Fish config refactor

Move things into sub-files and sub-directories
Add ensure_path function to make sure stuff doesn't get spammed multiple
times into the PATH
This commit is contained in:
Tim McCarthy
2020-03-31 12:42:50 -07:00
parent a8e6dd2c75
commit 3ccf865b99
12 changed files with 51 additions and 49 deletions

4
fish/functions/ec.fish Normal file
View File

@@ -0,0 +1,4 @@
# Emacs Client
function ec
emacsclient -n --alternate-editor=emacs $argv
end

View File

@@ -0,0 +1,7 @@
function ensure_path --description "Ensures directories are in $PATH"
for pathdir in $argv
if not set -l index (contains -i $pathdir $PATH)
set -g -x PATH $pathdir $PATH
end
end
end

View File

@@ -0,0 +1,6 @@
function hybrid_bindings --description "Vi-style bindings that inherit emacs-style bindings in all modes"
for mode in default insert visual
fish_default_key_bindings -M $mode
end
fish_vi_key_bindings --no-erase
end

4
fish/functions/ip.fish Normal file
View File

@@ -0,0 +1,4 @@
# Prints current public IP address
function ip
curl icanhazip.com
end

4
fish/functions/src.fish Normal file
View File

@@ -0,0 +1,4 @@
# reload your Fish config
function src
source ~/.config/fish/config.fish; and clear
end