From bd967d889e7f86b3940a5f25fe40266a4708ba6c Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Wed, 13 Sep 2023 19:21:24 +0200 Subject: [PATCH] Add move plugin --- lua/plugins/config/move.lua | 27 +++++++++++++++++++++++++++ lua/plugins/init.lua | 4 ++++ 2 files changed, 31 insertions(+) create mode 100644 lua/plugins/config/move.lua diff --git a/lua/plugins/config/move.lua b/lua/plugins/config/move.lua new file mode 100644 index 0000000..b901f24 --- /dev/null +++ b/lua/plugins/config/move.lua @@ -0,0 +1,27 @@ +--[[ + Copyright 2023 Oscar Wallberg + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +]] + +-- https://github.com/fedepujol/move.nvim + +local opts = { noremap = true, silent = true, } +vim.keymap.set("n", "", ":MoveLine(1)", opts) +vim.keymap.set("n", "", ":MoveLine(-1)", opts) +vim.keymap.set("n", "", ":MoveHChar(-1)", opts) +vim.keymap.set("n", "", ":MoveHChar(1)", opts) +vim.keymap.set("x", "", ":MoveBlock(1)", opts) +vim.keymap.set("x", "", ":MoveBlock(-1)", opts) +vim.keymap.set("x", "", ":MoveHBlock(-1)", opts) +vim.keymap.set("x", "", ":MoveHBlock(1)", opts) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 5979cb6..89d0ce1 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -204,6 +204,10 @@ local plugins = { "nvim-treesitter/nvim-treesitter-context", config = function () require("plugins.config.treesitter-context") end, }, + { + 'fedepujol/move.nvim', + config = function () require("plugins.config.move") end, + } } local opts = {}