From fc104536c1065b28cdb861d4870d0192424412a1 Mon Sep 17 00:00:00 2001 From: 409 Date: Tue, 2 Jan 2024 06:43:27 +0100 Subject: [PATCH] improvements (cba) --- after/plugin/colors.lua | 15 ++++++++++----- after/plugin/lsp.lua | 11 +++++++++++ after/plugin/telescope.lua | 3 ++- after/plugin/treesitter.lua | 36 ++++++++++++++++++++---------------- lua/409/init.lua | 5 +++++ lua/409/set.lua | 2 ++ 6 files changed, 50 insertions(+), 22 deletions(-) diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua index 798a55b..f94d4d0 100755 --- a/after/plugin/colors.lua +++ b/after/plugin/colors.lua @@ -1,10 +1,15 @@ function Color(color) - color = color or "catppuccin-mocha" - vim.cmd.colorscheme(color) + color = color or "catppuccin-mocha" + vim.cmd.colorscheme(color) - vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) - vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) - vim.cmd('hi StatusLine guibg=#00000000') + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) + vim.api.nvim_set_hl(0, "StatusLine", { bg = "none" }) + -- If Vim thinks StatusLine and StatusLineNC are the same it overrides these settings + vim.api.nvim_set_hl(0, "StatusLineNC", { ctermbg = "#ff0000", bg = "none" }) + vim.api.nvim_set_hl(0, "EndOfBuffer", { fg = "none", bg = "none" }) end Color() +-- #1E1E2E diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 0836c69..3c5f1d8 100755 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -10,6 +10,17 @@ require('mason-lspconfig').setup({ } }) +require('lspconfig').yamlls.setup { + settings = { + yaml = { + validate = false, + format = { + enable = true + } + } + } +} + local cmp = require('cmp') local cmp_select = {behavior = cmp.SelectBehavior.Select} diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index aae9115..f4079bb 100755 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -2,5 +2,6 @@ local builtin = require('telescope.builtin') vim.keymap.set("n", "pf", builtin.find_files, {}) vim.keymap.set("n", "", builtin.git_files, {}) vim.keymap.set("n", "ps", function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }); + builtin.grep_string({ search = vim.fn.input("Grep > ") }); end) +vim.api.nvim_set_hl(0, "TelescopeSelection", { link = "Visual" }) diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua index a5adf44..4e6ebeb 100755 --- a/after/plugin/treesitter.lua +++ b/after/plugin/treesitter.lua @@ -1,21 +1,25 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query" }, +require 'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "javascript", "typescript", "c", "lua", "vim", "vimdoc", "query" }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, - highlight = { - enable = true, + highlight = { + enable = true, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true, + disable = { 'yaml' } + } } diff --git a/lua/409/init.lua b/lua/409/init.lua index 6a1494e..db3535e 100755 --- a/lua/409/init.lua +++ b/lua/409/init.lua @@ -1,2 +1,7 @@ require('409.remap') require('409.set') + +vim.api.nvim_create_autocmd({ 'FileType' }, { + pattern = { '*.yaml' }, + command = 'setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0# indentkeys-=<:>' +}) diff --git a/lua/409/set.lua b/lua/409/set.lua index cfe2bf2..f39570a 100755 --- a/lua/409/set.lua +++ b/lua/409/set.lua @@ -9,6 +9,8 @@ vim.opt.shiftwidth = 4 vim.opt.expandtab = true vim.opt.smartindent = true +vim.opt.autoindent = true +vim.opt.linebreak = true vim.opt.wrap = false