mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-30 22:59:22 +02:00
better vscode support
This commit is contained in:
parent
3c07627b4d
commit
544b67d80a
7 changed files with 1379 additions and 108 deletions
33
README.md
33
README.md
|
@ -1,6 +1,5 @@
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
If you are looking for my old configs checkout the two snapshot branches
|
If you are looking for my old configs checkout the two snapshot branches
|
||||||
|
@ -23,16 +22,18 @@ sudo rm -r neovim
|
||||||
After installing the [Neovim
|
After installing the [Neovim
|
||||||
extension](https://github.com/asvetliakov/vscode-neovim) in VSCode
|
extension](https://github.com/asvetliakov/vscode-neovim) in VSCode
|
||||||
|
|
||||||
I recommend using this alongside the VSCode which-key extension
|
I recommend using this alongside the VSCode
|
||||||
|
[which-key](https://github.com/VSpaceCode/vscode-which-key) extension
|
||||||
|
|
||||||
Along with some of my config files you can find in utils/vscode\_config
|
You will also need `settings.json` and `keybindings.json` which can be
|
||||||
|
found in utils/vscode\_config
|
||||||
|
|
||||||
Point the nvim path to your `nvim` binary
|
Point the nvim path to your `nvim` binary
|
||||||
|
|
||||||
Point your `init.lua` path to:
|
Point your `init.vim` path to:
|
||||||
|
|
||||||
``` vim
|
``` vim
|
||||||
$HOME/.config/nvim/lua/nv-vscode/init.lua
|
$HOME/.config/nvim/vimscript/nv-vscode/init.vim
|
||||||
```
|
```
|
||||||
|
|
||||||
## Clipboard Support
|
## Clipboard Support
|
||||||
|
@ -138,24 +139,26 @@ git config --global github.user <username>
|
||||||
If you are looking for snippets checkout this github topic: [Snippet
|
If you are looking for snippets checkout this github topic: [Snippet
|
||||||
Topic](https://github.com/topics/vscode-snippets)
|
Topic](https://github.com/topics/vscode-snippets)
|
||||||
|
|
||||||
|
## De-bugging
|
||||||
|
|
||||||
|
To set up your particular debugger, look here:
|
||||||
|
[link](https://github.com/mfussenegger/nvim-dap/wiki/Debug-Adapter-installation)
|
||||||
|
|
||||||
## TODO
|
## TODO
|
||||||
|
|
||||||
**HIGH PRIORITY**
|
**HIGH PRIORITY**
|
||||||
|
|
||||||
- learn nvim-dap in depth
|
- better install script, simple install just support `~/.config/nvim`
|
||||||
|
path
|
||||||
|
|
||||||
|
**LOW PRIORITY**
|
||||||
|
|
||||||
- Implement what I can from this java config:
|
- Implement what I can from this java config:
|
||||||
[link](https://github.com/mfussenegger/nvim-jdtls/wiki/Sample-Configurations)
|
[link](https://github.com/mfussenegger/nvim-jdtls/wiki/Sample-Configurations)
|
||||||
- better ui for code actions - formatting
|
- better ui for code actions - formatting
|
||||||
- setup junit tests for java
|
- setup junit tests for java
|
||||||
- neovim light-bulb config
|
|
||||||
- better vscode support
|
|
||||||
|
|
||||||
|
|
||||||
**LOW PRIORITY**
|
|
||||||
|
|
||||||
- look into auto-install lsp
|
- look into auto-install lsp
|
||||||
- json config file (luajson)
|
- json config file (luajson)
|
||||||
- better install script, support both nvim and nvcode paths
|
|
||||||
- get logo
|
- get logo
|
||||||
- look into emmet-ls
|
- look into emmet-ls
|
||||||
- toggle virtual text diagnostics
|
- toggle virtual text diagnostics
|
||||||
|
@ -171,7 +174,5 @@ Topic](https://github.com/topics/vscode-snippets)
|
||||||
**PLUGIN BUGS**
|
**PLUGIN BUGS**
|
||||||
|
|
||||||
- finding files from dashboard sometimes number not set
|
- finding files from dashboard sometimes number not set
|
||||||
- spell not activated in readme Markdown
|
- better auto-import (jsx)
|
||||||
- better auto-import
|
|
||||||
- can't find global binary for markdown-lint
|
|
||||||
- keep and eye on indent guides plugin for thin lines
|
- keep and eye on indent guides plugin for thin lines
|
||||||
|
|
108
init.lua
108
init.lua
|
@ -1,61 +1,55 @@
|
||||||
-- vim.cmd('set rtp+=~/.config/nvcode')
|
-- General mappings
|
||||||
if vim.g.vscode then
|
require('plugins')
|
||||||
vim.cmd('source ~/.config/nvim/vimscript/nv-vscode/init.vim')
|
require('nv-utils')
|
||||||
require('settings')
|
require('settings')
|
||||||
require('nv-quickscope')
|
require('keymappings')
|
||||||
else
|
require('colorscheme')
|
||||||
-- General mappings
|
require('nv-galaxyline')
|
||||||
require('plugins')
|
|
||||||
require('nv-utils')
|
|
||||||
require('settings')
|
|
||||||
require('keymappings')
|
|
||||||
require('colorscheme')
|
|
||||||
require('nv-galaxyline')
|
|
||||||
|
|
||||||
-- Plugins
|
-- Plugins
|
||||||
require('nv-compe')
|
require('nv-compe')
|
||||||
require('nv-colorizer')
|
require('nv-colorizer')
|
||||||
require('nv-nvimtree')
|
require('nv-nvimtree')
|
||||||
require('nv-treesitter')
|
require('nv-treesitter')
|
||||||
require('nv-barbar')
|
require('nv-barbar')
|
||||||
require('nv-emmet')
|
require('nv-emmet')
|
||||||
require('nv-quickscope')
|
require('nv-quickscope')
|
||||||
require('nv-gitsigns')
|
require('nv-gitsigns')
|
||||||
require('nv-nvim-autopairs')
|
require('nv-nvim-autopairs')
|
||||||
require('nv-illuminate')
|
require('nv-illuminate')
|
||||||
require('nv-neogit')
|
require('nv-neogit')
|
||||||
require('nv-comment')
|
require('nv-comment')
|
||||||
require('nv-rnvimr')
|
require('nv-rnvimr')
|
||||||
require('nv-telescope')
|
require('nv-telescope')
|
||||||
require('nv-floaterm')
|
require('nv-floaterm')
|
||||||
require('nv-vim-rooter')
|
require('nv-vim-rooter')
|
||||||
require('nv-matchup')
|
require('nv-matchup')
|
||||||
require('nv-lspkind')
|
require('nv-lspkind')
|
||||||
require('nv-hop')
|
require('nv-hop')
|
||||||
require('nv-gitblame')
|
require('nv-gitblame')
|
||||||
require('nv-nvim-peekup')
|
require('nv-nvim-peekup')
|
||||||
require('nv-dashboard')
|
require('nv-dashboard')
|
||||||
require('nv-dial')
|
require('nv-dial')
|
||||||
|
require('nv-nvim-dap')
|
||||||
|
require('nv-lightbulb')
|
||||||
|
|
||||||
-- Which Key (Hope to replace with Lua plugin someday)
|
-- Which Key (Hope to replace with Lua plugin someday)
|
||||||
vim.cmd('source ~/.config/nvim/vimscript/nv-whichkey/init.vim')
|
vim.cmd('source ~/.config/nvim/vimscript/nv-whichkey/init.vim')
|
||||||
vim.cmd('source ~/.config/nvim/vimscript/functions.vim')
|
vim.cmd('source ~/.config/nvim/vimscript/functions.vim')
|
||||||
|
|
||||||
-- LSP
|
|
||||||
require('lsp')
|
|
||||||
require('lsp.lua-ls')
|
|
||||||
require('lsp.bash-ls')
|
|
||||||
require('lsp.js-ts-ls')
|
|
||||||
require('lsp.python-ls')
|
|
||||||
require('lsp.json-ls')
|
|
||||||
require('lsp.yaml-ls')
|
|
||||||
require('lsp.vim-ls')
|
|
||||||
require('lsp.graphql-ls')
|
|
||||||
require('lsp.css-ls')
|
|
||||||
require('lsp.docker-ls')
|
|
||||||
require('lsp.html-ls')
|
|
||||||
require('lsp.efm-general-ls')
|
|
||||||
require('lsp.virtual_text')
|
|
||||||
end
|
|
||||||
|
|
||||||
|
-- LSP
|
||||||
|
require('lsp')
|
||||||
|
require('lsp.lua-ls')
|
||||||
|
require('lsp.bash-ls')
|
||||||
|
require('lsp.js-ts-ls')
|
||||||
|
require('lsp.python-ls')
|
||||||
|
require('lsp.json-ls')
|
||||||
|
require('lsp.yaml-ls')
|
||||||
|
require('lsp.vim-ls')
|
||||||
|
require('lsp.graphql-ls')
|
||||||
|
require('lsp.css-ls')
|
||||||
|
require('lsp.docker-ls')
|
||||||
|
require('lsp.html-ls')
|
||||||
|
require('lsp.efm-general-ls')
|
||||||
|
require('lsp.virtual_text')
|
||||||
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
Lua
|
|
||||||
Yaml
|
|
||||||
Json
|
|
||||||
Javascript
|
|
||||||
CSS
|
|
||||||
github
|
|
||||||
TODO
|
|
||||||
nvim
|
|
||||||
dap
|
|
||||||
java
|
|
||||||
config
|
|
||||||
junit
|
|
||||||
ui
|
|
||||||
neovim
|
|
||||||
vscode
|
|
||||||
lsp
|
|
||||||
json
|
|
||||||
luajson
|
|
||||||
nvcode
|
|
||||||
emmet
|
|
||||||
neogit
|
|
||||||
kshenoy
|
|
||||||
PLUGIN
|
|
||||||
readme
|
|
||||||
plugin
|
|
||||||
VSCode
|
|
||||||
utils
|
|
||||||
Ubuntu
|
|
||||||
efm
|
|
||||||
NVCode
|
|
||||||
repo
|
|
||||||
CoC
|
|
||||||
configs
|
|
Binary file not shown.
171
utils/vscode_config/keybindings.json
Normal file
171
utils/vscode_config/keybindings.json
Normal file
|
@ -0,0 +1,171 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"key": "shift+ctrl+e",
|
||||||
|
"command": "actions.findWithSelection"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+e",
|
||||||
|
"command": "-actions.findWithSelection"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+e",
|
||||||
|
"command": "workbench.view.explorer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "shift+ctrl+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": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "k",
|
||||||
|
"command": "list.focusUp",
|
||||||
|
"when": "explorerViewletVisible && filesExplorerFocus && !explorerResourceIsRoot && !explorerResourceReadonly && !inputFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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": "shift+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 && !inputFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "o",
|
||||||
|
"command": "list.toggleExpand",
|
||||||
|
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "h",
|
||||||
|
"command": "list.collapse",
|
||||||
|
"when": "explorerViewletVisible && filesExplorerFocus && !inputFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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+shift+t",
|
||||||
|
"command": "workbench.action.terminal.focus",
|
||||||
|
"when": "!terminalFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+j",
|
||||||
|
"command": "-editor.action.insertLineAfter",
|
||||||
|
"when": "editorTextFocus && neovim.ctrlKeysInsert && !neovim.recording && neovim.mode == 'insert'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "alt+j",
|
||||||
|
"command": "workbench.action.terminal.focus",
|
||||||
|
"when": "!terminalFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+shift+t",
|
||||||
|
"command": "workbench.action.togglePanel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+j",
|
||||||
|
"command": "-workbench.action.togglePanel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "shift+k",
|
||||||
|
"command": "editor.action.showHover",
|
||||||
|
"when": "editorTextFocus && neovim.mode != 'insert'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+k ctrl+i",
|
||||||
|
"command": "-editor.action.showHover",
|
||||||
|
"when": "editorTextFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "shift+tab",
|
||||||
|
"command": "-acceptAlternativeSelectedSuggestion",
|
||||||
|
"when": "suggestWidgetVisible && textInputFocus && textInputFocus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "ctrl+f",
|
||||||
|
"command": "-vscode-neovim.ctrl-f",
|
||||||
|
"when": "editorTextFocus && neovim.ctrlKeysNormal && neovim.init && neovim.mode != 'insert'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "space",
|
||||||
|
"command": "whichkey.show",
|
||||||
|
"when": "neovim.mode != 'insert'"
|
||||||
|
}
|
||||||
|
]
|
1128
utils/vscode_config/settings.json
Normal file
1128
utils/vscode_config/settings.json
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,15 @@
|
||||||
" TODO there is a more contemporary version of this file
|
" TODO there is a more contemporary version of this file
|
||||||
" TODO Also some of it is redundant
|
" TODO Also some of it is redundant
|
||||||
|
packadd quickscope
|
||||||
|
|
||||||
|
luafile ~/.config/nvim/lua/settings.lua
|
||||||
|
|
||||||
|
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
|
||||||
|
|
||||||
|
highlight QuickScopePrimary guifg='#00C7DF' gui=underline ctermfg=155 cterm=underline
|
||||||
|
highlight QuickScopeSecondary guifg='#eF5F70' gui=underline ctermfg=81 cterm=underline
|
||||||
|
let g:qs_max_chars=150
|
||||||
|
|
||||||
"VSCode
|
"VSCode
|
||||||
function! s:split(...) abort
|
function! s:split(...) abort
|
||||||
let direction = a:1
|
let direction = a:1
|
||||||
|
@ -105,5 +115,5 @@ omap gc <Plug>VSCodeCommentary
|
||||||
nmap gcc <Plug>VSCodeCommentaryLine
|
nmap gcc <Plug>VSCodeCommentaryLine
|
||||||
|
|
||||||
" Simulate same TAB behavior in VSCode
|
" Simulate same TAB behavior in VSCode
|
||||||
nmap <Tab> :Tabnext<CR>
|
nmap <Tab> :Tabnext<CR>
|
||||||
nmap <S-Tab> :Tabprev<CR>
|
nmap <S-Tab> :Tabprev<CR>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue