Repository navigation
Expand file tree
/
Copy pathastrocore.lua
More file actions
107 lines (101 loc) · 4.73 KB
/
Copy pathastrocore.lua
File metadata and controls
107 lines (101 loc) · 4.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
-- AstroCore provides a central place to modify mappings, vim options, autocommands, and more!
-- Configuration documentation can be found with `:h astrocore`
-- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`)
-- as this provides autocomplete and documentation while editing
---@type LazySpec
return {
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
-- Configure core features of AstroNvim
features = {
large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
autopairs = true, -- enable autopairs at start
cmp = true, -- enable completion at start
diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on)
highlighturl = true, -- highlight URLs at start
notifications = true, -- enable notifications at start
},
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
diagnostics = {
virtual_text = true,
underline = true,
},
-- vim options can be configured here
options = {
opt = { -- vim.opt.<key>
relativenumber = true, -- sets vim.opt.relativenumber
number = true, -- sets vim.opt.number
spell = false, -- sets vim.opt.spell
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
wrap = false, -- sets vim.opt.wrap
},
g = { -- vim.g.<key>
-- configure global vim variables (vim.g)
-- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup`
-- This can be found in the `lua/lazy_setup.lua` file
python3_host_prog = "python",
["test#strategy"] = "shtuff",
shtuff_receiver = "devrunner",
["test#rust#runner"] = "cargonextest",
-- ["test#rust#cargotest#test_options"] = {
-- nearest = { "--", "--nocapture" },
-- },
},
},
-- Mappings can be configured through AstroCore as well.
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
mappings = {
-- first key is the mode
n = {
-- second key is the lefthand side of the map
-- navigate buffer tabs with `H` and `L`
-- L = {
-- function() require("astrocore.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end,
-- desc = "Next buffer",
-- },
-- H = {
-- function() require("astrocore.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end,
-- desc = "Previous buffer",
-- },
-- tables with just a `desc` key will be registered with which-key if it's installed
-- this is useful for naming menus
["<Leader>b"] = { desc = "Buffers" },
-- quick save
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
["<Leader>j"] = { desc = "vim-test" },
["<Leader>jn"] = { "<cmd>TestNearest<cr>", desc = "test near" },
["<Leader>jf"] = { "<cmd>TestFile<cr>", desc = "test file" },
["<Leader>ja"] = { "<cmd>TestSuite<cr>", desc = "test all" },
["<Leader>jl"] = { "<cmd>TestLast<cr>", desc = "test last" },
["<Leader>jv"] = { "<cmd>TestVisit<cr>", desc = "test visit" },
["<Leader>ws"] = { "<C-w>s", desc = "horizontal split window" },
["<Leader>wv"] = { "<C-w>v", desc = "vertical split window" },
["<Leader>wh"] = { "<C-w>h", desc = "left window" },
["<Leader>wj"] = { "<C-w>j", desc = "below window" },
["<Leader>wl"] = { "<C-w>l", desc = "right window" },
["<Leader>wk"] = { "<C-w>k", desc = "up window" },
["<Leader>ww"] = {
function() require("nvim_winpick").pick_focus_window() end,
desc = "Pick a window",
},
["<Leader>wc"] = {
function() require("nvim_winpick").pick_close_window() end,
desc = "Pick close window",
},
["<C-w>z"] = { "<cmd>WindowsMaximize<cr>", desc = "maximize windows" },
["gp"] = { desc = "Goto Preview" },
["gpd"] = { "<cmd>lua require('goto-preview').goto_preview_definition()<CR>", desc = "definition" },
["gpt"] = { "<cmd>lua require('goto-preview').goto_preview_type_definition()<CR>", desc = "type definition" },
["gpi"] = { "<cmd>lua require('goto-preview').goto_preview_implementation()<CR>", desc = "implementation" },
["gpr"] = { "<cmd>lua require('goto-preview').goto_preview_references()<CR>", desc = "references" },
},
v = {},
t = {
-- setting a mapping to false will disable it
-- ["<esc>"] = false,
["<esc>"] = { "<C-\\><C-n>", desc = "escape terminal" },
},
},
},
}