<Leader>J only formats the current line in normal mode (rather than the whole

document)
This commit is contained in:
Kevin MacMartin 2014-06-26 09:14:16 -04:00
parent 9306287af9
commit 57f3fd3a3b

View file

@ -498,7 +498,7 @@
vnoremap <Backspace> "_x
"formatting options to apply to the whole document
nnoremap <silent><expr> <Leader>J ':set tw=79<CR>gggqG:set tw=0<CR>:echo "Document text has been formatted to a width of 79 characters"<CR>'
nnoremap <silent><expr> <Leader>J ':set tw=79<CR>Vgq:set tw=0<CR>:echo "Document text has been formatted to a width of 79 characters"<CR>'
vnoremap <silent><expr> <Leader>J '<Esc>:set tw=79<CR>gvgq:set tw=0<CR>:echo "Selected text has been formatted to a width of 79 characters"<CR>'
nnoremap <Leader>f mzgg=G`z<CR>:echo "The document has been formatted"<CR>
vnoremap <Leader>f mz=`z<CR>:echo "The selection has been formatted"<CR>