blob: 88b9966328e788b3f2f821280c39a1027c101acf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
#+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 taxy-magit-section
:ensure t)
#+end_src
#+begin_src emacs-lisp
(use-package magit
:after taxy-magit-section
:ensure t)
#+end_src
#+begin_src emacs-lisp
(use-package git-timemachine
:ensure t)
#+end_src
#+begin_src emacs-lisp
(use-package forge
:ensure t
:after magit)
#+end_src
|