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

I cannot open a file directly from command line using NyaoVim #142

Open
chaitunya opened this issue Jun 28, 2018 · 2 comments
Open

I cannot open a file directly from command line using NyaoVim #142

chaitunya opened this issue Jun 28, 2018 · 2 comments

Comments

@chaitunya
Copy link

When I type nyaovim file.txt into PowerShell, NyaoVim starts in AppData/Roaming/npm/node_modules/nyaovim instead of editing file.txt.

Your Environment

  • OS: Windows
  • NyaoVim version: 0.2.0
  • nvim version: 0.3.0
  • Keyboard layout: US English
@ndaman
Copy link

ndaman commented Mar 6, 2019

I am having the same issue. This causes problems with Startify as well, as instead of loading Startify (like I had set up in my init.vim), it loads the netrw directory.

@ndaman
Copy link

ndaman commented Mar 6, 2019

I've done a little digging and comparing nvim to nyaovim, it appears that nyaovim is adding its base directory to argv, you can get around this by editing your init.vim (or vimrc) to drop that file.

Currently, the file you wanted to open IS open, just in a hidden buffer behind the directory that nyaovim has added. I made a little hack that does the trick for me (opens Startify when no options are passed, opens files passed otherwise), this is in near the end of my init.vim

" workaround for nyaovim's weird argv issue
if exists('g:nyaovim_version')
" delete first arg
	execute '1argd'
" close current buffer
	execute 'bd'
endif

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

No branches or pull requests

2 participants