Vim Newbie。
当我发布<代码>:wq 在我指挥下,我想把它拯救起来,只是关闭积极的缓冲,而不是拯救它,然后从维姆撤出。
同样,我谨提出<代码>:q。 标题与<代码>:bd相同。
任何关于如何实施这种行为的建议?
Vim Newbie。
当我发布<代码>:wq 在我指挥下,我想把它拯救起来,只是关闭积极的缓冲,而不是拯救它,然后从维姆撤出。
同样,我谨提出<代码>:q。 标题与<代码>:bd相同。
任何关于如何实施这种行为的建议?
Vim allows the user to add key mappings for commands in all modes,
including the Command-line mode, so one can define the following
mappings (in one’s .vimrc
file):
:cnoreabbrev wq w<bar>bd
:cnoreabbrev q bd
These commands instruct Vim to expand the WQ
key presses in the command line into w|bd
and, similarly, expand
Q into bd
. See :help key-mapping
for more details.
查阅。
我尝试了另一个答案,但是没有使用案件。 当我结束最后的缓冲时,我希望它像一个固定的<条码>:指挥<条码>:bd条码>将只剩下一个空白窗口,没有缓冲。
这里根据其他答案改编的地图:
" Prevent accidental closing of all buffers when doing :wq or :q
cnoreabbrev wq w<bar>Sayonara
cnoreabbrev q Sayonara
Is it possible to update vim plugins automatically?
How can I configure vim to autowrite buffers after switching with alt-tab to another application?
I m writing a lot of python code recently, and i used the tab-to-space mode in vim. I was just wondering how would i unindent in vim without leaving edit mode for example after i finished if...: block....
I ve been googling around trying to figure out if it s possible to use my mouse wheel to scroll while inside Vim in Mac s Terminal, with no luck. It seems as if only X11 or iTerm support this. Before ...
How do I delete comments in XML? If the opening and the closing comment tags are on the same line, I use :g/^<!--.*-->$/d to delete the comment. How to delete the comments that are spread ...
I have the following in my .vimrc to highlight lines longer than 80 chars: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ This works quite well. However, the ...
Whenever I start a shell in vim using :sh, it doesn t source my ~/.bashrc file. How can I get it to do this automatically?
I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile its startup and see which of ...