feat(nnn): set env vars as local

This commit is contained in:
Michel 2024-04-16 09:51:20 +02:00
parent a2d96c7305
commit db59542fe7
1 changed files with 37 additions and 19 deletions

56
.zshrc
View File

@ -231,23 +231,22 @@ compdef hg=rg
# To choose an existing instance for nvr, use: # To choose an existing instance for nvr, use:
# `export NVIM=$(nvr --serverlist | fzf --exit-0 --select-1) && echo $NVIM` # `export NVIM=$(nvr --serverlist | fzf --exit-0 --select-1) && echo $NVIM`
# nnn - n³ # nnn - n³
# #
# See https://github.com/jarun/nnn/wiki/Usage#configuration
export NNN_ARCHIVE='\.(7z|bz2|cbz|cbr|gz|tar|tbz|tgz|xz|zip|zst)$' local nnn_plug=(
if (( ${+commands[fuse-archive]} )); then 'b:-!bat --paging=always "$nnn"*'
export NNN_ARCHMNT='fuse-archive' 'd:fzcd'
fi 'z:fzopen'
export NNN_BMS="d:~/Downloads" 'm:mimelist'
export NNN_OPENER="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke" 'o:-!mimeopen "$nnn"*'
export NNN_OPTS='ABeGo' 'O:-!mimeopen --ask "$nnn"*'
export NNN_ORDER="t:$HOME/Downloads" 'U:umounttree'
export NNN_PLUG=';:-!bat --paging=always "$nnn"*;d:fzcd;m:mimelist;o:-!mimeopen --ask "$nnn"*;O:-!mimeopen "$nnn"*;U:umounttree;z:fzopen' ';:-!clear*'
if (( ${+commands[trash-put]} )); then
export NNN_TRASH=1 # TODO Dump trash
elif (( ${+commands[gio]} )); then )
export NNN_TRASH=2
fi
n() n()
{ {
@ -256,10 +255,27 @@ n()
return return
fi fi
export GUI=1 # plugins: nuke, xdgdefault local -x LESS=${LESS/F}
export LESS=${LESS/F} local -x PATH=$HOME/.config/nnn/plugins:$PATH
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/cd-on-quit"
export PATH=$HOME/.config/nnn/plugins:$PATH # See https://github.com/jarun/nnn/wiki/Usage#configuration
local -x GUI=1 # plugins: nuke, xdgdefault
local -x NNN_ARCHIVE='\.(7z|bz2|cbz|cbr|gz|tar|tbz|tgz|xz|zip|zst)$'
local -x NNN_BMS="d:~/Downloads;q:~/QubesIncoming"
local -x NNN_OPENER="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/plugins/nuke"
local -x NNN_OPTS='ABeGo'
local -x NNN_ORDER="t:$HOME/Downloads"
local -x NNN_PLUG=${(j:;:)nnn_plug}
local -x NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/cd-on-quit"
if (( ${+commands[fuse-archive]} )); then
local -x NNN_ARCHMNT='fuse-archive'
fi
if (( ${+commands[trash-put]} )); then
local -x NNN_TRASH=1
elif (( ${+commands[gio]} )); then
local -x NNN_TRASH=2
fi
command nnn "$@" command nnn "$@"
@ -317,6 +333,7 @@ zle -N nnn-file-widget
bindkey -M vicmd '\en' nnn-file-widget bindkey -M vicmd '\en' nnn-file-widget
bindkey -M viins '\en' nnn-file-widget bindkey -M viins '\en' nnn-file-widget
# Whiptail helper # Whiptail helper
# #
# see https://stackoverflow.com/questions/1970180/whiptail-how-to-redirect-output-to-environment-variable # see https://stackoverflow.com/questions/1970180/whiptail-how-to-redirect-output-to-environment-variable
@ -380,6 +397,7 @@ whiptail_menu() {
return $res return $res
} }
### ###
### Aliases -- Global & automatic expansion ### Aliases -- Global & automatic expansion
### ###