如何自定义CtrlP';s提示符-VIM
我正在使用插件 根据地图,我应该可以像这样重新映射如何自定义CtrlP';s提示符-VIM,vim,ctrlp,Vim,Ctrlp,我正在使用插件 根据地图,我应该可以像这样重新映射 let g:ctrlp_prompt_mappings = { 'PrtSelectMove("k")': ['<c-u>', '<up>'] } let g:ctrlp_prompt_mappings = { 'PrtSelectMove("j")': ['<c-d>', '<down>'] } let g:ctrlp_prompt_mappings = { 'PrtDelete()
let g:ctrlp_prompt_mappings = { 'PrtSelectMove("k")': ['<c-u>', '<up>'] }
let g:ctrlp_prompt_mappings = { 'PrtSelectMove("j")': ['<c-d>', '<down>'] }
let g:ctrlp_prompt_mappings = { 'PrtDelete()' : ['<c-k>', '<del>'] }
let g:ctrlp_prompt_mappings = { 'PrtExit()' : ['<c-l>', '<esc>'] }
+++更新2+++
let g:ctrlp_prompt_mappings = {
\ 'PrtExit()': ['<c-l>', '<esc>'],
\ 'PrtSelectMove("k")': ['<c-u>', '<up>'],
\ 'PrtSelectMove("j")': ['<c-d>', '<down>'],
\ 'PrtBS()': ['<c-k>', '<bs>', '<c-]>'],
\ 'ToggleByFname()': [''],
\ 'PrtCurRight()': ['<right>'],
\}
让g:ctrlp\u prompt\u映射={
\“PrtExit()”:[“”,”,
\“PrtSelectMove(“k”):[”,],
\“PrtSelectMove(“j”):[”,],
\'PrtBS()':['','',''],
\“ToggleByFname()”:[“”],
\“PrtCurRight()”:[“”],
\}
一切正常。
(,
)开始工作,因为我将它们从
\ 'ToggleByFname()': [''],
\ 'PrtCurRight()': ['<right>'],
\'ToggleByFname()':[''],
\“PrtCurRight()”:[“”],
如果将建议的解决方案复制到剪贴板
let g:ctrlp_prompt_mappings = { 'PrtSelectMove("k")': ['<c-u>', '<up>'] }
let g:ctrlp_prompt_mappings = { 'PrtSelectMove("j")': ['<c-d>', '<down>'] }
let g:ctrlp_prompt_mappings = { 'PrtDelete()' : ['<c-k>', '<del>'] }
let g:ctrlp_prompt_mappings = { 'PrtExit()' : ['<c-l>', '<esc>'] }
如果您遵循文档中描述的模式会更好:
*'g:ctrlp_prompt_mappings'*
Use this to customize the mappings inside CtrlP's prompt to your liking. You
only need to keep the lines that you've changed the values (inside []): >
let g:ctrlp_prompt_mappings = {
\ 'PrtBS()': ['<bs>', '<c-]>'],
\ 'PrtDelete()': ['<del>'],
\ 'PrtDeleteWord()': ['<c-w>'],
\ 'PrtClear()': ['<c-u>'],
\ 'PrtSelectMove("j")': ['<c-j>', '<down>'],
\ 'PrtSelectMove("k")': ['<c-k>', '<up>'],
...
\}
*'g:ctrlp\u提示符\u映射'*
使用此选项可根据您的喜好自定义CtrlP提示符内的映射。你
只需保留已更改值的行(在[]内):>
设g:ctrlp\u prompt\u映射={
\“PrtBS()”:[“”,”,
\“PrtDelete()”:[“”],
\“PrtDeleteWord()”:[“”],
\“PrtClear()”:[“”],
\“PrtSelectMove(“j”):[”,],
\“PrtSelectMove(“k”):[”,],
...
\}
每个大括号块包含一个字典。您的方法定义了四个不同的字典并将它们分配给同一个变量,而文档描述的表单定义了一个具有多个键/值对的字典。查看
:help dict
了解更多信息。@whitesiroi很高兴我能帮忙:)
\ 'ToggleByFname()': [''],
\ 'PrtCurRight()': ['<right>'],
let g:ctrlp_prompt_mappings = { 'PrtSelectMove("k")': ['<c-u>', '<up>'] }
let g:ctrlp_prompt_mappings = { 'PrtSelectMove("j")': ['<c-d>', '<down>'] }
let g:ctrlp_prompt_mappings = { 'PrtDelete()' : ['<c-k>', '<del>'] }
let g:ctrlp_prompt_mappings = { 'PrtExit()' : ['<c-l>', '<esc>'] }
:echo g:ctrlp_prompt_mappings
output: {'PrtExit()': ['<c-l>', '<esc>']}
*'g:ctrlp_prompt_mappings'*
Use this to customize the mappings inside CtrlP's prompt to your liking. You
only need to keep the lines that you've changed the values (inside []): >
let g:ctrlp_prompt_mappings = {
\ 'PrtBS()': ['<bs>', '<c-]>'],
\ 'PrtDelete()': ['<del>'],
\ 'PrtDeleteWord()': ['<c-w>'],
\ 'PrtClear()': ['<c-u>'],
\ 'PrtSelectMove("j")': ['<c-j>', '<down>'],
\ 'PrtSelectMove("k")': ['<c-k>', '<up>'],
...
\}