Skip to content

Commit 6674abc

Browse files
committed
update vscode nvim config
added lazy.nvim and mini.nvim (mainly just for mini.surround).
1 parent 342255e commit 6674abc

File tree

3 files changed

+49
-4
lines changed

3 files changed

+49
-4
lines changed

init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
print("Loading Neovim Configuration..")
21
if vim.g.vscode then
3-
-- VSCode extension
4-
print("Loading VSCode Neovim Configuration..")
2+
-- VSCode Neovim extension configuration
3+
print("Loading VSCode Neovim Configuration..\n")
54
require 'vscode-init'
5+
print("VSCode Neovim Configuration Loaded!")
66
else
77
require 'cli-init'
88
end

lua/vscode-init.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ vim.api.nvim_create_autocmd('TextYankPost', {
3131

3232
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
3333
vim.opt.ignorecase = true
34-
vim.opt.smartcase = true
34+
vim.opt.smartcase = true
35+
36+
-- * Manage plugins here
37+
if true then
38+
require("vscode-plugins")
39+
end

lua/vscode-plugins.lua

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-- VSCode Neovim plugin management
2+
3+
-- [[ Install `lazy.nvim` plugin manager ]]
4+
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
5+
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
6+
if not vim.uv.fs_stat(lazypath) then
7+
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
8+
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
9+
if vim.v.shell_error ~= 0 then
10+
error('Error cloning lazy.nvim:\n' .. out)
11+
end
12+
end ---@diagnostic disable-next-line: undefined-field
13+
vim.opt.rtp:prepend(lazypath)
14+
15+
16+
-- Lazy
17+
require('lazy').setup({
18+
{ -- Collection of various small independent plugins/modules
19+
'echasnovski/mini.nvim',
20+
config = function()
21+
-- Better Around/Inside textobjects
22+
--
23+
-- Examples:
24+
-- - va) - [V]isually select [A]round [)]paren
25+
-- - yinq - [Y]an [I]nside [N]ext [Q]uote
26+
-- - ci' - [C]hange [I]nside [']quote
27+
require('mini.ai').setup { n_lines = 500 }
28+
29+
-- Add/delete/replace surroundings (bracets, quotes, etc.)
30+
--
31+
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
32+
-- - sd' - [S]urround [D]elete [']quotes
33+
-- - sr)' - [S]urround [R]eplace [)] [']
34+
require('mini.surround').setup()
35+
36+
-- For more Mini.nvim stuff:
37+
-- Check out: https://github.com/echasnovski/mini.nvim
38+
end,
39+
},
40+
})

0 commit comments

Comments
 (0)