Skip to content

Commit

Permalink
modification of default mapping options
Browse files Browse the repository at this point in the history
  • Loading branch information
sk1418 committed Oct 29, 2013
1 parent dff31ee commit bceeaff
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 31 deletions.
1 change: 0 additions & 1 deletion autoload/HowMuch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ if exists("g:loaded_HowMuch")
endif
let g:loaded_HowMuch = 1

let g:HowMuch_debug =1
"//////////////////////////////////////////////////////////////////////
" Variables /
"//////////////////////////////////////////////////////////////////////
Expand Down
77 changes: 47 additions & 30 deletions plugin/HowMuch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -22,133 +22,150 @@
" }}}

"<Plug> mappings for auto engine
"{{{
vnoremap <silent><unique> <Plug>AutoCalcReplace :call HowMuch#HowMuch(0,0,0,'auto')<cr>
vnoremap <silent><unique> <Plug>AutoCalcReplaceWithSum :call HowMuch#HowMuch(0,0,1,'auto')<cr>
vnoremap <silent><unique> <Plug>AutoCalcAppend :call HowMuch#HowMuch(1,0,0,'auto')<cr>
vnoremap <silent><unique> <Plug>AutoCalcAppendWithEq :call HowMuch#HowMuch(1,1,0,'auto')<cr>
vnoremap <silent><unique> <Plug>AutoCalcAppendWithSum :call HowMuch#HowMuch(1,0,1,'auto')<cr>
vnoremap <silent><unique> <Plug>AutoCalcAppendWithEqAndSum :call HowMuch#HowMuch(1,1,1,'auto')<cr>
"}}}

"<Plug> mappings for bc engine
"{{{
vnoremap <silent><unique> <Plug>BcCalcReplace :call HowMuch#HowMuch(0,0,0,'bc')<cr>
vnoremap <silent><unique> <Plug>BcCalcReplaceWithSum :call HowMuch#HowMuch(0,0,1,'bc')<cr>
vnoremap <silent><unique> <Plug>BcCalcAppend :call HowMuch#HowMuch(1,0,0,'bc')<cr>
vnoremap <silent><unique> <Plug>BcCalcAppendWithEq :call HowMuch#HowMuch(1,1,0,'bc')<cr>
vnoremap <silent><unique> <Plug>BcCalcAppendWithSum :call HowMuch#HowMuch(1,0,1,'bc')<cr>
vnoremap <silent><unique> <Plug>BcCalcAppendWithEqAndSum :call HowMuch#HowMuch(1,1,1,'bc')<cr>
"}}}

"<Plug> mappings for vim engine
"{{{
vnoremap <silent><unique> <Plug>VimCalcReplace :call HowMuch#HowMuch(0,0,0,'vim')<cr>
vnoremap <silent><unique> <Plug>VimCalcReplaceWithSum :call HowMuch#HowMuch(0,0,1,'vim')<cr>
vnoremap <silent><unique> <Plug>VimCalcAppend :call HowMuch#HowMuch(1,0,0,'vim')<cr>
vnoremap <silent><unique> <Plug>VimCalcAppendWithEq :call HowMuch#HowMuch(1,1,0,'vim')<cr>
vnoremap <silent><unique> <Plug>VimCalcAppendWithSum :call HowMuch#HowMuch(1,0,1,'vim')<cr>
vnoremap <silent><unique> <Plug>VimCalcAppendWithEqAndSum :call HowMuch#HowMuch(1,1,1,'vim')<cr>
"}}}

"<Plug> mappings for python engine
"{{{
vnoremap <silent><unique> <Plug>PyCalcReplace :call HowMuch#HowMuch(0,0,0,'py')<cr>
vnoremap <silent><unique> <Plug>PyCalcReplaceWithSum :call HowMuch#HowMuch(0,0,1,'py')<cr>
vnoremap <silent><unique> <Plug>PyCalcAppend :call HowMuch#HowMuch(1,0,0,'py')<cr>
vnoremap <silent><unique> <Plug>PyCalcAppendWithEq :call HowMuch#HowMuch(1,1,0,'py')<cr>
vnoremap <silent><unique> <Plug>PyCalcAppendWithSum :call HowMuch#HowMuch(1,0,1,'py')<cr>
vnoremap <silent><unique> <Plug>PyCalcAppendWithEqAndSum :call HowMuch#HowMuch(1,1,1,'py')<cr>
"}}}

"===========================================================


"default mappings for auto
"{{{
if !hasmapto('<Plug>AutoCalcReplace','v')
vmap <silent><unique> <leader>?r <Plug>AutoCalcReplace
vmap <leader>?r <Plug>AutoCalcReplace
endif
if !hasmapto('<Plug>AutoCalcReplaceWithSum','v')
vmap <silent><unique> <leader>?rs <Plug>AutoCalcReplaceWithSum
vmap <leader>?rs <Plug>AutoCalcReplaceWithSum
endif
if !hasmapto('<Plug>AutoCalcAppend','v')
vmap <silent><unique> <leader>? <Plug>AutoCalcAppend
vmap <leader>? <Plug>AutoCalcAppend
endif

