Compare commits
112 Commits
v0.1.0-alp
...
v0.4.0-alp
Author | SHA1 | Date | |
---|---|---|---|
11839bf6a3 | |||
2a440a1a06 | |||
354416f3d5 | |||
5d3e126b63 | |||
3362f0abc4 | |||
c2693e2d16 | |||
dc3db065a8 | |||
6e2a462a78 | |||
bb4e924bca | |||
46c0948174 | |||
87ec3af110 | |||
e6455b01a2 | |||
fe4b92492c | |||
895c5d8dd0 | |||
709181113d | |||
ba0040230e | |||
201a3d171e | |||
88c112fc3a | |||
7563b361b8 | |||
254d3a0921 | |||
2d3137e1db | |||
8d8626c5d9 | |||
97996faf75 | |||
876d52fee3 | |||
b890129aec | |||
fd95026665 | |||
89c5d587f7 | |||
aa47cc862b | |||
b0a83a5816 | |||
5a99809844 | |||
3af1922f21 | |||
bf31eccae2 | |||
3d498ee713 | |||
5b8935b383 | |||
6a3f3d3032 | |||
b7fe8a8adc | |||
b278b062ec | |||
30b7215de8 | |||
4faf17f24c | |||
e03471df70 | |||
5987570b52 | |||
cbd534242c | |||
b17ede1ae2 | |||
f9de5d0e8a | |||
40d363cf3f | |||
688436c9af | |||
1efc925d16 | |||
40113b2639 | |||
c61e28fb4b | |||
30dc8c5732 | |||
51690c0c39 | |||
a33d906524 | |||
0ea177d5b3 | |||
c6b83a82bf | |||
87c37f287b | |||
46dba8f67e | |||
ed87ba777f | |||
713b37c068 | |||
f39f8aa220 | |||
e604d36440 | |||
f32ebb9182 | |||
24923ed31a | |||
f8b77db51b | |||
0cfc15e739 | |||
23476f1d3c | |||
1e4b958b4a | |||
ed0628286f | |||
6674a3accf | |||
2ea489c7ba | |||
06107862a7 | |||
94e5446f92 | |||
052b17bc51 | |||
318b56c1c4 | |||
e405023530 | |||
83d18dbcee | |||
bbb59d3ffd | |||
207beafda2 | |||
285c6d5686 | |||
d568098374 | |||
81d798fdaa | |||
701337fac8 | |||
3dd367caac | |||
cce3129e99 | |||
7a68907b39 | |||
6cf6959254 | |||
2128bf3e20 | |||
74063135d8 | |||
9d69c7f473 | |||
f22c21c52f | |||
08f6375e4c | |||
4d7455ad2c | |||
dcf520f3a7 | |||
7b943822db | |||
48d1e8df12 | |||
04a898a326 | |||
36c84f47c9 | |||
aafc033927 | |||
7f32af4ced | |||
1d6ce4fc57 | |||
542920fb82 | |||
73b38e6187 | |||
c76e8838b2 | |||
2a1b678dd8 | |||
b6c28f7a30 | |||
01bfb31637 | |||
0789574913 | |||
ce250bfbbd | |||
348b57ef96 | |||
0783fb55fe | |||
50f0e45518 | |||
e9175caf32 | |||
476eaa5045 |
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -58,7 +58,6 @@ jobs:
|
||||
prerelease: true
|
||||
bump-minor-pre-major: true
|
||||
bump-patch-for-minor-pre-major: true
|
||||
release-as: 0.1.0-alpha
|
||||
- uses: actions/checkout@v2
|
||||
- name: tag stable versions
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
|
138
CHANGELOG.md
138
CHANGELOG.md
@ -1,5 +1,143 @@
|
||||
# Changelog
|
||||
|
||||
## [0.4.0-alpha](https://github.com/LazyVim/LazyVim/compare/v0.3.0-alpha...v0.4.0-alpha) (2023-01-20)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **buffer:** remove `<leader>b[`, `<leader>b]` in favor of `]b` and `[b`
|
||||
* **treesitter:** use `<bs>` in visual mode to shrink delection. Fixes #71
|
||||
|
||||
### Features
|
||||
|
||||
* **buffer:** remove `<leader>b[`, `<leader>b]` in favor of `]b` and `[b` ([3362f0a](https://github.com/LazyVim/LazyVim/commit/3362f0abc4a70c82dc1ea81fca169e14bbb61c6a))
|
||||
* **keymaps:** added `[b` and `]b` to switch buffers ([c2693e2](https://github.com/LazyVim/LazyVim/commit/c2693e2d16ffc7f082d7b22b0da2d448a34b3778))
|
||||
* **lsp:** ignore lsp servers where setting is set to `false` ([5d3e126](https://github.com/LazyVim/LazyVim/commit/5d3e126b63c3ebebc01cf7f847464562c553bf32))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **lsp:** there is no declaration in telescope, use vim.lsp ([#78](https://github.com/LazyVim/LazyVim/issues/78)) ([fe4b924](https://github.com/LazyVim/LazyVim/commit/fe4b92492ca1c8bba826609ed2c34fd927068e0e))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **treesitter:** use `<bs>` in visual mode to shrink delection. Fixes [#71](https://github.com/LazyVim/LazyVim/issues/71) ([ba00402](https://github.com/LazyVim/LazyVim/commit/ba0040230e56edb04ca26702f0816392a87405fd))
|
||||
|
||||
## [0.3.0-alpha](https://github.com/LazyVim/LazyVim/compare/v0.2.2-alpha...v0.3.0-alpha) (2023-01-17)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **todo:** `<leader>xtt` => `<leader>xT`
|
||||
* **todo:** moved search todo to `<leader>st`
|
||||
* **telescope:** moved search diagnostics to `<leader>sd`
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **keymaps:** added Inspect to `<leader>ui` ([8d8626c](https://github.com/LazyVim/LazyVim/commit/8d8626c5d91ed0d5125dd2560271600c35bcf485))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **telescope:** moved search diagnostics to `<leader>sd` ([254d3a0](https://github.com/LazyVim/LazyVim/commit/254d3a092184b4327049ac7a0bc5202673f92c64))
|
||||
* **todo:** `<leader>xtt` => `<leader>xT` ([88c112f](https://github.com/LazyVim/LazyVim/commit/88c112fc3ae298fe3a0414a689cbd715db0ad2e3))
|
||||
* **todo:** moved search todo to `<leader>st` ([7563b36](https://github.com/LazyVim/LazyVim/commit/7563b361b8d7f62a75a6eb4e234326773ffbc89b))
|
||||
|
||||
## [0.2.2-alpha](https://github.com/LazyVim/LazyVim/compare/v0.2.1-alpha...v0.2.2-alpha) (2023-01-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **windows:** set version=false for treesitter. Last release is too old and broken on Windows. Fixes [#2](https://github.com/LazyVim/LazyVim/issues/2) ([876d52f](https://github.com/LazyVim/LazyVim/commit/876d52fee3e41d2c6d166bc05b06072fe443fb5e))
|
||||
|
||||
## [0.2.1-alpha](https://github.com/LazyVim/LazyVim/compare/v0.2.0-alpha...v0.2.1-alpha) (2023-01-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **keymaps:** added shortcuts for split and vsplit `<leader>-` and `<leader>|` ([5a99809](https://github.com/LazyVim/LazyVim/commit/5a99809844da64d18f2f1b9f5a3ef94f276e203e))
|
||||
* **mini.surround:** added lazy keys with descriptions to mini.surround ([bf31ecc](https://github.com/LazyVim/LazyVim/commit/bf31eccae20a7169024c115af52f134aef806cf5))
|
||||
* **treesitter:** added incremental selection ([3af1922](https://github.com/LazyVim/LazyVim/commit/3af1922f216f737cbcfbe44c0948dfc9688bbb63))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **version:** don't use version for schemastore and nvim-cmp. Last version is too old ([3d498ee](https://github.com/LazyVim/LazyVim/commit/3d498ee7136be179aada077d39c14adff6056187))
|
||||
|
||||
## [0.2.0-alpha](https://github.com/LazyVim/LazyVim/compare/v0.1.0-alpha...v0.2.0-alpha) (2023-01-16)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **telescope:** moved most `help` keymaps under `<leader>s` (search)
|
||||
* **neotree:** keymaps are now under `<leader>fe` and `<leader>fE`
|
||||
* **noice:** noice keymaps are now under `<leader>sn`
|
||||
* **keymaps:** terminal keymaps are now under `<leader>ft` and `<leader>fT`
|
||||
* **keymaps:** redraw is now mapped to `<leader>ur` (UI redraw)
|
||||
* **keymaps:** toggle keymaps can now be found under UI `<leader>u`
|
||||
* **colorscheme:** LazyVim now loads the colorscheme configured with config.colorscheme. See the docs for more info
|
||||
* **config:** LazyVim can now be configured like any other plugin with {"LazyVim/LazyVim", opts = ... }. `config.settings` is deprecated
|
||||
* **keymaps:** remove keymaps for [p and ]p
|
||||
|
||||
### Features
|
||||
|
||||
* added vim-repeat. Fixes [#56](https://github.com/LazyVim/LazyVim/issues/56) ([688436c](https://github.com/LazyVim/LazyVim/commit/688436c9af696f978c56f807e78fbc2df0314314))
|
||||
* **autocmds:** rebalance windows on resize ([6674a3a](https://github.com/LazyVim/LazyVim/commit/6674a3accf83b86ab9c978db002763f46c3f09bc))
|
||||
* **colorscheme:** LazyVim now loads the colorscheme configured with config.colorscheme. See the docs for more info ([08f6375](https://github.com/LazyVim/LazyVim/commit/08f6375e4caa33759dd29c0bb022de0ae2ff5e3f))
|
||||
* **config:** LazyVim can now be configured like any other plugin with {"LazyVim/LazyVim", opts = ... }. `config.settings` is deprecated ([36c84f4](https://github.com/LazyVim/LazyVim/commit/36c84f47c9f55ea818384d953c8fbeb7e99de8e6))
|
||||
* **config:** show an error when the needed version of `lazy.nvim` is too old ([7b94382](https://github.com/LazyVim/LazyVim/commit/7b943822db090e2eebeada5ace0b3b31fd772b89))
|
||||
* **keymaps:** added `<leader>r` to redraw and clear hlsearch ([1d6ce4f](https://github.com/LazyVim/LazyVim/commit/1d6ce4fc57f99188af410e91e632b11428ef3d22))
|
||||
* **keymaps:** redraw is now mapped to `<leader>ur` (UI redraw) ([1e4b958](https://github.com/LazyVim/LazyVim/commit/1e4b958b4a4d9f9ac3b54b981415ed8888ff2faf))
|
||||
* **keymaps:** remove keymaps for [p and ]p ([73b38e6](https://github.com/LazyVim/LazyVim/commit/73b38e6187d0801fed43fbac55ff4db950ffe20d))
|
||||
* **keymaps:** toggle keymaps can now be found under UI `<leader>u` ([ed06282](https://github.com/LazyVim/LazyVim/commit/ed0628286f9e896932286f29c163592dad079ce3))
|
||||
* **lsp:** added `<c-k>` for signature help in insert mode ([b17ede1](https://github.com/LazyVim/LazyVim/commit/b17ede1ae2acc3ef0398c85f5780083170b7acbc))
|
||||
* **lsp:** added `opts.autoformat` to be able to disable autoformat by default. Fixes [#65](https://github.com/LazyVim/LazyVim/issues/65) ([b278b06](https://github.com/LazyVim/LazyVim/commit/b278b062ecac5bef54a6fef3513655b93dd3032f))
|
||||
* **lsp:** allow overriding options for vim.lsp.buf.format. Fixes [#51](https://github.com/LazyVim/LazyVim/issues/51) ([40d363c](https://github.com/LazyVim/LazyVim/commit/40d363cf3f468a1cc4ea482eaabbd5c7e224f397))
|
||||
* **lsp:** make diagnostics configurable with `{"neovim/nvim-lspconfig", opts = {diagnostics = {}}}`. Fixes [#55](https://github.com/LazyVim/LazyVim/issues/55) ([1efc925](https://github.com/LazyVim/LazyVim/commit/1efc925d16b57659cbb9af5a1579cb1b9ee9643f))
|
||||
* **neo-tree:** added `<leader>e` and `<leader>E` to toggle neo-tree ([542920f](https://github.com/LazyVim/LazyVim/commit/542920fb8249d45d1e9ddbf6517a8f8539769eda))
|
||||
* **neo-tree:** load neo-tree when specifying a direcory on the cmdline ([81d798f](https://github.com/LazyVim/LazyVim/commit/81d798fdaa5bf49737969e0f15af4a90621a0a61))
|
||||
* **notify:** delay notifs till replaced or at most 500ms to prevent more prompts ([701337f](https://github.com/LazyVim/LazyVim/commit/701337fac8cb1de0f3e31400cef30b053762320f))
|
||||
* **notify:** lazy-load nvim-notify to show proper notifs before Noice loads ([7406313](https://github.com/LazyVim/LazyVim/commit/74063135d838b0ed9fe1a8d0e777c8cfe83ae28f))
|
||||
* **util:** use lazy's notify instead of `vim.notify` ([48d1e8d](https://github.com/LazyVim/LazyVim/commit/48d1e8df12795cf559f704223b63e76259998582))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add tsx treesitter to typescript lang module ([#48](https://github.com/LazyVim/LazyVim/issues/48)) ([a33d906](https://github.com/LazyVim/LazyVim/commit/a33d90652428ef4224b43e8f4cbec447c85fb117))
|
||||
* **autocmds:** load autocmds during startup when argc > 0. Fixes [#34](https://github.com/LazyVim/LazyVim/issues/34) ([318b56c](https://github.com/LazyVim/LazyVim/commit/318b56c1c425d90c71c0b63c6ec7655a8f019fa1))
|
||||
* **bufferline:** load bufferline on VeryLazy event ([#35](https://github.com/LazyVim/LazyVim/issues/35)) ([#36](https://github.com/LazyVim/LazyVim/issues/36)) ([207beaf](https://github.com/LazyVim/LazyVim/commit/207beafda215e4657bf083b94c80d455fc5de86b))
|
||||
* **format:** typo timeout -> timeout_ms ([f9de5d0](https://github.com/LazyVim/LazyVim/commit/f9de5d0e8a1a8782c9b2cc07f6964f6192f36b29))
|
||||
* **json:** correct case for SchemaStore.nvim ([04a898a](https://github.com/LazyVim/LazyVim/commit/04a898a326d6e719ca82ce062d82355feb0f3a1e))
|
||||
* **keymaps:** `<leader>ur` now does the same as Neovim's better `<c-l>` ([30dc8c5](https://github.com/LazyVim/LazyVim/commit/30dc8c57326aaf772f0e789f9a2523c63b89e7fe))
|
||||
* **keymaps:** add missing wk entries for buffer switching; lowercase UI in menu ([#45](https://github.com/LazyVim/LazyVim/issues/45)) ([46dba8f](https://github.com/LazyVim/LazyVim/commit/46dba8f67e96cb8aa5496351696b11b49093ecc8))
|
||||
* **keymaps:** Add unique keymap to toggle relative number ([#60](https://github.com/LazyVim/LazyVim/issues/60)) ([e03471d](https://github.com/LazyVim/LazyVim/commit/e03471df70a666d68285add56d3ed319d8cc009a))
|
||||
* **keymaps:** Resolve comment after PR got merged ([#61](https://github.com/LazyVim/LazyVim/issues/61)) ([30b7215](https://github.com/LazyVim/LazyVim/commit/30b7215de80a215c9bc72640505ea76431ff515c))
|
||||
* **lsp:** ']d' & '[d' was reversed ([#58](https://github.com/LazyVim/LazyVim/issues/58)) ([cbd5342](https://github.com/LazyVim/LazyVim/commit/cbd534242c46eda5d564e6d03daebe18b7f53363))
|
||||
* **luasnip:** don't set remap=true for `<tab>`. Fixes [#44](https://github.com/LazyVim/LazyVim/issues/44) ([87c37f2](https://github.com/LazyVim/LazyVim/commit/87c37f287b609f9fba12d2a6a518823d438bac44))
|
||||
* **neodev:** use opts instead of config ([7a68907](https://github.com/LazyVim/LazyVim/commit/7a68907b39cdf8a183f3e7fd0669c57637b00d7d))
|
||||
* **options:** set options with `vim.set_global` ([d568098](https://github.com/LazyVim/LazyVim/commit/d56809837426ad410df53f23f12d4240b715a077))
|
||||
* **options:** use `vim.opt` and trigger Lazy ui reload when needed. Fixes [#38](https://github.com/LazyVim/LazyVim/issues/38) ([e405023](https://github.com/LazyVim/LazyVim/commit/e405023530f869e8eaaa1a293806aa73ec6f453c))
|
||||
* **plugins:** fix the laziness of all plugins to still work as intended with `config.defaults.lazy = false`. Fixes [#67](https://github.com/LazyVim/LazyVim/issues/67) ([6a3f3d3](https://github.com/LazyVim/LazyVim/commit/6a3f3d3032181dae5fab36b5acc9ea5da086e7fa))
|
||||
* **telescope:** highlights are now under `<leader>sH`. [#50](https://github.com/LazyVim/LazyVim/issues/50) ([c6b83a8](https://github.com/LazyVim/LazyVim/commit/c6b83a82bf27309a16d8387d71317b062574e59e))
|
||||
* **typescipt:** properly check client.name in on_attach ([cce3129](https://github.com/LazyVim/LazyVim/commit/cce3129e995fa349002c518a7655bac3fb23a395))
|
||||
* **typescript:** only set ts keymaps for tsserver ([2128bf3](https://github.com/LazyVim/LazyVim/commit/2128bf3e20cceaf6c77275151087dd7606a9c15c))
|
||||
* **util:** prevent loop for now. Still need to figure out what's causing it ([bbb59d3](https://github.com/LazyVim/LazyVim/commit/bbb59d3ffda8fa211f48d9791447c6a87ec5f157))
|
||||
* **util:** proper fix for lazy notify ([83d18db](https://github.com/LazyVim/LazyVim/commit/83d18dbcee2af8cacbb6861e574f5f393d630618))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **neodev:** enable experimental pathStrict setting for better sumneko performance ([6cf6959](https://github.com/LazyVim/LazyVim/commit/6cf69592540030ee9df9a75a1221be978b63ebf0))
|
||||
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
* **keymaps:** terminal keymaps are now under `<leader>ft` and `<leader>fT` ([0cfc15e](https://github.com/LazyVim/LazyVim/commit/0cfc15e739c81e8ae4a34f6e9cf9e759e660e262))
|
||||
* **neotree:** keymaps are now under `<leader>fe` and `<leader>fE` ([24923ed](https://github.com/LazyVim/LazyVim/commit/24923ed31ad4c019b68583cce2acdc65dd839897))
|
||||
* **noice:** noice keymaps are now under `<leader>sn` ([f8b77db](https://github.com/LazyVim/LazyVim/commit/f8b77db51bef962f385ccd1303382582c0850764))
|
||||
* **telescope:** moved most `help` keymaps under `<leader>s` (search) ([f32ebb9](https://github.com/LazyVim/LazyVim/commit/f32ebb918289607617529f3889a44ee657b641f0))
|
||||
|
||||
## 0.1.0-alpha (2023-01-09)
|
||||
|
||||
|
||||
|
597
doc/LazyVim.txt
597
doc/LazyVim.txt
File diff suppressed because it is too large
Load Diff
@ -1,51 +0,0 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "563827f00bb4fe43269e3be653deabc0005f1302" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "21a0f2520ad3a7c32c0822f943368dc063a569fb" },
|
||||
"catppuccin": { "branch": "main", "commit": "26e498db297607fe17a6206c5a28f0f4cb532954" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "4436d6f41e2f6b8ada57588acd1a9f8b3d21453c" },
|
||||
"flit.nvim": { "branch": "main", "commit": "be110f9814a45788d10537fd59b3c76d956bb7ad" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "484fb38b8f493ceeebf4e6fc499ebe41e10aae25" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "db7cbcb40cc00fc5d6074d7569fb37197705e7f6" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "7eadaacc48bd4d5eff375c1d303caff51e4ec99e" },
|
||||
"leap.nvim": { "branch": "main", "commit": "a968ab4250840dc879e805f918b4f3b892310a12" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "d8c392dd75778d6258da4e7c55522e94ac389732" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "33a198bc5ee0215ae8ab3f61781b29103cf4ca5a" },
|
||||
"mason.nvim": { "branch": "main", "commit": "73831cbe979fb3b385ed8e61626d16d9306a1f06" },
|
||||
"mini.ai": { "branch": "main", "commit": "14a1382372195573c6c7f494ab8bb298b03e6f04" },
|
||||
"mini.bufremove": { "branch": "main", "commit": "96c2a7f3e7d079639a0e23d2fc0d4585e5d02dfd" },
|
||||
"mini.comment": { "branch": "main", "commit": "e5294cc3e75bafb2369f235d31a98b01a9cc67ad" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "59c73c6965f9fa74cd2c1351339a58778e68e589" },
|
||||
"mini.pairs": { "branch": "main", "commit": "fec9aba50912d8c3d92d07d6a77952de84f8d7ad" },
|
||||
"mini.surround": { "branch": "main", "commit": "df41f1c009afbb3eef39d979977fb14404576f9b" },
|
||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "3b41f0d17139bb156f1acd907608f63e0e307caf" },
|
||||
"neoconf.nvim": { "branch": "main", "commit": "3e3294631ef23599b9fccb87dee2592c73d11c60" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "258b83f48405c6b530c09dd96950693664dc6bc0" },
|
||||
"noice.nvim": { "branch": "main", "commit": "256ec7318e227d4a0879f3776bfbe3955f5d2eef" },
|
||||
"nui.nvim": { "branch": "main", "commit": "257da38029d3859ed111804f9d4e95b0fa993a31" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "6830a1ed04f89e6d556cb6bcc200433173004307" },
|
||||
"nvim-bufferline.lua": { "branch": "main", "commit": "028a87933d99f8bb88f2f70a4def3ff9574f3594" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "22c87d6f48c4fb1daf33476450d0b14a64230809" },
|
||||
"nvim-navic": { "branch": "master", "commit": "7a2b823152fe4de65ee7925b0e32d26ed73bc57c" },
|
||||
"nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" },
|
||||
"nvim-spectre": { "branch": "master", "commit": "68ea562b485b6593e325e7916c3bd6e833d433e7" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "69388e84c34d40c3d5c7d2f310db13276f2179e1" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "d816761ec1ea4a605689bc5f4111088459cf74d4" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "4a42b30376c1bd625ab5016c2079631d531d797a" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" },
|
||||
"persistence.nvim": { "branch": "main", "commit": "8484fdaa284207f77ec69b9627316bf334ad653f" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "9d81624fbcedd3dd43b38d7e13a1e7b3f873d8cd" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "b79cd6c88b3d96b0f49cb7d240807cd59b610cd8" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "077c59586d9d0726b0696dc5680eb863f4e04bc5" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "def91651c41f6d1d43ebcb50763324d35331baee" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "83ec606e7065adf134d17f4af6bae510e3c491c1" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "a6d0b28ea7d6b9d139374be1f94a16bd120fcda3" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "5f52ed26e0296a3e1d1453935f417e5808eefab8" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "b7e0b1f16c20bc1ea0515851bc5740d1c1f18444" }
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
-- This file is automatically loaded by plugins.config
|
||||
-- This file is automatically loaded by plugins.init
|
||||
|
||||
-- Check if we need to reload the file when it changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { command = "checktime" })
|
||||
@ -10,6 +10,13 @@ vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
end,
|
||||
})
|
||||
|
||||
-- resize splits if window got resized
|
||||
vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||
callback = function()
|
||||
vim.cmd("tabdo wincmd =")
|
||||
end,
|
||||
})
|
||||
|
||||
-- go to last loc when opening a buffer
|
||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
callback = function()
|
||||
|
165
lua/lazyvim/config/init.lua
Normal file
165
lua/lazyvim/config/init.lua
Normal file
@ -0,0 +1,165 @@
|
||||
---@type LazyVimConfig
|
||||
local M = {}
|
||||
|
||||
M.lazy_version = ">=9.1.0"
|
||||
|
||||
---@class LazyVimConfig
|
||||
local defaults = {
|
||||
-- colorscheme can be a string like `catppuccin` or a function that will load the colorscheme
|
||||
---@type string|fun()
|
||||
colorscheme = function()
|
||||
require("tokyonight").load()
|
||||
end,
|
||||
-- icons used by other plugins
|
||||
icons = {
|
||||
diagnostics = {
|
||||
Error = " ",
|
||||
Warn = " ",
|
||||
Hint = " ",
|
||||
Info = " ",
|
||||
},
|
||||
git = {
|
||||
added = " ",
|
||||
modified = " ",
|
||||
removed = " ",
|
||||
},
|
||||
kinds = {
|
||||
Array = " ",
|
||||
Boolean = " ",
|
||||
Class = " ",
|
||||
Color = " ",
|
||||
Constant = " ",
|
||||
Constructor = " ",
|
||||
Enum = " ",
|
||||
EnumMember = " ",
|
||||
Event = " ",
|
||||
Field = " ",
|
||||
File = " ",
|
||||
Folder = " ",
|
||||
Function = " ",
|
||||
Interface = " ",
|
||||
Key = " ",
|
||||
Keyword = " ",
|
||||
Method = " ",
|
||||
Module = " ",
|
||||
Namespace = " ",
|
||||
Null = "ﳠ ",
|
||||
Number = " ",
|
||||
Object = " ",
|
||||
Operator = " ",
|
||||
Package = " ",
|
||||
Property = " ",
|
||||
Reference = " ",
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
Unit = " ",
|
||||
Value = " ",
|
||||
Variable = " ",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
---@type LazyVimConfig
|
||||
local options
|
||||
|
||||
---@param opts? LazyVimConfig
|
||||
function M.setup(opts)
|
||||
options = vim.tbl_deep_extend("force", defaults, opts or {})
|
||||
if not M.has() then
|
||||
require("lazy.core.util").error(
|
||||
"**LazyVim** needs **lazy.nvim** version "
|
||||
.. M.lazy_version
|
||||
.. " to work properly.\n"
|
||||
.. "Please upgrade **lazy.nvim**",
|
||||
{ title = "LazyVim" }
|
||||
)
|
||||
end
|
||||
|
||||
if vim.fn.argc() == 0 then
|
||||
-- autocmds and keymaps can wait to load
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
group = vim.api.nvim_create_augroup("LazyVim", { clear = true }),
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
M.load("autocmds")
|
||||
M.load("keymaps")
|
||||
end,
|
||||
})
|
||||
else
|
||||
-- load them now so they affect the opened buffers
|
||||
M.load("autocmds")
|
||||
M.load("keymaps")
|
||||
end
|
||||
|
||||
require("lazy.core.util").try(function()
|
||||
if type(M.colorscheme) == "function" then
|
||||
M.colorscheme()
|
||||
else
|
||||
vim.cmd.colorscheme(M.colorscheme)
|
||||
end
|
||||
end, {
|
||||
msg = "Could not load your colorscheme",
|
||||
on_error = function(msg)
|
||||
require("lazy.core.util").error(msg)
|
||||
vim.cmd.colorscheme("habamax")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
---@param range? string
|
||||
function M.has(range)
|
||||
local Semver = require("lazy.manage.semver")
|
||||
return Semver.range(range or M.lazy_version):matches(require("lazy.core.config").version or "0.0.0")
|
||||
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
|
||||
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)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
if vim.bo.filetype == "lazy" then
|
||||
-- HACK: LazyVim may have overwritten options of the Lazy ui, so reset this here
|
||||
vim.cmd([[do VimResized]])
|
||||
end
|
||||
end
|
||||
|
||||
M.did_init = false
|
||||
function M.init()
|
||||
if not M.did_init then
|
||||
M.did_init = true
|
||||
-- delay notifications till vim.notify was replaced or after 500ms
|
||||
require("lazyvim.util").lazy_notify()
|
||||
|
||||
-- load options here, before lazy init while sourcing plugin modules
|
||||
-- this is needed to make sure options will be correctly applied
|
||||
-- after installing missing plugins
|
||||
require("lazyvim.config").load("options")
|
||||
end
|
||||
end
|
||||
|
||||
setmetatable(M, {
|
||||
__index = function(_, key)
|
||||
if options == nil then
|
||||
M.setup()
|
||||
end
|
||||
---@cast options LazyVimConfig
|
||||
return options[key]
|
||||
end,
|
||||
})
|
||||
|
||||
return M
|
@ -1,13 +1,11 @@
|
||||
-- This file is automatically loaded by lazyvim.plugins.config
|
||||
|
||||
local util = require("lazyvim.util")
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
-- better up/down
|
||||
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
|
||||
-- FIXME: document all keymaps
|
||||
|
||||
-- Move to window using the <ctrl> hjkl keys
|
||||
vim.keymap.set("n", "<C-h>", "<C-w>h", { desc = "Go to left window" })
|
||||
vim.keymap.set("n", "<C-j>", "<C-w>j", { desc = "Go to lower window" })
|
||||
@ -15,29 +13,46 @@ vim.keymap.set("n", "<C-k>", "<C-w>k", { desc = "Go to upper window" })
|
||||
vim.keymap.set("n", "<C-l>", "<C-w>l", { desc = "Go to right window" })
|
||||
|
||||
-- Resize window using <ctrl> arrow keys
|
||||
vim.keymap.set("n", "<C-Up>", "<cmd>resize +2<CR>", { desc = "Increase window height" })
|
||||
vim.keymap.set("n", "<C-Down>", "<cmd>resize -2<CR>", { desc = "Decrease window height" })
|
||||
vim.keymap.set("n", "<C-Left>", "<cmd>vertical resize -2<CR>", { desc = "Decrease window width" })
|
||||
vim.keymap.set("n", "<C-Right>", "<cmd>vertical resize +2<CR>", { desc = "Increase window width" })
|
||||
vim.keymap.set("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
|
||||
vim.keymap.set("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease window height" })
|
||||
vim.keymap.set("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window width" })
|
||||
vim.keymap.set("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
|
||||
|
||||
-- Move Lines
|
||||
vim.keymap.set("n", "<A-j>", ":m .+1<CR>==", { desc = "Move down" })
|
||||
vim.keymap.set("v", "<A-j>", ":m '>+1<CR>gv=gv", { desc = "Move down" })
|
||||
vim.keymap.set("i", "<A-j>", "<Esc>:m .+1<CR>==gi", { desc = "Move down" })
|
||||
vim.keymap.set("n", "<A-k>", ":m .-2<CR>==", { desc = "Move up" })
|
||||
vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv", { desc = "Move up" })
|
||||
vim.keymap.set("i", "<A-k>", "<Esc>:m .-2<CR>==gi", { desc = "Move up" })
|
||||
vim.keymap.set("n", "<A-j>", ":m .+1<cr>==", { desc = "Move down" })
|
||||
vim.keymap.set("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move down" })
|
||||
vim.keymap.set("i", "<A-j>", "<Esc>:m .+1<cr>==gi", { desc = "Move down" })
|
||||
vim.keymap.set("n", "<A-k>", ":m .-2<cr>==", { desc = "Move up" })
|
||||
vim.keymap.set("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move up" })
|
||||
vim.keymap.set("i", "<A-k>", "<Esc>:m .-2<cr>==gi", { desc = "Move up" })
|
||||
|
||||
-- Switch buffers with <shift> hl
|
||||
vim.keymap.set("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
|
||||
vim.keymap.set("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||
|
||||
-- Easier pasting
|
||||
vim.keymap.set("n", "[p", ":pu!<cr>", { desc = "Paste below" })
|
||||
vim.keymap.set("n", "]p", ":pu<cr>", { desc = "Paste above" })
|
||||
-- buffers
|
||||
if Util.has("nvim-bufferline.lua") then
|
||||
vim.keymap.set("n", "<S-h>", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
|
||||
vim.keymap.set("n", "<S-l>", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
|
||||
vim.keymap.set("n", "[b", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
|
||||
vim.keymap.set("n", "]b", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
|
||||
else
|
||||
vim.keymap.set("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
|
||||
vim.keymap.set("n", "<S-l>", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||
vim.keymap.set("n", "[b", "<cmd>bprevious<cr>", { desc = "Prev buffer" })
|
||||
vim.keymap.set("n", "]b", "<cmd>bnext<cr>", { desc = "Next buffer" })
|
||||
end
|
||||
vim.keymap.set("n", "<leader>bb", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
|
||||
vim.keymap.set("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
|
||||
|
||||
-- Clear search with <esc>
|
||||
vim.keymap.set({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
||||
|
||||
-- Clear search, diff update and redraw
|
||||
-- taken from runtime/lua/_editor.lua
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>ur",
|
||||
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
|
||||
{ desc = "Redraw / clear hlsearch / diff update" }
|
||||
)
|
||||
|
||||
vim.keymap.set("n", "gw", "*N")
|
||||
vim.keymap.set("x", "gw", "*N")
|
||||
|
||||
@ -54,7 +69,7 @@ vim.keymap.set("i", ",", ",<c-g>u")
|
||||
vim.keymap.set("i", ".", ".<c-g>u")
|
||||
vim.keymap.set("i", ";", ";<c-g>u")
|
||||
|
||||
-- save in insert mode
|
||||
-- save file
|
||||
vim.keymap.set({ "i", "v", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
|
||||
|
||||
-- better indenting
|
||||
@ -73,47 +88,43 @@ vim.keymap.set("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Open Quickfix List
|
||||
-- stylua: ignore start
|
||||
|
||||
-- toggle options
|
||||
vim.keymap.set("n", "<leader>tf", require("lazyvim.plugins.lsp.format").toggle, { desc = "Toggle format on Save" })
|
||||
vim.keymap.set("n", "<leader>ts", function() util.toggle("spell") end, { desc = "Toggle Spelling" })
|
||||
vim.keymap.set("n", "<leader>tw", function() util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
||||
vim.keymap.set("n", "<leader>tn", function() util.toggle("relativenumber", true) util.toggle("number") end, { desc = "Toggle Line Numbers" })
|
||||
vim.keymap.set("n", "<leader>td", util.toggle_diagnostics, { desc = "Toggle Diagnostics" })
|
||||
vim.keymap.set("n", "<leader>uf", require("lazyvim.plugins.lsp.format").toggle, { desc = "Toggle format on Save" })
|
||||
vim.keymap.set("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
|
||||
vim.keymap.set("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
||||
vim.keymap.set("n", "<leader>ul", function() Util.toggle("relativenumber", true) Util.toggle("number") end, { desc = "Toggle Line Numbers" })
|
||||
vim.keymap.set("n", "<leader>ud", Util.toggle_diagnostics, { desc = "Toggle Diagnostics" })
|
||||
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
||||
vim.keymap.set("n", "<leader>tc", function() util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||
vim.keymap.set("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||
|
||||
-- lazygit
|
||||
vim.keymap.set("n", "<leader>gg", function() require("lazyvim.util").float_term({ "lazygit" }) end, { desc = "Lazygit (cwd)" })
|
||||
vim.keymap.set("n", "<leader>gG", function() util.float_term({ "lazygit" }, { cwd = util.get_root() }) end, { desc = "Lazygit (root dir)" })
|
||||
vim.keymap.set("n", "<leader>gg", function() Util.float_term({ "lazygit" }) end, { desc = "Lazygit (cwd)" })
|
||||
vim.keymap.set("n", "<leader>gG", function() Util.float_term({ "lazygit" }, { cwd = Util.get_root() }) end, { desc = "Lazygit (root dir)" })
|
||||
|
||||
-- quit
|
||||
vim.keymap.set("n", "<leader>qq", "<cmd>qa<cr>", { desc = "Quit all" })
|
||||
|
||||
-- highlights under cursor
|
||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||
vim.keymap.set("n", "<leader>hl", vim.show_pos, { desc = "Highlight Groups at cursor" })
|
||||
vim.keymap.set("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
||||
end
|
||||
|
||||
-- floating terminal
|
||||
vim.keymap.set("n", "<leader>ot", function() util.float_term(nil, { cwd = util.get_root() }) end, { desc = "Terminal (root dir)" })
|
||||
vim.keymap.set("n", "<leader>oT", function() require("lazyvim.util").float_term() end, { desc = "Terminal (cwd)" })
|
||||
vim.keymap.set("n", "<leader>ft", function() Util.float_term(nil, { cwd = Util.get_root() }) end, { desc = "Terminal (root dir)" })
|
||||
vim.keymap.set("n", "<leader>fT", function() Util.float_term() end, { desc = "Terminal (cwd)" })
|
||||
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>", {desc = "Enter Normal Mode"})
|
||||
|
||||
-- windows
|
||||
vim.keymap.set("n", "<leader>ww", "<C-W>p", { desc = "other-window" })
|
||||
vim.keymap.set("n", "<leader>wd", "<C-W>c", { desc = "delete-window" })
|
||||
vim.keymap.set("n", "<leader>w-", "<C-W>s", { desc = "split-window-below" })
|
||||
vim.keymap.set("n", "<leader>w|", "<C-W>v", { desc = "split-window-right" })
|
||||
vim.keymap.set("n", "<leader>ww", "<C-W>p", { desc = "Other window" })
|
||||
vim.keymap.set("n", "<leader>wd", "<C-W>c", { desc = "Delete window" })
|
||||
vim.keymap.set("n", "<leader>w-", "<C-W>s", { desc = "Split window below" })
|
||||
vim.keymap.set("n", "<leader>w|", "<C-W>v", { desc = "Split window right" })
|
||||
vim.keymap.set("n", "<leader>-", "<C-W>s", { desc = "Split window below" })
|
||||
vim.keymap.set("n", "<leader>|", "<C-W>v", { desc = "Split window right" })
|
||||
|
||||
-- tabs
|
||||
vim.keymap.set("n", "<leader><tab>l", "<cmd>tablast<CR>", { desc = "Last" })
|
||||
vim.keymap.set("n", "<leader><tab>f", "<cmd>tabfirst<CR>", { desc = "First" })
|
||||
vim.keymap.set("n", "<leader><tab><tab>", "<cmd>tabnew<CR>", { desc = "New Tab" })
|
||||
vim.keymap.set("n", "<leader><tab>]", "<cmd>tabnext<CR>", { desc = "Next" })
|
||||
vim.keymap.set("n", "<leader><tab>d", "<cmd>tabclose<CR>", { desc = "Close" })
|
||||
vim.keymap.set("n", "<leader><tab>[", "<cmd>tabprevious<CR>", { desc = "Previous" })
|
||||
|
||||
-- buffers
|
||||
vim.keymap.set("n", "<leader>b]", "<cmd>:BufferLineCycleNext<CR>", { desc = "Next Buffer" })
|
||||
vim.keymap.set("n", "<leader>bb", "<cmd>:e #<cr>", { desc = "Switch to Other Buffer" })
|
||||
vim.keymap.set("n", "<leader>b[", "<cmd>:BufferLineCyclePrev<CR>", { desc = "Previous Buffer" })
|
||||
vim.keymap.set("n", "<leader>`", "<cmd>:e #<cr>", { desc = "Switch to Other Buffer" })
|
||||
vim.keymap.set("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last" })
|
||||
vim.keymap.set("n", "<leader><tab>f", "<cmd>tabfirst<cr>", { desc = "First" })
|
||||
vim.keymap.set("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" })
|
||||
vim.keymap.set("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next" })
|
||||
vim.keymap.set("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close" })
|
||||
vim.keymap.set("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous" })
|
||||
|
@ -3,54 +3,56 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.opt.autowrite = true -- enable auto write
|
||||
vim.opt.clipboard = "unnamedplus" -- sync with system clipboard
|
||||
vim.opt.cmdheight = 1
|
||||
vim.opt.completeopt = "menu,menuone,noselect"
|
||||
vim.opt.conceallevel = 3 -- Hide * markup for bold and italic
|
||||
vim.opt.confirm = true -- confirm to save changes before exiting modified buffer
|
||||
vim.opt.cursorline = true -- Enable highlighting of the current line
|
||||
vim.opt.expandtab = true -- Use spaces instead of tabs
|
||||
vim.opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
vim.opt.grepformat = "%f:%l:%c:%m"
|
||||
vim.opt.grepprg = "rg --vimgrep"
|
||||
vim.opt.guifont = "FiraCode Nerd Font:h11"
|
||||
vim.opt.hidden = true -- Enable modified buffers in background
|
||||
vim.opt.ignorecase = true -- Ignore case
|
||||
vim.opt.inccommand = "nosplit" -- preview incremental substitute
|
||||
vim.opt.joinspaces = false -- No double spaces with join after a dot
|
||||
vim.opt.laststatus = 0
|
||||
vim.opt.list = true -- Show some invisible characters (tabs...
|
||||
vim.opt.mouse = "a" -- enable mouse mode
|
||||
vim.opt.number = true -- Print line number
|
||||
vim.opt.pumblend = 10 -- Popup blend
|
||||
vim.opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||
vim.opt.relativenumber = true -- Relative line numbers
|
||||
vim.opt.scrolloff = 4 -- Lines of context
|
||||
vim.opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
||||
vim.opt.shiftround = true -- Round indent
|
||||
vim.opt.shiftwidth = 2 -- Size of an indent
|
||||
vim.opt.showmode = false -- dont show mode since we have a statusline
|
||||
vim.opt.sidescrolloff = 8 -- Columns of context
|
||||
vim.opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
|
||||
vim.opt.smartcase = true -- Don't ignore case with capitals
|
||||
vim.opt.smartindent = true -- Insert indents automatically
|
||||
vim.opt.spelllang = { "en" }
|
||||
vim.opt.splitbelow = true -- Put new windows below current
|
||||
vim.opt.splitright = true -- Put new windows right of current
|
||||
vim.opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
vim.opt.termguicolors = true -- True color support
|
||||
vim.opt.timeoutlen = 300
|
||||
vim.opt.undofile = true
|
||||
vim.opt.undolevels = 10000
|
||||
vim.opt.updatetime = 200 -- save swap file and trigger CursorHold
|
||||
vim.opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||
vim.go.winminwidth = 5 -- minimum window width
|
||||
vim.opt.wrap = false -- Disable line wrap
|
||||
local opt = vim.opt
|
||||
|
||||
opt.autowrite = true -- enable auto write
|
||||
opt.clipboard = "unnamedplus" -- sync with system clipboard
|
||||
opt.cmdheight = 1
|
||||
opt.completeopt = "menu,menuone,noselect"
|
||||
opt.conceallevel = 3 -- Hide * markup for bold and italic
|
||||
opt.confirm = true -- confirm to save changes before exiting modified buffer
|
||||
opt.cursorline = true -- Enable highlighting of the current line
|
||||
opt.expandtab = true -- Use spaces instead of tabs
|
||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
opt.grepformat = "%f:%l:%c:%m"
|
||||
opt.grepprg = "rg --vimgrep"
|
||||
opt.guifont = "FiraCode Nerd Font:h11"
|
||||
opt.hidden = true -- Enable modified buffers in background
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.inccommand = "nosplit" -- preview incremental substitute
|
||||
opt.joinspaces = false -- No double spaces with join after a dot
|
||||
opt.laststatus = 0
|
||||
opt.list = true -- Show some invisible characters (tabs...
|
||||
opt.mouse = "a" -- enable mouse mode
|
||||
opt.number = true -- Print line number
|
||||
opt.pumblend = 10 -- Popup blend
|
||||
opt.pumheight = 10 -- Maximum number of entries in a popup
|
||||
opt.relativenumber = true -- Relative line numbers
|
||||
opt.scrolloff = 4 -- Lines of context
|
||||
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
|
||||
opt.shiftround = true -- Round indent
|
||||
opt.shiftwidth = 2 -- Size of an indent
|
||||
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
|
||||
opt.smartcase = true -- Don't ignore case with capitals
|
||||
opt.smartindent = true -- Insert indents automatically
|
||||
opt.spelllang = { "en" }
|
||||
opt.splitbelow = true -- Put new windows below current
|
||||
opt.splitright = true -- Put new windows right of current
|
||||
opt.tabstop = 2 -- Number of spaces tabs count for
|
||||
opt.termguicolors = true -- True color support
|
||||
opt.timeoutlen = 300
|
||||
opt.undofile = true
|
||||
opt.undolevels = 10000
|
||||
opt.updatetime = 200 -- save swap file and trigger CursorHold
|
||||
opt.wildmode = "longest:full,full" -- Command-line completion mode
|
||||
opt.winminwidth = 5 -- minimum window width
|
||||
opt.wrap = false -- Disable line wrap
|
||||
|
||||
if vim.fn.has("nvim-0.9.0") == 1 then
|
||||
vim.opt.splitkeep = "screen"
|
||||
vim.o.shortmess = "filnxtToOFWIcC"
|
||||
opt.splitkeep = "screen"
|
||||
opt.shortmess = "filnxtToOFWIcC"
|
||||
end
|
||||
|
||||
-- fix markdown indentation settings
|
||||
|
@ -1,54 +1,16 @@
|
||||
---@class LazyVimSettings
|
||||
local settings = {
|
||||
icons = {
|
||||
diagnostics = {
|
||||
Error = " ",
|
||||
Warn = " ",
|
||||
Hint = " ",
|
||||
Info = " ",
|
||||
},
|
||||
git = {
|
||||
added = " ",
|
||||
modified = " ",
|
||||
removed = " ",
|
||||
},
|
||||
kinds = {
|
||||
Array = " ",
|
||||
Boolean = " ",
|
||||
Class = " ",
|
||||
Color = " ",
|
||||
Constant = " ",
|
||||
Constructor = " ",
|
||||
Enum = " ",
|
||||
EnumMember = " ",
|
||||
Event = " ",
|
||||
Field = " ",
|
||||
File = " ",
|
||||
Folder = " ",
|
||||
Function = " ",
|
||||
Interface = " ",
|
||||
Key = " ",
|
||||
Keyword = " ",
|
||||
Method = " ",
|
||||
Module = " ",
|
||||
Namespace = " ",
|
||||
Null = "ﳠ ",
|
||||
Number = " ",
|
||||
Object = " ",
|
||||
Operator = " ",
|
||||
Package = " ",
|
||||
Property = " ",
|
||||
Reference = " ",
|
||||
Snippet = " ",
|
||||
String = " ",
|
||||
Struct = " ",
|
||||
Text = " ",
|
||||
TypeParameter = " ",
|
||||
Unit = " ",
|
||||
Value = " ",
|
||||
Variable = " ",
|
||||
},
|
||||
require("lazy.core.util").warn(
|
||||
[[`config.settings` is deprecated.
|
||||
|
||||
Please configure LazyVim as a plugin:
|
||||
```lua
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
-- your config comes here
|
||||
},
|
||||
}
|
||||
|
||||
return settings
|
||||
```
|
||||
]],
|
||||
{ title = "LazyVim" }
|
||||
)
|
||||
return require("lazyvim.config")
|
||||
|
8
lua/lazyvim/init.lua
Normal file
8
lua/lazyvim/init.lua
Normal file
@ -0,0 +1,8 @@
|
||||
local M = {}
|
||||
|
||||
---@param opts? LazyVimConfig
|
||||
function M.setup(opts)
|
||||
require("lazyvim.config").setup(opts)
|
||||
end
|
||||
|
||||
return M
|
@ -20,7 +20,7 @@ return {
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true, remap = true, silent = true, mode = "i",
|
||||
expr = true, silent = true, mode = "i",
|
||||
},
|
||||
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||
@ -30,6 +30,7 @@ return {
|
||||
-- auto completion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
version = false, -- last release is way too old
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
@ -63,7 +64,7 @@ return {
|
||||
}),
|
||||
formatting = {
|
||||
format = function(_, item)
|
||||
local icons = require("lazyvim.config.settings").icons.kinds
|
||||
local icons = require("lazyvim.config").icons.kinds
|
||||
if icons[item.kind] then
|
||||
item.kind = icons[item.kind] .. item.kind
|
||||
end
|
||||
@ -91,7 +92,20 @@ return {
|
||||
-- surround
|
||||
{
|
||||
"echasnovski/mini.surround",
|
||||
keys = { "gz" },
|
||||
keys = function(plugin, keys)
|
||||
-- Populate the keys based on the user's options
|
||||
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
|
||||
local mappings = {
|
||||
{ opts.mappings.add, desc = "Add surrounding", mode = { "n", "v" } },
|
||||
{ opts.mappings.delete, desc = "Delete surrounding" },
|
||||
{ opts.mappings.find, desc = "Find right surrounding" },
|
||||
{ opts.mappings.find_left, desc = "Find left surrounding" },
|
||||
{ opts.mappings.highlight, desc = "Highlight surrounding" },
|
||||
{ opts.mappings.replace, desc = "Replace surrounding" },
|
||||
{ opts.mappings.update_n_lines, desc = "Update `MiniSurround.config.n_lines`" },
|
||||
}
|
||||
return vim.list_extend(mappings, keys)
|
||||
end,
|
||||
opts = {
|
||||
mappings = {
|
||||
add = "gza", -- Add surrounding in Normal and Visual modes
|
||||
@ -110,7 +124,7 @@ return {
|
||||
},
|
||||
|
||||
-- comments
|
||||
{ "JoosepAlviste/nvim-ts-context-commentstring" },
|
||||
{ "JoosepAlviste/nvim-ts-context-commentstring", lazy = true },
|
||||
{
|
||||
"echasnovski/mini.comment",
|
||||
event = "VeryLazy",
|
||||
|
@ -3,20 +3,14 @@ return {
|
||||
-- tokyonight
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
lazy = true,
|
||||
opts = { style = "moon" },
|
||||
config = function(_, opts)
|
||||
local tokyonight = require("tokyonight")
|
||||
tokyonight.setup(opts)
|
||||
tokyonight.load()
|
||||
end,
|
||||
},
|
||||
|
||||
-- catppuccin
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
lazy = true,
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
},
|
||||
}
|
||||
|
@ -1,33 +0,0 @@
|
||||
local function load(name)
|
||||
local Util = require("lazy.core.util")
|
||||
-- always load lazyvim, then user file
|
||||
for _, mod in ipairs({ "lazyvim.config." .. name, "config." .. name }) do
|
||||
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)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- load options here, before lazy init while sourcing plugin modules
|
||||
-- this is needed to make sure options will be correctly applied
|
||||
-- after installing missing plugins
|
||||
load("options")
|
||||
|
||||
-- autocmds and keymaps can wait to load
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "VeryLazy",
|
||||
callback = function()
|
||||
load("autocmds")
|
||||
load("keymaps")
|
||||
end,
|
||||
})
|
||||
|
||||
return {}
|
@ -1,4 +1,13 @@
|
||||
return {
|
||||
local specs = {
|
||||
-- set to HEAD for now. I'm sill making too many changes for this repo related to lazy itself
|
||||
{ "folke/lazy.nvim", version = false },
|
||||
}
|
||||
|
||||
-- only add for >=9.0.1, since there's an endless loop in earlier versions
|
||||
if require("lazyvim.config").has(">=9.1.0") then
|
||||
specs[#specs + 1] = { "LazyVim/LazyVim", priority = 10000, lazy = false, config = true }
|
||||
else
|
||||
require("lazyvim.config").setup()
|
||||
end
|
||||
|
||||
return specs
|
||||
|
@ -1,4 +1,4 @@
|
||||
local util = require("lazyvim.util")
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
|
||||
@ -8,21 +8,28 @@ return {
|
||||
cmd = "Neotree",
|
||||
keys = {
|
||||
{
|
||||
"<leader>ft",
|
||||
"<leader>fe",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = require("lazyvim.util").get_root() })
|
||||
end,
|
||||
desc = "NeoTree (root dir)",
|
||||
desc = "Explorer NeoTree (root dir)",
|
||||
},
|
||||
{ "<leader>fT", "<cmd>Neotree toggle<CR>", desc = "NeoTree (cwd)" },
|
||||
{ "<leader>fE", "<cmd>Neotree toggle<CR>", desc = "Explorer NeoTree (cwd)" },
|
||||
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
},
|
||||
init = function()
|
||||
vim.g.neo_tree_remove_legacy_commands = 1
|
||||
if vim.fn.argc() == 1 then
|
||||
local stat = vim.loop.fs_stat(vim.fn.argv(0))
|
||||
if stat and stat.type == "directory" then
|
||||
require("neo-tree")
|
||||
end
|
||||
end
|
||||
end,
|
||||
opts = {
|
||||
filesystem = {
|
||||
follow_current_file = true,
|
||||
hijack_netrw_behavior = "open_current",
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -42,33 +49,38 @@ return {
|
||||
cmd = "Telescope",
|
||||
version = false, -- telescope did only one release, so use HEAD for now
|
||||
keys = {
|
||||
{ "<leader>/", util.telescope("live_grep"), desc = "Find in Files (Grep)" },
|
||||
{ "<leader><space>", util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||
{ "<leader>/", Util.telescope("live_grep"), desc = "Find in Files (Grep)" },
|
||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
-- find
|
||||
{ "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" },
|
||||
{ "<leader>ff", util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fF", util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
-- git
|
||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
|
||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
|
||||
{ "<leader>ha", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
|
||||
{ "<leader>hc", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
||||
{ "<leader>hf", "<cmd>Telescope filetypes<cr>", desc = "File Types" },
|
||||
{ "<leader>hh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
||||
{ "<leader>hk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||
{ "<leader>hm", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
|
||||
{ "<leader>ho", "<cmd>Telescope vim_options<cr>", desc = "Options" },
|
||||
{ "<leader>hs", "<cmd>Telescope highlights<cr>", desc = "Search Highlight Groups" },
|
||||
{ "<leader>ht", "<cmd>Telescope builtin<cr>", desc = "Telescope" },
|
||||
-- search
|
||||
{ "<leader>sa", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
|
||||
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
|
||||
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader>sg", util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>sG", util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
|
||||
{ "<leader>sC", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
||||
{ "<leader>sd", "<cmd>Telescope diagnostics<cr>", desc = "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" },
|
||||
{ "<leader>sH", "<cmd>Telescope highlights<cr>", desc = "Search Highlight Groups" },
|
||||
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||
{ "<leader>sM", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
|
||||
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
|
||||
{ "<leader>,", "<cmd>Telescope buffers show_all_buffers=true<cr>", desc = "Switch Buffer" },
|
||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader>so", "<cmd>Telescope vim_options<cr>", desc = "Options" },
|
||||
{ "<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" },
|
||||
{
|
||||
"<leader>ss",
|
||||
util.telescope("lsp_document_symbols", {
|
||||
Util.telescope("lsp_document_symbols", {
|
||||
symbols = {
|
||||
"Class",
|
||||
"Function",
|
||||
@ -95,10 +107,10 @@ return {
|
||||
return require("trouble.providers.telescope").open_with_trouble(...)
|
||||
end,
|
||||
["<C-i>"] = function()
|
||||
util.telescope("find_files", { no_ignore = true })()
|
||||
Util.telescope("find_files", { no_ignore = true })()
|
||||
end,
|
||||
["<C-h>"] = function()
|
||||
util.telescope("find_files", { hidden = true })()
|
||||
Util.telescope("find_files", { hidden = true })()
|
||||
end,
|
||||
["<C-Down>"] = function(...)
|
||||
return require("telescope.actions").cycle_history_next(...)
|
||||
@ -132,7 +144,6 @@ return {
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
plugins = { spelling = true },
|
||||
key_labels = { ["<leader>"] = "SPC" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
local wk = require("which-key")
|
||||
@ -140,21 +151,21 @@ return {
|
||||
wk.register({
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["gz"] = { name = "+surround" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file" },
|
||||
["<leader>f"] = { name = "+file/find" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>h"] = { name = "+help" },
|
||||
["<leader>n"] = { name = "+noice" },
|
||||
["<leader>o"] = { name = "+open" },
|
||||
["<leader>gh"] = { name = "+hunks" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>t"] = { name = "+toggle" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
["<leader>sn"] = { name = "+noice" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
})
|
||||
end,
|
||||
},
|
||||
@ -242,9 +253,9 @@ return {
|
||||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo Trouble" },
|
||||
{ "<leader>xtt", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo Trouble" },
|
||||
{ "<leader>xT", "<cmd>TodoTelescope<cr>", desc = "Todo Telescope" },
|
||||
{ "<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" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -11,7 +11,10 @@ return {
|
||||
-- correctly setup lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = { "b0o/schemastore.nvim" },
|
||||
dependencies = {
|
||||
"b0o/SchemaStore.nvim",
|
||||
version = false, -- last release is way too old
|
||||
},
|
||||
opts = {
|
||||
-- make sure mason installs the server
|
||||
servers = {
|
||||
|
@ -4,23 +4,14 @@ return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.ensure_installed, "typescript")
|
||||
vim.list_extend(opts.ensure_installed, { "typescript", "tsx" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- correctly setup lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"jose-elias-alvarez/typescript.nvim",
|
||||
init = function()
|
||||
require("lazyvim.util").on_attach(function(_, buffer)
|
||||
-- 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 })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
dependencies = { "jose-elias-alvarez/typescript.nvim" },
|
||||
opts = {
|
||||
-- make sure mason installs the server
|
||||
servers = {
|
||||
@ -28,6 +19,13 @@ return {
|
||||
},
|
||||
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 })
|
||||
end
|
||||
end)
|
||||
require("typescript").setup({ server = opts })
|
||||
return true
|
||||
end,
|
||||
|
3
lua/lazyvim/plugins/init.lua
Normal file
3
lua/lazyvim/plugins/init.lua
Normal file
@ -0,0 +1,3 @@
|
||||
require("lazyvim.config").init()
|
||||
|
||||
return {}
|
@ -1,10 +1,16 @@
|
||||
local Util = require("lazy.core.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
M.autoformat = true
|
||||
|
||||
function M.toggle()
|
||||
M.autoformat = not M.autoformat
|
||||
vim.notify(M.autoformat and "Enabled format on save" or "Disabled format on save")
|
||||
if M.autoformat then
|
||||
Util.info("Enabled format on save", { title = "Format" })
|
||||
else
|
||||
Util.warn("Disabled format on save", { title = "Format" })
|
||||
end
|
||||
end
|
||||
|
||||
function M.format()
|
||||
@ -12,7 +18,7 @@ function M.format()
|
||||
local ft = vim.bo[buf].filetype
|
||||
local have_nls = #require("null-ls.sources").get_available(ft, "NULL_LS_FORMATTING") > 0
|
||||
|
||||
vim.lsp.buf.format({
|
||||
vim.lsp.buf.format(vim.tbl_deep_extend("force", {
|
||||
bufnr = buf,
|
||||
filter = function(client)
|
||||
if have_nls then
|
||||
@ -20,7 +26,7 @@ function M.format()
|
||||
end
|
||||
return client.name ~= "null-ls"
|
||||
end,
|
||||
})
|
||||
}, require("lazyvim.util").opts("nvim-lspconfig").format or {}))
|
||||
end
|
||||
|
||||
function M.on_attach(client, buf)
|
||||
|
@ -5,13 +5,30 @@ return {
|
||||
event = "BufReadPre",
|
||||
dependencies = {
|
||||
{ "folke/neoconf.nvim", cmd = "Neoconf", config = true },
|
||||
{ "folke/neodev.nvim", config = true },
|
||||
{ "folke/neodev.nvim", opts = { experimental = { pathStrict = true } } },
|
||||
"mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
-- options for vim.diagnostic.config()
|
||||
diagnostics = {
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
virtual_text = { spacing = 4, prefix = "●" },
|
||||
severity_sort = true,
|
||||
},
|
||||
-- Automatically format on save
|
||||
autoformat = true,
|
||||
-- options for vim.lsp.buf.format
|
||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||
-- but can be also overriden when specified
|
||||
format = {
|
||||
formatting_options = nil,
|
||||
timeout_ms = nil,
|
||||
},
|
||||
-- LSP Server Settings
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
jsonls = {},
|
||||
@ -50,6 +67,9 @@ return {
|
||||
require("lazyvim.util").deprecate("lspconfig.setup_server", "lspconfig.opts.setup[SERVER]")
|
||||
end
|
||||
|
||||
-- setup autoformat
|
||||
require("lazyvim.plugins.lsp.format").autoformat = opts.autoformat
|
||||
|
||||
-- setup formatting and keymaps
|
||||
require("lazyvim.util").on_attach(function(client, buffer)
|
||||
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
|
||||
@ -57,16 +77,11 @@ return {
|
||||
end)
|
||||
|
||||
-- diagnostics
|
||||
for name, icon in pairs(require("lazyvim.config.settings").icons.diagnostics) do
|
||||
for name, icon in pairs(require("lazyvim.config").icons.diagnostics) do
|
||||
name = "DiagnosticSign" .. name
|
||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
||||
end
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
virtual_text = { spacing = 4, prefix = "●" },
|
||||
severity_sort = true,
|
||||
})
|
||||
vim.diagnostic.config(opts.diagnostics)
|
||||
|
||||
local servers = opts.servers
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
@ -74,6 +89,9 @@ return {
|
||||
require("mason-lspconfig").setup({ ensure_installed = vim.tbl_keys(servers) })
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(server)
|
||||
if servers[server] == false then
|
||||
return
|
||||
end
|
||||
local server_opts = servers[server] or {}
|
||||
server_opts.capabilities = capabilities
|
||||
if opts.setup[server] then
|
||||
|
@ -5,16 +5,16 @@ function M.on_attach(client, buffer)
|
||||
|
||||
self:map("<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
|
||||
self:map("<leader>cl", "LspInfo", { desc = "Lsp Info" })
|
||||
self:map("<leader>xd", "Telescope diagnostics", { desc = "Telescope Diagnostics" })
|
||||
self:map("gd", "Telescope lsp_definitions", { desc = "Goto Definition" })
|
||||
self:map("gr", "Telescope lsp_references", { desc = "References" })
|
||||
self:map("gD", "Telescope lsp_declarations", { desc = "Goto Declaration" })
|
||||
self:map("gD", vim.lsp.buf.declaration, { desc = "Goto Declaration" })
|
||||
self:map("gI", "Telescope lsp_implementations", { desc = "Goto Implementation" })
|
||||
self:map("gt", "Telescope lsp_type_definitions", { desc = "Goto Type Definition" })
|
||||
self:map("K", vim.lsp.buf.hover, { desc = "Hover" })
|
||||
self:map("gK", vim.lsp.buf.signature_help, { desc = "Signature Help", has = "signatureHelp" })
|
||||
self:map("[d", M.diagnostic_goto(true), { desc = "Next Diagnostic" })
|
||||
self:map("]d", M.diagnostic_goto(false), { desc = "Prev Diagnostic" })
|
||||
self:map("<c-k>", vim.lsp.buf.signature_help, { mode = "i", desc = "Signature Help", has = "signatureHelp" })
|
||||
self:map("]d", M.diagnostic_goto(true), { desc = "Next Diagnostic" })
|
||||
self:map("[d", M.diagnostic_goto(false), { desc = "Prev Diagnostic" })
|
||||
self:map("]e", M.diagnostic_goto(true, "ERROR"), { desc = "Next Error" })
|
||||
self:map("[e", M.diagnostic_goto(false, "ERROR"), { desc = "Prev Error" })
|
||||
self:map("]w", M.diagnostic_goto(true, "WARNING"), { desc = "Next Warning" })
|
||||
|
@ -1,11 +1,15 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
version = false, -- last release is way too old and doesn't work on Windows
|
||||
build = ":TSUpdate",
|
||||
event = "BufReadPost",
|
||||
keys = {
|
||||
{ "<c-space>", desc = "Increment selection" },
|
||||
{ "<bs>", desc = "Schrink selection", mode = "x" },
|
||||
},
|
||||
---@type TSConfig
|
||||
opts = {
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
context_commentstring = { enable = true, enable_autocmd = false },
|
||||
@ -26,6 +30,15 @@ return {
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<nop>",
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
},
|
||||
---@param opts TSConfig
|
||||
config = function(plugin, opts)
|
||||
|
@ -1,10 +1,10 @@
|
||||
return {
|
||||
-- better vim.notify
|
||||
-- Better `vim.notify()`
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
keys = {
|
||||
{
|
||||
"<leader>nd",
|
||||
"<leader>un",
|
||||
function()
|
||||
require("notify").dismiss({ silent = true, pending = true })
|
||||
end,
|
||||
@ -25,6 +25,7 @@ return {
|
||||
-- better vim.ui
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
lazy = true,
|
||||
init = function()
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
vim.ui.select = function(...)
|
||||
@ -42,13 +43,13 @@ return {
|
||||
-- bufferline
|
||||
{
|
||||
"akinsho/nvim-bufferline.lua",
|
||||
event = "BufAdd",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
options = {
|
||||
diagnostics = "nvim_lsp",
|
||||
always_show_bufferline = false,
|
||||
diagnostics_indicator = function(_, _, diag)
|
||||
local icons = require("lazyvim.config.settings").icons.diagnostics
|
||||
local icons = require("lazyvim.config").icons.diagnostics
|
||||
local ret = (diag.error and icons.Error .. diag.error .. " " or "")
|
||||
.. (diag.warning and icons.Warn .. diag.warning or "")
|
||||
return vim.trim(ret)
|
||||
@ -74,7 +75,7 @@ return {
|
||||
require("lazyvim.util").deprecate("lualine.override", "lualine.opts")
|
||||
end
|
||||
|
||||
local icons = require("lazyvim.config.settings").icons
|
||||
local icons = require("lazyvim.config").icons
|
||||
|
||||
local function fg(name)
|
||||
return function()
|
||||
@ -203,9 +204,9 @@ return {
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
|
||||
{ "<leader>nl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
||||
{ "<leader>nh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||
{ "<leader>na", function() require("noice").cmd("all") end, desc = "Noice All" },
|
||||
{ "<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" },
|
||||
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll forward" },
|
||||
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll backward"},
|
||||
},
|
||||
@ -278,6 +279,7 @@ return {
|
||||
-- lsp symbol navigation for lualine
|
||||
{
|
||||
"SmiteshP/nvim-navic",
|
||||
lazy = true,
|
||||
init = function()
|
||||
vim.g.navic_silence = true
|
||||
require("lazyvim.util").on_attach(function(client, buffer)
|
||||
@ -290,8 +292,8 @@ return {
|
||||
},
|
||||
|
||||
-- icons
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
||||
|
||||
-- ui components
|
||||
"MunifTanjim/nui.nvim",
|
||||
{ "MunifTanjim/nui.nvim", lazy = true },
|
||||
}
|
||||
|
@ -23,5 +23,8 @@ return {
|
||||
},
|
||||
|
||||
-- library used by other plugins
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ "nvim-lua/plenary.nvim", lazy = true },
|
||||
|
||||
-- makes some plugins dot-repeatable like leap
|
||||
{ "tpope/vim-repeat", event = "VeryLazy" },
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
-- Ugly code to generate some things for the readme
|
||||
local Docs = require("lazy.docs")
|
||||
local Util = require("lazy.util")
|
||||
|
||||
local M = {}
|
||||
local root = vim.fn.fnamemodify(debug.getinfo(1, "S").source:sub(2), ":h:h:h:h")
|
||||
local root = vim.fn.fnamemodify(debug.getinfo(1, "S").source:sub(2), ":p:h:h:h:h")
|
||||
|
||||
---@return ReadmeBlock
|
||||
function M.keymaps()
|
||||
@ -44,7 +45,8 @@ function M.keymaps()
|
||||
|
||||
group = "Plugins"
|
||||
|
||||
Util.foreach(require("lazy.core.config").plugins, function(name, plugin)
|
||||
local core = require("lazy.core.plugin").Spec.new({ import = "lazyvim.plugins" })
|
||||
Util.foreach(core.plugins, function(name, plugin)
|
||||
for _, key in ipairs(plugin.keys or {}) do
|
||||
if type(key) == "table" and key.desc then
|
||||
local desc = key.desc or ""
|
||||
@ -58,7 +60,7 @@ function M.keymaps()
|
||||
local lines = {}
|
||||
|
||||
for _, group in ipairs(groups) do
|
||||
lines[#lines + 1] = "<details><summary>" .. group .. "</summary>"
|
||||
lines[#lines + 1] = "## " .. group
|
||||
lines[#lines + 1] = ""
|
||||
vim.list_extend(lines, { "| Key | Description | Mode |", "| --- | --- | --- |" })
|
||||
local mappings = vim.tbl_filter(function(m)
|
||||
@ -84,43 +86,72 @@ function M.keymaps()
|
||||
.. " |"
|
||||
end
|
||||
lines[#lines + 1] = ""
|
||||
lines[#lines + 1] = "</details>"
|
||||
lines[#lines + 1] = ""
|
||||
end
|
||||
return { content = table.concat(lines, "\n") }
|
||||
end
|
||||
|
||||
function M.update()
|
||||
local Docs = require("lazy.docs")
|
||||
---@type table<string, ReadmeBlock>
|
||||
local data = {
|
||||
function M.general()
|
||||
local lines = {
|
||||
[[
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
]],
|
||||
} ---@type string[]
|
||||
for _, entry in ipairs({
|
||||
{ name = "options", title = "Options" },
|
||||
{ name = "keymaps", title = "Keymaps" },
|
||||
{ name = "autocmds", title = "Auto Commands" },
|
||||
}) do
|
||||
local name, title = entry.name, entry.title
|
||||
lines[#lines + 1] = "## " .. title
|
||||
vim.list_extend(lines, {
|
||||
"",
|
||||
"<Tabs>",
|
||||
([[<TabItem value="custom" label="Custom %s">]]):format(title),
|
||||
"",
|
||||
([[```lua title="lua/config/%s.lua"
|
||||
%s
|
||||
```]]):format(
|
||||
name,
|
||||
Util.read_file(vim.fn.fnamemodify(root .. "/../LazyVim-starter/lua/config/" .. name .. ".lua", ":p"))
|
||||
),
|
||||
"",
|
||||
"</TabItem>",
|
||||
([[<TabItem value="defaults" label="Default %s">]]):format(title),
|
||||
"",
|
||||
([[```lua title="lazyvim.config.%s"
|
||||
%s
|
||||
```]]):format(name, Util.read_file(vim.fn.fnamemodify(root .. "/lua/lazyvim/config/" .. name .. ".lua", ":p"))),
|
||||
"",
|
||||
"</TabItem>",
|
||||
"</Tabs>",
|
||||
"",
|
||||
})
|
||||
end
|
||||
return { content = table.concat(lines, "\n") }
|
||||
end
|
||||
|
||||
function M.update2()
|
||||
local docs = vim.fs.normalize("~/projects/lazyvim.github.io/docs")
|
||||
|
||||
Docs.save({
|
||||
general = M.general(),
|
||||
}, docs .. "/configuration/general.md")
|
||||
|
||||
Docs.save({
|
||||
keymaps = M.keymaps(),
|
||||
}
|
||||
|
||||
local core = require("lazy.core.plugin").Spec.new({ import = "lazyvim.plugins" })
|
||||
|
||||
---@type string[]
|
||||
local plugins = {
|
||||
"<details><summary>Core</summary>",
|
||||
"",
|
||||
Docs.plugins(core.plugins).content,
|
||||
"",
|
||||
"</details>",
|
||||
"",
|
||||
}
|
||||
}, docs .. "/keymaps.md")
|
||||
|
||||
Util.walk(root .. "/lua/lazyvim/plugins/extras", function(path, name, type)
|
||||
if type == "file" and name:find("%.lua$") then
|
||||
local modname = path:gsub(".*/lua/", ""):gsub("/", "."):gsub("%.lua$", "")
|
||||
local spec = require("lazy.core.plugin").Spec.new({ import = modname })
|
||||
spec:fix_disabled()
|
||||
vim.list_extend(plugins, {
|
||||
("<details><summary>Extras: <code>%s</code></summary>"):format(modname:gsub(".*extras%.", "")),
|
||||
local lines = {} ---@type string[]
|
||||
vim.list_extend(lines, {
|
||||
"",
|
||||
([[
|
||||
To use this, add it to your **lazy.nvim** imports:
|
||||
|
||||
```lua
|
||||
```lua title="lua/config/lazy.lua"
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ "folke/LazyVim", import = "lazyvim.plugins" },
|
||||
@ -130,19 +161,152 @@ require("lazy").setup({
|
||||
})
|
||||
```
|
||||
]]):format(modname),
|
||||
Docs.plugins(spec.plugins).content,
|
||||
M.plugins("extras/" .. path:gsub(".*/extras/", "")).content,
|
||||
"",
|
||||
"</details>",
|
||||
})
|
||||
Docs.save({
|
||||
plugins = { content = table.concat(lines, "\n") },
|
||||
}, docs .. "/plugins/extras/" .. modname:gsub(".*extras%.", "") .. ".md")
|
||||
end
|
||||
end)
|
||||
|
||||
local examples = vim.fn.fnamemodify(root .. "/../LazyVim-starter/lua/plugins/example.lua", ":p")
|
||||
Docs.save({
|
||||
examples = Util.read_file(examples):gsub("^[^\n]+\n[^\n]+\n[^\n]+\n", ""),
|
||||
}, docs .. "/configuration/examples.md")
|
||||
|
||||
Docs.save({
|
||||
plugins = M.plugins("lsp/init.lua"),
|
||||
}, docs .. "/plugins/lsp.md")
|
||||
|
||||
for _, p in ipairs({ "coding", "colorscheme", "editor", "treesitter", "ui", "util" }) do
|
||||
Docs.save({
|
||||
plugins = M.plugins(p .. ".lua"),
|
||||
}, docs .. "/plugins/" .. p .. ".md")
|
||||
end
|
||||
end
|
||||
|
||||
function M.plugins(path)
|
||||
local test = root .. "/lua/lazyvim/plugins/" .. path
|
||||
local spec = require("lazy.core.plugin").Spec.new(dofile(test))
|
||||
local source = Util.read_file(test)
|
||||
local parser = vim.treesitter.get_string_parser(source, "lua")
|
||||
|
||||
---@type {code: string, opts: string, name: string, comment?:string, url: string}[]
|
||||
local plugins = {}
|
||||
|
||||
local function get_text(node)
|
||||
return Docs.fix_indent(vim.treesitter.get_node_text(node, source))
|
||||
end
|
||||
|
||||
local function get_field(node, field)
|
||||
for child in node:iter_children() do
|
||||
if child:type() == "field" then
|
||||
local name_node = child:field("name")[1]
|
||||
if name_node and get_text(name_node) == field then
|
||||
return child:field("value")[1]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function find_plugins(node)
|
||||
if node:type() == "string" then
|
||||
local text = vim.treesitter.query.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
|
||||
plugin_node = node
|
||||
end
|
||||
local comment_node = plugin_node:parent():prev_named_sibling()
|
||||
if comment_node and comment_node:type() ~= "comment" then
|
||||
comment_node = nil
|
||||
end
|
||||
|
||||
local opts_node = get_field(plugin_node, "opts")
|
||||
|
||||
local name_node = get_field(plugin_node, "name")
|
||||
local name = name_node and get_text(name_node):sub(2, -2) or text:match("/(.*)$")
|
||||
|
||||
if spec.plugins[name] then
|
||||
plugins[#plugins + 1] = {
|
||||
name = name,
|
||||
url = "https://github.com/" .. text,
|
||||
code = get_text(plugin_node),
|
||||
comment = comment_node and get_text(comment_node) or nil,
|
||||
opts = opts_node and get_text(opts_node) or get_field(plugin_node, "config") and "{}" or nil,
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
for child in node:iter_children() do
|
||||
find_plugins(child)
|
||||
end
|
||||
end
|
||||
|
||||
parser:parse()
|
||||
parser:for_each_tree(function(tree)
|
||||
local node = tree:root()
|
||||
find_plugins(node)
|
||||
-- print(vim.treesitter.query.get_node_text(node, str))
|
||||
end)
|
||||
|
||||
---@type string[]
|
||||
local lines = {
|
||||
[[
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
]],
|
||||
}
|
||||
|
||||
for _, plugin in ipairs(plugins) do
|
||||
lines[#lines + 1] = "## [" .. plugin.name .. "](" .. plugin.url .. ")"
|
||||
|
||||
if plugin.comment then
|
||||
lines[#lines + 1] = ""
|
||||
lines[#lines + 1] = table.concat(
|
||||
vim.tbl_map(function(line)
|
||||
return line:gsub("^%-+", "")
|
||||
end, vim.split(plugin.comment, "\n")),
|
||||
"\n"
|
||||
)
|
||||
lines[#lines + 1] = ""
|
||||
end
|
||||
vim.list_extend(lines, {
|
||||
"",
|
||||
"<Tabs>",
|
||||
})
|
||||
vim.list_extend(lines, {
|
||||
"",
|
||||
[[<TabItem value="opts" label="Options">]],
|
||||
"",
|
||||
"```lua",
|
||||
"opts = " .. (plugin.opts or "nil"),
|
||||
"```",
|
||||
"",
|
||||
"</TabItem>",
|
||||
"",
|
||||
})
|
||||
vim.list_extend(lines, {
|
||||
"",
|
||||
[[<TabItem value="code" label="Full Spec">]],
|
||||
"",
|
||||
"```lua",
|
||||
plugin.code,
|
||||
"```",
|
||||
"",
|
||||
"</TabItem>",
|
||||
"",
|
||||
})
|
||||
vim.list_extend(lines, {
|
||||
"</Tabs>",
|
||||
"",
|
||||
})
|
||||
end
|
||||
end)
|
||||
data.plugins = { content = table.concat(plugins, "\n") }
|
||||
local examples = vim.fn.fnamemodify(root .. "/../LazyVim-starter/lua/plugins/example.lua", ":p")
|
||||
data.examples = Util.read_file(examples):gsub("^[^\n]+\n[^\n]+\n[^\n]+\n", "")
|
||||
Docs.save(data)
|
||||
return { content = table.concat(lines, "\n") }
|
||||
end
|
||||
-- M.extract_opts("neovim/nvim-lspconfig")
|
||||
|
||||
M.update()
|
||||
M.update2()
|
||||
|
||||
return M
|
||||
|
@ -1,6 +1,8 @@
|
||||
local Util = require("lazy.core.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
M.root_patterns = { ".git", "/lua" }
|
||||
M.root_patterns = { ".git", "lua" }
|
||||
|
||||
---@param on_attach fun(client, buffer)
|
||||
function M.on_attach(on_attach)
|
||||
@ -13,6 +15,21 @@ function M.on_attach(on_attach)
|
||||
})
|
||||
end
|
||||
|
||||
---@param plugin string
|
||||
function M.has(plugin)
|
||||
return require("lazy.core.config").plugins[plugin] ~= nil
|
||||
end
|
||||
|
||||
---@param name string
|
||||
function M.opts(name)
|
||||
local plugin = require("lazy.core.config").plugins[name]
|
||||
if not plugin then
|
||||
return {}
|
||||
end
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
return Plugin.values(plugin, "opts", false)
|
||||
end
|
||||
|
||||
-- returns the root directory based on:
|
||||
-- * lsp workspace folders
|
||||
-- * lsp root_dir
|
||||
@ -95,19 +112,15 @@ function M.toggle(option, silent, values)
|
||||
else
|
||||
vim.opt_local[option] = values[1]
|
||||
end
|
||||
return vim.notify(
|
||||
"Set " .. option .. " to " .. vim.opt_local[option]:get(),
|
||||
vim.log.levels.INFO,
|
||||
{ title = "Option" }
|
||||
)
|
||||
return Util.info("Set " .. option .. " to " .. vim.opt_local[option]:get(), { title = "Option" })
|
||||
end
|
||||
vim.opt_local[option] = not vim.opt_local[option]:get()
|
||||
if not silent then
|
||||
vim.notify(
|
||||
(vim.opt_local[option]:get() and "Enabled" or "Disabled") .. " " .. option,
|
||||
vim.log.levels.INFO,
|
||||
{ title = "Option" }
|
||||
)
|
||||
if vim.opt_local[option]:get() then
|
||||
Util.info("Enabled " .. option, { title = "Option" })
|
||||
else
|
||||
Util.warn("Disabled " .. option, { title = "Option" })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -116,19 +129,52 @@ function M.toggle_diagnostics()
|
||||
enabled = not enabled
|
||||
if enabled then
|
||||
vim.diagnostic.enable()
|
||||
vim.notify("Enabled diagnostics", vim.log.levels.INFO, { title = "Diagnostics" })
|
||||
Util.info("Enabled diagnostics", { title = "Diagnostics" })
|
||||
else
|
||||
vim.diagnostic.disable()
|
||||
vim.notify("Disabled diagnostics", vim.log.levels.INFO, { title = "Diagnostics" })
|
||||
Util.warn("Disabled diagnostics", { title = "Diagnostics" })
|
||||
end
|
||||
end
|
||||
|
||||
function M.deprecate(old, new)
|
||||
vim.notify(
|
||||
("`%s` is deprecated. Please use `%s` instead"):format(old, new),
|
||||
vim.log.levels.WARN,
|
||||
{ title = "LazyVim" }
|
||||
)
|
||||
Util.warn(("`%s` is deprecated. Please use `%s` instead"):format(old, new), { title = "LazyVim" })
|
||||
end
|
||||
|
||||
-- delay notifications till vim.notify was replaced or after 500ms
|
||||
function M.lazy_notify()
|
||||
local notifs = {}
|
||||
local function temp(...)
|
||||
table.insert(notifs, vim.F.pack_len(...))
|
||||
end
|
||||
|
||||
local orig = vim.notify
|
||||
vim.notify = temp
|
||||
|
||||
local timer = vim.loop.new_timer()
|
||||
local check = vim.loop.new_check()
|
||||
|
||||
local replay = function()
|
||||
timer:stop()
|
||||
check:stop()
|
||||
if vim.notify == temp then
|
||||
vim.notify = orig -- put back the original notify if needed
|
||||
end
|
||||
vim.schedule(function()
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
for _, notif in ipairs(notifs) do
|
||||
vim.notify(vim.F.unpack_len(notif))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
-- wait till vim.notify has been replaced
|
||||
check:start(function()
|
||||
if vim.notify ~= temp then
|
||||
replay()
|
||||
end
|
||||
end)
|
||||
-- or if it took more than 500ms, then something went wrong
|
||||
timer:start(500, 0, replay)
|
||||
end
|
||||
|
||||
return M
|
||||
|
Reference in New Issue
Block a user