vim.g.mapleader = ' ' function map(mode, key, action) vim.api.nvim_set_keymap(mode, key, action, {noremap = true}) end function unmap(key) map('', key, '') end -- some unmaps unmap(' ') unmap('q') unmap('') -- option control map('n', 'c', ':setlocal cursorline!') map('n', 'l', ':setlocal list!') map('n', 'w', ':setlocal wrap!') -- search map('n', '/', ':noh') -- copy / paste map('n', 'y', '"+y') map('n', 'd', '"+d') map('n', 'p', '"+p') map('n', 'P', '"+P') -- keymap switch map('!', '', '') map('!', '', '')