diff options
Diffstat (limited to 'ftplugin')
-rw-r--r-- | ftplugin/c.lua | 11 | ||||
-rw-r--r-- | ftplugin/go.lua | 18 | ||||
-rw-r--r-- | ftplugin/javascript.lua | 35 | ||||
-rw-r--r-- | ftplugin/javascriptreact.lua | 35 | ||||
-rw-r--r-- | ftplugin/json.lua | 12 | ||||
-rw-r--r-- | ftplugin/lua.lua | 31 | ||||
-rw-r--r-- | ftplugin/python.lua | 17 | ||||
-rw-r--r-- | ftplugin/ruby.lua | 8 | ||||
-rw-r--r-- | ftplugin/rust.lua | 8 | ||||
-rw-r--r-- | ftplugin/sh.lua | 4 | ||||
-rw-r--r-- | ftplugin/typescript.lua | 35 | ||||
-rw-r--r-- | ftplugin/typescriptreact.lua | 35 | ||||
-rw-r--r-- | ftplugin/zig.lua | 1 | ||||
-rw-r--r-- | ftplugin/zsh.lua | 6 |
14 files changed, 4 insertions, 252 deletions
diff --git a/ftplugin/c.lua b/ftplugin/c.lua index ef371c03..7443cabe 100644 --- a/ftplugin/c.lua +++ b/ftplugin/c.lua @@ -18,14 +18,3 @@ require("lspconfig").clangd.setup { }), }, } - -if O.lang.clang.autoformat then - require("lv-utils").define_augroups { - _clang_autoformat = { - { "BufWritePre *.c lua vim.lsp.buf.formatting_sync(nil,1000)" }, - { "BufWritePre *.h lua vim.lsp.buf.formatting_sync(nil,1000)" }, - { "BufWritePre *.cpp lua vim.lsp.buf.formatting_sync(nil,1000)" }, - { "BufWritePre *.hpp lua vim.lsp.buf.formatting_sync(nil,1000)" }, - }, - } -end diff --git a/ftplugin/go.lua b/ftplugin/go.lua index 0bee465f..56b9cacc 100644 --- a/ftplugin/go.lua +++ b/ftplugin/go.lua @@ -6,17 +6,7 @@ require("lspconfig").gopls.setup { 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 +vim.opt_local.tabstop = 4 +vim.opt_local.shiftwidth = 4 +vim.opt_local.softtabstop = 4 +vim.opt_local.expandtab = false diff --git a/ftplugin/javascript.lua b/ftplugin/javascript.lua index 1c4004c2..ab370364 100644 --- a/ftplugin/javascript.lua +++ b/ftplugin/javascript.lua @@ -34,40 +34,5 @@ require("lspconfig").tsserver.setup { }), }, } - require("lsp.ts-fmt-lint").setup() - -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" diff --git a/ftplugin/javascriptreact.lua b/ftplugin/javascriptreact.lua index 1c4004c2..ab370364 100644 --- a/ftplugin/javascriptreact.lua +++ b/ftplugin/javascriptreact.lua @@ -34,40 +34,5 @@ require("lspconfig").tsserver.setup { }), }, } - require("lsp.ts-fmt-lint").setup() - -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" diff --git a/ftplugin/json.lua b/ftplugin/json.lua index da0c9ff2..29a3096f 100644 --- a/ftplugin/json.lua +++ b/ftplugin/json.lua @@ -15,15 +15,3 @@ require("lspconfig").jsonls.setup { }, }, } - -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/ftplugin/lua.lua b/ftplugin/lua.lua index f3c3ac50..32c24e80 100644 --- a/ftplugin/lua.lua +++ b/ftplugin/lua.lua @@ -40,34 +40,3 @@ 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, - }, - }, -} diff --git a/ftplugin/python.lua b/ftplugin/python.lua index 62464397..a9b41648 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -20,12 +20,6 @@ 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" }, @@ -64,17 +58,6 @@ require("lspconfig").pyright.setup { }, }, } -if O.lang.python.autoformat then - require("lv-utils").define_augroups { - _python_autoformat = { - { - "BufWritePre", - "*.py", - "lua vim.lsp.buf.formatting_sync(nil, 1000)", - }, - }, - } -end if O.plugin.debug.active and O.plugin.dap_install.active then local dap_install = require("dap-install") diff --git a/ftplugin/ruby.lua b/ftplugin/ruby.lua index 0cff96ff..bc844cd3 100644 --- a/ftplugin/ruby.lua +++ b/ftplugin/ruby.lua @@ -12,11 +12,3 @@ require("lspconfig").solargraph.setup { }, 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/ftplugin/rust.lua b/ftplugin/rust.lua index 34b211d6..2a106e7e 100644 --- a/ftplugin/rust.lua +++ b/ftplugin/rust.lua @@ -91,11 +91,3 @@ vim.api.nvim_exec( ]], 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/ftplugin/sh.lua b/ftplugin/sh.lua index fa8f0785..c146e45f 100644 --- a/ftplugin/sh.lua +++ b/ftplugin/sh.lua @@ -15,10 +15,6 @@ local shellcheck = { 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 diff --git a/ftplugin/typescript.lua b/ftplugin/typescript.lua index 1c4004c2..ab370364 100644 --- a/ftplugin/typescript.lua +++ b/ftplugin/typescript.lua @@ -34,40 +34,5 @@ require("lspconfig").tsserver.setup { }), }, } - require("lsp.ts-fmt-lint").setup() - -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" diff --git a/ftplugin/typescriptreact.lua b/ftplugin/typescriptreact.lua index 1c4004c2..ab370364 100644 --- a/ftplugin/typescriptreact.lua +++ b/ftplugin/typescriptreact.lua @@ -34,40 +34,5 @@ require("lspconfig").tsserver.setup { }), }, } - require("lsp.ts-fmt-lint").setup() - -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" diff --git a/ftplugin/zig.lua b/ftplugin/zig.lua index 7fc8d3fc..92b4120d 100644 --- a/ftplugin/zig.lua +++ b/ftplugin/zig.lua @@ -8,7 +8,6 @@ require("lspconfig").zls.setup { } require("lv-utils").define_augroups { _zig_autoformat = { - { "BufWritePre", "*.zig", "lua vim.lsp.buf.formatting_sync(nil, 1000)" }, { "BufEnter", "*.zig", ':lua vim.api.nvim_buf_set_option(0, "commentstring", "// %s")' }, }, } diff --git a/ftplugin/zsh.lua b/ftplugin/zsh.lua index a2847f19..b6fa9d5d 100644 --- a/ftplugin/zsh.lua +++ b/ftplugin/zsh.lua @@ -15,17 +15,11 @@ require("lspconfig").bashls.setup { -- 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 |