From 41ceb581b6f190dc095977d53ad9fcff4a92277e Mon Sep 17 00:00:00 2001 From: nojhan Date: Thu, 10 Feb 2011 18:55:13 +0100 Subject: [PATCH] map a macro that justifies a paragraph ; map a command to remove C/C++ comments and blank lines --- .vimrc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.vimrc b/.vimrc index 6ddfa9d..d8f4dcd 100644 --- a/.vimrc +++ b/.vimrc @@ -38,17 +38,18 @@ nnoremap v V`] " ,s will split vertically and swith over the new panel nnoremap s vl +" Wrap a paragraph and justify it +:runtime macros/justify.vim +nnoremap j gw}{V}:call Justify('tw',4) + " activate rainbow parenthesis nnoremap r :RainbowParenthesesToggle " activate gundo nnoremap u :GundoToggle -" fold all C++ comments (i.e. several lines starting with a //) -nnoremap h :set foldmethod=expr:set foldexpr=getline(v:lnum)=~'^\\s//'?1:getline(prevnonblank(v:lnum))=~'^\\s//'?1:getline(nextnonblank(v:lnum))=~'^\\s*//'?1:0 -" fold all C-like comments (i.e. /* lines inside slash stars */) -nnoremap H :set foldmethod=marker:set foldmarker=/*,*/ - +" remove all C/C++ comments and blank lines +nnoremap h :%s/\/\*\_.*\*\/\n\{,1}\|^\s*\/\/.*\n\|\s*\/\/.*//:%s/^\s*\n// set list set listchars=tab:▸\ " print tabs with a special character (add ",eol:·" for end of lines)