From b86aa2d2a2b60a9fac0aa197337207ba763a0343 Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Tue, 7 Nov 2023 23:21:58 +0100 Subject: [PATCH] feat(nvim): add notify plugin --- nvim/lazy-lock.json | 9 +++++---- nvim/lua/plugins.lua | 32 ++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 2d6f389..5dd0648 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -15,13 +15,14 @@ "mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "f0cd12f7a8a310c58cecebddb6b219ffad1cfd0f" }, "mason.nvim": { "branch": "main", "commit": "eabf6d347fdb75be360d4c0ced1145670a171453" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "1236db954ce502eb5b340bcdb69aa057cc372e8d" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "f053f09962819c1558cd93639aa80edf7c314c17" }, "nui.nvim": { "branch": "main", "commit": "c0c8e347ceac53030f5c1ece1c5a5b6a17a25b32" }, - "nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" }, + "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" }, "nvim-dap": { "branch": "master", "commit": "4048f37bc8b1a36fe1f5fde0df7d84aef71380e4" }, "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, - "nvim-lspconfig": { "branch": "master", "commit": "b44737605807023d32e6310b87ba69f4dbf10e0e" }, - "nvim-treesitter": { "branch": "master", "commit": "bef2c24e23d0da62a8542b1f08b1ac87ec43e93f" }, + "nvim-lspconfig": { "branch": "master", "commit": "37457f268af5cd6765e589b0dcd7cbd192d8da00" }, + "nvim-notify": { "branch": "master", "commit": "e4a2022f4fec2d5ebc79afa612f96d8b11c627b3" }, + "nvim-treesitter": { "branch": "master", "commit": "9a746b4b6a1ef215943f07e6aa2ec35fb14097d4" }, "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index 660d591..d83c060 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -1,4 +1,5 @@ local U = require("utility") +local n = U.keymap 'n' return { @@ -8,8 +9,8 @@ return { "rebelot/kanagawa.nvim", lazy = false, priority = 1000, - config = function() - vim.cmd("colorscheme kanagawa") + config = function() + vim.cmd "colorscheme kanagawa" end, }, @@ -35,7 +36,8 @@ return { }, config = function() local telescope = require "telescope" - local builtin = require "telescope.builtin" + local builtin = require "telescope.builtin" + local ext = telescope.extensions telescope.setup({ extensions = { fzf = { @@ -47,14 +49,16 @@ return { } }) telescope.load_extension("fzf") - local nmap = U.keymap 'n' - nmap "ff" (builtin.find_files) "Telescope: find files" - nmap "fb" (builtin.buffers) "Telescope: find buffers" - nmap "fg" (builtin.live_grep) "Telescope: grep content" - nmap "fh" (builtin.help_tags) "Telescope: search docs" + telescope.load_extension("notify") + n "ff" (builtin.find_files) "Telescope: find files" + n "fb" (builtin.buffers) "Telescope: find buffers" + n "fg" (builtin.live_grep) "Telescope: grep content" + n "fh" (builtin.help_tags) "Telescope: search docs" + n "fn" (ext.notify.notify) "Telescope: find notifications" end, }, + -- Shortcut hints { "folke/which-key.nvim", event = "VeryLazy", @@ -65,6 +69,14 @@ return { opts = {} }, + -- Notifications + { + "rcarriga/nvim-notify", + config = function() + vim.notify = require "notify" + end + }, + -- File tree { "nvim-neo-tree/neo-tree.nvim", @@ -191,8 +203,8 @@ return { { "mfussenegger/nvim-dap", config = function() - local dap = require("dap") - vim.keymap.set('n', "b", dap.toggle_breakpoint) + local dap = require "dap" + n "b" (dap.toggle_breakpoint) "DAP: Toggle breakpoint" end, },