From: Nicolas Boisselier Date: Wed, 3 Jun 2026 07:43:47 +0000 (+0200) Subject: etc/vim/source/map.vim X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=5234ec01646ef0fb2f93e392c7b3e3937521665a;p=nb.git etc/vim/source/map.vim --- diff --git a/etc/vim/source/map.vim b/etc/vim/source/map.vim index 77e8540e..8b264a2d 100644 --- a/etc/vim/source/map.vim +++ b/etc/vim/source/map.vim @@ -12,6 +12,16 @@ if !exists("g:MapHelp") let g:MapHelp = [] endif + +func!MapHelpAdd(key,lib) + for line in g:MapHelp + if line[0] == a:key + return + endif + endfor + call add(g:MapHelp,[a:key,a:lib]) +endfunc + func!_MapHelpSort(x,y) if (a:x[0] == a:y[0]) return 0 @@ -155,19 +165,19 @@ map :bp """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " F1 - Last Cmd -call add(MapHelp,['F1, Alt+x','Last shell command executed']) +call MapHelpAdd('F1, Alt+x','Last shell command executed') map :! map x :! """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " F2 - Script, formated text verification -call add(MapHelp,['F2, Alt+c','Check syntaxe']) +call MapHelpAdd('F2, Alt+c','Check syntaxe') map :call FileCheckSyntaxe() map c :call FileCheckSyntaxe() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " F5 - Comment -call add(MapHelp,['F5, Alt+m','Add / Delete comment']) +call MapHelpAdd('F5, Alt+m','Add / Delete comment') map :call CommentNewLine() vmap :call CommentToggle() map m :call CommentNewLine() @@ -175,6 +185,6 @@ vmap m :call CommentToggle() """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Alt+h - Help -call add(MapHelp,['Alt+h','This Help']) +call MapHelpAdd('Alt+h','This Help') map ˙ :call MapHelp() map h :call MapHelp()