Merge branch 'master' of gitea.srvlan:sp4ke/my-nvim-lua

master
moonblade 2 years ago
commit e5cbae3d2c

@ -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

146
.github/README.md vendored

@ -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

3
.gitignore vendored

@ -2,4 +2,5 @@ plugin/*compiled.lua
spell
examples
lua/scratch
lua/scratch
.luarc.json

@ -0,0 +1,3 @@
{
"lsp_autostart": true
}

@ -1,3 +0,0 @@
## Git merging with upstream
use the strategy=ours

@ -0,0 +1,2 @@
My nvim config using Lua based on [nvchad](https://nvchad.github.io/)

37
TODO

@ -1,37 +0,0 @@
- use libmodal + whichkey ?
- gisigns: add navigation between hunks (vs fugitive ?)
- optimize git flow
- navigator icons update
- vim-bookmarks disable default keymaps and use manaul ones (keep ma ...)
- Setup telescope/fzf mappings together
- LSP C-i is tab does not allow to jump back into history
- [PLUGIN INDEA] bookmark: take notes
- show messages window outside or floating
- create a bookmark mini plugin/helper for bookmarking paths
- html filetype use pup as auto formatter formatprg (check default vim) ?
- per project lsp settings
see https://www.reddit.com/r/neovim/comments/opipij/guide_tips_and_tricks_to_reduce_startup_and/
- add/read language docs in vim
- vim.diagnostics.hide()/show() /
- create toggle diagnostics that overrides vim diagnostic show handler
- [navigator] use colors for codelens icons
- [navigator] remap C-k keymap
- [navigator] neovim diagnositc toggle (use hide() instead of disable)
- [navigator] check codelens icons
- [navigator] disable diagnostic on startup
- dynamic C-x: if number default or close window
- load custom/init.lua (autocommands) as vimscript file ?
- install neorg (neovim org mode)
- dynamic :w!! (daos or sudo)
[x] [navigator] fix 'gi' keymap overriden by navigator (use space leader)
- welcome screen (use mini)
- incorporate changes in nvchad_ui to override
- [x]nvim C-p should not work in ft=qf
- [x] set neovim shell to bash/sh for faster commands (fish is slow)
- [x] yank until end of line $ mapping automatic with Y
- [x] remove registers from which-key plugin
-fix: problem with auto paused navigators
- [x] fix color/icon of status line diagnostics to match navigator
-[x] pin all plugins
- [x] autocommand move current directory when move to new window

@ -0,0 +1 @@
set formatoptions+=r " auto add comments on line return

@ -1,3 +1,4 @@
augroup my_json
au!
au FileType json set formatprg=jq
aug END

@ -0,0 +1,4 @@
local ok, nvchad = pcall(require, "nvchad")
if not ok then return end
nvchad.reload_theme("ayu-dark")

@ -0,0 +1 @@
set cursorline

@ -1,17 +1,22 @@
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 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,
},
InlayHint = {
fg = "#a9a19a",
},
Comment = {
fg = c.change_hex_lightness(colors["one_bg"], 20),
},
}
function set_hl()
@ -22,3 +27,4 @@ end
-- setup section
set_hl()

@ -0,0 +1,3 @@
; extends
((field) ",") @myfield

@ -2,3 +2,7 @@ snippet fn
function()
$0
end
snippet lm
local M = {}
$0

@ -1,3 +0,0 @@
snippet li "zk link to note"
[${1:${VISUAL:name}}](${2:id}) $0

@ -0,0 +1,3 @@
snippet lnd
println!("{:?}", $1);

@ -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)

@ -2,7 +2,7 @@ vim.defer_fn(function()
pcall(require, "impatient")
end, 0)
require "sp4ke.globals"
require "spike.globals"
require "core"
require "core.options"

@ -0,0 +1,13 @@
NVIM v0.9.0-dev-77-gf175ca9f7
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -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/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az47-468
Features: +acl +iconv +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

@ -29,10 +29,10 @@ opt.rulerformat = "%30(%=:b%n%y%m%r%w %l,%c%V %P%)" -- NvChad has custom ruler !
-- Indenting
opt.expandtab = true -- Tabs are spaces, not tabs
opt.shiftwidth = 2 -- use indents of 2 spaces
opt.shiftwidth = 4 -- use indents of 2 spaces
opt.smartindent = true -- smart indent when starting new lines
opt.tabstop = 2 -- number of spaces when tab pressed
opt.softtabstop = 2 -- Let backspace delete indent
opt.tabstop = 4 -- number of spaces when tab pressed
opt.softtabstop = 4 -- Let backspace delete indent
-- http://vim.wikia.com/wiki/Converting_tabs_to_spaces
opt.tabpagemax = 10
@ -62,8 +62,8 @@ opt.iskeyword:remove("-")
--
-- folding with tree sitter
-- set foldmethod=expr
-- set foldexpr=nvim_treesitter#foldexpr()
-- opt.foldmethod=expr
-- opt.foldexpr="nvim_treesitter#foldexpr()"
--
opt.foldminlines = 2
opt.foldlevelstart = 0
@ -78,9 +78,11 @@ opt.formatoptions:append("b") -- Auto-wrap text based on textwidt
opt.matchpairs:append("<:>")
opt.guicursor = {"n-v-c-sm:block-blinkwait50-blinkon200-blinkoff200", "i-ci-ve:ver25", "r-cr-o:hor20"}
-- Lines to scroll when cursor leaves screen
opt.scrolljump=5
opt.scrolloff=3
opt.scrolloff=2
-- Allow :find to work on all subdirectories
-- this only works when the original dir path is not changed
@ -96,9 +98,21 @@ g.netrw_winsize = 20 -- width of the window (25%)
opt.signcolumn = "yes"
-- opt.signcolumn = "auto:1-3" -- accommodate up to 3 icons
opt.splitbelow = true
opt.splitright = true
opt.termguicolors = true
-- if vim.fn.exists("+termguicolors") then
-- vim.go.t_8f = "<Esc>[38:2:%lu:%lu:%lum"
-- vim.go.t_8b = "<Esc>[48:2:%lu:%lu:%lum"
-- end
if vim.g.neovide then
opt.g.neovide_cursor_trail_size=0.3
opt.g.neovide_cursor_animation_length=0.10
opt.guifont = "ProFontIIx Nerd Font Mono:h10"
end
opt.timeoutlen = 400
opt.undofile = true
@ -107,7 +121,6 @@ opt.backup = true
opt.backupcopy = "yes"
opt.backupdir = vim.fn.expand("~/.local/share/nvim/backups")
opt.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,resize,winpos"
g.sp4ke_bookmark_dir = vim.fn.stdpath("data") .. '/bookmarks'
-- interval for writing swap file to disk, also used by gitsigns
opt.updatetime = 250

@ -2,6 +2,7 @@ local M = {}
M.options = {
auto_clean = true,
-- log = { level = 'debug'},
compile_on_sync = true,
git = { clone_timeout = 6000 },
display = {

@ -5,135 +5,151 @@ local M = {}
-- make sure you maintain the structure of `core/default_config.lua` here,
-- example of changing theme:
--
-- local custom_theme = require("sp4ke.theme")
-- local custom_theme = require("spike.theme")
-- vim.tbl_deep_extend("force", M.ui.hl_add, custom_theme)
M.ui = {
theme = "monekai",
theme_toggle = { "monekai", "blossom" },
hl_override = {
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"
},
},
hl_add = {
Visual = {
bg = "blue",
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,
},
DiagnosticUnderlineError = {
fg="black",
bg="pink",
},
-- 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",
theme = "monekai",
theme_toggle = { "monekai", "gruvbox_light" },
hl_override = {
CursorLine = {
bg = "one_bg3"
},
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"
},
},
hl_add = {
Visual = {
bg = "blue",
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,
},
DiagnosticUnderlineError = {
fg = "black",
bg = "pink",
},
-- 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 = "#ff4848",
bg = "one_bg3",
},
},
St_DapModeSep2 = {
fg = "grey",
bg = "baby_pink",
-- hl_override = {
-- CursorLine = {
-- underline = 1
-- }
-- },
myicons = {
lsp = {
diagnostic_head = '', -- default diagnostic head on dialogs
diagnostic_err = '', -- severity 1
diagnostic_warn = '', -- 2
diagnostic_info = '', -- 3
diagnostic_hint = '', -- 4
}
},
},
-- hl_override = {
-- CursorLine = {
-- underline = 1
-- }
-- },
myicons = {
lsp = {
diagnostic_head = '', -- default diagnostic head on dialogs
diagnostic_err = '', -- severity 1
diagnostic_warn = '', -- 2
diagnostic_info = '', -- 3
diagnostic_hint = '', -- 4
}
},
}
M.plugins = {
user = require "custom.plugins",
override = {
["folke/which-key.nvim"] = {
triggers_blacklist = {
-- list of mode / prefixes that should never be hooked by WhichKey
i = { "j", "k" },
v = { "j", "k" },
},
},
["NvChad/ui"] = {
-- tabufline = {
-- lazyload = false,
-- },
statusline = {
overriden_modules = function()
return require "custom.plugins.nvchadui"
end
}
user = require "custom.plugins",
override = {
["NvChad/ui"] = {
-- tabufline = {
-- lazyload = false,
-- },
statusline = {
overriden_modules = function()
return require "custom.plugins.nvchadui"
end
}
},
["windwp/nvim-autopairs"] = {
disable_filetype = {
"TelescopePrompt",
"vim",
"guihua",
"guihua_rust",
"clap_input"
}
},
["nvim-treesitter/nvim-treesitter"] = require "custom.plugins.configs.treesitter",
},
["windwp/nvim-autopairs"] = {
disable_filetype = {
"TelescopePrompt",
"vim",
"guihua",
"guihua_rust",
"clap_input"
}
},
["nvim-treesitter/nvim-treesitter"] = require "custom.plugins.configs.treesitter",
}
}

@ -37,13 +37,14 @@ vim.cmd [[
-- suckless {
vim.cmd [[
" Autocompile suckless
let dwm_file_patterns = expand("$HOME/.local/src/suckless/*/{config.h,*.c}")
" NOTE: symlinks do not work with autocommand patterns
let dwm_file_patterns = expand("/data/source/suckless/*/{config.h,*.c}")
augroup DWM
au!
execute "au BufEnter " . dwm_file_patterns . " :lcd %:p:h"
execute "au BufWrite " . dwm_file_patterns . " :AsyncRun! make clean && make && sudo make install"
execute "au BufWritePost " . dwm_file_patterns . " :AsyncRun! make clean && make && sudo make install"
"au BufWrite */src/*/dwm*/{*.h,dwm.c} :AsyncRun! make clean && make && sudo make install
augroup END
]]

