-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastrocore.lua
More file actions
67 lines (67 loc) · 3.41 KB
/
Copy pathastrocore.lua
File metadata and controls
67 lines (67 loc) · 3.41 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
---@type LazySpec
return {
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
options = {
opt = { -- vim.opt.<key>
-- list = true, -- show listchars, default - false
listchars = { tab = ">·", eol = "·" },
colorcolumn = "100",
},
g = { -- vim.g.<key>
-- :lua =vim.b.gitsigns_status_dict["root"] -- package root path
-- :echo g:python3_host_prog | :lua =vim.g.python3_host_prog
python3_host_prog = vim.fn.expand("~/.venv/bin/python"),
},
},
mappings = {
-- vim.keymap.set()
v = { -- visual mode
["x"] = { '"_x' },
},
i = { -- insert mode
-- im: ^V + key -> shortkey
["<C-s>"] = { "<Esc><C-s>" },
["<C-q>"] = { "<Esc><C-q>" },
},
n = { -- normal mode
["x"] = { '"_x' },
["X"] = { '"_X' },
["|"] = false, -- :nunmap | :map - all map
["\\"] = { false, desc = "Alt" },
["\\d"] = { '"_d', desc = "Alt" },
["\\dd"] = { '"_dd', desc = "Alt" },
-- shortkeys --
-- ~/.local/share/nvim/lazy/AstroNvim/lua/astronvim/plugins/_astrocore_mappings.lua
["<C-s>"] = { "<Cmd>w<CR>", desc = "Write" },
["<M-s>"] = { "<cmd>w!<cr>", desc = "Force write" },
["<C-q>"] = { function() require("astrocore.buffer").close() end, desc = "Close buffer" },
["<M-q>"] = { "<cmd>qa!<cr>", desc = "Force quit" },
-- ["<C-q>"] = { function() local _bufs = #vim.t.bufs; require("astrocore.buffer").close();
-- if _bufs == 1 and #vim.t.bufs == 1 then vim.cmd("conf q") end end, desc = "Smart close buffer" },
["<C-\\>"] = { function() require('smart-splits').move_cursor_previous() end, desc = "Move to previous split" },
-- :bf[irst] :bl[ast] :[#]bn[ext] :[#]bp[rev] :ls[buffers] :b # - alternate C-^ :lua =#vim.t.bufs
["<M-j>"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Prev buffer [b :bp" },
["<M-k>"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer ]b :bn" },
["<M-J>"] = { function() require("astrocore.buffer").move(-vim.v.count1) end, desc = "Move buffer tab left <b" },
["<M-K>"] = { function() require("astrocore.buffer").move(vim.v.count1) end, desc = "Move buffer tab right >b" },
["<M-C-[>"] = { "<M-j>" },
["<M-C-]>"] = { "<M-k>" },
-- leader --
["<Leader>\\"] = { "<Cmd>split<cr>", desc = "Horizontal Split" },
["<Leader>|"] = { "<Cmd>vsplit<cr>", desc = "Vertical Split" },
["<Leader>."] = { function() vim.opt.list = not(vim.opt.list:get()) end, desc = "Toggle list mode" }, -- se list!
["<Leader>>"] = { function() if vim.opt.colorcolumn:get()[1] == "100" then vim.opt.colorcolumn = ""
else vim.opt.colorcolumn = "100" end end, desc = "Toggle column cc=100"
},
["<Leader><"] = { function() if vim.opt.colorcolumn:get()[1] == "80" then vim.opt.colorcolumn = ""
else vim.opt.colorcolumn = "80" end end, desc = "Toggle column cc=80"
},
["<Leader>m"] = { "<Cmd>if &cole | se cole=0 | else | se cole=2 | endif<CR>", desc = "Toggle markdown syntax" },
["<Leader>M"] = { "<Cmd>se ft=markdown cole=2 cc=80 ts=2 sw=2<CR>", desc = "Set filetype markdown" },
["<Leader>I"] = { "<Cmd>$pu!='\nvim:ft=markdown:cole=2:cc=80:ts=2:sw=2'<CR>", desc = "Insert filetype at EOL" },
},
},
},
}