New answers tagged

0

Realize this is really old, but for me, substituting WinEnter and WinLeave for FocusGained and FocusLost fixed the problem in my VIM terminal.


3

You can use a BufWinEnter event instead. That's a late event, which should happen after all the filetype detection and setup is finished. au BufWinEnter * set formatoptions-=o The docs in :help BufRead suggest possibly using this event: See BufWinEnter for when you need to do something after processing the modelines. While your case is not directly ...


2

It took a winding road to reach the root cause. Jump to the last/second update below to skip to the conclusion. Per :h FileType the FileType event doesn't do anything unless 'filetype' is set. The standard way to set that is to have this in your vimrc/init.vim: :filetype on This "enables file type detection". You don't have anything in your init.vim so ...


3

Update: neovim now (January 2020) supports perl as well as has('perl'). I update neovim very often to the latest development version, and I only noticed the feature today when running checkhealth. If you are using a stable version of neovim, you probably will not see support for perl yet.


0

The best solution for me: " Create a function to open a neovim terminal in a small split window and run python function! Termpy() exec winheight(0)/4."split" | terminal python3 % endfunction Then use the solution above to map it to your prefered key combination: " Press CTRL+R to run python script into separate term window nnoremap <C-R> :call ...


1

it looks like there's no option to configure that, but you can set the title by setting titlestring (for more info see :help titlestring). you can set titlestring on each buffer enter with: autocmd bufenter * let &titlestring = expand('%:p').' - NVIM' You use autocmd bufenter * to run something on each buffer enter, the asterisk means the file ...


1

I am using Neovim both on Linux, Mac and Windows. For terminal Neovim, it seems that ctrl + 6 works as expected for me. On Windows, Ctrl-6 does not work. FYI, the terminal I am using for different platform: Windows: nvim-qt Linux: mintty (Connected to remote Linux server via ssh) Mac: Either iterm2, Alacritty, Kitty works. For Neovim GUI client, you can ...


2

justinmk (current neovim leader?) states ctrl-6 only works by accident in some terminals. The actual builtin mapping is <C-^>. https://github.com/onivim/oni/issues/2002#issuecomment-377688787 There is also https://github.com/equalsraf/neovim-qt/issues/170 So it just doesn't work for neovim (nvim.exe and nvim-qt.exe) even though neovim help is ...


1

From :h terminal-start: When the terminal starts, the buffer contents are updated and the buffer is named in the form of term://{cwd}//{pid}:{cmd}. This naming scheme is used by |:mksession| to restore a terminal buffer (by restarting the {cmd}). Therefore you can not do this, unless you manually "swap" buffer names before :mksession and on autocmd ...


3

Popup menu in neovim-qt is controlled by GuiPopupmenu command. You should add it to you ginit.vim: GuiPopupmenu 0 PS: It is not documented that well, I've found it somewhere in github issues. You can also try look into neovim-qt shim layer to find out what else is there:


0

I found what the problem was. It was caused by a plugin: auxiliary/vim-layout I'm not sure why it causes such strange behavior, but I have uninstalled it and now my undo history works fine.


0

Is this a NeoVim bug, am I doing something wrong or is my configuration flawed? After further investigation this does not appear to be a NeoVim bug; therefore I must have been doing something wrong or had configuration snags. An issue was raised on the NeoVim repository, and subsequently closed as the bug could not be replicated. I subsequently booted up ...


0

vim-dispatch :Make instead of :make You cannot run the built-in command :make asynchronously in Vim8 or NeoVim. You have to take the value of 'makeprg' and insert it into vim8 job_start() or neovim jobstart(). I personally like the convenience of plugins which take care of vim8/neovim differences, parsing the result and inserting it into the quickfix/...


1

It's a hack, but you could try this: augroup filetype_nerdtree au! au FileType nerdtree call s:disable_lightline_on_nerdtree() au WinEnter,BufWinEnter,TabEnter * call s:disable_lightline_on_nerdtree() augroup END fu s:disable_lightline_on_nerdtree() abort let nerdtree_winnr = index(map(range(1, winnr('$')), {_,v -> getbufvar(winbufnr(v), ...


2

Vim 8.1.2250 does not ship with filetype detection for solidity. (One can confirm with :edit $VIMRUNTIME/filetype.vim and then :global /sol/.) ALE has Solidity linters, but they require the filetype to be set. The simplest solution is to create ~/.vim/ftdetect/solidity.vim and add au BufNewFile,BufRead *.sol setfiletype solidity However, this plugin ...


3

Of course, your attempt won't work, because Lightline forcefully updates status line content on many auto events. That's quite obvious from its code and was clearly stated by the author in the issues you've quoted. The only solution is to exclude some specific buffers from such update, but, again, as the author said he is not going to do so for several ...


0

I am using the same plugin here's my config "js syntax folding augroup javascript_folding au! au filetype javascript setlocal foldmethod=syntax augroup END let g:javascript_conceal_function = "ƒ" let g:javascript_conceal_null = "ø" let g:javascript_conceal_this = "@" let g:javascript_conceal_return = "⇚" let g:javascript_conceal_undefined = ...


Top 50 recent answers are included