"--------------------------------------------------------------------------- " .vimrc "--------------------------------------------------------------------------- " Initialize:"{{{ " set nocompatible augroup MyVimrcCmd autocmd! augroup END let s:MSWindows = has('win95') + has('win16') + has('win32') + has('win64') let s:Android = executable('uname') ? system('uname -m')=~#'armv7l' : 0 if s:MSWindows let $DOTVIM = expand($VIM . '/vimfiles') else let $DOTVIM = expand('~/.vim') endif let $MYLOCALVIMRC = $DOTVIM.'/.local.vimrc' nnoremap ev :edit $MYVIMRC nnoremap eg :edit $MYGVIMRC nnoremap el :edit $MYLOCALVIMRC nnoremap tv :tabedit $MYVIMRC nnoremap tg :tabedit $MYGVIMRC nnoremap tl :tabedit $MYLOCALVIMRC nnoremap rv :source $MYVIMRC \| if has('gui_running') \| source $MYGVIMRC \| endif nnoremap rg :source $MYGVIMRC nnoremap rl :if 1 && filereadable($MYLOCALVIMRC) \| source $MYLOCALVIMRC \| endif if has('win32') || has('win64') " set shellslash set visualbell t_vb= endif nnoremap o/ :setlocal shellslash!\|setlocal shellslash? set noautochdir nnoremap oc :setlocal autochdir!\|setlocal autochdir? "--------------------------------------------------------------------------- " Encoding:"{{{ " " based on encode.vim " https://sites.google.com/site/fudist/Home/vim-nihongo-ban/vim-utf8 if !has('gui_macvim') if !has('gui_running') && s:MSWindows set termencoding=cp932 set encoding=cp932 elseif s:MSWindows set termencoding=cp932 set encoding=utf-8 else set encoding=utf-8 endif "set default fileencodings if &encoding == 'utf-8' set fileencodings=ucs-bom,utf-8,default,latin1 elseif &encoding == 'cp932' set fileencodings=ucs-bom endif " set fileencodings for character code automatic recognition if &encoding !=# 'utf-8' set encoding=japan set fileencoding=japan endif if has('iconv') let s:enc_euc = 'euc-jp' let s:enc_jis = 'iso-2022-jp' " check whether iconv supports eucJP-ms. if iconv("\x87\x64\x87\x6a", 'cp932', 'eucjp-ms') ==# "\xad\xc5\xad\xcb" let s:enc_euc = 'eucjp-ms' let s:enc_jis = 'iso-2022-jp-3' " check whether iconv supports JISX0213. elseif iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb" let s:enc_euc = 'euc-jisx0213' let s:enc_jis = 'iso-2022-jp-3' endif " build fileencodings if &encoding ==# 'utf-8' let s:fileencodings_default = &fileencodings let &fileencodings = s:enc_jis .','. s:enc_euc .',cp932' let &fileencodings = &fileencodings .','. s:fileencodings_default unlet s:fileencodings_default else let &fileencodings = &fileencodings .','. s:enc_jis set fileencodings+=utf-8,ucs-2le,ucs-2 if &encoding =~# '^\(euc-jp\|euc-jisx0213\|eucjp-ms\)$' set fileencodings+=cp932 set fileencodings-=euc-jp set fileencodings-=euc-jisx0213 set fileencodings-=eucjp-ms let &encoding = s:enc_euc let &fileencoding = s:enc_euc else let &fileencodings = &fileencodings .','. s:enc_euc endif endif " give priority to utf-8 if &encoding == 'utf-8' set fileencodings-=utf-8 let &fileencodings = substitute(&fileencodings, s:enc_jis, s:enc_jis.',utf-8','') endif " clean up constant unlet s:enc_euc unlet s:enc_jis endif " set fileformats automatic recognition if s:MSWindows set fileformats=dos,unix,mac else set fileformats=unix,mac,dos endif " to use the encoding to fileencoding when not included the Japanese if has('autocmd') function! AU_ReCheck_FENC() if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0 let &fileencoding=&encoding if s:MSWindows let &fileencoding='cp932' endif endif endfunction autocmd MyVimrcCmd BufReadPost * call AU_ReCheck_FENC() endif " When internal encoding is not cp932 in Windows, " and environment variable contains multi-byte character command! -nargs=+ Let call Let__EnvVar__() function! Let__EnvVar__(cmd) let cmd = 'let ' . a:cmd if has('win32') + has('win64') && has('iconv') && &enc != 'cp932' let cmd = iconv(cmd, &enc, 'cp932') endif exec cmd endfunction endif "}}} "--------------------------------------------------------------------------- " Kaoriya:"{{{ " if exists('g:no_vimrc_example') && g:no_vimrc_example == 1 silent! source $VIMRUNTIME/vimrc_example.vim endif "}}} "--------------------------------------------------------------------------- " MacVim:"{{{ " if has('gui_macvim') set macmeta let macvim_hig_shift_movement = 1 let macvim_skip_cmd_opt_movement = 1 if has('kaoriya') && has('vim_starting') let $PATH = simplify($VIM . '/../../MacOS') . ':' . $PATH set migemodict=$VIMRUNTIME/dict/migemo-dict set migemo let $SSH_ASKPASS = simplify($VIM . '/../../MacOS') . '/macvim-askpass' set noimdisable set imdisableactivate endif endif "}}} "--------------------------------------------------------------------------- " MSWIN:"{{{ " if (1 && filereadable($VIMRUNTIME . '/mswin.vim')) && !s:Android source $VIMRUNTIME/mswin.vim endif " some textobj plugins doesn't work on selection=exclusive set selection=inclusive " Redefinition :increment and :decrement noremap noremap "}}} "}}} "--------------------------------------------------------------------------- " Load Plugins:"{{{ " filetype off "--------------------------------------------------------------------------- " neobundle.vim:"{{{ " if has('vim_starting') set runtimepath+=$DOTVIM/Bundle/neobundle.vim/ endif if s:Android let $GITHUB_COM = 'git://207.97.227.239/' else let $GITHUB_COM = 'git://github.com/' endif let $BITBUCKET_ORG = 'https://bitbucket.org/' command! -nargs=* MyNeoBundle call MyNeoBundle() function! MyNeoBundle(args) let args = split(a:args) if len(args) < 1 return endif if eval(args[0]) execute 'NeoBundle ' . join(args[1:]) endif endfunction try call neobundle#rc($DOTVIM . '/Bundle/') " plugin management NeoBundle $GITHUB_COM.'Shougo/neobundle.vim.git' " runtime for other plugins NeoBundle $GITHUB_COM.'mattn/webapi-vim.git' NeoBundle $GITHUB_COM.'vim-scripts/cecutil.git' NeoBundle $GITHUB_COM.'vim-scripts/tlib.git' " doc NeoBundle $GITHUB_COM.'vim-jp/vimdoc-ja.git' NeoBundleLazy $GITHUB_COM.'thinca/vim-ref.git' " completion NeoBundle $GITHUB_COM.'Shougo/neocomplcache.git' NeoBundle $GITHUB_COM.'Shougo/neosnippet.git' MyNeoBundle !s:Android $GITHUB_COM.'Rip-Rip/clang_complete.git' MyNeoBundle !s:Android $GITHUB_COM.'osyo-manga/neocomplcache-clang_complete.git' MyNeoBundle !s:Android $GITHUB_COM.'ujihisa/neco-ghc.git' NeoBundle $GITHUB_COM.'teramako/jscomplete-vim.git' " ctags NeoBundleLazy $GITHUB_COM.'vim-scripts/taglist.vim.git' if executable('hg') NeoBundleLazy $BITBUCKET_ORG.'abudden/taghighlight', {'type': 'hg'} endif " vcs NeoBundle $GITHUB_COM.'tpope/vim-fugitive.git' NeoBundle $GITHUB_COM.'gregsexton/gitv.git' NeoBundle $GITHUB_COM.'int3/vim-extradite.git' " unite NeoBundle $GITHUB_COM.'Shougo/unite.vim.git' MyNeoBundle !s:Android $GITHUB_COM.'Shougo/unite-build.git' NeoBundle $GITHUB_COM.'ujihisa/unite-colorscheme.git' NeoBundleLazy $GITHUB_COM.'ujihisa/quicklearn.git' NeoBundle $GITHUB_COM.'sgur/unite-qf.git' NeoBundle $GITHUB_COM.'osyo-manga/unite-quickfix.git' NeoBundle $GITHUB_COM.'h1mesuke/unite-outline.git' NeoBundle $GITHUB_COM.'h1mesuke/vim-alignta.git' NeoBundle $GITHUB_COM.'tsukkee/unite-help.git' MyNeoBundle !s:Android $GITHUB_COM.'tsukkee/unite-tag.git' NeoBundle $GITHUB_COM.'tacroe/unite-mark.git' MyNeoBundle !s:Android $GITHUB_COM.'sgur/unite-everything.git' NeoBundle $GITHUB_COM.'zhaocai/unite-scriptnames.git' NeoBundle $GITHUB_COM.'pasela/unite-webcolorname.git' NeoBundle $GITHUB_COM.'daisuzu/unite-grep_launcher.git' MyNeoBundle !s:Android $GITHUB_COM.'daisuzu/unite-gtags.git' " textobj NeoBundle $GITHUB_COM.'kana/vim-textobj-user.git' NeoBundle $GITHUB_COM.'kana/vim-textobj-indent.git' NeoBundle $GITHUB_COM.'kana/vim-textobj-syntax.git' NeoBundle $GITHUB_COM.'kana/vim-textobj-line.git' NeoBundle $GITHUB_COM.'kana/vim-textobj-fold.git' NeoBundle $GITHUB_COM.'kana/vim-textobj-entire.git' NeoBundle $GITHUB_COM.'thinca/vim-textobj-between.git' NeoBundle $GITHUB_COM.'thinca/vim-textobj-comment.git' NeoBundle $GITHUB_COM.'h1mesuke/textobj-wiw.git' NeoBundle $GITHUB_COM.'vimtaku/vim-textobj-sigil.git' " operator NeoBundle $GITHUB_COM.'kana/vim-operator-user.git' NeoBundle $GITHUB_COM.'kana/vim-operator-replace.git' NeoBundle $GITHUB_COM.'tyru/operator-camelize.vim.git' NeoBundle $GITHUB_COM.'tyru/operator-reverse.vim.git' NeoBundle $GITHUB_COM.'emonkak/vim-operator-sort.git' " quickfix NeoBundle $GITHUB_COM.'thinca/vim-qfreplace.git' NeoBundle $GITHUB_COM.'dannyob/quickfixstatus.git' NeoBundle $GITHUB_COM.'jceb/vim-hier.git' NeoBundle $GITHUB_COM.'fuenor/qfixhowm.git' " appearance MyNeoBundle !s:Android $GITHUB_COM.'thinca/vim-fontzoom.git' MyNeoBundle !s:Android $GITHUB_COM.'nathanaelkane/vim-indent-guides.git' NeoBundle $GITHUB_COM.'daisuzu/rainbowcyclone.vim.git' NeoBundle $GITHUB_COM.'vim-scripts/MultipleSearch.git' " cursor movement NeoBundle $GITHUB_COM.'Lokaltog/vim-easymotion.git' NeoBundle $GITHUB_COM.'vim-scripts/matchparenpp.git' NeoBundle $GITHUB_COM.'vim-scripts/matchit.zip.git' " editing NeoBundle $GITHUB_COM.'tpope/vim-surround.git' NeoBundle $GITHUB_COM.'t9md/vim-textmanip.git' NeoBundle $GITHUB_COM.'tomtom/tcomment_vim.git' NeoBundle $GITHUB_COM.'kana/vim-niceblock.git' NeoBundle $GITHUB_COM.'vim-scripts/DrawIt.git' NeoBundle $GITHUB_COM.'vim-scripts/RST-Tables.git' NeoBundle $GITHUB_COM.'vim-scripts/sequence.git' " search NeoBundle $GITHUB_COM.'thinca/vim-visualstar.git' NeoBundle $GITHUB_COM.'othree/eregex.vim.git' " quickrun NeoBundleLazy $GITHUB_COM.'thinca/vim-quickrun.git' NeoBundleLazy $GITHUB_COM.'osyo-manga/vim-watchdogs.git' NeoBundleLazy $GITHUB_COM.'osyo-manga/shabadou.vim.git' NeoBundle $GITHUB_COM.'daisuzu/quickrun-hook-sphinx.git' " utility NeoBundle $GITHUB_COM.'mattn/ideone-vim.git' NeoBundle $GITHUB_COM.'vim-scripts/project.tar.gz.git' MyNeoBundle !s:Android $GITHUB_COM.'Shougo/vimproc.git' MyNeoBundle !s:Android $GITHUB_COM.'Shougo/vinarise.git' MyNeoBundle !s:Android $GITHUB_COM.'s-yukikaze/vinarise-plugin-peanalysis.git' NeoBundleLazy $GITHUB_COM.'Shougo/vimfiler.git' MyNeoBundle !s:Android $GITHUB_COM.'Shougo/vimshell.git' MyNeoBundle !s:Android $GITHUB_COM.'thinca/vim-logcat.git' NeoBundle $GITHUB_COM.'thinca/vim-prettyprint.git' NeoBundle $GITHUB_COM.'thinca/vim-editvar.git' NeoBundle $GITHUB_COM.'tyru/open-browser.vim.git' MyNeoBundle !s:Android $GITHUB_COM.'sjl/splice.vim.git' MyNeoBundle !s:Android $GITHUB_COM.'sjl/gundo.vim.git' NeoBundle $GITHUB_COM.'vim-scripts/copypath.vim.git' NeoBundle $GITHUB_COM.'vim-scripts/DirDiff.vim.git' NeoBundle $GITHUB_COM.'vim-scripts/ShowMultiBase.git' NeoBundle $GITHUB_COM.'vim-scripts/ttoc.git' NeoBundle $GITHUB_COM.'vim-scripts/wokmarks.vim.git' NeoBundle $GITHUB_COM.'vim-scripts/sudo.vim.git' " command extension NeoBundle $GITHUB_COM.'thinca/vim-ambicmd.git' NeoBundle $GITHUB_COM.'tyru/vim-altercmd.git' NeoBundle $GITHUB_COM.'tomtom/tcommand_vim.git' NeoBundleLazy $GITHUB_COM.'mbadran/headlights.git' " C/C++ NeoBundleLazy $GITHUB_COM.'vim-scripts/a.vim.git' NeoBundleLazy $GITHUB_COM.'vim-scripts/c.vim.git' NeoBundleLazy $GITHUB_COM.'vim-scripts/CCTree.git' NeoBundleLazy $GITHUB_COM.'vim-scripts/Source-Explorer-srcexpl.vim.git' NeoBundleLazy $GITHUB_COM.'vim-scripts/trinity.vim.git' NeoBundleLazy $GITHUB_COM.'vim-scripts/cscope-menu.git' NeoBundleLazy $GITHUB_COM.'vim-scripts/gtags.vim.git' NeoBundleLazy $GITHUB_COM.'vim-scripts/DoxygenToolkit.vim.git' " Python NeoBundleLazy $GITHUB_COM.'alfredodeza/pytest.vim.git' NeoBundleLazy $GITHUB_COM.'klen/python-mode.git' " Perl NeoBundleLazy $GITHUB_COM.'vim-scripts/perl-support.vim.git' " JavaScript NeoBundleLazy $GITHUB_COM.'pangloss/vim-javascript.git' NeoBundleLazy $GITHUB_COM.'basyura/jslint.vim.git' " Haskell NeoBundleLazy $GITHUB_COM.'kana/vim-filetype-haskell.git' NeoBundleLazy $GITHUB_COM.'lukerandall/haskellmode-vim.git' NeoBundleLazy $GITHUB_COM.'Twinside/vim-syntax-haskell-cabal.git' NeoBundleLazy $GITHUB_COM.'eagletmt/ghcmod-vim.git' " Clojure MyNeoBundle !s:Android $GITHUB_COM.'jondistad/vimclojure.git' " CSV NeoBundle $GITHUB_COM.'vim-scripts/csv.vim.git' " colorscheme NeoBundle $GITHUB_COM.'altercation/vim-colors-solarized.git' NeoBundle $GITHUB_COM.'vim-scripts/Colour-Sampler-Pack.git' catch /E117/ endtry "}}} filetype plugin indent on "--------------------------------------------------------------------------- " CCTree.vim:"{{{ " if 1 && filereadable($DOTVIM . '/Bundle/CCTree/ftplugin/cctree.vim') source $DOTVIM/Bundle/CCTree/ftplugin/cctree.vim endif "}}} "}}} "--------------------------------------------------------------------------- " Mouse:"{{{ " set mouse=a set nomousefocus set nomousehide "set guioptions+=a "}}} "--------------------------------------------------------------------------- " Edit:"{{{ " set nobackup set browsedir=buffer set clipboard+=unnamed set tabstop=4 set softtabstop=4 set shiftwidth=4 set smarttab set expandtab set backspace=indent,eol,start set whichwrap=b,s,<,>,[,] set wildmenu set virtualedit+=block set autoindent " Smart indenting set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class " settings for Japanese folding set formatoptions+=mM " don't continue the comment line automatically set formatoptions-=ro autocmd MyVimrcCmd FileType * setlocal formatoptions-=ro " settings for Japanese formatting let format_allow_over_tw = 1 set nrformats=alpha,hex " tags "{{{ set tags=./tags set tags+=tags; set tags+=./**/tags "}}} " grep "{{{ set grepprg=grep\ -nH "set grepprg=ack.pl\ -a " autocmd MyVimrcCmd QuickfixCmdPost make,grep,grepadd,vimgrep,vimgrepadd,helpgrep copen "}}} "}}} "--------------------------------------------------------------------------- " View:"{{{ " " Fonts:"{{{ if has('xfontset') set guifontset=a14,r14,k14 elseif has('unix') elseif has('mac') set guifont=Osaka-mono:h14 elseif has('win32') || has('win64') " set guifont=MS_Gothic:h12:cSHIFTJIS " set guifontwide=MS_Gothic:h12:cSHIFTJIS set guifont=MS_Gothic:h10:cSHIFTJIS set linespace=1 endif " For Printer : if has('printer') if has('win32') || has('win64') set printfont=MS_Mincho:h12:cSHIFTJIS " set printfont=MS_Gothic:h12:cSHIFTJIS endif endif "}}} " Color Scheme:"{{{ try colorscheme motus catch /E185/ colorscheme torte endtry "}}} set number set showmatch set laststatus=2 set cmdheight=2 set showcmd set title set showtabline=2 set display=uhex set nowrap nnoremap ow :setlocal wrap!\|setlocal wrap? set nolist nnoremap ol :setlocal list!\|setlocal list? set listchars=tab:>-,extends:<,precedes:>,trail:-,eol:$,nbsp:% " Limit horizontal scrollbar size to the length of the cursor line set guioptions+=h " Hide Toolbar set guioptions-=T " Toggle horizontal scrollbar nnoremap oh :if &guioptions =~# 'b' \set guioptions-=b \else \set guioptions+=b \endif " Window width set columns=160 " Window height set lines=40 " Command-line height set cmdheight=2 " Tabline settings "{{{ function! s:is_modified(n) "{{{ return getbufvar(a:n, "&modified") == 1 ? "+" : "" endfunction "}}} function! s:tabpage_label(n) "{{{ let title = gettabvar(a:n, 'title') if title !=# '' return title endif let bufnrs = tabpagebuflist(a:n) let buflist = join(map(copy(bufnrs), 'v:val . s:is_modified(v:val)'), ',') let curbufnr = bufnrs[tabpagewinnr(a:n) - 1] let fname = pathshorten(bufname(curbufnr)) let label = '[' . buflist . ']' . fname let hi = a:n is tabpagenr() ? '%#TabLineSel#' : '%#TabLine#' return '%' . a:n . 'T' . hi . label . '%T%#TabLineFill#' endfunction "}}} function! MakeTabLine() "{{{ let titles =map(range(1, tabpagenr('$')), 's:tabpage_label(v:val)') let sep = ' | ' let tabpages = join(titles, sep) . sep . '%#TabLineFill#%T' let info = fnamemodify(getcwd(),"~:") . ' ' return tabpages . '%=' . info endfunction "}}} set guioptions-=e set tabline=%!MakeTabLine() "}}} " Visualization of the full-width space and the blank at the end of the line "{{{ if has("syntax") syntax on " for POD bug syn sync fromstart function! ActivateInvisibleIndicator() syntax match InvisibleJISX0208Space " " display containedin=ALL highlight InvisibleJISX0208Space term=underline ctermbg=Blue guibg=darkgray gui=underline syntax match InvisibleTrailedSpace "\s\+$" display containedin=ALL if has('gui_macvim') highlight InvisibleTrailedSpace term=underline ctermbg=Red guibg=lightgray else highlight InvisibleTrailedSpace term=underline ctermbg=Red gui=undercurl guisp=darkorange endif syntax match InvisibleTab "\t" display containedin=ALL highlight InvisibleTab term=underline ctermbg=white gui=undercurl guisp=darkslategray endfunction call ActivateInvisibleIndicator() augroup invisible autocmd! invisible autocmd BufNew,BufRead * call ActivateInvisibleIndicator() augroup END endif "}}} " XPstatusline + fugitive#statusline "{{{ let g:statusline_max_path = 50 function! StatusLineGetPath() "{{{ let p = expand('%:.:h') let p = substitute(p, expand('$HOME'), '~', '') if len(p) > g:statusline_max_path let p = simplify(p) let p = pathshorten(p) endif return p endfunction "}}} nmap view:switch_status_path_length :let g:statusline_max_path = 200 - g:statusline_max_path nmap ,t view:switch_status_path_length augroup Statusline autocmd! Statusline autocmd BufEnter * call SetFullStatusline() autocmd BufLeave,BufNew,BufRead,BufNewFile * call SetSimpleStatusline() augroup END function! StatusLineRealSyn() let synId = synID(line('.'),col('.'),1) let realSynId = synIDtrans(synId) if synId == realSynId return 'Normal' else return synIDattr( realSynId, 'name' ) endif endfunction function! s:SetFullStatusline() "{{{ setlocal statusline= setlocal statusline+=%#StatuslineBufNr#%-1.2n\ " buffer number setlocal statusline+=%h%#StatuslineFlag#%m%r%w " flags setlocal statusline+=%#StatuslinePath#\ %-0.50{StatusLineGetPath()}%0* " path setlocal statusline+=%#StatuslineFileName#\/%t\ " file name setlocal statusline+=%#StatuslineFileSize#\(%{GetFileSize()}\)\ " file size try call fugitive#statusline() setlocal statusline+=%{fugitive#statusline()} " Git branch name catch /E117/ endtry setlocal statusline+=%#StatuslineChar#\ \ %{GetCharacterCode()} " current char setlocal statusline+=%#StatuslineTermEnc#(%{&termencoding},\ " encoding setlocal statusline+=%#StatuslineFileEnc#%{&fileencoding},\ " file encoding setlocal statusline+=%#StatuslineFileFormat#%{&fileformat}\)\ " file format setlocal statusline+=%#StatuslineFileType#\ %{strlen(&ft)?&ft:'**'}\ . " filetype setlocal statusline+=%#StatuslineSyn#\ %{synIDattr(synID(line('.'),col('.'),1),'name')}\ %0* " syntax name setlocal statusline+=%#StatuslineRealSyn#\ %{StatusLineRealSyn()}\ %0* " real syntax name setlocal statusline+=%= setlocal statusline+=\ %-10.(%l/%L,%c-%v%) " position setlocal statusline+=\ %P " position percentage endfunction "}}} function! s:SetSimpleStatusline() "{{{ setlocal statusline= setlocal statusline+=%#StatuslineNC#%-0.20{StatusLineGetPath()}%0* " path setlocal statusline+=\/%t\ " file name endfunction "}}} " Get character code on cursor with 'fileencoding'. function! GetCharacterCode() let str = iconv(matchstr(getline('.'), '.', col('.') - 1), &enc, &fenc) let out = '0x' for i in range(strlen(str)) let out .= printf('%02X', char2nr(str[i])) endfor if str ==# '' let out .= '00' endif return out endfunction " Return the current file size in human readable format. function! GetFileSize() let size = &encoding ==# &fileencoding || &fileencoding ==# '' \ ? line2byte(line('$') + 1) - 1 : getfsize(expand('%')) if size < 0 let size = 0 endif for unit in ['B', 'KB', 'MB'] if size < 1024 " return size . unit return printf('%.2f' . unit, size) endif let size = size / 1024.0 endfor return printf('%.2f' . 'GB', size) endfunction "}}} augroup MyVimrcCmd autocmd ColorScheme * call s:onColorScheme() augroup END function! s:onColorScheme() " IME Color "{{{ if has('multi_byte_ime') || has('xim') " Set the color of the cursor when the IME ON highlight CursorIM guibg=Purple guifg=NONE " Default IME settings in search mode and insert mode set iminsert=0 imsearch=0 if has('xim') && has('GUI_GTK') "set imactivatekey=C-Space endif endif if has('multi_byte_ime') " highlight Cursor guifg=NONE guibg=Green highlight CursorIM guifg=NONE guibg=Purple endif "}}} " Additional settings of Color "{{{ highlight Search guifg=Black guibg=Red gui=bold highlight Visual guifg=#404040 gui=bold highlight Cursor guifg=Black guibg=Green gui=bold highlight StatusLine guifg=white guibg=blue highlight Folded guifg=blue guibg=darkgray " highlight Folded guifg=blue guibg=cadetblue highlight TabLine ctermfg=0 ctermbg=8 guifg=Black guibg=#dcdcdc gui=underline highlight TabLineSel term=bold cterm=bold ctermfg=15 ctermbg=9 guifg=White guibg=Blue gui=bold highlight TabLineFill ctermfg=0 ctermbg=8 guifg=Black guibg=#dcdcdc gui=underline "}}} " For completion menu "{{{ highlight Pmenu ctermfg=White ctermbg=DarkBlue guifg=#0033ff guibg=#99cccc gui=none highlight PmenuSel ctermfg=Black ctermbg=Cyan guifg=#ccffff guibg=#006699 gui=none highlight PmenuSbar ctermfg=White ctermbg=LightCyan guifg=#ffffff guibg=#848484 gui=none highlight PmenuThumb ctermfg=White ctermbg=DarkGreen guifg=#ffffff guibg=#006699 gui=none "}}} " For unite "{{{ highlight UniteAbbr guifg=#80a0ff gui=underline highlight UniteCursor guifg=black guibg=lightblue gui=bold "}}} endfunction call s:onColorScheme() "}}} "--------------------------------------------------------------------------- " Search:"{{{ " set nowrapscan set incsearch set ignorecase nnoremap oi :setlocal ignorecase!\|setlocal ignorecase? set smartcase nnoremap os :setlocal smartcase!\|setlocal smartcase? set hlsearch nnoremap :nohlsearch "}}} "--------------------------------------------------------------------------- " Utilities:"{{{ " try call altercmd#load() catch /E117/ endtry " TabpageCD "{{{ command! -bar -complete=dir -nargs=? \ CD \ TabpageCD command! -bar -complete=dir -nargs=? \ TabpageCD \ execute 'cd' fnameescape(expand()) \ | let t:cwd = getcwd() autocmd MyVimrcCmd TabEnter * \ if exists('t:cwd') && !isdirectory(t:cwd) \ | unlet t:cwd \ | endif \ | if !exists('t:cwd') \ | let t:cwd = getcwd() \ | endif \ | execute 'cd' fnameescape(expand(t:cwd)) " Exchange ':cd' to ':TabpageCD'. try AlterCommand cd CD catch /E492/ endtry "}}} " CD to the directory of open files "{{{ command! -nargs=? -complete=dir -bang TCD call s:ChangeCurrentDir('', '') function! s:ChangeCurrentDir(directory, bang) if a:directory == '' TabpageCD %:p:h else execute 'TabpageCD' . a:directory endif if a:bang == '' pwd endif endfunction "}}} nnoremap cd :TCD " Occur "{{{ command! Occur execute 'vimgrep /' . @/ . '/ %' command! StarOccur execute 'vimgrep /' . expand('') . '/ %' nnoremap oc :Occur nnoremap so :StarOccur "}}} " WinMerge keybind in vimdiff "{{{ function! DiffGet() "{{{ try execute 'diffget' catch/E101/ execute 'diffget //2' endtry endfunction "}}} function! DiffPut() "{{{ try execute 'diffput' catch/E101/ execute 'diffget //3' endtry endfunction "}}} function! SetDiffMap() "{{{ nnoremap :diffupdate nnoremap [c nnoremap ]c nnoremap :call DiffGet() nnoremap :call DiffPut() endfunction "}}} autocmd MyVimrcCmd FilterWritePost * call SetDiffMap() "}}} " Command-line window "{{{ autocmd MyVimrcCmd CmdwinEnter * call s:init_cmdwin() function! s:init_cmdwin() nnoremap q :quit nnoremap :quit inoremap pumvisible() ? "\\" : "\" inoremap pumvisible() ? "\\" : "\" inoremap pumvisible() ? "\" : "\" startinsert! endfunction "}}} " DiffClip() "{{{ " http://vimwiki.net/?tips%2F49 command! -nargs=0 -range DiffClip , :call DiffClip('0') " get diff with register reg function! DiffClip(reg) range exe "let @a=@" . a:reg exe a:firstline . "," . a:lastline . "y b" tabnew "new " clear the buffer after close this window set buftype=nofile bufhidden=wipe put a diffthis lefta vnew "vnew set buftype=nofile bufhidden=wipe put b diffthis endfunction "}}} " DiffScratch() "{{{ command! DiffScratch call DiffScratch() function! DiffScratch() tabnew set buftype=nofile bufhidden=wipe diffthis lefta vnew set buftype=nofile bufhidden=wipe diffthis endfunction "}}} " NextIndent() "{{{ " http://vim.wikia.com/wiki/Move_to_next/previous_line_with_same_indentation " " Jump to the next or previous line that has the same level or a lower " level of indentation than the current line. " " exclusive (bool): true: Motion is exclusive " false: Motion is inclusive " fwd (bool): true: Go to next line " false: Go to previous line " lowerlevel (bool): true: Go to line with lower indentation level " false: Go to line with the same indentation level " skipblanks (bool): true: Skip blank lines " false: Don't skip blank lines function! NextIndent(exclusive, fwd, lowerlevel, skipblanks) let line = line('.') let column = col('.') let lastline = line('$') let indent = indent(line) let stepvalue = a:fwd ? 1 : -1 while (line > 0 && line <= lastline) let line = line + stepvalue if ( ! a:lowerlevel && indent(line) == indent || \ a:lowerlevel && indent(line) < indent) if (! a:skipblanks || strlen(getline(line)) > 0) if (a:exclusive) let line = line - stepvalue endif exe line exe "normal " column . "|" return endif endif endwhile endfunc " Moving back and forth between lines of same or lower indentation. nnoremap [l :call NextIndent(0, 0, 0, 1) nnoremap ]l :call NextIndent(0, 1, 0, 1) nnoremap [L :call NextIndent(0, 0, 1, 1) nnoremap ]L :call NextIndent(0, 1, 1, 1) vnoremap [l :call NextIndent(0, 0, 0, 1)m'gv'' vnoremap ]l :call NextIndent(0, 1, 0, 1)m'gv'' vnoremap [L :call NextIndent(0, 0, 1, 1)m'gv'' vnoremap ]L :call NextIndent(0, 1, 1, 1)m'gv'' onoremap [l :call NextIndent(0, 0, 0, 1) onoremap ]l :call NextIndent(0, 1, 0, 1) onoremap [L :call NextIndent(1, 0, 1, 1) onoremap ]L :call NextIndent(1, 1, 1, 1) "}}} " cscope_maps.vim "{{{ " http://cscope.sourceforge.net/cscope_vim_tutorial.html " """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " CSCOPE settings for vim """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " " This file contains some boilerplate settings for vim's cscope interface, " plus some keyboard mappings that I've found useful. " " USAGE: " -- vim 6: Stick this file in your ~/.vim/plugin directory (or in a " 'plugin' directory in some other directory that is in your " 'runtimepath'. " " -- vim 5: Stick this file somewhere and 'source cscope.vim' it from " your ~/.vimrc file (or cut and paste it into your .vimrc). " " NOTE: " These key maps use multiple keystrokes (2 or 3 keys). If you find that vim " keeps timing you out before you can complete them, try changing your timeout " settings, as explained below. " " Happy cscoping, " " Jason Duell jduell@alumni.princeton.edu 2002/3/7 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " This tests to see if vim was configured with the '--enable-cscope' option " when it was compiled. If it wasn't, time to recompile vim... if has("cscope") """"""""""""" Standard cscope/vim boilerplate " use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t' set cscopetag " check cscope for definition of a symbol before checking ctags: set to 1 " if you want the reverse search order. set csto=0 " add any cscope database in current directory if filereadable("cscope.out") cs add cscope.out " else add the database pointed to by environment variable elseif $CSCOPE_DB != "" cs add $CSCOPE_DB endif " show msg when any other cscope db added set cscopeverbose """"""""""""" My cscope/vim key mappings " " The following maps all invoke one of the following cscope search types: " " 's' symbol: find all references to the token under cursor " 'g' global: find global definition(s) of the token under cursor " 'c' calls: find all calls to the function name under cursor " 't' text: find all instances of the text under cursor " 'e' egrep: egrep search for the word under cursor " 'f' file: open the filename under cursor " 'i' includes: find files that include the filename under cursor " 'd' called: find functions that function under cursor calls " " Below are three sets of the maps: one set that just jumps to your " search result, one that splits the existing vim window horizontally and " diplays your search result in the new window, and one that does the same " thing, but does a vertical split instead (vim 6 only). " " I've used CTRL-\ and CTRL-@ as the starting keys for these maps, as it's " unlikely that you need their default mappings (CTRL-\'s default use is " as part of CTRL-\ CTRL-N typemap, which basically just does the same " thing as hitting 'escape': CTRL-@ doesn't seem to have any default use). " If you don't like using 'CTRL-@' or CTRL-\, , you can change some or all " of these maps to use other keys. One likely candidate is 'CTRL-_' " (which also maps to CTRL-/, which is easier to type). By default it is " used to switch between Hebrew and English keyboard mode. " " All of the maps involving the macro use '^$': this is so " that searches over '#include " return only references to " 'time.h', and not 'sys/time.h', etc. (by default cscope will return all " files that contain 'time.h' as part of their name). " To do the first type of search, hit 'CTRL-\', followed by one of the " cscope search types above (s,g,c,t,e,f,i,d). The result of your cscope " search will be displayed in the current window. You can use CTRL-T to " go back to where you were before the search. " 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("") " Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) then a search type " makes the vim window split horizontally, with search result displayed in " the new window. " " (Note: earlier versions of vim may not have the :scs command, but it " can be simulated roughly via: " nmap s :cs find s =expand("") nmap s :scs find s =expand("") nmap g :scs find g =expand("") nmap c :scs find c =expand("") nmap t :scs find t =expand("") nmap e :scs find e =expand("") nmap f :scs find f =expand("") nmap i :scs find i ^=expand("")$ nmap d :scs find d =expand("") " Hitting CTRL-space *twice* before the search type does a vertical " split instead of a horizontal one (vim 6 and up only) " " (Note: you may wish to put a 'set splitright' in your .vimrc " if you prefer the new window on the right instead of the left nmap s :vert scs find s =expand("") nmap g :vert scs find g =expand("") nmap c :vert scs find c =expand("") nmap t :vert scs find t =expand("") nmap e :vert scs find e =expand("") nmap f :vert scs find f =expand("") nmap i :vert scs find i ^=expand("")$ nmap d :vert scs find d =expand("") """"""""""""" key map timeouts " " By default Vim will only wait 1 second for each keystroke in a mapping. " You may find that too short with the above typemaps. If so, you should " either turn off mapping timeouts via 'notimeout'. " "set notimeout " " Or, you can keep timeouts, by uncommenting the timeoutlen line below, " with your own personal favorite value (in milliseconds): " "set timeoutlen=4000 " " Either way, since mapping timeout settings by default also set the " timeouts for multicharacter 'keys codes' (like ), you should also " set ttimeout and ttimeoutlen: otherwise, you will experience strange " delays as vim waits for a keystroke after you hit ESC (it will be " waiting to see if the ESC is actually part of a key code like ). " "set ttimeout " " personally, I find a tenth of a second to work well for key code " timeouts. If you experience problems and have a slow terminal or network " connection, set it higher. If you don't set ttimeoutlen, the value for " timeoutlent (default: 1000 = 1 second, which is sluggish) is used. " "set ttimeoutlen=100 endif "}}} " FullScreenToggle() "{{{ command! FullScreenToggle call FullScreenToggle() function! FullScreenToggle() if s:is_full_screen call FullScreenOff() else call FullScreenOn() endif endfunction let s:is_full_screen = 0 function! FullScreenOn() let s:columns = &columns let s:lines = &lines set columns=9999 set lines=999 let s:is_full_screen = 1 endfunction function! FullScreenOff() execute 'set columns=' . s:columns execute 'set lines=' . s:lines let s:is_full_screen = 0 endfunction "}}} " Split and Go "{{{ " USAGE: " [count]sag - Split the current window horizontally and, go to line [count]. " [count]sav - Split the current window vertically and, go to line [count]. nnoremap sag :SplitAndGo split nnoremap sav :SplitAndGo vsplit command! -count=1 -nargs=1 -complete=customlist,SAG_Complete SplitAndGo call SplitAndGo() function! SplitAndGo(cmd) let cnt = v:count ? v:count : 1 let cmd = cnt > line('.') ? 'botright '.a:cmd : 'topleft '.a:cmd " execute cmd call s:split(cmd, 'preview') execute 'normal' . cnt . 'G' normal zv endfunction function! SAG_Complete(ArgLead, CmdLine, CursorPos) return ['split', 'vsplit'] endfunction " For don't split the window if the window name is already exists. " http://d.hatena.ne.jp/osyo-manga/20120826/1345944705 function! s:is_number(str) return (type(a:str) == type(0)) || (a:str =~ '^\d\+$') endfunction function! s:winnrlist(...) return a:0 \ ? range(1, tabpagewinnr(a:1, "$")) \ : range(1, tabpagewinnr(tabpagenr(), "$")) endfunction function! s:winlist(...) let tabnr = a:0 == 0 ? tabpagenr() : a:1 return map(s:winnrlist(tabnr), '{ \ "winnr" : v:val, \ "name" : gettabwinvar(tabnr, v:val, "name") \ }') endfunction function! s:winnr(...) return a:0 == 0 ? winnr() \ : a:1 ==# "$" ? winnr("$") \ : a:1 ==# "#" ? winnr("#") \ : !s:is_number(a:1) ? (filter(s:winlist(), 'v:val.name ==# a:1') + [{'winnr' : '-1'}])[0].winnr \ : a:1 endfunction function! s:winname(...) return a:0 == 0 ? s:winname(winnr()) \ : a:1 ==# "$" ? s:winname(winnr("$")) \ : a:1 ==# "#" ? s:winname(winnr("#")) \ : !s:is_number(a:1) ? (filter(s:winlist(), 'v:val.name ==# a:1') + [{'name' : ''}])[0].name \ : (filter(s:winlist(), 'v:val.winnr ==# a:1') + [{'name' : ''}])[0].name endfunction function! s:split(cmd, name) let winnr = s:winnr(a:name) if winnr == -1 silent execute a:cmd let w:name = a:name else silent execute winnr . "wincmd w" endif endfunction " split the window with specifying the window name. " if the window name is already exists, move to there. command! -count=0 -nargs=1 \ Split call s:split("split", ) | if | silent execute | endif " open the preview window by specifying the line number. " 123ss " nnoremap ss :execute v:count."Split preview" "}}} " CtagsR "{{{ if executable('ctags') " Execute ctags command. And echo for error. command! -nargs=? -complete=file -bar CtagsR call CtagsR([]) function! CtagsR(args) let args = a:args let dir = '.' if !empty(args) && isdirectory(args[0]) let dir = args[0] call remove(args, 0) endif if !empty(args) && args[0] !~# '^-' echoerr 'Invalid options: ' . join(args) return endif let tagfile = s:tagfile() if tagfile !=# '' let dir = fnamemodify(tagfile, ':h') let args += ['-f', tagfile] endif if s:MSWindows let enc = get({ \ 'utf-8': 'utf8', \ 'cp932': 'sjis', \ 'euc-jp': 'euc', \ }, &l:fileencoding ==# '' ? &encoding : &l:fileencoding, '') if enc !=# '' let args += ['--jcode=' . enc] endif endif let lang = get({ \ 'cpp': 'C++', \ 'c': 'C++', \ 'java': 'Java', \ }, &l:filetype, '') if lang !=# '' let args += ['--languages=' . lang] endif let opt = get({ \ 'cpp': '--sort=yes --c++-kinds=+p --fields=+iaS --extra=+q', \ }, &l:filetype, '') if opt !=# '' let args += [opt] endif call map(add(args, dir), 'shellescape(v:val)') let cmd = printf('ctags -R --tag-relative=yes %s', join(args)) if s:MSWindows let cmd = 'start /b ' . cmd else let cmd .= ' &' endif silent execute '!' . cmd endfunction function! s:tagfile() let files = tagfiles() return empty(files) ? '' : files[0] endfunction endif "}}} " Capture "{{{ command! \ -nargs=+ -complete=command \ Capture \ call s:cmd_capture() function! s:cmd_capture(q_args) "{{{ redir => output silent execute a:q_args redir END let output = substitute(output, '^\n\+', '', '') belowright new silent file `=printf('[Capture: %s]', a:q_args)` setlocal buftype=nofile bufhidden=unload noswapfile nobuflisted call setline(1, split(output, '\n')) endfunction "}}} "}}} " s:has_plugin(name) "{{{ function! s:has_plugin(name) return globpath(&runtimepath, 'plugin/' . a:name . '.vim') !=# '' \ || globpath(&runtimepath, 'autoload/' . a:name . '.vim') !=# '' endfunction "}}} "}}} "--------------------------------------------------------------------------- " Plugins:"{{{ " "--------------------------------------------------------------------------- " 2html.vim:"{{{ " let g:html_number_lines = 0 let g:html_dynamic_folds = 1 "let g:html_hover_unfold = 1 "}}} "--------------------------------------------------------------------------- " vim-ref:"{{{ " autocmd MyVimrcCmd FileType vim,help setlocal keywordprg=:help let g:ref_cache_dir = $DOTVIM.'/.vim_ref_cache' " Python let g:ref_pydoc_cmd = "python -m pydoc" " webdict let g:ref_source_webdict_sites = { \ 'wikipedia:ja': { \ 'url': 'http://ja.wikipedia.org/wiki/%s', \ 'keyword_encoding': 'utf-8', \ 'cache': '0', \ }, \ 'wikipedia:en': { \ 'url': 'http://en.wikipedia.org/wiki/%s', \ 'keyword_encoding': 'utf-8', \ 'cache': '0', \ }, \ 'wiktionary': { \ 'url': 'http://ja.wiktionary.org/wiki/%s', \ 'keyword_encoding': 'utf-8', \ 'cache': '0', \ }, \ 'alc': { \ 'url': 'http://eow.alc.co.jp/%s', \ 'keyword_encoding': 'utf-8', \ 'cache': '0', \ }, \ } function! g:ref_source_webdict_sites.wiktionary.filter(output) return join(split(a:output, "\n")[18:], "\n") endfunction function! g:ref_source_webdict_sites.alc.filter(output) return join(split(a:output, "\n")[38:], "\n") endfunction let g:ref_source_webdict_sites.default = 'alc' "}}} "--------------------------------------------------------------------------- " neocomplcache:"{{{ " function! Init_neocomplcache() "{{{ NeoComplCacheEnable imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) inoremap neocomplcache#undo_completion() inoremap neocomplcache#complete_common_string() imap (neocomplcache_start_unite_quick_match) " SuperTab like snippets behavior. "imap neosnippet#expandable() ? "\(neosnippet_expand_or_jump)" : pumvisible() ? "\" : "\" " Recommended key-mappings. " : close popup and save indent. inoremap my_cr_function() function! s:my_cr_function() return pumvisible() ? neocomplcache#close_popup() . "\" : "\" endfunction " : completion. inoremap pumvisible() ? "\" : "\" " , : close popup and delete backword char. inoremap neocomplcache#smart_close_popup()."\" inoremap neocomplcache#smart_close_popup()."\" inoremap neocomplcache#close_popup() inoremap neocomplcache#cancel_popup() " For cursor moving in insert mode(Not recommended) "inoremap neocomplcache#close_popup() . "\" "inoremap neocomplcache#close_popup() . "\" "inoremap neocomplcache#close_popup() . "\" "inoremap neocomplcache#close_popup() . "\" " Or set this. "let g:neocomplcache_enable_cursor_hold_i = 1 " AutoComplPop like behavior. "let g:neocomplcache_enable_auto_select = 1 " Shell like behavior(not recommended). "set completeopt& "set completeopt+=longest "let g:neocomplcache_enable_auto_select = 1 "let g:neocomplcache_disable_auto_complete = 1 "inoremap pumvisible() ? "\" : "\\" "inoremap neocomplcache#smart_close_popup() . "\" endfunction "}}} function! Term_neocomplcache() "{{{ if neocomplcache#is_enabled() NeoComplCacheDisable iunmap sunmap iunmap iunmap iunmap iunmap iunmap iunmap iunmap iunmap iunmap endif endfunction "}}} command! InitNeoComplCache call Init_neocomplcache() command! TermNeoComplCache call Term_neocomplcache() " Disable AutoComplPop. let g:acp_enableAtStartup = 0 " Use neocomplcache. let g:neocomplcache_enable_at_startup = 0 " Use smartcase. let g:neocomplcache_enable_smart_case = 1 " Use camel case completion. let g:neocomplcache_enable_camel_case_completion = 1 " Use underbar completion. let g:neocomplcache_enable_underbar_completion = 1 " Set minimum syntax keyword length. let g:neocomplcache_min_syntax_length = 3 let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*' " Disable caching buffer name let g:neocomplcache_disable_caching_file_path_pattern = '\.ref\|\.txt' let g:neocomplcache_temporary_dir = $DOTVIM.'/.neocon' " Define dictionary. let g:neocomplcache_dictionary_filetype_lists = { \ 'default' : $DOTVIM.'/.neo_default', \ 'vimshell' : $DOTVIM.'/.vimshell_hist', \ 'scheme' : $DOTVIM.'/.gosh_completions' \ } " Define keyword. if !exists('g:neocomplcache_keyword_patterns') let g:neocomplcache_keyword_patterns = {} endif let g:neocomplcache_keyword_patterns['default'] = '\h\w*' let g:neocomplcache_enable_prefetch = 1 " For snippet_complete marker. if has('conceal') set conceallevel=2 concealcursor=i endif try if neocomplcache#is_enabled() " neocomplcache enable at startup InitNeoComplCache else " lazy loading for neocomplcache augroup MyInitNeocomplcache autocmd! autocmd InsertEnter * call Init_neocomplcache() | autocmd! MyInitNeocomplcache augroup END endif catch /E117/ endtry " Enable omni completion. autocmd MyVimrcCmd FileType css setlocal omnifunc=csscomplete#CompleteCSS autocmd MyVimrcCmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags autocmd MyVimrcCmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS autocmd MyVimrcCmd FileType python setlocal omnifunc=pythoncomplete#Complete autocmd MyVimrcCmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags " Enable heavy omni completion. if !exists('g:neocomplcache_omni_patterns') let g:neocomplcache_omni_patterns = {} endif let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::' "autocmd MyVimrcCmd FileType ruby setlocal omnifunc=rubycomplete#Complete let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::' let g:neocomplcache_omni_patterns.c = '\%(\.\|->\)\h\w*' let g:neocomplcache_omni_patterns.cpp = '\h\w*\%(\.\|->\)\h\w*\|\h\w*::' if !exists('g:neocomplcache_include_paths') let g:neocomplcache_include_paths = {} endif if s:MSWindows let g:neocomplcache_include_paths.c = "C:/MinGW/lib/gcc/mingw32/4.5.2/include" let g:neocomplcache_include_paths.cpp = "C:/MinGW/lib/gcc/mingw32/4.5.2/include/c++,C:/boost_1_47_0" endif " For clang_complete let g:neocomplcache_force_overwrite_completefunc = 1 let g:neocomplcache_ignore_composite_filetype_lists = { \ 'python.unit': 'python', \ 'php.unit': 'php', \ } "}}} "--------------------------------------------------------------------------- " clang_complete:"{{{ " let g:clang_complete_auto = 1 let g:clang_use_library = 0 " if s:MSWindows " let g:clang_exec = '"C:/GnuWin32/bin/clang.exe' " let g:clang_user_options = " \ '-I C:/boost_1_47_0 '. " \ '-fms-extensions -fmsc-version=1500 -fgnu-runtime '. " \ '-D__MSVCRT_VERSION__=0x800 -D_WIN32_WINNT=0x0500 '. " \ '2> NUL || exit 0"' " endif "}}} "--------------------------------------------------------------------------- " taghighlight:"{{{ " if exists('g:rt_cmd_registered') for ft in keys(g:rt_cmd_registered) execute 'autocmd MyVimrcCmd FileType ' . ft . ' silent! ReadTypes' endfor else let g:rt_cmd_registered = {} endif function! s:registReadTypesCmd(ft) if !get(g:rt_cmd_registered, a:ft) execute 'autocmd MyVimrcCmd FileType ' . a:ft . ' silent! ReadTypes' let g:rt_cmd_registered[a:ft] = 1 endif endfunction "}}} "--------------------------------------------------------------------------- " vim-fugitive:"{{{ " nnoremap gd :Gdiff nnoremap gs :Gstatus nnoremap gl :Extradite nnoremap ga :Gwrite nnoremap gc :Gcommit nnoremap gC :Git commit --amend nnoremap gb :Gblame nnoremap gv :Gitv nnoremap gV :Gitv! "}}} "--------------------------------------------------------------------------- " unite.vim:"{{{ " " The prefix key. nnoremap [unite] nmap f [unite] nnoremap [unite]a :Unite -prompt=#\ buffer bookmark file_mru file nnoremap [unite]b :UniteWithBufferDir -buffer-name=files -prompt=%\ buffer bookmark file_mru file nnoremap [unite]c :UniteWithCurrentDir -buffer-name=files buffer bookmark file_mru file nnoremap [unite]e :Unite -buffer-name=files everything nnoremap [unite]f :Unite source nnoremap [unite]g ':Unite grep:*::' . expand("") nnoremap [unite]h :UniteWithCursorWord help nnoremap [unite]m :Unite mark -no-quit nnoremap [unite]o :Unite outline nnoremap [unite]pi :Unite neobundle/install nnoremap [unite]pu :Unite neobundle/update nnoremap [unite]pl :Unite neobundle nnoremap [unite]r :Unite -buffer-name=register register nnoremap [unite]s :Unite scriptnames nnoremap [unite]t :Unite buffer_tab tab buffer let g:unite_kind_file_cd_command = 'TabpageCD' let g:unite_kind_file_lcd_command = 'TabpageCD' " Start insert. let g:unite_enable_start_insert = 1 autocmd MyVimrcCmd FileType unite call s:unite_my_settings() function! s:unite_my_settings() "{{{ " Overwrite settings. nmap (unite_exit) imap jj (unite_insert_leave) imap (unite_delete_backward_path) inoremap unite#do_action('insert') " : manual neocomplcache completion. inoremap endfunction "}}} let g:unite_source_file_mru_limit = 200 let g:unite_source_grep_max_candidates = 50000 " For optimize. let g:unite_source_file_mru_filename_format = '' let g:unite_data_directory = $DOTVIM.'/.unite' " highlight UniteAbbr guifg=#80a0ff gui=underline " highlight UniteCursor guifg=black guibg=lightblue gui=bold let g:unite_cursor_line_highlight = 'UniteCursor' let g:unite_abbr_highlight = 'UniteAbbr' "}}} "--------------------------------------------------------------------------- " textobj-user:"{{{ " " textobj-ruledline "{{{ " ruled line for rst's table if s:has_plugin('textobj/user') call textobj#user#plugin('ruledline', { \ '-': { \ '*pattern*': '-\+', \ 'select': ['aR', 'iR'], \ }, \ }) endif "}}} "}}} "--------------------------------------------------------------------------- " textobj-comment:"{{{ " let g:textobj_comment_no_default_key_mappings = 1 omap ao (textobj-comment-a) xmap ao (textobj-comment-a) omap io (textobj-comment-i) xmap io (textobj-comment-i) "}}} "--------------------------------------------------------------------------- " textobj-wiw:"{{{ " omap am (textobj-wiw-a) xmap am (textobj-wiw-a) omap im (textobj-wiw-i) xmap im (textobj-wiw-i) "}}} "--------------------------------------------------------------------------- " operator-user:"{{{ " if s:has_plugin('operator/user') " operator-fillblank "{{{ " replace selection with space function! OperatorFillBlank(motion_wise) let v = operator#user#visual_command_from_wise_name(a:motion_wise) execute 'normal! '. v . '`["x`]r ' endfunction call operator#user#define('fillblank', 'OperatorFillBlank') map b (operator-fillblank) "}}} " operator-retab "{{{ call operator#user#define_ex_command('retab', 'retab') map t (operator-retab) "}}} " operator-join "{{{ call operator#user#define_ex_command('join', 'join') map j (operator-join) "}}} " operator-uniq "{{{ call operator#user#define_ex_command('uniq', 'sort u') map u (operator-uniq) "}}} " operator-blank-killer "{{{ call operator#user#define_ex_command('blank-killer', 's/\s\+$//') map k (operator-blank-killer) "}}} endif "}}} "--------------------------------------------------------------------------- " operator-replace:"{{{ " map _ (operator-replace) "}}} "--------------------------------------------------------------------------- " operator-camelize:"{{{ " map c (operator-camelize) map C (operator-decamelize) "}}} "--------------------------------------------------------------------------- " operator-reverse:"{{{ " map rl (operator-reverse-lines) map rt (operator-reverse-text) "}}} "--------------------------------------------------------------------------- " operator-sort:"{{{ " map s (operator-sort) "}}} "--------------------------------------------------------------------------- " qfixhown.vim:"{{{ " let QFixHowm_Key = 'g' let QFixHowm_KeyB = ',' let howm_dir = $DOTVIM.'/howm' let howm_filename = '%Y/%m/%Y-%m-%d-%H%M%S.howm' let howm_fileencoding = 'utf-8' let howm_fileformat = 'dos' "}}} "--------------------------------------------------------------------------- " qfixmemo.vim:"{{{ " let qfixmemo_dir = $DOTVIM.'/qfixmemo' let qfixmemo_filename = '%Y/%m/%Y-%m-%d-%H%M%S.txt' let qfixmemo_fileencoding = 'cp932' let qfixmemo_fileformat = 'dos' let qfixmemo_filetype = 'qfix_memo' "}}} "--------------------------------------------------------------------------- " qfixmru.vim:"{{{ " let QFixMRU_Filename = $DOTVIM.'/.qfixmru' let QFixMRU_IgnoreFile = '' let QFixMRU_RegisterFile = '' let QFixMRU_IgnoreTitle = '' let g:QFixMRU_Entries = 20 let QFixMRU_EntryMax = 300 "}}} "--------------------------------------------------------------------------- " qfixgrep.vim:"{{{ " let QFix_PreviewEnable = 0 let QFix_HighSpeedPreview = 0 let QFix_DefaultPreview = 0 let QFix_PreviewExclude = '\.pdf$\|\.mp3$\|\.jpg$\|\.bmp$\|\.png$\|\.zip$\|\.rar$\|\.exe$\|\.dll$\|\.lnk$' let QFix_CopenCmd = '' let QFix_Height = 10 let QFix_Width = 0 set previewheight=12 let QFix_PreviewHeight = 12 set winwidth=20 let QFix_WindowHeightMin = 0 let QFix_PreviewOpenCmd = '' let QFix_PreviewWidth = 0 let QFix_HeightFixMode = 0 let QFix_CloseOnJump = 0 let QFix_Edit = 'tab' let QFix_PreviewFtypeHighlight = 1 let QFix_CursorLine = 1 let QFix_PreviewCursorLine = 1 "hi CursorLine guifg=NONE guibg=NONE gui=underline let QFix_Copen_winfixheight = 1 let QFix_Copen_winfixwidth = 1 let QFix_Preview_winfixheight = 1 let QFix_Preview_winfixwidth = 1 let MyGrep_ExcludeReg = '[~#]$\|\.bak$\|\.o$\|\.obj$\|\.exe$\|[/\\]tags$\|[/\\]svn[/\\]\|[/\\]\.git[/\\]\|[/\\]\.hg[/\\]' let mygrepprg = 'grep' let MyGrep_ShellEncoding = 'cp932' let MyGrep_Damemoji = 2 let MyGrep_DamemojiReplaceReg = '(..)' let MyGrep_DamemojiReplace = '[]' let MyGrep_yagrep_opt = 0 let MyGrepcmd_useropt = '' "let MyGrep_Key = 'g' "let MyGrep_KeyB = ',' let MyGrep_DefaultSearchWord = 1 let MyGrep_MenuBar = 3 autocmd MyVimrcCmd QuickfixCmdPre make,grep,grepadd,vimgrep,vimgrepadd,helpgrep copen "}}} "--------------------------------------------------------------------------- " vim-hier:"{{{ " " To highlight with a undercurl in quickfix error execute "highlight qf_error_ucurl gui=undercurl guisp=Red" let g:hier_highlight_group_qf = "qf_error_ucurl" function! ResetHierAutocmd() autocmd! Hier endfunction augroup MyHier autocmd! autocmd QuickFixCmdPre * call ResetHierAutocmd() augroup END "}}} "--------------------------------------------------------------------------- " vim-indent-guides:"{{{ " "let g:indent_guides_indent_levels = 30 let g:indent_guides_auto_colors = 1 "let g:indent_guides_color_change_percent = 10 let g:indent_guides_guide_size = 1 let g:indent_guides_start_level = 2 "let g:indent_guides_space_guides = 0 let g:indent_guides_enable_on_vim_startup = 1 try IndentGuidesEnable catch /E492/ endtry "}}} "--------------------------------------------------------------------------- " MultipleSearch:"{{{ " let g:MultipleSearchMaxColors=13 let g:MultipleSearchColorSequence="red,yellow,blue,green,magenta,lightred,cyan,lightyellow,gray,brown,lightblue,darkmagenta,darkcyan" let g:MultipleSearchTextColorSequence="white,black,white,black,white,black,black,black,black,white,black,white,white" try Search SearchReinit SearchReset catch /E492/ endtry "}}} "--------------------------------------------------------------------------- " rainbowcyclone.vim:"{{{ " if s:has_plugin('rainbowcyclone') nmap c/ (rc_search_forward) nmap c? (rc_search_backward) nmap c* (rc_search_forward_with_cursor) nmap c# (rc_search_backward_with_cursor) nmap cn (rc_search_forward_with_last_pattern) nmap cN (rc_search_backward_with_last_pattern) " nmap (rc_reset):nohlsearch nnoremap :RCReset:nohlsearch endif "}}} "--------------------------------------------------------------------------- " vim-textmanip:"{{{ " xmap (textmanip-move-down) xmap (textmanip-move-up) xmap (textmanip-move-left) xmap (textmanip-move-right) xmap (textmanip-duplicate-down) nmap (textmanip-duplicate-down) xmap (textmanip-duplicate-up) nmap (textmanip-duplicate-up) "}}} "--------------------------------------------------------------------------- " tcomment_vim:"{{{ " let g:tcommentMapLeaderOp1 = ',c' let g:tcommentMapLeaderOp2 = ',C' "}}} "--------------------------------------------------------------------------- " eregex.vim:"{{{ " nnoremap ,/ :M/ nnoremap ,? :M? "}}} "--------------------------------------------------------------------------- " ideone-vim:"{{{ " let g:ideone_put_url_to_clipboard_after_post = 0 let g:ideone_open_buffer_after_post = 1 "}}} "--------------------------------------------------------------------------- " project.tar.gz:"{{{ " let g:proj_flags = "imstc" nmap P ToggleProject "}}} "--------------------------------------------------------------------------- " vimfiler:"{{{ " nnoremap [vimfiler] nmap v [vimfiler] nnoremap [vimfiler]b :VimFilerBufferDir nnoremap [vimfiler]c :VimFilerCurrentDir nnoremap [vimfiler]d :VimFilerDouble nnoremap [vimfiler]f :VimFilerSimple -no-quit -winwidth=32 nnoremap [vimfiler]s :VimShell " Edit file by tabedit. let g:vimfiler_edit_action = 'open' let g:vimfiler_split_action = 'tabopen' let g:vimfiler_as_default_explorer = 1 if s:MSWindows let g:unite_kind_file_use_trashbox = 1 endif " Enable file operation commands. let g:vimfiler_safe_mode_by_default = 0 let g:vimfiler_data_directory = $DOTVIM.'/.vimfiler' let g:vimfiler_execute_file_list={ \ 'txt': 'vim', \ 'vim': 'vim' \ } "}}} "--------------------------------------------------------------------------- " vimshell:"{{{ " let g:vimshell_interactive_encodings = {'git': 'utf-8'} let g:vimshell_temporary_directory = $DOTVIM.'/.vimshell' let g:vimshell_vimshrc_path = $DOTVIM.'/.vimshell/.vimshrc' let g:vimshell_cd_command = 'TabpageCD' let g:vimshell_scrollback_limit = 50000 autocmd MyVimrcCmd FileType vimshell call s:vimshell_settings() function! s:vimshell_settings() inoremap unite#sources#vimshell_history#start_complete(!0) inoremap unite#sources#vimshell_history#start_complete(!0) endfunction "}}} "--------------------------------------------------------------------------- " vim-quickrun:"{{{ " if !exists('g:quickrun_config') let g:quickrun_config = {} endif let g:quickrun_config['_'] = { \ 'hook/close_unite_quickfix/enable_hook_loaded' : 1, \ 'hook/unite_quickfix/enable_failure' : 1, \ 'hook/close_quickfix/enable_exit' : 1, \ 'hook/close_buffer/enable_failure' : 1, \ 'hook/close_buffer/enable_empty_data' : 1, \ 'outputter' : 'multi:buffer:quickfix', \ 'hook/inu/enable' : 1, \ 'hook/inu/wait' : 20, \ 'outputter/buffer/split' : ':botright 8sp', \ 'runner' : 'vimproc', \ 'runner/vimproc/updatetime' : 40, \ } " settings for pandoc "{{{ let g:quickrun_config['markdown'] = { \ 'type': 'markdown/pandoc', \ 'outputter': 'browser', \ 'cmdopt': '-s' \ } "}}} " settings for sphinx "{{{ let g:quickrun_config['rst'] = { \ 'command': 'make', \ 'outputter': 'quickfix', \ 'hook/sphinx_open/enable' : 1, \ 'hook/sphinx_html2pdf/enable' : 1, \ 'hook/sphinx_html2pdf/options': [ \ '-B 0', \ '-L 0', \ '-R 0', \ '-T 0', \ ], \ 'cmdopt': 'html', \ 'exec': '%c %o' \ } "}}} "}}} "--------------------------------------------------------------------------- " vim-ambicmd:"{{{ " if s:has_plugin('ambicmd') cnoremap ambicmd#expand("\") cnoremap ambicmd#expand("\") cnoremap ambicmd#expand("\") autocmd MyVimrcCmd CmdwinEnter * call s:init_cmdwin_ambicmd() function! s:init_cmdwin_ambicmd() inoremap ambicmd#expand("\") inoremap ambicmd#expand("\") endfunction endif "}}} "--------------------------------------------------------------------------- " tcommand_vim:"{{{ " noremap : :TCommand "}}} "--------------------------------------------------------------------------- " Source-Explorer-srcexpl.vim:"{{{ " " // The switch of the Source Explorer " " nmap :SrcExplToggle " " " // Set the height of Source Explorer window " let g:SrcExpl_winHeight = 8 " " " // Set 100 ms for refreshing the Source Explorer " let g:SrcExpl_refreshTime = 100 " " " // Set "Enter" key to jump into the exact definition context " let g:SrcExpl_jumpKey = "" " " " // Set "Space" key for back from the definition context " let g:SrcExpl_gobackKey = "" " " " // In order to Avoid conflicts, the Source Explorer should know what plugins " " // are using buffers. And you need add their bufname into the list below " " // according to the command ":buffers!" " let g:SrcExpl_pluginList = [ \ "__Tag_List__", \ "_NERD_tree_", \ "Source_Explorer" \ ] " " " // Enable/Disable the local definition searching, and note that this is not " " // guaranteed to work, the Source Explorer doesn't check the syntax for now. " " // It only searches for a match with the keyword according to command 'gd' " let g:SrcExpl_searchLocalDef = 1 " " " // Do not let the Source Explorer update the tags file when opening " let g:SrcExpl_isUpdateTags = 0 " " " // Use 'Exuberant Ctags' with '--sort=foldcase -R .' or '-L cscope.files' to " " // create/update a tags file " let g:SrcExpl_updateTagsCmd = "ctags --sort=foldcase -R ." " " " // Set "" key for updating the tags file artificially " " let g:SrcExpl_updateTagsKey = "" "}}} "--------------------------------------------------------------------------- " gtags.vim:"{{{ " nmap gs :Gtags -s =expand("") nmap gg :Gtags -g =expand("") nmap gf :Gtags -f =expand("") nmap gr :Gtags -r =expand("") nmap gd :Gtags -d =expand("") "}}} "--------------------------------------------------------------------------- " python-mode:"{{{ " let g:pymode_lint_onfly = 1 let g:pymode_lint_write = 1 let g:pymode_lint_cwindow = 0 let g:pymode_lint_message = 1 let g:pydoc = "python -m pydoc" let g:pymode_rope = 0 let g:pymode_folding = 0 "}}} "--------------------------------------------------------------------------- " perl-support.vim:"{{{ " let g:Perl_Debugger = "ptkdb" "}}} "--------------------------------------------------------------------------- " jslint.vim:"{{{ " autocmd MyVimrcCmd FileType javascript call s:registJSLintCmd() let s:jslint_enabled = s:has_plugin('jslint') && \ s:MSWindows || \ exists("$JS_CMD") || \ executable('/System/Library/Frameworks/JavaScriptCore.framework/Resources/jsc') || \ executable('node') || \ executable('js') let g:jslint_cmd_registered = [] function! s:registJSLintCmd() if s:jslint_enabled && index(g:jslint_cmd_registered, bufnr('%')) < 0 call add(g:jslint_cmd_registered, bufnr('%')) autocmd MyVimrcCmd BufLeave call jslint#clear() autocmd MyVimrcCmd BufWritePost call jslint#check() autocmd MyVimrcCmd InsertLeave call jslint#check() autocmd MyVimrcCmd CursorMoved call jslint#message() endif endfunction "}}} "--------------------------------------------------------------------------- " haskellmode-vim:"{{{ " if s:MSWindows let g:haddock_browser="C:/Program\ Files/Mozilla\ Firefox/firefox.exe" else let g:haddock_browser="/usr/bin/firefox" endif "}}} "--------------------------------------------------------------------------- " vimclojure:"{{{ " let g:clj_highlight_builtins = 1 let g:clj_paren_rainbow = 1 "}}} "--------------------------------------------------------------------------- " neobundle.vim:"{{{ " function! LazyLoading(ft) for plugin_name in g:ll_plugins[a:ft] execute "silent! NeoBundleSource " . plugin_name endfor execute "autocmd! NeoBundleSourceFor_" . a:ft if exists('g:ll_post_process[a:ft]') for post_process in g:ll_post_process[a:ft] execute post_process endfor endif endfunction let g:ll_plugins={} let g:ll_plugins['c'] = [ \ 'taglist.vim', \ 'taghighlight', \ 'a.vim', \ 'c.vim', \ 'Source-Explorer-srcexpl.vim', \ 'trinity.vim', \ 'cscope-menu', \ 'gtags.vim', \ 'DoxygenToolkit.vim', \ ] let g:ll_plugins['cpp'] = [ \ 'taglist.vim', \ 'taghighlight', \ 'a.vim', \ 'c.vim', \ 'Source-Explorer-srcexpl.vim', \ 'trinity.vim', \ 'cscope-menu', \ 'gtags.vim', \ 'DoxygenToolkit.vim', \ ] let g:ll_plugins['python'] = [ \ 'pytest.vim', \ 'python-mode', \ 'taglist.vim', \ 'taghighlight', \ ] let g:ll_plugins['perl'] = [ \ 'perl-support.vim', \ 'taglist.vim', \ 'taghighlight', \ ] let g:ll_plugins['javascript'] = [ \ 'vim-javascript', \ 'jslint.vim', \ 'taghighlight', \ ] let g:ll_plugins['haskell'] = [ \ 'vim-filetype-haskell', \ 'haskellmode-vim', \ 'vim-syntax-haskell-cabal', \ 'ghcmod-vim', \ ] let g:ll_post_process={} let g:ll_post_process['c'] = [ \ 'call s:registReadTypesCmd("c")', \ 'silent! ReadTypes' \ ] let g:ll_post_process['cpp'] = [ \ 'call s:registReadTypesCmd("cpp")', \ 'silent! ReadTypes' \ ] let g:ll_post_process['python'] = [ \ 'call s:registReadTypesCmd("python")', \ 'silent! ReadTypes' \ ] let g:ll_post_process['perl'] = [ \ 'call s:registReadTypesCmd("perl")', \ 'silent! ReadTypes' \ ] let g:ll_post_process['javascript'] = [ \ 'call s:registReadTypesCmd("javascript")', \ 'silent! ReadTypes' \ ] if has('vim_starting') " lazy loading of each filetype if exists("g:ll_plugins") && !s:Android for k in keys(g:ll_plugins) execute "augroup " . "NeoBundleSourceFor_" . k execute "autocmd!" execute "autocmd FileType " . k . " call LazyLoading('" . k . "')" execute "augroup END" endfor endif endif " lazy loading for vim-ref if !exists('s:did_load_vimref') nnoremap K :call LoadVimRef()K vnoremap K :call LoadVimRef()K command! -nargs=+ Ref \ execute 'silent! NeoBundleSource vim-ref' \ | call ref#ref() function! LoadVimRef() nunmap K vunmap K silent! NeoBundleSource vim-ref let s:did_load_vimref = 1 endfunction endif " lazy loading for vimfiler if !exists('s:did_load_vimfiler') nnoremap [vimfiler]b :call LoadVimFiler('VimFilerBufferDir') nnoremap [vimfiler]c :call LoadVimFiler('VimFilerCurrentDir') nnoremap [vimfiler]d :call LoadVimFiler('VimFilerDouble') nnoremap [vimfiler]f :call LoadVimFiler('VimFilerSimple -no-quit -winwidth=32') " for retry vimfiler command " vimfiler needs a few seconds to load with low-spec PC function! LoadVimFiler(vimfiler_cmd) silent! NeoBundleSource vimfiler let s:is_vimfiler_loading = 1 while s:is_vimfiler_loading try silent! execute a:vimfiler_cmd let s:is_vimfiler_loading = 0 catch /E127/ sleep 1 endtry endwhile let s:did_load_vimfiler = 1 endfunction endif " lazy loading for vim-quickrun if !exists('s:did_load_quickrun') nnoremap r :call LoadQuickRun():QuickRun -mode n vnoremap r :call LoadQuickRun():QuickRun -mode v command! -nargs=* -range=0 QuickRun \ call LoadQuickRun() \ | call quickrun#command(, , , ) command! -nargs=* -range=0 WatchdogsRun \ delcommand WatchdogsRun \ | call LoadQuickRun() \ | WatchdogsRun command! -nargs=* -range=0 WatchdogsRunSilent \ delcommand WatchdogsRunSilent \ | call LoadQuickRun() \ | WatchdogsRunSilent function! LoadQuickRun() silent! NeoBundleSource vim-quickrun silent! NeoBundleSource quicklearn silent! NeoBundleSource vim-watchdogs silent! NeoBundleSource shabadou.vim call watchdogs#setup(g:quickrun_config) let s:did_load_quickrun = 1 endfunction endif "}}} "}}} "--------------------------------------------------------------------------- " Key Mappings:"{{{ " nnoremap Y y$ nnoremap X ^x " leave insertmode " inoremap j getline('.')[col('.') - 2] ==# 'j' ? "\\" : 'j' inoremap jj " insert blank in normal mode nnoremap i nnoremap o nnoremap O " Tabpage related mappings nnoremap tn :tabnew nnoremap tc :tabclose " Window related mappings nnoremap j nnoremap k nnoremap h nnoremap l inoremap j inoremap k inoremap h inoremap l nnoremap + nnoremap - nnoremap > > nnoremap < inoremap + inoremap - inoremap > > inoremap < " Move to the position last edited nnoremap gb '[ nnoremap gp '] " 'Quote' onoremap aq a' xnoremap aq a' onoremap iq i' xnoremap iq i' " "Double quote" onoremap ad a" xnoremap ad a" onoremap id i" xnoremap id i" " (Round bracket) onoremap ar a) xnoremap ar a) onoremap ir i) xnoremap ir i) " {Curly bracket} onoremap ac a} xnoremap ac a} onoremap ic i} xnoremap ic i} " onoremap aa a> xnoremap aa a> onoremap ia i> xnoremap ia i> " [sqUare bracket] onoremap au a] xnoremap au a] onoremap iu i] xnoremap iu i] "}}} "--------------------------------------------------------------------------- " FileTypes:"{{{ " autocmd MyVimrcCmd FileType rst setlocal suffixesadd=.rst "}}} "--------------------------------------------------------------------------- " External Settings:"{{{ " if 1 && filereadable($MYLOCALVIMRC) source $MYLOCALVIMRC endif "}}} " vim: foldmethod=marker