Compare commits

...

109 commits

Author SHA1 Message Date
siduck 215aa2bb2f Revert "rm useless luasnip calls"
This reverts commit de85977316.
2023-09-11 14:47:45 +05:30
Zohir Benghalem 617dca4dc1
add fzf telescope extension to improve sorting performance (#2371)
* add fzf telescope extension to improve sorting performance

* add fzf config tbl to the default tlsc config
2023-09-09 06:43:28 +05:30
siduck de85977316 rm useless luasnip calls 2023-09-08 06:11:49 +05:30
siduck 456ae88fad include MasonUpdate cmd for mason.nvim lazyloading
5344b81e5e , so we dont need to specifically load mason in updater
2023-09-07 21:32:07 +05:30
camel_case a69e8dc591
feat(lsp): add visual mode code actions (#2353) 2023-09-02 17:00:02 +05:30
Diogo Silva a9bc954d02
refactor: gen chadrc template (#2349) 2023-08-31 05:58:07 +05:30
siduck 3f1e6d71d4 make whichkey lazyloadable by its cmd | fix #2342 2023-08-27 11:28:56 +05:30
Paul 9c013a6aac
updated lazygit keys for which-key plugin (#2331) 2023-08-24 16:26:22 +05:30
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
19 changed files with 411 additions and 418 deletions

75
.github/README.md vendored
View file

@ -1,27 +1,21 @@
<h1 align="center">NvChad</h1>
<div align="center">
<a href="https://nvchad.github.io/">Home</a>
<a href="https://nvchad.com/">Home</a>
<span></span>
<a href="https://nvchad.github.io/quickstart/install">Install</a>
<a href="https://nvchad.com/docs/quickstart/install">Install</a>
<span></span>
<a href="https://nvchad.github.io/contribute">Contribute</a>
<a href="https://nvchad.com/docs/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>
<a href="https://nvchad.com/docs/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)
[![Neovim Minimum Version](https://img.shields.io/badge/Neovim-0.9.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)
@ -31,13 +25,11 @@
## 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">
<img src="https://nvchad.com/features/nvdash.webp">
<img src="https://nvchad.com/banner.webp">
( 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">
<img src="https://nvchad.com/screenshots/onedark.webp">
<img src="https://nvchad.com/screenshots/rxyhn1.webp">
## What is it?
@ -45,18 +37,19 @@
- 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)
- NvChad isn't a framework! It's supposed to be used as a "base" config, so users can tweak the defaults well, and also remove the things they don't 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 up-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)
![4 themes](https://nvchad.com/screenshots/four_Themes.webp)
![radium 1](https://nvchad.com/screenshots/radium1.webp)
![radium 2](https://nvchad.com/screenshots/radium2.webp)
![radium 3](https://nvchad.com/screenshots/radium3.webp)
(Note: these are just 4-5 themes, NvChad has around 27+ themes)
(Note: these are just 4-5 themes, NvChad has around 56 themes)
</details>
## UI related plugins used
@ -67,53 +60,37 @@
Fast file tree:
<kbd><img src="https://github.com/NvChad/nvchad.github.io/blob/src/static/img/features/nvimtree.png"></kbd><hr>
<kbd><img src="https://nvchad.com/features/nvimtree.webp"></kbd>
<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>
<kbd><img src="https://nvchad.com/features/telescope.webp"></kbd>
<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>
<kbd><img src="https://nvchad.com/features/statuslines.webp"></kbd>
<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>
<kbd><img src="https://nvchad.com/features/tabufline.webp"></kbd>
- Here's a [video](https://www.youtube.com/watch?v=V_9iJ96U_k8&ab_channel=siduck) that showcases it.
<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
<h3> NvCheatsheet ( our UI Plugin ) </h3>
<kbd> <img src="https://nvchad.com/features/nvcheatsheet.webp"/></kbd>
</details>
## Plugins list
- Many beautiful themes, theme toggler by [our base46 plugin](https://github.com/NvChad/base46)
- 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)
- Lightweight & performant ui plugin with [NvChad UI](https://github.com/NvChad/ui) It provides statusline modules, tabufline ( tabs + buffer manager) , beautiful cheatsheets and much more!
- 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)
@ -133,7 +110,7 @@ NeoVim Treesitter configurations and abstraction layer. We mostly use this for s
## :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.
If you like NvChad and would like to support & appreciate it via donation then I'll gladly accept it.
[![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)

2
.gitignore vendored
View file

@ -2,6 +2,8 @@ plugin
custom
spell
ftplugin
syntax
coc-settings.json
.luarc.json
lazy-lock.json
after

1
.ignore Normal file
View file

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

View file

@ -1,5 +1,4 @@
require "core"
require "core.options"
local custom_init_path = vim.api.nvim_get_runtime_file("lua/custom/init.lua", false)[1]
@ -17,7 +16,6 @@ if not vim.loop.fs_stat(lazypath) then
require("core.bootstrap").lazy(lazypath)
end
dofile(vim.g.base46_cache .. "defaults")
vim.opt.rtp:prepend(lazypath)
require "plugins"
dofile(vim.g.base46_cache .. "defaults")

View file

@ -1,55 +1,60 @@
local M = {}
local fn = vim.fn
M.echo = function(str)
vim.cmd "redraw"
vim.api.nvim_echo({ { str, "Bold" } }, true, {})
end
local function shell_call(args)
local output = 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)
print "Bootstrapping lazy.nvim .."
------------- base46 ---------------
local lazy_path = fn.stdpath "data" .. "/lazy/base46"
vim.fn.system {
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
install_path,
}
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 + compile their configs
-- install plugins
require "plugins"
require("lazy").load { plugins = { "nvim-treesitter" } }
-- install binaries from mason.nvim & tsparsers on LazySync
vim.schedule(function()
vim.cmd "silent! MasonInstallAll"
-- print success message
end, 0)
-- 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 input = vim.fn.input "Do you want to install chadrc template? (y/n) : "
vim.cmd "redraw|echo ''"
local path = fn.stdpath "config" .. "/lua/custom"
if input == "y" then
-- clone example_config repo
print "cloning chadrc starter template repo...."
if fn.isdirectory(path) ~= 1 then
local input = fn.input "Do you want to install example custom config? (y/N): "
vim.fn.system {
"git",
"clone",
"--depth",
"1",
"-b",
"v2.0",
"https://github.com/NvChad/example_config",
vim.fn.stdpath "config" .. "/lua/custom",
}
vim.cmd "redraw|echo ''"
if input:lower() == "y" then
M.echo "Cloning example custom config repo..."
shell_call { "git", "clone", "--depth", "1", "https://github.com/NvChad/example_config", path }
fn.delete(path .. "/.git", "rf")
else
-- use very minimal chadrc
fn.mkdir(path, "p")
-- delete .git from that repo
vim.loop.fs_rmdir(vim.fn.stdpath "config" .. "/lua/custom/.git")
vim.notify "successfully installed chadrc template!"
vim.cmd "redraw|echo ''"
local file = io.open(path .. "/chadrc.lua", "w")
if file then
file:write "---@type ChadrcConfig\nlocal M = {}\n\nM.ui = { theme = 'onedark' }\n\nreturn M"
file:close()
end
end
end
end

View file

@ -1,12 +1,7 @@
-- Chadrc overrides this file
local M = {}
M.options = {
nvChad = {
update_url = "https://github.com/NvChad/NvChad",
update_branch = "v2.0",
},
nvchad_branch = "v2.0",
}
M.ui = {
@ -18,6 +13,10 @@ 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 = {
@ -28,6 +27,8 @@ M.ui = {
selected_item_bg = "colored", -- colored / simple
},
telescope = { style = "borderless" }, -- borderless / bordered
------------------------------- nvchad_ui modules -----------------------------
statusline = {
theme = "default", -- default/vscode/vscode_colored/minimal
@ -39,6 +40,8 @@ M.ui = {
-- lazyload it when there are 1+ buffers
tabufline = {
show_numbers = false,
enabled = true,
lazyload = true,
overriden_modules = nil,
},
@ -61,23 +64,29 @@ M.ui = {
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 b m", "Telescope marks" },
{ " Themes", "Spc t f", "Telescope themes" },
{ "󰈚 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
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 = "" -- path i.e "custom.plugins" -> custom/plugins.lua only and not custom/plugins/init.lua!!!!
M.plugins = "" -- path i.e "custom.plugins", so make custom/plugins.lua file
M.lazy_nvim = {} -- config for lazy.nvim startup options
M.lazy_nvim = require "plugins.configs.lazy_nvim" -- config for lazy.nvim startup options
-- these are default mappings, 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
local new_cmd = vim.api.nvim_create_user_command
new_cmd("NvChadUpdate", function()
require("nvchad").update_nvchad()
end, {})
-- autocmds
-------------------------------------- autocmds ------------------------------------------
local autocmd = vim.api.nvim_create_autocmd
-- dont list quickfix buffers
@ -19,37 +71,45 @@ autocmd("FileType", {
end,
})
local sep = vim.loop.os_uname().sysname:find "windows" and "\\" or "/"
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = vim.fn.glob(
table.concat({
vim.fn.stdpath "config",
"lua",
"custom",
"**",
"*.lua",
}, sep),
true,
true,
true
),
-- 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"
local file = string
.gsub(vim.fn.fnamemodify(opts.file, ":r"), vim.fn.stdpath "config" .. sep .. "lua" .. sep, "")
:gsub(sep, ".")
require("plenary.reload").reload_module(file)
require("plenary.reload").reload_module(module)
require("plenary.reload").reload_module "custom.chadrc"
local config = require("core.utils").load_config().ui
config = require("core.utils").load_config()
vim.opt.statusline = "%!v:lua.require('nvchad_ui.statusline." .. config.statusline.theme .. "').run()"
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 +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"', "move up", opts = { expr = true } },
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "move down", 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"', "move left", opts = { expr = true } },
["k"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', "move down", 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>', "dont copy replaced text", 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,121 @@ 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"] = {
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",
},
},
v = {
["<leader>ca"] = {
function()
vim.lsp.buf.code_action()
end,
"LSP code action",
},
},
}
@ -262,10 +256,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 +268,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 +299,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 +323,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 +365,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 +394,7 @@ M.blankline = {
end
end,
"Jump to current_context",
"Jump to current context",
},
},
}

View file

@ -1,55 +0,0 @@
local opt = vim.opt
local g = vim.g
local config = require("core.utils").load_config()
g.nvchad_theme = config.ui.theme
g.base46_cache = vim.fn.stdpath "cache" .. "/nvchad/base46/"
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
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

View file

@ -10,9 +10,9 @@ M.load_config = function()
config.mappings = M.remove_disabled_keys(chadrc.mappings, config.mappings)
config = merge_tb("force", config, chadrc)
config.mappings.disabled = nil
end
config.mappings.disabled = nil
return config
end
@ -52,37 +52,39 @@ M.remove_disabled_keys = function(chadrc_mappings, default_mappings)
end
M.load_mappings = function(section, mapping_opt)
local function set_section_map(section_values)
if section_values.plugin then
return
end
vim.schedule(function()
local function set_section_map(section_values)
if section_values.plugin then
return
end
section_values.plugin = nil
section_values.plugin = nil
for mode, mode_values in pairs(section_values) do
local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {})
for keybind, mapping_info in pairs(mode_values) do
-- merge default + user opts
local opts = merge_tb("force", default_opts, mapping_info.opts or {})
for mode, mode_values in pairs(section_values) do
local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {})
for keybind, mapping_info in pairs(mode_values) do
-- merge default + user opts
local opts = merge_tb("force", default_opts, mapping_info.opts or {})
mapping_info.opts, opts.mode = nil, nil
opts.desc = mapping_info[2]
mapping_info.opts, opts.mode = nil, nil
opts.desc = mapping_info[2]
vim.keymap.set(mode, keybind, mapping_info[1], opts)
vim.keymap.set(mode, keybind, mapping_info[1], opts)
end
end
end
end
local mappings = require("core.utils").load_config().mappings
local mappings = require("core.utils").load_config().mappings
if type(section) == "string" then
mappings[section]["plugin"] = nil
mappings = { mappings[section] }
end
if type(section) == "string" then
mappings[section]["plugin"] = nil
mappings = { mappings[section] }
end
for _, sect in pairs(mappings) do
set_section_map(sect)
end
for _, sect in pairs(mappings) do
set_section_map(sect)
end
end)
end
M.lazy_load = function(plugin)

View file

@ -15,7 +15,7 @@ local formatting_style = {
fields = field_arrangement[cmp_style] or { "abbr", "kind", "menu" },
format = function(_, item)
local icons = require("nvchad_ui.icons").lspkind
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
@ -76,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
@ -105,8 +105,8 @@ local options = {
}),
},
sources = {
{ name = "luasnip" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "path" },

View file

@ -5,7 +5,7 @@ return {
ui = {
icons = {
ft = "",
lazy = " ",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},

View file

@ -1,5 +1,5 @@
dofile(vim.g.base46_cache .. "lsp")
require "nvchad_ui.lsp"
require "nvchad.lsp"
local M = {}
local utils = require "core.utils"
@ -13,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
@ -50,7 +54,7 @@ require("lspconfig").lua_ls.setup {
library = {
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
[vim.fn.stdpath "data" .. "/lazy/extensions/nvchad_types"] = true,
[vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types"] = true,
[vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy"] = true,
},
maxPreload = 100000,

View file

@ -6,8 +6,8 @@ local options = {
ui = {
icons = {
package_pending = "",
package_installed = " ",
package_uninstalled = " ",
package_installed = "󰄳 ",
package_uninstalled = " 󰚌",
},
keymaps = {

View file

@ -16,7 +16,7 @@ local options = {
adaptive_size = false,
side = "left",
width = 30,
hide_root_folder = true,
preserve_window_proportions = true,
},
git = {
enable = false,
@ -31,6 +31,7 @@ local options = {
},
},
renderer = {
root_folder_label = false,
highlight_git = false,
highlight_opened_files = "none",
@ -47,15 +48,15 @@ local options = {
},
glyphs = {
default = "",
default = "󰈚",
symlink = "",
folder = {
default = "",
empty = "",
empty_open = "",
default = "",
empty = "",
empty_open = "",
open = "",
symlink = "",
symlink_open = "",
symlink = "",
symlink_open = "",
arrow_open = "",
arrow_closed = "",
},
@ -73,6 +74,4 @@ local options = {
},
}
vim.g.nvimtree_side = options.view.side
return options

View file

@ -11,6 +11,8 @@ M.blankline = {
"TelescopePrompt",
"TelescopeResults",
"mason",
"nvdash",
"nvcheatsheet",
"",
},
buftype_exclude = { "terminal" },
@ -20,16 +22,20 @@ M.blankline = {
show_current_context_start = true,
}
M.luasnip = function()
local options = {
history = true,
updateevents = "TextChanged,TextChangedI",
}
M.luasnip = function(opts)
require("luasnip").config.set_config(opts)
require("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()
@ -45,12 +51,12 @@ end
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" },
untracked = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
add = { text = "" },
change = { text = "" },
delete = { text = "󰍵" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},
on_attach = function(bufnr)
utils.load_mappings("gitsigns", { buffer = bufnr })

View file

@ -49,7 +49,15 @@ local options = {
},
},
extensions_list = { "themes", "terms" },
extensions_list = { "themes", "terms", "fzf" },
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = "smart_case",
},
},
}
return options

View file

@ -1,31 +0,0 @@
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" },
},
}
return options

View file

@ -4,9 +4,6 @@ local default_plugins = {
"nvim-lua/plenary.nvim",
-- nvchad plugins
{ "NvChad/extensions", branch = "v2.0" },
{
"NvChad/base46",
branch = "v2.0",
@ -19,14 +16,13 @@ local default_plugins = {
"NvChad/ui",
branch = "v2.0",
lazy = false,
config = function()
require "nvchad_ui"
end,
},
{
"NvChad/nvterm",
init = require("core.utils").load_mappings "nvterm",
init = function()
require("core.utils").load_mappings "nvterm"
end,
config = function(_, opts)
require "base46.term"
require("nvterm").setup(opts)
@ -35,7 +31,9 @@ local default_plugins = {
{
"NvChad/nvim-colorizer.lua",
init = require("core.utils").lazy_load "nvim-colorizer.lua",
init = function()
require("core.utils").lazy_load "nvim-colorizer.lua"
end,
config = function(_, opts)
require("colorizer").setup(opts)
@ -49,7 +47,7 @@ local default_plugins = {
{
"nvim-tree/nvim-web-devicons",
opts = function()
return { override = require("nvchad_ui.icons").devicons }
return { override = require "nvchad.icons.devicons" }
end,
config = function(_, opts)
dofile(vim.g.base46_cache .. "devicons")
@ -59,6 +57,7 @@ local default_plugins = {
{
"lukas-reineke/indent-blankline.nvim",
version = "2.20.7",
init = function()
require("core.utils").lazy_load "indent-blankline.nvim"
end,
@ -74,7 +73,9 @@ local default_plugins = {
{
"nvim-treesitter/nvim-treesitter",
init = require("core.utils").lazy_load "nvim-treesitter",
init = function()
require("core.utils").lazy_load "nvim-treesitter"
end,
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
build = ":TSUpdate",
opts = function()
@ -89,17 +90,17 @@ local default_plugins = {
-- git stuff
{
"lewis6991/gitsigns.nvim",
ft = "gitcommit",
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")
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" }
require("lazy").load { plugins = { "gitsigns.nvim" } }
end)
end
end,
@ -117,7 +118,7 @@ local default_plugins = {
-- lsp stuff
{
"williamboman/mason.nvim",
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" },
opts = function()
return require "plugins.configs.mason"
end,
@ -129,12 +130,16 @@ local default_plugins = {
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",
init = require("core.utils").lazy_load "nvim-lspconfig",
init = function()
require("core.utils").lazy_load "nvim-lspconfig"
end,
config = function()
require "plugins.configs.lspconfig"
end,
@ -149,8 +154,9 @@ local default_plugins = {
-- snippet plugin
"L3MON4D3/LuaSnip",
dependencies = "rafamadriz/friendly-snippets",
config = function()
require("plugins.configs.others").luasnip()
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
config = function(_, opts)
require("plugins.configs.others").luasnip(opts)
end,
},
@ -179,7 +185,6 @@ local default_plugins = {
"hrsh7th/cmp-path",
},
},
opts = function()
return require "plugins.configs.cmp"
end,
@ -190,10 +195,19 @@ local default_plugins = {
{
"numToStr/Comment.nvim",
-- keys = { "gc", "gb" },
init = require("core.utils").load_mappings "comment",
config = function()
require("Comment").setup()
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)" },
},
init = function()
require("core.utils").load_mappings "comment"
end,
config = function(_, opts)
require("Comment").setup(opts)
end,
},
@ -201,7 +215,9 @@ local default_plugins = {
{
"nvim-tree/nvim-tree.lua",
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
init = require("core.utils").load_mappings "nvimtree",
init = function()
require("core.utils").load_mappings "nvimtree"
end,
opts = function()
return require "plugins.configs.nvimtree"
end,
@ -213,13 +229,14 @@ local default_plugins = {
{
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" } },
cmd = "Telescope",
init = require("core.utils").load_mappings "telescope",
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"
@ -235,12 +252,11 @@ local default_plugins = {
-- Only load whichkey after all the gui
{
"folke/which-key.nvim",
enabled = false,
keys = { "<leader>", '"', "'", "`" },
init = require("core.utils").load_mappings "whichkey",
opts = function()
return require "plugins.configs.whichkey"
keys = { "<leader>", "<c-r>", '"', "'", "`", "c", "v", "g" },
init = function()
require("core.utils").load_mappings "whichkey"
end,
cmd = "WhichKey",
config = function(_, opts)
dofile(vim.g.base46_cache .. "whichkey")
require("which-key").setup(opts)
@ -254,7 +270,4 @@ if #config.plugins > 0 then
table.insert(default_plugins, { import = config.plugins })
end
-- lazy_nvim startup opts
local lazy_config = vim.tbl_deep_extend("force", require "plugins.configs.lazy_nvim", config.lazy_nvim)
require("lazy").setup(default_plugins, lazy_config)
require("lazy").setup(default_plugins, config.lazy_nvim)