From 0ff4a94a049e4d980a397c457d2c96b105a2c0f8 Mon Sep 17 00:00:00 2001 From: FaultyBranches Date: Wed, 27 May 2026 08:25:34 -0500 Subject: [PATCH] feat: Adding the TSI (Tree-Sitter Install) command, changing the ui2 setup to use floating messages instead of the cmdline output, cleanup of plugin loading. --- nvim/lua/custom_commands.lua | 13 ++++++--- nvim/lua/plugins.lua | 49 ++++++++++++++++++---------------- nvim/lua/plugins/fugitive.lua | 3 --- nvim/lua/plugins/nvim-lint.lua | 35 +++++++++++------------- nvim/lua/settings.lua | 4 ++- 5 files changed, 54 insertions(+), 50 deletions(-) delete mode 100644 nvim/lua/plugins/fugitive.lua diff --git a/nvim/lua/custom_commands.lua b/nvim/lua/custom_commands.lua index 4202426..94d1118 100644 --- a/nvim/lua/custom_commands.lua +++ b/nvim/lua/custom_commands.lua @@ -4,6 +4,13 @@ vim.api.nvim_create_user_command('FindAndReplace', function(opts) vim.api.nvim_command(string.format('cfdo s/%s/%s/gc', opts.fargs[1], opts.fargs[2]) .. '| update | cclose') end, { nargs = '*' }) ---vim.api.nvim_create_user_command('TSI', function (opts) --- ---end) +-- TODO: Set up a command for installing treesitter plugins via luarocks +vim.api.nvim_create_user_command('TSI', function(opts) + local result = vim.system({ 'luarocks', 'install', 'tree-sitter-' .. opts.fargs[1] }, { text = true }):wait() + if result.code == 0 then + print('Completed install of tree-sitter-' .. opts.fargs[1]) + else + print('Failed to install tree-sitter-' .. opts.fargs[1]) + print(result.stdout) + end +end, { nargs = '*' }) diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 58323a6..5fe4fe5 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -1,4 +1,9 @@ -require('vim._core.ui2').enable() -- message + cmdline presentation layer replacement +require('vim._core.ui2').enable { + enable = true, + msg = { + targets = "msg", + } +} -- Load the following plugins eagerly to prevent visual oddities require('plugins.gruvbox') -- Colorscheme setup @@ -7,28 +12,26 @@ require('plugins.lualine') -- Status line plugin -- vim.schedule defers plugin loading for after the main loop starts -- Startup is cleaner and faster than ever vim.schedule(function() - require('plugins.language_support') -- LSP, treesitter and any other language specific support plugins - require('plugins.gitsigns') -- Git gutter notifiers - require('plugins.nvim-cmp') -- Autocompletion plugin (TODO: Move to builtin completion?) - require('plugins.telescope') -- Floating window fuzzy searching different sources - require('plugins.telekasten') -- Note taking plugins - require('plugins.mason') -- LSP and DAP manager - require('plugins.twilight') -- Focus mode, dim lines around the cursor's location - require('plugins.render-markdown') -- Render markdown directly in neovim - require('plugins.luasnip') -- Snippet engine + require('plugins.language_support') -- LSP, treesitter and any other language specific support plugins + require('plugins.gitsigns') -- Git gutter notifiers + require('plugins.nvim-cmp') -- Autocompletion plugin (TODO: Move to builtin completion?) + require('plugins.telescope') -- Floating window fuzzy searching different sources + require('plugins.telekasten') -- Note taking plugins + require('plugins.mason') -- LSP and DAP manager + require('plugins.twilight') -- Focus mode, dim lines around the cursor's location + require('plugins.render-markdown') -- Render markdown directly in neovim + require('plugins.luasnip') -- Snippet engine - vim.pack.add({ 'https://github.com/windwp/nvim-autopairs' }) -- Autocomplete symbol pairs when typing - vim.pack.add({ 'https://github.com/tpope/vim-surround' }) -- Change surrounding characters (doesn't need setup called) - vim.pack.add({ 'https://github.com/tpope/vim-fugitive' }) -- _The_ Git integration plugin people have been using forever - vim.pack.add({ 'https://github.com/habamax/vim-godot' }) -- Godot specific bindings and debug + vim.pack.add({ + 'https://github.com/windwp/nvim-autopairs', -- Autocomplete symbol pairs when typing + 'https://github.com/tpope/vim-surround', -- Change surrounding characters (doesn't need setup called) + 'https://github.com/tpope/vim-fugitive', -- _The_ Git integration plugin people have been using forever + 'https://github.com/habamax/vim-godot' -- Godot specific bindings and debug + }) - require('nvim-autopairs').setup() -- Automatic pair completion of paranteticals, braces, quotes, etc. - require('plugins.dap') -- DAP debugging plugin - require('plugins.dap-python') -- Debug plugin settings specifically for python - require('plugins.yaml-companion') -- Additional YAML and JSON schema helper + require('nvim-autopairs').setup() -- Automatic pair completion of paranteticals, braces, quotes, etc. + require('plugins.dap') -- DAP debugging plugin + require('plugins.dap-python') -- Debug plugin settings specifically for python + require('plugins.yaml-companion') -- Additional YAML and JSON schema helper + require('plugins.nvim-lint') -- Linter loader end) - --- TODO: Still in need of translation to the new setup - --- Currently not enabled --- require('plugins.nvim-lint'), -- Linter loader diff --git a/nvim/lua/plugins/fugitive.lua b/nvim/lua/plugins/fugitive.lua deleted file mode 100644 index 72c3c2f..0000000 --- a/nvim/lua/plugins/fugitive.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - 'tpope/vim-fugitive', -} diff --git a/nvim/lua/plugins/nvim-lint.lua b/nvim/lua/plugins/nvim-lint.lua index 091d0f5..4dc7170 100644 --- a/nvim/lua/plugins/nvim-lint.lua +++ b/nvim/lua/plugins/nvim-lint.lua @@ -1,22 +1,17 @@ -return { - 'mfussenegger/nvim-lint', - config = function() - require('lint').linters_by_ft = { - yaml = { 'cfn_lint' } - } +vim.pack.add({ + 'https://github.com/mfussenegger/nvim-lint' +}) - -- vim.api.nvim_create_autocmd({ 'BufWritePost', 'BufReadPost' }, { - -- callback = function() - -- require('lint').try_lint() - -- end, - -- }) - end, - keys = { - { - ';l', - function() - require('lint').try_lint() - end - }, - }, +require('lint').linters_by_ft = { + yaml = { 'cfn_lint' } } + +-- Run linting automatically after writing and reading a buffer +-- (A bit too often as it is with manual runs available via keymapping) +-- vim.api.nvim_create_autocmd({ 'BufWritePost', 'BufReadPost' }, { +-- callback = function() +-- require('lint').try_lint() +-- end, +-- }) + +vim.keymap.set('n', ';l', function() require('lint').try_lint() end) diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index 7baa31f..4266a5c 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -21,6 +21,8 @@ vim.opt.listchars = 'tab:|·,trail:¬,extends:>,precedes:<,nbsp:+' -- Charact vim.opt.mouse = 'a' -- Enable mouse mode vim.opt.number = true -- Show the line number in the gutter. vim.opt.relativenumber = true -- Relative line number +vim.opt.scrolloff = 8 +vim.opt.sidescrolloff = 8 vim.opt.shiftround = true -- Round indentation to shiftwidth vim.opt.shiftwidth = 4 -- Number of spaces a tab counts for when converting tabs to spaces vim.opt.shortmess = 'at' -- Abbreviations and truncation of cmd messages @@ -35,7 +37,7 @@ vim.opt.tabstop = 4 -- Setting t vim.opt.termguicolors = true -- Enable the truecolor GUI colors in a terminal vim.opt.undodir = os.getenv('HOME') .. '/.config/nvim/undodir' -- Set a specific undo file directory vim.opt.undofile = true -- Enable undo files -vim.opt.updatetime = 50 -- Update time in milliseconds +vim.opt.updatetime = 300 -- Update time in milliseconds vim.opt.wrap = false -- Do _not_ wrap lines vim.g.netrw_liststyle = 3 -- Use the tree style display for netrw directory listings