Skip to content

Commit af9390f

Browse files
committed
feat: replace lazyvim with astrovim
1 parent c1ccea4 commit af9390f

20 files changed

+482
-123
lines changed

home-manager/common/neovim/init.lua

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
-- bootstrap lazy.nvim, LazyVim and your plugins
2-
require("config.lazy")
1+
-- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution
2+
-- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk.
3+
local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
4+
if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then
5+
-- stylua: ignore
6+
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
7+
end
8+
vim.opt.rtp:prepend(lazypath)
9+
10+
-- validate that lazy is available
11+
if not pcall(require, "lazy") then
12+
-- stylua: ignore
13+
vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
14+
vim.fn.getchar()
15+
vim.cmd.quit()
16+
end
17+
18+
require "lazy_setup"
19+
require "polish"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
2+
3+
-- AstroCommunity: import any community modules here
4+
-- We import this file in `lazy_setup.lua` before the `plugins/` folder.
5+
-- This guarantees that the specs are processed before any user plugins.
6+
7+
---@type LazySpec
8+
return {
9+
"AstroNvim/astrocommunity",
10+
{ import = "astrocommunity.pack.lua" },
11+
-- import/override with your plugins folder
12+
}

home-manager/common/neovim/lua/config/autocmds.lua

Lines changed: 0 additions & 3 deletions
This file was deleted.

home-manager/common/neovim/lua/config/keymaps.lua

Lines changed: 0 additions & 3 deletions
This file was deleted.

home-manager/common/neovim/lua/config/lazy.lua

Lines changed: 0 additions & 51 deletions
This file was deleted.

