From 6674abcee8211c0a7b6ecb6ea15b3941d5c5559a Mon Sep 17 00:00:00 2001 From: Slayter Teal Date: Sun, 22 Jun 2025 15:11:47 -0500 Subject: [PATCH] update vscode nvim config added lazy.nvim and mini.nvim (mainly just for mini.surround). --- init.lua | 6 +++--- lua/vscode-init.lua | 7 ++++++- lua/vscode-plugins.lua | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 lua/vscode-plugins.lua diff --git a/init.lua b/init.lua index 938a29b9..a70f9e28 100644 --- a/init.lua +++ b/init.lua @@ -1,8 +1,8 @@ -print("Loading Neovim Configuration..") if vim.g.vscode then - -- VSCode extension - print("Loading VSCode Neovim Configuration..") + -- VSCode Neovim extension configuration + print("Loading VSCode Neovim Configuration..\n") require 'vscode-init' + print("VSCode Neovim Configuration Loaded!") else require 'cli-init' end diff --git a/lua/vscode-init.lua b/lua/vscode-init.lua index b0e6023a..66da0d3e 100644 --- a/lua/vscode-init.lua +++ b/lua/vscode-init.lua @@ -31,4 +31,9 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term vim.opt.ignorecase = true -vim.opt.smartcase = true \ No newline at end of file +vim.opt.smartcase = true + +-- * Manage plugins here +if true then + require("vscode-plugins") +end \ No newline at end of file diff --git a/lua/vscode-plugins.lua b/lua/vscode-plugins.lua new file mode 100644 index 00000000..de5394f0 --- /dev/null +++ b/lua/vscode-plugins.lua @@ -0,0 +1,40 @@ +-- VSCode Neovim plugin management + +-- [[ Install `lazy.nvim` plugin manager ]] +-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info +local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' +if not vim.uv.fs_stat(lazypath) then + local lazyrepo = 'https://github.com/folke/lazy.nvim.git' + local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + if vim.v.shell_error ~= 0 then + error('Error cloning lazy.nvim:\n' .. out) + end +end ---@diagnostic disable-next-line: undefined-field +vim.opt.rtp:prepend(lazypath) + + +-- Lazy +require('lazy').setup({ + { -- Collection of various small independent plugins/modules + 'echasnovski/mini.nvim', + config = function() + -- Better Around/Inside textobjects + -- + -- Examples: + -- - va) - [V]isually select [A]round [)]paren + -- - yinq - [Y]an [I]nside [N]ext [Q]uote + -- - ci' - [C]hange [I]nside [']quote + require('mini.ai').setup { n_lines = 500 } + + -- Add/delete/replace surroundings (bracets, quotes, etc.) + -- + -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren + -- - sd' - [S]urround [D]elete [']quotes + -- - sr)' - [S]urround [R]eplace [)] ['] + require('mini.surround').setup() + + -- For more Mini.nvim stuff: + -- Check out: https://github.com/echasnovski/mini.nvim + end, + }, +}) \ No newline at end of file