Skip to content

Latest commit

 

History

History
185 lines (173 loc) · 6.63 KB

File metadata and controls

185 lines (173 loc) · 6.63 KB

" ### Mappings ### " Quick tip " [nivsxco][re|nore|un]map[!] command; with ! makes insert mode, w/o is normal mode

" ### Allish Modes ###

map  / <Plug>(easymotion-sn)
map  N <Plug>(easymotion-prev)
map  n <Plug>(easymotion-next)
map <Leader>h <Plug>(easymotion-linebackward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>l <Plug>(easymotion-lineforward)

" ### Insertish Modes ###

" Buffers
    nnoremap ,b <ESC>:CommandTBuff
    nnoremap ,m <ESC>:bnext<CR>      " Seem odd?  Try it!
    nnoremap ,n <ESC>:bprevious<CR>  " Don't think about it, just do it!
" Comments
    inoremap ,* 
    inoremap ,/
    inoremap ,cc  * ******************************************************************************/<ESC>2ba
    inoremap ,ci // 
    inoremap ,co /*********************************************************************************<cr>
" Definition lists
    inoremap ,dd <dd><cr>XXX<cr></dd><ESC>?xxx
    inoremap ,dl <dl><cr><dt><cr>XXX<cr></dt><cr><dd><cr>XXX<cr></dd><cr></dl><ESC>7k/xxx
    inoremap ,dt <dt><cr>XXX<cr></dt><ESC>?xxx
" Meteor Events
    inoremap ,ec 'XXX .XXX': function () {<cr>},<cr>2k0/xxx
    inoremap ,ei 'XXX #XXX': function () {<cr>},<cr>2k0/xxx
    inoremap ,ev 'XXX XXX': function () {<cr>},<cr>2k0/xxx
    inoremap ,fa function () {<cr>}<ESC>O
    inoremap ,fa function XXX () {<cr>}<ESC>O
" Headings
    inoremap ,h1 <h1>XXX</h1><ESC>?xxx
    inoremap ,h2 <h2>XXX</h2><ESC>?xxx
    inoremap ,h3 <h3>XXX</h3><ESC>?xxx
    inoremap ,h4 <h4>XXX</h4><ESC>?xxx
    inoremap ,h5 <h5>XXX</h5><ESC>?xxx
    inoremap ,h6 <h6>XXX</h6><ESC>?xxx
" List items
    inoremap ,li <li><cr>XXX<cr></li><ESC>?xxx
    inoremap ,ol <ol><cr><li><cr>XXX<cr></li><cr></ol><ESC>?xxx
" ECMA Objects
    inoremap ,om xxx: function () {<cr>},<ESC>k0/xxx
    inoremap ,oo xxx: {<cr>},<ESC>k0/xxx
    inoremap ,op xxx: XXX,<ESC>0/xxx
" Spacebars
    inoremap ,sbea  {{#each XXX}}<cr>{{/if}}<esc>0k/xxx
    inoremap ,sbif  {{#if XXX}}<cr>{{/if}}<esc>0k/xxx
    inoremap ,sbife {{#if XXX}}<cr>{{else}}<cr>{{/if}}<esc>0kk/xxx
    inoremap ,sbun  {{#unless XXX}}<cr>{{/unless}}<esc>0k/xxx
    inoremap ,sbune {{#unless XXX}}<cr>{{else}}<cr>{{/unless}}<esc>0kk/xxx
" Tabs
    inoremap ,M <ESC>:tabnext<CR>    " Again, seems odd.  Try it.
    inoremap ,N <ESC>:tprevious<CR>
    inoremap ,t <ESC>:tabnew<CR>         
    inoremap ,t <ESC>:tabnew<CR>
    inoremap ,tR <ESC>:TabooReset<CR>
    inoremap ,to <ESC>:TabooOpen<CR>
    inoremap ,tr <ESC>:TabooRename<CR>
" Tern
    inoremap ,tD <ESC>:TernDoc<CR>
    inoremap ,tR <ESC>:TernRename<CR>
    inoremap ,tT <ESC>:TernType<CR>
    inoremap ,tb <ESC>:TagbarToggle<CR>
    inoremap ,td <ESC>:TernDef<CR>
    inoremap ,tn <Esc>:tabnext<CR>
    inoremap ,tp <Esc>:tabprev<CR>
    inoremap ,tr <ESC>:TernRefs<CR>
" Underscore
    inoremap ,ue _.each(XXX, function (value, key) {<cr>XXX<cr>}<esc>0kk/xxx
" Unordered list
    inoremap ,ul <ul><cr><li><cr>XXX<cr></li><cr></ul><ESC>?xxx
" Window manager
    inoremap ,wm1 <ESC>:FirstExplorerWindow<CR>  
    inoremap ,wm2 <ESC>:BottomExplorerWindow<CR>
    inoremap ,wmt <ESC>:WMToggle<CR>           
" That one thing
    inoremap <C-c> <CR><Esc>O
" That other thing
    inoremap <expr> <CR> BreakLine() ? "<CR><ESC>O" : "<CR>"

" ### Normalish Modes ###

" Buffers
    nnoremap ,b :CommandTBuff
    nnoremap ,m :bnext<CR>      " Seem odd?  Try it!
    nnoremap ,n :bprevious<CR>  " Don't think about it, just do it!
" Editing & Misc
    nnoremap ,fc gg=G
    nnoremap ,s :set spell!<CR>
    nnoremap ,zz :set &scrolloff=999-&scrolloff=2<CR>
    nnoremap <S-Down> ddp
    nnoremap <S-Up> ddkP
    nnoremap gV `[v`]
" Files
    noremap ,W :w !sudo tee % > /dev/null
    nnoremap ,e :CommandT<CR>
" Git
    nnoremap ,ga :Git add %:p<CR><CR>
    nnoremap ,gb :Git branch<Space>
    nnoremap ,gc :Gcommit -v -q<CR>
    nnoremap ,gd :Gdiff<CR>
    nnoremap ,ge :Gedit<CR>
    nnoremap ,gg :GitGutterLineHighlightsToggle<CR>
    nnoremap ,gl :silent! Glog<CR>:bot copen<CR>
    nnoremap ,gm :Gmove<Space>
    nnoremap ,go :Git checkout<Space>
    nnoremap ,gp :Ggrep<Space>
    nnoremap ,gpl :Dispatch! git pull<CR>
    nnoremap ,gpom :Gpush origin master<CR>
    nnoremap ,gps :Dispatch! git push<CR>
    nnoremap ,gr :Gread<CR>
    nnoremap ,gs :Gstatus<CR>
    nnoremap ,gt :Gcommit -v -q %:p<CR>
    nnoremap ,gw :Gwrite<CR><CR>
" Locations
    nnoremap ,lc :lclose<CR>
    nnoremap ,ln :lnext<CR>
    nnoremap ,lo :lopen<CR>
    nnoremap ,lp :lprevious<CR>
    nnoremap ,lw :lwindow<CR>
" Navigation
    nnoremap ,h <C-W>h
    nnoremap ,j <C-W>j
    nnoremap ,k <C-W>k
    nnoremap ,l <C-W>l
" Plugins
    nnoremap ,pc :NeoBundleClean<CR>
    nnoremap ,pi :NeoBundleInstall %:p<CR>
    nnoremap ,pi! :NeoBundleInstall! %:p<CR>
    nnoremap ,pl :NeoBundleList<CR>
    nnoremap ,ps :NeoBundleSearch %:p<CR>
    nnoremap ,pu :NeoBundleUpdate<CR>
" Sessions
    nnoremap ,sc :SessionClose<CR>
    nnoremap ,sd :SessionDelete<CR>
    nnoremap ,se :SessionEdit<CR>
    nnoremap ,sl :SessionList<CR>
    nnoremap ,so :SessionOpen<CR>
    nnoremap ,ss :SessionSave<CR>
    nnoremap ,ssa :SessionSaveAs<CR>
    nnoremap ,ssl :SessionShowList<CR>
" Syntax
    nnoremap ,jd <Plug>(jsdoc)
    nnoremap ,jf :JscsFix<CR>
    nnoremap ,tD :TernDoc<CR>
    nnoremap ,tR :TernRename<CR>
    nnoremap ,tT :TernType<CR>
    nnoremap ,tb :TagbarToggle<CR>
    nnoremap ,td :TernDef<CR>
    nnoremap ,tr :TernRefs<CR>
" Tabs
    nnoremap ,M :tabnext<CR>    " Again, seems odd.  Try it.
    nnoremap ,N :tprevious<CR>
    nnoremap ,t :tabnew<CR>         
    nnoremap ,to :TabooOpen<CR>
    nnoremap ,tr :TabooRename<CR>
    nnoremap ,tR :TabooReset<CR>
" Windows
    nnoremap ,ut :UndotreeToggle<CR>
    nnoremap ,wm1 :FirstExplorerWindow<cr>
    nnoremap ,wm2 :BottomExplorerWindow<cr>
    nnoremap ,wmt :WMToggle<cr>           
    nnoremap ,f :E<cr> 

" ### Selectish Modes ###

" Intuitive pasters
    vmap <S-Down> xp`[V`]
    vmap <S-Up> xkP`[V`]
" Reselect visual block after indentation change
    vnoremap < <gv
    vnoremap > >gv

" ### Special Modes ###

omap / <Plug>(easymotion-tn)

" ### END ###