diff --git a/.clang-tidy b/.clang-tidy index 82b705e..2ed66e3 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,5 @@ --- -Checks: 'clang-diagnostic-*,clang-analyzer-*,readability-*,modernize-*,bugprone-*,misc-*,-misc-unused-parameters,google-runtime-int,-llvm-header-guard,fuchsia-restrict-system-includes,-clang-analyzer-valist.Uninitialized,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-alpha.*,-readability-magic-numbers,-readability-braces-around-statements' +Checks: 'clang-diagnostic-*,clang-analyzer-*,readability-*,modernize-*,bugprone-*,misc-*,-misc-unused-parameters,google-runtime-int,-llvm-header-guard,fuchsia-restrict-system-includes,-clang-analyzer-valist.Uninitialized,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-alpha.*,-readability-magic-numbers,-readability-braces-around-statements,-readability-isolate-declaration,-bugprone-narrowing-conversions' WarningsAsErrors: '*' HeaderFilterRegex: '.*(?^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 diff --git a/Makefile b/Makefile index 4e35c6a..fce5f06 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION = 2.3 +VERSION = 2.4 PREFIX ?= /usr/local MANPREFIX ?= $(PREFIX)/share/man diff --git a/README.md b/README.md index 6467961..d6bc95b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -## nnn - -Noice is Not Noice, a noicer fork... +## nnn (_type less, do more_)
@@ -20,17 +18,15 @@ Noice is Not Noice, a noicer fork... [![nnn video](https://i.imgur.com/ZB5UdQ8.jpg)](https://www.youtube.com/watch?v=U2n5aGqou9E "Click to see nnn in action!") -
nnn in action! (Thanks Luke Smith for the video!)
- -`nnn` is smooth... like butter. It's also one of the fastest and most lightweight file managers you have ever used. It comes in a `~50KB` binary using `~3.5MB` resident memory at runtime. +video of nnn in action (an earlier release)
-Runs on Linux, macOS, Raspberry Pi, BSD, Cygwin, Linux subsystem for Windows and Termux on Android. +`nnn` is one of the fastest and most lightweight file managers you have ever used (`~50KB` binary, `~3.5MB` resident memory usage, [highly optimized](https://github.com/jarun/nnn/wiki/performance-factors) code). And yet, it doesn't lack in features! -`nnn` works with your DE and favourite GUI utilities, has a unique _navigate-as-you-type_ mode with auto-select, disk usage analyzer mode, bookmarks, contexts, application launcher, familiar navigation shortcuts, shell spawning, quick notes and much more. +`nnn` works seamlessly with your DE and favourite GUI utilities. It runs on Linux, macOS, Raspberry Pi, BSD, Cygwin, Linux subsystem for Windows and Termux on Android. -It supports as many scripts as you need! Integrate utilities like sxiv (view images in directory) or fzy (fuzzy search subtree) with available scripts (or your own), transfer selected files using lftp or use it as a (neo)vim plugin. Refer to the wiki [How to](https://github.com/jarun/nnn/wiki/How-to) for more such use cases. +Have as many scripts as you want to extend the power of `nnn`! Pick from the [scripts repository](https://github.com/jarun/nnn/tree/master/user-scripts) or add your own. -[Quickstart](#quickstart) and see how `nnn` simplifies those long desktop sessions. +[Quickstart](#quickstart) and see how `nnn` simplifies long desktop sessions. When you are ready for more, start [hacking `nnn`](https://github.com/jarun/nnn/wiki/hacking-nnn). *Love smart and efficient utilities? Explore [my repositories](https://github.com/jarun?tab=repositories). Buy me a cup of coffee if they help you.* @@ -48,6 +44,7 @@ It supports as many scripts as you need! Integrate utilities like sxiv (view ima - [Release packages](#release-packages) - [From source](#from-source) - [Shell completion](#shell-completion) +- [Quickstart](#quickstart) - [Usage](#usage) - [Cmdline options](#cmdline-options) - [Keyboard shortcuts](#keyboard-shortcuts) @@ -60,7 +57,6 @@ It supports as many scripts as you need! Integrate utilities like sxiv (view ima - [File indicators](#file-indicators) - [Configuration](#configuration) - [Help](#help) -- [Quickstart](#quickstart) - [User scripts](#user-scripts) - [Troubleshooting](#troubleshooting) - [Tmux configuration](#tmux-configuration) @@ -70,15 +66,16 @@ It supports as many scripts as you need! Integrate utilities like sxiv (view ima - [Why fork?](#why-fork) - [Mentions](#mentions) - [Developers](#developers) -- [Contributions](#contributions) #### FEATURES - Modes - - Detail (default), light, disk usage analyzer (du) - - File picker, vim (or neovim) plugin + - Detail (default), light + - Disk usage analyzer (block/apparent) + - File picker, (neo)vim plugin - Navigation - *Navigate-as-you-type* with auto-select directory + - *Wild load* for *navigate-as-you-type* - 4 contexts (_aka_ tabs _aka_ workspaces) - Bookmarks; pin and visit a directory - Familiar, easy shortcuts (arrows, ~, -, @) @@ -102,6 +99,7 @@ It supports as many scripts as you need! Integrate utilities like sxiv (view ima - Copy, move, delete, archive, link selection - FreeDesktop compliant trash (needs trash-cli) - Show copy, move progress on Linux (needs avdcpmv) + - Script to view directory and file diff for selection - Transfer files using lftp - Batch rename (needs vidir) - Per-context directory color (default: blue) @@ -113,7 +111,7 @@ It supports as many scripts as you need! Integrate utilities like sxiv (view ima - Change directory at exit (*easy* shell integration) - Edit file in EDITOR or open in PAGER - Take quick notes - - Terminal locker integration + - Lock the terminal (needs a locker) - Shortcut reference a keypress away - Unicode support - Follows Linux kernel coding style @@ -134,13 +132,13 @@ It supports as many scripts as you need! Integrate utilities like sxiv (view ima | xdg-open (Linux), open(1) (macOS), cygstart (Cygwin) | desktop opener | | file | determine file type | | coreutils (cp, mv, rm), findutils (xargs) | copy, move and remove files | -| trash-cli | trash files (instead of delete) | +| trash-cli | trash files (default: delete) | | mediainfo or exiftool | multimedia file details | -| atool, patool ([integration](https://github.com/jarun/nnn/wiki/How-to#integrate-patool)) | create, list and extract archives | +| atool, patool ([integration](https://github.com/jarun/nnn/wiki/hacking-nnn#integrate-patool)) | create, list and extract archives | | fzy | app launcher with drop-down menu | | vidir (from moreutils) | batch rename dir entries | | vlock (Linux), bashlock (macOS), lock(1) (BSD) | terminal locker | -| advcpmv (Linux) ([integration](https://github.com/jarun/nnn/wiki/How-to#show-cp-mv-progress)) | copy, move progress | +| advcpmv (Linux) ([integration](https://github.com/jarun/nnn/wiki/hacking-nnn#show-cp-mv-progress)) | copy, move progress | | $EDITOR (overridden by $VISUAL, if defined) | edit files (fallback vi) | | $PAGER (less, most) | page through files (fallback less) | | $SHELL | spawn a shell, run script (fallback sh) | @@ -149,6 +147,7 @@ It supports as many scripts as you need! Integrate utilities like sxiv (view ima - [Alpine Linux](https://pkgs.alpinelinux.org/packages?name=nnn) (`apk add nnn`) - [Arch Linux](https://www.archlinux.org/packages/community/x86_64/nnn/) (`pacman -S nnn`) +- [CRUX portdb](https://crux.nu/portdb/?a=search&q=nnn) (`prt-get depinst nnn`) - [Debian](https://packages.debian.org/search?keywords=nnn&searchon=names&exact=1) (`apt-get install nnn`) - [Fedora](https://apps.fedoraproject.org/packages/nnn) (`dnf install nnn`) - [FreeBSD](https://www.freshports.org/misc/nnn) (`pkg install nnn`) @@ -182,13 +181,25 @@ To cook yourself, download the [latest stable release](https://github.com/jarun/ `PREFIX` is supported, in case you want to install to a different location. -- Compilation information for [Raspberry Pi](https://github.com/jarun/nnn/issues/182) +- Compilation for [Raspberry Pi](https://github.com/jarun/nnn/issues/182) - Instructions for [Cygwin](https://github.com/jarun/nnn/wiki/Cygwin-instructions) #### Shell completion Option completion scripts for Bash, Fish and Zsh can be found in respective subdirectories of [`scripts/auto-completion/`](scripts/auto-completion). Please refer to your shell's manual for installation instructions. +#### QUICKSTART + +1. Install the [utilities required](#utility-dependencies) for your regular activities. +2. Configure [cd on quit](https://github.com/jarun/nnn/wiki/hacking-nnn#cd-on-quit). +3. Optionally open all text files in EDITOR (fallback vi): `export NNN_USE_EDITOR=1` +4. Run `n`. +5. To use `nnn` as a GUI app launcher with fuzzy selection menu, drop [`nlaunch`](https://github.com/jarun/nnn/blob/master/user-scripts/nlaunch) somewhere in your `$PATH`. +6. Don't memorize keys. Arrows, / and q suffice. Press ? for help on keyboard shortcuts anytime. + +- For additional functionality [setup custom scripts](#user-scripts). +- Visit the wiki page [hacking `nnn`](https://github.com/jarun/nnn/wiki/hacking-nnn) for many more specific usecases. + #### USAGE #### Cmdline options @@ -213,7 +224,7 @@ optional args: -s string filters [default: regex] -S du mode -v show version - -w wild mode + -w wild load -h show help ``` @@ -259,7 +270,7 @@ Help & settings, file details, media info and archive listing are shown in the P #### Leader key -The Leader key (` or ^/) provides a powerful multi-functional navigation mechanism. It is case-sensitive and understands contexts, bookmarks and handy location shortcuts. +The Leader key provides a powerful multi-functional navigation mechanism. It is case-sensitive and understands contexts, bookmarks and location shortcuts. | Key | Function | |:---:| --- | @@ -277,8 +288,8 @@ The Leader key (` or ^/) provides a powerful multi-functio Contexts serve the purpose of exploring multiple directories simultaneously. 4 contexts are available. The status of the contexts are shown in the top left corner: - the current context is in reverse -- other used contexts are underlined -- rest are unused +- other active contexts are underlined +- rest are inactive To switch to a context press the Leader key followed by the context number (1-4). @@ -288,7 +299,7 @@ When a context is quit, the next active context is selected. If the last active ##### Context-specific color -Each context can have its own color for directories specified: +Each context can have its own directory color specified: export NNN_CONTEXT_COLORS='1234' colors: 0-black, 1-red, 2-green, 3-yellow, 4-blue (default), 5-magenta, 6-cyan, 7-white @@ -304,23 +315,23 @@ To copy multiple absolute file paths: - navigate to another file in the same directory to select a range of files - press ^Y again to save the selection and exit selection mode. -Selected files are visually indicated by a `+`. +_NOTE:_ If you are on BSD/macOS, please check the [BSD terminal issue](https://github.com/jarun/nnn#bsd-terminal-issue) with ^Y for workaround. -The files in the list can now be copied (P), moved (V) or removed (X). +Selected files are visually indicated by a `+`. -To list the file paths copied to memory press y. +The selection can now be listed, copied, moved, removed, archived or linked. File paths are copied to the temporary file `DIR/.nnncp`, where `DIR` (by priority) is: $HOME or, - $TMPDIR or, /tmp + $TMPDIR or, The path is shown in the help and configuration screen. #### Filters -Filters support regexes by default to instantly (search-as-you-type) list the matching entries in the current directory. +Filters support regexes (default) to instantly (search-as-you-type) list the matching entries in the current directory. Common use cases: - to list all matches starting with the filter expression, start the expression with a `^` (caret) symbol @@ -339,7 +350,7 @@ When there's a unique match and it's a directory, `nnn` auto selects the directo This mode takes navigation to the next level when short, unique keypress sequences are possible. For example, to reach `nnn` development directory (located at `~/GitHub/nnn`) from my `$HOME` (which is the default directory the terminal starts in), I use the sequence gn. -The **_wild mode_** program option can be extremely handy for users who use this mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode. +The **_wild load_** option can be extremely handy for users who use this mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode. #### File indicators @@ -365,8 +376,9 @@ The following indicators are used in the detail view: | --- | --- | | `NNN_BMS='d:~/Documents;D:~/Docs archive/'` | specify bookmarks (max 10) | | `NNN_OPENER=mimeopen` | custom file opener | +| `NNN_OPENER_DETACH=1` | do not block when invoking file opener | | `NNN_CONTEXT_COLORS='1234'` | specify per context color [default: '4444' (all blue)] | -| `NNN_IDLE_TIMEOUT=300` | idle time to lock terminal [default: disabled] | +| `NNN_IDLE_TIMEOUT=300` | idle seconds before locking terminal [default: disabled] | | `NNN_COPIER='copier.sh'` | system clipboard copier script [default: none] | | `NNN_SCRIPT=/home/user/scripts[/script.sh]` | path to script dir or a single script | | `NNN_NOTE=/home/user/Dropbox/Public/notes` | path to note file [default: none] | @@ -384,20 +396,6 @@ The following indicators are used in the detail view: $ man nnn To lookup keyboard shortcuts at runtime, press ?. -#### QUICKSTART - -1. Install the [utilities required](#utility-dependencies) for your regular activities. -2. Configure [cd on quit](https://github.com/jarun/nnn/wiki/How-to#cd-on-quit). -3. Optionally open all text files in EDITOR (fallback vi): - - export NNN_USE_EDITOR=1 -4. Run `n`. -5. To use `nnn` as a GUI app launcher with fuzzy selection menu, drop [`nlaunch`](https://github.com/jarun/nnn/blob/master/user-scripts/nlaunch) somewhere in your `$PATH`. -6. Don't memorize keys. Arrows, / and q suffice. Press ? for help on keyboard shortcuts anytime. - -- For additional functionality [setup custom scripts](#user-scripts). -- Visit the [How to](https://github.com/jarun/nnn/wiki/How-to) for many more specific usecases. - #### USER SCRIPTS `nnn` can invoke custom scripts in the current directory (`$PWD` for the script) with the currently selected file name as the argument. @@ -446,6 +444,8 @@ Restrict opening 0-byte files due to [unexpected behaviour](https://github.com/j - one can argue my approach deviates from the goal of the original project - keep the utility `suckless`. `noice` was rudimentary. In my opinion evolution is the taste of time. - I would like to have a bit of control on what features are added in the name of desktop integration. A feature-bloat is the last thing in my mind. Check out [nnn design considerations](https://github.com/jarun/nnn/wiki/nnn-design-considerations) for more details. +Trivia: The name `nnn` stands for _Noice is Not Noice, a noicer fork..._. + #### MENTIONS - [FOSSMint](https://www.fossmint.com/nnn-linux-terminal-file-browser/) @@ -462,6 +462,4 @@ Restrict opening 0-byte files due to [unexpected behaviour](https://github.com/j 2. Copyright © 2014-2016 Dimitris Papastamos 3. Copyright © 2016-2019 [Arun Prakash Jana](https://github.com/jarun) -#### CONTRIBUTIONS - -We need contributors. Please visit the [ToDo list](https://github.com/jarun/nnn/issues/213). +Contributions are welcome. Please visit the [ToDo list](https://github.com/jarun/nnn/issues/213). diff --git a/nnn.1 b/nnn.1 index 83fd18d..7ecee23 100644 --- a/nnn.1 +++ b/nnn.1 @@ -1,4 +1,4 @@ -.Dd Feb 19, 2019 +.Dd Mar 19, 2019 .Dt NNN 1 .Os .Sh NAME @@ -29,145 +29,9 @@ opens the current working directory by default if is not specified. .Sh KEYBINDS .Pp -NAVIGATION -.Pp -.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact -.It Ic [Up], k -Move to previous entry -.It Ic [Down], j -Move to next entry -.It Ic [Left], h -Go to parent directory -.It Ic [Right], [Enter], l -Open file or enter directory -.It Ic [PgUp], ^U -Scroll up half a page -.It Ic [PgDn], ^D -Scroll down half a page -.It Ic [Home], g, ^A -Move to the first entry -.It Ic [End], G, ^E -Move to the last entry -.It Ic ~ -Change to the HOME directory -.It Ic & -Change to initial directory -.It Ic \- -Change to the last visited directory -.It Ic \&. -Toggle show hidden . (dot) files -.It Ic / -Change filter (more information below) -.It Ic [Insert], ^T -Toggle navigate-as-you-type mode -.It Ic b -Pin current directory -.It Ic ^B -Visit pinned directory -.It Ic d -Toggle detail view -.It Ic Tab, ^I -Next context, ask to create if none -.It Ic ,, ^/ -Leader key -.It Ic N, LeaderN -Switch to context N -.It Ic Esc -Exit prompt -.It Ic ^L -Force a redraw, clear prompt -.It Ic q -Quit the current context -.It Ic ^G -Quit and change directory -.It Ic Q, ^Q -Quit -.It Ic \&? -Help and configuration screen -.El -.Pp -FILES -.Pp -.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact -.It Ic ^O -Open with an application -.It Ic n -Create a new file, directory or link(s) to selection -.It Ic D -Show entry details -.It Ic ^R -Rename selected entry -.It Ic r -Batch rename -.It Ic K, ^Y -Toggle selection mode -.It Ic Y -Select all entries in dir -.It Ic Space, ^K -Select entry and copy absolute path -.It Ic y -Show selection list -.It Ic P -Copy files from selection -.It Ic V -Move files from selection -.It Ic X -Delete files from selection -.It Ic ^X -Delete entry -.It Ic f -Archive files -.It Ic F -List files in archive -.It Ic ^F -Extract archive in current directory -.It Ic m, M -Show brief/full media info -.It Ic e -Open entry in EDITOR (fallback vi) -.It Ic p -Open entry in PAGER (fallback less) -.El -.Pp -ORDER TOGGLES -.Pp -.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact -.It Ic ^J -Toggle disk usage analyzer mode -.It Ic S -Toggle sort by apparent size -.It Ic ^W -Wild mode -.It Ic t -Toggle sort by time modified -.It Ic s -Toggle sort by file size -.El -.Pp -MISC -.Pp -.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact -.It Ic \&!, ^] -Spawn SHELL in current directory (fallback sh) -.It Ic C -Execute entry -.It Ic R, ^V -Run or pick a script to run -.It Ic L -Lock terminal -.It Ic ^P -Show command prompt -.It Ic ^N -Take note -.It Ic = -Launcher -.El -.Pp -Backing up one directory level will set the cursor position at the -directory you came out of. -.Pp -Help & settings, file details, media info and archive listing are shown in the -PAGER. Use the PAGER-specific keys in these screens. +Press \fB?\fR in +.Nm +to see the list of keybinds. .Sh OPTIONS .Pp .Nm @@ -204,7 +68,7 @@ supports the following options: show version and exit .Pp .Fl w - wild mode - entries unsorted on directory load + wild load - entries unsorted on directory load .Pp .Fl h show program help and exit @@ -212,31 +76,31 @@ supports the following options: .Nm uses \fIxdg-open\fR (on Linux) and \fIopen(1)\fR (on macOS) as the desktop opener. .Pp -There is no configuration file. Settings work on environment variables. Please -refer to the ENVIRONMENT section below. +There is no configuration file. Settings work on environment variables. See ENVIRONMENT section below. .Pp Configuring .Nm to change to the last visited directory on quit requires shell integration in a -few easy steps. Please visit the project page (linked below) for the -instructions. +few easy steps. Look up NNN_TMPFILE in the ENVIRONMENT section below. .Sh CONTEXTS Contexts serve the purpose of exploring multiple directories simultaneously. 4 contexts are available. The status of the contexts are shown in the top left corner: .Pp - the current context is in reverse .br -- other used contexts are underlined +- other active contexts are underlined .br -- rest are unused +- rest are inactive .Pp To switch to a context press the Leader key followed by the context number (1-4). .Pp The first time a context is entered, it copies the state of the last visited context. Each context remembers its last visited directory. .Pp When a context is quit, the next active context is selected. If the last active context is quit, the program quits. +.Pp +Each context can have its own directory color specified. See ENVIRONMENT section below. .Sh FILTERS -Filters support regexes by default to instantly (search-as-you-type) list the matching +Filters support regexes (default) to instantly (search-as-you-type) list the matching entries in the current directory. .Pp Common use cases: @@ -255,7 +119,7 @@ allowing continuous navigation. Works best with the \fBarrow keys\fR. .br When there's a unique match and it's a directory, `nnn` auto selects the directory and enters it in this mode. .br -The \fIwild mode\fR can be extremely handy for users who use the \fInavigate-as-you-type\fR mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode. +The \fIwild load\fR option can be extremely handy for users who use the \fInavigate-as-you-type\fR mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode. .Sh SELECTION MODE The absolute path of a single file can be copied to clipboard by pressing \fI^K\fR if NNN_COPIER is set (see ENVIRONMENT section below). @@ -271,9 +135,7 @@ Press \fI^Y\fR again to save the selection and exit selection mode. .Pp Selected files are visually indicated by a \fB+\fR. .br -The files in the list can now be copied, moved or removed using respective keyboard shortcuts. -.Pp -To list the selected files press \fIy\fR. +The files in the list can now be listed, copied, moved, removed, archived or linked. .Sh ENVIRONMENT The SHELL, EDITOR (VISUAL, if defined) and PAGER environment variables take precedence when dealing with the !, e and p commands respectively. A single combination to arguments is supported for SHELL and PAGER. @@ -291,6 +153,11 @@ when dealing with the !, e and p commands respectively. A single combination to export NNN_OPENER=mimeopen .Ed .Pp +\fBNNN_OPENER_DETACH:\fR do not block when invoking file opener. +.Bd -literal + export NNN_OPENER_DETACH=1 +.Ed +.Pp \fBNNN_CONTEXT_COLORS:\fR string of color codes for each context, e.g.: .Bd -literal export NNN_CONTEXT_COLORS='1234' diff --git a/scripts/auto-completion/fish/nnn.fish b/scripts/auto-completion/fish/nnn.fish index 59182b5..02f8024 100644 --- a/scripts/auto-completion/fish/nnn.fish +++ b/scripts/auto-completion/fish/nnn.fish @@ -16,4 +16,4 @@ complete -c nnn -s p -r -d 'copy selection to file' complete -c nnn -s s -d 'use substring match for filters' complete -c nnn -s S -d 'start in disk usage analyzer mode' complete -c nnn -s v -d 'show program version and exit' -complete -c nnn -s w -d 'wild mode' +complete -c nnn -s w -d 'wild load' diff --git a/scripts/auto-completion/zsh/_nnn b/scripts/auto-completion/zsh/_nnn index bda285b..20a313f 100644 --- a/scripts/auto-completion/zsh/_nnn +++ b/scripts/auto-completion/zsh/_nnn @@ -20,7 +20,7 @@ args=( '(-s)-s[use substring match for filters]' '(-S)-S[start in disk usage analyzer mode]' '(-v)-v[show program version and exit]' - '(-w)-w[wild mode]' + '(-w)-w[wild load]' '*:filename:_files' ) _arguments -S -s $args diff --git a/scripts/nlay/README.md b/scripts/nlay/README.md new file mode 100644 index 0000000..4671eec --- /dev/null +++ b/scripts/nlay/README.md @@ -0,0 +1,31 @@ +## nlay + +`nlay` (*NnnpLAY*) is a customizable media type or action handler + +### Usage + +`nlay` is not used by `nnn` now. However, the bash script can be used to run desktop search utility or screensaver: + + nlay file type + file: absolute path to file ("" for an action) + type: type of media or action + +### Default apps + +* gnome-search-tool, catfish - file search +* vlock - terminal screensaver (alternatives - cmatrix, termsaver) + +### Perks + +- simple to modify (extensive in-file notes, comments and indicative code) +- handle files by category (e.g. plaintext, search, screensaver) +- support for multiple apps by order of preference +- run app in the foreground or silently detached in the background +- optionally add app arguments + +### Tips to modify + +- set `app=` in any category to change the player +- set `opts=` to use app options +- toggle `bg=` to enable or disable running app silently (`stdout` and `stderr` redirected to `/dev/null`) in background. E.g., vim (CLI) should be verbose and in the foreground while Sublime Text (GUI) can be started silently in the background. +- enable the commented out code under `ENABLE_FILE_TYPE_HANDLING` to handle specific file extensions e.g. use a different app than the one used for the category. diff --git a/src/dbg.h b/src/dbg.h new file mode 100644 index 0000000..4d5b54a --- /dev/null +++ b/src/dbg.h @@ -0,0 +1,88 @@ +/* + * BSD 2-Clause License + * + * Copyright (C) 2014-2016, Lazaros Koromilas