Compare commits

..

177 Commits

Author SHA1 Message Date
b26be29330 chore(main): release 10.20.0 (#2849)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-28 23:51:31 +01:00
8f1fb60f0a feat(extras): use mini.move instead of native move (#2865) 2024-03-28 23:49:48 +01:00
e29c7acd2d feat(extras): added extra for mini.diff 2024-03-28 23:41:54 +01:00
a786c471df fix(statuscolumn): right align signs when virtnum > 0 2024-03-28 23:25:06 +01:00
9a2f773090 fix(trouble): show message if use hasnt updated with Lazy yet after enabling the extra 2024-03-28 22:49:35 +01:00
bb6aa98cbf feat(extras): added extra for the trouble.nvim v3 beta 2024-03-28 22:11:55 +01:00
dd54a29cc5 chore(build): auto-generate vimdoc 2024-03-28 20:33:40 +00:00
d95c2ba1dc feat(python): enable auto_brackets for python, since pyright and basedpyright dont support this natively 2024-03-28 21:32:37 +01:00
bf8ce8076e feat(cmp): added option auto_brackets that adds brackets to functions/methods in configured filetypes 2024-03-28 21:32:09 +01:00
cfbd358273 fix(nvim-lint): don't duplicate linters. Fixes #2852 2024-03-27 16:54:38 +01:00
e3075b05ef fix(config): type filter was broken for telescope symbols 2024-03-27 15:04:41 +01:00
c901640167 chore(main): release 10.19.0 (#2835)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-27 11:28:17 +01:00
d945137a32 fix(python-semshi): better highlights (#2839) 2024-03-27 11:23:26 +01:00
bb1480a6b9 feat(lazygit): allow customizing the lazygit theme. Check the code to change the hl group mapping. Fixes #2846 2024-03-27 11:19:06 +01:00
6ed771de9d fix(lazygit): use Visual instead of CursorLine for selected line. Fixes #2846 2024-03-27 10:43:32 +01:00
ce5917a589 fix(lazygit): error handling for getting lazygit's config path 2024-03-27 10:21:09 +01:00
2a8bfccc3e chore(build): auto-generate vimdoc 2024-03-27 07:57:14 +00:00
eb9f9a8862 fix(keymaps): update all keymap descriptions to be Title Case (#2844) 2024-03-27 08:56:44 +01:00
7d570fad79 fix(autocmds): auto create directory on windows for uris. Fixes #2442 2024-03-26 20:48:56 +01:00
1910cd5cb7 refactor: use LazyVim.is_win() 2024-03-26 20:48:56 +01:00
1de90e7e4c chore(main): release 10.18.0 (#2834)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-26 20:33:06 +01:00
76b037dcc1 feat(extras): add dial extra (#2798)
* feat: add dial extra

* refactor: removed print statements

* fix(extras): early return for dial extra

* refactor: dials_by_ft like conform, nvim-lint. Simplified buffer specific groups

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-03-26 20:26:08 +01:00
fd0677fb9a fix(terminal): dont use backdrop for edgy terminal windows 2024-03-26 19:55:14 +01:00
426cd3ed91 feat(lazygit): configure lazygit nvim-remote as editor and enable nerdfont icons
can be disabled with `vim.g.lazygit_config = false`
2024-03-26 19:55:14 +01:00
55c2527dfe chore(main): release 10.17.3 (#2833)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-26 17:41:37 +01:00
f3655c33a3 perf(notify): disable animation notifications. too big impact on performance for too little benefit
To keep using animations, you can set stages = fade_in_slide_out for the
nvim-notify plugin
2024-03-26 17:35:27 +01:00
49a1afab53 chore(main): release 10.17.2 (#2831)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-26 15:30:56 +01:00
a26ca7bf56 fix(lazygit): dont error when setting ansi color fails. Fixes #2829 2024-03-26 15:24:16 +01:00
20efdd44da chore(main): release 10.17.1 (#2827)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-26 13:46:01 +01:00
bfe8c608a3 fix(lazygit): allow overriding default terminal options 2024-03-26 13:42:57 +01:00
4796dba8f7 chore(main): release 10.17.0 (#2805)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-26 12:47:36 +01:00
7d0dbc6ded feat(lazygit): lazygit now automatically uses colors from your Neovim colorscheme
Disable by setting `vim.g.lazygit_theme = false` in your `options.lua`
2024-03-26 12:43:07 +01:00
c00e3aa6b1 feat(util): added util function to get a fg/bg color from the active colorscheme 2024-03-26 12:43:07 +01:00
1d2cb7d8d1 chore(build): auto-generate vimdoc 2024-03-26 08:28:44 +00:00
3e5a5dd621 feat(python): allow configuring other python lsp servers than pyright, basedpyright 2024-03-26 09:28:08 +01:00
9e07a6615a chore(build): auto-generate vimdoc 2024-03-23 07:15:37 +00:00
b74ef23a27 feat(neo-tree): add mapping "O" to open with system default (#2758)
* feat(neo-tree): add mapping "O" to open with system default

* feat(neo-tree): add OS checks for system default open commands

* Use `vim.ui.open` if exists

* update OS checks

* Just use vim.ui.open or throw error if doesn't exist

* Make "O" undefined mapping if vim.ui.open isn't available

* fix: use lazy's util.open instead

---------

Co-authored-by: Uthman Mohamed <83053931+1239uth@users.noreply.github.com>
Co-authored-by: saeedahsan <ahsan02@gmail.com>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-03-23 08:15:04 +01:00
7ab6285011 feat(options): Disable foldtext for nightly (#2447)
* chores(format.lua): Fix typo

* Change gitsigns.nvim hunk preview shortcut

Change `preview_hunk` to recently added `preview_hunk_inline` command

* feat(options): remove redundant commented line

* feat(options): use native folding

see https://github.com/neovim/neovim/pull/20750
2024-03-22 10:38:10 +01:00
c91982a8bc chore(main): release 10.16.0 (#2791)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-22 10:33:16 +01:00
4b8fe44c08 fix: add shim for vim.uv just in case someone upgrades lazyvim before lazy 2024-03-22 10:30:35 +01:00
69aedc2657 fix(cmake): lazy load cmake-tools. Fixes #2767 2024-03-22 10:23:09 +01:00
1c13a5c10b feat(telescope-fzf-native): added support for building with cmake. Fixes #2132 2024-03-22 10:00:22 +01:00
8d31bf230c fix(java): dont error when not using cmp. Fixes #2038 2024-03-22 09:54:24 +01:00
3d4ab4eb26 feat(lazyterm): optional shell setup, mainly for pwsh. Fixes #2151 2024-03-22 09:49:07 +01:00
7a5dbeae75 feat: use LazyVim everywhere instead of require("lazyvim.util") 2024-03-22 09:15:09 +01:00
3a87c08cda feat: use vim.uv everywhere instead of vim.loop 2024-03-22 09:02:34 +01:00
7f333f006f chore(build): auto-generate vimdoc 2024-03-22 06:18:48 +00:00
213493e766 fix(format): Don't leak bufnr into opts tables (#2794) 2024-03-22 07:18:15 +01:00
70bc880330 chore(build): auto-generate vimdoc 2024-03-21 13:51:23 +00:00
4187417158 fix(python): basedpyright is now supported by mason-lspconfig 2024-03-20 22:25:59 +01:00
6e57e86c99 feat: added LazyVim global. Will refactor specs later to use that 2024-03-20 17:26:50 +01:00
1661759d33 fix(util.telescope): make show_untracked configurable (#2789) 2024-03-20 17:25:39 +01:00
642bcf168b chore(main): release 10.15.0 (#2790)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-20 17:19:56 +01:00
f6db6054e3 chore(build): auto-generate vimdoc 2024-03-20 16:18:58 +00:00
f055265bff feat(python): added option to configure basedpyright as lsp. Check the python extra docs. Fixes #2787 2024-03-20 17:18:11 +01:00
fa0e538838 fix(lsp): dont auto install disabled lsp servers 2024-03-20 14:13:28 +01:00
1432f318b6 chore(main): release 10.14.0 (#2741)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-19 22:44:49 +01:00
f655139281 feat(mini.ai): add more objects d,e,g,u,U (#2769) 2024-03-19 22:31:00 +01:00
52ee7ef696 fix(format): format injected langs does not wait 300ms (#2737) 2024-03-19 22:29:56 +01:00
ed44b246b4 feat(lualine): add modified_sign to pretty_path (#2754)
Closes #2752

I left the initial text blank on purpose, so that it doesn't change
anything stylistically and let the user decide what he wants to add
in his personal configuration for `lualine` spec.
2024-03-19 22:28:31 +01:00
6a37171df6 fix(extras): accept symlinks in User extras directory (#2745) 2024-03-19 22:28:00 +01:00
b8c6d87825 chore(build): auto-generate vimdoc 2024-03-19 21:02:56 +00:00
393a9c7c7a fix(neotest): add required nvim-nio to test and dap extra (neotest and nvim-dap-ui respectively) (#2763)
* Adding required nvim-nio to neotest in test-core

neotest now requires nvim-neotest/nvim-nio to be
installed as per BREAKING CHANGE: https://github.com/nvim-neotest/neotest/pull/337

* Adding nvim-nio as dependency

nvim-dap-ui now requires  nvim-neotest/nvim-nio as a dependency as of recent changes
2024-03-19 22:02:22 +01:00
e1d39b624f chore(build): auto-generate vimdoc 2024-03-18 10:24:36 +00:00
d8d380a60e fix(lazygit): make sure we start lazygit in a valid git root 2024-03-18 11:23:55 +01:00
864c58cae6 chore(build): auto-generate vimdoc 2024-03-15 17:02:05 +00:00
42a7e79d5a fix(git): use compatible function for windows and linux (#2740) 2024-03-15 18:01:33 +01:00
0107a1079b chore(main): release 10.13.0 (#2684)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-14 17:16:28 +01:00
623297efa6 fix(which-key): add group description for folds (#2496)
Signed-off-by: Jeff Davis <mr.jefedavis@gmail.com>
2024-03-14 17:12:47 +01:00
991523431f fix(mini.files): description for g. keybinding in mini.files (#2693)
If you press `g` in a mini.files menu, the `.` key shows up but doesn't have a description. This adds a desc attribute to the binding so the menu shows a correct description.
2024-03-14 17:12:23 +01:00
843032ef1c fix(markdown): disable headlines.nvim bullets for now 2024-03-14 16:53:00 +01:00
0ba731a879 fix(markdown): disable headlines.nvim in insert mode. Fixes #2717 2024-03-14 16:39:23 +01:00
98c8226e21 chore(build): auto-generate vimdoc 2024-03-14 13:15:16 +00:00
afca0b7876 fix(conform): make lsp_fallback option user configurable (#2616) 2024-03-14 14:14:41 +01:00
2a666ac5f2 fix(rust): don't overwrite vim.g.rustaceanvim if it is defined (#2720) 2024-03-14 00:07:40 +01:00
d2f7cb0462 chore(build): auto-generate vimdoc 2024-03-13 23:07:24 +00:00
0ec7a9040b feat(git): add <leader>gf for lazygit commit history on current file (#2728)
* Add <leader>gf for lazygit commit history on current file

* Change root dir to git root using git command

* refactor: cleanup

---------

Co-authored-by: Uthman Mohamed <83053931+1239uth@users.noreply.github.com>
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-03-14 00:06:47 +01:00
cca2e09149 chore(build): auto-generate vimdoc 2024-03-11 22:14:34 +00:00
1c9f4160a2 fix(options): dont set clipboard in an SSH session, so that OSC52 can be enabled (when supported) 2024-03-11 23:13:51 +01:00
78e6405f90 chore(build): auto-generate vimdoc 2024-03-10 08:46:17 +00:00
d3761eded7 feat(lualine): add more hl options to pretty_path (#2687)
* feat(lualine): add more hl options to pretty_path

Adds two additional options to pretty_path: filename_hl and dirpath_hl.

This allows users to customize the highlight group of both the directory
component of the path name and the filenname independently. modified_hl
is still used when the buffer has been modified.

Thanks to dpetka2001 (Iordanis Petkakis) for the changes to the format
function.

* feat: cleanup

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-03-10 09:45:40 +01:00
aa9fb1fd23 chore(build): auto-generate vimdoc 2024-03-09 08:00:17 +00:00
b12e742458 fix(terraform-extra): Drop unnecessary commentstring config for terraform (#2680)
* fix(terraform-extra): Drop unnecessary commentstring config for terraform

The commentstring for terraform and hcl files is now handled by nvim-ts-context-commentstring:

JoosepAlviste/nvim-ts-context-commentstring#94

* Fixed terraform.lua issues. I'm bad.
2024-03-09 08:59:44 +01:00
e3bfcb9bf7 chore(main): release 10.12.1 (#2677)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-08 11:55:40 +01:00
935bc2283f fix(extras): prevent duplicate extra imports 2024-03-08 11:51:18 +01:00
ee2e876252 fix(extras): automatically rename extra symbols-outline => outline. Fixes #2675 2024-03-08 11:47:17 +01:00
7415231855 fix(hi-patterns): correct regex for shorthand hex colors. See ##2562 2024-03-08 11:31:45 +01:00
166942251d chore(build): auto-generate vimdoc 2024-03-08 10:23:09 +00:00
04bc5718a5 fix(haskell): Make Haskell-snippets lazy load for performance (#2676)
* fix(haskell): add filetype to haskell-snippets for lazy load

* format haskell.lua

---------

Co-authored-by: Uthman Mohamed <83053931+1239uth@users.noreply.github.com>
2024-03-08 11:22:36 +01:00
c0ad2209b6 chore(main): release 10.12.0 (#2667)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-07 20:45:12 +01:00
4745314074 fix(extras): set correct priority for outline extra. Fixes #2666 2024-03-07 20:43:13 +01:00
139c41c18e feat(lang): replace rust-tools.nvim with rustacean.nvim #2198
dummy commit to trigger changelog.
original commit message was not correct and didnt get picked up by the changelog
2024-03-07 20:41:12 +01:00
5cabc2ff5b chore(main): release 10.11.1 (#2664)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-07 19:04:38 +01:00
c6736ef2b8 fix(extras): show rename of symbols-outline => outline 2024-03-07 18:59:14 +01:00
8ade97a42c chore(main): release 10.11.0 (#2659)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-07 17:51:41 +01:00
8386d23c81 fix(util): clear buffer root cache when cwd change (#2502) 2024-03-07 17:49:39 +01:00
e8e7d22f56 fix(go): adding opts recursive_run (#2520)
Adding opts recursive_run to fix the error 'no Go files in /path/project.' This issue is caused by a recent change in the 'nvim-neotest/neotest-go' project, which now [defaults to non-recursive behavior](https://github.com/nvim-neotest/neotest-go/pull/72)
2024-03-07 17:49:06 +01:00
a7c16f8efd feat(java): allow opts for setup_dap_main_class_configs() (#2581)
[1] 382b9f6258/doc/jdtls.txt (L206-L210)
2024-03-07 17:48:00 +01:00
780b9bb337 feat(lsp): added native codelens support. Enable in lsp settings. (disabled by default). Fixes #2656 2024-03-07 17:04:18 +01:00
b2a0ae6d0d fix(ansible): incorrect key spec 2024-03-07 16:41:03 +01:00
ed135e6ffd fix(lang): Change rustacean keymaps to vim.keymap.set instead of which-key (#2660)
Based on this [comment](https://github.com/LazyVim/LazyVim/pull/2198#pullrequestreview-1873658780).
2024-03-07 16:34:49 +01:00
66b3c0a19f feat(ui): dashboard files searches git files if in git repo (#2240)
just like `<leader>ff` keymap for telescope
2024-03-07 12:11:26 +01:00
cae22baf08 feat(extras): add harpoon2 (#2455)
* feat(extras): add harpoon2

* Update lua/lazyvim/plugins/extras/editor/harpoon2.lua

Co-authored-by: Iordanis Petkakis <dpetka2001@gmail.com>

* chore: formatting

---------

Co-authored-by: Iordanis Petkakis <dpetka2001@gmail.com>
2024-03-07 12:07:38 +01:00
21ca466db1 feat(autocmds): added support for copy/paste through ssh. Needs Neovim >= 0.10.0 2024-03-07 12:04:41 +01:00
41e60af52c style: formatting 2024-03-07 12:00:44 +01:00
d57817d79b feat(lang): add telescope terraform integrations (#2235)
* feat(lang): add telescope terraform integrations

Closes #2234

Add telescope integrations for:
- https://github.com/ANGkeith/telescope-terraform-doc.nvim
- https://github.com/cappyzawa/telescope-terraform.nvim

* fix(lang): remove event from terraform telescope extensions
2024-03-07 11:59:38 +01:00
b949835de5 feat(extras): Enable project-specific plugin specs using local .lazy.lua (#2115)
* feat(extras): Enable project-specific plugin specs using .lazy.lua

* added a warning when extra lazyrc is not the last plugin spec
2024-03-07 11:58:50 +01:00
5012d7d839 fix(util.ui.fg): Add link=false to show effective definition (#2542)
Fixes #2540 by showing the effective definition instead of the linked
group name.
2024-03-07 11:57:03 +01:00
f23d3cee42 feat(omnisharp): add nvim-dap configuration (#2532)
* feat(omnisharp): add `nvim-dap` configuration

* chore(omnisharp): add `netcoredbg` to `ensure_installed`

* chore: simplify get `netcoredbg` path
2024-03-07 11:56:27 +01:00
de01a37cb6 feat(lang): add support for helm chart templates (#2273)
* feat(lang): add support for helm chart templates

* fix(helm): stop yamlls and disable autostart

* fix(helm): stop yaml & docker compose lsp on helm file types

Revert disabling `autostart` since that kills the LSP globally even when
opening a standard yaml file, like GitHub Workflow file.

* fix(helm): remove docker compose lsp overrides

Since docker compose LSP does not seem to be triggered or started by
opening *.yaml helm files, the config overrides were removed to simplify
Helm config.

* fix(helm): ensure mason installs helm lsp
2024-03-07 11:55:58 +01:00
d2502613ff feat(extras): Add scala support using nvim-metals (#1347)
* Add scala support using nvim-metals

nvim-metals:
https://github.com/scalameta/nvim-metals

minimal example configuration from their documentation:
https://github.com/scalameta/nvim-metals/discussions/39

* add treesitter syntax highlighting
2024-03-07 11:54:16 +01:00
a48b14eb3e feat(symbols-outline): use outline.nvim instead of symbols-outline.nvim (#2535) 2024-03-07 11:53:06 +01:00
40a75e82f7 feat(util) create gitui extension (#2238) 2024-03-07 11:51:48 +01:00
c6c584f7c3 feat(lang): add Haskell config (#2052) 2024-03-07 11:51:08 +01:00
36ae4213b8 fix(telescope): anonymous keymap (#1879)
* fix(telescope): anonymous keymap

* fix(telescope): add desc

* fix(telescope): function name

* fix(telescope): update description

* fix(telescope): diagnostic disable
2024-03-07 11:49:50 +01:00
ddbba85408 chore(treesitter.lua): fix typo (#2026)
* fix typo

* fix typo
2024-03-07 11:48:37 +01:00
1b0b899ab3 feat(treesitter): add xml to ensure_installed (#1962) 2024-03-07 11:47:45 +01:00
b7da44caae feat(lang): add ansible support (#1218) 2024-03-07 11:46:33 +01:00
e7a58d9484 fix(telescope): dont use git_files when .ignore or .rgignore file is present 2024-03-07 11:43:22 +01:00
66bf7525e3 feat(lang) replace rust-tools.nvim with rustacean.nvim - fixes #2113 (#2198)
* feat(lang) - move to rustacean.nvim, fixes #2113

* update rustacean plugin

* PR comment for lsp settings
2024-03-07 11:42:23 +01:00
a8eeb1b75d feat(hipatterns): add shorthand hex color support (#2562) 2024-03-07 11:41:34 +01:00
d9f5e6db16 fix(yanky): properly disable sqlite.lua on Windows (#2543)
When directly modifying its `enabled` property, the plugin will remain
disabled even if required by another plugin.
2024-03-07 11:40:51 +01:00
29ed06e000 fix(options): don't lower timeoutlen when in VS Code (#2568)
Avoid lowering timeoutlen when running in VS Code, to avoid
unwanted timeouts from key mappings.

The lower value of 300ms (down from Neovim's default of 1000ms)
works great outside of VS Code, where it helps trigger the which-key UI
quickly, and where which-key prevents timeouts from occuring.

But in VS Code (where which-key isn't applicable), the lower value
makes it difficult to perform some key mappings in time,
such as `]p`, which requires shifting hand position.
2024-03-07 11:39:57 +01:00
16d6ac234a fix(autocmds): nvim already binds q to close for man-files (#2594) 2024-03-07 11:38:36 +01:00
1a417430fc fix(neo-tree): Add description to "Y" in Neo-Tree (#2642)
It copies the path of the file/directory
2024-03-07 11:34:20 +01:00
c43afbbdbb chore(build): auto-generate vimdoc 2024-03-07 10:33:56 +00:00
796112e170 fix(dot): remove hyprlang plugin (#2623) 2024-03-07 11:33:22 +01:00
91126b9896 chore(build): auto-generate vimdoc 2024-02-21 07:49:28 +00:00
fe72424e77 chore(main): release 10.10.0 (#2400)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-21 08:48:55 +01:00
a50f92f755 chore(build): auto-generate vimdoc 2024-01-23 06:52:05 +00:00
591f850f8a fix(autocmds): apply conceal level change to local buffer options (#2409) 2024-01-23 07:51:34 +01:00
Yi
54ae77e164 feat(telescope): add <leader>fg for finding files using git-files (#2353)
I found this to be more useful than the current <leader>ff and <leader>fF
2024-01-22 11:58:51 +01:00
7f9219162b feat(snippets): added extra to use native snippets instead of LuaSnip. 2024-01-22 08:39:07 +01:00
d9287391b7 feat: added LazyHealth that loads all plugins and runs :checkhealth 2024-01-22 08:03:15 +01:00
f799b39eaf fix(rust): avoid resetting cmp group_index to 1 (#2332)
For example, 'buffer' source by default has group_index = 2 [1], however
if we take all the sources plus crates and run them through
cmp.config.sources() again, since it's a one-dimensional list, all
group_indexes will be reset to 1.

[1] 879e29504d/lua/lazyvim/plugins/coding.lua (L74-L80)
2024-01-22 07:51:19 +01:00
eb2674ce37 chore(build): auto-generate vimdoc 2024-01-22 06:50:15 +00:00
1dffb1d853 fix(hyprlang): use lazyvim way to install (#2404) 2024-01-22 07:49:45 +01:00
eccf3b5e68 fix(neo-tree): better copy file name with Y 2024-01-21 21:32:09 +01:00
93342f15ba feat(toggle): use vim.diagnostic.is_disabled when available (#2217)
* feat(toggle-diagnostics): change logic based on `vim.diagnostic.is_disabled`

After discussion in #2215, I thought maybe it would be beneficial if we
could change the logic of the `toggle-diagnostics` function based on if
the user has disabled diagnostics in his own configuration.

* feat(toggle-diagnostics): revert to `enable` instead of `status`

* fix(toggle): use vim.diagnostics enabled state when possible

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2024-01-21 20:41:11 +01:00
a43d8cf358 fix(options): change default conceal level to 2 (#2053)
3 hides all concealed text, even if there are replacement chars defined

e.g. : for Markdown, 3 hides list item markers, dots for asterisk lists
and em-dashes for dash lists

If replacements are defined as defaults in a plugin, the "Laziest™"
config would seem to be displaying them.

Level 1 only seems useful when alignment really matters.
2024-01-21 20:34:07 +01:00
cbd9d700dc fix(typescript): don't hardcode values in lua table (#2254)
* fix(typescript): don't hardcode values in lua table

When a user changes `vim.opt.shiftwidth` with some auto-command, it's
not taken into account. Make `opts` a function, so that values get
evaluated when `lspconfig` loads instead.

* fix(typescript): remove format settings entirely

* fix(typescript): add back comment and Lua annotations

* fix(typescript): bring back function call completion snippets
2024-01-21 20:28:16 +01:00
8e2046f3d0 fix(autocmds): avoid checktime when buftype=nofile (#2270)
It triggered an 'E11: Invalid in command-line window; <CR> executes,
CTRL-C quits' error when Neovim was in Command Line window and
FocusGained.
2024-01-21 20:20:54 +01:00
c72db4938c docs(README-DE): remove .txt extension (#2321)
Probably some windows editor that added this automatically + known extensions hidden.
2024-01-21 20:18:03 +01:00
37107cf2fc docs: typo in init.lua (#2365) 2024-01-21 20:10:18 +01:00
c433ea7aa8 chore(main): release 10.9.1 (#2399)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-21 20:03:51 +01:00
fbe478ae3f fix: fixup for #2137 2024-01-21 20:02:11 +01:00
adc0b36069 chore(main): release 10.9.0 (#2391)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-01-21 20:00:03 +01:00
5296d42e6a feat(neo-tree): Adds copy file name command to Neo-Tree with 'Y' binding (#2137)
Co-authored-by: Ricardo Rebelo <ricardo.rebelo@siemens.com>
2024-01-21 19:53:57 +01:00
71a73e8334 fix(eslint): correct working directories name (#2071) 2024-01-21 19:53:09 +01:00
fa6158a595 feat(keymaps): add function to toggle between light/dark backgrounds (#2088) 2024-01-21 19:52:36 +01:00
f4ddb16b26 feat(gitsigns): update gitsigns.nvim preview command (#2178)
* chores(format.lua): Fix typo

* Change gitsigns.nvim hunk preview shortcut

Change `preview_hunk` to recently added `preview_hunk_inline` command
2024-01-21 19:49:41 +01:00
b71feb7e45 feat(test): Add <leader>tl to neotest.run_last() (#1968) 2024-01-21 19:37:38 +01:00
33830f1e7d feat(lsp): add diagnostic signs to lsp options (#2192)
Co-authored-by: Gary Murray <gamurray@fanatics.com>
2024-01-21 19:35:24 +01:00
d0120ccdd1 chore(build): auto-generate vimdoc 2024-01-21 10:25:29 +00:00
23fe52acd7 feat(autocmds): dont use conceal for json files 2024-01-21 11:24:59 +01:00
979bb952a6 fix(dot): treesitter for hypr was renamed to hyprlang 2024-01-20 12:50:34 +01:00
879e29504d chore(main): release 10.8.2 (#2097)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-30 21:27:02 +01:00
8baf9b5459 fix(lsp): fix inlay hints for older nightlies. See #2007 2023-11-30 21:24:07 +01:00
6ac331b588 chore(main): release 10.8.1 (#2095)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-30 20:20:39 +01:00
e229988a98 fix(lsp): inlay hints on stable. See #2007 2023-11-30 20:17:07 +01:00
11a8a6bea7 fix(ui): signcolumn signs on nightly. Fixes #2039 2023-11-30 20:17:07 +01:00
4ebda08d49 chore(build): auto-generate vimdoc 2023-11-30 18:54:19 +00:00
6853b785d9 fix(lsp): detect if using nvim-0.10 and use new inlay_hint.enable method (#2007)
* Detect if using nvim 0.10 and use new inlay_hint.enable method

* Add lsp util for inlay-hints and update keymap

* Remove the need to check vim version

* Support older nightly builds

* Move inlay_hint toggle in Util.toggle

---------

Co-authored-by: Gary Murray <gamurray@fanatics.com>
2023-11-30 19:53:40 +01:00
68ff818a5b chore(main): release 10.8.0 (#1874)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-04 11:12:37 +01:00
4312e5e283 feat(catppuccin): enable more integrations (#1922) 2023-11-04 11:09:01 +01:00
db31b4073b chore(build): auto-generate vimdoc 2023-11-04 09:15:11 +00:00
3986169823 fix(spectre): don't build nvim-spectre 2023-11-04 10:14:36 +01:00
e5babf289c chore(build): auto-generate vimdoc 2023-10-28 14:39:26 +00:00
b32b4fd581 fix(extras): dont show extras that give errors (user's extras). Fixes #1895 2023-10-28 16:38:43 +02:00
4b758c40c0 chore(build): auto-generate vimdoc 2023-10-27 16:35:14 +00:00
e01ad513aa fix(sessions): added folds to sessions 2023-10-27 18:34:33 +02:00
7831fc94ca chore(build): auto-generate vimdoc 2023-10-26 05:39:38 +00:00
4558407574 fix(plugin): LazyFile now properly deals with deleted buffers. Fixes #1877 2023-10-26 07:38:53 +02:00
09eafc60ef fix(mini.indentscope): remove duplicated filetype (#1871) 2023-10-25 20:00:01 +02:00
9a6b0f8928 chore(main): release 10.7.1 (#1870)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-25 17:52:35 +02:00
f589154268 fix(catppuccin): trouble integration. Fixes #1872 2023-10-25 17:23:37 +02:00
60e5707013 fix(util): pcall deletion of lazy_file augroup. See #1863 2023-10-25 15:54:35 +02:00
76 changed files with 2164 additions and 601 deletions

File diff suppressed because it is too large Load Diff

33
NEWS.md
View File

@ -2,6 +2,39 @@
## 10.x
- added new extra for [mini.diff](https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-diff.md)
This is a plugin similar to gitsigns but with a neat diff overlay
that can be toggled with `<leader>go`.
- **trouble.nvim** has been rewritten from scratch and is now in beta.
I've added a new extra for it (`trouble-v3`) for those of you who want to try it out.
You can find the updated docs [here](https://github.com/folke/trouble.nvim/tree/dev)
- The **lazygit** integration now configures:
- the theme based on the colorscheme
- nerd font icons (v3)
- editor preset is set to `nvim-remote` for better interop with Neovim
- The option `vim.g.lazygit_theme` was renamed to `vim.g.lazygit_config`
- **lazygit** now automatically uses the colors of your current colorscheme.
This is enabled by default. To disable, add the below to your `options.lua`:
```lua
vim.g.lazygit_config = false
```
- Added support for `basedpyright` to the **python** extra.
Enable in your `options.lua` with:
```lua
vim.g.lazyvim_python_lsp = "basedpyright"
```
Be aware that `basedpyright` is still in development and
may not work exactly the same as `pyright`.
- User extras under `lua/plugins/extras` can now also be managed
with **LazyExtras**

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2023 October 25
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 28
==============================================================================
Table of Contents *LazyVim-table-of-contents*
@ -8,6 +8,7 @@ Table of Contents *LazyVim-table-of-contents*
- Getting Started |LazyVim-getting-started|
- File Structure |LazyVim-file-structure|
- Configuration |LazyVim-configuration|
1. Links |LazyVim-links|
Install
·

View File

@ -7,7 +7,11 @@ end
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
group = augroup("checktime"),
command = "checktime",
callback = function()
if vim.o.buftype ~= "nofile" then
vim.cmd("checktime")
end
end,
})
-- Highlight on yank
@ -53,7 +57,6 @@ vim.api.nvim_create_autocmd("FileType", {
"PlenaryTestPopup",
"help",
"lspinfo",
"man",
"notify",
"qf",
"query",
@ -71,6 +74,15 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
-- make it easier to close man-files when opened inline
vim.api.nvim_create_autocmd("FileType", {
group = augroup("man_unlisted"),
pattern = { "man" },
callback = function(event)
vim.bo[event.buf].buflisted = false
end,
})
-- wrap and check for spell in text filetypes
vim.api.nvim_create_autocmd("FileType", {
group = augroup("wrap_spell"),
@ -81,14 +93,23 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
-- Fix conceallevel for json files
vim.api.nvim_create_autocmd({ "FileType" }, {
group = augroup("json_conceal"),
pattern = { "json", "jsonc", "json5" },
callback = function()
vim.opt_local.conceallevel = 0
end,
})
-- Auto create dir when saving a file, in case some intermediate directory does not exist
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("auto_create_dir"),
callback = function(event)
if event.match:match("^%w%w+://") then
if event.match:match("^%w%w+:[\\/][\\/]") then
return
end
local file = vim.loop.fs_realpath(event.match) or event.match
local file = vim.uv.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end,
})

View File

@ -1,9 +1,9 @@
local Util = require("lazyvim.util")
_G.LazyVim = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions
local M = {}
M.version = "10.7.0" -- x-release-please-version
M.version = "10.20.0" -- x-release-please-version
---@class LazyVimOptions
local defaults = {
@ -131,7 +131,7 @@ local defaults = {
}
M.json = {
version = 2,
version = 3,
data = {
version = nil, ---@type string?
news = {}, ---@type table<string, string>
@ -149,7 +149,7 @@ function M.json.load()
if ok then
M.json.data = vim.tbl_deep_extend("force", M.json.data, json or {})
if M.json.data.version ~= M.json.version then
Util.json.migrate()
LazyVim.json.migrate()
end
end
end
@ -178,18 +178,23 @@ function M.setup(opts)
end
M.load("keymaps")
Util.format.setup()
Util.news.setup()
Util.root.setup()
LazyVim.format.setup()
LazyVim.news.setup()
LazyVim.root.setup()
vim.api.nvim_create_user_command("LazyExtras", function()
Util.extras.show()
LazyVim.extras.show()
end, { desc = "Manage LazyVim extras" })
vim.api.nvim_create_user_command("LazyHealth", function()
vim.cmd([[Lazy! load all]])
vim.cmd([[checkhealth]])
end, { desc = "Load all plugins and run :checkhealth" })
end,
})
Util.track("colorscheme")
Util.try(function()
LazyVim.track("colorscheme")
LazyVim.try(function()
if type(M.colorscheme) == "function" then
M.colorscheme()
else
@ -198,11 +203,11 @@ function M.setup(opts)
end, {
msg = "Could not load your colorscheme",
on_error = function(msg)
Util.error(msg)
LazyVim.error(msg)
vim.cmd.colorscheme("habamax")
end,
})
Util.track()
LazyVim.track()
end
---@param buf? number
@ -216,6 +221,9 @@ function M.get_kind_filter(buf)
if M.kind_filter[ft] == false then
return
end
if type(M.kind_filter[ft]) == "table" then
return M.kind_filter[ft]
end
---@diagnostic disable-next-line: return-type-mismatch
return type(M.kind_filter) == "table" and type(M.kind_filter.default) == "table" and M.kind_filter.default or nil
end
@ -224,7 +232,7 @@ end
function M.load(name)
local function _load(mod)
if require("lazy.core.cache").find(mod)[1] then
Util.try(function()
LazyVim.try(function()
require(mod)
end, { msg = "Failed loading " .. mod })
end
@ -254,19 +262,19 @@ function M.init()
end
package.preload["lazyvim.plugins.lsp.format"] = function()
Util.deprecate([[require("lazyvim.plugins.lsp.format")]], [[require("lazyvim.util").format]])
return Util.format
LazyVim.deprecate([[require("lazyvim.plugins.lsp.format")]], [[LazyVim.format]])
return LazyVim.format
end
-- delay notifications till vim.notify was replaced or after 500ms
require("lazyvim.util").lazy_notify()
LazyVim.lazy_notify()
-- load options here, before lazy init while sourcing plugin modules
-- this is needed to make sure options will be correctly applied
-- after installing missing plugins
M.load("options")
Util.plugin.setup()
LazyVim.plugin.setup()
M.json.load()
end

View File

@ -1,9 +1,8 @@
-- This file is automatically loaded by lazyvim.config.init
local Util = require("lazyvim.util")
-- DO NOT USE THIS IN YOU OWN CONFIG!!
-- use `vim.keymap.set` instead
local map = Util.safe_keymap_set
local map = LazyVim.safe_keymap_set
-- better up/down
map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
@ -12,35 +11,35 @@ map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true
map({ "n", "x" }, "<Up>", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
-- Move to window using the <ctrl> hjkl keys
map("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
map("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
map("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
map("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window", remap = true })
map("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window", remap = true })
map("n", "<C-k>", "<C-w>k", { desc = "Go to Upper Window", remap = true })
map("n", "<C-l>", "<C-w>l", { desc = "Go to Right Window", remap = true })
-- Resize window using <ctrl> arrow keys
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease window height" })
map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window width" })
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
map("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase Window Height" })
map("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease Window Height" })
map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease Window Width" })
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" })
-- Move Lines
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move down" })
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move up" })
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move down" })
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move up" })
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" })
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move Up" })
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" })
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" })
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move Up" })
-- buffers
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next buffer" })
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
map("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next Buffer" })
map("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
map("n", "]b", "<cmd>bnext<cr>", { desc = "Next Buffer" })
map("n", "<leader>bb", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
map("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
-- Clear search with <esc>
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and Clear hlsearch" })
-- Clear search, diff update and redraw
-- taken from runtime/lua/_editor.lua
@ -48,16 +47,16 @@ map(
"n",
"<leader>ur",
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
{ desc = "Redraw / clear hlsearch / diff update" }
{ desc = "Redraw / Clear hlsearch / Diff Update" }
)
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next search result" })
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev search result" })
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
map("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next Search Result" })
map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" })
map("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next Search Result" })
map("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev Search Result" })
map("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" })
map("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev Search Result" })
-- Add undo break-points
map("i", ",", ",<c-g>u")
@ -65,7 +64,7 @@ map("i", ".", ".<c-g>u")
map("i", ";", ";<c-g>u")
-- save file
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
map({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save File" })
--keywordprg
map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
@ -83,12 +82,12 @@ map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
map("n", "[q", vim.cmd.cprev, { desc = "Previous Quickfix" })
map("n", "]q", vim.cmd.cnext, { desc = "Next Quickfix" })
-- formatting
map({ "n", "v" }, "<leader>cf", function()
Util.format({ force = true })
LazyVim.format({ force = true })
end, { desc = "Format" })
-- diagnostic
@ -110,56 +109,62 @@ map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
-- stylua: ignore start
-- toggle options
map("n", "<leader>uf", function() Util.format.toggle() end, { desc = "Toggle auto format (global)" })
map("n", "<leader>uF", function() Util.format.toggle(true) end, { desc = "Toggle auto format (buffer)" })
map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
map("n", "<leader>uL", function() Util.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
map("n", "<leader>ul", function() Util.toggle.number() end, { desc = "Toggle Line Numbers" })
map("n", "<leader>ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
map("n", "<leader>uf", function() LazyVim.format.toggle() end, { desc = "Toggle Auto Format (Global)" })
map("n", "<leader>uF", function() LazyVim.format.toggle(true) end, { desc = "Toggle Auto Format (Buffer)" })
map("n", "<leader>us", function() LazyVim.toggle("spell") end, { desc = "Toggle Spelling" })
map("n", "<leader>uw", function() LazyVim.toggle("wrap") end, { desc = "Toggle Word Wrap" })
map("n", "<leader>uL", function() LazyVim.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
map("n", "<leader>ul", function() LazyVim.toggle.number() end, { desc = "Toggle Line Numbers" })
map("n", "<leader>ud", function() LazyVim.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
if vim.lsp.inlay_hint then
map("n", "<leader>uh", function() vim.lsp.inlay_hint(0, nil) end, { desc = "Toggle Inlay Hints" })
map("n", "<leader>uc", function() LazyVim.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
if vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint then
map( "n", "<leader>uh", function() LazyVim.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" })
end
map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
map("n", "<leader>ub", function() LazyVim.toggle("background", false, {"light", "dark"}) end, { desc = "Toggle Background" })
-- lazygit
map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
map("n", "<leader>gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" })
map("n", "<leader>gf", function()
local git_path = vim.api.nvim_buf_get_name(0)
LazyVim.lazygit({args = { "-f", vim.trim(git_path) }})
end, { desc = "Lazygit Current File History" })
-- quit
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit All" })
-- highlights under cursor
map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
-- LazyVim Changelog
map("n", "<leader>L", function() Util.news.changelog() end, { desc = "LazyVim Changelog" })
map("n", "<leader>L", function() LazyVim.news.changelog() end, { desc = "LazyVim Changelog" })
-- floating terminal
local lazyterm = function() Util.terminal(nil, { cwd = Util.root() }) end
map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
map("n", "<leader>fT", function() Util.terminal() end, { desc = "Terminal (cwd)" })
map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
local lazyterm = function() LazyVim.terminal(nil, { cwd = LazyVim.root() }) end
map("n", "<leader>ft", lazyterm, { desc = "Terminal (Root Dir)" })
map("n", "<leader>fT", function() LazyVim.terminal() end, { desc = "Terminal (cwd)" })
map("n", "<c-/>", lazyterm, { desc = "Terminal (Root Dir)" })
map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
-- Terminal Mappings
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to left window" })
map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to lower window" })
map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to upper window" })
map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to right window" })
map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to Left Window" })
map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to Lower Window" })
map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to Upper Window" })
map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to Right Window" })
map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
-- windows
map("n", "<leader>ww", "<C-W>p", { desc = "Other window", remap = true })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
map("n", "<leader>w-", "<C-W>s", { desc = "Split window below", remap = true })
map("n", "<leader>w|", "<C-W>v", { desc = "Split window right", remap = true })
map("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
map("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
map("n", "<leader>ww", "<C-W>p", { desc = "Other Window", remap = true })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete Window", remap = true })
map("n", "<leader>w-", "<C-W>s", { desc = "Split Window Below", remap = true })
map("n", "<leader>w|", "<C-W>v", { desc = "Split Window Right", remap = true })
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })
map("n", "<leader>|", "<C-W>v", { desc = "Split Window Right", remap = true })
-- tabs
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })

View File

@ -12,12 +12,31 @@ vim.g.autoformat = true
-- * a function with signature `function(buf) -> string|string[]`
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
-- LazyVim automatically configures lazygit:
-- * theme, based on the active colorscheme.
-- * editorPreset to nvim-remote
-- * enables nerd font icons
-- Set to false to disable.
vim.g.lazygit_config = true
-- Optionally setup the terminal to use
-- This sets `vim.o.shell` and does some additional configuration for:
-- * pwsh
-- * powershell
-- LazyVim.terminal.setup("pwsh")
local opt = vim.opt
opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
if not vim.env.SSH_TTY then
-- only set clipboard if not in ssh, to make sure the OSC 52
-- integration works automatically. Requires Neovim >= 0.10.0
opt.clipboard = "unnamedplus" -- Sync with system clipboard
end
opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 3 -- Hide * markup for bold and italic
opt.conceallevel = 2 -- Hide * markup for bold and italic, but not markers with substitutions
opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
@ -34,7 +53,7 @@ opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup
opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 4 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp" }
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" }
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.shortmess:append({ W = true, I = true, c = true, C = true })
@ -49,7 +68,9 @@ opt.splitkeep = "screen"
opt.splitright = true -- Put new windows right of current
opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support
opt.timeoutlen = 300
if not vim.g.vscode then
opt.timeoutlen = 300 -- Lower than default (1000) to quickly trigger which-key
end
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold
@ -60,7 +81,6 @@ opt.wrap = false -- Disable line wrap
opt.fillchars = {
foldopen = "",
foldclose = "",
-- fold = "⸱",
fold = " ",
foldsep = " ",
diff = "",
@ -73,16 +93,18 @@ end
-- Folding
vim.opt.foldlevel = 99
vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
if vim.fn.has("nvim-0.9.0") == 1 then
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util'.ui.statuscolumn()]]
vim.opt.foldtext = "v:lua.require'lazyvim.util'.ui.foldtext()"
end
-- HACK: causes freezes on <= 0.9, so only enable on >= 0.10 for now
if vim.fn.has("nvim-0.10") == 1 then
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "v:lua.require'lazyvim.util'.ui.foldexpr()"
vim.opt.foldtext = ""
vim.opt.fillchars = "fold: "
else
vim.opt.foldmethod = "indent"
end

View File

@ -1,3 +1,5 @@
vim.uv = vim.uv or vim.loop
local M = {}
---@param opts? LazyVimConfig

View File

@ -1,35 +1,5 @@
return {
-- snippets
{
"L3MON4D3/LuaSnip",
build = (not jit.os:find("Windows"))
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil,
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true, silent = true, mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
},
-- auto completion
{
"hrsh7th/nvim-cmp",
@ -39,21 +9,26 @@ return {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"saadparwaiz1/cmp_luasnip",
},
-- Not all LSP servers add brackets when completing a function.
-- To better deal with this, LazyVim adds a custom option to cmp,
-- that you can configure. For example:
--
-- ```lua
-- opts = {
-- auto_brackets = { "python" }
-- }
-- ```
opts = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
local cmp = require("cmp")
local defaults = require("cmp.config.default")()
return {
auto_brackets = {}, -- configure any filetype to auto add brackets
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
@ -73,7 +48,6 @@ return {
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "path" },
}, {
{ name = "buffer" },
@ -95,15 +69,74 @@ return {
sorting = defaults.sorting,
}
end,
---@param opts cmp.ConfigSchema
---@param opts cmp.ConfigSchema | {auto_brackets?: string[]}
config = function(_, opts)
for _, source in ipairs(opts.sources) do
source.group_index = source.group_index or 1
end
require("cmp").setup(opts)
local cmp = require("cmp")
local Kind = cmp.lsp.CompletionItemKind
cmp.setup(opts)
cmp.event:on("confirm_done", function(event)
if not vim.tbl_contains(opts.auto_brackets or {}, vim.bo.filetype) then
return
end
local entry = event.entry
local item = entry:get_completion_item()
if vim.tbl_contains({ Kind.Function, Kind.Method }, item.kind) then
local keys = vim.api.nvim_replace_termcodes("()<left>", false, false, true)
vim.api.nvim_feedkeys(keys, "i", true)
end
end)
end,
},
-- snippets
{
"L3MON4D3/LuaSnip",
build = (not LazyVim.is_win())
and "echo 'NOTE: jsregexp is optional, so not a big deal if it fails to build'; make install_jsregexp"
or nil,
dependencies = {
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
{
"nvim-cmp",
dependencies = {
"saadparwaiz1/cmp_luasnip",
},
opts = function(_, opts)
opts.snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
}
table.insert(opts.sources, { name = "luasnip" })
end,
},
},
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true, silent = true, mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
},
-- auto pairs
{
"echasnovski/mini.pairs",
@ -113,15 +146,14 @@ return {
{
"<leader>up",
function()
local Util = require("lazy.core.util")
vim.g.minipairs_disable = not vim.g.minipairs_disable
if vim.g.minipairs_disable then
Util.warn("Disabled auto pairs", { title = "Option" })
LazyVim.warn("Disabled auto pairs", { title = "Option" })
else
Util.info("Enabled auto pairs", { title = "Option" })
LazyVim.info("Enabled auto pairs", { title = "Option" })
end
end,
desc = "Toggle auto pairs",
desc = "Toggle Auto Pairs",
},
},
},
@ -137,12 +169,12 @@ return {
local plugin = require("lazy.core.config").spec.plugins["mini.surround"]
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
local mappings = {
{ opts.mappings.add, desc = "Add surrounding", mode = { "n", "v" } },
{ opts.mappings.delete, desc = "Delete surrounding" },
{ opts.mappings.find, desc = "Find right surrounding" },
{ opts.mappings.find_left, desc = "Find left surrounding" },
{ opts.mappings.highlight, desc = "Highlight surrounding" },
{ opts.mappings.replace, desc = "Replace surrounding" },
{ opts.mappings.add, desc = "Add Surrounding", mode = { "n", "v" } },
{ opts.mappings.delete, desc = "Delete Surrounding" },
{ opts.mappings.find, desc = "Find Right Surrounding" },
{ opts.mappings.find_left, desc = "Find Left Surrounding" },
{ opts.mappings.highlight, desc = "Highlight Surrounding" },
{ opts.mappings.replace, desc = "Replace Surrounding" },
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
}
mappings = vim.tbl_filter(function(m)
@ -203,13 +235,33 @@ return {
f = ai.gen_spec.treesitter({ a = "@function.outer", i = "@function.inner" }, {}),
c = ai.gen_spec.treesitter({ a = "@class.outer", i = "@class.inner" }, {}),
t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" },
d = { "%f[%d]%d+" }, -- digits
e = { -- Word with case
{
"%u[%l%d]+%f[^%l%d]",
"%f[%S][%l%d]+%f[^%l%d]",
"%f[%P][%l%d]+%f[^%l%d]",
"^[%l%d]+%f[^%l%d]",
},
"^().*()$",
},
g = function() -- Whole buffer, similar to `gg` and 'G' motion
local from = { line = 1, col = 1 }
local to = {
line = vim.fn.line("$"),
col = math.max(vim.fn.getline("$"):len(), 1),
}
return { from = from, to = to }
end,
u = ai.gen_spec.function_call(), -- u for "Usage"
U = ai.gen_spec.function_call({ name_pattern = "[%w_]" }), -- without dot in function name
},
}
end,
config = function(_, opts)
require("mini.ai").setup(opts)
-- register all text objects with which-key
require("lazyvim.util").on_load("which-key.nvim", function()
LazyVim.on_load("which-key.nvim", function()
---@type table<string, string|table>
local i = {
[" "] = "Whitespace",
@ -229,10 +281,15 @@ return {
a = "Argument",
b = "Balanced ), ], }",
c = "Class",
d = "Digit(s)",
e = "Word in CamelCase & snake_case",
f = "Function",
g = "Entire file",
o = "Block, conditional, loop",
q = "Quote `, \", '",
t = "Tag",
u = "Use/call function & method",
U = "Use/call without dot in name",
}
local a = vim.deepcopy(i)
for k, v in pairs(a) do

View File

@ -14,15 +14,19 @@ return {
name = "catppuccin",
opts = {
integrations = {
aerial = true,
alpha = true,
cmp = true,
dashboard = true,
flash = true,
gitsigns = true,
headlines = true,
illuminate = true,
indent_blankline = { enabled = true },
leap = true,
lsp_trouble = true,
trouble = true,
mason = true,
markdown = true,
mini = true,
native_lsp = {
enabled = true,
@ -35,12 +39,13 @@ return {
},
navic = { enabled = true, custom_bg = "lualine" },
neotest = true,
neotree = true,
noice = true,
notify = true,
neotree = true,
semantic_tokens = true,
telescope = true,
treesitter = true,
treesitter_context = true,
which_key = true,
},
},

View File

@ -1,5 +1,3 @@
local Util = require("lazyvim.util")
return {
-- file explorer
@ -11,32 +9,32 @@ return {
{
"<leader>fe",
function()
require("neo-tree.command").execute({ toggle = true, dir = Util.root() })
require("neo-tree.command").execute({ toggle = true, dir = LazyVim.root() })
end,
desc = "Explorer NeoTree (root dir)",
desc = "Explorer NeoTree (Root Dir)",
},
{
"<leader>fE",
function()
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() })
end,
desc = "Explorer NeoTree (cwd)",
},
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (Root Dir)", remap = true },
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
{
"<leader>ge",
function()
require("neo-tree.command").execute({ source = "git_status", toggle = true })
end,
desc = "Git explorer",
desc = "Git Explorer",
},
{
"<leader>be",
function()
require("neo-tree.command").execute({ source = "buffers", toggle = true })
end,
desc = "Buffer explorer",
desc = "Buffer Explorer",
},
},
deactivate = function()
@ -44,7 +42,7 @@ return {
end,
init = function()
if vim.fn.argc(-1) == 1 then
local stat = vim.loop.fs_stat(vim.fn.argv(0))
local stat = vim.uv.fs_stat(vim.fn.argv(0))
if stat and stat.type == "directory" then
require("neo-tree")
end
@ -61,6 +59,20 @@ return {
window = {
mappings = {
["<space>"] = "none",
["Y"] = {
function(state)
local node = state.tree:get_node()
local path = node:get_id()
vim.fn.setreg("+", path, "c")
end,
desc = "Copy Path to Clipboard",
},
["O"] = {
function(state)
require("lazy.util").open(state.tree:get_node().path, { system = true })
end,
desc = "Open with System Application",
},
},
},
default_component_configs = {
@ -74,7 +86,7 @@ return {
},
config = function(_, opts)
local function on_move(data)
Util.lsp.on_rename(data.source, data.destination)
LazyVim.lsp.on_rename(data.source, data.destination)
end
local events = require("neo-tree.events")
@ -98,11 +110,12 @@ return {
-- search/replace in multiple files
{
"nvim-pack/nvim-spectre",
build = false,
cmd = "Spectre",
opts = { open_cmd = "noswapfile vnew" },
-- stylua: ignore
keys = {
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in files (Spectre)" },
{ "<leader>sr", function() require("spectre").open() end, desc = "Replace in Files (Spectre)" },
},
},
@ -117,10 +130,11 @@ return {
dependencies = {
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
enabled = vim.fn.executable("make") == 1,
build = vim.fn.executable("make") == 1 and "make"
or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
enabled = vim.fn.executable("make") == 1 or vim.fn.executable("cmake") == 1,
config = function()
Util.on_load("telescope.nvim", function()
LazyVim.on_load("telescope.nvim", function()
require("telescope").load_extension("fzf")
end)
end,
@ -132,29 +146,30 @@ return {
"<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>",
desc = "Switch Buffer",
},
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
{ "<leader>/", LazyVim.telescope("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
{ "<leader><space>", LazyVim.telescope("files"), desc = "Find Files (Root Dir)" },
-- find
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
{ "<leader>fc", Util.telescope.config_files(), desc = "Find Config File" },
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
{ "<leader>fc", LazyVim.telescope.config_files(), desc = "Find Config File" },
{ "<leader>ff", LazyVim.telescope("files"), desc = "Find Files (Root Dir)" },
{ "<leader>fF", LazyVim.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
{ "<leader>fg", "<cmd>Telescope git_files<cr>", desc = "Find Files (git-files)" },
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
{ "<leader>fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" },
{ "<leader>fR", LazyVim.telescope("oldfiles", { cwd = vim.uv.cwd() }), desc = "Recent (cwd)" },
-- git
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "Commits" },
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "Status" },
-- search
{ '<leader>s"', "<cmd>Telescope registers<cr>", desc = "Registers" },
{ "<leader>sa", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader>sC", "<cmd>Telescope commands<cr>", desc = "Commands" },
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document diagnostics" },
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace diagnostics" },
{ "<leader>sg", Util.telescope("live_grep"), desc = "Grep (root dir)" },
{ "<leader>sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document Diagnostics" },
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace Diagnostics" },
{ "<leader>sg", LazyVim.telescope("live_grep"), desc = "Grep (Root Dir)" },
{ "<leader>sG", LazyVim.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
{ "<leader>sH", "<cmd>Telescope highlights<cr>", desc = "Search Highlight Groups" },
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
@ -162,11 +177,11 @@ return {
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
{ "<leader>so", "<cmd>Telescope vim_options<cr>", desc = "Options" },
{ "<leader>sR", "<cmd>Telescope resume<cr>", desc = "Resume" },
{ "<leader>sw", Util.telescope("grep_string", { word_match = "-w" }), desc = "Word (root dir)" },
{ "<leader>sW", Util.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" },
{ "<leader>sw", Util.telescope("grep_string"), mode = "v", desc = "Selection (root dir)" },
{ "<leader>sW", Util.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" },
{ "<leader>uC", Util.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" },
{ "<leader>sw", LazyVim.telescope("grep_string", { word_match = "-w" }), desc = "Word (Root Dir)" },
{ "<leader>sW", LazyVim.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" },
{ "<leader>sw", LazyVim.telescope("grep_string"), mode = "v", desc = "Selection (Root Dir)" },
{ "<leader>sW", LazyVim.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" },
{ "<leader>uC", LazyVim.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with Preview" },
{
"<leader>ss",
function()
@ -198,12 +213,12 @@ return {
local find_files_no_ignore = function()
local action_state = require("telescope.actions.state")
local line = action_state.get_current_line()
Util.telescope("find_files", { no_ignore = true, default_text = line })()
LazyVim.telescope("find_files", { no_ignore = true, default_text = line })()
end
local find_files_with_hidden = function()
local action_state = require("telescope.actions.state")
local line = action_state.get_current_line()
Util.telescope("find_files", { hidden = true, default_text = line })()
LazyVim.telescope("find_files", { hidden = true, default_text = line })()
end
return {
@ -267,7 +282,7 @@ return {
"nvim-telescope/telescope.nvim",
optional = true,
opts = function(_, opts)
if not Util.has("flash.nvim") then
if not LazyVim.has("flash.nvim") then
return
end
local function flash(prompt_bufnr)
@ -305,6 +320,7 @@ return {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gs"] = { name = "+surround" },
["z"] = { name = "+fold" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader><tab>"] = { name = "+tabs" },
@ -357,7 +373,7 @@ return {
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
map("n", "<leader>ghp", gs.preview_hunk, "Preview Hunk")
map("n", "<leader>ghp", gs.preview_hunk_inline, "Preview Hunk Inline")
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
map("n", "<leader>ghd", gs.diffthis, "Diff This")
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
@ -456,7 +472,7 @@ return {
end
end
end,
desc = "Previous trouble/quickfix item",
desc = "Previous Trouble/Quickfix Item",
},
{
"]q",
@ -470,7 +486,7 @@ return {
end
end
end,
desc = "Next trouble/quickfix item",
desc = "Next Trouble/Quickfix Item",
},
},
},
@ -484,8 +500,8 @@ return {
config = true,
-- stylua: ignore
keys = {
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next Todo Comment" },
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous Todo Comment" },
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },

View File

@ -27,7 +27,7 @@ return {
optional = true,
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("codeium"))
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("codeium"))
end,
},
}

View File

@ -19,12 +19,11 @@ return {
optional = true,
event = "VeryLazy",
opts = function(_, opts)
local Util = require("lazyvim.util")
local colors = {
[""] = Util.ui.fg("Special"),
["Normal"] = Util.ui.fg("Special"),
["Warning"] = Util.ui.fg("DiagnosticError"),
["InProgress"] = Util.ui.fg("DiagnosticWarn"),
[""] = LazyVim.ui.fg("Special"),
["Normal"] = LazyVim.ui.fg("Special"),
["Warning"] = LazyVim.ui.fg("DiagnosticError"),
["InProgress"] = LazyVim.ui.fg("DiagnosticWarn"),
}
table.insert(opts.sections.lualine_x, 2, {
function()
@ -36,7 +35,7 @@ return {
if not package.loaded["copilot"] then
return
end
local ok, clients = pcall(require("lazyvim.util").lsp.get_clients, { name = "copilot", bufnr = 0 })
local ok, clients = pcall(LazyVim.lsp.get_clients, { name = "copilot", bufnr = 0 })
if not ok then
return false
end
@ -66,7 +65,7 @@ return {
copilot_cmp.setup(opts)
-- attach cmp source whenever copilot attaches
-- fixes lazy-loading issues with the copilot cmp source
require("lazyvim.util").lsp.on_attach(function(client)
LazyVim.lsp.on_attach(function(client)
if client.name == "copilot" then
copilot_cmp._on_insert_enter({})
end

View File

@ -0,0 +1,59 @@
return {
desc = "Use native snippets instead of LuaSnip. Only works on Neovim >= 0.10!",
{
"L3MON4D3/LuaSnip",
enabled = false,
},
{
"nvim-cmp",
opts = {
snippet = {
expand = function(args)
vim.snippet.expand(args.body)
end,
},
},
keys = {
{
"<Tab>",
function()
if vim.snippet.jumpable(1) then
vim.schedule(function()
vim.snippet.jump(1)
end)
return
end
return "<Tab>"
end,
expr = true,
silent = true,
mode = "i",
},
{
"<Tab>",
function()
vim.schedule(function()
vim.snippet.jump(1)
end)
end,
silent = true,
mode = "s",
},
{
"<S-Tab>",
function()
if vim.snippet.jumpable(-1) then
vim.schedule(function()
vim.snippet.jump(-1)
end)
return
end
return "<S-Tab>"
end,
expr = true,
silent = true,
mode = { "i", "s" },
},
},
},
}

View File

@ -1,5 +1,3 @@
local Util = require("lazyvim.util")
return {
-- Tabnine cmp source
{
@ -8,7 +6,7 @@ return {
{
"tzachar/cmp-tabnine",
build = {
Util.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
LazyVim.is_win() and "pwsh -noni .\\install.ps1" or "./install.sh",
":CmpTabnineHub",
},
dependencies = "hrsh7th/nvim-cmp",
@ -30,7 +28,7 @@ return {
priority = 100,
})
opts.formatting.format = Util.inject.args(opts.formatting.format, function(entry, item)
opts.formatting.format = LazyVim.inject.args(opts.formatting.format, function(entry, item)
-- Hide percentage in the menu
if entry.source.name == "cmp_tabnine" then
item.menu = ""
@ -45,7 +43,7 @@ return {
event = "VeryLazy",
opts = function(_, opts)
local icon = require("lazyvim.config").icons.kinds.TabNine
table.insert(opts.sections.lualine_x, 2, require("lazyvim.util").lualine.cmp_source("cmp_tabnine", icon))
table.insert(opts.sections.lualine_x, 2, LazyVim.lualine.cmp_source("cmp_tabnine", icon))
end,
},
}

View File

@ -2,31 +2,31 @@ return {
-- better yank/paste
{
"gbprod/yanky.nvim",
dependencies = { { "kkharji/sqlite.lua", enabled = not jit.os:find("Windows") } },
dependencies = not LazyVim.is_win() and { "kkharji/sqlite.lua" } or {},
opts = {
highlight = { timer = 250 },
ring = { storage = jit.os:find("Windows") and "shada" or "sqlite" },
ring = { storage = LazyVim.is_win() and "shada" or "sqlite" },
},
keys = {
-- stylua: ignore
{ "<leader>p", function() require("telescope").extensions.yank_history.yank_history({ }) end, desc = "Open Yank History" },
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank text" },
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after cursor" },
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before cursor" },
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put yanked text after selection" },
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put yanked text before selection" },
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle forward through yank history" },
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle backward through yank history" },
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" },
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" },
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" },
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" },
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put after applying a filter" },
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put before applying a filter" },
{ "y", "<Plug>(YankyYank)", mode = { "n", "x" }, desc = "Yank Text" },
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Cursor" },
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Cursor" },
{ "gp", "<Plug>(YankyGPutAfter)", mode = { "n", "x" }, desc = "Put Yanked Text After Selection" },
{ "gP", "<Plug>(YankyGPutBefore)", mode = { "n", "x" }, desc = "Put Yanked Text Before Selection" },
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle Forward Through Yank History" },
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle Backward Through Yank History" },
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put Indented After Cursor (Linewise)" },
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put Indented Before Cursor (Linewise)" },
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and Indent Right" },
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and Indent Left" },
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put Before and Indent Right" },
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put Before and Indent Left" },
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put After Applying a Filter" },
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put Before Applying a Filter" },
},
},
}

View File

@ -18,6 +18,7 @@ return {
-- fancy UI for the debugger
{
"rcarriga/nvim-dap-ui",
dependencies = { "nvim-neotest/nvim-nio" },
-- stylua: ignore
keys = {
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
@ -89,7 +90,7 @@ return {
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
{ "<leader>dC", function() require("dap").run_to_cursor() end, desc = "Run to Cursor" },
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to line (no execute)" },
{ "<leader>dg", function() require("dap").goto_() end, desc = "Go to Line (No Execute)" },
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },

View File

@ -1,5 +1,4 @@
local Config = require("lazyvim.config")
local Util = require("lazyvim.util")
return {
desc = "Aerial Symbol Browser",
@ -55,7 +54,7 @@ return {
"nvim-telescope/telescope.nvim",
optional = true,
opts = function()
Util.on_load("telescope.nvim", function()
LazyVim.on_load("telescope.nvim", function()
require("telescope").load_extension("aerial")
end)
end,
@ -73,11 +72,11 @@ return {
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
local edgy_idx = Util.plugin.extra_idx("ui.edgy")
local aerial_idx = Util.plugin.extra_idx("editor.aerial")
local edgy_idx = LazyVim.plugin.extra_idx("ui.edgy")
local aerial_idx = LazyVim.plugin.extra_idx("editor.aerial")
if edgy_idx and edgy_idx > aerial_idx then
Util.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", {
LazyVim.warn("The `edgy.nvim` extra must be **imported** before the `aerial.nvim` extra to work properly.", {
title = "LazyVim",
})
end

View File

@ -0,0 +1,171 @@
local M = {}
---@type table<string, table<string, string[]>>
M.dials_by_ft = {}
---@param increment boolean
---@param g? boolean
function M.dial(increment, g)
local is_visual = vim.fn.mode(true):sub(1, 1) == "v"
local func = (increment and "inc" or "dec") .. (g and "_g" or "_") .. (is_visual and "visual" or "normal")
local group = M.dials_by_ft[vim.bo.filetype] or "default"
return require("dial.map")[func](group)
end
return {
"monaqa/dial.nvim",
-- stylua: ignore
keys = {
{ "<C-a>", function() return M.dial(true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
{ "<C-x>", function() return M.dial(false) end, expr = true, desc = "Decrement", mode = {"n", "v"} },
{ "g<C-a>", function() return M.dial(true, true) end, expr = true, desc = "Increment", mode = {"n", "v"} },
{ "g<C-x>", function() return M.dial(false, true) end, expr = true, desc = "Decrement", mode = {"n", "v"} },
},
opts = function()
local augend = require("dial.augend")
local logical_alias = augend.constant.new({
elements = { "&&", "||" },
word = false,
cyclic = true,
})
local ordinal_numbers = augend.constant.new({
-- elements through which we cycle. When we increment, we go down
-- On decrement we go up
elements = {
"first",
"second",
"third",
"fourth",
"fifth",
"sixth",
"seventh",
"eighth",
"ninth",
"tenth",
},
-- if true, it only matches strings with word boundary. firstDate wouldn't work for example
word = false,
-- do we cycle back and forth (tenth to first on increment, first to tenth on decrement).
-- Otherwise nothing will happen when there are no further values
cyclic = true,
})
local weekdays = augend.constant.new({
elements = {
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
},
word = true,
cyclic = true,
})
local months = augend.constant.new({
elements = {
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
},
word = true,
cyclic = true,
})
local capitalized_boolean = augend.constant.new({
elements = {
"True",
"False",
},
word = true,
cyclic = true,
})
return {
dials_by_ft = {
css = "css",
javascript = "typescript",
javascriptreact = "typescript",
json = "json",
lua = "lua",
markdown = "markdown",
python = "python",
sass = "css",
scss = "css",
typescript = "typescript",
typescriptreact = "typescript",
},
groups = {
default = {
augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
},
typescript = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.constant.alias.bool, -- boolean value (true <-> false)
logical_alias,
augend.constant.new({ elements = { "let", "const" } }),
ordinal_numbers,
weekdays,
months,
},
css = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.hexcolor.new({
case = "lower",
}),
augend.hexcolor.new({
case = "upper",
}),
},
markdown = {
augend.misc.alias.markdown_header,
ordinal_numbers,
weekdays,
months,
},
json = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.semver.alias.semver, -- versioning (v1.1.2)
},
lua = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
augend.constant.alias.bool, -- boolean value (true <-> false)
augend.constant.new({
elements = { "and", "or" },
word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
cyclic = true, -- "or" is incremented into "and".
}),
ordinal_numbers,
weekdays,
months,
},
python = {
augend.integer.alias.decimal, -- nonnegative and negative decimal number
capitalized_boolean,
logical_alias,
ordinal_numbers,
weekdays,
months,
},
},
}
end,
config = function(_, opts)
require("dial.config").augends:register_group(opts.groups)
M.dials_by_ft = opts.dials_by_ft
end,
}

View File

@ -0,0 +1,61 @@
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
opts = {
menu = {
width = vim.api.nvim_win_get_width(0) - 4,
},
},
keys = {
{
"<leader>H",
function()
require("harpoon"):list():append()
end,
desc = "Harpoon File",
},
{
"<leader>h",
function()
local harpoon = require("harpoon")
harpoon.ui:toggle_quick_menu(harpoon:list())
end,
desc = "Harpoon Quick Menu",
},
{
"<leader>1",
function()
require("harpoon"):list():select(1)
end,
desc = "Harpoon to File 1",
},
{
"<leader>2",
function()
require("harpoon"):list():select(2)
end,
desc = "Harpoon to File 2",
},
{
"<leader>3",
function()
require("harpoon"):list():select(3)
end,
desc = "Harpoon to File 3",
},
{
"<leader>4",
function()
require("harpoon"):list():select(4)
end,
desc = "Harpoon to File 4",
},
{
"<leader>5",
function()
require("harpoon"):list():select(5)
end,
desc = "Harpoon to File 5",
},
},
}

View File

@ -20,9 +20,9 @@ return {
"ggandor/leap.nvim",
enabled = true,
keys = {
{ "s", mode = { "n", "x", "o" }, desc = "Leap forward to" },
{ "S", mode = { "n", "x", "o" }, desc = "Leap backward to" },
{ "gs", mode = { "n", "x", "o" }, desc = "Leap from windows" },
{ "s", mode = { "n", "x", "o" }, desc = "Leap Forward to" },
{ "S", mode = { "n", "x", "o" }, desc = "Leap Backward to" },
{ "gs", mode = { "n", "x", "o" }, desc = "Leap from Windows" },
},
config = function(_, opts)
local leap = require("leap")

View File

@ -0,0 +1,54 @@
return {
-- disable gitsigns.nvim
{
"lewis6991/gitsigns.nvim",
enabled = false,
},
-- setup mini.diff
{
"echasnovski/mini.diff",
event = "VeryLazy",
keys = {
{
"<leader>go",
function()
require("mini.diff").toggle_overlay(0)
end,
desc = "Toggle mini.diff overlay",
},
},
opts = {
view = {
style = "sign",
signs = {
add = "",
change = "",
delete = "",
},
},
},
},
-- lualine integration
{
"nvim-lualine/lualine.nvim",
opts = function(_, opts)
local x = opts.sections.lualine_x
for _, comp in ipairs(x) do
if comp[1] == "diff" then
comp.source = function()
local summary = vim.b.minidiff_summary
return summary
and {
added = summary.add,
modified = summary.change,
removed = summary.delete,
}
end
break
end
end
end,
},
}

View File

@ -18,12 +18,12 @@ return {
function()
require("mini.files").open(vim.api.nvim_buf_get_name(0), true)
end,
desc = "Open mini.files (directory of current file)",
desc = "Open mini.files (Directory of Current File)",
},
{
"<leader>fM",
function()
require("mini.files").open(vim.loop.cwd(), true)
require("mini.files").open(vim.uv.cwd(), true)
end,
desc = "Open mini.files (cwd)",
},
@ -50,14 +50,14 @@ return {
callback = function(args)
local buf_id = args.data.buf_id
-- Tweak left-hand side of mapping to your liking
vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id })
vim.keymap.set("n", "g.", toggle_dotfiles, { buffer = buf_id, desc = "Toggle Hidden Files" })
end,
})
vim.api.nvim_create_autocmd("User", {
pattern = "MiniFilesActionRename",
callback = function(event)
require("lazyvim.util").lsp.on_rename(event.data.from, event.data.to)
LazyVim.lsp.on_rename(event.data.from, event.data.to)
end,
})
end,

View File

@ -0,0 +1,32 @@
return {
{
"echasnovski/mini.move",
event = "VeryLazy",
opts = {},
keys = function()
local ret = {}
local directions = { "left", "down", "up", "right" }
local keys = { "h", "j", "k", "l" }
local move = require("mini.move")
for i, dir in ipairs(directions) do
ret[#ret + 1] = {
"<A-" .. keys[i] .. ">",
mode = { "i", "n" },
function()
move.move_line(dir)
end,
}
end
for i, dir in ipairs(directions) do
ret[#ret + 1] = {
"<A-" .. keys[i] .. ">",
mode = { "v" },
function()
move.move_selection(dir)
end,
}
end
return ret
end,
},
}

View File

@ -7,7 +7,7 @@ return {
lazy = true,
init = function()
vim.g.navic_silence = true
require("lazyvim.util").lsp.on_attach(function(client, buffer)
LazyVim.lsp.on_attach(function(client, buffer)
if client.supports_method("textDocument/documentSymbol") then
require("nvim-navic").attach(client, buffer)
end

View File

@ -1,13 +1,11 @@
local Util = require("lazyvim.util")
return {
{
"simrat39/symbols-outline.nvim",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
cmd = "SymbolsOutline",
"hedyhli/outline.nvim",
keys = { { "<leader>cs", "<cmd>Outline<cr>", desc = "Toggle Outline" } },
cmd = "Outline",
opts = function()
local Config = require("lazyvim.config")
local defaults = require("symbols-outline.config").defaults
local defaults = require("outline.config").defaults
local opts = {
symbols = {},
symbol_blacklist = {},
@ -37,24 +35,22 @@ return {
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
local edgy_idx = Util.plugin.extra_idx("ui.edgy")
local symbols_idx = Util.plugin.extra_idx("editor.symbols-outline")
local edgy_idx = LazyVim.plugin.extra_idx("ui.edgy")
local symbols_idx = LazyVim.plugin.extra_idx("editor.outline")
if edgy_idx and edgy_idx > symbols_idx then
Util.warn(
"The `edgy.nvim` extra must be **imported** before the `symbols-outline.nvim` extra to work properly.",
{
title = "LazyVim",
}
LazyVim.warn(
"The `edgy.nvim` extra must be **imported** before the `outline.nvim` extra to work properly.",
{ title = "LazyVim" }
)
end
opts.right = opts.right or {}
table.insert(opts.right, {
title = "Symbols Outline",
title = "Outline",
ft = "Outline",
pinned = true,
open = "SymbolsOutline",
open = "Outline",
})
end,
},

View File

@ -0,0 +1,76 @@
local Config = require("lazyvim.config")
for _, other in ipairs({ "aerial", "outline" }) do
local extra = "lazyvim.plugins.extras.editor." .. other
if vim.tbl_contains(Config.json.data.extras, extra) then
other = other:gsub("^%l", string.upper)
LazyVim.error({
"**Trouble v3** includes support for document symbols.",
("You currently have the **%s** extra enabled."):format(other),
"Please disable it in your config.",
})
end
end
return {
{
"folke/trouble.nvim",
branch = "dev",
keys = {
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics (Trouble)" },
{ "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer Diagnostics (Trouble)" },
{ "<leader>cs", "<cmd>Trouble symbols toggle focus=false<cr>", desc = "Symbols (Trouble)" },
{ "<leader>xL", "<cmd>Trouble loclist toggle<cr>", desc = "Location List (Trouble)" },
{ "<leader>xQ", "<cmd>Trouble qflist toggle<cr>", desc = "Quickfix List (Trouble)" },
},
},
-- lualine integration
{
"nvim-lualine/lualine.nvim",
optional = true,
opts = function(_, opts)
local trouble = require("trouble")
if not trouble.statusline then
LazyVim.error("You have enabled the **trouble-v3** extra,\nbut still need to update it with `:Lazy`")
return
end
local symbols = trouble.statusline({
mode = "lsp_document_symbols",
groups = {},
title = false,
filter = { range = true },
format = "{kind_icon}{symbol.name:Normal}",
})
table.insert(opts.sections.lualine_c, {
symbols.get,
cond = symbols.has,
})
end,
},
{
"folke/edgy.nvim",
optional = true,
opts = function(_, opts)
-- disable for now
do
return
end
for _, pos in ipairs({ "top", "bottom", "left", "right" }) do
opts[pos] = opts[pos] or {}
table.insert(opts[pos], {
ft = "trouble",
filter = function(_buf, win)
return vim.w[win].trouble
and vim.w[win].trouble.position == pos
and vim.w[win].trouble.type == "split"
and vim.w[win].trouble.relative == "editor"
and not vim.w[win].trouble_preview
end,
})
end
end,
},
}

View File

@ -0,0 +1,38 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "yaml" })
end
end,
},
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
-- for ansiblels validation
vim.list_extend(opts.ensure_installed, { "ansible-lint" })
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
ansiblels = {},
},
},
},
{
"mfussenegger/nvim-ansible",
keys = {
{
"<leader>tr",
function()
require("ansible").run()
end,
silent = true,
},
},
},
}

View File

@ -85,7 +85,7 @@ return {
},
setup = {
clangd = function(_, opts)
local clangd_ext_opts = require("lazyvim.util").opts("clangd_extensions.nvim")
local clangd_ext_opts = LazyVim.opts("clangd_extensions.nvim")
require("clangd_extensions").setup(vim.tbl_deep_extend("force", clangd_ext_opts or {}, { server = opts }))
return false
end,

Some files were not shown because too many files have changed in this diff Show More