machakann / vim-sandwich

Set of operators and textobjects to search/select/edit sandwiched texts.
1.44k stars 37 forks source link

Errors in Windows #140

Closed fhopecc closed 2 years ago

fhopecc commented 2 years ago

The Enviroment: Windows 10, gvim 8.2 (zh-tw language)

When I installed 'sandwich' with vim-plug, then restart gvim will report errors as following(including some Chinese chars) and shutdown gvim instantly:

處理 C:\Users\lgzhangjian\vimfiles\plugin\vim-sandwich\autoload\ope rator\sandwich\lib.vim 時發生錯誤: 行 85: E1122: Variable is locked: s:lib Failured at "operator-add:normal use #1" Expect: '((foo))' Got: 'aiwaiw(oo'

Howto resolve this problem?

machakann commented 2 years ago

I'm not very sure about your situation, but the error message tells one important thing. C:\Users\{username}\vimfiles\plugin is not the place to put repositories. Neither is the place to install plugins by vim-plug. I guess the plugin is misplaced accidentally. All the vim script files under the directory, I mean including tremendous test files, will be loaded when vim starts up. Probably, that's the reason why you got the message.

First, you should remove the directory C:\Users\{username}\vimfiles\plugin\vim-sandwich and all the files in it. Then, follow the instructions on installing vim plugins of vim-plug.

fhopecc commented 2 years ago

Thanks for yourhelp. I check out the vim-plug document and found the following warning:

" You can specify a custom plugin directory by passing it as the argument " - e.g. call plug#begin('~/.vim/plugged') " - Avoid using standard Vim directory names like 'plugin'

I has specified the custom plugin directory as standard Vim directory 'plugin'. After changed the custom plugin directory, this plugin is worked. Thank you