Compare commits
148 Commits
Author | SHA1 | Date |
---|---|---|
blob42 | f6c8c87402 | 4 days ago |
blob42 | fe252663bb | 1 month ago |
blob42 | 61710809ff | 3 months ago |
blob42 | ba813c1781 | 3 months ago |
blob42 | b8417bfb82 | 3 months ago |
blob42 | 55a7dc6a38 | 3 months ago |
blob42 | 02bb9b6658 | 8 months ago |
blob42 | 85155e5a3b | 8 months ago |
blob42 | 56f5ad5f34 | 8 months ago |
blob42 | e2f531c697 | 8 months ago |
blob42 | 7b3c881b1e | 8 months ago |
blob42 | 31dcd5375f | 9 months ago |
BlobRunner | e726420013 | 9 months ago |
blob42 | 7dd1e10bcf | 9 months ago |
BlobRunner | 59b792ab12 | 9 months ago |
BlobRunner | c626a710c1 | 9 months ago |
BlobRunner | 4071c239bb | 9 months ago |
BlobRunner | c4b2531c79 | 9 months ago |
blob42 | f432a60473 | 9 months ago |
BlobRunner | 5d7099ad7a | 9 months ago |
BlobRunner | 1923743738 | 9 months ago |
BlobRunner | 2e323becd3 | 9 months ago |
blob42 | 1aa5be2ef5 | 9 months ago |
blob42 | 06888508be | 9 months ago |
blob42 | a7ccbaa4fb | 9 months ago |
blob42 | 1eaccc7888 | 9 months ago |
blob42 | 49415bde0f | 9 months ago |
blob42 | 9a5a2c7a10 | 9 months ago |
blob42 | 800fcc2809 | 9 months ago |
blob42 | b9b886dd90 | 9 months ago |
blob42 | f66b8fcc81 | 9 months ago |
blob42 | 2246117cc9 | 9 months ago |
blob42 | 50113557c4 | 9 months ago |
blob42 | af45b94e8c | 9 months ago |
blob42 | 467fdfac0d | 9 months ago |
blob42 | e604b2aaa5 | 10 months ago |
blob42 | ecdf0344ff | 10 months ago |
blob42 | defa06be83 | 10 months ago |
blob42 | 3a315cc48c | 10 months ago |
blob42 | 89f57495cc | 10 months ago |
blob42 | 8c26c65db9 | 10 months ago |
blob42 | ea940f0066 | 10 months ago |
blob42 | f0db2664ad | 10 months ago |
blob42 | d5842563cf | 10 months ago |
blob42 | 9bfddd6290 | 10 months ago |
blob42 | 0005011361 | 10 months ago |
blob42 | 9f0be90572 | 10 months ago |
blob42 | 17b2ec25b6 | 10 months ago |
blob42 | f365b491b8 | 10 months ago |
blob42 | 45ae32d392 | 10 months ago |
blob42 | 645624d907 | 10 months ago |
blob42 | e0a6344198 | 10 months ago |
blob42 | a04f081553 | 10 months ago |
blob42 | 8646984b4a | 10 months ago |
blob42 | 7e683b2b2c | 10 months ago |
blob42 | 5c402da46d | 10 months ago |
blob42 | 5e660449fe | 10 months ago |
blob42 | 9459d7e92d | 10 months ago |
blob42 | 998397cfc2 | 10 months ago |
blob42 | 1791d088b3 | 10 months ago |
blob42 | 99b3ecebea | 10 months ago |
blob42 | 0866945769 | 10 months ago |
blob42 | 1e22939ada | 10 months ago |
blob42 | 660dd0c37b | 10 months ago |
blob42 | 0c1681d104 | 10 months ago |
blob42 | 896a05b16d | 10 months ago |
blob42 | 588b9f8907 | 10 months ago |
blob42 | 589b564e31 | 10 months ago |
blob42 | 51279f784d | 10 months ago |
blob42 | a56668d6ea | 10 months ago |
blob42 | 8e48f0c3da | 10 months ago |
blob42 | 516138fc73 | 10 months ago |
blob42 | 9852c55cb3 | 10 months ago |
blob42 | 2052d7088a | 10 months ago |
blob42 | c69f0a0b5b | 10 months ago |
blob42 | 46729ff2a5 | 10 months ago |
blob42 | 8b7e531680 | 11 months ago |
blob42 | 5b9fe0964f | 11 months ago |
blob42 | c4169d6d48 | 11 months ago |
blob42 | aeb11c5989 | 11 months ago |
blob42 | 5b1b51f782 | 11 months ago |
blob42 | e23172528f | 1 year ago |
blob42 | 7090563294 | 1 year ago |
blob42 | a1d6714a9f | 1 year ago |
blob42 | 6fcaa2c7d5 | 1 year ago |
blob42 | e73e01ab95 | 1 year ago |
blob42 | da3760df12 | 1 year ago |
blob42 | b649418528 | 1 year ago |
blob42 | d318389282 | 1 year ago |
blob42 | c0c72c5606 | 1 year ago |
blob42 | 898a383d4d | 1 year ago |
blob42 | 33aa97c9e0 | 1 year ago |
blob42 | 5216048827 | 1 year ago |
blob42 | 32a409df1a | 1 year ago |
blob42 | 1d594f4d29 | 1 year ago |
blob42 | e42fb7774c | 1 year ago |
blob42 | f4bd1a6031 | 1 year ago |
blob42 | e3473905d9 | 1 year ago |
blob42 | 396201fc4f | 1 year ago |
blob42 | 9f0d928696 | 1 year ago |
blob42 | 30d7889a30 | 1 year ago |
blob42 | 26a855646e | 1 year ago |
moonblade | 858e96cedb | 1 year ago |
moonblade | be356fa4da | 1 year ago |
moonblade | 083948ee1d | 1 year ago |
blob42 | e841162fc8 | 1 year ago |
blob42 | c52308ede4 | 1 year ago |
blob42 | 67be596154 | 1 year ago |
blob42 | dceac7591d | 1 year ago |
blob42 | 465dbe3de7 | 1 year ago |
blob42 | f0bb3b9021 | 1 year ago |
blob42 | f1514bc67a | 2 years ago |
blob42 | 07b5f3187b | 2 years ago |
moonblade | e96c4a613d | 2 years ago |
moonblade | 08f20c5852 | 2 years ago |
blob42 | 56a679c0a3 | 2 years ago |
blob42 | 3a80c0080d | 2 years ago |
blob42 | 30a366905c | 2 years ago |
blob42 | f3965f1276 | 2 years ago |
blob42 | bd04d2a322 | 2 years ago |
blob42 | df39230f58 | 2 years ago |
spike | 57f173cf4d | 2 years ago |
spike | 5977281eea | 2 years ago |
spike | 36bf07c3c5 | 2 years ago |
spike | 2621ab3ad6 | 2 years ago |
spike | f8f74ac25e | 2 years ago |
spike | e4189180ef | 2 years ago |
moonblade | f31f3649e9 | 2 years ago |
spike | 5a7920073d | 2 years ago |
spike | 9e5678036c | 2 years ago |
spike | a068850c79 | 2 years ago |
spike | a388697e9b | 2 years ago |
spike | bf50d7e8c6 | 2 years ago |
spike | 30b861d5e3 | 2 years ago |
moonblade | e5cbae3d2c | 2 years ago |
moonblade | 2cc6889d22 | 2 years ago |
spike | be44c24b1f | 2 years ago |
spike | bfeb426218 | 2 years ago |
spike | e455d26805 | 2 years ago |
spike | b0ca1ac78d | 2 years ago |
spike | fba0ef8038 | 2 years ago |
spike | 4a013e2b7e | 2 years ago |
spike | ba3e02a3dd | 2 years ago |
spike | b88a1b3ce9 | 2 years ago |
spike | 92798bf716 | 2 years ago |
spike | 9d379b301d | 2 years ago |
spike | 5bc5ca0e60 | 2 years ago |
spike | 033a5aeb1c | 2 years ago |
@ -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.7.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
|
@ -0,0 +1,7 @@
|
||||
set formatoptions+=r " auto add comments on line return
|
||||
|
||||
" formatting with gofmt
|
||||
" au BufEnter *.go set formatprg=gofmt\ -s
|
||||
" au BufEnter *.go set formatprg=goimports
|
||||
"
|
||||
nnoremap <Space>fm :%!goimports<CR>
|
@ -0,0 +1,4 @@
|
||||
set colorcolumn=0
|
||||
set signcolumn=yes:1
|
||||
set nonumber
|
||||
set norelativenumber
|
@ -1,4 +0,0 @@
|
||||
local ok, nvchad = pcall(require, "nvchad")
|
||||
if not ok then return end
|
||||
nvchad.reload_theme("ayu-dark")
|
||||
|
@ -0,0 +1 @@
|
||||
cnoremap R! !ruff --fix %<CR>
|
@ -0,0 +1,7 @@
|
||||
let g:abolish_save_file = "/home/spike/.config/nvim/after/plugin/abolish.vim"
|
||||
Abolish place{ho,h}ler{} placeholder
|
||||
Abolish improt import
|
||||
Abolish flase false
|
||||
Abolish optinoal optional
|
||||
Abolish n{O}ne none
|
||||
Abolish n{O}ne none
|
@ -0,0 +1 @@
|
||||
require 'spike.diagnostics'.set_diagnostics_level(vim.diagnostic.severity.ERROR)
|
@ -0,0 +1,15 @@
|
||||
local present, lspconfig = pcall(require, "lspconfig")
|
||||
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
-- local util = lspconfig.util
|
||||
-- util.on_setup = util.add_hook_before(util.on_setup, function (config)
|
||||
-- local o_root_dir = config.root_dir
|
||||
-- config.root_dir = function(fname, bufnr)
|
||||
-- -- P(fname)
|
||||
-- local dir = o_root_dir(fname)
|
||||
-- return "/source"
|
||||
-- end
|
||||
-- end)
|
@ -1,24 +1,235 @@
|
||||
--TODO: migrate to noirbuddy
|
||||
-- used to override nvchad highlights
|
||||
local c = require("base46.colors")
|
||||
local g = vim.g
|
||||
local M = {}
|
||||
|
||||
local colors = require("base46").get_theme_tb "base_30"
|
||||
local theme = require("base46").get_theme_tb "base_16"
|
||||
|
||||
local colors16 = require("base46").get_theme_tb "base_16"
|
||||
-- local theme = require("base46").get_theme_tb "base_16"
|
||||
|
||||
local ts_context_hl = c.change_hex_saturation(colors["yellow"], -20)
|
||||
local ts_context_hl = c.change_hex_lightness(ts_context_hl, -55)
|
||||
|
||||
local highlights = {
|
||||
TreesitterContext = {
|
||||
bg = ts_context_hl,
|
||||
-- TreesitterContext = {
|
||||
-- bg = ts_context_hl,
|
||||
-- },
|
||||
-- InlayHint = {
|
||||
-- fg = "#a9a19a",
|
||||
-- },
|
||||
-- Comment = {
|
||||
-- fg = c.change_hex_lightness(colors["one_bg"], 20),
|
||||
-- },
|
||||
St_file_sep_rev = {
|
||||
fg = colors.statusline_bg,
|
||||
bg = colors.lightbg,
|
||||
},
|
||||
-- DiagnosticUnderlineError = {
|
||||
-- fg = c.change_hex_lightness(colors["red"], 5),
|
||||
-- underline = true,
|
||||
-- },
|
||||
|
||||
}
|
||||
|
||||
local statusline = {
|
||||
|
||||
StatusLine = {
|
||||
bg = colors.statusline_bg,
|
||||
},
|
||||
|
||||
St_gitIcons = {
|
||||
fg = colors.light_grey,
|
||||
bg = colors.statusline_bg,
|
||||
bold = true,
|
||||
},
|
||||
|
||||
-- LSP
|
||||
|
||||
St_lspError = {
|
||||
fg = colors.red,
|
||||
bg = colors.statusline_bg,
|
||||
},
|
||||
|
||||
St_lspWarning = {
|
||||
fg = colors.yellow,
|
||||
bg = colors.statusline_bg,
|
||||
},
|
||||
|
||||
St_LspHints = {
|
||||
fg = colors.purple,
|
||||
bg = colors.statusline_bg,
|
||||
},
|
||||
|
||||
St_LspInfo = {
|
||||
fg = colors.green,
|
||||
bg = colors.statusline_bg,
|
||||
},
|
||||
|
||||
St_LspStatus = {
|
||||
fg = colors.nord_blue,
|
||||
bg = colors.statusline_bg,
|
||||
},
|
||||
|
||||
St_LspProgress = {
|
||||
fg = colors.green,
|
||||
bg = colors.statusline_bg,
|
||||
},
|
||||
|
||||
St_LspStatus_Icon = {
|
||||
fg = colors.black,
|
||||
bg = colors.nord_blue,
|
||||
},
|
||||
|
||||
-- MODES
|
||||
|
||||
St_NormalMode = {
|
||||
fg = colors.blue,
|
||||
bg = colors.black,
|
||||
},
|
||||
|
||||
St_InsertMode = {
|
||||
fg = colors16.base0B,
|
||||
bg = colors.black,
|
||||
|
||||
},
|
||||
|
||||
St_TerminalMode = {
|
||||
fg = colors.green,
|
||||
bg = colors.black,
|
||||
},
|
||||
|
||||
St_NTerminalMode = {
|
||||
fg = colors.yellow,
|
||||
bg = colors.black,
|
||||
},
|
||||
|
||||
St_VisualMode = {
|
||||
fg = colors.cyan,
|
||||
bg = colors.black,
|
||||
},
|
||||
|
||||
St_ReplaceMode = {
|
||||
fg = colors.orange,
|
||||
bg = colors.black,
|
||||
},
|
||||
|
||||
St_ConfirmMode = {
|
||||
fg = colors.teal,
|
||||
bg = colors.black,
|
||||
},
|
||||
|
||||
St_CommandMode = {
|
||||
fg = colors.green,
|
||||
bg = colors.black,
|
||||
},
|
||||
|
||||
St_SelectMode = {
|
||||
fg = colors.nord_blue,
|
||||
bg = colors.black,
|
||||
},
|
||||
|
||||
-- Separators for mode
|
||||
St_NormalModeSep = {
|
||||
bg = colors.nord_blue,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_InsertModeSep = {
|
||||
bg = colors16.base0B,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_TerminalModeSep = {
|
||||
bg = colors.green,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_NTerminalModeSep = {
|
||||
bg = colors.yellow,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_VisualModeSep = {
|
||||
bg = colors.cyan,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_ReplaceModeSep = {
|
||||
bg = colors.orange,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_ConfirmModeSep = {
|
||||
bg = colors.teal,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_CommandModeSep = {
|
||||
bg = colors.green,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_SelectModeSep = {
|
||||
bg = colors.nord_blue,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_EmptySpace = {
|
||||
fg = colors.grey,
|
||||
bg = colors.lightbg,
|
||||
},
|
||||
|
||||
St_EmptySpace2 = {
|
||||
fg = colors.grey,
|
||||
bg = colors.statusline_bg,
|
||||
},
|
||||
|
||||
St_file_info = {
|
||||
bg = colors.black,
|
||||
fg = colors.grey_fg2,
|
||||
},
|
||||
|
||||
St_file_sep = {
|
||||
bg = colors.statusline_bg,
|
||||
fg = colors.black,
|
||||
},
|
||||
|
||||
St_cwd_icon = {
|
||||
fg = colors.one_bg,
|
||||
bg = colors.red,
|
||||
},
|
||||
|
||||
St_cwd_text = {
|
||||
fg = colors.grey_fg2,
|
||||
bg = colors.black,
|
||||
},
|
||||
|
||||
St_cwd_sep = {
|
||||
fg = colors.red,
|
||||
bg = colors.statusline_bg,
|
||||
},
|
||||
|
||||
St_pos_sep = {
|
||||
fg = colors.base04,
|
||||
bg = colors.lightbg,
|
||||
},
|
||||
|
||||
St_pos_icon = {
|
||||
fg = colors.black,
|
||||
bg = colors.green,
|
||||
},
|
||||
|
||||
St_pos_text = {
|
||||
fg = colors16.base04,
|
||||
bg = colors.lightbg,
|
||||
},
|
||||
}
|
||||
|
||||
function set_hl()
|
||||
for hl, col in pairs(highlights) do
|
||||
for hl, col in pairs(vim.tbl_deep_extend("force", highlights, statusline)) do
|
||||
vim.api.nvim_set_hl(0, hl, col)
|
||||
end
|
||||
end
|
||||
|
||||
-- setup section
|
||||
set_hl()
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
if not pcall(require, "nvim-treesitter") then
|
||||
return
|
||||
end
|
||||
|
||||
local list = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
|
||||
list.sql = {
|
||||
install_info = {
|
||||
url = "https://github.com/DerekStride/tree-sitter-sql",
|
||||
files = { "src/parser.c" },
|
||||
branch = "main",
|
||||
},
|
||||
}
|
@ -0,0 +1 @@
|
||||
" let g:jukit_mappings = 1
|
@ -0,0 +1,11 @@
|
||||
augroup lexical
|
||||
autocmd!
|
||||
autocmd FileType markdown,mkd,toml,mail call lexical#init()
|
||||
autocmd FileType textile call lexical#init()
|
||||
autocmd FileType text call lexical#init({ 'spell': 0 })
|
||||
augroup END
|
||||
|
||||
let g:lexical#thesaurus_key = '<leader>ts'
|
||||
let g:lexical#dictionary_key = '<leader>kk'
|
||||
let g:lexical#thesaurus = ['~/.local/share/mthesaur.txt',]
|
||||
let g:lexical#dictionary = ['/usr/share/dict/words', '/usr/share/dict/spanish', '/usr/share/dict/french']
|
@ -0,0 +1,3 @@
|
||||
; extends
|
||||
|
||||
((field) ",") @myfield
|
@ -0,0 +1 @@
|
||||
{"tag_name":"nightly","target_commitish":"91d8f2ac534a51859c0e3c6562d07c94b27f4478","published_at":"2023-08-21T05:16:03Z"}
|
@ -1,37 +0,0 @@
|
||||
priority -55
|
||||
|
||||
global !p
|
||||
from vimsnippets import foldmarker, make_box, get_comment_format
|
||||
endglobal
|
||||
|
||||
|
||||
################
|
||||
# ANSI Color Codes #
|
||||
################
|
||||
|
||||
# The table starts with the original 16 colors (0-15).
|
||||
|
||||
# The proceeding 216 colors (16-231) or formed by a 3bpc RGB value offset by
|
||||
# 16, packed into a single value.
|
||||
|
||||
# The final 24 colors (232-256) are grayscale
|
||||
# starting from a shade slighly lighter than black, ranging up to shade slightly
|
||||
# darker than white.
|
||||
|
||||
# Some emulators interpret these steps as linear
|
||||
# increments from (256 / 24) on all three channels, although some emulators may
|
||||
# explicitly define these values.
|
||||
|
||||
snippet ansi_fg "Foreground ANSI 256 Color Code" i
|
||||
\033[38;5;${1:00}m
|
||||
endsnippet
|
||||
|
||||
snippet ansi_bg "Background ANSI 256 Color Code" i
|
||||
\033[48;5;${1:00}m
|
||||
endsnippet
|
||||
|
||||
snippet ansi_reset "Reset ANSI 256 Color Code" i
|
||||
\033[0m
|
||||
endsnippet
|
||||
|
||||
|
@ -1,12 +0,0 @@
|
||||
-- Just an example, supposed to be placed in /lua/custom/
|
||||
|
||||
local M = {}
|
||||
|
||||
-- make sure you maintain the structure of `core/default_config.lua` here,
|
||||
-- example of changing theme:
|
||||
|
||||
M.ui = {
|
||||
theme = "gruvchad",
|
||||
}
|
||||
|
||||
return M
|
@ -1,3 +0,0 @@
|
||||
-- example file i.e lua/custom/init.lua
|
||||
-- load your options globals, autocmds here or anything .__.
|
||||
-- you can even override default options here (core/options.lua)
|
@ -0,0 +1,13 @@
|
||||
NVIM v0.9.0-dev-888+g81c5483dc
|
||||
Build type: RelWithDebInfo
|
||||
LuaJIT 2.1.0-beta3
|
||||
Compilation: /usr/bin/gcc-10 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fno-common -fdiagnostics-color=always -fstack-protector-strong -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -DNVIM_UNIBI_HAS_VAR_FROM -I/home/runner/work/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include -I/home/runner/work/neovim/neovim/build/cmake.config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include -I/home/runner/work/neovim/neovim/.deps/usr/include
|
||||
Compiled by runner@fv-az454-10
|
||||
|
||||
Features: +acl +tui
|
||||
See ":help feature-compile"
|
||||
|
||||
system vimrc file: "$VIM/sysinit.vim"
|
||||
fall-back for $VIM: "/share/nvim"
|
||||
|
||||
Run :checkhealth for more info
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,145 @@
|
||||
-- nvchad custom highlights
|
||||
-- most highlights are set in the noirbuddy custom highlights
|
||||
local M = {}
|
||||
|
||||
|
||||
-- being migrated to noirbuddy, only statusline is defined here
|
||||
M.override = {
|
||||
-- IndentBlanklineContextChar = {
|
||||
-- fg = "baby_pink",
|
||||
-- nocombine = true,
|
||||
-- },
|
||||
-- IndentBlanklineChar= {
|
||||
-- fg = "black",
|
||||
-- nocombine = true,
|
||||
-- },
|
||||
Comment = {
|
||||
fg = "light_grey"
|
||||
},
|
||||
CursorLine = {
|
||||
bg = "#3b2a41"
|
||||
},
|
||||
CursorColumn = {
|
||||
bg = "#3b2a41"
|
||||
},
|
||||
-- ColorColumn = { -- outrun
|
||||
-- bg = "#3b2a41"
|
||||
-- },
|
||||
DiagnosticWarn = {
|
||||
fg = "yellow",
|
||||
italic = true,
|
||||
},
|
||||
St_LspWarning = {
|
||||
fg = "yellow"
|
||||
},
|
||||
DiagnosticHint = {
|
||||
fg = "purple",
|
||||
italic = true,
|
||||
},
|
||||
St_LspHints = {
|
||||
fg = "pruple",
|
||||
},
|
||||
DiagnosticError = {
|
||||
italic = true,
|
||||
},
|
||||
St_LspInfo = {
|
||||
fg = "white"
|
||||
},
|
||||
St_LspStatus = {
|
||||
fg = "blue"
|
||||
},
|
||||
-- LineNr = {
|
||||
-- fg = "#5f4468" -- outrun
|
||||
-- },
|
||||
}
|
||||
|
||||
M.add = {
|
||||
-- Visual = {
|
||||
-- bg = "cyan",
|
||||
-- fg = "black",
|
||||
-- },
|
||||
BookmarkSign = {
|
||||
fg = "blue",
|
||||
},
|
||||
BookmarkAnnotationSign = {
|
||||
fg = "yellow",
|
||||
},
|
||||
BookmarkAnnotationLine = {
|
||||
fg = "black",
|
||||
bg = "yellow"
|
||||
},
|
||||
DiagnosticInfo = { -- nvchad uses DiagnosticInformation wrong hi group for lsp
|
||||
fg = "white",
|
||||
italic = true,
|
||||
},
|
||||
DiagnosticFloatingInfo = {
|
||||
fg = "white",
|
||||
italic = true,
|
||||
},
|
||||
-- Definied in custom theme parameters (after/plugin/theme.lua)
|
||||
-- DiagnosticUnderlineError = {
|
||||
-- fg = "red",
|
||||
-- underline = true,
|
||||
-- },
|
||||
-- Code Lens related colors
|
||||
LspCodeLens = {
|
||||
fg = "vibrant_green",
|
||||
underline = true,
|
||||
},
|
||||
LspDiagnosticsSignHint = { -- LspDiagnostics Code Action
|
||||
fg = "vibrant_green",
|
||||
italic = true,
|
||||
},
|
||||
-- end of code lens colors
|
||||
DiffText = {
|
||||
bg = "vigrant_green"
|
||||
},
|
||||
St_DapMode = {
|
||||
fg = "black2",
|
||||
bg = "baby_pink",
|
||||
},
|
||||
St_DapModeSep = {
|
||||
fg = "baby_pink",
|
||||
bg = "one_bg3",
|
||||
},
|
||||
St_DapModeSep2 = {
|
||||
fg = "grey",
|
||||
bg = "baby_pink",
|
||||
},
|
||||
DapBreakpoint = {
|
||||
fg = "green"
|
||||
},
|
||||
-- DapStopped = {
|
||||
-- fg = "#ff4848"
|
||||
-- },
|
||||
DapLogPoint = {
|
||||
fg = "vibrant_green"
|
||||
},
|
||||
DapBreakpointCondition = {
|
||||
fg = "cyan"
|
||||
},
|
||||
DapBreakpointRejected = {
|
||||
fg = "purple"
|
||||
},
|
||||
LuaSnipChoice = {
|
||||
fg = "yellow",
|
||||
bg = "one_bg3",
|
||||
},
|
||||
LuaSnipInsert = {
|
||||
fg = "teal",
|
||||
-- bg = "one_bg3",
|
||||
},
|
||||
-- NvimDapVirtualText = {
|
||||
-- fg = '#f99540'
|
||||
-- },
|
||||
TabLineSel = {
|
||||
fg = "white",
|
||||
bold = true
|
||||
},
|
||||
TreesitterContext = {
|
||||
bg = "one_bg3"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return M
|
@ -0,0 +1,241 @@
|
||||
local M = {}
|
||||
|
||||
local opts = {
|
||||
-- Priority list of preferred backends for aerial.
|
||||
-- This can be a filetype map (see :help aerial-filetype-map)
|
||||
backends = { "treesitter", "lsp", "markdown", "man" },
|
||||
|
||||
layout = {
|
||||
-- These control the width of the aerial window.
|
||||
-- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
-- min_width and max_width can be a list of mixed types.
|
||||
-- max_width = {40, 0.2} means "the lesser of 40 columns or 20% of total"
|
||||
max_width = { 40, 0.2 },
|
||||
width = nil,
|
||||
min_width = 10,
|
||||
|
||||
-- Determines the default direction to open the aerial window. The 'prefer'
|
||||
-- options will open the window in the other direction *if* there is a
|
||||
-- different buffer in the way of the preferred direction
|
||||
-- Enum: prefer_right, prefer_left, right, left, float
|
||||
default_direction = "prefer_right",
|
||||
|
||||
-- Determines where the aerial window will be opened
|
||||
-- edge - open aerial at the far right/left of the editor
|
||||
-- window - open aerial to the right/left of the current window
|
||||
placement = "edge",
|
||||
},
|
||||
|
||||
-- Determines how the aerial window decides which buffer to display symbols for
|
||||
-- window - aerial window will display symbols for the buffer in the window from which it was opened
|
||||
-- global - aerial window will display symbols for the current window
|
||||
attach_mode = "global",
|
||||
|
||||
-- List of enum values that configure when to auto-close the aerial window
|
||||
-- unfocus - close aerial when you leave the original source window
|
||||
-- switch_buffer - close aerial when you change buffers in the source window
|
||||
-- unsupported - close aerial when attaching to a buffer that has no symbol source
|
||||
close_automatic_events = {},
|
||||
|
||||
-- Set to false to remove the default keybindings for the aerial buffer
|
||||
default_bindings = true,
|
||||
|
||||
-- Disable aerial on files with this many lines
|
||||
disable_max_lines = 10000,
|
||||
|
||||
-- Disable aerial on files this size or larger (in bytes)
|
||||
disable_max_size = 2000000, -- Default 2MB
|
||||
|
||||
-- A list of all symbols to display. Set to false to display all symbols.
|
||||
-- This can be a filetype map (see :help aerial-filetype-map)
|
||||
-- To see all available values, see :help SymbolKind
|
||||
filter_kind = {
|
||||
"Class",
|
||||
"Constructor",
|
||||
"Enum",
|
||||
"Function",
|
||||
"Interface",
|
||||
"Module",
|
||||
"Method",
|
||||
"Struct",
|
||||
},
|
||||
|
||||
-- Determines line highlighting mode when multiple splits are visible.
|
||||
-- split_width Each open window will have its cursor location marked in the
|
||||
-- aerial buffer. Each line will only be partially highlighted
|
||||
-- to indicate which window is at that location.
|
||||
-- full_width Each open window will have its cursor location marked as a
|
||||
-- full-width highlight in the aerial buffer.
|
||||
-- last Only the most-recently focused window will have its location
|
||||
-- marked in the aerial buffer.
|
||||
-- none Do not show the cursor locations in the aerial window.
|
||||
highlight_mode = "split_width",
|
||||
|
||||
-- Highlight the closest symbol if the cursor is not exactly on one.
|
||||
highlight_closest = true,
|
||||
|
||||
-- Highlight the symbol in the source buffer when cursor is in the aerial win
|
||||
highlight_on_hover = false,
|
||||
|
||||
-- When jumping to a symbol, highlight the line for this many ms.
|
||||
-- Set to false to disable
|
||||
highlight_on_jump = 300,
|
||||
|
||||
-- Define symbol icons. You can also specify "<Symbol>Collapsed" to change the
|
||||
-- icon when the tree is collapsed at that symbol, or "Collapsed" to specify a
|
||||
-- default collapsed icon. The default icon set is determined by the
|
||||
-- "nerd_font" option below.
|
||||
-- If you have lspkind-nvim installed, it will be the default icon set.
|
||||
-- This can be a filetype map (see :help aerial-filetype-map)
|
||||
icons = {},
|
||||
|
||||
-- Control which windows and buffers aerial should ignore.
|
||||
-- If attach_mode is "global", focusing an ignored window/buffer will
|
||||
-- not cause the aerial window to update.
|
||||
-- If open_automatic is true, focusing an ignored window/buffer will not
|
||||
-- cause an aerial window to open.
|
||||
-- If open_automatic is a function, ignore rules have no effect on aerial
|
||||
-- window opening behavior; it's entirely handled by the open_automatic
|
||||
-- function.
|
||||
ignore = {
|
||||
-- Ignore unlisted buffers. See :help buflisted
|
||||
unlisted_buffers = true,
|
||||
|
||||
-- List of filetypes to ignore.
|
||||
filetypes = {},
|
||||
|
||||
-- Ignored buftypes.
|
||||
-- Can be one of the following:
|
||||
-- false or nil - No buftypes are ignored.
|
||||
-- "special" - All buffers other than normal buffers are ignored.
|
||||
-- table - A list of buftypes to ignore. See :help buftype for the
|
||||
-- possible values.
|
||||
-- function - A function that returns true if the buffer should be
|
||||
-- ignored or false if it should not be ignored.
|
||||
-- Takes two arguments, `bufnr` and `buftype`.
|
||||
buftypes = "special",
|
||||
|
||||
-- Ignored wintypes.
|
||||
-- Can be one of the following:
|
||||
-- false or nil - No wintypes are ignored.
|
||||
-- "special" - All windows other than normal windows are ignored.
|
||||
-- table - A list of wintypes to ignore. See :help win_gettype() for the
|
||||
-- possible values.
|
||||
-- function - A function that returns true if the window should be
|
||||
-- ignored or false if it should not be ignored.
|
||||
-- Takes two arguments, `winid` and `wintype`.
|
||||
wintypes = "special",
|
||||
},
|
||||
|
||||
-- When you fold code with za, zo, or zc, update the aerial tree as well.
|
||||
-- Only works when manage_folds = true
|
||||
link_folds_to_tree = true,
|
||||
|
||||
-- Fold code when you open/collapse symbols in the tree.
|
||||
-- Only works when manage_folds = true
|
||||
link_tree_to_folds = false,
|
||||
|
||||
-- Use symbol tree for folding. Set to true or false to enable/disable
|
||||
-- 'auto' will manage folds if your previous foldmethod was 'manual'
|
||||
manage_folds = true,
|
||||
|
||||
-- Set default symbol icons to use patched font icons (see https://www.nerdfonts.com/)
|
||||
-- "auto" will set it to true if nvim-web-devicons or lspkind-nvim is installed.
|
||||
nerd_font = "auto",
|
||||
|
||||
-- Call this function when aerial attaches to a buffer.
|
||||
-- Useful for setting keymaps. Takes a single `bufnr` argument.
|
||||
on_attach = nil,
|
||||
|
||||
-- Call this function when aerial first sets symbols on a buffer.
|
||||
-- Takes a single `bufnr` argument.
|
||||
on_first_symbols = nil,
|
||||
|
||||
-- Automatically open aerial when entering supported buffers.
|
||||
-- This can be a function (see :help aerial-open-automatic)
|
||||
open_automatic = false,
|
||||
|
||||
-- Run this command after jumping to a symbol (false will disable)
|
||||
post_jump_cmd = "normal! zz",
|
||||
|
||||
-- When true, aerial will automatically close after jumping to a symbol
|
||||
close_on_select = false,
|
||||
|
||||
-- Show box drawing characters for the tree hierarchy
|
||||
show_guides = false,
|
||||
|
||||
-- The autocmds that trigger symbols update (not used for LSP backend)
|
||||
update_events = "TextChanged,InsertLeave",
|
||||
|
||||
-- Customize the characters used when show_guides = true
|
||||
guides = {
|
||||
-- When the child item has a sibling below it
|
||||
mid_item = "├─",
|
||||
-- When the child item is the last in the list
|
||||
last_item = "└─",
|
||||
-- When there are nested child guides to the right
|
||||
nested_top = "│ ",
|
||||
-- Raw indentation
|
||||
whitespace = " ",
|
||||
},
|
||||
|
||||
-- Options for opening aerial in a floating win
|
||||
float = {
|
||||
-- Controls border appearance. Passed to nvim_open_win
|
||||
border = "rounded",
|
||||
|
||||
-- Determines location of floating window
|
||||
-- cursor - Opens float on top of the cursor
|
||||
-- editor - Opens float centered in the editor
|
||||
-- win - Opens float centered in the window
|
||||
relative = "cursor",
|
||||
|
||||
-- These control the height of the floating window.
|
||||
-- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
-- min_height and max_height can be a list of mixed types.
|
||||
-- min_height = {8, 0.1} means "the greater of 8 rows or 10% of total"
|
||||
max_height = 0.9,
|
||||
height = nil,
|
||||
min_height = { 8, 0.1 },
|
||||
|
||||
override = function(conf, source_winid)
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
return conf
|
||||
end,
|
||||
},
|
||||
|
||||
lsp = {
|
||||
-- Fetch document symbols when LSP diagnostics update.
|
||||
-- If false, will update on buffer changes.
|
||||
diagnostics_trigger_update = true,
|
||||
|
||||
-- Set to false to not update the symbols when there are LSP errors
|
||||
update_when_errors = true,
|
||||
|
||||
-- How long to wait (in ms) after a buffer change before updating
|
||||
-- Only used when diagnostics_trigger_update = false
|
||||
update_delay = 300,
|
||||
},
|
||||
|
||||
treesitter = {
|
||||
-- How long to wait (in ms) after a buffer change before updating
|
||||
update_delay = 300,
|
||||
},
|
||||
|
||||
markdown = {
|
||||
-- How long to wait (in ms) after a buffer change before updating
|
||||
update_delay = 300,
|
||||
},
|
||||
|
||||
man = {
|
||||
-- How long to wait (in ms) after a buffer change before updating
|
||||
update_delay = 300,
|
||||
},
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
require("aerial").setup(opts)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,72 @@
|
||||
|
||||
local ok, codegpt = pcall(require, "codegpt")
|
||||
if not ok then
|
||||
vim.notify("missing module codegpt", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
-- vim.g["codegpt_write_response_to_err_log"] = true
|
||||
|
||||
require("spike.utils.openai").load_api_key("localai")
|
||||
vim.g["codegpt_openai_api_key"] = vim.fn.getenv("OPENAI_API_KEY")
|
||||
|
||||
vim.g["codegpt_chat_completions_url"] = "http://localai.srvlan:8080/v1/chat/completions"
|
||||
|
||||
|
||||
vim.g["codegpt_global_commands_defaults"] = {
|
||||
-- model = "dolphin-mixtral",
|
||||
model = "llama3-8b-inst-dpo",
|
||||
max_tokens = 8192,
|
||||
temperature = 0.6,
|
||||
-- extra_params = {
|
||||
-- presence_penalty = 0,
|
||||
-- frequency_penalty= 0
|
||||
-- }
|
||||
}
|
||||
|
||||
|
||||
vim.g["codegpt_commands"] = {
|
||||
["question"] = {
|
||||
callback_type = "text_popup",
|
||||
system_message_template = "You are a helpful {{filetype}} programming assistant. Analyze the question and any provided sample code and give thourough detailed explanations.",
|
||||
user_message_template = "I have a question about the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\n {{command_args}}",
|
||||
},
|
||||
["explain"] = {
|
||||
system_message_template = "You are a helpful {{filetype}} pair programming assistant. Help the user understand source code. Explain as if you were explaining to an other developer.",
|
||||
user_message_template = "Explain the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\n {{command_args}}",
|
||||
callback_type = "text_popup",
|
||||
temperature = 0.6
|
||||
},
|
||||
["implement"] = {
|
||||
callback_type = "code_popup",
|
||||
system_message_template = "You are a {{filetype}} programming assistant. Complete or implement the feature from the provided description. Think step by step before answering. Use {{filetype}} best practicies. Only output code snippets.",
|
||||
user_message_template = "I have the following specification for a {{language}} project: ```{{filetype}} {{text_selection}}``` {{command_args}}"
|
||||
|
||||
},
|
||||
["tests"] = {
|
||||
language_instructions = {
|
||||
python = "Use pytest framework."
|
||||
}
|
||||
},
|
||||
doc = {
|
||||
system_message_template = "You are a {{language}} programming assistant specialized in documenting source code.",
|
||||
user_message_template = "I have the following {{language}} code:\n```{{filetype}}\n{{text_selection}}\n```\nWrite good idiomatic documentation using the target language docstring. {{language_instructions}} {{command_args}}",
|
||||
},
|
||||
["completion"] = {
|
||||
system_message_template = "You are a Programming pair Assistant AI. You are helpful with improving and optimizing source code using the idiomatic practicies.",
|
||||
user_message_template = "I have the following {{language}} code: ```{{filetype}}\n{{text_selection}}```\n{{command_args}}. {{language_instructions}} Think step by step then only return the code snippet and nothing else."
|
||||
},
|
||||
["pydoc"] = {
|
||||
language_instructions = {
|
||||
python = "Use docstings to document the code. This project uses Sphinx. Use the google style python docstrings. Add sphinx directives if needed."
|
||||
},
|
||||
system_message_template = "You are a technical documentation assistant to a software developer. Help the user write clean detailed and easy to read project documentation.",
|
||||
user_message_template = "Create or improve the documentation for: ```{{text_selection}}```\n. Use a professional tone. {{language_instructions}} {{command_args}}",
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,62 @@
|
||||
local ok, copilot = pcall(require, 'copilot')
|
||||
if not ok then
|
||||
vim.notify("missing module copilot", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
local config = {
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = false,
|
||||
keymap = {
|
||||
jump_prev = "[[",
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<M-CR>"
|
||||
},
|
||||
layout = {
|
||||
position = "bottom", -- | top | left | right
|
||||
ratio = 0.4
|
||||
},
|
||||
},
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true,
|
||||
debounce = 100,
|
||||
keymap = {
|
||||
accept = "<M-j>",
|
||||
accept_word = false,
|
||||
accept_line = false,
|
||||
next = "<M-Right>",
|
||||
prev = "<M-Left>",
|
||||
dismiss = "<M-Down>",
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
python = true,
|
||||
yaml = false,
|
||||
markdown = true,
|
||||
help = false,
|
||||
gitcommit = false,
|
||||
gitrebase = false,
|
||||
hgcommit = false,
|
||||
svn = false,
|
||||
cvs = false,
|
||||
["."] = false,
|
||||
},
|
||||
copilot_node_command = 'node', -- Node.js version must be > 16.x
|
||||
server_opts_overrides = {
|
||||
-- trace = "verbose"
|
||||
inlineSuggestCount = 4,
|
||||
},
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
copilot.setup(config)
|
||||
end
|
||||
|
||||
return M
|
||||
|
@ -0,0 +1,33 @@
|
||||
local M = {}
|
||||
|
||||
-- config for dap ui virt text
|
||||
local dap_ui_virt_text_config = {
|
||||
enabled = true, -- enable this plugin (the default)
|
||||
enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
|
||||
highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
|
||||
highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
|
||||
show_stop_reason = true, -- show stop reason when stopped for exceptions
|
||||
commented = false, -- prefix virtual text with comment string
|
||||
only_first_definition = true, -- only show virtual text at first definition (if there are multiple)
|
||||
all_references = false, -- show virtual text on all all references of the variable (not only definitions)
|
||||
filter_references_pattern = '<module', -- filter references (not definitions) pattern when all_references is activated (Lua gmatch pattern, default filters out Python modules)
|
||||
-- experimental features:
|
||||
virt_text_pos = 'eol', -- position of virtual text, see `:h nvim_buf_set_extmark()`
|
||||
all_frames = true, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
|
||||
virt_lines = false, -- show virtual lines instead of virtual text (will flicker!)
|
||||
virt_text_win_col = 60 -- position the virtual text at a fixed window column (starting from the first text column) ,
|
||||
-- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()`
|
||||
}
|
||||
|
||||
|
||||
M.setup_virt_text = function()
|
||||
local ok, dap_virt_text = pcall(require, 'nvim-dap-virtual-text')
|
||||
if not ok then
|
||||
vim.notify("missing module nvim-dap-virtual-text", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
dap_virt_text.setup(dap_ui_virt_text_config)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,9 @@
|
||||
local M = {}
|
||||
local opts = {
|
||||
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,90 @@
|
||||
|
||||
local M = {}
|
||||
local opts = {
|
||||
icons = { expanded = "▾", collapsed = "▸", current_frame = "▸" },
|
||||
mappings = {
|
||||
-- Use a table to apply multiple mappings
|
||||
expand = { "<CR>", "<2-LeftMouse>" },
|
||||
open = "o",
|
||||
remove = "d",
|
||||
edit = "e",
|
||||
repl = "r",
|
||||
toggle = "t",
|
||||
},
|
||||
-- Expand lines larger than the window
|
||||
-- Requires >= 0.7
|
||||
expand_lines = true,
|
||||
-- Layouts define sections of the screen to place windows.
|
||||
-- The position can be "left", "right", "top" or "bottom".
|
||||
-- The size specifies the height/width depending on position. It can be an Int
|
||||
-- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while
|
||||
-- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns)
|
||||
-- Elements are the elements shown in the layout (in order).
|
||||
-- Layouts are opened in order so that earlier layouts take priority in window sizing.
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
-- Elements can be strings or table with id and size keys.
|
||||
{ id = "scopes", size = 0.5 },
|
||||
{ id = "breakpoints", size = 0.25 },
|
||||
{ id = "stacks", size = 0.25 },
|
||||
-- "watches",
|
||||
},
|
||||
size = 40, -- 40 columns
|
||||
position = "left",
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
{ id = "repl", size = 0.4 },
|
||||
{ id = "watches", size = 0.6 },
|
||||
-- "console",
|
||||
},
|
||||
size = 10, -- 25% of total lines
|
||||
position = "bottom",
|
||||
},
|
||||
},
|
||||
-- where to display controls
|
||||
controls = {
|
||||
-- Requires Neovim nightly (or 0.8 when released)
|
||||
enabled = true,
|
||||
|
||||
-- Display controls in this element
|
||||
element = "repl",
|
||||
icons = {
|
||||
pause = "",
|
||||
play = "",
|
||||
step_into = "",
|
||||
step_over = "",
|
||||
step_out = "",
|
||||
step_back = "",
|
||||
run_last = "↻",
|
||||
terminate = "",
|
||||
},
|
||||
},
|
||||
floating = {
|
||||
border = "single", -- Border style. Can be "single", "double" or "rounded"
|
||||
mappings = {
|
||||
close = { "q", "<Esc>" },
|
||||
},
|
||||
},
|
||||
render = {
|
||||
max_type_length = nil, -- Can be integer or nil.
|
||||
max_value_lines = 100, -- Can be integer or nil.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
M.setup = function()
|
||||
local ok, dapui = pcall(require, "dapui")
|
||||
if not ok then
|
||||
vim.notify("missing module dapui", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
dapui.setup(opts)
|
||||
end
|
||||
|
||||
M.opts = opts
|
||||
|
||||
|
||||
return M
|
@ -0,0 +1,184 @@
|
||||
local ok, dressing = pcall(require, "dressing")
|
||||
if not ok then
|
||||
vim.notify("missing module dressing", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
config = {
|
||||
input = {
|
||||
-- Set to false to disable the vim.ui.input implementation
|
||||
enabled = true,
|
||||
|
||||
-- Default prompt string
|
||||
default_prompt = "Input:",
|
||||
|
||||
-- Can be 'left', 'right', or 'center'
|
||||
prompt_align = "left",
|
||||
|
||||
-- When true, <Esc> will close the modal
|
||||
insert_only = true,
|
||||
|
||||
-- When true, input will start in insert mode.
|
||||
start_in_insert = true,
|
||||
|
||||
-- These are passed to nvim_open_win
|
||||
-- anchor = "SW",
|
||||
border = "rounded",
|
||||
-- 'editor' and 'win' will default to being centered
|
||||
relative = "cursor",
|
||||
|
||||
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
prefer_width = 40,
|
||||
width = nil,
|
||||
-- min_width and max_width can be a list of mixed types.
|
||||
-- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total"
|
||||
max_width = { 140, 0.9 },
|
||||
min_width = { 20, 0.2 },
|
||||
|
||||
win_options = {
|
||||
|
||||
-- Window transparency (0-100)
|
||||
winblend = 10,
|
||||
|
||||
-- Change default highlight groups (see :help winhl)
|
||||
winhighlight = "",
|
||||
},
|
||||
|
||||
-- Set to `false` to disable
|
||||
mappings = {
|
||||
n = {
|
||||
["<Esc>"] = "Close",
|
||||
["<CR>"] = "Confirm",
|
||||
},
|
||||
i = {
|
||||
["<C-c>"] = "Close",
|
||||
["<CR>"] = "Confirm",
|
||||
["<Up>"] = "HistoryPrev",
|
||||
["<Down>"] = "HistoryNext",
|
||||
},
|
||||
},
|
||||
|
||||
override = function(conf)
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
return conf
|
||||
end,
|
||||
|
||||
-- see :help dressing_get_config
|
||||
get_config = nil,
|
||||
},
|
||||
select = {
|
||||
-- Set to false to disable the vim.ui.select implementation
|
||||
enabled = true,
|
||||
|
||||
-- Priority list of preferred vim.select implementations
|
||||
backend = { "telescope", "fzf_lua", "nui", "builtin", "fzf" },
|
||||
|
||||
-- Trim trailing `:` from prompt
|
||||
trim_prompt = true,
|
||||
|
||||
-- Options for telescope selector
|
||||
-- These are passed into the telescope picker directly. Can be used like:
|
||||
-- telescope = require('telescope.themes').get_ivy({...})
|
||||
telescope = {
|
||||
layout_config = {
|
||||
width = 0.6,
|
||||
height = 0.6,
|
||||
},
|
||||
},
|
||||
|
||||
-- Options for fzf selector
|
||||
fzf = {
|
||||
window = {
|
||||
width = 0.5,
|
||||
height = 0.4,
|
||||
},
|
||||
},
|
||||
|
||||
-- Options for fzf_lua selector
|
||||
fzf_lua = {
|
||||
winopts = {
|
||||
width = 0.5,
|
||||
height = 0.6,
|
||||
},
|
||||
},
|
||||
|
||||
-- Options for nui Menu
|
||||
nui = {
|
||||
position = "50%",
|
||||
size = nil,
|
||||
relative = "editor",
|
||||
border = {
|
||||
style = "rounded",
|
||||
},
|
||||
buf_options = {
|
||||
swapfile = false,
|
||||
filetype = "DressingSelect",
|
||||
},
|
||||
win_options = {
|
||||
winblend = 10,
|
||||
},
|
||||
max_width = 80,
|
||||
max_height = 40,
|
||||
min_width = 40,
|
||||
min_height = 10,
|
||||
},
|
||||
|
||||
-- Options for built-in selector
|
||||
builtin = {
|
||||
-- These are passed to nvim_open_win
|
||||
|
||||
-- anchor = "NW",
|
||||
|
||||
border = "rounded",
|
||||
-- 'editor' and 'win' will default to being centered
|
||||
relative = "editor",
|
||||
|
||||
win_options = {
|
||||
-- Window transparency (0-100)
|
||||
winblend = 10,
|
||||
-- Change default highlight groups (see :help winhl)
|
||||
winhighlight = "",
|
||||
},
|
||||
|
||||
|
||||
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
-- the min_ and max_ options can be a list of mixed types.
|
||||
-- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total"
|
||||
width = nil,
|
||||
max_width = { 140, 0.8 },
|
||||
min_width = { 40, 0.2 },
|
||||
height = nil,
|
||||
max_height = 0.9,
|
||||
min_height = { 10, 0.2 },
|
||||
|
||||
-- Set to `false` to disable
|
||||
mappings = {
|
||||
["<Esc>"] = "Close",
|
||||
["<C-c>"] = "Close",
|
||||
["<CR>"] = "Confirm",
|
||||
},
|
||||
|
||||
override = function(conf)
|
||||
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
return conf
|
||||
end,
|
||||
},
|
||||
|
||||
-- Used to override format_item. See :help dressing-format
|
||||
format_item_override = {},
|
||||
|
||||
-- see :help dressing_get_config
|
||||
get_config = nil,
|
||||
},
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
dressing.setup(config)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,32 @@
|
||||
local M = {}
|
||||
|
||||
|
||||
local on_attach = function(bufnr)
|
||||
require("spike.utils").set_plugin_mappings "gitsigns"
|
||||
end
|
||||
|
||||
M.setup = function()
|
||||
local present, gitsigns = pcall(require, "gitsigns")
|
||||
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
require("base46").load_highlight "git"
|
||||
|
||||
local options = {
|
||||
signs = {
|
||||
add = { hl = "DiffAdd", text = "│", numhl = "GitSignsAddNr" },
|
||||
change = { hl = "DiffChange", text = "│", numhl = "GitSignsChangeNr" },
|
||||
delete = { hl = "DiffDelete", text = "", numhl = "GitSignsDeleteNr" },
|
||||
topdelete = { hl = "DiffDelete", text = "‾", numhl = "GitSignsDeleteNr" },
|
||||
changedelete = { hl = "DiffChangeDelete", text = "~", numhl = "GitSignsChangeNr" },
|
||||
},
|
||||
on_attach = on_attach,
|
||||
|
||||
}
|
||||
|
||||
gitsigns.setup(options)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,22 @@
|
||||
local ok, grapple = pcall(require, 'grapple')
|
||||
if not ok then
|
||||
vim.notify("missing module grapple", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
local config = {
|
||||
-- Your configuration goes here
|
||||
-- Leave empty to use the default configuration
|
||||
-- Please see the Configuration section below for more information
|
||||
scope = "git",
|
||||
log_level = "warn",
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
grapple.setup(config)
|
||||
end
|
||||
|
||||
|
||||
return M
|
@ -0,0 +1,35 @@
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
local M = {}
|
||||
|
||||
M.lazy_load_module = function()
|
||||
|
||||
|
||||
autocmd({"BufRead", "BufNewFile"},{
|
||||
group = vim.api.nvim_create_augroup("plantuml", {}),
|
||||
callback = function()
|
||||
plantuml_patterns = {
|
||||
"%.pu", "%.uml", "%.plantuml", "%.puml", "%.iuml"
|
||||
}
|
||||
|
||||
local bufname = vim.api.nvim_buf_get_name(0)
|
||||
for _,ft in ipairs(plantuml_patterns) do
|
||||
if vim.fn.fnamemodify(bufname, ":t"):match(ft) then
|
||||
vim.defer_fn(function()
|
||||
require("packer").loader("plantuml-syntax")
|
||||
end,0)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
firstline = vim.api.nvim_buf_get_lines(0,0,1,true)[1]
|
||||
if firestline ~= "" and firstline:match("^@startuml%s*") then
|
||||
vim.defer_fn(function()
|
||||
require("packer").loader("plantuml-syntax")
|
||||
end,0)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,42 @@
|
||||
local M = {}
|
||||
|
||||
|
||||
local opts = {
|
||||
defaults = {
|
||||
enable_highlighting = true,
|
||||
inline_highlighting = true,
|
||||
hl_groups = {
|
||||
insertion = "DiffAdd",
|
||||
deletion = "DiffDelete",
|
||||
change = "DiffChange",
|
||||
},
|
||||
},
|
||||
|
||||
debug = false,
|
||||
commands = {
|
||||
Norm = { cmd = "norm" },
|
||||
Reg = {
|
||||
cmd = "norm",
|
||||
-- This will transform ":5Reg a" into ":norm 5@a"
|
||||
args = function(opts)
|
||||
return (opts.count == -1 and "" or opts.count) .. "@" .. opts.args
|
||||
end,
|
||||
range = "",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
function M.get_cmds()
|
||||
local cmds = {}
|
||||
for cmd, _ in pairs(opts.commands) do
|
||||
table.insert(cmds, cmd)
|
||||
end
|
||||
|
||||
return cmds
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
require("live-command").setup(opts)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,44 @@
|
||||
local present, luasnip = pcall(require, "luasnip")
|
||||
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
local M = {}
|
||||
local types = require("luasnip.util.types")
|
||||
|
||||
local options = {
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI",
|
||||
enable_autosnippets = true,
|
||||
ext_opts = {
|
||||
[types.choiceNode] = {
|
||||
passive = {
|
||||
virt_text = { { " ", "LuaSnipChoice" } },
|
||||
}
|
||||
},
|
||||
[types.insertNode] = {
|
||||
passive = {
|
||||
virt_text = { { " ", "LuaSnipInsert" } },
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
luasnip.config.set_config(options)
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.luasnippets_path or "" }
|
||||
|
||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||
callback = function()
|
||||
if require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
|
||||
and not require("luasnip").session.jump_active
|
||||
then
|
||||
require("luasnip").unlink_current()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,107 @@
|
||||
local ok, neoai = pcall(require, "neoai")
|
||||
if not ok then
|
||||
vim.notify("missing module neoai", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local config = {
|
||||
-- Below are the default options, feel free to override what you would like changed
|
||||
ui = {
|
||||
output_popup_text = "NeoAI",
|
||||
input_popup_text = "Prompt",
|
||||
width = 30, -- As percentage eg. 30%
|
||||
output_popup_height = 80, -- As percentage eg. 80%
|
||||
submit = "<Enter>", -- Key binding to submit the prompt
|
||||
},
|
||||
models = {
|
||||
-- {
|
||||
-- name = "openai",
|
||||
-- model = "gpt-3.5-turbo",
|
||||
-- params = nil,
|
||||
-- },
|
||||
{
|
||||
name = "openai",
|
||||
model = "dolphin-mixtral",
|
||||
params = {
|
||||
temperature = 0.2
|
||||
},
|
||||
}
|
||||
},
|
||||
register_output = {
|
||||
["g"] = function(output)
|
||||
return output
|
||||
end,
|
||||
["c"] = require("neoai.utils").extract_code_snippets,
|
||||
},
|
||||
inject = {
|
||||
cutoff_width = 75,
|
||||
},
|
||||
prompts = {
|
||||
context_prompt = function(context)
|
||||
return "Hey, I'd like to provide some context for future "
|
||||
.. "messages. Here is the code/text that I want to refer "
|
||||
.. "to in our upcoming conversations:\n\n"
|
||||
.. context
|
||||
end,
|
||||
},
|
||||
mappings = {
|
||||
["select_up"] = "<C-k>",
|
||||
["select_down"] = "<C-j>",
|
||||
},
|
||||
open_ai = {
|
||||
api_base = "http://localai.srvlan:8080/v1",
|
||||
api_key = {
|
||||
env = "OPENAI_API_KEY",
|
||||
value = nil,
|
||||
-- `get` is is a function that retrieves an API key, can be used to override the default method.
|
||||
-- get = function() ... end
|
||||
|
||||
-- Here is some code for a function that retrieves an API key. You can use it with
|
||||
-- the Linux 'pass' application.
|
||||
-- get = function()
|
||||
-- local key = vim.fn.system("pass show openai/mytestkey")
|
||||
-- key = string.gsub(key, "\n", "")
|
||||
-- return key
|
||||
-- end,
|
||||
},
|
||||
},
|
||||
shortcuts = {
|
||||
{
|
||||
name = "textify",
|
||||
key = "<leader>as",
|
||||
desc = "fix text with AI",
|
||||
use_context = true,
|
||||
prompt = [[
|
||||
Please rewrite the text to make it more readable, clear,
|
||||
concise, and fix any grammatical, punctuation, or spelling
|
||||
errors
|
||||
]],
|
||||
modes = { "v" },
|
||||
strip_function = nil,
|
||||
},
|
||||
{
|
||||
name = "gitcommit",
|
||||
key = "<leader>ag",
|
||||
desc = "generate git commit message",
|
||||
use_context = false,
|
||||
prompt = function()
|
||||
return [[
|
||||
Using the following git diff generate a consise and
|
||||
clear git commit message, with a short title summary
|
||||
that is 75 characters or less:
|
||||
]] .. vim.fn.system("git diff --cached")
|
||||
end,
|
||||
modes = { "n" },
|
||||
strip_function = nil,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
neoai.setup(config)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,54 @@
|
||||
local present, neodev = pcall(require, "neodev")
|
||||
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
local M = {}
|
||||
|
||||
|
||||
local config = {
|
||||
library = {
|
||||
enabled = true, -- when not enabled, neodev will not change any settings to the LSP server
|
||||
-- these settings will be used for your Neovim config directory
|
||||
runtime = true, -- runtime path
|
||||
types = true, -- full signature, docs and completion of vim.api, vim.treesitter, vim.lsp and others
|
||||
-- plugins = true, -- installed opt or start plugins in packpath
|
||||
plugins = {
|
||||
"plenary.nvim",
|
||||
"grapple.nvim",
|
||||
"nvim-dap",
|
||||
"nvchad_ui",
|
||||
"base46",
|
||||
"go.nvim",
|
||||
"colorbuddy.nvim",
|
||||
"navigator.lua"
|
||||
},
|
||||
-- -- plugins = {"navigator.lua", "guihua.lua", "go.nvim", "plenary.nvim"},
|
||||
-- you can also specify the list of plugins to make available as a workspace library
|
||||
-- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" },
|
||||
},
|
||||
setup_jsonls = true, -- configures jsonls to provide completion for project specific .luarc.json files
|
||||
-- for your Neovim config directory, the config.library settings will be used as is
|
||||
-- for plugin directories (root_dirs having a /lua directory), config.library.plugins will be disabled
|
||||
-- for any other directory, config.library.enabled will be set to false
|
||||
-- override = function(root_dir, options) end,
|
||||
|
||||
|
||||
-- NOTE: using navigator I have to include the custom before_init
|
||||
-- With lspconfig, Neodev will automatically setup your lua-language-server
|
||||
-- If you disable this, then you have to set {before_init=require("neodev.lsp").before_init}
|
||||
-- in your lsp start options
|
||||
lspconfig = true,
|
||||
-- much faster, but needs a recent built of lua-language-server
|
||||
-- needs lua-language-server >= 3.6.0
|
||||
pathStrict = true,
|
||||
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
neodev.setup(config)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,44 @@
|
||||
local ok, noirbuddy = pcall(require, "noirbuddy")
|
||||
if not ok then
|
||||
P("NO NOIR BUDDY")
|
||||
vim.notify("missing module noirbuddy", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
local M = {}
|
||||
local g_config = require("core.utils").load_config()
|
||||
|
||||
M.palette = {
|
||||
primary = "#ef9d9d",
|
||||
secondary = "#a1b1e3",
|
||||
background = "#282936",
|
||||
noir_0 = "#e9e9f4",
|
||||
noir_1 = "#f1f2f8",
|
||||
noir_2 = "#e4e4f1",
|
||||
noir_3 = "#d4d4dd",
|
||||
noir_4 = "#cdcdd7",
|
||||
noir_5 = "#b9b9c7",
|
||||
noir_6 = "#a8a8b9",
|
||||
noir_7 = "#757b9a",
|
||||
noir_8 = "#353848",
|
||||
noir_9 = "#222430",
|
||||
|
||||
}
|
||||
|
||||
local config = {
|
||||
preset = 'slate',
|
||||
colors = M.palette
|
||||
}
|
||||
|
||||
|
||||
|
||||
M.setup = function()
|
||||
local base46 = require'base46'
|
||||
noirbuddy.setup(config)
|
||||
base46.load_highlight "defaults"
|
||||
base46.load_highlight "statusline"
|
||||
base46.load_highlight(base46.turn_str_to_color(g_config.ui.hl_add))
|
||||
require('theme.highlights').setup()
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,70 @@
|
||||
local ok, null_ls = pcall(require, 'null-ls')
|
||||
if not ok then
|
||||
vim.notify("missing module null-ls", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
local vim, api = vim, vim.api
|
||||
|
||||
local M = {}
|
||||
|
||||
M.default_sources = {
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
null_ls.builtins.code_actions.refactoring,
|
||||
null_ls.builtins.code_actions.shellcheck,
|
||||
null_ls.builtins.diagnostics.checkmake,
|
||||
null_ls.builtins.diagnostics.fish,
|
||||
null_ls.builtins.formatting.fish_indent,
|
||||
null_ls.builtins.diagnostics.hadolint,
|
||||
-- null_ls.builtins.formatting.ruff,
|
||||
-- null_ls.builtins.diagnostics.ruff,
|
||||
}
|
||||
|
||||
M.extra_sources = {
|
||||
null_ls.builtins.diagnostics.jshint,
|
||||
null_ls.builtins.diagnostics.flake8,
|
||||
null_ls.builtins.diagnostics.pydocstyle,
|
||||
null_ls.builtins.formatting.autoflake,
|
||||
null_ls.builtins.formatting.autopep8,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.isort,
|
||||
-- null_ls.builtins.diagnostics.pylint,
|
||||
|
||||
|
||||
-- golang revive (manually enabled with shortcut from mappings)
|
||||
-- null_ls.builtins.diagnostics.revive,
|
||||
}
|
||||
|
||||
M.config = {
|
||||
debounce = 1000,
|
||||
default_timeout = 5000,
|
||||
sources = M.default_sources,
|
||||
on_attach = function(client, bufnr)
|
||||
require('plugins.configs.lspconfig').on_attach(client, bufnr)
|
||||
local util = require('navigator.util')
|
||||
local log = util.log
|
||||
local trace = util.trace
|
||||
require('navigator.lspclient.highlight').add_highlight()
|
||||
require('navigator.lspclient.highlight').diagnositc_config_sign()
|
||||
api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
require('navigator.lspclient.mapping').setup({
|
||||
client = client,
|
||||
bufnr = bufnr,
|
||||
})
|
||||
if client.server_capabilities.documentHighlightProvider == true then
|
||||
trace('attaching doc highlight: ', bufnr, client.name)
|
||||
vim.defer_fn(function()
|
||||
require('navigator.dochighlight').documentHighlight(bufnr)
|
||||
end, 50) -- allow a bit time for it to settle down
|
||||
else
|
||||
log('skip doc highlight: ', bufnr, client.name)
|
||||
end
|
||||
require('navigator.lspclient.lspkind').init()
|
||||
end
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
null_ls.setup(M.config)
|
||||
end
|
||||
|
||||
|
||||
return M
|
@ -0,0 +1,17 @@
|
||||
local ok, overseer = pcall(require, 'overseer')
|
||||
if not ok then
|
||||
vim.notify("missing module overseer", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
opts = {
|
||||
|
||||
}
|
||||
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
require("overseer").setup(opts)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,34 @@
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
local M = {}
|
||||
|
||||
M.lazy_load_module = function()
|
||||
|
||||
|
||||
autocmd({"BufRead", "BufNewFile"},{
|
||||
group = vim.api.nvim_create_augroup("plantuml", {}),
|
||||
callback = function()
|
||||
local plantuml_patterns = {
|
||||
"%.pu", "%.uml", "%.plantuml", "%.puml", "%.iuml"
|
||||
}
|
||||
|
||||
local bufname = vim.api.nvim_buf_get_name(0)
|
||||
for _,ft in ipairs(plantuml_patterns) do
|
||||
if vim.fn.fnamemodify(bufname, ":t"):match(ft) then
|
||||
vim.defer_fn(function()
|
||||
require("packer").loader("plantuml-syntax")
|
||||
end,0)
|
||||
return
|
||||
end
|
||||
end
|
||||
local firstline = vim.api.nvim_buf_get_lines(0,0,1,true)[1]
|
||||
if firestline ~= "" and firstline:match("^@startuml%s*") then
|
||||
vim.defer_fn(function()
|
||||
require("packer").loader("plantuml-syntax")
|
||||
end,0)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,18 @@
|
||||
local ok, pconfig = pcall(require, "nvim-projectconfig")
|
||||
if not ok then
|
||||
vim.notify("missing module nvim-projectconfig", vim.log.levels.WARN)
|
||||
return false
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
local config = {
|
||||
project_dir = "~/.config/nvim-project-confs/", -- trailing slash important
|
||||
silent = false,
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
pconfig.setup(config)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,36 @@
|
||||
local ok, refactoring = pcall(require, 'refactoring')
|
||||
if not ok then
|
||||
vim.notify("missing module refactoring", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
local M = {}
|
||||
|
||||
|
||||
local config = {
|
||||
-- prompt for return type
|
||||
prompt_func_return_type = {
|
||||
go = true,
|
||||
cpp = true,
|
||||
c = true,
|
||||
java = true,
|
||||
},
|
||||
-- prompt for function parameters
|
||||
prompt_func_param_type = {
|
||||
go = true,
|
||||
cpp = true,
|
||||
c = true,
|
||||
java = true,
|
||||
},
|
||||
printf_statements = {},
|
||||
print_var_statements = {},
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
refactoring.setup(config)
|
||||
-- require("telescope").load_extension("refactoring")
|
||||
end
|
||||
|
||||
|
||||
|
||||
return M
|
@ -0,0 +1,188 @@
|
||||
local M = {}
|
||||
local opts = {
|
||||
tools = { -- rust-tools options
|
||||
|
||||
-- how to execute terminal commands
|
||||
-- options right now: termopen / quickfix
|
||||
executor = require("rust-tools/executors").termopen,
|
||||
|
||||
-- callback to execute once rust-analyzer is done initializing the workspace
|
||||
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
|
||||
on_initialized = nil,
|
||||
|
||||
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
|
||||
reload_workspace_from_cargo_toml = true,
|
||||
|
||||
-- These apply to the default RustSetInlayHints command
|
||||
inlay_hints = {
|
||||
-- automatically set inlay hints (type hints)
|
||||
-- default: true
|
||||
auto = true,
|
||||
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = false,
|
||||
|
||||
-- whether to show parameter hints with the inlay hints or not
|
||||
-- default: true
|
||||
show_parameter_hints = true,
|
||||
|
||||
-- prefix for parameter hints
|
||||
-- default: "<-"
|
||||
parameter_hints_prefix = " ",
|
||||
|
||||
-- prefix for all the other hints (type, chaining)
|
||||
-- default: "=>"
|
||||
other_hints_prefix = " ",
|
||||
|
||||
-- whether to align to the length of the longest line in the file
|
||||
max_len_align = false,
|
||||
|
||||
-- padding from the left if max_len_align is true
|
||||
max_len_align_padding = 1,
|
||||
|
||||
-- whether to align to the extreme right or not
|
||||
right_align = false,
|
||||
|
||||
-- padding from the right if right_align is true
|
||||
right_align_padding = 7,
|
||||
|
||||
-- The color of the hints
|
||||
highlight = "InlayHint",
|
||||
},
|
||||
|
||||
-- options same as lsp hover / vim.lsp.util.open_floating_preview()
|
||||
hover_actions = {
|
||||
|
||||
-- the border that is used for the hover window
|
||||
-- see vim.api.nvim_open_win()
|
||||
border = {
|
||||
{ "╭", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╮", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "╯", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╰", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
},
|
||||
|
||||
-- whether the hover action window gets automatically focused
|
||||
-- default: false
|
||||
auto_focus = false,
|
||||
},
|
||||
|
||||
-- settings for showing the crate graph based on graphviz and the dot
|
||||
-- command
|
||||
crate_graph = {
|
||||
-- Backend used for displaying the graph
|
||||
-- see: https://graphviz.org/docs/outputs/
|
||||
-- default: x11
|
||||
backend = "x11",
|
||||
-- where to store the output, nil for no output stored (relative
|
||||
-- path from pwd)
|
||||
-- default: nil
|
||||
output = nil,
|
||||
-- true for all crates.io and external crates, false only the local
|
||||
-- crates
|
||||
-- default: true
|
||||
full = true,
|
||||
|
||||
-- List of backends found on: https://graphviz.org/docs/outputs/
|
||||
-- Is used for input validation and autocompletion
|
||||
-- Last updated: 2021-08-26
|
||||
enabled_graphviz_backends = {
|
||||
"bmp",
|
||||
"cgimage",
|
||||
"canon",
|
||||
"dot",
|
||||
"gv",
|
||||
"xdot",
|
||||
"xdot1.2",
|
||||
"xdot1.4",
|
||||
"eps",
|
||||
"exr",
|
||||
"fig",
|
||||
"gd",
|
||||
"gd2",
|
||||
"gif",
|
||||
"gtk",
|
||||
"ico",
|
||||
"cmap",
|
||||
"ismap",
|
||||
"imap",
|
||||
"cmapx",
|
||||
"imap_np",
|
||||
"cmapx_np",
|
||||
"jpg",
|
||||
"jpeg",
|
||||
"jpe",
|
||||
"jp2",
|
||||
"json",
|
||||
"json0",
|
||||
"dot_json",
|
||||
"xdot_json",
|
||||
"pdf",
|
||||
"pic",
|
||||
"pct",
|
||||
"pict",
|
||||
"plain",
|
||||
"plain-ext",
|
||||
"png",
|
||||
"pov",
|
||||
"ps",
|
||||
"ps2",
|
||||
"psd",
|
||||
"sgi",
|
||||
"svg",
|
||||
"svgz",
|
||||
"tga",
|
||||
"tiff",
|
||||
"tif",
|
||||
"tk",
|
||||
"vml",
|
||||
"vmlz",
|
||||
"wbmp",
|
||||
"webp",
|
||||
"xlib",
|
||||
"x11",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- all the opts to send to nvim-lspconfig
|
||||
-- these override the defaults set by rust-tools.nvim
|
||||
-- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
|
||||
server = {
|
||||
-- standalone file support
|
||||
-- setting it to false may improve startup time
|
||||
standalone = true,
|
||||
cmd = {"run-rust-analyzer"}, -- use my wrapper script to see separate input/output log
|
||||
on_attach = function(client, bufnr)
|
||||
require('navigator.lspclient.mapping').setup({client=client, bufnr=bufnr}) -- setup navigator keymaps here,
|
||||
require("navigator.dochighlight").documentHighlight(bufnr)
|
||||
require('navigator.codeAction').code_action_prompt(bufnr)
|
||||
-- otherwise, you can define your own commands to call navigator functions
|
||||
end
|
||||
}, -- rust-analyzer options
|
||||
|
||||
-- debugging stuff
|
||||
dap = {
|
||||
-- adapter = {
|
||||
-- type = "executable",
|
||||
-- command = "lldb-vscode",
|
||||
-- -- command = "/home/spike/.local/share/nvim/mason/bin/codelldb",
|
||||
-- name = "rt_lldb",
|
||||
-- console = "integratedTerminal",
|
||||
-- },
|
||||
adapter = require('rust-tools.dap').get_codelldb_adapter(
|
||||
"/home/spike/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb",
|
||||
"/home/spike/.local/share/nvim/mason/packages/codelldb/extension/lldb/lib/liblldb.so"
|
||||
)
|
||||
},
|
||||
}
|
||||
|
||||
function M.setup()
|
||||
require("rust-tools").setup(opts)
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,20 @@
|
||||
local M = {}
|
||||
|
||||
local config = {
|
||||
server = {
|
||||
cmd = {"run-rust-analyzer"},
|
||||
auto_attach = false,
|
||||
on_attach = function(client, bufnr)
|
||||
require('navigator.lspclient.mapping').setup({client=client, bufnr=bufnr}) -- setup navigator keymaps here,
|
||||
require("navigator.dochighlight").documentHighlight(bufnr)
|
||||
require('navigator.codeAction').code_action_prompt(bufnr)
|
||||
-- otherwise, you can define your own commands to call navigator functions
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
function M.setup()
|
||||
vim.g.rustaceanvim = config
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,22 @@
|
||||
local M = {}
|
||||
|
||||
M.setup = function()
|
||||
vim.g.tabby_keybinding_accept = '<M-j>'
|
||||
vim.g.tabby_filetype_dict = {
|
||||
bash = "shellscript",
|
||||
sh = "shellscript",
|
||||
cs = "csharp",
|
||||
objc = "objective-c",
|
||||
objcpp = "objective-cpp",
|
||||
make = "makefile",
|
||||
cuda = "cuda-cpp",
|
||||
text = "plaintext",
|
||||
rust = "rust",
|
||||
go = "go",
|
||||
javascript = "javascript"
|
||||
}
|
||||
|
||||
vim.cmd("call tabby#OnVimEnter()")
|
||||
end
|
||||
|
||||
return M
|
@ -1,114 +1,118 @@
|
||||
return {
|
||||
ensure_installed = {
|
||||
"query",
|
||||
"css",
|
||||
"lua",
|
||||
"go",
|
||||
"rust",
|
||||
"fish",
|
||||
"bash",
|
||||
"python",
|
||||
"c",
|
||||
"cpp",
|
||||
"haskell",
|
||||
"javascript",
|
||||
"html",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"make",
|
||||
"sql",
|
||||
"yaml",
|
||||
"toml",
|
||||
"vue",
|
||||
},
|
||||
ensure_installed = {
|
||||
"query",
|
||||
"css",
|
||||
"lua",
|
||||
"go",
|
||||
"rust",
|
||||
"fish",
|
||||
"bash",
|
||||
"python",
|
||||
"c",
|
||||
"cpp",
|
||||
"haskell",
|
||||
"javascript",
|
||||
"html",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"make",
|
||||
"sql",
|
||||
"yaml",
|
||||
"toml",
|
||||
"vue",
|
||||
"xml"
|
||||
},
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function (lang, bufnr)
|
||||
return lang == "help"
|
||||
end
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(lang, bufnr)
|
||||
return lang == "help"
|
||||
end
|
||||
},
|
||||
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<CR>",
|
||||
node_incremental = "<Tab>",
|
||||
scope_incremental = "<CR>",
|
||||
node_decremental = "<S-Tab>",
|
||||
}
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<Space>",
|
||||
node_incremental = "<BS>",
|
||||
node_decremental = "<Space>",
|
||||
scope_incremental = "<CR>",
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
-- textsubjects = {
|
||||
-- enable = true,
|
||||
-- prev_selection = "<Tab>",
|
||||
-- keymaps = {
|
||||
-- ["<CR>"] = "textsubjects-smart", -- works in visual mode
|
||||
-- }
|
||||
-- },
|
||||
--
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
},
|
||||
-- textsubjects = {
|
||||
-- enable = true,
|
||||
-- prev_selection = "<Tab>",
|
||||
-- keymaps = {
|
||||
-- ["<CR>"] = "textsubjects-smart", -- works in visual mode
|
||||
-- }
|
||||
-- },
|
||||
--
|
||||
-- rainbow = {
|
||||
-- enable = true,
|
||||
-- extended_mode = true,
|
||||
-- },
|
||||
|
||||
textobjects = {
|
||||
enable = true,
|
||||
textobjects = {
|
||||
enable = true,
|
||||
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["aC"] = "@conditional.outer",
|
||||
["iC"] = "@conditional.inner",
|
||||
["ae"] = "@block.outer",
|
||||
["ie"] = "@block.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["is"] = "@statement.inner",
|
||||
["as"] = "@statement.outer",
|
||||
["ad"] = "@comment.outer",
|
||||
["am"] = "@call.outer",
|
||||
["im"] = "@call.inner",
|
||||
}
|
||||
},
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = { query = "@function.outer", desc = "TS function" },
|
||||
["if"] = { query = "@function.inner", desc = "TS function" },
|
||||
["aF"] = { query = "@myfield", desc = "TS field" },
|
||||
["ac"] = { query = "@class.outer", desc = "TS class" },
|
||||
["ic"] = { query = "@class.inner", desc = "TS class" },
|
||||
["aC"] = { query = "@conditional.outer", desc = "TS conditional" },
|
||||
["iC"] = { query = "@conditional.inner", desc = "TS conditional" },
|
||||
["ae"] = { query = "@block.outer", desc = "TS block" },
|
||||
["ie"] = { query = "@block.inner", desc = "TS block" },
|
||||
["al"] = { query = "@loop.outer", desc = "TS loop" },
|
||||
["il"] = { query = "@loop.inner", desc = "TS loop" },
|
||||
["is"] = { query = "@statement.inner", desc = "TS statement" },
|
||||
["as"] = { query = "@statement.outer", desc = "TS statement" },
|
||||
["ad"] = { query = "@comment.outer", desc = "TS comment" },
|
||||
["am"] = { query = "@call.outer", desc = "TS Call" },
|
||||
["im"] = { query = "@call.inner", desc = "TS Call" },
|
||||
}
|
||||
},
|
||||
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
["]]"] = "@function.outer",
|
||||
["]C"] = "@class.outer",
|
||||
["]f"] = "@field.outer",
|
||||
},
|
||||
|
||||
goto_next_start = {
|
||||
["]]"] = "@function.outer",
|
||||
["]C"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]["] = "@function.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[["] = "@function.outer",
|
||||
["[C"] = "@class.outer",
|
||||
["[f"] = "@field.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[]"] = "@function.outer",
|
||||
}
|
||||
},
|
||||
|
||||
goto_next_end = {
|
||||
["]["] = "@function.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[["] = "@function.outer",
|
||||
["[C"] = "@class.outer"
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[]"] = "@function.outer",
|
||||
}
|
||||
swap = {
|
||||
enable = false, -- swap using syntax-tree-surfer
|
||||
swap_next = {
|
||||
["~"] = "@parameter.inner"
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["~"] = "@parameter.inner"
|
||||
},
|
||||
playground = {
|
||||
enable = true,
|
||||
}
|
||||
},
|
||||
|
||||
playground = {
|
||||
enable = true,
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,31 @@
|
||||
local M = {}
|
||||
|
||||
M.enable = function()
|
||||
local venn_enabled = vim.inspect(vim.b.venn_enabled)
|
||||
if venn_enabled == "nil" then
|
||||
vim.b.venn_enabled = true
|
||||
vim.cmd[[setlocal ve=all]]
|
||||
-- draw a line on HJKL keystokes
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<CR>", {noremap = true})
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<CR>", {noremap = true})
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<CR>", {noremap = true})
|
||||
vim.api.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<CR>", {noremap = true})
|
||||
-- draw a box by pressing "f" with visual selection
|
||||
vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox<CR>", {noremap = true})
|
||||
else
|
||||
vim.cmd[[setlocal ve=]]
|
||||
vim.cmd[[mapclear <buffer>]]
|
||||
vim.b.venn_enabled = nil
|
||||
end
|
||||
end
|
||||
|
||||
M.disable = function()
|
||||
local venn_enabled = vim.inspect(vim.b.venn_enabled)
|
||||
if venn_enabled ~= "nil" then
|
||||
vim.cmd[[setlocal ve=]]
|
||||
vim.cmd[[mapclear <buffer>]]
|
||||
vim.b.venn_enabled = nil
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,33 @@
|
||||
local M = {}
|
||||
|
||||
local opts = {
|
||||
-- can be "telescope", "fzf" or "select" (`vim.ui.select`)
|
||||
-- it's recommended to use "telescope" or "fzf"
|
||||
picker = "select",
|
||||
|
||||
lsp = {
|
||||
-- `config` is passed to `vim.lsp.start_client(config)`
|
||||
config = {
|
||||
cmd = { "zk", "lsp" },
|
||||
name = "zk",
|
||||
-- on_attach = ...
|
||||
-- etc, see `:h vim.lsp.start_client()`
|
||||
on_attach = function(client, bufnr)
|
||||
vim.keymap.set("n", "K", "<cmd> lua vim.lsp.buf.hover()<CR>", { desc = "zk lsp hover"})
|
||||
vim.keymap.set("v", "<leader>za", ":'<,'> vim.lsp.buf.range_code_action()<CR>", { desc = { "zk range code action"}})
|
||||
end
|
||||
},
|
||||
|
||||
-- automatically attach buffers in a zk notebook that match the given filetypes
|
||||
auto_attach = {
|
||||
enabled = true,
|
||||
filetypes = { "markdown" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
M.setup = function()
|
||||
require("zk").setup(opts)
|
||||
end
|
||||
|
||||
return M
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,86 @@
|
||||
local M = {}
|
||||
|
||||
M.base_30 = {
|
||||
white = "#F8F8F2",
|
||||
darker_black = "#222430",
|
||||
black = "#282A36", -- nvim bg
|
||||
black2 = "#2d303e",
|
||||
one_bg = "#373844", -- real bg of onedark
|
||||
one_bg2 = "#44475a",
|
||||
one_bg3 = "#565761",
|
||||
grey = "#5e5f69",
|
||||
grey_fg = "#666771",
|
||||
grey_fg2 = "#6e6f79",
|
||||
light_grey = "#73747e",
|
||||
red = "#e87c7c",
|
||||
baby_pink = "#ef9d9d",
|
||||
pink = "#ec8cc3",
|
||||
line = "#3c3d49", -- for lines like vertsplit
|
||||
green = "#99d282",
|
||||
vibrant_green = "#5ffd89",
|
||||
nord_blue = "#8b9bcd",
|
||||
blue = "#a1b1e3",
|
||||
yellow = "#d7e28d",
|
||||
sun = "#e4af69",
|
||||
purple = "#BD93F9",
|
||||
dark_purple = "#BD93F9",
|
||||
teal = "#92a2d4",
|
||||
-- orange = "#FFB86C",
|
||||
orange = "#e9b782",
|
||||
cyan = "#74a9e1",
|
||||
statusline_bg = "#2d2f3b",
|
||||
lightbg = "#41434f",
|
||||
pmenu_bg = "#92a2d4",
|
||||
folder_bg = "#BD93F9",
|
||||
}
|
||||
|
||||
M.base_16 = {
|
||||
base00 = "#282936",
|
||||
base01 = "#3a3c4e",
|
||||
base02 = "#4d4f68",
|
||||
base03 = "#626483",
|
||||
base04 = "#94b2b6",
|
||||
base05 = "#e9e9f4",
|
||||
base06 = "#f1f2f8",
|
||||
base07 = "#f7f7fb",
|
||||
base08 = "#c2abd5", -- #TODO!: secondary
|
||||
base09 = "#e9b782",
|
||||
base0A = "#7dc2cd",
|
||||
base0B = "#e8cfcf",
|
||||
base0C = "#8BE9FD",
|
||||
base0D = "#ef9d9d", -- #NOTE: primmary
|
||||
base0E = "#c5c0c3",
|
||||
base0F = "#f7f7f3",
|
||||
}
|
||||
|
||||
M.polish_hl = {
|
||||
-- ["@function"] = { fg = M.base_16.base0D, bold = true },
|
||||
-- ["@function"] = { fg = "none" },
|
||||
-- ["@variable.builtin"] = { fg = "none" },
|
||||
-- ["Conditional"] = { fg = M.base_16.base0D, bold = true },
|
||||
-- ["Repeat"] = { fg = M.base_16.base0D, bold = true },
|
||||
-- ["@keyword.return"] = { fg = M.base_16.base0D, bold = true },
|
||||
--
|
||||
-- ["@keyword"] = { fg = M.base_16.base08, },
|
||||
-- ["@keyword.function"] = { fg = M.base_16.base08, },
|
||||
-- ["@keyword.coroutine"] = { fg = M.base_16.base08, },
|
||||
-- ["@type.builtin"] = { fg = M.base_16.base08, },
|
||||
-- ["@type"] = { fg = M.base_16.base08, },
|
||||
-- ["Type"] = { fg = M.base_16.base08, },
|
||||
--
|
||||
-- ["Constant"] = { fg = M.base_30.orange },
|
||||
-- ["Variable"] = { fg = "none" },
|
||||
-- ["String"] = { fg = M.base_30.green },
|
||||
--
|
||||
-- ["Identifier"] = { fg = M.base_16.base07 },
|
||||
-- ["@parameter"] = { fg = "none" },
|
||||
-- ["@attribute"] = { fg = "none" },
|
||||
-- ["@constructor"] = { fg = M.base_16.base07 },
|
||||
|
||||
}
|
||||
|
||||
|
||||
vim.opt.bg = "dark"
|
||||
M = require("base46").override_theme(M, "blob42")
|
||||
|
||||
return M
|
@ -1,22 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
M.set_plugin_mappings = function(plugin_name, mapping_opt)
|
||||
mappings = require("core.utils").load_config().mappings[plugin_name]
|
||||
mappings.plugin = nil
|
||||
|
||||
for mode, mode_values in pairs(mappings) do
|
||||
local default_opts = vim.tbl_deep_extend("force", { mode = mode }, mapping_opt or {})
|
||||
for keybind, mapping_info in pairs(mode_values) do
|
||||
-- merge default + user opts
|
||||
local opts = vim.tbl_deep_extend("force", default_opts, mapping_info.opts or {})
|
||||
|
||||
mapping_info.opts, opts.mode = nil, nil
|
||||
opts.desc = mapping_info[2]
|
||||
|
||||
vim.keymap.set(mode, keybind, mapping_info[1], opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return M
|
@ -1,33 +0,0 @@
|
||||
local dapmode = require("spike.dapmode")
|
||||
|
||||
local M = {}
|
||||
|
||||
local function register_listeners()
|
||||
local present, dap = pcall(require, "dap")
|
||||
if not present then
|
||||
print("nvim-dap missing !")
|
||||
return
|
||||
end
|
||||
|
||||
dap.listeners.before['event_initialized']['spike-dap'] = function(session, body)
|
||||
dapmode.start()
|
||||
end
|
||||
|
||||
dap.listeners.after['event_terminated']['spike-dap'] = function(session, body)
|
||||
-- print("dap session ended")
|
||||
dapmode.stop()
|
||||
end
|
||||
end
|
||||
|
||||
function M.go_debug()
|
||||
local present, gdap = pcall(require, "go.dap")
|
||||
if not present then return end
|
||||
gdap.run()
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
dapmode.setup({})
|
||||
register_listeners()
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,167 @@
|
||||
local libmodal = require 'libmodal'
|
||||
local daputils = require 'spike.dap.utils'
|
||||
|
||||
local M = {}
|
||||
M.layer = nil
|
||||
_BLOB42_DAPMODE_LOADED = _BLOB42_DAPMODE_LOADED or true
|
||||
|
||||
|
||||
local config = {
|
||||
mappings = {
|
||||
n =
|
||||
{
|
||||
t = { rhs = '<cmd> DapToggleBreakpoint<CR>', desc= '[dap] toggle breakpoint' },
|
||||
T = {
|
||||
rhs = function()
|
||||
require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))
|
||||
end,
|
||||
desc = '[dap] conditional breakpoint',
|
||||
},
|
||||
X = {
|
||||
rhs = function()
|
||||
require('dap').clear_breakpoints()
|
||||
end,
|
||||
desc = '[dap] clear all breakpoints'
|
||||
},
|
||||
c = {
|
||||
rhs = function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
desc = '[dap] continue'
|
||||
},
|
||||
n = {
|
||||
rhs = function()
|
||||
require('dap').step_over()
|
||||
end,
|
||||
desc = '[dap] step over'
|
||||
},
|
||||
s = {
|
||||
rhs = function()
|
||||
require('dap').step_into()
|
||||
end,
|
||||
desc = '[dap] step into'
|
||||
},
|
||||
o = {
|
||||
rhs = function()
|
||||
require('dap').step_out()
|
||||
end,
|
||||
desc = '[dap] step out'
|
||||
},
|
||||
R = {
|
||||
rhs = function()
|
||||
require('dap').run_last()
|
||||
end,
|
||||
desc = '[dap] restart'
|
||||
},
|
||||
S = {
|
||||
rhs = function()
|
||||
daputils.disconnect_dap()
|
||||
-- M.layer:exit() -- already done in dap listener
|
||||
vim.cmd("redrawstatus")
|
||||
end,
|
||||
desc = '[dap] stop'
|
||||
},
|
||||
K = {
|
||||
rhs = function()
|
||||
require('dap.ui.widgets').hover()
|
||||
end,
|
||||
desc = '[dap] hover'
|
||||
},
|
||||
C = {
|
||||
rhs = function()
|
||||
require('dap').run_to_cursor()
|
||||
end,
|
||||
desc = '[dap] run to curosr'
|
||||
},
|
||||
W = {
|
||||
rhs = function()
|
||||
require('dapui').float_element('watches')
|
||||
end,
|
||||
desc = '[dapui] float watches'
|
||||
},
|
||||
P = {
|
||||
rhs = function()
|
||||
require('dapui').float_element('scopes')
|
||||
end,
|
||||
desc = '[dapui] float scopes'
|
||||
},B = {
|
||||
rhs = function()
|
||||
require('dapui').float_element('breakpoints')
|
||||
end,
|
||||
desc = '[dapui] float breakpoints'
|
||||
},
|
||||
O = {
|
||||
rhs = function()
|
||||
require('dapui').float_element('scopes')
|
||||
end,
|
||||
desc = '[dapui] float scopes'
|
||||
},
|
||||
['Q'] = {
|
||||
rhs = function()
|
||||
M.layer:exit()
|
||||
vim.cmd.redrawstatus()
|
||||
end,
|
||||
desc = '[dap] exit dap mode'
|
||||
},
|
||||
-- WIP: use which-key for key mappings help
|
||||
-- ["?"] = {
|
||||
-- rhs = function()
|
||||
-- local wk = require("which-key")
|
||||
-- wk.show("?", "n")
|
||||
-- end
|
||||
-- }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
M.config = config
|
||||
|
||||
-- WIP: use which-key for key mappings help
|
||||
-- local function wk_reg_keys()
|
||||
-- local wk = require("which-key")
|
||||
-- local wk_dapmode = {
|
||||
-- name = "dap", -- section name
|
||||
-- }
|
||||
-- local wk_opts = {
|
||||
-- mode = "n",
|
||||
-- prefix = "?",
|
||||
-- -- noremap = true,
|
||||
-- }
|
||||
-- for key, data in pairs(config.mappings.n) do
|
||||
-- wk_dapmode[key] = { data.desc }
|
||||
-- end
|
||||
-- wk.register(wk_dapmode, wk_opts)
|
||||
-- end
|
||||
|
||||
|
||||
function M.start()
|
||||
if M.layer == nil then
|
||||
M.layer = libmodal.layer.new(config.mappings)
|
||||
end
|
||||
-- wk_reg_keys()
|
||||
M.layer:enter()
|
||||
end
|
||||
|
||||
function M.stop()
|
||||
if M.layer ~= nil and
|
||||
M.layer:is_active() then
|
||||
M.layer:exit()
|
||||
end
|
||||
end
|
||||
|
||||
function M.setup (opts)
|
||||
config = vim.tbl_deep_extend('force', config, opts or {})
|
||||
end
|
||||
|
||||
function M.is_active()
|
||||
if M.layer == nil then return false end
|
||||
return M.layer:is_active()
|
||||
end
|
||||
|
||||
|
||||
-- layer:map('n', '<Esc>', function() layer:exit() end, {})
|
||||
-- --
|
||||
-- layer:enter()
|
||||
--
|
||||
|
||||
return M
|
@ -0,0 +1,216 @@
|
||||
local present, dap = pcall(require, "dap")
|
||||
if not present then
|
||||
print("nvim-dap missing !")
|
||||
return
|
||||
end
|
||||
local api = vim.api
|
||||
local dapmode = require("spike.dap.dapmode")
|
||||
local daputils = require('spike.dap.utils')
|
||||
local dapui = require("dapui")
|
||||
|
||||
local liblldb_path = vim.fn.stdpath("data") .. "/mason/packages/codelldb/extension/lldb/lib/liblldb.so"
|
||||
local adapter_path = vim.fn.stdpath('data') .. '/mason/packages/codelldb/extension/adapter/codelldb'
|
||||
|
||||
local M = {}
|
||||
M.signs = {
|
||||
DapBreakpoint = {
|
||||
icon = '',
|
||||
hl = 'DapBreakpoint'
|
||||
},
|
||||
DapLogPoint = {
|
||||
icon = 'ﳁ',
|
||||
hl = 'DapLogPoint',
|
||||
},
|
||||
DapStopped = {
|
||||
icon = '',
|
||||
hl = 'DapStopped',
|
||||
},
|
||||
DapBreakpointCondition = {
|
||||
icon = '',
|
||||
hl = 'DapBreakpointCondition',
|
||||
},
|
||||
DapBreakpointRejected = {
|
||||
icon = '',
|
||||
hl = 'DapBreakpointRejected'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
local function register_listeners()
|
||||
dap.listeners.before['event_initialized']['blob42-dap'] = function(_, _)
|
||||
dapmode.start()
|
||||
dapui.open()
|
||||
daputils.register_keymaps()
|
||||
end
|
||||
|
||||
dap.listeners.after['event_terminated']['blob42-dap'] = function(_, _)
|
||||
-- print("dap session ended")
|
||||
dapmode.stop()
|
||||
dapui.close()
|
||||
daputils.unregister_keymaps()
|
||||
end
|
||||
dap.listeners.after['event_exited']['blob42-dap'] = function(_, _)
|
||||
-- print("dap session ended")
|
||||
dapmode.stop()
|
||||
dapui.close()
|
||||
daputils.unregister_keymaps()
|
||||
end
|
||||
end
|
||||
|
||||
function M.go_debug()
|
||||
local ok, gdap = pcall(require, "go.dap")
|
||||
if ok then gdap.run() end
|
||||
end
|
||||
|
||||
local function set_signs()
|
||||
for sign, conf in pairs(M.signs) do
|
||||
vim.fn.sign_define(sign, {text = conf.icon, texthl=conf.hl})
|
||||
end
|
||||
end
|
||||
|
||||
local function dap_setup()
|
||||
-- set default externalTerminal
|
||||
dap.defaults.fallback.external_terminal = {
|
||||
command = "/usr/bin/alacritty",
|
||||
args = {
|
||||
"--class",
|
||||
"dap",
|
||||
"-o",
|
||||
"window.dimensions.lines=30",
|
||||
"-o",
|
||||
"window.dimensions.columns=100",
|
||||
"-e"
|
||||
}
|
||||
}
|
||||
|
||||
-- dap.adapters["codelldb-c"] = {
|
||||
-- type = 'server',
|
||||
-- host = "127.0.0.1",
|
||||
-- port = "${port}",
|
||||
-- executable = {
|
||||
-- command = "/home/spike/.local/share/nvim/mason/packages/codelldb/extension/adapter/codelldb",
|
||||
-- args = {"--liblldb", liblldb_path,"--port", "${port}"},
|
||||
-- }
|
||||
-- }
|
||||
|
||||
|
||||
dap.adapters["codelldb-c"] = {
|
||||
type = 'server',
|
||||
host = "127.0.0.1",
|
||||
port = "${port}",
|
||||
executable = {
|
||||
|
||||
command = adapter_path,
|
||||
args = {"--liblldb", liblldb_path,"--port", "${port}"},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- NOTE: if compilation is done in diffferent folder then debugging workind
|
||||
-- dir (like using symlinked folder when building) source maps are needed
|
||||
-- "sourceMap": { "/build/time/source/path" : "/current/source/path" }
|
||||
dap.configurations.c = {
|
||||
{
|
||||
-- If you get an "Operation not permitted" error using this, try disabling YAMA:
|
||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
name = "Attach to process",
|
||||
type = 'codelldb-c', -- Adjust this to match your adapter name (`dap.adapters.<name>`)
|
||||
request = 'attach',
|
||||
pid = require('dap.utils').pick_process,
|
||||
args = {},
|
||||
},
|
||||
{
|
||||
name = "Launch file",
|
||||
type = "codelldb-c",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input("path to exe: ", vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
-- runInTerminal = true, -- use external terminal
|
||||
},
|
||||
|
||||
{
|
||||
name = "Launch file (custom args)",
|
||||
type = "codelldb-c",
|
||||
request = "launch",
|
||||
program = function()
|
||||
-- local custom_args = vim.ui.input({ prompt = "custom args: "}
|
||||
return vim.fn.input("path to exe: ", vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = function()
|
||||
local args = vim.fn.input("args: ", "")
|
||||
-- return a table of args
|
||||
return vim.split(args, "%s+")
|
||||
end
|
||||
-- runInTerminal = true,
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.go ={
|
||||
{
|
||||
name = "Debug current package" ,
|
||||
type = "go",
|
||||
request = "launch" ,
|
||||
mode = "debug" ,
|
||||
remotePath = "" ,
|
||||
port = 38697,
|
||||
host = " 127.0.0.1" ,
|
||||
program = " ${fileDirname}" ,
|
||||
env = {
|
||||
},
|
||||
args = {" daemon" },
|
||||
cwd = " ${workspaceFolder}" ,
|
||||
envFile = " ${workspaceFolder}/.env"
|
||||
},
|
||||
{
|
||||
name = "Attach main" ,
|
||||
type = "go" ,
|
||||
request = "attach" ,
|
||||
mode = "debug" ,
|
||||
remotePath = "" ,
|
||||
port = 38697,
|
||||
host = " 127.0.0.1" ,
|
||||
program = "${workspaceFolder}/main.go" ,
|
||||
env = {},
|
||||
args = {},
|
||||
cwd = "${workspaceFolder}" ,
|
||||
processId = "" ,
|
||||
envFile = "${workspaceFolder}/.env" ,
|
||||
buildFlags = ""
|
||||
},
|
||||
{
|
||||
name = "Launch file",
|
||||
type = "go",
|
||||
request = "launch",
|
||||
mode = "debug",
|
||||
program = "${file}"
|
||||
},
|
||||
{
|
||||
name = "Attach process",
|
||||
type = "go", -- Adjust this to match your adapter name (`dap.adapters.<name>`)
|
||||
request = "attach",
|
||||
mode = "local",
|
||||
processId = require('dap.utils').pick_process,
|
||||
args = {},
|
||||
},
|
||||
}
|
||||
|
||||
end
|
||||
|
||||
function M.prepare_launch()
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
dap_setup()
|
||||
dapmode.setup({})
|
||||
register_listeners()
|
||||
set_signs()
|
||||
daputils.load_launch_json()
|
||||
end
|
||||
|
||||
|
||||
return M
|
@ -0,0 +1,84 @@
|
||||
---@diagnostic disable: redefined-local
|
||||
local ok, dap = pcall(require, 'dap')
|
||||
if not ok then
|
||||
vim.notify('dap module missing')
|
||||
end
|
||||
-- local api = vim.api
|
||||
-- local keymap_restore = {}
|
||||
|
||||
local M = {}
|
||||
|
||||
M.disconnect_dap = function()
|
||||
local has_dap, dap = pcall(require, 'dap')
|
||||
local _, dapui = pcall(require, 'dapui')
|
||||
|
||||
if has_dap then
|
||||
dap.disconnect()
|
||||
dap.repl.close()
|
||||
dapui.close()
|
||||
vim.cmd('sleep 100m') -- allow cleanup
|
||||
else
|
||||
vim.notify('dap not found')
|
||||
end
|
||||
end
|
||||
|
||||
M.dap_logpoint = function()
|
||||
vim.ui.input({ prompt = 'Logpoint message> '}, function (input)
|
||||
dap.set_breakpoint(nil,nil,input)
|
||||
end)
|
||||
end
|
||||
|
||||
-- if there are no breakpoints in the project set a breakpoint on the current
|
||||
-- line
|
||||
M.init_breakpoints = function()
|
||||
-- see https://github.com/rcarriga/nvim-dap-ui/blob/master/lua/dapui/state.lua
|
||||
-- for a reference to access dap breakpoint details
|
||||
local breakpoints = require('dap.breakpoints').get() or {}
|
||||
if #breakpoints == 0 then
|
||||
dap.set_breakpoint()
|
||||
end
|
||||
end
|
||||
|
||||
--- Load the DAP launch.json file
|
||||
--- If the file does not exist, create it at the default location.
|
||||
M.load_launch_json = function()
|
||||
local Path = require("plenary.path")
|
||||
local fpath = Path:new(vim.fn.getcwd() .. "/.vscode/launch.json")
|
||||
-- if path does not exist print message
|
||||
if not fpath:exists() then
|
||||
vim.notify('launch.json not found at ' .. fpath.filename)
|
||||
return
|
||||
end
|
||||
require("dap.ext.vscode").load_launchjs()
|
||||
end
|
||||
|
||||
-- NOTE: dapmode handles keymaps for now
|
||||
-- manually setting keymaps
|
||||
-- Map K to hover while session is active https://github.com/mfussenegger/nvim-dap/wiki/Cookbook#map-k-to-hover-while-session-is-active
|
||||
-- see: update with https://github.com/jonboh/nvim-dap-rr/blob/f1678d5524aac8321c538883e77daa17d6be44f5/lua/nvim-dap-rr.lua
|
||||
M.register_keymaps = function()
|
||||
-- for _, buf in pairs(api.nvim_list_bufs()) do
|
||||
-- local keymaps = api.nvim_buf_get_keymap(buf, 'n')
|
||||
-- for _, keymap in pairs(keymaps) do
|
||||
-- if keymap.lhs == "K" then
|
||||
-- table.insert(keymap_restore, keymap)
|
||||
-- api.nvim_buf_del_keymap(buf, 'n', 'K')
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- api.nvim_set_keymap(
|
||||
-- 'n', 'K', '<cmd>lua require("dap.ui.widgets").hover()<CR>',
|
||||
-- {silent = true}
|
||||
-- )
|
||||
end
|
||||
|
||||
M.unregister_keymaps = function()
|
||||
-- vim.keymap.del('n', 'K', {silent=true})
|
||||
-- for _,keymap in pairs(keymap_restore) do
|
||||
-- vim.keymap.set(keymap.mode, keymap.lhs, keymap.rhs or keymap.callback,
|
||||
-- {buffer=keymap.buffer, silent=keymap.silent==1})
|
||||
-- end
|
||||
-- keymap_restore = {}
|
||||
end
|
||||
|
||||
return M
|
@ -1,114 +0,0 @@
|
||||
local libmodal = require "libmodal"
|
||||
|
||||
M = {}
|
||||
M.layer = nil
|
||||
|
||||
local config = {
|
||||
mappings = {
|
||||
n =
|
||||
{
|
||||
t = { rhs = '<cmd> DapToggleBreakpoint<CR>', desc= "[dap] toggle breakpoint" },
|
||||
T = {
|
||||
rhs = function()
|
||||
require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))
|
||||
end,
|
||||
desc = "[dap] conditional breakpoint",
|
||||
},
|
||||
c = {
|
||||
rhs = function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
desc = "[dap] continue"
|
||||
},
|
||||
n = {
|
||||
rhs = function()
|
||||
require('dap').step_over()
|
||||
end,
|
||||
desc = "[dap] step over"
|
||||
},
|
||||
s = {
|
||||
rhs = function()
|
||||
require('dap').step_into()
|
||||
end,
|
||||
desc = '[dap] step into'
|
||||
},
|
||||
o = {
|
||||
rhs = function()
|
||||
require('dap').step_out()
|
||||
end,
|
||||
desc = '[dap] step out'
|
||||
},
|
||||
r = {
|
||||
rhs = function()
|
||||
require('go.dap').run()
|
||||
end,
|
||||
desc = '[dap] run'
|
||||
},
|
||||
S = {
|
||||
rhs = function()
|
||||
require('go.dap').stop()
|
||||
end,
|
||||
desc = "[dap] stop"
|
||||
},
|
||||
C = {
|
||||
rhs = function()
|
||||
require('dap').run_to_cursor()
|
||||
end,
|
||||
desc = "[dap] run to curosr"
|
||||
},
|
||||
W = {
|
||||
rhs = function()
|
||||
require("dapui").float_element('watches')
|
||||
end,
|
||||
desc = '[dapui] float watches'
|
||||
},
|
||||
B = {
|
||||
rhs = function()
|
||||
require("dapui").float_element('breakpoints')
|
||||
end,
|
||||
desc = '[dapui] float breakpoints'
|
||||
},
|
||||
O = {
|
||||
rhs = function()
|
||||
require("dapui").float_element('scopes')
|
||||
end,
|
||||
desc = '[dapui] float scopes'
|
||||
},
|
||||
["Q"] = {
|
||||
rhs = function()
|
||||
M.layer:exit()
|
||||
end,
|
||||
desc = "[dap] exit dap mode"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function M.start()
|
||||
if M.layer == nil then
|
||||
M.layer = libmodal.layer.new(config.mappings)
|
||||
end
|
||||
M.layer:enter()
|
||||
end
|
||||
|
||||
function M.stop()
|
||||
if M.layer ~= nil then M.layer:exit() end
|
||||
end
|
||||
|
||||
function M.setup (opts)
|
||||
config = vim.tbl_deep_extend("force", config, opts or {})
|
||||
end
|
||||
|
||||
function M.is_active()
|
||||
if M.layer == nil then return false end
|
||||
return M.layer:is_active()
|
||||
end
|
||||
|
||||
|
||||
-- layer:map('n', '<Esc>', function() layer:exit() end, {})
|
||||
-- --
|
||||
-- layer:enter()
|
||||
--
|
||||
|
||||
return M
|
@ -0,0 +1,66 @@
|
||||
local M = {}
|
||||
|
||||
M.shown = true
|
||||
|
||||
-- toggle diagnostics with show/hide
|
||||
M.toggle = function()
|
||||
if M.shown then
|
||||
M.shown = false
|
||||
return vim.diagnostic.hide()
|
||||
end
|
||||
|
||||
|
||||
M.shown = true
|
||||
vim.diagnostic.show()
|
||||
end
|
||||
|
||||
local orig_diag_virt_handler = vim.diagnostic.handlers.virtual_text
|
||||
local ns = vim.api.nvim_create_namespace("my_diagnostics")
|
||||
|
||||
local filter_diagnostics = function(diagnostics, level, bufnr)
|
||||
assert(bufnr, "bufnr is required")
|
||||
local filtered_diag = {}
|
||||
if level == -1 then return {} end
|
||||
if not diagnostics then return {} end
|
||||
for _, d in ipairs(diagnostics) do
|
||||
if d.severity <= level then
|
||||
-- check if diagnostic line is out of range in current buffer
|
||||
local lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, true)
|
||||
if d.end_lnum <= #lines then
|
||||
table.insert(filtered_diag, 1, d)
|
||||
end
|
||||
end
|
||||
end
|
||||
return filtered_diag
|
||||
end
|
||||
|
||||
--NOTE: apply diagnostics filter to current buffer / all buffers
|
||||
M.set_diagnostics_level = function(level)
|
||||
|
||||
|
||||
vim.diagnostic.handlers.virtual_text = {
|
||||
show = function(_, bufnr, _, opts)
|
||||
-- get all diagnostics for local buffer
|
||||
local diagnostics = vim.diagnostic.get(bufnr)
|
||||
local filtered = filter_diagnostics(diagnostics, level, bufnr)
|
||||
-- filter diags based on severity
|
||||
orig_diag_virt_handler.show(ns, bufnr, filtered, opts)
|
||||
end,
|
||||
hide = function(_, bufnr)
|
||||
orig_diag_virt_handler.hide(ns, bufnr)
|
||||
end
|
||||
}
|
||||
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
-- hide all diagnostics
|
||||
vim.diagnostic.hide(nil, bufnr)
|
||||
|
||||
local diags = vim.diagnostic.get(bufnr)
|
||||
if #diags > 0 then
|
||||
local filtered = filter_diagnostics(diags, level, bufnr)
|
||||
vim.diagnostic.show(ns, bufnr, filtered)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return M
|
@ -1,19 +0,0 @@
|
||||
M = {}
|
||||
M.shown = true
|
||||
|
||||
-- toggle diagnostics with show/hide
|
||||
M.toggle_diagnostics = function ()
|
||||
if M.shown then
|
||||
M.shown = false
|
||||
return vim.diagnostic.hide()
|
||||
end
|
||||
vim.diagnostic.show()
|
||||
M.shown = true
|
||||
end
|
||||
|
||||
-- my customized attach
|
||||
-- M.custom_attach = function(client, bufnr)
|
||||
-- end
|
||||
|
||||
|
||||
return M
|
@ -0,0 +1,33 @@
|
||||
---@diagnostic disable: unused-local
|
||||
|
||||
local ls = require("luasnip")
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
local rep = require("luasnip.extras").rep
|
||||
-- local isn = ls.indent_snippet_node
|
||||
-- local d = ls.dynamic_node
|
||||
-- local r = ls.restore_node
|
||||
-- local events = require("luasnip.util.events")
|
||||
-- local ai = require("luasnip.nodes.absolute_indexer")
|
||||
-- local extras = require("luasnip.extras")
|
||||
-- local m = extras.m
|
||||
-- local l = extras.l
|
||||
-- local rep = extras.rep
|
||||
-- local postfix = require("luasnip.extras.postfix").postfix
|
||||
--
|
||||
-- add_snippet helper
|
||||
local add_snippet = require("spike.snips").add_snippet
|
||||
|
||||
|
||||
--HACK: remove after testing snippets or it resets all imported snippets
|
||||
-- require("luasnip.session.snippet_collection").clear_snippets "lua"
|
||||
|
||||
add_snippet {
|
||||
lua = {
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
local ok, ls = pcall(require, "luasnip")
|
||||
if not ok then return end
|
||||
|
||||
-- luasnip helpers
|
||||
|
||||
local M = {}
|
||||
|
||||
---shortcut for ls.add_snippet(ft, {defs})
|
||||
---@param args table arguments in the form {ft, snippet_defs}
|
||||
M.add_snippet = function(args)
|
||||
for ft,sn_defs in pairs(args) do
|
||||
ls.add_snippets(ft, sn_defs, {override_priority=2000})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return M
|
@ -0,0 +1,58 @@
|
||||
local ok, null_ls = pcall(require, 'null-ls')
|
||||
if not ok then
|
||||
vim.notify("missing module null-ls", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
|
||||
_ = require('dressing')
|
||||
|
||||
local M = {}
|
||||
|
||||
M.register_sources = function()
|
||||
local sources = require('custom.plugins.configs.null-ls').extra_sources
|
||||
vim.ui.select(sources, {
|
||||
prompt = "select source to register:",
|
||||
format_item = function (item)
|
||||
local enabled = null_ls.is_registered({ name = item.name})
|
||||
local entry = enabled and '' or ''
|
||||
local filetypes = ''
|
||||
for _, ft in ipairs(item.filetypes) do
|
||||
filetypes = filetypes .. ft .. '|'
|
||||
end
|
||||
filetypes = filetypes:gsub('|$', '')
|
||||
|
||||
local entry_text = string.format("%s %-20s%s", entry, item.name, filetypes)
|
||||
-- return entry .. ' ' .. item.name .. '\t\t' .. filetypes
|
||||
return entry_text
|
||||
end,
|
||||
}, function(item)
|
||||
if item then null_ls.register(item) end
|
||||
end)
|
||||
end
|
||||
|
||||
M.select_sources = function()
|
||||
local sources = null_ls.get_sources()
|
||||
--
|
||||
--TODO: add entry to disable / activate all aka disable null-ls
|
||||
vim.ui.select(sources, {
|
||||
prompt = "select source to toggle:",
|
||||
format_item = function (item)
|
||||
local entry = item._disabled and '' or ''
|
||||
|
||||
local filetypes = ''
|
||||
for ft, _ in pairs(item.filetypes) do
|
||||
filetypes = filetypes .. ft .. '|'
|
||||
end
|
||||
filetypes = filetypes:gsub('|$', '')
|
||||
|
||||
entry_text = string.format("%s %-20s%s", entry, item.name, filetypes)
|
||||
-- return entry .. ' ' .. item.name .. '\t\t' .. filetypes
|
||||
return entry_text
|
||||
end,
|
||||
}, function(item)
|
||||
if item then null_ls.toggle({name = item.name }) end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
return M
|
@ -1,28 +0,0 @@
|
||||
local M = {}
|
||||
M["unload_lua_ns"] = function (prefix)
|
||||
local prefix_with_dot = prefix .. '.'
|
||||
for key, _ in pairs(package.loaded) do
|
||||
if key == prefix or key:sub(1, #prefix_with_dot) == prefix_with_dot then
|
||||
print("removing: ", key)
|
||||
package.loaded[key] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- M.unload_lua_ns("core")
|
||||
M.list_loaded_modules = function ()
|
||||
local loaded = {}
|
||||
for k, _ in pairs(package.loaded) do
|
||||
loaded[#loaded + 1] = k
|
||||
end
|
||||
vim.ui.select(loaded, {}, nil)
|
||||
|
||||
end
|
||||
|
||||
M.reload_theme = function()
|
||||
require("plenary.reload").reload_module("base46")
|
||||
require("plenary.reload").reload_module("custom.chadrc")
|
||||
require("base46").load_theme()
|
||||
end
|
||||
|
||||
return M
|
@ -0,0 +1,128 @@
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
local api = vim.api
|
||||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
local M = {}
|
||||
|
||||
M["unload_lua_ns"] = function (prefix)
|
||||
local prefix_with_dot = prefix .. '.'
|
||||
for key, _ in pairs(package.loaded) do
|
||||
if key == prefix or key:sub(1, #prefix_with_dot) == prefix_with_dot then
|
||||
print("removing: ", key)
|
||||
package.loaded[key] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- M.unload_lua_ns("core")
|
||||
M.list_loaded_modules = function ()
|
||||
local loaded = {}
|
||||
for k, _ in pairs(package.loaded) do
|
||||
loaded[#loaded + 1] = k
|
||||
end
|
||||
vim.ui.select(loaded, {}, nil)
|
||||
|
||||
end
|
||||
|
||||
M.reload_theme = function()
|
||||
require("plenary.reload").reload_module("base46")
|
||||
require("plenary.reload").reload_module("custom.chadrc")
|
||||
require("base46").load_theme()
|
||||
end
|
||||
|
||||
M.set_plugin_mappings = function(plugin_name, mapping_opt)
|
||||
local mappings = require("core.utils").load_config().mappings[plugin_name]
|
||||
mappings.plugin = nil
|
||||
|
||||
for mode, mode_values in pairs(mappings) do
|
||||
local default_opts = vim.tbl_deep_extend("force", { mode = mode }, mapping_opt or {})
|
||||
for keybind, mapping_info in pairs(mode_values) do
|
||||
-- merge default + user opts
|
||||
local opts = vim.tbl_deep_extend("force", default_opts, mapping_info.opts or {})
|
||||
|
||||
mapping_info.opts, opts.mode = nil, nil
|
||||
opts.desc = mapping_info[2]
|
||||
|
||||
vim.keymap.set(mode, keybind, mapping_info[1], opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- convert timestamp under cursor in milliseconds to a human readable string
|
||||
-- @param timestamp in milliseconds
|
||||
-- @return human readable string
|
||||
M.human_timestamp = function()
|
||||
local cword = vim.fn.expand('<cword>')
|
||||
|
||||
|
||||
-- make sure cword is a number
|
||||
local n = tonumber(cword)
|
||||
if n == nil then return end
|
||||
|
||||
local time = os.date("*t", cword / (1000*1000))
|
||||
local format = string.format("%04d-%02d-%02d %02d:%02d:%02d", time.year, time.month, time.day, time.hour, time.min, time.sec)
|
||||
vim.notify(format, vim.lsp.log_levels.INFO)
|
||||
end
|
||||
|
||||
-- 1663878015759000
|
||||
-- 1670185951498000
|
||||
-- M.human_timestamp()
|
||||
|
||||
--lazy loads a packer plugin when a file matches {patterns}
|
||||
---@param patterns table matched patterns
|
||||
---@param plugin string plugin to load whan pattern is matched
|
||||
M.lazy_load_module = function(patterns, plugin)
|
||||
|
||||
autocmd({"BufRead", "BufNewFile"},{
|
||||
group = api.nvim_create_augroup("blob42_lazyload_plugin", {}),
|
||||
callback = function()
|
||||
|
||||
local bufname = api.nvim_buf_get_name(0)
|
||||
for _,pt in ipairs(patterns) do
|
||||
if vim.fn.fnamemodify(bufname, ":t"):match(pt) then
|
||||
require("packer").loader(plugin)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
M.togglezen = function()
|
||||
if g.zenmode then
|
||||
M.exitzen()
|
||||
else
|
||||
M.zenmode(true)
|
||||
end
|
||||
end
|
||||
|
||||
--- disable all clutter from UI
|
||||
---@param full? boolean maximum zen
|
||||
M.zenmode = function(full)
|
||||
opt.colorcolumn= '0'
|
||||
vim.cmd("TSDisable highlight")
|
||||
if full then
|
||||
vim.cmd("IndentBlanklineDisable")
|
||||
opt.signcolumn = 'no'
|
||||
opt.number = false
|
||||
opt.relativenumber = false
|
||||
opt.cmdheight = 0
|
||||
end
|
||||
g.zenmode = true
|
||||
end
|
||||
|
||||
--- cancel zenmode
|
||||
M.exitzen = function()
|
||||
opt.colorcolumn= '+0'
|
||||
opt.signcolumn = 'yes'
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
opt.cmdheight = 1
|
||||
g.zenmode = false
|
||||
vim.cmd("IndentBlanklineEnable")
|
||||
vim.cmd("TSEnable highlight")
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
|
@ -0,0 +1,37 @@
|
||||
local ok, terminal = pcall(require, 'nvterm.terminal')
|
||||
if not ok then
|
||||
vim.notify("missing module nvterm.terminal", vim.log.levels.WARN)
|
||||
return
|
||||
end
|
||||
local M = {}
|
||||
|
||||
M.last_cmds = {}
|
||||
|
||||
---run cmd using builtin terminal
|
||||
---@alias mode "vertical" | "horizontal" | "float"
|
||||
---@param input string command to be run in term
|
||||
---@param opts? { mode: mode } options
|
||||
M.run_cmd = function(input, opts)
|
||||
opts = opts or { mode = "vertical" }
|
||||
|
||||
|
||||
if input then
|
||||
table.insert(M.last_cmds, 1, input)
|
||||
terminal.send(input, opts.mode)
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
vim.ui.input({ prompt = "float term cmd:> "}, function(linput)
|
||||
table.insert(M.last_cmds, 1, linput)
|
||||
terminal.send(linput, opts.mode)
|
||||
end)
|
||||
end
|
||||
|
||||
M.rerun_last_cmd = function()
|
||||
if #M.last_cmds > 0 then terminal.send(M.last_cmds[1]) end
|
||||
end
|
||||
|
||||
|
||||
|
||||
return M
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue