generated from AstroNvim/user_example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmappings.lua
109 lines (104 loc) · 3.54 KB
/
mappings.lua
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
108
109
-- Mapping data with "desc" stored directly by vim.keymap.set().
--
-- Please use this mappings table to set keyboard mapping since this is the
-- lower level configuration and more robust one. (which-key will
-- automatically pick-up stored data by this setting.)
return {
-- first key is the mode
n = {
-- ["<C-,>"] = {
-- "<Cmd>ToggleTerm<CR>",
-- desc = "Toggle Terminal",
-- },
["<C-.>"] = {
"<Cmd>ToggleTerm size=60 direction=vertical<CR>",
desc = "Open vertical Terminal",
},
["<C-,>"] = {
"<Cmd>2ToggleTerm size=60 direction=vertical<CR>",
desc = "Open second vertical Terminal",
},
-- packagejson config manager
["<leader>ns"] = {
function() require("package-info").show() end,
desc = "show info package",
},
["<leader>np"] = {
function() require("package-info").change_version() end,
desc = "change version package json",
},
["<leader>nd"] = {
function() require("package-info").delete() end,
desc = "delete version package json",
},
["<leader>ni"] = {
function() require("package-info").install() end,
desc = "install version package json",
},
["<leader>fd"] = {
function() require("telescope.builtin").lsp_definitions { jump_type = "never" } end,
desc = "lsp definitions",
},
-- second key is the lefthand side of the map
-- navigate buffer tabs with `H` and `L`
L = {
function() require("astronvim.utils.buffer").nav(vim.v.count > 0 and vim.v.count or 1) end,
desc = "Next buffer",
},
H = {
function() require("astronvim.utils.buffer").nav(-(vim.v.count > 0 and vim.v.count or 1)) end,
desc = "Previous buffer",
},
-- mappings seen under group name "Buffer"
["<leader>bD"] = {
function()
require("astronvim.utils.status").heirline.buffer_picker(
function(bufnr) require("astronvim.utils.buffer").close(bufnr) end
)
end,
desc = "Pick to close",
},
-- tables with the `name` key will be registered with which-key if it's installed
-- this is useful for naming menus
["<leader>b"] = { name = "Buffers" },
["<leader>aa"] = { "ggyG", desc = "Copy whole buffer" },
["<leader>ac"] = { "ggdG", desc = "Cut whole buffer" },
["<leader>pp"] = { '"0p', desc = "Put from 0 register" },
["<C-u>"] = { "<C-u>zz", desc = "Up and center" },
["<C-d>"] = { "<C-d>zz", desc = "Down and center" },
-- quick save
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
["<leader>w"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
["<leader>q"] = { "::wall|qa!<cr>", desc = "Save all and quit" }, -- change description but the same command
},
i = {
-- ["<C-,>"] = {
-- "<Cmd>ToggleTerm<CR>",
-- desc = "Toggle Terminal",
-- },
["<C-.>"] = {
"<Cmd>ToggleTerm size=60 direction=vertical<CR>",
desc = "Open vertical Terminal",
},
["<C-,>"] = {
"<Cmd>2ToggleTerm size=60 direction=vertical<CR>",
desc = "Open second vertical Terminal",
},
},
t = {
-- ["<C-,>"] = {
-- "<Cmd>ToggleTerm<CR>",
-- desc = "Toggle Terminal",
-- },
["<C-.>"] = {
"<Cmd>ToggleTerm size=60 direction=vertical<CR>",
desc = "Open vertical Terminal",
},
["<C-,>"] = {
"<Cmd>2ToggleTerm size=60 direction=vertical<CR>",
desc = "Open second vertical Terminal",
},
-- setting a mapping to false will disable it
-- ["<esc>"] = false,
},
}