remove some unued plugins
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
@ -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
|
||||
}
|
||||
)
|
||||
|
@ -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
|
||||
)
|
||||
|
@ -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
|
Reference in New Issue
Block a user