Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify Neovim inside VSCode #83

Closed
adelarsq opened this issue Dec 9, 2019 · 6 comments
Closed

Identify Neovim inside VSCode #83

adelarsq opened this issue Dec 9, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@adelarsq
Copy link

adelarsq commented Dec 9, 2019

Would be nice to be possible to identify that the neovim instance is being used inside VSCode, so we can load plugins by demand.

Did try this config, but didn't work as expected:

if has('g:vscode_channel')
   let g:editor = 'vscode'
   ...
if g:editor !=# 'vscode'
    Plug 'https://github.com/nathanaelkane/vim-indent-guides'
endif
@asvetliakov asvetliakov added the enhancement New feature or request label Dec 9, 2019
@asvetliakov
Copy link
Member

@justinmk what is the correct way to set something before user config loads? Currently i'm setting vscode_channel var before ui_attach api call, but it doesn't seem to work

@justinmk
Copy link
Collaborator

justinmk commented Dec 9, 2019

That should work. Make sure you aren't using --headless

@adelarsq
Copy link
Author

adelarsq commented Dec 9, 2019

I notice that after the start from VSCode the variable is available. But on the neovim config loading phase isn't.

@asvetliakov
Copy link
Member

asvetliakov commented Dec 9, 2019

@justinmk Not using headless but using -c to load vim support files. May be because of this? Perhaps i can just add --cmd to set some marker variable instead

@justinmk
Copy link
Collaborator

justinmk commented Dec 9, 2019

-c runs after user config. See :help -c . Use --cmd

@asvetliakov
Copy link
Member

Once 0.0.40 released you can check with following:

if exists('g:vscode')
    " VSCode extension
else
    " ordinary neovim
endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants