Open yorickpeterse opened 6 years ago
Here's a somewhat clumsy recording to showcase this: https://asciinema.org/a/WzTx9FzTxWjScCQrYTQlKpPFK
This doesn't appear to happen when removing autocmd TermOpen * setlocal nonumber nornu
, but then you're left with line numbers enabled in terminal windows.
Note that this only happens when you open a split. If you open a file the normal way then rnu
is left as-is.
Neovim version v0.2.2-35-g30a21830d suffers from the same problem unfortunately.
You can somewhat work around this by doing the following:
Get rid of the autocmd TermOpen
, then add the following somewhere in your vimrc:
function! s:openTerm(vertical)
let cmd = a:vertical ? 'vnew' : 'new'
exec cmd
term
setlocal nonumber nornu
startinsert
endfunction
command! Term call s:openTerm(0)
command! Vterm call s:openTerm(1)
You can then open terminals using :Term
/ :Vterm
without line numbers, while FZF will continue to work as you'd expect.
@YorickPeterse can you try to restore your own config, but using the TerminalWinOpen
event instead? For example:
autocmd TerminalWinOpen * setlocal nonumber norelativenumber
This works for me to open terminal (even with ++curwin
) without line numbers without fzf.vim
messing with my line number config for buffers.
Using the latest version of neovim (0.2.1) it seems FZF still has some issues with disabling relative line numbers. To test this I used the following config:
The TermOpen autocmd is present to disable line numbers for terminal windows. Using this config (or my actual config for that matter) will result in relative line numbers being disabled when opening a split via FZF. For example:
rnu
is working:Files
and search for a file, then hit C-V to open a vertical splitrnu
is disabled and instead we're left with just regular line numbersThis is using fzf.vim commit 4b9e2a03fe8389da852b0059bd7d0dfffd380956 and fzf commit 2cd0d4a9f7a0a0a86c1ee70da9fb970ec18eac50.