Compare commits

...

170 Commits
main ... v2.0

Author SHA1 Message Date
antifallobst 4ae95c9772
fixed cmp override bug 2023-08-23 18:00:24 +02:00
antifallobst b97577b370
setup a small rust environment 2023-08-23 16:59:36 +02:00
antifallobst f3b9a3c9a9
removed github stuff 2023-08-23 16:08:45 +02:00
siduck d3d9aa251a rm config func from UI plugin spec
cuz the code will be loaded in the plugin/init.lua file of UI repo
2023-08-10 11:09:25 +05:30
siduck 46a61073a8 clean up 2023-08-09 20:29:50 +05:30
siduck 8ea74bc23b update some module paths 2023-08-09 20:22:46 +05:30
siduck 487ca44566 update icon paths 2023-08-09 08:51:40 +05:30
Paul 05f581918a
feat: added .ignore file (#2271)
Added .ignore file. So telescope doesn't ignore the custom folder.
2023-08-09 05:50:53 +05:30
siduck 6766acefec dont disable editor config with lazy_nvim 2023-08-06 21:52:08 +05:30
siduck 0e27cb4b44 dont reload tabufline if its disabled #2236 2023-07-26 09:58:01 +05:30
siduck 682b023fb3 make tabufline reloadable 2023-07-26 06:56:56 +05:30
A.S.K f18488d41c
feat: ignore after folder (#2228) 2023-07-24 10:01:21 +05:30
N 720d71b546
Update README.md (#2194)
Corrected typos and improved grammar
2023-07-09 05:09:33 +05:30
siduck 08f3deb901 temporarily revert blankline to stable version #2189 2023-07-07 05:05:50 +05:30
James Wright 3500e7388d
Catch errors from shell calls (#2188) 2023-07-06 22:12:33 +05:30
M 83aac1ecc0
fix: wildcard pattern usage in `fs_realpath` (#2152) 2023-07-02 16:22:52 +05:30
siduck 10b668d98a make formatting mapping <leader>fm as general mapping #2167
so its available even if an actual lsp isnt attached to the buffer
2023-06-29 05:18:18 +05:30
georgejean 286c951d7b
fix: make key mapping's description to lazy load Comment.nvim coherent with the defaults (#2148) 2023-06-24 06:49:07 +05:30
georgejean 4aa283119a
Fix too long descriptions for Comment.nvim's key mapping and add g key to trigger which-key (#2145) 2023-06-23 04:59:57 +05:30
georgejean 212bb9a66f
Improved keys property for Comment.vim (#2144) 2023-06-22 22:16:20 +05:30
Max Chechel 11c839f870
Defaulting to not installing custom config in --headless mode (#2132)
* Defaulting to not installing custom config in --headless mode

* Update bootstrap.lua

---------

Co-authored-by: siduck <siduck@tutanota.com>
2023-06-18 18:21:36 +05:30
Simone Fidanza d3433e3c55
feat: ignore syntax folder (#2124) 2023-06-16 14:44:50 +05:30
siduck 8ba64ff369 custom config reload: support symlinks https://github.com/NvChad/base46/issues/177
huge thanks to @lucario387 for helping me
2023-06-15 10:11:43 +05:30
Zhong Jianxin e3bb39106e
Fix default mappings not load if chadrc.lua does not exist (#2037)
* Fix default mappings not load if chadrc.lua does not exist

The regression was introduced by dab9171e64

Fix #1961 #2025

* clean up!

---------

Co-authored-by: siduck <siduck@tutanota.com>
2023-06-15 08:03:01 +05:30
anes a18d92dfa6 Update README.md 2023-06-14 05:43:00 +05:30
siduck d73d155287 disable semantic tokens only if the LSP supports it 2023-06-11 19:52:47 +05:30
Sidhanth Rathod 27992efc1c
Merge pull request #2031 from TirtharajPramanik/patch-1
update mason  binaries path in vim.env ( fixes rust_analyzyer bin not found )
2023-06-10 13:15:14 +05:30
Sidhanth Rathod 1d26f9dc50
Merge pull request #2097 from azuwis/telescope
telescope: Explicitly depend on nvim-treesitter
2023-06-10 08:54:52 +05:30
Zhong Jianxin c2a0bb1684 telescope: Explicitly depend on nvim-treesitter
Fix Telescope syntax highlighting is not working until open a file
https://github.com/NvChad/NvChad/issues/2084
2023-06-08 09:42:21 +08:00
André Jesus c3c349c830
Change cmp to insert completion instead of replacing the current word (#2083)
I find this annoying and if we want to actually delete the word we can simply just dw in vim

Co-authored-by: andré Jesus <andréjesusdebrito@gmail.com>
2023-06-08 05:21:39 +05:30
siduck f8a489ea1a include editor config in lazy disabled_plugins list 2023-06-01 22:07:27 +05:30
georgejean d72d935b35
Fix deprecated highlight config for gitsigns (#2078) 2023-06-01 21:39:14 +05:30
Martin Braun 9c10201ef3
Fix Comment.nvim not lazyloading from visual mode (#2067) 2023-05-29 19:32:33 +05:30
Fiete Börner 582dff9458
allow to override default config of comment.nvim (#2045) 2023-05-23 08:44:14 +05:30
siduck 262a06776a change mapping for telescope marks 2023-05-18 18:15:51 +05:30
siduck f6229b4b46 add mapping for telescope bookmarks (#2035) 2023-05-18 11:45:02 +05:30
siduck 1cb237fa78 rm outdated icons 2023-05-18 07:58:57 +05:30
siduck c8a1aa2e2b use old dir icon for nvimtree
in nerdfonts v3.0 update this icon was removed! but they re-added it in v3.0.1, so everyone please update your font package :D
2023-05-18 05:35:36 +05:30
André Carneiro a54e4e9272
chore: consistent border style when navigating diagnostics (#2033) 2023-05-18 05:31:36 +05:30
Tirtharaj Pramanik 914f9a400e
Update init.lua
Putting `.../mason/bin/` in the beginning of `vim.env.PATH`
2023-05-17 02:14:15 +05:30
Lexey Khom 699aeaa442
style(mappings): One style for descriptions (#2018)
* style(mappings.lua): Abbreviations in Upper case (like "LSP")

* style(mappings.lua): One description style - Sentence case

Only the first word of a sentence and proper nouns are capitalized,
with the rest of the words in lowercase.

* style(mappings.lua): Replase "_" to " " in descriptions
2023-05-13 15:28:50 +05:30
siduck e1631629b9 disable LSPs inbuilt formatting by default | FIX (#2016)
We mostly use null-ls for the formatting but if our current lsp server supports formatting then the null-ls one wouldnt work and we would never get an error etc or prompt to use null-ls formatter which is scaryy!! so disabling the formatting on lsp server by default
2023-05-12 20:33:16 +05:30
siduck 3dd0fa6c5b temporarily change folder icon
old folder icon was removed from octicons and nerdfonts uses latest octicons
2023-05-04 07:34:27 +05:30
siduck 03f93e5d75 update icons to nerdfont icons 3.0x 2023-05-03 13:49:50 +05:30
Mateus Abelli b51065b1a8
fix: readme links (#1974) 2023-04-30 10:14:21 +05:30
siduck 907684efa0 include lazyloading of comment.nvim with gcc/gbc keys (#1972) 2023-04-30 06:13:24 +05:30
siduck 56e6234363 add option for using extended base46 integrations 2023-04-25 10:22:57 +05:30
siduck cff182ce4b remove outdated plugin info in readme 2023-04-23 17:11:59 +05:30
siduck fdb3ddb806 rm un-needed code 2023-04-23 08:06:02 +05:30
siduck 7914da7cd3 include c , v keys in whichkey lazyloading 2023-04-12 18:03:18 +05:30
siduck 12f26e91ef rm depcreated option from nvimtree config 2023-04-12 14:12:32 +05:30
siduck 34bdca17d2 clean up 2023-04-10 10:05:05 +05:30
siduck af123eee4d handle semantic_tokens on lsp_attach based on chadrc option (#1907) 2023-04-10 07:21:07 +05:30
siduck f873d3cc50 add an option for lsp_semantic_tokens hl groups | fix (#1907)
also tiden up some stuff
2023-04-10 06:04:37 +05:30
Shubham K b5cf9fde0e
Added current buffer fuzzy find key mapping (#1903)
* Added current buffer fuzzy find key mapping

* change telescope fuzzy mapping to <leader>fz

 Co-authored-by: Sidhanth Rathod <siduck@tutanota.com>
2023-04-07 22:59:13 +05:30
siduck 907b112514 make some mapping keybinds lowercased (#1897) 2023-04-05 22:07:36 +05:30
prometheusalpha 3479853e69 feat(mappings): add description to movement keys in normal mode 2023-04-05 16:22:43 +05:30
hoangnh280 0619ef4e1e fix(mappings): fix description of j key in x mode 2023-04-05 08:29:18 +05:30
siduck 1754a23e65 add nvimtree option to preserve window proportions (#1597) 2023-04-04 05:31:43 +05:30
Ashish 4d45597468 gitsign: handling file path with spaces 2023-04-03 08:18:59 +05:30
siduck a5906e48fb use function in init opts for all plugins
if this isnt done then disabling a plugin will still have its init opt called, read https://github.com/NvChad/NvChad/discussions/1879
2023-04-01 12:47:42 +05:30
waneon 8ec2cb3b76 feat: Increase visibility of floating diagnostic 2023-03-31 05:59:08 +05:30
Daniel Boll 800d066aab feat(bootstrap): indicate that no is the default answer
Indicates that the default answer would be *no* if the user provide any input other than `y`
2023-03-31 05:27:23 +05:30
siduck ffdb4fc5e5 add show_numbers option to tabufline config
87525fa3cd
2023-03-30 18:23:16 +05:30
siduck c77c086365 add nvimtree_side global in nvimtree config func https://github.com/NvChad/ui/issues/68
also clean some lazy.nvim related variables
2023-03-29 07:41:21 +05:30
Daniel Boll 55de4b9c85 fix(cmp): lsp suggestions before snippets 2023-03-28 19:33:17 +05:30
siduck d7f91016a8 bootstrap.lua: rm useless variables 2023-03-27 05:34:12 +05:30
siduck 79805b7fea bootstrap: clone base46 to lazy path instead of tmpdir 2023-03-27 05:27:57 +05:30
siduck 609000db5b bootstrap base46 before lazy
fix https://github.com/NvChad/base46/issues/166
2023-03-26 15:52:41 +05:30
siduck ed03799697 load defaults cache after lazypath check
not having this will create that dofile error that the file isnt present as the file gets created only when base46 compiles and which occurs during boostrapping lazy.nvim
2023-03-25 08:15:53 +05:30
siduck 432b2c1cf1 just load default bas46 cache instead of giving it lazy priority
https://github.com/NvChad/base46/issues/173
2023-03-25 05:48:09 +05:30
siduck 0678b329dc give priority to defaults hl groups cache
fixes https://github.com/NvChad/base46/issues/173, not adding this will let plugins like vim-matchup messup our syntax highlight groups
2023-03-24 23:16:13 +05:30
siduck 59cee93fce reduce loc in boostrap.lua 2023-03-24 05:27:09 +05:30
siduck 7ec4515179 boostrap mason packages properly
print some message when nvchad is totally setup
2023-03-24 04:35:54 +05:30
siduck 84bdc2335c save nvchad cache at nvim data dir
many a time the user clears the cache dir and that results in deletion of base46 cache too which would prevent nvchad to function
2023-03-23 16:09:43 +05:30
siduck effec96b53 luasnip: add globals for various types of snippets 2023-03-23 16:00:06 +05:30
siduck 208c31f2ba rm outdated info in readme 2023-03-22 15:54:04 +05:30
siduck d1d25231cd update nvim version in readme badge 2023-03-22 15:51:49 +05:30
Diogo-ss edb80f4e0c fix: text in readme.md 2023-03-21 05:57:29 +05:30
Pham Huy Hoang 8214d4e858 fix NVIM_APPNAME 2023-03-18 11:42:26 +05:30
Lucario387 3353abb499 remove unused var 2023-03-18 11:42:26 +05:30
Lucario387 3563b5af83 normalize all paths 2023-03-18 11:42:26 +05:30
siduck 9dcaefd73f add variable for path seperators 2023-03-17 20:58:22 +05:30
Lucario387 a5833730d7 fix #1832 2023-03-17 20:50:18 +05:30
siduck bb87d70fd6 add an option to disable tabufline 2023-03-14 19:52:37 +05:30
siduck b2aa30b5ae make statusline separators reloadable 2023-03-14 13:58:12 +05:30
siduck 7830f0334f add options to disable signature 2023-03-14 08:07:06 +05:30
siduck 8eaa3666dd temporarily silence dofile syntax error during bootstrap
we need to find a way to fetch base46 first and then rest of the plugins (during bootstrap)
2023-03-14 06:39:26 +05:30
siduck caeec36191 keep whichkey enabled by default 2023-03-14 06:13:56 +05:30
Bruno Krugel 9ae789b332 Update default_config.lua 2023-03-14 05:52:42 +05:30
Sidhanth Rathod 521e6f872f
Update README.md 2023-03-13 23:50:31 +05:30
Sidhanth Rathod 11f30badfa
Fix broken site links in readme (#1814) 2023-03-13 19:36:03 +05:30
siduck 1e056a7eb4 use main branch example_config in bootstrap 2023-03-12 18:40:57 +05:30
siduck 08faf1d05a re-add ESC mapping for clearing highlights 2023-03-12 14:46:19 +05:30
Sidhanth Rathod c205f67912
Update image links 2023-03-12 13:53:19 +05:30
siduck 609b5450d5 add mappings btn in nvdash 2023-03-11 12:39:13 +05:30
siduck 5842684087 add mappings btn in nvdash 2023-03-11 12:08:42 +05:30
Sidhanth Rathod 612561a195
rm useless badge 2023-03-10 23:44:35 +05:30
siduck 9ed851000d add option for telescope style 2023-03-10 12:30:31 +05:30
siduck acfc5626ac run load_config() before reloading highlights onsaving chadrc 2023-03-10 11:49:54 +05:30
siduck 1dd3bf5a18 re-add reloading of all custom files 2023-03-10 11:40:24 +05:30
siduck dab9171e64 put all core stuff in core.init only 2023-03-09 18:07:58 +05:30
siduck 1d04d70417 exclude indentline in nvdash/nvcheatsheet fts 2023-03-09 06:32:32 +05:30
siduck 0aafb002b5 misc & cleanup 2023-03-08 18:57:54 +05:30
siduck a3ea8a9f4d load mappings after custom init.lua
this ensures that custom leader key will work properly
2023-03-01 14:29:12 +05:30
siduck 3384f81639 load cached highlights whenever base46 updates 2023-02-28 09:23:07 +05:30
siduck 27455fd2c2 misc 2023-02-26 10:17:45 +05:30
Lucario387 09001369f3 Add lazy.nvim to workspace library 2023-02-20 16:35:01 +05:30
siduck 10ba0e7a5a misc 2023-02-19 07:22:16 +05:30
siduck a6b9c0cae5 wrap some opt modules with function
not doing so will make those modules load by default which isnt good
2023-02-19 07:19:01 +05:30
siduck a2690a4b72 avoid loading cached highlights in plugin opts file 2023-02-18 14:26:40 +05:30
siduck 7b3aefee53 add condition to merge user custom plugins 2023-02-18 09:46:51 +05:30
siduck 6590372791 BREAKING CHANGE: utilize lazy.nvim fully, remove un-needed functions 2023-02-18 09:46:51 +05:30
siduck 5246faa09a add windows support for compile theme autocmd 2023-02-15 17:37:10 +05:30
siduck e8e7ed6144 add autocmd for automatically compiling base46 2023-02-14 11:12:31 +05:30
ariefra 7daf171948 Fix sumneko_lua deprecation, change to lua_ls 2023-02-12 18:29:31 +05:30
neo-f 8501cc01e1 update nvim-tree option names 2023-02-09 11:31:08 +05:30
siduck 205802b49f add nvchad_types to sumenko lsp config
also remove nvimtree depreceated option
2023-01-31 13:08:39 +05:30
siduck 2ee1ada911 reduce some LOC 2023-01-29 23:30:13 +05:30
siduck 4990b23935 use dofile to load cached theme files 2023-01-29 21:36:54 +05:30
siduck 947186b7ec dont load statusline highlights cache
as its included in the defaults file now!
2023-01-29 18:19:10 +05:30
siduck 6910a4435d update example_config branch in bootstrap module 2023-01-29 16:59:08 +05:30
siduck 86bb1413e4 use build opt instead of run 2023-01-26 08:58:44 +05:30
siduck 2b94bb92e0 clean config & rm un-needed pcalls 2023-01-25 20:11:55 +05:30
anosillus ff93c22e63 remove kyazdani42 repo 2023-01-17 06:49:01 +05:30
siduck ed71dba5cc rm un-needed cmdefinitons 2023-01-08 08:30:03 +05:30
siduck c2946844f9 rm unneeded whitespace in lazy-lock url 2023-01-08 07:59:17 +05:30
siduck 7303bb2990 avoid using vim.cmd! for running os commands 2023-01-08 07:51:37 +05:30
siduck 7cd80a35c6 include downloading of lazy-lock.json while bootstrapping
also pin all plugins by default
2023-01-08 07:40:00 +05:30
siduck 4378cb9532 update update_branch variable to lazy 2023-01-07 20:05:25 +05:30
siduck dc4674cad4 rm un-needed lazy.nvim config
those are defaults so no need to add them
2023-01-07 19:48:47 +05:30
siduck 1b8eff7516 migrate to lazy.nvim 2023-01-07 13:41:43 +05:30
Pham Huy Hoang 5db2f0978d update nvim-cmp loading strategy 2023-01-05 08:56:42 +05:30
Pham Huy Hoang ae68290e1f Move friendly-snippets to start
There is no reason to lazy load this plugin as there is no lua file
Move it to start to simply loading sequence
2023-01-05 08:56:42 +05:30
siduck ddeba3c01b bootstrap chadrc template before packer boostrap 2022-12-24 23:44:00 +05:30
siduck 54280a3e2a add function to install chadrc tempalte during bootstrap 2022-12-24 22:33:33 +05:30
Lucario387 a2540ef183 Fix mkdir on windows 2022-12-23 17:29:04 +05:30
siduck 9bd303feee rm mappings for navigating within insert mode
describes the issue with it https://github.com/NvChad/NvChad/issues/1294#issuecomment-1359897212
2022-12-21 00:25:25 +05:30
siduck 4c3eafbc20 add option for cheatsheet theme
and add description for some mappings
2022-12-19 22:32:29 +05:30
siduck 8babf12991 avoid swallowing custom/init.lua errors by pcall 2022-12-17 17:04:52 +05:30
Sidhanth Rathod bdd142dbd6 clean load_config function
based on @ii14 's comment https://github.com/NvChad/NvChad/pull/1704#discussion_r1040655958
2022-12-17 16:55:58 +05:30
Matt 78b2cc3106 ensure errors arent silently swallowed in custom chadrc if exists 2022-12-17 16:55:58 +05:30
SHA-5010 40c180d3b2 config(cmp): simplify disabling scrollbar 2022-12-12 22:36:14 +05:30
siduck 5ea340171c use dev branch of extensions repo 2022-12-07 05:59:17 +05:30
siduck 77a6c22fca use lua api for packersync wrapper 2022-12-03 11:17:27 +05:30
siduck 8db69224ba use lua api to set commands 2022-12-03 10:31:44 +05:30
siduck d1e6b664e1 set base46 as opt plugin
since we are now just using this plugin for compiling nvchad themes, we dont need this at startup
2022-12-03 10:10:07 +05:30
siduck c55dea9593 add helper comments for statusline options 2022-11-27 19:00:36 +05:30
siduck 1a4936ab26 add new dir icons for nvimtree 2022-11-27 09:23:17 +05:30
siduck 32b111b8e2 add statusline theme option 2022-11-25 10:49:15 +05:30
siduck 40130ce741 rm outdated nvchad_ui setup call 2022-11-24 20:41:53 +05:30
siduck ce9388d13d load bg file (containing vim.opt.bg value) 2022-11-22 08:29:48 +05:30
siduck 4f789d3406 add multiple cmp themes https://github.com/NvChad/base46/issues/109 2022-11-21 21:06:49 +05:30
siduck 8f92334c57 load syntax highlights in treesitter config 2022-11-20 21:50:13 +05:30
siduck d27e6a2b9d rm un-needed cmd 2022-11-20 17:35:56 +05:30
siduck b266f066af handle error base46_cache error 2022-11-19 12:02:07 +05:30
siduck d27029d1b1 load base46_cache in instead of minified modules 2022-11-19 11:45:33 +05:30
siduck c16c22e87b rm title option
fixes (#1653) and this is a cmp issue + only with some terminals
2022-11-17 23:35:28 +05:30
siduck 3616f417e7 fix packer bootstrapping not working 2022-11-17 23:16:28 +05:30
siduck 76f0c9bc6f rm incorrect theme cache path 2022-11-17 22:32:57 +05:30
siduck 770e07f77c fix typo in mkdir cmd 2022-11-17 22:04:03 +05:30
siduck a894ced767 add cmd to compile nvchad theme 2022-11-17 21:32:55 +05:30
siduck f77d052d70 change highlight loading function name 2022-11-17 19:26:43 +05:30
siduck 08453985ca rm un-needed lazyload function 2022-11-17 07:00:36 +05:30
siduck 936131c00a move ui plugin config to chadrc UI table 2022-11-16 09:53:16 +05:30
siduck d142ac899a use dev branch for ui/base46 plugins
this is temporary, gets easy to test dev changes locally
2022-11-16 09:51:07 +05:30
siduck 99f6b2132e remove alpha plugin 2022-11-15 21:28:04 +05:30
siduck 4971e07f6a rm support for ooold plugin syntax 2022-11-15 18:54:21 +05:30
siduck cdbdd66929 use default mapping for diagnostic goto_next 2022-11-15 18:42:15 +05:30
siduck 4db58e4975 add glyph icon for untracked icon (gitsigns 2022-11-15 18:40:40 +05:30
37 changed files with 905 additions and 1536 deletions

View File

@ -1,161 +0,0 @@
# [CONTRIBUTING](https://nvchad.github.io/contribute)
## NvChad install for contributors
If you wish to contribute to NvChad, you should:
1. [create a fork on GitHub](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
2. clone your fork to your machine
- For ssh:
```shell
$ git clone git@github.com:<YOUR GITHUB USERNAME>/NvChad.git ~/.config/nvim
```
- For https:
```shell
$ git clone https://github.com/<YOUR GITHUB USERNAME>/NvChad.git ~/.config/nvim
```
3. [add a new remote repo to track](https://www.atlassian.com/git/tutorials/git-forks-and-upstreams)
- this means you can push/pull as normal to your own repo, but also easily track & update from the NvChad repo
- for ssh:
```shell
$ git remote add upstream git@github.com:NvChad/NvChad.git
```
- for https:
```shell
$ git remote add upstream https://github.com/NvChad/NvChad.git
```
4. any time you create a branch to do some work, use
```shell
$ git fetch upstream && git checkout -b dev-myFEAT upstream/main
```
5. only use the **--rebase** flag to update your dev branch
- this means that there are no `Merge NvChad/main into devBranch` commits, which are to be avoided
```shell
$ git pull upstream --rebase
```
## Things to know before contributing
- When making a PR (pull request), please be very descriptive about what you've done!
- PR titles should be formatted with 'fix', 'chore' or 'feat'. ex: `feat: add new plugin`
- PRs should follow the pull request formats where applicable
- We are open to all PRs, but may decline some for a myriad of reasons. Though don't be discouraged! We'll still be open to discussions.
- PR's are always welcomed however NvChad aims to be less bloated. So PR's regarding existing plugin's enhancement and creating new features with existing plugins itself ( without adding a new plugin), bug fixes and corrections are more encouraged.
- NvChad won't keep adding more and more features (like adding new plugins most likely) as requested if they feel unneeded and aren't usable by the majority!! If you think the plugin you want to be added is very useful and many NvChaders would find it useful, then such feature's PR is welcomed!
- But adding specific features like adding config for [wakatime](https://github.com/wakatime/vim-wakatime) etc will be added in this [chad user configs](https://github.com/NvChad/NvChad/wiki/Chad-user-configs). This lets the user select the things only they want ( adding configs from extra configs ).
## How to remove or edit commits from your PR
> You may have been directed here to remove a commit such as a merge commit: `Merge NvChad/main into devBranch` from your PR
> As these commands edit your git history, you may need to **force push** with `git push origin --force`
1. Run the following:
```
$ git rebase -i HEAD~<NUMBER OF COMMITS TO GO BACK>
```
<details><summary>Example</summary>
<p>
```shell
$ git rebase -i HEAD~4
```
```shell
pick 28b2dcb statusline add lsp status
pick dad9a39 feat: Added lsp radial progress
pick 68f72f1 add clickable btn for exiting nvim
pick b281b53 avoid using q! for quitting vim
# Rebase 52b655b..b281b53 onto 52b655b (4 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# . create a merge commit using the original merge commit's
# . message (or the oneline, if no original merge commit was
# . specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
```
</p>
</details>
2. Change the `pick` commands to whatever you wish, you may wish to `d` `drop` or `e` `edit` a commit. Then save & quit this git file to run it.
<details><summary>Example</summary>
<p>
```shell {3,4}
pick 28b2dcb statusline add lsp status
pick dad9a39 feat: Added lsp radial progress
edit 68f72f1 add clickable btn for exiting nvim
d b281b53 avoid using q! for quitting vim
# Rebase 52b655b..b281b53 onto 52b655b (4 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# . create a merge commit using the original merge commit's
# . message (or the oneline, if no original merge commit was
# . specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
```
</p>
</details>
3. If you picked `drop` you are done, if you picked `edit` then edit your files, then run:
```shell
$ git add <files>
```
4. Once you have edited & added your files, run:
```shell
$ git rebase --continue
```
5. You will likely need to push using:
```shell
$ git push origin --force
```
## Help
For help with contributing and anything else nvChad related join the [discord](https://discord.gg/VyPxsGArXc)

3
.github/FUNDING.yml vendored
View File

@ -1,3 +0,0 @@
patreon: siduck
ko_fi: siduck
custom: ["https://www.buymeacoffee.com/siduck", "https://www.paypal.com/paypalme/siduck76"]

View File

@ -1,34 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
<!-- Before reporting: update nvchad to the latest version,read breaking changes page,search existing issues. -->
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- Operating System
- Terminal
- Version of Neovim
**Additional context**
Add any other context about the problem here.

View File

@ -1,8 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Wiki
url: https://github.com/siduck76/NvChad/wiki
about: "Walks you through how to use and Configure NvChad."
- name: Visit our gitter chat
url: https://gitter.im/neovim-dotfiles/community
about: "A place where we dicuss NvChad related stuff."

View File

@ -1,23 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem was.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
**Screenshot**
Maybe a screenshot of the feature

View File

@ -1,14 +0,0 @@
Fixes Issue # (If it doesn't fix an issue then delete this line)
Features Added:
- Plugin Name (Add links if possible too)
Reasoning:
List why the feature is needed
Speed (If applicable):
Show the impact on the speed of nvChad
Other:
Anything else relevant goes here

View File

@ -1,16 +0,0 @@
(Make sure your title is either: 'fix', 'chore', or 'feat' then your title. ex: `fix: add new plugin`)
Fixes Issue # (If it doesn't fix an issue then delete this line)
Plugins Added:
- [Plugin Name](Plugin Link)
- [Plugin Name](Plugin Link)
Reasoning:
List why the plugin(s) should be added
Speed:
Show the impact on the speed of nvChad
Other:
Anything else relevant goes here

146
.github/README.md vendored
View File

@ -1,146 +0,0 @@
<h1 align="center">NvChad</h1>
<div align="center">
<a href="https://nvchad.github.io/">Home</a>
<span></span>
<a href="https://nvchad.github.io/quickstart/install">Install</a>
<span></span>
<a href="https://nvchad.github.io/contribute">Contribute</a>
<span></span>
<a href="https://github.com/NvChad/NvChad#gift_heart-support">Support</a>
<span></span>
<a href="https://nvchad.github.io/Features">Features</a>
<p></p>
</div>
<div align="center">
[![Super Linter](https://img.shields.io/github/workflow/status/NvChad/NvChad/Super-Linter/main?style=flat-square&logo=github&label=Build&color=8DBBE9)]()
<a href="https://github.com/NvChad/NvChad/blob/main/LICENSE"
><img
src="https://img.shields.io/github/license/NvChad/NvChad?style=flat-square&logo=GNU&label=License&color=df967f"
alt="License"
/>
[![Neovim Minimum Version](https://img.shields.io/badge/Neovim-0.8.0-blueviolet.svg?style=flat-square&logo=Neovim&color=90E59A&logoColor=white)](https://github.com/neovim/neovim)
[![GitHub Issues](https://img.shields.io/github/issues/NvChad/NvChad.svg?style=flat-square&label=Issues&color=d77982)](https://github.com/NvChad/NvChad/issues)
[![Discord](https://img.shields.io/discord/869557815780470834?color=738adb&label=Discord&logo=discord&logoColor=white&style=flat-square)](https://discord.gg/gADmkJb9Fb)
[![Matrix](https://img.shields.io/badge/Matrix-40aa8b.svg?style=flat-square&logo=Matrix&logoColor=white)](https://matrix.to/#/#nvchad:matrix.org)
[![Telegram](https://img.shields.io/badge/Telegram-blue.svg?style=flat-square&logo=Telegram&logoColor=white)](https://t.me/DE_WM)
</div>
## Showcase
<img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/screenshots/dashboard.png">
<img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/screenshots/main2.png">
( Zoom in the screenshot )
<img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/screenshots/main.png">
<img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/screenshots/rxyhn1.png">
## What is it?
- NvChad is a neovim config written in lua aiming to provide a base configuration with very beautiful UI and blazing fast startuptime (around 0.02 secs ~ 0.07 secs). We tweak UI plugins such as telescope, nvim-tree, bufferline etc well to provide an aesthetic UI experience.
- Lazy loading is done 93% of the time meaning that plugins will not be loaded by default, they will be loaded only when required also at specific commands, events etc. This lowers the startuptime and it was like 0.07~ secs tested on an old pentium machine 1.4ghz + 4gb ram & HDD.
- NvChad isnt a framework! Its supposed to be used as a "base" config, so users could tweak the defaults well, can also remove the things they dont like in the default config and build their config on top of it. Users can tweak the entire default config while staying in their custom config (lua/custom dir). This is the control center of the user's config and gitignored so the users can stay update to-date with NvChad's latest config (main branch) while still controlling it with their chadrc (file that controls entire custom dir)
## Theme Showcase
<details><summary> <b>Images (Click to expand!)</b></summary>
![main themes](https://github.com/NvChad/nvchad.github.io/blob/src/static/img/screenshots/four_Themes.png)
![radium](https://github.com/NvChad/nvchad.github.io/blob/src/static/img/screenshots/radium1.png)
![radium](https://github.com/NvChad/nvchad.github.io/blob/src/static/img/screenshots/radium2.png)
![radium](https://github.com/NvChad/nvchad.github.io/blob/src/static/img/screenshots/radium3.png)
(Note: these are just 4-5 themes, NvChad has around 27+ themes)
</details>
## UI related plugins used
<details><summary> <b>Images (Click to expand!)</b></summary>
<h3> Nvim-tree.lua </h3>
Fast file tree:
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/nvimtree.png"></kbd><hr>
<h3> Telescope-nvim </h3>
A fuzzy file finder, picker, sorter, previewer and much more:
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/tel.png"></kbd><hr>
<h3> Indent-blankline.nvim </h3>
Adds indentline:
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/blanklineNvim.png"></kbd><hr>
<h3> Our own statusline written from scratch </h3>
[NvChad UI](https://github.com/NvChad/ui)
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/statusline.png"></kbd><hr>
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/statusline_modes.png"></kbd><hr>
<h3> Tabufline (our own pertab bufferline) </h3>
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/tabufline1.png"></kbd><hr>
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/tabufline2.png"></kbd><hr>
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/tabufline3.png"></kbd><hr>
<h3> Nvim-web-devicons </h3>
Lua fork of Vim Devicons which offers more file icon customisability:
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/devicons.png"></kbd><hr>
<h3> Nvim-treesitter </h3
NeoVim Treesitter configurations and abstraction layer. We mostly use this for syntax highlighting. The pretty syntax highlighting you see in all of our screenshots has gotten possible due to treesitter
</details>
## Plugins list
- Many beautiful themes, theme toggler by [our base46 plugin](https://github.com/NvChad/base46)
- Inbuilt terminal toggling & management with [Nvterm](https://github.com/NvChad/nvterm)
- NvChad updater, hide & unhide terminal buffers with [NvChad extensions](https://github.com/NvChad/extensions)
- Lightweight & performant ui plugin with [NvChad UI](https://github.com/NvChad/ui)
- File navigation with [nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua)
- Managing tabs, buffers with [bufferline.nvim](https://github.com/akinsho/bufferline.nvim)
- Beautiful and configurable icons with [nvim-web-devicons](https://github.com/kyazdani42/nvim-web-devicons)
- Git diffs and more with [gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)
- NeoVim Lsp configuration with [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) and [mason.nvim](https://github.com/williamboman/mason.nvim)
- Autocompletion with [nvim-cmp](https://github.com/hrsh7th/nvim-cmp)
- File searching, previewing image and text files and more with [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim).
- Syntax highlighting with [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
- Autoclosing braces and html tags with [nvim-autopairs](https://github.com/windwp/nvim-autopairs)
- Indentlines with [indent-blankline.nvim](https://github.com/lukas-reineke/indent-blankline.nvim)
- Useful snippets with [friendly snippets](https://github.com/rafamadriz/friendly-snippets) + [LuaSnip](https://github.com/L3MON4D3/LuaSnip).
- Popup mappings keysheet [whichkey.nvim](https://github.com/folke/which-key.nvim)
## History
- I (@siduck i.e creator of NvChad) in my initial days of learning to program wanted a lightweight IDE for writing code, I had a very low end system which was like 1.4ghz pentium + 4gb ram & HDD. I was into web dev stuff so many suggested me to use vscode but that thing was very heavy on my system, It took more ram than my browser! ( minimal ungoogled chromium ) so I never tried it again, sublime text was nice but the fear of using proprietary software XD for a linux user bugged me a lot. Then I tried doom-emacs which looked pretty but it was slow and I was lost within its docs, I tried lunarvim but too lazy to read the docs. Doom-emacs and lunarvim inspired me to make a config which is the prettiest + very fast and simple.
- I'm decent at ricing i.e customizing system and making it look pretty so I posted my neovim rice on [neovim subreddit](https://www.reddit.com/r/neovim/comments/m3xl4f/neovim_rice/), my neovim-dotfiles github repo blew up and then I had to come up with a name, I was amazed by the chad meme lol so I put NvChad as the name, the chad word in here doesnt literally mean the chad guy but in the sense such as chad linux vs windows i.e meaning superior, best etc. NvChad was made for my personal use but it gained some popularity which inspired me to make a public config i.e config usable by many and less hassle to update as everyone's going to use the same base config (NvChad) with their custom modifications (which are gitignored so that wont mess up), without the custom config stuff users would have to keep a track of every commit and copy paste git diffs to manually update nvchad.
## :gift_heart: Support
I'm (@siduck) really very sorry to remove the previous charity links but I had to do it for various reasons. A lot has been going here regarding financial issues and I do need some support if it's possible from your end. I haven't graduated yet and it would be great to earn some stuff as that'd help me with daily minor expenses. If you like NvChad and would like to support & appreciate it via donation then I'll gladly accept it. Dont worry! NvChad will still stay alive & active without your donations! I will remove the sponsor button and re-add the charity links once I get a job, probably a year or two.
[![kofi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/siduck)
[![paypal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/siduck76)
[![buymeacoffee](https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/siduck)
[![patreon](https://img.shields.io/badge/Patreon-F96854?style=for-the-badge&logo=patreon&logoColor=white)](https://www.patreon.com/siduck)
## Credits
- [Elianiva](https://github.com/elianiva) helped me with NeoVim Lua related issues many times, NvChad wouldn't exist without his help at all as he helped me in my initial neovim journey!
- @lorvethe for making the beautiful NvChad logo.

View File

@ -1,22 +0,0 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
exempt-all-issue-assignees: true # doesn't close an issue if someone was assigned to it.
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
exempt-all-pr-assignees: true # doesn't close a pr if someone was assigned to it.
days-before-issue-stale: 30
days-before-pr-stale: 45
days-before-issue-close: 5
days-before-pr-close: 10

5
.gitignore vendored
View File

@ -1,6 +1,9 @@
plugin
custom
spell
ftplugin
syntax
coc-settings.json
.luarc.json
lazy-lock.json
after
.github

1
.ignore Normal file
View File

@ -0,0 +1 @@
!/lua/custom/

View File

@ -1,34 +1,21 @@
vim.defer_fn(function()
pcall(require, "impatient")
end, 0)
require "core"
require "core.options"
-- setup packer + plugins
local fn = vim.fn
local install_path = fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim"
local custom_init_path = vim.api.nvim_get_runtime_file("lua/custom/init.lua", false)[1]
if fn.empty(fn.glob(install_path)) > 0 then
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#1e222a" })
print "Cloning packer .."
fn.system { "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path }
-- install plugins + compile their configs
vim.cmd "packadd packer.nvim"
require "plugins"
vim.cmd "PackerSync"
-- install binaries from mason.nvim & tsparsers
vim.api.nvim_create_autocmd("User", {
pattern = "PackerComplete",
callback = function()
vim.cmd "bw | silent! MasonInstallAll" -- close packer window
require("packer").loader "nvim-treesitter"
end,
})
if custom_init_path then
dofile(custom_init_path)
end
pcall(require, "custom")
require("core.utils").load_mappings()
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
-- bootstrap lazy.nvim!
if not vim.loop.fs_stat(lazypath) then
require("core.bootstrap").gen_chadrc_template()
require("core.bootstrap").lazy(lazypath)
end
dofile(vim.g.base46_cache .. "defaults")
vim.opt.rtp:prepend(lazypath)
require "plugins"

63
lua/core/bootstrap.lua Normal file
View File

@ -0,0 +1,63 @@
local M = {}
M.echo = function(str)
vim.cmd "redraw"
vim.api.nvim_echo({ { str, "Bold" } }, true, {})
end
local function shell_call(args)
local output = vim.fn.system(args)
assert(vim.v.shell_error == 0, "External call failed with error code: " .. vim.v.shell_error .. "\n" .. output)
end
M.lazy = function(install_path)
------------- base46 ---------------
local lazy_path = vim.fn.stdpath "data" .. "/lazy/base46"
M.echo " Compiling base46 theme to bytecode ..."
local base46_repo = "https://github.com/NvChad/base46"
shell_call { "git", "clone", "--depth", "1", "-b", "v2.0", base46_repo, lazy_path }
vim.opt.rtp:prepend(lazy_path)
require("base46").compile()
--------- lazy.nvim ---------------
M.echo " Installing lazy.nvim & plugins ..."
local repo = "https://github.com/folke/lazy.nvim.git"
shell_call { "git", "clone", "--filter=blob:none", "--branch=stable", repo, install_path }
vim.opt.rtp:prepend(install_path)
-- install plugins
require "plugins"
-- mason packages & show post_boostrap screen
require "nvchad.post_install"()
end
M.gen_chadrc_template = function()
if not vim.api.nvim_get_runtime_file("lua/custom/chadrc.lua", false)[1] then
local path = vim.fn.stdpath "config" .. "/lua/custom/"
local input = "N"
if next(vim.api.nvim_list_uis()) then
input = vim.fn.input "Do you want to install example custom config? (y/N) : "
end
-- clone example_config repo
if input == "y" then
M.echo "cloning example custom config repo ..."
shell_call { "git", "clone", "--depth", "1", "https://github.com/NvChad/example_config", path }
vim.fn.delete(path .. ".git", "rf")
else
-- use very minimal chadrc
vim.fn.mkdir(path, "p")
local file = io.open(path .. "chadrc.lua", "w")
file:write "---@type ChadrcConfig \n local M = {}\n M.ui = {theme = 'onedark'}\n return M"
file:close()
end
end
end
return M

View File

@ -1,15 +1,11 @@
-- Chadrc overrides this file
local M = {}
M.options = {
nvChad = {
update_url = "https://github.com/NvChad/NvChad",
update_branch = "main",
},
nvchad_branch = "v2.0",
}
M.ui = {
------------------------------- base46 -------------------------------------
-- hl = highlights
hl_add = {},
hl_override = {},
@ -17,11 +13,80 @@ M.ui = {
theme_toggle = { "onedark", "one_light" },
theme = "onedark", -- default theme
transparency = false,
lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens
-- https://github.com/NvChad/base46/tree/v2.0/lua/base46/extended_integrations
extended_integrations = {}, -- these aren't compiled by default, ex: "alpha", "notify"
-- cmp themeing
cmp = {
icons = true,
lspkind_text = true,
style = "default", -- default/flat_light/flat_dark/atom/atom_colored
border_color = "grey_fg", -- only applicable for "default" style, use color names from base30 variables
selected_item_bg = "colored", -- colored / simple
},
telescope = { style = "borderless" }, -- borderless / bordered
------------------------------- nvchad_ui modules -----------------------------
statusline = {
theme = "default", -- default/vscode/vscode_colored/minimal
-- default/round/block/arrow separators work only for default statusline theme
-- round and block will work for minimal theme only
separator_style = "default",
overriden_modules = nil,
},
-- lazyload it when there are 1+ buffers
tabufline = {
show_numbers = false,
enabled = true,
lazyload = true,
overriden_modules = nil,
},
-- nvdash (dashboard)
nvdash = {
load_on_startup = false,
header = {
" ▄ ▄ ",
" ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ ",
" █ ▄ █▄█ ▄▄▄ █ █▄█ █ █ ",
" ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █ ",
" ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ",
" █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄",
"▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █",
"█▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █",
" █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█ ",
},
buttons = {
{ " Find File", "Spc f f", "Telescope find_files" },
{ "󰈚 Recent Files", "Spc f o", "Telescope oldfiles" },
{ "󰈭 Find Word", "Spc f w", "Telescope live_grep" },
{ " Bookmarks", "Spc m a", "Telescope marks" },
{ " Themes", "Spc t h", "Telescope themes" },
{ " Mappings", "Spc c h", "NvCheatsheet" },
},
},
cheatsheet = { theme = "grid" }, -- simple/grid
lsp = {
-- show function signatures i.e args as you type
signature = {
disabled = false,
silent = true, -- silences 'no signature help available' message from appearing
},
},
}
M.plugins = {}
M.plugins = "" -- path i.e "custom.plugins", so make custom/plugins.lua file
M.lazy_nvim = require "plugins.configs.lazy_nvim" -- config for lazy.nvim startup options
-- check core.mappings for table structure
M.mappings = require "core.mappings"
return M

View File

@ -1,14 +1,66 @@
local opt = vim.opt
local g = vim.g
local config = require("core.utils").load_config()
-------------------------------------- globals -----------------------------------------
g.nvchad_theme = config.ui.theme
g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
-------------------------------------- options ------------------------------------------
opt.laststatus = 3 -- global statusline
opt.showmode = false
opt.clipboard = "unnamedplus"
opt.cursorline = true
-- Indenting
opt.expandtab = true
opt.shiftwidth = 2
opt.smartindent = true
opt.tabstop = 2
opt.softtabstop = 2
opt.fillchars = { eob = " " }
opt.ignorecase = true
opt.smartcase = true
opt.mouse = "a"
-- Numbers
opt.number = true
opt.numberwidth = 2
opt.ruler = false
-- disable nvim intro
opt.shortmess:append "sI"
opt.signcolumn = "yes"
opt.splitbelow = true
opt.splitright = true
opt.termguicolors = true
opt.timeoutlen = 400
opt.undofile = true
-- interval for writing swap file to disk, also used by gitsigns
opt.updatetime = 250
-- go to previous/next line with h,l,left arrow and right arrow
-- when cursor reaches end/beginning of line
opt.whichwrap:append "<>[]hl"
g.mapleader = " "
-- disable some default providers
for _, provider in ipairs { "node", "perl", "python3", "ruby" } do
vim.g["loaded_" .. provider .. "_provider"] = 0
end
-- add binaries installed by mason.nvim to path
local is_windows = vim.loop.os_uname().sysname == "Windows_NT"
vim.env.PATH = vim.env.PATH .. (is_windows and ";" or ":") .. vim.fn.stdpath "data" .. "/mason/bin"
vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and ";" or ":") .. vim.env.PATH
-- commands
vim.cmd "silent! command! NvChadUpdate lua require('nvchad').update_nvchad()"
vim.cmd "silent! command! NvChadSnapshotCreate lua require('nvchad').snap_create()"
vim.cmd "silent! command! NvChadSnapshotDelete lua require('nvchad').snap_delete()"
vim.cmd "silent! command! NvChadSnapshotCheckout lua require('nvchad').snap_checkout()"
-- autocmds
-------------------------------------- autocmds ------------------------------------------
local autocmd = vim.api.nvim_create_autocmd
-- dont list quickfix buffers
@ -19,9 +71,45 @@ autocmd("FileType", {
end,
})
-- wrap the PackerSync command to warn people before using it in NvChadSnapshots
autocmd("VimEnter", {
callback = function()
vim.cmd "command! -nargs=* -complete=customlist,v:lua.require'packer'.plugin_complete PackerSync lua require('plugins') require('core.utils').packer_sync(<f-args>)"
-- reload some chadrc options on-save
autocmd("BufWritePost", {
pattern = vim.tbl_map(function(path)
return vim.fs.normalize(vim.loop.fs_realpath(path))
end, vim.fn.glob(vim.fn.stdpath "config" .. "/lua/custom/**/*.lua", true, true, true)),
group = vim.api.nvim_create_augroup("ReloadNvChad", {}),
callback = function(opts)
local fp = vim.fn.fnamemodify(vim.fs.normalize(vim.api.nvim_buf_get_name(opts.buf)), ":r") --[[@as string]]
local app_name = vim.env.NVIM_APPNAME and vim.env.NVIM_APPNAME or "nvim"
local module = string.gsub(fp, "^.*/" .. app_name .. "/lua/", ""):gsub("/", ".")
require("plenary.reload").reload_module "base46"
require("plenary.reload").reload_module(module)
require("plenary.reload").reload_module "custom.chadrc"
config = require("core.utils").load_config()
vim.g.nvchad_theme = config.ui.theme
vim.g.transparency = config.ui.transparency
-- statusline
require("plenary.reload").reload_module("nvchad.statusline." .. config.ui.statusline.theme)
vim.opt.statusline = "%!v:lua.require('nvchad.statusline." .. config.ui.statusline.theme .. "').run()"
-- tabufline
if config.ui.tabufline.enabled then
require("plenary.reload").reload_module "nvchad.tabufline.modules"
vim.opt.tabline = "%!v:lua.require('nvchad.tabufline.modules').run()"
end
require("base46").load_all_highlights()
-- vim.cmd("redraw!")
end,
})
-------------------------------------- commands ------------------------------------------
local new_cmd = vim.api.nvim_create_user_command
new_cmd("NvChadUpdate", function()
require "nvchad.updater"()
end, {})

View File

@ -1,79 +0,0 @@
local M = {}
local autocmd = vim.api.nvim_create_autocmd
-- require("packer").loader(tb.plugins)
-- This must be used for plugins that need to be loaded just after a file
-- ex : treesitter, lspconfig etc
M.lazy_load = function(tb)
autocmd(tb.events, {
group = vim.api.nvim_create_augroup(tb.augroup_name, {}),
callback = function()
if tb.condition() then
vim.api.nvim_del_augroup_by_name(tb.augroup_name)
-- dont defer for treesitter as it will show slow highlighting
-- This deferring only happens only when we do "nvim filename"
if tb.plugin ~= "nvim-treesitter" then
vim.defer_fn(function()
require("packer").loader(tb.plugin)
if tb.plugin == "nvim-lspconfig" then
vim.cmd "silent! do FileType"
end
end, 0)
else
require("packer").loader(tb.plugin)
end
end
end,
})
end
-- load certain plugins only when there's a file opened in the buffer
-- if "nvim filename" is executed -> load the plugin after nvim gui loads
-- This gives an instant preview of nvim with the file opened
M.on_file_open = function(plugin_name)
M.lazy_load {
events = { "BufRead", "BufWinEnter", "BufNewFile" },
augroup_name = "BeLazyOnFileOpen" .. plugin_name,
plugin = plugin_name,
condition = function()
local file = vim.fn.expand "%"
return file ~= "NvimTree_1" and file ~= "[packer]" and file ~= ""
end,
}
end
M.packer_cmds = {
"PackerSnapshot",
"PackerSnapshotRollback",
"PackerSnapshotDelete",
"PackerInstall",
"PackerUpdate",
"PackerSync",
"PackerClean",
"PackerCompile",
"PackerStatus",
"PackerProfile",
"PackerLoad",
}
M.treesitter_cmds = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSEnable", "TSDisable", "TSModuleInfo" }
M.mason_cmds = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" }
M.gitsigns = function()
autocmd({ "BufRead" }, {
group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
callback = function()
vim.fn.system("git -C " .. vim.fn.expand "%:p:h" .. " rev-parse")
if vim.v.shell_error == 0 then
vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
vim.schedule(function()
require("packer").loader "gitsigns.nvim"
end)
end
end,
})
end
return M

View File

@ -1,79 +1,74 @@
-- n, v, i, t = mode names
local function termcodes(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
end
local M = {}
M.general = {
i = {
-- go to beginning and end
["<C-b>"] = { "<ESC>^i", "beginning of line" },
["<C-e>"] = { "<End>", "end of line" },
["<C-b>"] = { "<ESC>^i", "Beginning of line" },
["<C-e>"] = { "<End>", "End of line" },
-- navigate within insert mode
["<C-h>"] = { "<Left>", "move left" },
["<C-l>"] = { "<Right>", "move right" },
["<C-j>"] = { "<Down>", "move down" },
["<C-k>"] = { "<Up>", "move up" },
["<C-h>"] = { "<Left>", "Move left" },
["<C-l>"] = { "<Right>", "Move right" },
["<C-j>"] = { "<Down>", "Move down" },
["<C-k>"] = { "<Up>", "Move up" },
},
n = {
["<ESC>"] = { "<cmd> noh <CR>", "no highlight" },
["<Esc>"] = { ":noh <CR>", "Clear highlights" },
-- switch between windows
["<C-h>"] = { "<C-w>h", "window left" },
["<C-l>"] = { "<C-w>l", "window right" },
["<C-j>"] = { "<C-w>j", "window down" },
["<C-k>"] = { "<C-w>k", "window up" },
["<C-h>"] = { "<C-w>h", "Window left" },
["<C-l>"] = { "<C-w>l", "Window right" },
["<C-j>"] = { "<C-w>j", "Window down" },
["<C-k>"] = { "<C-w>k", "Window up" },
-- save
["<C-s>"] = { "<cmd> w <CR>", "save file" },
["<C-s>"] = { "<cmd> w <CR>", "Save file" },
-- Copy all
["<C-c>"] = { "<cmd> %y+ <CR>", "copy whole file" },
["<C-c>"] = { "<cmd> %y+ <CR>", "Copy whole file" },
-- line numbers
["<leader>n"] = { "<cmd> set nu! <CR>", "toggle line number" },
["<leader>rn"] = { "<cmd> set rnu! <CR>", "toggle relative number" },
-- update nvchad
["<leader>uu"] = { "<cmd> :NvChadUpdate <CR>", "update nvchad" },
["<leader>tt"] = {
function()
require("base46").toggle_theme()
end,
"toggle theme",
},
["<leader>n"] = { "<cmd> set nu! <CR>", "Toggle line number" },
["<leader>rn"] = { "<cmd> set rnu! <CR>", "Toggle relative number" },
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
-- empty mode is same as using <cmd> :map
-- also don't use g[j|k] when in operator pending mode, so it doesn't alter d, y or c behaviour
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
-- new buffer
["<leader>b"] = { "<cmd> enew <CR>", "new buffer" },
["<leader>b"] = { "<cmd> enew <CR>", "New buffer" },
["<leader>ch"] = { "<cmd> NvCheatsheet <CR>", "Mapping cheatsheet" },
["<leader>fm"] = {
function()
vim.lsp.buf.format { async = true }
end,
"LSP formatting",
},
},
t = { ["<C-x>"] = { termcodes "<C-\\><C-N>", "escape terminal mode" } },
t = {
["<C-x>"] = { vim.api.nvim_replace_termcodes("<C-\\><C-N>", true, true, true), "Escape terminal mode" },
},
v = {
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
},
x = {
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', opts = { expr = true } },
["j"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "Move up", opts = { expr = true } },
-- Don't copy the replaced text after pasting in visual mode
-- https://vim.fandom.com/wiki/Replace_a_word_with_yanked_text#Alternative_mapping_for_paste
["p"] = { 'p:let @+=@0<CR>:let @"=@0<CR>', opts = { silent = true } },
["p"] = { 'p:let @+=@0<CR>:let @"=@0<CR>', "Dont copy replaced text", opts = { silent = true } },
},
}
@ -82,29 +77,26 @@ M.tabufline = {
n = {
-- cycle through buffers
["<TAB>"] = {
["<tab>"] = {
function()
require("nvchad_ui.tabufline").tabuflineNext()
require("nvchad.tabufline").tabuflineNext()
end,
"goto next buffer",
"Goto next buffer",
},
["<S-Tab>"] = {
["<S-tab>"] = {
function()
require("nvchad_ui.tabufline").tabuflinePrev()
require("nvchad.tabufline").tabuflinePrev()
end,
"goto prev buffer",
"Goto prev buffer",
},
-- pick buffers via numbers
["<Bslash>"] = { "<cmd> TbufPick <CR>", "Pick buffer" },
-- close buffer + hide terminal buffer
["<leader>x"] = {
function()
require("nvchad_ui.tabufline").close_buffer()
require("nvchad.tabufline").close_buffer()
end,
"close buffer",
"Close buffer",
},
},
}
@ -118,14 +110,14 @@ M.comment = {
function()
require("Comment.api").toggle.linewise.current()
end,
"toggle comment",
"Toggle comment",
},
},
v = {
["<leader>/"] = {
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
"toggle comment",
"Toggle comment",
},
},
}
@ -140,119 +132,112 @@ M.lspconfig = {
function()
vim.lsp.buf.declaration()
end,
"lsp declaration",
"LSP declaration",
},
["gd"] = {
function()
vim.lsp.buf.definition()
end,
"lsp definition",
"LSP definition",
},
["K"] = {
function()
vim.lsp.buf.hover()
end,
"lsp hover",
"LSP hover",
},
["gi"] = {
function()
vim.lsp.buf.implementation()
end,
"lsp implementation",
"LSP implementation",
},
["<leader>ls"] = {
function()
vim.lsp.buf.signature_help()
end,
"lsp signature_help",
"LSP signature help",
},
["<leader>D"] = {
function()
vim.lsp.buf.type_definition()
end,
"lsp definition type",
"LSP definition type",
},
["<leader>ra"] = {
function()
require("nvchad_ui.renamer").open()
require("nvchad.renamer").open()
end,
"lsp rename",
"LSP rename",
},
["<leader>ca"] = {
function()
vim.lsp.buf.code_action()
end,
"lsp code_action",
"LSP code action",
},
["gr"] = {
function()
vim.lsp.buf.references()
end,
"lsp references",
"LSP references",
},
["<leader>f"] = {
function()
vim.diagnostic.open_float()
vim.diagnostic.open_float { border = "rounded" }
end,
"floating diagnostic",
"Floating diagnostic",
},
["[d"] = {
function()
vim.diagnostic.goto_prev()
vim.diagnostic.goto_prev { float = { border = "rounded" } }
end,
"goto prev",
"Goto prev",
},
["d]"] = {
["]d"] = {
function()
vim.diagnostic.goto_next()
vim.diagnostic.goto_next { float = { border = "rounded" } }
end,
"goto_next",
"Goto next",
},
["<leader>q"] = {
function()
vim.diagnostic.setloclist()
end,
"diagnostic setloclist",
},
["<leader>fm"] = {
function()
vim.lsp.buf.format { async = true }
end,
"lsp formatting",
"Diagnostic setloclist",
},
["<leader>wa"] = {
function()
vim.lsp.buf.add_workspace_folder()
end,
"add workspace folder",
"Add workspace folder",
},
["<leader>wr"] = {
function()
vim.lsp.buf.remove_workspace_folder()
end,
"remove workspace folder",
"Remove workspace folder",
},
["<leader>wl"] = {
function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end,
"list workspace folders",
"List workspace folders",
},
},
}
@ -262,10 +247,10 @@ M.nvimtree = {
n = {
-- toggle
["<C-n>"] = { "<cmd> NvimTreeToggle <CR>", "toggle nvimtree" },
["<C-n>"] = { "<cmd> NvimTreeToggle <CR>", "Toggle nvimtree" },
-- focus
["<leader>e"] = { "<cmd> NvimTreeFocus <CR>", "focus nvimtree" },
["<leader>e"] = { "<cmd> NvimTreeFocus <CR>", "Focus nvimtree" },
},
}
@ -274,23 +259,25 @@ M.telescope = {
n = {
-- find
["<leader>ff"] = { "<cmd> Telescope find_files <CR>", "find files" },
["<leader>fa"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "find all" },
["<leader>fw"] = { "<cmd> Telescope live_grep <CR>", "live grep" },
["<leader>fb"] = { "<cmd> Telescope buffers <CR>", "find buffers" },
["<leader>fh"] = { "<cmd> Telescope help_tags <CR>", "help page" },
["<leader>fo"] = { "<cmd> Telescope oldfiles <CR>", "find oldfiles" },
["<leader>tk"] = { "<cmd> Telescope keymaps <CR>", "show keys" },
["<leader>ff"] = { "<cmd> Telescope find_files <CR>", "Find files" },
["<leader>fa"] = { "<cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>", "Find all" },
["<leader>fw"] = { "<cmd> Telescope live_grep <CR>", "Live grep" },
["<leader>fb"] = { "<cmd> Telescope buffers <CR>", "Find buffers" },
["<leader>fh"] = { "<cmd> Telescope help_tags <CR>", "Help page" },
["<leader>fo"] = { "<cmd> Telescope oldfiles <CR>", "Find oldfiles" },
["<leader>fz"] = { "<cmd> Telescope current_buffer_fuzzy_find <CR>", "Find in current buffer" },
-- git
["<leader>cm"] = { "<cmd> Telescope git_commits <CR>", "git commits" },
["<leader>gt"] = { "<cmd> Telescope git_status <CR>", "git status" },
["<leader>cm"] = { "<cmd> Telescope git_commits <CR>", "Git commits" },
["<leader>gt"] = { "<cmd> Telescope git_status <CR>", "Git status" },
-- pick a hidden term
["<leader>pt"] = { "<cmd> Telescope terms <CR>", "pick hidden term" },
["<leader>pt"] = { "<cmd> Telescope terms <CR>", "Pick hidden term" },
-- theme switcher
["<leader>th"] = { "<cmd> Telescope themes <CR>", "nvchad themes" },
["<leader>th"] = { "<cmd> Telescope themes <CR>", "Nvchad themes" },
["<leader>ma"] = { "<cmd> Telescope marks <CR>", "telescope bookmarks" },
},
}
@ -303,21 +290,21 @@ M.nvterm = {
function()
require("nvterm.terminal").toggle "float"
end,
"toggle floating term",
"Toggle floating term",
},
["<A-h>"] = {
function()
require("nvterm.terminal").toggle "horizontal"
end,
"toggle horizontal term",
"Toggle horizontal term",
},
["<A-v>"] = {
function()
require("nvterm.terminal").toggle "vertical"
end,
"toggle vertical term",
"Toggle vertical term",
},
},
@ -327,37 +314,36 @@ M.nvterm = {
function()
require("nvterm.terminal").toggle "float"
end,
"toggle floating term",
"Toggle floating term",
},
["<A-h>"] = {
function()
require("nvterm.terminal").toggle "horizontal"
end,
"toggle horizontal term",
"Toggle horizontal term",
},
["<A-v>"] = {
function()
require("nvterm.terminal").toggle "vertical"
end,
"toggle vertical term",
"Toggle vertical term",
},
-- new
["<leader>h"] = {
function()
require("nvterm.terminal").new "horizontal"
end,
"new horizontal term",
"New horizontal term",
},
["<leader>v"] = {
function()
require("nvterm.terminal").new "vertical"
end,
"new vertical term",
"New vertical term",
},
},
}
@ -370,14 +356,14 @@ M.whichkey = {
function()
vim.cmd "WhichKey"
end,
"which-key all keymaps",
"Which-key all keymaps",
},
["<leader>wk"] = {
function()
local input = vim.fn.input "WhichKey: "
vim.cmd("WhichKey " .. input)
end,
"which-key query lookup",
"Which-key query lookup",
},
},
}
@ -399,7 +385,7 @@ M.blankline = {
end
end,
"Jump to current_context",
"Jump to current context",
},
},
}

View File

@ -1,96 +0,0 @@
local opt = vim.opt
local g = vim.g
local config = require("core.utils").load_config()
g.nvchad_theme = config.ui.theme
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
g.theme_switcher_loaded = false
opt.laststatus = 3 -- global statusline
opt.showmode = false
opt.title = true
opt.clipboard = "unnamedplus"
opt.cursorline = true
-- Indenting
opt.expandtab = true
opt.shiftwidth = 2
opt.smartindent = true
opt.tabstop = 2
opt.softtabstop = 2
opt.fillchars = { eob = " " }
opt.ignorecase = true
opt.smartcase = true
opt.mouse = "a"
-- Numbers
opt.number = true
opt.numberwidth = 2
opt.ruler = false
-- disable nvim intro
opt.shortmess:append "sI"
opt.signcolumn = "yes"
opt.splitbelow = true
opt.splitright = true
opt.termguicolors = true
opt.timeoutlen = 400
opt.undofile = true
-- interval for writing swap file to disk, also used by gitsigns
opt.updatetime = 250
-- go to previous/next line with h,l,left arrow and right arrow
-- when cursor reaches end/beginning of line
opt.whichwrap:append "<>[]hl"
g.mapleader = " "
-- disable some builtin vim plugins
local default_plugins = {
"2html_plugin",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
}
for _, plugin in pairs(default_plugins) do
g["loaded_" .. plugin] = 1
end
local default_providers = {
"node",
"perl",
"python3",
"ruby",
}
for _, provider in ipairs(default_providers) do
vim.g["loaded_" .. provider .. "_provider"] = 0
end

View File

@ -3,19 +3,16 @@ local merge_tb = vim.tbl_deep_extend
M.load_config = function()
local config = require "core.default_config"
local chadrc_exists, chadrc = pcall(require, "custom.chadrc")
local chadrc_path = vim.api.nvim_get_runtime_file("lua/custom/chadrc.lua", false)[1]
if chadrc_path then
local chadrc = dofile(chadrc_path)
if chadrc_exists then
-- merge user config if it exists and is a table; otherwise display an error
if type(chadrc) == "table" then
config.mappings = M.remove_disabled_keys(chadrc.mappings, config.mappings)
config = merge_tb("force", config, chadrc) or {}
else
error "chadrc must return a table!"
end
config = merge_tb("force", config, chadrc)
config.mappings.disabled = nil
end
config.mappings.disabled = nil
return config
end
@ -55,10 +52,12 @@ M.remove_disabled_keys = function(chadrc_mappings, default_mappings)
end
M.load_mappings = function(section, mapping_opt)
vim.schedule(function()
local function set_section_map(section_values)
if section_values.plugin then
return
end
section_values.plugin = nil
for mode, mode_values in pairs(section_values) do
@ -85,108 +84,35 @@ M.load_mappings = function(section, mapping_opt)
for _, sect in pairs(mappings) do
set_section_map(sect)
end
end)
end
-- merge default/user plugin tables
M.merge_plugins = function(plugins)
local plugin_configs = M.load_config().plugins
local user_plugins = plugin_configs
M.lazy_load = function(plugin)
vim.api.nvim_create_autocmd({ "BufRead", "BufWinEnter", "BufNewFile" }, {
group = vim.api.nvim_create_augroup("BeLazyOnFileOpen" .. plugin, {}),
callback = function()
local file = vim.fn.expand "%"
local condition = file ~= "NvimTree_1" and file ~= "[lazy]" and file ~= ""
-- old plugin syntax for adding plugins
if plugin_configs.user and type(plugin_configs.user) == "table" then
user_plugins = plugin_configs.user
end
-- support old plugin removal syntax
local remove_plugins = plugin_configs.remove
if type(remove_plugins) == "table" then
for _, v in ipairs(remove_plugins) do
plugins[v] = nil
end
end
plugins = merge_tb("force", plugins, user_plugins)
local final_table = {}
for key, val in pairs(plugins) do
if val and type(val) == "table" then
plugins[key] = val.rm_default_opts and user_plugins[key] or plugins[key]
plugins[key][1] = key
final_table[#final_table + 1] = plugins[key]
end
end
return final_table
end
-- override plugin options table with custom ones
M.load_override = function(options_table, name)
local plugin_configs, plugin_options = M.load_config().plugins, nil
-- support old plugin syntax for override
local user_override = plugin_configs.override and plugin_configs.override[name]
if user_override and type(user_override) == "table" then
plugin_options = user_override
end
-- if no old style plugin override is found, then use the new syntax
if not plugin_options and plugin_configs[name] then
local override_options = plugin_configs[name].override_options or {}
if type(override_options) == "table" then
plugin_options = override_options
elseif type(override_options) == "function" then
plugin_options = override_options()
end
end
-- make sure the plugin options are a table
plugin_options = type(plugin_options) == "table" and plugin_options or {}
return merge_tb("force", options_table, plugin_options)
end
M.packer_sync = function(...)
local git_exists, git = pcall(require, "nvchad.utils.git")
local defaults_exists, defaults = pcall(require, "nvchad.utils.config")
local packer_exists, packer = pcall(require, "packer")
if git_exists and defaults_exists then
local current_branch_name = git.get_current_branch_name()
-- warn the user if we are on a snapshot branch
if current_branch_name:match(defaults.snaps.base_snap_branch_name .. "(.+)" .. "$") then
vim.api.nvim_echo({
{ "WARNING: You are trying to use ", "WarningMsg" },
{ "PackerSync" },
{
" on a NvChadSnapshot. This will cause issues if NvChad dependencies contain "
.. "any breaking changes! Plugin updates will not be included in this "
.. "snapshot, so they will be lost after switching between snapshots! Would "
.. "you still like to continue? [y/N]\n",
"WarningMsg",
},
}, false, {})
local ans = vim.trim(string.lower(vim.fn.input "-> "))
if ans ~= "y" then
return
end
end
end
if packer_exists then
packer.sync(...)
local plugins = M.load_config().plugins
local old_style_options = plugins.user or plugins.override or plugins.remove
if old_style_options then
vim.notify_once("NvChad: This plugin syntax is deprecated, use new style config.", "Error")
if condition then
vim.api.nvim_del_augroup_by_name("BeLazyOnFileOpen" .. plugin)
-- dont defer for treesitter as it will show slow highlighting
-- This deferring only happens only when we do "nvim filename"
if plugin ~= "nvim-treesitter" then
vim.schedule(function()
require("lazy").load { plugins = plugin }
if plugin == "nvim-lspconfig" then
vim.cmd "silent! do FileType"
end
end, 0)
else
error "Packer could not be loaded!"
require("lazy").load { plugins = plugin }
end
end
end,
})
end
return M

6
lua/custom/chadrc.lua Normal file
View File

@ -0,0 +1,6 @@
---@type ChadrcConfig
local M = {}
M.ui = {theme = 'gatekeeper'}
M.plugins = 'custom.plugins'
M.mappings = require "custom.mappings"
return M

View File

@ -0,0 +1,6 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require("lspconfig")
local util = require "lspconfig/util"

View File

@ -0,0 +1,10 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local options = {
server = {
on_attach = on_attach,
capabilities = capabilities,
}
}
return options

6
lua/custom/init.lua Normal file
View File

@ -0,0 +1,6 @@
vim.opt.colorcolumn = "180"
vim.opt.expandtab = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 0
vim.opt.shiftwidth = 0

30
lua/custom/mappings.lua Normal file
View File

@ -0,0 +1,30 @@
local M = {}
M.dap = {
n = {
["<leader>db"] = {
"<cmd> DapToggleBreakpoint <CR>",
"Toggle Breakpoint"
},
["<leader>dus"] = {
function ()
local widgets = require("dap.ui.widgets");
local sidebar = widgets.sidebar(widgets.scopes);
sidebar.open();
end,
"Open debugging sidebar"
},
["<leader>dc"] = {
"<cmd> DapContinue <CR>",
"Continue debugging"
},
["<leader>rcu"] = {
function ()
require("crates").upgrade_all_crates()
end,
"Update all rust crates"
}
}
}
return M

57
lua/custom/plugins.lua Normal file
View File

@ -0,0 +1,57 @@
local plugins = {
{
"neovim/nvim-lspconfig",
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
end
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"lua-language-server",
"rust-analyzer"
}
}
},
{
"rust-lang/rust.vim",
ft = "rust",
init = function ()
vim.g.rustfmt_autosave = 1
end
},
{
"simrat39/rust-tools.nvim",
ft = "rust",
dependencies = "neovim/nvim-lspconfig",
opts = function ()
return require "custom.configs.rust-tools"
end,
config = function (_, opts)
require("rust-tools").setup(opts)
end
},
{
"mfussenegger/nvim-dap"
},
{
"saecki/crates.nvim",
ft = {"rust", "toml"},
config = function (_, opts)
local crates = require("crates")
crates.setup(opts)
crates.show()
end
},
{
"hrsh7th/nvim-cmp",
opts = function ()
local M = require "plugins.configs.cmp"
table.insert(M.sources, {name = "crates"})
return M
end
}
}
return plugins

View File

@ -1,110 +0,0 @@
local present, alpha = pcall(require, "alpha")
if not present then
return
end
require("base46").load_highlight "alpha"
local function button(sc, txt, keybind)
local sc_ = sc:gsub("%s", ""):gsub("SPC", "<leader>")
local opts = {
position = "center",
text = txt,
shortcut = sc,
cursor = 5,
width = 36,
align_shortcut = "right",
hl = "AlphaButtons",
}
if keybind then
opts.keymap = { "n", sc_, keybind, { noremap = true, silent = true } }
end
return {
type = "button",
val = txt,
on_press = function()
local key = vim.api.nvim_replace_termcodes(sc_, true, false, true) or ""
vim.api.nvim_feedkeys(key, "normal", false)
end,
opts = opts,
}
end
-- dynamic header padding
local fn = vim.fn
local marginTopPercent = 0.3
local headerPadding = fn.max { 2, fn.floor(fn.winheight(0) * marginTopPercent) }
local options = {
header = {
type = "text",
val = {
" ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣿⣶⣿⣦⣼⣆ ",
" ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ",
" ⠈⢿⣿⣟⠦ ⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ",
" ⣸⣿⣿⢧ ⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ",
" ⢠⣿⣿⣿⠈ ⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ",
" ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿⠄ ",
" ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ",
" ⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ",
" ⠙⠃ ⣼⣿⡟ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿ ⣿⣿⡇ ⠛⠻⢷⣄ ",
" ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ",
" ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⡟⢀⣀⣤⣾⡿⠃ ",
},
opts = {
position = "center",
hl = "AlphaHeader",
},
},
buttons = {
type = "group",
val = {
button("SPC f f", " Find File ", ":Telescope find_files<CR>"),
button("SPC f o", " Recent File ", ":Telescope oldfiles<CR>"),
button("SPC f w", " Find Word ", ":Telescope live_grep<CR>"),
button("SPC b m", " Bookmarks ", ":Telescope marks<CR>"),
button("SPC t h", " Themes ", ":Telescope themes<CR>"),
button("SPC e s", " Settings", ":e $MYVIMRC | :cd %:p:h <CR>"),
},
opts = {
spacing = 1,
},
},
headerPaddingTop = { type = "padding", val = headerPadding },
headerPaddingBottom = { type = "padding", val = 2 },
}
options = require("core.utils").load_override(options, "goolord/alpha-nvim")
alpha.setup {
layout = {
options.headerPaddingTop,
options.header,
options.headerPaddingBottom,
options.buttons,
},
opts = {},
}
-- Disable statusline in dashboard
vim.api.nvim_create_autocmd("FileType", {
pattern = "alpha",
callback = function()
-- store current statusline value and use that
local old_laststatus = vim.opt.laststatus
vim.api.nvim_create_autocmd("BufUnload", {
buffer = 0,
callback = function()
vim.opt.laststatus = old_laststatus
end,
})
vim.opt.laststatus = 0
end,
})

View File

@ -1,12 +1,35 @@
local present, cmp = pcall(require, "cmp")
local cmp = require "cmp"
if not present then
return
end
dofile(vim.g.base46_cache .. "cmp")
require("base46").load_highlight "cmp"
local cmp_ui = require("core.utils").load_config().ui.cmp
local cmp_style = cmp_ui.style
vim.o.completeopt = "menu,menuone,noselect"
local field_arrangement = {
atom = { "kind", "abbr", "menu" },
atom_colored = { "kind", "abbr", "menu" },
}
local formatting_style = {
-- default fields order i.e completion word + item.kind + item.kind icons
fields = field_arrangement[cmp_style] or { "abbr", "kind", "menu" },
format = function(_, item)
local icons = require "nvchad.icons.lspkind"
local icon = (cmp_ui.icons and icons[item.kind]) or ""
if cmp_style == "atom" or cmp_style == "atom_colored" then
icon = " " .. icon .. " "
item.menu = cmp_ui.lspkind_text and " (" .. item.kind .. ")" or ""
item.kind = icon
else
icon = cmp_ui.lspkind_text and (" " .. icon .. " ") or icon
item.kind = string.format("%s %s", icon, cmp_ui.lspkind_text and item.kind or "")
end
return item
end,
}
local function border(hl_name)
return {
@ -21,23 +44,20 @@ local function border(hl_name)
}
end
local cmp_window = require "cmp.utils.window"
cmp_window.info_ = cmp_window.info
cmp_window.info = function(self)
local info = self:info_()
info.scrollable = false
return info
end
local options = {
completion = {
completeopt = "menu,menuone",
},
window = {
completion = {
border = border "CmpBorder",
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
side_padding = (cmp_style ~= "atom" and cmp_style ~= "atom_colored") and 1 or 0,
winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel",
scrollbar = false,
},
documentation = {
border = border "CmpDocBorder",
winhighlight = "Normal:CmpDoc",
},
},
snippet = {
@ -45,13 +65,9 @@ local options = {
require("luasnip").lsp_expand(args.body)
end,
},
formatting = {
format = function(_, vim_item)
local icons = require("nvchad_ui.icons").lspkind
vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind)
return vim_item
end,
},
formatting = formatting_style,
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
@ -60,8 +76,8 @@ local options = {
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
@ -89,15 +105,16 @@ local options = {
}),
},
sources = {
{ name = "luasnip" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "path" },
},
}
-- check for any override
options = require("core.utils").load_override(options, "hrsh7th/nvim-cmp")
if cmp_style ~= "atom" and cmp_style ~= "atom_colored" then
options.window.completion.border = border "CmpBorder"
end
cmp.setup(options)
return options

View File

@ -0,0 +1,47 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}

View File

@ -1,11 +1,5 @@
local present, lspconfig = pcall(require, "lspconfig")
if not present then
return
end
require("base46").load_highlight "lsp"
require "nvchad_ui.lsp"
dofile(vim.g.base46_cache .. "lsp")
require "nvchad.lsp"
local M = {}
local utils = require "core.utils"
@ -19,7 +13,11 @@ M.on_attach = function(client, bufnr)
utils.load_mappings("lspconfig", { buffer = bufnr })
if client.server_capabilities.signatureHelpProvider then
require("nvchad_ui.signature").setup(client)
require("nvchad.signature").setup(client)
end
if not utils.load_config().ui.lsp_semantic_tokens and client.supports_method "textDocument/semanticTokens" then
client.server_capabilities.semanticTokensProvider = nil
end
end
@ -43,7 +41,7 @@ M.capabilities.textDocument.completion.completionItem = {
},
}
lspconfig.sumneko_lua.setup {
require("lspconfig").lua_ls.setup {
on_attach = M.on_attach,
capabilities = M.capabilities,
@ -56,6 +54,8 @@ lspconfig.sumneko_lua.setup {
library = {
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
[vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types"] = true,
[vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
},
maxPreload = 100000,
preloadFileSize = 10000,

View File

@ -1,18 +1,3 @@
local present, mason = pcall(require, "mason")
if not present then
return
end
vim.api.nvim_create_augroup("_mason", { clear = true })
vim.api.nvim_create_autocmd("Filetype", {
pattern = "mason",
callback = function()
require("base46").load_highlight "mason"
end,
group = "_mason",
})
local options = {
ensure_installed = { "lua-language-server" }, -- not an option from mason.nvim
@ -21,8 +6,8 @@ local options = {
ui = {
icons = {
package_pending = "",
package_installed = " ",
package_uninstalled = " ",
package_installed = "󰄳 ",
package_uninstalled = " 󰚌",
},
keymaps = {
@ -40,10 +25,4 @@ local options = {
max_concurrent_installers = 10,
}
options = require("core.utils").load_override(options, "williamboman/mason.nvim")
vim.api.nvim_create_user_command("MasonInstallAll", function()
vim.cmd("MasonInstall " .. table.concat(options.ensure_installed, " "))
end, {})
mason.setup(options)
return options

View File

@ -1,11 +1,3 @@
local present, nvimtree = pcall(require, "nvim-tree")
if not present then
return
end
require("base46").load_highlight "nvimtree"
local options = {
filters = {
dotfiles = false,
@ -13,20 +5,18 @@ local options = {
},
disable_netrw = true,
hijack_netrw = true,
open_on_setup = false,
ignore_ft_on_setup = { "alpha" },
hijack_cursor = true,
hijack_unnamed_buffer_when_opening = false,
update_cwd = true,
sync_root_with_cwd = true,
update_focused_file = {
enable = true,
update_cwd = false,
update_root = false,
},
view = {
adaptive_size = true,
adaptive_size = false,
side = "left",
width = 25,
hide_root_folder = true,
width = 30,
preserve_window_proportions = true,
},
git = {
enable = false,
@ -41,6 +31,7 @@ local options = {
},
},
renderer = {
root_folder_label = false,
highlight_git = false,
highlight_opened_files = "none",
@ -57,22 +48,22 @@ local options = {
},
glyphs = {
default = "",
default = "󰈚",
symlink = "",
folder = {
default = "",
empty = "",
empty_open = "",
open = "",
symlink = "",
symlink_open = "",
default = "",
empty = "",
empty_open = "",
open = "",
symlink = "",
symlink_open = "",
arrow_open = "",
arrow_closed = "",
},
git = {
unstaged = "",
staged = "",
unmerged = "",
unmerged = "",
renamed = "",
untracked = "",
deleted = "",
@ -83,8 +74,4 @@ local options = {
},
}
-- check for any override
options = require("core.utils").load_override(options, "kyazdani42/nvim-tree.lua")
vim.g.nvimtree_side = options.view.side
nvimtree.setup(options)
return options

View File

@ -1,34 +0,0 @@
local present, nvterm = pcall(require, "nvterm")
if not present then
return
end
require "base46.term"
local options = {
terminals = {
list = {},
type_opts = {
float = {
relative = "editor",
row = 0.3,
col = 0.25,
width = 0.5,
height = 0.4,
border = "single",
},
horizontal = { location = "rightbelow", split_ratio = 0.3 },
vertical = { location = "rightbelow", split_ratio = 0.5 },
},
},
behavior = {
close_on_exit = true,
auto_insert = true,
},
enable_new_mappings = true,
}
options = require("core.utils").load_override(options, "NvChad/nvterm")
nvterm.setup(options)

View File

@ -1,48 +1,18 @@
local M = {}
local load_override = require("core.utils").load_override
local utils = require "core.utils"
M.autopairs = function()
local present1, autopairs = pcall(require, "nvim-autopairs")
local present2, cmp = pcall(require, "cmp")
if not (present1 and present2) then
return
end
local options = {
fast_wrap = {},
disable_filetype = { "TelescopePrompt", "vim" },
}
options = load_override(options, "windwp/nvim-autopairs")
autopairs.setup(options)
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end
M.blankline = function()
local present, blankline = pcall(require, "indent_blankline")
if not present then
return
end
require("base46").load_highlight "blankline"
local options = {
M.blankline = {
indentLine_enabled = 1,
filetype_exclude = {
"help",
"terminal",
"alpha",
"packer",
"lazy",
"lspinfo",
"TelescopePrompt",
"TelescopeResults",
"mason",
"nvdash",
"nvcheatsheet",
"",
},
buftype_exclude = { "terminal" },
@ -50,72 +20,22 @@ M.blankline = function()
show_first_indent_level = false,
show_current_context = true,
show_current_context_start = true,
}
}
options = load_override(options, "lukas-reineke/indent-blankline.nvim")
blankline.setup(options)
end
M.luasnip = function(opts)
require("luasnip").config.set_config(opts)
M.colorizer = function()
local present, colorizer = pcall(require, "colorizer")
if not present then
return
end
local options = {
filetypes = {
"*",
},
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
names = false, -- "Name" codes like Blue
RRGGBBAA = false, -- #RRGGBBAA hex codes
rgb_fn = false, -- CSS rgb() and rgba() functions
hsl_fn = false, -- CSS hsl() and hsla() functions
css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
mode = "background", -- Set the display mode.
},
}
options = load_override(options, "NvChad/nvim-colorizer.lua")
colorizer.setup(options)
-- execute colorizer as soon as possible
vim.defer_fn(function()
require("colorizer").attach_to_buffer(0)
end, 0)
end
M.comment = function()
local present, nvim_comment = pcall(require, "Comment")
if not present then
return
end
local options = {}
options = load_override(options, "numToStr/Comment.nvim")
nvim_comment.setup(options)
end
M.luasnip = function()
local present, luasnip = pcall(require, "luasnip")
if not present then
return
end
local options = {
history = true,
updateevents = "TextChanged,TextChangedI",
}
options = load_override(options, "L3MON4D3/LuaSnip")
luasnip.config.set_config(options)
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.luasnippets_path or "" }
-- vscode format
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" }
-- snipmate format
require("luasnip.loaders.from_snipmate").load()
require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" }
-- lua format
require("luasnip.loaders.from_lua").load()
require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" }
vim.api.nvim_create_autocmd("InsertLeave", {
callback = function()
@ -129,61 +49,18 @@ M.luasnip = function()
})
end
M.gitsigns = function()
local present, gitsigns = pcall(require, "gitsigns")
if not present then
return
end
require("base46").load_highlight "git"
local options = {
M.gitsigns = {
signs = {
add = { hl = "DiffAdd", text = "", numhl = "GitSignsAddNr" },
change = { hl = "DiffChange", text = "", numhl = "GitSignsChangeNr" },
delete = { hl = "DiffDelete", text = "", numhl = "GitSignsDeleteNr" },
topdelete = { hl = "DiffDelete", text = "", numhl = "GitSignsDeleteNr" },
changedelete = { hl = "DiffChangeDelete", text = "~", numhl = "GitSignsChangeNr" },
add = { text = "" },
change = { text = "" },
delete = { text = "󰍵" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},
on_attach = function (bufnr)
on_attach = function(bufnr)
utils.load_mappings("gitsigns", { buffer = bufnr })
end
}
options = load_override(options, "lewis6991/gitsigns.nvim")
gitsigns.setup(options)
end
M.devicons = function()
local present, devicons = pcall(require, "nvim-web-devicons")
if present then
require("base46").load_highlight "devicons"
local options = { override = require("nvchad_ui.icons").devicons }
options = require("core.utils").load_override(options, "kyazdani42/nvim-web-devicons")
devicons.setup(options)
end
end
M.packer_init = function()
return {
auto_clean = true,
compile_on_sync = true,
git = { clone_timeout = 6000 },
display = {
working_sym = "",
error_sym = "",
done_sym = "",
removed_sym = "",
moved_sym = "",
open_fn = function()
return require("packer.util").float { border = "single" }
end,
},
}
end
}
return M

View File

@ -1,13 +1,3 @@
local present, telescope = pcall(require, "telescope")
if not present then
return
end
vim.g.theme_switcher_loaded = true
require("base46").load_highlight "telescope"
local options = {
defaults = {
vimgrep_arguments = {
@ -62,13 +52,4 @@ local options = {
extensions_list = { "themes", "terms" },
}
-- check for any override
options = require("core.utils").load_override(options, "nvim-telescope/telescope.nvim")
telescope.setup(options)
-- load extensions
pcall(function()
for _, ext in ipairs(options.extensions_list) do
telescope.load_extension(ext)
end
end)
return options

View File

@ -1,27 +1,12 @@
local present, treesitter = pcall(require, "nvim-treesitter.configs")
if not present then
return
end
require("base46").load_highlight "treesitter"
local options = {
ensure_installed = {
"lua",
},
ensure_installed = { "lua" },
highlight = {
enable = true,
use_languagetree = true,
},
indent = {
enable = true,
},
indent = { enable = true },
}
-- check for any override
options = require("core.utils").load_override(options, "nvim-treesitter/nvim-treesitter")
treesitter.setup(options)
return options

View File

@ -1,41 +0,0 @@
local present, wk = pcall(require, "which-key")
if not present then
return
end
require("base46").load_highlight "whichkey"
local options = {
icons = {
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
separator = "", -- symbol used between a key and it's label
group = "+", -- symbol prepended to a group
},
popup_mappings = {
scroll_down = "<c-d>", -- binding to scroll down inside the popup
scroll_up = "<c-u>", -- binding to scroll up inside the popup
},
window = {
border = "none", -- none/single/double/shadow
},
layout = {
spacing = 6, -- spacing between columns
},
hidden = { "<silent>", "<cmd>", "<Cmd>", "<CR>", "call", "lua", "^:", "^ " },
triggers_blacklist = {
-- list of mode / prefixes that should never be hooked by WhichKey
i = { "j", "k" },
v = { "j", "k" },
},
}
options = require("core.utils").load_override(options, "folke/which-key.nvim")
wk.setup(options)

View File

@ -1,113 +1,144 @@
local plugins = {
-- All plugins have lazy=true by default,to load a plugin on startup just lazy=false
-- List of all default plugins & their definitions
local default_plugins = {
["nvim-lua/plenary.nvim"] = { module = "plenary" },
"nvim-lua/plenary.nvim",
["lewis6991/impatient.nvim"] = {},
["wbthomason/packer.nvim"] = {
cmd = require("core.lazy_load").packer_cmds,
config = function()
require "plugins"
{
"NvChad/base46",
branch = "v2.0",
build = function()
require("base46").load_all_highlights()
end,
},
["NvChad/extensions"] = { module = { "telescope", "nvchad" } },
["NvChad/base46"] = {
config = function()
local ok, base46 = pcall(require, "base46")
if ok then
base46.load_theme()
end
end,
{
"NvChad/ui",
branch = "v2.0",
lazy = false,
},
["NvChad/ui"] = {
after = "base46",
config = function()
local present, nvchad_ui = pcall(require, "nvchad_ui")
if present then
nvchad_ui.setup()
end
end,
},
["NvChad/nvterm"] = {
module = "nvterm",
config = function()
require "plugins.configs.nvterm"
end,
setup = function()
{
"NvChad/nvterm",
init = function()
require("core.utils").load_mappings "nvterm"
end,
},
["kyazdani42/nvim-web-devicons"] = {
after = "ui",
module = "nvim-web-devicons",
config = function()
require("plugins.configs.others").devicons()
config = function(_, opts)
require "base46.term"
require("nvterm").setup(opts)
end,
},
["lukas-reineke/indent-blankline.nvim"] = {
opt = true,
setup = function()
require("core.lazy_load").on_file_open "indent-blankline.nvim"
{
"NvChad/nvim-colorizer.lua",
init = function()
require("core.utils").lazy_load "nvim-colorizer.lua"
end,
config = function(_, opts)
require("colorizer").setup(opts)
-- execute colorizer as soon as possible
vim.defer_fn(function()
require("colorizer").attach_to_buffer(0)
end, 0)
end,
},
{
"nvim-tree/nvim-web-devicons",
opts = function()
return { override = require "nvchad.icons.devicons" }
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "devicons")
require("nvim-web-devicons").setup(opts)
end,
},
{
"lukas-reineke/indent-blankline.nvim",
version = "2.20.7",
init = function()
require("core.utils").lazy_load "indent-blankline.nvim"
end,
opts = function()
return require("plugins.configs.others").blankline
end,
config = function(_, opts)
require("core.utils").load_mappings "blankline"
end,
config = function()
require("plugins.configs.others").blankline()
dofile(vim.g.base46_cache .. "blankline")
require("indent_blankline").setup(opts)
end,
},
["NvChad/nvim-colorizer.lua"] = {
opt = true,
setup = function()
require("core.lazy_load").on_file_open "nvim-colorizer.lua"
{
"nvim-treesitter/nvim-treesitter",
init = function()
require("core.utils").lazy_load "nvim-treesitter"
end,
config = function()
require("plugins.configs.others").colorizer()
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
build = ":TSUpdate",
opts = function()
return require "plugins.configs.treesitter"
end,
},
["nvim-treesitter/nvim-treesitter"] = {
module = "nvim-treesitter",
setup = function()
require("core.lazy_load").on_file_open "nvim-treesitter"
end,
cmd = require("core.lazy_load").treesitter_cmds,
run = ":TSUpdate",
config = function()
require "plugins.configs.treesitter"
config = function(_, opts)
dofile(vim.g.base46_cache .. "syntax")
require("nvim-treesitter.configs").setup(opts)
end,
},
-- git stuff
["lewis6991/gitsigns.nvim"] = {
ft = "gitcommit",
setup = function()
require("core.lazy_load").gitsigns()
{
"lewis6991/gitsigns.nvim",
ft = { "gitcommit", "diff" },
init = function()
-- load gitsigns only when a git file is opened
vim.api.nvim_create_autocmd({ "BufRead" }, {
group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
callback = function()
vim.fn.system("git -C " .. '"' .. vim.fn.expand "%:p:h" .. '"' .. " rev-parse")
if vim.v.shell_error == 0 then
vim.api.nvim_del_augroup_by_name "GitSignsLazyLoad"
vim.schedule(function()
require("lazy").load { plugins = { "gitsigns.nvim" } }
end)
end
end,
config = function()
require("plugins.configs.others").gitsigns()
})
end,
opts = function()
return require("plugins.configs.others").gitsigns
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "git")
require("gitsigns").setup(opts)
end,
},
-- lsp stuff
["williamboman/mason.nvim"] = {
cmd = require("core.lazy_load").mason_cmds,
config = function()
require "plugins.configs.mason"
{
"williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
opts = function()
return require "plugins.configs.mason"
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "mason")
require("mason").setup(opts)
-- custom nvchad cmd to install all mason binaries listed
vim.api.nvim_create_user_command("MasonInstallAll", function()
vim.cmd("MasonInstall " .. table.concat(opts.ensure_installed, " "))
end, {})
vim.g.mason_binaries_list = opts.ensure_installed
end,
},
["neovim/nvim-lspconfig"] = {
opt = true,
setup = function()
require("core.lazy_load").on_file_open "nvim-lspconfig"
{
"neovim/nvim-lspconfig",
init = function()
require("core.utils").lazy_load "nvim-lspconfig"
end,
config = function()
require "plugins.configs.lspconfig"
@ -115,109 +146,127 @@ local plugins = {
},
-- load luasnips + cmp related in insert mode only
["rafamadriz/friendly-snippets"] = {
module = { "cmp", "cmp_nvim_lsp" },
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
},
["hrsh7th/nvim-cmp"] = {
after = "friendly-snippets",
config = function()
require "plugins.configs.cmp"
dependencies = {
{
-- snippet plugin
"L3MON4D3/LuaSnip",
dependencies = "rafamadriz/friendly-snippets",
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
config = function(_, opts)
require("plugins.configs.others").luasnip(opts)
end,
},
["L3MON4D3/LuaSnip"] = {
wants = "friendly-snippets",
after = "nvim-cmp",
config = function()
require("plugins.configs.others").luasnip()
-- autopairing of (){}[] etc
{
"windwp/nvim-autopairs",
opts = {
fast_wrap = {},
disable_filetype = { "TelescopePrompt", "vim" },
},
config = function(_, opts)
require("nvim-autopairs").setup(opts)
-- setup cmp for autopairs
local cmp_autopairs = require "nvim-autopairs.completion.cmp"
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
},
["saadparwaiz1/cmp_luasnip"] = { after = "LuaSnip" },
["hrsh7th/cmp-nvim-lua"] = { after = "cmp_luasnip" },
["hrsh7th/cmp-nvim-lsp"] = { after = "cmp-nvim-lua" },
["hrsh7th/cmp-buffer"] = { after = "cmp-nvim-lsp" },
["hrsh7th/cmp-path"] = { after = "cmp-buffer" },
-- misc plugins
["windwp/nvim-autopairs"] = {
after = "nvim-cmp",
config = function()
require("plugins.configs.others").autopairs()
-- cmp sources plugins
{
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
},
},
opts = function()
return require "plugins.configs.cmp"
end,
config = function(_, opts)
require("cmp").setup(opts)
end,
},
["goolord/alpha-nvim"] = {
after = "base46",
disable = true,
config = function()
require "plugins.configs.alpha"
end,
{
"numToStr/Comment.nvim",
keys = {
{ "gcc", mode = "n", desc = "Comment toggle current line" },
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
{ "gc", mode = "x", desc = "Comment toggle linewise (visual)" },
{ "gbc", mode = "n", desc = "Comment toggle current block" },
{ "gb", mode = { "n", "o" }, desc = "Comment toggle blockwise" },
{ "gb", mode = "x", desc = "Comment toggle blockwise (visual)" },
},
["numToStr/Comment.nvim"] = {
module = "Comment",
keys = { "gc", "gb" },
config = function()
require("plugins.configs.others").comment()
end,
setup = function()
init = function()
require("core.utils").load_mappings "comment"
end,
config = function(_, opts)
require("Comment").setup(opts)
end,
},
-- file managing , picker etc
["kyazdani42/nvim-tree.lua"] = {
ft = "alpha",
{
"nvim-tree/nvim-tree.lua",
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
config = function()
require "plugins.configs.nvimtree"
end,
setup = function()
init = function()
require("core.utils").load_mappings "nvimtree"
end,
opts = function()
return require "plugins.configs.nvimtree"
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "nvimtree")
require("nvim-tree").setup(opts)
end,
},
["nvim-telescope/telescope.nvim"] = {
{
"nvim-telescope/telescope.nvim",
dependencies = "nvim-treesitter/nvim-treesitter",
cmd = "Telescope",
config = function()
require "plugins.configs.telescope"
end,
setup = function()
init = function()
require("core.utils").load_mappings "telescope"
end,
opts = function()
return require "plugins.configs.telescope"
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "telescope")
local telescope = require "telescope"
telescope.setup(opts)
-- load extensions
for _, ext in ipairs(opts.extensions_list) do
telescope.load_extension(ext)
end
end,
},
-- Only load whichkey after all the gui
["folke/which-key.nvim"] = {
disable = true,
module = "which-key",
keys = { "<leader>", '"', "'", "`" },
config = function()
require "plugins.configs.whichkey"
end,
setup = function()
{
"folke/which-key.nvim",
keys = { "<leader>", '"', "'", "`", "c", "v", "g" },
init = function()
require("core.utils").load_mappings "whichkey"
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "whichkey")
require("which-key").setup(opts)
end,
},
}
-- Load all plugins
local present, packer = pcall(require, "packer")
local config = require("core.utils").load_config()
if present then
vim.cmd "packadd packer.nvim"
-- Override with default plugins with user ones
plugins = require("core.utils").merge_plugins(plugins)
-- load packer init options
local init_options = require("plugins.configs.others").packer_init()
init_options = require("core.utils").load_override(init_options, "wbthomason/packer.nvim")
packer.init(init_options)
packer.startup { plugins }
if #config.plugins > 0 then
table.insert(default_plugins, { import = config.plugins })
end
require("lazy").setup(default_plugins, config.lazy_nvim)