diff --git a/bootstrap/components/zsh.sh b/bootstrap/components/zsh.sh index 793ab7c..a7e2511 100644 --- a/bootstrap/components/zsh.sh +++ b/bootstrap/components/zsh.sh @@ -1,14 +1,19 @@ echo "[INFO] ZDOTDIR = $ZDOTDIR" echo "[INFO] DOTFILES = $DOTFILES" -echo "[ACTION] Press any key to proceed" -read -n 1 -s -r +# echo "[ACTION] Press any key to proceed" +# read -n 1 -s -r echo "[INFO] Setting up system-wide zsh configuration" -echo "[ACTION] Elevation required!" +echo "[ACTION] Elevation required" test -f "/etc/zsh/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zsh/zshenv" test -f "/etc/zshenv" && sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zshenv" + +if [ $(uname) = "Darwin" ]; then + sudo cp "$DOTFILES/tools/zsh/zshenv" "/etc/zshenv" +fi + echo "[INFO] Installing zsh plugins" test -d $ZDOTDIR/plugins/zsh-autosuggestions || git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions.git $ZDOTDIR/plugins/zsh-autosuggestions test -d $ZDOTDIR/plugins/zsh-syntax-highlighting || git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ZDOTDIR/plugins/zsh-syntax-highlighting diff --git a/bootstrap/macOS/main.zsh b/bootstrap/macOS/main.zsh index 33590cb..3d842f5 100644 --- a/bootstrap/macOS/main.zsh +++ b/bootstrap/macOS/main.zsh @@ -14,7 +14,8 @@ echo "[ACTION] Request Human Takeover" xcode-select --install # Press any key to continue (if Xcode Command Line Tools are installed) -read -n 1 -s -r -p "Press any key to continue when xcode CLI tools are installed" +echo "[ACTION] Press any key to continue when xcode CLI tools are installed" +read -n 1 # System Preferences # Installation Sources @@ -29,7 +30,9 @@ echo "[INFO] Installing Homebrew" echo "[ACTION] Request Human Input" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -read -n 1 -s -r -p "Press any key to continue when xcode CLI tools are installed" + +echo "[ACTION] Press any key to continue when xcode CLI tools are installed" +read -n 1 echo "[INFO] Cloning Dotfiles" @@ -45,6 +48,10 @@ echo "[INFO] Installing Homebrew Packages" eval "$(/opt/homebrew/bin/brew shellenv)" brew bundle --file=$DOTFILES/bootstrap/macOS/Brewfile +# Setting up emacs +ln -s /usr/local/opt/emacs-mac/Emacs.app /Applications/Emacs.app + + # Setting Default Apps source $DOTFILES/bootstrap/macOS/duti.zsh @@ -62,10 +69,12 @@ source $DOTFILES/tools/zsh/zshrc echo "[INFO] Installing Rime" -git clone --depth 1 https://github.com/js0ny/Rime.git ~/Library/Rime +git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git ~/Library/Rime cd ~/Library/Rime -just set_remote +just init +# just install_rime +## Rime is installed via Brewfile just clone_plum echo "[INFO] Installing Doom Emacs" diff --git a/bootstrap/macOS/symlinks.zsh b/bootstrap/macOS/symlinks.zsh index 416d174..af80827 100644 --- a/bootstrap/macOS/symlinks.zsh +++ b/bootstrap/macOS/symlinks.zsh @@ -16,15 +16,15 @@ echo "[INFO] Setting up symbolic links" for src in ${(k)linkDots}; do dest="${linkDots[$src]}" echo "Linking $src to $dest" - # if [ -d "$src" ]; then - # test -d $dest && mv $dest $dest.bak - # mkdir -p $dest - # ln -sf $src $dest - # elif [ -f "$src" ]; then - # dest_parent=$(dirname $dest) - # test -d $dest_parent || mkdir -p $dest_parent - # ln -sf $src $dest - # else - # echo "[ERROR] $src does not exist" - # fi + if [ -d "$src" ]; then + test -d $dest && mv $dest $dest.bak + # mkdir -p $dest + ln -sf $src $dest + elif [ -f "$src" ]; then + dest_parent=$(dirname $dest) + test -d $dest_parent || mkdir -p $dest_parent + ln -sf $src $dest + else + echo "[ERROR] $src does not exist" + fi done diff --git a/bootstrap/setup.sh b/bootstrap/setup.sh index 0bbc212..e215743 100644 --- a/bootstrap/setup.sh +++ b/bootstrap/setup.sh @@ -15,8 +15,10 @@ export DOTFILES case "$(uname)" in Linux) : + ;; Darwin) curl https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/bootstrap/macOS/main.zsh -o ~/.local/.tmp/main.zsh zsh ~/.local/.tmp/main.zsh rm -rf ~/.local/.tmp/main.zsh + ;; esac diff --git a/platforms/linux/kde/dolphinrc b/platforms/linux/kde/dolphinrc index 0c22157..09bc6b1 100644 --- a/platforms/linux/kde/dolphinrc +++ b/platforms/linux/kde/dolphinrc @@ -16,3 +16,6 @@ ToolBarsMovable=Disabled [PreviewSettings] Plugins=appimagethumbnail,audiothumbnail,avif,blenderthumbnail,comicbookthumbnail,cursorthumbnail,djvuthumbnail,ebookthumbnail,exrthumbnail,directorythumbnail,fontthumbnail,heif,imagethumbnail,jpegthumbnail,jxl,kraorathumbnail,windowsexethumbnail,windowsimagethumbnail,mobithumbnail,opendocumentthumbnail,gsthumbnail,rawthumbnail,svgthumbnail,textthumbnail,ffmpegthumbs,gdk-pixbuf-thumbnailer + +[Search] +Location=Everywhere diff --git a/platforms/mac/karabiner/.gitignore b/platforms/mac/karabiner/.gitignore new file mode 100644 index 0000000..aa96c08 --- /dev/null +++ b/platforms/mac/karabiner/.gitignore @@ -0,0 +1 @@ +automatic_backups \ No newline at end of file diff --git a/platforms/mac/karabiner/assets/complex_modifications/1739653723.json b/platforms/mac/karabiner/assets/complex_modifications/1739653723.json new file mode 100644 index 0000000..a8d13d3 --- /dev/null +++ b/platforms/mac/karabiner/assets/complex_modifications/1739653723.json @@ -0,0 +1,997 @@ +{ + "title": "Fn -> Hyper", + "rules": [ + { + "description": "Fn + Letter -> Left_Shift + Left_Option + Left_Control + Left_Command + Letter", + "manipulators": [ + { + "type": "basic", + "from": { + "key_code": "grave_accent_and_tilde", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "grave_accent_and_tilde", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "1", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "1", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "2", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "2", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "3", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "3", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "4", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "4", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "5", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "5", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "6", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "6", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "7", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "7", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "8", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "8", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "9", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "9", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "0", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "0", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "hyphen", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "hyphen", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "equal_sign", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "equal_sign", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "q", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "w", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "e", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "e", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "r", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "r", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "t", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "y", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "y", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "u", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "u", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "i", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "o", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "o", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "p", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "p", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "open_bracket", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "open_bracket", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "close_bracket", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "close_bracket", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "backslash", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "backslash", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "a", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "s", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "d", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "d", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "f", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "f", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "g", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "h", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "h", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "j", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "j", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "k", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "k", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "l", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "l", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "semicolon", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "semicolon", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "quote", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "quote", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "z", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "x", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "c", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "v", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "b", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "b", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "n", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "n", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "m", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "m", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "comma", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "comma", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "period", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "period", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + }, + { + "type": "basic", + "from": { + "key_code": "slash", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": [ + "left_shift", + "left_option", + "left_control", + "left_command" + ] + } + ] + } + ] + } + ] +} diff --git a/platforms/mac/karabiner/caps_to_esc_lcmd.json b/platforms/mac/karabiner/caps_to_esc_lcmd.json deleted file mode 100644 index 00607a9..0000000 --- a/platforms/mac/karabiner/caps_to_esc_lcmd.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "description": "CapsLock to ESC (alone) or LCommand (withKeys)", - "manipulators": [ - { - "from": { - "key_code": "caps_lock", - "modifiers": { - "optional": [ - "any" - ] - } - }, - "to": [ - { - "key_code": "left_command" - } - ], - "to_if_alone": [ - { - "key_code": "escape" - } - ], - "type": "basic" - } - ] -} \ No newline at end of file diff --git a/platforms/mac/karabiner/fn-tab_to_cmd-tab.json b/platforms/mac/karabiner/fn-tab_to_cmd-tab.json deleted file mode 100644 index bc8089f..0000000 --- a/platforms/mac/karabiner/fn-tab_to_cmd-tab.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "description": "Map fn+tab to cmd+tab", - "manipulators": [ - { - "from": { - "key_code": "tab", - "modifiers": { - "mandatory": [ - "fn" - ] - } - }, - "to": [ - { - "key_code": "tab", - "modifiers": [ - "left_command" - ] - } - ], - "type": "basic" - } - ] -} \ No newline at end of file diff --git a/platforms/mac/karabiner/karabiner.json b/platforms/mac/karabiner/karabiner.json index d22eb3c..26f26b2 100644 --- a/platforms/mac/karabiner/karabiner.json +++ b/platforms/mac/karabiner/karabiner.json @@ -3,6 +3,763 @@ { "complex_modifications": { "rules": [ + { + "description": "Fn + Letter -> Left_Shift + Left_Option + Left_Control + Left_Command + Letter", + "manipulators": [ + { + "from": { + "key_code": "grave_accent_and_tilde", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "grave_accent_and_tilde", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "1", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "1", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "2", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "2", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "3", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "3", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "4", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "4", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "5", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "5", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "6", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "6", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "7", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "7", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "8", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "8", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "9", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "9", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "0", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "0", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "hyphen", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "hyphen", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "equal_sign", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "equal_sign", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "q", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "q", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "w", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "w", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "e", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "e", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "r", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "r", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "t", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "t", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "y", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "y", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "u", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "u", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "i", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "i", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "o", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "o", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "p", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "p", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "open_bracket", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "open_bracket", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "close_bracket", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "close_bracket", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "backslash", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "backslash", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "a", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "a", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "s", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "s", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "d", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "d", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "f", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "f", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "g", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "g", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "h", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "h", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "j", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "j", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "k", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "k", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "l", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "l", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "semicolon", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "semicolon", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "quote", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "quote", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "z", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "z", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "x", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "x", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "c", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "c", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "v", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "v", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "b", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "b", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "n", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "n", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "m", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "m", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "comma", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "comma", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "period", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "period", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + }, + { + "from": { + "key_code": "slash", + "modifiers": { + "mandatory": ["fn"], + "optional": ["caps_lock"] + } + }, + "to": [ + { + "key_code": "slash", + "modifiers": ["left_shift", "left_option", "left_control", "left_command"] + } + ], + "type": "basic" + } + ] + }, { "description": "Caps Lock to Esc and Ctrl", "manipulators": [ @@ -16,55 +773,6 @@ "type": "basic" } ] - }, - { - "description": "Change left_control+hnei to arrow keys", - "manipulators": [ - { - "from": { - "key_code": "h", - "modifiers": { - "mandatory": ["left_control"], - "optional": ["any"] - } - }, - "to": [{ "key_code": "left_arrow" }], - "type": "basic" - }, - { - "from": { - "key_code": "n", - "modifiers": { - "mandatory": ["left_control"], - "optional": ["any"] - } - }, - "to": [{ "key_code": "down_arrow" }], - "type": "basic" - }, - { - "from": { - "key_code": "e", - "modifiers": { - "mandatory": ["left_control"], - "optional": ["any"] - } - }, - "to": [{ "key_code": "up_arrow" }], - "type": "basic" - }, - { - "from": { - "key_code": "i", - "modifiers": { - "mandatory": ["left_control"], - "optional": ["any"] - } - }, - "to": [{ "key_code": "right_arrow" }], - "type": "basic" - } - ] } ] }, @@ -97,118 +805,39 @@ }, "ignore": false, "mouse_flip_vertical_wheel": true + }, + { + "identifiers": { + "is_keyboard": true, + "product_id": 641, + "vendor_id": 1452 + }, + "simple_modifications": [ + { + "from": { "apple_vendor_top_case_key_code": "keyboard_fn" }, + "to": [{ "key_code": "left_command" }] + }, + { + "from": { "key_code": "backslash" }, + "to": [{ "key_code": "delete_or_backspace" }] + }, + { + "from": { "key_code": "delete_or_backspace" }, + "to": [{ "key_code": "backslash" }] + }, + { + "from": { "key_code": "left_command" }, + "to": [{ "key_code": "left_option" }] + }, + { + "from": { "key_code": "left_option" }, + "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }] + } + ] } ], "name": "Default profile", "selected": true, - "simple_modifications": [ - { - "from": { "apple_vendor_top_case_key_code": "keyboard_fn" }, - "to": [{ "key_code": "left_command" }] - }, - { - "from": { "key_code": "left_command" }, - "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }] - } - ], - "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" } - }, - { - "complex_modifications": { - "rules": [ - { - "description": "Change left_control+hnei to arrow keys", - "manipulators": [ - { - "from": { - "key_code": "h", - "modifiers": { - "mandatory": ["left_control"], - "optional": ["any"] - } - }, - "to": [{ "key_code": "left_arrow" }], - "type": "basic" - }, - { - "from": { - "key_code": "n", - "modifiers": { - "mandatory": ["left_control"], - "optional": ["any"] - } - }, - "to": [{ "key_code": "down_arrow" }], - "type": "basic" - }, - { - "from": { - "key_code": "e", - "modifiers": { - "mandatory": ["left_control"], - "optional": ["any"] - } - }, - "to": [{ "key_code": "up_arrow" }], - "type": "basic" - }, - { - "from": { - "key_code": "i", - "modifiers": { - "mandatory": ["left_control"], - "optional": ["any"] - } - }, - "to": [{ "key_code": "right_arrow" }], - "type": "basic" - } - ] - } - ] - }, - "devices": [ - { - "identifiers": { - "is_keyboard": true, - "is_pointing_device": true, - "product_id": 626, - "vendor_id": 5426 - }, - "ignore": false, - "mouse_flip_y": true, - "simple_modifications": [ - { - "from": { "key_code": "left_command" }, - "to": [{ "key_code": "right_control" }] - }, - { - "from": { "key_code": "left_control" }, - "to": [{ "key_code": "left_command" }] - } - ] - }, - { - "identifiers": { - "is_pointing_device": true, - "product_id": 45088, - "vendor_id": 1133 - }, - "ignore": false, - "mouse_flip_vertical_wheel": true - } - ], - "name": "Default profile (copy)", - "simple_modifications": [ - { - "from": { "apple_vendor_top_case_key_code": "keyboard_fn" }, - "to": [{ "key_code": "left_command" }] - }, - { - "from": { "key_code": "left_command" }, - "to": [{ "apple_vendor_top_case_key_code": "keyboard_fn" }] - } - ], "virtual_hid_keyboard": { "keyboard_type_v2": "ansi" } } ] diff --git a/tools/browser/surfingkeys.js b/tools/browser/surfingkeys.js index 62892cf..210521e 100644 --- a/tools/browser/surfingkeys.js +++ b/tools/browser/surfingkeys.js @@ -3,7 +3,8 @@ // Load settings from: https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/tools/browser/surfingkeys.js // Browse to Extension > Surfingkeys > Allow access to file URLs to enable local file access // Windows: file:///C:/Users/username/.dotfiles/tools/browser/surfingkeys.js -// *nix: file:///home/username/.dotfiles/tools/browser/surfingkeys.js +// Linux: file:///home/username/.dotfiles/tools/browser/surfingkeys.js +// macOS: file:///Users/username/.dotfiles/tools/browser/surfingkeys.js // #region Example /** Examples @@ -488,19 +489,16 @@ mapkey(",y", "[y]ank app id", function () { * 1 - 学术 * 2 - 社交 */ -const perplexityFocusOn = function (n) { - q("div.rounded-md").querySelectorAll("span")[1].click() - setTimeout(() => { // Wait for the DOM to update - qs("div.shadow-subtle div.group\\/item")[n].click(); - }, 100); -}; unmap("", /perplexity.ai/); // allows to use perplexity web keybindings mapkey(",b", "Add Perplexity [b]ookmark", function () { // button.border:nth-child(2) q("div.sticky.left-0").querySelectorAll("button")[2].click() }, { domain: /perplexity.ai/ }); mapkey(",w", "Toggle [w]riting/[w]eb Search", function () { - perplexityFocusOn(0); + q("div.rounded-md").querySelectorAll("span")[1].click() + setTimeout(() => { // Wait for the DOM to update + qs("div.shadow-subtle div.group\\/item")[0].click(); + }, 100); }, { domain: /perplexity.ai/ }); mapkey(",s", "[s]tart Generating", function () { var btns = qs("span.grow button"); @@ -615,6 +613,17 @@ mapkey(",c", "toggle [c]aptions", function () { }, { domain: /youtube.com/ }); // #endregion +//#region zhihu.com +mapkey(",d", "Toggle [d]ark mode", function () { + const url = new URL(window.location.href); + if (url.searchParams.get("theme") === "dark") { + url.searchParams.set("theme", "light"); + } else { + url.searchParams.set("theme", "dark"); + } + window.location.href = url.href; +}, { domain: /zhihu.com/ }); +//#endregion // #endregion // #region ACE Editor diff --git a/tools/doom/config.el b/tools/doom/config.el index 4bc8d82..06479a6 100644 --- a/tools/doom/config.el +++ b/tools/doom/config.el @@ -22,7 +22,7 @@ ;; accept. For example: ;; ;; https://emacs-china.org/t/doom-emacs/23513/13 -(setq doom-font (font-spec :family "Iosevka Nerd Font Propo" :size 14) +(setq doom-font (font-spec :family "LXGW WenKai Mono" :size 14) doom-serif-font doom-font doom-symbol-font (font-spec :family "LXGW WenKai Mono") doom-variable-pitch-font (font-spec :family "LXGW WenKai Mono" :weight 'extra-bold)) diff --git a/tools/doom/evil.el b/tools/doom/evil.el index 2a4bb55..aec736e 100644 --- a/tools/doom/evil.el +++ b/tools/doom/evil.el @@ -21,4 +21,7 @@ (map! :leader ";" #'execute-extended-command ":" #'pp-eval-expression - "f h" #'consult-recent-file) + "f h" #'consult-recent-file + "b D" #'kill-some-buffers + "f c" #'doom/open-private-config + "f C" #'editorconfig-find-current-editorconfig) diff --git a/tools/doom/packages.el b/tools/doom/packages.el index 82fc249..53fc093 100644 --- a/tools/doom/packages.el +++ b/tools/doom/packages.el @@ -53,3 +53,4 @@ :recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))) (package! evil-matchit) (package! rime) +(package! ox-typst) diff --git a/tools/doom/treemacs.el b/tools/doom/treemacs.el index 49240b6..63d92da 100644 --- a/tools/doom/treemacs.el +++ b/tools/doom/treemacs.el @@ -10,6 +10,7 @@ "a" #'treemacs-create-file "A" #'treemacs-create-dir "c" #'treemacs-copy-file + "x" #'treemacs-move-file "d" #'treemacs-delete-file "r" #'treemacs-rename-file "q" #'treemacs-quit diff --git a/tools/fish/.gitignore b/tools/fish/.gitignore index 81de2a5..4ab7176 100644 --- a/tools/fish/.gitignore +++ b/tools/fish/.gitignore @@ -1,3 +1,4 @@ fish_variables completions +functions/br.fish themes/ diff --git a/tools/fish/conf.d/alias.fish b/tools/fish/conf.d/alias.fish index 7f3c6f2..73f91d9 100644 --- a/tools/fish/conf.d/alias.fish +++ b/tools/fish/conf.d/alias.fish @@ -11,8 +11,10 @@ switch (uname) case "Darwin" # macOS Specific - abbr --add clip pbcopy - abbr --add paste pbpaste + #abbr --add clip pbcopy + #abbr --add paste pbpaste + alias clip="pbcopy" + alias paste="pbpaste" # Use GNU Coreutils alias cp=gcp alias ln=gln @@ -21,11 +23,24 @@ case "Darwin" alias rm=grm alias rmdir=grmdir alias touch=gtouch + alias clip=pbcopy + alias paste=pbpaste abbr --add reboot "sudo reboot" case "Linux" # Linux Specific + #switch($XDG_SESSION_TYPE) + #case "wayland" + # Wayland Specific + alias clip="wl-copy" + alias paste="wl-paste" + #case "x11" + # # X11 Specific + # alias clip="xclip -selection clipboard" + # alias paste="xclip -selection clipboard -o" case '*' # Default / Fallback case + alias clip="xclip -selection clipboard" + alias paste="xclip -selection clipboard -o" end # Powershell equivalent @@ -82,6 +97,12 @@ function mtv mkdir -p (dirname $argv[1]) && touch $argv[1] && nvim $argv[1] end +function catclip + cat $argv | clip +end + +abbr --add bcat "bat --style=plain" + # Use neovide as gVim abbr --add gvi "neovide" diff --git a/tools/kitty/kitty.conf b/tools/kitty/kitty.conf index bb2578e..df2c861 100644 --- a/tools/kitty/kitty.conf +++ b/tools/kitty/kitty.conf @@ -1387,7 +1387,7 @@ disable_ligatures never #: Advanced {{{ -shell /opt/homebrew/bin/fish --interactive --login +# shell /opt/homebrew/bin/fish --interactive --login #: The shell program to execute. The default value of . means to use #: the value of of the SHELL environment variable or if unset, diff --git a/tools/nvim/lua/keymaps/init.lua b/tools/nvim/lua/keymaps/init.lua index 623215d..f52f46d 100644 --- a/tools/nvim/lua/keymaps/init.lua +++ b/tools/nvim/lua/keymaps/init.lua @@ -1,5 +1,6 @@ local M = {} -local keymaps_user_command = require("keymaps.user-command") +-- local keymaps_user_command = require("keymaps.user-command") +require("keymaps.user-command") local utils = require("keymaps.utils") local keymaps_nvim_tree_general = require("keymaps.nvim-tree").global diff --git a/tools/nvim/lua/keymaps/leaders.lua b/tools/nvim/lua/keymaps/leaders.lua index 320cf88..0c69dba 100644 --- a/tools/nvim/lua/keymaps/leaders.lua +++ b/tools/nvim/lua/keymaps/leaders.lua @@ -90,6 +90,7 @@ local leader_mappings = { }, c = { -- +code/compile { keys = "r", cmd = ":RunCode", opts = { desc = "Run code" } }, + { keys = "R", cmd = vim.lsp.buf.rename, opts = { desc = "Rename symbol under cursor" } }, { keys = "e", cmd = ":Telescope diagnostics", opts = { desc = "Navigate errors/warnings" } }, { keys = "f", cmd = formatFx, opts = { desc = "Format buffer" } }, { keys = "s", cmd = ":Telescope treesitter", opts = { desc = "Search symbols" } }, @@ -136,6 +137,9 @@ local leader_mappings = { { keys = "s", cmd = ":Telescope git_status", opts = { desc = "Git Status" } }, { keys = "t", cmd = ":Telescope git_branches", opts = { desc = "Git Branches" } }, }, + j = { -- +lsp + { keys = "r", cmd = vim.lsp.buf.references, opts = { desc = "Show current reference" } }, + }, p = { -- +project { keys = "p", cmd = ":Telescope projects", opts = { desc = "List all Projects" } }, { keys = "g", cmd = ":Telescope projects", opts = { desc = "List all Git Projects" } }, diff --git a/tools/nvim/lua/keymaps/lspkeys.lua b/tools/nvim/lua/keymaps/lspkeys.lua index 1682232..69eca86 100644 --- a/tools/nvim/lua/keymaps/lspkeys.lua +++ b/tools/nvim/lua/keymaps/lspkeys.lua @@ -1,5 +1,6 @@ local M = { { keys = "gd", cmd = vim.lsp.buf.definition, opts = { desc = "Goto Definition" } }, + { keys = "", cmd = vim.lsp.buf.definition, opts = { desc = "Goto Definition" } }, { keys = "gD", cmd = vim.lsp.buf.declaration, opts = { desc = "Goto Declaration" } }, { keys = "gr", cmd = vim.lsp.buf.references, opts = { desc = "Goto References" } }, { keys = "gi", cmd = vim.lsp.buf.implementation, opts = { desc = "Goto Implementation" } }, diff --git a/tools/qmk/keychron_k3_pro.c b/tools/qmk/keychron_k3_pro.c new file mode 100644 index 0000000..3aa3a8d --- /dev/null +++ b/tools/qmk/keychron_k3_pro.c @@ -0,0 +1,105 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +#define KC_ESC_CTRL MT(MOD_LCTL, KC_ESC) +#define KC_HYP MT(MOD_HYPR, KC_NO) +#define KC_TAB_L LT(CMK_TABL, KC_TAB) + +// clang-format off +enum layers{ + CMK_WIN, // Colemak Windows & GNU/Linux Base Layer (caps = esc/ctrl, swap bksp and backslash) (Switch to the left) + CMK_FNL, // Shared Functional Layer for both QWERTY and Colemak + /* +FN+C => CMK_WIN // Colemak Windows & GNU/Linux Base Layer +FN+M => QWE_MMM // QWERTY Modified Layer for macOS +FN+Q => QWE_DEF // QWERTY Default Layer +FN+X => CMK_MAC // Colemak Mac Layer +FN+W => QWE_MAC // QWERTY Mac Layer + */ + QWE_MMM, // QWERTY Modified Layer for macOS, designed for macOS Built-in Layout (Switch to the right) + QWE_DEF, // QWERTY Modified Layer for Windows & GNU/Linux, designed for GNU/Linux xkb colemak variant layout + CMK_MAC, // Colemak Mac Layer (swap CMD and CTRL at corner, caps = esc/ctrl, swap bksp and backslash, triggered by FN+M) + QWE_MAC, // QWERTY Mac Layer (Default Macintosh Layout) + CMK_TABL, // Colemak Tab Layer + CMK_SPCL // Colemak Space Layer +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[CMK_WIN] = LAYOUT_ansi_84( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, RGB_MOD, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_PGUP, + KC_TAB_L, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGDN, + KC_ESC_CTRL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(CMK_FNL),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[CMK_FNL] = LAYOUT_ansi_84( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, RGB_TOG, + KC_TRNS, BT_HST1, BT_HST2, BT_HST3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, TO(QWE_DEF), RGB_VAI, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, TO(CMK_MAC), TO(CMK_WIN), KC_TRNS, BAT_LVL, NK_TOGG, TO(QWE_MMM), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +[QWE_MMM] = LAYOUT_ansi_84( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, RGB_MOD, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGDN, + KC_ESC_CTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LGUI, KC_LCTL, KC_LALT, KC_SPC, KC_RALT, MO(CMK_FNL),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + // Swap GUI and CTRL + +[QWE_DEF] = LAYOUT_ansi_84( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, RGB_MOD, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(CMK_FNL),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[CMK_MAC] = LAYOUT_ansi_84( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, RGB_MOD, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_PGUP, + KC_TAB_L, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGDN, + KC_ESC_CTRL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LGUI, KC_LCTL, KC_LALT, KC_SPC, KC_RALT, MO(CMK_FNL),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[QWE_MAC] = LAYOUT_ansi_84( + KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNAP, KC_DEL, RGB_MOD, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LOPTN, KC_LCMMD, KC_SPC, KC_RCMMD,MO(CMK_FNL),KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), +[CMK_TABL] = LAYOUT_ansi_84( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, RGB_MOD, + KC_GRV, KC_1, KC_2, KC_3, KC_END, KC_5, KC_HOME, KC_7, KC_8, KC_9, KC_HOME, KC_MINS, KC_EQL, KC_BSLS, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_PGUP, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGDN, + KC_ESC_CTRL, KC_A, KC_R, KC_S, KC_T, KC_PGDN, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_O, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_HYP,KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), +[CMK_SPCL] = LAYOUT_ansi_84( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, RGB_MOD, + KC_GRV, KC_1, KC_2, KC_3, KC_END, KC_5, KC_HOME, KC_7, KC_8, KC_9, KC_HOME, KC_MINS, KC_EQL, KC_BSLS, KC_PGUP, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_PGUP, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGDN, + KC_ESC_CTRL, KC_A, KC_R, KC_S, KC_T, KC_PGDN, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_O, KC_QUOT, KC_ENT, KC_HOME, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_HYP,KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), +}; diff --git a/tools/vscode/keybindings-macos.jsonc b/tools/vscode/keybindings-macos.jsonc new file mode 100644 index 0000000..29a7506 --- /dev/null +++ b/tools/vscode/keybindings-macos.jsonc @@ -0,0 +1,726 @@ +// Place your key bindings in this file to override the defaults +[ + // #region mac minor change for cross-platform compatiblity + { + "key": "cmd+r", + "command": "workbench.action.openRecent" + }, + { + "key": "ctrl+r", + "command": "-workbench.action.openRecent" + }, + { + "key": "cmd+k cmd+o", + "command": "workbench.action.files.openFileFolder", + "when": "isMacNative && openFolderWorkspaceSupport" + }, + // #endregion + // #region quickOpen (Telescope) + { + "key": "cmd+p", + "command": "workbench.action.quickOpen" + }, + { + "key": "cmd+p", + "command": "workbench.action.quickOpenNavigatePrevious", + "when": "inQuickOpen" + }, + { + "key": "cmd+n", + "command": "workbench.action.quickOpenNavigateNext", + "when": "inQuickOpen" + }, + { + "key": "cmd+[", + "command": "workbench.action.closeQuickOpen", + "when": "inQuickOpen" + }, + { + "key": "ctrl+[", + "command": "workbench.action.closeQuickOpen", + "when": "inQuickOpen" + }, + { // Emacs-like + "key": "ctrl+g", + "command": "workbench.action.closeQuickOpen", + "when": "inQuickOpen" + }, + { // Emacs-like: M-x to show command palette + "key": "alt+x", + "command": "workbench.action.showCommands" + }, + // #endregion + // #region Extension: Code Runner + { + "key": "ctrl+alt+n", + "command": "-code-runner.run" + }, + // #endregion + // #region Nvim-Tree like File Explorer + // n, e : move cursor up/down + // h : move cursor to parent folder + // i : open file or folder + { + "key": "e", + "command": "list.focusUp", + "when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused" + }, + { + "key": "k", + "command": "-list.focusUp", + "when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused" + }, + { + "key": "e", + "command": "list.focusUp", + "when": "listFocus && !inputFocus" + }, + { + "key": "k", + "command": "-list.focusUp", + "when": "listFocus && !inputFocus" + }, + { + "key": "f", + "command": "filesExplorer.findInWorkspace", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { + "key": "n", + "command": "list.focusDown", + "when": "listFocus && !inputFocus" + }, + { + "key": "j", + "command": "-list.focusDown", + "when": "listFocus && !inputFocus" + }, + { + "key": "i", + "command": "list.select", + "when": "listFocus && !inputFocus" + }, + { + "key": "l", + "command": "-list.select", + "when": "listFocus && !inputFocus" + }, + { // z: Close all folders + "key": "z", + "command": "workbench.files.action.collapseExplorerFolders", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // e: Close left sidebar if is in file explorer + "key": "space e", + "command": "workbench.action.toggleSidebarVisibility", + "when": "sideBarFocus && !inputFocus && !searchViewletVisible && filesExplorerFocus" + }, + { // e: Focus on file explorer if is on sidebar and not in file explorer + "key": "space e", + "command": "workbench.files.action.focusFilesExplorer", + "when": "sideBarFocus && !inputFocus && !searchViewletVisible && !filesExplorerFocus" + }, + { // g: Focus on file explorer if is on sidebar and not in file explorer + "key": "space g", + "command": "workbench.scm.focus", + "when": "sideBarFocus && !inputFocus && !searchViewletVisible && !scmViewletVisible" + }, + { // a: add + "key": "a", + "command": "explorer.newFile", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // p: paste + "key": "p", + "command": "filesExplorer.paste", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // x: cut + "key": "x", + "command": "filesExplorer.cut", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // d: delete + "key": "d", + "command": "deleteFile", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // r: rename + "key": "r", + "command": "renameFile", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // s: open in vertical split / to side + "key": "s", + "command": "explorer.openToSide", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // A: add folder + "key": "shift+a", + "command": "explorer.newFolder", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // C: Copy path + "key": "shift+c", + "command": "copyFilePath", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // E: Open in File Explorer + "key": "shift+e", + "command": "revealFileInOS", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // E: Open in File Explorer (WSL) + "key": "shift+e", + "command": "remote-wsl.revealInExplorer", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus && remoteName == 'wsl'" + }, + { // O: Open with System App + "key": "shift+o", + "command": "openInExternalApp.open", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // Y: Copy Relative Path + "key": "shift+y", + "command": "copyRelativeFilePath", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // R: Copy Relative Path + "key": "shift+r", + "command": "workbench.files.action.refreshFilesExplorer", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // T: Open in terminal + "key": "shift+t", + "command": "openInIntegratedTerminal", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + // #endregion + // #region Vim-like Hover Browsing + { + "key": "h", + "command": "editor.action.scrollLeftHover", + "when": "editorHoverFocused" + }, + { + "key": "n", + "command": "editor.action.scrollDownHover", + "when": "editorHoverFocused" + }, + { + "key": "e", + "command": "editor.action.scrollUpHover", + "when": "editorHoverFocused" + }, + { + "key": "i", + "command": "editor.action.scrollRightHover", + "when": "editorHoverFocused" + }, + // #endregion + // #region Comment and semicolons + { + "key": "cmd+;", + "command": "extension.insertSemicolon", + "when": "editorTextFocus" + }, + { + "key": "cmd+/", + "command": "-extension.insertSemicolon", + "when": "editorTextFocus" + }, + // #endregion + // #region Vim-like Jupyter Navigation + { + "key": "n", + "command": "notebook.focusNextEditor", + "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'" + }, + { + "key": "j", + "command": "-notebook.focusNextEditor", + "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'" + }, + { + "key": "e", + "command": "notebook.focusPreviousEditor", + "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'" + }, + { + "key": "k", + "command": "-notebook.focusPreviousEditor", + "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'" + }, + // #endregion + // #region Editor: Completions + { + "key": "ctrl+n", + "command": "workbench.action.files.newUntitledFile", + "when": "!suggestWidgetVisible && !inQuickOpen" + }, + { + "key": "ctrl+n", + "command": "-workbench.action.files.newUntitledFile" + }, + { + "key": "ctrl+n", + "command": "selectNextSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" + }, + { + "key": "ctrl+p", + "command": "selectPrevSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" + }, + { + "key": "ctrl+f", + "command": "acceptSelectedSuggestion", + "when": "suggestWidgetVisible && textInputFocus && !inlineSuggestionVisible" + }, + { + "key": "alt+f", + "command": "editor.action.inlineSuggest.commit", + "when": "inlineSuggestionVisible && textInputFocus" + }, + { + "key": "ctrl+f", + "command": "editor.action.inlineSuggest.acceptNextWord", + "when": "inlineSuggestionVisible && textInputFocus" + }, + { + "key": "ctrl+b", + "command": "hideSuggestWidget", + "when": "suggestWidgetVisible && textInputFocus" + }, + { + "key": "ctrl+b", + "command": "editor.action.inlineSuggest.hide", + "when": "inlineSuggestionVisible && textInputFocus" + }, + // #endregion + // #region Terminal: tmux-like terminal control + { + "key": "cmd+0", + "command": "workbench.action.focusLastEditorGroup", + "when": "terminalFocus" + }, + { // prefix + x : kill terminal + "key": "ctrl+a x", + "command": "workbench.action.terminal.kill", + "when": "terminalFocus" + }, + { // prefix + c : create new terminal + "key": "ctrl+a c", + "command": "workbench.action.terminal.new", + "when": "terminalFocus" + }, + { // prefix + | : split terminal vertically + "key": "ctrl+a shift+\\", + "command": "workbench.action.terminal.split", + "when": "terminalFocus" + }, + { // prefix + \ : split terminal vertically + "key": "ctrl+a \\", + "command": "workbench.action.terminal.split", + "when": "terminalFocus" + }, + { // prefix + / : search + "key": "ctrl+a /", + "command": "workbench.action.terminal.focusFind", + "when": "terminalFocus" + }, + { // prefix + t : toggle terminal + "key": "ctrl+a t", + "command": "workbench.action.terminal.toggleTerminal", + "when": "terminalFocus" + }, + { // prefix + ^a: show information + "key": "ctrl+a ctrl+a", + "command": "workbench.action.terminal.focusHover", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { + "key": "ctrl+k ctrl+i", + "command": "-workbench.action.terminal.focusHover", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { // prefix + 1 : focus terminal 1 + "key": "ctrl+a 1", + "command": "workbench.action.terminal.focusAtIndex1", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { // prefix + 2 : focus terminal 2 + "key": "ctrl+a 2", + "command": "workbench.action.terminal.focusAtIndex2", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { // prefix + 3 : focus terminal 3 + "key": "ctrl+a 3", + "command": "workbench.action.terminal.focusAtIndex3", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { // prefix + g : Go to recent directory + "key": "ctrl+a g", + "command": "workbench.action.terminal.goToRecentDirectory", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+g", + "command": "-workbench.action.terminal.goToRecentDirectory", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { // prefix + d : detach terminal + "key": "ctrl+a d", + "command": "workbench.action.terminal.detachSession", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { // prefix + a : attach to session + "key": "ctrl+a a", + "command": "workbench.action.terminal.attachToSession", + "when": "terminalFocus" + }, + { + "key": "ctrl+a h", + "command": "workbench.action.terminal.focusPreviousPane", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a i", + "command": "workbench.action.terminal.focusNextPane", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a shift+H", + "command": "workbench.action.terminal.resizePaneLeft", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a shift+N", + "command": "workbench.action.terminal.resizePaneDown", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a shift+E", + "command": "workbench.action.terminal.resizePaneUp", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a shift+I", + "command": "workbench.action.terminal.resizePaneRight", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "cmd+`", + "command": "workbench.action.terminal.toggleTerminal", + "when": "terminal.active" + }, + { + "key": "ctrl+`", + "command": "-workbench.action.terminal.toggleTerminal", + "when": "terminal.active" + }, + // { + // "key": "space", + // "command": "vspacecode.space", + // "when": "activeEditorGroupEmpty && focusedView == '' && !whichkeyActive && !inputFocus" + // }, + // { + // "key": "space", + // "command": "vspacecode.space", + // "when": "sideBarFocus && !inputFocus && !whichkeyActive" + // }, + { + "key": "tab", + "command": "extension.vim_tab", + "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert' && editorLangId != 'magit'" + }, + { + "key": "tab", + "command": "-extension.vim_tab", + "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'" + }, + { + "key": "x", + "command": "magit.discard-at-point", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "k", + "command": "-magit.discard-at-point" + }, + { + "key": "-", + "command": "magit.reverse-at-point", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "v", + "command": "-magit.reverse-at-point" + }, + { + "key": "shift+-", + "command": "magit.reverting", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "shift+v", + "command": "-magit.reverting" + }, + { + "key": "shift+o", + "command": "magit.resetting", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "shift+x", + "command": "-magit.resetting" + }, + { + "key": "x", + "command": "-magit.reset-mixed" + }, + { + "key": "ctrl+u x", + "command": "-magit.reset-hard" + }, + { + "key": "y", + "command": "-magit.show-refs" + }, + { + "key": "y", + "command": "vspacecode.showMagitRefMenu", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode == 'Normal'" + }, + { + "key": "g", + "command": "-magit.refresh", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "g", + "command": "vspacecode.showMagitRefreshMenu", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "ctrl+j", + "command": "workbench.action.quickOpenSelectNext", + "when": "inQuickOpen" + }, + { + "key": "ctrl+k", + "command": "workbench.action.quickOpenSelectPrevious", + "when": "inQuickOpen" + }, + { + "key": "ctrl+j", + "command": "selectNextSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" + }, + { + "key": "ctrl+k", + "command": "selectPrevSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" + }, + { + "key": "ctrl+l", + "command": "acceptSelectedSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" + }, + { + "key": "ctrl+j", + "command": "showNextParameterHint", + "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" + }, + { + "key": "ctrl+k", + "command": "showPrevParameterHint", + "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" + }, + { + "key": "ctrl+j", + "command": "selectNextCodeAction", + "when": "codeActionMenuVisible" + }, + { + "key": "ctrl+k", + "command": "selectPrevCodeAction", + "when": "codeActionMenuVisible" + }, + { + "key": "ctrl+l", + "command": "acceptSelectedCodeAction", + "when": "codeActionMenuVisible" + }, + { + "key": "ctrl+h", + "command": "file-browser.stepOut", + "when": "inFileBrowser" + }, + { + "key": "ctrl+l", + "command": "file-browser.stepIn", + "when": "inFileBrowser" + }, + { + "key": "space", + "command": "vspacecode.space", + "when": "activeEditorGroupEmpty && focusedView == '' && !whichkeyActive && !inputFocus" + }, + { + "key": "space", + "command": "vspacecode.space", + "when": "sideBarFocus && !inputFocus && !whichkeyActive" + }, + // #endregion + // #region Editor: multicursor + { + "key": "alt+e", + "command": "editor.action.insertCursorAbove", + "when": "editorTextFocus" + }, + { + "key": "ctrl+alt+up", + "command": "-editor.action.insertCursorAbove", + "when": "editorTextFocus" + }, + { + "key": "alt+n", + "command": "editor.action.insertCursorBelow", + "when": "editorTextFocus" + }, + { + "key": "ctrl+alt+down", + "command": "-editor.action.insertCursorBelow", + "when": "editorTextFocus" + }, + // #endregion + // #region Emacs like Cursor Movements + { // macOS original C-a will move to BoL, VSCode cursorHome will move to BoL & first non-whitespace character + "key": "ctrl+a", + "command": "cursorHome", + "when": "textInputFocus" + }, + // no C-A and C-k C-a to select all, use S-a instead + { + "key": "ctrl+e", + "command": "cursorEnd", + "when": "textInputFocus" + }, + { + "key": "alt+b", + "command": "cursorWordStartLeft", + "when": "textInputFocus" + }, + { + "key": "alt+f", + "command": "cursorWordStartRight", + "when": "textInputFocus && !inlineEditIsVisible && !suggestWidgetVisible && !inlineSuggestionVisible" + }, + // #endregion + // #region Ctrl+W Remaps (Vim-like) + { + "key": "ctrl+w h", + "command": "workbench.action.navigateLeft" + }, + { + "key": "ctrl+w ctrl+h", + "command": "workbench.action.toggleSidebarVisibility" + }, + { + "key": "ctrl+w i", + "command": "workbench.action.navigateRight" + }, + { + "key": "ctrl+w ctrl+i", + "command": "workbench.action.toggleAuxiliaryBar" + }, + { + "key": "ctrl+w n", + "command": "workbench.action.navigateDown" + }, + { + "key": "ctrl+w ctrl+n", + "command": "workbench.action.togglePanel" + }, + { + "key": "ctrl+w e", + "command": "workbench.action.navigateUp" + }, + { // original ^w + "key": "ctrl+w ctrl+w", + "command": "workbench.action.closeActiveEditor", + "when": "editorFocus || inSettingsEditor || inKeybindings || inWelcome" + }, + { // :only + "key": "ctrl+w o", + "command": "runCommands", + "args": { + "commands": [ + "workbench.action.joinAllGroups", + "workbench.action.maximizeEditorHideSidebar" + ] + } + }, + { + "key": "ctrl+w ctrl+w", + "command": "workbench.action.closeGroup", + "when": "activeEditorGroupEmpty && multipleEditorGroups" + }, + { + "key": "ctrl+w", + "command": "-workbench.action.closeGroup", + "when": "activeEditorGroupEmpty && multipleEditorGroups" + }, + // #endregion + // #region Extension: VSpaceCode + { + "key": "alt+q", + "command": "vspacecode.space" + }, + // #endregion + // #region Sidebar: Search View + { // Focus on search list, therefore can use n/e to move up/down + "key": "escape", + "command": "search.action.focusSearchList", + "when": "searchViewletFocus && inputBoxFocus" + }, + { // Focus on main input box + "key": "l", + "command": "workbench.action.replaceInFiles", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "r", + "command": "toggleSearchRegex", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "w", + "command": "toggleSearchWholeWord", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "c", + "command": "toggleSearchCaseSensitive", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "p", + "command": "toggleSearchPreserveCase", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "i", + "command": "search.action.focusFilesToInclude", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "shift+e", + "command": "search.action.focusFilesToExclude", + "when": "searchViewletFocus && !inputBoxFocus" + }, + // #endregion + // #region Miscs and todos + // #endregion +] \ No newline at end of file diff --git a/tools/vscode/keybindings-windows-linux.jsonc b/tools/vscode/keybindings-windows-linux.jsonc new file mode 100644 index 0000000..34cf5d5 --- /dev/null +++ b/tools/vscode/keybindings-windows-linux.jsonc @@ -0,0 +1,834 @@ +// Place your key bindings in this file to override the defaultsauto[] +[ + // #region quickOpen (Telescope) + { + "key": "ctrl+p", + "command": "workbench.action.quickOpen" + }, + { + "key": "ctrl+p", + "command": "workbench.action.quickOpenNavigatePrevious", + "when": "inQuickOpen" + }, + { + "key": "ctrl+n", + "command": "workbench.action.quickOpenNavigateNext", + "when": "inQuickOpen" + }, + { + "key": "ctrl+[", + "command": "workbench.action.closeQuickOpen", + "when": "inQuickOpen" + }, + { // Emacs-like + "key": "ctrl+g", + "command": "workbench.action.closeQuickOpen", + "when": "inQuickOpen" + }, + { // Emacs-like: M-x to show command palette + "key": "alt+x", + "command": "workbench.action.showCommands" + }, + // #endregion + // #region Extension: Code Runner + { + "key": "ctrl+alt+n", + "command": "-code-runner.run" + }, + // #endregion + // #region Comment and semicolons + { + "key": "ctrl+oem_1", // ctrl+; + "command": "extension.insertSemicolon", + "when": "editorTextFocus" + }, + { // change to toggle comment + "key": "ctrl+oem_2", // ctrl+/; + "command": "-extension.insertSemicolon", + "when": "editorTextFocus" + }, + { + "key": "ctrl+shift+oem_1", + "command": "extension.insertSemicolonWithNewLine", + "when": "editorTextFocus" + }, + { + "key": "ctrl+shift+oem_2", + "command": "-extension.insertSemicolonWithNewLine", + "when": "editorTextFocus" + }, + { + "key": "ctrl+shift+oem_2", + "command": "github.copilot.acceptCursorPanelSolution", + "when": "github.copilot.activated && github.copilot.panelVisible" + }, + { + "key": "ctrl+oem_2", + "command": "-github.copilot.acceptCursorPanelSolution", + "when": "github.copilot.activated && github.copilot.panelVisible" + }, + // #endregion + // #region Nvim-Tree like File Explorer + // n, e : move cursor up/down + // h : move cursor to parent folder + // i : open file or folder + { + "key": "e", + "command": "list.focusUp", + "when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused" + }, + { + "key": "k", + "command": "-list.focusUp", + "when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused" + }, + { + "key": "e", + "command": "list.focusUp", + "when": "listFocus && !inputFocus" + }, + { + "key": "k", + "command": "-list.focusUp", + "when": "listFocus && !inputFocus" + }, + { + "key": "f", + "command": "filesExplorer.findInWorkspace", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { + "key": "n", + "command": "list.focusDown", + "when": "listFocus && !inputFocus" + }, + { + "key": "j", + "command": "-list.focusDown", + "when": "listFocus && !inputFocus" + }, + { + "key": "i", + "command": "list.select", + "when": "listFocus && !inputFocus" + }, + { + "key": "l", + "command": "-list.select", + "when": "listFocus && !inputFocus" + }, + { // z: Close all folders + "key": "z", + "command": "workbench.files.action.collapseExplorerFolders", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // e: Close left sidebar if is in file explorer + "key": "space e", + "command": "workbench.action.toggleSidebarVisibility", + "when": "sideBarFocus && !inputFocus && !searchViewletVisible && filesExplorerFocus" + }, + { // e: Focus on file explorer if is on sidebar and not in file explorer + "key": "space e", + "command": "workbench.files.action.focusFilesExplorer", + "when": "sideBarFocus && !inputFocus && !searchViewletVisible && !filesExplorerFocus" + }, + { // g: Focus on file explorer if is on sidebar and not in file explorer + "key": "space g", + "command": "workbench.scm.focus", + "when": "sideBarFocus && !inputFocus && !searchViewletVisible && !scmViewletVisible" + }, + { // a: add + "key": "a", + "command": "explorer.newFile", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // p: paste + "key": "p", + "command": "filesExplorer.paste", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // x: cut + "key": "x", + "command": "filesExplorer.cut", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // d: delete + "key": "d", + "command": "deleteFile", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // r: rename + "key": "r", + "command": "renameFile", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // s: open in vertical split / to side + "key": "s", + "command": "explorer.openToSide", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // A: add folder + "key": "shift+a", + "command": "explorer.newFolder", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // C: Copy path + "key": "shift+c", + "command": "copyFilePath", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // E: Open in File Explorer + "key": "shift+e", + "command": "revealFileInOS", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // E: Open in File Explorer (WSL) + "key": "shift+e", + "command": "remote-wsl.revealInExplorer", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus && remoteName == 'wsl'" + }, + { // O: Open with System App + "key": "shift+o", + "command": "openInExternalApp.open", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // Y: Copy Relative Path + "key": "shift+y", + "command": "copyRelativeFilePath", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // R: Copy Relative Path + "key": "shift+r", + "command": "workbench.files.action.refreshFilesExplorer", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { // T: Open in terminal + "key": "shift+t", + "command": "openInIntegratedTerminal", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + // #endregion + // #region Vim-like Hover Browsing + { + "key": "h", + "command": "editor.action.scrollLeftHover", + "when": "editorHoverFocused" + }, + { + "key": "n", + "command": "editor.action.scrollDownHover", + "when": "editorHoverFocused" + }, + { + "key": "e", + "command": "editor.action.scrollUpHover", + "when": "editorHoverFocused" + }, + { + "key": "i", + "command": "editor.action.scrollRightHover", + "when": "editorHoverFocused" + }, + // #endregion + // #region Vim-like Jupyter Navigation + { + "key": "n", + "command": "notebook.focusNextEditor", + "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'" + }, + { + "key": "j", + "command": "-notebook.focusNextEditor", + "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'" + }, + { + "key": "e", + "command": "notebook.focusPreviousEditor", + "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'" + }, + { + "key": "k", + "command": "-notebook.focusPreviousEditor", + "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'" + }, + // #endregion + // #region Git / Source Control + // { // Alt+Enter: Send Commit when editing commit message + // "key": "alt+enter", + // "command": "git.commitMessageAccept", + // "when": "editorLangId=\"git-commit\"" + // }, + { + "key": "ctrl+shift+g c", + "command": "-gitlens.showQuickCommitFileDetails", + "when": "editorTextFocus && !gitlens:disabled && config.gitlens.keymap == 'chorded'" + }, + { + "key": "ctrl+shift+g s", + "command": "git.stageAll" + }, + { + "key": "ctrl+shift+g g", + "command": "workbench.view.scm", + "when": "workbench.scm.active" + }, + { + "key": "ctrl+shift+g", + "command": "-workbench.view.scm", + "when": "workbench.scm.active" + }, + { + "key": "ctrl+k ctrl+shift+b", + "command": "editor.action.goToSelectionAnchor" + }, + { + "key": "ctrl+k ctrl+shift+i", + "command": "workbench.action.selectProductIconTheme" + }, + { + "key": "ctrl+l p", + "command": "-extension.openPrGitProvider" + }, + { + "key": "ctrl+l g", + "command": "-extension.openInGitHub" + }, + { + "key": "ctrl+l c", + "command": "-extension.copyGitHubLinkToClipboard" + }, + // #endregion + // #region Use ^pbnf to navigate completions + { + "key": "ctrl+n", + "command": "workbench.action.files.newUntitledFile", + "when": "!suggestWidgetVisible && !inQuickOpen" + }, + { + "key": "ctrl+n", + "command": "-workbench.action.files.newUntitledFile" + }, + { + "key": "ctrl+n", + "command": "selectNextSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" + }, + { + "key": "ctrl+p", + "command": "selectPrevSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" + }, + { + "key": "ctrl+f", + "command": "acceptSelectedSuggestion", + "when": "suggestWidgetVisible && textInputFocus && !inlineSuggestionVisible" + }, + { + "key": "alt+f", + "command": "editor.action.inlineSuggest.commit", + "when": "inlineSuggestionVisible && textInputFocus" + }, + { + "key": "ctrl+f", + "command": "editor.action.inlineSuggest.acceptNextWord", + "when": "inlineSuggestionVisible && textInputFocus" + }, + { + "key": "ctrl+b", + "command": "hideSuggestWidget", + "when": "suggestWidgetVisible && textInputFocus" + }, + { + "key": "ctrl+b", + "command": "editor.action.inlineSuggest.hide", + "when": "inlineSuggestionVisible && textInputFocus" + }, + // #endregion + // #region Terminal Control, use ^a as prefix / leader key + // tmux-like terminal control + { // prefix + x : kill terminal + "key": "ctrl+a space", + "command": "vspacecode.space", + "when": "terminalFocus" + }, + { // prefix + x : kill terminal + "key": "ctrl+a x", + "command": "workbench.action.terminal.kill", + "when": "terminalFocus" + }, + { // prefix + c : create new terminal + "key": "ctrl+a c", + "command": "workbench.action.terminal.new", + "when": "terminalFocus" + }, + { // prefix + | : split terminal vertically + "key": "ctrl+a shift+\\", + "command": "workbench.action.terminal.split", + "when": "terminalFocus" + }, + { // prefix + \ : split terminal vertically + "key": "ctrl+a \\", + "command": "workbench.action.terminal.split", + "when": "terminalFocus" + }, + { // prefix + / : search + "key": "ctrl+a /", + "command": "workbench.action.terminal.focusFind", + "when": "terminalFocus" + }, + { // prefix + t : toggle terminal + "key": "ctrl+a t", + "command": "workbench.action.terminal.toggleTerminal", + "when": "terminalFocus" + }, + { // prefix + ^a: show information + "key": "ctrl+a ctrl+a", + "command": "workbench.action.terminal.focusHover", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { + "key": "ctrl+k ctrl+i", + "command": "-workbench.action.terminal.focusHover", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { // prefix + 1 : focus terminal 1 + "key": "ctrl+a 1", + "command": "workbench.action.terminal.focusAtIndex1", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { // prefix + 2 : focus terminal 2 + "key": "ctrl+a 2", + "command": "workbench.action.terminal.focusAtIndex2", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { // prefix + 3 : focus terminal 3 + "key": "ctrl+a 3", + "command": "workbench.action.terminal.focusAtIndex3", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" + }, + { // prefix + g : Go to recent directory + "key": "ctrl+a g", + "command": "workbench.action.terminal.goToRecentDirectory", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+g", + "command": "-workbench.action.terminal.goToRecentDirectory", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { // prefix + d : detach terminal + "key": "ctrl+a d", + "command": "workbench.action.terminal.detachSession", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { // prefix + a : attach to session + "key": "ctrl+a a", + "command": "workbench.action.terminal.attachToSession", + "when": "terminalFocus" + }, + { + "key": "ctrl+a h", + "command": "workbench.action.terminal.focusPreviousPane", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a i", + "command": "workbench.action.terminal.focusNextPane", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a shift+H", + "command": "workbench.action.terminal.resizePaneLeft", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a shift+N", + "command": "workbench.action.terminal.resizePaneDown", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a shift+E", + "command": "workbench.action.terminal.resizePaneUp", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + { + "key": "ctrl+a shift+I", + "command": "workbench.action.terminal.resizePaneRight", + "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" + }, + // #endregion + // #region Misc + { + "key": "ctrl+o", + "command": "-workbench.action.files.openFolderViaWorkspace", + "when": "!openFolderWorkspaceSupport && workbenchState == 'workspace'" + }, + { + "key": "f9", + "command": "csdevkit.debug.noDebugFileLaunch" + }, + { + "key": "ctrl+h", + "command": "-editor.action.startFindReplaceAction", + "when": "editorFocus || editorIsOpen" + }, + { + "key": "ctrl+h", + "command": "-extension.vim_ctrl+h", + "when": "editorTextFocus && vim.active && vim.use && !inDebugRepl" + }, + { + "key": "ctrl+r", + "command": "-workbench.action.reloadWindow", + "when": "isDevelopment" + }, + { + "key": "ctrl+alt+r", + "command": "-workbench.action.terminal.runRecentCommand", + "when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled" + }, + { + "key": "ctrl+r", + "command": "-workbench.action.terminal.runRecentCommand", + "when": "accessibilityModeEnabled && terminalFocus && terminalHasBeenCreated || accessibilityModeEnabled && terminalFocus && terminalProcessSupported || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'" + }, + { + "key": "ctrl+shift+r", + "command": "-rerunSearchEditorSearch", + "when": "inSearchEditor" + }, + { + "key": "ctrl+shift+r", + "command": "-editor.action.refactor", + "when": "editorHasCodeActionsProvider && textInputFocus && !editorReadonly" + }, + { + "key": "ctrl+shift+r", + "command": "workbench.action.quickOpenNavigatePreviousInRecentFilesPicker", + "when": "inQuickOpen && inRecentFilesPicker" + }, + { + "key": "ctrl+shift+l", + "command": "cursorLineStart", + "when": "textInputFocus" + }, + { + "key": "space", + "command": "vspacecode.space", + "when": "activeEditorGroupEmpty && focusedView == '' && !whichkeyActive && !inputFocus" + }, + { + "key": "space", + "command": "vspacecode.space", + "when": "sideBarFocus && !inputFocus && !whichkeyActive" + }, + { + "key": "tab", + "command": "extension.vim_tab", + "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert' && editorLangId != 'magit'" + }, + { + "key": "tab", + "command": "-extension.vim_tab", + "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'" + }, + { + "key": "x", + "command": "magit.discard-at-point", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "k", + "command": "-magit.discard-at-point" + }, + { + "key": "-", + "command": "magit.reverse-at-point", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "v", + "command": "-magit.reverse-at-point" + }, + { + "key": "shift+-", + "command": "magit.reverting", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "shift+v", + "command": "-magit.reverting" + }, + { + "key": "shift+o", + "command": "magit.resetting", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "shift+x", + "command": "-magit.resetting" + }, + { + "key": "x", + "command": "-magit.reset-mixed" + }, + { + "key": "ctrl+u x", + "command": "-magit.reset-hard" + }, + { + "key": "y", + "command": "-magit.show-refs" + }, + { + "key": "y", + "command": "vspacecode.showMagitRefMenu", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode == 'Normal'" + }, + { + "key": "g", + "command": "-magit.refresh", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "g", + "command": "vspacecode.showMagitRefreshMenu", + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + }, + { + "key": "ctrl+j", + "command": "workbench.action.quickOpenSelectNext", + "when": "inQuickOpen" + }, + { + "key": "ctrl+k", + "command": "workbench.action.quickOpenSelectPrevious", + "when": "inQuickOpen" + }, + { + "key": "ctrl+j", + "command": "selectNextSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" + }, + { + "key": "ctrl+k", + "command": "selectPrevSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" + }, + { + "key": "ctrl+l", + "command": "acceptSelectedSuggestion", + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" + }, + { + "key": "ctrl+j", + "command": "showNextParameterHint", + "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" + }, + { + "key": "ctrl+k", + "command": "showPrevParameterHint", + "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" + }, + { + "key": "ctrl+j", + "command": "selectNextCodeAction", + "when": "codeActionMenuVisible" + }, + { + "key": "ctrl+k", + "command": "selectPrevCodeAction", + "when": "codeActionMenuVisible" + }, + { + "key": "ctrl+l", + "command": "acceptSelectedCodeAction", + "when": "codeActionMenuVisible" + }, + { + "key": "ctrl+h", + "command": "file-browser.stepOut", + "when": "inFileBrowser" + }, + { + "key": "ctrl+l", + "command": "file-browser.stepIn", + "when": "inFileBrowser" + }, + { + "key": "ctrl+oem_4", + "command": "whichkey.undoKey", + "when": "whichkeyVisible" + }, + // #region multicursor + { + "key": "alt+e", + "command": "editor.action.insertCursorAbove", + "when": "editorTextFocus" + }, + { + "key": "ctrl+alt+up", + "command": "-editor.action.insertCursorAbove", + "when": "editorTextFocus" + }, + { + "key": "alt+n", + "command": "editor.action.insertCursorBelow", + "when": "editorTextFocus" + }, + { + "key": "ctrl+alt+down", + "command": "-editor.action.insertCursorBelow", + "when": "editorTextFocus" + }, + // #endregion + // #endregion + // #region Ctrl+W Remaps (Vim-like) + { + "key": "ctrl+w h", + "command": "workbench.action.navigateLeft" + }, + { + "key": "ctrl+w ctrl+h", + "command": "workbench.action.toggleSidebarVisibility" + }, + { + "key": "ctrl+w i", + "command": "workbench.action.navigateRight" + }, + { + "key": "ctrl+w ctrl+i", + "command": "workbench.action.toggleAuxiliaryBar" + }, + { + "key": "ctrl+w n", + "command": "workbench.action.navigateDown" + }, + { + "key": "ctrl+w ctrl+n", + "command": "workbench.action.togglePanel" + }, + { + "key": "ctrl+w e", + "command": "workbench.action.navigateUp" + }, + { // original ^w + "key": "ctrl+w ctrl+w", + "command": "workbench.action.closeActiveEditor", + "when": "editorFocus || inSettingsEditor || inKeybindings || inWelcome" + }, + { // :only + "key": "ctrl+w o", + "command": "runCommands", + "args": { + "commands": [ + "workbench.action.joinAllGroups", + "workbench.action.maximizeEditorHideSidebar" + ] + } + }, + { + "key": "ctrl+w ctrl+w", + "command": "workbench.action.closeGroup", + "when": "activeEditorGroupEmpty && multipleEditorGroups" + }, + { + "key": "ctrl+w", + "command": "-workbench.action.closeGroup", + "when": "activeEditorGroupEmpty && multipleEditorGroups" + }, + // #endregion + // #region Emacs like Cursor Movement + { + "key": "ctrl+f", + "command": "cursorRight", + "when": "textInputFocus && !inlineEditIsVisible && !suggestWidgetVisible && !inlineSuggestionVisible" + }, + { + "key": "ctrl+b", + "command": "cursorLeft", + "when": "textInputFocus && !inlineEditIsVisible && !suggestWidgetVisible && !inlineSuggestionVisible" + }, + { + "key": "ctrl+n", + "command": "cursorDown", + "when": "textInputFocus && !suggestWidgetVisible && !inQuickOpen" + }, + { + "key": "ctrl+p", + "command": "cursorUp", + "when": "textInputFocus && !suggestWidgetVisible && !inQuickOpen" + }, + { + "key": "ctrl+a", + "command": "cursorHome", + "when": "textInputFocus" + }, + { + "key": "ctrl+shift+a", + "command": "cursorEnd", + "when": "editor.action.selectAll" + }, + { + "key": "ctrl+k ctrl+a", + "command": "editor.action.selectAll" + }, + { + "key": "ctrl+e", + "command": "cursorEnd", + "when": "textInputFocus" + }, + { + "key": "alt+b", + "command": "cursorWordStartLeft", + "when": "textInputFocus" + }, + { + "key": "alt+f", + "command": "cursorWordStartRight", + "when": "textInputFocus && !inlineEditIsVisible && !suggestWidgetVisible && !inlineSuggestionVisible" + }, + // #endregion + // #region Search View + { // Focus on search list, therefore can use n/e to move up/down + "key": "escape", + "command": "search.action.focusSearchList", + "when": "searchViewletFocus && inputBoxFocus" + }, + { // Focus on main input box + "key": "l", + "command": "workbench.action.replaceInFiles", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "r", + "command": "toggleSearchRegex", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "w", + "command": "toggleSearchWholeWord", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "c", + "command": "toggleSearchCaseSensitive", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "p", + "command": "toggleSearchPreserveCase", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "i", + "command": "search.action.focusFilesToInclude", + "when": "searchViewletFocus && !inputBoxFocus" + }, + { + "key": "shift+e", + "command": "search.action.focusFilesToExclude", + "when": "searchViewletFocus && !inputBoxFocus" + }, + // #endregion +] \ No newline at end of file diff --git a/tools/vscode/keybindings.json b/tools/vscode/keybindings.json deleted file mode 100644 index aabd41b..0000000 --- a/tools/vscode/keybindings.json +++ /dev/null @@ -1,850 +0,0 @@ -// Place your key bindings in this file to override the defaultsauto[] -[ - { - "key": "ctrl+p", - "command": "workbench.action.quickOpen" - }, - { - "key": "ctrl+p", - "command": "workbench.action.quickOpenNavigatePrevious", - "when": "inQuickOpen" - }, - { - "key": "ctrl+n", - "command": "workbench.action.quickOpenNavigateNext", - "when": "inQuickOpen" - }, - { - "key": "ctrl+[", - "command": "workbench.action.closeQuickOpen", - "when": "inQuickOpen" - }, - { // Emacs-like - "key": "ctrl+g", - "command": "workbench.action.closeQuickOpen", - "when": "inQuickOpen" - }, - { // Emacs-like: M-x to show command palette - "key": "alt+x", - "command": "workbench.action.showCommands" - }, - // #endregion - // #region Extension: Code Runner - { - "key": "ctrl+alt+n", - "command": "-code-runner.run" - }, - // #endregion - // #region Comment and semicolons - { - "key": "ctrl+oem_1", // ctrl+; - "command": "extension.insertSemicolon", - "when": "editorTextFocus" - }, - { // change to toggle comment - "key": "ctrl+oem_2", // ctrl+/; - "command": "-extension.insertSemicolon", - "when": "editorTextFocus" - }, - { - "key": "ctrl+shift+oem_1", - "command": "extension.insertSemicolonWithNewLine", - "when": "editorTextFocus" - }, - { - "key": "ctrl+shift+oem_2", - "command": "-extension.insertSemicolonWithNewLine", - "when": "editorTextFocus" - }, - { - "key": "ctrl+shift+oem_2", - "command": "github.copilot.acceptCursorPanelSolution", - "when": "github.copilot.activated && github.copilot.panelVisible" - }, - { - "key": "ctrl+oem_2", - "command": "-github.copilot.acceptCursorPanelSolution", - "when": "github.copilot.activated && github.copilot.panelVisible" - }, - // #endregion - // #region Nvim-Tree like File Explorer - // n, e : move cursor up/down - // h : move cursor to parent folder - // i : open file or folder - { - "key": "e", - "command": "list.focusUp", - "when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused" - }, - { - "key": "k", - "command": "-list.focusUp", - "when": "notebookEditorFocused && !inputFocus && !notebookOutputInputFocused" - }, - { - "key": "e", - "command": "list.focusUp", - "when": "listFocus && !inputFocus" - }, - { - "key": "k", - "command": "-list.focusUp", - "when": "listFocus && !inputFocus" - }, - { - "key": "f", - "command": "filesExplorer.findInWorkspace", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { - "key": "n", - "command": "list.focusDown", - "when": "listFocus && !inputFocus" - }, - { - "key": "j", - "command": "-list.focusDown", - "when": "listFocus && !inputFocus" - }, - { - "key": "i", - "command": "list.select", - "when": "listFocus && !inputFocus" - }, - { - "key": "l", - "command": "-list.select", - "when": "listFocus && !inputFocus" - }, - { // z: Close all folders - "key": "z", - "command": "workbench.files.action.collapseExplorerFolders", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // e: Close left sidebar if is in file explorer - "key": "space e", - "command": "workbench.action.toggleSidebarVisibility", - "when": "sideBarFocus && !inputFocus && !searchViewletVisible && filesExplorerFocus" - }, - { // e: Focus on file explorer if is on sidebar and not in file explorer - "key": "space e", - "command": "workbench.files.action.focusFilesExplorer", - "when": "sideBarFocus && !inputFocus && !searchViewletVisible && !filesExplorerFocus" - }, - { // g: Focus on file explorer if is on sidebar and not in file explorer - "key": "space g", - "command": "workbench.scm.focus", - "when": "sideBarFocus && !inputFocus && !searchViewletVisible && !scmViewletVisible" - }, - { // a: add - "key": "a", - "command": "explorer.newFile", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // p: paste - "key": "p", - "command": "filesExplorer.paste", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // x: cut - "key": "x", - "command": "filesExplorer.cut", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // d: delete - "key": "d", - "command": "deleteFile", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // r: rename - "key": "r", - "command": "renameFile", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // s: open in vertical split / to side - "key": "s", - "command": "explorer.openToSide", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // A: add folder - "key": "shift+a", - "command": "explorer.newFolder", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // C: Copy path - "key": "shift+c", - "command": "copyFilePath", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // E: Open in File Explorer - "key": "shift+e", - "command": "revealFileInOS", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // E: Open in File Explorer (WSL) - "key": "shift+e", - "command": "remote-wsl.revealInExplorer", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus && remoteName == 'wsl'" - }, - { // O: Open with System App - "key": "shift+o", - "command": "openInExternalApp.open", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // Y: Copy Relative Path - "key": "shift+y", - "command": "copyRelativeFilePath", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // R: Copy Relative Path - "key": "shift+r", - "command": "workbench.files.action.refreshFilesExplorer", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - { // T: Open in terminal - "key": "shift+t", - "command": "openInIntegratedTerminal", - "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" - }, - // #endregion - // #region Vim-like Hover Browsing - { - "key": "h", - "command": "editor.action.scrollLeftHover", - "when": "editorHoverFocused" - }, - { - "key": "n", - "command": "editor.action.scrollDownHover", - "when": "editorHoverFocused" - }, - { - "key": "e", - "command": "editor.action.scrollUpHover", - "when": "editorHoverFocused" - }, - { - "key": "i", - "command": "editor.action.scrollRightHover", - "when": "editorHoverFocused" - }, - // #endregion - // #region Vim-like Jupyter Navigation - { - "key": "n", - "command": "notebook.focusNextEditor", - "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'" - }, - { - "key": "j", - "command": "-notebook.focusNextEditor", - "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'none' && notebookEditorCursorAtBoundary != 'top'" - }, - { - "key": "e", - "command": "notebook.focusPreviousEditor", - "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'" - }, - { - "key": "k", - "command": "-notebook.focusPreviousEditor", - "when": "editorTextFocus && inputFocus && notebookEditorFocused && vim.mode == 'Normal' && notebookEditorCursorAtBoundary != 'bottom' && notebookEditorCursorAtBoundary != 'none'" - }, - // #endregion - // #region Git / Source Control - // { // Alt+Enter: Send Commit when editing commit message - // "key": "alt+enter", - // "command": "git.commitMessageAccept", - // "when": "editorLangId=\"git-commit\"" - // }, - { - "key": "ctrl+shift+g c", - "command": "-gitlens.showQuickCommitFileDetails", - "when": "editorTextFocus && !gitlens:disabled && config.gitlens.keymap == 'chorded'" - }, - { - "key": "ctrl+shift+g s", - "command": "git.stageAll" - }, - { - "key": "ctrl+shift+g g", - "command": "workbench.view.scm", - "when": "workbench.scm.active" - }, - { - "key": "ctrl+shift+g", - "command": "-workbench.view.scm", - "when": "workbench.scm.active" - }, - { - "key": "ctrl+k ctrl+shift+b", - "command": "editor.action.goToSelectionAnchor" - }, - { - "key": "ctrl+k ctrl+shift+i", - "command": "workbench.action.selectProductIconTheme" - }, - { - "key": "ctrl+l p", - "command": "-extension.openPrGitProvider" - }, - { - "key": "ctrl+l g", - "command": "-extension.openInGitHub" - }, - { - "key": "ctrl+l c", - "command": "-extension.copyGitHubLinkToClipboard" - }, - // #endregion - // #region Use ^pbnf to navigate completions - { - "key": "ctrl+n", - "command": "workbench.action.files.newUntitledFile", - "when": "!suggestWidgetVisible && !inQuickOpen" - }, - { - "key": "ctrl+n", - "command": "-workbench.action.files.newUntitledFile" - }, - { - "key": "ctrl+n", - "command": "selectNextSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" - }, - { - "key": "ctrl+p", - "command": "selectPrevSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" - }, - { - "key": "ctrl+f", - "command": "acceptSelectedSuggestion", - "when": "suggestWidgetVisible && textInputFocus && !inlineSuggestionVisible" - }, - { - "key": "alt+f", - "command": "editor.action.inlineSuggest.commit", - "when": "inlineSuggestionVisible && textInputFocus" - }, - { - "key": "ctrl+f", - "command": "editor.action.inlineSuggest.acceptNextWord", - "when": "inlineSuggestionVisible && textInputFocus" - }, - { - "key": "ctrl+b", - "command": "hideSuggestWidget", - "when": "suggestWidgetVisible && textInputFocus" - }, - { - "key": "ctrl+b", - "command": "editor.action.inlineSuggest.hide", - "when": "inlineSuggestionVisible && textInputFocus" - }, - // #endregion - // #region Terminal Control, use ^a as prefix / leader key - // tmux-like terminal control - { // prefix + x : kill terminal - "key": "ctrl+a space", - "command": "vspacecode.space", - "when": "terminalFocus" - }, - { // prefix + x : kill terminal - "key": "ctrl+a x", - "command": "workbench.action.terminal.kill", - "when": "terminalFocus" - }, - { // prefix + c : create new terminal - "key": "ctrl+a c", - "command": "workbench.action.terminal.new", - "when": "terminalFocus" - }, - { // prefix + | : split terminal vertically - "key": "ctrl+a shift+\\", - "command": "workbench.action.terminal.split", - "when": "terminalFocus" - }, - { // prefix + \ : split terminal vertically - "key": "ctrl+a \\", - "command": "workbench.action.terminal.split", - "when": "terminalFocus" - }, - { // prefix + / : search - "key": "ctrl+a /", - "command": "workbench.action.terminal.focusFind", - "when": "terminalFocus" - }, - { // prefix + t : toggle terminal - "key": "ctrl+a t", - "command": "workbench.action.terminal.toggleTerminal", - "when": "terminalFocus" - }, - { // prefix + ^a: show information - "key": "ctrl+a ctrl+a", - "command": "workbench.action.terminal.focusHover", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" - }, - { - "key": "ctrl+k ctrl+i", - "command": "-workbench.action.terminal.focusHover", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" - }, - { // prefix + 1 : focus terminal 1 - "key": "ctrl+a 1", - "command": "workbench.action.terminal.focusAtIndex1", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" - }, - { // prefix + 2 : focus terminal 2 - "key": "ctrl+a 2", - "command": "workbench.action.terminal.focusAtIndex2", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" - }, - { // prefix + 3 : focus terminal 3 - "key": "ctrl+a 3", - "command": "workbench.action.terminal.focusAtIndex3", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" - }, - { // prefix + g : Go to recent directory - "key": "ctrl+a g", - "command": "workbench.action.terminal.goToRecentDirectory", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" - }, - { - "key": "ctrl+g", - "command": "-workbench.action.terminal.goToRecentDirectory", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" - }, - { // prefix + d : detach terminal - "key": "ctrl+a d", - "command": "workbench.action.terminal.detachSession", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" - }, - { // prefix + a : attach to session - "key": "ctrl+a a", - "command": "workbench.action.terminal.attachToSession", - "when": "terminalFocus" - }, - { - "key": "ctrl+a h", - "command": "workbench.action.terminal.focusPreviousPane", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" - }, - { - "key": "ctrl+a i", - "command": "workbench.action.terminal.focusNextPane", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" - }, - { - "key": "ctrl+a shift+H", - "command": "workbench.action.terminal.resizePaneLeft", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" - }, - { - "key": "ctrl+a shift+N", - "command": "workbench.action.terminal.resizePaneDown", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" - }, - { - "key": "ctrl+a shift+E", - "command": "workbench.action.terminal.resizePaneUp", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" - }, - { - "key": "ctrl+a shift+I", - "command": "workbench.action.terminal.resizePaneRight", - "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" - }, - // #endregion - // #region Misc - { - "key": "ctrl+p", - "command": "workbench.action.files.openFileFolder", - "when": "isMacNative && openFolderWorkspaceSupport" - }, - { - "key": "ctrl+o", - "command": "-workbench.action.files.openFileFolder", - "when": "isMacNative && openFolderWorkspaceSupport" - }, - { - "key": "ctrl+p", - "command": "-extension.vim_ctrl+p", - "when": "editorTextFocus && vim.active && vim.use && !inDebugRepl || vim.active && vim.use && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use && !inDebugRepl && vim.mode == 'SearchInProgressMode'" - }, - { - "key": "ctrl+o", - "command": "-workbench.action.files.openFolderViaWorkspace", - "when": "!openFolderWorkspaceSupport && workbenchState == 'workspace'" - }, - { - "key": "f9", - "command": "csdevkit.debug.noDebugFileLaunch" - }, - { - "key": "ctrl+h", - "command": "-editor.action.startFindReplaceAction", - "when": "editorFocus || editorIsOpen" - }, - { - "key": "ctrl+h", - "command": "-extension.vim_ctrl+h", - "when": "editorTextFocus && vim.active && vim.use && !inDebugRepl" - }, - { - "key": "ctrl+r", - "command": "-workbench.action.reloadWindow", - "when": "isDevelopment" - }, - { - "key": "ctrl+alt+r", - "command": "-workbench.action.terminal.runRecentCommand", - "when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled" - }, - { - "key": "ctrl+r", - "command": "-workbench.action.terminal.runRecentCommand", - "when": "accessibilityModeEnabled && terminalFocus && terminalHasBeenCreated || accessibilityModeEnabled && terminalFocus && terminalProcessSupported || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'" - }, - { - "key": "ctrl+shift+r", - "command": "-rerunSearchEditorSearch", - "when": "inSearchEditor" - }, - { - "key": "ctrl+shift+r", - "command": "-editor.action.refactor", - "when": "editorHasCodeActionsProvider && textInputFocus && !editorReadonly" - }, - { - "key": "ctrl+shift+r", - "command": "workbench.action.quickOpenNavigatePreviousInRecentFilesPicker", - "when": "inQuickOpen && inRecentFilesPicker" - }, - { - "key": "ctrl+shift+l", - "command": "cursorLineStart", - "when": "textInputFocus" - }, - { - "key": "space", - "command": "vspacecode.space", - "when": "activeEditorGroupEmpty && focusedView == '' && !whichkeyActive && !inputFocus" - }, - { - "key": "space", - "command": "vspacecode.space", - "when": "sideBarFocus && !inputFocus && !whichkeyActive" - }, - { - "key": "tab", - "command": "extension.vim_tab", - "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert' && editorLangId != 'magit'" - }, - { - "key": "tab", - "command": "-extension.vim_tab", - "when": "editorTextFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'" - }, - { - "key": "x", - "command": "magit.discard-at-point", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" - }, - { - "key": "k", - "command": "-magit.discard-at-point" - }, - { - "key": "-", - "command": "magit.reverse-at-point", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" - }, - { - "key": "v", - "command": "-magit.reverse-at-point" - }, - { - "key": "shift+-", - "command": "magit.reverting", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" - }, - { - "key": "shift+v", - "command": "-magit.reverting" - }, - { - "key": "shift+o", - "command": "magit.resetting", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" - }, - { - "key": "shift+x", - "command": "-magit.resetting" - }, - { - "key": "x", - "command": "-magit.reset-mixed" - }, - { - "key": "ctrl+u x", - "command": "-magit.reset-hard" - }, - { - "key": "y", - "command": "-magit.show-refs" - }, - { - "key": "y", - "command": "vspacecode.showMagitRefMenu", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode == 'Normal'" - }, - { - "key": "g", - "command": "-magit.refresh", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" - }, - { - "key": "g", - "command": "vspacecode.showMagitRefreshMenu", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" - }, - { - "key": "ctrl+j", - "command": "workbench.action.quickOpenSelectNext", - "when": "inQuickOpen" - }, - { - "key": "ctrl+k", - "command": "workbench.action.quickOpenSelectPrevious", - "when": "inQuickOpen" - }, - { - "key": "ctrl+j", - "command": "selectNextSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" - }, - { - "key": "ctrl+k", - "command": "selectPrevSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" - }, - { - "key": "ctrl+l", - "command": "acceptSelectedSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" - }, - { - "key": "ctrl+j", - "command": "showNextParameterHint", - "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" - }, - { - "key": "ctrl+k", - "command": "showPrevParameterHint", - "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" - }, - { - "key": "ctrl+j", - "command": "selectNextCodeAction", - "when": "codeActionMenuVisible" - }, - { - "key": "ctrl+k", - "command": "selectPrevCodeAction", - "when": "codeActionMenuVisible" - }, - { - "key": "ctrl+l", - "command": "acceptSelectedCodeAction", - "when": "codeActionMenuVisible" - }, - { - "key": "ctrl+h", - "command": "file-browser.stepOut", - "when": "inFileBrowser" - }, - { - "key": "ctrl+l", - "command": "file-browser.stepIn", - "when": "inFileBrowser" - }, - { - "key": "ctrl+oem_4", - "command": "whichkey.undoKey", - "when": "whichkeyVisible" - }, - { - "key": "alt+e", - "command": "editor.action.insertCursorAbove", - "when": "editorTextFocus" - }, - { - "key": "ctrl+alt+up", - "command": "-editor.action.insertCursorAbove", - "when": "editorTextFocus" - }, - { - "key": "alt+n", - "command": "editor.action.insertCursorBelow", - "when": "editorTextFocus" - }, - { - "key": "ctrl+alt+down", - "command": "-editor.action.insertCursorBelow", - "when": "editorTextFocus" - }, - // #endregion - // #region Ctrl+W Remaps (Vim-like) - { - "key": "ctrl+w h", - "command": "workbench.action.navigateLeft" - }, - { - "key": "ctrl+w ctrl+h", - "command": "workbench.action.toggleSidebarVisibility" - }, - { - "key": "ctrl+w i", - "command": "workbench.action.navigateRight" - }, - { - "key": "ctrl+w ctrl+i", - "command": "workbench.action.toggleAuxiliaryBar" - }, - { - "key": "ctrl+w n", - "command": "workbench.action.navigateDown" - }, - { - "key": "ctrl+w ctrl+n", - "command": "workbench.action.togglePanel" - }, - { - "key": "ctrl+w e", - "command": "workbench.action.navigateUp" - }, - { // original ^w - "key": "ctrl+w ctrl+w", - "command": "workbench.action.closeActiveEditor", - "when": "editorFocus || inSettingsEditor || inKeybindings || inWelcome" - }, - { // :only - "key": "ctrl+w o", - "command": "runCommands", - "args": { - "commands": [ - "workbench.action.joinAllGroups", - "workbench.action.maximizeEditorHideSidebar" - ] - } - }, - { - "key": "ctrl+w ctrl+w", - "command": "workbench.action.closeGroup", - "when": "activeEditorGroupEmpty && multipleEditorGroups" - }, - { - "key": "ctrl+w", - "command": "-workbench.action.closeGroup", - "when": "activeEditorGroupEmpty && multipleEditorGroups" - }, - // #endregion - // #region Emacs like Cursor Movement - { - "key": "ctrl+f", - "command": "cursorRight", - "when": "textInputFocus && !inlineEditIsVisible && !suggestWidgetVisible && !inlineSuggestionVisible" - }, - { - "key": "ctrl+b", - "command": "cursorLeft", - "when": "textInputFocus && !inlineEditIsVisible && !suggestWidgetVisible && !inlineSuggestionVisible" - }, - { - "key": "ctrl+n", - "command": "cursorDown", - "when": "textInputFocus && !suggestWidgetVisible && !inQuickOpen" - }, - { - "key": "ctrl+p", - "command": "cursorUp", - "when": "textInputFocus && !suggestWidgetVisible && !inQuickOpen" - }, - { - "key": "ctrl+a", - "command": "cursorHome", - "when": "textInputFocus" - }, - { - "key": "ctrl+shift+a", - "command": "cursorEnd", - "when": "editor.action.selectAll" - }, - { - "key": "ctrl+k ctrl+a", - "command": "editor.action.selectAll" - }, - { - "key": "ctrl+e", - "command": "cursorEnd", - "when": "textInputFocus" - }, - { - "key": "alt+b", - "command": "cursorWordStartLeft", - "when": "textInputFocus" - }, - { - "key": "alt+f", - "command": "cursorWordStartRight", - "when": "textInputFocus && !inlineEditIsVisible && !suggestWidgetVisible && !inlineSuggestionVisible" - }, - // #endregion - { - "key": "alt+q", - "command": "vspacecode.space" - }, - // #region Search View - { // Focus on search list, therefore can use n/e to move up/down - "key": "escape", - "command": "search.action.focusSearchList", - "when": "searchViewletFocus && inputBoxFocus" - }, - { // Focus on main input box - "key": "l", - "command": "workbench.action.replaceInFiles", - "when": "searchViewletFocus && !inputBoxFocus" - }, - { - "key": "r", - "command": "toggleSearchRegex", - "when": "searchViewletFocus && !inputBoxFocus" - }, - { - "key": "w", - "command": "toggleSearchWholeWord", - "when": "searchViewletFocus && !inputBoxFocus" - }, - { - "key": "c", - "command": "toggleSearchCaseSensitive", - "when": "searchViewletFocus && !inputBoxFocus" - }, - { - "key": "p", - "command": "toggleSearchPreserveCase", - "when": "searchViewletFocus && !inputBoxFocus" - }, - { - "key": "i", - "command": "search.action.focusFilesToInclude", - "when": "searchViewletFocus && !inputBoxFocus" - }, - { - "key": "shift+e", - "command": "search.action.focusFilesToExclude", - "when": "searchViewletFocus && !inputBoxFocus" - } - // #endregion -] \ No newline at end of file diff --git a/tools/wezterm/misc.lua b/tools/wezterm/misc.lua index a70a2d2..3f5cb0a 100644 --- a/tools/wezterm/misc.lua +++ b/tools/wezterm/misc.lua @@ -4,4 +4,5 @@ return function(config) TERM = "xterm-256color", TERM_PROGRAM = "wezterm", } + config.enable_wayland = false end diff --git a/tools/wezterm/tab.lua b/tools/wezterm/tab.lua index 2a1e8a3..ef14713 100644 --- a/tools/wezterm/tab.lua +++ b/tools/wezterm/tab.lua @@ -10,8 +10,8 @@ tabline.setup({ tabs_enabled = true, theme_overrides = { tab = { - inactive = { bg = color.base, fg = color.text }, - active = { fg = color.lavender, bg = color.surface0 }, + inactive = { bg = color.crust , fg = color.text }, + active = { fg = color.lavender, bg = color.base }, inactive_hover = { fg = color.pink, bg = color.surface0 }, }, normal_mode = {