add support LspInstall where possible

This commit is contained in:
Chris 2021-03-25 19:58:40 -04:00
parent 36e9fdf69e
commit f52a6870a7
13 changed files with 67 additions and 36 deletions

View file

@ -151,6 +151,8 @@ To set up your particular debugger, look here:
**HIGH PRIORITY** **HIGH PRIORITY**
Move user config into `config.lua` Move user config into `config.lua`
ts-comment string for react
update lang-servers to use LspInstall
From here I will update for bug fixes and implement low priority From here I will update for bug fixes and implement low priority
features when I have time features when I have time
@ -159,7 +161,6 @@ features when I have time
- list all binaries needed for formatters and linters - list all binaries needed for formatters and linters
- add badges to readme - add badges to readme
- json config file (luajson)
- Implement what I can from this java config: - Implement what I can from this java config:
[link](https://github.com/mfussenegger/nvim-jdtls/wiki/Sample-Configurations) [link](https://github.com/mfussenegger/nvim-jdtls/wiki/Sample-Configurations)
- better ui for code actions - formatting - better ui for code actions - formatting
@ -172,10 +173,8 @@ features when I have time
- what is `fzy` - what is `fzy`
- https://github.com/pwntester/octo.nvim - https://github.com/pwntester/octo.nvim
- configure surround - configure surround
- move to ultisnips - maybe incorporate ultisnips
**PLUGIN BUGS** **PLUGIN BUGS**
- html snippets are broken with vsnip - html snippets are broken with vsnip
- keep and eye on indent guides plugin for thin lines
- better auto-import (jsx)

View file

@ -1,2 +1,5 @@
-- npm i -g bash-language-server -- npm i -g bash-language-server
require'lspconfig'.bashls.setup {on_attach = require'lsp'.common_on_attach} require'lspconfig'.bashls.setup {
cmd = {DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start"},
on_attach = require'lsp'.common_on_attach
}

View file

@ -1,2 +1,8 @@
-- npm install -g vscode-css-languageserver-bin -- npm install -g vscode-css-languageserver-bin
require'lspconfig'.cssls.setup {on_attach = require'lsp'.common_on_attach} require'lspconfig'.cssls.setup {
cmd = {
"node", DATA_PATH .. "/lspinstall/css/vscode-css/css-language-features/server/dist/node/cssServerMain.js",
"--stdio"
},
on_attach = require'lsp'.common_on_attach
}

View file

@ -1,2 +1,6 @@
-- npm install -g dockerfile-language-server-nodejs -- npm install -g dockerfile-language-server-nodejs
require'lspconfig'.dockerls.setup {on_attach = require'lsp'.common_on_attach} require'lspconfig'.dockerls.setup {
cmd = {DATA_PATH .. "/lspinstall/dockerfile/node_modules/.bin/docker-langserver", "--stdio"},
on_attach = require'lsp'.common_on_attach,
root_dir = vim.loop.cwd
}

View file

@ -45,6 +45,7 @@ local markdownPandocFormat = {formatCommand = 'pandoc -f markdown -t gfm -sp --t
require"lspconfig".efm.setup { require"lspconfig".efm.setup {
-- init_options = {initializationOptions}, -- init_options = {initializationOptions},
cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" },
init_options = {documentFormatting = true, codeAction = false}, init_options = {documentFormatting = true, codeAction = false},
filetypes = {"lua", "python", "javascriptreact", "javascript", "sh", "html", "css", "json", "yaml", "markdown"}, filetypes = {"lua", "python", "javascriptreact", "javascript", "sh", "html", "css", "json", "yaml", "markdown"},
settings = { settings = {

View file

@ -2,4 +2,8 @@
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true capabilities.textDocument.completion.completionItem.snippetSupport = true
require'lspconfig'.html.setup {on_attach = require'lsp'.common_on_attach, capabilities = capabilities} require'lspconfig'.html.setup {
cmd = {"node", DATA_PATH .. "/lspinstall/html/vscode-html/html-language-features/server/dist/node/htmlServerMain.js", "--stdio"},
on_attach = require'lsp'.common_on_attach,
capabilities = capabilities
}

View file

@ -1,6 +1,11 @@
-- npm install -g vscode-json-languageserver -- npm install -g vscode-json-languageserver
require'lspconfig'.jsonls.setup { require'lspconfig'.jsonls.setup {
cmd = {
"node", DATA_PATH .. "/lspinstall/json/vscode-json/json-language-features/server/dist/node/jsonServerMain.js",
"--stdio"
},
on_attach = require'lsp'.common_on_attach, on_attach = require'lsp'.common_on_attach,
commands = { commands = {
Format = { Format = {
function() function()

View file

@ -1,2 +1,5 @@
-- npm install -g vim-language-server -- npm install -g vim-language-server
require'lspconfig'.vimls.setup {on_attach = require'lsp'.common_on_attach} require'lspconfig'.vimls.setup {
cmd = {DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server", "--stdio"},
on_attach = require'lsp'.common_on_attach
}

View file

@ -1,4 +1,5 @@
-- npm install -g yaml-language-server -- npm install -g yaml-language-server
require'lspconfig'.yamlls.setup{ require'lspconfig'.yamlls.setup{
-- on_attach = require'lsp'.common_on_attach, cmd = {DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server", "--stdio"},
on_attach = require'lsp'.common_on_attach,
} }

View file

@ -23,9 +23,10 @@ require'compe'.setup {
nvim_lua = {kind = ""}, nvim_lua = {kind = ""},
spell = {kind = ""}, spell = {kind = ""},
tags = false, tags = false,
snippets_nvim = {kind = ""}, -- snippets_nvim = {kind = "  "},
-- ultisnips = {kind = "  "},
treesitter = {kind = ""}, treesitter = {kind = ""},
emoji = {kind = ""} emoji = {kind = "", filetypes={"markdown"}}
-- for emoji press : (idk if that in compe tho) -- for emoji press : (idk if that in compe tho)
} }
} }

View file

@ -44,11 +44,13 @@ return require('packer').startup(function(use)
use 'ChristianChiarulli/java-snippets' use 'ChristianChiarulli/java-snippets'
use 'ChristianChiarulli/python-snippets' use 'ChristianChiarulli/python-snippets'
-- Treesitter -- Treesitter
use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'} use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'}
use 'nvim-treesitter/nvim-treesitter-refactor' use 'nvim-treesitter/nvim-treesitter-refactor'
use 'nvim-treesitter/playground' use 'nvim-treesitter/playground'
use 'p00f/nvim-ts-rainbow' use 'p00f/nvim-ts-rainbow'
use { 'lukas-reineke/indent-blankline.nvim', branch = 'lua'}
-- Icons -- Icons
use 'kyazdani42/nvim-web-devicons' use 'kyazdani42/nvim-web-devicons'
@ -113,10 +115,8 @@ return require('packer').startup(function(use)
use 'junegunn/goyo.vim' use 'junegunn/goyo.vim'
use 'andymass/vim-matchup' use 'andymass/vim-matchup'
use 'windwp/nvim-autopairs' use 'windwp/nvim-autopairs'
use 'blackcauldron7/surround.nvim'
-- TODO put this back when stable for indent lines -- TODO put this back when stable for indent lines
use { 'lukas-reineke/indent-blankline.nvim', branch = 'lua'}
-- vim.g.indent_blankline_space_char = '' -- vim.g.indent_blankline_space_char = ''
-- use 'b3nj5m1n/kommentary' -- use 'b3nj5m1n/kommentary'
-- use { -- use {
@ -129,7 +129,12 @@ return require('packer').startup(function(use)
-- use 'mhinz/vim-startify' -- use 'mhinz/vim-startify'
-- use 'cstrap/python-snippets' -- use 'cstrap/python-snippets'
-- use 'ylcnfrht/vscode-python-snippet-pack' -- use 'ylcnfrht/vscode-python-snippet-pack'
-- use 'SirVer/ultisnips'
-- use 'norcalli/snippets.nvim' -- use 'norcalli/snippets.nvim'
-- use {'akinsho/nvim-bufferline.lua', requires = 'kyazdani42/nvim-web-devicons'} -- use {'akinsho/nvim-bufferline.lua', requires = 'kyazdani42/nvim-web-devicons'}
-- use 'SirVer/ultisnips'
-- use 'honza/vim-snippets'
-- vim.g.UltiSnipsExpandTrigger="<CR>"
-- vim.g.UltiSnipsJumpForwardTrigger="<Tab>"
-- vim.g.UltiSnipsJumpBackwardTrigger="<S-Tab>"
-- use 'blackcauldron7/surround.nvim'
end) end)

View file

@ -3,6 +3,7 @@ vim.cmd('set shortmess+=c') -- Don't pass messages to |ins-completion-menu|.
vim.o.hidden = true -- Required to keep multiple buffers open multiple buffers vim.o.hidden = true -- Required to keep multiple buffers open multiple buffers
vim.wo.wrap = false -- Display long lines as just one line vim.wo.wrap = false -- Display long lines as just one line
vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys
vim.cmd('syntax on') -- move to next line with theses keys
vim.o.pumheight = 10 -- Makes popup menu smaller vim.o.pumheight = 10 -- Makes popup menu smaller
vim.o.fileencoding = "utf-8" -- The encoding written to file vim.o.fileencoding = "utf-8" -- The encoding written to file
vim.o.cmdheight = 2 -- More space for displaying messages vim.o.cmdheight = 2 -- More space for displaying messages

View file

@ -1,3 +1,5 @@
#!/bin/sh
set -o nounset # error when referencing undefined variable set -o nounset # error when referencing undefined variable
set -o errexit # exit when command fails set -o errexit # exit when command fails
@ -60,8 +62,7 @@ installpynvim() {
} }
installpacker() { installpacker() {
git clone https://github.com/wbthomason/packer.nvim\ git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim
~/.local/share/nvim/site/pack/packer/start/packer.nvim
} }
cloneconfig() { cloneconfig() {
@ -133,7 +134,6 @@ which node >/dev/null && echo "node installed, moving on..." || asktoinstallnode
# install pynvim # install pynvim
pip3 list | grep pynvim >/dev/null && echo "pynvim installed, moving on..." || installpynvim pip3 list | grep pynvim >/dev/null && echo "pynvim installed, moving on..." || installpynvim
if [ -a "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then if [ -a "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim" ]; then
echo 'packer already installed' echo 'packer already installed'
else else
@ -149,8 +149,6 @@ else
echo 'export PATH=$HOME/.config/nvcode/utils/bin:$PATH' >>~/.bashrc echo 'export PATH=$HOME/.config/nvcode/utils/bin:$PATH' >>~/.bashrc
fi fi
echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts" echo "I recommend you also install and activate a font from here: https://github.com/ryanoasis/nerd-fonts"
echo "I also recommend you add 'set preview_images_method ueberzug' to ~/.config/ranger/rc.conf" echo "I also recommend you add 'set preview_images_method ueberzug' to ~/.config/ranger/rc.conf"