Error:
Error detected while processing BufWinEnter Autocommands for "*"..function <SNR>3_LocalVimRC[322]..BufWinEnter Autocommands for "*"..function <SNR>3_LocalVimRC:
line 263:
E654: missing delimiter after search pattern: Vim\%((\a\+)\)\=:E48
I've re-installed vim using brew install vim
and I've moved all vim configs and the folder to backups.
Results from running :scriptnames
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim82/defaults.vim
3: ~/.vim/plugin/localvimrc.vim
4: /usr/share/vim/vim82/plugin/getscriptPlugin.vim
5: /usr/share/vim/vim82/plugin/gzip.vim
6: /usr/share/vim/vim82/plugin/logiPat.vim
7: /usr/share/vim/vim82/plugin/manpager.vim
8: /usr/share/vim/vim82/plugin/matchparen.vim
9: /usr/share/vim/vim82/plugin/netrwPlugin.vim
10: /usr/share/vim/vim82/plugin/rrhelper.vim
11: /usr/share/vim/vim82/plugin/spellfile.vim
12: /usr/share/vim/vim82/plugin/tarPlugin.vim
13: /usr/share/vim/vim82/plugin/tohtml.vim
14: /usr/share/vim/vim82/plugin/vimballPlugin.vim
15: /usr/share/vim/vim82/plugin/zipPlugin.vim
I haven't touched any of the above files.
If I move my vimrc file back and run :PlugInstall, i get the following error:
:PlugInstall
Error detected while processing function <SNR>10_install[1]..<SNR>10_update_impl[53]..<SNR>10_prepare[18]..<SNR>10_new_window[1]..BufWinEnter Autocommands for "*"..function <SNR>19_LocalVimRC[322]..function <SNR>
10_install[1]..<SNR>10_update_impl[53]..<SNR>10_prepare[18]..<SNR>10_new_window[1]..BufWinEnter Autocommands for "*"..function <SNR>19_LocalVimRC:
line 263:
E654: missing delimiter after search pattern: Vim\%((\a\+)\)\=:E48
Error detected while processing function <SNR>10_install[1]..<SNR>10_update_impl[53]..<SNR>10_prepare:
line 18:
E171: Missing :endif
The most noticable thing I'm missing is nerdtree.
Here's my vimrc file, although i don't think vim is even getting that far:
" Set compatibility to Vim only.
set nocompatible
" Helps force plug-ins to load correctly when it is turned back on below.
filetype off
" Turn on syntax highlighting.
syntax on
" Just... required for colours. Should be default in vim -.-
set t_Co=256
set termguicolors
" Tells vim that you want a dark colour scheme (just a setting, doesn't affect background)
set background=dark
" For plug-ins to load correctly.
filetype plugin indent on
" tab length
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
" expected backspace behaviour
set backspace=indent,eol,start
" Display 5 lines above/below the cursor when scrolling with a mouse.
set scrolloff=5
" Speed up scrolling in Vim
set ttyfast
" set line number
set number
" Encoding
set encoding=utf-8
" Highlight matching search patterns
set hlsearch
" speed up redrawing with all the macros
set lazyredraw
" ignore these files for things
set wildignore+=*/node_modules/*,*.swp,
" display cursor line in status
set cursorline
" split new windows to bottom and right
set splitright
set splitbelow
" set font
set guifont=Menlo\ Regular:h18
" more buffer history
set history=100
"~~Persistent Undo~~"
let vimDir = '$HOME/.vim'
let &runtimepath.=','.vimDir
" Keep undo history across sessions by storing it in a file
if has('persistent_undo')
let myUndoDir = expand(vimDir . '/undodir')
" Create dirs
call system('mkdir ' . vimDir)
call system('mkdir ' . myUndoDir)
let &undodir = myUndoDir
set undofile
endif
"~~~~~~~~~~~~~~~~~~~"
" ~~~ home row movement ~~~ "
" ~~~~~~~~~~~~~~~~~~~~~~~~~ "
noremap ; l
noremap l k
noremap k j
noremap j h
" ~~~ moving windows with z ~~~ "
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "
noremap zj <C-W><Left>
noremap zk <C-W><Down>
noremap zl <C-W><Up>
noremap z; <C-W><Right>
" ~~~ shortcuts! ~~~ "
" ~~~~~~~~~~~~~~~~~~ "
let mapleader=","
call plug#begin('~/.vim/plugged')
" Linting
Plug 'w0rp/ale'
" Language plugins
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'tikhomirov/vim-glsl'
Plug 'leafgarland/typescript-vim'
Plug 'elzr/vim-json'
Plug 'stephpy/vim-yaml'
Plug 'udalov/kotlin-vim'
" command plugins
Plug 'tpope/vim-fugitive'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tpope/vim-commentary' " gc to comment out a line
" UI plugins
Plug 'luochen1990/rainbow'
Plug 'airblade/vim-gitgutter'
Plug 'vim-airline/vim-airline'
Plug 'ap/vim-css-color'
Plug 'nathanaelkane/vim-indent-guides'
" Utility
Plug 'scrooloose/nerdtree'
call plug#end()
" Use JSX syntax highlighting in TSX files
autocmd BufRead,BufNewFile *.tsx setlocal syntax=javascript.jsx
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
" rainbow brackets
let g:rainbow_active = 1
let g:indent_guides_enable_on_vim_startup = 1
let b:ale_fixers = {'javascript': ['eslint --ext .js,.ts,.jsx,.tsx']}
let g:ale_lint_delay = 500
let NERDTreeShowHidden=1
let g:NERDTreeDirArrowExpandable = '>'
let g:NERDTreeDirArrowCollapsible = 'v'
colorscheme meta5
" Commands to run at the beginning
autocmd VimEnter * if argc() == 0 | NERDTree | endif
autocmd VimEnter * if argc() == 0 | wincmd p | endif
Everything worked before the upgrade.
vim
and get this error (check withwhich vim
)? The next step would be to remove all of your config files and incrementally add them back in.<SNR>3_LocalVimRC
suggests the problem is on that~/.vim/plugin/localvimrc.vim
file of yours... What do you have in there? Particularly, on line 263 of that file? It's odd that it seems that file is being loaded before your vimrc... Usually, vimrc should be loaded first. Is there something unusual about the location of your vimrc file?plug.vim
installed somewhere and showing up in yourscriptnames
. If you took your vimrc out of the way, then what is configuring which plug-ins to install? You say thelocalvimrc.vim
file is being auto-generated, but there really isn't something that auto-generates such a file...~/.vim
out of the way, thatlocalvimrc.vim
file wouldn't be there, there's nothing that creates Vim files there AFAICT... In any case, I seem to have found the syntax error in that script, so I posted an answer about it.