Open kevinxft opened 2 years ago
"vim.operatorPendingModeKeyBindingsNonRecursive": [
{
"before": ["f"],
"after": ["z"]
},
{
"before": ["F"],
"after": ["Z"]
}
],
cs 要改的字符 变成的字符,
# 例如:'haha' -> "haha"
c s ' "
ys 要包裹的范围 用于包裹的字符
# 例如:haha -> "haha"
y s w "
删除包裹的字符
# 例如:"haha" -> haha
d s "
可视化模式下操作
# hello world ! -> "hello world ! "
shift+v S "
公式 :[range]s[ubstitute]/{pattern}/{string}/[flags]
# 到尾部 keivn 替换成 fuck ,需要按回车
:$s/kevin/fuck
# 全文keivn 替换成 fuck ,需要按回车
:%s/kevi/fuck
# 基于行,keivn 替换成 fuck ,需要按回车
:10,12s/kevin/fuck
:10,$s/kevin/fuck
# 一行内全部替换,不会遇到第一个匹配就停止
:%s/kevi/fuck/g
# 有确认的替换
:%s/kevi/fuck/c
% 匹配括号
可以录制一系列的动作
{
"before": ["
- 重命名 f2 or leader + r + n
```json
{
"before": ["<leader>", "r", "n"],
"commands": ["editor.action.rename"]
}
{
"before": ["<leader>", "["],
"commands": [
{
"command": "editor.fold"
},
{
"command": "vim.remap",
"args": {
"after": ["$", "%"]
}
}
]
}
[
{
"key": "cmd+c",
"command": "execCopy"
},
{
"key": "shift+left",
"command": "vim.remap",
"when": "vim.mode == 'Normal'",
"args": {
"after": ["<c-w>", "h"]
}
},
{
"key": "shift+right",
"command": "vim.remap",
"when": "vim.mode == 'Normal'",
"args": {
"after": ["<c-w>", "l"]
}
},
{
"key": "shift+up",
"command": "vim.remap",
"when": "vim.mode == 'Normal'",
"args": {
"after": ["<c-w>", "k"]
}
},
{
"key": "shift+down",
"command": "vim.remap",
"when": "vim.mode == 'Normal'",
"args": {
"after": ["<c-w>", "j"]
}
},
{
"key": "ctrl+cmd+\\",
"command": "workbench.action.splitEditorUp"
},
{
"key": "ctrl+;",
"command": "workbench.view.explorer",
"when": "viewContainer.workbench.view.explorer.enabled"
},
{
"key": "ctrl+'",
"command": "workbench.action.focusFirstEditorGroup"
},
{
"key": "a",
"command": "explorer.newFile",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "shift+a",
"command": "explorer.newFolder",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "r",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "d",
"command": "deleteFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
}
]
mapkey <L:v> <$>
mapkey <H:v> <0>
map gH firstTab
map gL lastTab
map g[ visitPreviousTab
map ' Marks.activate
chrome://lfags 将 extensions-on-chrome-urls 开启
brew install zsh-vi-mode,安装好以后需要在zshrc里面配置source激活
# /usr/local/opt/zsh-vi-mode/share/zsh-vi-mode/zsh-vi-mode.zsh
# Your custom widget
function jump_end_of_line() {
zvm_navigation_handler $
}
function jump_start_of_line() { zvm_navigation_handler ^ }
function zvm_after_lazy_keybindings() {
zvm_define_widget jump_end_of_line zvm_define_widget jump_start_of_line
zvm_bindkey vicmd 'H' jump_start_of_line zvm_bindkey visual 'H' jump_start_of_line zvm_bindkey vicmd 'L' jump_end_of_line zvm_bindkey visual 'L' jump_end_of_line }
#### 修复复制功能
```cmd
# zvm_vi_yank函数增加一样代码
function zvm_vi_yank() {
zvm_yank
echo ${CUTBUFFER} | pbcopy # 增加这行
zvm_exit_visual_mode
}
{
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[python]": {
"editor.formatOnType": true
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"codeium.enableSearch": true,
"css.validate": false,
"editor.accessibilitySupport": "off",
"editor.codeActionsOnSave": {
"editor.codeLensFontFamily": "monaco",
"leetcode.workspaceFolder": "/Users/kevin/.leetcode",
"workbench.editor.enablePreview": false
},
"editor.fontFamily": "CodeNewRoman Nerd Font",
"editor.fontSize": 18,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.lineHeight": 30,
"editor.lineNumbers": "relative",
"editor.tabSize": 2,
"editor.unfoldOnClickAfterEndOfLine": true,
"editor.unicodeHighlight.ambiguousCharacters": false,
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"files.autoSave": "onFocusChange",
"git.autofetch": true,
"hardhat.telemetry": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"leetcode-problem-rating.workspaceFolder": "/Users/kevin/.leetcode",
"leetcode.defaultLanguage": "javascript",
"leetcode.endpoint": "leetcode-cn",
"leetcode.hint.commandShortcut": false,
"leetcode.hint.commentDescription": false,
"leetcode.hint.configWebviewMarkdown": false,
"leetcode.workspaceFolder": "/Users/kevin/.leetcode",
"less.validate": false,
"liveServer.settings.donotShowInfoMsg": true,
"scss.validate": false,
"security.workspace.trust.untrustedFiles": "open",
"solidity.telemetry": true,
"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.fontFamily": "Maple Mono SC NF",
"terminal.integrated.fontSize": 14,
"vim.easymotion": true,
"vim.foldfix": true,
"vim.handleKeys": {},
"vim.hlsearch": true,
"vim.incsearch": true,
"vim.leader": "<Space>",
"vim.normalModeKeyBindings": [
{
"after": ["^"],
"before": ["H"]
},
{
"after": ["g", "_"],
"before": ["L"]
},
{
"after": ["5", "j"],
"before": ["J"]
},
{
"after": ["5", "k"],
"before": ["K"]
}
],
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "n", "d"],
"commands": ["explorer.newFolder"]
},
{
"before": ["<leader>", "n", "f"],
"commands": ["explorer.newFile"]
},
{
"after": ["V", "$", "%", "d"],
"before": ["<leader>", "d", "f"]
},
{
"after": ["V", "$", "%", "d"],
"before": ["<leader>", "f"]
},
{
"before": ["<leader>", "w"],
"commands": ["workbench.action.files.save"]
},
{
"before": ["<leader>", "w", "q"],
"commands": [
"workbench.action.files.save",
"workbench.action.closeActiveEditor"
]
},
{
"before": ["<leader>", "f", "d"],
"commands": ["editor.action.formatDocument"]
},
{
"before": ["<leader>", "r", "n"],
"commands": ["editor.action.rename"]
},
{
"before": ["<leader>", "["],
"commands": [
{
"command": "editor.fold"
},
{
"args": {
"after": ["$", "%"]
},
"command": "vim.remap"
}
]
},
{
"before": ["<leader>", "]"],
"commands": [
{
"command": "editor.unfold"
}
]
},
{
"before": ["<C-n>"],
"commands": [":nohl"]
},
{
"before": ["K"],
"commands": ["lineBreakInsert"],
"silent": true
},
{
"after": ["s"],
"before": ["f"]
},
{
"after": ["S"],
"before": ["F"]
},
{
"after": ["c", "l"],
"before": ["s"]
},
{
"after": ["^", "C"],
"before": ["S"]
},
{
"before": ["<leader>", "g", "c", "l"],
"commands": ["git.clean"]
},
{
"before": ["<leader>", "g", "d", "f"],
"commands": ["git.openChange"]
},
{
"before": ["<leader>", "g", "c"],
"commands": ["git.commit"]
},
{
"before": ["<leader>", "g", "g"],
"commands": ["workbench.view.scm"]
},
{
"before": ["<leader>", "g", "s"],
"commands": ["git.stage"]
},
{
"before": ["<leader>", "g", "u"],
"commands": ["git.unstage"]
},
{
"before": ["<leader>", "r", "e"],
"commands": ["abracadabra.extract"]
},
{
"before": ["<leader>", "v", "v"],
"commands": ["hocusPocus.createVariable"]
},
{
"before": ["<leader>", "f", "f"],
"commands": ["hocusPocus.createFunction"]
},
{
"before": ["<leader>", ";"],
"commands": ["vspacecode.space"]
}
],
"vim.operatorPendingModeKeyBindings": [
{
"after": ["^"],
"before": ["H"]
},
{
"after": ["g", "_"],
"before": ["L"]
},
{
"after": ["a", "I"],
"before": ["a", "i"]
}
],
"vim.operatorPendingModeKeyBindingsNonRecursive": [
{
"after": ["z"],
"before": ["f"]
},
{
"after": ["Z"],
"before": ["F"]
}
],
"vim.sneak": true,
"vim.useCtrlKeys": true,
"vim.useSystemClipboard": true,
"vim.visualModeKeyBindings": [
{
"after": ["^"],
"before": ["H"]
},
{
"after": ["g", "_"],
"before": ["L"]
},
{
"after": ["5", "j"],
"before": ["J"]
},
{
"after": ["5", "k"],
"before": ["K"]
},
{
"after": ["a", "I"],
"before": ["a", "i"]
}
],
"vim.visualModeKeyBindingsNonRecursive": [
{
"after": ["s"],
"before": ["f"]
},
{
"before": ["<leader>", ";"],
"commands": ["vspacecode.space"]
}
],
"vscode-pets.position": "explorer",
"vscode-pets.theme": "forest",
"vsicons.dontShowNewVersionMessage": true,
"workbench.colorTheme": "Dracula",
"workbench.iconTheme": "eq-material-theme-icons-light",
"workbench.startupEditor": "none",
"terminal.integrated.env.osx": {
"FIG_NEW_SESSION": "1"
}
}
[
{
"key": "cmd+c",
"command": "execCopy"
},
{
"key": "shift+left",
"command": "vim.remap",
"when": "vim.mode == 'Normal'",
"args": {
"after": ["<c-w>", "h"]
}
},
{
"key": "shift+right",
"command": "vim.remap",
"when": "vim.mode == 'Normal'",
"args": {
"after": ["<c-w>", "l"]
}
},
{
"key": "shift+up",
"command": "vim.remap",
"when": "vim.mode == 'Normal'",
"args": {
"after": ["<c-w>", "k"]
}
},
{
"key": "shift+down",
"command": "vim.remap",
"when": "vim.mode == 'Normal'",
"args": {
"after": ["<c-w>", "j"]
}
},
{
"key": "ctrl+cmd+\\",
"command": "workbench.action.splitEditorUp"
},
{
"key": "ctrl+;",
"command": "workbench.view.explorer",
"when": "viewContainer.workbench.view.explorer.enabled"
},
{
"key": "ctrl+'",
"command": "workbench.action.focusFirstEditorGroup"
},
{
"key": "a",
"command": "explorer.newFile",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "shift+a",
"command": "explorer.newFolder",
"when": "filesExplorerFocus && !inputFocus"
},
{
"key": "r",
"command": "renameFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
},
{
"key": "d",
"command": "deleteFile",
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceReadonly && !inputFocus"
},
{
"key": "space",
"command": "vspacecode.space",
"when": "activeEditorGroupEmpty && focusedView == '' && !whichkeyActive && !inputFocus"
},
// Trigger vspacecode when sidebar is in focus
{
"key": "space",
"command": "vspacecode.space",
"when": "sideBarFocus && !inputFocus && !whichkeyActive"
},
{
"key": "ctrl+,",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
{
"key": "ctrl+`",
"command": "-workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
{
"key": "cmd+]",
"command": "workbench.action.terminal.focusNextPane",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "alt+cmd+right",
"command": "-workbench.action.terminal.focusNextPane",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "cmd+[",
"command": "workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "alt+cmd+left",
"command": "-workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "shift+alt+q",
"command": "workbench.action.terminal.kill"
},
{
"key": "shift+alt+n",
"command": "workbench.action.terminal.new",
"when": "terminalProcessSupported || terminalWebExtensionContributedProfile"
},
{
"key": "ctrl+shift+`",
"command": "-workbench.action.terminal.new",
"when": "terminalProcessSupported || terminalWebExtensionContributedProfile"
},
{
"key": "shift+cmd+0",
"command": "workbench.action.debug.restart",
"when": "inDebugMode"
},
{
"key": "shift+cmd+f5",
"command": "-workbench.action.debug.restart",
"when": "inDebugMode"
},
{
"key": "shift+cmd+9",
"command": "editor.debug.action.toggleBreakpoint",
"when": "debuggersAvailable && editorTextFocus"
},
{
"key": "f9",
"command": "-editor.debug.action.toggleBreakpoint",
"when": "debuggersAvailable && editorTextFocus"
},
{
"key": "cmd+'",
"command": "workbench.action.debug.stepOver",
"when": "debugState == 'stopped'"
},
{
"key": "f10",
"command": "-workbench.action.debug.stepOver",
"when": "debugState == 'stopped'"
},
{
"key": "shift+cmd+'",
"command": "workbench.action.debug.stepInto",
"when": "debugState != 'inactive'"
},
{
"key": "f11",
"command": "-workbench.action.debug.stepInto",
"when": "debugState != 'inactive'"
},
{
"key": "tab",
"command": "extension.vim_tab",
"when": "editorFocus && vim.active && !inDebugRepl && vim.mode != 'Insert' && editorLangId != 'magit'"
},
{
"key": "tab",
"command": "-extension.vim_tab",
"when": "editorFocus && 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": "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"
}
]
操作
移动
配置更方便的滚动(normal,visual)
一些实用的组合
. 点命令
引申,删除一个单词
尾部加分号
屏幕滚动
插入
复制
可视化模式(可以配合上面的移动,还可以配合插入操作,例如A)
文本对象(i 内部,a 外部)
插件
vim-textobj-aruments (主要是修改函数参数)
vim-textobj-entire