commit 48a440edb93d19b4eb89ca1c11f071447bc55ea5
parent b2a0fe4d5e63e4fcf9ee577bd098beafae536dfc
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sat, 9 Mar 2019 11:18:01 +0100
Change file browser to nnn
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/links/.commands.sh b/links/.commands.sh
@@ -6,7 +6,7 @@
alias b='bash'
alias z='zsh'
alias v='vim'
-alias r='ranger'
+alias n='nnn'
## cd
alias cg='c "$(git rev-parse --show-toplevel)"' # cd under git repo
@@ -34,6 +34,8 @@ alias la='ls -A'
## Open files
o() {
+ [[ "$#" -gt 0 && -f "$1" ]] && (xdg-open "$1" & disown)
+
IFS=$'\n' out=($(fzf --query="$1" --exit-0 --expect=ctrl-o,ctrl-e --preview-window=hidden))
key=$(head -1 <<< "$out")
file=$(head -2 <<< "$out" | tail -1)