Refine hippie-expand config
This commit is contained in:
parent
a1d520c8aa
commit
df76ad127d
27
config.org
27
config.org
|
@ -1485,26 +1485,43 @@ By default, it completes (in order):
|
||||||
+ Dabbrev (kill ring)
|
+ Dabbrev (kill ring)
|
||||||
+ Known elisp symbols
|
+ Known elisp symbols
|
||||||
|
|
||||||
I find that "previous lines" completions often appear when I actually want a
|
I find that ~try-expand-line~ completions often appear when I actually want a
|
||||||
dabbrev completion, so let's deprioritise it somewhat. If I actually want to try
|
dabbrev completion, so let's deprioritise it somewhat. If I actually want to try
|
||||||
for a line expansion, it's fairly easy to deliberately trigger it --- just
|
for a line expansion, it's fairly easy to deliberately trigger it --- just
|
||||||
invoke ~hippie-expand~ after typing a space and there will be no dabbrev
|
invoke ~hippie-expand~ after typing a space and there will be no dabbrev
|
||||||
candidates.
|
candidates.
|
||||||
|
|
||||||
|
Speaking of dabbrev, I do think of hippie-expand mostly as "a stangely named
|
||||||
|
dabbrev+", so let's prioritise the dabbrev-related expanders a bit. I'll also
|
||||||
|
toss in a nice non-default expansion generator as the first dabbrev candidate
|
||||||
|
function: ~try-expand-dabbrev-visible~.
|
||||||
|
|
||||||
|
There's another cool source of multi-word expansion (actually multi-line) that
|
||||||
|
isn't used by default, ~try-expand-dabbrev-from-kill~. I personally think this one
|
||||||
|
is quite neat, but don't want it to interfere with more common single-word
|
||||||
|
completions, and so will place it just above ~try-expand-line~.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq hippie-expand-try-functions-list
|
(setq hippie-expand-try-functions-list
|
||||||
'(try-complete-file-name-partially
|
'(try-expand-list
|
||||||
try-complete-file-name
|
try-expand-dabbrev-visible
|
||||||
try-expand-all-abbrevs
|
|
||||||
try-expand-list
|
|
||||||
try-expand-dabbrev
|
try-expand-dabbrev
|
||||||
|
try-expand-all-abbrevs
|
||||||
try-expand-dabbrev-all-buffers
|
try-expand-dabbrev-all-buffers
|
||||||
|
try-complete-file-name-partially
|
||||||
|
try-complete-file-name
|
||||||
try-expand-dabbrev-from-kill
|
try-expand-dabbrev-from-kill
|
||||||
|
try-expand-whole-kill
|
||||||
try-expand-line
|
try-expand-line
|
||||||
try-complete-lisp-symbol-partially
|
try-complete-lisp-symbol-partially
|
||||||
try-complete-lisp-symbol))
|
try-complete-lisp-symbol))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Unfortunately there's one aspect of ~try-expand-dabbrev-from-kill~ that I find
|
||||||
|
lets me down a bit, which is that it fails to complete when the killed text
|
||||||
|
starts with a newline and the current line does not. I'll see if I can do
|
||||||
|
something about this in the future.
|
||||||
|
|
||||||
*** Buffer defaults
|
*** Buffer defaults
|
||||||
|
|
||||||
I'd much rather have my new buffers in ~org-mode~ than ~fundamental-mode~, hence
|
I'd much rather have my new buffers in ~org-mode~ than ~fundamental-mode~, hence
|
||||||
|
|
Loading…
Reference in New Issue