Skip to content

Commit

Permalink
Auto indent pasted text in vim
Browse files Browse the repository at this point in the history
'=' is to indent, '`]' is to do it until the end of the pasted text,
and '<C-o>' brings the cursor back to the start of the pasted text.'`'
  • Loading branch information
victormours committed Oct 15, 2015
1 parent 9f015da commit a0ac105
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vim/indent/gitconfig.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ setlocal autoindent
setlocal indentexpr=GetGitconfigIndent()
setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F

" Auto indent pasted text
nnoremap p p=`]<C-o>
nnoremap P P=`]<C-o>
" Only define the function once.
if exists("*GetGitconfigIndent")
finish
Expand Down

0 comments on commit a0ac105

Please sign in to comment.