NoPaste

buhtz's emacs init.el

von buhtz

SNIPPET_TEXT:
  1. ;; =================
  2. ;; Package setup
  3. ;; =================
  4. (require 'package)
  5. (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
  6.  
  7. ;; Initializes the package infrastructure
  8. (package-initialize)
  9.  
  10. ;; If there are no archived package contents, refresh them
  11. (when (not package-archive-contents)
  12.   (package-refresh-contents))
  13.  
  14. ;; Install packages
  15. ;; (notice: Pythons-stuff as elpy or flycheck are installed via apt-get install elpa-elpy)
  16. (defvar myPackages
  17.   '(better-defaults
  18.     recentf
  19.     init-open-recentf
  20.     evil
  21.     material-theme
  22.     smooth-scrolling
  23.     )
  24.   )
  25.  
  26. ;; Scans the list in myPackages
  27. ;; Install the package if not already installed
  28. (mapc #'(lambda (package)
  29.           (unless (package-installed-p package)
  30.             (package-install package)))
  31.       myPackages)
  32.  
  33. ;; =====================
  34. ;; Emacs basic setup
  35. ;; ====================
  36. (setq inhibit-startup-message t)    ;; Hide the startup message
  37. (load-theme 'material t)            ;; Load material theme
  38. (global-linum-mode t)               ;; Enable line numbers globally
  39. (setq linum-format "%d ")
  40. (setq line-number-mode t)           ;; Line number in status bar
  41. (setq column-number-mode t)         ;; Column number in status bar
  42. (setq make-backup-files nil)        ;; No backup files
  43. (scroll-bar-mode nil)               ;; No scroll bar
  44. (tool-bar-mode nil)                 ;; no toolbar
  45. (transient-mark-mode t)             ;; Textmarkierung sichtbar
  46. (setq x-stretch-cursor t)           ;; stretch cursor on tabs
  47. ;; automatic line wrap
  48. (setq-default auto-fill-function 'do-auto-fill) ;; automatic line wrap
  49. (setq-default fill-column 78)       ;; wrap at max 78th char
  50. ;;(global-set-key (kbd "C-c q") 'auto-fill-mode) ;; toggle auto fill mode
  51. (global-hl-line-mode 1)
  52. ;;
  53. (require 'smooth-scrolling)
  54. (smooth-scrolling-mode 1)
  55. ;;(setq smooth-scroll-margin 3)
  56.  
  57. ;; ==========
  58. ;; Evil mode
  59. ;; ==========
  60. (evil-mode 1)         ;; vi keys on emacs
  61.  
  62. ;; =============
  63. ;; Recent files
  64. ;; =============
  65. (recentf-mode 1)
  66. (setq recentf-max-menu-items 25)
  67. (setq recentf-max-saved-items 25)
  68. (global-set-key "\C-x\ \C-r" 'recentf-open-files)  ;; C-x C-r to open recent files
  69. (run-at-time nil (* 5 60) 'recentf-save-list)  ;; auto-save recent fileslist every 5 minutes
  70. (init-open-recentf)
  71.  
  72. ;; ===============
  73. ;; Python setup
  74. ;; ===============
  75. ;; Enable elpy
  76. (elpy-enable)
  77.  
  78. ;; deactivate virtuelenv
  79. (setq elpy-rpc-virtualenv-path 'current)
  80.  
  81. ;; folding
  82. (add-hook 'python-mode-hook 'hs-minor-mode)
  83.  
  84. ;; ===============
  85. ;; Misc
  86. ;; ===============
  87. ;; folding
  88.  
  89. ;; ================
  90. ;; Custom
  91. ;; ================
  92. (custom-set-variables
  93.  ;; custom-set-variables was added by Custom.
  94.  ;; If you edit it by hand, you could mess it up, so be careful.
  95.  ;; Your init file should contain only one such instance.
  96.  ;; If there is more than one, they won't work right.
  97.  '(package-selected-packages
  98.    (quote
  99.     (smooth-scrolling material-theme evil better-defaults yasnippet-snippets elpy))))
  100. (custom-set-faces
  101.  ;; custom-set-faces was added by Custom.
  102.  ;; If you edit it by hand, you could mess it up, so be careful.
  103.  ;; Your init file should contain only one such instance.
  104.  ;; If there is more than one, they won't work right.
  105.  )

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN