From ed09312c511018d26c9dd7bd03c6e9b62fb2708a Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 18 Dec 2014 15:53:48 +0100 Subject: [map] comments/uncomments C code blocks/lines --- vimrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vimrc b/vimrc index db9b36a..86edbfb 100644 --- a/vimrc +++ b/vimrc @@ -253,8 +253,16 @@ set tabstop=4 set shiftwidth=4 set noexpandtab -noremap U yyp:s/[^ ]/-/g:noh -noremap Y yyp:s/[^ ]/=/g:noh +"noremap U yyp:s/[^ ]/-/g:noh +"noremap Y yyp:s/[^ ]/=/g:noh + +" Code comment/uncomment + noremap // m"I// g`"3l + noremap /* m"I/* A */jg`"3l + xmap // /* +xnoremap /* `>a */` + noremap \* m"e?/\* *:s:/\* *::/ *\*\/:s: *\*/::\|:nohljg`"3h + noremap \\ m"0:s:// *::\|:nohlg`"3h " Reformatting is done using 'gq' noremap Q :s/^/> / -- cgit v1.2.3