#+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 * Prototyping #+begin_src emacs-lisp (defun mms-prototype-ruby (name) (interactive "sWhatcha workin on? ") (setq today (shell-command-to-string "echo -n $(date +%Y-%m-%d)")) (setq dir (concat mms-tmp-dir "/" name "-rb-" today "/")) (make-directory dir) (copy-file "~/.emacs.d/templates/spike-ruby.rb" (concat dir "run.rb")) (find-file (concat dir "run.rb")) (evil-window-vsplit) (eshell) (evil-window-left) ) #+end_src #+RESULTS: : mms-prototype-ruby * Aggresive intend #+begin_src emacs-lisp (use-package aggressive-indent :ensure t :config (global-aggressive-indent-mode 1)) #+end_src * Git #+begin_src emacs-lisp (use-package magit :ensure t) #+end_src