feat: enhance editor and language support with new plugins and configurations

This commit is contained in:
sankalp committed 2025-09-12 18:26:44 +05:45
1 parent 84f2be62ae
commit 6d3a60c8dd
7 files changed
+315 -151

No files matched your search

+5
View File
@@ -5,6 +5,7 @@
"better-escape.nvim": { "branch": "master", "commit": "19a38aab94961016430905ebec30d272a01e9742" }, "better-escape.nvim": { "branch": "master", "commit": "19a38aab94961016430905ebec30d272a01e9742" },
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" }, "conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
"floaterm": { "branch": "main", "commit": "ae3de018d20dccd9372bbff7137e8a6d6030f69e" },
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" }, "gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
@@ -27,11 +28,13 @@
"neoscroll.nvim": { "branch": "master", "commit": "f957373912e88579e26fdaea4735450ff2ef5c9c" }, "neoscroll.nvim": { "branch": "master", "commit": "f957373912e88579e26fdaea4735450ff2ef5c9c" },
"netrw.nvim": { "branch": "master", "commit": "90501c62b9b816ed3ed1e912ae9db9af5671a1b2" }, "netrw.nvim": { "branch": "master", "commit": "90501c62b9b816ed3ed1e912ae9db9af5671a1b2" },
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" }, "nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
"nvim-genghis": { "branch": "main", "commit": "cdf584d05ffc9d5c1f247079991552249e4f7487" },
"nvim-lint": { "branch": "master", "commit": "f126af5345c7472e9a0cdbe1d1a29209be72c4c4" }, "nvim-lint": { "branch": "master", "commit": "f126af5345c7472e9a0cdbe1d1a29209be72c4c4" },
"nvim-lspconfig": { "branch": "master", "commit": "c8b90ae5cbe21d547b342b05c9266dcb8ca0de8f" }, "nvim-lspconfig": { "branch": "master", "commit": "c8b90ae5cbe21d547b342b05c9266dcb8ca0de8f" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
"smartcolumn.nvim": { "branch": "main", "commit": "b9cdbdf42f7ac5a659204cd5926017c7ff724a19" }, "smartcolumn.nvim": { "branch": "main", "commit": "b9cdbdf42f7ac5a659204cd5926017c7ff724a19" },
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
"tiny-code-action.nvim": { "branch": "main", "commit": "2b3fa2fbd25496259eaf50987097982f8ad08d1b" }, "tiny-code-action.nvim": { "branch": "main", "commit": "2b3fa2fbd25496259eaf50987097982f8ad08d1b" },
@@ -39,7 +42,9 @@
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
"uv.nvim": { "branch": "main", "commit": "be4a7d47a976249282bb2f71fc773ac2f5325973" }, "uv.nvim": { "branch": "main", "commit": "be4a7d47a976249282bb2f71fc773ac2f5325973" },
"vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" },
"vim-wakatime": { "branch": "master", "commit": "d7973b157a632d1edeff01818f18d67e584eeaff" }, "vim-wakatime": { "branch": "master", "commit": "d7973b157a632d1edeff01818f18d67e584eeaff" },
"volt": { "branch": "main", "commit": "7b8c5e790120d9f08c8487dcb80692db6d2087a1" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
"windsurf.vim": { "branch": "main", "commit": "a8d47ec54fe82df920b2545559f767003e8a7f8d" } "windsurf.vim": { "branch": "main", "commit": "a8d47ec54fe82df920b2545559f767003e8a7f8d" }
} }
+44 -11
View File
@@ -156,15 +156,48 @@ return {
end, end,
}, },
-- multiple cursor -- code action
-- { {
-- "terryma/vim-multiple-cursors", "rachartier/tiny-code-action.nvim",
-- config = function() dependencies = {
-- vim.g.multi_cursor_use_default_mapping = 0 {
-- vim.g.multi_cursor_next_key = "<A-n>" "folke/snacks.nvim",
-- vim.g.multi_cursor_prev_key = "<A-p>" opts = {
-- vim.g.multi_cursor_skip_key = "<A-x>" terminal = {},
-- vim.g.multi_cursor_quit_key = "<leader>mc" },
-- end, },
-- }, },
event = "LspAttach",
config = function()
local codeaction = require("tiny-code-action")
codeaction.setup({
picker = {
"buffer",
opts = {
auto_preview = true,
hotkeys = true,
hotkeys_mode = "sequential",
},
},
})
vim.keymap.set("n", "<leader>.", codeaction.code_action)
end,
},
-- visual multi
{
"mg979/vim-visual-multi",
event = "VeryLazy",
init = function()
vim.g.VM_maps = {
["Find Under"] = "<M-d>",
["Find Subword Under"] = "<M-d>",
["Select All"] = "<C-M-d>",
["Add Cursor Down"] = "<C-M-j>",
["Add Cursor Up"] = "<C-M-k>",
}
end,
},
} }
+32 -3
View File
@@ -6,11 +6,38 @@ return {
keys = { "<leader>tf" }, keys = { "<leader>tf" },
config = function() config = function()
require("conform").setup({ require("conform").setup({
formatters = {
["markdown-toc"] = {
condition = function(_, ctx)
for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do
if line:find("<!%-%-% toc %-%->") then
return true
end
end
end,
},
["markdownlint-cli2"] = {
condition = function(_, ctx)
local diag = vim.tbl_filter(function(d)
return d.source == "markdownlint"
end, vim.diagnostic.get(ctx.buf))
return #diag > 0
end,
},
},
formatters_by_ft = { formatters_by_ft = {
lua = { "stylua" }, ["lua"] = { "stylua" },
python = { "black" }, ["python"] = { "ruff_fix", "ruff_format", "ruff_organize_imports" },
["javascript"] = { "prettier" },
["typescript"] = { "prettier" },
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
["mdx"] = { "prettier" },
["_"] = { "trim_whitespace" }, ["_"] = { "trim_whitespace" },
}, },
options = {
stop_after_first = true,
},
format_after_save = function(bufnr) format_after_save = function(bufnr)
if not vim.b[bufnr].conform_disable then if not vim.b[bufnr].conform_disable then
return { return {
@@ -27,9 +54,11 @@ return {
end) end)
require("mason-conform").setup({ require("mason-conform").setup({
ensure_installed = { ensure_installed = {
"black", "ruff",
"stylua", "stylua",
"prettier", "prettier",
"markdown-toc",
"markdownlint-cli2",
}, },
automatic_installation = true, automatic_installation = true,
}) })
+121 -108
View File
@@ -1,116 +1,129 @@
return { return {
-- treesitter -- treesitter
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" }, event = { "BufReadPost", "BufNewFile" },
config = function() config = function()
require("nvim-treesitter").setup({ require("nvim-treesitter").setup({
ensure_installed = { ensure_installed = {
"c", "c",
"markdown", "markdown",
"python", "python",
"java", "java",
"cpp", "cpp",
"bash", "bash",
"lua", "lua",
"make", "make",
"latex", "latex",
"json", "json",
"jsonc", "jsonc",
"sql", "sql",
"yaml", "yaml",
"toml", "toml",
"javascript", "javascript",
"ts_ls", "ts_ls",
"gitignore", "gitignore",
"go", "go",
"rust", "rust",
"html", "html",
"css", "css",
"scss", "scss",
"markdown_inline", "markdown_inline",
}, },
auto_install = true, auto_install = true,
highlight = { highlight = {
enable = true, enable = true,
additional_vim_regex_highlighting = true, additional_vim_regex_highlighting = true,
}, },
indent = { indent = {
enable = true, enable = true,
}, },
}) })
end, end,
}, },
-- rendering for html, latex, md -- rendering for html, latex, md
{ {
"OXY2DEV/markview.nvim", "OXY2DEV/markview.nvim",
lazy = false, lazy = false,
-- to load before treesitter -- to load before treesitter
priority = 45, priority = 45,
config = function() config = function()
require("markview").setup({ require("markview").setup({
markdown = { markdown = {
code_blocks = { sign = false }, code_blocks = { sign = false },
}, },
}) })
end, end,
}, },
-- markdown preview -- markdown preview
{ {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
build = "cd app && yarn install", build = "cd app && yarn install",
init = function() init = function()
vim.g.mkdp_filetypes = { "markdown" } vim.g.mkdp_filetypes = { "markdown" }
end, end,
ft = "markdown", ft = "markdown",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview" }, cmd = { "MarkdownPreviewToggle", "MarkdownPreview" },
}, },
{ {
"danymat/neogen", "danymat/neogen",
dependencies = { "nvim-treesitter/nvim-treesitter" }, dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = { opts = {
snippet_engine = "luasnip", snippet_engine = "luasnip",
languages = { languages = {
python = { python = {
template = { template = {
annotation_convention = "google_docstrings", annotation_convention = "google_docstrings",
}, },
}, },
}, },
}, },
}, },
-- auto pairs -- auto pairs
{ {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
event = "InsertEnter", event = "InsertEnter",
config = function() config = function()
require("nvim-autopairs").setup() require("nvim-autopairs").setup()
-- add new rules -- add new rules
local pairs = require("nvim-autopairs") local pairs = require("nvim-autopairs")
local rule = require("nvim-autopairs.rule") local rule = require("nvim-autopairs.rule")
local cond = require("nvim-autopairs.conds") local cond = require("nvim-autopairs.conds")
pairs.add_rules({ pairs.add_rules({
rule("$", "$", { "tex", "latex", "plaintex" }) rule("$", "$", { "tex", "latex", "plaintex" })
-- do not move right when repeat character -- do not move right when repeat character
:with_move(cond.none()), :with_move(cond.none()),
}) })
end, end,
}, },
{ {
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
event = "InsertEnter", ft = {
lazy = true, "html",
opts = { "xml",
enable_close = true, "javascript",
enable_rename = true, "typescript",
enable_close_on_slash = true, "javascriptreact",
}, "typescriptreact",
}, "jsx",
"tsx",
"vue",
"svelte",
"markdown",
},
event = "InsertEnter",
lazy = true,
opts = {
enable_close = true,
enable_rename = true,
enable_close_on_slash = true,
},
},
} }
+23 -11
View File
@@ -2,18 +2,29 @@ return {
"mfussenegger/nvim-lint", "mfussenegger/nvim-lint",
dependencies = { "rshkarin/mason-nvim-lint" }, dependencies = { "rshkarin/mason-nvim-lint" },
event = { "BufReadPost", "BufNewFile" }, event = { "BufReadPost", "BufNewFile" },
keys = {
{
"<leader>L",
mode = { "n" },
function()
require("lint").try_lint()
end,
desc = "Trigger linting for current file",
},
},
config = function() config = function()
require("lint").linters_by_ft = { require("lint").linters_by_ft = {
javascript = { "eslint_d" }, ["*"] = { "codespell" },
typescript = { "eslint_d" }, ["javascript"] = { "eslint_d", "cspell" },
javascriptreact = { "eslint_d" }, ["typescript"] = { "eslint_d", "cspell" },
typescriptreact = { "eslint_d" }, ["javascriptreact"] = { "eslint_d", "cspell" },
dockerfile = { "hadolint" }, ["typescriptreact"] = { "eslint_d", "cspell" },
markdown = { "write_good", "markdownlint" }, ["dockerfile"] = { "hadolint" },
text = { "write_good" }, ["markdown"] = { "write_good", "markdownlint" },
sh = { "shellcheck" }, ["text"] = { "write_good" },
yaml = { "actionlint" }, ["sh"] = { "shellcheck" },
python = { "ruff" }, ["yaml"] = { "actionlint" },
["python"] = { "ruff" },
} }
require("mason-nvim-lint").setup({ require("mason-nvim-lint").setup({
ensure_installed = { ensure_installed = {
@@ -25,7 +36,8 @@ return {
"actionlint", "actionlint",
"djlint", "djlint",
"ruff", "ruff",
"pylint", "codespell",
"cspell",
}, },
automatic_installation = true, automatic_installation = true,
}) })
+62 -18
View File
@@ -80,7 +80,7 @@ return {
{ {
"akinsho/toggleterm.nvim", "akinsho/toggleterm.nvim",
cmd = { "ToggleTerm" }, cmd = { "ToggleTerm" },
version = "v2.*", version = "*",
config = function() config = function()
require("toggleterm").setup({ require("toggleterm").setup({
size = 10, size = 10,
@@ -107,6 +107,20 @@ return {
}) })
end, end,
}, },
{
"nvzone/floaterm",
dependencies = "nvzone/volt",
opts = {
mappings = {
term = function(buf)
vim.keymap.set({ "n", "t" }, "<Tab>", function()
require("floaterm.api").cycle_term_bufs("prev")
end, { buffer = buf })
end,
},
},
cmd = "FloatermToggle",
},
-- smooth scrolling -- smooth scrolling
{ {
@@ -120,23 +134,6 @@ return {
-- event = "VeryLazy", -- event = "VeryLazy",
-- }, -- },
{
"rachartier/tiny-code-action.nvim",
dependencies = {
{
"folke/snacks.nvim",
opts = {
terminal = {},
},
},
},
event = "LspAttach",
opts = {},
vim.keymap.set({ "n", "x" }, "<leader>ca", function()
require("tiny-code-action").code_action()
end, { noremap = true, silent = true }),
},
-- uv -- uv
{ {
"benomahony/uv.nvim", "benomahony/uv.nvim",
@@ -160,10 +157,57 @@ return {
}, },
}, },
-- Project management
{
"ahmedkhalf/project.nvim",
config = function()
require("project_nvim").setup({
detection_methods = { "lsp", "pattern" },
patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json" },
})
end,
},
{ "wakatime/vim-wakatime", event = "VimEnter", lazy = false }, { "wakatime/vim-wakatime", event = "VimEnter", lazy = false },
-- { -- {
-- "m4xshen/hardtime.nvim", -- "m4xshen/hardtime.nvim",
-- lazy = false, -- lazy = false,
-- opts = {}, -- opts = {},
-- }, -- },
-- file operations
{
"chrisgrieser/nvim-genghis",
keys = {
{
"<leader>fp",
function()
require("genghis").createNewFile()
end,
desc = "New File",
},
{
"<leader>fd",
function()
require("genghis").duplicateFile()
end,
desc = "Duplicate File",
},
{
"<leader>fr",
function()
require("genghis").renameFile()
end,
desc = "Rename File",
},
{
"<leader>fx",
function()
require("genghis").chmodx()
end,
desc = "Make Executable",
},
},
},
} }
+28
View File
@@ -79,6 +79,20 @@ return {
{ "<leader>fx", ":%bd|e#|bd#<cr>", desc = "Close except current" }, { "<leader>fx", ":%bd|e#|bd#<cr>", desc = "Close except current" },
{ "<leader>ff", ":lua require('snacks').picker.files()", desc = "Find Files" }, { "<leader>ff", ":lua require('snacks').picker.files()", desc = "Find Files" },
{ "<leader>fg", ":lua require('snacks').picker.live_grep()", desc = "Live Grep" }, { "<leader>fg", ":lua require('snacks').picker.live_grep()", desc = "Live Grep" },
{
"<leader>fp",
function()
Snacks.picker.projects()
end,
desc = "Projects",
},
{
"<leader>ft",
function()
Snacks.picker.todo_comments()
end,
desc = "Search Todos",
},
{ "<leader>g", group = " Git" }, { "<leader>g", group = " Git" },
{ "<leader>gA", ":Gitsigns stage_buffer<cr>", desc = "Stage Buffer" }, { "<leader>gA", ":Gitsigns stage_buffer<cr>", desc = "Stage Buffer" },
@@ -91,7 +105,21 @@ return {
{ "<leader>gi", ":Gitsigns preview_hunk<cr>", desc = "Hunk Info" }, { "<leader>gi", ":Gitsigns preview_hunk<cr>", desc = "Hunk Info" },
{ "<leader>gj", ":Gitsigns next_hunk<cr>", desc = "Next Hunk" }, { "<leader>gj", ":Gitsigns next_hunk<cr>", desc = "Next Hunk" },
{ "<leader>gk", ":Gitsigns prev_hunk<cr>", desc = "Prev Hunk" }, { "<leader>gk", ":Gitsigns prev_hunk<cr>", desc = "Prev Hunk" },
{
"<leader>gl",
function()
Snacks.picker.git_log()
end,
desc = "Checkout commit",
},
{ "<leader>gr", ":Gitsigns reset_hunk<cr>", desc = "Reset Hunk" }, { "<leader>gr", ":Gitsigns reset_hunk<cr>", desc = "Reset Hunk" },
{
"<leader>gs",
function()
Snacks.picker.git_status()
end,
desc = "Open changed file",
},
{ "<leader>gu", ":Gitsigns undo_stage_hunk<cr>", desc = "Undo Stage Hunk" }, { "<leader>gu", ":Gitsigns undo_stage_hunk<cr>", desc = "Undo Stage Hunk" },
{ "<leader>gv", ":Gitsigns select_hunk<cr>", desc = "Select Hunk" }, { "<leader>gv", ":Gitsigns select_hunk<cr>", desc = "Select Hunk" },
{ "<leader>gw", ':lua require("snacks").gitbrowse()<cr>', desc = "Git Browse" }, { "<leader>gw", ':lua require("snacks").gitbrowse()<cr>', desc = "Git Browse" },