Compare commits

..

142 Commits

Author SHA1 Message Date
77efbe8bcf chore(main): release 2.3.0 (#606)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-17 20:53:26 +02:00
cfaf3b054e feat(dap): add step out, rebind step over (#605) 2023-04-17 17:53:39 +02:00
5f6913c0db chore(main): release 2.2.1 (#601)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-17 08:51:54 +02:00
a94f7afdeb fix(telescope): typo 2023-04-17 08:49:38 +02:00
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
28 changed files with 909 additions and 176 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

View File

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 February 14
*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/211285846-0b7bb3bf-0462-4029-b64c-4ee1d037fc1c.png" title="fig:"/>
<p class="caption">image</p>
</div>
<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>
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,44 +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.
Theres a great video created by elijahmano <https://github.com/elijahmanor>
with a walkthrough to get started.
<img src='https://img.youtube.com/vi/N93cTbtLCIM/hqdefault.jpg' title=''/>
<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.lua
</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

@ -42,15 +42,16 @@ vim.api.nvim_create_autocmd("BufReadPost", {
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
@ -67,3 +68,15 @@ vim.api.nvim_create_autocmd("FileType", {
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

@ -14,14 +14,22 @@ local defaults = {
defaults = {
autocmds = true, -- lazyvim.config.autocmds
keymaps = true, -- lazyvim.config.keymaps
options = true, -- lazyvim.config.options
-- 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 = {
@ -42,7 +50,7 @@ local defaults = {
Event = "",
Field = "",
File = "",
Folder = " ",
Folder = " ",
Function = "",
Interface = "",
Key = "",
@ -50,7 +58,7 @@ local defaults = {
Method = "",
Module = "",
Namespace = "",
Null = " ",
Null = " ",
Number = "",
Object = "",
Operator = "",
@ -132,15 +140,16 @@ function M.load(name)
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] then
if M.defaults[name] or name == "options" then
_load("lazyvim.config." .. name)
end
_load("config." .. name)

View File

@ -64,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" })
@ -96,6 +95,11 @@ 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" })
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
-- toggle options
@ -108,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" })
@ -122,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()
@ -57,6 +60,10 @@ return {
["<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" },
@ -107,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 = {
@ -151,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 {

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,
@ -151,10 +182,25 @@ 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
@ -172,11 +218,7 @@ return {
event = "VeryLazy",
opts = {
plugins = { spelling = true },
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
local keymaps = {
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
@ -193,11 +235,12 @@ return {
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
}
if Util.has("noice.nvim") then
keymaps["<leader>sn"] = { name = "+noice" }
end
wk.register(keymaps)
},
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end,
},
@ -209,8 +252,8 @@ return {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
@ -245,18 +288,28 @@ return {
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" },
},
},
@ -280,6 +333,28 @@ return {
{ "<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",
},
},
},
@ -296,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,94 @@
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>do", function() require("dap").step_out() end, desc = "Step Out" },
{ "<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,7 +17,14 @@ return {
opts = {
-- make sure mason installs the server
servers = {
tsserver = {},
---@type lspconfig.options.tsserver
tsserver = {
settings = {
completions = {
completeFunctionCalls = true,
},
},
},
},
setup = {
tsserver = function(_, opts)
@ -25,6 +32,7 @@ return {
if client.name == "tsserver" then
-- stylua: ignore
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)
@ -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

@ -18,9 +18,10 @@ 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 then
if vim.b.autoformat == false and not (opts and opts.force) then
return
end
local ft = vim.bo[buf].filetype

View File

@ -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
@ -101,23 +101,19 @@ return {
require("lspconfig")[server].setup(server_opts)
end
-- temp fix for lspconfig rename
-- https://github.com/neovim/nvim-lspconfig/pull/2439
local mappings = require("mason-lspconfig.mappings.server")
if not mappings.lspconfig_to_package.lua_ls then
mappings.lspconfig_to_package.lua_ls = "lua-language-server"
mappings.package_to_lspconfig["lua-language-server"] = "lua_ls"
-- 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 mlsp = require("mason-lspconfig")
local available = mlsp.get_available_servers()
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
@ -125,8 +121,10 @@ 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,
},
@ -138,10 +136,13 @@ return {
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,
@ -156,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,18 +5,20 @@ 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 = {
{ "<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" },
{ "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" },
{ "gt", "<cmd>Telescope lsp_type_definitions<cr>", desc = "Goto Type Definition" },
{ "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" },
@ -26,16 +28,31 @@ function M.get()
{ "[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>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()
require("inc_rename")
return ":IncRename " .. vim.fn.expand("<cword>")
local inc_rename = require("inc_rename")
return ":" .. inc_rename.config.cmd_name .. " " .. vim.fn.expand("<cword>")
end,
expr = true,
desc = "Rename",
@ -66,7 +83,7 @@ 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

View File

@ -4,9 +4,31 @@ return {
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
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

@ -83,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)
@ -98,7 +98,7 @@ return {
options = {
theme = "auto",
globalstatus = true,
disabled_filetypes = { statusline = { "dashboard", "lazy", "alpha" } },
disabled_filetypes = { statusline = { "dashboard", "alpha" } },
},
sections = {
lualine_a = { "mode" },
@ -145,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 = {
@ -154,7 +154,7 @@ return {
end,
},
},
extensions = { "neo-tree" },
extensions = { "neo-tree", "lazy" },
}
end,
},
@ -182,13 +182,15 @@ return {
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,
},
@ -197,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 = {
@ -216,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"}},
},
@ -238,22 +252,22 @@ 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,

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 = {}
@ -256,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

@ -102,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?