move nnn configuration to its own file, fixes
This commit is contained in:
parent
ea0a655fa8
commit
86c249c53b
5
nnn/.config/.nnn.env
Normal file
5
nnn/.config/.nnn.env
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
export NNN_OPTS='ds'
|
||||||
|
export NNN_COLORS='1235'
|
||||||
|
export NNN_TRASH=1
|
||||||
|
export NNN_FCOLORS='c1e2272e006033f7c6d6abc4'
|
||||||
|
export NNN_PLUG='s:start_shell'
|
||||||
7
nnn/.config/nnn/plugins/start_shell
Executable file
7
nnn/.config/nnn/plugins/start_shell
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
# Description: Start an interactive zsh shell.
|
||||||
|
|
||||||
|
export nnn="$1"
|
||||||
|
|
||||||
|
zsh -i
|
||||||
@ -1,6 +1,5 @@
|
|||||||
alias sx="startx"
|
alias sx="startx"
|
||||||
alias lss="ls -alh"
|
alias lss="ls -alh"
|
||||||
alias n="nnn"
|
|
||||||
|
|
||||||
# vim
|
# vim
|
||||||
alias v="nvim"
|
alias v="nvim"
|
||||||
|
|||||||
@ -1,8 +1,3 @@
|
|||||||
export EDITOR=vim
|
export EDITOR=vim
|
||||||
|
|
||||||
export NNN_OPTS='ds'
|
|
||||||
export NNN_COLORS='1235'
|
|
||||||
export NNN_TRASH=1
|
|
||||||
|
|
||||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
|
|
||||||
|
|||||||
@ -6,5 +6,15 @@ path+=("$(go env GOPATH)/bin")
|
|||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
source ~/.config/.env
|
source ~/.config/.env
|
||||||
source ~/.config/.env.system
|
# source system specific environment variables
|
||||||
|
if [[ -f ~/.config/.system.env ]]; then
|
||||||
|
echo ".system.env"
|
||||||
|
source ~/.config/.system.env
|
||||||
|
fi
|
||||||
|
# source nnn environment variables
|
||||||
|
if [[ -f ~/.config/.nnn.env ]]; then
|
||||||
|
echo ".nnn.env"
|
||||||
|
source ~/.config/.nnn.env
|
||||||
|
fi
|
||||||
|
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
|
|||||||
39
zsh/.zshrc
39
zsh/.zshrc
@ -22,7 +22,7 @@ compinit
|
|||||||
autoload -U colors
|
autoload -U colors
|
||||||
colors
|
colors
|
||||||
PROMPT="%{$fg_bold[yellow]%}%* %{$fg_bold[blue]%}%d %(?.$fg_bold[green]✓.$fg_bold[red]%?)
|
PROMPT="%{$fg_bold[yellow]%}%* %{$fg_bold[blue]%}%d %(?.$fg_bold[green]✓.$fg_bold[red]%?)
|
||||||
%(3L.$fg_bold[red]%L .)%{%(?.$fg_bold[green].$fg_bold[red])%}%%%{$reset_color%} "
|
%{%(3L.$fg_bold[red]%L .)%}%{%(?.$fg_bold[green].$fg_bold[red])%}%%%{$reset_color%} "
|
||||||
|
|
||||||
source $HOME/.config/.aliases
|
source $HOME/.config/.aliases
|
||||||
source $HOME/.config/.aliases.local
|
source $HOME/.config/.aliases.local
|
||||||
@ -50,4 +50,41 @@ if [[ -f ~/.last_dir ]]; then
|
|||||||
cd $(cat ~/.last_dir)
|
cd $(cat ~/.last_dir)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# save path on quiting nnn (and alias it to 'n')
|
||||||
|
function n {
|
||||||
|
# Block nesting of nnn in subshells
|
||||||
|
if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then
|
||||||
|
echo "nnn is already running"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# The default behaviour is to cd on quit (nnn checks if NNN_TMPFILE is set)
|
||||||
|
# To cd on quit only on ^G, remove the "export" as in:
|
||||||
|
# NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
|
# NOTE: NNN_TMPFILE is fixed, should not be modified
|
||||||
|
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
||||||
|
|
||||||
|
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
|
||||||
|
# stty start undef
|
||||||
|
# stty stop undef
|
||||||
|
# stty lwrap undef
|
||||||
|
# stty lnext undef
|
||||||
|
|
||||||
|
nnn "$@"
|
||||||
|
|
||||||
|
if [ -f "$NNN_TMPFILE" ]; then
|
||||||
|
. "$NNN_TMPFILE"
|
||||||
|
rm -f "$NNN_TMPFILE" > /dev/null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# cd to $PWD of exited subshell in nnn
|
||||||
|
function nnn_cd {
|
||||||
|
if ! [ -z "$NNN_PIPE" ]; then
|
||||||
|
printf "%s\0" "0c${PWD}" > "${NNN_PIPE}" !&
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
trap nnn_cd EXIT
|
||||||
|
|
||||||
eval `keychain --eval --quiet --agents ssh,gpg id_rsa`
|
eval `keychain --eval --quiet --agents ssh,gpg id_rsa`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user