LazyVim.LazyVim/lua/lazyvim/plugins
Jeremy Pridemore d2483f19ce
feat(lualine): allow for trouble_lualine to be overriden on buffer (#4096)
## Description

<!-- Describe the big picture of your changes to communicate to the
maintainers
  why we should accept this pull request. -->

Right now there is a default `vim.g.trouble_lualine` being set to
`true`, and only that variable is being checked when deciding if the
trouble output is being appended to the `lualine_c` for the lualine
plugin. This is normally nice in code files, where you can get output
like `packages/src/index.ts > myFunction` but in some filetypes, the
user may not wish for this. In particular, I found if you have files
with the `markdown` type that include long headers, then you can easily
lose the file name by it trying to include the headers in this location.

Considering that one of the `CONTRIBUTING.md` guidelines is `Ensure all
configurations are overridable by the user, using Lazy's specs.`, I
figured that allowing this to be overrideable at the user's discretion
could be a valuable feature.

This would allow the user to override this on file type by including an
autocmd like this in their `lua/config/autocmds.lua` or equivalent:

```lua
-- disable trouble symbols in lualine in text filetypes
vim.api.nvim_create_autocmd("FileType", {
  group = vim.api.nvim_create_augroup("disable_trouble_lualine", { clear = true }),
  pattern = { "text", "plaintex", "typst", "gitcommit", "markdown" },
  callback = function()
    vim.b.trouble_lualine = false
  end,
})
```

## Related Issue(s)

None

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.

---------

Co-authored-by: jpridemore-allegion <jeremy.pridemore@allegion.com>
2024-07-18 07:21:50 +02:00
..
compat fix(extras): better reasons as to why some extras are included in your config. 2024-06-14 11:14:00 +02:00
extras feat(edgy): added support for grug-far.nvim 2024-07-18 00:21:19 +02:00
lsp feat(keymaps): dynamic which-key icons/descriptions for toggles (#4050) 2024-07-15 15:47:44 +02:00
coding.lua feat(keymaps): dynamic which-key icons/descriptions for toggles (#4050) 2024-07-15 15:47:44 +02:00
colorscheme.lua feat(catppuccin): enable more integrations (#1922) 2023-11-04 11:09:01 +01:00
editor.lua feat(which-key): dynamic buffer mappings under leader-b 2024-07-17 12:43:12 +02:00
formatting.lua fix(conform): lsp_format breaking changes (#3707) 2024-06-17 19:49:30 +02:00
init.lua refactor: config = true >> opts = {} 2024-06-11 00:06:56 +02:00
linting.lua fix(lint): make prepend_args opt work when default args is empty (#3828) 2024-06-27 17:31:11 +02:00
treesitter.lua feat(keymaps): dynamic which-key icons/descriptions for toggles (#4050) 2024-07-15 15:47:44 +02:00
ui.lua feat(lualine): allow for trouble_lualine to be overriden on buffer (#4096) 2024-07-18 07:21:50 +02:00
util.lua style(persistence): remove unused option 2024-07-14 18:11:24 +02:00
xtras.lua refactor: LazyVim.config 2024-06-16 15:35:38 +02:00