📜  粘贴到 vim 没有缩进 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:46.055000             🧑  作者: Mango

代码示例1
# To turn off autoindent when you paste code, there's a special "paste" mode.
:set paste

# Then paste your code. Note that the text in the tooltip now says -- INSERT (paste) --.
# After you pasted your code, turn off the paste-mode, so that auto-indenting when you type works correctly again.
:set nopaste

# However, I always found that cumbersome. That's why I map  such that it can switch between paste and nopaste modes while editing the text! I add this to .vimrc
set pastetoggle=