pax_global_header00006660000000000000000000000064152400715240014512gustar00rootroot0000000000000052 comment=5f1c78b2c591b12fcbdb5b84d16b7ecd28eb12dc jarun-nnn-53baef9/000077500000000000000000000000001524007152400141205ustar00rootroot00000000000000jarun-nnn-53baef9/.circleci/000077500000000000000000000000001524007152400157535ustar00rootroot00000000000000jarun-nnn-53baef9/.circleci/config.yml000066400000000000000000000103761524007152400177520ustar00rootroot00000000000000version: 2.1 jobs: compile: working_directory: ~/nnn docker: - image: ubuntu:24.04 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 gcc-13 gcc-14 apt install -y --no-install-recommends clang-14 clang-15 clang-16 clang-17 clang-18 apt install -y --no-install-recommends clang-tidy-18 - 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 "########## gcc-13 ##########" CC=gcc-13 make strip ls -l nnn make clean echo echo "########## gcc-14 ##########" CC=gcc-14 make strip ls -l nnn make clean echo echo "########## clang-14 ##########" CC=clang-14 make strip ls -l nnn make clean echo echo "########## clang-15 ##########" CC=clang-15 make strip ls -l nnn make clean echo echo "########## clang-16 ##########" CC=clang-16 make strip ls -l nnn make clean echo echo "########## clang-17 ##########" CC=clang-17 make strip ls -l nnn make clean echo echo "########## clang-18 ##########" CC=clang-18 make strip ls -l nnn make clean echo echo "########## clang-tidy-18 ##########" clang-tidy-18 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: 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: /.*/ jarun-nnn-53baef9/.github/000077500000000000000000000000001524007152400154605ustar00rootroot00000000000000jarun-nnn-53baef9/.github/FUNDING.yml000066400000000000000000000000751524007152400172770ustar00rootroot00000000000000# These are supported funding model platforms github: jarun jarun-nnn-53baef9/.github/ISSUE_TEMPLATE/000077500000000000000000000000001524007152400176435ustar00rootroot00000000000000jarun-nnn-53baef9/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000032371524007152400223420ustar00rootroot00000000000000--- 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 jarun-nnn-53baef9/.github/ISSUE_TEMPLATE/config.yml000066400000000000000000000003431524007152400216330ustar00rootroot00000000000000contact_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. jarun-nnn-53baef9/.github/workflows/000077500000000000000000000000001524007152400175155ustar00rootroot00000000000000jarun-nnn-53baef9/.github/workflows/ci.yml000066400000000000000000000031501524007152400206320ustar00rootroot00000000000000name: 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: | sudo apt install libreadline-dev make checkpatches ubuntu-cppcheck: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Static analysis with cppcheck run: | sudo apt install cppcheck libreadline-dev cppcheck --std="c11" --error-exitcode=1 --enable=performance,portability \ --force --inline-suppr --max-ctu-depth=8 -j"$(nproc)" \ $(pkg-config --cflags ncurses) src/nnn.c jarun-nnn-53baef9/.github/workflows/codeql.yml000066400000000000000000000016261524007152400215140ustar00rootroot00000000000000name: "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 }}" jarun-nnn-53baef9/.gitignore000066400000000000000000000000711524007152400161060ustar00rootroot00000000000000*.o *.dSYM nnn src/icons-generated*.h src/icons-hash-gen jarun-nnn-53baef9/CHANGELOG000066400000000000000000001543451524007152400153460ustar00rootroot00000000000000nnn v5.3 Mai Tai 2026-08-15 - add native preview pane (P) with automatic `.npreview` support - fuzzy filtering improvements: - scoring, ranking, character arbitration - dimmed matches (works with string filtering also) - native prompt - cycle entries in the current directory with TAB - enter a directory that exactly matches the filter with / - support Alt-Esc to quit a context with or without an active filter - optimize ncurses rendering with `leaveok()` - lazy-load plugins when requested - disable linking libreadline by default; use `make O_NORL=0` to enable it - show the runtime bookmarked directory path in the help menu - add `O_BENCH` to exit after startup for benchmark runs - add `stats` plugin to show complete file information in a pager - add `tnp` terminal note-pad plugin - add Kitty drag-and-drop support to `dragdrop` - plugin `nmount` improvements: - unmount all external USB partitions with u - fill prompt with last input on Up, clear on Down - clear stale Kitty graphics placements when closing video previews in `preview-tui` - use `HOST_CC` and `HOST_CFLAGS` when building the icons generator - fix shell quoting in `preview-tabbed` - fix context selection and active-tab handling when cycling contexts - fix selection-path unescaping during selection edits - reconcile off-screen selections correctly before inversion - do not automatically enter directories without read permission - add safety checks for session header fields - support escaping name completions in the native prompt - handle arbitrarily long paths when escaping shell arguments ------------------------------------------------------------------------------- nnn v5.2 Blue Hawaii 2026-02-14 - enable 8 contexts (saved sessions may no longer be usable, users need to re-create the sessions) - massive [du performance improvement](https://github.com/jarun/nnn/wiki/Performance#02-feb-2026) - floating window - render file stats (f) in a navigable floating window - support rendering output of command run as plugin within floating window (prefix `>`) - support in order fuzzy search - with no selection, allow user input on _Copy here_ or _Move here_ e.g. to copy the system clipboard - double confirm when removing more than 10 selected files using `rm` - auto-complete hovered file name on pressing TAB at the end of prompt input - fix: scroll down arrow indicator not showing when down arrow is pressed with filter - fix: refresh directory after selection edits - support PCRE2 compile-in (`make O_PCRE2=1`), remove PCRE1 support (no longer being developed) - support jelliz in preview-tui - history file for native prompt ------------------------------------------------------------------------------- nnn v5.1 Moscow Mule 2025-03-23 - add support for custom trash function - remember history of last 16 commands executed in the native prompt in the current session - count files from selection file when no file is selected during selection removal - show session name in help - show current entry in reversed bold - show current (non-auto) session name at save session prompt - show `F` in the status bar when filter is inactive in _type-to-nav_ mode - restore correct filter function on session load, switch filter function on context changes - extend xreadline() with some by-word movement - added plugins gpgs and gpgv - add icon for `lzip` files, more emoji icons - suffix the current context number with `*` in help screen ------------------------------------------------------------------------------- nnn v5.0 Daiquiri 2024-08-26 - show relative line numbering when jumping (#1808) - option `-N` to use native prompt when compiled with libreadline - rm improvements - log removed filename - cancel on 'n' or 'N' - show name of the hovered file to be removed - show number of selected files to be removed - new keybind X to force `rm -rf` always (#1811) - fix sort order getting changed on context switch (#1757) - fix current selection on new file creation, if symlinks exist (#1767) - fix filter toggle with mouse click on last 2 rows (#1765) - fix file creation (#1864) - when handling bookmark, use readlink, not realpath - set `$PWD` on directory switch - add option `-0` to null-separate file paths in picker mode - quitcd.nu (for nushell) now supports modular import (#1806) - add _command as plugin_ example to cd to user input directory - `cbcopy-mac`, `cbpaste-mac`: plugins for integration with macOS clipboard - `fzhist` plugin: add support for zsh history - `preview-tui` plugin: support eza as replacement for exa, multiple fixes - `preview-tui` plugin: add full svg support (#1865) - `preview-tabbed`: show (n)sxiv in thumbnail mode inside "Pictures" directory - mpv sixel/kitty support for preview (#1590) ------------------------------------------------------------------------------- nnn v4.9 Elixir 2023-08-27 - config option `NNN_ARCHMNT` to specify archive mounter utility - key ^y 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 S) 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 Enter - 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 ^N 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 J 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 e (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 ^J and + functionality: - +: toggle file selection - ^J: 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 Enter 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 B 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 -) - picker mode improvements - open tty for input if `STDIN` is non-tty - truncate output file before writing - do not double select a file on Enter - 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 x (#1101) - insert the last command executed at prompt on Up or Down - insert the current file name at empty prompt on TAB - 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 - Bksp/Del at empty filter prompt to refresh dir - Try to create new context with Shift-TAB, else reverse cycle - Alt+Esc 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 ~ (HOME) or ` (ROOT) key repeat - ambiguous key ^Space 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 q 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 (Esc or Enter to exit) - invert selection with A - option `-u` removed (always prefer selection to hovered) - visit start dir on @ when start path is a file - exit filter mode and redraw on ^L 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 Esc in normal mode (#775) - ^Space replaces ^K for range selection/clear selection - show selection symbol (`+`) next to filename in detail mode (#741) - error & quit on Q if no selection, else pick to stdout - repeat ^T 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 ^C (#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 Alt+Esc to clear filter prompt and redraw - support Esc 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 Esc or left click to resend hovered file path to `NNN_FIFO` - show `+` instead of `s` in status bar on selection - F5 removed (misfit for toggle hidden), ^S 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` - Right or l 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 ' (followed by ' or char) - 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 Alt+key - allow `NNN_PIPE` usage by commands run as plugin - input format to `NNN_PIPE`: `` (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 > 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 T 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 +) - quit with error code on Q - additional key F5 to toggle hidden - key e to edit in EDITOR (back on multiple user requests) - option to edit list of files in selection is changed to E - 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 (b or ^/) - single key to toggle order (t or ^T) - 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 ,) - toggle executable (key *) - show mime along with file details - more special keys at empty filter prompt: - apply the last filter (^L) - toggle between string and regex (/) - toggle case-sensitivity (:) - retain filter on Esc, Up, Down - 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 Space or ^J - 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 z - additional key ] 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 y or Y - 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 ; 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 ^P - `-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: Space and ^J - select range (or clear selection): m and ^K - select all in dir: a - list selection: M - ^N replaces ^T to toggle _nav-as-you-type_ - Shift TAB to reverse context cycle - ' to jump to first file in dir - S for du, A for apparent du - additional key : to run plugin - additional key F2 to rename file - additional key F5 to redraw - quit context key Leadq is removed - Leader key combinations: - Lead' to jump to first file in dir - Lead] go to next active context - Lead[ go to prev active context - Lead. 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 / 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 ^R, 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 `/` - ` (backtick) - vim-like scrolloff support - ^D & ^U: scroll half page, PgDn & PdUp: scroll full page - fix selection across contexts - recognize Home and End 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 ^W) for _nav-as-you-type_ - POSIX-compliant GUI app launcher with drop-down menu (key =) - 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 ^T] - 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 K to toggle selection - change visit start dir key to @ - 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 ^C - 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 ^N for quick notes - handle multiple arguments in VISUAL/EDITOR - show the current directory being scanned in `du` mode - select all files (Y) - show command prompt (^P) - key , replaces ` as alternative Leader Key - keybind for visit pinned directory is now ^B - additional key ^V to run or select custom script - use libreadline for command prompt - reduce delay on Esc 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 - $, ^, Backspace, ^H, ^P, ^M, ^W, ` ------------------------------------------------------------------------------- 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 Del in rename prompt - Pass correct `file` option to identify mime - Support selection across directories and contexts - Offer option `force` before file remove - Keys Tab, ^I 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 C) - 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 Right or l - `NUL`-terminated file paths in selection list instead of `LF` - Better support for Termux and Cygwin environments - Remapped keys - ^I - go to next active context - ^T - toggle _navigate-as-you-type_ ------------------------------------------------------------------------------- nnn v2.1 2018-11-23 What's in? - Inclusion in several distros including Arch Linux official repo - Multiple contexts (_aka_ tabs _aka_ workspaces) [max 4] - Copy, move, remove selected files, remove current file - [Leader key](https://github.com/jarun/nnn#leader-key) (like vim) - In-built GUI app launcher with up to 2 arguments (key o) - List copy selection (key y) - Env var `NNN_NO_AUTOSELECT` to disable dir auto-select - Key Esc exits prompt, ^L clears prompt - Program runtime help revamped - Static code analysis integration - gcc-8 warnings fixed - Remapped keys: - ^W - go to pinned dir - ^X - delete current entry - ^Q - quit program - `nlay` is retired (functionality built into `nnn`) - `chdir` prompt is retired - Env var `NNN_NO_X` retired, selection now works out of the box - Only single-char bookmark keys (to work with Leader key) ------------------------------------------------------------------------------- nnn v2.0 2018-10-19 What's in? - Mode to show apparent size (key `S`) - Script to integrate `patool` instead of `atool` - Support `bashlock` (OS X) and `lock` (BSD) as terminal locker - Symbol `@/` for symlink to dir - Dependency on `libreadline` removed ------------------------------------------------------------------------------- nnn v1.9 2018-08-10 What's in? - Support unlimited number of scripts - Pass currently selected filename as first argument to custom scripts - Support directory auto-select in _navigate-as-you-type_ mode - Show selection name in archive name prompt - Support Cygwin opener - Better support on RHEL 25 with earlier version on curses - Sample script for `fzy` integration - Now available on OpenBSD - Disabled package generation for Ubuntu 17.10 ------------------------------------------------------------------------------- nnn v1.8 2018-05-02 What's in? - Run a custom script - Archive selected file/directory - Show number of cherry-picked files in multi-copy mode - Env var `NNN_SHOW_HIDDEN` to show hidden files by default - Additional information in help screen - Give preference to env var VISUAL, if defined, over EDITOR - New/changed/remapped shortcuts - ^] - spawn a new shell in current directory - r - edit directory entries in vidir - R - run a custom script - ^I - toggle navigate-as-you-type mode - L - lock the current terminal (Linux-only) - All Ctrl shortcuts enabled in navigate-as-you-type mode - Fix: GUI programs closing when parent terminal is closed - Recognize `~`, `-` and `&` at bookmark prompt - Recognize ruby (.rb) files as text files - Efficient integer-only file size calculation - Official inclusion on openSUSE and Fedora - Package generation for Ubuntu 18.04 ------------------------------------------------------------------------------- nnn v1.7 2018-02-28 What's in? - Batch rename/move/delete files in vidir from [moreutils](https://joeyh.name/code/moreutils/) - Copy multiple file paths - Copy file paths when X is unavailable - Optionally quote individual file paths with single quotes on copy - Use ISO 8601 date format in file details - New/changed/remapped shortcuts: - ^B - show bookmark prompt (replaces b) - b - pin current dir (replaces ^B) - ^J - toggle du mode - R - batch rename files in vidir - ^F - extract archive (replaces ^X) - ^G - quit nnn and change dir - ^X - quit nnn (replaces ^Q) - Extra shortcuts enabled in nav-as-you-type mode: - ^K, ^Y (file path copy) - ^T (toggles quoted file path copy) - ^R (rename) - ^O (open with...) - ^B (show bookmark prompt) - ^V (visit pinned dir) - ^J (toggle du mode) - ^/ (open desktop opener) - ^F (extract archive) - ^L (refresh) - ^G (quit nnn and change dir) - ^X (quit nnn) ------------------------------------------------------------------------------- nnn v1.6 2017-12-25 What's in? - Shortcut `^O` to open file with custom application - Option `-b` to open bookmarks directly at start - Huge performance improvements around file name storing and handling - Several large static buffers removed or reduced - Several internal algorithms fine tuned for performance/resource usage ------------------------------------------------------------------------------- nnn v1.5 2017-10-05 What's in? - File and directory creation (`n`) - Env variable `NNN_NOWAIT` to unblock nnn when opening files (DE-specific) - Show current entry number in status bar - Support archive listing (`F`) and extraction (`Ctrl-X`) [using `atool`] - Show correct file size on i386 for large files (> 2GB) ------------------------------------------------------------------------------- nnn v1.4 2017-09-04 What's in? - Monitor directory changes - In-place file rename - Pin (`Ctrl-B`) a directory and visit (`Ctrl-V`) it anytime - Auto-completion scripts - Show volume capacity and free in help - Auto-fallback to light mode if too few columns (< 35) - PackageCore integration - Unsupported Function keys (they never work universally): - `F2` (rename), use `Ctrl-R` - `F5` (refresh), use `Ctrl-L` ------------------------------------------------------------------------------- nnn v1.3 2017-07-26 What's in? - Show directories in custom color (default: enabled in blue) - Option `-e` to use exiftool instead of mediainfo - Fixed #34: nftw(3) broken with too many open descriptors - More concise help screen ------------------------------------------------------------------------------- nnn v1.2 2017-06-29 What's in? - Use the desktop opener (xdg-open on Linux, open(1) on OS X) to open files - Option `NNN_USE_EDITOR` to open text files in EDITOR (fallback vi) - Bookmark support (maximum 10, key `b`) - *Navigate-as-you-type* mode (key `Insert` or option `-i`) - Subtree search: gnome-search-tool, fallback catfish (key `^/`) (customizable) - Show current directory content size and file count in disk usage mode - Add detail view mode as default, use `-l` to start in light mode - Shortcuts `F2` and `^L` to refresh and unfilter Note: if filter is empty, `Enter` *opens* the currently selected file now - Help screen shows bookmarks and configuration - Show a message when calculating disk usage - Show the spawned shell level - Linux only: use vlock as the locker on timeout (set using `NNN_IDLE_TIMEOUT`) ------------------------------------------------------------------------------- nnn v1.1 2017-05-12 News - Introducing nlay - a highly customizable bash script to handle media type - nnn is on [Homebrew](http://braumeister.org/formula/nnn) now - RPM packages for CentOS 7 and Fedora 24 generated on release What's in? - *Search-as-you-type* - Unicode support - Option `-S` to start in disk usage analyzer mode - Show media information (using mediainfo) - Use readline at change directory prompt - Jump to prev directories using `cd .....` (with `.` as PWD) - Jump to initial directory using `&` - Show help, mediainfo and file info in PAGER - Several optimizations ------------------------------------------------------------------------------- nnn v1.0 2017-04-13 Modifications - Behaviour and navigation - Detail view (default: disabled) with: - file type (directory, regular, symlink etc.) - modification time - human-readable file size - current item in reverse video - number of items in current directory - full name of currently selected file in 'bar' - Show details of the currently selected file (stat, file) - Disk usage analyzer mode (within the same fs, doesn't follow symlinks) - Directories first (even with sorting) - Sort numeric names in numeric order - Case-insensitive alphabetic content listing instead of upper case first - Key `-` to jump to last visited directory - Roll over at the first and last entries of a directory (with Up/Down keys) - Removed navigation restriction with relative paths (and let permissions handle it) - Sort entries by file size (largest to smallest) - Shortcut to invoke file name copier (set using environment variable `NNN_COPIER`) - File association - Set `NNN_OPENER` to let a desktop opener handle it all. E.g.: export NNN_OPENER=xdg-open export NNN_OPENER=gnome-open export NNN_OPENER=gvfs-open - Selective file associations (ignored if `NNN_OPENER` is set): - Associate plain text files (determined using file) with vi - Associate common audio and video mimes with mpv - Associate PDF files with [zathura](https://pwmt.org/projects/zathura/) - Removed `less` as default file opener (there is no universal standalone opener utility) - You can customize further (see [how to change file associations](#change-file-associations)) - `NNN_FALLBACK_OPENER` is the last line of defense: - If the executable in static file association is missing - If a file type was not handled in static file association - This may be the best option to set your desktop opener to - To enable the desktop file manager key, set `NNN_DE_FILE_MANAGER`. E.g.: export NNN_DE_FILE_MANAGER=thunar - Optimization - All redundant buffer removal - All frequently used local chunks now static - Removed some redundant string allocation and manipulation - Simplified some roundabout procedures - Compiler warnings fixed - strip the final binary ------------------------------------------------------------------------------- jarun-nnn-53baef9/LICENSE000066400000000000000000000027001524007152400151240ustar00rootroot00000000000000BSD 2-Clause License Copyright (c) 2014-2016, Lazaros Koromilas Copyright (c) 2014-2016, Dimitris Papastamos Copyright (c) 2016-2026, Arun Prakash Jana All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. jarun-nnn-53baef9/Makefile000066400000000000000000000320101524007152400155540ustar00rootroot00000000000000VERSION = $(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_OPTIMIZATION ?= -O3 O_DEBUG := 0 # debug binary O_NORL := 1 # no readline support O_PCRE2 := 0 # link with PCRE2 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_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_NOSORT := 0 # disable sorting entries on dir load O_DIMFILTERED := 1 # dim characters matching filter (default: enabled) # 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_PCRE2)),1) CPPFLAGS += -DPCRE2 LDLIBS += -lpcre2-8 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_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_NOSORT)),1) CPPFLAGS += -DNOSORT endif ifeq ($(strip $(O_DIMFILTERED)),1) CPPFLAGS += -DDIM_FILTERED 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 CFLAGS += -std=c11 -Wall -Wextra -Wshadow CFLAGS += $(CFLAGS_OPTIMIZATION) CFLAGS += $(CFLAGS_CURSES) LDLIBS += $(LDLIBS_CURSES) -lpthread # For the icon hashtable generator HOST_CC ?= $(CC) HOST_CFLAGS ?= $(CFLAGS) # 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) $(BIN): $(SRC) $(HEADERS) Makefile @$(MAKE) --silent prepatch $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(GETTIME_C) $< $(LDLIBS) @$(MAKE) --silent postpatch # targets for backwards compatibility debug: $(BIN) norl: $(BIN) nolc: $(BIN) src/$(ICONS_INCLUDE): src/icons-hash.c src/icons.h src/icons-in-terminal.h $(HOST_CC) $(HOST_CFLAGS) $(CPPFLAGS) -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 $(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) $^ 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) | 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)) $(eval PKG_STATIC=$(BIN)-static) $(eval PKG_ICONS=$(BIN)-icons-static) $(eval PKG_NERD=$(BIN)-nerd-static) $(eval PKG_EMOJI=$(BIN)-emoji-static) $(eval PKG_MUSL=$(BIN)-musl-static) $(eval PKG_MUSL_EMOJI=$(BIN)-musl-emoji-static) $(eval ARCH=x86_64) # 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 $(PKG_STATIC) upx -qqq $(PKG_ICONS) upx -qqq $(PKG_NERD) upx -qqq $(PKG_EMOJI) upx -qqq $(PKG_MUSL) upx -qqq $(PKG_MUSL_EMOJI) # upload static binary tar -zcf $(PKG_STATIC)-$(VERSION).$(ARCH).tar.gz $(PKG_STATIC) curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(PKG_STATIC)-$(VERSION).$(ARCH).tar.gz' \ -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \ --upload-file $(PKG_STATIC)-$(VERSION).$(ARCH).tar.gz # upload icons-in-terminal compiled static binary tar -zcf $(PKG_ICONS)-$(VERSION).$(ARCH).tar.gz $(PKG_ICONS) curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(PKG_ICONS)-$(VERSION).$(ARCH).tar.gz' \ -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \ --upload-file $(PKG_ICONS)-$(VERSION).$(ARCH).tar.gz # upload patched nerd font compiled static binary tar -zcf $(PKG_NERD)-$(VERSION).$(ARCH).tar.gz $(PKG_NERD) curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(PKG_NERD)-$(VERSION).$(ARCH).tar.gz' \ -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \ --upload-file $(PKG_NERD)-$(VERSION).$(ARCH).tar.gz # upload emoji compiled static binary tar -zcf $(PKG_EMOJI)-$(VERSION).$(ARCH).tar.gz $(PKG_EMOJI) curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(PKG_EMOJI)-$(VERSION).$(ARCH).tar.gz' \ -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \ --upload-file $(PKG_EMOJI)-$(VERSION).$(ARCH).tar.gz # upload musl static binary tar -zcf $(PKG_MUSL)-$(VERSION).$(ARCH).tar.gz $(PKG_MUSL) curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(PKG_MUSL)-$(VERSION).$(ARCH).tar.gz' \ -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \ --upload-file $(PKG_MUSL)-$(VERSION).$(ARCH).tar.gz # upload musl emoji static binary tar -zcf $(PKG_MUSL_EMOJI)-$(VERSION).$(ARCH).tar.gz $(PKG_MUSL_EMOJI) curl -XPOST 'https://uploads.github.com/repos/jarun/nnn/releases/$(ID)/assets?name=$(PKG_MUSL_EMOJI)-$(VERSION).$(ARCH).tar.gz' \ -H 'Authorization: token $(NNN_SIG_UPLOAD_TOKEN)' -H 'Content-Type: application/x-sharedlib' \ --upload-file $(PKG_MUSL_EMOJI)-$(VERSION).$(ARCH).tar.gz clean: $(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 $(BIN)-musl-emoji-static $(BIN)-musl-emoji-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: all install uninstall strip static dist sign upload-local clean install-desktop uninstall-desktop jarun-nnn-53baef9/README.md000066400000000000000000000244141524007152400154040ustar00rootroot00000000000000

