فهرست منبع

you now need to activate your language

christianchiarulli 4 سال پیش
والد
کامیت
f99b82bd6e
3فایلهای تغییر یافته به همراه71 افزوده شده و 39 حذف شده
  1. 33 32
      init.lua
  2. 35 4
      lua/default-config.lua
  3. 3 3
      lv-config.lua

+ 33 - 32
init.lua

@@ -12,40 +12,41 @@ require('lv-treesitter')
 require('lv-autopairs')
 require('lv-which-key')
 
-
-
 -- TODO gotta get rid of this for speed
 vim.cmd('source ' .. CONFIG_PATH .. '/vimscript/functions.vim')
 
 -- LSP
 require('lsp')
-require('lsp.java-ls')
-require('lsp.angular-ls')
-require('lsp.bash-ls')
-require('lsp.clangd')
-require('lsp.cmake-ls')
-require('lsp.css-ls')
-require('lsp.dart-ls')
-require('lsp.docker-ls')
-require('lsp.efm-general-ls')
-require('lsp.elm-ls')
-require('lsp.emmet-ls')
-require('lsp.graphql-ls')
-require('lsp.go-ls')
-require('lsp.html-ls')
-require('lsp.json-ls')
-require('lsp.js-ts-ls')
-require('lsp.kotlin-ls')
-require('lsp.latex-ls')
-require('lsp.lua-ls')
-require('lsp.php-ls')
-require('lsp.python-ls')
-require('lsp.ruby-ls')
-require('lsp.rust-ls')
-require('lsp.svelte-ls')
-require('lsp.terraform-ls')
--- require('lsp.tailwindcss-ls')
-require('lsp.vim-ls')
-require('lsp.vue-ls')
-require('lsp.yaml-ls')
-require('lsp.elixir-ls')
+-- 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.elixer.active then require('lsp.elixer-ls') end
+if O.lang.tsserver.active then
+    require('lsp.js-ts-ls')
+    require('lsp.angular-ls')
+    require('lsp.vue-ls')
+end

+ 35 - 4
lua/default-config.lua

@@ -29,6 +29,7 @@ O = {
 
     lang = {
         python = {
+            active = false,
             linter = '',
             -- @usage can be 'yapf', 'black'
             formatter = '',
@@ -46,9 +47,11 @@ 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,
@@ -59,6 +62,7 @@ O = {
             }
         },
         sh = {
+            active = false,
             -- @usage can be 'shellcheck'
             linter = '',
             -- @usage can be 'shfmt'
@@ -71,6 +75,7 @@ O = {
             }
         },
         tsserver = {
+            active = false,
             -- @usage can be 'eslint'
             linter = '',
             -- @usage can be 'prettier'
@@ -83,6 +88,7 @@ O = {
             }
         },
         json = {
+            active = false,
             -- @usage can be 'prettier'
             formatter = '',
             autoformat = false,
@@ -92,13 +98,15 @@ O = {
                 underline = true
             }
         },
-        tailwindls = {
+        tailwindcss = {
+            active = false,
             filetypes = {
                 'html', 'css', 'scss', 'javascript', 'javascriptreact',
                 'typescript', 'typescriptreact'
             }
         },
         clang = {
+            active = false,
             diagnostics = {
                 virtual_text = {spacing = 0, prefix = ""},
                 signs = true,
@@ -106,6 +114,7 @@ O = {
             }
         },
         ruby = {
+            active = false,
             diagnostics = {
                 virtualtext = {spacing = 0, prefix = ""},
                 signs = true,
@@ -113,9 +122,31 @@ O = {
             },
             filetypes = {'rb', 'erb', 'rakefile'}
         },
-        go = {}
-        -- css = {formatter = '', autoformat = false, virtual_text = true},
-        -- json = {formatter = '', autoformat = false, virtual_text = true}
+        go = {active = false},
+        elixer = {active = false},
+        vim = {active = false},
+        yaml = {active = false},
+        terraform = {active = false},
+        rust = {active = false},
+        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},
+        css = {
+            active = false,
+
+            formatter = '', autoformat = false, virtual_text = true},
+        json = {
+            active = false,
+            formatter = '', autoformat = false, virtual_text = true}
 
     },
 

+ 3 - 3
lv-config.lua

@@ -5,8 +5,7 @@ Formatters and linters should be
 filled in as strings with either
 a global executable or a path to
 an executable
-]]
-
+]] -- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
 -- general
 O.auto_complete = true
 O.colorscheme = 'lunar'
@@ -26,7 +25,6 @@ O.treesitter.ensure_installed = "all"
 O.treesitter.ignore_install = {"haskell"}
 O.treesitter.highlight.enabled = true
 
-
 O.lang.clang.diagnostics.virtual_text = false
 O.lang.clang.diagnostics.signs = false
 O.lang.clang.diagnostics.underline = false
@@ -37,6 +35,7 @@ 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
@@ -48,6 +47,7 @@ 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