mirror of
https://github.com/prurigro/darkcloud-vimconfig.git
synced 2024-11-26 00:01:27 -05:00
added key mappings to up/down to do the same as j/k do with the move
plugin, and added mappings for left/right/h/l to move a half page at a time
This commit is contained in:
parent
faad00240f
commit
eb6cfb028c
1 changed files with 199 additions and 171 deletions
|
@ -32,8 +32,10 @@
|
||||||
"
|
"
|
||||||
" Mappings:
|
" Mappings:
|
||||||
" (mouse)
|
" (mouse)
|
||||||
" <Ctrl-ScrollUp> | (A) -> scroll right
|
" <Ctrl-ScrollUp> | (A) -> scroll right a few characters at a time
|
||||||
" <Ctrl-ScrollDown> | (A) -> scroll left
|
" <Ctrl-ScrollDown> | (A) -> scroll left a few characters at a time
|
||||||
|
" <Alt-ScrollUp> | (A) -> scroll right one character at a time
|
||||||
|
" <Alt-ScrollDown> | (A) -> scroll left one character at a time
|
||||||
" <Shift-MiddleClick> | (A) -> unbind this from vim so xorg can paste
|
" <Shift-MiddleClick> | (A) -> unbind this from vim so xorg can paste
|
||||||
"
|
"
|
||||||
" (tabs)
|
" (tabs)
|
||||||
|
@ -101,6 +103,20 @@
|
||||||
" <Shift-Right> | (N) -> move a few lines right
|
" <Shift-Right> | (N) -> move a few lines right
|
||||||
" <Shift-Left> | (N) -> move a few lines left
|
" <Shift-Left> | (N) -> move a few lines left
|
||||||
"
|
"
|
||||||
|
" <Alt+Up> | (V) -> move a block up one line
|
||||||
|
" <Alt+Down> | (V) -> move a block down one line
|
||||||
|
" <Alt+Up> | (N) -> move a line up one line
|
||||||
|
" <Alt+Down> | (N) -> move a line down one line
|
||||||
|
"
|
||||||
|
" <Alt+Left> | (V) -> move a block up a half page
|
||||||
|
" <Alt+Right> | (V) -> move a block down a half page
|
||||||
|
" <Alt+Left> | (N) -> move a line up a half page
|
||||||
|
" <Alt+Right> | (N) -> move a line down a half page
|
||||||
|
" <Alt+h> | (V) -> move a block up a half page
|
||||||
|
" <Alt+l> | (V) -> move a block down a half page
|
||||||
|
" <Alt+h> | (N) -> move a line up a half page
|
||||||
|
" <Alt+l> | (N) -> move a line down a half page
|
||||||
|
"
|
||||||
" (selection)
|
" (selection)
|
||||||
" <Ctrl-a> | (N) -> select all text
|
" <Ctrl-a> | (N) -> select all text
|
||||||
" <Leader>a | (N) -> select all text
|
" <Leader>a | (N) -> select all text
|
||||||
|
@ -181,218 +197,240 @@
|
||||||
|
|
||||||
"MAPPINGS: GENERAL KEYBINDINGS AND REBINDINGS {{{
|
"MAPPINGS: GENERAL KEYBINDINGS AND REBINDINGS {{{
|
||||||
"MOUSE:{
|
"MOUSE:{
|
||||||
"hold shift to enable middle-click paste
|
"hold shift to enable middle-click paste
|
||||||
noremap <S-Insert> <MiddleMouse>
|
noremap <S-Insert> <MiddleMouse>
|
||||||
noremap! <S-Insert> <MiddleMouse>
|
noremap! <S-Insert> <MiddleMouse>
|
||||||
|
|
||||||
"hold ctrl to scroll left/right instead of up/down
|
"hold ctrl to scroll left/right instead of up/down
|
||||||
noremap <C-ScrollWheelUp> 3zl
|
noremap <C-ScrollWheelUp> 4zl
|
||||||
noremap <C-ScrollWheelDown> 3zh
|
noremap <C-ScrollWheelDown> 4zh
|
||||||
inoremap <C-ScrollWheelUp> <C-O>3zl
|
inoremap <C-ScrollWheelUp> <C-O>4zl
|
||||||
inoremap <C-ScrollWheelDown> <C-O>3zh
|
inoremap <C-ScrollWheelDown> <C-O>4zh
|
||||||
|
|
||||||
|
"hold alt to scroll left/right more precisely
|
||||||
|
noremap <A-ScrollWheelUp> zl
|
||||||
|
noremap <A-ScrollWheelDown> zh
|
||||||
|
inoremap <A-ScrollWheelUp> <C-O>zl
|
||||||
|
inoremap <A-ScrollWheelDown> <C-O>zh
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"TABS:{
|
"TABS:{
|
||||||
nnoremap <silent><expr> <Leader>0 ':tabnext<CR>'
|
nnoremap <silent><expr> <Leader>0 ':tabnext<CR>'
|
||||||
inoremap <silent><expr> <Leader>0 '<C-O>:tabnext<CR>'
|
inoremap <silent><expr> <Leader>0 '<C-O>:tabnext<CR>'
|
||||||
xnoremap <silent><expr> <Leader>0 '<Esc>:tabnext<CR>'
|
xnoremap <silent><expr> <Leader>0 '<Esc>:tabnext<CR>'
|
||||||
nnoremap <silent><expr> <Leader>9 ':tabprev<CR>'
|
nnoremap <silent><expr> <Leader>9 ':tabprev<CR>'
|
||||||
inoremap <silent><expr> <Leader>9 '<Esc>:tabprev<CR>'
|
inoremap <silent><expr> <Leader>9 '<Esc>:tabprev<CR>'
|
||||||
xnoremap <silent><expr> <Leader>9 '<Esc>:tabprev<CR>'
|
xnoremap <silent><expr> <Leader>9 '<Esc>:tabprev<CR>'
|
||||||
nnoremap <silent><expr> <Leader>- ':tabnew<CR>'
|
nnoremap <silent><expr> <Leader>- ':tabnew<CR>'
|
||||||
inoremap <silent><expr> <Leader>- '<Esc>:tabnew<CR>'
|
inoremap <silent><expr> <Leader>- '<Esc>:tabnew<CR>'
|
||||||
xnoremap <silent><expr> <Leader>- '<Esc>:tabnew<CR>'
|
xnoremap <silent><expr> <Leader>- '<Esc>:tabnew<CR>'
|
||||||
nnoremap <silent><expr> <leader>= ':VimFiler -tab -project<CR>'
|
nnoremap <silent><expr> <leader>= ':VimFiler -tab -project<CR>'
|
||||||
inoremap <silent><expr> <leader>= '<Esc>:VimFiler -tab -project<CR>'
|
inoremap <silent><expr> <leader>= '<Esc>:VimFiler -tab -project<CR>'
|
||||||
xnoremap <silent><expr> <leader>= '<Esc>:VimFiler -tab -project<CR>'
|
xnoremap <silent><expr> <leader>= '<Esc>:VimFiler -tab -project<CR>'
|
||||||
nnoremap <silent><expr> <leader>+ ':VimFiler -tab -project -double<CR>'
|
nnoremap <silent><expr> <leader>+ ':VimFiler -tab -project -double<CR>'
|
||||||
inoremap <silent><expr> <leader>+ '<Esc>:VimFiler -tab -project -double<CR>'
|
inoremap <silent><expr> <leader>+ '<Esc>:VimFiler -tab -project -double<CR>'
|
||||||
xnoremap <silent><expr> <leader>+ '<Esc>:VimFiler -tab -project -double<CR>'
|
xnoremap <silent><expr> <leader>+ '<Esc>:VimFiler -tab -project -double<CR>'
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"TOGGLES:{
|
"TOGGLES:{
|
||||||
"bindings to trigger vimfiler
|
"bindings to trigger vimfiler
|
||||||
nnoremap <silent><expr> `` ':VimFilerExplorer -direction=botright -winwidth=45<CR>'
|
nnoremap <silent><expr> `` ':VimFilerExplorer -direction=botright -winwidth=45<CR>'
|
||||||
nnoremap <silent><expr> ~~ ':VimFilerExplorer -direction=topleft -winwidth=45<CR>'
|
nnoremap <silent><expr> ~~ ':VimFilerExplorer -direction=topleft -winwidth=45<CR>'
|
||||||
|
|
||||||
nnoremap <silent><expr> ?? ':h quickref<CR>'
|
nnoremap <silent><expr> ?? ':h quickref<CR>'
|
||||||
nnoremap <silent><expr> ?> ':exusage<CR>'
|
nnoremap <silent><expr> ?> ':exusage<CR>'
|
||||||
nnoremap <silent><expr> ?< ':viusage<CR>'
|
nnoremap <silent><expr> ?< ':viusage<CR>'
|
||||||
|
|
||||||
"toggle folded code at foldpoints
|
"toggle folded code at foldpoints
|
||||||
nnoremap <Space> za
|
nnoremap <Space> za
|
||||||
|
|
||||||
"unmap F1 from help then map it to toggle the display of line numbers
|
"unmap F1 from help then map it to toggle the display of line numbers
|
||||||
nnoremap <silent><expr> <F1> ':set number!<CR>:echo "Line numbers toggled"<CR>'
|
nnoremap <silent><expr> <F1> ':set number!<CR>:echo "Line numbers toggled"<CR>'
|
||||||
xnoremap <silent><expr> <F1> '<Esc>:set number!<CR>v'
|
xnoremap <silent><expr> <F1> '<Esc>:set number!<CR>v'
|
||||||
inoremap <silent><expr> <F1> '<C-O>:set number!<CR>'
|
inoremap <silent><expr> <F1> '<C-O>:set number!<CR>'
|
||||||
|
|
||||||
"toggle the cursor line and column
|
"toggle the cursor line and column
|
||||||
nnoremap <silent><expr> <F2> ':set cursorline! cursorcolumn!<CR>:echo "Cursor crosshair toggled"<CR>'
|
nnoremap <silent><expr> <F2> ':set cursorline! cursorcolumn!<CR>:echo "Cursor crosshair toggled"<CR>'
|
||||||
xnoremap <silent><expr> <F2> '<Esc>:set cursorline! cursorcolumn!<CR>v'
|
xnoremap <silent><expr> <F2> '<Esc>:set cursorline! cursorcolumn!<CR>v'
|
||||||
inoremap <silent><expr> <F2> '<C-O>:set cursorline! cursorcolumn!<CR>'
|
inoremap <silent><expr> <F2> '<C-O>:set cursorline! cursorcolumn!<CR>'
|
||||||
|
|
||||||
"toggle line wrapping (and bottom bar if using the gui)
|
"toggle line wrapping (and bottom bar if using the gui)
|
||||||
nnoremap <silent><expr> <F3> ':echo "Line wrapping toggled"<CR>:set wrap!<CR>'
|
nnoremap <silent><expr> <F3> ':echo "Line wrapping toggled"<CR>:set wrap!<CR>'
|
||||||
xnoremap <silent><expr> <F3> '<Esc>:set wrap!<CR>v'
|
xnoremap <silent><expr> <F3> '<Esc>:set wrap!<CR>v'
|
||||||
inoremap <silent><expr> <F3> '<C-O>:set wrap!<CR>'
|
inoremap <silent><expr> <F3> '<C-O>:set wrap!<CR>'
|
||||||
|
|
||||||
"toggle all folds
|
"toggle all folds
|
||||||
nnoremap <F4> zi:echo "Code Folding Toggled"<CR>
|
nnoremap <F4> zi:echo "Code Folding Toggled"<CR>
|
||||||
xnoremap <F4> <Esc>ziv
|
xnoremap <F4> <Esc>ziv
|
||||||
inoremap <F4> <C-O>zi
|
inoremap <F4> <C-O>zi
|
||||||
|
|
||||||
"toggle spellcheck
|
"toggle spellcheck
|
||||||
nnoremap <silent><expr> <F5> ':set spell!<CR>:echo "Spell checking toggled"<CR>'
|
nnoremap <silent><expr> <F5> ':set spell!<CR>:echo "Spell checking toggled"<CR>'
|
||||||
xnoremap <silent><expr> <F5> '<Esc>:set spell!<CR>v'
|
xnoremap <silent><expr> <F5> '<Esc>:set spell!<CR>v'
|
||||||
inoremap <silent><expr> <F5> '<C-O>:set spell!<CR>'
|
inoremap <silent><expr> <F5> '<C-O>:set spell!<CR>'
|
||||||
|
|
||||||
"toggle syntax checking
|
"toggle syntax checking
|
||||||
nnoremap <silent><expr> <F6> ':SyntasticToggleMode<CR>'
|
nnoremap <silent><expr> <F6> ':SyntasticToggleMode<CR>'
|
||||||
xnoremap <silent><expr> <F6> '<Esc>:SyntasticToggleMode<CR>v'
|
xnoremap <silent><expr> <F6> '<Esc>:SyntasticToggleMode<CR>v'
|
||||||
inoremap <silent><expr> <F6> '<C-O>:SyntasticToggleMode<CR>'
|
inoremap <silent><expr> <F6> '<C-O>:SyntasticToggleMode<CR>'
|
||||||
|
|
||||||
"bindings to trigger the tagbar list of tags
|
"bindings to trigger the tagbar list of tags
|
||||||
nnoremap <silent><expr> <F8> ':TagbarToggle<CR>:echo "Code tagbar toggled"<CR>'
|
nnoremap <silent><expr> <F8> ':TagbarToggle<CR>:echo "Code tagbar toggled"<CR>'
|
||||||
xnoremap <silent><expr> <F8> '<Esc>:TagbarToggle<CR>v'
|
xnoremap <silent><expr> <F8> '<Esc>:TagbarToggle<CR>v'
|
||||||
inoremap <silent><expr> <F8> '<C-O>:TagbarToggle<CR>'
|
inoremap <silent><expr> <F8> '<C-O>:TagbarToggle<CR>'
|
||||||
|
|
||||||
"bindings to trigger the tagbar list of errors
|
"bindings to trigger the tagbar list of errors
|
||||||
nmap <script> <silent> <C-F8> :call ToggleLocationList()<CR>:echo "Error/Location list toggled"<CR>
|
nmap <script> <silent> <C-F8> :call ToggleLocationList()<CR>:echo "Error/Location list toggled"<CR>
|
||||||
|
|
||||||
"bindings to trigger the gundo undo history
|
"bindings to trigger the gundo undo history
|
||||||
nnoremap <silent><expr> <F9> ':GundoToggle<CR>:echo "Undo history sidebar toggled"<CR>'
|
nnoremap <silent><expr> <F9> ':GundoToggle<CR>:echo "Undo history sidebar toggled"<CR>'
|
||||||
xnoremap <silent><expr> <F9> '<Esc>:GundoToggle<CR>v'
|
xnoremap <silent><expr> <F9> '<Esc>:GundoToggle<CR>v'
|
||||||
inoremap <silent><expr> <F9> '<C-O>:GundoToggle<CR>'
|
inoremap <silent><expr> <F9> '<C-O>:GundoToggle<CR>'
|
||||||
|
|
||||||
"bindings to trigger spellcheck
|
"bindings to trigger spellcheck
|
||||||
nnoremap <silent><expr> <C-F9> ':UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
|
nnoremap <silent><expr> <C-F9> ':UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
|
||||||
xnoremap <silent><expr> <C-F9> '<Esc>:UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
|
xnoremap <silent><expr> <C-F9> '<Esc>:UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
|
||||||
inoremap <silent><expr> <C-F9> '<Esc>:UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
|
inoremap <silent><expr> <C-F9> '<Esc>:UpdateAndSpellCheck<CR>:call ToggleQuickfixList()<CR>'
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"GVIM TOGGLES:{
|
"GVIM TOGGLES:{
|
||||||
"map toggles for the menu, toolbar and vertical scrollbar
|
"map toggles for the menu, toolbar and vertical scrollbar
|
||||||
nnoremap <silent><expr> <C-F1> ":if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>:echo 'Menu bar toggled'<CR>"
|
nnoremap <silent><expr> <C-F1> ":if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>:echo 'Menu bar toggled'<CR>"
|
||||||
vnoremap <silent><expr> <C-F1> "<Esc>:if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>v"
|
vnoremap <silent><expr> <C-F1> "<Esc>:if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>v"
|
||||||
inoremap <silent><expr> <C-F1> "<C-O>:if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>"
|
inoremap <silent><expr> <C-F1> "<C-O>:if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>"
|
||||||
|
|
||||||
nnoremap <silent><expr> <C-F2> ":if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>:echo 'Toolbar toggled'<CR>"
|
nnoremap <silent><expr> <C-F2> ":if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>:echo 'Toolbar toggled'<CR>"
|
||||||
vnoremap <silent><expr> <C-F2> "<Esc>:if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>v"
|
vnoremap <silent><expr> <C-F2> "<Esc>:if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>v"
|
||||||
inoremap <silent><expr> <C-F2> "<C-O>:if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>"
|
inoremap <silent><expr> <C-F2> "<C-O>:if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>"
|
||||||
|
|
||||||
nnoremap <silent><expr> <C-F3> ":if &go=~#'r'<Bar>set go-=r<Bar>set go-=L<Bar>set go-=b<Bar>else<Bar>set go+=r<Bar>set go+=L<Bar>set go+=b<Bar>endif<CR>:echo 'Scrollbars toggled'<CR>"
|
nnoremap <silent><expr> <C-F3> ":if &go=~#'r'<Bar>set go-=r<Bar>set go-=L<Bar>set go-=b<Bar>else<Bar>set go+=r<Bar>set go+=L<Bar>set go+=b<Bar>endif<CR>:echo 'Scrollbars toggled'<CR>"
|
||||||
vnoremap <silent><expr> <C-F3> "<Esc>:if &go=~#'r'<Bar>set go-=r<Bar>set go-=L<Bar>set go-=b<Bar>else<Bar>set go+=r<Bar>set go+=L<Bar>set go+=b<Bar>endif<CR>v"
|
vnoremap <silent><expr> <C-F3> "<Esc>:if &go=~#'r'<Bar>set go-=r<Bar>set go-=L<Bar>set go-=b<Bar>else<Bar>set go+=r<Bar>set go+=L<Bar>set go+=b<Bar>endif<CR>v"
|
||||||
inoremap <silent><expr> <C-F3> "<C-O>:if &go=~#'r'<Bar>set go-=r<Bar>set go-=L<Bar>set go-=b<Bar>else<Bar>set go+=r<Bar>set go+=L<Bar>set go+=b<Bar>endif<CR>"
|
inoremap <silent><expr> <C-F3> "<C-O>:if &go=~#'r'<Bar>set go-=r<Bar>set go-=L<Bar>set go-=b<Bar>else<Bar>set go+=r<Bar>set go+=L<Bar>set go+=b<Bar>endif<CR>"
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"COMPLETION:{
|
"COMPLETION:{
|
||||||
"emmet switch triggerkey from <Ctrl-Y>
|
"emmet switch triggerkey from <Ctrl-Y>
|
||||||
let g:user_emmet_leader_key='<C-\>'
|
let g:user_emmet_leader_key='<C-\>'
|
||||||
|
|
||||||
"press backslash twice on a mispelled word for suggestions
|
"press backslash twice on a mispelled word for suggestions
|
||||||
nnoremap \\ hei<C-X><C-S>
|
nnoremap \\ hei<C-X><C-S>
|
||||||
nnoremap \| zg
|
nnoremap \| zg
|
||||||
|
|
||||||
"neocomplcache: scroll through completion list
|
"neocomplcache: scroll through completion list
|
||||||
inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
||||||
"neocomplcache: complete the common part of the string
|
"neocomplcache: complete the common part of the string
|
||||||
inoremap <expr><Leader><Tab> neocomplcache#complete_common_string()
|
inoremap <expr><Leader><Tab> neocomplcache#complete_common_string()
|
||||||
"neocomplcache: close popup and delete backward char
|
"neocomplcache: close popup and delete backward char
|
||||||
inoremap <expr><CR> pumvisible() ? neocomplcache#smart_close_popup() : "\<CR>"
|
inoremap <expr><CR> pumvisible() ? neocomplcache#smart_close_popup() : "\<CR>"
|
||||||
"neocomplcache : undo completion
|
"neocomplcache : undo completion
|
||||||
inoremap <expr><Leader><Backspace> "<Backspace>" . neocomplcache#undo_completion()
|
inoremap <expr><Leader><Backspace> "<Backspace>" . neocomplcache#undo_completion()
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"FORMATTING:{
|
"FORMATTING:{
|
||||||
"have backspace delete the selected text
|
"have backspace delete the selected text
|
||||||
vnoremap <Backspace> "_x
|
vnoremap <Backspace> "_x
|
||||||
nnoremap <Backspace> i<Backspace><Esc>l
|
nnoremap <Backspace> i<Backspace><Esc>l
|
||||||
|
|
||||||
"formatting options to apply to the whole document
|
"formatting options to apply to the whole document
|
||||||
nnoremap <Leader><C-f> mzgg=G`z<CR>:echo "The document has been formatted"<CR>
|
nnoremap <Leader><C-f> mzgg=G`z<CR>:echo "The document has been formatted"<CR>
|
||||||
vnoremap <Leader><C-f> mz=`z<CR>:echo "The selection has been formatted"<CR>
|
vnoremap <Leader><C-f> mz=`z<CR>:echo "The selection has been formatted"<CR>
|
||||||
nnoremap <silent><expr> <Leader><C-w> ':FixWhitespace<CR>:echo "Trailing whitespace has been removed"<CR>'
|
nnoremap <silent><expr> <Leader><C-w> ':FixWhitespace<CR>:echo "Trailing whitespace has been removed"<CR>'
|
||||||
nnoremap <silent><expr> <Leader><C-t> ':retab<CR>:noh<CR>:echo "Tabs have been converted to spaces"<CR>'
|
nnoremap <silent><expr> <Leader><C-t> ':retab<CR>:noh<CR>:echo "Tabs have been converted to spaces"<CR>'
|
||||||
nnoremap <silent><expr> <Leader>/ ':noh<CR>:echo "Search results have been cleared"<CR>'
|
nnoremap <silent><expr> <Leader>/ ':noh<CR>:echo "Search results have been cleared"<CR>'
|
||||||
nnoremap <silent><expr> <Leader><Esc> ':noh<CR>:echo "Search results have been cleared"<CR>'
|
nnoremap <silent><expr> <Leader><Esc> ':noh<CR>:echo "Search results have been cleared"<CR>'
|
||||||
|
|
||||||
"tab and untab the currently selected lines
|
"tab and untab the currently selected lines
|
||||||
vnoremap <Tab> >gv
|
vnoremap <Tab> >gv
|
||||||
nnoremap <Tab> v>gv<Esc>
|
nnoremap <Tab> v>gv<Esc>
|
||||||
vnoremap <S-Tab> <gv
|
vnoremap <S-Tab> <gv
|
||||||
nnoremap <S-Tab> v<gv<Esc>
|
nnoremap <S-Tab> v<gv<Esc>
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"MOVEMENT:{
|
"MOVEMENT:{
|
||||||
"additional mappings for easier access
|
"additional mappings for easier access
|
||||||
nnoremap = +
|
nnoremap = +
|
||||||
|
|
||||||
"remap keys for speedier movement
|
"remap keys for speedier movement
|
||||||
nnoremap <S-Up> 4k
|
nnoremap <S-Up> 4k
|
||||||
nnoremap <S-Down> 4j
|
nnoremap <S-Down> 4j
|
||||||
nnoremap <S-Right> 6l
|
nnoremap <S-Right> 6l
|
||||||
nnoremap <S-Left> 6h
|
nnoremap <S-Left> 6h
|
||||||
|
|
||||||
"remap keys to scroll to the end in a direction
|
"remap keys to scroll to the end in a direction
|
||||||
nnoremap <C-Up> gg0
|
nnoremap <C-Up> gg0
|
||||||
nnoremap <C-Down> G$
|
nnoremap <C-Down> G$
|
||||||
nnoremap <C-Right> $
|
nnoremap <C-Right> $
|
||||||
nnoremap <C-Left> ^
|
nnoremap <C-Left> ^
|
||||||
|
|
||||||
|
"remap alt+up/down to move blocks up/down a line
|
||||||
|
vmap <A-Up> <Plug>MoveBlockUp
|
||||||
|
vmap <A-Down> <Plug>MoveBlockDown
|
||||||
|
nmap <A-Up> <Plug>MoveLineUp
|
||||||
|
nmap <A-Down> <Plug>MoveLineDown
|
||||||
|
|
||||||
|
"remap alt+left/right/h/l to move blocks up/down a half page
|
||||||
|
vmap <A-Left> <Plug>MoveBlockHalfPageUp
|
||||||
|
vmap <A-Right> <Plug>MoveBlockHalfPageDown
|
||||||
|
nmap <A-Left> <Plug>MoveLineHalfPageUp
|
||||||
|
nmap <A-Right> <Plug>MoveLineHalfPageDown
|
||||||
|
vmap <A-h> <Plug>MoveBlockHalfPageUp
|
||||||
|
vmap <A-l> <Plug>MoveBlockHalfPageDown
|
||||||
|
nmap <A-h> <Plug>MoveLineHalfPageUp
|
||||||
|
nmap <A-l> <Plug>MoveLineHalfPageDown
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"SELECTION:{
|
"SELECTION:{
|
||||||
"ctrl-a to select all (and an alt for screen users)
|
"ctrl-a to select all (and an alt for screen users)
|
||||||
nnoremap <C-a> gg0vG$
|
nnoremap <C-a> gg0vG$
|
||||||
xnoremap <C-a> <Esc>gg0vG$
|
xnoremap <C-a> <Esc>gg0vG$
|
||||||
nnoremap <Leader>a <Esc>gg0vG$
|
nnoremap <Leader>a <Esc>gg0vG$
|
||||||
xnoremap <Leader>a gg0vG$
|
xnoremap <Leader>a gg0vG$
|
||||||
|
|
||||||
"map remap keys for speedier text selection
|
"map remap keys for speedier text selection
|
||||||
xnoremap <S-Up> 4k
|
xnoremap <S-Up> 4k
|
||||||
xnoremap <S-Down> 4j
|
xnoremap <S-Down> 4j
|
||||||
xnoremap <S-Right> 6l
|
xnoremap <S-Right> 6l
|
||||||
xnoremap <S-Left> 6h
|
xnoremap <S-Left> 6h
|
||||||
|
|
||||||
"remap keys to select all text in one direction
|
"remap keys to select all text in one direction
|
||||||
xnoremap <C-Up> gg0
|
xnoremap <C-Up> gg0
|
||||||
xnoremap <C-Down> G$
|
xnoremap <C-Down> G$
|
||||||
xnoremap <C-Right> $
|
xnoremap <C-Right> $
|
||||||
xnoremap <C-Left> ^
|
xnoremap <C-Left> ^
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"VIMDIFF:{
|
"VIMDIFF:{
|
||||||
"map shortcuts for vimdiff
|
"map shortcuts for vimdiff
|
||||||
nnoremap <silent><expr> <Leader>> ':diffu<CR>'
|
nnoremap <silent><expr> <Leader>> ':diffu<CR>'
|
||||||
nnoremap <silent><expr> <Leader>< ':diffu<CR>'
|
nnoremap <silent><expr> <Leader>< ':diffu<CR>'
|
||||||
nnoremap >> ]c
|
nnoremap >> ]c
|
||||||
nnoremap << [c
|
nnoremap << [c
|
||||||
nnoremap <> dp
|
nnoremap <> dp
|
||||||
nnoremap >< do
|
nnoremap >< do
|
||||||
"}
|
"}
|
||||||
|
|
||||||
"PASTE:{
|
"PASTE:{
|
||||||
"display contents of paste buffers
|
"display contents of paste buffers
|
||||||
nnoremap <silent><expr> <Leader>p ':reg<CR>'
|
nnoremap <silent><expr> <Leader>p ':reg<CR>'
|
||||||
|
|
||||||
"allow y to copy a single character in normal mode
|
"allow y to copy a single character in normal mode
|
||||||
nnoremap y vy<Esc>
|
nnoremap y vy<Esc>
|
||||||
|
|
||||||
"P puts text it replaces in the buffer and p does not
|
"P puts text it replaces in the buffer and p does not
|
||||||
vnoremap P p
|
vnoremap P p
|
||||||
xmap p <Plug>ReplaceWithRegisterVisual
|
xmap p <Plug>ReplaceWithRegisterVisual
|
||||||
nmap <C-p> <Plug>ReplaceWithRegisterOperator
|
nmap <C-p> <Plug>ReplaceWithRegisterOperator
|
||||||
|
|
||||||
"Alternatives to deletion commands that don't replace the buffer
|
"Alternatives to deletion commands that don't replace the buffer
|
||||||
vnoremap <Leader>x "_x
|
vnoremap <Leader>x "_x
|
||||||
nnoremap <Leader>x "_x
|
nnoremap <Leader>x "_x
|
||||||
vnoremap <Leader>X "_X
|
vnoremap <Leader>X "_X
|
||||||
nnoremap <Leader>X "_X
|
nnoremap <Leader>X "_X
|
||||||
vnoremap <Leader>D "_D
|
vnoremap <Leader>D "_D
|
||||||
nnoremap <Leader>D "_D
|
nnoremap <Leader>D "_D
|
||||||
vnoremap <Leader>d "_d
|
vnoremap <Leader>d "_d
|
||||||
nnoremap <Leader>dd "_dd
|
nnoremap <Leader>dd "_dd
|
||||||
nnoremap <Leader>dw "_dw
|
nnoremap <Leader>dw "_dw
|
||||||
"}
|
"}
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
|
@ -451,13 +489,3 @@
|
||||||
cabbrev sudoe SudoRead
|
cabbrev sudoe SudoRead
|
||||||
cabbrev esudo SudoRead
|
cabbrev esudo SudoRead
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
"TMUX AND SCREEN COMPATIBILITY: SOME HACKS TO MAKE THINGS WORK RIGHT {{{
|
|
||||||
"general compatibility settings for both screen and tmux
|
|
||||||
if $TERM =~ '^screen-256color'
|
|
||||||
nmap <Esc>OH <Home>
|
|
||||||
imap <Esc>OH <Home>
|
|
||||||
nmap <Esc>OF <End>
|
|
||||||
imap <Esc>OF <End>
|
|
||||||
endif
|
|
||||||
"}}}
|
|
||||||
|
|
Loading…
Reference in a new issue