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