summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorchristianchiarulli <[email protected]>2021-07-01 23:42:26 -0400
committerchristianchiarulli <[email protected]>2021-07-01 23:42:26 -0400
commit20ed47e21e966a5b857ef9970ae6171b3a504ce1 (patch)
tree92bdefc7589545f4429a55b53e4493ad7832e632 /lua
parent9bb4f8a085644914c79343b48c808509311ee203 (diff)
lsp in ftplugin austonautomoy
Diffstat (limited to 'lua')
-rw-r--r--lua/default-config.lua46
-rw-r--r--lua/lsp/angular-ls.lua1
-rw-r--r--lua/lsp/bash-ls.lua6
-rw-r--r--lua/lsp/clangd.lua13
-rw-r--r--lua/lsp/cmake-ls.lua5
-rw-r--r--lua/lsp/css-ls.lua8
-rw-r--r--lua/lsp/dart-ls.lua11
-rw-r--r--lua/lsp/docker-ls.lua6
-rw-r--r--lua/lsp/efm-general-ls.lua61
-rw-r--r--lua/lsp/elixir-ls.lua10
-rw-r--r--lua/lsp/elm-ls.lua9
-rw-r--r--lua/lsp/emmet-ls.lua2
-rw-r--r--lua/lsp/go-ls.lua22
-rw-r--r--lua/lsp/graphql-ls.lua2
-rw-r--r--lua/lsp/html-ls.lua9
-rw-r--r--lua/lsp/java-ls.lua50
-rw-r--r--lua/lsp/js-ts-ls.lua67
-rw-r--r--lua/lsp/json-ls.lua28
-rw-r--r--lua/lsp/kotlin-ls.lua36
-rw-r--r--lua/lsp/latex-ls.lua4
-rw-r--r--lua/lsp/lua-ls.lua41
-rw-r--r--lua/lsp/php-ls.lua4
-rw-r--r--lua/lsp/python-ls.lua38
-rw-r--r--lua/lsp/ruby-ls.lua24
-rw-r--r--lua/lsp/rust-ls.lua87
-rw-r--r--lua/lsp/svelte-ls.lua1
-rw-r--r--lua/lsp/tailwindcss-ls.lua1
-rw-r--r--lua/lsp/terraform-ls.lua5
-rw-r--r--lua/lsp/vim-ls.lua5
-rw-r--r--lua/lsp/vue-ls.lua6
-rw-r--r--lua/lsp/yaml-ls.lua5
-rw-r--r--lua/lv-autopairs/init.lua1
-rw-r--r--lua/plugins.lua3
33 files changed, 23 insertions, 594 deletions
diff --git a/lua/default-config.lua b/lua/default-config.lua
index 407e4c1f..efb94f01 100644
--- a/lua/default-config.lua
+++ b/lua/default-config.lua
@@ -67,7 +67,6 @@ O = {
lang = {
python = {
- active = false,
linter = '',
-- @usage can be 'yapf', 'black'
formatter = '',
@@ -85,11 +84,9 @@ O = {
}
},
dart = {
- active = false,
sdk_path = '/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot'
},
lua = {
- active = false,
-- @usage can be 'lua-format'
formatter = '',
autoformat = false,
@@ -100,7 +97,6 @@ O = {
}
},
sh = {
- active = false,
-- @usage can be 'shellcheck'
linter = '',
-- @usage can be 'shfmt'
@@ -113,7 +109,6 @@ O = {
}
},
tsserver = {
- active = false,
-- @usage can be 'eslint'
linter = '',
-- @usage can be 'prettier'
@@ -126,7 +121,6 @@ O = {
}
},
json = {
- active = false,
-- @usage can be 'prettier'
formatter = '',
autoformat = false,
@@ -137,14 +131,12 @@ O = {
}
},
tailwindcss = {
- active = false,
filetypes = {
'html', 'css', 'scss', 'javascript', 'javascriptreact',
'typescript', 'typescriptreact'
}
},
clang = {
- active = false,
diagnostics = {
virtual_text = {spacing = 0, prefix = "ï„‘"},
signs = true,
@@ -152,7 +144,6 @@ O = {
}
},
ruby = {
- active = false,
diagnostics = {
virtualtext = {spacing = 0, prefix = "ï„‘"},
signs = true,
@@ -160,13 +151,12 @@ O = {
},
filetypes = {'rb', 'erb', 'rakefile'}
},
- go = {active = false},
- elixir = {active = false},
- vim = {active = false},
- yaml = {active = false},
- terraform = {active = false},
+ go = {},
+ elixir = {},
+ vim = {},
+ yaml = {},
+ terraform = {},
rust = {
- active = false,
linter = '',
formatter = '',
autoformat = false,
@@ -176,21 +166,19 @@ O = {
underline = true
}
},
- svelte = {active = false},
- php = {active = false},
- latex = {active = false},
- kotlin = {active = false},
- html = {active = false},
- elm = {active = false},
- emmet = {active = false},
- graphql = {active = false},
- efm = {active = true},
- docker = {active = false},
- cmake = {active = false},
- java = {active = false},
+ svelte = {},
+ php = {},
+ latex = {},
+ kotlin = {},
+ html = {},
+ elm = {},
+ emmet = {active = true},
+ graphql = {},
+ efm = {},
+ docker = {},
+ cmake = {},
+ java = {},
css = {
- active = false,
-
formatter = '',
autoformat = false,
virtual_text = true
diff --git a/lua/lsp/angular-ls.lua b/lua/lsp/angular-ls.lua
index 9f5e6245..64a66c21 100644
--- a/lua/lsp/angular-ls.lua
+++ b/lua/lsp/angular-ls.lua
@@ -1,3 +1,4 @@
+-- TODO find correct root filetype
-- :LspInstall angular
require'lspconfig'.angularls.setup {
cmd = {DATA_PATH .. "/lspinstall/angular/node_modules/@angular/language-server/bin/ngserver", "--stdio"},
diff --git a/lua/lsp/bash-ls.lua b/lua/lsp/bash-ls.lua
deleted file mode 100644
index 7b430a6e..00000000
--- a/lua/lsp/bash-ls.lua
+++ /dev/null
@@ -1,6 +0,0 @@
--- npm i -g bash-language-server
-require'lspconfig'.bashls.setup {
- cmd = {DATA_PATH .. "/lspinstall/bash/node_modules/.bin/bash-language-server", "start"},
- on_attach = require'lsp'.common_on_attach,
- filetypes = { "sh", "zsh" }
-}
diff --git a/lua/lsp/clangd.lua b/lua/lsp/clangd.lua
deleted file mode 100644
index 594c375b..00000000
--- a/lua/lsp/clangd.lua
+++ /dev/null
@@ -1,13 +0,0 @@
-require'lspconfig'.clangd.setup {
- cmd = {DATA_PATH .. "/lspinstall/cpp/clangd/bin/clangd"},
- on_attach = require'lsp'.common_on_attach,
- handlers = {
- ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
- virtual_text = O.lang.clang.diagnostics.virtual_text,
- signs = O.lang.clang.diagnostics.signs,
- underline = O.lang.clang.diagnostics.underline,
- update_in_insert = true
-
- })
- }
-}
diff --git a/lua/lsp/cmake-ls.lua b/lua/lsp/cmake-ls.lua
deleted file mode 100644
index a9647118..00000000
--- a/lua/lsp/cmake-ls.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-require'lspconfig'.cmake.setup {
- cmd = {DATA_PATH .. '/lspinstall/cmake/venv/bin/cmake-language-server'},
- on_attach = require'lsp'.common_on_attach,
- filetypes = {"cmake"},
-}
diff --git a/lua/lsp/css-ls.lua b/lua/lsp/css-ls.lua
deleted file mode 100644
index f68256a4..00000000
--- a/lua/lsp/css-ls.lua
+++ /dev/null
@@ -1,8 +0,0 @@
--- npm install -g vscode-css-languageserver-bin
-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
-}
diff --git a/lua/lsp/dart-ls.lua b/lua/lsp/dart-ls.lua
deleted file mode 100644
index fe4898e8..00000000
--- a/lua/lsp/dart-ls.lua
+++ /dev/null
@@ -1,11 +0,0 @@
-require'lspconfig'.dartls.setup{
- cmd = { "dart", O.lang.dart.sdk_path, "--lsp" },
- on_attach = require'lsp'.common_on_attach,
- init_options = {
- closingLabels = false,
- flutterOutline = false,
- onlyAnalyzeProjectsWithOpenFiles = false,
- outline = false,
- suggestFromUnimportedLibraries = true
- }
-}
diff --git a/lua/lsp/docker-ls.lua b/lua/lsp/docker-ls.lua
deleted file mode 100644
index b477a239..00000000
--- a/lua/lsp/docker-ls.lua
+++ /dev/null
@@ -1,6 +0,0 @@
--- npm install -g dockerfile-language-server-nodejs
-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
-}
diff --git a/lua/lsp/efm-general-ls.lua b/lua/lsp/efm-general-ls.lua
index d85bc216..8b4b8449 100644
--- a/lua/lsp/efm-general-ls.lua
+++ b/lua/lsp/efm-general-ls.lua
@@ -1,62 +1,4 @@
-- Example configuations here: https://github.com/mattn/efm-langserver
--- TODO this file needs to be refactored eache lang should be it's own file
--- python
-local python_arguments = {}
-
--- TODO replace with path argument
-local flake8 = {
- LintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -",
- lintStdin = true,
- lintFormats = {"%f:%l:%c: %m"}
-}
-
-local isort = {formatCommand = "isort --quiet -", formatStdin = true}
-
-local yapf = {formatCommand = "yapf --quiet", formatStdin = true}
-local black = {formatCommand = "black --quiet -", formatStdin = true}
-
-if O.lang.python.linter == 'flake8' then table.insert(python_arguments, flake8) end
-
-if O.lang.python.isort then table.insert(python_arguments, isort) end
-
-if O.lang.python.formatter == 'yapf' then
- table.insert(python_arguments, yapf)
-elseif O.lang.python.formatter == 'black' then
- table.insert(python_arguments, black)
-end
-
--- lua
-local lua_arguments = {}
-
-local luaFormat = {
- formatCommand = "lua-format -i --no-keep-simple-function-one-line --column-limit=80",
- formatStdin = true
-}
-
-local lua_fmt = {
- formatCommand = "luafmt --indent-count 2 --line-width 120 --stdin",
- formatStdin = true
-}
-
-if O.lang.lua.formatter == 'lua-format' then
- table.insert(lua_arguments, luaFormat)
-elseif O.lang.lua.formatter == 'lua-fmt' then
- table.insert(lua_arguments, lua_fmt)
-end
-
--- sh
-local sh_arguments = {}
-
-local shfmt = {formatCommand = 'shfmt -ci -s -bn', formatStdin = true}
-
-local shellcheck = {
- LintCommand = 'shellcheck -f gcc -x',
- lintFormats = {'%f:%l:%c: %trror: %m', '%f:%l:%c: %tarning: %m', '%f:%l:%c: %tote: %m'}
-}
-
-if O.lang.sh.formatter == 'shfmt' then table.insert(sh_arguments, shfmt) end
-
-if O.lang.sh.linter == 'shellcheck' then table.insert(sh_arguments, shellcheck) end
-- tsserver/web javascript react, vue, json, html, css, yaml
local prettier = {formatCommand = "prettier --stdin-filepath ${INPUT}", formatStdin = true}
@@ -96,9 +38,6 @@ require"lspconfig".efm.setup {
settings = {
rootMarkers = {".git/"},
languages = {
- python = python_arguments,
- lua = lua_arguments,
- sh = sh_arguments,
javascript = tsserver_args,
javascriptreact = tsserver_args,
typescript = tsserver_args,
diff --git a/lua/lsp/elixir-ls.lua b/lua/lsp/elixir-ls.lua
deleted file mode 100644
index 418b4c4d..00000000
--- a/lua/lsp/elixir-ls.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-require'lspconfig'.elixirls.setup{
- cmd = { DATA_PATH .. "/lspinstall/elixir/elixir-ls/language_server.sh"};
-}
-
--- needed for the LSP to recognize elixir files (alternativly just use elixir-editors/vim-elixir)
-vim.cmd([[
- au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
- au BufRead,BufNewFile *.eex,*.leex,*.sface set filetype=eelixir
- au BufRead,BufNewFile mix.lock set filetype=elixir
-]]) \ No newline at end of file
diff --git a/lua/lsp/elm-ls.lua b/lua/lsp/elm-ls.lua
deleted file mode 100644
index 3572a607..00000000
--- a/lua/lsp/elm-ls.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-require'lspconfig'.elmls.setup {
- cmd = {DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-language-server"},
- init_options= {
- elmAnalyseTrigger = "change",
- elmFormatPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-format",
- elmPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm",
- elmTestPath = DATA_PATH .. "/lspinstall/elm/node_modules/.bin/elm-test"
- }
-}
diff --git a/lua/lsp/emmet-ls.lua b/lua/lsp/emmet-ls.lua
index 6531ccf0..46d6c90d 100644
--- a/lua/lsp/emmet-ls.lua
+++ b/lua/lsp/emmet-ls.lua
@@ -6,7 +6,7 @@ capabilities.textDocument.completion.completionItem.snippetSupport = true
configs.emmet_ls = {
default_config = {
cmd = {'emmet-ls', '--stdio'};
- filetypes = {'html', 'css'};
+ filetypes = {'html', 'css', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact'};
root_dir = function()
return vim.loop.cwd()
end;
diff --git a/lua/lsp/go-ls.lua b/lua/lsp/go-ls.lua
deleted file mode 100644
index b2d6a82a..00000000
--- a/lua/lsp/go-ls.lua
+++ /dev/null
@@ -1,22 +0,0 @@
-require'lspconfig'.gopls.setup {
- cmd = {DATA_PATH .. "/lspinstall/go/gopls"},
- settings = {gopls = {analyses = {unusedparams = true}, staticcheck = true}},
- root_dir = require'lspconfig'.util.root_pattern(".git", "go.mod"),
- init_options = {usePlaceholders = true, completeUnimported = true},
- on_attach = require'lsp'.common_on_attach
-}
-
-if O.lang.go.autoformat then
- require('lv-utils').define_augroups({
- _go_format = {
- {'BufWritePre', '*.go', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
- },
- _go = {
- -- Go generally requires Tabs instead of spaces.
- {'FileType', 'go', 'setlocal tabstop=4'},
- {'FileType', 'go', 'setlocal shiftwidth=4'},
- {'FileType', 'go', 'setlocal softtabstop=4'},
- {'FileType', 'go', 'setlocal noexpandtab'}
- }
- })
-end
diff --git a/lua/lsp/graphql-ls.lua b/lua/lsp/graphql-ls.lua
deleted file mode 100644
index 0bd97ed5..00000000
--- a/lua/lsp/graphql-ls.lua
+++ /dev/null
@@ -1,2 +0,0 @@
--- npm install -g graphql-language-service-cli
-require'lspconfig'.graphql.setup {on_attach = require'lsp'.common_on_attach}
diff --git a/lua/lsp/html-ls.lua b/lua/lsp/html-ls.lua
deleted file mode 100644
index f3027fb8..00000000
--- a/lua/lsp/html-ls.lua
+++ /dev/null
@@ -1,9 +0,0 @@
--- npm install -g vscode-html-languageserver-bin
-local capabilities = vim.lsp.protocol.make_client_capabilities()
-capabilities.textDocument.completion.completionItem.snippetSupport = true
-
-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
-}
diff --git a/lua/lsp/java-ls.lua b/lua/lsp/java-ls.lua
deleted file mode 100644
index 0b151b66..00000000
--- a/lua/lsp/java-ls.lua
+++ /dev/null
@@ -1,50 +0,0 @@
-local util = require 'lspconfig/util'
--- In Vimscript
--- augroup lsp
--- au!
--- au FileType java lua require('jdtls').start_or_attach({cmd = {'java-linux-ls'}})
--- augroup end
--- find_root looks for parent directories relative to the current buffer containing one of the given arguments.
--- require'lspconfig'.jdtls.setup {cmd = {'java-linux-ls'}}
--- if vim.fn.has("mac") == 1 then
--- JAVA_LS_EXECUTABLE = 'java-mac-ls'
--- elseif vim.fn.has("unix") == 1 then
--- JAVA_LS_EXECUTABLE = 'java-linux-ls'
--- else
--- print("Unsupported system")
--- end
-
--- local bundles = {
--- vim.fn.glob(
--- CONFIG_PATH.."/.debuggers/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar")
--- };
-
-local on_attach = function(client, bufr)
- -- require('jdtls').setup_dap()
- require'lsp'.common_on_attach(client, bufr)
-end
-
-require'lspconfig'.jdtls.setup {
- on_attach = on_attach,
- cmd = {DATA_PATH .. "/lspinstall/java/jdtls.sh"},
- filetypes = { "java" },
- root_dir = util.root_pattern({'.git', 'build.gradle', 'pom.xml'}),
- -- init_options = {bundles = bundles}
- -- on_attach = require'lsp'.common_on_attach
-}
-
--- require('jdtls').start_or_attach({
--- on_attach = on_attach,
--- cmd = {DATA_PATH .. "/lspinstall/java/jdtls.sh"},
--- root_dir = require('jdtls.setup').find_root({'build.gradle', 'pom.xml', '.git'}),
--- init_options = {bundles = bundles}
--- })
-
--- TODO setup autoformat stuff later
- -- _java = {
- -- -- {'FileType', 'java', 'luafile '..CONFIG_PATH..'/lua/lsp/java-ls.lua'},
- -- {
- -- 'FileType', 'java',
- -- 'nnoremap ca <Cmd>lua require(\'jdtls\').code_action()<CR>'
- -- }
- -- }
diff --git a/lua/lsp/js-ts-ls.lua b/lua/lsp/js-ts-ls.lua
deleted file mode 100644
index 6fe4dd63..00000000
--- a/lua/lsp/js-ts-ls.lua
+++ /dev/null
@@ -1,67 +0,0 @@
--- npm install -g typescript typescript-language-server
--- require'snippets'.use_suggested_mappings()
--- local capabilities = vim.lsp.protocol.make_client_capabilities()
--- capabilities.textDocument.completion.completionItem.snippetSupport = true;
--- local on_attach_common = function(client)
--- print("LSP Initialized")
--- require'completion'.on_attach(client)
--- require'illuminate'.on_attach(client)
--- end
-require'lspconfig'.tsserver.setup {
- cmd = {
- DATA_PATH ..
- "/lspinstall/typescript/node_modules/.bin/typescript-language-server",
- "--stdio"
- },
- filetypes = {
- "javascript", "javascriptreact", "javascript.jsx", "typescript",
- "typescriptreact", "typescript.tsx"
- },
- on_attach = require'lsp'.tsserver_on_attach,
- -- This makes sure tsserver is not used for formatting (I prefer prettier)
- -- on_attach = require'lsp'.common_on_attach,
- root_dir = require('lspconfig/util').root_pattern("package.json",
- "tsconfig.json",
- "jsconfig.json", ".git"),
- settings = {documentFormatting = false},
- handlers = {
- ["textDocument/publishDiagnostics"] = vim.lsp.with(
- vim.lsp.diagnostic.on_publish_diagnostics, {
- virtual_text = O.lang.tsserver.diagnostics.virtual_text,
- signs = O.lang.tsserver.diagnostics.signs,
- underline = O.lang.tsserver.diagnostics.underline,
- update_in_insert = true
-
- })
- }
-}
-
-if O.lang.tsserver.autoformat then
- require('lv-utils').define_augroups({
- _javascript_autoformat = {
- {
-
- 'BufWritePre', '*.js',
- 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
- }
- },
- _javascriptreact_autoformat = {
- {
- 'BufWritePre', '*.jsx',
- 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
- }
- },
- _typescript_autoformat = {
- {
- 'BufWritePre', '*.ts',
- 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
- }
- },
- _typescriptreact_autoformat = {
- {
- 'BufWritePre', '*.tsx',
- 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
- }
- }
- })
-end
diff --git a/lua/lsp/json-ls.lua b/lua/lsp/json-ls.lua
deleted file mode 100644
index 3a565095..00000000
--- a/lua/lsp/json-ls.lua
+++ /dev/null
@@ -1,28 +0,0 @@
--- npm install -g vscode-json-languageserver
-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,
-
- commands = {
- Format = {
- function()
- vim.lsp.buf.range_formatting({}, {0, 0}, {vim.fn.line("$"), 0})
- end
- }
- }
-}
-
-if O.lang.json.autoformat then
- require('lv-utils').define_augroups({
- _json_format = {
- {
- 'BufWritePre', '*.json',
- 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
- }
- }
- })
-end
diff --git a/lua/lsp/kotlin-ls.lua b/lua/lsp/kotlin-ls.lua
deleted file mode 100644
index fcbb736b..00000000
--- a/lua/lsp/kotlin-ls.lua
+++ /dev/null
@@ -1,36 +0,0 @@
---- default config for gradle-projects of the
---- kotlin-language-server: https://github.com/fwcd/kotlin-language-server
----
---- This server requires vim to be aware of the kotlin-filetype.
---- You could refer for this capability to:
---- https://github.com/udalov/kotlin-vim (recommended)
---- Note that there is no LICENSE specified yet.
-
-local util = require 'lspconfig/util'
-
-local bin_name = DATA_PATH .. "/lspinstall/kotlin/server/bin/kotlin-language-server"
-if vim.fn.has('win32') == 1 then
- bin_name = bin_name..".bat"
-end
-
-local root_files = {
- 'settings.gradle', -- Gradle (multi-project)
- 'settings.gradle.kts', -- Gradle (multi-project)
- 'build.xml', -- Ant
- 'pom.xml', -- Maven
-}
-
-local fallback_root_files = {
- 'build.gradle', -- Gradle
- 'build.gradle.kts', -- Gradle
-}
-
-require'lspconfig'.kotlin_language_server.setup {
- cmd = {bin_name},
- on_attach = require'lsp'.common_on_attach,
- root_dir = function(fname)
- return util.root_pattern(unpack(root_files))(fname) or
- util.root_pattern(unpack(fallback_root_files))(fname)
- end
-}
-
diff --git a/lua/lsp/latex-ls.lua b/lua/lsp/latex-ls.lua
deleted file mode 100644
index 179c143c..00000000
--- a/lua/lsp/latex-ls.lua
+++ /dev/null
@@ -1,4 +0,0 @@
-require'lspconfig'.texlab.setup{
- cmd = {DATA_PATH .. "/lspinstall/latex/texlab"},
- on_attach = require'lsp'.common_on_attach
-}
diff --git a/lua/lsp/lua-ls.lua b/lua/lsp/lua-ls.lua
deleted file mode 100644
index 4257605f..00000000
--- a/lua/lsp/lua-ls.lua
+++ /dev/null
@@ -1,41 +0,0 @@
--- https://github.com/sumneko/lua-language-server/wiki/Build-and-Run-(Standalone)
-local sumneko_root_path = DATA_PATH .. "/lspinstall/lua"
-local sumneko_binary = sumneko_root_path .. "/sumneko-lua-language-server"
-
-require'lspconfig'.sumneko_lua.setup {
- cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"},
- on_attach = require'lsp'.common_on_attach,
- 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
- },
- maxPreload = 10000
- }
- }
- }
-}
-if O.lang.lua.autoformat then
- require('lv-utils').define_augroups({
- _lua_autoformat = {
- {
- 'BufWritePre', '*.lua',
- 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
- }
- }
- })
-end
-
diff --git a/lua/lsp/php-ls.lua b/lua/lsp/php-ls.lua
deleted file mode 100644
index abc90092..00000000
--- a/lua/lsp/php-ls.lua
+++ /dev/null
@@ -1,4 +0,0 @@
-require'lspconfig'.intelephense.setup {
- cmd = { DATA_PATH .. "/lspinstall/php/node_modules/.bin/intelephense", "--stdio" },
- on_attach = require'lsp'.common_on_attach
-} \ No newline at end of file
diff --git a/lua/lsp/python-ls.lua b/lua/lsp/python-ls.lua
deleted file mode 100644
index e2ccf42e..00000000
--- a/lua/lsp/python-ls.lua
+++ /dev/null
@@ -1,38 +0,0 @@
--- npm i -g pyright
-require'lspconfig'.pyright.setup {
- cmd = {
- DATA_PATH .. "/lspinstall/python/node_modules/.bin/pyright-langserver",
- "--stdio"
- },
- on_attach = require'lsp'.common_on_attach,
- handlers = {
- ["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic
- .on_publish_diagnostics,
- {
- virtual_text = O.lang.python.diagnostics.virtual_text,
- signs = O.lang.python.diagnostics.signs,
- underline = O.lang.python.diagnostics.underline,
- update_in_insert = true
- })
- },
- settings = {
- python = {
- analysis = {
- typeCheckingMode = O.lang.python.analysis.type_checking,
- autoSearchPaths = O.lang.python.analysis.auto_search_paths,
- useLibraryCodeForTypes = O.lang.python.analysis
- .use_library_code_types
- }
- }
- }
-}
-if O.lang.python.autoformat then
- require('lv-utils').define_augroups({
- _python_autoformat = {
- {
- 'BufWritePre', '*.py',
- 'lua vim.lsp.buf.formatting_sync(nil, 1000)'
- }
- }
- })
-end
diff --git a/lua/lsp/ruby-ls.lua b/lua/lsp/ruby-ls.lua
deleted file mode 100644
index f46a71f8..00000000
--- a/lua/lsp/ruby-ls.lua
+++ /dev/null
@@ -1,24 +0,0 @@
--- If you are using rvm, make sure to change below configuration
-require'lspconfig'.solargraph.setup {
- cmd = {DATA_PATH .. "/lspinstall/ruby/solargraph/solargraph", "--stdio"},
- on_attach = require'lsp'.common_on_attach,
- handlers = {
- ["textDocument/publishDiagnostics"] = vim.lsp.with(
- vim.lsp.diagnostic.on_publish_diagnostics, {
- virtual_text = O.lang.ruby.diagnostics.virtual_text,
- signs = O.lang.ruby.diagnostics.signs,
- underline = O.lang.ruby.diagnostics.underline,
- update_in_insert = true
-
- })
- },
- filetypes = O.lang.ruby.filetypes
-}
-
-if O.lang.ruby.autoformat then
- require('lv-utils').define_augroups({
- _ruby_format = {
- {'BufWritePre', '*.rb', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
- }
- })
-end
diff --git a/lua/lsp/rust-ls.lua b/lua/lsp/rust-ls.lua
deleted file mode 100644
index d210cadb..00000000
--- a/lua/lsp/rust-ls.lua
+++ /dev/null
@@ -1,87 +0,0 @@
-local opts = {
- tools = { -- rust-tools options
- -- automatically set inlay hints (type hints)
- -- There is an issue due to which the hints are not applied on the first
- -- opened file. For now, write to the file to trigger a reapplication of
- -- the hints or just run :RustSetInlayHints.
- -- default: true
- autoSetHints = true,
-
- -- whether to show hover actions inside the hover window
- -- this overrides the default hover handler
- -- default: true
- hover_with_actions = true,
-
- runnables = {
- -- whether to use telescope for selection menu or not
- -- default: true
- use_telescope = true
-
- -- rest of the opts are forwarded to telescope
- },
-
- inlay_hints = {
- -- wheter to show parameter hints with the inlay hints or not
- -- default: true
- show_parameter_hints = true,
-
- -- prefix for parameter hints
- -- default: "<-"
- parameter_hints_prefix = "<-",
-
- -- prefix for all the other hints (type, chaining)
- -- default: "=>"
- other_hints_prefix = "=>",
-
- -- whether to align to the lenght of the longest line in the file
- max_len_align = false,
-
- -- padding from the left if max_len_align is true
- max_len_align_padding = 1,
-
- -- whether to align to the extreme right or not
- right_align = false,
-
- -- padding from the right if right_align is true
- right_align_padding = 7
- },
-
- hover_actions = {
- -- the border that is used for the hover window
- -- see vim.api.nvim_open_win()
- border = {
- {"╭", "FloatBorder"}, {"─", "FloatBorder"},
- {"╮", "FloatBorder"}, {"│", "FloatBorder"},
- {"╯", "FloatBorder"}, {"─", "FloatBorder"},
- {"╰", "FloatBorder"}, {"│", "FloatBorder"}
- }
- }
- },
-
- -- all the opts to send to nvim-lspconfig
- -- these override the defaults set by rust-tools.nvim
- -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
- server = {
- cmd = {DATA_PATH .. "/lspinstall/rust/rust-analyzer"},
- on_attach = require'lsp'.common_on_attach
- } -- rust-analyser options
-}
-
-require('rust-tools').setup(opts)
-
--- TODO add this later
-vim.api.nvim_exec([[
- autocmd Filetype rust nnoremap <leader>lm <Cmd>RustExpandMacro<CR>
- autocmd Filetype rust nnoremap <leader>lH <Cmd>RustToggleInlayHints<CR>
- autocmd Filetype rust nnoremap <leader>le <Cmd>RustRunnables<CR>
- autocmd Filetype rust nnoremap <leader>lh <Cmd>RustHoverActions<CR>
- ]], true)
-
-if O.lang.rust.autoformat then
- require('lv-utils').define_augroups({
- _rust_format = {
- {'BufWritePre', '*.rs', 'lua vim.lsp.buf.formatting_sync(nil,1000)'}
- }
- })
-end
-
diff --git a/lua/lsp/svelte-ls.lua b/lua/lsp/svelte-ls.lua
index 753f7046..b9e8a5f8 100644
--- a/lua/lsp/svelte-ls.lua
+++ b/lua/lsp/svelte-ls.lua
@@ -1,3 +1,4 @@
+-- TODO what is a svelte filetype
require'lspconfig'.svelte.setup {
cmd = {DATA_PATH .. "/lspinstall/svelte/node_modules/.bin/svelteserver", "--stdio"},
on_attach = require'lsp'.common_on_attach
diff --git a/lua/lsp/tailwindcss-ls.lua b/lua/lsp/tailwindcss-ls.lua
index 923eb5d5..87cd924c 100644
--- a/lua/lsp/tailwindcss-ls.lua
+++ b/lua/lsp/tailwindcss-ls.lua
@@ -1,3 +1,4 @@
+-- TODO what is a tailwindcss filetype
local lspconfig = require 'lspconfig'
lspconfig.tailwindcss.setup {
diff --git a/lua/lsp/terraform-ls.lua b/lua/lsp/terraform-ls.lua
deleted file mode 100644
index a2e751a4..00000000
--- a/lua/lsp/terraform-ls.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-require'lspconfig'.terraformls.setup{
- cmd = {DATA_PATH .. "/lspinstall/terraform/terraform-ls", "serve"},
- on_attach = require'lsp'.common_on_attach,
- filetypes = { "tf", "terraform", "hcl" }
-}
diff --git a/lua/lsp/vim-ls.lua b/lua/lsp/vim-ls.lua
deleted file mode 100644
index 39beb119..00000000
--- a/lua/lsp/vim-ls.lua
+++ /dev/null
@@ -1,5 +0,0 @@
--- npm install -g vim-language-server
-require'lspconfig'.vimls.setup {
- cmd = {DATA_PATH .. "/lspinstall/vim/node_modules/.bin/vim-language-server", "--stdio"},
- on_attach = require'lsp'.common_on_attach
-}
diff --git a/lua/lsp/vue-ls.lua b/lua/lsp/vue-ls.lua
deleted file mode 100644
index f18fe2ab..00000000
--- a/lua/lsp/vue-ls.lua
+++ /dev/null
@@ -1,6 +0,0 @@
-
-require('lspconfig').vuels.setup {
- cmd = {DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls", "--stdio"},
- on_attach = require'lsp'.common_on_attach,
- root_dir = require('lspconfig').util.root_pattern(".git", ".")
-}
diff --git a/lua/lsp/yaml-ls.lua b/lua/lsp/yaml-ls.lua
deleted file mode 100644
index 3fbc41e4..00000000
--- a/lua/lsp/yaml-ls.lua
+++ /dev/null
@@ -1,5 +0,0 @@
--- npm install -g yaml-language-server
-require'lspconfig'.yamlls.setup{
- cmd = {DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server", "--stdio"},
- on_attach = require'lsp'.common_on_attach,
-}
diff --git a/lua/lv-autopairs/init.lua b/lua/lv-autopairs/init.lua
index 458f0d57..fb1300a2 100644
--- a/lua/lv-autopairs/init.lua
+++ b/lua/lv-autopairs/init.lua
@@ -1,4 +1,3 @@
-local remap = vim.api.nvim_set_keymap
local npairs = require('nvim-autopairs')
local Rule = require('nvim-autopairs.rule')
diff --git a/lua/plugins.lua b/lua/plugins.lua
index ccd1efa7..c15b0b27 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -35,10 +35,11 @@ return require("packer").startup(function(use)
-- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function)
use {"neovim/nvim-lspconfig"}
use {"glepnir/lspsaga.nvim", event = "BufRead"}
- use {"kabouzeid/nvim-lspinstall", event = "BufRead"}
+ use {"kabouzeid/nvim-lspinstall"}
-- Telescope
use {"nvim-lua/popup.nvim"}
use {"nvim-lua/plenary.nvim"}
+ use {"tjdevries/astronauta.nvim"}
use {
"nvim-telescope/telescope.nvim",
config = [[require('lv-telescope')]],