Compare commits

...

3355 Commits
v2.1 ... master

Author SHA1 Message Date
Arun Prakash Jana 0f10bd6cdc Update lock threads to latest 2024-05-24 06:32:02 +05:30
Arun e27d059552
Merge pull request #1881 from N-R-K/colemak-collision
fix collision in colemak patch
2024-05-18 05:43:44 +05:30
NRK 4f3662cf88 fix collision in colemak patch
Closes: https://github.com/jarun/nnn/issues/1876
2024-05-11 11:46:11 +00:00
Arun 9e95578c22
Merge pull request #1879 from N-R-K/use_stdio
use buffered io to reduce syscalls
2024-05-10 17:33:32 +05:30
NRK 78b9677abd use buffered io to reduce syscalls 2024-05-10 08:37:21 +00:00
Arun Prakash Jana 55137600e0
Fix #1877: use dprintf() instead of write() 2024-05-06 19:05:46 +05:30
Arun Prakash Jana be6988d1c8
Fix #1877: malloc: error pointer being freed was not allocated 2024-05-05 18:40:52 +05:30
Arun Prakash Jana 191e77ec5d
Fix CI error 2024-04-28 20:37:53 +05:30
Arun Prakash Jana 46b5255814
Add comma 2024-04-28 20:25:08 +05:30
Arun 2fb7490bf0
Merge pull request #1834 from TheUtopian/master
preview-tabbed: show sxiv/nsxiv in thumbnail mode when watching Pictures folder
2024-04-28 18:16:36 +05:30
Arun d61c983dd0
Merge pull request #1872 from N-R-K/manpage_sort
clarify au and du in manpage
2024-04-24 18:12:53 +05:30
NRK e60be2eaa2 silence new clang-tidy warnings 2024-04-24 07:31:15 +00:00
NRK 72ee94ed6e clarify au and du in manpage
Closes: https://github.com/jarun/nnn/issues/1855
Closes: https://github.com/jarun/nnn/issues/1290
Closes: https://github.com/jarun/nnn/discussions/1750
2024-04-24 06:16:00 +00:00
Oktay Imanzade b20886a29c
preview-tabbed: show (n)sxiv in thumbnail mode when watching "Pictures" directory 2024-04-18 20:18:24 +04:00
Arun ad04944bdf
Merge pull request #1865 from flipflop133/patch-1
preview-tui: add svg support
2024-04-08 18:04:00 +05:30
François Bechet 133c0d329b preview-tui: add full svg support 2024-04-08 13:55:21 +02:00
Arun 5853ac8e48
Merge pull request #1864 from horrad/master
Fix file creation on OpenBSD
2024-04-05 23:31:08 +05:30
Martin Ziemer 28d993a8e8 Fix file creation on OpenBSD
On OpenBSD at least one of O_RDONLY, O_WRONLY or O_RDWR is needed to open a file.

In creating a new file none of those is set, which leads to an EINVAL error ("invalid argument").

Since the new file is only created and never read, I chose to use O_WRONLY.
2024-04-04 15:57:36 +02:00
Arun 22aa1455a6
Merge pull request #1861 from KlzXS/makefile_icons
Prevent multiple icons options being selected at the same time
2024-03-30 01:33:20 +05:30
KlzXS 7806d5d371
Prevent multiple icons options being selected at the same time 2024-03-28 18:20:21 +01:00
Arun 5456ba4582
Merge pull request #1830 from c79cea05/master
nuke: use sort -V
2024-03-05 23:31:45 +05:30
c79cea05 297b85492f nuke: use sort -V 2024-02-23 09:21:15 +09:00
Arun Prakash Jana f71b1309a9
Fix deletion prompt when rm is used 2024-02-18 06:32:49 +05:30
Arun eb66598145
Merge pull request #1821 from KlzXS/cpmvrm_dashes
Added dashes to progress versions of cp and mv
2024-02-16 19:17:39 +05:30
KlzXS 3d6777920a
Add -- to mvg and cpg which were missed 2024-02-13 18:49:02 +01:00
Arun 4a9587a5e6
Merge pull request #1820 from KlzXS/cpmvrm_dashes
Add -- to cp, mv and rm
2024-02-13 19:45:38 +05:30
KlzXS b392dd3723
Added -- to all instances of cp, mv or rm dealing with user provided paths 2024-02-13 14:32:42 +01:00
Arun 0f62c6258a
Merge pull request #1806 from BeyondMagic/master
quitcd: fix old bug and feat. for modular export for nushell
2024-02-12 22:24:53 +05:30
João F. (BeyondMagic/koetemagie) 2a442ec30c quitcd: fix bugs and feat. for modular export and selective quit 2024-02-10 18:59:26 -03:00
Michel DHOOGE 5b05c8b9b1
fix: use a more generic way to print NUL with awk
Only gawk undestands the \0 syntax
feat(mimelist): use `mimetype` for better type detection
docs(mimelist): add author & dependencies
2024-02-09 23:14:58 +05:30
90 eb3888cb09
Add option to `rm -rf` irrespective of trash setting 2024-02-09 23:14:56 +05:30
Arun Prakash Jana 94aeaccdbd
Fix #1765: detect and ignore false mouse click 2024-02-09 23:14:49 +05:30
NRK 0738f39cf0 show relative line numbering when jumping
Co-authored-by: Darukutsu <darupeter@pm.me>
Closes: https://github.com/jarun/nnn/pull/1804
Closes: https://github.com/jarun/nnn/discussions/1708
2024-02-03 09:53:11 +00:00
Antonio Mancera Gamez e76d7bbf1d
Changed exa from grid to tree view (preview-tui) (#1803)
* Changed exa from grid to tree view (preview-tui)

* Update plugins/preview-tui

Change also eza

Co-authored-by: blissful <blissful@sunsetglow.net>

* Changed maximum depth in exa and eza

* Added fifo_pager to exa and eza

---------

Co-authored-by: blissful <blissful@sunsetglow.net>
2024-02-02 21:11:18 +05:30
Arun f2a8648861
Merge pull request #1783 from 7ocb/alternative-setenv-pwd-3
Setting PWD: set on use case, not on browse
2023-12-15 06:07:44 +05:30
Arun 82f9e544f2
Merge pull request #1782 from BeyondMagic/master
fix nushell quitcd script: remove deprecated keywords
2023-12-15 06:06:09 +05:30
me 3d2caf861d Setting PWD: set on use case, not on browse
This moves setting PWD environment variable closer to the places where child process (that needs PWD correctly set) is started instead of start it on browse.
2023-12-14 11:03:38 +03:00
João F. (BeyondMagic/koetemagie) eb775914af fix nu quitcd: remove deprecated keywords 2023-12-13 21:18:29 -03:00
Arun 5595d93d29
Merge pull request #1778 from 7ocb/set-PWD-to-current-path
Set PWD environment variable
2023-12-08 19:38:46 +05:30
Arun bb650eb9dd
Merge pull request #1775 from JefeDavis/master
feat(preview-tui): allow image previews inside tmux on kitty terminal
2023-12-08 18:21:29 +05:30
me ab718387c2 Set PWD environment variable
This is to make spawned shells and processes to see "logical" path.
2023-12-04 14:09:37 +03:00
Jeff Davis 3849430ebc feat(preview-tui): allow image previews inside tmux on kitty terminal
Signed-off-by: Jeff Davis <mr.jefedavis@gmail.com>
2023-12-03 00:51:27 -05:00
Arun f2a909dafd
Merge pull request #1770 from 7ocb/pass-path-to-abspath
When handling SEL_NEW pass `path` to `abspath` call
2023-11-25 18:36:52 +05:30
Arun 404eed5fc7
Merge pull request #1773 from 7ocb/handle-link-by-readlink-not-realpath-mk2
When handling bookmark, use readlink, not realpath
2023-11-25 18:34:01 +05:30
me 9aaf9491ad When handling bookmark, use readlink, not realpath
This is to cd to path as it pointed by symlink, not to it's real path. Bookmarked directory may itself contain symlinks in path, which should be respected.

For example: if directory is physically in /mnt/storage/some and it's symlinked to ~/some and directory ~/some/dir added to bookmarks, it's expected that when following bookmark directory will be changed to ~/some/dir (as in bookmark's link) not to /mnt/storage/some/dir (as dir real path).
2023-11-22 20:41:49 +03:00
Arun 485079d3ec
Merge pull request #1769 from N-R-K/fix-helpstr
fix buffer overflow on certain platforms
2023-11-21 22:11:12 +05:30
me bca441e00f When handling SEL_NEW pass `path` to `abspath` call
If `path` is not provided to `abspath`, later will do `getcwd`, and it's result will differ from `path`. This causes problem that when creating directory inside path reached with symlink, subsequent call to get_cwd_entry does not recognize newly created path as subpath of current path, thus not selecting newly created element.
2023-11-21 19:26:20 +03:00
NRK 60eabb6170 silence ci warning 2023-11-21 20:50:45 +06:00
NRK 3665541dac fix buffer overflow on certain platforms
the size of g_buf depends on PATH_MAX and NAME_MAX which on certain
platforms (such as mac) might not be big enough to decode the help
string. use an explicit buffer with proper size instead.

Closes: https://github.com/jarun/nnn/issues/1768
2023-11-21 19:32:00 +06:00
Arun 744a7554ef
Merge pull request #1762 from azuline/sortctx
restore sort function pointers when restoring cfg
2023-11-19 13:39:24 +05:30
blissful c0b3cc8689
factor out a `setcfg` function for setting the cfg global 2023-11-18 16:34:17 -05:00
blissful 703d349389
restore sort function pointers when restoring cfg 2023-11-17 17:45:06 -05:00
Arun Prakash Jana 9259170afd Add example: run cmd as plugin to change directory 2023-11-18 01:00:03 +05:30
Arun 2f22afcacc
Merge pull request #1755 from cronyakatsuki/alacritty
preview-tabbed: Add alacritty as xembed client for text-based preview
2023-11-17 19:08:03 +05:30
luukvbaal 4009e211f3
Merge pull request #1749 from abhinav3398/master
preview-tui: tmux sixel support for img, gif & vid preview
preview-tui: mpv kitty backend and better previewer handling
2023-11-16 15:50:08 +01:00
Luuk van Baal 3160442f0c
preview-tui: mpv kitty backend and better previewer handling 2023-11-16 15:40:03 +01:00
Abhinav Lakhani 9ff81ca1f9 preview-tui: tmux sixel support for img, gif & vid preview 2023-11-12 14:40:31 -07:00
CronyAkatsuki 8e8289373a
Add alacritty as xembed client for text-based preview 2023-11-03 12:08:09 +00:00
Arun 1051d7213d
Merge pull request #1747 from luukvbaal/master
Preview-tui avoid early exit after SIGWINCH
2023-10-18 06:53:33 +05:30
Luuk van Baal f8f6d6a482
Preview-tui avoid early exit after SIGWINCH 2023-10-11 01:20:44 +02:00
Arun 7f63bef4d6
Merge pull request #1744 from s-hamann/fix-colemak-patch
Fix colemak patch
2023-10-08 17:33:02 +05:30
black bfb46159a1
Fix colemak patch 2023-10-08 09:28:58 +02:00
Arun f3397d5ea4
Merge pull request #1741 from N-R-K/rm-colemak-dh
rm colemak-dh
2023-09-30 22:12:55 +05:30
NRK 336ec8be5d rm colemak-dh
one colemak patch ought to be enough.

Closes: https://github.com/jarun/nnn/issues/1735
2023-09-30 22:25:23 +06:00
J-Kappes afe84862ff
fix nu quitcd: switched quotes (#1737)
Closes: https://github.com/jarun/nnn/issues/1736
2023-09-30 16:19:01 +00:00
Arun 3176eaa85c
Merge pull request #1732 from N-R-K/pr-clang-tidy
Fix CI
2023-09-23 13:54:39 +05:30
NRK 4d5e29c3dd fix CI 2023-09-23 12:26:58 +06:00
NRK 6d6fc3419e split clang-tidy checks into multiple lines
makes it more readable and more easily editable. also produces better
diff when editing.
2023-09-23 12:26:29 +06:00
Arun Prakash Jana 9b921761b6
Update CI name 2023-09-23 08:21:20 +05:30
Arun 09bf8fe469
Merge pull request #1729 from azuline/eza
Add support for eza as a replacement for exa
2023-09-21 09:39:44 +05:30
blissful 3b3ad9ccc6
Add support for eza as a replacement for exa 2023-09-20 15:50:58 -04:00
Arun Prakash Jana dd07aeb703
Fix patch build errors 2023-09-20 23:41:54 +05:30
Arun Prakash Jana 9c7c7284c0
Option `-N` to use native prompt
This is useful for situations where the executable is compiled with
readline support but the user wants to use the native prompt. Often
this happens because packagers build without readline disabled.
2023-09-20 23:02:04 +05:30
Arun ba439084c5
Merge pull request #1728 from Xerillic/master
wallpaper plugin: remove unneeded code
2023-09-20 17:51:22 +05:30
Xerillic 06d8da9052 wallpaper plugin: remove unneeded code 2023-09-13 19:53:55 -04:00
Arun ed59aa2ac3
Merge pull request #1727 from Xerillic/master
wallpaper plugin: add ability to set wallpaper for specific monitors
2023-09-13 22:44:55 +05:30
umaranis a06af824ee
plugins for integration with MacOS clipboard 2023-09-13 18:01:35 +05:30
Xerillic 66447d52a7 wallpaper plugin: add ability to set wallpaper for specific monitors using nitrogen 2023-09-12 20:58:37 -04:00
Syed Umar Anis 547508aa78
fzhist plugin: add support for zsh history #1721 (#1722)
* fzhist plugin: add support for zsh history

* fzhist plugin: check $HISTFILE for history file location

* fzhist plugin: remove extra trailing spaces
2023-09-07 18:03:01 +05:30
Arun Prakash Jana d72ab3497a
Use CircleCI parallelism 2023-08-27 18:58:15 +05:30
Arun Prakash Jana 2472554e9a
Use identifiable CircleCI test name 2023-08-27 18:08:27 +05:30
Arun Prakash Jana 785dd3ddf1
Update Haiku nnn.rdef 2023-08-27 10:09:11 +05:30
Arun Prakash Jana 33126ee813
Prepare for release v4.9 Elixir 2023-08-27 09:55:13 +05:30
Arun d8c1c99e45
Merge pull request #1719 from umaranis/master
Update finder plugin find command with default path #1718
2023-08-27 09:12:40 +05:30
Syed Umar Anis b28f209c84
Update finder plugin find command with default path #1718 2023-08-27 10:00:12 +10:00
Arun 1ba85825c5
Merge pull request #1711 from quantonganh/dup-first-char-macOS
Double-width icons can cause duplicated first characters in the filename on macOS
2023-08-20 17:59:30 +05:30
Arun 66f636de13
Merge pull request #1712 from Rahlir/plugin-fzopen-fix
Fix bug in fzopen when selection is canceled
2023-08-17 05:09:19 +05:30
Tadeas Uhlir e500179188 Fix bug in fzopen when selection is canceled 2023-08-12 17:45:14 +02:00
Quan Tong d220c50773 Double-width icons can cause duplicated first characters in the filename on macOS 2023-08-11 06:54:15 +07:00
Arun Prakash Jana 186f9d01ea
Move to Ubuntu 22.04 on Circle CI 2023-08-07 06:16:34 +05:30
Arun Prakash Jana 693ba757c0
Fix #1704 - Show only selected file name if sel is preferred 2023-08-05 23:53:01 +05:30
Arun Prakash Jana 3539e5c1b1
Update help 2023-07-28 20:52:21 +05:30
Arun d65a095d9b
Merge pull request #1698 from ANtlord/young-files
Jump to the next young file
2023-07-28 20:39:29 +05:30
ANtlord dedf0554e5 Jump to the next young file
Forward jumping to the next young file is implemented. The starting
position from which the next young file is searched is the next
position. If no young file has been found, the search starts from the
beginning. It stops at the initial position where the search has
started.
2023-07-25 08:17:21 +06:00
Arun b835cfcc2a
Merge pull request #1686 from Anomalocaridid/nmount-replace-pmount
nmount: make `pmount` optional
2023-07-16 00:20:50 +05:30
Anomalocaridid 80bbf76b5b nmount: add support for luks volumes for udisksctl 2023-07-09 19:57:57 -04:00
Anomalocaridid 5723023491 nmount: update dependencies in plugins/README.md 2023-07-08 19:55:10 -04:00
Anomalocaridid 280068c5da nmount: make pmount optional 2023-07-08 19:55:07 -04:00
Arun 53e4fec75b
Merge pull request #1679 from N-R-K/ifdef_fixes
Remove some unnecessary ifdefs
2023-07-04 20:21:43 +05:30
NRK db8b61866b define _FILE_OFFSET_BITS 64 unconditionally
according to the manpage, it won't have any effect on 64bit system
anyways. and musl always uses 64bit so this macro doesn't have any
effect there either.
2023-07-01 08:56:18 +06:00
Arun 26d5b5c614
Merge pull request #1668 from N-R-K/better_compress
better and faster string compression
2023-06-16 12:14:02 +05:30
Arun 899fd5b4cf
Merge pull request #1673 from JingMatrix/master
Add djvu icon
2023-06-16 12:12:41 +05:30
JingMatrix e6ce7a614e Add djvu icon
Use paperclip as icon since it is used by DjVuLibre.
2023-06-15 16:56:51 +02:00
NRK 5e3ee08e64 fix failing colemak patches 2023-06-15 08:57:48 +06:00
NRK 4c2ce0a84d better helpstring compression
this avoids multiple printf calls and instead decodes the buffer
natively. using %NN instead of %-NNc also saves two bytes per run.
helpstr is also made `static` to avoid unnecessary stack allocation.
2023-06-15 08:49:30 +06:00
Arun 0dfc6881b4
Merge pull request #1672 from luukvbaal/preview-tui
Preview-tui add -C to NNN_PAGER
2023-06-14 16:20:15 +05:30
Luuk van Baal 05990dc9e5
Preview-tui add -C to NNN_PAGER
This makes it so that when the paged text is fewer lines than the preview pane, it is placed at the top instead of at the bottom
2023-06-14 09:24:23 +02:00
Arun fb6e7403cf
Merge pull request #1658 from N-R-K/chmod_fix
fix: properly update mode after xchmod
2023-05-27 04:44:56 +05:30
NRK b2b830e69d fix: properly update mode after xchmod
xchmod now returns the new mode through a pointer, no need to assume all
executable bits were toggled.

Closes: https://github.com/jarun/nnn/issues/1657
2023-05-26 19:31:00 +06:00
Arun 4149a2619d
Merge pull request #1655 from mistersmee/gitstatus-nerd
patches/gitstatus: Fix nerd fonts broken by 3.0.0 update
2023-05-22 18:08:39 +05:30
Aseem Athale aed2725cb3 patches/gitstatus: Fix nerd fonts broken by 3.0.0 update
Signed-off-by: Aseem Athale <athaleaseem@gmail.com>
2023-05-22 14:22:13 +05:30
Arun 04d9f6738d
Merge pull request #1650 from leo-arch/master
Fix crash when PWD is set to empty string
2023-05-19 01:57:34 +05:30
Arun e013a867da
Merge pull request #1651 from N-R-K/cp_mv
make the cp/mv modification more robust
2023-05-19 01:56:53 +05:30
Arun ed58e07a98
Merge pull request #1646 from Delgan/patch-2
Fix some broken table links in docs
2023-05-19 01:53:48 +05:30
NRK 16899bda53 make the cp/mv modification more robust
this makes it so that if the cp/mv commands are changed the in the
future, it will continue to work reliably instead of having hardcoded
indexes to modify the array.

the `#ifdef __linux__` is also removed, compilers should be smart enough
to see that PROGRESS_{CP,MV} are unused (on non-linux systems) and
optimize it out.
2023-05-15 11:29:47 +06:00
Arun 4c0305f11c
Merge pull request #1648 from N-R-K/g3_debug
Makefile: use -g3 for debug builds
2023-05-15 06:38:03 +05:30
leo-arch 4babedc3e4
Fix crash when PWD is set to empty string
nnn crashes when PWD is set to empty string: `PWD="" nnn`
2023-05-14 20:12:04 +00:00
NRK ddcf331205 Makefile: use -g3 for debug builds
-g3 builds additional information such as macro definition and so on.
2023-05-14 22:13:44 +06:00
Delgan bd4a4454fe
Fix some broken table links in docs 2023-05-13 17:25:59 +02:00
Arun aaf60b93d7
Merge pull request #1645 from Delgan/patch-1
Add "$NNN_TERMINAL_ARGS" for "preview-tui" plugin
2023-05-12 22:03:22 +05:30
Arun 145ea41490
Merge pull request #1644 from jaspwr/master
Update Haskell icon colour
2023-05-12 22:02:52 +05:30
Arun 29779acc57
Merge pull request #1643 from UnleashedMarf/iconlookup-fix
Fix syntax-error in .iconlookup
2023-05-12 21:07:29 +05:30
Delgan a7262eb4ee Allow $NNN_TERMINAL additional arguments for "preview-tui" plugin
This can be used to start terminal with a custom title and prevent focus switch with i3 window manager.
2023-05-12 15:53:45 +02:00
Jasper fb3a648756 Update Haskell icon color 2023-05-12 15:19:04 +10:00
UnleashedMarf 9be3ee9abf
Fix another typo
Co-authored-by: luukvbaal <luukvbaal@gmail.com>
2023-05-11 19:44:17 +02:00
UnleashedMarf d873eb393d
Fix syntax-error in .iconlookup
Fixed syntax-error that prevented .iconlookup from executing.
2023-05-11 18:58:11 +02:00
Arun Prakash Jana efd5bc9db1 Update docs 2023-05-06 17:56:21 +05:30
Arun 737ebaa9ef
Merge pull request #1639 from atomcult/posix-quitcd
quitcd.bash_zsh: make POSIX compliant; minor fixes and style changes
2023-05-06 08:34:31 +05:30
J. Brock 95183fbef8 quitcd.bash_zsh: make POSIX compliant; minor fixes and style changes
This commit makes the following changes to quitcd.bash_zsh:
- POSIX compliance and an according rename of the script
- Enforces consistent if-then statements and indentation
- Minor comment fixes

Signed-off-by: J. Brock <joseph.brock@protonmail.com>
2023-05-05 14:42:13 -04:00
Arun fe96bd6bc7
Merge pull request #1638 from luukvbaal/nerdfix
Update nerd-font icons to v3
2023-05-05 05:36:27 +05:30
Luuk van Baal 20e944f5e5
Update nerd-font icons to v3
This is an upstream breaking change.
Update your font to the latest version if you see missing icons.
2023-05-05 01:01:43 +02:00
Arun Prakash Jana 5d81aeb477 Filter adjustment when opening context from plugin
- Clear filter only when a plugin is selected manually.
  Plugin dir should be unfiltered when opened.
- Plugins invoked by keys don't require clearing filter
  of original context. If a new context is opened using
  the plugin, it will be unfiltered by default. If the
  same context is re-used (when all the contexts are in
  use) the filter should be cleared so the the new path
  is opened unfiltered.
2023-04-29 21:53:49 +05:30
Arun 8fd1822ca6
Merge pull request #1633 from N-R-K/assert_fix
icons-hash: replace assert with handmade version
2023-04-23 21:01:27 +05:30
NRK 20725b0b4d icons-hash: replace assert with handmade version
since 2fc9d51, the hash-table generator inherits environmental
CFLAGS and so we shouldn't disallow setting -DNDEBUG.

fixes: https://github.com/jarun/nnn/issues/1632
2023-04-22 17:08:00 +06:00
Arun 6a8d74a43a
Merge pull request #1630 from musjj/preview-tui-escape
feat(preview-tui): handle quoting in `start_preview` more robustly
2023-04-22 03:02:37 +05:30
Luuk van Baal d3b5d0e49d
perf(preview-tui): replace env for loop with parameter expansion 2023-04-21 10:39:10 +02:00
musjj 432b0755d3 feat(preview-tui): handle quoting in start_preview more robustly
This commit makes the script more resistant to naughty filenames.
The script now depends on bash for the following features:
- Arrays
Correctly creating and passing argument lists is now simple
- Parameter transformation
`${parameter@Q}` makes it easy to correctly quote a string so that it
can be safely re-evaluated by the interpreter later.

On iTerm, the shell command used to render the preview is now passed to
osascript via a named pipe: `$FIFO_OSASCRIPT`. By not embedding the
shell command directly, we now no longer need to worry about osascript's
quoting rules. It's not perfect, because $SHELL and $TMPDIR might
contain naughty characters, but it's quite unlikely to happen.
2023-04-19 08:20:41 +07:00
Arun 621dbba02e
Merge pull request #1628 from spfanning/patch-1
Support wezterm split size percentage in preview-tui
2023-04-14 18:54:22 +05:30
spfanning 63891578d7
Support wezterm split size percentage 2023-04-13 15:50:31 -05:00
Arun Prakash Jana 8a1dce888a
config option to specify archive mounter utility 2023-04-14 01:47:50 +05:30
Arun Prakash Jana 9319b638e7
Revert variety 2023-04-13 19:10:07 +05:30
Arun Prakash Jana 6dd8cf8b4d
Happy Birthday nnn!
Prepare for release v4.8 Spritz!
2023-04-13 18:37:42 +05:30
Arun 18b5371d08
Merge pull request #1621 from kianmeng/fix-typos
Fix typos
2023-04-04 21:06:08 +05:30
Kian-Meng Ang 3d1bc6e8e5 Fix typos
Found via `codespell -L noice,nd,fils,numer,caf,iterm`
2023-04-03 12:49:03 +08:00
Arun 79007074f7
Merge pull request #1619 from yoshiyoshyosh/icon-jxl
add jpeg xl icon
2023-03-29 22:09:52 +05:30
yosh 98d3b2135d add jxl icon 2023-03-28 11:44:38 -04:00
Arun a3759abd4e
Merge pull request #1616 from N-R-K/quitcd
add shell_escape() to properly escape filenames fed to shell
2023-03-28 04:28:04 +05:30
NRK 57882ffab7 add shell_escape() to properly escape filenames fed to shell
Fixes: https://github.com/jarun/nnn/issues/1615
2023-03-22 10:09:39 +06:00
Arun Prakash Jana c4678e3116 Update issue templates
Signed-off-by: Arun Prakash Jana <engineerarun@gmail.com>
2023-03-15 04:21:17 +05:30
Arun 03ae86cca4
Merge pull request #1598 from N-R-K/tilde_handling
More correct tilde handling
2023-03-10 18:15:16 +05:30
Arun 15e55f5e18
Merge pull request #1606 from mmai/patch-2
Fix paths in nushell quitcd script
2023-03-08 20:26:05 +05:30
Arun 2af79c9ad2
Merge pull request #1604 from irhl/patch-1
plugins/wallpaper: update link
2023-03-08 20:18:13 +05:30
Henri Bourcereau eaffd311d4
Fix paths in nushell quitcd script
This set the correct path to the temp nnn file when XDG_CONFIG_HOME is set. It fixes https://github.com/jarun/nnn/discussions/1605
2023-03-07 15:40:10 +01:00
NRK 003228afba add some critical comments 2023-03-05 18:43:08 +06:00
birik 8b8e3eb522
plugins/wallpaper: update link 2023-03-05 09:07:04 +00:00
Arun 9656c809d2
Merge pull request #1602 from mmai/patch-1
Create quitcd script for nushell
2023-03-02 05:09:23 +05:30
Henri Bourcereau 69882b3bff
Create quitcd script for nushell 2023-02-28 16:26:36 +01:00
NRK 3a30211e6c handle tilde more strictly in mkpath and abspath
otherwise, if a file is named "~" it will get incorrectly expanded into
$HOME and disaster can happen.
2023-02-26 18:13:26 +06:00
Arun 2a38132012
Merge pull request #1597 from amalgame21/master
Add old 1997-2003 .doc and .xls preview support
2023-02-26 07:33:57 +05:30
NRK 8dbd9da0cc convert_tilde: return whether the conversion was done or not 2023-02-25 21:15:55 +06:00
NRK a59a91c312 handle tilde more correctly
closes: https://github.com/jarun/nnn/issues/1596
2023-02-25 21:15:46 +06:00
amalgame21 1dc4c96139
Add old 1997-2003 .doc and .xls support 2023-02-25 09:52:33 +00:00
Arun 9503703517
Merge pull request #1593 from luukvbaal/preview-tui
Preview-tui hide terminated/broken pipe messages
2023-02-20 19:42:15 +05:30
Luuk van Baal 675e50c941
Preview-tui hide terminated/broken pipe messages
Fix #1583, close #1591
2023-02-19 21:55:07 +01:00
Arun a4745272db
Merge pull request #1592 from N-R-K/nmv_tmp_cleanup
nmv: ensure the tmpfile is cleaned up in all cases
2023-02-19 22:27:36 +05:30
Jacob Moena 2dc7f19be0
Added patch for colemak keyboard layout. Existing renamed to colemak-dh (#1587)
* Added patch for colemak keyboard layout. Existing renamed

to colemak-dh

* Missed two spots of O_COLEMAK

* Update check-patches.sh
2023-02-19 17:22:32 +01:00
NRK bc6a09475d nmv: ensure the tmpfile is cleaned up in all cases
currently, there's a couple exit paths where the tmpfile doesn't get
cleaned up.
2023-02-19 21:14:53 +06:00
Arun Prakash Jana b874da395c
Update copyright year 2023-02-19 08:28:20 +05:30
Arun b49cc28d80
Merge pull request #1589 from N-R-K/prefer_sel
fix shellcheck issues
2023-02-17 21:00:44 +05:30
NRK 8c23c3da4e fix shellcheck issues 2023-02-17 20:12:07 +06:00
Arun f1c85b977a
Merge pull request #1588 from N-R-K/prefer_sel
nmv: prefer selection if -u is active
2023-02-17 19:30:59 +05:30
NRK 4867fa2bc7 plugin-helper: add nnn_use_selection() 2023-02-17 19:54:36 +06:00
NRK 9cc4b66868 export NNN_PREFER_SELECTION to all plugins 2023-02-17 19:24:45 +06:00
NRK 8ad5c87107 nmv: prefer selection if -u is active
the rename plugin always asks for "selection vs current" even when -u
flag is active. pass it to the plugin via `NNN_PREFER_SELECTION` so that
there's less distracting prompts.
2023-02-17 19:22:46 +06:00
Arun 9357825b34
Merge pull request #1586 from luukvbaal/preview-tui
Preview-tui restore current working directory
2023-02-17 18:42:50 +05:30
Luuk van Baal fc26493602
Preview-tui restore current working directory 2023-02-17 03:02:01 +01:00
Arun ade477e705
Merge pull request #1585 from luukvbaal/preview-tui
Preview-tui hide wezterm split-pane output
2023-02-17 07:18:35 +05:30
Luuk van Baal 08d2ba0b5d
Preview-tui hide wezterm split-pane output 2023-02-17 01:45:17 +01:00
Arun Prakash Jana bbfb16db42
Update readme 2023-02-13 01:05:36 +05:30
Arun d7bfe38728
Merge pull request #1580 from luukvbaal/preview-tui
Preview-tui!: refactor environment variables
2023-02-12 07:58:58 +05:30
Luuk van Baal 80c07741e5
Preview-tui!: refactor environment variables
Problem:    List of environment variables is copied for each previewer.
            Environment variable names are too general.
Solution:   Parameterize environment variable flags with static list of
            variables. Prepend user-facing variables with `NNN_`.
2023-02-11 03:09:56 +01:00
Arun 3739aab578
Merge pull request #1578 from kuntau/wezterm-preview-support
feat(preview-tui): add `wezterm` support
2023-02-04 07:04:24 +05:30
Nizamuddin Sulieman 70204a2d0f
Update plugins/preview-tui
use `$WEZTERM_PANE` instead, since `$WEZTERM_UNIX_SOCKET` is not set on Linux

Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
2023-02-04 07:36:57 +08:00
Nizamuddin Sulieman 1ad6d30a36 feat(preview-tui): use built in `iTerm2` image protocol if
`NNN_PREVIEW_IMGPROG` is not specified. Add some notes.
2023-02-02 18:25:39 +08:00
Nizamuddin Sulieman 0ac8b7aa54 feat(preview-tui): add `wezterm` support 2023-02-02 16:14:56 +08:00
Arun Prakash Jana 58b77411c8
Optimize listed selection size calculation 2023-01-31 18:36:26 +05:30
Arun d0631707fc
Merge pull request #1576 from greenfoo/add_chafa
preview-tui: add chafa and PREFERRED_IMAGE_VIEWER env variable
2023-01-30 18:37:42 +05:30
Fernando Ramos c4c720a59a preview-tui: add chafa and PREFERRED_IMAGE_VIEWER env variable 2023-01-30 08:24:44 +01:00
Arun 326e76b9d0
Merge pull request #1575 from luukvbaal/colemak
Update colemak patch
2023-01-30 06:49:00 +05:30
Luuk van Baal 778d6617b1
Update colemak patch 2023-01-29 23:05:49 +01:00
Arun Prakash Jana 33827109d5
Show total size of non-filtered selected files in a directory. 2023-01-30 00:14:54 +05:30
Arun Prakash Jana 4f95796ede
Run cmd as plugin now supported exported variables 2023-01-28 10:01:46 +05:30
Arun Prakash Jana b80e047d50
Set defaults for some multiple choice prompts
Archive options: listing
Create new options: create file
Open with options: command type GUI
2023-01-28 09:50:58 +05:30
Arun Prakash Jana ad4ecb19cb
Simplify paged and GUI commands run as plugin 2023-01-28 09:16:06 +05:30
Arun Prakash Jana 03e0531e81
Place "$nnn" in double quotes in man page examples 2023-01-28 08:31:25 +05:30
Arun 786ecf9fc2
Merge pull request #1571 from KlzXS/plugin_simplification
Simplify the command as plugin codepath
2023-01-28 08:23:24 +05:30
Arun 1a5a7da8eb
Merge pull request #1570 from KlzXS/general_simplification
Second attempt at #1566
2023-01-28 08:22:52 +05:30
Arun d4575e99c8
Merge pull request #1573 from N-R-K/fix_chksum
plugins/chksum: use exit instead of return
2023-01-27 21:03:45 +05:30
NRK ca8fcf454a plugins/chksum: use exit instead of return
From https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_24:

| The return utility shall cause the shell to stop executing the current
| function or dot script. If the shell is not currently executing a
| function or dot script, the results are unspecified.

Closes: https://github.com/jarun/nnn/issues/1572
2023-01-26 01:21:40 +06:00
KlzXS 867726d870
Add debug message for bad call 2023-01-25 18:56:48 +01:00
KlzXS 7abfb77a13
Update signatures 2023-01-25 17:37:31 +01:00
KlzXS 827e84a56f
Simplify commands as plugins
Remove restrictions on $nnn

Update the plugin README
2023-01-25 17:33:15 +01:00
KlzXS 8d21e5e832
Revert using UTIL_SH_EXEC 2023-01-25 17:26:14 +01:00
Arun Prakash Jana 6b94911bc9 Revert "Simplify get_output()"
This reverts commit 6c23fdfd5f.
2023-01-16 00:19:03 +05:30
Arun Prakash Jana 653cab9dff Revert "Give better names to variables"
This reverts commit 1a2f783b75.
2023-01-16 00:18:52 +05:30
Arun Prakash Jana f9295780ef Revert "Make CI happy"
This reverts commit 8a1e32d9eb.
2023-01-16 00:18:41 +05:30
Arun Prakash Jana cac5b9ba33 Revert "Concatenate arguments to pass to `sh`"
This reverts commit 428c652d36.
2023-01-16 00:18:19 +05:30
Arun Prakash Jana df05f593de Revert "Paging is achieved through shell command now"
This reverts commit 243301603e.
2023-01-16 00:15:54 +05:30
Arun Prakash Jana 243301603e
Paging is achieved through shell command now 2023-01-15 11:46:03 +05:30
Arun f9281c8eab
Merge pull request #1566 from KlzXS/general_simplification
General simplification
2023-01-15 11:16:01 +05:30
Arun 428c652d36
Concatenate arguments to pass to `sh`
Co-authored-by: KlzXS <klzx+github@klzx.cf>
Co-authored-by: Arun Prakash Jana <engineerarun@gmail.com>
2023-01-15 10:59:36 +05:30
KlzXS 8a1e32d9eb
Make CI happy 2023-01-14 23:18:22 +01:00
KlzXS 1a2f783b75
Give better names to variables 2023-01-14 22:31:16 +01:00
KlzXS 6c23fdfd5f
Simplify get_output() 2023-01-14 22:11:10 +01:00
Arun fef3c673cd
Merge pull request #1565 from N-R-K/discussion_template
issue-template: add a section for opening a discussion
2023-01-14 18:35:59 +05:30
NRK 1887cd1a77 issue-template: add a section for opening a discussion
this should give the section more visibility.
2023-01-14 18:48:11 +06:00
Arun 12aedd521d
Merge pull request #1563 from N-R-K/macos_ci
attempt at fixing macos CI
2023-01-10 20:59:49 +05:30
NRK cf68675478 attempt at fixing macos CI 2023-01-10 14:19:00 +06:00
Arun 2b6fb3f388
Merge pull request #1559 from leovilok/tabbed-wayland-warn
preview-tabbed: warn & prevent running on Wayland
2023-01-08 06:32:50 +05:30
Léo Villeveygoux dac5fb0af9 preview-tabbed: warn & prevent running on Wayland 2023-01-07 23:19:28 +01:00
Arun Prakash Jana 789449a464 Update bug template 2023-01-06 04:24:38 +05:30
Arun fa62b08243
Merge pull request #1555 from N-R-K/icons_fix_ub
icons-hash: fix bitwise rotation
2023-01-03 04:38:26 +05:30
Arun Prakash Jana dd214c50f3
Update plugin docs and examples 2023-01-03 04:37:07 +05:30
NRK fb5b2e5e64 icons-hash: fix bitwise rotation
in case the rotation is 0, `v >> (32 - r)` would end up doing a 32 right
shift which is equal to the width of `v` and thus undefined behavior.

ref: https://blog.regehr.org/archives/1063
2023-01-03 02:20:21 +06:00
Raffaele Mancuso c9b384f009
[kdeconnect] Various improvements (#1551)
- Support multiple devices paired and available at the same time
- Filter out non-regular files
2023-01-02 22:23:47 +05:30
N-R-K 2000ed5080
icons-hash: misc improvements (#1553)
* icons-hash: take total probe count into account as well

* icons-hash: use a better PRNG

the older method was using a multiplicative congruential generator (MCG)
which doesn't work too well especially with just 32 bits of state.

change it to a PCG instead with 64 bits of state (and 32 bits of output)
which should give better results.

and since we should get better rng - the search iteration has been
halved as well to save some build time.

* icons-hash: use an xor-rotate hash function

* icons-hash: fix some compiler warnings
2023-01-02 22:23:18 +05:30
8B411 a51437ff16
Miscellaneous improvements to nmount plugin (#1547)
* plugins/nmount: keep `while` & `do` on one line for consistency

* plugins/nmount: sync only that device, which user wants to unmount

* plugins/nmount: replace all instances of `$dev` with `/dev/$dev`

* plugins/nmount: add `--no-user-interaction` option to `udisksctl`

Otherwise the user will be asked for authentication each time he wants
to unmount, say, HDD, since `udisksctl` will try to power it off.

* plugins/nmount: try to mount only existing block devices

* plugins/nmount: do not invoke `lsblk` immediately after mounting

Sometimes `lsblk` fails to provide mountpoint in such a short time frame.

* plugins/nmount: simplify pipe

* plugins/nmount: keep `echo` arguments in a single pair of quotes

* plugins/nmount: report mountpoint only if mounting was successful
2022-12-21 23:14:28 +05:30
Arun Prakash Jana e236bd0b3a
Add Discussions link to README. 2022-12-18 21:30:23 +05:30
Raffaele Mancuso 1b5cfbca3d
kdeconnect: misc improvements (#1543)
- Work with multiple connected devices by sending files to the first
  device
- Support multi-files selection
- Support sending hovered file in case no file is selected

Co-authored-by: NRK <nrk@disroot.org>
Co-authored-by: Arun Prakash Jana <engineerarun@gmail.com>
2022-12-18 21:29:52 +05:30
Arun Prakash Jana 1688b07d0e
Update readme 2022-12-16 19:54:53 +05:30
Arun 4d54490433
Merge pull request #1542 from KlzXS/archive_script
Remove unnecessary parameter from `archive_selection()`
2022-12-13 18:40:42 +05:30
KlzXS 87627a6e08
Remove unnecessary parameter from `archive_selection()` 2022-12-12 16:13:35 +01:00
Arun Prakash Jana 17ed380b57
Optimize link creation 2022-12-12 18:03:11 +05:30
Arun Prakash Jana 38d7090e64
Clear selection if all links are generated 2022-12-12 16:15:06 +05:30
Arun Prakash Jana 824e7a2c18
Show errno on link creation failure 2022-12-12 15:57:20 +05:30
Arun Prakash Jana 2e84716e76
Restore check to prevent overwriting hovered file when archiving 2022-12-12 14:45:04 +05:30
Arun Prakash Jana e8bc59a816
Improve archive, rename, new workflows
1. hover on entry created in cwd
2. check user input doesn't end with /
3. check user input len < PATH_MAX
4. support creation in ~ directory
5. handle filter mode after creation
6. ensure absolute path len < PATH_MAX
2022-12-12 10:19:53 +05:30
Arun Prakash Jana 32a6a63f44
Improve archive creation handling 2022-12-12 02:43:23 +05:30
Arun Prakash Jana cf46da60d9
Fix memory leak 2022-12-12 00:17:28 +05:30
Arun Prakash Jana 1a04e813be
Update docs 2022-12-11 10:53:16 +05:30
Arun Prakash Jana 02dec98bf8
Use built-in 2022-12-11 03:42:34 +05:30
Arun Prakash Jana 608fbb4ad7
Fix length calculation 2022-12-11 03:01:19 +05:30
Arun Prakash Jana d4c3e52f2f
Attmept to create PATH if PATH is non-existent 2022-12-11 00:03:24 +05:30
Arun Prakash Jana 93de728eab
Create files in less permissive mode 2022-12-10 22:02:22 +05:30
Arun Prakash Jana c9dbae0586
Fix build break 2022-12-10 21:43:42 +05:30
Arun Prakash Jana b6bfc740ce
Fix signed and unsigned comparison 2022-12-10 21:39:44 +05:30
Arun Prakash Jana 28ea6e0f36
Allow creating a new file on startup
An accessibe parent directory must exist to allow creation
2022-12-10 21:39:36 +05:30
Arun Prakash Jana 2a673b4eb1
Allow overwriting regular files on new empty file creation 2022-12-10 19:28:58 +05:30
Arun Prakash Jana cd145b982d
Update ToDo link 2022-12-03 07:26:26 +05:30
Arun Prakash Jana 92a0158f93
Update README 2022-11-26 09:36:07 +05:30
Arun Prakash Jana 0c234060bf
Add correct check for Wayland in clipboard plugins 2022-11-26 09:33:59 +05:30
Arun 07c5590db3
Merge pull request #1531 from sjmulder/pr/cflags
Respect CFLAGS and LDFLAGS when building generator
2022-11-25 22:24:31 +05:30
Sijmen J. Mulder 2fc9d518d1 Respect CFLAGS and LDFLAGS when building generator 2022-11-25 16:40:17 +01:00
Arun Prakash Jana 1de825b5bb
Fix #1529: fix improper piping 2022-11-25 19:48:45 +05:30
Arun Prakash Jana fbf9279973
Set rdef to development 2022-11-24 11:24:10 +05:30
Arun Prakash Jana 7330e6642b
Prepare for release v4.7 Cuba libre 2022-11-24 10:58:21 +05:30
Darukutsu 4bb7ffcd4a
plugins/upload: handle selection using ffsend 2022-11-18 21:17:02 +05:30
Arun 3359b8f7cd
Merge pull request #1516 from lgtm-migrator/codeql
Add CodeQL workflow for GitHub code scanning
2022-11-09 23:10:30 +05:30
LGTM Migrator 66fd131f2d
Add CodeQL workflow for GitHub code scanning 2022-11-09 15:46:24 +00:00
Arun a1477c2668
Merge pull request #1512 from Darukutsu/pull-requests
plugins/wallpaper: support wayland and fix indentation
2022-11-02 18:34:44 +05:30
NRK f13b527a93 plugins/wallpaper: update description 2022-11-02 05:27:57 +06:00
NRK 83c4c880cc plugins/wallpaper: fix indentation 2022-11-01 23:03:14 +06:00
daru e7abf87c54
Update wallpaper 2022-11-01 17:05:57 +01:00
Darukutsu e80ba2e44a fix plugins/wallpaper support for wayland 2022-11-01 16:40:25 +01:00
Arun 2a4231ea89
Merge pull request #1511 from N-R-K/icons_clarify
Misc icon changes
2022-10-26 17:26:32 +05:30
NRK 985f6537ce add ksh, ttf and otf icons
Co-authored-by: Tanner Babcock <babkock@protonmail.com>
2022-10-26 15:08:27 +06:00
NRK 080a061969 icons.h: fix alignment 2022-10-26 14:55:20 +06:00
NRK ff27d9ee14 clarify the goal of the default icon set 2022-10-26 14:54:07 +06:00
nblock b511506fa3
imgview: handle arguments as strings (#1509)
* imgview: handle arguments as strings

Avoids the following synax errors:
line 34: [: : integer expression expected
line 49: [: : integer expression expected

* imgview: use meaningful strings as arguments

Co-authored-by: Florian Preinstorfer <florian@nblock.org>
Co-authored-by: Luuk van Baal <luukvbaal@gmail.com>
2022-10-21 14:16:06 +02:00
Arun f89ba77516
Merge pull request #1506 from N-R-K/nsxiv_link
update nsxiv upstream link
2022-10-12 20:23:21 +05:30
Arun 0c4180f2d8
Merge pull request #1507 from N-R-K/prompt_prefill
prefill the prompt when there's a single target
2022-10-12 06:04:20 +05:30
NRK e5074ebc83 prefill the prompt when there's a single target
Fixes: #1505 #1282 #1345
2022-10-12 00:48:33 +06:00
NRK b00700ce4d fix nsxiv upstream link
main repo is hosted on codeberg, github is only a mirror.
2022-10-11 22:00:42 +06:00
Dean G 38b7282050
Add Rust icons (#1502) 2022-10-05 11:38:48 +00:00
Arun 31b83ef1f0
Merge pull request #1501 from luukvbaal/patches
Fix gitstatus patch git command
2022-10-01 21:15:48 +05:30
Luuk van Baal bc4233767a
Fix git pathspec for gitstatus patch 2022-10-01 17:06:30 +02:00
Arun Prakash Jana 59eed597c2
Fix #1498: count broken when selection is updated outside nnn 2022-09-28 00:30:26 +05:30
Arun Prakash Jana de3ad1b146
Fix build break 2022-09-19 21:36:04 +05:30
Christian Rackerseder c24ede2d4a
Fix #1486: update macOS instructions for chksum plugin 2022-09-19 20:10:51 +05:30
Arun Prakash Jana 0907895865
Add macOS instruction 2022-09-17 21:43:46 +05:30
Arun 1cefc326e3
Merge pull request #1491 from PatrickF1/patch-1
slightly improve n.fish
2022-09-16 23:28:59 +05:30
Patrick a7ce7bb36c
wrap in quotes just in case 2022-09-15 19:57:25 -07:00
Patrick c9c74dd753
make one single invocation to test 2022-09-15 18:24:04 -07:00
Patrick 3dac035819
slightly improve and optimize n.fish
The expr is redundant because `test -ge` treats strings as numbers already.
2022-09-15 17:11:34 -07:00
Arun f6edcc41b9
Merge pull request #1485 from pataquets/detect-key-collision-text
Detect key collisions: make clear everywhere that it exits afterwards.
2022-09-13 06:32:39 +05:30
pataquets 78019a758e Detect key collisions: make clear everywhere that it exits afterwards. 2022-09-12 23:04:54 +02:00
Arun 23f8c37094
Merge pull request #1480 from luukvbaal/master
Show selected items in rm msg
2022-09-09 00:40:35 +05:30
Luuk van Baal 4f57e0df37
Show selected items in rm msg
Close https://github.com/jarun/nnn/issues/1479
2022-09-08 20:07:34 +02:00
Arun Prakash Jana f56a8caf65
Use correct data type for key collision detection 2022-08-23 19:00:45 +05:30
Arun 340ba19098
Merge pull request #1461 from N-R-K/xstrdup_memcpy
xstrdup: use memcpy
2022-08-16 19:07:21 +05:30
NRK f8ee991254 xstrdup: use memcpy
the length is already known, so memcpy should be faster than xstrsncpy.
2022-08-16 19:31:18 +06:00
Arun d49ddd1331
Merge pull request #1457 from N-R-K/alignas
use standard C11 alignas
2022-08-11 16:16:31 +05:30
NRK 29a5992dee use standard C11 alignas
nnn source code already uses C11, which introduced `_Alignas` [^0] as a
standardized alternative to __attribute__((aligned)).

there are no other usage of `__attribute__` in the nnn source code, so
in theory this should make things more portable across compilers.

also removes an unnecessary usage of `alloca()` with an aligned constant
sized buffer instead.

[^0]: https://en.cppreference.com/w/c/language/_Alignas
2022-08-11 11:31:35 +06:00
Arun ad62463b48
Merge pull request #1456 from luukvbaal/preview-tui
Preview-tui fix image_preview stdout
2022-08-07 21:30:23 +05:30
Luuk van Baal 95e1d56ee4
Preview-tui fix image_preview stdout 2022-08-07 16:40:12 +02:00
Arun Prakash Jana a335f94d05
Update docs 2022-08-06 11:23:10 +05:30
Arun Prakash Jana a937bc0a4c
Update ToDo list link 2022-08-05 05:46:25 +05:30
Arun 92873352e0
Merge pull request #1453 from N-R-K/fix_manpage
fix outdated manpage
2022-08-04 21:45:20 +05:30
NRK e57bb26295 fix outdated manpage
Closes: https://github.com/jarun/nnn/issues/1452
2022-08-04 21:38:38 +06:00
Arun 7086d030f0
Merge pull request #1451 from KlzXS/list_mode_read
Improved chunk allocation logic
2022-08-03 21:27:47 +05:30
KlzXS 65dec55e23
Improved chunk allocation logic
Found memory deallocation edge case

Update and move chunk limit check

Generalize maximum size of input

Remove hard-coded values

Remove superfluous check before free

Let the kernel deal with extra data

Handle signals while reading

Conform to the manpage

Make CI happy

use `size_t` instead of `ssize_t`

`ssize_t` was used just so `--i` when `i` was zero would become -1
instead of SIZE_MAX. for looping through something in reverse order, the
"goes-to" operator (`-->`) can be used instead which doesn't require `i`
to be signed anymore.

remove useless blank line

use a normal loop

don't see any reason why freeing in reverse order would've been needed.

Co-authored-by: N-R-K <nrk@disroot.org>
2022-08-03 17:38:19 +02:00
Arun Prakash Jana ab9d8bee89
Fix #1449: ^N not working 2022-08-01 23:41:04 +05:30
Arun Prakash Jana 926c4014b3
Update colemak patch 2022-07-31 19:40:50 +05:30
Arun Prakash Jana a7ebc7858a
Key 'J' to jump to entry number or relative offset 2022-07-31 18:54:47 +05:30
Arun Prakash Jana e8acae3274
Continue listing when max files/size is exceeded 2022-07-31 12:49:42 +05:30
Arun Prakash Jana 21eebbb003
File list mode changes
- support listing maximum 16K files
- check if target directory exists before directory tree creation
  in most of the cases many files will be under the same directory
- make frequently used function 'inline'
2022-07-31 11:11:32 +05:30
Arun Prakash Jana f530b2ca18
Let ffmpegthumbnailer use embedded image metadata 2022-07-30 21:44:00 +05:30
Arun Prakash Jana e298f7eeaf
Update patches 2022-07-30 10:32:32 +05:30
Arun Prakash Jana e73b57c78a
Option -B to use bsdtar as archive tool 2022-07-29 22:35:43 +05:30
Arun Prakash Jana 49a0d9d02c
Fix typo 2022-07-29 22:18:34 +05:30
Arun Prakash Jana b76cea3a34 Revert "Patch #1386: make bsdtar the default archive handler"
This reverts commit e104b749be.
2022-07-29 22:14:00 +05:30
Arun Prakash Jana 83825a7d11
Fix rm prompt
Esc - cancels the search
y/Y - adds the force option
n/N/any other key - prompts for every file
2022-07-28 19:38:55 +05:30
Arun Prakash Jana 22db656b8d Update gitignore file 2022-07-28 18:38:54 +05:30
Arun 07c1e8e655
Merge pull request #1440 from N-R-K/fix_emoji_tar
fix emoji tar command
2022-07-26 21:09:59 +05:30
NRK 61e1356fbd fix emoji tar command
Fixes: https://github.com/jarun/nnn/pull/1356#discussion_r930094949
2022-07-26 21:37:38 +06:00
N-R-K f618b78866
Makefile: more robust generated header tracking (#1439)
give each generated header it's own unique file so that it's not
possible to try and build `O_EMOJI=1` with the generated header for
`O_NERD=1`.
2022-07-26 20:26:49 +05:30
Arun Prakash Jana f2a38b0e22
Update Haiku file 2022-07-26 20:20:04 +05:30
Arun Prakash Jana 0988268a61
Prepare for release v4.6 Absinthe 2022-07-26 19:28:44 +05:30
Tharindu Abeydeera 98287158aa
Add Elixir icon (#1437)
* Added icons for erlang, elixir and lockfile

* Lockfile icon updated

* Added colors for Erlang and elixir

* Added few more color variations and configured colors and file
extensions

* remove erlang and lock, use 1 color for elixir

Co-authored-by: Tharindu Abeydeera <tharindu.a@vizuamatix.com>
Co-authored-by: NRK <nrk@disroot.org>
2022-07-25 19:40:00 +05:30
Arun e2e1d80d58
Merge pull request #1438 from N-R-K/icons_cleanup
icons-hash: comments and cleanups
2022-07-25 19:19:25 +05:30
NRK e6b6466c49 icons-hash: comments and cleanups
adds some comments, references and cleanups. no change in functionality.
2022-07-25 18:34:36 +06:00
Arun Prakash Jana f415924c7e
Remove redundant spaces 2022-07-24 20:07:27 +05:30
Arun Prakash Jana ab0dc52c49
Add example to quick find in subtree and nuke 2022-07-24 16:20:54 +05:30
Arun f829afe60b
Merge pull request #1436 from N-R-K/icon_compaction
icons: use a compact array
2022-07-24 16:14:52 +05:30
NRK fe9c1bbb3a icons: use a compact array
a lot of the extension use the same icon. this can be exploited via
having an array with all the unique icons and then storing a single byte
index into the unique array.

when using `O_EMOJI` this results in around ~1.7KiB drop in the total
table size. `O_NERD` and `O_ICONS` get roughly ~0.5KiB savings.
2022-07-24 16:24:11 +06:00
NRK 63a254951d icons-hash: some minor cleanups 2022-07-24 16:24:11 +06:00
Arun aab5ab53a5
Merge pull request #1435 from N-R-K/icons_update
Update some icons and colors
2022-07-24 15:40:18 +05:30
NRK 12f5faa10d icons: replace double-width icons 2022-07-24 16:06:14 +06:00
NRK f1932967e2 icons: use COLOR_C for go files 2022-07-24 16:06:14 +06:00
Arun Prakash Jana 197717ce68
Enable hidden when opening a hidden file 2022-07-23 09:33:11 +05:30
Arun 117025c1a4
Merge pull request #1432 from N-R-K/icon_rework_squashed
Revise and optimize icons handling
2022-07-22 22:37:25 +05:30
Arun 0381db1875
Merge pull request #1431 from luukvbaal/preview-tui
Preview-tui improvements
2022-07-22 22:33:16 +05:30
NRK e98d9288d2 some cleanups and comments 2022-07-22 21:33:35 +06:00
NRK c3a42f0d92 make clang-tidy happy 2022-07-22 17:31:55 +06:00
NRK 3b09fd1c75 Revise and optimize icons handling
This pretty much reworks the entire icon system. Some notable changes:

* The extensions are put into a statically generated hash-table instead
  of a sorted array. We use Robin-Hood insertion to reduce the max probe
  length. Currently we need to probe only 2 slots for `O_EMOJI` and only
  3 for `O_NERD`/`O_ICONS`.
* I've opted not to use a perfect-hash since the perfect hashes
  generated by [`gperf`](https://www.gnu.org/software/gperf) used some
  huge lookup table. The hash function also wasn't as minimal as I'd
  like.
* Colors are now using X-Macros. This should speed up startup since we
  don't have to search `icons_ext` linearly to find unique colors.
* The hash-table generator outputs a more space optimized `struct
  icon_pair` using a char array instead of char pointer. This brings
  down the binary size from `145KiB` when using `O_NERD` down to
  `137KiB`.
* Some unnecessary duplication and indirection has been reduced by using
  the `ICON_STR()` macro.
2022-07-22 17:08:42 +06:00
Luuk van Baal 3fb9cc1e5a
Preview-tui improvements 2022-07-22 10:49:13 +02:00
Arun Prakash Jana d95755cce1
Use unget_wch() 2022-07-21 17:51:20 +05:30
Arun Prakash Jana 12b5416b2c
Fix #1428: handle unicode keybinds 2022-07-20 20:09:34 +05:30
Arun Prakash Jana a937265833
Reduce get_wch() array length and initialization. 2022-07-20 18:49:24 +05:30
Anomalocaridid f2c7495f50
escape call to `nnn` so `nnn` can be used as an alias to `n` 2022-07-18 18:28:18 +05:30
Arun Prakash Jana b0580905f2
Add Makefile target shellcheck 2022-07-18 18:28:16 +05:30
Arun Prakash Jana b75a22f72d
Minor improvements 2022-07-18 18:28:16 +05:30
Arun Prakash Jana b752744ca0
Show volume used information in help 2022-07-18 18:28:16 +05:30
Arun Prakash Jana db7cb4da1e
Fix double order chars on filter case match change 2022-07-18 18:28:15 +05:30
Luuk van Baal 910763441d
Fix checkpatches duplicate make 2022-07-18 18:28:15 +05:30
Arun Prakash Jana b658f324c2
Update README 2022-07-10 21:36:56 +05:30
Arun Prakash Jana 3f4efbefe4
Remove redundant check
sdfdf
2022-07-10 11:00:56 +05:30
Arun c09ac1c174
Merge pull request #1421 from luukvbaal/patches
Add colemak patch
2022-07-09 17:20:46 +05:30
Luuk van Baal a3cef1611d
Add colemak patch 2022-07-09 13:42:38 +02:00
Arun f4116a5f42
Merge pull request #1420 from CinnamonJui/patch-1
Update plugin name in Configuration section
2022-07-08 20:57:35 +05:30
Jie a7f243beed
Update plugin name in Configuration section
As the plugin was renamed from 'mocplay' to 'mocq' in 4dcefcc4d4
2022-07-08 23:25:40 +08:00
Arun Prakash Jana 8520fe5a0a
Udpate ToDO list 2022-07-01 22:28:21 +05:30
Arun a998938b9d
Merge pull request #1413 from N-R-K/patches_ci
make it easy to check for failing patches locally
2022-07-01 07:45:00 +05:30
NRK fd69fc2dca make it easy to check for failing patches locally
adds a script `check-patches.sh` to check for patch failures and also
adds a make target `checkpatches` which will invoke the check-patches
script.
2022-07-01 05:47:23 +06:00
NRK 7121a6fe43
Fix build break 2022-06-30 22:26:17 +05:30
happy wang dc2cfe78cd
add z.lua to autojump 2022-06-30 22:26:12 +05:30
Arun 96cfd3a41a
Merge pull request #1412 from N-R-K/misc_cleanups
Misc cleanups
2022-06-30 00:51:43 +05:30
NRK 0df6eebea0 fix breaking patches 2022-06-30 01:04:25 +06:00
NRK 744e9aaf70 initialize to zero instead of using memset
reduces some unncessary code. and when initializing larger objects,
compilers (gcc and clang at least) typically tend to compile it down to
a memset anyways.
2022-06-30 00:27:00 +06:00
NRK 1d347b1ce9 cfg: use designated initializer
anything not explicitly initialized will be implicitly initialized to
zero. this makes things more robust since comments are not checked by
the compiler and can be incorrect.
2022-06-30 00:26:36 +06:00
NRK 2df0cbd08b fix incorrect comment
xextension() uses xmemrchr to find '.'
2022-06-30 00:25:44 +06:00
Arun b9a1f1747f
Merge pull request #1411 from luukvbaal/preview-tui
Account for ueberzug offset in preview-tui
2022-06-29 20:59:14 +05:30
Luuk van Baal 0ab9189bc5
Account for ueberzug offset in preview-tui 2022-06-29 12:33:11 +02:00
Arun Prakash Jana 52f4ee5aee
Fix build break 2022-06-28 23:17:23 +05:30
Arun 5ace352d2c
Merge pull request #1409 from luukvbaal/preview-tui
Scale up kitty previews
2022-06-28 16:55:22 +05:30
Luuk van Baal 3e84c275ba
Scale up kitty previews 2022-06-28 12:43:35 +02:00
Arun Prakash Jana 89bd541562
Add new emoji for C files 2022-06-25 20:07:43 +05:30
Arun Prakash Jana 02d48a9144
New icons for audio and video 2022-06-25 19:59:13 +05:30
Arun c69067b502
Merge pull request #1406 from N-R-K/realpath
account for realpath failure and update link
2022-06-20 21:48:20 +05:30
NRK af5cdca043 README: update my name and link 2022-06-20 22:06:23 +06:00
NRK eb66cb5d11 account for realpath failure
realpath may fail, in which case fallback to mkpath.
2022-06-20 21:49:41 +06:00
Arun Prakash Jana 6c197f5f02
Update plugin doc 2022-06-16 23:40:05 +05:30
Arun Prakash Jana 2130e1b33a
Use the term auto-advance instead of auto-jump
There's no jump.
2022-06-15 20:04:56 +05:30
Arun Prakash Jana 0c626d49a6 Revert "Add bookmarknav patch"
This reverts commit fbd6f69f25.
2022-06-14 17:43:50 +05:30
Arun Prakash Jana d898d174f5
Fix docs, allow `/` to enable filter inside bookmarks 2022-06-14 17:36:17 +05:30
Arun Prakash Jana 581e629c20
Enable automatic dir entry on unique filer match 2022-06-14 13:49:41 +05:30
Arun Prakash Jana 56f96c3d0a
Enable filtering in plugins/bookmarks dirs
Enable auto-dir entry on filter mode
2022-06-14 13:10:54 +05:30
Arun Prakash Jana 51f2fde0e6
Revert #1398: Go to prev dir on bookmark key repeat
Reasons:

1. `b` is not a special key and will be interpreted as a filter
2. with this change pressing the standard `-` inside a symlinked
   bookmark takes back to the bookmarks directory. This deviates
   from the regular bookmarks behaviour.
2022-06-14 12:51:42 +05:30
Arun 40f75e9c38
Merge pull request #1402 from luukvbaal/selbm
Fix false positive selbm
2022-06-13 17:21:02 +05:30
Luuk van Baal 5b5a62bb0d
Fix false positive selbm 2022-06-13 04:07:40 +02:00
Arun Prakash Jana 1b31f5cf9b
Fix patch doc 2022-06-12 07:56:21 +05:30
Arun Prakash Jana 783ea754f7
Use a more visible color 2022-06-12 07:55:23 +05:30
Arun c02605a907
Merge pull request #1401 from luukvbaal/master
Add bookmarknav patch
2022-06-12 07:31:06 +05:30
Luuk van Baal fbd6f69f25
Add bookmarknav patch 2022-06-11 19:44:44 +02:00
Arun Prakash Jana 19b2ea324a
Skip redundant getutil() call 2022-06-11 21:32:16 +05:30
Arun Prakash Jana 03fc3b99c5
Add informative comment 2022-06-11 21:25:03 +05:30
Arun Prakash Jana e104b749be
Patch #1386: make bsdtar the default archive handler 2022-06-11 15:09:40 +05:30
Arun Prakash Jana 8fb7feb61c
Add new icon colors for mp4 and flac formats 2022-06-11 07:34:59 +05:30
Arun Prakash Jana 49f21ae013
Fix segfault when last dir is not set 2022-06-11 06:05:57 +05:30
Göran Gustafsson 4baee859f8
Go to last dir on bookmark key repeat 2022-06-10 21:18:02 +05:30
Arun Prakash Jana de004d944e
Fix #1385: document internal files in 'plugins' dir 2022-06-10 21:00:06 +05:30
Arun 4784587024
Merge pull request #1394 from luukvbaal/explorer
Disable e on explorer mode
2022-06-09 02:26:27 +05:30
Luuk van Baal 6fc8f63c0d
Disable e on explorer mode 2022-06-08 21:01:03 +02:00
Arun 88306e2d9c
Merge pull request #1391 from ggustafsson/feat/usage-stdout-fix
Print usage info to stdout instead of stderr
2022-06-08 02:54:27 +05:30
Arun 4c6c06b743
Merge pull request #1389 from ggustafsson/feat/bsd-stat-x-fix
Use -x flag with BSD stat
2022-06-08 01:38:53 +05:30
Göran Gustafsson 5023abe2df Print usage info to stdout instead of stderr 2022-06-07 20:33:05 +02:00
Göran Gustafsson 93db9bb2be Use -x flag with BSD stat 2022-06-05 22:13:23 +02:00
Arun 46a5092eee
Merge pull request #1384 from N-R-K/fix_sizeof
fix incorrect usage of sizeof
2022-06-02 21:44:52 +05:30
NRK 5ae3891ee5 fix incorrect usage of sizeof
`sizeof(cmd)` here would give the sizeof a char pointer, not the sizeof
the cp/mv array.
2022-06-02 15:44:31 +06:00
Arun 01ab453cff
Merge pull request #1380 from luukvbaal/master
Update patch conflict instructions/workflow
2022-05-31 16:36:23 +05:30
Luuk van Baal 3072aa7891
Update patch conflict instructions/workflow 2022-05-31 11:07:31 +02:00
Arun 0499998e2a
Merge pull request #1379 from luukvbaal/master
Move patch ci to ubuntu
2022-05-30 23:29:46 +05:30
Luuk van Baal bb604bdf1d
Move patch ci to ubuntu 2022-05-30 19:45:28 +02:00
Arun Prakash Jana a70ad9c480
Update doc 2022-05-30 22:31:24 +05:30
Arun Prakash Jana 10e2d37d0f Revert "Enter type-to-nav for bookmarks dir"
This reverts commit 8cdeddeb4a.
2022-05-30 22:20:45 +05:30
Arun Prakash Jana 85be28c019 Revert "Fix reverting filtermode on empty directory"
This reverts commit 4337214f50.
2022-05-30 22:19:41 +05:30
Arun d859e81444
Merge pull request #1377 from luukvbaal/patches
Add patch conflict instructions
2022-05-30 22:12:30 +05:30
Arun 33ec6dece4
Merge pull request #1376 from N-R-K/patches_ci
Improve patches ci
2022-05-30 22:11:43 +05:30
Luuk van Baal 4c974f286c
Add patch conflict instructions 2022-05-30 14:43:59 +02:00
N-R-K 1e98e2e126 improve patch conflict ci script
goes through all different combinations automatically and makes adding
another patch easier by simply putting the name into the patches array.
2022-05-30 17:43:41 +06:00
Arun f8b8e77be9
Merge pull request #1375 from luukvbaal/master
Add patch conflict workflow
2022-05-30 06:22:23 +05:30
Luuk van Baal 0095948d8d
Add patch conflict workflow 2022-05-30 01:01:46 +02:00
Arun Prakash Jana d618922177
Get rid of rundir 2022-05-29 22:32:54 +05:30
Arun Prakash Jana 4337214f50
Fix reverting filtermode on empty directory 2022-05-29 20:17:55 +05:30
Arun Prakash Jana 31a273fdd0
Fix build break 2022-05-29 20:09:33 +05:30
Arun c2a2a9dee7
Merge pull request #1373 from luukvbaal/bmnav
Enter type-to-nav for bookmarks dir
2022-05-29 19:37:33 +05:30
Luuk van Baal 8cdeddeb4a
Enter type-to-nav for bookmarks dir 2022-05-29 13:55:15 +02:00
Arun 772fd30fa0
Merge pull request #1372 from luukvbaal/patches
Fix restorepreview patch conflict
2022-05-29 14:12:44 +05:30
Luuk van Baal ae36d30b66
Fix restorepreview patch conflict 2022-05-29 01:32:07 +02:00
Arun Prakash Jana 14e80c3872
Update docs 2022-05-28 23:59:11 +05:30
Arun Prakash Jana 8175571952
Clear runtime states 2022-05-28 23:30:56 +05:30
Arun Prakash Jana 3a50be93fd
Fix #1369: limit symlinked bookmarks to bookmarks dir 2022-05-28 23:14:07 +05:30
Arun Prakash Jana ec7692bb9e
Update man page. 2022-05-28 06:20:57 +05:30
Arun e4c2cb9fd4
Merge pull request #1371 from dnbz/master
Fix a broken link in CONTRIBUTING.md
2022-05-28 05:57:18 +05:30
Arun Prakash Jana 8d83af811f
Fix #1369: open target of symlinked bookmark 2022-05-28 05:54:55 +05:30
Dan Baz ef5d90f4bb
Fix a broken link in CONTRIBUTING.md 2022-05-28 00:17:15 +00:00
Arun Prakash Jana ec076f5886
FIx alignment 2022-05-26 02:36:59 +05:30
Arun 81f96ecc1e
Merge pull request #1366 from jarun/preview-tui-kitty
Improve preview-tui kitty documentation
2022-05-23 21:14:36 +05:30
luukvbaal ed7afd2dd1
Improve preview-tui kitty documentation 2022-05-23 17:25:19 +02:00
Arun ab8505efa4
Merge pull request #1364 from cain-dev/patch-1
Reference dependency needed for kitty preview
2022-05-14 06:36:07 +05:30
cain-dev b3f16e7671
Reference dependency needed for kitty preview 2022-05-13 16:41:42 -03:00
Arun Prakash Jana f6783c2065
Emoji changes 2022-05-13 04:44:27 +05:30
Arun a3fbda02d7
Merge pull request #1363 from N-R-K/alloc_check
check for some alloc failures
2022-05-12 18:05:53 +05:30
NRK ba72fca69a check for some alloc failures 2022-05-12 18:26:48 +06:00
Arun e1e47f909f
Merge pull request #1361 from N-R-K/headers_makefile
add headers as make dependancy
2022-05-12 16:36:11 +05:30
NRK 6f332e5260 add headers as make dependancy 2022-05-12 00:32:10 +06:00
Arun Prakash Jana c23125ba50
Change some emojis 2022-05-11 21:40:23 +05:30
Arun Prakash Jana 0a67c5d657
Use correct Emojis for arrows 2022-05-11 01:54:54 +05:30
Arun Prakash Jana af94c7704f
Remove redundant Emojis 2022-05-11 00:56:25 +05:30
Desmond Kabus b45be9bc5b
Add build option EMOJI for Unicode emoji as file icons 2022-05-10 20:31:11 +05:30
Arun Prakash Jana 18a6a010cf
Fix #1355: interpret suffix `$nnn` when paging 2022-05-10 19:46:19 +05:30
Patrick 4ddd048feb
.cbcp plugin: output a more useful error message 2022-04-30 14:44:11 +05:30
Arun Prakash Jana fd998b3045
Post-release formalities. 2022-04-26 19:03:04 +05:30
Arun Prakash Jana 3f58f6111c Prepare for release v4.5 Cachaça 2022-04-26 18:34:24 +05:30
Arun 4366247441
Merge pull request #1347 from luukvbaal/patches
Fix patch conflicts and rebase
2022-04-26 18:33:05 +05:30
Luuk van Baal 7793cb8b5c
Fix patch conflicts and rebase 2022-04-26 14:54:27 +02:00
Arun Prakash Jana cc965d1c2d
Use bold forward arrowhead for current 2022-04-26 04:26:01 +05:30
Arun Prakash Jana dc16ca2340
Add 2 spaces after icons for better visibility 2022-04-26 03:59:12 +05:30
Arun Prakash Jana 6b9f8f3666
Fix #1345: allow symlink name '@' in single file case 2022-04-20 20:20:25 +05:30
Arun 15243186c5
Merge pull request #1344 from SlIdE42/patch-1
quitcd script for Elvish shell > 0.17.0
2022-04-17 17:05:26 +05:30
SlIdE42 0812c7afac
quitcd script for Elvish shell > 0.17.0 2022-04-17 13:29:51 +02:00
Arun Prakash Jana be4460c1da
Handle broken window if started in type-to-nav 2022-04-16 18:48:52 +05:30
Arun Prakash Jana eb42f7a948
Bind ^J with toggle auto-jump on open 2022-04-16 18:04:09 +05:30
Arun Prakash Jana 2c5cb4c5aa
Replace ^J with + to (un)select
^J has been reported as out of place several times.
As `+` is used as the seleciton marker, it makes more sense.
2022-04-16 17:04:53 +05:30
Arun a555a7d122
Merge pull request #1342 from N-R-K/use_elements
consistently use ELEMENTS macro
2022-04-14 06:26:16 +05:30
NRK d0bf2abb37 consistently use ELEMENTS macro
+ some small white-space fixes
2022-04-12 22:30:22 +06:00
Arun 59cf883437
Merge pull request #1338 from JingMatrix/fix-gsconnect
Allow gsconnect to handle multiple devices
2022-04-09 16:56:30 +05:30
JingMatrix 5bc75ef4fd Allow gsconnect to handle multiple devices
When gsconnect is connected to multiple devices, the original
script won't work. Now the code will share files to all devices.
2022-04-09 11:42:31 +02:00
Arun bb875cd5e7
Merge pull request #1337 from pcapriotti/pcapriotti/quit-on-cd-docs
Clarify docs in the quit-on-cd wrapper
2022-04-07 06:26:12 +05:30
Paolo Capriotti 4220f4e2eb Clarify docs in the quit-on-cd wrapper 2022-04-06 17:28:12 +02:00
Arun Prakash Jana d66492ac10 Show reverse timestamp for young entries
Show timestamps for entries modified/created within 5 minutes in
reverse.

Signed-off-by: Arun Prakash Jana <engineerarun@gmail.com>
2022-04-02 10:15:14 +05:30
Arun Prakash Jana 88e9122c79
opener improvements
- show file name
- open hovered if none selected
- open and exit if only one file selected
- code improvements
2022-04-01 09:00:51 +05:30
Arun Prakash Jana 5745597fd5
Fix #1333: plugin openall to open selection 2022-03-31 19:29:30 +05:30
Arun 0a7742089a
Merge pull request #1331 from JingMatrix/master
Preview for djvu files
2022-03-26 04:02:44 +05:30
JingMatrix 0a59005acd Preview for djvu files 2022-03-25 17:21:11 +01:00
Arun 81226db24e
Merge pull request #1330 from N-R-K/prompt_clearsel
native prompt: clear selection on successful operation
2022-03-24 03:05:47 +05:30
NRK 72ecf6c4b8 native prompt: clear selection on successful operation
have been using the %j substitution for a bit now, it's quite nice :)
but it's also quite annoying when doing something like

	mv "%j" ./

in this case, the files have been moved but the selection is incorrectly
points to them.

when there's a successful operation made on the selection via the native
prompt, it makes sense to clear the selection.
2022-03-24 00:23:38 +06:00
Arun 675016eb55
Merge pull request #1329 from N-R-K/avoid_malloc
avoid unnessary heap allocation
2022-03-23 21:03:31 +05:30
NRK 9be6c1a5e2 avoid unnessary heap allocation
the binary size shouldn't change since it'll most likely go into the bss
section.
2022-03-22 17:50:54 +06:00
Arun Prakash Jana d38841d5f3
Support n/N to cancel forced rm 2022-03-13 12:37:50 +05:30
Arun 136549b1ba
Merge pull request #1321 from N-R-K/preview_tui_debug
preview-tui: make debugging easier
2022-03-10 22:52:46 +05:30
NRK c3534bd7e0 preview-tui: make debugging easier
i've noticed that there's a non-trival amount of issues user face
related to preview-tui. allowing all the null redirection to be easily
switched on/off can make debugging much easier, both for the users and
for us.
2022-03-09 01:48:13 +06:00
Arun Prakash Jana 57d212c3ca
Fix entry order 2022-02-27 02:06:24 +05:30
Arun Prakash Jana 66639c6053
Fix #1312 2022-02-27 01:44:30 +05:30
Arun b718d6d305
Merge pull request #1314 from Darukutsu/master
Added a user-script/plugin to send selected files using GSConnect.
2022-02-23 21:11:22 +05:30
Arun 994bc80e82
Merge pull request #1315 from N-R-K/include-hidden
export NNN_INCLUDE_HIDDEN to plugins
2022-02-23 21:08:12 +05:30
daru 633a9ca8e1 Update plugins/gsconnect
Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com>
2022-02-22 22:19:44 +06:00
daru d1de515532 Update plugins/gsconnect
Co-authored-by: N-R-K <79544946+N-R-K@users.noreply.github.com>
2022-02-22 22:19:44 +06:00
Darukutsu cd2445607b workaround with xargs -0
added hover over file to send
2022-02-22 22:19:44 +06:00
Darukutsu 83b6d6aff7 Added a user-script/plugin to send selected files using GSConnect. 2022-02-22 22:19:44 +06:00
NRK 2fedc92efc export NNN_INCLUDE_HIDDEN to plugins
Closes: https://github.com/jarun/nnn/issues/1308
2022-02-22 17:40:44 +06:00
Arun Prakash Jana 953643b9f1
Fix condition 2022-02-21 02:01:03 +05:30
Arun 816680ed01
Merge pull request #1313 from N-R-K/dragon_name
dragdrop: use "dragon-drop" if it exists
2022-02-20 14:22:34 +05:30
NRK a8e9d279ac dragdrop: use "dragon-drop" if it exists
to avoid name conflict some distros renamed dragon to `dragon-drop`
https://github.com/mwh/dragon/issues/17#issuecomment-889878960
2022-02-20 14:41:37 +06:00
Arun cb410e25d8
Merge pull request #1307 from N-R-K/fd_leak
don't leak inotify_fd to plugins
2022-02-15 19:48:53 +05:30
NRK 799b8fd378 don't leak inotify_fd to plugins
Closes: https://github.com/jarun/nnn/issues/1291

Co-authored-by: Daniel Eklöf <daniel@ekloef.se>
2022-02-15 19:05:58 +06:00
Arun 30bd6a4e33
Merge pull request #1306 from KlzXS/nmv_trash
Respect NNN_TRASH in .nmv
2022-02-14 07:17:49 +05:30
KlzXS 184f134c9e
Respect NNN_TRASH in .nmv 2022-02-13 10:37:21 +01:00
Arun Prakash Jana 23b54ba0cf
Open previous active context on context quit 2022-02-06 00:23:45 +05:30
Arun 866612bfda
Merge pull request #1302 from N-R-K/makefile_rebuild
rebuild if Makefile changes
2022-02-04 08:57:40 +05:30
NRK ff1c1eb2e1 rebuild if Makefile changes 2022-02-03 22:20:55 +06:00
Arun fbb2172627
Merge pull request #1300 from N-R-K/rsynccp_fix
[rsynccp & fzcd]: avoid using non-portable xargs flag
2022-02-01 18:28:41 +05:30
NRK 24db74fd7b fzcd: avoid using non-portable xargs flag 2022-02-01 18:00:20 +06:00
NRK ffd0468f67 rsynccp: avoid using non-portable flags
Closes: https://github.com/jarun/nnn/issues/1299
2022-02-01 16:29:40 +06:00
Arun Prakash Jana e67587204b
Update ToDo list link 2022-01-23 20:55:16 +05:30
Arun Prakash Jana aa2147f3ef
make option O_NOSORT to disable sort on dir load 2022-01-23 10:52:33 +05:30
Arun Prakash Jana e140e34483
Disable filterinfo if file details enabled 2022-01-22 21:06:57 +05:30
Arun Prakash Jana fe4ea8a029
Update copyright date 2022-01-22 16:02:51 +05:30
Arun bfa2d4fce5
Merge pull request #1289 from luukvbaal/preview-tui
Preview-tui support windows terminal split
2022-01-18 00:22:11 +05:30
Luuk van Baal ecad3e0524
Preview-tui support windows terminal split
Co-authored-by: WanderLanz
2022-01-17 14:20:27 +01:00
Arun b8b0bab426
Merge pull request #1288 from Anomalocaridid/fix-nuke-imv
add support for imv when named imv in nuke
2022-01-09 16:16:37 +05:30
Arun 9c6ce560f1
Merge pull request #1287 from lawnowner/master
Remove trailing blanks to assure .desktop suffix for xdg-mime.
2022-01-09 16:15:52 +05:30
Anomalocaridid efa960d022 add support for imv when named imv in nuke 2022-01-08 16:21:49 -05:00
lwnctd 49aa4dabf1 Remove trailing blanks to assure .desktop suffix for xdg-mime. 2022-01-08 05:34:20 +03:00
Arun 2eadf35fa0
Merge pull request #1277 from N-R-K/webp_icon
add webp icon
2021-12-26 17:33:46 +05:30
NRK 04181084c0 add webp icon 2021-12-26 14:43:18 +06:00
Arun dcf3a35cd5
Merge pull request #1276 from N-R-K/bookmark_doc
add bookmark section to the manpage
2021-12-26 11:56:53 +05:30
NRK e2b856904d add bookmark section to the manpage 2021-12-26 11:07:18 +06:00
Arun Prakash Jana 693df568e0 Document symlinked bookmarks in the manpage 2021-12-26 09:58:34 +05:30
Arun 3368a7905b
Merge pull request #1275 from N-R-K/pedantic_cleanups
Pedantic cleanups
2021-12-25 22:36:13 +05:30
NRK 02d6feb9b9 check bound before making access 2021-12-25 12:47:48 +06:00
NRK 1608c8763f avoid having function with unspecified arguments 2021-12-25 12:47:33 +06:00
NRK 78c0d54400 avoid doing arithmetic on void pointer 2021-12-25 12:47:24 +06:00
Arun e44f8d3fcc
Merge pull request #1270 from N-R-K/doc_improvement
Make the manpage more clear
2021-12-25 08:17:45 +05:30
Arun 282266705e
Merge branch 'master' into doc_improvement 2021-12-25 08:17:34 +05:30
Patrick fe0608116a
introduce new plugin for jumping git root 2021-12-25 08:13:43 +05:30
Arun Prakash Jana 0fb7a25612
Use terms consistent with man page in docs 2021-12-25 08:13:41 +05:30
Arun Prakash Jana b69f838fb8
Update bug report template 2021-12-25 08:13:40 +05:30
Luuk van Baal beafeaaea2
Preview-tui fix gif conversion 2021-12-25 08:13:40 +05:30
Luuk van Baal a3d660b673
Preview-tui fix gif whitespace name 2021-12-25 08:13:39 +05:30
NRK ac86fbed0f
add icon for opus files 2021-12-25 08:13:39 +05:30
Luuk van Baal 48bcc929e8
Restorepreview when launching subshell 2021-12-25 08:13:39 +05:30
Luuk van Baal 06bf4f5dce
Replace restorepreview workaround 2021-12-25 08:13:38 +05:30
KlzXS 3be2dd8390
Remove -E from sed in plugins 2021-12-25 08:13:35 +05:30
NRK ce58aab6b2 slight reword 2021-12-25 08:39:29 +06:00
NRK 62f1004836 upadte the source code according to the docs 2021-12-25 08:37:28 +06:00
NRK d215a9c61d -A doc: change auto-select to auto-enter 2021-12-25 08:35:23 +06:00
NRK c234c05b3d clarify '+' keybinding in type-to-nav mode 2021-12-25 08:35:23 +06:00
NRK f7298efa99 reword 'select' -> 'selection' 2021-12-25 08:35:23 +06:00
NRK 9a26739132 fix plugin requirement 2021-12-25 08:35:23 +06:00
NRK 23edf571a7 make the manpage more clear
some of the terms used in the manpage aren't exactly obvious, especially
to a new user. this is an attempt at making the manual more clear and
remove any potential confusion.

here's a couple issues i've noticed where users were confused due to non
clear manpage description:

https://github.com/jarun/nnn/issues/1268
https://github.com/jarun/nnn/issues/1269
https://github.com/jarun/nnn/issues/1209
2021-12-25 08:35:23 +06:00
Arun Prakash Jana 892e4c0082
Use terms consistent with man page in docs 2021-12-25 08:02:27 +05:30
Arun Prakash Jana bd6e7e8147
Update bug report template 2021-12-20 11:56:54 +05:30
Arun ecfe819a73
Merge pull request #1267 from luukvbaal/preview-tui
Preview-tui fix gif conversion
2021-12-20 10:16:23 +05:30
Luuk van Baal b851b58e83
Preview-tui fix gif conversion 2021-12-20 02:39:10 +01:00
Arun 2c31615256
Merge pull request #1263 from luukvbaal/preview-tui
Preview-tui fix gif whitespace name
2021-12-19 03:13:25 +05:30
Luuk van Baal 95f709f86a
Preview-tui fix gif whitespace name 2021-12-18 22:34:24 +01:00
Arun a1b15eb766
Merge pull request #1258 from N-R-K/opus_icon
add icon for opus files
2021-12-17 17:46:59 +05:30
Arun 48e478bb90
Merge pull request #1257 from luukvbaal/patches
Restorepreview patch improvements
2021-12-17 17:46:33 +05:30
Luuk van Baal 8ba43edffc
Restorepreview when launching subshell 2021-12-17 12:41:29 +01:00
NRK 7aef60a9d5 add icon for opus files 2021-12-15 00:45:58 +06:00
Luuk van Baal e0c1ed273f
Replace restorepreview workaround 2021-12-14 17:16:56 +01:00
Arun 40b2250209
Merge pull request #1247 from KlzXS/posix_sed
Remove -E from sed in plugins
2021-11-28 06:45:30 +05:30
Arun eb62775852
Merge pull request #1248 from yeetologist/master
Fix zsh auto-completion typo
2021-11-27 15:43:27 +05:30
yeetologist c147414bc7 Fix zsh auto-completion typo 2021-11-27 11:57:45 +07:00
Arun Prakash Jana 1e8b8d14ff
Remove redundant line 2021-11-27 09:48:21 +05:30
KlzXS 8f2e17303e
Remove -E from sed in plugins 2021-11-26 10:33:11 +01:00
Arun 1bc234b0eb
Merge pull request #1244 from N-R-K/malloc_size
fix the malloc size in get_archive_cmd
2021-11-24 22:48:02 +05:30
NRK bd8faa2dd8 use patterns[] for archive command string 2021-11-24 22:34:22 +06:00
NRK 578e6d1aaa use a macro for the format string
this makes things slightly more robust as changing the string inside the
macro would automatically change the malloc size.
2021-11-24 22:06:05 +06:00
NRK f7091f78e5 fix the malloc size in get_archive_cmd
since the tr hack was removed in deead97, the format string is no longer
70 chars. also removes unnecessary malloc casting.
2021-11-24 21:53:11 +06:00
Arun c87b67e073
Merge pull request #1243 from omar-polo/sed-misc
misc sed tweaks
2021-11-24 18:25:13 +05:30
Omar Polo fb3d3ab0ef define SED only if not already defined
This allows packagers to set a custom path for sed (gsed may be simply
called `gsed' or `gnu-sed' or ...)
2021-11-24 11:44:50 +01:00
Omar Polo deead97e23 drop unnecessary ifdef __linux__
since nnn requires gsed anyway, why don't use it?
Probably forgot in #1210
2021-11-24 11:40:59 +01:00
Arun Prakash Jana 8ec2fe7f81
Set Haiku variety to dev 2021-11-23 18:58:43 +05:30
Arun Prakash Jana 65eddfe7b9
Prepare for release v4.4 Tequila 2021-11-23 18:33:45 +05:30
Arun 2f986253e4
Merge pull request #1241 from luukvbaal/master
Guard open_with getreadline for picker
2021-11-23 18:17:13 +05:30
Luuk van Baal 1a6d54515b Guard open_with getreadline with for picker
fix luukvbaal/nnn.nvim#25
2021-11-23 13:11:42 +01:00
Arun 256f0d008f
Merge pull request #1240 from KlzXS/percent_j
Enforce %J only at the end of command
2021-11-16 22:38:32 +05:30
KlzXS ca9b5e04c7
Enforce %J only at the end of command
Also removes double shell
2021-11-16 00:44:44 +01:00
Arun f3df0816d9
Merge pull request #1239 from tonijarjour/patch-1
n/sxiv play gifs automatically from tabbed
2021-11-15 19:06:54 +05:30
Toni Jarjour 8755a3c0cf
n/sxiv play gifs automatically from tabbed 2021-11-14 20:56:32 -05:00
Arun Prakash Jana f66183937d
More frequent interrupt handling during du
The check is done when traversing directories in preorder i.e before the files
inside are enumerated. Postorder traversal is unwinding, so mostly we are done
with the calculation and finishing off the thread.
2021-11-15 01:11:46 +05:30
Arun 6178be7e06
Merge pull request #1235 from luukvbaal/preview-tui
Preview-tui pass pts device in env variable
2021-11-13 01:00:26 +05:30
Luuk van Baal 84bfbcf4e7 Preview-tui pass pts device in env variable 2021-11-12 13:57:27 +01:00
Arun 9cb0a13ffe
Merge pull request #1234 from luukvbaal/preview-tui
Preview-tui ensure pts device for tput in subshell
2021-11-12 07:59:10 +05:30
Luuk van Baal e94f90c89a Preview-tui ensure pts device for tput in subshell 2021-11-11 17:35:10 +01:00
Arun 8b7feff4b6
Merge pull request #1232 from KlzXS/nmv_list_env
Env variable should be not set, not set to 0
2021-11-11 06:06:37 +05:30
Arun bd7f127ad9
Merge pull request #1231 from luukvbaal/preview-tui
Preview-tui workaround for ncurses tput regression
2021-11-11 06:05:35 +05:30
Arun fec0479da3
Merge pull request #1230 from N-R-K/nsxiv_support
add nsxiv support to nuke, preview-tabbed and imgview
2021-11-11 06:00:23 +05:30
KlzXS 875a4d8c23
-n exists for a reason 2021-11-10 21:56:51 +01:00
KlzXS a300e3267f
Env variable should be not set, not set to 0 2021-11-10 21:51:05 +01:00
Luuk van Baal 0d657b47b9 Preview-tui workaround for ncurses tput regression 2021-11-10 19:22:41 +01:00
NRK 39a3cc5309 add nsxiv support to nuke, preview-tabbed and imgview
`nuke` and `preview-tabbed` works as expected. I would assume `imgview`
should work as expected as well since `nsxiv` (at the moment at least)
is a drop-in replacement for sxiv, but I haven't tested it.

Closes: https://github.com/jarun/nnn/issues/1229
2021-11-10 22:46:45 +06:00
Arun c9b9c14481
Merge pull request #1227 from luukvbaal/patches
Fix restorepreview patch conflict
2021-11-09 15:35:01 +00:00
Arun 182ac51b8d
Merge pull request #1226 from luukvbaal/preview-tui
Proper fix for preview-tui zombie-pane
2021-11-09 15:34:28 +00:00
Luuk van Baal 66dfa60465 Fix restorepreview patch conflict 2021-11-09 14:52:45 +01:00
Luuk van Baal 26f380f154 Proper fix for preview-tui zombie-pane 2021-11-09 14:33:52 +01:00
KlzXS 48415c5e1c
Revert "malloc() mem those persist through program runtime"
This reverts commit b84ad2d552.
2021-11-08 15:08:12 +01:00
Arun 1508874b5a
Merge pull request #1224 from KlzXS/nmv_list_current
Updated .nmv to support current when NNN_LIST
2021-11-08 13:34:39 +00:00
Arun e686b94f7e
Merge pull request #1223 from akrifari/fix-invisible-description
Fix invisible description
2021-11-08 13:33:20 +00:00
KlzXS 22096ee0cd
Updated .nmv to support current when NNN_LIST
NNN_LIST now should pass listroo
2021-11-07 22:08:43 +01:00
Krisan Alifari eff4bd6e67 Fix invisible description 2021-11-07 13:00:06 +07:00
Arun f854b3c748
Merge pull request #1220 from luukvbaal/patches
Add nerd icons to gitstatus patch
2021-11-06 06:12:13 +05:30
Luuk van Baal 1621c0303b Add nerd icons to gitstatus patch 2021-11-05 17:01:56 +01:00
Arun Prakash Jana b84ad2d552
malloc() mem those persist through program runtime
At exit, the OS should reclaim all the memory, so no explicit free() required.
2021-11-05 07:59:40 +05:30
Arun Prakash Jana 07a47db8fe
Update ToDO list link 2021-11-04 20:50:32 +05:30
Arun Prakash Jana e2c4445d74
Fix build break 2021-11-03 09:01:26 +05:30
KlzXS eb769c0de5
Resolve symlinks one level for .nmv when in list mode 2021-11-03 08:37:08 +05:30
Terminator X b56e488f1c
Merge pull request #1217 from N-R-K/nuke
nuke: port sxiv-rifle performance improvement over
2021-11-02 10:16:17 +05:30
NRK 5e6c62cd8e nuke: port sxiv-rifle performance improvement over
this commit is mostly porting over some recent performance improvements
from `sxiv-rifle`: https://github.com/ranger/ranger/pull/2411

there's one "bug-fix" in this commit. currently a file named "afilejpeg"
would be matched due to the `-iregex` in listimages. this commit changes
that so only extensions would match, so for example "afile.jpeg" would
match but not "afilejpeg".

As for performance, there's a couple things this commit does:

* store the result of listimages into a tmp file instead of calling that
  function twice, this is probably the biggest performance improvement.
  especially when loading large directories.

* abspath now sets the var abs_target instead of calling printf. since
  abspath is only called from load_dir, we can go one step further and
  inline it. but i haven't done that since the function might be useful
  later on.

* avoid call to dirname and use parameter subsitution instead inside
  `listimages`

* use grep instead of `-iregex`, it's POSIX compliant and can be faster.

i've tested this out with sxiv and everything seems to be working as
expected.
2021-11-02 10:13:45 +06:00
Terminator X b5f5b2f55c
Merge pull request #1216 from CantoroMC/master
[icons nerdfont] added gpg icon
2021-11-01 17:34:59 +05:30
Marco Cantoro da03016c79 [icons nerdfont] added gpg icon 2021-11-01 11:39:33 +01:00
Terminator X bcae254ff2
Merge pull request #1215 from N-R-K/fzopen_fix
plugin: fzopen: print full path for picker mode
2021-11-01 13:53:48 +05:30
NRK 65ae3abc24 quickfix 2021-11-01 14:15:49 +06:00
NRK d2dff487e0 use $PWD 2021-11-01 14:13:21 +06:00
NRK afb7a6e9c1 check if $entry is fullpath or not 2021-11-01 14:05:18 +06:00
NRK a47376ee04 plugin: fzopen: print full path for picker mode
Closes: https://github.com/mcchrish/nnn.vim/issues/133
2021-11-01 13:28:49 +06:00
Arun Prakash Jana bdbd182c65
Handle plugin selection early 2021-11-01 12:54:47 +05:30
Arun Prakash Jana cffcd655e9
Minor code refactor 2021-10-30 12:26:31 +05:30
Arun Prakash Jana 2a87694e6a
Do not reorder pre-ordered directory on refresh 2021-10-30 12:07:45 +05:30
Arun Prakash Jana 473cd271b5
Position cursor in correct place for long names 2021-10-29 21:27:02 +05:30
Arun Prakash Jana 8efcc24e0e
Fix #1213: scroll long strings in prompts 2021-10-29 19:41:56 +05:30
Arun Prakash Jana aa8baa3d91
Update docs 2021-10-29 05:23:14 +05:30
Avimitin 254fd9b7a3
patch/docs: correct the git status build flag (#1212)
The git status build flag is missing a letter 'T'.

Signed-off-by: Avimitin <avimitin@gmail.com>
2021-10-28 14:11:49 +02:00
Terminator X 684a8c7b99
Merge pull request #1210 from alexDarcy/master
FreeBSD: use gsed instead of sed
2021-10-28 16:06:49 +05:30
Alexis Praga e3e4159e11 BSDs and Solaris: use gsed instead of sed 2021-10-28 11:38:35 +02:00
Arun Prakash Jana 856896f55d
Update comment 2021-10-27 03:57:23 +05:30
Terminator X b72090c9a3
Merge pull request #1208 from luukvbaal/preview-tui
Fix preview-tui without -a
2021-10-23 19:24:57 +05:30
Arun Prakash Jana 4d864d438f
Update help 2021-10-23 19:21:22 +05:30
Luuk van Baal de017b7aa2 Fix preview-tui without -a 2021-10-23 15:50:29 +02:00
Arun Prakash Jana f4f78276e2
Disable verbose xargs, change nativ eprompt to "nnn]" 2021-10-23 03:47:53 +05:30
Terminator X b411dfe1ba
Merge pull request #1202 from KlzXS/cmd_selection
Added %s and %S for using selection in shell
2021-10-23 03:01:07 +05:30
KlzXS 7857b7bc5a
Fix off-by-one 2021-10-22 21:06:26 +02:00
KlzXS 1022340aa1
Revert searching for a leading space
%j and %J will be replaced by a file path. File paths should be quoted to ensure proper interpretation by the shell
2021-10-22 20:28:33 +02:00
KlzXS 73ef170da7
Replace %s and %S with %j and %J
Those two conversions aren't used by any printf and scanf functions so there will no longer be any erroneous rewrites

Style fixes
2021-10-22 19:58:50 +02:00
Terminator X 0c0afd4799
Merge pull request #1207 from luukvbaal/master
Clear selection for send_to_explorer
2021-10-22 22:04:49 +05:30
Luuk van Baal fa9067afd4 Clear selection for send_to_explorer 2021-10-22 18:26:45 +02:00
Arun Prakash Jana cb5aefa59a
Remove option -w: always place HW cursor on current entry 2021-10-22 06:45:42 +05:30
Arun Prakash Jana 00c73512b9 Revert "fix: no mouse support inside vim terminal"
This reverts commit dd7c13dd77.

Single/double mouse click breaks on xfce4-terminal and xterm on Ubuntu 20.04
2021-10-22 00:30:11 +05:30
Luuk van Baal 2801832c4d
Selection and mouse support for explorer/picker 2021-10-21 23:58:35 +05:30
Terminator X 5f76b69c36
Merge pull request #1204 from N-R-K/mouse_ev
fix: no mouse support inside vim terminal
2021-10-21 18:23:57 +05:30
NRK dd7c13dd77 fix: no mouse support inside vim terminal
we need to signal mouse event by printing these escape codes. the X10
escape code seems to be legacy format only used as fallback incase SGR
extended coordinates aren't supported.
2021-10-21 18:21:59 +06:00
Terminator X f3e027c283
Merge pull request #1203 from luukvbaal/patches
Resolve gitstatus patch conflict
2021-10-21 17:11:14 +05:30
Luuk van Baal a0fcd78df2 Resolve gitstatus patch conflict 2021-10-21 13:39:09 +02:00
KlzXS bc69c968be
Added %s and %S for using selection in shell 2021-10-20 19:28:15 +02:00
Arun Prakash Jana 53fbab1f44
Prefer inline for single liner 2021-10-20 20:29:15 +05:30
Arun Prakash Jana 24b71bcf1f
Picker mode: don't pick on Enter if selection exists 2021-10-19 18:50:11 +05:30
Arun Prakash Jana 12fa5344cf
Fix #1201: accept link name for single target
When creating new sym/hard link, accept link name if
the current file is being linked or 1 file selected.
2021-10-19 15:35:57 +05:30
Arun Prakash Jana d5d559ae7f
Update docs 2021-10-19 00:44:33 +05:30
Arun Prakash Jana acfec62a13 Add example to copy image to clipboard (#1199) 2021-10-18 02:49:36 +05:30
Terminator X 4dc70f4a3f
Merge pull request #1198 from stelgenhof/master
Add 'font' mime-type registry check for preview-tui plugin
2021-10-17 17:51:29 +05:30
Arun Prakash Jana a06ff83c22
Add option -i to show file information on hover 2021-10-17 12:01:01 +05:30
Sacha Telgenhof 44b983f71e Added the media registry 'font' for mime types part of it.
Signed-off-by: Sacha Telgenhof <me@sachatelgenhof.com>
2021-10-17 14:34:09 +09:00
Arun Prakash Jana 9c36f0df34
Get rid of clearinfoln() 2021-10-17 05:00:35 +05:30
Arun Prakash Jana 3490a959be
make var O_FILEINFO to show file info on hover 2021-10-16 22:48:01 +05:30
Arun Prakash Jana c611720cba
Update version 2021-10-15 12:45:58 +05:30
Arun Prakash Jana be549f330a
Update docs 2021-10-15 03:05:21 +05:30
An Phung e20cfd67a1
Support OSX iterm2 in preview-tui by using split pane (#1196) 2021-10-14 22:07:11 +02:00
Arun Prakash Jana 3091a6f240
Update link to ToDo list 2021-10-10 11:45:49 +05:30
Arun Prakash Jana 3acbc65adb
Fix build break 2021-10-09 19:37:45 +05:30
Terminator X 98585153cc
Merge pull request #1191 from luukvbaal/patches
Fix gitstatus regression and restorepreview conflict
2021-10-09 19:11:03 +05:30
Terminator X 57bae766ea
Merge pull request #1192 from jarun/luukvbaal-readme
Add nnn.nvim to README
2021-10-09 18:57:21 +05:30
luukvbaal e9dbadd465
Add nnn.nvim to README 2021-10-09 14:40:22 +02:00
Luuk van Baal 17bf7c97f6 Fix gitstatus regression/restore preview conflict 2021-10-09 02:36:22 +02:00
Terminator X 1020f37320
Merge pull request #1190 from luukvbaal/sessionfix
Save session after browse()
2021-10-07 08:59:34 +05:30
Luuk van Baal 151312eb37 Save session after browse() 2021-10-07 02:57:55 +02:00
Terminator X 2435263052
Merge pull request #1186 from KlzXS/recursive_batch_rename
Added recursive capabilities to .nmv
2021-10-04 20:32:14 +05:30
Terminator X 831b434021
Merge pull request #1189 from luukvbaal/preview-tui
Remove preview-tui winch tmux workaround
2021-10-04 20:30:49 +05:30
Luuk van Baal c48691fe3d Change preview-tui winch workaround 2021-10-04 00:12:48 +02:00
KlzXS b492dfd7ca
Added recursive capabilities to .nmv 2021-10-03 11:42:02 +02:00
Terminator X fa7c19c409
Merge pull request #1183 from N-R-K/disable_e
Disable e on picker mode
2021-09-30 19:50:40 +05:30
NRK 8a1a5db92a Disable e on picker mode
Mainly so that pressing 'e' due to muscle memory on nnn.vim doesn't nest
a new editor instance inside the embedded vim terminal.

However invoking nnn with picker mode implies that the intention is to
pick file(s), there shouldn't be any business trying to edit things on
the fly. And if editing a file while in picker mode is desirable, then
'l' can be used for that instead.
2021-09-30 19:54:22 +06:00
Arun Prakash Jana 7477bd15bb
Update docs 2021-09-30 07:26:40 +05:30
Arun Prakash Jana 74b779abc9
Update docs 2021-09-30 03:17:02 +05:30
Arun Prakash Jana 2f6c180433
Improve docs in cd on quit scripts 2021-09-29 19:16:58 +05:30
Arun Prakash Jana 79b3688e49
Revert Haiku rdef 2021-09-29 16:22:01 +05:30
Terminator X d772223e1f
Merge pull request #1182 from luukvbaal/patches
Fix gitstatus and rebase patches
2021-09-29 15:43:43 +05:30
Luuk van Baal 541b936bcf Fix gitstatus and rebase patches 2021-09-29 11:33:19 +02:00
Arun Prakash Jana e74aa95e3f
Prepare for release v4.3 Martini 2021-09-29 14:37:45 +05:30
Arun Prakash Jana fc86152fa2
Fix compilation warning 2021-09-29 14:28:16 +05:30
Terminator X 1723aeb470
Merge pull request #1180 from MaxGyver83/master
autojump plugin: Support jethrokuan/z (port of z for fish)
2021-09-27 05:38:12 +05:30
Max Schillinger 1c9ecd781c
Combine assignment of $_Z_DATA, $Z_DATA or $HOME/.z
Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
2021-09-26 23:17:51 +02:00
Max Schillinger f39ee39a36 autojump plugin: Support jethrokuan/z (port of z for fish) 2021-09-26 21:54:01 +02:00
Arun Prakash Jana 046d676a73 Fix broken GUI cmd run as plugin case 2021-09-25 23:55:25 +05:30
Terminator X f3e0f23718
Merge pull request #1177 from luukvbaal/preview-tui
Preview without convert
2021-09-24 17:54:41 +05:30
Luuk van Baal 07c8089eaf Preview without convert 2021-09-24 12:12:13 +02:00
Terminator X 2c82c77a05
Merge pull request #1174 from luukvbaal/restorepreview
Improve restorepreview race conditions
2021-09-23 13:12:15 +05:30
Luuk van Baal 52d8aa0945 Improve restorepreview race conditions 2021-09-22 17:15:35 +02:00
Terminator X a447c12866
Merge pull request #1173 from luukvbaal/previewpatch
Add restorepreview patch
2021-09-22 09:08:32 +05:30
Luuk van Baal d96a7bc2b7 Add restorepreview patch 2021-09-22 04:13:57 +02:00
Arun Prakash Jana ffe472ac32 Revert "Close previewer when opening file (#1171)"
This reverts commit 532532704e.
2021-09-22 05:46:45 +05:30
CantoroMC bfc493c753
Support for nerdfont sty,cls and bib(tex filetypes) (#1169)
I've extended the use of nerdfont icon for tex to other common tex extensions.
I don't know how to do the same for icons-in-terminal.
Additionally, since the list is growing I have alphabetize the list of common
icons, used in icons-nerdfont.h.
2021-09-21 10:23:18 +05:30
luukvbaal 532532704e
Close previewer when opening file (#1171) 2021-09-21 10:18:51 +05:30
CantoroMC 2a6cc41972
add provided but unused ruby icon (#1167) 2021-09-19 10:13:07 +05:30
Terminator X 5bf9b52beb
Update FUNDING.yml 2021-09-19 06:55:51 +05:30
Arun Prakash Jana aea97cf3a7
More checks 2021-09-09 23:17:22 +05:30
Arun Prakash Jana 27e1eb54c4
Fix #1162: run commands as plugin through shell 2021-09-09 19:38:41 +05:30
Arun Prakash Jana e7aec90889 Add early check 2021-09-09 18:05:51 +05:30
Jakob Beckmann 7f84fbc8a0
Added theme support for bat in preview-tui plugin (#1141) 2021-09-09 18:02:06 +05:30
Arun Prakash Jana 9df7e5f03e
Reformat checks 2021-09-09 09:06:09 +05:30
Arun Prakash Jana 359d7bc29c
Directory-specific sort order 2021-09-09 01:46:22 +05:30
Arun Prakash Jana fa7cef2df7
The shell interprets "$nnn" now 2021-09-05 18:19:30 +05:30
Assaf Ben-Amitai d34741107a
fix jump cd to use seperate params (#1156) 2021-09-05 05:20:31 +05:30
Assaf Ben-Amitai 7de52ff890
plugin autojump: on jump - read entire line (#1155) 2021-09-05 02:01:41 +05:30
Arun Prakash Jana 51829c8027
Reformat copy current current file name 2021-09-04 08:06:29 +05:30
Arun Prakash Jana 49be2cfcd1
Fix #1153: sync hidden on batch rename 2021-09-04 07:23:02 +05:30
Arun Prakash Jana ab0ab2b5f4
Use a meaningful macro 2021-09-04 07:21:59 +05:30
Daniel Eklöf 0556ac14ec
[draft] signal CWD change to terminal via OSC-7 (#1148)
* Signal CWD change to terminal via OSC-7

Closes #1147

* Make OSC-7 emission gated by NOX11

* Use newpath variable in gethostname()

Use dynamic memory for hostname
2021-08-30 20:14:05 +05:30
Terminator X 64c2c68bd0
Merge pull request #1146 from luanrivello/patch-1
Fix kitty listen_on example
2021-08-29 20:16:40 +05:30
Luan Belem Rivello f9cf6dad48
Fix kitty listen_on example 2021-08-28 20:14:35 -03:00
Arun Prakash Jana c974690482
Fix build break 2021-08-25 20:14:55 +05:30
Arun Prakash Jana 742759f32d Exports special variables before running plugins 2021-08-25 16:32:45 +05:30
Terminator X ad968b88da
Merge pull request #1143 from joelazar/master
fix fzhist plugin - get fish_history from the right place
2021-08-25 16:25:20 +05:30
joelazar dba6eeb431 fix fzhist plugin - get fish_history from the right place 2021-08-25 10:36:10 +02:00
Arun Prakash Jana 55fc0c500b
Retain original context hovered file when selecting from plugin dir 2021-08-25 01:32:40 +05:30
Arun Prakash Jana a62dbf093a
Fix NULL file name handling 2021-08-25 00:47:52 +05:30
Arun Prakash Jana 900513710f
More special variables at prompt/shell
$dN: directory path open in context N
$fN: file path hovered in context N
2021-08-24 23:34:40 +05:30
Arun Prakash Jana 6243de06f4
Update help page logo 2021-08-23 11:02:53 +05:30
Arun Prakash Jana e11cbc289a
Add a cool ASCII art to help screen 2021-08-23 04:38:54 +05:30
elder-n00b e4813f06c1
MacOSX legacy (#1138)
* Branched v4.2
Added workaround for Mac OS X < 10.12.0
(Only tested on 10.11.6, lower versions may need more workaround)

* Added *.dSYM to .gitignore

* Added comments for the macosx detection in Makefile

* Fixed indentation, formatting and missing newline at eof

* Moved includes inside include guard

Co-authored-by: elder-n00b <elder-n00b@yandex.com>
2021-08-22 12:17:27 +05:30
Arun Prakash Jana 6c5eab5e55 Jump back last dir from plugin dir with - 2021-08-19 08:45:07 +05:30
luukvbaal ad6b6bd3df
Icon changes .iconlookup (#1136) 2021-08-18 23:16:29 +05:30
CantoroMC a65055fc32
change and add some icons-nerdfont (#1135) 2021-08-18 19:23:53 +05:30
Arun Prakash Jana 6c3a3dbc15
Update README 2021-08-18 00:27:09 +05:30
CantoroMC 43da9a9c46
icon for zsh, nix, and matlab files(nerdfonts), lua color to lua file (#1132)
* icon for nix and matlab files(nerdfonts), lua color to lua file

* Update .iconlookup

* Update icons-nerdfont.h

* Update icons.h

Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
2021-08-17 20:41:42 +02:00
Arun Prakash Jana 78ea6702f7
Key B to add bookmarks on the fly 2021-08-17 20:53:54 +05:30
Terminator X 0aed67f329
Merge pull request #1131 from luukvbaal/patchfix
Fix gitstatus pathspec errors
2021-08-17 17:49:34 +05:30
Luuk van Baal 82d1510213 Fix gitstatus pathspec errors 2021-08-17 14:01:24 +02:00
Arun Prakash Jana 983d689a05
Disable auto-marking 2021-08-17 15:06:09 +05:30
0xACE 9d4330e382
Decide string length at compile time (#1130)
I run into many premature optimizations in our codebase which are
unnecessary.

In this particular case `strlen()` is optimized at compile time even at
`-O0` with `gcc`.

I would value higher code quality than dealing with these things in our
future endeavours. If this is accepted I may supply some more
readability patches.
2021-08-17 10:26:33 +05:30
Arun Prakash Jana 86648ab391
Fix length 2021-08-17 01:03:28 +05:30
Arun Prakash Jana 46294e9f3d
Add bookmarks directory support 2021-08-16 20:16:56 +05:30
Terminator X 840fb75208
Merge pull request #1129 from luukvbaal/patchfix
Fix namefirst patch conflict
2021-08-16 18:39:03 +05:30
Luuk van Baal b5750c9e38 Fix finder typo 2021-08-16 12:47:02 +02:00
Luuk van Baal 2b45c1be55 Fix patch conflict 2021-08-16 12:45:44 +02:00
Luuk van Baal b7c6fede5f
Add finder history/bookmarks 2021-08-15 22:07:20 +05:30
Arun Prakash Jana 943a7c13ac
Fix broken statusbar when symlink name exceeds max cols 2021-08-15 22:07:18 +05:30
Arun Prakash Jana 7cbc79a5fc
Remove repetitive code 2021-08-14 19:27:24 +05:30
Arun Prakash Jana 0b07b77e85
Update Quickstart 2021-08-14 12:43:18 +05:30
Arun Prakash Jana e4c1abb6b8
Save full filter in session to restore correctly 2021-08-12 23:15:15 +05:30
Arun Prakash Jana bf2b8d8c84
Decouple statusbar redraw 2021-08-12 22:09:06 +05:30
Arun Prakash Jana fc00faf7d0
Do not modify $PWD 2021-08-12 10:46:12 +05:30
Arun Prakash Jana 42061b0399
Fail operations if selection file is empty 2021-08-12 00:20:13 +05:30
Arun Prakash Jana b2c99b9e4e
Update docs 2021-08-12 00:01:01 +05:30
Arun Prakash Jana 06e2676421
Sync operation on selection among nnn instances 2021-08-11 21:53:42 +05:30
Arun Prakash Jana 97ac88dec2
Try to get current dir from PWD first 2021-08-10 22:34:18 +05:30
Arun Prakash Jana e146ad0d7a
Use a different function 2021-08-10 07:06:20 +05:30
Arun Prakash Jana 59d90aa2ce
Do not resolve symlinks in argument PATH 2021-08-10 06:48:21 +05:30
Arun Prakash Jana 1df63a78e4
Do not resolve symlinks in bookmarks 2021-08-09 01:13:54 +05:30
Arun Prakash Jana db1efba256
Update ToDo list link 2021-08-08 20:19:46 +05:30
Arun Prakash Jana 49ee5b21e7
Do not end selection mode before prompt/shell 2021-08-08 20:15:20 +05:30
Arun Prakash Jana 62a0486480 Do not end selection mode before invoking plugin 2021-08-08 18:31:29 +05:30
Terminator X 2c32f24073
Merge pull request #1121 from sikmir/haiku
Update Haiku Makefile
2021-08-08 18:07:51 +05:30
Nikolay Korotkiy f8aaf3b34c
Update Haiku Makefile 2021-08-08 15:32:39 +03:00
Arun Prakash Jana 7d17cf3f63
List open locations from active contexts in help 2021-08-07 23:55:51 +05:30
Arun Prakash Jana 87380732dc
make option O_MATCHFLTR to disable filters without match 2021-08-05 22:15:02 +05:30
Terminator X 1d5efa7074
Merge pull request #1119 from N-R-K/NOSSN
fix misleading comment in Makefile
2021-07-29 23:28:10 +05:30
NRK 5fcd3d1198 fix misleading comment in Makefile
reading the source code, setting NOSSN to 1 _disables_ session support,
not enable it.
2021-07-29 15:33:19 +06:00
Arun Prakash Jana b54f771a44
Fix #1117: Revert "Ignore filter key if no results"
This reverts commit 3ef50f06f8.
2021-07-29 03:34:06 +05:30
Terminator X 23a806864f
Merge pull request #1118 from N-R-K/xdgdefault
xdgdefault: make dmenu case-insensitive, fix style
2021-07-28 14:33:49 +05:30
NRK f3c29fe81a xdgdefault: make dmenu case-insensitive, fix style
Most *.desktop entries have same name as their application name so this
is not an issue most of the time. However in the case of Neovim, the
application name is "Neovim" while the desktop entry is "nvim.desktop"

Since dmenu is case sensitive by default this means that searching
"neovim" will not show any results since the N is not capitalized and
the desktop entry name is "nvim"

fzf doesn't have this issue since its case-insensitive/fuzzy by
default. Making dmenu case-insensitive solves this.

Also fix the indentation to be consistent with the rest of the script.
2021-07-28 12:30:30 +06:00
Arun Prakash Jana 88e38f1efc
Eliminate redundant stat() 2021-07-27 23:04:23 +05:30
Arun Prakash Jana 6ba0a8357f
redraw() is heavy and distracting 2021-07-26 06:19:56 +05:30
Arun Prakash Jana 8cebc69e71
Fix build break 2021-07-25 07:20:43 +05:30
Arun Prakash Jana f6856f61f7
Allow specifying output file in NNN_TMPFILE for cd on quit 2021-07-25 07:03:09 +05:30
Arun Prakash Jana f1dbb9622d Open controlling terminal only as stdin 2021-07-24 22:22:17 +05:30
Terminator X 0db988b9b2
Merge pull request #1114 from jcromero/patch-1
Fix wrong exclamation mark char description
2021-07-24 15:48:36 +05:30
jcromero 258a5846f7
Fix wrong exclamation mark char description 2021-07-24 11:54:27 +02:00
Arun Prakash Jana d80fdf335b
Check if file is already selected before appending in picker mode 2021-07-24 01:51:20 +05:30
Arun Prakash Jana e2545f9596
Truncate output file before writing in picker mode 2021-07-24 01:25:28 +05:30
Arun Prakash Jana 25fab4cb2e
Open controlling terminal for input when run in a script 2021-07-23 23:46:20 +05:30
N-R-K 3a98dfb0b0
xdgdefault plugin: add dmenu support (#1112)
* xdgdefault plugin: add dmenu support

use fzf if available. otherwise, if available, use dmenu.
should be possible to use rofi as well, but i don't use rofi nor do i
have it installed for testing.

* xdgdefault plugin: add GUI flag

* update xdgdefault requirement
2021-07-23 17:06:19 +05:30
Arun Prakash Jana 0150c69844
Update plugin docs 2021-07-22 20:11:07 +05:30
Arun Prakash Jana b561772ada
Remove dated documentation 2021-07-21 23:43:59 +05:30
Arun Prakash Jana ad163fb574
Revert variety in Haiku Makefile 2021-07-21 17:56:46 +05:30
Arun Prakash Jana bc5b39d54c
Prepare for release v4.2 Mojito 2021-07-21 17:45:39 +05:30
Arun Prakash Jana 14663b964b
Add option to specify arguments to exec 2021-07-21 11:54:40 +05:30
Arun Prakash Jana 3f07a8ca76
Press TAB to insert current file name at prompt 2021-07-21 11:24:46 +05:30
Jonathan Rash 4b4355c733
Added execute fallback to nuke 2021-07-21 10:28:33 +05:30
Arun Prakash Jana 7b31a356d2
Minor update 2021-07-20 23:31:40 +05:30
Arun Prakash Jana 9972c4bdb0
Fix #1110: sanitize path from plugin 2021-07-19 03:57:53 +05:30
Arun Prakash Jana c470143113
Clear filter early before running plugin 2021-07-19 01:52:44 +05:30
Arun Prakash Jana 3b5800fc7a
Selection-specific scratch buffer 2021-07-18 11:45:50 +05:30
Arun Prakash Jana 29a7a25445
Free allocated memory 2021-07-18 02:51:09 +05:30
Arun Prakash Jana 6f14190e6d
Plugin suedit - preserve environment 2021-07-17 22:00:38 +05:30
Arun Prakash Jana d54bc230f6
fzopen - add option to open files in nuke 2021-07-17 21:04:53 +05:30
Arun Prakash Jana e31f71285d
Merge plugin fzz into autojump 2021-07-17 20:02:22 +05:30
Arun Prakash Jana 1e182a1fe5
Remember the last command executed at prompt 2021-07-17 16:30:45 +05:30
Arun Prakash Jana f7aa4ed324
Add macro for prompt 2021-07-17 13:09:33 +05:30
Arun Prakash Jana 0ef34a930c
Use a simpler macro 2021-07-17 13:05:37 +05:30
Arun Prakash Jana 07b627a725
Fix unused variable warning 2021-07-17 04:46:35 +05:30
Arun Prakash Jana a911b3044a
Code reformat 2021-07-16 21:19:17 +05:30
Arun Prakash Jana 26f44f0dfc
Fix selection in / 2021-07-16 11:09:20 +05:30
Arun Prakash Jana fa0f9ddc93
Remove from selection when hovered entry is deleted 2021-07-16 04:44:01 +05:30
Arun Prakash Jana 3ef50f06f8
Ignore filter key if no results 2021-07-16 02:22:01 +05:30
Arun Prakash Jana d40dbfd69a
Do not apply filter if directory is empty 2021-07-16 01:54:15 +05:30
Arun Prakash Jana 8af773eb0d
Allocate PATH_MAX aligned memory size 2021-07-16 01:19:09 +05:30
Arun Prakash Jana 8ad807d4a9
Optimize repeat copy of same prefix 2021-07-15 23:43:07 +05:30
Arun Prakash Jana 4ec87e3021
Optimize bulk selection 2021-07-15 21:21:54 +05:30
Arun Prakash Jana 0159c08602
Invert optimization: allocate in a go 2021-07-15 18:59:00 +05:30
Arun Prakash Jana 064f5ea998
Show msg for both invert and select all 2021-07-15 11:45:32 +05:30
Arun Prakash Jana 9526fb7612
Optimize invert further 2021-07-15 02:06:11 +05:30
Arun Prakash Jana 61d8a29d84
In-place invert optimization 2021-07-14 21:04:02 +05:30
Arun Prakash Jana cef9bd289f
Update docs 2021-07-14 02:44:38 +05:30
Arun Prakash Jana b3ef30a8ba
Update add to and invert selection logic 2021-07-13 21:46:18 +05:30
Arun Prakash Jana 96f2dfa8a5
Scan for selection status on redraw() 2021-07-13 01:30:23 +05:30
Arun Prakash Jana 60f310160a
Remove redundant macro 2021-07-12 02:54:00 +05:30
Arun Prakash Jana baca4693ec
Remove redundant prompt 2021-07-12 01:22:39 +05:30
Terminator X e94ac0b91b
Merge pull request #1106 from KlzXS/persistent_selection
Use selbufpos instead of selbuflen
2021-07-11 23:58:58 +05:30
KlzXS b5d1a1b036
Use selbufpos instead of selbuflen 2021-07-11 20:16:28 +02:00
KlzXS c0dceb18c6
Persistent selection (#1086)
* Add persistsel

* Fix Makefile spacing

* Update Haiku Makefile

* Do a double pass on inversion

* Split single and double pass for easier testing

Removed lastappendpos

Eliminate suffix matches

* Check if dir is in selection before searching for files

Fix double pass

* Switch to mainline

Optimize memory moving

Handle large selection in invertsel()

Going forward with 2pass

* Update Makefiles

* Fix style

* Move forward declarations

* Remove edit selection in inversion

Replace buf with g_buf to fix CI

Fix CI

* Style changes

* Comment the code

* Style fixes

* Fix infinite loop

* Fix crash on empty invert

* Fix off-by-one-in-two-places

Off-by-twice?

* Adopt changes from master

* Only check directory if entry in it is selected

* Better organization

* Wrong variable

* Tiny optimizations

* Style fixes and updated man page

* Update man page

* Remember where we found directory path in selection

Add in progress message on invert
2021-07-10 07:30:02 +05:30
Arun Prakash Jana d9db6b045c
Fix #1102: suppress clang unused variable warnings 2021-07-10 02:08:48 +05:30
Arun Prakash Jana 5f5ee10e94
Fix #1101: confirm trashing files 2021-07-09 21:00:46 +05:30
Arun Prakash Jana facdc5fdeb
Fix #1098: clear selmode on last deselect 2021-07-06 23:25:49 +05:30
Piña Colada 1269dd2695
Merge pull request #1095 from luukvbaal/patches
Remove gitstatus libgit2 dependency
2021-07-06 17:48:25 +05:30
Luuk van Baal ddf845be88 Remove gitstatus libgit2 dependency 2021-07-06 02:01:19 +02:00
Piña Colada c482cf54f0
Merge pull request #1094 from jarun/preview-tui
Allow tmux inside kitty without KITTY_LISTEN_ON set
2021-07-05 22:29:03 +05:30
Luuk van Baal 4abced6142 Allow tmux inside kitty without KITTY_LISTEN_ON set 2021-07-05 15:40:18 +02:00
Piña Colada 77c16ac143
Merge pull request #1091 from luukvbaal/adjust_cols
Move adjust_cols and no else braces
2021-07-03 05:24:23 +05:30
Luuk van Baal 36ddbac10a Move ajust cols and no else braces 2021-07-03 00:50:51 +02:00
Arun Prakash Jana d4a4c72e00
Fix off_t to uint_t comparison warning
The man page says:

"blkcnt_t and off_t shall be signed integer types."

https://man7.org/linux/man-pages/man0/sys_types.h.0p.html
2021-07-02 20:34:02 +05:30
Piña Colada a7aae40069
Merge pull request #1090 from luukvbaal/imgview
Imgview fix ucollage directory
2021-07-01 14:56:53 +05:30
Luuk van Baal fe07ae35f2 Imgview fix ucollage directory 2021-07-01 11:24:49 +02:00
Piña Colada a7603ba1f2
Merge pull request #1084 from luukvbaal/imgview
Imgview open hovered image and reuse NNN_PREVIEWDIR
2021-07-01 14:36:07 +05:30
Luuk van Baal a199156cae Imgview hovered image/thumbnail dir 2021-07-01 02:26:47 +02:00
Piña Colada ce8b9fdb2f
Merge pull request #1088 from 1bman/1bman-patch-1
fix icons.h typo
2021-06-30 19:51:50 +05:30
1bman 99bd80137d
fix icons.h typo
fixed some typo
2021-06-30 14:25:01 +05:30
Piña Colada 2fda5c78e0
Merge pull request #1087 from KlzXS/debug
Fix debug line number
2021-06-29 23:59:30 +05:30
KlzXS c39e54b288
Fix debug line number 2021-06-29 19:49:59 +02:00
Arun Prakash Jana 1729a10ef4
Try to unmount hovered local dir 2021-06-28 00:16:32 +05:30
Arun Prakash Jana 96fb61a6a2
Reformat help 2021-06-27 21:26:37 +05:30
Piña Colada 15b60a80ad
Merge pull request #1082 from tonijarjour/patch-1
Make sxiv play gifs automatically
2021-06-27 20:54:42 +05:30
Arun Prakash Jana 04a806dc09
Reformat help 2021-06-27 20:53:13 +05:30
Toni Jarjour 1607200a75
Make sxiv play gifs automatically 2021-06-27 11:11:39 -04:00
Arun Prakash Jana 63ef6d7340
Update docs 2021-06-25 23:57:28 +05:30
Arun Prakash Jana 73a175cc39
Update readme 2021-06-25 00:06:15 +05:30
Arun Prakash Jana d1df9343c6
Remove redundant param 2021-06-23 23:42:10 +05:30
Arun Prakash Jana e7f73d95ce
Fix memory leak 2021-06-22 20:51:23 +05:30
Arun Prakash Jana eae60c3048
Simplify mkpath() 2021-06-22 20:27:07 +05:30
KlzXS 20e0c49292
Replace fd dependency with find (#1078) 2021-06-21 04:59:50 +05:30
Arun Prakash Jana 7ce5bbcdf7
Break long macros 2021-06-20 22:16:09 +05:30
Arun Prakash Jana 94c399e2cf
One notify FIFO mode at a time 2021-06-20 21:42:44 +05:30
Arun Prakash Jana d9f988e7ed
Fix patch break 2021-06-20 21:25:22 +05:30
Arun Prakash Jana 983babc5f6
Improve alignment 2021-06-20 20:48:06 +05:30
Arun Prakash Jana c597f3be9b
Add range check 2021-06-20 19:20:10 +05:30
Arun Prakash Jana 0e8819fea8
Fix alignments 2021-06-20 15:45:03 +05:30
Arun Prakash Jana 2ffb0f7c79
Fix patch break 2021-06-20 14:29:07 +05:30
Arun Prakash Jana 556941c2b2
Alphabetically order internal states 2021-06-20 14:23:13 +05:30
Arun Prakash Jana 4f297fa147
Shared previewer and explorer 2021-06-20 13:58:33 +05:30
Arun Prakash Jana 9f86015c16
Print version to stdout 2021-06-20 10:25:40 +05:30
Arun Prakash Jana c0ed6d1d04
Fix compilation error when FIFO is disabled 2021-06-19 21:04:21 +05:30
Arun Prakash Jana b626cfa00f
Use macro in all places 2021-06-19 20:36:16 +05:30
Arun Prakash Jana 3e91c2c977
Use easily identifiable type 2021-06-19 18:39:35 +05:30
Arun Prakash Jana 8f3785f2e5
Restore statusbar after unmounting remote/archive 2021-06-19 17:23:28 +05:30
Arun Prakash Jana d5359f0455
Fix created archive not highlighted 2021-06-19 15:16:24 +05:30
Arun Prakash Jana 17bb0cfb52
Default to CWD for atool 2021-06-19 14:31:04 +05:30
Arun Prakash Jana e8f0c53287
Do not open current dir in nez context when extracting archive 2021-06-19 13:00:50 +05:30
Arun Prakash Jana 96cbb4ff84
Fix #1076: show file name in archive extract prompt 2021-06-19 11:21:42 +05:30
Arun Prakash Jana 35aa864554
Fix returns 2021-06-19 01:48:14 +05:30
Arun Prakash Jana 825effb264
Fix broken window due to double spawn 2021-06-18 20:44:44 +05:30
Michael Lan b2e7f7794c
Refactor fifo code and add explorer (#1075)
* Refactor fifo code and add explorer

* add explorer option and flag

* notify explorer fifo on selection

* close explorer fifo file descriptor

* Try to create explorer fifo if doesn't exist

This doesn't quite work

* Allow uncreated fifos

* delete persistence fifo on cleanup

with correct formatting

Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>

* Work correctly with NOFIFO

* Refactor variable names

* fix

* Use -X flag for explorer mode

* Update manpage with explorer mode

Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
2021-06-18 05:38:28 +05:30
luukvbaal 02b5b15001
Update gitstatus patch (#1074) 2021-06-18 05:02:44 +05:30
Arun Prakash Jana 640a56e1cc
sigwinch test 2021-06-18 04:36:28 +05:30
Arun Prakash Jana 239c7e7970 Revert "Remove redundant old state handlers"
This reverts commit 1590103ab7.
2021-06-17 00:31:26 +05:30
Arun Prakash Jana 0b99247774
Update docs 2021-06-16 23:44:24 +05:30
Arun Prakash Jana 1590103ab7
Remove redundant old state handlers 2021-06-16 00:17:01 +05:30
Arun Prakash Jana 3db1dfd17f
Get rid of file stream functions 2021-06-15 20:52:59 +05:30
Arun Prakash Jana 0884ad4af9
Code reformat, use basic IO functions 2021-06-15 20:18:19 +05:30
Arun Prakash Jana 745a30ccb5
Use raw functions instead of file functions 2021-06-15 15:28:53 +05:30
Arun Prakash Jana a007fe8493
Fix #1072: use internal tmp file to page output 2021-06-15 14:38:08 +05:30
Arun Prakash Jana 4c66a8c0c3
Remove redundant newline 2021-06-14 22:12:55 +05:30
Arun Prakash Jana 3834d75d77
Extract archive to, mount remove/archive in smart context 2021-06-14 00:16:49 +05:30
Arun Prakash Jana e256353fbf
Support archive "extract to..." 2021-06-13 14:38:37 +05:30
Arun Prakash Jana 54258749e1
Update docs 2021-06-13 10:38:12 +05:30
Arun Prakash Jana 361521b769
Fix patch incompatibility 2021-06-13 09:04:49 +05:30
Arun Prakash Jana 16a15fc976
Remove option from auto-complete 2021-06-13 02:03:47 +05:30
Arun Prakash Jana 06c5b17c02
Config NNN_HELP to show output of a program on top of help page 2021-06-13 01:22:36 +05:30
Arun Prakash Jana 8c116eea2c
Use netbsd-curses v0.3.2 2021-06-13 00:36:45 +05:30
Arun Prakash Jana f4f6919c02
Fix #1067: handle SIGWINCH the ncurses way
Ref: https://invisible-island.net/ncurses/ncurses-intro.html#xterm
2021-06-13 00:16:43 +05:30
Anna Arad 4f977ff269
Add force-tty capability to spawn and set pagers to it (#1070)
Co-authored-by: Anna Arad <annagram@shards.me>
2021-06-12 23:02:48 +05:30
Arun Prakash Jana 0dd76e7aec
Drop unreliable popen() call [e.g. fails if filename has "] 2021-06-12 22:44:15 +05:30
Arun Prakash Jana 69926a8eff
Simplify show_stats() 2021-06-12 21:33:26 +05:30
Arun Prakash Jana 9a124ae935
Initialize local array to NULL 2021-06-12 19:41:34 +05:30
Arun Prakash Jana 145ca91df2
Attempt to fix #1067: hook into ncurses to resize on KEY_RESIZE 2021-06-12 16:59:19 +05:30
Arun Prakash Jana e537c22281
Use standard descriptor names 2021-06-11 23:35:57 +05:30
Piña Colada 8238410d4c
Merge pull request #1066 from kevinsjoberg/remove-fzf-options
Remove opinionated options
2021-06-11 19:34:32 +05:30
Kevin Sjöberg 8fc18fb9d6 Remove opinionated options 2021-06-11 15:48:29 +02:00
Kevin Sjöberg f443768260
Support opening regular text files on macOS 2021-06-11 15:35:03 +05:30
Arun Prakash Jana cbbac4728b
Checkpatch fixes 2021-06-10 00:31:17 +05:30
Arun Prakash Jana 54b2eb51d5
Use static global 2021-06-08 20:50:09 +05:30
Arun Prakash Jana 46b48cf71c
Update examples 2021-06-07 01:18:34 +05:30
Arun Prakash Jana 6d2d901a91
Update docs 2021-06-06 23:35:15 +05:30
Arun Prakash Jana 51ac3d02c9
Remove redundant examples 2021-06-06 22:16:24 +05:30
Arun Prakash Jana 15eed29227
NNN_PLUG: use `|` to page run-and-exit cmd output 2021-06-06 21:51:30 +05:30
Arun Prakash Jana 3b6938f782
Fix alignment 2021-06-06 18:58:13 +05:30
Arun Prakash Jana f24b82a750
NNN_PLUG: use & as run-gui-cmd-as-plugin symbol (earlier |) 2021-06-06 18:48:14 +05:30
Arun Prakash Jana 9de941306c
NNN_PLUG: use ! as run-cmd-as-plugin symbol (earlier _) 2021-06-06 18:37:49 +05:30
Arun Prakash Jana 5e34181bb3
Add another useful plugin example 2021-06-06 17:35:05 +05:30
Arun Prakash Jana d87414eb61
Plugin fzcd - decouple from selection 2021-06-06 17:07:23 +05:30
Arun Prakash Jana 488fe6b941
Plugin cleanup 2: one-liners with paged output
- remove `mediainf`
- remove `uidgid`
- remove `hexview`
- remove `pdfview`
2021-06-06 13:56:09 +05:30
Arun Prakash Jana fb6ca79197
Plugin cleanup 1
- rename `wall` to `wallpaper`
- remove `upgrade` - packaging is on OBS now
- remove `treeview` - needs minor preview-tui tweak
- remove `picker` - `nnn -p -` does the same
2021-06-06 10:44:10 +05:30
Piña Colada 29bce804be
Merge pull request #1055 from luukvbaal/patches
Add gitstatus patch -G flag
2021-06-05 20:00:09 +05:30
Luuk van Baal 7edf14139b Add gitstatus patch -G flag 2021-06-05 16:21:01 +02:00
Arun Prakash Jana e1a9aa0aa5
Mention patch framework 2021-06-05 04:54:15 +05:30
Piña Colada b8851bdf16
Merge pull request #1054 from luukvbaal/preview-tui
Preview-tui single previewpid file
2021-06-05 04:27:58 +05:30
Luuk van Baal c9c0be32a8 Preview-tui single previewpid file 2021-06-05 00:35:54 +02:00
Piña Colada 4637a5a84d
Merge pull request #1053 from luukvbaal/preview-tui
Suppress pgrep output
2021-06-04 21:24:27 +05:30
Luuk van Baal 0fff92b396 Supress pgrep output 2021-06-04 17:04:01 +02:00
Piña Colada 7b32e3bae0
Merge pull request #1052 from luukvbaal/preview-tui
Fix preview-tui zombie
2021-06-04 20:25:48 +05:30
Luuk van Baal 5533f152bd Fix preview-tui zombie 2021-06-04 16:43:59 +02:00
Piña Colada f681a5b3f1
Merge pull request #1051 from luukvbaal/preview-tui
Fix preview-tui job control
2021-06-04 07:43:59 +05:30
Luuk van Baal 99e039d504 Fix preview-tui job control 2021-06-04 04:10:35 +02:00
Arun Prakash Jana f03b5dd4a9
Add mention 2021-06-03 23:28:07 +05:30
Arun Prakash Jana 2df1e64127
Post-release formalities 2021-06-03 22:54:12 +05:30
Arun Prakash Jana 5a6df62b1c
Prepare for release v4.1.1 Sake 2021-06-03 22:36:19 +05:30
luukvbaal c205177ac6
Update gitstatus patch (#1048) 2021-06-03 17:07:07 +02:00
Piña Colada 14be56057c
Merge pull request #1049 from luukvbaal/imgview
Plugin imgview improvements
2021-06-03 20:08:28 +05:30
Luuk van Baal de430efafb Improve imgview plugin 2021-06-03 15:09:20 +02:00
luukvbaal f3eac98678
Further gitstatus cleanup/fixes (#1046) 2021-06-03 11:01:27 +02:00
Arun Prakash Jana 29ef232301
Add Makefile target to compile nnn with musl libc 2021-06-03 04:34:44 +05:30
Arun Prakash Jana 88e9171266
Restore source code packing on CircleCI 2021-06-03 03:50:30 +05:30
Arun Prakash Jana f27e93fba0
Fix #1041 2021-06-03 03:15:09 +05:30
Arun Prakash Jana ccce80a1e9
Remove _Atomic usage 2021-06-02 21:53:29 +05:30
Arun Prakash Jana b52c09dd23
Move patches to top level 2021-06-02 12:25:31 +05:30
Arun Prakash Jana bf673744fb
Prepare for release v4.1 Sake
Sake - https://en.wikipedia.org/wiki/Sake
2021-06-02 10:44:41 +05:30
luukvbaal 93e7995ab5
Add user patch framework (#1037)
* Add user patch framework

* Add git status patch

* Add namefirst-gitstatus compatibility

* Add patch targets

* Fix gitstatus colors and patch order
2021-06-02 09:57:06 +05:30
Piña Colada 6f862131e1
Merge pull request #1038 from luukvbaal/unicodearrows
Unicode arrow indicators for O_ICONS/NERD
2021-05-31 23:02:44 +05:30
Luuk van Baal 40031b81ae Unicode arrows for O_ICONS/NERD 2021-05-31 18:41:05 +02:00
Arun Prakash Jana 859ddf8d88 Update docs 2021-05-31 17:42:06 +05:30
Piña Colada a79ef66abb
Merge pull request #1036 from luukvbaal/preview-tui
Fix preview-tui jpeg mime
2021-05-31 17:31:58 +05:30
Luuk van Baal 272e47c64a Fix preview-tui jpeg mime 2021-05-31 11:43:51 +02:00
Arun Prakash Jana 6a904f7cf5
Fix #1034: do not auto-generate packages for SuSE 2021-05-31 04:51:19 +05:30
Piña Colada 63913115df
Merge pull request #1035 from luukvbaal/manhome
Update man page
2021-05-31 04:37:41 +05:30
Luuk van Baal cc8a21fa61 Update man page 2021-05-31 01:04:07 +02:00
Piña Colada 2238fa9cbc
Merge pull request #1033 from luukvbaal/preview-tui
Preview-tui-ext to preview-tui
2021-05-31 03:48:32 +05:30
Luuk van Baal e4988f0264 Preview-tui-ext to preview-tui 2021-05-30 23:48:10 +02:00
Piña Colada 6eda83097a
Merge pull request #1032 from luukvbaal/imgplugins
Add ucollage to imgview
2021-05-31 01:12:34 +05:30
Luuk van Baal b6fd7d928c Add ucollage to imgview 2021-05-30 21:33:48 +02:00
Piña Colada 609b6a426a
Merge pull request #1031 from luukvbaal/imgplugins
Merge image plugins
2021-05-31 00:54:57 +05:30
Luuk van Baal 2f9c700537 Merge image plugins 2021-05-30 20:11:54 +02:00
Arun Prakash Jana 6d817a41e3
Update documentation 2021-05-30 23:29:10 +05:30
Arun Prakash Jana 6f29138299
Clear the selection for uniform behaviour 2021-05-29 16:06:42 +05:30
Arun Prakash Jana c54ba35ce0
Get rid of getchar() 2021-05-29 15:15:27 +05:30
Arun Prakash Jana 4ea0d70217
Alt+Esc to quit context from filter prompt 2021-05-29 13:16:19 +05:30
Arun Prakash Jana 46e1d6bdda
Remove ntfw-specific code 2021-05-29 12:51:57 +05:30
Arun Prakash Jana 85c108a5d6
Decouple variable documentation section 2021-05-29 10:25:21 +05:30
Arun Prakash Jana 6bb6ddfe8a
Fix condition 2021-05-29 03:40:00 +05:30
Arun Prakash Jana 4bc8e1a8be
Rename plugin fzdirs to fzcd, retains fzcd features 2021-05-29 01:12:12 +05:30
Arun Prakash Jana a6eeceec55
fzdirs - check if the first entry in path-list exists 2021-05-28 23:46:00 +05:30
Arun Prakash Jana f6b14f6505
Restore hovered file name on select and run plugin 2021-05-28 23:31:20 +05:30
Arun Prakash Jana b397606d0a
fzdirs: support default list, default to $PWD 2021-05-28 23:30:29 +05:30
Arun Prakash Jana 462531b8c7
Plugin fzdirs: fuzzy search multiple directories 2021-05-28 19:17:08 +05:30
Arun Prakash Jana 831287c92e
Show number of files selected in local buffer, if any
Even if selection mode is not on, it helps to show
number of files currently selected in local buffer.
Say, after running a plugin selection mode goes off.
However, if the plugin doesn't clear the selection
buffer, the files still remain selected in buffer.
2021-05-27 23:47:59 +05:30
Arun Prakash Jana 30ee27802e
plugin cleanfilename -> fixname, unmount-parent -> umounttree 2021-05-27 19:19:51 +05:30
Arun Prakash Jana a8c52134f6 Attempt to create a new context with Shift-TAB, else reverse cycle 2021-05-27 18:12:35 +05:30
Piña Colada 28731a10f7
Merge pull request #1028 from luukvbaal/makefile
Update haiku Makefile
2021-05-27 01:04:56 +05:30
Luuk van Baal 0a569496c8 Update haiku Makefile 2021-05-26 20:54:00 +02:00
Arun Prakash Jana 326d5a4fae Update musl compilation script 2021-05-26 23:48:38 +05:30
luukvbaal 78b2170e03
Ignore NOLC when ICONS/NERD are set (#1027) 2021-05-26 23:47:38 +05:30
Arun Prakash Jana 284a3c4866
Multi-threaded FTS-based disk usage calculation
Implements pthreads based du using FTS. Currently 4 threads are used.
NFTW is dropped as there is no way to pass any custom values to fn().

FTS does not require any per entry function callback.
The performance numbers are best with FTS:

./nnn-fts -T d /  5.29s user 0.94s system 116% cpu 5.335 total
1/21 du:102.402G free:8.476G files:397644 101132550144B

./nnn-ftw -T d /  5.52s user 0.94s system 116% cpu 5.534 total
1/21 du:102.400G free:8.474G files:397653 101133148160B

./nnn-4.0 -T d /  0.20s user 2.27s system 24% cpu 10.241 total
1/21 du:102.400G free:8.475G files:397654 101133299712B
2021-05-26 22:28:38 +05:30
Arun Prakash Jana 025b570e05
Fix du calculation 2021-05-26 03:16:01 +05:30
Arun Prakash Jana db8079f552
Make option O_NOLOC renamed to O_NOLC 2021-05-24 22:38:08 +05:30
Arun Prakash Jana fdeba8a87e
Dynamic view update in disk usage mode 2021-05-24 02:56:12 +05:30
Arun Prakash Jana 1017413474
Fix spelling, remove Known Issues section in favour of Troubleshooting Wiki 2021-05-23 20:08:11 +05:30
Arun Prakash Jana 53e98a9fd1
Minor changes to nuke 2021-05-22 08:34:59 +05:30
Arun Prakash Jana 88f71ff35d
Suppress session open failure msg in picker mode 2021-05-21 08:05:44 +05:30
Arun Prakash Jana 54d760b9f5
Fix #1023: support named persistent settions 2021-05-20 09:56:55 +05:30
Arun Prakash Jana 36e1544b32
Update ToDo list 2021-05-19 18:31:55 +05:30
Luuk van Baal b89c32b9fa
Preview-tui fix winch_handler 2021-05-19 04:48:03 +05:30
Arun Prakash Jana 2bd72d1b29
Remove pickraw, fix selection not picked on Q 2021-05-18 08:25:23 +05:30
Arun Prakash Jana edab98ab6d Fix opener key for archive 2021-05-18 07:58:11 +05:30
Piña Colada bb5642291c
Merge pull request #1018 from luukvbaal/preview-tui
Preview-tui fixes
2021-05-18 06:41:33 +05:30
Luuk van Baal d64242aec3 Preview-tui fixes 2021-05-18 00:19:41 +02:00
Arun Prakash Jana 45ac90d5e6 Exit nnn if plugin picks files 2021-05-18 00:49:25 +05:30
Piña Colada 9a949b7c33
Merge pull request #1017 from luukvbaal/cmusq
Exit cmusq when missing
2021-05-17 08:57:07 +05:30
Luuk van Baal 88eb45944c Exit cmusq when missing 2021-05-16 23:39:10 +02:00
Piña Colada 8a36196e98
Merge pull request #1016 from luukvbaal/preview-tui
Hide terminated message in preview-tui
2021-05-17 02:28:40 +05:30
Luuk van Baal 8eced6c5d4 Hide terminated message in preview-tui 2021-05-16 22:56:47 +02:00
Arun Prakash Jana cbc4587630
Fix nnn.vim #82: support picker plugins
Plugins like fzopen have the capability to pick files.
This comes handy if nnn is executing as a file picker.

This is a 2-way communication:

- nnn sends the picker output file to plugin ("-" for stdout)
- the plugin tells nnn if it has overwritten the output file
2021-05-17 01:11:35 +05:30
Piña Colada 715abc7a3f
Merge pull request #1015 from luukvbaal/preview-tui
Fix preview-tui zombie pager
2021-05-16 16:47:40 +05:30
Luuk van Baal 5cc98987c5 Fix preview-tui zombie pager 2021-05-16 13:02:12 +02:00
Piña Colada a95ed82f60
Merge pull request #1013 from luukvbaal/preview-tui
Preview-tui cleanup
2021-05-16 08:46:30 +05:30
Luuk van Baal 5fba2ba749 Preview-tui cleanup 2021-05-16 02:11:05 +02:00
Arun Prakash Jana 31c34740bc
Fix no file picked with NNN_TMPFILE set and quit with 'q'
If NNN_TMPFILE is exported, the selection buffer gets cleared as it is
combined with `^G` (clear picked files and exit). So even when 'q' is
pressed to quit the program the selection is lost. This was introduced
in commit d1d491c102 after release v2.7.
2021-05-16 03:23:03 +05:30
Arun Prakash Jana 79cbcc18e1
Update nuke to use mocq 2021-05-16 02:46:17 +05:30
Piña Colada db240eeeda
Merge pull request #1011 from luukvbaal/cmusq
Wait until cmus is ready and fix fzplug preview command
2021-05-16 02:02:28 +05:30
Luuk van Baal f7e84bed70 Wait until cmus is ready and fix fzplug preview command 2021-05-15 22:24:40 +02:00
Arun Prakash Jana 7bbacd0f0d
Minor edits 2021-05-16 01:49:52 +05:30
Arun Prakash Jana 4dcefcc4d4
Rename plugin mocplay to mocq 2021-05-16 00:25:47 +05:30
Kabouik 69d63ff50e
Add plugin cmusq (#1010)
* Fix conflict with #1006

* Queue/play in cmus player

* Remove leftover comments

* start_cmus function, optional xdotool dependency, better process waiting

* start_cmus function, better process waiting, optional xdotool dep

* Merge conflicts

* Better reporting of past actions

* Discriminate newly started queue and existing queue

* Harmonize descriptions, rename cmusqueue to cmusq, clean cmusq code

* Remove cmusqueue

* Exit if cmus missing and style changes

Co-authored-by: luukvbaal <31730729+luukvbaal@users.noreply.github.com>
2021-05-16 00:15:48 +05:30
Arun Prakash Jana 5e8ef070dc
Sanitize in-plugin documentation 2021-05-15 23:02:01 +05:30
Arun Prakash Jana 24080569b8
Chnage tabs to spaces 2021-05-15 06:57:20 +05:30
luukvbaal bb37c9dd46
If/else to case in preview-tui (#1009)
* If/else to case in preview-tui

* Fix conflict between #1004 #1006
2021-05-14 22:46:30 +05:30
Kabouik b14d2311e6
More minimal bat previews, minor improvements to fzplug (#1004)
* More minimal bat previews, minor improvements to fzplug

* Use BAT_STYLE if set, better fzplug formatting

* Fix linebreak in single quotes

* Fix line numbers in comments

* Readability and shellcheck warning

* Fix line numbers in comments

* Breaking typo

* Pre-existing BAT_STYLE would not be honored in tmux
2021-05-14 19:59:43 +05:30
Arun Prakash Jana 7a76ca8548
Remove unnecessary redirection 2021-05-14 18:45:09 +05:30
Arun Prakash Jana f343f315b5
Replace which with builtin type in plugins 2021-05-14 17:33:28 +05:30
Arun Prakash Jana 513b4f24a6
Optimize loop comparison 2021-05-14 12:38:07 +05:30
Arun Prakash Jana 1fabac27ba
Fix hovered marking on empty directory 2021-05-14 11:55:52 +05:30
Arun Prakash Jana 3316e2acdb
Show du/au details on enabling disk usage mode 2021-05-14 11:38:44 +05:30
Arun Prakash Jana 6222cac4bf
Reduce checks in per-entry print loop 2021-05-14 11:25:38 +05:30
Arun Prakash Jana 177b60e6c2 shellcheck fixes + use the last known good commit 2021-05-14 08:48:05 +05:30
Piña Colada 2ca11a34e7
Merge pull request #1006 from luukvbaal/preview-tui
Kill kitty icat in preview-tui
2021-05-14 07:52:54 +05:30
Piña Colada d83acda68b
Merge pull request #1005 from luukvbaal/icons
Fix .iconlookup typo
2021-05-14 07:45:36 +05:30
Luuk van Baal 9560a91f97 Kill kitty icat in preview-tui 2021-05-14 03:30:27 +02:00
Luuk van Baal 2edf59fef1 Fix .iconlookup typo 2021-05-14 02:08:45 +02:00
Arun Prakash Jana d46918946f
Avoid faccessat(..., AT_SYM_NOFOLLOW) with musl libc
See https://www.openwall.com/lists/musl/2014/09/25/1
2021-05-14 02:11:59 +05:30
Arun Prakash Jana d0b4508798
Change debug macro DBGMODE to DEBUG 2021-05-14 00:20:59 +05:30
Arun Prakash Jana 0427f70c4e
netbsd-curses: fix broken statusbar issue
See https://github.com/sabotage-linux/netbsd-curses/issues/46
2021-05-14 00:16:48 +05:30
Arun Prakash Jana bca5763cf7
Selection marks in reverse bold 2021-05-13 19:29:16 +05:30
lawnowner 9cbb7f540c
Add the xdgdefault plugin (#1003) 2021-05-13 16:13:21 +05:30
Piña Colada dd02afc58b
Merge pull request #1002 from luukvbaal/icons
Add chess/haskell icons to .iconlookup
2021-05-13 08:43:17 +05:30
Luuk van Baal 16b2f40ffe Add chess/haskell icons to .iconlookup 2021-05-13 01:20:27 +02:00
Arun Prakash Jana 6b0f308f26
Remove redundant param 2021-05-13 00:37:09 +05:30
Arun Prakash Jana 448a4203bc
Make space for 512TiB in blocks 2021-05-13 00:37:04 +05:30
Arun Prakash Jana 04c38ecf3d
Initialize variable, update musl script 2021-05-12 22:17:44 +05:30
Arun Prakash Jana 1b88062310 Fix script 2021-05-12 21:16:48 +05:30
Piña Colada 9756ce4650
Merge pull request #1001 from CantoroMC/nerdfont
nerdfont support for chess files(pgn,fen) haskell(hs,lhs) files and hpp
2021-05-12 20:00:39 +05:30
Arun Prakash Jana 4a4628e2fc
Remove redundant/unaccessed variable 2021-05-12 19:47:56 +05:30
Piña Colada 375d1057c1
Merge pull request #1000 from KlzXS/plguin_child
Wait for child on plugin invocation
2021-05-12 19:31:38 +05:30
Marco Cantoro d6af0d2ed4 nerdfont support for chess files(pgn,fen) haskell(hs,lhs) files and hpp 2021-05-12 15:44:46 +02:00
KlzXS 56d3f2d976
Wait for child on plugin invocation 2021-05-12 08:50:24 +02:00
Arun Prakash Jana 907616a058
Fix #998: remove ^Space keybind
netbsd-curses sends a NULL (key value 0) following the KEY_RESIZE.
The keybind ^Space also issues a 0. It seems even the key ^@ sends
the same. Dropping this ambiguous keybind in favour of alternative
key m (more appropriate for 'm'ark anyway). Keys with value 0 will
now be ignored in the filter function.
2021-05-12 10:07:29 +05:30
Arun Prakash Jana 1f95c355a9
Fix template 2021-05-11 22:53:37 +05:30
Arun Prakash Jana 9c5214c24a
Compilation script for netbsd-curses + musl libc 2021-05-11 19:06:13 +05:30
Arun Prakash Jana de80bba9db
musl libc: fix run cmd prompt message 2021-05-11 16:47:48 +05:30
Arun Prakash Jana 466d138cc7
Fix #996: select all on 'A' with empty selection 2021-05-11 11:55:39 +05:30
Arun Prakash Jana e4c3f7d739
Use existing buffer to (un)select file names 2021-05-11 03:07:55 +05:30
Arun Prakash Jana 9b6e7e86bc
Fix musl-gcc compile warnings 2021-05-11 00:05:02 +05:30
Arun Prakash Jana b44d2c5071
Update README 2021-05-10 20:54:04 +05:30
Arun Prakash Jana 8575711227
Minor optimization 2021-05-10 17:25:24 +05:30
Piña Colada c506da4419
Merge pull request #994 from luukvbaal/printent
Drop printptr for if-statement
2021-05-10 16:51:07 +05:30
Luuk van Baal a359a8152c Drop printptr for if-statement 2021-05-10 12:50:45 +02:00
Arun Prakash Jana c0ccf098ec
Simplify detail print 2021-05-10 00:12:26 +05:30
Luuk van Baal a327ee4a3d
Merge and simplify unescape 2021-05-09 20:18:05 +05:30
Arun Prakash Jana eec6366272
Optimize wide char conversion, show an extra char 2021-05-09 11:33:39 +05:30
Arun Prakash Jana b5654e3188 Reduce late assignments 2021-05-09 09:03:16 +05:30
Piña Colada e075b98cfe
Reorganize README 2021-05-09 08:33:00 +05:30
Piña Colada f45967c4a0
Merge pull request #989 from luukvbaal/adjust_cols
Fix adjust_cols for icons
2021-05-09 06:58:26 +05:30
Luuk van Baal 6c450bee94 Fix adjust_cols for icons 2021-05-09 02:02:53 +02:00
Arun Prakash Jana f3fe27e694
Fix invisible details when color code is 0 2021-05-08 20:34:01 +05:30
Arun Prakash Jana e5c1b0bdd2
Update man page 2021-05-08 17:34:38 +05:30
Arun Prakash Jana 0691c4fb47
Reversed block for hovered entry in detail mode 2021-05-08 17:05:22 +05:30
Arun Prakash Jana da7dc8e6e2
Reversed block instead of ACS_CKBOARD for current 2021-05-08 08:59:51 +05:30
Arun Prakash Jana 7acc9196d5
Reverse selection mark for visibility 2021-05-08 08:48:47 +05:30
Arun Prakash Jana 4727b3baa8
Bold selection marker for better visibility 2021-05-07 23:19:37 +05:30
luukvbaal f4eb89029c
One shot guid cache (#988) 2021-05-07 23:06:24 +05:30
Arun Prakash Jana 69df38dfd4
Update text in program help 2021-05-07 10:39:02 +05:30
Arun Prakash Jana 54aa971a6b
Update man page on selection 2021-05-07 09:12:00 +05:30
Piña Colada 7a562d7b03
Merge pull request #987 from luukvbaal/printent
Use cfg.showdetail
2021-05-07 07:54:10 +05:30
Luuk van Baal 6730c0fd01 Use cfg.showdetail 2021-05-07 00:45:24 +02:00
Arun Prakash Jana b58e9fc384
Fix min columns 2021-05-06 22:50:10 +05:30
Arun Prakash Jana 0d21813b11 Revert "Skip a complete erase on redraw()"
This reverts commit 41d414c2fc.
2021-05-06 22:33:30 +05:30
Arun Prakash Jana 765986b916
Reduce some common checks in printent() 2021-05-06 21:50:35 +05:30
Arun Prakash Jana 41d414c2fc
Skip a complete erase on redraw() 2021-05-06 12:34:31 +05:30
Arun Prakash Jana 0eeae6ee7b
Retain filter in filter mode when opening files 2021-05-05 13:09:54 +05:30
Arun Prakash Jana bd47846185
Shorten some strings 2021-05-05 08:05:07 +05:30
Arun Prakash Jana 949f76ec16
Drop brackets and simplify context printing logic 2021-05-05 07:20:08 +05:30
Arun Prakash Jana d4767e6d47 Update docs 2021-05-03 20:11:40 +05:30
Piña Colada 19a5ef8a61
Merge pull request #984 from luukvbaal/preview-tui
preview-tui: fix preview dir
2021-05-02 06:17:52 +05:30
Luuk van Baal d73569be73 preview-tui: fix preview dir 2021-05-02 00:54:42 +02:00
Piña Colada 703be56930
Merge pull request #983 from luukvbaal/preview-tui
preview-tui: fix cleanup/resize
2021-05-01 21:55:37 +05:30
Luuk van Baal 65e306feec preview-tui: fix cleanup/resize 2021-05-01 18:12:13 +02:00
luukvbaal 74785069e0
preview-tui: kitty gif/pager fallback (#981)
* preview-tui: kitty gif/pager fallback

* preview-tui: test QUICKLOOK and return
2021-05-01 21:13:24 +05:30
Arun Prakash Jana 2ac70152a4
Reorder entries 2021-05-01 12:22:51 +05:30
Arun Prakash Jana 3ab8bf1c16
Fix #978: store nanosec field 2021-05-01 10:16:26 +05:30
KlzXS 002758063e
Update .nmv 2021-05-01 06:23:39 +05:30
KlzXS 36d86a294d
Make batchrename interactive 2021-05-01 06:23:39 +05:30
Kabouik c2aeb51bcc
[Plugins] Fuzzy find plugins and run them; unmount mountpoints from their subfolders (#977)
* Fuzzy find plugins and run them

* Hide find warning when $otherplugins is not set

* Fix prompt on error 2

* Use /home/mathieu

* unmount-parent plugin

* Add dependencies and shell description

* Add dependencies and fix CI issue?

* Improve fzfplug prompt, fix shellcheck warnings, restore mistakenly deleted line in README

* Typo

* Make both scripts POSIX-compliant and small improvements

* Final cosmetic changes

* bis

* Clarify description

* Typo

* Typo

* Better support for custom dirs and use bat if available

Co-authored-by: M <>
2021-05-01 06:23:33 +05:30
luukvbaal 5ed2998023
preview-tui: update prompts (#980) 2021-04-30 18:59:11 +05:30
Arun Prakash Jana e8bebac168
Remove unavailable option 2021-04-29 09:25:56 +05:30
Arun Prakash Jana 714d806341
Return selection if external selection exists 2021-04-28 13:37:03 +05:30
luukvbaal 802a7794ae
Fix #974: picker mode broken (#975)
Co-authored-by: Piña Colada <engineerarun@gmail.com>
2021-04-28 11:53:13 +05:30
Arun Prakash Jana 163102e8ae
Fix #976: check external selection in 'c'urrent / 's'el prompt 2021-04-28 11:46:07 +05:30
Luuk van Baal 7a7fd5fcab preview-tui: ls flags 2021-04-27 21:37:18 +02:00
luukvbaal 4ebc396250
preview-tui: restore tree view (#972) 2021-04-28 00:58:38 +05:30
Arun Prakash Jana 0c88d1c210
Fix CI break: disable readability-function-cognitive-complexity 2021-04-28 00:23:41 +05:30
luukvbaal d998943119
preview-tui: error to foreground (#970)
* preview-tui: error to foreground

* preview-tui: test KITTY_LISTEN_ON
2021-04-27 11:56:52 +05:30
luukvbaal b97e2d02ea
preview-tui: reformat toggle (#966) 2021-04-26 20:51:52 +05:30
Arun Prakash Jana eea4d34423
Fix build break 2021-04-26 07:31:15 +05:30
Arun Prakash Jana 34c3d2116a
Bksp/Del at empty filter prompt to refresh dir and retain prompt 2021-04-26 00:53:48 +05:30
Arun Prakash Jana 1fde10b022
Fix LGTM alerts 2021-04-25 16:54:43 +05:30
luukvbaal 1241a4d75d
Update README.md 2021-04-25 16:54:35 +05:30
akimdi c673840d5d
added flag -f for big files 2021-04-24 20:55:21 +03:00
Piña Colada b0a985bca8
Merge pull request #963 from luukvbaal/preview-tui
preview-tui: reformat QuickLook
2021-04-24 04:28:21 +05:30
Luuk van Baal cbbefe805a preview-tui: reformat QuickLook 2021-04-24 00:36:05 +02:00
Arun Prakash Jana 4648a56178
Add QuickLook to description 2021-04-23 04:07:26 +05:30
Piña Colada 59dfffd004
Merge pull request #961 from luukvbaal/preview-tui
preview-tui: close previewer
2021-04-23 03:51:16 +05:30
Luuk van Baal 15031f7d9e preview-tui: close previewer 2021-04-22 21:45:23 +02:00
Piña Colada f0c64a89b8
Merge pull request #960 from luukvbaal/quicklook
preview-tui: add QuickLook support for WSL
2021-04-22 21:05:23 +05:30
Luuk van Baal 77640a6434 preview-tui: add QuickLook support 2021-04-22 14:15:42 +02:00
Piña Colada a629707eec
Merge pull request #957 from luukvbaal/preview-tui
preview-tui-ext: reformat archive preview
2021-04-21 21:06:32 +05:30
Luuk van Baal ec3f754192 preview-tui-ext: reformat archive preview 2021-04-21 16:39:15 +02:00
Piña Colada 47a779b1bf
Merge pull request #955 from rck/master
preview-tui-ext: use atool for rpm/deb
2021-04-21 18:17:13 +05:30
luukvbaal 48898eeb8b
preview-tui: directory preview/iconlookup (#954)
* preview-tui: directory preview/iconlookup

* preview-tui-ext: NNN_ARCHIVE note
2021-04-21 18:14:38 +05:30
Roland Kammerer 5c1c732fb7 preview-tui-ext: use atool for rpm/deb
atool does good job in previewing the content of deb/rpm files, use it.
2021-04-21 11:41:58 +02:00
Piña Colada cd070a6228
Merge pull request #953 from akimdi/master
added support ico format
2021-04-20 06:35:15 +05:30
akimdi 5f67acd8b8
added ico format to nuke plugin 2021-04-20 04:01:44 +03:00
akimdi 794048b306
added ico format to imgview plugin 2021-04-20 04:00:30 +03:00
Piña Colada c49f24c696
Merge pull request #951 from luukvbaal/preview-tui-ext
preview-tui-ext: pass env
2021-04-18 16:35:02 +05:30
Luuk van Baal 14350b94a8 preview-tui-ext: pass env 2021-04-18 12:58:50 +02:00
Arun Prakash Jana e09148e386
Update readme 2021-04-18 15:10:39 +05:30
Arun Prakash Jana b08aa8330d
Update docs 2021-04-18 08:36:14 +05:30
Arun Prakash Jana 6d2325e18a
Minor reformat to fix build break 2021-04-17 20:55:37 +05:30
Arun Prakash Jana 69431e49a9
Got to last dir on '~' or '/' key repeat 2021-04-17 20:25:58 +05:30
Arun Prakash Jana 430833326b
Minor plugin update 2021-04-17 19:25:07 +05:30
Arun Prakash Jana 25157592df
make option NOX11: disable notis, sel to clipboard sync, xterm title 2021-04-17 13:08:34 +05:30
Arun Prakash Jana 2b94c29e1d
Add clang 11 to CI 2021-04-17 01:22:49 +05:30
Arun Prakash Jana 30e1c54e0e
Update docs 2021-04-17 00:18:34 +05:30
Arun Prakash Jana b5015b8e6c
Set Haiku variety to dev 2021-04-13 16:56:16 +05:30
Arun Prakash Jana f4c5b1a937
Happy Birthday nnn! 🍰 2021-04-13 16:35:13 +05:30
Arun Prakash Jana 5bfc868321 Show xterm title on option '-x' 2021-04-13 16:34:06 +05:30
Mischievous Meerkat 285463253c
Merge pull request #946 from luukvbaal/demo
Update README demo
2021-04-13 16:33:13 +05:30
Luuk van Baal ad4f0cbbef Reduce thumbnail image size 2021-04-13 13:00:58 +02:00
Luuk van Baal 1fd61ca5f5 Update README demo 2021-04-13 12:52:27 +02:00
Arun Prakash Jana ad40ae9b53
Set Haiku variety to dev 2021-04-13 16:04:34 +05:30
Arun Prakash Jana a482e8afe5
Prepare for release v3.7 Sushi 2021-04-13 11:07:25 +05:30
Arun Prakash Jana 0c55e74fb5
Minor refactor 2021-04-13 09:06:26 +05:30
Arun Prakash Jana ee04215d91
Fix #941: on macOS set depth to OPEN_MAX for nftw() 2021-04-11 01:06:02 +05:30
Mischievous Meerkat 99a8f761cf
Merge pull request #942 from luukvbaal/nerdicons
nerdicon/preview fixes
2021-04-09 23:50:08 +05:30
Luuk van Baal 710e621735 more icon changes 2021-04-09 14:10:12 +02:00
Luuk van Baal eb98b9076b restore indicators 2021-04-09 12:25:29 +02:00
Luuk van Baal a5a1c7b82c nerdicon/preview fixes 2021-04-09 12:13:32 +02:00
Arun Prakash Jana a1cb764943
make option O_CKBOARD for checker board indicator in detail mode 2021-04-09 12:05:03 +05:30
Arun Prakash Jana 903a4b3a66
Use printw() to print time 2021-04-08 03:13:43 +05:30
Mischievous Meerkat 9a73057272
Merge pull request #939 from luukvbaal/printw
print_details: printw align
2021-04-08 02:55:53 +05:30
Luuk van Baal ada4695bb6 ind to char 2021-04-07 23:10:12 +02:00
Arun Prakash Jana dc9d877941
Use ACS_CKBOARD for currrent entry in detail mode 2021-04-08 02:38:29 +05:30
Luuk van Baal f1f147c928 print_details: printw align 2021-04-07 23:00:48 +02:00
Mischievous Meerkat a0be1c33cb
Merge pull request #938 from akimdi/master
added support svg format
2021-04-07 23:02:20 +05:30
akim 534aa355a1 added support svg format 2021-04-07 19:31:53 +03:00
Arun Prakash Jana a44b23786f
Use a single routine for common code 2021-04-07 09:17:36 +05:30
Arun Prakash Jana b3132d6398
Combine multiple functions 2021-04-06 21:59:21 +05:30
Arun Prakash Jana f27df77777
Minor refactor 2021-04-06 20:02:56 +05:30
Arun Prakash Jana edacfcc828
Remove loop for printing spaces 2021-04-06 16:25:02 +05:30
Arun Prakash Jana 0223d53584
Fix #936: name col len in old color mode and icons 2021-04-06 10:53:04 +05:30
Arun Prakash Jana b0fd7a5ffe
Reverse only hovered file name in detail mode
Changes:

- reverse only the file name in detail view
- don't apply reverse to details, show an arrow to the left
- always show selection ('+' symbol) in bright
- delegate showing selection '+' to printent()
2021-04-06 10:03:56 +05:30
Arun Prakash Jana dd5588650d
Initialize once 2021-04-06 04:36:34 +05:30
Arun Prakash Jana ed23e494a9
Replace printw(), optimize xitoa() 2021-04-06 03:28:02 +05:30
Arun Prakash Jana a62bcd3f87
Pass mode directly for indicator 2021-04-06 00:19:32 +05:30
Arun Prakash Jana ed55fbd9d5
Compact switch cases 2021-04-05 21:49:14 +05:30
Arun Prakash Jana 98308b8444
Continuous reverse for current entry in 8-color mode 2021-04-05 21:27:54 +05:30
exoton 98a0f7484a
Refactor printent/printent_long (DRY) (#934)
* Refactor printent/printent_long (DRY)

* Extend selection gap for icons, fix device names.
2021-04-05 21:26:25 +05:30
Arun Prakash Jana a6a09338a2 Reformat UID/GID printing in statusbar 2021-04-05 21:04:44 +05:30
Mischievous Meerkat df6dbbb84c
Merge pull request #932 from luukvbaal/preview-tui
.iconlookup: refactor
2021-04-01 20:28:42 +05:30
Luuk van Baal c3a472a7e2 .iconlookup: refactor 2021-04-01 16:17:46 +02:00
Arun Prakash Jana 3f47c6ee55
Update readme 2021-03-31 03:13:18 +05:30
Mischievous Meerkat da734c50da
Merge pull request #931 from luukvbaal/preview-tui
.iconlookup: shebang to env sh
2021-03-30 21:24:47 +05:30
Luuk van Baal 9fcdf78643 .iconlookup: shebang to env sh 2021-03-30 17:49:31 +02:00
luukvbaal 5cf723fbe4
preview-tui-ext: match nnn directory preview (#927)
* preview-tui-ext: add optional dependency iconlookup

* new plugin: .iconlookup
2021-03-30 20:55:56 +05:30
Arun Prakash Jana 34f20ea678 Man page update
Pick up some improvements from PR #929
2021-03-30 09:11:55 +05:30
Mischievous Meerkat e459d912b0
Merge pull request #930 from exoton/cdpath
Truncate the name, add comments.
2021-03-30 08:32:47 +05:30
Yuri Kloubakov 1a0c9d0c90 Truncate the name, add comments. 2021-03-29 21:29:03 -04:00
exoton 42aa97b112
Add new plugin (#928)
* Add new plugin

* Small cdpath refactoring

* Change the default CDPATH value, remove string indexing.

* Remove readlink() call to be POSIX compliant.

* Fix the comment
2021-03-29 08:09:42 +05:30
luukvbaal 832676984b
exchange double width glyph (#926) 2021-03-28 17:27:57 +05:30
Rudolf Adamkovič 655e8886f1
Improve consistency/spelling in some comments (#924)
* [comments] Fix incorrectly spelled verb "set up"

* [comments] Fix incorrectly capitalized "MIME" (as in MIME types)

* [comments] Fix inconsistent spelling: "filename" vs "file name"

* [comments] Add missing whitespace

* [comments] Make a comment capitalized like its sibings

* [comments] Improve sentence clarity with a comma

* [comments] Fix inconsistent spelling: "Esc" vs "Escape"

* [comments] Improve consistency of spelling and spacing

* Change 'set up' to 'set-up'
2021-03-28 07:25:43 +05:30
Arun Prakash Jana 603c1580e8
Set correct plugin language 2021-03-28 01:51:43 +05:30
Arun Prakash Jana 6dfea38999
Update readme 2021-03-28 01:46:07 +05:30
Arun Prakash Jana b29d898350
Fix build break 2021-03-28 01:16:22 +05:30
Arun Prakash Jana 8542f5bc33
Use better pipe check 2021-03-28 00:59:23 +05:30
Arun Prakash Jana ccf2927b6d
Replace $HOME with '~' in address bar 2021-03-27 23:28:23 +05:30
Arun Prakash Jana e5d44ce223 Replace $HOME by '~' in terminal title 2021-03-27 22:15:11 +05:30
Benawi Adha 0f4dfee6c6
plugins: cleanfilename: sh->bash and added support for cleaning newline (#923)
* plugins: cleanfilename: sh->bash and added support for cleaning newline

* plugins: cleanfilename: sh->bash and added support for cleaning newline
2021-03-27 19:36:17 +05:30
Arun Prakash Jana 37fbed2fb7
Fix plugin readme table 2021-03-27 19:34:41 +05:30
Arun Prakash Jana 980fd80aa9
Do not clear selection on single file removal 2021-03-27 19:07:40 +05:30
Arun Prakash Jana 7f5dbd11e3
Fix #917: enhance plugin framework to clear sel on request
With this enhancement, plugins which operate on selection
can explicitly request the program to clear the selection.
2021-03-27 17:12:21 +05:30
Arun Prakash Jana 7c63dc8d73
Fix CI break due to size of browse() 2021-03-26 20:08:23 +05:30
luukvbaal d5dac4c686
Show non matching guid in statusbar (#921) 2021-03-26 19:24:54 +05:30
Arun Prakash Jana 9c218d41e8
Fix #918: picker mode broken 2021-03-26 01:14:16 +05:30
Benawi Adha b0aa1fe379
plugins: cleanfilename: fixed to not overwrite existing file (#916)
* plugins: cleanfilename: fixed to not overwrite existing file

* plugins: cleanfilename: fixed to not overwrite existing file
2021-03-26 01:06:25 +05:30
Arun Prakash Jana f602cbee07
Reorder table alphabetically 2021-03-25 01:11:10 +05:30
Mischievous Meerkat 7233935109
Merge pull request #915 from leovilok/term-title-clear-stack
Save/load the terminal window title using xterm esc sequences
2021-03-25 01:07:16 +05:30
Léo Villeveygoux 5bba7b45fa Save/load the terminal window title using xterm esc sequences 2021-03-24 15:40:29 +01:00
Benawi Adha f176d81ea0
plugin: verbosepaste: gives copy-paste verbose progress percentage (#914)
* plugin: verbosepaste: gives copy-paste verbose progress percentage

* plugin: verbosepaste: gives copy-paste verbose progress percentage
2021-03-24 17:39:08 +05:30
Arun Prakash Jana d8e370e579
Update contributing guideline 2021-03-24 15:21:06 +05:30
Benawi Adha c61a716e11
plugin: cleanfilename: clean filename to be more shell-friendly (#913)
* plugins: cleanfilename: clean filename to be more shell-friendly

* plugins: cleanfilename: clean filename to be more shell-friendly

* plugins: cleanfilename: clean filename to be more shell-friendly

* plugins: cleanfilename: clean filename to be more shell-friendly

* plugins: cleanfilename: clean filename to be more shell-friendly
2021-03-24 14:51:38 +05:30
lvgx 1c2cb7fd31
Show path in terminal title (#912)
* Show path in terminal title

* Better terminal window title format

Title is now "basename (full/path)"
2021-03-24 06:50:51 +05:30
luukvbaal f90e567a17
cache and constraint preview dimensions (#910)
* cache and constraint preview dimensions

* cache subdirectory

* optional caching

* revert to ext for pdf/epub
2021-03-24 06:43:18 +05:30
Benawi Adha 638676a689
plugins: mtpmount: toggle mount of MTP devices (#909)
* plugins: mtpmount: toggle mount of MTP devices

* plugins: mtpmount: added some quotes

* plugins: mtpmount: toggle mount of MTP devices

* plugins: mtpmount: toggle mount of MTP devices

* plugins: mtpmount: toggle mount of MTP devices

* plugins: mtpmount: toggle mount of MTP devices
2021-03-23 19:42:10 +05:30
luukvbaal e0822fdef4
fill preview-tui preview (#907)
* fill preview pane

* add xcf preview and fix formatting

* test which convert

* restore -bL
2021-03-22 06:24:29 +05:30
Arun Prakash Jana 9f0a374255
Show number of links and inode num for hard links 2021-03-21 21:24:47 +05:30
Arun Prakash Jana 2f6046e6da
Use short options 2021-03-21 19:33:43 +05:30
luukvbaal 73a54e7550
preview-tui-ext ffmpegthumbnailer fallback (#906) 2021-03-21 18:53:56 +05:30
luukvbaal bc59961d98
preview-tui-ext jpg previews (#905)
* switch to jpg previews

* add ueberzug scaler
2021-03-21 15:59:44 +05:30
luukvbaal 9544eb91d2
generate_preview fallback (#904) 2021-03-21 09:19:19 +05:30
luukvbaal bebad983ca
fix fontpreview (#903) 2021-03-21 07:59:06 +05:30
luukvbaal ac29a7c166
preview-tui fixes (#900)
* redraw preview on resize

* fix stray preview pane after exit

* restore cleanup

* fix image bin info fallback
2021-03-21 07:11:14 +05:30
Arun Prakash Jana 49c458517f
Show symlink size on readlink failure 2021-03-21 06:53:38 +05:30
Arun Prakash Jana 71083b0670
Show correct symlink size in sttausbar 2021-03-21 06:25:17 +05:30
Arun Prakash Jana c625679d58
Remove redundant chars in symlink target display 2021-03-21 05:58:34 +05:30
Arun Prakash Jana 2fc61a8f48
Add more previewers 2021-03-21 00:01:46 +05:30
Arun Prakash Jana 4a45e45b30
Add bsdtar for archives, w3m for html 2021-03-20 23:36:24 +05:30
luukvbaal fdf40df5e9
replace preview-tui demo (#898) 2021-03-20 15:14:18 +05:30
Arun Prakash Jana 943728dd14 Update README 2021-03-20 06:40:49 +05:30
luukvbaal 2e4aca5e6b
preview-tui(-ext) subshell job control (#891)
* subshell job control

* remove unnecessary kill

* Update docs

* update PAGER and tree command

* restore clear
2021-03-20 06:28:46 +05:30
Arun Prakash Jana a88bbe1a9c
Use earlier asciicast in plugins readme. 2021-03-20 06:26:14 +05:30
luukvbaal f596ae2359
Update preview-tui demo 2021-03-19 22:16:38 +01:00
Luuk van Baal 77cde578e0 preview-tui demo 2021-03-19 22:08:10 +01:00
Arun Prakash Jana 4c8e2e25b8
Fix garbled symlink target 2021-03-19 00:27:45 +05:30
Arun Prakash Jana 5f0b3b74d0
Fix #889: clear selection if plugin doesn't send data 2021-03-19 00:00:37 +05:30
Arun Prakash Jana c825a9e541
Fix #893: show symlink target in statusbar 2021-03-18 23:45:32 +05:30
Arun Prakash Jana 381b251fd0
Fix #890: wrong macro 2021-03-18 22:35:59 +05:30
Arun Prakash Jana 317076b893
Update doc 2021-03-18 01:52:13 +05:30
Arun Prakash Jana fddc5086dd
Fix #888: wrong volume free/total size on macOS 2021-03-17 23:37:26 +05:30
Arun Prakash Jana 93ca773c59
Resurrect current/sel prompt 2021-03-17 23:06:08 +05:30
Arun Prakash Jana 2dccb94f3f Revert "Favor selection over current for nmv"
This reverts commit c9c1d0d454.
2021-03-17 22:19:01 +05:30
Arun Prakash Jana 12e7e2c7e0
Revert clear selection on plugin invocation
Many plugins are used for navigating to the target directory.

This reverts commit 026f76f14c.
2021-03-17 02:12:21 +05:30
Mischievous Meerkat 571363b0f9
Merge pull request #883 from salutis/patch-1
Improve clarity and consistency of README.md
2021-03-16 18:11:21 +05:30
Rudolf Adamkovič 02eb42b0ed
Improve clarity and consistency of README.md 2021-03-16 11:34:09 +01:00
Arun Prakash Jana d40137f7b3
Update Haiku makefile 2021-03-16 01:25:14 +05:30
Arun Prakash Jana 234a7e0080
Prepare for release v3.6 2021-03-16 00:52:50 +05:30
Mischievous Meerkat 3c0c5951ee
Merge pull request #877 from luukvbaal/preview-tui
cleanup fifo
2021-03-14 20:10:47 +05:30
Luuk van Baal 7527125487 cleanup fifo 2021-03-14 15:28:50 +01:00
Arun Prakash Jana 519ea8347e
Update docs 2021-03-14 16:23:46 +05:30
Arun Prakash Jana 3cd93a355a
Minor code reformat for clarity 2021-03-14 14:35:19 +05:30
Arun Prakash Jana bd95763c7a
Fix shellcheck report 2021-03-14 12:59:24 +05:30
luukvbaal ac72d2c66e
Fix preview-tui-ext and ueberzug support for preview-tui (#875)
* fix preview-tui-ext

* add ueberzug to preview-tui

* abolish config variables

* kitty
2021-03-14 12:23:03 +05:30
Arun Prakash Jana e8577baab2
Fix #876: fzcd - go to dir and select file 2021-03-14 12:19:40 +05:30
luukvbaal 1571ea2b35
preview-tui improvements (#869)
* Update preview-tui

* trap SIGWINCH

* Update preview-tui

fix CircleCI test

* fix CircleCI...

* add pdf/epub

forgot to add pdf/epub when adpating my own working script to the upstream version

* add USE tests

* add office preview

allows preview of ods, odt, docx, pptx, etc

* remove resize trap, show static gif

Removed the faulty resize code and show static gif when USE_GIFPREVIEW is not set.

* loop gif playback

* refactor imagepreview

* scale kitty preview

* fix ueberzug_remove regression

* add optional atool support

* single depth, colorized tree preview

also empty pager prompt

* atool optional

* window resize working

* USE_UEBERZUG check

* conditional trap

I can't fully explain the behavior I'm seeing but this seems to work as its supposed to.

* adopt TMPDIR

* prevent extra readline after window resize

* shellcheck fix

* clear preview pane after resize

prevents (seemingly random) pager previews from showing after resize

* fix stray fifo from subshells

* add preview-tui-ext
2021-03-13 16:52:51 +05:30
Arun Prakash Jana 3387f0a6ac
Have a distinct unused msg for index 0 2021-03-06 12:20:14 +05:30
Arun Prakash Jana e901615fcc
Add check for non-empty selection buffer 2021-03-04 23:55:41 +05:30
Arun Prakash Jana 8886f1cd56
Fix regression in #864 2021-03-04 19:56:15 +05:30
Arun Prakash Jana c7140e6758
Fix #864 2021-03-04 17:51:57 +05:30
Arun Prakash Jana 822546f285
Update docs 2021-02-28 23:56:10 +05:30
Arun Prakash Jana 07afd45243
Update docs 2021-02-28 00:15:11 +05:30
Mischievous Meerkat 5c47ac651f
Merge pull request #858 from KlzXS/xdgopen
Fix frozen terminal caused by opener
2021-02-19 03:13:25 +05:30
Mischievous Meerkat 4b15535983
Merge pull request #857 from KlzXS/batch_rename
Favor selection over current for nmv
2021-02-18 00:39:00 +05:30
Mischievous Meerkat 916910bd7a
Merge pull request #856 from KlzXS/cpmvrm
Add check for empty selection
2021-02-18 00:36:15 +05:30
KlzXS 8bdd4b2e2a
Use the fix you just implemented 2021-02-17 09:08:12 +00:00
KlzXS 54b7dc4756
Fix frozen terminal
xdg-open would launch a cli program that would contest the terminal for character input
2021-02-16 22:33:09 +00:00
KlzXS c9c1d0d454
Favor selection over current for nmv 2021-02-16 21:46:56 +00:00
KlzXS a27568824e
Add check for empty selection
nop when empty
2021-02-16 21:33:42 +00:00
Arun Prakash Jana 7e307bc2ff
Fix alignment 2021-02-11 21:04:37 +05:30
Mischievous Meerkat e3c994bd36
Merge pull request #852 from 0xACE/badideascfg
state.runctx now retains bitwidth as cfg.curctx
2021-02-11 08:52:00 +05:30
0xACE 67962efbd5 state.runctx now retains bitwidth as cfg.curctx
Didn't test this out, but judging by the name of the variable this
should be a bugfix
2021-02-11 04:11:54 +01:00
Arun Prakash Jana 16de133fea
Retain a way to return to start dir if file opened 2021-02-11 05:26:51 +05:30
Arun Prakash Jana 600286b627
Always prefer selection over current file
If you have selected some files, you intend to work on them. Also, this prompt
expects <kbd>c</kbd> / <kbd>s</kbd> which should cancel the next prompt in the
delete workflow. Rest of the three workflows are non-fatal.

Benefits of removing this option:
- code reduction
- one less step in the relevant workflows (more than one prompt feels dragged)

This prompt shows in the following workflows:
- delete: users have explicitly requested to prefer sel over current
- batch rename: key <kbd>^R</kbd> renames a single file
- archive: in most of the cases the user would want to archive the selection
- create sym/hard link: not a frequently used workflow (in general)
2021-02-10 05:12:40 +05:30
Arun Prakash Jana 026f76f14c
Clear selection after successful plugin invocation 2021-02-10 04:25:08 +05:30
Mischievous Meerkat d07c4907de
Merge pull request #851 from Lucas-Summers/master
adding support for ueberzug into plugins/preview-tui
2021-02-10 03:54:30 +05:30
Lucas Summers 8a12c01da4 fixed shellcheck errors for plugins/preview-tui 2021-02-09 10:32:32 -08:00
Lucas Summers 83232684a8 integrated ueberzug into plugins/preview-tui 2021-02-08 18:16:28 -08:00
Arun Prakash Jana 118657020e
Fix indentation in helpstr 2021-02-08 07:13:16 +05:30
Mischievous Meerkat 4178f62ece
Merge pull request #849 from uvelichitel/master
Correct umount fusefs on FreeBSD. rel. issue  #848
2021-01-31 08:25:05 +05:30
uvelichitel 3776f72af1 Correct umount fusefs on FreeBSD 2021-01-31 00:47:09 +03:00
Mischievous Meerkat d23cc2fe15
Merge pull request #840 from freddii/master
fixed wrong spelled words
2021-01-18 19:03:38 +05:30
Arun Prakash Jana 5d8738544b
Fix #839 2021-01-18 18:59:59 +05:30
freddii 50386ff511 fixed wrong spelled words 2021-01-18 13:55:28 +01:00
Mischievous Meerkat 86abd83dfd
Merge pull request #839 from bagnacauda/wall_update
Updated wall plugin to the standard utility file
2021-01-18 16:15:30 +05:30
Simone f23452396e Updated wall plugin to the standard utility file 2021-01-18 11:34:19 +01:00
Mischievous Meerkat f4baa394be
Merge pull request #836 from KlzXS/makefile
Fix #835
2021-01-13 20:36:33 +05:30
KlzXS 7310a9a773
Fix #835 2021-01-13 14:13:07 +00:00
Robin Schneider 25eba96466
Use HTTPS everywhere (mechanical edit using util from https-everywhere)
```Shell
~/src/EFForg/https-everywhere/utils/rewriter/rewriter.js .
```

Ref: https://github.com/EFForg/https-everywhere/tree/master/utils/rewriter

Remove suspicious file
2021-01-07 08:32:59 +05:30
Arun Prakash Jana c1e673b830
Update readme 2021-01-01 20:54:22 +05:30
Arun Prakash Jana 8e92ea8ad6 Update copyright year 2020-12-29 02:34:23 +05:30
Mischievous Meerkat 057c88a1e9
Merge pull request #822 from j0hnnybash/master
plugins: preview-tui: video thumbnails in preview-tui
2020-12-28 07:17:11 +05:30
johnnybash 37de198303 use trap to delete the temp files 2020-12-27 19:27:11 +01:00
johnnybash 4d77066b62 reuse image code, use more variables 2020-12-26 14:16:12 +01:00
johnnybash a918a59856 video thumbnails in preview-tui 2020-12-21 16:24:18 +01:00
Mischievous Meerkat 66a8b69426
Merge pull request #818 from 0xflotus/patch-1
fix: small error
2020-12-18 19:42:51 +05:30
0xflotus eb47a6c538
fix: small error 2020-12-18 14:42:22 +01:00
Arun Prakash Jana 18232f993d
Specify compilers explicitly 2020-12-17 08:45:41 +05:30
Arun Prakash Jana 12f3d0af61
Update docs 2020-12-17 07:45:02 +05:30
Mischievous Meerkat 558048b6cd
Merge pull request #816 from kyechou/master
Fix the same issue as #81 but with nuke
2020-12-16 02:15:35 +05:30
kyechou f1ea3e3ceb
Fix the same issue as #81 but with nuke 2020-12-15 14:17:03 -06:00
Arun Prakash Jana 9946b37177
Fix togglex: handle filenames with spaces 2020-12-15 22:51:25 +05:30
Arun Prakash Jana fc3a247c31
Minor plugin indentation update 2020-12-12 20:53:28 +05:30
Arun Prakash Jana 1ac4b9bd5a
Fix #813: plugin togglex - toggle exe mode for selection 2020-12-12 20:05:58 +05:30
Arun Prakash Jana a984b6a9e8
Update docs 2020-12-12 11:02:36 +05:30
Arun Prakash Jana a31af54c00
Fix #812: clear selection on single file deletion 2020-12-10 21:50:01 +05:30
Arun Prakash Jana 947c4a9faf
Checkpatch fixes 2020-12-10 01:33:17 +05:30
Arun Prakash Jana 4845ec72c5
Update docs 2020-12-06 09:15:20 +05:30
Arun Prakash Jana 7afd17d1c8
Update docs 2020-12-05 22:33:09 +05:30
Arun Prakash Jana 375df9f40b
Show tmp dir details in debug 2020-11-29 23:32:37 +05:30
Arun Prakash Jana f4cb5c63d0 Revert "use $VISUAL environment variable for plugins"
This reverts commit 9f3fbd93ce.
2020-11-28 10:03:05 +05:30
Arun Prakash Jana b54fc95c43
Remove obsolete options 2020-11-27 18:29:04 +05:30
Arun Prakash Jana 5966927008
Minor refactor - browse() 2020-11-25 02:51:01 +05:30
Arun Prakash Jana 6555dd8cee
Limit lines of code per func to 900 2020-11-25 02:15:13 +05:30
Arun Prakash Jana 2ec9103859
Loop the command prompt 2020-11-24 23:48:48 +05:30
Mischievous Meerkat d54033089c
Merge pull request #804 from angelskieglazki/master
Update config.yml
2020-11-23 22:50:55 +05:30
max 9a7e27c334
Update config.yml 2020-11-23 20:15:48 +03:00
Mischievous Meerkat 9270d4a044
Merge pull request #800 from tchici/master
use $VISUAL environment variable for plugins
2020-11-22 21:55:08 +05:30
tchici 9f3fbd93ce
use $VISUAL environment variable for plugins
falls back to previous behavior if $VISUAL is not set ($EDITOR then vi)
2020-11-22 16:18:06 +00:00
Mischievous Meerkat be34af5aeb
Merge pull request #799 from tchici/master
nuke plugin: use $VISUAL environment variable
2020-11-22 21:34:46 +05:30
tchici ea81864e03
nuke plugin: use $VISUAL environment variable
falls back to previous behavior if $VISUAL is not set ($EDITOR then vi)
2020-11-22 15:54:02 +00:00
Arun Prakash Jana 9e3bd377b0
Remove trailing spaces 2020-11-22 20:54:49 +05:30
Arun Prakash Jana a7fd4957dd
shellcheck fixes 2020-11-22 20:30:52 +05:30
Arun Prakash Jana 63315c88d2
Circle CI - move to Ubuntu 20.04 2020-11-22 19:25:18 +05:30
Arun Prakash Jana 58bb63633d
Fix build error 2020-11-22 03:58:37 +05:30
Mischievous Meerkat d0a7d61bd2
Integrate GH CI, retire Travis 2020-11-22 03:03:24 +05:30
Marco Grunert 6f7a4f723b
inotify is available only on Linux 2020-11-21 21:32:18 +05:30
Arun Prakash Jana b4b3ee4868
Key A to invert selection 2020-11-20 01:08:53 +05:30
Arun Prakash Jana 7f605ab995
Let ^L exit filter mode and redraw if no last filter 2020-11-19 23:30:32 +05:30
Arun Prakash Jana a443a321ef
Fix #786: memccpy() detects buffer overlap on macOS 2020-11-19 09:38:17 +05:30
Arun Prakash Jana 8735f11c58
Show msg on invalid list input, remove dep 2020-11-18 23:40:23 +05:30
Arun Prakash Jana d38f4b13d4
Fix #784: support msys2 compilation 2020-11-18 04:07:40 +05:30
Arun Prakash Jana aefe962182
Revert to dev tag 2020-11-17 08:55:12 +05:30
Arun Prakash Jana f6cc2e6161
Prepare for release v3.5 Freddie
Code named after Freddie Mercury: https://en.wikipedia.org/wiki/Freddie_Mercury
2020-11-17 08:19:09 +05:30
Arun Prakash Jana b528bc734b
Update ToDo list link 2020-11-15 20:31:31 +05:30
Arun Prakash Jana 9e40110731
Add a useful tip. 2020-11-14 19:23:09 +05:30
Arun Prakash Jana e6d510bed0
Update docs 2020-11-14 15:41:25 +05:30
Arun Prakash Jana 0bfc590f90
upx compress all static binaries before upload 2020-11-14 10:56:18 +05:30
Arun Prakash Jana 13923117dc
Update help 2020-11-14 10:05:51 +05:30
Arun Prakash Jana 74cd15c232
Q - error & quit if no selection, else pick & quit 2020-11-13 12:40:57 +05:30
Arun Prakash Jana b09adb4654
Update docs 2020-11-13 11:57:34 +05:30
Arun Prakash Jana 7afc3eeedd
Fix #777: input stream ishould trump -s/-S
If an input stream is available, prioritize that over sessions. find/grep
syntax can be very complex and can be scripted. On the contrary, sessions
can be loaded at runtime and the persistent session can be "restored".

An interesting use case is the listing is done in picker mode from a script
and the user expects to "pick" some entries among the listed search results.

Another important change is - if the user tries to load the "last session"
explicitly by name instead of using the session option _restore_, we should
not overwrite the "last session" ("@") before loading the it.
2020-11-13 11:37:28 +05:30
Arun Prakash Jana 1c4bc318f5
Update plugin 2020-11-12 08:17:14 +05:30
Arun Prakash Jana 52b87a2492
Clean-up help 2020-11-10 20:12:49 +05:30
Arun Prakash Jana c674cb5934
Fix #775: quit on double Esc 2020-11-10 19:13:38 +05:30
Arun Prakash Jana 1418ecde0d
Skip rm invocation when no files to delete 2020-11-10 00:36:16 +05:30
Arun Prakash Jana 8b9e0edc94
Update plugin notes and table 2020-11-08 21:37:19 +05:30
Mischievous Meerkat 7b3b41093e
Merge pull request #765 from KlzXS/dups
Modified dups to allow selecting files for removal
2020-11-08 17:51:11 +05:30
KlzXS 49936d1ca2
Clear up which files are removed 2020-11-08 12:20:36 +00:00
KlzXS 81953dd571
Wording 2020-11-08 11:28:28 +00:00
KlzXS d4c1986a95
sed fixes 2020-11-07 22:39:34 +00:00
KlzXS e8803b8b64
Fix shellchek error 2020-11-07 12:58:48 +00:00
Arun Prakash Jana 75a4123f5a
Minor changes 2020-11-06 08:02:13 +05:30
KlzXS 05bf019fbb
Add some prompts 2020-11-06 00:13:35 +00:00
Arun Prakash Jana d8d43ca85f
Fix locker not invoked 2020-11-05 20:40:31 +05:30
Arun Prakash Jana 9f6808a35a
make target upx (https://upx.github.io/) 2020-11-02 00:02:47 +05:30
Arun Prakash Jana 7b233c215c
Update README 2020-11-01 18:44:40 +05:30
Arun Prakash Jana 30edbeee6c
Update Haiku Makefile 2020-10-31 21:35:02 +05:30
Arun Prakash Jana 0b31414c9a
make option O_NOUG to compile out user group info 2020-10-31 21:22:01 +05:30
Arun Prakash Jana ff5685b64d Option -U to show user and group in status bar 2020-10-31 20:48:05 +05:30
Mischievous Meerkat aabbf6ddcb
Merge pull request #768 from voodoologic/master
Plugin readme improvement
2020-10-31 11:32:16 +05:30
Doug Headley 2b3b0990cc Plugin readme improvement 2020-10-30 22:00:46 -07:00
Arun Prakash Jana 3737527ba9
Update doc 2020-10-23 00:05:12 +05:30
KlzXS afdba193e4
Fix filenames with spaces not working 2020-10-21 17:46:31 +00:00
KlzXS 782df96080
Modified dups to allow selecting files for removal 2020-10-21 17:03:03 +00:00
Arun Prakash Jana 57163ffa5d
Update plugin 2020-10-21 10:50:56 +05:30
Tim Adler f3e122fc32
Support zoxide for jumping (#764)
* Create zoxide

* Delete zoxide

* Add files via upload
2020-10-21 10:03:56 +05:30
Arun Prakash Jana 65bffda6eb
Fix build break 2020-10-20 18:20:59 +05:30
Arun Prakash Jana 56757860d4
Generate static binaries with icon support 2020-10-20 17:59:39 +05:30
Arun Prakash Jana 234f7ae563 Fix #763: Revert "Fix #759" (makes nnn hang when used in a script)
This reverts commit c074572748.
2020-10-18 03:59:05 +05:30
Arun Prakash Jana 7b870281aa
Update docs 2020-10-17 14:24:53 +05:30
Placido Fernandez d38bed58b2
fix bookmarks plugin on empty output (#762)
* fix bookmarks plugin on empty output

* fix indentation

* remove redundant new line
2020-10-15 23:06:36 +05:30
Arun Prakash Jana dbf12ed031
Fix indentation 2020-10-15 08:08:50 +05:30
Arun Prakash Jana c074572748 Fix #759 2020-10-15 08:07:32 +05:30
Placido Fernandez ed53c54ba2
fix fzf bookmarks plugin environment variable (#756)
* fix fzf bookmarks plugin environment variable

* fix for POSIX
2020-10-13 17:50:28 +05:30
Arun Prakash Jana 1b1842c354 Udpate badge 2020-10-12 17:30:41 +05:30
Tim Gates bfcf296334
docs: fix simple typo: sdtout -> stdout (#755) 2020-10-12 15:02:58 +05:30
Arun Prakash Jana d15b47ab86
Update docs 2020-10-11 20:14:37 +05:30
Arun Prakash Jana afe0b0a7bd
Fix #739 #753 2020-10-10 07:38:57 +05:30
Arun Prakash Jana 881ea36f11
Fix #750: add more clarity to unmount help 2020-10-08 05:33:43 +05:30
Arun Prakash Jana 43acb25255
Update issue template 2020-10-07 18:52:52 +05:30
Arun Prakash Jana 8bbe7e9896
Update docs 2020-10-03 15:36:51 +05:30
Arun Prakash Jana 499127c698
Fix #741 2020-10-02 08:41:09 +05:30
Arun Prakash Jana 99e32f26f5
Update docs 2020-10-01 16:44:37 +05:30
Arun Prakash Jana 04e1b03fd1
Update docs 2020-09-30 22:31:52 +05:30
Arun Prakash Jana 5d955c772e
Update docs 2020-09-30 00:29:27 +05:30
Mischievous Meerkat 25770e8c0e
Update README.md 2020-09-29 22:59:26 +05:30
Arun Prakash Jana 0581c3f1c7
Fix indentation 2020-09-29 20:13:17 +05:30
Arun Prakash Jana c235c0f5c8 Merge remote-tracking branch 'origin/fix-rollover-bug' 2020-09-29 20:07:48 +05:30
lvgx 78e576ae24
Fix rollover bug (#747)
* Fix rollover bug

Fixes #743

* Snap to edges in no rollover multiline scroll mode

* Style fix
2020-09-29 20:05:59 +05:30
lvgx 6067a91ae6
Style fix 2020-09-29 16:22:49 +02:00
lvgx d1d4c4ad22
Snap to edges in no rollover multiline scroll mode 2020-09-29 16:13:57 +02:00
lvgx d9c0c08698
Fix rollover bug
Fixes #743
2020-09-29 15:41:22 +02:00
Arun Prakash Jana b5232de642
Update docs 2020-09-29 01:11:26 +05:30
Arun Prakash Jana 51009f8241
Fix #744 2020-09-28 22:13:33 +05:30
Arun Prakash Jana 627c5cfc36
Use inline for once-used function 2020-09-26 23:17:25 +05:30
Arun Prakash Jana 1d903a8c90
Fix #740 2020-09-26 23:04:27 +05:30
Arun Prakash Jana 55f2a0823a
Let buffer for current path be auto-allocated 2020-09-26 00:50:11 +05:30
Arun Prakash Jana 2e870f3879
Range selection: replace ^K by ^Space 2020-09-24 17:32:49 +05:30
Arun Prakash Jana faddaa5c3a
make option O_NOSSN to compile out session 2020-09-20 12:13:00 +05:30
cdarkly 88256206d7
preview-tabbed will now exit with ^C (#734)
* preview-tabbed will not exit with ^C

* preview-tabbed will not exit with ^C
2020-09-19 22:25:53 +05:30
Arun Prakash Jana 56621705e8
Fix #728 2020-09-18 20:45:47 +05:30
Arun Prakash Jana 56dec17840
Fix #735 2020-09-18 20:33:21 +05:30
Arun Prakash Jana e25dc108bf
Color for vtt sub icons 2020-09-18 05:58:38 +05:30
Arun Prakash Jana d11992c8f0
Color more doc type icons 2020-09-18 05:54:44 +05:30
Arun Prakash Jana 02b3f65dbe Revert "Update image"
This reverts commit 01455b3d3a.
2020-09-17 07:05:47 +05:30
Arun Prakash Jana 01455b3d3a
Update image 2020-09-17 06:58:53 +05:30
Arun Prakash Jana 07e994788a Fix #730 2020-09-15 19:06:43 +05:30
Toni Jarjour 240c0e5fed
sxiv automatically plays animations (part2) (#732)
* sxiv automatically plays animations (part2)

* Update imgview

* Update imgview
2020-09-15 08:29:50 +05:30
Toni Jarjour 1912cee957
make sxiv automatically play animations (#731) 2020-09-14 22:31:32 +05:30
Dave Snider 1fc1b8be8b
Add nerdfont defs file and normalize vars (#722)
* Add nerdfont defs file and normalize vars

* some cleanup

* address feedback

* one more spacing issue

* address feedback
2020-09-14 22:09:52 +05:30
Arun Prakash Jana 868c1898d3
Update docs 2020-09-13 21:36:12 +05:30
Arun Prakash Jana 12c09e85e3
Update tagline 2020-09-11 03:13:08 +05:30
Arun Prakash Jana 2ddabf19e0
Fix #724 2020-09-09 01:17:20 +05:30
Mischievous Meerkat 578912e75e
Merge pull request #725 from 0xACE/previewtab-no-one-left-behind
preview-tabbed now kills lingering viewer
2020-09-09 00:55:17 +05:30
0xACE 858794fd27 preview-tabbed now kills lingering viewer 2020-09-08 13:21:43 +02:00
Arun Prakash Jana d11b07fd01
Update docs 2020-09-06 14:41:09 +05:30
Arun Prakash Jana 835f0c16d6
Honor -C for context colors 2020-09-06 06:06:59 +05:30
Arun Prakash Jana 055652d979
Update docs 2020-09-05 08:28:42 +05:30
Arun Prakash Jana f21ed23273
Update docs 2020-09-02 22:01:30 +05:30
Arun Prakash Jana 1696455a6f
Ad instruction on reserved bitfield 2020-09-02 01:36:56 +05:30
Arun Prakash Jana 0b0605813d
Update auto-completion scripts 2020-09-01 23:06:26 +05:30
Arun Prakash Jana 02bb398550
Option -D to show dirs in context color 2020-09-01 22:58:03 +05:30
FriendlyNeighborhoodShane a8afbf89d5
Add option to not move to next entry on select (#713) 2020-08-30 05:32:40 +05:30
Arun Prakash Jana 279f36f628
Fix #716 2020-08-30 04:34:40 +05:30
Dave Snider 3bd115ef93
Add comment for imv command in imgview plugin. Check with which instead of version (#715)
* change version checks to `which` instead. add comments around imvr in linux

* add which checks for renamer and preview-tui as well
2020-08-30 04:26:55 +05:30
Dave Snider f79af220c7
Small plugin for jump. Also adds check for NNN_PIPE to autojump plugin (#714)
* Add jump plugin to nnn

* indents

* Readme for plugin

* add pipe check to autojump

* indents to 4

Merge plugins jump and autojump
2020-08-29 05:36:19 +05:30
Arun Prakash Jana 2f61b0910d
Cycle time, size, clear order at sort prompt with ^T 2020-08-28 02:02:23 +05:30
Arun Prakash Jana df264fa6cd
Larger image. 2020-08-23 22:12:12 +05:30
majjejjam 3087c21be5
Added space after period (#711) 2020-08-23 18:48:58 +05:30
lvgx bcbe8080be
Add support for Alexey Tourbin's QSORT code (#708)
* Add support for Alexey Tourbin's QSORT code

See https://github.com/svpv/qsort

* Add benchmark scripts and compilation mode

Compile with `make O_BENCHMARK=1`, and run benchmarks with e.g.:
  ./misc/test/benchmark.sh ./nnn '/' '/usr/bin' '/usr/lib' > benchdata
You can then plot basic violin graphs with:
  ./misc/test/plot-bench.py benchdata

* Update style, doc, haiku support, fix lint
2020-08-21 08:15:45 +05:30
Jake Secunda d37356a936
Haiku: Some small fixes to the recipe and resource file (#707)
* Haiku: Some small fixes to the recipe and resource file

Whoops...just some small fixes.

* Update nnn.rdef

Co-authored-by: Jana <engineerarun@gmail.com>
2020-08-20 22:21:28 +05:30
Gregory Anders 1afdd48f5d
nuke: use macOS open when GUI enabled (#705)
* nuke: use macOS open when GUI enabled

* nuke: use is_mac function to test for macOS

This is consistent with how the imgur plugin does detection.

* Add macOS open command to plugins

* pskill: only execute if input is non-empty
2020-08-20 14:51:26 +05:30
Arun Prakash Jana d788566268
Add vim-floaterm nnn wrapper 2020-08-19 23:35:11 +05:30
Arun Prakash Jana 6627f8f272
Update Haiku Makefile 2020-08-18 17:21:21 +05:30
Arun Prakash Jana 9c20f43410
Prepare for release v3.4 2020-08-18 15:33:49 +05:30
Arun Prakash Jana 551e9ca7e5
Fix #704 2020-08-18 13:15:21 +05:30
Arun Prakash Jana 351ddb1dd7
Update docs 2020-08-18 13:08:10 +05:30
Arun Prakash Jana faea2915f4
Minor refactor 2020-08-17 23:25:27 +05:30
Arun Prakash Jana ba2040afec
Icons and colors 2020-08-17 20:29:33 +05:30
Arun Prakash Jana 6a4ff8b825
Update docs 2020-08-17 14:08:04 +05:30
Arun Prakash Jana b5c7d41d9b
More icons 2020-08-17 02:55:21 +05:30
Arun Prakash Jana 1e72069378
More icons 2020-08-16 19:46:09 +05:30
Arun Prakash Jana cc82403be4
More icon extns, reserve number entries 2020-08-16 16:51:55 +05:30
Arun Prakash Jana 5db2298956
Support icon-specific colors 2020-08-16 13:49:09 +05:30
Arun Prakash Jana d86810a425
Minor reformat 2020-08-16 06:54:47 +05:30
KlzXS a85467d462
Icons (#697)
* Add icons

* Fix build break

* Fix icon position in detailed mode

* Various fixes

* Provision for icon specific colors

No icons with oldcolor. Small optimizatons

* Update Makefiles

Small refinement for other matching
2020-08-16 06:30:58 +05:30
Arun Prakash Jana 1998b88c14
Update docs 2020-08-15 21:54:56 +05:30
Arun Prakash Jana 8a82c58a2a
More appropriate enum name 2020-08-15 20:21:22 +05:30
Arun Prakash Jana 5fa16dbd15 Force accurate regex match 2020-08-15 17:32:27 +05:30
Anarchiste 7d672411bb
Adding support for `most` pager (#698)
* Added support of most

* Only test if bat exists

* Faster this way

* Don't test for bat'
2020-08-15 07:33:16 +05:30
Arun Prakash Jana 9459b15672
Simplify and preprocess archive handling 2020-08-14 08:20:01 +05:30
Arun Prakash Jana fbd5e77ec1
Initialize all make options 2020-08-14 00:02:54 +05:30
Jana 0c93b170c8
Merge pull request #696 from ucs1/revert-escdelay
Fix arrow keys not working on mintty
2020-08-12 19:02:57 +05:30
ucs 52d3d514ce Revert "Set Escape delay to 0"
An ESCDELAY of 0 can break long escape sequences, such as the arrow keys,
on slower terminals.

This reverts commit 2599564e64.
2020-08-12 11:55:15 +02:00
Jana fb454a5046
Merge pull request #693 from CodeforEvolution/haikuUpdate
Haiku: General fixup, add icon, add rdef file
2020-08-11 22:20:01 +05:30
Jana dc488857e1
Merge pull request #694 from ucs1/fix-readdir
Fix inability to enter directories on an XFS filesystem on top of an md device
2020-08-11 22:18:25 +05:30
ucs dd6976dfad Fix some directories not opening 2020-08-10 13:02:47 +02:00
CodeforEvolution 6f9571a805 Haiku: General fixup, add icon, add rdef file
- Add a native vector icon for Haiku (it hasn't been Haiku-ified yet however)
- Add a rdef file (specifies application metadata)
- Add clipboard support, notififcation support, and basic nuke support
- Fix support for fortunes on Haiku ("-s" option is not available on Haiku)
- Cleanup Haiku recipe
2020-08-09 22:19:51 -05:00
Arun Prakash Jana 90e0d5e3d6
Update docs 2020-08-10 03:19:31 +05:30
Arun Prakash Jana aa8769ecee
Reduce a check 2020-08-09 14:04:27 +05:30
Arun Prakash Jana 966fe839ee
Support traversal on creation, update docs 2020-08-08 10:42:37 +05:30
Arun Prakash Jana c566afd819 Revert "Move helper APIs to header file"
This reverts commit 1fecdb2393.
2020-08-07 23:16:17 +05:30
Arun Prakash Jana 1fecdb2393
Move helper APIs to header file 2020-08-07 23:10:25 +05:30
Arun Prakash Jana 7dbf1ca3b7
Update docs 2020-08-06 10:22:17 +05:30
Arun Prakash Jana 75c34d5f68
Fix #692 (partially) 2020-08-06 01:30:56 +05:30
Arun Prakash Jana 5e3a793480
File colors is independent of context colors 2020-08-06 01:06:21 +05:30
Arun Prakash Jana 8ddc659df8
Initialize file type colors as default 2020-08-06 00:27:12 +05:30
Arun Prakash Jana f712441eda
Utility functions to top, API to get file extn 2020-08-05 20:36:50 +05:30
Arun Prakash Jana a1b43ae830
Show locaiton in context color 2020-08-05 20:05:27 +05:30
Arun Prakash Jana 8c2e1726ba
Show file details in file missing colors 2020-08-05 16:35:45 +05:30
Arun Prakash Jana 13ccf25551
Set dir to bold only if required 2020-08-05 13:12:11 +05:30
Arun Prakash Jana b1ff36eb05
Code reformat 2020-08-05 12:59:54 +05:30
Arun Prakash Jana 11cc2797bb
Show dirs in bold 2020-08-05 00:11:56 +05:30
Arun Prakash Jana 3a61b3fc7f
Fix build break 2020-08-04 22:25:17 +05:30
Arun Prakash Jana 66bb5a67d6
Update docs 2020-08-04 22:19:01 +05:30
Arun Prakash Jana ef2d5a54d2
Support file colors in detail mode 2020-08-04 21:02:19 +05:30
Arun Prakash Jana 42fd2a4d13
Program option to use older 2020-08-04 20:36:19 +05:30
Arun Prakash Jana ae961da157
Support file colors 2020-08-04 19:22:29 +05:30
Arun Prakash Jana ccfccb7187
Detect odd hex symbols in NNN_COLORS 2020-08-04 00:42:58 +05:30
Arun Prakash Jana 8d94809897
Identify orphaned symlinks 2020-08-03 23:55:14 +05:30
Arun Prakash Jana 33953147d6
Use wrapper API 2020-08-03 22:25:42 +05:30
Arun Prakash Jana f03ddb587c
Fix #691 2020-08-03 14:57:00 +05:30
Arun Prakash Jana 2fbb6ae35f
Minor reformat 2020-08-02 23:58:52 +05:30
Arun Prakash Jana b3f2e47173 Revert "Reduce processing if NNN_COLORS is unset"
This reverts commit b948423a80.
2020-08-02 23:18:13 +05:30
Arun Prakash Jana b948423a80
Reduce processing if NNN_COLORS is unset 2020-08-02 23:15:48 +05:30
Arun Prakash Jana 359b6f7a37
Clear selection list after copy
Without this, there is a conflict with using the `-u` option (use selection).
After copying selected files, the selection is intact and if the user issues
a deletion next, the source files (meant for copying) are deleted.
2020-08-02 19:16:15 +05:30
Arun Prakash Jana d5e303beb7
Fix illegal access 2020-08-02 17:03:35 +05:30
Arun Prakash Jana 83fa6a0ff6
Support xterm 256 color 2020-08-02 16:28:25 +05:30
Arun Prakash Jana 110a4eb108
Avoid redundant printw() call for order 2020-08-02 00:54:07 +05:30
Arun Prakash Jana 9bad3c9399
Show selection in reverse in status bar 2020-08-02 00:40:51 +05:30
Arun Prakash Jana 1fb1ab55a7
Fix build break 2020-08-01 23:31:30 +05:30
Martin Roa Villescas e557bd2ed9
Write last dir on quit in vim picker mode 2020-08-01 22:53:27 +05:30
Arun Prakash Jana defc1965ee
Code reduction 2020-07-22 20:19:38 +05:30
Arun Prakash Jana 32ec37a796
Create mountpoint by hostname, clear prompt 2020-07-22 17:57:15 +05:30
Arun Prakash Jana f4ff4b0793
Fix #684: support path appended to hostname 2020-07-22 17:00:45 +05:30
Arun Prakash Jana a58c65a51a
Fix #685: indicator H fo hidden 2020-07-21 22:30:30 +05:30
Arun Prakash Jana e2febc986b
Pro-deletion jokers from Wikipedia can go to hell!
There's a specific problem with control in the hands of random jokers - it's abused.

Ref: https://en.wikipedia.org/wiki/Wikipedia:Articles_for_deletion/Nnn_(file_manager)
2020-07-21 18:59:00 +05:30
Jan Meischner 474ad74f25
Allow absolute paths returned by fzf in fzcd plugin (#682)
* Allow absolute paths returned by fzf in fzcd plugin

* Fix issue with POSIX syntax

* Add descriptive comment

* Add comment

* Remove description

* Add new line at the end of the file

Co-authored-by: Jan Meischner <jan.meischner@verimi.com>
2020-07-21 13:27:56 +05:30
Jason dacf7b0811
Fix typo (#679) 2020-07-15 04:49:13 +05:30
Arun Prakash Jana f17911e189
Prepare for release v3.3 2020-07-14 05:50:22 +05:30
Arun Prakash Jana a02ff64e9c
Update help 2020-07-13 00:20:12 +05:30
Arun Prakash Jana 387bd048e7
Alt+Esc to exit nav-to-type and redraw 2020-07-13 00:00:34 +05:30
Arun Prakash Jana 890425c08c
Add a note that Esc cancels 2020-07-09 20:30:30 +05:30
Arun Prakash Jana 1d8a14c6b4
Fix #675 2020-07-09 20:25:39 +05:30
lvgx 53bbcbc223
Update preview-tui (#674)
Co-authored-by: akimdi <akimdi@users.noreply.github.com>
2020-07-08 20:53:35 +05:30
Arun Prakash Jana d3e20e9015
Use the term mark instead of pin 2020-07-07 07:57:43 +05:30
Arun Prakash Jana 6fa4978230
Pin dir when visitng target file in find and list 2020-07-07 07:29:38 +05:30
Arun Prakash Jana 509f069818
Add quick find (fd) and grep (rg) plugin examples 2020-07-06 23:43:48 +05:30
Arun Prakash Jana 709e7bd7dd
Remove snprintf() from start-up path 2020-07-04 23:01:36 +05:30
Arun Prakash Jana 1faf9f2480 Revert "Simplify check"
This reverts commit 37e5e6189a.
2020-06-28 20:33:54 +05:30
Arun Prakash Jana 4178aaa98e
Copy the correct length 2020-06-28 00:52:24 +05:30
Arun Prakash Jana 90cf84186a
Minor refactor 2020-06-28 00:09:48 +05:30
Arun Prakash Jana 06651f3f00
Fix build break 2020-06-27 23:48:23 +05:30
KlzXS 45d96ee60d
Add relative paths support for cp/mv as (#668) 2020-06-27 23:16:17 +05:30
Arun Prakash Jana cb9e785145
Fix build break 2020-06-27 23:14:14 +05:30
Arun Prakash Jana 56b96cbf74
Pin current path on archive/remote mount 2020-06-27 22:22:20 +05:30
Arun Prakash Jana b3820df863
Update docs 2020-06-27 21:08:55 +05:30
Arun Prakash Jana 37e5e6189a
Simplify check 2020-06-25 19:59:47 +05:30
Sijmen J. Mulder 235eb29614
Fix check when char is unsigned (#665)
If char is unsigned (as on ARM) subtracting a larger number would
result in a wrap around, not a negative value.

  src/nnn.c: In function 'readpipe':
  src/nnn.c:4325:11: warning: comparison is always false due to limited
  range of data type [-Wtype-limits]

     if (ctx < 0 || ctx > CTX_MAX)
             ^
2020-06-24 04:35:42 +05:30
Sijmen J. Mulder 3686ef756a
Always use builtin alloca() (#666)
Fixes the build on NetBSD 9 on arm64.

GCC expands alloca() to __builtin_alloca() but only in nonstandard mode,
e.g. when -std=... is not supplied.  In standards mode (with -std=...)
alloca() is left undefined by GCC. The C library may define it but it
also may not, as on NetBSD on arm64:

    $ uname -srp
    NetBSD 9.0 aarch64

    $ cat alloca.c
    #include <stdlib.h>
    int main() { char *p = alloca(10); }

    $ gcc alloca.c

    $ gcc -std=c99 alloca.c
    alloca.c:(.text+0xc): warning: Warning: reference to the libc
     supplied alloca(3); this most likely will not work. Please use the
     compiler provided version of alloca(3), by supplying the
     appropriate compiler flags (e.g. not -std=c89).
    ld: alloca.c:(.text+0xc): undefined reference to `alloca'

The fix is to either not use standards mode (undesirable) or to
explicitly use the builtin, which is what this patch does.

This is also sufficient for Solarius/Illumos so that check and include
are removed.
2020-06-24 04:17:05 +05:30
Arun Prakash Jana 306af787ca
Add -Wshadow to CFLAGS and fixes 2020-06-22 09:17:59 +05:30
KlzXS 6147dc9a85
Add plugin bulknew (#662)
* Add plugin bulknew

* Update documentation

* Update dependencies

* Add whitespace note
2020-06-20 15:39:32 +02:00
Arun Prakash Jana 28bf18adab
Update contributing guideline 2020-06-19 07:35:05 +05:30
lvgx 7a1a4e293e
Avoid SIGWINCH interruptions of NNN_PIPE IO (#659)
Fixes #656
2020-06-19 07:10:37 +05:30
Mario 9b5b2b544c
Initial CONTRIBUTING.md (#655) 2020-06-18 09:06:27 +05:30
Arun Prakash Jana d7e5e420eb Update docs 2020-06-16 19:09:31 +05:30
akimdi 6548a0fa7c
added support webp format (#652)
* added support webp format

* update nuke plugin with support webp format
2020-06-16 19:08:46 +05:30
Arun Prakash Jana 4b4bf6cca5
Option -u to disable current/selection prompt 2020-06-15 19:54:44 +05:30
Arun Prakash Jana d9b8b0e821
Clear selection after some operations (see notes)
Selection is cleared after successful:
- file removal
- batch rename
- link creation

However, selection is not cleared after:
- archive creation: user may want to delete the files after archiving
2020-06-15 19:13:08 +05:30
Arun Prakash Jana 251a9a2e9c
Update docs 2020-06-14 11:15:41 +05:30
Arun Prakash Jana 7c802cce60
Show '+' in statusbar instead of 's' for selection 2020-06-14 09:56:34 +05:30
Arun Prakash Jana b3076e35d6
Refactor key-val pair parsing 2020-06-14 00:31:48 +05:30
Arun Prakash Jana a1ec2236d8
Make once-used function inline 2020-06-14 00:09:16 +05:30
Arun Prakash Jana d92cecba6c Update docs 2020-06-12 17:00:04 +05:30
Mario 5a565675c0
Sane tree defaults and viu support (#649) 2020-06-11 18:45:54 +05:30
Ian R 1f22da2994
Feature #534: Support hardware cursor sync 2020-06-11 11:30:43 +05:30
Arun Prakash Jana 2d5952fef7
Update docs 2020-06-11 11:11:35 +05:30
Arun Prakash Jana 0f67e1ff7d
support imv in imgview and nuke 2020-06-11 01:49:40 +05:30
Arun Prakash Jana a103f513c3
Use Firefox Send for upload if ffsend is found 2020-06-10 23:32:03 +05:30
Arun Prakash Jana ef0e973134
Add hx as alternative hex viewer 2020-06-10 22:33:59 +05:30
Doron Behar 92ff1447c0
preview-tui: make scope & pistol run before `file` (#647)
Both Pistol and `scope.sh` are run `file --mimetype` or an equivalent, internally.
Thus, for speed, it's better to run them before almost anything else.
2020-06-10 13:20:38 +05:30
Mario 7b68844a05
Pistol support (#646) 2020-06-10 06:11:57 +05:30
Mario 9130db3e75
Kitty splits (#643)
* Easier to browse plugin README.md

* Splits are inverted

* trying to fix kitty splits

* Correctly restores the kitty layout

* More clear comments
2020-06-10 05:56:15 +05:30
Mario 5a6078967b
Fixes environmental variables not being passed on preview-tui (#644) 2020-06-10 05:28:35 +05:30
Arun Prakash Jana b3e2ffc2e6
Selection mode don't need to be persistent 2020-06-09 23:43:49 +05:30
Arun Prakash Jana 05b1db059e
Plugin run flags don't need to be persistent 2020-06-09 23:33:32 +05:30
Arun Prakash Jana 796334354e
Picker mode doesn't need to be persistent 2020-06-09 23:03:36 +05:30
Arun Prakash Jana b481b23280
Retain order on session load 2020-06-09 22:26:35 +05:30
Mario eeb802280d
preview-tui splits are inverted (#642)
* Easier to browse plugin README.md

* Splits are inverted

* $SPLIT clarification and default values for $SPLIT and $TERMINAL
2020-06-09 20:27:28 +05:30
Mario c203ae7fa8
Easier to browse plugin README.md (#641) 2020-06-09 19:29:28 +05:30
Arun Prakash Jana aea8f737f6
Update docs 2020-06-09 11:44:20 +05:30
Mario a47d190654
Unified preview-tui and preview-kitty scripts (#634)
* Unified preview-tui and preview-kitty

* Remove preview-kitty

* No need to set $TERMINAL

* fix undeclared variable

* Integrated support for scope.sh

* Review fixes

* allow_remote_control must be enabled on kitty

* Documentation, kitty splits and images fallback

* fix restoring kitty layout
2020-06-09 07:16:35 +05:30
Arun Prakash Jana c5f0a25e7e
Simplify subdir creation 2020-06-08 21:56:33 +05:30
Arun Prakash Jana d19d8d5f02
Derive session and mount paths, shorten paths 2020-06-08 09:44:53 +05:30
Arun Prakash Jana b62adec72c
Subdir 'mounts' for remote/archive mounts 2020-06-08 08:48:20 +05:30
Arun Prakash Jana fdfbac0386 Fix #639: store NNNLVL in tmp var 2020-06-07 00:35:05 +05:30
lvgx 58411446b7
preview-kitty: fix crash on first file on dash (#636)
In the dash shell, when `exec < fifo` is interrupted by SIGCHLD, it exits.
So we replace it with `cat fifo |`.

Issue discussed in #614
2020-06-06 20:47:41 +05:30
Arun Prakash Jana 65cf067dc4 Fix #637: remove mount dir after unmount 2020-06-06 16:22:32 +05:30
ncoder-1 4d4f72460d
Update preview-kitty (#638)
Fixed typo in preview-kitty.
2020-06-06 08:47:40 +05:30
Arun Prakash Jana 056ef8b23d
Update docs 2020-06-04 20:22:35 +05:30
KlzXS 1f3ce3ae94
Added selection prompt and README entry (#633) 2020-06-04 20:21:50 +05:30
Arun Prakash Jana 10a43a4fbb
Add Live Previews asciicast
Thanks @Kabouik!
2020-06-04 09:33:48 +05:30
lvgx 2acc7bd324
preview-tui: wait killed previewers (#632) 2020-06-04 08:23:04 +05:30
KlzXS 7b606e0e29
Added GPG encrypt and decrypt plugins (#630)
* Added GPG encrypt and decrypt plugins

* Made description more descriptive
2020-06-04 08:17:09 +05:30
Arun Prakash Jana 56eea7e195
Fix tmux version check 2020-06-04 03:41:42 +05:30
Todd Yamakawa 995fa1ceb6
bookmarks: Pipe error to PAGER and clean up code (#631)
Co-authored-by: Todd Yamakawa <todd.yamakawa@arm.com>
2020-06-04 00:47:46 +05:30
Arun Prakash Jana 58fd92c7ae
Add new ToDo list 2020-06-03 16:12:27 +05:30
Arun Prakash Jana 2fc115bddc
Esc to send hovered path to FIFO 2020-06-03 15:56:10 +05:30
Arun Prakash Jana 709c0d209e
Force notify on left click (right selects & updates) 2020-06-03 14:51:52 +05:30
Arun Prakash Jana 63e90c573b
Move Live Preview usage notes to Wiki page 2020-06-03 09:15:00 +05:30
Arun Prakash Jana 1dbbc45c78
Key | to send file path to FIFO 2020-06-02 16:50:06 +05:30
Arun Prakash Jana 61b4416e08
Refresh hovered for preview on mouse click 2020-06-02 16:29:26 +05:30
lvgx 01da467547
preview-tui: simplify, add generic fifo_pager() (#625)
* preview-tui: simplify, add generic fifo_pager()

I've commented new filetype checks for now, as we need to discuss which ones
should be included by default, keeping in mind that this is supposed to be a
minimal, adaptable plugin.

* preview-tui: preview with man, tar, unzip by default
2020-06-02 14:26:50 +05:30
Arun Prakash Jana 5dbb511ede
Keep preview-tui generic 2020-06-02 06:30:07 +05:30
Arun Prakash Jana 0ebc6db163
Fix #624: wait for user input if cmd fails 2020-06-01 21:21:01 +05:30
Arun Prakash Jana ca8bc8bf30
Support mime, extension in preview-tui 2020-06-01 19:22:16 +05:30
Arun Prakash Jana f6d9a6b34d
Fix shellcheck 2020-06-01 15:19:34 +05:30
Arun Prakash Jana 9fddd416ca
Simplify preview-tui 2020-06-01 15:17:40 +05:30
Arun Prakash Jana 16356e9d06
Update preview-tui to adapt to terminal size 2020-06-01 14:12:34 +05:30
Arun Prakash Jana 52697e76d5
Workaround #621: preview is updated on redraw (^L) 2020-06-01 13:36:02 +05:30
Sijmen J. Mulder 68b9185071
Wrap FILE_MIME_OPTS use in check (#622)
We leave it undefined on Solaris/Illumos because no such options exist,
so only use it if we have it.
2020-06-01 06:47:03 +05:30
Arun Prakash Jana f5b5cf5fd7
Document non-repeat-refresh of file under preview 2020-06-01 01:40:02 +05:30
Arun Prakash Jana 8549121d86
Remove redundant key F5 2020-05-31 23:20:08 +05:30
Arun Prakash Jana 7263a5f89b
Do not auto-revive filter in nav-to-type mode 2020-05-31 23:05:59 +05:30
Arun Prakash Jana 4a2d978630
Simplify get_input() 2020-05-31 20:10:11 +05:30
Arun Prakash Jana 984cffecc4
Set the corrent keybind for plugin 2020-05-31 13:27:05 +05:30
Arun Prakash Jana 0b3e48ad41
Update template 2020-05-31 13:17:36 +05:30
Arun Prakash Jana 9de3a3c2ec
Update docs 2020-05-31 10:20:57 +05:30
Arun Prakash Jana 8e9c4ec88b
F5 to redraw (even with filter) 2020-05-30 23:25:01 +05:30
Arun Prakash Jana 04f9698d86 Retire ^S as select plugin 2020-05-30 22:02:55 +05:30
basbebe 3feae709ac
also send mutool to $PAGER (#615) 2020-05-30 18:48:12 +05:30
Arun Prakash Jana 309ed0ed67
Remove NNN_PIPE on exit 2020-05-30 15:31:37 +05:30
Arun Prakash Jana 9e09fb53a1
Update docs 2020-05-30 14:42:24 +05:30
Arun Prakash Jana e3d90a98ce
Support make option O_CTX8 for 8 contexts
Note that this is not compatible with 4 contexts.
2020-05-30 07:01:34 +05:30
Arun Prakash Jana 4d291d0ac2
Use bitfields for runtime transient states 2020-05-30 06:45:45 +05:30
Arun Prakash Jana 32ab43a9ff
Handle number of contexts in a generic fashion
This supports using a power of 2 number of contexts like 2, 4 or 8.
Note that the number of contexts are not backward compatible. So if
user is having 8 contexts and plans to use 4, his sessions with > 1
contexts open may break.

We can have a make option to enable 8 contexts. 4 remains default.
2020-05-30 06:07:53 +05:30
Arun Prakash Jana c48b8d02a1 Revert "Alt+Enter: clear filter and exit filter prompt"
This reverts commit 2232772db4.
2020-05-30 05:24:41 +05:30
lvgx f4acf23c15
Add -P to man (#612) 2020-05-30 05:17:06 +05:30
Mischievous Meerkat e47a04865e
Merge pull request #607 from leovilok/signals
Cleanly handle SIGTERM and SIGHUP
2020-05-30 05:08:45 +05:30
lvgx 41dc17883a
Fix detecting end of evironment options (#610)
This allow using both NNN_OPTS and options with arguments from argv.
2020-05-30 04:51:16 +05:30
Léo Villeveygoux 75e8bf44be Use sigaction() instead of signal() 2020-05-29 22:48:36 +02:00
Léo Villeveygoux 3426d0d0a3 Cleanly handle SIGTERM and SIGHUP 2020-05-29 22:48:36 +02:00
Arun Prakash Jana 2232772db4
Alt+Enter: clear filter and exit filter prompt 2020-05-29 22:16:36 +05:30
basbebe 0a318bd411
add 'wraps' attribute to allow autocompletion (#606) 2020-05-29 20:28:59 +05:30
Arun Prakash Jana 87bb2d7742
Remove F5 for toggle hidden (misfit) 2020-05-29 09:25:33 +05:30
Arun Prakash Jana 2599564e64
Set Escape delay to 0 2020-05-29 08:51:22 +05:30
Arun Prakash Jana dd5a936bf4
Alt+Esc to clear filter and exit filter prompt
It's a little annoying that one has to press ^L followed by Esc to go back
to the normal view. We cannot reload the directory on Esc because that will
break the filter filtered view feature. So we take this route.
2020-05-29 08:50:33 +05:30
lvgx 135821aa52
preview-tui: directly call $PAGER on text files (#599) 2020-05-28 05:04:53 +05:30
lvgx bbcd89c8d6
preview-tui: async version using $PAGER to scroll preview (#597) 2020-05-27 23:32:22 +05:30
SZ Lin (林上智) b6762e292c
Fix typos (#595)
This is a trial patch to fix the typos

Signed-off-by: SZ Lin (林上智) <szlin@debian.org>
2020-05-26 09:34:11 +05:30
Arun Prakash Jana e688188fa6
x86-64 to x86_64 2020-05-26 06:21:01 +05:30
Arun Prakash Jana 713bab21ea
Prepare for release v3.2 2020-05-26 05:38:38 +05:30
Arun Prakash Jana 9b7b9d80be
Use lock workflow 2020-05-24 12:59:14 +05:30
Arun Prakash Jana d7fb77861f
Update templates 2020-05-24 11:09:09 +05:30
Arun Prakash Jana 38829e5610
Fix build break 2020-05-24 09:28:29 +05:30
Arun Prakash Jana 56886922a6
Select file if file path is passed 2020-05-24 03:33:39 +05:30
Arun Prakash Jana c1f88d00ff
Fix filterfn not in sync with cfg.regex 2020-05-24 01:51:59 +05:30
Arun Prakash Jana 3527f68554
Add openSUSE Tumbleweed 2020-05-23 18:07:23 +05:30
lvgx b1027150ed
Add -a option to generate a temporary NNN_FIFO (#588)
* Add -a option to generate a temporary NNN_FIFO

* Add documentation for -a option

* plugins/README.md: promote the use of -a

This obsoletes the global FIFO unlink trick, so I remove mentions of it.
@jarun update:

Polish -a
2020-05-23 17:40:51 +05:30
lvgx c7af686b4e
preview-kitty polish (async version + text render for SVGs) (#591)
* preview-kitty: async version

The plugin now aborts slow file viewers.

* preview-kitty: use text mode preview for SVG
2020-05-23 15:59:51 +05:30
lvgx adf381acee
Change binary file detection in preview-tui/kitty (#587) 2020-05-22 08:18:00 +05:30
Arun Prakash Jana a4909beb44
Fix build break 2020-05-20 19:07:00 +05:30
Arun Prakash Jana 9e41c39138
Fix #582 2020-05-20 18:46:12 +05:30
Arun Prakash Jana c6c1514c6b
Remove Fedora 29 (EOL) 2020-05-20 18:38:16 +05:30
lvgx 0c916ae7b0
Notify FIFO readers on exit (if any) (#581)
This allows to close preview windows opened just before exiting nnn.
2020-05-19 22:29:13 +05:30
Arun Prakash Jana b465bf9427
Fix regression from commit 2200a1c 2020-05-19 17:54:36 +05:30
Arun Prakash Jana 709b2f229e
Fix build break 2020-05-19 08:50:04 +05:30
Arun Prakash Jana 1b5c3096ca
Option -P: specify plugin key to run on start 2020-05-18 09:05:19 +05:30
Arun Prakash Jana cafcf1c485
Take to target on Right/l on symlink in list dir 2020-05-17 22:54:39 +05:30
Arun Prakash Jana 54d9a6e4f9
Update docs 2020-05-17 17:54:10 +05:30
lvgx a17ef6699d
Add a preview-kitty plugin (#577) 2020-05-17 17:38:29 +05:30
Arun Prakash Jana 5ea6bc338b
Late handle blocked mimes 2020-05-17 00:46:49 +05:30
Arun Prakash Jana 74b95eb9bd
Fix #575 2020-05-16 15:31:34 +05:30
Arun Prakash Jana 0f01bd7d3a
Fix #573: update docs 2020-05-15 00:13:55 +05:30
Arun Prakash Jana 124666cb38
Fix #571 2020-05-14 12:46:37 +05:30
Arun Prakash Jana 23770ed049
Update docs 2020-05-13 12:55:46 +05:30
lvgx 2200a1c9be
Allow launching plugins with Alt + plugin's key (#569)
* Allow launching plugins with Alt + plugin's key

* Fix Alt key in filter/prompts modes

* Fix handling Alt key in nextsel()

In filter mode: run the associated plugin.
In prompt mode: just throw out the Alt+key input.
In nextsel(): differentiate Alt+key and Esc
2020-05-13 12:29:47 +05:30
Arun Prakash Jana 770bb47daf
Add some space for badges 2020-05-12 19:50:25 +05:30
Arun Prakash Jana 38e61fb864
Skip printing and erasing 2020-05-12 15:15:47 +05:30
Arun Prakash Jana dd4173551f
Update docs 2020-05-12 05:19:38 +05:30
Arun Prakash Jana 24d2bc9d3a
Add asciicast image 2020-05-11 19:45:01 +05:30
Arun Prakash Jana f46ec76e99
Auto-lock old issues 2020-05-11 15:35:21 +05:30
Arun Prakash Jana 5f3faf613a
Do not leak wfd 2020-05-10 22:50:29 +05:30
Arun Prakash Jana 861d44f934
Simplify cd 2020-05-10 19:15:40 +05:30
Arun Prakash Jana cfd4a66596
Fix #565: chdir when dir is changed 2020-05-10 16:23:45 +05:30
Arun Prakash Jana 14beb0746f
Fix #564: Option -l: number of lines to move on mouse scroll 2020-05-10 11:22:02 +05:30
Arun Prakash Jana 609561494f
Remove blocking pipe open in child 2020-05-10 11:19:13 +05:30
Arun Prakash Jana f0535dbd76
Use standard exit status everywhere 2020-05-10 10:04:03 +05:30
Arun Prakash Jana 0b0166816a
Use exit status 2020-05-10 09:57:20 +05:30
Arun Prakash Jana 7718936737
Block data type 2020-05-10 02:18:02 +05:30
Arun Prakash Jana 1f51417c63
Fix reading from pipe when running plugin 2020-05-10 00:47:02 +05:30
Arun Prakash Jana 151bbf000d
Increase pipe capacity 2020-05-09 14:55:21 +05:30
Arun Prakash Jana d71379e5b6
Minor doc update 2020-05-08 01:08:42 +05:30
Arun Prakash Jana db3a46a197
Ignore -S when start dir is specified 2020-05-06 23:26:40 +05:30
lvgx fcab64263e
preview-tui: ensure 1st hovered file is previewed (#561) 2020-05-06 22:55:14 +05:30
lvgx 11c9648774
getplugs: add "master" version support (#560)
Pass "master" as first argument to the script.
2020-05-06 22:36:19 +05:30
Arun Prakash Jana 2a5f8433b8
Ignore false lint issue 2020-05-06 21:28:59 +05:30
Arun Prakash Jana 900b37c56c
Mention tmux version required 2020-05-06 20:49:21 +05:30
Arun Prakash Jana ab9f560fa8
Fix no preview update when dir changed with same entry number hovered 2020-05-06 19:29:46 +05:30
Arun Prakash Jana ce06bf15d6
Fix broken dir read from pipe 2020-05-06 19:03:29 +05:30
Arun Prakash Jana 4832fc5fe1
Drop fzy support 2020-05-06 18:41:01 +05:30
Todd Yamakawa c8ecf06c51
Add a bookmarks plugin that supports names (#558)
Co-authored-by: Todd Yamakawa <todd.yamakawa@arm.com>
2020-05-06 17:24:21 +05:30
Arun Prakash Jana bf078c0a8a
Update docs 2020-05-06 15:02:50 +05:30
Arun Prakash Jana 8568cd6770
Change requires to dependencies 2020-05-06 10:59:57 +05:30
Arun Prakash Jana cfbb8f2117 Uniform plugins 2020-05-06 10:42:50 +05:30
lvgx f438ddc28c
preview-tui: fix tmux behaviour, del refs to nuke (#559)
As reported by @toddyamakawa
2020-05-06 09:54:31 +05:30
Léo Villeveygoux 5b34d0dbe7 Prevent open FIFO prom leaking to subprocess
This fix previews window staying open after nnn exits, because they
inherited open FIFO (in write mode) from parent nnn process, and never
close it.
2020-05-06 01:45:21 +02:00
Arun Prakash Jana 2ea3ce552a
Shorten column width 2020-05-06 04:47:35 +05:30
lvgx ba51b36931
Add a tmux/xterm based text previewer plugin (#557)
Uses `NNN_FIFO`, minimal dependencies.

Co-authored-by: Todd Yamakawa <todd.yamakawa@arm.com>

Co-authored-by: Todd Yamakawa <todd.yamakawa@arm.com>
2020-05-06 04:38:10 +05:30
Arun Prakash Jana c360f5c908
which prints to screen 2020-05-06 04:36:26 +05:30
Arun Prakash Jana 33c4b1e7a2
Update docs 2020-05-06 01:46:06 +05:30
Arun Prakash Jana 97df7df297
Minor previewer plugin update, docs update 2020-05-06 01:03:10 +05:30
lvgx f47700a609
Add a tabbed/xembed based file previewer plugin (#552)
* Add a tabbed/xembed based file previewer plugin

This plugin is written in bash, because job control is not well
specified in POSIX sh (`jobs` can return anything).

We use `tabbed` [1] as a xembed [2] host, to have a single window
owning each previewer window.

Uses mpv, sxiv, zathura, and the nuke plugin.

[1]: http://tools.suckless.org/tabbed/
[2]: https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html

* tabbed-preview: prevent focus steal with xdotool

* preview-tabbed: tabs->4 spaces

* preview-tabbed: add focus prevention timeout
2020-05-06 00:28:57 +05:30
Arun Prakash Jana 4c18f22587
Fix double free when starting in list mode 2020-05-05 23:35:14 +05:30
Arun Prakash Jana a563c1a553
Update docs 2020-05-05 23:09:24 +05:30
0xACE 65da1c1941
Double click only works on same item (#555)
This patch disables accidental triggering of double clicking when you
are just single clicking on multiple objects fast.
2020-05-05 18:02:42 +05:30
0xACE c9f0e279af
SEL_FIRST now displays the correct message (#556)
A bit scary when you get prompted to remove a file but you wanted to
select a file.

I also made sure all strings are correctly ordered.
2020-05-05 17:49:26 +05:30
Arun Prakash Jana 6ee257920d
Fix context range check 2020-05-05 17:14:42 +05:30
Arun Prakash Jana a950510342
Update docs 2020-05-04 20:17:40 +05:30
Arun Prakash Jana 69e132e36d
Update docs 2020-05-04 09:50:31 +05:30
lvgx 86e579799b
Add an option to print hovered files to a FIFO (#548)
* Add an option to print hovered files to a FIFO

This adds an env variable, `NNN_FIFO`, that can be set to a path that
`nnn` will open/create as a FIFO, and where every hovered file's path is
printed. This allows creating external perview/quick open plugins, ...

It can be compiled out with the make variable `O_NOFIFO`.

* Check filename ptr instead of full path (for FIFO)

* Add documentation to use NNN_FIFO in plugins

* Fix path sent to FIFO in empty dirs
2020-05-04 09:35:13 +05:30
Arun Prakash Jana b5de18c28f
Use const type 2020-05-04 07:48:51 +05:30
Arun Prakash Jana 625c8d11f4
Refactor move_cursor() 2020-05-04 06:17:38 +05:30
Arun Prakash Jana f2fd923573
Fix #550 2020-05-04 04:25:26 +05:30
Arun Prakash Jana ffc0790fba
Add is_prefix(), block empty files completely 2020-05-04 04:08:12 +05:30
Arun Prakash Jana 92f8fe14f2
Bind getplugs to installed version 2020-05-03 20:28:16 +05:30
Arun Prakash Jana af71d470f5
Plugin finder: run custom find/fd/grep/rg/fzf and list 2020-05-03 19:03:42 +05:30
Arun Prakash Jana ebb6f153b5
Context code '+' to create context smartly 2020-05-03 16:25:59 +05:30
Arun Prakash Jana 3f60a1931f
Decouple listpath and initpath 2020-05-03 15:25:19 +05:30
Arun Prakash Jana 8b764a5f7c
Show messages appropriately 2020-05-03 15:14:26 +05:30
Arun Prakash Jana eee5057da5
Plugin mimelist: support reading file list from (cmd as) plugin 2020-05-03 14:55:33 +05:30
Danh Doan e8e87f6ba2
browse: fix nnn -e (#549)
The current code will start editor if the mime doesn't start with
"text/". But, we want the opposite.

Simplify the check by using `strncmp` instead.

We may improve by writing a helper: `start_withs` in the future.

This change also cleans -Wstrict-aliasing on Ubuntu 16.04 LTS
2020-05-03 09:56:16 +05:30
Arun Prakash Jana ff568ea748
Simplify unescape() in no locale mode 2020-05-03 02:52:48 +05:30
Arun Prakash Jana f5c6f4f90b
Dim file details in detail mode 2020-05-02 19:58:10 +05:30
Rami3L 45a69f1cbf
Fix: BSD expr syntax error on empty $NNNLVL (#546) 2020-05-02 09:44:19 +05:30
Arun Prakash Jana cb202e128b
Update docs 2020-05-02 04:49:10 +05:30
Arun Prakash Jana d7a53fd518
Update docs 2020-05-01 22:24:11 +05:30
lvgx e68d0db949
Install logo to desktop icons (#542)
This shows the "n³" logo as  icon in application menus, when desktop file is
installed (using `install-desktop` make target).
2020-05-01 21:28:07 +05:30
lvgx 1a78ad4aff
Add a logo for nnn (n³) (#544)
"n³" on a black knight chess piece/black horse head.
2020-05-01 21:17:03 +05:30
step 49eecd7684
Support $_Z_DATA environment variable (#545)
Support `$_Z_DATA` environment variable per z's documentation dcd5541e7d/z.1 (L78).
`$_Z_DATA` allows changing the default location of the z database file.
2020-05-01 15:06:19 +05:30
Arun Prakash Jana 73e3f2bca0
Move installation section to Wiki 2020-05-01 11:21:25 +05:30
Arun Prakash Jana 283a29c48f
Update autogen packages 2020-05-01 10:45:25 +05:30
Arun Prakash Jana 3ba456c150
New logo: n³ 2020-04-29 10:33:32 +05:30
Arun Prakash Jana da91228bba
Randomize mocp 2020-04-27 08:35:43 +05:30
Arun Prakash Jana f1a9446b99
Use mem* function 2020-04-27 08:25:13 +05:30
Arun Prakash Jana 187750556c
Let mocp shuffle 2020-04-27 08:23:22 +05:30
Arun Prakash Jana 35fb89b972
Randomize mocp playlist 2020-04-27 01:17:03 +05:30
Arun Prakash Jana eec0e6d18e Various plugin improvements 2020-04-27 00:05:40 +05:30
KlzXS babf379a74
Optimize dups (#539) 2020-04-26 22:25:03 +05:30
Arun Prakash Jana e7147c1f39
Show error at source 2020-04-26 14:05:56 +05:30
Arun Prakash Jana 33fdbc2216
Fix #537 2020-04-26 13:54:12 +05:30
Arun Prakash Jana 6689870460
Fix buffer cleanup 2020-04-26 10:59:01 +05:30
Arun Prakash Jana 01392d48ad
Fix buffer cleanup 2020-04-26 02:37:16 +05:30
Arun Prakash Jana 99d21531b4
Use memrchr if available 2020-04-26 02:06:17 +05:30
Arun Prakash Jana c732de32e4
Resolve path in list mode 2020-04-25 20:52:23 +05:30
Arun Prakash Jana 06fe7d52dd
Minor refactor 2020-04-25 03:42:34 +05:30
Arun Prakash Jana f8a243ea91
Silently ignore invalid paths (documented) 2020-04-25 00:46:29 +05:30
Arun Prakash Jana d118c4cc24
Fix #532: support picker and list modes together 2020-04-25 00:46:25 +05:30
Arun Prakash Jana fffaa74a09
Fix return and show error 2020-04-24 20:30:16 +05:30
KlzXS 7b7252dd32
Fix picker and list mode conflict (#533)
* Fix picker and list mode conflict

* Comment the change
2020-04-24 20:26:09 +05:30
Arun Prakash Jana bc572df55a
NNN_SEL: custom selection file 2020-04-24 18:12:18 +05:30
Arun Prakash Jana 752bc67de0
Bookmark key get priority over session 2020-04-24 09:54:43 +05:30
Arun Prakash Jana b11bdc9361
Update completion scripts 2020-04-24 09:36:33 +05:30
lvgx 7dab9d0d86
Add nbak plugin to backup all nnn config (#528)
* Add nbak plugin to backup all nnn config

* nbak: check cd, quote env

* nbak: print backup file name

* nbak: add --show option, to show shell config

* nbak: fix shellcheck warning

'type' is POSIX complient, AND we check that we're actually running
bash, but shellcheck can't understand this...
Then '-o' is POSIX complient too, but shellcheck thinks it's "not well defined".

* nbak: variable renames, archive hierarchy changes

* nbak: fix variable expansion

* nbak: remove --show option

* nbak: call interactive bash/zsh to get fun/aliases

* Add nbak entry in plugins/README.md

* nbak: change archive hierarchy

* plugins/README.md: make nbak description shorter
2020-04-23 23:05:58 +05:30
KlzXS 00148360e4
Plugin improvements (#531)
* Added padding for numbers in .nmv

* Add skim as an option in fzopen

* Remove unnecessary eval

Thanks @leovilok!

Co-Authored-By: lvgx <l@vgx.fr>

* Added note about whitespace

Co-authored-by: lvgx <l@vgx.fr>
2020-04-20 22:39:30 +05:30
Krisan Alifari d549ae7486
Add nvim as a diff tool for getplugs plugin (#527)
* Add nvim as a diff tool for getplugs plugin

* Comment out `is_cmd_exists()`

* Add nvim diff tool for diffs plugin

* Add $EDITOR to nuke plugin for editing/reading text file format

* Modify diff command to fix CircleCI failures

* Fix getplugs prompt

* Allow nuke to use custom $PAGER
2020-04-20 22:19:35 +05:30
Arun Prakash Jana 4b5ecbe8fc
Do a complete erase 2020-04-19 03:11:12 +05:30
Arun Prakash Jana 12df1ab083
Fix listing files directly under / 2020-04-18 15:08:23 +05:30
Arun Prakash Jana b40e12ee9f
Remove hacky single path handling 2020-04-18 13:35:57 +05:30
Arun Prakash Jana 75724f9e3b
Fix #520: minimal erasure 2020-04-18 07:18:35 +05:30
Arun Prakash Jana e38c0108ba
Update issue template, add feature template 2020-04-18 06:58:19 +05:30
Arun Prakash Jana 645f43355e
Fix #526: persistent session 2020-04-18 04:54:07 +05:30
Todd Yamakawa c63fb28eff
Fix #523: handle NNN_PIPE (#525)
Co-authored-by: Todd Yamakawa <todd.yamakawa@arm.com>
2020-04-17 17:51:57 +05:30
Arun Prakash Jana 58ecc240ed
Save offset in key-val pairs 2020-04-17 16:53:19 +05:30
Arun Prakash Jana e92b523976 Fix #523: create NNN_PIPE early 2020-04-17 08:54:50 +05:30
lvgx 7cc46510e3
nuke: add lowdown as alternative markdown viewer (#524)
See https://kristaps.bsd.lv/lowdown/
2020-04-17 08:11:08 +05:30
Arun Prakash Jana ddaddcaf21
Experimental: guards to reduce repeat screen redraws 2020-04-16 17:45:58 +05:30
Arun Prakash Jana 37ebf8054f
Go to first file or next match 2020-04-16 03:44:07 +05:30
Arun Prakash Jana 63c177bb15
Env var NNN_LOCKER 2020-04-16 00:29:45 +05:30
Arun Prakash Jana 135172a1c6
Fix #520 2020-04-15 22:36:33 +05:30
Arun Prakash Jana 124d66dcbd
Fix build break 2020-04-15 21:05:10 +05:30
Arun Prakash Jana 425c0559a5
One-pass key-val pair parsing for bms and plugs 2020-04-15 20:43:26 +05:30
Arun Prakash Jana ac8b56ecc2
Show entry even if no permission 2020-04-15 17:52:21 +05:30
Arun Prakash Jana 588b413832
Optimized xstrlen(), xstrdup() 2020-04-15 16:18:41 +05:30
Arun Prakash Jana 30a6caf8bc
Refactor set_time_type() 2020-04-14 22:38:33 +05:30
Arun Prakash Jana e0cdbcb521
Check for file first (more in number) 2020-04-14 20:59:37 +05:30
Arun Prakash Jana 1029ff0d5b
MInor refactor 2020-04-14 09:54:42 +05:30
Arun Prakash Jana 555492276c
Update docs 2020-04-14 03:02:53 +05:30
Arun Prakash Jana cf3c55b787
Update docs 2020-04-14 01:25:54 +05:30
Arun Prakash Jana e72fa538d7 Reduce the scope of loop variables 2020-04-13 23:21:43 +05:30
Katrin Leinweber e83e505659
Fix typo (#516) 2020-04-13 22:39:32 +05:30
lvgx a6cef2504c
Make NNN_COLORS override NO_COLORS (#515) 2020-04-13 22:21:56 +05:30
Arun Prakash Jana cd1c458c96
Fix build break 2020-04-13 21:55:11 +05:30
Arun Prakash Jana a9436cfe7b
Fix build break 2020-04-13 21:42:23 +05:30
Arun Prakash Jana c58434d078
Fix symlink to dir indicator in detail mode 2020-04-13 20:42:19 +05:30
Arun Prakash Jana 35c3497364
Use memccpy 2020-04-13 20:35:14 +05:30
Arun Prakash Jana 315132b363
Happy Birthday nnn! 🍰 2020-04-13 09:01:09 +05:30
Krisan Alifari aa7f1dabdd
Support $FZF_DEFAULT_COMMAND on fzopen plugin (#514) 2020-04-12 22:39:24 +05:30
Arun Prakash Jana f54d51c863
Change nav-as-you-type to type-to-nav 2020-04-12 22:39:14 +05:30
Arun Prakash Jana 806b91b60d
Simplified dirname() 2020-04-12 17:44:29 +05:30
Arun Prakash Jana 2b3214bd58
Simplify finding valid parent 2020-04-12 17:12:14 +05:30
Arun Prakash Jana 5e0049b6fa
Fix indent 2020-04-12 09:50:03 +05:30
Saagar Jha 3bab34e962
Opinionated xstrlcpy changes (#513)
* Unvectorize xstrlcpy

On all libcs I could find, memcpy does a better job than we can.

* Rename xstrlcpy to xstrsncpy to avoid confusion

The semantics of our xstrlcpy differed slightly from strlcpy; we return
the number of copied characters; strlcpy returns the strlen(src).
strscpy from Linux is similar except it returns the number of copied
characters sans the NUL byte, so this is named strsncpy to be different.
2020-04-12 06:05:14 +05:30
Arun Prakash Jana 2115d75ac6
Minor refactor 2020-04-11 23:48:05 +05:30
Arun Prakash Jana 0b66191dd5
Minor refactor 2020-04-11 20:23:24 +05:30
Arun Prakash Jana a8da9979b7
Update docs 2020-04-11 11:16:21 +05:30
Arun Prakash Jana 36ae4b8250
Hover on dir and connect remote 2020-04-10 19:53:16 +05:30
Arun Prakash Jana f93bb79de8
Update docs 2020-04-10 18:30:59 +05:30
Arun Prakash Jana b3f8e4e511
Minor reformat 2020-04-09 19:13:42 +05:30
Arun Prakash Jana 707e30a590
Show status bar info in context color 2020-04-09 16:52:36 +05:30
Arun Prakash Jana e5ba4f69bb
Update docs 2020-04-09 11:55:44 +05:30
Arun Prakash Jana 341b1ccb00
x to extract archive 2020-04-07 21:18:24 +05:30
Arun Prakash Jana 46f17885ce
Fix #511: chew ling strings at filter prompt 2020-04-06 21:39:37 +05:30
Arun Prakash Jana cee24984bc
Fix #511 2020-04-06 21:06:39 +05:30
Arun Prakash Jana e1ed4c62c5
Fix #510 2020-04-06 19:30:16 +05:30
Arun Prakash Jana b060115a19
A nocolor msg print 2020-04-05 22:46:16 +05:30
Arun Prakash Jana 1195dc86e0
Remove redundant calls 2020-04-05 21:45:30 +05:30
Arun Prakash Jana 078d05dc7a
Fix jump on canceled duplicate 2020-04-05 14:42:32 +05:30
Arun Prakash Jana 1014d941b1
Support only NO_COLOR, revert -C to disable color 2020-04-05 13:07:18 +05:30
lvgx f14fb9c0f9
Add suport for "standard" NO_COLOR env variable (#508)
See https://no-color.org
2020-04-05 03:56:18 +02:00
Arun Prakash Jana 6d13fce698
Fix screen not cleared with drag down on narrow terms 2020-04-05 06:37:26 +05:30
Arun Prakash Jana 0c966b2178
With dimming, @ is not required for symlink to dir 2020-04-05 06:30:28 +05:30
Arun Prakash Jana 02c02c520d
Option -C to disable color 2020-04-05 05:53:46 +05:30
Arun Prakash Jana 0e3146ebd2
Status bar in context color 2020-04-04 23:39:21 +05:30
Arun Prakash Jana 5bd4a65b91
Add script to generate files 2020-04-04 09:57:21 +05:30
Arun Prakash Jana 73daf8be5b
Update docs 2020-04-03 19:52:33 +05:30
Arun Prakash Jana 38bd3c4900
(Sh)TAB should get a new context if required 2020-04-02 20:47:15 +05:30
Nick Waywood 415a6edd4a
Added support for fzy (#505)
* Added fzfz plugin

* Fixed shellcheck errors

* Fixed copy/paste error

* Added support for fzy, also renamed plugin since it's not specific to fzf anymore

* Refactored code

* Clean spillovers (jarun)
2020-04-02 10:58:54 +05:30
Nick Waywood 553f183919
Added fzfz plugin (#502)
* Added fzfz plugin

* Fixed shellcheck errors

* Fixed copy/paste error
2020-04-01 18:05:52 +05:30
Arun Prakash Jana a3f509ffc6
Fix #499: add fflush() as well 2020-04-01 15:16:21 +05:30
Arun Prakash Jana ef159b9985
Fix clang-tidy warnings 2020-04-01 04:21:39 +05:30
Arun Prakash Jana f8d2be504a
Remove redundant param 2020-04-01 04:21:39 +05:30
Arun Prakash Jana 91bd84cd5d
Fix #499 2020-04-01 04:21:40 +05:30
lvgx 6e6d3cba0d
Add .desktop file for XDG compatible DEs (#501)
Install with `make install-desktop`
It now appears in application menus, search, etc. in XDG compatible
desktop environments (like GNOME, KDE, ...).
2020-04-01 02:29:21 +05:30
Arun Prakash Jana 47ec055651
Fix #499: broken readline prompt 2020-04-01 02:26:32 +05:30
Arun Prakash Jana c01857cddb
Fix fzcd at /, minot refactor 2020-03-31 22:26:20 +05:30
Arun Prakash Jana 2d27902ac0
Quicker re-sort 2020-03-31 03:44:52 +05:30
Arun Prakash Jana eea1b5da7d
Update docs 2020-03-31 01:59:30 +05:30
Arun Prakash Jana a4243edacc
make var O_NOBATCH to compile out native batch renamer 2020-03-30 22:09:39 +05:30
Arun Prakash Jana 54d2580799
Add fortune to help 2020-03-30 09:09:11 +05:30
Arun Prakash Jana 9fea0220c4
List mode: limit exceeded error 2020-03-29 22:35:41 +05:30
Arun Prakash Jana b8ede9895f
Use more sensible msg 2020-03-29 21:27:52 +05:30
Arun Prakash Jana 8f910fe85a
Fix build break 2020-03-29 20:32:11 +05:30
Arun Prakash Jana 3d9905615d
Fix crash 2020-03-29 20:26:31 +05:30
Arun Prakash Jana 267dc04f6c
Reduce presel usage 2020-03-29 20:22:43 +05:30
Arun Prakash Jana d2e83b2cfe
Refactor change directory 2020-03-29 17:25:11 +05:30
Arun Prakash Jana 6ea33f1db3
Remove redundant name copy 2020-03-29 15:48:10 +05:30
Arun Prakash Jana e9ff65a7b5
No re-filter on MSGWAIT 2020-03-29 14:03:11 +05:30
Arun Prakash Jana 0bfc032e5d
Do not reload 2020-03-29 10:02:21 +05:30
Arun Prakash Jana 446266d4c7
Fix build error 2020-03-29 04:24:31 +05:30
Arun Prakash Jana df1e17a4c2
Reload dir when entering filter mode 2020-03-29 04:04:57 +05:30
Arun Prakash Jana dc7711271c
Fix sorting 2020-03-29 03:19:15 +05:30
Arun Prakash Jana 8f3f64b5a6
Experimental: retain filter in normal mode 2020-03-29 01:58:07 +05:30
Arun Prakash Jana c3ff380354
Retain hovered file name in filtered view with delayed msg 2020-03-28 12:28:00 +05:30
Arun Prakash Jana b87cdcde60
Fix wrong lint report 2020-03-28 09:45:22 +05:30
Arun Prakash Jana 22ccf5e2e6
Support time type (access/change/mod) change 2020-03-28 09:20:14 +05:30
Arun Prakash Jana 7e063f49d1
Update link 2020-03-27 20:49:44 +05:30
Arun Prakash Jana 72333dcdd6
Statics are always initalized to 0 2020-03-27 14:38:56 +05:30
Arun Prakash Jana bf057c1007
Fix #498 2020-03-27 13:06:01 +05:30
Arun Prakash Jana 68fd0d7dd2
Use meaningful vars 2020-03-25 20:52:27 +05:30
Arun Prakash Jana dc08354b0f
Update docs 2020-03-25 11:47:30 +05:30
Arun Prakash Jana 48bee9fafe
Update badge 2020-03-24 09:18:04 +05:30
Arun Prakash Jana 33f2a2f37b
Remove redundant assignments 2020-03-21 21:28:48 +05:30
Arun Prakash Jana 49e36a4707
Reformat bookmark handling 2020-03-21 19:10:01 +05:30
KlzXS aab90bf515
Add verbose option (#497) 2020-03-21 00:58:42 +05:30
Arun Prakash Jana 5e8f0aec35
Add regex exclude example 2020-03-21 00:55:46 +05:30
Arun Prakash Jana 41f80f1f60
Key > to export file list 2020-03-20 23:46:58 +05:30
Arun Prakash Jana 0c55977465
Fix #496: option -f to use readline history file 2020-03-20 22:24:49 +05:30
Arun Prakash Jana f4786da9bc
Option -T obsoletes option -v 2020-03-18 02:41:30 +05:30
Arun Prakash Jana 85379a703b
Option -T to change default sort order 2020-03-18 02:35:05 +05:30
Arun Prakash Jana fc8c5b46b3
Skip erasing the complete screen 2020-03-16 21:39:44 +05:30
Arun Prakash Jana 1cf50e738f
Add clang-9 to compilation matrix 2020-03-16 07:33:54 +05:30
Arun Prakash Jana b8a973a91a
Update plugins to support some env vars 2020-03-16 07:13:35 +05:30
Arun Prakash Jana a2c2332fc5
Update man page 2020-03-15 20:55:14 +05:30
Arun Prakash Jana ea2de804f8
batch rename: check dep, handle invalid input 2020-03-15 20:26:53 +05:30
Arun Prakash Jana 03e6d7d553 Adapt PR #495 2020-03-15 19:52:02 +05:30
KlzXS c215c5de80
Convert batchrename to bash and rename it (#495) 2020-03-15 19:49:05 +05:30
Arun Prakash Jana 67994ff4b2
Check if file is accessible 2020-03-14 21:44:48 +05:30
Arun Prakash Jana 4e58ad318c
Update plugin docs 2020-03-14 20:37:04 +05:30
Arun Prakash Jana 1e53cd8ea1 Highlight the last copied/moved file 2020-03-14 20:22:58 +05:30
lvgx d4b0ffa75e
Add x2sel plugin (reverse .cbcp) (#494)
This plugin is based on .cbcp and does basically the reverse operation.
It copies system clipboard newline-separated file list to selection.
2020-03-14 10:15:56 +05:30
Arun Prakash Jana 0ef2b61a17
Increase number of events handled 2020-03-14 06:51:52 +05:30
Arun Prakash Jana 2d952795a8
Start watching dir if filter mode is disabled 2020-03-14 05:14:25 +05:30
Arun Prakash Jana 02754205a2
Fix #492 2020-03-11 21:59:34 +05:30
Arun Prakash Jana f527dd1c6a
Integrate batch renamer plugin 2020-03-11 17:52:38 +05:30
KlzXS 29fe67b799
Addressing #489 (#490)
* Fix empty printf, change separator for sed

* Added missing quotes
2020-03-11 17:50:55 +05:30
Arun Prakash Jana 233b801131
Case-insensitive Ctrl-key handling, man page update 2020-03-11 09:50:26 +05:30
Arun Prakash Jana bf89040ace
Case-insensitive Ctrl-key handling, man page update 2020-03-11 09:14:59 +05:30
lvgx c9a17d80be
Add middle click copy (#491)
* Add middle click copy

* Make middle click action configurable

This introduces the NNN_MIDDLECLICK environment variable, containing the
key that middle mouse click emulates. Only the first character is read.

* Document NNN_MIDDLECLICK in nnn.1

* Use NNN_MCLICK instead of NNN_MIDDLECLICK

* Add '^key' syntax to set middle click to Ctrl+Key
2020-03-11 09:09:57 +05:30
Arun Prakash Jana 3a9ddbd90f
Add batchrename to readme, minor Makefile change 2020-03-11 09:07:20 +05:30
KlzXS f6ff9ae4aa
POSIX compliant batchrename plugin (#488)
* Added (almost) POSIX compliant batch rename script

* Not fully

* Added selection/current prompt
2020-03-08 07:15:11 +05:30
Arun Prakash Jana 4cd9adfd9b
Add badge to Wiki 2020-03-07 23:44:00 +05:30
Arun Prakash Jana 3dbe08aad6
Fix #486 2020-03-06 18:58:08 +05:30
Arun Prakash Jana d97d152269
Fix #486 2020-03-06 04:50:04 +05:30
Arun Prakash Jana 9bfda074bd
Show statusbar in du/au mode 2020-03-05 21:08:55 +05:30
Arun Prakash Jana 0cb5ddf3f1
Fix regression in calculating apparent du for dirs 2020-03-05 21:05:37 +05:30
Arun Prakash Jana 1fbaa61052
Add option to clear sort order 2020-03-05 20:45:07 +05:30
Arun Prakash Jana 020619d2b8
Remove mention of Lead key 2020-03-05 00:20:51 +05:30
Arun Prakash Jana 646cd10b57
Fix #484 2020-03-04 06:18:08 +05:30
Arun Prakash Jana 4aa12a2dfb
sxiv: load dir along with file 2020-03-03 06:16:52 +05:30
Arun Prakash Jana 0941e511e4
Clear filter at start 2020-03-02 18:54:53 +05:30
Arun Prakash Jana a54a23eae5
Minor refactor 2020-03-01 22:26:52 +05:30
Arun Prakash Jana 146f24e5de
Use target vars to create dirs 2020-03-01 21:00:45 +05:30
Arun Prakash Jana 78d0ea50f4
Use the same convention for global var names 2020-03-01 19:48:40 +05:30
Arun Prakash Jana 5533e38fbb
Guard against too many key-value pairs 2020-03-01 18:59:27 +05:30
Arun Prakash Jana db129c9120
Update Haiku Makefile 2020-03-01 18:56:33 +05:30
Arun Prakash Jana f3c4dae1dd
Fix build break 2020-03-01 18:34:59 +05:30
Arun Prakash Jana 1224270104
Drop path validation 2020-03-01 17:25:49 +05:30
Arun Prakash Jana ad9f834b64
Update right click sel 2020-03-01 12:44:28 +05:30
lvgx b2f2b78990
Add right click file selection (#482) 2020-03-01 12:40:35 +05:30
Arun Prakash Jana 2b11601f89
Set attrs in a go 2020-03-01 12:19:17 +05:30
Arun Prakash Jana 5228528fac
Update deps 2020-03-01 06:44:54 +05:30
Arun Prakash Jana b52d17caa2
Do not store force quit option in session 2020-02-29 20:06:39 +05:30
Arun Prakash Jana 56eb4cab6e
Update docs 2020-02-29 19:14:19 +05:30
Arun Prakash Jana 77e3183467
Merge quitcd scripts for bash and zsh 2020-02-29 18:36:47 +05:30
Arun Prakash Jana a5a3a84bd1
Shorten messages 2020-02-29 15:10:42 +05:30
Arun Prakash Jana edb9fe14e4
Reformat get archive cmd 2020-02-29 13:53:16 +05:30
Arun Prakash Jana 0d7d0ca7db
realpath allocates memory 2020-02-29 12:56:10 +05:30
Arun Prakash Jana 5198c62863
Unlimited bookmarks, several fixes 2020-02-29 09:53:49 +05:30
Arun Prakash Jana a1e2ef055e
Continue in filter mode 2020-02-29 06:32:02 +05:30
Arun Prakash Jana 37987d487e
Ignore backspace at empty filter prompt 2020-02-29 06:08:26 +05:30
Arun Prakash Jana d1fcc5351e
Fix lint 2020-02-28 19:36:00 +05:30
Arun Prakash Jana 88167511f6
Unlimited bookmarks and plugin keys 2020-02-28 19:23:57 +05:30
Arun Prakash Jana 76cf0c65d4
Hover next file on delete 2020-02-28 07:34:02 +05:30
Arun Prakash Jana fc805dac26
Do not count hard links for dirs 2020-02-28 01:57:33 +05:30
Arun Prakash Jana 9c100f987c
Single struct for patterns strings 2020-02-28 00:33:35 +05:30
Arun Prakash Jana c9f9ca32dd
Extra space for size column 2020-02-28 00:00:44 +05:30
Arun Prakash Jana 993ea99b76
Remove redundant buffers 2020-02-27 23:55:23 +05:30
Arun Prakash Jana 4eae58edd3
Fix filename truncation if O_NOLOC set 2020-02-27 21:41:06 +05:30
Arun Prakash Jana b5339c2dc5
Update man page 2020-02-27 19:51:04 +05:30
Arun Prakash Jana 95356681ff
Fix handling hard-links 2020-02-27 18:49:44 +05:30
Arun Prakash Jana 74e77f78fa
Support more sepecial keys at empty prompt in nav-as-you-type 2020-02-27 08:47:00 +05:30
Arun Prakash Jana c6cc8a5181
Use 32-bit unsigned params 2020-02-27 07:30:14 +05:30
Arun Prakash Jana 05f3d5fdbe
Hash inodes with lesser number of bits 2020-02-27 00:38:30 +05:30
Arun Prakash Jana f12bf0a2ee
Dim links 2020-02-26 23:49:20 +05:30
Arun Prakash Jana 987cc9b4b3
Drop / indicator for directories 2020-02-26 22:19:48 +05:30
Arun Prakash Jana dd2be32382
Get rid of printw() 2020-02-26 20:49:20 +05:30
Arun Prakash Jana f0f8008014
Restore filter on context switch in non nav-as-you-type mode 2020-02-26 19:42:37 +05:30
Arun Prakash Jana 7aa72ddd79
Optimize print entry 2020-02-26 08:54:34 +05:30
Arun Prakash Jana 07437a897c
Reformat entry printing 2020-02-26 03:31:32 +05:30
Arun Prakash Jana 71bac356d6
Optimize unescape 2020-02-26 01:53:43 +05:30
Arun Prakash Jana ae1d656a27
Update help, check for mocp before using mocplay 2020-02-25 21:37:52 +05:30
Arun Prakash Jana a780ab1c80
Update docs 2020-02-24 19:56:02 +05:30
Arun Prakash Jana d442346755
Update mocplay to understand opener calls 2020-02-23 15:29:21 +05:30
Arun Prakash Jana 78372b203a
Support coversion of current file 2020-02-23 14:56:51 +05:30
Arun Prakash Jana 702e29bbe9
Auto-select hovered file for diff when only 1 selected 2020-02-23 14:32:23 +05:30
Arun Prakash Jana e73ec218a9
Plugin mp3conv to extract audio from media as mp3 2020-02-23 13:09:24 +05:30
Arun Prakash Jana 5f419dc603
Fix doc 2020-02-23 10:36:32 +05:30
Arun Prakash Jana dd5b419742
Treat ~ as special shortcut in filterentries 2020-02-22 21:25:05 +05:30
Arun Prakash Jana 04ab3751af
Minor refactor 2020-02-22 18:42:55 +05:30
Arun Prakash Jana f2ba23bb3a
Combine file mode check 2020-02-22 17:10:29 +05:30
Arun Prakash Jana f61323cccd
Simplify detail print 2020-02-22 15:08:59 +05:30
Arun Prakash Jana d0930d0ccf
Show hard link symbol 2020-02-22 12:49:50 +05:30
Arun Prakash Jana 4a91df950b
Ignore hard links on du 2020-02-22 08:44:28 +05:30
Arun Prakash Jana 0f03b41995
Fix build break 2020-02-22 04:28:27 +05:30
Arun Prakash Jana b816a90256
Macro for confirmation 2020-02-22 04:18:15 +05:30
Arun Prakash Jana ca257e6016
Do not save trash setting in config (and session) 2020-02-21 21:54:26 +05:30
Arun Prakash Jana a1b8631d96
Tweak fzopen to show parent dir and filename with fzf 2020-02-20 08:37:49 +05:30
Arun Prakash Jana 9f1b51b004
Allow choosing the same context in plugin helper 2020-02-20 07:54:32 +05:30
Arun Prakash Jana f7f53bbd6b
Update docs 2020-02-20 00:59:06 +05:30
Arun Prakash Jana f6e814e364
nuke: open log files in vi 2020-02-19 20:22:00 +05:30
Arun Prakash Jana c5d122e299
Fix broken abort msg when starting in du mode 2020-02-19 19:04:51 +05:30
Arun Prakash Jana 39fffbac56
Update docs 2020-02-18 18:24:53 +05:30
0xACE 75f6d5d735
Avoid trying to edit a non-existing file (#477)
The previous implementation was inconsistent, sometimes it would
inherit the name of the parent folder of the current directory.

Other scenarios i encountered were:
1. Yield a empty search result, and try to edit. It would seemingly
   randomly select a file or folder
2. What would happen in a root path without any files residing?
2020-02-18 03:51:46 +05:30
Arun Prakash Jana 9cf77708a1
Late get and set NNNLVL before spawning shell 2020-02-17 20:34:03 +05:30
Arun Prakash Jana 1a8f9ee459
Minor reformat 2020-02-17 19:51:24 +05:30
Arun Prakash Jana 7837cc277f
Update docs 2020-02-15 07:27:12 +05:30
Arun Prakash Jana 6024c51839
Remember file name when refresh is not requested 2020-02-14 22:44:49 +05:30
Arun Prakash Jana b0ba197555
Do not play dat by extension 2020-02-14 22:37:47 +05:30
Arun Prakash Jana f2c4890d6e
Polish PR #476 2020-02-14 20:55:42 +05:30
Uffe Jakobsen 1ed015e988
Add NNN_OPTS environment variable feature (#476) 2020-02-14 20:35:17 +05:30
Arun Prakash Jana 9b199b3253
Remove redundant mouse mask variable 2020-02-14 18:48:44 +05:30
Arun Prakash Jana e664b2d29f
Compile option O_NOMOUSE to disable mouse support 2020-02-14 08:21:30 +05:30
Arun Prakash Jana a0339adf84
Minor refactor 2020-02-14 07:17:09 +05:30
Arun Prakash Jana 928f325a74
Use atoi from lib, use attribute for unused 2020-02-14 06:42:30 +05:30
Arun Prakash Jana ed616cf746
Minor refactor 2020-02-13 20:28:08 +05:30
Arun Prakash Jana 4bd742dafb
Fix static package name in repo 2020-02-13 16:38:06 +05:30
Arun Prakash Jana 80545534a9
Fix #474: explicitly indicate gzip to tar 2020-02-13 15:18:56 +05:30
Arun Prakash Jana 4ffb42c73e
Use s in statusbar to indicate selection enabled 2020-02-13 01:56:16 +05:30
Arun Prakash Jana a8bca5f440
Enable UTF8 for PCRE 2020-02-12 23:02:02 +05:30
Arun Prakash Jana dda34f5c73
Update Haiku Makefile 2020-02-12 08:54:04 +05:30
Arun Prakash Jana f6e7dbf6f9
Fix static file upload 2020-02-12 08:32:49 +05:30
Arun Prakash Jana bc7a81921e
Prepare for release v3.0 2020-02-12 07:30:15 +05:30
Arun Prakash Jana 3532d6c3ab
Play known video file types by extension 2020-02-12 07:05:41 +05:30
Arun Prakash Jana fb2793354b
Do not end selection on redraw 2020-02-10 19:23:15 +05:30
Arun Prakash Jana e318672904
Fix prefix calcualtion 2020-02-09 08:21:12 +05:30
Arun Prakash Jana 3d5815c5d1
Fix man 2020-02-09 05:40:24 +05:30
Arun Prakash Jana 43fc9890e8
When a file is edited, vim adds a \n at the end 2020-02-09 05:38:12 +05:30
Arun Prakash Jana bc5234be8d
Simplify and fix common prefix calculation 2020-02-09 00:25:58 +05:30
Arun Prakash Jana 58357912bc
Fix build break 2020-02-08 19:58:30 +05:30
Arun Prakash Jana 13e28fdecc
Use xrealpath() to show unresolved symlinks 2020-02-08 19:35:07 +05:30
Arun Prakash Jana 0a48b6b8cc
Ignore . and .. in file list 2020-02-08 19:18:49 +05:30
Arun Prakash Jana ae486e36b8
1. dirname() loses path, 2. use realpath() 2020-02-08 18:51:56 +05:30
Arun Prakash Jana 72668069ed
Show target file size in list mode 2020-02-08 17:45:49 +05:30
Arun Prakash Jana 1d60b6a475
Fix empty dir on list files 2020-02-08 00:11:10 +05:30
Arun Prakash Jana eaba594a9e
Clear filter on a manual dir relaod 2020-02-07 05:53:15 +05:30
Arun Prakash Jana 6d77b04032
Minor refactor 2020-02-04 23:21:50 +05:30
Arun Prakash Jana 05ae384b2d
Document list files 2020-02-03 08:46:14 +05:30
Arun Prakash Jana 1614ce172b
Late allocate memory for path pointers 2020-02-02 19:10:35 +05:30
Arun Prakash Jana 6faab79ba9
xrealloc() may move memory 2020-02-02 17:36:35 +05:30
Arun Prakash Jana 06f6435ebd
Fix build break 2020-02-02 17:25:47 +05:30
Arun Prakash Jana 47a2f93e02
Refactor file list processing 2020-02-02 17:07:53 +05:30
Arun Prakash Jana 04d9b667ed
Remove redundant example 2020-02-02 13:47:42 +05:30
Arun Prakash Jana 840b4a01a0
Update docs 2020-02-01 22:42:49 +05:30
Arun Prakash Jana da4f585188
Fix #446 2020-02-01 22:30:32 +05:30
Arun Prakash Jana 897f01c2c3
Reduce the number of redundant checks 2020-02-01 22:00:53 +05:30
KlzXS 2390ac7b74
List of files as input (#443)
* Start implementation on show list of files as input

* Remove tmp dir on exit, set global flag

* Bug fixes and improvements

* Follow symlinks when in list paths mode

* Fix bugs

* Add flag check

* Add message for invalid paths and style fixes

* Change the message

* Addressing review comments

* Handle errno being set

* Fix CI break

* Decreased startup memory usage and removed loops

* Fix CI break
2020-02-01 20:24:56 +05:30
Maxim Baz 099a9af289
Do not swallow keypress after printwait (#461) 2020-02-01 20:07:18 +05:30
Arun Prakash Jana c0f423496e
Use _exit() to terminate children
The NNN_PIPE file gets deleted after spawning a child in NOWAIT mode. Steps:
- open `nnn` with option `-x`
- press `;o` (custom binding) to open fzopen plugin
- press `^J` to select a file; it will spawn plugin `.cbcp` in NOWAIT mode
- when the intermediate child quits, the NNN_PIPE of parent is also deleted
2020-02-01 19:28:59 +05:30
Arun Prakash Jana 4401dbe092
Ignore link assuming stdscr is NULL 2020-02-01 18:46:56 +05:30
Arun Prakash Jana 27943b9efb
Fix #459
The following changes are made:

- STDOUT and STDIN are redirected to /dev/null when spawning rclone
  rclone blocks and also shows error/warning messages. nnn needs to spawn
  rclone and return without waiting. To avoid the rclone messages from
  corrupting the screen nnn makes the child silent.
  Note: sshfs returns after mount with a proper error code
- prompt only if both sshfs and rclone are installed
2020-02-01 08:57:16 +05:30
Arun Prakash Jana c7e2dc0005
Upload static binary as package 2020-01-31 08:43:35 +05:30
Maxim Baz 6b093f213f
Compile static bin locally for release (#457) 2020-01-31 03:16:06 +05:30
Arun Prakash Jana 6f48a711d4
Auto-proceed on open (key + to toggle) 2020-01-31 01:45:06 +05:30
Arun Prakash Jana 6aed714347
Run GUI app as plugin 2020-01-30 23:41:19 +05:30
Sijmen J. Mulder 46fc9c983c
Fallbacks for absent NAME_MAX and PATH_MAX (#455)
* Fallbacks for absent NAME_MAX and PATH_MAX

Certainly NAME_MAX isn't guaranteed to exist and on (some versions of?)
Illumos and SmartOS it doesn't, so provide some reasonably accommodating
fallbacks.

* Smaller limits

* Remove now redundant PATH_MAX definition for Hurd
2020-01-29 19:01:07 +05:30
Arun Prakash Jana c434d8d4bc
Use enough buffer length for file names 2020-01-29 05:22:03 +05:30
Arun Prakash Jana cb6f30fed4
Remove redundant lib only for older GLIBC 2020-01-28 18:55:41 +05:30
Arun Prakash Jana 9cbadc12be
Fix typo 2020-01-27 23:50:29 +05:30
Arun Prakash Jana e3d80da2ad
Exit prompt on ^D at empty prompt 2020-01-27 19:46:10 +05:30
Ethan R 812368cce6 Added more readline bindings (#452) 2020-01-27 18:57:56 +05:30
Arun Prakash Jana 3fd9e6ace7
Add -DNORL when var O_STATIC is set 2020-01-25 23:44:28 +05:30
Arun Prakash Jana bc177fd266 Revert "Test static packaging"
This reverts commit dbcbaa583c.
2020-01-25 08:55:07 +05:30
Arun Prakash Jana dbcbaa583c
Test static packaging 2020-01-25 08:36:50 +05:30
Arun Prakash Jana a2288594d1
Move compilation notes to Wiki 2020-01-24 23:42:05 +05:30
Arun Prakash Jana 1684d7b24e
Makefile option to compile with PCRE lib
Command: make O_PCRE=1 strip
2020-01-24 23:29:05 +05:30
Arun Prakash Jana e5ad7d81ff
PCRE 2 - fix check for filter match
Kind contribution from uno20001:

https://old.reddit.com/r/C_Programming/comments/etavho/file_manager_nnn_needs_help_with_pcre/fffk4wr/
2020-01-24 22:46:47 +05:30
Arun Prakash Jana 196c09ab9b
PCRE 2 - fix compilation error 2020-01-24 22:25:27 +05:30
Arun Prakash Jana e2d37632ea
PCRE - add error handling 2020-01-24 19:00:45 +05:30
KlzXS 27617c0446 Detach process with F_NOWAIT (#450)
* Experimental PCRE library support

To compile with PCRE install libpcre-dev(el) and run:

cc  -Wall -Wextra -O3 -DPCRE -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -I/usr/include -o nnn src/nnn.c -lreadline -lncursesw -ltinfo -lpcre

* Detach process with F_NOWAIT

Co-authored-by: Mischievous Meerkat <engineerarun@gmail.com>
2020-01-24 18:58:43 +05:30
Arun Prakash Jana 827875c3ef
Experimental PCRE library support
To compile with PCRE install libpcre-dev(el) and run:

cc  -Wall -Wextra -O3 -DPCRE -D_GNU_SOURCE -D_DEFAULT_SOURCE -I/usr/include/ncursesw -I/usr/include -o nnn src/nnn.c -lreadline -lncursesw -ltinfo -lpcre
2020-01-24 02:17:48 +05:30
Arun Prakash Jana d67ad84360
Add static compilation flag
make command:

make O_STATIC=1 O_NORL=1 strip
2020-01-23 22:22:07 +05:30
Arun Prakash Jana 50df09b918
Do not show file name in status bar
Both in light and detail modes we show more characters than in status bar.
2020-01-23 21:21:24 +05:30
Arun Prakash Jana de4b817998
Lazy unmount, umount (macOS) support 2020-01-23 02:00:16 +05:30
Arun Prakash Jana d224016011
nuke: add glow to preview markdown 2020-01-22 23:20:31 +05:30
Arun Prakash Jana 60dfb79b8d
Check if path exists before trying to create 2020-01-22 20:09:16 +05:30
Arun Prakash Jana a87be62204
Use indicative dir names when creating 2020-01-22 00:00:33 +05:30
Arun Prakash Jana 8d6f766e75
Remove redundant variables/assignments 2020-01-21 23:09:05 +05:30
Arun Prakash Jana 8df6602fac
Remove redundant check 2020-01-21 21:53:45 +05:30
Arun Prakash Jana a6f5f1ebc8
Update badges 2020-01-21 18:29:54 +05:30
Arun Prakash Jana abd1df8770
Initialize mask 2020-01-20 23:33:57 +05:30
Arun Prakash Jana 9b45b05746
Code refactor 2020-01-20 19:09:10 +05:30
Arun Prakash Jana d0f26e7c30 Revert "Update badges"
This reverts commit 3d98daaf27.
2020-01-20 08:38:20 +05:30
Arun Prakash Jana 3d98daaf27
Update badges 2020-01-20 08:37:04 +05:30
Arun Prakash Jana 0f1e648032
Refactor 2020-01-19 21:24:33 +05:30
Arun Prakash Jana 7677cd4417
Copy current name in API 2020-01-19 10:49:40 +05:30
Arun Prakash Jana 1c6fd9c7d7
Refactor 2020-01-18 23:31:39 +05:30
Arun Prakash Jana 5e7c42c822
checkpatch.pl fixes 2020-01-18 22:49:35 +05:30
Arun Prakash Jana 4d01aa78ae
Shorten env vars 2020-01-18 21:05:44 +05:30
Arun Prakash Jana 6c2dc7fc95
Use macro 2020-01-18 20:57:51 +05:30
Arun Prakash Jana cfdd745611
Get rid of modulo operation 2020-01-18 20:43:28 +05:30
Arun Prakash Jana 9b054d51f4
Key F5 toggle hidden 2020-01-18 19:55:09 +05:30
Arun Prakash Jana afb7efc860 Merge functions 2020-01-18 14:58:48 +05:30
Siddharth Dushantha 1dd691d20b fixed a formating error (#444)
Some normal text was indent a little, which caused to to become a code
2020-01-18 14:24:48 +05:30
Arun Prakash Jana dd02fb6049
Use simpler logic to show progress on Linux 2020-01-18 14:16:18 +05:30
Arun Prakash Jana 5f18a0892c
Clear lastname is the top file is deleted 2020-01-17 20:26:14 +05:30
Arun Prakash Jana 679374680f Revert "Revert "Fixed calculation of capacity on OpenBSD (#441)""
This reverts commit 681b22d5c7.

The statvfs man page:
http://man7.org/linux/man-pages/man3/statvfs.3.html

says clearly:

fsblkcnt_t     f_blocks;   /* Size of fs in f_frsize units */

I missed this earlier.
2020-01-17 20:08:45 +05:30
Arun Prakash Jana 64667b377d
Options -e and -t
Replaces the following environment variables:
- NNN_USE_EDITOR
- NNN_IDLE_TIMEOUT
2020-01-17 19:37:57 +05:30
Arun Prakash Jana 94a233b808
Fix: crash on entering empty dir, then press down 2020-01-17 03:36:57 +05:30
Arun Prakash Jana 4f233c161a
Remove redundant check 2020-01-17 02:40:02 +05:30
Arun Prakash Jana feec63ebb3
Use do-while instead of while 2020-01-16 23:09:19 +05:30
Arun Prakash Jana 681b22d5c7 Revert "Fixed calculation of capacity on OpenBSD (#441)"
This reverts commit 527e995f1f.
2020-01-16 22:58:12 +05:30
Arun Prakash Jana 7086df5c78
Update docs 2020-01-16 22:49:16 +05:30
Arun Prakash Jana f9d38d1420 A fancier prompt 2020-01-16 19:35:46 +05:30
Maxim Baz 0fd1f142c7 Quit with an error code (#442)
* Quit with an error code

* Use `Q` as "quit with err"

* Remove extra var and simplify conditions

* Revert combining conditions

* Fix formatting

* Format help with as much tabs as possible
2020-01-16 19:25:48 +05:30
Martin Ziemer 527e995f1f Fixed calculation of capacity on OpenBSD (#441) 2020-01-16 16:40:30 +05:30
Maxim Baz d1b2bb1e76 Release improvements, take 2 (#440)
* Revert "Undo changes from #417"

* Do not remove .git folder
2020-01-15 17:54:29 +05:30
Arun Prakash Jana 38de6efd48
Change command order 2020-01-15 17:18:10 +05:30
Arun Prakash Jana 22454d6893
Update docs 2020-01-15 15:01:14 +05:30
Arun Prakash Jana 3a4dd4c469
Fix alignment 2020-01-15 14:10:46 +05:30
Arun Prakash Jana 8ea1bc7430
Undo changes from #417 2020-01-15 11:22:54 +05:30
Arun Prakash Jana 2c6fb0eefc
Use shorter lines in man page 2020-01-15 11:09:51 +05:30
Arun Prakash Jana 0222b75c2e
Use / to toggle string and regex 2020-01-15 10:05:19 +05:30
Arun Prakash Jana 73a2919b7e
Prepare for release v2.9 2020-01-15 09:42:23 +05:30
KlzXS 4930f34c3f Catch NULL from malloc() (#438)
* Catch NULL from malloc()

* Tidy up errors

* Make indentaion look pretty in git
2020-01-15 04:05:26 +05:30
Arun Prakash Jana b1c9f4ed45
Use macro to print error 2020-01-15 01:21:13 +05:30
Arun Prakash Jana a9ebe7ed88
While drawing lines, set correct color 2020-01-15 00:57:02 +05:30
Arun Prakash Jana 1a728603bf
(B)Tab for BackTab 2020-01-14 23:37:33 +05:30
Arun Prakash Jana 364399246e
Show order info in filter info bar 2020-01-14 22:51:10 +05:30
Arun Prakash Jana 1b252b6ecb
Keybind changes 2020-01-14 21:20:57 +05:30
Arun Prakash Jana 8ebedab3f6
Fix doc 2020-01-14 04:10:11 +05:30
Arun Prakash Jana 3ccc6807ed New lowercase keys 2020-01-14 03:34:52 +05:30
Anna Arad 44871dd9d7 Update Haiku Makefile with changes of original (#435) 2020-01-14 03:08:20 +05:30
Arun Prakash Jana 62ae7e0a74
Key 0 to lock 2020-01-14 03:00:01 +05:30
Arun Prakash Jana 5bc20f1460
Remove p and e 2020-01-14 02:26:32 +05:30
Arun Prakash Jana d65271860a
Fix typo 2020-01-14 01:36:57 +05:30
Arun Prakash Jana 589065f9ab
Remove redundant question 2020-01-14 01:10:53 +05:30
Arun Prakash Jana 69efec865a
List from selection file if nothing selected 2020-01-14 00:31:20 +05:30
Arun Prakash Jana 7bcf19189a
Remove list selection 2020-01-13 23:44:19 +05:30
Arun Prakash Jana 7029656c78
Revert to key m to Mark range 2020-01-13 22:24:55 +05:30
Arun Prakash Jana 8f4706498c
Key ' for range selection 2020-01-13 21:25:34 +05:30
Arun Prakash Jana 526330bb8b
Unify plugin keys 2020-01-13 21:09:40 +05:30
Arun Prakash Jana c53b9df5ea
Reorder key listing, undocument F2 and F5 2020-01-13 20:26:16 +05:30
Arun Prakash Jana 3d7cc30441
Combine list, edit selection. Key ^Y 2020-01-13 20:13:46 +05:30
Arun Prakash Jana 749f089355
Key z to archive, fix du order issue 2020-01-13 18:57:46 +05:30
Maxim Baz 101d4e8a07 order toggle: show invalid key prompt (#433)
* order toggle: show invalid key prompt

* don't call statusbar()
2020-01-13 18:39:54 +05:30
Arun Prakash Jana 97a50c6622
Update docs 2020-01-13 08:26:14 +05:30
Arun Prakash Jana d2f69875be
Minor refactor 2020-01-13 07:48:25 +05:30
Maxim Baz 6ac353446f Order toggle: fix toggling reverse (#432) 2020-01-13 07:39:43 +05:30
Arun Prakash Jana 5fb4d637ee
Order toggle re-factor 2020-01-13 03:49:28 +05:30
Arun Prakash Jana 3416287553
Key f for first file 2020-01-13 02:45:47 +05:30
Arun Prakash Jana 16c88770b6
Sort order not changing in nav-as-you-type mode 2020-01-13 01:22:51 +05:30
Arun Prakash Jana ab521c02a4
Fix build break 2020-01-12 23:58:48 +05:30
Arun Prakash Jana 917123c400
Minor changes to fast redraw 2020-01-12 23:33:42 +05:30
Anna Arad 7948db6a64 Fast redraw on up/down key navigation (#431) 2020-01-12 22:45:55 +05:30
Arun Prakash Jana 1eb2ab2478
Clear info line completely 2020-01-12 19:40:33 +05:30
Arun Prakash Jana 61e03e0961
Update docs 2020-01-12 19:38:15 +05:30
Arun Prakash Jana 7718f77069
Add check for max val len in key:val pair 2020-01-12 08:40:33 +05:30
Arun Prakash Jana b70a54d47e
Update docs 2020-01-12 04:50:16 +05:30
Arun Prakash Jana aea48508da
^L at empty prompt shows last filter 2020-01-12 03:36:08 +05:30
Arun Prakash Jana bb3d79ce21
Go to top when last saved filter is applied 2020-01-12 02:46:19 +05:30
Arun Prakash Jana 3c69e6ccac
Guard against empty 2020-01-12 00:26:03 +05:30
Arun Prakash Jana f1791af2ab
Show statusbar instead of blank 2020-01-12 00:09:09 +05:30
Arun Prakash Jana b91f7a9600
Fix not waiting for command next time if non-Enter keys are pressed 2020-01-11 23:53:32 +05:30
Arun Prakash Jana 94781f7977
Refactor status bar printing 2020-01-11 23:18:24 +05:30
Arun Prakash Jana 7f579bc808
Add more clarity on filter prompt keys 2020-01-11 22:58:22 +05:30
Arun Prakash Jana fd99ef5af2
Show filter when returning after firing plugin 2020-01-11 22:53:40 +05:30
Arun Prakash Jana 357ce4a69a
Key ^F to fire plugin 2020-01-11 22:40:26 +05:30
Arun Prakash Jana 99d15815f0
Use : for filter case 2020-01-11 21:49:35 +05:30
Arun Prakash Jana 274c612076
Refactor PDF handling, add rtorrent, man pages 2020-01-11 20:20:20 +05:30
Arun Prakash Jana 490359f853
nuke: open manpages, reload dir after dot 2020-01-11 18:23:46 +05:30
Arun Prakash Jana 70dcbf43d7
Toggle filter case-sensitivity 2020-01-11 16:12:34 +05:30
Arun Prakash Jana 8588b3f0bd
Support regex/substring filter switch 2020-01-11 11:38:31 +05:30
Arun Prakash Jana 0e203288b4
Rememeber last filter 2020-01-11 05:15:20 +05:30
Arun Prakash Jana c22bf87f3e
Enable filter mode when there's a filter 2020-01-11 00:55:23 +05:30
Arun Prakash Jana 38414f4349
For links, set prefix instead of suffix 2020-01-11 00:31:08 +05:30
Arun Prakash Jana ca0a7b0558
Simplify showing status bar symbols 2020-01-10 20:15:50 +05:30
Arun Prakash Jana f04769f5a5
Update docs 2020-01-10 19:43:37 +05:30
Arun Prakash Jana d463c4f0df
Update docs 2020-01-10 02:01:20 +05:30
Arun Prakash Jana 4c0210ce2b
Do not reload dir on sort order change when filter is on 2020-01-09 23:51:41 +05:30
Arun Prakash Jana 19940efd64
nnn is ported to Haiku now 2020-01-09 22:09:32 +05:30
Arun Prakash Jana f654e3ca2b
Implement reverse sorting 2020-01-09 19:44:36 +05:30
Arun Prakash Jana a89b5fd82c
Fix build break 2020-01-09 04:38:08 +05:30
Arun Prakash Jana 5cb39b0db3
Show mime in file details 2020-01-09 04:00:28 +05:30
Arun Prakash Jana 7bf7894022
Use option -A to disable dir auto-select 2020-01-09 03:34:10 +05:30
Arun Prakash Jana 0492fa385d
Update docs 2020-01-09 01:26:23 +05:30
Arun Prakash Jana f92658f31e
Add examples of useful commands to run as plugin 2020-01-08 23:20:46 +05:30
Arun Prakash Jana 9a757c4905
Extension order: show files without extension on top 2020-01-08 21:45:54 +05:30
Arun Prakash Jana 604a8fafcc
Fix build break 2020-01-08 19:40:56 +05:30
Arun Prakash Jana d209e8f278
Optimize file extension check 2020-01-08 19:08:01 +05:30
Arun Prakash Jana 0b1c87758c
Minor refactor 2020-01-08 18:52:18 +05:30
Arun Prakash Jana c5ff2f5647
Fix openSUSE Leap 15.1 package generation 2020-01-07 23:45:22 +05:30
Arun Prakash Jana 23ef45ee49
Update docs 2020-01-07 22:12:39 +05:30
Arun Prakash Jana e4b762dcc1
Retain filter on single file removal 2020-01-07 18:28:30 +05:30
Arun Prakash Jana 9d9aa16185
Clear filter after removing current file 2020-01-07 01:21:36 +05:30
Arun Prakash Jana aa89522482
Re-order keybind help 2020-01-06 20:00:18 +05:30
Arun Prakash Jana 39f8b25b88
Clear filter on dir changes 2020-01-06 02:54:31 +05:30
Arun Prakash Jana e72dbec95a Update boom 2020-01-05 22:43:50 +05:30
Anna Arad 443bb7925b Update Haiku Makefile and recipe with suggestions from HaikuPorts (#426) 2020-01-03 22:25:44 +05:30
Arun Prakash Jana d43abec4bc
Merge plugins pastebin and upload 2020-01-03 07:34:59 +05:30
Arun Prakash Jana 045ad3da75
Merge plugins imgsxiv and imgviu 2020-01-03 00:27:28 +05:30
Arun Prakash Jana 69377bbd89
Remove plugin notes, update docs to run cmd as plugin 2020-01-03 00:04:31 +05:30
Arun Prakash Jana c92c5c7b15
Support toggle exe 2020-01-02 23:36:08 +05:30
Arun Prakash Jana e1c91e1aef
Plugin rename 2020-01-02 05:11:00 +05:30
Arun Prakash Jana ff72917e72
Plugin rename 2020-01-02 04:15:17 +05:30
Arun Prakash Jana c44d5b57bd
Update docs, early check for empty files 2020-01-02 04:03:54 +05:30
Arun Prakash Jana c6a5db460f
Add useful locker peaclock for Haiku 2020-01-02 03:07:56 +05:30
Arun Prakash Jana 4a3bf6d40f Use a shorter width param 2020-01-02 03:03:21 +05:30
CodeforEvolution a36146f9c0 Add Desktop Opener for Haiku (#425)
You guys almost forgot this. Hope this helps! ;)
2020-01-02 02:40:50 +05:30
Arun Prakash Jana 0b78ff4af3
Update docs 2020-01-01 00:24:13 +05:30
Arun Prakash Jana 027ed8d8ea
Update copyright year 2019-12-31 22:42:10 +05:30
Arun Prakash Jana f41e68742d
Fix 2 archive handling issues
- when an archive is mounted, jump into the mount point
- while archiving the hovered file, exit if the archive name is same
2019-12-31 21:09:40 +05:30
Arun Prakash Jana db647e7c4c On the fly dist generation 2019-12-30 01:37:01 +05:30
Maxim Baz 4e59ffd9d0 Make showsel print warning when nothing is selected (#423) 2019-12-30 00:34:39 +05:30
Arun Prakash Jana 8955d039c6
Drop ^T, no reload after empty cmd at prompt 2019-12-30 00:33:34 +05:30
Arun Prakash Jana c1f168c7cb
Show context numbers in help 2019-12-30 00:06:49 +05:30
Arun Prakash Jana 15a7bbe00e
Fix build break 2019-12-29 23:46:48 +05:30
Arun Prakash Jana 26d49a16b3
Get version string from source 2019-12-29 23:43:09 +05:30
Arun Prakash Jana f90c37cd5e
Automagically handle archives 2019-12-29 23:21:18 +05:30
Arun Prakash Jana 146da5911d
Code refactor 2019-12-29 17:58:48 +05:30
Arun Prakash Jana 7b7e005e52
Retire execute file
There is no way to detect and handle GUI executables. Must run manually.
2019-12-29 09:07:58 +05:30
Arun Prakash Jana 7157644250
Fix #420: simplify bookmarking, retire lead key 2019-12-29 08:20:56 +05:30
Arun Prakash Jana e3e6e1671a
Keybind v for version sort 2019-12-28 11:15:38 +05:30
Arun Prakash Jana d13fea6fa2
Refactor help 2019-12-28 10:15:11 +05:30
Arun Prakash Jana 3a554f02dc
Refactor help 2019-12-28 09:56:54 +05:30
Anna Arad fd9fcf741e Get nnn compile and run on Haiku (#403)
* Add support for Haiku OS

* Adjust DISTFILES and dist rule in haiku
2019-12-27 23:32:20 +05:30
Arun Prakash Jana d3ddff6690
Refactor help 2019-12-27 22:07:11 +05:30
Arun Prakash Jana ae65edb862
Code refactor 2019-12-27 21:22:27 +05:30
Arun Prakash Jana f5cd0e563d
Code refactor 2019-12-27 19:00:23 +05:30
Arun Prakash Jana bffadf09c5
Refactor plugin handling 2019-12-27 13:19:23 +05:30
Arun Prakash Jana 5676dfe682
Fix: save last hovered filename in cur context post arrow movement 2019-12-27 11:04:05 +05:30
Arun Prakash Jana 735b3d6cde
Code refactor 2019-12-27 10:13:48 +05:30
Arun Prakash Jana a32b3eac14
Code refactor 2019-12-27 09:26:20 +05:30
Arun Prakash Jana b455abf944
Refactor cur or sel confirmation 2019-12-26 20:33:01 +05:30
Arun Prakash Jana c43dce6926
Refactor context selection 2019-12-26 19:37:48 +05:30
Arun Prakash Jana 0d07e45efb
Use test and set in frequent keys 2019-12-26 18:24:32 +05:30
Arun Prakash Jana 765c494eb7
Experimental: clear filter on dir reload and retain name 2019-12-26 14:07:23 +05:30
Arun Prakash Jana 450df4c476
Retain filter on keys up and down 2019-12-26 10:24:57 +05:30
Arun Prakash Jana 7e958d3cd3 Revert "Retain filters when context keys are used from filter prompt"
This reverts commit d9da85a365.
2019-12-25 22:56:59 +05:30
Arun Prakash Jana 1003c0f8fc
Option n - nav as you type, V - version sort 2019-12-25 22:33:38 +05:30
Arun Prakash Jana 06920d7d9d Revert "Fix #420: reduce Lead key to bookmark key"
This reverts commit 1ed5febe0c.
2019-12-25 22:18:36 +05:30
Arun Prakash Jana d65ccfab1e Revert "Update help"
This reverts commit 89a158b9f4.
2019-12-25 22:18:24 +05:30
Arun Prakash Jana ffb0b0e3c2 Revert "Use b and ^B as bookmark key"
This reverts commit 278fcfdfc9.
2019-12-25 22:18:09 +05:30
Arun Prakash Jana 541bc3f653 Revert "Use a fixed key , for pinning dir"
This reverts commit 4d17b82950.
2019-12-25 22:17:50 +05:30
Arun Prakash Jana 4d17b82950
Use a fixed key , for pinning dir 2019-12-25 15:56:50 +05:30
Arun Prakash Jana 278fcfdfc9
Use b and ^B as bookmark key 2019-12-25 14:37:51 +05:30
Arun Prakash Jana 89a158b9f4
Update help 2019-12-25 12:34:45 +05:30
Arun Prakash Jana 1ed5febe0c
Fix #420: reduce Lead key to bookmark key 2019-12-25 12:15:03 +05:30
Arun Prakash Jana d9da85a365
Retain filters when context keys are used from filter prompt 2019-12-25 08:52:37 +05:30
Arun Prakash Jana f480de0065
Use file.io to ipload files 2019-12-24 11:11:39 +05:30
Arun Prakash Jana b1207d54ea
Set flags for OS-es without dp-type. 2019-12-23 20:14:03 +05:30
Arun Prakash Jana 0bc5cdbf26
Update docs 2019-12-22 08:41:38 +05:30
Arun Prakash Jana 55e4e938d0
Handle more audio types by file extension 2019-12-22 02:06:20 +05:30
Arun Prakash Jana 2276e3ddfd
Use CLI flags spawning CLI opener as default FM 2019-12-21 22:38:35 +05:30
Arun Prakash Jana 9dee99b456
Show message on invalid key 2019-12-21 10:03:05 +05:30
Arun Prakash Jana 2863278790
Update docs: use direct repology url 2019-12-21 07:24:01 +05:30
Arun Prakash Jana 404001a428
Update plugin docs 2019-12-21 06:04:04 +05:30
Maxim Baz f0eba7d51b Improvements for distribution (#417)
* Don't pack sources (github does it better), sign sources

* Make CircleCI generate the same git archive as Github, return make dist

* Revert make clean too

* Upload signature to Github release

* Read Github token from an env variable
2019-12-21 05:02:39 +05:30
Arun Prakash Jana 9f7ae0e86a
nuke: guard against opening risky file types 2019-12-20 21:49:03 +05:30
Arun Prakash Jana 88b8d2641d
Replace bools for binary states with an uchar 2019-12-20 16:01:35 +05:30
Arun Prakash Jana 37988cf854
Program option to load session is now `-s`
- remove auto-stored session "@" on restore
- minor help update
2019-12-20 15:49:13 +05:30
Arun Prakash Jana 9725c17d20 Revert "Internal states, sessions changes"
This reverts commit cf388649b9.
2019-12-20 15:30:53 +05:30
Arun Prakash Jana f25f062537
Mechanism to skip dir refresh after running plugin 2019-12-20 12:05:25 +05:30
Arun Prakash Jana 7d171368ad Revert "Prefer NNN_USE_EDITOR over opener (option )"
This reverts commit 7f3d2c10aa.
2019-12-20 02:51:25 +05:30
Arun Prakash Jana 583b6a84f5
Update docs 2019-12-20 00:35:58 +05:30
Arun Prakash Jana 7f3d2c10aa
Prefer NNN_USE_EDITOR over opener (option ) 2019-12-20 00:01:50 +05:30
Maxim Baz c5cd668a52 Show 'invalid key' prompt in more places (#415) 2019-12-19 18:41:30 +05:30
Arun Prakash Jana c24efdbedb
Simplify QuitCD scripts 2019-12-19 18:33:27 +05:30
Arun Prakash Jana cf388649b9
Internal states, sessions changes
- replace bools for internal non-persistent binary states with an uchar
- do not store path to session, derive from config path in tmp buffer
- program option to load session is not `-s`
- remove auto-stored session "@" on restore
- minor help update
2019-12-19 08:45:26 +05:30
Arun Prakash Jana 92ac068815
Use single API for nftw 2019-12-19 01:53:11 +05:30
Arun Prakash Jana fce848de3c
Fix typos in help 2019-12-18 23:48:19 +05:30
Arun Prakash Jana ac281cb63b
Fix cmd as plugin showing prompt on playing twice 2019-12-18 22:27:23 +05:30
Arun Prakash Jana 6b5bb16b46
Minor improvements
- reduce 4 spaces between help columns as it's too wide for handhelds
- support `]` as prompt in nav-as-you-type-mode when filter is empty
- update plugin docs
2019-12-18 21:53:18 +05:30
Arun Prakash Jana fb2c548e86
User control to disable prompt after run cmd as plugin 2019-12-17 20:57:29 +05:30
Maxim Baz 7b06480147 Fix fprint format args (#410)
Since 75061367be we only need to fill one %c
2019-12-17 16:12:16 +05:30
Arun Prakash Jana 0feb690d7d
Reduce one space 2019-12-17 08:35:42 +05:30
Arun Prakash Jana 8d3c24d19f
Notify invalid keypress at bookmark and plugin key input 2019-12-17 07:13:50 +05:30
Maxim Baz 99128ab5c9 Show prompt for bookmark selection (#409)
* Cleanup unused MSG_

* Print only plugin keys

* Speed up preparing keys prompt

* Show prompt for bookmarks

* Don't error when user interactively pressed non-existent bookmark key
2019-12-17 07:06:40 +05:30
Arun Prakash Jana 75061367be
Use a combo to parse help string 2019-12-17 06:36:10 +05:30
Maxim Baz f10481e93e Make help page more readable (#408)
* Make help page more readable

* Always use 2 columns only
2019-12-17 05:05:58 +05:30
Maxim Baz d6a4e449d3 Indicate when range selection and plugin picker are waiting for input (#406)
* Use [1:*] as indicator that range selection is in progress

* Fix review comments

* Add prompt for plugin selection
2019-12-17 04:37:48 +05:30
Arun Prakash Jana 5c76187b61
Update docs 2019-12-16 05:55:15 +05:30
Arun Prakash Jana 208a6605f5
Fix #402 2019-12-14 23:28:13 +05:30
Arun Prakash Jana d58ab38c52
Update docs 2019-12-14 21:29:52 +05:30
Arun Prakash Jana 95f530854d
remove program option -f 2019-12-14 20:25:23 +05:30
Arun Prakash Jana 5b0b63e7d6
remove / as additional lead key when filter is on 2019-12-14 19:54:13 +05:30
Arun Prakash Jana 09083f3ed6
Update docs 2019-12-14 19:18:19 +05:30
Arun Prakash Jana 04d10fc94b
Use string filters by default 2019-12-14 14:15:07 +05:30
Arun Prakash Jana 1f0f3fdf01
Update man 2019-12-14 00:17:16 +05:30
Arun Prakash Jana 78830781ee
Update docs 2019-12-13 19:38:28 +05:30
Arun Prakash Jana 2886abc90c
Fix opening image with sxiv 2019-12-13 08:33:02 +05:30
Arun Prakash Jana 2f6a4dd8ee
Minor edits 2019-12-13 02:14:37 +05:30
Arun Prakash Jana f73f79d5de
Simplify selection
Update the selection buffer and file in-place:
- Append file path when one is added.
- Remember the last position in selection buffer at which the next filename
  is to be appended when a directory/context change happens (lastappendpos).
  So in case of a de-selection we can go back to that position and scan all
  the entries to add only the ones which are selected.
2019-12-13 01:57:58 +05:30
Arun Prakash Jana 5a46b8fb25
Sync file paths correctly for clipboard copy 2019-12-13 00:36:30 +05:30
Arun Prakash Jana e723666256
End selmode and update selection on dir changes 2019-12-12 21:37:39 +05:30
Arun Prakash Jana fcba62d296
Update selection when context changed on mouse click 2019-12-12 21:29:48 +05:30
Arun Prakash Jana 73593450ac
Fix build break 2019-12-12 20:11:31 +05:30
Arun Prakash Jana fd8a8387b8
Add option to show noti and copy selection to system clipboard 2019-12-12 19:51:08 +05:30
Arun Prakash Jana f95ee54870
Add plugin to show notification 2019-12-12 07:24:22 +05:30
Arun Prakash Jana b64df85d23
Operation completion notification 2019-12-11 22:53:03 +05:30
Arun Prakash Jana 7eec6cedab
Reformat help 2019-12-11 20:30:23 +05:30
Arun Prakash Jana dfd1422997
Remove redundant key for first file 2019-12-11 20:30:20 +05:30
Arun Prakash Jana a86150f71a
Reformat help, remove redundant plugin key 2019-12-11 19:26:13 +05:30
KlzXS 8b7a74a451 Fix not properly checking if file is selected (#401) 2019-12-11 01:34:16 +05:30
Arun Prakash Jana 2e407d1325
Add m4a files 2019-12-10 22:57:06 +05:30
Arun Prakash Jana ef09f42720
PR #399: add autojump plugin 2019-12-10 22:30:35 +05:30
Arun Prakash Jana 92bba0cbf8
Fix #400: several selection issues in v2.8.1 2019-12-10 20:59:10 +05:30
Arun Prakash Jana 8d143bb87f
Disable partial regex errors 2019-12-10 18:37:10 +05:30
Arun Prakash Jana e8183058fd
Minor code refactor 2019-12-10 08:52:00 +05:30
Arun Prakash Jana 847bda4380
Combine archive operations 2019-12-10 03:56:38 +05:30
Arun Prakash Jana 8dd1946d1d
Revert to ] key 2019-12-10 01:27:51 +05:30
Arun Prakash Jana 6582855412
Key \ only works in empty prompt 2019-12-10 01:18:51 +05:30
Arun Prakash Jana a3d6b81d9f
Key 's' to manage session 2019-12-10 01:09:15 +05:30
Arun Prakash Jana 741f82b091
Use \ as alternative prompt/run command keybind 2019-12-10 00:56:29 +05:30
Arun Prakash Jana 1991bb516f
Update light/detail print mode when loading session 2019-12-09 23:52:05 +05:30
Arun Prakash Jana bc025ceb5a
Fix regex for file extension 2019-12-09 23:41:25 +05:30
Arun Prakash Jana 877f7b4d62
Exit if dir is unchanged 2019-12-09 23:27:10 +05:30
Arun Prakash Jana b14e1a4856
Print line number in debug logs 2019-12-09 23:17:40 +05:30
Arun Prakash Jana 6fcc6834ff
Show symlink even if target cannot be stat-ed 2019-12-09 22:20:46 +05:30
Arun Prakash Jana 21f9a713dc
Fix auto-select for symlink to dir 2019-12-09 19:12:59 +05:30
Arun Prakash Jana 885cfd4734
Support both fzf and fzy 2019-12-09 18:36:48 +05:30
Arun Prakash Jana 9614fec13b
Update docs 2019-12-09 07:43:20 +05:30
Arun Prakash Jana 9d336b77fa
Disable shellcheck warning SC2086 2019-12-09 02:37:55 +05:30
Arun Prakash Jana 819bddaac9
Fix build break 2019-12-09 01:57:31 +05:30
Arun Prakash Jana d5512462af
Move nlaunch to plugins as launch 2019-12-09 00:34:53 +05:30
Arun Prakash Jana 77ebfff98b
Rename opener nplay to nuke 2019-12-08 20:27:06 +05:30
Arun Prakash Jana 5708585c3b
Add nplay as a plugin 2019-12-08 08:27:53 +05:30
Arun Prakash Jana 5826da920f
Add nplay: a custom opener 2019-12-07 23:04:40 +05:30
Arun Prakash Jana 3b2b6f2b46
Fix only the last file path is copied to selection buffer 2019-12-06 22:24:35 +05:30
Arun Prakash Jana 9b384799b7
Cancel option for open with 2019-12-06 20:21:31 +05:30
Arun Prakash Jana b65bc92e73
Fix build break 2019-12-06 18:57:53 +05:30
Arun Prakash Jana 70f3bd2e53
Fix #398 2019-12-06 08:50:23 +05:30
Arun Prakash Jana 7f2bf343f8
Use ISO 8601 in status bar 2019-12-05 21:03:05 +05:30
Arun Prakash Jana 90108ba763
Prepare for release v2.8.1 2019-12-05 04:47:32 +05:30
Arun Prakash Jana c139178916
Add more details on selection 2019-12-04 18:54:25 +05:30
KlzXS 809b1885fb Fix always archiving current file (#396) 2019-12-04 18:25:41 +05:30
Arun Prakash Jana cc36aa8d49
Prepare for release v2.8 2019-12-04 02:58:27 +05:30
Arun Prakash Jana add789c002
Use common construct for utility names 2019-12-03 21:11:06 +05:30
Arun Prakash Jana 0acd18f989
Minor plugin fixes 2019-12-03 18:52:40 +05:30
José Luis Neder 189042d2d9 Plugin renamer (#393)
This plugin is an alternative to the native batch rename interface in
nnn. qmv from renameutils and vidir from moreutils allow to rename
files without fear of replacing existing files.
2019-12-03 18:30:44 +05:30
Arun Prakash Jana f80563e16a
Update docs 2019-12-03 06:56:43 +05:30
Arun Prakash Jana 5cd9794102
Remove redundant assignment 2019-12-02 22:24:06 +05:30
Arun Prakash Jana 6001eeb9a4
Disable rollover at edges on scroll 2019-12-02 18:24:59 +05:30
Arun Prakash Jana 3f0c604111
Option -R to disable rollover at edges 2019-12-01 23:00:06 +05:30
Arun Prakash Jana feb1d2fc27
Handle some keys as special only if filter is empty 2019-12-01 19:58:08 +05:30
Arun Prakash Jana 130cea3598
Adapt picker mode to new selection changes 2019-11-30 20:36:04 +05:30
Arun Prakash Jana 19a914cd0c
Update docs 2019-11-30 20:35:58 +05:30
Arun Prakash Jana e28197f066
Remove a startup loop and use self-fixing 2019-11-30 19:51:57 +05:30
Arun Prakash Jana 12669be900
Update auto-completion scripts 2019-11-30 18:14:39 +05:30
Arun Prakash Jana 178705a951
End selection before archive, new, rename 2019-11-30 16:15:12 +05:30
Arun Prakash Jana b3b1384740
Update docs 2019-11-30 04:58:55 +05:30
Arun Prakash Jana 0a5dc2e336
Selection should work across contexts 2019-11-30 04:28:09 +05:30
Arun Prakash Jana ef88a31a7c
Do not access invalid lastdir 2019-11-30 03:51:29 +05:30
Arun Prakash Jana f231c35ef9
Update docs 2019-11-30 02:21:59 +05:30
Arun Prakash Jana 3b42b6fc42
Fix LICENSE file 2019-11-29 22:34:53 +05:30
Arun Prakash Jana f9058e1aaa
Support link creation for hovered file 2019-11-29 20:58:12 +05:30
Arun Prakash Jana 965499c671
Show all selected files on M 2019-11-29 08:38:11 +05:30
Arun Prakash Jana 35b3cf3b1f
Update program help 2019-11-29 02:11:27 +05:30
Arun Prakash Jana 20ac9da988 Support deselection 2019-11-28 23:13:10 +05:30
Vidar Holen 1bf49c80e7 Some of the shell script fixes as per discussion (#389)
* Improved completion support for files with spaces

Filenames with spaces, both generally and for session names, will now
complete as expected.

* Misc shell script improvements

See discussion on:
1cca9e4b72
2019-11-26 18:06:31 +05:30
Arun Prakash Jana e81efdb5e6
Update docs 2019-11-26 02:34:21 +05:30
Arun Prakash Jana d986a32d0d
Update docs 2019-11-25 21:15:35 +05:30
Arun Prakash Jana 249836923e
Reduce delay, use a more meaningful msg 2019-11-25 08:21:14 +05:30
Arun Prakash Jana e4ffe35892
Update comment to reflect millisecond 2019-11-25 07:50:22 +05:30
Arun Prakash Jana e6f9d6d2d0
Add rclone support for remote access 2019-11-24 21:24:32 +05:30
Arun Prakash Jana c4483a8956
Update docs on -E 2019-11-24 19:23:09 +05:30
Arun Prakash Jana 5d0af863b5
Set hovered and file as 2019-11-24 02:13:27 +05:30
Arun Prakash Jana ca7405311f
Force undetachable edits in EDITOR 2019-11-24 01:54:06 +05:30
Arun Prakash Jana 9b37c9edb1
Load dir after hovered image 2019-11-23 10:37:46 +05:30
Arun Prakash Jana c70aaf2076
Update docs 2019-11-23 10:32:08 +05:30
Arun Prakash Jana c2998a819b Revert "Indicative inode hash bitmap implementation. Read details."
This reverts commit 547d87bfc2.
2019-11-23 10:07:05 +05:30
Arun Prakash Jana 547d87bfc2
Indicative inode hash bitmap implementation. Read details.
Known issues:
- To optimize dentfill() on most architectures we don't fstatat() with
  AT_SYMLINK_NOFOLLOW to get the inode number of the symlink itself.
- The current hash size serves the purpose of one filesystem. To serve
  more and have unique bits, we have to add more bits to prefix dev ID
  to the inode.  Memory consumption will be significant.

This will be reverted in next commit.
2019-11-23 10:05:06 +05:30
Arun Prakash Jana b63c00c9af
Quote so files with newline in name work 2019-11-22 23:43:43 +05:30
Arun Prakash Jana 2c35beb0a2
Rename utility macros 2019-11-22 20:46:05 +05:30
Arun Prakash Jana ababa87434
Organize strings together 2019-11-22 20:30:13 +05:30
Arun Prakash Jana 594d645e25
Rename plugins, group related ones 2019-11-22 17:51:13 +05:30
Arun Prakash Jana 085bda0330
Integrate similar plugins, diff should begin at start of file 2019-11-22 13:50:00 +05:30
Arun Prakash Jana a34200a747
Integrate shellcheck in CI 2019-11-22 11:59:14 +05:30
Arun Prakash Jana 1cca9e4b72
shellcheck fixes 2019-11-22 11:13:34 +05:30
Arun Prakash Jana ee2dcb1de7
Re-order plugin table 2019-11-21 22:14:25 +05:30
Arun Prakash Jana 2d23d8fe51
Drop findutils deps 2019-11-21 20:30:38 +05:30
Arun Prakash Jana d4b7897b41
All binary confirmation is now y or Y 2019-11-21 19:11:56 +05:30
KlzXS 4db8a61dea Don't use xargs options -I -o and -a (#388)
Also removed another stray cat
2019-11-21 18:19:55 +05:30
Arun Prakash Jana cb3ee616c2
update man page 2019-11-21 02:38:34 +05:30
Arun Prakash Jana be65fe4ccf
Add examples of conflicting keybinds 2019-11-21 02:23:02 +05:30
Arun Prakash Jana 7d70a655e6
Fix picker mode 2019-11-21 00:56:55 +05:30
Arun Prakash Jana 2d91768d88
Fix some cat abuses in code, plugins 2019-11-21 00:31:39 +05:30
Arun Prakash Jana 0c0f12b528
Use single API to create dir tree 2019-11-20 23:23:44 +05:30
Arun Prakash Jana f0ca47afae
dirs and files can be created with parent dirs 2019-11-20 21:11:13 +05:30
Arun Prakash Jana 5b7448bac9
Various plugin fixes
1. getplugs should work even if nnn is not run
2. Remove redundant ./ prefix
3. Update plugin docs
2019-11-20 19:19:09 +05:30
Arun Prakash Jana cc3702b2e1
Fix lint error 2019-11-20 01:34:07 +05:30
Arun Prakash Jana 3a9def25d8
Create new files and dirs with parent (like mkdir -p) 2019-11-20 01:28:11 +05:30
Arun Prakash Jana 9729b1f5a6
Refresh dirs on disruptive chnages, update sxiv plugin to browse and rename 2019-11-19 21:01:59 +05:30
Arun Prakash Jana 97e16364bb
Readahead is not available on all platforms 2019-11-18 22:04:09 +05:30
Arun Prakash Jana 6d3f3ba6a2
Show [selmode:num_selected] in status bar 2019-11-18 21:46:38 +05:30
Arun Prakash Jana 084a4c77c5
Add key ] to show prompt 2019-11-18 20:21:00 +05:30
Arun Prakash Jana 8705cb99a3
Seek advantage of kernel readahead()
References:
1. http://man7.org/linux/man-pages/man2/posix_fadvise.2.html
2. https://www.oreilly.com/library/view/linux-system-programming/9781449341527/ch04.html
2019-11-18 19:54:14 +05:30
Arun Prakash Jana 0ef9ec196e
Use boxes to show number of selected files. 2019-11-18 19:34:03 +05:30
Arun Prakash Jana 3004694cd4 Update man page on executing commands directly.
Remove extra static string.
2019-11-18 18:57:04 +05:30
Mischievous Meerkat 577d8d9bfc
Update ndiff 2019-11-18 12:11:35 +05:30
Mischievous Meerkat 11204d09d5
Update quitcd.csh 2019-11-18 12:10:50 +05:30
Arun Prakash Jana 52fad544fc
Always open vimdiff at start of file 2019-11-18 04:04:04 +05:30
Arun Prakash Jana 4ee9e2d129
Add key ; to execute plugin 2019-11-18 00:30:00 +05:30
Arun Prakash Jana f7fa1ffc8e Update plugin docs 2019-11-18 00:14:04 +05:30
Arun Prakash Jana 6bbf3ac9c4
Show output after running command 2019-11-17 21:56:05 +05:30
Arun Prakash Jana 472564fd7f
Do not update merged file, remove README.md 2019-11-17 21:02:43 +05:30
Arun Prakash Jana 4f787fd59e
Fix line count when editing selection 2019-11-17 20:26:01 +05:30
KlzXS 2cbd76abf6 getpulgs now asks before overwriting (#385)
* getpulgs now asks before overwriting

* Forgot a space
2019-11-17 19:52:36 +05:30
Arun Prakash Jana 0f5f04d087 Revert "Fix #384: support busybox xargs"
This reverts commit 407b690404.
2019-11-17 19:17:39 +05:30
Arun Prakash Jana 0620b1dfb5
Plugin fzhist 2019-11-17 19:14:30 +05:30
Arun Prakash Jana 407b690404
Fix #384: support busybox xargs 2019-11-17 17:45:22 +05:30
Arun Prakash Jana f4acfc7a4e
Block nesting of nnn instances 2019-11-17 14:33:30 +05:30
Arun Prakash Jana 7d0be597ad
Rename fzy-open to fzopen 2019-11-17 13:08:26 +05:30
Arun Prakash Jana 5b8b9eaa92
Add image of plugin gutenread in action 2019-11-17 10:17:38 +05:30
Arun Prakash Jana 6693bf8f13
Fixes the following workflow:
- press pick plugin key
- navigate away from the plugin directory (to ~, say)
- try to open any file, fails

When we are in run plugin mode, but detect we are in a different
context or a non-plugin directory, just cancel the runplgin mode
and continue as usual.

It also cleans up the plugin run function.
2019-11-17 10:05:23 +05:30
Arun Prakash Jana 05c84f7b80
Clear prompt after running a command. 2019-11-17 05:36:39 +05:30
Arun Prakash Jana e3aed0f658
Update help 2019-11-17 05:30:14 +05:30
Arun Prakash Jana 61048258a7
Do not reload for help, edit and page if in selection mode 2019-11-17 04:49:50 +05:30
Arun Prakash Jana efa9a6727d
Change the key to size sort to z 2019-11-17 04:11:27 +05:30
Arun Prakash Jana 37bf6b1010
Redraw in non-filter mode after hovered file deletion 2019-11-16 21:46:15 +05:30
Arun Prakash Jana 88698b372b
Edit also flushes selection 2019-11-16 20:39:05 +05:30
Arun Prakash Jana 4c863d9b7b
Do not check for events when selecting files 2019-11-16 20:10:03 +05:30
Arun Prakash Jana c7b037d6a1
Use small letters 2019-11-16 14:06:38 +05:30
Arun Prakash Jana f8b8c67bee
Update docs 2019-11-16 11:43:38 +05:30
Arun Prakash Jana cf987fa988
Plugin treeview to show tree o/p with perms and size 2019-11-16 11:22:34 +05:30
Arun Prakash Jana e82f6d02cd
Plugin extoggle to toggle executable status 2019-11-16 10:36:39 +05:30
Arun Prakash Jana 2b4bd35ba6
Simplify running commands 2019-11-16 07:20:18 +05:30
Arun Prakash Jana f31fa09f56 Fix issue with running plugin when help screen is shown 2019-11-15 22:36:57 +05:30
0xACE 688ed885d1 Fix dragdrop not working in selection mode (#382)
xargs couldn't call function `dnd()` and I couldn't find a portable way
to do it, so I replaced it with a variable which I guess should work
fine.
2019-11-15 21:57:37 +05:30
Arun Prakash Jana 950a8f6a65
Fix #381 2019-11-15 21:55:18 +05:30
Arun Prakash Jana 3c28d1f1d7
Refactor plugin handling 2019-11-14 02:55:05 +05:30
Arun Prakash Jana d723299df6
Add CentOS 8.0, Fedora 31 2019-11-12 19:30:56 +05:30
Arun Prakash Jana 32b19efc85
Update docs 2019-11-12 03:01:53 +05:30
Arun Prakash Jana fa4c37f230
Fix segfault 2019-11-11 21:43:56 +05:30
Arun Prakash Jana 6ea64288bc
Fix #379 2019-11-09 03:47:49 +05:30
Arun Prakash Jana 12f108cac9
Fix fzcd not working from other contexts 2019-11-09 02:52:44 +05:30
Arun Prakash Jana 53a2e4c560
Incorporate PR #368 2019-11-08 19:15:53 +05:30
Arun Prakash Jana 5077b020bc
Update docs 2019-11-06 16:26:49 +05:30
Arun Prakash Jana 9272c90f93
Removal of current dir can be a pain without force 2019-11-05 22:05:49 +05:30
Arun Prakash Jana 8a7d2bd1ed
Clear buffer for no locale compilation 2019-11-05 20:03:12 +05:30
Arun Prakash Jana 94e4dc51ba
Make bulk delete more verbose 2019-11-05 19:52:07 +05:30
Arun Prakash Jana 2559ddbd38 Add Wayland clipboard example 2019-11-05 02:45:32 +05:30
0xACE 955826a1e8 Fix dragdrop stderr causing issues (#374)
For w/e reason the output from `which` causes problems with nnn
rendering. This commit silences the problematic lines.
2019-11-04 08:12:00 +05:30
Arun Prakash Jana 6713bfba13
Fix #373 2019-11-02 21:50:26 +05:30
Arun Prakash Jana baaf3ede2a
Update docs 2019-11-02 20:46:50 +05:30
Arun Prakash Jana 169c2141f6
Print improvements 2019-11-02 07:51:45 +05:30
Arun Prakash Jana aedb9c2753
Update drag and drop plugin 2019-11-02 06:56:34 +05:30
0xACE 3c1645ca90 Merged drag and drop scripts to 1 file (#372) 2019-11-02 06:54:14 +05:30
Arun Prakash Jana 013dad1186 plugin pskill 2019-11-01 21:54:51 +05:30
Anna Arad c5c9323d30 Fix bad getplugs script (#370) (#371) 2019-11-01 21:28:32 +05:30
Arun Prakash Jana 55f687e463
Update version to 2.7 2019-11-01 19:38:41 +05:30
Arun Prakash Jana 5c336fb7da
Fix build break 2019-11-01 16:19:34 +05:30
Arun Prakash Jana ef8db1fd45
Show size of file in bytes in status bar in du mode 2019-11-01 15:28:13 +05:30
Arun Prakash Jana 7416bb8503
Print version in debug output 2019-11-01 02:34:06 +05:30
Arun Prakash Jana ef6a995e38
Fix #369: calculate checksum for directory tree 2019-11-01 02:28:25 +05:30
Arun Prakash Jana 6eeab1af9f
Use macro for 512B sector size 2019-10-30 22:43:22 +05:30
Arun Prakash Jana a97e3ed5c4
Fix opening files from browser 2019-10-30 20:17:31 +05:30
Arun Prakash Jana cf4ad22676
Add complete audio conversion tip 2019-10-25 07:50:54 +05:30
Arun Prakash Jana b987931f47
Do not pass path to commands 2019-10-24 20:25:07 +05:30
Arun Prakash Jana 8c096dad28
Update docs 2019-10-24 15:10:13 +05:30
Arun Prakash Jana 5bebd4ac67
Extend plugin mechanism to arbitrary commands 2019-10-24 12:44:01 +05:30
Arun Prakash Jana cb916661c8
Minor reformat 2019-10-24 11:53:34 +05:30
Arun Prakash Jana 5734f49126
Fix KEY_RESIZE loop 2019-10-24 08:47:45 +05:30
Arun Prakash Jana 3dd95fd9a8
Fix checkpatch warnings 2019-10-24 08:44:36 +05:30
Arun Prakash Jana 97200a2491 Update docs 2019-10-24 06:56:24 +05:30
Anna Arad 45387a431d
Fix Fish autocomplete suggestions for sessions 2019-10-23 17:58:08 +03:00
Anna Arad b81affffa1
Fix code examples in plugins README 2019-10-23 16:55:57 +03:00
Anna Arad 9afd7cf3bf Implement plugins control of nnn + plugins (#364)
* Implement plugins control of nnn + plugins

* Refactor plugins control code and fix getplugs to recognize hidden files

* Fix bug when going to dir on non-current context from plugin

* Fix some plugins to work on openbsd and freebsd

* Renamings

* Switch to -R flag in cp instead of -r; BSDs complain

* Change braces of function location

* Rewrite plugin creation in README and add new plugins to the table

* Update the fzcd script to include fzy or fzf

* Change plugin name resolve-link-dir -> lncd

* Fixing plugins README table

* Remove some cd plugins but add them as examples to plugins README
2019-10-23 15:34:12 +05:30
Arun Prakash Jana 0144f44060
Remove special characters from help 2019-10-21 20:13:52 +05:30
Arun Prakash Jana 3966465171
Change spaces to tab 2019-10-21 06:55:19 +05:30
Arun Prakash Jana d3eece14cc
Fix #366: update docs 2019-10-20 19:41:55 +05:30
Arun Prakash Jana 651b27032d
Fix #366 2019-10-20 19:37:35 +05:30
Arun Prakash Jana f601d825bc
Refactor fixes 2019-10-20 19:19:25 +05:30
Arun Prakash Jana 71bf18cee3
Refactor 2019-10-20 05:35:41 +05:30
Arun Prakash Jana 1b3b9f503d
Refactor cp, mv, cp-mv as, rm 2019-10-19 13:25:50 +05:30
Arun Prakash Jana 95e9151c90
Refactor screen move 2019-10-19 09:10:52 +05:30
Arun Prakash Jana 864273dd9b
Refactor current directory removal 2019-10-19 08:43:32 +05:30
Arun Prakash Jana ae7a3fbdc1
Clean up plugin handling code 2019-10-19 07:00:04 +05:30
Arun Prakash Jana 62457c3984
Update docs 2019-10-19 05:17:38 +05:30
Arun Prakash Jana 3aebeaec58
Update docs on session 2019-10-19 04:03:46 +05:30
Anna Arad 60dac94a5e Implementing sessions support (#360)
* Initial commit of sessions implementation

* Reduce code duplication

* Move load session to program flag -e

* Fix context initialization problem when loading session

* Add pinned directory to session and reduce session file size

* Make load_session print an error if exists and few minor adjustments

* Refactor session's file structure

* Initialize required structures in load_session before loading

* Add load session dynamically, restore last session, and extra fixes

* Fix indentation

* Add sessions documentation to man page

* Update fish completions with sessions and make some improvements

* Move to single keybinding session management and add help info

* ESC when asked to insert session name behaves better

* Add sessions completion for bash

* Remove pinned dir from session and minor code refactors
2019-10-19 03:41:39 +05:30
Arun Prakash Jana 2da5602a4f
Use a single keybind for cp/mv as 2019-10-17 23:35:49 +05:30
Arun Prakash Jana 522626a88d
Combine related cases together 2019-10-16 08:29:49 +05:30
Sijmen J. Mulder 3953639c5d Fix build (and more) on SmartOS (#363)
* Define _XOPEN_SOURCE_EXTENDED on SmartOS

Enables wide ncurses.

* SmartOS has alloca() in alloca.h

* SmartOS does not have sig_t

* dprintf() is not available on SmartOS

So replace its usage with fprintf.

* SmartOS has no d_type

* SmartOS has no CLOCK_MONOTONIC_RAW

* SmartOS has no O_DIRECTORY

* Work around SmartOS not having mime detection

* Missing comma
2019-10-16 07:07:45 +05:30
Sijmen J. Mulder 98042ad7d0 Fix strftime() buffer overflow (#362)
If the formatted string is longer than 17 characters the string won't
be null terminated, causing gibberish to be printed on the status line
and possibly worse.

This occurs with my current locale in which a date is printed as such:

  2019-okt.-15 19:26

Which is 18 characters.
2019-10-16 07:01:19 +05:30
Arun Prakash Jana 43c636d95c
Simplify functions 2019-10-15 06:15:32 +05:30
Arun Prakash Jana 269b80dbb2
Minor reformat 2019-10-15 05:56:34 +05:30
Arun Prakash Jana 29a934a1d2
Improve readibility 2019-10-15 04:17:12 +05:30
Arun Prakash Jana 8ac4a834ad
Minor refactor 2019-10-15 03:47:57 +05:30
Arun Prakash Jana 9469479c0a
Add function to count newlines in file 2019-10-14 22:49:24 +05:30
Arun Prakash Jana ff562983e1
Fix build break on macOS 2019-10-14 22:08:07 +05:30
KlzXS b9d183db26 Added copy/move-as (copy/move and rename) (#356)
* Added copy/move-as (copy/move and rename)

* Little refactorings

* Also handle selection file for cpmv_rename()
2019-10-14 22:06:45 +05:30
Arun Prakash Jana 04cba31128
Use a macro for readability 2019-10-14 17:58:16 +05:30
0xACE 2ac22cfc9f Mouseclicks are no longer delayed (#353)
This patch changes the mouseinterval to 0. And handles detection of
doubleclicking events internally.

This allows much faster response times for mouse clicks as nnn no longer
has to wait for ncurses to confirm what type of click it was.

It introduces a new config setting for changing how many milliseconds it
may take for a double click to be registered.
2019-10-14 17:55:04 +05:30
Anna Arad 49bee69490 suedit plugin (#359) 2019-10-14 06:36:11 +05:30
0xACE ab0fe6c408 unmount() ask for target if not found (#358)
* unmount() ask for target if not found

unmount() now properly asks for which target to unmount if it cannot
automatically deduce which folder to unmount.

* no more automatic unmounts outside of cfgdir
2019-10-13 20:53:32 +05:30
Anna Arad 06ff2c55da Remove -Wno-unused-parameter and do cleanup (#357) 2019-10-13 19:10:06 +05:30
Arun Prakash Jana 087380968d
Pass path as second argument 2019-10-13 17:28:02 +05:30
Arun Prakash Jana 19ea710e08
gutenread: support epub 2019-10-13 12:06:32 +05:30
Anna Arad 6d7c25822a Makefile detect header change (#355) 2019-10-13 03:07:53 +05:30
Arun Prakash Jana 2f413f8059
Plugin to browse, download, read from Project Gutenberg 2019-10-13 01:24:02 +05:30
0xACE 262c94f696 Check for alternative name for drag/drop exec (#354)
KDE dragon player collides with the name of the drag/drop dependency. On
archlinux the binary is renamed to `dragon-drag-and-drop`.

This change tries `dragon-drag-and-drop` before defaulting to `dragon`.
2019-10-13 00:48:50 +05:30
Arun Prakash Jana e371182a5b
Optional fortune quotes in help/config page 2019-10-12 23:04:34 +05:30
Arun Prakash Jana ec9331de17
Update docs 2019-10-12 10:20:21 +05:30
Arun Prakash Jana fef8f041d2
Fix build break 2019-10-12 08:44:58 +05:30
0xACE 3eb0a38c5e Added 2 plugins for drag and drop support (#352)
* Added 2 plugins for drag and drop support

These scripts uses https://github.com/mwh/dragon
and curl.

It allows nnn to drag and drop files either to other programs, or to
itself.

* added link to dependency and spelling

* added drag/drop-file scripts to readme table
2019-10-12 07:55:30 +05:30
Arun Prakash Jana 10188fa9b1
Update to Ubuntu 18.04 install commands 2019-10-12 03:26:00 +05:30
Arun Prakash Jana 19df7777db
Mount archives using archivemount 2019-10-12 02:13:08 +05:30
Arun Prakash Jana c54f50cf4f
Remove unused param 2019-10-12 00:26:34 +05:30
Arun Prakash Jana d1d491c102
Fix #350: cd on quit if NNN_TMPFILE is set 2019-10-11 23:19:25 +05:30
Arun Prakash Jana c99a47d688
Update man page on -K 2019-10-11 21:26:03 +05:30
Arun Prakash Jana 45c8730d2c
Fix build break 2019-10-11 21:19:51 +05:30
Arun Prakash Jana fe80d5aa9d
Update key collision detection 2019-10-11 20:59:22 +05:30
Anna Arad ab8e3e445e Implement a basic keybinding collision checker. (ToDo list #337) (#348) 2019-10-11 19:41:56 +05:30
Arun Prakash Jana a7d224f1e5
Fix #351: reduce prompt length for new file/dir 2019-10-11 18:38:06 +05:30
Arun Prakash Jana b42efcbb1f
Document edit selection 2019-10-10 19:26:08 +05:30
KlzXS b7c2ce741a Implemented edit selection buffer (#345)
* Implemented edit selection buffer

* Added checks and changed keybind

* Forgot check and style fixes

* Don't work late at night again

You forget things when you're tired
2019-10-10 18:37:16 +05:30
Arun Prakash Jana 7965fa1b0d
Fix #342: mention as Lead key in docs 2019-10-10 08:30:17 +05:30
Mischievous Meerkat f72cf4cee4
Merge pull request #347 from rindeal/make-fix
allow multiple make targets being specified at once
2019-10-09 21:24:40 +05:30
Jan Chren (rindeal) 7cc108f6a8 allow multiple make targets being specified at once 2019-10-09 17:45:40 +02:00
Mischievous Meerkat 0125684d3f
Merge pull request #344 from rindeal/make
do build configuration with variables instead of targets
2019-10-09 20:44:46 +05:30
Jan Chren (rindeal) 9e25886694 do build configuration with variables instead of targets 2019-10-09 17:05:56 +02:00
Arun Prakash Jana 84bb0b5bfe
Update doc on deselect, file size 2019-10-09 19:51:51 +05:30
Arun Prakash Jana 2d50a0db50
Update doc 2019-10-08 19:45:29 +05:30
Arun Prakash Jana b4ba845fe3
Remove obsolete troubleshooting note 2019-10-08 01:47:52 +05:30
Arun Prakash Jana 4f6f1a59d3
Fix #338: export current file as $NNN 2019-10-07 16:32:00 +05:30
Arun Prakash Jana 048c5195c3
Prepare for release v2.7 2019-10-06 20:19:22 +05:30
Arun Prakash Jana 9ff7ed9291
Update docs 2019-10-06 19:52:30 +05:30
Arun Prakash Jana bb0f1db965
Update auto-complete scripts 2019-10-06 18:57:15 +05:30
Arun Prakash Jana f2618a95fb
Update ToDo list link 2019-10-06 12:33:03 +05:30
Arun Prakash Jana a37ddfa080
Rename target nolocale to noloc 2019-10-05 07:26:18 +05:30
Arun Prakash Jana 914e180287
Update help 2019-10-05 07:23:25 +05:30
Arun Prakash Jana baac461b33
Limit imput length at readline prompt 2019-10-05 07:17:01 +05:30
Arun Prakash Jana 2f4144b0bd
Key ^N replaces ^T to toggle nav mode 2019-10-05 07:06:32 +05:30
Arun Prakash Jana 14c355bacf
Add keys: Shift+TAB, ' 2019-10-05 06:59:43 +05:30
Arun Prakash Jana 9dab803e1a
Suppress permission denied messages 2019-10-04 20:46:57 +05:30
Arun Prakash Jana 402f5651a1
Use type that fits length 2019-10-04 20:34:37 +05:30
Arun Prakash Jana 57298b7fcc
Use ix.io paste service 2019-10-04 18:45:21 +05:30
Arun Prakash Jana 8b9f96e645
Remove redundant alignment requirement 2019-10-04 08:10:35 +05:30
Arun Prakash Jana 133f55170b
Target nolocale: saves more on memory 2019-10-04 08:10:31 +05:30
Arun Prakash Jana 241a261531
fix CHANGELOG 2019-10-04 06:48:11 +05:30
Arun Prakash Jana d493f78dea
Track up to 8 events 2019-10-03 21:15:11 +05:30
Arun Prakash Jana 3489c87b98
Remove weak check for CLI detection 2019-10-03 18:14:51 +05:30
Arun Prakash Jana add2db80f2
Update man 2019-10-03 03:46:44 +05:30
Arun Prakash Jana f4ec874b79
Fix 2019-10-03 03:44:54 +05:30
Arun Prakash Jana 9f68e74289 Revert "Fix #334: Detect session type"
This reverts commit e226e8c889.
2019-10-03 03:33:15 +05:30
Arun Prakash Jana e226e8c889
Fix #334: Detect session type 2019-10-03 02:38:26 +05:30
Arun Prakash Jana 4a41d3a894
Group dirs on top 2019-10-03 02:24:08 +05:30
Arun Prakash Jana 66713730f0
Add plugin uidgid 2019-10-03 00:16:44 +05:30
Arun Prakash Jana a9f60d0353
Block range selection only when dir chanegs 2019-10-02 23:57:26 +05:30
Arun Prakash Jana 5f4046b63d
Fix #334 2019-10-02 23:04:56 +05:30
Arun Prakash Jana 67c33a5e80
Code refactor 2019-10-02 22:34:11 +05:30
Arun Prakash Jana 757a783d49
^S is used by stty, use ^K 2019-10-02 12:14:38 +05:30
Arun Prakash Jana f75620e95b
Update plugin viuimg 2019-10-01 07:35:54 +05:30
Arun Prakash Jana 30b5b0ed72
Update docs 2019-10-01 05:08:21 +05:30
Arun Prakash Jana 57e9cd54a2
SSHFS is optional dep 2019-10-01 04:21:56 +05:30
Arun Prakash Jana 727fad3b32
Add image 2019-10-01 04:01:02 +05:30
Arun Prakash Jana afdec4a573
Fix crc8 match on range selection 2019-10-01 02:55:40 +05:30
Arun Prakash Jana 951d43eb77
Clear selection file on clear selection 2019-09-30 23:02:44 +05:30
Arun Prakash Jana 025c7f0a48
Remove selmode indicator 2019-09-30 22:23:54 +05:30
Arun Prakash Jana 465bb92693
Update program help 2019-09-30 22:11:35 +05:30
Arun Prakash Jana 57d9edfed3
Get rid of selection mode. Plus associated changes.
- distinct keybinds for single entry, range or all selection
- selecting a file/range/all files would turn selection mode on
- single file/range or all selection appends to selection
- any operation (cp, mv, rm, plugin/file execution, cmd prompt, launch app, spawn
  shell) on selection ends the selection mode
- selection buffer is cleared after mv, rm on selection
- repeat range selection on same file clears selection and exits seleciton mode
- basic check (won't work on dir reload) added to avoid duplicates in selection
2019-09-30 21:35:52 +05:30
Arun Prakash Jana 7cae5dfe44
Shortcut to list selection y is now M 2019-09-30 18:54:27 +05:30
Arun Prakash Jana 62a0932976
Update docs on new selection shortcuts 2019-09-30 08:53:34 +05:30
Arun Prakash Jana 6ba1e48e62
End multi selection mode before link 2019-09-30 07:41:34 +05:30
Arun Prakash Jana 9d23517d10
key ^Y is now ^S, key ^K is now ^J, kwy ' is now m 2019-09-30 06:54:06 +05:30
Arun Prakash Jana 318ddd2ca6
Remove shortcut Leadq to quit context 2019-09-30 06:35:16 +05:30
Arun Prakash Jana b340ecc257
Do not clear buffer on selection end 2019-09-29 23:06:27 +05:30
Arun Prakash Jana 17de5bfc27
Use better keys for selection mode 2019-09-29 22:59:27 +05:30
Arun Prakash Jana b046157b61
End selection mode when an operation is run 2019-09-29 21:44:47 +05:30
Arun Prakash Jana 1d5f1bf653
Rename selection related tokens 2019-09-29 11:27:42 +05:30
Arun Prakash Jana 3309736060
Show Z for size sort 2019-09-29 10:44:53 +05:30
Arun Prakash Jana a6eb685ff5
Update docs 2019-09-29 10:02:51 +05:30
Arun Prakash Jana a25165d1bd
Fix directory view with viuimg 2019-09-29 09:19:44 +05:30
Arun Prakash Jana e8d5c453d7
Move packagecore config, update matrix 2019-09-29 08:02:40 +05:30
Arun Prakash Jana 2446d7c68c
Update help screen 2019-09-28 22:15:49 +05:30
Arun Prakash Jana 6f856dbe74
Update docs 2019-09-28 21:28:43 +05:30
Arun Prakash Jana a7b61f79c4
Shorten option list 2019-09-28 20:04:24 +05:30
Arun Prakash Jana e80b9b3c6a
Export current entry name as NN
The current file or dir name is exported in env var NN before running a cmd at
the command prompt or spawning a shell.

Export current file name as NCUR
2019-09-28 16:33:22 +05:30
Arun Prakash Jana dc9245d6b0
Update docs 2019-09-28 06:47:44 +05:30
Arun Prakash Jana 1e7cc1f369
Update plugin docs 2019-09-27 22:21:04 +05:30
Arun Prakash Jana 2c3b5e2f78
Add command to download plugins 2019-09-27 21:13:01 +05:30
Arun Prakash Jana 65c986b70a
Update some sections 2019-09-27 19:35:14 +05:30
Arun Prakash Jana 5c73c8942b
Update some sections 2019-09-27 08:54:50 +05:30
Arun Prakash Jana 60b590791c
Update docs 2019-09-26 21:51:38 +05:30
Arun Prakash Jana 85b5d33fa4
Do not reload dir after running plugin 2019-09-26 21:45:08 +05:30
Arun Prakash Jana d7ce06b10b
Add plugin to take quick notes 2019-09-26 19:56:43 +05:30
Arun Prakash Jana ce8e6a8791
Update docs 2019-09-26 19:17:48 +05:30
Arun Prakash Jana b0c0cc72c4
Use uniform separator 2019-09-26 08:22:53 +05:30
Arun Prakash Jana 52b413adae
Fix lint error 2019-09-26 06:24:11 +05:30
Arun Prakash Jana ccc25fd0f0
Update docs 2019-09-26 05:55:58 +05:30
Arun Prakash Jana 1ca1705219
Set num files selected in single select mode 2019-09-21 12:03:19 +05:30
Arun Prakash Jana 7335deb022
du status line change 2019-09-20 08:35:37 +05:30
Arun Prakash Jana 7ec54342ae
Remove redundant newline 2019-09-19 21:58:34 +05:30
Arun Prakash Jana b5ed36bebe
mocplay: confirm working with selection 2019-09-16 23:35:43 +05:30
Arun Prakash Jana 450601bea5
Update docs 2019-09-16 21:01:56 +05:30
Arun Prakash Jana 99840a6fa3
Show file size in status bar 2019-09-16 02:03:16 +05:30
Arun Prakash Jana 6bb6671118
Update help 2019-09-16 01:33:41 +05:30
Arun Prakash Jana 4a0e3570fe
Remove redundant spaces 2019-09-16 01:33:41 +05:30
Arun Prakash Jana 7c8df20bea
Key : to run plugin 2019-09-16 01:33:41 +05:30
Arun Prakash Jana 5259eb3f61
New image 2019-09-16 01:33:36 +05:30
Arun Prakash Jana 2f0dc405b8
No filename in status bar in du mode, coding style fixes 2019-09-15 21:39:39 +05:30
Arun Prakash Jana 6c39d87cdf
Key > to run plugin 2019-09-15 19:11:10 +05:30
Arun Prakash Jana e68e8ad8a5
Show directory size 2019-09-15 18:25:11 +05:30
Arun Prakash Jana 6feaecafe2
An extra column when no indicator 2019-09-15 18:14:56 +05:30
Arun Prakash Jana 9afe09b4b5
Uniform status bar for light and detail modes 2019-09-15 05:35:58 +05:30
Arun Prakash Jana 5936d3f110
Disable du on detail mode switch 2019-09-15 04:56:54 +05:30
Arun Prakash Jana b2199db194
Code refactor 2019-09-15 04:23:12 +05:30
Arun Prakash Jana 2a74640fc6
Status bar: show time and perms in light mode 2019-09-15 04:13:26 +05:30
Arun Prakash Jana a07c542870
Retain filter after running command 2019-09-15 01:37:39 +05:30
Arun Prakash Jana e2a95140d5
Add note on dated versions 2019-09-14 05:55:28 +05:30
Arun Prakash Jana 2820991383
Show extn for regular files 2019-09-12 22:15:25 +05:30
Arun Prakash Jana e4c14ee13c
Shortcut mapping: S for du, A for apparent du 2019-09-12 08:30:12 +05:30
Arun Prakash Jana 684a90a0fb
Batch rename: prompt if selection exists 2019-09-11 19:53:20 +05:30
Arun Prakash Jana c3ce5bc705
Preserve attributes on duplicate, update docs 2019-09-11 18:28:41 +05:30
Arun Prakash Jana bb5ef221b3
Run a command at filter prompt
This is a conveninece for nav-as-you-type mode.
With this program option, on pressing ^P, the filter is  executed as cmd.
2019-09-11 14:54:23 +05:30
Arun Prakash Jana ccf20f830b
Replace printw() with addstr()/addch() 2019-09-11 01:34:18 +05:30
Arun Prakash Jana 8d283886b0
10 chars are printed in for contexts 2019-09-11 00:12:25 +05:30
Arun Prakash Jana d33f469296
Remove redundant variable 2019-09-10 20:26:08 +05:30
Arun Prakash Jana a064818acf
Fold only long paths 2019-09-09 23:41:45 +05:30
Arun Prakash Jana 7621078d52
Show path in short form 2019-09-08 15:28:31 +05:30
Arun Prakash Jana 84119b1238
Prefer selection to copy in names 2019-09-08 14:23:00 +05:30
Arun Prakash Jana 9988d254fe
Fix xitoa() 2019-09-08 14:05:02 +05:30
Arun Prakash Jana 1baf284369
Show selection mode and number of selected files 2019-09-08 12:39:39 +05:30
Arun Prakash Jana cea542b515
Update docs 2019-09-06 20:03:48 +05:30
Arun Prakash Jana bde0f5c354
Fix help alignment 2019-09-05 19:42:59 +05:30
Arun Prakash Jana 1107df9515
Update ToDo list link 2019-09-03 19:55:10 +05:30
Arun Prakash Jana d55d1ad810
Simplify numeric value check 2019-09-01 11:53:17 +05:30
Arun Prakash Jana cabef475ab
Fix SEL_CYCLE (tab) 2019-08-31 23:19:04 +05:30
Arun Prakash Jana 460fe7c080
Update example 2019-08-30 21:03:39 +05:30
Arun Prakash Jana ec873ab4fa
Option -a to use file access time 2019-08-30 21:00:47 +05:30
Arun Prakash Jana 3f40980dd0
Plugin oldbigfile: find large files by access time 2019-08-30 20:01:13 +05:30
Arun Prakash Jana 94c3af873c
Implement mediainfo as a plugin 2019-08-28 00:02:33 +05:30
Arun Prakash Jana f781fbe78c
Set mode to detail for option -S 2019-08-25 21:15:17 +05:30
Arun Prakash Jana ea81e2e569
Add F12 as run plugin key:wq 2019-08-25 19:48:08 +05:30
Arun Prakash Jana 86594a747f
Fix plugin boom, make customizable 2019-08-25 06:17:05 +05:30
Arun Prakash Jana 2c90999381
Lead followed by . to show hidden files 2019-08-25 06:05:10 +05:30
Arun Prakash Jana 871685f7ca
New keys: F2 (rename) F5 (redraw) 2019-08-25 05:36:28 +05:30
Arun Prakash Jana 9b6ffeef5d
Use MOC in plugin boom 2019-08-24 22:35:04 +05:30
Arun Prakash Jana d8fe4b3bb6
Plugin dups: find duplicate files in dir 2019-08-24 21:23:52 +05:30
Arun Prakash Jana eb3a9ad2ee
Restore mousemask before exit 2019-08-24 19:44:49 +05:30
Arun Prakash Jana 3b7d07207d
Use concepts section to wiki 2019-08-24 11:29:29 +05:30
Arun Prakash Jana 611eaa51c8
Use canonical replstr 2019-08-23 22:08:29 +05:30
Arun Prakash Jana 3a0f2a20d8
Fix #328 2019-08-23 21:43:32 +05:30
Arun Prakash Jana a4d8d68c7d
Option -r to show cp, mv progress on Linux 2019-08-23 20:28:56 +05:30
Arun Prakash Jana 979fadcc7e
Change history file path.
The new path is ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.history
2019-08-23 19:10:48 +05:30
Arun Prakash Jana 9feb5ce651
Merge fzy-edit into fzy-open 2019-08-23 08:30:48 +05:30
Arun Prakash Jana 0fbd68ab48
Use lighter function to print character 2019-08-23 08:30:44 +05:30
Arun Prakash Jana 6ea75cfd8d
Fix broken links, update docs 2019-08-21 08:59:39 +05:30
Arun Prakash Jana 505bf0574e
Avoid double conversion in light mode 2019-08-20 21:55:54 +05:30
Arun Prakash Jana f4f1acf856
Remove wild load option 2019-08-20 20:00:48 +05:30
Arun Prakash Jana 8d16d6ac5f
Update list of packagers 2019-08-20 08:50:07 +05:30
Arun Prakash Jana e3a4ddeb55
Update features list 2019-08-19 23:23:16 +05:30
Arun Prakash Jana b9530a5ce0
Plugin organize 2019-08-19 23:01:41 +05:30
KlZX 80c2c469da
Fix 100% CPU usage if STDIN closes 2019-08-19 22:10:08 +05:30
Arun Prakash Jana f378743c49
Keep name unchanged at rename to duplicate 2019-08-19 20:00:01 +05:30
Arun Prakash Jana bf13243830
Update docs 2019-08-19 08:42:24 +05:30
Arun Prakash Jana e9f7b6aa6c
Option -t replaces NNN_NO_AUTOSELECT 2019-08-17 00:07:38 +05:30
Arun Prakash Jana ac815c692a
Option -o replaces NNN_RESTRICT_NAV_OPEN 2019-08-16 23:40:43 +05:30
Arun Prakash Jana e13481c5b0
Update auto-completion scripts 2019-08-16 23:15:29 +05:30
Arun Prakash Jana 1294a9caf5
Revert rename cp mv progress 2019-08-16 22:22:45 +05:30
Arun Prakash Jana db83e95a37
Symlinks to dirs are recognized by color 2019-08-16 20:03:58 +05:30
Arun Prakash Jana 9927849222
Update docs 2019-08-16 18:56:26 +05:30
Mischievous Meerkat 2ee3b74b31
Merge pull request #325 from KlzXS/awk
Replacing last occurance of 'awk'
2019-08-15 19:06:28 +05:30
KlZX 7e47cd729b Reverted 'batch_rename' to pre-'awk' but with 'sed' 2019-08-15 15:24:03 +02:00
Arun Prakash Jana 9282eff925
Update plugin docs 2019-08-15 11:11:23 +05:30
Arun Prakash Jana 7575a3e031
Plugin vidthumb 2019-08-15 10:06:41 +05:30
Arun Prakash Jana 4ab13b1b34
Plugin moclyrics 2019-08-15 09:15:03 +05:30
Arun Prakash Jana 8fff4643f5
Detect if MOC is playing 2019-08-15 04:01:53 +05:30
Arun Prakash Jana 5c591422dc
Revert "Replaced 'sed' with 'awk'"
This reverts commit 1027cd0cf2.
2019-08-14 21:58:22 +05:30
Arun Prakash Jana 2ffd493162
Update ToDo list 2019-08-14 21:58:22 +05:30
Arun Prakash Jana 02b3273233
Use key-plugin pairs for running plugins 2019-08-14 21:58:18 +05:30
Arun Prakash Jana 7b59a7dba9
Rename cp mv progress conf 2019-08-14 19:10:41 +05:30
Arun Prakash Jana c5bbbd852c
ndiff: direction to get rid of vim warning 2019-08-14 01:38:30 +05:30
Arun Prakash Jana 775742150c
Custom keybinds to run plugins directly 2019-08-14 01:38:30 +05:30
Arun Prakash Jana 3bd3418ab6
Update docs 2019-08-14 01:38:26 +05:30
Arun Prakash Jana 5ea8dee428
List symlink with target missing 2019-08-13 04:22:34 +05:30
Mischievous Meerkat 0cf77c2ac6
Merge pull request #322 from KlzXS/awk
Replaced 'sed' with 'awk'
2019-08-12 21:44:54 +05:30
KlZX 1027cd0cf2 Replaced 'sed' with 'awk' 2019-08-12 17:08:02 +02:00
Arun Prakash Jana e774634b5b
A simpler getutil() 2019-08-12 20:15:04 +05:30
Mischievous Meerkat edfcfdfdf4
Merge pull request #321 from KlzXS/batch-rename
Fix 'batch_rename' moving symlinks
2019-08-12 18:57:44 +05:30
KlZX 4cedba3d4d Fix 'batch_rename' moving symlinks 2019-08-12 11:36:09 +02:00
Arun Prakash Jana 7eafce9b45
Fix #320 2019-08-12 07:13:30 +05:30
Arun Prakash Jana 5dba524565
Add Slitaz as packager 2019-08-11 02:51:41 +05:30
Arun Prakash Jana e9e9f5930f
Fix #235: Add instruction for CentOS 2019-08-11 00:54:07 +05:30
Arun Prakash Jana cd6c1e65b6
Update docs 2019-08-10 22:07:36 +05:30
Arun Prakash Jana 59c7727a8b
Add DragonFly BSD 2019-08-10 19:05:59 +05:30
Arun Prakash Jana 0647c75cd8
Strip cwd path for all non-Linux platforms 2019-08-10 18:32:36 +05:30
Mischievous Meerkat 199fb3ca29
Merge pull request #313 from 0xACE/relativearchives
Make selection based archives use relative paths
2019-08-10 07:06:40 +05:30
Arun Prakash Jana 6481c812bd
Update docs 2019-08-09 13:56:00 +05:30
Mischievous Meerkat 6e4fcb5576
Merge pull request #316 from 0xACE/keyresize
Fix keyresize handling of cur in filterentries()
2019-08-08 07:21:18 +05:30
0xACE dcad704ae9 Fix keyresize handling of cur in filterentries() 2019-08-08 02:45:40 +02:00
Arun Prakash Jana 8ca96422cd
Fix #315: crash is NNN_BMS is not set 2019-08-08 01:39:41 +05:30
Arun Prakash Jana 93f2822f7c
Update docs 2019-08-07 22:28:24 +05:30
Arun Prakash Jana 29e8ca322c
Update help 2019-08-07 21:59:15 +05:30
Arun Prakash Jana 8bc71c6e5b
Key Lead' to go to first file in dir 2019-08-07 19:47:17 +05:30
Arun Prakash Jana 26e18ab382
Fix #315 2019-08-07 18:46:47 +05:30
Arun Prakash Jana 8c2c7e9e97
Fix #314 2019-08-07 02:03:52 +05:30
Arun Prakash Jana d23c2997af
Rename COPY macros to SEL 2019-08-07 01:38:51 +05:30
Arun Prakash Jana 8ea41dd0e5
Do not pick multiple times in selection mode 2019-08-07 01:27:22 +05:30
Arun Prakash Jana 9a3786f94d
Auto-proceed to next entry in selection mode 2019-08-07 00:51:54 +05:30
Arun Prakash Jana 68b460310e Use auto-compress option for bsdtar, tar 2019-08-06 23:27:06 +05:30
Mischievous Meerkat 5651d12dc4
Create FUNDING.yml
PayPal link
2019-08-06 07:26:50 +05:30
Arun Prakash Jana 75bfcb1834
Prepare for release v2.6 2019-08-06 04:13:10 +05:30
Arun Prakash Jana a95fc0c37a Revert "Use KEY_RESIZE when prompting user input"
This reverts commit ba12fa8b3d.
2019-08-05 19:03:55 +05:30
Arun Prakash Jana 7470fc3f7b
Update docs 2019-08-05 07:36:56 +05:30
Arun Prakash Jana dec683c39e
Better prompt for rename/duplicate key 2019-08-04 20:52:54 +05:30
Arun Prakash Jana 9431213e49
Support / as an additional leader key 2019-08-04 14:31:58 +05:30
Arun Prakash Jana 4c4db1430e
Ask for 'd' to duplicate 2019-08-04 11:48:45 +05:30
Arun Prakash Jana 9fdfd9388d
Light mode as default, options changed
-d is to show detail mode
-H is to show hidden files
-l is retired
2019-08-04 09:55:14 +05:30
Arun Prakash Jana cf1b9d34ea
Light mode: show statusbar, use reverse video 2019-08-04 08:56:59 +05:30
Arun Prakash Jana 2bfcb281e7
Support duplicate file/dir 2019-08-04 08:29:32 +05:30
Mischievous Meerkat f7a00ae114
Merge pull request #312 from rindeal/patch-1
Make strip explicit for all targets
2019-08-04 07:23:49 +05:30
0xACE 2baa42b877 MacOS support for archive_selection() 2019-08-04 02:49:48 +02:00
0xACE 30651d16d7 Make selection based archives use relative paths
This will create archives relative to your current working directory
rather than a full path when when creating the archive based on your
current selection.
2019-08-04 00:41:20 +02:00
Jan Chren 176187c1ed
remove $(STRIP) leftover from Makefile
Use only the `strip` target fort stripping the binary.
2019-08-03 22:09:16 +00:00
Arun Prakash Jana 9d4498e7b3 Revert "Remove bold fonts"
This reverts commit 43762d58c5.
2019-08-03 23:55:02 +05:30
Arun Prakash Jana 21b323b445
Increase function length 2019-08-01 23:01:04 +05:30
Arun Prakash Jana 0f6cb31d61
Sort by file extension 2019-08-01 22:20:40 +05:30
Arun Prakash Jana ea0e863f43
Update docs 2019-07-31 23:31:37 +05:30
Arun Prakash Jana 9aafc675ec
Update docs 2019-07-30 05:00:53 +05:30
Arun Prakash Jana e721dcb8ad
Link the wiki 2019-07-29 19:35:11 +05:30
Arun Prakash Jana f1720c8f44
Do not change filter state when clicked below last entry 2019-07-29 19:17:49 +05:30
Arun Prakash Jana 46aa0adafa
Limit nav-as-you-type toggle to click on last 2 rows 2019-07-28 21:55:29 +05:30
Arun Prakash Jana 43762d58c5
Remove bold fonts
This reverts commit d0c2e9da298c1f6042d775deaae33f9b9d70b6e1.

Remove bold fonts
2019-07-27 22:49:16 +05:30
Arun Prakash Jana 281d7cbc8b
Minor reformat 2019-07-27 20:26:12 +05:30
Arun Prakash Jana 79af710ac4
Update docs 2019-07-27 20:26:08 +05:30
Arun Prakash Jana de931db8a0
Support extract, list archives with default utils 2019-07-27 16:40:30 +05:30
Arun Prakash Jana 8e00d74259
Support archiving with default utils 2019-07-27 12:14:49 +05:30
Arun Prakash Jana a498636263
Document dual pane alias with dvtm 2019-07-27 01:29:58 +05:30
Arun Prakash Jana 8fe4761092
Fix #301 - use local buffer to avoid overwriting g_buf 2019-07-25 20:02:54 +05:30
Arun Prakash Jana 2a4008c9ab
Fix #307 - disable output 2019-07-23 07:13:19 +05:30
Arun Prakash Jana 27214bfca6
Fix #307 2019-07-22 22:55:04 +05:30
Arun Prakash Jana 847aa0e2ee
Fix hex viewer 2019-07-21 13:50:46 +05:30
Arun Prakash Jana 83bf689058 Revert "Fix #307"
This reverts commit fee2c339cc.
2019-07-21 05:47:15 +05:30
Arun Prakash Jana bf70a6660a Update docs 2019-07-20 21:15:49 +05:30
Mischievous Meerkat 124ded8b5b
Merge pull request #310 from 0xACE/keyresize
Use KEY_RESIZE when prompting user input
2019-07-16 18:37:48 +05:30
Mischievous Meerkat e3c99de23a
Merge pull request #309 from 0xACE/readline-resize
stop readline from overwriting LINES
2019-07-16 08:43:17 +05:30
0xACE 02fd4c4d8c documentation on rl_change_environment
Basically that line lets nnn retain the WINCH signal for itself.
2019-07-16 05:09:11 +02:00
0xACE ef32cf7177 set rl_change_environment in readline gt v6.3
Looked up GNU readline library's repo and looked
for the first occurance of rl_change_environment.
2019-07-16 05:02:45 +02:00
0xACE 3f33f0afb9 stop readline from overwriting LINES
The problem was that readline would completely block LINES from updating
after prompting the user. I'm not entirely sure why this happened, but
at least this patch fixes the problem.
2019-07-16 04:37:38 +02:00
0xACE ba12fa8b3d Use KEY_RESIZE when prompting user input
The problem was that a window wouldn't resize while prompting the user
for input. These changes allows the input methods in nnn to resize
properly if KEY_RESIZE is defined.

A more portable solution would be hooking the WINCH signal and update
the xlines value from there along with some resized flag.

In some cases the full window isn't redrawn until the user has finished
the input. This is because in some functions I wasn't sure the current
"path" was available.
2019-07-16 04:30:16 +02:00
Arun Prakash Jana fee2c339cc
Fix #307 2019-07-16 00:54:31 +05:30
Arun Prakash Jana 25add33539
Update docs 2019-07-15 20:19:46 +05:30
Arun Prakash Jana 140a526249
Add F2 for rename (undocumented) 2019-07-15 20:02:35 +05:30
Arun Prakash Jana fabf9fd47b
Compact notation for time/size sort order 2019-07-15 01:42:12 +05:30
Arun Prakash Jana 6fb4338ffa
Remove redundant initialization 2019-07-15 01:08:24 +05:30
Arun Prakash Jana e4afd91ec0
Update docs 2019-07-14 23:11:30 +05:30
Arun Prakash Jana aa840a7f65
Resurrect default sort 2019-07-14 23:00:14 +05:30
Arun Prakash Jana 1388b9ea71
Remove unused variable 2019-07-14 22:32:50 +05:30
Arun Prakash Jana ba099b6818
Fix coolsize 2019-07-14 22:27:22 +05:30
Arun Prakash Jana 0bc5d82d2f
Fix crash on a broken USB 2019-07-14 14:25:46 +05:30
Arun Prakash Jana c051fc3f7e
Update docs 2019-07-13 07:44:56 +05:30
Arun Prakash Jana bfc8d0a7d3
Termux improvement: toggle nav-as-you-type
2 changes:
- Toggle nav-as-you-type with left single/double click below last entry
- Handle mouse events when filter is on
2019-07-12 23:34:36 +05:30
Arun Prakash Jana 713eed0a21
Fix commenting style (if applicable) 2019-07-12 21:58:21 +05:30
Arun Prakash Jana 051a8b27c2
Termux improvement: remap visit parent click
Visit parent is now left single click outside context nums on top row.
2019-07-12 21:58:18 +05:30
Arun Prakash Jana 9b0cf4a2b9
Support mouse scroll
This is limited to libncurses support of full mouse scrolling.
Ref: https://invisible-island.net/ncurses/man/curs_mouse.3x.html#h3-Mouse-events
2019-07-12 19:50:30 +05:30
Arun Prakash Jana beabe62467
Update comments and debug info 2019-07-12 18:37:12 +05:30
Mischievous Meerkat 87d91251ae
Merge pull request #305 from 0xACE/fosterhome
Find a parent when CWD disappears
2019-07-12 18:28:21 +05:30
0xACE d640de2589 Keep lastname directory selected
incase the user just lost access, it would be better to remember the
selected directory to keep it highlighted.
2019-07-12 14:55:03 +02:00
0xACE 78ada7a8bc fixed misleading `else if` & text. removed lastdir 2019-07-12 14:44:59 +02:00
Arun Prakash Jana 33062d7c6e
Update checksum plugin documentation 2019-07-12 08:51:18 +05:30
0xACE e3393d0437 Find a parent when CWD disappears
The previous behaviour would exit nnn when the CWD disappeared.
2019-07-12 00:52:25 +02:00
Arun Prakash Jana ca714eac90
Show image thumbnails with lsix 2019-07-12 00:16:07 +05:30
Arun Prakash Jana 406faf63d9
Fix mtime comparison 2019-07-11 22:33:49 +05:30
Arun Prakash Jana 201b1ae571
Update docs 2019-07-11 08:35:39 +05:30
Mischievous Meerkat 74a7d2245c
Merge pull request #303 from fokinpv/forgotten-export
Add forgotten export for quitcd scripts
2019-07-10 19:14:25 +05:30
Pavel Fokin 66fa6fc682 Combine 'XDG_CONFIG_HOME' and 'HOME` in quitcd.fish 2019-07-10 15:56:17 +03:00
Arun Prakash Jana 2c84f24812
Linuk to youtube vide 2019-07-10 13:59:33 +05:30
Arun Prakash Jana 5552376cf6
Add packagers page in Wiki 2019-07-10 12:27:50 +05:30
Arun Prakash Jana e5733ab198
Add NuTyX to list of packagers 2019-07-10 09:37:02 +05:30
Arun Prakash Jana 41fcbd9b2f Fix #304 2019-07-10 09:21:52 +05:30
Pavel Fokin 17bb57263c Add forgotten export for quitcd scripts 2019-07-09 22:51:25 +03:00
Mischievous Meerkat d03ff4dc91
Merge pull request #302 from fokinpv/fix-quitcd-example
Fix quitcd snippets for 'zsh' and 'bash'
2019-07-09 10:30:12 +05:30
Pavel Fokin 56b6f70634 Update quitcd snippet for 'fish' 2019-07-09 07:09:19 +03:00
Arun Prakash Jana 427c4b2429
Bash auto-complete enhancements 2019-07-08 23:35:30 +05:30
Arun Prakash Jana b0a60cfe64
Set mouse interval 2019-07-08 23:25:21 +05:30
Pavel Fokin 34ecf3ce13 Fix quitcd snippets for 'zsh' and 'bash' 2019-07-08 20:29:32 +03:00
Arun Prakash Jana 1b2093040a
Add video of nnn on Termux 2019-07-07 22:40:28 +05:30
Arun Prakash Jana b7b3dbac22 Revert "Move declarations up"
This reverts commit afdfcecb9c.
2019-07-06 18:55:48 +05:30
Arun Prakash Jana 25a704cd27
Set scrolloff to 3 2019-07-05 21:40:33 +05:30
Arun Prakash Jana bde25e3ca0
Minor refactor 2019-07-05 20:58:36 +05:30
Arun Prakash Jana c373b4b279
Fix #301 2019-07-05 07:42:52 +05:30
Arun Prakash Jana afdfcecb9c
Move declarations up 2019-07-05 02:47:55 +05:30
Arun Prakash Jana a25e878dfc
Do not show mantissa for absolute sizes 2019-07-05 02:08:31 +05:30
Arun Prakash Jana 379fdf50fa
Show stat when file has single quote 2019-07-05 01:27:46 +05:30
Arun Prakash Jana d5408c4e9f
Replace snprintf for printing file size 2019-07-05 01:13:55 +05:30
Arun Prakash Jana bf28a096ba
Use macros for return codes 2019-06-28 21:12:43 +05:30
Mischievous Meerkat 169b29029e
Merge pull request #299 from ath3/ringtone-fixes
Small ringtone plugin fixes
2019-06-27 07:32:18 +05:30
ath3 e5cda54604 Small ringtone plugin fixes 2019-06-27 03:38:02 +02:00
Mischievous Meerkat 1e68309577
Merge pull request #298 from ath3/checksum-cleanup
Remove unneeded check from checksum plugin
2019-06-27 06:42:27 +05:30
Mischievous Meerkat 3cc0cf5f0a
Merge pull request #297 from ath3/mocplay-shuffle
Add shuffle to mocplay
2019-06-27 06:40:31 +05:30
Mischievous Meerkat b459879e2a
Merge pull request #296 from tanyaionova/duplicate-patch
Remove duplicate code (#295)
2019-06-27 06:36:40 +05:30
ath3 c2fbdfdeb3 Remove unneeded check from checksum plugin 2019-06-27 02:48:04 +02:00
ath3 4d7dade94c Add shuffle to mocplay 2019-06-27 02:19:55 +02:00
tanyaionova 3ad5f7f6cb Remove duplicate code (#295)
These three lines are exact copy of 4555-4557.
As opener is not changed in between, we can delete these
2019-06-27 01:01:42 +03:00
Mischievous Meerkat 900ffbebc7
Merge pull request #294 from tanyaionova/makefile-patch
Set CP in Makefile
2019-06-26 18:24:13 +05:30
tanyaionova e93abcf709 Set CP in Makefile
$(CP) is not set by GNU Make
Seems like [1] is a full list of what GNU Make defines implicitly
[1] https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html
2019-06-26 15:25:31 +03:00
Arun Prakash Jana a3019418b1
Update docs 2019-06-26 14:39:47 +05:30
Arun Prakash Jana 0fd6b5c9be
What's in the name? 2019-06-26 06:36:03 +05:30
Arun Prakash Jana b151e13548
Use generic msg 2019-06-25 01:08:32 +05:30
Arun Prakash Jana 80bdeb8d72
Fix order of options in man 2019-06-24 21:50:01 +05:30
Arun Prakash Jana 277f156c37
Fix #291 2019-06-24 21:45:02 +05:30
Arun Prakash Jana 2934db3482
Pretty table 2019-06-23 09:18:35 +05:30
Arun Prakash Jana 619ac17004
Add text2speech plugin 2019-06-23 01:43:52 +05:30
Arun Prakash Jana 4d6f304204
Fix #290: terminate g_buf correctly 2019-06-22 19:17:06 +05:30
Arun Prakash Jana a9392463b0
Fix #290: wchar_t may vary in size 2019-06-22 07:19:00 +05:30
Arun Prakash Jana 42a5479fa8
Add an mp3 ringtone generator 2019-06-21 22:36:34 +05:30
Arun Prakash Jana de2773c677
Update docs 2019-06-21 07:36:50 +05:30
Arun Prakash Jana c07288e585
The table is sorted 2019-06-20 20:57:19 +05:30
Arun Prakash Jana 2d1d176160
Fix #288 2019-06-20 19:17:00 +05:30
Arun Prakash Jana 98a8eb1805
Add note on vim warning 2019-06-20 18:38:45 +05:30
Mischievous Meerkat bccc2a0921
Merge pull request #286 from ath3/plugin-md5sum
Added md5sum plugin
2019-06-20 18:36:07 +05:30
ath3 2dc3da62a2 Refactored splitjoin and ndiff plugins, made them POSIX compliant 2019-06-20 10:45:24 +02:00
ath3 682e810e6e Extended md5sum script to support multiple checksums and renamed it to checksum 2019-06-20 03:39:23 +02:00
Arun Prakash Jana a4c38d8547
Fix #287 2019-06-20 02:13:59 +05:30
Arun Prakash Jana 25413dfe23
Update manual installation command 2019-06-19 22:03:08 +05:30
ath3 c499f1cb7f Changed bash code to sh 2019-06-19 13:40:31 +02:00
ath3 4757873d3a Added md5sum plugin 2019-06-19 04:06:19 +02:00
Arun Prakash Jana 4679daa761
Fix #285 2019-06-17 19:48:45 +05:30
Arun Prakash Jana 33e8c931f1
Update to gcc 9.1 2019-06-17 08:54:10 +05:30
Arun Prakash Jana 9bf86899f3
Update docs 2019-06-17 08:34:05 +05:30
Arun Prakash Jana 794a0e2709
Move scripts to misc 2019-06-17 07:04:42 +05:30
Arun Prakash Jana aa56b99326
Add widely available cmatrix as locker fallback 2019-06-17 07:04:42 +05:30
Arun Prakash Jana 32b3445f3b
Use case insensitive version sort to compare 2019-06-17 07:04:25 +05:30
Mischievous Meerkat 815155033d
Merge pull request #284 from anitagraham/docs
Add clarification for usage of moving and copying selections
2019-06-16 09:23:34 +05:30
Anita Graham 7554209e80 Add clarification for usage of moving and copying selections 2019-06-16 11:38:39 +08:00
Arun Prakash Jana 538995487b
Wait and show command output when running a command 2019-06-15 21:47:37 +05:30
Arun Prakash Jana c0bd33e3f6
Update deps 2019-06-14 09:19:41 +05:30
Arun Prakash Jana dba87bfdbe
Fix warning on CentOS 6 (refer to #282) 2019-06-13 06:21:10 +05:30
Mischievous Meerkat 444cf4b9ab
Merge pull request #280 from sjmulder/pr/sign-compare
Fix sign conversion and comparison warnings
2019-06-13 05:22:31 +05:30
Mischievous Meerkat f0b00c9fbf
Merge pull request #281 from sjmulder/pr/fwrite
Don't ignore fwrite errors
2019-06-13 05:20:54 +05:30
Sijmen J. Mulder da60f55559 Don't ignore fwrite errors
Fixes warning on CentOS 6:

  src/nnn.c:754: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
2019-06-13 01:07:03 +02:00
Sijmen J. Mulder 121bbe566b Fix sign conversion and comparison warnings
Building on i386 (NetBSD or Debian):

  src/nnn.c: In function 'selectiontofd':
  src/nnn.c:783:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    while (pos <= lastpos) {
               ^
  src/nnn.c:791:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (pos <= lastpos) {
             ^
  src/nnn.c: In function 'showcplist':
  src/nnn.c:823:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    if (pos && pos == copybufpos)
                   ^
  src/nnn.c: In function 'xlink':
  src/nnn.c:1955:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    while (pos < copybufpos) {
2019-06-13 00:51:19 +02:00
Arun Prakash Jana 331d2a6cc5
Update docs 2019-06-12 08:52:46 +05:30
Arun Prakash Jana 4e4892e861
nnn is available on CRUX 2019-06-12 06:59:28 +05:30
Arun Prakash Jana 23f84df1d8
Supprt exit on 'q' 2019-06-10 19:47:00 +05:30
Arun Prakash Jana 80c35e85bd
Support XDG_CONFIG_HOME 2019-06-09 10:36:35 +05:30
Arun Prakash Jana fa4f082ac0
Move cd on quit file
The new location is ~/.config/nnn/.lastd
2019-06-07 21:58:45 +05:30
Arun Prakash Jana cd458b9ab4
Remove retired config variable 2019-06-07 21:01:07 +05:30
Arun Prakash Jana b0bad47a71
Update plugins 2019-06-07 21:01:08 +05:30
Arun Prakash Jana a96ad1dab0
Add plugin to split or join files 2019-06-06 23:27:57 +05:30
Arun Prakash Jana 40afe7ca4d
Update docs 2019-06-06 21:18:11 +05:30
Arun Prakash Jana dee5e5a8e9
Move clang-tidy config 2019-06-05 21:50:03 +05:30
Arun Prakash Jana 8d1916e25b
Update docs 2019-06-05 20:41:54 +05:30
Arun Prakash Jana 1dbbcac84f
Use local buffers for events 2019-06-05 19:03:06 +05:30
Arun Prakash Jana 7f8766247f
Use pipes.sh as fallback user lock 2019-06-05 18:02:27 +05:30
Arun Prakash Jana d970a7416f
getplugs: backup earlier plugins 2019-06-05 17:52:33 +05:30
Arun Prakash Jana dd42726c5b
More intuitive nmount 2019-06-05 17:06:20 +05:30
Arun Prakash Jana 4a98d8db50
Use pipes.sh as locker fallback 2019-06-05 10:35:37 +05:30
Arun Prakash Jana c7f83dd179
Commented check 2019-06-04 23:32:23 +05:30
Arun Prakash Jana fcb29fa578
Fix #276 2019-06-04 22:41:48 +05:30
Arun Prakash Jana f269be5802
Restrict opening 0B files.
See #187. The behaviour has always remained so confusing. In my case a 0B file
opens in the GUI editor though I have NNN_USE_EDITOR set. We have a sensible
message in place to help users with what to do next.
2019-06-04 20:32:16 +05:30
Arun Prakash Jana aa6013378f
Make diff work with filenames with spaces 2019-06-03 20:29:37 +05:30
Arun Prakash Jana edf587a48f
Add plugin to play music in MOC 2019-06-03 18:26:53 +05:30
Arun Prakash Jana 9711297362
Update docs 2019-06-03 11:42:41 +05:30
Arun Prakash Jana 35fc77027a
Fix #274 2019-06-02 21:37:52 +05:30
Arun Prakash Jana 650f92bf34
Add plugin to view image and browse image dir 2019-06-02 21:37:42 +05:30
Arun Prakash Jana 9ba3cb3e9b
Update plugins, add mutool to view PDF 2019-06-01 00:34:07 +05:30
Arun Prakash Jana 82e7a98705
Enable packing source 2019-05-27 20:30:22 +05:30
Arun Prakash Jana 75768ad29e
Use mode=0755 when creating dirs 2019-05-27 20:16:55 +05:30
Arun Prakash Jana b767d3335c
Create ~/.config if missing 2019-05-27 18:55:05 +05:30
Arun Prakash Jana 5ea8218e4f
Prepare for release v2.5 2019-05-27 08:00:32 +05:30
Arun Prakash Jana 788dc80bb6
Code refactor 2019-05-27 07:23:30 +05:30
Arun Prakash Jana f02e0d359f
Add OS-specific alternative notes 2019-05-26 16:52:00 +05:30
Arun Prakash Jana 0d05d71a0f
file: use dereference 2019-05-26 16:44:17 +05:30
Arun Prakash Jana 22d8b4dba3
Update docs 2019-05-26 14:46:54 +05:30
Arun Prakash Jana d6fbe87768
Support directory diff 2019-05-26 10:27:09 +05:30
Arun Prakash Jana 7bf671c954
Show usage warning 2019-05-25 11:47:56 +05:30
Arun Prakash Jana 658099bee0
ipinfo shows external IP address 2019-05-24 23:14:19 +05:30
Arun Prakash Jana aa14a98ff9
Update docs 2019-05-23 08:14:15 +05:30
Arun Prakash Jana 6ce511cddb
Simplify batch rename 2019-05-22 20:51:53 +05:30
Arun Prakash Jana 93a2d174f0
PR #265: Replace dependency on vidir
Author: @bruce-hill
2019-05-22 18:44:03 +05:30
Arun Prakash Jana 2c2d497809
Update patool wrapper 2019-05-22 08:48:44 +05:30
Arun Prakash Jana 5f6ceb2f43
Support bsdtar 2019-05-22 08:48:44 +05:30
Bruce Hill a752235892
Alternate scrolling rules. 2019-05-22 08:48:44 +05:30
Arun Prakash Jana 9dc3976533
Middle click to visit parent dir 2019-05-22 08:48:44 +05:30
Arun Prakash Jana 84dbec6f3d
Update docs 2019-05-22 08:48:44 +05:30
Arun Prakash Jana ace449c0e9
Simpler permission string generation 2019-05-22 08:48:44 +05:30
Arun Prakash Jana e83f4ca62f
Refactor coolsize 2019-05-22 08:48:44 +05:30
Arun Prakash Jana fb4728bc31
Get rid of redundant buffer 2019-05-22 08:48:44 +05:30
Arun Prakash Jana d803521c6d
Fix #264 2019-05-22 08:48:44 +05:30
Arun Prakash Jana 9bd136e8b0
Add license and copyright 2019-05-22 08:48:44 +05:30
Arun Prakash Jana 3157ef1214
Code refactor 2019-05-22 08:48:45 +05:30
Arun Prakash Jana 95eaa636ef
Fix #261 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 3ca86eafbe
Get device info from path 2019-05-22 08:44:19 +05:30
Arun Prakash Jana ad076db56c
Update docs 2019-05-22 08:44:19 +05:30
Arun Prakash Jana da9537bfa6
Update mentions 2019-05-22 08:44:48 +05:30
Bruce Hill b5272a3973
Adding scrolloff option. 2019-05-22 08:44:19 +05:30
Arun Prakash Jana bd653ac91e
Code refactor 2019-05-22 08:44:42 +05:30
Arun Prakash Jana 7cb2d22e9f
Fix build break 2019-05-22 08:44:19 +05:30
Bruce Hill 2297373306
Fix #257: fix the logic for determining which file was clicked. 2019-05-22 08:44:19 +05:30
Arun Prakash Jana c8e54ce4e2
Code refactor 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 30aaa12e6f
Fix #257 2019-05-22 08:44:19 +05:30
Arun Prakash Jana b093d98a6e
Fix regression with opening binary file 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 3e54217ae9
Fix build break 2019-05-22 08:44:19 +05:30
Bruce Hill 0eec240260
Added mouse support 2019-05-22 08:44:19 +05:30
Arun Prakash Jana ece7654221
Use refresh after tmp escape 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 747490a180
Run nmount in a loop 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 0e8cb05045
sync data before ejecting drives 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 21ee3489c2
Add pdfview to view PDF file in PAGER 2019-05-22 08:44:19 +05:30
Arun Prakash Jana b764055314
Update getplugs to set up nlauch 2019-05-22 08:44:19 +05:30
smartmic 5cd8578799
Update Makefile library linking for debug target 2019-05-22 08:44:19 +05:30
Arun Prakash Jana d3fa01f91f
Update link 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 20256bbf99
Fix #249 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 8f1fdcf3e8
Update docs 2019-05-22 08:44:31 +05:30
Arun Prakash Jana b555887ca8
Fix target all to work with target debug 2019-05-22 08:44:19 +05:30
Arun Prakash Jana ee11e78f14
nlaunch: add sleep to wait for child 2019-05-22 08:44:19 +05:30
Arun Prakash Jana a5c5fc97e2
Auto-build every Sat midnight 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 3050639417
Update docs 2019-05-22 08:44:21 +05:30
Arun Prakash Jana b41560572c
Unify tmp file creation 2019-05-22 08:44:19 +05:30
Arun Prakash Jana 8166e0169a
Reformat create link to selection 2019-04-27 18:30:40 +05:30
Arun Prakash Jana ce6fc35929
Refactor dentfill() 2019-04-27 18:30:44 +05:30
Arun Prakash Jana 12a4ab3248 Support readline in open with 2019-04-27 01:53:41 +05:30
Arun Prakash Jana c4f39a200a Modular readline call 2019-04-27 01:41:35 +05:30
Arun Prakash Jana 810cf2e403 Add timeout to warnings 2019-04-27 00:55:28 +05:30
Arun Prakash Jana 2d65a30485
Update docs 2019-04-26 20:13:07 +05:30
Arun Prakash Jana bfe950d082 Make nlaunch independent 2019-04-26 19:08:04 +05:30
Arun Prakash Jana 41c9c82d90 Restore keyboard shortcuts 2019-04-26 18:52:54 +05:30
Arun Prakash Jana 4f15fb765a
Always detach opener
This may affect issue #227 but the defunct processes do not use any memory and exit when nnn exits. I guess that happens because of xdg-open using an intermediate script.

However, if we do not detach xdg-open, the child process is killed when the terminal is closed which is a severe problem.
2019-04-26 08:46:57 +05:30
Arun Prakash Jana f07c8a9dfd Update docs 2019-04-26 08:12:09 +05:30
Arun Prakash Jana cefc4b08a7
Update nmount, troubleshooting 2019-04-25 22:10:10 +05:30
Arun Prakash Jana 9ac9c1bf4f Document #225 2019-04-25 21:20:45 +05:30
Arun Prakash Jana 04bd1ea71d Revert "Fix #225"
This reverts commit 32dde3390a.
2019-04-25 21:11:35 +05:30
Arun Prakash Jana 6186e8b458 Fix check for binary value 2019-04-25 19:02:55 +05:30
Arun Prakash Jana 7467d9f0ed Update docs 2019-04-25 18:20:52 +05:30
Arun Prakash Jana 58e4b443a5 Check binary config values are 1 2019-04-24 20:31:52 +05:30
Arun Prakash Jana 32dde3390a Fix #225 2019-04-23 21:54:59 +05:30
Arun Prakash Jana e973330c91 Fix build break 2019-04-23 19:59:37 +05:30
Arun Prakash Jana adad3f2fe8 Allocate initial path dynamically 2019-04-23 08:50:25 +05:30
Arun Prakash Jana c270b6002f Fix picker mode with file 2019-04-23 01:52:53 +05:30
Arun Prakash Jana cd4009dbf6 Remove redundant change for HOME 2019-04-23 01:13:02 +05:30
Arun Prakash Jana b0132ba440 Remove redundant checks for g_tmpfpath 2019-04-22 23:57:26 +05:30
Arun Prakash Jana 99b1b1f489 SSHFS refinements 2019-04-22 02:14:43 +05:30
Arun Prakash Jana 92bbeb360d
Handle exit status of child process 2019-04-22 01:24:54 +05:30
Arun Prakash Jana 20280e182a
Update docs 2019-04-22 00:45:11 +05:30
Arun Prakash Jana a900b2c4fa Support config dir ~/.config/nnn 2019-04-21 23:59:51 +05:30
Arun Prakash Jana f9264577d2 Support copymode across contexts 2019-04-21 19:53:13 +05:30
Arun Prakash Jana 4ceb0800e4 Fix clang-tidy warning 2019-04-21 19:28:55 +05:30
Arun Prakash Jana 7133971052 Revert "Fix clang error"
This reverts commit 78de6b5752.
2019-04-21 15:41:26 +05:30
Arun Prakash Jana b059e08f3a Reduce statements 2019-04-21 15:40:30 +05:30
Arun Prakash Jana aa1bc78ea7 Update docs 2019-04-21 15:20:59 +05:30
Arun Prakash Jana bd2831498c Fix nmount on blank entry 2019-04-21 12:14:03 +05:30
Arun Prakash Jana 78de6b5752 Fix clang error 2019-04-21 12:05:56 +05:30
Arun Prakash Jana d2865de329 Refactor SSHFS code 2019-04-21 11:55:00 +05:30
Arun Prakash Jana 8e5b27f503
Update docs 2019-04-21 08:39:31 +05:30
Mischievous Meerkat c71056c03d
Merge pull request #248 from elig0n/diff_pgup_ctrlu
Differentiate half-page Ctrl+U/D and pageful PageDN/UP movement keys
2019-04-21 02:10:11 +05:30
elig0n a3eb617dc6 Differentiate half-page Ctrl+U/D and pageful PageDN/UP movement keys 2019-04-20 23:25:15 +03:00
Arun Prakash Jana b16d9dad54 Update docs 2019-04-21 01:28:19 +05:30
Arun Prakash Jana e2dad88a83
Fix lint warning 2019-04-21 00:57:43 +05:30
Arun Prakash Jana 882a17a60f
SSHFS support 2019-04-21 00:47:11 +05:30
Arun Prakash Jana bd29368d4c
Plugin music: play random music from current dir 2019-04-20 18:12:52 +05:30
Arun Prakash Jana e1d8adce2f Plugin ipinfo: fetch IP address and whois info 2019-04-20 13:07:04 +05:30
Arun Prakash Jana d5107d28ac
Plugin getplugs: update nnn plugins 2019-04-19 19:06:03 +05:30
Arun Prakash Jana 430945d420
Plugin nmount: toggle mount status of a device 2019-04-19 00:25:07 +05:30
Arun Prakash Jana 9167192d31
Update docs 2019-04-19 00:14:52 +05:30
Arun Prakash Jana 5cf3471716
Plugins! 2019-04-18 20:32:53 +05:30
Arun Prakash Jana 12ce9451ee
Move nlaunch from user-scripts 2019-04-18 19:41:39 +05:30
Arun Prakash Jana a80ed0554d
Update docs 2019-04-18 15:24:21 +05:30
Arun Prakash Jana b39dd62690
Update docs 2019-04-17 19:11:09 +05:30
Arun Prakash Jana cb5211bc74
Sanitize scripts to change wallpaper 2019-04-17 08:44:36 +05:30
Mischievous Meerkat ef9879da36
Merge pull request #244 from juacq97/master
Added two scripts to change the wallpaper
2019-04-17 08:39:56 +05:30
juacq97 a80d6f18e2 Changed the notify-send message 2019-04-16 20:58:56 -06:00
juacq97 9a5bd47e4a Commented the notify-send lines 2019-04-16 20:55:26 -06:00
juacq97 2261befa3f Changed bash to sh 2019-04-16 20:50:31 -06:00
Juan Adrián Castro Quintana 53b2efb069
Update nitrogen 2019-04-16 20:45:04 -06:00
Juan Adrián Castro Quintana 35403d40df
Update README.md 2019-04-16 20:44:12 -06:00
Juan Adrián Castro Quintana 3b99020523
Update README.md 2019-04-16 20:17:59 -06:00
juacq97 57d2327ee4 Added two scripts to change the wallpaper.
The one named "nitrogen" allow to change the wallpaper using
nitrogen. The one named "pywal" allows to change the wallpaper and the
terminal color scheme using pywal.
Both of them need to put the cursor over an image, there's no need to
select the file with space.
2019-04-16 19:50:16 -06:00
Arun Prakash Jana 39035bd75c
nnn as file manager: more changes
1. Support passing files to nnn
2. Enable debug logs much early
2019-04-16 22:55:59 +05:30
Arun Prakash Jana c5b5181ac4
Update docs 2019-04-15 23:35:19 +05:30
Arun Prakash Jana bb002eeda0
Fix #243 2019-04-15 19:38:07 +05:30
Arun Prakash Jana 6013d024ef
Code reformat 2019-04-13 21:59:34 +05:30
Arun Prakash Jana afafb7ef8f
Fix readline() call sequence 2019-04-13 20:48:18 +05:30
Arun Prakash Jana 5875358884
Update badges 2019-04-13 14:24:59 +05:30
Arun Prakash Jana dc7bcf5bc4
Checkout code for packaging 2019-04-13 14:12:22 +05:30
Arun Prakash Jana b2f7c49687
Update distros 2019-04-13 14:12:22 +05:30
Arun Prakash Jana 00769fb5b7
Remove duplicate builds 2019-04-13 13:30:24 +05:30
Arun Prakash Jana 33446b437c
Schedule weekly builds at 00:00 on Sun 2019-04-13 13:19:31 +05:30
Arun Prakash Jana b42fcc1ba4
Add CircleCI clang all 2019-04-13 12:36:52 +05:30
Arun Prakash Jana d51f889944
Add CircleCI gcc all 2019-04-13 11:26:19 +05:30
Arun Prakash Jana 82e305dc35
Add CircleCI gcc-9 build 2019-04-13 10:57:27 +05:30
Arun Prakash Jana 569b172fc7
Add CircleCI gcc-8 build 2019-04-13 10:43:38 +05:30
Arun Prakash Jana 5675e73dd3
Add CircleCI default build 2019-04-13 10:39:38 +05:30
Arun Prakash Jana c2a0a2ddce
More concise help 2019-04-13 08:30:32 +05:30
Arun Prakash Jana ad4ffb8928
Do not refresh if same dir 2019-04-13 05:40:34 +05:30
Arun Prakash Jana 33365dea52
Shortcut to visit root 2019-04-12 20:36:23 +05:30
Arun Prakash Jana 3e4797f728
Free readline buffer in corner cases 2019-04-12 20:06:29 +05:30
Arun Prakash Jana 7b07e8e0e8
Update help 2019-04-12 15:57:27 +05:30
Arun Prakash Jana 8e016dc7fa
Remove redundant variable 2019-04-12 15:42:33 +05:30
Arun Prakash Jana 85922c3139
Code refactor 2019-04-11 21:49:54 +05:30
Arun Prakash Jana 191eef8554
Retire xdirname() 2019-04-11 19:49:42 +05:30
Arun Prakash Jana 6175f33b75
Shorter NULL checks 2019-04-11 19:27:38 +05:30
Arun Prakash Jana 69328f5b03
Print file opener in debug mode 2019-04-10 07:44:38 +05:30
Arun Prakash Jana 4b32b53a5a
Keep global settings together 2019-04-10 07:44:35 +05:30
Arun Prakash Jana f7dd38d90e
Remember detail/light mode of context 2019-04-09 20:25:17 +05:30
Arun Prakash Jana 7ada9a0b6b
Add comment 2019-04-09 17:02:20 +05:30
Arun Prakash Jana c75e0a886f
Update docs 2019-04-08 22:52:03 +05:30
Mischievous Meerkat 68227f6ae7
Update README.md 2019-04-08 14:53:31 +05:30
Arun Prakash Jana 4997f047cc
Support only scripts directory 2019-04-06 06:54:06 +05:30
Arun Prakash Jana 650e51d2e7
A new image 2019-04-06 06:02:00 +05:30
Arun Prakash Jana f063cb7d34
Update docs 2019-04-04 21:12:27 +05:30
Arun Prakash Jana 1b06828819
Ignore case in version compare 2019-04-01 21:11:23 +05:30
Arun Prakash Jana 4cce877449
Fix issue with file details 2019-04-01 20:14:49 +05:30
Arun Prakash Jana 1238130e78
Copy last file name before refresh 2019-04-01 08:50:54 +05:30
Arun Prakash Jana dc6c6b8ca5
Experimental: save filter status on context switch 2019-04-01 08:42:43 +05:30
Arun Prakash Jana f8de2b2254
Minor changes 2019-03-31 09:56:30 +05:30
Arun Prakash Jana 8791444adc
Update docs 2019-03-29 14:23:55 +05:30
Arun Prakash Jana f609a487b2
Update docs 2019-03-28 21:10:27 +05:30
Arun Prakash Jana c25b539eea
Fix scripts 2019-03-28 20:49:17 +05:30
Mischievous Meerkat 87835a561f
Merge pull request #237 from dbotw/endhome
Recognize End/Home keys for editing
2019-03-25 22:23:13 +05:30
Jens Guenther e856df277c Recognize End/Home keys for editing 2019-03-25 17:29:45 +01:00
Mischievous Meerkat 09b713aa25
Merge pull request #236 from juacq97/add-kdeconnect
Make kdeconnec script POSIX compliant
2019-03-25 12:51:37 +05:30
Juan Adrián Castro Quintana 3b4be9fad3
Deleted blank line
Also, I commented again the three lines about the notifications.
2019-03-24 23:24:34 -07:00
Juan Adrián Castro Quintana 6c27098533
Merge branch 'master' into add-kdeconnect 2019-03-24 22:33:18 -07:00
juacq97 21e259ecd4 Changed the Shell type to POSIX compliant 2019-03-24 22:29:37 -07:00
Arun Prakash Jana 28ef959e71
Update docs 2019-03-25 08:30:26 +05:30
juacq97 8f4e456bb2 make the script POSIX compliant 2019-03-24 16:00:51 -07:00
Arun Prakash Jana b6c66a78c0
Use POSIX compliant sh scripts if possible 2019-03-24 21:11:43 +05:30
Arun Prakash Jana 1bd42c40c6
Add script to invoke pastebinit 2019-03-24 20:33:27 +05:30
Arun Prakash Jana f135a30c0c
Add script to upload a file to transfer.sh 2019-03-24 17:40:15 +05:30
Arun Prakash Jana 0328eafcb9
Add script to resize images in directory 2019-03-24 11:51:33 +05:30
Arun Prakash Jana 653b7d9211
Update docs 2019-03-24 11:51:34 +05:30
Arun Prakash Jana 8be36b9ae2
Update docs 2019-03-23 23:32:46 +05:30
Arun Prakash Jana c695e27783
nlaunch is an independent app launcher 2019-03-23 22:52:57 +05:30
Arun Prakash Jana ebe12e288a
Update docs 2019-03-23 20:29:31 +05:30
Arun Prakash Jana 9f2955435e
Do not subscribe to IN_ATTRIB events 2019-03-23 08:42:34 +05:30
Arun Prakash Jana f16455f3e0
Update docs 2019-03-23 08:38:28 +05:30
Arun Prakash Jana 144682ad49
Add user script to view files in hex 2019-03-23 07:44:34 +05:30
Arun Prakash Jana 00f1857099
Update docs 2019-03-23 07:05:34 +05:30
Arun Prakash Jana fa31775547 Fix #231 2019-03-22 19:30:01 +05:30
Mischievous Meerkat 6d023d7877
Merge pull request #233 from TimB87/master
add CRUX to distrolist
2019-03-22 15:45:46 +05:30
TimB87 52d3364c68
the list alphabetical and commands go in backquotes 2019-03-22 10:45:12 +01:00
TimB87 93379c673a
add CRUX to distrolist 2019-03-22 10:06:43 +01:00
Arun Prakash Jana 0b5a393c25
Update docs 2019-03-22 09:17:33 +05:30
Arun Prakash Jana 7fa6f75542
Update issue template 2019-03-22 08:05:07 +05:30
Arun Prakash Jana 30fb03e726
Fix lint warnings 2019-03-21 22:25:27 +05:30
Arun Prakash Jana 73770bd67c
Disable readability-isolate-declaration check 2019-03-21 04:18:23 +05:30
Arun Prakash Jana dd52acb925
Update docs 2019-03-21 03:39:47 +05:30
Arun Prakash Jana 10dea591f0
Fix #229 2019-03-20 23:52:08 +05:30
Arun Prakash Jana 20321695cc
Diff viewer script using vimdiff 2019-03-20 21:53:03 +05:30
Arun Prakash Jana 10c8344fbd
Update docs 2019-03-20 09:22:44 +05:30
Arun Prakash Jana b0960a2e3d
Break when watch desc becomes 0 2019-03-20 05:50:20 +05:30
Arun Prakash Jana 58a7773755
Remove obsolete help 2019-03-19 21:30:13 +05:30
Arun Prakash Jana ac2a4041b6
Fix build break 2019-03-19 20:13:03 +05:30
Arun Prakash Jana 24b72f65c5
Fix selection symbol (+) lost after a few seconds
This is fix on Linux. Someone has to test it on BSD and fix IF there's
similar issue with the kevent based mechanism.

We need to mask and check if the intended events are received because
some events like IN_UNMOUNT, IN_Q_OVERFLOW or IN_IGNORED may arrive
without knowledge.
2019-03-19 19:39:43 +05:30
Arun Prakash Jana 40b98e8c9e
Prepare for release v2.4 2019-03-19 03:17:22 +05:30
Arun Prakash Jana f30d21b7a4
Fix #227 2019-03-18 19:01:14 +05:30
Arun Prakash Jana 2946a89c00
Clear rest of the line 2019-03-18 06:42:52 +05:30
Arun Prakash Jana 39f84efa55
Do not refresh on mediainfo 2019-03-18 06:42:49 +05:30
Arun Prakash Jana eb7e14a964
Code reformat 2019-03-18 05:24:33 +05:30
Arun Prakash Jana 75c90dbdc6
Add reference to program help for keybinds 2019-03-17 22:06:28 +05:30
Arun Prakash Jana f38692e968
Add readme on nlay 2019-03-17 21:59:36 +05:30
Arun Prakash Jana dfd4a93e11
Update refs to new wiki page 2019-03-17 20:35:55 +05:30
Arun Prakash Jana b4607224e3
Update docs 2019-03-17 20:21:34 +05:30
Arun Prakash Jana f2ee21cdcd
checkpatch warning fixes 2019-03-17 19:40:57 +05:30
Arun Prakash Jana 4fc8d1edd1
Changes for #226 2019-03-17 18:43:21 +05:30
Mischievous Meerkat 3ce1b7dd97
Merge pull request #226 from juacq97/add-kdeconnect
Added a user-script to send selected files using kde-connect.
2019-03-17 18:41:41 +05:30
Arun Prakash Jana e1bd7c6852
Drop the .sh subscripts 2019-03-17 18:40:54 +05:30
juacq97 cfd0769089 Added a user-script to send selected files using kde-connect.
The script uses kdeconnect-cli to send the files to the linked device.
Uses the .nnncp file to cat the selected files.
You can get system notifications using notify-send. This is disabled
by default.
2019-03-17 00:09:15 -07:00
Arun Prakash Jana ff0378c18b
Add issue template 2019-03-16 19:03:17 +05:30
Arun Prakash Jana 208ea1a57e
Update docs 2019-03-16 13:20:56 +05:30
Arun Prakash Jana cdc7d81b60
Change debug file name, close before exit 2019-03-15 22:18:14 +05:30
Arun Prakash Jana 4d6ec9c475
Update docs 2019-03-14 21:26:23 +05:30
Arun Prakash Jana 47d35e1396
Remove redundant check 2019-03-14 20:15:59 +05:30
Arun Prakash Jana 9df78b4e0b
Proceed in filter mode after unhaide 2019-03-14 19:14:54 +05:30
Arun Prakash Jana 577e7693d6
Use persistent table 2019-03-14 18:58:04 +05:30
Arun Prakash Jana 1847a7647f
Persistent warnings 2019-03-14 18:21:02 +05:30
Arun Prakash Jana f9036bd959
Fix #223 2019-03-14 00:12:37 +05:30
Arun Prakash Jana 2849da93e7
Centralized mem free 2019-03-13 23:19:35 +05:30
Arun Prakash Jana c8f080f0b5
Update context switch logic 2019-03-13 22:44:23 +05:30
Arun Prakash Jana 573c61f330
Modular context switch 2019-03-13 20:54:23 +05:30
Arun Prakash Jana df5daf409e
Delay for copy messages 2019-03-13 19:01:22 +05:30
Arun Prakash Jana a70a4bf732
Do not change contents on ESC 2019-03-13 08:33:17 +05:30
Arun Prakash Jana 9b212da6d4
Reduce popup msg delay 2019-03-13 02:55:36 +05:30
Arun Prakash Jana ffc4b7e55d
Don't refresh in filter mode 2019-03-13 02:52:50 +05:30
Arun Prakash Jana a747a1e267
Update docs 2019-03-13 00:05:42 +05:30
Arun Prakash Jana caf77886b8
Redirect stderr and stdout separately 2019-03-12 18:14:50 +05:30
Arun Prakash Jana 54c89ca2a1
Go to start dir key is '@' now 2019-03-12 16:44:58 +05:30
Arun Prakash Jana 69aeeb51d2
GUI app launcher with drop-down menu
`nlauncher` is POSIX compliant. It needs `fzy`.
2019-03-12 16:23:00 +05:30
Arun Prakash Jana 99c1bdd2b7
Minor refactor 2019-03-11 23:56:18 +05:30
Arun Prakash Jana 90f25bf7a8
make :wqopen_max local static 2019-03-11 20:44:45 +05:30
Arun Prakash Jana a94daefcff
Inline printmsg 2019-03-11 20:33:19 +05:30
Arun Prakash Jana 459b2cceb8
Auto-completion for option `-d` 2019-03-11 20:24:44 +05:30
Arun Prakash Jana 2e07a20d23
Option `-d` to show hidden files.
NNN_SHOW_HIDDEN is removed.
2019-03-11 20:21:41 +05:30
Arun Prakash Jana 8882aa8022
No need to use packed structs 2019-03-11 20:08:03 +05:30
Arun Prakash Jana b95d1de4c5
Remove unused macros 2019-03-11 07:48:23 +05:30
Arun Prakash Jana b73ab3373a
Show messages 2019-03-11 07:26:45 +05:30
Arun Prakash Jana 013ab595b2
Smooth screen resize handling 2019-03-11 05:08:39 +05:30
Arun Prakash Jana 5d9bfed5a3
Fix regression with nnn.vim 2019-03-11 00:49:46 +05:30
Arun Prakash Jana d5245ac5ec
List available user-scripts 2019-03-11 00:28:28 +05:30
Arun Prakash Jana 6c6bbce5a4
Add imgur upload script
Source: https://github.com/jomo/imgur-screenshot
2019-03-11 00:06:28 +05:30
Arun Prakash Jana 9ca3f7d06b
Skip shell invocation to run user-scripts 2019-03-10 23:57:27 +05:30
Arun Prakash Jana b9205f1778
Do not delay on single file selection 2019-03-10 22:50:50 +05:30
Arun Prakash Jana ed724dfd0c
Fix build break 2019-03-10 22:40:11 +05:30
Arun Prakash Jana 085483ff6d
Reformat spawn() 2019-03-10 21:44:16 +05:30
Arun Prakash Jana 59db99f75d
Fix build break 2019-03-10 15:09:50 +05:30
Arun Prakash Jana 8b1ef2d9d5
Reformat spawn() 2019-03-10 12:57:41 +05:30
Arun Prakash Jana 616443ffa3
Fix #179 2019-03-10 12:02:59 +05:30
Arun Prakash Jana 1c9934ab7f
Error handling 2019-03-10 07:30:18 +05:30
Arun Prakash Jana c609885763
Special handling for editor 2019-03-10 07:30:18 +05:30
Arun Prakash Jana 4289f13c40
Formatting 2019-03-09 22:04:17 +05:30
Arun Prakash Jana 5f55bde141
A more prominent current indicator 2019-03-09 21:30:16 +05:30
Arun Prakash Jana e0eea57845
Fix regression 2019-03-09 18:18:32 +05:30
Arun Prakash Jana 2a85da09d5
Refactor redraw 2019-03-09 17:03:47 +05:30
Arun Prakash Jana 33768a6cff
Code refactor 2019-03-09 15:45:13 +05:30
Arun Prakash Jana f77d9bef3d
Rename env var 2019-03-09 13:46:18 +05:30
Arun Prakash Jana e13c04b40d
Fix checkpatch warning 2019-03-09 13:36:14 +05:30
Arun Prakash Jana 7a2fdc0e1d
Code refactor 2019-03-09 12:31:24 +05:30
Arun Prakash Jana 5dd5710b31
Support trash-cli to trash 2019-03-09 09:15:04 +05:30
Arun Prakash Jana 090e55c74a
Revert native trashing 2019-03-09 09:15:04 +05:30
Arun Prakash Jana 38fe392c43
Fix #219 2019-03-09 09:14:44 +05:30
Arun Prakash Jana e76a929710
Ignore wrong lint report 2019-03-08 04:49:43 +05:30
Arun Prakash Jana 879beb70cf
Combine checks 2019-03-08 04:49:43 +05:30
Arun Prakash Jana 4885b5fc2f
Avoid buffer copy 2019-03-08 04:49:43 +05:30
Arun Prakash Jana 2d72465e7b
Let user switch to detail mode in case of few columns 2019-03-08 04:49:43 +05:30
Arun Prakash Jana 6709ac01ad
Code reformat 2019-03-08 04:49:43 +05:30
Arun Prakash Jana eb9faf0832
Use packed structures 2019-03-08 04:49:43 +05:30
Arun Prakash Jana 0c63f474a3
Checkpatch fixes 2019-03-08 04:49:43 +05:30
Arun Prakash Jana 197bedc6ff
Show selection in light mode 2019-03-08 04:49:43 +05:30
Arun Prakash Jana b2aea5c619
Fix directory indicator 2019-03-05 20:34:17 +05:30
Arun Prakash Jana 6816e83e83
Code refactor 2019-03-05 20:34:17 +05:30
Arun Prakash Jana aba6557246
Update docs 2019-03-05 20:34:11 +05:30
Arun Prakash Jana ea378f9206
Fix #211 2019-03-03 21:18:15 +05:30
Arun Prakash Jana 7dbb7c224f
Update docs 2019-03-03 13:54:03 +05:30
Arun Prakash Jana 3dc1760630
refactor quitcd 2019-03-03 01:05:13 +05:30
Arun Prakash Jana 602ec0e41b
Fix selection archive 2019-03-03 00:38:37 +05:30
Arun Prakash Jana 36cd5b72a5
Fix clang warning 2019-03-03 00:28:53 +05:30
Arun Prakash Jana 7811518903
Add empty trash key T 2019-03-02 22:28:41 +05:30
Arun Prakash Jana ff2bfff386
trash dir is ~/.local/trash 2019-03-02 18:45:15 +05:30
Arun Prakash Jana 62d1ff278f
Trash file when deleted 2019-03-02 18:32:23 +05:30
Arun Prakash Jana bf7a5f25aa
Modularize cp, mv, rm 2019-03-02 15:09:00 +05:30
Arun Prakash Jana fa46963dd7
Create trash dir 2019-03-02 14:37:57 +05:30
Arun Prakash Jana 3f262910d3
Fix #219 2019-03-02 09:25:43 +05:30
Arun Prakash Jana 764c1fe60c
Use stat to show file details 2019-03-01 15:21:58 +05:30
Arun Prakash Jana df7c023dca
Remove redundant char 2019-03-01 14:17:45 +05:30
Arun Prakash Jana 0593cc165d
Fix #218: add MacPorts to the mix 2019-03-01 14:01:14 +05:30
Arun Prakash Jana 2a571d9b0d
Code refactor 2019-03-01 13:54:40 +05:30
Arun Prakash Jana 11b317020d
Fix lint error 2019-03-01 07:53:22 +05:30
Arun Prakash Jana 51fbd42ac0
Remove obsolete key 2019-03-01 06:51:19 +05:30
Arun Prakash Jana 746e5d0d1f
Fix #141, #196 2019-03-01 06:46:13 +05:30
Arun Prakash Jana 4c8c916ca3
Fix order 2019-02-28 22:40:48 +05:30
Arun Prakash Jana 7d36f54d75
Remove option to disable color 2019-02-28 22:36:52 +05:30
Arun Prakash Jana 0522a426c0
Don't remember initial dir per-context 2019-02-28 22:36:52 +05:30
Arun Prakash Jana f6a1dd0063
Fix Travis break 2019-02-28 22:36:52 +05:30
Arun Prakash Jana 6ba367b6c6
Code reformat 2019-02-28 22:36:52 +05:30
Arun Prakash Jana 3e053e9412
Wild mode for nav-as-you-type 2019-02-28 22:36:54 +05:30
Arun Prakash Jana 26861532a2
Simpler symlink to dir check 2019-02-28 22:36:52 +05:30
Arun Prakash Jana 005c94d1ba
Fix #216: remove outdated PPA 2019-02-28 22:36:52 +05:30
Arun Prakash Jana af8c52b026
Code refatoring 2019-02-28 22:36:52 +05:30
Arun Prakash Jana eeb4b933b0
Update docs 2019-02-28 22:36:48 +05:30
Arun Prakash Jana 963252fcc7
Fix #214: show cp, mv progress with advcpmv 2019-02-25 19:37:23 +05:30
Arun Prakash Jana 04e5d644db
Update docs 2019-02-25 09:20:17 +05:30
Arun Prakash Jana 54af324e85
Set max cols required to show file info 2019-02-25 00:33:09 +05:30
Arun Prakash Jana b411893137
Fix checkpatch warning 2019-02-24 09:28:17 +05:30
Arun Prakash Jana a34354409b
Fix prompt 2019-02-24 08:55:34 +05:30
Arun Prakash Jana 8cccc79b48
Update program help 2019-02-24 08:50:30 +05:30
Arun Prakash Jana 965fc2c876
Just show the last level 2019-02-24 08:06:24 +05:30
Arun Prakash Jana dc6c72f294
Use late binding for notes and scripts 2019-02-24 08:06:16 +05:30
Arun Prakash Jana b8acdaf2e4
Update docs 2019-02-23 21:27:55 +05:30
Arun Prakash Jana 42e36e85ee
Add key 'K' to toggle selection 2019-02-23 20:13:04 +05:30
Arun Prakash Jana 1a8df74749
Show permissions in detail mode 2019-02-23 20:00:31 +05:30
Arun Prakash Jana 9bc5171238
Update ToDo list link 2019-02-23 16:15:29 +05:30
Arun Prakash Jana aa9403862d
nnn follows Linux kernel coding style 2019-02-23 16:08:22 +05:30
Arun Prakash Jana 372dc599e6
Remove unused crc8init function 2019-02-23 14:55:01 +05:30
Arun Prakash Jana d37b67b77b
checkpatch fix: refactor cd on quit 2019-02-23 12:11:53 +05:30
Arun Prakash Jana 59a5db2c90
checkpatch fix: refactor run script code 2019-02-23 11:55:29 +05:30
Arun Prakash Jana 5402e1201c
checkpatch fix: refactor file path copy 2019-02-23 11:51:38 +05:30
Arun Prakash Jana 2ae1cca96a
Single loop coloring 2019-02-23 08:51:21 +05:30
Arun Prakash Jana 078c982f4e
Add troubleshooting section 2019-02-23 07:04:42 +05:30
Arun Prakash Jana 0b7473752e
Fix checkpatch warnings 2019-02-23 01:02:05 +05:30
Arun Prakash Jana a8388ab60b
Add target norl to drop libreadline 2019-02-22 05:35:26 +05:30
Arun Prakash Jana 95d0eb6a17
Use a shorter macro 2019-02-22 05:19:04 +05:30
Arun Prakash Jana f0fa3bba87
Update docs 2019-02-22 04:51:37 +05:30
Arun Prakash Jana e259765682
Use new container for archlinux 2019-02-19 17:20:47 +05:30
Arun Prakash Jana 7bea37e85c
Fix packaging issues. 2019-02-19 16:51:31 +05:30
Arun Prakash Jana 89f0ba8fb4
Fix compilation failure on Trusty 2019-02-19 16:26:36 +05:30
Arun Prakash Jana 5404988bf9
Try Trusty. 2019-02-19 16:22:30 +05:30
Arun Prakash Jana 9ec4234e88
Fix build break 2019-02-19 16:12:20 +05:30
Arun Prakash Jana 1c96ac4ff5
Prepare for release v2.3 2019-02-19 16:08:37 +05:30
Arun Prakash Jana 40cecab4da
Change strings 2019-02-16 12:12:06 +05:30
Arun Prakash Jana b7536dc38c
Update docs 2019-02-15 09:25:04 +05:30
Arun Prakash Jana cf0ea993df
Add comments 2019-02-13 23:41:49 +05:30
Arun Prakash Jana 2ae5864147
Fix file name generation 2019-02-12 21:20:30 +05:30
Arun Prakash Jana d8d4be6aa6
Add test files 2019-02-12 09:08:44 +05:30
Arun Prakash Jana 6d9f4b3710
Terminate string only once 2019-02-12 08:54:42 +05:30
Arun Prakash Jana b99a28a376
Fix #208: cut at correct codepoint for CJK 2019-02-12 03:14:08 +05:30
Arun Prakash Jana 671a0ef772
Use tmp buffer to redraw() 2019-02-11 21:42:30 +05:30
Arun Prakash Jana 8cdba23535
Fix indentation 2019-02-11 21:11:28 +05:30
Arun Prakash Jana 2ab9cfa0d0
Pressing Enter is simpler for some checks 2019-02-11 08:27:19 +05:30
Arun Prakash Jana e177669dc7
Remove ncdu from list of FMs 2019-02-10 21:01:09 +05:30
Arun Prakash Jana 82bb934da8
Fix #207: use correct description 2019-02-10 18:43:29 +05:30
Arun Prakash Jana 22825c0f37
Simplify check 2019-02-10 13:25:54 +05:30
Arun Prakash Jana fc7a21f6e1
Fix build break 2019-02-10 11:36:18 +05:30
Arun Prakash Jana 695dd10f0f
Use y/Y for all confirmations 2019-02-10 10:52:20 +05:30
Arun Prakash Jana 929edaf243
Fix https://github.com/mcchrish/nnn.vim/issues/39
If nnn is started in the picker mode, do NOT use libreadline.
Fallback to the stock mechanism to show the command prompt.
2019-02-10 09:58:13 +05:30
Arun Prakash Jana 543814f5aa
Update docs 2019-02-10 08:45:13 +05:30
Arun Prakash Jana 7b542d0a45
initialize on declaration 2019-02-09 06:03:24 +05:30
Arun Prakash Jana 83615dc72b
Fix build break 2019-02-09 05:18:09 +05:30
Arun Prakash Jana 1253e462b8
Use sigaction 2019-02-09 00:08:46 +05:30
Arun Prakash Jana 027af53ae0
Refresh contents after a ^C 2019-02-08 23:16:06 +05:30
Arun Prakash Jana 9b2966772c
Add verbosity 2019-02-08 21:23:10 +05:30
Arun Prakash Jana b23878847e
Fix build break 2019-02-08 20:56:02 +05:30
Arun Prakash Jana 2f32c32c7b
Support du abort on Ctrl-C 2019-02-08 20:39:09 +05:30
Arun Prakash Jana c07efcacc0
More informative feedback on du 2019-02-08 02:02:09 +05:30
Arun Prakash Jana ee49249b69
Update docs 2019-02-08 01:17:05 +05:30
Arun Prakash Jana e1fa88b24d
Show file name for easier archive naming 2019-02-07 18:37:45 +05:30
Arun Prakash Jana af7e88ab5e
Use env var NNNLVL to track nested level 2019-02-06 22:59:33 +05:30
Arun Prakash Jana 0950f058f1
Archive: check archive mode first 2019-02-06 22:06:36 +05:30
Arun Prakash Jana cdcbb82a91
Update docs 2019-02-06 19:55:15 +05:30
Arun Prakash Jana cc1c694e90
Just print the filepath 2019-02-06 03:21:43 +05:30
Arun Prakash Jana 0153e508f5
Merge pull request #204 from breisa/master
Clarify the difference between copy and select
2019-02-05 21:45:06 +00:00
Christoph 477d5a70eb Clarify the difference between copy and select. 2019-02-05 22:13:05 +01:00
Arun Prakash Jana 10da1ac8dd
Remove redundant env var 2019-02-06 02:31:00 +05:30
Arun Prakash Jana 22b95be810
Use a static CRC8 table 2019-02-06 01:04:35 +05:30
Arun Prakash Jana cebb2469d3
Add option -s to use string filters 2019-02-06 00:38:55 +05:30
Arun Prakash Jana 512d217392
Add version sort -n to auto-completion scripts 2019-02-06 00:13:04 +05:30
Arun Prakash Jana f21ec611cd
Replace backquote with comma as leader key 2019-02-05 23:58:13 +05:30
Arun Prakash Jana 336eca300a
Fix #190: support version sort (option -n) 2019-02-05 23:48:34 +05:30
Arun Prakash Jana b716cac0c9
Use a macro for digit check 2019-02-05 19:29:59 +05:30
Arun Prakash Jana 4016eaeeb3
Update docs 2019-02-04 12:33:50 +05:30
Arun Prakash Jana cc14f5ca16
Update docs 2019-02-03 09:58:59 +05:30
Arun Prakash Jana a161635ecc
Remove file indicator from file name 2019-02-03 09:58:59 +05:30
Arun Prakash Jana 729e775998 Revert "Handle nav cases separately"
This reverts commit 1430993858.
2019-02-01 21:23:27 +05:30
Arun Prakash Jana cc2aaf5877
Change badge color 2019-02-01 19:53:22 +05:30
Georgi Kirilov e5dc6c8750
Don't reset dircolor prematurely 2019-02-01 19:51:19 +05:30
Georgi Kirilov a85268cf79 Don't rebuild on make install 2019-02-01 18:55:56 +05:30
Arun Prakash Jana 8080b6dd67
Do not optimize cur on rm if in filter mode 2019-02-01 09:12:50 +05:30
Arun Prakash Jana ba088196f6
Do not watch dir if entering in filter mode 2019-02-01 08:51:22 +05:30
Arun Prakash Jana b3f7575ef0
Update help 2019-01-31 22:56:00 +05:30
Arun Prakash Jana 8b0fa2be44
Remove key N 2019-01-31 19:28:35 +05:30
Arun Prakash Jana 2128dab98a
Update docs 2019-01-31 07:45:13 +05:30
Arun Prakash Jana d9977c5ea1
Support archiving files in selection 2019-01-31 07:27:08 +05:30
Arun Prakash Jana 2324e8e3e7
Add an api to check if copying possible 2019-01-30 20:59:39 +05:30
Arun Prakash Jana 0fb49390df
natool: support multiple args 2019-01-30 20:38:13 +05:30
Arun Prakash Jana cad067a211
More concise help 2019-01-30 19:32:13 +05:30
Arun Prakash Jana 81318f9218
Remove dir watch before filtering contents 2019-01-30 19:19:14 +05:30
Arun Prakash Jana f3578247eb
Update docs 2019-01-30 08:25:02 +05:30
Arun Prakash Jana ebc81c5d34
Support select all with Y 2019-01-30 02:58:42 +05:30
Arun Prakash Jana b7666a8d5c
Fix crash while writing selection to file 2019-01-30 02:18:12 +05:30
Arun Prakash Jana 94725466a4
Update docs 2019-01-30 01:24:00 +05:30
Arun Prakash Jana 1430993858
Handle nav cases separately 2019-01-30 00:56:27 +05:30
Arun Prakash Jana cfb524ea5e
Fix #200: bind ^P to show command prompt 2019-01-29 23:40:46 +05:30
Arun Prakash Jana b1b1f90d11
Bind ^B to visit pinned dir 2019-01-29 23:37:09 +05:30
Arun Prakash Jana 44e10d40ab
Update ToDo list link 2019-01-29 23:01:12 +05:30
Arun Prakash Jana 0ae1ef656c
Read before write 2019-01-29 22:07:48 +05:30
Arun Prakash Jana 725349976a
Place symlinks to dirs along with dirs 2019-01-29 21:22:28 +05:30
Arun Prakash Jana ebd278e2cd
Add new badge 2019-01-29 00:35:37 +05:30
Arun Prakash Jana 4f03b2d2f0
Add comments 2019-01-28 21:54:48 +05:30
Arun Prakash Jana 2669278a31
Change dir before readline() 2019-01-27 15:11:45 +05:30
Arun Prakash Jana d47be4e89b
Code reformat 2019-01-27 14:38:19 +05:30
Arun Prakash Jana bc6295e7a7
Use ^B to visit pinned directory 2019-01-26 08:28:51 +05:30
Arun Prakash Jana 9c148d5789
Combine SEL_ASIZE with related cases 2019-01-25 22:42:36 +05:30
Arun Prakash Jana 7cc113ec98 Fix build break 2019-01-25 22:16:05 +05:30
Arun Prakash Jana f4f0b9dbba Simpler questions for input 2019-01-25 22:16:05 +05:30
Arun Prakash Jana fbcc543d55
Merge pull request #198 from bijanebrahimi/bugfix-openbsd-compile-error
fixed compile error in OpenBSD
2019-01-25 22:15:45 +05:30
Bijan Ebrahimi b4ee3641f9 fixed compile error in OpenBSD 2019-01-25 20:04:39 +03:30
Arun Prakash Jana 575d8e0e66
1-pass bookmark parsing 2019-01-25 22:03:08 +05:30
Arun Prakash Jana d080ba997d
Remove another getenv() call 2019-01-25 05:12:35 +05:30
Arun Prakash Jana b60cf12760
Remove calls to atoi 2019-01-24 22:34:28 +05:30
Arun Prakash Jana 7c223758ac
Show debug info under DPRINTF 2019-01-24 22:09:41 +05:30
Arun Prakash Jana 14639239de
Remove redundant function call 2019-01-24 21:53:53 +05:30
Arun Prakash Jana 223045fc99
Use global for HOME 2019-01-24 21:45:02 +05:30
Arun Prakash Jana 5e5ca2fc95
Remove extra loop 2019-01-24 21:16:37 +05:30
Arun Prakash Jana 278280a741
Remove redundant calls 2019-01-24 20:21:00 +05:30
Arun Prakash Jana e039b0ee35
Fix build break; rl_menu_complete missing on macOS 2019-01-24 12:23:59 +05:30
Arun Prakash Jana 94e4201dc1
Use libreadline at command prompt 2019-01-24 12:05:13 +05:30
Arun Prakash Jana 31849fd5fb
New key to tkae note ^N 2019-01-23 21:49:56 +05:30
Arun Prakash Jana 7de98faa74
Un-document ^M 2019-01-23 21:39:41 +05:30
Arun Prakash Jana 80f4f54078
Remove shortcuts ^H, ^N, ^P 2019-01-23 21:33:43 +05:30
Arun Prakash Jana cd3124605d
Remove calls to strtoll for numeric sort 2019-01-23 20:05:12 +05:30
Arun Prakash Jana b57e209242 Revert "Use library function for numeric sort"
This reverts commit 1b494b0d26.
2019-01-22 22:40:43 +05:30
Arun Prakash Jana 1b494b0d26
Use library function for numeric sort 2019-01-22 21:30:53 +05:30
Arun Prakash Jana 71cc0afe30
Remove redundant string copy 2019-01-22 20:08:28 +05:30
Arun Prakash Jana 5623cc55bb
Fix regression 2019-01-22 00:13:21 +05:30
Arun Prakash Jana a3dfeafa56
Code reformat 2019-01-22 00:12:10 +05:30
Arun Prakash Jana 7eb376bcc4
Fix mode check 2019-01-21 19:37:00 +05:30
Arun Prakash Jana b07becb176
Remove redundant param 2019-01-21 02:49:05 +05:30
Arun Prakash Jana 76c366147a
Update docs 2019-01-21 02:37:24 +05:30
Arun Prakash Jana b6842d69c5
Use early error checks
Early check for empty file name in populate().
Check access before calling populate().
Drop populate() return type.
2019-01-21 02:22:09 +05:30
Arun Prakash Jana 5301f78fa3
Optimized strcmp() macro 2019-01-21 01:28:57 +05:30
Arun Prakash Jana a8544f2842
Code reformat 2019-01-21 00:16:52 +05:30
Arun Prakash Jana 1958b7ddf7
Re-orient config vars 2019-01-20 23:17:30 +05:30
Arun Prakash Jana 4ff7ddc424
Code refactor 2019-01-20 22:12:43 +05:30
Arun Prakash Jana 1338922697
Remove redundant tmp assignment 2019-01-20 21:47:16 +05:30
Arun Prakash Jana 2b79d237cc
Support no suffix for link name 2019-01-20 19:58:20 +05:30
Arun Prakash Jana c92715a01d
Simplify writing selection 2019-01-20 17:50:49 +05:30
Arun Prakash Jana 231be5ec36
Code reformat 2019-01-20 17:32:44 +05:30
Arun Prakash Jana 8ff56d2c74
Support link creation 2019-01-20 16:59:55 +05:30
Arun Prakash Jana 90597f0e41
Update docs 2019-01-20 08:08:54 +05:30
Arun Prakash Jana fefa956128
Update memory stats 2019-01-19 22:22:44 +05:30
Arun Prakash Jana a8234f26e8
Combine navigation case 2019-01-19 21:50:30 +05:30
Arun Prakash Jana c400a19268
Combine cases
SEL_CDHOME, SEL_CDBEGIN, SEL_CDLAST, SEL_VISIT
2019-01-19 21:22:03 +05:30
Arun Prakash Jana 78048d6ef0
Document macros 2019-01-19 18:20:05 +05:30
Arun Prakash Jana 88a940dcab
Document NNN_TMPFILE 2019-01-19 17:32:43 +05:30
Arun Prakash Jana 366f49e6b3
Take notes with N 2019-01-19 14:51:40 +05:30
Arun Prakash Jana 772619527f
Remove key Backspace 2019-01-19 14:08:21 +05:30
Arun Prakash Jana d2ca475a4c
Update docs 2019-01-19 13:15:37 +05:30
Arun Prakash Jana 5f581ff20a
Key N to switch to context N 2019-01-19 13:09:46 +05:30
Arun Prakash Jana 5e4810b382
Remove keys ^, $ 2019-01-19 12:31:25 +05:30
Arun Prakash Jana 91a31dc61d
Use a more sensible var name 2019-01-19 10:07:04 +05:30
Arun Prakash Jana 867266431f
Code refactor 2019-01-19 09:28:43 +05:30
Arun Prakash Jana 05e910deb0
Fix broken links 2019-01-18 07:39:15 +05:30
Arun Prakash Jana db8d51c504 Update docs 2019-01-18 06:58:16 +05:30
Arun Prakash Jana 5bd2833b12
Merge pull request #194 from TBK/patch-3
Add install command for Alpine Linux
2019-01-18 06:40:30 +05:30
TBK 9975b79f95 Add install command for Alpine Linux 2019-01-18 02:09:41 +01:00
Arun Prakash Jana 5162ae826e
Update video image 2019-01-18 06:36:06 +05:30
Arun Prakash Jana aa7f5256c4
Code reformat 2019-01-17 21:58:07 +05:30
Arun Prakash Jana bf6419d6af
Use a concise help 2019-01-17 20:59:30 +05:30
Arun Prakash Jana 63f5abd054
CURSYM is redundant in detail mode 2019-01-17 20:38:20 +05:30
Arun Prakash Jana 339fcd83f0
Code reformat 2019-01-17 20:26:09 +05:30
Arun Prakash Jana ed934c0e97
Update README 2019-01-17 02:06:18 +05:30
Arun Prakash Jana 5f519841e7
Resurrect NNN_OPENER 2019-01-16 20:11:33 +05:30
Arun Prakash Jana e7e09483b6
Update docs 2019-01-15 15:51:56 +05:30
Arun Prakash Jana 13fb1d8c0e
Merge pull request #191 from szlin/master
Fix warning of implicit declaration of function 'strcasestr'
2019-01-15 14:05:30 +05:30
SZ Lin (林上智) cbef31ce25 Fix warning of implicit declaration of function 'strcasestr'
According to manpage of strcasestr [1], the macro function needs to be added.

[1] https://linux.die.net/man/3/strcasestr

Signed-off-by: SZ Lin (林上智) <szlin@debian.org>
2019-01-15 16:17:07 +08:00
Arun Prakash Jana 389180d139
Change env var name 2019-01-15 10:51:06 +05:30
Arun Prakash Jana c1668cb9dd
Use Ubuntu Xenial image to build 2019-01-13 23:32:04 +05:30
Arun Prakash Jana 098c2acb27
Support substring match in filter mode 2019-01-13 22:49:14 +05:30
Arun Prakash Jana 08520ac80e
Rename config env var 2019-01-11 22:15:51 +05:30
Arun Prakash Jana 5df41255b2 Fix #187
It seems the behaviour of the default opener (xdg-open) varies across platforms
and environments. Details are documented in the issue. To prevent an empty file
from being accidentally opened leading to unexpected behaviour, we are adding a
guard with the message that the empty file should be opened using edit or open
option.
2019-01-11 21:43:57 +05:30
Arun Prakash Jana 625f2f8830
Merge pull request #189 from milisarge/patch-1
Update README.md -Milis
2019-01-11 14:36:09 +05:30
Milli İşletim Sistemi (Milis Linux) d438a665e4
Update README.md
Milis Linux support
2019-01-11 12:01:33 +03:00
Arun Prakash Jana 1235a7a9a1
Fix #188 2019-01-11 08:06:16 +05:30
Milli İşletim Sistemi (Milis Linux) d241e5edcc
Update README.md
Milis Linux support
2019-01-11 02:36:16 +03:00
Arun Prakash Jana 6c141d1bb4
Remove redundant func call 2019-01-10 08:11:23 +05:30
Arun Prakash Jana b40662635d
Update docs 2019-01-07 18:40:30 +05:30
Arun Prakash Jana 51acd70ba0
Add user script to upgrade nnn on Debian 9 Stretch 2019-01-06 23:03:09 +05:30
Arun Prakash Jana b8f6432560
Add Raspberry Pi compilation/board info 2019-01-06 17:38:34 +05:30
Arun Prakash Jana 72e305759e
Don't lose filename on second escape 2019-01-06 03:08:46 +05:30
Arun Prakash Jana ef9e45682e
Reduce delay for escape 2019-01-06 02:53:13 +05:30
Arun Prakash Jana 03ea2252b2
Document prompt clear and exit behaviour 2019-01-06 02:34:37 +05:30
Arun Prakash Jana 98fd5755d1
Map ^V to run custom script 2019-01-06 02:08:07 +05:30
Arun Prakash Jana 6dc151e05d
Quote argument with sh -c 2019-01-06 00:02:55 +05:30
Arun Prakash Jana b811997120
Add a sample command 2019-01-05 22:31:05 +05:30
Arun Prakash Jana 6338466db5
Update docs 2019-01-05 21:14:01 +05:30
Arun Prakash Jana 3667e1e939
Update docs 2019-01-05 20:01:41 +05:30
Arun Prakash Jana b5e62d7ceb
Document picker behaviour 2019-01-05 10:57:11 +05:30
Arun Prakash Jana e87ff1129c
Fix #179 2019-01-04 23:56:02 +05:30
Arun Prakash Jana a40cdadb82
Open sxiv in bg 2019-01-04 23:01:24 +05:30
Arun Prakash Jana b958fd0015
Update user scripts 2019-01-04 22:54:18 +05:30
Arun Prakash Jana 0617c8d90a
Sample scripts to convert NUL to newline 2019-01-04 22:33:55 +05:30
Arun Prakash Jana 244ba9f953
Fix #185 2019-01-04 19:37:57 +05:30
Arun Prakash Jana bd30e41254
Update docs 2019-01-04 08:32:55 +05:30
Arun Prakash Jana 226fb18d96
Change location of copier script 2019-01-03 23:54:31 +05:30
Arun Prakash Jana 3cbb7dc5df
nnn as a file picker 2019-01-03 23:43:35 +05:30
Arun Prakash Jana 5675edebc7
Add sample user scripts 2019-01-03 23:05:51 +05:30
Arun Prakash Jana 9ecab2b30b
Update docs 2019-01-03 22:04:08 +05:30
Arun Prakash Jana 5694ffcbb6
Merge pull request #180 from akkartik/patch-1
Fix a broken link
2019-01-02 22:30:52 +05:30
Kartik Agaram eb0fd1486e Fix a broken link 2019-01-02 08:16:42 -08:00
Arun Prakash Jana 80a3036b5e
Merge pull request #178 from QasimK/document-fish-quitcd
Document how to install fish quitcd function
2019-01-02 16:35:36 +05:30
QasimK 2645dd59c9 Document second method of adding quitcd to fish 2019-01-02 10:46:02 +00:00
QasimK 6b7af57947 Document how to install fish quitcd function
It was not clear that the name of the file should match
the name of the function.
2019-01-01 23:57:38 +00:00
Arun Prakash Jana 243f8c67a9
Update changelog 2019-01-01 09:19:01 +05:30
Arun Prakash Jana 673e3b988f
Update readme 2019-01-01 08:04:20 +05:30
Arun Prakash Jana f9860f1c7f
Prepare for release v2.2 2019-01-01 08:01:48 +05:30
Arun Prakash Jana f0a2b3b48d
Update introduction 2018-12-28 18:49:50 +05:30
Arun Prakash Jana 6973ed37a7
Fix open with 2018-12-27 00:26:56 +05:30
Arun Prakash Jana 4b717b1920
Remove redundant fwd declaration 2018-12-26 17:05:10 +05:30
Arun Prakash Jana a3517b28dc
Fix #173 2018-12-26 16:46:20 +05:30
Arun Prakash Jana 1e932c24a7
New video! Thanks Luke Smith! 2018-12-21 23:53:38 +05:30
Arun Prakash Jana c678c9f786
Remove test code 2018-12-20 23:27:16 +05:30
Arun Prakash Jana 75060f5923
Fix #165 2018-12-20 22:14:26 +05:30
Arun Prakash Jana 6a816a5185
Merge pull request #170 from sjmulder/pr/readme
Readme changes
2018-12-18 04:02:00 +05:30
Sijmen J. Mulder b31f43a2cb Changes suggested by @jarun 2018-12-17 23:21:42 +01:00
Sijmen J. Mulder 532c1435e5 Link pkgsrc package 2018-12-17 17:14:07 +01:00
Sijmen J. Mulder 670ffc06b8 Any wide character curses works
E.g. BSD curses.
2018-12-17 17:12:31 +01:00
Sijmen J. Mulder b4e5b24379 Tweak list of supported platforms
- Add BSD
 - Raspberry Pi is not an OS
 - Non-exhaustive
2018-12-17 17:11:42 +01:00
Arun Prakash Jana 9eec60f8b1
Fix #168 2018-12-17 18:05:36 +05:30
Arun Prakash Jana 5548990b8f
Merge pull request #169 from avelino/master
describe that homebrew is installer for macOS
2018-12-17 17:58:35 +05:30
Arun Prakash Jana 4fb96ba575
Merge pull request #166 from sjmulder/pr/makefile
Makefile portability tweaks
2018-12-17 17:54:49 +05:30
Avelino 0bcde42f4c
describe that homebrew is installer for macOS
Hardly a person to use macOS and this familiar with homebrew search by homebrew
2018-12-17 09:46:32 -02:00
Sijmen J. Mulder 6658af3f66 Revert "Remove CPPFLAGS since C++ is not used"
Mistook CPPFLAGS ("C preprocessor flags") for CXXFLAGS ("C++ flags").

This reverts commit 0956b82d33fb2956da837e6a06a2a6f7216d47c0.
2018-12-17 10:22:36 +01:00
Arun Prakash Jana d360b08eb0
Fix #164 2018-12-17 07:25:26 +05:30
Arun Prakash Jana c8938df8f4
Fix #165 2018-12-17 07:12:50 +05:30
Sijmen J. Mulder 4005a1fa46 Remove CPPFLAGS since C++ is not used 2018-12-16 20:19:08 +01:00
Sijmen J. Mulder 7833781221 Make curses flags configurable 2018-12-16 20:19:08 +01:00
Sijmen J. Mulder 599f4e82b7 Also use pkg-config for regular ncurses 2018-12-16 20:19:08 +01:00
Sijmen J. Mulder f257cda04a Make optimization flags configurable 2018-12-16 20:17:29 +01:00
Arun Prakash Jana 9422a38b0d
Remove redundant static declaration 2018-12-16 21:03:28 +05:30
Arun Prakash Jana 836325f0d4
A better case name 2018-12-16 20:30:44 +05:30
Arun Prakash Jana cc34b977da
Use run a command to launch apps 2018-12-16 20:29:03 +05:30
Arun Prakash Jana b15867143c
Change order of switch cases (1) 2018-12-16 19:45:16 +05:30
Arun Prakash Jana 55f1397cbb
Change order of cases in switch statement. 2018-12-16 15:28:46 +05:30
Arun Prakash Jana cc38369540
use switch case for NNN_SCRIPT 2018-12-16 08:42:25 +05:30
Arun Prakash Jana 94ae45b391
handle script dir with NNN_SCRIPT 2018-12-16 00:24:45 +05:30
Arun Prakash Jana 64efd6528c
Minor modifications 2018-12-15 13:41:33 +05:30
Arun Prakash Jana c4c162f33a
Refresh on empty command 2018-12-14 19:04:20 +05:30
Arun Prakash Jana c26b9abd05
Quick switch on empty command 2018-12-13 21:49:06 +05:30
Arun Prakash Jana f76724e0ef
Update docs 2018-12-11 18:32:25 +05:30
Arun Prakash Jana 31c15dcdca
On entry delete move to previous file 2018-12-10 00:09:05 +05:30
Arun Prakash Jana 55abe4f76e
Update stats 2018-12-09 23:02:58 +05:30
Arun Prakash Jana 0aaa1d771f
Copy file paths at run a cmd prompt 2018-12-09 21:09:55 +05:30
Arun Prakash Jana e7b1215a20
Support run a command 2018-12-09 19:18:00 +05:30
Arun Prakash Jana 80dea7be49
Update completion scripts 2018-12-09 08:36:00 +05:30
Arun Prakash Jana 277df1c5a1
Update man page 2018-12-09 08:18:30 +05:30
Arun Prakash Jana 8eb4cd9e9f
Use force only in case of rm 2018-12-09 08:00:20 +05:30
Arun Prakash Jana efe445910f
Update binary size 2018-12-09 07:48:50 +05:30
Arun Prakash Jana cba1aec8d4
Reformat program help 2018-12-09 07:47:38 +05:30
Arun Prakash Jana aa9c7bac23
Add comments 2018-12-09 07:19:01 +05:30
Arun Prakash Jana 4c7fc6be69
Group more options 2018-12-08 23:03:58 +05:30
Arun Prakash Jana a6976550f1
Use stat to get file details 2018-12-08 19:42:51 +05:30
Arun Prakash Jana 70d1b0d4d8
Ensure script to run is not a directory 2018-12-08 18:44:28 +05:30
Arun Prakash Jana 08cfcfea59
Support run file as executable 2018-12-08 18:22:06 +05:30
Arun Prakash Jana d52482320a
Fix alignment 2018-12-08 17:42:33 +05:30
Arun Prakash Jana 7119310a6a
Ensure NNN_SCRIPT(suffix) exists 2018-12-08 17:38:17 +05:30
Arun Prakash Jana 5d1ca249f9
Simplify show details 2018-12-08 16:45:31 +05:30
Arun Prakash Jana 71fbf80925
Changes for running scripts 2018-12-08 16:31:38 +05:30
Arun Prakash Jana a5755ec855
Fix build break 2018-12-08 15:50:17 +05:30
Arun Prakash Jana d8fa9356e0
Use bool return if applicable 2018-12-08 15:28:55 +05:30
Arun Prakash Jana efc7af0c9c
Selection should not be blocked if no files 2018-12-08 14:54:56 +05:30
Arun Prakash Jana d029918282
Group similar options in browse() 2018-12-08 11:51:22 +05:30
Arun Prakash Jana 1a29b4ef36
Add function for 'which utility' 2018-12-08 09:44:08 +05:30
Arun Prakash Jana 674a58880d
Disable undocumented F2 and F5 2018-12-08 09:02:49 +05:30
Arun Prakash Jana 2c2f1e5eae
Combine more cases 2018-12-08 02:40:04 +05:30
Arun Prakash Jana bdea298bb5
Reload contents after launch 2018-12-08 01:42:30 +05:30
Arun Prakash Jana 572094c838
Fix wrong prompt 2018-12-08 01:11:55 +05:30
Arun Prakash Jana 0d435614b2
Fix documentation issues 2018-12-07 21:49:53 +05:30
Arun Prakash Jana 050fb84921
Document lftp integration 2018-12-07 09:28:02 +05:30
Arun Prakash Jana 2d8afc8de7
Support launching cli utility too 2018-12-07 00:43:49 +05:30
Arun Prakash Jana b59a21b57e
Handle argument ordering in spawn() 2018-12-06 22:57:59 +05:30
Arun Prakash Jana 82a58800d3
Refactor code 2018-12-06 21:45:29 +05:30
Arun Prakash Jana abfdc76e43
Instructions on how to get selection at prompt 2018-12-06 20:31:32 +05:30
Arun Prakash Jana cd23c60f56
Update docs 2018-12-06 07:20:54 +05:30
Arun Prakash Jana 4de4298ffd
Map ^I to context cycle 2018-12-05 20:43:00 +05:30
Arun Prakash Jana 47aa3366c2
Handle starting ^ at filter prompt 2018-12-05 05:35:06 +05:30
Arun Prakash Jana e26c21ce0b
Make ^T shortcut for nav-as-you-type.
The code for Tab and ^I are same when capture din getch().
2018-12-05 05:21:22 +05:30
Arun Prakash Jana 7ae6e481bc
Remove redundant use of regex 2018-12-05 05:01:29 +05:30
Arun Prakash Jana 4df1ae6311
Detect filetype using file output 2018-12-05 04:40:01 +05:30
Arun Prakash Jana 60de561b07
Remove redundant structure member 2018-12-05 04:26:19 +05:30
Arun Prakash Jana 45ce06cc8d
Update docs 2018-12-05 03:40:31 +05:30
Arun Prakash Jana 8b25593777
Use a generic comment 2018-12-04 21:09:56 +05:30
Arun Prakash Jana ebf64d5a4a
Shorter error message 2018-12-04 20:29:51 +05:30
Arun Prakash Jana c101fcd769
Use MAX as macro suffix 2018-12-04 18:21:01 +05:30
Arun Prakash Jana 21a491e660
Option -c is gone 2018-12-04 09:28:04 +05:30
Arun Prakash Jana 971f0ddda1
Match context index with directory color 2018-12-04 06:31:14 +05:30
Arun Prakash Jana 36b7b433f9
Per-context directory color 2018-12-03 21:44:33 +05:30
Arun Prakash Jana 4c576cfded
Update docs 2018-12-03 09:23:03 +05:30
Arun Prakash Jana 230664596e
Ask to create new context on TAB 2018-12-02 22:53:07 +05:30
Arun Prakash Jana a6dac8d22b
Update stats in docs 2018-12-02 22:17:36 +05:30
Arun Prakash Jana 8735f1691a
Support TAB to cycle contexts 2018-12-02 06:11:03 +05:30
Arun Prakash Jana d2c7a5a7cb
Update docs 2018-12-02 05:16:52 +05:30
Arun Prakash Jana e61917d75e
Add link to Cygwin wiki page 2018-12-01 21:56:27 +05:30
Arun Prakash Jana 5b42d9d8ea
Update copier script and docs 2018-12-01 21:51:59 +05:30
Arun Prakash Jana d1b4cc2beb
Add options to force file operations 2018-12-01 14:27:05 +05:30
Arun Prakash Jana bbe353c6a2
Use bool where applicable 2018-12-01 13:14:46 +05:30
Arun Prakash Jana 0afb792291
Fix #156: Support selection across directories, contexts 2018-12-01 10:29:28 +05:30
Arun Prakash Jana 50a4449417
Show arg to EDITOR, PAGER & SHELL 2018-12-01 08:12:34 +05:30
Arun Prakash Jana 4b9796eae0
Fix #157: support one combined arg for EDITOR, PAGER and SHELL 2018-12-01 08:06:34 +05:30
Arun Prakash Jana d7da4acde0
Split EDITOR & PAGER options, concise NNN_USE_EDITOR logic. 2018-12-01 07:42:37 +05:30
Arun Prakash Jana 08bd6f1bcb
No need to initialize sel 2018-12-01 07:23:29 +05:30
Arun Prakash Jana ef361294db
Get pager with arg 2018-12-01 07:19:56 +05:30
Arun Prakash Jana 419f365e88
Better msg if nothing in selection 2018-12-01 06:41:18 +05:30
Arun Prakash Jana 5cec8d9038 Refactor code to get editor args 2018-12-01 05:58:37 +05:30
Arun Prakash Jana 5ad89a8c51
Merge pull request #158 from davidjharder/patch-1
Add Solus to README
2018-12-01 04:53:03 +05:30
David Harder df64258c53
Add Solus to README
`nnn ` is now packaged for Solus.
2018-11-30 13:40:56 -06:00
Arun Prakash Jana 9403d52720
Use the same term 2018-12-01 00:21:18 +05:30
Arun Prakash Jana 33b22b8560
Fix #155: do not discard seleciton on Enter 2018-11-30 20:52:07 +05:30
Arun Prakash Jana 4ef2230fca
Add sample command for Termux 2018-11-30 06:19:19 +05:30
Arun Prakash Jana ac1264e044
Fix indentation 2018-11-29 20:40:49 +05:30
Arun Prakash Jana 9876948a46
Clear picker file on cancel 2018-11-29 20:35:41 +05:30
Arun Prakash Jana 04b0a38f68
vim plugin: Enter clears selection and picks cuntry 2018-11-29 19:43:53 +05:30
Arun Prakash Jana 91901b4f30
Update docs 2018-11-29 09:19:26 +05:30
Arun Prakash Jana 32ca8ca133
Simplify getting editor env var 2018-11-29 01:21:08 +05:30
Arun Prakash Jana 052cd282f4
Add xargs as external dep 2018-11-29 00:17:09 +05:30
Arun Prakash Jana eb4b8cfaa2
Update mentions 2018-11-28 20:43:44 +05:30
Arun Prakash Jana 5cae446aaf
xargs supports -a on Linux 2018-11-28 17:53:28 +05:30
Arun Prakash Jana d8df13f665
Remove .js from mime list 2018-11-28 09:25:01 +05:30
Arun Prakash Jana 8aa72a40a3
Use the -I option on OS X to identify file mime 2018-11-28 09:23:03 +05:30
Arun Prakash Jana 4b7833ed98
individual rm: replace -I with -i 2018-11-28 08:21:38 +05:30
Arun Prakash Jana 8cba83f43f
Return 1 on unrecognized option 2018-11-28 08:18:01 +05:30
Arun Prakash Jana 2a4cc85659
cp, mv: use replacement string with xargs 2018-11-28 05:57:27 +05:30
Arun Prakash Jana 8ac68fcc5b
Fix #147: arg should be at the end as it can be NULL 2018-11-28 05:14:12 +05:30
Arun Prakash Jana 0a8970a811
Fix #150: treat js file as text 2018-11-28 04:59:15 +05:30
Arun Prakash Jana 361c18064e
xargs: use -o, rm: change -I to -i 2018-11-28 04:27:33 +05:30
Arun Prakash Jana b7eb509ffb
cp: change -r to -R, --preserve=all to -p 2018-11-28 04:16:14 +05:30
Arun Prakash Jana c0b9703831
Fix #147: support one argument to editor 2018-11-28 03:45:57 +05:30
Arun Prakash Jana 0a21d90ad5
Fix #143: support copy to clipboard 2018-11-27 22:37:06 +05:30
Arun Prakash Jana 70d371c214
Fix #143 2018-11-27 21:25:21 +05:30
Arun Prakash Jana ab61bb03d0
Eliminate newline from selection buffer 2018-11-27 21:06:43 +05:30
Arun Prakash Jana 28eb6a6312
Use keybind ^T to go to next context 2018-11-27 18:37:31 +05:30
Arun Prakash Jana 338b3be707
Remove file path quoting 2018-11-27 18:29:46 +05:30
Arun Prakash Jana 06ff738b4c
Use ^B to go to next context 2018-11-27 04:01:51 +05:30
Arun Prakash Jana 7db777756f
Option to disable file open on Right and `l` 2018-11-27 02:06:57 +05:30
Arun Prakash Jana c3b2ace9fd
Merge pull request #142 from josalmi/patch-1
Replace single dot with source for fish shell
2018-11-26 18:16:13 +05:30
Joni Salmi 2623f688f2
Replace single dot with source for fish shell
Single dot has been deprecated and can cause issues with users on newer version: https://github.com/fish-shell/fish-shell/issues/310
2018-11-26 14:21:59 +02:00
Arun Prakash Jana 9cc627459d
Rename macro 2018-11-25 21:06:47 +05:30
Arun Prakash Jana d065666205
Use ^G to discard seleciton and exit in vim plugin mode 2018-11-25 02:21:22 +05:30
Arun Prakash Jana afd8b64d56
Update docs 2018-11-25 01:45:00 +05:30
Arun Prakash Jana 0abe07f9bd
vim plugin has a new project page 2018-11-24 21:11:26 +05:30
Arun Prakash Jana 78614f9fbf
Merge pull request #138 from KillTheMule/patch-3
Add neovim support
2018-11-24 18:30:32 +05:30
KillTheMule 7207b1d61f
Add neovim support 2018-11-24 13:20:50 +01:00
Arun Prakash Jana f1a9d15756
Update docs 2018-11-24 11:09:13 +05:30
Arun Prakash Jana 25a307f75e
Update ToDo list # 2018-11-24 08:19:55 +05:30
Arun Prakash Jana 075c0cb935
Handle DEL in rename prompt (Mac) 2018-11-24 03:06:01 +05:30
Arun Prakash Jana ab4c6ff363
Fix #135:wq 2018-11-24 01:26:18 +05:30
Arun Prakash Jana 4dc6cb83ff
Update docs 2018-11-24 01:10:44 +05:30
Arun Prakash Jana cc5e49a9a9
Fix #133: Add nnn-picker.vim plugin 2018-11-24 01:03:45 +05:30
Arun Prakash Jana fb64e7e2dd
option -p: pick last selected entry if no explicit select 2018-11-24 00:40:03 +05:30
Arun Prakash Jana 6853487109
Fix lint issue 2018-11-23 23:12:13 +05:30
Arun Prakash Jana 9e974be3dd
Add option -p for file picker 2018-11-23 22:41:47 +05:30
128 changed files with 23695 additions and 3950 deletions

122
.circleci/config.yml Normal file
View File

@ -0,0 +1,122 @@
version: 2
jobs:
compile:
docker:
- image: ubuntu:22.04
working_directory: ~/nnn
environment:
CI_FORCE_TEST: 1
parallelism: 4
steps:
- run:
command: |
apt update -qq
DEBIAN_FRONTEND="noninteractive" TZ="America/New_York" apt-get -y install tzdata
apt install -y --no-install-recommends software-properties-common wget gpg-agent shellcheck
apt install -y --no-install-recommends git make pkg-config libncurses-dev libreadline-dev
apt install -y --no-install-recommends gcc-9 gcc-10 gcc-11 gcc-12
apt install -y --no-install-recommends clang-11 clang-12 clang-13 clang-14 clang-15 clang-tidy-15
- checkout
- run:
command: |
export CFLAGS=-Werror
make clean
echo
echo "########## gcc-9 ##########"
CC=gcc-9 make strip
ls -l nnn
make clean
echo
echo "########## gcc-10 ##########"
CC=gcc-10 make strip
ls -l nnn
make clean
echo
echo "########## gcc-11 ##########"
CC=gcc-11 make strip
ls -l nnn
make clean
echo
echo "########## gcc-12 ##########"
CC=gcc-12 make strip
ls -l nnn
make clean
echo
echo "########## clang-11 ##########"
CC=clang-11 make strip
ls -l nnn
make clean
echo
echo "########## clang-12 ##########"
CC=clang-12 make strip
ls -l nnn
make clean
echo
echo "########## clang-13 ##########"
CC=clang-13 make strip
ls -l nnn
make clean
echo
echo "########## clang-14 ##########"
CC=clang-14 make strip
ls -l nnn
make clean
echo
echo "########## clang-tidy-15 ##########"
clang-tidy-15 src/* -- -I/usr/include -I/usr/include/ncursesw
echo "########## shellcheck ##########"
find plugins/ -type f ! \( -name "*.md" -o -name "*-mac" \) -exec shellcheck {} +
package-and-publish:
machine: true
working_directory: ~/nnn
steps:
- checkout
- run:
name: "auto-generate packages"
command: |
# Create dist directory if it doesn't exist
mkdir ./dist
# Clean up
rm -rf ./dist/*
# Pack source
git archive -o ../${CIRCLE_PROJECT_REPONAME}-${CIRCLE_TAG}.tar.gz --format tar.gz --prefix=${CIRCLE_PROJECT_REPONAME}-${CIRCLE_TAG#v}/ ${CIRCLE_TAG}
# Use latest installed python3 from pyenv
export PYENV_VERSION="$(pyenv versions | grep -Po '\b3\.\d+\.\d+' | tail -1)"
#pip install packagecore
#packagecore -c misc/packagecore/packagecore.yaml -o ./dist/ ${CIRCLE_TAG#v}
# Move source pack to dist
mv ../${CIRCLE_PROJECT_REPONAME}-${CIRCLE_TAG}.tar.gz ./dist/
- run:
name: "publish to GitHub"
command: |
go install github.com/tcnksm/ghr@latest
ghr -t ${GITHUB_API_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -replace ${CIRCLE_TAG} ./dist/
workflows:
version: 2
CircleCI:
jobs: &all-tests
- compile
nightly:
triggers:
- schedule:
cron: "0 0 * * 6"
filters:
branches:
only:
- master
jobs: *all-tests
publish-github-release:
jobs:
- package-and-publish:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/

View File

@ -1,14 +0,0 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,readability-*,modernize-*,bugprone-*,misc-*,-misc-unused-parameters,google-runtime-int,-llvm-header-guard,fuchsia-restrict-system-includes,-clang-analyzer-valist.Uninitialized,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-alpha.*,-readability-magic-numbers,-readability-braces-around-statements'
WarningsAsErrors: '*'
HeaderFilterRegex: '.*(?<!lookup3.c)$'
FormatStyle: 'file'
CheckOptions:
- key: readability-braces-around-statements.ShortStatementLines
value: '1'
- key: google-runtime-int.TypeSufix
value: '_t'
- key: fuchsia-restrict-system-includes.Includes
value: '*,-stdint.h,-stdbool.h'
...

3
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,3 @@
# These are supported funding model platforms
github: jarun

42
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,42 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
`nnn` comes with excellent documentation (including a Troubleshooting section). If you have a _How to do x_ question, it may have already been answered. Wiki: https://github.com/jarun/nnn/wiki
If it looks like a local environment issue, please try to debug yourself. Debugging local setup issues is not our top priority.
If you are looking for a new feature or program option, ensure you have the correct version with the feature installed. Refer to the release notes to confirm.
Before opening an issue, please try to reproduce on latest master. The bug you noticed might have already been fixed.
Useful links:
- compile `nnn` from source - https://github.com/jarun/nnn/wiki/Usage#from-source
- debugging `nnn` - https://github.com/jarun/nnn/wiki/Developer-guides#debugging-nnn
If the issue can be reproduced on master, log it.
Please provide the environment details. **If that's missing, the issue will be closed without any cited reason.**
If we need more information and there is no communication from the bug reporter within 7 days from the date of request, we will close the issue. If you have relevant information, resume discussion any time.
--- PLEASE DELETE THIS LINE AND EVERYTHING ABOVE ---
#### Environment details (Put `x` in the checkbox along with the information)
- [ ] Operating System:
- [ ] Desktop Environment:
- [ ] Terminal Emulator:
- [ ] Shell:
- [ ] Custom desktop opener (if applicable):
- [ ] Program options used:
- [ ] Configuration options set:
- [ ] Plugins are installed
- [ ] Issue exists on `nnn` master
#### Exact steps to reproduce the issue

4
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,4 @@
contact_links:
- name: Idea, Enhancement, Question, Support
url: https://github.com/jarun/nnn/discussions
about: If you have a question, need support or want to discuss new ideas then please open a discussion thread.

49
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,49 @@
name: GitHubCI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
macOS-gcc:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Compile with gcc
env:
CC: gcc
run: |
export CFLAGS="$CFLAGS -Werror"
make clean
make
make clean
macOS-clang:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Compile with clang
env:
CC: clang
run: |
# see: https://github.com/actions/setup-python/issues/577
brew update || true
brew install llvm || true
brew unlink python@3.11 && brew link python@3.11
export PATH="/usr/local/opt/llvm/bin:$PATH"
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export CFLAGS="$CFLAGS -Werror"
make clean
make
make clean
clang-tidy src/* -- -I/usr/include
ubuntu-patches:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Compile patches with gcc
env:
CC: gcc
run: |
make checkpatches

42
.github/workflows/codeql.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: "CodeQL"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "11 23 * * 3"
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ cpp, python ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2
if: ${{ matrix.language == 'cpp' || matrix.language == 'python' }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"

26
.github/workflows/lock.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: 'Lock threads'
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
permissions:
issues: write
pull-requests: write
discussions: write
concurrency:
group: lock-threads
jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: '30'
issue-lock-reason: ''
pr-lock-inactive-days: '30'
pr-lock-reason: ''

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
*.o
*.dSYM
nnn
src/icons-generated*.h
src/icons-hash-gen

View File

@ -1,58 +0,0 @@
language: c
sudo: required
services:
- docker
env:
global:
- REPO=nnn
matrix:
include:
# Access more recent gcc and clang via a Trusty image
- os: linux
dist: trusty
compiler: gcc
- os: linux
dist: trusty
compiler: clang
- os: osx
compiler: gcc
- os: osx
compiler: clang
install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [[ "$CC" == "clang" ]]; then brew update; brew install llvm; export PATH="/usr/local/opt/llvm/bin:$PATH"; fi; fi
script:
- export CFLAGS=-Werror;
- make clean; make;
- make clean;
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [[ "$CC" == "clang" ]]; then clang-tidy src/* -- -I/usr/include; fi; fi
before_deploy:
- cd ..
- rm -rf $REPO/.git
- tar -czf $REPO-${TRAVIS_TAG}.tar.gz $REPO
- cd $REPO
- unset CFLAGS
- sudo apt-get update -qy
- sudo apt-get install -qy python3 python3-pip
- sudo python3 -m pip install --upgrade pip
- sudo python3 -m pip install --upgrade packagecore setuptools
- packagecore -o dist/ "${TRAVIS_TAG#v}"
- mv ../$REPO-${TRAVIS_TAG}.tar.gz dist/
deploy:
provider: releases
api-key:
secure: bdw73zBeBEZtDZGEyFpAksnpwLHTBaC7VP1pONmnsXv4qmMcynASz0LfE4krEdAsRnvxQvqPZXviy/SZ3bmaLpVQmJIC1uRWIyOBE6K/7ddf+wfLy+1uO9EPd/zDF/D28Xy8QJLDGDZI08BY5Fist4XowyvtdW3GRwwDL7TwyZyigr0fkqLJwYcqCpojsHsjXjhkpGZqB5XRztaJ4kIEVz8du03ZU1l5kA9lI8Pdk9+mntOOt6emlaJl+Wr81QkwA8TvGPlZ1VP/+h9YCtlRy/4OuiU+bg5/Atxjh8M6rsq+WpZ3ZdYbR6x5vP78p9f6TsJa4ymGhhW6MhYrKPwdT4oITzZcOXJl6AEoIvrWHQWLY7K3WaEfRbT+DODnXks0ToFKls7wyWfi/AHI0ejeDD5Na5/XhY0jdVYOVvovoY2n8LBaqRTFJDYKoCbJ1S+6myUvvmFVwiZWcgOv9gVX1aaIl4wh+XuzUtPDJTcJtUOE8Q2MWl0bdYVtEkHVRznPXN5u3odrDaeTD3vo+pEaEpshLoSKhCyyWvslSzN7T98ez3aw3KFXoFhXPEg5MEJWy7u359MaVwJIsOGUDAFhy/Y7h83LjQYnu8cmX2wuVrQIRIlGVB0f10GYZzPffZz98I/T0xv75NzpyRs31/wMxvdXz35c8m/yTup4kAkG/1s=
file_glob: true
file:
- dist/*
skip_cleanup: true
on:
condition:
- "$TRAVIS_OS_NAME == linux"
- "$CC == gcc"
tags: true
repo: jarun/nnn

900
CHANGELOG
View File

@ -1,3 +1,903 @@
nnn v4.9 Elixir
2023-08-27
- config option `NNN_ARCHMNT` to specify archive mounter utility
- key <kbd>^y</kbd> to jump to next young file
- filter adjustment when opening context from plugin
- properly update mode after `chmod`
- pre-fill selected file name to create link if sel is preferred over hovered
- fix crash when `PWD` is empty
- make `quitcd.bash_zsh` POSIX-compliant
- `nmount` - support `udiskctl` as default
- `preview-tui` - support wezterm split size percentage
- `preview-tui` - move to bash for environment manipulation through arrays
- `fzopen` - handle empty selection
- `finder` - use default path to find
- add icons for `djvu` files
- support Nerd Fonts v3.0.0 and above (older versions are broken by v3.0.0)
-------------------------------------------------------------------------------
nnn v4.8 Spritz
2023-04-13
- show total size (key <kbd>S</kbd>) of non-filtered selection in a directory
- fix tilde (~) handling in file name
- plugin `.nmv` now respects `-u` flag
- env var `$NNN_PREFER_SELECTION` exported to all plugins
- support for wezterm in `preview-tui`
- create new file or directory (tree) on startup
- run command as plugin now supports exported variables
- use `"$nnn"` anywhere when running command as plugin
- set defaults for some prompts on <kbd>Enter</kbd>
- improve archive, rename and create new workflows
- optimize link creation
- allow overwriting regular files on new empty file creation
- add patch for colemak keyboard (existing renamed to colemak-dh)
- add correct check for Wayland in clipboard plugins
- add quitcd script for nushell
- plugin `kdeconnect` - send multiple files
- plugin `preview-tui`: add `chafa` as preferred image viewer, multiple fixes
- plugin `nmount` - misc. improvements
- add icon for jxl files
-------------------------------------------------------------------------------
nnn v4.7 Cuba libre
2022-11-24
- fix <kbd>^N</kbd> not working sometimes (#1449)
- fix file remove confirmation prompt
- bring back `atool` as the default archive handler
- add option `-B` to use `bsdtar` as the archive utility
- find and list mode improvements
ntinue even if max paths/data size limit is exceeded
eed improvements
pport listing maximum 16K paths of 64 MiB of data
- key <kbd>J</kbd> to jump to an entry or relative offset from current entry
- prefill the hard link creation prompt when there's a single target (#1507)
- documented workaround for docker container crash (#1407, #1476)
- plugin `imgview`: handle arguments as strings (#1509)
- plugin `wallpaper`: support Wayland (#1512)
- plugin `upload`: handle selection using `ffsend` (#1523)
- add Rust icons (#1502)
-------------------------------------------------------------------------------
nnn v4.6 Absinthe
2022-07-26
- icon handling overhaul (#1432, #1436)
- better performance, memory usage and reduced binary size
- emoji support for supporting distros and terminals (#1346)
- open the target directory of symlinked bookmarks (#1353)
- enable show hidden when a hidden file is passed as argument
- add Colemak-DH layout keybinds to patch framework (#1421)
- set `bsdtar` as the default archive utility
- support 4 byte unicode keybinds (#1428)
- enable directory auto-enter during filter operation (`-A` to disable)
- enable filter prompt inside the bookmark/plugin dirs
- show volume usage information in help
- add new icon colors for mp4 and flac files
- use `stat -x` for file details on *BSD and macOS (#1389)
- interpret suffix `$nnn` when paging (#1355)
- disable key <kbd>e</kbd> (edit file) in explorer mode (#1394)
- fix double order chars on filter case match change
- `.cbcp`: more verbose message on paste without a selection
- plugin `preview-tui`: scale-up kitty previews
- plugin `preview-tui`: account for ueberzug offset
- plugin `preview-tui`: support `SPLIT_SIZE` for preview pane (#1431)
- plugin `autojump`: support z.lua
- new Makefile target `shellcheck` to verify plugins
-------------------------------------------------------------------------------
nnn v4.5 Cachaça
2022-04-26
- disable filter info if file details (option `-i`) enabled
- open previous active context on context quit
- switch <kbd>^J</kbd> and <kbd>+</kbd> functionality:
- <kbd>+</kbd>: toggle file selection
- <kbd>^J</kbd>: toggle auto-jump on file open
- allow symlink creation with name `@` to a single file (#1345)
- clear selection on successful operation at native prompt with "%j" (#1330)
- reverse timestamps of entries modified/created within 5 minutes
- avoid using non-portable `xargs` flags on macOS (#1299)
- quitcd script for Elvish shell > 0.17.0 (#1344)
- plugin `openall` to open selected files together (#1333)
- plugin `gitroot` to jump to git root directory from a subtree
- plugin `gsconnect` to send the selected files to Android using gsconnect
- icon for opus and webp files
- `preview-tui` - fix gif conversion and whitespace name
- `preview-tui` - add support for windows terminal split
- `preview-tui` - djvu file previews
- `nuke` - add support for `imv` when named _imv_
- `gsconnect` - support connection to multiple devices
- export `NNN_INCLUDE_HIDDEN` to plugins (#1308)
- respect `NNN_TRASH` in `.nmv` (#1306)
- add GNU sed as a dependency with support for env var `SED`
- use bold `>` to point at current entry in detail mode
- add 2 spaces after icons for better visibility
- documentation refresh
- make option `O_NOSORT` to load directories unsorted on entry
-------------------------------------------------------------------------------
nnn v4.4 Tequila
2021-11-23
- support macOS iterm2 in plugin preview-tui (#1196)
- use selection at native command prompt with `%j` and `%J`
- docs - https://github.com/jarun/nnn/wiki/concepts#special-variables
- scroll strings longer than columns in rename/new prompts (#1213, #279)
- batch rename symlink targets in listing mode (#1214)
- option for recursive rename in plugin .nmv (#1186)
- more frequent checks for cancellation during du (#1236)
- picker mode: enable auto-proceed
- picker mode: don't pick hovered file on <kbd>Enter</kbd> if selection exists
- picker mode: fix issue in plugin `fzopen` when used to pick files
- send file to explorer FIFO on double left click instead of opening it
- new neovim plugin [nnn.nvim](https://github.com/luukvbaal/nnn.nvim)
- nvim-only, featuring explorer mode (`-F` flag)
- explorer mode for [nnn.vim](https://github.com/mcchrish/nnn.vim#explorer)
- remove option `-w`: always place HW cursor on current entry
- accept link name when linking a single target (#1201)
- option `-i` to show current file information in info bar
- force GNU sed on *BSD and Solaris
- add `nsxiv` support to nuke, preview-tabbed and imgview (#1230)
- fix preview-tui without `-a` (#1208)
- pass `pts` in env var for preview-tui to use in `tput` (#1235)
- disable editing file in picker mode (#1183)
- save session in picker mode (#1190)
- use nerd icons for gitstatus patch (#1220)
-------------------------------------------------------------------------------
nnn v4.3 Martini
2021-09-29
- cool ASCII art logo in the help screen
- add `bookmarks` directory for flexible symlinked bookmarks
- new key <kbd>B</kbd> to add a symlinked bookmark for current dir
- special variables `$dN`, `$fN` available for plugins/prompt/shell to access
dir/hovered file in each context
- config `NNN_ORDER` to set directory-specific ordering
- show/hide hidden files as per context state in plugin based batch rename
- retain search filter history for plugin `finder`
- sync multiple instances of `nnn` after operation on selection
- signal CWD change to terminal via OSC-7 (#1147)
- save complete per-context filter when saving sessions
- disable symlink resolution for paths in `NNN_BMS` and arg `PATH`
- do not end selection mode on running plugins/prompt/shell
- plugin `bookmarks` replaced by symlinked bookmarks support
- list open locations in active contexts in help page
- make option `O_MATCHFLTR` to discard filter key if no match
- configurable `NNN_TMPFILE` to _cd on quit_
- disable auto marking directories (use <kbd>-</kbd>)
- picker mode improvements
- open tty for input if `STDIN` is non-tty
- truncate output file before writing
- do not double select a file on <kbd>Enter</kbd>
- legacy macOS (< 10.12.0) support
- no redraw during du calculation, show processed dir name
- plugin `xdgdefault`: add dmenu support
- user patch `restorepreview`: close/restore `preview-tui` for internal edits
-------------------------------------------------------------------------------
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
-------------------------------------------------------------------------------
nnn v3.6 Nina
2021-03-16
- REPL command prompt (<kbd>Esc</kbd> or <kbd>Enter</kbd> to exit)
- invert selection with <kbd>A</kbd>
- option `-u` removed (always prefer selection to hovered)
- visit start dir on <kbd>@</kbd> when start path is a file
- exit filter mode and redraw on <kbd>^L</kbd> if no last filter
- plugin `fzcd` now selects the chosen file (#876)
- `ueberzug` support in plugin `preview-tui`
- new plugin `preview-tui-ext` with extra preview support
- clear selection after successful plugin invocation
- add method to sync subshell `$PWD` in WIki
- clear selection on single file deletion (#812)
- copy between instances not working (#864)
- plugin `togglex` to toggle exe mode of a selection (#813)
- fix `memccpy()` buffer overlap fault on macOS (#786)
- show `0 selected` msg on cp/mv with empty selection (#855)
- fix frozen terminal caused by opener (#858)
- migrate macOS CI to GitHub workflows, retire Travis
-------------------------------------------------------------------------------
nnn v3.5 Freddie
2020-11-17
- compile-in Alexey Tourbin's QSORT macro
- support Nerd Font patched icons [`make O_NERD=1`]
- auto-generate static binaries with icons support
- audit and adapt all plugins for macOS
- enhance plugin `dups` to delete duplicates interactively
- plugin `autojump` now supports `jump` and `zoxide`
- support `gio trash` to Trash [`export NNN_TRASH=2`] (#740)
- quit program on double <kbd>Esc</kbd> in normal mode (#775)
- <kbd>^Space</kbd> replaces <kbd>^K</kbd> for range selection/clear selection
- show selection symbol (`+`) next to filename in detail mode (#741)
- error & quit on <kbd>Q</kbd> if no selection, else pick to stdout
- repeat <kbd>^T</kbd> to cycle sort by time, size and clear
- option `-U` to show user & group info in status bar
- option `-J` to disable auto-proceed on select (#713)
- option `-D` to show dirs in context color with `NNN_FCOLORS`
- honor option `-C` for context colors
- show indicators if more entries above/below listing (#744)
- show missing utility name in flash msg (#753)
- exit `preview-tabbed` on <kbd>^C</kbd> (#727)
- invoke GNU sed (_gsed_) on macOS (#728)
- fix HW cursor moves to wrong line (#735)
- fix rollover bug with multiline scroll (#743)
- fix input stream not listed with `-s`/`-S` (#777)
- fix locker not being invoked
- make target `upx` for additional binary compression
- compress auto-generated static binaries with upx
- make variable `O_NOSSN` to compile out sessions
- make variable `O_NOUG` to compile out user & group info
-------------------------------------------------------------------------------
nnn v3.4 Emilia
2020-08-18
- icons with icon-specific colors (thanks @KlzXS)
- enhanced `NNN_COLORS` with xterm 256 colors support
- new colorscheme with `NNN_FCOLORS` (file type specific colors)
- switch `-C` to force earlier colorscheme (dirs follow context color)
- updates for Haiku (thanks @CodeforEvolution)
- fix XFS navigation issue (thanks @ucs1)
- optimize archive extension matching on file open
- show location in context color
- support `host[:dir]` format for remote mounts
- clear selection after copy
- support traversal on file/dir creation
- show selection in reverse in status bar
- show status bar indicator `H` when hidden files are listed
- show and confirm archive command output
- support _cd on quit_ in picker mode
-------------------------------------------------------------------------------
nnn v3.3
2020-07-14
- subdir `mounts` for remote and archive mounts
- remove mount point on successful unmount of remote/archive
- show error and prompt user if `cp`/`mv`/`rm` operation fails
- support absolute/relative paths in cp/mv as
- mark current path automatically on archive/remote mount
- mark current path automatically on target file visit in _find and list_ mode
- option `-C` to place HW cursor on hovered for screen readers and braille displays
- option `-u` to use selection (if available) and skip `current/sel` prompt
- key <kbd>Alt+Esc</kbd> to clear filter prompt and redraw
- support <kbd>Esc</kbd> to cancel remove operation
- `gpge` & `gpgd`: encrypt and decrypt with GPG
- `blknew`: create new files and directories in bulk
- `preview-tui`
- unified to support `tmux`/`kitty`/`xterm`/`$TERMINAL`
- auto-determine split orientation based on terminal height and width
- provision to use [`scope.sh`](https://github.com/ranger/ranger/blob/master/ranger/data/scope.sh) and [`pistol`](https://github.com/doronbehar/pistol)
- various other improvements
- `upload`: send to Firefox Send if [`ffsend`](https://github.com/timvisee/ffsend) is found
- `hexview`: add [`hx`](https://github.com/krpors/hx) as alternative hex viewer
- `nuke` and `imgview`: add [`imv`](https://github.com/eXeC64/imv) as alternative image viewer
- add find (with `fd`) and grep (with `rg`) examples in plugins doc
- key <kbd>Esc</kbd> or left click to resend hovered file path to `NNN_FIFO`
- show `+` instead of `s` in status bar on selection
- <kbd>F5</kbd> removed (misfit for toggle hidden), <kbd>^S</kbd> removed (often masked, redundant)
- handle abnormal program termination and remove NNN_PIPE and/or NNN_FIFO
- clear selection after successful batch rename, link creation
- make option `O_CTX8` for 8 contexts (NOT backward compatible with 4 contexts)
- fix issue with child window resize (see #656)
- fix issue with `NNNLVL` on macOS (see #639)
- fix issue with restoring session with du/au enabled
-------------------------------------------------------------------------------
nnn v3.2
2020-05-26
- an official logo
- previews
- config `NNN_FIFO` to write hovered file paths a previewer can read
- plugin `preview-tabbed`: [tabbed](https://tools.suckless.org/tabbed)/xembed based file previewer
- plugin `preview-tui`: simple TUI file previewer in tmux/xterm
- plugin `preview-kitty`: preview using kitty terminal's capabilities
- [live preview](https://github.com/jarun/nnn/wiki/Live-previews) configuration example
- find & list
- send list of files from (cmd run as) plugin to `nnn`
- plugin `finder`: find/fd/fzf/grep/ripgrep/fzf (in subtree) and list in `nnn`
- <kbd>Right</kbd> or <kbd>l</kbd> on symlink in list dir takes to target file
- persistent session option `-S` [for disk usage, run `nnn -T d` (see help)]
- hover on the file when a file path is passed as positional argument
- go to first file or match with <kbd>'</kbd> (followed by <kbd>'</kbd> or <kbd>char</kbd>)
- config `NNN_SEL` to specify custom selection file
- config `NNN_LOCKER` to specify locker program
- dim file details in detail mode
- call `chdir()` on directory change
- option `-l`: number of lines to move on mouse scroll
- graphical [keybind map](https://github.com/jarun/nnn/wiki/Usage#graphical-map)
- let `NNN_COLORS` override `NO_COLOR`
- plugins
- option `-P`: run plugin by key at start
- run plugins with <kbd>Alt+key</kbd>
- allow `NNN_PIPE` usage by commands run as plugin
- input format to `NNN_PIPE`: `<ctxcode><opcode><data>` (see plugins doc)
- set `ctxcode` to `+` for smart context usage (next inactive, else current)
- `getplugs` to fetch plugins by installed version of `nnn`
- plugin `mimelist`: list files by mime type in subtree
- plugin `bookmarks`: named bookmarks using symlinks
- plugin `nbak`: backup `nnn` config
- `nuke` adds lowdown as alternative markdown viewer
- several plugin improvements
- fix broken screen on resize (see #520)
- fix broken version sort (see #550)
- fix list and pipe modes not working together
- fix multiple issues with listing files
- fix `@` shown in detail mode for symlink to dir
- fix listing files directly under `/`
- move to `-std=c11`
-------------------------------------------------------------------------------
nnn v3.1
2020-04-13
- unlimited bookmarks and plugin keys
- status bar text in context color
- support config `NO_COLOR` to disable colors
- config `NNN_OPTS` to specify binary options to `nnn`
- config `NNN_MCLICK` to emulate configurable key
- toggle selection on right click
- ignore hard links when calculating disk usage
- dim (hard/sym) link names (symlink to file has `@`)
- more special keys at empty filter prompt in _type-to-nav_
- key <kbd>></kbd> to export file list
- option `-F` to show fortune in help and settings screen
- option `-T` to specify sort order (obsoletes `-v`)
- option to clear sort order
- key <kbd>T</kbd> to change time type (access/change/mod)
- `.nmv` - internal fully-functional batch renamer plugin
- make var `O_NOBATCH` to disable native batch renamer
- `nuke` & `imgview` - open all images in directory sxiv
- `nuke` - open log files in vi
- plugin `x2sel` - system clipboard to selection copier
- plugin `fzy` - cd using z database
- plugin `fzopen` - support `FZF_DEFAULT_COMMAND`
- create new context on TAB without prompt
- hover and connect by dir name (within config dir)
- move to next entry on current file delete
- on single file copy/move, select the copied/moved file
- option `-f` to use readline history file (off by default)
- use `s` in status bar to indicate selection in progress
- make var `O_NOMOUSE` to disable mouse support
- do not store `NNN_TRASH` and `-Q` in config/session
- add sample .desktop file for XDG compatible DEs
- rename _nav-as-you-type_ to _type-to-nav_ mode
- fix PCRE case-insensitive regex search
- fix no error msg when filter length limit exceeded
- fix static package generation
- fix broken abort message when started in du-mode
- fix filter lost on context switch in non _type-to-nav_ mode
- fix broken readline prompt
- fix long strings treated as action keys in filter prompt
- fix `NNNLVL` not reset when spawned shell is exited
-------------------------------------------------------------------------------
nnn v3.0
2020-02-12
- take list of files as input and show
- option `-e` replaces `NNN_USE_EDITOR`
- option `-t` replaces `NNN_IDLE_TIMEOUT`
- PCRE support
- more readline bindings for native prompts
- run GUI app as plugin
- attempt lazy unmount when regular unmount fails
- fix unmount on macOS: use `umount`
- detect `sshfs` and `rclone` to prompt intelligently
- auto-proceed on file open (toggle key <kbd>+</kbd>)
- quit with error code on <kbd>Q</kbd>
- additional key <kbd>F5</kbd> to toggle hidden
- key <kbd>e</kbd> to edit in EDITOR (back on multiple user requests)
- option to edit list of files in selection is changed to <kbd>E</kbd>
- do not end selection on redraw
- `nuke`: [`glow`](https://github.com/charmbracelet/glow) as Markdown viewer
- `nuke`: refactor, handle some common video types by extension
- file name removed from status bar
- static Makefile target
- generate, upload static package on release
- fix crash on entering empty dir, then Down
- fix keypresses lost when showing message
- fix #227: `nnn` creates xdg-open zombies
-------------------------------------------------------------------------------
nnn v2.9
2020-01-15
- all keybinds and options reviewed by the team and frozen (see #422)
- reduced number of keybinds
- greatly improved help screen readability
- `nuke`: sample opener (CLI-only by default) and plugin
- fast line redraws instead of full screen refresh (thanks @annagrram)
- auto archive handling by extension (see config `NNN_ARCHIVE`)
- Lead key simplified to bookmark key (<kbd>b</kbd> or <kbd>^/</kbd>)
- single key to toggle order (<kbd>t</kbd> or <kbd>^T</kbd>)
- plugins
- `.cbcp`: copy selection to system clipboard (internal, program option `-x`)
- `.ntfy`: show noti on cp, mv, rm completion (internal, program option `-x`)
- `autojump`: navigate using autojump
- `upload`: paste text files to http://ix.io, upload rest to https://file.io
- all fuzzy plugins modified to support both `fzf` and `fzy`
- more control on plugins
- prefix `-` to skip directory refresh after running (cmd as) plugin
- suffix `*` to skip confirmation after running cmd as plugin
- indicate range selection mode with `*`
- list keys at bookmark and plugin key prompts
- visit to pinned dir like bookmarks (Bookmark key followed by <kbd>,</kbd>)
- toggle executable (key <kbd>*</kbd>)
- show mime along with file details
- more special keys at empty filter prompt:
- apply the last filter (<kbd>^L</kbd>)
- toggle between string and regex (<kbd>/</kbd>)
- toggle case-sensitivity (<kbd>:</kbd>)
- retain filter on <kbd>Esc</kbd>, <kbd>Up</kbd>, <kbd>Down</kbd>
- show filter details when filter is on
- remove option to run filter as cmd on prompt key (can be disruptive)
- program options
- option `-x`: enable notis and copy selection to system clipboard
- option `-g`: regex filters (string filter is default now)
- option `-Q`: quit program without confirmation
- option `-s`: load session
- option `-n`: start in nav-as-you-type mode
- option `-v`: version sort
- option `-V`: show program version
- option `-A`: disable dir auto-select
- ISO 8601 compliant date in status bar
- ported to Haiku OS (thanks @annagrram)
- sort only filtered entries (to avoid directory refresh)
- fix `getplugs` to install hidden files
- fix several selection issues (see #400)
- fix detail mode not restored on loading session
- fix symlink to directory not auto-selected
- fix regex error on partial regex patterns
- fix symlink not shown if `stat(2)` on target fails
- fix flags when spawning a CLI opener as default FM
- fix issue with stat flag on Sun (no support for `dirent.d_type`)
- fix current file in current context not saved correctly in session
- signed source distribution on release
- simplified debugging with line numbers in logs
-------------------------------------------------------------------------------
nnn v2.8.1
2019-12-05
- Fix always archiving current file
- More elaborate docs on selection changes
-------------------------------------------------------------------------------
nnn v2.8
2019-12-04
- sessions (thanks @annagrram)
- `rclone` support for remote access (mount _any_ cloud storage!!!)
- toggle selection with <kbd>Space</kbd> or <kbd>^J</kbd>
- ignore events during selection so the `+` symbol is not lost
- run custom (non-shell-interpreted) commands like plugins
- configure _cd-on-quit_ as the default behaviour
- create parent dirs for new files and dirs, duplicate a file/dir anywhere
- _copy/move as_ workflow (thanks @KlzXS)
- edit , flush selection buffer (thanks @KlzXS)
- support xargs with minimal options (as in BusyBox) (thanks @KlzXS)
- changed the key to size sort to <kbd>z</kbd>
- additional key <kbd>]</kbd> to show command prompt
- mount archives using `archivemount`
- smoother double click handling
- program option `-R` to disable rollover at edges
- keybind collision checker (for custom keybind config) (thanks @annagrram)
- show size of file in bytes in status bar in disk usage mode
- pass unresolved path as second argument (`$2`) to plugin
- mechanism for plugins to control active directory
- all binary questions are confirmed by <kbd>y</kbd> or <kbd>Y</kbd>
- plugins
- some plugins renamed
- integrated `shellcheck` in CI, POSIX-compliance fixes (thanks @koalaman)
- `getplugs` - detect modifications in exiting plugin file (thanks @KlzXS)
- `drag-file` & `drop-file`: drag & drop files using dragon
- `gutenread`: browse, download and read from Project Gutenberg
- `suedit` - edit file with superuser permissions
- `fzhist` - fuzzy select commands from history, edit and run
- `fzcd` - change to a fuzzy-searched directory
- `rename` - batch rename directory or selection using qmv or vidir
- `pskill` - fuzzy list a process or zombies by name and kill
- `exetoggle` - toggle executable status of hovered file
- `treeview` - informative tree output with file permissions and size
- `chksum` - recursively calculate checksum for files in hovered directory
- `fzopen` renamed to `fzopen`
- `imgsxiv` instructions added to browse and rename images
- create link to current file
- additional key <kbd>;</kbd> to execute plugin
- more explicit force removal message
- force non-detachable internal edits in $EDITOR (option `-E`)
- export current file as `$nnn` (instead of `$NN`)
- fix file open failure from browser when configured as default FM
-------------------------------------------------------------------------------
nnn v2.7
2019-10-06
- plugins for image preview, image and video thumbnails
- redesigned selection workflow
- drop path prefix for files in current dir for selection based archives
- custom direct keybinds for plugins
- libreadline `.history` file moved to `nnn` config directory
- export current entry as `$NN` at command prompt
- more informative status bar in light/detail modes
- auto-proceed to next file on single file select
- path clipping for long paths
- completely revamped wiki
- new program options:
- `-a` to use file access time throughout the program
- `-c` to indicate cli-only opener
- `-f` to run filter as command on <kbd>^P</kbd>
- `-o` replaces config `NNN_RESTRICT_NAV_OPEN`
- `-t` replaces config `NNN_NO_AUTOSELECT`
- `-r` replaces config `NNN_OPS_PROG`
- plugin changes:
- `vidthumb` - show video thumbnails in terminal
- `mediainf` - show media info (decoupled as a plugin)
- `notes` - open a quick notes file/dir in `$EDITOR` (decoupled as a plugin)
- `dups` - list duplicate files in the current directory
- `oldbigfile` - list large files by access time
- `moclyrics` - show lyrics of the track currently playing in MOC
- `uidgid` list uid and gid of files in directory
- `mocplay` - now detects if a track is playing or not
- `organize` - categorize files and move to respective directories
- `pastebin` - now uses ix.io paste service
- `fzy-edit` - merged into `fzy-open`
- `viuimg` - fix directory view
- `checksum` - fixed POSIX compliance issues
- `boom` - play music in MOC
- keybind changes:
- select entry: <kbd>Space</kbd> and <kbd>^J</kbd>
- select range (or clear selection): <kbd>m</kbd> and <kbd>^K</kbd>
- select all in dir: <kbd>a</kbd>
- list selection: <kbd>M</kbd>
- <kbd>^N</kbd> replaces <kbd>^T</kbd> to toggle _nav-as-you-type_
- <kbd>Shift TAB</kbd> to reverse context cycle
- <kbd>'</kbd> to jump to first file in dir
- <kbd>S</kbd> for du, <kbd>A</kbd> for apparent du
- additional key <kbd>:</kbd> to run plugin
- additional key <kbd>F2</kbd> to rename file
- additional key <kbd>F5</kbd> to redraw
- quit context key <kbd>Leadq</kbd> is removed
- Leader key combinations:
- <kbd>Lead'</kbd> to jump to first file in dir
- <kbd>Lead]</kbd> go to next active context
- <kbd>Lead[</kbd> go to prev active context
- <kbd>Lead.</kbd> toggle show hidden files
- improved duplicate file workflow
- improved batch rename workflow when a selection exists
- removed the wild load option (`-w`)
- removed quick notes (added plugin `notes`)
- fix #225 (thanks @KlzXS)
- fix `tar`/`bsdtar` always creating tar archives (and not by suffix)
- fix single mouse click to select file not working
- fix symlink to dir removed on batch rename
- fix detail mode not set with program option `-S`
-------------------------------------------------------------------------------
nnn v2.6
2019-08-06
- new plugins
- view image or browse a directory of images in terminal
- show image thumbnails
- PDF and text file reader
- calculate and verify checksum of selection or file
- append (and play) selection/dir/file music in MOC
- variable bitrate mp3 ringtone generator
- split current file or join selection
- better experience on Termux (and touch based devices)
- mouse scrolling support (with ncursesw6.0 and above)
- tap/left click to visit parent, toggle nav-as-you-type mode
- light mode set as default
- show status bar and use reverse video in light mode
- changed program options
- `-d`: detail mode
- `-H`: show hidden files
- `-l` is retired
- support `XDG_CONFIG_HOME`
- support <kbd>/</kbd> as an additional Leader key when filter is on
- sort by file extension
- use zip/unzip/tar if atool/bsdtar not found
- support duplicate file (key <kbd>^R</kbd>, same as rename file)
- new config option `NNN_SSHFS_OPTS` to specify `sshfs` options
- restrict opening 0 byte files (`NNN_RESTRICT_0B` is obsolete)
- critical defects fixed
- fix #276 - crash with variable length inotify event handling
- fix #285 - hang after deleting/moving current directory
- fix #274 - a broken prompt on empty input with libreadline
- fix #304 - list selection from another instance
- `cmatrix` as locker fallback
- wait for user input after running a command from prompt
- scrolloff set to 3 from 5
-------------------------------------------------------------------------------
nnn v2.5
2019-05-27
- mouse support
- new location for config files - `~/.config/nnn`
- plugin dir location: `~/.config/nnn/plugins`
- selection file `.nnncp` is now `~/.config/nnn/.selection`
- plugins:
- pdfview: view a PDF in pager
- nmount: (un)mount a storage device
- ndiff: file and directory diff for selection
- hexview: view a file in hex
- imgresize: batch resize images to desktop resolution
- ipinfo: check your IP address and whois information
- transfer: upload a file to transfer.in
- pastebin: paste the contents of a text file to paste.ubuntu.com
- boom: play random music from a directory
- nwal: set an image as wallpaper using nitrogen
- pywal: set selected image as wallpaper, change terminal color scheme
- getplugs: update plugins
- SSHFS support
- support `bsdtar`, simplify `patool` integration
- native batch rename support (`vidir` dependency dropped)
- changes to support [configuration](https://github.com/jarun/nnn/wiki/nnn-as-default-file-manager) as the default file manager
- per-context detail/light mode
- case-insensitive version compare
- shortcut to visit `/` - <kbd>`</kbd> (backtick)
- vim-like scrolloff support
- <kbd>^D</kbd> & <kbd>^U</kbd>: scroll half page, <kbd>PgDn</kbd> & <kbd>PdUp</kbd>: scroll full page
- fix selection across contexts
- recognize <kbd>Home</kbd> and <kbd>End</kbd> keys at prompt for editing
- fix broken program option `-b`
- POSIX-compliant user-scripts (wherever possible)
- `NNN_SCRIPT` is retired (replaced by plugins)
-------------------------------------------------------------------------------
nnn v2.4
2019-03-19
- FreeDesktop.org compliant trashing
- mark selected entries with `+`
- _wild_ mode (option `-w`, key <kbd>^W</kbd>) for _nav-as-you-type_
- POSIX-compliant GUI app launcher with drop-down menu (key <kbd>=</kbd>)
- new scripts:
- upload image to imgur
- send selection to Android using kdeconnect-cli
- show permissions in detail mode
- cp, mv progress bar for Linux (needs advcpmv) [BSD, macOS shows on <kbd>^T</kbd>]
- make libreadline an optional dep (reduces memory usage)
- minimize the number of redraws
- handle screen resize gracefully
- option `-d` to show hidden files (`NNN_SHOW_HIDDEN` is removed)
- additional key <kbd>K</kbd> to toggle selection
- change visit start dir key to <kbd>@</kbd>
- option `-C` to disable colors removed
- per-context initial directory replaced by program start dir
- marker msg when spawning new shell removed
- rename debug file to `nnndbg`
-------------------------------------------------------------------------------
nnn v2.3
2019-02-19
- file picker mode
- repo of user-contributed scripts
- substring search for filters (option `-s`)
- version sort (option `-n`)
- disk usage calculation abort with <kbd>^C</kbd>
- create sym/hard link(s) to files in selection
- archiving of selection
- show dir symlinks along with dirs in top
- fixed CJK character handling at prompts
- key `N` (1 <= N <= 4) to switch to context N
- bring back `NNN_OPENER` to specify file opener
- env var `NNN_NOTE` and keybind <kbd>^N</kbd> for quick notes
- handle multiple arguments in VISUAL/EDITOR
- show the current directory being scanned in `du` mode
- select all files (<kbd>Y</kbd>)
- show command prompt (<kbd>^P</kbd>)
- key <kbd>,</kbd> replaces <kbd>`</kbd> as alternative Leader Key
- keybind for visit pinned directory is now <kbd>^B</kbd>
- additional key <kbd>^V</kbd> to run or select custom script
- use libreadline for command prompt
- reduce delay on <kbd>Esc</kbd> press
- config option to avoid unexpected behaviour on 0-byte file open (see #187)
- rename config option `DISABLE_FILE_OPEN_ON_NAV` to `NNN_RESTRICT_NAV_OPEN`
- keys removed - <kbd>$</kbd>, <kbd>^</kbd>, <kbd>Backspace</kbd>, <kbd>^H</kbd>, <kbd>^P</kbd>, <kbd>^M</kbd>, <kbd>^W</kbd>, <kbd>`</kbd>
-------------------------------------------------------------------------------
nnn v2.2
2019-01-01
What's in?
- (neo)vim plugin [nnn.vim](https://github.com/mcchrish/nnn.vim)
- macOS fixes
- Fix issues with file copy, move, remove
- Handle <kbd>Del</kbd> in rename prompt
- Pass correct `file` option to identify mime
- Support selection across directories and contexts
- Offer option `force` before file remove
- Keys <kbd>Tab</kbd>, <kbd>^I</kbd> to go to next active context
- Per-context directory color specified by `$NNN_CONTEXT_COLORS`
- Option `-c` is removed
- Option `-C` to disable colors
- Choose script to run from a script directory
- Run a command (or launch an application)
- Run file as executable (key <kbd>C</kbd>)
- Documentation on lftp integration for remote file transfers
- Support a _combined_ set of arguments to `$EDITOR`, `$PAGER` and `$SHELL`
- Handle > 2 GB files on 32-bit ARM
- Env var `$DISABLE_FILE_OPEN_ON_NAV` to disable file open on <kbd>Right</kbd> or <kbd>l</kbd>
- `NUL`-terminated file paths in selection list instead of `LF`
- Better support for Termux and Cygwin environments
- Remapped keys
- <kbd>^I</kbd> - go to next active context
- <kbd>^T</kbd> - toggle _navigate-as-you-type_
-------------------------------------------------------------------------------
nnn v2.1
2018-11-23

View File

@ -2,7 +2,7 @@ BSD 2-Clause License
Copyright (c) 2014-2016, Lazaros Koromilas <lostd@2f30.org>
Copyright (c) 2014-2016, Dimitris Papastamos <sin@2f30.org>
Copyright (c) 2016-2018, Arun Prakash Jana <engineerarun@gmail.com>
Copyright (c) 2016-2023, Arun Prakash Jana <engineerarun@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without

348
Makefile
View File

@ -1,34 +1,250 @@
VERSION = 2.1
VERSION = $(shell grep -m1 VERSION $(SRC) | cut -f 2 -d'"')
PREFIX ?= /usr/local
MANPREFIX ?= $(PREFIX)/share/man
DESKTOPPREFIX ?= $(PREFIX)/share/applications
DESKTOPICONPREFIX ?= $(PREFIX)/share/icons/hicolor
STRIP ?= strip
PKG_CONFIG ?= pkg-config
INSTALL ?= install
CP ?= cp
CFLAGS ?= -O3
CFLAGS += -Wall -Wextra -Wno-unused-parameter
CFLAGS_OPTIMIZATION ?= -O3
O_DEBUG := 0 # debug binary
O_NORL := 0 # no readline support
O_PCRE := 0 # link with PCRE library
O_NOLC := 0 # no locale support
O_NOMOUSE := 0 # no mouse support
O_NOBATCH := 0 # no built-in batch renamer
O_NOFIFO := 0 # no FIFO previewer support
O_CTX8 := 0 # enable 8 contexts
O_ICONS := 0 # support icons-in-terminal
O_NERD := 0 # support icons-nerdfont
O_EMOJI := 0 # support emoji
O_QSORT := 0 # use Alexey Tourbin's QSORT implementation
O_BENCH := 0 # benchmark mode (stops at first user input)
O_NOSSN := 0 # disable session support
O_NOUG := 0 # disable user, group name in status bar
O_NOX11 := 0 # disable X11 integration
O_MATCHFLTR := 0 # allow filters without matches
O_NOSORT := 0 # disable sorting entries on dir load
# User patches
O_COLEMAK := 0 # change key bindings to colemak compatible layout
O_GITSTATUS := 0 # add git status to detail view
O_NAMEFIRST := 0 # print file name first, add uid and guid to detail view
O_RESTOREPREVIEW := 0 # add preview pipe to close and restore preview pane
T_ICONS := 0 # test if multiple icons options are set and fail
# convert targets to flags for backwards compatibility
ifneq ($(filter debug,$(MAKECMDGOALS)),)
O_DEBUG := 1
endif
ifneq ($(filter norl,$(MAKECMDGOALS)),)
O_NORL := 1
endif
ifneq ($(filter nolc,$(MAKECMDGOALS)),)
O_NORL := 1
O_NOLC := 1
endif
ifeq ($(strip $(O_DEBUG)),1)
CPPFLAGS += -DDEBUG
CFLAGS += -g3
endif
ifeq ($(strip $(O_NORL)),1)
CPPFLAGS += -DNORL
else ifeq ($(strip $(O_STATIC)),1)
CPPFLAGS += -DNORL
else
LDLIBS += -lreadline
endif
ifeq ($(strip $(O_PCRE)),1)
CPPFLAGS += -DPCRE
LDLIBS += -lpcre
endif
ifeq ($(strip $(O_NOLC)),1)
ifeq ($(strip $(O_ICONS)),1)
$(info *** Ignoring O_NOLC since O_ICONS is set ***)
else ifeq ($(strip $(O_NERD)),1)
$(info *** Ignoring O_NOLC since O_NERD is set ***)
else ifeq ($(strip $(O_EMOJI)),1)
$(info *** Ignoring O_NOLC since O_EMOJI is set ***)
else
CPPFLAGS += -DNOLC
endif
endif
ifeq ($(strip $(O_NOMOUSE)),1)
CPPFLAGS += -DNOMOUSE
endif
ifeq ($(strip $(O_NOBATCH)),1)
CPPFLAGS += -DNOBATCH
endif
ifeq ($(strip $(O_NOFIFO)),1)
CPPFLAGS += -DNOFIFO
endif
ifeq ($(strip $(O_CTX8)),1)
CPPFLAGS += -DCTX8
endif
ifeq ($(strip $(O_ICONS)),1)
ICONS_INCLUDE = icons-generated-icons-in-term.h
CPPFLAGS += -DICONS_IN_TERM -DICONS_INCLUDE=\"$(ICONS_INCLUDE)\"
ifeq ($(strip $(T_ICONS)),1)
$(error Choose only one system for icons (O_ICONS, O_NERD or O_EMOJI))
endif
T_ICONS := 1
endif
ifeq ($(strip $(O_NERD)),1)
ICONS_INCLUDE = icons-generated-nerd.h
CPPFLAGS += -DNERD -DICONS_INCLUDE=\"$(ICONS_INCLUDE)\"
ifeq ($(strip $(T_ICONS)),1)
$(error Choose only one system for icons (O_ICONS, O_NERD or O_EMOJI))
endif
T_ICONS := 1
endif
ifeq ($(strip $(O_EMOJI)),1)
ICONS_INCLUDE = icons-generated-emoji.h
CPPFLAGS += -DEMOJI -DICONS_INCLUDE=\"$(ICONS_INCLUDE)\"
ifeq ($(strip $(T_ICONS)),1)
$(error Choose only one system for icons (O_ICONS, O_NERD or O_EMOJI))
endif
T_ICONS := 1
endif
ifeq ($(strip $(O_QSORT)),1)
CPPFLAGS += -DTOURBIN_QSORT
endif
ifeq ($(strip $(O_BENCH)),1)
CPPFLAGS += -DBENCH
endif
ifeq ($(strip $(O_NOSSN)),1)
CPPFLAGS += -DNOSSN
endif
ifeq ($(strip $(O_NOUG)),1)
CPPFLAGS += -DNOUG
endif
ifeq ($(strip $(O_NOX11)),1)
CPPFLAGS += -DNOX11
endif
ifeq ($(strip $(O_MATCHFLTR)),1)
CPPFLAGS += -DMATCHFLTR
endif
ifeq ($(strip $(O_NOSORT)),1)
CPPFLAGS += -DNOSORT
endif
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
CFLAGS += $(shell $(PKG_CONFIG) --cflags ncursesw)
LDLIBS += $(shell $(PKG_CONFIG) --libs ncursesw)
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)
else ifeq ($(shell $(PKG_CONFIG) ncurses && echo 1),1)
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncurses)
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncurses)
else
LDLIBS += -lncurses
LDLIBS_CURSES ?= -lncurses
endif
CFLAGS += -std=c11 -Wall -Wextra -Wshadow
CFLAGS += $(CFLAGS_OPTIMIZATION)
CFLAGS += $(CFLAGS_CURSES)
LDLIBS += $(LDLIBS_CURSES) -lpthread
# static compilation needs libgpm development package
ifeq ($(strip $(O_STATIC)),1)
LDFLAGS += -static
LDLIBS += -lgpm
endif
DISTFILES = src nnn.1 Makefile README.md LICENSE
SRC = src/nnn.c
HEADERS = src/nnn.h
BIN = nnn
DESKTOPFILE = misc/desktop/nnn.desktop
LOGOSVG = misc/logo/logo.svg
LOGO64X64 = misc/logo/logo-64x64.png
COLEMAK = patches/colemak
GITSTATUS = patches/gitstatus
NAMEFIRST = patches/namefirst
RESTOREPREVIEW = patches/restorepreview
# test if we are on Mac OS X and get X.Y.Z OS version with system binary /usr/bin/sw_vers
MACOS_VERSION := $(strip $(shell command -v sw_vers >/dev/null && [ "`sw_vers -productName`" = "Mac OS X" ] && sw_vers -productVersion))
# if Mac OS X detected, test if its version is below 10.12.0 relying on "sort -c" returning "disorder" message if the input is not sorted
ifneq ($(MACOS_VERSION),)
MACOS_BELOW_1012 := $(if $(strip $(shell printf '10.12.0\n%s' "$(MACOS_VERSION)" | sort -ct. -k1,1n -k2,2n -k3,3n 2>&1)),1)
endif
# if Mac OS X version is below 10.12.0, compile in the replacement clock_gettime and define MACOS_BELOW_1012 so that it's included in nnn.c
ifneq ($(MACOS_BELOW_1012),)
GETTIME_C = misc/macos-legacy/mach_gettime.c
GETTIME_H = misc/macos-legacy/mach_gettime.h
SRC += $(GETTIME_C)
HEADERS += $(GETTIME_H)
CPPFLAGS += -DMACOS_BELOW_1012
endif
ifeq ($(strip $(O_DEBUG)),1)
HEADERS += src/dbg.h
endif
ifeq ($(strip $(O_QSORT)),1)
HEADERS += src/qsort.h
endif
ifeq ($(strip $(O_EMOJI)),1)
HEADERS += src/icons.h src/$(ICONS_INCLUDE)
endif
ifeq ($(strip $(O_NERD)),1)
HEADERS += src/icons.h src/$(ICONS_INCLUDE)
endif
ifeq ($(strip $(O_ICONS)),1)
HEADERS += src/icons.h src/$(ICONS_INCLUDE) src/icons-in-terminal.h
endif
all: $(BIN)
$(SRC): src/nnn.h
$(BIN): $(SRC) $(HEADERS) Makefile
@$(MAKE) --silent prepatch
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(GETTIME_C) $< $(LDLIBS)
@$(MAKE) --silent postpatch
$(BIN): $(SRC)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
# targets for backwards compatibility
debug: $(BIN)
norl: $(BIN)
nolc: $(BIN)
debug: $(SRC)
$(CC) -DDEBUGMODE -g $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(BIN) $^ $(LDLIBS)
src/$(ICONS_INCLUDE): src/icons-hash.c src/icons.h src/icons-in-terminal.h
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -DICONS_GENERATE -o src/icons-hash-gen src/icons-hash.c
./src/icons-hash-gen > $@
install-desktop: $(DESKTOPFILE)
$(INSTALL) -m 0755 -d $(DESTDIR)$(DESKTOPPREFIX)
$(INSTALL) -m 0644 $(DESKTOPFILE) $(DESTDIR)$(DESKTOPPREFIX)
$(INSTALL) -m 0755 -d $(DESTDIR)$(DESKTOPICONPREFIX)/scalable/apps
$(INSTALL) -m 0644 $(LOGOSVG) $(DESTDIR)$(DESKTOPICONPREFIX)/scalable/apps/nnn.svg
$(INSTALL) -m 0755 -d $(DESTDIR)$(DESKTOPICONPREFIX)/64x64/apps
$(INSTALL) -m 0644 $(LOGO64X64) $(DESTDIR)$(DESKTOPICONPREFIX)/64x64/apps/nnn.png
uninstall-desktop:
$(RM) $(DESTDIR)$(DESKTOPPREFIX)/$(DESKTOPFILE)
$(RM) $(DESTDIR)$(DESKTOPICONPREFIX)/scalable/apps/nnn.svg
$(RM) $(DESTDIR)$(DESKTOPICONPREFIX)/64x64/apps/nnn.png
install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin
@ -43,16 +259,118 @@ uninstall:
strip: $(BIN)
$(STRIP) $^
upx: $(BIN)
$(STRIP) $^
upx -qqq $^
static:
# regular static binary
make O_STATIC=1 strip
mv $(BIN) $(BIN)-static
# static binary with icons-in-terminal support
make O_STATIC=1 O_ICONS=1 strip
mv $(BIN) $(BIN)-icons-static
# static binary with patched nerd font support
make O_STATIC=1 O_NERD=1 strip
mv $(BIN) $(BIN)-nerd-static
# static binary with emoji support
make O_STATIC=1 O_EMOJI=1 strip
mv $(BIN) $(BIN)-emoji-static
musl:
cp misc/musl/musl-static-ubuntu.sh .
./musl-static-ubuntu.sh 1
rm ./musl-static-ubuntu.sh
shellcheck:
find ./plugins/ -type f -not -name "*.md" -exec shellcheck {} +
dist:
mkdir -p nnn-$(VERSION)
$(CP) -r $(DISTFILES) nnn-$(VERSION)
tar -cf nnn-$(VERSION).tar nnn-$(VERSION)
gzip nnn-$(VERSION).tar
tar -cf - nnn-$(VERSION) | gzip > nnn-$(VERSION).tar.gz
$(RM) -r nnn-$(VERSION)
sign:
git archive -o nnn-$(VERSION).tar.gz --format tar.gz --prefix=nnn-$(VERSION)/ v$(VERSION)
gpg --detach-sign --yes nnn-$(VERSION).tar.gz
rm -f nnn-$(VERSION).tar.gz
upload-local: sign static musl
$(eval ID=$(shell curl -s 'https://api.github.com/repos/jarun/nnn/releases/tags/v$(VERSION)' | jq .id))
# upload sign file
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=nnn-$(VERSION).tar.gz.sig' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/pgp-signature' \
--upload-file nnn-$(VERSION).tar.gz.sig
# upx compress all static binaries
upx -qqq $(BIN)-static
upx -qqq $(BIN)-icons-static
upx -qqq $(BIN)-nerd-static
upx -qqq $(BIN)-emoji-static
# upload static binary
tar -zcf $(BIN)-static-$(VERSION).x86_64.tar.gz $(BIN)-static
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(BIN)-static-$(VERSION).x86_64.tar.gz' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \
--upload-file $(BIN)-static-$(VERSION).x86_64.tar.gz
# upload icons-in-terminal compiled static binary
tar -zcf $(BIN)-icons-static-$(VERSION).x86_64.tar.gz $(BIN)-icons-static
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(BIN)-icons-static-$(VERSION).x86_64.tar.gz' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \
--upload-file $(BIN)-icons-static-$(VERSION).x86_64.tar.gz
# upload patched nerd font compiled static binary
tar -zcf $(BIN)-nerd-static-$(VERSION).x86_64.tar.gz $(BIN)-nerd-static
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(BIN)-nerd-static-$(VERSION).x86_64.tar.gz' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \
--upload-file $(BIN)-nerd-static-$(VERSION).x86_64.tar.gz
# upload emoji compiled static binary
tar -zcf $(BIN)-emoji-static-$(VERSION).x86_64.tar.gz $(BIN)-emoji-static
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(BIN)-emoji-static-$(VERSION).x86_64.tar.gz' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \
--upload-file $(BIN)-emoji-static-$(VERSION).x86_64.tar.gz
# upload musl static binary
tar -zcf $(BIN)-musl-static-$(VERSION).x86_64.tar.gz $(BIN)-musl-static
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(BIN)-musl-static-$(VERSION).x86_64.tar.gz' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \
--upload-file $(BIN)-musl-static-$(VERSION).x86_64.tar.gz
clean:
$(RM) -f $(BIN) nnn-$(VERSION).tar.gz
$(RM) -f $(BIN) nnn-$(VERSION).tar.gz *.sig $(BIN)-static $(BIN)-static-$(VERSION).x86_64.tar.gz $(BIN)-icons-static $(BIN)-icons-static-$(VERSION).x86_64.tar.gz $(BIN)-nerd-static $(BIN)-nerd-static-$(VERSION).x86_64.tar.gz $(BIN)-emoji-static $(BIN)-emoji-static-$(VERSION).x86_64.tar.gz $(BIN)-musl-static $(BIN)-musl-static-$(VERSION).x86_64.tar.gz src/icons-hash-gen src/icons-generated-*.h
checkpatches:
./patches/check-patches.sh
prepatch:
ifeq ($(strip $(O_NAMEFIRST)),1)
patch --forward $(PATCH_OPTS) --strip=1 --input=$(NAMEFIRST)/mainline.diff
ifeq ($(strip $(O_GITSTATUS)),1)
patch --forward $(PATCH_OPTS) --strip=1 --input=$(GITSTATUS)/namefirst.diff
endif
else ifeq ($(strip $(O_GITSTATUS)),1)
patch --forward $(PATCH_OPTS) --strip=1 --input=$(GITSTATUS)/mainline.diff
endif
ifeq ($(strip $(O_RESTOREPREVIEW)),1)
patch --forward $(PATCH_OPTS) --strip=1 --input=$(RESTOREPREVIEW)/mainline.diff
endif
ifeq ($(strip $(O_COLEMAK)),1)
patch --forward $(PATCH_OPTS) --strip=1 --input=$(COLEMAK)/mainline.diff
endif
postpatch:
ifeq ($(strip $(O_NAMEFIRST)),1)
ifeq ($(strip $(O_GITSTATUS)),1)
patch --reverse $(PATCH_OPTS) --strip=1 --input=$(GITSTATUS)/namefirst.diff
endif
patch --reverse $(PATCH_OPTS) --strip=1 --input=$(NAMEFIRST)/mainline.diff
else ifeq ($(strip $(O_GITSTATUS)),1)
patch --reverse $(PATCH_OPTS) --strip=1 --input=$(GITSTATUS)/mainline.diff
endif
ifeq ($(strip $(O_RESTOREPREVIEW)),1)
patch --reverse $(PATCH_OPTS) --strip=1 --input=$(RESTOREPREVIEW)/mainline.diff
endif
ifeq ($(strip $(O_COLEMAK)),1)
patch --reverse $(PATCH_OPTS) --strip=1 --input=$(COLEMAK)/mainline.diff
endif
skip: ;
.PHONY: $(BIN) $(SRC) all debug install uninstall strip dist clean
.PHONY: all install uninstall strip static dist sign upload-local clean install-desktop uninstall-desktop

647
README.md
View File

@ -1,528 +1,165 @@
## nnn
Noice is Not Noice, a noicer fork...
<h3 align="center"><img src="misc/logo/logo-128x128.png" alt="nnn"><br>nnn - <i>Supercharge your productivity!</i></h3>
<p align="center">
<a href="https://github.com/jarun/nnn/releases/latest"><img src="https://img.shields.io/github/release/jarun/nnn.svg?maxAge=600" alt="Latest release" /></a>
<a href="http://formulae.brew.sh/formula/nnn"><img src="https://img.shields.io/homebrew/v/nnn.svg?maxAge=600" alt="Homebrew" /></a>
<a href="https://www.archlinux.org/packages/community/x86_64/nnn/"><img src="https://img.shields.io/badge/archlinux-rolling-blue.svg?maxAge=600" alt="Arch Linux" /></a>
<a href="https://packages.debian.org/search?keywords=nnn&searchon=names&exact=1"><img src="https://img.shields.io/badge/debian-10+-blue.svg?maxAge=2592000" alt="Debian Buster+" /></a>
<a href="https://apps.fedoraproject.org/packages/nnn"><img src="https://img.shields.io/badge/fedora-27+-blue.svg?maxAge=2592000" alt="Fedora 27+" /></a>
<a href="https://software.opensuse.org/package/nnn"><img src="https://img.shields.io/badge/opensuse%20leap-15.0+-blue.svg?maxAge=2592000" alt="openSUSE Leap 15.0+" /></a>
<a href="https://packages.ubuntu.com/search?keywords=nnn&searchon=names&exact=1"><img src="https://img.shields.io/badge/ubuntu-17.10+-blue.svg?maxAge=2592000" alt="Ubuntu Artful+" /></a>
<a href="https://github.com/jarun/nnn/releases/latest"><img src="https://img.shields.io/github/release/jarun/nnn.svg?maxAge=600&label=rel" alt="Latest release" /></a>
<a href="https://repology.org/project/nnn/versions"><img src="https://repology.org/badge/tiny-repos/nnn.svg?header=repos" alt="Availability"></a>
<a href="https://circleci.com/gh/jarun/workflows/nnn"><img src="https://img.shields.io/circleci/project/github/jarun/nnn.svg?label=circle%20ci" alt="CircleCI Status" /></a>
<a href="https://github.com/jarun/nnn/actions"><img src="https://github.com/jarun/nnn/workflows/ci/badge.svg?branch=master" alt="GitHub CI Status" /></a>
<a href="https://en.wikipedia.org/wiki/Privacy-invasive_software"><img src="https://img.shields.io/badge/privacy-✓-crimson?maxAge=2592000" alt="Privacy Awareness" /></a>
<a href="https://github.com/jarun/nnn/blob/master/LICENSE"><img src="https://img.shields.io/badge/©-BSD%202--Clause-important.svg?maxAge=2592000" alt="License" /></a>
</p>
<p align="center">
<a href="https://travis-ci.org/jarun/nnn"><img src="https://img.shields.io/travis/jarun/nnn/master.svg" alt="Build Status" /></a>
<a href="https://github.com/jarun/nnn/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-BSD%202--Clause-yellow.svg?maxAge=2592000" alt="License" /></a>
</p>
<p align="center"><a href="http://i.imgur.com/kOld6HT.gif"><img src="https://i.imgur.com/NUsSA2u.jpg"></a></p>
[![nnn screencast](https://i.imgur.com/wNtI24c.jpg)](https://vimeo.com/233223942 "Click to see nnn in action!")
<h3 align="center">[<a
href="https://github.com/jarun/nnn#features">Features</a>] [<a
href="https://github.com/jarun/nnn#quickstart">Quickstart</a>] [<a
href="https://github.com/jarun/nnn/tree/master/plugins#nnn-plugins">Plugins</a>] [<a
href="https://github.com/jarun/nnn/wiki">Wiki</a>]</h3>
<p align="center"><i>nnn in action! (click to play video)</i></a></p>
`nnn` (_n³_) is a full-featured terminal file manager. It's tiny, nearly 0-config and [incredibly fast](https://github.com/jarun/nnn/wiki/Performance).
`nnn` is probably the [fastest and most resource-sensitive](#performance) file manager you have ever used. It integrates seamlessly with your DE and favourite GUI utilities, has a unique [navigate-as-you-type](#navigate-as-you-type-mode) mode with auto-select, disk usage analyzer mode, bookmarks, contexts, application launcher, familiar navigation shortcuts, subshell spawning and much more.
It is designed to be unobtrusive with smart workflows to match the trains of thought.
[Integrate utilities](https://github.com/jarun/nnn#sample-scripts) like sxiv or fzy easily; `nnn` supports as many scripts as you need!
`nnn` can analyze disk usage, batch rename, launch apps and pick files. The plugin repository has tons of plugins to extend the capabilities further e.g. [live previews](https://github.com/jarun/nnn/wiki/Live-previews), (un)mount disks, find & list, file/dir diff, upload files. A [patch framework](https://github.com/jarun/nnn/tree/master/patches) hosts sizable user-submitted patches which are subjective in nature.
It runs on Linux, OS X, Raspberry Pi, Cygwin, Linux subsystem for Windows and Termux.
Independent (neo)vim plugins - [nnn.vim](https://github.com/mcchrish/nnn.vim), [vim-floaterm nnn wrapper](https://github.com/voldikss/vim-floaterm#nnn) and [nnn.nvim](https://github.com/luukvbaal/nnn.nvim) (neovim exclusive).
[Quickstart](#quickstart) and see how `nnn` simplifies those long desktop sessions... Missing a feature? Want to contribute? Head to the rolling [ToDo list](https://github.com/jarun/nnn/issues/110).
Runs on the Pi, [Termux](https://www.youtube.com/embed/AbaauM7gUJw) (Android), Linux, macOS, BSD, Haiku, Cygwin, WSL, across DEs or a strictly CLI env.
*Love smart and efficient utilities? Explore [my repositories](https://github.com/jarun?tab=repositories). Buy me a cup of coffee if they help you.*
[_(there's more)_](https://github.com/jarun/nnn/wiki/Basic-use-cases#the_nnn-magic)
<p align="center">
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q"><img src="https://img.shields.io/badge/PayPal-donate-green.svg" alt="Donate via PayPal!" /></a>
</p>
#### TABLE OF CONTENTS
- [Features](#features)
- [Performance](#performance)
- [Installation](#installation)
- [Dependencies](#dependencies)
- [From a package manager](#from-a-package-manager)
- [Release packages](#release-packages)
- [From source](#from-source)
- [Shell completion](#shell-completion)
- [Usage](#usage)
- [Cmdline options](#cmdline-options)
- [Keyboard shortcuts](#keyboard-shortcuts)
- [Leader key](#leader-key)
- [Contexts](#contexts)
- [Filters](#filters)
- [Navigate-as-you-type mode](#navigate-as-you-type-mode)
- [File indicators](#file-indicators)
- [File handling](#file-handling)
- [Help](#help)
- [Quickstart](#quickstart)
- [How to](#how-to)
- [add bookmarks](#add-bookmarks)
- [copy file paths](#copy-file-paths)
- [selection](#selection)
- [quote paths](#quote-paths)
- [to clipboard](#to-clipboard)
- [cd on quit](#cd-on-quit)
- [run custom scripts](#run-custom-scripts)
- [sample scripts](#sample-scripts)
- [change dir color](#change-dir-color)
- [integrate patool](#integrate-patool)
- [work faster at rename prompt](#work-faster-at-rename-prompt)
- [set idle timeout](#set-idle-timeout)
- [show hot plugged drives](#show-hot-plugged-drives)
- [tmux configuration](#tmux-configuration)
- [BSD terminal issue](#bsd-terminal-issue)
- [Why fork?](#why-fork)
- [Mentions](#mentions)
- [Developers](#developers)
#### FEATURES
## Features
- Quality
- Privacy-aware (no unconfirmed user data collection)
- POSIX-compliant, follows Linux kernel coding style
- Highly optimized, static analysis integrated code
- Frugal
- Typically needs less than 3.5MB resident memory
- Works with 8 colors (and xterm 256 colors)
- Disk-IO sensitive (few disk reads and writes)
- No FPU usage (all integer maths, even for file size)
- Minimizes screen refresh with fast line redraws
- Tiny binary (typically around 100KB)
- 1-column mode for smaller terminals and form factors
- Hackable - compile in/out features and dependencies
- Portable
- Language-agnostic plugins
- Static binary available (no need to install)
- Minimal library deps, easy to compile
- No config file, minimal config with sensible defaults
- Plugin to backup configuration
- Widely available on many packagers
- Touch enabled, handheld-friendly shortcuts
- Unicode support
- Modes
- Basic, detail (default), disk usage analyzer (du)
- Light (default), detail
- Disk usage analyzer (block/apparent)
- File picker, (neo)vim plugin
- Navigation
- Familiar, easy shortcuts (arrows, `~`, `-`, `&`)
- *Navigate-as-you-type* with auto-select directory
- Contexts (_aka_ tabs _aka_ workspaces)
- Bookmarks
- Pin and visit a directory
- Sorting
- Directories always listed on top
- Sort by file name, modification time, size
- Numeric order for numeric names (visit _/proc_)
- Filter with automatic dir entry on unique match
- *Type-to-nav* (turbo navigation/always filter) mode
- Contexts (_aka_ tabs/workspaces) with custom colors
- Sessions, bookmarks, mark and visit a dir
- Remote mounts (needs `sshfs`, `rclone`)
- Familiar shortcuts (arrows, <kbd>~</kbd>, <kbd>-</kbd>, <kbd>@</kbd>), quick look-up
- `cd` on quit (*easy* shell integration)
- Proceed to next file on file open and selection
- Search
- Instant filtering with *search-as-you-type*
- Regex (POSIX/PCRE) and string (default) filters
- Subtree search plugin to open or edit files
- Sort
- Ordered pure numeric names by default (visit `/proc`)
- Case-insensitive version (_aka_ natural) sort
- By name, access/change/mod (default) time, size, extn
- Reverse sort
- Directory-specific ordering
- Mimes
- Open with desktop opener or specify a custom app
- Create, list, extract archives (needs (p)atool)
- Open all text files in EDITOR (optional)
- Information
- Detailed stat-like file information
- Media information (needs mediainfo/exiftool)
- Preview hovered files in FIFO-based previewer
- Open with desktop opener or specify a custom opener
- File-specific colors (or minimal _dirs in context color_)
- Icons and Emojis support (customize and compile-in)
- Plugin for image, video and audio thumbnails
- Create, list, extract (to), mount (FUSE based) archives
- Option to open all text files in `$EDITOR`
- Convenience
- Create, rename files and directories
- Select multiple files; copy, move, delete selection
- Batch rename/move/delete (needs vidir)
- Show directories in custom color (default: blue)
- Spawn a subshell in the current directory
- Run custom scripts in the current directory
- Change directory at exit (*easy* shell integration)
- Edit file in EDITOR or open in PAGER
- GUI app launcher (up to 2 space-separated args)
- Terminal locker integration
- Unicode support
- Highly optimized, static analysis integrated code
- Available on many distros
#### PERFORMANCE
`nnn` vs. ncdu memory usage in disk usage analyzer mode (400K files on disk):
<pre>
PID USER PR NI VIRT <b>RES</b> SHR S %CPU %MEM TIME+ COMMAND
5034 vaio 20 0 71628 <b>59932</b> 2412 S 0.0 0.7 0:01.22 ncdu /
4949 vaio 20 0 14812 <b>3616</b> 2560 S 0.0 0.0 0:00.83 nnn -S /
</pre>
`nnn` vs. midnight commander vs. ranger memory usage while viewing a directory with 13.5K files, sorted by size:
<pre>
PID USER PR NI VIRT <b>RES</b> SHR S %CPU %MEM TIME+ COMMAND
31885 vaio 20 0 139720 <b>91220</b> 8460 S 0.0 1.1 0:02.96 /usr/bin/python -O /usr/bin/ranger
30108 vaio 20 0 72152 <b>12468</b> 7336 S 0.0 0.2 0:00.06 mc
30168 vaio 20 0 16476 <b>5072</b> 2640 S 0.0 0.1 0:00.22 nnn -c 1 -i
</pre>
Intrigued? Find out [HOW](https://github.com/jarun/nnn/wiki/performance-factors).
#### INSTALLATION
#### Dependencies
`nnn` needs libncursesw (on Linux or ncurses on OS X) and standard libc.
#### From a package manager
- [Arch Linux](https://www.archlinux.org/packages/community/x86_64/nnn/) (`pacman -S nnn`)
- [Debian](https://packages.debian.org/search?keywords=nnn&searchon=names&exact=1) (`apt-get install nnn`)
- [Fedora](https://apps.fedoraproject.org/packages/nnn) (`dnf install nnn`)
- [FreeBSD](https://www.freshports.org/misc/nnn) (`pkg install nnn`)
- [Gentoo](https://packages.gentoo.org/packages/app-misc/nnn) (`emerge nnn`)
- [Homebrew](http://formulae.brew.sh/formula/nnn) (`brew install nnn`)
- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/misc/nnn) (`nix-env -i nnn`)
- [OpenBSD](https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/sysutils/nnn/) (`pkg_add nnn`)
- [openSUSE](https://software.opensuse.org/package/nnn) (and packages for several other distros) (`zypper in nnn`)
- [Raspbian Testing](https://archive.raspbian.org/raspbian/pool/main/n/nnn/) (`apt-get install nnn`)
- [Slackware](http://slackbuilds.org/repository/14.2/system/nnn/) (`slackpkg install nnn`)
- [Source Mage](http://codex.sourcemage.org/test/shell-term-fm/nnn/) (`cast nnn`)
- [Termux](https://github.com/termux/termux-packages/tree/master/packages/nnn) (`pkg in nnn`)
- [Ubuntu](https://packages.ubuntu.com/search?keywords=nnn&searchon=names&exact=1) (`apt-get install nnn`)
- [Ubuntu PPA](https://launchpad.net/~twodopeshaggy/+archive/ubuntu/jarun/) (`apt-get install nnn`)
- [Void Linux](https://github.com/void-linux/void-packages/tree/master/srcpkgs/nnn) (`xbps-install -S nnn`)
#### Release packages
Packages for Arch Linux, CentOS, Debian, Fedora and Ubuntu are available with the [latest stable release](https://github.com/jarun/nnn/releases/latest).
#### From source
To cook yourself, download the [latest stable release](https://github.com/jarun/nnn/releases/latest) or clone this repository (*risky*). Then install the dependencies and compile (e.g. on Ubuntu 16.04):
$ sudo apt-get install pkg-config libncursesw5-dev
$ make
$ sudo make install
`PREFIX` is supported, in case you want to install to a different location.
#### Shell completion
Search keyword and option completion scripts for Bash, Fish and Zsh can be found in respective subdirectories of [`scripts/auto-completion/`](scripts/auto-completion). Please refer to your shell's manual for installation instructions.
#### USAGE
#### Cmdline options
```
usage: nnn [-b key] [-c N] [-e] [-i] [-l]
[-S] [-v] [-h] [PATH]
The missing terminal file manager for X.
positional args:
PATH start dir [default: current dir]
optional args:
-b key bookmark key to open
-c N dir color, disables if N>7
-e use exiftool instead of mediainfo
-i start in navigate-as-you-type mode
-l start in light mode
-S start in disk usage analyser mode
-v show program version
-h show this help
```
`>` indicates the currently selected entry in `nnn`.
#### Keyboard shortcuts
Press <kbd>?</kbd> in `nnn` to see the list anytime.
```
NAVIGATION
↑, k, ^P Up PgUp, ^U Scroll up
↓, j, ^N Down PgDn, ^D Scroll down
Home, g, ^, ^A First entry ~ Go HOME
End, G, $, ^E Last entry & Start dir
←, Bksp, h, ^H Parent dir - Last visited dir
→, ↵, l, ^M Open file/enter dir . Toggle show hidden
/ Filter Ins, ^I Toggle nav-as-you-type
b Pin current dir ^W Go to pinned dir
`, ^/ Leader key LeaderN Switch to context N
Esc Exit prompt ^L Redraw, clear prompt
^G Quit and cd q Quit context
Q, ^Q Quit ? Help, config
FILES
^O Open with... n Create new
D File details d Toggle detail view
^R Rename entry r Open dir in vidir
Y, ^Y Toggle selection y List selection
⎵, ^K Copy entry path ^T Toggle path quote
P Copy selection X Delete selection
V Move selection ^X Delete entry
f Archive entry F List archive
^F Extract archive m, M Brief/full media info
e Edit in EDITOR p Open in PAGER
ORDER
^J Toggle du mode S Toggle apparent size
s Toggle sort by size t Toggle sort by mtime
MISC
o Launch GUI app !, ^] Spawn SHELL in dir
R Run custom script L Lock terminal
```
Help & settings, file details, media info and archive listing are shown in the PAGER. Please use the PAGER-specific keys in these screens.
#### Leader key
The Leader key (<kbd>`</kbd> or <kbd>^/</kbd>) provides a powerful multi-functional navigation mechanism. It is case-sensitive and understands contexts, bookmarks and handy location shortcuts.
| Key | Function |
|:---:| --- |
| <kbd>1-4</kbd> | Go to selected context |
| <kbd>></kbd>, <kbd>.</kbd> | Go to next active context |
| <kbd><</kbd>, <kbd>,</kbd> | Go to previous active context |
| key | Go to bookmarked location |
| <kbd>~</kbd> | Go to HOME directory |
| <kbd>-</kbd> | Go to last visited directory |
| <kbd>&</kbd> | Go to start directory |
| <kbd>q</kbd> | Quit context |
#### Contexts
Contexts serve the purpose of exploring multiple directories simultaneously. 4 contexts are available. The status of the contexts are shown in the top left corner:
- the current context is in reverse
- other used contexts are underlined
- rest are unused
To switch to a context press the Leader key followed by the context number (1-4).
The first time a context is entered, it copies the state of the last visited context. Each context remembers its start directory and last visited directory.
When a context is quit, the next active context is selected. If the last active context is quit, the program quits.
#### Filters
Filters support regexes to instantly (search-as-you-type) list the matching entries in the current directory.
Ways to exit filter prompt:
- press <kbd>^L</kbd> to clear filter followed by <kbd>Bksp</kbd> (to clear the filter symbol, like vi)
- at other prompts <kbd>^L</kbd> followed by <kbd>Enter</kbd> discards all changes and exits prompt
- run a search with no matches and press <kbd>Enter</kbd>
Common use cases:
- to list all matches starting with the filter expression, start the expression with a `^` (caret) symbol
- type `\.mkv` to list all MKV files
- use `.*` to match any character (_sort of_ fuzzy search)
If `nnn` is invoked as root or the environment variable `NNN_SHOW_HIDDEN` is set the default filter will also match hidden files.
#### Navigate-as-you-type mode
In this mode directories are opened in filter mode, allowing continuous navigation. Works best with the **arrow keys**.
In case of only one match and it's a directory, `nnn` auto selects the directory and enters it in this mode. To disable this behaviour,
export NNN_NO_AUTOSELECT=1
#### File indicators
The following indicators are used in the detail view:
| Indicator | File Type |
|:---:| --- |
| `/` | Directory |
| `*` | Executable |
| <code>&#124;</code> | Fifo |
| `=` | Socket |
| `@` | Symbolic Link |
| `@/` | Symbolic Link to directory |
| `b` | Block Device |
| `c` | Character Device |
#### File handling
| External dependency | Operation |
| --- | --- |
| xdg-open (Linux), open(1) (OS X), cygstart (Cygwin) | desktop opener |
| file | determine file type |
| cp, mv, rm | copy, move and remove files |
| mediainfo, exiftool | multimedia file details |
| atool, patool ([integration](#integrate-patool)) | create, list and extract archives |
| vidir (from moreutils) | batch rename, move, delete dir entries |
| vlock (Linux), bashlock (OS X), lock(1) (BSD) | terminal locker |
| $EDITOR (overridden by $VISUAL, if defined) | edit files (fallback vi) |
| $PAGER | page through files (fallback less) |
| $SHELL | spawn a shell, run script (fallback sh) |
- To edit all text files in EDITOR (preferably CLI, fallback vi):
export NNN_USE_EDITOR=1
#### Help
$ nnn -h
$ man nnn
To lookup keyboard shortcuts at runtime, press <kbd>?</kbd>.
#### QUICKSTART
1. Install the [utilities required](#file-handling) for your regular activities.
2. Configure [cd on quit](#cd-on-quit).
3. Optionally open all text files in EDITOR (fallback vi):
export NNN_USE_EDITOR=1
4. Run `n`.
5. Press <kbd>?</kbd> for help on keyboard shortcuts anytime.
6. For additional functionality [setup custom scripts](#run-custom-scripts).
#### HOW TO
#### add bookmarks
Set environment variable `NNN_BMS` as a string of `key_char:location` pairs (max 10) separated by semicolons (`;`):
export NNN_BMS='d:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
NOTE: Bookmark keys should be single-character to use them in combination with the Leader key.
#### copy file paths
##### selection
Use <kbd>^K</kbd> to copy the absolute path of the file under the cursor.
To copy multiple absolute file paths:
- press <kbd>^Y</kbd> (or <kbd>Y</kbd>) to enter selection mode. In this mode it's possible to
- cherry-pick individual files one by one by pressing <kbd>^K</kbd> on each entry; or,
- navigate to another file in the same directory to select a range of files
- press <kbd>^Y</kbd> (or <kbd>Y</kbd>) _again_ to copy the paths and exit the selection mode
The files in the list can now be copied (<kbd>P</kbd>), moved (<kbd>V</kbd>) or removed (<kbd>X</kbd>).
To list the file paths copied to memory press <kbd>y</kbd>.
File paths are copied to the temporary file `DIR/.nnncp`, where `DIR` (by priority) is:
$HOME or,
$TMPDIR or,
/tmp
To see the path to the temporary copy file, run `nnn`, press <kbd>?</kbd> and look up `copy file`.
To use the copied paths from the cmdline, use command substitution. For example, if `DIR` above is `/home/user`:
# bash/zsh
ls -ltr `cat /home/user/.nnncp`
ls -ltr $(cat /home/user/.nnncp)
# fish
ls -ltr (cat /home/user/.nnncp)
An alias may be handy:
alias ncp='cat /home/user/.nnncp'
so you can easily handle files together:
# bash/zsh
ls -ltr `ncp`
ls -ltr $(ncp)
# fish
ls -ltr (ncp)
##### quote paths
To wrap each file path within single quotes while selecting:
export NNN_QUOTE_ON=1
This is particularly useful if you are planning to copy the whole string to the shell to run a command. Quotes can be toggled at runtime using <kbd>^T</kbd>.
Note that the filename is not escaped. So copying may still fail for filenames having quote(s) in them.
##### to clipboard
Along with default copy, `nnn` can pipe the absolute path of the current file or multiple files to a copier script. For example, you can use `xsel` on Linux or `pbcopy` on OS X.
Sample Linux copier script:
#!/bin/sh
# comment the next line to convert newlines to spaces
IFS=
echo -n $1 | xsel --clipboard --input
export `NNN_COPIER`:
export NNN_COPIER="/path/to/copier.sh"
#### cd on quit
To quit `nnn` and switch to the directory last opened follow the instructions below.
Pick the appropriate file for your shell from [`scripts/quitcd`](scripts/quitcd) and add the contents to your shell's rc file. You'll need to spawn a new shell for the change to take effect. You should start `nnn` as `n` (or modify the function name to something else). To change directory on quit press `^G` while exiting.
As you might notice, `nnn` uses the environment variable `NNN_TMPFILE` to write the last visited directory path. You can change it.
#### run custom scripts
`nnn` can invoke custom scripts with the currently selected file name as argument 1.
Export the path to the custom executable script:
export NNN_SCRIPT=/usr/local/bin/nscript
Press <kbd>R</kbd> to run the script in the current directory.
It's possible to run multiple scripts with `nnn` as long as the scripts are in the same location and share the same prefix. To enable multiple scripts,
export NNN_MULTISCRIPT=1
With the example of `NNN_SCRIPT` above, some more scripts could be:
/usr/local/bin/nscript1
/usr/local/bin/nscript2
/usr/local/bin/nscriptcustom1
/usr/local/bin/nscriptcustom2
and so on...
Type the correct suffix when prompted on pressing the keybind <kbd>R</kbd>. To use the base script (`NNN_SCRIPT`), just press <kbd>Enter</kbd>.
##### sample scripts
- Open image files in current dir in **sxiv**:
#!/usr/bin/env sh
sxiv -q * >/dev/null 2>&1
- Fuzzy find files in **fzy** and open with xdg-open:
#!/usr/bin/env sh
xdg-open $(find -type f | fzy) >/dev/null 2>&1
#### change dir color
The default color for directories is blue. Option `-c` accepts color codes from 0 to 7 to use a different color:
0-black, 1-red, 2-green, 3-yellow, 4-blue, 5-magenta, 6-cyan, 7-white
Any other value disables colored directories.
#### integrate patool
On systems where `atool` is not available but `patool` is, drop two copies of the Python3 script [natool](https://github.com/jarun/nnn/blob/master/scripts/natool) as `atool` and `apack` somewhere in `$PATH`.
#### work faster at rename prompt
The rename prompt supports some bash-like command-line shortcuts - <kbd>^A</kbd>, <kbd>^E</kbd>, <kbd>^U</kbd>. <kbd>^L</kbd> clears the name.
#### set idle timeout
The terminal locker is disabled by default. To set the wait time in seconds, use environment variable `NNN_IDLE_TIMEOUT`.
#### show hot plugged drives
Enable volume management in your DE file manager and set removable drives or media to be auto-mounted when inserted. Then visit the usual mount point location (`/mnt` or `/media/user`) in `nnn`.
#### tmux configuration
`nnn` might not handle keypresses correctly when used with tmux (see issue #104 for more details). Set `TERM=xterm-256color` to address it.
#### BSD terminal issue
By default in OpenBSD & FreeBSD, `stty` maps <kbd>^Y</kbd> to `DSUSP`. This means that typing <kbd>^Y</kbd> will suspend `nnn` as if you typed <kbd>^Z</kbd> (you can bring `nnn` back to the foreground by issuing `fg`) instead of entering multi-copy mode. You can check this with `stty -a`. If it includes the text "`dsusp = ^Y`", issuing `stty dsusp undef` will disable this `DSUSP` and let `nnn` receive the <kbd>^Y</kbd> instead.
#### WHY FORK?
`nnn` was initially forked from [noice](http://git.2f30.org/noice/) but is significantly [different](https://github.com/jarun/nnn/wiki/nnn-vs.-noice) today. I chose to fork because:
- one can argue my approach deviates from the goal of the original project - keep the utility `suckless`. `noice` was rudimentary. In my opinion evolution is the taste of time.
- I would like to have a bit of control on what features are added in the name of desktop integration. A feature-bloat is the last thing in my mind. Check out [nnn design considerations](https://github.com/jarun/nnn/wiki/nnn-design-considerations) for more details.
#### MENTIONS
- Detailed file stats and mime information
- Run plugins and custom commands with hotkeys
- FreeDesktop compliant trash utility integration
- Cross-dir file/all/range selection
- Create (with parents), rename, duplicate files and dirs
- Create new file or directory (tree) on startup
- Batch renamer for selection or dir
- List input stream of file paths from stdin or plugin
- Copy (as), move (as), delete, archive, link selection
- Dir updates, notification on `cp`, `mv`, `rm` completion
- Copy file paths to system clipboard on select
- Launch apps, run commands, spawn a shell, toggle exe
- Access context paths/files at prompt or spawned shell
- Lock terminal after configurable idle timeout
- Capture and show output of a program in help screen
- Basic support for screen readers and braille displays
## Quickstart
1. [Install](https://github.com/jarun/nnn/wiki/Usage) `nnn` and the dependencies you need.
2. The desktop opener is default. Use `-e` to open text files in the terminal. Optionally [open detached](https://github.com/jarun/nnn/wiki/Basic-use-cases#detached-text).
3. Configure [`cd` on quit](https://github.com/jarun/nnn/wiki/Basic-use-cases#configure-cd-on-quit).
4. [Sync subshell `$PWD`](https://github.com/jarun/nnn/wiki/Basic-use-cases#sync-subshell-pwd) to `nnn`.
5. [Install plugins](https://github.com/jarun/nnn/tree/master/plugins#installation).
6. Use `-x` to sync selection to clipboard, show notis on `cp`, `mv`, `rm` and set xterm title.
7. For a CLI-only environment, set [`NNN_OPENER`](https://github.com/jarun/nnn/wiki/Usage#configuration) to [`nuke`](https://github.com/jarun/nnn/blob/master/plugins/nuke). Use option `-c`.
8. Bid `ls` goodbye! `alias ls='nnn -de'` :sunglasses:
9. Visit the [Live previews](https://github.com/jarun/nnn/wiki/Live-previews) and [Troubleshooting](https://github.com/jarun/nnn/wiki/Troubleshooting) Wiki pages.
Don't memorize! Arrows, <kbd>/</kbd>, <kbd>q</kbd> suffice. <kbd>Tab</kbd> creates and/or cycles contexts. <kbd>?</kbd> lists shortcuts.
[![](https://i.imgur.com/TN3xYQz.jpg)](https://www.youtube.com/embed/-knZwdd1ScU)
[![Wiki](https://img.shields.io/badge/RTFM-nnn%20Wiki-important?maxAge=2592000)](https://github.com/jarun/nnn/wiki)
## Videos
- [nnn file manager on Termux (Android)](https://www.youtube.com/embed/AbaauM7gUJw)
- [NNN File Manager](https://www.youtube.com/embed/1QXU4XSqXNo)
- [This Week in Linux 114 - TuxDigital](https://www.youtube.com/watch?v=5W9ja0DQjSY&t=2059s)
- [nnn file manager basics - Linux](https://www.youtube.com/embed/il2Fm-KJJfM)
- [I'M GOING TO USE THE NNN FILE BROWSER! 😮](https://www.youtube.com/embed/U2n5aGqou9E)
- [NNN: Is This Terminal File Manager As Good As People Say?](https://www.youtube.com/embed/KuJHo-aO_FA)
- [nnn - A File Manager (By Uoou, again.)](https://www.youtube.com/embed/cnzuzcCPYsk)
## Elsewhere
- [AddictiveTips](https://www.addictivetips.com/ubuntu-linux-tips/navigate-linux-filesystem/)
- [ArchWiki](https://wiki.archlinux.org/index.php/Nnn)
- [FOSSMint](https://www.fossmint.com/nnn-linux-terminal-file-browser/)
- [gHacks Tech News](https://www.ghacks.net/2019/11/01/nnn-is-an-excellent-command-line-based-file-manager-for-linux-macos-and-bsds/)
- Hacker News [[1](https://news.ycombinator.com/item?id=18520898)] [[2](https://news.ycombinator.com/item?id=19850656)]
- [It's FOSS](https://itsfoss.com/nnn-file-browser-linux/)
- [LinuxLinks](https://www.linuxlinks.com/nnn-fast-and-flexible-file-manager/)
- [Ubuntu Full Circle Magazine - Issue 135](https://fullcirclemagazine.org/issue-135/)
- [Linux Format Issue 265; Manage files with nnn](https://linuxformat.com/archives?issue=265)
- LinuxLinks [[1](https://www.linuxlinks.com/nnn-fast-and-flexible-file-manager/)] [[2](https://www.linuxlinks.com/bestconsolefilemanagers/)] [[3](https://www.linuxlinks.com/excellent-system-tools-nnn-portable-terminal-file-manager/)]
- [Linux Magazine; FOSSPicks](https://www.linux-magazine.com/Issues/2017/205/FOSSPicks/(offset)/15)
- [Make Tech Easier](https://www.maketecheasier.com/nnn-file-manager-terminal/)
- [Opensource.com](https://opensource.com/article/22/12/linux-file-manager-nnn)
- [Open Source For You](https://www.opensourceforu.com/2019/12/nnn-this-feature-rich-terminal-file-manager-will-enhance-your-productivity/)
- [PCLinuxOS Magazine Issue June 2021](https://pclosmag.com/html/Issues/202106/page08.html)
- [Suckless Rocks](https://suckless.org/rocks/)
- [Ubuntu Full Circle Magazine Issue 135; Review: nnn](https://fullcirclemagazine.org/issue-135/)
- [Using and Administering Linux: Volume 2: Zero to SysAdmin: Advanced Topics](https://books.google.com/books?id=MqjDDwAAQBAJ&pg=PA32)
- [Wikipedia](https://en.wikipedia.org/wiki/Nnn_(file_manager))
#### DEVELOPERS
## Developers
1. Copyright © 2014-2016 Lazaros Koromilas
2. Copyright © 2014-2016 Dimitris Papastamos
3. Copyright © 2016-2018 [Arun Prakash Jana](https://github.com/jarun)
- [Arun Prakash Jana](https://github.com/jarun) (Copyright © 2016-2023)
- [0xACE](https://github.com/0xACE)
- [Anna Arad](https://github.com/annagrram)
- [KlzXS](https://github.com/KlzXS)
- [Léo Villeveygoux](https://github.com/leovilok)
- [Luuk van Baal](https://github.com/luukvbaal)
- [NRK](https://codeberg.org/NRK)
- [Sijmen J. Mulder](https://github.com/sjmulder)
- and other contributors
Visit the [Tracker](https://github.com/jarun/nnn/issues/1546) thread for a list of features in progress and anything up for grabs. Feel free to [discuss](https://github.com/jarun/nnn/discussions) new ideas or enhancement requests.

22
misc/CONTRIBUTING.md Normal file
View File

@ -0,0 +1,22 @@
# Contributing
Contributions to nnn are welcome! There's always an open issue with the current ToDo list, which contains the proposed features for the next release you can get your hands on. Any small changes or ideas should go in there, rather than in a separate issue.
Before suggesting changes, please read a bit about [the design principles nnn follows](https://github.com/jarun/nnn/wiki/concepts#design), and make sure you aren't breaking any of them.
Feel free to join the [Discussions](https://github.com/jarun/nnn/discussions). We highly recommended a discussion before raising a PR.
## Coding standard
`nnn` follows the Linux kernel coding style closely. The C source code uses TABs and the plugins use 4 spaces for indentation.
- Code changes should not break the patch framework. Please run `make checkpatches` to ensure.
- Run `make shellcheck` if adding/modifying plugins.
CI runs patch framework sanity test and `shellcheck`. Please watch out for any failures after raising the PR.
## Resources
The [wiki](https://github.com/jarun/nnn/wiki/Developer-guides) has some resources for developers you might be interested in: building, debugging...
## Communication
* [Gitter chat](https://gitter.im/jarun/nnn)
* [GitHub team](https://github.com/nnn-devs) (if you plan on contributing regularly, ask for an invitation).

View File

@ -0,0 +1,74 @@
#
# Rudimentary Bash completion definition for nnn.
#
# Author:
# Arun Prakash Jana <engineerarun@gmail.com>
#
_nnn ()
{
COMPREPLY=()
local IFS=$'\n'
local cur=$2 prev=$3
local -a opts
opts=(
-a
-A
-b
-B
-c
-C
-d
-D
-e
-E
-f
-g
-H
-i
-J
-K
-l
-n
-o
-p
-P
-Q
-r
-R
-s
-S
-t
-T
-u
-U
-V
-x
-h
)
if [[ $prev == -b ]]; then
local bookmarks=$(echo $NNN_BMS | awk -F: -v RS=\; '{print $1}')
COMPREPLY=( $(compgen -W "$bookmarks" -- "$cur") )
elif [[ $prev == -l ]]; then
return 1
elif [[ $prev == -p ]]; then
COMPREPLY=( $(compgen -f -d -- "$cur") )
elif [[ $prev == -P ]]; then
local plugins=$(echo $NNN_PLUG | awk -F: -v RS=\; '{print $1}')
COMPREPLY=( $(compgen -W "$plugins" -- "$cur") )
elif [[ $prev == -s ]]; then
local sessions_dir=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions
COMPREPLY=( $(cd "$sessions_dir" && compgen -f -d -- "$cur") )
elif [[ $prev == -t ]]; then
return 1
elif [[ $prev == -T ]]; then
local keys=$(echo "a d e r s t v" | awk -v RS=' ' '{print $0}')
COMPREPLY=( $(compgen -W "$keys" -- "$cur") )
elif [[ $cur == -* ]]; then
COMPREPLY=( $(compgen -W "${opts[*]}" -- "$cur") )
else
COMPREPLY=( $(compgen -f -d -- "$cur") )
fi
}
complete -o filenames -F _nnn nnn

View File

@ -0,0 +1,46 @@
#
# Fish completion definition for nnn.
#
# Author:
# Arun Prakash Jana <engineerarun@gmail.com>
#
if test -n "$XDG_CONFIG_HOME"
set sessions_dir $XDG_CONFIG_HOME/.config/nnn/sessions
else
set sessions_dir $HOME/.config/nnn/sessions
end
complete -c nnn -s a -d 'auto-create NNN_FIFO'
complete -c nnn -s A -d 'disable dir auto-enter'
complete -c nnn -s b -r -d 'bookmark key to open' -x -a '(echo $NNN_BMS | awk -F: -v RS=\; \'{print $1"\t"$2}\')'
complete -c nnn -s B -d 'use bsdtar for archives'
complete -c nnn -s c -d 'cli-only opener'
complete -c nnn -s C -d 'color by context'
complete -c nnn -s d -d 'start in detail mode'
complete -c nnn -s D -d 'dirs in context color'
complete -c nnn -s e -d 'open text files in $VISUAL/$EDITOR/vi'
complete -c nnn -s E -d 'use EDITOR for undetached edits'
complete -c nnn -s f -d 'use readline history file'
complete -c nnn -s g -d 'regex filters'
complete -c nnn -s H -d 'show hidden files'
complete -c nnn -s i -d 'show current file info'
complete -c nnn -s J -d 'no auto-advance on selection'
complete -c nnn -s K -d 'detect key collision and exit'
complete -c nnn -s l -r -d 'lines to move per scroll'
complete -c nnn -s n -d 'start in type-to-nav mode'
complete -c nnn -s o -d 'open files only on Enter'
complete -c nnn -s p -r -d 'copy selection to file' -a '-\tstdout'
complete -c nnn -s P -r -d 'plugin key to run' -x -a '(echo $NNN_PLUG | awk -F: -v RS=\; \'{print $1"\t"$2}\')'
complete -c nnn -s Q -d 'disable quit confirmation'
complete -c nnn -s r -d 'show cp, mv progress (Linux-only)'
complete -c nnn -s R -d 'disable rollover at edges'
complete -c nnn -s s -r -d 'load session by name' -x -a '@\t"last session" (ls $sessions_dir)'
complete -c nnn -s S -d 'persistent session'
complete -c nnn -s t -r -d 'timeout in seconds to lock'
complete -c nnn -s T -r -d 'a d e r s t v'
complete -c nnn -s u -d 'use selection (no prompt)'
complete -c nnn -s U -d 'show user and group'
complete -c nnn -s V -d 'show program version and exit'
complete -c nnn -s x -d 'notis, sel to system clipboard, xterm title'
complete -c nnn -s h -d 'show program help'

View File

@ -0,0 +1,47 @@
#compdef nnn
#
# Completion definition for nnn.
#
# Author:
# Arun Prakash Jana <engineerarun@gmail.com>
#
setopt localoptions noshwordsplit noksharrays
local -a args
args=(
'(-a)-a[auto-create NNN_FIFO]'
'(-A)-A[disable dir auto-enter]'
'(-b)-b[bookmark key to open]:key char'
'(-B)-B[use bsdtar for archives]'
'(-c)-c[cli-only opener]'
'(-C)-C[color by context]'
'(-d)-d[start in detail mode]'
'(-D)-D[dirs in context color]'
'(-e)-e[open text files in $VISUAL/$EDITOR/vi]'
'(-E)-E[use EDITOR for undetached edits]'
'(-f)-f[use readline history file]'
'(-g)-g[regex filters]'
'(-H)-H[show hidden files]'
'(-i)-i[show current file info]'
'(-J)-J[no auto-advance on selection]'
'(-K)-K[detect key collision and exit]'
'(-l)-l[lines to move per scroll]:val'
'(-n)-n[start in type-to-nav mode]'
'(-o)-o[open files only on Enter]'
'(-p)-p[copy selection to file]:file name'
'(-P)-P[plugin key to run]:key char'
'(-Q)-Q[disable quit confirmation]'
'(-r)-r[show cp, mv progress (Linux-only)]'
'(-R)-R[disable rollover at edges]'
'(-s)-s[load session]:session name'
'(-S)-S[persistent session]'
'(-t)-t[timeout to lock]:seconds'
'(-T)-T[a d e r s t v]:key'
'(-u)-u[use selection (no prompt)]'
'(-U)-U[show user and group]'
'(-V)-V[show program version and exit]'
'(-x)-x[notis, sel to system clipboard, xterm title]'
'(-h)-h[show program help]'
'*:filename:_files'
)
_arguments -S -s $args

10
misc/desktop/nnn.desktop Normal file
View File

@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=nnn
Comment=Terminal file manager
Exec=nnn
Terminal=true
Icon=nnn
MimeType=inode/directory
Categories=System;FileTools;FileManager;ConsoleOnly
Keywords=File;Manager;Management;Explorer;Launcher

250
misc/haiku/Makefile Normal file
View File

@ -0,0 +1,250 @@
VERSION = $(shell grep -m1 VERSION $(SRC) | cut -f 2 -d'"')
PREFIX ?= /boot/system/non-packaged
MANPREFIX ?= $(PREFIX)/documentation/man
STRIP ?= strip
PKG_CONFIG ?= pkg-config
INSTALL ?= install
CP ?= cp
CFLAGS_OPTIMIZATION ?= -O3
O_DEBUG := 0 # debug binary
O_NORL := 0 # no readline support
O_PCRE := 0 # link with PCRE library
O_NOLC := 0 # no locale support
O_NOMOUSE := 0 # no mouse support
O_NOBATCH := 0 # no built-in batch renamer
O_NOFIFO := 0 # no FIFO previewer support
O_CTX8 := 0 # enable 8 contexts
O_ICONS := 0 # support icons-in-terminal
O_NERD := 0 # support icons-nerdfont
O_QSORT := 0 # use Alexey Tourbin's QSORT implementation
O_BENCH := 0 # benchmark mode (stops at first user input)
O_NOSSN := 0 # disable session support
O_NOUG := 0 # disable user, group name in status bar
O_NOX11 := 0 # disable X11 integration
O_MATCHFLTR := 0 # allow filters without matches
# User patches
O_GITSTATUS := 0 # add git status to detail view
O_NAMEFIRST := 0 # print file name first, add uid and guid to detail view
ifeq ($(strip $(O_GITSTATUS)),1)
LDLIBS += -lgit2
endif
# convert targets to flags for backwards compatibility
ifneq ($(filter debug,$(MAKECMDGOALS)),)
O_DEBUG := 1
endif
ifneq ($(filter norl,$(MAKECMDGOALS)),)
O_NORL := 1
endif
ifneq ($(filter nolc,$(MAKECMDGOALS)),)
O_NORL := 1
O_NOLC := 1
endif
ifeq ($(strip $(O_DEBUG)),1)
CPPFLAGS += -DDEBUG
CFLAGS += -g
LDLIBS += -lrt
endif
ifeq ($(strip $(O_NORL)),1)
CPPFLAGS += -DNORL
else ifeq ($(strip $(O_STATIC)),1)
CPPFLAGS += -DNORL
else
LDLIBS += -lreadline
endif
ifeq ($(strip $(O_PCRE)),1)
CPPFLAGS += -DPCRE
LDLIBS += -lpcre
endif
ifeq ($(strip $(O_NOLC)),1)
ifeq ($(strip $(O_ICONS)),1)
$(info *** Ignoring O_NOLC since O_ICONS is set ***)
else ifeq ($(strip $(O_NERD)),1)
$(info *** Ignoring O_NOLC since O_NERD is set ***)
else
CPPFLAGS += -DNOLC
endif
endif
ifeq ($(strip $(O_NOMOUSE)),1)
CPPFLAGS += -DNOMOUSE
endif
ifeq ($(strip $(O_NOBATCH)),1)
CPPFLAGS += -DNOBATCH
endif
ifeq ($(strip $(O_NOFIFO)),1)
CPPFLAGS += -DNOFIFO
endif
ifeq ($(strip $(O_CTX8)),1)
CPPFLAGS += -DCTX8
endif
ifeq ($(strip $(O_ICONS)),1)
CPPFLAGS += -DICONS
endif
ifeq ($(strip $(O_NERD)),1)
CPPFLAGS += -DNERD
endif
ifeq ($(strip $(O_QSORT)),1)
CPPFLAGS += -DTOURBIN_QSORT
endif
ifeq ($(strip $(O_BENCH)),1)
CPPFLAGS += -DBENCH
endif
ifeq ($(strip $(O_NOSSN)),1)
CPPFLAGS += -DNOSSN
endif
ifeq ($(strip $(O_NOUG)),1)
CPPFLAGS += -DNOUG
endif
ifeq ($(strip $(O_NOX11)),1)
CPPFLAGS += -DNOX11
endif
ifeq ($(strip $(O_MATCHFLTR)),1)
CPPFLAGS += -DMATCHFLTR
endif
ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncursesw)
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncursesw)
else ifeq ($(shell $(PKG_CONFIG) ncurses && echo 1),1)
CFLAGS_CURSES ?= $(shell $(PKG_CONFIG) --cflags ncurses)
LDLIBS_CURSES ?= $(shell $(PKG_CONFIG) --libs ncurses)
else
LDLIBS_CURSES ?= -lncurses
endif
ifeq ($(shell uname -s), Haiku)
LDLIBS_HAIKU ?= -lstdc++ -lgnu -lbe
SRC_HAIKU ?= misc/haiku/nm.cpp
OBJS_HAIKU ?= misc/haiku/nm.o
endif
CFLAGS += -std=c11 -Wall -Wextra -Wshadow
CFLAGS += $(CFLAGS_OPTIMIZATION)
CFLAGS += $(CFLAGS_CURSES)
LDLIBS += $(LDLIBS_CURSES) -lpthread $(LDLIBS_HAIKU)
# static compilation needs libgpm development package
ifeq ($(strip $(O_STATIC)),1)
LDFLAGS += -static
LDLIBS += -lgpm
endif
DISTFILES = src nnn.1 Makefile README.md LICENSE
SRC = src/nnn.c
HEADERS = src/nnn.h
BIN = nnn
OBJS := nnn.o $(OBJS_HAIKU)
GITSTATUS = patches/gitstatus
NAMEFIRST = patches/namefirst
all: $(BIN)
ifeq ($(shell uname -s), Haiku)
$(OBJS_HAIKU): $(SRC_HAIKU)
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
endif
nnn.o: $(SRC) $(HEADERS)
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
$(BIN): $(OBJS)
@$(MAKE) --silent prepatch
$(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS)
@$(MAKE) --silent postpatch
# targets for backwards compatibility
debug: $(BIN)
norl: $(BIN)
nolc: $(BIN)
install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -m 0755 -d $(DESTDIR)$(MANPREFIX)/man1
$(INSTALL) -m 0644 $(BIN).1 $(DESTDIR)$(MANPREFIX)/man1
uninstall:
$(RM) $(DESTDIR)$(PREFIX)/bin/$(BIN)
$(RM) $(DESTDIR)$(MANPREFIX)/man1/$(BIN).1
strip: $(BIN)
$(STRIP) $^
static:
# regular static binary
make O_STATIC=1 strip
mv $(BIN) $(BIN)-static
dist:
mkdir -p nnn-$(VERSION)
$(CP) -r $(DISTFILES) nnn-$(VERSION)
mkdir -p nnn-$(VERSION)/misc
$(CP) -r misc/haiku nnn-$(VERSION)/misc
tar -cf - nnn-$(VERSION) | gzip > nnn-$(VERSION).tar.gz
$(RM) -r nnn-$(VERSION)
sign:
git archive -o nnn-$(VERSION).tar.gz --format tar.gz --prefix=nnn-$(VERSION)/ v$(VERSION)
gpg --detach-sign --yes nnn-$(VERSION).tar.gz
rm -f nnn-$(VERSION).tar.gz
upload-local: sign static
$(eval ID=$(shell curl -s 'https://api.github.com/repos/jarun/nnn/releases/tags/v$(VERSION)' | jq .id))
# upload sign file
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=nnn-$(VERSION).tar.gz.sig' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/pgp-signature' \
--upload-file nnn-$(VERSION).tar.gz.sig
tar -zcf $(BIN)-static-$(VERSION).x86_64.tar.gz $(BIN)-static
# upload static binary
curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(BIN)-static-$(VERSION).x86_64.tar.gz' \
-H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \
--upload-file $(BIN)-static-$(VERSION).x86_64.tar.gz
clean:
$(RM) -f $(BIN) nnn-$(VERSION).tar.gz *.sig $(BIN)-static $(BIN)-static-$(VERSION).x86_64.tar.gz
prepatch:
ifeq ($(strip $(O_NAMEFIRST)),1)
patch --forward --strip=1 --input=$(NAMEFIRST)/mainline.diff
ifeq ($(strip $(O_GITSTATUS)),1)
patch --forward --strip=1 --input=$(GITSTATUS)/namefirst.diff
endif
else ifeq ($(strip $(O_GITSTATUS)),1)
patch --forward --strip=1 --input=$(GITSTATUS)/mainline.diff
endif
postpatch:
ifeq ($(strip $(O_NAMEFIRST)),1)
ifeq ($(strip $(O_GITSTATUS)),1)
patch --reverse --strip=1 --input=$(GITSTATUS)/namefirst.diff
endif
patch --reverse --strip=1 --input=$(NAMEFIRST)/mainline.diff
else ifeq ($(strip $(O_GITSTATUS)),1)
patch --reverse --strip=1 --input=$(GITSTATUS)/mainline.diff
endif
skip: ;
.PHONY: all install uninstall strip static dist sign upload-local clean

View File

@ -0,0 +1,14 @@
#ifdef __cplusplus
extern "C" {
#endif
typedef struct haiku_nm_t *haiku_nm_h;
haiku_nm_h haiku_init_nm();
void haiku_close_nm(haiku_nm_h hnd);
int haiku_watch_dir(haiku_nm_h hnd, const char *path);
int haiku_stop_watch(haiku_nm_h hnd);
int haiku_is_update_needed(haiku_nm_h hnd);
#ifdef __cplusplus
}
#endif

83
misc/haiku/nm.cpp Normal file
View File

@ -0,0 +1,83 @@
#include <Directory.h>
#include <Looper.h>
#include <NodeMonitor.h>
#include <MessageFilter.h>
#include "haiku_interop.h"
filter_result dir_mon_flt(BMessage *message, BHandler **hnd, BMessageFilter *fltr) {
(void) hnd;
(void) fltr;
if (message->what == B_NODE_MONITOR) {
int32 val;
message->FindInt32("opcode", &val);
switch (val) {
case B_ENTRY_CREATED:
case B_ENTRY_MOVED:
case B_ENTRY_REMOVED:
return B_DISPATCH_MESSAGE;
}
}
return B_SKIP_MESSAGE;
}
class DirectoryListener : public BLooper {
public:
bool recv_reset() {
Lock();
bool val = _ev_on;
_ev_on = false;
Unlock();
return val;
}
private:
void MessageReceived(BMessage * message) override {
Lock();
_ev_on = true;
Unlock();
BLooper::MessageReceived(message);
}
bool _ev_on = false;
};
struct haiku_nm_t {
haiku_nm_t() {
dl = new DirectoryListener();
flt = new BMessageFilter(B_PROGRAMMED_DELIVERY, B_LOCAL_SOURCE, dir_mon_flt);
dl->AddCommonFilter(flt);
dl->Run();
}
DirectoryListener *dl;
BMessageFilter *flt;
node_ref nr;
};
haiku_nm_h haiku_init_nm() {
return new haiku_nm_t();
}
void haiku_close_nm(haiku_nm_h hnd) {
delete hnd->flt;
// This is the way of deleting a BLooper
hnd->dl->PostMessage(B_QUIT_REQUESTED);
delete hnd;
}
int haiku_watch_dir(haiku_nm_h hnd, const char *path) {
BDirectory dir(path);
dir.GetNodeRef(&(hnd->nr));
return watch_node(&(hnd->nr), B_WATCH_DIRECTORY, nullptr, hnd->dl);
}
int haiku_stop_watch(haiku_nm_h hnd) {
return watch_node(&(hnd->nr), B_STOP_WATCHING, nullptr, hnd->dl);
}
int haiku_is_update_needed(haiku_nm_h hnd) {
return hnd->dl->recv_reset();
}

View File

@ -0,0 +1,58 @@
SUMMARY="A blazing-fast lightweight terminal file manager"
DESCRIPTION="nnn is a full-featured terminal file manager. It's tiny and \
nearly 0-config with an incredible performance.
nnn is also a du analyzer, an app launcher, a batch renamer and a file picker. \
The plugin repository has tons of plugins and documentation to extend the \
capabilities further. You can plug new functionality and play with a \
custom keybind instantly. There's an independent (neo)vim plugin.
It runs smoothly on the Raspberry Pi, Termux on Android, Linux, macOS, BSD, \
Cygwin, WSL, Haiku and works seamlessly with DEs and GUI utilities.
Visit the Wiki for concepts, program usage, how-tos and troubleshooting."
HOMEPAGE="https://github.com/jarun/nnn"
COPYRIGHT="2016-2023 Arun Prakash Jana"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="git://github.com/jarun/nnn.git"
ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
nnn$secondaryArchSuffix = $portVersion
cmd:nnn = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
file$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
lib:libreadline$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libncurses$secondaryArchSuffix
devel:libreadline$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:g++$secondaryArchSuffix
cmd:gcc$secondaryArchSuffix
cmd:install
cmd:ld$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
make -f misc/haiku/Makefile $jobArgs
}
INSTALL()
{
make -f misc/haiku/Makefile install PREFIX=$prefix
addResourcesToBinaries misc/haiku/nnn.rdef $prefix/bin/nnn
}

140
misc/haiku/nnn.rdef Normal file
View File

@ -0,0 +1,140 @@
// How to apply this resource definition file manually (Haiku only):
// First, make sure that nnn is compiled.
// Next, run "rc nnn.rdef -o nnn.rsrc" to compile this resource file.
// Then, run "xres -o nnn nnn.rsrc" to apply the resource file to nnn.
// Finally, run "mimeset -f nnn" to refresh Haiku's MIME database.
resource app_signature "application/x-vnd.Jarun-nnn";
resource app_version {
major = 4,
middle = 9,
minor = 0,
variety = B_APPV_DEVELOPMENT,
internal = 0,
short_info = "nnn",
long_info = "A blazing-fast lightweight terminal file manager"
};
resource app_flags B_MULTIPLE_LAUNCH | B_BACKGROUND_APP | B_ARGV_ONLY;
resource file_types message {
"types" = "application/x-vnd.Be-directory"
};
resource vector_icon {
$"6E6369660805FF032E343602011202B8E0C339BAC3B985CFB8B7E549F5FF4994"
$"000000FFFF0000020112023745BA3659FABA87063B846942D03049EBF80000FF"
$"FF0000020112033BE54D39FE49B857E23A493A4A91FF489000000000AF0000FF"
$"00FF020112022D299A3B3A49BCE2FF2ED4134A65A94C096A0000FFFF00000201"
$"1202365425358147B6C63037AFB14669664AB9F30000FFFF0000020112023673"
$"5235AC4EB7FB7138A81D481E6A48C2C50000FFFF00000F0241BE60B360BE60B3"
$"60BE5FB360BE3EB364BE46B362BE2AB369BE17B371BE1FB36DBE03B379BDF3B3"
$"85BDFCB37EBDE3B38EBDCEB3A0BDD9B398BDB8B3B1BD8BB3DDBDA4B3C5BD58B4"
$"0EBCCDB4A0BD17B450BC93B4DBBC36B539BC61B50DBC35B537BC32B536BC34B5"
$"37BBE6B50ABB0FB48BBB7EB4CEBA9EB448B9E8B3DDBA36B40AB9C1B3C5B987B3"
$"A5B9A0B3B3B97AB39FB967B394B971B399B961B391B954B38CB95DB390B94FB3"
$"89B942B385B94CB388B93FB382B92FB37EB939B381B926B37DB8FFB379B900B3"
$"79B8E9B379B87FB3A4B8B1B37DB84CB3C8B82FB418B838B3FBB81FB453B826B4"
$"89B825B466B827B4CDB841B5F9B82FB534B848B656B854B6F9B84EB6B1B85AB7"
$"41B85CB776B85CB782B85CB75BB83AB7A7B860B772B814B7DBB767B88FB7CEB8"
$"29B6E7B90DB65CB9D1B694B955B626BA4CB62ABB5AB62CBAB9B629BC54B606BC"
$"9DB634BC1BB5CDBD3EB4B1BEF5B597BDA1B445BF96B3B0C089B3DDC033B31AC1"
$"A4B318C3DAB2D2C2D1B371C536B61FC639B4ABC60FB641C680B698C6F2B65CC6"
$"CFB698C6F2B69AC6F2B69AC6F2B71EC742B838C6F9B7BDC733B8B2C6BEB96CC5"
$"E2B919C65DB99BC59FBA11C4C4B9D8C530BA78C400BB14C34ABAB4C3A1BB75C2"
$"F2BD20C209BC0BC29ABDDEC1A6BED6C108BE5244BED6C121BED8C151BED9C139"
$"BECCC24CBE29C3E9BE9AC307BDC3C4B6BC1DC63ABD84C4F7BB43C700BA57C7FA"
$"BAB9C781B9F5C872B99DC966B9BCC8EBB961CA48B95ECBBBB955CB0830CBFDB9"
$"65CC7FB962CC3DBFC3CC7F60CC7FC621CC7FCC7ECBDECC7ACA9BCC7CCB3CCC6F"
$"C6D6CA63BE51CB9AC1F5C98736C731B8ADC899BA16C5F2B76EC2C4B648C477B6"
$"A1C212B625BFF7B63643B625C013B634C04A28C02FB631C027B5E2BFE0B546C0"
$"04B593BFAFB4D8BF5EB436BF81B47BBF4DB415BF30B3E0BF3FB3F8BF28B3D3BF"
$"18B3BBBF22B3C9BF11B3B4BEFFB39DBF0CB3ABBEF8B398BEE2B385BEF1B390BE"
$"DAB380BEC5B375BED1B37ABEB9B36EBE96B364BE96B364BE96B364BE95B364BE"
$"95B364BE93B364BE93B364BE93B364BE93B364BE60B360BE60B360BE60B36002"
$"23BCA6C6D2BCA6C6D2BE0FC58CBEDFC443BE70C523BF5BC34EBFA3C159BF97C2"
$"6DBFAAC0AEBF80BFC2BF99BFDABF7ABFBBBF34BFE33FBFC7BEA9C048BCC3C154"
$"BDD9C0C2BA90C277B95BC467BA2FC2CFB926C4CCB8C5C56FB8E2C542B83EC636"
$"B702C644B780C68FB6CEC624B6A8C5B6B6B4C5FDB6A1C587B660C581B69CC584"
$"B510C56EB3DDC3A7B426C4C2B3ACC2EDB465C0E9B3E0C1E1B481C0B1B55ABF67"
$"B4F0C005B642BE10B6C7BCE0B689BD92B6F5BC5DB6F6BB5AB6F5BC55B6F7BA1A"
$"B7F5B921B6F5BA1EB8CDB84DB928B776B928B7CEB928B757B90CB5E9B91BB6A4"
$"B8EBB45DB8FFB446B8EBB446B907B446BAA6B53A31B4B4BB85B5C0BC54B62FBC"
$"47B62FBC6128BD60B52BBCDBB5BABDF2B491BE6BB42BBE5EB428BE78B42EBF27"
$"B59ABEC3B4C2BF5DB613BFCBB704BF95B68DBFDEB703C005B702BFF2B702C0F0"
$"B6F1C29CB70FC229B6F9C42AB761C6A0B93DC57CB818C7F0BA8FC9A0BE92C8CC"
$"BC13CACFC21CCBAECA9DCBA3C6F5CBAFCAFBCBB15ECBB0CB56C5D85EBA295EC0"
$"015EBA21CB0FBA61C99A32CA68BA97C8CBBCA6C6D2BAF4C858BCA6C6D20215C8"
$"1C5EC81C5EC80FCB23C7DAC9A7C805CA9DC79EC84BC6E7C4FBC747C6A251C353"
$"C5B5C054C61BC1ACC54FBEF9C4A1BD7F4DBDEFC457BD12C3C3BC5FC40EBCB4C3"
$"79BC0DC2D8BB87C32B36C285BB4BC1C8BAF0C22BBB19C195BADDC120BAC444BA"
$"D2C13EBADEC177BB1CC15CBAF6C19EBB66C1B9BC18C1B5BBBAC1BCBC74C184BD"
$"41C1ABBCD8C15CBDA9C0C1BE85C11DBE17C0683EBF5CBFD2BFF2BF64BF69BFCD"
$"BF80BFC2BF7EBFBFBF99BFDABFA3C159BFAAC0AEBF97C26DBEE1C443BF5BC34E"
$"BE70C523BCA6C6D2BE0FC58CBAF4C858BA61C99ABA97C8CB32CA68BA295EBA21"
$"CB0FBECF5EC81C5EC3755EC81C5E021CBE6BB42BBE6BB42BBE5EB428BD60B52B"
$"BDF2B491BCDBB5BABC54B62FBC6128BC47B62FBAA6B53ABB85B5C031B4B4B8FF"
$"B446B907B446B8EBB446B90CB5E9B8EBB45DB91BB6A4B928B776B928B757B928"
$"B7CEB7F5B921B8CDB84DB6F5BA1EB6F6BB5AB6F7BA1AB6F5BC55B6C7BCE0B6F5"
$"BC5DB689BD92B55ABF67B642BE10B4F0C005B465C0E9B481C0B1B3E0C1E1B3DD"
$"C3A7B3ACC2EEB426C4C2B660C581B510C56EB680C583B697C58AB68FC583B74F"
$"C477B90545B815C32CB9FCC041BC10BD70BB07BEB8BC94BCCCBD99BBBBBD18BC"
$"36BE19BB41BF0DBAA0BE96BADFBF49BA82BFBBBA5FBF82BA6BBFF3BA52C05CBA"
$"59C028BA50C090BA6143BA94C0C2BA75C103BA9FC120BAC4C110BAB6C125BAC5"
$"C130BAC7C12ABAC6C0BBB986BFCEB704C043B846BFCDB704BFCBB704BFCDB704"
$"BF95B68BBF27B59ABF5DB613BEC4B4C2BE6BB42BBE78B42EBE6BB42B0207BFCE"
$"B704BFCEB704C063B85EC18FBB10C0F9B9B7C1C2BB1DC2BCBB74C28DBB61C6B9"
$"BBACC6A0B93DCB98BF33C57CB818C29CB70FC42AB761C229B6F9C005B702C0F0"
$"B6F1BFF3B702BFCEB704BFDFB703BFCEB7040207BCA6C6D2BCA6C6D2474ACB64"
$"C69E5149CB91C805CBAECA9DCBABC963CBAFCAFBCBB15ECBB0CB56C5D85EBA29"
$"5EC0015EBA21CB0FBA61C99A32CA68BA97C8CBBCA6C6D2BAF4C858BCA6C6D206"
$"04BFB67CC579B67CC579B7C1C49BB900C2AFB8F9C22FB906C32EB6F5C5CDB841"
$"C6ABB5AA4DB67CC5790211BD5BC297BD5BC297BDC5C279BEE5C244BE49C25EBF"
$"83C22BC0E8C21FC02EC21FC19DC21FC2AAC26CC234C238C323C29CC3C4C33EC3"
$"81C2E1C40BC399C45BC485C43EC405C478C502C487C626C487C58DC487C7BCC4"
$"87CAE7C487C9514ACAE746CAE7C2EFCAE746C96B46C67346C7EF46C5A0C1DDC4"
$"ABC20BC508C1AFC44FC0C2C421C151C421C097C421C040C424C06D4BC018C428"
$"BFBFC434BFEEC42CBFBFC66FBFBFCAE7BFBFC8ACBEF3CAE7BD5BCAE7BE27CAE7"
$"BD5BC821BD5BC297BD5BC55BBD5BC2970211BE27C363BE27C363BE91C345BFB1"
$"C310BF16C32AC050C2F7C1B4C2EBC0FAC2EBC269C2EBC376C338C300C304C3EF"
$"C368C490C40AC44DC3ADC4D7C465C527C551C50AC4D1C544C5CE4EC6F24EC659"
$"4EC8454ECAE74EC9964CCAE748CAE74ACAE748C9C548C77F48C8A148C6B9C2A9"
$"C5D4C2D7C62BC27BC57FC18EC553C21DC553C163C553C10CC557C1394EC0E4C5"
$"5A42C565C0BAC55E42C73A42CAE742C91140CAE73CCAE73ECAE73CC866BE27C3"
$"63BE27C5E4BE27C3630206B669C28FB669C28FB669C25DB613C207B642C21EB5"
$"8645B4F5C338B507C245B4F1C374B4F7C3BEB4F3C3B2B503C3DAB59DC370B507"
$"C3D7B632C309B669C28FB669C2CAB669C28F0207BAE6BC94BAE6BC94BC1EBB5D"
$"BD8EB8BBBD8EB948BD8EB89BBD1AB854BD5AB86DBBF7B7E7B988B975BA7DB85F"
$"B902BA0EB763BDFCB82DBAE5B751BE42B7F5BEBCB6C13FB92ABE1DBAE6BC94B9"
$"EDBD8CBAE6BC940207B9EABBF2B9EABBF2BA4CBB90BABFBABCBABFBAE9BABFBA"
$"B2BA9BBA9CBAAEBAA3BA40BA79B97BBAF7B9C8BA9EB952BB27B85BBCCCB85BBC"
$"B7B85BBCE3B8FCBC9EB89BBCCFB95EBC6CB9EABBF2B99CBC3FB9EABBF2020FC0"
$"E42CC0E42CC0BFB7C942B801C09DB7E0C07BB825C096B86CC080B84DC0ADB889"
$"C0F8B893C0D4B899C2D4B862C515B9BAC413B8E0C617BA94C789BD20C6D6BBD2"
$"C7CFBDA0C8EFC1C5C869BF62C977C428CA19CA85C9F2C73ACA1BCAABCA4FCADD"
$"CA30CACCCA6FCAEDCAB5CAD7CA97CAEBCAD4CAC4CAE5CA7DCAE7CAA1CABDC722"
$"59C19ACA3FC408C92DBF2BC83CBCC0C89FBD76C786BB6DC599B920C6BEBA17C4"
$"73B827C0E42CC2EEB794C0E42C020AC70ABC69C70ABC69C1BB3BC864C462C353"
$"50C8CFC440C982C3CEC930C411C983C3CDC984C3CCC983C3CCC985C3CAC987C3"
$"C7C986C3C9C9D4C384CA37C2CDCA13C32DCA59C272CA1945CA19C220C9B33FC8"
$"5ABC98C9B33DC85ABC98C859BC98C859BC98C7F2BC76C70ABC69C785BC69C70A"
$"BC690220C6E2C242C6E2C242C740C242C7A5C216C782C234C7CCC1F8C7DFC1AB"
$"C7DFC1D6C7DFC141C6C8C10CC782C10CC690C10CC622C10CC659C10CC622C0A1"
$"C622BFC8C622C035C659BFC8C6C8BFC8C690BFC8C705BFC8C75FBFA5C738BFBD"
$"C785BF8DC798BF35C798BF67C798BEE3C6EBBEB9C75FBEB9C6ADBEB9C635BED9"
$"C66FBEC3C5FABEEEC587BF1BC5BFBF03C555BEB4C4F0BDE5C523BE4CC532BDBA"
$"C5E5BD79C584BD98C64ABD5AC709BD4AC6ABBD4AC774BD4AC814BD6CC7CDBD54"
$"C85EBD84C8C6BDCEC89ABDA5C8F1BDF5C922BE5CC911BE24C935BE91C93DBF04"
$"C93DBECAC93DBF3EC916BFA5C931BF73C8FEBFD4C89AC038C8D4C005C8EEC05D"
$"58C0D7C92CC092C975C117C988C1B0C988C160C988C1FAC966C27CC97DC23EC9"
$"4EC2BBC8F1C321C927C2F1C8BCC34DC821C38BC878C370C7CCC3A5C6E7C3B4C7"
$"63C3B4C68DC3B4C5C5C399C62EC3AAC562C384C4D6C348C511C36AC4F5C2D4C5"
$"34C1EAC515C25EC58CC210C616C236C5D7C229C653C23EC6E2C242C698C242C6"
$"E2C2420F0A000100000A010101000A020102000A030103000A040104000A0501"
$"05000A060106000A010107000A000108000A000109000A07010A000A00010B00"
$"0A00010C000A01010D000A00010E00"
};

BIN
misc/logo/logo-128x128.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
misc/logo/logo-64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

302
misc/logo/logo.svg Normal file
View File

@ -0,0 +1,302 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="63.999996"
height="63.999996"
viewBox="0 0 16.933332 16.933333"
version="1.1"
id="svg8"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="logo.svg"
inkscape:export-filename="logo-64x64.png"
inkscape:export-xdpi="96.000008"
inkscape:export-ydpi="96.000008">
<title
id="title1733">n³ logo</title>
<defs
id="defs2">
<linearGradient
inkscape:collect="always"
id="linearGradient4258">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop4254" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop4256" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3891">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3887" />
<stop
style="stop-color:#000000;stop-opacity:0;"
offset="1"
id="stop3889" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3746">
<stop
style="stop-color:#000000;stop-opacity:0"
offset="0"
id="stop3742" />
<stop
id="stop3750"
offset="0.68665242"
style="stop-color:#000000;stop-opacity:0" />
<stop
style="stop-color:#000000;stop-opacity:1"
offset="1"
id="stop3744" />
</linearGradient>
<linearGradient
inkscape:collect="always"
id="linearGradient3628">
<stop
style="stop-color:#000000;stop-opacity:1"
offset="0"
id="stop3624" />
<stop
style="stop-color:#000000;stop-opacity:0"
offset="1"
id="stop3626" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3628"
id="radialGradient4190"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.10643412,0.08213184,-0.08695471,0.11268405,2.5028417,-19.507024)"
cx="80.745285"
cy="31.199144"
fx="80.745285"
fy="31.199144"
r="17.514044" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3628"
id="radialGradient4200"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.1591284,-0.22144644,0.05150741,0.03701252,-10.674157,4.5498963)"
cx="63.691868"
cy="24.91503"
fx="63.691868"
fy="24.91503"
r="16.80954" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3746"
id="radialGradient4206"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.08312121,-0.16218012,0.2763752,0.1416496,-5.8976633,2.3429863)"
cx="109.63785"
cy="27.735554"
fx="109.63785"
fy="27.735554"
r="14.917971" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3891"
id="radialGradient4208"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.77009845,-0.00589491,0.0032956,0.4305302,1.4732687,-112.12628)"
cx="10.145939"
cy="261.29977"
fx="10.145939"
fy="261.29977"
r="7.9343286" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient4258"
id="radialGradient4260"
cx="38.219185"
cy="-11.155752"
fx="38.219185"
fy="-11.155752"
r="2.5266471"
gradientTransform="matrix(0.41700468,-0.5564057,0.25660676,0.1923169,-8.5901303,12.321222)"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3891"
id="radialGradient4271"
cx="36.437771"
cy="11.167927"
fx="36.437771"
fy="11.167927"
r="0.92064488"
gradientTransform="matrix(0.79726776,-1.0594042,0.6692442,0.50364803,-33.972333,27.585938)"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="43.627536"
inkscape:cy="44.431591"
inkscape:document-units="mm"
inkscape:current-layer="layer2"
showgrid="true"
units="px"
inkscape:snap-bbox="true"
inkscape:snap-bbox-midpoints="false"
inkscape:bbox-nodes="true"
inkscape:object-nodes="false"
inkscape:snap-global="true"
inkscape:snap-nodes="true"
inkscape:window-width="1918"
inkscape:window-height="1060"
inkscape:window-x="0"
inkscape:window-y="18"
inkscape:window-maximized="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
showguides="false">
<inkscape:grid
type="xygrid"
id="grid815"
empspacing="2"
dotted="true"
originx="0"
originy="0" />
<inkscape:grid
type="xygrid"
id="grid1158"
spacingx="16.933333"
spacingy="16.933333"
empcolor="#3fff3f"
empopacity="0.25098039"
enabled="true"
color="#52ff3f"
opacity="0.1254902"
originx="0"
originy="0" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>n³ logo</dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Léo Villeveygoux</dc:title>
</cc:Agent>
</dc:creator>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="fg"
transform="translate(1.6666665e-6,16.933336)"
style="display:inline">
<path
sodipodi:nodetypes="ccccccccccccccccscccsccccccccccccccccscccccccccccccscccccsccsccccc"
inkscape:connector-curvature="0"
id="path4096"
d="m 7.5563837,-16.683514 c -6.37e-4,4e-5 -0.06582,0.008 -0.08984,0.0137 -0.04805,0.0106 -0.07759,0.0228 -0.101563,0.0332 -0.04795,0.0209 -0.07078,0.0351 -0.0918,0.0488 -0.04203,0.0274 -0.06833,0.0495 -0.0957,0.0723 -0.05474,0.0455 -0.10969,0.0967 -0.175781,0.16016 -0.132182,0.127 -0.300521,0.29823 -0.492188,0.50195 -0.146719,0.15595 -0.277344,0.28701 -0.388672,0.39649 -0.0057,-0.003 -0.0078,-0.004 -0.01367,-0.008 -0.197393,-0.11237 -0.466421,-0.2688 -0.753907,-0.4414 -0.292561,-0.17566 -0.563176,-0.33604 -0.765625,-0.45313 -0.101224,-0.0585 -0.185684,-0.10714 -0.25,-0.14258 -0.03216,-0.0177 -0.05714,-0.0313 -0.08398,-0.0449 -0.01342,-0.007 -0.02769,-0.0122 -0.04883,-0.0215 -0.01057,-0.005 -0.02139,-0.0114 -0.04492,-0.0195 -0.01177,-0.004 -0.02683,-0.008 -0.05078,-0.0137 -0.02395,-0.006 -0.124654,-0.0156 -0.125,-0.0156 -0.05674,0 -0.203301,0.0121 -0.333985,0.10937 -0.130683,0.0973 -0.184045,0.2292 -0.205078,0.30469 -0.04207,0.15099 -0.02811,0.20268 -0.02539,0.29102 0.0054,0.17668 0.02754,0.44302 0.07031,0.95703 0.02009,0.24144 0.03761,0.47757 0.05078,0.66211 0.01317,0.18453 0.02149,0.35714 0.02149,0.32617 -2.5e-5,-0.0716 0.0084,-0.0136 -0.08984,0.12305 -0.09824,0.13666 -0.280681,0.34121 -0.548828,0.60546 -0.331583,0.32677 -0.546477,0.51342 -0.689453,0.83204 -0.142977,0.31862 -0.12766,0.605 -0.128907,1.01953 -0.0019,0.65046 0.02339,0.50097 -0.0957,0.84179 -0.144761,0.41429 -0.289011,0.6739003 -0.884765,1.5566403 -0.27946103,0.41409 -0.54683003,0.82021 -0.66601603,1.04493 -0.389514,0.73442 -0.574283,1.51442 -0.394531,2.20507 0.234069,0.89938 1.04359803,1.46551 2.00976503,1.57227 0.08937,0.18231 0.157509,0.38673 0.316407,0.48242 h 0.002 c 0.344505,0.20741 0.757366,0.16421 1.074218,0.0137 0.316853,-0.15053 0.584433,-0.40119 0.802735,-0.72265 0.11807,-0.17388 0.279753,-0.46209 0.423828,-0.73828 0.267813,-0.5134 0.424453,-0.75918 0.673828,-0.98438 0.249375,-0.2252 0.638049,-0.4572 1.359375,-0.83203 0.492658,-0.25601 0.795852,-0.45655 1.134766,-0.66797 -3.2e-5,0.0656 0.0067,0.12864 0.0039,0.18945 -0.02949,0.65113 -0.155996,1.13801 -0.449219,1.72266 -0.266512,0.53141 -0.429772,0.70223 -1.361329,1.54102 -0.567672,0.51114 -0.922548,0.84685 -1.177734,1.16015 -0.255186,0.31331 -0.40187,0.6268 -0.484375,0.94336 -0.153164,0.58764 -0.184601,1.08693002 -0.164063,1.55274002 L 4.2498067,-3.675972e-6 H 16.933332 L 16.919662,-1.2538237 c -0.0264,-2.50458 -0.581284,-5.74387 -1.388672,-8.16016 -0.567382,-1.6980103 -1.186678,-2.8095203 -2.121093,-3.7480403 -0.824138,-0.82775 -1.808365,-1.36141 -2.937501,-1.58985 -0.460672,-0.0932 -1.2090663,-0.0911 -1.8593753,-0.0488 l 0.216796,-0.0137 -0.277343,-0.60742 c -0.129838,-0.28446 -0.245022,-0.52486 -0.335938,-0.70312 -0.04546,-0.0891 -0.0838,-0.16151 -0.121094,-0.22461 -0.01865,-0.0315 -0.03654,-0.0597 -0.06445,-0.0977 -0.01396,-0.019 -0.02894,-0.0405 -0.0625,-0.0742 -0.01678,-0.0169 -0.03866,-0.0381 -0.07617,-0.0644 -0.01876,-0.0132 -0.04084,-0.0276 -0.07227,-0.043 -0.03143,-0.0154 -0.12448,-0.0429 -0.125,-0.043 h -0.0039 l -0.0019,-0.002 c -5.15e-4,-10e-5 -0.132175,-0.01 -0.132812,-0.01 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:0px;word-spacing:0px;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.05833328;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="path4098"
d="m 6.4080867,-3.7690437 c 0.938534,-0.84507 1.188659,-1.11552 1.48007,-1.69657 0.320921,-0.63988 0.47318,-1.22312 0.505483,-1.9363 0.02009,-0.44367 -0.02591,-0.99383 -0.08833,-1.05625 -0.01983,-0.0198 -0.09943,0.0146 -0.196664,0.0851 -0.362858,0.26298 -0.902924,0.58065 -1.625708,0.95624 -1.458811,0.75805 -1.708252,0.98331 -2.259881,2.04078 -0.136798,0.26224 -0.312882,0.57127 -0.391298,0.68675 -0.348405,0.51305 -0.842285,0.74905 -1.167444,0.55329 -0.136991,-0.0825 -0.203307,-0.18758 -0.23386,-0.37066 -0.0206,-0.1234 -0.02893,-0.12948 -0.189186,-0.13815 -0.869164,-0.047 -1.47390803,-0.49276 -1.66510103,-1.22739 -0.125725,-0.48307 0.0075,-1.1762 0.35022,-1.82239 0.076,-0.14329 0.36220403,-0.59246 0.63600503,-0.99816 0.601277,-0.89093 0.78603,-1.21845 0.946654,-1.6781303 0.120217,-0.34405 0.12288,-0.36238 0.124815,-1.01425 0.0025,-0.83103 -0.0022,-0.82067 0.662064,-1.47528 0.558243,-0.55015 0.795236,-0.87983 0.795158,-1.10615 -2.8e-5,-0.0813 -0.0332,-0.54616 -0.07371,-1.033 -0.08546,-1.02692 -0.08733,-1.08802 -0.03345,-1.08802 0.02217,0 0.515642,0.2854 1.096601,0.63421 0.58096,0.34881 1.083868,0.63511 1.117573,0.63621 0.03371,10e-4 0.347056,-0.30174 0.696336,-0.67299 0.374566,-0.39812 0.657987,-0.67043 0.690965,-0.66387 0.03324,0.007 0.230015,0.39256 0.485181,0.95161 l 0.429268,0.94049 0.146868,-0.01 c 0.609325,-0.0396 1.4254303,-0.0214 1.7210693,0.0384 1.033646,0.20912 1.909331,0.68342 2.667218,1.44463 0.872014,0.87585 1.440968,1.88647 1.994305,3.5424503 0.784909,2.34901 1.335797,5.56889 1.361403,7.99842 l 0.0076,0.71920002 H 4.7566417 c -0.01888,-0.4282 0.0079,-0.85904002 0.147789,-1.39575002 0.139882,-0.53671 0.378578,-0.83142 1.503656,-1.84447 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;display:inline;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.05833328;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill" />
<path
inkscape:connector-curvature="0"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;display:inline;fill:url(#radialGradient4190);fill-opacity:1;stroke:none;stroke-width:1.05833328;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
d="m 14.019296,-0.52863368 c -0.03236,-0.37147 -0.05679,-0.71947002 -0.168981,-1.35909002 -0.15856,-0.90396 -0.383199,-2.00523 -0.634071,-3.1042 -0.25087,-1.09897 -0.528185,-2.19572 -0.792716,-3.09077 -0.264533,-0.89505 -0.516175,-1.58828 -0.715719,-1.8805 -0.190129,-0.2784503 -0.377891,-0.5254103 -0.572058,-0.7420803 -0.194167,-0.21666 -0.394798,-0.40292 -0.611333,-0.5612 -0.216532,-0.15828 -0.448667,-0.28843 -0.7058983,-0.39171 -0.131273,-0.0527 -0.29119,-0.0793 -0.436667,-0.11834 0.07747,0.0695 0.156587,0.13071 0.227892,0.22944 0.09939,0.19294 0.158695,0.41322 0.167431,0.65319 0.0087,0.23998 -0.03275,0.49928 -0.135908,0.77102 -0.103153,0.2717303 -0.267553,0.5556703 -0.503845,0.8438703 -0.233789,0.28516 -0.540714,0.57454 -0.925525,0.86093 0.03184,-0.0131 0.08412,-0.0497 0.09353,-0.0403 0.06242,0.0624 0.108457,0.6126 0.08837,1.05627 -0.0323,0.71318 -0.184474,1.29644 -0.505395,1.93632 -0.291411,0.58105 -0.541995,0.85146 -1.48053,1.69653 -1.125078,1.01305 -1.363385,1.30814 -1.503267,1.84485 -0.139889,0.53671 -0.166675,0.96758002 -0.147795,1.39578002 z"
id="path4106" />
<path
inkscape:connector-curvature="0"
id="path4116"
d="m 7.5855797,-16.154034 c -0.03298,-0.007 -0.316348,0.26592 -0.690914,0.66404 -0.34928,0.37125 -0.662888,0.67383 -0.696598,0.67283 -0.0337,-10e-4 -0.536801,-0.28733 -1.117761,-0.63614 -0.58096,-0.34881 -1.074404,-0.63407 -1.096574,-0.63407 -0.05388,0 -0.05187,0.0609 0.03359,1.08779 0.04051,0.48684 0.07387,0.95171 0.0739,1.03301 7.7e-5,0.22632 -0.237058,0.55625 -0.795301,1.1064 -0.664264,0.65461 -0.659475,0.64381 -0.661975,1.47484 -0.0019,0.65187 -0.0048,0.67036 -0.125057,1.01441 -0.160624,0.4596803 -0.345435,0.7870003 -0.946712,1.6779303 -0.273801,0.4057 -0.55962,0.8551 -0.63562003,0.99839 -0.34272,0.64619 -0.476091,1.33956 -0.350366,1.82263 0.191193,0.73463 0.79585103,1.18032 1.66501403,1.22732 0.08533,0.005 0.123824,0.005 0.147795,0.0264 0.474897,-0.71432 0.990332,-1.57106 1.609204,-2.52181 0.642554,-0.98713 1.335583,-2.00634 2.022099,-2.85977 0.343258,-0.4267203 0.685028,-0.8121303 1.018026,-1.1312003 0.332998,-0.31907 0.65726,-0.57187 0.965832,-0.73381 0.154287,-0.081 0.304578,-0.13915 0.450102,-0.17156 0.145524,-0.0324 0.286173,-0.0389 0.421163,-0.0165 0.13499,0.0223 0.264371,0.0733 0.387056,0.15658 0.04214,0.0286 0.07884,0.0836 0.119373,0.11989 0.01427,0.004 0.02839,0.008 0.04289,0.0114 l -0.920357,-2.49752 -0.0047,5.1e-4 -0.428914,-0.94051 c -0.255166,-0.55905 -0.452002,-0.94436 -0.485242,-0.95136 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;display:inline;fill:url(#radialGradient4200);fill-opacity:1;stroke:none;stroke-width:1.05833328;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill" />
<path
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;display:inline;fill:url(#radialGradient4206);fill-opacity:1;stroke:none;stroke-width:1.05833328;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
d="m 8.5043867,-14.262674 1.165911,2.68461 c 0.133392,0.0334 0.6612493,0.21144 0.7796483,0.25898 2.649479,0.14717 5.883653,2.4870503 2.584913,-1.46978 -0.757881,-0.76121 -1.633374,-1.23575 -2.667019,-1.44487 -0.29564,-0.0598 -1.1120183,-0.0778 -1.7213433,-0.0382 z"
id="path4122"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;display:inline;fill:url(#radialGradient4208);fill-opacity:1;stroke:none;stroke-width:1.05833328;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
d="m 6.4080867,-3.7690437 c 3.9106623,-2.0517737 6.5564953,-2.316357 9.7896183,-0.1353155 0.116365,0.9327131 0.184394,1.8392243 0.193006,2.6563355 l 0.0076,0.71920002 H 4.7566417 c -0.01888,-0.4282 0.0079,-0.85904002 0.147789,-1.39575002 0.139882,-0.53671 0.378578,-0.83142 1.503656,-1.84447 z"
id="path4124"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<path
style="display:inline;opacity:0.33200001;fill:url(#radialGradient4271);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 2.3150987,-4.6632687 c 0.84336,-0.578776 1.653646,-2.182813 1.670183,-1.852083 0.01654,0.330729 -0.496094,2.645833 -1.35599,2.067057 -0.859896,-0.578776 -0.314193,-0.214974 -0.314193,-0.214974 z"
id="path4262"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccscccsccscsccccc"
inkscape:connector-curvature="0"
d="m 6.8791644,-6.5799967 c 0.277182,-0.0747 0.617361,-0.14533 1.020535,-0.21177 0.411575,-0.0665 0.856747,-0.0997 1.335516,-0.0997 0.470371,0 0.8609466,0.0664 1.1717256,0.19932 0.310781,0.12456 0.554366,0.30725 0.730754,0.54808 0.18479,0.23253 0.314982,0.51489 0.390577,0.8470599 0.0756,0.32387 0.113393,0.68512 0.113393,1.08374 v 3.1548598 h -1.5875 v -2.9555598 c 0,-0.5481 -0.06013,-0.94256 -0.1803996,-1.18338 -0.120264,-0.2408299 -0.364802,-0.3612399 -0.733616,-0.3612399 -0.112248,0 -0.224495,0.004 -0.336742,0.0125 -0.10423,0.008 -0.216478,0.0208 -0.336743,0.0373 v 4.4503697 h -1.5875 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.11111069px;line-height:80.00000119%;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold';letter-spacing:0px;word-spacing:0px;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:0.23356323px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path4273" />
<path
sodipodi:nodetypes="ccscccsccscsccccc"
inkscape:connector-curvature="0"
d="m 7.4083317,-6.0508267 c 0.277182,-0.0747 0.617361,-0.14533 1.020535,-0.21177 0.411575,-0.0665 0.856747,-0.0997 1.335516,-0.0997 0.4703713,0 0.8609463,0.0664 1.1717253,0.19932 0.310781,0.12456 0.554366,0.30725 0.730754,0.54808 0.18479,0.23253 0.314982,0.5148899 0.390577,0.8470599 0.0756,0.32387 0.113393,0.68512 0.113393,1.08374 v 2.6257298 h -1.5875 v -2.2633598 c 0,-0.51127 -0.06013,-0.87922 -0.180399,-1.10385 -0.120264,-0.22465 -0.364802,-0.33697 -0.7336163,-0.33697 -0.112248,0 -0.224495,0.004 -0.336742,0.0117 -0.10423,0.007 -0.216478,0.0194 -0.336743,0.0348 v 3.6577098 h -1.5875 z"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.11111069px;line-height:80.00000119%;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.23356323px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path4158" />
<path
inkscape:connector-curvature="0"
id="path4160"
d="m 2.2657997,-6.5970811 c 2.39e-4,-0.13158 -0.102021,-0.29549 -0.222752,-0.3571395 -0.367285,-0.18754 -0.694817,0.1635095 -0.738403,0.7914195 -0.01108,0.15956 -0.0093,0.31791 0.0038,0.35187 0.0276,0.071 0.04155,0.0639 0.42986,-0.20266 0.388306,-0.26657 0.527201,-0.43437 0.527446,-0.58349 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.05833328;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill" />
<path
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;opacity:0.44600004;fill:url(#radialGradient4260);fill-opacity:1;stroke:none;stroke-width:3.37220645;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
d="m 5.2460787,-10.568226 c 0.812188,-0.809811 1.765374,-2.190004 1.765374,-2.556274 0,-0.0838 -0.135642,-0.203925 -0.301459,-0.267015 -0.752294,-0.286133 -1.733457,0.02549 -2.369685,0.748534 -0.347846,0.396158 -0.900949,0.953943 -1.423035,3.0038925 -0.04718,0.1852661 -0.424024,0.9086143 0.377177,0.4985965 0.801204,-0.4100179 1.308944,-0.7869297 1.951628,-1.427734 z"
id="path4252"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ssccscs" />
<path
inkscape:connector-curvature="0"
id="path4162"
d="m 4.5914317,-10.992111 c 0.254897,-0.254151 0.554045,-0.687311 0.554045,-0.802261 0,-0.0263 -0.04257,-0.064 -0.09461,-0.0838 -0.2361,-0.0898 -0.544028,0.008 -0.743702,0.23492 -0.109168,0.12433 -0.747614,1.164311 -0.747614,1.217801 0,0.06 0.167933,0.0101 0.419382,-0.11858 0.25145,-0.12868 0.410799,-0.24697 0.612499,-0.44808 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.05833328;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill" />
<path
inkscape:connector-curvature="0"
id="path4164"
d="m 9.2282597,-13.755752 a 0.26460981,0.26460981 0 1 0 0.05273,0.52539 c 1.2306523,-0.12455 2.0604593,0.20175 2.7285163,0.76758 0.668056,0.56582 1.165386,1.39097 1.630859,2.255861 0.179199,0.3329602 0.577259,1.4975302 0.927734,3.0839804 0.350476,1.5864495 0.671479,3.6240594 0.771485,5.8124992 a 0.26490778,0.26490778 0 1 0 0.529297,-0.0234 c -0.101686,-2.2251898 -0.428845,-4.2894697 -0.785157,-5.9023392 -0.356311,-1.6128702 -0.723527,-2.7469202 -0.978515,-3.2207004 -0.472697,-0.878311 -0.99272,-1.763511 -1.753906,-2.408211 -0.761187,-0.6447 -1.771873,-1.02737 -3.1230473,-0.89062 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:80.00000119%;font-family:'DejaVu Sans';-inkscape-font-specification:'DejaVu Sans';font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:0px;word-spacing:0px;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.5291667;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
sodipodi:nodetypes="ccccccccccc"
inkscape:connector-curvature="0"
id="path4275"
d="m 13.309647,-10.683461 c -3.5259213,0.8942402 -2.467588,6.4504898 0.896553,5.2949099 0.277432,-0.0861 0.529922,-0.20786 0.742188,-0.38476 l 0.0059,-0.006 0.0078,-0.008 c 0.200661,-0.17837 0.36145,-0.4014 0.457031,-0.65235 0.08874,-0.23296 -0.07914,-0.44979 -0.07914,-0.7037295 -0.264584,-1.5875002 -0.264584,-2.1166602 -1.157186,-3.4173504 -0.0012,-3.9e-4 -0.0027,3.9e-4 -0.0039,0 -0.266042,-0.0881 -0.551145,-0.12305 -0.86914,-0.12305 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.11111069px;line-height:80.00000119%;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold';font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:0px;word-spacing:0px;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.16429496;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
inkscape:connector-curvature="0"
id="path4168"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.11111069px;line-height:80.00000119%;font-family:'Ubuntu Mono';-inkscape-font-specification:'Ubuntu Mono Bold';letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.16429496;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers stroke fill"
d="m 13.205251,-6.7970011 q 0.368361,0 0.506496,-0.11511 0.149645,-0.1151195 0.149645,-0.2762795 0,-0.4144001 -0.725209,-0.4144001 h -0.425918 v -0.8403301 h 0.425918 q 0.241736,0 0.391383,-0.0921 0.149647,-0.0921 0.149647,-0.28779 0,-0.32231 -0.448939,-0.32231 -0.241738,0 -0.471962,0.0806 -0.230226,0.0806 -0.448941,0.17266 l -0.391382,-0.80578 q 0.253249,-0.16115 0.63312,-0.27626 0.391383,-0.1266202 0.759743,-0.1266202 0.414405,0 0.690677,0.0921 0.28778,0.0921 0.46045,0.2532602 0.172659,0.14964 0.241735,0.36836 0.06909,0.20721 0.06909,0.43744 0,0.2187 -0.103625,0.41439 -0.09207,0.18419 -0.322314,0.3798801 0.333821,0.14965 0.471953,0.4144 0.149648,0.25326 0.149648,0.5640601 0,0.2877795 -0.09208,0.5295095 -0.09207,0.24173 -0.299287,0.42592 -0.207203,0.17268 -0.541028,0.27628 -0.333827,0.10365 -0.817301,0.10365 -0.345337,0 -0.748232,-0.0691 -0.391384,-0.0806 -0.621608,-0.20719 l 0.241736,-0.9093995 q 0.345339,0.1496595 0.587075,0.1956995 0.241736,0.0345 0.529518,0.0345 z" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -0,0 +1,42 @@
#include "mach_gettime.h"
#include <mach/mach_time.h>
#define MT_NANO (+1.0E-9)
#define MT_GIGA UINT64_C(1000000000)
// TODO create a list of timers,
static double mt_timebase = 0.0;
static uint64_t mt_timestart = 0;
int clock_gettime(clockid_t clk_id, struct timespec *tp)
{
kern_return_t retval = KERN_SUCCESS;
if (clk_id == TIMER_ABSTIME) {
if (!mt_timestart) { // only one timer, initialized on the first call to the TIMER
mach_timebase_info_data_t tb;
mach_timebase_info(&tb);
mt_timebase = tb.numer;
mt_timebase /= tb.denom;
mt_timestart = mach_absolute_time();
}
double diff = (mach_absolute_time() - mt_timestart) * mt_timebase;
tp->tv_sec = diff * MT_NANO;
tp->tv_nsec = diff - (tp->tv_sec * MT_GIGA);
} else { // other clk_ids are mapped to the corresponding mach clock_service
clock_serv_t cclock;
mach_timespec_t mts;
host_get_clock_service(mach_host_self(), clk_id, &cclock);
retval = clock_get_time(cclock, &mts);
mach_port_deallocate(mach_task_self(), cclock);
tp->tv_sec = mts.tv_sec;
tp->tv_nsec = mts.tv_nsec;
}
return retval;
}
/* Copyright (c) 2015-2018 Alf Watt - Open Source - https://opensource.org/licenses/MIT */

View File

@ -0,0 +1,28 @@
#ifndef mach_time_h
#define mach_time_h
#include <sys/types.h>
#include <sys/_types/_timespec.h>
#include <mach/mach.h>
#include <mach/clock.h>
/* The opengroup spec isn't clear on the mapping from REALTIME to CALENDAR
being appropriate or not.
http://pubs.opengroup.org/onlinepubs/009695299/basedefs/time.h.html */
// XXX only supports a single timer
#define TIMER_ABSTIME -1
#define CLOCK_REALTIME CALENDAR_CLOCK
#define CLOCK_MONOTONIC SYSTEM_CLOCK
typedef int clockid_t;
/* the mach kernel uses struct mach_timespec, so struct timespec
is loaded from <sys/_types/_timespec.h> for compatibility */
// struct timespec { time_t tv_sec; long tv_nsec; };
int clock_gettime(clockid_t clk_id, struct timespec *tp);
#endif
/* Copyright (c) 2015-2018 Alf Watt - Open Source - https://opensource.org/licenses/MIT */

67
misc/musl/musl-static-ubuntu.sh Executable file
View File

@ -0,0 +1,67 @@
#!/usr/bin/env sh
# Statically compile nnn with netbsd-curses, musl-fts and musl libc on Ubuntu
#
# netbsd-curses: https://github.com/sabotage-linux/netbsd-curses
# musl-fts: https://github.com/void-linux/musl-fts
# musl libc: https://www.musl-libc.org/
#
# Dependencies: git
#
# Usage: musl-static-ubuntu.sh [no_run]
# # optional argument - do not to execute the binary after compilation
#
# Notes:
# - run the script within the top-level nnn directory
# - installs musl & gits netbsd-curses, musl-fts libs
#
# Tested on Ubuntu 20.04 x86_64
# Author: Arun Prakash Jana
# Exit on first failure
set -e
# Output binary name
BIN=nnn-musl-static
# Install musl
sudo apt install -y --no-install-recommends musl musl-dev musl-tools
# Get netbsd-curses
[ ! -d "./netbsd-curses" ] && git clone https://github.com/sabotage-linux/netbsd-curses
# Enter the library dir
cd netbsd-curses
# Get the last known working version
git checkout v0.3.2
# Compile the static netbsd-curses libraries
if [ ! -d "./libs" ]; then
mkdir libs
else
rm -vf -- libs/*
fi
make CC=musl-gcc CFLAGS=-O3 LDFLAGS=-static all-static -j$(($(nproc)+1))
cp -v libcurses/libcurses.a libterminfo/libterminfo.a libs/
# Get musl-fts library
cd ..
[ ! -d "./musl-fts" ] && git clone https://github.com/void-linux/musl-fts --depth=1
# Compile the static musl-fts library
cd musl-fts
./bootstrap.sh
./configure
make CC=musl-gcc CFLAGS=-O3 LDFLAGS=-static -j$(($(nproc)+1))
# Compile nnn
cd ..
[ -e "./netbsd-curses" ] || rm -- "$BIN"
musl-gcc -O3 -DNORL -DNOMOUSE -std=c11 -Wall -Wextra -Wshadow -I./netbsd-curses/libcurses -I./musl-fts -o "$BIN" src/nnn.c -Wl,-Bsymbolic-functions -lpthread -L./netbsd-curses/libs -lcurses -lterminfo -static -L./musl-fts/.libs -lfts
strip "$BIN"
if [ -z "$1" ]; then
# Run the binary with it selected
./"$BIN" -d "$BIN"
fi

View File

@ -3,36 +3,41 @@
# #############################################################################
# natool: a wrapper script to patool to list, extract and create archives
#
# usage: natool [-l] [-x] [archive] [file/dir]
# usage: natool [-a] [-l] [-x] [archive] [file/dir]
#
# Examples:
# - create archive : natool -a archive.7z archive_dir
# - list archive : natool -l archive.7z
# - extract archive: natool -x archive.7z
# - create archive : natool archive.7z archive_dir
#
# Brief:
# natool is written to integrate patool (instead of the default atool) with nnn
# Two copies of this file should be dropped somewhere in $PATH - atool, apack
# A copies of this file should be dropped somewhere in $PATH as atool
#
# Author: Arun Prakash Jana
# Email: engineerarun@gmail.com
# Homepage: https://github.com/jarun/nnn
# Copyright © 2018 Arun Prakash Jana
# Copyright © 2019 Arun Prakash Jana
# #############################################################################
import sys
from subprocess import Popen, PIPE, DEVNULL
from subprocess import Popen, PIPE
if len(sys.argv) != 3:
print('usage: natool [-l] [-x] [archive] [file/dir]')
if len(sys.argv) < 3:
print('usage: natool [-a] [-l] [-x] [archive] [file/dir]')
sys.exit(0)
if sys.argv[1] == '-x':
cmd = ['patool', '--non-interactive', 'extract', sys.argv[2]]
if sys.argv[1] == '-a':
cmd = ['patool', '--non-interactive', 'create', sys.argv[2]]
cmd.extend(sys.argv[3:])
elif sys.argv[1] == '-l':
cmd = ['patool', '--non-interactive', 'list', sys.argv[2]]
cmd = ['patool', '--non-interactive', 'list']
cmd.extend(sys.argv[2:])
elif sys.argv[1] == '-x':
cmd = ['patool', '--non-interactive', 'extract']
cmd.extend(sys.argv[2:])
else:
cmd = ['patool', '--non-interactive', 'create', sys.argv[1], sys.argv[2]]
sys.exit(0)
pipe = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
out, err = pipe.communicate()

View File

@ -1,50 +1,61 @@
name: nnn
maintainer: Arun Prakash Jana <engineerarun@gmail.com>
license: BSD 2-Clause
summary: The missing terminal file manager for X.
summary: The unorthodox terminal file manager.
homepage: https://github.com/jarun/nnn
commands:
install:
- make PREFIX="/usr" strip install DESTDIR="${BP_DESTDIR}"
packages:
archlinux:
builddeps:
- make
- gcc
- pkg-config
deps:
- ncurses
container: "base/archlinux"
centos7.2:
centos7.5:
builddeps:
- make
- gcc
- pkgconfig
- ncurses-devel
- readline-devel
deps:
- ncurses
- readline
commands:
pre:
- yum install epel-release
centos7.3:
centos7.6:
builddeps:
- make
- gcc
- pkgconfig
- ncurses-devel
- readline-devel
deps:
- ncurses
- readline
commands:
pre:
- yum install epel-release
centos7.4:
centos7.7:
builddeps:
- make
- gcc
- pkgconfig
- ncurses-devel
- readline-devel
deps:
- ncurses
- readline
commands:
pre:
- yum install epel-release
centos8.0:
builddeps:
- make
- gcc
- pkgconfig
- ncurses-devel
- readline-devel
deps:
- ncurses
- readline
commands:
pre:
- yum install epel-release
@ -54,61 +65,77 @@ packages:
- gcc
- pkg-config
- libncursesw5-dev
- libreadline-dev
deps:
- libncursesw5
fedora25:
- readline-common
debian10:
builddeps:
- make
- gcc
- pkgconfig
- ncurses-devel
- pkg-config
- libncurses-dev
- libreadline-dev
deps:
- ncurses
fedora26:
- libncursesw6
- readline-common
fedora32:
builddeps:
- make
- gcc
- pkg-config
- ncurses-devel
- readline-devel
deps:
- ncurses
fedora27:
builddeps:
- make
- gcc
- pkg-config
- ncurses-devel
deps:
- ncurses
fedora28:
builddeps:
- make
- gcc
- pkg-config
- ncurses-devel
deps:
- ncurses
# opensuse42.3:
- readline
# opensuse15.2:
# builddeps:
# - make
# - gcc
# - pkg-config
# - readline-devel
# - ncurses-devel
# deps:
# - ncurses
# - libncurses6
# - libreadline7
# opensuse.tumbleweed:
# builddeps:
# - make
# - gcc
# - pkg-config
# - readline-devel
# - ncurses-devel
# deps:
# - libncurses6
# - libreadline8
ubuntu16.04:
builddeps:
- make
- gcc
- pkg-config
- libncursesw5-dev
- libreadline6-dev
deps:
- libncursesw5
- libreadline6
ubuntu18.04:
builddeps:
- make
- gcc
- pkg-config
- libncursesw5-dev
- libreadline-dev
deps:
- libncursesw5
- libreadline7
ubuntu20.04:
builddeps:
- make
- gcc
- pkg-config
- libncurses-dev
- libreadline-dev
deps:
- libncursesw6
- libreadline8

View File

@ -0,0 +1,30 @@
n ()
{
# Block nesting of nnn in subshells
[ "${NNNLVL:-0}" -eq 0 ] || {
echo "nnn is already running"
return
}
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to
# see. To cd on quit only on ^G, remove the "export" and make sure not to
# use a custom path, i.e. set NNN_TMPFILE *exactly* as follows:
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
# stty stop undef
# stty lwrap undef
# stty lnext undef
# The command builtin allows one to alias nnn to n, if desired, without
# making an infinitely recursive alias
command nnn "$@"
[ ! -f "$NNN_TMPFILE" ] || {
. "$NNN_TMPFILE"
rm -f -- "$NNN_TMPFILE" > /dev/null
}
}

17
misc/quitcd/quitcd.csh Normal file
View File

@ -0,0 +1,17 @@
# NOTE: set NNN_TMPFILE correctly if you use 'XDG_CONFIG_HOME'
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to see.
# To cd on quit only on ^G, set NNN_TMPFILE after the nnn invocation, and make
# sure not to use a custom path.
set NNN_TMPFILE=~/.config/nnn/.lastd
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
# stty stop undef
# stty lwrap undef
# stty lnext undef
# The backslash allows one to alias n to nnn if desired without making an
# infinitely recursive alias
alias n '\nnn; source "$NNN_TMPFILE"; rm -f -- "$NNN_TMPFILE"'

41
misc/quitcd/quitcd.elv Normal file
View File

@ -0,0 +1,41 @@
# Append this file to ~/.elvish/rc.elv (Elvish > 0.17.0)
use path
fn n {|@a|
# Block nesting of nnn in subshells
if (has-env NNNLVL) {
try {
if (>= $E:NNNLVL 1) {
echo "nnn is already running"
return
}
} catch e {
nop
}
}
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to
# see.
if (has-env XDG_CONFIG_HOME) {
set-env NNN_TMPFILE $E:XDG_CONFIG_HOME/nnn/.lastd
} else {
set-env NNN_TMPFILE $E:HOME/.config/nnn/.lastd
}
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
# stty stop undef
# stty lwrap undef
# stty lnext undef
# The e: prefix allows one to alias n to nnn if desired without making an
# infinitely recursive alias
e:nnn $@a
if (path:is-regular $E:NNN_TMPFILE) {
eval (slurp < $E:NNN_TMPFILE)
rm -- $E:NNN_TMPFILE
}
}

36
misc/quitcd/quitcd.fish Normal file
View File

@ -0,0 +1,36 @@
# Rename this file to match the name of the function
# e.g. ~/.config/fish/functions/n.fish
# or, add the lines to the 'config.fish' file.
function n --wraps nnn --description 'support nnn quit and change directory'
# Block nesting of nnn in subshells
if test -n "$NNNLVL" -a "$NNNLVL" -ge 1
echo "nnn is already running"
return
end
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to
# see. To cd on quit only on ^G, remove the "-x" from both lines below,
# without changing the paths.
if test -n "$XDG_CONFIG_HOME"
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
else
set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
end
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
# stty stop undef
# stty lwrap undef
# stty lnext undef
# The command function allows one to alias this function to `nnn` without
# making an infinitely recursive alias
command nnn $argv
if test -e $NNN_TMPFILE
source $NNN_TMPFILE
rm -- $NNN_TMPFILE
end
end

37
misc/quitcd/quitcd.nu Normal file
View File

@ -0,0 +1,37 @@
# Run nnn with dynamic changing directory to the environment.
#
# $env.XDG_CONFIG_HOME sets the home folder for `nnn` folder and its $env.NNN_TMPFILE variable.
# See manual NNN(1) for more information.
#
# Import module using `use quitcd.nu n` to have `n` command in your context.
export def --env n [
...args : string # Extra flags to launch nnn with.
--selective = false # Change directory only when exiting via ^G.
] -> nothing {
# The behaviour is set to cd on quit (nnn checks if $env.NNN_TMPFILE is set).
# Hard-coded to its respective behaviour in `nnn` source-code.
let nnn_tmpfile = $env
| default '~/.config/' 'XDG_CONFIG_HOME'
| get 'XDG_CONFIG_HOME'
| path join 'nnn/.lastd'
| path expand
# Launch nnn. Add desired flags after `^nnn`, ex: `^nnn -eda ...$args`,
# or make an alias `alias n = n -eda`.
if $selective {
^nnn ...$args
} else {
NNN_TMPFILE=$nnn_tmpfile ^nnn ...$args
}
if ($nnn_tmpfile | path exists) {
# Remove <cd '> from the first part of the string and the last single quote <'>.
# Fix post-processing of nnn's given path that escapes its single quotes with POSIX syntax.
let path = open $nnn_tmpfile | str substring 4..-1 | str replace --all `'\''` `'`
^rm -- $nnn_tmpfile
cd $path
}
}

37
misc/test/benchmark.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/sh
#
# Usage: ./misc/test/benchmark.sh ./nnn /tmp/testdir1 ./testdir2 ...
#
# Don't forget to build nnn in benchmark mode: make O_BENCH=1
# Use a test dir filled with genfiles.sh to get interesting output
# (or maybe /usr/lib/)
LANG=C
TIME_VAL=${TIME_VAL:-"real"}
SAMPLES=${SAMPLES:-100}
EXE=$1
bench_val () {
(time "$1" "$2") 2>&1 |\
awk '$1=="'"$TIME_VAL"'"{match($2, /[0-9]*\.[0-9]*/) ; print substr($2, RSTART, RLENGTH)}'
}
bench_dir () {
i=$SAMPLES
printf "$2"
while [ $((i--)) -gt 0 ] ; do
printf "\t%s" "$(bench_val "$1" "$2")"
done
printf "\n"
}
shift
for dir in "$@" ; do
bench_dir "$EXE" "$dir"
done

8
misc/test/genfiles.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# Generates 100000 files in the current directory
i=1; while [ $i -le 100000 ]; do
mktemp -p . -t 'XXXXXXXXXXXXXXXXXXXXX'
i=$(( i + 1 ))
done

View File

@ -7,7 +7,7 @@ test -e outdir && {
exit 1
}
mkdir -p outdir && cd outdir
mkdir -p outdir && cd outdir || exit 1
echo 'It works!' > normal.txt
echo 'Με δουλέβει;' > 'κοινό.txt'
@ -30,6 +30,21 @@ echo 'chmod 000 test/cage' > cage/lock.sh
echo 'chmod 755 test/cage' > cage-unlock.sh
mkdir -p cage/lion
echo 'chmod 000 test/cage' > cage/lion/lock.sh
mkdir -p korean
touch 'korean/[ENG sub] PRODUCE48 울림ㅣ김채원ㅣ행복 나눠주는 천사소녀 @자기소개_1분 PR 180615 EP.0-Cgnmr6Fd82'
touch 'korean/[ENG sub] PRODUCE48 [48스페셜] 윙크요정, 내꺼야!ㅣ김채원(울림) 180615 EP.0-K7ulTiuJZK8.mp4'
touch 'korean/[FULL ENG SUB] 181008 SALEWA x IZ_ONE Long Padding Photoshoot Behind Film-[오늘의 시구] 아이즈원 (IZONE) 장원영&미야와키 사쿠라! 시구 시타! (10.06)-VmDl5eBJ3x0.mkv'
touch 'korean/IZ_ONE (아이즈원) - 1st Mini Album [COLOR_IZ] Highlight Medley-w9V2xFrYIgk.web'
touch 'korean/IZ_ONE (아이즈원) - 1st Mini Album [COLOR_IZ] MV TEASER 1-uhnJLBNBNto.mkv'
touch 'korean/IZ_ONE CHU [1회] ′순도 100% 우리즈원 숙소 생활 ★최초 공개★ 181025 EP.1-pcutrQN1Sbg.mkv'
touch 'korean/IZ_ONE CHU [1회_예고] 아이즈원 데뷔 준비 과정 ★독점 공개★ 아이즈원 츄 이번주 (목) 밤 11시 첫방송 181025'
touch 'korean/IZ_ONE CHU [1회] 도치기현 1호 이모 팬과의 만남! 181025 EP.1-5kYoReT5x44.mp4'
touch 'korean/IZ_ONE CHU [1회] 12명 소녀들의 새로운 시작′ 앞으로 아이즈원 잘 부탁해♥ 181025 EP.1-RVNvgbdLQLQ'
touch 'korean/IZ_ONE CHU [1회] ′앗..그것만은! 자비없는 합숙생활 폭로전 181025 EP.1-AmP5KzpoI38.mkv'
touch 'korean/IZ_ONE CHU [1회] 휴게소 간식 내기 노래 맞히기 게임 181025 EP.1-LyNDKflpWYE.mp4'
touch 'korean/IZ_ONE CHU [1회] 2018 아이즈원 걸크러시능력시험 (feat. 치타쌤) 181025 EP.1-9qHWpbo0eB8.mp4'
touch 'korean/IZ_ONE CHU [1회] ′돼지요′ 아니죠, ′되지요′ 맞습니다! (feat. 꾸라먹방) 181025EP.1-WDLFqMWiKn'
touch 'korean/IZ_ONE CHU [1회] ′두근두근′ 첫 MT를 앞둔 비글력 만렙의 아이즈원 181025 EP.1'
mkdir -p unicode
touch 'unicode/Malgudi Days - मालगुडी डेज - E05. Swami and Friends - स्वामी और उसके दोस्त (Part 1)'
touch 'unicode/Malgudi Days - मालगुडी डेज - E05. Swami and Friends - स्वामी और उसके दोस्त (Part 2)'

20
misc/test/plot-bench.py Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env python3
#
# Usage: ./plot-bench.py datafile
# (where datafile is the output of benchmark.sh)
import matplotlib.pyplot as plt
import sys
def bench_file_to_lists(infile):
return [[float(entry) for entry in line.split('\t')[1:]] for line in infile.readlines()]
def plot_data(data):
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
ax.violinplot(data)
plt.savefig("plot.svg")
filename = sys.argv[1]
plot_data(bench_file_to_lists(open(filename)))

758
nnn.1
View File

@ -1,323 +1,619 @@
.Dd Nov 23, 2018
.Dd Aug 27, 2023
.Dt NNN 1
.Os
.Sh NAME
.Nm nnn
.Nd the missing terminal file manager for X
.Nd The unorthodox terminal file manager.
.Sh SYNOPSIS
.Nm
.Op Ar -aAcCdDeEfgHJKnQrRSuUVxh
.Op Ar -b key
.Op Ar -c N
.Op Ar -e
.Op Ar -i
.Op Ar -l
.Op Ar -S
.Op Ar -v
.Op Ar -h
.Op Ar -F val
.Op Ar -l val
.Op Ar -p file
.Op Ar -P key
.Op Ar -s name
.Op Ar -t secs
.Op Ar -T key
.Op Ar PATH
.Sh DESCRIPTION
.Nm
(Noice is Not Noice) is a performance-optimized, feature-packed fork of noice (http://git.2f30.org/noice/) with seamless desktop integration, simplified navigation, \fInavigate-as-you-type\fR mode, disk usage analyzer mode, bookmarks, contexts, application launcher, familiar navigation shortcuts, subshell spawning and much more. It remains a simple and efficient file manager that stays out of your way.
.Pq Nnn's Not Noice
is a performance-optimized, feature-packed fork of noice
.Em http://git.2f30.org/noice/
with seamless desktop integration, simplified navigation,
.Em type-to-nav
mode with dir auto-enter, disk usage analyzer mode, bookmarks,
contexts, application launcher, familiar navigation shortcuts,
subshell spawning and much more. It remains a simple and
efficient file manager that stays out of your way.
.Pp
.Nm
opens the current working directory by default if
opens the current working directory if
.Ar PATH
is not specified.
is not specified. If
.Ar PATH
is specified and it exists,
.Nm
will open it. If the
.Ar PATH
doesn't exist and ends with a \fB/\fR,
.Nm
will attempt to create the directory tree and open it. Otherwise,
.Ar PATH
is considered a path to a regular file and
.Nm
attempts to create the complete directory tree to the file, open
the parent directory and prompt to create the new file in it with
the base filename.
.Sh KEYBINDS
.Pp
Press
.Ql \&?
in
.Nm
supports both vi-like and emacs-like key bindings as listed below.
.Pp
NAVIGATION
.Pp
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
.It Ic [Up], k, ^P
Move to previous entry
.It Ic [Down], j, ^N
Move to next entry
.It Ic [PgUp], ^U
Scroll up half a page
.It Ic [PgDn], ^D
Scroll down half a page
.It Ic [Home], g, ^, ^A
Move to the first entry
.It Ic [End], G, $, ^E
Move to the last entry
.It Ic [Left], [Backspace], h, ^H
Go to parent directory
.It Ic [Right], [Enter], l, ^M
Open file or enter directory
.It Ic ~
Change to the HOME directory
.It Ic &
Change to initial directory
.It Ic \-
Change to the last visited directory
.It Ic \&.
Toggle show hidden . (dot) files
.It Ic /
Change filter (more information below)
.It Ic [Insert], ^I
Toggle navigate-as-you-type mode
.It Ic b
Pin current directory
.It Ic ^W
Visit pinned directory
.It Ic `, ^/
Leader key
.It Ic LeaderN
Switch to context N
.It Ic Esc
Exit prompt
.It Ic ^L
Force a redraw, clear prompt
.It Ic q
Quit the current context
.It Ic ^G
Quit and change directory
.It Ic Q, ^Q
Quit
.It Ic \&?
Help and configuration screen
.El
.Pp
FILES
.Pp
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
.It Ic ^O
Open with an application
.It Ic n
Create a new file or directory
.It Ic D
Show entry details
.It Ic d
Toggle detail view
.It Ic ^R
Rename selected entry
.It Ic r
Open directory in vidir
.It Ic Y, ^Y
Toggle selection mode
.It Ic Space, ^K
Copy entry absolute path
.It Ic y
Show selection list
.It Ic ^T
Toggle path quote
.It Ic P
Copy files from selection
.It Ic V
Move files from selection
.It Ic X
Delete files from selection
.It Ic ^X
Delete entry
.It Ic f
Archive entry
.It Ic F
List files in archive
.It Ic ^F
Extract archive in current directory
.It Ic m, M
Show brief/full media info
.It Ic e
Open entry in EDITOR (fallback vi)
.It Ic p
Open entry in PAGER (fallback less)
.El
.Pp
ORDER
.Pp
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
.It Ic ^J
Toggle disk usage analyzer mode
.It Ic S
Toggle sort by apparent size
.It Ic s
Toggle sort by file size
.It Ic t
Toggle sort by time modified
.El
.Pp
MISC
.Pp
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
.It Ic o
Launch a GUI application
.It Ic \&!, ^]
Spawn SHELL in current directory (fallback sh)
.It Ic R
Run a custom script
.It Ic L
Lock terminal (Linux only)
.El
.Pp
Backing up one directory level will set the cursor position at the
directory you came out of.
.Pp
Help & settings, file details, media info and archive listing are shown in the
PAGER. Please use the PAGER-specific keys in these screens.
to see the list of keybinds.
.Sh OPTIONS
.Pp
.Nm
supports the following options:
.Pp
.Fl a
auto-setup temporary \fBNNN_FIFO\fR (described in \fIENVIRONMENT\fR section)
.Pp
.Fl A
disable directory auto-enter on unique filter match
.Pp
.Fl "b key"
specify bookmark key to open
.Pp
.Fl "c N"
specify dir color (default blue), disables if N>7
0-black, 1-red, 2-green, 3-yellow, 4-blue, 5-magenta, 6-cyan, 7-white
.Fl B
use bsdtar for archives (default: atool)
.Pp
.Fl c
indicates that the opener is a cli-only opener (overrides -e)
.Pp
.Fl C
8-color scheme - color directories by context, disable file colors
.Pp
.Fl d
detail mode
.Pp
.Fl D
show directories in context color with \fBNNN_FCOLORS\fR set
.Pp
.Fl e
use exiftool instead of mediainfo
open text files in $VISUAL (else $EDITOR, fallback vi) [preferably CLI]
.Pp
.Fl E
use $EDITOR for internal undetached edits
.Pp
.Fl f
use readline history file
.Pp
.Fl "F val"
fifo notification mode
0: notify as previewer, 1: notify as explorer
.Pp
.Fl g
use regex filters instead of substring match
.Pp
.Fl H
show hidden files
.Pp
.Fl i
start in navigate-as-you-type mode
show current file information in info bar (may be slow)
.Pp
.Fl l
start in light mode (fewer details)
.Fl J
disable auto-advance on selection
(eg. selecting an entry will no longer move cursor to the next entry)
.Pp
.Fl K
test for keybind collision and exit
.Pp
.Fl "l val"
number of lines to move per mouse wheel scroll
.Pp
.Fl n
start in type-to-nav mode
.Pp
.Fl o
open files only on Enter key
.Pp
.Fl "p file"
copy (or \fIpick\fR) selection to file, or stdout if file='-'
.Pp
.Fl "P key"
specify plugin key to run
.Pp
.Fl Q
disable confirmation on quit with multiple contexts active
.Pp
.Fl r
show cp, mv progress
(Linux-only, needs \fIadvcpmv\fR; '^T' shows the progress on BSD/macOS)
.Pp
.Fl R
disable rollover at edges (eg. pressing \fIdown\fR while on the last
entry will no longer move cursor to the first entry and vice\-versa)
.Pp
.Fl "s name"
load a session by name
.Pp
.Fl S
start in disk usage analyzer mode
persistent session
.Pp
.Fl v
.Fl "t secs"
idle timeout in seconds to lock terminal
.Pp
.Fl "T key"
sort order
keys: 'a'pparent disk usage / 'd'isk usage / 'e'xtension / 'r'everse / 's'ize / 't'ime / 'v'ersion
capitalize to reverse (except 'r')
.Pp
.Fl u
use selection if available, don't prompt to choose between selection and hovered entry
.Pp
.Fl U
show user and group names in status bar
.Pp
.Fl V
show version and exit
.Pp
.Fl x
show notifications on selection cp, mv, rm completion (requires \fI.ntfy\fR plugin)
copy path to system clipboard on selection (requires \fI.cbcp\fR plugin)
show xterm title (if non-picker mode)
.Pp
.Fl h
show program help and exit
.Sh CONFIGURATION
.Nm
uses \fIxdg-open\fR (on Linux) and \fIopen(1)\fR (on OS X) as the desktop opener.
There is no configuration file. Associated files are at
.Pp
There is no configuration file. Settings work on environment variables. Please
refer to the ENVIRONMENT section below.
.Pa ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
.Pp
Configuration is done using a few optional (set if you need) environment
variables. See ENVIRONMENT section.
.Pp
Configuring
.Nm
to change to the last visited directory on quit requires shell integration in a
few easy steps. Please visit the project page (linked below) for the
instructions.
uses \fIxdg-open\fR (on Linux), \fIopen(1)\fR (on macOS), \fIcygstart\fR on
(Cygwin) and \fIopen\fR on (Haiku) as the desktop opener. It's also possible
to specify a custom opener. See ENVIRONMENT section.
.Sh CONTEXTS
Contexts serve the purpose of exploring multiple directories simultaneously. 4 contexts
are available. The status of the contexts are shown in the top left corner:
Open multiple locations with 4 contexts. The status is shown in the top left
corner:
.Pp
- the current context is in reverse
- the current context is in reverse video
.br
- other used contexts are underlined
- other active contexts are underlined
.br
- rest are unused
- rest are inactive
.Pp
To switch to a context press the Leader key followed by the context number (1-4).
A new context copies the state of the previous context. Each context can have
its own color. See ENVIRONMENT section.
.Sh SESSIONS
Sessions are a way to save and restore states of work. A session stores the
settings and contexts. Sessions can be loaded at runtime or with a program
option.
.Pp
The first time a context is entered, it copies the state of the last visited context. Each context remembers its start directory and last visited directory.
- When a session is loaded at runtime, the last working state is saved
automatically to a dedicated "auto session" session file. Session option
\fIrestore\fR would restore the "auto session".
.br
- The persistent session option is global. If it is used, the last active session
will be updated with the final state at program quit.
.br
- The "auto session" is used in persistent session mode if no session is active.
.br
- Listing input stream and opening a bookmark by key have a higher priority to
session options (-s/-S).
.Pp
When a context is quit, the next active context is selected. If the last active context is quit, the program quits.
All the session files are located by session name in the directory
.Pp
\fB${XDG_CONFIG_HOME:-$HOME/.config}/nnn/sessions\fR
.Pp
"@" is the "auto session" file.
.Sh FILTERS
Filters support regexes to instantly (search-as-you-type) list the matching
entries in the current directory.
.Pp
Ways to exit filter prompt:
.Pp
(1) press \fI^L\fR to clear filter followed by \fIBksp\fR (to clear the filter symbol, like vi)
Filters are strings (or regex patterns) to find matching entries in the current
directory instantly (\fIsearch-as-you-type\fR). Matches are case-insensitive by
default. The last filter in each context is persisted at runtime or in saved
sessions.
.br
- at other prompts \fI^L\fR followed by \fIEnter\fR discards all changes and exits prompt
.br
(2) run a search with no matches and press \fIEnter\fR
When there's a unique match and it's a directory,
.Nm
auto enters the directory. Use the relevant program option to disable this.
.Pp
Common use cases:
Special keys at filter prompt:
.Bd -literal
-------- + ---------------------------------------
Key | Function
-------- + ---------------------------------------
^char | Usual keybind functionality
Esc | Exit filter prompt but skip dir refresh
Alt+Esc | Unfilter, quit context
-------- + ---------------------------------------
.Ed
.Pp
(1) To list all matches starting with the filter expression, start the expression
with a '^' (caret) symbol.
Special keys at \fBempty filter prompt\fR:
.Bd -literal
------ + ---------------------------------------
Key | Function
------ + ---------------------------------------
? | Show help and config screen
/ | Toggle between string and regex
: | Toggle case-sensitivity
^L | Clear filter (\fIif prompt is non-empty\fR)
| OR apply last filter
Bksp | Stay at filter prompt and refresh dir
Del | Stay at filter prompt and refresh dir
------ + ---------------------------------------
.Ed
.Pp
Common regex use cases:
.Pp
(1) To list all matches starting with the filter expression,
start the expression with a '^' (caret) symbol.
.br
(2) Type '\\.mkv' to list all MKV files.
.br
(3) Use '.*' to match any character (\fIsort of\fR fuzzy search).
.br
(4) Exclude filenames having 'nnn' (compiled with PCRE lib): '^(?!nnn)'
.Pp
If
In the \fBtype-to-nav\fR mode directories are opened in filter
mode, allowing continuous navigation.
.Pp
Additional special keys at \fBempty filter prompt\fR
in \fBtype-to-nav\fR mode:
.Bd -literal
------ + ------------------------
Key | Function
------ + ------------------------
' | Go to first non-dir file
+ | Toggle file selection
, | Mark CWD
- | Go to last visited dir
. | Show hidden files
; | Run a plugin by its key
= | Launch a GUI application
> | Export file list
@ | Visit start dir
] | Show command prompt
` | Visit /
~ | Go HOME
------ + ------------------------
.Ed
.Sh SELECTION
.Nm
is invoked as root or the environment variable \fBNNN_SHOW_HIDDEN\fR is set the default filter will also match hidden files.
allows file selection across directories and contexts!
.Pp
In the \fInavigate-as-you-type\fR mode directories are opened in filter mode,
allowing continuous navigation. Works best with the \fBarrow keys\fR.
There are 3 groups of keybinds to add files to selection:
.Pp
(1) hovered file selection toggle
- deselects if '+' is visible before the entry, else adds to selection
.br
In case of only one match and it's a directory, `nnn` auto selects the directory and enters it in this mode.
.Sh SELECTION MODE
The absolute path of a single file can be copied to clipboard by pressing \fI^K\fR if
NNN_COPIER is set (see ENVIRONMENT section below).
.Pp
To copy multiple file paths the selection mode should be enabled using \fI^Y\fR.
In this mode it's possible to
.Pp
(1) cherry-pick individual files one by one by pressing <kbd>^K</kbd> on each entry; or,
(2) add a range of files to selection
- repeat the range key on the same entry twice to clear selection completely
.br
(2) navigate to another file in the same directory to select a range of files.
(3) add all files in the current directory to selection
.Pp
Pressing \fI^Y\fR again copies the paths and exits the selection mode. The files in the list can now
be copied, moved or removed using respective keyboard shortcuts.
A selection can be edited, copied, moved, removed, archived or linked.
.Pp
To list the file paths copied to memory press \fIy\fR.
Absolute paths of the selected files are copied to \fB.selection\fR file in
the config directory. The selection file is shared between multiple program
instances. Selection from multiple instances are not merged. The last instance
writing to the file overwrites earlier contents. If you have 2 instances of
.Nm
\fIopen\fR in 2 panes of a terminal multiplexer, you can select in one pane and
use the selection in the other pane. The selection gets cleared in the
.Nm
instance where the selection was made on mv/rm (but not on cp).
.Pp
.Nm
clears the selection after a successful operation with the selection. Plugins
are allowed to define the behaviour individually.
.Pp
To edit the selection use the _edit selection_ key. Editing doesn't end the
selection mode. You can add more files to the selection and edit the list
again. If no file is selected in the current session, this option attempts
to list the selection file.
.Pp
.Nm
can show the total size of non-filtered selected files listed in a
directory. For directories, only the size of the directory is added by
default. To add the size of the contents of a directory, switch to du mode.
.Sh FIND AND LIST
There are two ways to search and list:
.Pp
- feed a list of file paths as input
.br
- search using a plugin (e.g. \fIfinder\fR) and list the results
.Pp
File paths must be NUL-separated ('\\0'). Paths and can be relative to the
current directory or absolute. Invalid paths in the input are ignored. Input
processing limit is 16,384 paths or 64 MiB (max_paths x max_path_len) of data.
.Pp
To list the input stream, start
.Nm
by writing to its standard input. E.g., to list files in current
directory larger than
1M:
.Bd -literal
find -maxdepth 1 -size +1M -print0 | nnn
.Ed
.Pp
or redirect a list from a file:
.Bd -literal
nnn < files.txt
.Ed
.Pp
Handy bash/zsh shell function to list files by mime-type in current directory:
.Bd -literal
# to show video files, run: list video
list ()
{
find . -maxdepth 1 | file -if- | grep "$1" | awk -F: '{printf "%s%c", $1, 0}' | nnn
}
.Ed
.Pp
A temporary directory will be created containing symlinks to the given
paths. Any action performed on these symlinks will be performed only on their
targets, after which they might become invalid.
.Pp
Right arrow or 'l' on a symlink in the listing dir takes to the target
file. Press '-' to return to the listing dir. Press 'Enter' to open the symlink.
.Pp
Listing input stream can be scripted. It can be extended to pick (option -p)
selected entries from the listed results.
.Sh BOOKMARKS
There are 2 ways (can be used together) to manage bookmarks.
.Pp
(1) Bookmark keys: See \fBNNN_BMS\fR under \fIENVIORNMENT\fR section on how to set
bookmark keys.
The select bookmark key \fIb\fR lists all the bookmark keys set in \fBNNN_BMS\fR
in the bookmarks prompt.
.Pp
(2) Symlinked bookmarks: A symlinked bookmark to the current directory can
be created with the \fIB\fR key (or manually under ~/.config/nnn/bookmarks).
Pressing 'Enter' at the bookmarks prompt takes to this directory.
If \fBNNN_BMS\fR is not set, the select bookmark key directly opens it.
.Pp
On entering a bookmark, the directory where the select bookmark key was
pressed is set as the previous directory. Press '-' to return to it.
.Pp
.Sh UNITS
The minimum file size unit is byte (B). The rest are K, M, G, T, P, E, Z, Y
(powers of 1024), same as the default units in \fIls\fR.
.Sh ENVIRONMENT
The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables take precedence
when dealing with the !, e and p commands respectively.
The SHELL, VISUAL (else EDITOR) and PAGER environment variables are
used. A single combination of arguments is supported for SHELL and PAGER.
.Pp
\fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs (max 10) separated by
\fI;\fR:
\fBNNN_OPTS:\fR binary options to
.Nm
.Bd -literal
export NNN_BMS='d:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
export NNN_OPTS="cEnrx"
.Ed
.Pp
\fBNNN_OPENER:\fR specify a custom file opener.
.Bd -literal
export NNN_OPENER=nuke
NOTE: Bookmark keys should be single-character to use them in combination with the Leader key.
NOTE: 'nuke' is a file opener available in the plugin repository.
.Ed
.Pp
\fBNNN_USE_EDITOR:\fR use EDITOR (preferably CLI, fallback vi) to handle text
files.
\fBNNN_BMS:\fR bookmark string as \fIkey_char:location\fR pairs
separated by \fI;\fR:
.Bd -literal
export NNN_USE_EDITOR=1
export NNN_BMS="d:$HOME/Docs;u:/home/user/Cam Uploads;D:$HOME/Downloads/"
.Ed
.Pp
\fBNNN_IDLE_TIMEOUT:\fR set idle timeout (in seconds) to invoke terminal locker.
These bookmarks are listed in the help and config screen (key ?).
.Pp
\fBNNN_COPIER:\fR set to a clipboard copier script. For example, on Linux:
\fBNNN_PLUG:\fR directly executable plugins as \fIkey_char:plugin\fR pairs
separated by \fI;\fR:
.Bd -literal
-------------------------------------
#!/bin/sh
export NNN_PLUG='f:finder;o:fzopen;p:mocplay;d:diffs;t:nmount;v:imgview'
# comment the next line to convert newlines to spaces
IFS=
echo -n $1 | xsel --clipboard --input
-------------------------------------
NOTES:
1. To run a plugin directly, press \fI;\fR followed by the key.
2. Alternatively, combine with \fIAlt\fR (i.e. \fIAlt+key\fR).
3. To skip directory refresh after running a plugin, prefix with \fB-\fR.
If it's not set, by default file paths are copied to the tmp file \fBDIR/.nnncp\fR, where 'DIR' (by priority) is: \fI$HOME\fR or, \fI$TMPDIR\fR or, \fI/tmp\fR.
export NNN_PLUG='p:-plugin'
.Ed
.Pp
\fBNNN_QUOTE_ON:\fR wrap copied paths within single quotes. Useful for pasting
names in the shell. Note that the filename is not escaped. So copying may still fail
for filenames having quote(s) in them.
.Pp
\fBNNN_SCRIPT:\fR path to a custom script to invoke with currently selected file name as argument 1.
To assign keys to arbitrary non-background cli commands and invoke like
plugins, add \fB!\fR before the command.
.Bd -literal
export NNN_SCRIPT=/usr/local/bin/nscript
export NNN_PLUG='x:!chmod +x "$nnn";g:!git log;s:!smplayer "$nnn"'
To pick and run an unassigned plugin, press \fBEnter\fR at the plugin prompt.
To run a plugin at startup, use the option `-P` followed by the plugin key.
NOTES:
1. Place $nnn (or exported variables) in double quotes (\fB"$nnn"\fR)
2. Use single quotes for $NNN_PLUG so "$nnn" is not interpreted
3. (Again) add \fB!\fR before the command
4. To disable directory refresh after running a \fIcommand as plugin\fR,
prefix with \fB-!\fR
5. To skip user confirmation after command execution, suffix with \fB*\fR
Note: Do not use \fB*\fR with programs those run and exit e.g. cat
export NNN_PLUG='y:-!sync*'
6. To run a \fIGUI app as plugin\fR, add a \fB&\fR after \fB!\fR.
export NNN_PLUG='m:-!&mousepad "$nnn"'
7. To show the output of run-and-exit commands which do not need user input,
add \fB|\fR (pipe) after \fB!\fR
Note: This option is incompatible with \fB&\fR (terminal output is masked
for GUI programs) and ignores \fB*\fR (output is already paged for user).
export NNN_PLUG='m:-!|mediainfo "$nnn";t:-!|tree -ps;l:-!|ls -lah --group-directories-first'
EXAMPLES:
------------------------------------ + -------------------------------------------------
Key:Command | Description
------------------------------------ + -------------------------------------------------
c:!convert "$nnn" png:- | xclip | Copy image to clipboard
-sel clipboard -t image/png* |
C:!cp -rv "$nnn" "$nnn".cp* | Create a copy of the hovered file
e:-!sudo -E vim "$nnn"* | Edit file as root in vim
g:-!git diff | Show git diff
h:-!hx "$nnn"* | Open hovered file in hx hex editor
k:-!fuser -kiv "$nnn"* | Interactively kill process(es) using hovered file
l:-!git log | Show git log
n:-!vi /home/user/Dropbox/dir/note* | Take quick notes in a synced file/dir of notes
p:-!less -iR "$nnn"* | Page through hovered file in less
s:-!&smplayer -minigui "$nnn" | Play hovered media file, even unfinished download
x:!chmod +x "$nnn" | Make the hovered file executable
y:-!sync* | Flush cached writes
------------------------------------ + -------------------------------------------------
Online docs: https://github.com/jarun/nnn/tree/master/plugins
.Ed
.Pp
\fBNNN_MULTISCRIPT:\fR run multiple custom scripts.
\fBNNN_ORDER:\fR directory-specific sort key.
.Bd -literal
export NNN_MULTISCRIPT=1
export NNN_ORDER='t:/home/user/Downloads;S:/tmp'
NOTE: Sort keys can be a/d/e/r/s/t/v (see program option -T).
Capitalize to reverse (except 'r').
Path must be absolute.
Timestamps for entries modified/created within 5 minutes are shown in reverse.
.Ed
.Pp
\fBNNN_SHOW_HIDDEN:\fR show hidden files.
\fBNNN_COLORS:\fR string of color numbers for each context, e.g.:
.Bd -literal
export NNN_SHOW_HIDDEN=1
# 8 color numbers:
# 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white
export NNN_COLORS='1234'
# xterm 256 color numbers (converted to hex, 2 symbols per context):
# see https://user-images.githubusercontent.com/1482942/93023823-46a6ba80-f5e1-11ea-9ea3-6a3c757704f4.png
export NNN_COLORS='#0a1b2c3d'
# both (256 followed by 8 as fallback, separated by ';')
export NNN_COLORS='#0a1b2c3d;1234'
NOTE: If only 256 colors are specified and the terminal doesn't support, default is used.
.Ed
.Pp
\fBNNN_NO_AUTOSELECT:\fR Disable directory auto-selection in \fInavigate-as-you-type\fR mode.
\fBNNN_FCOLORS:\fR specify file-type specific colors:
.Bd -literal
export NNN_NO_AUTOSELECT=1
export NNN_FCOLORS='c1e2272e006033f7c6d6abc4'
Specify file-specific colors in xterm 256 color hex numbers (2 symbols per color).
Order is strict, use 00 to omit/use default terminal color. Defaults:
------------------------- + --- + -------------
Order | Hex | Color
------------------------- + --- + -------------
Block device | c1 | DarkSeaGreen1
Char device | e2 | Yellow1
Directory | 27 | DeepSkyBlue1
Executable | 2e | Green1
Regular | 00 | Normal
Hard link | 60 | Plum4
Symbolic link | 33 | Cyan1
Missing OR file details | f7 | Grey62
Orphaned symbolic link | c6 | DeepPink1
FIFO | d6 | Orange1
Socket | ab | MediumOrchid1
Unknown OR 0B regular/exe | c4 | Red1
------------------------- + --- + -------------
If the terminal supports xterm 256 colors or more, file-specific colors will be rendered.
To force the 8-color scheme use option -C.
If xterm 256 colors aren't supported, 8-color scheme will be used.
.Ed
.Sh KNOWN ISSUES
If you are using urxvt you might have to set backspace key to DEC.
.Pp
\fBNNN_ARCHIVE:\fR archive extensions to be handled silently (default: bzip2, (g)zip, tar).
.Bd -literal
export NNN_ARCHIVE="\\\\.(7z|bz2|gz|tar|tgz|zip)$"
NOTE: Non-default formats may require a third-party utility.
.Ed
.Pp
\fBNNN_ARCHMNT:\fR optional archive mounter utility (default: archivemount).
.Bd -literal
export NNN_ARCHIVE='fuse-archive'
.Ed
.Pp
\fBNNN_SSHFS:\fR specify custom sshfs command with options:
.Bd -literal
export NNN_SSHFS='sshfs -o reconnect,idmap=user,cache_timeout=3600'
NOTE: The options must be comma-separated without any space between them.
.Ed
.Pp
\fBNNN_RCLONE:\fR pass additional options to rclone command:
.Bd -literal
export NNN_RCLONE='rclone mount --read-only --no-checksum'
NOTE: The options must be preceded by "rclone" and max 5 flags are supported.
.Ed
.Pp
\fBNNN_TRASH:\fR trash (instead of \fIrm -rf\fR) files to desktop Trash.
.Bd -literal
export NNN_TRASH=n
# n=1: trash-cli, n=2: gio trash
.Ed
.Pp
\fBNNN_SEL:\fR absolute path to custom selection file.
.Bd -literal
export NNN_SEL='/tmp/.sel'
.Ed
.Pp
\fBNNN_FIFO:\fR path of a named pipe to write the hovered file path:
.Bd -literal
export NNN_FIFO='/tmp/nnn.fifo'
NOTES:
1. Overridden by a temporary path with -a option.
2. If the FIFO file doesn't exist it will be created,
but not removed (unless it is generated by -a option).
Online docs: https://github.com/jarun/nnn/wiki/Live-previews
.Ed
.Pp
\fBNNN_LOCKER:\fR terminal locker program.
.Bd -literal
export NNN_LOCKER='bmon -p wlp1s0'
export NNN_LOCKER='cmatrix'
.Ed
.Pp
\fBNNN_TMPFILE:\fR \fIalways\fR cd on quit and write the command in the file specified.
.Bd -literal
export NNN_TMPFILE='/tmp/.lastd'
.Ed
.Pp
\fBNNN_HELP:\fR run a program and show the output on top of the program help page.
.Bd -literal
export NNN_HELP='fortune'
.Ed
.Pp
\fBNNN_MCLICK:\fR key emulated by a middle mouse click.
.Bd -literal
export NNN_MCLICK='^R'
NOTE: Only the first character is considered if not a \fICtrl+key\fR combo.
.Ed
.Pp
\fBnnn:\fR this is a special variable.
.Bd -literal
Set to the hovered file name before starting the command prompt or spawning a shell.
.Ed
.Pp
\fBNO_COLOR:\fR disable ANSI color output (overridden by \fBNNN_COLORS\fR).
.Sh AUTHORS
.An Arun Prakash Jana Aq Mt engineerarun@gmail.com ,
.An Lazaros Koromilas Aq Mt lostd@2f30.org ,
.An Dimitris Papastamos Aq Mt sin@2f30.org ,
.An Arun Prakash Jana Aq Mt engineerarun@gmail.com .
.An Dimitris Papastamos Aq Mt sin@2f30.org .
.Sh HOME
.Em https://github.com/jarun/nnn

30
patches/README.md Normal file
View File

@ -0,0 +1,30 @@
<h1 align="center">User Patch Framework</h1>
This directory contains sizable user submitted patches that were rejected from mainline as they tend to be more subjective in nature.
The patches will be adapted on each release when necessary (v4.1 onwards). Each patch can be applied through its respective make variable during compilation. In case inter-patch merge conflicts occur, a compatibility patch is provided and will automatically be applied.
## List of patches
| Patch (a-z) | Description | Make var |
| --- | --- | --- |
| colemak | Key bindings for Colemak keyboard layout | `O_COLEMAK` |
| gitstatus | Add git status column to the detail view. Provides command line flag `-G` to show column in normal mode. | `O_GITSTATUS` |
| namefirst | Print filenames first in the detail view. Print user/group columns when a directory contains different users/groups. | `O_NAMEFIRST` |
| restorepreview | Add pipe to close and restore [`preview-tui`](https://github.com/jarun/nnn/blob/master/plugins/preview-tui) for internal undetached edits (<kbd>e</kbd> key)| `O_RESTOREPREVIEW` |
To apply a patch, use the corresponding make variable, e.g.:
make O_NAMEFIRST=1
When contributing/adding a new patch, make sure to add the make variable to the patches array in `./misc/test/check-patches.sh` as well so that patch failures can be easily tested.
## Resolving patch conflicts
Patch conflicts can be checked locally by running `make checkpatches` or by running `./patches/check-patches.sh` manually.
Whenever patch conflicts occur on the latest master, pull requests resolving them are welcome. Let's say a conflict occurs in the `restorepreview` patch. The best way to resolve this conflict would be something along the lines of:
- Ensure you're on latest master and run `PATCH_OPTS="--merge" make O_RESTOREPREVIEW=1`. This will generate the conflict markers in `src/nnn.c`.
- Next edit `src/nnn.c`, resolve the conflicts around the conflict markers(`<<<<<<<`), and save.
- Then run `git diff > patch.diff && sed -i -e "/^$/{r patch.diff" -e "q;}" patches/restorepreview/mainline.diff` to update the patch.

29
patches/check-patches.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
#
# Usage: ./misc/test/check-patches.sh
#
# Bash script that checks for any of the patches failing to apply.
# Read patches/README.md for more information.
export PATCH_OPTS="--merge"
patches=("O_COLEMAK" "O_GITSTATUS" "O_NAMEFIRST" "O_RESTOREPREVIEW")
z=$(( 1 << ${#patches[@]} ))
pid=$$
ret=0
trap 'ret=1' SIGUSR1
for ((n=1; n < z; ++n)); do
for ((i=0; i < ${#patches[@]}; ++i)); do
printf "%s=%d " "${patches[$i]}" "$(( (n & (1 << i)) != 0 ))"
done | tee "/dev/stderr" | (
make clean -s
if ! xargs make 2>&1; then
echo "[FAILED]" >&2
kill -SIGUSR1 "$pid"
else
echo "[SUCCESS]" >&2
fi
git restore src
) >/dev/null
done
exit "$ret"

View File

@ -0,0 +1,134 @@
diff --git a/src/nnn.c b/src/nnn.c
index d7c53166..bb7ff3e8 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -5149,12 +5149,12 @@ static void show_help(const char *path)
"2(___n))\n"
"0\n"
"1NAVIGATION\n"
- "9Up k Up%16PgUp ^U Page up\n"
- "9Dn j Down%14PgDn ^D Page down\n"
+ "9Up e Up%16PgUp ^U Page up\n"
+ "9Dn n Down%14PgDn ^D Page down\n"
"9Lt h Parent%12~ ` @ - ~, /, start, prev\n"
- "5Ret Rt l Open%20' First file/match\n"
- "9g ^A Top%21J Jump to entry/offset\n"
- "9G ^E End%20^J Toggle auto-advance on open\n"
+ "5Ret Rt i Open%20' First file/match\n"
+ "9g ^E Top%21J Jump to entry/offset\n"
+ "9G ^N End%20^J Toggle auto-advance on open\n"
"8B (,) Book(mark)%11b ^/ Select bookmark\n"
"a1-4 Context%11(Sh)Tab Cycle/new context\n"
"62Esc ^Q Quit%19^y Next young\n"
@@ -5162,27 +5162,27 @@ static void show_help(const char *path)
"cq Quit context\n"
"0\n"
"1FILTER & PROMPT\n"
- "c/ Filter%17^N Toggle type-to-nav\n"
+ "c/ Filter%17^K Toggle type-to-nav\n"
"aEsc Exit prompt%12^L Toggle last filter\n"
"c. Toggle hidden%05Alt+Esc Unfilter, quit context\n"
"0\n"
"1FILES\n"
- "9o ^O Open with%15n Create new/link\n"
+ "9o ^O Open with%15c Create new/link\n"
"9f ^F File stats%14d Detail mode toggle\n"
"b^R Rename/dup%14r Batch rename\n"
- "cz Archive%17e Edit file\n"
+ "cz Archive%17y Edit file\n"
"c* Toggle exe%14> Export list\n"
"6Space + (Un)select%12m-m Select range/clear\n"
"ca Select all%14A Invert sel\n"
"9p ^P Copy here%12w ^W Cp/mv sel as\n"
- "9v ^V Move here%15E Edit sel list\n"
+ "9v ^V Move here%15l Edit sel list\n"
"9x ^X Delete or trash%09S Listed sel size\n"
"cX Delete (rm -rf)%07Esc Send to FIFO\n"
"0\n"
"1MISC\n"
"8Alt ; Select plugin%11= Launch app\n"
"9! ^] Shell%19] Cmd prompt\n"
- "cc Connect remote%10u Unmount remote/archive\n"
+ "cC Connect remote%10u Unmount remote/archive\n"
"9t ^T Sort toggles%12s Manage session\n"
"cT Set time type%110 Lock\n"
"b^L Redraw%18? Help, conf\n"
diff --git a/src/nnn.h b/src/nnn.h
index bd500244..43b7fa22 100644
--- a/src/nnn.h
+++ b/src/nnn.h
@@ -139,12 +139,12 @@ static struct key bindings[] = {
{ '\r', SEL_OPEN },
/* Pure navigate inside */
{ KEY_RIGHT, SEL_NAV_IN },
- { 'l', SEL_NAV_IN },
+ { 'i', SEL_NAV_IN },
/* Next */
- { 'j', SEL_NEXT },
+ { 'n', SEL_NEXT },
{ KEY_DOWN, SEL_NEXT },
/* Previous */
- { 'k', SEL_PREV },
+ { 'e', SEL_PREV },
{ KEY_UP, SEL_PREV },
/* Page down */
{ KEY_NPAGE, SEL_PGDN },
@@ -157,11 +157,11 @@ static struct key bindings[] = {
/* First entry */
{ KEY_HOME, SEL_HOME },
{ 'g', SEL_HOME },
- { CONTROL('A'), SEL_HOME },
+ { CONTROL('E'), SEL_HOME },
/* Last entry */
{ KEY_END, SEL_END },
{ 'G', SEL_END },
- { CONTROL('E'), SEL_END },
+ { CONTROL('N'), SEL_END },
/* Go to first file */
{ '\'', SEL_FIRST },
/* Jump to an entry number/offset */
@@ -179,7 +179,7 @@ static struct key bindings[] = {
{ 'b', SEL_BMOPEN },
{ CONTROL('_'), SEL_BMOPEN },
/* Connect to server over SSHFS */
- { 'c', SEL_REMOTE },
+ { 'C', SEL_REMOTE },
/* Cycle contexts in forward direction */
{ '\t', SEL_CYCLE },
/* Cycle contexts in reverse direction */
@@ -202,7 +202,7 @@ static struct key bindings[] = {
/* Filter */
{ '/', SEL_FLTR },
/* Toggle filter mode */
- { CONTROL('N'), SEL_MFLTR },
+ { CONTROL('K'), SEL_MFLTR },
/* Toggle hide .dot files */
{ '.', SEL_HIDDEN },
/* Detailed listing */
@@ -229,7 +229,7 @@ static struct key bindings[] = {
/* Invert selection in current dir */
{ 'A', SEL_SELINV },
/* List, edit selection */
- { 'E', SEL_SELEDIT },
+ { 'l', SEL_SELEDIT },
/* Copy from selection buffer */
{ 'p', SEL_CP },
{ CONTROL('P'), SEL_CP },
@@ -247,7 +247,7 @@ static struct key bindings[] = {
{ 'o', SEL_OPENWITH },
{ CONTROL('O'), SEL_OPENWITH },
/* Create a new file */
- { 'n', SEL_NEW },
+ { 'c', SEL_NEW },
/* Show rename prompt */
{ CONTROL('R'), SEL_RENAME },
/* Rename contents of current dir */
@@ -259,7 +259,7 @@ static struct key bindings[] = {
/* Toggle auto-advance on file open */
{ CONTROL('J'), SEL_AUTONEXT },
/* Edit in EDITOR */
- { 'e', SEL_EDIT },
+ { 'y', SEL_EDIT },
/* Run a plugin */
{ ';', SEL_PLUGIN },
/* Show total size of listed selection */

View File

@ -0,0 +1,223 @@
# Description: Add git status column to detail mode. Provides additional
# command line flag -G which will render the git status
# column also in normal mode. Vim plugin users may consider
# adding the -G flag to their command override.
#
# Authors: Luuk van Baal
diff --git a/src/nnn.c b/src/nnn.c
index 83ecdb90..4397944a 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -270,6 +270,25 @@
#define VFS_USED 1
#define VFS_SIZE 2
+/* Git icons */
+#ifdef NERD
+#define GIT_ADD ""
+#define GIT_DEL ""
+#define GIT_IGN ""
+#define GIT_MOD ""
+#define GIT_NEW ""
+#define GIT_NON "-"
+#define GIT_UPD "󰚰"
+#else
+#define GIT_ADD "A"
+#define GIT_DEL "D"
+#define GIT_IGN "!"
+#define GIT_MOD "M"
+#define GIT_NEW "?"
+#define GIT_NON "-"
+#define GIT_UPD "U"
+#endif
+
/* TYPE DEFINITIONS */
typedef unsigned int uint_t;
typedef unsigned char uchar_t;
@@ -294,6 +313,7 @@ typedef struct entry {
uid_t uid; /* 4 bytes */
gid_t gid; /* 4 bytes */
#endif
+ char git_status[2][5];
} *pEntry;
/* Selection marker */
@@ -349,6 +369,7 @@ typedef struct {
uint_t cliopener : 1; /* All-CLI app opener */
uint_t waitedit : 1; /* For ops that can't be detached, used EDITOR */
uint_t rollover : 1; /* Roll over at edges */
+ uint_t normalgit : 1; /* Show git status in normal mode */
} settings;
/* Non-persistent program-internal states (alphabeical order) */
@@ -400,7 +421,17 @@ typedef struct {
} session_header_t;
#endif
+typedef struct {
+ char status[2];
+ char path[PATH_MAX];
+} git_status_t;
+
/* GLOBALS */
+struct {
+ bool show;
+ size_t len;
+ git_status_t *statuses;
+} git_statuses;
/* Configuration, contexts */
static settings cfg = {
@@ -3796,6 +3827,47 @@ static int get_kv_key(kv *kvarr, char *val, uchar_t max, uchar_t id)
return -1;
}
+static size_t get_git_statuses(const char *path)
+{
+ static char gst[] = "git -c core.quotePath= status -s --no-renames --ignored=matching -unormal . 2>/dev/null";
+ FILE *fp = popen(gst, "r");
+ char status[PATH_MAX];
+ size_t pathindex, i = -1;
+ git_statuses.show = FALSE;
+
+ while (fgets(status, PATH_MAX, fp)) {
+ pathindex = (status[3] == '"') ? 4 : 3;
+ if (!cfg.showhidden && status[pathindex] == '.')
+ continue;
+ status[xstrlen(status) - pathindex + 2] = '\0';
+ git_statuses.statuses = xrealloc(git_statuses.statuses, sizeof(git_status_t) * (++i + 1));
+ git_statuses.statuses[i].status[0] = status[0];
+ git_statuses.statuses[i].status[1] = status[1];
+ mkpath(path, status + pathindex, git_statuses.statuses[i].path);
+ }
+
+ pclose(fp);
+ return (i + 1);
+}
+
+static void set_git_status(char status[][5], uint_t nr)
+{
+ for (int j = 0; j < 2; j++) {
+ if (status[j][0] == '-')
+ switch (git_statuses.statuses[nr].status[j]) {
+ case ' ': xstrsncpy(status[j], GIT_NON, 4); break;
+ case 'M': xstrsncpy(status[j], GIT_MOD, 4); break;
+ case 'A': xstrsncpy(status[j], GIT_ADD, 4); break;
+ case '?': xstrsncpy(status[j], GIT_NEW, 4); break;
+ case '!': xstrsncpy(status[j], GIT_IGN, 4); break;
+ case 'D': xstrsncpy(status[j], GIT_DEL, 4); break;
+ case 'U': xstrsncpy(status[j], GIT_UPD, 4); break;
+ }
+ }
+ if (git_statuses.statuses[nr].status[1] != '!')
+ git_statuses.show = TRUE;
+}
+
static void resetdircolor(int flags)
{
/* Directories are always shown on top, clear the color when moving to first file */
@@ -4123,6 +4195,10 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
uchar_t color_pair = get_color_pair_name_ind(ent, &ind, &attrs);
+ if (git_statuses.show && (cfg.showdetail || cfg.normalgit))
+ printw("%*s%s%s", (cfg.normalgit && !cfg.showdetail) ? 1 : 0, "",
+ ent->git_status[0], ent->git_status[1]);
+
addch((ent->flags & FILE_SELECTED) ? '+' | A_REVERSE | A_BOLD : ' ');
if (g_state.oldcolor)
@@ -5592,6 +5668,11 @@ static int dentfill(char *path, struct entry **ppdents)
attron(COLOR_PAIR(cfg.curctx + 1));
}
+ char linkpath[PATH_MAX];
+ if ((git_statuses.len = get_git_statuses(path)))
+ if (!realpath(path, linkpath))
+ printwarn(NULL);
+
#if _POSIX_C_SOURCE >= 200112L
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
@@ -5792,6 +5873,29 @@ static int dentfill(char *path, struct entry **ppdents)
#endif
}
+ if (git_statuses.len) {
+ char dentpath[PATH_MAX];
+ size_t pathlen = mkpath(linkpath, dentp->name, dentpath);
+ dentp->git_status[0][0] = dentp->git_status[1][0] = '-';
+ dentp->git_status[0][1] = dentp->git_status[1][1] = '\0';
+
+ if (dentp->flags & DIR_OR_DIRLNK) {
+ char prefix[PATH_MAX];
+ memccpy(prefix, dentpath, '\0', PATH_MAX);
+ prefix[pathlen - 1] = '/';
+
+ for (size_t i = 0; i < git_statuses.len; ++i)
+ if (is_prefix(git_statuses.statuses[i].path, prefix, pathlen))
+ set_git_status(dentp->git_status, i);
+ } else {
+ for (size_t i = 0; i < git_statuses.len; ++i)
+ if (!xstrcmp(git_statuses.statuses[i].path, dentpath)) {
+ set_git_status(dentp->git_status, i);
+ break;
+ }
+ }
+ }
+
++ndents;
} while ((dp = readdir(dirp)));
@@ -6361,11 +6465,12 @@ static int adjust_cols(int n)
#endif
if (cfg.showdetail) {
/* Fallback to light mode if less than 35 columns */
- if (n < 36)
+ if (n < 38)
cfg.showdetail ^= 1;
else /* 2 more accounted for below */
- n -= 32;
- }
+ n -= (git_statuses.show ? 34 : 32);
+ } else if (cfg.normalgit && git_statuses.show)
+ n -= 3;
/* 2 columns for preceding space and indicator */
return (n - 2);
@@ -8143,6 +8248,7 @@ static void usage(void)
" -F val fifo mode [0:preview 1:explore]\n"
#endif
" -g regex filters\n"
+ " -G always show git status\n"
" -H show hidden files\n"
" -i show current file info\n"
" -J no auto-advance on selection\n"
@@ -8282,6 +8388,7 @@ static void cleanup(void)
fflush(stdout);
}
#endif
+ free(git_statuses.statuses);
free(selpath);
free(plgpath);
free(cfgpath);
@@ -8326,7 +8433,7 @@ int main(int argc, char *argv[])
while ((opt = (env_opts_id > 0
? env_opts[--env_opts_id]
- : getopt(argc, argv, "aAb:BcCdDeEfF:gHiJKl:nNop:P:QrRs:St:T:uUVxh"))) != -1) {
+ : getopt(argc, argv, "aAb:BcCdDeEfF:gGHiJKl:nNop:P:QrRs:St:T:uUVxh"))) != -1) {
switch (opt) {
#ifndef NOFIFO
case 'a':
@@ -8380,6 +8487,9 @@ int main(int argc, char *argv[])
cfg.regex = 1;
filterfn = &visible_re;
break;
+ case 'G':
+ cfg.normalgit = 1;
+ break;
case 'H':
cfg.showhidden = 1;
break;

View File

@ -0,0 +1,226 @@
# Description: Add git status column to detail mode. Provides additional
# command line flag -G which will render the git status
# column also in normal mode. Vim plugin users may consider
# adding the -G flag to their command override.
# Compatibility patch for the namefirst patch.
#
# Authors: Luuk van Baal
diff --git a/src/nnn.c b/src/nnn.c
index 88538787..d4af7c43 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -270,6 +270,25 @@
#define VFS_USED 1
#define VFS_SIZE 2
+/* Git icons */
+#ifdef NERD
+#define GIT_ADD ""
+#define GIT_DEL ""
+#define GIT_IGN ""
+#define GIT_MOD ""
+#define GIT_NEW ""
+#define GIT_NON "-"
+#define GIT_UPD "󰚰"
+#else
+#define GIT_ADD "A"
+#define GIT_DEL "D"
+#define GIT_IGN "!"
+#define GIT_MOD "M"
+#define GIT_NEW "?"
+#define GIT_NON "-"
+#define GIT_UPD "U"
+#endif
+
/* TYPE DEFINITIONS */
typedef unsigned int uint_t;
typedef unsigned char uchar_t;
@@ -294,6 +313,7 @@ typedef struct entry {
uid_t uid; /* 4 bytes */
gid_t gid; /* 4 bytes */
#endif
+ char git_status[2][5];
} *pEntry;
/* Selection marker */
@@ -349,6 +369,7 @@ typedef struct {
uint_t cliopener : 1; /* All-CLI app opener */
uint_t waitedit : 1; /* For ops that can't be detached, used EDITOR */
uint_t rollover : 1; /* Roll over at edges */
+ uint_t normalgit : 1; /* Show git status in normal mode */
} settings;
/* Non-persistent program-internal states (alphabeical order) */
@@ -404,7 +425,17 @@ static struct {
ushort_t maxnameln, maxsizeln, maxuidln, maxgidln, maxentln, uidln, gidln, printguid;
} dtls;
+typedef struct {
+ char status[2];
+ char path[PATH_MAX];
+} git_status_t;
+
/* GLOBALS */
+struct {
+ bool show;
+ size_t len;
+ git_status_t *statuses;
+} git_statuses;
/* Configuration, contexts */
static settings cfg = {
@@ -3804,6 +3835,47 @@ static int get_kv_key(kv *kvarr, char *val, uchar_t max, uchar_t id)
return -1;
}
+static size_t get_git_statuses(const char *path)
+{
+ static char gst[] = "git -c core.quotePath= status -s --no-renames --ignored=matching -unormal . 2>/dev/null";
+ FILE *fp = popen(gst, "r");
+ char status[PATH_MAX];
+ size_t pathindex, i = -1;
+ git_statuses.show = FALSE;
+
+ while (fgets(status, PATH_MAX, fp)) {
+ pathindex = (status[3] == '"') ? 4 : 3;
+ if (!cfg.showhidden && status[pathindex] == '.')
+ continue;
+ status[xstrlen(status) - pathindex + 2] = '\0';
+ git_statuses.statuses = xrealloc(git_statuses.statuses, sizeof(git_status_t) * (++i + 1));
+ git_statuses.statuses[i].status[0] = status[0];
+ git_statuses.statuses[i].status[1] = status[1];
+ mkpath(path, status + pathindex, git_statuses.statuses[i].path);
+ }
+
+ pclose(fp);
+ return (i + 1);
+}
+
+static void set_git_status(char status[][5], uint_t nr)
+{
+ for (int j = 0; j < 2; j++) {
+ if (status[j][0] == '-')
+ switch (git_statuses.statuses[nr].status[j]) {
+ case ' ': xstrsncpy(status[j], GIT_NON, 4); break;
+ case 'M': xstrsncpy(status[j], GIT_MOD, 4); break;
+ case 'A': xstrsncpy(status[j], GIT_ADD, 4); break;
+ case '?': xstrsncpy(status[j], GIT_NEW, 4); break;
+ case '!': xstrsncpy(status[j], GIT_IGN, 4); break;
+ case 'D': xstrsncpy(status[j], GIT_DEL, 4); break;
+ case 'U': xstrsncpy(status[j], GIT_UPD, 4); break;
+ }
+ }
+ if (git_statuses.statuses[nr].status[1] != '!')
+ git_statuses.show = TRUE;
+}
+
static void resetdircolor(int flags)
{
/* Directories are always shown on top, clear the color when moving to first file */
@@ -4104,6 +4176,9 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
int attrs = 0, namelen;
uchar_t color_pair = get_color_pair_name_ind(ent, &ind, &attrs);
+ if (git_statuses.show && (cfg.showdetail || cfg.normalgit))
+ printw(" %s%s", ent->git_status[0], ent->git_status[1]);
+
addch((ent->flags & FILE_SELECTED) ? '+' | A_REVERSE | A_BOLD : ' ');
if (g_state.oldcolor)
@@ -5598,6 +5673,11 @@ static int dentfill(char *path, struct entry **ppdents)
attron(COLOR_PAIR(cfg.curctx + 1));
}
+ char linkpath[PATH_MAX];
+ if ((git_statuses.len = get_git_statuses(path)))
+ if (!realpath(path, linkpath))
+ printwarn(NULL);
+
#if _POSIX_C_SOURCE >= 200112L
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
@@ -5798,6 +5878,29 @@ static int dentfill(char *path, struct entry **ppdents)
#endif
}
+ if (git_statuses.len) {
+ char dentpath[PATH_MAX];
+ size_t pathlen = mkpath(linkpath, dentp->name, dentpath);
+ dentp->git_status[0][0] = dentp->git_status[1][0] = '-';
+ dentp->git_status[0][1] = dentp->git_status[1][1] = '\0';
+
+ if (dentp->flags & DIR_OR_DIRLNK) {
+ char prefix[PATH_MAX];
+ memccpy(prefix, dentpath, '\0', PATH_MAX);
+ prefix[pathlen - 1] = '/';
+
+ for (size_t i = 0; i < git_statuses.len; ++i)
+ if (is_prefix(git_statuses.statuses[i].path, prefix, pathlen))
+ set_git_status(dentp->git_status, i);
+ } else {
+ for (size_t i = 0; i < git_statuses.len; ++i)
+ if (!xstrcmp(git_statuses.statuses[i].path, dentpath)) {
+ set_git_status(dentp->git_status, i);
+ break;
+ }
+ }
+ }
+
++ndents;
} while ((dp = readdir(dirp)));
@@ -6362,7 +6465,8 @@ static int adjust_cols(int n)
cfg.showdetail ^= 1;
else /* 2 more accounted for below */
n -= (dtls.maxentln - 2 - dtls.maxnameln);
- }
+ } else if (cfg.normalgit && git_statuses.show)
+ n -= 3;
/* 2 columns for preceding space and indicator */
return (n - 2);
@@ -6517,7 +6621,7 @@ static void redraw(char *path)
}
#endif
}
- dtls.maxentln = dtls.maxnameln + dtls.maxsizeln + (dtls.printguid ? (dtls.maxuidln + dtls.maxgidln + 29) : 26);
+ dtls.maxentln = dtls.maxnameln + dtls.maxsizeln + (dtls.printguid ? (dtls.maxuidln + dtls.maxgidln + 3) : 0) + (git_statuses.show ? 29 : 26);
}
ncols = adjust_cols(ncols);
@@ -8153,6 +8257,7 @@ static void usage(void)
" -F val fifo mode [0:preview 1:explore]\n"
#endif
" -g regex filters\n"
+ " -G always show git status\n"
" -H show hidden files\n"
" -i show current file info\n"
" -J no auto-advance on selection\n"
@@ -8292,6 +8397,7 @@ static void cleanup(void)
fflush(stdout);
}
#endif
+ free(git_statuses.statuses);
free(selpath);
free(plgpath);
free(cfgpath);
@@ -8336,7 +8442,7 @@ int main(int argc, char *argv[])
while ((opt = (env_opts_id > 0
? env_opts[--env_opts_id]
- : getopt(argc, argv, "aAb:BcCdDeEfF:gHiJKl:nNop:P:QrRs:St:T:uUVxh"))) != -1) {
+ : getopt(argc, argv, "aAb:BcCdDeEfF:gGHiJKl:nNop:P:QrRs:St:T:uUVxh"))) != -1) {
switch (opt) {
#ifndef NOFIFO
case 'a':
@@ -8390,6 +8496,9 @@ int main(int argc, char *argv[])
cfg.regex = 1;
filterfn = &visible_re;
break;
+ case 'G':
+ cfg.normalgit = 1;
+ break;
case 'H':
cfg.showhidden = 1;
break;

View File

@ -0,0 +1,227 @@
# Description: Prints filenames first in the detail view. Prints user/group
# columns when a directory contains different users/groups.
#
# Author: Luuk van Baal
diff --git a/src/nnn.c b/src/nnn.c
index f8a2c58..9802a1f 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -394,6 +394,10 @@ typedef struct {
} session_header_t;
#endif
+static struct {
+ ushort_t maxnameln, maxsizeln, maxuidln, maxgidln, maxentln, uidln, gidln, printguid;
+} dtls;
+
/* GLOBALS */
/* Configuration, contexts */
@@ -1070,10 +1074,12 @@ static char *getpwname(uid_t uid)
static char *namecache;
if (uidcache != uid) {
+ if (dtls.maxuidln && !dtls.printguid) dtls.printguid = 1;
struct passwd *pw = getpwuid(uid);
uidcache = uid;
namecache = pw ? pw->pw_name : NULL;
+ dtls.uidln = xstrlen(namecache ? namecache : xitoa(uid));
}
return namecache ? namecache : xitoa(uid);
@@ -1085,10 +1091,12 @@ static char *getgrname(gid_t gid)
static char *grpcache;
if (gidcache != gid) {
+ if (dtls.maxgidln && !dtls.printguid) dtls.printguid = 1;
struct group *gr = getgrgid(gid);
gidcache = gid;
grpcache = gr ? gr->gr_name : NULL;
+ dtls.gidln = xstrlen(grpcache ? grpcache : xitoa(gid));
}
return grpcache ? grpcache : xitoa(gid);
@@ -3834,14 +3842,13 @@ static void resetdircolor(int flags)
* Max supported str length: NAME_MAX;
*/
#ifdef NOLC
-static char *unescape(const char *str, uint_t maxcols)
+static size_t unescape(const char *str, uint_t maxcols)
{
char * const wbuf = g_buf;
char *buf = wbuf;
-
- xstrsncpy(wbuf, str, maxcols);
+ size_t len = xstrsncpy(wbuf, str, maxcols);
#else
-static wchar_t *unescape(const char *str, uint_t maxcols)
+static size_t unescape(const char *str, uint_t maxcols)
{
wchar_t * const wbuf = (wchar_t *)g_buf;
wchar_t *buf = wbuf;
@@ -3866,7 +3873,7 @@ static wchar_t *unescape(const char *str, uint_t maxcols)
++buf;
}
- return wbuf;
+ return len;
}
static off_t get_size(off_t size, off_t *pval, int comp)
@@ -4228,38 +4235,13 @@ static void printent(int pdents_index, uint_t namecols, bool sel)
{
const struct entry *ent = &pdents[pdents_index];
char ind = '\0';
- int attrs;
-
- if (cfg.showdetail) {
- int type = ent->mode & S_IFMT;
- char perms[6] = {' ', ' ', (char)('0' + ((ent->mode >> 6) & 7)),
- (char)('0' + ((ent->mode >> 3) & 7)),
- (char)('0' + (ent->mode & 7)), '\0'};
-
- addch(' ');
- attrs = g_state.oldcolor ? (resetdircolor(ent->flags), A_DIM)
- : (fcolors[C_MIS] ? COLOR_PAIR(C_MIS) : 0);
- if (attrs)
- attron(attrs);
-
- /* Print details */
- print_time(&ent->sec, ent->flags);
-
- printw("%s%9s ", perms, (type == S_IFREG || type == S_IFDIR)
- ? coolsize(cfg.blkorder ? (blkcnt_t)ent->blocks << blk_shift : ent->size)
- : (type = (uchar_t)get_detail_ind(ent->mode), (char *)&type));
-
- if (attrs)
- attroff(attrs);
- }
+ int attrs = 0, namelen;
if (g_state.showlines) {
ptrdiff_t rel_num = pdents_index - cur;
printw(rel_num == 0 ? "%4td" : "%+4td", rel_num);
}
- attrs = 0;
-
uchar_t color_pair = get_color_pair_name_ind(ent, &ind, &attrs);
addch((ent->flags & FILE_SELECTED) ? '+' | A_REVERSE | A_BOLD : ' ');
@@ -4284,15 +4266,40 @@ static void printent(int pdents_index, uint_t namecols, bool sel)
++namecols;
#ifndef NOLC
- addwstr(unescape(ent->name, namecols));
+ addwstr((namelen = unescape(ent->name, namecols), (wchar_t *)g_buf));
#else
- addstr(unescape(ent->name, MIN(namecols, ent->nlen) + 1));
+ addstr((namelen = unescape(ent->name, MIN(namecols, ent->nlen) + 1), (char *)g_buf));
#endif
- if (attrs)
+ if (!sel && attrs)
attroff(attrs);
if (ind)
addch(ind);
+ if (cfg.showdetail) {
+ int type = ent->mode & S_IFMT;
+ char perms[6] = {(char)('0' + ((ent->mode >> 6) & 7)),
+ (char)('0' + ((ent->mode >> 3) & 7)),
+ (char)('0' + (ent->mode & 7)), ' ', ' ', '\0'}, *size = NULL;
+
+ if (attrs)
+ attron(attrs);
+ if (!g_state.oldcolor && (type == S_IFDIR || (type == S_IFLNK && ent->flags & DIR_OR_DIRLNK)))
+ attroff(A_BOLD);
+ int sizelen = (type == S_IFREG || type == S_IFDIR) ? xstrlen(size = coolsize(cfg.blkorder ? ent->blocks << blk_shift : ent->size)) : 1;
+ printw("%*c%*s%s%s", 1 + MIN(namecols, dtls.maxnameln + (uint_t)(ind ? 0 : 1)) - namelen, ' ',
+ dtls.maxsizeln - sizelen, "", size ? size : (type = (uchar_t)get_detail_ind(ent->mode), (char *)&type), " ");
+#ifndef NOUG
+ if (g_state.uidgid && dtls.printguid) {
+ addstr(getpwname(ent->uid));
+ printw("%*c%s", dtls.maxuidln + 1 - dtls.uidln, ' ', getgrname(ent->gid));
+ printw("%*c", dtls.maxgidln + 2 - dtls.gidln, ' ');
+ }
+#endif
+ addstr(perms);
+ print_time(&ent->sec, ent->flags);
+ }
+ if (attrs)
+ attroff(attrs);
}
/**
@@ -6527,26 +6534,19 @@ static void statusbar(char *path)
tocursor();
}
-static inline void markhovered(void)
-{
- if (cfg.showdetail && ndents) { /* Bold forward arrowhead */
- tocursor();
- addch('>' | A_BOLD);
- }
-}
-
static int adjust_cols(int n)
{
/* Calculate the number of cols available to print entry name */
#ifdef ICONS_ENABLED
n -= (g_state.oldcolor ? 0 : ICON_SIZE + ICON_PADDING_LEFT_LEN + ICON_PADDING_RIGHT_LEN);
#endif
+
if (cfg.showdetail) {
/* Fallback to light mode if less than 35 columns */
- if (n < 36)
+ if (n < (dtls.maxentln + 1 - dtls.maxnameln))
cfg.showdetail ^= 1;
else /* 2 more accounted for below */
- n -= 32;
+ n -= (dtls.maxentln - 2 - dtls.maxnameln);
}
/* 2 columns for preceding space and indicator */
@@ -6412,8 +6411,6 @@ static void draw_line(int ncols)
/* Must reset e.g. no files in dir */
if (dir)
attroff(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
-
- markhovered();
}
static void redraw(char *path)
@@ -6521,6 +6518,21 @@ static void redraw(char *path)
onscreen = MIN(onscreen + curscroll, ndents);
+ if (cfg.showdetail) {
+ ushort_t lenbuf = dtls.maxnameln = dtls.maxsizeln = dtls.maxuidln = dtls.maxgidln = dtls.printguid = 0;
+ for (i = curscroll; i < onscreen; ++i) {
+ if ((lenbuf = pdents[i].nlen - 1) > dtls.maxnameln) dtls.maxnameln = lenbuf;
+ if ((lenbuf = xstrlen(coolsize(cfg.blkorder ? pdents[i].blocks << blk_shift : pdents[i].size))) > dtls.maxsizeln) dtls.maxsizeln = lenbuf;
+#ifndef NOUG
+ if (g_state.uidgid) {
+ if ((getpwname(pdents[i].uid), dtls.uidln) > dtls.maxuidln) dtls.maxuidln = dtls.uidln;
+ if ((getgrname(pdents[i].gid), dtls.gidln) > dtls.maxgidln) dtls.maxgidln = dtls.gidln;
+ }
+#endif
+ }
+ dtls.maxentln = dtls.maxnameln + dtls.maxsizeln + (dtls.printguid ? (dtls.maxuidln + dtls.maxgidln + 29) : 26);
+ }
+
ncols = adjust_cols(ncols);
int len = scanselforpath(path, FALSE);
@@ -6551,7 +6563,7 @@ static void redraw(char *path)
#endif
}
- markhovered();
+ statusbar(path);
}
static bool cdprep(char *lastdir, char *lastname, char *path, char *newpath)

View File

@ -0,0 +1,269 @@
# Description: Adds preview pipe to enable closing and re-opening the preview
# pane when running an undetached editor. If you are using vim
# you might experience incorrectly resized window. Consider adding
# the following to your vimrc:
# autocmd VimEnter * :silent exec "!kill -s WINCH $PPID"
#
# Authors: Luuk van Baal
diff --git a/src/nnn.c b/src/nnn.c
index 0388b23c..66d3316a 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -391,7 +391,8 @@ typedef struct {
uint_t usebsdtar : 1; /* Use bsdtar as default archive utility */
uint_t xprompt : 1; /* Use native prompt instead of readline prompt */
uint_t showlines : 1; /* Show line numbers */
- uint_t reserved : 3; /* Adjust when adding/removing a field */
+ uint_t previewer : 1; /* Run state of previewer */
+ uint_t reserved : 2; /* Adjust when adding/removing a field */
} runstate;
/* Contexts or workspaces */
@@ -516,6 +517,9 @@ alignas(max_align_t) static char g_tmpfpath[TMP_LEN_MAX];
/* Buffer to store plugins control pipe location */
alignas(max_align_t) static char g_pipepath[TMP_LEN_MAX];
+/* Buffer to store preview plugins control pipe location */
+static char g_ppipepath[TMP_LEN_MAX] __attribute__ ((aligned));
+
/* Non-persistent runtime states */
static runstate g_state;
@@ -696,12 +700,13 @@ static const char * const messages[] = {
#define NNN_FCOLORS 5
#define NNNLVL 6
#define NNN_PIPE 7
-#define NNN_MCLICK 8
-#define NNN_SEL 9
-#define NNN_ARCHIVE 10
-#define NNN_ORDER 11
-#define NNN_HELP 12 /* strings end here */
-#define NNN_TRASH 13 /* flags begin here */
+#define NNN_PPIPE 8
+#define NNN_MCLICK 9
+#define NNN_SEL 10
+#define NNN_ARCHIVE 11
+#define NNN_ORDER 12
+#define NNN_HELP 13 /* strings end here */
+#define NNN_TRASH 14 /* flags begin here */
static const char * const env_cfg[] = {
"NNN_OPTS",
@@ -712,6 +717,7 @@ static const char * const env_cfg[] = {
"NNN_FCOLORS",
"NNNLVL",
"NNN_PIPE",
+ "NNN_PPIPE",
"NNN_MCLICK",
"NNN_SEL",
"NNN_ARCHIVE",
@@ -850,7 +856,7 @@ static int set_sort_flags(int r);
static void statusbar(char *path);
static bool get_output(char *file, char *arg1, char *arg2, int fdout, bool page);
#ifndef NOFIFO
-static void notify_fifo(bool force);
+static void notify_fifo(bool force, bool closepreview);
#endif
/* Functions */
@@ -3140,7 +3146,7 @@ try_quit:
} else {
#ifndef NOFIFO
if (!g_state.fifomode)
- notify_fifo(TRUE); /* Send hovered path to NNN_FIFO */
+ notify_fifo(TRUE, FALSE); /* Send hovered path to NNN_FIFO */
#endif
escaped = TRUE;
settimeout();
@@ -5258,15 +5264,20 @@ static void run_cmd_as_plugin(const char *file, uchar_t flags)
static bool plctrl_init(void)
{
- size_t len;
+ size_t len, lenbuf;
+ pid_t pid = getpid();
/* g_tmpfpath is used to generate tmp file names */
g_tmpfpath[tmpfplen - 1] = '\0';
- len = xstrsncpy(g_pipepath, g_tmpfpath, TMP_LEN_MAX);
+ len = lenbuf = xstrsncpy(g_pipepath, g_tmpfpath, TMP_LEN_MAX);
g_pipepath[len - 1] = '/';
- len = xstrsncpy(g_pipepath + len, "nnn-pipe.", TMP_LEN_MAX - len) + len;
- xstrsncpy(g_pipepath + len - 1, xitoa(getpid()), TMP_LEN_MAX - len);
+ xstrsncpy(g_ppipepath, g_pipepath, TMP_LEN_MAX);
+ len += xstrsncpy(g_pipepath + len, "nnn-pipe.", TMP_LEN_MAX - len);
+ xstrsncpy(g_pipepath + len - 1, xitoa(pid), TMP_LEN_MAX - len);
+ len = xstrsncpy(g_ppipepath + lenbuf, "nnn-ppipe.", TMP_LEN_MAX - lenbuf) + lenbuf;
+ xstrsncpy(g_ppipepath + len - 1, xitoa(pid), TMP_LEN_MAX - len);
setenv(env_cfg[NNN_PIPE], g_pipepath, TRUE);
+ setenv(env_cfg[NNN_PPIPE], g_ppipepath, TRUE);
return EXIT_SUCCESS;
}
@@ -5295,6 +5306,21 @@ static ssize_t read_nointr(int fd, void *buf, size_t count)
return len;
}
+void *previewpipe(void *arg __attribute__ ((unused)))
+{
+ int fd, buf;
+
+ mkfifo(g_ppipepath, 0600);
+ fd = open(g_ppipepath, O_RDONLY);
+
+ if (read(fd, &buf, 1) == 1)
+ g_state.previewer = buf;
+
+ close(fd);
+ unlink(g_ppipepath);
+ return NULL;
+}
+
static char *readpipe(int fd, char *ctxnum, char **path)
{
char ctx, *nextpath = NULL;
@@ -5979,7 +6005,7 @@ static void populate(char *path, char *lastname)
}
#ifndef NOFIFO
-static void notify_fifo(bool force)
+static void notify_fifo(bool force, bool closepreview)
{
if (!fifopath)
return;
@@ -5995,6 +6021,12 @@ static void notify_fifo(bool force)
}
}
+ if (closepreview) {
+ if (write(fifofd, "close\n", 6) != 6)
+ xerror();
+ return;
+ }
+
static struct entry lastentry;
if (!force && !memcmp(&lastentry, &pdents[cur], sizeof(struct entry))) // NOLINT
@@ -6027,7 +6059,7 @@ static void send_to_explorer(int *presel)
if (fd > 1)
close(fd);
} else
- notify_fifo(TRUE); /* Send opened path to NNN_FIFO */
+ notify_fifo(TRUE, FALSE); /* Send opened path to NNN_FIFO */
}
#endif
@@ -6060,7 +6092,7 @@ static void move_cursor(int target, int ignore_scrolloff)
#ifndef NOFIFO
if (!g_state.fifomode)
- notify_fifo(FALSE); /* Send hovered path to NNN_FIFO */
+ notify_fifo(FALSE, FALSE); /* Send hovered path to NNN_FIFO */
#endif
}
@@ -6733,7 +6765,7 @@ static bool browse(char *ipath, const char *session, int pkey)
pEntry pent;
enum action sel;
struct stat sb;
- int r = -1, presel, selstartid = 0, selendid = 0;
+ int r = -1, presel, selstartid = 0, selendid = 0, previewkey = 0;
const uchar_t opener_flags = (cfg.cliopener ? F_CLI : (F_NOTRACE | F_NOSTDIN | F_NOWAIT));
bool watch = FALSE, cd = TRUE;
ino_t inode = 0;
@@ -6991,7 +7023,7 @@ nochange:
move_cursor(r, 1);
#ifndef NOFIFO
else if ((event.bstate == BUTTON1_PRESSED) && !g_state.fifomode)
- notify_fifo(TRUE); /* Send clicked path to NNN_FIFO */
+ notify_fifo(TRUE, FALSE); /* Send clicked path to NNN_FIFO */
#endif
/* Handle right click selection */
if (event.bstate == BUTTON3_PRESSED) {
@@ -7153,7 +7185,14 @@ nochange:
&& strstr(g_buf, "text")
#endif
) {
+ if (g_state.previewer)
+ notify_fifo(FALSE, TRUE);
spawn(editor, newpath, NULL, NULL, F_CLI);
+ if (g_state.previewer) {
+ pkey = previewkey;
+ goto run_plugin;
+ }
+
if (cfg.filtermode) {
presel = FILTER;
clearfilter();
@@ -7471,8 +7510,14 @@ nochange:
copycurname();
goto nochange;
case SEL_EDIT:
+ if (g_state.previewer)
+ notify_fifo(FALSE, TRUE);
if (!(g_state.picker || g_state.fifomode))
spawn(editor, newpath, NULL, NULL, F_CLI);
+ if (g_state.previewer) {
+ pkey = previewkey;
+ goto run_plugin;
+ }
continue;
default: /* SEL_LOCK */
lock_terminal();
@@ -7860,6 +7905,7 @@ nochange:
cd = FALSE;
goto begin;
}
+run_plugin:
case SEL_PLUGIN:
/* Check if directory is accessible */
if (!xdiraccess(plgpath)) {
@@ -7885,6 +7931,12 @@ nochange:
goto nochange;
}
+ if (xstrcmp(tmp, "preview-tui") == 0) {
+ previewkey = r;
+ pthread_t tid;
+ pthread_create(&tid, NULL, previewpipe, NULL);
+ }
+
if (tmp[0] == '-' && tmp[1]) {
++tmp;
r = FALSE; /* Do not refresh dir after completion */
@@ -7943,7 +7995,13 @@ nochange:
case SEL_SHELL: // fallthrough
case SEL_LAUNCH: // fallthrough
case SEL_PROMPT:
+ if (g_state.previewer)
+ notify_fifo(FALSE, TRUE);
r = handle_cmd(sel, path, newpath);
+ if (g_state.previewer) {
+ pkey = previewkey;
+ goto run_plugin;
+ }
/* Continue in type-to-nav mode, if enabled */
if (cfg.filtermode)
@@ -8492,8 +8550,10 @@ static void cleanup(void)
if (g_state.autofifo)
unlink(fifopath);
#endif
- if (g_state.pluginit)
+ if (g_state.pluginit){
unlink(g_pipepath);
+ unlink(g_ppipepath);
+ }
#ifdef DEBUG
disabledbg();
#endif
@@ -9020,7 +9080,7 @@ int main(int argc, char *argv[])
#ifndef NOFIFO
if (!g_state.fifomode)
- notify_fifo(FALSE);
+ notify_fifo(FALSE, TRUE);
if (fifofd != -1)
close(fifofd);
#endif

51
plugins/.cbcp Executable file
View File

@ -0,0 +1,51 @@
#!/usr/bin/env sh
# Description: Copy selection to system clipboard as newline-separated entries
# Dependencies:
# - tr
# - xclip/xsel (Linux)
# - pbcopy (macOS)
# - termux-clipboard-set (Termux)
# - clip.exe (WSL)
# - clip (Cygwin)
# - wl-copy (Wayland)
# - clipboard (Haiku)
#
# Limitation: breaks if a filename has newline in it
#
# Note: For a space-separated list:
# xargs -0 < "$SELECTION"
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" # protect trailing \n
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
[ -s "$selection" ] || { echo "plugin .cbcp error: empty selection" >&2 ; exit 1; }
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then
# Wayland
tr '\0' '\n' < "$selection" | wl-copy
elif type xsel >/dev/null 2>&1; then
# Linux
tr '\0' '\n' < "$selection" | xsel -bi
elif type xclip >/dev/null 2>&1; then
# Linux
tr '\0' '\n' < "$selection" | xclip -sel clip
elif type pbcopy >/dev/null 2>&1; then
# macOS
tr '\0' '\n' < "$selection" | pbcopy
elif type termux-clipboard-set >/dev/null 2>&1; then
# Termux
tr '\0' '\n' < "$selection" | termux-clipboard-set
elif type clip.exe >/dev/null 2>&1; then
# WSL
tr '\0' '\n' < "$selection" | clip.exe
elif type clip >/dev/null 2>&1; then
# Cygwin
tr '\0' '\n' < "$selection" | clip
elif type clipboard >/dev/null 2>&1; then
# Haiku
tr '\0' '\n' < "$selection" | clipboard --stdin
fi

441
plugins/.iconlookup Executable file
View File

@ -0,0 +1,441 @@
#!/usr/bin/env sh
# Description: Print icons in front of list of directories/files
# Dependencies: awk
# Usage
# 1. Set colors and/or icons to your liking
# 2. Pipe any directory listing to iconlookup and it will output prepended icons
# 3. preview-tui uses the script to prepend icon to directory listings
# 4. Aditionally you can consider adding it to your PATH and/or FZF_DEFAULT_COMMAND to
# make it work with various fzf plugins (make sure you also add --ansi to your FZF_DEFAULT_OPTS)
# Shell: POSIX compliant
# Author: Luuk van Baal (https://github.com/luukvbaal/iconlookup)
icon_lookup() {
awk 'BEGIN {
# Set your ANSI colorscheme below (https://en.wikipedia.org/wiki/ANSI_escape_code#Colors).
# Default uses standard nnn icon colors, 8 and 24-bit nord themes are commented out.
colordepth=8 #colordepth=8 #colordepth=24
color_dirtxt=39 #color_dirtxt=111 #color_dirtxt="129;161;193"
color_filetxt=15 #color_filetxt=111 #color_filetxt="129;161;193"
color_default=39 #color_default=111 #color_default="129;161;193"
color_video=93 #color_video=110 #color_video="136;192;208"
color_audio=220 #color_audio=150 #color_audio="163;190;140"
color_image=82 #color_image=150 #color_image="163;190;140"
color_docs=202 #color_docs=173 #color_docs="208;135;112"
color_archive=209 #color_archive=179 #color_archive="235;203;139"
color_c=81 #color_c=150 #color_c="163;190;140"
color_elixir=104 #color_elixir=109 #color_elixir="143;188;187"
color_java=32 #color_java=139 #color_java="180;142;173"
color_js=47 #color_js=109 #color_js="143;188;187"
color_react=39 #color_react=111 #color_react="129;161;193"
color_css=199 #color_css=110 #color_css="136;192;208"
color_python=227 #color_python=68 #color_python="94;129;172"
color_lua=19 #color_lua=167 #color_lua="191;97;106"
color_document=15 #color_document=173 #color_document="208;135;112"
color_fsharp=31 #color_fsharp=179 #color_fsharp="180;142;173"
color_ruby=160 #color_ruby=150 #color_ruby="163;190;140"
color_scala=196 #color_scala=139 #color_scala="143;188;187"
color_shell=47 #color_shell=109 #color_shell="143;188;187"
color_vim=28 #color_vim=109 #color_vim="143;188;187"
# icons[][1] contains icon and icons[][2] contains color
icons["directory"][1] = ""; icons["directory"][2] = color_default
icons["file"][1] = "󰈔"; icons["file"][2] = color_default
icons["exec"][1] = ""; icons["exec"][2] = color_default
icons["manual"][1] = "󱓷"; icons["manual"][2] = color_docs
icons["pipe"][1] = "󰟥"; icons["pipe"][2] = color_default
icons["socket"][1] = "󰟩"; icons["socket"][2] = color_default
icons["door"][1] = "➡"; icons["door"][2] = color_default
# top level and common icons
icons[".git"][1] = ""; icons[".git"][2] = color_default
icons["desktop"][1] = "󰟀"; icons["desktop"][2] = color_default
icons["briefcase"][1] = "󰃖"; icons["briefcase"][2] = color_default
icons["document"][1] = "󰃖"; icons["document"][2] = color_default
icons["downloads"][1] = "󰃘"; icons["downloads"][2] = color_default
icons["music"][1] = "󱍙"; icons["music"][2] = color_default
icons["musicfile"][1] = "󰎈"; icons["musicfile"][2] = color_audio
icons["pictures"][1] = "󰉔"; icons["pictures"][2] = color_default
icons["picturefile"][1] = "󰈟"; icons["picturefile"][2] = color_image
icons["public"][1] = ""; icons["public"][2] = color_default
icons["templates"][1] = "󰗇"; icons["templates"][2] = color_default
icons["videos"][1] = "󰈰"; icons["videos"][2] = color_default
icons["videofile"][1] = "󰈫"; icons["videofile"][2] = color_video
icons["changelog"][1] = "󰋚"; icons["changelog"][2] = color_docs
icons["configure"][1] = ""; icons["configure"][2] = color_default
icons["license"][1] = "󰈙"; icons["license"][2] = color_docs
icons["makefile"][1] = "󰆍"; icons["makefile"][2] = color_default
icons["archive"][1] = "󰀼"; icons["archive"][2] = color_archive
icons["rust"][1] = ""; icons["rust"][2] = color_default
icons["script"][1] = ""; icons["script"][2] = color_shell
icons["subtitle"][1] = "󰅺"; icons["subtitle"][2] = color_default
icons["cplusplus"][1] = ""; icons["cplusplus"][2] = color_c
icons["java"][1] = ""; icons["java"][2] = color_java
icons["clojure"][1] = ""; icons["clojure"][2] = color_default
icons["js"][1] = "󰌞"; icons["js"][2] = color_js
icons["linux"][1] = "󰌽"; icons["linux"][2] = color_default
icons["elixir"][1] = ""; icons["elixir"][2] = color_fsharp
icons["fsharp"][1] = ""; icons["fsharp"][2] = color_fsharp
icons["ruby"][1] = ""; icons["ruby"][2] = color_ruby
icons["c"][1] = ""; icons["c"][2] = color_c
icons["chess"][1] = "󰄺"; icons["chess"][2] = color_default
icons["haskell"][1] = ""; icons["haskell"][2] = color_vim
icons["font"][1] = ""; icons["font"][2] = color_default
icons["html"][1] = "󰌝"; icons["html"][2] = color_default
icons["react"][1] = ""; icons["react"][2] = color_react
icons["python"][1] = ""; icons["python"][2] = color_python
icons["database"][1] = "󰆼"; icons["database"][2] = color_default
icons["worddoc"][1] = "󰈬"; icons["worddoc"][2] = color_document
icons["playlist"][1] = "󱍙"; icons["playlist"][2] = color_audio
icons["opticaldisk"][1] = ""; icons["opticaldisk"][2] = color_archive
# numbers
icons["1"][1] = icons["manual"][1]; icons["1"][2] = icons["manual"][2]
icons["7z"][1] = icons["archive"][1]; icons["7z"][2] = icons["archive"][2]
# a
icons["a"][1] = icons["manual"][1]; icons["a"][2] = icons["manual"][2]
icons["apk"][1] = icons["archive"][1]; icons["apk"][2] = icons["archive"][2]
icons["asm"][1] = icons["file"][1]; icons["asm"][2] = icons["file"][2]
icons["aup"][1] = icons["musicfile"][1]; icons["aup"][2] = icons["musicfile"][2]
icons["avi"][1] = icons["videofile"][1]; icons["avi"][2] = icons["videofile"][2]
# b
icons["bat"][1] = icons["script"][1]; icons["bat"][2] = icons["script"][2]
icons["bin"][1] = ""; icons["bin"][2] = color_default
icons["bmp"][1] = icons["picturefile"][1]; icons["bmp"][2] = icons["picturefile"][2]
icons["bz2"][1] = icons["archive"][1]; icons["bz2"][2] = icons["archive"][2]
# c
icons["cplusplus"][1] = icons["cplusplus"][1]; icons["cplusplus"][2] = icons["cplusplus"][2]
icons["cabal"][1] = icons["haskell"][1]; icons["cab"][2] = icons["haskell"][2]
icons["cab"][1] = icons["archive"][1]; icons["cab"][2] = icons["archive"][2]
icons["cbr"][1] = icons["archive"][1]; icons["cbr"][2] = icons["archive"][2]
icons["cbz"][1] = icons["archive"][1]; icons["cbz"][2] = icons["archive"][2]
icons["cc"][1] = icons["cplusplus"][1]; icons["cc"][2] = icons["cplusplus"][2]
icons["class"][1] = icons["java"][1]; icons["class"][2] = icons["java"][2]
icons["clj"][1] = icons["clojure"][1]; icons["clj"][2] = icons["clojure"][2]
icons["cljc"][1] = icons["clojure"][1]; icons["cljc"][2] = icons["clojure"][2]
icons["cljs"][1] = icons["clojure"][1]; icons["cljs"][2] = icons["clojure"][2]
icons["cmake"][1] = icons["makefile"][1]; icons["cmake"][2] = icons["makefile"][2]
icons["coffee"][1] = ""; icons["coffee"][2] = color_default
icons["conf"][1] = icons["configure"][1]; icons["conf"][2] = icons["configure"][2]
icons["cpio"][1] = icons["archive"][1]; icons["cpio"][2] = icons["archive"][2]
icons["cpp"][1] = icons["cplusplus"][1]; icons["cpp"][2] = icons["cplusplus"][2]
icons["css"][1] = ""; icons["css"][2] = color_css
icons["cue"][1] = icons["playlist"][1]; icons["cue"][2] = icons["playlist"][2]
icons["cvs"][1] = icons["configure"][1]; icons["cvs"][2] = icons["configure"][2]
icons["cxx"][1] = icons["cplusplus"][1]; icons["cxx"][2] = icons["cplusplus"][2]
# d
icons["db"][1] = icons["database"][1]; icons["db"][2] = icons["database"][2]
icons["deb"][1] = ""; icons["deb"][2] = color_archive
icons["diff"][1] = ""; icons["diff"][2] = color_default
icons["dll"][1] = icons["script"][1]; icons["dll"][2] = icons["script"][2]
icons["doc"][1] = icons["worddoc"][1]; icons["doc"][2] = icons["worddoc"][2]
icons["docx"][1] = icons["worddoc"][1]; icons["docx"][2] = icons["worddoc"][2]
# e
icons["ejs"][1] = icons["js"][1]; icons["ejs"][2] = icons["js"][2]
icons["elf"][1] = icons["linux"][1]; icons["elf"][2] = icons["linux"][2]
icons["epub"][1] = icons["manual"][1]; icons["epub"][2] = icons["manual"][2]
icons["exe"][1] = icons["exec"][1]; icons["exe"][2] = icons["exec"][2]
icons["ex"][1] = icons["elixir"][1]; icons["ex"][2] = icons["elixir"][2]
icons["eex"][1] = icons["elixir"][1]; icons["eex"][2] = icons["elixir"][2]
icons["exs"][1] = icons["elixir"][1]; icons["exs"][2] = icons["elixir"][2]
# f
icons["fsharp"][1] = icons["fsharp"][1]; icons["fsharp"][2] = icons["fsharp"][2]
icons["flac"][1] = icons["musicfile"][1]; icons["flac"][2] = icons["musicfile"][2]
icons["fen"][1] = icons["chess"][1]; icons["fen"][2] = icons["chess"][2]
icons["flv"][1] = icons["videofile"][1]; icons["flv"][2] = icons["videofile"][2]
icons["fs"][1] = icons["fsharp"][1]; icons["fs"][2] = icons["fsharp"][2]
icons["fsi"][1] = icons["fsharp"][1]; icons["fsi"][2] = icons["fsharp"][2]
icons["fsscript"][1] = icons["fsharp"][1]; icons["fsscript"][2] = icons["fsharp"][2]
icons["fsx"][1] = icons["fsharp"][1]; icons["fsx"][2] = icons["fsharp"][2]
# g
icons["gem"][1] = icons["ruby"][1]; icons["gem"][2] = icons["ruby"][2]
icons["gif"][1] = icons["picturefile"][1]; icons["gif"][2] = icons["picturefile"][2]
icons["go"][1] = "󰟓"; icons["go"][2] = color_default
icons["gz"][1] = icons["archive"][1]; icons["gz"][2] = icons["archive"][2]
icons["gzip"][1] = icons["archive"][1]; icons["gzip"][2] = icons["archive"][2]
# h
icons["h"][1] = icons["c"][1]; icons["h"][2] = icons["c"][2]
icons["hh"][1] = icons["cplusplus"][1]; icons["hh"][2] = icons["cplusplus"][2]
icons["hpp"][1] = icons["cplusplus"][1]; icons["hpp"][2] = icons["cplusplus"][2]
icons["hs"][1] = icons["haskell"][1]; icons["hs"][2] = icons["haskell"][2]
icons["htaccess"][1] = icons["configure"][1]; icons["htaccess"][2] = icons["configure"][2]
icons["htpasswd"][1] = icons["configure"][1]; icons["htpasswd"][2] = icons["configure"][2]
icons["htm"][1] = icons["html"][1]; icons["htm"][2] = icons["html"][2]
icons["hxx"][1] = icons["cplusplus"][1]; icons["hxx"][2] = icons["cplusplus"][2]
icons["heex"][1] = icons["elixir"][1]; icons["heex"][2] = icons["elixir"][2]
# i
icons["ico"][1] = icons["picturefile"][1]; icons["ico"][2] = icons["picturefile"][2]
icons["img"][1] = icons["opticaldisk"][1]; icons["img"][2] = icons["opticaldisk"][2]
icons["ini"][1] = icons["configure"][1]; icons["ini"][2] = icons["configure"][2]
icons["iso"][1] = icons["opticaldisk"][1]; icons["iso"][2] = icons["opticaldisk"][2]
icons["isub"][1] = icons["subtitle"][1]; icons["isub"][2] = icons["subtitle"][2]
# j
icons["jar"][1] = icons["java"][1]; icons["jar"][2] = icons["java"][2]
icons["java"][1] = icons["java"][1]; icons["java"][2] = icons["java"][2]
icons["jl"][1] = icons["configure"][1]; icons["jl"][2] = icons["configure"][2]
icons["jpeg"][1] = icons["picturefile"][1]; icons["jpeg"][2] = icons["picturefile"][2]
icons["jpg"][1] = icons["picturefile"][1]; icons["jpg"][2] = icons["picturefile"][2]
icons["json"][1] = ""; icons["json"][2] = color_js
icons["jsx"][1] = icons["react"][1]; icons["jsx"][2] = icons["react"][2]
icons["jxl"][1] = icons["picturefile"][1]; icons["jxl"][2] = icons["picturefile"][2]
# k
icons["ksh"][1] = icons["font"][1]; icons["ksf"][2] = icons["font"][2]
# l
icons["lha"][1] = icons["archive"][1]; icons["lha"][2] = icons["archive"][2]
icons["lhs"][1] = icons["haskell"][1]; icons["lhs"][2] = icons["haskell"][2]
icons["ilog"][1] = icons["document"][1]; icons["ilog"][2] = icons["document"][2]
icons["lua"][1] = ""; icons["lua"][2] = color_lua
icons["lzh"][1] = icons["archive"][1]; icons["lzh"][2] = icons["archive"][2]
icons["lzma"][1] = icons["archive"][1]; icons["lzma"][2] = icons["archive"][2]
# m
icons["m"][1] = "󰠞"; icons["mat"][2] = color_c
icons["m4a"][1] = icons["musicfile"][1]; icons["m4a"][2] = icons["musicfile"][2]
icons["m4v"][1] = icons["videofile"][1]; icons["m4v"][2] = icons["videofile"][2]
icons["mat"][1] = ""; icons["mat"][2] = color_c
icons["markdown"][1] = ""; icons["markdown"][2] = color_docs
icons["md"][1] = ""; icons["md"][2] = color_docs
icons["mk"][1] = icons["makefile"][1]; icons["mk"][2] = icons["makefile"][2]
icons["mkv"][1] = icons["videofile"][1]; icons["mkv"][2] = icons["videofile"][2]
icons["mov"][1] = icons["videofile"][1]; icons["mov"][2] = icons["videofile"][2]
icons["mp3"][1] = icons["musicfile"][1]; icons["mp3"][2] = icons["musicfile"][2]
icons["mp4"][1] = icons["videofile"][1]; icons["mp4"][2] = icons["videofile"][2]
icons["mpeg"][1] = icons["videofile"][1]; icons["mpeg"][2] = icons["videofile"][2]
icons["mpg"][1] = icons["videofile"][1]; icons["mpg"][2] = icons["videofile"][2]
icons["msi"][1] = "󰍲"; icons["msi"][2] = color_default
# n
icons["nix"][1] = ""; icons["nix"][2] = color_fsharp
# o
icons["o"][1] = icons["manual"][1]; icons["o"][2] = icons["manual"][2]
icons["ogg"][1] = icons["musicfile"][1]; icons["ogg"][2] = icons["musicfile"][2]
icons["odownload"][1] = icons["download"][1]; icons["odownload"][2] = icons["download"][2]
icons["otf"][1] = icons["font"][1]; icons["otf"][2] = icons["font"][2]
icons["out"][1] = icons["linux"][1]; icons["out"][2] = icons["linux"][2]
# p
icons["part"][1] = icons["download"][1]; icons["part"][2] = icons["download"][2]
icons["patch"][1] = icons["diff"][1]; icons["patch"][2] = icons["diff"][2]
icons["pdf"][1] = "󰈦"; icons["pdf"][2] = color_docs
icons["pgn"][1] = icons["chess"][1]; icons["pgn"][2] = icons["chess"][2]
icons["php"][1] = ""; icons["php"][2] = color_default
icons["png"][1] = icons["picturefile"][1]; icons["png"][2] = icons["picturefile"][2]
icons["ppt"][1] = "󰈧"; icons["ppt"][2] = color_default
icons["pptx"][1] = "󰈧"; icons["pptx"][2] = color_default
icons["psb"][1] = ""; icons["psb"][2] = color_default
icons["psd"][1] = ""; icons["psd"][2] = color_default
icons["py"][1] = icons["python"][1]; icons["py"][2] = icons["python"][2]
icons["pyc"][1] = icons["python"][1]; icons["pyc"][2] = icons["python"][2]
icons["pyd"][1] = icons["python"][1]; icons["pyd"][2] = icons["python"][2]
icons["pyo"][1] = icons["python"][1]; icons["pyo"][2] = icons["python"][2]
# q
# r
icons["rar"][1] = icons["archive"][1]; icons["rar"][2] = icons["archive"][2]
icons["rc"][1] = icons["configure"][1]; icons["rc"][2] = icons["configure"][2]
icons["rom"][1] = "󰊖"; icons["rom"][2] = color_default
icons["rpm"][1] = icons["archive"][1]; icons["rpm"][2] = icons["archive"][2]
icons["rss"][1] = ""; icons["rss"][2] = color_default
icons["rtf"][1] = "󰈦"; icons["rtf"][2] = color_default
# s
icons["sass"][1] = ""; icons["sass"][2] = color_css
icons["scss"][1] = ""; icons["scss"][2] = color_css
icons["so"][1] = icons["manual"][1]; icons["so"][2] = icons["manual"][2]
icons["scala"][1] = ""; icons["scala"][2] = color_scala
icons["sh"][1] = icons["script"][1]; icons["sh"][2] = icons["script"][2]
icons["slim"][1] = icons["script"][1]; icons["slim"][2] = icons["script"][2]
icons["sln"][1] = ""; icons["sln"][2] = color_default
icons["sql"][1] = icons["database"][1]; icons["sql"][2] = icons["database"][2]
icons["srt"][1] = icons["subtitle"][1]; icons["srt"][2] = icons["subtitle"][2]
icons["svg"][1] = icons["picturefile"][1]; icons["svg"][2] = icons["picturefile"][2]
# t
icons["tar"][1] = icons["archive"][1]; icons["tar"][2] = icons["archive"][2]
icons["tex"][1] = "󰙩"; icons["tex"][2] = color_default
icons["tgz"][1] = icons["archive"][1]; icons["tgz"][2] = icons["archive"][2]
icons["ts"][1] = ""; icons["ts"][2] = color_js
icons["tsx"][1] = icons["react"][1]; icons["tsx"][2] = icons["react"][2]
icons["txt"][1] = icons["document"][1]; icons["txt"][2] = icons["document"][2]
icons["txz"][1] = icons["archive"][1]; icons["txz"][2] = icons["archive"][2]
icons["ttf"][1] = icons["font"][1]; icons["ttf"][2] = icons["font"][2]
# u
# v
icons["vid"][1] = icons["videofile"][1]; icons["vid"][2] = icons["videofile"][2]
icons["vim"][1] = ""; icons["vim"][2] = color_vim
icons["vimrc"][1] = ""; icons["vimrc"][2] = color_vim
icons["vtt"][1] = icons["subtitle"][1]; icons["vtt"][2] = icons["subtitle"][2]
# w
icons["wav"][1] = icons["musicfile"][1]; icons["wav"][2] = icons["musicfile"][2]
icons["webm"][1] = icons["videofile"][1]; icons["webm"][2] = icons["videofile"][2]
icons["wma"][1] = icons["videofile"][1]; icons["wma"][2] = icons["videofile"][2]
icons["wmv"][1] = icons["videofile"][1]; icons["wmv"][2] = icons["videofile"][2]
# x
icons["xbps"][1] = icons["archive"][1]; icons["xbps"][2] = color_archive
icons["xcf"][1] = icons["picturefile"][1]; icons["xcf"][2] = color_image
icons["xhtml"][1] = icons["html"][1]; icons["xhtml"][2] = icons["html"][2]
icons["xls"][1] = "󰈛"; icons["xls"][2] = color_default
icons["xlsx"][1] = "󰈛"; icons["xlsx"][2] = color_default
icons["xml"][1] = icons["html"][1]; icons["xml"][2] = icons["html"][2]
icons["xz"][1] = icons["archive"][1]; icons["xz"][2] = icons["archive"][2]
# y
icons["yaml"][1] = icons["configure"][1]; icons["yaml"][2] = icons["configure"][2]
icons["yml"][1] = icons["configure"][1]; icons["yml"][2] = icons["configure"][2]
# z
icons["zip"][1] = icons["archive"][1]; icons["zip"][2] = icons["archive"][2]
icons["zsh"][1] = icons["script"][1]; icons["zsh"][2] = icons["script"][2]
icons["zst"][1] = icons["archive"][1]; icons["zst"][2] = icons["archive"][2]
FS = "."
limit = ENVIRON["limit"]
switch (colordepth) {
case "4":
escape="\033["
break;
case "8":
escape="\033[38;5;"
break;
case "24":
escape="\033[38;2;"
break;
}
bstr = ENVIRON["beforestr"]
}
{
# dont print cwd . and leading ./ from tree -f
if ($0 ~/^\.$/)
next
ent = ($0 ~/^\.\//) ? substr($0, 3, length($0) - 2) : $0
ext = $NF
# Print icons, set color and bold directories by using ansi escape codes
if (ext in icons)
printcolor(icons[ext][1], icons[ext][2], color_filetxt, ent, "10")
else
switch (substr(ent, length(ent), 1)) {
case "/":
printcolor(icons["directory"][1], color_default, color_dirtxt, ent, "1")
break;
case "*":
printcolor(icons["exe"][1], color_default, color_filetxt, ent, "10")
break;
case "|":
printcolor(icons["pipe"][1], color_default, color_filetxt, ent, "10")
break;
case "=":
printcolor(icons["socket"][1], color_default, color_filetxt, ent, "10")
break;
case ">":
printcolor(icons["door"][1], color_default, color_filetxt, ent, "10")
break;
default:
printcolor(icons["file"][1], color_default, color_filetxt, ent, "10")
}
}
function printcolor(i, c, d, n, b) {
if (limit != "" && length(n) + 2 > limit)
n = substr(n, 1, limit - 2)
printf "\033[0m"
printf "%s%s%s;%sm%s %s%sm%s\n", bstr, escape, c, b, i, escape, d, n
}'
printf '\033[0m'
}
print_begin() {
printf '%s\n' "$1" | sed 's/\\n/\n/g'
}
print_end() {
printf '%s\n' "$1" | sed 's/\\n/\n/g'
}
print_help() {
printf 'Icon Lookup\n
Usage:
iconlookup [options]
iconlookup [-bBe] [string]
iconlookup -l [number]
iconlookup (-h | --help)
Prepend icons to list of files based on extension or appended indicator by ls/tree "-F" flag ("/" for directory, "*" for executable etc.)
Options:
-h --help -? Show this screen.
-b --before Prepend str before icon.
-B --begin Prepend str before output.
-e --end Append str after output.
-l --limit Limit line length to [number] characters.'
}
while :; do
case $1 in
-h|-\?|--help)
print_help
exit ;;
-B|--begin)
if [ -n "$2" ]; then
print_begin "$2"
fi
shift ;;
-e|--end)
if [ -n "$2" ]; then
end=1
endstr="$2"
fi
shift ;;
-b|--before)
if [ -n "$2" ]; then
export beforestr="$2"
fi
shift ;;
-l|--limit)
if [ -n "$2" ]; then
export limit="$2"
shift
else
printf 'ERROR: "--limit" requires a non-empty option argument.\n'
exit
fi ;;
--)
shift
break ;;
-?*)
printf 'WARNING: Unknown option ignored: %s\n' "$1" ;;
*) break ;;
esac
shift
done
if [ ! -t 0 ]; then
[ -n "$beforestr" ] && limit="$((limit - ${#beforestr}))"
icon_lookup
else
printf 'ERROR: no data provided...\nExpecting a directory listing in stdin\n'
fi
if [ -n "$end" ]; then
print_end "$endstr"
fi

174
plugins/.nmv Executable file
View File

@ -0,0 +1,174 @@
#!/usr/bin/env bash
# Description: An almost fully POSIX compliant batch file renamer
#
# Note: nnn auto-detects and invokes this plugin if available
# Whitespace is used as delimiter for read.
# The plugin doesn't support filenames with leading or trailing whitespace
# To use NNN_LIST your shell must support readlink(1)
#
# Capabilities:
# 1. Basic file rename
# 2. Detects order change
# 3. Can move files
# 4. Can remove files
# 5. Switch number pairs to swap filenames
#
# Shell: bash
# Author: KlzXS
# shellcheck disable=SC1090,SC1091
. "$(dirname "$0")"/.nnn-plugin-helper
EDITOR="${EDITOR:-vi}"
TMPDIR="${TMPDIR:-/tmp}"
NNN_INCLUDE_HIDDEN="${NNN_INCLUDE_HIDDEN:-0}"
VERBOSE="${VERBOSE:-0}"
RECURSIVE="${RECURSIVE:-0}"
case "$NNN_TRASH" in
1)
RM_UTIL="trash-put" ;;
2)
RM_UTIL="gio trash" ;;
*)
RM_UTIL="rm -ri --" ;;
esac
exit_status=0
if nnn_use_selection "Rename"; then
# shellcheck disable=SC2154
arr=$(tr '\0' '\n' < "$selection")
else
findcmd="find . ! -name ."
if [ "$RECURSIVE" -eq 0 ]; then
findcmd="$findcmd -prune"
fi
if [ "$NNN_INCLUDE_HIDDEN" -eq 0 ]; then
findcmd="$findcmd ! -name \".*\""
fi
if [ -z "$NNN_LIST" ]; then
findcmd="$findcmd -print"
else
findcmd="$findcmd -printf "'"'"$NNN_LIST/%P\n"'"'
fi
arr=$(eval "$findcmd" | sort)
fi
lines=$(printf "%s\n" "$arr" | wc -l)
width=${#lines}
dst_file=$(mktemp "$TMPDIR/.nnnXXXXXX")
trap 'rm -f -- "$dst_file"' EXIT
printf "%s" "$arr" | awk '{printf("%'"${width}"'d %s\n", NR, $0)}' > "$dst_file"
items=("~")
while IFS='' read -r line; do
if [ -n "$NNN_LIST" ]; then
line=$(readlink "$line" || printf "%s" "$line")
fi
items+=("$line");
done < <(printf "%s\n" "$arr")
$EDITOR "$dst_file"
while read -r num name; do
if [ -z "$name" ]; then
if [ -z "$num" ]; then
continue
fi
printf "%s: unable to parse line, aborting\n" "$0"
exit 1
fi
# check if $num is an integer
if [ ! "$num" -eq "$num" ] 2> /dev/null; then
printf "%s: unable to parse line, aborting\n" "$0"
exit 1
fi
src=${items[$num]}
if [ -z "$src" ]; then
printf "%s: unknown item number %s\n" "$0" "$num" > /dev/stderr
continue
elif [ "$name" != "$src" ]; then
if [ -z "$name" ]; then
continue
fi
if [ ! -e "$src" ] && [ ! -L "$src" ]; then
printf "%s: %s does not exit\n" "$0" "$src" > /dev/stderr
unset "items[$num]"
continue
fi
# handle swaps
if [ -e "$name" ] || [ -L "$name" ]; then
tmp="$name~"
c=0
while [ -e "$tmp" ] || [ -L "$tmp" ]; do
c=$((c+1))
tmp="$tmp~$c"
done
if mv -- "$name" "$tmp"; then
if [ "$VERBOSE" -ne 0 ]; then
printf "'%s' -> '%s'\n" "$name" "$tmp"
fi
else
printf "%s: failed to rename %s to %s: %s\n" "$0" "$name" "$tmp" "$!" > /dev/stderr
exit_status=1
fi
for key in "${!items[@]}"; do
if [ "${items[$key]}" = "$name" ]; then
items[$key]="$tmp"
fi
done
fi
dir=$(dirname "$name")
if [ ! -d "$dir" ] && ! mkdir -p "$dir"; then
printf "%s: failed to create directory tree %s\n" "$0" "$dir" > /dev/stderr
exit_status=1
elif ! mv -i -- "$src" "$name"; then
printf "%s: failed to rename %s to %s: %s\n" "$0" "$name" "$tmp" "$!" > /dev/stderr
exit_status=1
else
if [ -d "$name" ]; then
for key in "${!items[@]}"; do
items[$key]=$(printf "%s" "${items[$key]}" | sed "s|^$src\(\$\|\/\)|$name\1|")
done
if [ "$VERBOSE" -ne 0 ]; then
printf "'%s' => '%s'\n" "$src" "$name"
fi
else
true
if [ "$VERBOSE" -ne 0 ]; then
printf "'%s' -> '%s'\n" "$src" "$name"
fi
fi
fi
fi
unset "items[$num]"
done <"$dst_file"
unset "items[0]"
for item in "${items[@]}"; do
$RM_UTIL "$item"
done
exit $exit_status

View File

@ -0,0 +1,61 @@
#!/usr/bin/env sh
# Description: Helper script for plugins
#
# Shell: POSIX compliant
# Author: Anna Arad
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
export selection
## Set CUR_CTX to 1 to open directory in current context
CUR_CTX=0
export CUR_CTX
NNN_PREFER_SELECTION="${NNN_PREFER_SELECTION:-0}"
export NNN_PREFER_SELECTION
## Ask nnn to switch to directory $1 in context $2.
## If $2 is not provided, the function asks explicitly.
nnn_cd () {
dir="$1"
if [ -z "$NNN_PIPE" ]; then
echo "No pipe file found" 1>&2
return
fi
if [ -n "$2" ]; then
context=$2
elif [ $CUR_CTX -ne 1 ]; then
printf "Choose context 1-4 (blank for current): "
read -r context
fi
printf "%s" "${context:-0}c$dir" > "$NNN_PIPE"
}
cmd_exists () {
type "$1" > /dev/null 2>&1
echo $?
}
nnn_use_selection() {
if ! [ -s "$selection" ]; then
return 1
fi
if [ "$NNN_PREFER_SELECTION" -eq 1 ]; then
return 0
else
[ -n "$1" ] && printf "%s " "$1"
printf "(s)election/(c)urrent? [default=c] "
read -r resp__
if [ "$resp__" = "s" ]; then
return 0
else
return 1
fi
fi
}

22
plugins/.ntfy Executable file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env sh
# Description: Show a notification
#
# Details: nnn invokes this plugin to show notification when a cp/mv/rm operation is complete.
#
# Dependencies: notify-send (Ubuntu)/ntfy (https://github.com/dschep/ntfy)/osascript (macOS)/notify (Haiku)
#
# Shell: POSIX compliant
# Author: Anna Arad
OS="$(uname)"
if type notify-send >/dev/null 2>&1; then
notify-send nnn "Done!"
elif [ "$OS" = "Darwin" ]; then
osascript -e 'display notification "Done!" with title "nnn"'
elif type ntfy >/dev/null 2>&1; then
ntfy -t nnn send "Done!"
elif [ "$OS" = "Haiku" ]; then
notify --title "nnn" "Done!"
fi

383
plugins/README.md Normal file
View File

@ -0,0 +1,383 @@
<h1 align="center">nnn plugins</h1>
<p align="center"><img src="https://i.imgur.com/SpT0L2W.png" /></p>
<p align="center"><i>read ebooks with plugin gutenread (Android)</i></p>
## Introduction
Plugins extend the capabilities of `nnn`. They are _executable_ scripts (or binaries) `nnn` can communicate with and trigger. This mechanism fits perfectly with the fundamental design to keep the core file manager lean and fast, by delegating repetitive (but not necessarily file manager-specific) tasks to the plugins which can be run with custom hotkeys.
`nnn` is _**language-agnostic**_ when it comes to plugins. You can write a plugin in any (scripting) language you are comfortable in!
## List of plugins
| Plugin (a-z) | Description [Clears selection<sup>1</sup>] | Lang | Dependencies |
| --- | --- | --- | --- |
| [autojump](autojump) | Navigate to dir/path | sh | [jump](https://github.com/gsamokovarov/jump)/autojump/<br>zoxide/z/[z.lua](https://github.com/skywind3000/z.lua) |
| [boom](boom) | Play random music from dir | sh | [moc](http://moc.daper.net/) |
| [bulknew](bulknew) | Create multiple files/dirs at once | bash | sed, xargs, mktemp |
| [cbcopy-mac](cbcopy-mac) | Copy the hovered file to MacOS clipboard | applescript | macos |
| [cbpaste-mac](cbpaste-mac) | Pastes files from MacOS clipboard into currect directory | macos |
| [cdpath](cdpath) | `cd` to the directory from `CDPATH` | sh | fzf |
| [chksum](chksum) | Create and verify checksums [✓] | sh | md5sum,<br>sha256sum |
| [cmusq](cmusq) | Queue/play files/dirs in cmus player [✓] | sh | cmus, pgrep |
| [diffs](diffs) | Diff for selection (limited to 2 for directories) [✓] | sh | vimdiff, mktemp |
| [dragdrop](dragdrop) | Drag/drop files from/into nnn | sh | [dragon](https://github.com/mwh/dragon) |
| [dups](dups) | List non-empty duplicate files in current dir | bash | find, md5sum,<br>sort uniq xargs |
| [finder](finder) | Run custom find command (**stored in histfile**) and list | sh | - |
| [fixname](fixname) | Clean filename to be more shell-friendly [✓] | bash | sed |
| [fzcd](fzcd) | Fuzzy search multiple dirs (or `$PWD`) and visit file | sh | fzf, (find) |
| [fzhist](fzhist) | Fuzzy-select a cmd from history, edit in `$EDITOR` and run | sh | fzf, mktemp |
| [fzopen](fzopen) | Fuzzy find file(s) in subtree to edit/open/pick | sh | fzf, xdg-open/open |
| [fzplug](fzplug) | Fuzzy find, preview and run other plugins | sh | fzf |
| [getplugs](getplugs) | Update plugins to installed `nnn` version | sh | curl |
| [gitroot](gitroot) | Cd to the root of current git repo | sh | git |
| [gpge](gpge) | Encrypt/decrypt files using GPG [✓] | sh | gpg |
| [gutenread](gutenread) | Browse, download, read from Project Gutenberg | sh | curl, unzip, w3m<br>[epr](https://github.com/wustho/epr) (optional) |
| [gsconnect](gsconnect) | GNOME's implementation of kdeconnect [✓] | sh | gsconnect |
| [imgresize](imgresize) | Batch resize images in dir to screen resolution | sh | [imgp](https://github.com/jarun/imgp) |
| [imgur](imgur) | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) | bash | - |
| [imgview](imgview) | View (thumbnail)images, set wallpaper, [rename](https://github.com/jarun/nnn/wiki/Basic-use-cases#browse-rename-images) and [more](https://wiki.archlinux.org/index.php/Sxiv#Assigning_keyboard_shortcuts)| sh | _see in-file docs_ |
| [ipinfo](ipinfo) | Fetch external IP address and whois information | sh | curl, whois |
| [kdeconnect](kdeconnect) | Send selected files to an Android device [✓] | sh | kdeconnect-cli |
| [launch](launch) | GUI application launcher | sh | fzf |
| [mimelist](mimelist) | List files by mime in subtree | sh | file/mimetype |
| [moclyrics](moclyrics) | Show lyrics of the track playing in moc | sh | [ddgr](https://github.com/jarun/ddgr), [moc](http://moc.daper.net/) |
| [mocq](mocq) | Queue/play selection/dir/file in moc [✓] | sh | [moc](http://moc.daper.net/) |
| [mp3conv](mp3conv) | Extract audio from multimedia as mp3 | sh | ffmpeg |
| [mtpmount](mtpmount) | Toggle mount of MTP device (eg. Android) | sh | gvfs-mtp |
| [nbak](nbak) | Backs up `nnn` config | sh | tar, awk, mktemp |
| [nmount](nmount) | Toggle mount status of a device as normal user | sh | pmount (optional), udisks2 |
| [nuke](nuke) | Sample file opener (CLI-only by default) | sh | _see in-file docs_ |
| [oldbigfile](oldbigfile) | List large files by access time | sh | find, sort |
| [openall](openall) | Open selected files together or one by one [✓] | bash | - |
| [organize](organize) | Auto-organize files in directories by file type [✓] | sh | file |
| [pdfread](pdfread) | Read a PDF or text file aloud | sh | pdftotext, mpv,<br>pico2wave |
| [preview-tabbed](preview-tabbed) | Preview files with Tabbed/xembed | bash | _see in-file docs_ |
| [preview-tui](preview-tui) | Preview with Tmux/kitty/[QuickLook](https://github.com/QL-Win/QuickLook)/xterm/`$TERMINAL` | sh | _see in-file docs_ |
| [pskill](pskill) | Fuzzy list by name and kill process or zombie | sh | fzf, ps, sudo/doas |
| [renamer](renamer) | Batch rename selection or files in dir [✓] | sh | [qmv](https://www.nongnu.org/renameutils/)/[vidir](https://joeyh.name/code/moreutils/) |
| [ringtone](ringtone) | Create a variable bitrate mp3 ringtone from file | sh | date, ffmpeg |
| [rsynccp](rsynccp) | Gives copy-paste verbose progress percentage [✓] | sh | rsync |
| [splitjoin](splitjoin) | Split file or join selection [✓] | sh | split, cat |
| [suedit](suedit) | Edit file using superuser permissions | sh | sudoedit/sudo/doas |
| [togglex](togglex) | Toggle executable mode for selection [✓] | sh | chmod |
| [umounttree](umounttree) | Unmount a remote mountpoint from within | sh | fusermount |
| [upload](upload) | Upload to Firefox Send or ix.io (text) or file.io (bin) | sh | [ffsend](https://github.com/timvisee/ffsend), curl, jq, tr |
| [wallpaper](wallpaper) | Set wallpaper or change colorscheme | sh | nitrogen/pywal |
| [x2sel](x2sel) | Copy file list from system clipboard to selection | sh | _see in-file docs_ |
| [xdgdefault](xdgdefault) | Set the default app for the hovered file type | sh | xdg-utils, fzf/dmenu |
Notes:
1. A plugin has to explicitly request `nnn` to clear the selection e.g. after operating on the selected files.
2. Files starting with a dot in the `plugins` directory are internal files and should not be used as plugins.
### Table of contents
- [Installation](#installation)
- [Configuration](#configuration)
- [Skip directory refresh after running a plugin](#skip-directory-refresh-after-running-a-plugin--)
- [Running commands as plugin](#running-commands-as-plugin-)
- [Skip user confirmation after command execution](#skip-user-confirmation-after-command-execution-)
- [Run a GUI app as plugin](#run-a-gui-app-as-plugin-)
- [Page non-interactive command output](#page-non-interactive-command-output-)
- [Some useful key-command examples](#some-useful-key-command-examples)
- [Access level of plugins](#access-level-of-plugins)
- [Create your own plugins](#create-your-own-plugins)
- [Send data to `nnn`](#send-data-to-nnn)
- [Get notified on file hover](#get-notified-on-file-hover)
- [Examples](#examples)
- [Contributing plugins](#contributing-plugins)
## Installation
The following command installs or updates (after backup) all plugins:
```sh
sh -c "$(curl -Ls https://raw.githubusercontent.com/jarun/nnn/master/plugins/getplugs)"
```
Plugins are installed to `${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins`.
## Configuration
Set environment variable `NNN_PLUG` to assign keybinds and invoke plugins directly using the plugin shortcut (<kbd>;</kbd>) followed by the assigned key character. E.g., with the below config:
```sh
export NNN_PLUG='f:finder;o:fzopen;p:mocq;d:diffs;t:nmount;v:imgview'
```
plugin `finder` can be invoked with the keybind <kbd>;f</kbd>, `fzopen` can be run with <kbd>;o</kbd> and so on... The key vs. plugin pairs are shown in the help and config screen.
Alternatively, combine with <kbd>Alt</kbd> (i.e. <kbd>Alt+key</kbd>).
To pick and run an unassigned plugin, press <kbd>Enter</kbd> (to _enter_ the plugin dir) at the plugin prompt.
To run a plugin at startup, use the option `-P` followed by the plugin key.
If the plugins list gets too long, try breaking them up into sections:
```
NNN_PLUG_PERSONAL='g:personal/convert2zoom;p:personal/echo'
NNN_PLUG_WORK='j:work/prettyjson;d:work/foobar'
NNN_PLUG_INLINE='e:!go run "$nnn"*'
NNN_PLUG_DEFAULT='1:ipinfo;p:preview-tui;o:fzz;b:nbak'
NNN_PLUG="$NNN_PLUG_PERSONAL;$NNN_PLUG_WORK;$NNN_PLUG_DEFAULT;$NNN_PLUG_INLINE"
export NNN_PLUG
```
Note:
- `'g:personal/convert2zoom'` will look in the personal sub-folder inside the plugin folder.
- `'b:boom;b:bulknew` will result in only the first definition of *b* (`b:boom`) being used.
- A keybinding definition of more than 1 character will prevent nnn from starting.
#### Skip directory refresh after running a plugin [`-`]
`nnn` refreshes the directory after running a plugin to reflect any changes by the plugin. To disable this add a `-` before the plugin name:
```sh
export NNN_PLUG='p:-plugin'
```
## Running commands as plugin [`!`]
To assign keys to arbitrary non-background cli commands and invoke like plugins, add `!` before the command.
```sh
export NNN_PLUG='x:!chmod +x "$nnn";g:!git log;s:!smplayer "$nnn"'
```
Now <kbd>;x</kbd> can be used to make a file executable, <kbd>;g</kbd> can be used to the git log of a git project directory, <kbd>;s</kbd> can be used to preview a partially downloaded media file.
#### Skip user confirmation after command execution [`*`]
`nnn` waits for user confirmation (the prompt `Press Enter to continue`) after it executes a command as plugin (unlike plugins which can add a `read` to wait). To skip this, add a `*` after the command.
```sh
export NNN_PLUG='s:!smplayer "$nnn"*;n:-!vim /home/vaio/Dropbox/Public/synced_note*'
```
Now there will be no prompt after <kbd>;s</kbd> and <kbd>;n</kbd>.
Note: Do not use `*` with programs that run and exit e.g. cat.
#### Run a GUI app as plugin [`&`]
To run a GUI app as plugin, add a `&` after `!`.
```sh
export NNN_PLUG='m:-!&mousepad "$nnn"'
```
#### Page non-interactive command output [`|`]
To show the output of run-and-exit commands which do not need user input, add `|` (pipe) after `!`.
```sh
export NNN_PLUG='m:-!|mediainfo "$nnn";t:-!|tree -ps;l:-!|ls -lah --group-directories-first'
```
This option is incompatible with `&` (terminal output is masked for GUI programs) and ignores `*` (output is already paged for user).
Notes:
1. Place `$nnn` (or exported variables) in double quotes (**`"$nnn"`**)
2. Use single quotes for `$NNN_PLUG` so `"$nnn"` is not interpreted
3. (_Again_) add `!` before the command
4. To disable directory refresh after running a _command as plugin_, prefix with `-!`
#### Some useful key-command examples
| Key:Command | Description |
|---|---|
| `c:!convert "$nnn" png:- \| xclip -sel clipboard -t image/png*` | Copy image to clipboard |
| `C:!cp -rv "$nnn" "$nnn".cp` | Create a copy of the hovered file |
| `e:-!sudo -E vim "$nnn"*` | Edit file as root in vim |
| `g:-!git diff` | Show git diff |
| `h:-!hx "$nnn"*` | Open hovered file in [hx](https://github.com/krpors/hx) hex editor |
| `k:-!fuser -kiv "$nnn"*` | Interactively kill process(es) using hovered file |
| `l:-!git log` | Show git log |
| `n:-!vi /home/user/Dropbox/dir/note*` | Take quick notes in a synced file/dir of notes |
| `p:-!less -iR "$nnn"*` | Page through hovered file in less |
| `s:-!&smplayer -minigui "$nnn"` | Play hovered media file, even unfinished download |
| `x:!chmod +x "$nnn"` | Make the hovered file executable |
| `y:-!sync*` | Flush cached writes |
## Access level of plugins
When `nnn` executes a plugin, it does the following:
- Changes to the directory where the plugin is to be run (`$PWD` pointing to the active directory)
- Passes three arguments to the script:
1. `$1`: The hovered file's name.
2. `$2`: The working directory (might differ from `$PWD` in case of symlinked paths; non-canonical).
3. `$3`: The picker mode output file (`-` for stdout) if `nnn` is executed as a file picker.
- Sets the environment variable `NNN_PIPE` used to control `nnn` active directory.
- Sets the environment variable `NNN_INCLUDE_HIDDEN` to `1` if hidden files are active, `0` otherwise.
- Sets the environment variable `NNN_PREFER_SELECTION` to `1` if user prefers to use selection (see nnn's `-u` flag), `0` otherwise.
- Exports the [special variables](https://github.com/jarun/nnn/wiki/Concepts#special-variables).
Plugins can also read the `.selection` file in the config directory.
## Create your own plugins
Plugins can be written in any scripting language. However, POSIX-compliant shell scripts runnable in `sh` are preferred.
**Make the file executable**. Drop it in the plugin directory. Optionally add a hotkey in `$NNN_PLUG` for frequent usage.
#### Send data to `nnn`
`nnn` provides a mechanism for plugins to send data to `nnn` to control its active directory or invoke the list mode.
The way to do so is by writing to the pipe pointed by the environment variable `NNN_PIPE`.
The plugin should write a single string in the format `(<->)<ctxcode><opcode><data>` without a newline at the end. For example, `1c/etc`.
The optional `-` at the **beginning of the stream** instructs `nnn` to clear the selection.
In cases where the data transfer to `nnn` has to happen while the selection file is being read (e.g. in a loop), the plugin should
create a tmp copy of the selection file, inform `nnn` to clear the selection and then do the subsequent processing with the tmp file.
A paged [`|`] or GUI [`&`] cmd run as plugin cannot clear selection.
The `ctxcode` indicates the context to change the active directory of.
| Context code | Meaning |
|:---:| --- |
| `+` | smart context (next inactive else current) |
| `0` | current context |
| `1`-`4` | context number |
The `opcode` indicates the operation type.
| Opcode | Operation |
|:---:| --- |
| `c` | change directory |
| `l` | list files in list mode |
| `p` | picker file overwritten |
For convenience, we provided a helper script named `.nnn-plugin-helper` and a function named `nnn_cd` to ease this process. `nnn_cd` receives the path to change to as the first argument, and the context as an optional second argument.
If a context is not provided, it is asked for explicitly. To skip this and choose the current context, set the `CUR_CTX` variable in `.nnn-plugin-helper` (or in the specific plugin after sourcing `.nnn-plugin-helper`) to 1.
Usage examples can be found in the Examples section below.
#### Get notified on file hover
If `NNN_FIFO` is set, `nnn` will open it and write every hovered files. This can be used in plugins and external scripts, e.g. to implement file previews.
Don't forget to fork in the background to avoid blocking `nnn`.
For more details on configuration and usage of the preview plugins, visit [Live Previews](https://github.com/jarun/nnn/wiki/Live-previews).
## Examples
There are many plugins provided by `nnn` which can be used as examples. Here are a few simple selected examples.
#### Show the git log of changes to the particular file along with the code for a quick and easy review.
```sh
#!/usr/bin/env sh
git log -p -- "$1"
```
#### Change to directory in clipboard using helper script
```sh
#!/usr/bin/env sh
. $(dirname $0)/.nnn-plugin-helper
nnn_cd "$(xsel -ob)"
```
#### Change directory to the location of a link using helper script with specific context (current)
```sh
#!/usr/bin/env sh
. $(dirname $0)/.nnn-plugin-helper
nnn_cd "$(dirname $(readlink -fn $1))" 0
```
#### Change to arbitrary directory without helper script
```sh
#!/usr/bin/env sh
printf "cd to: "
read -r dir
printf "%s" "0c$dir" > "$NNN_PIPE"
```
#### Send every hovered file to X selection
```sh
#!/usr/bin/env sh
if [ -z "$NNN_FIFO" ] ; then
exit 1
fi
while read FILE ; do
printf "%s" "$FILE" | xsel
done < "$NNN_FIFO" &
disown
```
#### Quick `find` the first match in subtree and open in `nuke`
```sh
#!/usr/bin/env sh
NUKE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
printf "file name: "
read -r pattern
entry=$(find . -type f -iname "$pattern" -print -quit 2>/dev/null)
if [ -n "$entry" ]; then
"$NUKE" "$entry"
fi
```
#### Quick find (using `fd`)
```sh
#!/usr/bin/env sh
. "$(dirname "$0")"/.nnn-plugin-helper
printf "pattern: "
read -r pattern
if [ -n "$pattern" ]; then
printf "%s" "+l" > "$NNN_PIPE"
eval "fd -HI $pattern -0" > "$NNN_PIPE"
fi
```
#### Quick grep (using `rg`)
```sh
#!/usr/bin/env sh
. "$(dirname "$0")"/.nnn-plugin-helper
printf "pattern: "
read -r pattern
if [ -n "$pattern" ]; then
printf "%s" "+l" > "$NNN_PIPE"
eval "rg -l0 --hidden -S $pattern" > "$NNN_PIPE"
fi
```
#### Change directory
NNN_PLUG='c:!read -r to && [ -n "$to" ] && printf "0c%s" "${to}" > "$NNN_PIPE"*'
## Contributing plugins
1. Add informative sections like _Description_, _Notes_, _Dependencies_, _Shell_, _Author_ etc. in the plugin.
2. Add an entry in the table above. Note that the list is alphabetically ordered by plugin name.
3. Keep non-portable commands (like `notify-send`) commented so users from any other OS/DE aren't surprised.
4. The plugin file should be executable.
5. If your plugin stores data, use `${XDG_CACHE_HOME:-$HOME/.cache}/nnn`. Document it _in-file_.

74
plugins/autojump Executable file
View File

@ -0,0 +1,74 @@
#!/usr/bin/env sh
# Description: Navigate to directory using jump/autojump/zoxide/z
#
# Dependencies:
# - jump - https://github.com/gsamokovarov/jump
# - OR autojump - https://github.com/wting/autojump
# - OR zoxide - https://github.com/ajeetdsouza/zoxide
# - OR z - https://github.com/rupa/z (z requires fzf)
# - OR z (fish) - https://github.com/jethrokuan/z (z requires fzf)
# - OR z.lua - https://github.com/skywind3000/z.lua (z.lua can enhanced with fzf)
#
# Note: The dependencies STORE NAVIGATION PATTERNS
#
# to make z.lua work, you need to set $NNN_ZLUA to the path of script z.lua
#
# Shell: POSIX compliant
# Authors: Marty Buchaus, Dave Snider, Tim Adler, Nick Waywood
if [ ! -p "$NNN_PIPE" ]; then
printf 'ERROR: NNN_PIPE is not set!'
read -r _
exit 2
fi
if type jump >/dev/null 2>&1; then
printf "jump to : "
IFS= read -r line
# shellcheck disable=SC2086
odir="$(jump cd ${line})"
printf "%s" "0c$odir" > "$NNN_PIPE"
elif type autojump >/dev/null 2>&1; then
printf "jump to : "
read -r dir
odir="$(autojump "$dir")"
printf "%s" "0c$odir" > "$NNN_PIPE"
elif type zoxide >/dev/null 2>&1; then
if type fzf >/dev/null 2>&1; then
odir="$(zoxide query -i --)"
printf "%s" "0c$odir" > "$NNN_PIPE"
else
printf "jump to : "
read -r dir
odir="$(zoxide query -- "$dir")"
printf "%s" "0c$odir" > "$NNN_PIPE"
fi
elif type lua >/dev/null 2>&1 && [ -n "$NNN_ZLUA" ]; then
printf "jump to : "
read -r line
if type fzf >/dev/null 2>&1; then
odir="$(lua "$NNN_ZLUA" -l "$line" | fzf --nth 2.. --reverse --inline-info --tac +s -e --height 35%)"
printf "%s" "0c$(echo "$odir" | awk '{print $2}')" > "$NNN_PIPE"
else
odir="$(lua "$NNN_ZLUA" -e "$line")"
printf "%s" "0c$odir" > "$NNN_PIPE"
fi
else
# rupa/z uses $_Z_DATA, jethrokuan/z (=port of z for fish) uses $Z_DATA
datafile="${_Z_DATA:-${Z_DATA:-$HOME/.z}}"
if type fzf >/dev/null 2>&1 && [ -f "$datafile" ]; then
# Read the data from z's file instead of calling
# z so the data doesn't need to be processed twice
sel=$(awk -F "|" '{print $1}' "$datafile" | fzf | awk '{$1=$1};1')
# NOTE: Uncomment this line and comment out the line above if
# you want to see the weightings of the dir's in the fzf pane
# sel=$(awk -F "|" '{printf "%s %s\n", $2, $1}' "$datafile" | fzf | sed 's/^[0-9,.]* *//' | awk '{$1=$1};1')
printf "%s" "0c$sel" > "$NNN_PIPE"
else
printf "No supported autojump script [jump/autojump/zoxide/z (needs fzf)] found"
read -r _
fi
fi

50
plugins/boom Executable file
View File

@ -0,0 +1,50 @@
#!/usr/bin/env sh
# Description: Play random music (MP3, FLAC, M4A, WEBM, WMA) from current dir.
#
# Dependencies: mocp (or custom)
#
# Note: You may want to set GUIPLAYER.
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
GUIPLAYER="${GUIPLAYER:-""}"
NUMTRACKS="${NUMTRACKS:-100}"
if [ -n "$GUIPLAYER" ]; then
find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.webm" -o -iname "*.wma" \) | shuf -n "$NUMTRACKS" | xargs -d "\n" "$GUIPLAYER" > /dev/null 2>&1 &
# detach the player
sleep 1
elif type mocp >/dev/null 2>&1; then
cmd=$(pgrep -x mocp 2>/dev/null)
ret=$cmd
if [ -z "$ret" ]; then
# start MOC server
mocp -S
mocp -o shuffle
else
# mocp running, check if it's playing
state=$(mocp -i | grep "State:" | cut -d' ' -f2)
if [ "$state" = 'PLAY' ]; then
# add up to 100 random audio files
find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.webm" -o -iname "*.wma" \) | head -n "$NUMTRACKS" | xargs -d "\n" mocp -a
exit
fi
fi
# clear MOC playlist
mocp -c
mocp -o shuffle
# add up to 100 random audio files
find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.webm" -o -iname "*.wma" \) | head -n "$NUMTRACKS" | xargs -d "\n" mocp -a
# start playing
mocp -p
else
printf "moc missing"
read -r _
fi

32
plugins/bulknew Executable file
View File

@ -0,0 +1,32 @@
#!/usr/bin/env sh
# Description: Allows for creation of multiple files/dirs simultaneously
# Creates a tmp file to write each entry in a separate line
#
# Note: Only relative paths are supported. Absolute paths are ignored
# Leading and trailing whitespace in path names is also ignored
#
# Shell: POSIX compliant
# Author: KlzXS
EDITOR="${EDITOR:-vi}"
TMPDIR="${TMPDIR:-/tmp}"
printf "'f'ile / 'd'ir? "
read -r resp
if [ "$resp" = "f" ]; then
#shellcheck disable=SC2016
cmd='mkdir -p "$(dirname "{}")" && touch "{}"'
elif [ "$resp" = "d" ]; then
cmd='mkdir -p {}'
else
exit 1
fi
tmpfile=$(mktemp "$TMPDIR/.nnnXXXXXX")
$EDITOR "$tmpfile"
sed "/^\//d" "$tmpfile" | xargs -n1 -I{} sh -c "$cmd"
rm -- "$tmpfile"

16
plugins/cbcopy-mac Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/osascript
# Description: Copy the hovered file to MacOS clipboard.
#
# Note: Supports only MacOS
#
# Shell: POSIX compliant
# Author: Syed Umar Anis
on run args
set filePath to (second item of args & "/" & first item of args)
tell application "Finder"
set the clipboard to (filePath as POSIX file)
end tell
end

24
plugins/cbpaste-mac Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env sh
# shellcheck disable=all
# Description: Paste the clipboard files into the current directory.
# Only works if clipboard contents are files.
#
# Note: Supports only MacOS
#
# Shell: POSIX compliant
# Author: Syed Umar Anis
fs=($( osascript -e "use framework \"Foundation\"
property this : a reference to the current application
property NSPasteboard : a reference to NSPasteboard of this
property NSURL : a reference to NSURL of this
property pb : a reference to NSPasteboard's generalPasteboard
property text item delimiters : linefeed
pb's readObjectsForClasses:[NSURL] options:[]
(result's valueForKey:\"path\") as list as text" ))
cp -R -- "${fs[@]}" "$2/"

56
plugins/cdpath Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env sh
# Description: 'cd' to the directory from CDPATH
#
# Details: If the CDPATH environment variable is not set, the default value of
# ${XDG_CONFIG_HOME:-$HOME/.config}/nnn/bookmarks will be used.
# You can create this directory and fill it with symbolic links to your
# favorite directories. It's a good idea to add it to CDPATH so that it
# could also be used from the command line outside of nnn.
# The fzf search is done on the directory basename (the first column).
#
# This plugin is an extended version of the bookmarks plugin.
# If you set your CDPATH to ${XDG_CACHE_HOME:-$HOME/.cache}/nnn/bookmarks
# or to the value of BOOKMARKS_DIR, you can use it as a bookmarks replacement.
#
# Shell: POSIX compliant
# Author: Yuri Kloubakov
# shellcheck disable=SC1090,SC1091
. "$(dirname "$0")"/.nnn-plugin-helper
# Get a list of (symbolic links to) directories for every element of CDPATH
get_dirs() {
IFS=':'
for path in $CDPATH; do
for entry in "$path"/*; do
if [ -d "$entry" ]; then
name=$(basename "$entry" | grep -o '^.\{1,24\}')
if [ -h "$entry" ]; then
slink=$(ls -dl -- "$entry")
entry=${slink#*" $entry -> "}
fi
printf "%-24s :%s\n" "${name}" "$entry"
fi
done
done
}
abort() {
echo "$1"
read -r _
exit 1
}
if [ -z "$CDPATH" ]; then
CDPATH="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/bookmarks"
[ -d "$CDPATH" ] || abort "CDPATH is not set and there is no \"$CDPATH\" directory"
fi
dir_list=$(get_dirs)
[ -n "$dir_list" ] || abort "There are no directories to choose from. Check your \"$CDPATH\"."
dir=$(echo "$dir_list" | fzf --nth=1 --delimiter=':' | awk -F: 'END { print $2 }')
if [ -n "$dir" ]; then
nnn_cd "$dir" 0
fi

75
plugins/chksum Executable file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env sh
# Description: Create and verify checksums
#
# Note: On macOS, install the relevant checksum packages from Homebrew with:
# brew install coreutils
#
# Details:
# - selection: it will generate one file with the checksums and filenames
# (and with paths if they are in another directory)
# output checksum filename format: checksum_timestamp.checksum_type
# - file: if the file is a checksum, the plugin does the verification
# if the file is not a checksum, checksum will be generated for it
# the output checksum filename will be filename.checksum_type
# - directory: recursively calculates checksum for all the files in the dir
# the output checksum filename will be directory.checksum_type
#
# Shell: POSIX compliant
# Authors: ath3, Arun Prakash Jana
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
resp=f
chsum=md5
checksum_type()
{
echo "possible checksums: md5, sha1, sha224, sha256, sha384, sha512"
printf "create md5 (m), sha256 (s), sha512 (S) (or type one of the above checksums) [default=m]: "
read -r chsum_resp
for chks in md5 sha1 sha224 sha256 sha384 sha512
do
if [ "$chsum_resp" = "$chks" ]; then
chsum=$chsum_resp
return
fi
done
if [ "$chsum_resp" = "s" ]; then
chsum=sha256
elif [ "$chsum_resp" = "S" ]; then
chsum=sha512
fi
}
if [ -s "$selection" ]; then
printf "work with selection (s) or current file (f) [default=f]: "
read -r resp
fi
if [ "$resp" = "s" ]; then
checksum_type
sed 's|'"$PWD/"'||g' < "$selection" | xargs -0 -I{} ${chsum}sum {} > "checksum_$(date '+%Y%m%d%H%M').$chsum"
# Clear selection
if [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi
elif [ -n "$1" ]; then
if [ -f "$1" ]; then
for chks in md5 sha1 sha224 sha256 sha384 sha512
do
if echo "$1" | grep -q \.${chks}$; then
${chks}sum -c < "$1"
read -r _
exit
fi
done
checksum_type
file=$(basename "$1").$chsum
${chsum}sum "$1" > "$file"
elif [ -d "$1" ]; then
checksum_type
file=$(basename "$1").$chsum
find "$1" -type f -exec ${chsum}sum "{}" + > "$file"
fi
fi

80
plugins/cmusq Executable file
View File

@ -0,0 +1,80 @@
#!/usr/bin/env sh
# Description: Add selection or hovered file/directory to cmus queue
#
# Dependencies: cmus, pgrep, xdotool (optional)
#
# Notes:
# 1. If adding selection, files/dirs are added in the same order they were selected in nnn
# 2. A new window will be opened if cmus is not running already, playback will start immediately
# 3. If cmus is already running, files will be appended to the queue with no forced playback
#
# TODO:
# 1. Add cava and cmus-lyrics as optional dependencies
# 2. Start cava and/or cmus-lyrics in tmux or kitty panes next to cmus
#
# Shell: POSIX compliant
# Author: Kabouik
# (Optional) Set preferred terminal emulator for cmus if not set in your env,
# or leave commented out to use OS default
#TERMINAL="kitty"
if ! type cmus >/dev/null; then
printf "cmus missing"
read -r _
exit 1
fi
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
start_cmus() {
type xdotool >/dev/null && nnnwindow="$(xdotool getactivewindow)"
case "$TERMINAL" in
kitty | gnome-terminal | st)
nohup "$TERMINAL" -- cmus & ;;
havoc)
nohup "$TERMINAL" cmus & ;;
"")
nohup x-terminal-emulator -e cmus & ;;
*)
nohup "$TERMINAL" -e cmus & ;;
esac
# Give the new terminal some time to open
until cmus-remote -C; do sleep 0.1; done
[ -n "$nnnwindow" ] && xdotool windowactivate "$nnnwindow"
} >/dev/null 2>&1
fill_queue() {
if [ "$REPLY" = "s" ]; then
xargs < "$selection" -0 cmus-remote -q
elif [ -n "$1" ]; then
cmus-remote -q "$1"
fi
}
# If active selection,then ask what to do
if [ -s "$selection" ]; then
printf "Queue [s]election or [c]urrently hovered? [default=c]: "
read -r REPLY
fi
# If cmus is not running, start and play queue
if ! pgrep cmus >/dev/null; then
printf "cmus is not running, starting it in a new %s window.\n" "$TERMINAL"
start_cmus
fill_queue "$1"
cmus-remote -p
printf "Files added to cmus queue.\n"
else # Append to existing queue if cmus is already running
fill_queue "$1"
printf "Files appended to current cmus queue.\n"
fi
# Change view
cmus-remote -C "view 4"
# Clear selection
if [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi

62
plugins/diffs Executable file
View File

@ -0,0 +1,62 @@
#!/usr/bin/env sh
# Description: Show diff of 2 directories or multiple files in vimdiff
#
# Notes:
# 1. vim may show the warning: 'Vim: Warning: Input is not from a terminal'
# press 'Enter' to ignore and proceed.
# 2. if only one file is in selection, the hovered file is considered as the
# second file to diff with
#
# Shell: POSIX compliant
# Authors: Arun Prakash Jana, ath3
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
if type nvim >/dev/null 2>&1; then
diffcmd="nvim -d"
else
diffcmd="vimdiff +0"
fi
dirdiff() {
dir1=$(mktemp "${TMPDIR:-/tmp}"/nnn-"$(basename "$1")".XXXXXXXX)
dir2=$(mktemp "${TMPDIR:-/tmp}"/nnn-"$(basename "$2")".XXXXXXXX)
ls -A1 "$1" > "$dir1"
ls -A1 "$2" > "$dir2"
$diffcmd "$dir1" "$dir2"
rm -- "$dir1" "$dir2"
}
if [ -s "$selection" ]; then
arr=$(tr '\0' '\n' < "$selection")
if [ "$(echo "$arr" | wc -l)" -gt 1 ]; then
f1="$(echo "$arr" | sed -n '1p')"
f2="$(echo "$arr" | sed -n '2p')"
if [ -d "$f1" ] && [ -d "$f2" ]; then
dirdiff "$f1" "$f2"
else
# If xargs supports the -o option, use it to get rid of:
# Vim: Warning: Input is not from a terminal
# xargs -0 -o vimdiff < $selection
eval xargs -0 "$diffcmd" < "$selection"
fi
elif [ -n "$1" ]; then
f1="$(echo "$arr" | sed -n '1p')"
if [ -d "$f1" ] && [ -d "$1" ]; then
dirdiff "$f1" "$1"
elif [ -f "$f1" ] && [ -f "$1" ]; then
$diffcmd "$f1" "$1"
else
echo "cannot compare file with directory"
fi
else
echo "needs at least 2 files or directories selected for comparison"
fi
fi
# Clear selection
if [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi

77
plugins/dragdrop Executable file
View File

@ -0,0 +1,77 @@
#!/usr/bin/env sh
# Description: Open a Drag and drop window, to drop files onto other programs.
# Also provides drag and drop window for files.
#
# Dependencies: dragon - https://github.com/mwh/dragon
#
# Notes:
# 1. Files that are dropped will be added to nnn's selection
# Some web-based files will be downloaded to current dir
# with curl and it may overwrite some existing files
# 2. The user has to mm to clear nnn's selection first
#
# Shell: POSIX compliant
# Author: 0xACE
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
resp=f
all=
if type dragon-drag-and-drop >/dev/null 2>&1; then
dnd="dragon-drag-and-drop"
elif type dragon-drop >/dev/null 2>&1; then
dnd="dragon-drop"
else
dnd="dragon"
fi
add_file ()
{
printf '%s\0' "$@" >> "$selection"
}
use_all ()
{
printf "mark --all (a) [default=none]: "
read -r resp
if [ "$resp" = "a" ]; then
all="--all"
else
all=""
fi
}
if [ -s "$selection" ]; then
printf "Drop file (r). Drag selection (s), Drag current directory (d) or drag current file (f) [default=f]: "
read -r resp
else
printf "Drop file (r). Drag current directory (d) or drag current file (f) [default=f]: "
read -r resp
if [ "$resp" = "s" ]; then
resp=f
fi
fi
if [ "$resp" = "s" ]; then
use_all
sed -z 's|'"$PWD/"'||g' < "$selection" | xargs -0 "$dnd" "$all" &
elif [ "$resp" = "d" ]; then
use_all
"$dnd" "$all" "$PWD/"* &
elif [ "$resp" = "r" ]; then
true > "$selection"
"$dnd" --print-path --target | while read -r f
do
if printf "%s" "$f" | grep '^\(https\?\|ftps\?\|s\?ftp\):\/\/' ; then
curl -LJO "$f"
add_file "$PWD/$(basename "$f")"
elif [ -e "$f" ]; then
add_file "$f"
fi
done &
else
if [ -n "$1" ] && [ -e "$1" ]; then
"$dnd" "$1" &
fi
fi

70
plugins/dups Executable file
View File

@ -0,0 +1,70 @@
#!/usr/bin/env sh
# Description: List non-empty duplicates in the current dir (based on size followed by MD5)
#
# Source: https://www.commandlinefu.com/commands/view/3555/find-duplicate-files-based-on-size-first-then-md5-hash
#
# Dependencies: find md5sum sort uniq xargs gsed
#
# Notes:
# 1. If the file size exceeds $size_digits digits the file will be misplaced
# 12 digits fit files up to 931GiB
# 2. Bash compatible required for mktemp
#
# Shell: Bash
# Authors: syssyphus, KlzXS
EDITOR="${EDITOR:-vi}"
TMPDIR="${TMPDIR:-/tmp}"
size_digits=12
tmpfile=$(mktemp "$TMPDIR/.nnnXXXXXX")
printf "\
## This is an overview of all duplicate files found.
## Comment out the files you wish to remove. You will be given an option to cancel.
## Lines with double comments (##) are ignored.
## You will have the option to remove the files with force or interactively.\n
" > "$tmpfile"
# shellcheck disable=SC2016
find . -size +0 -type f -printf "%${size_digits}s %p\n" | sort -rn | uniq -w"${size_digits}" -D | sed -e '
s/^ \{0,12\}\([0-9]\{0,12\}\) \(.*\)$/printf "%s %s\\n" "$(md5sum "\2")" "d\1"/
' | tr '\n' '\0' | xargs -0 -n1 sh -c | sort | { uniq -w32 --all-repeated=separate; echo; } | sed -ne '
h
s/^\(.\{32\}\).* d\([0-9]*\)$/## md5sum: \1 size: \2 bytes/p
g
:loop
N
/.*\n$/!b loop
p' | sed -e 's/^.\{32\} \(.*\) d[0-9]*$/\1/' >> "$tmpfile"
"$EDITOR" "$tmpfile"
printf "Remove commented files? (yes/no) [default=n]: "
read -r commented
if [ "$commented" = "y" ]; then
sedcmd="/^##.*/d; /^[^#].*/d; /^$/d; s/^# *\(.*\)$/\1/"
else
printf "Press any key to exit"
read -r _
exit
fi
printf "Remove with force or interactive? (f/i) [default=i]: "
read -r force
if [ "$force" = "f" ]; then
#shellcheck disable=SC2016
sed -e "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -f -- "$0" "$@" </dev/tty'
else
#shellcheck disable=SC2016
sed -e "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -i -- "$0" "$@" </dev/tty'
fi
rm -- "$tmpfile"
printf "Press any key to exit"
read -r _

89
plugins/finder Executable file
View File

@ -0,0 +1,89 @@
#!/usr/bin/env bash
# Description: Run custom search and list results in smart context
#
# Note: This plugin retains search history
#
# Usage:
# Run plugin and enter e.g. "-size +10M" to list files in current
# directory larger than 10M. By default entered expressions are
# interpreted as arguments to find. Results have to be NUL
# terminated which is done by default for find. Alternatively one
# can prepend a '$' to run a custom search program such as fd or
# ripgrep. Entered expressions will be saved in history file to
# be listed as bookmarks and and can be entered by index and edited.
#
# Shell: Bash
# Author: Arun Prakash Jana, Luuk van Baal
TMPDIR="${TMPDIR:-/tmp}"
NNN_FINDHIST="${NNN_FINDHIST:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/finderbms}"
NNN_FINDHISTLEN="${NNN_FINDHISTLEN:-10000}"
printexamples() {
printf -- "-maxdepth 1 -name pattern
-maxdepth 1 -size +100M
\$fd -0 pattern
\$fd -0 -d 2 -S +100M
\$grep -rlZ pattern
\$rg -l0 pattern
\$fzf -m | tr '\\\n' '\\\0'\n"
}
printexprs() {
for ((i = "$1"; i < ${#fexprs[@]}; i++)); do
printf '%s\t%s\n' "$((i + 1))" "${fexprs[$i]}"
done
}
mapexpr() {
if [ "$fexpr" -eq "$fexpr" ] 2>/dev/null; then
fexpr=${fexprs[$((fexpr - 1))]}
read -r -e -p "Search expression: " -i "$fexpr" fexpr
else
return 1
fi
}
readexpr() {
case "$fexpr" in
h) clear
printf "Examples:\n"
mapfile -t fexprs < <(printexamples)
printexprs 0
read -r -p "Search expression or index: " fexpr
mapexpr
[ -n "$fexpr" ] && readexpr ;;
\$*) cmd="${fexpr:1}" ;;
*) mapexpr && readexpr
cmd="find . $fexpr -print0" ;;
esac
}
clear
[ -f "$NNN_FINDHIST" ] || printexamples > "$NNN_FINDHIST"
mapfile -t fexprs < <(sort "$NNN_FINDHIST" | uniq -c | sort -nr | head -n5 |\
awk '{for (i=2; i<NF; i++) printf $i " "; print $NF}')
printf "Most used search expressions:\n"
printexprs 0
mapfile -t -O"$i" fexprs < <(tac "$NNN_FINDHIST" | awk '!a[$0]++' | head -n5)
printf "Most recently used search expressions:\n"
printexprs "$i"
read -r -p "Search expression or index (h for help): " fexpr
mapexpr
if [ -n "$fexpr" ]; then
printf "+l" > "$NNN_PIPE"
while :; do
readexpr
eval "$cmd" > "$NNN_PIPE" && break
read -r -e -p "Search expression: " -i "$fexpr" fexpr
done
if [ -n "$fexpr" ]; then
tail -n"$NNN_FINDHISTLEN" "$NNN_FINDHIST" > "$TMPDIR/finderbms"
printf "%s\n" "$fexpr" >> "$TMPDIR/finderbms"
mv -- "$TMPDIR/finderbms" "$NNN_FINDHIST"
fi
fi

75
plugins/fixname Executable file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env bash
# Description: Clean filename or dirname (either hovered or selections)
# to be more shell-friendly. This script cleans
# non A-Za-z0-9._- characters.
# and replaces it with underscore (_).
#
# It supports cleaning single/double quote, newline,
# leading, trailing spaces.
#
# eg.
# to be continued (つづく).mp4 -> to_be_continued______.mp4
# [work] stuff.txt -> _work__stuff.txt
# home's server -> home_s_server
# qwe\trty -> __qwe_rty
#
# And if there are two almost similar filenames
# like: 'asd]f' and 'asd f' both will be renamed to 'asd_f',
# to avoid overwriting, the last file will be prepended by _.
# So they will be: 'asd_f' and '_asd_f'
#
# Dependencies: sed
#
# Shell: Bash
# Author: Benawi Adha
prompt=true
sel=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
cleanup() {
# printf "%s" "$1" | sed -e 's/[^A-Za-z0-9._-]/_/g'
printf "%s" "$1" | sed 's/[^A-Za-z0-9._-]/_/g' | sed ':a;N;$!ba;s/\n/_/g'
}
if [ -s "$sel" ]; then
targets=()
while IFS= read -r -d '' i || [ -n "$i" ]; do
targets+=( "$(basename "$i")" )
done < "$sel"
else
targets=("$1")
fi
for i in "${targets[@]}"; do
printf "%s -> %s\n" "$i" "$(cleanup "$i")";
done
if $prompt; then
echo
printf "Proceed [Yn]? "
read -r input
case "$input" in
y|Y|'')
;;
*)
echo "Canceled"
exit
;;
esac
fi
for i in "${targets[@]}"; do
if [ "$i" != "$(cleanup "$i")" ]; then
tmp=''
if [ -e "$(cleanup "$i")" ]; then
tmp='_'
fi
mv -- "$i" "$tmp$(cleanup "$i")";
fi
done
# Clear selection
if [ -s "$sel" ] && [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi

89
plugins/fzcd Executable file
View File

@ -0,0 +1,89 @@
#!/usr/bin/env sh
# Description: Fuzzy search multiple locations read-in from a path-list file
# (or $PWD) and open the selected file's dir in a smart context.
# Dependencies: fzf, find (only for multi-location search)
#
# Details: Paths in list file should be newline-separated absolute paths.
# Paths can be file paths; the script will scan the parent dirs.
#
# The path-list file precedence is:
# - "$1" (the hovered file) if it exists, is plain-text and the
# first line points to an existing file
# - "$LIST" if set below
# - "$2" (the current directory) [mimics plugin fzcd behaviour]
#
# The path-list file can be generated easily:
# - pick the (file)paths in picker mode to path-list file
# - OR, edit selection in nnn and save as path-list file
#
# Shell: POSIX compliant
# Author: Anna Arad, Arun Prakash Jana, KlzXS
IFS="$(printf '\n\r')"
# shellcheck disable=SC1090,SC1091
. "$(dirname "$0")"/.nnn-plugin-helper
CTX=+
LIST="${LIST:-""}"
if ! type fzf >/dev/null 2>&1; then
printf "fzf missing"
read -r _
exit 1
fi
if [ -n "$1" ] && [ "$(file -b --mime-type "$1")" = 'text/plain' ] && [ -e "$(head -1 "$1")" ]; then
LIST="$1"
elif ! [ -s "$LIST" ]; then
sel=$(fzf)
# Show only the file and parent dir
# sel=$(fzf --delimiter / --with-nth=-2,-1 --tiebreak=begin --info=hidden)
LIST=''
fi
if [ -n "$LIST" ]; then
if type find >/dev/null 2>&1; then
tmpfile=$(mktemp /tmp/abc-script.XXXXXX)
while IFS= read -r path; do
if [ -d "$path" ]; then
printf "%s\n" "$path" >> "$tmpfile"
elif [ -f "$path" ]; then
printf "%s\n" "$(dirname "$path")" >> "$tmpfile"
fi
done < "$LIST"
sel=$(xargs -d '\n' < "$tmpfile" -I{} find {} -type f -printf "%H//%P\n" | sed '/.*\/\/\(\..*\|.*\/\..*\)/d; s:/\+:/:g' | fzf --delimiter / --tiebreak=begin --info=hidden)
# Alternative for 'fd'
# sel=$(xargs -d '\n' < "$tmpfile" fd . | fzf --delimiter / --tiebreak=begin --info=hidden)
rm -- "$tmpfile"
else
printf "find missing"
read -r _
exit 1
fi
fi
if [ -n "$sel" ]; then
if [ "$sel" = "." ] || { ! [ -d "$sel" ] && ! [ -f "$sel" ]; }; then
exit 0
fi
# Check if the selected path returned by fzf command is absolute
case $sel in
/*) nnn_cd "$sel" "$CTX" ;;
*)
# Remove "./" prefix if it exists
sel="${sel#./}"
if [ "$PWD" = "/" ]; then
nnn_cd "/$sel" "$CTX"
else
nnn_cd "$PWD/$sel" "$CTX"
fi;;
esac
fi

53
plugins/fzhist Executable file
View File

@ -0,0 +1,53 @@
#!/usr/bin/env sh
# Description: Fuzzy find a command from history,
# edit in $EDITOR and run as a command
#
# Note: Supports only bash, zsh and fish history
#
# TODO: For zsh there's also $ZDOTDIR which might need to be checked as well for the -z $HISTFILE && -n $ZDOTDIR case.
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
if type fzf >/dev/null 2>&1; then
fuzzy=fzf
else
exit 1
fi
shellname="$(basename "$SHELL")"
if [ "$shellname" = "bash" ]; then
if [ -f "$HISTFILE" ]; then
hist_file="$HISTFILE"
else
hist_file="$HOME/.bash_history"
fi
entry="$("$fuzzy" < "$hist_file")"
elif [ "$shellname" = "zsh" ]; then
if [ -f "$HISTFILE" ]; then
hist_file="$HISTFILE"
else
hist_file="$HOME/.zsh_history"
fi
entry="$("$fuzzy" < "$hist_file")"
elif [ "$shellname" = "fish" ]; then
hist_file="$HOME/.local/share/fish/fish_history"
entry="$(grep "\- cmd: " "$hist_file" | cut -c 8- | "$fuzzy")"
fi
if [ -n "$entry" ]; then
tmpfile=$(mktemp)
echo "$entry" >> "$tmpfile"
$EDITOR "$tmpfile"
if [ -s "$tmpfile" ]; then
$SHELL -c "$(cat "$tmpfile")"
fi
rm -- "$tmpfile"
printf "Press any key to exit"
read -r _
fi

85
plugins/fzopen Executable file
View File

@ -0,0 +1,85 @@
#!/usr/bin/env sh
# Description: Regular mode:
# Fuzzy find a file in directory subtree.
# Opens in $VISUAL or $EDITOR if text.
# Opens other type of files with xdg-open.
# Work only with a single file selected.
#
# Picker mode:
# If picker mode output file is passed, it
# will be overwritten with any picked files.
# Leaves untouched if no file is picked.
# Works with single/multiple files selected.
#
# Dependencies: fd/find, fzf/skim, xdg-open/open (on macOS)
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
NUKE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
USE_NUKE=0
# shellcheck disable=SC1090,SC1091
. "$(dirname "$0")"/.nnn-plugin-helper
if type fzf >/dev/null 2>&1; then
cmd="$FZF_DEFAULT_COMMAND"
if type fd >/dev/null 2>&1; then
[ -z "$cmd" ] && cmd="fd -t f 2>/dev/null"
else
[ -z "$cmd" ] && cmd="find . -type f 2>/dev/null"
fi
entry="$(eval "$cmd" | fzf -m)"
# To show only the file name
# entry=$(find . -type f 2>/dev/null | fzf --delimiter / --with-nth=-1 --tiebreak=begin --info=hidden)
elif type sk >/dev/null 2>&1; then
entry=$(find . -type f 2>/dev/null | sk)
else
exit 1
fi
# Check for picker mode
if [ "$3" ]; then
if [ "$entry" ]; then
case "$entry" in
/*) fullpath="$entry" ;;
*) fullpath="$PWD/$entry" ;;
esac
if [ "-" = "$3" ]; then
printf "%s\n" "$fullpath"
else
printf "%s\n" "$fullpath" > "$3"
fi
# Tell `nnn` to clear its internal selection
printf "%s" "0p" > "$NNN_PIPE"
fi
exit 0
fi
if [ "$entry" ]; then
if [ "$USE_NUKE" -ne 0 ]; then
"$NUKE" "$entry"
exit 0
fi
# Open the file (works for a single file only)
cmd_file=""
cmd_open=""
if uname | grep -q "Darwin"; then
cmd_file="file -bIL"
cmd_open="open"
else
cmd_file="file -biL"
cmd_open="xdg-open"
fi
case "$($cmd_file "$entry")" in
*text*)
"${VISUAL:-$EDITOR}" "$entry" ;;
*)
$cmd_open "$entry" >/dev/null 2>&1 ;;
esac
fi

59
plugins/fzplug Executable file
View File

@ -0,0 +1,59 @@
#!/usr/bin/env sh
# Description: Fuzzy find and execute nnn plugins (and optionally,
# custom scripts located elsewhere).
# Description and details of plugins can be previewed
# from the fzf interface. Use `?` to toggle preview
# pane on and off, ^Up/^Dn to scroll.
#
# Dependencies: find, fzf, cat (or bat, if installed)
#
# Note: For better compatibility with as many nnn plugins as possible,
# fzplug will first execute the chosen script on the file hovered
# in nnn, and upon failure, try to run it with no target (i.e on
# an active selection, if present).
#
# Shell: POSIX compliant
# Author: Kabouik
# Optional scripts sources
# Leave blank or fill with the absolute path of a folder containing executable
# scripts other than nnn plugins (e.g., "$HOME/.local/share/nautilus/scripts",
# since there are numerous Nautilus script git repositories).
# Add extra variables if needed, make sure you call them in the find command.
#CUSTOMDIR1="$HOME/.local/share/nautilus/scripts"
CUSTOMDIR1=""
CUSTOMDIR2=""
nnnpluginsdir="$HOME/.config/nnn/plugins"
# Preview with bat if installed
if type bat >/dev/null; then
BAT="bat --terminal-width='$(tput cols)' --decorations=always --color=always --style='${BAT_STYLE:-header,numbers}'"
fi
plugin=$(find "$nnnpluginsdir" "$CUSTOMDIR1" "$CUSTOMDIR2" \
-maxdepth 3 -perm -111 -type f 2>/dev/null | fzf --ansi --preview \
"${BAT:-cat} {}" --preview-window="right:66%:wrap" --delimiter / \
--with-nth -1 --bind="?:toggle-preview")
# Try running the script on the hovered file, and abort
# abort if no plugin was selected (ESC or ^C pressed).
err=0
if ! [ "$plugin" = "" ]; then
"$plugin" "$1" || err=1
fi
# If attempt with hovered file fails, try without any target
# (nnn selections should still be passed to the script in that case)
if [ "$err" -eq "1" ]; then
clear && "$plugin" || err=2
fi
# Abort and show error if both fail
if [ "$err" -eq "2" ]; then
sep="\n---\n"
printf "$sep""Failed to execute '%s'. See error above or try without fzfplug. Press return to continue. " "$plugin" && read -r _ && clear
fi

70
plugins/getplugs Executable file
View File

@ -0,0 +1,70 @@
#!/usr/bin/env sh
# Description: Update nnn plugins to installed nnn version
#
# Shell: POSIX compliant
# Authors: Arun Prakash Jana, KlzXS
CONFIG_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/
PLUGIN_DIR=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins
merge () {
if type nvim >/dev/null 2>&1; then
nvim -d "$1" "$2"
else
vimdiff +0 "$1" "$2"
fi
}
prompt () {
printf "%s\n" "Plugin $1 already exists and is different."
printf "Keep (k), merge (m), overwrite (o) [default: k]? "
read -r operation
if [ "$operation" = "m" ]; then
op="merge"
elif [ "$operation" = "o" ]; then
op="cp -vRf --"
else
op="true"
fi
}
if [ "$1" = "master" ] ; then
VER="master"
ARCHIVE_URL=https://github.com/jarun/nnn/archive/master.tar.gz
elif type nnn >/dev/null 2>&1; then
VER=$(nnn -V)
ARCHIVE_URL=https://github.com/jarun/nnn/releases/download/v"$VER"/nnn-v"$VER".tar.gz
else
echo "nnn is not installed"
exit 1
fi
# backup any earlier plugins
if [ -d "$PLUGIN_DIR" ]; then
tar -C "$CONFIG_DIR" -czf "$CONFIG_DIR""plugins-$(date '+%Y%m%d%H%M').tar.gz" plugins/
fi
mkdir -p "$PLUGIN_DIR"
cd "$CONFIG_DIR" || exit 1
curl -Ls "$ARCHIVE_URL" -o nnn-"$VER".tar.gz
tar -zxf nnn-"$VER".tar.gz
cd nnn-"$VER"/plugins || exit 1
# shellcheck disable=SC2044
# We do not use obnoxious names for plugins
for f in $(find . -maxdepth 1 \( ! -iname "." ! -iname "*.md" \)); do
if [ -f ../../plugins/"$f" ]; then
if [ "$(diff --brief "$f" ../../plugins/"$f")" ]; then
prompt "$f"
$op "$f" ../../plugins/
fi
else
cp -vRf -- "$f" ../../plugins/
fi
done
cd ../.. || exit 1
rm -rf nnn-"$VER"/ nnn-"$VER".tar.gz

15
plugins/gitroot Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env sh
# Description: cd to the top level of the current git repository in the current context
# Dependencies: git
# Shell: sh
# Author: https://github.com/PatrickF1
root="$(git rev-parse --show-toplevel 2>/dev/null)"
if [ -n "$root" ]; then
printf "%s" "0c$root" > "$NNN_PIPE"
else
printf "Not in a git repository"
read -r _
exit 1
fi

28
plugins/gpgd Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env sh
# Description: Decrypts selected files using gpg. The contents of the
# decrypted file are stored in a file with extension .dec
#
# Note: If an appropriate private key cannot be found gpg silently
# prints a message in the background and no files are written.
#
# Shell: POSIX compliant
# Author: KlzXS
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
printf "(s)election/(c)urrent? [default=c] "
read -r resp
if [ "$resp" = "s" ]; then
files=$(tr '\0' '\n' < "$selection")
else
files=$1
fi
printf "%s" "$files" | xargs -n1 -I{} gpg --decrypt --output "{}.dec" {}
# Clear selection
if [ "$resp" = "s" ] && [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi

45
plugins/gpge Executable file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env sh
# Description: Encrypts selected files using gpg. Can encrypt
# asymmetrically (key) or symmetrically (passphrase).
# If asymmetric encryption is chosen a key can be
# chosen from the list of capable public keys using fzf.
#
# Note: Symmetric encryption only works for a single (current) file as per gpg limitations
#
# Shell: POSIX compliant
# Author: KlzXS
# shellcheck disable=SC1090,SC1091
. "$(dirname "$0")"/.nnn-plugin-helper
printf "(s)ymmetric, (a)symmetric? [default=a] "
read -r symmetry
if [ "$symmetry" = "s" ]; then
gpg --symmetric "$1"
else
if nnn_use_selection; then
clear_sel=1
# shellcheck disable=SC2154
files=$(tr '\0' '\n' < "$selection")
else
clear_sel=0
files=$1
fi
keyids=$(gpg --list-public-keys --with-colons | grep -E "pub:(.*:){10}.*[eE].*:" | awk -F ":" '{print $5}')
#awk needs literal $10
#shellcheck disable=SC2016
keyuids=$(printf "%s" "$keyids" | xargs -n1 -I{} sh -c 'gpg --list-key --with-colons "{}" | grep "uid" | awk -F ":" '\''{printf "%s %s\n", "{}", $10}'\''')
recipient=$(printf "%s" "$keyuids" | fzf | awk '{print $1}')
printf "%s" "$files" | xargs -n1 gpg --encrypt --recipient "$recipient"
# Clear selection
if [ "$clear_sel" -eq 1 ] && [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi
fi

21
plugins/gsconnect Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env sh
#set -x
# Description: Send the selected (or hovered) files to your Android device using gsconnect daemon.js.
# GSConnect must be configured on the Android device and the PC.
#
# Shell: POSIX compliant
# Author: Darukutsu
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
gsconnect=$HOME/.local/share/gnome-shell/extensions/gsconnect@andyholmes.github.io/service/daemon.js
ids=$($gsconnect -l)
for id in $ids; do
if [ -s "$selection" ]; then
xargs -0 < "$selection" -I{} "$gsconnect" -d "$id" --share-file="{}"
# Clear selection
printf "-" > "$NNN_PIPE"
else
"$gsconnect" -d "$id" --share-file="$2/$1"
fi
done

49
plugins/gutenread Executable file
View File

@ -0,0 +1,49 @@
#!/usr/bin/env sh
# Description: Browse Project Gutenberg catalogue by popularity, then download
# and read a book of your choice.
#
# Details: Set the variable EBOOK_ID to download in html format and read in w3m.
# Clear EBOOK_ID to browse available ebooks by popularity and set it to
# the ID once you find an interesting one.
# To download and read in epub format set READER to an epub reader like
# epr: https://github.com/wustho/epr
#
# More on EBOOK_ID:
# Wuthering Heights by Emily Brontë is at https://www.gutenberg.org/ebooks/768
# So EBOOK_ID would be 768
#
# Downloaded ebooks are at ${XDG_CACHE_HOME:-$HOME/.cache}/nnn/gutenbooks/
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
EBOOK_ID="${EBOOK_ID:-""}"
DIR="${XDG_CACHE_HOME:-$HOME/.cache}/nnn/gutenbooks/$EBOOK_ID"
BROWSE_LINK="https://www.gutenberg.org/ebooks/search/?sort_order=downloads"
BROWSER="${BROWSER:-w3m}"
READER="${READER:-""}"
if [ -n "$EBOOK_ID" ]; then
if [ ! -e "$DIR" ]; then
mkdir -p "$DIR"
cd "$DIR" || exit 1
if [ -z "$READER" ]; then
curl -L -O "https://www.gutenberg.org/files/$EBOOK_ID/$EBOOK_ID-h.zip"
unzip "$EBOOK_ID"-h.zip
else
curl -L -o "$EBOOK_ID".epub "https://www.gutenberg.org/ebooks/$EBOOK_ID.epub.noimages"
fi
fi
if [ -d "$DIR" ]; then
if [ -z "$READER" ]; then
"$BROWSER" "$DIR/$EBOOK_ID-h/$EBOOK_ID-h.htm"
else
"$READER" "$DIR/$EBOOK_ID.epub"
fi
fi
else
"$BROWSER" "$BROWSE_LINK"
fi

31
plugins/imgresize Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env sh
# Description: Resize images in a directory to screen resolution with imgp
#
# Dependencipes: imgp - https://github.com/jarun/imgp
#
# Notes:
# 1. Set res to avoid the desktop resolution prompt each time
# 2. MINSIZE is set to 1MB by default, adjust it if you want
# 3. imgp options used:
# a - adaptive mode
# c - convert PNG to JPG
# k - skip images matching specified hres/vres
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
# set resolution (e.g. 1920x1080)
res="${RESOLUTION}"
# set minimum image size (in bytes) to resize (default: 1MB)
MINSIZE="${MINSIZE:-1048576}"
if [ -z "$res" ]; then
printf "desktop resolution (hxv): "
read -r res
fi
if [ -n "$res" ] && [ -n "$MINSIZE" ]; then
imgp -ackx "$res" -s "$MINSIZE"
fi

597
plugins/imgur Executable file
View File

@ -0,0 +1,597 @@
#!/usr/bin/env bash
##########################################################################
# The MIT License
#
# Copyright (c) jomo
#
# Permission is hereby granted, free of charge,
# to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to
# deal in the Software without restriction, including
# without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom
# the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice
# shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
# ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
##########################################################################
# https://github.com/jomo/imgur-screenshot
# https://help.imgur.com/hc/en-us/articles/209592766-Tools-for-Imgur
#
# Slightly modified for `nnn` integration
#
# Shell: Bash
# Description: Upload an image file to imgur
if [ "${1}" = "--debug" ]; then
echo "########################################"
echo "Enabling debug mode"
echo "Please remove credentials before pasting"
echo "########################################"
echo ""
uname -a
for arg in ${0} "${@}"; do
echo -n "'${arg}' "
done
echo -e "\n"
shift
set -x
fi
current_version="v1.7.4"
function is_mac() {
uname | grep -q "Darwin"
}
### IMGUR-SCREENSHOT DEFAULT CONFIG ####
# You can override the config in ~/.config/imgur-screenshot/settings.conf
imgur_anon_id="ea6c0ef2987808e"
imgur_icon_path="${HOME}/Pictures/imgur.png"
imgur_acct_key=""
imgur_secret=""
login="false"
album_title=""
album_id=""
credentials_file="${HOME}/.config/imgur-screenshot/credentials.conf"
file_name_format="imgur-%Y_%m_%d-%H:%M:%S.png" # when using scrot, must end with .png!
file_dir="${HOME}/Pictures"
upload_connect_timeout="5"
upload_timeout="120"
upload_retries="1"
# shellcheck disable=SC2034
if is_mac; then
screenshot_select_command="screencapture -i %img"
screenshot_window_command="screencapture -iWa %img"
screenshot_full_command="screencapture %img"
open_command="open %url"
else
screenshot_select_command="scrot -s %img"
screenshot_window_command="scrot %img"
screenshot_full_command="scrot %img"
open_command="xdg-open %url"
fi
open="true"
mode="select"
edit_command="gimp %img"
edit="false"
exit_on_album_creation_fail="true"
log_file="${HOME}/.imgur-screenshot.log"
auto_delete=""
copy_url="true"
keep_file="true"
check_update="true"
# NOTICE: if you make changes here, also edit the docs at
# https://github.com/jomo/imgur-screenshot/wiki/Config
# You can override the config in ~/.config/imgur-screenshot/settings.conf
############## END CONFIG ##############
settings_path="${HOME}/.config/imgur-screenshot/settings.conf"
if [ -f "${settings_path}" ]; then
# shellcheck disable=SC1090
source "${settings_path}"
fi
# dependency check
if [ "${1}" = "--check" ]; then
(type grep &>/dev/null && echo "OK: found grep") || echo "ERROR: grep not found"
if is_mac; then
if type growlnotify &>/dev/null; then
echo "OK: found growlnotify"
elif type terminal-notifier &>/dev/null; then
echo "OK: found terminal-notifier"
else
echo "ERROR: growlnotify nor terminal-notifier found"
fi
(type screencapture &>/dev/null && echo "OK: found screencapture") || echo "ERROR: screencapture not found"
(type pbcopy &>/dev/null && echo "OK: found pbcopy") || echo "ERROR: pbcopy not found"
else
(type notify-send &>/dev/null && echo "OK: found notify-send") || echo "ERROR: notify-send (from libnotify-bin) not found"
(type scrot &>/dev/null && echo "OK: found scrot") || echo "ERROR: scrot not found"
(type xclip &>/dev/null && echo "OK: found xclip") || echo "ERROR: xclip not found"
fi
(type curl &>/dev/null && echo "OK: found curl") || echo "ERROR: curl not found"
exit 0
fi
# notify <'ok'|'error'> <title> <text>
function notify() {
if is_mac; then
if type growlnotify &>/dev/null; then
growlnotify --icon "${imgur_icon_path}" --iconpath "${imgur_icon_path}" --title "${2}" --message "${3}"
else
terminal-notifier -appIcon "${imgur_icon_path}" -contentImage "${imgur_icon_path}" -title "imgur: ${2}" -message "${3}"
fi
else
if [ "${1}" = "error" ]; then
notify-send -a ImgurScreenshot -u critical -c "im.error" -i "${imgur_icon_path}" -t 500 "imgur: ${2}" "${3}"
else
notify-send -a ImgurScreenshot -u low -c "transfer.complete" -i "${imgur_icon_path}" -t 500 "imgur: ${2}" "${3}"
fi
fi
}
function take_screenshot() {
echo "Please select area"
is_mac || sleep 0.1 # https://bbs.archlinux.org/viewtopic.php?pid=1246173#p1246173
cmd="screenshot_${mode}_command"
cmd=${!cmd//\%img/${1}}
if ! shot_err="$(${cmd} &>/dev/null)"; then #takes a screenshot with selection
echo "Failed to take screenshot '${1}': '${shot_err}'. For more information visit https://github.com/jomo/imgur-screenshot/wiki/Troubleshooting" | tee -a "${log_file}"
notify error "Something went wrong :(" "Information has been logged"
exit 1
fi
}
function check_for_update() {
# exit non-zero on HTTP error, output only the body (no stats) but output errors, follow redirects, output everything to stdout
remote_version="$(curl --compressed -fsSL --stderr - "https://api.github.com/repos/jomo/imgur-screenshot/releases" | grep -Em 1 --color 'tag_name":\s*".*"' | cut -d '"' -f 4)"
if [ -n "$remote_version" ]; then
if [ ! "${current_version}" = "${remote_version}" ] && [ -n "${current_version}" ] && [ -n "${remote_version}" ]; then
echo "Update found!"
echo "Version ${remote_version} is available (You have ${current_version})"
notify ok "Update found" "Version ${remote_version} is available (You have ${current_version}). https://github.com/jomo/imgur-screenshot"
echo "Check https://github.com/jomo/imgur-screenshot/releases/${remote_version} for more info."
elif [ -z "${current_version}" ] || [ -z "${remote_version}" ]; then
echo "Invalid empty version string"
echo "Current (local) version: '${current_version}'"
echo "Latest (remote) version: '${remote_version}'"
else
echo "Version ${current_version} is up to date."
fi
else
echo "Failed to check for latest version: ${remote_version}"
fi
}
function check_oauth2_client_secrets() {
if [ -z "${imgur_acct_key}" ] || [ -z "${imgur_secret}" ]; then
echo "In order to upload to your account, register a new application at:"
echo "https://api.imgur.com/oauth2/addclient"
echo "Select 'OAuth 2 authorization without a callback URL'"
echo "Then, set the imgur_acct_key (Client ID) and imgur_secret in your config."
exit 1
fi
}
function load_access_token() {
token_expire_time=0
# check for saved access_token and its expiration date
if [ -f "${credentials_file}" ]; then
# shellcheck disable=SC1090
source "${credentials_file}"
fi
current_time="$(date +%s)"
preemptive_refresh_time="$((10*60))"
expired="$((current_time > (token_expire_time - preemptive_refresh_time)))"
if [ -n "${refresh_token}" ]; then
# token already set
if [ "${expired}" -eq "0" ]; then
# token expired
refresh_access_token "${credentials_file}"
fi
else
acquire_access_token "${credentials_file}"
fi
}
function acquire_access_token() {
check_oauth2_client_secrets
# prompt for a PIN
authorize_url="https://api.imgur.com/oauth2/authorize?client_id=${imgur_acct_key}&response_type=pin"
echo "Go to"
echo "${authorize_url}"
echo "and grant access to this application."
read -rp "Enter the PIN: " imgur_pin
if [ -z "${imgur_pin}" ]; then
echo "PIN not entered, exiting"
exit 1
fi
# exchange the PIN for access token and refresh token
response="$(curl --compressed -fsSL --stderr - \
-F "client_id=${imgur_acct_key}" \
-F "client_secret=${imgur_secret}" \
-F "grant_type=pin" \
-F "pin=${imgur_pin}" \
https://api.imgur.com/oauth2/token)"
save_access_token "${response}" "${1}"
}
function refresh_access_token() {
check_oauth2_client_secrets
token_url="https://api.imgur.com/oauth2/token"
# exchange the refresh token for access_token and refresh_token
if ! response="$(curl --compressed -fsSL --stderr - \
-F "client_id=${imgur_acct_key}" \
-F "client_secret=${imgur_secret}" \
-F "grant_type=refresh_token" \
-F "refresh_token=${refresh_token}" \
"${token_url}"
)"; then
# curl failed
handle_upload_error "${response}" "${token_url}"
exit 1
fi
save_access_token "${response}" "${1}"
}
function save_access_token() {
if ! grep -q "access_token" <<<"${1}"; then
# server did not send access_token
echo "Error: Something is wrong with your credentials:"
echo "${1}"
exit 1
fi
access_token="$(grep -Eo 'access_token":".*"' <<<"${1}" | cut -d '"' -f 3)"
refresh_token="$(grep -Eo 'refresh_token":".*"' <<<"${1}" | cut -d '"' -f 3)"
expires_in="$(grep -Eo 'expires_in":[0-9]*' <<<"${1}" | cut -d ':' -f 2)"
token_expire_time="$(( $(date +%s) + expires_in ))"
# create dir if not exist
mkdir -p "$(dirname "${2}")" 2>/dev/null
touch "${2}" && chmod 600 "${2}"
cat <<EOF > "${2}"
access_token="${access_token}"
refresh_token="${refresh_token}"
token_expire_time="${token_expire_time}"
EOF
}
function fetch_account_info() {
response="$(curl --compressed --connect-timeout "${upload_connect_timeout}" -m "${upload_timeout}" --retry "${upload_retries}" -fsSL --stderr - -H "Authorization: Bearer ${access_token}" https://api.imgur.com/3/account/me)"
if grep -Eq '"success":\s*true' <<<"${response}"; then
username="$(grep -Eo '"url":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
echo "Logged in as ${username}."
echo "https://${username}.imgur.com"
else
echo "Failed to fetch info: ${response}"
fi
}
function delete_image() {
response="$(curl --compressed -X DELETE -fsSL --stderr - -H "Authorization: Client-ID ${1}" "https://api.imgur.com/3/image/${2}")"
if grep -Eq '"success":\s*true' <<<"${response}"; then
echo "Image successfully deleted (delete hash: ${2})." >> "${3}"
else
echo "The Image could not be deleted: ${response}." >> "${3}"
fi
}
function upload_authenticated_image() {
echo "Uploading '${1}'..."
title="$(echo "${1}" | rev | cut -d "/" -f 1 | cut -d "." -f 2- | rev)"
if [ -n "${album_id}" ]; then
response="$(curl --compressed --connect-timeout "${upload_connect_timeout}" -m "${upload_timeout}" --retry "${upload_retries}" -fsSL --stderr - -F "title=${title}" -F "image=@\"${1}\"" -F "album=${album_id}" -H "Authorization: Bearer ${access_token}" https://api.imgur.com/3/image)"
else
response="$(curl --compressed --connect-timeout "${upload_connect_timeout}" -m "${upload_timeout}" --retry "${upload_retries}" -fsSL --stderr - -F "title=${title}" -F "image=@\"${1}\"" -H "Authorization: Bearer ${access_token}" https://api.imgur.com/3/image)"
fi
# JSON parser premium edition (not really)
if grep -Eq '"success":\s*true' <<<"${response}"; then
img_id="$(grep -Eo '"id":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
img_ext="$(grep -Eo '"link":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4 | rev | cut -d "." -f 1 | rev)" # "link" itself has ugly '\/' escaping and no https!
del_id="$(grep -Eo '"deletehash":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
if [ -n "${auto_delete}" ]; then
export -f delete_image
echo "Deleting image in ${auto_delete} seconds."
nohup /bin/bash -c "sleep ${auto_delete} && delete_image ${imgur_anon_id} ${del_id} ${log_file}" &
fi
handle_upload_success "https://i.imgur.com/${img_id}.${img_ext}" "https://imgur.com/delete/${del_id}" "${1}"
else # upload failed
err_msg="$(grep -Eo '"error":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
test -z "${err_msg}" && err_msg="${response}"
handle_upload_error "${err_msg}" "${1}"
fi
}
function upload_anonymous_image() {
echo "Uploading '${1}'..."
title="$(echo "${1}" | rev | cut -d "/" -f 1 | cut -d "." -f 2- | rev)"
if [ -n "${album_id}" ]; then
response="$(curl --compressed --connect-timeout "${upload_connect_timeout}" -m "${upload_timeout}" --retry "${upload_retries}" -fsSL --stderr - -H "Authorization: Client-ID ${imgur_anon_id}" -F "title=${title}" -F "image=@\"${1}\"" -F "album=${album_id}" https://api.imgur.com/3/image)"
else
response="$(curl --compressed --connect-timeout "${upload_connect_timeout}" -m "${upload_timeout}" --retry "${upload_retries}" -fsSL --stderr - -H "Authorization: Client-ID ${imgur_anon_id}" -F "title=${title}" -F "image=@\"${1}\"" https://api.imgur.com/3/image)"
fi
# JSON parser premium edition (not really)
if grep -Eq '"success":\s*true' <<<"${response}"; then
img_id="$(grep -Eo '"id":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
img_ext="$(grep -Eo '"link":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4 | rev | cut -d "." -f 1 | rev)" # "link" itself has ugly '\/' escaping and no https!
del_id="$(grep -Eo '"deletehash":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
if [ -n "${auto_delete}" ]; then
export -f delete_image
echo "Deleting image in ${auto_delete} seconds."
nohup /bin/bash -c "sleep ${auto_delete} && delete_image ${imgur_anon_id} ${del_id} ${log_file}" &
fi
handle_upload_success "https://i.imgur.com/${img_id}.${img_ext}" "https://imgur.com/delete/${del_id}" "${1}"
else # upload failed
err_msg="$(grep -Eo '"error":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
test -z "${err_msg}" && err_msg="${response}"
handle_upload_error "${err_msg}" "${1}"
fi
}
function handle_upload_success() {
echo ""
echo "image link: ${1}"
echo "delete link: ${2}"
if [ "${copy_url}" = "true" ] && [ -z "${album_title}" ]; then
if is_mac; then
echo -n "${1}" | pbcopy
else
echo -n "${1}" | xclip -selection clipboard
fi
echo "URL copied to clipboard"
fi
# print to log file: image link, image location, delete link
echo -e "${1}\t${3}\t${2}" >> "${log_file}"
notify ok "Upload done!" "${1}"
# if [ ! -z "${open_command}" ] && [ "${open}" = "true" ]; then
# open_cmd=${open_command//\%url/${1}}
# open_cmd=${open_cmd//\%img/${2}}
# echo "Opening '${open_cmd}'"
# eval "${open_cmd}"
# fi
}
function handle_upload_error() {
error="Upload failed: \"${1}\""
echo "${error}"
echo -e "Error\t${2}\t${error}" >> "${log_file}"
notify error "Upload failed :(" "${1}"
}
function handle_album_creation_success() {
echo ""
echo "Album link: ${1}"
echo "Delete hash: ${2}"
echo ""
notify ok "Album created!" "${1}"
if [ "${copy_url}" = "true" ]; then
if is_mac; then
echo -n "${1}" | pbcopy
else
echo -n "${1}" | xclip -selection clipboard
fi
echo "URL copied to clipboard"
fi
# print to log file: album link, album title, delete hash
echo -e "${1}\t\"${3}\"\t${2}" >> "${log_file}"
}
function handle_album_creation_error() {
error="Album creation failed: \"${1}\""
echo -e "Error\t${2}\t${error}" >> "${log_file}"
notify error "Album creation failed :(" "${1}"
if [ ${exit_on_album_creation_fail} ]; then
exit 1
fi
}
while [ ${#} != 0 ]; do
case "${1}" in
-h | --help)
echo "usage: ${0} [--debug] [-c | --check | -v | -h | -u]"
echo " ${0} [--debug] [option]... [file]..."
echo ""
echo " --debug Enable debugging, must be first option"
echo " -h, --help Show this help, exit"
echo " -v, --version Show current version, exit"
echo " --check Check if all dependencies are installed, exit"
echo " -c, --connect Show connected imgur account, exit"
echo " -o, --open <true|false> Override 'open' config"
echo " -e, --edit <true|false> Override 'edit' config"
echo " -i, --edit-command <command> Override 'edit_command' config (include '%img'), sets --edit 'true'"
echo " -l, --login <true|false> Override 'login' config"
echo " -a, --album <album_title> Create new album and upload there"
echo " -A, --album-id <album_id> Override 'album_id' config"
echo " -k, --keep-file <true|false> Override 'keep_file' config"
echo " -d, --auto-delete <s> Automatically delete image after <s> seconds"
echo " -u, --update Check for updates, exit"
echo " file Upload file instead of taking a screenshot"
exit 0;;
-v | --version)
echo "${current_version}"
exit 0;;
-s | --select)
mode="select"
shift;;
-w | --window)
mode="window"
shift;;
-f | --full)
mode="full"
shift;;
-o | --open)
# shellcheck disable=SC2034
open="${2}"
shift 2;;
-e | --edit)
edit="${2}"
shift 2;;
-i | --edit-command)
edit_command="${2}"
edit="true"
shift 2;;
-l | --login)
login="${2}"
shift 2;;
-c | --connect)
load_access_token
fetch_account_info
exit 0;;
-a | --album)
album_title="${2}"
shift 2;;
-A | --album-id)
album_id="${2}"
shift 2;;
-k | --keep-file)
keep_file="${2}"
shift 2;;
-d | --auto-delete)
auto_delete="${2}"
shift 2;;
-u | --update)
check_for_update
exit 0;;
*)
upload_files=("${@}")
break;;
esac
done
if [ "${login}" = "true" ]; then
# load before changing directory
load_access_token
fi
if [ -n "${album_title}" ]; then
if [ "${login}" = "true" ]; then
response="$(curl -fsSL --stderr - \
-F "title=${album_title}" \
-H "Authorization: Bearer ${access_token}" \
https://api.imgur.com/3/album)"
else
response="$(curl -fsSL --stderr - \
-F "title=${album_title}" \
-H "Authorization: Client-ID ${imgur_anon_id}" \
https://api.imgur.com/3/album)"
fi
if grep -Eq '"success":\s*true' <<<"${response}"; then # Album creation successful
echo "Album '${album_title}' successfully created"
album_id="$(grep -Eo '"id":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
del_id="$(grep -Eo '"deletehash":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
handle_album_creation_success "https://imgur.com/a/${album_id}" "${del_id}" "${album_title}"
if [ "${login}" = "false" ]; then
album_id="${del_id}"
fi
else # Album creation failed
err_msg="$(grep -Eo '"error":\s*"[^"]+"' <<<"${response}" | cut -d "\"" -f 4)"
test -z "${err_msg}" && err_msg="${response}"
handle_album_creation_error "${err_msg}" "${album_title}"
fi
fi
if [ -z "${upload_files[*]}" ]; then
upload_files[0]=""
fi
for upload_file in "${upload_files[@]}"; do
if [ -z "${upload_file}" ]; then
cd "${file_dir}" || exit 1
# new filename with date
img_file="$(date +"${file_name_format}")"
take_screenshot "${img_file}"
else
# upload file instead of screenshot
img_file="${upload_file}"
fi
# get full path
#cd "$(dirname "$(realpath "${img_file}")")"
#img_file="$(realpath "${img_file}")"
# check if file exists
if ! [ -f "${img_file}" ]; then
echo "file '${img_file}' doesn't exist !"
read -r _
exit 1
fi
# open image in editor if configured
if [ "${edit}" = "true" ]; then
edit_cmd=${edit_command//\%img/${img_file}}
echo "Opening editor '${edit_cmd}'"
if ! (eval "${edit_cmd}"); then
echo "Error for image '${img_file}': command '${edit_cmd}' failed, not uploading. For more information visit https://github.com/jomo/imgur-screenshot/wiki/Troubleshooting" | tee -a "${log_file}"
notify error "Something went wrong :(" "Information has been logged"
exit 1
fi
fi
if [ "${login}" = "true" ]; then
upload_authenticated_image "${img_file}"
else
upload_anonymous_image "${img_file}"
fi
# delete file if configured
if [ "${keep_file}" = "false" ] && [ -z "${1}" ]; then
echo "Deleting temp file ${file_dir}/${img_file}"
rm -rf -- "${img_file}"
fi
echo ""
done
if [ "${check_update}" = "true" ]; then
check_for_update
fi
read -r _

113
plugins/imgview Executable file
View File

@ -0,0 +1,113 @@
#!/usr/bin/env sh
# Description: Open hovered or current directory in image viewer.
# Generates media thumbnails with optional dependencies.
#
# Dependencies:
# - imv (https://github.com/eXeC64/imv) or,
# - sxiv (https://github.com/muennich/sxiv) or,
# - nsxiv (https://codeberg.org/nsxiv/nsxiv) or,
# - ucollage (https://github.com/ckardaris/ucollage) or,
# - lsix (https://github.com/hackerb9/lsix), or
# - viu (https://github.com/atanunq/viu), or
# - catimg (https://github.com/posva/catimg), or
# - optional: ffmpeg for audio thumbnails (album art)
# - optional: ffmpegthumbnailer for video thumbnails
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana, Luuk van Baal
#
# Consider setting NNN_PREVIEWDIR to $XDG_CACHE_HOME/nnn/previews
# if you want to keep media thumbnails on disk between reboots.
NNN_PREVIEWDIR="${NNN_PREVIEWDIR:-${TMPDIR:-/tmp}/nnn/previews}"
exit_prompt() {
[ -n "$1" ] && printf "%s\n" "$1"
printf "%s" "Press any key to exit..."
cfg=$(stty -g); stty raw -echo; head -c 1; stty "$cfg"
clear
exit
}
make_thumbs() {
mkdir -p "$NNN_PREVIEWDIR$dir" || return
if [ "$1" = "viu" ] || [ "$1" = "catimg" ]; then
[ -d "$target" ] && exit_prompt "$1 can only display a single image"
mime="$(file -bL --mime-type -- "$target")"
case "$mime" in
audio/*) ffmpeg -i "$target" "$NNN_PREVIEWDIR$target.jpg" -y >/dev/null 2>&1
ret="$NNN_PREVIEWDIR/$target.jpg" ;;
video/*) ffmpegthumbnailer -i "$target" -o "$NNN_PREVIEWDIR$target.jpg" 2> /dev/null
ret="$NNN_PREVIEWDIR/$target.jpg" ;;
*) ret="$target" ;;
esac
fi
for file in "$dir"/*; do
if [ ! -f "$NNN_PREVIEWDIR$file.jpg" ]; then
case "$(file -bL --mime-type -- "$file")" in
audio/*) [ "$1" != "sxiv" ] &&
ffmpeg -i "$file" "$NNN_PREVIEWDIR$file.jpg" -y >/dev/null 2>&1 ;;
video/*) [ "$1" != "ucollage" ] &&
ffmpegthumbnailer -i "$file" -o "$NNN_PREVIEWDIR$file.jpg" 2> /dev/null ;;
esac
fi
done
for file in "$NNN_PREVIEWDIR$dir"/*; do
filename="$(basename "$file" .jpg)"
[ ! -e "$dir/$filename" ] && rm -- "$file" 2>/dev/null
done
}
listimages() {
find -L "$dir" "$NNN_PREVIEWDIR$dir" -maxdepth 1 -type f -print0 2>/dev/null | sort -z
}
view_files() {
[ -f "$target" ] && count="-n $(listimages | grep -a -m 1 -ZznF "$target" | cut -d: -f1)"
case "$1" in
nsxiv) listimages | xargs -0 nsxiv -a "${count:--t}" -- ;;
sxiv) listimages | xargs -0 sxiv -a "${count:--t}" -- ;;
imv*) listimages | xargs -0 "$1" "${count:-}" -- ;;
esac
}
target="$(readlink -f "$1")"
[ -d "$target" ] && dir="$target" || dir="${target%/*}"
if uname | grep -q "Darwin"; then
[ -f "$1" ] && open "$1" >/dev/null 2>&1 &
elif type lsix >/dev/null 2>&1; then
if [ -d "$target" ]; then
cd "$target" || exit_prompt
fi
make_thumbs lsix
clear
lsix
cd "$NNN_PREVIEWDIR$dir" && lsix
exit_prompt
elif type ucollage >/dev/null 2>&1; then
type ffmpeg >/dev/null 2>&1 && make_thumbs ucollage
UCOLLAGE_EXPAND_DIRS=1 ucollage "$dir" "$NNN_PREVIEWDIR$dir" || exit_prompt
elif type sxiv >/dev/null 2>&1; then
type ffmpegthumbnailer >/dev/null 2>&1 && make_thumbs sxiv
view_files sxiv >/dev/null 2>&1 &
elif type nsxiv >/dev/null 2>&1; then
type ffmpegthumbnailer >/dev/null 2>&1 && make_thumbs sxiv
view_files nsxiv >/dev/null 2>&1 &
elif type imv >/dev/null 2>&1; then
make_thumbs imv
view_files imv >/dev/null 2>&1 &
elif type imvr >/dev/null 2>&1; then
make_thumbs imv
view_files imvr >/dev/null 2>&1 &
elif type viu >/dev/null 2>&1; then
clear
make_thumbs viu
viu -n "$ret"
exit_prompt
elif type catimg >/dev/null 2>&1; then
make_thumbs catimg
catimg "$ret"
exit_prompt
else
exit_prompt "Please install sxiv/nsxiv/imv/viu/catimg/lsix."
fi

13
plugins/ipinfo Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env sh
# Description: Shows the external IP address and whois information. Useful over VPNs.
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
IP=$(curl -s ifconfig.me)
whois "$IP"
echo your external IP address is "$IP"
read -r _

66
plugins/kdeconnect Executable file
View File

@ -0,0 +1,66 @@
#!/usr/bin/env sh
# Description: Send files or folders to your Android device using kdeconnect-cli.
# kdeconnect must be configured on the Android device and the PC.
#
# Usage:
# - Hover over a file or a folder and call the plugin.
# - Alternatively, select the files and folders you would like to send, and activate the plugin.
#
# Shell: POSIX compliant
# Author: juacq97, raffaem, N-R-K
# If you want system notification, put this equal to 1
notify=0
note() {
if [ $notify = 1 ]; then
notify-send -a "Kdeconnect" "$1"
else
echo "[Kdeconnect] $1"
fi
}
# kdeconnect doesn't cope with non-files
filter_files() {
xargs -0 -I{} sh -c '
if [ -f "{}" ]; then
printf "%s\0" "{}";
else
printf "Error: not a regular file: %s\n" "{}" >&2;
fi;'
}
send() {
filter_files | xargs -0 -I{} kdeconnect-cli --name "$devname" --share {}
note "Files sent"
}
# Select paired device
names=$(kdeconnect-cli --list-available --name-only 2>/dev/null)
if [ -z "$names" ]; then
note "No devices paired and available"
exit
fi
ndevs=$(printf "%s" "$names" | awk 'END{print NR}')
if [ "$ndevs" -eq 1 ]; then
devname="$names"
else
printf "%s" "$names" | awk '{ print NR ". " $0 }'
printf "Pick a device: "
read -r pick
if [ -n "$pick" ] && [ "$pick" -eq "$pick" ]; then
devname=$(printf '%s' "$names" | awk "NR==$pick")
fi
fi
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
if [ -s "$selection" ]; then
send < "$selection"
[ -p "$NNN_PIPE" ] && printf "-" > "$NNN_PIPE" # clear selection
elif [ -n "$1" ]; then
printf "%s" "$1" | send
else
note "No selection and no hovered file"
fi

42
plugins/launch Executable file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env sh
# Description: Independent POSIX-compliant GUI application launcher.
# Fuzzy find executables in $PATH and launch an application.
# stdin, stdout, stderr are suppressed so CLI tools exit silently.
#
# To configure launch as an independent app launcher add a keybind
# to open launch in a terminal e.g.,
#
# xfce4-terminal -e "${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/launch
#
# Dependencies: fzf
#
# Usage: launch [delay]
# delay is in seconds, if omitted launch waits for 1 sec
#
# Integration with nnn: launch is installed with other plugins, nnn picks it up.
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
# shellcheck disable=SC2086
IFS=':'
get_selection() {
if type fzf >/dev/null 2>&1; then
{ IFS=':'; ls -H $PATH; } | sort | fzf
else
exit 1
fi
}
if selection=$( get_selection ); then
setsid "$selection" 2>/dev/null 1>/dev/null &
if [ -n "$1" ]; then
sleep "$1"
else
sleep 1
fi
fi

23
plugins/mimelist Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env sh
# Description: Find and list files by mime type in smart context
#
# Dependencies:
# - file
# - mimetype (optional, PERL File MimeInfo)
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana, Michel DHOOGE
# shellcheck disable=SC1090,SC1091
. "$(dirname "$0")"/.nnn-plugin-helper
printf "mime (e.g., video/audio/image): "
read -r mime
printf "%s" "+l" > "$NNN_PIPE"
if type mimetype >/dev/null 2>&1; then
find . | mimetype -f - | grep "$mime" | awk -F: '{printf "%s%c", $1, 0}' > "$NNN_PIPE"
else
find . | file -if- | grep "$mime" | awk -F: '{printf "%s%c", $1, 0}' > "$NNN_PIPE"
fi

40
plugins/moclyrics Executable file
View File

@ -0,0 +1,40 @@
#!/usr/bin/env sh
# Description: Fetches the lyrics of the track currently playing in MOC
#
# Dependencies: ddgr (https://github.com/jarun/ddgr)
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
# Check if MOC server is running
cmd=$(pgrep -x mocp 2>/dev/null)
ret=$cmd
if [ -z "$ret" ]; then
exit
fi
# Grab the output
out="$(mocp -i)"
# Check if anything is playing
state=$(echo "$out" | grep "State:" | cut -d' ' -f2)
if ! [ "$state" = 'PLAY' ]; then
exit
fi
# Try by Artist and Song Title first
ARTIST="$(echo "$out" | grep 'Artist:' | cut -d':' -f2 | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')"
TITLE="$(echo "$out" | grep 'SongTitle:' | cut -d':' -f2 | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//')"
if [ -n "$ARTIST" ] && [ -n "$TITLE" ]; then
ddgr -w azlyrics.com --ducky "$ARTIST" "$TITLE"
else
# Try by file name
FILENAME="$(basename "$(echo "$out" | grep 'File:' | cut -d':' -f2)")"
FILENAME="$(echo "${FILENAME%%.*}" | tr -d -)"
if [ -n "$FILENAME" ]; then
ddgr -w azlyrics.com --ducky "$FILENAME"
fi
fi

89
plugins/mocq Executable file
View File

@ -0,0 +1,89 @@
#!/usr/bin/env sh
# Description: Appends and optionally plays music in MOC
#
# Notes:
# - if selection is available, plays it, else plays the current file or directory
# - appends tracks and exits is MOC is running, else clears playlist and adds tracks
# - to let mocp shuffle tracks, set SHUFFLE=1
#
# Shell: POSIX compliant
# Authors: Arun Prakash Jana, ath3
IFS="$(printf '\n\r')"
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
cmd=$(pgrep -x mocp 2>/dev/null)
ret=$cmd
SHUFFLE="${SHUFFLE:-0}"
mocp_add ()
{
if [ "$SHUFFLE" = 1 ]; then
if [ "$resp" = "y" ]; then
arr=$(tr '\0' '\n' < "$selection")
elif [ -n "$1" ]; then
arr="$1"
fi
for entry in $arr
do
if [ -d "$entry" ]; then
arr2=$arr2$(find "$entry" -type f \( ! -iname "*.m3u" ! -iname "*.pls" \))
elif echo "$entry" | grep -qv '\.m3u$\|\.pls$' ; then
arr2=$(printf "%s\n%s" "$entry" "$arr2")
fi
done
mocp -o shuffle
echo "$arr2" | xargs -d "\n" mocp -a
else
if [ "$resp" = "y" ]; then
xargs < "$selection" -0 mocp -a
else
mocp -a "$1"
fi
fi
}
if [ ! -s "$selection" ] && [ -z "$1" ]; then
exit
fi
if [ "$2" = "opener" ]; then
:
elif [ -s "$selection" ]; then
printf "Work with selection? Enter 'y' to confirm: "
read -r resp
fi
if [ -z "$ret" ]; then
# mocp not running
mocp -S
else
# mocp running, check if it's playing
state=$(mocp -i | grep "State:" | cut -d' ' -f2)
if [ "$state" = 'PLAY' ]; then
# add to playlist and exit
mocp_add "$1"
# uncomment the line below to show mocp interface after appending
# mocp
exit
fi
fi
# clear selection and play
mocp -c
mocp_add "$1" "$resp"
mocp -p
# uncomment the line below to show mocp interface after appending
# mocp
# Clear selection
if [ "$resp" = "y" ] && [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi

41
plugins/mp3conv Executable file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env sh
# Description: Extract audio from multimedia files and convert to mp3
#
# Dependencies: ffmpeg compiled with libmp3lame audio codec support
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
outdir=_mp3files
handle_multimedia() {
mime="${1}"
file="${2}"
case "${mime}" in
audio/* | video/*)
ffmpeg -i "${file}" -vn -codec:a libmp3lame -q:a 2 "${outdir}/${file%.*}.mp3"
;;
*)
;;
esac
}
printf "Process 'a'll in directory or 'c'urrent? "
read -r resp
if [ "$resp" = "a" ]; then
if ! [ -e "${outdir}" ]; then
mkdir "${outdir}"
fi
for f in *; do
if [ -f "${f}" ]; then
mimestr="$( file --dereference --brief --mime-type -- "${f}" )"
handle_multimedia "${mimestr}" "${f}"
fi
done
elif [ "$resp" = "c" ] && [ -f "$1" ]; then
ffmpeg -i "${1}" -vn -codec:a libmp3lame -q:a 2 "${1%.*}.mp3"
fi

76
plugins/mtpmount Executable file
View File

@ -0,0 +1,76 @@
#!/usr/bin/env sh
# Description: Toggle mount of MTP device (eg. Android device)
# 'l' to list mountable devices
# 'n' integer associated to device to mount
# 'q'/'Return' exit
#
# Dependencies: gvfs-mtp
#
# Notes: The MTP device should be mounted at /run/user/$UID/gvfs.
# Put /run/user/$UID/gvfs to bookmark entries (NNN_BMS) for faster access.
# Make sure the device is unlocked when mounting.
#
# When doing copy-paste into MTP device, you will get an error like this:
# cp: preserving times for './gambar1.png': Operation not supported
# That just means the file is copied but timestamp won't be preserved.
# It's like doing `cp -p localfile.txt file-to-SMB.txt`.
#
# Shell: POSIX compliant
# Author: Benawi Adha
prompt="Device number ('l' to list): "
IFS='
'
lsmtp () {
devs=$(gio mount -li | grep -e 'activation_root' | sed 's/\s*activation_root=//g')
c=1
printf "Devices list:\n"
for i in $devs; do
printf "%s %s\\n" "$c" "$i"
c=$(( c + 1 ))
done
echo
}
lsmtp
printf "%s" "$prompt"
read -r input
while [ -n "$input" ]
do
if [ "$input" = "l" ]; then
lsmtp
elif [ "$input" = "q" ] || [ "$input" -eq 0 ]; then
exit
elif [ "$input" -le "$(printf '%s\n' "${devs}" | grep -c '^')" ]; then
# dev=$(printf "%s\n" "$devs" | cut -d$'\n' -f${input})
c=1
for i in $devs; do
dev=$i
if [ "$input" -eq $c ]; then
break
fi
c=$(( c + 1 ))
done
if (gio mount -l | grep '^Mount([1-9]).*'"$dev" ) 1>/dev/null; then
if gio mount -u "${dev}"; then
printf "%s unmounted\n" "$dev"
fi
else
if gio mount "${dev}"; then
printf "%s mounted to /run/user/\$UID/gvfs\n" "$dev"
fi
fi
echo
else
printf "Invalid input\n"
fi
printf "%s" "$prompt"
read -r input
done

75
plugins/nbak Executable file
View File

@ -0,0 +1,75 @@
#!/usr/bin/env sh
# Description: Backup nnn configuration
# - config dir content
# - environment config
# - shell functions and aliases
#
# Shell: POSIX compliant
# Author: Léo Villeveygoux
nnn_aliases="n nnn"
outdir="nnn-$(whoami)@$(hostname)"
outfile="${outdir}.tar.bz2"
shellname="$(basename "$SHELL")"
conffile="config.txt"
configdir="${XDG_CONFIG_HOME:-$HOME/.config}/nnn"
workdir="$PWD"
tempdir="$(mktemp -d)"
mkdir "$tempdir/$outdir"
if [ ! -d "$tempdir" ]; then
echo "Can't create work directory." >&2
exit 1
fi
cd "$tempdir/$outdir" || exit 1
# Backing up config dir content
cp -r -- "$configdir" . || exit 1
# Environment config
env | sed "s/'/'\\\\''/" |\
awk '/^NNN_/{print "export '\''"$0"'\''"}' > "$conffile"
# Shell functions/aliases
case "$shellname" in
bash)
for name in $nnn_aliases ; do
if [ "$(bash -ic "type -t $name")" = "function" ] ; then
bash -ic "type $name" | tail -n+2 >> "$conffile"
elif bash -ic "alias $name" >/dev/null 2>&1 ; then
bash -ic "alias $name" >> "$conffile"
fi
done
;;
zsh)
for name in $nnn_aliases ; do
if zsh -ic "functions $name" ; then
zsh -ic "functions $name" >> "$conffile"
elif zsh -ic "alias $name" ; then
echo alias "$(zsh -ic "alias $name")" >> "$conffile"
fi
done
;;
*)
echo "Unknown shell, skipping alias/function checking." >&2
;;
esac
cd .. || exit 1
printf "Saving as '%s' ... " "$workdir/$outfile"
tar caf "$workdir/$outfile" "$outdir" && echo "Done" || echo "Failed"
cd "$workdir" && rm -rf -- "$tempdir"

88
plugins/nmount Executable file
View File

@ -0,0 +1,88 @@
#!/usr/bin/env sh
# Description: Toggle mount status of a device using pmount
# If the device is not mounted, it will be mounted.
# If the device is mounted, it will be unmounted and powered down.
#
# Dependencies: lsblk, pmount (optional), udisks2
#
# Usage: Runs `lsblk` on 'l', exits on 'Return`.
#
# Notes:
# - The script uses Linux-specific lsblk to list block devices. Alternatives:
# macOS: "diskutil list"
# BSD: "geom disk list"
# - The script uses udisksctl (from udisks2) to power down devices. This is also Linux-specific.
# Users on non-Linux platforms can comment it and use an alternative to power-down disks.
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
prompt="device name [e.g. sdXn] ('l'ist, 'q'uit): "
lsblk
printf "\nEnsure you aren't still in the mounted device.\n"
printf "%s" "$prompt"
read -r dev
while [ -n "$dev" ]; do
if [ "$dev" = "l" ]; then
lsblk
elif [ "$dev" = "q" ]; then
exit
else
# LUKS volumes mounted with udisksctl appear differently than with pmount
if grep -qs "$dev " /proc/mounts || [ -n "$(lsblk -n "/dev/$dev" -o MOUNTPOINT)" ]; then
sync "$(lsblk -n "/dev/$dev" -o MOUNTPOINT | sed "/^$/d")"
if type pumount >/dev/null 2>&1; then
pumount "/dev/$dev"
exit_code="$?"
else
# Unlike pmount, udisksctl does not transparently handle LUKS volumes
# We need to manually get the unlocked device, unmount it, and then lock the volume
if lsblk -n "/dev/$dev" -o FSTYPE | grep "crypto_LUKS" >/dev/null; then
dev_map="$(udisksctl info -b /dev/"$dev" | grep "CleartextDevice" | grep -o "dm_2d[[:digit:]]*" | sed "s/_2d/-/")"
udisksctl unmount -b "/dev/$dev_map" --no-user-interaction >/dev/null
exit_code="$?"
udisksctl lock -b "/dev/$dev" --no-user-interaction >/dev/null
else
udisksctl unmount -b "/dev/$dev" --no-user-interaction >/dev/null
exit_code="$?"
fi
fi
if [ $exit_code -eq 0 ]; then
echo "/dev/$dev unmounted."
if udisksctl power-off -b "/dev/$dev" --no-user-interaction; then
echo "/dev/$dev ejected."
fi
fi
elif [ -b "/dev/$dev" ]; then
if type pmount >/dev/null 2>&1; then
pmount "/dev/$dev"
exit_code="$?"
else
# Unlike pmount, udisksctl does not transparently handle LUKS volumes
# We need to manually get the unlocked device and mount that instead of the volume itself
if [ "$(lsblk "/dev/$dev" -n -o FSTYPE)" = "crypto_LUKS" ]; then
dev_map=$(udisksctl unlock -b "/dev/$dev" --no-user-interaction | grep -o "dm-[[:digit:]]*")
udisksctl mount -b "/dev/$dev_map" --no-user-interaction >/dev/null
exit_code="$?"
else
udisksctl mount -b "/dev/$dev" --no-user-interaction >/dev/null
exit_code="$?"
fi
fi
if [ $exit_code -eq 0 ]; then
sleep 1
echo "/dev/$dev mounted to $(lsblk -n "/dev/$dev" -o MOUNTPOINT | sed "/^$/d")."
fi
else
echo "/dev/$dev does not exist or is not a block device."
fi
fi
echo
printf "%s" "$prompt"
read -r dev
done

555
plugins/nuke Executable file
View File

@ -0,0 +1,555 @@
#!/usr/bin/env sh
# Description: Sample script to play files in apps by file type or mime
#
# Shell: POSIX compliant
# Usage: nuke filepath
#
# Integration with nnn:
# 1. Export the required config:
# export NNN_OPENER=/absolute/path/to/nuke
# # Otherwise, if nuke is in $PATH
# # export NNN_OPENER=nuke
# 2. Run nnn with the program option to indicate a CLI opener
# nnn -c
# # The -c program option overrides option -e
# 3. nuke can use nnn plugins (e.g. mocq is used for audio), $PATH is updated.
#
# Details:
# Inspired by ranger's scope.sh, modified for usage with nnn.
#
# Guards against accidentally opening mime types like executables, shared libs etc.
#
# Tries to play 'file' (1st argument) in the following order:
# 1. by extension
# 2. by mime (image, video, audio, pdf)
# 3. by mime (other file types)
# 4. by mime (prompt and run executables)
#
# Modification tips:
# 1. Invokes CLI utilities by default. Set GUI to 1 to enable GUI apps.
# 2. PAGER is "less -R".
# 3. Start GUI apps in bg to unblock. Redirect stdout and strerr if required.
# 4. Some CLI utilities are piped to the $PAGER, to wait and quit uniformly.
# 5. If the output cannot be paged use "read -r _" to wait for user input.
# 6. On a DE, try 'xdg-open' or 'open' in handle_fallback() as last resort.
#
# Feel free to change the utilities to your favourites and add more mimes.
#
# Defaults:
# By extension (only the enabled ones):
# most archives: list with atool, bsdtar
# rar: list with unrar
# 7-zip: list with 7z
# pdf: zathura (GUI), pdftotext, mutool, exiftool
# audio: mocq (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool
# avi|mkv|mp4: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool
# log: vi
# torrent: rtorrent, transmission-show
# odt|ods|odp|sxw: odt2txt
# md: glow (https://github.com/charmbracelet/glow), lowdown (https://kristaps.bsd.lv/lowdown)
# htm|html|xhtml: w3m, lynx, elinks
# json: jq, python (json.tool module)
# Multimedia by mime:
# image/*: imv/sxiv/nsxiv (GUI), viu (https://github.com/atanunq/viu), img2txt, exiftool
# video/*: smplayer, mpv (GUI), ffmpegthumbnailer, mediainfo, exiftool
# audio/*: mocq (nnn plugin using MOC), mpv, media_client (Haiku), mediainfo, exiftool
# application/pdf: zathura (GUI), pdftotext, mutool, exiftool
# Other mimes:
# text/troff: man -l
# text/* | */xml: vi
# image/vnd.djvu): djvutxt, exiftool
#
# TODO:
# 1. Adapt, test and enable all mimes
# 2. Clean-up the unnecessary exit codes
# set to 1 to enable GUI apps and/or BIN execution
GUI="${GUI:-0}"
BIN="${BIN:-0}"
set -euf -o noclobber -o noglob -o nounset
IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" # protect trailing \n
PATH=$PATH:"${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins"
IMAGE_CACHE_PATH="$(dirname "$1")"/.thumbs
FPATH="$1"
FNAME=$(basename "$1")
EDITOR="${VISUAL:-${EDITOR:-vi}}"
PAGER="${PAGER:-less -R}"
ext="${FNAME##*.}"
if [ -n "$ext" ]; then
ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')"
fi
is_mac() {
uname | grep -q "Darwin"
}
handle_pdf() {
if [ "$GUI" -ne 0 ]; then
if is_mac; then
nohup open "${FPATH}" >/dev/null 2>&1 &
elif type zathura >/dev/null 2>&1; then
nohup zathura "${FPATH}" >/dev/null 2>&1 &
else
return
fi
elif type pdftotext >/dev/null 2>&1; then
## Preview as text conversion
pdftotext -l 10 -nopgbrk -q -- "${FPATH}" - | eval "$PAGER"
elif type mutool >/dev/null 2>&1; then
mutool draw -F txt -i -- "${FPATH}" 1-10 | eval "$PAGER"
elif type exiftool >/dev/null 2>&1; then
exiftool "${FPATH}" | eval "$PAGER"
else
return
fi
exit 0
}
handle_audio() {
if type mocp >/dev/null 2>&1 && type mocq >/dev/null 2>&1; then
mocq "${FPATH}" "opener" >/dev/null 2>&1
elif type mpv >/dev/null 2>&1; then
mpv "${FPATH}" >/dev/null 2>&1 &
elif type media_client >/dev/null 2>&1; then
media_client play "${FPATH}" >/dev/null 2>&1 &
elif type mediainfo >/dev/null 2>&1; then
mediainfo "${FPATH}" | eval "$PAGER"
elif type exiftool >/dev/null 2>&1; then
exiftool "${FPATH}"| eval "$PAGER"
else
return
fi
exit 0
}
handle_video() {
if [ "$GUI" -ne 0 ]; then
if is_mac; then
nohup open "${FPATH}" >/dev/null 2>&1 &
elif type smplayer >/dev/null 2>&1; then
nohup smplayer "${FPATH}" >/dev/null 2>&1 &
elif type mpv >/dev/null 2>&1; then
nohup mpv "${FPATH}" >/dev/null 2>&1 &
else
return
fi
elif type ffmpegthumbnailer >/dev/null 2>&1; then
# Thumbnail
[ -d "${IMAGE_CACHE_PATH}" ] || mkdir "${IMAGE_CACHE_PATH}"
ffmpegthumbnailer -i "${FPATH}" -o "${IMAGE_CACHE_PATH}/${FNAME}.jpg" -s 0
viu -n "${IMAGE_CACHE_PATH}/${FNAME}.jpg" | eval "$PAGER"
elif type mediainfo >/dev/null 2>&1; then
mediainfo "${FPATH}" | eval "$PAGER"
elif type exiftool >/dev/null 2>&1; then
exiftool "${FPATH}"| eval "$PAGER"
else
return
fi
exit 0
}
# handle this extension and exit
handle_extension() {
case "${ext}" in
## Archive
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
if type atool >/dev/null 2>&1; then
atool --list -- "${FPATH}" | eval "$PAGER"
exit 0
elif type bsdtar >/dev/null 2>&1; then
bsdtar --list --file "${FPATH}" | eval "$PAGER"
exit 0
fi
exit 1;;
rar)
if type unrar >/dev/null 2>&1; then
## Avoid password prompt by providing empty password
unrar lt -p- -- "${FPATH}" | eval "$PAGER"
fi
exit 1;;
7z)
if type 7z >/dev/null 2>&1; then
## Avoid password prompt by providing empty password
7z l -p -- "${FPATH}" | eval "$PAGER"
exit 0
fi
exit 1;;
## PDF
pdf)
handle_pdf
exit 1;;
## Audio
aac|flac|m4a|mid|midi|mpa|mp2|mp3|ogg|wav|wma)
handle_audio
exit 1;;
## Video
avi|mkv|mp4)
handle_video
exit 1;;
## Log files
log)
"$EDITOR" "${FPATH}"
exit 0;;
## BitTorrent
torrent)
if type rtorrent >/dev/null 2>&1; then
rtorrent "${FPATH}"
exit 0
elif type transmission-show >/dev/null 2>&1; then
transmission-show -- "${FPATH}"
exit 0
fi
exit 1;;
## OpenDocument
odt|ods|odp|sxw)
if type odt2txt >/dev/null 2>&1; then
## Preview as text conversion
odt2txt "${FPATH}" | eval "$PAGER"
exit 0
fi
exit 1;;
## Markdown
md)
if type glow >/dev/null 2>&1; then
glow -sdark "${FPATH}" | eval "$PAGER"
exit 0
elif type lowdown >/dev/null 2>&1; then
lowdown -Tterm "${FPATH}" | eval "$PAGER"
exit 0
fi
;;
## HTML
htm|html|xhtml)
## Preview as text conversion
if type w3m >/dev/null 2>&1; then
w3m -dump "${FPATH}" | eval "$PAGER"
exit 0
elif type lynx >/dev/null 2>&1; then
lynx -dump -- "${FPATH}" | eval "$PAGER"
exit 0
elif type elinks >/dev/null 2>&1; then
elinks -dump "${FPATH}" | eval "$PAGER"
exit 0
fi
;;
## JSON
json)
if type jq >/dev/null 2>&1; then
jq --color-output . "${FPATH}" | eval "$PAGER"
exit 0
elif type python >/dev/null 2>&1; then
python -m json.tool -- "${FPATH}" | eval "$PAGER"
exit 0
fi
;;
esac
}
# sets the variable abs_target, this should be faster than calling printf
abspath() {
case "$1" in
/*) abs_target="$1";;
*) abs_target="$PWD/$1";;
esac
}
# storing the result to a tmp file is faster than calling listimages twice
listimages() {
find -L "///${1%/*}" -maxdepth 1 -type f -print0 |
grep -izZE '\.(jpe?g|png|gif|webp|tiff|bmp|ico|svg)$' |
sort -zV | tee "$tmp"
}
load_dir() {
abspath "$2"
tmp="${TMPDIR:-/tmp}/nuke_$$"
trap 'rm -f -- "$tmp"' EXIT
count="$(listimages "$abs_target" | grep -a -m 1 -ZznF "$abs_target" | cut -d: -f1)"
if [ -n "$count" ]; then
if [ "$GUI" -ne 0 ]; then
xargs -0 nohup "$1" -n "$count" -- < "$tmp"
else
xargs -0 "$1" -n "$count" -- < "$tmp"
fi
else
shift
"$1" -- "$@" # fallback
fi
}
handle_multimedia() {
## Size of the preview if there are multiple options or it has to be
## rendered from vector graphics. If the conversion program allows
## specifying only one dimension while keeping the aspect ratio, the width
## will be used.
# local DEFAULT_SIZE="1920x1080"
mimetype="${1}"
case "${mimetype}" in
## SVG
# image/svg+xml|image/svg)
# convert -- "${FPATH}" "${IMAGE_CACHE_PATH}" && exit 6
# exit 1;;
## DjVu
# image/vnd.djvu)
# ddjvu -format=tiff -quality=90 -page=1 -size="${DEFAULT_SIZE}" \
# - "${IMAGE_CACHE_PATH}" < "${FPATH}" \
# && exit 6 || exit 1;;
## Image
image/*)
if [ "$GUI" -ne 0 ]; then
if is_mac; then
nohup open "${FPATH}" >/dev/null 2>&1 &
exit 0
elif type imv >/dev/null 2>&1; then
load_dir imv "${FPATH}" >/dev/null 2>&1 &
exit 0
elif type imvr >/dev/null 2>&1; then
load_dir imvr "${FPATH}" >/dev/null 2>&1 &
exit 0
elif type sxiv >/dev/null 2>&1; then
load_dir sxiv "${FPATH}" >/dev/null 2>&1 &
exit 0
elif type nsxiv >/dev/null 2>&1; then
load_dir nsxiv "${FPATH}" >/dev/null 2>&1 &
exit 0
fi
elif type viu >/dev/null 2>&1; then
viu -n "${FPATH}" | eval "$PAGER"
exit 0
elif type img2txt >/dev/null 2>&1; then
img2txt --gamma=0.6 -- "${FPATH}" | eval "$PAGER"
exit 0
elif type exiftool >/dev/null 2>&1; then
exiftool "${FPATH}" | eval "$PAGER"
exit 0
fi
# local orientation
# orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FPATH}" )"
## If orientation data is present and the image actually
## needs rotating ("1" means no rotation)...
# if [[ -n "$orientation" && "$orientation" != 1 ]]; then
## ...auto-rotate the image according to the EXIF data.
# convert -- "${FPATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
# fi
## `w3mimgdisplay` will be called for all images (unless overridden
## as above), but might fail for unsupported types.
exit 7;;
## PDF
application/pdf)
handle_pdf
exit 1;;
## Audio
audio/*)
handle_audio
exit 1;;
## Video
video/*)
handle_video
exit 1;;
# pdftoppm -f 1 -l 1 \
# -scale-to-x "${DEFAULT_SIZE%x*}" \
# -scale-to-y -1 \
# -singlefile \
# -jpeg -tiffcompression jpeg \
# -- "${FPATH}" "${IMAGE_CACHE_PATH%.*}" \
# && exit 6 || exit 1;;
## ePub, MOBI, FB2 (using Calibre)
# application/epub+zip|application/x-mobipocket-ebook|\
# application/x-fictionbook+xml)
# # ePub (using https://github.com/marianosimone/epub-thumbnailer)
# epub-thumbnailer "${FPATH}" "${IMAGE_CACHE_PATH}" \
# "${DEFAULT_SIZE%x*}" && exit 6
# ebook-meta --get-cover="${IMAGE_CACHE_PATH}" -- "${FPATH}" \
# >/dev/null && exit 6
# exit 1;;
## Font
# application/font*|application/*opentype)
# preview_png="/tmp/$(basename "${IMAGE_CACHE_PATH%.*}").png"
# if fontimage -o "${preview_png}" \
# --pixelsize "120" \
# --fontname \
# --pixelsize "80" \
# --text " ABCDEFGHIJKLMNOPQRSTUVWXYZ " \
# --text " abcdefghijklmnopqrstuvwxyz " \
# --text " 0123456789.:,;(*!?') ff fl fi ffi ffl " \
# --text " The quick brown fox jumps over the lazy dog. " \
# "${FPATH}";
# then
# convert -- "${preview_png}" "${IMAGE_CACHE_PATH}" \
# && rm -- "${preview_png}" \
# && exit 6
# else
# exit 1
# fi
# ;;
## Preview archives using the first image inside.
## (Very useful for comic book collections for example.)
# application/zip|application/x-rar|application/x-7z-compressed|\
# application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar)
# local fn=""; local fe=""
# local zip=""; local rar=""; local tar=""; local bsd=""
# case "${mimetype}" in
# application/zip) zip=1 ;;
# application/x-rar) rar=1 ;;
# application/x-7z-compressed) ;;
# *) tar=1 ;;
# esac
# { [ "$tar" ] && fn=$(tar --list --file "${FPATH}"); } || \
# { fn=$(bsdtar --list --file "${FPATH}") && bsd=1 && tar=""; } || \
# { [ "$rar" ] && fn=$(unrar lb -p- -- "${FPATH}"); } || \
# { [ "$zip" ] && fn=$(zipinfo -1 -- "${FPATH}"); } || return
#
# fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \
# [ print(l, end='') for l in sys.stdin if \
# (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\
# sort -V | head -n 1)
# [ "$fn" = "" ] && return
# [ "$bsd" ] && fn=$(printf '%b' "$fn")
#
# [ "$tar" ] && tar --extract --to-stdout \
# --file "${FPATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6
# fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g')
# [ "$bsd" ] && bsdtar --extract --to-stdout \
# --file "${FPATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6
# [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}"
# [ "$rar" ] && unrar p -p- -inul -- "${FPATH}" "$fn" > \
# "${IMAGE_CACHE_PATH}" && exit 6
# [ "$zip" ] && unzip -pP "" -- "${FPATH}" "$fe" > \
# "${IMAGE_CACHE_PATH}" && exit 6
# [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}"
# ;;
esac
}
handle_mime() {
mimetype="${1}"
case "${mimetype}" in
## Manpages
text/troff)
man -l "${FPATH}"
exit 0;;
## Text
text/* | */xml)
"$EDITOR" "${FPATH}"
exit 0;;
## Syntax highlight
# if [[ "$( stat --printf='%s' -- "${FPATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
# exit 2
# fi
# if [[ "$( tput colors )" -ge 256 ]]; then
# local pygmentize_format='terminal256'
# local highlight_format='xterm256'
# else
# local pygmentize_format='terminal'
# local highlight_format='ansi'
# fi
# env HIGHLIGHT_OPTIONS="${HIGHLIGHT_OPTIONS}" highlight \
# --out-format="${highlight_format}" \
# --force -- "${FPATH}" && exit 5
# pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}"\
# -- "${FPATH}" && exit 5
# exit 2;;
## DjVu
image/vnd.djvu)
if type djvutxt >/dev/null 2>&1; then
## Preview as text conversion (requires djvulibre)
djvutxt "${FPATH}" | eval "$PAGER"
exit 0
elif type exiftool >/dev/null 2>&1; then
exiftool "${FPATH}" | eval "$PAGER"
exit 0
fi
exit 1;;
esac
}
handle_fallback() {
if [ "$GUI" -ne 0 ]; then
if type xdg-open >/dev/null 2>&1; then
nohup xdg-open "${FPATH}" >/dev/null 2>&1 &
exit 0
elif type open >/dev/null 2>&1; then
nohup open "${FPATH}" >/dev/null 2>&1 &
exit 0
fi
fi
echo '----- File details -----' && file --dereference --brief -- "${FPATH}"
exit 1
}
handle_blocked() {
case "${MIMETYPE}" in
application/x-sharedlib)
exit 0;;
application/x-shared-library-la)
exit 0;;
application/x-executable)
exit 0;;
application/x-shellscript)
exit 0;;
application/octet-stream)
exit 0;;
esac
}
handle_bin() {
case "${MIMETYPE}" in
application/x-executable|application/x-shellscript)
clear
echo '-------- Executable File --------' && file --dereference --brief -- "${FPATH}"
printf "Run executable (y/N/'a'rgs)? "
read -r answer
case "$answer" in
[Yy]* ) exec "${FPATH}";;
[Aa]* )
printf "args: "
read -r args
exec "${FPATH}" "$args";;
[Nn]* ) exit;;
esac
esac
}
MIMETYPE="$( file -bL --mime-type -- "${FPATH}" )"
handle_extension
handle_multimedia "${MIMETYPE}"
handle_mime "${MIMETYPE}"
[ "$BIN" -ne 0 ] && [ -x "${FPATH}" ] && handle_bin
handle_blocked "${MIMETYPE}"
handle_fallback
exit 1

16
plugins/oldbigfile Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env sh
# Description: List files bigger than input size by ascending access date.
#
# Dependencies: find sort
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
printf "Min file size (MB): "
read -r size
find . -size +"$size"M -type f -printf '%A+ %s %p\n' | sort
echo "Press any key to exit"
read -r _

49
plugins/openall Executable file
View File

@ -0,0 +1,49 @@
#!/usr/bin/env bash
# Description: Open selected files in nuke one by one or in oneshot
#
# Notes: 1. Opens the hovered file if the selection is empty
# 2. nuke is the default, set OPENER below for custom
# 3. Opener is invoked once for each file in a loop
# 4. Keep pressing "Enter" to open files one by one
#
# Shell: bash
# Author: Arun Prakash Jana
sel=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
OPENER="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
if [ -s "$sel" ]; then
targets=()
while IFS= read -r -d '' entry || [ -n "$entry" ]; do
targets+=( "$entry" )
done < "$sel"
elements=${#targets[@]}
if (( elements == 1 )); then
# If there's only one file selected, open without prompts
"$OPENER" "${targets[0]}"
else
printf "open [A]ll? "
read -r all
for ((index=0; index <= ${#targets[@]}; index++)); do
"$OPENER" "${targets[index]}"
if [ "$all" != "A" ] && (( index+1 < elements )); then
printf "press Enter to open '%s'\n" "${targets[index+1]}"
read -r -s -n 1 key
if [[ $key != "" ]]; then
break
fi
fi
done
fi
# Clear selection
if [ -s "$sel" ] && [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi
elif [ -n "$1" ]; then
"$OPENER" "$1"
fi

62
plugins/organize Executable file
View File

@ -0,0 +1,62 @@
#!/usr/bin/env sh
# Description: Organize files in directories by category
#
# Note: This plugin clears the selection as it changes the contents of the current dir
#
# Shell: POSIX compliant
# Author: th3lusive
sel=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
organize() {
case "$(file -biL "$1")" in
*video*)
[ ! -d "Videos" ] && mkdir "Videos"
mv -- "$1" "Videos/$1"
printf "Moved %s to Videos\n" "$1" ;;
*audio*) [ ! -d "Audio" ] && mkdir "Audio"
mv -- "$1" "Audio/$1"
printf "Moved %s to Audio\n" "$1" ;;
*image*)
[ ! -d "Images" ] && mkdir "Images"
mv -- "$1" "Images/$1"
printf "Moved %s to Images\n" "$1" ;;
*pdf*|*document*|*epub*|*djvu*|*cb*)
[ ! -d "Documents" ] && mkdir "Documents"
mv -- "$1" "Documents/$1"
printf "Moved %s to Documents\n" "$1" ;;
*text*)
[ ! -d "Plaintext" ] && mkdir "Plaintext"
mv -- "$1" "Plaintext/$1"
printf "Moved %s to Plaintext\n" "$1" ;;
*tar*|*xz*|*compress*|*7z*|*rar*|*zip*)
[ ! -d "Archives" ] && mkdir "Archives"
mv -- "$1" "Archives/$1"
printf "Moved %s to Archives\n" "$1" ;;
*binary*)
[ ! -d "Binaries" ] && mkdir "Binaries"
mv -- "$1" "Binaries/$1"
printf "Moved %s to Binaries\n" "$1" ;;
esac
}
main() {
for file in *
do
[ -f "$file" ] && organize "$file"
done
# Clear selection
if [ -s "$sel" ] && [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi
}
main "$@"

30
plugins/pdfread Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env sh
# Description: Read a text or PDF file in British English
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
if [ -n "$1" ]; then
tmpf="$(basename "$1")"
tmpf="${TMPDIR:-/tmp}"/"${tmpf%.*}"
if [ "$(head -c 4 "$1")" = "%PDF" ]; then
# Convert using pdftotext
pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' > "$tmpf".txt
pico2wave -w "$tmpf".wav -l en-GB "$(tr '\n' ' ' < "$tmpf".txt)"
rm -- "$tmpf".txt
else
pico2wave -w "$tmpf".wav -l en-GB "$(tr '\n' ' ' < "$1")"
fi
# to jump around and note the time
mpv "$tmpf".wav
# flat read but better quality
# play -qV0 "$tmpf".wav treble 2 gain -l 2
rm -- "$tmpf".wav
fi

231
plugins/preview-tabbed Executable file
View File

@ -0,0 +1,231 @@
#!/usr/bin/env bash
# Description: tabbed/xembed based file previewer
#
# Dependencies:
# - tabbed (https://tools.suckless.org/tabbed): xembed host
# - xterm (or urxvt or st or alacritty) : xembed client for text-based preview
# - mpv (https://mpv.io): xembed client for video/audio
# - sxiv (https://github.com/muennich/sxiv) or,
# - nsxiv (https://codeberg.org/nsxiv/nsxiv) : xembed client for images
# - zathura (https://pwmt.org/projects/zathura): xembed client for PDF
# - nnn's nuke plugin for text preview and fallback
# nuke is a fallback for 'mpv', 'sxiv'/'nsxiv', and 'zathura', but has its
# own dependencies, see the script for more information
# - vim (or any editor/pager really)
# - file
# - mktemp
# - xdotool (optional, to keep main window focused)
#
# Usage:
# - Install the dependencies. Then set a NNN_FIFO
# and set a key for the plugin, then start `nnn`:
# $ NNN_FIFO=/tmp/nnn.fifo nnn
# - Launch the plugin with the designated key from nnn
#
# Notes:
# 1. This plugin needs a "NNN_FIFO" to work. See man.
# 2. If the same NNN_FIFO is used in multiple nnn instances, there will be one
# common preview window. With different FIFO paths, they will be independent.
# 3. This plugin only works on X, not on Wayland.
#
# How it works:
# We use `tabbed` [1] as a xembed [2] host, to have a single window
# owning each previewer window. So each previewer must be a xembed client.
# For text previewers, this is not an issue, as there are a lot of
# xembed-able terminal emulator (we default to `xterm`, but examples are
# provided for `urxvt` and `st`). For graphic preview this can be trickier,
# but a few popular viewers are xembed-able, we use:
# - `mpv`: multimedia player, for video/audio preview
# - `sxiv`/`nsxiv`: image viewer
# - `zathura`: PDF viewer
# - but we always fallback to `nuke` plugin
#
# [1]: https://tools.suckless.org/tabbed/
# [2]: https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html
#
# Shell: Bash (job control is weakly specified in POSIX)
# Author: Léo Villeveygoux
XDOTOOL_TIMEOUT=2
PAGER=${PAGER:-"vim -R"}
NUKE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
if [ -n "$WAYLAND_DISPLAY" ] ; then
echo "Wayland is not supported in preview-tabbed, this plugin could freeze your session!" >&2
exit 1
fi
if type xterm >/dev/null 2>&1 ; then
TERMINAL="xterm -into"
elif type urxvt >/dev/null 2>&1 ; then
TERMINAL="urxvt -embed"
elif type st >/dev/null 2>&1 ; then
TERMINAL="st -w"
elif type alacritty >/dev/null 2>&1 ; then
TERMINAL="alacritty --embed"
else
echo "No xembed term found" >&2
fi
if type xdg-user-dir >/dev/null 2>&1 ; then
PICTURES_DIR=$(xdg-user-dir PICTURES)
fi
term_nuke () {
# $1 -> $XID, $2 -> $FILE
$TERMINAL "$1" -e "$NUKE" "$2" &
}
start_tabbed () {
FIFO="$(mktemp -u)"
mkfifo "$FIFO"
tabbed > "$FIFO" &
jobs # Get rid of the "Completed" entries
TABBEDPID="$(jobs -p %%)"
if [ -z "$TABBEDPID" ] ; then
echo "Can't start tabbed"
exit 1
fi
read -r XID < "$FIFO"
rm -- "$FIFO"
}
get_viewer_pid () {
VIEWERPID="$(jobs -p %%)"
}
kill_viewer () {
if [ -n "$VIEWERPID" ] && jobs -p | grep "$VIEWERPID" ; then
kill "$VIEWERPID"
fi
}
sigint_kill () {
kill_viewer
kill "$TABBEDPID"
exit 0
}
previewer_loop () {
unset -v NNN_FIFO
# mute from now
exec >/dev/null 2>&1
MAINWINDOW="$(xdotool getactivewindow)"
start_tabbed
trap sigint_kill SIGINT
xdotool windowactivate "$MAINWINDOW"
# Bruteforce focus stealing prevention method,
# works well in floating window managers like XFCE
# but make interaction with the preview window harder
# (uncomment to use):
#xdotool behave "$XID" focus windowactivate "$MAINWINDOW" &
while read -r FILE ; do
jobs # Get rid of the "Completed" entries
if ! jobs | grep tabbed ; then
break
fi
if [ ! -e "$FILE" ] ; then
continue
fi
kill_viewer
MIME="$(file -bL --mime-type "$FILE")"
case "$MIME" in
video/*)
if type mpv >/dev/null 2>&1 ; then
mpv --force-window=immediate --loop-file --wid="$XID" "$FILE" &
else
term_nuke "$XID" "$FILE"
fi
;;
audio/*)
if type mpv >/dev/null 2>&1 ; then
mpv --force-window=immediate --loop-file --wid="$XID" "$FILE" &
else
term_nuke "$XID" "$FILE"
fi
;;
image/*)
if type sxiv >/dev/null 2>&1 ; then
sxiv -ae "$XID" "$FILE" &
elif type nsxiv >/dev/null 2>&1 ; then
nsxiv -ae "$XID" "$FILE" &
else
term_nuke "$XID" "$FILE"
fi
;;
application/pdf)
if type zathura >/dev/null 2>&1 ; then
zathura -e "$XID" "$FILE" &
else
term_nuke "$XID" "$FILE"
fi
;;
inode/directory)
if [[ -n $PICTURES_DIR && "$FILE" == "$PICTURES_DIR"* ]] ; then
if type sxiv >/dev/null 2>&1 ; then
sxiv -te "$XID" "$FILE" &
elif type nsxiv >/dev/null 2>&1 ; then
nsxiv -te "$XID" "$FILE" &
else
$TERMINAL "$XID" -e nnn "$FILE" &
fi
else
$TERMINAL "$XID" -e nnn "$FILE" &
fi
;;
text/*)
if [ -x "$NUKE" ] ; then
term_nuke "$XID" "$FILE"
else
# shellcheck disable=SC2086
$TERMINAL "$XID" -e $PAGER "$FILE" &
fi
;;
*)
if [ -x "$NUKE" ] ; then
term_nuke "$XID" "$FILE"
else
$TERMINAL "$XID" -e sh -c "file '$FILE' | $PAGER -" &
fi
;;
esac
get_viewer_pid
# following lines are not needed with the bruteforce xdotool method
ACTIVE_XID="$(xdotool getactivewindow)"
if [ $((ACTIVE_XID == XID)) -ne 0 ] ; then
xdotool windowactivate "$MAINWINDOW"
else
timeout "$XDOTOOL_TIMEOUT" xdotool behave "$XID" focus windowactivate "$MAINWINDOW" &
fi
done
kill "$TABBEDPID"
kill_viewer
}
if [ ! -r "$NNN_FIFO" ] ; then
echo "Can't read \$NNN_FIFO ('$NNN_FIFO')"
exit 1
fi
previewer_loop < "$NNN_FIFO" &
disown

538
plugins/preview-tui Executable file
View File

@ -0,0 +1,538 @@
#!/usr/bin/env bash
# Description: Terminal based file previewer
#
# Note: This plugin needs a "NNN_FIFO" to work. See man.
#
# Dependencies:
# - Supports 6 independent methods to preview with:
# - tmux (>=3.0), or
# - kitty with allow_remote_control and listen_on set in kitty.conf, or
# - wezterm (https://wezfurlong.org/wezterm), or
# - QuickLook on WSL (https://github.com/QL-Win/QuickLook), or
# - Windows Terminal (https://github.com/Microsoft/Terminal | https://aka.ms/terminal) with WSL, or
# - $NNN_TERMINAL set to a terminal (it's xterm by default).
# - less or $NNN_PAGER
# - tree or exa/eza or (GNU) ls
# - mediainfo or file
# - mktemp
# - unzip
# - tar
# - man
# - optional: bsdtar or atool for additional archive preview
# - optional: bat for code syntax highlighting
# - optional: ueberzug, kitty terminal, wezterm terminal, img2sixel, viu, catimg or chafa for images
# - optional: convert(ImageMagick) for playing gif preview (mandatory for kitty image previews)
# - optional: mpv for gif and video
# Also requires a terminal supporting the sixel (https://www.arewesixelyet.com/)
# or kitty (https://sw.kovidgoyal.net/kitty/graphics-protocol) video_output backends.
# Requires tmux compiled with `./configure --enable-sixel` if used.
# - optional: ffmpegthumbnailer for video thumbnails (https://github.com/dirkvdb/ffmpegthumbnailer)
# - optional: ffmpeg for audio thumbnails
# - optional: libreoffce for opendocument/officedocument preview
# - optional: pdftoppm(poppler) for pdf thumbnails
# - optional: gnome-epub-thumbnailer for epub thumbnails (https://gitlab.gnome.org/GNOME/gnome-epub-thumbnailer)
# - optional: fontpreview for font preview (https://github.com/sdushantha/fontpreview)
# - optional: djvulibre for djvu
# - optional: glow or lowdown for markdown
# - optional: w3m or lynx or elinks for html
# - optional: set/export NNN_ICONLOOKUP as 1 to enable file icons in front of directory previews with .iconlookup
# Icons and colors are configurable in .iconlookup
# - optional: scope.sh file viewer from ranger.
# 1. drop scope.sh executable in $PATH
# 2. set/export $NNN_SCOPE as 1
# - optional: pistol file viewer (https://github.com/doronbehar/pistol).
# 1. install pistol
# 2. set/export $NNN_PISTOL as 1
# - optional: librsvg for rsvg-convert
#
# Usage:
# You need to set a NNN_FIFO path and a key for the plugin with NNN_PLUG,
# then start `nnn`:
#
# $ nnn -a
#
# or
#
# $ NNN_FIFO=/tmp/nnn.fifo nnn
#
# Then launch the `preview-tui` plugin in `nnn`.
#
# If you provide the same NNN_FIFO to all nnn instances, there will be a
# single common preview window. If you provide different FIFO path (e.g.
# with -a), they will be independent.
#
# The previews will be shown in a tmux split. If that isn't possible, it
# will try to use a kitty terminal split. And as a final fallback, a
# different terminal window will be used ($NNN_TERMINAL).
#
# Kitty users need something similar to the following in their kitty.conf:
# - `allow_remote_control yes`
# - `listen_on unix:$TMPDIR/kitty`
# - `enabled_layouts splits` (optional)
# With ImageMagick installed, this terminal can use the icat kitten to display images.
# Refer to kitty documentation for further details.
#
# Users with both tmux and kitty can leverage image previews inside tmux with kitty's icat kitten
# - setup kitty as stated above
# - tmux >= v3.3a required
# - add the following to your tmux.conf:
# - `set -g allow-passthrough on`
#
# Wezterm should work out of the box. If `NNN_PREVIEWIMGPROG` is not specified it will use
# built in iTerm2 image protocol.
#
# Note that GNU ls is used for its `--group-directories-first` flag.
# On MacOS this may be installed with `brew install coreutils`, or the flag can be removed.
# iTerm2 users are recommended to use viu to view images without getting pixelated.
#
# Windows Terminal users can set "Profile termination behavior" under "Profile > Advanced" settings
# to automatically close pane on quit when exit code is 0.
#
# When specifying a different terminal, additional arguments are supported. In particular, you can
# append a specific title to the terminal and set it to "nofocus" in your WM config.
# E.g for alacritty and i3, you can set $NNN_TERMINAL to 'alacritty --title preview-tui' and add
# 'no_focus [title="preview-tui"]' to your i3 config file.
#
# Shell: Bash (for environment manipulation through arrays)
# Authors: Todd Yamakawa, Léo Villeveygoux, @Recidiviste, Mario Ortiz Manero, Luuk van Baal, @WanderLanz, @flipflop133
# Configurable environment variables:
NNN_SPLIT=${NNN_SPLIT:-} # permanent split direction
NNN_TERMINAL=${NNN_TERMINAL:-} # external terminal to be used
NNN_SPLITSIZE=${NNN_SPLITSIZE:-50} # previewer split size percentage
TMPDIR=${TMPDIR:-/tmp} # location of temporary files
ENVVARS=(
"NNN_SCOPE=${NNN_SCOPE:-0}" # use scope
"NNN_PISTOL=${NNN_PISTOL:-0}" # use pistol
"NNN_ICONLOOKUP=${NNN_ICONLOOKUP:-0}" # use .iconlookup
"NNN_PAGER=${NNN_PAGER:-less -P?n -R -C}" # pager options
"NNN_BATTHEME=${NNN_BATTHEME:-ansi}" # bat theme
"NNN_BATSTYLE=${NNN_BATSTYLE:-numbers}" # bat style
"NNN_PREVIEWWIDTH=${NNN_PREVIEWWIDTH:-1920}" # width of generated preview images
"NNN_PREVIEWHEIGHT=${NNN_PREVIEWHEIGHT:-1080}" # height of generated preview images
"NNN_PREVIEWDIR=${NNN_PREVIEWDIR:-$TMPDIR/nnn/previews}" # location of generated preview images
"NNN_PREVIEWIMGPROG=${NNN_PREVIEWIMGPROG:-}" # program used to preview images
"NNN_PREVIEWVIDEO=${NNN_PREVIEWVIDEO:-}" # mpv backend used to preview video
)
# Non-configurable environment variables
NNN_PARENT=${NNN_FIFO#*.}
[ "$NNN_PARENT" -eq "$NNN_PARENT" ] 2>/dev/null || NNN_PARENT="" # Make empty if non-numeric
ENVVARS+=(
"PWD=$PWD"
"PATH=$PATH"
"NNN_FIFO=$NNN_FIFO"
"FIFOPID=$TMPDIR/nnn-preview-tui-fifopid.$NNN_PARENT"
"FIFOPATH=$TMPDIR/nnn-preview-tui-fifo.$NNN_PARENT"
"PREVIEWPID=$TMPDIR/nnn-preview-tui-previewpid.$NNN_PARENT"
"CURSEL=$TMPDIR/nnn-preview-tui-selection.$NNN_PARENT"
"FIFO_UEBERZUG=$TMPDIR/nnn-preview-tui-ueberzug-fifo.$NNN_PARENT"
"POSOFFSET=$TMPDIR/nnn-preview-tui-posoffset"
)
trap '' PIPE
exists() { type "$1" >/dev/null 2>&1 ;}
pkill() { command pkill "$@" >/dev/null 2>&1 ;}
prompt() { clear; printf "%b" "$@"; cfg=$(stty -g); stty raw -echo; head -c 1; stty "$cfg" ;}
pidkill() {
if [ -f "$1" ]; then
PID="$(cat "$1" 2>/dev/null)" || return 1
kill "$PID" >/dev/null 2>&1
RET=$?
wait "$PID" 2>/dev/null
return $RET
fi
return 1
}
start_preview() {
if [ -e "${TMUX%%,*}" ] && tmux -V | grep -q '[ -][3456789]\.'; then
NNN_TERMINAL=tmux
exists mpv && tmux display -p '#{client_termfeatures}' | grep -q 'sixel' && ENVVARS+=("NNN_PREVIEWVIDEO=sixel")
elif [ -n "$KITTY_LISTEN_ON" ]; then
NNN_TERMINAL=kitty
exists mpv && ENVVARS+=("NNN_PREVIEWVIDEO=kitty")
elif [ -n "$WEZTERM_PANE" ]; then
NNN_TERMINAL=wezterm
exists mpv && ENVVARS+=("NNN_PREVIEWVIDEO=kitty")
elif [ -z "$NNN_TERMINAL" ] && [ "$TERM_PROGRAM" = "iTerm.app" ]; then
NNN_TERMINAL=iterm
exists mpv && ENVVARS+=("NNN_PREVIEWVIDEO=sixel")
elif [ -n "$WT_SESSION" ]; then
NNN_TERMINAL=winterm
else
NNN_TERMINAL="${NNN_TERMINAL:-xterm}"
fi
if [ -z "$NNN_SPLIT" ] && [ $(($(tput lines) * 2)) -gt "$(tput cols)" ]; then
NNN_SPLIT='h'
elif [ "$NNN_SPLIT" != 'h' ]; then
NNN_SPLIT='v'
fi
ENVVARS+=("NNN_TERMINAL=$NNN_TERMINAL" "NNN_SPLIT=$NNN_SPLIT" "QLPATH=$2" "PREVIEW_MODE=1")
case "$NNN_TERMINAL" in
iterm|winterm) # has to run in separate shell command: escape
ENVVARS=("${ENVVARS[@]/#/\\\"}")
ENVVARS=("${ENVVARS[@]/%/\\\"}")
command="$SHELL -c 'env ${ENVVARS[*]} \\\"$0\\\" \\\"$1\\\"'" ;;
esac
case "$NNN_TERMINAL" in
tmux) # tmux splits are inverted
ENVVARS=("${ENVVARS[@]/#/-e}")
if [ "$NNN_SPLIT" = "v" ]; then split="h"; else split="v"; fi
tmux split-window -l"$NNN_SPLITSIZE"% "${ENVVARS[@]}" -d"$split" -p"$NNN_SPLITSIZE" "$0" "$1" ;;
kitty) # Setting the layout for the new window. It will be restored after the script ends.
ENVVARS=("${ENVVARS[@]/#/--env=}")
kitty @ goto-layout splits
# Trying to use kitty's integrated window management as the split window.
kitty @ launch --no-response --title "preview-tui" --keep-focus \
--cwd "$PWD" "${ENVVARS[@]}" --location "${NNN_SPLIT}split" "$0" "$1" ;;
wezterm)
export "${ENVVARS[@]}"
if [ "$NNN_SPLIT" = "v" ]; then split="--horizontal"; else split="--bottom"; fi
wezterm cli split-pane --cwd "$PWD" $split --percent "$NNN_SPLITSIZE" "$0" "$1" >/dev/null
wezterm cli activate-pane-direction Prev ;;
iterm)
if [ "$NNN_SPLIT" = "h" ]; then split="horizontally"; else split="vertically"; fi
osascript <<-EOF
tell application "iTerm"
tell current session of current window
split $split with default profile command "$command"
end tell
end tell
EOF
;;
winterm)
if [ "$NNN_SPLIT" = "h" ]; then split="H"; else split="V"; fi
wt -w 0 sp -$split -s"0.$NNN_SPLITSIZE" "$command" \; -w 0 mf previous 2>/dev/null ;;
*) if [ -n "$2" ]; then
env "${ENVVARS[@]}" QUICKLOOK=1 "$0" "$1" &
else
# shellcheck disable=SC2086 # (allow arguments)
env "${ENVVARS[@]}" $NNN_TERMINAL -e "$0" "$1" &
fi ;;
esac
}
toggle_preview() {
export "${ENVVARS[@]}"
if exists QuickLook.exe; then
QLPATH="QuickLook.exe"
elif exists Bridge.exe; then
QLPATH="Bridge.exe"
fi
if pidkill "$FIFOPID"; then
[ -p "$NNN_PPIPE" ] && printf "0" > "$NNN_PPIPE"
pidkill "$PREVIEWPID"
pkill -f "tail --follow $FIFO_UEBERZUG"
if [ -n "$QLPATH" ] && stat "$1"; then
f="$(wslpath -w "$1")" && "$QLPATH" "$f" &
fi
else
[ -p "$NNN_PPIPE" ] && printf "1" > "$NNN_PPIPE"
start_preview "$1" "$QLPATH"
fi
}
fifo_pager() {
cmd="$1"
shift
# We use a FIFO to access $NNN_PAGER PID in jobs control
mkfifo "$FIFOPATH" || return
$NNN_PAGER < "$FIFOPATH" &
printf "%s" "$!" > "$PREVIEWPID"
(
exec > "$FIFOPATH"
if [ "$cmd" = "pager" ]; then
if exists bat; then
bat --terminal-width="$cols" --decorations=always --color=always \
--paging=never --style="$NNN_BATSTYLE" --theme="$NNN_BATTHEME" "$@" &
else
$NNN_PAGER "$@" &
fi
else
"$cmd" "$@" &
fi
)
rm -- "$FIFOPATH"
}
# Binary file: show file info inside the pager
print_bin_info() {
printf -- "-------- \033[1;31mBinary file\033[0m --------\n"
if exists mediainfo; then
mediainfo "$1"
else
file -b "$1"
fi
}
handle_mime() {
case "$2" in
image/jpeg) image_preview "$cols" "$lines" "$1" ;;
image/gif) generate_preview "$cols" "$lines" "$1" "gif" ;;
image/vnd.djvu) generate_preview "$cols" "$lines" "$1" "djvu" ;;
image/*) generate_preview "$cols" "$lines" "$1" "image" ;;
video/*) generate_preview "$cols" "$lines" "$1" "video" ;;
audio/*) generate_preview "$cols" "$lines" "$1" "audio" ;;
application/font*|application/*opentype|font/*) generate_preview "$cols" "$lines" "$1" "font" ;;
*/*office*|*/*document*|*/*msword|*/*ms-excel) generate_preview "$cols" "$lines" "$1" "office" ;;
application/zip) fifo_pager unzip -l "$1" ;;
text/troff)
if exists man; then
fifo_pager man -Pcat -l "$1"
else
fifo_pager pager "$1"
fi ;;
*) handle_ext "$1" "$3" "$4" ;;
esac
}
handle_ext() {
case "$2" in
epub) generate_preview "$cols" "$lines" "$1" "epub" ;;
pdf) generate_preview "$cols" "$lines" "$1" "pdf" ;;
gz|bz2) fifo_pager tar -tvf "$1" ;;
md) if exists glow; then
fifo_pager glow -s dark "$1"
elif exists lowdown; then
fifo_pager lowdown -Tterm "$1"
else
fifo_pager pager "$1"
fi ;;
htm|html|xhtml)
if exists w3m; then
fifo_pager w3m "$1"
elif exists lynx; then
fifo_pager lynx "$1"
elif exists elinks; then
fifo_pager elinks "$1"
else
fifo_pager pager "$1"
fi ;;
7z|a|ace|alz|arc|arj|bz|cab|cpio|deb|jar|lha|lz|lzh|lzma|lzo\
|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z)
if exists atool; then
fifo_pager atool -l "$1"
elif exists bsdtar; then
fifo_pager bsdtar -tvf "$1"
fi ;;
*) if [ "$3" = "bin" ]; then
fifo_pager print_bin_info "$1"
else
fifo_pager pager "$1"
fi ;;
esac
}
preview_file() {
clear
# Trying to use pistol if it's available.
if [ "$NNN_PISTOL" -ne 0 ] && exists pistol; then
fifo_pager pistol "$1"
return
fi
# Trying to use scope.sh if it's available.
if [ "$NNN_SCOPE" -ne 0 ] && exists scope.sh; then
fifo_pager scope.sh "$1" "$cols" "$lines" "$(mktemp -d)" "True"
return
fi
# Use QuickLook if it's available.
if [ -n "$QUICKLOOK" ]; then
stat "$1" && f="$(wslpath -w "$1")" && "$QLPATH" "$f" &
return
fi
# Detecting the exact type of the file: the encoding, mime type, and extension in lowercase.
encoding="$(file -bL --mime-encoding -- "$1")"
mimetype="$(file -bL --mime-type -- "$1")"
ext="${1##*.}"
[ -n "$ext" ] && ext="$(printf "%s" "${ext}" | tr '[:upper:]' '[:lower:]')"
lines=$(tput lines)
cols=$(tput cols)
# Otherwise, falling back to the defaults.
if [ -d "$1" ]; then
cd "$1" || return
if [ "$NNN_ICONLOOKUP" -ne 0 ] && [ -f "$(dirname "$0")"/.iconlookup ]; then
[ "$NNN_SPLIT" = v ] && BSTR="\n"
# shellcheck disable=SC2012
ls -F --group-directories-first | head -n "$((lines - 3))" | "$(dirname "$0")"/.iconlookup -l "$cols" -B "$BSTR" -b " "
elif exists tree; then
fifo_pager tree --filelimit "$(find . -maxdepth 1 | wc -l)" -L 3 -C -F --dirsfirst --noreport
elif exists exa; then
fifo_pager exa -T --group-directories-first --colour=always -L 3
elif exists eza; then # eza is a community fork of exa (exa is unmaintained)
fifo_pager eza -T --group-directories-first --colour=always -L 3
else
fifo_pager ls -F --group-directories-first --color=always
fi
cd ..
elif [ "${encoding#*)}" = "binary" ]; then
handle_mime "$1" "$mimetype" "$ext" "bin"
else
handle_mime "$1" "$mimetype" "$ext"
fi
}
generate_preview() {
if [ -n "$QLPATH" ] && stat "$3"; then
f="$(wslpath -w "$3")" && "$QLPATH" "$f" &
elif [ -n "$NNN_PREVIEWVIDEO" ] && [[ "$4" == +(gif|video) ]]; then
[ "$4" = "video" ] && args=(--start=10% --length=4) || args=()
video_preview "$1" "$2" "$3" "${args[@]}" && return
elif [ ! -f "$NNN_PREVIEWDIR/$3.jpg" ] || [ -n "$(find -L "$3" -newer "$NNN_PREVIEWDIR/$3.jpg")" ]; then
mkdir -p "$NNN_PREVIEWDIR/${3%/*}"
case $4 in
audio) ffmpeg -i "$3" -filter_complex "scale=iw*min(1\,min($NNN_PREVIEWWIDTH/iw\,ih)):-1" "$NNN_PREVIEWDIR/$3.jpg" -y ;;
epub) gnome-epub-thumbnailer "$3" "$NNN_PREVIEWDIR/$3.jpg" ;;
font) fontpreview -i "$3" -o "$NNN_PREVIEWDIR/$3.jpg" ;;
gif) if [ -p "$FIFO_UEBERZUG" ] && exists convert; then
frameprefix="$NNN_PREVIEWDIR/$3/${3##*/}"
if [ ! -d "$NNN_PREVIEWDIR/$3" ]; then
mkdir -p "$NNN_PREVIEWDIR/$3"
convert -coalesce -resize "$NNN_PREVIEWWIDTH"x"$NNN_PREVIEWHEIGHT"\> "$3" "$frameprefix.jpg" ||
MAGICK_TMPDIR="/tmp" convert -coalesce -resize "$NNN_PREVIEWWIDTH"x"$NNN_PREVIEWHEIGHT"\> "$3" "$frameprefix.jpg"
fi
frames=$(($(find "$NNN_PREVIEWDIR/$3" | wc -l) - 2))
[ $frames -lt 0 ] && return
while true; do
for i in $(seq 0 $frames); do
image_preview "$1" "$2" "$frameprefix-$i.jpg"
sleep 0.1
done
done &
printf "%s" "$!" > "$PREVIEWPID"
return
elif [ -n "$NNN_PREVIEWVIDEO" ]; then
video_preview "$1" "$2" "$3" && return
else
image_preview "$1" "$2" "$3" && return
fi ;;
image) if exists rsvg-convert && [[ "${3##*.}" == "svg" ]]; then
rsvg-convert -a -w "$NNN_PREVIEWWIDTH" -h "$NNN_PREVIEWHEIGHT" -f png -o "$NNN_PREVIEWDIR/$3.png" "$3"
elif exists convert; then
convert "$3" -flatten -resize "$NNN_PREVIEWWIDTH"x"$NNN_PREVIEWHEIGHT"\> "$NNN_PREVIEWDIR/$3.jpg"
else
image_preview "$1" "$2" "$3" && return
fi ;;
office) libreoffice --convert-to jpg "$3" --outdir "$NNN_PREVIEWDIR/${3%/*}"
filename="$(printf "%s" "${3##*/}" | cut -d. -f1)"
mv -- "$NNN_PREVIEWDIR/${3%/*}/$filename.jpg" "$NNN_PREVIEWDIR/$3.jpg" ;;
pdf) pdftoppm -jpeg -f 1 -singlefile "$3" "$NNN_PREVIEWDIR/$3" ;;
djvu) ddjvu -format=ppm -page=1 "$3" "$NNN_PREVIEWDIR/$3.jpg" ;;
video) video_preview "$1" "$2" "$3" && return ;;
esac
fi
if [ -f "$NNN_PREVIEWDIR/$3.jpg" ]; then
image_preview "$1" "$2" "$NNN_PREVIEWDIR/$3.jpg"
elif [[ "${3##*.}" == "svg" ]] && [ -f "$NNN_PREVIEWDIR/$3.png" ]; then
image_preview "$1" "$2" "$NNN_PREVIEWDIR/$3.png"
else
fifo_pager print_bin_info "$3"
fi
} >/dev/null 2>&1
image_preview() {
clear
exec >/dev/tty
if [ "$NNN_TERMINAL" = "kitty" ] && [[ "$NNN_PREVIEWIMGPROG" == +(|icat) ]]; then
kitty +kitten icat --silent --scale-up --place "$1"x"$2"@0x0 --transfer-mode=stream --stdin=no "$3" &
elif [ "$NNN_TERMINAL" = "tmux" ] && [[ -n "$KITTY_LISTEN_ON" ]] && [[ "$NNN_PREVIEWIMGPROG" == +(|icat) ]]; then
kitty +kitten icat --silent --scale-up --place "$(($1 - 1))x$(($2 - 1))"@0x0 --transfer-mode=memory --stdin=no "$3" &
elif [ "$NNN_TERMINAL" = "wezterm" ] && [[ "$NNN_PREVIEWIMGPROG" == +(|imgcat) ]]; then
wezterm imgcat "$3" &
elif exists ueberzug && [[ "$NNN_PREVIEWIMGPROG" == +(|ueberzug) ]]; then
ueberzug_layer "$1" "$2" "$3" && return
elif exists catimg && [[ "$NNN_PREVIEWIMGPROG" == +(|catimg) ]]; then
catimg "$3" &
elif exists viu && [[ "$NNN_PREVIEWIMGPROG" == +(|viu) ]]; then
viu -t "$3" &
elif exists chafa && [[ "$NNN_PREVIEWIMGPROG" == +(|chafa) ]]; then
chafa "$3" &
elif exists img2sixel && [[ "$NNN_PREVIEWIMGPROG" == +(|img2sixel) ]]; then
img2sixel -g "$3" &
else
fifo_pager print_bin_info "$3" && return
fi
printf "%s" "$!" > "$PREVIEWPID"
}
video_preview() {
clear
exec >/dev/tty
if [ -n "$NNN_PREVIEWVIDEO" ]; then
mpv --no-config --really-quiet --vo="$NNN_PREVIEWVIDEO" --profile=sw-fast --loop-file --no-audio "$4" "$3" &
else
ffmpegthumbnailer -m -s0 -i "$3" -o "$NNN_PREVIEWDIR/$3.jpg" || rm -- "$NNN_PREVIEWDIR/$3.jpg" &
fi
printf "%s" "$!" > "$PREVIEWPID"
}
ueberzug_layer() {
[ -f "$POSOFFSET" ] && read -r x y < "$POSOFFSET"
printf '{"action": "add", "identifier": "nnn_ueberzug", "x": %d, "y": %d, "width": "%d", "height": "%d", "scaler": "fit_contain", "path": "%s"}\n'\
"${x:-0}" "${y:-0}" "$1" "$2" "$3" > "$FIFO_UEBERZUG"
}
ueberzug_remove() {
printf '{"action": "remove", "identifier": "nnn_ueberzug"}\n' > "$FIFO_UEBERZUG"
}
winch_handler() {
clear
pidkill "$PREVIEWPID"
if [ -p "$FIFO_UEBERZUG" ]; then
pkill -f "tail --follow $FIFO_UEBERZUG"
tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser json &
fi
preview_file "$(cat "$CURSEL")"
}
preview_fifo() {
while read -r selection; do
if [ -n "$selection" ]; then
pidkill "$PREVIEWPID"
[ -p "$FIFO_UEBERZUG" ] && ueberzug_remove
[ "$selection" = "close" ] && break
preview_file "$selection"
printf "%s" "$selection" > "$CURSEL"
fi
done < "$NNN_FIFO"
sleep 0.1 # make sure potential preview by winch_handler is killed
pkill -P "$$"
}
if [ "$PREVIEW_MODE" -eq 1 ] 2>/dev/null; then
if exists ueberzug && [ "$NNN_TERMINAL" != "kitty" ] && [[ "$NNN_PREVIEWIMGPROG" == +(|ueberzug) ]]; then
mkfifo "$FIFO_UEBERZUG"
tail --follow "$FIFO_UEBERZUG" | ueberzug layer --silent --parser json &
fi
preview_file "$PWD/$1"
preview_fifo & WAITPID=$!
printf "%s" "$!" > "$FIFOPID"
printf "%s" "$PWD/$1" > "$CURSEL"
trap 'winch_handler' WINCH
trap 'rm -- "$PREVIEWPID" "$CURSEL" "$FIFO_UEBERZUG" "$FIFOPID" "$POSOFFSET" 2>/dev/null' INT HUP EXIT
while kill -s 0 $WAITPID; do
wait $WAITPID 2>/dev/null
done
exit 0
else
if [ ! -r "$NNN_FIFO" ]; then
prompt "No FIFO available! (\$NNN_FIFO='$NNN_FIFO')\nPlease read Usage in '$0'."
elif [ "$KITTY_WINDOW_ID" ] && [ -z "$TMUX" ] && [ -z "$KITTY_LISTEN_ON" ]; then
prompt "\$KITTY_LISTEN_ON not set!\nPlease read Usage in '$0'."
else
toggle_preview "$1" &
fi
fi

35
plugins/pskill Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env sh
# Description: Fuzzy list and kill a (zombie) process by name
#
# Dependencies: fzf, ps
#
# Note: To kill a zombie process enter "zombie"
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
printf "Enter process name ['defunct' for zombies]: "
read -r psname
# shellcheck disable=SC2009
if [ -n "$psname" ]; then
if type sudo >/dev/null 2>&1; then
sucmd=sudo
elif type doas >/dev/null 2>&1; then
sucmd=doas
else
sucmd=: # noop
fi
if type fzf >/dev/null 2>&1; then
fuzzy=fzf
else
exit 1
fi
cmd="$(ps -ax | grep -iw "$psname" | "$fuzzy" | sed -e 's/^[ \t]*//' | cut -d' ' -f1)"
if [ -n "$cmd" ]; then
$sucmd kill -9 "$cmd"
fi
fi

45
plugins/renamer Executable file
View File

@ -0,0 +1,45 @@
#!/usr/bin/env sh
# Description: Batch rename selection or current directory with qmv or vidir
#
# Notes:
# - Try to mimic current batch rename functionality but with correct
# handling of edge cases by qmv or vidir.
# - Qmv opens with hidden files if no selection is used. Selected
# directories are shown.
# - Vidir don't show directories nor hidden files.
#
# Shell: POSIX compliant
# Author: José Neder
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
if type qmv >/dev/null 2>&1; then
batchrenamesel="qmv -fdo -da"
batchrename="qmv -fdo -a"
elif type vidir >/dev/null 2>&1; then
batchrenamesel="vidir"
batchrename="vidir"
else
printf "there is not batchrename program installed."
exit
fi
if [ -s "$selection" ]; then
printf "rename selection? "
read -r resp
fi
if [ "$resp" = "y" ]; then
# -o flag is necessary for interactive editors
xargs -o -0 $batchrenamesel < "$selection"
# Clear selection
if [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi
elif [ ! "$(LC_ALL=C ls -a)" = ".
.." ]; then
# On older systems that don't have ls -A
$batchrename
fi

Some files were not shown because too many files have changed in this diff Show More