`nnn` is a fork of [noice](http://git.2f30.org/noice/), a blazing-fast lightweight terminal file browser with easy keyboard shortcuts for navigation, opening files and running tasks. noice is developed considering terminal based systems. There is no config file and mime associations are hard-coded. However, the incredible user-friendliness and speed make it a perfect utility on modern distros.
-`nnn` can use the default desktop opener at runtime and handle media types with `nlay`, a customizable bash script. `nnn` adds new navigation options, [navigate-as-you-type](#navigate-as-you-type-mode) mode, enhanced DE integration, a disk usage analyzer mode, comprehensive file details and much more. Add to that a huge [performance](#performance) boost. For a detailed comparison, visit [nnn vs. noice](https://github.com/jarun/nnn/wiki/nnn-vs.-noice).
+`nnn` can use the default desktop opener at runtime and handle media types with [nlay](https://github.com/jarun/nnn/wiki/all-about-nlay), a customizable bash script. `nnn` adds new navigation options, [navigate-as-you-type](#navigate-as-you-type-mode) mode, enhanced DE integration, a disk usage analyzer mode, comprehensive file details and much more. Add to that a huge [performance](#performance) boost. For a detailed comparison, visit [nnn vs. noice](https://github.com/jarun/nnn/wiki/nnn-vs.-noice).
If you want to edit a file in vim with some soothing music in the background while referring to a spec in your GUI PDF viewer, `nnn` got it! All from the same terminal session. Follow the instructions in the [quickstart](#quickstart) section and see how `nnn` simplifies those long desktop sessions...
& | Jump to initial dir
- | Jump to last visited dir
/ | Filter dir contents
- ^/ | Search dir in gnome-search-tool
+ ^/ | Search dir in desktop search tool
. | Toggle hide .dot files
c | Show change dir prompt
d | Toggle detail view
export NNN_OPENER=gvfs-open
- If `nnn` recognizes the file extension, it invokes nlay (which invokes the players). Default apps:
- mpv - audio and video
- - viewnior - image
+ - viewnior, fim - image
- [zathura](https://pwmt.org/projects/zathura/) - pdf
- vim - plain text
- - gnome-search-tool - search
+ - gnome-search-tool, catfish - search
- vlock - terminal screensaver
- to add, remove recognized extensions in `nnn`, see [how to change file associations](#change-file-associations)
- If a file without any extension is a plain text file, it is opened in EDITOR (fallback vi)
# MUST READ:
#
# 1. Feel free to change the default apps to your favourite ones.
-# If you change the app for a group you may also need to modify the bg
-# setting. If bg is set the app is detached and started in the background in
-# silent mode.
+# If you change the app for a group you may also need to modify the opts and
+# bg settings. If bg is set the app is detached and started in the background
+# in silent mode.
#
# The bg setting depends on personal preference and type of app, e.g.,
# I would start vim (CLI) in the foreground but Sublime Text (GUI) in the
#------------------ AUDIO -------------------
if [ "$2" == "audio" ]; then
app=mpv
+
# To start mpv in a window enable opts
#opts="--no-terminal --force-window"
eval $app $opts "\"$1\"" $bg
exit 0
-fi
#------------------ VIDEO -------------------
-if [ "$2" == "video" ]; then
+elif [ "$2" == "video" ]; then
app=mpv
+
# To start mpv in a window enable opts
#opts="--no-terminal --force-window"
eval $app $opts "\"$1\"" $bg
exit 0
-fi
#------------------ IMAGE -------------------
-if [ "$2" == "image" ]; then
- app=viewnior
- #opts=
+elif [ "$2" == "image" ]; then
+ app=("viewnior"
+ "fim")
- bg=">/dev/null 2>&1 &"
+ opts=(""
+ "-a --cd-and-readdir")
- eval $app $opts "\"$1\"" $bg
- exit 0
-fi
+ bg=(">/dev/null 2>&1 &"
+ ">/dev/null 2>&1 &")
#------------------- PDF --------------------
-if [ "$2" == "pdf" ]; then
- app=zathura
- #opts=
+elif [ "$2" == "pdf" ]; then
+ app=("zathura")
- bg=">/dev/null 2>&1 &"
+ opts=("")
- eval $app $opts "\"$1\"" $bg
- exit 0
-fi
+ bg=(">/dev/null 2>&1 &")
#---------------- PLAINTEXT -----------------
-if [ "$2" == "text" ]; then
- app=vim
- #opts=
+elif [ "$2" == "text" ]; then
+ app=("vim")
- #bg=">/dev/null 2>&1 &"
+ opts=("")
- eval $app $opts "\"$1\"" $bg
- exit 0
-fi
+ bg=("")
#----------------- SEARCH -------------------
-if [ "$2" == "search" ]; then
- app=gnome-search-tool
- #opts=
+elif [ "$2" == "search" ]; then
+ app=("gnome-search-tool"
+ "catfish")
- bg=">/dev/null 2>&1 &"
+ opts=(""
+ "--path")
- eval $app $opts --path "\"$1\"" $bg
- exit 0
-fi
+ bg=(">/dev/null 2>&1 &"
+ ">/dev/null 2>&1 &")
#--------------- SCREENSAVER ----------------
-if [ "$2" == "screensaver" ]; then
+elif [ "$2" == "screensaver" ]; then
app=vlock
+
#opts=
#bg=">/dev/null 2>&1 &"
+ type -P $app &>/dev/null &&
eval $app $opts $bg
exit 0
fi
+
+#------------------- PLAY -------------------
+for index in ${!app[@]}
+do
+ type -P ${app[$index]} &>/dev/null &&
+ eval ${app[$index]} ${opts[$index]} "\"$1\"" ${bg[$index]}
+done