🪄 Substitution/Navigation
- Faster/smarter plugin loading - Substitution motions with the 'x' and 'X' keys - Fold navigation with Ctrl+hjkl - Various small tweaks for usability
This commit is contained in:
+31
-2
@@ -5,9 +5,8 @@
|
|||||||
-- -------------------------------- Commands -----------------------------------
|
-- -------------------------------- Commands -----------------------------------
|
||||||
-- Make :Q close all of the buffers
|
-- Make :Q close all of the buffers
|
||||||
vim.api.nvim_create_user_command("Q", function()
|
vim.api.nvim_create_user_command("Q", function()
|
||||||
vim.cmd.bdelete()
|
|
||||||
vim.cmd.qall()
|
vim.cmd.qall()
|
||||||
end, { force = true })
|
end, { force = true, desc = "Close all buffers" })
|
||||||
|
|
||||||
-- Yank line without leading/trailing whitespace
|
-- Yank line without leading/trailing whitespace
|
||||||
vim.api.nvim_create_user_command("YankLine", function()
|
vim.api.nvim_create_user_command("YankLine", function()
|
||||||
@@ -22,6 +21,12 @@ vim.api.nvim_create_user_command("RestoreColorscheme", function()
|
|||||||
)
|
)
|
||||||
end, { force = true })
|
end, { force = true })
|
||||||
|
|
||||||
|
-- Load/start Remote
|
||||||
|
vim.api.nvim_create_user_command("LoadRemote", function()
|
||||||
|
require("remote-nvim").setup()
|
||||||
|
vim.cmd("RemoteStart")
|
||||||
|
end, { force = true, desc = "Load/start Remote" })
|
||||||
|
|
||||||
-- ------------------------------ Auto-Commands --------------------------------
|
-- ------------------------------ Auto-Commands --------------------------------
|
||||||
-- Autosave Colorscheme
|
-- Autosave Colorscheme
|
||||||
-- When the colorscheme changes, store the name in .colorscheme
|
-- When the colorscheme changes, store the name in .colorscheme
|
||||||
@@ -36,6 +41,30 @@ vim.api.nvim_create_autocmd("ColorScheme", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Define cursor color/icon based on mode
|
||||||
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
autocmd({ "ModeChanged", "BufEnter" }, {
|
||||||
|
callback = function()
|
||||||
|
local current_mode = vim.fn.mode()
|
||||||
|
if current_mode == "n" then
|
||||||
|
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#8aa8f3" })
|
||||||
|
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||||
|
elseif current_mode == "v" then
|
||||||
|
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#d298eb" })
|
||||||
|
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||||
|
elseif current_mode == "V" then
|
||||||
|
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#d298eb" })
|
||||||
|
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||||
|
elseif current_mode == "�" then
|
||||||
|
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#bf616a" })
|
||||||
|
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||||
|
elseif current_mode == "i" then
|
||||||
|
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#9bd482" })
|
||||||
|
vim.fn.sign_define("smoothcursor", { text = "" })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- GIT CONFLICT MARKERS
|
-- GIT CONFLICT MARKERS
|
||||||
-- if there are conflicts, jump to first conflict, highlight conflict markers,
|
-- if there are conflicts, jump to first conflict, highlight conflict markers,
|
||||||
-- and disable diagnostics (simplified version of `git-conflict.nvim`)
|
-- and disable diagnostics (simplified version of `git-conflict.nvim`)
|
||||||
|
|||||||
+20
-2
@@ -45,7 +45,9 @@ wk.add({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>gS",
|
"<leader>gS",
|
||||||
"<cmd>LazyGit<cr>",
|
rhs = function()
|
||||||
|
require("lazygit").lazygit()
|
||||||
|
end,
|
||||||
desc = "LazyGit",
|
desc = "LazyGit",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -196,7 +198,9 @@ wk.add({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"<leader>wt",
|
"<leader>wt",
|
||||||
"<cmd>TransparentToggle<cr>",
|
rhs = function()
|
||||||
|
require("transparent").toggle()
|
||||||
|
end,
|
||||||
desc = "Toggle Transparency",
|
desc = "Toggle Transparency",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -220,7 +224,21 @@ wk.add({
|
|||||||
end,
|
end,
|
||||||
desc = "Toggle Hardmode",
|
desc = "Toggle Hardmode",
|
||||||
},
|
},
|
||||||
|
{ -- Toggle ZenMode
|
||||||
|
"<leader>z",
|
||||||
|
rhs = function()
|
||||||
|
require("zen-mode").toggle()
|
||||||
|
end,
|
||||||
|
desc = "Toggle ZenMode",
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Substitute
|
||||||
|
-- Define substitue mappings
|
||||||
|
vim.keymap.set("n", "x", require("substitute").operator, { noremap = true })
|
||||||
|
vim.keymap.set("n", "xx", require("substitute").line, { noremap = true })
|
||||||
|
vim.keymap.set("n", "X", require("substitute").eol, { noremap = true })
|
||||||
|
vim.keymap.set("x", "x", require("substitute").visual, { noremap = true })
|
||||||
|
|
||||||
-- ---------------------------- Spell Correction -------------------------------
|
-- ---------------------------- Spell Correction -------------------------------
|
||||||
require("config.spellcheck")
|
require("config.spellcheck")
|
||||||
|
|||||||
@@ -18,6 +18,11 @@ STORED_THEME = vim.fn.readfile(vim.fn.stdpath("config") .. "/.colorscheme")[1]
|
|||||||
vim.g.loaded_perl_provider = 0
|
vim.g.loaded_perl_provider = 0
|
||||||
vim.g.lazyvim_python_lsp = "basedpyright"
|
vim.g.lazyvim_python_lsp = "basedpyright"
|
||||||
|
|
||||||
|
-- ----------------------------------- FOLDS --------------------------------------
|
||||||
|
vim.opt.foldmethod = "expr"
|
||||||
|
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||||
|
vim.opt.foldlevelstart = 99 -- load buffers with folds open
|
||||||
|
|
||||||
-- ------------------------------- CLIENT APPS ---------------------------------
|
-- ------------------------------- CLIENT APPS ---------------------------------
|
||||||
if vim.g.neovide then
|
if vim.g.neovide then
|
||||||
-- ----------------------- Neovide -------------------------
|
-- ----------------------- Neovide -------------------------
|
||||||
|
|||||||
+1
-5
@@ -11,7 +11,7 @@ return {
|
|||||||
},
|
},
|
||||||
{ -- Transparent
|
{ -- Transparent
|
||||||
"xiyaowong/transparent.nvim",
|
"xiyaowong/transparent.nvim",
|
||||||
event = "VeryLazy",
|
lazy = true,
|
||||||
config = true,
|
config = true,
|
||||||
},
|
},
|
||||||
{ -- Auto Dark Mode
|
{ -- Auto Dark Mode
|
||||||
@@ -117,8 +117,4 @@ return {
|
|||||||
require("hlchunk").setup(common_config)
|
require("hlchunk").setup(common_config)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ -- Alternate
|
|
||||||
"ton/vim-alternate",
|
|
||||||
event = "VeryLazy",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,11 @@ return {
|
|||||||
require("mini.align").setup()
|
require("mini.align").setup()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ -- Emoji completion
|
{ -- Alternate
|
||||||
|
"ton/vim-alternate",
|
||||||
|
ft = { "cpp", "h", "hpp", "c" },
|
||||||
|
},
|
||||||
|
{ -- Completion
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
---@param opts cmp.ConfigSchema
|
---@param opts cmp.ConfigSchema
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
@@ -122,9 +126,6 @@ return {
|
|||||||
opts = {
|
opts = {
|
||||||
yank_substituted_text = false,
|
yank_substituted_text = false,
|
||||||
preserve_cursor_position = true,
|
preserve_cursor_position = true,
|
||||||
highlight_substituted_text = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ return { -- Dashboard
|
|||||||
{ action = "LazyGit", desc = " LazyGit", icon = " ", key = "G" },
|
{ action = "LazyGit", desc = " LazyGit", icon = " ", key = "G" },
|
||||||
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = " ", key = "c" },
|
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = " ", key = "c" },
|
||||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||||
{ action = 'RemoteStart', desc = " Remote Session", icon = " ", key = "S" },
|
{ action = 'LoadRemote', desc = " Remote Session", icon = " ", key = "S" },
|
||||||
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
||||||
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
||||||
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = " ", key = "q" },
|
{ action = function() vim.api.nvim_input("<cmd>qa<cr>") end, desc = " Quit", icon = " ", key = "q" },
|
||||||
|
|||||||
+46
-36
@@ -12,8 +12,15 @@ return {
|
|||||||
{ -- Illuminate
|
{ -- Illuminate
|
||||||
import = "lazyvim.plugins.extras.editor.illuminate",
|
import = "lazyvim.plugins.extras.editor.illuminate",
|
||||||
},
|
},
|
||||||
{ -- Leap
|
{
|
||||||
import = "lazyvim.plugins.extras.editor.leap",
|
"folke/flash.nvim",
|
||||||
|
opts = {
|
||||||
|
modes = {
|
||||||
|
char = {
|
||||||
|
jump_labels = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{ -- Outline
|
{ -- Outline
|
||||||
import = "lazyvim.plugins.extras.editor.outline",
|
import = "lazyvim.plugins.extras.editor.outline",
|
||||||
@@ -21,6 +28,35 @@ return {
|
|||||||
{ -- Telescope
|
{ -- Telescope
|
||||||
import = "lazyvim.plugins.extras.editor.telescope",
|
import = "lazyvim.plugins.extras.editor.telescope",
|
||||||
},
|
},
|
||||||
|
{ -- FoldNav
|
||||||
|
"domharries/foldnav.nvim",
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<C-h>",
|
||||||
|
function()
|
||||||
|
require("foldnav").goto_start()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<C-j>",
|
||||||
|
function()
|
||||||
|
require("foldnav").goto_next()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<C-k>",
|
||||||
|
function()
|
||||||
|
require("foldnav").goto_prev_start()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<C-l>",
|
||||||
|
function()
|
||||||
|
require("foldnav").goto_end()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{ -- Which-Key
|
{ -- Which-Key
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
@@ -69,7 +105,7 @@ return {
|
|||||||
},
|
},
|
||||||
{ -- Remote-nvim
|
{ -- Remote-nvim
|
||||||
"amitds1997/remote-nvim.nvim",
|
"amitds1997/remote-nvim.nvim",
|
||||||
event = "VeryLazy",
|
lazy = true,
|
||||||
version = "*", -- Pin to GitHub releases
|
version = "*", -- Pin to GitHub releases
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim", -- For standard functions
|
"nvim-lua/plenary.nvim", -- For standard functions
|
||||||
@@ -80,7 +116,7 @@ return {
|
|||||||
},
|
},
|
||||||
{ -- DeadColumn
|
{ -- DeadColumn
|
||||||
"Bekaboo/deadcolumn.nvim",
|
"Bekaboo/deadcolumn.nvim",
|
||||||
event = "VeryLazy",
|
event = "InsertEnter",
|
||||||
config = function()
|
config = function()
|
||||||
require("deadcolumn").setup({
|
require("deadcolumn").setup({
|
||||||
scope = "line", ---@type string|fun(): integer
|
scope = "line", ---@type string|fun(): integer
|
||||||
@@ -109,11 +145,13 @@ return {
|
|||||||
},
|
},
|
||||||
{ -- Precognition
|
{ -- Precognition
|
||||||
"tris203/precognition.nvim",
|
"tris203/precognition.nvim",
|
||||||
event = "VeryLazy",
|
lazy = true,
|
||||||
|
opts = {},
|
||||||
},
|
},
|
||||||
{ -- Zen Mode
|
{ -- Zen Mode
|
||||||
"folke/zen-mode.nvim",
|
"folke/zen-mode.nvim",
|
||||||
event = "VeryLazy",
|
--event = "VeryLazy",
|
||||||
|
lazy = true,
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
{ -- SmoothCursor
|
{ -- SmoothCursor
|
||||||
@@ -127,7 +165,7 @@ return {
|
|||||||
texthl = "SmoothCursor",
|
texthl = "SmoothCursor",
|
||||||
fancy = {
|
fancy = {
|
||||||
enable = true, -- enable fancy mode
|
enable = true, -- enable fancy mode
|
||||||
head = { cursor = "", texthl = nil, linehl = nil },
|
head = { cursor = "" },
|
||||||
body = {},
|
body = {},
|
||||||
tail = { false }, -- false to disable fancy tail
|
tail = { false }, -- false to disable fancy tail
|
||||||
},
|
},
|
||||||
@@ -137,7 +175,6 @@ return {
|
|||||||
texthl = {
|
texthl = {
|
||||||
"SmoothCursor",
|
"SmoothCursor",
|
||||||
},
|
},
|
||||||
linehl = nil, -- No line highlight for the head
|
|
||||||
},
|
},
|
||||||
body = {
|
body = {
|
||||||
length = 6, -- Specifies the length of the cursor body
|
length = 6, -- Specifies the length of the cursor body
|
||||||
@@ -147,7 +184,6 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
tail = {
|
tail = {
|
||||||
cursor = nil,
|
|
||||||
texthl = {
|
texthl = {
|
||||||
"SmoothCursor",
|
"SmoothCursor",
|
||||||
},
|
},
|
||||||
@@ -156,7 +192,7 @@ return {
|
|||||||
},
|
},
|
||||||
autostart = true, -- Automatically start SmoothCursor
|
autostart = true, -- Automatically start SmoothCursor
|
||||||
always_redraw = true, -- Redraw the screen on each update
|
always_redraw = true, -- Redraw the screen on each update
|
||||||
flyin_effect = nil, -- Choose "bottom" or "top" for flying effect
|
flyin_effect = "bottom", -- Choose "bottom" or "top" for flying effect
|
||||||
speed = 25, -- Max speed is 100 to stick with your current position
|
speed = 25, -- Max speed is 100 to stick with your current position
|
||||||
intervals = 35, -- Update intervals in milliseconds
|
intervals = 35, -- Update intervals in milliseconds
|
||||||
priority = 10, -- Set marker priority
|
priority = 10, -- Set marker priority
|
||||||
@@ -164,32 +200,6 @@ return {
|
|||||||
threshold = 3, -- Animate only if cursor moves more than this many lines
|
threshold = 3, -- Animate only if cursor moves more than this many lines
|
||||||
max_threshold = 2000, -- If you move more than this many lines, don't animate (if `nil`, deactivate check)
|
max_threshold = 2000, -- If you move more than this many lines, don't animate (if `nil`, deactivate check)
|
||||||
disable_float_win = false, -- Disable in floating windows
|
disable_float_win = false, -- Disable in floating windows
|
||||||
enabled_filetypes = nil, -- Enable only for specific file types, e.g., { "lua", "vim" }
|
|
||||||
disabled_filetypes = nil, -- Disable for these file types
|
|
||||||
show_last_positions = nil,
|
|
||||||
})
|
|
||||||
-- Define cursor color/icon based on mode
|
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
|
||||||
autocmd({ "ModeChanged", "BufEnter" }, {
|
|
||||||
callback = function()
|
|
||||||
local current_mode = vim.fn.mode()
|
|
||||||
if current_mode == "n" then
|
|
||||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#8aa8f3" })
|
|
||||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
|
||||||
elseif current_mode == "v" then
|
|
||||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#d298eb" })
|
|
||||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
|
||||||
elseif current_mode == "V" then
|
|
||||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#d298eb" })
|
|
||||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
|
||||||
elseif current_mode == "�" then
|
|
||||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#bf616a" })
|
|
||||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
|
||||||
elseif current_mode == "i" then
|
|
||||||
vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#9bd482" })
|
|
||||||
vim.fn.sign_define("smoothcursor", { text = "" })
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
})
|
||||||
-- Define last cursor position icon
|
-- Define last cursor position icon
|
||||||
vim.fn.sign_define("smoothcursor_n", { text = "" })
|
vim.fn.sign_define("smoothcursor_n", { text = "" })
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ return {
|
|||||||
},
|
},
|
||||||
{ -- Link following
|
{ -- Link following
|
||||||
"chrishrb/gx.nvim",
|
"chrishrb/gx.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
cmd = { "Browse" },
|
cmd = { "Browse" },
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.netrw_nogx = 1
|
vim.g.netrw_nogx = 1
|
||||||
@@ -41,21 +42,23 @@ return {
|
|||||||
},
|
},
|
||||||
{ -- Auto-save
|
{ -- Auto-save
|
||||||
"Pocco81/auto-save.nvim",
|
"Pocco81/auto-save.nvim",
|
||||||
|
event = "InsertEnter",
|
||||||
config = function()
|
config = function()
|
||||||
require("auto-save").setup({})
|
require("auto-save").setup({})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ -- User is bored
|
{ -- User is bored
|
||||||
"mikesmithgh/ugbi",
|
"mikesmithgh/ugbi",
|
||||||
event = "VeryLazy",
|
event = "InsertEnter",
|
||||||
},
|
},
|
||||||
{ -- Ripgrep substitute
|
{ -- Ripgrep substitute
|
||||||
"chrisgrieser/nvim-rip-substitute",
|
"chrisgrieser/nvim-rip-substitute",
|
||||||
|
event = "InsertEnter",
|
||||||
cmd = "RipSubstitute",
|
cmd = "RipSubstitute",
|
||||||
},
|
},
|
||||||
{ -- Gist Tools
|
{ -- Gist Tools
|
||||||
"Rawnly/gist.nvim",
|
"Rawnly/gist.nvim",
|
||||||
event = "VeryLazy",
|
event = "InsertEnter",
|
||||||
cmd = { "GistCreate", "GistCreateFromFile", "GistsList" },
|
cmd = { "GistCreate", "GistCreateFromFile", "GistsList" },
|
||||||
config = true,
|
config = true,
|
||||||
},
|
},
|
||||||
@@ -114,6 +117,7 @@ return {
|
|||||||
},
|
},
|
||||||
{ -- Thanks/github-stars
|
{ -- Thanks/github-stars
|
||||||
"jsongerber/thanks.nvim",
|
"jsongerber/thanks.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
config = {
|
config = {
|
||||||
star_on_install = false,
|
star_on_install = false,
|
||||||
},
|
},
|
||||||
@@ -134,6 +138,7 @@ return {
|
|||||||
},
|
},
|
||||||
{ -- GitLinker
|
{ -- GitLinker
|
||||||
"linrongbin16/gitlinker.nvim",
|
"linrongbin16/gitlinker.nvim",
|
||||||
|
lazy = true,
|
||||||
cmd = "GitLink",
|
cmd = "GitLink",
|
||||||
opts = {},
|
opts = {},
|
||||||
keys = {
|
keys = {
|
||||||
|
|||||||
Reference in New Issue
Block a user