Closed jarun closed 5 years ago
@ath3 @0xACE @tanyaionova @maxice8 any of you can help with setting up nnn
wikipage on Arch Linux wiki and Wikipedia? We have the content and it would be great if we can have the pages set up for users.
ny of you can help with setting up
nnn
wikipage on Arch Linux wiki and Wikipedia? We have the content and it would be great if we can have the pages set up for users.
Hey, I'm still away during the weekend but I made a simple stub article
https://wiki.archlinux.org/index.php/Nnn
Feedback would be appreciated as I would argue documentation is important to attract more users. I also added a article link for nnn to list of applications on the archlinux wiki.
That's real fast and awesome!!!
You'll find more on nnn
here: https://github.com/jarun/nnn/wiki/hacking-nnn
I would leave the content up to you as you are already hacking nnn
impressively ;). Also, as I have authored the current documentation that would influence as well.
Requesting all collaborators to pitch in with suggestions and contributions to the page.
@0xACE please link from: https://wiki.archlinux.org/index.php/Category:File_managers
@0xACE please link from: https://wiki.archlinux.org/index.php/Category:File_managers
Still not home but managed to add nnn to the list of : File managers and Console applications.
There were other ideas i had during the day but as I didn't write them down I can't recall them atm.
No problem! Please take your time.
I wrote some changes to the archwiki while bbqing, but the battery died and all progress was lost sigh... From now on I'll write changes locally and then upload them...
Another quirk i noticed and can't seem to figure out is:
^P
and hit ^D
to resume back to nnnnnn
, and notice that it doesn't resize as the terminal resizes. Even hitting SEL_REDRAW
will not cause it to redraw the screen.The same problem appears when you use ^O
. Any guesses to what causes this and what to change?
EDIT: This doesn't seem to affect me on termux
but it does on my other machines. I use mainly st
as my terminal but the problem remains in urxvt
and xterm
. Also I guess I should create a seperate issue for these sorts of discussions, right?
~We should handle ^D
to exit the prompt and that should fix it.~
No, the problem happens even without pressing ^D
. That's because the getch()
in xreadlien()
is blocking and we do not get the resize signal. I think we may have to live with it.
More details: https://stackoverflow.com/questions/26807623/interrupt-ncurses-getch-on-incoming-signal
Regarding the wiki page: I think the change to category Console applications is also lost: https://wiki.archlinux.org/index.php/Category:Console_applications
Adding some info on the plugins would help users. In addition to the regular info, a small example to add a custom plugin (doing very basic stuff) would be great. I don't think we have a hands-on example anywhere.
Regarding Category:Console_applications
I have no idea where it is suppose to be used. Maybe it previously was listed under list of applications but someone else has removed it. I'm not the right person to determine if it should be on the list, but at least when someone adds it nnn
will show up on it too. From what I can tell it's only linked from https://wiki.archlinux.org/index.php/Table_of_contents. And the other Category:Commands
page doesn't seem permit me to add nnn
into that category (the edit button doesn't show up). I would say it's enough with the list of applications entry as the other categories are not commonly referenced.
The plugins tutorial has been added and some other minor changes to the archwiki and also added info regarding $NNNLVL
. I wouldn't mind having that text just copy pasted over to the github wiki if that's fine with you? (at least the baseline scenarios, so new instructions doesn't have to be made up)
I will also be sending you two pull requests for you to review regarding terminal resize handling.
getreadline()
(^P
and ^O
) which is a very minimal edit to the current code judging by the current testing.get_input()
, xreadline()
and filterentries()
(filterentries()
isn't finished/implemented yet but the method should be the same as for the other two). (I guess this patch even contains some bug fixes in these functions)The reason I spent effort on this is because of my tiling window manager setup. Some of my nnn
sessions will remain open for many days (or entirety of a project) and windows will frequently resize and I would rather have nnn
work throughout my session without having to restart nnn
to have it function without difficulties.
It's a bit too early to tell but I have a hunch that printprompt()
doesn't serve its purpose well, although i would ask that you leave printprompt()
untouched until I have resolved the resizing issues. Or if you also see the problem with printprompt()
I would be interested to hear your opinion, though the reasons might become more clear when you see the patches (I avoid printprompt()
in most/all places iirc and even replaced it at some points). I've got a busy week coming up therefore in might take some time until I'm publishing the results.
Anyhow I expect patch 1 to be adopted as it's not a huge change, and 2 might be up for discussion, considering it's a very unique edge case scenario that is affected, but it's at least nice to have nnn
function like a fully working program.
I would say it's enough with the list of applications entry as the other categories are not commonly referenced.
👍
I wouldn't mind having that text just copy pasted over to the github wiki if that's fine with you?
Sure thing!
I will also be sending you two pull requests
Please raise and I'll review. Please make sure you are using master to avoid tedious rebase efforts later.
The reason I spent effort on this is because of my tiling window manager setup.
That's true with many users. Than you for enhancing the use-case.
printprompt()
Ideas are welcome!
In the add your own plugins section, I think the path in 2 places should start with:
${XDG_CONFIG_HOME:-$HOME/
...
I forgot about the F2
key. Added as an undocumented key now.
printprompt()
Ideas are welcome!
I will see if I can make my patch utilize printprompt()
better. Still too busy to deal with it atm.
I will also be sending you two pull requests
Please raise and I'll review. Please make sure you are using master to avoid tedious rebase efforts later.
Yeah I always use master, but the past week has been troublesome as some of the changes I have made are now also conflicting with the changes in the current master, this will further delay my progress. But yes, I always send clean up-to-date patches. I wouldn't expect to be able to work on the patches until maybe next week or the week after.
I forgot about the
F2
key. Added as an undocumented key now.
I'm actually happy it was re-added :)
The Arch Wiki page looks cool. Does Wikipedia use the same format too?
I wouldn't be too sure on that considering Arch Wiki has some code blocks related things e.g:
{{hc|head=~/.bashrc|output
PS1=$NNNLVL $PS1
}}
And iirc wikipedia even has sourcecode highlighting etc, and the current Arch wiki page would likely not be appropriate to copy paste as is to Wikipedia as it probably goes too deep into configurating nnn
rather than just being a informative article about the product.
No, for Wikipedia it should be introductory. Whenever you find the time.
If you are on Arch Linux can you share the output of ...
?
No, for Wikipedia it should be introductory. Whenever you find the time.
Yeah, I'll see, I think wikipedia will have more strict rules to adding content, it can't be a "sensationalist" article...
If you are on Arch Linux can you share the output of
pacman -V|base32|head -1
?
My main arch machine is a bit behind but I've got other arch machines which are up to date:
My main machine yields: Pacman v5.1.1 - libalpm v11.0.1
And one of my server (updated last week I guess): Pacman v5.1.3 - libalpm v11.0.3
My nnn
install is overshadowed by a local copy which nnn
yields ~/src/nnn/nnn
essentially.
I am trying to create an account on Arch Wiki and the question is from there.
But if I paste "Pacman v5.1.3 - libalpm v11.0.3" it says the answer is wrong!
I am trying to create an account on Arch Wiki and the question (What is the output of "pacman -V|base32|head -1") is from there.
But if I paste "Pacman v5.1.3 - libalpm v11.0.3" it says the answer is wrong!
hahahahahaha That's cute. My bad I was wondering why you requested base32
while being human
...
Done! Thank you!
Made a few edits. I am thinking, would it be a good idea to retire the hacking nnn page and move the entire content to Arch Wiki?
Made a few edits. Yeah, noticed, they were nice ;)
I am thinking, would it be a good idea to retire the hacking nnn page and move the entire content to Arch Wiki?
I would argue against it. I believe the archwiki
is useful for acquiring new users but should be treated as a separate venture.
I would suggest our focus should rely on just the git repo for full documentation, meaning a something like a README.md
or something similar that lists these configuration guides. This way it is useable by anyone cloning the code.
Or possibly a github.io page could be used as a official
landing page for non-technical users.
But other than that you can rely on me trying to keep both sources up to date.
Btw, one of my bigger hacks for nnn
was actually related to my pager. I customized lesspipe.sh
to some personal preferences and used LESSOPEN
to make my pager less
use lesspipe.sh
determine how files open. So when i push p
in nnn
: lesspipe.sh
will pick a appropriate way to display the content in a CLI
. The most satisfying change from lesspipe.sh
would be that it redirects via viu
so that you can a t least see the image in the terminal. I will eventually add sixel
support to my terminal add support it from lesspipe.sh
. nnn
really becomes a very useful filemanager this way.
Anyhow I spent some time to make my personal nnn
patches easier to apply in the future so it's easier for me to keep up with master
. I will be busy for some time now but I will keep an eye out here.
I would suggest our focus should rely on just the git repo for full documentation
It was all on the landing page earlier. I had to move it to hacking nnn
because of frequent edits. Reading your comment I think I am back to my senses. ;)
Btw, one of my bigger hacks for nnn was actually related to my pager.
Wow wow wow! I need this. Can you please add this to the hacking nnn
page? Maybe a section on pager based file open
?
Btw, one of my bigger hacks for nnn was actually related to my pager.
Wow wow wow! I need this. Can you please add this to the
hacking nnn
page? Maybe a section onpager based file open
?
I added instructions for users to abuse their pager for personal benefits in the hacking nnn
wiki entry. though the instructions might not work exactly, unless they actually git clone
my repo and switch to the personal branch. Again, too busy to verify all this information atm. https://github.com/jarun/nnn/wiki/hacking-nnn#adjust-your-pager-to-view-files-better
I added instructions for users to abuse their pager
Oh, I'm sure no one would mind a little eccentricity ;)
Seems like my hiatus will be overextending a bit further than anticipated... Anyhow I wanted to check with what you think of my latest hack:
When nnn
is running within tmux
3 new keys are introduced: "
, %
and N
. They all offer the same functionality: open a new shell in the CWD that you are browsing, basically another CONTROL('G')
but without closing down nnn
. The first 2 keys will split the terminal vertical/horizontal (I believe those are tmux
default keys for vert/horiz -split ), the third one will spawn a new window and bring focus to it (c
would be the default in tmux
but c
is taken by mounting sshfs
so I figured N
should suffice).
The reason I don't push this hack any further is because my solution is tmux
dependant. and others out there could be using GNU screen
, iterm
or w/e... each of which would require their own method.
I guess I should be fair and mention tmux will let you spawn a shell with keystrokes. The problem is that but they do not respect the CWD
you are browsing... Meaning: unless nnn
changes its CWD
tmux will spawn the new shell in the origin WD
that spawned nnn
.
EDIT: regarding the tmux hack above: a simple chdir()
may be all that is needed to solve this.
Oh and another thought I had: shouldn't nnn
be displaying $NNNLVL
if you are nested within another nnn
? Since I introduced my tmux splitting I haven't been much bothered by the lack of $NNNLVL
indicators, but I remember that it was annoying. The reason I didn't patch it in myself is because I was not sure where to put the depth level indicator... Putting it at the top would mess with mouse clicks and other context
related code unless it's put right after the list of contexts...
I use dvtm nowadays. tmux appears very slow on wsl.
I think we show nnnlvl in help screen.
@0xACE For the wikipedia page, a dual-pane screenshot with dvtm would be cool. What do you think?
@0xACE For the wikipedia page, a dual-pane screenshot with dvtm would be cool. What do you think?
Heyy, absolutely though dvtm
isn't rendering correctly on my machine so I'll figure it out before I post it (I used dvtm in 2012 but it crashed too frequently, has it gotten more stable now?)
Btw I've been busy hence my silence... But another annoyance I have come by is the commit bfc8d0a7d3ea39b19b3367444f98768995eb9e32
On pc if you ever use the mouse to click on the terminal to highlight or activate the window you are likely going to end up in nav-as-you-type-mode
. I am 100% not a fan of nav-as-you-type-mode
and find it annoying*. Do you have any input on this? In my local copy of nnn
I don't mind maintaining and deactivating this feature, but I feel like on pc it's annoying that "every time you click you also have to hit ESC
"
You should know that if I were to make walkthrough video of nnn
, my workflow with my local branch is wildly different from the upstream
(the one you are working on), but most of my changes are very much a personal thing and very difficult to explain to others...
*As mentioned before when I hit /
while in filter-mode
it will go into the item if it's a directory and give another empty search filter. Like nav-as-you-type
but if you use any other key than /
it will exit to normal mode. e.g. starting nnn
in $HOME
: /src/nn/sr<ENTER>
would bring me to ~/src/nnn/src
but that final <ENTER>
key would make nnn
resume to normal mode instead of nav-as-you-type
has it gotten more stable now?
looks like that
Do you have any input on this?
This was to make toggling nav-as-you-type easier on handhelds
every time you click you also have to hit ESC
did you try clicking again (without your local changes)? It would toggle nav-as-you-type. And it's really annoying, we should try to make it Termux-only. Perhaps I didn't notice because I use a drop-down terminal.
As mentioned before when I hit /
It appears to me /
is not a valid metacharacter. Please confirm. It also can't be a valid file-name character. With this, let's discuss more in a separate thread on how to make /
a more powerful key.
You should know that if I were to make walkthrough video of nnn
If you make one, please make it from master, without your local changes
On pc if you ever use the mouse to click on the terminal to highlight or activate the window
In commit 1b340cc5f3c1e3e22e249f70e50bc1de6f17d807 I have limited this to click on last 2 rows.
has it gotten more stable now?
looks like that
Oki, I will give it a try, but I have started to like tmux
because a lot of my tools support it well.
every time you click you also have to hit ESC
did you try clicking again (without your local changes)? It would toggle nav-as-you-type. And it's really annoying, we should try to make it Termux-only. Perhaps I didn't notice because I use a drop-down terminal.
Yeah I guess I could click, but my mind as a "user" isn't smart enough to figure that out so my natural instinct is to hit "escape" (I believe I'm suppose to hit "^T" but I'm not smart enough to realise it)
As mentioned before when I hit /
It appears to me
/
is not a valid metacharacter. Please confirm. It also can't be a valid file-name character. With this, let's discuss more in a separate thread on how to make/
a more powerful key.
Yeah I detect it by ch == '/'
. The philosophy of using /
is because /
as far as I know will never appear in a file/dir name as /
is the separator for paths so I figured why not have /
as a go into directory
. I haven't decided what to do when the highlighted item is not a directory or when the search filter is empty (it could just go in if it's a dir... again this is very much a personal "experimental" hack)
You should know that if I were to make walkthrough video of nnn
If you make one, please make it from master, without your local changes
Yeah I make videos as a hobby. If I ever start publishing my videos I'll definitely make one for the master branch of nnn
. The truth would be though that it's not exactly how I use nnn
but I get your point.
On pc if you ever use the mouse to click on the terminal to highlight or activate the window
In commit 1b340cc I have limited this to click on last 2 rows.
That's great. I feel bad for pushing this because I believe it could make sense that termux behaves that way. But again, I'm not a nav-as-you-type
user... If I ever use the filter_entries()
function I rarely have to ESC
out of it, as I have added:
E
- Open file in editorP
- Open file in pagerL
- remapped to ENTER
q
- remapped to escape
(escape
key is a really far fetched key to reach for me)Q
- remapped to regular q
so you can actually search for the letter q
(only place in my directories where this is a problem is my quotes/
directory.J
- go down 1 itemK
-go up 1 itemG
- go to last item!
- open a child terminal in CWD
I guess I have a personal grudge against ^T
. I guess I'll just remove nav-as-you-type
mode in my copy because I never use it and it's annoying when it keeps going back into it.
I had this problem of using ^Y
in the beginning too, I'm not sure why ^Y
is being required to select multiple items... Today I don't mind ^Y
and have sort of grown keen to it. As I now I know I'll only ever select 1 file when I SPACE
something and if I were want to do something complicated I can ^Y
and even select from multiple directories :D.
Yeah I guess I could click
This is now limited to last 2 lines.
Yeah I detect it by ch == '/'
We'll have an elaborate discussion on a separate thread on this.
I guess I have a personal grudge against ^T
We'll see if we can have something better with /
Today I don't mind
I think it's a matter of habit. In earlier days, I had to switch keybinds often and I was regualrly using nnn too.
@0xACE here's some input for the ArchWiki page:
https://old.reddit.com/r/archlinux/comments/cjcwet/request_for_suggestions_on_nnn_archwiki_page/
The alias in the .bashrc example don't show completely.
I'll see when I can find the time for it. Since you posted it a couple of very insightful comments has appeared. I'll let the thread settle down before I meddle with it.
Regarding CTRL-G
Maybe i should first establish in the article that nnn
is very minimal and comes with a zeroed
setup so, if you want to exit out of nnn
into the current working directory you could add that bashrc alias.
In terms of configuration, I'm not exactly sure how to structure it... My personal configuration was more deeply involved in what I'd guess a average user would do... We will see how it evolves...
(I am in a rush hence my message may not make much sense)
Can you please fix the following line in the Wiki?
alias ncp="cat ~/.config/nnn/.selection | tr '\0' '\n'" # access the selected files from your terminal
It doesn't show correctly. Also. it should be:
alias ncp="cat ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection | tr '\0' '\n'" # access the selected files from your terminal
Hi, what about integrating icons like lsd does? https://github.com/Peltoche/lsd
Hi, what about integrating icons like lsd does? https://github.com/Peltoche/lsd
I guess that could be easy for DIR
, LINKS
, FIFO
FILE
, PIPE
and a couple of others im forgetting to mention but they are already indicated with /
@
|
etc... But if you are expecting symbols for specfic file types it's unlikely that will happen...
Im guessing these are the lines you want to target https://github.com/jarun/nnn/blob/master/src/nnn.c#L2324 though I wouldn't recommend it, because I dunno what the consequences are of using utf8 chars there, but you are welcome to try.
Can you please fix the following line in the Wiki?
alias ncp="cat ~/.config/nnn/.selection | tr '\0' '\n'" # access the selected files from your terminal
It doesn't show correctly. Also. it should be:
alias ncp="cat ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection | tr '\0' '\n'" # access the selected files from your terminal
I'll get that fixed now since its a smaller issue. I'm sorry im still very busy...
btw some updates im dumping here before I leave:
SEL_DUPE
: I find myself frequently wanting to backup/duplicate a file in the same directory, and I cant without going into the terminal and cp oldfile newfile
my SEL_DUPE
will basically cp oldfile oldfile.1
or cp oldfile oldfile~1
. Haven't decided how this will handle selections
and what not but I'll start with a highlighted file for now...I think i had some other notes but I can't recall them atm...
I missed this. Thanks for backing up. Yes, we are not going to package and show any icons. In addition to the indicators, I have added a patch in master which would also sort files by type. Also if you are looking for mkv files use the filter .mkv
(exact string match) and that should show you the expected results.
I'm sorry im still very busy
No problem! Thanks for fixing it. I removed the entry for a while because it was showing incorrectly and I couldn't figure out how to handle it.
nice to use when you want to upload files via the browser
Cool! We can add it to the wiki hacking nnn page.
reverse order
I use G
to jump to the bottom and scroll up for the reverse order. Let's not add a new keybind for this. We also support rolling off top and bottom. So this shouldn't be a problem.
I liked the bold fonts
The problem is it looks awesome with some fonts and the bold rendering of some fonts are pathetic. So I just kept the brightness part of it. But with your input I think I will revert this back. This relieves us of having to detect the number of supported colors too. I think most terminals have way to disable bold fonts if someone doesn't like his/her font in bold. I'll add an wiki entry as well.
SEL_DUPE
I have faced this myself. We can implement this easily with a new keybind I guess.
I missed this. Thanks for backing up. Yes, we are not going to package and show any icons. In addition to the indicators, I have added a patch in master which would also sort files by type. Also if you are looking for mkv files use the filter
.mkv
(exact string match) and that should show you the expected results.
And to clarify it for @LoafingBunny implementing it would sort of go against the design philosophy of nnn
which sort of entails KISS
and there isn't a simple and effective way to make those results accurately represent the data without significantly hogging the program down.
But fret not, eventually™ I will find some middle ground and make sixel
show some simple thumbnails for pictures and movies within nnn
and somehow not slow down everything too much. But I haven't put much thought into this other than, "oh I wish I had this", but atm I don't even have sixel
on my terminals. Also note that this will never reach upstream, again because it is in great conflict of the design philosophy.
I'm sorry im still very busy
No problem! Thanks for fixing it. I removed the entry for a while because it was showing incorrectly and I couldn't figure out how to handle it.
Yeah and also a archwiki admin or something wasn't happy with the article, saying that the article was too "self promoting". I guess we have to dial down our wording on how wonderful our cult is.
nice to use when you want to upload files via the browser
Cool! We can add it to the wiki hacking nnn page.
I have made two very shoddy scripts which we could add to the ./plugins/
instead.
nnn
's selection
. If the file exists it will simply be added, but if you add a web based file it will be downloaded to CWD
and added to the selection
, the problem is though that atm it may overwrite files if they have the same name. (Also note that the user have to clear the selection with KK
or the selection
in nnn
will not be updated if it already exists, do you have any ideas on how to streamline this experience? I echo
the results to the .selection
file)The scripts I made are of very low quality and would be in need of great improvement.
reverse order
I use
G
to jump to the bottom and scroll up for the reverse order. Let's not add a new keybind for this. We also support rolling off top and bottom. So this shouldn't be a problem.
Yeah, that's not the problem. When I sort by time: I find the problem being when there are a bunch of directories and files in one folder: I have to scroll somewhere to the middle of a huge list to find the most recent file...
I guess my workflow is wrong, but if I could reverse the order then the file I would be looking for could be reached with G
or gg
. More often than not atm the file I'm looking for is a couple of PGDN
clicks away (and when I over shoot a couple of PGUP
's too)...
I liked the bold fonts
The problem is it looks awesome with some fonts and the bold rendering of some fonts are pathetic. So I just kept the brightness part of it. But with your input I think I will revert this back. This relieves us of having to detect the number of supported colors too. I think most terminals have way to disable bold fonts if someone doesn't like his/her font in bold. I'll add an wiki entry as well.
Yeah I realised it, hence I remained quiet. But seeing as I was dumping my thoughts in here I figured it was worth bringing up. I'm glad its back upstream :D.
SEL_DUPE
I have faced this myself. We can implement this easily with a new keybind I guess.
I used { 'B', 'SEL_DUPE' }
thinking of Backup as Duplicate was taken already. But I would need input on how this feature would behave. As I stated my version will only handle 1 highlighted file. But what should happen when you select multiple files?
Here I go again, disappearing for a while poof
Yeah and also a archwiki admin or something wasn't happy with the article
It's their turf so we can't do much. I added two important characteristics now.
The scripts I made are of very low quality and would be in need of great improvement.
We can get help from @ath3 when he is back. He is great with scripts.
I guess my workflow is wrong
You need a keybind to jump to the first file in the directory. That's useful, yes.
SEL_DUPE
I'll think about it
SEL_DUPE
Instead of adding a new keybind, I am thinking of handling it the following way:
SEL_RENAME
for a single fileSEL_DUPE
Instead of adding a new keybind, I am thinking of handling it the following way:
* combine the workflow with `SEL_RENAME` for a single file
Do you mean that the user gets prompted for a new file name to copy to? So basically a prompt for cp
? Shouldn't this require a new key? Otherwise we have to prompt the user if they want to rename
or copy
* add a plugin for mass duplicate
Yeah, I would put it at a lower priority too...
Anyhow, don't stress too much about it.
Btw, my presence will be unreliable for the next few months. But I will try to keep an eye out here.
Otherwise we have to prompt the user if they want to rename or copy
Yes. That's what I am adding now.
Otherwise we have to prompt the user if they want to rename or copy
Yes. That's what I am adding now.
Alright. Not sure how I feel about it. But I will try your version out and give it an actual "field tested" review :)
I had thought of 2 workflows -
which one do you think is better? the second one keeps current workflow for rename intact but it may not be apparent to user that (s)he needs to keep the filename same to duplicate.
Rolled from #213.
Ready for next release
tar
/bsdtar
always creating tar archives (and not by suffix)NNN_OPS_PROG
renamed toNNN_CP_MV_PROG
Proposed features and tasks (up for grabs)
browse()
Anything else which would add value (please discuss in this thread).
List of completed features and tasks.