From ec950f9d196b54bbe382a035f01d12fcd172a9b8 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 17 Aug 2022 15:53:34 +0300 Subject: nvim: bring in leap.nvim, vim.keymap.set --- .config/nvim/lua/mappings.lua | 46 +++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 30 deletions(-) (limited to '.config/nvim/lua/mappings.lua') diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua index a324d90..db2a552 100644 --- a/.config/nvim/lua/mappings.lua +++ b/.config/nvim/lua/mappings.lua @@ -5,16 +5,6 @@ -- │▘▝ ▘▝▀▘▌ ▌ ▀▘▘ ▘▗▄▘▀▀ │ -- └────────────────────────┘ --- -- map helper --- local function map(mode, lhs, rhs, opts) --- local options = {noremap = true, silent = true} --- if opts then options = vim.tbl_extend('force', options, opts) end --- vim.api.nvim_set_keymap(mode, lhs, rhs, options) --- end - --- local cmd = vim.cmd --- local M = {} - -- brute force deasciify everything vim.keymap.set("n", "tc", "TurkishDeasciifyForce()", { expr = true }) vim.keymap.set("n", "tctc", "TurkishDeasciifyForce() .. '_'", { expr = true }) @@ -95,22 +85,11 @@ vim.keymap.set('v', '<', ' mappings should not be noremap --- -- https://www.reddit.com/r/vim/comments/78izt4/please_help_understand_how_to_use_plug_mapping/ --- local function plugmap(mode, lhs, rhs, opts) --- local options = {noremap = false, silent = true} --- if opts then options = vim.tbl_extend('force', options, opts) end --- vim.api.nvim_set_keymap(mode, lhs, rhs, options) --- end - --- sneak using grave, s is for sandwich -vim.keymap.set('n', '`', 'Sneak_s') -vim.keymap.set('n', '`', 'Sneak_s') -vim.keymap.set('n', '`', 'Sneak_S') +-- ` is more useful than ` vim.keymap.set('n', "'", '`') +-- plug mappings {{{ -- + -- use the special yoink paste that rotates vim.keymap.set('n', 'p', '(YoinkPaste_p)') vim.keymap.set('n', 'P', '(YoinkPaste_P)') @@ -162,11 +141,18 @@ vim.keymap.set('n', 'vr', ':NvimTreeRefresh') vim.keymap.set('n', 'vs', ':NvimTreeFindFile') -- dial.nvim mappings -vim.keymap.set("n", "", require("dial.map").inc_normal(), {noremap = true}) -vim.keymap.set("n", "", require("dial.map").dec_normal(), {noremap = true}) -vim.keymap.set("v", "", require("dial.map").inc_visual(), {noremap = true}) -vim.keymap.set("v", "", require("dial.map").dec_visual(), {noremap = true}) -vim.keymap.set("v", "g", require("dial.map").inc_gvisual(), {noremap = true}) -vim.keymap.set("v", "g", require("dial.map").dec_gvisual(), {noremap = true}) +local opts = { noremap=true, silent=true } +vim.keymap.set("n", "", require("dial.map").inc_normal(), opts) +vim.keymap.set("n", "", require("dial.map").dec_normal(), opts) +vim.keymap.set("v", "", require("dial.map").inc_visual(), opts) +vim.keymap.set("v", "", require("dial.map").dec_visual(), opts) +vim.keymap.set("v", "g", require("dial.map").inc_gvisual(), opts) +vim.keymap.set("v", "g", require("dial.map").dec_gvisual(), opts) + +-- leap.nvim mappings +vim.keymap.set('n', '`', '(leap-forward)', opts) +vim.keymap.set('n', '`', '(leap-backward)', opts) +vim.keymap.set('v', '`', '(leap-forward)', opts) +vim.keymap.set('v', '`', '(leap-backward)', opts) -- }}} plug mappings -- -- cgit v1.2.3-70-g09d2