" Dein.vim: let s:dein_dir = expand('$CACHE/dein') . '/repos/github.com/Shougo/dein.vim' let g:dein#install_progress_type = 'title' let g:dein#enable_notification = 1 " setup dein "{{{ if &runtimepath !~# '/dein.vim' if !isdirectory(s:dein_dir) call system('git clone https://github.com/Shougo/dein.vim ' . s:dein_dir) endif execute ' set runtimepath^=' . s:dein_dir let g:loaded_neobundle = 1 endif "}}} let s:path = expand('$CACHE/dein') if dein#load_state(s:path) call dein#begin(s:path, expand('')) call dein#load_toml('~/.vim/plugins.toml', {'lazy' : 0}) call dein#load_toml('~/.vim/pluginslazy.toml', {'lazy' : 1}) if filereadable(expand('~/.vim/trial.toml')) call dein#load_toml('~/.vim/trial.toml', {'lazy' : 0, 'merged': 0}) endif call dein#load_toml('~/.vim/ftplugin.toml', {'lazy' : 0}) " after/ftplugin/ 扱い 要recache if dein#tap('deoplete.nvim') && has('nvim') call dein#disable('neocomplete.vim') endif call dein#end() call dein#save_state() if dein#check_install() call dein#install() endif endif au myac VimEnter * call dein#call_hook('source') au myac VimEnter * call dein#call_hook('post_source') "###################### plugin config ############################" let g:netrw_nogx = 1 " Disable unnecessary keymaps " let g:loaded_netrw = 1 " let g:loaded_netrwPlugin = 1 " let g:loaded_netrwSettings = 1 " let g:loaded_netrwFileHandlers = 1 let g:solarized_termcolors = 256 " To use solarized in CLI " vim-operator taps "{{{ if dein#tap('vim-operator-user') "{{{ nmap k (operator-jump-head-out)a nmap j (operator-jump-tail-out)a nmap se (operator-evalruby) nmap seL (operator-evalruby)(textobj-line-a) xmap se (operator-evalruby) call operator#user#define('space-fold', 'vimrc#operator_space_fold') call operator#user#define('blank2void', 'vimrc#operator_blank2void') " Add fold marker and space to end of line nmap zf (operator-space-fold) xmap zf (operator-space-fold) nmap d (operator-blank2void) xmap d (operator-blank2void) nmap dd :exec "normal \(vim-original-visualline)d" " TODO cバージョン作るのむずい 削除した場所をピンポイントで編集させるの難しい endif "}}} if dein#tap('vim-operator-replace') nmap gz (operator-replace) xmap gz (operator-replace) for s:c in split("\" ' ` ( { [ <") exe 'nmap gz' . s:c '(operator-replace)i' . s:c endfor unlet s:c endif if dein#tap('vim-operator-surround') "{{{ " () {} はab aB で表す 他は記号 でもb Bは使わないかな map sa (operator-surround-append) map sd (operator-surround-delete)a map sr (operator-surround-replace)a " if you use vim-textobj-multiblock nmap sdd (operator-surround-delete)(textobj-multiblock-a) nmap srr (operator-surround-replace)(textobj-multiblock-a) nmap S (vim-original-visual)(vim-original-tail)(operator-surround-append) " nmap saw saaw " nmap saW saaW nmap saL saiL endif "}}} "}}} " vim-textobj taps "{{{ if dein#tap('vim-textobj-user') call textobj#user#plugin( \ 'blankline', { \ 'prev': {'select': '', 'select-function': 'vimrc#textobj_blankline_prev'}, \ 'next': {'select': '', 'select-function': 'vimrc#textobj_blankline_next'}, \ }, \ ) omap } (textobj-blankline-next) omap { (textobj-blankline-prev) endif if dein#tap('textobj-lastpaste') "{{{ let g:textobj_lastpaste_no_default_key_mappings = 1 omap v (textobj-lastpaste-i) endif "}}} if dein#tap('textobj-wiw') "{{{ " bkad/CamelCaseMotionと組み合わせれば意図した通りに動く let g:textobj_wiw_no_default_key_mappings = 1 omap aw (textobj-wiw-a) omap iw (textobj-wiw-i) xmap aw (textobj-wiw-a) xmap iw (textobj-wiw-i) endif "}}} if dein#tap('vim-textobj-line') "{{{ let g:textobj_line_no_default_key_mappings = 1 omap aL (textobj-line-a) omap iL (textobj-line-i) " whitout last ... nmap yY y(textobj-line-i) nmap dD d(textobj-line-i) nmap cC c(textobj-line-i) endif "}}} if dein#tap('vim-textobj-function') "{{{ let g:textobj_function_no_default_key_mappings = 1 omap im (textobj-function-i) omap am (textobj-function-a) xmap im (textobj-function-i) xmap am (textobj-function-a) " I A でvisual-blockの挿入ができない " omap IF (textobj-function-I) " omap AF (textobj-function-A) " vmap IF (textobj-function-I) " vmap AF (textobj-function-A) endif "}}} if dein#tap('sideways.vim') "{{{ nmap l SidewaysRight nmap h SidewaysLeft endif "}}} if dein#tap('vim-textobj-ruby') "{{{ let g:textobj_ruby_no_default_key_mappings = 1 " do-endとかのブロックもある " TODO プルリク送る? function! s:textobj_function_ruby_select(object_type) return textobj#ruby#object_definition_select_{a:object_type}() endfunction au myac FileType ruby let b:textobj_function_select = function('s:textobj_function_ruby_select') endif "}}} if dein#tap('vim-textobj-multiblock') "{{{ let g:textobj_multiblock_no_default_key_mappings = 1 omap ib (textobj-multiblock-i) xmap ib (textobj-multiblock-i) omap ab (textobj-multiblock-a) xmap ab (textobj-multiblock-a) let g:textobj#multiblock#enable_block_in_cursor = 1 let g:textobj_multiblock_search_limit = 40 let g:textobj_multiblock_blocks = [ \ ['"', '"', 1], \ ["'", "'", 1], \ ['`', '`', 1], \ ['(', ')', 1], \ ['[', ']', 1], \ ['{', '}', 1], \ ['<', '>', 1], \ ['|', '|', 1], \ ] endif "}}} "}}} if dein#tap('caw.vim') " {{{ let g:caw_no_default_keymappings = 1 let g:caw_dollarpos_sp_left = ' ' let g:caw_dollarpos_startinsert = 1 " for context_filetype and precious au myac FileType * let b:caw_oneline_comment = substitute(&commentstring, '\s*%s', '', '') " 回数指定は gc2jみたいにやる nmap gcc (caw:hatpos:toggle) nmap gcj (caw:hatpos:toggle)j(caw:hatpos:toggle)k nmap gck (caw:hatpos:toggle)k(caw:hatpos:toggle)j " Aじゃないとobjectのaと被る nmap gcA (caw:dollarpos:toggle) nmap gyy yy(caw:hatpos:toggle) xmap (comment-toggle-yank) ygv(caw:i:toggle) xmap gy (comment-toggle-yank) xmap gc (caw:hatpos:toggle) nmap gc (operator-caw-hatpos-toggle) nmap g gcc xmap g gc if dein#tap('vim-operator-exec_command') nmap gy operator#exec_command#mapexpr_v_keymapping("\(comment-toggle-yank)") endif endif "}}} if dein#tap('vimshell.vim') "{{{ nnoremap sh :VimShellTab " Initialize execute file list. let g:vimshell_execute_file_list = {} if !exists('g:vimshell_interactive_interpreter_commands') let g:vimshell_interactive_interpreter_commands = {} endif let g:vimshell_interactive_interpreter_commands.python = 'ipython' let g:vimshell_interactive_interpreter_commands.ruby = 'pry' endif "}}} if dein#tap('neocomplete.vim') "{{{ let g:loaded_deoplete = 1 let g:neocomplete#enable_at_startup = 1 let g:neopairs#enable = 1 inoremap pumvisible()? "\" : "\" " inoremap pumvisible()? "\" : "\" " inoremap neocomplete#smart_close_popup() . "\" " inoremap neocomplete#smart_close_popup() . "\" endif "}}} if dein#tap('neosnippet.vim') "{{{ let g:neosnippet#enable_snipmate_compatibility = 0 let g:neosnippet#snippets_directory = '~/.vim/snippets' let g:neosnippet#enable_complete_done = 1 let g:neosnippet#expand_word_boundary = 1 let g:neosnippet#scope_aliases = {} let g:neosnippet#scope_aliases['ruby'] = 'ruby,ruby-rails' au myac InsertLeave * NeoSnippetClearMarkers " let g:neosnippet#enable_auto_clear_markers = 1 " Don't work for multi lines " imap pumvisible()? "\" : neosnippet#jumpable()? "\(neosnippet_jump)" : "\" imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) xmap (neosnippet_jump) if has('conceal') " set conceallevel=2 concealcursor=niv endif endif "}}} if dein#tap('unite.vim') "{{{ " commands command! Prefix Unite -auto-resize -start-insert -input=^... prefix command! Vgrep Unite -auto-resize -no-quit -buffer-name=vimgrep vg command! Mes Unite -auto-resize -buffer-name=message message command! Todo Unite -auto-resize -ignorecase -buffer-name=todo grep:%::(todo|fix|xxx)\: command! Schemes Unite -auto-resize -auto-preview colorscheme command! Status Unite -auto-resize -no-empty -no-quit -buffer-name=git/status giti/status command! Quickfix Unite -auto-resize -no-empty -no-quit -direction=botright quickfix -buffer-name=quickfix command! -nargs=* Maps execute 'Unite -auto-resize -start-insert output:map\ ' . . '|map!\ ' . command! -nargs=+ Out execute 'Unite output:' . escape(, ' ') " #keymap nnoremap u :Unite nnoremap ;gs :Status nnoremap ;q :Quickfix nnoremap m :Unite -auto-resize -no-empty -buffer-name=mark mark nnoremap ;mb :Unite -auto-resize -no-empty -buffer-name=bookmark bookmark nnoremap ;ma :UniteBookmarkAdd nnoremap ;uh :Unite history/command -auto-resize -buffer-name=history-command nnoremap ;uc :Unite command -auto-resize -buffer-name=command nnoremap ;ut :Unite tab -auto-resize -select=`tabpagenr()-1` -buffer-name=tab nnoremap ;uj :Unite jump -auto-resize -buffer-name=jump nnoremap ;u nnoremap \b :Unite -start-insert -auto-resize -buffer-name=buffer buffer nnoremap \f :Unite -start-insert file nnoremap \F :Unite -start-insert file neomru/file nnoremap r :UniteResume -no-start-insert -force-redraw " search nnoremap s/ :Unite -buffer-name=search%`bufnr('%')` -start-insert -auto-resize line:all nnoremap s? :Vgrep nnoremap s* :UniteWithCursorWord -buffer-name=search%`bufnr('%')` line:forward:wrap nnoremap s# :UniteWithCursorWord -buffer-name=search%`bufnr('%')` line:backward:wrap nnoremap st :Unite -start-insert tag nnoremap sg :Unite grep/git:**:-i nmap sn :UniteResume search%`bufnr('%')` -no-start-insert -force-redraw(unite_loop_cursor_down) nnoremap sh :Unite -auto-resize -start-insert -buffer-name=headline headline nnoremap so :Unite -auto-resize -start-insert -resume -input= -buffer-name=outline outline nnoremap sT :Todo endif "}}} if dein#tap('unite-quickfix') "{{{ command! LocationList call s:OpenLocationList() functio! s:OpenLocationList() let l:bufnum = winbufnr(unite#get_unite_winnr('location_list')) echomsg bufnum if bufnum != -1 echomsg 'delete ' . l:bufnum execute 'bwipeout' l:bufnum endif " -silent つかないと起動時にメッセージが出て止まる " -create 意図した通りに動作するがhide-bufferが大量生成される " ないとFileTypeでのマップがうまくいかなかったり、色がつかなかったり Unite location_list -buffer-name=location_list -auto-resize -no-quit -no-empty -no-focus -create -direction=below -silent endfunction " au myac VimEnter * au myac BufWritePost * LocationList endif "}}} if dein#tap('syntastic') "{{{ let g:syntastic_always_populate_loc_list = 1 " quickfixの表示を更新する let g:syntastic_loc_list_height = 10 let g:syntastic_auto_loc_list = 0 let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 let g:syntastic_enable_signs = 0 let g:syntastic_auto_jump = 0 " default is 0 let g:syntastic_ignore_files = ['\m^/usr/include/', expand('~/Documents/note/')] " let g:syntastic_debug = 1 let g:syntastic_error_symbol = '✗' let g:syntastic_warning_symbol = '⚠' let g:syntastic_cpp_compiler = 'clang++' let g:syntastic_cpp_compiler_options = $CPP_COMP_OPT let g:syntastic_ruby_mri_args = '-W1' nmap \ts :SyntasticToggleMode nmap gas :call SyntasticLoclistHide() " TODO " wrteで開く " readで開くのはafter/plugin/の中にある " function! dein#tapped.hooks.on_post_source(bundle) " au myac BufWritePost * LocationList " endfunction endif "}}} if dein#tap('yankround.vim') "{{{ nmap p (yankround-p) xmap p (yankround-p) nmap P (yankround-P) nmap gp (yankround-gp) xmap gp (yankround-gp) nmap gP (yankround-gP) nmap (yankround-next) nmap smart_previous() function! s:smart_previous() if yankround#is_active() return "\(yankround-prev)" else return ":\" endif endfunction let g:yankround_max_history = 30 let g:yankround_dir = '~/.vim/tmp/yankround_history' let g:yankround_use_region_hl = 1 highlight YankRoundRegion cterm=italic au myac ColorScheme * highlight YankRoundRegion cterm=italic endif "}}} if dein#tap('vim-easymotion') "{{{ let g:EasyMotion_do_mapping = 0 let g:EasyMotion_keys = 'asdghklqwertuiopzxcvbnmfj' let g:EasyMotion_use_upper = 0 let g:EasyMotion_smartcase = 1 let g:EasyMotion_leader_key = ';' let g:EasyMotion_skipfoldedline = 1 let g:EasyMotion_do_shade = 1 let g:EasyMotion_enter_jump_first = 1 " Enter jump to first match let g:EasyMotion_space_jump_first = 1 " Space jump to first match let g:EasyMotion_add_search_history = 0 let g:EasyMotion_prompt = '{n}> ' let g:EasyMotion_cursor_highlight = 0 au myac ColorScheme,VimEnter * call s:easymotion_highlight() function! s:easymotion_highlight() "{{{ hi EasyMotionTarget ctermfg=220 guifg=#ffd700 hi EasyMotionTarget2First ctermfg=220 guifg=#ffd700 hi EasyMotionTarget2Second ctermfg=46 guifg=#00ff00 endfunction "}}} " (easymotion-lineanywhere) current line上のwordの初めと終わりを選択して飛ぶ " (easymotion-jumptoanywhere) スクリーン上のwordの初めと終わりを選択して飛ぶ map ;h (easymotion-linebackward) map ;l (easymotion-lineforward) map ;j (easymotion-j) map ;k (easymotion-k) nmap ;L (easymotion-overwin-line) map ;; (easymotion-s2) " map ;f (easymotion-sl2) map ;f (easymotion-fln) map ;t (easymotion-tln) map ;w (easymotion-w) nmap ;w (easymotion-overwin-w) map ;b (easymotion-b) " nmap EasyMotion#is_active()? '(easymotion-next)' : '' endif "}}} if dein#tap('vim-airline') "{{{ " https://github.com/bling/vim-airline/wiki/Screenshots let g:airline_theme = 'kalisi' " 分割した時のファイル名とか見やすい " serene simple xtermlight kalisi badwolf light let g:airline_powerline_fonts = 1 " let g:airline_left_sep = ' ' " let g:airline_right_sep = ' ' let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#show_tab_nr = 1 let g:airline#extensions#tabline#tab_nr_type = 2 " splits and tab number " let g:airline#extensions#tabline#left_sep = ' ' " let g:airline#extensions#tabline#left_alt_sep = ' ' " let g:airline#extensions#tabline#right_sep = ' ' " let g:airline#extensions#tabline#right_alt_sep = ' ' let g:airline#extensions#tabline#fnamemod = ':t' " name in tabline. second argument of fnamemodify endif "}}} if dein#tap('hl_matchit.vim') "{{{ let g:hl_matchit_enable_on_vim_startup = 1 let g:hl_matchit_hl_groupname = 'Title' let g:hl_matchit_allow_ft = 'html,vim,zsh,sh' " ruby上手くいかない let g:hl_matchit_cursor_wait = 0.10 " 更新頻度 let g:hl_matchit_hl_groupname = 'HlMatchit' au myac ColorScheme * hi HlMatchit cterm=bold,underline endif "}}} if dein#tap('vim-anzu') " {{{ " let g:anzu_enable_CursorHold_AnzuUpdateSearchStatus = 1 " Treat folding well " nnoremap n anzu#mode#mapexpr('n', '', 'zzzv') " nnoremap N anzu#mode#mapexpr('N', '', 'zzzv') " clear status " nmap (anzu-clear-search-status) endif " }}} if dein#tap('vim-asterisk') "{{{ " let g:asterisk#keeppos = 1 endif "}}} if dein#tap('incsearch.vim') " {{{ au myac ColorScheme * hi IncSearch ctermbg=39 ctermfg=56 guibg=#00afff guifg=#5f00d7 cterm=NONE gui=NONE au myac ColorScheme * hi Search ctermfg=75 ctermbg=18 guifg=#5fafff guibg=#000087 cterm=NONE gui=NONE let g:incsearch#no_inc_hlsearch = 0 " 他のwindowではハイライトしない let g:incsearch#auto_nohlsearch = 1 " 自動でハイライトを消す let g:incsearch#consistent_n_direction = 0 " 1:nで常にforwardに移動 let g:incsearch#magic = '\v' " very magic if dein#is_sourced('incsearch-index.vim') map / (incsearch-index-/) map ? (incsearch-index-?) map g/ (incsearch-index-stay) else map / (incsearch-forward) map ? (incsearch-backward) map g/ (incsearch-stay) endif map * (incsearch-nohl-*)(anzu-update-search-status-with-echo) map # (incsearch-nohl-#)(anzu-update-search-status-with-echo) map g* (incsearch-nohl0)(asterisk-z*)(anzu-update-search-status-with-echo) map g# (incsearch-nohl0)(asterisk-z#)(anzu-update-search-status-with-echo) xmap * (incsearch-nohl)(asterisk-g*)(anzu-update-search-status-with-echo) xmap # (incsearch-nohl)(asterisk-g#)(anzu-update-search-status-with-echo) xmap g* (incsearch-nohl0)(asterisk-gz*)(anzu-update-search-status-with-echo) xmap g# (incsearch-nohl0)(asterisk-gz#)(anzu-update-search-status-with-echo) map n (incsearch-nohl-n) map N (incsearch-nohl-N) nmap n (incsearch-nohl)(anzu-n)zzzv nmap N (incsearch-nohl)(anzu-N)zzzv " g系は選択範囲を検索 zはstay asteriskはsmartcaseで*検索する " nohlとnohl0の違いはたぶんCursorMovedがあるかないか " map * (incsearch-nohl)(asterisk-*) " map # (incsearch-nohl)(asterisk-#) endif "}}} if dein#tap('clever-f.vim') "{{{ let g:clever_f_ignore_case = 0 let g:clever_f_smart_case = 0 let g:clever_f_use_migemo = 0 let g:clever_f_across_no_line = 0 let g:clever_f_chars_match_any_signs = '' " ;で ({\"を代用 let g:clever_f_fix_key_direction = 0 " 1だとどんな時でもfで後ろにFで前に移動する let g:clever_f_show_prompt = 1 let g:clever_f_timeout_ms = 0 let g:clever_f_repeat_last_char_inputs = ["\", "\"] " (clever-f-repeat-forward) " (clever-f-repeat-back) endif "}}} if dein#tap('vim-jplus') "{{{ nmap J (jplus) xmap J (jplus) " 任意の1文字+両端に空白を挿入して結合を行う nmap gJ (jplus-getchar) xmap gJ (jplus-getchar) " 複数文字を入力したい場合 nmap gJ (jplus-input) vmap gJ (jplus-input) " ,での結合にスペースを挿入 let g:jplus#input_config = { \ ',' : {'delimiter_format' : '%d '} \} endif "}}} if dein#tap('vim-quickhl') "{{{ let g:quickhl_manual_enable_at_startup = 1 let g:quickhl_cword_enable_at_startup = 0 let g:quickhl_tag_enable_at_startup = 0 let g:quickhl_manual_keywords = [] " Can use List and Dictionary nmap gh (quickhl-manual-this) nmap gl (operator-quickhl-manual-this-motion)(textobj-line-i) nmap gm (operator-quickhl-manual-this-motion) xmap gh (quickhl-manual-this) nmap \hm (quickhl-manual-reset) xmap \hm (quickhl-manual-reset) nmap \ht (quickhl-tag-toggle) nmap \hc (quickhl-cword-toggle) let g:quickhl_manual_hl_priority = 100 let g:quickhl_manual_colors = [ \ 'term=reverse ctermfg=232 ctermbg=160 gui=bold guifg=Black guibg=Red', \ 'term=reverse ctermfg=232 ctermbg=128 gui=bold guifg=Black guibg=Purple', \ 'term=reverse ctermfg=232 ctermbg=63 gui=bold guifg=Black guibg=SlateBlue', \ 'term=reverse ctermfg=232 ctermbg=33 gui=bold guifg=Black guibg=Blue', \ 'term=reverse ctermfg=232 ctermbg=34 gui=bold guifg=Black guibg=Green', \ 'term=reverse ctermfg=232 ctermbg=226 gui=bold guifg=Black guibg=Yellow', \ 'term=reverse ctermfg=232 ctermbg=202 gui=bold guifg=Black guibg=Orange', \ 'term=reverse ctermfg=0 ctermbg=207', \ 'term=reverse ctermfg=0 ctermbg=201', \ 'term=reverse ctermfg=0 ctermbg=117', \ 'term=reverse ctermfg=0 ctermbg=75', \ 'term=reverse ctermfg=0 ctermbg=43', \ 'term=reverse ctermfg=0 ctermbg=190', \ 'term=reverse ctermfg=0 ctermbg=69', \ 'term=reverse ctermfg=0 ctermbg=85', \ 'term=reverse ctermfg=0 ctermbg=183', \ ] endif "}}} if dein#tap('vim-choosewin') "{{{ nmap \w (choosewin) let g:choosewin_overlay_enable = 1 let g:choosewin_overlay_clear_multibyte = 1 let g:choosewin_overlay_font_size = 'small' let g:choosewin_blink_on_land = 0 let g:choosewin_statusline_replace = 0 let g:choosewin_tabline_replace = 0 endif "}}} if dein#tap('jedi-vim') "{{{ autocmd myac FileType python setlocal omnifunc=jedi#completions let g:jedi#completions_enabled = 0 let g:jedi#auto_vim_configuration = 0 endif "}}} if dein#tap('open-browser.vim') "{{{ nmap gss :Wsearch " nmap gsc (openbrowser-open) xmap gsc (openbrowser-smart-search) nmap gsc :call smart_open() function! s:smart_open() abort let iskeyword_save = &iskeyword setl iskeyword=@,@-@,-,_,:,;,.,%,/,48-57 try let str = expand('') let str = substitute(str, '[,.]$', '', '') call openbrowser#smart_search(str) finally let &l:iskeyword = iskeyword_save endtry endfunction command! -nargs=* Wsearch :call www_search() nnoremap (openbrowser-wwwsearch) :call www_search() function! s:www_search(query) if a:query !=# '' let l:search_word = a:query else let l:search_word = input('Please input search word: ') endif if l:search_word !=# '' let l:search_word = substitute(l:search_word, "'", "''", 'g') call openbrowser#search(l:search_word) endif endfunction endif "}}} if dein#tap('rainbowcyclone.vim') "{{{ let g:rainwbow_cyclone_colors = [ \ 'term=reverse ctermfg=232 ctermbg=196 gui=bold guifg=Black guibg=Red', \ 'term=reverse ctermfg=232 ctermbg=129 gui=bold guifg=Black guibg=Purple', \ 'term=reverse ctermfg=232 ctermbg=63 gui=bold guifg=Black guibg=SlateBlue', \ 'term=reverse ctermfg=232 ctermbg=27 gui=bold guifg=Black guibg=Blue', \ 'term=reverse ctermfg=232 ctermbg=40 gui=bold guifg=Black guibg=Green', \ 'term=reverse ctermfg=232 ctermbg=226 gui=bold guifg=Black guibg=Yellow', \ 'term=reverse ctermfg=232 ctermbg=202 gui=bold guifg=Black guibg=Orange', \ ] nmap co/ (rc_search_forward) nmap co? (rc_search_backward) nmap co* (rc_search_forward_with_cursor) nmap co# (rc_search_backward_with_cursor) nmap con (rc_search_forward_with_last_pattern) nmap coN (rc_search_backward_with_last_pattern) " nmap c/ (rc_highlight) " nmap c* (rc_highlight_with_cursor) " nmap cn (rc_highlight_with_last_pattern) " nmap * (rc_search_forward_with_cursor_complete) endif "}}} if dein#tap('vim-hopping') "{{{ let g:hopping#prompt = 'Input:> ' nmap \H (hopping-start) " let g:hopping#keymapping = { " \ "\" : "(hopping-next)", " \ "\" : "(hopping-prev)", " \ "\" : "(scroll-u)", " \ "\" : "(scroll-d)", " \} endif "}}} if dein#tap('CamelCaseMotion') "{{{ map w CamelCaseMotion_w map b CamelCaseMotion_b map e CamelCaseMotion_e endif "}}} if dein#tap('vim-gista') "{{{ let g:gista#client#default_username = 'uplus' endif "}}} if dein#tap('vim-fugitive') "{{{ command! Commit Gcommit -v command! Fix Gcommit --amend -v endif "}}} if dein#tap('shaberu.vim') "{{{ command! -nargs=1 Say ShaberuSay let g:shaberu_user_define_say_command = 'jsay "%%TEXT%%"' let g:shaberu_is_mute = 0 endif "}}} if dein#tap('vim-expand-region') "{{{ xmap v (expand_region_expand) xmap gm (expand_region_shrink) endif "}}} if dein#tap('vim-over') "{{{ " let g:over_enable_auto_nohlsearch = 1 let g:over_enable_cmd_window = 0 " let g:over_command_line_prompt = "> " " let g:over_command_line_key_mappings = {} " (over-cmdline-scroll-y) |CTRL-y| 相当 " (over-cmdline-scroll-u) |CTRL-u| 相当 " (over-cmdline-scroll-f) |CTRL-f| 相当 " (over-cmdline-scroll-e) |CTRL-e| 相当 " (over-cmdline-scroll-d) |CTRL-d| 相当 " (over-cmdline-scroll-b) |CTRL-b| 相当 nnoremap ss :OverCommandLine %s/\v nnoremap sw :OverCommandLine %s/\v<>/ nnoremap sW :OverCommandLine %s/\v<>/ xnoremap ss :OverCommandLine s/\v xnoremap sw :OverCommandLine s/\v<>/ xnoremap sW :OverCommandLine s/\v<>/ endif "}}} if dein#tap('vim-smartword') "{{{ nmap w (smartword-w) nmap b (smartword-b) nmap e (smartword-e) nmap ge (smartword-ge) vmap w (smartword-w) vmap b (smartword-b) vmap e (smartword-e) vmap ge (smartword-ge) " word moveをCamelCase単位にする map (smartword-basic-w) CamelCaseMotion_w map (smartword-basic-b) CamelCaseMotion_b map (smartword-basic-e) CamelCaseMotion_e endif "}}} if dein#tap('webapi-vim') "{{{ command! -nargs=* URIencode :call URIencode() command! -nargs=* URIdecode :call URIdecode() function! URIencode(...) abort if a:0 == 0 || '' ==# a:1 let list = matchlist(getline('.'), '\v^(\s*)(.*)\s*$')[1:2] let url = webapi#http#encodeURI(list[1]) call setline('.', list[0] . url) else echo webapi#http#encodeURI(a:1) endif endfunction function! URIdecode(...) abort if a:0 == 0 || '' ==# a:1 let list = matchlist(getline('.'), '\v^(\s*)(.*)\s*$')[1:2] let url = webapi#http#decodeURI(list[1]) call setline('.', list[0] . url) else echo webapi#http#decodeURI(a:1) endif endfunction endif "}}} if dein#tap('ref-dicts-en') "{{{ let g:ref_source_webdict_sites = { \ 'ej': { 'url': 'http://dictionary.infoseek.ne.jp/ejword/%s' }, \ 'je': { 'url': 'http://dictionary.infoseek.ne.jp/jeword/%s' }, \ 'wiki': { 'url': 'http://ja.wikipedia.org/wiki/%s' }, \ } let g:ref_source_webdict_sites.default = 'ej' " output filter function! g:ref_source_webdict_sites.ej.filter(output) let l:body = join(split(a:output, "\n")[16:], "\n") let l:body = tr(l:body, '《》〈〉【】[]()', '<><>[][]()') let l:body = substitute(l:body, '[★▼●]', '', 'g') let l:body = substitute(l:body, '\n出典:\_.*\%$', '', 'g') return l:body endfunction function! g:ref_source_webdict_sites.je.filter(output) let l:body = join(split(a:output, "\n")[16:], "\n") let l:body = tr(l:body, '《》〈〉【】[]()', '<><>[][]()') let l:body = substitute(l:body, '[★▼●]', '', 'g') let l:body = substitute(l:body, '\n出典:\_.*\%$', '', 'g') return l:body endfunction au myac FileType ref-webdict nnoremap q :quit command! -nargs=1 Wiki Ref webdict wiki command! -nargs=1 Eng Ref webdict endif "}}}