From 08bda86dbb0f1296ccefa297a9acb35f6aba7cc0 Mon Sep 17 00:00:00 2001 From: Pratik Tripathy Date: Sat, 28 Dec 2024 16:54:52 +0530 Subject: [PATCH] chore: README formatting & nvim keymap changes --- README.md | 14 +++++++------- common/.config/nvim/lua/plugins/code-git.lua | 14 ++++++-------- common/.config/nvim/lua/plugins/navigate-files.lua | 3 +-- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 339b3e4..6a45c78 100755 --- a/README.md +++ b/README.md @@ -39,16 +39,16 @@ Any package not available are *skipped*. - aka, pending installations that I gave up automating. - All Distros: - - Appimagelauncher: https://github.com/TheAssassin/AppImageLauncher/releases - - Zoho Mail: https://downloads.zohocdn.com/zmail-desktop/linux/ - - Zoho Workdrive: https://www.zoho.com/workdrive/desktop-sync.html - - Jetbrains-Toolbox: https://www.jetbrains.com/toolbox-app/ - - Sublime-Text: https://www.sublimetext.com/docs/linux_repositories.html + - Appimagelauncher: + - Zoho Mail: + - Zoho Workdrive: + - Jetbrains-Toolbox: + - Sublime-Text: - Debian & Ubuntu: - Add non-free and backport sources, then run the `install-os-packges.sh` again - - Ulauncher: https://ulauncher.io/#Download + - Ulauncher: - Debian: - - Dotnet8: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install + - Dotnet8: ## Test diff --git a/common/.config/nvim/lua/plugins/code-git.lua b/common/.config/nvim/lua/plugins/code-git.lua index 7bd1e58..e025c79 100644 --- a/common/.config/nvim/lua/plugins/code-git.lua +++ b/common/.config/nvim/lua/plugins/code-git.lua @@ -45,6 +45,8 @@ return { on_attach = function(bufnr) local gs = package.loaded.gitsigns + gs.toggle_current_line_blame() -- git blame line + local function map(mode, l, r, opts) opts = opts or {} opts.buffer = bufnr @@ -72,6 +74,9 @@ return { return "" end, { expr = true, desc = "Previous Git hunk" }) + -- Text object + map({ "o", "x" }, "ih", ":Gitsigns select_hunk", { desc = "Git: Visual select hunk" }) + -- Staging -- Actions map("n", "gr", gs.reset_hunk, { desc = "Git: reset hunk" }) @@ -86,19 +91,12 @@ return { map("v", "gsH", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end, { desc = "Git: Visual Stage Hunk" }) - map("v", "gsR", function() - gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, { desc = "Git: Visual Reset Hunk" }) -- normal mode map("n", "gp", gs.preview_hunk, { desc = "Git: Preview hunk" }) -- Toggles - map("n", "gtb", gs.toggle_current_line_blame, { desc = "Git: toggle blame line" }) - map("n", "gtd", gs.toggle_deleted, { desc = "Git: toggle show deleted" }) - - -- Text object - map({ "o", "x" }, "ih", ":Gitsigns select_hunk", { desc = "Git: Visual select hunk" }) + map("n", "gB", gs.toggle_current_line_blame, { desc = "Git: Toggle blame-line" }) end, }, }, diff --git a/common/.config/nvim/lua/plugins/navigate-files.lua b/common/.config/nvim/lua/plugins/navigate-files.lua index 7948ea3..fd2fa2f 100644 --- a/common/.config/nvim/lua/plugins/navigate-files.lua +++ b/common/.config/nvim/lua/plugins/navigate-files.lua @@ -186,10 +186,9 @@ return { -- Neovim Things vim.keymap.set("n", "ns", require("telescope.builtin").search_history, { desc = "Search History" }) - vim.keymap.set("n", "nn", require("telescope.builtin").help_tags, { desc = "Search NeoVIM Help" }) + vim.keymap.set("n", "nh", require("telescope.builtin").help_tags, { desc = "Search NeoVIM Help" }) vim.keymap.set("n", "nc", require("telescope.builtin").command_history, { desc = "Command History" }) vim.keymap.set("n", "nC", require("telescope.builtin").colorscheme, { desc = "Colorschemes (with preview)" }) - vim.keymap.set("n", "nn", "Telescope notify", { desc = "Past notifications" }) -- Help vim.keymap.set("n", "hk", require("telescope.builtin").keymaps, { desc = "Help: NeoVIM Keymaps" })