caio.co/de/config.nvim


Use nvim 0.10+ default diagnostic bindings 💬 by Caio 6 months ago (log)
]d is bound by default. I barely use ]ed since I added telescope

I don't like the default open float binding but it's easy enough
to memorize

Blob lua/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
local map = vim.keymap.set

map('i', "<F1>", "<ESC>")
map('n', "<F1>", "<ESC>")
map('v', "<F1>", "<ESC>")

map('n', ",", "zA")
map('v', ",", "zA")

map('v', "'", "`")
map('v', "`", "'")

-- Re-select block after (de)indent
map('v', "<", "<gv")
map('v', ">", ">gv")

-- Faster window nagivation
map('n', '<C-h>', '<C-w>h')
map('n', '<C-l>', '<C-w>l')
map('n', '<C-j>', '<C-w>j')
map('n', '<C-k>', '<C-w>k')

-- Easier marking on intl keyboards
map('n', "'", "`")
map('n', "`", "'")

-- Faster buffer switching
map('n', "<leader>n", ":bn<CR>")
map('n', "<leader>m", ":bp<CR>")

-- Act like a normal thing when navigating wrapped lines
map('n', "k", "gk")
map('n', "j", "gj")

local opts = { silent = true }
map('n', "<leader><space>", ":nohlsearch<CR>", opts)

map('n', '0', ":lua require('custom').caret_or_zero()<CR>", opts)