nnn: update plugins

Also drop `elvish` and `ion` config
This commit is contained in:
Hoang Nguyen 2021-03-29 17:49:29 +03:00
parent dd0784924a
commit 188cdc6b88
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
17 changed files with 228 additions and 334 deletions

View File

@ -58,7 +58,7 @@
- [ ] ~~[dotdrop](https://github.com/deadc0de6/dotdrop)~~
- [x] Migrate zsh to [zinit](https://github.com/zdharma/zinit)
- [x] Wayland compositors
- [ ] ion / oksh / nushell / osh / xonsh / elvish / oh
- [ ] ~~ion~~ / oksh / nushell / osh / xonsh / ~~elvish~~ / oh
- [ ] NixOS / Guix / Gentoo / FreeBSD
- [ ] New Neovim's config in Lua
- [ ] Independent ~/.emacs.d

View File

@ -99,14 +99,14 @@ if command -v nnn >/dev/null
then
export TERMINAL=alacritty # for the preview script
export NNN_OPTS="HUedx"
export NNN_PLUG='t:preview-tui;m:nmount;f:fzcd;c:chksum;n:nuke;z:fzz;b:bulknew;d:dups;h:hexview;o:organize;p:pdfview;s:suedit;r:renamer'
export NNN_PLUG='b:bulknew;c:fzcd;o:fzopen;z:fzz;d:gpgd;e:gpge;h:hexview;m:nmount;n:nuke;t:preview-tui;r:renamer;p:rsynccp;j:splitjoin;s:suedit;i:ringtone'
export NNN_FIFO="/tmp/nnn.fifo"
export NNN_ARCHIVE='\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$'
# export NNN_OPENER="$XDG_CONFIG_HOME/nnn/plugins/nuke"
# export NNN_TRASH=1 # Use trash-cli
export USE_SCOPE=1
export NNN_COLORS='2345'
export NNN_FCOLORS='c1e20402006033f7c6d6ab01'
export NNN_FCOLORS='c1e20402006006f7c6d6ab01'
export NNN_BMS="h:~;C:~/Code;D:~/Downloads;P:~/Pictures;V:~/Videos;A:~/Media;U:~/Music;f:~/.config;l:~/.local/share;e:/etc;u:/usr/share;o:/opt;b:/boot;m:/media;M:/mnt;i:/run/media/$USER;v:/var;t:/tmp;d:/dev;s:/srv;r:/;k:/bedrock/strata"
export NNN_SSHFS="sshfs -o reconnect,idmap=user,follow_symlinks"
fi

View File

@ -102,13 +102,13 @@ set -gx _ZO_RESOLVE_SYMLINKS 1
if command -v nnn >/dev/null
set -gx TERMINAL alacritty
set -gx NNN_OPTS HUedx
set -gx NNN_PLUG 't:preview-tui;m:nmount;f:fzcd;c:chksum;n:nuke;z:fzz;b:bulknew;d:dups;h:hexview;o:organize;p:pdfview;s:suedit;r:renamer'
set -gx NNN_PLUG 'b:bulknew;c:fzcd;o:fzopen;z:fzz;d:gpgd;e:gpge;h:hexview;m:nmount;n:nuke;t:preview-tui;r:renamer;p:rsynccp;j:splitjoin;s:suedit;i:ringtone'
set -gx NNN_FIFO /tmp/nnn.fifo
set -gx NNN_ARCHIVE '\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$'
# set -gx NNN_OPENER $XDG_CONFIG_HOME/nnn/plugins/nuke
# set -gx NNN_TRASH=1
set -gx USE_SCOPE 1
set -gx NNN_FCOLORS 'c1e20402006033f7c6d6ab01'
set -gx NNN_FCOLORS 'c1e20402006006f7c6d6ab01'
set -gx NNN_COLORS '2345'
set -gx NNN_BMS "h:~;C:~/Code;D:~/Downloads;P:~/Pictures;V:~/Videos;A:~/Media;U:~/Music;f:~/.config;l:~/.local/share;e:/etc;u:/usr/share;o:/opt;b:/boot;m:/media;M:/mnt;i:/run/media/$USER;v:/var;t:/tmp;d:/dev;s:/srv;r:/;k:/bedrock/strata"
set -gx NNN_SSHFS "sshfs -o reconnect,idmap=user,follow_symlinks"

View File

@ -1,3 +0,0 @@
eval $(starship init ion --print-full-init)
~/.local/bin/bunny

View File

@ -1,66 +0,0 @@
#!/usr/bin/env sh
# Description: Create and verify checksums
#
# For selection: it will generate one file containing the checksums with file names
# [and with paths if they are in another directory]
# the output checksum filename will be checksum_timestamp.checksum_type
# For file: if the file is a checksum, the plugin does the verification
# if the file is not a checksum, checksum will be generated for it
# the output checksum filename will be filename.checksum_type
# For directory: recursively calculates checksum for all the files in the directory
# the output checksum filename will be directory.checksum_type
#
# Shell: POSIX compliant
# Authors: ath3, Arun Prakash Jana
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
resp=f
chsum=md5
checksum_type()
{
echo "possible checksums: md5, sha1, sha224, sha256, sha384, sha512"
printf "create md5 (m), sha256 (s), sha512 (S) (or type one of the above checksums) [default=m]: "
read -r chsum_resp
for chks in md5 sha1 sha224 sha256 sha384 sha512
do
if [ "$chsum_resp" = "$chks" ]; then
chsum=$chsum_resp
return
fi
done
if [ "$chsum_resp" = "s" ]; then
chsum=sha256
elif [ "$chsum_resp" = "S" ]; then
chsum=sha512
fi
}
if [ -s "$selection" ]; then
printf "work with selection (s) or current file (f) [default=f]: "
read -r resp
fi
if [ "$resp" = "s" ]; then
checksum_type
sed 's|'"$PWD/"'||g' < "$selection" | xargs -0 -I{} ${chsum}sum {} > "checksum_$(date '+%Y%m%d%H%M').$chsum"
elif [ -n "$1" ]; then
if [ -f "$1" ]; then
for chks in md5 sha1 sha224 sha256 sha384 sha512
do
if echo "$1" | grep -q \.${chks}$; then
${chks}sum -c < "$1"
read -r _
return
fi
done
checksum_type
file=$(basename "$1").$chsum
${chsum}sum "$1" > "$file"
elif [ -d "$1" ]; then
checksum_type
file=$(basename "$1").$chsum
find "$1" -type f -exec ${chsum}sum "{}" + > "$file"
fi
fi

View File

@ -1,15 +0,0 @@
#!/usr/bin/env sh
# Description: List non-empty duplicate files in the current directory (based on size followed by MD5)
#
# Source: https://www.commandlinefu.com/commands/view/3555/find-duplicate-files-based-on-size-first-then-md5-hash
#
# Dependencies: find md5sum sort uniq xargs
#
# Shell: POSIX compliant
# Authors: syssyphus, KlzXS
find . -size +0 -type f -printf "%s %p\n" | sort -rn | sed -n 'N; /^\([0-9]*\) .*\n\1.*$/p;$d;D' | awk '{printf("%s\0", substr($0, index($0, $2)))}' | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
printf "Press any key to exit"
read -r _

38
home/.config/nnn/plugins/fzopen Executable file
View File

@ -0,0 +1,38 @@
#!/usr/bin/env sh
# Description: Fuzzy find a file in directory subtree
# Opens in $VISUAL or $EDITOR if text
# Opens other type of files with xdg-open
#
# Dependencies: fd/find, fzf/skim, xdg-open
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
if which fzf >/dev/null 2>&1; then
cmd="$FZF_DEFAULT_COMMAND"
if which fd >/dev/null 2>&1; then
[ -z "$cmd" ] && cmd="fd -t f 2>/dev/null"
else
[ -z "$cmd" ] && cmd="find . -type f 2>/dev/null"
fi
entry="$(eval "$cmd" | fzf --delimiter / --nth=-1 --tiebreak=begin --info=hidden)"
# To show only the file name
# entry=$(find . -type f 2>/dev/null | fzf --delimiter / --with-nth=-1 --tiebreak=begin --info=hidden)
elif which sk >/dev/null 2>&1; then
entry=$(find . -type f 2>/dev/null | sk)
else
exit 1
fi
case "$(file -biL "$entry")" in
*text*)
"${VISUAL:-$EDITOR}" "$entry" ;;
*)
if uname | grep -q "Darwin"; then
open "$entry" >/dev/null 2>&1
else
xdg-open "$entry" >/dev/null 2>&1
fi
;;
esac

