chore: simplify user configuration
parent
6774fc80cd
commit
543b6c0e30
|
@ -1,4 +1,4 @@
|
|||
# AstroNvim Structured User Example
|
||||
# AstroNvim User Configuration Example
|
||||
|
||||
A user configuration template for [AstroNvim](https://github.com/AstroNvim/AstroNvim)
|
||||
|
||||
|
@ -19,10 +19,16 @@ mv ~/.local/share/nvim ~/.local/share/nvim.bak
|
|||
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
|
||||
```
|
||||
|
||||
#### Create a new user repository from this template
|
||||
|
||||
Press the "Use this template" button above to create a new repository to store your user configuration.
|
||||
|
||||
You can also just clone this repository directly if you do not want to track your user configuration in GitHub.
|
||||
|
||||
#### Clone the repository
|
||||
|
||||
```shell
|
||||
git clone https://github.com/AstroNvim/split_user_example ~/.config/nvim/lua/user
|
||||
git clone https://github.com/<your_user>/<your_repository> ~/.config/nvim/lua/user
|
||||
```
|
||||
|
||||
#### Start Neovim
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
-- Set colorscheme to use
|
||||
return "astrodark"
|
|
@ -1,5 +0,0 @@
|
|||
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
|
||||
return {
|
||||
virtual_text = true,
|
||||
underline = true,
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
-- Customize attributes of highlighting in Heirline components
|
||||
return {
|
||||
-- styling choices for each heirline element, check possible attributes with `:h attr-list`
|
||||
git_branch = { bold = true }, -- bold the git branch statusline component
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
-- Customize colors for each element each element has a `_fg` and a `_bg`
|
||||
return function(colors)
|
||||
local get_hlgroup = require("astronvim.utils").get_hlgroup
|
||||
colors.git_branch_fg = get_hlgroup("Conditional").fg
|
||||
return colors
|
||||
end
|
|
@ -1,9 +0,0 @@
|
|||
-- Customize if icons should be highlighted
|
||||
return {
|
||||
breadcrumbs = false, -- LSP symbols in the breadcrumbs
|
||||
file_icon = {
|
||||
winbar = false, -- Filetype icon in the winbar inactive windows
|
||||
statusline = true, -- Filetype icon in the statusline
|
||||
tabline = true, -- Filetype icon in the tabline
|
||||
},
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
-- Customize different separators between sections
|
||||
return {
|
||||
breadcrumbs = " > ",
|
||||
tab = { "", "" },
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
return {
|
||||
-- Configure AstroNvim updates
|
||||
updater = {
|
||||
remote = "origin", -- remote to use
|
||||
channel = "nightly", -- "stable" or "nightly"
|
||||
version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
|
||||
branch = "nightly", -- branch name (NIGHTLY ONLY)
|
||||
commit = nil, -- commit hash (NIGHTLY ONLY)
|
||||
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
|
||||
skip_prompts = false, -- skip prompts about breaking changes
|
||||
show_changelog = true, -- show the changelog after performing an update
|
||||
auto_quit = false, -- automatically quit the current session after a successful update
|
||||
remotes = { -- easily add new remotes to track
|
||||
-- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
|
||||
-- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
|
||||
-- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork
|
||||
},
|
||||
},
|
||||
|
||||
-- Set colorscheme to use
|
||||
colorscheme = "astrodark",
|
||||
|
||||
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
|
||||
diagnostics = {
|
||||
virtual_text = true,
|
||||
underline = true,
|
||||
},
|
||||
|
||||
lsp = {
|
||||
-- customize lsp formatting options
|
||||
formatting = {
|
||||
-- control auto formatting on save
|
||||
format_on_save = {
|
||||
enabled = true, -- enable or disable format on save globally
|
||||
allow_filetypes = { -- enable format on save for specified filetypes only
|
||||
-- "go",
|
||||
},
|
||||
ignore_filetypes = { -- disable format on save for specified filetypes
|
||||
-- "python",
|
||||
},
|
||||
},
|
||||
disabled = { -- disable formatting capabilities for the listed language servers
|
||||
-- "sumneko_lua",
|
||||
},
|
||||
timeout_ms = 1000, -- default format timeout
|
||||
-- filter = function(client) -- fully override the default formatting function
|
||||
-- return true
|
||||
-- end
|
||||
},
|
||||
-- enable servers that you already have installed without mason
|
||||
servers = {
|
||||
-- "pyright"
|
||||
},
|
||||
},
|
||||
|
||||
-- Configure require("lazy").setup() options
|
||||
lazy = {
|
||||
defaults = { lazy = true },
|
||||
performance = {
|
||||
rtp = {
|
||||
-- customize default disabled vim plugins
|
||||
disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin", "matchparen" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- This function is run last and is a good place to configuring
|
||||
-- augroups/autocommands and custom filetypes also this just pure lua so
|
||||
-- anything that doesn't fit in the normal config locations above can go here
|
||||
polish = function()
|
||||
-- Set up custom filetypes
|
||||
-- vim.filetype.add {
|
||||
-- extension = {
|
||||
-- foo = "fooscript",
|
||||
-- },
|
||||
-- filename = {
|
||||
-- ["Foofile"] = "fooscript",
|
||||
-- },
|
||||
-- pattern = {
|
||||
-- ["~/%.config/foo/.*"] = "fooscript",
|
||||
-- },
|
||||
-- }
|
||||
end,
|
||||
}
|
10
lazy.lua
10
lazy.lua
|
@ -1,10 +0,0 @@
|
|||
-- Configure require("lazy").setup() options
|
||||
return {
|
||||
defaults = { lazy = true },
|
||||
performance = {
|
||||
rtp = {
|
||||
-- customize default disabled vim plugins
|
||||
disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin", "matchparen" },
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
-- example for addings schemas to yamlls
|
||||
return { -- override table for require("lspconfig").yamlls.setup({...})
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
|
||||
["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
|
||||
["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
-- customize lsp formatting options
|
||||
return {
|
||||
-- control auto formatting on save
|
||||
format_on_save = {
|
||||
enabled = true, -- enable or disable format on save globally
|
||||
allow_filetypes = { -- enable format on save for specified filetypes only
|
||||
-- "go",
|
||||
},
|
||||
ignore_filetypes = { -- disable format on save for specified filetypes
|
||||
-- "python",
|
||||
},
|
||||
},
|
||||
disabled = { -- disable formatting capabilities for the listed language servers
|
||||
-- "sumneko_lua",
|
||||
},
|
||||
timeout_ms = 1000, -- default format timeout
|
||||
-- filter = function(client) -- fully override the default formatting function
|
||||
-- return true
|
||||
-- end
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
-- easily add or disable built in mappings added during LSP attaching
|
||||
return {
|
||||
n = {
|
||||
-- ["<leader>lf"] = false -- disable formatting keymap
|
||||
},
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
-- enable servers that you already have installed without mason
|
||||
return {
|
||||
-- "pyright"
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
-- override the LSP setup handler function based on server name
|
||||
return {
|
||||
-- first function changes the default setup handler
|
||||
function(server, opts) require("lspconfig")[server].setup(opts) end,
|
||||
-- keys for a specific server name will be used for that LSP
|
||||
sumneko_lua = function(server, opts)
|
||||
-- custom sumneko_lua setup handler
|
||||
require("lspconfig")["sumneko_lua"].setup(opts)
|
||||
end,
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
-- customize alpha options
|
||||
return {
|
||||
"goolord/alpha-nvim",
|
||||
opts = function(_, opts)
|
||||
-- customize the dashboard header
|
||||
opts.section.header.val = {
|
||||
" █████ ███████ ████████ ██████ ██████",
|
||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
||||
"███████ ███████ ██ ██████ ██ ██",
|
||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
||||
"██ ██ ███████ ██ ██ ██ ██████",
|
||||
" ",
|
||||
" ███ ██ ██ ██ ██ ███ ███",
|
||||
" ████ ██ ██ ██ ██ ████ ████",
|
||||
" ██ ██ ██ ██ ██ ██ ██ ████ ██",
|
||||
" ██ ██ ██ ██ ██ ██ ██ ██ ██",
|
||||
" ██ ████ ████ ██ ██ ██",
|
||||
}
|
||||
return opts
|
||||
end,
|
||||
}
|
|
@ -1,4 +1,25 @@
|
|||
return {
|
||||
-- customize alpha options
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
opts = function(_, opts)
|
||||
-- customize the dashboard header
|
||||
opts.section.header.val = {
|
||||
" █████ ███████ ████████ ██████ ██████",
|
||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
||||
"███████ ███████ ██ ██████ ██ ██",
|
||||
"██ ██ ██ ██ ██ ██ ██ ██",
|
||||
"██ ██ ███████ ██ ██ ██ ██████",
|
||||
" ",
|
||||
" ███ ██ ██ ██ ██ ███ ███",
|
||||
" ████ ██ ██ ██ ██ ████ ████",
|
||||
" ██ ██ ██ ██ ██ ██ ██ ████ ██",
|
||||
" ██ ██ ██ ██ ██ ██ ██ ██ ██",
|
||||
" ██ ████ ████ ██ ██ ██",
|
||||
}
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
-- You can disable default plugins as follows:
|
||||
-- { "max397574/better-escape.nvim", enabled = false },
|
||||
--
|
||||
|
|
17
polish.lua
17
polish.lua
|
@ -1,17 +0,0 @@
|
|||
-- This function is run last and is a good place to configuring
|
||||
-- augroups/autocommands and custom filetypes also this just pure lua so
|
||||
-- anything that doesn't fit in the normal config locations above can go here
|
||||
return function()
|
||||
-- Set up custom filetypes
|
||||
-- vim.filetype.add {
|
||||
-- extension = {
|
||||
-- foo = "fooscript",
|
||||
-- },
|
||||
-- filename = {
|
||||
-- ["Foofile"] = "fooscript",
|
||||
-- },
|
||||
-- pattern = {
|
||||
-- ["~/%.config/foo/.*"] = "fooscript",
|
||||
-- },
|
||||
-- }
|
||||
end
|
17
updater.lua
17
updater.lua
|
@ -1,17 +0,0 @@
|
|||
-- Configure AstroNvim updates
|
||||
return {
|
||||
remote = "origin", -- remote to use
|
||||
channel = "nightly", -- "stable" or "nightly"
|
||||
version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
|
||||
branch = "nightly", -- branch name (NIGHTLY ONLY)
|
||||
commit = nil, -- commit hash (NIGHTLY ONLY)
|
||||
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
|
||||
skip_prompts = false, -- skip prompts about breaking changes
|
||||
show_changelog = true, -- show the changelog after performing an update
|
||||
auto_quit = false, -- automatically quit the current session after a successful update
|
||||
remotes = { -- easily add new remotes to track
|
||||
-- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
|
||||
-- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
|
||||
-- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue