feat: Adding a bunch of changes to move further towards a clean and more

builtin setup rather than relying upon plugins.
This commit is contained in:
2026-05-26 05:28:54 -05:00
parent abe81c01b3
commit a587e16f1f
15 changed files with 137 additions and 246 deletions

View File

@@ -46,7 +46,6 @@ vim.loader.enable()
require('custom_commands')
require('plugins')
require('language_support')
require('autocmds')
require('keymappings')
require('settings')

View File

@@ -3,7 +3,7 @@ vim.api.nvim_create_autocmd({ 'BufReadPre' }, {
pattern = '*',
group = vim.api.nvim_create_augroup('largefile', { clear = true }),
callback = function(args)
local max_filesize_MiB = 2
local max_filesize_MiB = 1
local _, stats = pcall(function()
return vim.loop.fs_stat(vim.api.nvim_buf_get_name(args.buf))

View File

@@ -3,3 +3,7 @@ vim.api.nvim_create_user_command('FindAndReplace', function(opts)
-- TODO: Does not close the buffers opened through changes
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)

View File

@@ -51,8 +51,8 @@ vim.keymap.set('n', '<leader>w', ':set list!<CR>', options)
vim.keymap.set('n', '<space>', 'za')
-- Comment toggling
vim.keymap.set('n', '<leader>c', 'gcc', {remap=true})
vim.keymap.set('v', '<leader>c', 'gc', {remap=true})
vim.keymap.set('n', '<leader>c', 'gcc', { remap = true })
vim.keymap.set('v', '<leader>c', 'gc', { remap = true })
-- Keymaps for custom functions
vim.keymap.set('n', '<leader>et', function() custom_functions.execute('test') end)

View File

@@ -1,43 +1,34 @@
require('vim._core.ui2').enable()
require('vim._core.ui2').enable() -- message + cmdline presentation layer replacement
-- Load the following plugins eagerly to prevent visual oddities
vim.pack.add({
'https://github.com/sainnhe/gruvbox-material',
})
vim.g.gruvbox_material_enable_italic = true
vim.g.gruvbox_material_background = 'hard'
vim.g.gruvbox_material_better_performance = 1
vim.cmd.colorscheme('gruvbox-material')
require('plugins.lualine') -- Status line plugin
require('plugins.gruvbox') -- Colorscheme setup
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.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.treesitter') -- Syntax highlighting and tree support
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
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/habamax/vim-godot'}) -- Godot specific bindings and debug
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
require('nvim-autopairs').setup()
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
end)
-- TODO: Still in need of translation to the new setup
-- 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
-- Currently not enabled
-- require('plugins.nvim-lint'), -- Linter loader
-- require('plugins.fugitive'), -- _The_ Git integration plugin people have been using forever
-- require('plugins.schemastore'), -- Loads YAML and JSON schemas for autocompletion

View File

@@ -1,78 +1,69 @@
return {
'mfussenegger/nvim-dap',
dependencies = {
{ 'jay-babu/mason-nvim-dap.nvim' },
{ 'nvim-neotest/nvim-nio' },
vim.pack.add({
'https://github.com/rcarriga/nvim-dap-ui',
'https://github.com/mfussenegger/nvim-dap',
'https://github.com/nvim-neotest/nvim-nio',
'https://github.com/theHamsta/nvim-dap-virtual-text',
})
require('dapui').setup({
mappings = {
open = 'o',
remove = 'd',
edit = 'e',
repl = 'r',
toggle = 't',
},
layouts = {
{
'rcarriga/nvim-dap-ui',
config = function()
require('dapui').setup({
mappings = {
open = 'o',
remove = 'd',
edit = 'e',
repl = 'r',
toggle = 't',
},
layouts = {
{
elements = {
'scopes',
'breakpoints',
'stacks',
},
size = 0.33,
position = 'right',
},
{
elements = {
'console',
'watches',
},
size = 0.2,
position = 'bottom',
},
},
floating = {
max_height = nil,
max_width = nil,
border = 'single',
mappings = {
close = { 'q', '<Esc>' },
},
},
windows = {
indent = 1
},
render = {
max_type_length = nil,
},
})
end,
elements = {
'scopes',
'breakpoints',
'stacks',
},
size = 0.33,
position = 'right',
},
{
'theHamsta/nvim-dap-virtual-text',
config = function()
require('nvim-dap-virtual-text').setup()
end,
elements = {
'console',
'watches',
},
size = 0.2,
position = 'bottom',
},
},
config = function()
local mason_dap = require('mason-nvim-dap')
floating = {
max_height = nil,
max_width = nil,
border = 'single',
mappings = {
close = { 'q', '<Esc>' },
},
},
windows = {
indent = 1
},
render = {
max_type_length = nil,
},
})
require('nvim-dap-virtual-text').setup()
-- local mason_dap = require('mason-nvim-dap')
local dap, dapui = require('dap'), require('dapui')
mason_dap.setup({
ensure_installed = {
'codelldb',
'debugpy',
},
automatic_installation = true,
handlers = {
function(config)
require('mason-nvim-dap').default_setup(config)
end,
}
})
-- mason_dap.setup({
-- ensure_installed = {
-- 'codelldb',
-- 'debugpy',
-- },
-- automatic_installation = true,
-- handlers = {
-- function(config)
-- require('mason-nvim-dap').default_setup(config)
-- end,
-- }
-- })
dap.listeners.before.attach.dapui_config = function()
dapui.open()
@@ -136,53 +127,15 @@ return {
}
}
}
end,
keys = {
{
'<leader>b',
function() require('dap').toggle_breakpoint() end,
desc = 'DAP: Toggle Breakpoint',
},
{
'<leader>B',
function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end,
desc = 'DAP: Set conditional breakpoint',
},
{
'<leader>dh',
function() require('dap.ui.widgets').hover() end,
mode = { 'n', 'v' },
desc = 'DAP: Debug hover',
},
{
'<F5>',
function() require('dap').continue() end,
desc = 'DAP: Continue',
},
{
'<F6>',
function() require('dap').run_to_cursor() end,
desc = 'DAP: Run to cursor',
},
{
'<F8>',
function() require('dap').terminate() end,
desc = 'DAP: Terminate debug session',
},
{
'<F10>',
function() require('dap').step_over() end,
desc = 'DAP: Step Over',
},
{
'<F11>',
function() require('dap').step_into() end,
desc = 'DAP: Step Into',
},
{
'<F12>',
function() require('dap').step_out() end,
desc = 'DAP: Step Out',
},
},
}
vim.keymap.set('n', '<leader>b', function ()
require('dap').toggle_breakpoint()
end)
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end)
vim.keymap.set({'n', 'v'}, '<leader>dh', function() require('dap.ui.widgets').hover() end)
vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
vim.keymap.set('n', '<F6>', function() require('dap').run_to_cursor() end)
vim.keymap.set('n', '<F8>', function() require('dap').terminate() end)
vim.keymap.set('n', '<F10>', function() require('dap').step_over() end)
vim.keymap.set('n', '<F11>', function() require('dap').step_into() end)
vim.keymap.set('n', '<F12>', function() require('dap').step_out() end)

