On 08-Feb-2011 00:06, Christian Brabandt wrote: > On Sa, 05 Feb 2011, Ingo Karkat wrote: > >> Here are some rules and guidelines from my personal "Vim scripting guide": > > Good information. I took your text, reworked it a little bit and put it > into the faqı It's question 20.20 and it should be in the web tomorrow > or the day after tomorrow. Please check. > > ı) http://www.github.com/chrisbra/vim_faq > and on the web at: > http://vimhelp.appspot.com/vim_faq.txt.html
Hello Christian, I'm glad you have found the information useful and have added it to the VIM FAQ. Thanks for maintaining this FAQ; I guess I will find some good nuggets there. So far, I've reviewed only the added question 20.20; here's my list of corrections. (Excuse the plain diff; I'll fork and send a pull request in case I find additional corrections.) -- regards, ingo #v+ --- vim_faq.txt.orig 2011-02-09 15:24:31.798020200 +0100 +++ vim_faq.txt 2011-02-09 15:36:25.059282500 +0100 @@ -5122,7 +5122,7 @@ From https://groups.google.com/group/vim_dev/msg/75f1f2dfc00908bb Not every normal mode-mapping is automatically suitable for execution via -<Ctrl-O> from within inser mode; you need to explicitly design your mappings +<Ctrl-O> from within insert mode; you need to explicitly design your mappings for that purpose. The <Ctrl-O> command allows execution of one normal mode command from @@ -5139,17 +5139,19 @@ b) Concatenate multiple Ex commands via <Bar> on the rhs: - :nnoremap zC :<C-U>call MyMap1()<CR><Bar>call MyMap2()<CR> + :nnoremap zC :<C-U>call MyMap1()<Bar>call MyMap2()<CR> c) Shadow normal mode mappings by insert mode mappings that re-enter normal mode, then invoke the normal mode mapping: - :inoremap <silent> <script> zC <SID>MyMap1<C-\><C-O><SID>MyMap2 + :nnoremap <silent> <SID>MyMap2 :<C-U>call MyMap2()<CR> + :inoremap <silent> <script> <SID>MyMap2 <C-\><C-O><SID>MyMap2 + :nnoremap <silent> <script> zC <SID>MyMap1<SID>MyMap2 d) Normal mode mappings that consist of multiple Ex command lines (and - where Ex commands cannot be concatenated via <Bar>) use <SID>NM - instead of ':<C-U>'; use the <SID>NM Mapping that enters normal mode - for one ex command line: + where Ex commands cannot be concatenated via <Bar>) replace ':<C-U>' + with <SID>NM; the <SID>NM mapping enters normal mode for one ex command + line: :nnoremap <silent> <SID>NM :<C-U> :inoremap <silent> <SID>NM <C-\><C-O>: #v- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
