diff --git a/init.lua b/init.lua index e85085c..a5b735e 100644 --- a/init.lua +++ b/init.lua @@ -12,19 +12,27 @@ vim.wo.number = true vim.api.nvim_set_hl(0, "LineNr", { fg = "#6c7086" }) -- overlay0 vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "#cba6f7", bold = true }) -- mauve +local cursorline_group = vim.api.nvim_create_augroup("CursorLineControl", { clear = true }) + +vim.api.nvim_create_autocmd({ "WinEnter", "BufEnter" }, { + group = cursorline_group, + callback = function() + vim.opt_local.cursorline = true + end, +}) + +vim.api.nvim_create_autocmd({ "WinLeave" }, { + group = cursorline_group, + callback = function() + vim.opt_local.cursorline = false + end, +}) + -- Windows vim.opt.splitbelow = true vim.opt.splitright = true vim.o.winborder = "rounded" --- Sane keymaps -vim.keymap.set("i", "jj", "") -vim.keymap.set("n", "q:", ":", { noremap = true, silent = true }) -vim.keymap.set("n", "bd", function() -- delete buffer - vim.cmd("bd") - vim.cmd("echo 'Buffer deleted'") -end, { noremap = true }) - -- Sane tab management vim.opt.tabstop = 2 vim.opt.softtabstop = 2 @@ -53,6 +61,19 @@ vim.opt.scrolloff = math.floor(vim.o.lines / 2) - 3 -- Indent vim.o.autoindent = true +-- Keymap function +function Keymap(mode, key, binding) + vim.keymap.set(mode, key, binding, { noremap = true, silent = true }) +end + +-- Better keymaps +Keymap("i", "jj", "") +Keymap("n", "q:", ":") +Keymap("n", "bd", function() -- delete buffer + vim.cmd("bd") + vim.cmd("echo 'Buffer deleted'") +end) + vim.keymap.set("n", "i", function() if vim.fn.getline("."):match("^%s*$") then return [["_cc]] @@ -69,12 +90,6 @@ vim.keymap.set("n", "a", function() end end, { expr = true, desc = "Indent properly on empty lines" }) --- Force proper keybindings -vim.keymap.set("n", "", 'echo "Use h to move!!"') -vim.keymap.set("n", "", 'echo "Use l to move!!"') -vim.keymap.set("n", "", 'echo "Use k to move!!"') -vim.keymap.set("n", "", 'echo "Use j to move!!"') - -- C-BS for deleting whole word in insert mode vim.keymap.set("i", "", "", { noremap = true }) @@ -84,17 +99,12 @@ vim.keymap.set("n", "qj", function() -- quit and save session local vim.cmd("wqa") end, { noremap = true }) -vim.keymap.set("n", "qw", function() -- quit and save session global - local sessionName = vim.fn.input("Session Name: ") - if sessionName ~= "" then - MiniSessions.write(sessionName) - vim.cmd("wqa") - else - vim.notify("Session Name Invalid", vim.log.levels.INFO) - end -end, { noremap = true }) - vim.keymap.set("n", "qd", function() -- quit and delete session - MiniSessions.delete(".session") + pcall(MiniSessions.delete(".session")) vim.cmd("wqa") end, { noremap = true }) + +-- lg keybind +Keymap("n", "l", function() + Snacks.lazygit.open() +end) diff --git a/lua/plugins/completion/blink.lua b/lua/plugins/completion/blink.lua index 1128a72..4398eca 100644 --- a/lua/plugins/completion/blink.lua +++ b/lua/plugins/completion/blink.lua @@ -11,7 +11,9 @@ return { fuzzy = { implementation = "lua" }, - signature = { enabled = true }, + signature = { + enabled = true, + }, completion = { list = { diff --git a/lua/plugins/functional/mini.lua b/lua/plugins/functional/mini.lua index 6960dd9..6319a93 100644 --- a/lua/plugins/functional/mini.lua +++ b/lua/plugins/functional/mini.lua @@ -3,11 +3,13 @@ return { version = "", config = function() - local animate = require("mini.animate") require("mini.pairs").setup() -- Bracket pairs and stuff + require("mini.ai").setup() -- Around and In extension for visual mode + require("mini.cursorword").setup() -- Underline current word below cursor (makes it easier to c and d) - require("mini.indentscope").setup({ + + require("mini.indentscope").setup({ -- shows indents symbol = "│", draw = { delay = 10, @@ -17,24 +19,20 @@ return { easing = "out", }), }, - }) -- Indent lines + }) + require("mini.trailspace").setup() -- Shows useless spaces - require("mini.sessions").setup({ + + require("mini.sessions").setup({ -- dir based session management autoread = true, autowrite = true, file = ".session", force = { read = false, write = true, delete = true }, }) - -- require("mini.notify").setup({ - -- window = { winblend = 0 }, - -- }) -- Better Notifications - -- vim.notify = MiniNotify.make_notify({ - -- ERROR = { duration = 5000 }, - -- WARN = { duration = 4000 }, - -- INFO = { duration = 3000 }, - -- }) + require("mini.surround").setup() -- Suround selections with characters - require("mini.move").setup({ + + require("mini.move").setup({ -- move selection in visual mode mappings = { down = "J", up = "K", @@ -42,6 +40,8 @@ return { }) require("mini.icons").setup() -- Icon provider + + local animate = require("mini.animate") -- animations ovs require("mini.animate").setup({ cursor = { enable = false, @@ -58,7 +58,7 @@ return { -- Animate with wiping from nearest edge instead of default static one winconfig = animate.gen_winconfig.wipe({ direction = "from_edge" }), -- Make bigger windows more transparent - winblend = animate.gen_winblend.linear({ from = 80, to = 100 }), + winblend = animate.gen_winblend.linear({ from = 0, to = 0 }), }, close = { -- Animate for 400 milliseconds with linear easing @@ -66,7 +66,7 @@ return { -- Animate with wiping to nearest edge instead of default static one winconfig = animate.gen_winconfig.wipe({ direction = "to_edge" }), -- Make bigger windows more transparent - winblend = animate.gen_winblend.linear({ from = 100, to = 80 }), + winblend = animate.gen_winblend.linear({ from = 0, to = 0 }), }, }) end, diff --git a/lua/plugins/functional/neorg.lua b/lua/plugins/functional/neorg.lua index 630d5be..cfdd535 100644 --- a/lua/plugins/functional/neorg.lua +++ b/lua/plugins/functional/neorg.lua @@ -8,8 +8,22 @@ return { load = { ["core.defaults"] = {}, ["core.concealer"] = {}, + ["core.qol.toc"] = { + config = { + close_after_use = true, + }, + }, ["core.integrations.treesitter"] = {}, ["core.looking-glass"] = {}, + ["core.itero"] = { + config = { + iterables = { + "unordered_list%d", + "ordered_list%d", + "quote%d", + }, + }, + }, ["core.completion"] = { config = { engine = { module_name = "external.lsp-completion" } }, }, @@ -52,5 +66,15 @@ return { }) vim.wo.foldlevel = 99 vim.wo.conceallevel = 2 + + vim.api.nvim_create_autocmd("Filetype", { + pattern = "norg", + callback = function() + vim.keymap.set("n", "", "(neorg.esupports.hop.hop-link.vsplit)", { buffer = true }) + vim.keymap.set("i", "", "(neorg.itero.next-iteration)", { buffer = true }) + vim.keymap.set("n", "m", "Neorg inject-metadata", { buffer = true }) + vim.keymap.set("n", "f", "Telescope neorg insert_link", { buffer = true }) + end, + }) end, } diff --git a/lua/plugins/functional/telescope-ui-select.lua b/lua/plugins/functional/telescope-ui-select.lua deleted file mode 100644 index 71698e0..0000000 --- a/lua/plugins/functional/telescope-ui-select.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "nvim-telescope/telescope-ui-select.nvim", - dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }, -} diff --git a/lua/plugins/functional/telescope.lua b/lua/plugins/functional/telescope.lua index a73072f..c232a17 100644 --- a/lua/plugins/functional/telescope.lua +++ b/lua/plugins/functional/telescope.lua @@ -4,6 +4,7 @@ return { dependencies = { "nvim-lua/plenary.nvim", "nvim-telescope/telescope-symbols.nvim", + "nvim-telescope/telescope-ui-select.nvim", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, }, config = function() diff --git a/lua/plugins/ui/lualine.lua b/lua/plugins/ui/lualine.lua index 54a23c1..f2bb090 100644 --- a/lua/plugins/ui/lualine.lua +++ b/lua/plugins/ui/lualine.lua @@ -1,6 +1,6 @@ return { "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, + dependencies = { "nvim-tree/nvim-web-devicons", "archibate/lualine-time" }, config = function() require("lualine").setup({ options = { @@ -39,9 +39,9 @@ return { lualine_a = { "mode" }, lualine_b = { "branch", "diff", "diagnostics" }, lualine_c = { "filename" }, - lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_x = { "filetype" }, lualine_y = { "lsp_status" }, - lualine_z = { "location" }, + lualine_z = { "ctime" }, }, inactive_sections = { lualine_a = {}, diff --git a/lua/plugins/ui/noice.lua b/lua/plugins/ui/noice.lua index 1eb5f0f..1b860e6 100644 --- a/lua/plugins/ui/noice.lua +++ b/lua/plugins/ui/noice.lua @@ -18,7 +18,14 @@ return { hover = { enabled = false, }, - -- you can enable a preset for easier configuration + lsp = { + hover = { + enabled = false, + }, + signature = { + enabled = false, + }, + }, presets = { long_message_to_split = true, -- long messages will be sent to a split inc_rename = false, -- enables an input dialog for inc-rename.nvim @@ -27,6 +34,8 @@ return { }) require("notify").setup({ background_colour = "#000000", + render = "compact", + stages = "slide", }) end, dependencies = { diff --git a/lua/plugins/ui/snacks.lua b/lua/plugins/ui/snacks.lua index dc431ba..22f1e79 100644 --- a/lua/plugins/ui/snacks.lua +++ b/lua/plugins/ui/snacks.lua @@ -2,6 +2,8 @@ return { "folke/snacks.nvim", config = function() require("snacks").setup({ + bigfile = {}, + lazygit = {}, image = { enabled = true, math = { diff --git a/lua/plugins/ui/tint.lua b/lua/plugins/ui/tint.lua deleted file mode 100644 index 43d965f..0000000 --- a/lua/plugins/ui/tint.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "levouh/tint.nvim", - config = function() - require("tint").setup() - end, -} diff --git a/lua/plugins/ui/vimade.lua b/lua/plugins/ui/vimade.lua new file mode 100644 index 0000000..100bf03 --- /dev/null +++ b/lua/plugins/ui/vimade.lua @@ -0,0 +1,7 @@ +return { + "tadaa/vimade", + opts = { + recipe = { "minimalist", { animate = true } }, + fadelevel = 0.6, + }, +}