1 Commits

Author SHA1 Message Date
Zacharias-Brohn e157e8985f lazyvim branch 2025-04-07 16:25:04 +02:00
101 changed files with 1178 additions and 4494 deletions
+8 -2
View File
@@ -1,2 +1,8 @@
lazy-lock.json
.DS_Store
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data
+15
View File
@@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}
-14
View File
@@ -1,14 +0,0 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": false,
"singleQuote": false,
"overrides": [
{
"files": ".prettierrc",
"options": {
"parser": "json"
}
}
]
}
-6
View File
@@ -1,6 +0,0 @@
column_width = 80
line_endings = "Unix"
indent_type = "Tabs"
indent_width = 4
quote_style = "AutoPreferDouble"
call_parentheses = "None"
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+3 -49
View File
@@ -1,50 +1,4 @@
<div align="center">
<img src="/assets/neovim.png" width="600">
</div>
# 💤 LazyVim
# Neovim Configuration
Personal Neovim configuration using [lazy.nvim](https://github.com/folke/lazy.nvim) for plugin management.
## Features
- **LSP**: Native LSP with Mason for language server management
- **Completion**: Blink.cmp with Copilot integration
- **Fuzzy Finding**: Telescope for files and grep
- **File Explorer**: Snacks.nvim explorer
- **Git**: Fugitive, Gitsigns, and GitHub integration
- **AI**: Copilot and CopilotChat
- **UI**: Bufferline, Lualine, Dropbar, and various colorschemes
- **Navigation**: Harpoon, Kitty navigator for splits
- **Editing**: Treesitter, autopairs, rainbow delimiters, visual-multi
## Key Mappings
| Key | Action |
| ------------------- | ----------------------- |
| `<leader>e` | File explorer |
| `<leader>f` | Find files |
| `<leader>g` | Live grep |
| `<Tab>` / `<S-Tab>` | Cycle buffers |
| `<Alt-Arrow>` | Navigate splits (Kitty) |
| `<Alt-c>` | Toggle Copilot Chat |
| `<C-q>` | Toggle terminal |
| `<leader>u` | Undotree |
| `<leader>ap` | Code actions preview |
| `<leader>sp` | Colorscheme picker |
## Requirements
- Neovim >= 0.10
- Git
- A [Nerd Font](https://www.nerdfonts.com/)
- ripgrep (for Telescope grep)
## Installation
```bash
git clone https://github.com/Zacharias-Brohn/nvimdots ~/.config/nvim
nvim
```
Plugins will be installed automatically on first launch.
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 KiB

-13
View File
@@ -1,13 +0,0 @@
function! neoformat#formatters#qml#enabled() abort
return ['qmlformat']
endfunction
function! neoformat#formatters#qml#qmlformat() abort
return {
\ 'exe': '/usr/lib/qt6/bin/qmlformat',
\ 'args': ['-t', '-n', '--objects-spacing', '--functions-spacing', '-i'],
\ 'replace': 1,
\ 'stderr': 1,
\ 'stdin': 0
\ }
endfunction
-55
View File
@@ -1,55 +0,0 @@
{
"suggest.noselect": true,
"suggest.enablePreselect": false,
"suggest.triggerAfterInsertEnter": true,
"inlineSuggest.autoTrigger": false,
"suggest.completionItemKindLabels": {
"text": "",
"method": "",
"function": "",
"constructor": "",
"field": "",
"variable": "",
"class": "",
"interface": "",
"module": "",
"property": "",
"unit": "",
"value": "",
"enum": "",
"keyword": "",
"snippet": "",
"color": "",
"file": "",
"reference": "",
"folder": "",
"enumMember": "",
"constant": "",
"struct": "",
"event": "",
"operator": "",
"typeParameter": "",
"default": ""
},
"suggest.floatConfig": {
"maxWidth": 80,
"winblend": 1,
},
"suggest.virtualText": false,
"languageserver": {
"hyprlang": {
"command": "hyprls",
"filetypes": ["hyprlang"]
},
"qml": {
"command": "qmlls6",
"filetypes": ["qml"]
}
},
"git.addedSign.hlGroup": "GitGutterAdd",
"git.changedSign.hlGroup": "GitGutterChange",
"git.removedSign.hlGroup": "GitGutterDelete",
"coc.source.file.enable": true,
"coc.source.file.ignoreHidden": false,
}
-432
View File
@@ -1,432 +0,0 @@
-- Generated by zshell. Material 3 based Neovim colorscheme.
-- This file is a Jinja template rendered by zshell.
vim.g.colors_name = nil
vim.o.background = "dark"
vim.cmd("highlight clear")
if vim.fn.exists("syntax_on") == 1 then
vim.cmd("syntax reset")
end
vim.g.colors_name = "zshell"
vim.o.termguicolors = true
local set = vim.api.nvim_set_hl
local function hl(group, opts)
set(0, group, opts)
end
local function link(from, to)
hl(from, { link = to })
end
local is_light = "dark" == "light"
local function pick(light, dark)
return is_light and light or dark
end
local c = {
bg = "#1A1206",
bg_alt = "#231A0D",
bg_float = "#271E11",
bg_popup = "#32291A",
bg_cursorline = pick("#32291A", "#3D3324"),
bg_fold = "#231A0D",
bg_visual = "#733429",
bg_search = pick("#B5893E", "#733429"),
bg_incsearch = "#7D2C1E",
bg_selection = "#7D2C1E",
bg_statusline = pick("#32291A", "#271E11"),
bg_statusline_nc = "#231A0D",
bg_tabline = "#231A0D",
bg_tabsel = "#32291A",
fg = "#F1E0CA",
fg_muted = "#DBC3A1",
fg_subtle = "#A38E6E",
fg_comment = pick("#A38E6E", "#55442A"),
fg_strong = pick("#1A1B1F", "#F2F2F7"),
fg_on_soft = pick("#17181C", "#F4F4F8"),
border = "#55442A",
accent = "#FFB4A6",
accent_container = "#7D2C1E",
accent_fg = "#FFDAD4",
accent_solid_fg = "#5F150A",
secondary = "#FFB4A6",
secondary_container = "#733429",
secondary_fg = "#FFDAD4",
secondary_solid_fg = "#561E15",
tertiary = "#F0BE6D",
tertiary_container = "#B5893E",
tertiary_fg = "#000000",
tertiary_solid_fg = "#432C00",
error = "#FFB4AB",
error_container = "#93000A",
error_fg = "#FFDAD6",
error_solid_fg = "#690005",
ok = "#FFBD9D",
warn = "#FFDFD5",
info = "#B9AB66",
hint = "#FFBA8D",
add = "#FFBD9D",
change = "#B9AB66",
delete = "#FF563E",
cursor_fg = "#5F150A",
cursor_bg = "#FFB4A6",
match_bg = "#B5893E",
match_fg = "#000000",
todo_bg = "#B5893E",
todo_fg = "#000000",
-- Syntax accents must stay dynamic. These come from your generated palette
-- instead of fixed hex values, so foregrounds change with the wallpaper too.
code_keyword = "#F18F8A",
code_func = "#FFBA8D",
code_string = "#FFBD9D",
code_number = "#FFDFD5",
code_const = "#FF563E",
code_type = "#FFB4A6",
code_special = "#F0BE6D",
code_preproc = "#FFB4A6",
code_builtin = "#FFB4A6",
code_param = "#FFDFD5",
code_field = "#FFB4A6",
code_namespace = "#F0BE6D",
code_operator = pick("#FFB4A6", "#FFB4A6"),
line_current = pick("#232428", "#E7E7EC"),
ref_bg = pick("#3D3324", "#32291A"),
}
-- Core UI -------------------------------------------------------------------
hl("Normal", { fg = c.fg, bg = c.bg })
hl("NormalNC", { fg = c.fg, bg = c.bg })
hl("NormalFloat", { fg = c.fg, bg = c.bg_float })
hl("FloatBorder", { fg = c.border, bg = c.bg_float })
hl("FloatTitle", { fg = c.accent, bg = c.bg_float, bold = true })
hl("FloatFooter", { fg = c.fg_muted, bg = c.bg_float })
hl("WinSeparator", { fg = c.border, bg = "NONE" })
link("VertSplit", "WinSeparator")
hl("Cursor", { fg = c.cursor_fg, bg = c.cursor_bg })
link("lCursor", "Cursor")
link("CursorIM", "Cursor")
link("TermCursor", "Cursor")
hl("CursorLine", { bg = c.bg_cursorline })
hl("CursorColumn", { bg = c.bg_cursorline })
hl("ColorColumn", { bg = c.bg_alt })
hl("LineNr", { fg = c.fg_subtle, bg = c.bg })
hl("LineNrAbove", { fg = c.fg_subtle, bg = c.bg })
hl("LineNrBelow", { fg = c.fg_subtle, bg = c.bg })
hl("CursorLineNr", { fg = c.line_current, bg = c.bg_cursorline, bold = true })
hl("SignColumn", { fg = c.fg_muted, bg = c.bg })
hl("FoldColumn", { fg = c.fg_muted, bg = c.bg })
hl("Folded", { fg = c.fg_muted, bg = c.bg_fold, italic = true })
hl("NonText", { fg = c.border, bg = "NONE" })
link("EndOfBuffer", "NonText")
hl("Whitespace", { fg = c.border, bg = "NONE" })
hl("SpecialKey", { fg = c.border, bg = "NONE" })
hl("Visual", { bg = c.bg_visual })
link("VisualNOS", "Visual")
hl("Search", { fg = c.tertiary_fg, bg = c.bg_search })
hl("CurSearch", { fg = c.accent_fg, bg = c.bg_incsearch, bold = true })
link("IncSearch", "CurSearch")
hl("Substitute", { fg = c.accent_fg, bg = c.bg_incsearch, bold = true })
hl("MatchParen", { fg = c.match_fg, bg = c.match_bg, bold = true })
hl("Pmenu", { fg = c.fg, bg = c.bg_popup })
hl("PmenuSel", { fg = c.fg_on_soft, bg = c.bg_selection, bold = true })
hl("PmenuKind", { fg = c.secondary, bg = c.bg_popup })
hl("PmenuKindSel", { fg = c.fg_on_soft, bg = c.secondary_container, bold = true })
hl("PmenuExtra", { fg = c.fg_muted, bg = c.bg_popup })
hl("PmenuExtraSel", { fg = c.fg_on_soft, bg = c.bg_selection })
hl("PmenuSbar", { bg = c.bg_alt })
hl("PmenuThumb", { bg = c.border })
hl("PmenuMatch", { fg = c.accent, bg = c.bg_popup, bold = true })
hl("PmenuMatchSel", { fg = c.accent, bg = c.bg_selection, bold = true })
hl("PmenuBorder", { fg = c.border, bg = c.bg_popup })
hl("StatusLine", { fg = c.fg_strong, bg = c.bg_statusline })
hl("StatusLineNC", { fg = c.fg_muted, bg = c.bg_statusline_nc })
link("StatusLineTerm", "StatusLine")
link("StatusLineTermNC", "StatusLineNC")
hl("TabLine", { fg = c.fg_muted, bg = c.bg_tabline })
hl("TabLineFill", { bg = c.bg_tabline })
hl("TabLineSel", { fg = c.fg_on_soft, bg = c.accent_container, bold = true })
hl("WinBar", { fg = c.fg, bg = c.bg })
hl("WinBarNC", { fg = c.fg_muted, bg = c.bg })
hl("Directory", { fg = c.accent, bg = "NONE" })
hl("Title", { fg = c.accent, bg = "NONE", bold = true })
hl("Question", { fg = c.secondary, bg = "NONE", bold = true })
hl("ModeMsg", { fg = c.accent, bg = "NONE", bold = true })
hl("MoreMsg", { fg = c.info, bg = "NONE", bold = true })
hl("ErrorMsg", { fg = c.error, bg = "NONE", bold = true })
hl("WarningMsg", { fg = c.warn, bg = "NONE", bold = true })
hl("OkMsg", { fg = c.ok, bg = "NONE", bold = true })
hl("QuickFixLine", { bg = c.bg_selection, bold = true })
-- Diffs ---------------------------------------------------------------------
hl("DiffAdd", { fg = c.add, bg = c.bg_alt })
hl("DiffChange", { fg = c.change, bg = c.bg_alt })
hl("DiffDelete", { fg = c.delete, bg = c.bg_alt })
hl("DiffText", { fg = c.fg_on_soft, bg = c.accent_container, bold = true })
link("DiffTextAdd", "DiffText")
hl("Added", { fg = c.add })
hl("Changed", { fg = c.change })
hl("Removed", { fg = c.delete })
-- Standard syntax groups ----------------------------------------------------
hl("Comment", { fg = c.fg_comment, italic = true })
hl("Constant", { fg = c.code_const })
hl("String", { fg = c.code_string })
hl("Character", { fg = c.code_string })
hl("Number", { fg = c.code_number })
hl("Boolean", { fg = c.code_number, bold = true })
hl("Float", { fg = c.code_number })
hl("Identifier", { fg = c.fg })
hl("Function", { fg = c.code_func, bold = true })
hl("Statement", { fg = c.code_keyword, bold = true })
link("Conditional", "Statement")
link("Repeat", "Statement")
link("Label", "Statement")
hl("Operator", { fg = c.code_operator })
hl("Keyword", { fg = c.code_keyword, italic = true })
link("Exception", "Statement")
hl("PreProc", { fg = c.code_preproc })
link("Include", "PreProc")
link("Define", "PreProc")
link("Macro", "PreProc")
link("PreCondit", "PreProc")
hl("Type", { fg = c.code_type, bold = true })
link("StorageClass", "Type")
link("Structure", "Type")
link("Typedef", "Type")
hl("Special", { fg = c.code_special })
link("SpecialChar", "Special")
link("Tag", "Special")
hl("Delimiter", { fg = c.fg_muted })
link("SpecialComment", "Special")
link("Debug", "Special")
hl("Underlined", { fg = c.accent, underline = true })
hl("Todo", { fg = c.todo_fg, bg = c.todo_bg, bold = true })
hl("Error", { fg = c.error, bold = true })
-- Spell ---------------------------------------------------------------------
hl("SpellBad", { sp = c.error, undercurl = true })
hl("SpellCap", { sp = c.info, undercurl = true })
hl("SpellLocal", { sp = c.hint, undercurl = true })
hl("SpellRare", { sp = c.secondary, undercurl = true })
-- Diagnostics ---------------------------------------------------------------
hl("DiagnosticError", { fg = c.error })
hl("DiagnosticWarn", { fg = c.warn })
hl("DiagnosticInfo", { fg = c.info })
hl("DiagnosticHint", { fg = c.hint })
hl("DiagnosticOk", { fg = c.ok })
hl("DiagnosticUnderlineError", { sp = c.error, undercurl = true })
hl("DiagnosticUnderlineWarn", { sp = c.warn, undercurl = true })
hl("DiagnosticUnderlineInfo", { sp = c.info, undercurl = true })
hl("DiagnosticUnderlineHint", { sp = c.hint, undercurl = true })
hl("DiagnosticUnderlineOk", { sp = c.ok, undercurl = true })
link("DiagnosticSignError", "DiagnosticError")
link("DiagnosticSignWarn", "DiagnosticWarn")
link("DiagnosticSignInfo", "DiagnosticInfo")
link("DiagnosticSignHint", "DiagnosticHint")
link("DiagnosticSignOk", "DiagnosticOk")
link("DiagnosticFloatingError", "DiagnosticError")
link("DiagnosticFloatingWarn", "DiagnosticWarn")
link("DiagnosticFloatingInfo", "DiagnosticInfo")
link("DiagnosticFloatingHint", "DiagnosticHint")
link("DiagnosticFloatingOk", "DiagnosticOk")
hl("DiagnosticVirtualTextError", { fg = c.error, bg = c.error_container })
hl("DiagnosticVirtualTextWarn", { fg = c.warn, bg = c.bg_alt })
hl("DiagnosticVirtualTextInfo", { fg = c.info, bg = c.bg_alt })
hl("DiagnosticVirtualTextHint", { fg = c.hint, bg = c.bg_alt })
hl("DiagnosticVirtualTextOk", { fg = c.ok, bg = c.bg_alt })
link("DiagnosticVirtualLinesError", "DiagnosticVirtualTextError")
link("DiagnosticVirtualLinesWarn", "DiagnosticVirtualTextWarn")
link("DiagnosticVirtualLinesInfo", "DiagnosticVirtualTextInfo")
link("DiagnosticVirtualLinesHint", "DiagnosticVirtualTextHint")
link("DiagnosticVirtualLinesOk", "DiagnosticVirtualTextOk")
hl("DiagnosticDeprecated", { fg = c.fg_muted, strikethrough = true })
hl("DiagnosticUnnecessary", { fg = c.fg_muted, italic = true })
-- LSP reference/inlay/codelens ---------------------------------------------
hl("LspReferenceText", { bg = c.ref_bg })
hl("LspReferenceRead", { bg = c.ref_bg })
hl("LspReferenceWrite", { bg = c.ref_bg, sp = c.accent, undercurl = true })
hl("LspReferenceTarget", { fg = c.accent, bg = c.ref_bg, bold = true })
hl("LspInlayHint", { fg = c.fg_muted, bg = c.bg_alt, italic = true })
hl("LspCodeLens", { fg = c.fg_muted, italic = true })
hl("LspCodeLensSeparator", { fg = c.border })
hl("LspSignatureActiveParameter", { fg = c.accent, bold = true, underline = true })
-- Treesitter captures -------------------------------------------------------
link("@comment", "Comment")
link("@comment.documentation", "Comment")
link("@comment.todo", "Todo")
link("@comment.error", "DiagnosticError")
link("@comment.warning", "DiagnosticWarn")
link("@comment.note", "DiagnosticInfo")
link("@constant", "Constant")
hl("@constant.builtin", { fg = c.code_builtin, italic = true, bold = true })
hl("@constant.macro", { fg = c.code_preproc, bold = true })
link("@string", "String")
hl("@string.escape", { fg = c.code_special, bold = true })
link("@string.regex", "Special")
link("@character", "Character")
link("@number", "Number")
link("@boolean", "Boolean")
link("@float", "Float")
link("@variable", "Identifier")
hl("@variable.builtin", { fg = c.code_builtin, italic = true, bold = true })
hl("@variable.parameter", { fg = c.code_param, italic = true })
hl("@variable.member", { fg = c.code_field })
hl("@property", { fg = c.code_field })
hl("@field", { fg = c.code_field })
link("@function", "Function")
hl("@function.builtin", { fg = c.code_builtin, bold = true })
link("@function.call", "Function")
hl("@function.method", { fg = c.code_func })
hl("@function.method.call", { fg = c.code_func })
hl("@constructor", { fg = c.code_type, bold = true })
link("@keyword", "Keyword")
hl("@keyword.function", { fg = c.code_keyword, bold = true })
hl("@keyword.operator", { fg = c.code_operator })
link("@keyword.return", "Keyword")
link("@conditional", "Conditional")
link("@repeat", "Repeat")
link("@label", "Label")
link("@operator", "Operator")
link("@exception", "Exception")
link("@preproc", "PreProc")
link("@include", "Include")
link("@define", "Define")
link("@macro", "Macro")
link("@type", "Type")
hl("@type.builtin", { fg = c.code_type, italic = true, bold = true })
link("@type.definition", "Type")
hl("@attribute", { fg = c.code_preproc })
hl("@module", { fg = c.code_namespace })
hl("@namespace", { fg = c.code_namespace })
link("@punctuation.delimiter", "Delimiter")
link("@punctuation.bracket", "Delimiter")
hl("@punctuation.special", { fg = c.code_special })
link("@tag", "Tag")
hl("@tag.attribute", { fg = c.code_field })
link("@tag.delimiter", "Delimiter")
-- LSP semantic token families ----------------------------------------------
link("@lsp.type.class", "@type")
link("@lsp.type.comment", "@comment")
link("@lsp.type.decorator", "@attribute")
link("@lsp.type.enum", "@type")
link("@lsp.type.enumMember", "@constant")
link("@lsp.type.event", "@property")
link("@lsp.type.function", "@function")
link("@lsp.type.interface", "@type")
link("@lsp.type.keyword", "@keyword")
link("@lsp.type.macro", "@macro")
link("@lsp.type.method", "@function.method")
link("@lsp.type.modifier", "@keyword")
link("@lsp.type.namespace", "@namespace")
link("@lsp.type.number", "@number")
link("@lsp.type.operator", "@operator")
link("@lsp.type.parameter", "@variable.parameter")
link("@lsp.type.property", "@property")
link("@lsp.type.regexp", "@string.regex")
link("@lsp.type.string", "@string")
link("@lsp.type.struct", "@type")
link("@lsp.type.type", "@type")
link("@lsp.type.typeParameter", "@type")
link("@lsp.type.variable", "@variable")
hl("@lsp.mod.deprecated", { strikethrough = true })
link("@lsp.mod.readonly", "Constant")
link("@lsp.typemod.variable.readonly", "Constant")
-- Common plugin aliases -----------------------------------------------------
hl("GitSignsAdd", { fg = c.add, bg = c.bg })
hl("GitSignsChange", { fg = c.change, bg = c.bg })
hl("GitSignsDelete", { fg = c.delete, bg = c.bg })
hl("MiniIndentscopeSymbol", { fg = c.border, nocombine = true })
hl("IblIndent", { fg = c.border, nocombine = true })
hl("IblScope", { fg = c.fg_muted, nocombine = true })
link("TelescopeNormal", "NormalFloat")
link("TelescopeBorder", "FloatBorder")
link("TelescopeTitle", "FloatTitle")
link("TelescopeSelection", "PmenuSel")
hl("TelescopeMatching", { fg = c.accent, bold = true })
-- Snacks.nvim picker / explorer --------------------------------------------
hl("SnacksPicker", { fg = c.fg, bg = c.bg })
hl("SnacksPickerBorder", { fg = c.border, bg = c.bg })
hl("SnacksPickerBoxBorder", { fg = c.border, bg = c.bg_alt })
hl("SnacksPickerTitle", { fg = c.accent, bg = c.bg_alt, bold = true })
hl("SnacksPickerInput", { fg = c.fg, bg = c.bg_alt })
hl("SnacksPickerInputBorder", { fg = c.border, bg = c.bg_alt })
hl("SnacksPickerInputTitle", { fg = c.accent, bg = c.bg_alt, bold = true })
hl("SnacksPickerInputSearch", { fg = c.accent, bg = c.bg_alt, bold = true })
hl("SnacksPickerPrompt", { fg = c.accent, bg = c.bg_alt, bold = true })
hl("SnacksPickerList", { fg = c.fg, bg = c.bg })
hl("SnacksPickerListBorder", { fg = c.border, bg = c.bg })
hl("SnacksPickerListTitle", { fg = c.secondary, bg = c.bg, bold = true })
hl("SnacksPickerListCursorLine", { bg = c.bg_cursorline })
hl("SnacksPickerPreview", { fg = c.fg, bg = c.bg_float })
hl("SnacksPickerPreviewBorder", { fg = c.border, bg = c.bg_float })
hl("SnacksPickerPreviewTitle", { fg = c.tertiary, bg = c.bg_float, bold = true })
hl("SnacksPickerMatch", { fg = c.accent, bold = true })
hl("SnacksPickerFile", { fg = c.fg })
hl("SnacksPickerDir", { fg = c.secondary })
hl("SnacksPickerPathHidden", { fg = c.fg_muted })
hl("SnacksPickerPathIgnored", { fg = c.fg_subtle, italic = true })
hl("SnacksPickerPathExcluded", { fg = c.fg_subtle, italic = true })
hl("SnacksPickerGitStatusAdded", { fg = c.add })
hl("SnacksPickerGitStatusModified", { fg = c.change })
hl("SnacksPickerGitStatusDeleted", { fg = c.delete })
hl("SnacksPickerGitStatusRenamed", { fg = c.info })
hl("SnacksPickerGitStatusCopied", { fg = c.info })
hl("SnacksPickerGitStatusUntracked", { fg = c.hint })
hl("SnacksPickerGitStatusIgnored", { fg = c.fg_subtle })
hl("SnacksPickerGitStatusStaged", { fg = c.ok })
return c
-2
View File
@@ -1,2 +0,0 @@
let it_SI = "\e[5 q"
let &t_EI = "\e[2 q"
-5
View File
@@ -1,5 +0,0 @@
local ionfig = {
cmd = {'/usr/bin/jdtls'},
root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]),
}
require('jdtls').start_or_attach(config)
-11
View File
@@ -1,11 +0,0 @@
local gen_hook = MiniSplitjoin.gen_hook
local curly = { brackets = { '%b{}' }}
local add_comma_curly = gen_hook.add_trailing_separator(curly)
local remove_comma_curly = gen_hook.del_trailing_separator(curly)
local pad_curly = gen_hook.pad_brackets(curly)
vim.b.minisplitjoin_config = {
split = { hooks_post = { add_comma_curly }},
join = { hooks_post = { remove_comma_curly, pad_curly }},
}
View File
+2 -43
View File
@@ -1,43 +1,2 @@
if vim.env.PROF then
local snacks = vim.fn.stdpath "data" .. "/lazy/snacks.nvim"
vim.opt.rtp:append(snacks)
require("snacks.profiler").startup {
startup = {
event = "UIEnter",
},
}
end
local home = os.getenv "HOME"
package.path = package.path
.. ";"
.. home
.. "/.luarocks/share/lua/5.4/?.lua"
.. ";"
.. home
.. "/.luarocks/share/lua/5.4/?/init.lua"
package.cpath = package.cpath .. ";" .. home .. "/.luarocks/lib/lua/5.4/?.so"
vim.cmd("source " .. vim.fn.stdpath "config" .. "/cursor.vim")
require "config.lazy"
require "options"
require "globals"
require "mappings"
require "autocmd"
require("minimodules").load_modules()
-- require("coc-settings")
if vim.g.neovide then
require "config.neovide"
end
vim.filetype.add {
pattern = {
[".*/hypr/.*%.conf"] = "hyprlang",
[".*/uwsm/env.*"] = "zsh",
},
}
vim.cmd.colorscheme "zshell"
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")
+60
View File
@@ -0,0 +1,60 @@
{
"CopilotChat.nvim": { "branch": "main", "commit": "23162ada224e858d0d60bbbf2a35f9b6c98427ce" },
"LazyVim": { "branch": "main", "commit": "3f034d0a7f58031123300309f2efd3bb0356ee21" },
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
"SchemaStore.nvim": { "branch": "main", "commit": "e659e0c6ca06727ed898aaaeea3850f528898684" },
"auto-session": { "branch": "main", "commit": "0a1318557c03845f2e0dde347bc54507d1d8c34d" },
"base46-colors": { "branch": "main", "commit": "131ca742f6e8d1eb4c938a2519a94840ba129c2f" },
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"conform.nvim": { "branch": "master", "commit": "b1a75324ddf96b7bb84963a297b1ed334db087c0" },
"copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" },
"copilot.lua": { "branch": "master", "commit": "13ae71875457d25b92cb13cb43aae5a43972dd36" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gitsigns.nvim": { "branch": "main", "commit": "3c76f7fabac723aa682365ef782f88a83ccdb4ac" },
"grug-far.nvim": { "branch": "main", "commit": "9411a99390014231753bbb7a2afe6886fda99257" },
"harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
"lualine.nvim": { "branch": "master", "commit": "1517caa8fff05e4b4999857319d3b0609a7f57fa" },
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "ea387e0819ab189d536bb4067e4d8ece3801a292" },
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
"mini.ai": { "branch": "main", "commit": "e139eb1101beb0250fea322f8c07a42f0f175688" },
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
"mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" },
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" },
"nvim-cmp": { "branch": "main", "commit": "059e89495b3ec09395262f16b1ad441a38081d04" },
"nvim-dap": { "branch": "master", "commit": "7aade9e99bef5f0735cf966e715b3ce45515d786" },
"nvim-dap-ui": { "branch": "master", "commit": "bc81f8d3440aede116f821114547a476b082b319" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "df66808cd78b5a97576bbaeee95ed5ca385a9750" },
"nvim-lint": { "branch": "master", "commit": "81e8ba7655cc4395b1092ef4e1b6e83f54cd54ad" },
"nvim-lspconfig": { "branch": "master", "commit": "40f120c10ea4b87311175539a183c3b75eab95a3" },
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
"nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" },
"nvim-treesitter": { "branch": "master", "commit": "997288c55253e27f782d991099490f80205d65bf" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "de39919a57e1a40a4c7dc5bae0de276f9c616ef3" },
"render-markdown.nvim": { "branch": "main", "commit": "d2285137fa4fbc0b4152cb444008166962b727b5" },
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
"tmux.nvim": { "branch": "main", "commit": "2c1c3be0ef287073cef963f2aefa31a15c8b9cd8" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
"trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" },
"ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" },
"undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" },
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
}
+9 -1
View File
@@ -1,7 +1,15 @@
{
"extras": [
"lazyvim.plugins.extras.ai.copilot",
"lazyvim.plugins.extras.ai.copilot-chat",
"lazyvim.plugins.extras.coding.nvim-cmp",
"lazyvim.plugins.extras.dap.core",
"lazyvim.plugins.extras.lang.json",
"lazyvim.plugins.extras.lang.markdown",
"lazyvim.plugins.extras.lang.toml",
"lazyvim.plugins.extras.vscode"
],
"install_version": 8,
"news": {
"NEWS.md": "10960"
},
-74
View File
@@ -1,74 +0,0 @@
local M = {}
M.icons = {
misc = {
dots = "󰇘",
},
ft = {
octo = "",
gh = "",
["markdown.gh"] = "",
},
dap = {
Stopped = { "󰁕 ", "DiagnosticWarn", "DapStoppedLine" },
Breakpoint = "",
BreakpointCondition = "",
BreakpointRejected = { "", "DiagnosticError" },
LogPoint = ".>",
},
diagnostics = {
Error = "",
Warn = "",
Hint = "",
Info = "",
},
git = {
added = "",
modified = "",
removed = "",
},
kinds = {
Array = "",
Boolean = "󰨙 ",
Class = "",
Codeium = "󰘦 ",
Color = "",
Control = "",
Collapsed = "",
Constant = "󰏿 ",
Constructor = "",
Copilot = "",
Enum = "",
EnumMember = "",
Event = "",
Field = "",
File = "",
Folder = "",
Function = "󰊕 ",
Interface = "",
Key = "",
Keyword = "",
Method = "󰊕 ",
Module = "",
Namespace = "󰦮 ",
Null = "",
Number = "󰎠 ",
Object = "",
Operator = "",
Package = "",
Property = "",
Reference = "",
Snippet = "󱄽 ",
String = "",
Struct = "󰆼 ",
Supermaven = "",
TabNine = "󰏚 ",
Text = "",
TypeParameter = "",
Unit = "",
Value = "",
Variable = "󰀫 ",
},
}
return M
-84
View File
@@ -1,84 +0,0 @@
local autocmd = vim.api.nvim_create_autocmd
autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client then
vim.lsp.document_color.enable(false, args.buf, { "background" })
end
end,
})
autocmd("VimLeave", {
command = "set guicursor=a:ver25-Cursor",
})
autocmd("BufWritePre", {
callback = function()
local ok = pcall(function()
vim.cmd "undojoin"
end)
vim.cmd "Neoformat"
end,
})
autocmd({ "InsertLeave" }, {
callback = function()
require("lint").try_lint()
end,
})
local progress = vim.defaulttable()
vim.api.nvim_create_autocmd("LspProgress", {
---@param ev {data: {client_id: integer, params: lsp.ProgressParams}}
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
local value = ev.data.params.value --[[@as {percentage?: number, title?: string, message?: string, kind: "begin" | "report" | "end"}]]
if not client or type(value) ~= "table" then
return
end
local p = progress[client.id]
for i = 1, #p + 1 do
if i == #p + 1 or p[i].token == ev.data.params.token then
p[i] = {
token = ev.data.params.token,
msg = ("[%3d%%] %s%s"):format(
value.kind == "end" and 100 or value.percentage or 100,
value.title or "",
value.message and (" **%s**"):format(value.message)
or ""
),
done = value.kind == "end",
}
break
end
end
local msg = {} ---@type string[]
progress[client.id] = vim.tbl_filter(function(v)
return table.insert(msg, v.msg) or not v.done
end, p)
local spinner = {
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
}
vim.notify(table.concat(msg, "\n"), "info", {
id = "lsp_progress",
title = client.name,
opts = function(notif)
notif.icon = #progress[client.id] == 0 and ""
or spinner[math.floor(vim.uv.hrtime() / (1e6 * 80)) % #spinner + 1]
end,
})
end,
})
-221
View File
@@ -1,221 +0,0 @@
vim.opt.backup = false
vim.opt.writebackup = false
vim.opt.completeopt = "menuone,menu,noinsert,noselect,popup"
vim.opt.pumheight = 10
vim.opt.updatetime = 300
vim.opt.signcolumn = "yes"
local keyset = vim.keymap.set
function _G.check_back_space()
local col = vim.fn.col "." - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" ~= nil
end
-- Use Tab for trigger completion with characters ahead and navigate
-- NOTE: There's always a completion item selected by default, you may want to enable
-- no select by setting `"suggest.noselect": true` in your configuration file
-- NOTE: Use command ':verbose imap <tab>' to make sure Tab is not mapped by
-- other plugins before putting this into your config
local opts =
{ silent = true, noremap = true, expr = true, replace_keycodes = false }
keyset(
"i",
"<TAB>",
'coc#pum#visible() ? coc#pum#next(0) : v:lua.check_back_space() ? "<TAB>" : coc#refresh()',
opts
)
keyset("i", "<S-TAB>", [[coc#pum#visible() ? coc#pum#prev(0) : "\<C-h>"]], opts)
-- Make <CR> to accept selected completion item or notify coc.nvim to format
-- <C-g>u breaks current undo, please make your own choice
keyset(
"i",
"<cr>",
[[coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"]],
opts
)
-- Use <c-j> to trigger snippets
keyset("i", "<c-j>", "<Plug>(coc-snippets-expand-jump)")
-- Use <c-space> to trigger completion
keyset("i", "<c-space>", "coc#refresh()", { silent = true, expr = true })
-- Use `[g` and `]g` to navigate diagnostics
-- Use `:CocDiagnostics` to get all diagnostics of current buffer in location list
keyset("n", "[g", "<Plug>(coc-diagnostic-prev)", { silent = true })
keyset("n", "]g", "<Plug>(coc-diagnostic-next)", { silent = true })
-- GoTo code navigation
keyset("n", "gd", "<Plug>(coc-definition)", { silent = true })
keyset("n", "gy", "<Plug>(coc-type-definition)", { silent = true })
keyset("n", "gi", "<Plug>(coc-implementation)", { silent = true })
keyset("n", "gr", "<Plug>(coc-references)", { silent = true })
-- Use K to show documentation in preview window
function _G.show_docs()
local cw = vim.fn.expand "<cword>"
if vim.fn.index({ "vim", "help" }, vim.bo.filetype) >= 0 then
vim.api.nvim_command("h " .. cw)
elseif vim.api.nvim_eval "coc#rpc#ready()" then
vim.fn.CocActionAsync "doHover"
else
vim.api.nvim_command("!" .. vim.o.keywordprg .. " " .. cw)
end
end
keyset("n", "K", "<CMD>lua _G.show_docs()<CR>", { silent = true })
-- Highlight the symbol and its references on a CursorHold event(cursor is idle)
vim.api.nvim_create_augroup("CocGroup", {})
vim.api.nvim_create_autocmd("CursorHold", {
group = "CocGroup",
command = "silent call CocActionAsync('highlight')",
desc = "Highlight symbol under cursor on CursorHold",
})
-- Symbol renaming
keyset("n", "<leader>rn", "<Plug>(coc-rename)", { silent = true })
-- Formatting selected code
keyset("x", "<leader>f", "<Plug>(coc-format-selected)", { silent = true })
keyset("n", "<leader>f", "<Plug>(coc-format-selected)", { silent = true })
-- Setup formatexpr specified filetype(s)
vim.api.nvim_create_autocmd("FileType", {
group = "CocGroup",
pattern = "typescript,json",
command = "setl formatexpr=CocAction('formatSelected')",
desc = "Setup formatexpr specified filetype(s).",
})
-- Apply codeAction to the selected region
-- Example: `<leader>aap` for current paragraph
local opts = { silent = true, nowait = true }
keyset("x", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
keyset("n", "<leader>a", "<Plug>(coc-codeaction-selected)", opts)
-- Remap keys for apply code actions at the cursor position.
keyset("n", "<leader>ac", "<Plug>(coc-codeaction-cursor)", opts)
-- Remap keys for apply source code actions for current file.
keyset("n", "<leader>as", "<Plug>(coc-codeaction-source)", opts)
-- Apply the most preferred quickfix action on the current line.
keyset("n", "<leader>qf", "<Plug>(coc-fix-current)", opts)
-- Remap keys for apply refactor code actions.
keyset("n", "<leader>re", "<Plug>(coc-codeaction-refactor)", { silent = true })
keyset(
"x",
"<leader>r",
"<Plug>(coc-codeaction-refactor-selected)",
{ silent = true }
)
keyset(
"n",
"<leader>r",
"<Plug>(coc-codeaction-refactor-selected)",
{ silent = true }
)
-- Run the Code Lens actions on the current line
keyset("n", "<leader>cl", "<Plug>(coc-codelens-action)", opts)
-- Map function and class text objects
-- NOTE: Requires 'textDocument.documentSymbol' support from the language server
keyset("x", "if", "<Plug>(coc-funcobj-i)", opts)
keyset("o", "if", "<Plug>(coc-funcobj-i)", opts)
keyset("x", "af", "<Plug>(coc-funcobj-a)", opts)
keyset("o", "af", "<Plug>(coc-funcobj-a)", opts)
keyset("x", "ic", "<Plug>(coc-classobj-i)", opts)
keyset("o", "ic", "<Plug>(coc-classobj-i)", opts)
keyset("x", "ac", "<Plug>(coc-classobj-a)", opts)
keyset("o", "ac", "<Plug>(coc-classobj-a)", opts)
-- Remap <C-f> and <C-b> to scroll float windows/popups
---@diagnostic disable-next-line: redefined-local
local opts = { silent = true, nowait = true, expr = true }
keyset(
"n",
"<C-f>",
'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"',
opts
)
keyset(
"n",
"<C-b>",
'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"',
opts
)
keyset(
"i",
"<C-f>",
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"',
opts
)
keyset(
"i",
"<C-b>",
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"',
opts
)
keyset(
"v",
"<C-f>",
'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"',
opts
)
keyset(
"v",
"<C-b>",
'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"',
opts
)
-- Use CTRL-S for selections ranges
-- Requires 'textDocument/selectionRange' support of language server
keyset("n", "<C-s>", "<Plug>(coc-range-select)", { silent = true })
keyset("x", "<C-s>", "<Plug>(coc-range-select)", { silent = true })
-- Add `:Format` command to format current buffer
vim.api.nvim_create_user_command("Format", "call CocAction('format')", {})
-- " Add `:Fold` command to fold current buffer
vim.api.nvim_create_user_command(
"Fold",
"call CocAction('fold', <f-args>)",
{ nargs = "?" }
)
-- Add `:OR` command for organize imports of the current buffer
vim.api.nvim_create_user_command(
"OR",
"call CocActionAsync('runCommand', 'editor.action.organizeImport')",
{}
)
-- Add (Neo)Vim's native statusline support
-- NOTE: Please see `:h coc-status` for integrations with external plugins that
-- provide custom statusline: lightline.vim, vim-airline
vim.opt.statusline:prepend "%{coc#status()}%{get(b:,'coc_current_function','')}"
-- Mappings for CoCList
-- code actions and coc stuff
---@diagnostic disable-next-line: redefined-local
local opts = { silent = true, nowait = true }
-- Show all diagnostics
keyset("n", "<space>a", ":<C-u>CocList diagnostics<cr>", opts)
-- Manage extensions
keyset("n", "<space>m", ":<C-u>CocList extensions<cr>", opts)
-- Show commands
keyset("n", "<space>c", ":<C-u>CocList commands<cr>", opts)
-- Find symbol of current document
keyset("n", "<space>o", ":<C-u>CocList outline<cr>", opts)
-- Search workspace symbols
keyset("n", "<space>s", ":<C-u>CocList -I symbols<cr>", opts)
-- Do default action for next item
keyset("n", "<space>j", ":<C-u>CocNext<cr>", opts)
-- Do default action for previous item
keyset("n", "<space>k", ":<C-u>CocPrev<cr>", opts)
-- Resume latest coc list
keyset("n", "<space>p", ":<C-u>CocListResume<cr>", opts)
-1
View File
@@ -1 +0,0 @@
require("tiny-inline-diagnostic").setup({})
-73
View File
@@ -1,73 +0,0 @@
require("actions-preview").setup {
-- options for vim.diff(): https://neovim.io/doc/user/lua.html#vim.diff()
diff = {
ctxlen = 3,
},
highlight_command = {
-- require("actions-preview.highlight").delta(),
-- require("actions-preview.highlight").diff_so_fancy(),
-- require("actions-preview.highlight").diff_highlight(),
},
-- priority list of preferred backend
backend = { "snacks", "nui" },
-- options related to telescope.nvim
telescope = vim.tbl_extend(
"force",
require("telescope.themes").get_dropdown(),
-- a table for customizing content
{
-- a function to make a table containing the values to be displayed.
-- fun(action: Action): { title: string, client_name: string|nil }
make_value = nil,
-- a function to make a function to be used in `display` of a entry.
-- see also `:h telescope.make_entry` and `:h telescope.pickers.entry_display`.
-- fun(values: { index: integer, action: Action, title: string, client_name: string }[]): function
make_make_display = nil,
}
),
-- options for nui.nvim components
nui = {
-- component direction. "col" or "row"
dir = "col",
-- keymap for selection component: https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/menu#keymap
keymap = nil,
-- options for nui Layout component: https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/layout
layout = {
position = "50%",
size = {
width = "60%",
height = "100%",
},
min_width = 40,
min_height = 10,
relative = "editor",
},
-- options for preview area: https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup
preview = {
size = "80%",
border = {
style = "rounded",
padding = { 0, 1 },
},
},
-- options for selection area: https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/menu
select = {
size = "20%",
border = {
style = "rounded",
padding = { 0, 1 },
},
},
},
--- options for snacks picker
---@type snacks.picker.Config
snacks = {
layout = { preset = "default" },
},
}
+56
View File
@@ -0,0 +1,56 @@
local autocmd = vim.api.nvim_create_autocmd
-- autocmd({ "BufEnter", "QuitPre" }, {
-- nested = false,
-- callback = function(e)
-- local tree = require("nvim-tree.api").tree
--
-- -- Nothing to do if tree is not opened
-- if not tree.is_visible() then
-- return
-- end
--
-- local winCount = 0
-- for _, winId in ipairs(vim.api.nvim_list_wins()) do
-- if vim.api.nvim_win_get_config(winId).focusable then
-- winCount = winCount + 1
-- end
-- end
--
-- -- We want to quit and only one window besides tree is left
-- if e.event == "QuitPre" and winCount == 2 then
-- vim.api.nvim_cmd({ cmd = "qall" }, {})
-- end
--
-- -- :bd was probably issued an only tree window is left
-- -- Behave as if tree was closed (see `:h :bd`)
-- if e.event == "BufEnter" and winCount == 1 then
-- -- Required to avoid "Vim:E444: Cannot close last window"
-- vim.defer_fn(function()
-- -- close nvim-tree: will go to the last buffer used before closing
-- tree.toggle({ find_file = true, focus = true })
-- -- re-open nivm-tree
-- tree.toggle({ find_file = true, focus = false })
-- end, 10)
-- end
-- end,
-- })
autocmd("VimEnter", {
callback = function()
--NVIM_ENTER=1
vim.cmd([[call chansend(v:stderr, "\033]1337;SetUserVar=NVIM_ENTER=MQ==\007")]])
end,
})
autocmd("VimLeavePre", {
callback = function()
--NVIM_ENTER=0
vim.cmd([[call chansend(v:stderr, "\033]1337;SetUserVar=NVIM_ENTER=MA==\007")]])
end,
})
autocmd("VimLeave", {
pattern = "*",
command = "set guicursor=a:ver25",
})
-3
View File
@@ -1,3 +0,0 @@
local npairs = require('nvim-autopairs')
npairs.setup({})
-38
View File
@@ -1,38 +0,0 @@
require("auto-session").setup ({
{
enabled = true,
root_dir = vim.fn.stdpath "data" .. "/sessions/",
auto_save = true,
auto_restore = true,
auto_create = true,
suppressed_dirs = nil,
allowed_dirs = nil,
auto_restore_last_session = false,
use_git_branch = false,
lazy_support = true,
bypass_save_filetypes = nil,
close_unsupported_windows = true,
args_allow_single_directory = true,
args_allow_files_auto_save = false,
continue_restore_on_error = true,
show_auto_restore_notif = false,
cwd_change_handling = false,
lsp_stop_on_restore = false,
log_level = "error",
session_lens = {
load_on_setup = true,
theme_conf = {
},
previewer = false,
mappings = {
delete_session = { "i", "<C-D>" },
alternate_session = { "i", "<C-S>" },
copy_session = { "i", "<C-Y>" },
},
session_control = {
control_dir = vim.fn.stdpath "data" .. "/auto_session/",
control_filename = "session_control.json",
},
},
}
})
-42
View File
@@ -1,42 +0,0 @@
require("bufferline").setup ({
options = {
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local s = " "
if diagnostics_dict then
for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and ""
or (e == "warning" and "" or "")
s = sym .. n
end
return s
end
return ""
end,
show_close_icon = false,
show_buffer_close_icons = false,
always_show_bufferline = true,
tab_size = 1,
indicator = {
style = "icon",
icon = "",
},
offsets = {
{
filetype = "NvimTree",
text = "Explorer",
text_align = "center",
},
{
filetype = "snacks_layout_box",
},
},
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
callback = function()
vim.schedule(function()
pcall(nvim_bufferline)
end)
end,
})
},
})
-6
View File
@@ -1,6 +0,0 @@
return {
opts = {
max_completions = 1,
max_attempts = 2,
},
}
-177
View File
@@ -1,177 +0,0 @@
local M = {}
local icons = require("assets.icons").icons.kinds
local devicons = {
default_icon = { icon = "󰈚", name = "Default" },
js = { icon = "󰌞", name = "js" },
ts = { icon = "󰛦", name = "ts" },
lock = { icon = "󰌾", name = "lock" },
["robots.txt"] = { icon = "󰚩", name = "robots" },
}
M.components = {
kind_icon = {
text = function(ctx)
local icon = (icons[ctx.kind] or "󰈚")
return icon .. " "
end,
},
kind = {
highlight = function(ctx)
return ctx.kind
end,
},
}
local opts = {
"saghen/blink.cmp",
dependencies = {
"rafamadriz/friendly-snippets",
{
"fang2hou/blink-copilot",
config = function()
require "config.blink-copilot"
end,
},
},
version = "1.*",
opts = {
keymap = {
["<Tab>"] = {
function(cmp)
if cmp.is_visible() then
return cmp.select_next()
end
if cmp.snippet_active() then
return cmp.snippet_forward()
end
end,
"fallback",
},
["<S-Tab>"] = {
function(cmp)
if cmp.is_visible() then
return cmp.select_prev()
end
if cmp.snippet_active() then
return cmp.snippet_backward()
end
end,
"fallback",
},
["<CR>"] = { "accept", "fallback" },
["Up"] = {},
["Down"] = {},
},
appearance = {
nerd_font_variant = "mono",
},
cmdline = {
completion = {
menu = { auto_show = true },
list = { selection = { preselect = false } },
},
keymap = {
["<Tab>"] = {
function(cmp)
if cmp.is_visible() then
return cmp.select_next()
end
end,
"fallback",
},
["<S-Tab>"] = {
function(cmp)
if cmp.is_visible() then
return cmp.select_prev()
end
end,
"fallback",
},
["<CR>"] = { "accept", "fallback" },
["Up"] = {},
["Down"] = {},
},
},
completion = {
documentation = { auto_show = true, auto_show_delay_ms = 50 },
keyword = { range = "full" },
accept = { auto_brackets = { enabled = true } },
ghost_text = { enabled = true },
list = {
selection = {
-- preselect = false,
auto_insert = false,
},
},
menu = {
scrollbar = false,
border = "single",
draw = {
padding = 1,
columns = {
{ "kind_icon" },
{ "label", "label_description", gap = 1 },
{ "kind" },
},
components = M.components,
},
},
},
signature = { enabled = true },
sources = {
default = { "lsp", "path", "snippets", "buffer", "copilot" },
providers = {
lsp = {
score_offset = 50,
},
path = {
opts = {
get_cwd = function()
return vim.fn.getcwd()
end,
},
},
buffer = {
score_offset = -10,
},
snippets = {
score_offset = 0,
},
copilot = {
name = "copilot",
module = "blink-copilot",
score_offset = 100,
async = true,
},
},
},
snippets = {
preset = "default",
},
fuzzy = { implementation = "prefer_rust_with_warning" },
},
opts_extend = { "sources.default" },
}
return opts
-71
View File
@@ -1,71 +0,0 @@
---@diagnostic disable: redundant-parameter
require("catppuccin").setup {
flavour = "latte",
background = {
light = "latte",
dark = "latte",
},
transparent_background = false,
float = {
transparent = false,
solid = false,
},
show_end_of_buffer = false,
term_colors = false,
dim_inactive = {
enabled = false,
shade = "dark",
percentage = 0.15,
},
no_italic = false,
no_bold = false,
no_underline = false,
styles = {
comments = { "italic" },
conditionals = { "italic" },
loops = {},
functions = {},
keywords = {},
strings = {},
variables = {},
numbers = {},
booleans = {},
properties = {},
types = {},
operators = {},
-- miscs = {},
},
lsp_styles = {
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
ok = { "italic" },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
ok = { "underline" },
},
inlay_hints = {
background = true,
},
},
color_overrides = {},
custom_highlights = {},
default_integrations = true,
auto_integrations = false,
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
notify = false,
mini = {
enabled = true,
indentscope_color = "",
},
},
}
-38
View File
@@ -1,38 +0,0 @@
require("chatgpt").setup({
api_host_cmd = "echo http://localhost:5000",
api_key_cmd = "echo ''",
openai_params = {
model = "Selene-1-Mini-Llama-3.1-8B-EXL3",
frequency_penalty = 0,
presence_penalty = 0,
max_tokens = 1024,
temperature = 0.1,
top_p = 1,
n = 1,
},
keymaps = {
close = "<C-c>",
close_n = "<Esc>",
yank_last = "<C-y>",
yank_last_code = "<C-k>",
scroll_up = "<C-u>",
scroll_down = "<C-d>",
new_session = "<C-l>",
cycle_windows = "<Tab>",
cycle_modes = "<C-f>",
next_message = "<C-j>",
prev_message = "<C-k>",
select_session = "<Space>",
rename_session = "r",
delete_session = "d",
draft_message = "<C-r>",
edit_message = "e",
delete_message = "d",
toggle_settings = "<C-o>",
toggle_sessions = "<C-p>",
toggle_help = "<C-h>",
toggle_message_role = "<C-r>",
toggle_system_role_open = "<C-s>",
stop_generating = "<C-x>",
},
})
-40
View File
@@ -1,40 +0,0 @@
local cmp_kinds = {
Text = '',
Method = '',
Function = '',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
}
local cmp = require('cmp')
cmp.setup({
preselect = 'None',
formatting = {
fields = { 'kind', 'abbr' },
format = function(_, vim_item)
vim_item.kind = cmp_kinds[vim_item.kind] or ''
return vim_item
end,
}
})
-18
View File
@@ -1,18 +0,0 @@
local M = {}
M = {
keymaps = {
toggle = "<C-S-q>",
quit = nil,
},
border = "rounded",
width = "0.8",
height = "0.8",
model = "gpt-5.2",
autoinstall = false,
panel = false,
use_buffer = false,
}
return M
-11
View File
@@ -1,11 +0,0 @@
require("colorizer").setup({
user_default_options = {
mode = "virtualtext",
virtualtext = "",
css = true,
tailwind = true,
sass = { enable = true, parsers = { "css" }},
virtualtext_inline = 'before',
AARRGGBB = true,
},
})
-59
View File
@@ -1,59 +0,0 @@
require("copilot").setup {
panel = {
enabled = false,
auto_refresh = true,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<CR>",
refresh = "gr",
open = "<M-CR>",
},
layout = {
position = "bottom", -- | top | left | right | horizontal | vertical
ratio = 0.4,
},
},
suggestion = {
enabled = false,
auto_trigger = true,
hide_during_completion = true,
debounce = 75,
keymap = {
accept = "<A-tab>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
filetypes = {
-- yaml = false,
markdown = true,
help = true,
-- gitcommit = false,
-- gitrebase = false,
-- hgcommit = false,
-- svn = false,
-- cvs = false,
-- python = false,
-- html = false,
-- css = false,
-- sh = false,
-- tex = false,
-- typescript = false,
-- java = false,
-- swift = false,
-- cpp = false,
-- hypr = false,
-- ["."] = false,
},
copilot_node_command = "node",
server_opts_overrides = {},
vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
callback = function()
vim.cmd "CopilotChatSave AutoSave"
end,
}),
}
-42
View File
@@ -1,42 +0,0 @@
require("CopilotChat").setup {
-- system_prompt = "You are an assistant helping the user with whatever they need, but you are also a bit of an asshole.",
prompts = {
},
headers = {
user = ' You: ',
assistant = ' Copilot: ',
tool = '󰖷 Tool: ',
},
temperature = 0.2,
providers = {
tabby = {
prepare_input = require('CopilotChat.config.providers').copilot.prepare_input,
prepare_output = require('CopilotChat.config.providers').copilot.prepare_output,
get_models = function(headers)
local response, err = require('CopilotChat.utils').curl_get('http://localhost:5000/v1/models', {
headers = headers,
json_response = true
})
if err then
error(err)
end
return vim.tbl_map(function(model)
return {
id = model.id,
name = model.id,
}
end, response.body.data)
end,
get_url = function()
return 'http://localhost:5000/v1/chat/completions'
end,
}
}
}
-106
View File
@@ -1,106 +0,0 @@
local dap = require('dap')
dap.adapters.python = function(cb, config)
if config.request == 'attach' then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or '127.0.0.1'
cb({
type = 'server',
port = assert(port, '`connect.port` is required for a python `attach` configuration'),
host = host,
options = {
source_filetype = 'python',
},
})
else
cb({
type = 'executable',
command = 'path/to/virtualenvs/debugpy/bin/python',
args = { '-m', 'debugpy.adapter' },
options = {
source_filetype = 'python',
},
})
end
end
dap.configurations.python = {
{
-- The first three options are required by nvim-dap
type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python`
request = 'launch';
name = "Launch file";
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
program = "${file}"; -- This configuration will launch the current file if used.
pythonPath = function()
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
return cwd .. '/venv/bin/python'
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
return cwd .. '/.venv/bin/python'
else
return '/home/zach/miniconda3/bin/python'
end
end;
},
}
dap.adapters.lldb = {
type = 'executable',
command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
name = 'lldb'
}
dap.configurations.cpp = {
{
name = 'Launch',
type = 'lldb',
request = 'launch',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
args = {},
-- 💀
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
--
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
--
-- Otherwise you might get the following error:
--
-- Error on launch: Failed to attach to the target process
--
-- But you should be aware of the implications:
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
-- runInTerminal = false,
},
}
dap.adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
-- 💀 Make sure to update this path to point to your installation
args = {"/home/zach/.config/nvim/java-dap/js-debug/src/dapDebugServer.js", "${port}"},
}
}
dap.configurations.javascript = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
}
-35
View File
@@ -1,35 +0,0 @@
return {
"yarospace/dev-tools.nvim",
opts = {
actions = {},
filetypes = {
include = {},
exclude = {},
},
builtin_actions = {
include = {},
exclude = {},
},
action_opts = {
{
group = "Debuggins",
name = "Log vars under cursor",
opts = {
keymap = {
global = "<leader>dl",
picker = "<M-l>",
hide = true,
}
}
}
}
},
ui = {
override = true,
group_actions = true,
}
}
+23
View File
@@ -0,0 +1,23 @@
vim.keymap.del("n", "<leader>ur")
vim.keymap.del("n", "<leader>uf")
vim.keymap.del("n", "<leader>uF")
vim.keymap.del("n", "<leader>us")
vim.keymap.del("n", "<leader>uw")
vim.keymap.del("n", "<leader>uL")
vim.keymap.del("n", "<leader>ud")
vim.keymap.del("n", "<leader>ul")
vim.keymap.del("n", "<leader>uc")
vim.keymap.del("n", "<leader>uA")
vim.keymap.del("n", "<leader>uT")
vim.keymap.del("n", "<leader>ub")
vim.keymap.del("n", "<leader>uD")
vim.keymap.del("n", "<leader>ua")
vim.keymap.del("n", "<leader>ug")
-- vim.keymap.del("n", "<leader>uG")
vim.keymap.del("n", "<leader>up")
vim.keymap.del("n", "<leader>uS")
vim.keymap.del("n", "<leader>uh")
vim.keymap.del("n", "<leader>ui")
vim.keymap.del("n", "<leader>uI")
vim.keymap.del("n", "<leader>uZ")
vim.keymap.del("n", "<leader>uz")
-13
View File
@@ -1,13 +0,0 @@
return {
"Bekaboo/dropbar.nvim",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
run = "make"
},
opts = {
bar = {
}
}
}
-118
View File
@@ -1,118 +0,0 @@
local opts = {
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = Util.ui.borderchars("thick", "tl-t-tr-r-br-b-bl-l"),
sources = {
"filesystem",
"buffers",
"git_status",
"diagnostics",
-- "document_symbols",
},
source_selector = {
winbar = true, -- toggle to show selector on winbar
content_layout = "center",
tabs_layout = "equal",
show_separator_on_edge = true,
sources = {
{ source = "filesystem", display_name = "󰉓" },
{ source = "buffers", display_name = "󰈙" },
{ source = "git_status", display_name = "" },
-- { source = "document_symbols", display_name = "o" },
{ source = "diagnostics", display_name = "󰒡" },
},
},
default_component_configs = {
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = "",
last_indent_marker = "",
-- expander config, needed for nesting files
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "",
folder_empty_open = "",
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "",
},
modified = { symbol = "" },
git_status = { symbols = Icon.git },
diagnostics = { symbols = Icon.diagnostics },
},
window = {
width = 40,
mappings = {
["<1-LeftMouse>"] = "open",
["l"] = "open",
["<space>"] = "none",
["P"] = { "toggle_preview", config = { use_float = false } },
},
},
filesystem = {
window = {
mappings = {
["H"] = "navigate_up",
["<bs>"] = "toggle_hidden",
["."] = "set_root",
["/"] = "fuzzy_finder",
["f"] = "filter_on_submit",
["<c-x>"] = "clear_filter",
["a"] = { "add", config = { show_path = "relative" } }, -- "none", "relative", "absolute"
},
},
filtered_items = {
hide_dotfiles = false,
hide_gitignored = false,
},
follow_current_file = {
enabled = true,
}, -- This will find and focus the file in the active buffer every
-- time the current file is changed while the tree is open.
group_empty_dirs = true, -- when true, empty folders will be grouped together
},
async_directory_scan = "always",
}
opts.filesystem.components =
require "config.features.neo-tree.sources.filesystem.components"
local function hideCursor()
vim.cmd [[
setlocal guicursor=n:block-Cursor
setlocal foldcolumn=0
hi Cursor blend=100
]]
end
local function showCursor()
vim.cmd [[
setlocal guicursor=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20
hi Cursor blend=0
]]
end
local neotree_group = Util.augroup "neo-tree_hide_cursor"
vim.api.nvim_create_autocmd({ "WinEnter", "BufEnter", "InsertEnter" }, {
group = neotree_group,
callback = function()
local action = vim.bo.filetype == "neo-tree" and hideCursor
or showCursor
action()
end,
})
vim.api.nvim_create_autocmd({ "WinLeave", "BufLeave", "InsertEnter" }, {
group = neotree_group,
callback = function()
showCursor()
end,
})
return opts
@@ -1,86 +0,0 @@
local M = {}
function M.name(config, node, state)
local common = require "neo-tree.sources.common.components"
local highlights = require "neo-tree.ui.highlights"
local highlight = config.highlight or highlights.FILE_NAME
local text = node.name
if node.type == "directory" then
highlight = highlights.DIRECTORY_NAME
if config.trailing_slash and text ~= "/" then
text = text .. "/"
end
end
if node:get_depth() == 1 and node.type ~= "message" then
highlight = highlights.ROOT_NAME
text = vim.fn.fnamemodify(text, ":p:h:t")
text = string.upper(text)
else
local filtered_by = common.filtered_by(config, node, state)
highlight = filtered_by.highlight or highlight
if config.use_git_status_colors then
local git_status = state.components.git_status({}, node, state)
if git_status and git_status.highlight then
highlight = git_status.highlight
end
end
end
if type(config.right_padding) == "number" then
if config.right_padding > 0 then
text = text .. string.rep(" ", config.right_padding)
end
else
text = text .. " "
end
return {
text = text,
highlight = highlight,
}
end
function M.icon(config, node, state)
local common = require "neo-tree.sources.common.components"
local highlights = require "neo-tree.ui.highlights"
local icon = config.default or " "
local highlight = config.highlight or highlights.FILE_ICON
if node.type == "directory" then
highlight = highlights.DIRECTORY_ICON
if node.loaded and not node:has_children() then
icon = not node.empty_expanded and config.folder_empty
or config.folder_empty_open
elseif node:is_expanded() then
icon = config.folder_open or "-"
else
icon = config.folder_closed or "+"
end
elseif node.type == "file" or node.type == "terminal" then
local success, web_devicons = pcall(require, "nvim-web-devicons")
if success then
local devicon, hl = web_devicons.get_icon(node.name, node.ext)
icon = devicon or icon
highlight = hl or highlight
end
end
local filtered_by = common.filtered_by(config, node, state)
-- Don't render icon in root folder
if node:get_depth() == 1 then
return {
text = nil,
highlight = highlight,
}
end
return {
text = icon .. " ",
highlight = filtered_by.highlight or highlight,
}
end
return M
-42
View File
@@ -1,42 +0,0 @@
local palettes = {}
require("github-theme").setup {
options = {
compile_path = vim.fn.stdpath "cache" .. "/github-theme",
compile_file_suffix = "_compiled",
hide_end_of_buffer = true,
hide_nc_statusline = true,
transparent = false,
terminal_colors = true,
dim_inactive = false,
module_default = true,
styles = {
comments = "italic",
functions = "NONE",
keywords = "NONE",
variables = "NONE",
conditionals = "NONE",
constants = "NONE",
numbers = "NONE",
operators = "NONE",
strings = "NONE",
types = "NONE",
},
inverse = {
match_paren = false,
visual = false,
search = false,
},
darken = {
floats = true,
sidebars = {
enable = true,
list = {},
},
},
modules = {},
},
palettes = {},
specs = {},
groups = {},
}
-51
View File
@@ -1,51 +0,0 @@
local icons = require("assets.icons").icons
require('gitsigns').setup {
signs = {
add = { text = icons.git.added },
change = { text = icons.git.modified },
delete = { text = icons.git.removed },
topdelete = { text = icons.git.removed },
changedelete = { text = icons.git.modified },
untracked = { text = '' },
},
signs_staged = {
add = { text = icons.git.added },
change = { text = icons.git.modified },
delete = { text = icons.git.removed },
topdelete = { text = icons.git.removed },
changedelete = { text = icons.git.modified },
untracked = { text = '' },
},
signs_staged_enable = true,
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = {
follow_files = true
},
auto_attach = true,
attach_to_untracked = false,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
delay = 1000,
ignore_whitespace = false,
virt_text_priority = 100,
use_focus = true,
},
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
sign_priority = 6,
update_debounce = 100,
status_formatter = nil, -- Use default
max_file_length = 40000, -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
style = 'minimal',
relative = 'cursor',
row = 0,
col = 1
},
}
+23
View File
@@ -0,0 +1,23 @@
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.g.base46_cache = vim.fn.stdpath("data") .. "/base46/"
vim.g.mapleader = " "
vim.g.gruvbox_material_background = "medium"
vim.g.coq_settings = { keymap = { recommended = false } }
vim.g.gruvbox_material_foreground = "original"
vim.api.nvim_set_hl(0, "GitGutterAdd", { fg = "#009900", ctermfg = 2 })
vim.api.nvim_set_hl(0, "GitGutterChange", { fg = "#bbbb00", ctermfg = 3 })
vim.api.nvim_set_hl(0, "GitGutterDelete", { fg = "#ff2222", ctermfg = 1 })
local bg_color = vim.api.nvim_get_hl(0, { name = "Normal" }).bg or "NONE"
vim.api.nvim_set_hl(
0,
"WinSeparator",
{ fg = vim.api.nvim_get_hl(0, { name = "NvimTreeEndOfBuffer" }).fg or "NONE", bg = "NONE" }
)
vim.api.nvim_set_hl(0, "WinSeparator", { fg = bg_color, bg = "NONE" })
vim.api.nvim_set_hl(0, "CursorLine", { bg = vim.api.nvim_get_hl(0, { name = "CursorLine" }).bg or "NONE" })
vim.api.nvim_set_hl(0, "LspReferenceWrite", { bg = vim.api.nvim_get_hl(0, { name = "CursorLine" }).bg or "NONE" })
vim.api.nvim_set_hl(0, "LspReferenceText", { bg = vim.api.nvim_get_hl(0, { name = "CursorLine" }).bg or "NONE" })
vim.api.nvim_set_hl(0, "LspReferenceRead", { bg = vim.api.nvim_get_hl(0, { name = "CursorLine" }).bg or "NONE" })
-1
View File
@@ -1 +0,0 @@
require("gruvbox-baby").setup()
-50
View File
@@ -1,50 +0,0 @@
require("gruvbox").setup({
variant = "hard",
dark_variant = "medium",
dim_inactive_windows = false,
extend_background_behind_borders = false,
enable = {
terminal = true,
legacy_highlights = true,
migrations = true,
},
styles = {
bold = true,
italic = true,
transparency = false,
},
groups = {
border = "gray",
link = "purple_lite",
panel = "bg_second",
error = "red_lite",
hint = "aqua_lite",
info = "blue_lite",
ok = "green_lite",
warn = "yellow_lite",
note = "yellow_dark",
todo = "aqua_dark",
git_add = "green_dark",
git_change = "yellow_dark",
git_delete = "red_dark",
git_dirty = "orange_dark",
git_ignore = "gray",
git_merge = "purple_dark",
git_rename = "blue_dark",
git_stage = "purple_dark",
git_text = "yellow_lite",
git_untracked = "bg2",
h1 = "red_dark",
h2 = "yellow_dark",
h3 = "green_dark",
h4 = "aqua_dark",
h5 = "blue_dark",
h6 = "purple_dark",
},
})
-34
View File
@@ -1,34 +0,0 @@
local harpoon = require("harpoon")
harpoon:setup()
local conf = require("telescope.config").values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
require("telescope.pickers").new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
}):find()
end
vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
{ desc = "Open harpoon window" })
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<C-1>", function() harpoon:list():select(1) end)
vim.keymap.set("n", "<C-2>", function() harpoon:list():select(2) end)
vim.keymap.set("n", "<C-3>", function() harpoon:list():select(3) end)
vim.keymap.set("n", "<C-4>", function() harpoon:list():select(4) end)
vim.keymap.set("n", "<C-S-P>", function() harpoon:list():prev() end)
vim.keymap.set("n", "<C-S-N>", function() harpoon:list():next() end)
-29
View File
@@ -1,29 +0,0 @@
local highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
}
local hooks = require "ibl.hooks"
-- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
vim.g.rainbow_delimiters = { highlight = highlight }
require("ibl").setup {
indent = { char = "" },
scope = { highlight = highlight }
}
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
-24
View File
@@ -1,24 +0,0 @@
require("kanagawa").setup({
compile = true,
undercurl = true,
commentStyle = { italic = true },
functionStyle = {},
keywordStyle = { italic = true},
statementStyle = { bold = true },
typeStyle = {},
transparent = false,
dimInactive = false,
terminalColors = true,
colors = {
palette = {},
theme = { wave = {}, lotus = {}, dragon = {}, all = {} },
},
overrides = function(colors)
return {}
end,
theme = "dragon",
background = {
dark = "dragon",
light = "lotus"
},
})
+79
View File
@@ -0,0 +1,79 @@
local map = vim.keymap.set
require("config.disable-default-keybinds")
map("n", "<Tab>", "<Cmd>BufferLineCycleNext<CR>")
map("n", "<S-Tab>", "<Cmd>BufferLineCyclePrev<CR>")
map("n", ";", ":", { desc = "CMD enter command mode" })
-- Move selected text up
map("v", "<C-Up>", ":m '<-2<CR>gv=gv", { desc = "Move selected text up" })
map("v", "<C-Down>", ":m '>+1<CR>gv=gv", { desc = "Move selected text down" })
-- Alt + Arrow Key to change buffer
map("n", "<A-Left>", "<C-w>h", { desc = "Move to left split" })
map("n", "<A-Down>", "<C-w>j", { desc = "Move to bottom split" })
map("n", "<A-Up>", "<C-w>k", { desc = "Move to top split" })
map("n", "<A-Right>", "<C-w>l", { desc = "Move to right split" })
-- Copilot Chat buffer
map("n", "<A-c>", vim.cmd.CopilotChatToggle)
map("i", "<A-c>", vim.cmd.CopilotChatToggle)
map("v", "<A-c>", vim.cmd.CopilotChatToggle)
-- map('n', '<leader>e', vim.cmd.NvimTreeToggle)
map("n", "<leader>e", function()
Snacks.explorer()
end)
map("n", "<leader>u", require("undotree").toggle, { noremap = true, silent = true })
map("n", "<A-->", ":bdelete<CR>")
-- map("n", "<SA-->", ":BufferRestore<CR>")
map("n", "<C-a>", "ggVG", { noremap = true, silent = true })
map("n", "<leader>pv", vim.cmd.Ex)
map("v", "J", ":m '>+1<CR>gv=gv")
map("v", "K", ":m '<-2<CR>gv=gv")
map("n", "J", "mzJ`z")
map("n", "<C-d>", "<C-d>zz")
map("n", "<C-u>", "<C-u>zz")
map("n", "n", "nzzzv")
map("n", "N", "Nzzzv")
map("n", "<leader>zig", "<cmd>LspRestart<cr>")
-- greatest remap ever
map("x", "<leader>p", [["_dP]])
-- next greatest remap ever : asbjornHaland
map({ "n", "v" }, "<leader>y", [["+y]])
map("n", "<leader>Y", [["+Y]])
map({ "n", "v" }, "<leader>d", '"_d')
-- This is going to get me cancelled
map("i", "<C-c>", "<Esc>")
map("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>")
map("n", "<leader><leader>", function()
vim.cmd("so")
end)
-- Tmux binds
map("n", "<C-A-Left>", "<cmd>lua require('tmux').move_left()<CR>")
map("n", "<C-A-Down>", "<cmd>lua require('tmux').move_bottom()<CR>")
map("n", "<C-A-Up>", "<cmd>lua require('tmux').move_top()<CR>")
map("n", "<C-A-Right>", "<cmd>lua require('tmux').move_right()<CR>")
map("n", "<A-S-Left>", "<cmd>lua require('tmux').resize_left()<CR>")
map("n", "<A-S-Down>", "<cmd>lua require('tmux').resize_bottom()<CR>")
map("n", "<A-S-Up>", "<cmd>lua require('tmux').resize_top()<CR>")
map("n", "<A-S-Right>", "<cmd>lua require('tmux').resize_right()<CR>")
map("n", "<leader><Left>", "<cmd>lua require('tmux').swap_left()<CR>")
map("n", "<leader><Down>", "<cmd>lua require('tmux').swap_bottom()<CR>")
map("n", "<leader><Up>", "<cmd>lua require('tmux').swap_top()<CR>")
map("n", "<leader><Right>", "<cmd>lua require('tmux').swap_right()<CR>")
+21 -9
View File
@@ -1,4 +1,3 @@
-- bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
@@ -15,16 +14,29 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
require("lazy").setup({
spec = {
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "onedark" } },
-- automatically check for plugin updates
checker = { enabled = true },
defaults = {
lazy = false,
version = false,
},
install = { colorscheme = { "tokyonight", "habamax" } },
checker = {
enabled = true,
notify = false,
},
performance = {
rtp = {
disabled_plugins = {
"gzip",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
-9
View File
@@ -1,9 +0,0 @@
require("lazydev").setup({
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" }},
"LazyVim",
},
enabled = function(root_dir)
return vim.g.lazydev_enabled == nil and true or vim.g.lazydev_enabled
end,
})
-41
View File
@@ -1,41 +0,0 @@
require("lint").linters_by_ft = {
javascript = { "eslint" },
javascriptreact = { "eslint" },
typescript = { "eslint" },
typescriptreact = { "eslint" },
lua = { "luacheck" },
python = { "pylint" },
go = { "golangci_lint" },
rust = { "clippy" },
zsh = { "zsh" },
sh = { "zsh" },
bash = { "zsh" },
cpp = { "cpplint" },
markdown = { "markdownlint" },
json = { "jsonlint" },
yaml = { "yamllint" },
qml = { "qmllint" },
}
local default_severity = {
['error'] = vim.diagnostic.severity.ERROR,
['warning'] = vim.diagnostic.severity.WARN,
['information'] = vim.diagnostic.severity.INFO,
['hint'] = vim.diagnostic.severity.HINT,
}
require("lint").linters.qmllint = {
name = "qmllint",
cmd = "qmllint",
stdin = true,
append_fname = true,
args = {},
stream = nil,
ignore_exitcode = true,
env = nil,
parser = require("lint.parser").from_pattern(
"([^:]+):(%d+) : (.+)",
{ "filename", "lnum", "message" },
default_severity,
{[ "source" ] = "qmllint" }
)
}
-2
View File
@@ -1,2 +0,0 @@
vim.cmd.colorscheme "tokyodark"
vim.o.background = "dark"
-295
View File
@@ -1,295 +0,0 @@
local cmp = require "cmp"
local cmp_lsp = require "cmp_nvim_lsp"
local cmp_kinds = require("assets.icons").icons.kinds
local function flatten_to_array(t)
local res = {}
local function _flatten(tbl)
for _, v in ipairs(tbl) do
if type(v) == "table" then
_flatten(v)
else
table.insert(res, v)
end
end
end
_flatten(t)
return res
end
local capabilities = vim.tbl_deep_extend(
"force",
{},
vim.lsp.protocol.make_client_capabilities(),
cmp_lsp.default_capabilities()
)
require("fidget").setup {}
require("mason").setup()
require("mason-lspconfig").setup {
automatic_enable = true,
ensure_installed = {
"lua_ls",
"rust_analyzer",
"gopls",
},
handlers = {
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {
capabilities = capabilities,
}
end,
["tailwindcss"] = function()
local lspconfig = require "lspconfig"
lspconfig.tailwindcss.setup {
capabilities = capabilities,
}
end,
["css-lsp"] = function()
local lspconfig = require "lspconfig"
lspconfig.cssls.setup {
capabilities = capabilities,
}
end,
zls = function()
local lspconfig = require "lspconfig"
lspconfig.zls.setup {
capabilities = capabilities,
root_dir = lspconfig.util.root_pattern(
".git",
"build.zig",
"zls.json"
),
settings = {
zls = {
enable_inlay_hints = true,
enable_snippets = true,
warn_style = true,
},
},
}
vim.g.zig_fmt_parse_errors = 0
vim.g.zig_fmt_autosave = 0
end,
["lua_ls"] = function()
local lspconfig = require "lspconfig"
lspconfig.lua_ls.setup {
capabilities = capabilities,
settings = {
Lua = {
runtime = { version = "Lua 5.1" },
diagnostics = {
globals = {
"bit",
"vim",
"it",
"describe",
"before_each",
"after_each",
},
},
},
},
}
end,
},
}
cmp.setup {
preselect = "None",
formatting = {
fields = { "kind", "abbr" },
format = function(entry, vim_item)
vim_item.kind = cmp_kinds[vim_item.kind] or ""
if entry.completion_item.detail then
vim_item.menu = entry.completion_item.detail
end
return vim_item
end,
},
completion = { completeopt = "menu,menuone" },
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
view = {
entries = "custom",
},
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-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
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
require("luasnip").jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = cmp.config.sources {
{ name = "path" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
},
}
vim.diagnostic.config {
virtual_text = false,
virtual_lines = false,
signs = true,
underline = true,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = true,
header = "",
prefix = "",
},
}
local lspconfig = vim.lsp.config
lspconfig("texlab", {
cmd = { "texlab" },
filetypes = { "tex", "bib", "plaintex" },
root_markers = {
".git",
".latexmkrc",
"latexmkrc",
".texlabroot",
"texlabroot",
"Tectonic.toml",
},
settings = {
texlab = {
rootDirectory = nil,
build = {
executable = "latexmk",
args = {
"-pdf",
"-interaction=nonstopmode",
"-synctex=1",
"%f",
},
onSave = true,
forwardSearchAfter = true,
},
forwardSearch = {
executable = "zathura",
args = {
"--synctex-editor-command",
[[ nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]]
.. vim.v.servername,
"--synctex-forward",
"%l:1:%f",
"%p",
},
},
chktex = {
onEdit = false,
onOpenAndSave = true,
},
diagnosticsDelay = 300,
latexFormatter = "latexindent",
latexindent = {
["local"] = nil,
modifyLineBreaks = false,
},
bibtexFormatter = "texlab",
formatterLineLength = 80,
},
},
})
lspconfig("qmlls", {
cmd = { "qmlls6" },
filetypes = { "qml" },
single_file_support = true,
root_dir = function(bufnr, on_dir)
local root = vim.fs.root(bufnr, ".git")
on_dir(root)
end,
})
lspconfig("jsonls", {
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
},
},
})
lspconfig("yamlls", {
settings = {
yaml = {
schemaStore = {
enable = false,
url = "",
},
schemas = require("schemastore").yaml.schemas(),
},
},
})
local lspenable = vim.lsp.enable
local servers = {
"html",
"bashls",
"pyright",
"ts_ls",
"texlab",
"sourcekit",
"qmlls",
"tailwindcss",
"systemd-lsp",
require("mason-lspconfig").get_installed_servers(),
}
local flat_servers = flatten_to_array(servers)
for _, server in ipairs(flat_servers) do
lspconfig(server, {
on_attach = function(client, bufnr)
if client.name == "typos_lsp" then
return
end
end,
capabilities = capabilities,
})
lspenable(server)
end
-10
View File
@@ -1,10 +0,0 @@
require("lspsaga").setup({
symbol_in_winbar = {
enable = false,
},
ui = {
code_action = "",
}
})
-194
View File
@@ -1,194 +0,0 @@
local fn = vim.fn
local icons = require("assets.icons").icons
local get_active_lsp = function()
local msg = ""
local buf_ft = vim.api.nvim_get_option_value("filetype", {})
local clients = vim.lsp.get_clients { bufnr = 0 }
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
---@diagnostic disable-next-line: undefined-field
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end
local function spell()
if vim.o.spell then
return string.format "[SPELL]"
end
return ""
end
--- show indicator for Chinese IME
local function ime_state()
if vim.g.is_mac then
local layout =
fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
if res ~= -1 then
return "[CN]"
end
end
return ""
end
local diff = function()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end
local virtual_env = function()
-- only show virtual env for Python
if vim.bo.filetype ~= "python" then
return ""
end
local conda_env = os.getenv "CONDA_DEFAULT_ENV"
local venv_path = os.getenv "VIRTUAL_ENV"
if venv_path == nil then
if conda_env == nil then
return ""
else
return string.format(" %s (conda)", conda_env)
end
else
local venv_name = vim.fn.fnamemodify(venv_path, ":t")
return string.format(" %s (venv)", venv_name)
end
end
local lint_progress = function()
local linters = require("lint").get_running()
if #linters == 0 then
return ""
end
return table.concat(linters, ", ")
end
require("lualine").setup {
laststatus = 0,
options = {
icons_enabled = true,
theme = "zshell",
globalstatus = true,
component_separators = "",
section_separators = { left = "", right = "" },
disabled_filetypes = {},
always_divide_middle = true,
},
sections = {
lualine_a = {
{
"mode",
},
},
lualine_b = {
{
"branch",
fmt = function(name, _)
-- truncate branch name in case the name is too long
return string.sub(name, 1, 20)
end,
color = { gui = "italic,bold" },
separator = { right = "" },
},
{
virtual_env,
color = { fg = "black", bg = "#F1CA81" },
},
},
lualine_c = {
{
"filename",
symbols = {
readonly = "[ 󰌾 ]",
},
},
{
"diff",
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
source = diff,
},
{
"%S",
color = { gui = "bold", fg = "cyan" },
},
{
spell,
color = { fg = "black", bg = "#a7c080" },
},
},
lualine_x = {
{
ime_state,
color = { fg = "black", bg = "#f46868" },
},
{
lint_progress,
icon = "󱉶 ",
},
{
get_active_lsp,
icon = "",
},
{
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
},
lualine_y = {
{ "encoding", fmt = string.upper },
{
"fileformat",
symbols = {
unix = "",
dos = "",
mac = "",
},
},
"filetype",
},
lualine_z = {
{
"location",
},
},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = { "quickfix", "fugitive", "nvim-tree" },
}
-7
View File
@@ -1,7 +0,0 @@
return {
content = {
active = nil,
inactive = nil,
},
use_icons = true,
}
-17
View File
@@ -1,17 +0,0 @@
require("modicator").setup({
show_warnings = true,
highlights = {
defaults = {
bold = false,
italic = false,
},
use_cursorline_background = true,
},
integration = {
lualine = {
enabled = true,
mode_section = nil,
highlight = 'bg',
}
}
})
-11
View File
@@ -1,11 +0,0 @@
require("mini.splitjoin").setup({
mappings = {
toggle = "gS",
},
detect = {
brackets = { '%b()', '%b{}', '%b[]' },
separator = '[,;]',
},
})
-35
View File
@@ -1,35 +0,0 @@
require("monokai-pro").setup({
transparent_background = false,
terminal_colors = true,
devicons = true,
styles = {
comment = { italic = true },
keyword = { italic = true },
type = { italic = true },
storageclass = { italic = true },
structure = { italic = true },
parameter = { italic = true },
annotation = { italic = true },
tag_attribute = { italic = true },
},
filter = "pro",
day_night = {
enable = false,
day_filter = "pro",
night_filter = "spectrum",
},
inc_search = "background",
background_clear = {
},
plugins = {
bufferline = {
underline_selected = false,
underline_visible = false,
},
indent_blankline = {
context_highlight = "default",
context_start_underline = false,
},
},
})
-11
View File
@@ -1,11 +0,0 @@
vim.g.neovide_cursor_trail_size = 0
vim.g.neovide_floating_corner_radius = 0.4
vim.o.guifont = "0xProto Nerd Font Mono:h12"
vim.g.neovide_refresh_rate = 144
vim.g.neovide_refresh_rate_idle = 144
vim.g.neovide_no_idle = true
vim.g.neovide_floating_blur_amount_x = 0
vim.g.neovide_floating_blur_amount_y = 0
vim.g.neovide_cursor_animation_length = 0.08
vim.g.neovide_cursor_short_animation_length = 0.04
vim.g.neovide_scroll_animation_length = 0.15
-29
View File
@@ -1,29 +0,0 @@
require("noice").setup({
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
inc_rename = false,
lsp_doc_border = false,
},
views = {
popupmenu = {
enabled = true,
backend = "nui",
win_options = {
winblend = 0.5,
},
border = {
style = "shadow",
padding = { 1, 2 },
},
},
},
})
-118
View File
@@ -1,118 +0,0 @@
vim.notify = require "notify"
local dap = require "dap"
require("notify").setup {
render = "wrapped-default",
timeout = 6000,
max_width = 50,
minimum_width = 50,
level = "info",
fps = 60,
icons = {
ERROR = "",
WARN = "",
INFO = "",
DEBUG = "",
TRACE = "",
},
on_open = function(win)
-- vim.api.nvim_win_set_option(win, 'wrap', true)
vim.api.nvim_win_set_option(win, "breakat", " ")
end,
}
-- Utility functions shared between progress reports for LSP and DAP
local client_notifs = {}
local function get_notif_data(client_id, token)
if not client_notifs[client_id] then
client_notifs[client_id] = {}
end
if not client_notifs[client_id][token] then
client_notifs[client_id][token] = {}
end
return client_notifs[client_id][token]
end
local spinner_frames =
{ "", "", "", "", "", "", "", "" }
local function update_spinner(client_id, token)
local notif_data = get_notif_data(client_id, token)
if notif_data.spinner then
local new_spinner = (notif_data.spinner + 1) % #spinner_frames
notif_data.spinner = new_spinner
notif_data.notification = vim.notify(nil, nil, {
hide_from_history = true,
icon = spinner_frames[new_spinner],
replace = notif_data.notification,
})
vim.defer_fn(function()
update_spinner(client_id, token)
end, 100)
end
end
local function format_title(title, client_name)
return client_name .. (#title > 0 and ": " .. title or "")
end
local function format_message(message, percentage)
return (percentage and percentage .. "%\t" or "") .. (message or "")
end
-- LSP integration
-- Make sure to also have the snippet with the common helper functions in your config!
vim.lsp.handlers["$/progress"] = function(_, result, ctx)
local client_id = ctx.client_id
local val = result.value
if not val.kind then
return
end
local notif_data = get_notif_data(client_id, result.token)
if val.kind == "begin" then
local message = format_message(val.message, val.percentage)
notif_data.notification = vim.notify(message, "info", {
title = format_title(
val.title,
vim.lsp.get_client_by_id(client_id).name
),
icon = spinner_frames[1],
timeout = false,
hide_from_history = false,
})
notif_data.spinner = 1
update_spinner(client_id, result.token)
elseif val.kind == "report" and notif_data then
notif_data.notification =
vim.notify(format_message(val.message, val.percentage), "info", {
replace = notif_data.notification,
hide_from_history = false,
})
elseif val.kind == "end" and notif_data then
notif_data.notification = vim.notify(
val.message and format_message(val.message) or "Complete",
"info",
{
icon = "",
replace = notif_data.notification,
timeout = 3000,
}
)
notif_data.spinner = nil
end
end
-7
View File
@@ -1,7 +0,0 @@
local popup = require('nui.popup')
local Popup = popup({
border = {
style = "shadow",
}
})
-32
View File
@@ -1,32 +0,0 @@
-- local null_ls = require("null-ls")
--
-- local group = vim.api.nvim_create_augroup("lsp_format_on_save", { clear = false })
-- local event = "BufWritePre" -- or "BufWritePost"
-- local async = event == "BufWritePost"
--
-- null_ls.setup({
-- on_attach = function(client, bufnr)
-- if client.supports_method("textDocument/formatting") then
-- vim.keymap.set("n", "<Leader>f", function()
-- vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() })
-- end, { buffer = bufnr, desc = "[lsp] format" })
--
-- -- format on save
-- vim.api.nvim_clear_autocmds({ buffer = bufnr, group = group })
-- vim.api.nvim_create_autocmd(event, {
-- buffer = bufnr,
-- group = group,
-- callback = function()
-- vim.lsp.buf.format({ bufnr = bufnr, async = async })
-- end,
-- desc = "[lsp] format on save",
-- })
-- end
--
-- if client.supports_method("textDocument/rangeFormatting") then
-- vim.keymap.set("x", "<Leader>f", function()
-- vim.lsp.buf.format({ bufnr = vim.api.nvim_get_current_buf() })
-- end, { buffer = bufnr, desc = "[lsp] format" })
-- end
-- end,
-- })
+11 -22
View File
@@ -1,15 +1,9 @@
vim.o.pumblend = 50
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = false
vim.opt.smartindent = false
vim.o.list = true
vim.opt.listchars = { tab = "··", trail = "·", nbsp = "_" }
vim.opt.laststatus = 3
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = true
vim.opt.linebreak = true
vim.opt.swapfile = false
@@ -25,8 +19,9 @@ vim.opt.isfname:append("@-@")
vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
vim.opt.textwidth = 80
vim.opt.formatoptions = "rqnj"
vim.opt.formatoptions = "tcrqnj"
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
vim.o.laststatus = 3
vim.o.clipboard = "unnamedplus"
vim.o.cursorline = true
vim.o.cursorlineopt = "number"
@@ -35,29 +30,23 @@ vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.mouse = "a"
vim.o.number = true
vim.o.termguicolors = true
vim.o.numberwidth = 3
vim.o.ruler = false
vim.o.showmode = false
vim.opt.shortmess:append "sI"
vim.opt.shortmess:append("sI")
vim.o.splitbelow = true
vim.o.splitright = true
vim.o.timeoutlen = 400
vim.opt.whichwrap:append "<>[]hl"
vim.opt.whichwrap:append("<>[]hl")
vim.g.loaded_node_provider = 0
vim.g.loaded_python3_provider = 0
vim.g.loaded_perl_provider = 0
vim.g.loaded_ruby_provider = 0
local is_windows = vim.fn.has "win32" ~= 0
local is_windows = vim.fn.has("win32") ~= 0
local sep = is_windows and "\\" or "/"
local delim = is_windows and ";" or ":"
vim.env.PATH = table.concat({ vim.fn.stdpath "data", "mason", "bin" }, sep) .. delim .. vim.env.PATH
vim.env.PATH = table.concat({ vim.fn.stdpath("data"), "mason", "bin" }, sep) .. delim .. vim.env.PATH
vim.api.nvim_set_hl( 0, "Cursor", { reverse = true })
vim.api.nvim_create_user_command('Redir', function(ctx)
local lines = vim.split(vim.api.nvim_exec(ctx.args, true), '\n', { plain = true })
vim.cmd('new')
vim.api.nvim_buf_set_lines(0, 0, -1, false, lines)
vim.opt_local.modified = false
end, { nargs = '+', complete = 'command' })
vim.g.snacks_animate = false
vim.g.autoformat = false
vim.g.lazyvim_cmp = "nvim-cmp"
-19
View File
@@ -1,19 +0,0 @@
local prettier = require("prettier")
prettier.setup({
bin = 'prettier',
filetypes = {
"css",
"graphql",
"html",
"javascript",
"javascriptreact",
"json",
"less",
"markdown",
"scss",
"typescript",
"typescriptreact",
"yaml",
},
})
-26
View File
@@ -1,26 +0,0 @@
require('refactoring').setup({
prompt_func_return_type = {
go = true,
java = true,
cpp = true,
c = true,
h = true,
hpp = true,
cxx = true,
},
prompt_func_param_type = {
go = true,
java = true,
cpp = true,
c = true,
h = true,
hpp = true,
cxx = true,
},
printf_statements = {},
print_var_statements = {},
show_success_message = true, -- shows a message with information about the refactor on success
-- i.e. [Refactor] Inlined 3 variable occurrences
})
-4
View File
@@ -1,4 +0,0 @@
require("region-folding").setup({
region_text = { start = "<think>", ending = "</think>" },
fold_indicator = "",
})
-55
View File
@@ -1,55 +0,0 @@
local opts = {}
opts = {
file_types = { "markdown" },
completions = {
lsp = {
enabled = true,
},
},
render_modes = true,
anti_conceal = {
enabled = true,
above = 1,
below = 1,
},
code = {
enabled = true,
render_modes = false,
sign = true,
conceal_delimiters = true,
language = true,
position = "left",
language_icon = true,
language_name = true,
language_info = true,
language_pad = 0,
width = "full",
left_margin = 0,
left_pad = 2,
right_pad = 0,
min_width = 40,
border = "thick",
language_border = "",
language_left = "",
language_right = "",
above = "",
below = "",
inline = true,
inline_left = "",
inline_right = "",
inline_pad = 0,
priority = 140,
highlight = "RenderMarkdownCode",
highlight_info = "RenderMarkdownCodeInfo",
highlight_language = nil,
highlight_border = "RenderMarkdownCodeBorder",
highlight_fallback = "RenderMarkdownCodeFallback",
highlight_inline = "RenderMarkdownCodeInline",
style = "full",
},
}
return opts
-6
View File
@@ -1,6 +0,0 @@
-- local colors = require("monokai-pro.octagon.colors").setup()
require("scrollbar").setup {
handle = {},
marks = {},
}
-22
View File
@@ -1,22 +0,0 @@
require("smart-splits").setup {
ignored_buftypes = {
"nofile",
"quickfix",
"prompt",
},
ignored_filetypes = { "NvimTree" },
default_amount = 3,
at_edge = "wrap",
float_win_behavior = "previous",
move_cursor_same_row = false,
cursor_follows_swapped_bufs = false,
ignored_events = {
"BufEnter",
"WinEnter",
},
multiplexer_integration = nil,
disable_multiplexer_nav_when_zoomed = true,
kitty_password = nil,
zellij_move_focus_or_tab = false,
log_level = "error",
}
-139
View File
@@ -1,139 +0,0 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
bigfile = { enabled = true },
dashboard = { enabled = true },
explorer = { enabled = true },
indent = {
enabled = true,
scope = {
enabled = true,
underline = false,
},
chunk = {
enabled = false,
char = {
corner_top = "",
corner_bottom = "",
vertical = "",
arrow = "",
},
},
},
input = { enabled = true },
picker = {
enabled = true,
hidden = true,
ignored = true,
},
image = {
enabled = true,
formats = {
"png",
"jpg",
"jpeg",
"gif",
"bmp",
"webp",
"tiff",
"heic",
"avif",
"mp4",
"mov",
"avi",
"mkv",
"webm",
"pdf",
"icns",
},
doc = {
enabled = true,
inline = true,
float = true,
max_width = 80,
max_height = 80,
},
},
notifier = {
timeout = 3000,
width = { min = 40, max = 0.4 },
height = { min = 1, max = 0.6 },
margin = { top = 0, right = 1, bottom = 0 },
padding = true,
gap = 0,
sort = { "level", "added" },
level = vim.log.levels.TRACE,
icons = {
error = "",
warn = "",
info = "",
debug = "",
trace = "",
},
keep = function(notif)
return vim.fn.getcmdpos() > 0
end,
---@type snacks.notifier.style
style = "fancy",
top_down = true,
date_format = "%R",
---@type string|boolean
more_format = " ↓ %d lines ",
refresh = 50,
},
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = false },
statuscolumn = { enabled = true },
words = { enabled = true },
terminal = {
enabled = true,
win = { style = "terminal" },
},
styles = {
terminal = {
keys = {
term_normal = {
"<c-q>",
function()
Snacks.terminal.toggle()
end,
mode = "t",
},
},
},
notification = {
border = true,
zindex = 100,
ft = "markdown",
wo = {
winblend = 0,
wrap = true,
conceallevel = 2,
colorcolumn = "",
},
bo = { filetype = "snacks_notif" },
},
notification_history = {
border = true,
zindex = 100,
minimal = false,
title = " Notifications ",
title_pos = "center",
ft = "markdown",
bo = { filetype = "snacks_notif_history", modifiable = false },
wo = { winhighlight = "Normal:SnacksNotifierHistory" },
keys = { q = "close" },
},
},
gitbrowse = {
enabled = true,
notify = false,
},
},
}
-7
View File
@@ -1,7 +0,0 @@
require("telescope").setup ({
pickers = {
colorscheme = {
enable_preview = true,
}
}
})
-15
View File
@@ -1,15 +0,0 @@
local i = {}
function M.foldexpr()
local lnum = vim.v.lnum
local line = vim.fn.getline( lnum )
if line:find( "<think>", 1, true ) then
return "a1"
elseif line:find( "</think>", 1, true ) then
return "s1"
else
return "="
end
end
return M
-1
View File
@@ -1 +0,0 @@
require("texlabconfig").setup({})
-8
View File
@@ -1,8 +0,0 @@
-- lua
require('onedarkpro').setup({
highlights = {
Comment = { italic = true },
Directory = { bold = false },
ErrorMsg = { italic = true },
},
})
-21
View File
@@ -1,21 +0,0 @@
require("tmux").setup({
copy_sync = {
enable = true,
redirect_to_clipboard = true,
sync_clipboard = false,
sync_registers = true,
},
navigation = {
cycle_navigation = true,
enable_default_keybindings = false,
},
resize = {
enable_default_keybindings = false,
resize_step_x = 5,
resize_step_y = 5,
},
swap = {
cycle_navigation = false,
enable_default_keybindings = false,
}
})
-13
View File
@@ -1,13 +0,0 @@
local treesitter = require "nvim-treesitter"
treesitter.install { "all" }
local parsers = treesitter.get_installed()
vim.api.nvim_create_autocmd("FileType", {
pattern = parsers,
callback = function()
vim.treesitter.start()
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})
-19
View File
@@ -1,19 +0,0 @@
require('undotree').setup({
float_diff = true,
layout = "left_bottom",
position = "left",
ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' },
window = {
winblend = 30,
},
keymaps = {
['j'] = "move_next",
['k'] = "move_prev",
['gj'] = "move2parent",
['J'] = "move_change_next",
['K'] = "move_change_prev",
['<cr>'] = "action_enter",
['p'] = "enter_diffbuf",
['q'] = "quit",
},
})
-10
View File
@@ -1,10 +0,0 @@
require("zterm-navigator").setup {
left = "<A-Left>",
right = "<A-Right>",
up = "<A-Up>",
down = "<A-Down>",
statusline = {
enabled = false,
},
}
-202
View File
@@ -1,202 +0,0 @@
local M = {}
local function get_qmlls_client(bufnr)
for _, c in ipairs(vim.lsp.get_clients { bufnr = bufnr }) do
if c.name == "qmlls" then
return c
end
end
end
local function first_client_encoding(bufnr)
local c = vim.lsp.get_clients({ bufnr = bufnr })[1]
return (c and c.offset_encoding) or "utf-16"
end
local function normalize_locations(result)
if not result then
return {}
end
-- Single Location / LocationLink
if result.uri or result.targetUri then
return { result }
end
-- Array of Location / LocationLink
if vim.islist(result) then
return result
end
return {}
end
local function request_locations(bufnr, method, timeout_ms)
local enc = first_client_encoding(bufnr)
local params = vim.lsp.util.make_position_params(0, enc)
local responses =
vim.lsp.buf_request_sync(bufnr, method, params, timeout_ms or 1000)
if not responses then
return {}
end
local all = {}
for client_id, resp in pairs(responses) do
local result = resp and resp.result
local locs = normalize_locations(result)
for _, loc in ipairs(locs) do
table.insert(all, { client_id = client_id, loc = loc })
end
end
return all
end
local function jump_to_first_location(bufnr, matches)
if #matches == 0 then
return false
end
local m = matches[1]
local client = vim.lsp.get_client_by_id(m.client_id)
local enc = (client and client.offset_encoding)
or first_client_encoding(bufnr)
local loc = m.loc
-- Convert LocationLink -> Location-ish target for jump_to_location
if loc.targetUri then
loc = {
uri = loc.targetUri,
range = loc.targetSelectionRange or loc.targetRange,
}
end
vim.lsp.util.jump_to_location(loc, enc)
return true
end
local function get_cursor_context(bufnr)
local pos = vim.api.nvim_win_get_cursor(0)
local row = pos[1] - 1
local col = pos[2]
local line = vim.api.nvim_buf_get_lines(bufnr, row, row + 1, false)[1] or ""
local cword = vim.fn.expand "<cword>"
return row, col, line, cword
end
-- Tries to detect something like Config.save() and returns ("Config", "save")
local function detect_singleton_member_call(bufnr)
local _, col, line, cword = get_cursor_context(bufnr)
local before = line:sub(1, col + 1)
-- If cursor is on "save" in Config.save(), this usually works.
local singleton = before:match "([%a_][%w_]*)%s*%.[%w_]*$"
if not singleton then
-- If cursor is on "Config", this can also catch it.
singleton = before:match "([%a_][%w_]*)%s*$"
if singleton and not line:sub(col + 1):match "^%s*%." then
singleton = nil
end
end
if not singleton then
return nil
end
-- Basic heuristic: singleton names are often capitalized in QML
-- (you can remove this check if your singletons are lowercase)
if not singleton:match "^[A-Z_]" then
return nil
end
return singleton, cword
end
local function find_project_root(bufnr)
local qmlls = get_qmlls_client(bufnr)
if qmlls and qmlls.config and qmlls.config.root_dir then
return qmlls.config.root_dir
end
return vim.fs.root(bufnr, { ".qmlls.ini", ".git" }) or vim.fn.getcwd()
end
local function singleton_fallback_jump(bufnr)
local singleton, member = detect_singleton_member_call(bufnr)
if not singleton then
return false
end
local root = find_project_root(bufnr)
local target_name = singleton .. ".qml"
local matches = vim.fs.find(target_name, {
path = root,
type = "file",
limit = math.huge,
})
if not matches or vim.tbl_isempty(matches) then
return false
end
local pick = nil
if #matches == 1 then
pick = matches[1]
else
-- Prefer a path containing "/Config/" for Config.qml, etc.
for _, p in ipairs(matches) do
if
p:match("/" .. singleton .. "/")
or p:match("/" .. target_name .. "$")
then
pick = p
break
end
end
pick = pick or matches[1]
end
vim.cmd.edit(vim.fn.fnameescape(pick))
-- Optional: try to jump near the member inside the singleton file.
if member and member ~= singleton then
local escaped = vim.fn.escape(member, [[\/]])
-- Try function save(...) first, then any "save" occurrence.
local found =
vim.fn.search("\\<function\\s\\+" .. escaped .. "\\s*(", "W")
if found == 0 then
vim.fn.search("\\<" .. escaped .. "\\>", "W")
end
end
vim.notify(
("LSP returned no locations; fell back to %s.qml"):format(singleton),
vim.log.levels.INFO
)
return true
end
function M.smart_qml_jump()
local bufnr = vim.api.nvim_get_current_buf()
-- 1) Try normal definition
local defs = request_locations(bufnr, "textDocument/definition", 1200)
if jump_to_first_location(bufnr, defs) then
return
end
-- 2) Try type definition
local tdefs = request_locations(bufnr, "textDocument/typeDefinition", 1200)
if jump_to_first_location(bufnr, tdefs) then
return
end
-- 3) Singleton fallback: Config.save() -> Config.qml
if singleton_fallback_jump(bufnr) then
return
end
vim.notify(
"No locations found (definition/typeDefinition/fallback)",
vim.log.levels.WARN
)
end
return M
-13
View File
@@ -1,13 +0,0 @@
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
vim.g.mapleader = " "
vim.g.gruvbox_material_background = "medium"
vim.g.coq_settings = { keymap = { recommended = false } }
vim.g.gruvbox_material_foreground = "original"
vim.g.zig_fmt_parse_errors = 0
vim.g.zig_fmt_autosave = 0
vim.api.nvim_set_hl(0, 'GitGutterAdd', { fg = '#009900', ctermfg = 2 })
vim.api.nvim_set_hl(0, 'GitGutterChange', { fg = '#bbbb00', ctermfg = 3 })
vim.api.nvim_set_hl(0, 'GitGutterDelete', { fg = '#ff2222', ctermfg = 1 })
-61
View File
@@ -1,61 +0,0 @@
-- Generated by zshell. Lualine theme matching the zshell colorscheme.
local is_light = "dark" == "light"
local function pick(light, dark)
return is_light and light or dark
end
local c = {
bg = "#1A1206",
bg_alt = "#231A0D",
bg_mid = pick("#32291A", "#271E11"),
fg = "#F1E0CA",
fg_muted = "#DBC3A1",
fg_strong = pick("#15161A", "#F4F4F8"),
normal = "#7D2C1E",
insert = "#733429",
visual = "#B5893E",
replace = "#93000A",
command = pick("#FFDFD5", "#B9AB66"),
inactive = "#231A0D",
normal_fg = pick("#15161A", "#F4F4F8"),
insert_fg = pick("#15161A", "#F4F4F8"),
visual_fg = pick("#15161A", "#F4F4F8"),
replace_fg = pick("#15161A", "#F4F4F8"),
command_fg = pick("#15161A", "#F4F4F8"),
}
return {
normal = {
a = { fg = c.normal_fg, bg = c.normal, gui = "bold" },
b = { fg = c.fg_strong, bg = c.bg_mid },
c = { fg = c.fg, bg = c.bg_alt },
},
insert = {
a = { fg = c.insert_fg, bg = c.insert, gui = "bold" },
b = { fg = c.fg_strong, bg = c.bg_mid },
c = { fg = c.fg, bg = c.bg_alt },
},
visual = {
a = { fg = c.visual_fg, bg = c.visual, gui = "bold" },
b = { fg = c.fg_strong, bg = c.bg_mid },
c = { fg = c.fg, bg = c.bg_alt },
},
replace = {
a = { fg = c.replace_fg, bg = c.replace, gui = "bold" },
b = { fg = c.fg_strong, bg = c.bg_mid },
c = { fg = c.fg, bg = c.bg_alt },
},
command = {
a = { fg = c.command_fg, bg = c.command, gui = "bold" },
b = { fg = c.fg_strong, bg = c.bg_mid },
c = { fg = c.fg, bg = c.bg_alt },
},
inactive = {
a = { fg = c.fg_muted, bg = c.inactive, gui = "bold" },
b = { fg = c.fg_muted, bg = c.inactive },
c = { fg = c.fg_muted, bg = c.bg },
},
}
-121
View File
@@ -1,121 +0,0 @@
local map = vim.keymap.set
map("n", "<Tab>", "<Cmd>BufferLineCycleNext<CR>")
map("n", "<S-Tab>", "<Cmd>BufferLineCyclePrev<CR>")
map("n", ";", ":", { desc = "CMD enter command mode" })
-- Move selected text up
map("v", "<C-Up>", ":m '<-2<CR>gv=gv", { desc = "Move selected text up" })
map("v", "<C-Down>", ":m '>+1<CR>gv=gv", { desc = "Move selected text down" })
-- Copilot Chat buffer
map("n", "<A-c>", vim.cmd.CopilotChatToggle)
map("i", "<A-c>", vim.cmd.CopilotChatToggle)
map("v", "<A-c>", vim.cmd.CopilotChatToggle)
-- Splits
vim.keymap.set("n", "<A-S-Left>", require("smart-splits").resize_left)
vim.keymap.set("n", "<A-S-Down>", require("smart-splits").resize_down)
vim.keymap.set("n", "<A-S-Up>", require("smart-splits").resize_up)
vim.keymap.set("n", "<A-S-Right>", require("smart-splits").resize_right)
vim.keymap.set("n", "<A-Left>", require("smart-splits").move_cursor_left)
vim.keymap.set("n", "<A-Down>", require("smart-splits").move_cursor_down)
vim.keymap.set("n", "<A-Up>", require("smart-splits").move_cursor_up)
vim.keymap.set("n", "<A-Right>", require("smart-splits").move_cursor_right)
-- Explorer and Undotree
map("n", "<leader>e", function()
Snacks.explorer()
end)
map(
"n",
"<leader>u",
require("undotree").toggle,
{ noremap = true, silent = true }
)
-- Telescope grep
map(
"n",
"<leader>g",
require("telescope.builtin").live_grep,
{ desc = "Telescope grep" }
)
map(
"n",
"<leader>f",
require("telescope.builtin").find_files,
{ desc = "Telescope find files" }
)
-- LSP
map(
"n",
"gd",
vim.lsp.buf.definition,
{ noremap = true, silent = true, buffer = bufnr }
)
map("n", "<A-->", ":bdelete<CR>")
-- map("n", "<SA-->", ":BufferRestore<CR>")
map("n", "<C-a>", "ggVG", { noremap = true, silent = true })
map("n", "J", "mzJ`z")
map("n", "<C-d>", "<C-d>zz")
map("n", "<C-u>", "<C-u>zz")
map("n", "n", "nzzzv")
map("n", "N", "Nzzzv")
map("n", "<leader>zig", "<cmd>LspRestart<cr>")
-- greatest remap ever
map("x", "<leader>p", [["_dP]])
-- next greatest remap ever : asbjornHaland
map({ "n", "v" }, "<leader>y", [["+y]])
map("n", "<leader>Y", [["+Y]])
map({ "n", "v" }, "<leader>d", '"_d')
-- This is going to get me cancelled
map("i", "<C-c>", "<Esc>")
map("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>")
map("n", "<leader><leader>", function()
vim.cmd "so"
end)
map("n", "<A-v>", "<cmd>ChatGPT<CR>")
map(
"n",
"<leader>fm",
"<cmd>TailwindConcealToggle<CR>",
{ desc = "Toggle Tailwind Conceal" }
)
-- Terminal
map("n", "<C-q>", function()
Snacks.terminal.toggle()
end, { desc = "Toggle Terminal" })
-- Gitbrowse
map("n", "<leader>gb", function()
Snacks.gitbrowse.open()
end)
-- Notif history
map("n", "<leader>n", function()
Snacks.notifier.show_history()
end)
-- Actions Previewer
map({ "n", "v" }, "<leader>ap", require("actions-preview").code_actions)
map("n", "K", require("pretty_hover").hover)
-- winbar
local dbar_api = require "dropbar.api"
map("n", "<leader>b", dbar_api.pick)
-17
View File
@@ -1,17 +0,0 @@
local M = {}
function M.load_modules()
local modules_path = vim.fn.stdpath("config") .. "/lua/config/modules"
local modules = vim.fn.globpath(modules_path, "*.lua", false, true)
for _, module_file in ipairs(modules) do
local module_name = vim.fn.fnamemodify(module_file, ":t:r")
local ok, err = pcall(require, "config.modules." .. module_name)
if not ok then
vim.notify("Failed to load module: " .. module_name .. "\n" .. err, vim.log.levels.ERROR)
end
end
end
return M
+38
View File
@@ -0,0 +1,38 @@
return {
"rmagatti/auto-session",
enabled = true,
opts = {
root_dir = vim.fn.stdpath("data") .. "/sessions/",
auto_save = true,
auto_restore = true,
auto_create = true,
suppressed_dirs = nil,
allowed_dirs = nil,
auto_restore_last_session = false,
use_git_branch = false,
lazy_support = true,
bypass_save_filetypes = nil,
close_unsupported_windows = true,
args_allow_single_directory = true,
args_allow_files_auto_save = false,
continue_restore_on_error = true,
show_auto_restore_notif = false,
cwd_change_handling = false,
lsp_stop_on_restore = false,
log_level = "error",
session_lens = {
load_on_setup = true,
theme_conf = {},
previewer = false,
mappings = {
delete_session = { "i", "<C-D>" },
alternate_session = { "i", "<C-S>" },
copy_session = { "i", "<C-Y>" },
},
session_control = {
control_dir = vim.fn.stdpath("data") .. "/auto_session/",
control_filename = "session_control.json",
},
},
},
}
+4 -61
View File
@@ -1,66 +1,9 @@
return {
{ "notken12/base46-colors" },
{
"olimorris/onedarkpro.nvim",
priority = 1000,
config = function()
require "config.themelight"
end,
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
{
"notken12/base46-colors",
},
{
"loctvl842/monokai-pro.nvim",
config = function()
require "config.monokaipro"
end,
},
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
config = function()
require "config.catppuccin"
end,
},
{
"rebelot/kanagawa.nvim",
-- config = function()
-- require("config.kanagawa")
-- end,
},
{
"sainnhe/edge",
lazy = false,
priority = 1000,
config = function()
vim.g.edge_enable_italic = 1
vim.g.edge_style = "default"
vim.g.edge_menu_selection_background = "purple"
end,
},
{
"projekt0n/github-nvim-theme",
lazy = false,
priority = 1000,
config = function()
require "config.githubtheme"
end,
},
{
"alexmozaidze/palenight.nvim",
},
{
"Yazeed1s/minimal.nvim",
init = function()
vim.g.minimal_italic_comments = true
vim.g.minimal_italic_keywords = true
end,
},
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {},
},
}
+61
View File
@@ -0,0 +1,61 @@
return {
{
"CopilotC-Nvim/CopilotChat.nvim",
cmd = "CopilotChatToggle",
keys = function()
return {}
end,
},
{
"folke/flash.nvim",
keys = function()
return {}
end,
},
{
"MagicDuck/grug-far.nvim",
keys = function()
return {}
end,
},
{
"williamboman/mason.nvim",
keys = function()
return {}
end,
},
{
"folke/noice.nvim",
keys = function()
return {}
end,
},
{
"nvim-treesitter/nvim-treesitter",
keys = function()
return {}
end,
},
{
"folke/snacks.nvim",
keys = function()
return {}
end,
},
{
"ThePrimeagen/harpoon",
keys = function()
return {}
end,
},
{
"L3M0N4D3/LuaSnip",
keys = function()
return {}
end,
},
{
"folke/persistence.nvim",
enabled = false,
},
}
+4
View File
@@ -0,0 +1,4 @@
return {
"andweeb/presence.nvim",
enabled = true,
}
+197
View File
@@ -0,0 +1,197 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
table.insert(opts.sources, { name = "emoji" })
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").lsp.on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, {
function()
return "😄"
end,
})
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
}
-336
View File
@@ -1,336 +0,0 @@
return {
{
"nvim-mini/mini.nvim",
version = false,
modules = function()
require "config.mini-modules"
end,
},
{
"nvim-treesitter/nvim-treesitter",
lazy = false,
branch = "main",
build = ":TSUpdate",
config = function()
require "config.treesitter"
end,
},
{
"rmagatti/auto-session",
config = function()
require "config.autosession"
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require "config.telescope"
end,
},
{
"lambdalisue/vim-suda",
init = function()
vim.g.suda_smart_edit = 1
end,
},
{
"nvim-tree/nvim-web-devicons",
},
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
config = function()
require "config.barbar"
end,
},
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
config = function()
require "config.lualine"
end,
},
{
"mawkler/modicator.nvim",
config = function()
require "config.modicator"
end,
},
{
"jiaoshijie/undotree",
config = function()
require "config.undotree"
end,
},
{
"hiphish/rainbow-delimiters.nvim",
enabled = false,
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require "config.autopairs"
end,
},
{
"tpope/vim-fugitive",
},
{
"zbirenbaum/copilot.lua",
lazy = true,
cmd = "Copilot",
event = "InsertEnter",
config = function()
require "config.copilot"
end,
},
{
"CopilotC-Nvim/CopilotChat.nvim",
dependencies = {
{ "zbirenbaum/copilot.lua" },
{ "nvim-lua/plenary.nvim", branch = "master" },
},
build = "make tiktoken",
config = function()
require "config.copilotchat"
end,
},
{
"mfussenegger/nvim-dap",
config = function()
require "config.dapconf"
end,
},
{
require "config.snacks",
},
{
"folke/lazydev.nvim",
ft = "lua",
opts = function()
require "config.lazydev"
end,
},
{
"neovim/nvim-lspconfig",
enabled = true,
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/nvim-cmp",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"j-hui/fidget.nvim",
"b0o/schemastore.nvim",
},
config = function()
require "config.lspconfig"
end,
},
{
"smolck/command-completion.nvim",
opts = {
border = nil,
highlight_selection = true,
use_matchfuzzy = true,
tab_completion = true,
},
},
{
"andweeb/presence.nvim",
},
{
"mfussenegger/nvim-jdtls",
},
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require "config.harpoon"
end,
},
-- {
-- "catgoose/nvim-colorizer.lua",
-- config = function()
-- require("config.colorizer")
-- end,
-- },
{
"ziglang/zig.vim",
},
{
"mg979/vim-visual-multi",
branch = "master",
},
{
"elkowar/yuck.vim",
},
{
"f3fora/nvim-texlabconfig",
config = function()
require "config.texlab"
end,
build = "go build",
},
{
"lancewilhelm/horizon-extended.nvim",
},
{
"vimpostor/vim-tpipeline",
},
{
"yazeed1s/minimal.nvim",
config = function()
vim.g.minimal_italic_comments = true
end,
},
{
"ThePrimeagen/refactoring.nvim",
config = function()
require "config.refactoring"
end,
},
{
"Yazeed1s/minimal.nvim",
config = function()
vim.g.minimal_italic_comments = true
vim.g.minimal_italic_functions = true
end,
},
-- {
-- "propet/colorscheme-persist.nvim",
-- dependencies = {
-- "nvim-telescope/telescope.nvim",
-- },
-- lazy = false,
-- config = true,
-- keys = {
-- {
-- "<leader>sp",
-- function()
-- require("colorscheme-persist").picker()
-- end,
-- mode = "n",
-- },
-- },
-- opts = {
-- picker_opts = require("telescope.themes").get_dropdown {
-- enable_preview = true,
-- },
-- },
-- },
{
"aznhe21/actions-preview.nvim",
config = function()
require "config.actions-preview"
end,
},
{
"mfussenegger/nvim-lint",
config = function()
require "config.lint"
end,
},
{
"rachartier/tiny-inline-diagnostic.nvim",
config = function()
require "config.TID"
end,
},
{
"MunifTanjim/nui.nvim",
},
-- {
-- "artemave/workspace-diagnostics.nvim",
-- },
{
require "config.dev-tools",
},
{
"Fildo7525/pretty_hover",
event = "LspAttach",
opts = {},
},
{
"knubie/vim-kitty-navigator",
build = "cp ./*.py ~/.config/kitty/",
},
{
require "config.dropbar",
},
{
"lewis6991/gitsigns.nvim",
config = function()
require "config.gitsigns"
end,
},
{
"sbdchd/neoformat",
init = function()
vim.cmd(
"source "
.. vim.fn.stdpath "config"
.. "/lua/plugins/neoformat.vim"
)
end,
},
{
"petertriho/nvim-scrollbar",
config = function()
require "config.scrollbar"
end,
},
{
"Zacharias-Brohn/zterm-navigator.nvim",
enabled = false,
config = function()
require "config.zterm-navigator"
end,
},
{
"MeanderingProgrammer/render-markdown.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-mini/mini.nvim",
},
---@module 'render-markdown'
---@type render.md.UserConfig
opts = require "config.render-markdown",
},
{
"mrjones2014/smart-splits.nvim",
config = function()
require "config.smart-splits"
end,
},
{
"kkrampis/codex.nvim",
lazy = true,
cmd = { "Codex", "CodexToggle" },
keys = {
-- {
-- nil,
-- function()
-- require("codex").toggle()
-- end,
-- desc = "Toggle Codex",
-- mode = { "n", "t" },
-- },
},
opts = function()
require "config.codex"
end,
},
}
+139
View File
@@ -0,0 +1,139 @@
local cmp = require("cmp")
local cmp_lsp = require("cmp_nvim_lsp")
local capabilities =
vim.tbl_deep_extend("force", {}, vim.lsp.protocol.make_client_capabilities(), cmp_lsp.default_capabilities())
return {
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/nvim-cmp",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"j-hui/fidget.nvim",
},
init = function()
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
"pyright",
"tsserver",
"gopls",
"rust_analyzer",
"clangd",
"jsonls",
"yamlls",
"html",
"cssls",
},
handlers = {
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup({
capabilities = capabilities,
})
end,
zls = function()
local lspconfig = require("lspconfig")
lspconfig.zls.setup({
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
settings = {
zls = {
enable_inlay_hints = true,
enable_snippets = true,
warn_style = true,
},
},
})
vim.g.zig_fmt_parse_errors = 0
vim.g.zig_fmt_autosave = 0
end,
["lua_ls"] = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({
capabilities = capabilities,
settings = {
Lua = {
runtime = { version = "Lua 5.1" },
diagnostics = {
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
},
},
},
})
end,
},
})
cmp.setup({
completion = { completeopt = "menu,menuone" },
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
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-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
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
require("luasnip").jump(-1)
else
fallback()
end
end, { "i", "s" }),
-- ["<Up>"] = cmp.mapping(function()
-- vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Up>", true, true, true), "n", true)
-- end, { "i", "s" }),
-- ["<Down>"] = cmp.mapping(function()
-- vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Down>", true, true, true), "n", true)
-- end, { "i", "s" }),
},
sources = cmp.config.sources({
{ name = "path" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
}),
})
vim.diagnostic.config({
-- update_in_insert = true,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
})
end,
}
+165
View File
@@ -0,0 +1,165 @@
local fn = vim.fn
local get_active_lsp = function()
local msg = "🚫"
local buf_ft = vim.api.nvim_get_option_value("filetype", {})
local clients = vim.lsp.get_clients({ bufnr = 0 })
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
---@diagnostic disable-next-line: undefined-field
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end
local function spell()
if vim.o.spell then
return string.format("[SPELL]")
end
return ""
end
--- show indicator for Chinese IME
local function ime_state()
if vim.g.is_mac then
local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
if res ~= -1 then
return "[CN]"
end
end
return ""
end
local diff = function()
local git_status = vim.b.gitsigns_status_dict
if git_status == nil then
return
end
local modify_num = git_status.changed
local remove_num = git_status.removed
local add_num = git_status.added
local info = { added = add_num, modified = modify_num, removed = remove_num }
-- vim.print(info)
return info
end
local virtual_env = function()
-- only show virtual env for Python
if vim.bo.filetype ~= "python" then
return ""
end
local conda_env = os.getenv("CONDA_DEFAULT_ENV")
local venv_path = os.getenv("VIRTUAL_ENV")
if venv_path == nil then
if conda_env == nil then
return ""
else
return string.format(" %s (conda)", conda_env)
end
else
local venv_name = vim.fn.fnamemodify(venv_path, ":t")
return string.format(" %s (venv)", venv_name)
end
end
return {
"nvim-lualine/lualine.nvim",
opts = function(_, opts)
-- Merge or replace LazyVim's opts with your custom settings
opts.options = {
icons_enabled = true,
theme = "auto",
globalstatus = true,
component_separators = "",
section_separators = { left = "", right = "" },
disabled_filetypes = {},
always_divide_middle = true,
}
opts.sections = {
lualine_a = { { "mode" } },
lualine_b = {
{
"branch",
fmt = function(name, _)
return string.sub(name, 1, 20)
end,
color = { gui = "italic,bold" },
separator = { right = "" },
},
{
virtual_env,
color = { fg = "black", bg = "#F1CA81" },
},
},
lualine_c = {
{
"filename",
symbols = { readonly = "[🔒]" },
},
{
"diff",
source = diff,
},
{
"%S",
color = { gui = "bold", fg = "cyan" },
},
{
spell,
color = { fg = "black", bg = "#a7c080" },
},
},
lualine_x = {
{
ime_state,
color = { fg = "black", bg = "#f46868" },
},
{
get_active_lsp,
icon = " LSP:",
},
{
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = { error = "🆇 ", warn = "⚠️ ", info = " ", hint = "" },
},
},
lualine_y = {
{ "encoding", fmt = string.upper },
{
"fileformat",
symbols = {
unix = "",
dos = "",
mac = "",
},
},
"filetype",
},
lualine_z = { "progress" },
}
opts.inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
}
opts.tabline = {}
opts.extensions = { "quickfix", "fugitive", "nvim-tree" }
end,
}
-11
View File
@@ -1,11 +0,0 @@
let g:neoformat_enabled_python = ['autopep8']
let g:neoformat_enabled_javascript = ['prettier']
let g:neoformat_enabled_html = ['prettier']
let g:neoformat_enabled_css = ['prettier']
let g:neoformat_enabled_json = ['prettier']
let g:neoformat_enabled_yaml = ['prettier']
let g:neoformat_enabled_lua = ['stylua']
let g:neoformat_enabled_rust = ['rustfmt']
let g:neoformat_enabled_cpp = ['uncrustify']
let g:neoformat_enabled_markdown = ['prettier']
let g:neoformat_enabled_qml = ['qmlformat']
+3
View File
@@ -0,0 +1,3 @@
return {
"hiphish/rainbow-delimiters.nvim",
}
+14
View File
@@ -0,0 +1,14 @@
return {
"aserowy/tmux.nvim",
navigation = {
cycle_navigation = true,
enable_default_keybindings = false,
},
resize = {
enable_default_keybindings = false,
},
swap = {
cycle_navigation = true,
enable_default_keybindings = false,
},
}
-221
View File
@@ -1,221 +0,0 @@
return {
"y3owk1n/undo-glow.nvim",
version = "*",
opts = {
animation = {
enabled = true,
duration = 300,
animation_type = "fade",
window_scoped = true,
},
highlights = {
undo = {
hl_color = { bg = "#693232" }, -- Dark muted red
},
redo = {
hl_color = { bg = "#2F4640" }, -- Dark muted green
},
yank = {
hl_color = { bg = "#7A683A" }, -- Dark muted yellow
},
paste = {
hl_color = { bg = "#325B5B" }, -- Dark muted cyan
},
search = {
hl_color = { bg = "#5C475C" }, -- Dark muted purple
},
comment = {
hl_color = { bg = "#7A5A3D" }, -- Dark muted orange
},
cursor = {
hl_color = { bg = "#793D54" }, -- Dark muted pink
},
},
priority = 2048 * 3,
},
keys = {
{
"u",
function()
require("undo-glow").undo()
end,
mode = "n",
desc = "Undo with highlight",
noremap = true,
},
{
"U",
function()
require("undo-glow").redo()
end,
mode = "n",
desc = "Redo with highlight",
noremap = true,
},
{
"p",
function()
require("undo-glow").paste_below()
end,
mode = "n",
desc = "Paste below with highlight",
noremap = true,
},
{
"P",
function()
require("undo-glow").paste_above()
end,
mode = "n",
desc = "Paste above with highlight",
noremap = true,
},
{
"n",
function()
require("undo-glow").search_next {
animation = {
animation_type = "strobe",
},
}
end,
mode = "n",
desc = "Search next with highlight",
noremap = true,
},
{
"N",
function()
require("undo-glow").search_prev {
animation = {
animation_type = "strobe",
},
}
end,
mode = "n",
desc = "Search prev with highlight",
noremap = true,
},
{
"*",
function()
require("undo-glow").search_star {
animation = {
animation_type = "strobe",
},
}
end,
mode = "n",
desc = "Search star with highlight",
noremap = true,
},
{
"#",
function()
require("undo-glow").search_hash {
animation = {
animation_type = "strobe",
},
}
end,
mode = "n",
desc = "Search hash with highlight",
noremap = true,
},
{
"gc",
function()
-- This is an implementation to preserve the cursor position
local pos = vim.fn.getpos "."
vim.schedule(function()
vim.fn.setpos(".", pos)
end)
return require("undo-glow").comment()
end,
mode = { "n", "x" },
desc = "Toggle comment with highlight",
expr = true,
noremap = true,
},
{
"gc",
function()
require("undo-glow").comment_textobject()
end,
mode = "o",
desc = "Comment textobject with highlight",
noremap = true,
},
{
"gcc",
function()
return require("undo-glow").comment_line()
end,
mode = "n",
desc = "Toggle comment line with highlight",
expr = true,
noremap = true,
},
},
init = function()
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
callback = function()
require("undo-glow").yank()
end,
})
-- This only handles neovim instance and do not highlight when switching panes in tmux
vim.api.nvim_create_autocmd("CursorMoved", {
desc = "Highlight when cursor moved significantly",
callback = function()
require("undo-glow").cursor_moved {
animation = {
animation_type = "slide",
},
}
end,
})
-- This will handle highlights when focus gained, including switching panes in tmux
vim.api.nvim_create_autocmd("FocusGained", {
desc = "Highlight when focus gained",
callback = function()
---@type UndoGlow.CommandOpts
local opts = {
animation = {
animation_type = "slide",
},
}
opts = require("undo-glow.utils").merge_command_opts(
"UgCursor",
opts
)
local pos = require("undo-glow.utils").get_current_cursor_row()
require("undo-glow").highlight_region(
vim.tbl_extend("force", opts, {
s_row = pos.s_row,
s_col = pos.s_col,
e_row = pos.e_row,
e_col = pos.e_col,
force_edge = opts.force_edge == nil and true
or opts.force_edge,
})
)
end,
})
vim.api.nvim_create_autocmd("CmdlineLeave", {
desc = "Highlight when search cmdline leave",
callback = function()
require("undo-glow").search_cmd {
animation = {
animation_type = "fade",
},
}
end,
})
end,
}
+22
View File
@@ -0,0 +1,22 @@
return {
"jiaoshijie/undotree",
opts = {
float_diff = true,
layout = "left_bottom",
position = "left",
ignore_filetype = { "undotree", "undotreeDiff", "qf", "TelescopePrompt", "spectre_panel", "tsplayground" },
window = {
winblend = 30,
},
keymaps = {
["j"] = "move_next",
["k"] = "move_prev",
["gj"] = "move2parent",
["J"] = "move_change_next",
["K"] = "move_change_prev",
["<cr>"] = "action_enter",
["p"] = "enter_diffbuf",
["q"] = "quit",
},
},
}

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