-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Use one instance for nnn or remember nnn paths #43
Comments
it will be wonderful if there is a nnn buffer and it keeps everything I have entered |
If it's possible, it has to be done in the plugin. nnn itself doesn't track any user details. |
@jarun thanks for you replying, I got your meaning |
I'm using this key binding which opens nnn in the current buffer's directory, not a replacement for remembering path but may fit your use case: nnoremap <C-n> :NnnPicker %<CR> |
@khuedoan ya. Sometime when i need to use nnn, i have call command with some args my self too 😄 |
Sure! I'll work on this. Also, this seems like an approach we can use to simulate a classic directory viewer. That would entail reopening an |
https://github.com/mcchrish/nnn.vim/blob/master/doc/nnn.txt#L149-L159 with this option, it should be possible to make use of sessions right away. They can pass any file they want for example: " create a session that is tied to the current vim session
let g:nnn#command = 'nnn -s ' . tempname() Another possibility is to tweak call nnn#pick('~/some-files', { 'command': 'nnn -s '. tempname() }) Which is probably the most flexible direction. |
Seems like a possible direction if stdout option doesn't work out #43. |
There are some annoying things with the way sessions currently work in upstream Please let me know if you do not happen to experience this issue. To be specific, you will see an |
Actually, I am understanding sessions incorrectly. I think it would be less suitable to call them "sessions" since they are more like "snapshots" that can be arbitrarily loaded and saved. What we would need is an option for named sessions to be saved on quit. All that needs to be done is to take the existing code for auto-saving the
I am currently working on making the third choice here work. |
Did you happen to test this? Because to my knowledge this isn't actually possible yet, read my prior comments for details. |
I have not. I assumed the behavior of |
This isn't really an issue to be concerned with as this isn't the default behavior anyway. Take a look at jarun/nnn#1023 (comment) for more details. |
See jarun/nnn#1023.
Persistent session option is global. So any session which is active at quit will be persisted. I don;t want more complexity in that. The "auto session" (@) will be used to restore the last working state when a session is loaded at runtime temporarily. Also "auto session" will be used (as it is now) to persist the session if no other session is active at program quit. |
May I assign myself this task? I think the interface should be kept simple. Maybe have a |
Sure! |
Fixed at #96. |
nnn v4.2 Mojito 2021-07-21 - `NNN_PLUG` indicator symbol interpretation has **changed**: - `!` - _run-cmd-as-plugin_ (earlier `_`) - `&` - _run-gui-cmd-as-plugin_ (earlier `|`) - `|` (new) - page noninteractive _run-cmd-as-plugin_ output - persistent selection markers (#1086) - option _extract to..._ for archives - mount remote and mount/extract archive to a smart context - confirm file trashing to avoid accidental press of <kbd>x</kbd> (#1101) - insert the last command executed at prompt on <kbd>Up</kbd> or <kbd>Down</kbd> - insert the current file name at empty prompt on <kbd>TAB</kbd> - handle redraw issue on missed `KEY_RESIZE` (#1067) - add force-tty capability to spawn and set pagers to it (#1064) - clear selection mode on deselecting last selected file (#1098) - remove selected hovered entry from selection on deletion - disable filtering in empty directories - ignore last pressed filter character when no matches - fix broken screen on resize while paging (#1072) - fix archive not hovered on creation - remove libgit2 dependency in `gitstatus` patch (#1095) - add `-G` flag for `gitstatus` patch - option `-X` for explorer (persistent picker) mode - option `-F` decommissioned in favour of config `NNN_HELP` - `-F` redefined to multiplex `NNN_FIFO` to preview or explore - support paging noninterative _run-cmd-as-plugin_ output - `nuke` - add option to execute binaries (#1111) - plugin `fzopen` - call `open` on macOS, add option to use `nuke` - plugin `fzcd` will not modify selection - plugin `suedit` - preserve environment - several `preview-tui` fixes - plugin `wall` renamed to `wallpaper` - remove plugin `fzz` - merged into plugin `autojump` - remove plugin `upgrade` - packaging is on OBS now - remove plugin `treeview` - needs minor `preview-tui` tweak - remove plugin `picker` - `nnn -p -` does the same - remove plugin `pdfview` - needs simple change in `pdfread` - remove plugin `uidgid` - use program option `-U` - remove plugins `mediainf`, `hexview` - simple one-liners ------------------------------------------------------------------------------- nnn v4.1.1 Sake 2021-06-03 - fix segfault on session save (#1041) - remove redundant `_Atomic` usage - move [`patches`](../tree/master/patches) directory to top-level - fix and cleanup gitstatus patch - plugin `imgview` improvements (#1049) - restore source-code packing on CircleCI - add Makefile target to compile with musl ------------------------------------------------------------------------------- nnn v4.1 2021-06-02 - a patch management model for approved patches - multi-threaded disk usage calculation using pthreads and FTS - dynamic view update when calculating disk usage - <kbd>Bksp</kbd>/<kbd>Del</kbd> at empty filter prompt to refresh dir - Try to create new context with <kbd>Shift-TAB</kbd>, else reverse cycle - <kbd>Alt+Esc</kbd> to quit context from filter prompt - fix zombies left behind after running plugins (#999) - named persistent sessions (mcchrish/nnn.vim#43) - consider nanosecond resolution when sorting by time (#978) - check external selection in `'c'urrent / 's'el` prompt (#976) - show number of files selected in local selection buffer, if any - `nnn` & picker plugin (e.g. `fzopen`) sync (mcchrish/nnn.vim#82) - make batch rename interactive (#971) - cached uid/gid for performance improvement - fixes for `nnn` with `netbsd-curses`, `musl-fts`, `musl` (#998) - script to statically compile `nnn` with `musl gcc` on Ubuntu - restore hovered file when plugin is chosen from plugin dir - support QuickLook on WSL in `preview-tui` (#959) - toggle `preview-tui` with the same _custom_ plugin key - smoother preview toggling in `preview-tui` (#966) - `listen_on` should be set in kitty.conf for `preview-tui` (#970) - minimal `bat` style in `preview-tui`, honors `$BAT_STYLE` - plugin `preview-tui-ext` supersedes `preview-tui` (#1033) - plugin `fzcd` can now fuzzy search multiple directories - plugin `imgview` supersedes `imgthumb` and `vidthumb` - plugin `umounttree`: unmount remote mntpoint from within - plugin `xdgdefault`: set the default app for hovered file type - plugin `fzplug`: fuzzy find, preview and run other plugins - plugin `cmusq`: queue/play music in `cmus` - plugin `mocplay` renamed to `mocq` - plugin `cleanfilename` renamed to `fixname` - go to last dir on <kbd>~</kbd> (HOME) or <kbd>`</kbd> (ROOT) key repeat - ambiguous key <kbd>^Space</kbd> to select/clear range dropped (#998) - user wiki page for [Themes](https://github.com/jarun/nnn/wiki/Themes) - show selection mark (`+`) in reverse bold for improved visibility - reverse block replaces `>` to mark hovered entry in detail mode - make option `O_CKBOARD` removed - make option `O_NOLOC` renamed to `O_NOLC` - ignore `O_NOLC` if `O_ICONS` or `O_NERD` is specified (#1026) - unicode arrow indicators if `O_ICONS` or `O_NERD` is specified - make option `NOX11`: disable notis, sel-clipboard sync, xterm title - retain filter in _nav-to-type_ mode after file open - fix no files picked with `NNN_TMPFILE` exported and <kbd>q</kbd> to quit - disable xterm title setting in picker mode (#974) ------------------------------------------------------------------------------- nnn v4.0 Sushi 2021-04-13 - show xterm title on option `-x` ------------------------------------------------------------------------------- nnn v3.7 2021-04-13 - allow plugins to clear selection (#884, #889, #917) - do not clear selection on hovered file deletion - resurrect `'c'urrent/'s'el` prompt and option `-u` (#889) - show only file name in reverse in detail mode - more file/mime types supported in `preview-tui-ext` - plugin `mtpmount` - (un)mount MTP devices - plugin `cleanfilename` - more shell-friendly file names - plugin `rsynccp` - copy-paste with visual progress - replace `$HOME` by `~` in address bar - show current path in terminal title (#911) - total links and inode number of hardlink in statusbar - fix symlink to text file not opening in CLI editor (#890) - fix symlink size shown as 0B in statusbar (#888) - show symlink target in statusbar (#893) - show correct disk free/total on macOS (#888) - fix directory disk usage showing as 0 on macOS (#941) - fix name col len with `-C` and icons compiled-in (#936) - refactor printing entries in light/detail modes (#934) - make option `O_CKBOARD` for checker board as indicator
Is your feature request related to a problem? Please describe.
After select a file with
Enter
. nnn close and everything is reset when we reopen nnn again, everything is reset to default current path, see below gif:Describe the solution you'd like
It's more convenient if nnn.vim can use one instance for nnn. Or at least remember the current path of nnn.
Like i have 2 buffer which splited
| buffer 1 | buffer 2 |
When i was in buffer 1, open nnn and goes to folder
test/buffer1/test1.js
And in buffer 2, open nnn and goes to folder
test/buffer2/test2.js
When i reopen nnn in those buffers. It should open the current path of that buffer. If it can remember path of each context [1][2][3][4], it's the best.
That's just my idea. How do you guys thinks. I'v just a lots of files manager for vim. nnn is the fasted but it lack some convenient features.
Minimal vimrc
Versions
OS: macOS Mojave 10.14.1
Terminal: Alacritty
Neovim: Latest
nnn: Latest
nnn.vim: Latest
The text was updated successfully, but these errors were encountered: