vim 使用 备忘

vim基本操作
[code]
i/I,a/A,o/O:插入
h,j,k,l:上下左右
ctrl+f:向下翻页
ctrl+b:向上翻页
v,V,ctrl+v:可视模式 n<>->n tab缩进
/[?]pattern:搜索
:%s/from/to/gc :询问替换
r/R:替换
d^:删至行首
D/d$:删至行尾
rx:删除一个字符
ynl/ynw:复制n个字符/单词
y$/Y:复制一行
ndd:删n行
p:粘帖
x:删除
u:取消上次操作
ctrl+r:回复上次操作
[/code]

vim配置文件:
[code]
" This is my _vimrc under windows platform
" and it can be used on *nix too
" all the difference of them is the font setting session
" happy Viming, guys!
" copyLeft (#) Abruzzi John

" autoload _vimrc
autocmd! bufwritepost _vimrc source %

" vim 定制
set linebreak " line break
set nocompatible " no compatible
set history=400 " history
set ruler
set number " line number
set hlsearch " highlight search
set noincsearch " no in C search
set expandtab " expand table
set t_vb= "close bell
set foldmethod=marker
set tabstop=4 " table step
set shiftwidth=4
set nobackup " don't backup
set smarttab " smart table
set smartindent " smart indent
set autoindent " auto indent
set cindent "cindent
set cursorline " hightlight cursor line

"set guioptions-=m " 取消顶部菜单栏
set guioptions-=r " 取消右边滚动条
set guioptions-=L " 取消左边滚动条
set guioptions-=T " 取消顶部工具条

colorscheme desert " color scheme

filetype plugin indent on " filetype setting
set completeopt=longest,menu " for code complete

" the following function is used for show the status bar on the buttom
function! CurrectDir()
let curdir = substitute(getcwd(), "", "", "g")
return curdir
endfunction
set statusline=\ [File]\ %F%m%r%h\ %w\ \ [PWD]\ %r%{CurrectDir()}%h\ \ %=[Line]\ %l,%c\ %=\ %P

" 字体
if has("win32")
set guifont=Courier_New:h10:cANSI
endif

" 设置语法高亮
if exists("syntax_on")
syntax reset
else
syntax on
endif

" plugin config begin

" NERDTree key-map
map <F10> :NERDTreeToggle<CR>

" plugin cofig end


" vim tab binding
map nt :tabnew %<cr> "open a new tab in normal mode
map tc :tabclose<cr> " close tab
map tn :tabnext<cr> " next tab
map tp :tabprev<cr> " preveiw tab


"绑定插入模式的hjkl
imap <c-j> <Down>
imap <c-k> <Up>
imap <c-h> <left>
imap <c-l> <Right>

" that's all, folks!


[/code]

常用插件:
1.NERDTree
2.tagList
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值