feat(nnn): zsh config

This commit is contained in:
Michel 2024-02-13 14:19:12 +01:00
parent 28e04e04bd
commit 6167ebe389
1 changed files with 6 additions and 2 deletions

8
.zshrc
View File

@ -4,7 +4,7 @@
### Debian Settings ### Debian Settings
### ###
# apt install bat curl fd-find fzf lsd ripgrep # apt install bat curl fd-find fzf lsd ripgrep xdg-utils
# dpkg-divert --divert /usr/bin/bat --rename /usr/bin/batcat # dpkg-divert --divert /usr/bin/bat --rename /usr/bin/batcat
# dpkg-divert --divert /usr/bin/fd --rename /usr/bin/fdfind # dpkg-divert --divert /usr/bin/fd --rename /usr/bin/fdfind
@ -251,7 +251,7 @@ export NNN_BMS="d:~/Downloads"
export NNN_OPENER="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke" export NNN_OPENER="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
export NNN_OPTS='ABeGo' export NNN_OPTS='ABeGo'
export NNN_ORDER="t:$HOME/Downloads" export NNN_ORDER="t:$HOME/Downloads"
export NNN_PLUG='d:fzcd;o:-!xdg-open "$nnn"*;z:fzopen' export NNN_PLUG='b:-!bat --paging=always "$nnn"*;d:fzcd;m:mimelist;o:-!mimeopen --ask "$nnn"*;O:-!mimeopen "$nnn"*;U:umounttree;z:fzopen'
if (( ${+commands[trash-put]} )); then if (( ${+commands[trash-put]} )); then
export NNN_TRASH=1 export NNN_TRASH=1
elif (( ${+commands[gio]} )); then elif (( ${+commands[gio]} )); then
@ -268,6 +268,8 @@ n()
export GUI=1 # plugins: nuke, xdgdefault export GUI=1 # plugins: nuke, xdgdefault
export LESS=${LESS/F} export LESS=${LESS/F}
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/cd-on-quit" export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/cd-on-quit"
export PATH=$HOME/.config/nnn/plugins:$PATH
command nnn "$@" command nnn "$@"
if [ -f $NNN_TMPFILE ]; then if [ -f $NNN_TMPFILE ]; then
@ -279,6 +281,7 @@ n()
dirs -v dirs -v
fi fi
} }
compdef n=nnn
nnn-file-widget() { nnn-file-widget() {
# Extract "shell word" at cursor position (respecting quotes) # Extract "shell word" at cursor position (respecting quotes)
@ -504,6 +507,7 @@ typeset -U path fpath
### ###
compdef bat=batcat compdef bat=batcat
compdef locate=glocate
# Hide "parameters" (i.e. environment variables) when looking for a "command" # Hide "parameters" (i.e. environment variables) when looking for a "command"
zstyle ':completion:*:-command-:*' tag-order '!parameters' zstyle ':completion:*:-command-:*' tag-order '!parameters'