dotfiles/.config/nvim/lua/user/keymaps.lua

17 lines
744 B
Lua

vim.g.mapleader = ' ' -- set <SPACE> as leader key
vim.keymap.set('n', '<leader>w', '<cmd>write<cr>') -- write file with leader w
vim.keymap.set('n', '<leader>e', '<cmd>NvimTreeToggle<cr>') -- open file explorer with leader e
-- set split navigation to cntrl+j/k/h/l
vim.keymap.set('n', '<C-j>', '<C-w>j')
vim.keymap.set('n', '<C-k>', '<C-w>k')
vim.keymap.set('n', '<C-h>', '<C-w>h')
vim.keymap.set('n', '<C-l>', '<C-w>l')
-- telescope keymaps
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})