3 { 'echasnovski/mini.clue',
4 -- NOTE: this caused some issue with unterminated mappings, i.e. <L>gc when there
5 -- is also <L>gcc. It would simply terminate early and not allow for next mapping.
9 { mode = 'n', keys = '<Leader>' },
10 { mode = 'x', keys = '<Leader>' },
12 { mode = 'n', keys = 'g' },
13 { mode = 'x', keys = 'g' },
15 { mode = 'n', keys = "'" },
16 { mode = 'n', keys = '`' },
17 { mode = 'x', keys = "'" },
18 { mode = 'x', keys = '`' },
20 { mode = 'n', keys = '<C-w>' },
22 { mode = 'n', keys = 'z' },
23 { mode = 'x', keys = 'z' },
26 { mode = 'n', keys = '<Leader>b', desc = '+Buffers' },
27 { mode = 'n', keys = '<Leader>c', desc = '+LSP' },
31 { "akinsho/bufferline.nvim",
34 { "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle Pin" },
35 { "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete Non-Pinned Buffers" },
36 { "<leader>br", "<Cmd>BufferLineCloseRight<CR>", desc = "Delete Buffers to the Right" },
37 { "<leader>bl", "<Cmd>BufferLineCloseLeft<CR>", desc = "Delete Buffers to the Left" },
38 { "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
39 { "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
40 { "[b", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
41 { "]b", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
42 { "[B", "<cmd>BufferLineMovePrev<cr>", desc = "Move buffer prev" },
43 { "]B", "<cmd>BufferLineMoveNext<cr>", desc = "Move buffer next" },
45 ---@type BufferlineConfig
48 close_command = function(n) Snacks.bufdelete(n) end,
49 right_mouse_command = function(n) Snacks.bufdelete(n) end,
50 diagnostics = "nvim_lsp",
51 always_show_bufferline = false,
52 diagnostics_indicator = function(_, _, diag)
53 local icons = LazyVim.config.icons.diagnostics
54 local ret = (diag.error and icons.Error .. diag.error .. " " or "")
55 .. (diag.warning and icons.Warn .. diag.warning or "")
62 highlight = "Directory",
66 ---@param opts bufferline.IconFetcherOpts
67 get_element_icon = function(opts)
68 return LazyVim.config.icons.ft[opts.filetype]
73 { "nvim-lualine/lualine.nvim",
74 -- TODO: Things that were in vim but are missing
75 -- - git line add/mod/del ar next to branch name rather on right
76 -- - one status line per splits
77 -- - maybe a single one is OK too?
78 -- - I think I want a line stating wihch file is in the split though
79 -- - unix/dos eof markers
80 -- - really I only want to know if it's not unix
81 -- - filetype in text form. It's quite important to glance this quickly
84 vim.g.lualine_laststatus = vim.o.laststatus
85 if vim.fn.argc(-1) > 0 then
86 -- set an empty statusline till lualine loads
87 vim.o.statusline = " "
89 -- hide the statusline on the starter page
94 -- PERF: we don't need this lualine require madness 🤷
95 local lualine_require = require("lualine_require")
96 lualine_require.require = require
98 local icons = LazyVim.config.icons
100 vim.o.laststatus = vim.g.lualine_laststatus
105 globalstatus = vim.o.laststatus == 3,
106 disabled_filetypes = { statusline = { "dashboard", "alpha", "ministarter", "snacks_dashboard" } },
109 lualine_a = { "mode" },
110 lualine_b = { "branch" },
116 error = icons.diagnostics.Error,
117 warn = icons.diagnostics.Warn,
118 info = icons.diagnostics.Info,
119 hint = icons.diagnostics.Hint,
122 { "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
123 { LazyVim.lualine.pretty_path() },
126 Snacks.profiler.status(),
129 function() return " " .. require("dap").status() end,
130 cond = function() return package.loaded["dap"] and require("dap").status() ~= "" end,
131 color = function() return { fg = Snacks.util.color("Debug") } end,
135 require("lazy.status").updates,
136 cond = require("lazy.status").has_updates,
137 color = function() return { fg = Snacks.util.color("Special") } end,
142 added = icons.git.added,
143 modified = icons.git.modified,
144 removed = icons.git.removed,
147 local gitsigns = vim.b.gitsigns_status_dict
150 added = gitsigns.added,
151 modified = gitsigns.changed,
152 removed = gitsigns.removed,
159 { "progress", separator = " ", padding = { left = 1, right = 0 } },
160 { "location", padding = { left = 0, right = 1 } },
164 return " " .. os.date("%R")
168 extensions = { "neo-tree", "lazy", "fzf" },
171 local trouble = require("trouble")
172 local symbols = trouble.statusline({
176 filter = { range = true },
177 format = "{kind_icon}{symbol.name:Normal}",
178 hl_group = "lualine_c_normal",
180 table.insert(opts.sections.lualine_c, {
181 symbols and symbols.get,
183 return vim.b.trouble_lualine ~= false and symbols.has()
191 "echasnovski/mini.icons",
195 [".keep"] = { glyph = "", hl = "MiniIconsGrey" },
196 ["devcontainer.json"] = { glyph = "", hl = "MiniIconsAzure" },
199 dotenv = { glyph = "", hl = "MiniIconsYellow" },
203 -- TODO: try without this
204 -- see :h MiniIcons.mock_nvim_web_devicons()
205 package.preload["nvim-web-devicons"] = function()
206 require("mini.icons").mock_nvim_web_devicons()
207 return package.loaded["nvim-web-devicons"]
211 { "MunifTanjim/nui.nvim", lazy = true },
212 { "stevearc/dressing.nvim",
213 enabled = false, -- replaced by snacks.input
217 start_in_insert = false,
222 { "indent-blankline.nvim",
223 enabled = false, -- replaced by snacks.indent
225 { "echasnovski/mini.indentscope",
226 enabled = false, -- replaced by snacks.indent
227 version = false, -- wait till new 0.7.0 release to put it back on semver
229 opts = function (_, opts)
232 animation = require("mini.indentscope").gen_animation.linear({ duration = 10 })
237 { "SmiteshP/nvim-navic",
240 vim.g.navic_silence = true
241 LazyVim.lsp.on_attach(function(client, buffer)
242 if client.supports_method("textDocument/documentSymbol") then
243 require("nvim-navic").attach(client, buffer)
252 icons = LazyVim.config.icons.kinds,
253 lazy_update_context = true,
257 { "nvim-lualine/lualine.nvim",
259 opts = function(_, opts)
260 if not vim.g.trouble_lualine then
261 table.insert(opts.sections.lualine_c, { "navic", color_correction = "dynamic" })