NyaoVim icon indicating copy to clipboard operation
NyaoVim copied to clipboard

I cannot open a file directly from command line using NyaoVim

Open chaitunya opened this issue 7 years ago • 2 comments

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

chaitunya avatar Jun 28 '18 04:06 chaitunya

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 avatar Mar 06 '19 16:03 ndaman

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

ndaman avatar Mar 06 '19 20:03 ndaman