diff --git a/lazy-lock.json b/lazy-lock.json index 8dc717f..8aedb47 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -24,7 +24,7 @@ "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, "mini.comment": { "branch": "main", "commit": "a0c721115faff8d05505c0a12dab410084d9e536" }, "mini.files": { "branch": "main", "commit": "fafacfecdd6c5a66bb10d173a749f3c098e84498" }, - "mini.nvim": { "branch": "main", "commit": "8c40d95931cbe6138391af9180e59439ed2e69df" }, + "mini.nvim": { "branch": "main", "commit": "e5a9a3830f9c37211df4c82cac45bf728b95739d" }, "mini.splitjoin": { "branch": "main", "commit": "9fcd8856efb95a505090c3225726466494076127" }, "mini.surround": { "branch": "main", "commit": "d648a5601e1c48f175b07d10eba141da338a0a2a" }, "mini.trailspace": { "branch": "main", "commit": "f8083ca969e1b2098480c10f3c3c4d2ce3586680" }, diff --git a/lua/themenacesauce/core/keymaps.lua b/lua/themenacesauce/core/keymaps.lua index cf74fa3..f4a6a0e 100644 --- a/lua/themenacesauce/core/keymaps.lua +++ b/lua/themenacesauce/core/keymaps.lua @@ -3,16 +3,66 @@ local opts = { noremap = true, silent = true } vim.g.mapleader = " " vim.g.maplocalleader = " " +vim.keymap.set("v", "J", ":m '>+1gv=gv", { desc = "moves lines down in visual selection" }) +vim.keymap.set("v", "K", ":m '<-2gv=gv", { desc = "moves lines up in visual selection" }) +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "", "zz", { desc = "move down in buffer with cursor centered" }) +vim.keymap.set("n", "", "zz", { desc = "move up in buffer with cursor centered" }) +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- select single or multiple lines and move them up or down without having to re-enter visual mode +vim.keymap.set("v", "<", "", ">gv", opts) + +-- Paste without replacing clipboard content by x. +vim.keymap.set("x","p", [["_dP]]) + +-- tab stuff +vim.keymap.set("n", "to", "tabnew") --open new tab +vim.keymap.set("n", "tx", "tabclose") --close current tab +vim.keymap.set("n", "tn", "tabn") --go to next +vim.keymap.set("n", "tp", "tabp") --go to pre +vim.keymap.set("n", "tf", "tabnew %") --open current tab in new tab + +--split management +vim.keymap.set("n", "sv", "v", { desc = "Split window vertically" }) +-- split window vertically +vim.keymap.set("n", "sh", "s", { desc = "Split window horizontally" }) +-- split window horizontally +vim.keymap.set("n", "se", "=", { desc = "Make splits equal size" }) -- make split windows equal width & height +-- close current split window +vim.keymap.set("n", "sx", "close", { desc = "Close current split" }) + +-- vim tmux settings local M = {} - M.general = { n = { [""] = { " TmuxNavigateLeft", "window left"}, [""] = { " TmuxNavigateRight", "window right"}, - [""] = { " TmuxNavigateDown", "window down"}, + [""] = { " TmuxNavigateDown", "window down"}, [""] = { " TmuxNavigateUp", "window up"}, } } +-- Replace the word cursor is on globally +vim.keymap.set("n", "s", [[:%s/\<\>//gI]], + { desc = "Replace word cursor is on globally" }) +-- Copy filepath to the clipboard +vim.keymap.set("n", "fp", function() + local filePath = vim.fn.expand("%:~") -- Gets the file path relative to the home directory + vim.fn.setreg("+", filePath) -- Copy the file path to the clipboard register + print("File path copied to clipboard: " .. filePath) +end, { desc = "Copy file path to clipboard" }) + +-- Toggle LSP diagnostics visibility +local isLspDiagnosticsVisible = true +vim.keymap.set("n", "lx", function() + isLspDiagnosticsVisible = not isLspDiagnosticsVisible + vim.diagnostic.config({ + virtual_text = isLspDiagnosticsVisible, + underline = isLspDiagnosticsVisible + }) +end, { desc = "Toggle LSP diagnostics" }) diff --git a/lua/themenacesauce/core/options.lua b/lua/themenacesauce/core/options.lua index d916578..066b2bd 100644 --- a/lua/themenacesauce/core/options.lua +++ b/lua/themenacesauce/core/options.lua @@ -41,6 +41,7 @@ vim.opt.colorcolumn = "80" -- highlights the files you search for. vim.opt.hlsearch = true -vim.opt.mouse = "a" -vim.g.editorconfig = true +vim.opt.mouse = "a" -- mouse support for all vim modes + +vim.g.editorconfig = true -- consistent coding styles across editors diff --git a/lua/themenacesauce/plugins/image-support.lua b/lua/themenacesauce/plugins/image-support.lua index 97f0776..ad9fcb3 100644 --- a/lua/themenacesauce/plugins/image-support.lua +++ b/lua/themenacesauce/plugins/image-support.lua @@ -23,8 +23,8 @@ return { dir_path = function() local cwd = vim.fn.getcwd() - local vault_name = "Alibaba's Vault" -- obsidian vault dir - local vault_images_path = "/Documents/Alibaba's Vault/Images/" + local vault_name ="Alibaba" -- obsidian vault dir + local vault_images_path = "/home/sauce/Documents/Alibaba/Images/" if cwd:match(vault_name) then return vault_images_path diff --git a/lua/themenacesauce/plugins/snacks.lua b/lua/themenacesauce/plugins/snacks.lua index c0cc872..ddb13bb 100644 --- a/lua/themenacesauce/plugins/snacks.lua +++ b/lua/themenacesauce/plugins/snacks.lua @@ -114,18 +114,19 @@ return { end, doc = { float = false, -- show image on cursor hover - inline = false, -- show image inline + inline = true, -- show image inline max_width = 50, max_height = 30, wo = { - wrap = false, + wrap = true, }, }, convert = { notify = true, command = "magick" }, - img_dirs = { "img", "images", "assets", "static", "public", "media", "attachments","~Documents/Alibaba's Vault/Images", "~/Library", "~/Downloads" }, + img_dirs = { "img", "images", "assets", "static", "public", "media", "attachments","/home/sauce/Documents/Alibaba/Images", "~/Library", "~/Downloads" }, + }, dashboard = { enabled = true,