From dadb7da642d1b7fbf27612c2e0f4b9aae457931a Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 23 Jan 2020 09:51:03 -0600 Subject: [PATCH] Remove more generated fish stuff, more fixes --- apps/de/x/profile | 1 + apps/kitty/kitty.conf | 3 +- apps/neovim/plugins.vim | 2 +- apps/shell/fish/.gitignore | 1 + apps/shell/fish/aliases.fish | 60 ++++++++++++------- apps/shell/fish/config.fish | 9 ++- .../functions/fish_user_key_bindings.fish | 3 - .../fish/functions/fzf_key_bindings.fish | 1 - env/desktop/bash | 3 +- env/desktop/config.fish | 13 +++- 10 files changed, 61 insertions(+), 35 deletions(-) delete mode 100644 apps/shell/fish/functions/fish_user_key_bindings.fish delete mode 120000 apps/shell/fish/functions/fzf_key_bindings.fish diff --git a/apps/de/x/profile b/apps/de/x/profile index 73ecbdc..60fb2b4 100644 --- a/apps/de/x/profile +++ b/apps/de/x/profile @@ -13,6 +13,7 @@ has_command autocutsel && autocutsel -s PRIMARY & has_command autocutsel && autocutsel -s CLIPBOARD & has_command autorandr && autorandr -c has_command redshift && redshift -r -l 39.1:-94.6 -t 6500K:3000K & +has_command kdeconnect-indicator && kdeconnect-indicator & eval "$(/usr/bin/gnome-keyring-daemon --start --components=pkcs11,secrets,ssh)" export SSH_AUTH_SOCK diff --git a/apps/kitty/kitty.conf b/apps/kitty/kitty.conf index 7a6af38..cc56e4c 100644 --- a/apps/kitty/kitty.conf +++ b/apps/kitty/kitty.conf @@ -15,7 +15,8 @@ clear_all_shortcuts yes map ctrl+shift+equal change_font_size all +0.5 map ctrl+shift+minus change_font_size all -0.5 -map shift+insert paste_from_selection +map shift+insert paste_from_clipboard +map ctrl+shift+v paste_from_selection enable_audio_bell yes diff --git a/apps/neovim/plugins.vim b/apps/neovim/plugins.vim index 226a820..ce845d6 100644 --- a/apps/neovim/plugins.vim +++ b/apps/neovim/plugins.vim @@ -66,7 +66,7 @@ Plug 'tmux-plugins/vim-tmux-focus-events' " allow transiti Plug 'christoomey/vim-tmux-navigator' " allow transitions within tmux Plug 'godlygeek/tabular' " align text Plug 'lytedev/vim-superman' " view man pages with vim -Plug 'tpope/vim-surround' " quickly modify text surrounding objects +Plug 'machakann/vim-sandwich' " quickly modify text surrounding objects Plug 'tpope/vim-speeddating' " vim knows about date-like text objects Plug 'tpope/vim-fugitive' " vim git commands Plug 'michaeljsmith/vim-indent-object' " adds an indentation level text object diff --git a/apps/shell/fish/.gitignore b/apps/shell/fish/.gitignore index 23efee9..1cc8a73 100644 --- a/apps/shell/fish/.gitignore +++ b/apps/shell/fish/.gitignore @@ -1 +1,2 @@ fish_variables +functions diff --git a/apps/shell/fish/aliases.fish b/apps/shell/fish/aliases.fish index 2e92ecf..e820740 100755 --- a/apps/shell/fish/aliases.fish +++ b/apps/shell/fish/aliases.fish @@ -32,6 +32,10 @@ function ltl echo $l end +function scount -d "Silent count" -w count + count $argv > /dev/null +end + function ltld set d $argv[1] . set -l l "" @@ -48,31 +52,42 @@ alias vltl "vim (ltl)" alias cdltl "cd (ltld)" alias ltlv vltl -# navigation aliases -function c - if count $argv - cd $NICE_HOME && cd $argv[1] || exit 1 +function d -w cd + if scount $argv + cd $argv || exit 1 else cd $NICE_HOME || exit 1 end + la end -alias cd.. "cd .." -alias cdd "cd $DOTFILES_PATH" # go to dotfiles -alias cde "cd $ENV_PATH" # go to env dotfiles -alias cdc "cd $XDG_CONFIG_HOME" # go to ~/.config -alias cdn "cd $NOTES_PATH" -alias cdl "cd $NICE_HOME/dl" -alias cdg "cd $NICE_HOME/games" + +# navigation aliases +function c -w cd + if scount $argv + cd $NICE_HOME && d $argv || exit 1 + else + d $NICE_HOME + end + la +end + +alias cd.. "d .." +alias cdd "d $DOTFILES_PATH" # go to dotfiles +alias cde "d $ENV_PATH" # go to env dotfiles +alias cdc "d $XDG_CONFIG_HOME" # go to ~/.config +alias cdn "d $NOTES_PATH" +alias cdl "d $NICE_HOME/dl" +alias cdg "d $NICE_HOME/games" # quick parent-directory aliases -alias .. "cd .." -alias ... "cd ../.." -alias .... "cd ../../.." -alias ..... "cd ../../../.." -alias ...... "cd ../../../../.." -alias ....... "cd ../../../../../.." -alias ........ "cd ../../../../../../.." -alias ......... "cd ../../../../../../../.." +alias .. "d .." +alias ... "d ../.." +alias .... "d ../../.." +alias ..... "d ../../../.." +alias ...... "d ../../../../.." +alias ....... "d ../../../../../.." +alias ........ "d ../../../../../../.." +alias ......... "d ../../../../../../../.." # tmux aliases # TODO: see if this can be worked around? @@ -89,7 +104,7 @@ alias tm "tmux attach -t music || tmux new -s music" # git aliases # TODO: make these git aliases in the gitconfig? function g - if count $argv >/dev/null + if scount $argv git $argv else git status @@ -158,6 +173,11 @@ alias mail "mutt" # fsw aliases alias fsw-mix-test 'fsw "mix test" ./**/*.{ex,exs,erl,hrl,xrl,yrl}' +function field + not scount $argv && echo "No field index provided"; exit 1 + awk "{print \$$argv[1]}" +end + # weechat aliases function chat set -l pass (pass config/weechat-passphrase | head -n 1) diff --git a/apps/shell/fish/config.fish b/apps/shell/fish/config.fish index 60696c8..6d3788c 100755 --- a/apps/shell/fish/config.fish +++ b/apps/shell/fish/config.fish @@ -4,8 +4,6 @@ set -Ux XDG_CONFIG_HOME $HOME/.config set -Ux DOTFILES_PATH $XDG_CONFIG_HOME/dotfiles set -Ux ENV_PATH $HOME/.env -function source_if_exists; test -f $ENV_PATH/$argv[1] && source $argv[1]; end -function maybe_source_env_file; source_if_exists $ENV_PATH/$argv[1]; end function has_command; command -v $argv[1] 2>&1 >/dev/null; end source $DOTFILES_PATH/apps/shell/fish/paths.fish @@ -33,9 +31,10 @@ end set -Ux LS_COLORS 'ow=01;36;40' # load a per-device config last so anything can be overridden -# TODO: this does not work quite right for fish? -maybe_source_env_file config.fish -maybe_source_env_file .hidden/config.fish +for cf in config.fish .hidden/config.fish + set f $ENV_PATH/$cf + test -f $f && source $f +end mkdir -p $NOTES_PATH $USER_LOGS_PATH $SCROTS_PATH diff --git a/apps/shell/fish/functions/fish_user_key_bindings.fish b/apps/shell/fish/functions/fish_user_key_bindings.fish deleted file mode 100644 index 350a9da..0000000 --- a/apps/shell/fish/functions/fish_user_key_bindings.fish +++ /dev/null @@ -1,3 +0,0 @@ -function fish_user_key_bindings - fzf_key_bindings -end diff --git a/apps/shell/fish/functions/fzf_key_bindings.fish b/apps/shell/fish/functions/fzf_key_bindings.fish deleted file mode 120000 index 5ff404e..0000000 --- a/apps/shell/fish/functions/fzf_key_bindings.fish +++ /dev/null @@ -1 +0,0 @@ -/home/daniel/.home/.fzf/shell/key-bindings.fish \ No newline at end of file diff --git a/env/desktop/bash b/env/desktop/bash index 19daabb..0251788 100755 --- a/env/desktop/bash +++ b/env/desktop/bash @@ -1,3 +1,4 @@ #!/usr/bin/env bash -. "$ENV_PATH/.hidden/bash" +hb="$ENV_PATH/.hidden/bash" +[ -f "$hb" ] && . "$hb" diff --git a/env/desktop/config.fish b/env/desktop/config.fish index b155199..3b009dc 100755 --- a/env/desktop/config.fish +++ b/env/desktop/config.fish @@ -1,6 +1,13 @@ #!/usr/bin/env fish -echo whee -function I_AM_HELP - help +# TODO: completion +function src-hidden-dir + not scount $argv && echo "No directory specified" && exit 1 + set f $ENV_PATH/.hidden/fish.d/$argv[1]/config.fish + echo "Checking $f..." + test -f $f && source $f end + +set hc $ENV_PATH/.hidden/config.fish +test -f $hc && source $hc +