我想对不同的文件类型使用不同的colorschemes,我在.vimrc中添加了以下代码
function SetColorScheme () if &filetype != "vo_base" colorscheme desertEx endif endfunction au WinEnter * call SetColorScheme()这适用于一个问题。
如果我打开.otl文件,说todo.otl(vo_base),然后打开另一个文件,比如example.xml,使用:sp colorscheme desertEx不会应用于第二个窗口(具有example.xml的窗口)。
如果我使用BufEnter而不是WinEnter而不是使用desertEx来应用于两个窗口。
有没有办法确保当我打开一个窗口时:sp上面的函数(a)运行,(b)只运行该特定窗口而不是当前会话中的所有窗口。
I want to used different colorschemes for different filetypes and I added the following code in my .vimrc
function SetColorScheme () if &filetype != "vo_base" colorscheme desertEx endif endfunction au WinEnter * call SetColorScheme()This works fine with one issue.
If I open a .otl file, say todo.otl (vo_base), and then open another file, say example.xml, using :sp the colorscheme desertEx does not get applied to the second window (the one having example.xml).
If I use BufEnter instead of WinEnter than desertEx gets applied to both the windows.
Is there a way to make sure that when I open a window with :sp the above function (a) runs, and (b) runs only for that particular window and not all the windows in the current session.
最满意答案
不,没有办法做到这一点。 在vim中,同时只能有一个活动的colorscheme。
No there's no way to do that. There can be only one active colorscheme at the same time in vim.
更多推荐
发布评论