Merge branch 'master' into reorg

This commit is contained in:
js0ny 2024-12-01 07:41:57 +00:00
commit f30ba8a02e
24 changed files with 1002 additions and 45 deletions

View file

@ -20,3 +20,8 @@ indent_size = 2
[*.{json,toml,js,lua,yaml,yml}]
indent_size = 2
indent_style = space
[*.{bat}]
# Empty ruleset to skip global settings
# charset = gbk # Not available
# end_of_line = crlf

6
.gitattributes vendored
View file

@ -2,3 +2,9 @@
# Date: 2024-11-30
# Author: contact@js0ny.net
skhdrc linguist-language=Shell
yabairc linguist-language=Shell
sketchybarrc linguist-language=Shell
*.vimrc linguist-language=VimL
vsvimrc linguist-language=VimL
vimrc linguist-language=VimL
ideavimrc linguist-language=VimL

2
.gitignore vendored
View file

@ -40,3 +40,5 @@ tools/nushell/
.DS_Store
.venv/
platforms/win/komorebi/applications.json

View file

@ -1,6 +1,7 @@
{
"material-icon-theme.files.associations": {
"ideavimrc": "vim",
"vsvimrc": "vim",
"vimrc": "vim",
"haskeline": "haskell",
"inputrc": "console",

View file

@ -82,7 +82,8 @@ New-Item -ItemType Directory -Path "$Env:AppData\less" -Force
New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\node" -Force
[System.Environment]::SetEnvironmentVariable("NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\repl_history", "User")
# ~\.ts_node_repl_history -> %LocalAppData%\state\node\ts_node_repl_history :: Node.js
[System.Environment]::SetEnvironmentVariable("TS_NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\ts_node_repl_history", "User")
# NOTE: ts-node doesn't support this yet
# [System.Environment]::SetEnvironmentVariable("TS_NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\ts_node_repl_history", "User")
# ~\.nuget\packages -> %LocalAppData%\cache\NuGet\packages :: NuGet
[System.Environment]::SetEnvironmentVariable("NUGET_PACKAGES", "$Env:XDG_CACHE_HOME\NuGet\packages", "User")
# ~\.omnisharp -> %AppData%\OmniSharp :: OmniSharp
@ -96,6 +97,7 @@ New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\python" -Force
# ~\.vimrc -> %AppData%\Vim\_vimrc :: Vim
New-Item -ItemType Directory -Path "$Env:AppData\Vim" -Force
[System.Environment]::SetEnvironmentVariable("VIM", "$Env:AppData\Vim", "User")
[System.Environment]::SetEnvironmentVariable("KOMOREBI_CONFIG_HOME", "$Env:AppData\komorebi", "User")
# ~\.vuerc -> %AppData%\vue\.vuerc :: Vue CLI
# Currently, Vue CLI doesn't support file path configuration:https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli/lib/confifile
# [System.Environment]::SetEnvironmentVariable("VUE_CLI_CONFIG_PATH", "$Env:AppData\vue\.vuerc", "User")

View file

@ -9,21 +9,23 @@ $BASE_COMMON = Join-Path $DOTFILES "common"
$BASE_TOOLS = Join-Path $DOTFILES "tools"
$BASE_WIN = Join-Path $DOTFILES "platforms" "win"
$linkDots = @{
"$BASE_WIN\wslconfig" = "$env:UserProfile\.wslconfig"
"$BASE_WIN\neovide.toml" = "$Env:AppData\neovide\config.toml"
"$BASE_COMMON\condarc.yaml" = "$env:XDG_CONFIG_HOME\conda\.condarc"
"$BASE_COMMON\gitconfig" = "$env:UserProfile\.gitconfig"
"$BASE_COMMON\glow.yaml" = "$env:AppData\glow\glow.yml"
"$BASE_COMMON\haskeline" = "$env:UserProfile\.haskeline"
"$BASE_COMMON\ideavimrc" = "$env:XDG_CONFIG_HOME\ideavim\ideavimrc"
"$BASE_COMMON\lesskey" = "$env:LessKeyIn"
"$BASE_COMMON\npmrc" = "$env:NPM_CONFIG_USERCONFIG"
"$BASE_COMMON\NuGet.Config" = "$env:AppData\NuGet\NuGet.Config"
"$BASE_COMMON\obsidian.vimrc" = "$env:UserProfile\Obsidian\.obsidian.vimrc"
"$BASE_COMMON\pip.conf" = "$env:AppData\pip\pip.ini"
"$BASE_COMMON\vimrc" = "$env:Vim\_vimrc"
"$BASE_TOOLS\ipython" = "$env:IPYTHONDIR"
"$BASE_TOOLS\nvim" = "$env:XDG_CONFIG_HOME\nvim"
"$BASE_WIN\wslconfig" = "$env:UserProfile\.wslconfig"
"$BASE_WIN\neovide.toml" = "$Env:AppData\neovide\config.toml"
"$BASE_WIN\vsvimrc" = "$Env:Vim\.vsvimrc"
"$BASE_WIN\komorebi" = "$env:KOMOREBI_CONFIG_HOME"
"$BASE_COMMON\condarc.yaml" = "$env:XDG_CONFIG_HOME\conda\.condarc"
"$BASE_COMMON\gitconfig" = "$env:UserProfile\.gitconfig"
"$BASE_COMMON\glow.yaml" = "$env:AppData\glow\glow.yml"
"$BASE_COMMON\haskeline" = "$env:UserProfile\.haskeline"
"$BASE_COMMON\ideavimrc" = "$env:XDG_CONFIG_HOME\ideavim\ideavimrc"
"$BASE_COMMON\lesskey" = "$env:LessKeyIn"
"$BASE_COMMON\npmrc" = "$env:NPM_CONFIG_USERCONFIG"
"$BASE_COMMON\NuGet.Config" = "$env:AppData\NuGet\NuGet.Config"
"$BASE_COMMON\obsidian.vimrc" = "$env:UserProfile\Obsidian\.obsidian.vimrc"
"$BASE_COMMON\pip.conf" = "$env:AppData\pip\pip.ini"
"$BASE_COMMON\vim.noxdg.vimrc" = "$env:Vim\_vimrc"
"$BASE_TOOLS\ipython" = "$env:IPYTHONDIR"
"$BASE_TOOLS\nvim" = "$env:XDG_CONFIG_HOME\nvim"
}
# TODO: Auto create directories

View file

@ -8,6 +8,7 @@
[core]
editor = nvim
pager = delta
autocrlf = input
[interactive]
diffFilter = delta --color-only
[delta]

View file

@ -5,9 +5,8 @@
let mapleader = " " " set <leader> to <space>
""" Colemak """
" Word wrap
noremap n gj
noremap e gk
noremap n j
noremap e k
noremap i l
" Similar position to i

View file

@ -0,0 +1,33 @@
#Requires AutoHotkey v2.0
; #b::
; Run '"C:\Program Files\Zotero\zotero.exe"'
; return
; #f::
; Run '"C:\Program Files\GPSoftware\Directory Opus\dopus.exe"'
; return
; #q::
; Send '!{F4}'
; return
; #r::
; Run '"C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.21.3231.0_x64__8wekyb3d8bbwe\wt.exe"'
; return
#h::
Send '{Left}'
return
#n::
Send '{Down}'
return
#e::
Send '{Up}'
return
#i::
Send '{Right}'
return

View file

@ -0,0 +1,13 @@
@REM Not working
@REM encoding: GBK
@echo off
set regPath="HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"
for /f "usebackq tokens=2*" %%a in (`reg query %regPath% /v AppsUseLightTheme ^| find "REG_DWORD"`) do set currentMode=%%b
if "%currentMode%"=="0x1" (
reg add %regPath% /v AppsUseLightTheme /t REG_DWORD /d 0 /f >nul
echo <20><><EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD>ɫģʽ
) else (
reg add %regPath% /v AppsUseLightTheme /t REG_DWORD /d 1 /f >nul
echo <20><><EFBFBD>л<EFBFBD><D0BB><EFBFBD>dzɫģʽ
)

View file

@ -0,0 +1,72 @@
; Use %KOMOREBI_CONFIG_HOME% Environment Variable to set the path to the config file
#Requires AutoHotkey v2.0.2
#SingleInstance Force
Komorebic(cmd) {
RunWait(format("komorebic.exe {}", cmd), , "Hide")
}
!q:: Komorebic("close")
!m:: Komorebic("minimize")
; Focus windows
#+h:: Komorebic("focus left")
#+n:: Komorebic("focus down")
#+e:: Komorebic("focus up")
#+i:: Komorebic("focus right")
!+[:: Komorebic("cycle-focus previous")
!+]:: Komorebic("cycle-focus next")
; Move windows
!+h:: Komorebic("move left")
!+j:: Komorebic("move down")
!+k:: Komorebic("move up")
!+l:: Komorebic("move right")
; Stack windows
!Left:: Komorebic("stack left")
!Down:: Komorebic("stack down")
!Up:: Komorebic("stack up")
!Right:: Komorebic("stack right")
!;:: Komorebic("unstack")
![:: Komorebic("cycle-stack previous")
!]:: Komorebic("cycle-stack next")
; Resize
!=:: Komorebic("resize-axis horizontal increase")
!-:: Komorebic("resize-axis horizontal decrease")
!+=:: Komorebic("resize-axis vertical increase")
!+_:: Komorebic("resize-axis vertical decrease")
; Manipulate windows
!t:: Komorebic("toggle-float")
!f:: Komorebic("toggle-monocle")
; Window manager options
!+r:: Komorebic("retile")
!p:: Komorebic("toggle-pause")
; Layouts
!x:: Komorebic("flip-layout horizontal")
!y:: Komorebic("flip-layout vertical")
; Workspaces
!1:: Komorebic("focus-workspace 0")
!2:: Komorebic("focus-workspace 1")
!3:: Komorebic("focus-workspace 2")
!4:: Komorebic("focus-workspace 3")
!5:: Komorebic("focus-workspace 4")
!6:: Komorebic("focus-workspace 5")
!7:: Komorebic("focus-workspace 6")
!8:: Komorebic("focus-workspace 7")
; Move windows across workspaces
!+1:: Komorebic("move-to-workspace 0")
!+2:: Komorebic("move-to-workspace 1")
!+3:: Komorebic("move-to-workspace 2")
!+4:: Komorebic("move-to-workspace 3")
!+5:: Komorebic("move-to-workspace 4")
!+6:: Komorebic("move-to-workspace 5")
!+7:: Komorebic("move-to-workspace 6")
!+8:: Komorebic("move-to-workspace 7")

View file

@ -0,0 +1,76 @@
{
"$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.30/schema.bar.json",
"monitor": {
"index": 0,
"work_area_offset": {
"left": 0,
"top": 40,
"right": 0,
"bottom": 40
}
},
"font_family": "JetBrains Mono",
"theme": {
"palette": "Base16",
"name": "Ashes",
"accent": "Base0D"
},
"left_widgets": [
{
"Komorebi": {
"workspaces": {
"enable": true,
"hide_empty_workspaces": false
},
"layout": {
"enable": true
},
"focused_window": {
"enable": true,
"show_icon": true
}
}
}
],
"right_widgets": [
{
"Media": {
"enable": true
}
},
{
"Storage": {
"enable": true
}
},
{
"Memory": {
"enable": true
}
},
{
"Network": {
"enable": true,
"show_total_data_transmitted": true,
"show_network_activity": true
}
},
{
"Date": {
"enable": true,
"format": "DayDateMonthYear"
}
},
{
"Time": {
"enable": true,
"format": "TwentyFourHour"
}
},
{
"Battery": {
"enable": true
}
}
]
}

View file

@ -0,0 +1,58 @@
{
"$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.30/schema.json",
"app_specific_configuration_path": "$Env:USERPROFILE/applications.json",
"window_hiding_behaviour": "Cloak",
"cross_monitor_move_behaviour": "Insert",
"default_workspace_padding": 20,
"default_container_padding": 20,
"border": true,
"border_width": 8,
"border_offset": -1,
"theme": {
"palette": "Base16",
"name": "Ashes",
"unfocused_border": "Base03",
"bar_accent": "Base0D"
},
"stackbar": {
"height": 40,
"mode": "OnStack",
"tabs": {
"width": 300
}
},
"monitors": [
{
"workspaces": [
{
"name": "I",
"layout": "BSP"
},
{
"name": "II",
"layout": "VerticalStack"
},
{
"name": "III",
"layout": "HorizontalStack"
},
{
"name": "IV",
"layout": "UltrawideVerticalStack"
},
{
"name": "V",
"layout": "Rows"
},
{
"name": "VI",
"layout": "Grid"
},
{
"name": "VII",
"layout": "RightMainVerticalStack"
}
]
}
]
}

View file

@ -11,5 +11,5 @@ vsync = false
wsl = true
[font]
normal = ["CaskaydiaCove Nerd Font"] # Will use the bundled Fira Code Nerd Font by default
normal = ["CaskaydiaCove Nerd Font", "霞鹜文楷等宽"] # Will use the bundled Fira Code Nerd Font by default
size = 14.0

41
platforms/win/vsvimrc Normal file
View file

@ -0,0 +1,41 @@
" This is the `vimrc` config for VSVim (Visual Studio Vim Emulator)
" Put it in %Vim%\.vsvimrc
" Colemak Keys
" Arrow remap
noremap n j
noremap e k
noremap i l
noremap H 0
noremap N 5j
noremap E 5k
noremap I $
" Similar position to i
noremap l i
noremap L I
" ne[k]st
noremap k n
noremap K N
" [j]ump
noremap j e
noremap J E
" Normal minimal setup
noremap Y y$
set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent
set wrap
set scrolloff=3
set hlsearch
set incsearch
set ignorecase
set smartcase
set number
set relativenumber

View file

@ -1,5 +1,3 @@
# .dotfiles
Moving to *Colemak*
This branch is WIP.
Moving to _Colemak_

62
tools/fastfetch/win.jsonc Normal file
View file

@ -0,0 +1,62 @@
// ~\.config\fastfetch\config.jsonc
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
// "type": "auto",
"source": "Windows 7",
"padding": {
"top": 2,
"left": 1,
"right": 2
}
},
"general": {
"multithreading": true
},
"display": {
"separator": " ",
"key": {
"width": 10,
"paddingLeft": 2,
"type": "icon"
}
},
"modules": [
{
"type": "title",
"format": "{#1}───────────── {#}{user-name-colored}@{host-name-colored}"
},
{
"type": "colors",
"symbol": "diamond",
"paddingLeft": 15
},
"os",
"host",
"kernel",
"uptime",
{
"type": "packages"
},
"shell",
"display",
"de",
"wm",
"wmtheme",
"theme",
"icons",
"font",
"cursor",
"terminal",
"terminalfont",
"cpu",
"gpu",
"memory",
"swap",
"disk",
"localip",
"battery",
"poweradapter",
"locale"
]
}

