Skip to content
Snippets Groups Projects
Commit 5823550c authored by Michael Blaschek's avatar Michael Blaschek :bicyclist:
Browse files

Update Editors/README.md, Editors/VIM-Reference.pdf, Editors/Emacs-Reference.pdf files

parent afc1732f
No related branches found
No related tags found
No related merge requests found
File added
# Editors for development
Here one can find some help on getting started with some editors or usefull configurations or packages to use.
Here one can find some help on getting started with some editors or useful configurations or packages to use.
If you have a nice addition please try to submit it.
If you have a nice addition please submit it (create an issue).
Thanks.
Thanks. :elephant:
List of Editors:
- Vim
- Emacs
- Gedit
- Atom
- VS-Code
- Pycharm
[[_TOC_]]
## Vim
![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9f/Vimlogo.svg/64px-Vimlogo.svg.png)
Vim (a contraction of Vi IMproved) is a clone, with additions, of Bill Joy's vi text editor program for Unix.
This is a very basic editor, in terms of user interface. Functionality is huge. Make yourself comfortable with the [keyboard shortcuts](VIM-Reference.pdf) otherwise you will be stuck. This editor or its relative `vi` is present on any unix system (or linux).
Install: e.g Ubuntu (Debian) [VIM](https://wiki.ubuntuusers.de/VIM/)
Alternative: [VIM](https://www.vim.org/)
Some useful VIM modifications in `~/.vimrc` :
```vim
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
" Make sure we can use backspace delete
noremap! <C-?> <C-h>
" These lines setup the environment to show graphics and colors correctly.
set laststatus=2
set t_Co=256
```
on SRVX2 and JET you can use `:term` inside vim to split the view into a terminal and an editor. Switch between windows with `CTRL+w`.
Another super useful command is `vimdiff [file1] [file2]` to compare two files and show differences between these two. Switch between sides with `CTRL+w` and use the following shortcuts to:
```
]c : - next difference
[c : - previous difference
do - diff obtain
dp - diff put
zo - open folded text
zc - close folded text
:diffupdate - re-scan the files for differences
```
## Emacs
![](https://www.gnu.org/software/emacs/images/emacs.png)
This is another major editor that is available on all unix (linux) machines as well. It has a commandline interface and a gui. It is much easier than VIM, but again has a lot of [shortcuts](Emacs-Reference.pdf) to learn.
Install: [Emacs](https://www.gnu.org/software/emacs/)
There are tons of options and customizations in the `~/.emacs` file:
```
;; set the title
(setq-default frame-title-format "%b (%f)")
;; allow to get recent files
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; backup settings ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; https://www.emacswiki.org/emacs/BackupFiles
(setq
backup-by-copying t ; don't clobber symlinks
kept-new-versions 10 ; keep 10 latest versions
kept-old-versions 0 ; don't bother with old versions
delete-old-versions t ; don't ask about deleting old versions
version-control t ; number backups
vc-make-backup-files t) ; backup version controlled files
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; backup every save ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; http://stackoverflow.com/questions/151945/how-do-i-control-how-emacs-makes-backup-files
;; https://www.emacswiki.org/emacs/backup-each-save.el
(defvar bjm/backup-file-size-limit (* 5 1024 1024)
"Maximum size of a file (in bytes) that should be copied at each savepoint.
If a file is greater than this size, don't make a backup of it.
Default is 5 MB")
(defvar bjm/backup-location (expand-file-name "~/.emacs.d/backups")
"Base directory for backup files.")
(defvar bjm/backup-trash-dir (expand-file-name "~/.Trash")
"Directory for unwanted backups.")
(defvar bjm/backup-exclude-regexp "\\[Gmail\\]"
"Don't back up files matching this regexp.
Files whose full name matches this regexp are backed up to `bjm/backup-trash-dir'. Set to nil to disable this.")
;; Default and per-save backups go here:
;; N.B. backtick and comma allow evaluation of expression
;; when forming list
(setq backup-directory-alist
`(("" . ,(expand-file-name "per-save" bjm/backup-location))))
;; add trash dir if needed
(if bjm/backup-exclude-regexp
(add-to-list 'backup-directory-alist `(,bjm/backup-exclude-regexp . ,bjm/backup-trash-dir)))
(defun bjm/backup-every-save ()
"Backup files every time they are saved.
Files are backed up to `bjm/backup-location' in subdirectories \"per-session\" once per Emacs session, and \"per-save\" every time a file is saved.
Files whose names match the REGEXP in `bjm/backup-exclude-regexp' are copied to `bjm/backup-trash-dir' instead of the normal backup directory.
Files larger than `bjm/backup-file-size-limit' are not backed up."
;; Make a special "per session" backup at the first save of each
;; emacs session.
(when (not buffer-backed-up)
;;
;; Override the default parameters for per-session backups.
;;
(let ((backup-directory-alist
`(("." . ,(expand-file-name "per-session" bjm/backup-location))))
(kept-new-versions 3))
;;
;; add trash dir if needed
;;
(if bjm/backup-exclude-regexp
(add-to-list
'backup-directory-alist
`(,bjm/backup-exclude-regexp . ,bjm/backup-trash-dir)))
;;
;; is file too large?
;;
(if (<= (buffer-size) bjm/backup-file-size-limit)
(progn
(message "Made per session backup of %s" (buffer-name))
(backup-buffer))
(message "WARNING: File %s too large to backup - increase value of bjm/backup-file-size-limit" (buffer-name)))))
;;
;; Make a "per save" backup on each save. The first save results in
;; both a per-session and a per-save backup, to keep the numbering
;; of per-save backups consistent.
;;
(let ((buffer-backed-up nil))
;;
;; is file too large?
;;
(if (<= (buffer-size) bjm/backup-file-size-limit)
(progn
(message "Made per save backup of %s" (buffer-name))
(backup-buffer))
(message "WARNING: File %s too large to backup - increase value of bjm/backup-file-size-limit" (buffer-name)))))
;; add to save hook
(add-hook 'before-save-hook 'bjm/backup-every-save)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; autosave settings ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setq auto-save-file-name-transforms
`((".*" "~/.emacs.d/saves" t)))
;; auto save often
;; save every 20 characters typed (this is the minimum)
(setq auto-save-interval 20)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; cutoms settings ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(font-lock-global-modes t)
'(global-font-lock-mode t nil (font-lock))
'(global-linum-mode t)
'(inhibit-startup-screen t)
'(ps-lpr-command "kprinter")
'(ps-lpr-switches (quote ("-stdin")))
'(ps-printer-name-option "")
'(scroll-bar-mode (quote right))
'(speedbar-show-unknown-files t))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "ghost white" :foreground "#000000" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 121 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))))
(set-background-color "ghost white")
(put 'downcase-region 'disabled nil)
; (speedbar 1)
```
There are much more things that can be added to `~/.emacs` if you want.
## IDEs
### Atom
![](https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Atom_icon.svg/150px-Atom_icon.svg.png)
Atom is a free and open-source text and source code editor for macOS, Linux, and Microsoft Windows with support for plug-ins written in JavaScript, and embedded Git Control, developed by GitHub. Atom is a desktop application built using web technologies.
Install: [Atom](https://atom.io/)
This editor can do everything, as it is open source and solutions on common problems exist on github. However, it is for more advanced users, as sometimes you need to change things and fix small bugs.
### VS-Code
![](https://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Visual_Studio_Code_1.35_icon.svg/100px-Visual_Studio_Code_1.35_icon.svg.png)
Visual Studio Code is a freeware source-code editor made by Microsoft for Windows, Linux and macOS. Features include support for debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git. Microsoft has released Visual Studio Code's source code on the `microsoft/vscode` (Code - OSS) repository of GitHub, under the permissive MIT License, while the releases by Microsoft are freeware.
Install: [VS-Code (Microsoft)](https://code.visualstudio.com/)
Open-Source: [OSS](https://github.com/microsoft/vscode)
This is a great editor and has some nice features for Python, however PyCharm is much better for Python. A great feature is remote development. Using VS-code with remote development on SRVX1 or SRVX8 can be done using [instructions](vscode.md) and using a [singularity](https://sylabs.io/guides/3.7/user-guide/) container.
### Pycharm
![](https://upload.wikimedia.org/wikipedia/commons/thumb/1/1d/PyCharm_Icon.svg/150px-PyCharm_Icon.svg.png)
PyCharm is an integrated development environment (IDE) used in computer programming, specifically for the Python language. It is developed by the Czech company JetBrains. It provides code analysis, a graphical debugger, an integrated unit tester, integration with version control systems (VCSes), and supports web development with Django as well as data science with Anaconda.
PyCharm is cross-platform, with Windows, macOS and Linux versions. The Community Edition is released under the Apache License, and there is also Professional Edition with extra features – released under a proprietary license.
Install: [Pycharm Community](https://www.jetbrains.com/de-de/pycharm/)
This is perfect for python development. However, remote development is not supported by the community version and running it via VNC works.
## Meld
![](https://media-cdn.ubuntu-de.org/wiki/attachments/19/03/meld_logo.png)
Download: [Meld](https://meldmerge.org/)
Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects. It provides **two- and three-way** comparison of both files and directories, and has support for many popular version control systems.
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment