mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-03-18 07:24:10 +01:00
feat(home/base/tui/editors/neovim): astronvim v4 - leader => Leader
This commit is contained in:
@@ -43,7 +43,7 @@ return {
|
||||
},
|
||||
g = { -- vim.g.<key>
|
||||
-- configure global vim variables (vim.g)
|
||||
-- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup`
|
||||
-- NOTE: `mapLeader` and `maplocalLeader` must be set in the AstroNvim opts or before `lazy.setup`
|
||||
-- This can be found in the `lua/lazy_setup.lua` file
|
||||
},
|
||||
},
|
||||
@@ -73,7 +73,7 @@ return {
|
||||
|
||||
-- second key is the lefthand side of the map
|
||||
-- mappings seen under group name "Buffer"
|
||||
["<leader>bn"] = { "<cmd>tabnew<cr>", desc = "New tab" },
|
||||
["<Leader>bn"] = { "<cmd>tabnew<cr>", desc = "New tab" },
|
||||
-- quick save
|
||||
["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
||||
|
||||
@@ -82,51 +82,51 @@ return {
|
||||
-- 1. If {cmd} is a List it runs directly (no 'shell')
|
||||
-- 2. If {cmd} is a String it runs in the 'shell'
|
||||
-- search and replace globally
|
||||
["<leader>ss"] = { '<cmd>lua require("spectre").toggle()<CR>', desc = "Toggle Spectre" },
|
||||
["<leader>sw"] = {
|
||||
["<Leader>ss"] = { '<cmd>lua require("spectre").toggle()<CR>', desc = "Toggle Spectre" },
|
||||
["<Leader>sw"] = {
|
||||
'<cmd>lua require("spectre").open_visual({select_word=true})<CR>',
|
||||
desc = "Search current word",
|
||||
},
|
||||
["<leader>sp"] = {
|
||||
["<Leader>sp"] = {
|
||||
'<cmd>lua require("spectre").open_file_search({select_word=true})<CR>',
|
||||
desc = "Search on current file",
|
||||
},
|
||||
|
||||
-- refactoring
|
||||
["<leader>ri"] = {
|
||||
["<Leader>ri"] = {
|
||||
function() require("refactoring").refactor "Inline Variable" end,
|
||||
desc = "Inverse of extract variable",
|
||||
},
|
||||
["<leader>rb"] = { function() require("refactoring").refactor "Extract Block" end, desc = "Extract Block" },
|
||||
["<leader>rbf"] = {
|
||||
["<Leader>rb"] = { function() require("refactoring").refactor "Extract Block" end, desc = "Extract Block" },
|
||||
["<Leader>rbf"] = {
|
||||
function() require("refactoring").refactor "Extract Block To File" end,
|
||||
desc = "Extract Block To File",
|
||||
},
|
||||
["<leader>rr"] = {
|
||||
["<Leader>rr"] = {
|
||||
function() require("telescope").extensions.refactoring.refactors() end,
|
||||
desc = "Prompt for a refactor to apply",
|
||||
},
|
||||
["<leader>rp"] = {
|
||||
["<Leader>rp"] = {
|
||||
function() require("refactoring").debug.printf { below = false } end,
|
||||
desc = "Insert print statement to mark the calling of a function",
|
||||
},
|
||||
["<leader>rv"] = {
|
||||
["<Leader>rv"] = {
|
||||
function() require("refactoring").debug.print_var() end,
|
||||
desc = "Insert print statement to print a variable",
|
||||
},
|
||||
["<leader>rc"] = {
|
||||
["<Leader>rc"] = {
|
||||
function() require("refactoring").debug.cleanup {} end,
|
||||
desc = "Cleanup of all generated print statements",
|
||||
},
|
||||
|
||||
-- yank_history
|
||||
["<leader>yh"] = {
|
||||
["<Leader>yh"] = {
|
||||
function() require("telescope").extensions.yank_history.yank_history() end,
|
||||
desc = "Preview Yank History",
|
||||
},
|
||||
|
||||
-- undo history
|
||||
["<leader>uh"] = { "<cmd>Telescope undo<cr>", desc = "Telescope undo" },
|
||||
["<Leader>uh"] = { "<cmd>Telescope undo<cr>", desc = "Telescope undo" },
|
||||
|
||||
-- implementation/definition preview
|
||||
["gpd"] = { "<cmd>lua require('goto-preview').goto_preview_definition()<CR>", desc = "goto_preview_definition" },
|
||||
@@ -148,28 +148,28 @@ return {
|
||||
-- Visual mode
|
||||
v = {
|
||||
-- search and replace globally
|
||||
["<leader>sw"] = { '<esc><cmd>lua require("spectre").open_visual()<CR>', desc = "Search current word" },
|
||||
["<Leader>sw"] = { '<esc><cmd>lua require("spectre").open_visual()<CR>', desc = "Search current word" },
|
||||
},
|
||||
-- visual mode(what's the difference between v and x???)
|
||||
x = {
|
||||
-- refactoring
|
||||
["<leader>ri"] = {
|
||||
["<Leader>ri"] = {
|
||||
function() require("refactoring").refactor "Inline Variable" end,
|
||||
desc = "Inverse of extract variable",
|
||||
},
|
||||
["<leader>re"] = {
|
||||
["<Leader>re"] = {
|
||||
function() require("refactoring").refactor "Extract Function" end,
|
||||
desc = "Extracts the selected code to a separate function",
|
||||
},
|
||||
["<leader>rf"] = {
|
||||
["<Leader>rf"] = {
|
||||
function() require("refactoring").refactor "Extract Function To File" end,
|
||||
desc = "Extract Function To File",
|
||||
},
|
||||
["<leader>rv"] = {
|
||||
["<Leader>rv"] = {
|
||||
function() require("refactoring").refactor "Extract Variable" end,
|
||||
desc = "Extracts occurrences of a selected expression to its own variable",
|
||||
},
|
||||
["<leader>rr"] = {
|
||||
["<Leader>rr"] = {
|
||||
function() require("telescope").extensions.refactoring.refactors() end,
|
||||
desc = "Prompt for a refactor to apply",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user