From 5ffe274abdfd36d14a28c5edba98e799d90e26cb Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Tue, 4 Oct 2022 22:15:21 -0400 Subject: [PATCH] neovim stuffs --- configs/nvim/init.vim | 32 +++++++++++++++++++++++++++++++- configs/scripts/catto | 2 +- configs/zsh/macros.sh | 8 ++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/configs/nvim/init.vim b/configs/nvim/init.vim index 6ad9b45..d726d20 100644 --- a/configs/nvim/init.vim +++ b/configs/nvim/init.vim @@ -1,4 +1,7 @@ +" Syntax highlighting +syntax on + " Enable mouse usage set mouse=a @@ -7,6 +10,16 @@ set tabstop=4 set shiftwidth=4 set expandtab +" VSCode-style selection indenting +nnoremap >>_ +nnoremap <<_ +inoremap +vnoremap >gv +vnoremap int: print("File not found", file=sys.stderr) return 1 - # Compres the image to a temporary file + # Compress the image to a temporary file with tempfile.NamedTemporaryFile(suffix=image_path.suffix) as temp: # Compress if not args.no_compress: diff --git a/configs/zsh/macros.sh b/configs/zsh/macros.sh index 22ad3e6..ea8f9e2 100644 --- a/configs/zsh/macros.sh +++ b/configs/zsh/macros.sh @@ -7,6 +7,7 @@ alias cls=clear alias p4='ping 8.8.8.8 -c 4' alias quickhttp='sudo python -m SimpleHTTPServer 443' alias zshreload="source ~/.zshrc" +alias wg-easykeys="wg genkey | tee >(wg pubkey)" # Kill via pgrep nkill() { @@ -22,6 +23,13 @@ mkcd() { fi } +# Sources a .env +source_env() { + env=${1:-.env} + [ ! -f "${env}" ] && { echo "Env file ${env} doesn't exist"; return 1; } + eval $(sed -e '/^\s*$/d' -e '/^\s*#/d' -e 's/=/="/' -e 's/$/"/' -e 's/^/export /' "${env}") +} + # Auto-extract anything extract() { if [ -f $1 ]; then