Selaa lähdekoodia

lsp in ftplugin austonautomoy

christianchiarulli 4 vuotta sitten
vanhempi
commit
20ed47e21e

+ 0 - 0
lua/lsp/cmake-ls.lua → ftplugin/cmake.lua


+ 0 - 0
lua/lsp/clangd.lua → ftplugin/cpp.lua


+ 1 - 0
lua/lsp/css-ls.lua → ftplugin/css.lua

@@ -6,3 +6,4 @@ require'lspconfig'.cssls.setup {
     },
     on_attach = require'lsp'.common_on_attach
 }
+vim.cmd("setl ts=2 sw=2")

+ 0 - 1
ftplugin/css.vim

@@ -1 +0,0 @@
-setl ts=2 sw=2             

+ 0 - 0
lua/lsp/dart-ls.lua → ftplugin/dart.lua


+ 0 - 0
lua/lsp/docker-ls.lua → ftplugin/docker.lua


+ 0 - 0
lua/lsp/elixir-ls.lua → ftplugin/elixir.lua


+ 0 - 0
lua/lsp/elm-ls.lua → ftplugin/elm.lua


+ 0 - 0
lua/lsp/go-ls.lua → ftplugin/go.lua


+ 0 - 0
lua/lsp/graphql-ls.lua → ftplugin/graphql.lua


+ 1 - 0
lua/lsp/html-ls.lua → ftplugin/html.lua

@@ -7,3 +7,4 @@ require'lspconfig'.html.setup {
     on_attach = require'lsp'.common_on_attach,
     capabilities = capabilities
 }
+vim.cmd("setl ts=2 sw=2")

+ 0 - 1
ftplugin/html.vim

@@ -1 +0,0 @@
-setl ts=2 sw=2             

+ 0 - 0
lua/lsp/java-ls.lua → ftplugin/java.lua


+ 1 - 0
lua/lsp/js-ts-ls.lua → ftplugin/javascript.lua

@@ -65,3 +65,4 @@ if O.lang.tsserver.autoformat then
         }
     })
 end
+vim.cmd("setl ts=2 sw=2")

+ 0 - 1
ftplugin/javascript.vim

@@ -1 +0,0 @@
-setl ts=2 sw=2             

+ 68 - 0
ftplugin/javascriptreact.lua

@@ -0,0 +1,68 @@
+-- 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
+vim.cmd("setl ts=2 sw=2")

+ 0 - 1
ftplugin/javascriptreact.vim

@@ -1 +0,0 @@
-setl commentstring={/*%s*/} ts=2 sw=2             

+ 0 - 0
lua/lsp/json-ls.lua → ftplugin/json.lua


+ 0 - 0
lua/lsp/kotlin-ls.lua → ftplugin/kotlin.lua


+ 0 - 0
lua/lsp/latex-ls.lua → ftplugin/latex.lua


+ 30 - 0
lua/lsp/lua-ls.lua → ftplugin/lua.lua

@@ -39,3 +39,33 @@ if O.lang.lua.autoformat then
     })
 end
 
+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
+
+require"lspconfig".efm.setup {
+    -- init_options = {initializationOptions},
+    cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"},
+    init_options = {documentFormatting = true, codeAction = false},
+    filetypes = {"lua"},
+    settings = {
+        rootMarkers = {".git/"},
+        languages = {
+            lua = lua_arguments,
+        }
+    }
+}

+ 0 - 0
lua/lsp/php-ls.lua → ftplugin/php.lua


+ 49 - 0
lua/lsp/python-ls.lua → ftplugin/python.lua

@@ -1,3 +1,52 @@
+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
+
+require"lspconfig".efm.setup {
+    -- init_options = {initializationOptions},
+    cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"},
+    init_options = {documentFormatting = true, codeAction = false},
+    filetypes = {"lua", "python", "javascriptreact", "javascript", "typescript","typescriptreact","sh", "html", "css", "yaml", "markdown", "vue"},
+    settings = {
+        rootMarkers = {".git/", "requirements.txt"},
+        languages = {
+            python = python_arguments,
+        }
+    }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
 -- npm i -g pyright
 require'lspconfig'.pyright.setup {
     cmd = {

+ 0 - 0
lua/lsp/ruby-ls.lua → ftplugin/ruby.lua


+ 0 - 0
lua/lsp/rust-ls.lua → ftplugin/rust.lua


+ 33 - 0
ftplugin/sh.lua

@@ -0,0 +1,33 @@
+-- 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" }
+}
+
+-- 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
+
+require"lspconfig".efm.setup {
+    -- init_options = {initializationOptions},
+    cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"},
+    init_options = {documentFormatting = true, codeAction = false},
+    filetypes = {"sh"},
+    settings = {
+        rootMarkers = {".git/"},
+        languages = {
+            sh = sh_arguments,
+        }
+    }
+}

+ 0 - 0
lua/lsp/terraform-ls.lua → ftplugin/tf.lua


+ 68 - 0
ftplugin/typescript.lua

@@ -0,0 +1,68 @@
+-- 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
+vim.cmd("setl ts=2 sw=2")

+ 88 - 0
ftplugin/typescriptreact.lua

@@ -0,0 +1,88 @@
+-- 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
+vim.cmd("setl ts=2 sw=2")
+
+local nvim_lsp = require'lspconfig'
+local configs = require'lspconfig/configs'
+local capabilities = vim.lsp.protocol.make_client_capabilities()
+capabilities.textDocument.completion.completionItem.snippetSupport = true
+
+configs.emmet_ls = {
+  default_config = {
+    cmd = {'emmet-ls', '--stdio'};
+    filetypes = {'html', 'css', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact'};
+    root_dir = function()
+      return vim.loop.cwd()
+    end;
+    settings = {};
+  };
+}
+
+nvim_lsp.emmet_ls.setup{
+  -- on_attach = on_attach;
+}

+ 0 - 0
lua/lsp/vim-ls.lua → ftplugin/vim.lua


+ 0 - 1
lua/lsp/vue-ls.lua → ftplugin/vue.lua

@@ -1,4 +1,3 @@
-
 require('lspconfig').vuels.setup {
     cmd = {DATA_PATH .. "/lspinstall/vue/node_modules/.bin/vls", "--stdio"},
     on_attach = require'lsp'.common_on_attach,

+ 1 - 0
lua/lsp/yaml-ls.lua → ftplugin/yaml.lua

@@ -3,3 +3,4 @@ require'lspconfig'.yamlls.setup{
 	cmd = {DATA_PATH .. "/lspinstall/yaml/node_modules/.bin/yaml-language-server", "--stdio"},
     on_attach = require'lsp'.common_on_attach,
 }
+vim.cmd("setl ts=2 sw=2 ts=2 ai et")

+ 0 - 1
ftplugin/yaml.vim

@@ -1 +0,0 @@
-setl ts=2 sw=2 ts=2 ai et          

+ 40 - 0
ftplugin/zsh.lua

@@ -0,0 +1,40 @@
+-- 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" }
+}
+
+-- 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" }
+}
+
+-- 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
+
+require"lspconfig".efm.setup {
+    -- init_options = {initializationOptions},
+    cmd = {DATA_PATH .. "/lspinstall/efm/efm-langserver"},
+    init_options = {documentFormatting = true, codeAction = false},
+    filetypes = {"zsh"},
+    settings = {
+        rootMarkers = {".git/"},
+        languages = {
+            sh = sh_arguments,
+        }
+    }
+}

+ 0 - 34
init.lua

@@ -8,39 +8,5 @@ require('keymappings')
 require('lv-galaxyline')
 require('lv-treesitter')
 require('lv-which-key')
-
--- LSP
 require('lsp')
--- TODO should I put this in the filetype files?
-if O.lang.java.active then require('lsp.java-ls') end
-if O.lang.clang.active then require('lsp.clangd') end
-if O.lang.sh.active then require('lsp.bash-ls') end
-if O.lang.cmake.active then require('lsp.cmake-ls') end
-if O.lang.css.active then require('lsp.css-ls') end
-if O.lang.dart.active then require('lsp.dart-ls') end
-if O.lang.docker.active then require('lsp.docker-ls') end
-if O.lang.efm.active then require('lsp.efm-general-ls') end
-if O.lang.elm.active then require('lsp.elm-ls') end
 if O.lang.emmet.active then require('lsp.emmet-ls') end
-if O.lang.graphql.active then require('lsp.graphql-ls') end
-if O.lang.go.active then require('lsp.go-ls') end
-if O.lang.html.active then require('lsp.html-ls') end
-if O.lang.json.active then require('lsp.json-ls') end
-if O.lang.kotlin.active then require('lsp.kotlin-ls') end
-if O.lang.latex.active then require('lsp.latex-ls') end
-if O.lang.lua.active then require('lsp.lua-ls') end
-if O.lang.php.active then require('lsp.php-ls') end
-if O.lang.python.active then require('lsp.python-ls') end
-if O.lang.ruby.active then require('lsp.ruby-ls') end
-if O.lang.rust.active then require('lsp.rust-ls') end
-if O.lang.svelte.active then require('lsp.svelte-ls') end
-if O.lang.terraform.active then require('lsp.terraform-ls') end
-if O.lang.tailwindcss.active then require('lsp.tailwindcss-ls') end
-if O.lang.vim.active then require('lsp.vim-ls') end
-if O.lang.yaml.active then require('lsp.yaml-ls') end
-if O.lang.elixir.active then require('lsp.elixir-ls') end
-if O.lang.tsserver.active then
-    require('lsp.js-ts-ls')
-    require('lsp.angular-ls')
-    require('lsp.vue-ls')
-end

+ 17 - 29
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

+ 1 - 0
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"},

+ 0 - 6
lua/lsp/bash-ls.lua

@@ -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" }
-}

+ 0 - 61
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,

+ 1 - 1
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;

+ 1 - 0
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

+ 1 - 0
lua/lsp/tailwindcss-ls.lua

@@ -1,3 +1,4 @@
+-- TODO what is a tailwindcss filetype
 local lspconfig = require 'lspconfig'
 
 lspconfig.tailwindcss.setup {

+ 0 - 1
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')
 

+ 2 - 1
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')]],

+ 1 - 3
lv-config.lua

@@ -49,7 +49,6 @@ O.lang.clang.diagnostics.underline = false
 -- add things like O.python.formatter.isort.exec_path
 O.lang.python.formatter = 'yapf'
 -- O.python.linter = 'flake8'
-O.lang.python.active = true
 O.lang.python.isort = true
 O.lang.python.autoformat = true
 O.lang.python.diagnostics.virtual_text = true
@@ -59,9 +58,9 @@ O.lang.python.analysis.type_checking = "off"
 O.lang.python.analysis.auto_search_paths = true
 O.lang.python.analysis.use_library_code_types = true
 
+
 -- lua
 -- TODO look into stylua
-O.lang.lua.active = true
 O.lang.lua.formatter = 'lua-format'
 -- O.lua.formatter = 'lua-format'
 O.lang.lua.autoformat = false
@@ -72,7 +71,6 @@ O.lang.tsserver.linter = nil
 O.lang.tsserver.autoformat = true
 
 -- json
-O.lang.json.active = false
 O.lang.json.autoformat = true
 
 -- ruby