diff options
| author | Abouzar Parvan <[email protected]> | 2021-07-15 05:18:05 +0430 | 
|---|---|---|
| committer | GitHub <[email protected]> | 2021-07-14 20:48:05 -0400 | 
| commit | e6de44e4443042dc14d34e36dd8ee8528f4936f2 (patch) | |
| tree | d600f814c33e9154bbb3fdde0dfda6e75b071483 /ftplugin | |
| parent | 2a7b3d4892605508d0b0328444d689e1c4922897 (diff) | |
more language reformat (#949)
Diffstat (limited to 'ftplugin')
| -rw-r--r-- | ftplugin/vue.lua | 13 | ||||
| -rw-r--r-- | ftplugin/yaml.lua | 27 | ||||
| -rw-r--r-- | ftplugin/zig.lua | 20 | ||||
| -rw-r--r-- | ftplugin/zsh.lua | 40 | 
4 files changed, 16 insertions, 84 deletions
| diff --git a/ftplugin/vue.lua b/ftplugin/vue.lua index 96048164..297e8832 100644 --- a/ftplugin/vue.lua +++ b/ftplugin/vue.lua @@ -1,10 +1,5 @@ -if require("lv-utils").check_lsp_client_active "vuels" then -  return -end +require("lamg.vue").format() +require("lamg.vue").lint() +require("lamg.vue").lsp() +require("lamg.vue").dap() --- Vue language server configuration (vetur) -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", "vue.config.js", "package.json", "yarn.lock"), -} diff --git a/ftplugin/yaml.lua b/ftplugin/yaml.lua index f1dfc5dc..47a0d039 100644 --- a/ftplugin/yaml.lua +++ b/ftplugin/yaml.lua @@ -1,24 +1,5 @@ -O.formatters.filetype["yaml"] = { -  function() -    return { -      exe = O.lang.yaml.formatter.exe, -      args = O.lang.yaml.formatter.args, -      stdin = not (O.lang.yaml.formatter.stdin ~= nil), -    } -  end, -} +require("lamg.yaml").format() +require("lamg.yaml").lint() +require("lamg.yaml").lsp() +require("lamg.yaml").dap() -require("formatter.config").set_defaults { -  logging = false, -  filetype = O.formatters.filetype, -} -if require("lv-utils").check_lsp_client_active "yamlls" then -  return -end - --- 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, -} -vim.cmd "setl ts=2 sw=2 ts=2 ai et" diff --git a/ftplugin/zig.lua b/ftplugin/zig.lua index 55707d85..bc177211 100644 --- a/ftplugin/zig.lua +++ b/ftplugin/zig.lua @@ -1,17 +1,5 @@ -if not require("lv-utils").check_lsp_client_active "zls" then -  -- Because lspinstall don't support zig yet, -  -- So we need zls preset in global lib -  -- Further custom install zls in -  -- https://github.com/zigtools/zls/wiki/Downloading-and-Building-ZLS -  require("lspconfig").zls.setup { -    root_dir = require("lspconfig").util.root_pattern(".git", "build.zig", "zls.json"), -    on_attach = require("lsp").common_on_attach, -  } -end +require("lang.zig").format() +require("lang.zig").lint() +require("lang.zig").lsp() +require("lang.zig").dap() -require("lv-utils").define_augroups { -  _zig_autoformat = { -    { "BufEnter", "*.zig", ':lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s")' }, -  }, -} -vim.cmd "setl expandtab tabstop=8 softtabstop=4 shiftwidth=4" diff --git a/ftplugin/zsh.lua b/ftplugin/zsh.lua index 750e8ede..4dfbb7b8 100644 --- a/ftplugin/zsh.lua +++ b/ftplugin/zsh.lua @@ -1,36 +1,4 @@ -if not require("lv-utils").check_lsp_client_active "bashls" then -  -- 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" }, -  } -end - --- sh -local sh_arguments = {} - -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.linter == "shellcheck" then -  table.insert(sh_arguments, shellcheck) -end - -if not require("lv-utils").check_lsp_client_active "efm" then -  require("lspconfig").efm.setup { -    -- init_options = {initializationOptions}, -    cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, -    init_options = { documentFormatting = true, codeAction = false }, -    root_dir = require("lspconfig").util.root_pattern ".git/", -    filetypes = { "zsh" }, -    settings = { -      rootMarkers = { ".git/" }, -      languages = { -        sh = sh_arguments, -      }, -    }, -  } -end +require("lang.zsh").format() +require("lang.zsh").lint() +require("lang.zsh").lsp() +require("lang.zsh").dap() | 
