mirror of
https://github.com/Cian-H/my_nvim_config.git
synced 2025-12-23 04:31:57 +00:00
Attempt to refactor config to be more maintainable
This commit is contained in:
@@ -1,15 +1,13 @@
|
|||||||
return { -- General programming utilities go here
|
return {
|
||||||
-- Tools for configuration and plugin development
|
{ -- Autoformat
|
||||||
{
|
"stevearc/conform.nvim",
|
||||||
"klen/nvim-config-local",
|
event = "VimEnter",
|
||||||
lazy = false, -- Load immediately to ensure it catches the initial working directory
|
|
||||||
opts = {
|
opts = {
|
||||||
config_files = { ".nvim.lua", ".nvimrc", ".exrc" },
|
notify_on_error = false,
|
||||||
hashfile = vim.fn.stdpath("data") .. "/config-local",
|
format_on_save = {
|
||||||
autocommands_create = true,
|
timeout_ms = 500,
|
||||||
commands_create = true,
|
lsp_fallback = true,
|
||||||
silent = false,
|
},
|
||||||
lookup_parents = true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -22,60 +20,6 @@ return { -- General programming utilities go here
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Privilege escalation plugin
|
|
||||||
{ "lambdalisue/suda.vim", event = "VeryLazy" },
|
|
||||||
{
|
|
||||||
"folke/trouble.nvim",
|
|
||||||
cmd = { "Trouble" },
|
|
||||||
opts = {
|
|
||||||
modes = {
|
|
||||||
lsp = {
|
|
||||||
win = { position = "right" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = require("config.keys").trouble,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"folke/todo-comments.nvim",
|
|
||||||
cmd = { "TodoTrouble", "TodoTelescope" },
|
|
||||||
event = "VimEnter",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
|
||||||
keys = require("config.keys").todo_comments,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"lewis6991/gitsigns.nvim",
|
|
||||||
event = "VimEnter",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
|
||||||
config = function()
|
|
||||||
require("gitsigns").setup({
|
|
||||||
signs = {
|
|
||||||
add = { text = "┃" },
|
|
||||||
change = { text = "┃" },
|
|
||||||
delete = { text = "_" },
|
|
||||||
topdelete = { text = "‾" },
|
|
||||||
changedelete = { text = "~" },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
keys = require("config.keys").gitsigns,
|
|
||||||
},
|
|
||||||
{ -- Oil is a very nice buffer-based filetree editor
|
|
||||||
"stevearc/oil.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {},
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
||||||
keys = require("config.keys").oil,
|
|
||||||
},
|
|
||||||
{ -- Harpoon, because i keep losing track of my markers
|
|
||||||
"theprimeagen/harpoon",
|
|
||||||
branch = "harpoon2",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
|
||||||
config = function()
|
|
||||||
require("harpoon"):setup({})
|
|
||||||
end,
|
|
||||||
keys = require("config.keys").harpoon,
|
|
||||||
},
|
|
||||||
{ -- Package and devenv plugins
|
{ -- Package and devenv plugins
|
||||||
"danymat/neogen",
|
"danymat/neogen",
|
||||||
event = "VimEnter",
|
event = "VimEnter",
|
||||||
@@ -94,26 +38,36 @@ return { -- General programming utilities go here
|
|||||||
end,
|
end,
|
||||||
keys = require("config.keys").neogen,
|
keys = require("config.keys").neogen,
|
||||||
},
|
},
|
||||||
{ -- Autoformat
|
{ -- A plugin to integrate tests is helpful, so i'm adding neotest
|
||||||
"stevearc/conform.nvim",
|
"nvim-neotest/neotest",
|
||||||
event = "VimEnter",
|
event = "VeryLazy",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-neotest/nvim-nio",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"antoinemadec/FixCursorHold.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ -- Tools for configuration and plugin development
|
||||||
|
"klen/nvim-config-local",
|
||||||
|
lazy = false, -- Load immediately to ensure it catches the initial working directory
|
||||||
opts = {
|
opts = {
|
||||||
notify_on_error = false,
|
config_files = { ".nvim.lua", ".nvimrc", ".exrc" },
|
||||||
format_on_save = {
|
hashfile = vim.fn.stdpath("data") .. "/config-local",
|
||||||
timeout_ms = 500,
|
autocommands_create = true,
|
||||||
lsp_fallback = true,
|
commands_create = true,
|
||||||
},
|
silent = false,
|
||||||
formatters_by_ft = {
|
lookup_parents = true,
|
||||||
lua = { "stylua" },
|
|
||||||
nix = { "alejandra" },
|
|
||||||
-- Conform can also run multiple formatters sequentially
|
|
||||||
-- python = { "isort", "black" },
|
|
||||||
--
|
|
||||||
-- You can use a sub-list to tell conform to run *until* a formatter
|
|
||||||
-- is found.
|
|
||||||
-- javascript = { { "prettierd", "prettier" } },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{ -- Add Overseer as a task running tool
|
||||||
|
"stevearc/overseer.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
config = function()
|
||||||
|
require("overseer").setup()
|
||||||
|
end,
|
||||||
|
keys = require("config.keys").overseer,
|
||||||
},
|
},
|
||||||
{ -- Highlight, edit, and navigate code
|
{ -- Highlight, edit, and navigate code
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
@@ -132,30 +86,4 @@ return { -- General programming utilities go here
|
|||||||
{ "nushell/tree-sitter-nu", build = ":TSUpdate nu" },
|
{ "nushell/tree-sitter-nu", build = ":TSUpdate nu" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ -- Undo tree
|
|
||||||
"mbbill/undotree",
|
|
||||||
event = "VeryLazy",
|
|
||||||
keys = require("config.keys").undotree,
|
|
||||||
},
|
|
||||||
{ -- Add Overseer as a task running tool
|
|
||||||
"stevearc/overseer.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = {},
|
|
||||||
config = function()
|
|
||||||
require("overseer").setup()
|
|
||||||
end,
|
|
||||||
keys = require("config.keys").overseer,
|
|
||||||
},
|
|
||||||
{ -- A plugin to integrate tests is helpful, so i'm adding neotest
|
|
||||||
"nvim-neotest/neotest",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-neotest/nvim-nio",
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"antoinemadec/FixCursorHold.nvim",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- Rust tools like inlay hints are absolutely essential
|
|
||||||
{ "mrcjkb/rustaceanvim", version = "^6", lazy = false },
|
|
||||||
}
|
}
|
||||||
3
lua/plugins/command.lua
Normal file
3
lua/plugins/command.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
{ "lambdalisue/suda.vim", event = "VeryLazy" }, -- Privilege escalation plugin
|
||||||
|
}
|
||||||
108
lua/plugins/editor.lua
Normal file
108
lua/plugins/editor.lua
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
require("gitsigns").setup({
|
||||||
|
signs = {
|
||||||
|
add = { text = "┃" },
|
||||||
|
change = { text = "┃" },
|
||||||
|
delete = { text = "_" },
|
||||||
|
topdelete = { text = "‾" },
|
||||||
|
changedelete = { text = "~" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
keys = require("config.keys").gitsigns,
|
||||||
|
},
|
||||||
|
{ -- Harpoon, because i keep losing track of my markers
|
||||||
|
"theprimeagen/harpoon",
|
||||||
|
branch = "harpoon2",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
require("harpoon"):setup({})
|
||||||
|
end,
|
||||||
|
keys = require("config.keys").harpoon,
|
||||||
|
},
|
||||||
|
{ -- Definitely need to add a plugin for quickly making notes in obsidian
|
||||||
|
"epwalsh/obsidian.nvim",
|
||||||
|
version = "*",
|
||||||
|
cmd = "Obsidian",
|
||||||
|
event = "VeryLazy",
|
||||||
|
cond = function()
|
||||||
|
return vim.fn.executable("obsidian") == 1
|
||||||
|
end,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
},
|
||||||
|
opts = function()
|
||||||
|
local target_path = vim.fn.expand("~/Documents/Work_Notes/")
|
||||||
|
local workspaces = {}
|
||||||
|
|
||||||
|
if vim.fn.isdirectory(target_path) == 1 then
|
||||||
|
table.insert(workspaces, {
|
||||||
|
name = "work",
|
||||||
|
path = target_path,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if #workspaces == 0 then
|
||||||
|
local fallback_path = vim.fn.stdpath("data") .. "/obsidian_fallback"
|
||||||
|
if vim.fn.isdirectory(fallback_path) == 0 then
|
||||||
|
vim.fn.mkdir(fallback_path, "p")
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(workspaces, {
|
||||||
|
name = "fallback",
|
||||||
|
path = fallback_path,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.notify(
|
||||||
|
"Obsidian: 'Work_Notes' not found. Using fallback path.",
|
||||||
|
vim.log.levels.WARN
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
workspaces = workspaces,
|
||||||
|
completion = {
|
||||||
|
min_chars = 2,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{ -- Oil is a very nice buffer-based filetree editor
|
||||||
|
"stevearc/oil.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
keys = require("config.keys").oil,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/todo-comments.nvim",
|
||||||
|
cmd = { "TodoTrouble", "TodoTelescope" },
|
||||||
|
event = "VimEnter",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
keys = require("config.keys").todo_comments,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
cmd = { "Trouble" },
|
||||||
|
opts = {
|
||||||
|
modes = {
|
||||||
|
lsp = {
|
||||||
|
win = { position = "right" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = require("config.keys").trouble,
|
||||||
|
},
|
||||||
|
{ -- Undo tree
|
||||||
|
"mbbill/undotree",
|
||||||
|
event = "VeryLazy",
|
||||||
|
keys = require("config.keys").undotree,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
return { -- Non programming quality of life utilities go here
|
|
||||||
{ -- Definitely need to add a plugin for quickly making notes in obsidian
|
|
||||||
"epwalsh/obsidian.nvim",
|
|
||||||
version = "*",
|
|
||||||
cmd = "Obsidian",
|
|
||||||
event = "VeryLazy",
|
|
||||||
cond = function()
|
|
||||||
return vim.fn.executable("obsidian") == 1
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
},
|
|
||||||
opts = function()
|
|
||||||
local target_path = vim.fn.expand("~/Documents/Work_Notes/")
|
|
||||||
local workspaces = {}
|
|
||||||
|
|
||||||
if vim.fn.isdirectory(target_path) == 1 then
|
|
||||||
table.insert(workspaces, {
|
|
||||||
name = "work",
|
|
||||||
path = target_path,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
if #workspaces == 0 then
|
|
||||||
local fallback_path = vim.fn.stdpath("data") .. "/obsidian_fallback"
|
|
||||||
if vim.fn.isdirectory(fallback_path) == 0 then
|
|
||||||
vim.fn.mkdir(fallback_path, "p")
|
|
||||||
end
|
|
||||||
|
|
||||||
table.insert(workspaces, {
|
|
||||||
name = "fallback",
|
|
||||||
path = fallback_path,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.notify(
|
|
||||||
"Obsidian: 'Work_Notes' not found. Using fallback path.",
|
|
||||||
vim.log.levels.WARN
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
workspaces = workspaces,
|
|
||||||
completion = {
|
|
||||||
min_chars = 2,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"MeanderingProgrammer/render-markdown.nvim",
|
|
||||||
opts = {},
|
|
||||||
ft = "markdown",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
"echasnovski/mini.nvim",
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
},
|
|
||||||
---@module 'render-markdown'
|
|
||||||
---@type render.md.UserConfig
|
|
||||||
},
|
|
||||||
{ -- A cheatsheet will always be useful until im a bit more familiar with vim
|
|
||||||
"sudormrfbin/cheatsheet.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
"nvim-lua/popup.nvim",
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
3
lua/plugins/lang/kitty.lua
Normal file
3
lua/plugins/lang/kitty.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
{ "fladson/vim-kitty", ft = "kitty" },
|
||||||
|
}
|
||||||
10
lua/plugins/lang/lua.lua
Normal file
10
lua/plugins/lang/lua.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
14
lua/plugins/lang/markdown.lua
Normal file
14
lua/plugins/lang/markdown.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
|
opts = {},
|
||||||
|
ft = "markdown",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"echasnovski/mini.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
---@module 'render-markdown'
|
||||||
|
---@type render.md.UserConfig
|
||||||
|
},
|
||||||
|
}
|
||||||
10
lua/plugins/lang/nix.lua
Normal file
10
lua/plugins/lang/nix.lua
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
nix = { "alejandra" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
21
lua/plugins/lang/python.lua
Normal file
21
lua/plugins/lang/python.lua
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"benomahony/uv.nvim",
|
||||||
|
ft = { "python" },
|
||||||
|
dependencies = {
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
picker_integration = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
opts = {
|
||||||
|
formatters_by_ft = {
|
||||||
|
python = { "ruff" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
4
lua/plugins/lang/rust.lua
Normal file
4
lua/plugins/lang/rust.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
-- Analysis and inlay hints are absolutely essential
|
||||||
|
{ "mrcjkb/rustaceanvim", version = "^6", lazy = false },
|
||||||
|
}
|
||||||
3
lua/plugins/lang/scallop.lua
Normal file
3
lua/plugins/lang/scallop.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
{ "scallop-lang/vim-scallop", ft = "scallop" },
|
||||||
|
}
|
||||||
@@ -56,6 +56,4 @@ return {
|
|||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ "fladson/vim-kitty", ft = "kitty" },
|
|
||||||
{ "scallop-lang/vim-scallop", ft = "scallop" },
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,15 @@ return { -- UI components and other visual elements are declared here
|
|||||||
vim.cmd.colorscheme("tokyonight-night")
|
vim.cmd.colorscheme("tokyonight-night")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
{ -- A cheatsheet will always be useful until im a bit more familiar with vim
|
||||||
|
"sudormrfbin/cheatsheet.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
"nvim-lua/popup.nvim",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
|
},
|
||||||
{ "MunifTanjim/nui.nvim", lazy = true },
|
{ "MunifTanjim/nui.nvim", lazy = true },
|
||||||
{ -- Useful plugin to show you pending keybinds.
|
{ -- Useful plugin to show you pending keybinds.
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
|
|||||||
Reference in New Issue
Block a user