]> git.rmz.io Git - dotfiles.git/blob - nvim/lua/plugins/ui.lua
nvim: allow normal mode in lsp.rename() popup
[dotfiles.git] / nvim / lua / plugins / ui.lua
1 ---@type LazyPluginSpec
2 return {
3 {
4 "nvim-notify",
5 },
6 {
7 "bufferline.nvim",
8 ---@type BufferlineConfig
9 opts = {
10 options = {
11 always_show_bufferline = false,
12 },
13 },
14 },
15 {
16 "stevearc/dressing.nvim",
17 lazy = true,
18 opts = {
19 input = {
20 insert_only = false,
21 },
22 },
23 },
24 {
25 "noice.nvim",
26 enabled = false,
27 ---@type NoiceConfig
28 opts = {
29 presets = {
30 command_palette = false, -- don't position the cmdline and popupmenu together
31 lsp_doc_border = true,
32 long_message_to_split = true,
33 },
34 cmdline = {
35 view = "cmdline",
36 },
37 routes = {
38 { -- send file written messages to mini
39 filter = {
40 event = "msg_show",
41 kind = "",
42 find = "%[w%]",
43 },
44 opts = { skip = true },
45 },
46 },
47 },
48 config = function(_, opts)
49 -- ensure [w] is written to msg_show so we can match it
50 vim.opt.shortmess:append("w")
51 vim.opt.shortmess:remove("W")
52
53 require("noice").setup(opts)
54 end,
55 },
56 {
57 "lualine.nvim",
58 --TODO: Things that were in vim but are missing
59 -- - git line add/mod/del ar next to branch name rather on right
60 -- - one status line per splits
61 -- - maybe a single one is OK too?
62 -- - I think I want a line stating wihch file is in the split though
63 -- - unix/dos eof markers
64 -- - really I only want to know if it's not unix
65 -- - filetype in text form. It's quite important to glance this quickly
66 },
67 {
68 "indent-blankline.nvim",
69 },
70 {
71 "mini.indentscope",
72 opts = {
73 draw = {
74 animation = require("mini.indentscope").gen_animation.linear({ duration = 10 }),
75 },
76 },
77 },
78 {
79 "nvimdev/dashboard-nvim",
80 -- TODO: create cool dashboard header
81 -- generate logo from text here:
82 -- https://patorjk.com/software/taag/#p=testall&v=0&f=Computer&t=NEOVIM
83 -- Can also use use `chafa` and aplha.term to generate text from cli, see
84 -- https://github.com/goolord/alpha-nvim/discussions/16#discussioncomment-4915947
85 -- https://github.com/goolord/alpha-nvim/discussions/16#discussioncomment-5065731
86 -- To add orgmode agenda button in alpha
87 -- dashboard.button("a", "󰕪 " .. " View Agenda", ":lua require('orgmode').action('agenda.agenda')<CR>"),
88 opts = function()
89 local logo = [[
90 ██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
91 ██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
92 ██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
93 ██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
94 ███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
95 ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
96 ]]
97
98 logo = string.rep("\n", 8) .. logo .. "\n\n"
99
100 local opts = {
101 theme = "doom",
102 hide = {
103 -- this is taken care of by lualine
104 -- enabling this messes up the actual laststatus setting after loading a file
105 statusline = false,
106 },
107 config = {
108 header = vim.split(logo, "\n"),
109 -- stylua: ignore
110 center = {
111 { action = [[lua require('orgmode').action('agenda.agenda')]], desc = " View Agenda", icon = "󰕪 ", key = "a" },
112 { action = "Telescope find_files", desc = " Find file", icon = " ", key = "f" },
113 { action = "ene | startinsert", desc = " New file", icon = " ", key = "n" },
114 { action = "Telescope oldfiles", desc = " Recent files", icon = " ", key = "r" },
115 { action = [[lua require("lazyvim.util").telescope.config_files()()]], desc = " Config", icon = " ", key = "c" },
116 { action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
117 { action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
118 { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
119 },
120 footer = function()
121 local stats = require("lazy").stats()
122 local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
123 return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
124 end,
125 },
126 }
127
128 for _, button in ipairs(opts.config.center) do
129 button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
130 button.key_format = " %s"
131 end
132
133 -- close Lazy and re-open when the dashboard is ready
134 if vim.o.filetype == "lazy" then
135 vim.cmd.close()
136 vim.api.nvim_create_autocmd("User", {
137 pattern = "DashboardLoaded",
138 callback = function()
139 require("lazy").show()
140 end,
141 })
142 end
143
144 return opts
145 end
146 },
147 {
148 "nvim-navic",
149 },
150 {
151 "nvim-web-devicons",
152 },
153 {
154 "nui.nvim",
155 },
156 }