.dotfiles/nvim/lua/mappings.lua

42 lines
1.1 KiB
Lua
Raw Normal View History

2022-04-14 20:38:59 +02:00
local map = require("utils").map
2022-01-23 23:24:50 +01:00
-- search for visual selection
map {'v', '//', 'y/<C-R>"<CR>'}
map {'n', 'H', '^'}
-- ex command
map {'c', '<C-p>', '<Up>'}
map {'c', '<C-n>', '<Down>'}
-- auto expand brackets
map {'i', '(;', '(<CR>)<C-c>O'}
map {'i', '(,', '(<CR>),<C-c>O'}
map {'i', '{;', '{<CR>}<C-c>O'}
map {'i', '{,', '{<CR>},<C-c>O'}
map {'i', '[;', '[<CR>]<C-c>O'}
map {'i', '[,', '[<CR>],<C-c>O'}
-- toggle hybrid mode
map {'n', '<leader>h', ':set rnu!<CR>'}
2022-01-24 00:49:38 +01:00
-- nvim-tree.lua
map {'n', '<leader>e', ':NvimTreeToggle<CR>'}
2022-01-23 23:24:50 +01:00
-- Telescope
map {'n', '<C-y>', '<cmd>Telescope buffers<CR>'}
map {'n', '<leader>f', '<cmd>Telescope find_files<CR>'}
map {'n', '<leader>l', '<cmd>Telescope live_grep<CR>'}
map {'n', '<silent> gy', '<cmd>Telescope treesitter<CR>'}
2022-04-14 20:38:59 +02:00
map {'n', '<leader>wm', '<cmd>lua require("notes").list()<CR>'}
map {'n', '<leader>wt', '<cmd>lua require("notes").tags()<CR>'}
2022-01-23 23:24:50 +01:00
-- neo formatter
map {'n', '<leader>p', ':Neoformat<CR>'}
-- goyo mapping
map {'n', '<silent> <leader>w', ':Goyo<CR>'}
-- spelling
map {'n', '<silent> <leader>se', ':set spell spelllang=en<CR>'}
map {'n', '<silent> <leader>sd', ':set spell spelllang=de<CR>'}