]> git.rmz.io Git - dotfiles.git/blobdiff - nvim/lua/plugins/snacks.lua
nvim: replace telescope with snacks.picker
[dotfiles.git] / nvim / lua / plugins / snacks.lua
index af027adcdc0ac256f9bb0b0ac8fdfe48690c8af4..63e12ab4a3f73339d1c382a8be6ab9f809115cdc 100644 (file)
@@ -19,7 +19,12 @@ return {
     },
     opts = {
       bigfile = { enabled = true },
-      quickfile = { enabled = true },
+      indent = { enabled = true },
+      input = { enabled = true },  -- NOTE: seems unecessary
+      quickfile = { enabled = true },  -- TODO: review if needed
+      scope = { enabled = true },
+      scroll = { enabled = false },  -- fuck this!
+      statuscolumn = { enabled = true },
       terminal = {
         win = {
           keys = {
@@ -30,6 +35,47 @@ return {
           },
         },
       },
+      dashboard = {
+        preset = {
+          -- TODO: replace header
+          header = [[
+          ██╗      █████╗ ██╗   ██╗███████╗██╗   ██╗██╗   ██╗██╗███╗   ███╗          Z
+          ██║     ██╔══██╗██║   ██║╚══███╔╝╚██╗ ██╔╝██║   ██║██║████╗ ████║      Z    
+          ██║     ██║  ██║██║   ██║  ███╔╝  ╚████╔╝ ██║   ██║██║██╔████╔██║   z       
+          ██║     ██║  ██║██║   ██║ ███╔╝    ╚██╔╝  ╚██╗ ██╔╝██║██║╚██╔╝██║ z         
+          ███████╗╚█████╔╝╚██████╔╝███████╗   ██║    ╚████╔╝ ██║██║ ╚═╝ ██║           
+          ╚══════╝ ╚════╝  ╚═════╝ ╚══════╝   ╚═╝     ╚═══╝  ╚═╝╚═╝     ╚═╝           ]],
+          -- stylua: ignore
+          ---@type snacks.dashboard.Item[]
+          keys = {
+            { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
+            { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
+            { icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
+            { icon = " ", key = "r", desc = "Recent Files", action = ":lua Snacks.dashboard.pick('oldfiles')" },
+            { icon = " ", key = "c", desc = "Config", action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
+            { icon = " ", key = "s", desc = "Restore Session", section = "session" },
+            { icon = " ", key = "x", desc = "Lazy Extras", action = ":LazyExtras" },
+            { icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy" },
+          },
+        },
+      },
+    },
+  },
+  { "folke/snacks.nvim",
+    opts = {
+      notifier = { enabled = true },
+    },
+    -- stylua: ignore
+    keys = {
+      -- TODO: review after picking picker (ha)
+      { "<leader>n", function()
+        if Snacks.config.picker and Snacks.config.picker.enabled then
+          Snacks.picker.notifications()
+        else
+          Snacks.notifier.show_history()
+        end
+      end, desc = "Notification History" },
+      { "<leader>un", function() Snacks.notifier.hide() end, desc = "Dismiss All Notifications" },
     },
   }
 }