Added a new script that can be used to update the repo if bash is
available. Updated the README. Improved the theme by adding a bunch
of syntax highlighting definitions (mostly rooted in html, though
a bunch of other languages base their colours on it), as well as
tweaking visual selection to longer invert on the block with the cursor,
and parenthesis matching to look the same at both ends. Added a plugin
that improves the theme and adds some keyboard shortcuts to markdown,
which is what the README.md files in Github are written in. I realized
that the h,j,k,l shortcuts equivalent to the ones with arrow keys I'd
added were overwriting other shortcuts with the shift combinations, so
I removed those and the ctrl-ones for consistency. The diff shortcuts
weren't intuitive or easy on the hands, so I tried something else and
I think it works much better now (check vim/keyboard.vim). An update
script has also been added to simplify updating submodules; I'm not
completely clear as to whether following this method will properly
update the submodules in certain conditions like when one is removed,
but this should add new ones and update the existing ones after pulling
from the repo.
2014-04-01 00:03:52 -04:00
|
|
|
"==========================="
|
2014-02-20 23:24:20 -05:00
|
|
|
" Keyboard Configuration: "
|
|
|
|
"==========================="
|
|
|
|
"
|
2014-03-28 22:12:13 -04:00
|
|
|
" Note:
|
|
|
|
" *The default <Leader> key is: \
|
|
|
|
"
|
2014-02-20 23:24:20 -05:00
|
|
|
" Reference: (view plugin documentation for the full list of commands each offers)
|
2014-04-02 02:09:20 -04:00
|
|
|
" <Leader>q | (N) -> toggle display of the quickfix list
|
|
|
|
" <Leader>l | (N) -> toggle display of the location list
|
2014-03-28 22:12:13 -04:00
|
|
|
" cs'" | (N) -> change surrounding '' to "" (any delimiters work)
|
|
|
|
" cs"<q> | (N) -> change surrounding "" to the tag: <q></q>
|
|
|
|
" cst" | (N) -> change any surrounding tag to ""
|
|
|
|
" ds" | (N) -> delete surrounding ""
|
2014-02-20 23:24:20 -05:00
|
|
|
"
|
|
|
|
" Mappings:
|
2014-03-28 22:12:13 -04:00
|
|
|
" (mouse)
|
|
|
|
" <Ctrl-ScrollUp> | (A) -> scroll right
|
|
|
|
" <Ctrl-ScrollDown> | (A) -> scroll left
|
|
|
|
" <Shift-MiddleClick> | (A) -> unbind this from vim so xorg can paste
|
|
|
|
"
|
|
|
|
" (tabs)
|
|
|
|
" <Ctrl-t> | (A) -> open a new tab
|
|
|
|
" <Ctrl-n> | (A) -> go to the next open tab
|
|
|
|
" <Ctrl-p> | (A) -> go to the previous open tab
|
|
|
|
"
|
|
|
|
" (toggles)
|
2014-04-02 11:17:12 -04:00
|
|
|
" <Space> | (N) -> toggle folds
|
2014-03-28 22:12:13 -04:00
|
|
|
" <F1> | (A) -> toggle line numbers
|
|
|
|
" <F2> | (A) -> toggle row/column highlighting
|
2014-04-02 11:17:12 -04:00
|
|
|
" <F3> | (A) -> toggle line wrapping
|
|
|
|
" <F4> | (A) -> toggle spell check
|
|
|
|
" <F5> | (A) -> toggle all folds
|
|
|
|
" <F9> | (A) -> toggle the gundo undo history sidebar
|
2014-03-28 22:12:13 -04:00
|
|
|
" <Shift-F9> | (A) -> toggle the tagbar sidebar
|
2014-04-02 11:17:12 -04:00
|
|
|
" <Ctrl-F9> | (A) -> toggle the error list
|
|
|
|
" `` | (N) -> toggle the filer explorer sidebar
|
2014-03-28 22:12:13 -04:00
|
|
|
"
|
|
|
|
" (gvim toggles)
|
|
|
|
" <Ctrl-F1> | (A) -> toggle the menu
|
|
|
|
" <Ctrl-F2> | (A) -> toggle the toolbar
|
|
|
|
" <Ctrl-F3> | (A) -> toggle the scrollbar
|
|
|
|
"
|
2014-04-02 11:17:12 -04:00
|
|
|
" (completion)
|
|
|
|
" <Leader>,, | (A) -> enter after emme 'word' (ie: html:5)
|
2014-03-28 22:12:13 -04:00
|
|
|
" \\ | (N) -> show spelling suggestions popup for word
|
|
|
|
" \| | (N) -> add word to a local list of correct spellings
|
2014-04-02 11:17:12 -04:00
|
|
|
" <Tab> | (I) -> (neocomp) autocomplete using common string
|
|
|
|
" <Leader><Tab> | (I) -> (neocomp) autocomplete the common string
|
|
|
|
" <Enter> | (I) -> (neocomp) close the suggestion popup
|
|
|
|
" <Leader><Backspace> | (I) -> (neocomp) undo the most recent completion
|
2014-03-28 22:12:13 -04:00
|
|
|
"
|
|
|
|
" (formatting)
|
|
|
|
" <Backspace> | (V) -> deletes currently selected text
|
|
|
|
" <Backspace> | (N) -> deletes the character behind the cursor
|
|
|
|
" <Leader><C-f> | (N) -> format document and return to current line
|
|
|
|
" <Leader><C-w> | (N) -> remove whitespace
|
|
|
|
" <Leader><C-t> | (N) -> convert tabs into spaces
|
|
|
|
" <Leader>\ | (N) -> remove search highlighting
|
|
|
|
" <Tab> | (V) -> indent all the lines currently selected
|
|
|
|
" <Tab> | (N) -> indent the current line
|
|
|
|
" <Shift-Tab> | (V) -> unindent all the lines currently selected
|
|
|
|
" <Shift-Tab> | (N) -> unindent the current line
|
2014-02-20 23:24:20 -05:00
|
|
|
"
|
2014-03-28 22:12:13 -04:00
|
|
|
" (movement)
|
|
|
|
" = | (N) -> move to the first character on the next line
|
|
|
|
" <Ctrl-Up> | (N) -> move to the beginning of the document
|
|
|
|
" <Ctrl-Down> | (N) -> move to the end of the document
|
|
|
|
" <Ctrl-Right> | (N) -> move to the end of the line
|
|
|
|
" <Ctrl-Left> | (N) -> move to the beginning of the non-whitespace
|
2014-02-20 23:24:20 -05:00
|
|
|
"
|
2014-03-28 22:12:13 -04:00
|
|
|
" (selection)
|
|
|
|
" <Ctrl-a> | (V) -> select all
|
|
|
|
" <Ctrl-a> | (N) -> select all
|
|
|
|
" <Leader>a | (V) -> select all
|
|
|
|
" <Leader>a | (N) -> select all
|
|
|
|
" <Shift-Up> | (V) -> toggle selection of all text above the cursor
|
|
|
|
" <Shift-Up> | (N) -> select all text above the cursor
|
|
|
|
" <Shift-Down> | (V) -> toggle selection of all text below the cursor
|
|
|
|
" <Shift-Down> | (N) -> select all text below the cursor
|
|
|
|
" <Shift-Right> | (V) -> toggle selection of all text to the right of the cursor
|
|
|
|
" <Shift-Right> | (N) -> select all text to the right of the cursor
|
|
|
|
" <Shift-Left> | (V) -> toggle selection of all non-whitespace to the left
|
|
|
|
" <Shift-Left> | (N) -> select all non-whitespace to the left
|
2014-02-20 23:24:20 -05:00
|
|
|
"
|
2014-03-28 22:12:13 -04:00
|
|
|
" (vimdiff)
|
2014-04-02 11:17:12 -04:00
|
|
|
" <Leader>> | (N) -> update differences
|
Added a new script that can be used to update the repo if bash is
available. Updated the README. Improved the theme by adding a bunch
of syntax highlighting definitions (mostly rooted in html, though
a bunch of other languages base their colours on it), as well as
tweaking visual selection to longer invert on the block with the cursor,
and parenthesis matching to look the same at both ends. Added a plugin
that improves the theme and adds some keyboard shortcuts to markdown,
which is what the README.md files in Github are written in. I realized
that the h,j,k,l shortcuts equivalent to the ones with arrow keys I'd
added were overwriting other shortcuts with the shift combinations, so
I removed those and the ctrl-ones for consistency. The diff shortcuts
weren't intuitive or easy on the hands, so I tried something else and
I think it works much better now (check vim/keyboard.vim). An update
script has also been added to simplify updating submodules; I'm not
completely clear as to whether following this method will properly
update the submodules in certain conditions like when one is removed,
but this should add new ones and update the existing ones after pulling
from the repo.
2014-04-01 00:03:52 -04:00
|
|
|
" >> | (N) -> next difference
|
|
|
|
" << | (N) -> previous difference
|
|
|
|
" >< | (N) -> replace diff in current pane with other pane
|
|
|
|
" <> | (N) -> replace diff in other pane with current pane
|
2014-02-20 23:24:20 -05:00
|
|
|
"
|
2014-03-31 05:47:32 -04:00
|
|
|
" (paste)
|
|
|
|
" y | (N) -> copies the character
|
2014-03-28 22:12:13 -04:00
|
|
|
" p | (V) -> paste and replace the currently selected text
|
|
|
|
" P | (V) -> paste and replace the currently selected text
|
Added a new script that can be used to update the repo if bash is
available. Updated the README. Improved the theme by adding a bunch
of syntax highlighting definitions (mostly rooted in html, though
a bunch of other languages base their colours on it), as well as
tweaking visual selection to longer invert on the block with the cursor,
and parenthesis matching to look the same at both ends. Added a plugin
that improves the theme and adds some keyboard shortcuts to markdown,
which is what the README.md files in Github are written in. I realized
that the h,j,k,l shortcuts equivalent to the ones with arrow keys I'd
added were overwriting other shortcuts with the shift combinations, so
I removed those and the ctrl-ones for consistency. The diff shortcuts
weren't intuitive or easy on the hands, so I tried something else and
I think it works much better now (check vim/keyboard.vim). An update
script has also been added to simplify updating submodules; I'm not
completely clear as to whether following this method will properly
update the submodules in certain conditions like when one is removed,
but this should add new ones and update the existing ones after pulling
from the repo.
2014-04-01 00:03:52 -04:00
|
|
|
" <Leader>p | (N) -> view the paste buffers and register contents
|
|
|
|
" <Leader>d | (V) -> delete the currently selected text
|
|
|
|
" <Leader>x | (V) -> delete the currently selected text
|
|
|
|
" <Leader>x | (N) -> delete the char(s) under and the cursor
|
|
|
|
" <Leader>X | (V) -> delete the currently selected lines
|
|
|
|
" <Leader>X | (N) -> delete the char(s) before the cursor
|
|
|
|
" <Leader>D | (V) -> delete the currently selected lines
|
|
|
|
" <Leader>D | (N) -> delete chars under and after the cursor on the line
|
|
|
|
" <Leader>dw | (N) -> delete chars under and after the cursor in the word
|
|
|
|
" <Leader>dd | (N) -> delete lines under and after the one below
|
2014-03-28 22:12:13 -04:00
|
|
|
"
|
|
|
|
" Aliases:
|
|
|
|
" :wsudo -and- :sudow | (C) -> :SudoWrite (write the file as root using sudo)
|
|
|
|
" :esudo -and- :sudoe | (C) -> :SudoRead (read a file as root using sudo)
|
2014-02-20 23:24:20 -05:00
|
|
|
"
|
|
|
|
|
2014-03-11 03:05:09 -04:00
|
|
|
"MAPPINGS: GENERAL KEYBINDINGS AND REBINDINGS {{{
|
2014-03-28 22:12:13 -04:00
|
|
|
"MOUSE:{
|
2014-03-24 17:58:31 -04:00
|
|
|
"hold shift to enable middle-click paste
|
2014-03-24 17:20:35 -04:00
|
|
|
noremap <S-Insert> <MiddleMouse>
|
|
|
|
noremap! <S-Insert> <MiddleMouse>
|
|
|
|
|
2014-03-24 17:58:31 -04:00
|
|
|
"hold ctrl to scroll left/right instead of up/down
|
|
|
|
noremap <C-ScrollWheelUp> 3zl
|
|
|
|
noremap <C-ScrollWheelDown> 3zh
|
2014-03-31 05:47:32 -04:00
|
|
|
inoremap <C-ScrollWheelUp> <C-O>3zl
|
|
|
|
inoremap <C-ScrollWheelDown> <C-O>3zh
|
2014-03-28 22:12:13 -04:00
|
|
|
"}
|
2014-03-24 17:58:31 -04:00
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"TABS:{
|
2014-03-11 03:05:09 -04:00
|
|
|
"move to the next and previous tabs
|
changed the clipboard to 'unnamedplus' which cuts/copies to the xorg clipboard and the desktop one, and pastes from the desktop. I also tweaked the theme to include more variety, make things more readable and apply more logic as to what has what colour/style. F2-F4 are now the line number and highlight toggles, ` and ~ are now toggles for nerdtree/ctags, visual highlighted text is now replaced with p rather than needing to use P, ctrl-t,n,p open new tabs and cycle to the next and previous one respectively, and each ctrl/shift-up/down/left/right combo now has a h,j,k,l equivalent with more complete movement. The autocomplete list no longer has a limit, and folded code is now collapsed at a lower depth.
2014-03-24 20:36:36 -04:00
|
|
|
nnoremap <silent><expr> <C-t> ':tabnew<CR>'
|
|
|
|
nnoremap <silent><expr> <C-n> ':tabnext<CR>'
|
|
|
|
nnoremap <silent><expr> <C-p> ':tabprev<CR>'
|
2014-03-28 22:12:13 -04:00
|
|
|
"}
|
2014-03-11 03:05:09 -04:00
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"TOGGLES:{
|
2014-04-02 11:17:12 -04:00
|
|
|
"toggle folded code at foldpoints
|
|
|
|
nnoremap <Space> za
|
|
|
|
|
2014-03-26 00:44:02 -04:00
|
|
|
"unmap F1 from help then map it to toggle the display of line numbers
|
|
|
|
nnoremap <silent><expr> <F1> ':set number!<CR>'
|
2014-03-27 00:56:54 -04:00
|
|
|
vnoremap <silent><expr> <F1> '<Esc>:set number!<CR>v'
|
2014-03-28 22:12:13 -04:00
|
|
|
inoremap <silent><expr> <F1> '<C-O>:set number!<CR>'
|
2014-03-11 03:05:09 -04:00
|
|
|
|
changed the clipboard to 'unnamedplus' which cuts/copies to the xorg clipboard and the desktop one, and pastes from the desktop. I also tweaked the theme to include more variety, make things more readable and apply more logic as to what has what colour/style. F2-F4 are now the line number and highlight toggles, ` and ~ are now toggles for nerdtree/ctags, visual highlighted text is now replaced with p rather than needing to use P, ctrl-t,n,p open new tabs and cycle to the next and previous one respectively, and each ctrl/shift-up/down/left/right combo now has a h,j,k,l equivalent with more complete movement. The autocomplete list no longer has a limit, and folded code is now collapsed at a lower depth.
2014-03-24 20:36:36 -04:00
|
|
|
"toggle the cursor line and column
|
2014-03-28 22:12:13 -04:00
|
|
|
nnoremap <silent><expr> <F2> ':set cursorline! cursorcolumn!<CR>'
|
|
|
|
vnoremap <silent><expr> <F2> '<Esc>:set cursorline! cursorcolumn!<CR>v'
|
|
|
|
inoremap <silent><expr> <F2> '<C-O>:set cursorline! cursorcolumn!<CR>'
|
2014-03-27 00:56:54 -04:00
|
|
|
|
2014-04-02 11:17:12 -04:00
|
|
|
"toggle line wrapping (and bottom bar if using the gui)
|
|
|
|
nnoremap <silent><expr> <F3> ':set wrap! go'.'-+'[&wrap]."=b\r"
|
|
|
|
vnoremap <silent><expr> <F3> '<Esc>:set wrap! go'.'-+'[&wrap]."=b\rv"
|
|
|
|
inoremap <silent><expr> <F3> '<C-O>:set wrap! go'.'-+'[&wrap]."=b\r"
|
|
|
|
|
2014-03-27 00:56:54 -04:00
|
|
|
"toggle spellcheck
|
2014-04-02 11:17:12 -04:00
|
|
|
nnoremap <silent><expr> <F4> ':set spell!<CR>'
|
|
|
|
vnoremap <silent><expr> <F4> '<Esc>:set spell!<CR>v'
|
|
|
|
inoremap <silent><expr> <F4> '<C-O>:set spell!<CR>'
|
2014-03-28 22:12:13 -04:00
|
|
|
|
2014-04-02 11:17:12 -04:00
|
|
|
"toggle all folds
|
|
|
|
nnoremap <F5> zi
|
|
|
|
vnoremap <F5> <Esc>ziv
|
|
|
|
inoremap <F5> <C-O>zi
|
|
|
|
|
|
|
|
"bindings to trigger the gundo undo history
|
|
|
|
nnoremap <silent><expr> <F9> ':GundoToggle<CR>'
|
|
|
|
vnoremap <silent><expr> <F9> '<Esc>:GundoToggle<CR>v'
|
|
|
|
inoremap <silent><expr> <F9> '<C-O>:GundoToggle<CR>'
|
2014-03-28 22:12:13 -04:00
|
|
|
|
2014-04-02 11:17:12 -04:00
|
|
|
"bindings to trigger the tagbar list of tags
|
2014-03-28 22:12:13 -04:00
|
|
|
nnoremap <silent><expr> <S-F9> ':TagbarToggle<CR>'
|
|
|
|
vnoremap <silent><expr> <S-F9> '<Esc>:TagbarToggle<CR>v'
|
|
|
|
inoremap <silent><expr> <S-F9> '<C-O>:TagbarToggle<CR>'
|
2014-03-11 03:05:09 -04:00
|
|
|
|
2014-04-02 11:17:12 -04:00
|
|
|
"bindings to trigger the tagbar list of errors
|
|
|
|
nmap <script> <silent> <C-F9> :call ToggleLocationList()<CR>
|
2014-03-11 03:05:09 -04:00
|
|
|
|
2014-04-02 11:17:12 -04:00
|
|
|
"bindings to trigger the filer explorer
|
|
|
|
nnoremap <silent><expr> `` ':VimFilerExplorer<CR>'
|
2014-03-28 22:12:13 -04:00
|
|
|
"}
|
2014-03-21 16:17:15 -04:00
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"GVIM TOGGLES:{
|
|
|
|
"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>"
|
|
|
|
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>"
|
2014-03-24 17:20:35 -04:00
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
nnoremap <silent><expr> <C-F2> ":if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>"
|
|
|
|
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>"
|
|
|
|
|
|
|
|
nnoremap <silent><expr> <C-F3> ":if &go=~#'r'<Bar>set go-=r<Bar>else<Bar>set go+=r<Bar>endif<CR>"
|
|
|
|
vnoremap <silent><expr> <C-F3> "<Esc>:if &go=~#'r'<Bar>set go-=r<Bar>else<Bar>set go+=r<Bar>endif<CR>v"
|
|
|
|
inoremap <silent><expr> <C-F3> "<C-O>:if &go=~#'r'<Bar>set go-=r<Bar>else<Bar>set go+=r<Bar>endif<CR>"
|
|
|
|
"}
|
|
|
|
|
|
|
|
"SPELLING AND COMPLETION:{
|
2014-04-02 11:17:12 -04:00
|
|
|
"emmet switch triggerkey from <Ctrl-Y>
|
|
|
|
let g:user_emmet_leader_key='<Leader>,'
|
2014-03-28 16:30:38 -04:00
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"press backslash twice on a mispelled word for suggestions
|
Added a new script that can be used to update the repo if bash is
available. Updated the README. Improved the theme by adding a bunch
of syntax highlighting definitions (mostly rooted in html, though
a bunch of other languages base their colours on it), as well as
tweaking visual selection to longer invert on the block with the cursor,
and parenthesis matching to look the same at both ends. Added a plugin
that improves the theme and adds some keyboard shortcuts to markdown,
which is what the README.md files in Github are written in. I realized
that the h,j,k,l shortcuts equivalent to the ones with arrow keys I'd
added were overwriting other shortcuts with the shift combinations, so
I removed those and the ctrl-ones for consistency. The diff shortcuts
weren't intuitive or easy on the hands, so I tried something else and
I think it works much better now (check vim/keyboard.vim). An update
script has also been added to simplify updating submodules; I'm not
completely clear as to whether following this method will properly
update the submodules in certain conditions like when one is removed,
but this should add new ones and update the existing ones after pulling
from the repo.
2014-04-01 00:03:52 -04:00
|
|
|
nnoremap \\ hei<C-X><C-S>
|
2014-03-28 22:12:13 -04:00
|
|
|
nnoremap \| zg
|
|
|
|
|
2014-04-02 11:17:12 -04:00
|
|
|
"neocomplcache: scroll through completion list
|
|
|
|
inoremap <expr><Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
|
|
|
"neocomplcache: complete the common part of the string
|
|
|
|
inoremap <expr><Leader><Tab> neocomplcache#complete_common_string()
|
|
|
|
"neocomplcache: close popup and delete backward char
|
|
|
|
inoremap <expr><CR> pumvisible() ? neocomplcache#smart_close_popup() : "\<CR>"
|
|
|
|
"neocomplcache : undo completion
|
|
|
|
inoremap <expr><Leader><Backspace> "<Backspace>" . neocomplcache#undo_completion()
|
2014-03-28 22:12:13 -04:00
|
|
|
"}
|
|
|
|
|
|
|
|
"FORMATTING:{
|
|
|
|
"have backspace delete the selected text
|
|
|
|
vnoremap <Backspace> x
|
|
|
|
nnoremap <Backspace> i<Backspace><Esc>l
|
|
|
|
|
|
|
|
"formatting options to apply to the whole document
|
|
|
|
nnoremap <Leader><C-f> mzgg=G`z<CR>
|
|
|
|
nnoremap <silent><expr> <Leader><C-w> ':FixWhitespace<CR>'
|
|
|
|
nnoremap <silent><expr> <Leader><C-t> ':retab<CR>:noh<CR>'
|
2014-03-28 16:30:38 -04:00
|
|
|
nnoremap <silent><expr> <Leader>/ ':noh<CR>'
|
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"tab and untab the currently selected lines
|
|
|
|
vnoremap <Tab> >gv
|
|
|
|
nnoremap <Tab> v>gv<Esc>
|
|
|
|
vnoremap <S-Tab> <gv
|
|
|
|
nnoremap <S-Tab> v<gv<Esc>
|
|
|
|
"}
|
|
|
|
|
|
|
|
"MOVEMENT:{
|
|
|
|
"additional mappings for easier access
|
|
|
|
nnoremap = +
|
|
|
|
|
2014-03-24 17:20:35 -04:00
|
|
|
"remap keys to scroll through text
|
2014-03-28 07:36:19 -04:00
|
|
|
nnoremap <C-Up> gg0
|
|
|
|
nnoremap <C-Down> G$
|
2014-03-24 17:20:35 -04:00
|
|
|
nnoremap <C-Right> $
|
|
|
|
nnoremap <C-Left> ^
|
2014-03-28 22:12:13 -04:00
|
|
|
"}
|
2014-03-24 17:20:35 -04:00
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"SELECTION:{
|
2014-03-24 17:20:35 -04:00
|
|
|
"map remap keys to select text
|
2014-03-28 11:44:12 -04:00
|
|
|
vnoremap <C-a> <Esc>gg0vG$
|
2014-03-28 11:52:42 -04:00
|
|
|
nnoremap <C-a> gg0vG$
|
2014-03-28 11:44:12 -04:00
|
|
|
vnoremap <Leader>a <Esc>gg0vG$
|
2014-03-28 11:52:42 -04:00
|
|
|
nnoremap <Leader>a gg0vG$
|
|
|
|
vnoremap <S-Up> gg0
|
2014-03-28 07:36:19 -04:00
|
|
|
nnoremap <S-Up> vgg0
|
2014-03-28 11:52:42 -04:00
|
|
|
vnoremap <S-Down> G$
|
2014-03-28 07:36:19 -04:00
|
|
|
nnoremap <S-Down> vG$
|
2014-03-28 11:52:42 -04:00
|
|
|
vnoremap <S-Right> $
|
2014-03-24 17:20:35 -04:00
|
|
|
nnoremap <S-Right> v$
|
2014-03-28 11:52:42 -04:00
|
|
|
vnoremap <S-Left> ^
|
2014-03-24 17:20:35 -04:00
|
|
|
nnoremap <S-Left> v^
|
2014-03-28 22:12:13 -04:00
|
|
|
"}
|
2014-03-11 03:05:09 -04:00
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"VIMDIFF:{
|
|
|
|
"map shortcuts for vimdiff
|
2014-04-02 11:17:12 -04:00
|
|
|
nnoremap <silent><expr> <Leader>> ':diffu<CR>'
|
Added a new script that can be used to update the repo if bash is
available. Updated the README. Improved the theme by adding a bunch
of syntax highlighting definitions (mostly rooted in html, though
a bunch of other languages base their colours on it), as well as
tweaking visual selection to longer invert on the block with the cursor,
and parenthesis matching to look the same at both ends. Added a plugin
that improves the theme and adds some keyboard shortcuts to markdown,
which is what the README.md files in Github are written in. I realized
that the h,j,k,l shortcuts equivalent to the ones with arrow keys I'd
added were overwriting other shortcuts with the shift combinations, so
I removed those and the ctrl-ones for consistency. The diff shortcuts
weren't intuitive or easy on the hands, so I tried something else and
I think it works much better now (check vim/keyboard.vim). An update
script has also been added to simplify updating submodules; I'm not
completely clear as to whether following this method will properly
update the submodules in certain conditions like when one is removed,
but this should add new ones and update the existing ones after pulling
from the repo.
2014-04-01 00:03:52 -04:00
|
|
|
nnoremap >> ]c
|
|
|
|
nnoremap << [c
|
|
|
|
nnoremap <> dp
|
|
|
|
nnoremap >< do
|
2014-03-28 22:12:13 -04:00
|
|
|
"}
|
2014-03-11 03:05:09 -04:00
|
|
|
|
2014-03-31 05:47:32 -04:00
|
|
|
"PASTE:{
|
Added a new script that can be used to update the repo if bash is
available. Updated the README. Improved the theme by adding a bunch
of syntax highlighting definitions (mostly rooted in html, though
a bunch of other languages base their colours on it), as well as
tweaking visual selection to longer invert on the block with the cursor,
and parenthesis matching to look the same at both ends. Added a plugin
that improves the theme and adds some keyboard shortcuts to markdown,
which is what the README.md files in Github are written in. I realized
that the h,j,k,l shortcuts equivalent to the ones with arrow keys I'd
added were overwriting other shortcuts with the shift combinations, so
I removed those and the ctrl-ones for consistency. The diff shortcuts
weren't intuitive or easy on the hands, so I tried something else and
I think it works much better now (check vim/keyboard.vim). An update
script has also been added to simplify updating submodules; I'm not
completely clear as to whether following this method will properly
update the submodules in certain conditions like when one is removed,
but this should add new ones and update the existing ones after pulling
from the repo.
2014-04-01 00:03:52 -04:00
|
|
|
"display contents of paste buffers
|
|
|
|
nnoremap <silent><expr> <Leader>p ':reg<CR>'
|
|
|
|
|
2014-03-31 05:47:32 -04:00
|
|
|
"allow y to copy in normal mode
|
|
|
|
nnoremap y vy<Esc>
|
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"alternatives that preserve the paste buffer
|
2014-04-02 11:17:12 -04:00
|
|
|
vnoremap p "_dP
|
|
|
|
vnoremap P "_dP
|
2014-03-28 22:12:13 -04:00
|
|
|
vnoremap <Leader>x "_x
|
|
|
|
nnoremap <Leader>x "_x
|
|
|
|
vnoremap <Leader>X "_X
|
|
|
|
nnoremap <Leader>X "_X
|
|
|
|
vnoremap <Leader>D "_D
|
|
|
|
nnoremap <Leader>D "_D
|
|
|
|
vnoremap <Leader>d "_d
|
|
|
|
nnoremap <Leader>dd "_dd
|
|
|
|
nnoremap <Leader>dw "_dw
|
|
|
|
"}
|
|
|
|
"}}}
|
2014-03-11 03:05:09 -04:00
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"ALIASES: COMMAND SHORTCUTS {{{
|
|
|
|
cabbrev sudow SudoWrite
|
|
|
|
cabbrev wsudo SudoWrite
|
|
|
|
cabbrev sudoe SudoRead
|
|
|
|
cabbrev esudo SudoRead
|
2014-03-11 03:05:09 -04:00
|
|
|
"}}}
|
|
|
|
|
|
|
|
"TMUX AND SCREEN COMPATIBILITY: SOME HACKS TO MAKE THINGS WORK RIGHT {{{
|
2014-03-28 22:12:13 -04:00
|
|
|
"general compatibility settings for both screen and tmux
|
2014-03-11 03:05:09 -04:00
|
|
|
if $TERM =~ '^screen-256color'
|
|
|
|
nmap <Esc>OH <Home>
|
|
|
|
imap <Esc>OH <Home>
|
|
|
|
nmap <Esc>OF <End>
|
|
|
|
imap <Esc>OF <End>
|
|
|
|
endif
|
2014-03-28 07:36:19 -04:00
|
|
|
|
2014-03-28 22:12:13 -04:00
|
|
|
"full keyboard compatibility for tmux with xterm-keys enabled
|
2014-03-28 07:36:19 -04:00
|
|
|
if &term =~ '^screen' && exists('$TMUX')
|
|
|
|
execute "set <xUp>=\e[1;*A"
|
|
|
|
execute "set <xDown>=\e[1;*B"
|
|
|
|
execute "set <xRight>=\e[1;*C"
|
|
|
|
execute "set <xLeft>=\e[1;*D"
|
|
|
|
execute "set <xHome>=\e[1;*H"
|
|
|
|
execute "set <xEnd>=\e[1;*F"
|
|
|
|
execute "set <Insert>=\e[2;*~"
|
|
|
|
execute "set <Delete>=\e[3;*~"
|
|
|
|
execute "set <PageUp>=\e[5;*~"
|
|
|
|
execute "set <PageDown>=\e[6;*~"
|
|
|
|
execute "set <xF1>=\e[1;*P"
|
|
|
|
execute "set <xF2>=\e[1;*Q"
|
|
|
|
execute "set <xF3>=\e[1;*R"
|
|
|
|
execute "set <xF4>=\e[1;*S"
|
|
|
|
execute "set <F5>=\e[15;*~"
|
|
|
|
execute "set <F6>=\e[17;*~"
|
|
|
|
execute "set <F7>=\e[18;*~"
|
|
|
|
execute "set <F8>=\e[19;*~"
|
|
|
|
execute "set <F9>=\e[20;*~"
|
|
|
|
execute "set <F10>=\e[21;*~"
|
|
|
|
execute "set <F11>=\e[23;*~"
|
|
|
|
execute "set <F12>=\e[24;*~"
|
|
|
|
endif
|
2014-03-11 03:05:09 -04:00
|
|
|
"}}}
|