summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/mango/remap.lua
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-11-07 04:01:31 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-11-07 04:01:31 +0100
commit5a0c981679093abe6185fc9782a172bfc41f8252 (patch)
tree05a7bc6bad08cced66382be4b0e937c6a0fdd919 /.config/nvim/lua/mango/remap.lua
parent2653fc8a4946863324b279fa4087707d0bffecb7 (diff)
nvim: Rework sorting and transposition
Diffstat (limited to '.config/nvim/lua/mango/remap.lua')
-rw-r--r--.config/nvim/lua/mango/remap.lua19
1 files changed, 4 insertions, 15 deletions
diff --git a/.config/nvim/lua/mango/remap.lua b/.config/nvim/lua/mango/remap.lua
index 824ad53..2c41cfc 100644
--- a/.config/nvim/lua/mango/remap.lua
+++ b/.config/nvim/lua/mango/remap.lua
@@ -42,18 +42,10 @@ remap('i', '<C-+>', '"+pa')
remap('nv', "'", '`')
remap('nv', '`', "'")
--- Transpose characters without clobbering registers
-local function transpose_chars(rev)
- lib.save_regs('a', function()
- vim.cmd.normal('"a' .. (rev and 'X' or 'x') .. '"ap')
- end)
-end
-
--- Transpose characters
-remap('n', '<leader>t', transpose_chars)
-remap('n', '<leader>T', function()
- transpose_chars(true)
-end)
+-- Transpose characters; for some reason it has a noticable delay if I just give
+-- a string instead of lambda functions
+remap('n', '<leader>t', function() vim.cmd.normal('"zx"zp') end)
+remap('n', '<leader>T', function() vim.cmd.normal('"zX"zp') end)
-- Open netrw quickly
remap('n', '-', ':Ex<CR>')
@@ -63,6 +55,3 @@ remap('n', '-', ':Ex<CR>')
-- bottom instead of the left or top
remap('n', '–', ':vsplit | Ex<CR>')
remap('n', 'g–', ':split | Ex<CR>')
-
--- Sort lines in selection
-remap('v', 's', ':sort<CR>')