View File

@@ -31,19 +31,19 @@ require('gitsigns').setup {
end)
-- Actions
map('n', '<leader>gs', gitsigns.stage_hunk)
map('n', '<leader>gs', gitsigns.stage_hunk) -- TODO: Overlaps with LSP keymappings
map('n', '<leader>gu', gitsigns.undo_stage_hunk)
map('n', '<leader>gr', gitsigns.reset_hunk)
map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
map('n', '<leader>gr', gitsigns.reset_hunk) -- TODO: Overlaps with LSP keymappings
map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
map('v', '<leader>gu', function() gitsigns.undo_stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
map('n', '<leader>gS', gitsigns.stage_buffer)
map('n', '<leader>gR', gitsigns.reset_buffer)
map('n', '<leader>gp', gitsigns.preview_hunk)
map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end)
map('n', '<leader>gtb', gitsigns.toggle_current_line_blame)
map('n', '<leader>gd', gitsigns.diffthis)
map('n', '<leader>gD', function() gitsigns.diffthis('~') end)
map('n', '<leader>gd', gitsigns.diffthis) -- TODO: Overlaps with LSP keymappings
map('n', '<leader>gD', function() gitsigns.diffthis('~') end) -- TODO: Overlaps with LSP keymappings
map('n', '<leader>gtd', gitsigns.toggle_deleted)
-- Text object

View File

@@ -0,0 +1,8 @@
vim.pack.add({
'https://github.com/sainnhe/gruvbox-material',
})
vim.g.gruvbox_material_enable_italic = true
vim.g.gruvbox_material_background = 'hard'
vim.g.gruvbox_material_better_performance = 1
vim.cmd.colorscheme('gruvbox-material')

View File

