From afb1c819423bbb8cee6b17899f52fd8554daa6e8 Mon Sep 17 00:00:00 2001 From: Mikkel Svartveit Date: Mon, 10 Mar 2025 23:47:20 +0100 Subject: [PATCH] Add Zed config --- .gitignore | 3 +++ README.md | 1 + zed/keymap.json | 27 ++++++++++++++++++++++++++ zed/settings.json | 47 ++++++++++++++++++++++++++++++++++++++++++++++ zed/tasks.json | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 126 insertions(+) create mode 100644 zed/keymap.json create mode 100644 zed/settings.json create mode 100644 zed/tasks.json diff --git a/.gitignore b/.gitignore index 0bf3091..f04dc7f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,9 @@ !wallpapers/**/* !appicons/**/* !cursor-export/**/* +!zed/settings.json +!zed/keymap.json +!zed/tasks.json # Blacklist some stuff again .DS_Store diff --git a/README.md b/README.md index ba8dcd9..8d10ee4 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ A small collection of configuration files for macOS, including: - Neovim (complete development environment with Coc and a bunch of plugins) - Vim (simple configuration, no plugins) - IdeaVim (Vim emulation for JetBrains IDEs) +- Zed (code editor) - [Karabiner](https://karabiner-elements.pqrs.org) (for [mapping CapsLock to Ctrl and Esc](https://medium.com/@pechyonkin/how-to-map-capslock-to-control-and-escape-on-mac-60523a64022b)) - Some wallpapers and custom app icons diff --git a/zed/keymap.json b/zed/keymap.json new file mode 100644 index 0000000..0657e3f --- /dev/null +++ b/zed/keymap.json @@ -0,0 +1,27 @@ +// Zed keymap +// +// For information on binding keys, see the Zed +// documentation: https://zed.dev/docs/key-bindings +// +// To see the default key bindings run `zed: open default keymap` +// from the command palette. +[ + { + "context": "Workspace", + "bindings": { + // "shift shift": "file_finder::Toggle" + } + }, + { + "context": "Editor", + "bindings": { + // "j k": ["workspace::SendKeystrokes", "escape"] + } + }, + { + "context": "vim_mode == visual", + "bindings": { + "shift-s": ["vim::PushAddSurrounds", {}] + } + } +] diff --git a/zed/settings.json b/zed/settings.json new file mode 100644 index 0000000..35cb926 --- /dev/null +++ b/zed/settings.json @@ -0,0 +1,47 @@ +// Zed settings +// +// For information on how to configure Zed, see the Zed +// documentation: https://zed.dev/docs/configuring-zed +// +// To see all of Zed's default settings without changing your +// custom settings, run `zed: open default settings` from the +// command palette (cmd-shift-p / ctrl-shift-p) +{ + "ssh_connections": [ + { + "host": "idun", + "projects": [ + { + "paths": ["~/thesis/masterproject/code"] + } + ] + } + ], + "features": { + "edit_prediction_provider": "zed" + }, + "assistant": { + "default_model": { + "provider": "zed.dev", + "model": "claude-3-5-sonnet-latest" + }, + "version": "2" + }, + "telemetry": { + "metrics": true + }, + "vim_mode": true, + "vim": { + "use_system_clipboard": "on_yank", + "use_smartcase_find": true + }, + "buffer_font_family": "FiraCode Nerd Font", + "buffer_font_size": 14, + "soft_wrap": "editor_width", + "theme": { + "mode": "system", + "light": "One Light", + "dark": "One Dark" + }, + "ui_font_family": ".SystemUIFont" +} diff --git a/zed/tasks.json b/zed/tasks.json new file mode 100644 index 0000000..a49b834 --- /dev/null +++ b/zed/tasks.json @@ -0,0 +1,48 @@ +// Static tasks configuration. +// +// Example: +[ + { + "label": "Example task", + "command": "for i in {1..5}; do echo \"Hello $i/5\"; sleep 1; done", + //"args": [], + // Env overrides for the command, will be appended to the terminal's environment from the settings. + "env": { "foo": "bar" }, + // Current working directory to spawn the command into, defaults to current project root. + //"cwd": "/path/to/working/directory", + // Whether to use a new terminal tab or reuse the existing one to spawn the process, defaults to `false`. + "use_new_terminal": false, + // Whether to allow multiple instances of the same task to be run, or rather wait for the existing ones to finish, defaults to `false`. + "allow_concurrent_runs": false, + // What to do with the terminal pane and tab, after the command was started: + // * `always` — always show the task's pane, and focus the corresponding tab in it (default) + // * `no_focus` — always show the task's pane, add the task's tab in it, but don't focus it + // * `never` — do not alter focus, but still add/reuse the task's tab in its pane + "reveal": "always", + // Where to place the task's terminal item after starting the task: + // * `dock` — in the terminal dock, "regular" terminal items' place (default) + // * `center` — in the central pane group, "main" editor area + "reveal_target": "dock", + // What to do with the terminal pane and tab, after the command had finished: + // * `never` — Do nothing when the command finishes (default) + // * `always` — always hide the terminal tab, hide the pane also if it was the last tab in it + // * `on_success` — hide the terminal tab on task success only, otherwise behaves similar to `always` + "hide": "never", + // Which shell to use when running a task inside the terminal. + // May take 3 values: + // 1. (default) Use the system's default terminal configuration in /etc/passwd + // "shell": "system" + // 2. A program: + // "shell": { + // "program": "sh" + // } + // 3. A program with arguments: + // "shell": { + // "with_arguments": { + // "program": "/bin/bash", + // "args": ["--login"] + // } + // } + "shell": "system" + } +]