26
home/.config/nnn/plugins/gpgd Executable file
View File

@ -0,0 +1,26 @@
#!/usr/bin/env sh
# Description: Decrypts selected files using gpg. The contents of the decrypted file are stored in a file with extension .dec
#
# Note: If an appropriate private key cannot be found gpg silently prints a message in the background and no files are written.
#
# Shell: POSIX compliant
# Author: KlzXS
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
printf "(s)election/(c)urrent? [default=c] "
read -r resp
if [ "$resp" = "s" ]; then
files=$(tr '\0' '\n' < "$selection")
else
files=$1
fi
printf "%s" "$files" | xargs -n1 -I{} gpg --decrypt --output "{}.dec" {}
# Clear selection
if [ "$resp" = "s" ] && [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi

42
home/.config/nnn/plugins/gpge Executable file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env sh
# Description: Encrypts selected files using gpg. Can encrypt either asymmetrically (key) or symmetrically (passphrase).
# If asymmetric encryption is chosen a key can be chosen from the list of capable public keys using fzf.
#
# Note: symmetric encryption only works for a single (current) file as per gpg limitations
#
# Shell: POSIX compliant
# Author: KlzXS
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
printf "(s)ymmetric, (a)symmetric? [default=a] "
read -r symmetry
if [ "$symmetry" = "s" ]; then
gpg --symmetric "$1"
else
printf "(s)election/(c)urrent? [default=c] "
read -r resp
if [ "$resp" = "s" ]; then
files=$(tr '\0' '\n' < "$selection")
else
files=$1
fi
keyids=$(gpg --list-public-keys --with-colons | grep -E "pub:(.*:){10}.*[eE].*:" | awk -F ":" '{print $5}')
#awk needs literal $10
#shellcheck disable=SC2016
keyuids=$(printf "%s" "$keyids" | xargs -n1 -I{} sh -c 'gpg --list-key --with-colons "{}" | grep "uid" | awk -F ":" '\''{printf "%s %s\n", "{}", $10}'\''')
recipient=$(printf "%s" "$keyuids" | fzf | awk '{print $1}')
printf "%s" "$files" | xargs -n1 gpg --encrypt --recipient "$recipient"
# Clear selection
if [ "$resp" = "s" ] && [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi
fi

View File

@ -1,53 +0,0 @@
#!/usr/bin/env sh
# Description: Organize files in directories by category
#
# Shell: POSIX compliant
# Author: th3lusive
organize() {
case "$(file -biL "$1")" in
*video*)
[ ! -d "Videos" ] && mkdir "Videos"
mv "$1" "Videos/$1"
printf "Moved %s to Videos\n" "$1" ;;
*audio*) [ ! -d "Audio" ] && mkdir "Audio"
mv "$1" "Audio/$1"
printf "Moved %s to Audio\n" "$1" ;;
*image*)
[ ! -d "Images" ] && mkdir "Images"
mv "$1" "Images/$1"
printf "Moved %s to Images\n" "$1" ;;
*pdf*|*document*|*epub*|*djvu*|*cb*)
[ ! -d "Documents" ] && mkdir "Documents"
mv "$1" "Documents/$1"
printf "Moved %s to Documents\n" "$1" ;;
*text*)
[ ! -d "Plaintext" ] && mkdir "Plaintext"
mv "$1" "Plaintext/$1"
printf "Moved %s to Plaintext\n" "$1" ;;
*tar*|*xz*|*compress*|*7z*|*rar*|*zip*)
[ ! -d "Archives" ] && mkdir "Archives"
mv "$1" "Archives/$1"
printf "Moved %s to Archives\n" "$1" ;;
*binary*)
[ ! -d "Binaries" ] && mkdir "Binaries"
mv "$1" "Binaries/$1"
printf "Moved %s to Binaries\n" "$1" ;;
esac
}
main() {
for file in *
do
[ -f "$file" ] && organize "$file"
done
}
main "$@"

