feat: use yamlls and use additional formatters

This commit is contained in:
dario 2025-10-08 09:44:39 +02:00 committed by dasvh
parent 365ea56a98
commit 9357b66509
1 changed files with 70 additions and 7 deletions

View File

@ -1,5 +1,6 @@
--[[ --[[
TODO: fix leader key for telescope from neo-tree
What is Kickstart? What is Kickstart?
Kickstart.nvim is *not* a distribution. Kickstart.nvim is *not* a distribution.
@ -44,7 +45,7 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal -- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false vim.g.have_nerd_font = true
-- [[ Setting options ]] -- [[ Setting options ]]
-- See `:help vim.opt` -- See `:help vim.opt`
@ -114,6 +115,14 @@ vim.opt.scrolloff = 10
-- See `:help 'confirm'` -- See `:help 'confirm'`
vim.opt.confirm = true vim.opt.confirm = true
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.filetype.add {
filename = { ['Taskfile'] = 'yaml' },
pattern = { ['.*/%.taskfiles/.*%.ya?ml'] = 'yaml' },
}
-- highlight ExtraWhitespace -- highlight ExtraWhitespace
-- TODO: does not seem to clear all whitespace (-> did not work for yaml file) -- TODO: does not seem to clear all whitespace (-> did not work for yaml file)
vim.api.nvim_set_hl(0, 'ExtraWhitespace', { vim.api.nvim_set_hl(0, 'ExtraWhitespace', {
@ -644,7 +653,7 @@ require('lazy').setup({
-- clangd = {}, -- clangd = {},
gopls = {}, gopls = {},
bashls = {}, bashls = {},
-- pyright = {}, pyright = {},
-- rust_analyzer = {}, -- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
-- --
@ -652,7 +661,7 @@ require('lazy').setup({
-- https://github.com/pmizio/typescript-tools.nvim -- https://github.com/pmizio/typescript-tools.nvim
-- --
-- But for many setups, the LSP (`ts_ls`) will work just fine -- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {}, ts_ls = {},
-- --
lua_ls = { lua_ls = {
@ -669,6 +678,39 @@ require('lazy').setup({
}, },
}, },
}, },
yamlls = {
settings = {
yaml = {
validate = true,
hover = true,
completion = true,
format = { enable = false },
kubernetes = { enable = true },
schemaStore = { enable = true },
schemas = {
['https://raw.githubusercontent.com/compose-spec/compose-spec/refs/heads/main/schema/compose-spec.json'] = {
'docker-compose*.yml',
'docker-compose*.yaml',
'compose*.yml',
'compose*.yaml',
},
['https://json.schemastore.org/github-workflow.json'] = {
'.github/workflows/*.yml',
'.github/workflows/*.yaml',
},
['https://json.schemastore.org/gitlab-ci.json'] = {
'.gitlab-ci.yml',
'.gitlab-ci.yaml',
},
['https://taskfile.dev/schema.json'] = {
'Taskfile',
'Taskfile.yml',
'Taskfile.yaml',
},
},
},
},
},
} }
-- Ensure the servers and tools above are installed -- Ensure the servers and tools above are installed
@ -739,6 +781,14 @@ require('lazy').setup({
end, end,
formatters_by_ft = { formatters_by_ft = {
lua = { 'stylua' }, lua = { 'stylua' },
yaml = { 'prettier' },
-- markdown = { 'prettier' },
python = { 'black' },
terraform = { 'terraform_fmt' },
tex = { 'latexindent' },
sql = { 'prettier' },
-- sql = { 'sql_formatter' },
-- Conform can also run multiple formatters sequentially -- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" }, -- python = { "isort", "black" },
-- --
@ -866,6 +916,19 @@ require('lazy').setup({
end, end,
}, },
{
'Piotr1215/presenterm.nvim',
build = false,
config = function()
require('presenterm').setup {
default_keybindings = true,
picker = {
provider = 'telescope',
},
}
end,
},
{ -- You can easily change to a different colorscheme. { -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then -- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is. -- change the command in the config to whatever the name of that colorscheme is.
@ -944,7 +1007,7 @@ require('lazy').setup({
-- the list of additional_vim_regex_highlighting and disabled languages for indent. -- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' }, additional_vim_regex_highlighting = { 'ruby' },
}, },
indent = { enable = true, disable = { 'ruby' } }, indent = { enable = true, disable = { 'ruby', 'yaml' } },
}, },
-- There are additional nvim-treesitter modules that you can use to interact -- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you: -- with nvim-treesitter. You should go explore a few and see what interests you:
@ -965,9 +1028,9 @@ require('lazy').setup({
-- --
-- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint', require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs', require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree', require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`