Skip to content

Instantly share code, notes, and snippets.

@koturn
Last active August 29, 2015 14:25
Show Gist options
  • Save koturn/47cb92bcb017bd0dc09a to your computer and use it in GitHub Desktop.
Save koturn/47cb92bcb017bd0dc09a to your computer and use it in GitHub Desktop.
2015/07/20の.vimrc
" ============================================================
" __ __ ____
" / /______ / /___ ___________ / __ \ _
" / //_/ __ \/ __/ / / / ___/ __ \ / / / /(_)
" / ,< / /_/ / /_/ /_/ / / / / / / / /_/ / _
" /_/|_|\____/\__/\__,_/_/ /_/ /_/ \____/ ( )
" |/
"
" The setting file for GUI only.
" ============================================================
" ------------------------------------------------------------
" Basic settings
" ------------------------------------------------------------
if has('kaoriya')
set guioptions=
else
set guioptions=
endif
set winaltkeys=no " Turns off the Alt key bindings to the gui menu
set cursorline cursorcolumn
set guicursor+=a:blinkon0
" function! s:SID() abort
" return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
" endfun
" let s:sid = s:SID()
" delfunction s:SID
"
" function! s:balloon_expr() abort
" let lnum = foldclosed(v:beval_lnum)
" if lnum == -1
" return ''
" endif
" let lines = getline(lnum, foldclosedend(lnum))
" return iconv(join(len(lines) > &lines ? lines[: &lines] : lines, "\n"), &enc, &tenc)
" endfunction
" let &balloonexpr = '<SNR>' . s:sid . '_balloon_expr()'
" set ballooneval
" Change cursor color depending on state of IME.
if has('multi_byte_ime') || has('xim')
autocmd MyAutoCmd Colorscheme * hi CursorIM guifg=NONE guibg=Orange
" Default state of IME on insert mode and searching mode.
set iminsert=0 imsearch=0 " for no KaoriYa WIN gvim
endif
if exists('+antialias')
set antialias
endif
if g:is_windows
set guifont=Consolas:h9 guifontwide=MS_Gothic:h9
""" Setting for menubar
" set langmenu=ja_jp.utf-8
" source $VIMRUNTIME/delmenu.vim
" source $VIMRUNTIME/menu.vim
elseif has('xfontset')
set guifontset=a14,r14,k14
elseif g:is_mac
set guifont=Osaka-Mono:h14
endif
" ------------------------------------------------------------
" Setting written in gvimrc of KaoriYa-vim
" ------------------------------------------------------------
set linespace=1
" Disable auto focus with mouse moving.
set nomousefocus
" Hide mouse-pointer when you input.
set mousehide
" ------------------------------------------------------------
" END of .gvimrc
" ------------------------------------------------------------
if has('kaoriya')
gui
if g:is_windows
let s:transparencies = [240, 210]
function! s:toggle_transparency() abort
if s:transparencies == [255, 255]
let s:transparencies = [240, 210]
else
let s:transparencies = [255, 255]
endif
doautocmd FocusGained
endfunction
else
let s:transparencies = [15, 30]
function! s:toggle_transparency() abort
if s:transparencies == [0, 0]
let s:transparencies = [15, 30]
else
let s:transparencies = [0, 0]
endif
doautocmd FocusGained
endfunction
endif
command! -bar ToggleTransparency call s:toggle_transparency()
augroup MyAutoCmd
autocmd FocusGained,WinEnter * let &transparency=s:transparencies[0]
autocmd FocusLost * let &transparency=s:transparencies[1]
augroup END
endif
set t_vb=
if 0 | endif
if &compatible && has('vim_starting')
set nocompatible
endif
" =============================================================================
" __ __ ____
" / /______ / /___ ___________ / __ \ _
" / //_/ __ \/ __/ / / / ___/ __ \ / / / /(_)
" / ,< / /_/ / /_/ /_/ / / / / / / / /_/ / _
" /_/|_|\____/\__/\__,_/_/ /_/ /_/ \____/ ( )
" |/
"
" This .vimrc was mainly written for Windows.
" But you can also use in Cygwin or UNIX/Linux.
" In Windows, you have to put this in HOME-directory.
" ==============================================================================
" ------------------------------------------------------------------------------
" Initialize and Variables {{{
" ------------------------------------------------------------------------------
" Variables for various environment.
let s:startuptime = reltime()
let g:is_windows = has('win16') || has('win32') || has('win64')
let g:is_cygwin = has('win32unix')
let g:is_mac = !g:is_windows && (has('mac') || has('macunix') || has('gui_macvim')
\ || (!isdirectory('/proc') && executable('sw_vers')))
let g:is_unix = has('unix')
let s:is_cui = !has('gui_running')
let g:at_startup = has('vim_starting')
" let s:is_tmux = $TMUX ==# ''
" let s:is_ssh = $SSH_TTY ==# ''
" let s:is_android = has('unix')
" \ && ($HOSTNAME ==? 'android' || $VIM =~? 'net\.momodalo\.app\.vimtouch')
if !exists($MYGVIMRC)
let $MYGVIMRC = $HOME . '/.gvimrc'
endif
let $DOTVIM = $HOME . '/.vim'
let $NEOBUNDLE_DIR = $DOTVIM . '/bundle'
" If $DOTVIM/.private.vim is exists, ignore error.
if filereadable(expand('$DOTVIM/.private.vim'))
source $DOTVIM/.private.vim
else
let g:private = {}
endif
augroup MyAutoCmd
autocmd!
augroup END
" Measure startup time.
if g:at_startup && has('reltime')
autocmd MyAutoCmd VimEnter *
\ redraw
\ | echomsg 'startuptime:' reltimestr(reltime(s:startuptime))
\ | unlet s:startuptime
endif
" Singleton (if !s:is_cui)
if g:at_startup && has('clientserver')
let s:running_vim_list = filter(split(serverlist(), '\n'), 'v:val !=? v:servername')
if !empty(s:running_vim_list)
if !argc()
quitall!
endif
if g:is_windows
if s:is_cui
silent !cls
endif
let s:vim_cmd = '!start gvim'
else
let s:vim_cmd = '!gvim'
endif
silent execute s:vim_cmd
\ '--servername' s:running_vim_list[0]
\ '--remote-tab-silent' join(map(argv(), 'fnameescape(v:val)'), ' ')
quitall!
endif
unlet s:running_vim_list
endif
" Add directory under plugins directory to runtimepath
if g:at_startup && has('kaoriya')
function! s:full_plugin() abort
for path in split(glob($VIM . '/plugins/*'), '\n')
if path !~# '\~$' && isdirectory(path)
let &rtp .= ',' . path
endif
endfor
function! s:open_help_en_jp(args) abort
let en = a:args . '@en'
let ja = a:args . '@ja'
execute 'tab help' en
setlocal scrollbind
split
execute 'help' ja
setlocal scrollbind
endfunction
command! -nargs=1 -complete=help Help call s:open_help_en_jp('<args>')
delcommand FullInstall
endfunction
command! -bar FullInstall call s:full_plugin()
endif
" Timer {{{
if g:at_startup
let s:Timer = {
\ 'elapsed_time': 0.0,
\ 'is_stopped': 1
\}
function! s:Timer.new(name) abort
let timer = copy(self)
let timer.name = a:name
call timer.start()
return timer
endfunction
function! s:Timer.start() abort dict
if self.is_stopped
let self.is_stopped = 0
let self.start_time = reltime()
endif
endfunction
function! s:Timer.stop() abort dict
if !self.is_stopped
let self.elapsed_time += str2float(reltimestr(reltime(self.start_time)))
let self.is_stopped = 1
endif
endfunction
function! s:Timer.get_elapsed_time() abort dict
return self.elapsed_time + (self.is_stopped ? 0.0 : str2float(reltimestr(reltime(self.start_time))))
endfunction
function! s:Timer.show() abort dict
let t = s:convert_time(self.get_elapsed_time())
echo printf('%16s: %2d days %02d:%02d:%02d.%1d', self.name, t.day, t.hour, t.minute, t.second, t.msec)
endfunction
function! s:convert_time(time) abort
let integer_part = float2nr(a:time)
let decimal_part = a:time - integer_part
let t = {
\ 'day': integer_part / 86400,
\ 'msec': float2nr((decimal_part + 0.000001) * 10)
\}
let integer_part = integer_part % 86400
let t.hour = integer_part / 3600
let integer_part = integer_part % 3600
let t.minute = integer_part / 60
let t.second = integer_part % 60
return t
endfunction
let s:startupdate = strftime('%Y/%m/%d %H:%M:%S')
let s:timer_launched = s:Timer.new('Launched Time')
let s:timer_active = s:Timer.new('Active Time')
let s:timer_used = s:Timer.new('Used Time')
unlet s:Timer
function! s:show_time_info() abort
echo 'Launched at:' s:startupdate
call s:timer_launched.show()
call s:timer_active.show()
call s:timer_used.show()
endfunction
command! -bar ShowTimeInfo call s:show_time_info()
endif
autocmd MyAutoCmd FocusGained,WinEnter * call s:timer_active.start()
autocmd MyAutoCmd FocusLost * call s:timer_active.stop()
autocmd MyAutoCmd CursorHold,CursorHoldI,FocusLost * call s:timer_used.stop()
autocmd MyAutoCmd CursorMoved,CursorMovedI * call s:timer_used.start()
" }}}
" let s:timer_used.clock = 0
" let s:timer_used.time_to_stop = 30000
" function! s:timer_used.update() abort dict
" if self.clock < self.time_to_stop && !self.is_stopped
" call feedkeys(mode() ==# 'i' ? "\<C-g>\<ESC>" : "g\<ESC>", 'n')
" let self.clock += &updatetime
" else
" echo 'Stopped'
" call self.stop()
" let self.clock = 0
" endif
" endfunction
"
" function! s:timer_used.wakeup() abort dict
" let self.clock = 0
" call self.start()
" endfunction
"
" autocmd MyAutoCmd CursorHold,CursorHoldI * call s:timer_used.update()
" autocmd MyAutoCmd CursorMoved,CursorMovedI * call s:timer_used.wakeup()
" }}}
" ------------------------------------------------------------------------------
" Basic settings {{{
" ------------------------------------------------------------------------------
let s:_executable = {}
function! s:executable(cmd)
if !has_key(s:_executable, a:cmd)
let s:_executable[a:cmd] = executable(a:cmd)
endif
return s:_executable[a:cmd]
endfunction
source $VIMRUNTIME/macros/matchit.vim
let g:hl_matchit_enable_on_vim_startup = 1
let g:hl_matchit_speed_level = 1
let g:hl_matchit_allow_ft_regexp = 'html\|vim\|sh'
language message C
language time C
set helplang=ja
" Hide splash screen.
set shortmess& shortmess+=I
" Enable to use '/' for direstory path separator on Windows.
set shellslash
" Enable square-selecting if charactors don't exist.
set virtualedit=block
set autoread
" Turn off word wrap.
set nowrap
if exists('+breakindent')
set breakindent
set breakindentopt=min:40,shift:-1
endif
set synmaxcol=1000
" Turn off start a new line sutomatically.
set textwidth=0
" Markers are three '{' and three '}'.
set foldmethod=marker
" Set browsedir at directory which is edit on buffer.
set browsedir=buffer
" Enable show other file when you change a file.
set hidden
" When the closed brackets is inputted, show the matching open brackets.
set showmatch
" Identify upper case characters and lower case characters
" if a word for searching includes upper case cahracters.
set smartcase
" Don't stop cursor at start of line and end of line.
set whichwrap=b,s,h,l,<,>,[,]
" Setting for split windows.
" set splitbelow splitright
" Mute beep.
" set errorbells
" set novisualbell
" set visualbell t_vb=
set visualbell t_vb=
" Don't redraw while execute scripts
set lazyredraw
" Swap file.
set noswapfile
" Backup file.
set nobackup nowritebackup
if has('persistent_undo')
set noundofile
endif
" file of '_viminfo'.
set viminfo=
" Show vertical line at column-80
set colorcolumn=+1,+21
" Open buffer which already exists instead of opening new.
set switchbuf=useopen,usetab
" Settng for C-a adding and C-x subtracting.
set more
set formatoptions=nroqB
if v:version >= 704
set formatoptions+=j
endif
set nojoinspaces
set nrformats=alpha,octal,hex
set scrolloff=5
if s:is_cui
set ttyfast
set ttyscroll=3
set notimeout
set ttimeout
set timeoutlen=100
else
set timeout
set timeoutlen=500
set ttimeoutlen=100
endif
" Indent settings
set autoindent smartindent
set expandtab smarttab
set shiftwidth=2 tabstop=2 softtabstop=2
set shiftround
set copyindent
" Show line number.
set number
set updatetime=1500
" title
" set title
" set titlelen=95
" set titlestring=Vim:\ %f\ %h%r%m
" Use vim-help
" if get(g:private, 'browser_cmd', '') ==# ''
" set keywordprg=
" else
" let &keywordprg = g:private.browser_cmd
" endif
if s:executable('man')
autocmd MyAutoCmd FileType c setlocal keywordprg=man
endif
autocmd MyAutoCmd FileType help,vim setlocal keywordprg=:help
if s:executable('firefox')
set keywordprg=firefox\ -search
else
set keywordprg=:help
endif
" spell check language
set spelllang=en,cjk
" complete
set completeopt=menu,preview
set showfulltag
set wildoptions=tagfile
" Setting for grep
if s:executable('ag')
set grepprg=ag\ --nogroup\ -iS
set grepformat=%f:%l:%m
elseif s:executable('ack')
set grepprg=ack\ --nogroup
set grepformat=%f:%l:%m
elseif s:executable('grep')
set grepprg=grep\ -Hnd\ skip\ -r
set grepformat=%f:%l:%m,%f:%l%m,%f\ \ %l%m
else
set grepprg=internal
endif
" Setting for printing.
if has('printer') && g:is_windows
set printoptions=number:y,header:0,syntax:y,left:5pt,right:5pt,top:10pt,bottom:10pt
set printfont=Consolas:h8 printmbfont=r:MS_Gothic:h8,a:yes
endif
if v:version > 704 || v:version == 704 && has('patch399')
set cryptmethod=blowfish2
elseif v:version >= 703
set cryptmethod=blowfish
else
set cryptmethod=zip
endif
if has('clipboard')
if has('unnamedplus')
set clipboard=unnamedplus,autoselect
cnoremap <M-P> <C-r>+
vnoremap <M-P> "+p
else
set clipboard=unnamed,autoselect
cnoremap <M-P> <C-r>*
vnoremap <M-P> "*p
endif
endif
" In windows, not to use cygwin-git.
if g:is_windows
let s:win_git_path = get(g:private, 'win_git_path', '')
if s:win_git_path !=# ''
" let $PATH = g:win_git_path . ';' . $PATH
endif
unlet s:win_git_path
endif
" ------------------------------------------------------------------------------
" Setting written in vimrc of KaoriYa-vim {{{
" ------------------------------------------------------------------------------
" Don't ignore cases when searching.
set ignorecase
" Delete indent and EOL with backspace.
set backspace=indent,eol,start
" Searches wrap around the end of the file.
set wrapscan
" Display the brackets corresponding to the input brackets.
set showmatch
" Use enhanced command-line completion.
set wildmenu wildmode=list:longest,full
" set wildmode=longest:full,full
" Show commands on command-line.
set showcmd
" Set two lines the height of command-line.
set cmdheight=2
set history=200 " keep 50 lines of command-line history
set incsearch " do incremental searching
if has('mouse')
set mouse=a
set mousemodel=popup
endif
if &t_Co > 2 || !s:is_cui
syntax enable
set hlsearch
endif
" Setting for the system that not identify upper cases and lower cases.
" (example: DOS / Windows / MacOS)
if filereadable($HOME . '/.vimrc') && filereadable($HOME . '/.ViMrC')
set tags=./tags;,tags; " Prevent duplication of tags file
else
set tags=./tags;
endif
" In Windows, if $VIM is not include in $PATH, .exe cannot be found.
if !g:at_startup && g:is_windows && $PATH !~? '\(^\|;\)' . escape($VIM, '\\') . '\(;\|$\)'
let $PATH .= ';' . $VIM
endif
" In Mac, default 'iskeyword' is incomplete for cp932.
if g:is_mac
set iskeyword=@,48-57,_,128-167,224-235
endif
" }}}
" }}}
" ------------------------------------------------------------------------------
" Character-code and EOL-code {{{
" ------------------------------------------------------------------------------
if g:is_windows
set fenc=utf-8
set tenc=cp932
if s:is_cui
set enc=cp932
else
set enc=utf-8
endif
endif
if g:is_cygwin
set enc =utf-8
set fenc=utf-8
set tenc=utf-8
if (&term =~# '^xterm' || &term ==# 'screen') && &t_Co < 256
set t_Co=256 " Extend cygwin terminal color
endif
if &term !=# 'cygwin' " not in command prompt
" Change cursor shape depending on mode.
let &t_ti .= "\e[2 q"
let &t_SI .= "\e[6 q"
let &t_EI .= "\e[2 q"
let &t_te .= "\e[0 q"
" 縦分割スクロール高速化
" http://www.youtube.com/watch?v=KQfOArRJkYI
" http://ttssh2.sourceforge.jp/manual/ja/usage/tips/vim.html
" http://qiita.com/kefir_/items/c725731d33de4d8fb096
" let &t_ti = &t_ti . "\e[?6h\e[?69h"
" let &t_te = "\e[?69l\e[?6l" . &t_te
" let &t_CV = "\e[%i%p1%d;%p2%ds"
" let &t_CS = 'y'
endif
endif
set fileformats=dos,unix,mac
if has('kaoriya')
set fileencodings=guess,utf-16,utf-16le
else
set fileencodings=iso-2022-jp,ucs-bom,utf-8,euc-jp,cp932,utf-16,utf-16le
endif
scriptencoding utf-8 " required to visualize double-byte spaces.(after set enc)
set matchpairs& matchpairs+=(:),{:},「:」,『:』
autocmd MyAutoCmd BufWritePre *
\ if &ff !=# 'unix' && input(printf('Convert fileformat:%s to unix? [y/N]', &ff)) =~? '^y\%[es]$'
\ | setlocal ff=unix
\ | endif
autocmd MyAutoCmd BufReadPost *
\ if &modifiable && !search('[^\x00-\x7F]', 'cnw')
\ | setlocal fenc=ascii
\ | endif
function! s:checktime() abort
if bufname('%') !=# '[Command Line]'
checktime
endif
endfunction
autocmd MyAutoCmd WinEnter,FocusGained * call s:checktime()
function! s:map_easy_close() abort
nnoremap <silent> <buffer> q :<C-u>q<CR>
nnoremap <silent> <buffer> <Esc> :<C-u>q<CR>
nnoremap <silent> <buffer> <Esc><Esc> :<C-u>q<CR>
endfunction
autocmd MyAutoCmd FileType help,qf call s:map_easy_close()
autocmd MyAutoCmd CmdwinEnter * call s:map_easy_close()
" }}}
" ------------------------------------------------------------------------------
" Commands and autocmds {{{
" ------------------------------------------------------------------------------
function! s:system(cmd) abort
try
call vimproc#cmd#system(a:cmd)
catch /^Vim(call)\=:E117: .\+: vimproc#cmd#system$/
call system(a:cmd)
endtry
endfunction
function! s:redir(cmd) abort
let [verbose, verbosefile] = [&verbose, &verbosefile]
set verbose=0 verbosefile=
redir => str
execute 'silent!' a:cmd
redir END
let [&verbose, &verbosefile] = [verbose, verbosefile]
return str
endfunction
" function! s:retab_head(has_bang, width, line1, line2) abort
" let spaces = repeat(' ', a:width)
" let cursor = getcurpos()
" if &l:expandtab
" execute 'silent' a:line1 ',' a:line2 . (a:has_bang ?
" \ 's/^\s\+/\=substitute(substitute(submatch(0), spaces, "\t", "g"), "\t", spaces, "g")/ge' :
" \ 's/^\(\s*\t\+ \+\|\s\+\t\+ *\)\ze[^ ]/\=substitute(submatch(0), "\t", spaces, "g")/ge')
" else
" execute 'silent' a:line1 ',' a:line2 . (a:has_bang ?
" \ 's/^\s\+/\=substitute(substitute(submatch(0), "\t", spaces, "g"), spaces, "\t", "g")/ge' :
" \ 's#^\(\s*\t\+ \+\|\s\+\t\+ *\)\ze[^ ]#\=repeat("\t", len(substitute(submatch(0), "\t", spaces, "g")) / a:width)#ge')
" endif
" call setpos('.', cursor)
" endfunction
" command! -bar -bang -range=% RetabHead call s:retab_head(<bang>0, &tabstop, <line1>, <line2>)
function! s:toggle_tab_space(has_bang, width, line1, line2) abort
let &l:shiftwidth = a:width
let &l:tabstop = a:width
let &l:softtabstop = a:width
let spaces = repeat(' ', a:width)
let cursor = getcurpos()
if &l:expandtab
setlocal noexpandtab
execute 'silent keepjumps keeppatterns' a:line1 ',' a:line2 . (a:has_bang ?
\ 's/^\s\+/\=substitute(substitute(submatch(0), "\t", spaces, "g"), spaces, "\t", "g")/ge' :
\ 's#^ \+#\=repeat("\t", len(submatch(0)) / a:width) . repeat(" ", len(submatch(0)) % a:width)#ge')
else
setlocal expandtab
execute 'silent keepjumps keeppatterns' a:line1 ',' a:line2 . (a:has_bang ?
\ 's/^\s\+/\=substitute(submatch(0), "\t", spaces, "g")/ge' :
\ 's/^\t\+/\=repeat(" ", len(submatch(0)) * a:width)/ge')
endif
call setpos('.', cursor)
endfunction
command! -bar -bang -range=% ToggleTabSpace call s:toggle_tab_space(<bang>0, &l:tabstop, <line1>, <line2>)
nnoremap <silent> <Leader><Tab> :<C-u>call <SID>toggle_tab_space(1, &l:tabstop, 1, line('$'))<CR>
function! s:change_indent(has_bang, width) abort
if a:has_bang
let &shiftwidth = a:width
let &tabstop = a:width
let &softtabstop = a:width
else
let &l:shiftwidth = a:width
let &l:tabstop = a:width
let &l:softtabstop = a:width
endif
endfunction
command! -bang -bar -nargs=1 Indent call s:change_indent(<bang>0, <q-args>)
function! s:smart_split(cmd)
if winwidth(0) > winheight(0) * 2
vsplit
else
split
endif
execute a:cmd
endfunction
command! -bar -nargs=? -complete=command SmartSplit call <SID>smart_split(<q-args>)
nnoremap <C-w><Space> :<C-u>SmartSplit<CR>
if s:executable('xxd')
function! s:read_binary() abort
if !&bin && &l:filetype !=# 'xxd'
set binary
silent %!xxd -g 1
let b:original_filetype = &l:filetype
setfiletype xxd
endif
endfunction
function! s:write_binary() abort
if &bin && &l:filetype ==# 'xxd'
silent %!xxd -r
write
silent %!xxd -g 1
set nomodified
endif
endfunction
function! s:decode_binary() abort
if &bin && &l:filetype ==# 'xxd'
silent %!xxd -r
set nobinary
let &l:filetype = b:original_filetype
unlet b:original_filetype
endif
endfunction
command! -bar BinaryRead call s:read_binary()
command! -bar BinaryWrite call s:write_binary()
command! -bar BinaryDecode call s:decode_binary()
endif
function! s:clear_message()
for i in range(201)
echomsg ''
endfor
endfunction
command! -bar Clear call s:clear_message()
function! s:messages_head(has_bang, ...) abort
let n = a:0 > 0 ? a:1 : 10
let lines = filter(split(s:redir('messages'), "\n"), 'v:val !=# ""')[: n]
if a:has_bang
for line in lines
echomsg line
endfor
else
for line in lines
echo line
endfor
endif
endfunction
command! -bar -bang -nargs=? MessagesHead call s:messages_head(<bang>0, <f-args>)
function! s:messages_tail(has_bang, ...) abort
let n = a:0 > 0 ? a:1 : 10
let lines = filter(split(s:redir('messages'), "\n"), 'v:val !=# ""')
if n > len(lines)
let n = len(lines)
endif
let lines = lines[len(lines) - n :]
if a:has_bang
for line in lines
echomsg line
endfor
else
for line in lines
echo line
endfor
endif
endfunction
command! -bar -bang -nargs=? MessagesTail call s:messages_tail(<bang>0, <f-args>)
" Make directory automatically.
function! s:auto_mkdir(dir, force) abort
if !isdirectory(a:dir) && (a:force || input(printf('"%s" does not exist. Create? [y/N]', a:dir)) =~? '^y\%[es]$')
call mkdir(iconv(a:dir, &enc, &tenc), 'p')
endif
endfunction
autocmd MyAutoCmd BufWritePre * call s:auto_mkdir(expand('<afile>:p:h'), v:cmdbang)
" Command of 'which' for vim command.
function! s:cmd_which(cmd) abort
if stridx(a:cmd, '/') != -1 || stridx(a:cmd, '\\') != -1
echoerr a:cmd 'is not a command-name.'
return
endif
let path = substitute(substitute($PATH, '\\', '/', 'g'), ';', ',', 'g')
let save_suffix_add = &suffixesadd
if g:is_windows
setlocal suffixesadd=.exe,.cmd,.bat
endif
let file_list = findfile(a:cmd, path, -1)
if !empty(file_list)
echo fnamemodify(file_list[0], ':p')
else
echo a:cmd 'was not found.'
endif
let &suffixesadd = save_suffix_add
endfunction
command! -bar -nargs=1 Which call s:cmd_which(<q-args>)
" lcd to buffer-directory.
function! s:cmd_lcd(count) abort
let dir = expand('%:p' . repeat(':h', a:count + 1))
if isdirectory(dir)
execute 'lcd' fnameescape(dir)
endif
endfunction
command! -bar -nargs=0 -count=0 Lcd call s:cmd_lcd(<count>)
" Close buffer not closing window
function! s:buf_delete() abort
let current_bufnr = bufnr('%')
let alternate_bufnr = bufnr('#')
if buflisted(alternate_bufnr)
buffer #
else
bnext
endif
if buflisted(current_bufnr)
execute 'silent bwipeout' current_bufnr
" If bwipeout is failed, restore buffer of upper windows.
if bufloaded(current_bufnr) != 0
execute 'buffer' current_bufnr
endif
endif
endfunction
command! -bar Ebd call s:buf_delete()
" Close buffer not closing window
function! s:bwipeout_all(bang, ...) abort
let bufnrs = map(split(s:redir('ls'), "\n"), 'str2nr(split(v:val, "\\s")[0])')
if a:0 > 0
call filter(bufnrs, 'index(a:000, bufname(v:val)) != -1')
endif
echohl ErrorMsg
for bufnr in bufnrs
try
execute 'silent bwipeout' . a:bang bufnr
catch /^Vim(bwipeout):E89: /
echomsg substitute(v:exception, '^Vim(bwipeout):', '', '')
endtry
endfor
echohl None
endfunction
command! -bar -bang -nargs=* -complete=buffer BwipeoutAll call s:bwipeout_all('<bang>', <f-args>)
command! -bar -bang BwipeoutAllNoname call s:bwipeout_all('<bang>', '')
" Preview fold area.
function! s:preview_fold(previewheight) abort
let lnum = line('.')
if foldclosed(lnum) <= -1
pclose
return
endif
let lines = getline(lnum, foldclosedend(lnum))
if len(lines) > a:previewheight
let lines = lines[: a:previewheight - 1]
endif
let filetype = &ft
let winnr = bufwinnr('__fold__')
if winnr == -1
silent execute 'botright' a:previewheight 'split' '__fold__'
else
silent wincmd P
endif
%d _
execute 'setlocal syntax=' . filetype
setlocal buftype=nofile noswapfile bufhidden=wipe previewwindow foldlevel=99 nowrap
call append(0, lines)
wincmd p
endfunction
nnoremap <silent> zp :<C-u>call <SID>preview_fold(&previewheight)<CR>
if s:executable('chmod')
augroup Permission
autocmd!
augroup END
if g:is_windows
function! s:permission_644() abort
autocmd! Permission BufWritePost <buffer>
silent call s:system((getline(1)[0 : 1] ==# '#!' ? 'chmod 755 ' : 'chmod 644 ') . shellescape(expand('%')))
endfunction
autocmd Permission BufNewFile * autocmd Permission BufWritePost <buffer> call s:permission_644()
else
function! s:add_permission_x() abort
autocmd! Permission BufWritePost <buffer>
if getline(1)[0 : 1] ==# '#!'
silent call s:system('chmod a+x ' . shellescape(expand('%:p')))
endif
endfunction
autocmd Permission BufNewFile * autocmd Permission BufWritePost <buffer> call s:add_permission_x()
endif
endif
function! s:get_selected_text() abort
let tmp = @@
silent normal! gvy
let [text, @@] = [@@, tmp]
return text
endfunction
" Execute selected text as a vimscript
function! s:exec_selected_text() abort
execute s:get_selected_text()
endfunction
xnoremap <silent> <Leader>e :<C-u>call <SID>exec_selected_text()<CR>
" Generate match pattern for selected text.
" @*: clipboard @@: anonymous buffer
" mode == 0 : magic, mode == 1 : nomagic, mode == 2 : verymagic
function! s:store_selected_text(...) abort
let mode = a:0 > 0 ? a:1 : (&magic ? 0 : 1)
let selected = substitute(escape(s:get_selected_text(),
\ mode == 2 ? '^$[]/\.*~(){}<>?+=@|%&' :
\ mode == 1 ? '^$[]/\' :
\ '^$[]/\.*~'), "\n", '\\n', 'g')
silent! let @* = selected
silent! let @0 = selected
endfunction
xnoremap ,r :<C-u>call <SID>store_selected_text()<CR>:<C-u>.,$s/<C-r>"//gc<Left><Left><Left>
xnoremap ,R :<C-u>call <SID>store_selected_text(0)<CR>:<C-u>.,$s/\M<C-r>"//gc<Left><Left><Left>
xnoremap ,<C-r> :<C-u>call <SID>store_selected_text(1)<CR>:<C-u>.,$s/\M<C-r>"//gc<Left><Left><Left>
xnoremap ,<M-r> :<C-u>call <SID>store_selected_text(2)<CR>:<C-u>.,$s/\M<C-r>"//gc<Left><Left><Left>
xnoremap ,s :<C-u>call <SID>store_selected_text()<CR>/<C-u><C-r>"<CR>N
xnoremap ,S :<C-u>call <SID>store_selected_text(0)<CR>/<C-u>\m<C-r>"<CR>N
xnoremap ,<C-s> :<C-u>call <SID>store_selected_text(1)<CR>/<C-u>\M<C-r>"<CR>N
xnoremap ,<M-s> :<C-u>call <SID>store_selected_text(2)<CR>/<C-u>\v<C-r>"<CR>N
" Complete HTML tag
function! s:complete_tag() abort
normal! vy
execute 'normal!' (@* ==# '<' ? 'v%x' : '%v%x')
if @* =~# '/\s*>'
normal! p
return
endif
let @* = @* =~# '^</' ?
\ substitute(@*, '\(</\(\a\+\)\s*.*/*>\)', '<\2>\1', 'g') :
\ substitute(@*, '\(<\(\a\+\)\s*.*/*>\)', '\1</\2>', 'g')
normal! p%
startinsert
endfunction
nnoremap <silent> <M-p> :<C-u>call <SID>complete_tag()<CR>
inoremap <silent> <M-p> <Esc>:call <SID>complete_tag()<CR>
autocmd Filetype ant,html,xml inoremap <buffer> </ </<C-x><C-o>
autocmd Filetype ant,html,xml inoremap <buffer> <M-a> </<C-x><C-o>
autocmd Filetype ant,html,xml inoremap <buffer> <M-i> </<C-x><C-o><Esc>%i
function! s:difforig() abort
let save_ft = &l:filetype
vertical new
setlocal buftype=nofile
read #
0d_
let &l:filetype = save_ft
diffthis
wincmd p
diffthis
autocmd MyAutoCmd InsertLeave <buffer> diffupdate
endfunction
command! -bar DiffOrig call s:difforig()
function! s:vimdiff_in_newtab(...) abort
if a:0 == 1
tabedit %:p
execute 'rightbelow vertical diffsplit' a:1
else
execute 'tabedit' a:1
for file in a:000[1 :]
execute 'rightbelow vertical diffsplit' file
endfor
endif
wincmd w
endfunction
command! -bar -nargs=+ -complete=file Diff call s:vimdiff_in_newtab(<f-args>)
function! s:compare(...) abort
if a:0 == 1
tabedit %:p
execute 'rightbelow vnew' a:1
else
execute 'tabedit' a:1
setlocal scrollbind
for file in a:000[1 :]
execute 'rightbelow vnew' file
setlocal scrollbind
endfor
endif
wincmd w
endfunction
command! -bar -nargs=+ -complete=file Compare call s:compare(<f-args>)
" Highlight cursor position vertically and horizontally.
command! -bar ToggleCursorHighlight
\ if !&cursorline || !&cursorcolumn || &colorcolumn ==# ''
\ | setlocal cursorline cursorcolumn
\ | else
\ | setlocal nocursorline nocursorcolumn
\ | endif
nnoremap <silent> <Leader>h :<C-u>ToggleCursorHighlight<CR>
autocmd MyAutoCmd CursorHold,CursorHoldI,WinEnter * setlocal cursorline cursorcolumn
autocmd MyAutoCmd CursorMoved,CursorMovedI,WinLeave * setlocal nocursorline nocursorcolumn
" Search in selected texts
function! s:range_search(d) abort
let s = input(a:d)
if strlen(s) > 0
let s = a:d . '\%V' . s . "\<CR>"
call feedkeys(s, 'n')
endif
endfunction
vnoremap <silent>/ :<C-u>call <SID>range_search('/')<CR>
vnoremap <silent>? :<C-u>call <SID>range_search('?')<CR>
function! s:speed_up(has_bang) abort
if a:has_bang
setlocal noshowmatch nocursorline nocursorcolumn colorcolumn=
else
set noshowmatch nocursorline nocursorcolumn colorcolumn=
endif
NoMatchParen
set laststatus=0 showtabline=0
if !s:is_cui
set guicursor=a:blinkon0
if has('kaoriya')
if g:is_windows
set transparency=255
else
set transparency=0
endif
endif
endif
endfunction
command! -bang -bar SpeedUp call s:speed_up(<bang>0)
function! s:comma_period(line1, line2) abort
let cursor = getcurpos()
execute 'silent keepjumps' a:line1 ',' a:line2 's/、/,/ge'
execute 'silent keepjumps' a:line1 ',' a:line2 's/。/./ge'
call setpos('.', cursor)
endfunction
command! -bar -range=% CommaPeriod call s:comma_period(<line1>, <line2>)
function! s:kutouten(line1, line2) abort range
let cursor = getcurpos()
execute 'silent keepjumps' a:line1 ',' a:line2 's/,/、/ge'
execute 'silent keepjumps' a:line1 ',' a:line2 's/./。/ge'
call setpos('.', cursor)
endfunction
command! -bar -range=% Kutouten <line1>,<line2>call s:kutouten(<line1>, <line2>)
function! s:make_junk_buffer(has_bang) abort
if a:has_bang
edit __JUNK_BUFFER__
setlocal nobuflisted bufhidden=unload buftype=nofile
else
edit __JUNK_BUFFER_RECYCLE__
setlocal nobuflisted buftype=nofile
endif
endfunction
command! -bang -bar JunkBuffer call s:make_junk_buffer(<bang>0)
function! s:delete_trailing_whitespace(line1, line2) abort
let cursor = getcurpos()
execute 'silent keepjumps keeppatterns' a:line1 ',' a:line2 's/\s\+$//ge'
call setpos('.', cursor)
endfunction
command! -bar -range=% DeleteTrailingWhitespace call s:delete_trailing_whitespace(<line1>, <line2>)
function! s:delete_blank_lines(line1, line2) abort range
let cursor = getcurpos()
let offset = 0
execute 'silent keepjumps keeppatterns' a:line1 ',' cursor[1] 'g /^\s*$/let offset += 1'
let cursor[1] -= offset
execute 'silent keepjumps keeppatterns' a:line1 ',' a:line2 'g /^\s*$/d'
call setpos('.', cursor)
endfunction
command! -bar -range=% DeleteBlankLines call s:delete_blank_lines(<line1>, <line2>)
function! s:show_file_size()
let size = (&encoding ==# &fileencoding || &fileencoding ==# '')
\ ? line2byte(line('$') + 1) - 1 : getfsize(expand('%'))
let bufname = bufname('%')
if bufname ==# ''
let bufname = '[No Name]'
endif
echo 'File size:' bufname
echo printf('%.2f KB', size / 1024.0)
echo size 'B'
" if size < 0
" let size = 0
" endif
" for unit in ['B', 'KB', 'MB']
" if size < 1024
" return size . unit
" endif
" let size = size / 1024
" endfor
" return size . 'GB'
endfunction
command! -bar ShowFileSize call s:show_file_size()
function! s:clear_undo() abort
let save_undolevels = &l:undolevels
setlocal undolevels=-1
execute "normal! a \<BS>\<Esc>"
setlocal nomodified
let &l:undolevels = save_undolevels
endfunction
command! -bar ClearUndo call s:clear_undo()
" Save as a super user.
if s:executable('sudo')
function! s:save_as_root(bang, filename) abort
execute 'write' a:bang '!sudo tee > /dev/null' (a:filename ==# '' ? '%' : a:filename)
endfunction
else
function! s:save_as_root(bang, filename) abort
echoerr 'sudo is not supported in this environment.'
endfunction
endif
command! -bar -bang -nargs=? -complete=file Write call s:save_as_root('<bang>', <q-args>)
if s:executable('jq')
function! s:jq(has_bang, ...) abort range
execute 'silent' a:firstline ',' a:lastline '!jq' (a:0 == 0 ? '.' : a:1)
if !v:shell_error || a:has_bang
return
endif
let error_lines = filter(getline('1', '$'), 'v:val =~# "^parse error: "')
let error_lines = map(error_lines, 'substitute(v:val, "line \\zs\\(\\d\\+\\)\\ze,", "\\=(submatch(1) + a:firstline - 1)", "")')
let winheight = len(error_lines) > 10 ? 10 : len(error_lines)
undo
execute 'botright' winheight 'new'
setlocal nobuflisted bufhidden=unload buftype=nofile
call setline(1, error_lines)
call s:clear_undo()
setlocal readonly
endfunction
command! -bar -bang -range=% -nargs=? Jq <line1>,<line2>call s:jq(<bang>0, <f-args>)
endif
if s:executable('indent')
let s:indent_cmd = 'indent -orig -bad -bap -nbbb -nbbo -nbc -bli0 -br -brs -nbs
\ -c8 -cbiSHIFTWIDTH -cd8 -cdb -cdw -ce -ciSHIFTWIDTH -cliSHIFTWIDTH -cp2 -cs
\ -d0 -nbfda -nbfde -di0 -nfc1 -nfca -hnl -iSHIFTWIDTH -ipSHIFTWIDTH
\ -nlp -lps -npcs -piSHIFTWIDTH -nprs -psl -saf -sai -saw -sbi0
\ -sc -nsob -nss -tsSOFTTABSTOP -ppiSHIFTWIDTH -ip0 -l160 -lc160'
function! s:format_c_program(has_bang) abort range
let indent_cmd = substitute(s:indent_cmd, 'SHIFTWIDTH', &shiftwidth, 'g')
let indent_cmd = substitute(indent_cmd, 'SOFTTABSTOP', &softtabstop, 'g')
let indent_cmd .= &expandtab ? ' -nut' : ' -ut'
execute 'silent' a:firstline ',' a:lastline '!' indent_cmd
if !v:shell_error || a:has_bang
return
endif
let current_file = expand('%')
if current_file ==# ''
let current_file = '[No Name]'
endif
let error_lines = filter(getline('1', '$'), 'v:val =~# "^indent: Standard input:\\d\\+: Error:"')
let error_lines = map(error_lines, 'substitute(v:val, "^indent: \\zsStandard input:\\(\\d\\+\\)\\ze: Error:", "\\=current_file . \":\" . (submatch(1) + a:firstline - 1)", "")')
let winheight = len(error_lines) > 10 ? 10 : len(error_lines)
undo
execute 'botright' winheight 'new'
setlocal nobuflisted bufhidden=unload buftype=nofile
call setline(1, error_lines)
call s:clear_undo()
setlocal readonly
endfunction
autocmd MyAutoCmd FileType c,cpp
\ command! -bar -bang -range=% -buffer FormatCProgram
\ <line1>,<line2>call s:format_c_program(<bang>0)
endif
if s:executable('pdftotext')
command! -bar -complete=file -nargs=1 Pdf :r !pdftotext -nopgbrk -layout <q-args> -
endif
" Show highlight group name under a cursor
command! -bar VimShowHlGroup echo synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name')
command! -bar Rot13 normal! mzggg?G`z
command! -bar RandomString echo sha256(reltimestr(reltime()))[: 7]
command! -nargs=1 GrepCurrent vimgrep <args> % | cwindow
" Reopen current file with another encoding.
command! -bar -bang Utf8 edit<bang> ++enc=utf-8
command! -bar -bang Iso2022jp edit<bang> ++enc=iso-2022-jp
command! -bar -bang Cp932 edit<bang> ++enc=cp932
command! -bar -bang Euc edit<bang> ++enc=euc-jp
command! -bar -bang Utf16 edit<bang> ++enc=ucs-2le
command! -bar -bang Utf16be edit<bang> ++enc=ucs-2
" File encoding commands.
command! -bar FUtf8 setlocal fenc=utf-8
command! -bar FIso2022jp setlocal fenc=iso-2022-jp
command! -bar FCp932 setlocal fenc=cp932
command! -bar FEuc setlocal fenc=euc-jp
command! -bar FUtf16 setlocal fenc=ucs-2le
command! -bar FUtf16be setlocal fenc=ucs-2
command! -bar -nargs=1 -complete=file Rename file <args> | call delete(expand('#'))
command! -bar CloneToNewTab execute 'tabnew' expand('%:p')
command! -bar -nargs=1 -complete=file E tabedit <args>
command! -bar Q tabclose <args>
command! -bar GC call garbagecollect()
function! s:plugin_test(use_gvim, ex_command, is_same_window) abort
let cmd = escape((a:use_gvim ? 'gvim' : 'vim')
\ . ' -u ~/.vim/min.vim'
\ . ' -U NONE'
\ . ' -i NONE'
\ . ' -n'
\ . ' -N'
\ . printf(' --cmd "set rtp+=%s"', getcwd())
\ . (a:ex_command ==# '' ? '' : printf('-c "au VimEnter * %s"', a:ex_command)), '!')
if g:is_windows
if a:use_gvim
execute 'silent !start' cmd
else
if a:is_same_window
execute 'silent !' cmd
else
execute 'silent !start cmd /c call' cmd
endif
endif
else
execute 'silent !' cmd
redraw!
endif
endfunction
command! -bar -bang -nargs=* PluginTest call s:plugin_test(<bang>0, <q-args>, 0)
command! -bar -bang -nargs=* PluginTestCUI call s:plugin_test(0, <q-args>, 0)
command! -bar -bang -nargs=* PluginTestGUI call s:plugin_test(1, <q-args>, 0)
if s:is_cui && g:is_windows
command! -bar -bang -nargs=* PluginTestCUISameWindow call s:plugin_test(0, <q-args>, 1)
endif
" Joke!
if has('cryptv')
function! s:destroy_file(has_bang) abort
if !filereadable(expand('%:p'))
echoerr 'Current buffer is not write out to file'
return
endif
if !a:has_bang
echoerr "Must to add '!' to destroy this file"
return
endif
let cursor = getcurpos()
normal! ggg?G
call setpos('.', cursor)
let &l:key = sha256(reltimestr(reltime()))
write
bwipeout
endfunction
command! -bar -bang DestroyFile call s:destroy_file(<bang>0)
endif
if g:is_windows && s:executable('taskkill')
command! -bar Suicide call system('taskkill /pid ' . getpid())
elseif s:executable('kill')
command! -bar Suicide call system('kill -KILL '. getpid())
endif
" }}}
" ------------------------------------------------------------------------------
" Setting for Visualize {{{
" ------------------------------------------------------------------------------
" Show invisible characters and define format of the characters.
if &enc ==# 'utf-8'
" set list listchars=eol:↓,extends:»,nbsp:%,precedes:«,tab:»-,trail:-
set list listchars=eol:↓,extends:»,nbsp:%,precedes:«,tab:¦\ ,trail:-
set showbreak=»
else
" set list listchars=eol:$,extends:>,nbsp:%,precedes:<,tab:>-,trail:-
set list listchars=eol:$,extends:>,nbsp:%,precedes:<,tab:¦\ ,trail:-
set showbreak=>
endif
function! s:matchadd(group, pattern, ...) abort
for m in getmatches()
if m.group ==# a:group
return
endif
endfor
if a:0 > 1
call matchadd(a:group, a:pattern, a:0, a:1)
elseif a:0 == 1
call matchadd(a:group, a:pattern, a:0)
else
call matchadd(a:group, a:pattern)
endif
endfunction
augroup MyAutoCmd
" TODO
au ColorScheme * hi WhitespaceEOL term=underline ctermbg=Blue guibg=Blue
au VimEnter,WinEnter,BufRead * call s:matchadd('WhitespaceEOL', ' \+$')
" au VimEnter,WinEnter,BufRead * match WhitespaceEOL / \+$/
au ColorScheme * hi TabEOL term=underline ctermbg=DarkGreen guibg=DarkGreen
au VimEnter,WinEnter * call s:matchadd('TabEOL', '\t\+$')
" au VimEnter,WinEnter,BufRead * match TabEOL /\t\+$/
au ColorScheme * hi SpaceTab term=underline ctermbg=Magenta guibg=Magenta guisp=Magenta
au VimEnter,WinEnter,BufRead * call s:matchadd('SpaceTab', ' \+\ze\t\|\t\+\ze ')
" au VimEnter,WinEnter,BufRead * match SpaceTab / \+\ze\t\|\t\+\ze /
au Colorscheme * hi JPSpace term=underline ctermbg=Red guibg=Red
au VimEnter,WinEnter,BufRead * call s:matchadd('JPSpace', ' ') " \%u3000
" au VimEnter,WinEnter,BufRead * match JPSpace / /
augroup END
" }}}
" ------------------------------------------------------------------------------
" Setting for languages. {{{
" ------------------------------------------------------------------------------
let c_gnu = 1 " Enable highlight gnu-C keyword in C-mode.
augroup MyAutoCmd
" ----------------------------------------------------------------------------
" Setting for indent.
" ----------------------------------------------------------------------------
au Filetype awk setlocal cindent cinkeys-=0#
au Filetype c setlocal cindent cinoptions& cinoptions+=g0,N-s cinkeys-=0#
au Filetype cpp setlocal cindent cinoptions& cinoptions+=g0,N-s cinkeys-=0#
au Filetype cs setlocal sw=4 ts=4 sts=4 noet
au Filetype java setlocal sw=4 ts=4 sts=4 noet cindent cinoptions& cinoptions+=j1
au Filetype javascript setlocal sw=2 ts=2 sts=2 cindent cinoptions& cinoptions+=j1,J1,(s
" )
au Filetype kuin setlocal sw=2 ts=2 sts=2 noet
au Filetype python setlocal sw=4 ts=4 sts=4 cindent cinkeys-=0#
au Filetype make setlocal sw=4 ts=4 sts=4 noet
au Filetype tex setlocal sw=2 ts=2 sts=2 conceallevel=0
augroup END
" }}}
" ------------------------------------------------------------------------------
" Keybinds {{{
" ------------------------------------------------------------------------------
" For terminal
if !g:is_windows && s:is_cui
" Use meta keys in console.
" <ESC>O do not map because used by arrow keys.
for s:ch in map(
\ range(char2nr('%'), char2nr('?'))
\ + range(char2nr('A'), char2nr('N'))
\ + range(char2nr('P'), char2nr('Z'))
\ + range(char2nr('a'), char2nr('z'))
\ , 'nr2char(v:val)')
execute 'map <ESC>' . s:ch '<M-' . s:ch . '>'
execute 'cmap <ESC>' . s:ch '<M-' . s:ch . '>'
endfor
unlet s:ch
map <NUL> <C-Space>
map! <NUL> <C-Space>
endif
if g:is_mac
noremap ¥ \
noremap! ¥ \
noremap \ ¥
noremap! \ ¥
endif
nnoremap <C-c> <Nop>
nunmap <C-c>
" Use black hole register.
nnoremap c "_c
nnoremap x "_x
nnoremap Q gQ
nnoremap gQ Q
" Keep the cursor in place while joining lines
nnoremap <M-j> mzJ`z:delmarks z<CR>
" Delete search register
nnoremap <silent> <Esc><Esc> :<C-u>let @/= ''<CR>
nnoremap <silent> <Space><Esc> :<C-u>setlocal hlsearch! hlsearch?<CR>
" Search the word nearest to the cursor in new window.
nnoremap <C-w>* <C-w>s*
nnoremap <C-w># <C-w>s#
" Move line to line as you see whenever wordwrap is set.
nnoremap j gj
nnoremap k gk
nnoremap gj j
nnoremap gk k
" Tag jump
nnoremap <C-]> g<C-]>zz
nnoremap g<C-]> <C-]>zz
nnoremap <M-]> :<C-u>tag<CR>
nnoremap <M-[> :<C-u>pop<CR>
" For moveing between argument list
nnoremap [a :<C-u>previous<CR>
nnoremap ]a :<C-u>next<CR>
nnoremap [A :<C-u>first<CR>
nnoremap ]A :<C-u>last<CR>
" For moveing between buffers
nnoremap [b :<C-u>bprevious<CR>
nnoremap ]b :<C-u>bnext<CR>
nnoremap [B :<C-u>bfirst<CR>
nnoremap ]B :<C-u>blast<CR>
" For moveing between buffers
nnoremap [l :<C-u>lprevious<CR>
nnoremap ]l :<C-u>lnext<CR>
nnoremap [L :<C-u>lfirst<CR>
nnoremap ]L :<C-u>llast<CR>
" For vimgrep
nnoremap [q :<C-u>cprevious<CR>
nnoremap ]q :<C-u>cnext<CR>
nnoremap [Q :<C-u>cfirst<CR>
nnoremap ]Q :<C-u>clast<CR>
" For moveing between tag list
nnoremap [t :<C-u>tprevious<CR>
nnoremap ]t :<C-u>tnext<CR>
nnoremap [T :<C-u>tfirst<CR>
nnoremap ]T :<C-u>tlast<CR>
" Paste at start of line.
" nnoremap <C-p> I<C-r>"<Esc>
" Toggle relativenumber.
"""""" if v:version >= 703
nnoremap <silent> <Leader>l :<C-u>setlocal rnu! rnu?<CR>
"""""" endif
nnoremap <silent> <Leader>s :<C-u>setlocal spell! spell?<CR>
nnoremap <silent> <Leader>w :<C-u>setlocal wrap! wrap?<CR>
" Resize window.
nnoremap <silent> <M-<> <C-w><
nnoremap <silent> <M-+> <C-w>+
nnoremap <silent> <M--> <C-w>-
nnoremap <silent> <M-=> <C-w>-
nnoremap <silent> <M->> <C-w>>
" Change tab.
nnoremap <C-Tab> gt
nnoremap <S-C-Tab> Gt
" Show marks.
nnoremap <Space>m :<C-u>marks<CR>
" Show ascii-code of charactor under cursor.
nnoremap <Space>@ :<C-u>ascii<CR>
" Show registers
nnoremap <Space>r :<C-u>registers<CR>
nnoremap <Leader>/ /<C-u>\<\><Left><Left>
" Repeat last substitution, including flags, with &.
nnoremap & :<C-u>&&<CR>
au MyAutoCmd Filetype html nnoremap <buffer> <F5> :<C-u>lcd %:h<CR>:<C-u>silent !start cmd /c call chrome %<CR>
inoremap <C-c> <C-c>u
" Move to indented position.
inoremap <C-A> a<Esc>==xa
" Cursor-move setting at insert-mode.
inoremap <M-h> <Left>
inoremap <M-j> <Down>
inoremap <M-k> <Up>
inoremap <M-l> <Right>
" Like Emacs.
inoremap <C-f> <Right>
inoremap <C-b> <Left>
inoremap <silent> <C-d> <Del>
inoremap <silent> <C-e> <Esc>$a
" Insert a blank line in insert mode.
inoremap <C-o> <Esc>o
" During insert, ctrl-u will break undo sequence then delete all entered chars
inoremap <C-u> <C-g>u<C-u>
" Easy <Esc> in insert-mode.
" inoremap jj <Esc>
inoremap <expr> j getline('.')[col('.') - 2] ==# 'j' ? "\<BS>\<ESC>" : 'j'
" No wait for <Esc>.
if g:is_unix && s:is_cui
inoremap <silent> <ESC> <ESC>
endif
" Cursor-move setting at insert-mode.
cnoremap <M-h> <Left>
cnoremap <M-j> <Down>
cnoremap <M-k> <Up>
cnoremap <M-l> <Right>
cnoremap <M-H> <Home>
cnoremap <M-L> <End>
cnoremap <M-w> <S-Right>
cnoremap <M-b> <S-Left>
cnoremap <M-x> <Del>
" cnoremap <C-a> <Home>
" cnoremap <C-b> <Left>
" cnoremap <C-d> <Del>
" cnoremap <C-e> <End>
" cnoremap <C-f> <Right>
" cnoremap <C-n> <Down>
" cnoremap <C-p> <Up>
" cnoremap <M-b> <S-Left>
" cnoremap <M-f> <S-Right>
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
" Paste from anonymous buffer
" cnoremap <M-p> <C-r><S-">
cnoremap <M-p> <C-r>+
" Add excape to '/' and '?' automatically.
cnoremap <expr> / getcmdtype() == '/' ? '\/' : '/'
cnoremap <expr> ? getcmdtype() == '?' ? '\?' : '?'
" Input full-path of the current file directory
cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h') . '/' : '%%'
" Select paren easly
onoremap ) f)
onoremap ( t(
xnoremap ) f)
xnoremap ( t(
" Reselect visual block after indent.
xnoremap < <gv
xnoremap > >gv
" Select current position to EOL.
xnoremap v $<Left>
" Paste yanked string vertically.
xnoremap <C-p> I<C-r>"<ESC>
" Search selected text in new window.
xnoremap <C-w>* y<C-w>s/<C-r>0<CR>N
xnoremap <C-w>: y<C-w>v/<C-r>0<CR>N
if v:version > 704 || (v:version == 704 && has('patch754'))
if g:is_windows
silent! xunmap <C-v>
endif
xnoremap <C-a> <C-a>gv
xnoremap <C-x> <C-x>gv
endif
" Repeat last substitution, including flags, with &.
xnoremap & :<C-u>&&<CR>
" Sequencial copy
vnoremap <silent> <M-p> "0p
noremap <silent> <F2> :<C-u>VimFiler<CR>
noremap! <silent> <F2> <Esc>:VimFiler<CR>
noremap <silent> <F3> :<C-u>MiniBufExplore<CR>
noremap! <silent> <F3> <Esc>:MiniBufExplore<CR>
noremap <silent> <F4> :<C-u>VimShell<CR>
noremap! <silent> <F4> <Esc>:VimShell<CR>
" noremap <silent> <F4> :<C-u>call tmpwin#toggle('VimShell')<CR>
" noremap! <silent> <F4> <Esc>:call tmpwin#toggle('VimShell')<CR>
noremap <silent> <F5> :<C-u>HierStart<CR>:<C-u>QuickRun<CR>
noremap! <silent> <F5> <Esc>:HierStart<CR>:<C-u>QuickRun<CR>
noremap <silent> <S-F5> :<C-u>sp +enew<CR>:<C-u> r !make<CR>
noremap! <silent> <S-F5> <Esc>:sp +enew<CR>:<C-u> r !make<CR>
" Open .vimrc
nnoremap <silent> <Space>c :<C-u>edit $MYVIMRC<CR>
" Open .gvimrc
nnoremap <silent> <Space>g :<C-u>edit $MYGVIMRC<CR>
if s:is_cui
" Reload .vimrc.
noremap <silent> <F12> :<C-u>source $MYVIMRC<CR>
noremap! <silent> <F12> <Esc>:source $MYVIMRC<CR>
else
" Reload .vimrc and .gvimrc.
noremap <silent> <F12> :<C-u>source $MYVIMRC<CR>:<C-u>source $MYGVIMRC<CR>
noremap! <silent> <F12> <Esc>:source $MYVIMRC<CR>:<C-u>source $MYGVIMRC<CR>
endif
noremap <silent> <S-F12> :<C-u>source %<CR>
noremap! <silent> <S-F12> <Esc>:source %<CR>
" ------------------------------------------------------------------------------
" Force to use keybind of vim to move cursor.
" ------------------------------------------------------------------------------
let s:keymsgs = [
\ "Don't use Left-Key!! Enter Normal-Mode and press 'h'!!!!",
\ "Don't use Down-Key!! Enter Normal-Mode and press 'j'!!!!",
\ "Don't use Up-Key!! Enter Normal-Mode and press 'k'!!!!",
\ "Don't use Right-Key!! Enter Normal-Mode and press 'l'!!!!",
\ "Don't use Delete-Key!! Press 'x' in Normal-Mode!!!!",
\ "Don't use Backspace-Key!! Press 'X' in Normal-Mode!!!!"
\]
function! s:echo_keymsg(msgnr) abort
echo s:keymsgs[a:msgnr]
endfunction
if s:is_cui && !g:is_windows
" Disable move with cursor-key.
noremap <Left> <Nop>
noremap! <Left> <Nop>
nnoremap <Left> :<C-u>call <SID>echo_keymsg(0)<CR>
inoremap <Left> <Esc>:call <SID>echo_keymsg(0)<CR>a
noremap <Down> <Nop>
noremap! <Down> <Nop>
nnoremap <Down> :<C-u>call <SID>echo_keymsg(1)<CR>
inoremap <Down> <Esc>:call <SID>echo_keymsg(1)<CR>a
noremap <Up> <Nop>
noremap! <Up> <Nop>
nnoremap <Up> :<C-u>call <SID>echo_keymsg(2)<CR>
inoremap <Up> <Esc>:call <SID>echo_keymsg(2)<CR>a
noremap <Right> <Nop>
noremap! <Right> <Nop>
nnoremap <Right> :<C-u>call <SID>echo_keymsg(3)<CR>
inoremap <Right> <Esc>:call <SID>echo_keymsg(3)<CR>a
else
map <Left> <Plug>(movewin-left)
map! <Left> <Plug>(movewin-left)
map <Down> <Plug>(movewin-down)
map! <Down> <Plug>(movewin-down)
map <Up> <Plug>(movewin-up)
map! <Up> <Plug>(movewin-up)
map <Right> <Plug>(movewin-right)
map! <Right> <Plug>(movewin-right)
endif
" Disable delete with <Delete>
noremap <Del> <Nop>
noremap! <Del> <Nop>
nnoremap <Del> :<C-u>call <SID>echo_keymsg(4)<CR>
inoremap <Del> <Esc>:call <SID>echo_keymsg(4)<CR>a
" Disable delete with <BS>.
" But available in command-line mode.
noremap <BS> <Nop>
inoremap <BS> <Nop>
nnoremap <BS> :<C-u>call <SID>echo_keymsg(5)<CR>
inoremap <BS> <Esc>:call <SID>echo_keymsg(5)<CR>a
" }}}
" ------------------------------------------------------------------------------
" NeoBundle {{{
" ------------------------------------------------------------------------------
" ------------------------------------------------------------------------------
" Init NeoBundle {{{
" ------------------------------------------------------------------------------
" If neobundle is not exist, finish setting.
if !isdirectory($NEOBUNDLE_DIR . '/neobundle.vim')
if v:version < 702
echoerr 'Please use vim7.3!!!!'
finish
elseif !s:executable('git')
echoerr 'Please install git!!!!'
finish
endif
function! s:neobundle_init() abort
call mkdir($NEOBUNDLE_DIR, 'p')
call system('git clone https://github.com/Shougo/neobundle.vim ' . $NEOBUNDLE_DIR . '/neobundle.vim')
set rtp+=$NEOBUNDLE_DIR/neobundle.vim
call neobundle#rc()
NeoBundleInstall
endfunction
command! -bar NeoBundleInit call s:neobundle_init()
echomsg 'Please Install NeoBundle!'
echomsg 'Do command :NeoBundleInit'
finish
endif
if g:at_startup
set rtp+=$NEOBUNDLE_DIR/neobundle.vim
endif
call neobundle#begin()
NeoBundleFetch 'Shougo/neobundle.vim'
let g:neobundle#default_options = {'_': {'verbose': 1}}
" For dummy complete function {{{
" neobundlelazy-autoload cannot call script-local command-complete function.
" So define temporary complete function.
" After plugin is lazy-loaded, delete the temporary function.
augroup CompleteDummy
autocmd!
augroup END
function! s:SID() abort
return matchstr(expand('<sfile>'), '^function <SNR>\zs\d\+\ze_SID$')
endfun
let s:sid = s:SID()
delfunction s:SID
function! s:to_global_name(scriptlocal_funcname) abort
return '<SNR>' . s:sid . '_' . a:scriptlocal_funcname
endfunction
function! s:delete_function_lazy(funcname) abort
execute 'autocmd CompleteDummy CursorHold,CursorHoldI,CursorMoved,CursorMovedI,InsertEnter *'
\ 'delfunction' a:funcname
\ '| autocmd! CompleteDummy CursorHold,CursorHoldI,CursorMoved,CursorMovedI,InsertEnter *'
endfunction
" }}}
command! -nargs=1 MyNeoBundle
\ NeoBundle <args>, {
\ 'base': $DOTVIM . '/norepository-plugins',
\ 'type': 'nosync'
\}
command! -nargs=1 MyNeoBundleCtrlP
\ NeoBundle <args>, {
\ 'base': $DOTVIM . '/norepository-plugins',
\ 'type': 'nosync',
\ 'depends': 'ctrlpvim/ctrlp.vim'
\}
command! -nargs=1 MyNeoBundleLazy
\ NeoBundle <args>, {
\ 'base': $DOTVIM . '/norepository-plugins',
\ 'type': 'nosync',
\ 'lazy': 1
\}
" }}}
" ------------------------------------------------------------------------------
" plug-in list {{{
" ------------------------------------------------------------------------------
if g:is_cygwin || neobundle#load_cache()
NeoBundleLazy 'vim-jp/vital.vim'
NeoBundleLazy 'tyru/restart.vim'
""" vim-marching
NeoBundleLazy 'osyo-manga/vim-marching'
NeoBundle 'othree/html5-syntax.vim'
NeoBundle 'hail2u/vim-css3-syntax'
" NeoBundle 'Shougo/context_filetype.vim'
NeoBundle 'elzr/vim-json'
NeoBundleLazy 'Shougo/vimproc.vim'
NeoBundle 'bling/vim-airline'
NeoBundleLazy 'rhysd/vim-grammarous'
NeoBundleLazy 'deris/vim-shot-f'
" NeoBundleLazy 'haya14busa/incsearch.vim'
NeoBundleLazy 'haya14busa/vim-undoreplay'
NeoBundleLazy 'ctrlpvim/ctrlp.vim'
NeoBundleLazy 'LeafCage/alti.vim'
NeoBundleLazy 'kamichidu/vim-milqi'
NeoBundleLazy 'Shougo/unite.vim'
NeoBundleLazy 'Shougo/neomru.vim'
NeoBundleLazy 'ujihisa/unite-colorscheme'
NeoBundleLazy 'ujihisa/unite-font'
NeoBundleLazy 'osyo-manga/unite-airline_themes'
NeoBundleLazy 'osyo-manga/unite-highlight'
NeoBundleLazy 'tsukkee/unite-tag'
NeoBundleLazy 'tacroe/unite-mark'
NeoBundleLazy 'yomi322/unite-tweetvim'
NeoBundleLazy 'Shougo/unite-outline'
NeoBundleLazy 'rhysd/unite-n3337'
NeoBundleLazy 'osyo-manga/unite-boost-online-doc'
" NeoBundleLazy 'Shougo/unite-build'
NeoBundleLazy 'tsukkee/unite-help'
NeoBundleLazy 'mattn/unite-advent_calendar'
NeoBundleLazy 'sorah/unite-ghq'
NeoBundleLazy 'kana/vim-textobj-user'
NeoBundleLazy 'kana/vim-textobj-entire' " ae, ie
NeoBundleLazy 'kana/vim-textobj-fold' " az, iz
NeoBundleLazy 'kana/vim-textobj-indent' " ai, ii
NeoBundleLazy 'kana/vim-textobj-line' " al, il
NeoBundleLazy 'kana/vim-textobj-syntax' " ay, iy
NeoBundleLazy 'kana/vim-textobj-django-template' " adb, idb
NeoBundleLazy 'thinca/vim-textobj-between' " af{char}, if{char}
NeoBundleLazy 'mattn/vim-textobj-url' " au, iu
NeoBundleLazy 'osyo-manga/vim-textobj-multiblock' " ab, ib
NeoBundleLazy 'lucapette/vim-textobj-underscore' " a_, i_
NeoBundleLazy 'haya14busa/vim-textobj-number' " an, in
if neobundle#tap('vim-textobj-entire')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'ae'], ['xo', 'ie']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-fold')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'az'], ['xo', 'iz']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-indent')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'ai'], ['xo', 'aI'], ['xo', 'ii'], ['xo', 'iI']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-line')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'al'], ['xo', 'il']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-syntax')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'ay'], ['xo', 'iy']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-django-template')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'adb'], ['xo', 'idb']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-between')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'af'], ['xo', 'if'], ['xo', '<Plug>(textobj-between-']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-url')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'au'], ['xo', 'iu']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-multiblock')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'ab'], ['xo', 'ib'], ['xo', '<Plug>(textobj-multiblock-']]}
\})
omap ib <Plug>(textobj-multiblock-i)
omap ab <Plug>(textobj-multiblock-a)
vmap ib <Plug>(textobj-multiblock-i)
vmap ab <Plug>(textobj-multiblock-a)
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-underscore')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'a_'], ['xo', 'i_']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-textobj-number')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'an'], ['xo', 'in']]}
\})
call neobundle#untap()
endif
if neobundle#tap('textobj-wiw')
call neobundle#config({
\ 'depends': 'kana/vim-textobj-user',
\ 'autoload': {'mappings': [['xo', 'a,w'], ['xo', 'i,w']]}
\})
call neobundle#untap()
endif
NeoBundleLazy 'Shougo/vimfiler'
if has('lua') && (v:version > 703 || (v:version == 703 && has('patch885')))
NeoBundleLazy 'Shougo/neocomplete.vim'
else
NeoBundleLazy 'Shougo/neocomplcache'
endif
NeoBundleLazy 'Shougo/neosnippet'
NeoBundle 'Shougo/neosnippet-snippets'
NeoBundleLazy 'tyru/eskk.vim'
if !g:is_cygwin
NeoBundle 'thinca/vim-localrc'
endif
NeoBundleLazy "osyo-manga/vim-over"
" I want to show startup time when vim is started, so lazy-load this plug-in.
" NeoBundleLazy 'bling/vim-bufferline'
NeoBundle 'Yggdroot/indentLine'
NeoBundleLazy 'osyo-manga/vim-reanimate'
NeoBundleLazy 'jceb/vim-hier'
NeoBundleLazy 'tyru/caw.vim'
NeoBundleLazy 'tpope/vim-surround'
NeoBundleLazy 'kana/vim-altr'
" NeoBundleLazy 'kana/vim-smartinput'
NeoBundleLazy 'cohama/lexima.vim'
NeoBundleLazy 'AndrewRadev/switch.vim'
" Clone of 'tpope/vim-endwise'.
NeoBundleLazy 'rhysd/endwize.vim'
"""""" if s:executable('w3m')
NeoBundleLazy 'yuratomo/w3m.vim'
"""""" endif
NeoBundleLazy 'rhysd/clever-f.vim'
NeoBundleLazy 'rhysd/accelerated-jk'
NeoBundleLazy 'osyo-manga/vim-anzu'
NeoBundleLazy 'daisuzu/rainbowcyclone.vim'
NeoBundleLazy 'thinca/vim-visualstar'
"""""" if s:executable('lynx')
NeoBundleLazy 'thinca/vim-ref'
"""""" endif
NeoBundleLazy 'mattn/excitetranslate-vim'
NeoBundleLazy 'mattn/googletranslate-vim'
NeoBundleLazy 'rhysd/tmpwin.vim'
NeoBundleLazy 'BufOnly.vim'
NeoBundleLazy 'renamer.vim'
NeoBundleLazy 'koturn/movewin.vim'
NeoBundleLazy 'koturn/resizewin.vim'
" NeoBundle 'lambdalisue/vim-fullscreen'
NeoBundleLazy 'vim-scripts/DrawIt'
" NeoBundle 'vim-scripts/Align'
NeoBundleLazy 'osyo-manga/vim-sugarpot'
" TODO: check repository
NeoBundleLazy 'add20/vim-conque'
NeoBundleLazy 'Shougo/vimshell'
NeoBundleLazy 'ujihisa/vimshell-ssh'
""" C++ plugins
NeoBundleLazy 'rhysd/vim-clang-format'
NeoBundleLazy 'osyo-manga/vim-snowdrop'
NeoBundleLazy 'rhysd/wandbox-vim'
NeoBundleLazy 'vim-scripts/DoxygenToolkit.vim'
NeoBundleLazy 'tatt61880/kuin_vim'
NeoBundleLazy 'vim-scripts/gnuplot.vim'
NeoBundleLazy 'java_getset.vim'
NeoBundleLazy 'ebc-2in2crc/vim-ref-jvmis'
NeoBundleLazy 'pangloss/vim-javascript'
NeoBundleLazy 'heavenshell/vim-jsdoc'
NeoBundleLazy 'jcommenter.vim'
NeoBundleLazy 'mitechie/pyflakes-pathogen'
NeoBundleLazy 'ruby-matchit'
NeoBundleLazy 'mattn/emmet-vim'
"""""" if s:executable('ctags')
NeoBundleLazy 'tagexplorer.vim'
"""""" endif
NeoBundleLazy 'rbtnn/vimconsole.vim'
NeoBundleLazy 'thinca/vim-quickrun'
NeoBundleLazy 'mattn/emoji-vim'
NeoBundleLazy 'kannokanno/previm'
NeoBundleLazy 'joker1007/vim-markdown-quote-syntax'
NeoBundleLazy 'Shougo/vinarise'
NeoBundleLazy 'koturn/benchvimrc-vim'
NeoBundleLazy 'thinca/vim-scouter'
" NeoBundleLazy 'koturn/vim-cloud-speech-synthesizer'
NeoBundleLazy 'koturn/vim-clipboard'
NeoBundleLazy 'mattn/gist-vim'
NeoBundle 'tpope/vim-fugitive'
NeoBundleLazy 'tyru/open-browser.vim'
NeoBundleLazy 'yuratomo/gmail.vim'
NeoBundleLazy 'basyura/TweetVim'
NeoBundleLazy 'koron/chalice'
NeoBundleLazy 'daisuzu/facebook.vim'
NeoBundleLazy 'tsukkee/lingr-vim'
NeoBundleLazy 'rbtnn/puyo.vim'
NeoBundleLazy 'koturn/weather.vim'
NeoBundleLazy 'itchyny/calendar.vim'
NeoBundleLazy 'gregsexton/VimCalc'
NeoBundleLazy 'LeafCage/vimhelpgenerator'
NeoBundleLazy 'mattn/startmenu-vim'
NeoBundleLazy 'mopp/AOJ.vim'
NeoBundleLazy 'junegunn/goyo.vim'
NeoBundleLazy 'pocket7878/presen-vim'
NeoBundleLazy 'thinca/vim-showtime'
NeoBundleLazy 'mopp/makecomp.vim'
NeoBundleLazy 'supermomonga/jazzradio.vim', {'depends': ['Shougo/unite.vim']}
NeoBundleLazy 'mattn/ctrlp-jazzradio'
" NeoBundleLazy 'mattn/ctrlp-rebuildfm'
" Games
NeoBundleLazy 'thinca/vim-threes'
NeoBundleLazy 'katono/rogue.vim'
NeoBundleLazy 'deris/vim-duzzle'
" colorscheme
NeoBundle 'sickill/vim-monokai'
"libraries
NeoBundleLazy 'mattn/webapi-vim'
NeoBundleLazy 'tyru/capture.vim'
NeoBundleLazy 'thinca/vim-prettyprint'
NeoBundleLazy 'glidenote/memolist.vim'
" NeoBundle 'ynkdir/vim-funlib'
NeoBundle 'lilydjwg/colorizer'
NeoBundle 'rbtnn/mario.vim'
NeoBundleLazy 'thinca/vim-fontzoom'
NeoBundleLazy 'koturn/vim-mplayer'
" ------------------------------------------------------------------------------
" LocalPlugins {{{
" ------------------------------------------------------------------------------
MyNeoBundleLazy 'vim-serverutil'
if neobundle#tap('vim-serverutil')
call neobundle#config({
\ 'autoload': {'function_prefix': 'serverutil'}
\})
call neobundle#untap()
endif
MyNeoBundleLazy 'vim-brainfuck'
if neobundle#tap('vim-brainfuck')
call neobundle#config({
\ 'autoload': {
\ 'commands': ['BFExecute', 'BFTranslate2C'],
\ 'filetypes': 'brainfuck'
\ }
\})
autocmd MyAutoCmd BufNewFile,BufRead *.b,*.brainfuck setfiletype brainfuck
let g:brainfuck#verbose = 1
let g:brainfuck#use_lua = 1
call neobundle#untap()
endif
MyNeoBundleLazy 'koturn/vim-kotemplate'
if neobundle#tap('vim-kotemplate')
let s:config = {
\ 'autoload': {
\ 'commands': [
\ {'name': 'KoTemplateLoad', 'complete': 'customlist,kotemplate#complete_load'},
\ {'name': 'KoTemplateMakeProject', 'complete': 'customlist,kotemplate#complete_project'}
\ ],
\ 'unite_sources': 'kotemplate',
\ 'function_prefix': 'kotemplate'
\ }
\}
if neobundle#is_installed('ctrlp.vim')
call add(s:config.autoload.commands, 'CtrlPKoTemplate')
endif
if neobundle#is_installed('alti.vim')
call add(s:config.autoload.commands, 'AltiKoTemplate')
endif
if neobundle#is_installed('vim-milqi')
call add(s:config.autoload.commands, 'MilqiKoTemplate')
endif
call neobundle#config(s:config)
unlet s:config
call neobundle#untap()
endif
" }}}
" ------------------------------------------------------------------------------
" NeoBundle config {{{
" ------------------------------------------------------------------------------
if neobundle#tap('vital.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': {'name': 'Vitalize', 'complete': 'customlist,vitalizer#complete'},
\ 'functions': 'vital#of',
\ 'function_prefix': 'vitalizer'
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('restart.vim')
call neobundle#config({
\ 'autoload': {'commands': 'Restart'}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-marching')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ 'MarchingBufferClearCache',
\ 'MarchingDebugLog',
\ 'MarchingDebugClearLog',
\ 'MarchingEnableDebug',
\ 'MarchingDisableDebug',
\ 'MarchingDebugCheck'
\ ],
\ 'mappings': [['i', '<Plug>(marching_']],
\ 'filetypes': ['c', 'cpp']
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vimproc.vim')
let s:config = {
\ 'build': {
\ 'cygwin': 'make -f make_cygwin.mak',
\ 'mac': 'make -f make_mac.mak',
\ 'linux': 'make'
\ },
\ 'autoload': {
\ 'commands': [
\ 'VimProcInstall',
\ {'name': 'VimProcBang', 'complete': 'shellcmd'},
\ {'name': 'VimProcRead', 'complete': 'shellcmd'},
\ ],
\ 'function_prefix': 'vimproc'
\ }
\}
if s:executable('make')
let s:config.build.windows = has('win64') ? 'make -f make_mingw64.mak' : 'make -f make_mingw32.mak'
endif
if s:executable('gmake')
let s:config.build.unix = gmake
endif
call neobundle#config(s:config)
unlet s:config
call neobundle#untap()
endif
if neobundle#tap('vim-grammarous')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'GrammarousCheck', 'complete': 'customlist,grammarous#complete_opt'},
\ 'GrammarousReset'
\ ],
\ 'mappings': [['n', '<Plug>(grammarous-']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vim-shot-f')
call neobundle#config({
\ 'autoload': {
\ 'mappings': [['nxo', '<Plug>(shot-f-']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('incsearch.vim')
call neobundle#config({
\ 'autoload': {'mappings': [['nvo', '<Plug>(incsearch-']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-undoreplay')
call neobundle#config({
\ 'autoload': {
\ 'commands': 'UndoReplay'
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('ctrlp.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'CtrlP', 'complete': 'dir'},
\ {'name': 'CtrlPMRUFiles', 'complete': 'dir'},
\ 'CtrlPBuffer',
\ 'CtrlPLastMode',
\ 'CtrlPClearCache',
\ 'CtrlPClearAllCaches',
\ 'CtrlPCtrlPCache',
\ 'CtrlPAllCtrlPCaches',
\ 'CtrlPCurWD',
\ 'CtrlPCurFile',
\ 'CtrlPRoot',
\ 'CtrlPTag',
\ 'CtrlPQuickfix',
\ {'name': 'CtrlPDir', 'complete': 'dir'},
\ {'name': 'CtrlPBufTag', 'complete': 'buffer'},
\ 'CtrlPBufTagAll',
\ 'CtrlPRTS',
\ 'CtrlPUndo',
\ {'name': 'CtrlPLine', 'complete': 'buffer'},
\ {'name': 'CtrlPChange', 'complete': 'buffer'},
\ 'CtrlPChangeAll',
\ 'CtrlPMixed',
\ 'CtrlPBookmarkDir',
\ {'name': 'CtrlPBookmarkDirAdd', 'complete': 'dir'},
\ ],
\ 'functions': 'ctrlp#rebuildfm#id'
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('alti.vim')
call neobundle#config({
\ 'autoload': {
\ 'function_prefix': 'alti'
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vim-milqi')
call neobundle#config({
\ 'autoload': {
\ 'commands': {'name': 'MilqiFromUnite', 'complete': 'custom,' . s:to_global_name('milqi_complete_unite_source')},
\ 'function_prefix': 'milqi'
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('unite.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'Unite', 'complete': 'customlist,unite#complete_source'},
\ {'name': 'UniteWithCurrentDir', 'complete': 'customlist,unite#complete_source'},
\ {'name': 'UniteWithBufferDir', 'complete': 'customlist,unite#complete_source'},
\ {'name': 'UniteWithProjectDir', 'complete': 'customlist,unite#complete_source'},
\ {'name': 'UniteWithInputDirectory', 'complete': 'customlist,unite#complete_source'},
\ {'name': 'UniteWithCursorWord', 'complete': 'customlist,unite#complete_source'},
\ {'name': 'UniteWithInput', 'complete': 'customlist,unite#complete_source'},
\ {'name': 'UniteResume', 'complete': 'customlist,unite#complete#buffer_name'},
\ {'name': 'UniteClose', 'complete': 'customlist,unite#complete#buffer_name'},
\ {'name': 'UniteNext', 'complete': 'customlist,unite#complete#buffer_name'},
\ {'name': 'UnitePrevious', 'complete': 'customlist,unite#complete#buffer_name'},
\ {'name': 'UniteFirst', 'complete': 'customlist,unite#complete#buffer_name'},
\ {'name': 'UniteLast', 'complete': 'customlist,unite#complete#buffer_name'}
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('neomru.vim')
call neobundle#config({'autoload': {'unite_sources': 'file_mru'}})
call neobundle#untap()
endif
if neobundle#tap('unite-colorscheme')
call neobundle#config({'autoload': {'unite_sources': 'colorscheme'}})
call neobundle#untap()
endif
if neobundle#tap('unite-font')
call neobundle#config({'autoload': {'unite_sources': 'font'}})
call neobundle#untap()
endif
if neobundle#tap('unite-airline_themes')
call neobundle#config({'autoload': {'unite_sources': 'airline_themes'}})
call neobundle#untap()
endif
if neobundle#tap('unite-highlight')
call neobundle#config({'autoload': {'unite_sources': 'highlight'}})
call neobundle#untap()
endif
if neobundle#tap('unite-tag')
call neobundle#config({'autoload': {'unite_sources': 'tag'}})
call neobundle#untap()
endif
if neobundle#tap('unite-mark')
call neobundle#config({'autoload': {'unite_sources': 'mark'}})
call neobundle#untap()
endif
if neobundle#tap('unite-tweetvim')
call neobundle#config({'autoload': {'unite_sources': 'tweetvim'}})
call neobundle#untap()
endif
if neobundle#tap('unite-outline')
call neobundle#config({'autoload': {'unite_sources': 'outline'}})
call neobundle#untap()
endif
if neobundle#tap('unite-n3337')
call neobundle#config({'autoload': {'unite_sources': 'n3337'}})
call neobundle#untap()
endif
if neobundle#tap('unite-boost-online-doc')
call neobundle#config({
\ 'depends': ['Shougo/unite.vim', 'tyru/open-browser.vim', 'mattn/webapi-vim'],
\ 'autoload': {'unite_sources': 'boost-online-doc'}
\})
call neobundle#untap()
endif
if neobundle#tap('unite-build')
call neobundle#config({
\ 'depends': ['Shougo/unite.vim', 'Shougo/vimproc.vim'],
\ 'autoload': {'unite_sources': 'build'}
\})
call neobundle#untap()
endif
if neobundle#tap('unite-help')
call neobundle#config({'autoload': {'unite_sources': 'help'}})
call neobundle#untap()
endif
if neobundle#tap('unite-advent_calendar')
call neobundle#config({
\ 'depends': ['Shougo/unite.vim', 'tyru/open-browser.vim', 'mattn/webapi-vim'],
\ 'autoload': {'unite_sources': 'advent_calendar'}
\})
call neobundle#untap()
endif
if neobundle#tap('unite-ghq')
call neobundle#config({'autoload': {'unite_sources': 'ghq'}})
call neobundle#untap()
endif
if neobundle#tap('vimfiler')
call neobundle#config({
\ 'depends' : 'Shougo/unite.vim',
\ 'autoload': {
\ 'commands': [
\ {'name': 'VimFiler', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerDouble', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerCurrentDir', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerBufferDir', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerCreate', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerSimple', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerSplit', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerTab', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerExplorer', 'complete': 'customlist,vimfiler#complete'},
\ 'VimFilerClose',
\ {'name': 'VimFilerEdit', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerRead', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerSource', 'complete': 'customlist,vimfiler#complete'},
\ {'name': 'VimFilerWrite', 'complete': 'customlist,vimfiler#complete'}
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('neocomplete.vim')
call neobundle#config({
\ 'autoload': {
\ 'insert': 1,
\ 'commands': [
\ 'NeoCompleteEnable',
\ 'NeoCompleteDisable',
\ 'NeoCompleteLock',
\ 'NeoCompleteUnlock',
\ 'NeoCompleteToggle',
\ {'name': 'NeoCompleteSetFileType', 'complete': 'filetype'},
\ 'NeoCompleteClean',
\ {'name': 'NeoCompleteBufferMakeCache', 'complete': 'file'},
\ {'name': 'NeoCompleteDictionaryMakeCache', 'complete': 'customlist,neocomplete#filetype_complete'},
\ {'name': 'NeoCompleteSyntaxMakeCache', 'complete': 'customlist,neocomplete#filetype_complete'},
\ 'NeoCompleteTagMakeCache'
\ ]
\ }
\})
call neobundle#untap()
endif
" TODO: autoload
if neobundle#tap('neocomplcache')
call neobundle#config({
\ 'autoload': {
\ 'insert': 1,
\ 'commands': [
\ 'NeoComplCacheEnable',
\ 'NeoComplCacheDisable',
\ 'NeoComplCacheLock',
\ 'NeoComplCacheUnlock',
\ 'NeoComplCacheToggle',
\ 'NeoComplCacheLockSource',
\ 'NeoComplCacheUnlockSource',
\ (v:version >= 703 ? {'name': 'NeoComplCacheSetFileType', 'complete': 'filetype'} : 'NeoComplCacheSetFileType'),
\ 'NeoComplCacheSetFileType',
\ 'NeoComplCacheClean',
\ ],
\ 'mappings': [['is', '<Plug>(neocomplcache_snippets_']]
\ }
\})
call neobundle#untap()
endif
" TODO: autoload: insert?
if neobundle#tap('neosnippet')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'NeoSnippetEdit', 'complete': 'customlist,neosnippet#commands#_edit_complete'},
\ {'name': 'NeoSnippetMakeCache', 'complete': 'customlist,neosnippet#commands#_filetype_complete'},
\ {'name': 'NeoSnippetSource', 'complete': 'file'},
\ 'NeoSnippetClearMarkers'
\ ],
\ 'mappings': [['nisx', '<Plug>(neosnippet_']],
\ 'insert': 1
\ }
\})
call neobundle#untap()
endif
" TODO: autoload
if neobundle#tap('eskk.vim')
call neobundle#config({
\ 'autoload': {'mappings': [['nicl', '<Plug>(eskk:']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-over')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ 'OverCommandLine',
\ 'OverCommandLineNoremap',
\ 'OverCommandLineMap',
\ 'OverCommandLineUnmap'
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vim-bufferline')
call neobundle#config({
\ 'autoload': {'insert': 1}
\})
call neobundle#untap()
endif
" TODO: autoload: local complete function
if neobundle#tap('vim-reanimate')
let s:_ = 'customlist,' . s:to_global_name('reanimate_save_point_completelist')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'ReanimateSave', 'complete': s:_},
\ 'ReanimateSaveCursorHold',
\ 'ReanimateSaveInput',
\ {'name': 'ReanimateLoad', 'complete': s:_},
\ 'ReanimateLoadInput',
\ 'ReanimateLoadLatest',
\ {'name': 'ReanimateSwitch', 'complete': s:_},
\ {'name': 'ReanimateEditVimrcLocal', 'complete': s:_},
\ 'ReanimateUnLoad'
\ ]
\ }
\})
unlet s:_
call neobundle#untap()
endif
if neobundle#tap('vim-hier')
call neobundle#config({
\ 'autoload': {'commands': ['HierUpdate', 'HierClear', 'HierStart', 'HierStop']}
\})
call neobundle#untap()
endif
if neobundle#tap('caw.vim')
call neobundle#config({
\ 'autoload': {'mappings': [['nv', '<Plug>(caw:']]}
\})
call neobundle#untap()
endif
" TODO: autoload
if neobundle#tap('vim-surround')
call neobundle#config({
\ 'autoload': {
\ 'mappings': [
\ ['n', '<Plug>Dsurround'],
\ ['n', '<Plug>Csurround'],
\ ['n', '<Plug>Ysurround'],
\ ['n', '<Plug>YSurround'],
\ ['n', '<Plug>Yssurround'],
\ ['n', '<Plug>YSsurround'],
\ ['v', '<Plug>VSurround'],
\ ['v', '<Plug>VgSurround']
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vim-altr')
call neobundle#config({
\ 'autoload': {'mappings': [['cinov', '<Plug>(altr-']]}
\})
call neobundle#untap()
endif
if neobundle#tap('endwize.vim')
call neobundle#config({
\ 'autoload': {'filetypes': ['lua', 'ruby', 'sh', 'zsh', 'vb', 'vbnet', 'aspvbs', 'vim']}
\})
call neobundle#untap()
endif
" if neobundle#tap('vim-smartinput')
" call neobundle#config({
" \ 'autoload': {'insert': 1}
" \})
" call neobundle#untap()
" endif
if neobundle#tap('lexima.vim')
call neobundle#config({
\ 'autoload': {'insert': 1}
\})
call neobundle#untap()
endif
if neobundle#tap('switch.vim')
call neobundle#config({
\ 'autoload': {'commands': 'Switch'}
\})
call neobundle#untap()
endif
if neobundle#tap('w3m.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'W3m', 'complete': 'customlist,w3m#search_engine#List'},
\ {'name': 'W3mTab', 'complete': 'customlist,w3m#search_engine#List'},
\ {'name': 'W3mSplit', 'complete': 'customlist,w3m#search_engine#List'},
\ {'name': 'W3mVSplit', 'complete': 'customlist,w3m#search_engine#List'},
\ {'name': 'W3mLocal', 'complete': 'file'},
\ 'W3mHistory',
\ 'W3mHistoryClear'
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('clever-f.vim')
call neobundle#config({
\ 'autoload': {'mappings': [['nxo', '<Plug>(clever-f-']]}
\})
call neobundle#untap()
endif
if neobundle#tap('accelerated-jk')
call neobundle#config({
\ 'autoload': {'mappings': [['n', '<Plug>(accelerated_jk_']]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-anzu')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ 'AnzuClearSearchStatus',
\ 'AnzuClearSearchCache',
\ 'AnzuUpdateSearchStatus',
\ 'AnzuUpdateSearchStatusOutput',
\ 'AnzuSignMatchLine',
\ 'AnzuClearSignMatchLine'
\ ],
\ 'mappings': [['nxo', '<Plug>(anzu-']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('rainbowcyclone.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': ['RC', 'RCReset', 'RCList', 'RCConcat'],
\ 'mappings': [['n', '<Plug>(rc_']]
\}})
call neobundle#untap()
endif
if neobundle#tap('vim-visualstar')
call neobundle#config({
\ 'autoload': {'mappings': [['nvo', '<Plug>(visualstar-']]
\}})
call neobundle#untap()
endif
if neobundle#tap('vim-ref')
call neobundle#config({
\ 'autoload': {
\ 'commands': {'name': 'Ref', 'complete': 'customlist,ref#complete'},
\ 'mappings': [['nv', '<Plug>(ref-keyword)']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('excitetranslate-vim')
call neobundle#config({
\ 'depends': 'mattn/webapi-vim',
\ 'autoload': {'commands': 'ExciteTranslate'}
\})
call neobundle#untap()
endif
if neobundle#tap('googletranslate-vim')
call neobundle#config({
\ 'autoload': {'commands': ['GoogleTranslate', 'Trans']}
\})
call neobundle#untap()
endif
if neobundle#tap('tmpwin.vim')
call neobundle#config({
\ 'autoload': {'function_prefix': 'tmpwin'}
\})
call neobundle#untap()
endif
if neobundle#tap('BufOnly.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'BufOnly', 'complete': 'buffer'},
\ {'name': 'Bonly', 'complete': 'buffer'},
\ {'name': 'BOnly', 'complete': 'buffer'},
\ {'name': 'Bufonly', 'complete': 'buffer'}
\ ]
\ }
\})
call neobundle#untap()
endif
" TODO: autoload
if neobundle#tap('renamer.vim')
call neobundle#config({
\ 'autoload': {'commands': ['Renamer', 'Ren']}
\})
call neobundle#untap()
endif
if neobundle#tap('movewin.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': ['MoveWin', 'MoveWinLeft', 'MoveWinDown', 'MoveWinUp', 'MoveWinRight'],
\ 'mappings': [['nvoic', '<Plug>(movewin-']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('resizewin.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': ['ResizeWin', 'ResizeWinCX', 'ResizeWinEY', 'ResizeWinCY', 'ResizeWinEX', 'FullSize'],
\ 'mappings': [['nvoic', '<Plug>(resizewin-']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('DrawIt')
call neobundle#config({
\ 'autoload': {
\ 'commands': ['DrawIt', 'DIstart', 'DIstop', 'DInrml', 'DIsngl', 'DIdbl'],
\ 'mappings': [['nxo', '<Plug>DrawIt']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vim-sugarpot')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'SugarpotRenderImage', 'complete': 'file'},
\ {'name': 'SugarpotPreview', 'complete': 'file'},
\ {'name': 'SugarpotClosePreview', 'complete': 'file'},
\ {'name': 'SugarpotClosePreviewAll', 'complete': 'file'}
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vim-conque')
call neobundle#config({
\ 'autoload': {'commands': 'ConqueTerm'}
\})
call neobundle#untap()
endif
if neobundle#tap('vimshell')
call neobundle#config({
\ 'depends': 'Shougo/vimproc.vim',
\ 'autoload': {
\ 'commands': [
\ {'name': 'VimShell', 'complete': 'customlist,vimshell#complete'},
\ {'name': 'VimShellCreate', 'complete': 'customlist,vimshell#complete'},
\ {'name': 'VimShellPop', 'complete': 'customlist,vimshell#complete'},
\ {'name': 'VimShellTab', 'complete': 'customlist,vimshell#complete'},
\ {'name': 'VimShellCurrentDir', 'complete': 'customlist,vimshell#complete'},
\ {'name': 'VimShellBufferDir', 'complete': 'customlist,vimshell#complete'},
\ {'name': 'VimShellExecute', 'complete': 'customlist,vimshell#helpers#vimshell_execute_complete'},
\ {'name': 'VimShellInteractive', 'complete': 'customlist,vimshell#helpers#vimshell_execute_complete'},
\ 'VimShellSendString',
\ {'name': 'VimShellSendBuffer', 'complete': 'buffer'},
\ 'VimShellClose',
\ ],
\ 'mappings': [['n', '<Plug>(vimshell_']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vimshell-ssh')
call neobundle#config({
\ 'autoload': {'filetypes': 'vimshell'}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-clang-format')
call neobundle#config({
\ 'depends': ['kana/vim-operator-user'],
\ 'autoload': {
\ 'commands': ['ClangFormat', 'ClangFormatEchoFormattedCode', 'ClangFormatAutoToggle'],
\ 'mappings': ['<Plug>(operator-clang-format)']
\ }
\})
call neobundle#untap()
endif
" TODO: autoload
if neobundle#tap('vim-snowdrop')
call neobundle#config({
\ 'autoload': {'filetypes': ['c', 'cpp']}
\})
call neobundle#untap()
endif
if neobundle#tap('wandbox-vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'Wandbox', 'complete': 'customlist,wandbox#complete_command'},
\ {'name': 'WandboxAsync', 'complete': 'customlist,wandbox#complete_command'},
\ {'name': 'WandboxSync', 'complete': 'customlist,wandbox#complete_command'},
\ 'WandboxOptionList',
\ 'WandboxOptionListAsync',
\ 'WandboxAbortAsyncWorks',
\ 'WandboxOpenBrowser'
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('DoxygenToolkit.vim')
call neobundle#config({
\ 'autoload': {'commands': ['Dox', 'DoxLic', 'DoxAuthor', 'DoxUndoc', 'DoxBlock']}
\})
call neobundle#untap()
endif
if neobundle#tap('kuin_vim')
call neobundle#config({
\ 'autoload': {'filetypes': 'kuin'}
\})
call neobundle#untap()
endif
if neobundle#tap('gnuplot.vim')
call neobundle#config({
\ 'autoload': {'filetypes': 'gnuplot'}
\})
call neobundle#untap()
endif
" TODO: autoload
if neobundle#tap('java_getset.vim')
call neobundle#config({
\ 'autoload': {'filetypes': 'java'}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-ref-jvmis')
call neobundle#config({
\ 'depends': 'thinca/vim-ref',
\ 'autoload': {'commands': 'Jvmis'}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-javascript')
call neobundle#config({
\ 'autoload': {'filetypes': 'javascript'}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-jsdoc')
call neobundle#config({
\ 'autoload': {'filetypes': 'javascript'}
\})
call neobundle#untap()
endif
if neobundle#tap('jcommenter.vim')
call neobundle#config({
\ 'autoload': {'filetypes': 'java'}
\})
call neobundle#untap()
endif
if neobundle#tap('pyflakes-pathogen')
call neobundle#config({
\ 'autoload': {'filetypes': 'python'}
\})
call neobundle#untap()
endif
if neobundle#tap('ruby-matchit')
call neobundle#config({
\ 'autoload': {'filetypes': 'ruby'}
\})
call neobundle#untap()
endif
if neobundle#tap('emmet-vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': ['EmmetInstall', 'Emmet'],
\ 'filetypes': ['html', 'css']
\ }
\})
call neobundle#untap()
endif
" TODO: autoload
if neobundle#tap('tagexplorer.vim')
call neobundle#config({
\ 'autoload': {
\ 'filetypes': ['cpp', 'java', 'perl', 'python', 'ruby', 'tags']
\}})
call neobundle#untap()
endif
if neobundle#tap('vimconsole.vim')
" call neobundle#config({
" \ 'autoload': {'commands': ['VimConsole', 'VimConsoleOpen']}
" \})
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ 'VimConsoleOpen',
\ 'VimConsoleRedraw',
\ 'VimConsoleClose',
\ 'VimConsoleClear',
\ 'VimConsoleToggle',
\ {'name': 'VimConsoleLog', 'complete': 'expression'},
\ {'name': 'VimConsoleSaveSession', 'complete': 'file'},
\ {'name': 'VimConsoleLoadSession', 'complete': 'file'},
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vim-quickrun')
call neobundle#config({
\ 'autoload': {
\ 'commands': {'name': 'QuickRun', 'complete': 'customlist,quickrun#complete'},
\ 'mappings': [['n', '<Plug>(quickrun']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('jedi-vim')
call neobundle#config({
\ 'depends': 'jmcantrell/vim-virtualenv',
\ 'autoload': {'filetypes': 'python'}
\})
call neobundle#untap()
endif
if neobundle#tap('emoji-vim')
call neobundle#config({
\ 'autoload': {'commands': 'Emoji'}
\})
call neobundle#untap()
endif
" TODO: autoload: prefer filetype
if neobundle#tap('previm')
call neobundle#config({
\ 'autoload': {'commands': 'PrevimOpen'}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-markdown-quote-syntax')
call neobundle#config({
\ 'autoload': {'filetypes': 'markdown'}
\})
call neobundle#untap()
endif
if neobundle#tap('vinarise')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'Vinarise', 'complete': 'customlist,vinarise#complete'},
\ {'name': 'VinariseDump', 'complete': 'customlist,vinarise#complete'},
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('benchvimrc-vim')
call neobundle#config({
\ 'autoload': {'commands': [{'name': 'BenchVimrc', 'complete': 'file'}]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-scouter')
call neobundle#config({
\ 'autoload': {'commands': [{'name': 'Scouter', 'complete': 'file'}]}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-cloud-speech-synthesizer')
call neobundle#config({
\ 'depends': ['mattn/webapi-vim', 'Shougo/vimproc.vim', 'osyo-manga/vim-sound'],
\ 'autoload': {'commands': 'CloudSpeechSynthesize'}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-clipboard')
call neobundle#config({
\ 'autoload': {'commands': ['GetClip', 'PutClip']}
\})
call neobundle#untap()
endif
if neobundle#tap('gist-vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': {'name': 'Gist', 'complete': 'customlist,' . s:to_global_name('gist_CompleteArgs')}
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('open-browser.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ 'OpenBrowser',
\ {'name': 'OpenBrowserSearch', 'complete': 'customlist,openbrowser#_cmd_complete'},
\ {'name': 'OpenBrowserSmartSearch', 'complete': 'customlist,openbrowser#_cmd_complete'}
\ ],
\ 'mappings': [['nv', '<Plug>(openbrowser-']],
\ 'function_prefix': 'openbrowser'
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('gmail.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': ['Gmail', 'GmailChangeUser', 'GmailExit', 'GmailCheckNewMail'],
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('TweetVim')
call neobundle#config({
\ 'depends': ['tyru/open-browser.vim', 'basyura/twibill.vim'],
\ 'autoload': {
\ 'commands': [
\ 'TweetVimAccessToken',
\ 'TweetVimAddAccount',
\ 'TweetVimClearIcon',
\ 'TweetVimCommandSay',
\ 'TweetVimCurrentLineSay',
\ 'TweetVimHomeTimeline',
\ {'name': 'TweetVimListStatuses', 'complete': 'custom,tweetvim#complete#list'},
\ 'TweetVimMentions',
\ {'name': 'TweetVimSay', 'complete': 'custom,tweetvim#complete#account'},
\ {'name': 'TweetVimSearch', 'complete': 'custom,tweetvim#complete#search'},
\ {'name': 'TweetVimSwitchAccount', 'complete': 'custom,tweetvim#complete#account'},
\ 'TweetVimUserStream',
\ {'name': 'TweetVimUserTimeline', 'complete': 'custom,tweetvim#complete#screen_name'},
\ 'TweetVimVersion'
\ ],
\ 'unite_sources': 'tweetvim'
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('chalice')
call neobundle#config({
\ 'autoload': {'commands': 'Chalice'}
\})
call neobundle#untap()
endif
if neobundle#tap('facebook.vim')
let s:build_cmd = 'pip install fbconsole'
call neobundle#config({
\ 'build': {
\ 'windows': s:build_cmd,
\ 'mac': s:build_cmd,
\ 'cygwin': s:build_cmd,
\ 'linux': s:build_cmd,
\ 'unix': s:build_cmd
\ },
\ 'depends': ['tyru/open-browser.vim', 'mattn/webapi-vim'],
\ 'autoload': {
\ 'commands': [
\ 'FacebookHome',
\ 'FacebookFeed',
\ 'FacebookWallPost',
\ 'FacebookAuthenticate'
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('lingr-vim')
call neobundle#config({
\ 'autoload': {'commands': 'LingrLaunch'}
\})
call neobundle#untap()
endif
if neobundle#tap('puyo.vim')
call neobundle#config({
\ 'autoload': {'commands': 'Puyo'}
\})
call neobundle#untap()
endif
if neobundle#tap('weather.vim')
call neobundle#config({
\ 'autoload': {'commands': {'name': 'Weather', 'complete': 'customlist,weather#list'}}
\})
call neobundle#untap()
endif
if neobundle#tap('calendar.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': {'name': 'Calendar', 'complete': 'customlist,calendar#argument#complete'},
\ 'mappings': [['nv', '<Plug>(calendar)']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('VimCalc')
call neobundle#config({
\ 'autoload': {'commands': 'Calc'}
\})
call neobundle#untap()
endif
if neobundle#tap('vimhelpgenerator')
call neobundle#config({
\ 'autoload': {'commands': ['VimHelpGenerator', 'VimHelpGeneratorVirtual']}
\})
call neobundle#untap()
endif
if neobundle#tap('startmenu-vim')
call neobundle#config({
\ 'depends': ['mattn/webapi-vim', 'ctrlpvim/ctrlp.vim', 'Shougo/unite.vim'],
\ 'autoload': {'commands': 'StartMenu'},
\ 'unite_sources': 'startmenu'
\})
call neobundle#untap()
endif
if neobundle#tap('AOJ.vim')
call neobundle#config({
\ 'depends': ['mattn/webapi-vim', 'Shougo/unite.vim'],
\ 'autoload': {
\ 'commands': ['AOJSubmit', 'AOJSubmitByProblemID', 'AOJViewProblems', 'AOJViewStaticticsLogs']
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('goyo.vim')
call neobundle#config({
\ 'autoload': {'commands': 'Goyo'}
\})
call neobundle#untap()
endif
if neobundle#tap('presen-vim')
call neobundle#config({
\ 'depends': 'pocket7878/curses-vim',
\ 'autoload': {
\ 'commands': [
\ {'name': 'Presen', 'complete': 'file'},
\ {'name': 'Vp2html', 'complete': 'file'},
\ ],
\ 'filetypes': 'vimpresen',
\}})
call neobundle#untap()
endif
if neobundle#tap('vim-showtime')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'ShowtimeStart', 'complete': 'file'},
\ {'name': 'ShowtimeResume', 'complete': 'file'}
\ ]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('makecomp.vim')
call neobundle#config({
\ 'autoload': {
\ 'commands': {'name': 'Make', 'complete': 'customlist,makecomp#get_make_argument'}
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('jazzradio.vim')
call neobundle#config({
\ 'autoload': {
\ 'unite_sources': 'jazzradio',
\ 'commands': [
\ 'JazzradioUpdateChannels',
\ 'JazzradioStop',
\ {'name': 'JazzradioPlay', 'complete': 'customlist,jazzradio#channel_key_complete'}
\ ],
\ 'function_prefix': 'jazzradio'
\ }
\})
endif
if neobundle#tap('ctrlp-jazzradio')
call neobundle#config({
\ 'depends' : 'ctrlpvim/ctrlp.vim',
\ 'autoload': {'commands': 'CtrlPJazzradio'}
\})
call neobundle#untap()
endif
if neobundle#tap('ctrlp-rebuildfm')
call neobundle#config({
\ 'depends' : ['ctrlpvim/ctrlp.vim', 'mattn/webapi-vim'],
\ 'autoload': {'commands': 'Rebuildfm'}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-threes')
call neobundle#config({
\ 'autoload': {
\ 'commands': ['ThreesStart', 'ThreesShowRecord']
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('rogue.vim')
call neobundle#config({
\ 'autoload': {'commands': ['Rogue', 'RogueRestore', 'RogueResume', 'RogueScores']}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-duzzle')
call neobundle#config({
\ 'autoload': {'commands': 'DuzzleStart'}
\})
call neobundle#untap()
endif
if neobundle#tap('webapi-vim')
call neobundle#config({
\ 'autoload': {'function_prefix': 'webapi'}
\})
call neobundle#untap()
endif
if neobundle#tap('capture.vim')
call neobundle#config({
\ 'autoload': {'commands': {'name': 'Capture', 'complete': 'command'}}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-prettyprint')
call neobundle#config({
\ 'autoload': {
\ 'commands': [
\ {'name': 'PrettyPrint', 'complete': 'expression'},
\ {'name': 'PP', 'complete': 'expression'}
\ ],
\ 'function_prefix': 'prettyprint'
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('memolist.vim')
call neobundle#config({
\ 'autoload': {'commands': ['MemoGrep', 'MemoList', 'MemoNew']}
\})
call neobundle#untap()
endif
if neobundle#tap('vim-fontzoom')
call neobundle#config({
\ 'gui': 1,
\ 'autoload': {
\ 'commands': 'Fontzoom',
\ 'mappings': [['n', '<Plug>(fontzoom-']]
\ }
\})
call neobundle#untap()
endif
if neobundle#tap('vim-mplayer')
call neobundle#config({
\ 'commands': [
\ {'name': 'MPlayer', 'complete': 'file'},
\ {'name': 'MPlayerEnqueue', 'complete': 'file'},
\ 'MPlayerStop',
\ 'MPlayerVolume',
\ 'MPlayerSpeed',
\ {'name': 'MPlayerEqualizer', 'complete': 'customlist,mplayer#equlizer_complete'},
\ 'MPlayerToggleMute',
\ 'MPlayerTogglePause',
\ 'MPlayerToggleRTTimeInfo',
\ 'MPlayerLoop',
\ 'MPlayerSeek',
\ 'MPlayerSeekToHead',
\ 'MPlayerSeekToEnd',
\ 'MPlayerOperateWithKey',
\ 'MPlayerPrev',
\ 'MPlayerNext',
\ 'MPlayerShowFileInfo',
\ {'name': 'MPlayerCommand', 'complete': 'customlist,mplayer#cmd_complete'},
\ {'name': 'MPlayerGetProperty', 'complete': 'customlist,mplayer#get_property_complete'},
\ {'name': 'MPlayerSetProperty', 'complete': 'customlist,mplayer#set_property_complete'},
\ {'name': 'MPlayerStepProperty', 'complete': 'customlist,mplayer#step_property_complete'},
\ {'name': 'MPlayerHelp', 'complete': 'customlist,mplayer#help_complete'},
\ 'MPlayerFlush'
\ ]
\})
call neobundle#untap()
endif
if !g:is_cygwin
NeoBundleSaveCache
endif
" }}}
endif " neobundle#load_cache()
MyNeoBundleLazy 'koturn/vim-altcomplete'
if neobundle#tap('vim-altcomplete')
call neobundle#config({
\ 'autoload': {'function_prefix': 'altcomplete'}
\})
call neobundle#untap()
endif
MyNeoBundleLazy 'koturn/vim-profiler'
if neobundle#tap('vim-profiler')
call neobundle#config({
\ 'autoload': {'function_prefix': 'profiler'}
\})
call neobundle#untap()
endif
MyNeoBundleLazy 'koturn/vim-rawsearch'
if neobundle#tap('vim-profiler')
call neobundle#config({
\ 'autoload': {'commands': 'ToggleRawSearch'}
\})
call neobundle#untap()
endif
MyNeoBundleLazy 'koturn/vim-chatbot'
if neobundle#tap('vim-chatbot')
call neobundle#config({
\ 'autoload': {
\ 'commands': ['ChatBotQandAMode', 'ChatBotSiritoriMode', 'ChatBotTalkMode']
\}})
call neobundle#untap()
endif
" MyNeoBundle 'koturn/vim-koutil'
MyNeoBundle 'koturn/vim-winmode'
" MyNeoBundleCtrlP 'koturn/vim-rebuildfm'
" NeoBundle 'koturn/vim-mozaicfm'
" MyNeoBundle 'koturn/vim-nicovideo'
if g:is_windows
let mplayer#mplayer = 'C:/CommonUtil/mplayer/mplayer.exe'
else
let mplayer#mplayer = '/cygdrive/c/CommonUtil/mplayer/mplayer.exe'
let mplayer#use_win_mplayer_in_cygwin = 1
endif
let mozaicfm#play_command = mplayer#mplayer
let nicovideo#mplayer = 'C:/CommonUtil/smplayer/mplayer/mplayer'
let nicovideo#mail_address = '[email protected]'
let nicovideo#password = 'jeakitou0411'
let nicovideo#crt_file = expand('~/curl-ca-bundle.crt')
let rebuildfm#verbose = 1
let mozaicfm#verbose = 1
let g:chatbot#user_profile = {
\ 'nickname': 'koturn',
\ 'nickname_y': 'コターン',
\ 'sex': '男',
\ 'bloodtype': 'AB',
\ 'birthdateY': 1990,
\ 'birthdateM': 4,
\ 'birthdateD': 11,
\ 'age': 24,
\ 'constellations': '牡羊座',
\ 'place': '香川',
\}
call neobundle#end()
" }}}
" ------------------------------------------------------------------------------
" plug-in config {{{
" ------------------------------------------------------------------------------
set laststatus=2
if neobundle#tap('vim-airline') && (!s:is_cui || &t_Co >= 16)
" NeoBundle 'itchyny/lightline.vim'
let g:airline_theme = 'solarized'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#tabline#tab_nr_type = 1
let g:airline#extensions#tabline#fnamemod = ':t'
" let g:airline#extensions#tabline#left_sep = ' '
" let g:airline#extensions#tabline#left_alt_sep = '|'
call neobundle#untap()
else
set statusline=%<%f\ %m\ %r%h%w%{'[fenc='.(&fenc!=#''?&fenc:&enc).']\ [ff='.&ff.']\ [ft='.(&ft==#''?'null':&ft).']\ [ascii=0x'}%B]%=\ (%v,%l)/%L%8P
" Change color of status line depending on mode.
if has('syntax')
augroup MyAutoCmd
au InsertEnter * call s:hi_statusline(1)
au InsertLeave * call s:hi_statusline(0)
au ColorScheme * silent! let s:slhlcmd = 'highlight ' . s:get_highlight('StatusLine')
augroup END
endif
function! s:hi_statusline(mode) abort
if a:mode == 1
highlight StatusLine guifg=white guibg=MediumOrchid gui=none ctermfg=white ctermbg=DarkRed cterm=none
else
highlight clear StatusLine
silent execute s:slhlcmd
endif
endfunction
function! s:get_highlight(hi) abort
let hl = ''
redir => hl
execute 'highlight' a:hi
redir END
let hl = substitute(substitute(hl, 'xxx', '', ''), '[\r\n]', '', 'g')
return hl
endfunction
endif
if neobundle#tap('vim-shot-f')
let g:shot_f_no_default_key_mappings = 1
nmap ,f <Plug>(shot-f-f)
nmap ,F <Plug>(shot-f-F)
nmap ,t <Plug>(shot-f-t)
nmap ,T <Plug>(shot-f-T)
xmap ,f <Plug>(shot-f-f)
xmap ,F <Plug>(shot-f-F)
xmap ,t <Plug>(shot-f-t)
xmap ,T <Plug>(shot-f-T)
omap ,f <Plug>(shot-f-f)
omap ,F <Plug>(shot-f-F)
omap ,t <Plug>(shot-f-t)
omap ,T <Plug>(shot-f-T)
call neobundle#untap()
endif
if neobundle#tap('incsearch.vim')
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
call neobundle#untap()
endif
if neobundle#tap('ctrlp.vim')
nnoremap <silent> <C-p> :<C-u>CtrlP<CR>
let g:ctrlp_extensions = [
\ 'rebuildfm',
\ 'mozaicfm',
\ 'nicovideo'
\]
call neobundle#untap()
endif
if neobundle#tap('vim-milqi')
function! s:milqi_complete_unite_source(arglead, ...) abort
let files = split(globpath(&runtimepath, 'autoload/unite/sources/*.vim'), "\n")
let names = map(files, 'fnamemodify(v:val, ":t:r")')
return join(names, "\n")
endfunction
function! neobundle#tapped.hooks.on_post_source(bundle) abort
delfunction s:milqi_complete_unite_source
endfunction
call neobundle#untap()
endif
if neobundle#tap('unite.vim')
let g:unite_enable_start_insert = 1
nnoremap [unite] <Nop>
nmap ,u [unite]
nnoremap [unite]u :<C-u>Unite<Space>
nnoremap <silent> [unite]a :<C-u>Unite airline_themes -auto-preview -winheight=12<CR>
nnoremap <silent> [unite]b :<C-u>Unite buffer<CR>
nnoremap <silent> [unite]c :<C-u>Unite colorscheme -auto-preview<CR>
nnoremap <silent> [unite]d :<C-u>Unite directory<CR>
nnoremap <silent> [unite]f :<C-u>Unite buffer file_rec/async:! file file_mru<CR>
nnoremap <silent> [unite]F :<C-u>Unite font -auto-preview<CR>
nnoremap <silent> [unite]h :<C-u>Unite highlight<CR>
nnoremap <silent> [unite]m :<C-u>Unite mark -auto-preview<CR>
nnoremap <silent> [unite]n :<C-u>Unite n3337<CR>
nnoremap <silent> [unite]o :<C-u>Unite outline<CR>
nnoremap <silent> [unite]r :<C-u>Unite register<CR>
nnoremap <silent> [unite]s :<C-u>Unite source<CR>
nnoremap <silent> [unite]t :<C-u>Unite tag<CR>
nnoremap <silent> [unite]T :<C-u>Unite tweetvim<CR>
nnoremap <silent><expr> [unite]/ line('$') > 5000 ?
\ ":\<C-u>Unite -buffer-name=search -no-split -start-insert line/fast\<CR>" :
\ ":\<C-u>Unite -buffer-name=search -start-insert line\<CR>"
nnoremap <Space>ub :<C-u>UniteWithCursorWord boost-online-doc<CR>
call neobundle#untap()
endif
if neobundle#tap('unite-n3337')
let g:unite_n3337_txt = $DOTVIM . '/n3337.txt'
call neobundle#untap()
endif
if neobundle#tap('neocomplete.vim')
" inoremap <expr><CR> neocomplete#smart_close_popup() . "\<CR>"
" inoremap <expr><CR> pumvisible() ? neocomplete#smart_close_popup() . "\<CR>" : "\<CR>"
let g:neocomplete#enable_at_startup = 1
call neobundle#untap()
endif
if neobundle#tap('neocomplcache')
inoremap <expr><CR> neocomplcache#smart_close_popup() . "\<CR>"
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_force_overwrite_completefunc = 1
if !exists('g:neocomplcache_force_omni_patterns')
let g:neocomplcache_force_omni_patterns = {}
endif
" let g:neocomplcache_force_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|::'
call neobundle#untap()
endif
if neobundle#tap('neosnippet')
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
imap <expr><TAB> neosnippet#expandable() <Bar><Bar> neosnippet#jumpable() ?
\ '<Plug>(neosnippet_expand_or_jump)' : pumvisible() ? '<C-n>' : '<TAB>'
smap <expr><TAB> neosnippet#expandable() <Bar><Bar> neosnippet#jumpable() ?
\ '<Plug>(neosnippet_expand_or_jump)' : '<TAB>'
let g:neosnippet#snippets_directory = '~/.vim/snippets'
if has('conceal')
" set conceallevel=2 concealcursor=i
set conceallevel=0
endif
call neobundle#untap()
endif
if neobundle#tap('eskk.vim')
function! s:toggle_ime() abort
if s:is_ime
set noimdisable
iunmap <C-j>
cunmap <C-j>
lunmap <C-j>
else
set imdisable
imap <C-j> <Plug>(eskk:toggle)
cmap <C-j> <Plug>(eskk:toggle)
lmap <C-j> <Plug>(eskk:toggle)
endif
let s:is_ime = !s:is_ime
endfunction
let s:is_ime = 0
call s:toggle_ime()
command! -bar ToggleIME call s:toggle_ime()
function! neobundle#tapped.hooks.on_source(bundle) abort
" let g:eskk#enable_completion = 1
let g:eskk#start_completion_length = 5
let g:eskk#show_candidates_count = 2
let g:eskk#egg_like_newline_completion = 1
let g:eskk#marker_henkan = '»'
let g:eskk#marker_okuri = '*'
let g:eskk#marker_henkan_select = '«'
let g:eskk#marker_jisyo_touroku = '?'
let g:eskk#dictionary = {'path' : '~/.skk-jisyo', 'sorted' : 0, 'encoding' : 'utf-8'}
let g:eskk#large_dictionary = {'path' : '~/.eskk/SKK-JISYO.L', 'sorted' : 1, 'encoding' : 'euc-jp'}
let g:eskk#debug = 0
" let g:eskk#rom_input_style = 'msime'
let g:eskk#revert_henkan_style = 'okuri'
let g:eskk#egg_like_newline = 1
let g:eskk#keep_state = 1
function! s:eskk_map() abort
let table = eskk#table#new('rom_to_hira*', 'rom_to_hira')
call s:eskk_map_zenkaku(table)
call eskk#register_mode_table('hira', table)
let table = eskk#table#new('rom_to_kata*', 'rom_to_kata')
call s:eskk_map_zenkaku(table)
call eskk#register_mode_table('kata', table)
endfunction
function! s:eskk_map_zenkaku(table) abort
call a:table.add_map(',', ',')
call a:table.add_map('.', '.')
call a:table.add_map('0', '0')
call a:table.add_map('1', '1')
call a:table.add_map('2', '2')
call a:table.add_map('3', '3')
call a:table.add_map('4', '4')
call a:table.add_map('5', '5')
call a:table.add_map('6', '6')
call a:table.add_map('7', '7')
call a:table.add_map('8', '8')
call a:table.add_map('9', '9')
call a:table.add_map('"', '”')
call a:table.add_map('#', '#')
call a:table.add_map('$', '$')
call a:table.add_map('%', '%')
call a:table.add_map('&', '&')
call a:table.add_map("'", '’')
call a:table.add_map('(', '(')
call a:table.add_map(')', ')')
call a:table.add_map('=', '=')
call a:table.add_map('~', '~')
call a:table.add_map('|', '|')
call a:table.add_map('@', '@')
call a:table.add_map('`', '‘')
call a:table.add_map('{', '{')
call a:table.add_map('+', '+')
call a:table.add_map('*', '*')
call a:table.add_map('}', '}')
call a:table.add_map('<', '<')
call a:table.add_map('>', '>')
call a:table.add_map('\', '¥')
call a:table.add_map('_', '_')
call a:table.add_map(' ', ' ')
endfunction
autocmd MyAutoCmd User eskk-initialize-pre call s:eskk_map()
endfunction
call neobundle#untap()
endif
if neobundle#tap('indentLine')
let g:indentLine_color_term = 111
let g:indentLine_color_gui = '#008800'
let g:indentLine_faster = 1
call neobundle#untap()
endif
if neobundle#tap('vim-reanimate')
function! s:reanimate_save_point_completelist(arglead, ...) abort
return filter(reanimate#save_points(), "v:val =~? '" . a:arglead . "'")
endfunction
function! neobundle#tapped.hooks.on_post_source(bundle) abort
call s:delete_function_lazy('s:reanimate_save_point_completelist')
endfunction
let g:reanimate_save_dir = $DOTVIM . '/save'
let g:reanimate_default_save_name = 'reanimate'
let g:reanimate_sessionoptions = 'curdir,folds,help,localoptions,slash,tabpages,winsize'
call neobundle#untap()
endif
if neobundle#tap('caw.vim')
nmap <Leader>c <Plug>(caw:i:toggle)
xmap <Leader>c <Plug>(caw:i:toggle)
call neobundle#untap()
endif
if neobundle#tap('vim-surround')
nmap ds <Plug>Dsurround
nmap cs <Plug>Csurround
nmap ys <Plug>Ysurround
nmap yS <Plug>YSurround
nmap yss <Plug>Yssurround
nmap ySs <Plug>YSsurround
nmap ySS <Plug>YSsurround
xmap S <Plug>VSurround
xmap gS <Plug>VgSurround
call neobundle#untap()
endif
if neobundle#tap('vim-altr')
nmap <Space>a <Plug>(altr-forward)
nmap <Space>A <Plug>(altr-back)
call neobundle#untap()
endif
if neobundle#tap('endwize.vim')
let g:endwize_add_info_filetypes = ['ruby', 'c', 'cpp']
let g:endwise_no_mappings = 1
" autocmd MyAutoCmd FileType lua,ruby,sh,zsh,vb,vbnet,aspvbs,vim imap <buffer> <silent><CR> <CR><Plug>DiscretionaryEnd
autocmd MyAutoCmd FileType lua,ruby,sh,zsh,vb,vbnet,aspvbs,vim
\ imap <buffer> <silent><expr><CR>
\ pumvisible() ? neocomplete#smart_close_popup() . '<CR>' : '<CR><Plug>DiscretionaryEnd'
call neobundle#untap()
endif
" if neobundle#tap('vim-smartinput')
" function! neobundle#tapped.hooks.on_source(bundle) abort
" call smartinput#define_rule({
" \ 'at': '\%(\<struct\>\|\<class\>\|\<enum\>\)\s*\w\+.*\%#',
" \ 'char': '{',
" \ 'input': '{};<Left><Left>',
" \ 'filetype': ['cpp'],
" \})
" endfunction
" call neobundle#untap()
" endif
if neobundle#tap('lexima.vim')
call neobundle#untap()
endif
if neobundle#tap('switch.vim')
function! neobundle#tapped.hooks.on_source(bundle) abort
source $DOTVIM/plugin-config/switch.vim
endfunction
nnoremap <silent> <Space>! :<C-u>Switch<CR>
call neobundle#untap()
endif
if neobundle#tap('clever-f.vim')
map f <Plug>(clever-f-f)
map F <Plug>(clever-f-F)
map t <Plug>(clever-f-t)
map T <Plug>(clever-f-T)
call neobundle#untap()
endif
if neobundle#tap('accelerated-jk')
nmap <C-j> <Plug>(accelerated_jk_gj)
nmap <C-k> <Plug>(accelerated_jk_gk)
call neobundle#untap()
endif
if neobundle#tap('vim-anzu')
let g:anzu_bottomtop_word = 'search hit BOTTOM, continuing at TOP'
let g:anzu_topbottom_word = 'search hit TOP, continuing at BOTTOM'
let g:anzu_status_format = '%p(%i/%l) %w'
nmap n <Plug>(anzu-n-with-echo)zz
nmap N <Plug>(anzu-N-with-echo)zz
nmap * <Plug>(anzu-star-with-echo)Nzz
nmap # <Plug>(anzu-sharp-with-echo)Nzz
nnoremap g* g*Nzz
nnoremap g# g#Nzz
call neobundle#untap()
endif
if neobundle#tap('rainbowcyclone.vim')
nmap c/ <Plug>(rc_search_forward)
nmap c? <Plug>(rc_search_backward)
nmap <silent> c* <Plug>(rc_search_forward_with_cursor)
nmap <silent> c# <Plug>(rc_search_backward_with_cursor)
nmap <silent> cn <Plug>(rc_search_forward_with_last_pattern)
nmap <silent> cN <Plug>(rc_search_backward_with_last_pattern)
call neobundle#untap()
endif
if neobundle#tap('vim-visualstar')
let g:visualstar_no_default_key_mappings = 1
xmap * <Plug>(visualstar-*)
xmap # <Plug>(visualstar-#)
xmap g* <Plug>(visualstar-g*)
xmap g# <Plug>(visualstar-g#)
xmap <kMultiply> <Plug>(visualstar-*)
xmap g<kMultiply> <Plug>(visualstar-g*)
vmap <S-LeftMouse> <Plug>(visualstar-*)
vmap g<S-LeftMouse> <Plug>(visualstar-g*)
call neobundle#untap()
endif
if neobundle#tap('vim-ref')
nnoremap <Leader>e :<C-u>Ref webdict ej<Space>
nnoremap <Leader>E :<C-u>Ref webdict Ej<Space>
nnoremap <Leader>j :<C-u>Ref webdict je<Space>
nnoremap <Leader>dn :<C-u>Ref webdict dn<Space>
nnoremap <Leader>we :<C-u>Ref webdict wiki_en<Space>
nnoremap <Leader>wj :<C-u>Ref webdict wiki<Space>
nnoremap <Leader>k :<C-u>execute 'Ref webdict ej ' . expand('<cword>')<CR>
function! neobundle#tapped.hooks.on_source(bundle) abort
source $DOTVIM/plugin-config/ref.vim
endfunction
call neobundle#untap()
endif
if neobundle#tap('vim-kotemplate')
augroup KoTemplate
autocmd!
autocmd BufNewFile * call kotemplate#auto_action()
augroup END
call neobundle#untap()
endif
if neobundle#tap('movewin.vim')
map <Left> <Plug>(movewin-left)
map! <Left> <Plug>(movewin-left)
map <Down> <Plug>(movewin-down)
map! <Down> <Plug>(movewin-down)
map <Up> <Plug>(movewin-up)
map! <Up> <Plug>(movewin-up)
map <Right> <Plug>(movewin-right)
map! <Right> <Plug>(movewin-right)
call neobundle#untap()
endif
if neobundle#tap('resizewin.vim')
map <F11> <Plug>(resizewin-full)
map! <F11> <Plug>(resizewin-full)
map <M-F11> <Plug>(resizewin-full)
map! <M-F11> <Plug>(resizewin-full)
map <S-Left> <Plug>(resizewin-contract-x)
map! <S-Left> <Plug>(resizewin-contract-x)
map <S-Down> <Plug>(resizewin-expand-y)
map! <S-Down> <Plug>(resizewin-expand-y)
map <S-Up> <Plug>(resizewin-contract-y)
map! <S-Up> <Plug>(resizewin-contract-y)
map <S-Right> <Plug>(resizewin-expand-x)
map! <S-Right> <Plug>(resizewin-expand-x)
call neobundle#untap()
endif
if neobundle#tap('DrawIt')
map <Leader>di <Plug>DrawItStart
map <Leader>ds <Plug>DrawItStop
call neobundle#untap()
endif
if neobundle#tap('vim-sugarpot')
let g:sugarpot_convert = get(g:private, 'imagemagick_path', 'convert')
let g:sugarpot_convert_resize = '50%x25%'
call neobundle#untap()
endif
if neobundle#tap('vim-conque')
let g:ConqueTerm_FastMode = 1
let g:ConqueTerm_ReadUnfocused = 1
let g:ConqueTerm_InsertOnEnter = 1
" let g:ConqueTerm_PromptRegex = '^-->'
" let g:ConqueTerm_TERM = 'xterm'
call neobundle#untap()
endif
if neobundle#tap('vimshell')
function! neobundle#tapped.hooks.on_source(bundle) abort
if s:is_cui
let g:vimshell_prompt = "('v ')$ "
else
let s:my_vimshell_prompt_counter = -1
let s:my_vimshell_anim = [
\ "(´:_:`)",
\ "( ´:_:)",
\ "( ´:_)",
\ "( ´:)",
\ "( ´)",
\ "( )",
\ "( )",
\ "(` )",
\ "(:` )",
\ "(_:` )",
\ "(:_:` )",
\]
let s:my_vimshell_anim_len = len(s:my_vimshell_anim)
function! s:my_vimshell_dynamic_prompt() abort
echomsg 'counter =' s:my_vimshell_prompt_counter
let s:my_vimshell_prompt_counter += 1
return s:my_vimshell_anim[s:my_vimshell_prompt_counter % s:my_vimshell_anim_len]
endfunction
let g:vimshell_prompt_expr = s:to_global_name('my_vimshell_dynamic_prompt') . '() . " $ "'
let g:vimshell_prompt_pattern = '^([ ´:_:`]\{5}) \$ '
endif
let g:vimshell_secondary_prompt = '> '
let g:vimshell_user_prompt = 'getcwd()'
let g:vimshell_right_prompt = '"[" . strftime("%Y/%m/%d %H:%M:%S", localtime()) . "]"'
endfunction
" if g:at_startup && !argc()
" autocmd MyAutoCmd VimEnter * VimShell
" endif
call neobundle#untap()
endif
if neobundle#tap('vim-clang-format')
map ,x <Plug>(operator-clang-format)
call neobundle#untap()
endif
if neobundle#tap('vim-snowdrop')
function! neobundle#tapped.hooks.on_source(bundle) abort
let g:snowdrop#libclang_directory = get(g:private, 'libclang_dir', '')
let g:snowdrop#command_options = {
\ 'cpp': '-std=c++1y',
\}
" Enable code completion in neocomplete.vim.
let g:neocomplete#sources#snowdrop#enable = 1
" Not skip
let g:neocomplete#skip_auto_completion_time = ''
endfunction
call neobundle#untap()
endif
if neobundle#tap('wandbox-vim')
function! neobundle#tapped.hooks.on_source(bundle) abort
" Set default compilers for each filetype
let wandbox#default_compiler = {
\ 'cpp': 'clang-head',
\ 'ruby': 'ruby-1.9.3-p0',
\}
" Set default options for each filetype. Type of value is string or list of string
let wandbox#default_options = {
\ 'cpp': 'warning,optimize,boost-1.55,sprout',
\ 'haskell': ['haskell-warning', 'haskell-optimize']
\}
endfunction
call neobundle#untap()
endif
if neobundle#tap('kuin_vim')
" autocmd MyAutoCmd BufReadPre *.kn setfiletype kuin
call neobundle#untap()
endif
if neobundle#tap('gnuplot.vim')
autocmd MyAutoCmd BufReadPre *.plt setfiletype gnuplot
call neobundle#untap()
endif
if neobundle#tap('emmet-vim')
let g:user_emmet_install_global = 0
autocmd MyAutoCmd FileType html,css EmmetInstall
call neobundle#untap()
endif
if neobundle#tap('vim-quickrun')
function! neobundle#tapped.hooks.on_source(bundle) abort
source $DOTVIM/plugin-config/quickrun.vim
endfunction
call neobundle#untap()
endif
if neobundle#tap('previm')
" g:chrome_cmd is defined in ~/.vim/.private.vim
let g:previm_open_cmd = get(g:private, 'browser_cmd', '')
call neobundle#untap()
endif
if neobundle#tap('vim-markdown-quote-syntax')
function! neobundle#tapped.hooks.on_source(bundle) abort
let g:markdown_quote_syntax_filetypes = {
\ 'c': {'start': 'c'},
\ 'cpp': {'start': 'cpp'},
\ 'html': {'start': 'html'},
\ 'java': {'start': 'java'},
\ 'javascript': {'start': 'javascript'},
\ 'perl': {'start': 'perl'},
\ 'python': {'start': 'python'},
\ 'ruby': {'start': 'ruby'},
\ 'vim': {'start': 'VimL'}
\}
endfunction
call neobundle#untap()
endif
if neobundle#tap('vim-clipboard')
nnoremap <silent> ,<Space> :<C-u>PutClip<CR>
nnoremap <silent> <Space>, :<C-u>GetClip<CR>
if has('unnamedplus')
let g:clipboard#clip_register = '@+'
endif
call neobundle#untap()
endif
if neobundle#tap('gist-vim')
function! s:gist_CompleteArgs(arg_lead,cmdline,cursor_pos) abort
return filter(["-p", "-P", "-a", "-m", "-e", "-s", "-d", "+1", "-1", "-f", "-c", "-l", "-la", "-ls", "-b",
\ "--listall", "--liststar", "--list", "--multibuffer", "--private", "--public", "--anonymous", "--description", "--clipboard",
\ "--rawurl", "--delete", "--edit", "--star", "--unstar", "--fork", "--browser"
\ ], '!stridx(v:val, a:arg_lead)')
endfunction
function! neobundle#tapped.hooks.on_post_source(bundle) abort
delfunction s:gist_CompleteArgs
endfunction
call neobundle#untap()
endif
if neobundle#tap('open-browser.vim')
" execute the command which was last selected by you.
function! s:execute_with_selected_text(command) abort
if a:command !~? '%s'
return
endif
let reg = '"'
let [save_reg, save_type] = [getreg(reg), getregtype(reg)]
normal! gvy
let selectedText = @"
call setreg(reg, save_reg, save_type)
if selectedText ==# ''
return
endif
execute printf(a:command, selectedText)
endfunction
nmap <Space>o <Plug>(openbrowser-smart-search)
nmap <Space>O :<C-u>OpenBrowserSmartSearch<Space>
nnoremap gz vi':<C-u>call <SID>execute_with_selected_text('call openbrowser#open("https://github.com/%s")')<CR>
vnoremap gz :<C-u>call <SID>execute_with_selected_text('call openbrowser#open("https://github.com/%s")')<CR>
call neobundle#untap()
endif
if neobundle#tap('gmail.vim')
" g:gmail_address is defined in ~/.vim/.private.vim
let g:gmail_user_name = get(g:private, 'gmail_address', '')
call neobundle#untap()
endif
if neobundle#tap('TweetVim')
function! neobundle#tapped.hooks.on_source(bundle) abort
let g:tweetvim_original_hi = 1
let g:tweetvim_tweet_per_page = 50
let g:tweetvim_display_source = 1
let g:tweetvim_display_time = 1
let g:tweetvim_display_icon = 1
endfunction
noremap <Leader>t :<C-u>TweetVimCommandSay<Space>
call neobundle#untap()
endif
if neobundle#tap('vimhelpgenerator')
function! neobundle#tapped.hooks.on_source(bundle) abort
let g:vimhelpgenerator_defaultlanguage = 'en'
let g:vimhelpgenerator_version = ''
let g:vimhelpgenerator_author = 'Author : koturn'
let g:vimhelpgenerator_contents = {
\ 'contents': 1, 'introduction': 1, 'usage': 1, 'interface': 1,
\ 'variables': 1, 'commands': 1, 'key-mappings': 1, 'functions': 1,
\ 'setting': 0, 'todo': 1, 'changelog': 0
\}
endfunction
call neobundle#untap()
endif
if neobundle#tap('startmenu-vim')
let g:startmenu_interface = 'unite'
call neobundle#untap()
endif
if neobundle#tap('goyo.vim')
function! neobundle#tapped.hooks.on_source(bundle) abort
let g:goyo_margin_top = 0
let g:goyo_margin_bottom = 0
let g:goyo_linenr = 1
let g:goyo_width = 100
function! s:goyo_before() abort
setlocal colorcolumn=+1,+21
highlight ColorColumn ctermbg=Red guibg=Red
endfunction
function! s:goyo_after() abort
" Do nothing
endfunction
let g:goyo_callbacks = [function('s:goyo_before'), function('s:goyo_after')]
endfunction
call neobundle#untap()
endif
if neobundle#tap('presen-vim')
augroup MyAutoCmd
au BufReadPre *.vp setfiletype vimpresen
au FileType presen,vimshell hi WhitespaceEOL term=NONE ctermbg=NONE guibg=NONE
au FileType presen,vimshell execute 'au MyAutoCmd BufEnter <buffer> hi WhitespaceEOL term=NONE ctermbg=NONE guibg=NONE'
au FileType presen,vimshell execute 'au MyAutoCmd BufLeave <buffer> hi WhitespaceEOL term=underline ctermbg=Blue guibg=Blue'
" au FileType presen hi TabEOL term=NONE ctermbg=NONE guibg=NONE
au FileType presen,vimshell hi SpaceTab term=NONE ctermbg=NONE guibg=NONE guisp=NONE
au FileType presen,vimshell execute 'au MyAutoCmd BufEnter <buffer> hi SpaceTab term=NONE ctermbg=NONE guibg=NONE'
au FileType presen,vimshell execute 'au MyAutoCmd BufLeave <buffer> hi SpaceTab term=underline ctermbg=Magenta guibg=Magenta guisp=Magenta'
" au FileType presen hi JPSpace term=NONE ctermbg=NONE guibg=NONE
augroup END
call neobundle#untap()
endif
if neobundle#tap('vim-showtime')
augroup MyAutoCmd
au FileType showtime nested hi WhitespaceEOL term=NONE ctermbg=NONE guibg=NONE
au FileType showtime nested hi TabEOL term=NONE ctermbg=NONE guibg=NONE
au FileType showtime nested hi SpaceTab term=NONE ctermbg=NONE guibg=NONE guisp=NONE
au FileType showtime nested hi JPSpace term=NONE ctermbg=NONE guibg=NONE
augroup END
call neobundle#untap()
endif
if neobundle#tap('jazzradio.vim')
nnoremap <silent> [unite]j :<C-u>Unite jazzradio<CR>
call neobundle#untap()
endif
if neobundle#tap('rogue.vim')
let g:rogue#name = 'koturn'
let g:rogue#japanese = 1
call neobundle#untap()
endif
if neobundle#tap('memolist.vim')
" When use NeoBundleLazy, Netrw doesn't work well at the first time
" So redifine MemoList to call memolist#list() twice.
command! -nargs=0 MemoList silent call memolist#list() | call memolist#list()
" let g:memolist_unite = 1
" let g:memolist_vimfiler = 1
call neobundle#untap()
endif
if neobundle#tap('vim-fontzoom')
nmap + <Plug>(fontzoom-larger)
nmap - <Plug>(fontzoom-smaller)
call neobundle#untap()
endif
if neobundle#tap('vim-marching')
function! neobundle#tapped.hooks.on_source(bundle) abort
if g:is_windows
let g:marching_clang_command = 'C:/CommonUtil/LLVM/clang.exe'
else
let g:marching_clang_command = '/cygdrive/c/CommonUtil/LLVM/clang.exe'
endif
let g:marching#clang_command#options = {
\ 'cpp': '-std=gnu++1y'
\}
if g:is_windows
let g:marching_include_paths = [
\ 'C:/cygwin64/usr/include',
\ 'C:/cygwin64/lib/gcc/x86_64-pc-cygwin/4.8.3/include/c++'
\]
else
let g:marching_include_paths = [
\ '/usr/include',
\ '/lib/gcc/x86_64-pc-cygwin/4.8.3/include/c++'
\]
endif
let g:marching_enable_neocomplete = 1
if !exists('g:neocomplete#force_omni_input_patterns')
let g:neocomplete#force_omni_input_patterns = {}
endif
let g:neocomplete#force_omni_input_patterns.cpp =
\ '[^.[:digit:] *\t]\%(\.\|->\)\w*\|\h\w*::\w*'
endfunction
call neobundle#untap()
endif
if neobundle#tap('vim-kotemplate')
function! neobundle#tapped.hooks.on_source(bundle) abort
function! s:get_filename(tag) abort
let filename = fnamemodify(expand('%'), ':t')
return filename ==# '' ? a:tag : filename
endfunction
function! s:get_basefilename(tag) abort
let basefilename = fnamemodify(expand('%'), ':t:r')
return basefilename ==# '' ? a:tag : basefilename
endfunction
function! s:get_filename_camel2capital(tag) abort
let basefilename = fnamemodify(expand('%'), ':t:r')
let basefilename = toupper(substitute(basefilename, '.\zs\(\u\)', '_\l\1', 'g'))
return basefilename ==# '' ? a:tag : basefilename
endfunction
function! s:get_filename_snake2pascal(tag) abort
let basefilename = fnamemodify(expand('%'), ':t:r')
let basefilename = substitute(basefilename, '\(^\l\)', '\u\1', '')
let basefilename = substitute(basefilename, '_\(\l\)', '\u\1', 'g')
return basefilename ==# '' ? a:tag : basefilename
endfunction
function! s:move_cursor(tag) abort
if getline(line('$')) ==# ''
let pos = getcurpos()
normal! G"_ddgg
call setpos('.', pos)
endif
if search(a:tag)
normal! "_da>
endif
return ''
endfunction
let g:kotemplate#filter = {
\ 'pattern': {
\ 'c': ['*.c', '*.h'],
\ 'cpp': ['*.c', '*.cc', '*.cpp', '*.cxx', '*.h', '*.hpp'],
\ 'cs': ['*.cs'],
\ 'html': ['*.html'],
\ 'java': ['*.java'],
\ 'javascript': ['*.js'],
\ 'markdown': ['*.md'],
\ 'python': ['*.py'],
\ 'ruby': ['*.rb'],
\ 'vim': ['*.vim'],
\ 'xml': ['*.xml'],
\ },
\ 'function': 'glob'
\}
let g:kotemplate#enable_autocmd = 1
let g:kotemplate#auto_filetypes = keys(g:kotemplate#filter.pattern)
let g:kotemplate#autocmd_function = 'inputlist'
let g:kotemplate#dir = '~/github/kotemplate/'
let g:kotemplate#tag_actions = [{
\ '<+AUTHOR+>': 'koturn',
\ '<+MAIL_ADDRESS+>': get(g:private, 'gmail_address', ''),
\ '<+DATE+>': 'strftime("%Y %m/%d")',
\ '<+DATEFULL+>': 'strftime("%Y-%m-%d %H:%M:%S")',
\ '<+YEAR+>': 'strftime("%Y")',
\ '<+FILE+>': function('s:get_filename'),
\ '<+FILEBASE+>': function('s:get_basefilename'),
\ '<+FILE_CAPITAL+>': function('s:get_filename_camel2capital'),
\ '<+FILE_PASCAL+>': function('s:get_filename_snake2pascal'),
\ '<+DIR+>': 'split(expand("%:p:h"), "/")[-1]',
\ '<%=\(.\{-}\)%>': 'eval(submatch(1))',
\}, {
\ '<+CURSOR+>': function('s:move_cursor'),
\}]
let vim_project_expr = 'fnamemodify(substitute(%%PROJECT%%, "^vim-", "", "g"), ":t:r") . ".vim"'
let g:kotemplate#projects = {
\ 'vim': {
\ 'autoload': {vim_project_expr : 'Vim/autoload.vim'},
\ 'plugin': {vim_project_expr : 'Vim/plugin.vim'},
\ 'README.md': 'Markdown/ReadMe.md',
\ 'LICENSE': 'LicenseFile/MIT'
\ }, 'java': {
\ 'src': {'Main.java': 'Java/Main.java'},
\ 'bin': {},
\ 'build.xml': 'Java/build.xml'
\ }, 'web': {
\ 'index.html': 'HTML/html5.html',
\ 'css': {},
\ 'js': 'JavaScript/module.js'
\ }
\}
endfunction
call neobundle#untap()
endif
" }}}
" }}}
" ********************** The end of setting of NeoBundle ***********************
" ------------------------------------------------------------------------------
" END of .vimrc {{{
" ------------------------------------------------------------------------------
if !g:at_startup
call neobundle#call_hook('on_source')
endif
if g:is_windows && s:is_cui
colorscheme torte
else
colorscheme monokai
endif
filetype plugin indent on
set secure
" }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment