diff --git a/lazy-lock.json b/lazy-lock.json index 8876922..6a779a3 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -30,6 +30,7 @@ "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, "nvim-cmp": { "branch": "main", "commit": "51f1e11a89ec701221877532ee1a23557d291dd5" }, "nvim-lspconfig": { "branch": "master", "commit": "0d29cad8de3b2c654315203fc1fe12fde722a18a" }, + "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-treesitter": { "branch": "master", "commit": "f7bb866405530e863135596900781e73cbf6f4ed" }, "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" }, diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 552a4c2..f405c4e 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -12,89 +12,93 @@ vim.g.maplocalleader = " " -- command_mode = "c", require("util").keymaps({ - n = { - [";"] = { ":", desc = "No shift command mode" }, - ["n"] = { "nzzzv", desc = "Next search result centered" }, - ["N"] = { "Nzzzv", desc = "Previous search result centered" }, - [""] = { ":noh", desc = "Clear search on escape" }, - [""] = { ":noh", desc = "Clear search on return" }, - ["a"] = { "ggVG", desc = "Select all" }, - ["w"] = { "w", desc = "Save" }, - ["q"] = { "confirm q", desc = "Quit" }, - ["bq"] = { "bp|bd #", desc = "Close current buffer only" }, - ["tn"] = { "tabnew", desc = "Create new tab" }, - ["tq"] = { "tabclose", desc = "Close current tab" }, - ["|"] = { "vsplit", desc = "Vertical Split" }, - ["\\"] = { "split", desc = "Horizontal Split" }, - [""] = { "zz", desc = "Vertical half page down and center cursor" }, - [""] = { "zz", desc = "Vertical half page up and center cursor" }, - ["y"] = { '"*y', desc = "Copy to system clipboard" }, - ["p"] = { '"*p', desc = "Paste from system clipboard" }, - ["Q"] = { "Neotree closeqa", desc = "Quit all" }, - ["J"] = { "mzJ`z", desc = "Move line below onto this line" }, - [""] = { "", desc = "Go back " }, - -- window navigation - [""] = { "h", desc = "Move window left current" }, - [""] = { "j", desc = "Move window below current" }, - [""] = { "k", desc = "Move window above current" }, - [""] = { "l", desc = "Move window right current" }, - -- tab navigation - ["H"] = { "tabprevious", desc = "Move to previous tab" }, - ["L"] = { "tabnext", desc = "Move to next tab" }, - -- reformat LSP - ["lf"] = { - function() - -- vim.cmd "SqlxFormat" - vim.lsp.buf.format() - end, - desc = "Reformat file", - }, - ["lsf"] = { "SqlxFormat", desc = "Format sqlx queries in rust raw string literals." }, - ["ld"] = { - function() - vim.diagnostic.open_float() - end, - desc = "Show diagnostic message", - }, - ["ll"] = { - function() - vim.diagnostic.setloclist() - end, - desc = "Show diagnostic list", - }, - ["lz"] = { "e", desc = "Edit current file again / Restart LSP Server" }, - [",uu"] = { ':let @u = trim(tolower(system("uuidgen")))au', desc = "Generate and insert UUID" }, - ["B"] = { "b#", desc = "Switch to last buffer" }, - }, - v = { - ["J"] = { ":m '>+1gv=gv", desc = "Visually move block down" }, - ["K"] = { ":m '<-2gv=gv", desc = "Visually move block up" }, - [",uu"] = { - 'd:let @u = trim(tolower(system("uuidgen")))iu', - desc = "Generate and replace UUID", - }, - ["y"] = { '"*y', desc = "Copy to system clipboard" }, - ["p"] = { '"*p', desc = "Paste from system clipboard" }, - ["p"] = { '"_dP', desc = "Paste without yanking replaced content" }, - [""] = { '"hy:%s/h//g', desc = "Replace current selection" }, - }, - i = { - [""] = { "", desc = "Up" }, - [""] = { "", desc = "Down" }, - [""] = { "", desc = "Left" }, - [""] = { "", desc = "Right" }, - [""] = { "", desc = "End" }, - [""] = { "", desc = "Home" }, - }, - c = { - [""] = { "", desc = "Left" }, - [""] = { "", desc = "Down" }, - [""] = { "", desc = "Up" }, - [""] = { "", desc = "Right" }, - [""] = { "", desc = "End" }, - [""] = { "", desc = "Home" }, - }, - t = { - [""] = { "", desc = "Escape the terminal" }, - }, + n = { + [";"] = { ":", desc = "No shift command mode" }, + ["n"] = { "nzzzv", desc = "Next search result centered" }, + ["N"] = { "Nzzzv", desc = "Previous search result centered" }, + [""] = { ":noh", desc = "Clear search on escape" }, + [""] = { ":noh", desc = "Clear search on return" }, + ["a"] = { "ggVG", desc = "Select all" }, + ["w"] = { "w", desc = "Save" }, + ["q"] = { "confirm q", desc = "Quit" }, + ["bq"] = { "bp|bd #", desc = "Close current buffer only" }, + ["tn"] = { "tabnew", desc = "Create new tab" }, + ["tq"] = { "tabclose", desc = "Close current tab" }, + ["|"] = { "vsplit", desc = "Vertical Split" }, + ["\\"] = { "split", desc = "Horizontal Split" }, + [""] = { "zz", desc = "Vertical half page down and center cursor" }, + [""] = { "zz", desc = "Vertical half page up and center cursor" }, + ["y"] = { '"*y', desc = "Copy to system clipboard" }, + ["p"] = { '"*p', desc = "Paste from system clipboard" }, + ["Q"] = { "Neotree closeqa", desc = "Quit all" }, + ["J"] = { "mzJ`z", desc = "Move line below onto this line" }, + [""] = { "", desc = "Go back " }, + -- window navigation + [""] = { "h", desc = "Move window left current" }, + [""] = { "j", desc = "Move window below current" }, + [""] = { "k", desc = "Move window above current" }, + [""] = { "l", desc = "Move window right current" }, + -- tab navigation + ["H"] = { "tabprevious", desc = "Move to previous tab" }, + ["L"] = { "tabnext", desc = "Move to next tab" }, + -- reformat LSP + ["lf"] = { + function() + -- vim.cmd "SqlxFormat" + vim.lsp.buf.format() + end, + desc = "Reformat file", + }, + ["lsf"] = { "SqlxFormat", desc = "Format sqlx queries in rust raw string literals." }, + ["ld"] = { + function() + vim.diagnostic.open_float() + end, + desc = "Show diagnostic message", + }, + ["ll"] = { + function() + vim.diagnostic.setloclist() + end, + desc = "Show diagnostic list", + }, + ["lz"] = { "e", desc = "Edit current file again / Restart LSP Server" }, + [",uu"] = { ':let @u = trim(tolower(system("uuidgen")))au', desc = "Generate and insert UUID" }, + ["B"] = { "b#", desc = "Switch to last buffer" }, + ["S"] = { + "set equalalwaysset noequalalways", + desc = "Equalize/resize screens evenly", + }, + }, + v = { + ["J"] = { ":m '>+1gv=gv", desc = "Visually move block down" }, + ["K"] = { ":m '<-2gv=gv", desc = "Visually move block up" }, + [",uu"] = { + 'd:let @u = trim(tolower(system("uuidgen")))iu', + desc = "Generate and replace UUID", + }, + ["y"] = { '"*y', desc = "Copy to system clipboard" }, + ["p"] = { '"*p', desc = "Paste from system clipboard" }, + ["p"] = { '"_dP', desc = "Paste without yanking replaced content" }, + [""] = { '"hy:%s/h//g', desc = "Replace current selection" }, + }, + i = { + [""] = { "", desc = "Up" }, + [""] = { "", desc = "Down" }, + [""] = { "", desc = "Left" }, + [""] = { "", desc = "Right" }, + [""] = { "", desc = "End" }, + [""] = { "", desc = "Home" }, + }, + c = { + [""] = { "", desc = "Left" }, + [""] = { "", desc = "Down" }, + [""] = { "", desc = "Up" }, + [""] = { "", desc = "Right" }, + [""] = { "", desc = "End" }, + [""] = { "", desc = "Home" }, + }, + t = { + [""] = { "", desc = "Escape the terminal" }, + }, }) diff --git a/lua/options.lua b/lua/options.lua index 79b29a9..0d72dff 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -47,8 +47,12 @@ vim.opt.splitright = true -- Set completeopt to have a better completion experience vim.o.completeopt = "menuone,noselect" vim.diagnostic.config({ - float = { border = "single" }, + float = { border = "single" }, }) -- Turn on new diff vim.opt.diffopt:append("linematch:20") + +-- Set screen mode +vim.o.noequalalways = true +vim.o.equalalways = false diff --git a/lua/plugins/vim-notify.lua b/lua/plugins/vim-notify.lua new file mode 100644 index 0000000..d013df4 --- /dev/null +++ b/lua/plugins/vim-notify.lua @@ -0,0 +1,14 @@ +return { + "rcarriga/nvim-notify", + opts = { + top_down = false, + }, + config = function(_, opts) + require("notify").setup(opts) + + vim.notify = require("notify") + end, + keys = { + { "fn", "Telescope notify", desc = "Telescope search notifications" }, + }, +}