1
0
mirror of https://github.com/pratiktri/dotfiles.git synced 2026-05-07 03:53:41 +05:30

Compare commits

..

6 Commits

Author SHA1 Message Date
Pratik Tripathy 87169ab4ed chore(neovim): neogit: Add process_spinner & use log graph_style 2026-04-21 15:49:19 +05:30
Pratik Tripathy 288a93e253 fix(neovim): Use default keymaps for incremental selection
- Remove `mini.ai`: conflicts with `an`, `in` incremental selection defaults
- Remove old keymaps
2026-04-21 15:11:18 +05:30
Pratik Tripathy 7828f4de3f chore(vscode): Update plugins 2026-04-21 11:54:55 +05:30
Pratik Tripathy 8fb3f6ea0b chore(nvim): Disable Ctrl+p to paste in edit mode
- `Ctrl+p` always gets accidentally pressed when trying to escape with
  `Ctrl+[` - disable it
2026-04-21 11:53:30 +05:30
Pratik Tripathy f1129233d1 fix(neovim): Update nvim-treesitter-textobjects to new format
- Older config doesn't work with `main` branch
- Update: Use vim.keymap to perform the moves
- Fix: select > as > query => `@local.scope`
2026-04-21 11:51:05 +05:30
Pratik Tripathy f33504b9c4 feat(yamllint): Add global yamllint config 2026-04-17 22:53:15 +05:30
6 changed files with 68 additions and 44 deletions
@@ -9,6 +9,8 @@ vim.keymap.set({ "n" }, "<C-,>", "<cmd>edit " .. vim.fn.expand(vim.fn.stdpath("c
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y', { desc = "Copy to system clipboard" }) vim.keymap.set({ "n", "v" }, "<leader>y", '"+y', { desc = "Copy to system clipboard" })
vim.keymap.set({ "n", "v" }, "<leader>p", '"+p', { desc = "Paste from system clipboard" }) vim.keymap.set({ "n", "v" }, "<leader>p", '"+p', { desc = "Paste from system clipboard" })
-- Disable [Ctrl + p] to paste in edit mode; avoids accidentally pressing `p` when actually doing `Ctrl + [`
vim.keymap.set("i", "<C-p>", "<Nop>", { noremap = true, silent = true })
-- Remap for dealing with word wrap -- Remap for dealing with word wrap
vim.keymap.set({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) vim.keymap.set({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
@@ -285,18 +285,18 @@ return {
}) })
-- Incremental selection is NATIVE in 0.12 (no plugin config) -- Incremental selection is NATIVE in 0.12 (no plugin config)
-- 0.12 defaults: gnn (init), grn (expand node), grm (shrink), grc (scope) -- 0.12 defaults:
-- Remap to your existing keys: -- v:
vim.keymap.set("n", "<C-space>", "gnn", { remap = true, desc = "Init treesitter selection" }) -- an (expand out)
vim.keymap.set("x", "<C-CR>", "grc", { remap = true, desc = "Expand scope selection" }) -- in (shrink in)
vim.keymap.set("x", "<bs>", "grm", { remap = true, desc = "Shrink node selection" }) -- ]n (next sibling)
-- [n (previous sibling)
end, end,
}, },
{ {
"nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/nvim-treesitter-textobjects",
branch = "main", branch = "main",
dependencies = { "nvim-treesitter/nvim-treesitter" },
config = function() config = function()
require("nvim-treesitter-textobjects").setup({ require("nvim-treesitter-textobjects").setup({
select = { select = {
@@ -311,38 +311,59 @@ return {
["ic"] = { query = "@class.inner", desc = "Select inside of the class" }, ["ic"] = { query = "@class.inner", desc = "Select inside of the class" },
["al"] = { query = "@loop.outer", desc = "Select around the loop" }, ["al"] = { query = "@loop.outer", desc = "Select around the loop" },
["il"] = { query = "@loop.inner", desc = "Select inside of the loop" }, ["il"] = { query = "@loop.inner", desc = "Select inside of the loop" },
["as"] = { query = "@scope", query_group = "locals", desc = "Select around the scope" }, ["as"] = { query = "@local.scope", query_group = "locals", desc = "Select around the scope" },
}, },
}, },
move = { move = {
enable = true, set_jumps = true,
goto_next_start = {
["]f"] = { query = "@function.outer", desc = "Goto next function start" },
["]o"] = { query = "@loop.*", desc = "Goto next loop start" },
["]a"] = { query = "@parameter.inner", desc = "Goto next parameter" },
},
goto_next_end = {
["]F"] = { query = "@function.outer", desc = "Goto next function end" },
["]C"] = { query = "@class.outer", desc = "Goto next class end" },
["]O"] = { query = "@loop.*", desc = "Goto next loop end" },
},
goto_previous_start = {
["[f"] = { query = "@function.outer", desc = "Goto previous function start" },
["[o"] = { query = "@loop.*", desc = "Goto previous loop start" },
["[a"] = { query = "@parameter.inner", desc = "Goto previous parameter" },
},
goto_previous_end = {
["[F"] = { query = "@function.outer", desc = "Goto previous function end" },
["[C"] = { query = "@class.outer", desc = "Goto previous class end" },
["[O"] = { query = "@loop.*", desc = "Goto previous loop end" },
},
},
lsp_interop = {
enable = true,
border = "none",
floating_preview_opts = {},
}, },
}) })
local move = require("nvim-treesitter-textobjects.move")
-- goto_next_start
vim.keymap.set({ "n", "x", "o" }, "]f", function()
move.goto_next_start("@function.outer", "textobjects")
end, { desc = "Goto next function start" })
vim.keymap.set({ "n", "x", "o" }, "]o", function()
move.goto_next_start({ "@loop.inner", "@loop.outer" }, "textobjects")
end, { desc = "Goto next loop start" })
vim.keymap.set({ "n", "x", "o" }, "]a", function()
move.goto_next_start("@parameter.inner", "textobjects")
end, { desc = "Goto next parameter" })
-- goto_next_end
vim.keymap.set({ "n", "x", "o" }, "]F", function()
move.goto_next_end("@function.outer", "textobjects")
end, { desc = "Goto next function end" })
vim.keymap.set({ "n", "x", "o" }, "]C", function()
move.goto_next_end("@class.outer", "textobjects")
end, { desc = "Goto next class end" })
vim.keymap.set({ "n", "x", "o" }, "]O", function()
move.goto_next_end({ "@loop.inner", "@loop.outer" }, "textobjects")
end, { desc = "Goto next loop end" })
-- goto_previous_start
vim.keymap.set({ "n", "x", "o" }, "[f", function()
move.goto_previous_start("@function.outer", "textobjects")
end, { desc = "Goto previous function start" })
vim.keymap.set({ "n", "x", "o" }, "[o", function()
move.goto_previous_start({ "@loop.inner", "@loop.outer" }, "textobjects")
end, { desc = "Goto previous loop start" })
vim.keymap.set({ "n", "x", "o" }, "[a", function()
move.goto_previous_start("@parameter.inner", "textobjects")
end, { desc = "Goto previous parameter" })
-- goto_previous_end
vim.keymap.set({ "n", "x", "o" }, "[F", function()
move.goto_previous_end("@function.outer", "textobjects")
end, { desc = "Goto previous function end" })
vim.keymap.set({ "n", "x", "o" }, "[C", function()
move.goto_previous_end("@class.outer", "textobjects")
end, { desc = "Goto previous class end" })
vim.keymap.set({ "n", "x", "o" }, "[O", function()
move.goto_previous_end({ "@loop.inner", "@loop.outer" }, "textobjects")
end, { desc = "Goto previous loop end" })
end, end,
}, },
} }
+8 -9
View File
@@ -7,20 +7,19 @@ return {
"sindrets/diffview.nvim", "sindrets/diffview.nvim",
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
}, },
config = true, config = function()
local neogit = require("neogit")
neogit.setup({
graph_style = "kitty",
process_spinner = true,
})
end,
keys = { keys = {
{ "<leader>gg", "<cmd>Neogit<cr>", desc = "Git: Open Neogit", mode = { "n" } }, { "<leader>gg", "<cmd>Neogit<cr>", desc = "Git: Open Neogit", mode = { "n" } },
}, },
}, },
-- Git Diffview
{
"sindrets/diffview.nvim",
keys = {
{ "<leader>gD", "<cmd>DiffviewOpen<cr>", desc = "Git: Diffview Project against index/staging", mode = { "n" } },
},
},
-- Adds git related signs to the gutter, as well as utilities for managing changes -- Adds git related signs to the gutter, as well as utilities for managing changes
{ {
"lewis6991/gitsigns.nvim", "lewis6991/gitsigns.nvim",
@@ -7,7 +7,6 @@ return {
config = function() config = function()
require("mini.comment").setup() require("mini.comment").setup()
require("mini.pairs").setup() require("mini.pairs").setup()
require("mini.ai").setup({ n_lines = 500 })
-- mini.surround -- mini.surround
-- functionality similar to tpope's vim-surround -- functionality similar to tpope's vim-surround
+3
View File
@@ -0,0 +1,3 @@
extends: default
rules:
line-length: disable
File diff suppressed because one or more lines are too long