nnn
nnn - Supercharge your productivity!

Latest release Availability Circle CI Status GitHub CI Status Privacy Awareness License

[Features] [Quickstart] [Plugins] [Wiki]

`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). It is designed to be unobtrusive with smart workflows to match the trains of thought. `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. 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). 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. [_(more use cases)_](https://github.com/jarun/nnn/wiki/Basic-use-cases#the_nnn-magic) ## 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 - Light (default), detail - Disk usage analyzer (block/apparent) - File picker, (neo)vim plugin - Navigation - Filter with automatic dir entry on unique match - *Type-to-nav* (turbo navigation/always filter) mode - Jump to an entry with visible relative offset - Contexts (_aka_ tabs/workspaces) with custom colors - Sessions, bookmarks, mark and visit a dir - Remote mounts (needs `sshfs`, `rclone`) - Familiar shortcuts (arrows, ~, -, @), 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* - Fuzzy, regex (POSIX/PCRE2) 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 - Built-in previewer for directory and text files - FIFO-based previewer plugins with extensive mime support - 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 - 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 - Easily copy, move paths in system clipboard to current dir - 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, /, q suffice. Tab creates and/or cycles contexts. ? lists shortcuts. [![](https://github.com/user-attachments/assets/e93f7571-8b8d-4703-bef1-93fc804adf7d)](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/) - [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 - [Arun Prakash Jana](https://github.com/jarun) (Copyright © 2016-2026) - [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. jarun-nnn-53baef9/misc/000077500000000000000000000000001524007152400150535ustar00rootroot00000000000000jarun-nnn-53baef9/misc/CONTRIBUTING.md000066400000000000000000000024701524007152400173070ustar00rootroot00000000000000# 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). jarun-nnn-53baef9/misc/auto-completion/000077500000000000000000000000001524007152400201725ustar00rootroot00000000000000jarun-nnn-53baef9/misc/auto-completion/bash/000077500000000000000000000000001524007152400211075ustar00rootroot00000000000000jarun-nnn-53baef9/misc/auto-completion/bash/nnn-completion.bash000066400000000000000000000031531524007152400247100ustar00rootroot00000000000000# # Rudimentary Bash completion definition for nnn. # # Author: # Arun Prakash Jana # _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 -z -0 -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 jarun-nnn-53baef9/misc/auto-completion/fish/000077500000000000000000000000001524007152400211235ustar00rootroot00000000000000jarun-nnn-53baef9/misc/auto-completion/fish/nnn.fish000066400000000000000000000045451524007152400225770ustar00rootroot00000000000000# # Fish completion definition for nnn. # # Author: # Arun Prakash Jana # 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 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 'sort order' -x -a "a\t'apparent disk usage' d\t'disk usage' e\t'extension' r\t'reverse' s\t'size' t\t'time' v\t'version'" 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 z -d 'in order fuzzy filters' complete -c nnn -s 0 -d 'use null separator in picker mode' complete -c nnn -s h -d 'show program help' jarun-nnn-53baef9/misc/auto-completion/zsh/000077500000000000000000000000001524007152400207765ustar00rootroot00000000000000jarun-nnn-53baef9/misc/auto-completion/zsh/_nnn000066400000000000000000000034111524007152400216500ustar00rootroot00000000000000#compdef nnn # # Completion definition for nnn. # # Author: # Arun Prakash Jana # 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 history file]' '(-F)-F[fifo notification mode]:mode:(( 0\:"notify as previewer" 1\:"notify as explorer" ))' '(-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[sort order]:key:(( a\:"apparent disk usage" d\:"disk usage" e\:"extension" r\:"reverse" s\:"size" t\:"time" v\:"version" ))' '(-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]' '(-z)-z[in order fuzzy filters]' '(-0)-0[use null separator in picker mode]' '(-h)-h[show program help]' '*:filename:_files' ) _arguments -S -s $args jarun-nnn-53baef9/misc/desktop/000077500000000000000000000000001524007152400165245ustar00rootroot00000000000000jarun-nnn-53baef9/misc/desktop/nnn.desktop000066400000000000000000000003531524007152400207110ustar00rootroot00000000000000[Desktop Entry] Type=Application Name=nnn Comment=Terminal file manager Exec=nnn %f Terminal=true Icon=nnn MimeType=inode/directory Categories=System;FileTools;FileManager;ConsoleOnly Keywords=File;Manager;Management;Explorer;Launcher jarun-nnn-53baef9/misc/haiku/000077500000000000000000000000001524007152400161545ustar00rootroot00000000000000jarun-nnn-53baef9/misc/haiku/Makefile000066400000000000000000000142211524007152400176140ustar00rootroot00000000000000VERSION = $(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_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_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 jarun-nnn-53baef9/misc/haiku/haiku_interop.h000066400000000000000000000004661524007152400211740ustar00rootroot00000000000000#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 jarun-nnn-53baef9/misc/haiku/nm.cpp000066400000000000000000000031501524007152400172710ustar00rootroot00000000000000#include #include #include #include #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(); } jarun-nnn-53baef9/misc/haiku/nnn-master.recipe000066400000000000000000000031301524007152400214240ustar00rootroot00000000000000SUMMARY="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-2026 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 } jarun-nnn-53baef9/misc/haiku/nnn.rdef000066400000000000000000000202661524007152400176150ustar00rootroot00000000000000 // 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 = 5, middle = 3, minor = 0, variety = B_APPV_FINAL, 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" }; jarun-nnn-53baef9/misc/logo/000077500000000000000000000000001524007152400160135ustar00rootroot00000000000000jarun-nnn-53baef9/misc/logo/logo-128x128.png000066400000000000000000000234341524007152400204220ustar00rootroot00000000000000PNG  IHDR>asBIT|d pHYsetEXtSoftwarewww.inkscape.org<tEXtTitlen³ logob?tEXtAuthorLéo Villeveygoux IDATxy|eO$  @@T]PUAe<@RE  x,( ( (@t螞L5O?=UO=SO?q,CDjHcю @D.gEdJOsyGD"rʸߟI9_E_EDFsן(#D( 阀MDrK."$D!"JD`(" *x#?ɟCAADZ@DB]GuDiܸ1{t~Wn<LWJE6jT1.İ .Ky~ +B~A Fu1> 6K/eСw\h\ ܤJ^T H*K%K2}LJL0@rr2ujצNjꦦO rL SV-|ÇF\vH " .[0)**[Wiii|hZ|B_}ݿ&t8=2͛7w_ ])e\7/'*L3`ʪƍo#99ܼ̝DŽI91IgGsu>KJYbR@D 8d|nn. ۽{T"99fMttt|rT}u0f3`RjVeTy{Y~~> 7&vs+hղE: }ȇ}~~/W_z c+Ts'Dd80^VXX]CuUi:tvK\R a ޴{NJUqMf08}{Gyqq1WLPB絗_rgU Qv{drwy5Xѝdjb~1wDRw<=\b ,Mpeuo.n]ϲЫgOV^MV~@ҩct+@=_%UEd<0X^r̷ټŹJȃ]ǃ0Z ;{:/((0=h%lS=J-|׮];l82 3:4fMrǭitT{eeBj:U});;7lkJ;'Q0lJc 72e6'6~ Mc'm*7_סn^Ƙenݺ?|]vo@v |YMPʔN?=C)4QRR¸w_6TDʲ1"en趛o3CP~vd۶x4>lnEEEL4Qvҽ[WK~865=]a~a*oAԿB5_`YƘь]TA@GD)DR˅xm4?uhҤ ]p!˖-Gs嶛 6mؤr*$ˤ ^6r oެ}p)߫ >EE3zঁ7T 4`¸1yKuWcƍ3n+pA@u𕆒b Bc)S^/%%5+lso㒋zaF)qy2rk&ߍy9/>:8s;x<,Y-jƮL(LX[3fXS7O5UYۜ4fv|8?a5?8:vg0oem]~W#)M{H/+f ??8GYo?Lm9cfts ;;ZdxzX_1ṞLo$%%Y^+rPNvB נRk=d|ɧ,_[ZzurM72&M֫VOnn.)"3 laT333yad<I 7\y=ty4A|Bi(}5ͣ1Lju>&ѥs'N=%z*RY|9]xt1t , طϜf)sI 3c={xQoΝJ=73qd7KܧDBTꙢq{YXj@0!+sÖ5+t%ɜޡ}uVd2~_DmE.DdS--KNNϏ`s?),( XRR!F0/DlZ%i2h4b< ߯]k:M\.p#=zA呔d_4˹=>W_ -I+c.X9KaΩ6QKP6lM"۹k{dڋjRp˞|f4{z&Ooߞgd=w0Ѩq#?+IIxz˹;Ev <!9Ch!_Dc{bZiii4hPN=5fZz߯6߿;vسx0| /:oo~R󸯔^=r` L <. `iwDItd  |JwDa eof^n?m܀ǛTNgtd7h RJ RJeafCݓ<̙aX(7Zj6ԭ W{ =3ߞe)~-[`݃y޹Ѫdc1qnӇnu0V)=ʪiի} HTWD:`ġ oz_ʻ4]7\;$B 0x*s萩q7szh٢E:nOvm^ 8p6m}MӸi {_?^oE PYSihfRVJRJS:\CkӦs0y?fʕsqک2c@|>憕[{XNpX}<7bȽpݵwAJJ /Lyԇ'k}ˀRJk籧ۥv͞{?ܛY% Ejj*whi<Ln^f͚sR5&nܼ9?^b/h' ~9I[sʯП^y5&7J)3JFD xκugfxD;:*N;o~W^ٹ=jԨAgn$"ܿg$GD_V O?x4%o?ΤRa:jEn]ό](((?̍x_~>d`LS8RZ-rl|@AAŦr#%%)'D"`UJMD|m0@:u[7uS۱˅ngݘȎE>DFD/aa^‰q߄EύgOVd{44ओZs|4m҄&d4ɠiF5jԠvZ_G޽g7mf,_ ^'pB82mgZd| 8Kg{3^ mv͚5ztzÆKuޘ1)^sw]zz;ȕ 9t|3waӌ >Cg}~{+RܨQ;=PJEVJC*ߺU1=\9*jƔM3ء7oq͚ѤqcjծEJq~ڸ 7˯ۢJN=Lv8|KkƲŋHIqNNTJY=܋b^nMl t덃הL4ovgOsԱ#?G:2GOd̀ow9Ǿ05ʊ?qF 3Y)]nXMzS: 8gnE pϗRYxҙ3t@v6VϚ?dfe[.եyЦ7lRji3igTCFϾ}d?@II1yy$%%Q?-SNnG .z۬Lma]⳨o۱1jق$+ӟRj,Pϳkؠб3%pw懵x,z)̜;2%s^>Z?_-[Vf-[pQskU/s>JiO>]:%zD) !D$ nJ&U U+Un7?.RRj60F+.,WN&>7.} ͨ[r~3CœlKE떕nrF&{GH(c0()VJEt%Mf0y׬u]JJ Wy˹_+@Dd+"-/ߊh *YX(jpuݑĉP`Jv/ƮP;vhqѢc.47k E/G>URúͷԮw8MF16nԈ?̤u+ ʸ|i{inՊ۵F@a+p[3xj uN) G񟌆b0lG gLG&l16OIDATr0}ĽO).P%Μ*vǪ솈 Ĺ_ S^<""Vڕ$g {$F=sqT`+.<'egE9*T {\ج"K0i 4c'ٮʯhbX|>~JH(.N\xI`L 3\$PJm*L⿀ H[^^nǮTEp8#ab,p :<AU+!*rHjAD$''n=7p nEŀΚlޕtw>tXjJ <W+0͓o`ۭT\\̽<]+!blċ7aѕs`5X羑gOЃ (u!m7wF 0mM6J+Xm GȒȔAFJF]-d9AQ9E 2^\c! 0)/sԌվRhWA b_~fv2;\^"r*"'I4ӻ8CqZ60*2ALecwi?nHs~W`Hq6փ f:!D `}WF A]B~Pv! >4jE{'utA `5%֟@C=&MdTlDb.: "VFqph.'JA%0x>g(AC)a4 P3F9-L[ 'M컲yNj:$L袛\L`}†eג `>!/.(. [8pY~dX#AEd qCѾ)LI#֌,ZlwFQJ(%@Thg?ظ9d ':؆Du-|~ -vu+ęLG GfaZ0cΝ&%dHT4! `lLF c1CAh#΍S8|w1*BLm q?`KSSA@; 1<ds8|8}3\!:" t]IZ:zu1t|G=^Cq<fOf&Ǎ {7G4$[|>:u>e yPo%UG.hԱZ;VqHiWDe̺8_>^u _P@POyL`9O1^σI` 7ODB;B-زEzxT?Tۦ1AxMGi>}V:_m4yi90B)q +|iY6Y\Q,Z`֌GIOO盭흿CL]:ܪHڋd=-y{+>\W `a`fs4_mȸ~KYY9ߋgLƛe, 0 ˲Rk8x}{fS(-/g:E"iI6>¢", !gY{|M~}A:d6 ee<8m:>7#ذi#o-Y,p|c6D4^?]Ρ-_ww9/iSIdsS\\p\p4 >$kj|jٙED5.{M.-)C]?d?߼5pjjk4\.e2bp^z o{]hZ0 _Bf=4ksO>/[~TpP^~T׍<4Mǰݭs7 0".Gg>/s(dlJ T3xibݫYXr%a:n6ZtuIx^>p VJ5umTD$("\.]M[:^ibY&4EfFwDFF:Ux}>V~)6M$FP4P .,P[SB,{OQ}eÆqeyG哵y,ze1_PJ$"+jE 4͸Ρw1PUUVR[S;'ŋҷO&*-+cx~_uyRK;i ͙;}?BlMPQSj >^&l{e(IPl$W_{wLlD磢̞VRv)i媏8xc,|e iGnYOH}:a $6:s b۠jiXӼ^/ww?%eT >#̚9#𞜜Lm]-lF޽eko7۶{j}O]%6yr\h.[Mm~ؽ'|bb"C.(̆M,t'; ^x *</(☜{j*4at]nt;&[$%%{ԒŚU+TJW ѝȣ3=e K7f4 ~ºݸ\:.MNN"%%$m).)!6֞ 3Sk qm:>_J:?ŋHMM _ \-X]:b>LM8Y!.y]D;.\@l+m0~|1rZrl5הӠ9\9'y_ &6n5W vH c-ݻT?..̄qcILL/+H`iZ[<#== 58vnQ$ R\>|iv]bR '咙$<cOEݺ.- 6III!e]롊 **EFFz*p6`T.'G?? hƬ3RRy޹;PX_~x߾cC./K k㋍3@Dxi,`EvOB,=C~-0N)U?*"YϤG֍3N?,2o{EcǎQZVΆ4oɌt:cڷ?=80ti}GyP"<(,*"99^~a;RJ◝zಆ<3=k2+"|f=4՜˳ޭidfڶ8ዂ/Yy>>d{1n#%%k?( t>ii!x{psz{mͪg v`W_tOn8ϑ@a!@`XT Rj5Zu2%!3#.sS-*L^\K񀃱yՕ'gGzIMM%..GR]SCbBB[i蕋RtBB<'29>`XcLZ%~و{6`"p![b SJ= >B>m0+Hf,zeqă 6R5r4_'@%Ry@^r"2n|qViZUU E'V}@6R$$`i<4>ϏE~dPQQdo=Iϊ3g=y0!{{.9@j[-pcNVҀ@ˣ"3 #Na48~pҶ%Nlџ-tUUU1g򝠩p|`4  Bi m8ZYr.??$n&n`ՖCLДR'+a ALl u۷~ oYp HB)A(A ٱF4' 'F, +m464L?q %D]cIP8`޽X8#<(4@44P"_^4A5 w 'b'g~v$J>"H"'8ˀX)pSHsϚ S86i)t˲0 ?ߥQoXAB &DД򫺀h(냅Uj`0hQT p| SvXIENDB`jarun-nnn-53baef9/misc/logo/logo.svg000066400000000000000000000711121524007152400174760ustar00rootroot00000000000000 n³ logo image/svg+xml n³ logo Léo Villeveygoux jarun-nnn-53baef9/misc/macos-legacy/000077500000000000000000000000001524007152400174175ustar00rootroot00000000000000jarun-nnn-53baef9/misc/macos-legacy/mach_gettime.c000066400000000000000000000022501524007152400222100ustar00rootroot00000000000000#include "mach_gettime.h" #include #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 */ jarun-nnn-53baef9/misc/macos-legacy/mach_gettime.h000066400000000000000000000014661524007152400222250ustar00rootroot00000000000000#ifndef mach_time_h #define mach_time_h #include #include #include #include /* 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 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 */ jarun-nnn-53baef9/misc/musl/000077500000000000000000000000001524007152400160335ustar00rootroot00000000000000jarun-nnn-53baef9/misc/musl/musl-static-ubuntu.sh000077500000000000000000000047341524007152400221670ustar00rootroot00000000000000#!/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 names BIN=nnn-musl-static EMOJIBIN=nnn-musl-emoji-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)) cd .. # Compile nnn with Emoji [ -d "./netbsd-curses" ] && [ -d ./musl-fts ] || rm -- "$EMOJIBIN" musl-gcc -DEMOJI -std=c11 -Wall -Wextra -Wshadow -O3 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DICONS_GENERATE -o src/icons-hash-gen src/icons-hash.c ./src/icons-hash-gen > src/icons-generated-emoji.h musl-gcc -O3 -DNORL -DNOMOUSE -DEMOJI -DICONS_INCLUDE=\"icons-generated-emoji.h\" -std=c11 -Wall -Wextra -Wshadow -I./netbsd-curses/libcurses -I./musl-fts -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -o "$EMOJIBIN" src/nnn.c -Wl,-Bsymbolic-functions -lpthread -L./netbsd-curses/libs -lcurses -lterminfo -static -L./musl-fts/.libs -lfts # Compile nnn [ -d "./netbsd-curses" ] && [ -d ./musl-fts ] || 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 jarun-nnn-53baef9/misc/natool/000077500000000000000000000000001524007152400163475ustar00rootroot00000000000000jarun-nnn-53baef9/misc/natool/natool000077500000000000000000000025641524007152400176000ustar00rootroot00000000000000#!/usr/bin/env python3 # ############################################################################# # natool: a wrapper script to patool to list, extract and create archives # # 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 # # Brief: # natool is written to integrate patool (instead of the default atool) with nnn # 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 © 2019 Arun Prakash Jana # ############################################################################# import sys from subprocess import Popen, PIPE if len(sys.argv) < 3: print('usage: natool [-a] [-l] [-x] [archive] [file/dir]') sys.exit(0) 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'] cmd.extend(sys.argv[2:]) elif sys.argv[1] == '-x': cmd = ['patool', '--non-interactive', 'extract'] cmd.extend(sys.argv[2:]) else: sys.exit(0) pipe = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) out, err = pipe.communicate() print(out.decode()) print(err.decode()) jarun-nnn-53baef9/misc/packagecore/000077500000000000000000000000001524007152400173175ustar00rootroot00000000000000jarun-nnn-53baef9/misc/packagecore/packagecore.yaml000066400000000000000000000047561524007152400224630ustar00rootroot00000000000000name: nnn maintainer: Arun Prakash Jana license: BSD 2-Clause summary: The unorthodox terminal file manager. homepage: https://github.com/jarun/nnn commands: install: - make PREFIX="/usr" strip install DESTDIR="${BP_DESTDIR}" packages: centos7.5: builddeps: - make - gcc - pkgconfig - ncurses-devel - readline-devel deps: - ncurses - readline commands: pre: - yum install epel-release centos7.6: builddeps: - make - gcc - pkgconfig - ncurses-devel - readline-devel deps: - ncurses - readline commands: pre: - yum install epel-release 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 debian9: builddeps: - make - gcc - pkg-config - libncursesw5-dev - libreadline-dev deps: - libncursesw5 - readline-common debian10: builddeps: - make - gcc - pkg-config - libncurses-dev - libreadline-dev deps: - libncursesw6 - readline-common fedora32: builddeps: - make - gcc - pkg-config - ncurses-devel - readline-devel deps: - ncurses - readline # opensuse15.2: # builddeps: # - make # - gcc # - pkg-config # - readline-devel # - ncurses-devel # deps: # - 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 jarun-nnn-53baef9/misc/quitcd/000077500000000000000000000000001524007152400163445ustar00rootroot00000000000000jarun-nnn-53baef9/misc/quitcd/quitcd.bash_sh_zsh000066400000000000000000000017411524007152400220550ustar00rootroot00000000000000n () { # 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 } } jarun-nnn-53baef9/misc/quitcd/quitcd.csh000066400000000000000000000012371524007152400203370ustar00rootroot00000000000000# 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"' jarun-nnn-53baef9/misc/quitcd/quitcd.elv000066400000000000000000000016321524007152400203470ustar00rootroot00000000000000# 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 } } jarun-nnn-53baef9/misc/quitcd/quitcd.fish000066400000000000000000000022451524007152400205130ustar00rootroot00000000000000# 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 jarun-nnn-53baef9/misc/quitcd/quitcd.nu000066400000000000000000000024101524007152400201760ustar00rootroot00000000000000# 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 -> 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 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 replace --all --regex `^cd '|'$` `` | str replace --all `'\''` `'` ^rm -- $nnn_tmpfile cd $path } } jarun-nnn-53baef9/misc/quitcd/quitcd.rc000066400000000000000000000006011524007152400201600ustar00rootroot00000000000000# 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. NNN_TMPFILE='$HOME/.config/nnn/.lastd' fn n { command nnn eval `( cat $NNN_TEMPFILE ) rm -f -- $NNN_TMPFILE } jarun-nnn-53baef9/misc/test/000077500000000000000000000000001524007152400160325ustar00rootroot00000000000000jarun-nnn-53baef9/misc/test/benchmark.sh000077500000000000000000000012331524007152400203220ustar00rootroot00000000000000#!/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 jarun-nnn-53baef9/misc/test/genfiles.sh000077500000000000000000000002421524007152400201630ustar00rootroot00000000000000#!/bin/sh # Generates 100000 files in the current directory i=1; while [ $i -le 100000 ]; do mktemp -p . -t 'XXXXXXXXXXXXXXXXXXXXX' i=$(( i + 1 )) done jarun-nnn-53baef9/misc/test/mktest.sh000077500000000000000000000071531524007152400177060ustar00rootroot00000000000000#!/bin/sh # Create test files and directories test -e outdir && { echo "Remove 'outdir' and try again" exit 1 } mkdir -p outdir && cd outdir || exit 1 echo 'It works!' > normal.txt echo 'Με δουλέβει;' > 'κοινό.txt' ln -sf normal.txt ln-normal.txt ln -sf normal.txt ln-normal mkdir -p normal-dir ln -sf normal-dir ln-normal-dir ln -sf nowhere ln-nowhere mkfifo mk-fifo touch no-access && chmod 000 no-access mkdir -p no-access-dir && chmod 000 no-access-dir ln -sf ../normal.txt normal-dir/ln-normal.txt ln -sf ../normal.txt normal-dir/ln-normal echo 'int main(void) { *((char *)0) = 0; }' > ill.c make ill > /dev/null echo 'test/ill' > ill.sh mkdir -p empty-dir mkdir -p cage 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)' touch 'unicode/Malgudi Days - मालगुडी डेज - E05. Swami and Friends - स्वामी और उसके दोस्त (Part 3)' chmod +x 'unicode/Malgudi Days - मालगुडी डेज - E05. Swami and Friends - स्वामी और उसके दोस्त (Part 2)' touch 'unicode/Führer' touch 'unicode/Eso eso aamar ghare eso ♫ এসো এসো আমার ঘরে এসো ♫ Swagatalakshmi Dasgupta' touch 'max_chars_filename_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' jarun-nnn-53baef9/misc/test/nnn_runner.sh000077500000000000000000000307051524007152400205600ustar00rootroot00000000000000#!/bin/sh # # POSIX test wrapper for nnn (no tmux dependency) # # Runs nnn inside a pty (via the `script` command) and feeds it keystrokes # from an input file, one input per line. Captures terminal output for # verification. # # Dependencies: script (from util-linux / POSIX), mkfifo # # Usage: # ./misc/test/nnn_runner.sh [OPTIONS] [nnn-args ...] # # Options: # -e Path to nnn binary (default: ./nnn) # -d Working directory for nnn (default: temporary dir) # -o Output directory for snapshots (default: /tmp/nnn-test.) # -t Delay in milliseconds between inputs (default: 200) # -v Verbose: print each input as it is sent # -h Show this help # # Input file format: # One input per line. Blank lines and lines starting with '#' are skipped. # Lines starting with '@' are directives: # @sleep Extra delay in milliseconds # @snapshot