Hello, "703designs" <[EMAIL PROTECTED]> :
> Following this tip: > http://vim.wikia.com/wiki/Automatically_append_closing_characters#Improved_Bracket-Matching > > I've pasted the code three times, replacing ( with [ and {, ) with ] > and } respectively for the latter two. > [...] > Any ideas as to how I could extract the second > mapping into a function, taking one argument for the matched > character? The first version of my bracketing system was quite impossible to evolve and maintain. In the last version (*), I've provided a command that helps define normal-, visual- and insert-mode bracket-mappings. (*) The v1.0.0 is only available through subversion at that moment: http://code.google.com/p/lh-vim/wiki/lhBrackets Otherwise, you have several options: 1- play with :exe to map with options :exe "inoremap <silent> ".open." ".open.close."<left>" 2- Have a function that execute the mapping itself ; the function will play with exe+normal 3- Have an <expr>-mapping that expand the result of the called function. HTH, -- Luc Hermitte http://lh-vim.googlecode.com/ http://hermitte.free.fr/vim/ --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
