From 9c1111f4de02d702bcb0c7f03fccd55e6b8bc790 Mon Sep 17 00:00:00 2001 From: Noah Masur Date: Sun, 11 Apr 2021 17:15:26 -0400 Subject: [PATCH] homemade vim snippets --- nvim.configlink/init.vim | 13 ++++++++++++- scripts/setup_fish | 2 +- shell/templates/skeleton.py | 12 ++++++++++++ shell/templates/{help => skeleton.sh} | 0 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 shell/templates/skeleton.py rename shell/templates/{help => skeleton.sh} (100%) diff --git a/nvim.configlink/init.vim b/nvim.configlink/init.vim index 6b37520..1f496af 100644 --- a/nvim.configlink/init.vim +++ b/nvim.configlink/init.vim @@ -94,7 +94,8 @@ endif " Custom Commands "---------------- -command Vimrc edit ~/.config/nvim/init.vim " Edit .vimrc (this file) +command! Vimrc edit ~/.config/nvim/init.vim " Edit .vimrc (this file) +command! Refresh source ~/.config/nvim/init.vim " Refresh from .vimrc (this file) " Custom Keybinds "---------------- @@ -160,9 +161,19 @@ nnoremap wm :only " Exit terminal mode (requires Alacritty escape) tnoremap +" Reload Vimrc settings +nnoremap rr :Refresh +nnoremap rp :Refresh :PlugInstall + " Open file tree noremap ft :Fern . -drawer -width=35 -toggle= +" Snippets +"--------- + +nnoremap ,sh :-1read $DOTS/shell/templates/skeleton.shGdd03kC +nnoremap ,py :-1read $DOTS/shell/templates/skeleton.pyGdd08kC + " LaTeX Settings "--------------- diff --git a/scripts/setup_fish b/scripts/setup_fish index 25768ee..8f0c20a 100755 --- a/scripts/setup_fish +++ b/scripts/setup_fish @@ -5,7 +5,7 @@ fisher update # Set $PATH for finding programs set -U FISH_DIR (readlink ~/.config/fish) -set -U DOTS (dirname $FISH_DIR) +set -Ux DOTS (dirname $FISH_DIR) set -U CDPATH . $HOME set -U EDITOR nvim set -U PROJ $HOME/dev/work diff --git a/shell/templates/skeleton.py b/shell/templates/skeleton.py new file mode 100644 index 0000000..395f57d --- /dev/null +++ b/shell/templates/skeleton.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +""" +Program +""" + +def main(): + """Run the program""" + pass + +if __name__ == "__main__": + main() diff --git a/shell/templates/help b/shell/templates/skeleton.sh similarity index 100% rename from shell/templates/help rename to shell/templates/skeleton.sh