|
|
|
@ -1,11 +1,13 @@
|
|
|
|
|
local opts = { noremap = true, silent = true }
|
|
|
|
|
|
|
|
|
|
-- Terminal options for.
|
|
|
|
|
local term_opts = { silent = true }
|
|
|
|
|
|
|
|
|
|
-- Shorten function name
|
|
|
|
|
-- Shorten function name.
|
|
|
|
|
local keymap = vim.api.nvim_set_keymap
|
|
|
|
|
|
|
|
|
|
--Remap space as leader key
|
|
|
|
|
--Re-map space as leader key.
|
|
|
|
|
--I already did this on vim & neovim(init.vim).
|
|
|
|
|
keymap("", "<Space>", "<Nop>", opts)
|
|
|
|
|
vim.g.mapleader = " "
|
|
|
|
|
vim.g.maplocalleader = " "
|
|
|
|
@ -20,47 +22,57 @@ vim.g.maplocalleader = " "
|
|
|
|
|
|
|
|
|
|
-- Normal --
|
|
|
|
|
-- Better window navigation
|
|
|
|
|
-- Exactly what I would have done...
|
|
|
|
|
keymap("n", "<C-h>", "<C-w>h", opts)
|
|
|
|
|
keymap("n", "<C-j>", "<C-w>j", opts)
|
|
|
|
|
keymap("n", "<C-k>", "<C-w>k", opts)
|
|
|
|
|
keymap("n", "<C-l>", "<C-w>l", opts)
|
|
|
|
|
|
|
|
|
|
-- Toggle NetRW Plugin for now...
|
|
|
|
|
keymap("n", "<leader>e", ":Lex 30<cr>", opts)
|
|
|
|
|
|
|
|
|
|
-- Resize with arrows
|
|
|
|
|
-- Resize with with Ctrl-Up/Down/Left/Right.
|
|
|
|
|
-- Tweaked slightly like on the Video-series.
|
|
|
|
|
keymap("n", "<C-Up>", ":resize +2<CR>", opts)
|
|
|
|
|
keymap("n", "<C-Down>", ":resize -2<CR>", opts)
|
|
|
|
|
keymap("n", "<C-Left>", ":vertical resize -2<CR>", opts)
|
|
|
|
|
keymap("n", "<C-Right>", ":vertical resize +2<CR>", opts)
|
|
|
|
|
keymap("n", "<C-Left>", ":vertical resize +2<CR>", opts)
|
|
|
|
|
keymap("n", "<C-Right>", ":vertical resize -2<CR>", opts)
|
|
|
|
|
|
|
|
|
|
-- Navigate buffers
|
|
|
|
|
-- Navigate buffers.
|
|
|
|
|
-- I like changing buffers this way,
|
|
|
|
|
-- b/c I was running into problems w/ Ctrl-f/b.
|
|
|
|
|
keymap("n", "<S-l>", ":bnext<CR>", opts)
|
|
|
|
|
keymap("n", "<S-h>", ":bprevious<CR>", opts)
|
|
|
|
|
|
|
|
|
|
-- Insert --
|
|
|
|
|
-- Press jk fast to enter
|
|
|
|
|
-- Press jk fast to enter Normal-mode, from Insert-mode.
|
|
|
|
|
keymap("i", "jk", "<ESC>", opts)
|
|
|
|
|
|
|
|
|
|
-- Visual --
|
|
|
|
|
-- Stay in indent mode
|
|
|
|
|
-- Stay in indent mode.
|
|
|
|
|
-- I like this idea.
|
|
|
|
|
keymap("v", "<", "<gv", opts)
|
|
|
|
|
keymap("v", ">", ">gv", opts)
|
|
|
|
|
|
|
|
|
|
-- Move text up and down
|
|
|
|
|
-- Move text highlights up & down.
|
|
|
|
|
keymap("v", "<A-j>", ":m .+1<CR>==", opts)
|
|
|
|
|
keymap("v", "<A-k>", ":m .-2<CR>==", opts)
|
|
|
|
|
keymap("v", "p", '"_dP', opts)
|
|
|
|
|
-- Subltle change, but if you paste over a visual selection;
|
|
|
|
|
-- Now it won't put what you pasted over into the 2-be-pasted-next buffer.
|
|
|
|
|
|
|
|
|
|
-- Visual Block --
|
|
|
|
|
-- Move text up and down
|
|
|
|
|
-- Move full lines Up/Down.
|
|
|
|
|
keymap("x", "J", ":move '>+1<CR>gv-gv", opts)
|
|
|
|
|
keymap("x", "K", ":move '<-2<CR>gv-gv", opts)
|
|
|
|
|
keymap("x", "<A-j>", ":move '>+1<CR>gv-gv", opts)
|
|
|
|
|
keymap("x", "<A-k>", ":move '<-2<CR>gv-gv", opts)
|
|
|
|
|
|
|
|
|
|
-- Terminal --
|
|
|
|
|
-- Better terminal navigation
|
|
|
|
|
keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", term_opts)
|
|
|
|
|
keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", term_opts)
|
|
|
|
|
keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
|
|
|
|
|
keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
|
|
|
|
|
-- Better terminal navigation... ???
|
|
|
|
|
-- This is the ONLY block I am not sure if I want to include in my config,
|
|
|
|
|
-- b/c I don't understand what it does; so I'll disable it for now...
|
|
|
|
|
-- keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", term_opts)
|
|
|
|
|
-- keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", term_opts)
|
|
|
|
|
-- keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
|
|
|
|
|
-- keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
|
|
|
|
|