-
-
Notifications
You must be signed in to change notification settings - Fork 25
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
feat: keep nnn open #61
Comments
I think #43 and #55 are different from my request in that they expect nnn to close, but want the open directory to persist/be remembered.
My personal desire is to have nnn stay open and visible. I'm not asking the plugin to store session data at all, so as I understand the requests in those other two issues implementing them wouldn't give me the behavior I want. Perhaps I'm just not (yet) adapted to a vim-centric workflow. When I can see the dir tree, i tend to structure around that tree. As I've been using nvim primarily the past few weeks, I've found myself creating a lot more gigantic files and trying to navigate within files instead of between files. In any case, I understand that your time constrained, and I'll continue looking for other solutions/workflows/etc |
Im also interested in NNN persistant pane. You describe it very well like NerdTREE no matter if you open the file the File Browser do not close after opening the file. |
Still nothing about that. It would be very helpful to have persistent pane. |
Please be patient. Anyway, taking a look over this, the first thing I question is, when a file is selected from the |
Since |
@mcchrish This is an interesting idea, but could you elaborate a tad more? I have never quite thought about a curses process communicating via stdout. I guess it would be an alternative to the picker file, maybe |
I think what the user is looking for is, |
User provides the picker output file and whenever she acts (presses |
I guess we can have some keybind that is intercepted before it reaches |
Yes, it seems so. We would need to change the behaviour of So maybe a switch or something. |
Exactly However, |
I think we would need to use the stdout method since Vim must communicate with nnn first, them nnn communicates back with Vim. |
Sure! |
I would love to help make the |
You'll have to follow the |
Done with the change at jarun/nnn@2bd72d1. Now you can follow the |
I've tested it on both Vim8 ( My only change to https://github.com/jarun/nnn/blob/2bd72d1b29d968204421e9a479bc1c159a9dc490/src/nnn.c#L6290 which is probably incorrect for most purposes but was just a test. My logging output looks like this: Maybe the help page for
Emphasis mine. I suspect I may be doing something wrong, but I do not know how to proceed. |
I'm trying some experiments a bit and see if might be helpful. I'm using neovim 0.4.4 and nnn 4.0. A small vimscript to test out: function! s:callback(id, data, name)
echom string([a:id, a:data])
endfunction
function! s:test_nnn()
call termopen('nnn -p -', {'on_stdout': function('s:callback') })
endfunction I'm getting the same result:
But if you take a look at the end, the selected files are found in the output:
It just seems like nnn outputs some other UI data/escape codes to stdout. If I changed call termopen('echo "hello"', {'on_stdout': function('s:callback') }) The output is simply:
If I try using ranger, I'm met with a similar output as nnn:
So it looks like this is just how curses programs deal with stdout? And finally I tried running nnn again but this time with the option call termopen('nnn -p -', {'on_stdout': function('s:callback'), 'stdout_buffered': v:true }) Where I get a single list as output:
This looks like something that we can parse where the items in the list are the actual selected files outputted by nnn except for the first item. The first item is a string containing escape codes and the first selected item at the end of it.
This could be something that can be work on for now but I hope there is something from the nnn or neovim side that could make it easier. Note that I have not tried nnn with the jarun/nnn@2bd72d1 patch yet and only tried neovim. I hope this will be of help. |
Thank you so much! Not sure if we should proceed with the Have you considered the possibility of having |
I'm not that familiar with named pipes and I look at some usage from other plugins and it looks promising. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Is your feature request related to a problem? Please describe.
Coming from more graphical editors and IDEs, I'm used to having a file explorer open all the time.
Describe the solution you'd like
Using netrw in nvim I can get roughly equivalent behavior:
Is it possible to do this with nnn instead?
Describe alternatives you've considered
Seems feasible to pass the file list back to vimscript on some bindable keypress and then process it as usual. I dont have the familiarity with nnn or vimscript to implement it myself atm.
The text was updated successfully, but these errors were encountered: