Answers for "Make views automatic and avoid error "no file ..." neovim"

0

Make views automatic and avoid error "no file ..." neovim

augroup myView 
    autocmd!
    autocmd BufWinLeave *.* mkview
    autocmd BufWinEnter *.* silent! loadview
  augroup END
  " the '!' mark helped me get rid of the error on startup
  
" and if you want to be more explicit make custom function
" assuming your error code is E484 eg:
" Error detected while processing BufWinEnter Autocommands for "*":
" E484: Can't open file /home/jan/.local/share/nvim/view/~=+index=
  
 function! LoadView() abort
    try
        loadview
    catch /E484/
        return
    endtry
 endfunction

autocmd BufWinEnter * call LoadView()
Posted by: Guest on January-22-2021

Code answers related to "Make views automatic and avoid error "no file ..." neovim"

Browse Popular Code Answers by Language