mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Fix #27: use catfish as default search utility
This commit is contained in:
parent
ba49beac79
commit
71bc3c7432
|
@ -146,6 +146,7 @@ Right, Enter, l, ^M | Open file or enter dir
|
||||||
- | Jump to last visited dir
|
- | Jump to last visited dir
|
||||||
o | Open dir in NNN_DE_FILE_MANAGER
|
o | Open dir in NNN_DE_FILE_MANAGER
|
||||||
/ | Filter dir contents
|
/ | Filter dir contents
|
||||||
|
^/ | Search dir in catfish
|
||||||
c | Show change dir prompt
|
c | Show change dir prompt
|
||||||
d | Toggle detail view
|
d | Toggle detail view
|
||||||
D | Toggle current file details screen
|
D | Toggle current file details screen
|
||||||
|
@ -200,11 +201,12 @@ nnn is designed to play files using multiple strategies (in order of decreasing
|
||||||
export NNN_OPENER=xdg-open
|
export NNN_OPENER=xdg-open
|
||||||
export NNN_OPENER="gio open"
|
export NNN_OPENER="gio open"
|
||||||
export NNN_OPENER=gvfs-open
|
export NNN_OPENER=gvfs-open
|
||||||
- If nnn recognizes the file extension, it invokes nlay (which invokes the players). Default players:
|
- If nnn recognizes the file extension, it invokes nlay (which invokes the players). Default apps:
|
||||||
- mpv - audio and video
|
- mpv - audio and video
|
||||||
- viewnior - image
|
- viewnior - image
|
||||||
- [zathura](https://pwmt.org/projects/zathura/) - pdf
|
- [zathura](https://pwmt.org/projects/zathura/) - pdf
|
||||||
- vim - plain text
|
- vim - plain text
|
||||||
|
- catfish - search
|
||||||
- to add, remove recognized extensions in nnn, see [how to change file associations](#change-file-associations)
|
- 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)
|
- If a file without any extension is a plain text file, it is opened in EDITOR (fallback vi)
|
||||||
- Set `NNN_FALLBACK_OPENER` as the fallback opener. E.g.:
|
- Set `NNN_FALLBACK_OPENER` as the fallback opener. E.g.:
|
||||||
|
|
|
@ -35,6 +35,8 @@ static struct key bindings[] = {
|
||||||
{ 'l', SEL_GOIN, "", "" },
|
{ 'l', SEL_GOIN, "", "" },
|
||||||
/* Filter */
|
/* Filter */
|
||||||
{ '/', SEL_FLTR, "", "" },
|
{ '/', SEL_FLTR, "", "" },
|
||||||
|
/* Desktop search */
|
||||||
|
{ CONTROL('_'), SEL_SEARCH, "", "" },
|
||||||
/* Next */
|
/* Next */
|
||||||
{ 'j', SEL_NEXT, "", "" },
|
{ 'j', SEL_NEXT, "", "" },
|
||||||
{ KEY_DOWN, SEL_NEXT, "", "" },
|
{ KEY_DOWN, SEL_NEXT, "", "" },
|
||||||
|
|
11
nlay
11
nlay
|
@ -120,3 +120,14 @@ if [ "$2" == "text" ]; then
|
||||||
eval $app $txt_opts "\"$1\"" $bg
|
eval $app $txt_opts "\"$1\"" $bg
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#----------------- SEARCH -------------------
|
||||||
|
if [ "$2" == "search" ]; then
|
||||||
|
app=catfish
|
||||||
|
#search_opts=
|
||||||
|
|
||||||
|
bg=">/dev/null 2>&1 &"
|
||||||
|
|
||||||
|
eval $app $search_opts "\"$1\"" $bg
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
2
nnn.1
2
nnn.1
|
@ -51,6 +51,8 @@ Change to the last visited directory
|
||||||
Open directory in NNN_DE_FILE_MANAGER
|
Open directory in NNN_DE_FILE_MANAGER
|
||||||
.It Ic /
|
.It Ic /
|
||||||
Change filter (more information below)
|
Change filter (more information below)
|
||||||
|
.It Ic ^/
|
||||||
|
Search directory in catfish
|
||||||
.It Ic c
|
.It Ic c
|
||||||
Change into the given directory
|
Change into the given directory
|
||||||
.It Ic d
|
.It Ic d
|
||||||
|
|
10
nnn.c
10
nnn.c
|
@ -84,6 +84,7 @@ enum action {
|
||||||
SEL_BACK,
|
SEL_BACK,
|
||||||
SEL_GOIN,
|
SEL_GOIN,
|
||||||
SEL_FLTR,
|
SEL_FLTR,
|
||||||
|
SEL_SEARCH,
|
||||||
SEL_NEXT,
|
SEL_NEXT,
|
||||||
SEL_PREV,
|
SEL_PREV,
|
||||||
SEL_PGDN,
|
SEL_PGDN,
|
||||||
|
@ -1212,6 +1213,7 @@ show_help(void)
|
||||||
- | Jump to last visited dir\n\
|
- | Jump to last visited dir\n\
|
||||||
o | Open dir in NNN_DE_FILE_MANAGER\n\
|
o | Open dir in NNN_DE_FILE_MANAGER\n\
|
||||||
/ | Filter dir contents\n\
|
/ | Filter dir contents\n\
|
||||||
|
^/ | Search dir in catfish\n\
|
||||||
c | Show change dir prompt\n\
|
c | Show change dir prompt\n\
|
||||||
d | Toggle detail view\n\
|
d | Toggle detail view\n\
|
||||||
D | Toggle current file details screen\n\
|
D | Toggle current file details screen\n\
|
||||||
|
@ -1658,6 +1660,14 @@ nochange:
|
||||||
if (ndents > 0)
|
if (ndents > 0)
|
||||||
mkpath(path, dents[cur].name, oldpath, PATH_MAX);
|
mkpath(path, dents[cur].name, oldpath, PATH_MAX);
|
||||||
goto nochange;
|
goto nochange;
|
||||||
|
case SEL_SEARCH:
|
||||||
|
exitcurses();
|
||||||
|
if (player)
|
||||||
|
spawn(player, path, "search", NULL, 0);
|
||||||
|
else
|
||||||
|
spawn("nlay", path, "search", NULL, 0);
|
||||||
|
initcurses();
|
||||||
|
break;
|
||||||
case SEL_NEXT:
|
case SEL_NEXT:
|
||||||
if (cur < ndents - 1)
|
if (cur < ndents - 1)
|
||||||
cur++;
|
cur++;
|
||||||
|
|
Loading…
Reference in a new issue