summaryrefslogtreecommitdiff
path: root/mms-prog.org
diff options
context:
space:
mode:
authormms <michal@sapka.me>2024-01-19 15:22:13 +0100
committermms <michal@sapka.me>2024-01-19 15:22:13 +0100
commit9ab57ee255a03b86ed7303aa94959e3b104e1719 (patch)
tree926293dc6d9460f1eab12231573b71abc8d5ac4e /mms-prog.org
feat: extract into dedicated repo
Diffstat (limited to 'mms-prog.org')
-rw-r--r--mms-prog.org72
1 files changed, 72 insertions, 0 deletions
diff --git a/mms-prog.org b/mms-prog.org
new file mode 100644
index 0000000..9b45df0
--- /dev/null
+++ b/mms-prog.org
@@ -0,0 +1,72 @@
+#+TITLE: mms Emacs Config - Prog mode
+#+AUTHOR: MichaƂ Sapka (https://michal.sapka.me)
+#+STARTUP: showall indent logdoneGeneral settings
+
+#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/
+#+HUGO_WEIGHT: 400
+#+HUGO_SECTION: emacs/config
+#+HUGO_CATEGORIES: emacs emacs-config
+#+HUGO_MENU :menu "emacs-config" :name "Ruby"
+#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - Programmming"
+#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "Programming setup, generic"
+#+EXPORT_FILE_NAME: programming
+
+* General
+
+#+begin_src emacs-lisp
+ (global-display-line-numbers-mode) ; By default I want line number everywhere
+#+end_src
+* Auto-complete
+
+Auto-complete at point is almost all I want from a programmers editor.
+Luckily, =corfu= is am /amazing/ package for that
+
+#+begin_src emacs-lisp
+ (use-package corfu
+ :ensure t
+ ;; Optional customizations
+ :custom
+ ;; (corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
+ (corfu-auto t) ;; Enable auto completion
+ ;; (corfu-separator ?\s) ;; Orderless field separator
+ ;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary
+ ;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match
+ ;; (corfu-preview-current nil) ;; Disable current candidate preview
+ ;; (corfu-preselect 'prompt) ;; Preselect the prompt
+ ;; (corfu-on-exact-match nil) ;; Configure handling of exact matches
+ ;; (corfu-scroll-margin 5) ;; Use scroll margin
+
+ ;; Enable Corfu only for certain modes.
+ ;; :hook ((prog-mode . corfu-mode)
+ ;; (shell-mode . corfu-mode)
+ ;; (eshell-mode . corfu-mode))
+
+ ;; Recommended: Enable Corfu globally. This is recommended since Dabbrev can
+ ;; be used globally (M-/). See also the customization variable
+ ;; `global-corfu-modes' to exclude certain modes.
+ :init
+ (global-corfu-mode))
+#+end_src
+
+* Fast navigation
+
+This is not /strictly/ for prog, but quick buffer switch is great.
+At a certain point I might move this to general config.
+I use =consult= for the as-I-type propositions.
+
+#+begin_src emacs-lisp
+ (use-package consult
+ :ensure t)
+ #+end_src
+
+#+begin_src emacs-lisp
+ (with-eval-after-load 'general
+ (mms-leader-keys
+ "f g" '(lambda () (interactive) (consult-ripgrep)) :wk "Ripgrep"
+ "f i" '(lambda () (interactive) (consult-imenu)) :wk "Imenu"
+ "f F" '(lambda () (interactive) (consult-recent-file)) :wk "Recent file"
+ "f B" '(lambda () (interactive) (consult-bookmark)) :wk "Bookmark"
+ "f b" '(lambda () (interactive) (consult-buffer)) :wk "Buffer"
+ "f f" '(lambda () (interactive) (consult-find)) :wk "File"
+ ))
+#+end_src