vim.g.mapleader = ' ' function unmap(key) vim.api.nvim_set_keymap('', key, '', {}) end function map(mode, key, action) vim.api.nvim_set_keymap(mode, key, action, {noremap = true}) 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('!', '', '')