nixos/config/nvim/lua/keymaps.lua

40 lines
1.8 KiB
Lua

vim.g.mapleader = ' '
vim.keymap.set('i', 'jk', '<esc>')
-- Toggleterm
vim.keymap.set('n', '<leader>th', '<cmd>ToggleTerm direction=horizontal<cr>')
vim.keymap.set('n', '<leader>tv', '<cmd>ToggleTerm direction=vertical<cr>')
vim.keymap.set('n', '<leader>tf', '<cmd>ToggleTerm direction=float<cr>')
vim.keymap.set('n', '<leader>tt', '<cmd>ToggleTerm direction=tab<cr>')
-- Aerial
vim.keymap.set('n', '<leader>aa', '<cmd>AerialToggle<cr>')
-- Telescope
vim.keymap.set('n', '<leader>;', '<cmd>Telescope builtin<cr>')
vim.keymap.set('n', '<leader>ff', '<cmd>Telescope find_files<cr>')
vim.keymap.set('n', '<leader>fg', '<cmd>Telescope live_grep<cr>')
vim.keymap.set('n', '<leader>fp', '<cmd>Telescope projects<cr>')
vim.keymap.set('n', '<leader>fa', '<cmd>Telescope aerial<cr>')
vim.keymap.set('n', '<leader>fl', '<cmd>Telescope lsp_document_symbols<cr>')
vim.keymap.set('n', '<leader>fe', '<cmd>Telescope diagnostics<cr>')
vim.keymap.set('n', '<leader>fs', '<cmd>Telescope treesitter<cr>')
vim.keymap.set('n', '<leader>fz', '<cmd>Telescope current_buffer_fuzzy_find<cr>')
-- Nvim-tree
vim.keymap.set('n', '<leader>n', '<cmd>NvimTreeToggle<cr>')
-- Trouble
vim.keymap.set('n', '<leader>xx', '<cmd>TroubleToggle<cr>')
vim.keymap.set('n', '<leader>xw', '<cmd>TroubleToggle workspace_diagnostics<cr>')
vim.keymap.set('n', '<leader>xd', '<cmd>TroubleToggle document_diagnostics<cr>')
vim.keymap.set('n', '<leader>xq', '<cmd>TroubleToggle quickfix<cr>')
vim.keymap.set('n', '<leader>xl', '<cmd>TroubleToggle loclist<cr>')
-- Navigator
vim.keymap.set({'n', 't'}, '<A-h>', '<CMD>NavigatorLeft<CR>')
vim.keymap.set({'n', 't'}, '<A-l>', '<CMD>NavigatorRight<CR>')
vim.keymap.set({'n', 't'}, '<A-k>', '<CMD>NavigatorUp<CR>')
vim.keymap.set({'n', 't'}, '<A-j>', '<CMD>NavigatorDown<CR>')
vim.keymap.set({'n', 't'}, '<A-p>', '<CMD>NavigatorPrevious<CR>')