dotfiles icon indicating copy to clipboard operation
dotfiles copied to clipboard

Error detected while processing /home/samuelodan/.vimrc: (E121: Undefined variable: g:has_async)

Open Samuelodan opened this issue 3 years ago • 2 comments

image

  if g:has_async autocmd VimEnter * \ set updatetime=1000 |                      
      \ let g:ale_lint_on_text_changed = 0                                       
      autocmd CursorHold * call ale#Queue(0)                                       
      autocmd CursorHoldI * call ale#Queue(0)                                      
       autocmd InsertEnter * call ale#Queue(0)                                      
       autocmd InsertLeave * call ale#Queue(0)                                      
   else                                                                           
       echoerr "The thoughtbot dotfiles require NeoVim or Vim 8"                    
  endif                                                                          
 augroup END

Hi, I get this error whenever I load vim, and that's the offending block (the first line more specifically. Thanks.

Samuelodan avatar Aug 10 '22 19:08 Samuelodan

Hi @Samuelodan that variable is defined in the ~/.vimrc.bundles file that is included on line 26 of the .vimrc https://github.com/thoughtbot/dotfiles/blob/65cc8ef0848805395a8d21c9cb7d077874dd430d/vimrc.bundles#L13 https://github.com/thoughtbot/dotfiles/blob/65cc8ef0848805395a8d21c9cb7d077874dd430d/vimrc#L25-L27 It's possible the .vimrc.bundles isn't being loaded for some reason so the variable isn't defined before it's used in the conditional that's raising the error. Do you have a .vimrc.bundles file in your home directory?

danielnolan avatar Sep 20 '22 17:09 danielnolan

Apologies for the delayed response. I don't have vimrc.bundles I think I just copied all the text from the .vimrc file and pasted in my file. I've not yet learned to separate the files.

Samuelodan avatar Sep 25 '22 16:09 Samuelodan

It's best to follow the install instructions so that all of the files needed are symlinked into your home directory. If you don't want to install everything you could try copying the contents of vimrc.bundles to a file in your home directory called .vimrc.bundles.

danielnolan avatar Mar 08 '23 19:03 danielnolan