View File

@ -1,24 +0,0 @@
#!/usr/bin/env sh
# Description: View a PDF file in pager
#
# Notes:
# - $PAGER must be 'less -R' or 'most'
# - To use mutool, uncomment the relevant lines and comment the pdftotext line
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
if ! [ -z "$1" ]; then
if [ "$(head -c 4 "$1")" = "%PDF" ]; then
# Convert using pdftotext
pdftotext -nopgbrk -layout "$1" - | sed 's/\xe2\x80\x8b//g' | $PAGER
# Convert using mutool
# file=`basename "$1"`
# txt=/tmp/"$file".txt
# mutool convert -o "$txt" "$1"
# eval $PAGER $txt
# rm "$txt"
fi
fi

View File

@ -0,0 +1,36 @@
#!/usr/bin/env sh
# Description: Create an mp3 ringtone out of an audio file in any format
# Needs user to provide start and end where to cut the file
# Input file audio.ext results in audio_ringtone.mp3
#
# Tip: To convert a complete media file, set start as 0 and
# the runtime of the file as end.
#
# Dependencies: date, ffmpeg
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
if [ -n "$1" ]; then
printf "start (hh:mm:ss): "
read -r start
st=$(date -d "$start" +%s) || exit 1
printf "end (hh:mm:ss): "
read -r end
et=$(date -d "$end" +%s) || exit 1
if [ "$st" -ge "$et" ]; then
printf "error: start >= end "
read -r _
exit 1
fi
interval=$(( et - st ))
outfile=$(basename "$1")
outfile="${outfile%.*}"_ringtone.mp3
ffmpeg -i "$1" -ss "$start" -t "$interval" -vn -sn -acodec libmp3lame -q:a 2 "$outfile"
fi

