Compare commits
2 commits
5ca5f0a0f7
...
92f6f79316
| Author | SHA1 | Date | |
|---|---|---|---|
| 92f6f79316 | |||
| 722dbbbf40 |
1 changed files with 17 additions and 8 deletions
25
init.lua
25
init.lua
|
|
@ -33,13 +33,6 @@ vim.api.nvim_create_autocmd({ "TermOpen" }, {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
---- Folding ----
|
|
||||||
vim.api.nvim_create_autocmd({ "FileType" }, {
|
|
||||||
pattern = "yaml",
|
|
||||||
callback = function()
|
|
||||||
vim.opt_local.foldmethod = "indent"
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
---- Theming ----
|
---- Theming ----
|
||||||
opt.termguicolors = true
|
opt.termguicolors = true
|
||||||
|
|
@ -112,7 +105,17 @@ ts.setup({
|
||||||
})
|
})
|
||||||
|
|
||||||
---- Filetypes ---
|
---- Filetypes ---
|
||||||
|
-- KDL --
|
||||||
vim.filetype.add({ extension = { kdl = "kdl" } })
|
vim.filetype.add({ extension = { kdl = "kdl" } })
|
||||||
|
-- YAML --
|
||||||
|
vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||||
|
pattern = "yaml",
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.expandtab = true
|
||||||
|
vim.opt_local.foldmethod = "indent"
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
---- formatter.nvim ----
|
---- formatter.nvim ----
|
||||||
local formatter = require("formatter")
|
local formatter = require("formatter")
|
||||||
formatter.setup({
|
formatter.setup({
|
||||||
|
|
@ -121,7 +124,13 @@ formatter.setup({
|
||||||
require("formatter.filetypes.lua").stylua,
|
require("formatter.filetypes.lua").stylua,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
["*"] = {
|
||||||
|
-- "formatter.filetypes.any" defines default configurations for any
|
||||||
|
-- filetype
|
||||||
|
require("formatter.filetypes.any").remove_trailing_whitespace
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
---- LSP ----
|
---- LSP ----
|
||||||
local lsp = require("lspconfig")
|
local lsp = require("lspconfig")
|
||||||
|
|
||||||
|
|
@ -180,7 +189,7 @@ local servers = {
|
||||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
local lsp_format = false
|
local lsp_format = false
|
||||||
for _, client in pairs(vim.lsp.get_active_clients({ bufnr = 0 })) do
|
for _, client in pairs(vim.lsp.buf_get_clients()) do
|
||||||
if client.server_capabilities.documentFormattingProvider then
|
if client.server_capabilities.documentFormattingProvider then
|
||||||
lsp_format = true
|
lsp_format = true
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue