认为这是我第一次遇到vimscript,我已经检查了插件代码。它有以下几行代码:
fu! ctrlp#init(type, ...)
if exists('s:init') || s:iscmdwin() | retu | en
let [s:ermsg, v:errmsg] = [v:errmsg, '']
let [s:matches, s:init] = [1, 1]
cal s:Reset(a:0 ? a:1 : {})
noa cal s:Open()
cal s:SetWD(a:0 ? a:1 : {})
gal s:MapNorms()
cal s:MapSpecs()
cal ctrlp#syntax()
cal ctrlp#setlines(s:settype(a:type))
cal s:SetDefTxt()
cal s:BuildPrompt(1)
if s:keyloop | cal s:KeyLoop() | en
endf
如果我在函数中放置colorscheme atom
或类似的东西,它会改变整个缓冲区的颜色方案,而不是只改变弹出窗口的颜色方案。有没有办法配置CtrlP使用单独的配色方案?当然,我并不打算将配置放到插件代码中,因此我也在寻找一种解决方案,使我能够将设置放入我的.vimrc
,例如使用{{{ 1}}。
答案 0 :(得分:7)
+1
用于查看源代码并实际尝试某些内容。
-1
,因为没有关注the plugin's documentation:
Highlighting:~
* For the CtrlP buffer:
CtrlPNoEntries : the message when no match is found (Error)
CtrlPMatch : the matched pattern (Identifier)
CtrlPLinePre : the line prefix '>' in the match window
CtrlPPrtBase : the prompt's base (Comment)
CtrlPPrtText : the prompt's text (|hl-Normal|)
CtrlPPrtCursor : the prompt's cursor when moving over the text (Constant)
* In extensions:
CtrlPTabExtra : the part of each line that's not matched against (Comment)
CtrlPBufName : the buffer name an entry belongs to (|hl-Directory|)
CtrlPTagKind : the kind of the tag in buffer-tag mode (|hl-Title|)
CtrlPqfLineCol : the line and column numbers in quickfix mode (Comment)
CtrlPUndoT : the elapsed time in undo mode (|hl-Directory|)
CtrlPUndoBr : the square brackets [] in undo mode (Comment)
CtrlPUndoNr : the undo number inside [] in undo mode (String)
CtrlPUndoSv : the point where the file was saved (Comment)
CtrlPUndoPo : the current position in the undo tree (|hl-Title|)
CtrlPBookmark : the name of the bookmark (Identifier)
Statuslines:~
* Highlight groups:
CtrlPMode1 : 'file' or 'path' or 'line', and the current mode (Character)
CtrlPMode2 : 'prt' or 'win', 'regex', the working directory (|hl-LineNr|)
CtrlPStats : the scanning status (Function)
<强> 修改 强>
看看你最喜欢的colorscheme,如果它写得很好,你应该找到一堆看起来像这样的线:
hi Whatever ctermbg=235 ctermfg=250 guibg=#262626 guifg=#bcbcbc cterm=NONE gui=NONE
您需要做的很简单:
Whatever
更改为CtrlPNoEntries
,如果您希望您的colorscheme是独立的,您需要在一个单独的文件中定义所有这些CtrlP高亮,这些文件将像任何其他插件一样加载,但在启动过程的后期:
~/.vim/after/plugin/mycolorscheme.vim