diff --git a/sync.sh b/sync.sh index e655303..58f2ba2 100755 --- a/sync.sh +++ b/sync.sh @@ -28,8 +28,8 @@ ZED_KEYMAP="$ZED_CONFIG_DIR/keymap.json" ZED_SETTINGS="$ZED_CONFIG_DIR/settings.json" # Repository paths -REPO_TMUX="./tmux" -REPO_VSCODE="./vscode" +REPO_TMUX_DIR="./tmux" +REPO_VSCODE_DIR="./vscode" REPO_ZED_DIR="./zed" # Ensure directory paths @@ -37,16 +37,11 @@ mkdir -p tmux mkdir -p vscode mkdir -p zed -# Document sources -echo $TMUX_CONFIG > "$REPO_TMUX/SOURCE" -echo $VSCODE_USER_CONFIG_DIR > "$REPO_VSCODE/SOURCE" -echo $ZED_CONFIG_DIR > "$REPO_ZED/SOURCE" - # Copy -cp $TMUX_CONFIG "$REPO_TMUX/.tmux.conf" +cp $TMUX_CONFIG "$REPO_TMUX_DIR/.tmux.conf" -cp $VSCODE_USER_CONFIG_KEYBINDINGS "$REPO_VSCODE/keybindings.json" -cp $VSCODE_USER_CONFIG_SETTINGS "$REPO_VSCODE/settings.json" +cp $VSCODE_USER_CONFIG_KEYBINDINGS "$REPO_VSCODE_DIR/keybindings.json" +cp $VSCODE_USER_CONFIG_SETTINGS "$REPO_VSCODE_DIR/settings.json" cp $ZED_KEYMAP "$REPO_ZED_DIR/keymap.json" cp $ZED_SETTINGS "$REPO_ZED_DIR/settings.json" diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 901b535..a3e66e6 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -5,9 +5,19 @@ bind-key M-a send-prefix # switch panes using vim motions directions without prefix bind -n M-h select-pane -L -bind -n M-l select-pane -R -bind -n M-k select-pane -U bind -n M-j select-pane -D +bind -n M-k select-pane -U +bind -n M-l select-pane -R # set default shell to bash set-option -g default-command "/bin/bash" + +# enable copy mode +bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard' + +# remove delay when switching to normal using esc +set -s escape-time 0 + +# increase scrollback buffer size +set -g history-limit 5000 + diff --git a/tmux/SOURCE b/tmux/SOURCE deleted file mode 100644 index f83b688..0000000 --- a/tmux/SOURCE +++ /dev/null @@ -1 +0,0 @@ -/home/tyler/.tmux.conf diff --git a/vscode/SOURCE b/vscode/SOURCE deleted file mode 100644 index 5c7db11..0000000 --- a/vscode/SOURCE +++ /dev/null @@ -1 +0,0 @@ -/home/tyler/.config/Code/User diff --git a/zed/keymap.json b/zed/keymap.json index e9220b8..040c5b5 100644 --- a/zed/keymap.json +++ b/zed/keymap.json @@ -1,8 +1,116 @@ [ + // Use neovim's yank behavior: yank to end of line. + { + "context": "vim_mode == normal && !menu", + "bindings": { + "shift-y": ["workspace::SendKeystrokes", "y $"] + } + }, + // Multicursor in normal, visual, operator, and insert modes if not in a menu + { + "context": "(VimControl || vim_mode == insert) && !menu", + "bindings": { + "alt-j": "editor::AddSelectionBelow", + "alt-k": "editor::AddSelectionAbove" + } + }, + // Surround vim + { + "context": "vim_mode == visual", + "bindings": { + "s": [ + "vim::PushOperator", + { + "AddSurrounds": {} + } + ] + } + }, + // TODO: Use alt-j and alt-k instead of ctrl-d and ctrl-u for scrolling + // - This currently doesn't work because hover hints are not in the menu context + // { + // "context": "menu", + // "bindings": { + // "alt-j": "vim::ScrollDown", + // "alt-k": "vim::ScrollUp" + // } + // }, { "context": "Editor", "bindings": { - "alt-f": "editor::Format" + "ctrl-.": "editor::ToggleCodeActions", + + "alt-f": "editor::Format", + "alt-h": ["workspace::ActivatePaneInDirection", "Left"], + "alt-l": ["workspace::ActivatePaneInDirection", "Right"], + "alt-space": "editor::ToggleCodeActions", + + "alt-shift-i": "editor::SplitSelectionIntoLines", + "alt-shift-j": "editor::MoveLineDown", + "alt-shift-k": "editor::MoveLineUp", + "alt-shift-r": "editor::RestartLanguageServer" + } + }, + { + "bindings": { + // allow file finder in insert mode (still doesn't work in completion menus) + "ctrl-p": "file_finder::Toggle", + + // Toggle between Terminal and Editor without closing terminal + "ctrl-shift-k": "terminal_panel::ToggleFocus", + // Open/Close Terminal + "ctrl-shift-i": "workspace::ToggleBottomDock", + + "alt-[": "workspace::ToggleLeftDock", + "alt-]": "workspace::ToggleRightDock", + + "alt-,": "zed::OpenSettings", + "alt-.": "zed::OpenKeymap", + + "alt-shift-,": "zed::OpenDefaultSettings", + "alt-shift-.": "zed::OpenDefaultKeymap", + "alt-shift-/": "vim::OpenDefaultKeymap", + + // Project file search, command palette + "alt-j": "menu::SelectNext", + "alt-k": "menu::SelectPrev" + } + }, + // Code Actions, Autocomplete + { + "context": "Editor && (showing_code_actions || showing_completions)", + "bindings": { + "alt-j": "editor::ContextMenuNext", + "alt-k": "editor::ContextMenuPrev" + } + }, + // Split Panes + { + "context": "Pane", + "bindings": { + "alt-shift-h": "pane::SplitLeft", + "alt-shift-l": "pane::SplitRight" + } + }, + // Firefox Developer Keyboard Shortcuts (kind of) + Pane Navigation from Terminal + { + "context": "Terminal", + "bindings": { + // Pane navigation + "alt-h": ["workspace::ActivatePaneInDirection", "Left"], + "alt-j": ["workspace::ActivatePaneInDirection", "Down"], + "alt-k": ["workspace::ActivatePaneInDirection", "Up"], + "alt-l": ["workspace::ActivatePaneInDirection", "Right"] + } + }, + // Pane Navigation from Project Panel + { + "context": "ProjectPanel", + "bindings": { + "alt-h": ["workspace::ActivatePaneInDirection", "Left"], + "alt-j": ["workspace::ActivatePaneInDirection", "Down"], + "alt-k": ["workspace::ActivatePaneInDirection", "Up"], + "alt-l": ["workspace::ActivatePaneInDirection", "Right"] } } ] diff --git a/zed/settings.json b/zed/settings.json index 3c5a95c..eae2a2c 100644 --- a/zed/settings.json +++ b/zed/settings.json @@ -8,6 +8,13 @@ // from the command palette or from `Zed` application menu. { // Settings applied after Welcome + "assistant": { + "default_model": { + "provider": "copilot_chat", + "model": "gpt-4o" + }, + "version": "2" + }, "base_keymap": "VSCode", "vim_mode": true, "telemetry": { @@ -30,6 +37,59 @@ }, "buffer_font_family": "Droid Sans Mono for Powerline", "formatter": "prettier", + "file_types": { + "env": [".env*"], // requires Zed env extension + "JSON": [".prettierrc"], + "JSONC": [ + "**/.vscode/**/*.json", + "**/packages/tsconfig/*.json", + "**/turbo.json", + "**/host.json", + "**/local.settings.json", + "**/tsconfig.json" + ], + "LOG": ["*.log", "*.log.*"] + }, + "gutter": { "code_actions": false }, + "preview_tabs": { + "enabled": false + }, + "project_panel": { + "show_diagnostics": "all", + "auto_fold_dirs": false, + "indent_size": 16 + }, + "relative_line_numbers": true, + "scroll_sensitivity": 2, + "search": { "case_sensitive": true, "regex": false, "whole_word": false }, + "search_wrap": false, // disables `n` on last result looping back to first result using `/` search + "tab_bar": { + "show_nav_history_buttons": false + }, "tab_size": 4, - "ui_font_family": "Droid Sans Mono for Powerline" + "tabs": { + "file_icons": true, + "git_status": true, + "show_diagnostics": "all" + }, + "terminal": { + // Powerline font necessary for oh-my-bash context renderer (git branch, etc.) + "font_family": "Droid Sans Mono for Powerline", + "font_size": 12 + }, + "toolbar": { + "quick_actions": false, + "selections_menu": false, + "breadcrumbs": false + }, + "ui_font_family": "Droid Sans Mono for Powerline", + "use_autoclose": false, + "use_smartcase_search": true, + "vim": { + "use_multiline_find": true, + "use_smartcase_find": true, + "toggle_relative_line_numbers": true, + "highlight_on_yank_duration": 100, + "use_system_clipboard": "always" + } }