Vim

Reason is the light and the light of life.

Jerry Su Oct 04, 2018 1 mins

Install vim

apt install libncurses5-dev
git clone git@github.com:vim/vim.git
cd vim

# YouCompleteMe unavailable: requires Vim compiled with Python (3.6.0+) support.
./configure --enable-pythoninterp=yes --enable-cscope --enable-fontset --with-python3-config-dir=/opt/conda/envs/blog/lib/python3.8/config-3.8-x86_64-linux-gnu --enable-python3interp=yes --with-python3-command=python3.8

make
make install

~/.vimrc

https://github.com/jerrylsu/vimrc

Install Pluge

curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

vim :PlugeInstall

Uninstall Pluge

" 注释 .vimrc中的插件,:source ~/.vimrc

:PlugeClean

Vim的设计哲学

operation 操作:

  • d, delete

  • c, change

  • y

motion 动作:

  • w, word

  • b, back

  • f, find查找光标后的字符(:冒号,字母a)并跳转,f:, fa

常用组合:

  • cw, change word 删除一个词(删除光标以后的词),并进入写模式。

  • ciw, change in word 删除一个词(光标在词中),并进入写模式。 i是插入,如果做了映射noremap f i,则cfw

  • ci”, change in " 删除某种符号(如双引号”)之间的所有内容,并进入写模式。

  • dw, diw, di", yw, yiw, yi" 同理

  • df:, cf:, yf:

windows ‘\r\n’ to linux ‘\n’

vim filename && set ff=unix

替换

:s/from/to/g

https://www.cnblogs.com/wind-wang/p/5768000.html


Read more: