From d77b55a6d17192a245b2af7548c8fe7a955e0933 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Tue, 14 Dec 2021 16:54:41 -0500 Subject: add keymaps --- lua/user/keymaps.lua | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 lua/user/keymaps.lua (limited to 'lua/user/keymaps.lua') diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua new file mode 100644 index 0000000..fb8fdb4 --- /dev/null +++ b/lua/user/keymaps.lua @@ -0,0 +1,70 @@ +local opts = { noremap = true, silent = true } + +local term_opts = { silent = true } + +-- Shorten function name +local keymap = vim.api.nvim_set_keymap + +--Remap space as leader key +keymap("", "", "", opts) +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- Modes +-- normal_mode = "n", +-- insert_mode = "i", +-- visual_mode = "v", +-- visual_block_mode = "x", +-- term_mode = "t", +-- command_mode = "c", + +-- Normal -- +-- Better window navigation +keymap("n", "", "h", opts) +keymap("n", "", "j", opts) +keymap("n", "", "k", opts) +keymap("n", "", "l", opts) + +keymap("n", "e", ":Lex 30", opts) + +-- Resize with arrows +keymap("n", "", ":resize -2", opts) +keymap("n", "", ":resize +2", opts) +keymap("n", "", ":vertical resize -2", opts) +keymap("n", "", ":vertical resize +2", opts) + +-- Navigate buffers +keymap("n", "", ":bnext", opts) +keymap("n", "", ":bprevious", opts) + +-- Move text up and down +keymap("n", "", ":m .+1==gi", opts) +keymap("n", "", ":m .-2==gi", opts) + +-- Insert -- +-- Press jk fast to enter +keymap("i", "jk", "", opts) + +-- Visual -- +-- Stay in indent mode +keymap("v", "<", "", ">gv", opts) + +-- Move text up and down +keymap("v", "", ":m .+1==", opts) +keymap("v", "", ":m .-2==", opts) +keymap("v", "p", '"_dP', opts) + +-- Visual Block -- +-- Move text up and down +keymap("x", "J", ":move '>+1gv-gv", opts) +keymap("x", "K", ":move '<-2gv-gv", opts) +keymap("x", "", ":move '>+1gv-gv", opts) +keymap("x", "", ":move '<-2gv-gv", opts) + +-- Terminal -- +-- Better terminal navigation +keymap("t", "", "h", term_opts) +keymap("t", "", "j", term_opts) +keymap("t", "", "k", term_opts) +keymap("t", "", "l", term_opts) -- cgit v1.2.3 From 4f2899202ef524a0264959feb6e4775b6e82b596 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sat, 18 Dec 2021 23:05:40 -0500 Subject: remove keymap --- lua/user/keymaps.lua | 4 ---- 1 file changed, 4 deletions(-) (limited to 'lua/user/keymaps.lua') diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index fb8fdb4..b4823fe 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -37,10 +37,6 @@ keymap("n", "", ":vertical resize +2", opts) keymap("n", "", ":bnext", opts) keymap("n", "", ":bprevious", opts) --- Move text up and down -keymap("n", "", ":m .+1==gi", opts) -keymap("n", "", ":m .-2==gi", opts) - -- Insert -- -- Press jk fast to enter keymap("i", "jk", "", opts) -- cgit v1.2.3 From e1ac27496fccd2e0accb79c6ac2097865feff14b Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Sun, 19 Dec 2021 13:16:43 -0500 Subject: update resize --- lua/user/keymaps.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua/user/keymaps.lua') diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index b4823fe..b3eb0d8 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -28,8 +28,8 @@ keymap("n", "", "l", opts) keymap("n", "e", ":Lex 30", opts) -- Resize with arrows -keymap("n", "", ":resize -2", opts) -keymap("n", "", ":resize +2", opts) +keymap("n", "", ":resize +2", opts) +keymap("n", "", ":resize -2", opts) keymap("n", "", ":vertical resize -2", opts) keymap("n", "", ":vertical resize +2", opts) -- cgit v1.2.3 From 2ea76f22329a1523502787ba13d62da1eb36bf58 Mon Sep 17 00:00:00 2001 From: "Vito G. Graffagnino" Date: Sat, 28 May 2022 11:15:19 +0100 Subject: keymaps: Changed leader key to ',' options: Allowed relative numbers, showmode --- lua/user/keymaps.lua | 6 +++--- lua/user/options.lua | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lua/user/keymaps.lua') diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index b3eb0d8..e66fca5 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -6,9 +6,9 @@ local term_opts = { silent = true } local keymap = vim.api.nvim_set_keymap --Remap space as leader key -keymap("", "", "", opts) -vim.g.mapleader = " " -vim.g.maplocalleader = " " +-- keymap("", "", "", opts) +vim.g.mapleader = "," +vim.g.maplocalleader = "," -- Modes -- normal_mode = "n", diff --git a/lua/user/options.lua b/lua/user/options.lua index 6b38e23..cf23784 100644 --- a/lua/user/options.lua +++ b/lua/user/options.lua @@ -7,16 +7,16 @@ local options = { fileencoding = "utf-8", -- the encoding written to a file hlsearch = true, -- highlight all matches on previous search pattern ignorecase = true, -- ignore case in search patterns - mouse = "a", -- allow the mouse to be used in neovim + mouse = "", -- allow the mouse to be used in neovim pumheight = 10, -- pop up menu height - showmode = false, -- we don't need to see things like -- INSERT -- anymore + showmode = true, -- we don't need to see things like -- INSERT -- anymore showtabline = 2, -- always show tabs smartcase = true, -- smart case smartindent = true, -- make indenting smarter again splitbelow = true, -- force all horizontal splits to go below current window splitright = true, -- force all vertical splits to go to the right of current window swapfile = false, -- creates a swapfile - -- termguicolors = true, -- set term gui colors (most terminals support this) + termguicolors = true, -- set term gui colors (most terminals support this) timeoutlen = 1000, -- time to wait for a mapped sequence to complete (in milliseconds) undofile = true, -- enable persistent undo updatetime = 300, -- faster completion (4000ms default) @@ -26,7 +26,7 @@ local options = { tabstop = 2, -- insert 2 spaces for a tab cursorline = true, -- highlight the current line number = true, -- set numbered lines - relativenumber = false, -- set relative numbered lines + relativenumber = true, -- set relative numbered lines numberwidth = 4, -- set number column width to 2 {default 4} signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time wrap = false, -- display lines as one long line -- cgit v1.2.3