From e7c8b3f9cd31bdb9f183a068e1eb9d476a837aac Mon Sep 17 00:00:00 2001 From: venus Date: Mon, 1 Jun 2026 22:36:15 -0500 Subject: [PATCH] patched autocommand issue, simplifying lsp setup --- lua/autocommands.lua | 28 ++-------------------------- lua/plugins/guessIndent.lua | 8 ++++++++ lua/plugins/lsp.lua | 34 ---------------------------------- lua/plugins/treesitter.lua | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 60 deletions(-) create mode 100644 lua/plugins/guessIndent.lua create mode 100644 lua/plugins/treesitter.lua diff --git a/lua/autocommands.lua b/lua/autocommands.lua index 813cfaa..8d5590c 100644 --- a/lua/autocommands.lua +++ b/lua/autocommands.lua @@ -1,14 +1,10 @@ --- lua/autocommands.lua --- Defines autocommands to run on certain events happening --- TODO clean this with functions - --- [[dynamically change kitty window opacity when opening and closing]] +-- [[dynamicallt change kitty window opacity when opening and closing]] -- Define the target opacities local nvim_opacity = "0.85" local default_opacity = "0.6" -- Function to talk to Kitty local function set_kitty_opacity(opacity) - -- print("Attempting to set opacity to: " .. opacity) + -- Use os.execute to run the kitty remote command os.execute("kitty @ set-background-opacity " .. opacity) end -- Set up the autocommands @@ -27,24 +23,4 @@ vim.api.nvim_create_autocmd("VimLeave", { set_kitty_opacity(default_opacity) end, }) -vim.api.nvim_create_autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() - vim.hl.on_yank() - end, -}) --- Create an augroup to manage our spellcheck autocommands -local spell_group = vim.api.nvim_create_augroup("EnableSpellcheck", { clear = true }) - -vim.api.nvim_create_autocmd("FileType", { - group = spell_group, - -- List the filetypes you want to enable spellcheck for - pattern = { "markdown", "text", "gitcommit", "latex", "plaintex" }, - callback = function() - vim.opt_local.spell = true - vim.opt_local.spelllang = "en_us" -- Optional: set your preferred language - vim.opt_local.spelloptions = "camel" - end, -}) diff --git a/lua/plugins/guessIndent.lua b/lua/plugins/guessIndent.lua new file mode 100644 index 0000000..c8b54fc --- /dev/null +++ b/lua/plugins/guessIndent.lua @@ -0,0 +1,8 @@ +return { + 'NMAC427/guess-indent.nvim', + config = function() + require('guess-indent').setup ({ + filetype_exclude = {"lua"}, + }) + end, +} -- Detect tabstop and shiftwidth automatically diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 05d0eb7..fa5f617 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -26,40 +26,6 @@ return { -- adds lsp functionality and api for included languages dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, -- if you use the mini.nvim suite ---@module 'render-markdown' }, - { -- basic tree sitter parser support - "nvim-treesitter/nvim-treesitter", - opts = { - indent = { enable = true }, - highlight = { enable = true }, - folds = { enable = true }, - ensure_installed = { - "bash", - "c", - "diff", - "html", - "javascript", - "jsdoc", - "json", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "printf", - "python", - "query", - "regex", - "toml", - "tsx", - "typescript", - "vim", - "vimdoc", - "xml", - "yaml", - "zsh", - }, - } - }, { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', opts = { diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..78f6030 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,34 @@ +return { -- basic tree sitter parser support + "nvim-treesitter/nvim-treesitter", + opts = { + indent = { enable = true }, + highlight = { enable = true }, + folds = { enable = true }, + ensure_installed = { + "bash", + "c", + "diff", + "html", + "javascript", + "jsdoc", + "json", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "printf", + "python", + "query", + "regex", + "toml", + "tsx", + "typescript", + "vim", + "vimdoc", + "xml", + "yaml", + "zsh", + }, + } + }