2022-02-28 03:11:17 +00:00
|
|
|
local opts = { noremap = true, silent = true }
|
|
|
|
local map = vim.api.nvim_set_keymap
|
|
|
|
|
|
|
|
map("", "<Space>", "<Nop>", opts)
|
|
|
|
vim.g.mapleader = " "
|
|
|
|
vim.g.maplocalleader = " "
|
|
|
|
|
|
|
|
-- Window Navigation without needing <C-w> first
|
|
|
|
map("n", "<C-h>", "<C-w>h", opts)
|
|
|
|
map("n", "<C-j>", "<C-w>j", opts)
|
|
|
|
map("n", "<C-k>", "<C-w>k", opts)
|
|
|
|
map("n", "<C-l>", "<C-w>l", opts)
|
|
|
|
|
|
|
|
-- Resize with C-arrow
|
|
|
|
map("n", "<C-Up>", "<cmd>resize -2<CR>", opts)
|
|
|
|
map("n", "<C-Down>", "<cmd>resize +2<CR>", opts)
|
|
|
|
map("n", "<C-Left>", "<cmd>vertical resize -2<CR>", opts)
|
|
|
|
map("n", "<C-Right>", "<cmd>vertical resize +2<CR>", opts)
|
|
|
|
|
2022-02-28 05:45:40 +00:00
|
|
|
-- Navigate buffers with S-lh
|
|
|
|
map("n", "<S-l>", "<cmd>bnext<CR>", opts)
|
|
|
|
map("n", "<S-h>", "<cmd>bprevious<CR>", opts)
|
|
|
|
|
|
|
|
-- NvimTree
|
|
|
|
map('n', '<leader>e', '<cmd>NvimTreeToggle<CR>', opts)
|
|
|
|
map('n', '<leader>o', '<cmd>NvimTreeFocus<CR>', opts)
|
|
|
|
|
2022-02-28 14:41:22 +00:00
|
|
|
-- Comment
|
|
|
|
map('n', '<leader>/', '<cmd>lua require(\'Comment.api\').toggle_current_linewise()<CR>', opts)
|
|
|
|
map('v', '<leader>/', '<esc><cmd>lua require(\'Comment.api\').toggle_linewise_op(vim.fn.visualmode())<CR>', opts)
|
2022-02-28 05:45:40 +00:00
|
|
|
|