diff --git a/lib/tasks/fish.rake b/lib/tasks/fish.rake index 7819886..5379a7e 100644 --- a/lib/tasks/fish.rake +++ b/lib/tasks/fish.rake @@ -2,6 +2,7 @@ require 'add_line_to_file' require 'user' +require 'macos' task :fish => [:'brew:casks_and_formulae'] do fish_executable = (which 'fish') @@ -13,6 +14,15 @@ task :fish => [:'brew:casks_and_formulae'] do command sudo, '/usr/bin/chsh', '-s', fish_executable, USER end + editor = macos? ? 'mate' : 'code' + + fish_conf_dir = Pathname('~/.config/fish/conf.d').expand_path + (fish_conf_dir/'editor.fish').write <<~FISH + set -x EDITOR '#{editor} -w' + set -x HOMEBREW_EDITOR '#{editor}' + alias edit='#{editor}' + FISH + puts ANSI.blue { 'Installing Fish Plugins …' } plugins = %w[ edc/bass