将PHP文档记录程序脚本绑定到< C-P>在Vim中 [英] Binding PHP documenter script to <C-P> in Vim
问题描述
如此处答案中所建议:
我试图将 Ctl p 绑定到PHP documenter脚本以生成注释.
I was trying to bind Ctlp to the PHP documenter script in order to generate comments.
我在.vimrc文件的末尾使用了以下几行:
I used these lines at the end of my .vimrc file:
" PHP documenter script bound to Control-P
autocmd FileType php inoremap <C-P> <ESC>:call PhpDocSingle()<CR>i
autocmd FileType php nnoremap <C-P> :call PhpDocSingle()<CR>
autocmd FileType php vnoremap <C-P> :call PhpDocRange()<CR>
但是当我按 Ctl p 时,光标会移到前面的行,并且不会生成注释.
But when I press Ctlp, the cursor goes to the line before and the comments are not generated.
但是,如果我手动执行命令:
However if I manually execute the command:
:call PhpDocSingle()
它工作正常,所以我知道php-doc.vim插件已正确安装,问题出在键盘快捷键上.
It works fine, so I know the php-doc.vim plugin is correctly installed and the problem is about the keyboard shortcut.
我已经在.vimrc文件中搜索了是否有与 Ctl p 的任何其他绑定,但是我没有找到.
I've searched in my .vimrc file if there is any other binding to Ctlp, but I found none.
有什么建议吗?
推荐答案
<C-P>
和<C-p>
不同:您正在将某些内容映射到 Ctrl + Shift + p ,但是您正在按 Ctrl + p .
<C-P>
and <C-p>
are different: you are mapping something to Ctrl+Shift+p but you are hitting Ctrl+p.
当您按下 Ctrl + Shift + p 时会发生什么?
What happens when you hit Ctrl+Shift+p?
这篇关于将PHP文档记录程序脚本绑定到< C-P>在Vim中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!