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

+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",
},
}