@@ -1,14 +1,16 @@
-- Treesitter
-- def tsi [parser: string] {
-- let tree = $"($env.HOME)/.local/share/nvim/site"
-- luarocks $"--tree=($tree)" install $"tree-sitter-($parser)"
-- }
local rocks_path = os.getenv('HOME') .. "/.luarocks/lib/luarocks/rocks-5.1"
local rocks_path = vim.fn.stdpath("data") .. "/site/lib/luarocks/rocks-5.1"
-- Pick up the installed
for _, parser_dir in ipairs(vim.fn.glob(rocks_path .. '/tree-sitter-*/*/', true, true)) do
vim.opt.runtimepath:prepend(parser_dir)
end
-- Start treesitter parsing on the current buffer
vim.api.nvim_create_autocmd("FileType", {
callback = function (args)
pcall(vim.treesitter.start, args.buf)
callback = function(ev)
-- Use pcall to prevent blocking errors
pcall(vim.treesitter.start, ev.buf)
end
})
@@ -18,15 +20,14 @@ vim.diagnostic.config({
prefix = "",
source = 'always',
},
-- signs = true,
severity_sort = true,
-- update_in_insert = true,
float = {
source = 'always'
}
})
-- LSP
-- TODO: test out removing the lspconfig plugin and using the built-in enablement
vim.pack.add({
'https://github.com/neovim/nvim-lspconfig',
})
@@ -66,7 +67,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<leader><leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
vim.keymap.set('n', '<leader>for', function() vim.lsp.buf.format { async = true } end, bufopts)
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, bufopts)
vim.keymap.set('i', '<c-space>', vim.lsp.completion.get, bufopts)
end,

View File

@@ -21,7 +21,7 @@ cmp.setup {
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-j>'] = cmp.mapping.scroll_docs(-4),
['<C-k>'] = cmp.mapping.scroll_docs(4),
['<C-space>'] = cmp.mapping.complete(),
['<C-space>'] = cmp.mapping.complete(), -- TODO: Overlaps with completion(? possibly doesn't due to state)
['<C-y>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,

View File

@@ -1,55 +0,0 @@
vim.pack.add({
'https://github.com/nvim-treesitter/nvim-treesitter'
})
-- require('nvim-treesitter.configs').setup {
-- auto_install = true,
-- ensure_installed = {
-- 'c',
-- 'c_sharp',
-- 'comment',
-- 'css',
-- 'gdscript',
-- 'gitignore',
-- 'html',
-- 'java',
-- 'javascript',
-- 'json',
-- 'lua',
-- 'markdown',
-- 'markdown_inline',
-- 'python',
-- 'query',
-- 'rust',
-- 'sql',
-- 'tera',
-- 'toml',
-- 'tsx',
-- 'typescript',
-- 'yaml',
-- },
-- highlight = {
-- enable = true,
-- additional_vim_regex_highlighting = false,
-- },
-- incremental_selection = {
-- enable = true,
-- },
-- indent = {
-- enable = true,
-- },
-- rainbow = {
-- enable = true,
-- }
-- }
vim.treesitter.language.register('markdown', 'telekasten')
-- return {
-- 'nvim-treesitter/nvim-treesitter',
-- build = function()
-- require('nvim-treesitter.install').update({ with_sync = true })
-- end,
-- config = function()
-- end,
-- }

View File

@@ -1,3 +1,4 @@
-- Focus plugin that 'dims' lines around the current block/line
vim.pack.add({
'https://github.com/folke/twilight.nvim'
})
@@ -16,4 +17,4 @@ require('twilight').setup({
}
})
vim.keymap.set('n', '<leader>f', ':Twilight<CR>')
vim.keymap.set('n', '<leader>foc', ':Twilight<CR>')

View File

@@ -1,8 +1,7 @@
return {
'mosheavni/yaml-companion.nvim',
config = function(_, opts)
local cfg = require('yaml-companion').setup(opts)
vim.lsp.config('yamlls', cfg)
vim.lsp.enable('yamlls')
end,
}
vim.pack.add({
'https://github.com/mosheavni/yaml-companion.nvim'
})
local cfg = require('yaml-companion').setup()
vim.lsp.config('yamlls', cfg)
vim.lsp.enable('yamlls')

View File

@@ -37,3 +37,6 @@ vim.opt.undodir = os.getenv('HOME') .. '/.config/nvim/undodir' -- Set a spe
vim.opt.undofile = true -- Enable undo files
vim.opt.updatetime = 50 -- 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
vim.g.netrw_winsize = 25 -- Percentage based pane size for directory exploring

View File

@@ -1,13 +0,0 @@
-- Treesitter
-- def tsi [parser: string] {
-- let tree = $"($env.HOME)/.local/share/nvim/site"
-- luarocks $"--tree=($tree)" install $"tree-sitter-($parser)"
-- }
local rocks_path = vim.fn.stdpath("data") .. "/site/lib/luarocks/rocks-5.1"
vim.api.nvim_create_autocmd("FileType", {
callback = function (args)
pcall(vim.treesitter.start, args.buf)
end
})