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
|
||||||
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
|
||||||
|
|
@ -105,17 +112,7 @@ 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({
|
||||||
|
|
@ -124,13 +121,7 @@ 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")
|
||||||
|
|
||||||
|
|
@ -189,7 +180,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.buf_get_clients()) do
|
for _, client in pairs(vim.lsp.get_active_clients({ bufnr = 0 })) 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