View file

@ -4,4 +4,4 @@
${function:wget} = {wget --hsts-file $XDG_CACHE_HOME/wget-hsts $args}
# yarn v1
${function:yarn} = {yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config.yaml $args}
${function:yarn} = {yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config.yaml $args}

View file

@ -6,7 +6,7 @@ Set-PSReadLineOption -PredictionSource HistoryAndPlugin
# Set-PSReadLineOption -ContinuationPrompt "`e[36m CR > " # Use Starship instead
# PSReadLineKeyHandlers
## Colemak hnei
Set-PSReadLineKeyHandler -Chord "n" -Function NextHistory -ViMode Command
Set-PSReadLineKeyHandler -Chord "n" -Function NextHistory -ViMode Command
Set-PSReadLineKeyHandler -Chord "e" -Function PreviousHistory -ViMode Command
Set-PSReadLineKeyHandler -Chord "i" -Function ViForwardChar -ViMode Command
## Similar position to [i] in QWERTY
@ -22,4 +22,7 @@ Set-PSReadLineKeyHandler -Chord "J" -Function ViEndOfGlob -ViMode Command
Set-PSReadLineKeyHandler -Chord "N" -Function ViJoinLines -ViMode Command
Set-PSReadLineKeyHandler -Chord "Control+Oem4" -Function ViCommandMode -ViMode Insert # ^[ to Escape
Set-PSReadLineKeyHandler -Chord "Ctrl+a" -Function BeginningOfLine
Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine
Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine
## Use <Tab> to Invoke MenuComplete
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete

