diff --git a/dotfiles/.gitconfig b/dotfiles/.gitconfig index 87396920..a7127a09 100644 --- a/dotfiles/.gitconfig +++ b/dotfiles/.gitconfig @@ -6,14 +6,12 @@ user = tyru [core] excludesfile = ~/.gitignore.base - editor = vim [user] name = tyru email = tyru.exe@gmail.com [alias] ar = archive br = branch - cancel = !git commit -a -m 'Temporary commit for cancel' && git reset --hard HEAD~ ci = commit -v cia = commit -v --all ciam = commit -v --amend diff --git a/dotfiles/.vim/Vivacious.lock b/dotfiles/.vim/Vivacious.lock index c67c4f5c..ca3df037 100644 --- a/dotfiles/.vim/Vivacious.lock +++ b/dotfiles/.vim/Vivacious.lock @@ -1,4 +1,7 @@ version:1 +active:1 version:2ec28751775ee4f33cdcd6fe5bb93af1573dc6fd dir:bundle/open-browser.vim name:open-browser.vim remote:origin type:git url:https://github.com/tyru/open-browser.vim branch:master +active:1 version:f874dbdd8a5945a4dd7310c43dffba5f1820a8fa dir:bundle/emap.vim name:emap.vim remote:origin type:git url:https://github.com/tyru/emap.vim branch:master +active:1 version:69b471b3b215bbebd2580d1663dc811f9a09b25a dir:bundle/vim-altercmd name:vim-altercmd remote:origin type:git url:https://github.com/tyru/vim-altercmd branch:master active:1 version:145ddffb8cd33211df22b1c7c5399cb8ecdafd6b dir:bundle/SudoEdit.vim name:SudoEdit.vim remote:origin type:git url:https://github.com/vim-scripts/SudoEdit.vim branch:master active:1 version:6600953fc7c85ca43216abf4765118994bf0cc5f dir:bundle/ag.vim name:ag.vim remote:origin type:git url:https://github.com/rking/ag.vim.git branch:master active:1 version:32c272063f2602d57882c83fea2cd7496776eb83 dir:bundle/autodate.vim name:autodate.vim remote:origin type:git url:https://github.com/vim-scripts/autodate.vim.git branch:master @@ -8,12 +11,10 @@ active:1 version:9a52df9f8b381276e732cf1394e6bd07fc083a56 dir:bundle/caw.vim nam active:1 version:56498f8dfea1f68de2892d6373e132a7e863753e dir:bundle/codingstyle.vim name:codingstyle.vim remote:origin type:git url:https://github.com/tyru/codingstyle.vim branch:master active:1 version:bc7fe9e3ead0be6a6fe3a8f2871b454051365337 dir:bundle/cpp-vim name:cpp-vim remote:origin type:git url:https://github.com/vim-jp/cpp-vim branch:master active:1 version:e8e5b191b16d9903a933382a19d33a13be1c5257 dir:bundle/current-func-info.vim name:current-func-info.vim remote:origin type:git url:https://github.com/tyru/current-func-info.vim branch:master -active:1 version:f874dbdd8a5945a4dd7310c43dffba5f1820a8fa dir:bundle/emap.vim name:emap.vim remote:origin type:git url:https://github.com/tyru/emap.vim branch:master -active:1 version:07e5acbaacb9c016419c04c5728831d8a0756fd9 dir:bundle/eskk.vim name:eskk.vim remote:origin type:git url:https://github.com/tyru/eskk.vim branch:master +active:1 version:e0d0019bb512715e167fdda1ae93f347ce7d20ca dir:bundle/eskk.vim name:eskk.vim remote:origin type:git url:https://github.com/tyru/eskk.vim branch:master active:1 version:8854283dc68c6b669c441774e3497954a6f1e352 dir:bundle/fileutils.vim name:fileutils.vim remote:origin type:git url:https://github.com/tyru/fileutils.vim branch:master active:1 version:2ca2ae57d6a69bc73fc91864f5a3acf9d81d5798 dir:bundle/foldCC name:foldCC remote:origin type:git url:https://github.com/LeafCage/foldCC branch:master active:1 version:9b0a764c26c3c52edfabacc1597bb46023913fa5 dir:bundle/ftl-vim-syntax name:ftl-vim-syntax remote:origin type:git url:https://github.com/chaquotay/ftl-vim-syntax branch:master -active:1 version:88c331e2e07765090112a396e5e119b39b5aa754 dir:bundle/gist-vim name:gist-vim remote:origin type:git url:https://github.com/mattn/gist-vim branch:master active:1 version:21b38e6bce5a0852dd55d41f7a014c1e7c3938a6 dir:bundle/lexima.vim name:lexima.vim remote:origin type:git url:https://github.com/cohama/lexima.vim branch:master active:1 version:1977757ec425408d5dc1dfaa9c0ccb67a5c437bb dir:bundle/neocomplete.vim name:neocomplete.vim remote:origin type:git url:https://github.com/Shougo/neocomplete.vim.git branch:master active:1 version:bab3124e3ff52dc70d30fd741ba0b8d718cae4d9 dir:bundle/neomru.vim name:neomru.vim remote:origin type:git url:https://github.com/Shougo/neomru.vim branch:master @@ -21,19 +22,16 @@ active:1 version:a444952e7bfc1443815dde9ab72a2e2b843e5d20 dir:bundle/neosnippet- active:1 version:da9806f8253a9f889f3a800dd78d8ce3389685d4 dir:bundle/neosnippet.vim name:neosnippet.vim remote:origin type:git url:https://github.com/Shougo/neosnippet.vim.git branch:master active:1 version:6dbde30df6170cbe685627b12bf36b48d1c6d175 dir:bundle/nextfile.vim name:nextfile.vim remote:origin type:git url:https://github.com/tyru/nextfile.vim branch:master active:1 version:8312733b08330191358af14832d9959f19739eda dir:bundle/open-browser-github.vim name:open-browser-github.vim remote:origin type:git url:https://github.com/tyru/open-browser-github.vim branch:master -active:1 version:61169d9c614cfead929be33b279e4e644d2c7c55 dir:bundle/open-browser.vim name:open-browser.vim remote:origin type:git url:https://github.com/tyru/open-browser.vim branch:master active:1 version:53f9588aa8f1baa0d0313543b36d950498f67a55 dir:bundle/operator-html-escape.vim name:operator-html-escape.vim remote:origin type:git url:https://github.com/tyru/operator-html-escape.vim branch:master active:1 version:5cef6ab1da1bb8942796bb6d88342dbf0436751b dir:bundle/qfhist.vim name:qfhist.vim remote:origin type:git url:https://github.com/tyru/qfhist.vim branch:master active:1 version:81a1c599e54ae01348e5935386175a147c7b9cd2 dir:bundle/restart.vim name:restart.vim remote:origin type:git url:https://github.com/tyru/restart.vim branch:master -active:1 version:f8a8fcffcff2a7d2f169ecf3bb5d0071ae1649c5 dir:bundle/skkdict.vim name:skkdict.vim remote:origin type:git url:https://github.com/tyru/skkdict.vim branch:master +active:1 version:786effb02b40aaa5dce560aebb8323c572a9ca1e dir:bundle/skkdict.vim name:skkdict.vim remote:origin type:git url:https://github.com/tyru/skkdict.vim branch:master active:1 version:05e040cfdd003c367b2351dada21d0517149f20f dir:bundle/transbuffer.vim name:transbuffer.vim remote:origin type:git url:https://github.com/tyru/transbuffer.vim branch:master active:1 version:fa1efac6ce022fc307836d34828c6aff43481233 dir:bundle/typescript-vim name:typescript-vim remote:origin type:git url:https://github.com/leafgarland/typescript-vim.git branch:master active:1 version:422eca71a0c17e543a1aaa6713b903502d7a0354 dir:bundle/unite.vim name:unite.vim remote:origin type:git url:https://github.com/Shougo/unite.vim branch:master -active:1 version:69b471b3b215bbebd2580d1663dc811f9a09b25a dir:bundle/vim-altercmd name:vim-altercmd remote:origin type:git url:https://github.com/tyru/vim-altercmd branch:master active:1 version:f8ba72aa0c50958a747b7cb3c36be1a26b696b0e dir:bundle/vim-anzu name:vim-anzu remote:origin type:git url:https://github.com/osyo-manga/vim-anzu.git branch:master active:1 version:3d595447dab4466e90b6fe47e3d80c014cd15a0e dir:bundle/vim-brightest name:vim-brightest remote:origin type:git url:https://github.com/osyo-manga/vim-brightest branch:master active:1 version:b02d8a9140d800f4a07af82fa31b6189bb3b66c6 dir:bundle/vim-fakeclip name:vim-fakeclip remote:origin type:git url:https://github.com/kana/vim-fakeclip branch:master -active:1 version:4a70aa2e0b98d20940a65ac38b6e9acc69c6b7a0 dir:bundle/vim-flavored-markdown name:vim-flavored-markdown remote:origin type:git url:https://github.com/jtratner/vim-flavored-markdown.git branch:master active:1 version:89771dffd3682ef82a4b3b3e9c971b9909f08e87 dir:bundle/vim-ft-diff_fold name:vim-ft-diff_fold remote:origin type:git url:https://github.com/thinca/vim-ft-diff_fold branch:master active:1 version:9faeb4bf4644ad5d4a1bbef9df635d44814cd80c dir:bundle/vim-ft-markdown_fold name:vim-ft-markdown_fold remote:origin type:git url:https://github.com/thinca/vim-ft-markdown_fold branch:master active:1 version:fd36aa9c61e06d71befdbe8931f97137c489b065 dir:bundle/vim-fugitive name:vim-fugitive remote:origin type:git url:https://github.com/tpope/vim-fugitive branch:master @@ -49,7 +47,6 @@ active:1 version:fc5d7792afbebc7bef8de1e3a00713bba2932a24 dir:bundle/vim-rails n active:1 version:007b0ac409100cf2b83eb7dace5c8235e3737fef dir:bundle/vim-ref name:vim-ref remote:origin type:git url:https://github.com/thinca/vim-ref branch:master active:1 version:6dd787884b4df5c9193073325775b22c3a800225 dir:bundle/vim-repeat name:vim-repeat remote:origin type:git url:https://github.com/kana/vim-repeat branch:master active:1 version:a3b9500ebda69f90d16a567da9a39693919489ea dir:bundle/vim-rooter name:vim-rooter remote:origin type:git url:https://github.com/airblade/vim-rooter.git branch:master -active:1 version:1d9ef6ef40b4de6ce2c973b3e8dc1d521ddcb274 dir:bundle/vim-singleton name:vim-singleton remote:origin type:git url:https://github.com/thinca/vim-singleton branch:master active:1 version:d44a302b3ca97c8014c35c93893ca8fec0b95e4e dir:bundle/vim-submode name:vim-submode remote:origin type:git url:https://github.com/kana/vim-submode branch:master active:1 version:e0d348ca7474d970d7abdd87b59cf44efe617ee2 dir:bundle/vim-surround name:vim-surround remote:origin type:git url:https://github.com/kana/vim-surround branch:master active:1 version:8b71a03a037608fa5918f5096812577cec6355e4 dir:bundle/vim-tabpagecd name:vim-tabpagecd remote:origin type:git url:https://github.com/kana/vim-tabpagecd branch:master @@ -59,16 +56,30 @@ active:1 version:de7de799d8fcba459aad75d49a21a9349ce088bf dir:bundle/vim-textobj active:1 version:a543539f45b45afb449b36befd209b2864a91b47 dir:bundle/vim-textobj-function-javascript name:vim-textobj-function-javascript remote:origin type:git url:https://github.com/thinca/vim-textobj-function-javascript branch:master active:1 version:22842e725e26795bb9b068e6c6344ffce3f84baf dir:bundle/vim-textobj-function-perl name:vim-textobj-function-perl remote:origin type:git url:https://github.com/thinca/vim-textobj-function-perl branch:master active:1 version:deb76867c302f933c8f21753806cbf2d8461b548 dir:bundle/vim-textobj-indent name:vim-textobj-indent remote:origin type:git url:https://github.com/kana/vim-textobj-indent branch:master -active:1 version:e23fc2cb977c9bf061aae133aa9a41f2488bd1af dir:bundle/vim-textobj-jabraces name:vim-textobj-jabraces remote:origin type:git url:https://github.com/kana/vim-textobj-jabraces branch:master active:1 version:a3054162c09bcf732624f43ddacbd85dad09713b dir:bundle/vim-textobj-user name:vim-textobj-user remote:origin type:git url:https://github.com/kana/vim-textobj-user branch:master active:1 version:79eb95aa4dd24a818799f770c346cd995f06dd10 dir:bundle/vim-themis name:vim-themis remote:origin type:git url:https://github.com/thinca/vim-themis branch:master -active:1 version:eeeb1739ded6e7ff9108c21fb47966a2320eaea0 dir:bundle/vim-vimlint name:vim-vimlint remote:origin type:git url:https://github.com/syngan/vim-vimlint branch:master active:1 version:a18cd0e7a03311ac709595c1d261ed44b45c9098 dir:bundle/vim-visualstar name:vim-visualstar remote:origin type:git url:https://github.com/thinca/vim-visualstar branch:master active:1 version:199cc37c8ddddd153cbc1a747f7fc15d64cd9f65 dir:bundle/vimdoc-ja name:vimdoc-ja remote:origin type:git url:https://github.com/vim-jp/vimdoc-ja branch:master -active:1 version:e12f415d9263b50777fdf03e6e6fcfca162819e2 dir:bundle/vimproc name:vimproc remote:origin type:git url:https://github.com/Shougo/vimproc branch:master -active:1 version:ba9ce13a5c9910d58f8be03d90a07da7fafe7166 dir:bundle/vital.vim name:vital.vim remote:origin type:git url:https://github.com/vim-jp/vital.vim branch:web/uri/implement-todo -active:1 version:16d59da0bedb9a110a8acc62e31657c5ca76219e dir:bundle/vivacious.vim name:vivacious.vim remote:origin type:git url:https://github.com/tyru/vivacious.vim.git branch:master +active:1 version:aa075b9b56839e1adb08421d2e9837f90e59acad dir:bundle/vimproc name:vimproc remote:origin type:git url:https://github.com/Shougo/vimproc branch:master +active:1 version:c90955aa94561dd54d68cd963f41f78c215da944 dir:bundle/vital.vim name:vital.vim remote:origin type:git url:https://github.com/vim-jp/vital.vim branch:web/uri/implement-todo +active:1 version:45630dfb84ffc4d0f87054b6cd7cf6ca610da29e dir:bundle/vivacious.vim name:vivacious.vim remote:origin type:git url:https://github.com/tyru/vivacious.vim.git branch:master active:1 version:dfc60635e610f9200646a84d11887af9e3d50b10 dir:bundle/webapi-vim name:webapi-vim remote:origin type:git url:https://github.com/mattn/webapi-vim branch:master active:1 version:b130f24277e3c6a5afa3984921516b0a83b31d28 dir:bundle/previm name:previm remote:origin type:git url:https://github.com/kannokanno/previm branch:master active:1 version:478b217d299b6f5938b43a4929d6bb0907cc3a56 dir:bundle/vim-trailing-whitespace name:vim-trailing-whitespace remote:origin type:git url:https://github.com/bronson/vim-trailing-whitespace branch:master active:1 version:8ec90adc65257115227e8e724a7509efd920b3f6 dir:bundle/quickey.vim name:quickey.vim remote:origin type:git url:https://github.com/tyru/quickey.vim branch:master +active:0 version:e25473061bdca0aa7ca2fa17968dd0eff82eaff6 dir:bundle/vim-vimlint name:vim-vimlint remote:origin type:git url:https://github.com/syngan/vim-vimlint branch:master +active:0 version:8235a27309929c9eefe89b86027f3c8059e77872 dir:bundle/vim-vimlparser name:vim-vimlparser remote:origin type:git url:https://github.com/ynkdir/vim-vimlparser branch:master +active:1 version:d2f1f5ba91fc144b8611c7bba35cea4066e88297 dir:bundle/vmock name:vmock remote:origin type:git url:https://github.com/kannokanno/vmock branch:master +active:1 version:03c59f648fcadd415fc91d7b100cf48bd0a55fac dir:bundle/vim-niceblock name:vim-niceblock remote:origin type:git url:https://github.com/kana/vim-niceblock branch:master +active:1 version:1345a556a321a092716e149d4765a5e17c0e9f0f dir:bundle/vim-operator-replace name:vim-operator-replace remote:origin type:git url:https://github.com/kana/vim-operator-replace branch:master +active:1 version:1200f05badc4cba2f35a7df93cbce8393fd30003 dir:bundle/vim-textobj-underscore name:vim-textobj-underscore remote:origin type:git url:https://github.com/lucapette/vim-textobj-underscore branch:master +active:1 version:9a970d68d7e3f2134a079329e6f5bcf331cd7262 dir:bundle/operator-camelize.vim name:operator-camelize.vim remote:origin type:git url:https://github.com/tyru/operator-camelize.vim branch:master +active:1 version:88f6e5c42b6c532eabcd5e8c3738c3acc3dce7b5 dir:bundle/vim-lastplace name:vim-lastplace remote:origin type:git url:https://github.com/dietsche/vim-lastplace branch:master +active:1 version:b4b6f786f2ff96ed0a8c9f2db822212625a222f4 dir:bundle/vim-gista name:vim-gista remote:origin type:git url:https://github.com/lambdalisue/vim-gista branch:master +active:1 version:e2cc8a661bb3f3215fddf58549913c5115f585bd dir:bundle/vim-localrc name:vim-localrc remote:origin type:git url:https://github.com/thinca/vim-localrc branch:master +active:1 version:55bb439e5834515e7def35484f9ed08738fb9dc5 dir:bundle/stoptypofile.vim name:stoptypofile.vim remote:origin type:git url:git@github.com:tyru/stoptypofile.vim.git branch:master +active:1 version:765c65d1b27ba771102aa3cd775e13c6095f7ae5 dir:bundle/closesubwin.vim name:closesubwin.vim remote:origin type:git url:git@github.com:tyru/closesubwin.vim.git branch:master +active:1 version:1832bac55d3a96048d3f010d69b90f4671b805fc dir:bundle/markdown-codehl-onthefly.vim name:markdown-codehl-onthefly.vim remote:origin type:git url:git@github.com:tyru/markdown-codehl-onthefly.vim.git branch:master +active:1 version:de42c8a325fa964f0e3031fe0c029e7437195106 dir:bundle/vim-markdown name:vim-markdown remote:origin type:git url:https://github.com/tpope/vim-markdown branch:master +active:1 version:1d9ef6ef40b4de6ce2c973b3e8dc1d521ddcb274 dir:bundle/vim-singleton name:vim-singleton remote:origin type:git url:https://github.com/thinca/vim-singleton branch:master +active:1 version:a3f3c8b8109183e7bd75d609e29e63b61617549e dir:bundle/share-cmdline-history.vim name:share-cmdline-history.vim remote:origin type:git url:https://github.com/tyru/share-cmdline-history.vim branch:master diff --git a/dotfiles/.vim/after/ftplugin/c.vim b/dotfiles/.vim/after/ftplugin/c.vim index bb941093..32f9a9a3 100644 --- a/dotfiles/.vim/after/ftplugin/c.vim +++ b/dotfiles/.vim/after/ftplugin/c.vim @@ -3,10 +3,6 @@ scriptencoding utf-8 let s:save_cpo = &cpo set cpo&vim -if globpath(&rtp, 'autoload/tyru/util.vim') == '' - finish -endif - " Do not search from header setlocal complete-=i setlocal complete-=d diff --git a/dotfiles/.vim/after/ftplugin/html.vim b/dotfiles/.vim/after/ftplugin/html.vim new file mode 100644 index 00000000..27f72bc8 --- /dev/null +++ b/dotfiles/.vim/after/ftplugin/html.vim @@ -0,0 +1,11 @@ +" vim:foldmethod=marker:fen: +scriptencoding utf-8 +let s:save_cpo = &cpo +set cpo&vim + +setlocal includeexpr=substitute(v:fname,'^\\/','','') +setlocal path+=;/ + +let b:undo_ftplugin = 'setlocal includeexpr< path<' + +let &cpo = s:save_cpo diff --git a/dotfiles/.vim/after/ftplugin/markdown.vim b/dotfiles/.vim/after/ftplugin/markdown.vim index 13106c45..a759bfb2 100644 --- a/dotfiles/.vim/after/ftplugin/markdown.vim +++ b/dotfiles/.vim/after/ftplugin/markdown.vim @@ -3,7 +3,7 @@ scriptencoding utf-8 let s:save_cpo = &cpo set cpo&vim -setlocal tabstop=2 shiftwidth=0 +setlocal tabstop=4 let b:undo_ftplugin = 'setlocal tabstop< shiftwidth<' let &cpo = s:save_cpo diff --git a/dotfiles/.vim/bundleconfig/closesubwin.vim b/dotfiles/.vim/bundleconfig/closesubwin.vim new file mode 100644 index 00000000..f3a4244d --- /dev/null +++ b/dotfiles/.vim/bundleconfig/closesubwin.vim @@ -0,0 +1,42 @@ +scriptencoding utf-8 +let s:save_cpo = &cpo +set cpo&vim + + +let s:closesubwin = vivacious#bundleconfig#new() + +" Configuration for closesubwin. +function! s:closesubwin.config() + Map -remap [n] ch (closesubwin-close-help) + Map -remap [n] cq (closesubwin-close-quickfix) + Map -remap [n] cu (closesubwin-close-unlisted) + " Close first matching window in above windows. + Map -remap [n] cc (closesubwin-close-sub) +endfunction + +" Plugin dependencies for closesubwin. +function! s:closesubwin.depends() + return [] +endfunction + +" Recommended plugin dependencies for closesubwin. +" If the plugins are not installed, vivacious shows recommended plugins. +function! s:closesubwin.recommends() + return [] +endfunction + +" External commands dependencies for closesubwin. +" (e.g.: curl) +function! s:closesubwin.depends_commands() + return [] +endfunction + +" Recommended external commands dependencies for closesubwin. +" If the plugins are not installed, vivacious shows recommended commands. +function! s:closesubwin.recommends_commands() + return [] +endfunction + + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/dotfiles/.vim/bundleconfig/fugitive.vim b/dotfiles/.vim/bundleconfig/fugitive.vim index 7176b3d6..78667857 100644 --- a/dotfiles/.vim/bundleconfig/fugitive.vim +++ b/dotfiles/.vim/bundleconfig/fugitive.vim @@ -7,6 +7,16 @@ let s:fugitive = vivacious#bundleconfig#new() " Configuration for fugitive. function! s:fugitive.config() + MapAlterCommand gad[d] Git add + MapAlterCommand gam[end] Gcommit -v --amend + MapAlterCommand gch[eckout] Git checkout + MapAlterCommand gco[mmit] Gcommit -v + MapAlterCommand gd[iff] Gdiff + MapAlterCommand gi[t] Git + MapAlterCommand gst[atus] Gstatus + " :help fugitive-revision + MapAlterCommand gsh[ow] Gsplit HEAD^{} + augroup vimrc-fugitive autocmd! autocmd VimEnter * diff --git a/dotfiles/.vim/bundleconfig/gista.vim b/dotfiles/.vim/bundleconfig/gista.vim new file mode 100644 index 00000000..821b94fb --- /dev/null +++ b/dotfiles/.vim/bundleconfig/gista.vim @@ -0,0 +1,38 @@ +scriptencoding utf-8 +let s:save_cpo = &cpo +set cpo&vim + + +let s:gista = vivacious#bundleconfig#new() + +" Configuration for gista. +function! s:gista.config() + let g:gista#command#post#open_browser = 1 +endfunction + +" Plugin dependencies for gista. +function! s:gista.depends() + return [] +endfunction + +" Recommended plugin dependencies for gista. +" If the plugins are not installed, vivacious shows recommended plugins. +function! s:gista.recommends() + return [] +endfunction + +" External commands dependencies for gista. +" (e.g.: curl) +function! s:gista.depends_commands() + return [] +endfunction + +" Recommended external commands dependencies for gista. +" If the plugins are not installed, vivacious shows recommended commands. +function! s:gista.recommends_commands() + return [] +endfunction + + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/dotfiles/.vim/bundleconfig/neocomplete.vim b/dotfiles/.vim/bundleconfig/neocomplete.vim index 89d97c3d..b351053d 100644 --- a/dotfiles/.vim/bundleconfig/neocomplete.vim +++ b/dotfiles/.vim/bundleconfig/neocomplete.vim @@ -13,8 +13,4 @@ function! s:config.config() " Map -expr [i] neocomplete#close_popup() " Map -expr [i] pumvisible() ? neocomplete#close_popup() . "\" : "\" " Map -remap [is] (neocomplete_snippets_expand) - - highlight Pmenu ctermbg=8 guibg=#606060 - highlight PmenuSel ctermbg=1 guifg=#dddd00 guibg=#1f82cd - highlight PmenuSbar ctermbg=0 guibg=#d6d6d6 endfunction diff --git a/dotfiles/.vim/bundleconfig/neosnippet.vim b/dotfiles/.vim/bundleconfig/neosnippet.vim index 42a57398..9dea2b1e 100644 --- a/dotfiles/.vim/bundleconfig/neosnippet.vim +++ b/dotfiles/.vim/bundleconfig/neosnippet.vim @@ -1,10 +1,8 @@ let s:config = vivacious#bundleconfig#new() function! s:config.config() - " SuperTab like snippets' behavior. Map -remap -expr [i] neosnippet#expandable_or_jumpable() ? - \ "\(neosnippet_expand_or_jump)" - \: pumvisible() ? "\" : "\" + \ "\(neosnippet_expand_or_jump)" : "\" Map -remap -expr [s] neosnippet#expandable_or_jumpable() ? \ "\(neosnippet_expand_or_jump)" \: "\" diff --git a/dotfiles/.vim/bundleconfig/operator-camelize.vim b/dotfiles/.vim/bundleconfig/operator-camelize.vim index bd4be637..ee10bf2a 100644 --- a/dotfiles/.vim/bundleconfig/operator-camelize.vim +++ b/dotfiles/.vim/bundleconfig/operator-camelize.vim @@ -5,20 +5,17 @@ function! s:config.config() let g:operator_camelize_all_uppercase_action = 'camelize' let g:operator_decamelize_all_uppercase_action = 'lowercase' - " Test: g:operator_camelize_detect_function " function! Camelized(word) " return 0 " endfunction " let g:operator_camelize_detect_function = 'Camelized' - " E704: Funcref variable name must start with a capital: g:operator_camelize_detect_function " let g:operator_camelize_detect_function = function('Camelized') " Test: mappings " Map -remap [nxo] c (operator-camelize) " Map -remap [nxo] C (operator-decamelize) - " See "keymappings" branch. " Map -remap [nxo] c (operator-camelize/camelize) " Map -remap [nxo] C (operator-decamelize/lowercase) diff --git a/dotfiles/.vim/bundleconfig/previm.vim b/dotfiles/.vim/bundleconfig/previm.vim new file mode 100644 index 00000000..e1e9d806 --- /dev/null +++ b/dotfiles/.vim/bundleconfig/previm.vim @@ -0,0 +1,42 @@ +scriptencoding utf-8 +let s:save_cpo = &cpo +set cpo&vim + + +let s:previm = vivacious#bundleconfig#new() + +" Configuration for previm. +function! s:previm.config() + augroup vimrc-previm + autocmd! + autocmd FileType *{mkd,markdown,rst,textile}* + \ Map -buffer [n] p PrevimOpen + augroup END +endfunction + +" Plugin dependencies for previm. +function! s:previm.depends() + return [] +endfunction + +" Recommended plugin dependencies for previm. +" If the plugins are not installed, vivacious shows recommended plugins. +function! s:previm.recommends() + return [] +endfunction + +" External commands dependencies for previm. +" (e.g.: curl) +function! s:previm.depends_commands() + return [] +endfunction + +" Recommended external commands dependencies for previm. +" If the plugins are not installed, vivacious shows recommended commands. +function! s:previm.recommends_commands() + return [] +endfunction + + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/dotfiles/.vim/bundleconfig/ref.vim b/dotfiles/.vim/bundleconfig/ref.vim index 01c54edd..d48b71f5 100644 --- a/dotfiles/.vim/bundleconfig/ref.vim +++ b/dotfiles/.vim/bundleconfig/ref.vim @@ -12,21 +12,16 @@ function! s:config.config() MapAlterCommand py[doc] Ref pydoc Map [n] K K - " Map -remap [n] K (open-help-window)(ref-keyword) Map -remap [n] K (ref-keyword) - - Map [n] (open-help-window) :call open_help_window() - function! s:open_help_window() - if !s:has_help_window() - Help - wincmd w - endif - endfunction + augroup bundleconfig-ref + autocmd! + autocmd FileType vim Map -buffer [n] K K + augroup END if $VIMRC_USE_VIMPROC !=# 2 let g:ref_use_vimproc = $VIMRC_USE_VIMPROC endif - let g:ref_open = 'SplitNicely split' + let g:ref_open = 'SplitNicely vsplit' if executable('perldocjp') let g:ref_perldoc_cmd = 'perldocjp' endif diff --git a/dotfiles/.vim/bundleconfig/trailing-whitespace.vim b/dotfiles/.vim/bundleconfig/trailing-whitespace.vim index 7e988354..74b73c65 100644 --- a/dotfiles/.vim/bundleconfig/trailing-whitespace.vim +++ b/dotfiles/.vim/bundleconfig/trailing-whitespace.vim @@ -7,8 +7,12 @@ let s:trailingwhitespace = vivacious#bundleconfig#new() " Configuration for trailing-whitespace. function! s:trailingwhitespace.config() - highlight ExtraWhitespace cterm=underline gui=underline ctermfg=4 guifg=Cyan - autocmd ColorScheme * highlight ExtraWhitespace cterm=underline gui=underline ctermfg=4 guifg=Cyan + " TODO: + " * Clear highlight temporarily (':hi clear ExtraWhitespace' is enough?) + " * Overwrite default highlight defined by trailing-whitespace.vim properly. + let hicmd = 'highlight ExtraWhitespace cterm=underline ctermfg=4 gui=underline guifg=Cyan' + execute hicmd + execute 'autocmd ColorScheme *' hicmd endfunction " Plugin dependencies for trailing-whitespace. diff --git a/dotfiles/.vim/bundleconfig/unite.vim b/dotfiles/.vim/bundleconfig/unite.vim index 07a364bd..5e4d0b1b 100644 --- a/dotfiles/.vim/bundleconfig/unite.vim +++ b/dotfiles/.vim/bundleconfig/unite.vim @@ -1,27 +1,27 @@ let s:config = vivacious#bundleconfig#new() function! s:config.config() - DefMacroMap [n] anything s + DefMacroMap [n] unite s DefMacroMap [nxo] prompt ,t MapAlterCommand u[nite] Unite -prompt='-')/\ -no-split -create command! -bar -nargs=* CustomUnite Unite -prompt='-')/\ -no-split -create - Map [n] f :CustomUnite -buffer-name=files file buffer file_mru - Map [n] F :CustomUnite -buffer-name=files file_rec - Map [n] p :CustomUnite -buffer-name=files buffer_tab - Map [n] h :CustomUnite -buffer-name=files file_mru - Map [n] t :CustomUnite -immediately tab:no-current - Map [n] w :CustomUnite -immediately window:no-current - " Map [n] T :CustomUnite tag - " Map [n] H :CustomUnite help - Map [n] b :CustomUnite buffer - " Map [n] o :CustomUnite outline - Map [n] r :CustomUnite -input=ref/ source - Map [n] s :CustomUnite source - Map [n] g :CustomUnite grep - Map [n] / :CustomUnite line - " Map [n] : :CustomUnite history/command - Map [n] j :CustomUnite jump + Map [n] f :CustomUnite -buffer-name=files file buffer file_mru + Map [n] F :CustomUnite -buffer-name=files file_rec + Map [n] p :CustomUnite -buffer-name=files buffer_tab + Map [n] h :CustomUnite -buffer-name=files file_mru + Map [n] t :CustomUnite -immediately tab:no-current + Map [n] w :CustomUnite -immediately window:no-current + " Map [n] T :CustomUnite tag + " Map [n] H :CustomUnite help + Map [n] b :CustomUnite buffer + " Map [n] o :CustomUnite outline + Map [n] r :CustomUnite -input=ref/ source + Map [n] s :CustomUnite source + Map [n] g :CustomUnite grep + Map [n] / :CustomUnite line + " Map [n] : :CustomUnite history/command + Map [n] j :CustomUnite jump " abbrev @@ -57,13 +57,6 @@ function! s:config.config() let g:unite_enable_start_insert = 1 let g:unite_enable_ignore_case = 1 let g:unite_enable_smart_case = 1 - let g:unite_enable_split_vertically = 0 - let g:unite_split_rule = - \ g:unite_enable_split_vertically ? - \ 'topleft' : 'rightbelow' - let g:unite_update_time = 50 - let g:unite_source_file_mru_ignore_pattern = - \ '^/tmp/.*\|^/var/tmp/.*\|\.tmp$\|COMMIT_EDITMSG' " matcher {{{ " if has('migemo') || executable('cmigemo') diff --git a/dotfiles/.vim/bundleconfig/vim-operator-replace.vim b/dotfiles/.vim/bundleconfig/vim-operator-replace.vim new file mode 100644 index 00000000..034efaea --- /dev/null +++ b/dotfiles/.vim/bundleconfig/vim-operator-replace.vim @@ -0,0 +1,38 @@ +scriptencoding utf-8 +let s:save_cpo = &cpo +set cpo&vim + + +let s:vimoperatorreplace = vivacious#bundleconfig#new() + +" Configuration for vim-operator-replace. +function! s:vimoperatorreplace.config() + Map -remap [nxo] r (operator-replace) +endfunction + +" Plugin dependencies for vim-operator-replace. +function! s:vimoperatorreplace.depends() + return [] +endfunction + +" Recommended plugin dependencies for vim-operator-replace. +" If the plugins are not installed, vivacious shows recommended plugins. +function! s:vimoperatorreplace.recommends() + return [] +endfunction + +" External commands dependencies for vim-operator-replace. +" (e.g.: curl) +function! s:vimoperatorreplace.depends_commands() + return [] +endfunction + +" Recommended external commands dependencies for vim-operator-replace. +" If the plugins are not installed, vivacious shows recommended commands. +function! s:vimoperatorreplace.recommends_commands() + return [] +endfunction + + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/dotfiles/.vimrc b/dotfiles/.vimrc index 40190a39..33f40303 100644 --- a/dotfiles/.vimrc +++ b/dotfiles/.vimrc @@ -60,8 +60,8 @@ if $VIMRC_LOAD_MENU set guioptions+=m else set guioptions+=M - let did_install_default_menus = 1 - let did_install_syntax_menu = 1 + let g:did_install_default_menus = 1 + let g:did_install_syntax_menu = 1 endif filetype plugin indent on @@ -261,7 +261,9 @@ Map [n] call vivacious#bundleconfig#load() " TODO: Load only vim-singleton and call it before 'vivacious#load_plugins()'. -call singleton#enable() +if vivacious#loaded_plugin('vim-singleton') + call singleton#enable() +endif " Generate helptags for plugins in 'runtimepath'. call vivacious#helptags() @@ -325,7 +327,7 @@ set mousemodel=popup_setpos " command-line set cmdheight=1 set wildmenu -set wildmode=longest,list +set wildmode=longest,list,full " completion set complete=.,w,b,u,t,i,d,k,kspell @@ -826,19 +828,20 @@ function! s:toggle_option(option_name) "{{{ endif endfunction "}}} -function! s:advance_state(state, elem) "{{{ - let curidx = index(a:state, a:elem) - let curidx = curidx is -1 ? 0 : curidx - return a:state[index(a:state, curidx + 1) isnot -1 ? curidx + 1 : 0] +function! s:advance_state(states, elem) "{{{ + let curidx = index(a:states, a:elem) + let curidx = (curidx is -1 ? 0 : curidx) + let curidx = (curidx + 1 >=# len(a:states) ? 0 : curidx + 1) + return a:states[curidx] endfunction "}}} -function! s:toggle_option_list(state, optname) "{{{ +function! s:toggle_option_list(states, optname) "{{{ let varname = '&' . a:optname call setbufvar( \ '%', \ varname, \ s:advance_state( - \ a:state, + \ a:states, \ getbufvar('%', varname))) execute 'setlocal' a:optname . '?' endfunction "}}} @@ -861,144 +864,11 @@ Map [n] oe :call toggle_option('expandtab') Map [n] ol :call toggle_option('list') Map [n] on :call toggle_option('number') Map [n] om :call toggle_option('modeline') +Map [n] ot :call toggle_option_list([2, 4, 8], 'tabstop') Map [n] ofc :call toggle_option_list(['', 'all'], 'foldclose') Map [n] ofm :call toggle_option_list(['manual', 'marker', 'indent'], 'foldmethod') Map [n] ofw :call toggle_winfix() -" }}} -" Close help/quickfix window {{{ - -" s:window {{{ -let s:window = {'_group_order': [], '_groups': {}} - -function! s:window.register(group_name, functions) "{{{ - call add(s:window._group_order, a:group_name) - let s:window._groups[a:group_name] = a:functions -endfunction "}}} - -function! s:window.get_all_groups() "{{{ - return map(copy(s:window._group_order), - \ 'deepcopy(s:window._groups[v:val])') -endfunction "}}} - - -function! s:window.close(winnr) "{{{ - if winbufnr(a:winnr) !=# -1 - execute a:winnr . 'wincmd w' - execute 'wincmd c' - return 1 - else - return 0 - endif -endfunction "}}} - - -function! s:window.get_winnr_list_like(expr) "{{{ - let ret = [] - for winnr in range(1, winnr('$')) - if eval(a:expr) - call add(ret, winnr) - endif - endfor - return ret -endfunction "}}} - -function! s:window.close_first_like(expr) "{{{ - let winnr_list = s:window.get_winnr_list_like(a:expr) - " Close current window if current matches a:expr. - let winnr_list = s:move_current_winnr_to_head(winnr_list) - if empty(winnr_list) - return - endif - - let prev_winnr = winnr() - try - for winnr in winnr_list - if s:window.close(winnr) - return 1 " closed. - endif - endfor - return 0 - finally - " Back to previous window. - let cur_winnr = winnr() - if cur_winnr !=# prev_winnr && winbufnr(prev_winnr) !=# -1 - execute prev_winnr . 'wincmd w' - endif - endtry -endfunction "}}} - -function! s:move_current_winnr_to_head(winnr_list) "{{{ - let winnr = winnr() - if index(a:winnr_list, winnr) is -1 - return a:winnr_list - endif - return [winnr] + filter(a:winnr_list, 'v:val isnot winnr') -endfunction "}}} - -" }}} - -" help {{{ -function! s:close_help_window() "{{{ - return s:window.close_first_like('s:is_help_window(winnr)') -endfunction "}}} -function! s:is_help_window(winnr) "{{{ - return getbufvar(winbufnr(a:winnr), '&buftype') ==# 'help' -endfunction "}}} - -call s:window.register('help', {'close': function('s:close_help_window'), 'detect': function('s:is_help_window')}) -" }}} - -" quickfix {{{ -function! s:close_quickfix_window() "{{{ - " cclose - return s:window.close_first_like('s:is_quickfix_window(winnr)') -endfunction "}}} -function! s:is_quickfix_window(winnr) "{{{ - return getbufvar(winbufnr(a:winnr), '&buftype') ==# 'quickfix' -endfunction "}}} - -call s:window.register('quickfix', {'close': function('s:close_quickfix_window'), 'detect': function('s:is_quickfix_window')}) -" }}} - -" unlisted {{{ -function! s:close_unlisted_window() "{{{ - return s:window.close_first_like('s:is_unlisted_window(winnr)') -endfunction "}}} -function! s:is_unlisted_window(winnr) "{{{ - return !getbufvar(winbufnr(a:winnr), '&buflisted') -endfunction "}}} - -call s:window.register('unlisted', {'close': function('s:close_unlisted_window'), 'detect': function('s:is_unlisted_window')}) -" }}} - -function! s:close_certain_window() "{{{ - let curwinnr = winnr() - let groups = s:window.get_all_groups() - - " Close current. - for group in groups - if group.detect(curwinnr) - call group.close() - return - endif - endfor - - " Or close outside buffer. - for group in groups - if group.close() - return 1 - endif - endfor -endfunction "}}} - - -Map -silent [n] ch :call close_help_window() -Map -silent [n] cq :call close_quickfix_window() -Map -silent [n] cu :call close_unlisted_window() - -" Close first matching window in above windows. -Map -silent [n] cc :call close_certain_window() " }}} " Back to col '$' when current col is right of col '$'. {{{ " @@ -1082,21 +952,6 @@ function! s:map_lines(str, expr) endfunction -" http://labs.timedia.co.jp/2012/10/vim-more-useful-blockwise-insertion.html -Map -expr [x] I force_blockwise_visual() -Map -expr [x] A force_blockwise_visual() - -function! s:force_blockwise_visual(next_key) - if mode() ==# 'v' - return "\" . a:next_key - elseif mode() ==# 'V' - return "\0o$" . a:next_key - else " mode() ==# "\" - return a:next_key - endif -endfunction - - " Tab key indent " NOTE: is GUI only. Map [x] >gv @@ -1181,10 +1036,6 @@ MapAlterCommand hg helpgrep MapAlterCommand ds diffsplit MapAlterCommand do diffoff! -MapAlterCommand ba breakadd -MapAlterCommand baf breakadd func -MapAlterCommand bah breakadd here - " For typo. MapAlterCommand qw wq " }}} @@ -1200,8 +1051,16 @@ Map [n] ? :setlocal ignorecase hlsearch? Map -script [n] * :setlocal noignorecase hlsearch*(centering-display) Map -script [n] # :setlocal noignorecase hlsearch#(centering-display) -Map [n] : :setlocal hlsearch: -Map [x] : :setlocal hlsearchgv: +" TODO: Won't work +" DefMap -silent [n] pre-: :setlocal hlsearch +" DefMap -silent [x] pre-: :setlocal hlsearchgv +" Map [nx] : : + +Map -silent [n] (pre-:) :setlocal ignorecase hlsearch +Map -silent [x] (pre-:) :setlocal ignorecase hlsearchgv +Map -expr [n] (count) (v:count ==# 0 ? '' : v:count) +Map -script -expr [n] : '(pre-:)' . (v:count ==# 0 ? '' : v:count) . ':' +Map -script [x] : (pre-:)gv: Map -script [n] gd :setlocal hlsearchgd(centering-display) Map -script [n] gD :setlocal hlsearchgD(centering-display) @@ -1338,28 +1197,6 @@ function! s:set_dict() "{{{ let &l:dictionary = join(s:List.uniq(dicts), ',') endfunction "}}} -function! s:is_current_filetype(filetypes) "{{{ - if type(a:filetypes) isnot type([]) - return s:is_current_filetype([a:filetypes]) - endif - let filetypes = copy(a:filetypes) - for ft in s:current_filetypes() - if !empty(filter(filetypes, 'v:val ==# ft')) - return 1 - endif - endfor - return 0 -endfunction "}}} -function! s:set_tab_width() "{{{ - if s:is_current_filetype( - \ ['css', 'xml', 'html', 'smarty', 'htmldjango', - \ 'lisp', 'scheme', 'yaml', 'python', 'markdown'] - \) - setlocal tabstop=2 - else - setlocal tabstop=4 - endif -endfunction "}}} function! s:set_compiler() "{{{ let filetype_vs_compiler = { \ 'c': 'gcc', @@ -1384,7 +1221,6 @@ function! s:load_filetype() "{{{ endif call s:set_dict() - call s:set_tab_width() call s:set_compiler() endfunction "}}} @@ -1409,6 +1245,11 @@ VimrcAutocmd BufNewFile,BufRead *.avs setlocal syntax=avs command! -bar DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis \ | wincmd p | diffthis " }}} +" :Pwd - Copy working dir to clipboard {{{ +MapAlterCommand pwd Pwd + +command! -bar -nargs=0 Pwd pwd | let [@+, @*] = [getcwd(), getcwd()] +" }}} " :EchoPath - Show path-like option in a readable way {{{ MapAlterCommand epa EchoPath @@ -1527,6 +1368,10 @@ command! \ -bang -nargs=* -complete=help \ Help \ SplitNicely help + +" FIXME: "K" uses ":help" ('keywordprg') by default +" TODO: Create a framework plugin which provides a customization for ":help" ? + " }}} " :NonSortUniq {{{ " @@ -1571,7 +1416,7 @@ augroup watch-autocmd autocmd! augroup END -command! -bar -nargs=1 -complete=event WatchAutocmd +command! -bar -bang -nargs=1 -complete=event WatchAutocmd \ call s:cmd_{0 ? "un" : ""}watch_autocmd() @@ -1600,10 +1445,11 @@ function! s:cmd_watch_autocmd(event) return endif - execute 'autocmd watch-autocmd' a:event - \ '* call s:echomsg("Executing '.string(a:event).' event...")' + execute 'autocmd watch-autocmd' a:event '*' + \ 'call s:echomsg("MoreMsg", ' + \ '"Executing '.string(a:event).' event...")' let s:watching_events[a:event] = 1 - echomsg 'Added watch for '.a:event.' event.' + echomsg 'Added watch for' a:event 'event.' endfunction " }}} " :Kwbd {{{ @@ -1644,10 +1490,10 @@ function! s:scrollbind_specific_mappings(enable) if a:enable " Check either buffer-local those mappings are mapped already or not. if get(maparg('', 'n', 0, 1), 'buffer', 0) - nnoremap :call no_scrollbind('') + Map -buffer [n] :call no_scrollbind('') endif if get(maparg('', 'n', 0, 1), 'buffer', 0) - nnoremap :call no_scrollbind('') + Map -buffer [n] :call no_scrollbind('') endif else " Check either those mappings are above one or not. @@ -1697,7 +1543,7 @@ VimrcAutocmd QuickfixCmdPost [^l]* copen let g:vim_indent_cont = 0 " }}} " changelog.vim {{{ - let changelog_username = "tyru" + let g:changelog_username = "tyru" " }}} " syntax/sh.vim {{{ let g:is_bash = 1 @@ -1745,39 +1591,6 @@ call s:delete_backup() " }}} " Misc. (bundled with kaoriya vim's .vimrc & etc.) {{{ -" Checking typo. {{{ -VimrcAutocmd BufWriteCmd *[,*] call s:write_check_typo(expand('')) -function! s:write_check_typo(file) - let writecmd = 'write'.(v:cmdbang ? '!' : '').' '.a:file - if exists('b:write_check_typo_nocheck') - execute writecmd - return - endif - let prompt = "possible typo: really want to write to '" . a:file . "'?(y/n):" - let input = input(prompt) - if input ==# 'YES' - execute writecmd - let b:write_check_typo_nocheck = 1 - elseif input =~? '^y\(es\)\=$' - execute writecmd - endif -endfunction -" }}} - -" Jump to the last known cursor position {{{ -" This setting was from $VIM/vimrc_example.vim - -" When editing a file, always jump to the last known cursor position. -" Don't do it when the position is invalid or when inside an event handler -" (happens when dropping a file on gvim). -" Also don't do it when the mark is in the first line, that is the default -" position when opening a file. -VimrcAutocmd BufReadPost * -\ if line("'\"") > 1 && line("'\"") <= line("$") | -\ exe "normal! g`\"" | -\ endif -" }}} - " About japanese input method {{{ if has('multi_byte_ime') || has('xim') " Cursor color when IME is on. @@ -1788,30 +1601,23 @@ endif " Make same as ordinal applications on MS Windows {{{ if has('gui_running') && s:is_win - nnoremap :simalt ~ + Map [n] :simalt ~ endif " }}} -" Use meta keys in console {{{ -if has('unix') && !has('gui_running') - " Use meta keys in console. - function! s:use_meta_keys() " {{{ - for i in map( - \ range(char2nr('a'), char2nr('z')) - \ + range(char2nr('A'), char2nr('Z')) - \ + range(char2nr('0'), char2nr('9')) - \ , 'nr2char(v:val)') - " O do not map because used by arrow keys. - if i != 'O' - execute 'nmap ' . i '' - endif - endfor - endfunction " }}} +" Exit diff mode automatically {{{ +" https://hail2u.net/blog/software/vim-turn-off-diff-mode-automatically.html - call s:use_meta_keys() - map - map! -endif +augroup vimrc-diff-autocommands + autocmd! + + " Turn off diff mode automatically + autocmd WinEnter * + \ if (winnr('$') == 1) && + \ (getbufvar(winbufnr(0), '&diff')) == 1 | + \ diffoff | + \ endif +augroup END " }}} " }}}