feat: bootstrap neovim configuration with Lazy.nvim and AstroNvim

This commit is contained in:
Prad N committed 2025-03-07 15:53:52 -05:00
commit 08d5780f92
16 files changed
+731

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
-- AstroCommunity: import any community modules here
-- We import this file in `lazy_setup.lua` before the `plugins/` folder.
-- This guarantees that the specs are processed before any user plugins.
---@type LazySpec
return {
"AstroNvim/astrocommunity",
{ import = "astrocommunity.pack.docker" },
{ import = "astrocommunity.pack.lua" },
{ import = "astrocommunity.pack.go" },
{ import = "astrocommunity.pack.markdown" },
{ import = "astrocommunity.pack.templ" },
{ import = "astrocommunity.pack.tailwindcss" },
{ import = "astrocommunity.pack.typescript" },
{ import = "astrocommunity.pack.yaml" },
{ import = "astrocommunity.code-runner.overseer-nvim" },
{ import = "astrocommunity.lsp.inc-rename-nvim" },
{ import = "astrocommunity.lsp.nvim-lsp-file-operations" },
{ import = "astrocommunity.bars-and-lines.bufferline-nvim" },
{ import = "astrocommunity.colorscheme.cyberdream-nvim" },
{ import = "astrocommunity.utility.telescope-lazy-nvim" },
{ import = "astrocommunity.completion.supermaven-nvim" },
{ import = "astrocommunity.completion.blink-cmp" },
}
+31
View File
@@ -0,0 +1,31 @@
require("lazy").setup({
{
"AstroNvim/AstroNvim",
import = "astronvim.plugins",
opts = { -- AstroNvim options must be set here with the `import` key
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up
icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
update_notifications = false, -- Enable/disable notification about running `:Lazy update` twice to update pinned plugins
},
},
{ import = "community" },
{ import = "plugins" },
} --[[@as LazySpec]], {
-- Configure any other `lazy.nvim` configuration options here
install = { colorscheme = { "cyberdream" } },
ui = { backdrop = 100 },
performance = {
rtp = {
-- disable some rtp plugins, add more to your liking
disabled_plugins = {
"gzip",
"netrwPlugin",
"tarPlugin",
"tohtml",
"zipPlugin",
},
},
},
} --[[@as LazyConfig]])
+61
View File
@@ -0,0 +1,61 @@
local files = require "overseer.files"
local overseer = require "overseer"
---@type overseer.TemplateFileDefinition
local tmpl = {
priority = 60,
params = {
args = { optional = true, type = "list", delimiter = " " },
cwd = { optional = true },
},
builder = function(params)
return {
cmd = { "sh" },
args = { "-c", table.concat(params.args, " && ") },
cwd = params.cwd,
}
end,
}
---@param opts overseer.SearchParams
---@return string|nil
local function get_devbox_file(opts)
return vim.fs.find("devbox.json", {
upward = true,
type = "file",
path = opts.dir,
})[1]
end
return {
cache_key = function(opts) return get_devbox_file(opts) end,
condition = {
callback = function(opts)
local devbox_file = get_devbox_file(opts)
if not devbox_file then return false, "No devbox.json file found" end
return true
end,
},
generator = function(opts, cb)
local devbox_file = get_devbox_file(opts)
if not devbox_file then
cb {}
return
end
local data = files.load_json_file(devbox_file)
local ret = {}
if data.shell and data.shell.scripts then
for k, v in pairs(data.shell.scripts) do
table.insert(
ret,
overseer.wrap_template(
tmpl,
{ name = string.format("devbox run %s", k) },
{ args = v, cwd = vim.fs.dirname(devbox_file) }
)
)
end
end
cb(ret)
end,
}
+20
View File
@@ -0,0 +1,20 @@
-- /home/stevearc/.config/nvim/lua/overseer/template/user/run_script.lua
return {
name = "run script",
builder = function()
local file = vim.fn.expand "%:p"
local cmd = { file }
if vim.bo.filetype == "templ" then cmd = { "templ", "generate" } end
return {
cmd = cmd,
components = {
{ "on_output_quickfix", set_diagnostics = true },
"on_result_diagnostics",
"default",
},
}
end,
condition = {
filetype = { "templ" },
},
}
+90
View File
@@ -0,0 +1,90 @@
-- AstroCore provides a central place to modify mappings, vim options, autocommands, and more!
-- Configuration documentation can be found with `:h astrocore`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
-- as this provides autocomplete and documentation while editing
---@type LazySpec
return {
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
rooter = {
-- list of detectors in order of prevalence, elements can be:
-- "lsp" : lsp detection
-- string[] : a list of directory patterns to look for
-- fun(bufnr: integer): string|string[] : a function that takes a buffer number and outputs detected roots
detector = {
"lsp", -- highest priority is getting workspace from running language servers
{ ".git", "_darcs", ".hg", ".bzr", ".svn" }, -- next check for a version controlled parent directory
{ "lua", "go.mod", "package.json", "Cargo.toml", "go.work", "Pipfile", "Makefile", "requirements.txt" }, -- lastly check for a file named `main`
},
-- ignore things from root detection
ignore = {
servers = {}, -- list of language server names to ignore (Ex. { "efm" })
dirs = {}, -- list of directory patterns (Ex. { "~/.cargo/*" })
},
-- automatically update working directory (update manually with `:AstroRoot`)
autochdir = true,
-- scope of working directory to change ("global"|"tab"|"win")
scope = "tab",
-- show notification on every working directory change
notify = false,
},
-- Configure core features of AstroNvim
features = {
autopairs = true, -- enable autopairs at start
diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on)
highlighturl = true, -- highlight URLs at start
notifications = false, -- enable notifications at start
},
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
diagnostics = {
virtual_text = true,
underline = true,
},
-- vim options can be configured here
options = {
opt = { -- vim.opt.<key>
relativenumber = false, -- sets vim.opt.relativenumber
number = true, -- sets vim.opt.number
spell = false, -- sets vim.opt.spell
wrap = true, -- sets vim.opt.wrap
},
g = { -- vim.g.<key>
-- configure global vim variables (vim.g)
-- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup`
-- This can be found in the `lua/lazy_setup.lua` file
},
},
-- Mappings can be configured through AstroCore as well.
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
mappings = {
-- first key is the mode
n = {
-- navigate buffer tabs
["L"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
["H"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
["K"] = { "g;", desc = "Go to previous edited line" },
["J"] = { "g,", desc = "Go to next edited line" },
["vv"] = { "gg0VG$", desc = "Select all contents in buffer" },
["<C-Space>"] = { "<Cmd>Telescope oldfiles<CR>", desc = "Recent Files" },
["<C-m>"] = { "<Cmd>OverseerRun<CR>", desc = "Overseer" },
["<C-d>"] = { "<Cmd>Telescope diagnostics<CR>", desc = "Show Errors" },
["<C-u>"] = { "<Cmd>Telescope lsp_document_symbols<CR>", desc = "Show Symbols" },
["<C-c>"] = { function() vim.cmd "bd" end, desc = "Close window" },
["<C-q>"] = { "<Cmd>wa<CR><Cmd>qa!<CR>", desc = "Save and Quit Neovim" },
["<C-r>"] = { vim.lsp.buf.rename, desc = "LSP Rename Symbol" },
["<C-e>"] = { "<Cmd>Neotree toggle<CR>", desc = "Show Explorer" },
["<C-p>"] = { "p", desc = "Paste" },
},
v = {
["<C-e>"] = { "<Cmd>Neotree toggle<CR>", desc = "Show Explorer" },
},
t = {
["<Esc>"] = { [[<C-\><C-n>]], desc = "Exit terminal mode" },
},
},
},
}
+9
View File
@@ -0,0 +1,9 @@
---@type LazySpec
return {
"AstroNvim/astroui",
---@type AstroUIOpts
opts = {
-- change colorscheme
colorscheme = "cyberdream",
},
}
+246
View File
@@ -0,0 +1,246 @@
return {
{
"neo-tree.nvim",
opts = {
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
sort_case_insensitive = false,
auto_expand_width = true,
git_status_async = true, -- Asynchronous git status. Improves performance.
hide_root_node = true, -- Hide the root node.
retain_hidden_root_indent = false, -- IF the root node is hidden, keep the indentation anyhow.
default_component_configs = {
container = {
enable_character_fade = true,
},
indent = {
indent_size = 1,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = "│",
last_indent_marker = "└",
highlight = "NeoTreeIndentMarker",
-- expander config, needed for nesting files
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
name = {
trailing_slash = false, -- append a trailing slash to folder names
use_git_status_colors = true, -- use git status colors instead of the default colors
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "✖", -- this can only be used in the git_status source
renamed = "󰁕", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "󰄱",
staged = "",
conflict = "",
},
},
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
file_size = {
enabled = true,
width = 12, -- width of the column
required_width = 64, -- min width of window required to show this column
},
type = {
enabled = true,
width = 10, -- width of the column
required_width = 122, -- min width of window required to show this column
},
last_modified = {
enabled = true,
width = 20, -- width of the column
required_width = 88, -- min width of window required to show this column
},
created = {
enabled = true,
width = 20, -- width of the column
required_width = 110, -- min width of window required to show this column
},
symlink_target = {
enabled = false,
},
},
-- Simplified default component configs
window = {
mappings = {
["<bs>"] = "navigate_up",
[">"] = "set_root",
["."] = "toggle_hidden",
["/"] = "fuzzy_finder",
["f"] = "filter_on_submit",
["<c-x>"] = "clear_filter",
["<CR>"] = "open_and_close_neotree",
["<S-CR>"] = "open",
},
header = {
highlight = "NeoTreeHeader",
},
},
buffers = {
follow_current_file = true,
},
-- Filesystem specific settings
filesystem = {
commands = {
-- If item is a file it will close neotree after opening it.
open_and_close_neotree = function(state)
require("neo-tree.sources.filesystem.commands").open(state)
local tree = state.tree
local success, node = pcall(tree.get_node, tree)
if not success then return end
if node.type == "file" then require("neo-tree.command").execute { action = "close" } end
end,
},
bind_to_cwd = true,
follow_current_file = {
enabled = true,
leave_dirs_open = true,
},
filtered_items = {
force_visible_in_empty_folder = true,
group_empty = true,
show_hidden_count = false,
hide_dotfiles = false,
hide_gitignored = true,
hide_by_pattern = {
"dist",
".python-version",
"*_test.go",
"*.pb.go",
"*_templ.go",
"buf.gen.*",
"mprocs.*",
"*config.*.js",
"*config.js",
"deps.mjs",
"test_*.go",
".trunk",
},
hide_by_name = {
".github",
".taskfiles",
"types",
".gitignore",
"analysis_options.yaml",
"decorators",
"slumber.yml",
"CHANGELOG.md",
"devbox.d",
"package-lock.json",
".husky",
"translations",
"test",
"networks",
"go.mod",
"LICENSE.md",
"CONTRIBUTING.md",
},
never_show_by_pattern = {
"PULL_REQUEST_TEMPLATE.md",
".trunk",
".editorconfig",
".eslint*",
"*.min.js",
".gitpod.*",
"cspell.*",
"*.lock",
"*.lockb",
"*.pulsar.go",
"*.pb.gorm.go",
"*.pb.gw.go",
"*_templ.go",
"*.tmp",
"*.work.*",
"*.sum",
".wrangler",
"*.wasm",
"*.png",
"*.min.js",
"*.jpg",
"*.icns",
"*.ico",
"build",
"PklProject.deps.json",
"*.iml",
},
never_show = {
".dart_tool",
".idea",
".metadata",
".venv",
"zkp",
"ted25519",
"dkg",
"ecies",
"ot",
"paillier",
"sharing",
"signatures",
"subtle",
"bulletproof",
"dkg",
"daed",
".gradle",
"gradle.bat",
".aider.chat.history.md",
".aider.input.history",
".aider.tags.cache.v3",
".devcontainer",
"heighliner",
".tmp",
".zed",
".vscode",
"go.work.sum",
".DS_Store",
".git",
"LICENSE",
"interchaintest",
".envrc",
"tmp",
"sonr.log",
"DISCUSSION_TEMPLATE",
"ISSUE_TEMPLATE",
},
},
},
diagnostics = {
enable = true,
icons = {
hint = "",
info = "",
warning = "",
error = "",
},
},
source_selector = {
winbar = false,
statusline = false,
},
-- Main sources
sources = {
"filesystem",
"diagnostics",
},
},
},
}
+69
View File
@@ -0,0 +1,69 @@
-- You can also add or configure plugins by creating files in this `plugins/` folder
-- Here are some examples:
---@type LazySpec
return {
"andweeb/presence.nvim",
{
"kdheepak/lazygit.nvim",
lazy = true,
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<C-g>", "<cmd>LazyGit<cr>", desc = "LazyGit" },
},
},
{
"chrisgrieser/nvim-rip-substitute",
cmd = "RipSubstitute",
keys = {
{
"<C-f>",
function() require("rip-substitute").sub() end,
mode = { "n", "x" },
desc = " rip substitute",
},
},
},
-- disable neo-tree
{
"goolord/alpha-nvim",
enabled = true,
opts = function(_, opts)
-- customize the dashboard header
opts.section.header.val = {
" ▗▄████▄▖ ",
" ▟███▛███▛▘ ",
" ▄███▜▝ ▘▀ ▗ ",
" ▗▟██▜▞▘ ▟██▖ ",
" ▟██▛█▘ ▄▙▖ ▝▜█▜█▙ ",
"▟██▜▀ ▄████▄ ▀██▟▙",
"██▟▌ ▐████▟█▜ ▐▟██",
"▜▛██▄ ▀▜▟█▛▀ ▄██▛▛",
" ▜█▛█▙▖ ▝▀▌▘ ▗▟█▟▙▛ ",
" ▝▜█▛▘ ▟██▟█▘ ",
" ▘ ▄▄ ▄███▟▀ ",
" ▗▟▜▛██▜█▜▞▘ ",
" ▝▀████▀▘ ",
}
return opts
end,
},
-- Add SchemaStore.nvim to your plugin
{
"b0o/SchemaStore.nvim",
},
}
+48
View File
@@ -0,0 +1,48 @@
-- This will run last in the setup process and is a good place to configure
-- things like custom filetypes. This just pure lua so anything that doesn't
-- fit in the normal config locations above can go here
require("telescope").setup {
pickers = {
oldfiles = {
cwd_only = true,
},
},
}
require("overseer").setup {
strategy = {
"toggleterm",
use_shell = false,
size = vim.o.columns * 0.25,
auto_scroll = true,
close_on_exit = false,
quit_on_exit = "success",
open_on_start = true,
hidden = true,
},
}
require("lspconfig").jsonls.setup {
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
},
},
}
require("lspconfig").yamlls.setup {
settings = {
yaml = {
schemaStore = {
-- You must disable built-in schemaStore support if you want to use
-- this plugin and its advanced options like `ignore`.
enable = false,
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
url = "",
},
schemas = require("schemastore").yaml.schemas(),
},
},
}