문제

In a previous post here - vim buffer Trying char-by-char conversion - I was running into a problem when opening up certain files and vim wasn't able to detect the encodings in that file and this was resolved by the solution provided by Ingo.

But after I installed vim's NERDTree plugin, I am running into the same problem again.

It appears that buffer opened by NERDTree mapping map <F2> :NERDTreeToggle<CR> does not obey the :set encoding=utf-8 directive.

I have to manually run :set encoding=utf-8 again in order for the Trying char~by-char conversion... problem to be resolved.

Also, my nerdtree directory shows up with a weird ? instead of the | symbol. Like this:- enter image description here

What am I doing wrong?

도움이 되었습니까?

해결책

I have temporarily solved this problem by mapping

map <F2> :NERDTreeToggle<CR>:set encoding=utf-8<CR>

instead of the original plain

map <F2> :NERDTreeToggle<CR>

However this solution is not good enough as the Trying char~by-char conversion warning still pops up whenever I browse open a specific directory in the NERDTree buffer.

So, I would like to hear if anyone has a better solution! Thanks!

The nerdtree ? character problem was solved by this post - vim - nerdtree suddenly broke

다른 팁

You shouldn't need to do anything: NERDTree doesn't manipulate encoding and encoding is a global option that you set once and for all in your ~/.vimrc. Go back to an almost empty ~/.vimrc and build from that (with encoding and other options).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top