Compare commits
170 Commits
Author | SHA1 | Date |
---|---|---|
antifallobst | 4ae95c9772 | |
antifallobst | b97577b370 | |
antifallobst | f3b9a3c9a9 | |
siduck | d3d9aa251a | |
siduck | 46a61073a8 | |
siduck | 8ea74bc23b | |
siduck | 487ca44566 | |
Paul | 05f581918a | |
siduck | 6766acefec | |
siduck | 0e27cb4b44 | |
siduck | 682b023fb3 | |
A.S.K | f18488d41c | |
N | 720d71b546 | |
siduck | 08f3deb901 | |
James Wright | 3500e7388d | |
M | 83aac1ecc0 | |
siduck | 10b668d98a | |
georgejean | 286c951d7b | |
georgejean | 4aa283119a | |
georgejean | 212bb9a66f | |
Max Chechel | 11c839f870 | |
Simone Fidanza | d3433e3c55 | |
siduck | 8ba64ff369 | |
Zhong Jianxin | e3bb39106e | |
anes | a18d92dfa6 | |
siduck | d73d155287 | |
Sidhanth Rathod | 27992efc1c | |
Sidhanth Rathod | 1d26f9dc50 | |
Zhong Jianxin | c2a0bb1684 | |
André Jesus | c3c349c830 | |
siduck | f8a489ea1a | |
georgejean | d72d935b35 | |
Martin Braun | 9c10201ef3 | |
Fiete Börner | 582dff9458 | |
siduck | 262a06776a | |
siduck | f6229b4b46 | |
siduck | 1cb237fa78 | |
siduck | c8a1aa2e2b | |
André Carneiro | a54e4e9272 | |
Tirtharaj Pramanik | 914f9a400e | |
Lexey Khom | 699aeaa442 | |
siduck | e1631629b9 | |
siduck | 3dd0fa6c5b | |
siduck | 03f93e5d75 | |
Mateus Abelli | b51065b1a8 | |
siduck | 907684efa0 | |
siduck | 56e6234363 | |
siduck | cff182ce4b | |
siduck | fdb3ddb806 | |
siduck | 7914da7cd3 | |
siduck | 12f26e91ef | |
siduck | 34bdca17d2 | |
siduck | af123eee4d | |
siduck | f873d3cc50 | |
Shubham K | b5cf9fde0e | |
siduck | 907b112514 | |
prometheusalpha | 3479853e69 | |
hoangnh280 | 0619ef4e1e | |
siduck | 1754a23e65 | |
Ashish | 4d45597468 | |
siduck | a5906e48fb | |
waneon | 8ec2cb3b76 | |
Daniel Boll | 800d066aab | |
siduck | ffdb4fc5e5 | |
siduck | c77c086365 | |
Daniel Boll | 55de4b9c85 | |
siduck | d7f91016a8 | |
siduck | 79805b7fea | |
siduck | 609000db5b | |
siduck | ed03799697 | |
siduck | 432b2c1cf1 | |
siduck | 0678b329dc | |
siduck | 59cee93fce | |
siduck | 7ec4515179 | |
siduck | 84bdc2335c | |
siduck | effec96b53 | |
siduck | 208c31f2ba | |
siduck | d1d25231cd | |
Diogo-ss | edb80f4e0c | |
Pham Huy Hoang | 8214d4e858 | |
Lucario387 | 3353abb499 | |
Lucario387 | 3563b5af83 | |
siduck | 9dcaefd73f | |
Lucario387 | a5833730d7 | |
siduck | bb87d70fd6 | |
siduck | b2aa30b5ae | |
siduck | 7830f0334f | |
siduck | 8eaa3666dd | |
siduck | caeec36191 | |
Bruno Krugel | 9ae789b332 | |
Sidhanth Rathod | 521e6f872f | |
Sidhanth Rathod | 11f30badfa | |
siduck | 1e056a7eb4 | |
siduck | 08faf1d05a | |
Sidhanth Rathod | c205f67912 | |
siduck | 609b5450d5 | |
siduck | 5842684087 | |
Sidhanth Rathod | 612561a195 | |
siduck | 9ed851000d | |
siduck | acfc5626ac | |
siduck | 1dd3bf5a18 | |
siduck | dab9171e64 | |
siduck | 1d04d70417 | |
siduck | 0aafb002b5 | |
siduck | a3ea8a9f4d | |
siduck | 3384f81639 | |
siduck | 27455fd2c2 | |
Lucario387 | 09001369f3 | |
siduck | 10ba0e7a5a | |
siduck | a6b9c0cae5 | |
siduck | a2690a4b72 | |
siduck | 7b3aefee53 | |
siduck | 6590372791 | |
siduck | 5246faa09a | |
siduck | e8e7ed6144 | |
ariefra | 7daf171948 | |
neo-f | 8501cc01e1 | |
siduck | 205802b49f | |
siduck | 2ee1ada911 | |
siduck | 4990b23935 | |
siduck | 947186b7ec | |
siduck | 6910a4435d | |
siduck | 86bb1413e4 | |
siduck | 2b94bb92e0 | |
anosillus | ff93c22e63 | |
siduck | ed71dba5cc | |
siduck | c2946844f9 | |
siduck | 7303bb2990 | |
siduck | 7cd80a35c6 | |
siduck | 4378cb9532 | |
siduck | dc4674cad4 | |
siduck | 1b8eff7516 | |
Pham Huy Hoang | 5db2f0978d | |
Pham Huy Hoang | ae68290e1f | |
siduck | ddeba3c01b | |
siduck | 54280a3e2a | |
Lucario387 | a2540ef183 | |
siduck | 9bd303feee | |
siduck | 4c3eafbc20 | |
siduck | 8babf12991 | |
Sidhanth Rathod | bdd142dbd6 | |
Matt | 78b2cc3106 | |
SHA-5010 | 40c180d3b2 | |
siduck | 5ea340171c | |
siduck | 77a6c22fca | |
siduck | 8db69224ba | |
siduck | d1e6b664e1 | |
siduck | c55dea9593 | |
siduck | 1a4936ab26 | |
siduck | 32b111b8e2 | |
siduck | 40130ce741 | |
siduck | ce9388d13d | |
siduck | 4f789d3406 | |
siduck | 8f92334c57 | |
siduck | d27e6a2b9d | |
siduck | b266f066af | |
siduck | d27029d1b1 | |
siduck | c16c22e87b | |
siduck | 3616f417e7 | |
siduck | 76f0c9bc6f | |
siduck | 770e07f77c | |
siduck | a894ced767 | |
siduck | f77d052d70 | |
siduck | 08453985ca | |
siduck | 936131c00a | |
siduck | d142ac899a | |
siduck | 99f6b2132e | |
siduck | 4971e07f6a | |
siduck | cdbdd66929 | |
siduck | 4db58e4975 |
|
@ -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)
|
|
|
@ -1,3 +0,0 @@
|
||||||
patreon: siduck
|
|
||||||
ko_fi: siduck
|
|
||||||
custom: ["https://www.buymeacoffee.com/siduck", "https://www.paypal.com/paypalme/siduck76"]
|
|
|
@ -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.
|
|
|
@ -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."
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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.
|
|
|
@ -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
|
|
|
@ -1,6 +1,9 @@
|
||||||
plugin
|
plugin
|
||||||
custom
|
|
||||||
spell
|
spell
|
||||||
ftplugin
|
ftplugin
|
||||||
|
syntax
|
||||||
coc-settings.json
|
coc-settings.json
|
||||||
.luarc.json
|
.luarc.json
|
||||||
|
lazy-lock.json
|
||||||
|
after
|
||||||
|
.github
|
||||||
|
|
43
init.lua
43
init.lua
|
@ -1,34 +1,21 @@
|
||||||
vim.defer_fn(function()
|
|
||||||
pcall(require, "impatient")
|
|
||||||
end, 0)
|
|
||||||
|
|
||||||
require "core"
|
require "core"
|
||||||
require "core.options"
|
|
||||||
|
|
||||||
-- setup packer + plugins
|
local custom_init_path = vim.api.nvim_get_runtime_file("lua/custom/init.lua", false)[1]
|
||||||
local fn = vim.fn
|
|
||||||
local install_path = fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim"
|
|
||||||
|
|
||||||
if fn.empty(fn.glob(install_path)) > 0 then
|
if custom_init_path then
|
||||||
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#1e222a" })
|
dofile(custom_init_path)
|
||||||
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,
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
pcall(require, "custom")
|
|
||||||
|
|
||||||
require("core.utils").load_mappings()
|
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"
|
||||||
|
|
|
@ -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
|
|
@ -1,15 +1,11 @@
|
||||||
-- Chadrc overrides this file
|
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.options = {
|
M.options = {
|
||||||
nvChad = {
|
nvchad_branch = "v2.0",
|
||||||
update_url = "https://github.com/NvChad/NvChad",
|
|
||||||
update_branch = "main",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
M.ui = {
|
M.ui = {
|
||||||
|
------------------------------- base46 -------------------------------------
|
||||||
-- hl = highlights
|
-- hl = highlights
|
||||||
hl_add = {},
|
hl_add = {},
|
||||||
hl_override = {},
|
hl_override = {},
|
||||||
|
@ -17,11 +13,80 @@ M.ui = {
|
||||||
theme_toggle = { "onedark", "one_light" },
|
theme_toggle = { "onedark", "one_light" },
|
||||||
theme = "onedark", -- default theme
|
theme = "onedark", -- default theme
|
||||||
transparency = false,
|
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"
|
M.mappings = require "core.mappings"
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -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
|
-- add binaries installed by mason.nvim to path
|
||||||
local is_windows = vim.loop.os_uname().sysname == "Windows_NT"
|
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
|
-------------------------------------- autocmds ------------------------------------------
|
||||||
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
|
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
-- dont list quickfix buffers
|
-- dont list quickfix buffers
|
||||||
|
@ -19,9 +71,45 @@ autocmd("FileType", {
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- wrap the PackerSync command to warn people before using it in NvChadSnapshots
|
-- reload some chadrc options on-save
|
||||||
autocmd("VimEnter", {
|
autocmd("BufWritePost", {
|
||||||
callback = function()
|
pattern = vim.tbl_map(function(path)
|
||||||
vim.cmd "command! -nargs=* -complete=customlist,v:lua.require'packer'.plugin_complete PackerSync lua require('plugins') require('core.utils').packer_sync(<f-args>)"
|
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,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-------------------------------------- commands ------------------------------------------
|
||||||
|
local new_cmd = vim.api.nvim_create_user_command
|
||||||
|
|
||||||
|
new_cmd("NvChadUpdate", function()
|
||||||
|
require "nvchad.updater"()
|
||||||
|
end, {})
|
||||||
|
|
|
@ -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
|
|
|
@ -1,79 +1,74 @@
|
||||||
-- n, v, i, t = mode names
|
-- n, v, i, t = mode names
|
||||||
|
|
||||||
local function termcodes(str)
|
|
||||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
|
||||||
end
|
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.general = {
|
M.general = {
|
||||||
i = {
|
i = {
|
||||||
-- go to beginning and end
|
-- go to beginning and end
|
||||||
["<C-b>"] = { "<ESC>^i", "beginning of line" },
|
["<C-b>"] = { "<ESC>^i", "Beginning of line" },
|
||||||
["<C-e>"] = { "<End>", "end of line" },
|
["<C-e>"] = { "<End>", "End of line" },
|
||||||
|
|
||||||
-- navigate within insert mode
|
-- navigate within insert mode
|
||||||
["<C-h>"] = { "<Left>", "move left" },
|
["<C-h>"] = { "<Left>", "Move left" },
|
||||||
["<C-l>"] = { "<Right>", "move right" },
|
["<C-l>"] = { "<Right>", "Move right" },
|
||||||
["<C-j>"] = { "<Down>", "move down" },
|
["<C-j>"] = { "<Down>", "Move down" },
|
||||||
["<C-k>"] = { "<Up>", "move up" },
|
["<C-k>"] = { "<Up>", "Move up" },
|
||||||
},
|
},
|
||||||
|
|
||||||
n = {
|
n = {
|
||||||
["<ESC>"] = { "<cmd> noh <CR>", "no highlight" },
|
["<Esc>"] = { ":noh <CR>", "Clear highlights" },
|
||||||
|
|
||||||
-- switch between windows
|
-- switch between windows
|
||||||
["<C-h>"] = { "<C-w>h", "window left" },
|
["<C-h>"] = { "<C-w>h", "Window left" },
|
||||||
["<C-l>"] = { "<C-w>l", "window right" },
|
["<C-l>"] = { "<C-w>l", "Window right" },
|
||||||
["<C-j>"] = { "<C-w>j", "window down" },
|
["<C-j>"] = { "<C-w>j", "Window down" },
|
||||||
["<C-k>"] = { "<C-w>k", "window up" },
|
["<C-k>"] = { "<C-w>k", "Window up" },
|
||||||
|
|
||||||
-- save
|
-- save
|
||||||
["<C-s>"] = { "<cmd> w <CR>", "save file" },
|
["<C-s>"] = { "<cmd> w <CR>", "Save file" },
|
||||||
|
|
||||||
-- Copy all
|
-- Copy all
|
||||||
["<C-c>"] = { "<cmd> %y+ <CR>", "copy whole file" },
|
["<C-c>"] = { "<cmd> %y+ <CR>", "Copy whole file" },
|
||||||
|
|
||||||
-- line numbers
|
-- line numbers
|
||||||
["<leader>n"] = { "<cmd> set nu! <CR>", "toggle line number" },
|
["<leader>n"] = { "<cmd> set nu! <CR>", "Toggle line number" },
|
||||||
["<leader>rn"] = { "<cmd> set rnu! <CR>", "toggle relative 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",
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Allow moving the cursor through wrapped lines with j, k, <Up> and <Down>
|
-- 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/
|
-- http://www.reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/
|
||||||
-- empty mode is same as using <cmd> :map
|
-- 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
|
-- 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 } },
|
["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"', 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"', 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"', opts = { expr = true } },
|
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
|
||||||
|
|
||||||
-- new buffer
|
-- 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 = {
|
v = {
|
||||||
["<Up>"] = { 'v:count || mode(1)[0:1] == "no" ? "k" : "gk"', 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"', opts = { expr = true } },
|
["<Down>"] = { 'v:count || mode(1)[0:1] == "no" ? "j" : "gj"', "Move down", opts = { expr = true } },
|
||||||
},
|
},
|
||||||
|
|
||||||
x = {
|
x = {
|
||||||
["j"] = { '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"', 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
|
-- 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
|
-- 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 = {
|
n = {
|
||||||
-- cycle through buffers
|
-- cycle through buffers
|
||||||
["<TAB>"] = {
|
["<tab>"] = {
|
||||||
function()
|
function()
|
||||||
require("nvchad_ui.tabufline").tabuflineNext()
|
require("nvchad.tabufline").tabuflineNext()
|
||||||
end,
|
end,
|
||||||
"goto next buffer",
|
"Goto next buffer",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<S-Tab>"] = {
|
["<S-tab>"] = {
|
||||||
function()
|
function()
|
||||||
require("nvchad_ui.tabufline").tabuflinePrev()
|
require("nvchad.tabufline").tabuflinePrev()
|
||||||
end,
|
end,
|
||||||
"goto prev buffer",
|
"Goto prev buffer",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- pick buffers via numbers
|
|
||||||
["<Bslash>"] = { "<cmd> TbufPick <CR>", "Pick buffer" },
|
|
||||||
|
|
||||||
-- close buffer + hide terminal buffer
|
-- close buffer + hide terminal buffer
|
||||||
["<leader>x"] = {
|
["<leader>x"] = {
|
||||||
function()
|
function()
|
||||||
require("nvchad_ui.tabufline").close_buffer()
|
require("nvchad.tabufline").close_buffer()
|
||||||
end,
|
end,
|
||||||
"close buffer",
|
"Close buffer",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -118,14 +110,14 @@ M.comment = {
|
||||||
function()
|
function()
|
||||||
require("Comment.api").toggle.linewise.current()
|
require("Comment.api").toggle.linewise.current()
|
||||||
end,
|
end,
|
||||||
"toggle comment",
|
"Toggle comment",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
v = {
|
v = {
|
||||||
["<leader>/"] = {
|
["<leader>/"] = {
|
||||||
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
|
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
|
||||||
"toggle comment",
|
"Toggle comment",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -140,119 +132,112 @@ M.lspconfig = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.declaration()
|
vim.lsp.buf.declaration()
|
||||||
end,
|
end,
|
||||||
"lsp declaration",
|
"LSP declaration",
|
||||||
},
|
},
|
||||||
|
|
||||||
["gd"] = {
|
["gd"] = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.definition()
|
vim.lsp.buf.definition()
|
||||||
end,
|
end,
|
||||||
"lsp definition",
|
"LSP definition",
|
||||||
},
|
},
|
||||||
|
|
||||||
["K"] = {
|
["K"] = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.hover()
|
vim.lsp.buf.hover()
|
||||||
end,
|
end,
|
||||||
"lsp hover",
|
"LSP hover",
|
||||||
},
|
},
|
||||||
|
|
||||||
["gi"] = {
|
["gi"] = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.implementation()
|
vim.lsp.buf.implementation()
|
||||||
end,
|
end,
|
||||||
"lsp implementation",
|
"LSP implementation",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>ls"] = {
|
["<leader>ls"] = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.signature_help()
|
vim.lsp.buf.signature_help()
|
||||||
end,
|
end,
|
||||||
"lsp signature_help",
|
"LSP signature help",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>D"] = {
|
["<leader>D"] = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.type_definition()
|
vim.lsp.buf.type_definition()
|
||||||
end,
|
end,
|
||||||
"lsp definition type",
|
"LSP definition type",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>ra"] = {
|
["<leader>ra"] = {
|
||||||
function()
|
function()
|
||||||
require("nvchad_ui.renamer").open()
|
require("nvchad.renamer").open()
|
||||||
end,
|
end,
|
||||||
"lsp rename",
|
"LSP rename",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>ca"] = {
|
["<leader>ca"] = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.code_action()
|
vim.lsp.buf.code_action()
|
||||||
end,
|
end,
|
||||||
"lsp code_action",
|
"LSP code action",
|
||||||
},
|
},
|
||||||
|
|
||||||
["gr"] = {
|
["gr"] = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.references()
|
vim.lsp.buf.references()
|
||||||
end,
|
end,
|
||||||
"lsp references",
|
"LSP references",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>f"] = {
|
["<leader>f"] = {
|
||||||
function()
|
function()
|
||||||
vim.diagnostic.open_float()
|
vim.diagnostic.open_float { border = "rounded" }
|
||||||
end,
|
end,
|
||||||
"floating diagnostic",
|
"Floating diagnostic",
|
||||||
},
|
},
|
||||||
|
|
||||||
["[d"] = {
|
["[d"] = {
|
||||||
function()
|
function()
|
||||||
vim.diagnostic.goto_prev()
|
vim.diagnostic.goto_prev { float = { border = "rounded" } }
|
||||||
end,
|
end,
|
||||||
"goto prev",
|
"Goto prev",
|
||||||
},
|
},
|
||||||
|
|
||||||
["d]"] = {
|
["]d"] = {
|
||||||
function()
|
function()
|
||||||
vim.diagnostic.goto_next()
|
vim.diagnostic.goto_next { float = { border = "rounded" } }
|
||||||
end,
|
end,
|
||||||
"goto_next",
|
"Goto next",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>q"] = {
|
["<leader>q"] = {
|
||||||
function()
|
function()
|
||||||
vim.diagnostic.setloclist()
|
vim.diagnostic.setloclist()
|
||||||
end,
|
end,
|
||||||
"diagnostic setloclist",
|
"Diagnostic setloclist",
|
||||||
},
|
|
||||||
|
|
||||||
["<leader>fm"] = {
|
|
||||||
function()
|
|
||||||
vim.lsp.buf.format { async = true }
|
|
||||||
end,
|
|
||||||
"lsp formatting",
|
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>wa"] = {
|
["<leader>wa"] = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.add_workspace_folder()
|
vim.lsp.buf.add_workspace_folder()
|
||||||
end,
|
end,
|
||||||
"add workspace folder",
|
"Add workspace folder",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>wr"] = {
|
["<leader>wr"] = {
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.remove_workspace_folder()
|
vim.lsp.buf.remove_workspace_folder()
|
||||||
end,
|
end,
|
||||||
"remove workspace folder",
|
"Remove workspace folder",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>wl"] = {
|
["<leader>wl"] = {
|
||||||
function()
|
function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end,
|
end,
|
||||||
"list workspace folders",
|
"List workspace folders",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -262,10 +247,10 @@ M.nvimtree = {
|
||||||
|
|
||||||
n = {
|
n = {
|
||||||
-- toggle
|
-- toggle
|
||||||
["<C-n>"] = { "<cmd> NvimTreeToggle <CR>", "toggle nvimtree" },
|
["<C-n>"] = { "<cmd> NvimTreeToggle <CR>", "Toggle nvimtree" },
|
||||||
|
|
||||||
-- focus
|
-- focus
|
||||||
["<leader>e"] = { "<cmd> NvimTreeFocus <CR>", "focus nvimtree" },
|
["<leader>e"] = { "<cmd> NvimTreeFocus <CR>", "Focus nvimtree" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,23 +259,25 @@ M.telescope = {
|
||||||
|
|
||||||
n = {
|
n = {
|
||||||
-- find
|
-- find
|
||||||
["<leader>ff"] = { "<cmd> Telescope find_files <CR>", "find files" },
|
["<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>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>fw"] = { "<cmd> Telescope live_grep <CR>", "Live grep" },
|
||||||
["<leader>fb"] = { "<cmd> Telescope buffers <CR>", "find buffers" },
|
["<leader>fb"] = { "<cmd> Telescope buffers <CR>", "Find buffers" },
|
||||||
["<leader>fh"] = { "<cmd> Telescope help_tags <CR>", "help page" },
|
["<leader>fh"] = { "<cmd> Telescope help_tags <CR>", "Help page" },
|
||||||
["<leader>fo"] = { "<cmd> Telescope oldfiles <CR>", "find oldfiles" },
|
["<leader>fo"] = { "<cmd> Telescope oldfiles <CR>", "Find oldfiles" },
|
||||||
["<leader>tk"] = { "<cmd> Telescope keymaps <CR>", "show keys" },
|
["<leader>fz"] = { "<cmd> Telescope current_buffer_fuzzy_find <CR>", "Find in current buffer" },
|
||||||
|
|
||||||
-- git
|
-- git
|
||||||
["<leader>cm"] = { "<cmd> Telescope git_commits <CR>", "git commits" },
|
["<leader>cm"] = { "<cmd> Telescope git_commits <CR>", "Git commits" },
|
||||||
["<leader>gt"] = { "<cmd> Telescope git_status <CR>", "git status" },
|
["<leader>gt"] = { "<cmd> Telescope git_status <CR>", "Git status" },
|
||||||
|
|
||||||
-- pick a hidden term
|
-- pick a hidden term
|
||||||
["<leader>pt"] = { "<cmd> Telescope terms <CR>", "pick hidden term" },
|
["<leader>pt"] = { "<cmd> Telescope terms <CR>", "Pick hidden term" },
|
||||||
|
|
||||||
-- theme switcher
|
-- 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()
|
function()
|
||||||
require("nvterm.terminal").toggle "float"
|
require("nvterm.terminal").toggle "float"
|
||||||
end,
|
end,
|
||||||
"toggle floating term",
|
"Toggle floating term",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<A-h>"] = {
|
["<A-h>"] = {
|
||||||
function()
|
function()
|
||||||
require("nvterm.terminal").toggle "horizontal"
|
require("nvterm.terminal").toggle "horizontal"
|
||||||
end,
|
end,
|
||||||
"toggle horizontal term",
|
"Toggle horizontal term",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<A-v>"] = {
|
["<A-v>"] = {
|
||||||
function()
|
function()
|
||||||
require("nvterm.terminal").toggle "vertical"
|
require("nvterm.terminal").toggle "vertical"
|
||||||
end,
|
end,
|
||||||
"toggle vertical term",
|
"Toggle vertical term",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -327,37 +314,36 @@ M.nvterm = {
|
||||||
function()
|
function()
|
||||||
require("nvterm.terminal").toggle "float"
|
require("nvterm.terminal").toggle "float"
|
||||||
end,
|
end,
|
||||||
"toggle floating term",
|
"Toggle floating term",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<A-h>"] = {
|
["<A-h>"] = {
|
||||||
function()
|
function()
|
||||||
require("nvterm.terminal").toggle "horizontal"
|
require("nvterm.terminal").toggle "horizontal"
|
||||||
end,
|
end,
|
||||||
"toggle horizontal term",
|
"Toggle horizontal term",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<A-v>"] = {
|
["<A-v>"] = {
|
||||||
function()
|
function()
|
||||||
require("nvterm.terminal").toggle "vertical"
|
require("nvterm.terminal").toggle "vertical"
|
||||||
end,
|
end,
|
||||||
"toggle vertical term",
|
"Toggle vertical term",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- new
|
-- new
|
||||||
|
|
||||||
["<leader>h"] = {
|
["<leader>h"] = {
|
||||||
function()
|
function()
|
||||||
require("nvterm.terminal").new "horizontal"
|
require("nvterm.terminal").new "horizontal"
|
||||||
end,
|
end,
|
||||||
"new horizontal term",
|
"New horizontal term",
|
||||||
},
|
},
|
||||||
|
|
||||||
["<leader>v"] = {
|
["<leader>v"] = {
|
||||||
function()
|
function()
|
||||||
require("nvterm.terminal").new "vertical"
|
require("nvterm.terminal").new "vertical"
|
||||||
end,
|
end,
|
||||||
"new vertical term",
|
"New vertical term",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -370,14 +356,14 @@ M.whichkey = {
|
||||||
function()
|
function()
|
||||||
vim.cmd "WhichKey"
|
vim.cmd "WhichKey"
|
||||||
end,
|
end,
|
||||||
"which-key all keymaps",
|
"Which-key all keymaps",
|
||||||
},
|
},
|
||||||
["<leader>wk"] = {
|
["<leader>wk"] = {
|
||||||
function()
|
function()
|
||||||
local input = vim.fn.input "WhichKey: "
|
local input = vim.fn.input "WhichKey: "
|
||||||
vim.cmd("WhichKey " .. input)
|
vim.cmd("WhichKey " .. input)
|
||||||
end,
|
end,
|
||||||
"which-key query lookup",
|
"Which-key query lookup",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -399,7 +385,7 @@ M.blankline = {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
"Jump to current_context",
|
"Jump to current context",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
|
|
@ -3,19 +3,16 @@ local merge_tb = vim.tbl_deep_extend
|
||||||
|
|
||||||
M.load_config = function()
|
M.load_config = function()
|
||||||
local config = require "core.default_config"
|
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.mappings = M.remove_disabled_keys(chadrc.mappings, config.mappings)
|
||||||
config = merge_tb("force", config, chadrc) or {}
|
config = merge_tb("force", config, chadrc)
|
||||||
else
|
config.mappings.disabled = nil
|
||||||
error "chadrc must return a table!"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
config.mappings.disabled = nil
|
|
||||||
return config
|
return config
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -55,10 +52,12 @@ M.remove_disabled_keys = function(chadrc_mappings, default_mappings)
|
||||||
end
|
end
|
||||||
|
|
||||||
M.load_mappings = function(section, mapping_opt)
|
M.load_mappings = function(section, mapping_opt)
|
||||||
|
vim.schedule(function()
|
||||||
local function set_section_map(section_values)
|
local function set_section_map(section_values)
|
||||||
if section_values.plugin then
|
if section_values.plugin then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
section_values.plugin = nil
|
section_values.plugin = nil
|
||||||
|
|
||||||
for mode, mode_values in pairs(section_values) do
|
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
|
for _, sect in pairs(mappings) do
|
||||||
set_section_map(sect)
|
set_section_map(sect)
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- merge default/user plugin tables
|
M.lazy_load = function(plugin)
|
||||||
M.merge_plugins = function(plugins)
|
vim.api.nvim_create_autocmd({ "BufRead", "BufWinEnter", "BufNewFile" }, {
|
||||||
local plugin_configs = M.load_config().plugins
|
group = vim.api.nvim_create_augroup("BeLazyOnFileOpen" .. plugin, {}),
|
||||||
local user_plugins = plugin_configs
|
callback = function()
|
||||||
|
local file = vim.fn.expand "%"
|
||||||
|
local condition = file ~= "NvimTree_1" and file ~= "[lazy]" and file ~= ""
|
||||||
|
|
||||||
-- old plugin syntax for adding plugins
|
if condition then
|
||||||
if plugin_configs.user and type(plugin_configs.user) == "table" then
|
vim.api.nvim_del_augroup_by_name("BeLazyOnFileOpen" .. plugin)
|
||||||
user_plugins = plugin_configs.user
|
|
||||||
end
|
-- dont defer for treesitter as it will show slow highlighting
|
||||||
|
-- This deferring only happens only when we do "nvim filename"
|
||||||
-- support old plugin removal syntax
|
if plugin ~= "nvim-treesitter" then
|
||||||
local remove_plugins = plugin_configs.remove
|
vim.schedule(function()
|
||||||
if type(remove_plugins) == "table" then
|
require("lazy").load { plugins = plugin }
|
||||||
for _, v in ipairs(remove_plugins) do
|
|
||||||
plugins[v] = nil
|
if plugin == "nvim-lspconfig" then
|
||||||
end
|
vim.cmd "silent! do FileType"
|
||||||
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")
|
|
||||||
end
|
end
|
||||||
|
end, 0)
|
||||||
else
|
else
|
||||||
error "Packer could not be loaded!"
|
require("lazy").load { plugins = plugin }
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---@type ChadrcConfig
|
||||||
|
local M = {}
|
||||||
|
M.ui = {theme = 'gatekeeper'}
|
||||||
|
M.plugins = 'custom.plugins'
|
||||||
|
M.mappings = require "custom.mappings"
|
||||||
|
return M
|
|
@ -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"
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -0,0 +1,6 @@
|
||||||
|
vim.opt.colorcolumn = "180"
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.softtabstop = 0
|
||||||
|
vim.opt.shiftwidth = 0
|
||||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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,
|
|
||||||
})
|
|
|
@ -1,12 +1,35 @@
|
||||||
local present, cmp = pcall(require, "cmp")
|
local cmp = require "cmp"
|
||||||
|
|
||||||
if not present then
|
dofile(vim.g.base46_cache .. "cmp")
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
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)
|
local function border(hl_name)
|
||||||
return {
|
return {
|
||||||
|
@ -21,23 +44,20 @@ local function border(hl_name)
|
||||||
}
|
}
|
||||||
end
|
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 = {
|
local options = {
|
||||||
|
completion = {
|
||||||
|
completeopt = "menu,menuone",
|
||||||
|
},
|
||||||
|
|
||||||
window = {
|
window = {
|
||||||
completion = {
|
completion = {
|
||||||
border = border "CmpBorder",
|
side_padding = (cmp_style ~= "atom" and cmp_style ~= "atom_colored") and 1 or 0,
|
||||||
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
|
winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:PmenuSel",
|
||||||
|
scrollbar = false,
|
||||||
},
|
},
|
||||||
documentation = {
|
documentation = {
|
||||||
border = border "CmpDocBorder",
|
border = border "CmpDocBorder",
|
||||||
|
winhighlight = "Normal:CmpDoc",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
|
@ -45,13 +65,9 @@ local options = {
|
||||||
require("luasnip").lsp_expand(args.body)
|
require("luasnip").lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
formatting = {
|
|
||||||
format = function(_, vim_item)
|
formatting = formatting_style,
|
||||||
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,
|
|
||||||
},
|
|
||||||
mapping = {
|
mapping = {
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||||
|
@ -60,8 +76,8 @@ local options = {
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.close(),
|
["<C-e>"] = cmp.mapping.close(),
|
||||||
["<CR>"] = cmp.mapping.confirm {
|
["<CR>"] = cmp.mapping.confirm {
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Insert,
|
||||||
select = false,
|
select = true,
|
||||||
},
|
},
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
|
@ -89,15 +105,16 @@ local options = {
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "luasnip" },
|
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "nvim_lua" },
|
{ name = "nvim_lua" },
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- check for any override
|
if cmp_style ~= "atom" and cmp_style ~= "atom_colored" then
|
||||||
options = require("core.utils").load_override(options, "hrsh7th/nvim-cmp")
|
options.window.completion.border = border "CmpBorder"
|
||||||
|
end
|
||||||
|
|
||||||
cmp.setup(options)
|
return options
|
||||||
|
|
|
@ -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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,11 +1,5 @@
|
||||||
local present, lspconfig = pcall(require, "lspconfig")
|
dofile(vim.g.base46_cache .. "lsp")
|
||||||
|
require "nvchad.lsp"
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
require("base46").load_highlight "lsp"
|
|
||||||
require "nvchad_ui.lsp"
|
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
local utils = require "core.utils"
|
local utils = require "core.utils"
|
||||||
|
@ -19,7 +13,11 @@ M.on_attach = function(client, bufnr)
|
||||||
utils.load_mappings("lspconfig", { buffer = bufnr })
|
utils.load_mappings("lspconfig", { buffer = bufnr })
|
||||||
|
|
||||||
if client.server_capabilities.signatureHelpProvider then
|
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
|
||||||
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,
|
on_attach = M.on_attach,
|
||||||
capabilities = M.capabilities,
|
capabilities = M.capabilities,
|
||||||
|
|
||||||
|
@ -56,6 +54,8 @@ lspconfig.sumneko_lua.setup {
|
||||||
library = {
|
library = {
|
||||||
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
|
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
|
||||||
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = 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,
|
maxPreload = 100000,
|
||||||
preloadFileSize = 10000,
|
preloadFileSize = 10000,
|
||||||
|
|
|
@ -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 = {
|
local options = {
|
||||||
ensure_installed = { "lua-language-server" }, -- not an option from mason.nvim
|
ensure_installed = { "lua-language-server" }, -- not an option from mason.nvim
|
||||||
|
|
||||||
|
@ -21,8 +6,8 @@ local options = {
|
||||||
ui = {
|
ui = {
|
||||||
icons = {
|
icons = {
|
||||||
package_pending = " ",
|
package_pending = " ",
|
||||||
package_installed = " ",
|
package_installed = " ",
|
||||||
package_uninstalled = " ﮊ",
|
package_uninstalled = " ",
|
||||||
},
|
},
|
||||||
|
|
||||||
keymaps = {
|
keymaps = {
|
||||||
|
@ -40,10 +25,4 @@ local options = {
|
||||||
max_concurrent_installers = 10,
|
max_concurrent_installers = 10,
|
||||||
}
|
}
|
||||||
|
|
||||||
options = require("core.utils").load_override(options, "williamboman/mason.nvim")
|
return options
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("MasonInstallAll", function()
|
|
||||||
vim.cmd("MasonInstall " .. table.concat(options.ensure_installed, " "))
|
|
||||||
end, {})
|
|
||||||
|
|
||||||
mason.setup(options)
|
|
||||||
|
|
|
@ -1,11 +1,3 @@
|
||||||
local present, nvimtree = pcall(require, "nvim-tree")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
require("base46").load_highlight "nvimtree"
|
|
||||||
|
|
||||||
local options = {
|
local options = {
|
||||||
filters = {
|
filters = {
|
||||||
dotfiles = false,
|
dotfiles = false,
|
||||||
|
@ -13,20 +5,18 @@ local options = {
|
||||||
},
|
},
|
||||||
disable_netrw = true,
|
disable_netrw = true,
|
||||||
hijack_netrw = true,
|
hijack_netrw = true,
|
||||||
open_on_setup = false,
|
|
||||||
ignore_ft_on_setup = { "alpha" },
|
|
||||||
hijack_cursor = true,
|
hijack_cursor = true,
|
||||||
hijack_unnamed_buffer_when_opening = false,
|
hijack_unnamed_buffer_when_opening = false,
|
||||||
update_cwd = true,
|
sync_root_with_cwd = true,
|
||||||
update_focused_file = {
|
update_focused_file = {
|
||||||
enable = true,
|
enable = true,
|
||||||
update_cwd = false,
|
update_root = false,
|
||||||
},
|
},
|
||||||
view = {
|
view = {
|
||||||
adaptive_size = true,
|
adaptive_size = false,
|
||||||
side = "left",
|
side = "left",
|
||||||
width = 25,
|
width = 30,
|
||||||
hide_root_folder = true,
|
preserve_window_proportions = true,
|
||||||
},
|
},
|
||||||
git = {
|
git = {
|
||||||
enable = false,
|
enable = false,
|
||||||
|
@ -41,6 +31,7 @@ local options = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
renderer = {
|
renderer = {
|
||||||
|
root_folder_label = false,
|
||||||
highlight_git = false,
|
highlight_git = false,
|
||||||
highlight_opened_files = "none",
|
highlight_opened_files = "none",
|
||||||
|
|
||||||
|
@ -57,22 +48,22 @@ local options = {
|
||||||
},
|
},
|
||||||
|
|
||||||
glyphs = {
|
glyphs = {
|
||||||
default = "",
|
default = "",
|
||||||
symlink = "",
|
symlink = "",
|
||||||
folder = {
|
folder = {
|
||||||
default = "",
|
default = "",
|
||||||
empty = "",
|
empty = "",
|
||||||
empty_open = "",
|
empty_open = "",
|
||||||
open = "",
|
open = "",
|
||||||
symlink = "",
|
symlink = "",
|
||||||
symlink_open = "",
|
symlink_open = "",
|
||||||
arrow_open = "",
|
arrow_open = "",
|
||||||
arrow_closed = "",
|
arrow_closed = "",
|
||||||
},
|
},
|
||||||
git = {
|
git = {
|
||||||
unstaged = "✗",
|
unstaged = "✗",
|
||||||
staged = "✓",
|
staged = "✓",
|
||||||
unmerged = "",
|
unmerged = "",
|
||||||
renamed = "➜",
|
renamed = "➜",
|
||||||
untracked = "★",
|
untracked = "★",
|
||||||
deleted = "",
|
deleted = "",
|
||||||
|
@ -83,8 +74,4 @@ local options = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- check for any override
|
return options
|
||||||
options = require("core.utils").load_override(options, "kyazdani42/nvim-tree.lua")
|
|
||||||
vim.g.nvimtree_side = options.view.side
|
|
||||||
|
|
||||||
nvimtree.setup(options)
|
|
||||||
|
|
|
@ -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)
|
|
|
@ -1,48 +1,18 @@
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
local load_override = require("core.utils").load_override
|
|
||||||
local utils = require "core.utils"
|
local utils = require "core.utils"
|
||||||
|
|
||||||
M.autopairs = function()
|
M.blankline = {
|
||||||
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 = {
|
|
||||||
indentLine_enabled = 1,
|
indentLine_enabled = 1,
|
||||||
filetype_exclude = {
|
filetype_exclude = {
|
||||||
"help",
|
"help",
|
||||||
"terminal",
|
"terminal",
|
||||||
"alpha",
|
"lazy",
|
||||||
"packer",
|
|
||||||
"lspinfo",
|
"lspinfo",
|
||||||
"TelescopePrompt",
|
"TelescopePrompt",
|
||||||
"TelescopeResults",
|
"TelescopeResults",
|
||||||
"mason",
|
"mason",
|
||||||
|
"nvdash",
|
||||||
|
"nvcheatsheet",
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
buftype_exclude = { "terminal" },
|
buftype_exclude = { "terminal" },
|
||||||
|
@ -50,72 +20,22 @@ M.blankline = function()
|
||||||
show_first_indent_level = false,
|
show_first_indent_level = false,
|
||||||
show_current_context = true,
|
show_current_context = true,
|
||||||
show_current_context_start = true,
|
show_current_context_start = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
options = load_override(options, "lukas-reineke/indent-blankline.nvim")
|
M.luasnip = function(opts)
|
||||||
blankline.setup(options)
|
require("luasnip").config.set_config(opts)
|
||||||
end
|
|
||||||
|
|
||||||
M.colorizer = function()
|
-- vscode format
|
||||||
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 "" }
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
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", {
|
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||||
callback = function()
|
callback = function()
|
||||||
|
@ -129,61 +49,18 @@ M.luasnip = function()
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
M.gitsigns = function()
|
M.gitsigns = {
|
||||||
local present, gitsigns = pcall(require, "gitsigns")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
require("base46").load_highlight "git"
|
|
||||||
|
|
||||||
local options = {
|
|
||||||
signs = {
|
signs = {
|
||||||
add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" },
|
add = { text = "│" },
|
||||||
change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" },
|
change = { text = "│" },
|
||||||
delete = { hl = "DiffDelete", text = "", numhl = "GitSignsDeleteNr" },
|
delete = { text = "" },
|
||||||
topdelete = { hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr" },
|
topdelete = { text = "‾" },
|
||||||
changedelete = { hl = "DiffChangeDelete", text = "~", numhl = "GitSignsChangeNr" },
|
changedelete = { text = "~" },
|
||||||
|
untracked = { text = "│" },
|
||||||
},
|
},
|
||||||
on_attach = function (bufnr)
|
on_attach = function(bufnr)
|
||||||
utils.load_mappings("gitsigns", { buffer = 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,
|
||||||
},
|
}
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -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 = {
|
local options = {
|
||||||
defaults = {
|
defaults = {
|
||||||
vimgrep_arguments = {
|
vimgrep_arguments = {
|
||||||
|
@ -62,13 +52,4 @@ local options = {
|
||||||
extensions_list = { "themes", "terms" },
|
extensions_list = { "themes", "terms" },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- check for any override
|
return options
|
||||||
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)
|
|
||||||
|
|
|
@ -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 = {
|
local options = {
|
||||||
ensure_installed = {
|
ensure_installed = { "lua" },
|
||||||
"lua",
|
|
||||||
},
|
|
||||||
|
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
use_languagetree = true,
|
use_languagetree = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
indent = {
|
indent = { enable = true },
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- check for any override
|
return options
|
||||||
options = require("core.utils").load_override(options, "nvim-treesitter/nvim-treesitter")
|
|
||||||
|
|
||||||
treesitter.setup(options)
|
|
||||||
|
|
|
@ -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)
|
|
|
@ -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"] = {},
|
{
|
||||||
|
"NvChad/base46",
|
||||||
["wbthomason/packer.nvim"] = {
|
branch = "v2.0",
|
||||||
cmd = require("core.lazy_load").packer_cmds,
|
build = function()
|
||||||
config = function()
|
require("base46").load_all_highlights()
|
||||||
require "plugins"
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
["NvChad/extensions"] = { module = { "telescope", "nvchad" } },
|
{
|
||||||
|
"NvChad/ui",
|
||||||
["NvChad/base46"] = {
|
branch = "v2.0",
|
||||||
config = function()
|
lazy = false,
|
||||||
local ok, base46 = pcall(require, "base46")
|
|
||||||
|
|
||||||
if ok then
|
|
||||||
base46.load_theme()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
|
|
||||||
["NvChad/ui"] = {
|
{
|
||||||
after = "base46",
|
"NvChad/nvterm",
|
||||||
config = function()
|
init = 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()
|
|
||||||
require("core.utils").load_mappings "nvterm"
|
require("core.utils").load_mappings "nvterm"
|
||||||
end,
|
end,
|
||||||
},
|
config = function(_, opts)
|
||||||
|
require "base46.term"
|
||||||
["kyazdani42/nvim-web-devicons"] = {
|
require("nvterm").setup(opts)
|
||||||
after = "ui",
|
|
||||||
module = "nvim-web-devicons",
|
|
||||||
config = function()
|
|
||||||
require("plugins.configs.others").devicons()
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
["lukas-reineke/indent-blankline.nvim"] = {
|
{
|
||||||
opt = true,
|
"NvChad/nvim-colorizer.lua",
|
||||||
setup = function()
|
init = function()
|
||||||
require("core.lazy_load").on_file_open "indent-blankline.nvim"
|
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"
|
require("core.utils").load_mappings "blankline"
|
||||||
end,
|
dofile(vim.g.base46_cache .. "blankline")
|
||||||
config = function()
|
require("indent_blankline").setup(opts)
|
||||||
require("plugins.configs.others").blankline()
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
["NvChad/nvim-colorizer.lua"] = {
|
{
|
||||||
opt = true,
|
"nvim-treesitter/nvim-treesitter",
|
||||||
setup = function()
|
init = function()
|
||||||
require("core.lazy_load").on_file_open "nvim-colorizer.lua"
|
require("core.utils").lazy_load "nvim-treesitter"
|
||||||
end,
|
end,
|
||||||
config = function()
|
cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" },
|
||||||
require("plugins.configs.others").colorizer()
|
build = ":TSUpdate",
|
||||||
|
opts = function()
|
||||||
|
return require "plugins.configs.treesitter"
|
||||||
end,
|
end,
|
||||||
},
|
config = function(_, opts)
|
||||||
|
dofile(vim.g.base46_cache .. "syntax")
|
||||||
["nvim-treesitter/nvim-treesitter"] = {
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
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"
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- git stuff
|
-- git stuff
|
||||||
["lewis6991/gitsigns.nvim"] = {
|
{
|
||||||
ft = "gitcommit",
|
"lewis6991/gitsigns.nvim",
|
||||||
setup = function()
|
ft = { "gitcommit", "diff" },
|
||||||
require("core.lazy_load").gitsigns()
|
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,
|
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,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- lsp stuff
|
-- lsp stuff
|
||||||
["williamboman/mason.nvim"] = {
|
{
|
||||||
cmd = require("core.lazy_load").mason_cmds,
|
"williamboman/mason.nvim",
|
||||||
config = function()
|
cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUninstall", "MasonUninstallAll", "MasonLog" },
|
||||||
require "plugins.configs.mason"
|
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,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
["neovim/nvim-lspconfig"] = {
|
{
|
||||||
opt = true,
|
"neovim/nvim-lspconfig",
|
||||||
setup = function()
|
init = function()
|
||||||
require("core.lazy_load").on_file_open "nvim-lspconfig"
|
require("core.utils").lazy_load "nvim-lspconfig"
|
||||||
end,
|
end,
|
||||||
config = function()
|
config = function()
|
||||||
require "plugins.configs.lspconfig"
|
require "plugins.configs.lspconfig"
|
||||||
|
@ -115,109 +146,127 @@ local plugins = {
|
||||||
},
|
},
|
||||||
|
|
||||||
-- load luasnips + cmp related in insert mode only
|
-- load luasnips + cmp related in insert mode only
|
||||||
|
{
|
||||||
["rafamadriz/friendly-snippets"] = {
|
"hrsh7th/nvim-cmp",
|
||||||
module = { "cmp", "cmp_nvim_lsp" },
|
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
},
|
dependencies = {
|
||||||
|
{
|
||||||
["hrsh7th/nvim-cmp"] = {
|
-- snippet plugin
|
||||||
after = "friendly-snippets",
|
"L3MON4D3/LuaSnip",
|
||||||
config = function()
|
dependencies = "rafamadriz/friendly-snippets",
|
||||||
require "plugins.configs.cmp"
|
opts = { history = true, updateevents = "TextChanged,TextChangedI" },
|
||||||
|
config = function(_, opts)
|
||||||
|
require("plugins.configs.others").luasnip(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
["L3MON4D3/LuaSnip"] = {
|
-- autopairing of (){}[] etc
|
||||||
wants = "friendly-snippets",
|
{
|
||||||
after = "nvim-cmp",
|
"windwp/nvim-autopairs",
|
||||||
config = function()
|
opts = {
|
||||||
require("plugins.configs.others").luasnip()
|
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,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
["saadparwaiz1/cmp_luasnip"] = { after = "LuaSnip" },
|
-- cmp sources plugins
|
||||||
["hrsh7th/cmp-nvim-lua"] = { after = "cmp_luasnip" },
|
{
|
||||||
["hrsh7th/cmp-nvim-lsp"] = { after = "cmp-nvim-lua" },
|
"saadparwaiz1/cmp_luasnip",
|
||||||
["hrsh7th/cmp-buffer"] = { after = "cmp-nvim-lsp" },
|
"hrsh7th/cmp-nvim-lua",
|
||||||
["hrsh7th/cmp-path"] = { after = "cmp-buffer" },
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
-- misc plugins
|
"hrsh7th/cmp-path",
|
||||||
["windwp/nvim-autopairs"] = {
|
},
|
||||||
after = "nvim-cmp",
|
},
|
||||||
config = function()
|
opts = function()
|
||||||
require("plugins.configs.others").autopairs()
|
return require "plugins.configs.cmp"
|
||||||
|
end,
|
||||||
|
config = function(_, opts)
|
||||||
|
require("cmp").setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
["goolord/alpha-nvim"] = {
|
{
|
||||||
after = "base46",
|
"numToStr/Comment.nvim",
|
||||||
disable = true,
|
keys = {
|
||||||
config = function()
|
{ "gcc", mode = "n", desc = "Comment toggle current line" },
|
||||||
require "plugins.configs.alpha"
|
{ "gc", mode = { "n", "o" }, desc = "Comment toggle linewise" },
|
||||||
end,
|
{ "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()
|
||||||
["numToStr/Comment.nvim"] = {
|
|
||||||
module = "Comment",
|
|
||||||
keys = { "gc", "gb" },
|
|
||||||
config = function()
|
|
||||||
require("plugins.configs.others").comment()
|
|
||||||
end,
|
|
||||||
setup = function()
|
|
||||||
require("core.utils").load_mappings "comment"
|
require("core.utils").load_mappings "comment"
|
||||||
end,
|
end,
|
||||||
|
config = function(_, opts)
|
||||||
|
require("Comment").setup(opts)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- file managing , picker etc
|
-- file managing , picker etc
|
||||||
["kyazdani42/nvim-tree.lua"] = {
|
{
|
||||||
ft = "alpha",
|
"nvim-tree/nvim-tree.lua",
|
||||||
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
|
||||||
config = function()
|
init = function()
|
||||||
require "plugins.configs.nvimtree"
|
|
||||||
end,
|
|
||||||
setup = function()
|
|
||||||
require("core.utils").load_mappings "nvimtree"
|
require("core.utils").load_mappings "nvimtree"
|
||||||
end,
|
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",
|
cmd = "Telescope",
|
||||||
config = function()
|
init = function()
|
||||||
require "plugins.configs.telescope"
|
|
||||||
end,
|
|
||||||
setup = function()
|
|
||||||
require("core.utils").load_mappings "telescope"
|
require("core.utils").load_mappings "telescope"
|
||||||
end,
|
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
|
-- Only load whichkey after all the gui
|
||||||
["folke/which-key.nvim"] = {
|
{
|
||||||
disable = true,
|
"folke/which-key.nvim",
|
||||||
module = "which-key",
|
keys = { "<leader>", '"', "'", "`", "c", "v", "g" },
|
||||||
keys = { "<leader>", '"', "'", "`" },
|
init = function()
|
||||||
config = function()
|
|
||||||
require "plugins.configs.whichkey"
|
|
||||||
end,
|
|
||||||
setup = function()
|
|
||||||
require("core.utils").load_mappings "whichkey"
|
require("core.utils").load_mappings "whichkey"
|
||||||
end,
|
end,
|
||||||
|
config = function(_, opts)
|
||||||
|
dofile(vim.g.base46_cache .. "whichkey")
|
||||||
|
require("which-key").setup(opts)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Load all plugins
|
local config = require("core.utils").load_config()
|
||||||
local present, packer = pcall(require, "packer")
|
|
||||||
|
|
||||||
if present then
|
if #config.plugins > 0 then
|
||||||
vim.cmd "packadd packer.nvim"
|
table.insert(default_plugins, { import = config.plugins })
|
||||||
|
|
||||||
-- 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 }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
require("lazy").setup(default_plugins, config.lazy_nvim)
|
||||||
|
|
Loading…
Reference in New Issue