~gpanders/dotfiles

0dd515be0073d2de032e27ba2149f1e71fb945e4 — Greg Anders 1 year, 11 months ago 7ca5b5b
Fish shell changes

- Put fisher bootstrapping into a conf.d script
- Remove pyenv and rbenv conf.d scripts
- Add !! and !$ substitution
M fish/.config/fish/conf.d/abbr.fish => fish/.config/fish/conf.d/abbr.fish +3 -3
@@ 1,5 1,5 @@
# Define abbreviations
if status is-login
    abbr -a -U g git
    abbr -a -U vi vim
if status is-interactive
    abbr --add --global g git
    abbr --add --global vi vim
end

M fish/.config/fish/conf.d/colors.fish => fish/.config/fish/conf.d/colors.fish +4 -2
@@ 1,4 1,4 @@
if status is-login
if not set -q fish_user_colors
    set -U fish_color_command green
    set -U fish_color_comment yellow
    set -U fish_color_error red --bold


@@ 8,10 8,12 @@ if status is-login
    set -U fish_color_autosuggestion brblack
    set -U fish_color_operator blue
    set -U fish_color_end normal
    set -U fish_color_search_match normal
    set -U fish_color_search_match normal --background=bryellow
    set -U fish_color_cancel black --background=white
    set -U fish_color_selection normal --background=bryellow
    set -U fish_pager_color_prefix normal --bold
    set -U fish_pager_color_completion normal
    set -U fish_pager_color_description yellow

    set -U fish_user_colors 1
end

A fish/.config/fish/conf.d/fisher.fish => fish/.config/fish/conf.d/fisher.fish +16 -0
@@ 0,0 1,16 @@
set -q XDG_CONFIG_HOME
or set XDG_CONFIG_HOME $HOME/.config

if not functions -q fisher
    curl https://git.io/fisher --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/fisher.fish
    fish -c fisher
end

set -g fisher_path $XDG_CONFIG_HOME/fish/fisher

set fish_function_path $fish_function_path[1] $fisher_path/functions $fish_function_path[2..-1]
set fish_complete_path $fish_complete_path[1] $fisher_path/completions $fish_complete_path[2..-1]

for file in $fisher_path/conf.d/*.fish
    builtin source $file 2>/dev/null
end

M fish/.config/fish/conf.d/fzf.fish => fish/.config/fish/conf.d/fzf.fish +6 -6
@@ 1,13 1,13 @@
if status is-login
    if command -sq fd
        set -x FZF_FIND_FILE_COMMAND "fd --type f --hidden --follow --exclude .git"
        set -x FZF_CD_COMMAND "fd -t d"
        set -gx FZF_FIND_FILE_COMMAND "fd --type f --hidden --follow --exclude .git"
        set -gx FZF_CD_COMMAND "fd -t d"
    else if command -sq rg
        set -x FZF_FIND_FILE_COMMAND "rg --files --hidden --glob '!.git'"
        set -gx FZF_FIND_FILE_COMMAND "rg --files --hidden --glob '!.git'"
    else if command -sq ag
        set -x FZF_FIND_FILE_COMMAND "ag -g ''"
        set -gx FZF_FIND_FILE_COMMAND "ag -g ''"
    end

    set -x FZF_COLORS "bg+:10,bg:0,spinner:6,hl:4,fg:12,header:4,info:3,pointer:6,marker:6,fg+:13,prompt:3,hl+:4"
    set -x FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --color $FZF_COLORS"
    set -gx FZF_COLORS "bg+:10,bg:0,spinner:6,hl:4,fg:12,header:4,info:3,pointer:6,marker:6,fg+:13,prompt:3,hl+:4"
    set -gx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --color $FZF_COLORS"
end

D fish/.config/fish/conf.d/pyenv.fish => fish/.config/fish/conf.d/pyenv.fish +0 -10
@@ 1,10 0,0 @@
if status is-login
    if test -s ~/.pyenv/bin/pyenv
        set -x PYENV_ROOT ~/.pyenv
        set -x PATH $PYENV_ROOT/bin $PATH
    end

    if command -sq pyenv
        source (pyenv init - --no-rehash fish | psub)
    end
end

D fish/.config/fish/conf.d/rbenv.fish => fish/.config/fish/conf.d/rbenv.fish +0 -5
@@ 1,5 0,0 @@
if status is-login
    if command -sq rbenv
        source (rbenv init - --no-rehash fish | psub)
    end
end

M fish/.config/fish/conf.d/xdg.fish => fish/.config/fish/conf.d/xdg.fish +6 -3
@@ 1,3 1,6 @@
set -q XDG_CONFIG_HOME; or set -U XDG_CONFIG_HOME ~/.config
set -q XDG_DATA_HOME; or set -U XDG_DATA_HOME ~/.local/share
set -q XDG_CACHE_HOME; or set -U XDG_CACHE_HOME ~/.local/cache
set -q XDG_CONFIG_HOME
or set -U XDG_CONFIG_HOME ~/.config
set -q XDG_DATA_HOME
or set -U XDG_DATA_HOME ~/.local/share
set -q XDG_CACHE_HOME
or set -U XDG_CACHE_HOME ~/.local/cache

M fish/.config/fish/config.fish => fish/.config/fish/config.fish +0 -15
@@ 1,15 0,0 @@
if not functions -q fisher
    curl https://git.io/fisher --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/fisher.fish
    fish -c fisher
end

set -g fisher_path $XDG_CONFIG_HOME/fish/fisher

set fish_function_path $fish_function_path[1] $fisher_path/functions $fish_function_path[2..-1]
set fish_complete_path $fish_complete_path[1] $fisher_path/completions $fish_complete_path[2..-1]

for file in $fisher_path/conf.d/*.fish
    builtin source $file 2>/dev/null
end

fish_hybrid_key_bindings

A fish/.config/fish/functions/bind_bang.fish => fish/.config/fish/functions/bind_bang.fish +9 -0
@@ 0,0 1,9 @@
function bind_bang
    switch (commandline -t)
        case !
            commandline -t $history[1]
            commandline -f repaint
        case "*"
            commandline -i !
    end
end

A fish/.config/fish/functions/bind_dollar.fish => fish/.config/fish/functions/bind_dollar.fish +9 -0
@@ 0,0 1,9 @@
function bind_dollar
    switch (commandline -t)
        case !
            commandline -t ""
            commandline -f history-token-search-backward
        case "*"
            commandline -i '$'
    end
end

A fish/.config/fish/functions/fish_user_key_bindings.fish => fish/.config/fish/functions/fish_user_key_bindings.fish +6 -0
@@ 0,0 1,6 @@
function fish_user_key_bindings
    bind ! bind_bang
    bind -M insert ! bind_bang
    bind '$' bind_dollar
    bind -M insert '$' bind_dollar
end

M fish/.config/fish/functions/tmux.fish => fish/.config/fish/functions/tmux.fish +2 -1
@@ 1,3 1,4 @@
function tmux
	command tmux -f $HOME/.config/tmux/tmux.conf $argv;
    command tmux -f $HOME/.config/tmux/tmux.conf $argv

end