Compare commits

..

No commits in common. 'master' and 'navigator' have entirely different histories.

@ -0,0 +1,161 @@
# [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)

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

@ -0,0 +1,34 @@
---
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.

@ -0,0 +1,8 @@
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."

@ -0,0 +1,23 @@
---
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

@ -0,0 +1,14 @@
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

@ -0,0 +1,16 @@
(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

@ -0,0 +1,146 @@
<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.

@ -0,0 +1,22 @@
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

6
.gitignore vendored

@ -1,7 +1,3 @@
plugin/*compiled.lua
plugin
spell
examples
lua/scratch
.luarc.json
scratch

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

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

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

@ -0,0 +1,8 @@
- [navigator] sync icons between navigator and nvchad lspconfig
- [navigator] disable diagnostic on startup
- [navigator] manually setup all keymaps
- 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)

@ -1,7 +0,0 @@
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>

@ -1,4 +0,0 @@
set colorcolumn=0
set signcolumn=yes:1
set nonumber
set norelativenumber

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

@ -1 +0,0 @@
set cursorline

@ -1 +0,0 @@
cnoremap R! !ruff --fix %<CR>

@ -1,2 +0,0 @@
set makeprg=cargo\ run\ -q
nnoremap <Space>c :AsyncRun cargo test<CR>

@ -1,7 +0,0 @@
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

@ -1 +0,0 @@
require 'spike.diagnostics'.set_diagnostics_level(vim.diagnostic.severity.ERROR)

@ -1,15 +0,0 @@
" vim modeline
" vim: foldmarker={,} foldmethod=marker foldlevel=0
" example usage
" for NvChad highlihgts chould be handled in chadrc
" au BufEnter * hi CursorLine gui=underline
" au BufEnter * hi CursorLine guifg=red
"
" GuiGua selected item (navigator etc )
au BufEnter * hi GuihuaListSelHl gui=underline guibg=bg
au BufEnter * hi TabLineFill NONE
au BufEnter * hi TabLine NONE

@ -1,16 +0,0 @@
nnoremap <leader>I :tab Info<CR>
augroup INFO
au!
au FileType info nnoremap i <NOP>
au FileType info nmap <buffer> <Up> <Plug>(InfoUp)
au FileType info nmap <buffer> iu <Plug>(InfoUp)
au FileType info nmap <buffer> <Down> <Plug>(InfoMenu)
au FileType info nmap <buffer> im <Plug>(InfoMenu)
au FileType info nmap <buffer> <C-F> <Plug>(InfoFollow)
au FileType info nmap <buffer> if <Plug>(InfoFollow)
au FileType info nmap <buffer> <Right> <Plug>(InfoNext)
au FileType info nmap <buffer> in <Plug>(InfoNext)
au FileType info nmap <buffer> <Left> <Plug>(InfoPrev)
au FileType info nmap <buffer> ip <Plug>(InfoPrev)
au FileType info nmap <buffer> ig <Plug>(InfoGoto)
augroup END

@ -1,15 +0,0 @@
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,235 +0,0 @@
--TODO: migrate to noirbuddy
-- used to override nvchad highlights
local c = require("base46.colors")
local colors = require("base46").get_theme_tb "base_30"
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,
-- },
-- 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(vim.tbl_deep_extend("force", highlights, statusline)) do
vim.api.nvim_set_hl(0, hl, col)
end
end
-- setup section
set_hl()

@ -1,13 +0,0 @@
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",
},
}

@ -1 +0,0 @@
" let g:jukit_mappings = 1

@ -1,11 +0,0 @@
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']

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

@ -1 +0,0 @@
{"tag_name":"nightly","target_commitish":"91d8f2ac534a51859c0e3c6562d07c94b27f4478","published_at":"2023-08-21T05:16:03Z"}

@ -0,0 +1 @@
../../dotfiles/nvim/.config/nvim/mysnippets

@ -0,0 +1,12 @@
-- 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

@ -0,0 +1,3 @@
-- 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,6 @@ vim.defer_fn(function()
pcall(require, "impatient")
end, 0)
require "spike.globals"
require "core"
require "core.options"
@ -12,7 +11,6 @@ require("core.utils").load_mappings()
local fn = vim.fn
local install_path = fn.stdpath "data" .. "/site/pack/packer/opt/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#1e222a" })
print "Cloning packer .."
@ -25,7 +23,3 @@ if fn.empty(fn.glob(install_path)) > 0 then
end
pcall(require, "custom")
local xdg_config = vim.env["XDG_CONFIG_HOME"] or '~/.config'
local vimscriptsfolder = xdg_config .. "/nvim/myvimscript" -- relative to .config/nvim dir
vim.opt.runtimepath:prepend(vimscriptsfolder)

@ -1,13 +0,0 @@
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

@ -79,8 +79,7 @@ M.mason_cmds = {
M.gitsigns = function()
autocmd({ "BufRead" }, {
callback = function()
if vim.fn.isdirectory ".git" ~= 0 or
vim.fn.filereadable ".git" ~= 0 then
if vim.fn.isdirectory ".git" ~= 0 then
vim.schedule(function()
require("packer").loader "gitsigns.nvim"
end)

File diff suppressed because it is too large Load Diff

@ -7,13 +7,6 @@ g.nvchad_theme = config.ui.theme
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
g.theme_switcher_loaded = false
-- g.fg_man_folding_enable = true -- enable folding for man pages
-- if vim.fn.executable("sh") then opt.shell = vim.fn.exepath("sh") end
if vim.fn.executable("fish") then
opt.shell = 'fish -C vim_prompt'
end
-- use filetype.lua instead of filetype.vim. it's enabled by default in neovim 0.8 (nightly)
if g.vim_version < 8 then
@ -22,37 +15,31 @@ if g.vim_version < 8 then
end
opt.laststatus = 3 -- global statusline
-- for statusline format see lua/custom/plugins/nvchadui.lua
opt.cmdheight = 1
opt.showmode = false
opt.title = true
opt.clipboard = "unnamed"
opt.cul = true -- cursor line
opt.cursorlineopt="number"
-- opt.colorcolumn = "80"
opt.colorcolumn = '+0' -- make colorcolumn follow text width
opt.textwidth = 80
opt.colorcolumn = "80"
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 = 4 -- use indents of 2 spaces
opt.shiftwidth = 2 -- use indents of 2 spaces
opt.smartindent = true -- smart indent when starting new lines
opt.tabstop = 4 -- number of spaces when tab pressed
opt.softtabstop = 4 -- Let backspace delete indent
opt.tabstop = 2 -- number of spaces when tab pressed
opt.softtabstop = 2 -- Let backspace delete indent
-- http://vim.wikia.com/wiki/Converting_tabs_to_spaces
opt.tabpagemax = 10
opt.fillchars = { eob = "" }
opt.fillchars = { eob = " " }
opt.ignorecase = true
opt.smartcase = true
opt.mouse = "a"
opt.cpoptions:append ">" -- When appending to registers use newline
-- GUI
-- opt.mousehide = true
opt.mousehide = true
-- Numbers
opt.number = true
@ -69,20 +56,17 @@ opt.iskeyword:remove(".")
opt.iskeyword:remove("#")
opt.iskeyword:remove("-")
-- remove `=` from is fname
opt.isfname:remove("=")
--
-- folding with tree sitter
-- opt.foldmethod=expr
-- opt.foldexpr="nvim_treesitter#foldexpr()"
-- set foldmethod=expr
-- set foldexpr=nvim_treesitter#foldexpr()
--
opt.foldminlines = 2
opt.foldlevelstart = 1
opt.foldminlines = 3
opt.foldlevelstart = 0
opt.conceallevel=1 -- how to show text with :syn-conceal syntax
opt.list = false -- show tabs,trailing spaces and non-breakable spaces
opt.listchars = "tab: ,trail:,extends:#,nbsp:⋅,eol:" -- Highlight problematic whitespace
opt.list = true -- show tabs,trailing spaces and non-breakable spaces
opt.listchars = "tab: ,trail:•,extends:#,nbsp:." -- Highlight problematic whitespace
opt.diffopt:append("vertical")
opt.completeopt = "menu,menuone,noselect"
opt.wrap = false
@ -90,11 +74,9 @@ 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=2
opt.scrolloff=3
-- Allow :find to work on all subdirectories
-- this only works when the original dir path is not changed
@ -110,28 +92,16 @@ 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
-- backups
opt.backup = true
opt.backupcopy = "yes"
opt.backupdir = vim.fn.expand("~/.local/share/nvim/backups")
opt.backupdir = vim.fn.expand("$XDG_DATA_HOME/nvim/backups")
opt.sessionoptions="blank,buffers,curdir,folds,help,tabpages,winsize,resize,winpos"
-- interval for writing swap file to disk, also used by gitsigns
@ -164,7 +134,7 @@ local default_plugins = {
"syntax",
"synmenu",
"optwin",
-- "compiler",
"compiler",
"bugreport",
"ftplugin",
}
@ -173,11 +143,10 @@ for _, plugin in pairs(default_plugins) do
g["loaded_" .. plugin] = 1
end
-- disable some default providers
local default_providers = {
"node",
"perl",
-- "python3",
"python3",
"ruby",
}

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

@ -175,7 +175,7 @@ M.packer_sync = function(...)
end
M.bufilter = function()
local bufs = vim.t.bufs or {}
local bufs = vim.t.bufs
for i = #bufs, 1, -1 do
if not vim.api.nvim_buf_is_valid(bufs[i]) then

@ -2,72 +2,50 @@
local M = {}
local colors = {
neon = "#3ece8d",
flashred = "#ff4848",
}
local highlights = require "custom.highlights"
-- make sure you maintain the structure of `core/default_config.lua` here,
-- example of changing theme:
--
-- local custom_theme = require("spike.theme")
-- vim.tbl_deep_extend("force", M.ui.hl_add, custom_theme)
M.ui = {
-- theme = "gruvbox_material",
-- theme = "ayu-dark",
theme = "blob42",
theme_toggle = { "blob42", "chadracula"},
-- transparency = true,
hl_override = highlights.override,
hl_add = highlights.add,
-- 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
}
},
theme = "monekai",
theme_toggle = { "monekai", "blossom" },
-- hl_override = {
-- CursorLine = {
-- underline = 1
-- }
-- },
}
M.plugins = {
user = require "custom.plugins",
override = {
["NvChad/ui"] = {
-- tabufline = {
-- lazyload = false,
-- },
statusline = {
separator_style = 'block',
overriden_modules = function()
return require "custom.plugins.nvchadui"
end
},
tabufline = {
enabled = false,
}
},
["windwp/nvim-autopairs"] = {
disable_filetype = {
"TelescopePrompt",
"vim",
"guihua",
"guihua_rust",
"clap_input",
"markdown"
}
},
["nvim-treesitter/nvim-treesitter"] = require "custom.plugins.configs.treesitter",
}
user = require "custom.plugins",
override = {
-- ["NvChad/ui"] = {
-- tabufline = {
-- lazyload = false,
-- },
--
-- },
["nvim-treesitter/nvim-treesitter"] = {
ensure_installed = {
"lua",
"go",
"rust",
"fish",
"bash",
"python",
"c",
"haskell",
"javascript",
"html",
"markdown",
"markdown_inline",
"make",
"sql",
"yaml",
"toml",
"vue",
}
},
}
}
return M

@ -1,145 +0,0 @@
-- 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

@ -1,110 +1,75 @@
-- vim modeline
-- vim: foldmarker={,} foldmethod=marker foldlevel=0
local augroup = vim.api.nvim_create_augroup
local autocmd = vim.api.nvim_create_autocmd
local windowGroup = augroup("dkowindow", {})
-- FIXME: temporary fix for bug introduced in
-- https://github.com/neovim/neovim/commit/d52cc668c736ef6ca7ee3655a7eb7fe6475afadc
-- https://github.com/davidosomething/dotfiles/commit/95c0ac68936a8517d9c60b3e461b3e7b7fd076c1
-- Remove on next update
autocmd("WinLeave", {
callback = function()
if vim.bo.ft == "TelescopePrompt" and vim.fn.mode() == "i" then
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes("<Esc>", true, false, true),
"i",
false
)
end
end,
desc = "https://github.com/nvim-telescope/telescope.nvim/issues/2027",
group = windowGroup,
})
-- silence unwanted warnings
local notify = vim.notify
vim.notify = function(msg, ...)
if msg:match("warning: multiple different client offset_encodings") then
return
end
notify(msg, ...)
end
-- local augroup = vim.api.nvim_create_augroup
-- local autocmd = vim.api.nvim_create_autocmd
-- window closing
-- TODO: using dynamic C-x command
-- if character under cursor is number
-- use normal C-x or close window
--
-- highlights {
-- handled in chadrc ui
-- see also plugin/after highlihght.vim
-- vim.cmd[[ runtime highlight.vim ]]
vim.cmd [[
hi CursorLine gui=underline
]]
--}
-- Shift key typos{
-- vim.cmd [[
-- command! -bang -nargs=* -complete=file E e<bang> <args>
-- command! -bang -nargs=* -complete=file W w<bang> <args>
-- command! -bang -nargs=* -complete=file Wq wq<bang> <args>
-- command! -bang -nargs=* -complete=file WQ wq<bang> <args>
-- command! -nargs=* -complete=help H h <args>
-- command! -bang Wa wa<bang>
-- command! -bang WA wa<bang>
-- command! -bang Q q<bang>
-- command! -bang QA qa<bang>
-- command! -bang Qa qa<bang>
-- ]]
vim.cmd [[
command! -bang -nargs=* -complete=file E e<bang> <args>
command! -bang -nargs=* -complete=file W w<bang> <args>
command! -bang -nargs=* -complete=file Wq wq<bang> <args>
command! -bang -nargs=* -complete=file WQ wq<bang> <args>
command! -nargs=* -complete=help H h <args>
command! -bang Wa wa<bang>
command! -bang WA wa<bang>
command! -bang Q q<bang>
command! -bang QA qa<bang>
command! -bang Qa qa<bang>
]]
--}
-- suckless {
-- vim.cmd [[
-- " Autocompile suckless
-- " 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 BufWritePost " . dwm_file_patterns . " :AsyncRun! make clean && make && sudo make install"
-- "au BufWritePost */src/*/dwm*/{*.h,dwm.c} :AsyncRun! make clean && make && doas make install
-- au BufWritePost */suckless/*/{*.h,*.c} :AsyncRun! make clean && make && doas make install"
-- augroup END
-- ]]
vim.cmd [[
" Autocompile suckless
let dwm_file_patterns = expand("$HOME/.local/src/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"
"au BufWrite */src/*/dwm*/{*.h,dwm.c} :AsyncRun! make clean && make && sudo make install
augroup END
]]
--}
-- Make asyncrun work with fugitive {
-- vim.cmd [[
-- augroup asyncrun
-- au!
-- command -bang -nargs=* -complete=file Make AsyncRun -program=make @ <args>
-- augroup END
-- ]]
vim.cmd [[
augroup asyncrun
au!
command -bang -nargs=* -complete=file Make AsyncRun -program=make @ <args>
augroup END
]]
--}
-- gopass{
-- vim.cmd [[
-- augroup gopass
-- au!
-- au BufNewFile,BufRead /dev/shm/gopass* setlocal noswapfile nobackup noundofile
-- augroup END
-- ]]
vim.cmd [[
augroup gopass
au!
au BufNewFile,BufRead /dev/shm/gopass* setlocal noswapfile nobackup noundofile
augroup END
]]
--}
-- plantuml {
-- vim.cmd [[
-- au FileType plantuml let g:plantuml_previewer#plantuml_jar_path = get(
-- \ matchlist(system('cat `which plantuml` | grep plantuml.jar'), '\v.*\s[''"]?(\S+plantuml\.jar).*'),
-- \ 1,
-- \ 0
-- \)
-- ]]
vim.cmd [[
au FileType plantuml let g:plantuml_previewer#plantuml_jar_path = get(
\ matchlist(system('cat `which plantuml` | grep plantuml.jar'), '\v.*\s[''"]?(\S+plantuml\.jar).*'),
\ 1,
\ 0
\)
]]
-- }

@ -1,241 +0,0 @@
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

@ -1,90 +0,0 @@
local M = {}
local config = {
-- welcome_message = WELCOME_MESSAGE,
loading_text = "loading",
question_sign = "", -- you can use emoji if you want e.g. 🙂
answer_sign = "", -- 🤖
max_line_length = 120,
yank_register = "+",
chat_layout = {
relative = "editor",
position = "50%",
size = {
height = "80%",
width = "80%",
},
},
settings_window = {
border = {
style = "rounded",
text = {
top = " Settings ",
},
},
},
chat_window = {
filetype = "chatgpt",
border = {
highlight = "FloatBorder",
style = "rounded",
text = {
top = " ChatGPT ",
},
},
},
chat_input = {
prompt = "",
border = {
highlight = "FloatBorder",
style = "rounded",
text = {
top_align = "center",
top = " Prompt ",
},
},
},
openai_params = {
model = "gpt-3.5-turbo",
frequency_penalty = 0,
presence_penalty = 0,
max_tokens = 300,
temperature = 0,
top_p = 1,
n = 1,
},
openai_edit_params = {
model = "code-davinci-edit-001",
temperature = 0,
top_p = 1,
n = 1,
},
keymaps = {
close = { "<C-c>" },
submit = "<C-Enter>",
yank_last = "<C-y>",
yank_last_code = "<C-k>",
scroll_up = "<C-u>",
scroll_down = "<C-d>",
toggle_settings = "<C-o>",
new_session = "<C-n>",
cycle_windows = "<Tab>",
-- in the Sessions pane
select_session = "<Space>",
rename_session = "r",
delete_session = "d",
},
}
M.setup = function()
local ok, chatgpt = pcall(require, 'chatgpt')
if not ok then
vim.notify("missing module chatgpt", vim.log.levels.WARN)
return
end
chatgpt.setup(config)
end
return M

@ -1,72 +0,0 @@
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",
max_tokens = 8192,
temperature = 0.4,
-- 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

@ -1,62 +0,0 @@
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

@ -1,33 +0,0 @@
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

@ -1,9 +0,0 @@
local M = {}
local opts = {
}
M.setup = function()
end
return M

@ -1,90 +0,0 @@
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

@ -1,182 +0,0 @@
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

@ -4,14 +4,9 @@ if not present then
return
end
local options = {
fzf.register_ui_select()
keymap = {
fzf = {
["ctrl-c"] = "abort",
["ctrl-z"] = "abort",
},
},
local options = {
fzf_opts = {
['--layout'] = 'default',

@ -1,32 +0,0 @@
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

@ -1,39 +0,0 @@
local dapui_cfg = require("custom.plugins.configs.dapui").opts
local M = {}
local config = {
-- verbose = true,
run_in_floaterm = false,
icons = false,
-- icons = { breakpoint = "🧘", currentpos = "🏃" }, -- set to false to disable
lsp_cfg = false, -- handled instead by navigator
lsp_keymaps = false, -- use navigator
-- lsp_diag_signs = false,
lsp_codelens = false, -- use navigator
textobjects = true,
dap_debug_keymap = false,
dap_debug_gui = dapui_cfg,
-- dap_debug_vt = false,
log_path = vim.fn.stdpath('cache') .. '/gonvim.log',
lsp_inlay_hints = {
enable = false,
-- only_current_line = true,
}
}
function M.setup()
local ok, null_ls = pcall(require, 'null-ls')
if not ok then
vim.notify("missing module null-ls", vim.log.levels.WARN)
end
require("go").setup(config)
local gotest = require('go.null_ls').gotest()
local gotest_codeaction = require("go.null_ls").gotest_action()
null_ls.register(gotest)
null_ls.register(gotest_codeaction)
end
return M

@ -1,22 +0,0 @@
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

@ -1,36 +0,0 @@
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()

@ -1,35 +0,0 @@
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

@ -1,8 +0,0 @@
local present, leap = pcall(require, "leap")
if not present then
return
end
leap.set_default_keymaps()
leap.opts.special_keys.next_match = "<Space>"
leap.opts.special_keys.prev_match = "<BS>"

@ -1,42 +0,0 @@
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

@ -1,18 +0,0 @@
local present, signature = pcall(require, "lsp_signature")
if not present then
return
end
local config = {
floating_window = true,
hint_enable = true,
}
local M = {}
M.setup = function()
signature.setup(config)
end
return M

@ -1,44 +0,0 @@
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

@ -1,23 +0,0 @@
local present, marks = pcall(require, "marks")
if not present then
return
end
local M = {}
local config = {
bookmark_0 = {
sign= "",
virt_text = "vim",
annotate = true,
}
}
M.setup = function()
marks.setup(config)
end
return M

@ -1,150 +1,89 @@
local present, navigator = pcall(require, "navigator")
if not present then
return
end
local myicons = require("custom.chadrc").ui.myicons
M = {}
local get_current_gomod = function()
local file = io.open('go.mod', 'r')
if file == nil then
return nil
end
local first_line = file:read()
local mod_name = first_line:gsub('module ', '')
file:close()
return mod_name
end
-- default config
-- "~/.local/share/nvim/site/pack/packer/opt/navigator.lua/lua/navigator.lua"
-- "~/.local/share/nvim/site/pack/packer/opt/navigator.lua/lua/navigator/lspclient/mapping.lua"
local config = {
debug = false,
-- debug = true,
transparency = 5,
lsp_signature_help = false, -- needs plugin lsp_signature
lsp_signature_help = true,
default_mapping = false,
on_attach = require('plugins.configs.lspconfig').on_attach,
keymaps = {
{ key = 'gr', func = require('navigator.reference').async_ref, desc = 'lsp async_ref' },
{ key = '<Leader>gr', func = require('navigator.reference').reference, desc = 'lsp reference' }, -- reference deprecated
{ mode = 'i', key = '<M-k>', func = vim.lsp.signature_help, desc = 'lsp signature_help' },
{ key = '<c-k>', func = vim.lsp.buf.signature_help, desc = 'lsp signature_help' },
{ key = 'g0', func = require('navigator.symbols').document_symbols, desc = 'lsp document_symbols' },
{ key = 'gW', func = require('navigator.workspace').workspace_symbol_live, desc = 'lsp workspace_symbol_live' },
{ key = '<c-]>', func = require('navigator.definition').definition, desc = 'lsp definition' },
{ key = 'gd', func = require('navigator.definition').definition, desc = 'lsp definition' },
{ key = 'gD', func = vim.lsp.buf.declaration, desc = 'lsp declaration' },
{ key = 'gp', func = require('navigator.definition').definition_preview, desc = 'lsp definition_preview' },
{ key = '<Leader>gt', func = require('navigator.treesitter').buf_ts, desc = 'lsp buf_ts' },
{ 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 = '<Space>ca', mode = 'n', func = require('navigator.codeAction').code_action, desc = 'lsp code_action' },
{
key = 'gr',
func = require('navigator.reference').async_ref,
desc = 'lsp async_ref'
},
{
key = '<leader>lr',
func = require('navigator.reference').reference,
desc = 'lsp reference'
},
{
key = 'g0',
func = require('navigator.symbols').document_symbols,
desc = 'lsp document_symbols'
},
{
key = 'gW',
func = require('navigator.workspace').workspace_symbol_live,
desc = 'lsp workspace_symbol_live'
},
{
key = '<c-]>',
func = require('navigator.definition').definition,
desc = 'lsp definition'
},
{
key = '<C-LeftMouse>',
func = require('navigator.definition').definition,
desc = "lsp definition"
},
{ key = 'gd', func = require('navigator.definition').definition, desc = 'definition' },
{ key = 'gD', func = vim.lsp.buf.declaration, desc = 'declaration' },
{ key = 'gm', func = vim.lsp.buf.implementation, desc = 'implementation' },
{ key = 'g<LeftMouse>', func = vim.lsp.buf.implementation, desc = 'implementation' },
{
key = 'gp',
func = require('navigator.definition').definition_preview,
desc = 'lsp definition preview'
},
{ key = "<BS>h", func = function()
vim.lsp.inlay_hint(0, nil)
end, desc = "toggle lsp hints"},
{ key = '<leader>D', func = vim.lsp.buf.type_definition, desc = 'type_definition' },
{ key = '<leader>Dp', func = require('navigator.definition').type_definition_preview, desc = 'lsp type definition preview' },
{ 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 = '<BS><Right>', mode = 'n', func = require('navigator.symbols').side_panel, desc = 'toggle lsp outline pannel'},
{
key = '<M-a>',
key = '<Space>ca',
mode = 'v',
func = require('navigator.codeAction').range_code_action,
desc = 'lsp range_code_action',
},
-- { key = '<Leader>re', func = 'rename()' },
{ key = '<Space>rn', func = require('navigator.rename').rename, desc = 'lsp rename' },
{ key = '<Leader>gi', func = vim.lsp.buf.incoming_calls, desc = 'lsp incoming_calls' },
{ key = '<Leader>gc', func = vim.lsp.buf.incoming_calls, desc = 'lsp incoming_calls' },
{ key = '<Leader>go', func = vim.lsp.buf.outgoing_calls, desc = 'lsp outgoing_calls' },
{ key = '<Leader>gi', func = vim.lsp.buf.implementation, desc = 'lsp implementation' },
{ key = '<Space>D', func = vim.lsp.buf.type_definition, desc = 'lsp type_definition' },
{ 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' },
--TODO: toggle diagnostics
{
key = ']d',
func = vim.diagnostic.goto_next,
desc = 'next diagnostics',
},
{
key = '[d',
func = vim.diagnostic.goto_prev,
desc = 'prev diagnostics',
},
{
key = ']O',
func = vim.diagnostic.set_loclist,
desc = 'diagnostics set loclist',
},
{ key = '<Leader>dt', func = require('navigator.diagnostics').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' },
{ key = ']r', func = require('navigator.treesitter').goto_next_usage, desc = 'lsp goto_next_usage' },
{ key = '[r', func = require('navigator.treesitter').goto_previous_usage, desc = 'lsp goto_previous_usage' },
{
key = '<leader>lf',
func = vim.lsp.buf.format,
mode = 'n',
desc = 'lsp format'
},
{
key = '<leader>lf',
func = vim.lsp.buf.range_formatting,
mode = 'v',
desc = 'lsp range format'
},
{ 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 = '<leader>wa', func = require('navigator.workspace').add_workspace_folder, desc = 'lsp add_workspace_folder' },
{ key = '<Space>wa', func = require('navigator.workspace').add_workspace_folder, desc = 'lsp add_workspace_folder' },
{
key = '<leader>wr',
key = '<Space>wr',
func = require('navigator.workspace').remove_workspace_folder,
desc = 'lsp lsp remove_workspace_folder',
},
{ 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' },
{ key = '<Space>ff', 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' },
{
key = '<Space>gm',
func = require('navigator.formatting').range_format,
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' },
},
icons = {
icons = true, -- set to false to use system default ( if you using a terminal does not have nerd/icon)
-- Code action
code_action_icon = '', -- "",
code_action_icon = '', -- "",
-- code lens
code_lens_action_icon = '',
code_lens_action_icon = '',
-- Diagnostics
diagnostic_head = myicons.lsp.diagnostic_head, -- default diagnostic head on dialogs
diagnostic_err = myicons.lsp.diagnostic_err, -- severity 1
diagnostic_warn = myicons.lsp.diagnostic_warn, -- 2
diagnostic_info = myicons.lsp.diagnostic_info, -- 3
diagnostic_hint = myicons.lsp.diagnostic_hint, -- 4
diagnostic_head = '', -- default diagnostic head on dialogs
diagnostic_err = '', -- severity 1
diagnostic_warn = '', -- 2
diagnostic_info = '', -- 3
diagnostic_hint = '', -- 4
-- used in the diagnostics summary window
diagnostic_head_severity_1 = '',
@ -152,12 +91,10 @@ local config = {
diagnostic_head_severity_3 = 'i',
diagnostic_head_description = ' ',
diagnostic_virtual_text = '',
diagnostic_file = '',
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 = '',
@ -169,26 +106,25 @@ local config = {
},
-- Treesitter
match_kinds = {
var = '',
method = 'ƒ ',
['function'] = '',
parameter = '',
associated = '',
namespace = '',
var = '', -- "👹", -- Vampaire
method = 'ƒ ', -- "🍔", -- mac
['function'] = '', -- "🤣", -- Fun
parameter = '', -- Pi
associated = '🤝',
namespace = '🚀',
type = '',
field = '',
module = '',
flag = '',
field = '🏈',
module = '📦',
flag = '🎏',
},
treesitter_defult = '',
treesitter_defult = '🌲',
doc_symbols = '',
},
mason = true,
mason_disabled_for = {"ccls"}, -- disable mason for specified lspclients
lsp = {
document_highlight = false,
mason = true,
format_on_save = false, -- applies to all formatting feature of neovim
-- including auto-fold
-- including auto-fold
diagnostic = {
underline = true,
virtual_text = {
@ -196,109 +132,16 @@ local config = {
source = true
}, -- show virtual for diagnostic message
update_in_insert = false, -- update diagnostic message in insert mode
severity_sort = { reverse = false },
severity_sort = { reverse = true },
},
code_action = {
delay = 6000, -- 5 sec delay
virtual_text_icon = false,
},
diagnostic_scrollbar_sign = false,
display_diagnostic_qf = false,
disable_lsp = {"clangd", "rust_analyzer"},
-- disable_lsp = {"sqls"},
-- disable auto start of lsp per language
-- set global default on lspconfig (see lspconfig doc)
gopls = {
-- cmd = { "nc", "localhost", "9999" },
-- cmd = {"socat", "-" ,"tcp:localhost:4444"},
-- on_attach = require("spike.lsp.go").custom_attach,
on_attach = require("spike.lsp.go").gopls_onattach,
settings = {
flags = { allow_incremental_sync = true, debounce_text_changes = 500 },
gopls = {
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
},
analyses = {
unreachable = true,
nilness = true,
unusedparams = true,
useany = true,
unusedwrite = true,
ST1003 = true,
undeclaredname = true,
fillreturns = true,
nonewvars = true,
fieldalignment = false,
shadow = true,
},
codelenses = {
generate = true, -- show the `go generate` lens.
gc_details = true, -- Show a code lens toggling the display of gc's choices.
test = true,
tidy = true,
vendor = true,
regenerate_cgo = true,
upgrade_dependency = true,
},
usePlaceholders = true,
completeUnimported = true,
staticcheck = true,
matcher = 'Fuzzy',
diagnosticsDelay = '500ms',
symbolMatcher = 'fuzzy',
['local'] = get_current_gomod(),
-- gofumpt = _GO_NVIM_CFG.lsp_gofumpt or false, -- true|false, -- turn on for new repos, gofmpt is good but also create code turmoils
buildFlags = { '-tags', 'integration' },
}
}
},
pylsp = {
settings = {
pylsp = {
plugins = {
black = { enabled = true},
autopep8 = { enabled = false },
-- pylint = { enabled = false }, -- disabled in null-ls
flake8 = { enabled = false },
mccabe = { enabled = false },
pycodestyle= { enabled = false},
pyflakes = { enabled = false },
-- install python-lsp-ruff
-- if using mason activate venv from mason package
-- and install inside venv
-- select isort and pycodestyle
ruff = { enabled = true, select = {"I", "E"}}
}
}
}
},
lua_ls = {
before_init=require("neodev.lsp").before_init,
}
-- FIX: deperecated https://github.com/ray-x/navigator.lua/commit/1b2a0856f4adfffc5c4e785a6779c62759c8c926
-- ["neodev"] = {
-- library = {
-- enabled = true,
-- runtime = true,
-- -- plugins = true,
-- plugins = {"plenary.nvim"},
-- -- plugins = {"navigator.lua", "guihua.lua", "go.nvim", "plenary.nvim"},
-- types = true,
-- },
-- setup_jsonls = true,
-- },
-- ["lua-dev"] = { -- only for lua-dev.nvim
-- autostart = false,
-- }
}
}
@ -308,18 +151,18 @@ end
-- make sure LSP is not started automatically
-- TODO: how to it per project basis
-- M.enable = function()
-- local lspconfig = require("lspconfig")
-- lspconfig.util.default_config = vim.tbl_extend(
-- "force",
-- lspconfig.util.default_config,
-- {
-- autostart = true
-- }
-- )
-- vim.cmd[[
-- LspStart
-- ]]
-- end
M.enable = function()
local lspconfig = require("lspconfig")
lspconfig.util.default_config = vim.tbl_extend(
"force",
lspconfig.util.default_config,
{
autostart = true
}
)
vim.cmd[[
LspStart
]]
end
return M

@ -1,107 +0,0 @@
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

@ -1,54 +0,0 @@
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

@ -1,44 +0,0 @@
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

@ -1,70 +0,0 @@
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

@ -1,17 +0,0 @@
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

@ -1,34 +0,0 @@
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

@ -1,18 +0,0 @@
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

@ -1,36 +0,0 @@
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

@ -1,188 +0,0 @@
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

@ -1,20 +0,0 @@
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

@ -1,22 +0,0 @@
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"
}
end
return M

@ -1,43 +0,0 @@
local present, todo = pcall(require, "todo-comments")
if not present then
return
end
local colors = require("custom.themes.blob42").base_30
local M = {}
local config = {
keywords = {
TODO = { icon = ""},
["_TODO"] = {
color = "warning",
alt = {"TODO!"}, -- a set of other keywords that all map to this FIX keywords
},
LEARN = { color = "hint" },
WIP = { color = "default", alt = {"REFACT"}},
NOTE = { alt = { "TIP", "INFO", "TRICK", "RELEASE"}},
DEBUG = { alt = { "DBG", }, color = "debug" },
REVIEW = { color = "info" }
},
colors = {
hint = {colors.green},
info = {colors.blue},
default = {colors.nord_blue},
warning = {colors.orange},
error = { colors.red },
debug = { colors.purple }
},
highlight = {
-- multiline = false,
after = "",
}
}
M.setup = function()
todo.setup(config)
end
return M

@ -1,19 +0,0 @@
local ok, tscontext = pcall(require,"treesitter-context")
if not ok then return end
local M = {}
local config = {
enable = true
}
M.config = config
function M.setup()
tscontext.setup(config)
end
return M

@ -0,0 +1,79 @@
local present, treesitter = pcall(require, "nvim-treesitter.configs")
if not present then
return
end
local options = {
-- treesitter config (not textobjects)
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
}
},
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",
}
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
["]m"] = "@function.outer",
["]]"] = "@class.outer"
},
goto_next_end = {
["]M"] = "@function.outer",
["]["] = "@class.outer"
},
goto_previous_start = {
["[m"] = "@function.outer",
["[["] = "@class.outer"
},
goto_previous_end = {
["[M"] = "@function.outer",
["[]"] = "@class.outer"
}
},
swap = {
enable = true,
swap_next = {
["<leader>sw"] = "@parameter.inner"
},
swap_previous = {
["<leader>sW"] = "@parameter.inner"
}
}
}
}
treesitter.setup(options)

@ -1,118 +0,0 @@
return {
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
},
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,
-- },
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",
["]C"] = "@class.outer",
["]f"] = "@field.outer",
},
goto_next_end = {
["]["] = "@function.outer",
},
goto_previous_start = {
["[["] = "@function.outer",
["[C"] = "@class.outer",
["[f"] = "@field.outer",
},
goto_previous_end = {
["[]"] = "@function.outer",
}
},
swap = {
enable = false, -- swap using syntax-tree-surfer
swap_next = {
["~"] = "@parameter.inner"
},
}
},
playground = {
enable = true,
}
}

@ -1,31 +0,0 @@
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

@ -1,33 +0,0 @@
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

@ -0,0 +1,24 @@
local M = {}
M.set_mappings = function ()
vim.cmd [[
nnoremap <leader>I :tab Info<CR>
augroup INFO
au!
au FileType info nnoremap i <NOP>
au FileType info nmap <buffer> <Up> <Plug>(InfoUp)
au FileType info nmap <buffer> iu <Plug>(InfoUp)
au FileType info nmap <buffer> <Down> <Plug>(InfoMenu)
au FileType info nmap <buffer> im <Plug>(InfoMenu)
au FileType info nmap <buffer> <C-F> <Plug>(InfoFollow)
au FileType info nmap <buffer> if <Plug>(InfoFollow)
au FileType info nmap <buffer> <Right> <Plug>(InfoNext)
au FileType info nmap <buffer> in <Plug>(InfoNext)
au FileType info nmap <buffer> <Left> <Plug>(InfoPrev)
au FileType info nmap <buffer> ip <Plug>(InfoPrev)
au FileType info nmap <buffer> ig <Plug>(InfoGoto)
augroup END
]]
end
return M

File diff suppressed because it is too large Load Diff

@ -1,192 +0,0 @@
-- called in chadrc
-- statusline=%!v:lua.require('nvchad_ui').statusline()
-- vim.o.statusline="%.40(%{expand('%:p:h:t')}/%t%)"
local fn = vim.fn
local sep_style = vim.g.statusline_sep_style
local separators = (type(sep_style) == "table" and sep_style)
or require("nvchad_ui.icons").statusline_separators[sep_style]
local sep_l = separators["left"]
local sep_r = separators["right"]
local myicons = require("custom.chadrc").ui.myicons
local modes = {
["n"] = { "NORMAL", "St_NormalMode" },
["niI"] = { "NORMAL i", "St_NormalMode" },
["niR"] = { "NORMAL r", "St_NormalMode" },
["niV"] = { "NORMAL v", "St_NormalMode" },
["no"] = { "N-PENDING", "St_NormalMode" },
["i"] = { "INSERT", "St_InsertMode" },
["ic"] = { "INSERT (completion)", "St_InsertMode" },
["ix"] = { "INSERT completion", "St_InsertMode" },
["t"] = { "TERMINAL", "St_TerminalMode" },
["nt"] = { "NTERMINAL", "St_NTerminalMode" },
["v"] = { "VISUAL", "St_VisualMode" },
["V"] = { "V-LINE", "St_VisualMode" },
["Vs"] = { "V-LINE (Ctrl O)", "St_VisualMode" },
[""] = { "V-BLOCK", "St_VisualMode" },
["R"] = { "REPLACE", "St_ReplaceMode" },
["Rv"] = { "V-REPLACE", "St_ReplaceMode" },
["s"] = { "SELECT", "St_SelectMode" },
["S"] = { "S-LINE", "St_SelectMode" },
[""] = { "S-BLOCK", "St_SelectMode" },
["c"] = { "COMMAND", "St_CommandMode" },
["cv"] = { "COMMAND", "St_CommandMode" },
["ce"] = { "COMMAND", "St_CommandMode" },
["r"] = { "PROMPT", "St_ConfirmMode" },
["rm"] = { "MORE", "St_ConfirmMode" },
["r?"] = { "CONFIRM", "St_ConfirmMode" },
["!"] = { "SHELL", "St_TerminalMode" },
}
local function is_dapmode()
if not _BLOB42_DAPMODE_LOADED then return false end
return require("spike.dap.dapmode").is_active()
-- return false
end
return {
mode = function()
local m = vim.api.nvim_get_mode().mode
local current_mode = "%#" .. modes[m][2] .. "# " .. modes[m][1]
local mode_sep1 = "%#" .. modes[m][2] .. "Sep" .. "#" .. sep_r
if is_dapmode() then
local dap_mode = "%#St_DapMode# DAP" .. "%#St_DapModeSep#"
return current_mode .. mode_sep1 .. dap_mode .. sep_r
end
return current_mode .. mode_sep1
end,
fileInfo = function()
local icon = ""
local filepath = fn.expand "%:p:h:t" .. '/%t'
local filetype = '%y '
local filename = (fn.expand "%" == "" and "Empty ") or filepath
local modified = (vim.bo[0].modified and "+ ") or ""
if filename ~= "Empty " then
local devicons_present, devicons = pcall(require, "nvim-web-devicons")
if devicons_present then
local ft_icon = devicons.get_icon(filename)
icon = (ft_icon ~= nil and " " .. ft_icon) or ""
end
filename = " " .. filetype .. filename .. " "
end
return "%#St_file_info#" .. icon .. filename .. "[%n] " .. modified .. "%#St_file_sep#" .. sep_r
end,
LSP_Diagnostics = function()
if not rawget(vim, "lsp") then
return ""
end
local errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
local warnings = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN })
local hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT })
local info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO })
errors = (errors and errors > 0) and ("%#St_lspError#" .. myicons.lsp.diagnostic_err .. " " .. errors .. " ") or
""
warnings = (warnings and warnings > 0) and
("%#St_lspWarning#" .. myicons.lsp.diagnostic_warn .. " " .. warnings .. " ") or ""
hints = (hints and hints > 0) and ("%#St_lspHints#" .. myicons.lsp.diagnostic_hint .. " " .. hints .. " ") or ""
info = (info and info > 0) and ("%#St_lspInfo#" .. myicons.lsp.diagnostic_info .. " " .. info .. " ") or ""
if vim.o.columns > 120 then
return errors .. warnings .. hints .. info
else
return ""
end
end,
LSP_progress = function()
if not rawget(vim, "lsp") or vim.lsp.status then
return ""
end
local Lsp = vim.lsp.status()[1]
-- hide spammy null-ls progress
if Lsp and Lsp.name:match "null%-ls" then
return ""
end
if vim.o.columns < 120 or not Lsp then
return ""
end
local msg = Lsp.message or ""
local percentage = Lsp.percentage or 0
local title = Lsp.title or ""
local spinners = { "", "" }
local ms = vim.loop.hrtime() / 1000000
local frame = math.floor(ms / 120) % #spinners
local content = string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage)
return ("%#St_LspProgress#" .. content) or ""
end,
LSP_status = function()
local lsp_status = ""
local dap_status = ""
if rawget(vim, "lsp") then
for _, client in ipairs(vim.lsp.get_active_clients()) do
if client.attached_buffers[vim.api.nvim_get_current_buf()] then
lsp_status = (vim.o.columns > 100 and "%#St_LspStatus#" .. "[" .. client.name .. "]") or "%#St_LspStatus#" .. ""
end
end
end
if _BLOB42_DAPMODE_LOADED then
local present, dap = pcall(require, "dap")
if present then
local session = dap.session()
if session ~= nil and session.initialized == true then
dap_status = "%#St_Dap#" .. "%* "
end
end
end
return lsp_status .. dap_status
end,
cwd = function()
local dir_icon = "%#St_cwd_icon#" .. ""
local dir_name = "%#St_cwd_text#" .. " " .. fn.fnamemodify(fn.getcwd(), ":p:~") .. " "
return (vim.o.columns > 85 and ("%#St_file_sep_rev#" .. sep_r .. dir_name)) or ""
end,
cursor_position = function()
text = '%l,%c%V%\\ %p%%'
return "%#St_pos_text#" .. " " .. text .. " "
end,
git = function()
if not vim.b.gitsigns_head or vim.b.gitsigns_git_status then
return ""
end
local git_status = vim.b.gitsigns_status_dict
local added = (git_status.added and git_status.added ~= 0) and ("" .. git_status.added) or ""
local changed = (git_status.changed and git_status.changed ~= 0) and ("" .. git_status.changed) or ""
local removed = (git_status.removed and git_status.removed ~= 0) and ("" .. git_status.removed) or ""
local branch_name = "" .. git_status.head .. " "
if vim.o.columns > 120 then
return "%#St_gitIcons#" .. branch_name .. added .. changed .. removed
else
return ""
end
end
}

@ -1,86 +0,0 @@
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

@ -0,0 +1,22 @@
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,7 +1,7 @@
local present, cmp = pcall(require, "cmp")
if not present then
return
return
end
require("base46").load_highlight "cmp"
@ -9,186 +9,117 @@ 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
end
local has_words_before = function()
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then return false end
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_text(0, line-1, 0, line-1, col, {})[1]:match("^%s*$") == nil
local info = self:info_()
info.scrollable = false
return info
end
local options = {
-- 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,
window = {
completion = {
border = border "CmpBorder",
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
},
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,
documentation = {
border = border "CmpDocBorder",
},
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.jumpable(1) then
luasnip.jump(1)
elseif luasnip.expandable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
})
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() and has_words_before() 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() and has_words_before() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
},
sources = {
{ name = "luasnip", priority = 1000, group_index = 2 },
{ name = "nvim_lua", priority = 900, group_index = 2 },
{ name = "nvim_lsp", priority = 800, group_index = 2 },
{
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
},
priority = 700,
group_index = 2,
},
-- { name = "copilot", priority = 100, group_index = 2 },
{ name = "path", group_index = 2 },
},
sorting = {
priority_weight = 2,
comparators = {
-- require("copilot_cmp.comparators").prioritize,
-- Below is the default comparitor list and order for nvim-cmp
cmp.config.compare.offset,
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
cmp.config.compare.exact,
cmp.config.compare.score,
cmp.config.compare.recently_used,
cmp.config.compare.locality,
cmp.config.compare.kind,
cmp.config.compare.sort_text,
cmp.config.compare.length,
cmp.config.compare.order,
},
},
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,
},
-- 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" },
{ name = "nvim_lsp_signature_help" },
},
}
-- check for any override

@ -1,99 +1,80 @@
-- 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"
--
local M = {}
require("base46").load_highlight "lsp"
require "nvchad_ui.lsp"
function M.setup()
lspconfig.util.default_config = vim.tbl_extend(
"force",
lspconfig.util.default_config,
{
autostart = false
})
local M = {}
local utils = require "core.utils"
end
-- export on_attach & capabilities for custom lspconfigs
-- my custom on_attach to inject in other lsp clients
-- called from navigator config
M.on_attach = function(client, bufnr)
require('core.utils').load_mappings 'lspconfig'
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,
},
},
},
}
-- 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,
-- }
lspconfig.gopls.setup {
on_attach = M.on_attach,
capabilities = M.capabilities,
}
return M

@ -20,7 +20,7 @@ local options = {
icons = {
package_pending = "",
package_installed = "",
package_uninstalled = "",
package_uninstalled = "",
},
keymaps = {

@ -41,8 +41,6 @@ local options = {
},
},
renderer = {
symlink_destination = false,
highlight_git = false,
highlight_opened_files = "none",

@ -12,13 +12,13 @@ local options = {
type_opts = {
float = {
relative = "editor",
row = 0.15,
col = 0.2,
width = 0.6,
height = 0.6,
border = "shadow",
row = 0.3,
col = 0.25,
width = 0.5,
height = 0.4,
border = "single",
},
horizontal = { location = "rightbelow", split_ratio = 0.4 },
horizontal = { location = "rightbelow", split_ratio = 0.3 },
vertical = { location = "rightbelow", split_ratio = 0.5 },
},
},

@ -55,14 +55,12 @@ M.blankline = function()
buftype_exclude = { "terminal" },
show_trailing_blankline_indent = false,
show_first_indent_level = false,
show_current_context = true,
show_current_context_start = true,
show_end_of_line = true,
show_current_context = false,
show_current_context_start = false,
}
options = load_override(options, "lukas-reineke/indent-blankline.nvim")
blankline.setup(options)
require("theme.highlights").blankline()
end
M.colorizer = function()
@ -107,6 +105,57 @@ 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")
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" },
},
}
options = load_override(options, "lewis6991/gitsigns.nvim")
gitsigns.setup(options)
end
M.devicons = function()
local present, devicons = pcall(require, "nvim-web-devicons")

@ -1,7 +1,6 @@
local present, telescope = pcall(require, "telescope")
if not present then
vim.notify("missing module telescope", vim.log.levels.WARN)
return
end
@ -11,9 +10,6 @@ require("base46").load_highlight "telescope"
local options = {
defaults = {
preview = {
treesitter = false
},
vimgrep_arguments = {
"rg",
"--color=never",
@ -39,8 +35,8 @@ local options = {
vertical = {
mirror = false,
},
width = 0.99,
height = 0.99,
width = 0.87,
height = 0.80,
preview_cutoff = 120,
},
file_sorter = require("telescope.sorters").get_fuzzy_file,
@ -50,7 +46,7 @@ local options = {
winblend = 0,
border = {},
borderchars = { "", "", "", "", "", "", "", "" },
color_devicons = false,
color_devicons = true,
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
@ -58,22 +54,17 @@ local options = {
-- Developer configurations: Not meant for general override
buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker,
mappings = {
n = {
["q"] = require('telescope.actions').close,
["<M-a>"] = require('telescope.actions').select_all,
},
n = { ["q"] = require("telescope.actions").close },
},
},
extensions_list = { "themes", "terms", "fzf" },
extensions_list = { "themes", "terms" },
}
-- check for any override
options = require("core.utils").load_override(options, "nvim-telescope/telescope.nvim")
telescope.setup(options)
-- load extensions
pcall(function()
for _, ext in ipairs(options.extensions_list) do

@ -4,7 +4,7 @@ if not present then
return
end
-- require("base46").load_highlight "treesitter"
require("base46").load_highlight "treesitter"
local options = {
ensure_installed = {

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

@ -2,10 +2,7 @@ vim.cmd "packadd packer.nvim"
local plugins = {
["nvim-lua/plenary.nvim"] = {
module = "plenary",
module_pattern = "plenary*",
},
["nvim-lua/plenary.nvim"] = { module = "plenary" },
["wbthomason/packer.nvim"] = {
cmd = require("core.lazy_load").packer_cmds,
config = function()
@ -19,30 +16,29 @@ local plugins = {
config = function()
local ok, base46 = pcall(require, "base46")
-- if ok then
-- base46.load_theme()
-- end
if ok then
base46.load_theme()
end
end,
},
["NvChad/ui"] = {
lock = true,
disable = false,
after = {"base46", "nvim-noirbuddy"},
after = "base46",
config = function()
require("plugins.configs.others").nvchad_ui()
end,
},
["NvChad/nvterm"] = {
module = "nvterm",
config = function()
require "plugins.configs.nvterm"
end,
setup = function()
require("core.utils").load_mappings "nvterm"
end,
},
-- ["NvChad/nvterm"] = {
-- module = "nvterm",
-- config = function()
-- require "plugins.configs.nvterm"
-- end,
-- setup = function()
-- require("core.utils").load_mappings "nvterm"
-- end,
-- },
["kyazdani42/nvim-web-devicons"] = {
after = "ui",
@ -53,7 +49,7 @@ local plugins = {
},
["lukas-reineke/indent-blankline.nvim"] = {
lock = false,
lock = true,
opt = true,
setup = function()
require("core.lazy_load").on_file_open "indent-blankline.nvim"
@ -87,6 +83,17 @@ local plugins = {
end,
},
-- git stuff
["lewis6991/gitsigns.nvim"] = {
ft = "gitcommit",
setup = function()
require("core.lazy_load").gitsigns()
end,
config = function()
require("plugins.configs.others").gitsigns()
end,
},
-- lsp stuff
["williamboman/mason.nvim"] = {
@ -132,9 +139,12 @@ local plugins = {
after = "LuaSnip",
},
["hrsh7th/cmp-nvim-lua"] = {
after = "cmp_luasnip",
},
["hrsh7th/cmp-nvim-lsp"] = {
after = {"nvim-cmp"},
after = "cmp-nvim-lua",
},
["hrsh7th/cmp-buffer"] = {
@ -174,7 +184,6 @@ local plugins = {
-- file managing , picker etc
["kyazdani42/nvim-tree.lua"] = {
commit = "9e87ee2",
ft = "alpha",
cmd = { "NvimTreeToggle", "NvimTreeFocus" },
config = function()
@ -187,7 +196,6 @@ local plugins = {
["nvim-telescope/telescope.nvim"] = {
cmd = "Telescope",
module = {"telescope"},
config = function()
require "plugins.configs.telescope"
end,

@ -1,167 +0,0 @@
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

@ -1,216 +0,0 @@
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

@ -1,84 +0,0 @@
---@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,66 +0,0 @@
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

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save