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:
4
fish/functions/ec.fish
Normal file
4
fish/functions/ec.fish
Normal file
@@ -0,0 +1,4 @@
|
||||
# Emacs Client
|
||||
function ec
|
||||
emacsclient -n --alternate-editor=emacs $argv
|
||||
end
|
||||
7
fish/functions/ensure_path.fish
Normal file
7
fish/functions/ensure_path.fish
Normal 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
|
||||
6
fish/functions/hybrid_bindings.fish
Normal file
6
fish/functions/hybrid_bindings.fish
Normal 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
4
fish/functions/ip.fish
Normal file
@@ -0,0 +1,4 @@
|
||||
# Prints current public IP address
|
||||
function ip
|
||||
curl icanhazip.com
|
||||
end
|
||||
4
fish/functions/src.fish
Normal file
4
fish/functions/src.fish
Normal file
@@ -0,0 +1,4 @@
|
||||
# reload your Fish config
|
||||
function src
|
||||
source ~/.config/fish/config.fish; and clear
|
||||
end
|
||||
Reference in New Issue
Block a user