Compare commits

..

196 Commits

Author SHA1 Message Date
b391c37e53 chore(main): release 2.2.0 (#595)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-17 08:31:16 +02:00
338680d80a chore(build): auto-generate vimdoc 2023-04-17 05:34:39 +00:00
df9547f432 fix(telescope): consistent keymap description. Fixes #600 2023-04-17 07:33:55 +02:00
0155de00ab feat(noice): added keymap to dismiss all noice messages 2023-04-16 23:08:46 +02:00
0cb8974221 fix(lsp): gT => gy. keymap for goto type definition. Fixes #554 2023-04-16 22:35:14 +02:00
700cdaf30d chore(main): release 2.1.0 (#594)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-16 22:05:08 +02:00
feaeab9fca fix(dap): added DapInstall and DapUninstall to cmds 2023-04-16 21:56:38 +02:00
54846ff763 docs: add extras keymaps to keymaps 2023-04-16 21:50:48 +02:00
f562d1d197 feat(dap): added extra for dap nlua 2023-04-16 21:35:52 +02:00
bc14e02a1f feat: added extra for dap 2023-04-16 21:35:38 +02:00
df94a044ec feat(which-key): easier integration for which-key group names 2023-04-16 21:33:55 +02:00
29ec138f8e chore(main): release 2.0.0 (#588)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-16 14:17:09 +02:00
98775f5631 feat(telescope): add document/workspace diagnostics and todo/fixme telescope keymaps (#557) 2023-04-16 14:15:34 +02:00
36aa64bc0b build: deprecated treesitter method 2023-04-16 11:35:35 +02:00
02c5e8d953 fix(config): options cant be disabled with lazyvim config. Fixes #566 2023-04-16 11:34:35 +02:00
a9e9204dae fix(lazygit): dont use <esc><esc> for normal more for laygit to prevent delays on <esc>. Fixes #567 2023-04-16 11:18:44 +02:00
2d8116ef67 fix(lsp): gt -> gT. Fixes #554 2023-04-16 11:03:54 +02:00
bef36bb2fd fix(format): ignore vim.b.autoformat when formatting using key bindings. Fixes #575 2023-04-16 10:48:07 +02:00
a099b2d3ab feat(keymaps): Get rename command from inc_rename configuration (#579)
Gets the rename command from the inc_rename module (when installed), rather than assuming the default `IncRename`, allowing the user to modify the inc_rename options without having to create a new keymap.
2023-04-16 10:43:14 +02:00
1defd5f670 feat(autocmds): add checkhealth filetype to close_with_q list (#512) 2023-04-16 10:39:12 +02:00
6e01e8560e feat(telescope): use the new dynamic workspace symbols (#577)
`lsp_workspace_symbols` may fail or return nothing when query is empty.
Use the new `lsp_dynamic_workspace_symbols` to dynamically query symbols
in the workspace.

Related: https://github.com/nvim-telescope/telescope.nvim/issues/964
Fixes: https://github.com/LazyVim/LazyVim/issues/576
2023-04-16 10:25:20 +02:00
7691daa036 chore(build): auto-generate vimdoc 2023-04-16 05:54:27 +00:00
7476da7811 fix(autocmds): don't auto create dirs for urls. Fixes #583 2023-04-16 07:53:42 +02:00
1c06aa35ee chore(build): auto-generate vimdoc 2023-04-15 21:12:09 +00:00
078250a114 refactor(treesitter)!: rename help to vimdoc (#521) 2023-04-15 23:11:29 +02:00
7ce1b1519a chore(main): release 1.24.0 (#510)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-31 13:17:00 +02:00
79fe0455a0 feat(lualine): added lazy extension 2023-03-31 13:05:36 +02:00
a6062758d2 chore(build): auto-generate vimdoc 2023-03-31 07:41:46 +00:00
ed48b85dbe feat(autocmds): add auto create dir (#493)
* feat(autocmds): add auto create dir

* refactor: auto-create dir

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-03-31 09:40:57 +02:00
f67f20184f chore(main): release 1.23.0 (#492)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-25 09:57:40 +01:00
7048619cc1 chore(build): auto-generate vimdoc 2023-03-25 08:43:47 +00:00
59eb19835f feat(treesitter): use Python indents as they've improved greatly (#490) 2023-03-25 09:42:57 +01:00
c4572fcec8 chore(main): release 1.22.0 (#468)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-23 08:12:56 +01:00
c272cb2940 chore(build): auto-generate vimdoc 2023-03-23 07:01:09 +00:00
381ee0a9fc fix(mason): removed flake8. You can add it back in your own configs if you need it or add ruff_lsp 2023-03-23 08:00:24 +01:00
b48a1969d3 chore(build): auto-generate vimdoc 2023-03-22 08:03:44 +00:00
b0cef1f506 fix(autocmd): remove query from q-to-quit autocmd (#473) 2023-03-22 09:03:02 +01:00
049c84509c chore(build): auto-generate vimdoc 2023-03-21 06:27:56 +00:00
ade4342c42 feat(treesitter): add luadoc (#469) 2023-03-21 07:27:13 +01:00
18328d10c9 chore(build): auto-generate vimdoc 2023-03-20 18:57:14 +00:00
df5cbfdbec feat(mason): compatibility with the new mason registry 2023-03-20 19:56:34 +01:00
11d414c358 chore: update templates 2023-03-19 20:40:58 +01:00
7a8ca6222a chore(main): release 1.21.2 (#463)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-19 08:15:14 +01:00
db66353db9 chore(build): auto-generate vimdoc 2023-03-19 06:59:41 +00:00
a7b25e13fa fix(alpha): use AlphaFooter highlight for footer section (#461) 2023-03-19 07:58:51 +01:00
a0b1256554 chore(main): release 1.21.1 (#451)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-17 22:31:38 +01:00
501474e421 fix(config): compat with lazy.nvim 2023-03-17 22:29:07 +01:00
b984c0cff5 chore(main): release 1.21.0 (#449)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-17 16:44:09 +01:00
9f5a0f1bd8 feat(lsp): added keymap to see source actions with <leader>cA (useful for tsserver and others) 2023-03-17 16:29:32 +01:00
d0b378f427 chore(main): release 1.20.0 (#442)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-17 08:16:40 +01:00
aa4f7ec651 chore(build): auto-generate vimdoc 2023-03-17 07:05:01 +00:00
c10e550639 feat(lsp): make lsp work when mason-lspconfig is disabled. Fixed #445 2023-03-17 08:04:17 +01:00
f0b548af2f chore(build): auto-generate vimdoc 2023-03-16 11:17:38 +00:00
Lc
cec000dfd8 fix(icons): replace obsolete icons (#441)
* fix(icons): replace obsolete icons

* fix(icons): bigger icons

* fix(icons): bigger folder icon

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-03-16 12:16:55 +01:00
6b740fd300 chore(main): release 1.19.0 (#422)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-14 11:23:08 +01:00
564e25a277 chore(build): auto-generate vimdoc 2023-03-14 10:18:08 +00:00
df6ac591ba fix(core): set cond=true for LazyVim 2023-03-14 11:17:07 +01:00
bcdcfab020 feat(mini-starter): add Session restore to starter menu (#421)
This mirrors the menu item added in alpha-nvim. I named this "Session
restore" rather than "Restore session", since mini.starter uses the
first letter of the item as the shortcut key.  This way it doesn't
conflict with "Recent files"
2023-03-12 23:00:20 +01:00
8bb0c9ddd8 chore(main): release 1.18.2 (#415)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-12 09:26:52 +01:00
0bed79f844 chore(build): auto-generate vimdoc 2023-03-12 08:12:43 +00:00
a28885be3f fix(lsp): allow silent=false for lsp keymaps. Fixes #414 2023-03-12 09:10:45 +01:00
f5e010d887 chore(main): release 1.18.1 (#407)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-10 13:58:49 +01:00
9f30a2e03a fix(prettier): extend ensure_installed instead of overwriting it. Fixes #406 2023-03-10 13:55:06 +01:00
9d9e6b1188 chore(main): release 1.18.0 (#391)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-10 09:04:29 +01:00
3ffd5408a1 chore(build): auto-generate vimdoc 2023-03-10 07:59:02 +00:00
f1dbd097e4 fix(eslint): only run EslintFixAll on buffers where eslint is attached 2023-03-10 08:54:56 +01:00
aa8bae07ae feat(prettierd): added an extra for prettierd with null-ls 2023-03-10 08:45:09 +01:00
75299da24c feat(eslint): added an extra for eslint lsp that runs EslintFixAll before saving a buffer 2023-03-10 08:44:47 +01:00
5aad5749a7 feat(null-ls): added .neoconf.json to null-ls root_dir 2023-03-10 08:44:17 +01:00
5bb2314787 feat(typescript): added null-ls typescript code actions 2023-03-10 08:43:53 +01:00
b1b5b461bf chore(build): auto-generate vimdoc 2023-03-06 06:38:20 +00:00
23ba877bb0 feat(copilot): better sorting for cmp sources when using copilot 2023-03-06 07:37:37 +01:00
8f3834bc13 feat(null-ls): added fish_indent and fish diag 2023-03-06 07:37:37 +01:00
c407ddfe8a feat(shfmt): added shfmt to null-ls and mason 2023-03-06 07:37:37 +01:00
3c6357815c chore(main): release 1.17.1 (#389)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-05 17:10:36 +01:00
079d3967d0 fix(copilot): confirm with replace for copilot only 2023-03-05 17:06:13 +01:00
ae9c74d88e chore(main): release 1.17.0 (#379)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-05 09:16:44 +01:00
e7a515e548 fix(mason): removed installing of shellcheck and shfmt. Use bashls instead 2023-03-05 09:12:16 +01:00
2002265461 chore(build): auto-generate vimdoc 2023-03-05 08:09:39 +00:00
f441faad03 feat: add luap to nvim-treesitter ensure_installed (#383) 2023-03-05 09:08:51 +01:00
6fec14e508 fix(typescript): enable function call completion snippets 2023-03-04 10:41:52 +01:00
b10c9ade77 build: neoconf sumneko_lua => lua_ls 2023-03-04 10:41:52 +01:00
2e951e4f44 feat(autocmds): added 'query' to close_with_q autocmd 2023-03-04 10:41:51 +01:00
0d32e62567 chore(build): auto-generate vimdoc 2023-03-04 07:41:20 +00:00
9dd2487529 fix: rename more appropriately (also a typo) (#378) 2023-03-04 08:40:37 +01:00
1f7be0bbad chore(main): release 1.16.0 (#376)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-03 20:12:35 +01:00
57c2dcb3a3 feat(neo-tree): added expanders 2023-03-03 20:10:45 +01:00
099fd48844 chore(main): release 1.15.0 (#371)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-03 08:34:43 +01:00
04a60e251b fix(luasnip): added note that jsregexp is optional if it fails to build 2023-03-03 08:28:35 +01:00
d285548ae0 chore(build): auto-generate vimdoc 2023-03-03 07:23:08 +00:00
368c65e14b feat(copilot): added an extra to enable copilot. {import = "lazyvim.plugins.extras.coding.copilot"} 2023-03-03 08:22:20 +01:00
3a52307505 feat(cmp): added <s-CR> to confirm completion with replace 2023-03-03 08:21:29 +01:00
3c0f28331b chore(main): release 1.14.1 (#366)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-02 14:29:06 +01:00
c32943f2aa chore(build): auto-generate vimdoc 2023-03-02 13:18:45 +00:00
d00aade8db fix(alpha): larger session icon. Fixes #365 2023-03-02 14:17:57 +01:00
f6f3ce4a9b fix(luasnip): dont build jsregexp on Windows 2023-03-02 14:15:51 +01:00
16e4a3f8fd fix(leap): unpin leap 2023-03-02 08:19:03 +01:00
d0e420eca8 chore(main): release 1.14.0 (#360)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-01 17:51:10 +01:00
f9b7406df9 feat(telescope): Add open selected with trouble keymap (#357) 2023-03-01 13:10:04 +01:00
efca9528da chore(main): release 1.13.1 (#358)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-01 11:41:35 +01:00
e42c308a6b chore(build): auto-generate vimdoc 2023-03-01 10:40:15 +00:00
787ceab031 fix(leap): pin leap for now till flit issue is fixed 2023-03-01 11:39:33 +01:00
7e47f88749 chore(main): release 1.13.0 (#343)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-28 12:58:53 +01:00
59fa83653f feat(keymaps): Add previous/next trouble/quickfix item keymap [q, ]q (#299) 2023-02-28 11:31:35 +01:00
5abb10b5ab fix(lsp): only map lsp goto definition when client has definitionProvider (#348)
Co-authored-by: Alexander Born <alexander.born@bmw.de>
2023-02-28 11:29:57 +01:00
4b37723558 fix(git-signs): larger icons for delete 2023-02-28 10:01:53 +01:00
588dc5dd65 fix(icons): replace obsolete Nerd icons (#331) 2023-02-28 09:59:50 +01:00
70966bbc19 style: desc for gw 2023-02-28 09:59:01 +01:00
8a9265efed style: add description for "gw" keymap (#327) 2023-02-28 09:58:29 +01:00
2b8b27b4a9 chore(build): auto-generate vimdoc 2023-02-28 08:52:19 +00:00
d97bf66eed fix(mini-indentscope): disable indentscope for filetypes during init. Fixes #318 2023-02-28 09:51:29 +01:00
fc765e9e3d fix(treesitter): always install all built-in treesitter parsers to prevent queriy issues 2023-02-27 19:38:29 +01:00
592074ad80 chore(build): auto-generate vimdoc 2023-02-27 09:18:03 +00:00
bd62cbe370 fix(luasnips): make install_jsregexp 2023-02-27 10:17:22 +01:00
befa6c67a4 chore(main): release 1.12.1 (#314)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-20 22:04:44 +01:00
079c685831 refactor(treesitter): nil-check 2023-02-20 16:01:02 +01:00
0eef2c2f29 fix(treesitter): nil check #312 (#313)
Co-authored-by: Alexander Born <alexander.born@bmw.de>
2023-02-20 15:58:52 +01:00
9b175ab1bc chore(main): release 1.12.0 (#294)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-20 09:05:53 +01:00
db9a7d90d5 chore(build): auto-generate vimdoc 2023-02-20 07:22:26 +00:00
cccdc1cacf feat(telescope): add <leader>sS for :Telescope lsp_workspace_symbols (#309) 2023-02-20 08:21:39 +01:00
90c58352dd chore(build): auto-generate vimdoc 2023-02-19 21:32:05 +00:00
6b9f0c0c3c feat: persist pinned tabs (#304)
Adds `globals` to session opts to persist pinned tabs
2023-02-19 09:56:08 +01:00
de6a28b781 fix(treesitter): disable indent only for python right now 2023-02-18 13:14:47 +01:00
329a2daff4 fix(treesitter): disable treesitter indent by default, since it has too many issues. See #297 2023-02-18 12:40:25 +01:00
f08d004bc2 chore(build): auto-generate vimdoc 2023-02-18 08:56:40 +00:00
8e84dcf85c fix(mini.surround): don't create empty keymaps. Fixes #296 2023-02-18 09:55:56 +01:00
a0cf00c81b fix(illuminate): always set refernce keymaps on the buffer as well to properly overwrite ftplugin mappings. Fixes #292 2023-02-17 21:32:25 +01:00
ba7942b80b chore(main): release 1.11.0 (#286)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-17 17:09:38 +01:00
9edd1a938f feat(telescope): add <leader>sR for :Telescope resume (#284)
* feat(telescope): add `<leader>fR` for `:Telescope resume`

* fix: use `<leader>sR` instead or `<leader>fR

---------

Co-authored-by: Calvin Bochulak <cbochula@cisco.com>
2023-02-17 16:38:51 +01:00
3d18548c0a chore(build): auto-generate vimdoc 2023-02-17 06:19:43 +00:00
78cb3bb66d fix(lualine): Add a space separator between progress & location in lualine (#285) 2023-02-17 07:18:59 +01:00
d5a9ac0e06 chore(main): release 1.10.0 (#280)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-16 20:21:55 +01:00
94ebe25ccb fix(treesitter-textobjects): only disable the textobject plugins/* files when its not enabled in the treesitter opts 2023-02-16 20:12:54 +01:00
eccd122e6d feat(leap): lazy-load leap/flit and added keymaps 2023-02-16 14:12:10 +01:00
e33dd761b1 chore(build): auto-generate vimdoc 2023-02-16 12:30:27 +00:00
8b0e6ab19e chore(main): release 1.9.4 (#271)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-16 13:29:41 +01:00
27248b0193 chore(build): auto-generate vimdoc 2023-02-15 13:04:31 +00:00
d198a19325 fix(health): also check for fdfind instead of just fd. Fixes #270 2023-02-15 14:03:46 +01:00
b64d980bbf chore(main): release 1.9.3 (#267)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-14 22:04:39 +01:00
5d6f0d58d5 fix(notify): install notify when noice is not enabled 2023-02-14 21:56:09 +01:00
cc3070d30e faet(util): added Util.on_very_lazy 2023-02-14 21:55:52 +01:00
e91903e810 chore(build): auto-generate vimdoc 2023-02-14 13:41:28 +00:00
38eb3bf115 fix(which-key): only add noice group when noice is enabled 2023-02-14 14:40:34 +01:00
2e18998c9e chore(main): release 1.9.2 (#251)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-12 16:52:20 +01:00
a3aeb27cbc fix(format): nil check 2023-02-12 12:31:43 +01:00
fab6150da9 fix(format): dont format if client capaibilities disabled it. #249 2023-02-12 11:43:31 +01:00
e8766c5edd chore(main): release 1.9.1 (#241)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-12 11:19:07 +01:00
5cb44bae6d chore(build): auto-generate vimdoc 2023-02-12 10:00:54 +00:00
543126818e fix(lsp): temp mason fix for sumenko_lua -> lua_ls rename. See #248 2023-02-12 10:59:58 +01:00
57e92b04e2 style: fix comment typo (#243) 2023-02-11 17:10:39 +01:00
31ad893788 fix(cmp): added <c-n> and <c-p> to make it more consistent 2023-02-11 13:29:27 +01:00
151bf12a9f fix(telescope): make key bindings more consistent for telescope 2023-02-11 13:28:11 +01:00
d9e95f8dcd chore(main): release 1.9.0 (#239)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-11 09:04:05 +01:00
490598b81a chore(build): auto-generate vimdoc 2023-02-11 08:00:32 +00:00
6669e63368 feat(config): allow to disable loading of the default keymaps/autocmds/options. Fixes #238 2023-02-11 08:59:42 +01:00
d9b1c79c3e chore(main): release 1.8.0 (#230)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-10 17:09:04 +01:00
f5d232b79c refactor(mini.ai): improved descriptions for mini.ai 2023-02-10 17:06:01 +01:00
fd0a0e829d feat(telescope): improved Telescope mappings in normal and insert mode (#231)
Co-authored-by: sourproton <sourproton98@gmail.com>
2023-02-10 16:49:03 +01:00
b96ea665b3 feat(mini.ai): added all mini.ai text-objects to which-key 2023-02-10 16:17:18 +01:00
b20f016b04 chore(build): auto-generate vimdoc 2023-02-10 09:05:28 +00:00
24cb9a90e5 chore(main): release 1.7.2 (#225)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-10 10:04:40 +01:00
42d2411bfa fix(leap): don't use the x and X mappings in visual mode 2023-02-09 22:49:07 +01:00
ddd1fceb76 ci: autogen recipes 2023-02-09 22:48:42 +01:00
7336478d09 chore(main): release 1.7.1 (#222)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-09 14:50:50 +01:00
cb384ad69f fix(lsp): remove debug 2023-02-09 14:47:55 +01:00
f492daa009 chore(main): release 1.7.0 (#221)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-09 14:43:35 +01:00
225a875179 chore(build): auto-generate vimdoc 2023-02-09 13:38:32 +00:00
3af91550be feat(bufferline): added keymaps to pin and delete non-pinned buffers. See #218 2023-02-09 14:37:37 +01:00
d61e4bd553 fix(lsp): dont use expr=true for lsp rename. Fixes #220 2023-02-09 14:35:48 +01:00
b796b6e5a8 chore(build): auto-generate vimdoc 2023-02-08 06:36:15 +00:00
4df6301f1e docs: Added Chinese Translation of the README (#211) 2023-02-08 07:35:04 +01:00
6416761353 chore(main): release 1.6.0 (#207)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-07 23:17:40 +01:00
52b34ce3c3 feat(lsp): allow disabling autoformat for certain buffers 2023-02-07 23:15:10 +01:00
79b4d67357 chore(main): release 1.5.0 (#206)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-07 22:02:02 +01:00
5f5a564a82 fix(plugins): lazy-loading on BufReadPre or BufReadPost, should also use BufNewFile. Fixes #169 2023-02-07 21:59:33 +01:00
088914e1dd feat(trouble): keymaps for trouble quicklist / loclist (#171)
* use trouble quicklist / loclist if available

* feat: added keymaps for loclist and qf list with trouble

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-02-07 21:50:41 +01:00
f57031db7c feat(autocmds): add groups to autocmds (#151)
* fix(config): add groups to autocommands, and fix plugin/user config order

* revert config loading refactor and inline augroups

* refactor: autocmd groups

---------

Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
2023-02-07 20:30:46 +01:00
9131897b61 docs: added recipes 2023-02-07 19:43:30 +01:00
0968e24f82 chore(main): release 1.4.0 (#186)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-07 17:00:11 +01:00
320f5c6de7 fix(mini.indent): no need to disable indent in alpha dashboard config. Fixes #199 2023-02-07 16:46:48 +01:00
826655b901 fix(lsp): properly merge lsp client capabilities 2023-02-07 16:46:48 +01:00
edd0fbb6a1 chore(build): auto-generate vimdoc 2023-02-07 08:17:32 +00:00
a5755408dd feat(icons): add copilot icon (#195) 2023-02-07 09:16:47 +01:00
4a9a2e8861 chore(build): auto-generate vimdoc 2023-02-06 21:39:20 +00:00
0556c011c5 docs: video 2023-02-06 22:38:35 +01:00
4792d498ab chore(build): auto-generate vimdoc 2023-02-06 21:38:19 +00:00
68ad526f3a docs: move video below install instructions 2023-02-06 22:37:36 +01:00
ab89f46fba chore(build): auto-generate vimdoc 2023-02-06 21:36:02 +00:00
e7004bce30 docs: video walkthrough to get started (#170) 2023-02-06 22:35:23 +01:00
3a28ce7919 fix(typescript): typescript extras Keymaps (#175) 2023-02-06 16:44:43 +01:00
2ff213126c fix(keymaps): move lines with silent and without triggering cmdline. Fixes #184 2023-02-06 08:43:59 +01:00
e5626e9a2d fix(keymaps): silent by default 2023-02-06 08:43:59 +01:00
d905ff08b9 chore(build): auto-generate vimdoc 2023-02-06 07:31:56 +00:00
182323623a fix(mini.surround): use merged plugin spec to build keys. Fixes #172. Fixes #177 2023-02-06 08:31:04 +01:00
663e142bcd chore(build): auto-generate vimdoc 2023-02-03 17:07:08 +00:00
dfba8bab93 docs: Update README.md (#167)
Pretty sure it's not meant to be `.toml`?
2023-02-03 18:06:22 +01:00
30 changed files with 1376 additions and 218 deletions

View File

@ -16,7 +16,7 @@ body:
required: true
- label: I have searched the existing issues of LazyVim
required: true
- label: I have searched the exsiting issues of plugins related to this issue
- label: I have searched the existing issues of plugins related to this issue
required: true
- type: input
attributes:
@ -59,6 +59,7 @@ body:
value: |
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name

View File

@ -15,8 +15,12 @@ jobs:
- name: Install Neovim
shell: bash
run: |
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.deb -O /tmp/nvim.deb
sudo dpkg -i /tmp/nvim.deb
mkdir -p /tmp/nvim
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage -O /tmp/nvim/nvim.appimage
cd /tmp/nvim
chmod a+x ./nvim.appimage
./nvim.appimage --appimage-extract
echo "/tmp/nvim/squashfs-root/usr/bin/" >> $GITHUB_PATH
- name: Run Tests
run: |
nvim --version
@ -55,7 +59,7 @@ jobs:
with:
release-type: simple
package-name: LazyVim
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: tag stable versions
if: ${{ steps.release.outputs.release_created }}
run: |

View File

@ -7,7 +7,7 @@
},
"neoconf": {
"plugins": {
"sumneko_lua": {
"lua_ls": {
"enabled": true
}
}

File diff suppressed because it is too large Load Diff

141
README-CN.md Normal file
View File

@ -0,0 +1,141 @@
<div align="center">
<img src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
</div>
<hr>
<h4 align="center">
<a href="https://lazyvim.github.io/installation">安装</a>
·
<a href="https://lazyvim.github.io/configuration">配置</a>
·
<a href="https://lazyvim.github.io">文档</a>
</h4>
<div align="center"><p>
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
</a>
<a href="https://github.com/LazyVim/LazyVim/pulse">
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
</a>
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/LazyVim/LazyVim/stargazers">
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/LazyVim/LazyVim/issues">
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/LazyVim/LazyVim">
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://twitter.com/intent/follow?screen_name=folke">
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
</a>
</div>
LazyVim 是由 [💤 lazy.nvim](https://github.com/folke/lazy.nvim) 驱动的一套 Neovim 配置,可以轻松自定义和扩展您的配置。
不必在从头开始或使用预制发行版之间做选择,
LazyVim 提供了两全其美的方式 - 根据需要调整配置的灵活性,以及默认预配置的便利性。
![image](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png)
![image](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png)
## ✨ 特性
- 🔥 将你的 Neovim 变成一个成熟的 IDE
- 💤 使用 [lazy.nvim](https://github.com/folke/lazy.nvim) 轻松自定义和扩展您的配置
- 🚀 快如闪电
- 🧹 选项、自动命令和键盘映射的合理预设
- 📦 预配置了大量插件,随时可用
## ⚡️ 要求
- Neovim >= **0.8.0** (需要用 **LuaJIT** 构建)
- Git >= **2.19.0** (用于部分克隆支持)
- 一个 [Nerd Font](https://www.nerdfonts.com/) 字体 **_(可选)_**
## 🚀 入门
您可以在 [此处](https://github.com/LazyVim/starter) 找到 **LazyVim** 的入门模板
<details><summary>在 Docker 中尝试</summary>
```sh
docker run -w /root -it --rm alpine:edge sh -uelic '
apk add git lazygit neovim ripgrep alpine-sdk --update
git clone https://github.com/LazyVim/starter ~/.config/nvim
cd ~/.config/nvim
nvim
'
```
</details>
<details><summary> 安装 <a href="https://github.com/LazyVim/starter">LazyVim Starter</a></summary>
- 备份您当前的 Neovim 文件
```sh
mv ~/.config/nvim ~/.config/nvim.bak
mv ~/.local/share/nvim ~/.local/share/nvim.bak
```
- 克隆 starter
```sh
git clone https://github.com/LazyVim/starter ~/.config/nvim
```
- 删除 `.git` 文件夹,以便稍后将其添加到您自己的存储库
```sh
rm -rf ~/.config/nvim/.git
```
- 启动 Neovim!
```sh
nvim
```
请参阅文件中有关如何自定义 **LazyVim** 的注释。
</details>
---
[@elijahmanor](https://github.com/elijahmanor) 制作了一段很棒的视频,其中包含入门演练。
[![Watch the video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM)
## 📂 文件结构
config 下的文件会在适当的时候自动加载,所以你不需要手动引入这些文件。
**LazyVim** 带有一组默认配置文件,这些文件将在您的配置**之前**加载。
看[这里](https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config)
您可以在 `lua/plugins/` 下添加自定义插件配置(specs)。
[lazy.nvim](https://github.com/folke/lazy.nvim) 会自动加载这些文件。
<pre>
~/.config/nvim
├── lua
│   ├── config
│   │   ├── autocmds.lua
│   │   ├── keymaps.lua
│   │   ├── lazy.lua
│   │   └── options.lua
│   └── plugins
│   ├── spec1.lua
│   ├── **
│   └── spec2.lua
└── init.lua
</pre>
## ⚙️ Configuration
参考[文档](https://lazyvim.github.io/)

View File

@ -42,10 +42,10 @@ Rather than having to choose between starting from scratch or using a
pre-made distro, LazyVim offers the best of both worlds - the flexibility
to tweak your config as needed, along with the convenience of a pre-configured setup.
![image](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png)
![image](https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png)
![image](https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png)
## ✨ Features
- 🔥 Transform your Neovim into a full-fledged IDE
@ -108,6 +108,12 @@ docker run -w /root -it --rm alpine:edge sh -uelic '
</details>
---
There's a great video created by [@elijahmanor](https://github.com/elijahmanor) with a walkthrough to get started.
[![Watch the video](https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg)](https://www.youtube.com/watch?v=N93cTbtLCIM)
## 📂 File Structure
The files under config will be automatically loaded at the appropriate time,
@ -130,7 +136,7 @@ will be automatically loaded by [lazy.nvim](https://github.com/folke/lazy.nvim)
│   ├── spec1.lua
│   ├── **
│   └── spec2.lua
└── init.toml
└── init.lua
</pre>
## ⚙️ Configuration

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 February 02
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 April 17
==============================================================================
Table of Contents *LazyVim-table-of-contents*
@ -9,46 +9,29 @@ Table of Contents *LazyVim-table-of-contents*
- File Structure |LazyVim-file-structure|
- Configuration |LazyVim-configuration|
<img
src="https://user-images.githubusercontent.com/292349/213446185-2db63fd5-8c84-459c-9f04-e286382d6e80.png">
<hr>
<h4 align="center">
<a href="https://lazyvim.github.io/installation">Install</a>
Install
·
<a href="https://lazyvim.github.io/configuration">Configure</a>
Configure
·
<a href="https://lazyvim.github.io">Docs</a>
Docs
</h4>
<div align="center">
<a href="https://github.com/LazyVim/LazyVim/releases/latest">
<img alt="Latest release" src="https://img.shields.io/github/v/release/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41&include_prerelease&sort=semver" />
</a>
<a href="https://github.com/LazyVim/LazyVim/pulse">
<img alt="Last commit" src="https://img.shields.io/github/last-commit/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=8bd5ca&logoColor=D9E0EE&labelColor=302D41"/>
</a>
<a href="https://github.com/LazyVim/LazyVim/blob/main/LICENSE">
<img alt="License" src="https://img.shields.io/github/license/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=ee999f&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/LazyVim/LazyVim/stargazers">
<img alt="Stars" src="https://img.shields.io/github/stars/LazyVim/LazyVim?style=for-the-badge&logo=starship&color=c69ff5&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/LazyVim/LazyVim/issues">
<img alt="Issues" src="https://img.shields.io/github/issues/LazyVim/LazyVim?style=for-the-badge&logo=bilibili&color=F5E0DC&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://github.com/LazyVim/LazyVim">
<img alt="Repo Size" src="https://img.shields.io/github/repo-size/LazyVim/LazyVim?color=%23DDB6F2&label=SIZE&logo=codesandbox&style=for-the-badge&logoColor=D9E0EE&labelColor=302D41" />
</a>
<a href="https://twitter.com/intent/follow?screen_name=folke">
<img alt="follow on Twitter" src="https://img.shields.io/twitter/follow/folke?style=for-the-badge&logo=twitter&color=8aadf3&logoColor=D9E0EE&labelColor=302D41" />
</a>
</div>
LazyVim is a Neovim setup powered by lazy.nvim
<https://github.com/folke/lazy.nvim> to make it easy to customize and extend
@ -57,15 +40,6 @@ using a pre-made distro, LazyVim offers the best of both worlds - the
flexibility to tweak your config as needed, along with the convenience of a
pre-configured setup.
<div class="figure">
<img src="https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png" title="fig:"/>
<p class="caption">image</p>
</div>
<div class="figure">
<img src="https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png" title="fig:"/>
<p class="caption">image</p>
</div>
FEATURES *LazyVim-features*
@ -82,7 +56,7 @@ REQUIREMENTS *LazyVim-requirements*
- Neovim >= **0.8.0** (needs to be built with **LuaJIT**)
- Git >= **2.19.0** (for partial clones support)
- a Nerd Font <https://www.nerdfonts.com/> **_(optional)_**
- a Nerd Font <https://www.nerdfonts.com/> **(optional)**
GETTING STARTED *LazyVim-getting-started*
@ -90,7 +64,7 @@ GETTING STARTED *LazyVim-getting-started*
You can find a starter template for **LazyVim** here
<https://github.com/LazyVim/starter>
Try it with Docker
Try it with Docker ~
>sh
docker run -w /root -it --rm alpine:edge sh -uelic '
@ -101,8 +75,7 @@ Try it with Docker
'
<
Install the <a href="https://github.com/LazyVim/starter">LazyVim Starter</a>
Install the LazyVim Starter ~
- Make a backup of your current Neovim files:
@ -124,36 +97,36 @@ Install the <a href="https://github.com/LazyVim/starter">LazyVim Starter</a>
<
Refer to the comments in the files on how to customize **LazyVim**.
------------------------------------------------------------------------------
Theres a great video created by @elijahmanor
<https://github.com/elijahmanor> with a walkthrough to get started.
<https://www.youtube.com/watch?v=N93cTbtLCIM>
FILE STRUCTURE *LazyVim-file-structure*
The files under config will be automatically loaded at the appropriate time, so
you dont need to require those files manually. **LazyVim** comes with a set
of default config files that will be loaded **_before_** your own. See here
of default config files that will be loaded **before** your own. See here
<https://github.com/LazyVim/LazyVim/tree/main/lua/lazyvim/config>
You can add your custom plugin specs under `lua/plugins/`. All files there will
be automatically loaded by lazy.nvim <https://github.com/folke/lazy.nvim>
<pre>
~/.config/nvim
lua
   config
      autocmds.lua
      keymaps.lua
      lazy.lua
      options.lua
   plugins
   spec1.lua
  
   spec2.lua
init.toml
</pre>
CONFIGURATION *LazyVim-configuration*
Refer to the docs <https://lazyvim.github.io>
==============================================================================
1. Links *LazyVim-links*
1. *image*: https://user-images.githubusercontent.com/292349/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png
2. *image*: https://user-images.githubusercontent.com/292349/213447056-92290767-ea16-430c-8727-ce994c93e9cc.png
3. *@elijahmanor*:
4. *Watch the video*: https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -1,10 +1,18 @@
-- This file is automatically loaded by plugins.init
local function augroup(name)
return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true })
end
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { command = "checktime" })
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
group = augroup("checktime"),
command = "checktime",
})
-- Highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", {
group = augroup("highlight_yank"),
callback = function()
vim.highlight.on_yank()
end,
@ -12,6 +20,7 @@ vim.api.nvim_create_autocmd("TextYankPost", {
-- resize splits if window got resized
vim.api.nvim_create_autocmd({ "VimResized" }, {
group = augroup("resize_splits"),
callback = function()
vim.cmd("tabdo wincmd =")
end,
@ -19,6 +28,7 @@ vim.api.nvim_create_autocmd({ "VimResized" }, {
-- go to last loc when opening a buffer
vim.api.nvim_create_autocmd("BufReadPost", {
group = augroup("last_loc"),
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0)
@ -30,16 +40,18 @@ vim.api.nvim_create_autocmd("BufReadPost", {
-- close some filetypes with <q>
vim.api.nvim_create_autocmd("FileType", {
group = augroup("close_with_q"),
pattern = {
"qf",
"PlenaryTestPopup",
"help",
"lspinfo",
"man",
"notify",
"lspinfo",
"qf",
"spectre_panel",
"startuptime",
"tsplayground",
"PlenaryTestPopup",
"checkhealth",
},
callback = function(event)
vim.bo[event.buf].buflisted = false
@ -47,10 +59,24 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
-- wrap and check for spell in text filetypes
vim.api.nvim_create_autocmd("FileType", {
group = augroup("wrap_spell"),
pattern = { "gitcommit", "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
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
return
end
local file = vim.loop.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end,
})

View File

@ -10,12 +10,26 @@ local defaults = {
colorscheme = function()
require("tokyonight").load()
end,
-- load the default settings
defaults = {
autocmds = true, -- lazyvim.config.autocmds
keymaps = true, -- lazyvim.config.keymaps
-- lazyvim.config.options can't be configured here since that's loaded before lazyvim setup
-- if you want to disable loading options, add `package.loaded["lazyvim.config.options"] = true` to the top of your init.lua
},
-- icons used by other plugins
icons = {
dap = {
Stopped = { "", "DiagnosticWarn", "DapStoppedLine" },
Breakpoint = "",
BreakpointCondition = "",
BreakpointRejected = { "", "DiagnosticError" },
LogPoint = ".>",
},
diagnostics = {
Error = "",
Warn = "",
Hint = " ",
Hint = " ",
Info = "",
},
git = {
@ -30,12 +44,13 @@ local defaults = {
Color = "",
Constant = "",
Constructor = "",
Copilot = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = " ",
Folder = " ",
Function = "",
Interface = "",
Key = "",
@ -43,7 +58,7 @@ local defaults = {
Method = "",
Module = "",
Namespace = "",
Null = " ",
Null = " ",
Number = "",
Object = "",
Operator = "",
@ -119,20 +134,25 @@ end
---@param name "autocmds" | "options" | "keymaps"
function M.load(name)
local Util = require("lazy.core.util")
-- always load lazyvim, then user file
for _, mod in ipairs({ "lazyvim.config." .. name, "config." .. name }) do
local function _load(mod)
Util.try(function()
require(mod)
end, {
msg = "Failed loading " .. mod,
on_error = function(msg)
local modpath = require("lazy.core.cache").find(mod)
if modpath then
Util.error(msg)
local info = require("lazy.core.cache").find(mod)
if info == nil or (type(info) == "table" and #info == 0) then
return
end
Util.error(msg)
end,
})
end
-- always load lazyvim, then user file
if M.defaults[name] or name == "options" then
_load("lazyvim.config." .. name)
end
_load("config." .. name)
if vim.bo.filetype == "lazy" then
-- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here
vim.cmd([[do VimResized]])

View File

@ -7,6 +7,8 @@ local function map(mode, lhs, rhs, opts)
---@cast keys LazyKeysHandler
-- do not create the keymap if a lazy keys handler exists
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
opts = opts or {}
opts.silent = opts.silent ~= false
vim.keymap.set(mode, lhs, rhs, opts)
end
end
@ -28,12 +30,12 @@ map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window wi
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
-- Move Lines
map("n", "<A-j>", ":m .+1<cr>==", { desc = "Move down" })
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("i", "<A-j>", "<Esc>:m .+1<cr>==gi", { desc = "Move down" })
map("n", "<A-k>", ":m .-2<cr>==", { desc = "Move up" })
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
map("i", "<A-k>", "<Esc>:m .-2<cr>==gi", { desc = "Move up" })
-- buffers
if Util.has("bufferline.nvim") then
@ -62,8 +64,7 @@ map(
{ desc = "Redraw / clear hlsearch / diff update" }
)
map("n", "gw", "*N")
map("x", "gw", "*N")
map({ "n", "x" }, "gw", "*N", { desc = "Search word under cursor" })
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
@ -91,8 +92,13 @@ map("n", "<leader>l", "<cmd>:Lazy<cr>", { desc = "Lazy" })
-- new file
map("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Open Location List" })
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Open Quickfix List" })
map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
if not Util.has("trouble.nvim") then
map("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
map("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
end
-- stylua: ignore start
@ -106,8 +112,8 @@ 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" })
-- lazygit
map("n", "<leader>gg", function() Util.float_term({ "lazygit" }, { cwd = Util.get_root() }) end, { desc = "Lazygit (root dir)" })
map("n", "<leader>gG", function() Util.float_term({ "lazygit" }) end, { desc = "Lazygit (cwd)" })
map("n", "<leader>gg", function() Util.float_term({ "lazygit" }, { cwd = Util.get_root(), esc_esc = false }) end, { desc = "Lazygit (root dir)" })
map("n", "<leader>gG", function() Util.float_term({ "lazygit" }, {esc_esc = false}) end, { desc = "Lazygit (cwd)" })
-- quit
map("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
@ -120,7 +126,7 @@ end
-- floating terminal
map("n", "<leader>ft", function() Util.float_term(nil, { cwd = Util.get_root() }) end, { desc = "Terminal (root dir)" })
map("n", "<leader>fT", function() Util.float_term() end, { desc = "Terminal (cwd)" })
map("t", "<esc><esc>", "<c-\\><c-n>", {desc = "Enter Normal Mode"})
map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
-- windows
map("n", "<leader>ww", "<C-W>p", { desc = "Other window" })

View File

@ -1,5 +1,4 @@
-- This file is automatically loaded by plugins.config
vim.g.mapleader = " "
vim.g.maplocalleader = " "
@ -28,7 +27,7 @@ opt.scrolloff = 4 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.shortmess:append { W = true, I = true, c = true }
opt.shortmess:append({ W = true, I = true, c = true })
opt.showmode = false -- Dont show mode since we have a statusline
opt.sidescrolloff = 8 -- Columns of context
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
@ -49,7 +48,7 @@ opt.wrap = false -- Disable line wrap
if vim.fn.has("nvim-0.9.0") == 1 then
opt.splitkeep = "screen"
opt.shortmess:append { C = true }
opt.shortmess:append({ C = true })
end
-- Fix markdown indentation settings

View File

@ -9,11 +9,23 @@ function M.check()
vim.health.report_error("Neovim >= 0.8.0 is required")
end
for _, cmd in ipairs({ "git", "rg", "fd", "lazygit" }) do
if vim.fn.executable(cmd) == 1 then
vim.health.report_ok(("`%s` is installed"):format(cmd))
for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do
local name = type(cmd) == "string" and cmd or vim.inspect(cmd)
local commands = type(cmd) == "string" and { cmd } or cmd
---@cast commands string[]
local found = false
for _, c in ipairs(commands) do
if vim.fn.executable(c) == 1 then
name = c
found = true
end
end
if found then
vim.health.report_ok(("`%s` is installed"):format(name))
else
vim.health.report_warn(("`%s` is not installed"):format(cmd))
vim.health.report_warn(("`%s` is not installed"):format(name))
end
end
end

View File

@ -3,6 +3,9 @@ return {
-- snippets
{
"L3MON4D3/LuaSnip",
build = (not jit.os:find("Windows"))
and "echo -e 'NOTE: jsregexp is optional, so not a big deal if it fails to build\n'; make install_jsregexp"
or nil,
dependencies = {
"rafamadriz/friendly-snippets",
config = function()
@ -50,11 +53,17 @@ return {
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 }),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<S-CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
@ -92,8 +101,9 @@ return {
-- surround
{
"echasnovski/mini.surround",
keys = function(plugin, keys)
keys = function(_, keys)
-- Populate the keys based on the user's options
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" } },
@ -104,6 +114,9 @@ return {
{ opts.mappings.replace, desc = "Replace surrounding" },
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
}
mappings = vim.tbl_filter(function(m)
return m[1] and #m[1] > 0
end, mappings)
return vim.list_extend(mappings, keys)
end,
opts = {
@ -148,15 +161,7 @@ return {
-- { "i", mode = { "x", "o" } },
-- },
event = "VeryLazy",
dependencies = {
{
"nvim-treesitter/nvim-treesitter-textobjects",
init = function()
-- no need to load the plugin, since we only need its queries
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
end,
},
},
dependencies = { "nvim-treesitter-textobjects" },
opts = function()
local ai = require("mini.ai")
return {
@ -172,8 +177,50 @@ return {
}
end,
config = function(_, opts)
local ai = require("mini.ai")
ai.setup(opts)
require("mini.ai").setup(opts)
-- register all text objects with which-key
if require("lazyvim.util").has("which-key.nvim") then
---@type table<string, string|table>
local i = {
[" "] = "Whitespace",
['"'] = 'Balanced "',
["'"] = "Balanced '",
["`"] = "Balanced `",
["("] = "Balanced (",
[")"] = "Balanced ) including white-space",
[">"] = "Balanced > including white-space",
["<lt>"] = "Balanced <",
["]"] = "Balanced ] including white-space",
["["] = "Balanced [",
["}"] = "Balanced } including white-space",
["{"] = "Balanced {",
["?"] = "User Prompt",
_ = "Underscore",
a = "Argument",
b = "Balanced ), ], }",
c = "Class",
f = "Function",
o = "Block, conditional, loop",
q = "Quote `, \", '",
t = "Tag",
}
local a = vim.deepcopy(i)
for k, v in pairs(a) do
a[k] = v:gsub(" including.*", "")
end
local ic = vim.deepcopy(i)
local ac = vim.deepcopy(a)
for key, name in pairs({ n = "Next", l = "Last" }) do
i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
end
require("which-key").register({
mode = { "o", "x" },
i = i,
a = a,
})
end
end,
},
}

View File

@ -2,5 +2,5 @@ require("lazyvim.config").init()
return {
{ "folke/lazy.nvim", version = "*" },
{ "LazyVim/LazyVim", priority = 10000, lazy = false, config = true, version = "*" },
{ "LazyVim/LazyVim", priority = 10000, lazy = false, config = true, cond = true, version = "*" },
}

View File

@ -46,6 +46,14 @@ return {
["<space>"] = "none",
},
},
default_component_configs = {
indent = {
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
},
},
},
@ -65,7 +73,7 @@ return {
version = false, -- telescope did only one release, so use HEAD for now
keys = {
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
{ "<leader>/", Util.telescope("live_grep"), desc = "Find in Files (Grep)" },
{ "<leader>/", Util.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)" },
-- find
@ -81,7 +89,8 @@ return {
{ "<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<cr>", desc = "Diagnostics" },
{ "<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>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
@ -90,6 +99,7 @@ return {
{ "<leader>sM", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
{ "<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"), desc = "Word (root dir)" },
{ "<leader>sW", Util.telescope("grep_string", { cwd = false }), desc = "Word (cwd)" },
{ "<leader>uC", Util.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" },
@ -111,6 +121,24 @@ return {
}),
desc = "Goto Symbol",
},
{
"<leader>sS",
Util.telescope("lsp_dynamic_workspace_symbols", {
symbols = {
"Class",
"Function",
"Method",
"Constructor",
"Interface",
"Module",
"Struct",
"Trait",
"Field",
"Property",
},
}),
desc = "Goto Symbol (Workspace)",
},
},
opts = {
defaults = {
@ -121,6 +149,9 @@ return {
["<c-t>"] = function(...)
return require("trouble.providers.telescope").open_with_trouble(...)
end,
["<a-t>"] = function(...)
return require("trouble.providers.telescope").open_selected_with_trouble(...)
end,
["<a-i>"] = function()
Util.telescope("find_files", { no_ignore = true })()
end,
@ -133,6 +164,17 @@ return {
["<C-Up>"] = function(...)
return require("telescope.actions").cycle_history_prev(...)
end,
["<C-f>"] = function(...)
return require("telescope.actions").preview_scrolling_down(...)
end,
["<C-b>"] = function(...)
return require("telescope.actions").preview_scrolling_up(...)
end,
},
n = {
["q"] = function(...)
return require("telescope.actions").close(...)
end,
},
},
},
@ -140,16 +182,33 @@ return {
},
-- easily jump to any location and enhanced f/t motions for Leap
{
"ggandor/flit.nvim",
keys = function()
---@type LazyKeys[]
local ret = {}
for _, key in ipairs({ "f", "F", "t", "T" }) do
ret[#ret + 1] = { key, mode = { "n", "x", "o" }, desc = key }
end
return ret
end,
opts = { labeled_modes = "nx" },
},
{
"ggandor/leap.nvim",
event = "VeryLazy",
dependencies = { { "ggandor/flit.nvim", opts = { labeled_modes = "nv" } } },
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" },
},
config = function(_, opts)
local leap = require("leap")
for k, v in pairs(opts) do
leap.opts[k] = v
end
leap.add_default_mappings(true)
vim.keymap.del({ "x", "o" }, "x")
vim.keymap.del({ "x", "o" }, "X")
end,
},
@ -159,11 +218,7 @@ return {
event = "VeryLazy",
opts = {
plugins = { spelling = true },
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register({
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
@ -171,30 +226,34 @@ return {
["["] = { name = "+prev" },
["<leader><tab>"] = { name = "+tabs" },
["<leader>b"] = { name = "+buffer" },
["<leader>c"] = { name = "+code" },
["<leader><lll"] = { name = "+code" },
["<leader>f"] = { name = "+file/find" },
["<leader>g"] = { name = "+git" },
["<leader>gh"] = { name = "+hunks" },
["<leader>q"] = { name = "+quit/session" },
["<leader>s"] = { name = "+search" },
["<leader>sn"] = { name = "+noice" },
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
})
},
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end,
},
-- git signs
{
"lewis6991/gitsigns.nvim",
event = "BufReadPre",
event = { "BufReadPre", "BufNewFile" },
opts = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
@ -225,22 +284,32 @@ return {
-- references
{
"RRethy/vim-illuminate",
event = "BufReadPost",
event = { "BufReadPost", "BufNewFile" },
opts = { delay = 200 },
config = function(_, opts)
require("illuminate").configure(opts)
local function map(key, dir, buffer)
vim.keymap.set("n", key, function()
require("illuminate")["goto_" .. dir .. "_reference"](false)
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
end
map("]]", "next")
map("[[", "prev")
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
vim.api.nvim_create_autocmd("FileType", {
callback = function()
local buffer = vim.api.nvim_get_current_buf()
pcall(vim.keymap.del, "n", "]]", { buffer = buffer })
pcall(vim.keymap.del, "n", "[[", { buffer = buffer })
map("]]", "next", buffer)
map("[[", "prev", buffer)
end,
})
end,
-- stylua: ignore
keys = {
{ "]]", function() require("illuminate").goto_next_reference(false) end, desc = "Next Reference", },
{ "[[", function() require("illuminate").goto_prev_reference(false) end, desc = "Prev Reference" },
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
},
@ -262,6 +331,30 @@ return {
keys = {
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
{
"[q",
function()
if require("trouble").is_open() then
require("trouble").previous({ skip_groups = true, jump = true })
else
vim.cmd.cprev()
end
end,
desc = "Previous trouble/quickfix item",
},
{
"]q",
function()
if require("trouble").is_open() then
require("trouble").next({ skip_groups = true, jump = true })
else
vim.cmd.cnext()
end
end,
desc = "Next trouble/quickfix item",
},
},
},
@ -269,7 +362,7 @@ return {
{
"folke/todo-comments.nvim",
cmd = { "TodoTrouble", "TodoTelescope" },
event = "BufReadPost",
event = { "BufReadPost", "BufNewFile" },
config = true,
-- stylua: ignore
keys = {
@ -278,6 +371,7 @@ return {
{ "<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" },
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
},
},
}

View File

@ -0,0 +1,76 @@
return {
-- copilot
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
build = ":Copilot auth",
opts = {
suggestion = { enabled = false },
panel = { enabled = false },
},
},
-- copilot cmp source
{
"nvim-cmp",
dependencies = {
{
"zbirenbaum/copilot-cmp",
dependencies = "copilot.lua",
opts = {},
config = function(_, opts)
local copilot_cmp = require("copilot_cmp")
copilot_cmp.setup(opts)
-- attach cmp source whenever copilot attaches
-- fixes lazy-loading issues with the copilot cmp source
require("lazyvim.util").on_attach(function(client)
if client.name == "copilot" then
copilot_cmp._on_insert_enter()
end
end)
end,
},
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local cmp = require("cmp")
table.insert(opts.sources, 1, { name = "copilot", group_index = 2 })
local confirm = opts.mapping["<CR>"]
local confirm_copilot = cmp.mapping.confirm({
select = true,
behavior = cmp.ConfirmBehavior.Replace,
})
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<CR>"] = function(...)
local entry = cmp.get_selected_entry()
if entry and entry.source.name == "copilot" then
return confirm_copilot(...)
end
return confirm(...)
end,
})
opts.sorting = {
priority_weight = 2,
comparators = {
require("copilot_cmp.comparators").prioritize,
-- Below is the default comparitor list and order for nvim-cmp
cmp.config.compare.offset,
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
cmp.config.compare.exact,
cmp.config.compare.score,
cmp.config.compare.recently_used,
cmp.config.compare.locality,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
}
end,
},
}

View File

@ -0,0 +1,93 @@
return {
"mfussenegger/nvim-dap",
dependencies = {
-- fancy UI for the debugger
{
"rcarriga/nvim-dap-ui",
-- stylua: ignore
keys = {
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }
},
opts = {},
config = function(_, opts)
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({})
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close({})
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close({})
end
end,
},
-- virtual text for the debugger
{
"theHamsta/nvim-dap-virtual-text",
opts = {},
},
-- which key integration
{
"folke/which-key.nvim",
opts = {
defaults = {
["<leader>d"] = { name = "+debug" },
["<leader>da"] = { name = "+adapters" },
},
},
},
-- mason.nvim integration
{
"jay-babu/mason-nvim-dap.nvim",
dependencies = "mason.nvim",
cmd = { "DapInstall", "DapUninstall" },
opts = {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_setup = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
},
},
},
},
-- stylua: ignore
keys = {
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>do", function() require("dap").step_over() end, desc = "Step Over" },
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
{ "<leader>dr", function() require("dap").repl.open() end, desc = "Repl" },
},
config = function()
local Config = require("lazyvim.config")
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
for name, sign in pairs(Config.icons.dap) do
sign = type(sign) == "table" and sign or { sign }
vim.fn.sign_define(
"Dap" .. name,
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
)
end
end,
}

View File

@ -0,0 +1,27 @@
return {
"mfussenegger/nvim-dap",
dependencies = {
{
"jbyuki/one-small-step-for-vimkind",
-- stylua: ignore
keys = {
{ "<leader>daL", function() require("osv").launch({ port = 8086 }) end, desc = "Adapter Lua Server" },
{ "<leader>dal", function() require("osv").run_this() end, desc = "Adapter Lua" },
},
config = function()
local dap = require("dap")
dap.adapters.nlua = function(callback, config)
callback({ type = "server", host = config.host or "127.0.0.1", port = config.port or 8086 })
end
dap.configurations.lua = {
{
type = "nlua",
request = "attach",
name = "Attach to running Neovim instance",
},
}
end,
},
},
}

View File

@ -0,0 +1,15 @@
return {
{
"williamboman/mason.nvim",
opts = function(_, opts)
table.insert(opts.ensure_installed, "prettierd")
end,
},
{
"jose-elias-alvarez/null-ls.nvim",
opts = function(_, opts)
local nls = require("null-ls")
table.insert(opts.sources, nls.builtins.formatting.prettierd)
end,
},
}

View File

@ -17,15 +17,23 @@ return {
opts = {
-- make sure mason installs the server
servers = {
tsserver = {},
---@type lspconfig.options.tsserver
tsserver = {
settings = {
completions = {
completeFunctionCalls = true,
},
},
},
},
setup = {
tsserver = function(_, opts)
require("lazyvim.util").on_attach(function(client, buffer)
if client.name == "tsserver" then
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
vim.keymap.set("n", "<leader>co", "<cmd>TypescriptOrganizeImports<CR>", { buffer = buffer, desc = "Organize Imports" })
-- stylua: ignore
vim.keymap.set("n", "<leader>cR", "<cmd>TypescriptRenameFile<CR>", { desc = "Rename File", buffer = buffer })
end
end)
require("typescript").setup({ server = opts })
@ -34,4 +42,10 @@ return {
},
},
},
{
"jose-elias-alvarez/null-ls.nvim",
opts = function(_, opts)
table.insert(opts.sources, require("typescript.extensions.null-ls.code-actions"))
end,
},
}

View File

@ -0,0 +1,27 @@
return {
{
"neovim/nvim-lspconfig",
-- other settings removed for brevity
opts = {
servers = {
eslint = {
settings = {
-- helps eslint find the eslintrc when it's placed in a subfolder instead of the cwd root
workingDirectory = { mode = "auto" },
},
},
},
setup = {
eslint = function()
vim.api.nvim_create_autocmd("BufWritePre", {
callback = function(event)
if require("lspconfig.util").get_active_client_by_name(event.buf, "eslint") then
vim.cmd("EslintFixAll")
end
end,
})
end,
},
},
},
}

View File

@ -35,6 +35,7 @@ return {
new_section("Lazy", "Lazy", "Config"),
new_section("New file", "ene | startinsert", "Built-in"),
new_section("Quit", "qa", "Built-in"),
new_section("Session restore", [[lua require("persistence").load()]], "Session"),
},
content_hooks = {
starter.gen_hook.adding_bullet(pad .. "", false),

View File

@ -5,7 +5,12 @@ local M = {}
M.autoformat = true
function M.toggle()
M.autoformat = not M.autoformat
if vim.b.autoformat == false then
vim.b.autoformat = nil
M.autoformat = true
else
M.autoformat = not M.autoformat
end
if M.autoformat then
Util.info("Enabled format on save", { title = "Format" })
else
@ -13,8 +18,12 @@ function M.toggle()
end
end
function M.format()
---@param opts? {force?:boolean}
function M.format(opts)
local buf = vim.api.nvim_get_current_buf()
if vim.b.autoformat == false and not (opts and opts.force) then
return
end
local ft = vim.bo[buf].filetype
local have_nls = #require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0
@ -30,6 +39,15 @@ function M.format()
end
function M.on_attach(client, buf)
-- dont format if client disabled it
if
client.config
and client.config.capabilities
and client.config.capabilities.documentFormattingProvider == false
then
return
end
if client.supports_method("textDocument/formatting") then
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("LspFormat." .. buf, {}),

View File

@ -2,7 +2,7 @@ return {
-- lspconfig
{
"neovim/nvim-lspconfig",
event = "BufReadPre",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
{ "folke/neodev.nvim", opts = { experimental = { pathStrict = true } } },
@ -28,7 +28,7 @@ return {
autoformat = true,
-- options for vim.lsp.buf.format
-- `bufnr` and `filter` is handled by the LazyVim formatter,
-- but can be also overriden when specified
-- but can be also overridden when specified
format = {
formatting_options = nil,
timeout_ms = nil,
@ -37,7 +37,7 @@ return {
---@type lspconfig.options
servers = {
jsonls = {},
sumneko_lua = {
lua_ls = {
-- mason = false, -- set to false if you don't want this server to be installed with mason
settings = {
Lua = {
@ -65,7 +65,7 @@ return {
},
},
---@param opts PluginLspOpts
config = function(plugin, opts)
config = function(_, opts)
-- setup autoformat
require("lazyvim.plugins.lsp.format").autoformat = opts.autoformat
-- setup formatting and keymaps
@ -85,8 +85,10 @@ return {
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
local function setup(server)
local server_opts = servers[server] or {}
server_opts.capabilities = capabilities
local server_opts = vim.tbl_deep_extend("force", {
capabilities = vim.deepcopy(capabilities),
}, servers[server] or {})
if opts.setup[server] then
if opts.setup[server](server, server_opts) then
return
@ -99,15 +101,19 @@ return {
require("lspconfig")[server].setup(server_opts)
end
local mlsp = require("mason-lspconfig")
local available = mlsp.get_available_servers()
-- get all the servers that are available thourgh mason-lspconfig
local have_mason, mlsp = pcall(require, "mason-lspconfig")
local all_mslp_servers = {}
if have_mason then
all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package)
end
local ensure_installed = {} ---@type string[]
for server, server_opts in pairs(servers) do
if server_opts then
server_opts = server_opts == true and {} or server_opts
-- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig
if server_opts.mason == false or not vim.tbl_contains(available, server) then
if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then
setup(server)
else
ensure_installed[#ensure_installed + 1] = server
@ -115,23 +121,28 @@ return {
end
end
require("mason-lspconfig").setup({ ensure_installed = ensure_installed })
require("mason-lspconfig").setup_handlers({ setup })
if have_mason then
mlsp.setup({ ensure_installed = ensure_installed })
mlsp.setup_handlers({ setup })
end
end,
},
-- formatters
{
"jose-elias-alvarez/null-ls.nvim",
event = "BufReadPre",
event = { "BufReadPre", "BufNewFile" },
dependencies = { "mason.nvim" },
opts = function()
local nls = require("null-ls")
return {
root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"),
sources = {
-- nls.builtins.formatting.prettierd,
nls.builtins.formatting.fish_indent,
nls.builtins.diagnostics.fish,
nls.builtins.formatting.stylua,
nls.builtins.diagnostics.flake8,
nls.builtins.formatting.shfmt,
-- nls.builtins.diagnostics.flake8,
},
}
end,
@ -146,21 +157,27 @@ return {
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
-- "flake8",
},
},
---@param opts MasonSettings | {ensure_installed: string[]}
config = function(plugin, opts)
config = function(_, opts)
require("mason").setup(opts)
local mr = require("mason-registry")
for _, tool in ipairs(opts.ensure_installed) do
local p = mr.get_package(tool)
if not p:is_installed() then
p:install()
local function ensure_installed()
for _, tool in ipairs(opts.ensure_installed) do
local p = mr.get_package(tool)
if not p:is_installed() then
p:install()
end
end
end
if mr.refresh then
mr.refresh(ensure_installed)
else
ensure_installed()
end
end,
},
}

View File

@ -5,31 +5,63 @@ M._keys = nil
---@return (LazyKeys|{has?:string})[]
function M.get()
local format = require("lazyvim.plugins.lsp.format").format
local format = function()
require("lazyvim.plugins.lsp.format").format({ force = true })
end
if not M._keys then
---@class PluginLspKeys
-- stylua: ignore
M._keys = M._keys or {
{ "<leader>cd", vim.diagnostic.open_float, desc = "Line Diagnostics" },
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
{ "gd", "<cmd>Telescope lsp_definitions<cr>", desc = "Goto Definition" },
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
{ "gI", "<cmd>Telescope lsp_implementations<cr>", desc = "Goto Implementation" },
{ "gt", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto Type Definition" },
{ "K", vim.lsp.buf.hover, desc = "Hover" },
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
{ "]d", M.diagnostic_goto(true), desc = "Next Diagnostic" },
{ "[d", M.diagnostic_goto(false), desc = "Prev Diagnostic" },
{ "]e", M.diagnostic_goto(true, "ERROR"), desc = "Next Error" },
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
{ "<leader>cf", format, desc = "Format Document", has = "documentFormatting" },
{ "<leader>cf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" },
{ "<leader>cr", M.rename, expr = true, desc = "Rename", has = "rename" },
}
-- stylua: ignore
M._keys = {
{ "<leader>cd", vim.diagnostic.open_float, desc = "Line Diagnostics" },
{ "<leader>cl", "<cmd>LspInfo<cr>", desc = "Lsp Info" },
{ "gd", "<cmd>Telescope lsp_definitions<cr>", desc = "Goto Definition", has = "definition" },
{ "gr", "<cmd>Telescope lsp_references<cr>", desc = "References" },
{ "gD", vim.lsp.buf.declaration, desc = "Goto Declaration" },
{ "gI", "<cmd>Telescope lsp_implementations<cr>", desc = "Goto Implementation" },
{ "gy", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto T[y]pe Definition" },
{ "K", vim.lsp.buf.hover, desc = "Hover" },
{ "gK", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" },
{ "<c-k>", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" },
{ "]d", M.diagnostic_goto(true), desc = "Next Diagnostic" },
{ "[d", M.diagnostic_goto(false), desc = "Prev Diagnostic" },
{ "]e", M.diagnostic_goto(true, "ERROR"), desc = "Next Error" },
{ "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" },
{ "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" },
{ "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" },
{ "<leader>cf", format, desc = "Format Document", has = "documentFormatting" },
{ "<leader>cf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" },
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code Action", mode = { "n", "v" }, has = "codeAction" },
{
"<leader>cA",
function()
vim.lsp.buf.code_action({
context = {
only = {
"source",
},
diagnostics = {},
},
})
end,
desc = "Source Action",
has = "codeAction",
}
}
if require("lazyvim.util").has("inc-rename.nvim") then
M._keys[#M._keys + 1] = {
"<leader>cr",
function()
local inc_rename = require("inc_rename")
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
end,
expr = true,
desc = "Rename",
has = "rename",
}
else
M._keys[#M._keys + 1] = { "<leader>cr", vim.lsp.buf.rename, desc = "Rename", has = "rename" }
end
end
return M._keys
end
@ -51,21 +83,13 @@ function M.on_attach(client, buffer)
local opts = Keys.opts(keys)
---@diagnostic disable-next-line: no-unknown
opts.has = nil
opts.silent = true
opts.silent = opts.silent ~= false
opts.buffer = buffer
vim.keymap.set(keys.mode or "n", keys[1], keys[2], opts)
end
end
end
function M.rename()
if pcall(require, "inc_rename") then
return ":IncRename " .. vim.fn.expand("<cword>")
else
vim.lsp.buf.rename()
end
end
function M.diagnostic_goto(next, severity)
local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev
severity = severity and vim.diagnostic.severity[severity] or nil

View File

@ -3,10 +3,32 @@ return {
"nvim-treesitter/nvim-treesitter",
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
event = "BufReadPost",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
{
"nvim-treesitter/nvim-treesitter-textobjects",
init = function()
-- PERF: no need to load the plugin, if we only need its queries for mini.ai
local plugin = require("lazy.core.config").spec.plugins["nvim-treesitter"]
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
local enabled = false
if opts.textobjects then
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
if opts.textobjects[mod] and opts.textobjects[mod].enable then
enabled = true
break
end
end
end
if not enabled then
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
end
end,
},
},
keys = {
{ "<c-space>", desc = "Increment selection" },
{ "<bs>", desc = "Schrink selection", mode = "x" },
{ "<bs>", desc = "Decrement selection", mode = "x" },
},
---@type TSConfig
opts = {
@ -15,11 +37,13 @@ return {
context_commentstring = { enable = true, enable_autocmd = false },
ensure_installed = {
"bash",
"help",
"c",
"html",
"javascript",
"json",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"python",
@ -28,6 +52,7 @@ return {
"tsx",
"typescript",
"vim",
"vimdoc",
"yaml",
},
incremental_selection = {

View File

@ -20,6 +20,15 @@ return {
return math.floor(vim.o.columns * 0.75)
end,
},
init = function()
-- when noice is not enabled, install notify on VeryLazy
local Util = require("lazyvim.util")
if not Util.has("noice.nvim") then
Util.on_very_lazy(function()
vim.notify = require("notify")
end)
end
end,
},
-- better vim.ui
@ -44,6 +53,10 @@ return {
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
keys = {
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
},
opts = {
options = {
diagnostics = "nvim_lsp",
@ -70,7 +83,7 @@ return {
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(plugin)
opts = function()
local icons = require("lazyvim.config").icons
local function fg(name)
@ -85,7 +98,7 @@ return {
options = {
theme = "auto",
globalstatus = true,
disabled_filetypes = { statusline = { "dashboard", "lazy", "alpha" } },
disabled_filetypes = { statusline = { "dashboard", "alpha" } },
},
sections = {
lualine_a = { "mode" },
@ -132,7 +145,7 @@ return {
},
},
lualine_y = {
{ "progress", separator = "", padding = { left = 1, right = 0 } },
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
{ "location", padding = { left = 0, right = 1 } },
},
lualine_z = {
@ -141,7 +154,7 @@ return {
end,
},
},
extensions = { "neo-tree" },
extensions = { "neo-tree", "lazy" },
}
end,
},
@ -149,7 +162,7 @@ return {
-- indent guides for Neovim
{
"lukas-reineke/indent-blankline.nvim",
event = "BufReadPost",
event = { "BufReadPost", "BufNewFile" },
opts = {
-- char = "▏",
char = "",
@ -163,19 +176,21 @@ return {
{
"echasnovski/mini.indentscope",
version = false, -- wait till new 0.7.0 release to put it back on semver
event = "BufReadPre",
event = { "BufReadPre", "BufNewFile" },
opts = {
-- symbol = "▏",
symbol = "",
options = { try_as_border = true },
},
config = function(_, opts)
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = { "help", "alpha", "dashboard", "neo-tree", "Trouble", "lazy", "mason" },
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
config = function(_, opts)
require("mini.indentscope").setup(opts)
end,
},
@ -184,6 +199,17 @@ return {
{
"folke/noice.nvim",
event = "VeryLazy",
dependencies = {
-- which key integration
{
"folke/which-key.nvim",
opts = function(_, opts)
if require("lazyvim.util").has("noice.nvim") then
opts.defaults["<leader>sn"] = { name = "+noice" }
end
end,
},
},
opts = {
lsp = {
override = {
@ -203,6 +229,7 @@ return {
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
{ "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll forward", mode = {"i", "n", "s"} },
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll backward", mode = {"i", "n", "s"}},
},
@ -225,28 +252,26 @@ return {
dashboard.section.header.val = vim.split(logo, "\n")
dashboard.section.buttons.val = {
dashboard.button("f", " " .. " Find file", ":Telescope find_files <CR>"),
dashboard.button("f", " " .. " Find file", ":Telescope find_files <CR>"),
dashboard.button("n", "" .. " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles <CR>"),
dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles <CR>"),
dashboard.button("g", "" .. " Find text", ":Telescope live_grep <CR>"),
dashboard.button("c", "" .. " Config", ":e $MYVIMRC <CR>"),
dashboard.button("s", "" .. " Restore Session", [[:lua require("persistence").load() <cr>]]),
dashboard.button("l", "" .. " Lazy", ":Lazy<CR>"),
dashboard.button("s", "" .. " Restore Session", [[:lua require("persistence").load() <cr>]]),
dashboard.button("l", "󰒲 " .. " Lazy", ":Lazy<CR>"),
dashboard.button("q", "" .. " Quit", ":qa<CR>"),
}
for _, button in ipairs(dashboard.section.buttons.val) do
button.opts.hl = "AlphaButtons"
button.opts.hl_shortcut = "AlphaShortcut"
end
dashboard.section.footer.opts.hl = "Type"
dashboard.section.header.opts.hl = "AlphaHeader"
dashboard.section.buttons.opts.hl = "AlphaButtons"
dashboard.section.footer.opts.hl = "AlphaFooter"
dashboard.opts.layout[1].val = 8
return dashboard
end,
config = function(_, dashboard)
vim.b.miniindentscope_disable = true
-- close Lazy and re-open when the dashboard is ready
if vim.o.filetype == "lazy" then
vim.cmd.close()

View File

@ -13,7 +13,7 @@ return {
{
"folke/persistence.nvim",
event = "BufReadPre",
opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help" } },
opts = { options = { "buffers", "curdir", "tabpages", "winsize", "help", "globals" } },
-- stylua: ignore
keys = {
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },

View File

@ -54,6 +54,23 @@ function M.keymaps()
end
end)
Util.walk(root .. "/lua/lazyvim/plugins/extras", function(path, name, t)
if t == "file" and name:find("%.lua$") then
local modname = path:gsub(".*/lua/", ""):gsub("/", "."):gsub("%.lua$", "")
local extra_doc = "/plugins/extras/" .. modname:gsub("lazyvim%.plugins%.extras%.", "")
local extra = require("lazy.core.plugin").Spec.new({ import = modname })
Util.foreach(extra.plugins, function(name, plugin)
group = ("[%s](%s)\nPart of [%s](%s)"):format(plugin.name, plugin.url, modname, extra_doc)
for _, key in ipairs(plugin.keys or {}) do
if type(key) == "table" and key.desc then
local desc = key.desc or ""
map(key.mode or "n", key[1], key[2], { desc = desc })
end
end
end)
end
end)
---@type string[]
local lines = {}
@ -129,13 +146,51 @@ import TabItem from '@theme/TabItem';
return { content = table.concat(lines, "\n") }
end
function M.recipes()
local src = Util.read_file(vim.fs.normalize("~/projects/lazyvim.github.io/lua/recipes.lua"))
local lines = vim.split(src, "\n")
local ret = {}
local header = {} ---@type string[]
local block = {} ---@type string[]
for _, line in ipairs(lines) do
local comment = line:match("^ %-%- ?(.*)")
if comment then
header[#header + 1] = comment
elseif line:find("^ {") then
block = { "{" }
elseif line:find("^ }") then
block[#block + 1] = " }"
vim.list_extend(ret, header)
ret[#ret + 1] = "\n```lua"
local code = Docs.fix_indent(table.concat(block, "\n"))
ret[#ret + 1] = code
ret[#ret + 1] = "```\n"
header = {}
block = {}
else
block[#block + 1] = line
end
end
return { content = table.concat(ret, "\n") }
end
function M.update2()
local docs = vim.fs.normalize("~/projects/lazyvim.github.io/docs")
local config = Docs.extract("lua/lazyvim/config/init.lua", "\nlocal defaults = ({.-\n})")
Docs.save({
config = config,
}, docs .. "/configuration/index.md")
Docs.save({
general = M.general(),
}, docs .. "/configuration/general.md")
Docs.save({
recipes = M.recipes(),
}, docs .. "/configuration/recipes.md")
Docs.save({
lazy = {
content = [[```lua title="lua/config/lazy.lua"]] .. "\n" .. Util.read_file(
@ -218,7 +273,7 @@ function M.plugins(path)
local function find_plugins(node)
if node:type() == "string" then
local text = vim.treesitter.query.get_node_text(node, source):sub(2, -2)
local text = vim.treesitter.get_node_text(node, source):sub(2, -2)
if text:find("/") and #node:parent():field("name") == 0 then
local plugin_node = node:parent():parent()
if plugin_node:named_child(0):field("value")[1]:id() ~= node:id() then

View File

@ -20,6 +20,16 @@ function M.has(plugin)
return require("lazy.core.config").plugins[plugin] ~= nil
end
---@param fn fun()
function M.on_very_lazy(fn)
vim.api.nvim_create_autocmd("User", {
pattern = "VeryLazy",
callback = function()
fn()
end,
})
end
---@param name string
function M.opts(name)
local plugin = require("lazy.core.config").plugins[name]
@ -72,7 +82,7 @@ function M.get_root()
end
-- this will return a function that calls telescope.
-- cwd will defautlt to lazyvim.util.get_root
-- cwd will default to lazyvim.util.get_root
-- for `files`, git_files or find_files will be chosen depending on .git
function M.telescope(builtin, opts)
local params = { builtin = builtin, opts = opts }
@ -92,15 +102,17 @@ function M.telescope(builtin, opts)
end
end
-- FIXME: create a togglable terminal
-- Opens a floating terminal (interactive by default)
---@param cmd? string[]|string
---@param opts? LazyCmdOptions|{interactive?:boolean}
---@param opts? LazyCmdOptions|{interactive?:boolean, esc_esc?:false}
function M.float_term(cmd, opts)
opts = vim.tbl_deep_extend("force", {
size = { width = 0.9, height = 0.9 },
}, opts or {})
require("lazy.util").float_term(cmd, opts)
local float = require("lazy.util").float_term(cmd, opts)
if opts.esc_esc == false then
vim.keymap.set("t", "<esc>", "<esc>", { buffer = float.buf, nowait = true })
end
end
---@param silent boolean?