Add nnn config

This commit is contained in:
Peter Cai 2024-03-22 16:29:50 -04:00
parent 292bdb6c62
commit e0162f2613
2 changed files with 16 additions and 0 deletions

View file

@ -16,6 +16,9 @@ export MACHINE_START_SWAY=false # Whether to start Sway from bash
alias ssh="TERM=xterm-256color ssh"
# NNN configuration
alias nnn="VISUAL=$HOME/.local/bin/vim-wrapper nnn -e"
# SSH without checking or adding host keys to known_hosts
# Useful for cloud server rescue environment & installation
alias sshtmp="ssh -o 'UserKnownHostsFile /dev/null' -o 'StrictHostKeyChecking no'"

13
nnn/.local/bin/vim-wrapper Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
if [ "$TERM_PROGRAM" != "WezTerm" ]; then
exec vim "$@"
fi
pane_id=$(wezterm cli get-pane-direction Right)
if [ -z "$pane_id" ]; then
exec wezterm cli split-pane --right --percent 70 -- vim "$@"
else
exec wezterm cli spawn -- vim "$@"
fi