neovim/lua/keymappings.lua

16 lines
563 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>s", "<cmd>setlocal spell spelllang=en_us<cr>")
-- Toggle line numbers and file tree
utils.map("n", "<F3>", "<cmd>set nonumber!<CR>")
utils.map("n", "<F5>", "<cmd>NvimTreeToggle<CR>")