Skip to content

Commit 199c837

Browse files
authored
Initial commit
0 parents  commit 199c837

16 files changed

+535
-0
lines changed

.neoconf.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"neodev": {
3+
"library": {
4+
"enabled": true,
5+
"plugins": true
6+
}
7+
},
8+
"neoconf": {
9+
"plugins": {
10+
"lua_ls": {
11+
"enabled": true
12+
}
13+
}
14+
},
15+
"lspconfig": {
16+
"lua_ls": {
17+
"Lua.format.enable": false
18+
}
19+
}
20+
}

.stylua.toml

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

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# AstroNvim Template
2+
3+
**NOTE:** This is for AstroNvim v4+
4+
5+
A template for getting started with [AstroNvim](https://github.com/AstroNvim/AstroNvim)
6+
7+
## 🛠️ Installation
8+
9+
#### Make a backup of your current nvim and shared folder
10+
11+
```shell
12+
mv ~/.config/nvim ~/.config/nvim.bak
13+
mv ~/.local/share/nvim ~/.local/share/nvim.bak
14+
mv ~/.local/state/nvim ~/.local/state/nvim.bak
15+
mv ~/.cache/nvim ~/.cache/nvim.bak
16+
```
17+
18+
#### Create a new user repository from this template
19+
20+
Press the "Use this template" button above to create a new repository to store your user configuration.
21+
22+
You can also just clone this repository directly if you do not want to track your user configuration in GitHub.
23+
24+
#### Clone the repository
25+
26+
```shell
27+
git clone https://github.com/<your_user>/<your_repository> ~/.config/nvim
28+
```
29+
30+
#### Start Neovim
31+
32+
```shell
33+
nvim
34+
```

init.lua

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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"

lua/community.lua

+12
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+
}

lua/lazy_setup.lua

+32
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 nightly 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 = { "astrotheme", "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]])

lua/plugins/astrocore.lua

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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 * 256, 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 = "yes", -- sets vim.opt.signcolumn to yes
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
50+
["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
51+
["[b"] = { 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 = "Close buffer from tabline",
61+
},
62+
63+
-- tables with just a `desc` key will be registered with which-key if it's installed
64+
-- this is useful for naming menus
65+
-- ["<Leader>b"] = { desc = "Buffers" },
66+
67+
-- setting a mapping to false will disable it
68+
-- ["<C-S>"] = false,
69+
},
70+
},
71+
},
72+
}

lua/plugins/astrolsp.lua

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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+
codelens = true, -- enable/disable codelens refresh on start
16+
inlay_hints = false, -- enable/disable inlay hints on start
17+
semantic_tokens = true, -- enable/disable semantic token highlighting
18+
},
19+
-- customize lsp formatting options
20+
formatting = {
21+
-- control auto formatting on save
22+
format_on_save = {
23+
enabled = true, -- enable or disable format on save globally
24+
allow_filetypes = { -- enable format on save for specified filetypes only
25+
-- "go",
26+
},
27+
ignore_filetypes = { -- disable format on save for specified filetypes
28+
-- "python",
29+
},
30+
},
31+
disabled = { -- disable formatting capabilities for the listed language servers
32+
-- disable lua_ls formatting capability if you want to use StyLua to format your lua code
33+
-- "lua_ls",
34+
},
35+
timeout_ms = 1000, -- default format timeout
36+
-- filter = function(client) -- fully override the default formatting function
37+
-- return true
38+
-- end
39+
},
40+
-- enable servers that you already have installed without mason
41+
servers = {
42+
-- "pyright"
43+
},
44+
-- customize language server configuration options passed to `lspconfig`
45+
---@diagnostic disable: missing-fields
46+
config = {
47+
-- clangd = { capabilities = { offsetEncoding = "utf-8" } },
48+
},
49+
-- customize how language servers are attached
50+
handlers = {
51+
-- 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
52+
-- function(server, opts) require("lspconfig")[server].setup(opts) end
53+
54+
-- the key is the server that is being setup with `lspconfig`
55+
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
56+
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
57+
},
58+
-- Configure buffer local auto commands to add when attaching a language server
59+
autocmds = {
60+
-- first key is the `augroup` to add the auto commands to (:h augroup)
61+
lsp_codelens_refresh = {
62+
-- Optional condition to create/delete auto command group
63+
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
64+
-- condition will be resolved for each client on each execution and if it ever fails for all clients,
65+
-- the auto commands will be deleted for that buffer
66+
cond = "textDocument/codeLens",
67+
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
68+
-- list of auto commands to set
69+
{
70+
-- events to trigger
71+
event = { "InsertLeave", "BufEnter" },
72+
-- the rest of the autocmd options (:h nvim_create_autocmd)
73+
desc = "Refresh codelens (buffer)",
74+
callback = function(args)
75+
if require("astrolsp").config.features.codelens then vim.lsp.codelens.refresh { bufnr = args.buf } end
76+
end,
77+
},
78+
},
79+
},
80+
-- mappings to be set up on attaching of a language server
81+
mappings = {
82+
n = {
83+
-- 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
84+
gD = {
85+
function() vim.lsp.buf.declaration() end,
86+
desc = "Declaration of current symbol",
87+
cond = "textDocument/declaration",
88+
},
89+
["<Leader>uY"] = {
90+
function() require("astrolsp.toggles").buffer_semantic_tokens() end,
91+
desc = "Toggle LSP semantic highlight (buffer)",
92+
cond = function(client)
93+
return client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil
94+
end,
95+
},
96+
},
97+
},
98+
-- A custom `on_attach` function to be run after the default `on_attach` function
99+
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
100+
on_attach = function(client, bufnr)
101+
-- this would disable semanticTokensProvider for all clients
102+
-- client.server_capabilities.semanticTokensProvider = nil
103+
end,
104+
},
105+
}

lua/plugins/astroui.lua

+39
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+
}

lua/plugins/mason.lua

+39
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+
-- Customize Mason plugins
4+
5+
---@type LazySpec
6+
return {
7+
-- use mason-lspconfig to configure LSP installations
8+
{
9+
"williamboman/mason-lspconfig.nvim",
10+
-- overrides `require("mason-lspconfig").setup(...)`
11+
opts = {
12+
ensure_installed = {
13+
"lua_ls",
14+
-- add more arguments for adding more language servers
15+
},
16+
},
17+
},
18+
-- use mason-null-ls to configure Formatters/Linter installation for null-ls sources
19+
{
20+
"jay-babu/mason-null-ls.nvim",
21+
-- overrides `require("mason-null-ls").setup(...)`
22+
opts = {
23+
ensure_installed = {
24+
"stylua",
25+
-- add more arguments for adding more null-ls sources
26+
},
27+
},
28+
},
29+
{
30+
"jay-babu/mason-nvim-dap.nvim",
31+
-- overrides `require("mason-nvim-dap").setup(...)`
32+
opts = {
33+
ensure_installed = {
34+
"python",
35+
-- add more arguments for adding more debuggers
36+
},
37+
},
38+
},
39+
}

0 commit comments

Comments
 (0)