From 02bbb24cacac4590a5ce5a6514adf8ac4288e96e Mon Sep 17 00:00:00 2001 From: js0ny Date: Sat, 27 Sep 2025 02:02:29 +0100 Subject: [PATCH] feat(vscode): qwerty --- common/vimrc+qwerty.vimrc | 32 +++--- tools/fish/config.fish | 15 --- tools/vscode/keybindings-windows-linux.jsonc | 108 +++++++++++++++++-- 3 files changed, 113 insertions(+), 42 deletions(-) diff --git a/common/vimrc+qwerty.vimrc b/common/vimrc+qwerty.vimrc index 2c7a6a2..f9fc1f3 100644 --- a/common/vimrc+qwerty.vimrc +++ b/common/vimrc+qwerty.vimrc @@ -37,22 +37,22 @@ set showcmd set statusline=%<%f\ %h%m%r\ %=\ [%l,%v]\ [%p%%]\ [\ %Y]\ [󱑉\ %{strftime('%H:%M:%S')}] -" XDG Directory Specifications -" Reference to https://jorenar.com/blog/vim-xdg - -if empty($XDG_CACHE_HOME) | let $XDG_CACHE_HOME = $HOME."/.cache" | endif -if empty($XDG_CONFIG_HOME) | let $XDG_CONFIG_HOME = $HOME."/.config" | endif -if empty($XDG_DATA_HOME) | let $XDG_DATA_HOME = $HOME."/.local/share" | endif -if empty($XDG_STATE_HOME) | let $XDG_STATE_HOME = $HOME."/.local/state" | endif - -set viminfo+=n$XDG_STATE_HOME/vim/viminfo -set packpath^=$XDG_DATA_HOME/vim -set packpath+=$XDG_DATA_HOME/vim/after -set backupdir=$XDG_STATE_HOME/vim/backup -set directory=$XDG_STATE_HOME/vim/swap -set undodir=$XDG_STATE_HOME/vim/undo -set viewdir=$XDG_STATE_HOME/vim/view -" set shada+=n$XDG_STATE_HOME/vim/shada +"" XDG Directory Specifications +"" Reference to https://jorenar.com/blog/vim-xdg +" +"if empty($XDG_CACHE_HOME) | let $XDG_CACHE_HOME = $HOME."/.cache" | endif +"if empty($XDG_CONFIG_HOME) | let $XDG_CONFIG_HOME = $HOME."/.config" | endif +"if empty($XDG_DATA_HOME) | let $XDG_DATA_HOME = $HOME."/.local/share" | endif +"if empty($XDG_STATE_HOME) | let $XDG_STATE_HOME = $HOME."/.local/state" | endif +" +"set viminfo+=n$XDG_STATE_HOME/vim/viminfo +"set packpath^=$XDG_DATA_HOME/vim +"set packpath+=$XDG_DATA_HOME/vim/after +"set backupdir=$XDG_STATE_HOME/vim/backup +"set directory=$XDG_STATE_HOME/vim/swap +"set undodir=$XDG_STATE_HOME/vim/undo +"set viewdir=$XDG_STATE_HOME/vim/view +"" set shada+=n$XDG_STATE_HOME/vim/shada " Leader let mapleader = "\" nnoremap :FZF diff --git a/tools/fish/config.fish b/tools/fish/config.fish index db1fb7f..1e6a82c 100644 --- a/tools/fish/config.fish +++ b/tools/fish/config.fish @@ -20,18 +20,3 @@ set --export PATH $BUN_INSTALL/bin $PATH # moonbit fish_add_path "$HOME/.moon/bin" - - -# >>> conda initialize >>> -# !! Contents within this block are managed by 'conda init' !! -if test -f /home/js0ny/.local/anaconda3/bin/conda - eval /home/js0ny/.local/anaconda3/bin/conda "shell.fish" "hook" $argv | source -else - if test -f "/home/js0ny/.local/anaconda3/etc/fish/conf.d/conda.fish" - . "/home/js0ny/.local/anaconda3/etc/fish/conf.d/conda.fish" - else - set -x PATH "/home/js0ny/.local/anaconda3/bin" $PATH - end -end -# <<< conda initialize <<< - diff --git a/tools/vscode/keybindings-windows-linux.jsonc b/tools/vscode/keybindings-windows-linux.jsonc index 34cf5d5..dc489f7 100644 --- a/tools/vscode/keybindings-windows-linux.jsonc +++ b/tools/vscode/keybindings-windows-linux.jsonc @@ -1,9 +1,10 @@ -// Place your key bindings in this file to override the defaultsauto[] +// Place your key bindings in this file to override the defaults [ - // #region quickOpen (Telescope) + // #region Panel { "key": "ctrl+p", - "command": "workbench.action.quickOpen" + "command": "workbench.action.quickOpen", + "when": "!terminalFocus" }, { "key": "ctrl+p", @@ -117,6 +118,11 @@ "command": "-list.select", "when": "listFocus && !inputFocus" }, + { // ctrl-w enter: open in vertical split / to side + "key": "ctrl+w enter", + "command": "explorer.openToSide", + "when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, { // z: Close all folders "key": "z", "command": "workbench.files.action.collapseExplorerFolders", @@ -382,7 +388,7 @@ "when": "terminalFocus" }, { // prefix + ^a: show information - "key": "ctrl+a ctrl+a", + "key": "ctrl+a a", "command": "workbench.action.terminal.focusHover", "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalIsOpen || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus" }, @@ -458,6 +464,21 @@ }, // #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", @@ -660,7 +681,6 @@ "command": "whichkey.undoKey", "when": "whichkeyVisible" }, - // #region multicursor { "key": "alt+e", "command": "editor.action.insertCursorAbove", @@ -682,7 +702,6 @@ "when": "editorTextFocus" }, // #endregion - // #endregion // #region Ctrl+W Remaps (Vim-like) { "key": "ctrl+w h", @@ -693,23 +712,23 @@ "command": "workbench.action.toggleSidebarVisibility" }, { - "key": "ctrl+w i", + "key": "ctrl+w l", "command": "workbench.action.navigateRight" }, { - "key": "ctrl+w ctrl+i", + "key": "ctrl+w ctrl+l", "command": "workbench.action.toggleAuxiliaryBar" }, { - "key": "ctrl+w n", + "key": "ctrl+w j", "command": "workbench.action.navigateDown" }, { - "key": "ctrl+w ctrl+n", + "key": "ctrl+w ctrl+j", "command": "workbench.action.togglePanel" }, { - "key": "ctrl+w e", + "key": "ctrl+w k", "command": "workbench.action.navigateUp" }, { // original ^w @@ -727,6 +746,16 @@ ] } }, + { // :only + "key": "ctrl+w ctrl+o", + "command": "runCommands", + "args": { + "commands": [ + "workbench.action.joinAllGroups", + "workbench.action.maximizeEditorHideSidebar" + ] + } + }, { "key": "ctrl+w ctrl+w", "command": "workbench.action.closeGroup", @@ -737,6 +766,10 @@ "command": "-workbench.action.closeGroup", "when": "activeEditorGroupEmpty && multipleEditorGroups" }, + { + "key": "ctrl+w d", + "command": "editor.action.revealDefinitionAside" + }, // #endregion // #region Emacs like Cursor Movement { @@ -789,6 +822,10 @@ "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", @@ -830,5 +867,54 @@ "command": "search.action.focusFilesToExclude", "when": "searchViewletFocus && !inputBoxFocus" }, + { + "key": "shift+alt+3", + "command": "editor.action.commentLine", + "when": "editorTextFocus && !editorReadonly" + }, + { + "key": "ctrl+/", + "command": "-editor.action.commentLine", + "when": "editorTextFocus && !editorReadonly" + }, // #endregion + //#region Debugger + { + "key": "c", + "command": "workbench.action.debug.continue", + "when": "inDebugMode && debugState == 'stopped' && vim.mode == 'Normal' && editorFocus" + }, + { + "key": "t", + "command": "workbench.action.debug.stepInto", + "when": "inDebugMode && debugState == 'stopped' && vim.mode == 'Normal' && editorFocus" + }, + { + "key": "s", + "command": "workbench.action.debug.stepOver", + "when": "inDebugMode && debugState == 'stopped' && vim.mode == 'Normal' && editorFocus" + }, + { + "key": "r", + "command": "workbench.action.debug.restart", + "when": "inDebugMode && debugState == 'stopped' && vim.mode == 'Normal' && editorFocus" + }, + { + "key": "g c", + "command": "editor.debug.action.runToCursor", + "when": "inDebugMode && debugState == 'stopped' && vim.mode == 'Normal' && editorFocus" + }, + { + "key": "g h", + "command": "editor.debug.action.showDebugHover", + "when": "inDebugMode && debugState == 'stopped' && vim.mode == 'Normal' && editorFocus" + }, + { + "key": "ctrl+w f", + "command": "search.action.openNewEditorToSide" + }, + { + "key": "ctrl+k ctrl+shift+c", + "command": "vspacecode.copyFilenameBase" + } ] \ No newline at end of file