Friday, August 24, 2012

Re: defining imap that calls performs second call if cursor didn't move

>
>
> The following mapping works:
>
>
>
> imap <C-L> <C-O>:call SelectImapOrUlti()<CR>
>
>
>
> I'm not 100% sure why <C-R>=SelectImapOrUlti()<CR> doesn't work,
>
> but I guess because it's only meant to insert text.
>
>
>
> Btw. the LaTeX-Suite might not be the best solution. Here's what
>
> the bot vimgor (from Freenode/#vim) has to say about it:
>
>
>
> <vimgor> A slightly-maintained, buggy, over-complicated plugin
>
> intended to make it easier to author (La)Tex files.
>
> Often, this is better served by using a standalone
>
> snippets plugin (like snipMate) to define the
>
> snippets you actually find useful as well as using
>
> the command ':compiler tex' to allow using Vim's
>
> quickfix feature when compiling TeX to an output
>
> format.
>
>
>
> Personally I use XPTemplate instead of snipMate and it works very
>
> well for me.
>
>
>
> Regards,
>
> Simon


I tried to follow your advise and stick to a snippets plugin (I use ultisnips), and so far the only things that I miss are:

-- to be able to properly compile and view the errors (vim-latex compiles several times if necessary and only shows error list if any error or warning is present, I tried latex-box for this but the experience doesn't seem to be as good)

-- when typing several characters like ^^ vim-latex would give something like ^{}<++> and then I would be able to jump out, even nesting these types of objects. In my current setup with ultisnips:

inoremap <silent> $$ $$<C-R>=UltiSnips_Anon('$$1$$0', '$$', 'dollar', "r")<cr>
inoremap <silent> ^^ ^^<C-R>=UltiSnips_Anon('^{$1}$0', '\^\^', 'hat', "r")<cr>
inoremap <silent> __ __<C-R>=UltiSnips_Anon('_{$1}$0', '__', 'unders', "r")<cr>

it only jumps out from the most inner one, so if I type $$ and then use ^^ inside this it will jump once but when I hit <c-j> again the cursor will not move.

--
You received this message from the "vim_use" 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

No comments:

Post a Comment