Skip to content

Commit

Permalink
Update vim config
Browse files Browse the repository at this point in the history
  • Loading branch information
tyru committed Jan 10, 2016
1 parent 767fca5 commit 612deab
Show file tree
Hide file tree
Showing 6 changed files with 232 additions and 604 deletions.
3 changes: 2 additions & 1 deletion dotfiles/.vim/Vivacious.lock
Expand Up @@ -24,7 +24,6 @@ active:1 version:8312733b08330191358af14832d9959f19739eda dir:bundle/open-browse
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:8ec90adc65257115227e8e724a7509efd920b3f6 dir:bundle/quickey.vim name:quickey.vim remote:origin type:git url:https://github.com/tyru/quickey.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:05e040cfdd003c367b2351dada21d0517149f20f dir:bundle/transbuffer.vim name:transbuffer.vim remote:origin type:git url:https://github.com/tyru/transbuffer.vim branch:master
Expand Down Expand Up @@ -71,3 +70,5 @@ active:1 version:ba9ce13a5c9910d58f8be03d90a07da7fafe7166 dir:bundle/vital.vim n
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: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
66 changes: 10 additions & 56 deletions dotfiles/.vim/bundleconfig/operator-user.vim
Expand Up @@ -2,47 +2,28 @@
let s:config = vivacious#bundleconfig#new()

function! s:config.config()
" operator-adjust {{{
call operator#user#define('adjust', 'Op_adjust_window_height')
function! Op_adjust_window_height(motion_wiseness)
execute (line("']") - line("'[") + 1) 'wincmd _'
normal! `[zt
endfunction

Map -remap [nxo] <operator>adj <Plug>(operator-adjust)
" }}}


" operator-sort {{{
" operator-sort
call operator#user#define_ex_command('sort', 'sort')
Map -remap [nxo] <operator>s <Plug>(operator-sort)
" }}}

" operator-retab {{{
" operator-retab
call operator#user#define_ex_command('retab', 'retab')
Map -remap [nxo] <operator>t <Plug>(operator-retab)
" }}}

" operator-join {{{
" operator-join
call operator#user#define_ex_command('join', 'join')
Map -remap [nxo] <operator>j <Plug>(operator-join)
" }}}

" operator-uniq {{{
" operator-uniq
call operator#user#define_ex_command('uniq', 'sort u')
Map -remap [nxo] <operator>u <Plug>(operator-uniq)
" }}}

" operator-narrow {{{
call operator#user#define_ex_command('narrow', 'Narrow')

Map -remap [nxo] <operator>na <Plug>(operator-narrow)
Map [nxo] <operator>nw :<C-u>Widen<CR>

let g:narrow_allow_overridingp = 1
" }}}
" operator-blank-killer
call operator#user#define_ex_command('blank-killer', 's/\s\+$//')
Map -remap [nxo] <operator>bk <Plug>(operator-blank-killer)

" operator-zen2han, operator-han2zen {{{
" TODO: operator-zen2han, operator-han2zen
if 0
call operator#user#define('zen2han', 'Op_zen2han')
function! Op_zen2han(motion_wiseness)
" TODO
Expand All @@ -55,32 +36,5 @@ function! s:config.config()

Map -remap [nxo] <operator>zh <Plug>(operator-zen2han)
Map -remap [nxo] <operator>hz <Plug>(operator-han2zen)
" }}}

" operator-blank-killer {{{
call operator#user#define_ex_command('blank-killer', 's/\s\+$//')
Map -remap [nxo] <operator>bk <Plug>(operator-blank-killer)
" }}}

" operator-fillblank {{{
" from daisuzu .vimrc:
" http://vim-jp.org/reading-vimrc/archive/023.html
" http://lingr.com/room/vim/archives/2012/12/08#message-13176343
" https://raw.github.com/daisuzu/dotvim/master/.vimrc

function! OperatorFillBlank(motion_wise)
let v = operator#user#visual_command_from_wise_name(a:motion_wise)
execute 'normal! `['.v.'`]"xy'
let text = getreg('x', 1)
let text = s:map_lines(text,
\ 'substitute(v:val, ".", "\\=s:charwidthwise_r(submatch(0))", "g")')
call setreg('x', text, v)
normal! gv"xp
endfunction
function! s:charwidthwise_r(char)
return repeat(' ', exists('*strwidth') ? strwidth(a:char) : 1)
endfunction
call operator#user#define('fillblank', 'OperatorFillBlank')
Map -remap [nxo] <operator><Space> <Plug>(operator-fillblank)
" }}}
endif
endfunction
40 changes: 40 additions & 0 deletions dotfiles/.vim/bundleconfig/textobj-entire.vim
@@ -0,0 +1,40 @@
scriptencoding utf-8
let s:save_cpo = &cpo
set cpo&vim


let s:textobjentire = vivacious#bundleconfig#new()

" Configuration for textobj-entire.
function! s:textobjentire.config()
let g:textobj_entire_no_default_key_mappings = 1
Map -remap [xo] i@ <Plug>(textobj-entire-i)
Map -remap [xo] a@ <Plug>(textobj-entire-a)
endfunction

" Plugin dependencies for textobj-entire.
function! s:textobjentire.depends()
return []
endfunction

" Recommended plugin dependencies for textobj-entire.
" If the plugins are not installed, vivacious shows recommended plugins.
function! s:textobjentire.recommends()
return []
endfunction

" External commands dependencies for textobj-entire.
" (e.g.: curl)
function! s:textobjentire.depends_commands()
return []
endfunction

" Recommended external commands dependencies for textobj-entire.
" If the plugins are not installed, vivacious shows recommended commands.
function! s:textobjentire.recommends_commands()
return []
endfunction


let &cpo = s:save_cpo
unlet s:save_cpo
39 changes: 39 additions & 0 deletions dotfiles/.vim/bundleconfig/trailing-whitespace.vim
@@ -0,0 +1,39 @@
scriptencoding utf-8
let s:save_cpo = &cpo
set cpo&vim


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
endfunction

" Plugin dependencies for trailing-whitespace.
function! s:trailingwhitespace.depends()
return []
endfunction

" Recommended plugin dependencies for trailing-whitespace.
" If the plugins are not installed, vivacious shows recommended plugins.
function! s:trailingwhitespace.recommends()
return []
endfunction

" External commands dependencies for trailing-whitespace.
" (e.g.: curl)
function! s:trailingwhitespace.depends_commands()
return []
endfunction

" Recommended external commands dependencies for trailing-whitespace.
" If the plugins are not installed, vivacious shows recommended commands.
function! s:trailingwhitespace.recommends_commands()
return []
endfunction


let &cpo = s:save_cpo
unlet s:save_cpo
1 change: 1 addition & 0 deletions dotfiles/.vim/bundleconfig/unite.vim
Expand Up @@ -2,6 +2,7 @@ let s:config = vivacious#bundleconfig#new()

function! s:config.config()
DefMacroMap [n] anything s
DefMacroMap [nxo] prompt ,t

MapAlterCommand u[nite] Unite -prompt='-')/\ -no-split -create <args>
command! -bar -nargs=* CustomUnite Unite -prompt='-')/\ -no-split -create <args>
Expand Down

0 comments on commit 612deab

Please sign in to comment.