better vscode support

This commit is contained in:
Chris 2021-03-22 22:09:11 -04:00
parent 3c07627b4d
commit 544b67d80a
7 changed files with 1379 additions and 108 deletions

View file

@ -1,6 +1,5 @@
![NVCode Logo](./utils/media/nvcode_logo.png)
![NVCode Demo](./utils/media/demo.png)
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
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 your `init.lua` path to:
Point your `init.vim` path to:
``` vim
$HOME/.config/nvim/lua/nv-vscode/init.lua
$HOME/.config/nvim/vimscript/nv-vscode/init.vim
```
## Clipboard Support
@ -138,24 +139,26 @@ git config --global github.user <username>
If you are looking for snippets checkout this github topic: [Snippet
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
**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:
[link](https://github.com/mfussenegger/nvim-jdtls/wiki/Sample-Configurations)
- better ui for code actions - formatting
- setup junit tests for java
- neovim light-bulb config
- better vscode support
**LOW PRIORITY**
- look into auto-install lsp
- json config file (luajson)
- better install script, support both nvim and nvcode paths
- get logo
- look into emmet-ls
- toggle virtual text diagnostics
@ -171,7 +174,5 @@ Topic](https://github.com/topics/vscode-snippets)
**PLUGIN BUGS**
- finding files from dashboard sometimes number not set
- spell not activated in readme Markdown
- better auto-import
- can't find global binary for markdown-lint
- better auto-import (jsx)
- keep and eye on indent guides plugin for thin lines

108
init.lua
View file

@ -1,61 +1,55 @@
-- vim.cmd('set rtp+=~/.config/nvcode')
if vim.g.vscode then
vim.cmd('source ~/.config/nvim/vimscript/nv-vscode/init.vim')
require('settings')
require('nv-quickscope')
else
-- General mappings
require('plugins')
require('nv-utils')
require('settings')
require('keymappings')
require('colorscheme')
require('nv-galaxyline')
-- General mappings
require('plugins')
require('nv-utils')
require('settings')
require('keymappings')
require('colorscheme')
require('nv-galaxyline')
-- Plugins
require('nv-compe')
require('nv-colorizer')
require('nv-nvimtree')
require('nv-treesitter')
require('nv-barbar')
require('nv-emmet')
require('nv-quickscope')
require('nv-gitsigns')
require('nv-nvim-autopairs')
require('nv-illuminate')
require('nv-neogit')
require('nv-comment')
require('nv-rnvimr')
require('nv-telescope')
require('nv-floaterm')
require('nv-vim-rooter')
require('nv-matchup')
require('nv-lspkind')
require('nv-hop')
require('nv-gitblame')
require('nv-nvim-peekup')
require('nv-dashboard')
require('nv-dial')
-- Plugins
require('nv-compe')
require('nv-colorizer')
require('nv-nvimtree')
require('nv-treesitter')
require('nv-barbar')
require('nv-emmet')
require('nv-quickscope')
require('nv-gitsigns')
require('nv-nvim-autopairs')
require('nv-illuminate')
require('nv-neogit')
require('nv-comment')
require('nv-rnvimr')
require('nv-telescope')
require('nv-floaterm')
require('nv-vim-rooter')
require('nv-matchup')
require('nv-lspkind')
require('nv-hop')
require('nv-gitblame')
require('nv-nvim-peekup')
require('nv-dashboard')
require('nv-dial')
require('nv-nvim-dap')
require('nv-lightbulb')
-- 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/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
-- 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/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')

View file

@ -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.

View 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'"
}
]

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,15 @@
" TODO there is a more contemporary version of this file
" 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
function! s:split(...) abort
let direction = a:1
@ -105,5 +115,5 @@ omap gc <Plug>VSCodeCommentary
nmap gcc <Plug>VSCodeCommentaryLine
" Simulate same TAB behavior in VSCode
nmap <Tab> :Tabnext<CR>
nmap <S-Tab> :Tabprev<CR>
nmap <Tab> :Tabnext<CR>
nmap <S-Tab> :Tabprev<CR>