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

Update Editors/_emacs, Editors/README.md files

parent 77ce200e
No related branches found
No related tags found
No related merge requests found
......@@ -57,150 +57,8 @@ This is another major editor that is available on all unix (linux) machines as w
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.
There are tons of options and customizations in the `~/.emacs` file, which is here [](_emacs)
There are much more things that can be added to `~/.emacs` if you want. Have a look at [CategoryDotEmacs](https://www.emacswiki.org/emacs/CategoryDotEmacs).
## IDEs
......@@ -240,3 +98,12 @@ This is perfect for python development. However, remote development is not suppo
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.
## Joplin
![](https://upload.wikimedia.org/wikipedia/en/thumb/0/08/Joplin-icon.svg/240px-Joplin-icon.svg.png)
Download: [Joplin](https://joplinapp.org)
Joplin is a free, open source note taking and to-do application, which can handle a large number of notes organised into notebooks. The notes are searchable, can be copied, tagged and modified either from the applications directly or from your own text editor. The notes are in Markdown format.
It can be synced with your u:cloud account using webdav with `Joplin` as the directory in your u:cloud and this as url `https://ucloud.univie.ac.at/remote.php/webdav/Joplin`, using your u:account credentials.
;; 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment