Oni: opening using `oni <dir>` does not set the dir correctly

Created on 2 May 2018  路  7Comments  路  Source: onivim/oni

<dir> appears to be sticky. So the first time I opened oni, it was in a specific dir. Unless I change the dir with :cd <dir> the dir appears to be sticky.

expected:

oni . should use the pwd to set the dir correctly for example.

daily-editor-blocker help wanted

Most helpful comment

I am not sure invoking oni without arguments should set the cwd. The reason is that users that for some reason don't have a shell-less command to run Oni would always open it in the ~ dir, e.g. starting a terminal and running Oni.

My suggestion would be to adhere to the following convention:

  • oni: Opens Oni without setting cwd, i.e. loads the last cwd remembered
  • oni <dir>: Opens Oni with cwd set as <dir> (including .). Even better if NETRW opened as well.
  • oni <file>: I think it's really annoying when the file explorer displays a project's tree that has no relation to the file I am editing, this would improve the quality of life for people who need to perform quick tweaks on occasion. Opening with pwd or the file's directory would work for me.

All 7 comments

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

This is something that only atom does afaik. Not vim.

if i'm opening vim in a folder, and I open NerdTree or whatever, it's not going to show files in some other directory I opened hours earlier.

Any GUI I've used be it atom, sublime, whatever, will show the explorer in the dir it was opened in.

That's not the same thing as your original request.

Yes it is. I'm talking about opening oni with oni <dir> and it showing the explorer for that dir.

oni . is one example. If I start it like that now, it is remembering the last directory I did a :cd to. I don't know where it's storing that, but it's not in the config dir.

What directory are you starting from? Oh, in the case of oni . obviously it should use CWD. But it should do that even without the . arg.

I just tried it, you're right that Oni remembers the last :cd and doesn't look at the CWD where oni was invoked. That does seem wrong. I was confused by the mention of oni <dir>, because the I've seen other requests in the past asking for nvim <dir> to set the CWD to <dir> (which Atom does, IIRC).

I am not sure invoking oni without arguments should set the cwd. The reason is that users that for some reason don't have a shell-less command to run Oni would always open it in the ~ dir, e.g. starting a terminal and running Oni.

My suggestion would be to adhere to the following convention:

  • oni: Opens Oni without setting cwd, i.e. loads the last cwd remembered
  • oni <dir>: Opens Oni with cwd set as <dir> (including .). Even better if NETRW opened as well.
  • oni <file>: I think it's really annoying when the file explorer displays a project's tree that has no relation to the file I am editing, this would improve the quality of life for people who need to perform quick tweaks on occasion. Opening with pwd or the file's directory would work for me.
Was this page helpful?
0 / 5 - 0 ratings