View file

@ -6,4 +6,4 @@ if ($IsWindows) {
if (Test-Path($ChocolateyProfile)) { Import-Module "$ChocolateyProfile" }
# WinGet
Import-Module -Name Microsoft.WinGet.CommandNotFound #f45873b3-b655-43a6-b217-97c00aa0db58
}
}

View file

@ -4,9 +4,9 @@ This is the cross-platform PowerShell profile for PowerShell Core
```text
.
├── Aliases.ps1
├── Aliases.ps1
├── Keymap.ps1 # keymaps, optimize for Vi-Mode and Colemak
├── Modules.ps1
├── Modules.ps1
├── Navigation.ps1
├── Prompt.ps1
├── readme.md
@ -15,9 +15,8 @@ This is the cross-platform PowerShell profile for PowerShell Core
1 directory, 7 files
```
| Keymap | Action | Mode |
| --- | --- | --- |
| `^a` | To Beginning of Line | All |
| `^e` | To End of Line | All |
| `^[` | To Normal Mode | Insert |
| Keymap | Action | Mode |
| ------ | -------------------- | ------ |
| `^a` | To Beginning of Line | All |
| `^e` | To End of Line | All |
| `^[` | To Normal Mode | Insert |

View file

@ -1,8 +0,0 @@
# VSCode HyperSnips Snippets
## Navigator
- [C](./c.hsnips)
- [$\LaTeX$](./latex.hsnips)
- [Markdown](./markdown.hsnips)
- [Typst](./typst.hsnips)

