diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-08-03 09:25:53 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-08-03 09:25:53 +1200 |
commit | 71ced1ccfa28a4dffe126b1408849676e4b36505 (patch) | |
tree | 73f184a6c4b81dbf6551fddc84810eb86dc4b86c /vim/vimrc | |
parent | Merge branch 'hotfix/v1.41.1' (diff) | |
parent | Rebuild dotfiles(7) man page (diff) | |
download | dotfiles-71ced1ccfa28a4dffe126b1408849676e4b36505.tar.gz dotfiles-71ced1ccfa28a4dffe126b1408849676e4b36505.zip |
Merge branch 'release/v1.42.0'v1.42.0
* release/v1.42.0:
Rebuild dotfiles(7) man page
Bump VERSION
Remove unsupported pandoc(1) option
Remove j/gj,k/gk maps again
Revert "Remove & remaps"
Add some experimental :vimgrep and :helpgrep maps
Use g_ instead of $ for yanking command lines
Correct \: mapping
Round out execution mappings
Use \! instead of \@ for line-execute
Add 'confirm'
Add \@ mapping to execute lines with 'shell'
Revert "Remove j/gj remappings"
Add leader mappings for < and >
Check for existence of +completeopt
Add longest and menuone to 'completeopt'
Add equalalways_resized.vim plugin
Remove trailing space from Vim plugin
Add missing abort attribute to plugin
Add scroll_next.vim plugin
Don't set up 'wildignore' in &compatible mode
Add foldlevelstart_stdin.vim plugin
Correct syntax of new map
Try an expanded mapping for <Space>
Remove backspace mapping
Update insert_cancel.vim plugin
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 40 |
1 files changed, 38 insertions, 2 deletions
@@ -58,6 +58,9 @@ silent! set breakindent " Clear default 'comments' value, let the filetype handle it set comments= +" Give me a prompt instead of just rejecting risky :write, :saveas +set confirm + " Try to keep swapfiles in one system-appropriate dir set directory^=~/.vim/cache/swap//,~/vimfiles/cache/swap// @@ -142,6 +145,12 @@ set wildmenu " Use wildmenu set wildmode=list:longest " Tab press completes and lists silent! set wildignorecase " Case insensitive, if supported +" Add completion options +if exists('+completeopt') + set completeopt+=longest " Insert longest common substring + set completeopt+=menuone " Show the menu even if only one match +endif + " Fold based on indent, but only when I ask if has('folding') set foldlevelstart=99 @@ -182,9 +191,18 @@ endif " Map double Ctrl-K in insert mode to search digraph names imap <C-K><C-K> <Plug>(DigraphSearch) -" Remap normal space to scroll down a page, backspace up a page +" Remap normal space to scroll down a page nnoremap <Space> <C-F> -nnoremap <BS> <C-B> +" If we have plugins, do a :next after hitting the last line +if &loadplugins + nmap <Space> <Plug>(ScrollNext) +endif + +" Remap normal/visual & to preserve substitution flags +nnoremap <silent> & :&&<CR> +if exists(':xnoremap') + xnoremap <silent> & :&&<CR> +endif " Map g: as a 'colon operator' nmap g: <Plug>(ColonOperator) @@ -289,11 +307,29 @@ nnoremap <Bslash>+ :<C-U>call vimrc#Anchor('1GgqG')<CR> " \. runs the configured make program into the location list nnoremap <Bslash>. :<C-U>lmake!<CR> +" \< and \> adjusts indent of last edit; good for pasting +nnoremap <Bslash>< :<C-U>'[,']<<CR> +nnoremap <Bslash>> :<C-U>'[,']><CR> + +" \/ types :vimgrep for me ready to enter a search pattern +nnoremap <Bslash>/ :<C-U>vimgrep /\c/ **<S-Left><S-Left><Right> +" \? types :helpgrep for me ready to enter a search pattern +nnoremap <Bslash>? :<C-U>helpgrep \c<S-Left> + " \DEL deletes the current buffer nnoremap <Bslash><Delete> :bdelete<CR> " \INS edits a new buffer nnoremap <Bslash><Insert> :<C-U>enew<CR> +" Execution mappings; each of these clobbers register z + +" \@ executes line in normal mode +nnoremap <Bslash>@ g^"zyg_@z +" \: executes line in command mode +nnoremap <Bslash>: g^"zyg_:<C-R>z<CR> +" \! executes line with 'shell' +nnoremap <Bslash>! g^"zyg_:!<C-R>z<CR> + " If we're running NeoVim, source some extra configuration if has('nvim') runtime nvim.vim |