=> On [2012-05-14 08:18:34 -0700]:
 Ben Fritz Said:
> On Monday, May 14, 2012 8:24:51 AM UTC-5, miles christopher wrote:
> > I want to edit snippet file in a new split window instead of current window.
> > Because edit in current window will close current file.

> > bellowing is a solution to solve this:
> > But I do not know how to use variable &filetype behind command 
> > :NeoComplCacheEditSnippets.
> > If you have any idea, please tell me, thanks very much.

> >     " FIXME function to open snippet edit in a vertical split or tab.
> >     function! EditNeoSnippets()
> >         let current_ft = &filetype
> >         split
> >         :NeoComplCacheEditSnippets &current_ft<CR>
> >     endfunction

> >     nnoremap <buffer> <Leader>es :call EditNeoSnippets()<CR>


> You only use the & for &filetype because it's a built-in OPTION, not a 
> variable. You just access variables by name, with option scope.

> Your other problem is that variables only can be used in expressions, and 
> most commands don't use expressions.

> Use the :execute command (which does take an expression), like this:

> execute "NeoComplCacheEditSnippets ".current_ft

> or even

> execute "NeoComplCacheEditSnippets ".&filetype
thanks

> --
> 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


--
[ stardiviner ] ^^&^^ {I hate all of you !  Leave me alone}
IRC(freeenode): Evanescence \\ Twitter:  @numbchild \\
GnuPG Key fingerprint
    >>> 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433

Attachment: signature.asc
Description: Digital signature

Reply via email to