.config/nvim/lua/config/maps.lua

Mon, 13 Feb 2023 21:25:15 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 13 Feb 2023 21:25:15 -0600
changeset 1019
7e42fd320166
parent 1017
6944e81bc60f
child 1020
b1b644e9825d
permissions
-rw-r--r--

Further nvim work

1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 local map = vim.keymap
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 local opts = {noremap = true, silent = true}
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 map.set("n", "<F2>", ":20Lexplore<CR>", opts)
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 map.set("n", "<F3>", "n", opts)
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 map.set("n", "<S-F3>", "N", opts)
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 map.set("", "<F4>", ":let v:hlsearch = !v:hlsearch<CR>", opts)
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 -- map.set("n", "<F5>", ":UndotreeToggle<CR>", opts)
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 -- map.set("n", "<F8>", ":TagbarToggle<CR>", opts)
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 -- Allow :noh even in insert mode
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 map.set("i", "<F4>", "<C-O><F4>")
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 -- cover for search habit
1017
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
16 map.set("c", "<F3>", "<CR>", opts)
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
17
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
18 map.set("n", "<leader>cd", ":cd %:p:h<CR>:pwd<CR>", opts)
1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
19
1017
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
20 map.set("n", "<C-h>", "<C-w>h", opts)
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
21 map.set("n", "<C-j>", "<C-w>j", opts)
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
22 map.set("n", "<C-k>", "<C-w>k", opts)
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
23 map.set("n", "<C-l>", "<C-w>l", opts)
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
24 map.set("n", "<C-\\>", "<C-w>p", opts)
1015
21950cadff6b Ongoing nvim config
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
25
1017
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
26 map.set("n", "gb", "<C-^>", opts)
6944e81bc60f A few more maps
Meredith Howard <mhoward@roomag.org>
parents: 1015
diff changeset
27 map.set("n", "gB", ":ls<CR>:b ", {noremap = true})

mercurial