View file

@ -0,0 +1,485 @@
// Place your key bindings in this file to override the defaultsauto[]
[
// #region quickOpen (Telescope)
{ // <leader> <space> Telescope emulator
"key": "space space",
"command": "workbench.action.quickOpen",
"when": "!editorFocus && !inputFocus"
},
{
"key": "ctrl+p",
"command": "workbench.action.quickOpen"
},
{
"key": "ctrl+e",
"command": "workbench.action.quickOpenNavigatePrevious",
"when": "inQuickOpen"
},
{
"key": "ctrl+n",
"command": "workbench.action.quickOpenNavigateNext",
"when": "inQuickOpen"
},
{
"key": "ctrl+[",
"command": "workbench.action.closeQuickOpen",
"when": "inQuickOpen"
},
// #endregion
// #region plugin: code runner
{
"key": "ctrl+alt+n",
"command": "-code-runner.run"
},
// #endregion
{
"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"
},
{
"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<C-h> && !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+e",
"command": "cursorEnd",
"when": "textInputFocus"
},
// #region Nvim-Tree like File Explorer
// n, e : move cursor up/down
// h : move cursor to parent folder
// l : open file or folder
{ // z: Close all folders
"key": "z",
"command": "workbench.files.action.collapseExplorerFolders",
"when": "filesExplorerFocus && foldersViewVisible && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{ // <leader>e: Close left sidebar if is in file explorer
"key": "space e",
"command": "workbench.action.toggleSidebarVisibility",
"when": "sideBarFocus && !inputFocus && !searchViewletVisible && filesExplorerFocus"
},
{ // <leader>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"
},
{ // <leader>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
{
"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<C-p> && !inDebugRepl || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use<C-p> && !inDebugRepl && vim.mode == 'SearchInProgressMode'"
},
{
"key": "ctrl+o",
"command": "-workbench.action.files.openFolderViaWorkspace",
"when": "!openFolderWorkspaceSupport && workbenchState == 'workspace'"
},
// #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
{
"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"
},
{
"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"
},
// #region Use ^n ^e 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+e",
"command": "selectPrevSuggestion",
"when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion"
},
// #endregion
// #region Terminal Control, use ^a as prefix / leader key
// tmux-like terminal control
{ // 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"
}
]

