vim配置:
vim ~/.vimrc
set nocompatible set number set ruler set wrap set showcmd set history=1000 set nobackup set noswapfile "set cursorline "set cursorcolumn set showmatch set autoindent set cindent syntax enable syntax on set t_Co=256 set ignorecase "set mouse=a set tabstop=4 set shiftwidth=4 set softtabstop=4 set smarttab set expandtab set encoding=utf-8 set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1 set ff=unix filetype on filetype indent on filetype plugin on filetype plugin indent on
解决粘贴代码混乱的问题:
- 设置为粘贴模式:
:set paste
- 退出粘贴模式:
:set nopaste
- 设置为粘贴模式:
可视模式:
1. 可视:v 2. 可视行:V 3. 可视块:Ctrl + v
大小写忽略设置:
- 忽略:
:set ic
- 不忽略:
:set noic
- 忽略:
查找/替换/删除命令:
- 查找:
# 命令 /{内容} # n 向下查找 # N 向上查找
- 替换:
# 命令 :%s/{search}/{replace}/g
- 删除行:
# 删除所有包含指定内容的行,忽略大小写 :g/{内容}/d
- 查找:
修改默认编辑器:
vim /etc/profile
export EDITOR=/usr/bin/vim
文档更新时间: 2024-04-20 10:57 作者:lee