View File

@ -0,0 +1,26 @@
#!/usr/bin/env sh
# Description: Simple script to give copy-paste a progress percentage
# by utilizing rsync.
#
# LIMITATION: this won't work when pasting to MTP device.
#
# Dependencies: rsync
#
# Shell: POSIX compliant
# Author: Benawi Adha
sel=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
# Choose one of these two schemes by commenting
# more verbose
# xargs -0 -a "$sel" -I % rsync -ah --progress % "$PWD"
# less verbose
xargs -0 -a "$sel" -I % rsync -ah --info=progress2 % "$PWD"
# Clear selection
if [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi

View File

@ -0,0 +1,52 @@
#!/usr/bin/env sh
# Description: Splits the file passed as argument or joins selection
#
# Note: Adds numeric suffix to split files
# Adds '.out suffix to the first file to be joined and saves as output file for join
#
# Shell: POSIX compliant
# Authors: Arun Prakash Jana, ath3
selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}
resp=s
if [ -s "$selection" ]; then
printf "press 's' (split current file) or 'j' (join selection): "
read -r resp
fi
if [ "$resp" = "j" ]; then
if [ -s "$selection" ]; then
arr=$(tr '\0' '\n' < "$selection")
if [ "$(echo "$arr" | wc -l)" -lt 2 ]; then
echo "joining needs at least 2 files"
exit
fi
for entry in $arr
do
if [ -d "$entry" ]; then
echo "cant join directories"
exit
fi
done
file="$(basename "$(echo "$arr" | sed -n '1p' | sed -e 's/[0-9][0-9]$//')")"
sort -z < "$selection" | xargs -0 -I{} cat {} > "${file}.out"
# Clear selection
if [ -p "$NNN_PIPE" ]; then
printf "-" > "$NNN_PIPE"
fi
fi
elif [ "$resp" = "s" ]; then
if [ -n "$1" ] && [ -f "$1" ]; then
# a single file is passed
printf "split size in MB: "
read -r size
if [ -n "$size" ]; then
split -d -b "$size"M "$1" "$1"
fi
fi
fi

