dotfiles/nvim/lua/keymap.lua
2022-08-30 12:43:04 +02:00

33 lines
897 B
Lua

function map(mode, shortcut, command)
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
end
function nmap(shortcut, command)
map('n', shortcut, command)
end
function imap(shortcut, command)
map('i', shortcut, command)
end
function xmap(shortcut, command)
map('x', shortcut, command)
end
nmap("<SPACE>","<Nop>")
xmap("p",'\"_dP')
nmap("<leader>fg", "<cmd>lua require('telescope.builtin').live_grep()<cr>")
nmap("<leader>fb", "<cmd>lua require('telescope.builtin').buffers()<cr>")
nmap("<leader>fh", "<cmd>lua require('telescope.builtin').help_tags()<cr>")
nmap("<leader>ff", "<cmd>lua require('telescope.builtin').find_files()<cr>")
nmap("<leader>b","<cmd>lua require('telescope.builtin').buffers()<cr>")
nmap("<C-n>",":NvimTreeToggle<cr>")
nmap("<leader>r",":NvimTreeRefresh<cr>")
nmap("<leader>n",":NvimTreeToggle<cr>")
nmap("<leader>zn","zf%")