tools
astronvim
user
.github
highlights
plugins
···
1
1
+
{
2
2
+
"nodes": {
3
3
+
"astro-nvim": {
4
4
+
"flake": false,
5
5
+
"locked": {
6
6
+
"lastModified": 1693178813,
7
7
+
"narHash": "sha256-XbvqX7xEdgfS8/fNvkwB4x7SW4S/Myh3MJS8TH70Xs0=",
8
8
+
"owner": "AstroNvim",
9
9
+
"repo": "AstroNvim",
10
10
+
"rev": "9ea4eaa1e6cdd4e0618a9d30751eed94319c986a",
11
11
+
"type": "github"
12
12
+
},
13
13
+
"original": {
14
14
+
"owner": "AstroNvim",
15
15
+
"repo": "AstroNvim",
16
16
+
"type": "github"
17
17
+
}
18
18
+
},
19
19
+
"beautysh": {
20
20
+
"inputs": {
21
21
+
"nixpkgs": [
22
22
+
"nixvim",
23
23
+
"nixpkgs"
24
24
+
],
25
25
+
"poetry2nix": "poetry2nix",
26
26
+
"utils": "utils"
27
27
+
},
28
28
+
"locked": {
29
29
+
"lastModified": 1680308980,
30
30
+
"narHash": "sha256-aUEHV0jk2qIFP3jlsWYWhBbm+w/N9gzH3e4I5DcdB5s=",
31
31
+
"owner": "lovesegfault",
32
32
+
"repo": "beautysh",
33
33
+
"rev": "9845efc3ea3e86cc0d41465d720a47f521b2799c",
34
34
+
"type": "github"
35
35
+
},
36
36
+
"original": {
37
37
+
"owner": "lovesegfault",
38
38
+
"repo": "beautysh",
39
39
+
"type": "github"
40
40
+
}
41
41
+
},
42
42
+
"flake-compat": {
43
43
+
"flake": false,
44
44
+
"locked": {
45
45
+
"lastModified": 1673956053,
46
46
+
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
47
47
+
"owner": "edolstra",
48
48
+
"repo": "flake-compat",
49
49
+
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
50
50
+
"type": "github"
51
51
+
},
52
52
+
"original": {
53
53
+
"owner": "edolstra",
54
54
+
"repo": "flake-compat",
55
55
+
"type": "github"
56
56
+
}
57
57
+
},
58
58
+
"flake-parts": {
59
59
+
"inputs": {
60
60
+
"nixpkgs-lib": "nixpkgs-lib"
61
61
+
},
62
62
+
"locked": {
63
63
+
"lastModified": 1690933134,
64
64
+
"narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=",
65
65
+
"owner": "hercules-ci",
66
66
+
"repo": "flake-parts",
67
67
+
"rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb",
68
68
+
"type": "github"
69
69
+
},
70
70
+
"original": {
71
71
+
"id": "flake-parts",
72
72
+
"type": "indirect"
73
73
+
}
74
74
+
},
75
75
+
"flake-utils": {
76
76
+
"inputs": {
77
77
+
"systems": "systems"
78
78
+
},
79
79
+
"locked": {
80
80
+
"lastModified": 1692799911,
81
81
+
"narHash": "sha256-3eihraek4qL744EvQXsK1Ha6C3CR7nnT8X2qWap4RNk=",
82
82
+
"owner": "numtide",
83
83
+
"repo": "flake-utils",
84
84
+
"rev": "f9e7cf818399d17d347f847525c5a5a8032e4e44",
85
85
+
"type": "github"
86
86
+
},
87
87
+
"original": {
88
88
+
"owner": "numtide",
89
89
+
"repo": "flake-utils",
90
90
+
"type": "github"
91
91
+
}
92
92
+
},
93
93
+
"flake-utils_2": {
94
94
+
"inputs": {
95
95
+
"systems": "systems_2"
96
96
+
},
97
97
+
"locked": {
98
98
+
"lastModified": 1685518550,
99
99
+
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
100
100
+
"owner": "numtide",
101
101
+
"repo": "flake-utils",
102
102
+
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
103
103
+
"type": "github"
104
104
+
},
105
105
+
"original": {
106
106
+
"owner": "numtide",
107
107
+
"repo": "flake-utils",
108
108
+
"type": "github"
109
109
+
}
110
110
+
},
111
111
+
"gitignore": {
112
112
+
"inputs": {
113
113
+
"nixpkgs": [
114
114
+
"nixvim",
115
115
+
"pre-commit-hooks",
116
116
+
"nixpkgs"
117
117
+
]
118
118
+
},
119
119
+
"locked": {
120
120
+
"lastModified": 1660459072,
121
121
+
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
122
122
+
"owner": "hercules-ci",
123
123
+
"repo": "gitignore.nix",
124
124
+
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
125
125
+
"type": "github"
126
126
+
},
127
127
+
"original": {
128
128
+
"owner": "hercules-ci",
129
129
+
"repo": "gitignore.nix",
130
130
+
"type": "github"
131
131
+
}
132
132
+
},
133
133
+
"nixpkgs": {
134
134
+
"locked": {
135
135
+
"lastModified": 1693377291,
136
136
+
"narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=",
137
137
+
"owner": "NixOS",
138
138
+
"repo": "nixpkgs",
139
139
+
"rev": "e7f38be3775bab9659575f192ece011c033655f0",
140
140
+
"type": "github"
141
141
+
},
142
142
+
"original": {
143
143
+
"owner": "NixOS",
144
144
+
"ref": "nixos-unstable",
145
145
+
"repo": "nixpkgs",
146
146
+
"type": "github"
147
147
+
}
148
148
+
},
149
149
+
"nixpkgs-lib": {
150
150
+
"locked": {
151
151
+
"dir": "lib",
152
152
+
"lastModified": 1690881714,
153
153
+
"narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=",
154
154
+
"owner": "NixOS",
155
155
+
"repo": "nixpkgs",
156
156
+
"rev": "9e1960bc196baf6881340d53dccb203a951745a2",
157
157
+
"type": "github"
158
158
+
},
159
159
+
"original": {
160
160
+
"dir": "lib",
161
161
+
"owner": "NixOS",
162
162
+
"ref": "nixos-unstable",
163
163
+
"repo": "nixpkgs",
164
164
+
"type": "github"
165
165
+
}
166
166
+
},
167
167
+
"nixpkgs-stable": {
168
168
+
"locked": {
169
169
+
"lastModified": 1685801374,
170
170
+
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
171
171
+
"owner": "NixOS",
172
172
+
"repo": "nixpkgs",
173
173
+
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
174
174
+
"type": "github"
175
175
+
},
176
176
+
"original": {
177
177
+
"owner": "NixOS",
178
178
+
"ref": "nixos-23.05",
179
179
+
"repo": "nixpkgs",
180
180
+
"type": "github"
181
181
+
}
182
182
+
},
183
183
+
"nixvim": {
184
184
+
"inputs": {
185
185
+
"beautysh": "beautysh",
186
186
+
"flake-utils": "flake-utils",
187
187
+
"nixpkgs": [
188
188
+
"nixpkgs"
189
189
+
],
190
190
+
"pre-commit-hooks": "pre-commit-hooks"
191
191
+
},
192
192
+
"locked": {
193
193
+
"lastModified": 1693402604,
194
194
+
"narHash": "sha256-pnmgGOZqWw4rQnF5Cq8P4xeTkQlj/qbzDjiJgCsVSS4=",
195
195
+
"owner": "nix-community",
196
196
+
"repo": "nixvim",
197
197
+
"rev": "26b202828f5227b1d06f6cc7ba723011679ff69e",
198
198
+
"type": "github"
199
199
+
},
200
200
+
"original": {
201
201
+
"owner": "nix-community",
202
202
+
"repo": "nixvim",
203
203
+
"type": "github"
204
204
+
}
205
205
+
},
206
206
+
"poetry2nix": {
207
207
+
"inputs": {
208
208
+
"flake-utils": [
209
209
+
"nixvim",
210
210
+
"beautysh",
211
211
+
"utils"
212
212
+
],
213
213
+
"nixpkgs": [
214
214
+
"nixvim",
215
215
+
"beautysh",
216
216
+
"nixpkgs"
217
217
+
]
218
218
+
},
219
219
+
"locked": {
220
220
+
"lastModified": 1658665240,
221
221
+
"narHash": "sha256-/wkx7D7enyBPRjIkK0w7QxLQhzEkb3UxNQnjyc3FTUI=",
222
222
+
"owner": "nix-community",
223
223
+
"repo": "poetry2nix",
224
224
+
"rev": "8b8edc85d24661d5a6d0d71d6a7011f3e699780f",
225
225
+
"type": "github"
226
226
+
},
227
227
+
"original": {
228
228
+
"owner": "nix-community",
229
229
+
"repo": "poetry2nix",
230
230
+
"type": "github"
231
231
+
}
232
232
+
},
233
233
+
"pre-commit-hooks": {
234
234
+
"inputs": {
235
235
+
"flake-compat": "flake-compat",
236
236
+
"flake-utils": "flake-utils_2",
237
237
+
"gitignore": "gitignore",
238
238
+
"nixpkgs": [
239
239
+
"nixvim",
240
240
+
"nixpkgs"
241
241
+
],
242
242
+
"nixpkgs-stable": "nixpkgs-stable"
243
243
+
},
244
244
+
"locked": {
245
245
+
"lastModified": 1692274144,
246
246
+
"narHash": "sha256-BxTQuRUANQ81u8DJznQyPmRsg63t4Yc+0kcyq6OLz8s=",
247
247
+
"owner": "cachix",
248
248
+
"repo": "pre-commit-hooks.nix",
249
249
+
"rev": "7e3517c03d46159fdbf8c0e5c97f82d5d4b0c8fa",
250
250
+
"type": "github"
251
251
+
},
252
252
+
"original": {
253
253
+
"owner": "cachix",
254
254
+
"repo": "pre-commit-hooks.nix",
255
255
+
"type": "github"
256
256
+
}
257
257
+
},
258
258
+
"root": {
259
259
+
"inputs": {
260
260
+
"astro-nvim": "astro-nvim",
261
261
+
"flake-parts": "flake-parts",
262
262
+
"nixpkgs": "nixpkgs",
263
263
+
"nixvim": "nixvim"
264
264
+
}
265
265
+
},
266
266
+
"systems": {
267
267
+
"locked": {
268
268
+
"lastModified": 1681028828,
269
269
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
270
270
+
"owner": "nix-systems",
271
271
+
"repo": "default",
272
272
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
273
273
+
"type": "github"
274
274
+
},
275
275
+
"original": {
276
276
+
"owner": "nix-systems",
277
277
+
"repo": "default",
278
278
+
"type": "github"
279
279
+
}
280
280
+
},
281
281
+
"systems_2": {
282
282
+
"locked": {
283
283
+
"lastModified": 1681028828,
284
284
+
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
285
285
+
"owner": "nix-systems",
286
286
+
"repo": "default",
287
287
+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
288
288
+
"type": "github"
289
289
+
},
290
290
+
"original": {
291
291
+
"owner": "nix-systems",
292
292
+
"repo": "default",
293
293
+
"type": "github"
294
294
+
}
295
295
+
},
296
296
+
"utils": {
297
297
+
"locked": {
298
298
+
"lastModified": 1678901627,
299
299
+
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
300
300
+
"owner": "numtide",
301
301
+
"repo": "flake-utils",
302
302
+
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
303
303
+
"type": "github"
304
304
+
},
305
305
+
"original": {
306
306
+
"owner": "numtide",
307
307
+
"repo": "flake-utils",
308
308
+
"type": "github"
309
309
+
}
310
310
+
}
311
311
+
},
312
312
+
"root": "root",
313
313
+
"version": 7
314
314
+
}
···
1
1
+
{
2
2
+
description = "lassulus superconfig";
3
3
+
4
4
+
inputs = {
5
5
+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6
6
+
7
7
+
nixvim.url = "github:nix-community/nixvim";
8
8
+
nixvim.inputs.nixpkgs.follows = "nixpkgs";
9
9
+
10
10
+
astro-nvim.url = "github:AstroNvim/AstroNvim";
11
11
+
astro-nvim.flake = false;
12
12
+
};
13
13
+
14
14
+
outputs = inputs@{ flake-parts, ... }:
15
15
+
flake-parts.lib.mkFlake { inherit inputs; } {
16
16
+
imports = [
17
17
+
# To import a flake module
18
18
+
# 1. Add foo to inputs
19
19
+
# 2. Add foo as a parameter to the outputs function
20
20
+
# 3. Add here: foo.flakeModule
21
21
+
./tools/nvim.nix
22
22
+
./tools/astronvim/flake-module.nix
23
23
+
24
24
+
];
25
25
+
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
26
26
+
perSystem = { config, self', inputs', pkgs, system, ... }: {
27
27
+
# Per-system attributes can be defined here. The self' and inputs'
28
28
+
# module parameters provide easy access to attributes of the same
29
29
+
# system.
30
30
+
31
31
+
# Equivalent to inputs'.nixpkgs.legacyPackages.hello;
32
32
+
packages.default = pkgs.hello;
33
33
+
};
34
34
+
flake = {
35
35
+
# The usual flake attributes can be defined here, including system-
36
36
+
# agnostic ones like nixosModule and system-enumerating ones, although
37
37
+
# those are more easily expressed in perSystem.
38
38
+
39
39
+
};
40
40
+
};
41
41
+
}
···
1
1
+
{ inputs, ... }:
2
2
+
{
3
3
+
perSystem = { system, ... }: {
4
4
+
packages.nvim = inputs.nixvim.legacyPackages.${system}.makeNixvim {
5
5
+
colorschemes.gruvbox.enable = true;
6
6
+
options = {
7
7
+
mouse = "a";
8
8
+
pastetoggle = "<INS>";
9
9
+
undofile = {};
10
10
+
undolevels = 10000;
11
11
+
undoreload = 10000;
12
12
+
};
13
13
+
extraConfigVim = ''
14
14
+
set list listchars=tab:⇥\ ,extends:❯,precedes:❮,nbsp:␣,trail:· showbreak=¬
15
15
+
set et
16
16
+
'';
17
17
+
maps.normalVisualOp = {
18
18
+
"<C-c>" = ":q<cr>";
19
19
+
};
20
20
+
plugins.lsp = {
21
21
+
enable = true;
22
22
+
};
23
23
+
};
24
24
+
};
25
25
+
}
···
1
1
+
{ inputs , ... }:
2
2
+
{
3
3
+
perSystem = { system, lib, pkgs, ... }: let
4
4
+
langs = [
5
5
+
# "agda"
6
6
+
"bash"
7
7
+
"c"
8
8
+
"c-sharp"
9
9
+
"cpp"
10
10
+
"css"
11
11
+
"elm"
12
12
+
"elisp"
13
13
+
#"fluent"
14
14
+
"go"
15
15
+
"hcl"
16
16
+
"haskell"
17
17
+
"html"
18
18
+
"janet-simple"
19
19
+
"java"
20
20
+
"javascript"
21
21
+
"jsdoc"
22
22
+
"json"
23
23
+
"julia"
24
24
+
"ocaml"
25
25
+
"pgn"
26
26
+
"php"
27
27
+
"python"
28
28
+
"ruby"
29
29
+
"rust"
30
30
+
"scala"
31
31
+
# "swift"
32
32
+
"typescript"
33
33
+
"yaml"
34
34
+
"nix"
35
35
+
"lua"
36
36
+
"markdown-inline"
37
37
+
"perl"
38
38
+
"make"
39
39
+
"toml"
40
40
+
];
41
41
+
nvim_deps = with pkgs; [
42
42
+
nodejs # copilot
43
43
+
vale
44
44
+
terraform-ls
45
45
+
nodePackages.pyright
46
46
+
sumneko-lua-language-server
47
47
+
48
48
+
# based on ./suggested-pkgs.json nvim
49
49
+
delve
50
50
+
gopls
51
51
+
golangci-lint
52
52
+
nodePackages.bash-language-server
53
53
+
taplo-lsp
54
54
+
marksman
55
55
+
rust-analyzer
56
56
+
yaml-language-server
57
57
+
nil
58
58
+
gomodifytags
59
59
+
gofumpt
60
60
+
iferr
61
61
+
impl
62
62
+
gotools
63
63
+
shellcheck
64
64
+
shfmt
65
65
+
isort
66
66
+
black
67
67
+
ruff
68
68
+
nixpkgs-fmt
69
69
+
terraform-ls
70
70
+
clang-tools
71
71
+
nodePackages.prettier
72
72
+
stylua
73
73
+
# does not build yet on aarch64
74
74
+
] ++ lib.optional (pkgs.stdenv.hostPlatform.system == "x86_64-linux") pkgs.deno; # lsp
75
75
+
nvim_config = pkgs.runCommand "nvim_config" { } ''
76
76
+
mkdir -p $out/nvim/parser
77
77
+
78
78
+
ln -s ${inputs.astro-nvim}/* $out/nvim/
79
79
+
rm $out/nvim/lua
80
80
+
mkdir -p $out/nvim/lua
81
81
+
ln -s ${inputs.astro-nvim}/lua/* $out/nvim/lua
82
82
+
ln -s ${./user} $out/nvim/lua/user
83
83
+
84
84
+
${lib.concatMapStringsSep "\n" (name: ''
85
85
+
ln -s ${pkgs.tree-sitter.builtGrammars."tree-sitter-${name}"}/parser $out/nvim/parser/${name}.so
86
86
+
'') langs}
87
87
+
'';
88
88
+
in {
89
89
+
packages.asvim = pkgs.writers.writeDashBin "asvim" ''
90
90
+
unset VIMINIT
91
91
+
export PATH=$PATH:${lib.makeBinPath nvim_deps}
92
92
+
XDG_CONFIG_HOME=${nvim_config} ${pkgs.neovim}/bin/nvim "$@"
93
93
+
'';
94
94
+
};
95
95
+
}
···
1
1
+
column_width = 120
2
2
+
line_endings = "Unix"
3
3
+
indent_type = "Spaces"
4
4
+
indent_width = 2
5
5
+
quote_style = "AutoPreferDouble"
6
6
+
call_parentheses = "None"
7
7
+
collapse_simple_statement = "Always"
···
1
1
+
vim.api.nvim_create_user_command("RaiseTmuxPane", function()
2
2
+
-- run shell command
3
3
+
4
4
+
local out = vim.fn.system "tmux list-panes -a -F '#I #{pane_tty}'"
5
5
+
local tty = vim.env.TTY
6
6
+
if tty == nil then return end
7
7
+
local _, _, window_id = string.find(out, "(%d+) " .. tty)
8
8
+
if window_id == nil then return end
9
9
+
vim.fn.system("tmux select-window -t '" .. window_id .. "'")
10
10
+
end, {})
11
11
+
12
12
+
vim.api.nvim_create_user_command("Nurl", function()
13
13
+
local url = vim.fn.input("Enter a URL: ")
14
14
+
local rev = vim.fn.input("Enter the revision (e.g., v0.2.0 or empty string): ")
15
15
+
16
16
+
local cmd = string.format('nurl %s %s 2>/dev/null', url, rev)
17
17
+
18
18
+
local output = vim.fn.systemlist(cmd)
19
19
+
if vim.v.shell_error == 0 and #output > 0 then
20
20
+
vim.api.nvim_put(output, "l", true, true)
21
21
+
else
22
22
+
print("Error executing command or command returned empty result.")
23
23
+
end
24
24
+
end, {})
25
25
+
26
26
+
return {
27
27
+
-- Configure AstroNvim updates
28
28
+
updater = {
29
29
+
remote = "origin", -- remote to use
30
30
+
channel = "stable", -- "stable" or "nightly"
31
31
+
version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
32
32
+
branch = "nightly", -- branch name (NIGHTLY ONLY)
33
33
+
commit = nil, -- commit hash (NIGHTLY ONLY)
34
34
+
pin_plugins = nil, -- nil, true, false (nil will pin plugins on stable only)
35
35
+
skip_prompts = false, -- skip prompts about breaking changes
36
36
+
show_changelog = true, -- show the changelog after performing an update
37
37
+
auto_quit = false, -- automatically quit the current session after a successful update
38
38
+
remotes = { -- easily add new remotes to track
39
39
+
-- ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
40
40
+
-- ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
41
41
+
-- ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork
42
42
+
},
43
43
+
},
44
44
+
-- Set colorscheme to use
45
45
+
colorscheme = "gruvbox",
46
46
+
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
47
47
+
diagnostics = {
48
48
+
virtual_text = true,
49
49
+
underline = true,
50
50
+
},
51
51
+
lsp = {
52
52
+
config = {
53
53
+
clangd = {
54
54
+
cmd = { "clangd", "--offset-encoding=utf-16" },
55
55
+
},
56
56
+
vale = {
57
57
+
cmd = { "vale", "--lsp" },
58
58
+
filetypes = { "markdown", "text" },
59
59
+
},
60
60
+
},
61
61
+
-- customize lsp formatting options
62
62
+
formatting = {
63
63
+
-- control auto formatting on save
64
64
+
format_on_save = {
65
65
+
enabled = true, -- enable or disable format on save globally
66
66
+
allow_filetypes = { -- enable format on save for specified filetypes only
67
67
+
"go",
68
68
+
},
69
69
+
ignore_filetypes = { -- disable format on save for specified filetypes
70
70
+
-- "python",
71
71
+
},
72
72
+
},
73
73
+
disabled = { -- disable formatting capabilities for the listed language servers
74
74
+
-- disable lua_ls formatting capability if you want to use StyLua to format your lua code
75
75
+
-- "lua_ls",
76
76
+
},
77
77
+
timeout_ms = 1000, -- default format timeout
78
78
+
-- filter = function(client) -- fully override the default formatting function
79
79
+
-- return true
80
80
+
-- end
81
81
+
},
82
82
+
-- enable servers that you already have installed without mason
83
83
+
servers = {
84
84
+
"clangd",
85
85
+
"bashls",
86
86
+
"gopls",
87
87
+
"taplo",
88
88
+
"marksman",
89
89
+
"pyright",
90
90
+
"nil_ls",
91
91
+
"terraformls",
92
92
+
"lua_ls",
93
93
+
"vale",
94
94
+
"rust_analyzer",
95
95
+
"gopls",
96
96
+
"yamlls",
97
97
+
"denols",
98
98
+
},
99
99
+
},
100
100
+
-- Configure require("lazy").setup() options
101
101
+
lazy = {
102
102
+
defaults = { lazy = true },
103
103
+
-- Disable change detection because it caused nvim to constantly need 3-5% CPU, which is bad for battery life
104
104
+
change_detection = { enabled = false, },
105
105
+
performance = {
106
106
+
rtp = {
107
107
+
-- customize default disabled vim plugins
108
108
+
disabled_plugins = { "tohtml", "gzip", "matchit", "zipPlugin", "netrwPlugin", "tarPlugin" },
109
109
+
},
110
110
+
},
111
111
+
},
112
112
+
-- This function is run last and is a good place to configuring
113
113
+
-- augroups/autocommands and custom filetypes also this just pure lua so
114
114
+
-- anything that doesn't fit in the normal config locations above can go here
115
115
+
polish = function()
116
116
+
-- Set up custom filetypes
117
117
+
-- vim.filetype.add {
118
118
+
-- extension = {
119
119
+
-- foo = "fooscript",
120
120
+
-- },
121
121
+
-- filename = {
122
122
+
-- ["Foofile"] = "fooscript",
123
123
+
-- },
124
124
+
-- pattern = {
125
125
+
-- ["~/%.config/foo/.*"] = "fooscript",
126
126
+
-- },
127
127
+
-- }
128
128
+
end,
129
129
+
}
···
1
1
+
function open_or_create_file(tfilename)
2
2
+
-- complete filepath from the file where this is called
3
3
+
local parent = vim.fn.expand('%:p:h')
4
4
+
local newfilepath = parent .. '/' .. vim.fn.expand(tfilename)
5
5
+
6
6
+
if vim.fn.filereadable(newfilepath) ~= 1 then
7
7
+
-- create parent directory
8
8
+
vim.fn.system('mkdir -p ' .. vim.fn.shellescape(parent))
9
9
+
vim.fn.system('touch ' .. vim.fn.shellescape(newfilepath))
10
10
+
end
11
11
+
vim.cmd(':e ' .. newfilepath)
12
12
+
end
13
13
+
14
14
+
15
15
+
-- Mapping data with "desc" stored directly by vim.keymap.set().
16
16
+
--
17
17
+
-- Please use this mappings table to set keyboard mapping since this is the
18
18
+
-- lower level configuration and more robust one. (which-key will
19
19
+
-- automatically pick-up stored data by this setting.)
20
20
+
return {
21
21
+
-- first key is the mode
22
22
+
n = {
23
23
+
-- second key is the lefthand side of the map
24
24
+
25
25
+
-- navigate buffer tabs with `H` and `L`
26
26
+
-- L = {
27
27
+
-- function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end,
28
28
+
-- desc = "Next buffer",
29
29
+
-- },
30
30
+
-- H = {
31
31
+
-- function() require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end,
32
32
+
-- desc = "Previous buffer",
33
33
+
-- },
34
34
+
-- mappings seen under group name "Buffer"
35
35
+
["<leader>bD"] = {
36
36
+
function()
37
37
+
require("astronvim.utils.status").heirline.buffer_picker(function(bufnr) require("astronvim.utils.buffer").close(bufnr) end)
38
38
+
end,
39
39
+
desc = "Pick to close",
40
40
+
},
41
41
+
-- tables with the `name` key will be registered with which-key if it's installed
42
42
+
-- this is useful for naming menus
43
43
+
["<leader>b"] = { name = "Buffers" },
44
44
+
-- quick save
45
45
+
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
46
46
+
47
47
+
-- Don't error if file doesn't exist
48
48
+
["gf"] = { function() open_or_create_file(vim.fn.expand("<cfile>")) end, desc = "Create file" },
49
49
+
["<leader>*"] = { function() require("telescope.builtin").grep_string() end, desc = "Find for word under cursor", },
50
50
+
["<leader><leader>"] = { function() require("telescope.builtin").find_files() end, desc = "Find files" },
51
51
+
},
52
52
+
t = {
53
53
+
-- setting a mapping to false will disable it
54
54
+
-- ["<esc>"] = false,
55
55
+
},
56
56
+
c = {
57
57
+
-- setting a mapping to false will disable it
58
58
+
["w!!"] = { "w !sudo tee > /dev/null %", desc = "Write as sudo" },
59
59
+
}
60
60
+
}
···
1
1
+
-- set vim options here (vim.<first_key>.<second_key> = value)
2
2
+
return {
3
3
+
opt = {
4
4
+
-- set to true or false etc.
5
5
+
relativenumber = true, -- sets vim.opt.relativenumber
6
6
+
number = true, -- sets vim.opt.number
7
7
+
spell = false, -- sets vim.opt.spell
8
8
+
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
9
9
+
wrap = false, -- sets vim.opt.wrap
10
10
+
},
11
11
+
g = {
12
12
+
mapleader = " ", -- sets vim.g.mapleader
13
13
+
autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
14
14
+
cmp_enabled = true, -- enable completion at start
15
15
+
autopairs_enabled = true, -- enable autopairs at start
16
16
+
diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on)
17
17
+
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
18
18
+
ui_notifications_enabled = true, -- disable notifications when toggling UI elements
19
19
+
resession_enabled = false, -- enable experimental resession.nvim session management (will be default in AstroNvim v4)
20
20
+
},
21
21
+
}
22
22
+
-- If you need more control, you can use the function()...end notation
23
23
+
-- return function(local_vim)
24
24
+
-- local_vim.opt.relativenumber = true
25
25
+
-- local_vim.g.mapleader = " "
26
26
+
-- local_vim.opt.whichwrap = vim.opt.whichwrap - { 'b', 's' } -- removing option from list
27
27
+
-- local_vim.opt.shortmess = vim.opt.shortmess + { I = true } -- add to option list
28
28
+
--
29
29
+
-- return local_vim
30
30
+
-- end
···
1
1
+
# AstroNvim User Configuration Example
2
2
+
3
3
+
A user configuration template for [AstroNvim](https://github.com/AstroNvim/AstroNvim)
4
4
+
5
5
+
## 🛠️ Installation
6
6
+
7
7
+
#### Make a backup of your current nvim and shared folder
8
8
+
9
9
+
```shell
10
10
+
mv ~/.config/nvim ~/.config/nvim.bak
11
11
+
mv ~/.local/share/nvim ~/.local/share/nvim.bak
12
12
+
```
13
13
+
14
14
+
#### Clone AstroNvim
15
15
+
16
16
+
```shell
17
17
+
git clone https://github.com/AstroNvim/AstroNvim ~/.config/nvim
18
18
+
```
19
19
+
20
20
+
#### Create a new user repository from this template
21
21
+
22
22
+
Press the "Use this template" button above to create a new repository to store your user configuration.
23
23
+
24
24
+
You can also just clone this repository directly if you do not want to track your user configuration in GitHub.
25
25
+
26
26
+
#### Clone the repository
27
27
+
28
28
+
```shell
29
29
+
git clone https://github.com/<your_user>/<your_repository> ~/.config/nvim/lua/user
30
30
+
```
31
31
+
32
32
+
#### Start Neovim
33
33
+
34
34
+
```shell
35
35
+
nvim
36
36
+
```
···
1
1
+
return { -- this table overrides highlights in all themes
2
2
+
-- Normal = { bg = "#000000" },
3
3
+
}
···
1
1
+
return {
2
2
+
-- customize alpha options
3
3
+
{
4
4
+
"goolord/alpha-nvim",
5
5
+
opts = function(_, opts)
6
6
+
-- customize the dashboard header
7
7
+
opts.section.header.val = {
8
8
+
" █████ ███████ ████████ ██████ ██████",
9
9
+
"██ ██ ██ ██ ██ ██ ██ ██",
10
10
+
"███████ ███████ ██ ██████ ██ ██",
11
11
+
"██ ██ ██ ██ ██ ██ ██ ██",
12
12
+
"██ ██ ███████ ██ ██ ██ ██████",
13
13
+
" ",
14
14
+
" ███ ██ ██ ██ ██ ███ ███",
15
15
+
" ████ ██ ██ ██ ██ ████ ████",
16
16
+
" ██ ██ ██ ██ ██ ██ ██ ████ ██",
17
17
+
" ██ ██ ██ ██ ██ ██ ██ ██ ██",
18
18
+
" ██ ████ ████ ██ ██ ██",
19
19
+
}
20
20
+
return opts
21
21
+
end,
22
22
+
},
23
23
+
{
24
24
+
"gitsigns.nvim",
25
25
+
opts = function(_, opts)
26
26
+
opts.current_line_blame = true
27
27
+
return opts
28
28
+
end,
29
29
+
},
30
30
+
{
31
31
+
"nvim-neo-tree/neo-tree.nvim",
32
32
+
opts = {
33
33
+
follow_current_file = true,
34
34
+
},
35
35
+
},
36
36
+
-- override make command build since we provide the shared library with home-manager already
37
37
+
{ "nvim-telescope/telescope-fzf-native.nvim", build = "true", },
38
38
+
39
39
+
-- You can disable default plugins as follows:
40
40
+
-- { "max397574/better-escape.nvim", enabled = false },
41
41
+
--
42
42
+
-- You can also easily customize additional setup of plugins that is outside of the plugin's setup call
43
43
+
-- {
44
44
+
-- "L3MON4D3/LuaSnip",
45
45
+
-- config = function(plugin, opts)
46
46
+
-- require "plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call
47
47
+
-- -- add more custom luasnip configuration such as filetype extend or custom snippets
48
48
+
-- local luasnip = require "luasnip"
49
49
+
-- luasnip.filetype_extend("javascript", { "javascriptreact" })
50
50
+
-- end,
51
51
+
-- },
52
52
+
-- {
53
53
+
-- "windwp/nvim-autopairs",
54
54
+
-- config = function(plugin, opts)
55
55
+
-- require "plugins.configs.nvim-autopairs"(plugin, opts) -- include the default astronvim config that calls the setup call
56
56
+
-- -- add more custom autopairs configuration such as custom rules
57
57
+
-- local npairs = require "nvim-autopairs"
58
58
+
-- local Rule = require "nvim-autopairs.rule"
59
59
+
-- local cond = require "nvim-autopairs.conds"
60
60
+
-- npairs.add_rules(
61
61
+
-- {
62
62
+
-- Rule("$", "$", { "tex", "latex" })
63
63
+
-- -- don't add a pair if the next character is %
64
64
+
-- :with_pair(cond.not_after_regex "%%")
65
65
+
-- -- don't add a pair if the previous character is xxx
66
66
+
-- :with_pair(
67
67
+
-- cond.not_before_regex("xxx", 3)
68
68
+
-- )
69
69
+
-- -- don't move right when repeat character
70
70
+
-- :with_move(cond.none())
71
71
+
-- -- don't delete if the next character is xx
72
72
+
-- :with_del(cond.not_after_regex "xx")
73
73
+
-- -- disable adding a newline when you press <cr>
74
74
+
-- :with_cr(cond.none()),
75
75
+
-- },
76
76
+
-- -- disable for .vim files, but it work for another filetypes
77
77
+
-- Rule("a", "a", "-vim")
78
78
+
-- )
79
79
+
-- end,
80
80
+
-- },
81
81
+
-- By adding to the which-key config and using our helper function you can add more which-key registered bindings
82
82
+
-- {
83
83
+
-- "folke/which-key.nvim",
84
84
+
-- config = function(plugin, opts)
85
85
+
-- require "plugins.configs.which-key"(plugin, opts) -- include the default astronvim config that calls the setup call
86
86
+
-- -- Add bindings which show up as group name
87
87
+
-- local wk = require "which-key"
88
88
+
-- wk.register({
89
89
+
-- b = { name = "Buffer" },
90
90
+
-- }, { mode = "n", prefix = "<leader>" })
91
91
+
-- end,
92
92
+
-- },
93
93
+
}
···
1
1
+
-- customize mason plugins
2
2
+
local suggested_packages = {}
3
3
+
local utils = require "astronvim.utils"
4
4
+
5
5
+
local disable_auto_install = function(_, opts)
6
6
+
local data_dir = vim.fn.stdpath("data")
7
7
+
utils.list_insert_unique(suggested_packages, opts.ensure_installed or {})
8
8
+
local f = io.open(data_dir .. "/suggested-pkgs.json", "w")
9
9
+
f:write(vim.fn.json_encode(suggested_packages))
10
10
+
f:close()
11
11
+
12
12
+
opts.ensure_installed = {}
13
13
+
end
14
14
+
15
15
+
return {
16
16
+
-- use mason-lspconfig to configure LSP installations
17
17
+
{
18
18
+
"williamboman/mason-lspconfig.nvim",
19
19
+
-- overrides `require("mason-lspconfig").setup(...)`
20
20
+
opts = disable_auto_install,
21
21
+
},
22
22
+
-- use mason-null-ls to configure Formatters/Linter installation for null-ls sources
23
23
+
{
24
24
+
"jay-babu/mason-null-ls.nvim",
25
25
+
-- overrides `require("mason-null-ls").setup(...)`
26
26
+
opts = disable_auto_install,
27
27
+
},
28
28
+
{
29
29
+
"jay-babu/mason-nvim-dap.nvim",
30
30
+
-- overrides `require("mason-nvim-dap").setup(...)`
31
31
+
opts = disable_auto_install,
32
32
+
},
33
33
+
}
···
1
1
+
return {
2
2
+
"jose-elias-alvarez/null-ls.nvim",
3
3
+
opts = function(_, config)
4
4
+
-- config variable is the default configuration table for the setup function call
5
5
+
local null_ls = require "null-ls"
6
6
+
7
7
+
-- Check supported formatters and linters
8
8
+
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
9
9
+
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
10
10
+
config.sources = {
11
11
+
-- Set a formatter
12
12
+
null_ls.builtins.formatting.stylua,
13
13
+
14
14
+
-- html/css/js/ts/json/yaml/xml/markdown
15
15
+
null_ls.builtins.formatting.prettier,
16
16
+
17
17
+
-- go
18
18
+
null_ls.builtins.formatting.gofumpt,
19
19
+
null_ls.builtins.formatting.goimports,
20
20
+
null_ls.builtins.diagnostics.golangci_lint,
21
21
+
null_ls.builtins.code_actions.impl,
22
22
+
23
23
+
-- nix
24
24
+
null_ls.builtins.formatting.nixpkgs_fmt,
25
25
+
26
26
+
-- python
27
27
+
null_ls.builtins.formatting.black,
28
28
+
null_ls.builtins.formatting.isort,
29
29
+
null_ls.builtins.formatting.ruff,
30
30
+
31
31
+
-- c/c++
32
32
+
null_ls.builtins.formatting.clang_format,
33
33
+
34
34
+
-- rust
35
35
+
null_ls.builtins.formatting.rustfmt,
36
36
+
37
37
+
-- bash
38
38
+
null_ls.builtins.formatting.shfmt.with {
39
39
+
args = { "-i", "2" },
40
40
+
},
41
41
+
}
42
42
+
return config -- return final config table
43
43
+
end,
44
44
+
}
···
1
1
+
return {
2
2
+
"nvim-treesitter/nvim-treesitter",
3
3
+
config = function()
4
4
+
end,
5
5
+
opts = {
6
6
+
-- enable terraform using hcl
7
7
+
-- ensure_installed = { "lua" },
8
8
+
},
9
9
+
}
···
1
1
+
return {
2
2
+
{
3
3
+
"lewis6991/spaceless.nvim",
4
4
+
config = function() require("spaceless").setup() end,
5
5
+
},
6
6
+
}