From 00794985c214177286d01a4cbec8f495d34f0c4e Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 29 Aug 2020 12:29:11 -0400 Subject: [PATCH] added configuration for vscodium integration --- init.vim | 81 ++-- keys/mappings.vim | 102 +++-- plug-config/easymotion.vim | 22 +- utils/vscode_config/keybindings.json | 129 ++++++ utils/vscode_config/settings.json | 633 +++++++++++++++++++++++++++ vim-plug/plugins.vim | 258 +++++------ vscode/windows.vim | 76 ++++ 7 files changed, 1082 insertions(+), 219 deletions(-) create mode 100644 utils/vscode_config/keybindings.json create mode 100644 utils/vscode_config/settings.json create mode 100644 vscode/windows.vim diff --git a/init.vim b/init.vim index 8d211c75..8f8689d1 100644 --- a/init.vim +++ b/init.vim @@ -10,47 +10,54 @@ source $HOME/.config/nvim/vim-plug/plugins.vim source $HOME/.config/nvim/general/settings.vim source $HOME/.config/nvim/general/functions.vim source $HOME/.config/nvim/keys/mappings.vim -source $HOME/.config/nvim/keys/which-key.vim -" Themes -source $HOME/.config/nvim/themes/syntax.vim -source $HOME/.config/nvim/themes/onedark.vim -source $HOME/.config/nvim/themes/airline.vim - -" Plugin Configuration -source $HOME/.config/nvim/plug-config/rnvimr.vim -source $HOME/.config/nvim/plug-config/better-whitespace.vim -source $HOME/.config/nvim/plug-config/fzf.vim source $HOME/.config/nvim/plug-config/vim-commentary.vim -source $HOME/.config/nvim/plug-config/rainbow.vim -source $HOME/.config/nvim/plug-config/codi.vim -source $HOME/.config/nvim/plug-config/quickscope.vim -source $HOME/.config/nvim/plug-config/vim-wiki.vim -source $HOME/.config/nvim/plug-config/sneak.vim -source $HOME/.config/nvim/plug-config/coc.vim -source $HOME/.config/nvim/plug-config/goyo.vim -source $HOME/.config/nvim/plug-config/vim-rooter.vim -source $HOME/.config/nvim/plug-config/start-screen.vim -source $HOME/.config/nvim/plug-config/gitgutter.vim -source $HOME/.config/nvim/plug-config/git-messenger.vim -source $HOME/.config/nvim/plug-config/closetags.vim -source $HOME/.config/nvim/plug-config/floaterm.vim -source $HOME/.config/nvim/plug-config/vista.vim -source $HOME/.config/nvim/plug-config/xtabline.vim -source $HOME/.config/nvim/plug-config/polyglot.vim -source $HOME/.config/nvim/plug-config/far.vim -source $HOME/.config/nvim/plug-config/tagalong.vim -source $HOME/.config/nvim/plug-config/illuminate.vim -source $HOME/.config/nvim/plug-config/bracey.vim -source $HOME/.config/nvim/plug-config/asynctask.vim -source $HOME/.config/nvim/plug-config/window-swap.vim -source $HOME/.config/nvim/plug-config/markdown-preview.vim -" source $HOME/.config/nvim/plug-config/vimspector.vim " Uncomment if you want to use Vimspector -" source $HOME/.config/nvim/plug-config/ale.vim -luafile $HOME/.config/nvim/lua/plug-colorizer.lua + +if exists('g:vscode') + " VS Code extension + source $HOME/.config/nvim/vscode/windows.vim + source $HOME/.config/nvim/plug-config/easymotion.vim +else + + " Themes + source $HOME/.config/nvim/themes/syntax.vim + source $HOME/.config/nvim/themes/onedark.vim + source $HOME/.config/nvim/themes/airline.vim + + " Plugin Configuration + source $HOME/.config/nvim/keys/which-key.vim + source $HOME/.config/nvim/plug-config/rnvimr.vim + source $HOME/.config/nvim/plug-config/better-whitespace.vim + source $HOME/.config/nvim/plug-config/fzf.vim + source $HOME/.config/nvim/plug-config/rainbow.vim + source $HOME/.config/nvim/plug-config/codi.vim + source $HOME/.config/nvim/plug-config/quickscope.vim + source $HOME/.config/nvim/plug-config/vim-wiki.vim + source $HOME/.config/nvim/plug-config/sneak.vim + source $HOME/.config/nvim/plug-config/coc.vim + source $HOME/.config/nvim/plug-config/goyo.vim + source $HOME/.config/nvim/plug-config/vim-rooter.vim + source $HOME/.config/nvim/plug-config/start-screen.vim + source $HOME/.config/nvim/plug-config/gitgutter.vim + source $HOME/.config/nvim/plug-config/git-messenger.vim + source $HOME/.config/nvim/plug-config/closetags.vim + source $HOME/.config/nvim/plug-config/floaterm.vim + source $HOME/.config/nvim/plug-config/vista.vim + source $HOME/.config/nvim/plug-config/xtabline.vim + source $HOME/.config/nvim/plug-config/polyglot.vim + source $HOME/.config/nvim/plug-config/far.vim + source $HOME/.config/nvim/plug-config/tagalong.vim + source $HOME/.config/nvim/plug-config/illuminate.vim + source $HOME/.config/nvim/plug-config/bracey.vim + source $HOME/.config/nvim/plug-config/asynctask.vim + source $HOME/.config/nvim/plug-config/window-swap.vim + source $HOME/.config/nvim/plug-config/markdown-preview.vim + " source $HOME/.config/nvim/plug-config/vimspector.vim " Uncomment if you want to use Vimspector + " source $HOME/.config/nvim/plug-config/ale.vim + luafile $HOME/.config/nvim/lua/plug-colorizer.lua +endif " Add paths to node and python here if !empty(glob("~/.config/nvim/paths.vim")) source $HOME/.config/nvim/paths.vim endif - diff --git a/keys/mappings.vim b/keys/mappings.vim index 0ae118d0..c7d21d4c 100644 --- a/keys/mappings.vim +++ b/keys/mappings.vim @@ -13,58 +13,68 @@ nnoremap vnoremap < >gv -" Better nav for omnicomplete -inoremap ("\") -inoremap ("\") +if exists('g:vscode') -" I hate escape more than anything else -inoremap jk -inoremap kj + " Simulate same TAB behavior in VSCode + nmap :Tabnext + nmap :Tabprev -" Easy CAPS -" inoremap viwUi -" nnoremap viwU +else -" TAB in general mode will move to text buffer -nnoremap :bnext -" SHIFT-TAB will go back -nnoremap :bprevious + " Better nav for omnicomplete + inoremap ("\") + inoremap ("\") -" Move selected line / block of text in visual mode -" shift + k to move up -" shift + j to move down -xnoremap K :move '<-2gv-gv -xnoremap J :move '>+1gv-gv + " I hate escape more than anything else + inoremap jk + inoremap kj -" Alternate way to save -nnoremap :w -" Alternate way to quit -nnoremap :wq! -" Use control-c instead of escape -nnoremap -" : completion. -inoremap pumvisible() ? "\" : "\" + " Easy CAPS + " inoremap viwUi + " nnoremap viwU -" Better window navigation -nnoremap h -nnoremap j -nnoremap k -nnoremap l + " TAB in general mode will move to text buffer + nnoremap :bnext + " SHIFT-TAB will go back + nnoremap :bprevious -" Terminal window navigation -tnoremap h -tnoremap j -tnoremap k -tnoremap l -inoremap h -inoremap j -inoremap k -inoremap l -tnoremap + " Move selected line / block of text in visual mode + " shift + k to move up + " shift + j to move down + xnoremap K :move '<-2gv-gv + xnoremap J :move '>+1gv-gv -" Use alt + hjkl to resize windows -nnoremap :resize -2 -nnoremap :resize +2 -nnoremap :vertical resize -2 -nnoremap :vertical resize +2 + " Alternate way to save + nnoremap :w + " Alternate way to quit + nnoremap :wq! + " Use control-c instead of escape + nnoremap + " : completion. + inoremap pumvisible() ? "\" : "\" + + " Better window navigation + nnoremap h + nnoremap j + nnoremap k + nnoremap l + + " Terminal window navigation + tnoremap h + tnoremap j + tnoremap k + tnoremap l + inoremap h + inoremap j + inoremap k + inoremap l + tnoremap + + " Use alt + hjkl to resize windows + nnoremap :resize -2 + nnoremap :resize +2 + nnoremap :vertical resize -2 + nnoremap :vertical resize +2 + +endif diff --git a/plug-config/easymotion.vim b/plug-config/easymotion.vim index 0a94ea7f..49a0e262 100644 --- a/plug-config/easymotion.vim +++ b/plug-config/easymotion.vim @@ -19,21 +19,21 @@ nmap s (easymotion-overwin-f2) " nmap S (easymotion-overwin-t) " Move to line -map l (easymotion-bd-jk) -nmap l (easymotion-overwin-line) +" map l (easymotion-bd-jk) +" nmap l (easymotion-overwin-line) -" Move to word -map w (easymotion-bd-w) -nmap w (easymotion-overwin-w) +" " Move to word +" map w (easymotion-bd-w) +" nmap w (easymotion-overwin-w) -hi link EasyMotionTarget ErrorMsg -hi link EasyMotionShade Comment +" hi link EasyMotionTarget ErrorMsg +" hi link EasyMotionShade Comment -hi link EasyMotionTarget2First MatchParen -hi link EasyMotionTarget2Second MatchParen +" hi link EasyMotionTarget2First MatchParen +" hi link EasyMotionTarget2Second MatchParen -hi link EasyMotionMoveHL Search -hi link EasyMotionIncSearch Search +" hi link EasyMotionMoveHL Search +" hi link EasyMotionIncSearch Search "Lower case finds upper & lower case but upper case only finds upper case let g:EasyMotion_smartcase = 1 diff --git a/utils/vscode_config/keybindings.json b/utils/vscode_config/keybindings.json new file mode 100644 index 00000000..9ba07de6 --- /dev/null +++ b/utils/vscode_config/keybindings.json @@ -0,0 +1,129 @@ +// Place your key bindings in this file to override the defaultsauto[] +[ + { + "key": "shift+cmd+e", + "command": "actions.findWithSelection" + }, + { + "key": "cmd+e", + "command": "-actions.findWithSelection" + }, + { + "key": "cmd+e", + "command": "workbench.view.explorer" + }, + { + "key": "shift+cmd+e", + "command": "-workbench.view.explorer" + }, + { + "key": "r", + "command": "renameFile", + "when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { + "key": "enter", + "command": "-renameFile", + "when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus" + }, + { + "key": "j", + "command": "list.focusDown", + "when": "listFocus" + }, + { + "key": "k", + "command": "list.focusUp", + "when": "listFocus" + }, + { + "key": "ctrl+j", + "command": "selectNextSuggestion", + "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible" + }, + { + "key": "ctrl+k", + "command": "selectPrevSuggestion", + "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible" + }, + { + "key": "ctrl+j", + "command": "workbench.action.quickOpenNavigateNext", + "when": "inQuickOpen" + }, + { + "key": "tab", + "command": "selectNextSuggestion", + "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible" + }, + { + "key": "tab", + "command": "workbench.action.quickOpenNavigateNext", + "when": "inQuickOpen" + }, + { + "key": "shit+tab", + "command": "selectPrevSuggestion", + "when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible" + }, + { + "key": "shift+tab", + "command": "workbench.action.quickOpenNavigatePrevious", + "when": "inQuickOpen" + }, + { + "key": "ctrl+k", + "command": "workbench.action.quickOpenNavigatePrevious", + "when": "inQuickOpen" + }, + { + "key": "enter", + "command": "list.select", + "when": "explorerViewletVisible && filesExplorerFocus" + }, + { + "key": "l", + "command": "list.select", + "when": "explorerViewletVisible && filesExplorerFocus" + }, + { + "key": "o", + "command": "list.toggleExpand", + "when": "listFocus" + }, + { + "key": "h", + "command": "list.collapse", + "when": "listFocus" + }, + { + "key": "a", + "command": "explorer.newFile", + "when": "filesExplorerFocus && !inputFocus" + }, + { + "key": "shift+a", + "command": "explorer.newFolder", + "when": "filesExplorerFocus && !inputFocus" + }, + { + "key": "shift+;", + "command": "insertPrevSuggestion", + "when": "hasOtherSuggestions && textInputFocus && textInputFocus && !inSnippetMode && !suggestWidgetVisible && config.editor.tabCompletion == 'on'" + }, + { + "key": "ctrl+l", + "when": "sideBarFocus", + "command": "workbench.action.focusActiveEditorGroup" + }, + { + "key": "ctrl+k", + "command": "workbench.action.focusActiveEditorGroup", + "when": "terminalFocus" + }, + { + "key": "ctrl+j", + "command": "workbench.action.terminal.focus", + "when": "!terminalFocus" + } +] diff --git a/utils/vscode_config/settings.json b/utils/vscode_config/settings.json new file mode 100644 index 00000000..2e199720 --- /dev/null +++ b/utils/vscode_config/settings.json @@ -0,0 +1,633 @@ +{ + "vscode-neovim.neovimExecutablePaths.darwin": "/usr/local/bin/nvim", + "vscode-neovim.neovimExecutablePaths.linux": "/usr/bin/nvim", + "vscode-neovim.neovimInitVimPaths.darwin": "$HOME/.config/nvim/init.vim", + "vscode-neovim.neovimInitVimPaths.linux": "$HOME/.config/nvim/init.vim", + "whichkey.sortOrder": "alphabetically", + "whichkey.bindings": [ + { + "key": "/", + "name": "comment", + "type": "command", + "command": "vscode-neovim.send", + "args": "" + }, + { + "key": "b", + "name": "Buffers/Editors...", + "type": "bindings", + "bindings": [ + { + "key": "b", + "name": "Show all buffers/editors", + "type": "command", + "command": "workbench.action.showAllEditors" + }, + { + "key": "d", + "name": "Close active editor", + "type": "command", + "command": "workbench.action.closeActiveEditor" + }, + { + "key": "h", + "name": "Move editor into left group", + "type": "command", + "command": "workbench.action.moveEditorToLeftGroup" + }, + { + "key": "j", + "name": "Move editor into below group", + "type": "command", + "command": "workbench.action.moveEditorToBelowGroup" + }, + { + "key": "k", + "name": "Move editor into above group", + "type": "command", + "command": "workbench.action.moveEditorToAboveGroup" + }, + { + "key": "l", + "name": "Move editor into right group", + "type": "command", + "command": "workbench.action.moveEditorToRightGroup" + }, + { + "key": "m", + "name": "Close other editors", + "type": "command", + "command": "workbench.action.closeOtherEditors" + }, + { + "key": "n", + "name": "Next editor", + "type": "command", + "command": "workbench.action.nextEditor" + }, + { + "key": "p", + "name": "Previous editor", + "type": "command", + "command": "workbench.action.previousEditor" + }, + { + "key": "N", + "name": "New untitled editor", + "type": "command", + "command": "workbench.action.files.newUntitledFile" + }, + { + "key": "u", + "name": "Reopen closed editor", + "type": "command", + "command": "workbench.action.reopenClosedEditor" + }, + { + "key": "y", + "name": "Copy buffer to clipboard", + "type": "commands", + "commands": [ + "editor.action.selectAll", + "editor.action.clipboardCopyAction", + "cancelSelection" + ] + } + ] + }, + { + "key": "d", + "name": "Debug...", + "type": "bindings", + "bindings": [ + { + "key": "d", + "name": "Start debug", + "type": "command", + "command": "workbench.action.debug.start" + }, + { + "key": "S", + "name": "Stop debug", + "type": "command", + "command": "workbench.action.debug.stop" + }, + { + "key": "c", + "name": "Continue debug", + "type": "command", + "command": "workbench.action.debug.continue" + }, + { + "key": "p", + "name": "Pause debug", + "type": "command", + "command": "workbench.action.debug.pause" + }, + { + "key": "r", + "name": "Run without debugging", + "type": "command", + "command": "workbench.action.debug.run" + }, + { + "key": "R", + "name": "Restart debug", + "type": "command", + "command": "workbench.action.debug.restart" + }, + { + "key": "i", + "name": "Step into", + "type": "command", + "command": "workbench.action.debug.stepInto" + }, + { + "key": "s", + "name": "Step over", + "type": "command", + "command": "workbench.action.debug.stepOver" + }, + { + "key": "o", + "name": "Step out", + "type": "command", + "command": "workbench.action.debug.stepOut" + }, + { + "key": "b", + "name": "Toggle breakpoint", + "type": "command", + "command": "editor.debug.action.toggleBreakpoint" + }, + { + "key": "B", + "name": "Toggle inline breakpoint", + "type": "command", + "command": "editor.debug.action.toggleInlineBreakpoint" + }, + { + "key": "j", + "name": "Jump to cursor", + "type": "command", + "command": "debug.jumpToCursor" + }, + { + "key": "v", + "name": "REPL", + "type": "command", + "command": "workbench.debug.action.toggleRepl" + }, + { + "key": "w", + "name": "Focus on watch window", + "type": "command", + "command": "workbench.debug.action.focusWatchView" + }, + { + "key": "W", + "name": "Add to watch", + "type": "command", + "command": "editor.debug.action.selectionToWatch" + } + ] + }, + { + "key": "e", + "name": "Toggle Explorer", + "type": "command", + "command": "workbench.action.toggleSidebarVisibility" + }, + { + "key": "g", + "name": "Git...", + "type": "bindings", + "bindings": [ + { + "key": "b", + "name": "Checkout", + "type": "command", + "command": "git.checkout" + }, + { + "key": "c", + "name": "Commit", + "type": "command", + "command": "git.commit" + }, + { + "key": "d", + "name": "Delete Branch", + "type": "command", + "command": "git.deleteBranch" + }, + { + "key": "f", + "name": "Fetch", + "type": "command", + "command": "git.fetch" + }, + { + "key": "i", + "name": "Init", + "type": "command", + "command": "git.init" + }, + { + "key": "m", + "name": "Merge", + "type": "command", + "command": "git.merge" + }, + { + "key": "p", + "name": "Publish", + "type": "command", + "command": "git.publish" + }, + { + "key": "s", + "name": "Stash", + "type": "command", + "command": "workbench.view.scm" + }, + { + "key": "S", + "name": "Stage", + "type": "command", + "command": "git.stage" + }, + { + "key": "U", + "name": "Unstage", + "type": "command", + "command": "git.unstage" + } + ] + }, + { + "key": "h", + "name": "Split Horizontal", + "type": "command", + "command": "workbench.action.splitEditorDown" + }, + { + "key": "i", + "name": "Insert...", + "type": "bindings", + "bindings": [ + { + "key": "j", + "name": "Insert line below", + "type": "command", + "command": "editor.action.insertLineAfter" + }, + { + "key": "k", + "name": "Insert line above", + "type": "command", + "command": "editor.action.insertLineBefore" + }, + { + "key": "s", + "name": "Insert snippet", + "type": "command", + "command": "editor.action.insertSnippet" + } + ] + }, + { + "key": "s", + "name": "Search...", + "type": "bindings", + "bindings": [ + { + "key": "e", + "name": "Edit symbol", + "type": "command", + "command": "editor.action.rename" + }, + { + "key": "h", + "name": "Highlight symbol", + "type": "transient", + "command": "editor.action.wordHighlight.trigger", + "bindings": [ + { + "key": "p", + "name": "Previous occurrence", + "type": "command", + "command": "editor.action.wordHighlight.prev" + }, + { + "key": "N", + "name": "Previous occurrence", + "type": "command", + "command": "editor.action.wordHighlight.prev" + }, + { + "key": "n", + "name": "Next occurrence", + "type": "command", + "command": "editor.action.wordHighlight.next" + }, + { + "key": "/", + "name": "Search in a project with a selection", + "type": "commands", + "commands": [ + "editor.action.addSelectionToNextFindMatch", + "workbench.action.findInFiles" + ] + } + ] + }, + { + "key": "j", + "name": "Jump to symbol in file", + "type": "command", + "command": "workbench.action.gotoSymbol" + }, + { + "key": "J", + "name": "Jump to symbol in workspace", + "type": "command", + "command": "workbench.action.showAllSymbols" + }, + { + "key": "p", + "name": "Search in a project", + "type": "command", + "command": "workbench.action.findInFiles" + }, + { + "key": "P", + "name": "Search in a project with a selection", + "type": "commands", + "commands": [ + "editor.action.addSelectionToNextFindMatch", + "workbench.action.findInFiles" + ] + }, + { + "key": "r", + "name": "Search all references", + "type": "command", + "command": "editor.action.referenceSearch.trigger" + }, + { + "key": "R", + "name": "Search all references in side bar", + "type": "command", + "command": "references-view.find" + }, + { + "key": "s", + "name": "Search in current file", + "type": "command", + "command": "actions.find" + } + ] + }, + { + "key": "S", + "name": "Show...", + "type": "bindings", + "bindings": [ + { + "key": "e", + "name": "Show explorer", + "type": "command", + "command": "workbench.view.explorer" + }, + { + "key": "s", + "name": "Show search", + "type": "command", + "command": "workbench.view.search" + }, + { + "key": "g", + "name": "Show source control", + "type": "command", + "command": "workbench.view.scm" + }, + { + "key": "t", + "name": "Show test", + "type": "command", + "command": "workbench.view.extension.test" + }, + { + "key": "r", + "name": "Show remote explorer", + "type": "command", + "command": "workbench.view.remote" + }, + { + "key": "x", + "name": "Show extensions", + "type": "command", + "command": "workbench.view.extensions" + }, + { + "key": "p", + "name": "Show problem", + "type": "command", + "command": "workbench.actions.view.problems" + }, + { + "key": "o", + "name": "Show output", + "type": "command", + "command": "workbench.action.output.toggleOutput" + }, + { + "key": "d", + "name": "Show debug console", + "type": "command", + "command": "workbench.debug.action.toggleRepl" + } + ] + }, + { + "key": "t", + "name": "Terminal...", + "type": "bindings", + "bindings": [ + { + "key": "t", + "name": "Toggle Terminal", + "type": "command", + "command": "workbench.action.togglePanel" + } + ] + }, + { + "key": "T", + "name": "UI toggles...", + "type": "bindings", + "bindings": [ + { + "key": "b", + "name": "Toggle side bar visibility", + "type": "command", + "command": "workbench.action.toggleSidebarVisibility" + }, + { + "key": "j", + "name": "Toggle panel visibility", + "type": "command", + "command": "workbench.action.togglePanel" + }, + { + "key": "F", + "name": "Toggle full screen", + "type": "command", + "command": "workbench.action.toggleFullScreen" + }, + { + "key": "s", + "name": "Select theme", + "type": "command", + "command": "workbench.action.selectTheme" + }, + { + "key": "m", + "name": "Toggle maximized panel", + "type": "command", + "command": "workbench.action.toggleMaximizedPanel" + }, + { + "key": "t", + "name": "Toggle tool/activity bar visibility", + "type": "command", + "command": "workbench.action.toggleActivityBarVisibility" + }, + { + "key": "T", + "name": "Toggle tab visibility", + "type": "command", + "command": "workbench.action.toggleTabsVisibility" + } + ] + }, + { + "key": "v", + "name": "Split Vertical", + "type": "command", + "command": "workbench.action.splitEditor" + }, + { + "key": "w", + "name": "Window...", + "type": "bindings", + "bindings": [ + { + "key": "W", + "name": "Focus previous editor group", + "type": "command", + "command": "workbench.action.focusPreviousGroup" + }, + { + "key": "h", + "name": "Move editor group left", + "type": "command", + "command": "workbench.action.moveActiveEditorGroupLeft" + }, + { + "key": "j", + "name": "Move editor group down", + "type": "command", + "command": "workbench.action.moveActiveEditorGroupDown" + }, + { + "key": "k", + "name": "Move editor group up", + "type": "command", + "command": "workbench.action.moveActiveEditorGroupUp" + }, + { + "key": "l", + "name": "Move editor group right", + "type": "command", + "command": "workbench.action.moveActiveEditorGroupRight" + }, + { + "key": "t", + "name": "Toggle editor group sizes", + "type": "command", + "command": "workbench.action.toggleEditorWidths" + }, + { + "key": "m", + "name": "Maximize editor group", + "type": "command", + "command": "workbench.action.minimizeOtherEditors" + }, + { + "key": "M", + "name": "Maximize editor group and hide side bar", + "type": "command", + "command": "workbench.action.maximizeEditor" + }, + { + "key": "=", + "name": "Reset editor group sizes", + "type": "command", + "command": "workbench.action.evenEditorWidths" + }, + { + "key": "z", + "name": "Combine all editors", + "type": "command", + "command": "workbench.action.joinAllGroups" + }, + { + "key": "d", + "name": "Close editor group", + "type": "command", + "command": "workbench.action.closeEditorsInGroup" + }, + { + "key": "x", + "name": "Close all editor groups", + "type": "command", + "command": "workbench.action.closeAllGroups" + } + ] + }, + { + "key": "z", + "name": "Toggle zen mode", + "type": "command", + "command": "workbench.action.toggleZenMode" + } + ], + "workbench.editor.showTabs": true, + "sync.gist": "939951904a077b97f8001bc35f6b5948", + "gitlens.currentLine.enabled": false, + "gitlens.hovers.currentLine.over": "line", + "editor.suggestSelection": "first", + "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", + "python.pythonPath": "/Users/chris/.miniconda/bin/python", + "java.semanticHighlighting.enabled": true, + "workbench.iconTheme": "material-icon-theme", + "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx1G -Xms100m -javaagent:\"/Users/chris/.vscode-oss/extensions/gabrielbb.vscode-lombok-1.0.1/server/lombok.jar\"", + "workbench.list.automaticKeyboardNavigation": false, + "oneDarkPro.editorTheme": "onedarkPro", + "python.languageServer": "Microsoft", + "terminal.integrated.inheritEnv": false, + "editor.scrollbar.horizontal": "hidden", + "editor.scrollbar.vertical": "hidden", + "kite.showWelcomeNotificationOnStartup": false, + "python.terminal.activateEnvironment": false, + "editor.cursorBlinking": "solid", + "editor.fontFamily": "Fira, Menlo, Monaco, 'Courier New', monospace", + "files.exclude": { + "**/.classpath": true, + "**/.project": true, + "**/.settings": true, + "**/.factorypath": true + } +} diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim index 513937ac..a21db943 100644 --- a/vim-plug/plugins.vim +++ b/vim-plug/plugins.vim @@ -8,133 +8,141 @@ endif call plug#begin('~/.config/nvim/autoload/plugged') - Plug 'suy/vim-context-commentstring' - " Change dates fast - Plug 'tpope/vim-speeddating' - " Convert binary, hex, etc.. - Plug 'glts/vim-radical' - " Files - Plug 'tpope/vim-eunuch' - " Repeat stuff - Plug 'tpope/vim-repeat' - " Surround - Plug 'tpope/vim-surround' - " Better Comments - Plug 'tpope/vim-commentary' - " Have the file system follow you around - Plug 'airblade/vim-rooter' - " auto set indent settings - Plug 'tpope/vim-sleuth' + " Better Comments + Plug 'tpope/vim-commentary' - " Text Navigation - Plug 'justinmk/vim-sneak' - Plug 'unblevable/quick-scope' - " Add some color - Plug 'norcalli/nvim-colorizer.lua' - Plug 'luochen1990/rainbow' - " Better Syntax Support - Plug 'sheerun/vim-polyglot' - " Cool Icons - Plug 'ryanoasis/vim-devicons' - " Auto pairs for '(' '[' '{' - Plug 'jiangmiao/auto-pairs' - " Closetags - Plug 'alvan/vim-closetag' - " Themes - Plug 'christianchiarulli/onedark.vim' - " Intellisense - Plug 'neoclide/coc.nvim', {'branch': 'release'} - " Status Line - Plug 'vim-airline/vim-airline' - Plug 'kevinhwang91/rnvimr' - " FZF - Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } - Plug 'junegunn/fzf.vim' - " Git - Plug 'airblade/vim-gitgutter' - Plug 'tpope/vim-fugitive' - Plug 'tpope/vim-rhubarb' - Plug 'junegunn/gv.vim' - Plug 'rhysd/git-messenger.vim' - " Terminal - Plug 'voldikss/vim-floaterm' - " Start Screen - Plug 'mhinz/vim-startify' - " Vista - Plug 'liuchengxu/vista.vim' - " See what keys do like in emacs - Plug 'liuchengxu/vim-which-key' - " Zen mode - Plug 'junegunn/goyo.vim' - " Snippets - Plug 'honza/vim-snippets' - Plug 'mattn/emmet-vim' - " Interactive code - Plug 'metakirby5/codi.vim' - " Debugging - " Plug 'puremourning/vimspector' - " Better tabline - Plug 'mg979/vim-xtabline' - " undo time travel - Plug 'mbbill/undotree' - " highlight all matches under cursor - Plug 'RRethy/vim-illuminate' - " Find and replace - Plug 'ChristianChiarulli/far.vim' - " Plug 'brooth/far.vim' - " Auto change html tags - Plug 'AndrewRadev/tagalong.vim' - " live server - Plug 'turbio/bracey.vim' - " Smooth scroll - Plug 'psliwka/vim-smoothie' - " async tasks - Plug 'skywind3000/asynctasks.vim' - Plug 'skywind3000/asyncrun.vim' - " Swap windows - Plug 'wesQ3/vim-windowswap' - " Markdown Preview - Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & npm install' } - " Easily Create Gists - Plug 'mattn/vim-gist' - Plug 'mattn/webapi-vim' - " Async Linting Engine - " TODO make sure to add ale config before plugin - " Plug 'dense-analysis/ale' - " Better Whitespace - Plug 'ntpeters/vim-better-whitespace' - " Multiple Cursors - Plug 'mg979/vim-visual-multi', {'branch': 'master'} - Plug 'moll/vim-bbye' - " Plugin Graveyard + if exists('g:vscode') + " Easy motion for VSCode + Plug 'asvetliakov/vim-easymotion' + else - " jsx syntax support - " Plug 'maxmellon/vim-jsx-pretty' - " Typescript syntax - " Plug 'HerringtonDarkholme/yats.vim' - " Multiple Cursors - " Plug 'terryma/vim-multiple-cursors' - " Plug 'kaicataldo/material.vim' - " Plug 'NLKNguyen/papercolor-theme' - " Plug 'tomasiser/vim-code-dark' - " Vim Wiki - " Plug 'https://github.com/vimwiki/vimwiki.git' - " Better Comments - " Plug 'jbgutierrez/vim-better-comments' - " Echo doc - " Plug 'Shougo/echodoc.vim' - " Plug 'hardcoreplayers/spaceline.vim' - " Plug 'vim-airline/vim-airline-themes' - " Ranger - " Plug 'francoiscabrol/ranger.vim' - " Plug 'rbgrouleff/bclose.vim' - " Making stuff - " Plug 'neomake/neomake' - " Plug 'mhinz/vim-signify' - " Plug 'easymotion/vim-easymotion' - " Plug 'preservim/nerdcommenter' - " Plug 'brooth/far.vim' - " Plug 'atishay/far.vim' + " Change dates fast + Plug 'tpope/vim-speeddating' + " Convert binary, hex, etc.. + Plug 'glts/vim-radical' + " Files + Plug 'tpope/vim-eunuch' + " Repeat stuff + Plug 'tpope/vim-repeat' + " Surround + Plug 'tpope/vim-surround' + " Have the file system follow you around + Plug 'airblade/vim-rooter' + " auto set indent settings + Plug 'tpope/vim-sleuth' + " Text Navigation + Plug 'justinmk/vim-sneak' + Plug 'unblevable/quick-scope' + " Add some color + Plug 'norcalli/nvim-colorizer.lua' + Plug 'luochen1990/rainbow' + " Better Syntax Support + Plug 'sheerun/vim-polyglot' + " Cool Icons + Plug 'ryanoasis/vim-devicons' + " Auto pairs for '(' '[' '{' + Plug 'jiangmiao/auto-pairs' + " Closetags + Plug 'alvan/vim-closetag' + " Themes + Plug 'christianchiarulli/onedark.vim' + " Intellisense + Plug 'neoclide/coc.nvim', {'branch': 'release'} + " Status Line + Plug 'vim-airline/vim-airline' + Plug 'kevinhwang91/rnvimr' + " FZF + Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } + Plug 'junegunn/fzf.vim' + " Git + Plug 'airblade/vim-gitgutter' + Plug 'tpope/vim-fugitive' + Plug 'tpope/vim-rhubarb' + Plug 'junegunn/gv.vim' + Plug 'rhysd/git-messenger.vim' + " Terminal + Plug 'voldikss/vim-floaterm' + " Start Screen + Plug 'mhinz/vim-startify' + " Vista + Plug 'liuchengxu/vista.vim' + " See what keys do like in emacs + Plug 'liuchengxu/vim-which-key' + " Zen mode + Plug 'junegunn/goyo.vim' + " Snippets + Plug 'honza/vim-snippets' + Plug 'mattn/emmet-vim' + " Interactive code + Plug 'metakirby5/codi.vim' + " Debugging + " Plug 'puremourning/vimspector' + " Better tabline + Plug 'mg979/vim-xtabline' + " undo time travel + Plug 'mbbill/undotree' + " highlight all matches under cursor + Plug 'RRethy/vim-illuminate' + " Find and replace + Plug 'ChristianChiarulli/far.vim' + " Plug 'brooth/far.vim' + " Auto change html tags + Plug 'AndrewRadev/tagalong.vim' + " live server + Plug 'turbio/bracey.vim' + " Smooth scroll + Plug 'psliwka/vim-smoothie' + " async tasks + Plug 'skywind3000/asynctasks.vim' + Plug 'skywind3000/asyncrun.vim' + " Swap windows + Plug 'wesQ3/vim-windowswap' + " Markdown Preview + Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & npm install' } + " Easily Create Gists + Plug 'mattn/vim-gist' + Plug 'mattn/webapi-vim' + " Async Linting Engine + " TODO make sure to add ale config before plugin + " Plug 'dense-analysis/ale' + " Better Whitespace + Plug 'ntpeters/vim-better-whitespace' + " Multiple Cursors + " TODO add this back in change from C-n + " Plug 'mg979/vim-visual-multi', {'branch': 'master'} + Plug 'moll/vim-bbye' + " Useful for React Commenting + Plug 'suy/vim-context-commentstring' + " Plugin Graveyard + + " jsx syntax support + " Plug 'maxmellon/vim-jsx-pretty' + " Typescript syntax + " Plug 'HerringtonDarkholme/yats.vim' + " Multiple Cursors + " Plug 'terryma/vim-multiple-cursors' + " Plug 'kaicataldo/material.vim' + " Plug 'NLKNguyen/papercolor-theme' + " Plug 'tomasiser/vim-code-dark' + " Vim Wiki + " Plug 'https://github.com/vimwiki/vimwiki.git' + " Better Comments + " Plug 'jbgutierrez/vim-better-comments' + " Echo doc + " Plug 'Shougo/echodoc.vim' + " Plug 'hardcoreplayers/spaceline.vim' + " Plug 'vim-airline/vim-airline-themes' + " Ranger + " Plug 'francoiscabrol/ranger.vim' + " Plug 'rbgrouleff/bclose.vim' + " Making stuff + " Plug 'neomake/neomake' + " Plug 'mhinz/vim-signify' + " Plug 'easymotion/vim-easymotion' + " Plug 'preservim/nerdcommenter' + " Plug 'brooth/far.vim' + " Plug 'atishay/far.vim' + endif call plug#end() diff --git a/vscode/windows.vim b/vscode/windows.vim new file mode 100644 index 00000000..def66822 --- /dev/null +++ b/vscode/windows.vim @@ -0,0 +1,76 @@ +" TODO there is a more contemporary version of this file +"VSCode +function! s:split(...) abort + let direction = a:1 + let file = a:2 + call VSCodeCall(direction == 'h' ? 'workbench.action.splitEditorDown' : 'workbench.action.splitEditorRight') + if file != '' + call VSCodeExtensionNotify('open-file', expand(file), 'all') + endif +endfunction + +function! s:splitNew(...) + let file = a:2 + call s:split(a:1, file == '' ? '__vscode_new__' : file) +endfunction + +function! s:closeOtherEditors() + call VSCodeNotify('workbench.action.closeEditorsInOtherGroups') + call VSCodeNotify('workbench.action.closeOtherEditors') +endfunction + +function! s:manageEditorSize(...) + let count = a:1 + let to = a:2 + for i in range(1, count ? count : 1) + call VSCodeNotify(to == 'increase' ? 'workbench.action.increaseViewSize' : 'workbench.action.decreaseViewSize') + endfor +endfunction + +command! -complete=file -nargs=? Split call split('h', ) +command! -complete=file -nargs=? Vsplit call split('v', ) +command! -complete=file -nargs=? New call split('h', '__vscode_new__') +command! -complete=file -nargs=? Vnew call split('v', '__vscode_new__') +command! -bang Only if == '!' | call closeOtherEditors() | else | call VSCodeNotify('workbench.action.joinAllGroups') | endif + +nnoremap s :call split('h') +xnoremap s :call split('h') + +nnoremap v :call split('v') +xnoremap v :call split('v') + +nnoremap n :call splitNew('h', '__vscode_new__') +xnoremap n :call splitNew('h', '__vscode_new__') + +nnoremap :call VSCodeNotify('workbench.action.focusBelowGroup') +xnoremap :call VSCodeNotify('workbench.action.focusBelowGroup') +nnoremap :call VSCodeNotify('workbench.action.focusAboveGroup') +xnoremap :call VSCodeNotify('workbench.action.focusAboveGroup') +nnoremap :call VSCodeNotify('workbench.action.focusLeftGroup') +xnoremap :call VSCodeNotify('workbench.action.focusLeftGroup') +nnoremap :call VSCodeNotify('workbench.action.focusRightGroup') +xnoremap :call VSCodeNotify('workbench.action.focusRightGroup') + +nnoremap = :call VSCodeNotify('workbench.action.evenEditorWidths') +xnoremap = :call VSCodeNotify('workbench.action.evenEditorWidths') + +nnoremap > :call manageEditorSize(v:count, 'increase') +xnoremap > :call manageEditorSize(v:count, 'increase') +nnoremap + :call manageEditorSize(v:count, 'increase') +xnoremap + :call manageEditorSize(v:count, 'increase') +nnoremap < :call manageEditorSize(v:count, 'decrease') +xnoremap < :call manageEditorSize(v:count, 'decrease') +nnoremap - :call manageEditorSize(v:count, 'decrease') +xnoremap - :call manageEditorSize(v:count, 'decrease') + +" Bind C-/ to vscode commentary since calling from vscode produces double comments due to multiple cursors +xnoremap :call Comment() +nnoremap :call Comment() + +nnoremap _ :call VSCodeNotify('workbench.action.toggleEditorWidths') + +" nnoremap :call VSCodeCall('whichkey.show') +" xnoremap :call VSCodeCall('whichkey.show') + +nnoremap :call VSCodeNotify('whichkey.show') +xnoremap :call VSCodeNotify('whichkey.show')