home-manager/common/neovim/lua/config/options.lua

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
require("lazy").setup({
2+
{
3+
"AstroNvim/AstroNvim",
4+
version = "^4", -- Remove version tracking to elect for nighly AstroNvim
5+
import = "astronvim.plugins",
6+
opts = { -- AstroNvim options must be set here with the `import` key
7+
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
8+
maplocalleader = ",", -- This ensures the localleader key must be configured before Lazy is set up
9+
icons_enabled = true, -- Set to false to disable icons (if no Nerd Font is available)
10+
pin_plugins = nil, -- Default will pin plugins when tracking `version` of AstroNvim, set to true/false to override
11+
update_notifications = true, -- Enable/disable notification about running `:Lazy update` twice to update pinned plugins
12+
},
13+
},
14+
{ import = "community" },
15+
{ import = "plugins" },
16+
} --[[@as LazySpec]], {
17+
-- Configure any other `lazy.nvim` configuration options here
18+
install = { colorscheme = { "astrodark", "habamax" } },
19+
ui = { backdrop = 100 },
20+
performance = {
21+
rtp = {
22+
-- disable some rtp plugins, add more to your liking
23+
disabled_plugins = {
24+
"gzip",
25+
"netrwPlugin",
26+
"tarPlugin",
27+
"tohtml",
28+
"zipPlugin",
29+
},
30+
},
31+
},
32+
} --[[@as LazyConfig]])
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
2+
3+
-- AstroCore provides a central place to modify mappings, vim options, autocommands, and more!
4+
-- Configuration documentation can be found with `:h astrocore`
5+
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
6+
-- as this provides autocomplete and documentation while editing
7+
8+
---@type LazySpec
9+
return {
10+
"AstroNvim/astrocore",
11+
---@type AstroCoreOpts
12+
opts = {
13+
-- Configure core features of AstroNvim
14+
features = {
15+
large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
16+
autopairs = true, -- enable autopairs at start
17+
cmp = true, -- enable completion at start
18+
diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on)
19+
highlighturl = true, -- highlight URLs at start
20+
notifications = true, -- enable notifications at start
21+
},
22+
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
23+
diagnostics = {
24+
virtual_text = true,
25+
underline = true,
26+
},
27+
-- vim options can be configured here
28+
options = {
29+
opt = { -- vim.opt.<key>
30+
relativenumber = true, -- sets vim.opt.relativenumber
31+
number = true, -- sets vim.opt.number
32+
spell = false, -- sets vim.opt.spell
33+
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
34+
wrap = false, -- sets vim.opt.wrap
35+
},
36+
g = { -- vim.g.<key>
37+
-- configure global vim variables (vim.g)
38+
-- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup`
39+
-- This can be found in the `lua/lazy_setup.lua` file
40+
},
41+
},
42+
-- Mappings can be configured through AstroCore as well.
43+
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
44+
mappings = {
45+
-- first key is the mode
46+
n = {
47+
-- second key is the lefthand side of the map
48+
49+
-- navigate buffer tabs with `H` and `L`
50+
L = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
51+
H = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
52+
53+
-- mappings seen under group name "Buffer"
54+
["<Leader>bD"] = {
55+
function()
56+
require("astroui.status.heirline").buffer_picker(
57+
function(bufnr) require("astrocore.buffer").close(bufnr) end
58+
)
59+
end,
60+
desc = "Pick to close",
61+
},
62+
-- tables with just a `desc` key will be registered with which-key if it's installed
63+
-- this is useful for naming menus
64+
["<Leader>b"] = { desc = "Buffers" },
65+
-- quick save
66+
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
67+
},
68+
t = {
69+
-- setting a mapping to false will disable it
70+
-- ["<esc>"] = false,
71+
},
72+
},
73+
},
74+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
2+
3+
-- AstroLSP allows you to customize the features in AstroNvim's LSP configuration engine
4+
-- Configuration documentation can be found with `:h astrolsp`
5+
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
6+
-- as this provides autocomplete and documentation while editing
7+
8+
---@type LazySpec
9+
return {
10+
"AstroNvim/astrolsp",
11+
---@type AstroLSPOpts
12+
opts = {
13+
-- Configuration table of features provided by AstroLSP
14+
features = {
15+
autoformat = true, -- enable or disable auto formatting on start
16+
codelens = true, -- enable/disable codelens refresh on start
17+
inlay_hints = false, -- enable/disable inlay hints on start
18+
semantic_tokens = true, -- enable/disable semantic token highlighting
19+
},
20+
-- customize lsp formatting options
21+
formatting = {
22+
-- control auto formatting on save
23+
format_on_save = {
24+
enabled = true, -- enable or disable format on save globally
25+
allow_filetypes = { -- enable format on save for specified filetypes only
26+
-- "go",
27+
},
28+
ignore_filetypes = { -- disable format on save for specified filetypes
29+
-- "python",
30+
},
31+
},
32+
disabled = { -- disable formatting capabilities for the listed language servers
33+
-- disable lua_ls formatting capability if you want to use StyLua to format your lua code
34+
-- "lua_ls",
35+
},
36+
timeout_ms = 1000, -- default format timeout
37+
-- filter = function(client) -- fully override the default formatting function
38+
-- return true
39+
-- end
40+
},
41+
-- enable servers that you already have installed without mason
42+
servers = {
43+
-- "pyright"
44+
},
45+
-- customize language server configuration options passed to `lspconfig`
46+
---@diagnostic disable: missing-fields
47+
config = {
48+
-- clangd = { capabilities = { offsetEncoding = "utf-8" } },
49+
},
50+
-- customize how language servers are attached
51+
handlers = {
52+
-- a function without a key is simply the default handler, functions take two parameters, the server name and the configured options table for that server
53+
-- function(server, opts) require("lspconfig")[server].setup(opts) end
54+
55+
-- the key is the server that is being setup with `lspconfig`
56+
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
57+
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
58+
},
59+
-- Configure buffer local auto commands to add when attaching a language server
60+
autocmds = {
61+
-- first key is the `augroup` to add the auto commands to (:h augroup)
62+
lsp_document_highlight = {
63+
-- Optional condition to create/delete auto command group
64+
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
65+
-- condition will be resolved for each client on each execution and if it ever fails for all clients,
66+
-- the auto commands will be deleted for that buffer
67+
cond = "textDocument/documentHighlight",
68+
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
69+
-- list of auto commands to set
70+
{
71+
-- events to trigger
72+
event = { "CursorHold", "CursorHoldI" },
73+
-- the rest of the autocmd options (:h nvim_create_autocmd)
74+
desc = "Document Highlighting",
75+
callback = function() vim.lsp.buf.document_highlight() end,
76+
},
77+
{
78+
event = { "CursorMoved", "CursorMovedI", "BufLeave" },
79+
desc = "Document Highlighting Clear",
80+
callback = function() vim.lsp.buf.clear_references() end,
81+
},
82+
},
83+
},
84+
-- mappings to be set up on attaching of a language server
85+
mappings = {
86+
n = {
87+
gl = { function() vim.diagnostic.open_float() end, desc = "Hover diagnostics" },
88+
-- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean
89+
-- gD = {
90+
-- function() vim.lsp.buf.declaration() end,
91+
-- desc = "Declaration of current symbol",
92+
-- cond = "textDocument/declaration",
93+
-- },
94+
-- ["<Leader>uY"] = {
95+
-- function() require("astrolsp.toggles").buffer_semantic_tokens() end,
96+
-- desc = "Toggle LSP semantic highlight (buffer)",
97+
-- cond = function(client) return client.server_capabilities.semanticTokensProvider and vim.lsp.semantic_tokens end,
98+
-- },
99+
},
100+
},
101+
-- A custom `on_attach` function to be run after the default `on_attach` function
102+
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
103+
on_attach = function(client, bufnr)
104+
-- this would disable semanticTokensProvider for all clients
105+
-- client.server_capabilities.semanticTokensProvider = nil
106+
end,
107+
},
108+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
2+
3+
-- AstroUI provides the basis for configuring the AstroNvim User Interface
4+
-- Configuration documentation can be found with `:h astroui`
5+
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
6+
-- as this provides autocomplete and documentation while editing
7+
8+
---@type LazySpec
9+
return {
10+
"AstroNvim/astroui",
11+
---@type AstroUIOpts
12+
opts = {
13+
-- change colorscheme
14+
colorscheme = "astrodark",
15+
-- AstroUI allows you to easily modify highlight groups easily for any and all colorschemes
16+
highlights = {
17+
init = { -- this table overrides highlights in all themes
18+
-- Normal = { bg = "#000000" },
19+
},
20+
astrodark = { -- a table of overrides/changes when applying the astrotheme theme
21+
-- Normal = { bg = "#000000" },
22+
},
23+
},
24+
-- Icons can be configured throughout the interface
25+
icons = {
26+
-- configure the loading of the lsp in the status line
27+
LSPLoading1 = "",
28+
LSPLoading2 = "",
29+
LSPLoading3 = "",
30+
LSPLoading4 = "",
31+
LSPLoading5 = "",
32+
LSPLoading6 = "",
33+
LSPLoading7 = "",
34+
LSPLoading8 = "",
35+
LSPLoading9 = "",
36+
LSPLoading10 = "",
37+
},
38+
},
39+
}

home-manager/common/neovim/lua/plugins/colorscheme.lua

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)