[addr]s/<源字符串>/<目的字符串>/[option]
[addr]
:
"1, n"
:表示从第 1 行到 n 行。%
:表示整个文件,同 "1, $"
。[option]
:
g
:全局替换。c
:进行确认。i
:不区分大小写。ctrl + v
进入 VISUAL 模式,移动光标竖向选择。
shift + i
进行插入d
删除选择部分gt
跳转后一个标签页gT
跳转前一个标签页按键映射:
vim8 release: https://github.com/vim/vim/releases
最好安装python3.6,然后再编译vim,python3.6安装教程
sudo yum -y install gcc openssl-devel bzip2-devel
wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz
tar xzf Python-3.6.6.tgz
cd Python-3.6.6
./configure --enable-optimizations --prefix=/home/ray02.lei/.bin
make install
源码编译安装vim8
# python3 config dir
python3.6-config --configdir
./configure --with-features=huge \
--enable-multibyte \
--enable-python3interp \
--with-python3-command=python3 \
--with-python3-config-dir=/home/ray02.lei/.bin/lib/python3.6/config-3.6m-x86_64-linux-gnu \
--prefix=/home/ray02.lei/.bin
make install
https://github.com/tpope/vim-pathogen
https://github.com/vim-syntastic/syntastic#installation
https://github.com/scrooloose/nerdtree
新标签页打开修复文件夹打开插件 https://github.com/Nopik/vim-nerdtree-direnter
" 在新标签页中打开文件
let NERDTreeMapOpenInTab='<ENTER>'
https://github.com/sirver/ultisnips
cd ~/.vim/bundle && git clone git://github.com/SirVer/ultisnips.git
cd ~/.vim/bundle && git clone git://github.com/honza/vim-snippets.git
http://www.alexeyshmalko.com/2014/youcompleteme-ultimate-autocomplete-plugin-for-vim/
yum install python-devel
cd ~/.vim/bundle
git clone https://github.com/Valloric/YouCompleteMe.git
cd YouCompleteMe
git submodule update --init --recursive
./install.sh --clang-completer
# CXX=/apps/svr/vre/bin/g++ python3 install.py --all
https://github.com/vim-airline/vim-airline
set guifont=Ubuntu\ Mono\ derivative\ Powerline\ 13
let g:airline_powerline_fonts = 1
let g:airline_theme='deus'
let g:airline_section_b = '%{strftime("%c")}'
let g:airline_section_y = 'BN: %{bufnr("%")}'
let g:airline#extensions#tavline#enabled = 1
# 颜色显示不了解决:
vim ~/.bashrc
export TERM=screen-256color
https://github.com/Townk/vim-autoclose
git clone https://github.com/Townk/vim-autoclose.git ~/.vim/bundle/vim-autoclose
https://github.com/tpope/vim-fugitive
git clone https://github.com/tpope/vim-fugitive.git ~/.vim/bundle/vim-fugitive
升级git: https://phoenixnap.com/kb/how-to-install-git-on-centos-7
https://github.com/devjoe/vim-codequery
https://github.com/Shougo/unite.vim
拷贝到 ~/.vim/bundle