近來,鍵盤敲的手疼,所以貼出vim配置,看看是什麼原因導致的手疼,是鍵盤太差了,還是vim配置有問題。
set nu
set ts=
4set expandtab
set autoindent
set shiftwidth=
4set encoding=utf-
8set termencoding=utf-
8set fileencodings=utf-
8,ucs-bom,gb18030,gbk,gb2312,cp936
set backspace=indent,eol,start
filetype plugin indent on
"快捷鍵的字首字元,預設是\,但是因為小指疼,改為-
let mapleader="-"
"使vim配置生效
nnoremap ss :source ~/
.vimrc
"搜尋高亮
set hlsearch
"set iskeyword=@,48
-57,_,192
-255,^.,^/,^:
set rtp+=~/
.vim/bundle/vundle.vim
"set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim/
set laststatus=2
"set t_co=
256let g:powerline_symbols =
'fancy'
set nocompatible " be improved, required
filetype off
call vundle#begin()
plugin 'gmarik/vundle.vim'
plugin 'fatih/vim-go'
plugin 'valloric/youcompleteme'
plugin 'majutsushi/tagbar'
plugin 'vim-syntastic/syntastic'
plugin 'scrooloose/nerdcommenter' "多行注釋,leader鍵+cc生成, leader+cu刪除注釋
plugin 'lokaltog/vim-powerline'
plugin 'vim-scripts/markdown'
plugin 'altercation/vim-colors-solarized'
plugin 'raimondi/delimitmate'
plugin 'lokaltog/vim-easymotion'
"快速跳轉,按兩下leader鍵和f組合
plugin 'vim-scripts/grep.vim' "在命令列模式使用grep命令,:grep
call vundle#end()
filetype on
"solarized
syntax enable
set background=dark
"let g:solarized_termcolors=
256"colorscheme solarized
"molokai
"let g:molokai_original = 1
"let g:rehash256 =11
au filetype go nmap >
(go-def
-pop)
set runtimepath^=~/
.vim/bundle/ctrlp.vim
"f9 彈出tagbar
nmap :tagbartogglenmap cp :ctrlpnmap :bnnmap :bpnmap bn :bnnmap bm :bpnmap :grepnmap t :nerdtreetoggle"保持原格式貼上
nnoremap :set paste
"exit window
nmap q :qnmap aq :qanmap p "
+p " 定義快捷鍵儲存當前視窗內容
nmap w :w" 定義快捷鍵儲存所有視窗內容並退出 vim
nmap wq :wa:q
" 依次遍歷子視窗
nnoremap ww " 跳轉至右方的視窗
nnoremap wl >l
" 跳轉至左方的視窗
nnoremap wh h
" 跳轉至上方的子視窗
nnoremap wk >k
" 跳轉至下方的子視窗
nnoremap wj j
" 跳到行尾
nnoremap ee g_
" 向上翻頁
nnoremap bb " 向下翻頁
nnoremap ff >
" ycm 補全選單配色
" 選單
highlight pmenu ctermfg=
2 ctermbg=
3 guifg=
#005f87 guibg=
#eee8d5
" 選中項
highlight pmenusel ctermfg=2 ctermbg=3 guifg=#afd700 guibg=#106900
" 補全功能在注釋中同樣有效
let g:ycm_complete_in_comments=
1" 允許 vim 載入 .ycm_extra_conf.py 檔案,不再提示
let g:ycm_confirm_extra_conf=0
" 開啟 ycm 標籤補全引擎
let g:ycm_collect_identifiers_from_tags_files=
1" 引入 c++ 標準庫tags
set tags+=/data/misc/software/misc./vim/stdcpp.tags
" ycm 整合 omnicppcomplete 補全引擎,設定其快捷鍵
"inoremap ; " 補全內容不以分割子視窗形式出現,只顯示補全列表
set completeopt-=preview
" 從第乙個鍵入字元就開始羅列匹配項
let g:ycm_min_num_of_chars_for_completion=1
" 禁止快取匹配項,每次都重新生成匹配項
let g:ycm_cache_omnifunc=
0" 語法關鍵字補全
let g:ycm_seed_identifiers_with_syntax=1
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/youcompleteme/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
"cscope 快捷鍵
nmap s :cs find s >=expand("")
nmap g :cs find g >=expand("")
nmap c :cs find c >=expand("")
nmap t :cs find t >=expand("")
nmap e :cs find e >=expand("")
nmap f :cs find f >=expand("")
nmap i :cs find i ^>=expand("")$
nmap d :cs find d >=expand("")
"easymotion
map h (easymotion-linebackward)
map j (easymotion-j)
map k (easymotion-k)
map l (easymotion-lineforward)
" 重複上一次操作, 類似repeat外掛程式, 很強大
map.(easymotion-repeat)
wincmd w
autocmd vimenter * wincmd w
autocmd bufenter *
if (winnr("$") ==
1&& exists("b:nerdtreetype") && b:nerdtreetype ==
"primary") | q | endif
autocmd stdinreadpre *
let s:std_in=
1autocmd vimenter *
if argc() ==0&&
!exists("s:std_in") | nerdtree | endif
au bufreadpost *
if line("'\"") >0|
if line("'\"") <= line("$")|exe("norm '\"")|
else
|exe "norm $"
|endif|endif
我的vim配置
vim是相當強大的文字編輯器,下面是我的vim配置。在根目錄下新建檔案.vimrc,複製以下 到該檔案即可。搜尋時高亮 set hlsearch 隨著鍵入即時搜尋 set incsearch tab 鍵設定4個空格 set tabstop 4 set shiftwidth 4 set expandt...
我的vim配置
目前機器上vim的配置為 vim ctags taglist omnicppcomplete minibufexplorer bufexplorer nerd tree doxgentoolkit 1.taglist外掛程式 用於顯示檔案的tag,需要ctags的支援 在taglist.vim中設定...
vim 我的配置歷程
我用的作業系統是ubuntu 11.10.首先是基本設定。basic settings 介面設定 gui settings 外掛程式,我一般用三個外掛程式 類 函式 變數列表外掛程式 檔案樹外掛程式 片段自動完成外掛程式 補全外掛程式 taglist 顯示類 函式 變數的外掛程式 nerdtree ...