2014-12-21 1 views
0

vimscript를 처음 접하는 것은 처음이라고 생각합니다. 플러그인 코드를 확인했습니다. 나는 함수 내에서 같은 colorscheme atom 또는 뭔가를 넣어 경우는 팝업의 색상을 변경하는 대신 전체 버퍼의 색상을 변경,CtrlP 플러그인의 팝업에 별도의 색 구성표를 설정할 수 있습니까?

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 

: 그것은 다음 코드 줄이있다. 별도의 색 구성표를 사용하도록 CtrlP를 구성 할 수있는 방법이 있습니까? 물론, 나는 플러그인 코드에 설정을 넣으려고하지 않았다. 그래서 나는 에 설정을 넣을 수있는 해결책을 찾고있다. 예를 들어 autocmd을 사용하는 것이다. 소스보고 실제로 뭔가를 시도하기위한

+0

그것을 ctrlp 플러그인이 자체 색상 그룹을 지정하지 않으면 불가능합니다. 색상 체계는 기본적으로 서로 다른 색상 그룹에 대해서만 색상을 지정하는 정력 스크립트입니다. – EvergreenTree

답변

7

+1 . the plugin's documentation보고하지 않는

-1 :

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) 

편집

, 당신의 마음에 드는 색상 구성표를 살펴 보자가 유능하게 작성된 경우, 당신은 라인의 무리를 찾아야한다 다음과 같이 보입니다.

hi Whatever ctermbg=235 ctermfg=250 guibg=#262626 guifg=#bcbcbc cterm=NONE gui=NONE 

당신이해야 할 것은 간단하다

  1. 사본 그 라인 중 하나
  2. 변화 CtrlPNoEntriesWhatever에서 하이라이트 그룹 이름,
  3. 당신의 취향에 맞게 색상 값을 조정,
  4. 반복하십시오.

당신이 당신의 색상 구성표가 독립 싶은 경우에, 당신은 다른 플러그인처럼로드하지만 늦게 시작 프로세스됩니다 별도의 파일에 모든 CtrlP 하이라이트 정의해야합니다

~/.vim/after/plugin/mycolorscheme.vim 
+0

문서를 보았을 때, vim이 어떻게 작동하는지 모르기 때문에 이것이 중요한 부분이라는 것을 깨닫지 못했습니다. 이것이 내가 소스를보기로 결정한 이유입니다. 최소한 플러그인이 어떻게 작동하고 어떻게 작동하는지 보여주기 때문입니다. 중요한 부분을 지적 해 주셔서 감사합니다. 내 이해가 정확하다면 팝업에 대해 별도의 색 구성표를 설정할 수는 없지만 색 구성표와는 별도로 각 강조 그룹의 색을 하나씩 재정의 할 수 있습니까? 'highlight group value' 명령으로. 그게 유일한 방법인가요? – kdani

+0

제 편집을 참조하십시오. Airline 또는 Lightline과 같은 일부 플러그인에는 테마가 내장되어 있으므로 특정 플러그인의 특정 기능에만 적용되는 특정 색상 표를 작성할 수 있습니다. CtrlP는 기본적으로 두 가지 해결책을 가지고 있지 않으므로 : 당신의 colorscheme을 편집하십시오. (복사/붙여 넣기의 문제 일지라도, 다음번에 더 나은 colorscheme을 찾을 때조차도 다시해야합니다) 또는 필요한 강조 표시 정의를 별도의 플러그인 (한 번만 해보면 좋겠다). – romainl

관련 문제