commit 1b8493fb234bae49b7deab33f43e7f04019e91dd
parent 2ec9f90dd316fc1c35e140fb95a2901110949012
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sat, 9 Mar 2019 12:09:26 +0100
Add NNN configuration and scripts
Diffstat:
5 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/links/.config/nnn/copy-to-clipboard.sh b/links/.config/nnn/copy-to-clipboard.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env sh
+
+# Description: Copy selection to clipboard
+#
+# Shell: generic
+# Author: Arun Prakash Jana
+
+# Linux
+cat ~/.nnncp | xargs -0 | xsel -bi
+
+# macOS
+# cat ~/.nnncp | xargs -0 | pbcopy
+
+# Termux
+# cat /data/data/com.termux/files/home/.nnncp | xargs -0 | termux-clipboard-set
+
+# Cygwin
+# cat ~/.nnncp | xargs -0 | clip
diff --git a/links/.config/nnn/fzf-edit.sh b/links/.config/nnn/fzf-edit.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+vim "$(find . -type f | fzf)"
diff --git a/links/.config/nnn/fzf-open.sh b/links/.config/nnn/fzf-open.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+xdg-open "$(find . -type f | fzf)" >/dev/null 2>&1
diff --git a/links/.config/nnn/open-images.sh b/links/.config/nnn/open-images.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+sxiv -q -t ./* >/dev/null 2>&1 &
diff --git a/links/.profile b/links/.profile
@@ -1,3 +1,4 @@
+# shellcheck source=/dev/null
[ -f ~/.locale ] && . ~/.locale
export EDITOR="vim"
export LC_ALL=en_US.UTF-8
@@ -6,6 +7,20 @@ export MAILDIR=~/mail
export TERMINAL=st
export BROWSER=surf-open.sh
+# nnn settings
+NNN_BMS='a:~/articles;'
+NNN_BMS+='b:~/books;'
+NNN_BMS+='c:~/code;'
+NNN_BMS+='d:~/doc;'
+NNN_BMS+='D:~/code/dotfiles/links;'
+NNN_BMS+='s:~/uni/postdoc/stanford-sigma;'
+NNN_BMS+='t:~/tmp;'
+NNN_BMS+='u:~/uni;'
+NNN_BMS+='v:~/videos'
+export NNN_BMS # bookmarks (max 10)
+export NNN_USE_EDITOR=1 # always open text files in $EDITOR
+export NNN_SCRIPT="$HOME/.config/nnn"
+
# shellcheck source=/dev/null
[ -f ~/.secret_env_vars ] && . ~/.secret_env_vars