ctrl k
AstroNvim v4 released (#5)
Merged
Micah Halter opened 1 year ago
No description
Target branch was fast-forwarded to source branch
  • .stylua.toml
    ■ ■ ■ ■ ■ ■
     1 +column_width = 120
     2 +line_endings = "Unix"
     3 +indent_type = "Spaces"
     4 +indent_width = 2
     5 +quote_style = "AutoPreferDouble"
     6 +call_parentheses = "None"
     7 +collapse_simple_statement = "Always"
     8 + 
  • README.md
    ■ ■ ■ ■ ■
    skipped 3 lines
    4 4   
    5 5  ## Installation
    6 6   
    7  -- Install AstroNvim
    8  - 
    9 7  ```sh
    10  -git clone https://github.com/AstroNvim/AstroNvim.git ~/.config/nvim
    11  -```
    12  - 
    13  -- Install these user settings
    14  - 
    15  -```sh
    16  -git clone https://code.mehalter.com/AstroNvim_user ~/.config/nvim/lua/user
     8 +git clone https://code.mehalter.com/AstroNvim_user ~/.config/nvim
    17 9  ```
    18 10   
    19 11  - Initialize AstroVim
    20 12   
    21 13  ```sh
    22  -nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
     14 +nvim --headless -c 'quitall'
    23 15  ```
    24 16   
  • after/queries/markdown/highlights.scm
    ■ ■ ■ ■ ■ ■
     1 +;; extends
     2 +((inline) @_inline (#match? @_inline "^\(import\|export\)")) @nospell
     3 + 
     4 +; offset and table chars courtesy of `megalithic`:
     5 +; https://github.com/megalithic/dotfiles/blob/39aa5fcefaa4d68cce66b6de425311e47c2d54fb/config/nvim/after/queries/markdown/highlights.scm#L45-L64
     6 + 
     7 +; list markers/bullet points
     8 +(
     9 + ([
     10 + (list_marker_star)
     11 + (list_marker_plus)
     12 + (list_marker_minus)
     13 + ]) @markdown_list_marker
     14 + (#offset! @markdown_list_marker 0 0 0 -1)
     15 + (#set! conceal "•")
     16 +)
     17 + 
     18 +; checkboxes
     19 +((task_list_marker_unchecked) @markdown_check_undone (#set! conceal "󰄱"))
     20 +((task_list_marker_checked) @markdown_check_done (#set! conceal "󰄵"))
     21 + 
     22 +; box drawing characters for tables
     23 +(pipe_table_header ("|") @punctuation.special @conceal (#set! conceal "│"))
     24 +(pipe_table_delimiter_row ("|") @punctuation.special @conceal (#set! conceal "│"))
     25 +(pipe_table_delimiter_cell ("-") @punctuation.special @conceal (#set! conceal "─"))
     26 +(pipe_table_row ("|") @punctuation.special @conceal (#set! conceal "│"))
     27 + 
     28 +; block quotes
     29 +((block_quote_marker) @markdown_quote_marker (#set! conceal "▍"))
     30 +((block_quote
     31 + (paragraph (inline
     32 + (block_continuation) @markdown_quote_marker (#set! conceal "▍")
     33 + ))
     34 +))
     35 + 
     36 +; (fenced_code_block
     37 +; (info_string) @devicon
     38 +; (#as_devicon! @devicon))
     39 + 
     40 +(
     41 + fenced_code_block (fenced_code_block_delimiter) @markdown_code_block_marker
     42 + (#set! conceal "")
     43 +)
     44 +(
     45 + [(info_string (language))] @markdown_code_block_lang_javascript
     46 + (#any-of? @markdown_code_block_lang_javascript "javascript" "js" "node")
     47 + (#set! conceal "")
     48 +)
     49 +(
     50 + [(info_string (language))] @markdown_code_block_lang_typescript
     51 + (#any-of? @markdown_code_block_lang_typescript "typescript" "ts")
     52 + (#set! conceal "")
     53 +)
     54 +(
     55 + [(info_string (language))] @markdown_code_block_lang_json
     56 + (#any-of? @markdown_code_block_lang_json "json" "jsonc")
     57 + (#set! conceal "")
     58 +)
     59 +(
     60 + [(info_string (language))] @markdown_code_block_lang_bash
     61 + (#any-of? @markdown_code_block_lang_bash "bash" "sh" "shell" "zsh")
     62 + (#set! conceal "")
     63 +)
     64 +(
     65 + [(info_string (language))] @markdown_code_block_lang_julia
     66 + (#eq? @markdown_code_block_lang_julia "julia")
     67 + (#set! conceal "")
     68 +)
     69 +(
     70 + [(info_string (language))] @markdown_code_block_lang_lua
     71 + (#eq? @markdown_code_block_lang_lua "lua")
     72 + (#set! conceal "")
     73 +)
     74 +(
     75 + [(info_string (language))] @markdown_code_block_lang_python
     76 + (#any-of? @markdown_code_block_lang_python "python" "python3")
     77 + (#set! conceal "")
     78 +)
     79 +(
     80 + [(info_string (language))] @markdown_code_block_lang_diff
     81 + (#eq? @markdown_code_block_lang_diff "diff")
     82 + (#set! conceal "")
     83 +)
     84 +(
     85 + [(info_string (language))] @markdown_code_block_lang_vim
     86 + (#eq? @markdown_code_block_lang_vim "vim")
     87 + (#set! conceal "")
     88 +)
     89 +(
     90 + [(info_string (language))] @markdown_code_block_lang_md
     91 + (#any-of? @markdown_code_block_lang_md "markdown" "md" "pandoc")
     92 + (#set! conceal "")
     93 +)
     94 +(
     95 + [(info_string (language))] @markdown_code_block_lang_yaml
     96 + (#any-of? @markdown_code_block_lang_yaml "yaml" "yml")
     97 + (#set! conceal "")
     98 +)
     99 +(
     100 + [(info_string (language))] @markdown_code_block_lang_toml
     101 + (#eq? @markdown_code_block_lang_toml "toml")
     102 + (#set! conceal "")
     103 +)
     104 +(
     105 + [(info_string (language))] @markdown_code_block_lang_java
     106 + (#eq? @markdown_code_block_lang_java "java")
     107 + (#set! conceal "")
     108 +)
     109 +(
     110 + [(info_string (language))] @markdown_code_block_lang_html
     111 + (#eq? @markdown_code_block_lang_html "xhtml")
     112 + (#set! conceal "")
     113 +)
     114 +(
     115 + [(info_string (language))] @markdown_code_block_lang_css
     116 + (#eq? @markdown_code_block_lang_css "css")
     117 + (#set! conceal "")
     118 +)
     119 +(
     120 + [(info_string (language))] @markdown_code_block_lang_sql
     121 + (#eq? @markdown_code_block_lang_sql "sql")
     122 + (#set! conceal "")
     123 +)
     124 + 
  • after/queries/markdown/injections.scm
    ■ ■ ■ ■ ■ ■
     1 +;; extends
     2 +((((inline) @_inline (#match? @_inline "^\(import\|export\)"))) @injection.content (#set! injection.language "tsx"))
     3 + 
  • autocmds.lua
    ■ ■ ■ ■ ■ ■
    1  -if vim.fn.executable "autocomp" == 1 then
    2  - vim.api.nvim_create_autocmd("VimLeave", {
    3  - desc = "Stop running auto compiler on leave",
    4  - group = vim.api.nvim_create_augroup("quit_autocomp", { clear = true }),
    5  - pattern = "*",
    6  - callback = function() vim.fn.jobstart { "autocomp", vim.fn.expand "%:p", "stop" } end,
    7  - })
    8  -end
    9  - 
    10  -vim.api.nvim_create_autocmd("FileType", {
    11  - desc = "Enable wrap and spell for text like documents",
    12  - group = vim.api.nvim_create_augroup("auto_spell", { clear = true }),
    13  - pattern = { "gitcommit", "markdown", "text", "plaintex" },
    14  - callback = function()
    15  - vim.opt_local.wrap = true
    16  - vim.opt_local.spell = true
    17  - end,
    18  -})
    19  - 
    20  -vim.api.nvim_create_autocmd("User", {
    21  - desc = "Auto hide tabline",
    22  - group = vim.api.nvim_create_augroup("autohide_tabline", { clear = true }),
    23  - pattern = "AstroBufsUpdated",
    24  - callback = function()
    25  - local new_showtabline = #vim.t.bufs > 1 and 2 or 1
    26  - if new_showtabline ~= vim.opt.showtabline:get() then vim.opt.showtabline = new_showtabline end
    27  - end,
    28  -})
    29  - 
    30  -if vim.env.KITTY_LISTEN_ON then
    31  - local cmd = require("astronvim.utils").cmd
    32  - 
    33  - for _, color in ipairs(vim.fn.split(cmd { "kitty", "@", "get-colors" } or "", "\n")) do
    34  - local orig_bg = color:match "^background%s+(#[0-9a-fA-F]+)$"
    35  - if orig_bg then
    36  - local function set_bg(new_color) cmd { "kitty", "@", "set-colors", ("background=%s"):format(new_color) } end
    37  - 
    38  - local augroup = vim.api.nvim_create_augroup("kitty_background", { clear = true })
    39  - vim.api.nvim_create_autocmd("User", {
    40  - desc = "set kitty background to colorscheme's background",
    41  - pattern = "AstroColorScheme",
    42  - group = augroup,
    43  - callback = function()
    44  - local bg_color = require("astronvim.utils").get_hlgroup("Normal").bg
    45  - if not bg_color or bg_color == "NONE" then
    46  - bg_color = orig_bg
    47  - elseif type(bg_color) == "number" then
    48  - bg_color = string.format("#%06x", bg_color)
    49  - end
    50  - 
    51  - set_bg(bg_color)
    52  - end,
    53  - })
    54  - 
    55  - vim.api.nvim_create_autocmd("VimLeave", {
    56  - desc = "set kitty background back to original background",
    57  - group = augroup, -- add autocmd to augroup
    58  - callback = function() set_bg(orig_bg) end,
    59  - })
    60  - break
    61  - end
    62  - end
    63  -end
    64  - 
  • colorscheme.lua
    ■ ■ ■ ■ ■ ■
    1  -return "catppuccin"
    2  - 
  • diagnostics.lua
    ■ ■ ■ ■ ■ ■
    1  -return { update_in_insert = false }
    2  - 
  • highlights/astrotheme.lua
    ■ ■ ■ ■ ■ ■
    1  -return function()
    2  - local get_hlgroup = require("astronvim.utils").get_hlgroup
    3  - -- get highlights from highlight groups
    4  - local normal = get_hlgroup "Normal"
    5  - local fg, bg = normal.fg, normal.bg
    6  - local bg_alt = get_hlgroup("Visual").bg
    7  - local green = get_hlgroup("String").fg
    8  - local red = get_hlgroup("Error").fg
    9  - -- return a table of highlights for telescope based on colors gotten from highlight groups
    10  - return {
    11  - TelescopeBorder = { fg = bg_alt, bg = bg },
    12  - TelescopeNormal = { bg = bg },
    13  - TelescopePreviewBorder = { fg = bg, bg = bg },
    14  - TelescopePreviewNormal = { bg = bg },
    15  - TelescopePreviewTitle = { fg = bg, bg = green },
    16  - TelescopePromptBorder = { fg = bg_alt, bg = bg_alt },
    17  - TelescopePromptNormal = { fg = fg, bg = bg_alt },
    18  - TelescopePromptPrefix = { fg = red, bg = bg_alt },
    19  - TelescopePromptTitle = { fg = bg, bg = red },
    20  - TelescopeResultsBorder = { fg = bg, bg = bg },
    21  - TelescopeResultsNormal = { bg = bg },
    22  - TelescopeResultsTitle = { fg = bg, bg = bg },
    23  - }
    24  -end
    25  - 
  • highlights/init.lua
    ■ ■ ■ ■ ■ ■
    1  -return function()
    2  - local get_hlgroup = require("astronvim.utils").get_hlgroup
    3  - local nontext = get_hlgroup "NonText"
    4  - return {
    5  - CursorLineFold = { link = "CursorLineNr" }, -- highlight fold indicator as well as line number
    6  - GitSignsCurrentLineBlame = { fg = nontext.fg, italic = true }, -- italicize git blame virtual text
    7  - HighlightURL = { underline = true }, -- always underline URLs
    8  - OctoEditable = { fg = "NONE", bg = "NONE" }, -- use treesitter for octo.nvim highlighting
    9  - }
    10  -end
    11  - 
  • init.lua
    ■ ■ ■ ■ ■ ■
     1 +-- bootstrap lazy.nvim, AstroNvim, and user plugins
     2 +local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
     3 +if not (vim.env.LAZY or vim.loop.fs_stat(lazypath)) then
     4 + -- stylua: ignore
     5 + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
     6 +end
     7 +vim.opt.rtp:prepend(lazypath)
     8 + 
     9 +if not pcall(require, "lazy") then
     10 + -- stylua: ignore
     11 + vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
     12 + vim.fn.getchar()
     13 + vim.cmd.quit()
     14 +end
     15 + 
     16 +require "lazy_setup"
     17 + 
  • lazy.lua
    ■ ■ ■ ■ ■ ■
    1  -return { diff = { cmd = "terminal_git" }, checker = { enabled = true } }
    2  - 
  • lsp/config/clangd.lua
    ■ ■ ■ ■ ■ ■
    1  -return { capabilities = { offsetEncoding = "utf-8" } }
    2  - 
  • lsp/config/julials.lua
    ■ ■ ■ ■ ■ ■
    1  -return { autostart = false }
    2  - 
  • lsp/config/lua_ls.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - settings = {
    3  - Lua = {
    4  - hint = { enable = true, arrayIndex = "Disable" },
    5  - },
    6  - },
    7  -}
    8  - 
  • lsp/config/taplo.lua
    ■ ■ ■ ■ ■ ■
    1  -return { evenBetterToml = { schema = { catalogs = { "https://www.schemastore.org/api/json/catalog.json" } } } }
    2  - 
  • lsp/config/texlab.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - settings = {
    3  - texlab = {
    4  - build = { onSave = true },
    5  - forwardSearch = { executable = "zathura", args = { "--synctex-forward", "%l:1:%f", "%p" } },
    6  - },
    7  - },
    8  -}
    9  - 
  • lsp/config/tsserver.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - settings = {
    3  - typescript = {
    4  - inlayHints = {
    5  - includeInlayEnumMemberValueHints = true,
    6  - includeInlayFunctionLikeReturnTypeHints = true,
    7  - includeInlayFunctionParameterTypeHints = true,
    8  - includeInlayParameterNameHints = "all",
    9  - includeInlayParameterNameHintsWhenArgumentMatchesName = false,
    10  - includeInlayPropertyDeclarationTypeHints = true,
    11  - includeInlayVariableTypeHints = true,
    12  - includeInlayVariableTypeHintsWhenTypeMatchesName = false,
    13  - },
    14  - },
    15  - javascript = {
    16  - inlayHints = {
    17  - includeInlayEnumMemberValueHints = true,
    18  - includeInlayFunctionLikeReturnTypeHints = true,
    19  - includeInlayFunctionParameterTypeHints = true,
    20  - includeInlayParameterNameHints = "all",
    21  - includeInlayParameterNameHintsWhenArgumentMatchesName = false,
    22  - includeInlayPropertyDeclarationTypeHints = true,
    23  - includeInlayVariableTypeHints = true,
    24  - includeInlayVariableTypeHintsWhenTypeMatchesName = false,
    25  - },
    26  - },
    27  - },
    28  -}
    29  - 
  • lsp/formatting.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - format_on_save = { ignore_filetypes = { "julia" } },
    3  -}
    4  - 
  • lua/base.lua
    ■ ■ ■ ■ ■ ■
     1 +---@LazySpec
     2 +return {
     3 + { "AstroNvim/AstroNvim", import = "astronvim.plugins" },
     4 + -- { "AstroNvim/astrocommunity" },
     5 + -- { import = "astrocommunity.pack.lua" },
     6 +}
     7 + 
  • lua/lazy_setup.lua
    ■ ■ ■ ■ ■ ■
     1 +require("lazy").setup({
     2 + { import = "base" },
     3 + { import = "plugins" },
     4 +} --[[@as LazySpec]], {
     5 + dev = {
     6 + ---@param plugin LazyPlugin
     7 + path = function(plugin)
     8 + local dir = plugin.url:match "^https://(.*)%.git$"
     9 + return dir and vim.env.GIT_PATH and vim.env.GIT_PATH .. "/" .. dir or "~/projects/" .. plugin.name
     10 + end,
     11 + patterns = {
     12 + -- "AstroNvim", -- local AstroNvim
     13 + },
     14 + },
     15 + defaults = { lazy = true },
     16 + diff = { cmd = "terminal_git" },
     17 + install = { colorscheme = { "catppuccin", "astrodark", "habamax" } },
     18 + lockfile = vim.fn.stdpath "data" .. "/lazy-lock.json",
     19 + performance = {
     20 + rtp = {
     21 + disabled_plugins = {
     22 + "gzip",
     23 + "netrwPlugin",
     24 + "tarPlugin",
     25 + "tohtml",
     26 + "zipPlugin",
     27 + },
     28 + },
     29 + },
     30 + ui = { backdrop = 100 },
     31 +} --[[@as LazyConfig]])
     32 + 
  • lua/plugins/astrocore.lua
    ■ ■ ■ ■ ■ ■
     1 +local function yaml_ft(path, bufnr)
     2 + local buf_text = table.concat(vim.api.nvim_buf_get_lines(bufnr, 0, -1, false), "\n")
     3 + if
     4 + -- check if file is in roles, tasks, or handlers folder
     5 + vim.regex("(tasks\\|roles\\|handlers)/"):match_str(path)
     6 + -- check for known ansible playbook text and if found, return yaml.ansible
     7 + or vim.regex("hosts:\\|tasks:"):match_str(buf_text)
     8 + then
     9 + return "yaml.ansible"
     10 + elseif vim.regex("AWSTemplateFormatVersion:"):match_str(buf_text) then
     11 + return "yaml.cfn"
     12 + else -- return yaml if nothing else
     13 + return "yaml"
     14 + end
     15 +end
     16 + 
     17 +---@type AstroCoreOpts
     18 +local opts = {
     19 + rooter = {
     20 + ignore = { servers = { "julials" } },
     21 + autochdir = true,
     22 + },
     23 + options = {
     24 + opt = {
     25 + conceallevel = 1, -- enable conceal
     26 + list = true, -- show whitespace characters
     27 + listchars = { tab = "│→", extends = "⟩", precedes = "⟨", trail = "·", nbsp = "␣" },
     28 + showbreak = "↪ ",
     29 + showtabline = (vim.t.bufs and #vim.t.bufs > 1) and 2 or 1,
     30 + spellfile = vim.fn.expand "~/.config/nvim/spell/en.utf-8.add",
     31 + splitkeep = "screen",
     32 + swapfile = false,
     33 + thesaurus = vim.fn.expand "~/.config/nvim/spell/mthesaur.txt",
     34 + wrap = true, -- soft wrap lines
     35 + },
     36 + },
     37 + autocmds = {
     38 + auto_spell = {
     39 + {
     40 + event = "FileType",
     41 + desc = "Enable wrap and spell for text like documents",
     42 + pattern = { "gitcommit", "markdown", "text", "plaintex" },
     43 + callback = function()
     44 + vim.opt_local.wrap = true
     45 + vim.opt_local.spell = true
     46 + end,
     47 + },
     48 + },
     49 + autohide_tabline = {
     50 + {
     51 + event = "User",
     52 + desc = "Auto hide tabline",
     53 + pattern = "AstroBufsUpdated",
     54 + callback = function()
     55 + local new_showtabline = #vim.t.bufs > 1 and 2 or 1
     56 + if new_showtabline ~= vim.opt.showtabline:get() then vim.opt.showtabline = new_showtabline end
     57 + end,
     58 + },
     59 + },
     60 + },
     61 + diagnostics = { update_in_insert = false },
     62 + filetypes = {
     63 + extension = {
     64 + mdx = "markdown.mdx",
     65 + qmd = "markdown",
     66 + yml = yaml_ft,
     67 + yaml = yaml_ft,
     68 + },
     69 + pattern = {
     70 + ["/tmp/neomutt.*"] = "markdown",
     71 + },
     72 + },
     73 + mappings = {
     74 + n = {
     75 + -- disable default bindings
     76 + ["<C-q>"] = false,
     77 + ["<C-s>"] = false,
     78 + ["q:"] = ":",
     79 + -- better buffer navigation
     80 + ["]b"] = false,
     81 + ["[b"] = false,
     82 + ["L"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
     83 + ["H"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
     84 + -- better search
     85 + -- better increment/decrement
     86 + ["-"] = { "<C-x>", desc = "Descrement number" },
     87 + ["+"] = { "<C-a>", desc = "Increment number" },
     88 + ["<Leader>n"] = { "<Cmd>enew<CR>", desc = "New File" },
     89 + ["<Leader>N"] = { "<Cmd>tabnew<CR>", desc = "New Tab" },
     90 + ["<Leader><CR>"] = { '<Esc>/<++><CR>"_c4l', desc = "Next Template" },
     91 + ["<Leader>."] = { "<Cmd>cd %:p:h<CR>", desc = "Set CWD" },
     92 + },
     93 + i = {
     94 + ["<S-Tab>"] = { "<C-V><Tab>", desc = "Tab character" },
     95 + },
     96 + -- terminal mappings
     97 + t = {
     98 + ["<C-BS>"] = { "<C-\\><C-n>", desc = "Terminal normal mode" },
     99 + ["<Esc><Esc>"] = { "<C-\\><C-n>:q<CR>", desc = "Terminal quit" },
     100 + },
     101 + x = {
     102 + -- better increment/decrement
     103 + ["+"] = { "g<C-a>", desc = "Increment number" },
     104 + ["-"] = { "g<C-x>", desc = "Descrement number" },
     105 + -- line text-objects
     106 + ["iL"] = { ":<C-u>normal! $v^<CR>", desc = "Inside line text object" },
     107 + ["aL"] = { ":<C-u>normal! $v0<CR>", desc = "Around line text object" },
     108 + },
     109 + o = {
     110 + -- line text-objects
     111 + ["iL"] = { ":<C-u>normal! $v^<CR>", desc = "Inside line text object" },
     112 + ["aL"] = { ":<C-u>normal! $v0<CR>", desc = "Around line text object" },
     113 + },
     114 + ia = vim.fn.has "nvim-0.10" == 1 and {
     115 + mktmpl = { function() return "<++>" end, desc = "Insert <++>", expr = true },
     116 + ldate = { function() return os.date "%Y/%m/%d %H:%M:%S -" end, desc = "Y/m/d H:M:S -", expr = true },
     117 + ndate = { function() return os.date "%Y-%m-%d" end, desc = "Y-m-d", expr = true },
     118 + xdate = { function() return os.date "%m/%d/%y" end, desc = "m/d/y", expr = true },
     119 + fdate = { function() return os.date "%B %d, %Y" end, desc = "B d, Y", expr = true },
     120 + Xdate = { function() return os.date "%H:%M" end, desc = "H:M", expr = true },
     121 + Fdate = { function() return os.date "%H:%M:%S" end, desc = "H:M:S", expr = true },
     122 + } or nil,
     123 + },
     124 +}
     125 + 
     126 +local function better_search(key)
     127 + return function()
     128 + local searched, error =
     129 + pcall(vim.cmd.normal, { args = { (vim.v.count > 0 and vim.v.count or "") .. key }, bang = true })
     130 + if not searched and type(error) == "string" then require("astrocore").notify(error, vim.log.levels.ERROR) end
     131 + end
     132 +end
     133 +opts.mappings.n.n = { better_search "n", desc = "Next search" }
     134 +opts.mappings.n.N = { better_search "N", desc = "Previous search" }
     135 + 
     136 +-- add line text object
     137 +for lhs, rhs in pairs {
     138 + il = { ":<C-u>normal! $v^<CR>", desc = "inside line" },
     139 + al = { ":<C-u>normal! V<CR>", desc = "around line" },
     140 +} do
     141 + opts.mappings.o[lhs] = rhs
     142 + opts.mappings.x[lhs] = rhs
     143 +end
     144 + 
     145 +-- add missing in between and arround two character pairs
     146 +for _, char in ipairs { "_", "-", ".", ":", ",", ";", "|", "/", "\\", "*", "+", "%", "`", "?" } do
     147 + for lhs, rhs in pairs {
     148 + ["i" .. char] = { (":<C-u>silent! normal! f%sF%slvt%s<CR>"):format(char, char, char), desc = "inside " .. char },
     149 + ["a" .. char] = { (":<C-u>silent! normal! f%sF%svf%s<CR>"):format(char, char, char), desc = "around " .. char },
     150 + } do
     151 + opts.mappings.o[lhs] = rhs
     152 + opts.mappings.x[lhs] = rhs
     153 + end
     154 +end
     155 + 
     156 +---@type LazySpec
     157 +return { "AstroNvim/astrocore", opts = opts }
     158 + 
  • lua/plugins/astrolsp.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "AstroNvim/astrolsp",
     4 + ---@type AstroLSPOpts
     5 + opts = {
     6 + ---@diagnostic disable: missing-fields
     7 + config = {
     8 + clangd = { capabilities = { offsetEncoding = "utf-8" } },
     9 + gopls = {
     10 + settings = {
     11 + gopls = {
     12 + codelenses = {
     13 + generate = true, -- show the `go generate` lens.
     14 + gc_details = true, -- Show a code lens toggling the display of gc's choices.
     15 + test = true,
     16 + tidy = true,
     17 + vendor = true,
     18 + regenerate_cgo = true,
     19 + upgrade_dependency = true,
     20 + },
     21 + hints = {
     22 + assignVariableTypes = true,
     23 + compositeLiteralFields = true,
     24 + compositeLiteralTypes = true,
     25 + constantValues = true,
     26 + functionTypeParameters = true,
     27 + parameterNames = true,
     28 + rangeVariableTypes = true,
     29 + },
     30 + semanticTokens = true,
     31 + },
     32 + },
     33 + },
     34 + julials = { autostart = false },
     35 + lua_ls = { settings = { Lua = { hint = { enable = true, arrayIndex = "Disable" } } } },
     36 + basedpyright = {
     37 + before_init = function(_, c)
     38 + if not c.settings then c.settings = {} end
     39 + if not c.settings.python then c.settings.python = {} end
     40 + c.settings.python.pythonPath = vim.fn.exepath "python"
     41 + end,
     42 + settings = {
     43 + basedpyright = {
     44 + analysis = {
     45 + typeCheckingMode = "basic",
     46 + autoImportCompletions = true,
     47 + stubPath = vim.env.HOME .. "/typings",
     48 + diagnosticSeverityOverrides = {
     49 + reportUnusedImport = "information",
     50 + reportUnusedFunction = "information",
     51 + reportUnusedVariable = "information",
     52 + reportGeneralTypeIssues = "none",
     53 + reportOptionalMemberAccess = "none",
     54 + reportOptionalSubscript = "none",
     55 + reportPrivateImportUsage = "none",
     56 + },
     57 + },
     58 + },
     59 + },
     60 + },
     61 + taplo = { evenBetterToml = { schema = { catalogs = { "https://www.schemastore.org/api/json/catalog.json" } } } },
     62 + texlab = {
     63 + on_attach = function(_, bufnr)
     64 + require("astrocore").set_mappings({
     65 + n = {
     66 + ["<Leader>lB"] = { "<Cmd>TexlabBuild<CR>", desc = "LaTeX Build" },
     67 + ["<Leader>lF"] = { "<Cmd>TexlabForward<CR>", desc = "LaTeX Forward Search" },
     68 + },
     69 + }, { buffer = bufnr })
     70 + end,
     71 + settings = {
     72 + texlab = {
     73 + build = { onSave = true },
     74 + forwardSearch = { executable = "zathura", args = { "--synctex-forward", "%l:1:%f", "%p" } },
     75 + },
     76 + },
     77 + },
     78 + vtsls = {
     79 + settings = {
     80 + typescript = {
     81 + inlayHints = {
     82 + parameterNames = { enabled = "all", suppressWhenArgumentMatchesName = false },
     83 + parameterTypes = { enabled = true },
     84 + variableTypes = { enabled = true, suppressWhenTypeMatchesName = false },
     85 + propertyDeclarationTypes = { enabled = true },
     86 + functionLikeReturnTypes = { enabled = true },
     87 + enumMemberValues = { enabled = true },
     88 + },
     89 + updateImportsOnFileMove = { enabled = "always" },
     90 + },
     91 + javascript = {
     92 + inlayHints = {
     93 + parameterNames = { enabled = "all", suppressWhenArgumentMatchesName = false },
     94 + parameterTypes = { enabled = true },
     95 + variableTypes = { enabled = true, suppressWhenTypeMatchesName = false },
     96 + propertyDeclarationTypes = { enabled = true },
     97 + functionLikeReturnTypes = { enabled = true },
     98 + enumMemberValues = { enabled = true },
     99 + },
     100 + updateImportsOnFileMove = { enabled = "always" },
     101 + },
     102 + },
     103 + },
     104 + },
     105 + mappings = {
     106 + i = {
     107 + ["<C-l>"] = {
     108 + function() vim.lsp.buf.signature_help() end,
     109 + desc = "Signature help",
     110 + cond = "textDocument/signatureHelp",
     111 + },
     112 + },
     113 + },
     114 + },
     115 +}
     116 + 
  • lua/plugins/astroui.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "AstroNvim/astroui",
     4 + ---@type AstroUIOpts
     5 + opts = {
     6 + colorscheme = "catppuccin",
     7 + highlights = {
     8 + init = function(colors_name)
     9 + local get_hlgroup = require("astroui").get_hlgroup
     10 + 
     11 + -- Global Highlights --
     12 + local highlights = {
     13 + CursorLineFold = { link = "CursorLineNr" }, -- highlight fold indicator as well as line number
     14 + GitSignsCurrentLineBlame = { fg = get_hlgroup("NonText").fg, italic = true }, -- italicize git blame virtual text
     15 + HighlightURL = { underline = true }, -- always underline URLs
     16 + OctoEditable = { fg = "NONE", bg = "NONE" }, -- use treesitter for octo.nvim highlighting
     17 + ZenBg = { link = "Normal" }, -- Set zen-mode background to Normal mode
     18 + }
     19 + 
     20 + -- NvChad like Telescope Theme --
     21 + if not colors_name:match "^catppuccin.*" then
     22 + local normal = get_hlgroup "Normal"
     23 + local fg, bg = normal.fg, normal.bg
     24 + local bg_alt = get_hlgroup("Visual").bg
     25 + local green = get_hlgroup("String").fg
     26 + local red = get_hlgroup("Error").fg
     27 + highlights.TelescopeBorder = { fg = bg_alt, bg = bg }
     28 + highlights.TelescopeNormal = { bg = bg }
     29 + highlights.TelescopePreviewBorder = { fg = bg, bg = bg }
     30 + highlights.TelescopePreviewNormal = { bg = bg }
     31 + highlights.TelescopePreviewTitle = { fg = bg, bg = green }
     32 + highlights.TelescopePromptBorder = { fg = bg_alt, bg = bg_alt }
     33 + highlights.TelescopePromptNormal = { fg = fg, bg = bg_alt }
     34 + highlights.TelescopePromptPrefix = { fg = red, bg = bg_alt }
     35 + highlights.TelescopePromptTitle = { fg = bg, bg = red }
     36 + highlights.TelescopeResultsBorder = { fg = bg, bg = bg }
     37 + highlights.TelescopeResultsNormal = { bg = bg }
     38 + highlights.TelescopeResultsTitle = { fg = bg, bg = bg }
     39 + end
     40 + 
     41 + return highlights
     42 + end,
     43 + },
     44 + },
     45 +}
     46 + 
  • lua/plugins/catppuccin.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "catppuccin/nvim",
     4 + name = "catppuccin",
     5 + ---@type CatppuccinOptions
     6 + opts = {
     7 + dim_inactive = { enabled = true, percentage = 0.25 },
     8 + default_integrations = false,
     9 + integrations = {
     10 + aerial = true,
     11 + cmp = true,
     12 + dap = true,
     13 + dap_ui = true,
     14 + gitsigns = true,
     15 + illuminate = { enabled = true, lsp = true },
     16 + indent_blankline = true,
     17 + markdown = true,
     18 + mason = true,
     19 + native_lsp = {
     20 + enabled = true,
     21 + virtual_text = {
     22 + errors = { "italic" },
     23 + hints = { "italic" },
     24 + warnings = { "italic" },
     25 + information = { "italic" },
     26 + },
     27 + underlines = {
     28 + errors = { "underline" },
     29 + hints = { "underline" },
     30 + warnings = { "underline" },
     31 + information = { "underline" },
     32 + },
     33 + inlay_hints = { background = false },
     34 + },
     35 + neotree = true,
     36 + notify = true,
     37 + semantic_tokens = true,
     38 + symbols_outline = true,
     39 + telescope = { enabled = true, style = "nvchad" },
     40 + treesitter = true,
     41 + ufo = true,
     42 + which_key = true,
     43 + window_picker = true,
     44 + },
     45 + custom_highlights = {
     46 + -- disable italics for treesitter highlights
     47 + TabLineFill = { link = "StatusLine" },
     48 + LspInlayHint = { style = { "italic" } },
     49 + UfoFoldedEllipsis = { link = "UfoFoldedFg" },
     50 + ["@parameter"] = { style = {} },
     51 + ["@type.builtin"] = { style = {} },
     52 + ["@namespace"] = { style = {} },
     53 + ["@text.uri"] = { style = { "underline" } },
     54 + ["@tag.attribute"] = { style = {} },
     55 + ["@tag.attribute.tsx"] = { style = {} },
     56 + },
     57 + },
     58 +}
     59 + 
  • lua/plugins/clangd_extensions.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "p00f/clangd_extensions.nvim",
     4 + dependencies = {
     5 + "AstroNvim/astrocore",
     6 + opts = {
     7 + autocmds = {
     8 + clangd_extensions = {
     9 + {
     10 + event = "LspAttach",
     11 + desc = "Load clangd_extensions with clangd",
     12 + callback = function(args)
     13 + if assert(vim.lsp.get_client_by_id(args.data.client_id)).name == "clangd" then
     14 + require "clangd_extensions"
     15 + vim.api.nvim_del_augroup_by_name "clangd_extensions"
     16 + end
     17 + end,
     18 + },
     19 + },
     20 + },
     21 + },
     22 + },
     23 +}
     24 + 
  • lua/plugins/cmp.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "hrsh7th/nvim-cmp",
     4 + dependencies = {
     5 + "hrsh7th/cmp-calc",
     6 + "hrsh7th/cmp-emoji",
     7 + "jc-doyle/cmp-pandoc-references",
     8 + "kdheepak/cmp-latex-symbols",
     9 + },
     10 + opts = function(_, opts)
     11 + opts.sources = {
     12 + { name = "nvim_lsp", priority = 1000 },
     13 + { name = "luasnip", priority = 750 },
     14 + { name = "pandoc_references", priority = 725 },
     15 + { name = "latex_symbols", priority = 700 },
     16 + { name = "emoji", priority = 700 },
     17 + { name = "calc", priority = 650 },
     18 + { name = "path", priority = 500 },
     19 + { name = "buffer", priority = 250, group_index = 2 },
     20 + }
     21 + 
     22 + if not opts.sorting then opts.sorting = {} end
     23 + local compare = require "cmp.config.compare"
     24 + opts.sorting.comparators = {
     25 + compare.offset,
     26 + compare.exact,
     27 + compare.score,
     28 + compare.recently_used,
     29 + function(entry1, entry2)
     30 + local _, entry1_under = entry1.completion_item.label:find "^_+"
     31 + local _, entry2_under = entry2.completion_item.label:find "^_+"
     32 + entry1_under = entry1_under or 0
     33 + entry2_under = entry2_under or 0
     34 + if entry1_under > entry2_under then
     35 + return false
     36 + elseif entry1_under < entry2_under then
     37 + return true
     38 + end
     39 + end,
     40 + compare.kind,
     41 + compare.sort_text,
     42 + compare.length,
     43 + compare.order,
     44 + }
     45 + end,
     46 +}
     47 + 
  • lua/plugins/conform.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + { "AstroNvim/astrolsp", opts = { formatting = { disabled = true } } },
     4 + {
     5 + "stevearc/conform.nvim",
     6 + event = "User AstroFile",
     7 + cmd = "ConformInfo",
     8 + dependencies = {
     9 + "williamboman/mason.nvim",
     10 + {
     11 + "AstroNvim/astrocore",
     12 + opts = {
     13 + options = { opt = { formatexpr = "v:lua.require'conform'.formatexpr()" } },
     14 + commands = {
     15 + Format = {
     16 + function(args)
     17 + local range = nil
     18 + if args.count ~= -1 then
     19 + local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
     20 + range = {
     21 + start = { args.line1, 0 },
     22 + ["end"] = { args.line2, end_line:len() },
     23 + }
     24 + end
     25 + require("conform").format { async = true, lsp_fallback = true, range = range }
     26 + end,
     27 + desc = "Format buffer",
     28 + range = true,
     29 + },
     30 + },
     31 + mappings = {
     32 + n = {
     33 + ["<Leader>lf"] = { function() vim.cmd.Format() end, desc = "Format buffer" },
     34 + ["<Leader>lI"] = { function() vim.cmd.ConformInfo() end, desc = "Conform information" },
     35 + ["<Leader>uf"] = {
     36 + function()
     37 + if vim.b.autoformat == nil then
     38 + if vim.g.autoformat == nil then vim.g.autoformat = true end
     39 + vim.b.autoformat = vim.g.autoformat
     40 + end
     41 + vim.b.autoformat = not vim.b.autoformat
     42 + require("astrocore").notify(
     43 + string.format("Buffer autoformatting %s", vim.b.autoformat and "on" or "off")
     44 + )
     45 + end,
     46 + desc = "Toggle autoformatting (buffer)",
     47 + },
     48 + ["<Leader>uF"] = {
     49 + function()
     50 + if vim.g.autoformat == nil then vim.g.autoformat = true end
     51 + vim.g.autoformat = not vim.g.autoformat
     52 + vim.b.autoformat = nil
     53 + require("astrocore").notify(
     54 + string.format("Global autoformatting %s", vim.g.autoformat and "on" or "off")
     55 + )
     56 + end,
     57 + desc = "Toggle autoformatting (global)",
     58 + },
     59 + },
     60 + },
     61 + },
     62 + },
     63 + },
     64 + opts = function(_, opts)
     65 + opts.format_on_save = function(bufnr)
     66 + if vim.g.autoformat == nil then vim.g.autoformat = true end
     67 + local autoformat = vim.b[bufnr].autoformat
     68 + if autoformat == nil then autoformat = vim.g.autoformat end
     69 + if autoformat then return { timeout_ms = 2000, lsp_fallback = true } end
     70 + end
     71 + 
     72 + opts.formatters_by_ft = {
     73 + ["*"] = { "injected" },
     74 + lua = { "stylua" },
     75 + puppet = { "puppet-lint" },
     76 + sh = { "shfmt" },
     77 + ["_"] = function(bufnr)
     78 + return require("astrocore.buffer").is_valid(bufnr)
     79 + and { "trim_whitespace", "trim_newlines", "squeeze_blanks" }
     80 + or {}
     81 + end,
     82 + }
     83 + 
     84 + -- prettier filetypes
     85 + vim.tbl_map(function(ft) opts.formatters_by_ft[ft] = { "prettier" } end, {
     86 + "javascript",
     87 + "javascriptreact",
     88 + "typescript",
     89 + "typescriptreact",
     90 + "vue",
     91 + "css",
     92 + "scss",
     93 + "less",
     94 + "html",
     95 + "json",
     96 + "jsonc",
     97 + "yaml",
     98 + "yaml.ansible",
     99 + "yaml.cfn",
     100 + "markdown",
     101 + "markdown.mdx",
     102 + "graphql",
     103 + "handlebars",
     104 + })
     105 + 
     106 + opts.formatters = {
     107 + prettier = {
     108 + options = {
     109 + ft_parsers = {
     110 + markdown = "markdown",
     111 + },
     112 + },
     113 + },
     114 + }
     115 + end,
     116 + },
     117 +}
     118 + 
  • lua/plugins/diffview.lua
    ■ ■ ■ ■ ■ ■
     1 +local prefix = "<Leader>D"
     2 +---@type LazySpec
     3 +return {
     4 + {
     5 + "sindrets/diffview.nvim",
     6 + cmd = { "DiffviewOpen", "DiffviewFileHistory" },
     7 + dependencies = {
     8 + "AstroNvim/astrocore",
     9 + opts = {
     10 + mappings = {
     11 + n = {
     12 + [prefix] = { name = " Diff View" },
     13 + [prefix .. "<CR>"] = { "<Cmd>DiffviewOpen<CR>", desc = "Open DiffView" },
     14 + [prefix .. "h"] = { "<Cmd>DiffviewFileHistory %<CR>", desc = "Open DiffView File History" },
     15 + [prefix .. "H"] = { "<Cmd>DiffviewFileHistory<CR>", desc = "Open DiffView Branch History" },
     16 + },
     17 + },
     18 + },
     19 + },
     20 + opts = function()
     21 + local actions = require "diffview.actions"
     22 + local build_keymaps = function(maps)
     23 + local out = {}
     24 + local i = 1
     25 + for lhs, def in
     26 + pairs(require("astrocore").extend_tbl(maps, {
     27 + [prefix .. "q"] = { "<Cmd>DiffviewClose<CR>", desc = "Quit Diffview" }, -- Toggle the file panel.
     28 + ["]D"] = { actions.select_next_entry, desc = "Next Difference" }, -- Open the diff for the next file
     29 + ["[D"] = { actions.select_prev_entry, desc = "Previous Difference" }, -- Open the diff for the previous file
     30 + ["[C"] = { actions.prev_conflict, desc = "Next Conflict" }, -- In the merge_tool: jump to the previous conflict
     31 + ["]C"] = { actions.next_conflict, desc = "Previous Conflict" }, -- In the merge_tool: jump to the next conflict
     32 + ["Cl"] = { actions.cycle_layout, desc = "Cycle Diff Layout" }, -- Cycle through available layouts.
     33 + ["Ct"] = { actions.listing_style, desc = "Cycle Tree Style" }, -- Cycle through available layouts.
     34 + ["<Leader>e"] = { actions.toggle_files, desc = "Toggle Explorer" }, -- Toggle the file panel.
     35 + ["<Leader>o"] = { actions.focus_files, desc = "Focus Explorer" }, -- Bring focus to the file panel
     36 + }))
     37 + do
     38 + local opts
     39 + local rhs = def
     40 + local mode = { "n" }
     41 + if type(def) == "table" then
     42 + if def.mode then mode = def.mode end
     43 + rhs = def[1]
     44 + def[1] = nil
     45 + def.mode = nil
     46 + opts = def
     47 + end
     48 + out[i] = { mode, lhs, rhs, opts }
     49 + i = i + 1
     50 + end
     51 + return out
     52 + end
     53 + 
     54 + return {
     55 + enhanced_diff_hl = true,
     56 + view = {
     57 + default = { winbar_info = true },
     58 + file_history = { winbar_info = true },
     59 + merge_tool = { layout = "diff3_mixed" },
     60 + },
     61 + hooks = { diff_buf_read = function(bufnr) vim.b[bufnr].view_activated = false end },
     62 + keymaps = {
     63 + disable_defaults = true,
     64 + view = build_keymaps {
     65 + [prefix .. "o"] = { actions.conflict_choose "ours", desc = "Take Ours" }, -- Choose the OURS version of a conflict
     66 + [prefix .. "t"] = { actions.conflict_choose "theirs", desc = "Take Theirs" }, -- Choose the THEIRS version of a conflict
     67 + [prefix .. "b"] = { actions.conflict_choose "base", desc = "Take Base" }, -- Choose the BASE version of a conflict
     68 + [prefix .. "a"] = { actions.conflict_choose "all", desc = "Take All" }, -- Choose all the versions of a conflict
     69 + [prefix .. "0"] = { actions.conflict_choose "none", desc = "Take None" }, -- Delete the conflict region
     70 + },
     71 + diff3 = build_keymaps {
     72 + [prefix .. "O"] = { actions.diffget "ours", mode = { "n", "x" }, desc = "Get Our Diff" }, -- Obtain the diff hunk from the OURS version of the file
     73 + [prefix .. "T"] = { actions.diffget "theirs", mode = { "n", "x" }, desc = "Get Their Diff" }, -- Obtain the diff hunk from the THEIRS version of the file
     74 + },
     75 + diff4 = build_keymaps {
     76 + [prefix .. "B"] = { actions.diffget "base", mode = { "n", "x" }, desc = "Get Base Diff" }, -- Obtain the diff hunk from the OURS version of the file
     77 + [prefix .. "O"] = { actions.diffget "ours", mode = { "n", "x" }, desc = "Get Our Diff" }, -- Obtain the diff hunk from the OURS version of the file
     78 + [prefix .. "T"] = { actions.diffget "theirs", mode = { "n", "x" }, desc = "Get Their Diff" }, -- Obtain the diff hunk from the THEIRS version of the file
     79 + },
     80 + file_panel = build_keymaps {
     81 + j = actions.next_entry, -- Bring the cursor to the next file entry
     82 + k = actions.prev_entry, -- Bring the cursor to the previous file entry.
     83 + o = actions.select_entry,
     84 + S = actions.stage_all, -- Stage all entries.
     85 + U = actions.unstage_all, -- Unstage all entries.
     86 + X = actions.restore_entry, -- Restore entry to the state on the left side.
     87 + L = actions.open_commit_log, -- Open the commit log panel.
     88 + Cf = { actions.toggle_flatten_dirs, desc = "Flatten" }, -- Flatten empty subdirectories in tree listing style.
     89 + R = actions.refresh_files, -- Update stats and entries in the file list.
     90 + ["-"] = actions.toggle_stage_entry, -- Stage / unstage the selected entry.
     91 + ["<Down>"] = actions.next_entry,
     92 + ["<Up>"] = actions.prev_entry,
     93 + ["<CR>"] = actions.select_entry, -- Open the diff for the selected entry.
     94 + ["<2-LeftMouse>"] = actions.select_entry,
     95 + ["<C-b>"] = actions.scroll_view(-0.25), -- Scroll the view up
     96 + ["<C-f>"] = actions.scroll_view(0.25), -- Scroll the view down
     97 + ["<Tab>"] = actions.select_next_entry,
     98 + ["<S-tab>"] = actions.select_prev_entry,
     99 + },
     100 + file_history_panel = build_keymaps {
     101 + j = actions.next_entry,
     102 + k = actions.prev_entry,
     103 + o = actions.select_entry,
     104 + y = actions.copy_hash, -- Copy the commit hash of the entry under the cursor
     105 + L = actions.open_commit_log,
     106 + zR = { actions.open_all_folds, desc = "Open all folds" },
     107 + zM = { actions.close_all_folds, desc = "Close all folds" },
     108 + ["?"] = { actions.options, desc = "Options" }, -- Open the option panel
     109 + ["<Down>"] = actions.next_entry,
     110 + ["<Up>"] = actions.prev_entry,
     111 + ["<CR>"] = actions.select_entry,
     112 + ["<2-LeftMouse>"] = actions.select_entry,
     113 + ["<C-A-d>"] = actions.open_in_diffview, -- Open the entry under the cursor in a diffview
     114 + ["<C-b>"] = actions.scroll_view(-0.25),
     115 + ["<C-f>"] = actions.scroll_view(0.25),
     116 + ["<Tab>"] = actions.select_next_entry,
     117 + ["<S-Tab>"] = actions.select_prev_entry,
     118 + },
     119 + option_panel = {
     120 + q = actions.close,
     121 + o = actions.select_entry,
     122 + ["<CR>"] = actions.select_entry,
     123 + ["<2-LeftMouse"] = actions.select_entry,
     124 + },
     125 + },
     126 + }
     127 + end,
     128 + },
     129 + {
     130 + "NeogitOrg/neogit",
     131 + optional = true,
     132 + opts = { integrations = { diffview = true } },
     133 + },
     134 +}
     135 + 
  • lua/plugins/disabled.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return vim.tbl_map(function(plugin) return { plugin, enabled = false } end, {
     3 + "lukas-reineke/indent-blankline.nvim",
     4 + "goolord/alpha-nvim",
     5 + "max397574/better-escape.nvim",
     6 + "nvimtools/none-ls.nvim",
     7 + "jay-babu/mason-null-ls.nvim",
     8 +})
     9 + 
  • lua/plugins/easy-align.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "junegunn/vim-easy-align",
     4 + event = "User AstroFile",
     5 + dependencies = {
     6 + "AstroNvim/astrocore",
     7 + opts = {
     8 + mappings = {
     9 + n = { ga = { "<Plug>(EasyAlign)", desc = "Easy Align" } },
     10 + x = { ga = { "<Plug>(EasyAlign)", desc = "Easy Align" } },
     11 + },
     12 + },
     13 + },
     14 +}
     15 + 
  • lua/plugins/gitsigns.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "lewis6991/gitsigns.nvim",
     4 + opts = {
     5 + signcolumn = false,
     6 + numhl = true,
     7 + current_line_blame_opts = { ignore_whitespace = true },
     8 + },
     9 +}
     10 + 
  • lua/plugins/headlines.lua
    ■ ■ ■ ■ ■ ■
     1 +return {
     2 + {
     3 + "lukas-reineke/headlines.nvim",
     4 + dependencies = "nvim-treesitter/nvim-treesitter",
     5 + ft = { "markdown", "norg", "org", "rmd" },
     6 + opts = {},
     7 + },
     8 + {
     9 + "catppuccin",
     10 + optional = true,
     11 + ---@type CatppuccinOptions
     12 + opts = { integrations = { headlines = true } },
     13 + },
     14 +}
     15 + 
  • lua/plugins/heirline.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "rebelot/heirline.nvim",
     4 + dependencies = {
     5 + "AstroNvim/astroui",
     6 + ---@type AstroUIOpts
     7 + opts = {
     8 + icons = {
     9 + Clock = "", -- add icon for clock
     10 + },
     11 + status = {
     12 + separators = {
     13 + left = { "", " " },
     14 + right = { " ", "" },
     15 + },
     16 + },
     17 + },
     18 + },
     19 + opts = function(_, opts)
     20 + local status = require "astroui.status"
     21 + -- add time to mode indicator
     22 + opts.statusline[#opts.statusline] = status.component.builder {
     23 + {
     24 + provider = function()
     25 + local time = os.date "%H:%M" -- show hour and minute in 24 hour format
     26 + ---@cast time string
     27 + return status.utils.stylize(time, {
     28 + icon = { kind = "Clock", padding = { right = 1 } }, -- add icon
     29 + padding = { right = 1 }, -- pad the right side
     30 + })
     31 + end,
     32 + },
     33 + update = { "ModeChanged", pattern = "*:*", callback = vim.schedule_wrap(function() vim.cmd.redrawstatus() end) },
     34 + hl = status.hl.get_attributes "mode", -- highlight based on mode attributes
     35 + surround = { separator = "right", color = status.hl.mode_bg, update = { "ModeChanged", pattern = "*:*" } }, -- background highlight based on mode
     36 + init = status.init.update_events {
     37 + { "User", pattern = "UpdateTime", callback = vim.schedule_wrap(function() vim.cmd.redrawstatus() end) },
     38 + },
     39 + }
     40 + 
     41 + local uv = vim.uv or vim.loop
     42 + uv.new_timer():start( -- timer for updating the time
     43 + (60 - tonumber(os.date "%S")) * 1000, -- offset timer based on current seconds past the minute
     44 + 60000, -- update every 60 seconds
     45 + vim.schedule_wrap(function() vim.api.nvim_exec_autocmds("User", { pattern = "UpdateTime", modeline = false }) end)
     46 + )
     47 + 
     48 + -- custom winbar
     49 + local path_func = status.provider.filename { modify = ":.:h", fallback = "" }
     50 + opts.winbar[1][1] = status.component.separated_path { path_func = path_func }
     51 + opts.winbar[2] = {
     52 + status.component.separated_path { path_func = path_func },
     53 + status.component.file_info { -- add file_info to breadcrumbs
     54 + file_icon = { hl = status.hl.filetype_color, padding = { left = 0 } },
     55 + file_read_only = false,
     56 + file_modified = false,
     57 + filename = {},
     58 + filetype = false,
     59 + hl = status.hl.get_attributes("winbar", true),
     60 + surround = false,
     61 + update = "BufEnter",
     62 + },
     63 + status.component.breadcrumbs {
     64 + icon = { hl = true },
     65 + hl = status.hl.get_attributes("winbar", true),
     66 + prefix = true,
     67 + padding = { left = 0 },
     68 + },
     69 + }
     70 + end,
     71 +}
     72 + 
  • lua/plugins/highlight-colors.lua
    ■ ■ ■ ■ ■ ■
     1 +return {
     2 + { "NvChad/nvim-colorizer.lua", enabled = false },
     3 + {
     4 + "brenoprata10/nvim-highlight-colors",
     5 + event = "User AstroFile",
     6 + cmd = "HighlightColors",
     7 + dependencies = {
     8 + {
     9 + "AstroNvim/astrocore",
     10 + opts = function(_, opts)
     11 + local maps = opts.mappings
     12 + maps.n["<Leader>uz"] = { function() vim.cmd.HighlightColors "Toggle" end, desc = "Toggle color highlight" }
     13 + end,
     14 + },
     15 + },
     16 + opts = { enabled_named_colors = false },
     17 + },
     18 +}
     19 + 
  • lua/plugins/indent-tools.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "arsham/indent-tools.nvim",
     4 + dependencies = { "arsham/arshlib.nvim" },
     5 + event = "User AstroFile",
     6 + config = function() require("indent-tools").config {} end,
     7 +}
     8 + 
  • lua/plugins/init.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return { "wakatime/vim-wakatime", event = "User AstroFile" }
     3 + 
  • lua/plugins/kitty-scrollback.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "mikesmithgh/kitty-scrollback.nvim",
     4 + dependencies = { "AstroNvim/astrocore" },
     5 + cmd = { "KittyScrollbackGenerateKittens", "KittyScrollbackCheckHealth" },
     6 + event = "User KittyScrollbackLaunch",
     7 + opts = {},
     8 +}
     9 + 
  • lua/plugins/lsp-file-operations.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "antosha417/nvim-lsp-file-operations",
     4 + lazy = true,
     5 + init = function(plugin) require("astrocore").on_load("neo-tree.nvim", plugin.name) end,
     6 + main = "lsp-file-operations",
     7 + opts = {},
     8 +}
     9 + 
  • lua/plugins/lspkind.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "onsails/lspkind.nvim",
     4 + opts = function(_, opts)
     5 + -- use codicons preset
     6 + opts.preset = "codicons"
     7 + -- set some missing symbol types
     8 + opts.symbol_map = {
     9 + Array = "",
     10 + Boolean = "",
     11 + Key = "",
     12 + Namespace = "",
     13 + Null = "",
     14 + Number = "",
     15 + Object = "",
     16 + Package = "",
     17 + String = "",
     18 + }
     19 + opts.before = function(_, vim_item)
     20 + local max_width = math.floor(0.25 * vim.o.columns)
     21 + local label = vim_item.abbr
     22 + local truncated_label = vim.fn.strcharpart(label, 0, max_width)
     23 + if truncated_label ~= label then vim_item.abbr = truncated_label .. "…" end
     24 + return vim_item
     25 + end
     26 + end,
     27 +}
     28 + 
  • lua/plugins/mason-nvim-dap.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "jay-babu/mason-nvim-dap.nvim",
     4 + opts = {
     5 + handlers = {
     6 + js = function()
     7 + local dap = require "dap"
     8 + dap.adapters["pwa-node"] = {
     9 + type = "server",
     10 + port = "${port}",
     11 + executable = { command = vim.fn.exepath "js-debug-adapter", args = { "${port}" } },
     12 + }
     13 + 
     14 + local pwa_node_attach = {
     15 + type = "pwa-node",
     16 + request = "launch",
     17 + name = "js-debug: Attach to Process (pwa-node)",
     18 + proccessId = require("dap.utils").pick_process,
     19 + cwd = "${workspaceFolder}",
     20 + }
     21 + local function deno(cmd)
     22 + cmd = cmd or "run"
     23 + return {
     24 + request = "launch",
     25 + name = ("js-debug: Launch Current File (deno %s)"):format(cmd),
     26 + type = "pwa-node",
     27 + program = "${file}",
     28 + cwd = "${workspaceFolder}",
     29 + runtimeExecutable = vim.fn.exepath "deno",
     30 + runtimeArgs = { cmd, "--inspect-brk" },
     31 + attachSimplePort = 9229,
     32 + }
     33 + end
     34 + local function typescript(args)
     35 + return {
     36 + type = "pwa-node",
     37 + request = "launch",
     38 + name = ("js-debug: Launch Current File (ts-node%s)"):format(
     39 + args and (" " .. table.concat(args, " ")) or ""
     40 + ),
     41 + program = "${file}",
     42 + cwd = "${workspaceFolder}",
     43 + runtimeExecutable = "ts-node",
     44 + runtimeArgs = args,
     45 + sourceMaps = true,
     46 + protocol = "inspector",
     47 + console = "integratedTerminal",
     48 + resolveSourceMapLocations = {
     49 + "${workspaceFolder}/dist/**/*.js",
     50 + "${workspaceFolder}/**",
     51 + "!**/node_modules/**",
     52 + },
     53 + }
     54 + end
     55 + for _, language in ipairs { "javascript", "javascriptreact" } do
     56 + dap.configurations[language] = {
     57 + {
     58 + type = "pwa-node",
     59 + request = "launch",
     60 + name = "js-debug: Launch File (pwa-node)",
     61 + program = "${file}",
     62 + cwd = "${workspaceFolder}",
     63 + },
     64 + deno "run",
     65 + deno "test",
     66 + pwa_node_attach,
     67 + }
     68 + end
     69 + for _, language in ipairs { "typescript", "typescriptreact" } do
     70 + dap.configurations[language] = {
     71 + typescript(),
     72 + typescript { "--esm" },
     73 + deno "run",
     74 + deno "test",
     75 + pwa_node_attach,
     76 + }
     77 + end
     78 + end,
     79 + },
     80 + },
     81 +}
     82 + 
  • lua/plugins/mason-tool-installer.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + {
     4 + "WhoIsSethDaniel/mason-tool-installer.nvim",
     5 + cmd = { "MasonToolsInstall", "MasonToolsUpdate", "MasonToolsClean" },
     6 + dependencies = { "williamboman/mason.nvim" },
     7 + init = function(plugin) require("astrocore").on_load("mason.nvim", plugin.name) end,
     8 + opts = {
     9 + ensure_installed = {
     10 + -- Language Servers
     11 + "ansiblels",
     12 + "astro",
     13 + "basedpyright",
     14 + "clangd",
     15 + "cssls",
     16 + "gopls",
     17 + "hls",
     18 + "html",
     19 + "intelephense",
     20 + "jsonls",
     21 + "julials",
     22 + "lua_ls",
     23 + "marksman",
     24 + "neocmake",
     25 + "ruff_lsp",
     26 + "tailwindcss",
     27 + "taplo",
     28 + "texlab",
     29 + "vtsls",
     30 + "yamlls",
     31 + 
     32 + -- Linters
     33 + "ansible-lint",
     34 + "selene",
     35 + "shellcheck",
     36 + 
     37 + -- Formatters
     38 + "prettier",
     39 + "shfmt",
     40 + "stylua",
     41 + 
     42 + -- Debuggers
     43 + "bash-debug-adapter",
     44 + "cpptools",
     45 + "debugpy",
     46 + "delve",
     47 + "haskell-debug-adapter",
     48 + "js-debug-adapter",
     49 + "php-debug-adapter",
     50 + },
     51 + },
     52 + config = function(_, opts)
     53 + local mason_tool_installer = require "mason-tool-installer"
     54 + mason_tool_installer.setup(opts)
     55 + mason_tool_installer.run_on_start()
     56 + end,
     57 + },
     58 + { "jay-babu/mason-nvim-dap.nvim", optional = true, init = false },
     59 + { "williamboman/mason-lspconfig.nvim", optional = true, init = false },
     60 + { "jay-babu/mason-null-ls.nvim", optional = true, init = false },
     61 +}
     62 + 
  • lua/plugins/metals.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "scalameta/nvim-metals",
     4 + enabled = function() return vim.fn.executable "cs" == 1 or vim.fn.executable "coursier" == 1 end,
     5 + ft = { "scala", "sbt", "java" },
     6 + dependencies = {
     7 + { "AstroNvim/astrolsp", opts = { handlers = { metals = false } } },
     8 + {
     9 + "mfussenegger/nvim-dap",
     10 + optional = true,
     11 + config = function()
     12 + require("dap").configurations.scala = {
     13 + {
     14 + type = "scala",
     15 + request = "launch",
     16 + name = "RunOrTest",
     17 + metals = { runType = "runOrTestFile" },
     18 + },
     19 + {
     20 + type = "scala",
     21 + request = "launch",
     22 + name = "Test Target",
     23 + metals = { runType = "testTarget" },
     24 + },
     25 + }
     26 + end,
     27 + },
     28 + },
     29 + opts = function()
     30 + local metals = require "metals"
     31 + local user_config = require("astrolsp").lsp_opts "metals"
     32 + if require("astrocore").is_available "nvim-dap" then
     33 + local on_attach = user_config.on_attach
     34 + user_config.on_attach = function(...)
     35 + on_attach(...)
     36 + metals.setup_dap()
     37 + end
     38 + end
     39 + return require("astrocore").extend_tbl(metals.bare_config(), user_config)
     40 + end,
     41 + config = function(self, opts)
     42 + vim.api.nvim_create_autocmd("FileType", {
     43 + pattern = self.ft,
     44 + group = vim.api.nvim_create_augroup("nvim-metals", { clear = true }),
     45 + desc = "Initialize and attach nvim-metals",
     46 + callback = function() require("metals").initialize_or_attach(opts) end,
     47 + })
     48 + end,
     49 +}
     50 + 
  • lua/plugins/mini-move.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + {
     4 + "echasnovski/mini.move",
     5 + keys = {
     6 + { "<M-l>", mode = { "n", "v" } },
     7 + { "<M-k>", mode = { "n", "v" } },
     8 + { "<M-j>", mode = { "n", "v" } },
     9 + { "<M-h>", mode = { "n", "v" } },
     10 + },
     11 + opts = {},
     12 + },
     13 + {
     14 + "catppuccin",
     15 + optional = true,
     16 + ---@type CatppuccinOptions
     17 + opts = { integrations = { mini = true } },
     18 + },
     19 +}
     20 + 
  • lua/plugins/mini-surround.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + {
     4 + "echasnovski/mini.surround",
     5 + keys = {
     6 + { "sa", desc = "Add surrounding", mode = { "n", "v" } },
     7 + { "sd", desc = "Delete surrounding" },
     8 + { "sf", desc = "Find right surrounding" },
     9 + { "sF", desc = "Find left surrounding" },
     10 + { "sh", desc = "Highlight surrounding" },
     11 + { "sr", desc = "Replace surrounding" },
     12 + { "sn", desc = "Update `MiniSurround.config.n_lines`" },
     13 + },
     14 + opts = { n_lines = 200 },
     15 + },
     16 + {
     17 + "catppuccin",
     18 + optional = true,
     19 + ---@type CatppuccinOptions
     20 + opts = { integrations = { mini = true } },
     21 + },
     22 +}
     23 + 
  • lua/plugins/neo-tree.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "nvim-neo-tree/neo-tree.nvim",
     4 + opts = {
     5 + filesystem = {
     6 + filtered_items = {
     7 + always_show = { ".github", ".gitignore" },
     8 + },
     9 + },
     10 + nesting_rules = {
     11 + docker = {
     12 + pattern = "^dockerfile$",
     13 + ignore_case = true,
     14 + files = { ".dockerignore", "docker-compose.*", "dockerfile*" },
     15 + },
     16 + git_files = {
     17 + pattern = "^%.gitignore$",
     18 + files = { ".gitattributes", ".gitmodules", ".gitmessage", ".mailmap", ".git-blame*" },
     19 + },
     20 + readme = {
     21 + pattern = "^readme.*",
     22 + ignore_case = true,
     23 + files = {
     24 + "authors",
     25 + "backers*",
     26 + "changelog*",
     27 + "citation*",
     28 + "code_of_conduct*",
     29 + "codeowners",
     30 + "contributing*",
     31 + "contributors",
     32 + "copying*",
     33 + "credits",
     34 + "governance.md",
     35 + "history.md",
     36 + "license*",
     37 + "maintainers",
     38 + "readme*",
     39 + "security.md",
     40 + "sponsors*",
     41 + },
     42 + },
     43 + tex = {
     44 + pattern = "^(.*)%.tex$",
     45 + files = {
     46 + "_minted-%1",
     47 + "%1.acn",
     48 + "%1.acr",
     49 + "%1.alg",
     50 + "%1.aux",
     51 + "%1.bbl",
     52 + "%1.blg",
     53 + "%1.fdb_latexmk",
     54 + "%1.fls",
     55 + "%1.glg",
     56 + "%1.glo",
     57 + "%1.gls",
     58 + "%1.idx",
     59 + "%1.ind",
     60 + "%1.ist",
     61 + "%1.lof",
     62 + "%1.log",
     63 + "%1.lot",
     64 + "%1.out",
     65 + "%1.pag",
     66 + "%1.pdf",
     67 + "%1.synctex.gz",
     68 + "%1.toc",
     69 + "%1.xdv",
     70 + },
     71 + },
     72 + tool_versions = {
     73 + pattern = "^%.tool-versions$",
     74 + files = { ".rtx.toml" },
     75 + },
     76 + },
     77 + },
     78 +}
     79 + 
  • lua/plugins/neogen.lua
    ■ ■ ■ ■ ■ ■
     1 +local prefix = "<Leader>a"
     2 +---@type LazySpec
     3 +return {
     4 + "danymat/neogen",
     5 + cmd = "Neogen",
     6 + dependencies = {
     7 + "AstroNvim/astrocore",
     8 + opts = {
     9 + mappings = {
     10 + n = {
     11 + [prefix] = { desc = "󰏫 Annotate" },
     12 + [prefix .. "<CR>"] = { function() require("neogen").generate() end, desc = "Current" },
     13 + [prefix .. "c"] = { function() require("neogen").generate { type = "class" } end, desc = "Class" },
     14 + [prefix .. "f"] = { function() require("neogen").generate { type = "func" } end, desc = "Function" },
     15 + [prefix .. "t"] = { function() require("neogen").generate { type = "type" } end, desc = "Type" },
     16 + [prefix .. "F"] = { function() require("neogen").generate { type = "file" } end, desc = "File" },
     17 + },
     18 + },
     19 + },
     20 + },
     21 + opts = {
     22 + snippet_engine = "luasnip",
     23 + languages = {
     24 + lua = { template = { annotation_convention = "emmylua" } },
     25 + typescript = { template = { annotation_convention = "tsdoc" } },
     26 + typescriptreact = { template = { annotation_convention = "tsdoc" } },
     27 + },
     28 + },
     29 +}
     30 + 
  • lua/plugins/neogit.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + {
     4 + "NeogitOrg/neogit",
     5 + cmd = "Neogit",
     6 + dependencies = {
     7 + "AstroNvim/astrocore",
     8 + opts = {
     9 + mappings = {
     10 + n = {
     11 + ["<Leader>gG"] = { function() require("neogit").open() end, desc = "Neogit" },
     12 + },
     13 + },
     14 + },
     15 + },
     16 + opts = function()
     17 + local get_icon = require("astroui").get_icon
     18 + local fold_signs = { get_icon "FoldClosed", get_icon "FoldOpened" }
     19 + return {
     20 + disable_builtin_notifications = true,
     21 + integrations = { telescope = true },
     22 + signs = { section = fold_signs, item = fold_signs },
     23 + }
     24 + end,
     25 + },
     26 + {
     27 + "catppuccin",
     28 + optional = true,
     29 + ---@type CatppuccinOptions
     30 + opts = { integrations = { neogit = true } },
     31 + },
     32 +}
     33 + 
  • lua/plugins/neotest.lua
    ■ ■ ■ ■ ■ ■
     1 +local prefix = "<Leader>T"
     2 +---@type LazySpec
     3 +return {
     4 + {
     5 + "nvim-neotest/neotest",
     6 + dependencies = {
     7 + {
     8 + "AstroNvim/astrocore",
     9 + opts = {
     10 + mappings = {
     11 + n = {
     12 + [prefix] = { desc = "󰗇 Tests" },
     13 + [prefix .. "t"] = { function() require("neotest").run.run() end, desc = "Run test" },
     14 + [prefix .. "d"] = { function() require("neotest").run.run { strategy = "dap" } end, desc = "Debug test" },
     15 + [prefix .. "f"] = {
     16 + function() require("neotest").run.run(vim.fn.expand "%") end,
     17 + desc = "Run all tests in file",
     18 + },
     19 + [prefix .. "p"] = {
     20 + function() require("neotest").run.run(vim.fn.getcwd()) end,
     21 + desc = "Run all tests in project",
     22 + },
     23 + [prefix .. "<CR>"] = { function() require("neotest").summary.toggle() end, desc = "Test Summary" },
     24 + [prefix .. "o"] = { function() require("neotest").output.open() end, desc = "Output hover" },
     25 + [prefix .. "O"] = { function() require("neotest").output_panel.toggle() end, desc = "Output window" },
     26 + },
     27 + },
     28 + },
     29 + },
     30 + "mrcjkb/neotest-haskell",
     31 + "nvim-neotest/neotest-go",
     32 + "nvim-neotest/neotest-python",
     33 + "stevanmilic/neotest-scala",
     34 + },
     35 + opts = function()
     36 + return {
     37 + adapters = {
     38 + require "neotest-go",
     39 + require "neotest-haskell",
     40 + require "neotest-python",
     41 + require "neotest-scala",
     42 + },
     43 + }
     44 + end,
     45 + config = function(_, opts)
     46 + vim.diagnostic.config({
     47 + virtual_text = {
     48 + format = function(diagnostic)
     49 + return diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
     50 + end,
     51 + },
     52 + }, vim.api.nvim_create_namespace "neotest")
     53 + require("neotest").setup(opts)
     54 + end,
     55 + },
     56 + {
     57 + "catppuccin",
     58 + optional = true,
     59 + ---@type CatppuccinOptions
     60 + opts = { integrations = { neotest = true } },
     61 + },
     62 +}
     63 + 
  • plugins/noice.lua lua/plugins/noice.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
    1 2  return {
    2  - { "rcarriga/nvim-notify", init = false, config = true },
    3  - {
    4  - "nvim-treesitter/nvim-treesitter",
    5  - opts = function(_, opts)
    6  - if opts.ensure_installed ~= "all" then
    7  - opts.ensure_installed = require("astronvim.utils").list_insert_unique(
    8  - opts.ensure_installed,
    9  - { "bash", "markdown", "markdown_inline", "regex", "vim" }
    10  - )
    11  - end
    12  - end,
    13  - },
    14 3   {
    15 4   "folke/noice.nvim",
    16 5   event = "VeryLazy",
     6 + dependencies = { "rcarriga/nvim-notify", init = false, config = true },
    17 7   opts = {
    18 8   cmdline = { view = "cmdline" },
    19 9   messages = { view_search = false },
    skipped 3 lines
    23 13   signature = { enabled = false },
    24 14   },
    25 15   routes = {
     16 + { filter = { event = "msg_show", cmdline = "^:lua" }, view = "messages" }, -- send lua output to split
    26 17   { filter = { event = "msg_show", min_height = 20 }, view = "messages" }, -- send long messages to split
    27 18   { filter = { event = "msg_show", find = "%d+L,%s%d+B" }, opts = { skip = true } }, -- skip save notifications
    28 19   { filter = { event = "msg_show", find = "^%d+ more lines$" }, opts = { skip = true } }, -- skip paste notifications
    skipped 1 lines
    30 21   { filter = { event = "msg_show", find = "^%d+ lines yanked$" }, opts = { skip = true } }, -- skip yank notifications
    31 22   },
    32 23   },
     24 + },
     25 + {
     26 + "catppuccin",
     27 + optional = true,
     28 + ---@type CatppuccinOptions
     29 + opts = { integrations = { noice = true } },
    33 30   },
    34 31  }
    35 32   
  • lua/plugins/nvim-dap-virtual-text.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "theHamsta/nvim-dap-virtual-text",
     4 + init = function(plugin) require("astrocore").on_load("nvim-dap", plugin.name) end,
     5 + opts = {},
     6 +}
     7 + 
  • lua/plugins/nvim-lint.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "mfussenegger/nvim-lint",
     4 + event = "User AstroFile",
     5 + dependencies = { "williamboman/mason.nvim" },
     6 + opts = {
     7 + linters_by_ft = {
     8 + lua = { "selene" },
     9 + puppet = { "puppet-lint" },
     10 + sh = { "shellcheck" },
     11 + ansible = { "ansible_lint" },
     12 + cfn = { "cfn_lint" },
     13 + },
     14 + linters = {
     15 + cfn_lint = {
     16 + ignore_exitcode = true,
     17 + },
     18 + },
     19 + },
     20 + config = function(_, opts)
     21 + local lint = require "lint"
     22 + 
     23 + lint.linters_by_ft = opts.linters_by_ft
     24 + for name, linter in pairs(opts.linters or {}) do
     25 + lint.linters[name] = (type(linter) == "table" and type(lint.linters[name]) == "table")
     26 + and vim.tbl_deep_extend("force", lint.linters[name], linter)
     27 + or linter
     28 + end
     29 + 
     30 + local valid_linters = function(ctx, linters)
     31 + if not linters then return {} end
     32 + return vim.tbl_filter(function(name)
     33 + local linter = lint.linters[name]
     34 + return linter
     35 + and vim.fn.executable(linter.cmd) == 1
     36 + and not (type(linter) == "table" and linter.condition and not linter.condition(ctx))
     37 + end, linters)
     38 + end
     39 + 
     40 + local orig_resolve_linter_by_ft = lint._resolve_linter_by_ft
     41 + lint._resolve_linter_by_ft = function(...)
     42 + local ctx = { filename = vim.api.nvim_buf_get_name(0) }
     43 + ctx.dirname = vim.fn.fnamemodify(ctx.filename, ":h")
     44 + 
     45 + local linters = valid_linters(ctx, orig_resolve_linter_by_ft(...))
     46 + if not linters[1] then linters = valid_linters(ctx, lint.linters_by_ft["_"]) end -- fallback
     47 + require("astrocore").list_insert_unique(linters, valid_linters(ctx, lint.linters_by_ft["*"])) -- global
     48 + 
     49 + return linters
     50 + end
     51 + 
     52 + lint.try_lint() -- start linter immediately
     53 + local timer = vim.loop.new_timer()
     54 + vim.api.nvim_create_autocmd({ "BufWritePost", "BufReadPost", "InsertLeave", "TextChanged" }, {
     55 + group = vim.api.nvim_create_augroup("auto_lint", { clear = true }),
     56 + desc = "Automatically try linting",
     57 + callback = function()
     58 + timer:start(100, 0, function()
     59 + timer:stop()
     60 + vim.schedule(lint.try_lint)
     61 + end)
     62 + end,
     63 + })
     64 + end,
     65 +}
     66 + 
  • lua/plugins/nvim-notify.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "rcarriga/nvim-notify",
     4 + opts = { timeout = 0 },
     5 +}
     6 + 
  • lua/plugins/oil.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "stevearc/oil.nvim",
     4 + cmd = "Oil",
     5 + init = function() -- start oil on startup lazily if necessary
     6 + if vim.fn.argc() == 1 then
     7 + local arg = vim.fn.argv(0)
     8 + ---@cast arg string
     9 + local stat = vim.loop.fs_stat(arg)
     10 + local adapter = string.match(arg, "^([%l-]*)://")
     11 + if (stat and stat.type == "directory") or adapter == "oil-ssh" then require "oil" end
     12 + end
     13 + end,
     14 + dependencies = {
     15 + { "nvim-neo-tree/neo-tree.nvim", opts = { filesystem = { hijack_netrw_behavior = "disabled" } } },
     16 + {
     17 + "AstroNvim/astrocore",
     18 + opts = {
     19 + autocmds = {
     20 + neotree_start = false,
     21 + oil_start = {
     22 + {
     23 + event = "BufNew",
     24 + desc = "start oil when editing a directory",
     25 + callback = function()
     26 + if package.loaded["oil"] then
     27 + vim.api.nvim_del_augroup_by_name "oil_start"
     28 + elseif vim.fn.isdirectory(vim.fn.expand "<afile>") == 1 then
     29 + require "oil"
     30 + vim.api.nvim_del_augroup_by_name "oil_start"
     31 + end
     32 + end,
     33 + },
     34 + },
     35 + oil_settings = {
     36 + {
     37 + event = "FileType",
     38 + desc = "Disable view saving for oil buffers",
     39 + pattern = "oil",
     40 + callback = function(args) vim.b[args.buf].view_activated = false end,
     41 + },
     42 + {
     43 + event = "User",
     44 + pattern = "OilActionsPost",
     45 + desc = "Logic to run after an action in Oil",
     46 + callback = function(args)
     47 + if args.data.err then return end
     48 + for _, action in ipairs(args.data.actions) do
     49 + ---@cast action oil.Action
     50 + if action.type == "delete" then
     51 + ---@cast action oil.DeleteAction
     52 + local _, path = require("oil.util").parse_url(action.url)
     53 + local bufnr = vim.fn.bufnr(path)
     54 + if bufnr ~= -1 then require("astrocore.buffer").wipe(bufnr, true) end
     55 + end
     56 + end
     57 + end,
     58 + },
     59 + },
     60 + },
     61 + mappings = {
     62 + n = {
     63 + ["<Tab>"] = { "<Cmd>Oil<CR>", desc = "Oil Filebrowser" },
     64 + },
     65 + },
     66 + },
     67 + },
     68 + {
     69 + "rebelot/heirline.nvim",
     70 + opts = function(_, opts)
     71 + local status = require "astroui.status"
     72 + local is_oil = function(bufnr) return status.condition.buffer_matches({ filetype = "^oil$" }, bufnr) end
     73 + local disable_winbar_cb = opts.opts.disable_winbar_cb
     74 + opts.opts.disable_winbar_cb = function(args)
     75 + if is_oil(args.buf) then return false end
     76 + return disable_winbar_cb(args)
     77 + end
     78 + 
     79 + if opts.winbar then
     80 + table.insert(opts.winbar, 1, {
     81 + condition = function(self) return is_oil(self.bufnr) end,
     82 + status.component.separated_path {
     83 + padding = { left = 2 },
     84 + max_depth = false,
     85 + suffix = false,
     86 + path_func = function() return require("oil").get_current_dir() end,
     87 + },
     88 + })
     89 + end
     90 + end,
     91 + },
     92 + },
     93 + opts = {
     94 + skip_confirm_for_simple_edits = true,
     95 + experimental_watch_for_changes = true,
     96 + keymaps = {
     97 + ["<Tab>"] = "actions.close",
     98 + },
     99 + },
     100 +}
     101 + 
  • lua/plugins/overseer.lua
    ■ ■ ■ ■ ■ ■
     1 +local prefix = "<Leader>m"
     2 +---@type LazySpec
     3 +return {
     4 + {
     5 + "stevearc/overseer.nvim",
     6 + cmd = {
     7 + "OverseerOpen",
     8 + "OverseerClose",
     9 + "OverseerToggle",
     10 + "OverseerSaveBundle",
     11 + "OverseerLoadBundle",
     12 + "OverseerDeleteBundle",
     13 + "OverseerRunCmd",
     14 + "OverseerRun",
     15 + "OverseerInfo",
     16 + "OverseerBuild",
     17 + "OverseerQuickAction",
     18 + "OverseerTaskAction",
     19 + "OverseerClearCache",
     20 + },
     21 + dependencies = {
     22 + "AstroNvim/astrocore",
     23 + opts = {
     24 + commands = {
     25 + AutoCompile = {
     26 + function()
     27 + require("overseer").run_template({ name = "compile with compiler" }, function(task)
     28 + if task then
     29 + task:add_component { "restart_on_save", paths = { vim.fn.expand "%:p" } }
     30 + else
     31 + vim.notify("Error setting up auto compilation", vim.log.levels.ERROR)
     32 + end
     33 + end)
     34 + end,
     35 + desc = "Automatically compile the current file with `compiler` on save",
     36 + },
     37 + Compile = {
     38 + function() require("overseer").run_template { name = "compile with compiler" } end,
     39 + desc = "Compile the current file with `compiler`",
     40 + },
     41 + OpOut = {
     42 + function() require("overseer").run_template { name = "view file output" } end,
     43 + desc = "View the current file ouptut with `opout`",
     44 + },
     45 + Present = {
     46 + function()
     47 + require("overseer").run_template({ name = "present with pdfpc" }, function(task)
     48 + if not task then vim.notify("Unable to start presentation", vim.log.levels.ERROR) end
     49 + end)
     50 + end,
     51 + desc = "Present the current file with `pdfpc`",
     52 + },
     53 + },
     54 + mappings = {
     55 + n = {
     56 + [prefix] = { desc = "󱁤 Compilation" },
     57 + [prefix .. "a"] = { "<Cmd>OverseerQuickAction<CR>", desc = "Quick Action" },
     58 + [prefix .. "i"] = { "<Cmd>OverseerInfo<CR>", desc = "Overseer Info" },
     59 + [prefix .. "k"] = { "<Cmd>Compile<CR>", desc = "Compile" },
     60 + [prefix .. "K"] = { "<Cmd>AutoCompile<CR>", desc = "Auto Compile" },
     61 + [prefix .. "<CR>"] = { "<Cmd>OverseerToggle<CR>", desc = "Overseer" },
     62 + [prefix .. "p"] = { "<Cmd>Present<CR>", desc = "Present file output" },
     63 + [prefix .. "r"] = { "<Cmd>OverseerRun<CR>", desc = "Run" },
     64 + [prefix .. "v"] = { "<Cmd>OpOut<CR>", desc = "View Output" },
     65 + },
     66 + },
     67 + },
     68 + },
     69 + opts = {
     70 + setup = {
     71 + task_list = {
     72 + strategy = "toggleterm",
     73 + direction = "bottom",
     74 + bindings = {
     75 + ["<C-l>"] = false,
     76 + ["<C-h>"] = false,
     77 + ["<C-k>"] = false,
     78 + ["<C-j>"] = false,
     79 + q = "<Cmd>close<CR>",
     80 + K = "IncreaseDetail",
     81 + J = "DecreaseDetail",
     82 + ["<C-p>"] = "ScrollOutputUp",
     83 + ["<C-n>"] = "ScrollOutputDown",
     84 + },
     85 + },
     86 + },
     87 + templates = {
     88 + {
     89 + name = "compile with compiler",
     90 + builder = function() return { cmd = { "compiler" }, args = { vim.fn.expand "%:p" } } end,
     91 + },
     92 + {
     93 + name = "view file output",
     94 + builder = function() return { cmd = { "opout" }, args = { vim.fn.expand "%:p" } } end,
     95 + },
     96 + {
     97 + name = "present with pdfpc",
     98 + builder = function() return { cmd = { "pdfpc" }, args = { vim.fn.expand "%:r" .. ".pdf" } } end,
     99 + condition = { callback = function() return vim.fn.filereadable(vim.fn.expand "%:r" .. ".pdf") == 1 end },
     100 + },
     101 + },
     102 + },
     103 + config = function(_, opts)
     104 + require("overseer").setup(opts.setup)
     105 + vim.tbl_map(require("overseer").register_template, opts.templates)
     106 + end,
     107 + },
     108 + {
     109 + "catppuccin",
     110 + optional = true,
     111 + ---@type CatppuccinOptions
     112 + opts = { integrations = { overseer = true } },
     113 + },
     114 +}
     115 + 
  • lua/plugins/rainbow-delimiters.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + {
     4 + "HiPhish/rainbow-delimiters.nvim",
     5 + dependencies = {
     6 + {
     7 + "AstroNvim/astrocore",
     8 + opts = {
     9 + mappings = {
     10 + n = {
     11 + ["<Leader>u("] = {
     12 + function()
     13 + local bufnr = vim.api.nvim_get_current_buf()
     14 + require("rainbow-delimiters").toggle(bufnr)
     15 + require("astrocore").notify(
     16 + string.format(
     17 + "Buffer rainbow delimeters %s",
     18 + require("rainbow-delimiters").is_enabled(bufnr) and "on" or "off"
     19 + )
     20 + )
     21 + end,
     22 + desc = "Toggle rainbow delimeters (buffer)",
     23 + },
     24 + },
     25 + },
     26 + },
     27 + },
     28 + },
     29 + event = "User AstroFile",
     30 + main = "rainbow-delimiters.setup",
     31 + opts = {},
     32 + },
     33 + {
     34 + "catppuccin",
     35 + optional = true,
     36 + ---@type CatppuccinOptions
     37 + opts = { integrations = { rainbow_delimiters = true } },
     38 + },
     39 +}
     40 + 
  • lua/plugins/schemastore.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "b0o/SchemaStore.nvim",
     4 + {
     5 + "AstroNvim/astrolsp",
     6 + opts = {
     7 + config = {
     8 + jsonls = {
     9 + on_new_config = function(config)
     10 + if not config.settings.json.schemas then config.settings.json.schemas = {} end
     11 + vim.list_extend(config.settings.json.schemas, require("schemastore").json.schemas())
     12 + end,
     13 + settings = { json = { validate = { enable = true } } },
     14 + },
     15 + yamlls = {
     16 + on_new_config = function(config)
     17 + config.settings.yaml.schemas =
     18 + vim.tbl_deep_extend("force", config.settings.yaml.schemas or {}, require("schemastore").yaml.schemas())
     19 + end,
     20 + settings = { yaml = { schemaStore = { enable = false, url = "" } } },
     21 + },
     22 + },
     23 + },
     24 + },
     25 +}
     26 + 
  • lua/plugins/send-to-term.lua
    ■ ■ ■ ■ ■ ■
     1 +local prefix = "<Leader>r"
     2 +---@type LazySpec
     3 +return {
     4 + "mtikekar/nvim-send-to-term",
     5 + keys = { "<Plug>Send", "<Plug>SendLine" },
     6 + cmd = "SendHere",
     7 + dependencies = {
     8 + "AstroNvim/astrocore",
     9 + opts = {
     10 + options = { g = { send_disable_mapping = true } },
     11 + mappings = {
     12 + n = {
     13 + [prefix] = { desc = " REPL" },
     14 + [prefix .. "r"] = { "<Plug>Send", desc = "Send to REPL" },
     15 + [prefix .. "l"] = { "<Plug>SendLine", desc = "Send line to REPL" },
     16 + [prefix .. "<CR>"] = { "<Cmd>SendHere<CR>", desc = "Set REPL" },
     17 + },
     18 + v = {
     19 + [prefix] = { "<Plug>Send", desc = "Send to REPL" },
     20 + },
     21 + },
     22 + },
     23 + },
     24 +}
     25 + 
  • lua/plugins/smart-splits.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "mrjones2014/smart-splits.nvim",
     4 + dependencies = {
     5 + "AstroNvim/astrocore",
     6 + opts = {
     7 + mappings = {
     8 + n = {
     9 + ["<C-Down>"] = false,
     10 + ["<C-Left>"] = false,
     11 + ["<C-Right>"] = false,
     12 + ["<C-Up>"] = false,
     13 + -- resize with arrows
     14 + ["<Up>"] = { function() require("smart-splits").resize_up(2) end, desc = "Resize split up" },
     15 + ["<Down>"] = { function() require("smart-splits").resize_down(2) end, desc = "Resize split down" },
     16 + ["<Left>"] = { function() require("smart-splits").resize_left(2) end, desc = "Resize split left" },
     17 + ["<Right>"] = { function() require("smart-splits").resize_right(2) end, desc = "Resize split right" },
     18 + },
     19 + },
     20 + },
     21 + },
     22 + build = "./kitty/install-kittens.bash",
     23 + opts = function(_, opts) opts.at_edge = require("smart-splits.types").AtEdgeBehavior.stop end,
     24 +}
     25 + 
  • lua/plugins/spectre.lua
    ■ ■ ■ ■ ■ ■
     1 +local prefix = "<Leader>s"
     2 +---@type LazySpec
     3 +return {
     4 + "nvim-pack/nvim-spectre",
     5 + cmd = "Spectre",
     6 + dependencies = {
     7 + "AstroNvim/astrocore",
     8 + opts = {
     9 + mappings = {
     10 + n = {
     11 + [prefix] = { desc = "󰛔 Search/Replace" },
     12 + [prefix .. "s"] = { function() require("spectre").toggle() end, desc = "Toggle Spectre" },
     13 + [prefix .. "f"] = { function() require("spectre").open_file_search() end, desc = "Spectre (current file)" },
     14 + [prefix .. "w"] = {
     15 + function() require("spectre").open_visual { select_word = true } end,
     16 + desc = "Spectre (current word)",
     17 + },
     18 + },
     19 + v = {
     20 + [prefix] = { function() require("spectre").open_visual() end, desc = "Spectre" },
     21 + },
     22 + },
     23 + },
     24 + },
     25 + opts = {
     26 + open_cmd = "new",
     27 + mapping = {
     28 + send_to_qf = { map = "<Leader>sq" },
     29 + replace_cmd = { map = "<Leader>sc" },
     30 + show_option_menu = { map = "<Leader>so" },
     31 + run_current_replace = { map = "<Leader>sC" },
     32 + run_replace = { map = "<Leader>sR" },
     33 + change_view_mode = { map = "<Leader>sv" },
     34 + resume_last_search = { map = "<Leader>sl" },
     35 + },
     36 + },
     37 +}
     38 + 
  • lua/plugins/telescope-bibtex.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "nvim-telescope/telescope-bibtex.nvim",
     4 + dependencies = {
     5 + {
     6 + "nvim-telescope/telescope.nvim",
     7 + opts = {
     8 + extensions = {
     9 + bibtex = { context = true, context_fallback = false },
     10 + },
     11 + },
     12 + },
     13 + {
     14 + "AstroNvim/astrocore",
     15 + opts = function(_, opts) opts.mappings.n["<Leader>fB"] = { "<Cmd>Telescope bibtex<CR>", desc = "Find BibTeX" } end,
     16 + },
     17 + },
     18 + init = function()
     19 + require("astrocore").on_load("telescope.nvim", function() require("telescope").load_extension "bibtex" end)
     20 + end,
     21 +}
     22 + 
  • lua/plugins/telescope.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "nvim-telescope/telescope.nvim",
     4 + opts = {
     5 + defaults = {
     6 + results_title = "",
     7 + selection_caret = " ",
     8 + layout_config = {
     9 + width = 0.90,
     10 + height = 0.85,
     11 + preview_cutoff = 120,
     12 + horizontal = {
     13 + preview_width = 0.6,
     14 + },
     15 + vertical = {
     16 + width = 0.9,
     17 + height = 0.95,
     18 + preview_height = 0.5,
     19 + },
     20 + flex = {
     21 + horizontal = {
     22 + preview_width = 0.9,
     23 + },
     24 + },
     25 + },
     26 + },
     27 + pickers = {
     28 + find_files = { hidden = true },
     29 + buffers = {
     30 + path_display = { "smart" },
     31 + mappings = {
     32 + i = { ["<C-d>"] = function(...) return require("telescope.actions").delete_buffer(...) end },
     33 + n = { ["d"] = function(...) return require("telescope.actions").delete_buffer(...) end },
     34 + },
     35 + },
     36 + },
     37 + },
     38 +}
     39 + 
  • lua/plugins/template-literal-comments.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "bennypowers/template-literal-comments.nvim",
     4 + ft = { "javascript", "typescript" },
     5 + config = true,
     6 +}
     7 + 
  • lua/plugins/trouble.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "folke/trouble.nvim",
     4 + branch = "dev",
     5 + cmd = "Trouble",
     6 + dependencies = {
     7 + "AstroNvim/astrocore",
     8 + opts = function(_, opts)
     9 + local maps, prefix = opts.mappings, "<Leader>x"
     10 + maps.n[prefix] = { desc = "󰒡 Trouble" }
     11 + maps.n[prefix .. "l"] = { "<Cmd>Trouble lsp toggle win.position=right<CR>", desc = "LSP (Trouble)" }
     12 + maps.n[prefix .. "L"] = { "<Cmd>Trouble loclist toggle<CR>", desc = "Location List (Trouble)" }
     13 + maps.n[prefix .. "q"] = { "<Cmd>Trouble qflist toggle<CR>", desc = "Quickfix List (Trouble)" }
     14 + maps.n[prefix .. "s"] = { "<Cmd>Trouble symbols toggle focus=false<CR>", desc = "Symbols (Trouble)" }
     15 + maps.n[prefix .. "x"] = { "<Cmd>Trouble diagnostics toggle<CR>", desc = "Diagnostics (Trouble)" }
     16 + maps.n[prefix .. "X"] =
     17 + { "<Cmd>Trouble diagnostics toggle filter.buf=0<CR>", desc = "Buffer Diagnostics (Trouble)" }
     18 + 
     19 + if require("astrocore").is_available "todo-comments.nvim" then
     20 + maps.n[prefix .. "T"] = { "<Cmd>TodoTrouble<CR>", desc = "TODOs (Trouble)" }
     21 + end
     22 + end,
     23 + },
     24 + opts = function()
     25 + local get_icon = require("astroui").get_icon
     26 + local lspkind_avail, lspkind = pcall(require, "lspkind")
     27 + 
     28 + ---@type trouble.Config
     29 + return {
     30 + keys = {
     31 + ["<Esc>"] = "close",
     32 + ["<C-e>"] = "cancel",
     33 + },
     34 + icons = {
     35 + indent = {
     36 + fold_open = get_icon "FoldOpened",
     37 + fold_closed = get_icon "FoldClosed",
     38 + },
     39 + folder_closed = get_icon "FolderClosed",
     40 + folder_open = get_icon "FolderOpen",
     41 + kinds = lspkind_avail and lspkind.symbol_map,
     42 + },
     43 + }
     44 + end,
     45 +}
     46 + 
  • lua/plugins/venv-selector.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "linux-cultist/venv-selector.nvim",
     4 + cmd = { "VenvSelect", "VenvSelectCached" },
     5 + dependencies = {
     6 + {
     7 + "AstroNvim/astrocore",
     8 + opts = {
     9 + mappings = {
     10 + n = {
     11 + ["<Leader>v"] = { "<Cmd>VenvSelect<CR>", desc = "Activate virtual environment" },
     12 + },
     13 + },
     14 + },
     15 + },
     16 + {
     17 + "rebelot/heirline.nvim",
     18 + opts = function(_, opts)
     19 + opts.statusline[10] = require("astroui.status").component.virtual_env {
     20 + on_click = {
     21 + name = "heirline_virtual_env",
     22 + callback = function()
     23 + vim.schedule(function() vim.cmd.VenvSelect() end)
     24 + end,
     25 + },
     26 + }
     27 + end,
     28 + },
     29 + },
     30 + opts = function()
     31 + local opts = {
     32 + name = { "env", ".env", "venv", ".venv" },
     33 + notify_user_on_activate = false,
     34 + parents = 0,
     35 + }
     36 + if vim.env.MAMBA_HOME then
     37 + opts.anaconda_base_path = vim.env.MAMBA_HOME
     38 + opts.anaconda_envs_path = vim.env.MAMBA_HOME .. "/envs"
     39 + end
     40 + return opts
     41 + end,
     42 +}
     43 + 
  • lua/plugins/vim-matchup.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "nvim-treesitter/nvim-treesitter",
     4 + dependencies = {
     5 + "andymass/vim-matchup",
     6 + dependencies = {
     7 + "AstroNvim/astrocore",
     8 + opts = {
     9 + options = {
     10 + g = {
     11 + matchup_matchparen_offscreen = { method = "popup", fullwidth = 1, highlight = "WinBar", syntax_hl = 1 },
     12 + },
     13 + },
     14 + },
     15 + },
     16 + },
     17 + ---@type TSConfig
     18 + ---@diagnostic disable-next-line: missing-fields
     19 + opts = {
     20 + matchup = { enable = true },
     21 + },
     22 +}
     23 + 
  • lua/plugins/vscode.lua
    ■ ■ ■ ■ ■ ■
     1 +if not vim.g.vscode then return {} end
     2 + 
     3 +local enabled = {}
     4 +vim.tbl_map(function(plugin) enabled[plugin] = true end, {
     5 + -- core plugins
     6 + "lazy.nvim",
     7 + "AstroNvim",
     8 + "astrocore",
     9 + "astroui",
     10 + "Comment.nvim",
     11 + "nvim-autopairs",
     12 + "nvim-treesitter",
     13 + "nvim-ts-autotag",
     14 + "nvim-treesitter-textobjects",
     15 + "nvim-ts-context-commentstring",
     16 + -- more known working
     17 + "flash.nvim",
     18 + "flit.nvim",
     19 + "leap.nvim",
     20 + "mini.ai",
     21 + "mini.comment",
     22 + "mini.surround",
     23 + "vim-easy-align",
     24 + "vim-repeat",
     25 + "vim-sandwich",
     26 +})
     27 + 
     28 +local Config = require "lazy.core.config"
     29 +Config.options.checker.enabled = false
     30 +Config.options.change_detection.enabled = false
     31 +Config.options.defaults.cond = function(plugin) return enabled[plugin.name] end
     32 + 
     33 +---@type LazySpec
     34 +return {
     35 + {
     36 + "AstroNvim/astrocore",
     37 + ---@type AstroCoreOpts
     38 + opts = {
     39 + mappings = {
     40 + n = {
     41 + ["<Leader>ff"] = "<Cmd>Find<CR>",
     42 + ["<Leader>fw"] = "<Cmd>call VSCodeNotify('workbench.action.findInFiles')<CR>",
     43 + ["<Leader>ls"] = "<Cmd>call VSCodeNotify('workbench.action.gotoSymbol')<CR>",
     44 + },
     45 + },
     46 + },
     47 + },
     48 + { "AstroNvim/astroui", opts = { colorscheme = false } },
     49 + { "nvim-treesitter/nvim-treesitter", opts = { highlight = { enable = false } } },
     50 +}
     51 + 
  • lua/plugins/zen-mode.lua
    ■ ■ ■ ■ ■ ■
     1 +---@type LazySpec
     2 +return {
     3 + "folke/zen-mode.nvim",
     4 + cmd = "ZenMode",
     5 + dependencies = {
     6 + "AstroNvim/astrocore",
     7 + opts = {
     8 + mappings = {
     9 + n = {
     10 + ["<Leader>z"] = { "<Cmd>ZenMode<CR>", desc = "Zen Mode" },
     11 + },
     12 + },
     13 + },
     14 + },
     15 + opts = {
     16 + window = {
     17 + width = function() return math.min(120, vim.o.columns * 0.75) end,
     18 + height = 0.9,
     19 + options = {
     20 + number = false,
     21 + relativenumber = false,
     22 + foldcolumn = "0",
     23 + list = false,
     24 + showbreak = "NONE",
     25 + signcolumn = "no",
     26 + },
     27 + },
     28 + plugins = {
     29 + options = {
     30 + cmdheight = 1,
     31 + laststatus = 0,
     32 + },
     33 + },
     34 + on_open = function() -- disable diagnostics, indent blankline, and winbar
     35 + vim.g.diagnostics_mode_old = vim.g.diagnostics_mode
     36 + vim.g.indent_blankline_enabled_old = vim.g.indent_blankline_enabled
     37 + vim.g.miniindentscope_disable_old = vim.g.miniindentscope_disable
     38 + vim.g.winbar_old = vim.wo.winbar
     39 + vim.g.diagnostics_mode = 0
     40 + vim.g.indent_blankline_enabled = false
     41 + vim.g.miniindentscope_disable = true
     42 + vim.wo.winbar = nil
     43 + vim.diagnostic.config(require("astrocore").config.diagnostics[vim.g.diagnostics_mode])
     44 + end,
     45 + on_close = function() -- restore diagnostics, indent blankline, and winbar
     46 + vim.g.diagnostics_mode = vim.g.diagnostics_mode_old
     47 + vim.g.indent_blankline_enabled = vim.g.indent_blankline_enabled_old
     48 + vim.g.miniindentscope_disable = vim.g.miniindentscope_disable_old
     49 + vim.wo.winbar = vim.g.winbar_old
     50 + pcall(vim.cmd.IndentBlanklineRefresh)
     51 + vim.diagnostic.config(require("astrocore").config.diagnostics[vim.g.diagnostics_mode])
     52 + end,
     53 + },
     54 +}
     55 + 
  • mappings.lua
    ■ ■ ■ ■ ■ ■
    1  -local utils = require "user.utils"
    2  -local astro_utils = require "astronvim.utils"
    3  -local mappings = {
    4  - n = {
    5  - -- disable default bindings
    6  - ["<C-Down>"] = false,
    7  - ["<C-Left>"] = false,
    8  - ["<C-Right>"] = false,
    9  - ["<C-Up>"] = false,
    10  - ["<C-q>"] = false,
    11  - ["<C-s>"] = false,
    12  - ["q:"] = ":",
    13  - -- better buffer navigation
    14  - ["]b"] = false,
    15  - ["[b"] = false,
    16  - ["<S-l>"] = {
    17  - function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end,
    18  - desc = "Next buffer",
    19  - },
    20  - ["<S-h>"] = {
    21  - function() require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end,
    22  - desc = "Previous buffer",
    23  - },
    24  - -- better search
    25  - n = { utils.better_search "n", desc = "Next search" },
    26  - N = { utils.better_search "N", desc = "Previous search" },
    27  - -- better increment/decrement
    28  - ["-"] = { "<c-x>", desc = "Descrement number" },
    29  - ["+"] = { "<c-a>", desc = "Increment number" },
    30  - -- resize with arrows
    31  - ["<Up>"] = { function() require("smart-splits").resize_up(2) end, desc = "Resize split up" },
    32  - ["<Down>"] = { function() require("smart-splits").resize_down(2) end, desc = "Resize split down" },
    33  - ["<Left>"] = { function() require("smart-splits").resize_left(2) end, desc = "Resize split left" },
    34  - ["<Right>"] = { function() require("smart-splits").resize_right(2) end, desc = "Resize split right" },
    35  - -- Easy-Align
    36  - ga = { "<Plug>(EasyAlign)", desc = "Easy Align" },
    37  - -- buffer switching
    38  - ["<Tab>"] = {
    39  - function()
    40  - if #vim.t.bufs > 1 then
    41  - require("telescope.builtin").buffers { sort_mru = true, ignore_current_buffer = true }
    42  - else
    43  - astro_utils.notify "No other buffers open"
    44  - end
    45  - end,
    46  - desc = "Switch Buffers",
    47  - },
    48  - ["<leader>n"] = { "<cmd>enew<cr>", desc = "New File" },
    49  - ["<leader>N"] = { "<cmd>tabnew<cr>", desc = "New Tab" },
    50  - ["<leader><cr>"] = { '<esc>/<++><cr>"_c4l', desc = "Next Template" },
    51  - ["<leader>."] = { "<cmd>cd %:p:h<cr>", desc = "Set CWD" },
    52  - -- neogen
    53  - ["<leader>a"] = { desc = "󰏫 Annotate" },
    54  - ["<leader>a<cr>"] = { function() require("neogen").generate() end, desc = "Current" },
    55  - ["<leader>ac"] = { function() require("neogen").generate { type = "class" } end, desc = "Class" },
    56  - ["<leader>af"] = { function() require("neogen").generate { type = "func" } end, desc = "Function" },
    57  - ["<leader>at"] = { function() require("neogen").generate { type = "type" } end, desc = "Type" },
    58  - ["<leader>aF"] = { function() require("neogen").generate { type = "file" } end, desc = "File" },
    59  - -- telescope plugin mappings
    60  - ["<leader>fx"] = {
    61  - function() require("telescope").extensions.live_grep_args.live_grep_args() end,
    62  - desc = "Find words (args)",
    63  - },
    64  - ["<leader>fB"] = { "<cmd>Telescope bibtex<cr>", desc = "Find BibTeX" },
    65  - ["<leader>fe"] = { "<cmd>Telescope file_browser<cr>", desc = "File explorer" },
    66  - ["<leader>fp"] = { function() require("telescope").extensions.projects.projects {} end, desc = "Find projects" },
    67  - ["<leader>fT"] = { "<cmd>TodoTelescope<cr>", desc = "Find TODOs" },
    68  - -- neogit
    69  - ["<leader>gG"] = { function() require("neogit").open() end, desc = "Neogit" },
    70  - -- compiler
    71  - ["<leader>m"] = { desc = "󱁤 Compiler" },
    72  - ["<leader>mk"] = {
    73  - function()
    74  - vim.cmd "silent! write"
    75  - local filename = vim.fn.expand "%:t"
    76  - utils.async_run({ "compiler", vim.fn.expand "%:p" }, function() astro_utils.notify("Compiled " .. filename) end)
    77  - end,
    78  - desc = "Compile",
    79  - },
    80  - ["<leader>ma"] = {
    81  - function()
    82  - vim.notify "Autocompile Started"
    83  - utils.async_run({ "autocomp", vim.fn.expand "%:p" }, function() astro_utils.notify "Autocompile stopped" end)
    84  - end,
    85  - desc = "Auto Compile",
    86  - },
    87  - ["<leader>mv"] = {
    88  - function() vim.fn.jobstart { "opout", vim.fn.expand "%:p" } end,
    89  - desc = "View Output",
    90  - },
    91  - ["<leader>mb"] = {
    92  - function()
    93  - local filename = vim.fn.expand "%:t"
    94  - utils.async_run({
    95  - "pandoc",
    96  - vim.fn.expand "%",
    97  - "--pdf-engine=xelatex",
    98  - "--variable",
    99  - "urlcolor=blue",
    100  - "-t",
    101  - "beamer",
    102  - "-o",
    103  - vim.fn.expand "%:r" .. ".pdf",
    104  - }, function() astro_utils.notify("Compiled " .. filename) end)
    105  - end,
    106  - desc = "Compile Beamer",
    107  - },
    108  - ["<leader>mp"] = {
    109  - function()
    110  - local pdf_path = vim.fn.expand "%:r" .. ".pdf"
    111  - if vim.fn.filereadable(pdf_path) == 1 then vim.fn.jobstart { "pdfpc", pdf_path } end
    112  - end,
    113  - desc = "Present Output",
    114  - },
    115  - ["<leader>ml"] = { function() utils.toggle_qf() end, desc = "Logs" },
    116  - ["<leader>mt"] = { "<cmd>TexlabBuild<cr>", desc = "LaTeX" },
    117  - ["<leader>mf"] = { "<cmd>TexlabForward<cr>", desc = "Forward Search" },
    118  - ["<leader>r"] = { desc = " REPL" },
    119  - ["<leader>rr"] = { "<Plug>Send", desc = "Send to REPL" },
    120  - ["<leader>rl"] = { "<Plug>SendLine", desc = "Send line to REPL" },
    121  - ["<leader>r<cr>"] = { "<cmd>SendHere<cr>", desc = "Set REPL" },
    122  - ["<leader>z"] = { "<cmd>ZenMode<cr>", desc = "Zen Mode" },
    123  - ["<leader>s"] = { desc = "󰛔 Search/Replace" },
    124  - ["<leader>ss"] = { function() require("spectre").toggle() end, desc = "Toggle Spectre" },
    125  - ["<leader>sf"] = { function() require("spectre").open_file_search() end, desc = "Spectre (current file)" },
    126  - ["<leader>sw"] = {
    127  - function() require("spectre").open_visual { select_word = true } end,
    128  - desc = "Spectre (current word)",
    129  - },
    130  - ["<leader>x"] = { desc = "󰒡 Trouble" },
    131  - ["<leader>xx"] = { "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
    132  - ["<leader>xX"] = { "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
    133  - ["<leader>xl"] = { "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
    134  - ["<leader>xq"] = { "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
    135  - ["<leader>xT"] = { "<cmd>TodoTrouble<cr>", desc = "TODOs (Trouble)" },
    136  - },
    137  - v = {
    138  - ["<leader>r"] = { "<Plug>Send", desc = "Send to REPL" },
    139  - ["<leader>s"] = { function() require("spectre").open_visual() end, desc = "Spectre" },
    140  - },
    141  - i = {
    142  - -- signature help, fails silently so attach always
    143  - ["<C-l>"] = { function() vim.lsp.buf.signature_help() end, desc = "Signature help" },
    144  - ["<S-Tab>"] = { "<C-V><Tab>", desc = "Tab character" },
    145  - },
    146  - -- terminal mappings
    147  - t = {
    148  - ["<C-BS>"] = { "<C-\\><C-n>", desc = "Terminal normal mode" },
    149  - ["<esc><esc>"] = { "<C-\\><C-n>:q<cr>", desc = "Terminal quit" },
    150  - },
    151  - x = {
    152  - -- better increment/decrement
    153  - ["+"] = { "g<C-a>", desc = "Increment number" },
    154  - ["-"] = { "g<C-x>", desc = "Descrement number" },
    155  - -- Easy-Align
    156  - ga = { "<Plug>(EasyAlign)", desc = "Easy Align" },
    157  - },
    158  - o = {
    159  - -- line text-objects
    160  - ["il"] = { ":normal vil<cr>", desc = "Inside line text object" },
    161  - ["al"] = { ":normal val<cr>", desc = "Around line text object" },
    162  - },
    163  - ia = vim.fn.has "nvim-0.10" == 1 and {
    164  - mktemp = { function() return "<++>" end, desc = "Insert <++>", expr = true },
    165  - ldate = { function() return os.date "%Y/%m/%d %H:%M:%S -" end, desc = "Y/m/d H:M:S -", expr = true },
    166  - ndate = { function() return os.date "%Y-%m-%d" end, desc = "Y-m-d", expr = true },
    167  - xdate = { function() return os.date "%m/%d/%y" end, desc = "m/d/y", expr = true },
    168  - fdate = { function() return os.date "%B %d, %Y" end, desc = "B d, Y", expr = true },
    169  - Xdate = { function() return os.date "%H:%M" end, desc = "H:M", expr = true },
    170  - Fdate = { function() return os.date "%H:%M:%S" end, desc = "H:M:S", expr = true },
    171  - } or nil,
    172  -}
    173  - 
    174  -return mappings
    175  - 
  • neovim.yml
    ■ ■ ■ ■ ■ ■
     1 +---
     2 +base: lua51
     3 + 
     4 +globals:
     5 + vim:
     6 + any: true
     7 + 
  • options.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - opt = {
    3  - conceallevel = 2, -- enable conceal
    4  - list = true, -- show whitespace characters
    5  - listchars = { tab = "│→", extends = "⟩", precedes = "⟨", trail = "·", nbsp = "␣" },
    6  - showbreak = "↪ ",
    7  - showtabline = (vim.t.bufs and #vim.t.bufs > 1) and 2 or 1,
    8  - spellfile = vim.fn.expand "~/.config/nvim/lua/user/spell/en.utf-8.add",
    9  - splitkeep = "screen",
    10  - swapfile = false,
    11  - thesaurus = vim.fn.expand "~/.config/nvim/lua/user/spell/mthesaur.txt",
    12  - wrap = true, -- soft wrap lines
    13  - },
    14  - g = {
    15  - resession_enabled = true,
    16  - },
    17  -}
    18  - 
  • plugins/catppuccin.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - "catppuccin/nvim",
    3  - name = "catppuccin",
    4  - opts = {
    5  - dim_inactive = { enabled = true, percentage = 0.25 },
    6  - integrations = {
    7  - alpha = false,
    8  - dashboard = false,
    9  - flash = false,
    10  - nvimtree = false,
    11  - ts_rainbow = false,
    12  - ts_rainbow2 = false,
    13  - barbecue = false,
    14  - indent_blankline = false,
    15  - navic = false,
    16  - dropbar = false,
    17  - 
    18  - aerial = true,
    19  - dap = { enabled = true, enable_ui = true },
    20  - headlines = true,
    21  - mason = true,
    22  - native_lsp = { enabled = true, inlay_hints = { background = false } },
    23  - neogit = true,
    24  - neotree = true,
    25  - noice = true,
    26  - notify = true,
    27  - sandwich = true,
    28  - semantic_tokens = true,
    29  - symbols_outline = true,
    30  - telescope = { enabled = true, style = "nvchad" },
    31  - which_key = true,
    32  - },
    33  - custom_highlights = {
    34  - -- disable italics for treesitter highlights
    35  - TabLineFill = { link = "StatusLine" },
    36  - LspInlayHint = { style = { "italic" } },
    37  - ["@parameter"] = { style = {} },
    38  - ["@type.builtin"] = { style = {} },
    39  - ["@namespace"] = { style = {} },
    40  - ["@text.uri"] = { style = { "underline" } },
    41  - ["@tag.attribute"] = { style = {} },
    42  - ["@tag.attribute.tsx"] = { style = {} },
    43  - },
    44  - },
    45  -}
    46  - 
  • plugins/cmp.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - "hrsh7th/nvim-cmp",
    3  - dependencies = {
    4  - "hrsh7th/cmp-calc",
    5  - "hrsh7th/cmp-emoji",
    6  - "jc-doyle/cmp-pandoc-references",
    7  - "kdheepak/cmp-latex-symbols",
    8  - },
    9  - opts = function(_, opts)
    10  - local cmp = require "cmp"
    11  - local compare = require "cmp.config.compare"
    12  - local luasnip = require "luasnip"
    13  - 
    14  - local function has_words_before()
    15  - local line, col = unpack(vim.api.nvim_win_get_cursor(0))
    16  - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match "%s" == nil
    17  - end
    18  - 
    19  - return require("astronvim.utils").extend_tbl(opts, {
    20  - window = { completion = { col_offset = -1, side_padding = 0 } },
    21  - sources = cmp.config.sources {
    22  - { name = "nvim_lsp", priority = 1000 },
    23  - { name = "luasnip", priority = 750 },
    24  - { name = "pandoc_references", priority = 725 },
    25  - { name = "latex_symbols", priority = 700 },
    26  - { name = "emoji", priority = 700 },
    27  - { name = "calc", priority = 650 },
    28  - { name = "path", priority = 500 },
    29  - { name = "buffer", priority = 250 },
    30  - },
    31  - sorting = {
    32  - comparators = {
    33  - compare.offset,
    34  - compare.exact,
    35  - compare.score,
    36  - compare.recently_used,
    37  - function(entry1, entry2)
    38  - local _, entry1_under = entry1.completion_item.label:find "^_+"
    39  - local _, entry2_under = entry2.completion_item.label:find "^_+"
    40  - entry1_under = entry1_under or 0
    41  - entry2_under = entry2_under or 0
    42  - if entry1_under > entry2_under then
    43  - return false
    44  - elseif entry1_under < entry2_under then
    45  - return true
    46  - end
    47  - end,
    48  - compare.kind,
    49  - compare.sort_text,
    50  - compare.length,
    51  - compare.order,
    52  - },
    53  - },
    54  - mapping = {
    55  - -- tab complete
    56  - ["<Tab>"] = cmp.mapping(function(fallback)
    57  - if cmp.visible() and has_words_before() then
    58  - cmp.confirm { select = true }
    59  - else
    60  - fallback()
    61  - end
    62  - end, { "i", "s" }),
    63  - -- <C-n> and <C-p> for navigating snippets
    64  - ["<C-n>"] = cmp.mapping(function()
    65  - if luasnip.jumpable(1) then luasnip.jump(1) end
    66  - end, { "i", "s" }),
    67  - ["<C-p>"] = cmp.mapping(function()
    68  - if luasnip.jumpable(-1) then luasnip.jump(-1) end
    69  - end, { "i", "s" }),
    70  - -- <C-j> for starting completion
    71  - ["<C-j>"] = cmp.mapping(function()
    72  - if cmp.visible() then
    73  - cmp.select_next_item { behavior = cmp.SelectBehavior.Insert }
    74  - else
    75  - cmp.complete()
    76  - end
    77  - end, { "i", "s" }),
    78  - },
    79  - })
    80  - end,
    81  -}
    82  - 
  • plugins/core.lua
    ■ ■ ■ ■ ■ ■
    1  -local get_icon = require("astronvim.utils").get_icon
    2  - 
    3  -return {
    4  - { "goolord/alpha-nvim", enabled = false },
    5  - { "max397574/better-escape.nvim", enabled = false },
    6  - { "lukas-reineke/indent-blankline.nvim", enabled = false },
    7  - 
    8  - { "mfussenegger/nvim-dap", dependencies = {
    9  - { "theHamsta/nvim-dap-virtual-text", config = true },
    10  - } },
    11  - { "akinsho/toggleterm.nvim", opts = {
    12  - terminal_mappings = false,
    13  - } },
    14  - { "rcarriga/nvim-notify", opts = {
    15  - timeout = 0,
    16  - } },
    17  - {
    18  - "mrjones2014/smart-splits.nvim",
    19  - build = "./kitty/install-kittens.bash",
    20  - opts = function(_, opts) opts.at_edge = require("smart-splits.types").AtEdgeBehavior.stop end,
    21  - },
    22  - {
    23  - "lewis6991/gitsigns.nvim",
    24  - opts = {
    25  - signcolumn = false,
    26  - numhl = true,
    27  - current_line_blame_opts = { ignore_whitespace = true },
    28  - },
    29  - },
    30  - {
    31  - "nvim-neo-tree/neo-tree.nvim",
    32  - opts = {
    33  - filesystem = {
    34  - hijack_netrw_behavior = "open_default",
    35  - filtered_items = {
    36  - always_show = { ".github", ".gitignore" },
    37  - },
    38  - },
    39  - },
    40  - },
    41  -}
    42  - 
  • plugins/editor.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - {
    3  - "folke/zen-mode.nvim",
    4  - cmd = "ZenMode",
    5  - opts = {
    6  - window = {
    7  - backdrop = 1,
    8  - width = function() return math.min(120, vim.o.columns * 0.75) end,
    9  - height = 0.9,
    10  - options = {
    11  - number = false,
    12  - relativenumber = false,
    13  - foldcolumn = "0",
    14  - list = false,
    15  - showbreak = "NONE",
    16  - signcolumn = "no",
    17  - },
    18  - },
    19  - plugins = {
    20  - options = {
    21  - cmdheight = 1,
    22  - laststatus = 0,
    23  - },
    24  - },
    25  - on_open = function() -- disable diagnostics, indent blankline, and winbar
    26  - vim.g.diagnostics_mode_old = vim.g.diagnostics_mode
    27  - vim.g.indent_blankline_enabled_old = vim.g.indent_blankline_enabled
    28  - vim.g.winbar_old = vim.wo.winbar
    29  - vim.g.diagnostics_mode = 0
    30  - vim.g.indent_blankline_enabled = false
    31  - vim.wo.winbar = nil
    32  - vim.diagnostic.config(require("astronvim.utils.lsp").diagnostics[vim.g.diagnostics_mode])
    33  - end,
    34  - on_close = function() -- restore diagnostics, indent blankline, and winbar
    35  - vim.g.diagnostics_mode = vim.g.diagnostics_mode_old
    36  - vim.g.indent_blankline_enabled = vim.g.indent_blankline_enabled_old
    37  - vim.wo.winbar = vim.g.winbar_old
    38  - vim.diagnostic.config(require("astronvim.utils.lsp").diagnostics[vim.g.diagnostics_mode])
    39  - end,
    40  - },
    41  - },
    42  - {
    43  - "echasnovski/mini.move",
    44  - keys = {
    45  - { "<M-l>", mode = { "n", "v" } },
    46  - { "<M-k>", mode = { "n", "v" } },
    47  - { "<M-j>", mode = { "n", "v" } },
    48  - { "<M-h>", mode = { "n", "v" } },
    49  - },
    50  - opts = {},
    51  - },
    52  - {
    53  - "arsham/indent-tools.nvim",
    54  - dependencies = { "arsham/arshlib.nvim" },
    55  - event = "User AstroFile",
    56  - config = function() require("indent-tools").config {} end,
    57  - },
    58  - {
    59  - "danymat/neogen",
    60  - cmd = "Neogen",
    61  - opts = {
    62  - snippet_engine = "luasnip",
    63  - languages = {
    64  - lua = { template = { annotation_convention = "emmylua" } },
    65  - typescript = { template = { annotation_convention = "tsdoc" } },
    66  - typescriptreact = { template = { annotation_convention = "tsdoc" } },
    67  - },
    68  - },
    69  - },
    70  - {
    71  - "lukas-reineke/headlines.nvim",
    72  - dependencies = "nvim-treesitter/nvim-treesitter",
    73  - ft = "markdown",
    74  - opts = {},
    75  - },
    76  - {
    77  - "folke/todo-comments.nvim",
    78  - event = "User AstroFile",
    79  - cmd = { "TodoTrouble", "TodoTelescope", "TodoLocList", "TodoQuickFix" },
    80  - opts = {},
    81  - },
    82  - {
    83  - "folke/trouble.nvim",
    84  - cmd = { "TroubleToggle", "Trouble" },
    85  - opts = {
    86  - use_diagnostic_signs = true,
    87  - action_keys = {
    88  - close = { "q", "<esc>" },
    89  - cancel = "<c-e>",
    90  - },
    91  - },
    92  - },
    93  - {
    94  - "nvim-pack/nvim-spectre",
    95  - cmd = "Spectre",
    96  - opts = function()
    97  - local prefix = "<leader>s"
    98  - return {
    99  - open_cmd = "new",
    100  - mapping = {
    101  - send_to_qf = { map = prefix .. "q" },
    102  - replace_cmd = { map = prefix .. "c" },
    103  - show_option_menu = { map = prefix .. "o" },
    104  - run_current_replace = { map = prefix .. "C" },
    105  - run_replace = { map = prefix .. "R" },
    106  - change_view_mode = { map = prefix .. "v" },
    107  - resume_last_search = { map = prefix .. "l" },
    108  - },
    109  - }
    110  - end,
    111  - },
    112  - { "junegunn/vim-easy-align", event = "User AstroFile" },
    113  - {
    114  - "echasnovski/mini.surround",
    115  - keys = {
    116  - { "sa", desc = "Add surrounding", mode = { "n", "v" } },
    117  - { "sd", desc = "Delete surrounding" },
    118  - { "sf", desc = "Find right surrounding" },
    119  - { "sF", desc = "Find left surrounding" },
    120  - { "sh", desc = "Highlight surrounding" },
    121  - { "sr", desc = "Replace surrounding" },
    122  - { "sn", desc = "Update `MiniSurround.config.n_lines`" },
    123  - },
    124  - opts = { n_lines = 200 },
    125  - },
    126  - { "wakatime/vim-wakatime", event = "User AstroFile" },
    127  -}
    128  - 
  • plugins/git.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - "NeogitOrg/neogit",
    3  - cmd = "Neogit",
    4  - dependencies = {
    5  - {
    6  - "sindrets/diffview.nvim",
    7  - event = "User AstroGitFile",
    8  - opts = function()
    9  - local actions = require "diffview.actions"
    10  - local utils = require "astronvim.utils" -- astronvim utils
    11  - 
    12  - local prefix = "<leader>D"
    13  - 
    14  - utils.set_mappings {
    15  - n = {
    16  - [prefix] = { name = " Diff View" },
    17  - [prefix .. "<cr>"] = { "<cmd>DiffviewOpen<cr>", desc = "Open DiffView" },
    18  - [prefix .. "h"] = { "<cmd>DiffviewFileHistory %<cr>", desc = "Open DiffView File History" },
    19  - [prefix .. "H"] = { "<cmd>DiffviewFileHistory<cr>", desc = "Open DiffView Branch History" },
    20  - },
    21  - }
    22  - 
    23  - local build_keymaps = function(maps)
    24  - local out = {}
    25  - local i = 1
    26  - for lhs, def in
    27  - pairs(utils.extend_tbl(maps, {
    28  - [prefix .. "q"] = { "<cmd>DiffviewClose<cr>", desc = "Quit Diffview" }, -- Toggle the file panel.
    29  - ["]D"] = { actions.select_next_entry, desc = "Next Difference" }, -- Open the diff for the next file
    30  - ["[D"] = { actions.select_prev_entry, desc = "Previous Difference" }, -- Open the diff for the previous file
    31  - ["[C"] = { actions.prev_conflict, desc = "Next Conflict" }, -- In the merge_tool: jump to the previous conflict
    32  - ["]C"] = { actions.next_conflict, desc = "Previous Conflict" }, -- In the merge_tool: jump to the next conflict
    33  - ["Cl"] = { actions.cycle_layout, desc = "Cycle Diff Layout" }, -- Cycle through available layouts.
    34  - ["Ct"] = { actions.listing_style, desc = "Cycle Tree Style" }, -- Cycle through available layouts.
    35  - ["<leader>e"] = { actions.toggle_files, desc = "Toggle Explorer" }, -- Toggle the file panel.
    36  - ["<leader>o"] = { actions.focus_files, desc = "Focus Explorer" }, -- Bring focus to the file panel
    37  - }))
    38  - do
    39  - local opts
    40  - local rhs = def
    41  - local mode = { "n" }
    42  - if type(def) == "table" then
    43  - if def.mode then mode = def.mode end
    44  - rhs = def[1]
    45  - def[1] = nil
    46  - def.mode = nil
    47  - opts = def
    48  - end
    49  - out[i] = { mode, lhs, rhs, opts }
    50  - i = i + 1
    51  - end
    52  - return out
    53  - end
    54  - 
    55  - return {
    56  - enhanced_diff_hl = true,
    57  - view = {
    58  - merge_tool = { layout = "diff3_mixed" },
    59  - },
    60  - hooks = { diff_buf_read = function(bufnr) vim.b[bufnr].view_activated = false end },
    61  - keymaps = {
    62  - disable_defaults = true,
    63  - view = build_keymaps {
    64  - [prefix .. "o"] = { actions.conflict_choose "ours", desc = "Take Ours" }, -- Choose the OURS version of a conflict
    65  - [prefix .. "t"] = { actions.conflict_choose "theirs", desc = "Take Theirs" }, -- Choose the THEIRS version of a conflict
    66  - [prefix .. "b"] = { actions.conflict_choose "base", desc = "Take Base" }, -- Choose the BASE version of a conflict
    67  - [prefix .. "a"] = { actions.conflict_choose "all", desc = "Take All" }, -- Choose all the versions of a conflict
    68  - [prefix .. "0"] = { actions.conflict_choose "none", desc = "Take None" }, -- Delete the conflict region
    69  - },
    70  - diff3 = build_keymaps {
    71  - [prefix .. "O"] = { actions.diffget "ours", mode = { "n", "x" }, desc = "Get Our Diff" }, -- Obtain the diff hunk from the OURS version of the file
    72  - [prefix .. "T"] = { actions.diffget "theirs", mode = { "n", "x" }, desc = "Get Their Diff" }, -- Obtain the diff hunk from the THEIRS version of the file
    73  - },
    74  - diff4 = build_keymaps {
    75  - [prefix .. "B"] = { actions.diffget "base", mode = { "n", "x" }, desc = "Get Base Diff" }, -- Obtain the diff hunk from the OURS version of the file
    76  - [prefix .. "O"] = { actions.diffget "ours", mode = { "n", "x" }, desc = "Get Our Diff" }, -- Obtain the diff hunk from the OURS version of the file
    77  - [prefix .. "T"] = { actions.diffget "theirs", mode = { "n", "x" }, desc = "Get Their Diff" }, -- Obtain the diff hunk from the THEIRS version of the file
    78  - },
    79  - file_panel = build_keymaps {
    80  - j = actions.next_entry, -- Bring the cursor to the next file entry
    81  - k = actions.prev_entry, -- Bring the cursor to the previous file entry.
    82  - o = actions.select_entry,
    83  - S = actions.stage_all, -- Stage all entries.
    84  - U = actions.unstage_all, -- Unstage all entries.
    85  - X = actions.restore_entry, -- Restore entry to the state on the left side.
    86  - L = actions.open_commit_log, -- Open the commit log panel.
    87  - Cf = { actions.toggle_flatten_dirs, desc = "Flatten" }, -- Flatten empty subdirectories in tree listing style.
    88  - R = actions.refresh_files, -- Update stats and entries in the file list.
    89  - ["-"] = actions.toggle_stage_entry, -- Stage / unstage the selected entry.
    90  - ["<down>"] = actions.next_entry,
    91  - ["<up>"] = actions.prev_entry,
    92  - ["<cr>"] = actions.select_entry, -- Open the diff for the selected entry.
    93  - ["<2-LeftMouse>"] = actions.select_entry,
    94  - ["<c-b>"] = actions.scroll_view(-0.25), -- Scroll the view up
    95  - ["<c-f>"] = actions.scroll_view(0.25), -- Scroll the view down
    96  - ["<tab>"] = actions.select_next_entry,
    97  - ["<s-tab>"] = actions.select_prev_entry,
    98  - },
    99  - file_history_panel = build_keymaps {
    100  - j = actions.next_entry,
    101  - k = actions.prev_entry,
    102  - o = actions.select_entry,
    103  - y = actions.copy_hash, -- Copy the commit hash of the entry under the cursor
    104  - L = actions.open_commit_log,
    105  - zR = { actions.open_all_folds, desc = "Open all folds" },
    106  - zM = { actions.close_all_folds, desc = "Close all folds" },
    107  - ["?"] = { actions.options, desc = "Options" }, -- Open the option panel
    108  - ["<down>"] = actions.next_entry,
    109  - ["<up>"] = actions.prev_entry,
    110  - ["<cr>"] = actions.select_entry,
    111  - ["<2-LeftMouse>"] = actions.select_entry,
    112  - ["<C-A-d>"] = actions.open_in_diffview, -- Open the entry under the cursor in a diffview
    113  - ["<c-b>"] = actions.scroll_view(-0.25),
    114  - ["<c-f>"] = actions.scroll_view(0.25),
    115  - ["<tab>"] = actions.select_next_entry,
    116  - ["<s-tab>"] = actions.select_prev_entry,
    117  - },
    118  - option_panel = {
    119  - q = actions.close,
    120  - o = actions.select_entry,
    121  - ["<cr>"] = actions.select_entry,
    122  - ["<2-LeftMouse"] = actions.select_entry,
    123  - },
    124  - },
    125  - }
    126  - end,
    127  - },
    128  - },
    129  - opts = function()
    130  - local get_icon = require("astronvim.utils").get_icon
    131  - local fold_signs = { get_icon "FoldClosed", get_icon "FoldOpened" }
    132  - return {
    133  - disable_builtin_notifications = true,
    134  - telescope_sorter = function() return require("telescope").extensions.fzy_native.native_fzy_sorter() end,
    135  - integrations = { telescope = true, diffview = true },
    136  - signs = { section = fold_signs, item = fold_signs },
    137  - }
    138  - end,
    139  -}
    140  - 
  • plugins/heirline.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - "rebelot/heirline.nvim",
    3  - opts = function(_, opts)
    4  - local status = require "astronvim.utils.status"
    5  - opts.statusline[3] = status.component.file_info { filetype = {}, filename = false }
    6  - 
    7  - local path_func = status.provider.filename { modify = ":.:h", fallback = "" }
    8  - opts.winbar[1][1] = status.component.separated_path { path_func = path_func }
    9  - opts.winbar[2] = {
    10  - status.component.separated_path { path_func = path_func },
    11  - status.component.file_info { -- add file_info to breadcrumbs
    12  - file_icon = { hl = status.hl.filetype_color, padding = { left = 0 } },
    13  - file_modified = false,
    14  - file_read_only = false,
    15  - hl = status.hl.get_attributes("winbar", true),
    16  - surround = false,
    17  - update = "BufEnter",
    18  - },
    19  - status.component.breadcrumbs {
    20  - icon = { hl = true },
    21  - hl = status.hl.get_attributes("winbar", true),
    22  - prefix = true,
    23  - padding = { left = 0 },
    24  - },
    25  - }
    26  - return opts
    27  - end,
    28  -}
    29  - 
  • plugins/lsp.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - {
    3  - "jose-elias-alvarez/typescript.nvim",
    4  - init = function() table.insert(astronvim.lsp.skip_setup, "tsserver") end,
    5  - ft = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
    6  - opts = function() return { server = require("astronvim.utils.lsp").config "tsserver" } end,
    7  - },
    8  - {
    9  - "p00f/clangd_extensions.nvim",
    10  - init = function() table.insert(astronvim.lsp.skip_setup, "clangd") end,
    11  - ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
    12  - opts = function()
    13  - return {
    14  - server = require("astronvim.utils.lsp").config "clangd",
    15  - extensions = { autoSetHints = false },
    16  - }
    17  - end,
    18  - },
    19  -}
    20  - 
  • plugins/lspkind.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - "onsails/lspkind.nvim",
    3  - opts = function(_, opts)
    4  - -- use codicons preset
    5  - opts.preset = "codicons"
    6  - -- set some missing symbol types
    7  - opts.symbol_map = {
    8  - Array = "",
    9  - Boolean = "",
    10  - Key = "",
    11  - Namespace = "",
    12  - Null = "",
    13  - Number = "",
    14  - Object = "",
    15  - Package = "",
    16  - String = "",
    17  - }
    18  - return opts
    19  - end,
    20  -}
    21  - 
  • plugins/mason.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - { "williamboman/mason.nvim", opts = { PATH = "append" } },
    3  - {
    4  - "williamboman/mason-lspconfig.nvim",
    5  - opts = {
    6  - ensure_installed = {
    7  - "ansiblels",
    8  - "clangd",
    9  - "cssls",
    10  - "gopls",
    11  - "html",
    12  - "intelephense",
    13  - "marksman",
    14  - "neocmake",
    15  - "jsonls",
    16  - "julials",
    17  - "pyright",
    18  - "lua_ls",
    19  - "taplo",
    20  - "texlab",
    21  - "tsserver",
    22  - "yamlls",
    23  - },
    24  - },
    25  - },
    26  - {
    27  - "jay-babu/mason-null-ls.nvim",
    28  - opts = {
    29  - ensure_installed = {
    30  - "shellcheck",
    31  - "stylua",
    32  - "black",
    33  - "isort",
    34  - "prettierd",
    35  - "shfmt",
    36  - "shellcheck",
    37  - },
    38  - handlers = {
    39  - taplo = function() end, -- disable taplo in null-ls, it's taken care of by lspconfig
    40  - },
    41  - },
    42  - },
    43  - {
    44  - "jay-babu/mason-nvim-dap.nvim",
    45  - opts = {
    46  - ensure_installed = {
    47  - "bash",
    48  - "cppdbg",
    49  - "delve",
    50  - "js",
    51  - "php",
    52  - "python",
    53  - },
    54  - handlers = {
    55  - js = function()
    56  - local dap = require "dap"
    57  - dap.adapters["pwa-node"] = {
    58  - type = "server",
    59  - port = "${port}",
    60  - executable = { command = vim.fn.exepath "js-debug-adapter", args = { "${port}" } },
    61  - }
    62  - 
    63  - local pwa_node_attach = {
    64  - type = "pwa-node",
    65  - request = "launch",
    66  - name = "js-debug: Attach to Process (pwa-node)",
    67  - proccessId = require("dap.utils").pick_process,
    68  - cwd = "${workspaceFolder}",
    69  - }
    70  - local function deno(cmd)
    71  - cmd = cmd or "run"
    72  - return {
    73  - request = "launch",
    74  - name = ("js-debug: Launch Current File (deno %s)"):format(cmd),
    75  - type = "pwa-node",
    76  - program = "${file}",
    77  - cwd = "${workspaceFolder}",
    78  - runtimeExecutable = vim.fn.exepath "deno",
    79  - runtimeArgs = { cmd, "--inspect-brk" },
    80  - attachSimplePort = 9229,
    81  - }
    82  - end
    83  - local function typescript(args)
    84  - return {
    85  - type = "pwa-node",
    86  - request = "launch",
    87  - name = ("js-debug: Launch Current File (ts-node%s)"):format(
    88  - args and (" " .. table.concat(args, " ")) or ""
    89  - ),
    90  - program = "${file}",
    91  - cwd = "${workspaceFolder}",
    92  - runtimeExecutable = "ts-node",
    93  - runtimeArgs = args,
    94  - sourceMaps = true,
    95  - protocol = "inspector",
    96  - console = "integratedTerminal",
    97  - resolveSourceMapLocations = {
    98  - "${workspaceFolder}/dist/**/*.js",
    99  - "${workspaceFolder}/**",
    100  - "!**/node_modules/**",
    101  - },
    102  - }
    103  - end
    104  - for _, language in ipairs { "javascript", "javascriptreact" } do
    105  - dap.configurations[language] = {
    106  - {
    107  - type = "pwa-node",
    108  - request = "launch",
    109  - name = "js-debug: Launch File (pwa-node)",
    110  - program = "${file}",
    111  - cwd = "${workspaceFolder}",
    112  - },
    113  - deno "run",
    114  - deno "test",
    115  - pwa_node_attach,
    116  - }
    117  - end
    118  - for _, language in ipairs { "typescript", "typescriptreact" } do
    119  - dap.configurations[language] = {
    120  - typescript(),
    121  - typescript { "--esm" },
    122  - deno "run",
    123  - deno "test",
    124  - pwa_node_attach,
    125  - }
    126  - end
    127  - end,
    128  - },
    129  - },
    130  - },
    131  -}
    132  - 
  • plugins/repl.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - {
    3  - "jupyter-vim/jupyter-vim",
    4  - ft = { "pyhon", "julia" },
    5  - config = function()
    6  - require("astronvim.utils").set_mappings {
    7  - n = {
    8  - ["<leader>J"] = { "<cmd>JupyterConnect<cr>", desc = "Connect to Jupyter" },
    9  - ["<leader>j"] = { "<Plug>JupyterRunTextObj", desc = "Send to Jupyter" },
    10  - },
    11  - v = {
    12  - ["<leader>j"] = { "<Plug>JupyterRunVisual", desc = "Send to Jupyter" },
    13  - },
    14  - }
    15  - end,
    16  - },
    17  - {
    18  - "mtikekar/nvim-send-to-term",
    19  - init = function() vim.g.send_disable_mapping = true end,
    20  - keys = { "<Plug>Send", "<Plug>SendLine" },
    21  - cmd = "SendHere",
    22  - },
    23  -}
    24  - 
  • plugins/telescope.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - "nvim-telescope/telescope.nvim",
    3  - dependencies = {
    4  - { "nvim-telescope/telescope-fzf-native.nvim", enabled = false },
    5  - "nvim-telescope/telescope-fzy-native.nvim",
    6  - "nvim-telescope/telescope-live-grep-args.nvim",
    7  - "nvim-telescope/telescope-hop.nvim",
    8  - "nvim-telescope/telescope-bibtex.nvim",
    9  - "nvim-telescope/telescope-file-browser.nvim",
    10  - {
    11  - "jay-babu/project.nvim",
    12  - name = "project_nvim",
    13  - event = "VeryLazy",
    14  - opts = { ignore_lsp = { "lua_ls", "julials" } },
    15  - },
    16  - },
    17  - opts = function(_, opts)
    18  - local telescope = require "telescope"
    19  - local actions = require "telescope.actions"
    20  - local fb_actions = require("telescope").extensions.file_browser.actions
    21  - local lga_actions = require "telescope-live-grep-args.actions"
    22  - local hop = telescope.extensions.hop
    23  - return require("astronvim.utils").extend_tbl(opts, {
    24  - defaults = {
    25  - results_title = "",
    26  - selection_caret = " ",
    27  - layout_config = {
    28  - width = 0.90,
    29  - height = 0.85,
    30  - preview_cutoff = 120,
    31  - horizontal = {
    32  - preview_width = 0.6,
    33  - },
    34  - vertical = {
    35  - width = 0.9,
    36  - height = 0.95,
    37  - preview_height = 0.5,
    38  - },
    39  - flex = {
    40  - horizontal = {
    41  - preview_width = 0.9,
    42  - },
    43  - },
    44  - },
    45  - mappings = {
    46  - i = {
    47  - ["<C-h>"] = hop.hop,
    48  - ["<C-space>"] = function(prompt_bufnr)
    49  - hop._hop_loop(
    50  - prompt_bufnr,
    51  - { callback = actions.toggle_selection, loop_callback = actions.send_selected_to_qflist }
    52  - )
    53  - end,
    54  - },
    55  - },
    56  - },
    57  - extensions = {
    58  - bibtex = { context = true, context_fallback = false },
    59  - file_browser = {
    60  - mappings = {
    61  - i = {
    62  - ["<C-z>"] = fb_actions.toggle_hidden,
    63  - },
    64  - n = {
    65  - z = fb_actions.toggle_hidden,
    66  - },
    67  - },
    68  - },
    69  - live_grep_args = {
    70  - auto_quoting = true, -- enable/disable auto-quoting
    71  - mappings = { -- extend mappings
    72  - i = {
    73  - ["<C-a>"] = lga_actions.quote_prompt(),
    74  - ["<C-f>"] = lga_actions.quote_prompt { postfix = " --iglob " },
    75  - },
    76  - },
    77  - },
    78  - },
    79  - pickers = {
    80  - find_files = {
    81  - hidden = true,
    82  - find_command = function(cfg)
    83  - local find_command = { "rg", "--files", "--color", "never" }
    84  - if not cfg.no_ignore then vim.list_extend(find_command, { "--glob", "!**/.git/**" }) end
    85  - return find_command
    86  - end,
    87  - },
    88  - buffers = {
    89  - path_display = { "smart" },
    90  - mappings = {
    91  - i = { ["<c-d>"] = actions.delete_buffer },
    92  - n = { ["d"] = actions.delete_buffer },
    93  - },
    94  - },
    95  - },
    96  - })
    97  - end,
    98  - config = function(...)
    99  - require "plugins.configs.telescope"(...)
    100  - local telescope = require "telescope"
    101  - telescope.load_extension "fzy_native"
    102  - telescope.load_extension "live_grep_args"
    103  - telescope.load_extension "bibtex"
    104  - telescope.load_extension "file_browser"
    105  - telescope.load_extension "projects"
    106  - end,
    107  -}
    108  - 
  • plugins/treesitter.lua
    ■ ■ ■ ■ ■ ■
    1  -return {
    2  - {
    3  - "nvim-treesitter/nvim-treesitter",
    4  - dependencies = {
    5  - { "andymass/vim-matchup", init = function() vim.g.matchup_matchparen_deferred = 1 end },
    6  - {
    7  - "HiPhish/rainbow-delimiters.nvim",
    8  - opts = function()
    9  - return {
    10  - strategy = {
    11  - [""] = function()
    12  - if not vim.b.large_buf then return require("rainbow-delimiters").strategy.global end
    13  - end,
    14  - },
    15  - }
    16  - end,
    17  - config = function(_, opts) require "rainbow-delimiters.setup"(opts) end,
    18  - },
    19  - },
    20  - opts = {
    21  - auto_install = vim.fn.executable "tree-sitter" == 1,
    22  - matchup = { enable = true },
    23  - },
    24  - },
    25  -}
    26  - 
  • polish.lua
    ■ ■ ■ ■ ■ ■
    1  -return function()
    2  - local function yaml_ft(path, bufnr)
    3  - -- get content of buffer as string
    4  - local content = vim.filetype.getlines(bufnr)
    5  - if type(content) == "table" then content = table.concat(content, "\n") end
    6  - 
    7  - -- check if file is in roles, tasks, or handlers folder
    8  - local path_regex = vim.regex "(tasks\\|roles\\|handlers)/"
    9  - if path_regex and path_regex:match_str(path) then return "yaml.ansible" end
    10  - -- check for known ansible playbook text and if found, return yaml.ansible
    11  - local regex = vim.regex "hosts:\\|tasks:"
    12  - if regex and regex:match_str(content) then return "yaml.ansible" end
    13  - 
    14  - -- return yaml if nothing else
    15  - return "yaml"
    16  - end
    17  - 
    18  - vim.filetype.add {
    19  - extension = {
    20  - qmd = "markdown",
    21  - yml = yaml_ft,
    22  - yaml = yaml_ft,
    23  - },
    24  - pattern = {
    25  - ["/tmp/neomutt.*"] = "markdown",
    26  - },
    27  - }
    28  - 
    29  - require "user.autocmds"
    30  -end
    31  - 
  • selene.toml
    ■ ■ ■ ■ ■ ■
     1 +std = "neovim"
     2 + 
     3 +[rules]
     4 +global_usage = "allow"
     5 +if_same_then_else = "allow"
     6 +incorrect_standard_library_use = "allow"
     7 +mixed_table = "allow"
     8 +multiple_statements = "allow"
     9 + 
  • updater.lua
    ■ ■ ■ ■ ■ ■
    1  -return { channel = "nightly", skip_prompts = true }
    2  - 
  • utils.lua
    ■ ■ ■ ■ ■ ■
    1  -local M = {}
    2  - 
    3  -function M.vim_opt_toggle(opt, on, off, name)
    4  - if on == nil then on = true end
    5  - if off == nil then off = false end
    6  - if not name then name = opt end
    7  - local is_off = vim.opt[opt]:get() == off
    8  - vim.opt[opt] = is_off and on or off
    9  - require("astronvim.utils").notify(name .. " " .. (is_off and "Enabled" or "Disabled"))
    10  -end
    11  - 
    12  -function M.async_run(cmd, on_finish)
    13  - local lines = { "" }
    14  - 
    15  - local function on_event(_, data, event)
    16  - if (event == "stdout" or event == "stderr") and data then vim.list_extend(lines, data) end
    17  - 
    18  - if event == "exit" then
    19  - vim.fn.setqflist({}, " ", {
    20  - title = table.concat(cmd, " "),
    21  - lines = lines,
    22  - efm = "%f:%l:%c: %t%n %m",
    23  - })
    24  - if on_finish then on_finish() end
    25  - end
    26  - end
    27  - 
    28  - vim.fn.jobstart(cmd, {
    29  - on_stdout = on_event,
    30  - on_stderr = on_event,
    31  - on_exit = on_event,
    32  - stdout_buffered = true,
    33  - stderr_buffered = true,
    34  - })
    35  -end
    36  - 
    37  -function M.toggle_qf()
    38  - local qf_exists = false
    39  - for _, win in pairs(vim.fn.getwininfo()) do
    40  - if win["quickfix"] == 1 then
    41  - qf_exists = true
    42  - break
    43  - end
    44  - end
    45  - if qf_exists then
    46  - vim.cmd.cclose()
    47  - elseif not vim.tbl_isempty(vim.fn.getqflist()) then
    48  - vim.cmd.copen()
    49  - end
    50  -end
    51  - 
    52  -function M.better_search(key)
    53  - return function()
    54  - local searched, error =
    55  - pcall(vim.cmd.normal, { args = { (vim.v.count > 0 and vim.v.count or "") .. key }, bang = true })
    56  - if not searched and type(error) == "string" then require("astronvim.utils").notify(error, vim.log.levels.ERROR) end
    57  - end
    58  -end
    59  - 
    60  -return M
    61  - 
pull request 1 of 1
Submitter Micah Halter
Target master
Source v4
Assignees
Merge Strategy
Create Merge Commit If Necessary
Watchers (1)
Reference
pull request AstroNvim_user#5
Please wait...
Page is in error, reload to recover