Add ace-window to s-w
And get the commands more in line with my hydra. Less to think about.
This commit is contained in:
parent
595d435789
commit
5a26d457a7
1 changed files with 24 additions and 36 deletions
|
@ -351,10 +351,6 @@ Why would I ever quit Emacs with a simple keybinding? Let’s override it:
|
|||
#+begin_src emacs-lisp
|
||||
(global-set-key (kbd "s-q") 'bury-buffer)
|
||||
#+end_src
|
||||
Oh, and let’s not close the frame, but instead, the window:
|
||||
#+begin_src emacs-lisp
|
||||
(global-set-key (kbd "s-w") 'delete-window)
|
||||
#+end_src
|
||||
** Undo
|
||||
I mean, I /always/ use ~C-/~ for [[help:undo][undo]] (and ~C-?~ for [[help:undo-redo][redo]]), but when I’m on the Mac, I need to cover my bases.
|
||||
|
||||
|
@ -789,36 +785,29 @@ And put it on the toggle menu:
|
|||
*** Window Operations
|
||||
While it comes with Emacs, I use [[https://www.emacswiki.org/emacs/WinnerMode][winner-mode]] to undo window-related changes:
|
||||
#+begin_src emacs-lisp
|
||||
(use-package winner
|
||||
:custom
|
||||
(winner-dont-bind-my-keys t)
|
||||
:config
|
||||
(winner-mode +1))
|
||||
(use-package winner
|
||||
:custom
|
||||
(winner-dont-bind-my-keys t)
|
||||
:config
|
||||
(winner-mode +1))
|
||||
#+end_src
|
||||
Use the [[https://github.com/abo-abo/ace-window][ace-window]] project to jump to any window you see:
|
||||
#+begin_src emacs-lisp
|
||||
(use-package ace-window)
|
||||
(use-package ace-window
|
||||
:bind ("s-w" . ace-window))
|
||||
#+end_src
|
||||
This package, bound to ~SPC w w~, also allows operations specified before choosing the window:
|
||||
- ~x~ - delete window
|
||||
- ~m~ - swap windows
|
||||
- ~M~ - move window
|
||||
- ~c~ - copy window
|
||||
- ~j~ - select buffer
|
||||
- ~n~ - select the previous window
|
||||
- ~u~ - select buffer in the other window
|
||||
- ~c~ - split window, either vertically or horizontally
|
||||
- ~v~ - split window vertically
|
||||
- ~b~ - split window horizontally
|
||||
- ~o~ - maximize current window
|
||||
- ~?~ - show these command bindings
|
||||
- ~x~ - delete window
|
||||
- ~m~ - swap windows, which allows you to place the current buffer in any other window
|
||||
- ~j~ - switch to a buffer in any other window
|
||||
- ~?~ - show the rest of the command bindings
|
||||
Keep in mind, these shortcuts work with more than two windows open. For instance, ~SPC w w x 3~ closes the "3" window.
|
||||
|
||||
To jump to a window even quicker, use the [[https://github.com/deb0ch/emacs-winum][winum package]]:
|
||||
#+begin_src emacs-lisp
|
||||
(use-package winum
|
||||
:config
|
||||
(winum-mode +1))
|
||||
(use-package winum
|
||||
:config
|
||||
(winum-mode +1))
|
||||
#+end_src
|
||||
And when creating new windows, why isn't the new window selected?
|
||||
#+begin_src emacs-lisp
|
||||
|
@ -834,9 +823,9 @@ This is nice since the window numbers are always present on a Doom modeline, but
|
|||
|
||||
The ~0~ key/window should be always associated with a project-specific tree window:
|
||||
#+begin_src emacs-lisp
|
||||
(add-to-list 'winum-assign-functions
|
||||
(lambda ()
|
||||
(when (string-match-p (buffer-name) ".*\\*NeoTree\\*.*") 10)))
|
||||
(add-to-list 'winum-assign-functions
|
||||
(lambda ()
|
||||
(when (string-match-p (buffer-name) ".*\\*NeoTree\\*.*") 10)))
|
||||
#+end_src
|
||||
|
||||
Let's try this out with a Hydra since some I can /repeat/ some commands (e.g. enlarge window). It also allows me to organize the helper text.
|
||||
|
@ -845,17 +834,16 @@ Let's try this out with a Hydra since some I can /repeat/ some commands (e.g. en
|
|||
:config
|
||||
(defhydra hydra-window-resize (:color blue :hint nil) "
|
||||
_w_: select _n_: new _^_: taller (t) _z_: Swap _+_: text larger
|
||||
_c_: cycle _d_: delete _V_: shorter (T) _u_: undo _-_: text smaller
|
||||
_j_: go up _=_: balance _>_: wider _U_: undo+ _F_: font larger
|
||||
_k_: down _m_: maximize _<_: narrower _r_: redo _f_: font smaller
|
||||
_h_: left _s_: h-split _e_: balanced _R_: redo+ _0_: toggle neotree
|
||||
_c_: cycle _x_: delete _V_: shorter (T) _u_: undo _-_: text smaller
|
||||
_j_: go up _e_: balance _>_: wider _U_: undo+ _F_: font larger
|
||||
_k_: down _o_: maximize _<_: narrower _r_: redo _f_: font smaller
|
||||
_h_: left _b_: h-split _e_: balanced _R_: redo+ _0_: toggle neotree
|
||||
_l_: right _v_: v-split _o_: choose by number (also 1-9)
|
||||
"
|
||||
("w" ace-window)
|
||||
("c" other-window)
|
||||
("=" balance-windows)
|
||||
("m" delete-other-windows)
|
||||
("d" delete-window)
|
||||
("o" delete-other-windows)
|
||||
("x" delete-window)
|
||||
("D" ace-delete-window)
|
||||
|
||||
("z" ace-swap-window)
|
||||
|
@ -872,7 +860,7 @@ Let's try this out with a Hydra since some I can /repeat/ some commands (e.g. en
|
|||
("l" evil-window-right)
|
||||
("o" other-window)
|
||||
|
||||
("s" evil-window-split)
|
||||
("b" evil-window-split)
|
||||
("v" evil-window-vsplit)
|
||||
|
||||
("F" font-size-increase :color pink)
|
||||
|
|
Loading…
Reference in a new issue