Closed sooheon closed 9 years ago
There are two ways:
Initialize with global-vim-empty-lines-mode
and selectively turn it off for certain modes, using:
(add-hook 'eshell-mode-hook (lambda () (vim-empty-lines-mode -1))
(add-hook 'shell-mode-hook (lambda () (vim-empty-lines-mode -1))
Don't use the global initialization function, and use hooks to selectively call vim-empty-lines-mode
in relevant modes, e.g.:
(add-hook 'text-mode-hook 'vim-empty-lines-mode)
However, I should make it a bit more intelligent with the buffers where global-vim-empty-lines-mode
should be ignored. I'll have to read up a bit on how packages conventionally do this, but I'll treat this as a bug for now. As a temporary fix, I'd go with method 2. above.
Sorry, I think I misunderstood you.
Did you mean to say that this was a bug or just your preferrence? If it's the latter, I'll remove the bug label and refer to the commands above, which should do the trick.
Yep, these commands do the job, thanks. I think this issue can be closed, unless you want to keep it as a reminder for possible implementation of say a list of excluded global modes or something.
@sooheon I noticed that the code for selectively disabling the mode fails for shell-mode and eshell-mode if the corresponding shells haven't been previously loaded. Instead, run:
(eval-after-load 'esh-opt
(add-hook 'eshell-mode-hook (lambda () (vim-empty-lines-mode -1))))
(eval-after-load 'shell
(add-hook 'shell-mode-hook (lambda () (vim-empty-lines-mode -1))))
How can I be selective about which modes
global-vim-empty-lines-mode
initialises on?