@ -0,0 +1,10 @@
-- local dap = require("dap")
local M = {}
local opts = {
}
M.setup = function()
end
return M

@ -0,0 +1,82 @@
local dapui = require('dapui')
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 = vim.fn.has("nvim-0.7") == 1,
-- 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.25 },
"breakpoints",
"stacks",
-- "watches",
},
size = 40, -- 40 columns
position = "left",
},
{
elements = {
"repl",
"watches"
-- "console",
},
size = 0.25, -- 25% of total lines
position = "bottom",
},
},
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 = {
max_height = nil, -- These can be integers or a float between 0 and 1.
max_width = nil, -- Floats will be treated as percentage of your screen.
border = "single", -- Border style. Can be "single", "double" or "rounded"
mappings = {
close = { "q", "<Esc>" },
},
},
windows = { indent = 1 },
render = {
max_type_length = nil, -- Can be integer or nil.
max_value_lines = 100, -- Can be integer or nil.
}
}
M.setup = function()
dapui.setup(opts)
end
return M

@ -2,7 +2,7 @@ local M = {}
local config = {
-- verbose = true,
run_in_floaterm = true,
run_in_floaterm = false,
icons = false,
-- icons = { breakpoint = "🧘", currentpos = "🏃" }, -- set to false to disable
lsp_cfg = false, -- handled handled instead by navigator

@ -0,0 +1,36 @@
local ok, iron = pcall(require, "iron.core")
if not ok then return end
local M = {}
local ironSetup = {
config = {
scratch_repl = true,
highlight_last = "IronLastSent",
repl_definition = {
sh = {
command = {"sh"}
},
python = require("iron.fts.python").ipython,
},
repl_open_cmd = require('iron.view').bottom(20),
},
keymaps = {
send_motion = "<leader>io",
visual_send = "<leader>io",
send_file = "<leader>ii",
send_line = "<leader>il",
cr = "<leader>i<cr>",
interrupt = "<leader>i<leader>",
exit = "<leader>iq"
}
}
function M.setup()
iron.setup(ironSetup)
end
return M
-- M.setup()

@ -0,0 +1,42 @@
local M = {}
local opts = {
defaults = {
enable_highlighting = true,
inline_highlighting = true,
hl_groups = {
insertion = "DiffAdd",
deletion = "DiffDelete",
change = "DiffChange",
},
},
debug = true,
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,37 @@
local present, luasnip = pcall(require, "luasnip")
if not present then
return
end
local types = require("luasnip.util.types")
local options = {
history = true,
updateevents = "TextChanged,TextChangedI",
ext_opts = {
[types.choiceNode] = {
passive = {
virt_text = { { "", "LuaSnipChoice" } },
}
}
},
}
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

@ -31,9 +31,10 @@ local config = {
{ key = '<Leader>gT', func = require('navigator.treesitter').bufs_ts, desc = 'lsp bufs_ts' },
{ key = '<Leader>ct', func = require('navigator.ctags').ctags, desc = 'lsp ctags' },
{ key = 'K', func = vim.lsp.buf.hover, desc = 'lsp hover' },
{ key = '<C-a>', mode = 'n', func = require('navigator.codeAction').code_action, desc = 'lsp code_action' },
{ key = '<M-a>', mode = 'n', func = require('navigator.codeAction').code_action, desc = 'lsp code_action' },
{ key = '<M-a>', mode = 'i', func = require('navigator.codeAction').code_action, desc = 'lsp code_action' },
{
key = '<C-a>',
key = '<M-a>',
mode = 'v',
func = require('navigator.codeAction').range_code_action,
desc = 'lsp range_code_action',
@ -47,7 +48,7 @@ local config = {
{ key = 'gL', func = require('navigator.diagnostics').show_diagnostics, desc = 'lsp show_diagnostics' },
{ key = 'gG', func = require('navigator.diagnostics').show_buf_diagnostics, desc = 'lsp show_buf_diagnostics' },
-- { key = '<Leader>dt', func = require('navigator.diagnostics').toggle_diagnostics, desc = 'lsp toggle_diagnostics' },
{ key = '<Leader>dt', func = require('sp4ke.lsp').toggle_diagnostics, desc = 'lsp toggle_diagnostics' },
{ key = '<Leader>td', func = require('spike.lsp').toggle_diagnostics, desc = 'lsp toggle_diagnostics' },
{ key = ']d', func = vim.diagnostic.goto_next, desc = 'lsp next diagnostics' },
{ key = '[d', func = vim.diagnostic.goto_prev, desc = 'lsp prev diagnostics' },
{ key = ']O', func = vim.diagnostic.set_loclist, desc = 'lsp diagnostics set loclist' },
@ -56,13 +57,13 @@ local config = {
{ key = '<C-LeftMouse>', func = vim.lsp.buf.definition, desc = 'lsp definition' },
{ key = 'g<LeftMouse>', func = vim.lsp.buf.implementation, desc = 'lsp implementation' },
{ key = '<Leader>k', func = require('navigator.dochighlight').hi_symbol, desc = 'lsp hi_symbol' },
{ key = '<Space>wa', func = require('navigator.workspace').add_workspace_folder, desc = 'lsp add_workspace_folder' },
{ key = '<leader>wa', func = require('navigator.workspace').add_workspace_folder, desc = 'lsp add_workspace_folder' },
{
key = '<Space>wr',
key = '<leader>wr',
func = require('navigator.workspace').remove_workspace_folder,
desc = 'lsp lsp remove_workspace_folder',
},
{ key = '<Space>ff', func = vim.lsp.buf.format, mode = 'n', desc = 'lsp format' },
{ key = '<space>fm', func = vim.lsp.buf.format, mode = 'n', desc = 'lsp format' },
-- { key = '<Space>ff', func = vim.lsp.buf.range_formatting, mode = 'v', desc = 'lsp range format' },
-- DEPRECATED
-- {
@ -71,8 +72,8 @@ local config = {
-- mode = 'n',
-- desc = 'lsp range format operator e.g gmip',
-- },
{ key = '<Space>wl', func = require('navigator.workspace').list_workspace_folders, desc = 'lsp list_workspace_folders' },
{ key = '<Space>la', mode = 'n', func = require('navigator.codelens').run_action, desc = 'lsp run code lens action' },
{ key = '<leader>wl', func = require('navigator.workspace').list_workspace_folders, desc = 'lsp list_workspace_folders' },
{ key = '<leader>ll', mode = 'n', func = require('navigator.codelens').run_action, desc = 'lsp run code lens action' },
},
icons = {
@ -98,8 +99,8 @@ local config = {
diagnostic_virtual_text = '',
diagnostic_file = '🚑',
-- Values
value_changed = '📝',
value_definition = '🐶🍡', -- it is easier to see than 🦕
value_changed = '',
value_definition = '', -- it is easier to see than 🦕
side_panel = {
section_separator = '',
line_num_left = '',
@ -111,16 +112,16 @@ local config = {
},
-- Treesitter
match_kinds = {
var = '', -- "👹", -- Vampaire
method = 'ƒ ', -- "🍔", -- mac
['function'] = '', -- "🤣", -- Fun
parameter = '', -- Pi
associated = '🤝',
namespace = '🚀',
var = '',
method = 'ƒ ',
['function'] = '',
parameter = '',
associated = '',
namespace = '',
type = '',
field = '🏈',
module = '📦',
flag = '🎏',
field = '',
module = '',
flag = '',
},
treesitter_defult = '🌲',
doc_symbols = '',
@ -143,11 +144,13 @@ local config = {
diagnostic_scrollbar_sign = false,
disable_lsp = {"clangd"},
disable_lsp = {"clangd", "rust_analyzer"},
-- disable auto start of lsp per language
-- set global default on lspconfig (see lspconfig doc)
gopls = {
-- on_attach = require("spike.lsp.go").custom_attach,
on_attach = require("spike.lsp.go").gopls_onattach,
settings = {
gopls = {
hints = {
@ -166,7 +169,8 @@ local config = {
["lua-dev"] = {
library = {
enabled = true,
plugins = {"navigator.lua", "guihua.lua", "go.nvim"},
plugins = {"plenary.nvim"},
-- plugins = {"navigator.lua", "guihua.lua", "go.nvim", "plenary.nvim"},
runtime = true,
types = true,
}

@ -0,0 +1,183 @@
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",
name = "rt_lldb",
console = "integratedTerminal",
},
},
}
function M.setup()
require("rust-tools").setup(opts)
end
return M

@ -7,6 +7,15 @@ end
M = {}
local config = {
keywords = {
["_TODO"] = { color = "warning"},
["LEARN"] = { color = "hint" },
},
colors = {
info = {"#2563EB"},
hint = {"#10B981"},
default = {"#8C3AED" },
},
}
M.setup = function()

@ -1,108 +1,117 @@
return {
ensure_installed = {
"query",
"css",
"lua",
"go",
"rust",
"fish",
"bash",
"python",
"c",
"cpp",
"haskell",
"javascript",
"html",
"markdown",
"markdown_inline",
"make",
"sql",
"yaml",
"toml",
"vue",
},
incremental_selection = {
enable = false,
keymaps = {
init_selection = "<CR>",
node_incremental = "<Tab>",
scope_incremental = "<CR>",
node_decremental = "<S-Tab>",
}
},
ensure_installed = {
"query",
"css",
"lua",
"go",
"rust",
"fish",
"bash",
"python",
"c",
"cpp",
"haskell",
"javascript",
"html",
"markdown",
"markdown_inline",
"make",
"sql",
"yaml",
"toml",
"vue",
},
textsubjects = {
enable = true,
prev_selection = "<Tab>",
keymaps = {
["<CR>"] = "textsubjects-smart", -- works in visual mode
}
},
highlight = {
enable = true,
disable = function(lang, bufnr)
return lang == "help"
end
},
rainbow = {
enable = true,
extended_mode = true,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<Space>",
node_incremental = "<Space>",
node_decremental = "<BS>",
scope_incremental = "<CR>",
}
},
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",
}
-- textsubjects = {
-- enable = true,
-- prev_selection = "<Tab>",
-- keymaps = {
-- ["<CR>"] = "textsubjects-smart", -- works in visual mode
-- }
-- },
--
rainbow = {
enable = true,
extended_mode = true,
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
textobjects = {
enable = true,
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
goto_next_start = {
["]]"] = "@function.outer",
["]m"] = "@class.outer"
},
goto_next_start = {
["]]"] = "@function.outer",
["]C"] = "@class.outer",
["]f"] = "@field.outer",
},
goto_next_end = {
["]["] = "@function.outer",
["]M"] = "@class.outer"
},
goto_previous_start = {
["[["] = "@function.outer",
["[m"] = "@class.outer"
},
goto_previous_end = {
["[]"] = "@function.outer",
["[M"] = "@class.outer"
}
goto_next_end = {
["]["] = "@function.outer",
},
goto_previous_start = {
["[["] = "@function.outer",
["[C"] = "@class.outer",
["[f"] = "@field.outer",
},
goto_previous_end = {
["[]"] = "@function.outer",
}
},
swap = {
enable = true,
swap_next = {
["~"] = "@parameter.inner"
},
}
},
swap = {
enable = true,
swap_next = {
["~"] = "@parameter.inner"
},
playground = {
enable = true,
}
},
playground = {
enable = true,
}
}

@ -1,4 +1,4 @@
-- vim: foldlevel=1
-- vim: foldlevel=1 foldmethod=marker
--
-- TODO: interesting plugins to install
-- - neovim minisurround to replace vim-surround
@ -31,360 +31,515 @@
-- - XXX ~~Reload all lua modules with `"pleanery.reload".reload_module(mod)`~~ XXX
return {
["nvim-treesitter/nvim-treesitter"] = {
setup = function()
require("core.lazy_load").on_file_open "nvim-treesitter"
require("core.lazy_load").on_file_open "nvim-treesitter-textobjects"
require("core.lazy_load").on_file_open "nvim-treesitter-textsubjects"
require("core.lazy_load").on_file_open "nvim-treesitter-context"
-- require("core.lazy_load").on_file_open "nvim-ts-rainbow"
end
},
["nvim-treesitter/nvim-treesitter-textobjects"] = {
opt = true,
},
["RRethy/nvim-treesitter-textsubjects"] = {
opt = true,
},
-- Treesitter dev/exploration tool
["nvim-treesitter/playground"] = {
opt = true,
},
["nvim-treesitter/nvim-treesitter-context"] = {
opt = true,
config = function()
require("custom.plugins.configs.treesitter-context").setup()
end
},
-- My Plugins
["~/.config/nvim/my_packages/perproject"] = { -- {{{
opt = true,
after = { "nvim-lspconfig", "navigator.lua" },
require = { "nvim-lspconfig", "navigator.lua" },
config = function()
require("perproject").setup()
-- callbacks = {
-- foo = function()
-- print("FOO")
-- end
-- }
-- })
end
}, -- }}}
["folke/todo-comments.nvim"] = {
after = "nvim-treesitter",
config = function()
require("custom.plugins.configs.todo-comments").setup()
end
},
-- ["p00f/nvim-ts-rainbow"] = {
-- opt = true,
-- },
["hrsh7th/cmp-buffer"] = {
config = function ()
local disabled_ft = {
"guihua",
"clap_input",
"guihua_rust,",
"TelescopePrompt"
}
require("cmp").setup.buffer {
enabled = function ()
for _, v in ipairs(disabled_ft) do
if vim.o.ft == v then return false end
end
return true
-- treesitter
["nvim-treesitter/nvim-treesitter"] = { -- {{{
-- custom config in chadrc -> custom.configs.treesitter
setup = function()
require("core.lazy_load").on_file_open "nvim-treesitter"
require("core.lazy_load").on_file_open "nvim-treesitter-textobjects"
require("core.lazy_load").on_file_open "nvim-treesitter-textsubjects"
require("core.lazy_load").on_file_open "nvim-treesitter-context"
-- require("core.lazy_load").on_file_open "nvim-ts-rainbow"
end,
},
["nvim-treesitter/nvim-treesitter-textobjects"] = {
opt = true,
},
["RRethy/nvim-treesitter-textsubjects"] = {
opt = true,
},
-- Treesitter dev/exploration tool
["nvim-treesitter/playground"] = {
opt = true,
cmd = {"TSPlayground*"},
},
["nvim-treesitter/nvim-treesitter-context"] = {
opt = true,
config = function()
require("custom.plugins.configs.treesitter-context").setup()
end
}
end
},
}, -- }}}
-- autocomplete
["hrsh7th/cmp-buffer"] = { -- {{{
config = function()
local disabled_ft = {
"guihua",
"clap_input",
"guihua_rust,",
"TelescopePrompt"
}
require("cmp").setup.buffer {
enabled = function()
for _, v in ipairs(disabled_ft) do
if vim.o.ft == v then return false end
end
return true
end
}
end
}, -- }}}
["mfussenegger/nvim-dap"] = {
lock = true,
module = "dap",
setup = function()
require("core.utils").load_mappings "dap"
end,
},
-- snippets
["honza/vim-snippets"] = { -- {{{
module = { "cmp", "cmp_nvim_lsp" },
event = "InsertEnter",
},
["rcarriga/nvim-dap-ui"] = {
lock = true,
after = "nvim-dap",
},
["L3MON4D3/LuaSnip"] = {
lock = false,
config = function()
-- load default config first
require("custom.plugins.configs.luasnip").setup()
vim.g.my_snippets_paths = { "./custom_snippets" }
require("luasnip").filetype_extend("markdown", { "markdown_zk" })
-- load snippets from "honza/vim-snippets"
-- includes ultisnips and snipmate snippets
-- default priority for snipmate is 1000
require("luasnip.loaders.from_snipmate").lazy_load({ override_priority = 500 })
require("luasnip.loaders.from_snipmate").lazy_load {
paths = vim.g.my_snippets_paths,
override_priority = 600
}
end
}, -- }}}
["theHamsta/nvim-dap-virtual-text"] = {
lock = true,
after = "nvim-dap"
},
-- side panel with symbols (replaced by Navigator :LspSymbols cmd)
-- ["liuchengxu/vista.vim"] = {
-- cmd = "Vista",
-- setup = function()
-- require("core.utils").load_mappings "vista"
-- end
-- },
--
["folke/which-key.nvim"] = {
lock = true,
disable = false,
keys = {"<leader>", "<BS>", "<Space>"}
},
-- text formatting
["nvim-telescope/telescope.nvim"] = {
-- lock = true,
tag = "*",
disable = false,
},
["tom-anders/telescope-vim-bookmarks.nvim"] = {
opt = true,
module = "telescope",
after = {"telescope.nvim", "vim-bookmarks"},
-- cmd = "Telescope",
-- requires = "vim-bookmarks",
-- after = {"vim-bookmarks", "telescope"},
-- module = "telescope",
config = function()
require("telescope").load_extension("vim_bookmarks")
end
},
["nvim-telescope/telescope-fzf-native.nvim"] = {
opt = true,
module = "telescope",
after = {"telescope.nvim"},
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build',
},
["ibhagwan/fzf-lua"] = {
lock = true,
after = "ui",
config = function()
require("custom.plugins.configs.fzflua")
require("plugins.configs.others").devicons()
end,
setup = function()
require("core.utils").load_mappings "fzf_lua"
end
},
-- Run async commands (make & errors)
["skywind3000/asyncrun.vim"] = {
lock = true,
cmd = "AsyncRun",
setup = function()
require("core.utils").load_mappings "asyncrun"
vim.g.asyncrun_open = 8
end
},
["folke/todo-comments.nvim"] = { -- {{{
after = "nvim-treesitter",
config = function()
require("custom.plugins.configs.todo-comments").setup()
end
},
["tpope/vim-fugitive"] = {
lock = true,
cmd = {"G", "Git", "G*"}
},
["tpope/vim-surround"] = {},
-- session and view
["vim-scripts/restore_view.vim"] = {}, -- TODO: check if still needed
-- ["rmagatti/auto-session"] = {
-- config = function ()
-- require("auto-session").setup {
-- log_level = "error",
-- auto_session_suppress_dirs = {"~/", "~/projects", "/"},
-- auto_save_enabled = false,
-- }
-- end
-- },
-- text formatting and navigation
-- repeat operator for plugin commands
["tpope/vim-repeat"] = {
keys = {"."},
},
["godlygeek/tabular"] = {
lcmd = "Tabularize"
}, -- }}}
["ggandor/leap.nvim"] = {
config = function()
require "custom.plugins.configs.leap"
end
},
-- ["justinmk/vim-sneak"] = {
-- lock = true,
-- keys = {"s", "S"},
-- },
["tpope/vim-surround"] = {},
["godlygeek/tabular"] = {
cmd = "Tabularize"
},
--
-- misc general plugins
-- Read info files
--
["https://gitlab.com/HiPhish/info.vim.git"] = {
cmd = "Info",
},
-- ["p00f/nvim-ts-rainbow"] = {
-- opt = true,
-- },
--
["MattesGroeger/vim-bookmarks"] = {
config = function()
require("core.utils").load_mappings "vim_bookmarks"
end
},
-- dap
-- create new vim modes
["Iron-E/nvim-libmodal"] = {
lock = true,
},
["mfussenegger/nvim-dap"] = { -- {{{
lock = true,
module = "dap",
setup = function()
require("core.utils").load_mappings "dap"
require('spike.dap').setup()
end,
config = function()
require("custom.plugins.configs.dap").setup()
end
},
-- ["chentoast/marks.nvim"] = {
-- opt = true,
-- keys = {"m", "d"},
-- cmd = {"Marks*", "Bookmarks*"},
-- config = function ()
-- require("custom.plugins.configs.marks").setup()
-- end
-- },
-- snippets
["L3MON4D3/LuaSnip"] = {
lock = true,
config = function()
-- load default config first
require("plugins.configs.others").luasnip()
vim.g.my_snippets_paths = {"./custom_snippets"}
require("luasnip").filetype_extend("markdown", { "markdown_zk" })
-- load snippets from "honza/vim-snippets"
-- includes ultisnips and snipmate snippets
require("luasnip.loaders.from_snipmate").lazy_load({ override_priority = 800 })
require("luasnip.loaders.from_snipmate").lazy_load {
paths = vim.g.my_snippets_paths,
override_priority = 800
}
end
},
-- ------------------
-- LSP
-- ------------------
["honza/vim-snippets"] = {
module = {"cmp", "cmp_nvim_lsp"},
event = "InsertEnter",
},
["neovim/nvim-lspconfig"] = {
after = "lua-dev.nvim",
lock = true,
config = function()
local lspconfig = require("lspconfig")
lspconfig.util.default_config = vim.tbl_extend(
"force",
lspconfig.util.default_config,
{
autostart = false
}
)
end-- disable lspconfig, handled by navigator
},
["williamboman/mason-lspconfig.nvim"] = {
lock = true,
requires = {"williamboman/mason.nvim", "nvim-lspconfig"},
-- after = "mason.nvim",
module = {"mson-lspconfig.nvim", "mason.nvim"},
config = function()
require("mason-lspconfig").setup({})
end,
},
["ray-x/guihua.lua"] = {
lock = true,
module = {"navigator"},
run = "cd lua/fzy && make",
config = function()
require("guihua.maps").setup {
maps = {
close_view = "<C-x>",
}
}
end
["rcarriga/nvim-dap-ui"] = {
tag = "*",
after = "nvim-dap",
config = function()
require('custom.plugins.configs.dapui').setup()
end
},
},
-- ["https://git.sp4ke.xyz/sp4ke/navigator.lua"] =
["theHamsta/nvim-dap-virtual-text"] = {
lock = true,
after = "nvim-dap"
}, -- }}}
-- User Interface / UX
--
["ray-x/navigator.lua"] = {
lock = true,
opt = true,
module = "navigator.lua",
after = { "nvim-lspconfig", "base46", "ui", "mason.nvim", "mason-lspconfig.nvim" },
requires = {"neovim/nvim-lspconfig", "ray-x/guihua.lua", "nvim-treesitter/nvim-treesitter"},
setup = function()
require("core.lazy_load").on_file_open "navigator.lua"
require("core.utils").load_mappings "navigator"
end,
config = function()
require("custom.plugins.configs.navigator").setup()
require("base46").load_highlight "lsp"
-- TODO: use nvchadui_lsp features manually
-- require("nvchad_ui.lsp")
end
},
-- allows to preview commands after they are registerd by plugin
-- the current registerd norm command works by first selecting a visual selection
-- then doing the changes, it's an enhanced multi cursor
["smjonas/live-command.nvim"] = {
cmd = require("custom.plugins.configs.live-command").get_cmds(),
opt = true,
config = function()
require("custom.plugins.configs.live-command").setup()
end
},
["ray-x/lsp_signature.nvim"] = {
after = {"navigator.lua"},
config = function()
require("custom.plugins.configs.lsp_signature").setup()
end
["folke/which-key.nvim"] = { -- {{{
lock = true,
disable = false,
keys = { "<leader>", "<BS>", "<Space>", "\"", "`", "'", "z", "g" }
},
},
-- repeat operator for plugin commands
["tpope/vim-repeat"] = {
keys = { "." },
},
-- per language plugins
-- -------
-- lua dev
-- -------
-- Eval Lua lines/selections
["bfredl/nvim-luadev"] = {
lock = true,
cmd = "Luadev",
keys = {
"<Plug>(Luadev-RunLine)",
"<Plug>(Luadev-Run)",
"<Plug>(Luadev-RunWord)",
"<Plug>(Luadev-Complete)",
["nvim-telescope/telescope.nvim"] = {
-- lock = true,
disable = false,
},
setup = function()
local autocmd = vim.api.nvim_create_autocmd
autocmd("FileType", {
pattern = "lua",
callback = function ()
vim.keymap.set({'n', 'i'}, '<leader>r', '<Plug>(Luadev-RunLine)', {
desc = "Luadev RunLine"
})
["tom-anders/telescope-vim-bookmarks.nvim"] = {
opt = true,
module = "telescope",
after = { "telescope.nvim", "vim-bookmarks" },
-- cmd = "Telescope",
-- requires = "vim-bookmarks",
-- after = {"vim-bookmarks", "telescope"},
-- module = "telescope",
config = function()
require("telescope").load_extension("vim_bookmarks")
end
},
["nvim-telescope/telescope-fzf-native.nvim"] = {
opt = true,
module = "telescope",
after = { "telescope.nvim" },
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build',
},
["ibhagwan/fzf-lua"] = {
lock = true,
after = "ui",
config = function()
require("custom.plugins.configs.fzflua")
require("plugins.configs.others").devicons()
end,
})
end
},
setup = function()
require("core.utils").load_mappings "fzf_lua"
end
}, -- }}}
-- Theme customization
["uga-rosa/ccc.nvim"] = { -- {{{{{{
commit = "427471b",
cmd = { "Ccc*", "<Plug>(ccc-insert)" },
setup = function()
require("core.utils").load_mappings "ccc"
end,
config = function()
require("ccc").setup({})
end
}, -- }}}}}}
-- REPL for Lua development
["ii14/neorepl.nvim"] = {
lock = true,
cmd = "Repl",
after = "nvim-cmp",
config = function ()
local autocmd = vim.api.nvim_create_autocmd
autocmd("FileType",{
pattern = "neorepl",
callback = function ()
require('cmp').setup.buffer({enabled = false})
-- custom keymap example
-- activate corresponding section in mappings
-- mappings = require("custom.utils").set_plugin_mappings "neorepl"
-- navigation / jumping / buffer modification
-- ["justinmk/vim-sneak"] = {
-- lock = true,
-- keys = {"s", "S"},
-- },
["ggandor/leap.nvim"] = { -- {{{
config = function()
require "custom.plugins.configs.leap"
end
})
end
},
}, -- }}}
-- Lua dev env
-- check setup in configs/navigator.lua
["folke/lua-dev.nvim"] = {
module = "lua-dev",
},
-- tmux helpers
["christoomey/vim-tmux-navigator"] = {
cond = function()
return vim.env.TMUX ~= nil
end
},
["https://git.sp4ke.xyz/sp4ke/vim-vimux"] = {
cond = function()
return vim.env.TMUX ~= nil
end,
setup = function()
require("core.utils").load_mappings "vimux"
-- vim.g.VimuxDebug = 1
vim.g.VimuxHeight = 20
end
},
-- Job management (use nvim startjob )
-- Run async commands (make & errors)
-- TODO: replace with https://github.com/skywind3000/asynctasks.vim
["skywind3000/asyncrun.vim"] = { -- {{{
lock = true,
cmd = "AsyncRun",
setup = function()
require("core.utils").load_mappings "asyncrun"
vim.g.asyncrun_open = 8
end
}, -- }}}
-- Git
["tpope/vim-fugitive"] = {
cmd = { "G", "Git", "G*" }
},
-- session and view
["vim-scripts/restore_view.vim"] = {}, -- TODO: check if still needed
-- ["rmagatti/auto-session"] = {
-- config = function ()
-- require("auto-session").setup {
-- log_level = "error",
-- auto_session_suppress_dirs = {"~/", "~/projects", "/"},
-- auto_save_enabled = false,
-- }
-- end
-- },
--
-- Misc / General plugins
-- Read info files
["https://gitlab.com/HiPhish/info.vim.git"] = { -- {{{{{{
cmd = "Info",
}, -- }}}}}}
["MattesGroeger/vim-bookmarks"] = { -- {{{
config = function()
require("core.utils").load_mappings "vim_bookmarks"
end
}, -- }}}
-- create new vim modes
["Iron-E/nvim-libmodal"] = { -- {{{
lock = true,
}, -- }}}
-- get rid of bad habits
-- ["ja-ford/delaytrain.nvim"] = {
["~/src/delaytrain.nvim"] = {
config = function()
require('delaytrain').setup({
delay_ms = 1000, -- How long repeated usage of a key should be prevented
grace_period = 1, -- How many repeated keypresses are allowed
keys = { -- Which keys (in which modes) should be delayed
['nv'] = { 'h', 'j', 'k', 'l' },
-- ['nvi'] = { '<Left>', '<Down>', '<Up>', '<Right>' },
},
ignore_filetypes = {"qf", "NvimTree", "help", "qf", "netrw"},
})
end
},
-- ["takac/vim-hardtime"] = {-- {{{
-- -- keys = { "h", "j", "k", "l" },
-- setup = function()
-- vim.g.hardtime_default_on = 1
-- vim.g.hardtime_showmsg = 1
-- vim.g.list_of_normal_keys = {"h","j","k","l"}
-- vim.g.list_of_visual_keys = {"h","j","k","l"}
-- vim.g.hardtime_ignore_quickfix = 1
-- vim.g.hardtime_ignore_buffer_patterns = {
-- "NERD.*",
-- "netrw",
-- "TelescopePrompt",
-- "fugitive",
-- "guihua*",
-- }
-- vim.g.hardtime_maxcount = 2
-- end,
-- },-- }}}
-- ["chentoast/marks.nvim"] = {
-- opt = true,
-- keys = {"m", "d"},
-- cmd = {"Marks*", "Bookmarks*"},
-- config = function ()
-- require("custom.plugins.configs.marks").setup()
-- end
-- },
-- ------------------
-- LSP
-- ------------------
["neovim/nvim-lspconfig"] = { -- {{{
after = { "lua-dev.nvim", "mason.nvim", "mason-lspconfig.nvim" },
module = { "lspconfig" },
lock = false,
config = function()
require("plugins.configs.lspconfig").setup()
end
},
["williamboman/mason-lspconfig.nvim"] = {
lock = false,
requires = { "williamboman/mason.nvim", "nvim-lspconfig" },
-- after = "mason.nvim",
module = { "mson-lspconfig.nvim", "mason.nvim" },
config = function()
require("mason-lspconfig").setup({})
end,
},
["ray-x/guihua.lua"] = {
lock = true,
module = { "navigator" },
run = "cd lua/fzy && make",
config = function()
require("guihua.maps").setup {
maps = {
close_view = "<C-x>",
}
}
end
},
-- ["https://git.sp4ke.xyz/sp4ke/navigator.lua"] =
--
["ray-x/navigator.lua"] = {
lock = true,
opt = true,
module = "navigator",
after = { "nvim-lspconfig", "base46", "ui", "mason.nvim", "mason-lspconfig.nvim", "lua-dev.nvim" },
requires = { "neovim/nvim-lspconfig", "ray-x/guihua.lua", "nvim-treesitter/nvim-treesitter" },
setup = function()
require("core.lazy_load").on_file_open "navigator.lua"
require("core.utils").load_mappings "navigator"
end,
config = function()
require("custom.plugins.configs.navigator").setup()
require("base46").load_highlight "lsp"
-- TODO: use nvchadui_lsp features manually
-- require("nvchad_ui.lsp")
end
},
["ray-x/lsp_signature.nvim"] = {
lock = true,
after = { "navigator.lua" },
config = function()
require("custom.plugins.configs.lsp_signature").setup()
end
}, -- }}}
-- side panel with symbols (replaced by Navigator :LspSymbols cmd)
-- ["liuchengxu/vista.vim"] = {
-- cmd = "Vista",
-- setup = function()
-- require("core.utils").load_mappings "vista"
-- end
-- },
--
-- -------------------------------------------------------
-- Programming Languages Plugins
-- -------------------------------------------------------
-- -------
-- lua dev
-- -------
-- Eval Lua lines/selections
-- ["bfredl/nvim-luadev"] = {{{{
-- lock = true,
-- cmd = "Luadev",
-- keys = {
-- "<Plug>(Luadev-RunLine)",
-- "<Plug>(Luadev-Run)",
-- "<Plug>(Luadev-RunWord)",
-- "<Plug>(Luadev-Complete)",
-- },
-- setup = function()
-- local autocmd = vim.api.nvim_create_autocmd
-- autocmd("FileType", {
-- pattern = "lua",
-- callback = function ()
-- vim.keymap.set({'n', 'i'}, '<leader>r', '<Plug>(Luadev-RunLine)', {
-- desc = "Luadev RunLine"
-- })
-- end,
-- })
-- end
-- },}}}
-- power Repl {{{
["hkupty/iron.nvim"] = {
loack = true,
cmd = { "Iron*" },
setup = function()
require("core.utils").load_mappings "iron"
end,
config = function()
require("custom.plugins.configs.iron").setup()
end
},
-- REPL for Lua development
["ii14/neorepl.nvim"] = {
lock = true,
cmd = "Repl",
after = "nvim-cmp",
config = function()
local autocmd = vim.api.nvim_create_autocmd
autocmd("FileType", {
pattern = "neorepl",
callback = function()
require('cmp').setup.buffer({ enabled = false })
-- custom keymap example
-- activate corresponding section in mappings
-- mappings = require("custom.utils").set_plugin_mappings "neorepl"
end
})
end
},
-- Lua dev env
-- check setup in configs/navigator.lua
["folke/lua-dev.nvim"] = {
lock = true,
module = "lua-dev",
}, -- }}}
-- golang dev
["ray-x/go.nvim"] = { -- {{{
lock = true,
-- after = {"nvim-lspconfig", "navigator.lua", "guihua.lua"},
ft = { "go" },
opt = true,
config = function()
require("custom.plugins.configs.gonvim").setup()
end
}, -- }}}
-- Rust dev
["simrat39/rust-tools.nvim"] = { -- {{{
lock = true,
ft = { "rust" },
opt = true,
config = function()
require("custom.plugins.configs.rust-tools").setup()
end
} -- }}}
-- golang dev
["ray-x/go.nvim"] = {
lock = true,
-- after = {"nvim-lspconfig", "navigator.lua", "guihua.lua"},
ft = {"go"},
opt = true,
config = function()
require("custom.plugins.configs.gonvim").setup()
end
}
}

@ -37,7 +37,7 @@ local modes = {
}
local function is_dapmode()
return require("sp4ke.dapmode").is_active()
return require("spike.dap.dapmode").is_active()
-- return false
end

@ -1,7 +1,7 @@
local present, cmp = pcall(require, "cmp")
if not present then
return
return
end
require("base46").load_highlight "cmp"
@ -9,116 +9,154 @@ require("base46").load_highlight "cmp"
vim.opt.completeopt = "menuone,noselect"
local function border(hl_name)
return {
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
}
return {
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
}
end
local cmp_window = require "cmp.utils.window"
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
cmp_window.info_ = cmp_window.info
cmp_window.info = function(self)
local info = self:info_()
info.scrollable = false
return info
local info = self:info_()
info.scrollable = false
return info
end
local options = {
window = {
completion = {
border = border "CmpBorder",
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
-- preselect = cmp.PreselectMode.None,
window = {
completion = {
border = border "CmpBorder",
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
},
documentation = {
border = border "CmpDocBorder",
},
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
documentation = {
border = border "CmpDocBorder",
formatting = {
format = function(entry, vim_item)
local icons = require("nvchad_ui.icons").lspkind
vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind)
-- show source
vim_item.menu = ({
buffer = ":buf",
nvim_lsp = ":lsp",
luasnip = ":LuaS",
nvim_lua = ":lua",
latex_symbols = ":ltx",
})[entry.source.name]
return vim_item
end,
},
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
-- Try to emulate native neovim C-x completion style behavior
["<C-e><C-e>"] = cmp.mapping.complete(),
["<C-c>"] = cmp.mapping.close(),
["<C-e>"] = cmp.mapping.abort(),
["<C-y>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
-- luasnip forward jump
["<C-k>"] = cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.confirm()
else
fallback()
end
end, {
"i",
"s",
}),
-- luasnip reverse jump
["<C-j>"] = cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
["<Tab>"] = cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.confirm()
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
},
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
formatting = {
format = function(_, vim_item)
local icons = require("nvchad_ui.icons").lspkind
vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind)
return vim_item
end,
},
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-e>"] = cmp.mapping.complete(),
["<C-c>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = false,
sources = {
{ name = "luasnip", priority = 1000 },
{ name = "nvim_lsp", priority = 800 },
{
name = "buffer",
option = {
get_bufnrs = function()
local bufs = {}
for _, win in ipairs(vim.api.nvim_list_wins()) do
bufs[vim.api.nvim_win_get_buf(win)] = true
end
return vim.tbl_keys(bufs)
end
},
},
{ name = "nvim_lua", priority = 900 },
{ name = "path" },
},
-- luasnip forward jump
["<C-k>"] = cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, {
"i",
"s",
}),
-- luasnip reverse jump
["<C-j>"] = cmp.mapping(function(fallback)
local luasnip = require("luasnip")
if luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
else
fallback()
end
end, {
"i",
"s",
}),
},
sources = {
{ name = "luasnip" },
{ name = "nvim_lsp" },
{ name = "buffer" },
{ name = "nvim_lua" },
{ name = "path" },
},
}
-- check for any override

@ -1,80 +1,92 @@
-- lsp is handled by navigator.lua
local present, lspconfig = pcall(require, "lspconfig")
if not present then
return
end
require("base46").load_highlight "lsp"
require "nvchad_ui.lsp"
-- require("base46").load_highlight "lsp"
-- require "nvchad_ui.lsp"
--
local M = {}
local utils = require "core.utils"
-- export on_attach & capabilities for custom lspconfigs
M.on_attach = function(client, bufnr)
print("NVCHAD ON ATTACH")
if vim.g.vim_version > 7 then
-- nightly
client.server_capabilities.documentFormattingProvider = false
client.server_capabilities.documentRangeFormattingProvider = false
else
-- stable
client.resolved_capabilities.document_formatting = false
client.resolved_capabilities.document_range_formatting = false
end
utils.load_mappings("lspconfig", { buffer = bufnr })
if client.server_capabilities.signatureHelpProvider then
require("nvchad_ui.signature").setup(client)
end
function M.setup()
lspconfig.util.default_config = vim.tbl_extend(
"force",
lspconfig.util.default_config,
{
autostart = false
})
end
M.capabilities = vim.lsp.protocol.make_client_capabilities()
M.capabilities.textDocument.completion.completionItem = {
documentationFormat = { "markdown", "plaintext" },
snippetSupport = true,
preselectSupport = true,
insertReplaceSupport = true,
labelDetailsSupport = true,
deprecatedSupport = true,
commitCharactersSupport = true,
tagSupport = { valueSet = { 1 } },
resolveSupport = {
properties = {
"documentation",
"detail",
"additionalTextEdits",
},
},
}
lspconfig.sumneko_lua.setup {
on_attach = M.on_attach,
capabilities = M.capabilities,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
workspace = {
library = {
[vim.fn.expand "$VIMRUNTIME/lua"] = true,
[vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
},
maxPreload = 100000,
preloadFileSize = 10000,
},
},
},
}
lspconfig.gopls.setup {
on_attach = M.on_attach,
capabilities = M.capabilities,
}
-- local utils = require "core.utils"
--
-- -- export on_attach & capabilities for custom lspconfigs
--
-- M.on_attach = function(client, bufnr)
-- print("NVCHAD ON ATTACH")
-- if vim.g.vim_version > 7 then
-- -- nightly
-- client.server_capabilities.documentFormattingProvider = false
-- client.server_capabilities.documentRangeFormattingProvider = false
-- else
-- -- stable
-- client.resolved_capabilities.document_formatting = false
-- client.resolved_capabilities.document_range_formatting = false
-- end
--
-- utils.load_mappings("lspconfig", { buffer = bufnr })
--
-- if client.server_capabilities.signatureHelpProvider then
-- require("nvchad_ui.signature").setup(client)
-- end
-- end
--
-- M.capabilities = vim.lsp.protocol.make_client_capabilities()
--
-- M.capabilities.textDocument.completion.completionItem = {
-- documentationFormat = { "markdown", "plaintext" },
-- snippetSupport = true,
-- preselectSupport = true,
-- insertReplaceSupport = true,
-- labelDetailsSupport = true,
-- deprecatedSupport = true,
-- commitCharactersSupport = true,
-- tagSupport = { valueSet = { 1 } },
-- resolveSupport = {
-- properties = {
-- "documentation",
-- "detail",
-- "additionalTextEdits",
-- },
-- },
-- }
--
-- lspconfig.sumneko_lua.setup {
-- on_attach = M.on_attach,
-- capabilities = M.capabilities,
--
-- settings = {
-- Lua = {
-- diagnostics = {
-- globals = { "vim" },
-- },
-- workspace = {
-- library = {
-- [vim.fn.expand "$VIMRUNTIME/lua"] = true,
-- [vim.fn.expand "$VIMRUNTIME/lua/vim/lsp"] = true,
-- },
-- maxPreload = 100000,
-- preloadFileSize = 10000,
-- },
-- },
-- },
-- }
--
-- lspconfig.gopls.setup {
-- on_attach = M.on_attach,
-- capabilities = M.capabilities,
-- }
return M

@ -106,35 +106,6 @@ M.comment = function()
nvim_comment.setup(options)
end
M.luasnip = function()
local present, luasnip = pcall(require, "luasnip")
if not present then
return
end
local options = {
history = true,
updateevents = "TextChanged,TextChangedI",
}
options = load_override(options, "L3MON4D3/LuaSnip")
luasnip.config.set_config(options)
require("luasnip.loaders.from_vscode").lazy_load()
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
M.gitsigns = function()
local present, gitsigns = pcall(require, "gitsigns")

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

@ -2,7 +2,10 @@ vim.cmd "packadd packer.nvim"
local plugins = {
["nvim-lua/plenary.nvim"] = { module = "plenary" },
["nvim-lua/plenary.nvim"] = {
module = "plenary",
module_pattern = "plenary*",
},
["wbthomason/packer.nvim"] = {
cmd = require("core.lazy_load").packer_cmds,
config = function()

@ -1,33 +0,0 @@
local dapmode = require("sp4ke.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']['sp4ke-dap'] = function(session, body)
dapmode.start()
end
dap.listeners.after['event_terminated']['sp4ke-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

@ -1,30 +1,32 @@
local libmodal = require "libmodal"
local libmodal = require 'libmodal'
local daputils = require 'spike.dap.utils'
M = {}
M.layer = nil
local config = {
mappings = {
n =
{
t = { rhs = '<cmd> DapToggleBreakpoint<CR>', desc= "[dap] toggle breakpoint" },
{
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",
desc = '[dap] conditional breakpoint',
},
c = {
rhs = function()
require('dap').continue()
end,
desc = "[dap] continue"
desc = '[dap] continue'
},
n = {
rhs = function()
require('dap').step_over()
end,
desc = "[dap] step over"
desc = '[dap] step over'
},
s = {
rhs = function()
@ -40,28 +42,51 @@ local config = {
},
r = {
rhs = function()
require('go.dap').run()
require('dap').run_last()
end,
desc = '[dap] run'
desc = '[dap] restart'
},
S = {
rhs = function()
require('go.dap').stop()
daputils.disconnect_dap()
end,
desc = "[dap] stop"
desc = '[dap] stop'
},
C = {
rhs = function()
require('dap').run_to_cursor()
end,
desc = "[dap] run to curosr"
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"] = {
['Q'] = {
rhs = function()
M.layer:exit()
end,
desc = "[dap] exit dap mode"
}
desc = '[dap] exit dap mode'
}
}
}
}
@ -79,7 +104,7 @@ function M.stop()
end
function M.setup (opts)
config = vim.tbl_deep_extend("force", config, opts or {})
config = vim.tbl_deep_extend('force', config, opts or {})
end
function M.is_active()
@ -92,5 +117,6 @@ end
-- --
-- layer:enter()
--
M.disconnect_dap = disconnect_dap
return M

@ -0,0 +1,70 @@
local dapmode = require("spike.dap.dapmode")
local daputils = require('spike.dap.utils')
local dapui = require("dapui")
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()
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()
dapui.open()
end
dap.listeners.after['event_terminated']['spike-dap'] = function(session, body)
-- print("dap session ended")
dapmode.stop()
dapui.close()
end
end
function M.go_debug()
local present, gdap = pcall(require, "go.dap")
if not present then return end
gdap.run()
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
function M.prepare_launch()
end
function M.setup()
dapmode.setup({})
register_listeners()
set_signs()
end
return M

@ -0,0 +1,35 @@
local ok, dap = pcall(require, 'dap')
if not ok then
vim.notify('dap module missing')
end
local M = {}
M.disconnect_dap = function()
local has_dap, dap = pcall(require, 'dap')
if has_dap then
dap.disconnect()
dap.repl.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
return M

@ -18,3 +18,13 @@ R = function(name)
RELOAD(name)
return require(name)
end
TBL_HASVAL = function(tab, val)
for index, value in ipairs(tab) do
if value == val then
return true
end
end
return false
end

@ -0,0 +1,33 @@
-- custom golang lsp settings
local augroup = vim.api.nvim_create_augroup
local autocmd = vim.api.nvim_create_autocmd
local M = {}
local augroupname = "spike.go"
-- Navigator custom on_attach for golang
function M.gopls_onattach(client, bufnr)
-- auto auto format on save
local ok, goformat = pcall(require, "go.format")
if not ok then
print("go.nvim missing !")
return
end
-- autocmd({"BufWritePre", "InsertLeave"}, {
autocmd({"BufWritePre"}, {
group = augroup(augroupname, {clear = true}),
buffer = bufnr,
callback = function()
goformat.goimport()
end
})
require("core.utils").load_mappings "golang"
end
return M

@ -11,4 +11,9 @@ M.toggle_diagnostics = function ()
M.shown = true
end
-- my customized attach
-- M.custom_attach = function(client, bufnr)
-- end
return M

@ -0,0 +1,128 @@
-- helper module for setting custom lsp settings per project
-- will be used for setting autostart of lspclient per projects
--
local M = {}
local autocmd = vim.api.nvim_create_autocmd
local augroup = vim.api.nvim_create_augroup
local augroup_name = "perproject"
local function setup_autocommands ()
augroup( augroup_name ,{}) -- automatically clears prev group commands
autocmd({"BufRead", "BufWinEnter", "BufNewFile"},{
group = augroup_name,
pattern = "*",
callback = require("perproject").per_project_jsonfile,
})
autocmd({"DirChanged"},{
group = augroup_name,
pattern = "window",
callback = require("perproject").per_project_jsonfile,
})
end
local _PP_CONF = {
basename = ".pnvim.json",
callbacks = pp_callbacks,
}
local pp_callbacks = {
-- @enabled: bool
lsp_autostart = function(enabled)
if enabled then
local other_matching_configs = require('lspconfig.util').get_other_matching_providers(vim.bo.filetype)
for _, config in ipairs(other_matching_configs) do
config.launch()
end
end
end
}
local function call_pp_callback(proj_opts)
for key, val in pairs(proj_opts) do
-- pp_callbacks[opt] ~= nil and pp_callbacks[opt].__call()
if pp_callbacks[key] ~= nil then
pp_callbacks[key](val)
end
end
end
local ok, Path = pcall(require, "plenary.path")
if not ok then
print("[perproject] plenary required !")
end
-- local scandir = require("plenary.scandir")
local function per_project_file()
local cwd = Path.new(vim.fn.getcwd())
local pp_dir = cwd:joinpath(_PP_CONF_.basename)
if pp_dir:is_dir() then
-- find if there is perproject dir
local function on_exit(results)
vim.schedule(function()
for _, res in ipairs(results) do
pp_options[vim.fs.basename(res)] = true
end
end)
end
scandir.scan_dir_async(pp_dir.filename, {
-- on_insert = on_insert,
on_exit = on_exit,
})
else
print("no " .. _PP_CONF.basename)
end
-- TODO:
-- check if there is a custom .nvim-lsp dir in working dir
-- each file inside .nvim-lsp represent a active option if
-- it is present
-- example
-- workingDir/
-- .perproject/
-- lsp.autostart --> autostart lsp for this project
end
M.per_project_jsonfile = function()
local cwd = Path.new(vim.fn.getcwd())
local pp_file = cwd:joinpath(_PP_CONF.basename)
if pp_file:is_file() then
local ok, decoded = pcall(vim.json.decode, (pp_file:read()))
if not ok then
vim.notify(string.format("[perproject] could not parse %s : %s", _PP_CONF.basename, decoded), vim.log.levels.ERROR)
return
end
call_pp_callback(decoded)
-- pp_options = vim.tbl_deep_extend("force", pp_options, proj_opts or {})
end
end
local function setup_callbacks(conf)
if conf.callbacks and
type(conf.callbacks) == "table" then
for cb_name, cb in pairs(conf.callbacks) do
if type(cb) == "function" then
print("setting up callback, ", cb_name)
pp_callbacks[cb_name] = cb
end
end
end
end
function M.setup(conf)
local config = conf or {}
setup_callbacks(config)
setup_autocommands()
end
return M
Loading…
Cancel
Save