Personal emacs config
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.6 KiB

  1. * Editing
  2. ** Hippie expand
  3. #+BEGIN_SRC emacs-lisp
  4. (use-package hippie-exp
  5. :bind ("M-/" . hippie-expand))
  6. #+END_SRC
  7. ** IEdit mode
  8. #+BEGIN_SRC emacs-lisp
  9. (use-package iedit
  10. :bind ("C-;" . iedit-mode))
  11. #+END_SRC
  12. ** Line numbers
  13. #+BEGIN_SRC emacs-lisp
  14. (global-display-line-numbers-mode)
  15. #+END_SRC
  16. * Unix buffer things
  17. ** Platform fixes
  18. ** Key bindings
  19. ** Custom features/Monkey patches
  20. * Major modes
  21. ** Java
  22. ** JavaScript
  23. ** Magit
  24. #+BEGIN_SRC emacs-lisp
  25. (use-package magit
  26. :bind (("C-x g" . magit-status))
  27. :config
  28. (use-package git-commit
  29. :hook (git-commit-setup . git-commit-turn-on-flyspell)))
  30. #+END_SRC
  31. ** Python
  32. *** Platform specific
  33. #+BEGIN_SRC emacs-lisp
  34. (cond
  35. ((string-equal system-type "gnu/linux")
  36. "python3")
  37. ((string-equal system-type "windows-nt")
  38. "python.exe"))
  39. #+END_SRC
  40. *** custom feature
  41. *** bindings/settings
  42. #+begin_src emacs-lisp
  43. (use-package python
  44. :config
  45. (use-package elpy
  46. :bind (("C-=" . elpy-goto-assignment))
  47. :config (when (require 'flycheck nil t)
  48. (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))))
  49. (elpy-enable)
  50. (blacken-mode))
  51. #+END_SRC
  52. ** SSH config mode
  53. #+BEGIN_SRC emacs-lisp
  54. (use-package ssh-config-mode
  55. :mode "~/.ssh/config\\'")
  56. #+END_SRC
  57. ** Tramp
  58. ** Webmode
  59. ** YAML
  60. #+BEGIN_SRC emacs-lisp
  61. (use-package yaml-mode
  62. :mode "\\.yml\\'")
  63. #+END_SRC
  64. * Minor modes/misc
  65. ** IBuffer mode
  66. #+BEGIN_SRC emacs-lisp
  67. (use-package ibbufer-vc
  68. :hook ((ibuffer-mode . ibuffer-vc-set-filter-groups-by-vc-root)))
  69. (use-package ibuffer
  70. :bind (("C-x C-b" . ibuffer))
  71. :config
  72. (define-ibuffer-column size-h
  73. ;; Use human readable Size column instead of original one
  74. (:name "Size" :inline t)
  75. (cond ((> (buffer-size) 1000000)
  76. (format "%7.1fM" (/ (buffer-size) 1000000.0)))
  77. ((> (buffer-size) 100000)
  78. (format "%7.0fk" (/ (buffer-size) 1000.0)))
  79. ((> (buffer-size) 1000)
  80. (format "%7.1fk" (/ (buffer-size) 1000.0)))
  81. (t
  82. (format "%8d" (buffer-size))))))
  83. #+END_SRC
  84. ** Ivy
  85. #+BEGIN_SRC emacs-lisp
  86. (use-package ivy-mode
  87. :config
  88. (use-package swiper
  89. :bind ("C-s" . swiper)))
  90. #+END_SRC
  91. ** Kill the things
  92. *** Buffer
  93. #+BEGIN_SRC emacs-lisp
  94. (global-set-key (kbd "C-x k") 'kill-this-buffer)
  95. #+END_SRC
  96. *** Emacs
  97. #+BEGIN_SRC emacs-lisp
  98. (global-set-key (kbd "C-x C-k C-x C-k") 'kill-emacs)
  99. #+END_SRC
  100. ** Lispy
  101. #+BEGIN_SRC emacs-lisp
  102. (use-package lispy
  103. :hook ((emacs-lisp-mode) . lispy-mode))
  104. #+END_SRC
  105. ** Window numbering mode
  106. #+BEGIN_SRC emacs-lisp
  107. (use-package window-numbering
  108. :config
  109. (window-numbering-mode))
  110. #+END_SRC