From 5a08a0d681a31b183e54348f7f400f06e668bf55 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 9 Jul 2022 08:47:29 -0700 Subject: [PATCH] Improved fish config --- .gitignore | 1 + fish/config.fish | 57 ++++++++++++++++++++++++++++++++++++++------- fish/fish_variables | 33 -------------------------- 3 files changed, 49 insertions(+), 42 deletions(-) create mode 100644 .gitignore mode change 100755 => 100644 fish/config.fish delete mode 100644 fish/fish_variables diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca8238e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +fish/fish_variables \ No newline at end of file diff --git a/fish/config.fish b/fish/config.fish old mode 100755 new mode 100644 index 4770820..f2e8636 --- a/fish/config.fish +++ b/fish/config.fish @@ -1,17 +1,56 @@ #!/usr/bin/fish -alias gclon "git clone (xclip -o)" -alias gpull "git pull origin master" -alias gpush "git push --all origin" + +# Git aliases alias glog "git log --oneline --all --graph" +# Misc aliases alias icat "kitty +kitten icat --align left" +alias ls lsd + + +# Python aliases +function mkvenv \ + --description "Make a python venv" + # mkvenv : make venv at path + # mkvenv : make venv at path and set prompt. + + if test (count $argv) -eq 2 + mkvenv $argv[1] + + echo -n "Set venv prompt to " + set_color "green" + echo -n $argv[2] + set_color normal + echo + + python -m venv --prompt=$argv[2] $argv[1] + else if test (count $argv) -eq 1 + echo -n "Making virtualenv at " + set_color green + echo -n $argv[1] + set_color normal + echo + + python -m venv $argv[1] + else + echo "Invalid number of arguments." + end +end + +function venvon \ + --description "Activate a python venv. If no args are provided, assume path is 'venv'" + if test (count $argv) -eq 0 + source venv/bin/activate.fish + else if test (count $argv) -eq 1 + source $argv[1]/bin/activate.fish + else + echo "Invalid number of arguments." + end +end + + # Enable kitty command completion -kitty + complete setup fish | source - -alias notbg "kitty --override background_opacity=1 --detach && exit" - -set cfg $HOME/.config -set mnt /mnt/mark +kitty + complete setup fish | source \ No newline at end of file diff --git a/fish/fish_variables b/fish/fish_variables deleted file mode 100644 index d41d088..0000000 --- a/fish/fish_variables +++ /dev/null @@ -1,33 +0,0 @@ -# This file contains fish universal variable definitions. -# VERSION: 3.0 -SETUVAR __fish_initialized:3100 -SETUVAR fish_color_autosuggestion:555\x1ebrblack -SETUVAR fish_color_cancel:\x2dr -SETUVAR fish_color_command:005fd7 -SETUVAR fish_color_comment:990000 -SETUVAR fish_color_cwd:green -SETUVAR fish_color_cwd_root:red -SETUVAR fish_color_end:009900 -SETUVAR fish_color_error:ff0000 -SETUVAR fish_color_escape:00a6b2 -SETUVAR fish_color_history_current:\x2d\x2dbold -SETUVAR fish_color_host:normal -SETUVAR fish_color_host_remote:yellow -SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue -SETUVAR fish_color_normal:normal -SETUVAR fish_color_operator:00a6b2 -SETUVAR fish_color_param:00afff -SETUVAR fish_color_quote:999900 -SETUVAR fish_color_redirection:00afff -SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack -SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack -SETUVAR fish_color_status:red -SETUVAR fish_color_user:brgreen -SETUVAR fish_color_valid_path:\x2d\x2dunderline -SETUVAR fish_greeting: -SETUVAR fish_key_bindings:fish_default_key_bindings -SETUVAR fish_pager_color_completion:\x1d -SETUVAR fish_pager_color_description:B3A06D\x1eyellow -SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline -SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan -SETUVAR fish_user_paths:/home/mark/\x2egem/ruby/2\x2e7\x2e0/bin/