dotfiles/lua/keymappings.lua

16 lines
563 B
Lua
Raw Normal View History

2021-11-25 22:10:31 +01:00
local utils = require('utils')
2023-08-03 02:49:25 +02:00
-- Clear highlights (search + trailing whitespace)
utils.map('n', '<C-h>', '<cmd>noh<CR>')
utils.map("n", "<C-k>", "<cmd>let _s=@/<Bar>:%s/\\s\\+$//e<Bar>:let @/=_s<Bar><CR>")
-- Use tab and shift+tab to cycle buffers
utils.map("n", "<tab>", "<cmd>bn<cr>")
utils.map("n", "<S-tab>", "<cmd>bp<cr>")
-- Turn spellchecker on
utils.map("n", "<leader>s", "<cmd>setlocal spell spelllang=en_us<cr>")
2023-08-03 02:49:25 +02:00
-- Toggle line numbers and file tree
utils.map("n", "<F3>", "<cmd>set nonumber!<CR>")
utils.map("n", "<F5>", "<cmd>NvimTreeToggle<CR>")