Skip to content

Commit

Permalink
Add vscode settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Apr 12, 2022
1 parent 36ac649 commit 8ea60a6
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 6 deletions.
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ task :macos => [
:dnsmasq,
:loginwindow,
:textmate,
:vscode,
:dock,
:softwareupdate,
:terminal,
Expand Down
4 changes: 2 additions & 2 deletions lib/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ def color(r, g, b, a = 1)
)
end

def font(name, size = 11.0)
def font(name, size:)
wrap_data(
{
'$class' => { 'CF$UID' => 3 },
'NSName' => { 'CF$UID' => 2 },
'NSSize' => size,
'NSSize' => size.to_f,
'NSfFlags' => 16,
},
name,
Expand Down
1 change: 1 addition & 0 deletions lib/tasks/brew.rake
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ namespace :brew do
'fluor' => {},
'fork' => {},
'font-meslo-lg-nerd-font' => {},
'font-sauce-code-pro-nerd-font' => {},
'handbrake' => { flags: ["--appdir=#{converters_dir}"] },
'hazel' => {},
'hex-fiend' => {},
Expand Down
7 changes: 4 additions & 3 deletions lib/tasks/terminal.rake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ task :terminal do
write 'Shell', ''
write 'CopyAttributesProfile', ''

meslo = font('MesloLGSNerdFontComplete-Regular')
font_name = 'SauceCodeProNerdFontCompleteM-Regular'
font_size = 13

base03 = color(0, 43, 54)
base02 = color(7, 54, 66)
Expand Down Expand Up @@ -45,7 +46,7 @@ task :terminal do
'BackgroundColor' => color(253, 246, 227, 0.98),
'CursorColor' => base1,
'SelectionColor' => base02,
'Font' => meslo,
'Font' => font(font_name, size: font_size),
'TextColor' => base1,
'TextBoldColor' => base01,
'ANSIBlackColor' => base03,
Expand Down Expand Up @@ -101,7 +102,7 @@ task :terminal do
'BackgroundColor' => color(0, 43, 54, 1),
'CursorColor' => base01,
'SelectionColor' => base02,
'Font' => meslo,
'Font' => font(font_name, size: font_size),
'TextColor' => base01,
'TextBoldColor' => base1,
'ANSIBlackColor' => base2,
Expand Down
35 changes: 35 additions & 0 deletions lib/tasks/vscode.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# frozen_string_literal: true

require 'json'

task :vscode do
settings_path = Pathname('~/Library/Application Support/Code/User/settings.json').expand_path

settings = settings_path.exist? ? JSON.parse(settings_path.read) : {}

settings.merge!({
'trailing-spaces.trimOnSave' => true,
'trailing-spaces.highlightCurrentLine' => false,
# FIXME: https://github.com/shardulm94/vscode-trailingspaces/issues/55
# FIXME: https://github.com/shardulm94/vscode-trailingspaces/issues/56
'trailing-spaces.syntaxIgnore' => ['markdown'],
'workbench.preferredLightColorTheme' => 'Solarized Light',
'workbench.preferredDarkColorTheme' => 'Solarized Dark',
'window.autoDetectColorScheme' => true,
'editor.fontFamily' => 'SauceCodePro Nerd Font Mono',
'editor.cursorWidth' => 1,
'editor.tabSize' => 2,
'editor.fontSize' => 13,
})

settings_path.write JSON.pretty_generate(settings)

extensions = [
'EditorConfig.EditorConfig',
'shardulm94.trailing-spaces',
]

extensions.each do |extension|
command 'code', '--install-extension', extension
end
end
2 changes: 1 addition & 1 deletion ~/.tm_properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file was created automatically, do not edit it directly.

fontName = "Source Code Pro"
fontName = "SauceCodePro Nerd Font"
fontSize = 13

wrapColumn = 0
Expand Down

0 comments on commit 8ea60a6

Please sign in to comment.