View File

@ -84,14 +84,14 @@ if command -v nnn >/dev/null
then
export TERMINAL=alacritty # for the preview script
export NNN_OPTS="HUedx"
export NNN_PLUG='t:preview-tui;m:nmount;f:fzcd;c:chksum;n:nuke;z:fzz;b:bulknew;d:dups;h:hexview;o:organize;p:pdfview;s:suedit;r:renamer'
export NNN_PLUG='b:bulknew;c:fzcd;o:fzopen;z:fzz;d:gpgd;e:gpge;h:hexview;m:nmount;n:nuke;t:preview-tui;r:renamer;p:rsynccp;j:splitjoin;s:suedit;i:ringtone'
export NNN_FIFO="/tmp/nnn.fifo"
export NNN_ARCHIVE='\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$'
# export NNN_OPENER="$XDG_CONFIG_HOME/nnn/plugins/nuke"
# export NNN_TRASH=1
export USE_SCOPE=1
export NNN_COLORS='2345'
export NNN_FCOLORS='c1e20402006033f7c6d6ab01'
export NNN_FCOLORS='c1e20402006006f7c6d6ab01'
export NNN_BMS="h:~;C:~/Code;D:~/Downloads;P:~/Pictures;V:~/Videos;A:~/Media;U:~/Music;f:~/.config;l:~/.local/share;e:/etc;u:/usr/share;o:/opt;b:/boot;m:/media;M:/mnt;i:/run/media/$USER;v:/var;t:/tmp;d:/dev;s:/srv;r:/;k:/bedrock/strata"
export NNN_SSHFS="sshfs -o reconnect,idmap=user,follow_symlinks"
fi

View File

