Add autoclose, tabout nvim autocomplete and Format on save
This commit is contained in:
6
lua/plugins/autoclose.lua
Normal file
6
lua/plugins/autoclose.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
'm4xshen/autoclose.nvim',
|
||||
config = function()
|
||||
require('autoclose').setup()
|
||||
end
|
||||
}
|
||||
@@ -1,8 +1,19 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"mason-org/mason.nvim",
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua", -- only load on lua files
|
||||
opts = {
|
||||
library = {
|
||||
-- See the configuration section for more details
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
@@ -42,5 +53,19 @@ return {
|
||||
}
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("lsp", { clear = true }),
|
||||
callback = function(args)
|
||||
-- 2
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
-- 3
|
||||
buffer = args.buf,
|
||||
callback = function()
|
||||
-- 4 + 5
|
||||
vim.lsp.buf.format { async = false, id = args.data.client_id }
|
||||
end,
|
||||
})
|
||||
end
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
11
lua/plugins/tabout.lua
Normal file
11
lua/plugins/tabout.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
{
|
||||
'abecodes/tabout.nvim',
|
||||
lazy = false,
|
||||
config = function()
|
||||
require('tabout').setup {
|
||||
tabkey = '<Tab>'
|
||||
}
|
||||
end
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user