dotfiles/lua/keymappings.lua
2024-01-03 02:10:43 +01:00

15 lines
559 B
Lua

local utils = require('utils')
-- 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>se", "<cmd>setlocal spell spelllang=en_us<cr>")
-- Toggle line numbers and file tree
utils.map("n", "<F3>", "<cmd>set nonumber!<CR>")
utils.map("n", "<leader>fe", "<cmd>Oil<CR>")