Skip to content

Instantly share code, notes, and snippets.

@joeldrapper
Last active November 20, 2024 12:14
Show Gist options
  • Save joeldrapper/bf5cfe4601a5abd661fb9c36e2fa42f2 to your computer and use it in GitHub Desktop.
Save joeldrapper/bf5cfe4601a5abd661fb9c36e2fa42f2 to your computer and use it in GitHub Desktop.
My Zed Config
[
{
"context": "Editor",
"bindings": {
"alt-up": "editor::SelectLargerSyntaxNode",
"alt-down": "editor::SelectSmallerSyntaxNode",
"ctrl-cmd-up": "editor::MoveLineUp",
"ctrl-cmd-down": "editor::MoveLineDown"
}
}
]
{
"assistant": {
"default_open_ai_model": "gpt-4",
"provider": {
"name": "openai",
"default_model": "gpt-4"
}
},
"vim_mode": true,
"features": {
"copilot": true
},
"show_inline_completions": true,
"theme": "Rosé Pine Moon",
"buffer_font_family": "Monolisa Variable",
"soft_wrap": "editor_width",
"hard_tabs": true,
"tab_size": 2,
"format_on_save": "on",
"buffer_font_size": 16,
"buffer_line_height": {
"custom": 1.7
},
"indent_guides": {
"enabled": false
},
"tab_bar": {
"show": true
},
"semantic_index": {
"enabled": true
},
"lsp": {
"solargraph": {
"initialization_options": {
"diagnostics": false,
"formatting": false
}
},
"ruby-lsp": {
"initialization_options": {
"diagnostics": true,
"formatting": false
}
},
"tailwindcss-language-server": {
"settings": {
"includeLanguages": {
"erb": "html",
"ruby": "html"
},
"experimental": {
"classRegex": ["\\bclass:\\s*['\"]([^'\"]*)['\"]"]
}
}
}
},
"languages": {
"Ruby": {
"language_servers": [
"tailwindcss-language-server",
"ruby-lsp",
"!solargraph"
],
"formatter": {
"external": {
"command": "bundle",
"arguments": [
"exec",
"rubocop",
"--server",
"--auto-correct-all",
"--fail-level",
"error",
"--stdin",
"corrected.rb",
"--stderr"
]
}
}
},
"Markdown": {
"soft_wrap": "preferred_line_length",
"preferred_line_length": 80,
"hard_tabs": false
},
"YAML": {
"hard_tabs": false
}
},
"file_scan_exclusions": ["*.git", "*.DS_Store"]
}
@notpeter
Copy link

notpeter commented Jun 20, 2024

Thanks for sharing this @joeldrapper! Could you make one small change since we're deprecating some zed settings -- can you update with show_inline_completions in place of show_copilot_suggestions.

Thanks! -peter@zed

@MSchmidt
Copy link

@joeldrapper @notpeter is there a way to make the formatter optional? It's calling bundle exec rubocop now. So it always fails on projects that have rubocop not in the Gemfile. Having it optional based on the Gemfile would be great though. Some projects don't use rubocop and I would like to just edit them without any zed magic.

@joeldrapper
Copy link
Author

You can disable it by setting format on save to off. You may want to disable it globally and then enable it for specific projects with a .zed/settings.json file in the project.

@MSchmidt
Copy link

Thanks Joel. Sounds like a reasonable approach.

@MSchmidt
Copy link

MSchmidt commented Nov 1, 2024

fyi --auto-correct-all is deprecated; use --autocorrect-all instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment