Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 91773e0a00 | |||
| ee4515da26 | |||
| 4c2f8f17d3 | |||
| 2fbd1332e5 | |||
| a517625e1d | |||
| 95828a8abe | |||
| 75a5dd8f9c | |||
| d9157328ef | |||
| 9c871ccf40 | |||
| ce4238004b | |||
| 4c8248f323 | |||
| f77acb5f33 | |||
| 1d13bc8a07 | |||
| 353b462aaf | |||
| a806dc285f | |||
| 8ce88a35bc | |||
| 918d3654c5 | |||
| f434feba89 | |||
| f2b10ec900 | |||
| 7526d2795b | |||
| 92170fa726 |
@@ -1,4 +1,21 @@
|
|||||||
|
### The infamous windows/linux Neovim config
|
||||||
|
|
||||||
|
## windows
|
||||||
|
|
||||||
|
# Powershell
|
||||||
|
|
||||||
|
Make use of the powershell script to solve a bunch of issues beforehand.
|
||||||
|
|
||||||
|
```pwsh
|
||||||
|
.\scripts\windows_dependencies.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
To Do powershell script:
|
||||||
|
|
||||||
|
- [] Add binaries to PATH
|
||||||
|
|
||||||
## Remove lines containing regex
|
## Remove lines containing regex
|
||||||
|
|
||||||
```
|
```
|
||||||
:%g/{regex}/d
|
:%g/{regex}/d
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
function! neoformat#formatters#pwsh#enabled() abort
|
||||||
|
return ['pwshfmt']
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! neoformat#formatters#pwsh#pwshfmt() abort
|
||||||
|
if has('win32') || has('win64')
|
||||||
|
let l:args = [
|
||||||
|
\ '-NoProfile',
|
||||||
|
\ '-Command',
|
||||||
|
\ 'Invoke-Formatter',
|
||||||
|
\ ]
|
||||||
|
else
|
||||||
|
let l:args = [
|
||||||
|
\ '-NoProfile',
|
||||||
|
\ '-Command',
|
||||||
|
\ '"Import-Module (Resolve-Path \"/opt/powershell-editor-services/PSScriptAnalyzer/*/PSScriptAnalyzer.psd1\" | Select-Object -ExpandProperty Path); Invoke-Formatter -ScriptDefinition (\$input | Out-String)"'
|
||||||
|
\ ]
|
||||||
|
endif
|
||||||
|
|
||||||
|
return {
|
||||||
|
\ 'exe': 'pwsh',
|
||||||
|
\ 'args': l:args,
|
||||||
|
\ 'stdin': 1,
|
||||||
|
\ }
|
||||||
|
endfunction
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
@@ -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,
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,432 @@
|
|||||||
|
-- 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 = "#171216",
|
||||||
|
bg_alt = "#201A1F",
|
||||||
|
bg_float = "#241E23",
|
||||||
|
bg_popup = "#2E282D",
|
||||||
|
bg_cursorline = pick("#2E282D", "#3A3338"),
|
||||||
|
bg_fold = "#201A1F",
|
||||||
|
bg_visual = "#5D3F5C",
|
||||||
|
bg_search = pick("#8CAB44", "#5D3F5C"),
|
||||||
|
bg_incsearch = "#D285D3",
|
||||||
|
bg_selection = "#D285D3",
|
||||||
|
bg_statusline = pick("#2E282D", "#241E23"),
|
||||||
|
bg_statusline_nc = "#201A1F",
|
||||||
|
bg_tabline = "#201A1F",
|
||||||
|
bg_tabsel = "#2E282D",
|
||||||
|
|
||||||
|
fg = "#EBDFE6",
|
||||||
|
fg_muted = "#D2C2CE",
|
||||||
|
fg_subtle = "#9B8C98",
|
||||||
|
fg_comment = pick("#9B8C98", "#4F434D"),
|
||||||
|
fg_strong = pick("#1A1B1F", "#F2F2F7"),
|
||||||
|
fg_on_soft = pick("#17181C", "#F4F4F8"),
|
||||||
|
|
||||||
|
border = "#4F434D",
|
||||||
|
accent = "#FCABFC",
|
||||||
|
accent_container = "#D285D3",
|
||||||
|
accent_fg = "#5B1961",
|
||||||
|
accent_solid_fg = "#53115A",
|
||||||
|
|
||||||
|
secondary = "#E2BADE",
|
||||||
|
secondary_container = "#5D3F5C",
|
||||||
|
secondary_fg = "#D3ADCF",
|
||||||
|
secondary_solid_fg = "#422742",
|
||||||
|
|
||||||
|
tertiary = "#B2D266",
|
||||||
|
tertiary_container = "#8CAB44",
|
||||||
|
tertiary_fg = "#2C3C00",
|
||||||
|
tertiary_solid_fg = "#263500",
|
||||||
|
|
||||||
|
error = "#FFB4AB",
|
||||||
|
error_container = "#93000A",
|
||||||
|
error_fg = "#FFDAD6",
|
||||||
|
error_solid_fg = "#690005",
|
||||||
|
|
||||||
|
ok = "#FFBAC2",
|
||||||
|
warn = "#FFDDEA",
|
||||||
|
info = "#B3A2D5",
|
||||||
|
hint = "#FFBA93",
|
||||||
|
add = "#FFBAC2",
|
||||||
|
change = "#B3A2D5",
|
||||||
|
delete = "#F248D2",
|
||||||
|
|
||||||
|
cursor_fg = "#53115A",
|
||||||
|
cursor_bg = "#FCABFC",
|
||||||
|
match_bg = "#8CAB44",
|
||||||
|
match_fg = "#2C3C00",
|
||||||
|
todo_bg = "#8CAB44",
|
||||||
|
todo_fg = "#2C3C00",
|
||||||
|
|
||||||
|
-- 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 = "#D994CF",
|
||||||
|
code_func = "#FFBA93",
|
||||||
|
code_string = "#FFBAC2",
|
||||||
|
code_number = "#FFDDEA",
|
||||||
|
code_const = "#F248D2",
|
||||||
|
code_type = "#FCABFC",
|
||||||
|
code_special = "#B2D266",
|
||||||
|
code_preproc = "#E2BADE",
|
||||||
|
code_builtin = "#FCABFC",
|
||||||
|
code_param = "#FFDDEA",
|
||||||
|
code_field = "#E2BADE",
|
||||||
|
code_namespace = "#B2D266",
|
||||||
|
code_operator = pick("#FCABFC", "#E2BADE"),
|
||||||
|
|
||||||
|
line_current = pick("#232428", "#E7E7EC"),
|
||||||
|
ref_bg = pick("#3A3338", "#2E282D"),
|
||||||
|
}
|
||||||
|
|
||||||
|
-- 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
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
if not MiniSplitjoin then return end
|
||||||
local gen_hook = MiniSplitjoin.gen_hook
|
local gen_hook = MiniSplitjoin.gen_hook
|
||||||
|
|
||||||
local curly = { brackets = { '%b{}' }}
|
local curly = { brackets = { '%b{}' }}
|
||||||
|
|||||||
+4
-4
@@ -1,12 +1,12 @@
|
|||||||
local gen_hook = MiniSplitjoin.gen_hook
|
local gen_hook = MiniSplitjoin.gen_hook
|
||||||
|
|
||||||
local curly = { brackets = { '%b{}' }, separator = ';' }
|
local curly = { brackets = { "%b{}" }, separator = ";" }
|
||||||
local curly_semi = { brackets = { '%b{}' }, separator = ';' }
|
local curly_semi = { brackets = { "%b{}" }, separator = ";" }
|
||||||
local add_semicolon_curly = gen_hook.add_trailing_separator(curly)
|
local add_semicolon_curly = gen_hook.add_trailing_separator(curly)
|
||||||
local remove_semicolon_curly = gen_hook.del_trailing_separator(curly)
|
local remove_semicolon_curly = gen_hook.del_trailing_separator(curly)
|
||||||
local pad_curly = gen_hook.pad_brackets(curly_semi)
|
local pad_curly = gen_hook.pad_brackets(curly_semi)
|
||||||
|
|
||||||
vim.b.minisplitjoin_config = {
|
vim.b.minisplitjoin_config = {
|
||||||
split = { hooks_post = { remove_semicolon_curly }},
|
split = { hooks_post = { remove_semicolon_curly } },
|
||||||
join = { hooks_pre = { add_semicolon_curly }, hooks_post = { pad_curly }},
|
join = { hooks_pre = { add_semicolon_curly }, hooks_post = { pad_curly } },
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
"<leader>a",
|
||||||
|
function()
|
||||||
|
vim.cmd.RustLsp('codeAction') -- supports rust-analyzer's grouping
|
||||||
|
-- or vim.lsp.buf.codeAction() if you don't want grouping.
|
||||||
|
end,
|
||||||
|
{ silent = true, buffer = bufnr }
|
||||||
|
)
|
||||||
|
vim.keymap.set(
|
||||||
|
"n",
|
||||||
|
"K", -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
|
||||||
|
function()
|
||||||
|
vim.cmd.RustLsp({'hover', 'actions'})
|
||||||
|
end,
|
||||||
|
{ silent = true, buffer = bufnr }
|
||||||
|
)
|
||||||
@@ -1,22 +1,10 @@
|
|||||||
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
|
|
||||||
|
|
||||||
vim.cmd('source ' .. vim.fn.stdpath("config") .. "/cursor.vim")
|
|
||||||
require("config.lazy")
|
|
||||||
require("options")
|
require("options")
|
||||||
|
require("config.lazy")
|
||||||
require("globals")
|
require("globals")
|
||||||
require("mappings")
|
require("mappings")
|
||||||
require("autocmd")
|
require("autocmd")
|
||||||
require("minimodules").load_modules()
|
require("minimodules").load_modules()
|
||||||
-- require("coc-settings")
|
vim.cmd('source ' .. vim.fn.stdpath("config") .. "/cursor.vim")
|
||||||
|
|
||||||
if vim.g.neovide then
|
if vim.g.neovide then
|
||||||
require("config.neovide")
|
require("config.neovide")
|
||||||
@@ -28,3 +16,14 @@ vim.filetype.add({
|
|||||||
[".*/uwsm/env.*"] = "zsh",
|
[".*/uwsm/env.*"] = "zsh",
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
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
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
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
|
||||||
+33
-11
@@ -1,20 +1,42 @@
|
|||||||
local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
autocmd("LspAttach", {
|
autocmd("LspAttach", {
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local client = vim.lsp.get_client_by_id( args.data.client_id )
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
if client then
|
if client then
|
||||||
vim.lsp.document_color.enable(false, args.buf, { "background" })
|
vim.lsp.document_color.enable(false, { bufnr = args.buf })
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
autocmd("VimLeave", {
|
autocmd("VimLeave", {
|
||||||
command = "set guicursor=a:ver25-Cursor"
|
command = "set guicursor=a:ver25-Cursor",
|
||||||
})
|
})
|
||||||
|
|
||||||
autocmd({ "CursorHold" }, {
|
autocmd("BufWritePre", {
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.diagnostic.open_float(nil, { focus = false })
|
local ok = pcall(function()
|
||||||
end
|
vim.cmd "undojoin"
|
||||||
|
end)
|
||||||
|
vim.cmd "Neoformat"
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- fWindows
|
||||||
|
autocmd("VimLeavePre", {
|
||||||
|
group = vim.api.nvim_create_augroup("fuck_shada_temp", { clear = true }),
|
||||||
|
pattern = { "*" },
|
||||||
|
callback = function()
|
||||||
|
local status = 0
|
||||||
|
for _, f in ipairs(vim.fn.globpath(vim.fn.stdpath "data" .. "/shada", "*tmp*", false, true)) do
|
||||||
|
if vim.tbl_isempty(vim.fn.readfile(f)) then
|
||||||
|
status = status + vim.fn.delete(f)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if status ~= 0 then
|
||||||
|
vim.notify("Could not delete empty temporary ShaDa files.", vim.log.levels.ERROR)
|
||||||
|
vim.fn.getchar()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
desc = "Delete empty temp ShaDa files",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,173 +0,0 @@
|
|||||||
vimiopt.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)
|
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
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 = { rpreset = "default" },
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
|
local is_windows = package.config:sub(1,1) == "\\"
|
||||||
require("copilot").setup({
|
require("copilot").setup({
|
||||||
|
|
||||||
panel = {
|
panel = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
auto_refresh = true,
|
auto_refresh = true,
|
||||||
@@ -17,10 +19,10 @@ require("copilot").setup({
|
|||||||
suggestion = {
|
suggestion = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
auto_trigger = true,
|
auto_trigger = true,
|
||||||
hide_during_completion = true,
|
hide_during_completion = false,
|
||||||
debounce = 75,
|
debounce = 75,
|
||||||
keymap = {
|
keymap = {
|
||||||
accept = "<A-tab>",
|
accept = is_windows and "<A-a>" or "<A-a>",
|
||||||
accept_word = false,
|
accept_word = false,
|
||||||
accept_line = false,
|
accept_line = false,
|
||||||
next = "<M-]>",
|
next = "<M-]>",
|
||||||
@@ -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>",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -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,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
require("tiny-inline-diagnostic").setup({})
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
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)
|
||||||
@@ -1,46 +1,36 @@
|
|||||||
local cmp = require("cmp")
|
local cmp = require "cmp"
|
||||||
local cmp_lsp = require("cmp_nvim_lsp")
|
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(
|
local capabilities = vim.tbl_deep_extend(
|
||||||
"force",
|
"force",
|
||||||
{},
|
{},
|
||||||
vim.lsp.protocol.make_client_capabilities(),
|
vim.lsp.protocol.make_client_capabilities(),
|
||||||
cmp_lsp.default_capabilities()
|
cmp_lsp.default_capabilities()
|
||||||
)
|
)
|
||||||
|
|
||||||
local cmp_kinds = {
|
require("fidget").setup {}
|
||||||
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 = ' ',
|
|
||||||
}
|
|
||||||
|
|
||||||
require("fidget").setup({})
|
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup {
|
||||||
automatic_enable = true,
|
automatic_enable = true,
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"lua_ls",
|
"lua_ls",
|
||||||
|
"qmlls",
|
||||||
"rust_analyzer",
|
"rust_analyzer",
|
||||||
"gopls",
|
"gopls",
|
||||||
},
|
},
|
||||||
@@ -52,24 +42,28 @@ require("mason-lspconfig").setup({
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
["tailwindcss"] = function()
|
["tailwindcss"] = function()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require "lspconfig"
|
||||||
lspconfig.tailwindcss.setup {
|
lspconfig.tailwindcss.setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
||||||
["css-lsp"] = function()
|
["css-lsp"] = function()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require "lspconfig"
|
||||||
lspconfig.cssls.setup {
|
lspconfig.cssls.setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
||||||
zls = function()
|
zls = function()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require "lspconfig"
|
||||||
lspconfig.zls.setup({
|
lspconfig.zls.setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
|
root_dir = lspconfig.util.root_pattern(
|
||||||
|
".git",
|
||||||
|
"build.zig",
|
||||||
|
"zls.json"
|
||||||
|
),
|
||||||
settings = {
|
settings = {
|
||||||
zls = {
|
zls = {
|
||||||
enable_inlay_hints = true,
|
enable_inlay_hints = true,
|
||||||
@@ -77,34 +71,40 @@ require("mason-lspconfig").setup({
|
|||||||
warn_style = true,
|
warn_style = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
vim.g.zig_fmt_parse_errors = 0
|
vim.g.zig_fmt_parse_errors = 0
|
||||||
vim.g.zig_fmt_autosave = 0
|
vim.g.zig_fmt_autosave = 0
|
||||||
|
|
||||||
end,
|
end,
|
||||||
["lua_ls"] = function()
|
["lua_ls"] = function()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require "lspconfig"
|
||||||
lspconfig.lua_ls.setup {
|
lspconfig.lua_ls.setup {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
runtime = { version = "Lua 5.1" },
|
runtime = { version = "Lua 5.1" },
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
globals = {
|
||||||
}
|
"bit",
|
||||||
}
|
"vim",
|
||||||
}
|
"it",
|
||||||
|
"describe",
|
||||||
|
"before_each",
|
||||||
|
"after_each",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
}
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
preselect = 'None',
|
preselect = "None",
|
||||||
formatting = {
|
formatting = {
|
||||||
fields = { 'kind', 'abbr' },
|
fields = { "kind", "abbr" },
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
vim_item.kind = cmp_kinds[vim_item.kind] or ''
|
vim_item.kind = cmp_kinds[vim_item.kind] or ""
|
||||||
if entry.completion_item.detail then
|
if entry.completion_item.detail then
|
||||||
vim_item.menu = entry.completion_item.detail
|
vim_item.menu = entry.completion_item.detail
|
||||||
end
|
end
|
||||||
@@ -118,6 +118,15 @@ cmp.setup {
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
window = {
|
||||||
|
completion = cmp.config.window.bordered(),
|
||||||
|
documentation = cmp.config.window.bordered(),
|
||||||
|
},
|
||||||
|
|
||||||
|
view = {
|
||||||
|
entries = "custom",
|
||||||
|
},
|
||||||
|
|
||||||
mapping = {
|
mapping = {
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||||
@@ -149,17 +158,17 @@ cmp.setup {
|
|||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
},
|
},
|
||||||
|
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources {
|
||||||
{ name = "path" },
|
{ name = "path" },
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
{ name = "buffer" },
|
{ name = "buffer" },
|
||||||
{ name = "nvim_lua" },
|
{ name = "nvim_lua" },
|
||||||
}),
|
{ name = "copilot" },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config {
|
||||||
-- update_in_insert = true,
|
|
||||||
virtual_text = false,
|
virtual_text = false,
|
||||||
virtual_lines = false,
|
virtual_lines = false,
|
||||||
signs = true,
|
signs = true,
|
||||||
@@ -172,20 +181,32 @@ vim.diagnostic.config({
|
|||||||
header = "",
|
header = "",
|
||||||
prefix = "",
|
prefix = "",
|
||||||
},
|
},
|
||||||
})
|
}
|
||||||
|
|
||||||
local lspconfig = vim.lsp.config
|
local lspconfig = vim.lsp.config
|
||||||
|
|
||||||
lspconfig("texlab", {
|
lspconfig("texlab", {
|
||||||
cmd = { "texlab" },
|
cmd = { "texlab" },
|
||||||
filetypes = { "tex", "bib", "plaintex" },
|
filetypes = { "tex", "bib", "plaintex" },
|
||||||
root_markers = { ".git", ".latexmkrc", "latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
|
root_markers = {
|
||||||
|
".git",
|
||||||
|
".latexmkrc",
|
||||||
|
"latexmkrc",
|
||||||
|
".texlabroot",
|
||||||
|
"texlabroot",
|
||||||
|
"Tectonic.toml",
|
||||||
|
},
|
||||||
settings = {
|
settings = {
|
||||||
texlab = {
|
texlab = {
|
||||||
rootDirectory = nil,
|
rootDirectory = nil,
|
||||||
build = {
|
build = {
|
||||||
executable = "latexmk",
|
executable = "latexmk",
|
||||||
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
|
args = {
|
||||||
|
"-pdf",
|
||||||
|
"-interaction=nonstopmode",
|
||||||
|
"-synctex=1",
|
||||||
|
"%f",
|
||||||
|
},
|
||||||
onSave = true,
|
onSave = true,
|
||||||
forwardSearchAfter = true,
|
forwardSearchAfter = true,
|
||||||
},
|
},
|
||||||
@@ -193,7 +214,8 @@ lspconfig("texlab", {
|
|||||||
executable = "zathura",
|
executable = "zathura",
|
||||||
args = {
|
args = {
|
||||||
"--synctex-editor-command",
|
"--synctex-editor-command",
|
||||||
[[ nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername,
|
[[ nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]]
|
||||||
|
.. vim.v.servername,
|
||||||
"--synctex-forward",
|
"--synctex-forward",
|
||||||
"%l:1:%f",
|
"%l:1:%f",
|
||||||
"%p",
|
"%p",
|
||||||
@@ -206,7 +228,7 @@ lspconfig("texlab", {
|
|||||||
diagnosticsDelay = 300,
|
diagnosticsDelay = 300,
|
||||||
latexFormatter = "latexindent",
|
latexFormatter = "latexindent",
|
||||||
latexindent = {
|
latexindent = {
|
||||||
['local'] = nil,
|
["local"] = nil,
|
||||||
modifyLineBreaks = false,
|
modifyLineBreaks = false,
|
||||||
},
|
},
|
||||||
bibtexFormatter = "texlab",
|
bibtexFormatter = "texlab",
|
||||||
@@ -216,7 +238,30 @@ lspconfig("texlab", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
lspconfig("qmlls", {
|
lspconfig("qmlls", {
|
||||||
cmd = { "qmlls6" },
|
cmd = { "qmlls6", "qmlls" },
|
||||||
|
filetypes = { "qml", "qmljs" },
|
||||||
|
root_markers = { ".git" },
|
||||||
|
})
|
||||||
|
|
||||||
|
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 lspenable = vim.lsp.enable
|
||||||
@@ -229,8 +274,25 @@ local servers = {
|
|||||||
"sourcekit",
|
"sourcekit",
|
||||||
"qmlls",
|
"qmlls",
|
||||||
"tailwindcss",
|
"tailwindcss",
|
||||||
|
"systemd-lsp",
|
||||||
|
require("mason-lspconfig").get_installed_servers(),
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, server in ipairs(servers) do
|
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" or client.name == "copilot" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
require("workspace-diagnostics").populate_workspace_diagnostics(
|
||||||
|
client,
|
||||||
|
bufnr
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
lspenable(server)
|
lspenable(server)
|
||||||
end
|
end
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.plugin = {
|
||||||
|
"sbdchd/neoformat",
|
||||||
|
config = function()
|
||||||
|
vim.g.neoformat_enabled_lua = { "luaformatter" }
|
||||||
|
vim.g.neoformat_enabled_python = { "black" }
|
||||||
|
vim.g.neoformat_enabled_javascript = { "prettier" }
|
||||||
|
vim.g.neoformat_enabled_typescript = { "prettier" }
|
||||||
|
vim.g.neoformat_enabled_qml = { "qmlformat" }
|
||||||
|
vim.g.neoformat_enabled_go = { "gofmt" }
|
||||||
|
vim.g.neoformat_enabled_sh = { "shfmt" }
|
||||||
|
vim.g.neoformat_enabled_bash = { "shfmt" }
|
||||||
|
vim.g.neoformat_enabled_zsh = { "shfmt" }
|
||||||
|
vim.g.neoformat_enabled_rust = { "rustfmt" }
|
||||||
|
vim.g.neoformat_enabled_pwsh = { "pwshfmt" }
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
local prettier = require("prettier")
|
||||||
|
|
||||||
|
prettier.setup({
|
||||||
|
bin = 'prettier',
|
||||||
|
filetypes = {
|
||||||
|
"css",
|
||||||
|
"graphql",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"json",
|
||||||
|
"less",
|
||||||
|
"markdown",
|
||||||
|
"rust",
|
||||||
|
"scss",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
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
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -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)
|
|
||||||
@@ -62,7 +62,7 @@ return {
|
|||||||
scope = { enabled = true },
|
scope = { enabled = true },
|
||||||
scroll = { enabled = true },
|
scroll = { enabled = true },
|
||||||
statuscolumn = { enabled = true },
|
statuscolumn = { enabled = true },
|
||||||
words = { enabled = true },
|
words = { enabled = false },
|
||||||
terminal = {
|
terminal = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
win = { style = "terminal" },
|
win = { style = "terminal" },
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
require("zterm-navigator").setup({
|
||||||
|
-- Default keybindings (set to false to disable)
|
||||||
|
left = "<A-Left>",
|
||||||
|
right = "<A-Right>",
|
||||||
|
up = "<A-Up>",
|
||||||
|
down = "<A-Down>",
|
||||||
|
|
||||||
|
statusline = {
|
||||||
|
enabled = false
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
require("colorizer").setup {
|
||||||
|
user_default_options = {
|
||||||
|
mode = "virtualtext",
|
||||||
|
virtualtext = "●",
|
||||||
|
css = true,
|
||||||
|
tailwind = true,
|
||||||
|
sass = { enable = true, parsers = { "css" } },
|
||||||
|
virtualtext_inline = "before",
|
||||||
|
AARRGGBB = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
|
|
||||||
|
local icons = require("assets.icons").icons
|
||||||
|
|
||||||
local get_active_lsp = function()
|
local get_active_lsp = function()
|
||||||
local msg = ""
|
local msg = ""
|
||||||
local buf_ft = vim.api.nvim_get_option_value("filetype", {})
|
local buf_ft = vim.api.nvim_get_option_value("filetype", {})
|
||||||
@@ -20,7 +22,7 @@ end
|
|||||||
|
|
||||||
local function spell()
|
local function spell()
|
||||||
if vim.o.spell then
|
if vim.o.spell then
|
||||||
return string.format("[SPELL]")
|
return string.format "[SPELL]"
|
||||||
end
|
end
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
@@ -29,7 +31,8 @@ end
|
|||||||
--- show indicator for Chinese IME
|
--- show indicator for Chinese IME
|
||||||
local function ime_state()
|
local function ime_state()
|
||||||
if vim.g.is_mac then
|
if vim.g.is_mac then
|
||||||
local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
|
local layout =
|
||||||
|
fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
|
||||||
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
|
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
|
||||||
if res ~= -1 then
|
if res ~= -1 then
|
||||||
return "[CN]"
|
return "[CN]"
|
||||||
@@ -40,18 +43,14 @@ local function ime_state()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local diff = function()
|
local diff = function()
|
||||||
local git_status = vim.b.gitsigns_status_dict
|
local gitsigns = vim.b.gitsigns_status_dict
|
||||||
if git_status == nil then
|
if gitsigns then
|
||||||
return
|
return {
|
||||||
|
added = gitsigns.added,
|
||||||
|
modified = gitsigns.changed,
|
||||||
|
removed = gitsigns.removed,
|
||||||
|
}
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
local virtual_env = function()
|
local virtual_env = function()
|
||||||
@@ -60,8 +59,8 @@ local virtual_env = function()
|
|||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
local conda_env = os.getenv("CONDA_DEFAULT_ENV")
|
local conda_env = os.getenv "CONDA_DEFAULT_ENV"
|
||||||
local venv_path = os.getenv("VIRTUAL_ENV")
|
local venv_path = os.getenv "VIRTUAL_ENV"
|
||||||
|
|
||||||
if venv_path == nil then
|
if venv_path == nil then
|
||||||
if conda_env == nil then
|
if conda_env == nil then
|
||||||
@@ -75,14 +74,22 @@ local virtual_env = function()
|
|||||||
end
|
end
|
||||||
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 {
|
require("lualine").setup {
|
||||||
laststatus = 0,
|
laststatus = 0,
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
theme = "auto",
|
theme = "zshell",
|
||||||
globalstatus = true,
|
globalstatus = true,
|
||||||
component_separators = '',
|
component_separators = "",
|
||||||
section_separators = { left = '', right = '' },
|
section_separators = { left = "", right = "" },
|
||||||
disabled_filetypes = {},
|
disabled_filetypes = {},
|
||||||
always_divide_middle = true,
|
always_divide_middle = true,
|
||||||
},
|
},
|
||||||
@@ -111,11 +118,16 @@ require("lualine").setup {
|
|||||||
{
|
{
|
||||||
"filename",
|
"filename",
|
||||||
symbols = {
|
symbols = {
|
||||||
readonly = "[]",
|
readonly = "[ ]",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"diff",
|
"diff",
|
||||||
|
symbols = {
|
||||||
|
added = icons.git.added,
|
||||||
|
modified = icons.git.modified,
|
||||||
|
removed = icons.git.removed,
|
||||||
|
},
|
||||||
source = diff,
|
source = diff,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -132,14 +144,23 @@ require("lualine").setup {
|
|||||||
ime_state,
|
ime_state,
|
||||||
color = { fg = "black", bg = "#f46868" },
|
color = { fg = "black", bg = "#f46868" },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
lint_progress,
|
||||||
|
icon = " ",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
get_active_lsp,
|
get_active_lsp,
|
||||||
icon = " LSP:",
|
icon = " ",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
sources = { "nvim_diagnostic" },
|
sources = { "nvim_diagnostic" },
|
||||||
symbols = { error = " ", warn = " ", info = " ", hint = " " },
|
symbols = {
|
||||||
|
error = icons.diagnostics.Error,
|
||||||
|
warn = icons.diagnostics.Warn,
|
||||||
|
info = icons.diagnostics.Info,
|
||||||
|
hint = icons.diagnostics.Hint,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
lualine_y = {
|
lualine_y = {
|
||||||
@@ -155,7 +176,9 @@ require("lualine").setup {
|
|||||||
"filetype",
|
"filetype",
|
||||||
},
|
},
|
||||||
lualine_z = {
|
lualine_z = {
|
||||||
"progress",
|
{
|
||||||
|
"location",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
+13
-13
@@ -1,13 +1,13 @@
|
|||||||
require'nvim-treesitter.configs'.setup {
|
local treesitter = require "nvim-treesitter"
|
||||||
ensure_installed = "all",
|
|
||||||
ignore_install = { "ipkg" },
|
treesitter.install { "all" }
|
||||||
sync_install = true,
|
|
||||||
auto_install = true,
|
local parsers = treesitter.get_installed()
|
||||||
highlight = {
|
|
||||||
enable = true,
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
additional_vim_regex_highlighting = false,
|
pattern = parsers,
|
||||||
},
|
callback = function()
|
||||||
indent = {
|
vim.treesitter.start()
|
||||||
enable = true,
|
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||||
},
|
end,
|
||||||
}
|
})
|
||||||
|
|||||||
+4
-5
@@ -2,12 +2,11 @@ vim.g.loaded_netrw = 1
|
|||||||
vim.g.loaded_netrwPlugin = 1
|
vim.g.loaded_netrwPlugin = 1
|
||||||
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
vim.g.gruvbox_material_background = "medium"
|
|
||||||
vim.g.coq_settings = { keymap = { recommended = false } }
|
vim.g.coq_settings = { keymap = { recommended = false } }
|
||||||
vim.g.gruvbox_material_foreground = "original"
|
|
||||||
vim.g.zig_fmt_parse_errors = 0
|
vim.g.zig_fmt_parse_errors = 0
|
||||||
vim.g.zig_fmt_autosave = 0
|
vim.g.zig_fmt_autosave = 0
|
||||||
|
|
||||||
vim.api.nvim_set_hl(0, 'GitGutterAdd', { fg = '#009900', ctermfg = 2 })
|
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, "GitGutterChange", { fg = "#bbbb00", ctermfg = 3 })
|
||||||
vim.api.nvim_set_hl(0, 'GitGutterDelete', { fg = '#ff2222', ctermfg = 1 })
|
vim.api.nvim_set_hl(0, "GitGutterDelete", { fg = "#ff2222", ctermfg = 1 })
|
||||||
|
vim.api.nvim_set_hl(1, "CmpItemKindCopilot", { fg = "#6CC644" })
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
-- 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 = "#171216",
|
||||||
|
bg_alt = "#201A1F",
|
||||||
|
bg_mid = pick("#2E282D", "#241E23"),
|
||||||
|
fg = "#EBDFE6",
|
||||||
|
fg_muted = "#D2C2CE",
|
||||||
|
fg_strong = pick("#15161A", "#F4F4F8"),
|
||||||
|
|
||||||
|
normal = "#D285D3",
|
||||||
|
insert = "#5D3F5C",
|
||||||
|
visual = "#8CAB44",
|
||||||
|
replace = "#93000A",
|
||||||
|
command = pick("#FFDDEA", "#B3A2D5"),
|
||||||
|
inactive = "#201A1F",
|
||||||
|
|
||||||
|
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 },
|
||||||
|
},
|
||||||
|
}
|
||||||
+27
-53
@@ -1,79 +1,53 @@
|
|||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
|
|
||||||
|
-- Base nvim mappings, you need this.
|
||||||
map("n", "<Tab>", "<Cmd>BufferLineCycleNext<CR>")
|
map("n", "<Tab>", "<Cmd>BufferLineCycleNext<CR>")
|
||||||
map("n", "<S-Tab>", "<Cmd>BufferLineCyclePrev<CR>")
|
map("n", "<S-Tab>", "<Cmd>BufferLineCyclePrev<CR>")
|
||||||
|
map({"n", "v"}, "<leader>ap", require("actions-preview").code_actions)
|
||||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
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-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" })
|
map("v", "<C-Down>", ":m '>+1<CR>gv=gv", { desc = "Move selected text down" })
|
||||||
|
map("n", "<C-a>", "ggVG", { noremap = true, silent = true })
|
||||||
-- Alt + Arrow Key to change buffer
|
map("n", "<C-j>", "<C-d>zz")
|
||||||
-- map("n", "<A-Left>", "<C-w>h", { desc = "Move to left split" })
|
map("n", "<C-k>", "<C-u>zz")
|
||||||
-- map("n", "<A-Down>", "<C-w>j", { desc = "Move to bottom split" })
|
map("n", "<A-->", ":bdelete<CR>")
|
||||||
-- map("n", "<A-Up>", "<C-w>k", { desc = "Move to top split" })
|
-- map("n", "<SA-->", ":BufferRestore<CR>")
|
||||||
-- map("n", "<A-Right>", "<C-w>l", { desc = "Move to right split" })
|
map('n', '<leader>e', function() Snacks.explorer() end)
|
||||||
|
map('n', '<leader>u', require('undotree').toggle, { noremap = true, silent = true })
|
||||||
map("n", "<A-Left>", "<cmd>lua require('tmux').move_left()<CR>", { desc = "Move to left split" })
|
map("n", "<leader>g", require("telescope.builtin").live_grep, {desc = "Telescope grep" })
|
||||||
map("n", "<A-Down>", "<cmd>lua require('tmux').move_bottom()<CR>", { desc = "Move to bottom split" })
|
map("n", "<leader>f", require("telescope.builtin").find_files, {desc = "Telescope find files" })
|
||||||
map("n", "<A-Up>", "<cmd>lua require('tmux').move_top()<CR>", { desc = "Move to top split" })
|
|
||||||
map("n", "<A-Right>", "<cmd>lua require('tmux').move_right()<CR>", { desc = "Move to right split" })
|
|
||||||
|
|
||||||
map("n", "<C-Left>", "<cmd>lua require('tmux').resize_left()<CR>", { desc = "Move to left split" })
|
|
||||||
map("n", "<C-Down>", "<cmd>lua require('tmux').resize_bottom()<CR>", { desc = "Move to bottom split" })
|
|
||||||
map("n", "<C-Up>", "<cmd>lua require('tmux').resize_top()<CR>", { desc = "Move to top split" })
|
|
||||||
map("n", "<C-Right>", "<cmd>lua require('tmux').resize_right()<CR>", { desc = "Move to right split" })
|
|
||||||
|
|
||||||
-- Copilot Chat buffer
|
-- Copilot Chat buffer
|
||||||
map("n", "<A-c>", vim.cmd.CopilotChatToggle)
|
map("n", "<A-c>", vim.cmd.CopilotChatToggle)
|
||||||
map("i", "<A-c>", vim.cmd.CopilotChatToggle)
|
map("i", "<A-c>", vim.cmd.CopilotChatToggle)
|
||||||
map("v", "<A-c>", vim.cmd.CopilotChatToggle)
|
map("v", "<A-c>", vim.cmd.CopilotChatToggle)
|
||||||
|
|
||||||
-- Explorer and Undotree
|
-- LSP Restart
|
||||||
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" })
|
|
||||||
|
|
||||||
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>")
|
map("n", "<leader>zig", "<cmd>LspRestart<cr>")
|
||||||
|
|
||||||
-- greatest remap ever
|
-- Why?
|
||||||
map("x", "<leader>p", [["_dP]])
|
map("x", "<leader>p", [["_dP]])
|
||||||
|
|
||||||
-- next greatest remap ever : asbjornHaland
|
|
||||||
map({"n", "v"}, "<leader>y", [["+y]])
|
map({"n", "v"}, "<leader>y", [["+y]])
|
||||||
map("n", "<leader>Y", [["+Y]])
|
|
||||||
|
|
||||||
map({"n", "v"}, "<leader>d", "\"_d")
|
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>mr", "<cmd>CellularAutomaton make_it_rain<CR>");
|
||||||
|
|
||||||
map("n", "<leader><leader>", function()
|
map("n", "<leader><leader>", function()
|
||||||
vim.cmd("so")
|
vim.cmd("so")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Greatest remap
|
||||||
|
map("n", "<leader>Y", [["+Y]])
|
||||||
|
map("n", "<A-q>", function() Snacks.terminal.toggle() end, { desc = "Toggle Terminal" })
|
||||||
|
map("n", "<leader>gb", function() Snacks.gitbrowse.open() end )
|
||||||
|
map("n", "K", require("pretty_hover").hover)
|
||||||
|
|
||||||
|
-- Might delete later
|
||||||
|
map("n", "<leader>fm", "<cmd>TailwindConcealToggle<CR>", { desc = "Toggle Tailwind Conceal" })
|
||||||
map("n", "<A-v>", "<cmd>ChatGPT<CR>")
|
map("n", "<A-v>", "<cmd>ChatGPT<CR>")
|
||||||
|
|
||||||
map("n", "<leader>fm", "<cmd>TailwindConcealToggle<CR>", { desc = "Toggle Tailwind Conceal" })
|
-- Notif history
|
||||||
|
map("n", "<leader>n", function()
|
||||||
|
Snacks.notifier.show_history()
|
||||||
|
end)
|
||||||
|
|
||||||
-- Terminal
|
-- Actions Previewer
|
||||||
map("n", "<C-q>", function() Snacks.terminal.toggle() end, { desc = "Toggle Terminal" })
|
map({ "n", "v" }, "<leader>ap", require("actions-preview").code_actions)
|
||||||
|
|
||||||
-- Gitbrowse
|
|
||||||
map("n", "<leader>gb", function() Snacks.gitbrowse.open() end )
|
|
||||||
|
|||||||
+4
-6
@@ -3,7 +3,7 @@ vim.opt.relativenumber = true
|
|||||||
vim.opt.tabstop = 4
|
vim.opt.tabstop = 4
|
||||||
vim.opt.softtabstop = 4
|
vim.opt.softtabstop = 4
|
||||||
vim.opt.shiftwidth = 4
|
vim.opt.shiftwidth = 4
|
||||||
vim.opt.expandtab = false
|
vim.opt.expandtab = true
|
||||||
vim.opt.smartindent = false
|
vim.opt.smartindent = false
|
||||||
|
|
||||||
vim.o.list = true
|
vim.o.list = true
|
||||||
@@ -13,14 +13,14 @@ vim.opt.wrap = true
|
|||||||
vim.opt.linebreak = true
|
vim.opt.linebreak = true
|
||||||
vim.opt.swapfile = false
|
vim.opt.swapfile = false
|
||||||
vim.opt.backup = false
|
vim.opt.backup = false
|
||||||
vim.opt.undodir = os.getenv("HOME") .. "/.nvim/undodir"
|
vim.opt.undodir = vim.fn.stdpath "data" .. "/undodir"
|
||||||
vim.opt.undofile = true
|
vim.opt.undofile = true
|
||||||
vim.opt.hlsearch = false
|
vim.opt.hlsearch = false
|
||||||
vim.opt.incsearch = true
|
vim.opt.incsearch = true
|
||||||
vim.opt.termguicolors = true
|
vim.opt.termguicolors = true
|
||||||
vim.opt.scrolloff = 8
|
vim.opt.scrolloff = 8
|
||||||
vim.opt.signcolumn = "yes:1"
|
vim.opt.signcolumn = "yes:1"
|
||||||
vim.opt.isfname:append("@-@")
|
vim.opt.isfname:append "@-@"
|
||||||
vim.opt.updatetime = 50
|
vim.opt.updatetime = 50
|
||||||
vim.opt.colorcolumn = "80"
|
vim.opt.colorcolumn = "80"
|
||||||
vim.opt.textwidth = 80
|
vim.opt.textwidth = 80
|
||||||
@@ -34,7 +34,6 @@ vim.o.ignorecase = true
|
|||||||
vim.o.smartcase = true
|
vim.o.smartcase = true
|
||||||
vim.o.mouse = "a"
|
vim.o.mouse = "a"
|
||||||
vim.o.number = true
|
vim.o.number = true
|
||||||
vim.o.termguicolors = true
|
|
||||||
vim.o.numberwidth = 3
|
vim.o.numberwidth = 3
|
||||||
vim.o.ruler = false
|
vim.o.ruler = false
|
||||||
vim.o.showmode = false
|
vim.o.showmode = false
|
||||||
@@ -52,7 +51,6 @@ local sep = is_windows and "\\" or "/"
|
|||||||
local delim = 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_set_hl(0, "Cursor", { reverse = true })
|
||||||
|
|
||||||
-- vim-tpipeline
|
|
||||||
vim.g.tpipeline_restore = 1
|
vim.g.tpipeline_restore = 1
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"nvim-mini/mini.nvim",
|
||||||
|
},
|
||||||
|
---@module 'render-markdown'
|
||||||
|
---@type render.md.UserConfig
|
||||||
|
opts = require "config.format.markdown",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'mrcjkb/rustaceanvim',
|
||||||
|
version = '^9',
|
||||||
|
-- lazy = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
config = function()
|
||||||
|
require("config.gitsigns")
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
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,
|
||||||
|
}
|
||||||
+245
-280
@@ -1,283 +1,248 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-mini/mini.nvim",
|
require "config.snacks",
|
||||||
version = false,
|
},
|
||||||
|
{
|
||||||
|
"nvim-mini/mini.nvim",
|
||||||
|
version = false,
|
||||||
|
|
||||||
modules = function()
|
modules = function()
|
||||||
require("config.mini-modules")
|
require "config.mini-modules"
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
config = function()
|
lazy = false,
|
||||||
require("config.treesitter")
|
build = ":TSUpdate",
|
||||||
end,
|
branch = "main",
|
||||||
},
|
config = function()
|
||||||
{
|
require "config.treesitter"
|
||||||
"sainnhe/edge",
|
end,
|
||||||
lazy = false,
|
},
|
||||||
priority = 1000,
|
{
|
||||||
config = function()
|
"sainnhe/edge",
|
||||||
vim.g.edge_enable_italic = 1
|
lazy = false,
|
||||||
vim.g.edge_style = "default"
|
priority = 1000,
|
||||||
vim.g.edge_menu_selection_background = "purple"
|
config = function()
|
||||||
end,
|
vim.g.edge_enable_italic = 1
|
||||||
},
|
vim.g.edge_style = "default"
|
||||||
{
|
vim.g.edge_menu_selection_background = "purple"
|
||||||
"rmagatti/auto-session",
|
end,
|
||||||
config = function()
|
},
|
||||||
require("config.autosession")
|
{
|
||||||
end,
|
"rmagatti/auto-session",
|
||||||
},
|
config = function()
|
||||||
{
|
require "config.autosession"
|
||||||
"olimorris/onedarkpro.nvim",
|
end,
|
||||||
priority = 1000,
|
},
|
||||||
config = function()
|
{
|
||||||
require("config.themelight")
|
"lambdalisue/vim-suda",
|
||||||
end,
|
init = function()
|
||||||
},
|
vim.g.suda_smart_edit = 1
|
||||||
{
|
end,
|
||||||
"nvim-telescope/telescope.nvim",
|
},
|
||||||
dependencies = {
|
{
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-tree/nvim-web-devicons",
|
||||||
},
|
},
|
||||||
config = function()
|
{
|
||||||
require("config.telescope")
|
"akinsho/bufferline.nvim",
|
||||||
end,
|
event = "VeryLazy",
|
||||||
},
|
config = function()
|
||||||
{
|
require "config.barbar"
|
||||||
"lambdalisue/vim-suda",
|
end,
|
||||||
init = function()
|
},
|
||||||
vim.g.suda_smart_edit = 1
|
{
|
||||||
end,
|
"mawkler/modicator.nvim",
|
||||||
},
|
config = function()
|
||||||
{
|
require "config.modicator"
|
||||||
"nvim-tree/nvim-web-devicons",
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"akinsho/bufferline.nvim",
|
"shinchu/lightline-gruvbox.vim",
|
||||||
event = "VeryLazy",
|
},
|
||||||
config = function()
|
{
|
||||||
require("config.barbar")
|
"jiaoshijie/undotree",
|
||||||
end,
|
config = function()
|
||||||
},
|
require "config.undotree"
|
||||||
{
|
end,
|
||||||
"nvim-lualine/lualine.nvim",
|
},
|
||||||
event = "VeryLazy",
|
{
|
||||||
config = function ()
|
"hiphish/rainbow-delimiters.nvim",
|
||||||
if vim.env.TMUX then
|
enabled = true,
|
||||||
vim.api.nvim_create_autocmd({ "FocusGained", "ColorScheme", "VimEnter" }, {
|
},
|
||||||
callback = function()
|
{
|
||||||
vim.defer_fn( function()
|
"windwp/nvim-autopairs",
|
||||||
vim.opt.laststatus = 0
|
event = "InsertEnter",
|
||||||
end, 100)
|
config = function()
|
||||||
end,
|
require "config.autopairs"
|
||||||
})
|
end,
|
||||||
vim.o.laststatus = 0
|
},
|
||||||
end
|
{
|
||||||
require("config.lualine")
|
"tpope/vim-fugitive",
|
||||||
end,
|
},
|
||||||
},
|
{
|
||||||
{
|
"rcarriga/nvim-notify",
|
||||||
"mawkler/modicator.nvim",
|
config = function()
|
||||||
config = function()
|
require "config.notify"
|
||||||
require("config.modicator")
|
end,
|
||||||
end
|
},
|
||||||
},
|
{
|
||||||
{
|
"zbirenbaum/copilot.lua",
|
||||||
"shinchu/lightline-gruvbox.vim",
|
cmd = "Copilot",
|
||||||
},
|
event = "InsertEnter",
|
||||||
{
|
config = function()
|
||||||
"jiaoshijie/undotree",
|
require "config.ai.copilot"
|
||||||
config = function()
|
end,
|
||||||
require("config.undotree")
|
},
|
||||||
end,
|
{
|
||||||
},
|
"CopilotC-Nvim/CopilotChat.nvim",
|
||||||
{
|
dependencies = {
|
||||||
"hiphish/rainbow-delimiters.nvim",
|
{ "zbirenbaum/copilot.lua" },
|
||||||
enabled = true,
|
{ "nvim-lua/plenary.nvim", branch = "master" },
|
||||||
},
|
},
|
||||||
{
|
build = "make tiktoken",
|
||||||
"windwp/nvim-autopairs",
|
config = function()
|
||||||
event = "InsertEnter",
|
require "config.ai.copilotchat"
|
||||||
config = function()
|
end,
|
||||||
require("config.autopairs")
|
},
|
||||||
end,
|
{
|
||||||
},
|
"mfussenegger/nvim-dap",
|
||||||
{
|
config = function()
|
||||||
"tpope/vim-fugitive",
|
require "config.dapconf"
|
||||||
},
|
end,
|
||||||
{
|
},
|
||||||
"rcarriga/nvim-notify",
|
{
|
||||||
config = function()
|
"mason-org/mason-lspconfig.nvim",
|
||||||
require "config.notify"
|
opts = {},
|
||||||
end,
|
dependencies = {
|
||||||
},
|
{ "mason-org/mason.nvim", opts = {} },
|
||||||
{
|
"neovim/nvim-lspconfig",
|
||||||
"zbirenbaum/copilot.lua",
|
},
|
||||||
lazy = true,
|
},
|
||||||
cmd = "Copilot",
|
{
|
||||||
event = "InsertEnter",
|
"folke/lazydev.nvim",
|
||||||
config = function()
|
ft = "lua",
|
||||||
require "config.copilot"
|
opts = function()
|
||||||
end,
|
require "config.lazydev"
|
||||||
},
|
end,
|
||||||
{
|
},
|
||||||
"CopilotC-Nvim/CopilotChat.nvim",
|
{
|
||||||
dependencies = {
|
"neovim/nvim-lspconfig",
|
||||||
{ "zbirenbaum/copilot.lua" },
|
enabled = true,
|
||||||
{ "nvim-lua/plenary.nvim", branch = "master" },
|
dependencies = {
|
||||||
},
|
-- "williamboman/mason.nvim",
|
||||||
build = "make tiktoken",
|
-- "williamboman/mason-lspconfig.nvim",
|
||||||
config = function()
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
require "config.copilotchat"
|
"hrsh7th/cmp-buffer",
|
||||||
end,
|
"hrsh7th/cmp-path",
|
||||||
},
|
"hrsh7th/cmp-cmdline",
|
||||||
{
|
"hrsh7th/nvim-cmp",
|
||||||
"mfussenegger/nvim-dap",
|
"L3MON4D3/LuaSnip",
|
||||||
config = function()
|
"saadparwaiz1/cmp_luasnip",
|
||||||
require("config.dapconf")
|
"j-hui/fidget.nvim",
|
||||||
end,
|
"b0o/schemastore.nvim",
|
||||||
},
|
},
|
||||||
{
|
config = function()
|
||||||
require("config.snacks")
|
require "config.format.lspconfig"
|
||||||
},
|
end,
|
||||||
{
|
},
|
||||||
"notken12/base46-colors",
|
{
|
||||||
},
|
"smolck/command-completion.nvim",
|
||||||
-- {
|
opts = {
|
||||||
-- "mason-org/mason-lspconfig.nvim",
|
border = nil,
|
||||||
-- opts = {},
|
highlight_selection = true,
|
||||||
-- dependencies = {
|
use_matchfuzzy = true,
|
||||||
-- { "mason-org/mason.nvim", opts = {} },
|
tab_completion = true,
|
||||||
-- "neovim/nvim-lspconfig",
|
},
|
||||||
-- },
|
},
|
||||||
-- },
|
{
|
||||||
{
|
"andweeb/presence.nvim",
|
||||||
"folke/lazydev.nvim",
|
},
|
||||||
ft = "lua",
|
{
|
||||||
opts = function()
|
"mfussenegger/nvim-jdtls",
|
||||||
require("config.lazydev")
|
},
|
||||||
end,
|
{
|
||||||
},
|
"ziglang/zig.vim",
|
||||||
{
|
},
|
||||||
"neovim/nvim-lspconfig",
|
{
|
||||||
enabled = true,
|
"mg979/vim-visual-multi",
|
||||||
dependencies = {
|
branch = "master",
|
||||||
"williamboman/mason.nvim",
|
},
|
||||||
"williamboman/mason-lspconfig.nvim",
|
{
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"elkowar/yuck.vim",
|
||||||
"hrsh7th/cmp-buffer",
|
},
|
||||||
"hrsh7th/cmp-path",
|
{
|
||||||
"hrsh7th/cmp-cmdline",
|
"f3fora/nvim-texlabconfig",
|
||||||
"hrsh7th/nvim-cmp",
|
config = function()
|
||||||
"L3MON4D3/LuaSnip",
|
require "config.format.texlab"
|
||||||
"saadparwaiz1/cmp_luasnip",
|
end,
|
||||||
"j-hui/fidget.nvim",
|
build = "go build",
|
||||||
},
|
},
|
||||||
config = function()
|
{
|
||||||
require("config.lspconfig")
|
"lancewilhelm/horizon-extended.nvim",
|
||||||
end,
|
},
|
||||||
},
|
{
|
||||||
{
|
"vimpostor/vim-tpipeline",
|
||||||
"smolck/command-completion.nvim",
|
},
|
||||||
opts = {
|
{
|
||||||
border = nil,
|
"yazeed1s/minimal.nvim",
|
||||||
highlight_selection = true,
|
config = function()
|
||||||
use_matchfuzzy = true,
|
vim.g.minimal_italic_comments = true
|
||||||
tab_completion = true,
|
end,
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
{
|
"Yazeed1s/minimal.nvim",
|
||||||
"andweeb/presence.nvim",
|
config = function()
|
||||||
},
|
vim.g.minimal_italic_comments = true
|
||||||
{
|
vim.g.minimal_italic_functions = true
|
||||||
"mfussenegger/nvim-jdtls",
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ThePrimeagen/harpoon",
|
"aserowy/tmux.nvim",
|
||||||
branch = "harpoon2",
|
config = function()
|
||||||
dependencies = {
|
require "config.terminal.tmux"
|
||||||
"nvim-lua/plenary.nvim",
|
end,
|
||||||
},
|
},
|
||||||
config = function()
|
{
|
||||||
require("config.harpoon")
|
"rachartier/tiny-inline-diagnostic.nvim",
|
||||||
end,
|
config = function()
|
||||||
},
|
require "config.format.TID"
|
||||||
{
|
end,
|
||||||
"catgoose/nvim-colorizer.lua",
|
},
|
||||||
config = function()
|
{
|
||||||
require("config.colorizer")
|
"ThePrimeagen/harpoon",
|
||||||
end,
|
branch = "harpoon2",
|
||||||
},
|
dependencies = {
|
||||||
{
|
"nvim-lua/plenary.nvim",
|
||||||
"ziglang/zig.vim",
|
},
|
||||||
},
|
config = function()
|
||||||
{
|
require "config.harpoon"
|
||||||
"mg979/vim-visual-multi",
|
end,
|
||||||
branch = "master",
|
},
|
||||||
},
|
{
|
||||||
{
|
"aznhe21/actions-preview.nvim",
|
||||||
"elkowar/yuck.vim",
|
config = function()
|
||||||
},
|
require "config.actions-preview"
|
||||||
{
|
end,
|
||||||
"f3fora/nvim-texlabconfig",
|
},
|
||||||
config = function()
|
{
|
||||||
require("config.texlab")
|
"sbdchd/neoformat",
|
||||||
end,
|
config = function()
|
||||||
build = "go build",
|
require "config.format.neoformat"
|
||||||
},
|
end,
|
||||||
{
|
},
|
||||||
"lancewilhelm/horizon-extended.nvim",
|
{
|
||||||
},
|
"Zacharias-Brohn/zterm-navigator.nvim",
|
||||||
{
|
config = function()
|
||||||
"vimpostor/vim-tpipeline",
|
require "config.terminal.zterm-navigator"
|
||||||
},
|
end,
|
||||||
{
|
},
|
||||||
"yazeed1s/minimal.nvim",
|
{
|
||||||
config = function()
|
"Fildo7525/pretty_hover",
|
||||||
vim.g.minimal_italic_comments = true
|
event = "LspAttach",
|
||||||
end,
|
opts = {},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ThePrimeagen/refactoring.nvim",
|
"artemave/workspace-diagnostics.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,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"aserowy/tmux.nvim",
|
|
||||||
config = function()
|
|
||||||
require("config.tmux")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("config.telescope")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"propet/colorscheme-persist.nvim",
|
||||||
|
enable = false,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
config = true,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>sp",
|
||||||
|
function()
|
||||||
|
require("colorscheme-persist").picker()
|
||||||
|
end,
|
||||||
|
mode = "n",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = function() -- ✅ Changed to function
|
||||||
|
return {
|
||||||
|
picker_opts = require("telescope.themes").get_dropdown({
|
||||||
|
enable_preview = true,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"notken12/base46-colors",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
config = function ()
|
||||||
|
if vim.env.TMUX then
|
||||||
|
vim.api.nvim_create_autocmd({ "FocusGained", "ColorScheme", "VimEnter" }, {
|
||||||
|
callback = function()
|
||||||
|
vim.defer_fn( function()
|
||||||
|
vim.opt.laststatus = 0
|
||||||
|
end, 100)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
vim.o.laststatus = 0
|
||||||
|
end
|
||||||
|
require("config.theme.lualine")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"catgoose/nvim-colorizer.lua",
|
||||||
|
config = function()
|
||||||
|
require("config.theme.colorizer")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"olimorris/onedarkpro.nvim",
|
||||||
|
enabled = false,
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
require("config.theme.onedarkpro-light")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
Write-Host "NVIM setup script for Windows" -ForegroundColor Green
|
||||||
|
Write-Host "Installing winget packages" -foregroundcolor cyan
|
||||||
|
|
||||||
|
$packages = @(
|
||||||
|
"Neovim.Neovim",
|
||||||
|
"MartinStorsjo.LLVM-MinGW.MSVCRT",
|
||||||
|
"zig.zig",
|
||||||
|
"GnuWin32.Make",
|
||||||
|
"Rustlang.Rust.MSVC",
|
||||||
|
"GoLang.Go",
|
||||||
|
"Kitware.Cmake",
|
||||||
|
"Ninja-build.Ninja",
|
||||||
|
"LuaLS.lua-language-server",
|
||||||
|
"GitHub.cli",
|
||||||
|
"GNU.Wget2",
|
||||||
|
"GnuWin32.UnZip",
|
||||||
|
"GnuWin32.Gzip",
|
||||||
|
"7zip.7zip",
|
||||||
|
"PSScriptAnalyzer"
|
||||||
|
)
|
||||||
|
|
||||||
|
for ($i = 0; $i -lt $packages.Count; $i++) {
|
||||||
|
$index = $i + 1
|
||||||
|
Write-Host ("{0,4}) {1}" -f $index, $packages[$i]) -foreground yellow
|
||||||
|
winget install $package
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !(Get-Command cargo -ErrorAction SilentlyContinue) ) {
|
||||||
|
Write-Host "Cargo is not installed. Please install Rust to proceed." -ForegroundColor Red
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
Write-Host "Installing cargo package treesitter-cli" -foregroundcolor cyan
|
||||||
|
cargo install --locked tree-sitter-cli
|
||||||
|
}
|
||||||
|
|
||||||
|
$list = @(
|
||||||
|
"Git.Git",
|
||||||
|
"ajeetdsouza.zoxide"
|
||||||
|
)
|
||||||
|
|
||||||
|
Write-Host "`nOptional packages to install:`n" -ForegroundColor Magenta
|
||||||
|
|
||||||
|
for ($i = 0; $i -lt $list.Count; $i++) {
|
||||||
|
$index = $i + 1
|
||||||
|
Write-Host "$index) $($list[$i])" -ForegroundColor Magenta
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "`nInstall all packages? [Y]es / [N]o / [E]dit list: " -ForegroundColor Green -NoNewLine
|
||||||
|
$answer = Read-Host
|
||||||
|
|
||||||
|
switch ($answer.ToLower()) {
|
||||||
|
|
||||||
|
"y" {
|
||||||
|
$selected = $list
|
||||||
|
}
|
||||||
|
|
||||||
|
"n" {
|
||||||
|
Write-Host "No packages will be installed." -ForegroundColor Red
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
"e" {
|
||||||
|
Write-Host "`nEnter numbers to EXCLUDE (space separated, e.g. 2 3): " -ForegroundColor Yellow -NoNewLine
|
||||||
|
$excludeInput = Read-Host
|
||||||
|
|
||||||
|
$excludeIndexes = $excludeInput -split "\s+" | ForEach-Object { [int]$_ - 1 }
|
||||||
|
|
||||||
|
$selected = @()
|
||||||
|
for ($i = 0; $i -lt $list.Count; $i++) {
|
||||||
|
if ($excludeIndexes -notcontains $i) {
|
||||||
|
$selected += $list[$i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
default {
|
||||||
|
Write-Host "Invalid option. Exiting." -ForegroundColor Red
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($selected.Count -eq 0) {
|
||||||
|
Write-Host "Nothing to install." -ForegroundColor Red
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "`nInstalling selected packages:`n" -ForegroundColor Cyan
|
||||||
|
|
||||||
|
foreach ($module in $selected) {
|
||||||
|
Write-Host "Installing $module..." -ForegroundColor Yellow
|
||||||
|
winget install --id $module
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user