From 30e12d7ab8f32ef2f54713659d5641ca0eccb741 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 8 Jul 2024 08:11:23 +0200 Subject: [PATCH] Fix editor on Linux. --- lib/tasks/fish.rake | 10 ++++++++++ 1 file changed, 10 insertions(+) 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