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

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

Reply via email to