From 474f961b2a31c0fe8281188150c08cc2849bf4df Mon Sep 17 00:00:00 2001 From: Christian Chiarulli Date: Tue, 9 Mar 2021 23:55:11 -0500 Subject: Native LSP, more Lua, less CoC --- .gitignore | 1 + README.md | 122 +++++++---------- coc-settings.json | 155 --------------------- general/functions.vim | 4 + general/settings.vim | 2 +- init.vim | 120 +++++++++------- keys/which-key.vim | 110 ++++----------- lua/config-telescope.lua | 76 ----------- lua/lsp-wrapper.lua | 258 +++++++++++++++++++++++++++++++++++ lua/lsp-wrapper.vim | 27 ++++ lua/lsp/bash-ls.lua | 3 + lua/lsp/css-ls.lua | 3 + lua/lsp/docker-ls.lua | 3 + lua/lsp/graphql-ls.lua | 3 + lua/lsp/html-ls.lua | 11 ++ lua/lsp/javascript-ls.lua | 3 + lua/lsp/json-ls.lua | 11 ++ lua/lsp/lsp-config.lua | 61 +++++++++ lua/lsp/lsp-kind.lua | 27 ++++ lua/lsp/lua-ls.lua | 42 ++++++ lua/lsp/python-ls.lua | 3 + lua/lsp/vim-ls.lua | 3 + lua/lsp/yaml-ls.lua | 3 + lua/nvcodeline.lua | 271 ------------------------------------- lua/plug-colorizer.lua | 15 -- lua/plugins/colorizer-config.lua | 15 ++ lua/plugins/compe-config.lua | 73 ++++++++++ lua/plugins/galaxyline-config.lua | 271 +++++++++++++++++++++++++++++++++++++ lua/plugins/lspsaga-config.lua | 2 + lua/plugins/nvimtree-config.lua | 31 +++++ lua/plugins/telescope-config.lua | 76 +++++++++++ lua/plugins/treesitter-config.lua | 33 +++++ lua/treesitter.lua | 33 ----- plug-config/coc/coc-extensions.vim | 33 ----- plug-config/coc/coc.vim | 171 ----------------------- plug-config/gitgutter.vim | 1 + plug-config/lsp-config.vim | 14 ++ plug-config/nvimtree-config.vim | 45 ++++++ spell/en.utf-8.add | 1 + spell/en.utf-8.add.spl | Bin 0 -> 31 bytes utils/install_latest_neovim.sh | 9 ++ vim-plug/extras.vim | 84 ++++++++++++ vim-plug/plugins.vim | 138 +++++-------------- 43 files changed, 1301 insertions(+), 1066 deletions(-) delete mode 100644 coc-settings.json delete mode 100644 lua/config-telescope.lua create mode 100644 lua/lsp-wrapper.lua create mode 100644 lua/lsp-wrapper.vim create mode 100644 lua/lsp/bash-ls.lua create mode 100644 lua/lsp/css-ls.lua create mode 100644 lua/lsp/docker-ls.lua create mode 100644 lua/lsp/graphql-ls.lua create mode 100644 lua/lsp/html-ls.lua create mode 100644 lua/lsp/javascript-ls.lua create mode 100644 lua/lsp/json-ls.lua create mode 100644 lua/lsp/lsp-config.lua create mode 100644 lua/lsp/lsp-kind.lua create mode 100644 lua/lsp/lua-ls.lua create mode 100644 lua/lsp/python-ls.lua create mode 100644 lua/lsp/vim-ls.lua create mode 100644 lua/lsp/yaml-ls.lua delete mode 100644 lua/nvcodeline.lua delete mode 100644 lua/plug-colorizer.lua create mode 100644 lua/plugins/colorizer-config.lua create mode 100644 lua/plugins/compe-config.lua create mode 100644 lua/plugins/galaxyline-config.lua create mode 100644 lua/plugins/lspsaga-config.lua create mode 100644 lua/plugins/nvimtree-config.lua create mode 100644 lua/plugins/telescope-config.lua create mode 100644 lua/plugins/treesitter-config.lua delete mode 100644 lua/treesitter.lua delete mode 100644 plug-config/coc/coc-extensions.vim delete mode 100644 plug-config/coc/coc.vim create mode 100644 plug-config/lsp-config.vim create mode 100644 plug-config/nvimtree-config.vim create mode 100644 spell/en.utf-8.add create mode 100644 spell/en.utf-8.add.spl create mode 100755 utils/install_latest_neovim.sh create mode 100644 vim-plug/extras.vim diff --git a/.gitignore b/.gitignore index fc5da9f1..364e4a08 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ session wiki/ pack/ utils/java/* +lua-language-server/ diff --git a/README.md b/README.md index 69ebf1c7..675ebbb9 100644 --- a/README.md +++ b/README.md @@ -8,55 +8,44 @@ The following will install this config if you have an existing config it will mo This script only supports Mac, Ubuntu and Arch -``` +```bash bash <(curl -s https://raw.githubusercontent.com/ChristianChiarulli/nvim/master/utils/install.sh) ``` ## Install Neovim -- Mac - - ``` - brew install --HEAD neovim # Nightly version - - brew upgrade neovim --fetch-HEAD # Sometimes you need to update - ``` - -- Ubuntu - - ``` - curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage -o /tmp/nvim.appimage - - sudo mv /tmp/nvim.appimage /usr/local/bin/nvim +To get the latest and greatest: - chmod +x /usr/local/bin/nvim - ``` - -- Arch +```bash +cd ~ +sudo rm -r neovim +git clone https://github.com/neovim/neovim +cd neovim +sudo make CMAKE_BUILD_TYPE=Release install +cd ~ +sudo rm -r neovim +``` - ``` - yay -S neovim-git # Latest - ``` ## Clone this repo into your config -``` +```bash git clone https://github.com/ChristianChiarulli/nvim.git ~/.config/nvim ``` ## Install python & node support -``` +```bash pip install pynvim ``` -``` +```bash npm i -g neovim ``` ## Install Neovim remote -``` +```bash pip install neovim-remote ``` @@ -72,13 +61,13 @@ export PATH=$HOME/.local/bin:$PATH - Ubuntu - ``` + ```bash sudo apt install xsel ``` - Arch - ``` + ```bash sudo pacman -S xsel ``` @@ -104,56 +93,45 @@ let g:node_host_prog = expand("~/.nvm/versions/node/v12.16.1/bin/neovim-node-hos - universal-ctags - lazy git - lazy docker +- ninja (for lua lsp) Explanations and installation instruction can be found on my blog ## Language Servers -Since CoC doesn't support all languages in there extensions -I recommend installing some language servers from scratch -and adding them to your `coc-settings.json` file +Some example language servers, if you just install them they will work with this config -Example: - -- bash +```bash +npm i -g pyright +npm i -g bash-language-server +npm install -g vscode-css-languageserver-bin +npm install -g dockerfile-language-server-nodejs +npm install -g graphql-language-service-cli +npm install -g vscode-html-languageserver-bin +npm install -g typescript typescript-language-server +npm install -g vscode-json-languageserver +npm install -g vim-language-server +npm install -g yaml-language-server +``` - `npm i -g bash-language-server` +Go [here](https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md) - ``` - "languageserver": { - "bash": { - "command": "bash-language-server", - "args": ["start"], - "filetypes": ["sh"], - "ignoredRootPaths": ["~"] - } - } - ``` +How to install the lua language server: [link](https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)) ## For FAR to work -``` +```vim :UpdateRemotePlugins ``` To replace in file make sure to specify `%:p` To replace across project specify `**/*.` -## TabNine - -To use TabNine enter the following in a buffer: - -``` -TabNine::config -``` - -**NOTE** This extension can take up a ton of memory - ## Vim Gists To use **vim-gists** you will need to configure the following: -``` +```bash git config --global github.user ``` @@ -165,19 +143,19 @@ You can install it on multiple platforms: - Mac - ``` + ```bash brew cask install vscodium ``` - Arch - ``` + ```bash yay -s vscodium-bin ``` - Snap - ``` + ```bash snap install codium ``` @@ -191,35 +169,27 @@ Along with some of my config files you can find in `utils/vscode_config` - Better Documentation https://github.com/gennaro-tedesco/nvim-jqx - https://github.com/nathunsmitty/nvim-ale-diagnostic + https://github.com/mattn/efm-langserver - https://github.com/windwp/nvim-ts-closetag + https://github.com/nvim-telescope/telescope-media-files.nvim - https://github.com/kosayoda/nvim-lightbulb - https://github.com/ms-jpq/chadtree + https://github.com/b3nj5m1n/kommentary - https://github.com/glepnir/lspsaga.nvim - https://github.com/nvim-lua/completion-nvim - https://github.com/nvim-telescope/telescope-frecency.nvim -## CoC extensions to check out + https://github.com/nvim-lua/completion-nvim -- coc-fzf-preview - - https://github.com/yuki-ycino/fzf-preview.vim/ -- coc-floaterm + https://github.com/nvim-telescope/telescope-frecency.nvim ## 0.5 -- native lsp -- treesitter +- native lsp (in progress) +- treesitter (in progress) ## LOW PRIORITY TODO If anyone reading this has any suggestions about implementing any of the following I will accept a PR, but these are not priority. -- ale - multiple cursors -- markdown table - galaxyline automatically grab colors from colorscheme - tpope/vim-dadbod - neovide @@ -227,6 +197,6 @@ If anyone reading this has any suggestions about implementing any of the followi - vimspector this is included but I don't plan on using it much - can be used with jdb, pdb, gdb, etc... - nvim-dap and nvim-dap-virtual-text (ALL DEBUGGING IN NEOVIM IS CONFUSING AND HARD TO GET WORKING OR I'M JUST DUMB) -- later manually link pylance +- potentially manually link pylance - resize with arrows in addition to meta - how to support meta key on for macOS? diff --git a/coc-settings.json b/coc-settings.json deleted file mode 100644 index d8ae6d80..00000000 --- a/coc-settings.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - // suggestions - // "suggest.echodocSupport": true, -/* https://code.visualstudio.com/docs/editor/intellisense reference for vscode symbols*/ -/* https://www.nerdfonts.com/cheat-sheet reference to find some other symbols*/ - /* some symbols you might like: פּ                 */ - /* fb44 this is the hex for nf-mdi-file_tree, should be good for class*/ - "suggest.completionItemKindLabels": { - "method": "  ", - "function": "  ", - "variable": "[]", - "field": "  ", - "typeParameter": "<>", - "constant": "  ", - "class": "  ", - "interface": " 蘒", - "struct": "  ", - "event": "  ", - "operator": "  ", - "module": "  ", - "property": "  ", - "enum": " 練", - "reference": "  ", - "keyword": "  ", - "file": "  ", - "folder": " ﱮ ", - "color": "  ", - "unit": " 塞 ", - "snippet": "  ", - "text": "  ", - "constructor": "  ", - "value": "  ", - "enumMember": "  ", - "default": "  " - }, - "snippets.priority": 1, - //"yank.priority": 1, - "suggest.languageSourcePriority": 99, - "coc.source.file.priority": 2, - "coc.source.around.priority": 3, - "coc.source.buffer.priority": 4, - - // diagnostics - "diagnostic.errorSign": " ", - "diagnostic.warningSign": " ", - "diagnostic.infoSign": "", - "diagnostic.hintSign": " ", - // "diagnostic.displayByAle": true, - // "diagnostic.virtualText": true, // this won't work with codelens when error on same line - - // codelens - "codeLens.enable": true, - "java.referencesCodeLens.enabled": true, - "java.implementationsCodeLens.enabled": true, - "java.completion.enabled": true, - "java.jdt.ls.vmargs": "-javaagent:/usr/local/share/lombok/lombok.jar", - - // list - "list.indicator": ">", - "list.selectedSignText": " ", - - // autoformat - "coc.preferences.formatOnSaveFiletypes": [ - "css", - "markdown", - "javascript", - "graphql", - "html", - "yaml", - "json", - "python", - "java" - ], - "coc.preferences.hoverTarget": "float", - - // python config - "python.analysis.autoImportCompletions": true, - "python.analysis.autoSearchPaths": true, - "python.analysis.diagnosticMode": "openFilesOnly", - "python.analysis.stubPath": "typings", - "python.analysis.typeshedPaths": [], - "python.analysis.diagnosticSeverityOverrides": {}, - "python.analysis.typeCheckingMode": "basic", - "python.analysis.useLibraryCodeForTypes": true, - "python.pythonPath": "python", - "python.venvPath": "", - "python.formatting.provider": "black", - "python.formatting.blackPath": "~/.local/bin/black", - "python.formatting.blackArgs": [], - "python.formatting.autopep8Path": "autopep8", - "python.formatting.autopep8Args": [], - "python.formatting.yapfPath": "yapf", - "python.formatting.yapfArgs": [], - "python.linting.enabled": true, - "python.linting.flake8Enabled": false, - "python.linting.banditEnabled": false, - "python.linting.mypyEnabled": false, - "python.linting.pytypeEnabled": false, - "python.linting.prospectorEnabled": false, - "python.linting.pydocstyleEnabled": false, - "python.linting.pylamaEnabled": false, - "python.linting.pylintEnabled": false, - - // snippets - "snippets.ultisnips.directories": ["UltiSnips", "~/.config/nvim/snips"], - //"snippets.userSnippetsDirectory": "~/.config/nvim/snips", - - // emmet - "emmet.includeLanguages": { - "vue-html": "html", - "javascript": "javascriptreact" - }, - - // CSS (disable since I'm also using stylelintplus) - "css.validate": false, - "less.validate": false, - "scss.validate": false, - "wxss.validate": false, - - // explorer - "explorer.width": 30, - "explorer.file.root.template": "[icon] [git] [hidden & 1][root]", - "explorer.icon.enableNerdfont": true, - "explorer.previewAction.onHover": false, - "explorer.icon.enableVimDevicons": false, - "explorer.file.showHiddenFiles": false, - "explorer.keyMappings.global": { - "": ["expandable?", "expand", "open"], - "v": "open:vsplit" - }, - - /* "languageserver": { */ - /* "lua": { */ - /* "command": "/home/chris/.luambenvs/neovim4/bin/lua-lsp", */ - /* "filetypes": ["lua"], */ - /* "trace.server": "verbose" */ - /* } */ - /* }, */ - - //coc-emoji - "coc.source.emoji.filetypes": ["markdown"] - - // lua - //"lua.useSumnekoLs": true, - //"lua.commandPath": "/home/chris/.luambenvs/neovim3/bin/lua-lsp" - //"lua.enable": true, - //"Lua.completion.enable": true, - //"Lua.runtime.version": "Lua 5.1", - //"Lua.runtime.path": ["?.lua", "?/init.lua", "?/?.lua"], - //"lua.version": "5.1" - //"lua.commandPath": "/home/chris/.vscode-insiders/extensions/sumneko.lua-1.0.5/server/bin/Linux/lua-language-server" - - // TODO b:coc_suggest_disable=1 GOYO - // TODO add to paths.vim g:coc_node_path -} diff --git a/general/functions.vim b/general/functions.vim index e5424ca3..9f62d227 100644 --- a/general/functions.vim +++ b/general/functions.vim @@ -9,3 +9,7 @@ nnoremap :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" +augroup highlight_yank + autocmd! + au TextYankPost * silent! lua vim.highlight.on_yank { higroup='IncSearch', timeout=200 } +augroup END diff --git a/general/settings.vim b/general/settings.vim index b94676d6..c98db005 100644 --- a/general/settings.vim +++ b/general/settings.vim @@ -35,7 +35,7 @@ set updatetime=300 " Faster completion set timeoutlen=100 " By default timeoutlen is 1000 ms set clipboard=unnamedplus " Copy paste between vim and everything else set incsearch -set guifont=JetBrainsMono\ Nerd\ Font\ Mono +set guifont=JetBrainsMono\ Nerd\ Font\ Mono:h22 " New stuff " set notimeout nottimeout diff --git a/init.vim b/init.vim index ecafaeac..3cf40d62 100644 --- a/init.vim +++ b/init.vim @@ -4,64 +4,70 @@ " _/ // / / / / /__| |/ / / / / / / / "/___/_/ /_/_/\__(_)___/_/_/ /_/ /_/ - " General Settings if !exists('g:vscode') - source $HOME/.config/nvim/plug-config/polyglot.vim + source ~/.config/nvim/plug-config/polyglot.vim endif -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 ~/.config/nvim/vim-plug/plugins.vim +source ~/.config/nvim/general/settings.vim +source ~/.config/nvim/general/functions.vim +source ~/.config/nvim/keys/mappings.vim if exists('g:vscode') " VS Code extension - source $HOME/.config/nvim/vscode/settings.vim - source $HOME/.config/nvim/plug-config/easymotion.vim - source $HOME/.config/nvim/plug-config/highlightyank.vim + source ~/.config/nvim/vscode/settings.vim + source ~/.config/nvim/plug-config/easymotion.vim + source ~/.config/nvim/plug-config/highlightyank.vim else " Themes - source $HOME/.config/nvim/themes/syntax.vim - source $HOME/.config/nvim/themes/nvcode.vim + source ~/.config/nvim/themes/syntax.vim + source ~/.config/nvim/themes/nvcode.vim " Plugin Configuration - source $HOME/.config/nvim/keys/which-key.vim - source $HOME/.config/nvim/plug-config/vim-commentary.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/codi.vim - source $HOME/.config/nvim/plug-config/vim-wiki.vim - luafile $HOME/.config/nvim/lua/nvcodeline.lua - luafile $HOME/.config/nvim/lua/treesitter.lua - source $HOME/.config/nvim/plug-config/coc/coc.vim - source $HOME/.config/nvim/plug-config/coc/coc-extensions.vim - source $HOME/.config/nvim/plug-config/easymotion.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/barbar.vim - source $HOME/.config/nvim/plug-config/far.vim - source $HOME/.config/nvim/plug-config/tagalong.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/neovide.vim - luafile $HOME/.config/nvim/lua/plug-colorizer.lua - luafile $HOME/.config/nvim/lua/config-telescope.lua - source $HOME/.config/nvim/plug-config/vimspector.vim - " source $HOME/.config/nvim/plug-config/sneak.vim - " source $HOME/.config/nvim/plug-config/rainbow.vim - " source $HOME/.config/nvim/plug-config/illuminate.vim - " source $HOME/.config/nvim/plug-config/vista.vim - " source $HOME/.config/nvim/plug-config/xtabline.vim - " source $HOME/.config/nvim/plug-config/ale.vim + source ~/.config/nvim/keys/which-key.vim + source ~/.config/nvim/plug-config/vim-commentary.vim + source ~/.config/nvim/plug-config/rnvimr.vim + source ~/.config/nvim/plug-config/codi.vim + source ~/.config/nvim/plug-config/vim-wiki.vim + source ~/.config/nvim/plug-config/easymotion.vim + source ~/.config/nvim/plug-config/goyo.vim + source ~/.config/nvim/plug-config/vim-rooter.vim + source ~/.config/nvim/plug-config/start-screen.vim + source ~/.config/nvim/plug-config/gitgutter.vim + source ~/.config/nvim/plug-config/git-messenger.vim + source ~/.config/nvim/plug-config/closetags.vim + source ~/.config/nvim/plug-config/floaterm.vim + source ~/.config/nvim/plug-config/barbar.vim + source ~/.config/nvim/plug-config/far.vim + source ~/.config/nvim/plug-config/tagalong.vim + source ~/.config/nvim/plug-config/bracey.vim + source ~/.config/nvim/plug-config/markdown-preview.vim + source ~/.config/nvim/plug-config/nvimtree-config.vim + source ~/.config/nvim/lua/lsp-wrapper.vim + luafile ~/.config/nvim/lua/plugins/galaxyline-config.lua + luafile ~/.config/nvim/lua/plugins/nvimtree-config.lua + luafile ~/.config/nvim/lua/plugins/treesitter-config.lua + luafile ~/.config/nvim/lua/plugins/colorizer-config.lua + luafile ~/.config/nvim/lua/plugins/telescope-config.lua + luafile ~/.config/nvim/lua/lsp/lsp-kind.lua + luafile ~/.config/nvim/lua/plugins/compe-config.lua + luafile ~/.config/nvim/lua/plugins/lspsaga-config.lua + " LSP + source ~/.config/nvim/plug-config/lsp-config.vim + luafile ~/.config/nvim/lua/lsp/lsp-config.lua + luafile ~/.config/nvim/lua/lsp/lua-ls.lua + luafile ~/.config/nvim/lua/lsp/python-ls.lua + luafile ~/.config/nvim/lua/lsp/bash-ls.lua + luafile ~/.config/nvim/lua/lsp/css-ls.lua + luafile ~/.config/nvim/lua/lsp/docker-ls.lua + luafile ~/.config/nvim/lua/lsp/graphql-ls.lua + luafile ~/.config/nvim/lua/lsp/html-ls.lua + luafile ~/.config/nvim/lua/lsp/javascript-ls.lua + luafile ~/.config/nvim/lua/lsp/json-ls.lua + luafile ~/.config/nvim/lua/lsp/vim-ls.lua + luafile ~/.config/nvim/lua/lsp/yaml-ls.lua + " https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md endif source $HOME/.config/nvim/plug-config/quickscope.vim @@ -73,3 +79,23 @@ endif " Better nav for omnicomplete TODO figure out why this is being overridden inoremap ("\") inoremap ("\") + +" TODO highlight groups for native LSP diagnostics +" add back other docs for compe +nnoremap K lua require('lspsaga.hover').render_hover_doc() + +" -- scroll down hover doc or scroll in definition preview +nnoremap lua require('lspsaga.action').smart_scroll_with_saga(1) +" -- scroll up hover doc +nnoremap lua require('lspsaga.action').smart_scroll_with_saga(-1) +" signature +nnoremap gs lua require('lspsaga.signaturehelp').signature_help() + + +" Lightbulb +autocmd CursorHold,CursorHoldI * lua require'nvim-lightbulb'.update_lightbulb() + +"TODO +" fix space and tab triggering completion all the time +" autoimport jsx +" snippets diff --git a/keys/which-key.vim b/keys/which-key.vim index 048766a4..0b5a81bf 100644 --- a/keys/which-key.vim +++ b/keys/which-key.vim @@ -1,5 +1,4 @@ " Leader Key Maps - let @s = 'veS"' " Timeout @@ -17,10 +16,6 @@ let g:which_key_map = {} let g:which_key_sep = '→' " set timeoutlen=100 -" Coc Search & refactor -nnoremap ? :CocSearch =expand("") -let g:which_key_map['?'] = 'search word' - " Not a fan of floating windows for this let g:which_key_use_floating_win = 0 let g:which_key_max_size = 0 @@ -39,15 +34,17 @@ autocmd FileType which_key set laststatus=0 noshowmode noruler " Single mappings let g:which_key_map['/'] = [ ':call Comment()' , 'comment' ] +let g:which_key_map['?'] = [ ':NvimTreeFindFile' , 'comment' ] let g:which_key_map['.'] = [ ':e $MYVIMRC' , 'open init' ] let g:which_key_map[';'] = [ ':Commands' , 'commands' ] let g:which_key_map['='] = [ '=' , 'balance windows' ] -let g:which_key_map['e'] = [ ':CocCommand explorer --toggle --sources=file+' , 'explorer' ] +let g:which_key_map['e'] = [ ':NvimTreeToggle' , 'explorer' ] let g:which_key_map['h'] = [ 's' , 'split below'] let g:which_key_map['n'] = [ ':let @/ = ""' , 'no highlight' ] let g:which_key_map['o'] = [ ':RnvimrToggle' , 'open' ] let g:which_key_map['p'] = [ ':Files' , 'search files' ] -let g:which_key_map['q'] = [ '(coc-fix-current)' , 'quickfix' ] +" TODO fix this +" let g:which_key_map['q'] = [ ':q' , 'quit' ] let g:which_key_map['T'] = [ ':TSHighlightCapturesUnderCursor' , 'treesitter highlight' ] let g:which_key_map['u'] = [ ':UndotreeToggle' , 'undo tree'] let g:which_key_map['v'] = [ 'v' , 'split right'] @@ -156,37 +153,7 @@ let g:which_key_map.m = { " CoC throws an error " \ 'a' : [':CocCommand bookmark.annotate', 'annotate bookmark'], -" " s is for search -" let g:which_key_map.s = { -" \ 'name' : '+search' , -" \ '/' : [':History/' , 'history'], -" \ ';' : [':Commands' , 'commands'], -" \ 'a' : [':Ag' , 'text Ag'], -" \ 'b' : [':BLines' , 'current buffer'], -" \ 'B' : [':Buffers' , 'open buffers'], -" \ 'c' : [':Commits' , 'commits'], -" \ 'C' : [':BCommits' , 'buffer commits'], -" \ 'f' : [':Files' , 'files'], -" \ 'g' : [':GFiles' , 'git files'], -" \ 'G' : [':GFiles?' , 'modified git files'], -" \ 'h' : [':History' , 'file history'], -" \ 'H' : [':History:' , 'command history'], -" \ 'l' : [':Lines' , 'lines'] , -" \ 'm' : [':Marks' , 'marks'] , -" \ 'M' : [':Maps' , 'normal maps'] , -" \ 'p' : [':Helptags' , 'help tags'] , -" \ 'P' : [':Tags' , 'project tags'], -" \ 's' : [':CocList snippets' , 'snippets'], -" \ 'S' : [':Colors' , 'color schemes'], -" \ 't' : [':Rg' , 'text Rg'], -" \ 'T' : [':BTags' , 'buffer tags'], -" \ 'w' : [':Windows' , 'search windows'], -" \ 'y' : [':Filetypes' , 'file types'], -" \ 'z' : [':FZF' , 'FZF'], -" \ } - " \ 's' : [':Snippets' , 'snippets'], -" TODO fix FZF preview or just move to Telescope " s is for search powered by telescope let g:which_key_map.s = { \ 'name' : '+search' , @@ -225,17 +192,6 @@ let g:which_key_map.s = { \ 'u' : [':Telescope colorscheme' , 'colorschemes'], \ 'z' : [':Telescope current_buffer_fuzzy_find' , 'buf_fuz_find'], \ } -" -" :CocCommand fzf-preview.AllBuffers -" :CocCommand fzf-preview.Changes -" :CocCommand fzf-preview.Yankround -" :CocCommand fzf-preview.CocReferences -" :CocCommand fzf-preview.CocDiagnostics -" :CocCommand fzf-preview.CocCurrentDiagnostics -" :CocCommand fzf-preview.CocTypeDefinitions -" \ 'l' : [':CocCommand fzf-preview.Bookmarks', 'list bookmarks'], -" $FZF_PREVIEW_PREVIEW_BAT_THEME = 'ansi-dark' -" let g:which_key_map.S = { \ 'name' : '+Session' , @@ -297,46 +253,34 @@ let g:which_key_map.G = { " l is for language server protocol let g:which_key_map.l = { \ 'name' : '+lsp' , - \ '.' : [':CocConfig' , 'config'], - \ ';' : ['(coc-refactor)' , 'refactor'], - \ 'a' : ['(coc-codeaction)' , 'code action'], - \ 'A' : ['(coc-codeaction-selected)' , 'selected action'], - \ 'b' : [':CocNext' , 'next action'], - \ 'B' : [':CocPrev' , 'prev action'], - \ 'c' : [':CocList commands' , 'commands'], - \ 'd' : ['(coc-definition)' , 'definition'], - \ 'D' : ['(coc-declaration)' , 'declaration'], - \ 'e' : [':CocList extensions' , 'extensions'], - \ 'f' : ['(coc-format-selected)' , 'format selected'], - \ 'F' : ['(coc-format)' , 'format'], - \ 'h' : ['(coc-float-hide)' , 'hide'], - \ 'i' : ['(coc-implementation)' , 'implementation'], - \ 'I' : [':CocList diagnostics' , 'diagnostics'], - \ 'j' : ['(coc-float-jump)' , 'float jump'], - \ 'l' : ['(coc-codelens-action)' , 'code lens'], - \ 'n' : ['(coc-diagnostic-next)' , 'next diagnostic'], - \ 'N' : ['(coc-diagnostic-next-error)' , 'next error'], + \ 'a' : [':Lspsaga code_action' , 'code action'], + \ 'A' : [':Lspsaga range_code_action' , 'selected action'], + \ 'd' : [':LspDefinition' , 'definition'], + \ 'D' : [':LspDeclaration' , 'workspace_diagnostics'], + \ 'f' : [':LspFormatting' , 'format'], + \ 'h' : [':Lspsaga hover_doc' , 'hover_doc'], + \ 'H' : [':Lspsaga signature_help' , 'signature_help'], + \ 'K' : [':LspHover' , 'hover'], + \ 'i' : [':LspImplementation' , 'lsp_info'], + \ 'I' : [':LspInfo' , 'lsp_info'], + \ 'l' : [':Lspsaga lsp_finder' , 'lsp_finder'], + \ 'L' : [':Lspsaga show_line_diagnostics' , 'line_diagnostics'], + \ 'n' : [':Lspsaga diagnostic_jump_next' , 'next_diagnostic'], \ 'o' : [':Vista!!' , 'outline'], - \ 'O' : [':CocList outline' , 'search outline'], - \ 'p' : ['(coc-diagnostic-prev)' , 'prev diagnostic'], - \ 'P' : ['(coc-diagnostic-prev-error)' , 'prev error'], - \ 'q' : ['(coc-fix-current)' , 'quickfix'], - \ 'r' : ['(coc-references)' , 'references'], - \ 'R' : ['(coc-rename)' , 'rename'], - \ 's' : [':CocList -I symbols' , 'references'], - \ 'S' : [':CocList snippets' , 'snippets'], - \ 't' : ['(coc-type-definition)' , 'type definition'], - \ 'u' : [':CocListResume' , 'resume list'], - \ 'U' : [':CocUpdate' , 'update CoC'], - \ 'z' : [':CocDisable' , 'disable CoC'], - \ 'Z' : [':CocEnable' , 'enable CoC'], + \ 'p' : [':Lspsaga diagnostic_jump_prev' , 'prev diagnostic'], + \ 'q' : [':Lspsaga code_action' , 'quickfix'], + \ 'r' : [':LspReferences' , 'references'], + \ 'R' : [':LspRename' , 'rename'], + \ 'T' : [':LspTypeDefinition' , 'type defintion'], + \ 'x' : [':cclose' , 'close quickfix'], + \ 'y' : [':LspDocumentSymbol' , 'document symbols'], + \ 'Y' : [':LspWorkspaceSymbol' , 'workspace symbols'], \ } - " \ 'o' : ['(coc-openlink)' , 'open link'], " t is for terminal let g:which_key_map.t = { \ 'name' : '+terminal' , - \ ';' : [':FloatermNew --wintype=normal --height=6' , 'terminal'], + \ ';' : [':FloatermNew --wintype=normal --height=6' , 'terminal'], \ 'f' : [':FloatermNew fzf' , 'fzf'], \ 'g' : [':FloatermNew lazygit' , 'git'], \ 'd' : [':FloatermNew lazydocker' , 'docker'], @@ -347,7 +291,7 @@ let g:which_key_map.t = { \ 'r' : [':FloatermNew ranger' , 'ranger'], \ 't' : [':FloatermToggle' , 'toggle'], \ 'y' : [':FloatermNew ytop' , 'ytop'], - \ 's' : [':FloatermNew ncdu' , 'ncdu'], + \ 'u' : [':FloatermNew ncdu' , 'ncdu'], \ } " w is for wiki diff --git a/lua/config-telescope.lua b/lua/config-telescope.lua deleted file mode 100644 index d8e38ca8..00000000 --- a/lua/config-telescope.lua +++ /dev/null @@ -1,76 +0,0 @@ -local actions = require('telescope.actions') --- Global remapping ------------------------------- - -- '--color=never', -require('telescope').setup{ - defaults = { - vimgrep_arguments = { - 'rg', - '--no-heading', - '--with-filename', - '--line-number', - '--column', - '--smart-case' - }, - prompt_position = "bottom", - prompt_prefix = " ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "descending", - layout_strategy = "horizontal", - layout_defaults = { - horizontal = { - mirror = false, - }, - vertical = { - mirror = false, - }, - }, - file_sorter = require'telescope.sorters'.get_fuzzy_file, - file_ignore_patterns = {}, - generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, - shorten_path = true, - winblend = 0, - width = 0.75, - preview_cutoff = 120, - results_height = 1, - results_width = 0.8, - border = {}, - borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, - color_devicons = true, - use_less = true, - set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil, - file_previewer = require'telescope.previewers'.vim_buffer_cat.new, - grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new, - qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new, - - -- Developer configurations: Not meant for general override - buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker, - mappings = { - i = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - -- To disable a keymap, put [map] = false - -- So, to not map "", just put - -- [""] = false, - - -- Otherwise, just set the mapping to the function that you want it to be. - -- [""] = actions.select_horizontal, - - -- Add up multiple actions - [""] = actions.select_default + actions.center, - - -- You can perform as many actions in a row as you like - -- [""] = actions.select_default + actions.center + my_cool_custom_action, - }, - n = { - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - -- [""] = actions.close, - -- [""] = my_cool_custom_action, - }, - }, - } -} diff --git a/lua/lsp-wrapper.lua b/lua/lsp-wrapper.lua new file mode 100644 index 00000000..7df60a7f --- /dev/null +++ b/lua/lsp-wrapper.lua @@ -0,0 +1,258 @@ +local lsp_wrapper = {} + +-- buf + +function lsp_wrapper.add_to_workspace_folder() + vim.lsp.buf.add_workspace_folder() +end + +function lsp_wrapper.clear_references() + vim.lsp.buf.clear_references() +end + +function lsp_wrapper.code_action() + vim.lsp.buf.code_action() +end + +function lsp_wrapper.declaration() + vim.lsp.buf.declaration() + vim.lsp.buf.clear_references() +end + +function lsp_wrapper.definition() + vim.lsp.buf.definition() + vim.lsp.buf.clear_references() +end + +function lsp_wrapper.document_highlight() + vim.lsp.buf.document_highlight() +end + +function lsp_wrapper.document_symbol() + vim.lsp.buf.document_symbol() +end + +function lsp_wrapper.formatting() + vim.lsp.buf.formatting() +end + +function lsp_wrapper.formatting_sync() + vim.lsp.buf.formatting_sync() +end + +function lsp_wrapper.hover() + vim.lsp.buf.hover() +end + +function lsp_wrapper.implementation() + vim.lsp.buf.implementation() +end + +function lsp_wrapper.incoming_calls() + vim.lsp.buf.incoming_calls() +end + +function lsp_wrapper.list_workspace_folders() + vim.lsp.buf.list_workspace_folders() +end + +function lsp_wrapper.outgoing_calls() + vim.lsp.buf.outgoing_calls() +end + +function lsp_wrapper.range_code_action() + vim.lsp.buf.range_code_action() +end + +function lsp_wrapper.range_formatting() + vim.lsp.buf.range_formatting() +end + +function lsp_wrapper.references() + vim.lsp.buf.references() + vim.lsp.buf.clear_references() +end + +function lsp_wrapper.remove_workspace_folder() + vim.lsp.buf.remove_workspace_folder() +end + +function lsp_wrapper.rename() + vim.lsp.buf.rename() +end + +function lsp_wrapper.signature_help() + vim.lsp.buf.signature_help() +end + +function lsp_wrapper.type_definition() + vim.lsp.buf.type_definition() +end + +function lsp_wrapper.workspace_symbol() + vim.lsp.buf.workspace_symbol() +end + +-- diagnostic + +function lsp_wrapper.get_all() + vim.lsp.diagnostic.get_all() +end + +function lsp_wrapper.get_next() + vim.lsp.diagnostic.get_next() +end + +function lsp_wrapper.get_prev() + vim.lsp.diagnostic.get_prev() +end + +function lsp_wrapper.goto_next() + vim.lsp.diagnostic.goto_next() +end + +function lsp_wrapper.goto_prev() + vim.lsp.diagnostic.goto_prev() +end + +function lsp_wrapper.show_line_diagnostics() + vim.lsp.diagnostic.show_line_diagnostics() +end + +-- misc + +-- :lua print(vim.inspect(vim.lsp.buf_get_clients())) + +-- autoformat +-- autocmd BufWritePre *.rs lua vim.lsp.buf.formatting_sync(nil, 1000) + +return lsp_wrapper + + + + +-- You can see more about the differences in types here: +-- https://microsoft.github.io/language-server-protocol/specification#textDocument_documentHighlight + +-- *hl-LspReferenceText* +-- LspReferenceText used for highlighting "text" references +-- *hl-LspReferenceRead* +-- LspReferenceRead used for highlighting "read" references +-- *hl-LspReferenceWrite* +-- LspReferenceWrite used for highlighting "write" references + + +-- *lsp-highlight-diagnostics* +-- All highlights defined for diagnostics begin with `LspDiagnostics` followed by +-- the type of highlight (e.g., `Sign`, `Underline`, etc.) and then the Severity +-- of the highlight (e.g. `Error`, `Warning`, etc.) + +-- Sign, underline and virtual text highlights (by default) are linked to their +-- corresponding LspDiagnosticsDefault highlight. + +-- For example, the default highlighting for |hl-LspDiagnosticsSignError| is +-- linked to |hl-LspDiagnosticsDefaultError|. To change the default (and +-- therefore the linked highlights), use the |:highlight| command: > + +-- highlight LspDiagnosticsDefaultError guifg="BrightRed" +-- < + +-- *hl-LspDiagnosticsDefaultError* +-- LspDiagnosticsDefaultError +-- Used as the base highlight group. +-- Other LspDiagnostic highlights link to this by default (except Underline) + +-- *hl-LspDiagnosticsDefaultWarning* +-- LspDiagnosticsDefaultWarning +-- Used as the base highlight group. +-- Other LspDiagnostic highlights link to this by default (except Underline) + +-- *hl-LspDiagnosticsDefaultInformation* +-- LspDiagnosticsDefaultInformation +-- Used as the base highlight group. +-- Other LspDiagnostic highlights link to this by default (except Underline) + +-- *hl-LspDiagnosticsDefaultHint* +-- LspDiagnosticsDefaultHint +-- Used as the base highlight group. +-- Other LspDiagnostic highlights link to this by default (except Underline) + +-- *hl-LspDiagnosticsVirtualTextError* +-- LspDiagnosticsVirtualTextError +-- Used for "Error" diagnostic virtual text. +-- See |vim.lsp.diagnostic.set_virtual_text()| + +-- *hl-LspDiagnosticsVirtualTextWarning* +-- LspDiagnosticsVirtualTextWarning +-- Used for "Warning" diagnostic virtual text. +-- See |vim.lsp.diagnostic.set_virtual_text()| + +-- *hl-LspDiagnosticsVirtualTextInformation* +-- LspDiagnosticsVirtualTextInformation +-- Used for "Information" diagnostic virtual text. +-- See |vim.lsp.diagnostic.set_virtual_text()| + +-- *hl-LspDiagnosticsVirtualTextHint* +-- LspDiagnosticsVirtualTextHint +-- Used for "Hint" diagnostic virtual text. +-- See |vim.lsp.diagnostic.set_virtual_text()| + +-- *hl-LspDiagnosticsUnderlineError* +-- LspDiagnosticsUnderlineError +-- Used to underline "Error" diagnostics. +-- See |vim.lsp.diagnostic.set_underline()| + +-- *hl-LspDiagnosticsUnderlineWarning* +-- LspDiagnosticsUnderlineWarning +-- Used to underline "Warning" diagnostics. +-- See |vim.lsp.diagnostic.set_underline()| + +-- *hl-LspDiagnosticsUnderlineInformation* +-- LspDiagnosticsUnderlineInformation +-- Used to underline "Information" diagnostics. +-- See |vim.lsp.diagnostic.set_underline()| + +-- *hl-LspDiagnosticsUnderlineHint* +-- LspDiagnosticsUnderlineHint +-- Used to underline "Hint" diagnostics. +-- See |vim.lsp.diagnostic.set_underline()| + +-- *hl-LspDiagnosticsFloatingError* +-- LspDiagnosticsFloatingError +-- Used to color "Error" diagnostic messages in diagnostics float. +-- See |vim.lsp.diagnostic.show_line_diagnostics()| + +-- *hl-LspDiagnosticsFloatingWarning* +-- LspDiagnosticsFloatingWarning +-- Used to color "Warning" diagnostic messages in diagnostics float. +-- See |vim.lsp.diagnostic.show_line_diagnostics()| + +-- *hl-LspDiagnosticsFloatingInformation* +-- LspDiagnosticsFloatingInformation +-- Used to color "Information" diagnostic messages in diagnostics float. +-- See |vim.lsp.diagnostic.show_line_diagnostics()| + +-- *hl-LspDiagnosticsFloatingHint* +-- LspDiagnosticsFloatingHint +-- Used to color "Hint" diagnostic messages in diagnostics float. +-- See |vim.lsp.diagnostic.show_line_diagnostics()| + +-- *hl-LspDiagnosticsSignError* +-- LspDiagnosticsSignError +-- Used for "Error" signs in sign column. +-- See |vim.lsp.diagnostic.set_signs()| + +-- *hl-LspDiagnosticsSignWarning* +-- LspDiagnosticsSignWarning +-- Used for "Warning" signs in sign column. +-- See |vim.lsp.diagnostic.set_signs()| + +-- *hl-LspDiagnosticsSignInformation* +-- LspDiagnosticsSignInformation +-- Used for "Information" signs in sign column. +-- See |vim.lsp.diagnostic.set_signs()| + +-- *hl-LspDiagnosticsSignHint* +-- LspDiagnosticsSignHint +-- Used for "Hint" signs in sign column. +-- See |vim.lsp.diagnostic.set_signs()| diff --git a/lua/lsp-wrapper.vim b/lua/lsp-wrapper.vim new file mode 100644 index 00000000..cd3dc165 --- /dev/null +++ b/lua/lsp-wrapper.vim @@ -0,0 +1,27 @@ +command! LspCodeAction lua require 'lsp-wrapper'.code_action() +command! LspDeclaration lua require 'lsp-wrapper'.declaration() +command! LspDefinition lua require 'lsp-wrapper'.definition() +command! LspDocumentSymbol lua require 'lsp-wrapper'.document_symbol() +command! LspFormatting lua require 'lsp-wrapper'.formatting() +command! LspFormattingSync lua require 'lsp-wrapper'.formatting_sync() +command! LspHover lua require 'lsp-wrapper'.hover() +command! LspImplementation lua require 'lsp-wrapper'.implementation() +command! LspRangeCodeAction lua require 'lsp-wrapper'.range_code_action() +command! LspRangeFormatting lua require 'lsp-wrapper'.range_formatting() +command! LspReferences lua require 'lsp-wrapper'.references() +command! LspRename lua require 'lsp-wrapper'.rename() +command! LspTypeDefinition lua require 'lsp-wrapper'.type_definition() +command! LspWorkspaceSymbol lua require 'lsp-wrapper'.workspace_symbol() +command! LspGotoNext lua require 'lsp-wrapper'.goto_next() +command! LspGotoPrev lua require 'lsp-wrapper'.goto_prev() +command! LspShowLineDiagnostics lua require 'lsp-wrapper'.show_line_diagnostics() +" command! LspAddToWorkspaceFolder lua require 'lsp-wrapper'.add_to_workspace_folder() +" command! LspRemoveWorkspaceFolder lua require 'lsp-wrapper'.remove_workspace_folder() +" command! LspListWorkspaceFolders lua require 'lsp-wrapper'.list_workspace_folders() +" command! LspClearReferences lua require 'lsp-wrapper'.clear_references() +" command! LspGetNext lua require 'lsp-wrapper'.get_next() +" command! LspGetPrev lua require 'lsp-wrapper'.get_prev() +" command! LspGetAll lua require 'lsp-wrapper'.get_all() +" command! LspIncomingCalls lua require 'lsp-wrapper'.incoming_calls() +" command! LspOutGoingCalls lua require 'lsp-wrapper'.outgoing_calls() +" command! LspDocumentHighlight lua require 'lsp-wrapper'.document_highlight() diff --git a/lua/lsp/bash-ls.lua b/lua/lsp/bash-ls.lua new file mode 100644 index 00000000..ae3e7d70 --- /dev/null +++ b/lua/lsp/bash-ls.lua @@ -0,0 +1,3 @@ +-- npm i -g bash-language-server +require'lspconfig'.bashls.setup{} + diff --git a/lua/lsp/css-ls.lua b/lua/lsp/css-ls.lua new file mode 100644 index 00000000..337fd585 --- /dev/null +++ b/lua/lsp/css-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g vscode-css-languageserver-bin +require'lspconfig'.cssls.setup{} + diff --git a/lua/lsp/docker-ls.lua b/lua/lsp/docker-ls.lua new file mode 100644 index 00000000..32b8b946 --- /dev/null +++ b/lua/lsp/docker-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g dockerfile-language-server-nodejs +require'lspconfig'.dockerls.setup{} + diff --git a/lua/lsp/graphql-ls.lua b/lua/lsp/graphql-ls.lua new file mode 100644 index 00000000..6369446d --- /dev/null +++ b/lua/lsp/graphql-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g graphql-language-service-cli +require'lspconfig'.graphql.setup{} + diff --git a/lua/lsp/html-ls.lua b/lua/lsp/html-ls.lua new file mode 100644 index 00000000..b27650a6 --- /dev/null +++ b/lua/lsp/html-ls.lua @@ -0,0 +1,11 @@ +-- npm install -g vscode-html-languageserver-bin +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +require'lspconfig'.html.setup { + capabilities = capabilities, +} + + +require'lspconfig'.html.setup{} diff --git a/lua/lsp/javascript-ls.lua b/lua/lsp/javascript-ls.lua new file mode 100644 index 00000000..62ca0675 --- /dev/null +++ b/lua/lsp/javascript-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g typescript typescript-language-server +require'lspconfig'.tsserver.setup{} + diff --git a/lua/lsp/json-ls.lua b/lua/lsp/json-ls.lua new file mode 100644 index 00000000..474f1803 --- /dev/null +++ b/lua/lsp/json-ls.lua @@ -0,0 +1,11 @@ +-- npm install -g vscode-json-languageserver +require'lspconfig'.jsonls.setup { + commands = { + Format = { + function() + vim.lsp.buf.range_formatting({},{0,0},{vim.fn.line("$"),0}) + end + } + } +} + diff --git a/lua/lsp/lsp-config.lua b/lua/lsp/lsp-config.lua new file mode 100644 index 00000000..74b82865 --- /dev/null +++ b/lua/lsp/lsp-config.lua @@ -0,0 +1,61 @@ +-- local nvim_lsp = require('lspconfig') +-- local on_attach = function(client, bufnr) +-- local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end +-- local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end + +-- buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') + +-- -- Mappings. +-- local opts = { noremap=true, silent=true } +-- buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) +-- -- buf_set_keymap('n', 'gd', ':lua vim.lsp.buf.definition()') +-- buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) +-- buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) +-- buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) +-- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) +-- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) +-- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) +-- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) +-- buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) +-- buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) +-- -- buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) +-- buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) +-- buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) +-- buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) +-- buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) + +-- -- *vim.lsp.buf.code_action() + +-- -- Set some keybinds conditional on server capabilities +-- if client.resolved_capabilities.document_formatting then +-- buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) +-- elseif client.resolved_capabilities.document_range_formatting then +-- buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) +-- end +-- -- Set autocommands conditional on server_capabilities +-- -- if client.resolved_capabilities.document_highlight then +-- -- vim.api.nvim_exec([[ +-- -- hi LspReferenceRead cterm=bold ctermbg=red guibg=Pink +-- -- hi LspReferenceText cterm=bold ctermbg=red guibg=Pink +-- -- hi LspReferenceWrite cterm=bold ctermbg=red guibg=Pink +-- -- augroup lsp_document_highlight +-- -- autocmd! * +-- -- autocmd CursorHold lua vim.lsp.buf.document_highlight() +-- -- autocmd CursorMoved lua vim.lsp.buf.clear_references() +-- -- augroup END +-- -- ]], false) +-- -- end +-- end + +-- -- Use a loop to conveniently both setup defined servers +-- -- and map buffer local keybindings when the language server attaches +-- local servers = { "pyright", "rust_analyzer", "tsserver" } +-- for _, lsp in ipairs(servers) do +-- nvim_lsp[lsp].setup { on_attach = on_attach } +-- end + + +vim.fn.sign_define("LspDiagnosticsSignError", {text = "", numhl = "LspDiagnosticsDefaultError"}) +vim.fn.sign_define("LspDiagnosticsSignWarning", {text = "", numhl = "LspDiagnosticsDefaultWarning"}) +vim.fn.sign_define("LspDiagnosticsSignInformation", {text = "", numhl = "LspDiagnosticsDefaultInformation"}) +vim.fn.sign_define("LspDiagnosticsSignHint", {text = "", numhl = "LspDiagnosticsDefaultHint"}) diff --git a/lua/lsp/lsp-kind.lua b/lua/lsp/lsp-kind.lua new file mode 100644 index 00000000..7ac3fefa --- /dev/null +++ b/lua/lsp/lsp-kind.lua @@ -0,0 +1,27 @@ +-- commented options are defaults +require('lspkind').init({ + with_text = false, + symbol_map = { + Text = '  ', + Method = '  ', + Function = '  ', + Constructor = '  ', + Variable = '[]', + Class = '  ', + Interface = ' 蘒', + Module = '  ', + Property = '  ', + Unit = ' 塞 ', + Value = '  ', + Enum = ' 練', + Keyword = '  ', + Snippet = '  ', + Color = '', + File = '', + Folder = ' ﱮ ', + EnumMember = '  ', + Constant = '  ', + Struct = '  ' + }, +}) + diff --git a/lua/lsp/lua-ls.lua b/lua/lsp/lua-ls.lua new file mode 100644 index 00000000..95e72216 --- /dev/null +++ b/lua/lsp/lua-ls.lua @@ -0,0 +1,42 @@ +-- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone) +-- TODO fix for different systems and put variable for user + +-- local system_name +-- if vim.fn.has("mac") == 1 then +-- system_name = "macOS" +-- elseif vim.fn.has("unix") == 1 then +-- system_name = "Linux" +-- elseif vim.fn.has('win32') == 1 then +-- system_name = "Windows" +-- else +-- print("Unsupported system for sumneko") +-- end + +-- set the path to the sumneko installation; if you previously installed via the now deprecated :LspInstall, use +local sumneko_root_path = "/Users/chris/.config/nvim/lua-language-server" +local sumneko_binary = "/Users/chris/.config/nvim/lua-language-server/bin/macOS/lua-language-server" + +require'lspconfig'.sumneko_lua.setup { + cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}; + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = vim.split(package.path, ';'), + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true, + [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + }, + }, + }, + }, +} diff --git a/lua/lsp/python-ls.lua b/lua/lsp/python-ls.lua new file mode 100644 index 00000000..0be71acb --- /dev/null +++ b/lua/lsp/python-ls.lua @@ -0,0 +1,3 @@ +-- npm i -g pyright +require'lspconfig'.pyright.setup{} + diff --git a/lua/lsp/vim-ls.lua b/lua/lsp/vim-ls.lua new file mode 100644 index 00000000..ac1e6e19 --- /dev/null +++ b/lua/lsp/vim-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g vim-language-server +require'lspconfig'.vimls.setup{} + diff --git a/lua/lsp/yaml-ls.lua b/lua/lsp/yaml-ls.lua new file mode 100644 index 00000000..6b2de91e --- /dev/null +++ b/lua/lsp/yaml-ls.lua @@ -0,0 +1,3 @@ +-- npm install -g yaml-language-server +require'lspconfig'.yamlls.setup{} + diff --git a/lua/nvcodeline.lua b/lua/nvcodeline.lua deleted file mode 100644 index e416b2c3..00000000 --- a/lua/nvcodeline.lua +++ /dev/null @@ -1,271 +0,0 @@ --- require'nvim-web-devicons'.setup() - -local gl = require('galaxyline') -local gls = gl.section -gl.short_line_list = {'LuaTree','vista','dbui'} - -local colors = { - bg = '#282c34', - yellow = '#fabd2f', - cyan = '#008080', - darkblue = '#081633', - green = '#608B4E', - orange = '#FF8800', - purple = '#5d4d7a', - magenta = '#d16d9e', - grey = '#c0c0c0', - blue = '#569CD6', - red = '#D16969' -} - -local buffer_not_empty = function() - if vim.fn.empty(vim.fn.expand('%:t')) ~= 1 then - return true - end - return false -end - --- gls.left[1] = { --- FirstElement = { --- -- provider = function() return '▋' end, --- provider = function() return ' ' end, --- highlight = {colors.bg,colors.bg} --- }, --- } --- gls.left[2] = { --- ViMode = { --- provider = function() --- local alias = {n = 'NORMAL',i = 'INSERT',c= 'COMMAND',V= 'VISUAL', [''] = 'VISUAL'} --- return alias[vim.fn.mode()] --- end, --- separator = ' ', --- separator_highlight = {colors.yellow,function() --- if not buffer_not_empty() then --- return colors.purple --- end --- return colors.purple --- end}, --- highlight = {colors.grey,colors.purple,'bold'}, --- }, --- } -gls.left[2] = { - ViMode = { - provider = function() - -- auto change color according the vim mode - local mode_color = {n = colors.purple, - i = colors.green, - v = colors.blue, - [''] = colors.blue, - V = colors.blue, - c = colors.purple, - no = colors.magenta, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.red, - Rv = colors.red, - cv = colors.red, - ce=colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red} - vim.api.nvim_command('hi GalaxyViMode guibg='..mode_color[vim.fn.mode()]) - return ' NVCode ' - end, - separator = ' ', - separator_highlight = {colors.yellow,function() - if not buffer_not_empty() then - return colors.bg - end - return colors.bg - end}, - highlight = {colors.grey,colors.bg,'bold'}, - }, -} --- gls.left[3] ={ --- FileIcon = { --- separator = ' ', --- provider = 'FileIcon', --- condition = buffer_not_empty, --- highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.bg}, --- }, --- } --- gls.left[4] = { --- FileName = { --- provider = {'FileSize'}, --- condition = buffer_not_empty, --- separator = ' ', --- separator_highlight = {colors.purple,colors.bg}, --- highlight = {colors.magenta,colors.bg} --- } --- } - -gls.left[3] = { - GitIcon = { - provider = function() return ' ' end, - condition = buffer_not_empty, - highlight = {colors.orange,colors.bg}, - } -} -gls.left[4] = { - GitBranch = { - provider = 'GitBranch', - separator = ' ', - separator_highlight = {colors.purple,colors.bg}, - condition = buffer_not_empty, - highlight = {colors.grey,colors.bg}, - } -} - -local checkwidth = function() - local squeeze_width = vim.fn.winwidth(0) / 2 - if squeeze_width > 40 then - return true - end - return false -end - -gls.left[5] = { - DiffAdd = { - provider = 'DiffAdd', - condition = checkwidth, - -- separator = ' ', - -- separator_highlight = {colors.purple,colors.bg}, - icon = '  ', - highlight = {colors.green,colors.bg}, - } -} -gls.left[6] = { - DiffModified = { - provider = 'DiffModified', - condition = checkwidth, - -- separator = ' ', - -- separator_highlight = {colors.purple,colors.bg}, - icon = '  ', - highlight = {colors.blue,colors.bg}, - } -} -gls.left[7] = { - DiffRemove = { - provider = 'DiffRemove', - condition = checkwidth, - -- separator = ' ', - -- separator_highlight = {colors.purple,colors.bg}, - icon = '  ', - highlight = {colors.red,colors.bg}, - } -} -gls.left[8] = { - LeftEnd = { - provider = function() return ' ' end, - separator = ' ', - separator_highlight = {colors.purple,colors.bg}, - highlight = {colors.purple,colors.bg} - } -} -gls.left[9] = { - DiagnosticError = { - provider = 'DiagnosticError', - icon = '  ', - highlight = {colors.red,colors.bg} - } -} -gls.left[10] = { - Space = { - provider = function () return '' end - } -} -gls.left[11] = { - DiagnosticWarn = { - provider = 'DiagnosticWarn', - icon = '  ', - highlight = {colors.yellow,colors.bg}, - } -} -gls.left[12] = { - DiagnosticHint = { - provider = 'DiagnosticHint', - icon = '  ', - highlight = {colors.blue,colors.bg}, - } -} -gls.left[13] = { - DiagnosticInfo = { - provider = 'DiagnosticInfo', - icon = '  ', - highlight = {colors.orange,colors.bg}, - } -} -gls.right[1]= { - FileFormat = { - provider = 'FileFormat', - separator = ' ', - separator_highlight = {colors.bg,colors.bg}, - highlight = {colors.grey,colors.bg}, - } -} -gls.right[2] = { - LineInfo = { - provider = 'LineColumn', - separator = ' | ', - separator_highlight = {colors.darkblue,colors.bg}, - highlight = {colors.grey,colors.bg}, - }, -} -gls.right[3] = { - PerCent = { - provider = 'LinePercent', - separator = ' |', - separator_highlight = {colors.darkblue,colors.bg}, - highlight = {colors.grey,colors.bg}, - } -} -gls.right[4] = { - ScrollBar = { - provider = 'ScrollBar', - highlight = {colors.yellow,colors.purple}, - } -} - --- gls.short_line_left[1] = { --- BufferType = { --- provider = 'FileTypeName', --- separator = ' ', --- separator_highlight = {colors.purple,colors.bg}, --- highlight = {colors.grey,colors.purple} --- } --- } - -gls.short_line_left[1] = { - LeftEnd = { - provider = function() return ' ' end, - separator = ' ', - separator_highlight = {colors.purple,colors.bg}, - highlight = {colors.purple,colors.bg} - } -} - --- gls.short_line_right[1] = { --- BufferIcon = { --- provider= 'BufferIcon', --- separator = ' ', --- separator_highlight = {colors.purple,colors.bg}, --- highlight = {colors.grey,colors.purple} --- } --- } --- function! s:my_bookmark_color() abort --- let s:scl_guibg = matchstr(execute('hi SignColumn'), 'guibg=\zs\S*') --- if empty(s:scl_guibg) --- let s:scl_guibg = 'NONE' --- endif --- exe 'hi MyBookmarkSign guifg=' . s:scl_guibg --- endfunction --- call s:my_bookmark_color() " don't remove this line! - --- augroup UserGitSignColumnColor --- autocmd! --- autocmd ColorScheme * call s:my_bookmark_color() --- augroup END diff --git a/lua/plug-colorizer.lua b/lua/plug-colorizer.lua deleted file mode 100644 index e990d505..00000000 --- a/lua/plug-colorizer.lua +++ /dev/null @@ -1,15 +0,0 @@ -require'colorizer'.setup( - {'*';}, - { - RGB = true; -- #RGB hex codes - RRGGBB = true; -- #RRGGBB hex codes - -- names = true; -- "Name" codes like Blue - RRGGBBAA = true; -- #RRGGBBAA hex codes - rgb_fn = true; -- CSS rgb() and rgba() functions - hsl_fn = true; -- CSS hsl() and hsla() functions - css = true; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true; -- Enable all CSS *functions*: rgb_fn, hsl_fn - }) - - - diff --git a/lua/plugins/colorizer-config.lua b/lua/plugins/colorizer-config.lua new file mode 100644 index 00000000..e990d505 --- /dev/null +++ b/lua/plugins/colorizer-config.lua @@ -0,0 +1,15 @@ +require'colorizer'.setup( + {'*';}, + { + RGB = true; -- #RGB hex codes + RRGGBB = true; -- #RRGGBB hex codes + -- names = true; -- "Name" codes like Blue + RRGGBBAA = true; -- #RRGGBBAA hex codes + rgb_fn = true; -- CSS rgb() and rgba() functions + hsl_fn = true; -- CSS hsl() and hsla() functions + css = true; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true; -- Enable all CSS *functions*: rgb_fn, hsl_fn + }) + + + diff --git a/lua/plugins/compe-config.lua b/lua/plugins/compe-config.lua new file mode 100644 index 00000000..6033c0e7 --- /dev/null +++ b/lua/plugins/compe-config.lua @@ -0,0 +1,73 @@ +-- TODO we need snippet support and to maybe get better docs idk + +vim.o.completeopt = "menuone,noselect" + +require'compe'.setup { + enabled = true; + autocomplete = true; + debug = false; + min_length = 1; + preselect = 'enable'; + throttle_time = 80; + source_timeout = 200; + incomplete_delay = 400; + max_abbr_width = 100; + max_kind_width = 100; + max_menu_width = 100; + documentation = false; + + source = { + path = true; + buffer = true; + calc = true; + vsnip = true; + nvim_lsp = true; + nvim_lua = true; + spell = true; + tags = true; + snippets_nvim = true; + treesitter = true; + }; +} + +local t = function(str) + return vim.api.nvim_replace_termcodes(str, true, true, true) +end + +-- local check_back_space = function() +-- local col = vim.fn.col('.') - 1 +-- if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then +-- return true +-- else +-- return false +-- end +-- end + +-- Use (s-)tab to: +--- move to prev/next item in completion menuone +--- jump to prev/next snippet's placeholder +-- _G.tab_complete = function() +-- if vim.fn.pumvisible() == 1 then +-- return t "" + -- elseif vim.fn.call("vsnip#available", {1}) == 1 then + -- return t "(vsnip-expand-or-jump)" + -- elseif check_back_space() then + -- return t "" + -- else + -- return vim.fn['compe#complete']() + -- end +-- end +_G.s_tab_complete = function() + if vim.fn.pumvisible() == 1 then + return t "" + elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then + return t "(vsnip-jump-prev)" + else + return t "" + end +end + +-- vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) +vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) +vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) +vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) diff --git a/lua/plugins/galaxyline-config.lua b/lua/plugins/galaxyline-config.lua new file mode 100644 index 00000000..e416b2c3 --- /dev/null +++ b/lua/plugins/galaxyline-config.lua @@ -0,0 +1,271 @@ +-- require'nvim-web-devicons'.setup() + +local gl = require('galaxyline') +local gls = gl.section +gl.short_line_list = {'LuaTree','vista','dbui'} + +local colors = { + bg = '#282c34', + yellow = '#fabd2f', + cyan = '#008080', + darkblue = '#081633', + green = '#608B4E', + orange = '#FF8800', + purple = '#5d4d7a', + magenta = '#d16d9e', + grey = '#c0c0c0', + blue = '#569CD6', + red = '#D16969' +} + +local buffer_not_empty = function() + if vim.fn.empty(vim.fn.expand('%:t')) ~= 1 then + return true + end + return false +end + +-- gls.left[1] = { +-- FirstElement = { +-- -- provider = function() return '▋' end, +-- provider = function() return ' ' end, +-- highlight = {colors.bg,colors.bg} +-- }, +-- } +-- gls.left[2] = { +-- ViMode = { +-- provider = function() +-- local alias = {n = 'NORMAL',i = 'INSERT',c= 'COMMAND',V= 'VISUAL', [''] = 'VISUAL'} +-- return alias[vim.fn.mode()] +-- end, +-- separator = ' ', +-- separator_highlight = {colors.yellow,function() +-- if not buffer_not_empty() then +-- return colors.purple +-- end +-- return colors.purple +-- end}, +-- highlight = {colors.grey,colors.purple,'bold'}, +-- }, +-- } +gls.left[2] = { + ViMode = { + provider = function() + -- auto change color according the vim mode + local mode_color = {n = colors.purple, + i = colors.green, + v = colors.blue, + [''] = colors.blue, + V = colors.blue, + c = colors.purple, + no = colors.magenta, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.red, + Rv = colors.red, + cv = colors.red, + ce=colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red} + vim.api.nvim_command('hi GalaxyViMode guibg='..mode_color[vim.fn.mode()]) + return ' NVCode ' + end, + separator = ' ', + separator_highlight = {colors.yellow,function() + if not buffer_not_empty() then + return colors.bg + end + return colors.bg + end}, + highlight = {colors.grey,colors.bg,'bold'}, + }, +} +-- gls.left[3] ={ +-- FileIcon = { +-- separator = ' ', +-- provider = 'FileIcon', +-- condition = buffer_not_empty, +-- highlight = {require('galaxyline.provider_fileinfo').get_file_icon_color,colors.bg}, +-- }, +-- } +-- gls.left[4] = { +-- FileName = { +-- provider = {'FileSize'}, +-- condition = buffer_not_empty, +-- separator = ' ', +-- separator_highlight = {colors.purple,colors.bg}, +-- highlight = {colors.magenta,colors.bg} +-- } +-- } + +gls.left[3] = { + GitIcon = { + provider = function() return ' ' end, + condition = buffer_not_empty, + highlight = {colors.orange,colors.bg}, + } +} +gls.left[4] = { + GitBranch = { + provider = 'GitBranch', + separator = ' ', + separator_highlight = {colors.purple,colors.bg}, + condition = buffer_not_empty, + highlight = {colors.grey,colors.bg}, + } +} + +local checkwidth = function() + local squeeze_width = vim.fn.winwidth(0) / 2 + if squeeze_width > 40 then + return true + end + return false +end + +gls.left[5] = { + DiffAdd = { + provider = 'DiffAdd', + condition = checkwidth, + -- separator = ' ', + -- separator_highlight = {colors.purple,colors.bg}, + icon = '  ', + highlight = {colors.green,colors.bg}, + } +} +gls.left[6] = { + DiffModified = { + provider = 'DiffModified', + condition = checkwidth, + -- separator = ' ', + -- separator_highlight = {colors.purple,colors.bg}, + icon = '  ', + highlight = {colors.blue,colors.bg}, + } +} +gls.left[7] = { + DiffRemove = { + provider = 'DiffRemove', + condition = checkwidth, + -- separator = ' ', + -- separator_highlight = {colors.purple,colors.bg}, + icon = '  ', + highlight = {colors.red,colors.bg}, + } +} +gls.left[8] = { + LeftEnd = { + provider = function() return ' ' end, + separator = ' ', + separator_highlight = {colors.purple,colors.bg}, + highlight = {colors.purple,colors.bg} + } +} +gls.left[9] = { + DiagnosticError = { + provider = 'DiagnosticError', + icon = '  ', + highlight = {colors.red,colors.bg} + } +} +gls.left[10] = { + Space = { + provider = function () return '' end + } +} +gls.left[11] = { + DiagnosticWarn = { + provider = 'DiagnosticWarn', + icon = '  ', + highlight = {colors.yellow,colors.bg}, + } +} +gls.left[12] = { + DiagnosticHint = { + provider = 'DiagnosticHint', + icon = '  ', + highlight = {colors.blue,colors.bg}, + } +} +gls.left[13] = { + DiagnosticInfo = { + provider = 'DiagnosticInfo', + icon = '  ', + highlight = {colors.orange,colors.bg}, + } +} +gls.right[1]= { + FileFormat = { + provider = 'FileFormat', + separator = ' ', + separator_highlight = {colors.bg,colors.bg}, + highlight = {colors.grey,colors.bg}, + } +} +gls.right[2] = { + LineInfo = { + provider = 'LineColumn', + separator = ' | ', + separator_highlight = {colors.darkblue,colors.bg}, + highlight = {colors.grey,colors.bg}, + }, +} +gls.right[3] = { + PerCent = { + provider = 'LinePercent', + separator = ' |', + separator_highlight = {colors.darkblue,colors.bg}, + highlight = {colors.grey,colors.bg}, + } +} +gls.right[4] = { + ScrollBar = { + provider = 'ScrollBar', + highlight = {colors.yellow,colors.purple}, + } +} + +-- gls.short_line_left[1] = { +-- BufferType = { +-- provider = 'FileTypeName', +-- separator = ' ', +-- separator_highlight = {colors.purple,colors.bg}, +-- highlight = {colors.grey,colors.purple} +-- } +-- } + +gls.short_line_left[1] = { + LeftEnd = { + provider = function() return ' ' end, + separator = ' ', + separator_highlight = {colors.purple,colors.bg}, + highlight = {colors.purple,colors.bg} + } +} + +-- gls.short_line_right[1] = { +-- BufferIcon = { +-- provider= 'BufferIcon', +-- separator = ' ', +-- separator_highlight = {colors.purple,colors.bg}, +-- highlight = {colors.grey,colors.purple} +-- } +-- } +-- function! s:my_bookmark_color() abort +-- let s:scl_guibg = matchstr(execute('hi SignColumn'), 'guibg=\zs\S*') +-- if empty(s:scl_guibg) +-- let s:scl_guibg = 'NONE' +-- endif +-- exe 'hi MyBookmarkSign guifg=' . s:scl_guibg +-- endfunction +-- call s:my_bookmark_color() " don't remove this line! + +-- augroup UserGitSignColumnColor +-- autocmd! +-- autocmd ColorScheme * call s:my_bookmark_color() +-- augroup END diff --git a/lua/plugins/lspsaga-config.lua b/lua/plugins/lspsaga-config.lua new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/lua/plugins/lspsaga-config.lua @@ -0,0 +1,2 @@ + + diff --git a/lua/plugins/nvimtree-config.lua b/lua/plugins/nvimtree-config.lua new file mode 100644 index 00000000..8eeec88d --- /dev/null +++ b/lua/plugins/nvimtree-config.lua @@ -0,0 +1,31 @@ +local tree_cb = require'nvim-tree.config'.nvim_tree_callback +vim.g.nvim_tree_bindings = { + -- mappings + [""] = tree_cb("edit"), + ["l"] = tree_cb("edit"), + ["o"] = tree_cb("edit"), + ["<2-LeftMouse>"] = tree_cb("edit"), + ["<2-RightMouse>"] = tree_cb("cd"), + [""] = tree_cb("cd"), + ["v"] = tree_cb("vsplit"), + ["s"] = tree_cb("split"), + [""] = tree_cb("tabnew"), + ["h"] = tree_cb("close_node"), + [""] = tree_cb("close_node"), + [""] = tree_cb("close_node"), + [""] = tree_cb("preview"), + ["I"] = tree_cb("toggle_ignored"), + ["H"] = tree_cb("toggle_dotfiles"), + ["R"] = tree_cb("refresh"), + ["a"] = tree_cb("create"), + ["d"] = tree_cb("remove"), + ["r"] = tree_cb("rename"), + [""] = tree_cb("full_rename"), + ["x"] = tree_cb("cut"), + ["c"] = tree_cb("copy"), + ["p"] = tree_cb("paste"), + ["[c"] = tree_cb("prev_git_item"), + ["]c"] = tree_cb("next_git_item"), + ["-"] = tree_cb("dir_up"), + ["q"] = tree_cb("close"), +} diff --git a/lua/plugins/telescope-config.lua b/lua/plugins/telescope-config.lua new file mode 100644 index 00000000..d8e38ca8 --- /dev/null +++ b/lua/plugins/telescope-config.lua @@ -0,0 +1,76 @@ +local actions = require('telescope.actions') +-- Global remapping +------------------------------ + -- '--color=never', +require('telescope').setup{ + defaults = { + vimgrep_arguments = { + 'rg', + '--no-heading', + '--with-filename', + '--line-number', + '--column', + '--smart-case' + }, + prompt_position = "bottom", + prompt_prefix = " ", + selection_caret = " ", + entry_prefix = " ", + initial_mode = "insert", + selection_strategy = "reset", + sorting_strategy = "descending", + layout_strategy = "horizontal", + layout_defaults = { + horizontal = { + mirror = false, + }, + vertical = { + mirror = false, + }, + }, + file_sorter = require'telescope.sorters'.get_fuzzy_file, + file_ignore_patterns = {}, + generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter, + shorten_path = true, + winblend = 0, + width = 0.75, + preview_cutoff = 120, + results_height = 1, + results_width = 0.8, + border = {}, + borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' }, + color_devicons = true, + use_less = true, + set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil, + file_previewer = require'telescope.previewers'.vim_buffer_cat.new, + grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new, + qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new, + + -- Developer configurations: Not meant for general override + buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker, + mappings = { + i = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + -- To disable a keymap, put [map] = false + -- So, to not map "", just put + -- [""] = false, + + -- Otherwise, just set the mapping to the function that you want it to be. + -- [""] = actions.select_horizontal, + + -- Add up multiple actions + [""] = actions.select_default + actions.center, + + -- You can perform as many actions in a row as you like + -- [""] = actions.select_default + actions.center + my_cool_custom_action, + }, + n = { + [""] = actions.move_selection_next, + [""] = actions.move_selection_previous, + -- [""] = actions.close, + -- [""] = my_cool_custom_action, + }, + }, + } +} diff --git a/lua/plugins/treesitter-config.lua b/lua/plugins/treesitter-config.lua new file mode 100644 index 00000000..b9549a46 --- /dev/null +++ b/lua/plugins/treesitter-config.lua @@ -0,0 +1,33 @@ +require'nvim-treesitter.configs'.setup { + ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages + highlight = { + enable = true, -- false will disable the whole extension + }, +} + +require "nvim-treesitter.configs".setup { + playground = { + enable = true, + disable = {}, + updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code + persist_queries = false -- Whether the query persists across vim sessions + } +} + +-- require'nvim-treesitter.configs'.setup { +-- refactor = { +-- highlight_current_scope = { enable = false }, +-- }, +-- } + +-- require'nvim-treesitter.configs'.setup { +-- refactor = { +-- smart_rename = { +-- enable = true, +-- keymaps = { +-- smart_rename = "grr", +-- }, +-- }, +-- }, +-- } + diff --git a/lua/treesitter.lua b/lua/treesitter.lua deleted file mode 100644 index b9549a46..00000000 --- a/lua/treesitter.lua +++ /dev/null @@ -1,33 +0,0 @@ -require'nvim-treesitter.configs'.setup { - ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages - highlight = { - enable = true, -- false will disable the whole extension - }, -} - -require "nvim-treesitter.configs".setup { - playground = { - enable = true, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false -- Whether the query persists across vim sessions - } -} - --- require'nvim-treesitter.configs'.setup { --- refactor = { --- highlight_current_scope = { enable = false }, --- }, --- } - --- require'nvim-treesitter.configs'.setup { --- refactor = { --- smart_rename = { --- enable = true, --- keymaps = { --- smart_rename = "grr", --- }, --- }, --- }, --- } - diff --git a/plug-config/coc/coc-extensions.vim b/plug-config/coc/coc-extensions.vim deleted file mode 100644 index 7066163e..00000000 --- a/plug-config/coc/coc-extensions.vim +++ /dev/null @@ -1,33 +0,0 @@ -let g:coc_global_extensions = [ - \ 'coc-snippets', - \ 'coc-actions', - \ 'coc-sh', - \ 'coc-java-debug', - \ 'coc-java', - \ 'coc-lists', - \ 'coc-emmet', - \ 'coc-tasks', - \ 'coc-pairs', - \ 'coc-tsserver', - \ 'coc-floaterm', - \ 'coc-fzf-preview', - \ 'coc-html', - \ 'coc-css', - \ 'coc-cssmodules', - \ 'coc-stylelintplus', - \ 'coc-emoji', - \ 'coc-yaml', - \ 'coc-pyright', - \ 'coc-explorer', - \ 'coc-svg', - \ 'coc-prettier', - \ 'coc-vimlsp', - \ 'coc-xml', - \ 'coc-yank', - \ 'coc-json', - \ 'coc-marketplace', - \ ] - " \ 'coc-tabnine', - " \ 'coc-highlight', - " \ 'coc-bookmark', - diff --git a/plug-config/coc/coc.vim b/plug-config/coc/coc.vim deleted file mode 100644 index f8c9270e..00000000 --- a/plug-config/coc/coc.vim +++ /dev/null @@ -1,171 +0,0 @@ -" Use tab for trigger completion with characters ahead and navigate. -inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -" Use to trigger completion. -inoremap coc#refresh() - -" Use to confirm completion, `u` means break undo chain at current -" position. Coc only does snippet and additional edit on confirm. -if exists('*complete_info') - inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" -else - imap pumvisible() ? "\" : "\u\" -endif - -" GoTo code navigation. -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -" Use K to show documentation in preview window. -nnoremap K :call show_documentation() - -function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif -endfunction - -" set keywordprg=:call\ CocActionAsync('doHover') -" augroup VimHelp -" autocmd! -" autocmd Filetype vim,help setlocal keywordprg=:help -" augroup END - -" Highlight the symbol and its references when holding the cursor. -autocmd CursorHold * silent call CocActionAsync('highlight') - -" Symbol renaming. -" nmap rn (coc-rename) - -augroup mygroup - autocmd! - " Setup formatexpr specified filetype(s). - autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') - " Update signature help on jump placeholder. - autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') -augroup end - -" Applying codeAction to the selected region. -" Example: `aap` for current paragraph -" xmap a (coc-codeaction-selected) -" nmap a (coc-codeaction-selected) - -" Remap keys for applying codeAction to the current line. -" nmap ac (coc-codeaction) -" Apply AutoFix to problem on the current line. -" nmap qf (coc-fix-current) - -" Introduce function text object -" NOTE: Requires 'textDocument.documentSymbol' support from the language server. -xmap if (coc-funcobj-i) -xmap af (coc-funcobj-a) -omap if (coc-funcobj-i) -omap af (coc-funcobj-a) - -" Remap and for scroll float windows/popups. -" Note coc#float#scroll works on neovim >= 0.4.3 or vim >= 8.2.0750 -nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" -nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" -inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" -inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" - -" NeoVim-only mapping for visual mode scroll -" Useful on signatureHelp after jump placeholder of snippet expansion -if has('nvim') - vnoremap coc#float#has_scroll() ? coc#float#nvim_scroll(1, 1) : "\" - vnoremap coc#float#has_scroll() ? coc#float#nvim_scroll(0, 1) : "\" -endif - -" Add `:Format` command to format current buffer. -command! -nargs=0 Format :call CocAction('format') - -" Add `:Fold` command to fold current buffer. -command! -nargs=? Fold :call CocAction('fold', ) - -" Add `:OR` command for organize imports of the current buffer. -command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') - -" Add (Neo)Vim's native statusline support. -" NOTE: Please see `:h coc-status` for integrations with external plugins that -" provide custom statusline: lightline.vim, vim-airline. -" set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} - -" Mappings using CoCList: -" Show all diagnostics. -" TODO add these to which key -" nnoremap a :CocList diagnostics -" " Manage extensions. -" nnoremap e :CocList extensions -" " Show commands. -" nnoremap c :CocList commands -" " Find symbol of current document. -" nnoremap o :CocList outline -" " Search workspace symbols. -" nnoremap s :CocList -I symbols -" " Do default action for next item. -" nnoremap j :CocNext -" " Do default action for previous item. -" nnoremap k :CocPrev -" " Resume latest coc list. -" nnoremap p :CocListResume - -" Explorer -let g:coc_explorer_global_presets = { -\ 'floating': { -\ 'position': 'floating', -\ }, -\ 'floatingLeftside': { -\ 'position': 'floating', -\ 'floating-position': 'left-center', -\ 'floating-width': 30, -\ }, -\ 'floatingRightside': { -\ 'position': 'floating', -\ 'floating-position': 'right-center', -\ 'floating-width': 30, -\ }, -\ 'simplify': { -\ 'file.child.template': '[selection | clip | 1] [indent][icon | 1] [filename omitCenter 1]' -\ } -\ } -"nmap e :CocCommand explorer -" nnoremap e :CocCommand explorer -" nmap f :CocCommand explorer --preset floatingRightside -autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif - -" Snippets -" Use for trigger snippet expand. -imap (coc-snippets-expand) - -" Use for select text for visual placeholder of snippet. -vmap (coc-snippets-select) - -" Use for jump to next placeholder, it's default of coc.nvim -let g:coc_snippet_next = '' - -" Use for jump to previous placeholder, it's default of coc.nvim -let g:coc_snippet_prev = '' - -" Use for both expand and jump (make expand higher priority.) -imap (coc-snippets-expand-jump) - -augroup MyCocExplorer - autocmd! - autocmd VimEnter * sil! au! FileExplorer * - autocmd BufEnter * let d = expand('%') | if isdirectory(d) | silent! bd | exe 'CocCommand explorer ' . d | endif -augroup END diff --git a/plug-config/gitgutter.vim b/plug-config/gitgutter.vim index 8455543b..9907d8e5 100644 --- a/plug-config/gitgutter.vim +++ b/plug-config/gitgutter.vim @@ -1,5 +1,6 @@ +let g:gitgutter_sign_allow_clobber = 1 let g:gitgutter_sign_added = '▎' let g:gitgutter_sign_modified = '▎' let g:gitgutter_sign_removed = '契' diff --git a/plug-config/lsp-config.vim b/plug-config/lsp-config.vim new file mode 100644 index 00000000..bb5ae691 --- /dev/null +++ b/plug-config/lsp-config.vim @@ -0,0 +1,14 @@ +" LSP config (the mappings used in the default file don't quite work right) +nnoremap gd lua vim.lsp.buf.definition() +nnoremap gD lua vim.lsp.buf.declaration() +nnoremap gr lua vim.lsp.buf.references() +nnoremap gi lua vim.lsp.buf.implementation() +nnoremap K lua vim.lsp.buf.hover() +nnoremap lua vim.lsp.buf.signature_help() +nnoremap [d lua vim.lsp.diagnostic.goto_prev() +nnoremap ]d lua vim.lsp.diagnostic.goto_next() +" autoformat +autocmd BufWritePre *.js lua vim.lsp.buf.formatting_sync(nil, 100) +autocmd BufWritePre *.jsx lua vim.lsp.buf.formatting_sync(nil, 100) +autocmd BufWritePre *.py lua vim.lsp.buf.formatting_sync(nil, 100) + diff --git a/plug-config/nvimtree-config.vim b/plug-config/nvimtree-config.vim new file mode 100644 index 00000000..34e98991 --- /dev/null +++ b/plug-config/nvimtree-config.vim @@ -0,0 +1,45 @@ +let g:nvim_tree_side = 'left' " | 'left' "left by default +let g:nvim_tree_width = 40 "30 by default +let g:nvim_tree_ignore = [ '.git', 'node_modules', '.cache' ] "empty by default +let g:nvim_tree_auto_open = 0 "0 by default, opens the tree when typing `vim $DIR` or `vim` +let g:nvim_tree_auto_close = 1 "0 by default, closes the tree when it's the last window +" let g:nvim_tree_auto_ignore_ft = 'startify' "empty by default, don't auto open tree on specific filetypes. +let g:nvim_tree_quit_on_open = 0 "0 by default, closes the tree when you open a file +let g:nvim_tree_follow = 1 "0 by default, this option allows the cursor to be updated when entering a buffer +let g:nvim_tree_indent_markers = 1 "0 by default, this option shows indent markers when folders are open +let g:nvim_tree_hide_dotfiles = 1 "0 by default, this option hides files and folders starting with a dot `.` +let g:nvim_tree_git_hl = 1 "0 by default, will enable file highlight for git attributes (can be used without the icons). +" let g:nvim_tree_root_folder_modifier = ':~' "This is the default. See :help filename-modifiers for more options +" let g:nvim_tree_tab_open = 1 "0 by default, will open the tree when entering a new tab and the tree was previously open +" let g:nvim_tree_width_allow_resize = 1 "0 by default, will not resize the tree when opening a file +let g:nvim_tree_disable_netrw = 1 "1 by default, disables netrw +let g:nvim_tree_hijack_netrw = 1 "1 by default, prevents netrw from automatically opening when opening directories (but lets you keep its other utilities) +let g:nvim_tree_show_icons = { + \ 'git': 1, + \ 'folders': 1, + \ 'files': 1, + \ } +"If 0, do not show the icons for one of 'git' 'folder' and 'files' +"1 by default, notice that if 'files' is 1, it will only display +"if nvim-web-devicons is installed and on your runtimepath + +" default will show icon by default if no icon is provided +" default shows no icon by default +let g:nvim_tree_icons = { + \ 'default': '', + \ 'symlink': '', + \ 'git': { + \ 'unstaged': "✗", + \ 'staged': "✓", + \ 'unmerged': "", + \ 'renamed': "➜", + \ 'untracked': "ﭖ" + \ }, + \ 'folder': { + \ 'default': "", + \ 'open': "", + \ 'empty': "", + \ 'empty_open': "", + \ 'symlink': "", + \ } + \ } diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add new file mode 100644 index 00000000..5eaeb1c0 --- /dev/null +++ b/spell/en.utf-8.add @@ -0,0 +1 @@ +lua diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl new file mode 100644 index 00000000..58649263 Binary files /dev/null and b/spell/en.utf-8.add.spl differ diff --git a/utils/install_latest_neovim.sh b/utils/install_latest_neovim.sh new file mode 100755 index 00000000..bdd9441d --- /dev/null +++ b/utils/install_latest_neovim.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd ~ +sudo rm -r neovim +git clone https://github.com/neovim/neovim +cd neovim +sudo make CMAKE_BUILD_TYPE=Release install +cd ~ +sudo rm -r neovim \ No newline at end of file diff --git a/vim-plug/extras.vim b/vim-plug/extras.vim new file mode 100644 index 00000000..3f07fb87 --- /dev/null +++ b/vim-plug/extras.vim @@ -0,0 +1,84 @@ + " Plugin Graveyard + " Rainbow brackets + " Plug 'luochen1990/rainbow' + " 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 'yuezk/vim-js' + " Plug 'maxmellon/vim-jsx-pretty' + " Plug 'jelera/vim-javascript-syntax' + " Debug + " Plug 'mfussenegger/nvim-dap' + " Plug 'nvim-dap-virtual-text' + " Sneak + " Plug 'justinmk/vim-sneak' + " Minimap + " Plug 'wfxr/minimap.vim' + " jsx syntax support + " Typescript syntax + " Plug 'HerringtonDarkholme/yats.vim' + " Multiple Cursors + " Plug 'terryma/vim-multiple-cursors' + " Plug 'kaicataldo/material.vim' + " Plug 'tomasiser/vim-code-dark' + " Plug 'mg979/vim-xtabline' + " Files + " Plug 'tpope/vim-eunuch' + " 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' + " 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 'preservim/nerdcommenter' + " Plug 'atishay/far.vim' + " Plug 'romgrk/lib.kom' + " Plug 'brooth/far.vim' + " Debugging + " Repeat stuff + " Plug 'tpope/vim-repeat' + " Convert binary, hex, etc.. + " Plug 'glts/vim-radical' + " highlight all matches under cursor + " Plug 'RRethy/vim-illuminate' + " Surround + " Plug 'tpope/vim-surround' + " auto set indent settings + " Plug 'tpope/vim-sleuth' + " FZF + " Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } + " Plug 'yuki-ycino/fzf-preview.vim', { 'branch': 'release', 'do': ':UpdateRemotePlugins' } + " Plug 'junegunn/fzf.vim' + " undo time travel + " Plug 'mbbill/undotree' + " " async tasks + " Plug 'skywind3000/asynctasks.vim' + " Plug 'skywind3000/asyncrun.vim' + " CoC + " Plug 'neoclide/coc.nvim', {'branch': 'release'} + " Swap windows + " Plug 'wesQ3/vim-windowswap' + " Debugging + " Plug 'puremourning/vimspector' + " Plug 'szw/vim-maximizer' + " Treesitter + " Plug 'nvim-treesitter/playground' + " Plug 'nvim-treesitter/nvim-treesitter-refactor' + " Plug 'nvim-treesitter/nvim-treesitter-textobjects' + " Plug 'romgrk/nvim-treesitter-context' + " Neovim in Browser + " Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(1) } } diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim index 442e3ffa..4ca5f710 100644 --- a/vim-plug/plugins.vim +++ b/vim-plug/plugins.vim @@ -12,16 +12,10 @@ call plug#begin('~/.config/nvim/autoload/plugged') Plug 'tpope/vim-commentary' " Change dates fast Plug 'tpope/vim-speeddating' - " Convert binary, hex, etc.. - Plug 'glts/vim-radical' - " Repeat stuff - Plug 'tpope/vim-repeat' " Text Navigation Plug 'unblevable/quick-scope' " Useful for React Commenting Plug 'suy/vim-context-commentstring' - " highlight all matches under cursor - " Plug 'RRethy/vim-illuminate' if exists('g:vscode') " Easy motion for VSCode @@ -32,41 +26,19 @@ call plug#begin('~/.config/nvim/autoload/plugged') " Easymotion Plug 'easymotion/vim-easymotion' - " Surround - Plug 'tpope/vim-surround' " Have the file system follow you around Plug 'airblade/vim-rooter' - " auto set indent settings - Plug 'tpope/vim-sleuth' - " Better Syntax Support - Plug 'sheerun/vim-polyglot' " Treesitter Plug 'nvim-treesitter/nvim-treesitter' - Plug 'nvim-treesitter/playground' " Cool Icons Plug 'kyazdani42/nvim-web-devicons' Plug 'ryanoasis/vim-devicons' " Auto pairs for '(' '[' '{' Plug 'jiangmiao/auto-pairs' - " Closetags - Plug 'alvan/vim-closetag' - " Themes - Plug 'christianchiarulli/nvcode-color-schemes.vim' - " Intellisense - Plug 'neoclide/coc.nvim', {'branch': 'release'} " Status Line Plug 'glepnir/galaxyline.nvim' + " Ranger Plug 'kevinhwang91/rnvimr' - " FZF - Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } - " Plug 'yuki-ycino/fzf-preview.vim', { 'branch': 'release', 'do': ':UpdateRemotePlugins' } - 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 @@ -84,95 +56,51 @@ call plug#begin('~/.config/nvim/autoload/plugged') Plug 'metakirby5/codi.vim' " Better tabline Plug 'romgrk/barbar.nvim' - " undo time travel - Plug 'mbbill/undotree' " 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' - " Colorizer - Plug 'norcalli/nvim-colorizer.lua' " Intuitive buffer closing Plug 'moll/vim-bbye' - " Debugging - Plug 'puremourning/vimspector' - Plug 'szw/vim-maximizer' - " Neovim in Browser - Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(1) } } " Telescope Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' - " Rainbow brackets - " Plug 'luochen1990/rainbow' - " 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 'yuezk/vim-js' - " Plug 'maxmellon/vim-jsx-pretty' - " Plug 'jelera/vim-javascript-syntax' - " Plugin Graveyard + " Intellisense + Plug 'neovim/nvim-lspconfig' + Plug 'hrsh7th/nvim-compe' + Plug 'glepnir/lspsaga.nvim' + Plug 'onsails/lspkind-nvim' + Plug 'kosayoda/nvim-lightbulb' + " File Explorer + Plug 'kyazdani42/nvim-tree.lua' - " Debug - " Plug 'mfussenegger/nvim-dap' - " Plug 'nvim-dap-virtual-text' - " Sneak - " Plug 'justinmk/vim-sneak' - " Plug 'nvim-treesitter/nvim-treesitter-refactor' - " Plug 'nvim-treesitter/nvim-treesitter-textobjects' - " Plug 'romgrk/nvim-treesitter-context' - " Minimap - " Plug 'wfxr/minimap.vim' - " jsx syntax support - " Typescript syntax - " Plug 'HerringtonDarkholme/yats.vim' - " Multiple Cursors - " Plug 'terryma/vim-multiple-cursors' - " Plug 'kaicataldo/material.vim' - " Plug 'tomasiser/vim-code-dark' - " Plug 'mg979/vim-xtabline' - " Files - " Plug 'tpope/vim-eunuch' - " 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' - " 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 'preservim/nerdcommenter' - " Plug 'atishay/far.vim' - " Plug 'romgrk/lib.kom' - " Plug 'brooth/far.vim' - " Debugging + " Themes + Plug 'christianchiarulli/nvcode-color-schemes.vim' + " Better Syntax Support + Plug 'sheerun/vim-polyglot' + + " Git + Plug 'airblade/vim-gitgutter' + Plug 'tpope/vim-fugitive' + Plug 'tpope/vim-rhubarb' + Plug 'junegunn/gv.vim' + Plug 'rhysd/git-messenger.vim' + " Easily Create Gists + Plug 'mattn/vim-gist' + Plug 'mattn/webapi-vim' + + " Webdev + " Auto change html tags + Plug 'AndrewRadev/tagalong.vim' + " Closetags + Plug 'alvan/vim-closetag' + " Colorizer + Plug 'norcalli/nvim-colorizer.lua' + " live server + Plug 'turbio/bracey.vim' endif call plug#end() -- cgit v1.2.3