diff --git a/.config/fish/config.fish b/.config/fish/config.fish index bcd44de..705a12f 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -15,3 +15,22 @@ command -sq asdf; and source (brew --prefix asdf)/asdf.fish # The next line updates PATH for the Google Cloud SDK. # if test -f '/Users/m/Documents/google-cloud-sdk/path.fish.inc'; source '/Users/m/Documents/google-cloud-sdk/path.fish.inc'; end + +# aliases +function cat; bat --theme ansi-dark $argv; end + +function cp; rsync -aP $argv; end + +function dm; docker-machine $argv; end + +function dm-env; eval (docker-machine env $argv); end + +function goland; open -a Goland .; end + +function rider; open -a Rider .; end + +function v; nvim (fzf); end + +function vg; vagrant $argv; end + +function webstorm; open -a Webstorm .; end diff --git a/.config/fish/functions/cat.fish b/.config/fish/functions/cat.fish deleted file mode 100644 index c5eac37..0000000 --- a/.config/fish/functions/cat.fish +++ /dev/null @@ -1,3 +0,0 @@ -function cat - bat --theme ansi-dark $argv -end diff --git a/.config/fish/functions/cp.fish b/.config/fish/functions/cp.fish deleted file mode 100644 index a365fb3..0000000 --- a/.config/fish/functions/cp.fish +++ /dev/null @@ -1,3 +0,0 @@ -function cp - rsync -aP $argv -end diff --git a/.config/fish/functions/fish_prompt.fish b/.config/fish/functions/fish_prompt.fish index 367316c..3044ad0 100644 --- a/.config/fish/functions/fish_prompt.fish +++ b/.config/fish/functions/fish_prompt.fish @@ -75,10 +75,12 @@ function fish_prompt --description 'Write out the prompt' set -l cur_branch (string sub -s 3 (string match -r '^\* .*$' (git branch))) if string match -q '(HEAD detached*' $cur_branch; set cur_branch 'detached'; end - set -l cur_branch_len (string length $cur_branch) - if test $cur_branch_len -gt 21 - set -l sub_str (string sub -l 18 $cur_branch) - set cur_branch "$sub_str..." + if test -n "$cur_branch" + set -l cur_branch_len (string length $cur_branch) + if test $cur_branch_len -gt 21 + set -l sub_str (string sub -l 18 $cur_branch) + set cur_branch "$sub_str..." + end end if string match 'Your branch is ahead of*' $git_status > /dev/null diff --git a/.config/fish/functions/goland.fish b/.config/fish/functions/goland.fish deleted file mode 100644 index eb91929..0000000 --- a/.config/fish/functions/goland.fish +++ /dev/null @@ -1,4 +0,0 @@ -function goland - open -a Goland . -end - diff --git a/.config/fish/functions/machine-env.fish b/.config/fish/functions/machine-env.fish deleted file mode 100644 index 8e1d7d4..0000000 --- a/.config/fish/functions/machine-env.fish +++ /dev/null @@ -1,4 +0,0 @@ -function machine-env - eval (docker-machine env $argv) -end - diff --git a/.config/fish/functions/v.fish b/.config/fish/functions/v.fish deleted file mode 100644 index f113d0a..0000000 --- a/.config/fish/functions/v.fish +++ /dev/null @@ -1,4 +0,0 @@ -function v - nvim (fzf) -end - diff --git a/.config/fish/functions/webstorm.fish b/.config/fish/functions/webstorm.fish deleted file mode 100644 index bfd0713..0000000 --- a/.config/fish/functions/webstorm.fish +++ /dev/null @@ -1,3 +0,0 @@ -function webstorm - open -a Webstorm . -end diff --git a/.vimrc b/.vimrc index 898dcd5..8e41b89 100644 --- a/.vimrc +++ b/.vimrc @@ -16,7 +16,7 @@ Plug 'vimwiki/vimwiki' Plug 'junegunn/goyo.vim' " Conditionally loaded plugins -Plug 'tpope/vim-fugitive', { 'on': ['G', 'Git'] } +Plug 'tpope/vim-fugitive', { 'on': ['G', 'Git'], 'for': 'gitcommit' } Plug 'mileszs/ack.vim', { 'on': 'Ack' } Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'reedes/vim-pencil', { 'on': ['HardPencil', 'SoftPencil'] } @@ -101,6 +101,7 @@ let g:ale_linters = { \ 'elixir': ['credo', 'elixir-ls'], \ 'cs': ['OmniSharp'], \ 'terraform': ['terraform', 'tflint'], +\ 'ruby': ['rubocop', 'solargraph'], \} @@ -117,6 +118,7 @@ let g:ale_fixers = { \ 'make': ['remove_trailing_lines', 'trim_whitespace'], \ 'elixir': ['mix_format'], \ 'terraform': ['terraform'], +\ 'ruby': ['rubocop'], \} let g:ale_fix_on_save = 1