View file

@ -9,15 +9,122 @@ noremap n j
noremap e k
noremap i l
" Switch between tabs
noremap H :bprevious<CR>
noremap I :bnext<CR>
noremap N 5j
noremap E 5k
" Similar position to i
noremap l i
noremap L I
" ne[k]st
noremap k n
noremap K N
" [j]ump
" [j]ump
noremap j e
noremap J E
" Y to yank to end of line
noremap Y y$
noremap Y y$
" 分词版本的w和b支持中文需要插件
" Comment if you don't use cjk or the plugin
noremap w cjkWordHandler.cursorWordEndRight
noremap b cjkWordHandler.cursorWordStartLeft
" keep selection after indent (define in settings.json)
" voremap < <gv
" voremap > >gv
" lsp
noremap gi editor.action.goToImplementation
noremap gpi editor.action.peekImplementation
noremap gd editor.action.goToDefinition
noremap gpd editor.action.peekDefinition
noremap gt editor.action.goToTypeDefinition
noremap gpt editor.action.peekTypeDefinition
noremap gh editor.action.showDefinitionPreviewHover
noremap <leader><leader> workbench.action.quickOpen
noremap <leader>: workbench.action.showCommands
" <leader>q : +quit
noremap <leader>qq :quit<CR>
noremap <leader>qQ :qall<CR>
noremap <leader>Q :quit<CR>
" <leader>w : +write/window
noremap <leader>ww :write<CR>
noremap <leader>wa :wall<CR>
noremap <leader>wq :wq<CR>
noremap <leader>W :write<CR>
noremap <leader>wh workbench.action.focusLeftGroup
noremap <leader>wH workbench.action.splitEditorLeft
noremap <leader>wn workbench.action.focusBelowGroup
noremap <leader>wN workbench.action.splitEditorDown
noremap <leader>we workbench.action.focusAboveGroup
noremap <leader>wE workbench.action.splitEditorUp
noremap <leader>wi workbench.action.focusRightGroup
noremap <leader>wI workbench.action.splitEditorRight
" <leader>f : +find/file
noremap <leader>ff workbench.action.quickOpen
noremap <leader>fF workbench.view.search
noremap <leader>fc workbench.action.openSettings
noremap <leader>fC workbench.action.openFolderSettingsFile
noremap <leader>fe workbench.view.explorer
noremap <leader>fr workbench.action.showAllEditorsByMostRecentlyUsed
noremap <leader>fR workbench.action.openRecent
noremap <leader>fs workbench.action.search.toggleQueryDetails
noremap <leader>ft workbench.action.terminal.toggleTerminal
noremap <leader>fx workbench.view.extensions
" <leader>p : +project (requires Project Manager extension)
noremap <leader>pp projectManager.listProjects
noremap <leader>pP projectManager.listAnyProjects#sideBarAny
noremap <leader>pc projectManager.openSettings#sideBarAny
noremap <leader>pe projectManager.editProjects
noremap <leader>pf projectManager.addToFavorites
noremap <leader>pF projectManager.filterProjectsByTag
noremap <leader>pg projectManager.listGitProjects#sideBarGit
noremap <leader>pr workbench.action.openRecent
noremap <leader>ps projectManager.saveProject
" <leader>g : +git
noremap <leader>gg workbench.view.scm
noremap <leader>gS git.stageAll
" <leader>j : +jump
noremap <leader>jj workbench.action.gotoLine
" <leader>l : +language (define in settings.json)
" <leader>u : +ui
noremap <leader>ui workbench.action.selectTheme
noremap <leader>uw editor.action.toggleWordWrap
noremap <leader>uz workbench.action.toggleZenMode
" <leader>a : +ai/action
noremap <leader>aa inlineChat.start
noremap <leader>aA workbench.panel.chat
noremap <leader>ae workbench.action.chat.openEditSession
" <leader>r : +refactor
" <leader>s : +search
" <leader>t : +test
noremap <leader>tt testing.runAll
noremap <leader>tT testing.debugAll
noremap <leader>ta testing.runAll
noremap <leader>tA testing.debugAll
noremap <leader>tf testing.reRunFailedTests
noremap <leader>tF testing.debugFailedTests
noremap <leader>tl testing.reRunLastRun
noremap <leader>tL testing.debugLastRun
noremap <leader>tc testing.runCurrentTest
noremap <leader>tC testing.debugCurrentTest
noremap <leader>tx testing.cancelTestRun
" <leader>d : +debug
" <leader>h : +help
" <leader>c : +code
noremap <leader>cr coderunner.run
noremap <leader>cf editor.action.formatDocument
noremap <leader>c<leader> editor.action.trimTrailingWhitespace
noremap <leader>cs workbench.action.gotoSymbol
noremap <leader>cS workbench.action.showAllSymbols
" <leader>b : +buffer
noremap <leader>bb workbench.action.showAllEditors
noremap <leader>bd :bdelete<CR>
noremap <leader>bh :bprevious<CR>
noremap <leader>bi :bnext<CR>