Skip to content

Commit

Permalink
Fix editor on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Jul 8, 2024
1 parent 7436bfd commit 30e12d7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/tasks/fish.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'add_line_to_file'
require 'user'
require 'macos'

task :fish => [:'brew:casks_and_formulae'] do
fish_executable = (which 'fish')
Expand All @@ -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
Expand Down

0 comments on commit 30e12d7

Please sign in to comment.