@ -1,165 +0,0 @@
# ________ _____
# ___ __ )_____ __________(_)_____________
# __ __ | __ `/_ ___/_ /_ ___/_ ___/
# _ /_/ // /_/ /_(__ )_ / / /__ _(__ )
# /_____/ \__,_/ /____/ /_/ \___/ /____/
# Bundled modules
use unix
use re
use str
use math
use readline-binding
# Prompt
if ?(command -v starship >/dev/null) {
eval (starship init elvish)
}
# Case-insensitive completion
edit:completion:matcher[''] = [p]{ edit:match-prefix &ignore-case $p }
# __________
# ___ ____/_________ __
# __ __/ __ __ \_ | / /
# _ /___ _ / / /_ |/ /
# /_____/ /_/ /_/_____/
# xdg stuff
E:XDG_CONFIG_HOME = "$E:HOME/.config"
E:XDG_CACHE_HOME = "$E:HOME/.cache"
E:XDG_DATA_HOME = "$E:HOME/.local/share"
E:XDG_DATA_DIRS = "$E:HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share"
# alternative paths
E:LESSHISTFILE = -
E:GTK2_RC_FILES = "$E:XDG_CONFIG_HOME/gtk-2.0/gtkrc"
E:TERMINFO = "$E:XDG_DATA_HOME/terminfo"
E:TERMINFO_DIRS = "$E:XDG_DATA_HOME/terminfo:/usr/share/terminfo"
E:GOPATH = "$E:XDG_DATA_HOME/go"
E:GRADLE_USER_HOME = "$E:XDG_DATA_HOME/gradle"
E:_JAVA_OPTIONS = "-Djava.util.prefs.userRoot=$E:XDG_CONFIG_HOME/java"
E:NODE_REPL_HISTORY = "$E:XDG_CACHE_HOME/node_repl_history"
E:NPM_CONFIG_USERCONFIG = "$E:XDG_CONFIG_HOME/npm/npmrc"
E:NPM_CONFIG_PREFIX = "$E:XDG_DATA_HOME/npm-global"
E:CARGO_HOME = "$E:XDG_DATA_HOME/cargo"
E:RUSTUP_HOME = "$E:XDG_DATA_HOME/rustup"
E:BUNDLE_USER_CONFIG = "$E:XDG_CONFIG_HOME/bundle"
E:BUNDLE_USER_CACHE = "$E:XDG_CACHE_HOME/bundle"
E:BUNDLE_USER_PLUGIN = "$E:XDG_DATA_HOME/bundle"
E:GEM_HOME = "$E:XDG_DATA_HOME/gem"
E:GEM_SPEC_CACHE = "$E:XDG_CACHE_HOME/gem"
E:DOCKER_CONFIG = "$E:XDG_CONFIG_HOME/docker"
E:GNUPGHOME = "$E:XDG_DATA_HOME/gnupg"
E:IPYTHONDIR = "$E:XDG_CONFIG_HOME/ipython"
E:JUPYTER_CONFIG_DIR = "$E:XDG_CONFIG_HOME/jupyter"
E:XAUTHORITY = "$E:XDG_RUNTIME_DIR/Xauthority"
E:XINITRC = "$E:XDG_CONFIG_HOME/X11/xinitrc"
E:XSERVERRC = "$E:XDG_CONFIG_HOME/X11/xserverrc"
# env
E:EDITOR = nvim
E:VISUAL = nvim
E:PAGER = "less -R"
# E:SVDIR = "$E:HOME/.local/share/service"
E:_JAVA_AWT_WM_NONREPARENTING = 1
E:GPG_TTY = "$(tty)"
# fzf
E:FZF_DEFAULT_OPTS = "--multi --layout=reverse --inline-info
--color fg:#D8DEE9,bg:#2E3440,hl:#A3BE8C,fg+:#D8DEE9,bg+:#434C5E,hl+:#A3BE8C
--color pointer:#BF616A,info:#4C566A,spinner:#4C566A,header:#4C566A,prompt:#81A1C1,marker:#EBCB8B"
# E:FZF_DEFAULT_OPTS = "--multi --layout=reverse --inline-info
# --color dark
# --color fg:-1,bg:-1,hl:#c678dd,fg+:#ffffff,bg+:#4b5263,hl+:#d858fe
# --color info:#98c379,prompt:#61afef,pointer:#be5046,marker:#e5c07b,spinner:#61afef,header:#61afef"
E:FZF_DEFAULT_COMMAND = "fd --type f --follow --hidden --exclude .git"
E:FZF_CTRL_T_OPTS = "--no-height --preview-window 'left:60%' --preview '$HOME/.local/bin/garbage/preview {} 2>/dev/null'"
E:FZF_CTRL_T_COMMAND = "fd --follow --hidden --exclude .git"
E:FZF_ALT_C_OPTS = "--preview 'exa -1a --color always --icons {} 2>/dev/null'"
E:FZF_ALT_C_COMMAND = "fd --type d --follow --hidden --exclude .git"
E:FZF_TMUX = 1
# ibus
E:GTK_IM_MODULE = ibus
E:XMODIFIERS = "@im=ibus"
E:QT_IM_MODULE = ibus
# qt5ct
E:QT_QPA_PLATFORMTHEME = qt5ct
E:QT_PLATFORM_PLUGIN = qt5ct
# .NET
E:DOTNET_CLI_TELEMETRY_OPTOUT = 1
# nnn
if ?(command -v nnn >/dev/null) {
E:TERMINAL = alacritty
E:NNN_OPTS = Hedx
E:NNN_PLUG = 't:preview-tui;m:nmount;f:fzcd;c:chksum;n:nuke;z:fzz;b:bulknew;d:dups:h:hexview;o:organize;p:pdfview;s:suedit;r:renamer'
E:NNN_FIFO = "/tmp/nnn.fifo"
E:NNN_ARCHIVE = '\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$'
# E:NNN_OPENER = "$E:XDG_CONFIG_HOME/nnn/plugins/nuke"
E:USE_SCOPE = 1
E:NNN_FCOLORS = 'c1e20402006033f7c6d6ab01'
E:NNN_COLORS = '2345'
E:NNN_BMS = "h:~;C:~/Code;D:~/Downloads;P:~/Pictures;V:~/Videos;A:~/Media;U:~/Music;f:~/.config;l:~/.local/share;e:/etc;u:/usr/share;o:/opt;b:/boot;m:/media;M:/mnt;i:/run/media/$USER;v:/var;t:/tmp;d:/dev;s:/srv;r:/;k:/bedrock/strata"
E:NNN_SSHFS = "sshfs -o reconnect,idmap=user,follow_symlinks"
}
# Set path
use path
paths = [
$E:HOME/.local/bin
$E:HOME/.local/bin/fzf
$E:CARGO_HOME/bin
$E:GOPATH/bin
$E:NPM_CONFIG_PREFIX/bin
/bin
/usr/bin
/usr/local/bin
]
each [p]{
if (not (path:is-dir (or (_ = ?(path:eval-symlinks $p)) $p))) {
echo (styled "Warning: directory "$p" in PATH does not exist." yellow)
}
} $paths
# ______ ___ _________ ______
# ___ |/ /___________ /___ ____ /____________
# __ /|_/ /_ __ \ __ /_ / / /_ /_ _ \_ ___/
# _ / / / / /_/ / /_/ / / /_/ /_ / / __/(__ )
# /_/ /_/ \____/\__,_/ \__,_/ /_/ \___//____/
#use epm
# _________________
# ___ |__ /__(_)_____ ____________________
# __ /| |_ /__ /_ __ `/_ ___/ _ \_ ___/
# _ ___ | / _ / / /_/ /_(__ )/ __/(__ )
# /_/ |_/_/ /_/ \__,_/ /____/ \___//____/
# man page with colors
fn man [@a]{
E:LESS_TERMCAP_mb = "\e[01;31m"
E:LESS_TERMCAP_md = "\e[01;36m"
E:LESS_TERMCAP_me = "\e[0m"
E:LESS_TERMCAP_se = "\e[0m"
E:LESS_TERMCAP_so = "\e[01;44;33m"
E:LESS_TERMCAP_ue = "\e[0m"
E:LESS_TERMCAP_us = "\e[01;32m"
e:man $@a
}
# ____________ _____
# __ ___/_ /______ _________ /____ _________
# _____ \_ __/ __ `/_ ___/ __/ / / /__ __ \
# ____/ // /_ / /_/ /_ / / /_ / /_/ /__ /_/ /
# /____/ \__/ \__,_/ /_/ \__/ \__,_/ _ .___/
# /_/
$E:HOME/.local/bin/bunny
# gpg-agent
if ?(not pgrep -u "$E:USER" gpg-agent >/dev/null) {
gpg-daemon --daemon --enable-ssh-support >/dev/null
}
if ?(test -z "$E:SSH_AUTH_SOCK") {
E:SSH_AUTH_SOCK = "$(gpgconf --list-dirs agent-ssh-socket)"
}
gpg-connect-agent updatestartuptty /bye >/dev/null

View File

@ -16,7 +16,7 @@ cd ../
# For coc.nvim
mkdir -pv ~/.local/share/nvim/lsp
cp -rf lua-language-server ~/.local/share/nvim/lsp/ && echo "Copied to ~/.local/share/nvim/lsp/lua-language-server"
cp -rf lua-language-server ~/.local/share/nvim/lsp/ && echo "copied 'lua-language-server' -> ~/.local/share/nvim/lsp/lua-language-server"
# For Doom Emacs
mkdir -pv ~/.config/emacs/.local/etc/lsp
mv -fv lua-language-server ~/.config/emacs/.local/etc/lsp/