Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Commit aac7f99

Browse files
committed
feat: initial push with a fully separated and organized user configuration for AstroNvim v3
0 parents  commit aac7f99

28 files changed

+362
-0
lines changed

.stylua.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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"

astronvim_theme/colors.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Modify the color palette for the default theme
2+
return {
3+
fg = "#abb2bf",
4+
bg = "#1e222a",
5+
}

astronvim_theme/highlights.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
local C = require "astronvim_theme.colors"
2+
-- modify the astronvim colors of the astronvim colorscheme directly when it's created
3+
return {
4+
Normal = { fg = C.fg, bg = C.bg },
5+
6+
-- customize styles of highlight groups
7+
-- DiagnosticError = { italic = true },
8+
-- DiagnosticHint = { italic = true },
9+
-- DiagnosticInfo = { italic = true },
10+
-- DiagnosticWarn = { italic = true },
11+
}

astronvim_theme/plugins.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
-- enable or disable highlighting for extra plugins in the astronvim theme
2+
return {
3+
aerial = true,
4+
beacon = false,
5+
bufferline = false,
6+
cmp = true,
7+
dashboard = true,
8+
highlighturl = true,
9+
hop = false,
10+
indent_blankline = true,
11+
lightspeed = false,
12+
["neo-tree"] = true,
13+
notify = true,
14+
["nvim-tree"] = false,
15+
["nvim-web-devicons"] = true,
16+
rainbow = true,
17+
symbols_outline = false,
18+
telescope = true,
19+
treesitter = true,
20+
vimwiki = false,
21+
["which-key"] = true,
22+
}

colorscheme.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- Set colorscheme to use
2+
return "astronvim"

diagnostics.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
2+
return {
3+
virtual_text = true,
4+
underline = true,
5+
}

heirline/attributes.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Customize attributes of highlighting in Heirline components
2+
return {
3+
-- styling choices for each heirline element, check possible attributes with `:h attr-list`
4+
git_branch = { bold = true }, -- bold the git branch statusline component
5+
}

heirline/colors.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Customize colors for each element each element has a `_fg` and a `_bg`
2+
return function(colors)
3+
colors.git_branch_fg = astronvim.get_hlgroup "Conditional"
4+
return colors
5+
end

heirline/icon_highlights.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- Customize if icons should be highlighted
2+
return {
3+
breadcrumbs = false, -- LSP symbols in the breadcrumbs
4+
file_icon = {
5+
winbar = false, -- Filetype icon in the winbar inactive windows
6+
statusline = true, -- Filetype icon in the statusline
7+
tabline = true, -- Filetype icon in the tabline
8+
},
9+
}

heirline/separators.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- Customize different separators between sections
2+
return {
3+
breadcrumbs = " > ",
4+
tab = { "", "" },
5+
}

highlights/duskfox.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
return { -- a table of overrides/changes to the duskfox theme
2+
Normal = { bg = "#000000" },
3+
}

highlights/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
return { -- this table overrides highlights in all themes
2+
-- Normal = { bg = "#000000" },
3+
}

lazy.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- Configure require("lazy").setup() options
2+
return {
3+
defaults = { lazy = true },
4+
performance = {
5+
rtp = {
6+
-- customize default disabled vim plugins
7+
disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin", "matchparen" },
8+
},
9+
},
10+
}

