remove some unued plugins

This commit is contained in:
2021-10-08 11:16:06 +02:00
parent 1bfb07f1e1
commit abf32b26c3
5 changed files with 20 additions and 73 deletions

View File

@ -1,58 +0,0 @@
local u = require "utils"
-- Config Formatter
u.create_augroup(
{
--{"BufWritePost", "*.js,*.jsx,*.ts,*.tsx,*.rs,*.svelte", "OrganizeImports"},
{"BufWritePost", "*.js,*.jsx,*.ts,*.tsx,*.rs,*.lua", "FormatWrite"}
},
"FormatAutogroup"
)
require("formatter").setup(
{
logging = false,
filetype = {
typescript = {
-- prettier
function()
return {
exe = "prettier",
args = {"--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote"},
stdin = true
}
end
},
javascript = {
-- prettier
function()
return {
exe = "prettier",
args = {"--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote"},
stdin = true
}
end
},
svelte = {
-- prettier
function()
return {
exe = "prettier",
args = {"--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote"},
stdin = true
}
end
},
lua = {
-- luafmt
function()
return {
exe = "luafmt",
args = {"--indent-count", 2, "--stdin"},
stdin = true
}
end
}
}
}
)

View File

@ -1,4 +1,5 @@
local Terminal = require("toggleterm.terminal").Terminal
local u = require("utils")
local lazygit =
Terminal:new(
{
@ -51,7 +52,7 @@ local nvimConfig =
direction = "float",
on_close = function(term)
Terminal:close()
vim.api.nvim_command(":source $MYVIMRC")
u.ReloadConfig()
end
}
)

View File

@ -41,9 +41,8 @@ local function on_attach(client)
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
" autocmd CursorHold *.* :lua vim.lsp.diagnostic.show_line_diagnostics()
autocmd BufWritePre * lua vim.lsp.buf.formatting_sync(nil, 300)
augroup END
autocmd CursorHold *.* :lua vim.lsp.diagnostic.show_line_diagnostics()
augroup END
]],
false
)

View File

@ -10,6 +10,16 @@ function M.create_augroup(autocmds, name)
cmd('augroup END')
end
function M.ReloadConfig()
for name,_ in pairs(package.loaded) do
if name:match('^cnull') then
package.loaded[name] = nil
end
end
dofile(vim.env.MYVIMRC)
end
local function dump(o)
if type(o) == 'table' then
local s = '{ '
@ -28,4 +38,4 @@ function M.has_plugin(pluginName)
return status
end
return M
return M