From 0bd93f7aa3e8bddb0084eb246b3168b0448b5df4 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 4 May 2021 10:00:38 -0400 Subject: [PATCH] cleanup fish config --- fish.configlink/config.fish | 13 +++---------- fish.configlink/functions/abbrs.fish | 13 ++++++++++++- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/fish.configlink/config.fish b/fish.configlink/config.fish index 0ba2034..a8637c2 100644 --- a/fish.configlink/config.fish +++ b/fish.configlink/config.fish @@ -9,15 +9,6 @@ if status --is-interactive $DOTS/bin \ ~/.cargo/bin - # Aliases - if command -v nvim > /dev/null - alias vim='nvim' - abbr -a vimrc 'vim $HOME/.config/nvim/init.vim' - end - if [ (uname) = "Linux" ] - linux - end - # Use `vi` in the shell with cursor shapes fish_vi_key_bindings bind yy fish_clipboard_copy @@ -35,7 +26,9 @@ if status --is-interactive zoxide init fish | source # Colors - command cat $DOTS/fish.configlink/fish_colors + if test -e $DOTS/fish.configlink/fish_colors + command cat $DOTS/fish.configlink/fish_colors + end # Fuzzy finder fzf_key_bindings diff --git a/fish.configlink/functions/abbrs.fish b/fish.configlink/functions/abbrs.fish index a7e5889..e06d4a1 100644 --- a/fish.configlink/functions/abbrs.fish +++ b/fish.configlink/functions/abbrs.fish @@ -49,8 +49,13 @@ function abbrs --description 'All abbreviations' abbr -a cdg 'cd (git rev-parse --show-toplevel)' # Vim + if command -v nvim > /dev/null + alias vim='nvim' + abbr -a vimrc 'vim $HOME/.config/nvim/init.vim' + else + abbr -a vimrc 'vim $HOME/.vimrc' + end abbr -a v 'vim' - abbr -a vimrc 'vim $HOME/.vimrc' abbr -a vl 'vim -c "normal! `0"' abbr -a vll 'vim -c "Hist"' abbr -a vh 'vim -c "Hist"' @@ -118,4 +123,10 @@ function abbrs --description 'All abbreviations' # macOS abbr -a casks 'vim $DOTS/homebrew/Caskfile' + # Linux + if [ (uname) = "Linux" ] + linux + end + + end