if !hasmapto('<Plug>AutoCalcAppendWithEq','v')
vmap <silent><unique> <leader>?= <Plug>AutoCalcAppendWithEq
vmap <leader>?= <Plug>AutoCalcAppendWithEq
endif

if !hasmapto('<Plug>AutoCalcAppendWithSum','v')
vmap <silent><unique> <leader>?s <Plug>AutoCalcAppendWithSum
vmap <leader>?s <Plug>AutoCalcAppendWithSum
endif

if !hasmapto('<Plug>AutoCalcAppendWithEqAndSum','v')
vmap <silent><unique> <leader>?=s <Plug>AutoCalcAppendWithEqAndSum
endif
vmap <leader>?=s <Plug>AutoCalcAppendWithEqAndSum
endif"}}}

"default mappings for bc
"{{{
if !hasmapto('<Plug>BcCalcReplace','v')
vmap <silent><unique> <leader>b?r <Plug>BcCalcReplace
vmap <leader>b?r <Plug>BcCalcReplace
endif

if !hasmapto('<Plug>BcCalcReplaceWithSum','v')
vmap <silent><unique> <leader>b?rs <Plug>BcCalcReplaceWithSum
vmap <leader>b?rs <Plug>BcCalcReplaceWithSum
endif

if !hasmapto('<Plug>BcCalcAppend','v')
vmap <silent><unique> <leader>b? <Plug>BcCalcAppend
vmap <leader>b? <Plug>BcCalcAppend
endif

if !hasmapto('<Plug>BcCalcAppendWithEq','v')
vmap <silent><unique> <leader>b?= <Plug>BcCalcAppendWithEq
vmap <leader>b?= <Plug>BcCalcAppendWithEq
endif

if !hasmapto('<Plug>BcCalcAppendWithSum','v')
vmap <silent><unique> <leader>b?s <Plug>BcCalcAppendWithSum
vmap <leader>b?s <Plug>BcCalcAppendWithSum
endif

if !hasmapto('<Plug>BcCalcAppendWithEqAndSum','v')
vmap <silent><unique> <leader>b?=s <Plug>BcCalcAppendWithEqAndSum
endif
vmap <leader>b?=s <Plug>BcCalcAppendWithEqAndSum
endif"}}}

"default mappings for vim
"{{{
if !hasmapto('<Plug>VimCalcReplace','v')
vmap <silent><unique> <leader>v?r <Plug>VimCalcReplace
vmap <leader>v?r <Plug>VimCalcReplace
endif

if !hasmapto('<Plug>VimCalcReplaceWithSum','v')
vmap <silent><unique> <leader>v?rs <Plug>VimCalcReplaceWithSum
vmap <leader>v?rs <Plug>VimCalcReplaceWithSum
endif

if !hasmapto('<Plug>VimCalcAppend','v')
vmap <silent><unique> <leader>v? <Plug>VimCalcAppend
vmap <leader>v? <Plug>VimCalcAppend
endif

if !hasmapto('<Plug>VimCalcAppendWithEq','v')
vmap <silent><unique> <leader>v?= <Plug>VimCalcAppendWithEq
vmap <leader>v?= <Plug>VimCalcAppendWithEq
endif

if !hasmapto('<Plug>VimCalcAppendWithSum','v')
vmap <silent><unique> <leader>v?s <Plug>VimCalcAppendWithSum
vmap <leader>v?s <Plug>VimCalcAppendWithSum
endif

if !hasmapto('<Plug>VimCalcAppendWithEqAndSum','v')
vmap <silent><unique> <leader>v?=s <Plug>VimCalcAppendWithEqAndSum
vmap <leader>v?=s <Plug>VimCalcAppendWithEqAndSum
endif

"py default mappings
"}}}

"default mappings for python
"{{{
if !hasmapto('<Plug>PyCalcReplace','v')
vmap <silent><unique> <leader>p?r <Plug>PyCalcReplace
vmap <leader>p?r <Plug>PyCalcReplace
endif

if !hasmapto('<Plug>PyCalcReplaceWithSum','v')
vmap <silent><unique> <leader>p?rs <Plug>PyCalcReplaceWithSum
vmap <leader>p?rs <Plug>PyCalcReplaceWithSum
endif

if !hasmapto('<Plug>PyCalcAppend','v')
vmap <silent><unique> <leader>p? <Plug>PyCalcAppend
vmap <leader>p? <Plug>PyCalcAppend
endif

if !hasmapto('<Plug>PyCalcAppendWithEq','v')
vmap <silent><unique> <leader>p?= <Plug>PyCalcAppendWithEq
vmap <leader>p?= <Plug>PyCalcAppendWithEq
endif

if !hasmapto('<Plug>PyCalcAppendWithSum','v')
vmap <silent><unique> <leader>p?s <Plug>PyCalcAppendWithSum
vmap <leader>p?s <Plug>PyCalcAppendWithSum
endif

if !hasmapto('<Plug>PyCalcAppendWithEqAndSum','v')
vmap <silent><unique> <leader>p?=s <Plug>PyCalcAppendWithEqAndSum
vmap <leader>p?=s <Plug>PyCalcAppendWithEqAndSum
endif
"}}}

" vim: ts=2:sw=2:tw=78:fdm=marker:expandtab

0 comments on commit bceeaff

Please sign in to comment.