lsp/config/yamlls.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- example for addings schemas to yamlls
2+
return { -- override table for require("lspconfig").yamlls.setup({...})
3+
settings = {
4+
yaml = {
5+
schemas = {
6+
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
7+
["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
8+
["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
9+
},
10+
},
11+
},
12+
}

lsp/formatting.lua

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- customize lsp formatting options
2+
return {
3+
-- control auto formatting on save
4+
format_on_save = {
5+
enabled = true, -- enable or disable format on save globally
6+
allow_filetypes = { -- enable format on save for specified filetypes only
7+
-- "go",
8+
},
9+
ignore_filetypes = { -- disable format on save for specified filetypes
10+
-- "python",
11+
},
12+
},
13+
disabled = { -- disable formatting capabilities for the listed language servers
14+
-- "sumneko_lua",
15+
},
16+
timeout_ms = 1000, -- default format timeout
17+
-- filter = function(client) -- fully override the default formatting function
18+
-- return true
19+
-- end
20+
}

lsp/mappings.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- easily add or disable built in mappings added during LSP attaching
2+
return {
3+
n = {
4+
-- ["<leader>lf"] = false -- disable formatting keymap
5+
},
6+
}

lsp/mason.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
-- customize mason plugins
2+
return {
3+
-- use mason-lspconfig to configure LSP installations
4+
{
5+
"williamboman/mason-lspconfig.nvim",
6+
-- overrides `require("mason-lspconfig").setup(...)`
7+
opts = {
8+
-- ensure_installed = { "sumneko_lua" },
9+
},
10+
},
11+
-- use mason-null-ls to configure Formatters/Linter installation for null-ls sources
12+
{
13+
"jay-babu/mason-null-ls.nvim",
14+
-- overrides `require("mason-null-ls").setup(...)`
15+
opts = {
16+
-- ensure_installed = { "prettier", "stylua" },
17+
},
18+
},
19+
{
20+
"jay-babu/mason-nvim-dap.nvim",
21+
-- overrides `require("mason-nvim-dap").setup(...)`
22+
opts = {
23+
-- ensure_installed = { "python" },
24+
},
25+
},
26+
}

lsp/servers.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- enable servers that you already have installed without mason
2+
return {
3+
-- "pyright"
4+
}

lsp/setup_handlers.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
-- override the LSP setup handler function based on server name
2+
return {
3+
-- first function changes the default setup handler
4+
function(server, opts) require("lspconfig")[server].setup(opts) end,
5+
-- keys for a specific server name will be used for that LSP
6+
sumneko_lua = function(server, opts)
7+
-- custom sumneko_lua setup handler
8+
require("lspconfig")["sumneko_lua"].setup(opts)
9+
end,
10+
}

mappings.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-- Mapping data with "desc" stored directly by vim.keymap.set().
2+
--
3+
-- Please use this mappings table to set keyboard mapping since this is the
4+
-- lower level configuration and more robust one. (which-key will
5+
-- automatically pick-up stored data by this setting.)
6+
return {
7+
-- first key is the mode
8+
n = {
9+
-- second key is the lefthand side of the map
10+
-- mappings seen under group name "Buffer"
11+
["<leader>bb"] = { "<cmd>tabnew<cr>", desc = "New tab" },
12+
["<leader>bc"] = { "<cmd>BufferLinePickClose<cr>", desc = "Pick to close" },
13+
["<leader>bj"] = { "<cmd>BufferLinePick<cr>", desc = "Pick to jump" },
14+
["<leader>bt"] = { "<cmd>BufferLineSortByTabs<cr>", desc = "Sort by tabs" },
15+
-- tables with the `name` key will be registered with which-key if it's installed
16+
-- this is useful for naming menus
17+
["<leader>b"] = { name = "Buffers" },
18+
-- quick save
19+
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
20+
},
21+
t = {
22+
-- setting a mapping to false will disable it
23+
-- ["<esc>"] = false,
24+
},
25+
}

options.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- set vim options here (vim.<first_key>.<second_key> = value)
2+
return {
3+
opt = {
4+
-- set to true or false etc.
5+
relativenumber = true, -- sets vim.opt.relativenumber
6+
number = true, -- sets vim.opt.number
7+
spell = false, -- sets vim.opt.spell
8+
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
9+
wrap = false, -- sets vim.opt.wrap
10+
},
11+
g = {
12+
mapleader = " ", -- sets vim.g.mapleader
13+
autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
14+
cmp_enabled = true, -- enable completion at start
15+
autopairs_enabled = true, -- enable autopairs at start
16+
diagnostics_enabled = true, -- enable diagnostics at start
17+
status_diagnostics_enabled = true, -- enable diagnostics in statusline
18+
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
19+
ui_notifications_enabled = true, -- disable notifications when toggling UI elements
20+
},
21+
}

plugins/alpha.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-- customize alpha options
2+
return {
3+
"goolord/alpha-nvim",
4+
opts = function(_, opts)
5+
-- customize the dashboard header
6+
opts.section.header.val = {
7+
" █████ ███████ ████████ ██████ ██████",
8+
"██ ██ ██ ██ ██ ██ ██ ██",
9+
"███████ ███████ ██ ██████ ██ ██",
10+
"██ ██ ██ ██ ██ ██ ██ ██",
11+
"██ ██ ███████ ██ ██ ██ ██████",
12+
" ",
13+
" ███  ██ ██  ██ ██ ███  ███",
14+
" ████  ██ ██  ██ ██ ████  ████",
15+
" ██ ██  ██ ██  ██ ██ ██ ████ ██",
16+
" ██  ██ ██  ██  ██  ██ ██  ██  ██",
17+
" ██   ████   ████   ██ ██      ██",
18+
}
19+
return opts
20+
end,
21+
}

plugins/core.lua

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
return {
2+
-- You can disable default plugins as follows:
3+
-- { "max397574/better-escape.nvim", enabled = false },
4+
--
5+
-- You can also easily customize additional setup of plugins that is outside of the plugin's setup call
6+
-- {
7+
-- "L3MON4D3/LuaSnip",
8+
-- config = function(plugin, opts)
9+
-- plugin.default_config(opts) -- include the default astronvim config that calls the setup call
10+
-- -- add more custom luasnip configuration such as filetype extend or custom snippets
11+
-- local luasnip = require "luasnip"
12+
-- luasnip.filetype_extend("javascript", { "javascriptreact" })
13+
-- end,
14+
-- },
15+
-- {
16+
-- "windwp/nvim-autopairs",
17+
-- config = function(plugin, opts)
18+
-- plugin.default_config(opts) -- include the default astronvim config that calls the setup call
19+
-- -- add more custom autopairs configuration such as custom rules
20+
-- local npairs = require "nvim-autopairs"
21+
-- local Rule = require "nvim-autopairs.rule"
22+
-- local cond = require "nvim-autopairs.conds"
23+
-- npairs.add_rules(
24+
-- {
25+
-- Rule("$", "$", { "tex", "latex" })
26+
-- -- don't add a pair if the next character is %
27+
-- :with_pair(cond.not_after_regex "%%")
28+
-- -- don't add a pair if the previous character is xxx
29+
-- :with_pair(
30+
-- cond.not_before_regex("xxx", 3)
31+
-- )
32+
-- -- don't move right when repeat character
33+
-- :with_move(cond.none())
34+
-- -- don't delete if the next character is xx
35+
-- :with_del(cond.not_after_regex "xx")
36+
-- -- disable adding a newline when you press <cr>
37+
-- :with_cr(cond.none()),
38+
-- },
39+
-- -- disable for .vim files, but it work for another filetypes
40+
-- Rule("a", "a", "-vim")
41+
-- )
42+
-- end,
43+
-- },
44+
-- By adding to the which-key config and using our helper function you can add more which-key registered bindings
45+
-- {
46+
-- "folke/which-key.nvim",
47+
-- config = function(plugin, opts)
48+
-- plugin.default_config(opts)
49+
-- -- Add bindings which show up as group name
50+
-- local wk = require "which-key"
51+
-- wk.register({
52+
-- b = { name = "Buffer" },
53+
-- }, { mode = "n", prefix = "<leader>" })
54+
-- end,
55+
-- },
56+
}

plugins/null-ls.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
return {
2+
"jose-elias-alvarez/null-ls.nvim",
3+
opts = function(_, config)
4+
-- config variable is the default configuration table for the setup function call
5+
-- local null_ls = require "null-ls"
6+
7+
-- Check supported formatters and linters
8+
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
9+
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
10+
config.sources = {
11+
-- Set a formatter
12+
-- null_ls.builtins.formatting.stylua,
13+
-- null_ls.builtins.formatting.prettier,
14+
}
15+
return config -- return final config table
16+
end,
17+
}

plugins/treesitter.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
return {
2+
"nvim-treesitter/nvim-treesitter",
3+
opts = {
4+
-- ensure_installed = { "lua" },
5+
},
6+
}

plugins/user.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
return {
2+
-- You can also add new plugins here as well:
3+
-- Add plugins, the lazy syntax
4+
-- "andweeb/presence.nvim",
5+
-- {
6+
-- "ray-x/lsp_signature.nvim",
7+
-- event = "BufRead",
8+
-- config = function()
9+
-- require("lsp_signature").setup()
10+
-- end,
11+
-- },
12+
}

polish.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- This function is run last and is a good place to configuring
2+
-- augroups/autocommands and custom filetypes also this just pure lua so
3+
-- anything that doesn't fit in the normal config locations above can go here
4+
return function()
5+
-- Set up custom filetypes
6+
-- vim.filetype.add {
7+
-- extension = {
8+
-- foo = "fooscript",
9+
-- },
10+
-- filename = {
11+
-- ["Foofile"] = "fooscript",
12+
-- },
13+
-- pattern = {
14+
-- ["~/%.config/foo/.*"] = "fooscript",
15+
-- },
16+
-- }
17+
end

updater.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- Configure AstroNvim updates
2+
return {
3+
remote = "origin", -- remote to use
4+
channel = "stable", -- "stable" or "nightly"
5+
version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
6+
branch = "main", -- branch name (NIGHTLY ONLY)
7+
commit = nil, -- commit hash (NIGHTLY ONLY)
8+
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
9+
skip_prompts = false, -- skip prompts about breaking changes
10+
show_changelog = true, -- show the changelog after performing an update
11+
auto_quit = false, -- automatically quit the current session after a successful update
12+
-- remotes = { -- easily add new remotes to track
13+
-- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
14+
-- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
15+
-- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork
16+
-- },
17+
}

0 commit comments

Comments
 (0)