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