feat: enhance editor and language support with new plugins and configurations
This commit is contained in:
7 files changed
+315
-151
No files matched your search
@@ -5,6 +5,7 @@
|
||||
"better-escape.nvim": { "branch": "master", "commit": "19a38aab94961016430905ebec30d272a01e9742" },
|
||||
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
||||
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
|
||||
"floaterm": { "branch": "main", "commit": "ae3de018d20dccd9372bbff7137e8a6d6030f69e" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
||||
@@ -27,11 +28,13 @@
|
||||
"neoscroll.nvim": { "branch": "master", "commit": "f957373912e88579e26fdaea4735450ff2ef5c9c" },
|
||||
"netrw.nvim": { "branch": "master", "commit": "90501c62b9b816ed3ed1e912ae9db9af5671a1b2" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
||||
"nvim-genghis": { "branch": "main", "commit": "cdf584d05ffc9d5c1f247079991552249e4f7487" },
|
||||
"nvim-lint": { "branch": "master", "commit": "f126af5345c7472e9a0cdbe1d1a29209be72c4c4" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "c8b90ae5cbe21d547b342b05c9266dcb8ca0de8f" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" },
|
||||
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
|
||||
"smartcolumn.nvim": { "branch": "main", "commit": "b9cdbdf42f7ac5a659204cd5926017c7ff724a19" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
||||
"tiny-code-action.nvim": { "branch": "main", "commit": "2b3fa2fbd25496259eaf50987097982f8ad08d1b" },
|
||||
@@ -39,7 +42,9 @@
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"uv.nvim": { "branch": "main", "commit": "be4a7d47a976249282bb2f71fc773ac2f5325973" },
|
||||
"vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" },
|
||||
"vim-wakatime": { "branch": "master", "commit": "d7973b157a632d1edeff01818f18d67e584eeaff" },
|
||||
"volt": { "branch": "main", "commit": "7b8c5e790120d9f08c8487dcb80692db6d2087a1" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" },
|
||||
"windsurf.vim": { "branch": "main", "commit": "a8d47ec54fe82df920b2545559f767003e8a7f8d" }
|
||||
}
|
||||
+44
-11
@@ -156,15 +156,48 @@ return {
|
||||
end,
|
||||
},
|
||||
|
||||
-- multiple cursor
|
||||
-- {
|
||||
-- "terryma/vim-multiple-cursors",
|
||||
-- config = function()
|
||||
-- vim.g.multi_cursor_use_default_mapping = 0
|
||||
-- vim.g.multi_cursor_next_key = "<A-n>"
|
||||
-- vim.g.multi_cursor_prev_key = "<A-p>"
|
||||
-- vim.g.multi_cursor_skip_key = "<A-x>"
|
||||
-- vim.g.multi_cursor_quit_key = "<leader>mc"
|
||||
-- end,
|
||||
-- },
|
||||
-- code action
|
||||
{
|
||||
"rachartier/tiny-code-action.nvim",
|
||||
dependencies = {
|
||||
{
|
||||
"folke/snacks.nvim",
|
||||
opts = {
|
||||
terminal = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
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
@@ -6,11 +6,38 @@ return {
|
||||
keys = { "<leader>tf" },
|
||||
config = function()
|
||||
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 = {
|
||||
lua = { "stylua" },
|
||||
python = { "black" },
|
||||
["lua"] = { "stylua" },
|
||||
["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" },
|
||||
},
|
||||
options = {
|
||||
stop_after_first = true,
|
||||
},
|
||||
format_after_save = function(bufnr)
|
||||
if not vim.b[bufnr].conform_disable then
|
||||
return {
|
||||
@@ -27,9 +54,11 @@ return {
|
||||
end)
|
||||
require("mason-conform").setup({
|
||||
ensure_installed = {
|
||||
"black",
|
||||
"ruff",
|
||||
"stylua",
|
||||
"prettier",
|
||||
"markdown-toc",
|
||||
"markdownlint-cli2",
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
+121
-108
@@ -1,116 +1,129 @@
|
||||
return {
|
||||
-- treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = function()
|
||||
require("nvim-treesitter").setup({
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"markdown",
|
||||
"python",
|
||||
"java",
|
||||
"cpp",
|
||||
"bash",
|
||||
"lua",
|
||||
"make",
|
||||
"latex",
|
||||
"json",
|
||||
"jsonc",
|
||||
"sql",
|
||||
"yaml",
|
||||
"toml",
|
||||
"javascript",
|
||||
"ts_ls",
|
||||
"gitignore",
|
||||
"go",
|
||||
"rust",
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
"markdown_inline",
|
||||
},
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- treesitter
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = function()
|
||||
require("nvim-treesitter").setup({
|
||||
ensure_installed = {
|
||||
"c",
|
||||
"markdown",
|
||||
"python",
|
||||
"java",
|
||||
"cpp",
|
||||
"bash",
|
||||
"lua",
|
||||
"make",
|
||||
"latex",
|
||||
"json",
|
||||
"jsonc",
|
||||
"sql",
|
||||
"yaml",
|
||||
"toml",
|
||||
"javascript",
|
||||
"ts_ls",
|
||||
"gitignore",
|
||||
"go",
|
||||
"rust",
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
"markdown_inline",
|
||||
},
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- rendering for html, latex, md
|
||||
{
|
||||
"OXY2DEV/markview.nvim",
|
||||
lazy = false,
|
||||
-- to load before treesitter
|
||||
priority = 45,
|
||||
config = function()
|
||||
require("markview").setup({
|
||||
markdown = {
|
||||
code_blocks = { sign = false },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- rendering for html, latex, md
|
||||
{
|
||||
"OXY2DEV/markview.nvim",
|
||||
lazy = false,
|
||||
-- to load before treesitter
|
||||
priority = 45,
|
||||
config = function()
|
||||
require("markview").setup({
|
||||
markdown = {
|
||||
code_blocks = { sign = false },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- markdown preview
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = "markdown",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview" },
|
||||
},
|
||||
-- markdown preview
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = "markdown",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview" },
|
||||
},
|
||||
|
||||
{
|
||||
"danymat/neogen",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
opts = {
|
||||
snippet_engine = "luasnip",
|
||||
languages = {
|
||||
python = {
|
||||
template = {
|
||||
annotation_convention = "google_docstrings",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"danymat/neogen",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
opts = {
|
||||
snippet_engine = "luasnip",
|
||||
languages = {
|
||||
python = {
|
||||
template = {
|
||||
annotation_convention = "google_docstrings",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- auto pairs
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup()
|
||||
-- auto pairs
|
||||
{
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup()
|
||||
|
||||
-- add new rules
|
||||
local pairs = require("nvim-autopairs")
|
||||
local rule = require("nvim-autopairs.rule")
|
||||
local cond = require("nvim-autopairs.conds")
|
||||
pairs.add_rules({
|
||||
rule("$", "$", { "tex", "latex", "plaintex" })
|
||||
-- do not move right when repeat character
|
||||
:with_move(cond.none()),
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- add new rules
|
||||
local pairs = require("nvim-autopairs")
|
||||
local rule = require("nvim-autopairs.rule")
|
||||
local cond = require("nvim-autopairs.conds")
|
||||
pairs.add_rules({
|
||||
rule("$", "$", { "tex", "latex", "plaintex" })
|
||||
-- do not move right when repeat character
|
||||
:with_move(cond.none()),
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
event = "InsertEnter",
|
||||
lazy = true,
|
||||
opts = {
|
||||
enable_close = true,
|
||||
enable_rename = true,
|
||||
enable_close_on_slash = true,
|
||||
},
|
||||
},
|
||||
{
|
||||
"windwp/nvim-ts-autotag",
|
||||
ft = {
|
||||
"html",
|
||||
"xml",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"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
@@ -2,18 +2,29 @@ return {
|
||||
"mfussenegger/nvim-lint",
|
||||
dependencies = { "rshkarin/mason-nvim-lint" },
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>L",
|
||||
mode = { "n" },
|
||||
function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
desc = "Trigger linting for current file",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("lint").linters_by_ft = {
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
typescriptreact = { "eslint_d" },
|
||||
dockerfile = { "hadolint" },
|
||||
markdown = { "write_good", "markdownlint" },
|
||||
text = { "write_good" },
|
||||
sh = { "shellcheck" },
|
||||
yaml = { "actionlint" },
|
||||
python = { "ruff" },
|
||||
["*"] = { "codespell" },
|
||||
["javascript"] = { "eslint_d", "cspell" },
|
||||
["typescript"] = { "eslint_d", "cspell" },
|
||||
["javascriptreact"] = { "eslint_d", "cspell" },
|
||||
["typescriptreact"] = { "eslint_d", "cspell" },
|
||||
["dockerfile"] = { "hadolint" },
|
||||
["markdown"] = { "write_good", "markdownlint" },
|
||||
["text"] = { "write_good" },
|
||||
["sh"] = { "shellcheck" },
|
||||
["yaml"] = { "actionlint" },
|
||||
["python"] = { "ruff" },
|
||||
}
|
||||
require("mason-nvim-lint").setup({
|
||||
ensure_installed = {
|
||||
@@ -25,7 +36,8 @@ return {
|
||||
"actionlint",
|
||||
"djlint",
|
||||
"ruff",
|
||||
"pylint",
|
||||
"codespell",
|
||||
"cspell",
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
+62
-18
@@ -80,7 +80,7 @@ return {
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
cmd = { "ToggleTerm" },
|
||||
version = "v2.*",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("toggleterm").setup({
|
||||
size = 10,
|
||||
@@ -107,6 +107,20 @@ return {
|
||||
})
|
||||
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
|
||||
{
|
||||
@@ -120,23 +134,6 @@ return {
|
||||
-- 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
|
||||
{
|
||||
"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 },
|
||||
|
||||
-- {
|
||||
-- "m4xshen/hardtime.nvim",
|
||||
-- lazy = false,
|
||||
-- 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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -79,6 +79,20 @@ return {
|
||||
{ "<leader>fx", ":%bd|e#|bd#<cr>", desc = "Close except current" },
|
||||
{ "<leader>ff", ":lua require('snacks').picker.files()", desc = "Find Files" },
|
||||
{ "<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>gA", ":Gitsigns stage_buffer<cr>", desc = "Stage Buffer" },
|
||||
@@ -91,7 +105,21 @@ return {
|
||||
{ "<leader>gi", ":Gitsigns preview_hunk<cr>", desc = "Hunk Info" },
|
||||
{ "<leader>gj", ":Gitsigns next_hunk<cr>", desc = "Next 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>gs",
|
||||
function()
|
||||
Snacks.picker.git_status()
|
||||
end,
|
||||
desc = "Open changed file",
|
||||
},
|
||||
{ "<leader>gu", ":Gitsigns undo_stage_hunk<cr>", desc = "Undo Stage Hunk" },
|
||||
{ "<leader>gv", ":Gitsigns select_hunk<cr>", desc = "Select Hunk" },
|
||||
{ "<leader>gw", ':lua require("snacks").gitbrowse()<cr>', desc = "Git Browse" },
|
||||
|
||||
Reference in new issue
Block a user