diff --git a/ansible/roles/neovim/files/nvim/lua/settings/keymap.lua b/ansible/roles/neovim/files/nvim/lua/settings/keymap.lua index 6ef2cd8..9bda706 100644 --- a/ansible/roles/neovim/files/nvim/lua/settings/keymap.lua +++ b/ansible/roles/neovim/files/nvim/lua/settings/keymap.lua @@ -1,2 +1,37 @@ vim.g.mapleader = " " vim.g.maplocalleader = " " + +local options = { + noremap = true, + silent = true +} + +-- Move the current line down one line in normal mode +vim.keymap.set('n', '', ":move .+1==", options) + +-- Move the current line up one line in normal mode +vim.keymap.set('n', '', ":move .-2==", options) + +-- Move the character under the cursor one character forward in normal mode +vim.keymap.set('n', '', "xp", options) + +-- Move the character under the cursor one character backward in normal mode +vim.keymap.set('n', '', "xhP", options) + +-- Move the current range down one line in visual-line mode +vim.keymap.set('x', '', ":move '>+1gv=gv", options) + +-- Move the current range up one line in visual-line mode +vim.keymap.set('x', '', ":move '<-2gv=gv", options) + +-- Move the current line down one line in insert mode +vim.keymap.set('i', '', ":move .+1==gi", options) + +-- Move the current line up one line in insert mode +vim.keymap.set('i', '', ":move .-2==gi", options) + +-- Move the character under the cursor one character forward in insert mode +vim.keymap.set('i', '', "lxpi", options) + +-- Move the character under the cursor one character backward in insert mode +vim.keymap.set('i', '', "lxhPi", options)