summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/mappings.lua
diff options
context:
space:
mode:
authorYigit Sever2022-08-17 15:53:34 +0300
committerYigit Sever2022-08-17 15:53:34 +0300
commitec950f9d196b54bbe382a035f01d12fcd172a9b8 (patch)
treebef76b090581490e54883468842f8e44c07321c3 /.config/nvim/lua/mappings.lua
parentbf6851e4dd0d5d9a9282d4c9528a29e6f7ffc1d6 (diff)
downloaddotfiles-ec950f9d196b54bbe382a035f01d12fcd172a9b8.tar.gz
dotfiles-ec950f9d196b54bbe382a035f01d12fcd172a9b8.tar.bz2
dotfiles-ec950f9d196b54bbe382a035f01d12fcd172a9b8.zip
nvim: bring in leap.nvim, vim.keymap.set
Diffstat (limited to '.config/nvim/lua/mappings.lua')
-rw-r--r--.config/nvim/lua/mappings.lua46
1 files changed, 16 insertions, 30 deletions
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 @@
5-- │▘▝ ▘▝▀▘▌ ▌ ▀▘▘ ▘▗▄▘▀▀ │ 5-- │▘▝ ▘▝▀▘▌ ▌ ▀▘▘ ▘▗▄▘▀▀ │
6-- └────────────────────────┘ 6-- └────────────────────────┘
7 7
8-- -- map helper
9-- local function map(mode, lhs, rhs, opts)
10-- local options = {noremap = true, silent = true}
11-- if opts then options = vim.tbl_extend('force', options, opts) end
12-- vim.api.nvim_set_keymap(mode, lhs, rhs, options)
13-- end
14
15-- local cmd = vim.cmd
16-- local M = {}
17
18-- brute force deasciify everything 8-- brute force deasciify everything
19vim.keymap.set("n", "<leader>tc", "TurkishDeasciifyForce()", { expr = true }) 9vim.keymap.set("n", "<leader>tc", "TurkishDeasciifyForce()", { expr = true })
20vim.keymap.set("n", "<leader>tctc", "TurkishDeasciifyForce() .. '_'", { expr = true }) 10vim.keymap.set("n", "<leader>tctc", "TurkishDeasciifyForce() .. '_'", { expr = true })
@@ -95,22 +85,11 @@ vim.keymap.set('v', '<', '<gv')
95vim.keymap.set('v', 'y', 'myy`y') 85vim.keymap.set('v', 'y', 'myy`y')
96vim.keymap.set('v', 'Y', 'myY`y') 86vim.keymap.set('v', 'Y', 'myY`y')
97 87
98-- plug mappings {{{ -- 88-- ` is more useful than `
99-- New vim.keymap.set handles Plug mappings, I think, remove this paragraph if nothing breaks in the upcoming days
100-- -- <Plug> mappings should not be noremap
101-- -- https://www.reddit.com/r/vim/comments/78izt4/please_help_understand_how_to_use_plug_mapping/
102-- local function plugmap(mode, lhs, rhs, opts)
103-- local options = {noremap = false, silent = true}
104-- if opts then options = vim.tbl_extend('force', options, opts) end
105-- vim.api.nvim_set_keymap(mode, lhs, rhs, options)
106-- end
107
108-- sneak using grave, s is for sandwich
109vim.keymap.set('n', '`', '<Plug>Sneak_s')
110vim.keymap.set('n', '`', '<Plug>Sneak_s')
111vim.keymap.set('n', '<Leader>`', '<Plug>Sneak_S')
112vim.keymap.set('n', "'", '`') 89vim.keymap.set('n', "'", '`')
113 90
91-- plug mappings {{{ --
92
114-- use the special yoink paste that rotates 93-- use the special yoink paste that rotates
115vim.keymap.set('n', 'p', '<Plug>(YoinkPaste_p)') 94vim.keymap.set('n', 'p', '<Plug>(YoinkPaste_p)')
116vim.keymap.set('n', 'P', '<Plug>(YoinkPaste_P)') 95vim.keymap.set('n', 'P', '<Plug>(YoinkPaste_P)')
@@ -162,11 +141,18 @@ vim.keymap.set('n', 'vr', ':NvimTreeRefresh<CR>')
162vim.keymap.set('n', 'vs', ':NvimTreeFindFile<CR>') 141vim.keymap.set('n', 'vs', ':NvimTreeFindFile<CR>')
163 142
164-- dial.nvim mappings 143-- dial.nvim mappings
165vim.keymap.set("n", "<C-a>", require("dial.map").inc_normal(), {noremap = true}) 144local opts = { noremap=true, silent=true }
166vim.keymap.set("n", "<C-x>", require("dial.map").dec_normal(), {noremap = true}) 145vim.keymap.set("n", "<C-a>", require("dial.map").inc_normal(), opts)
167vim.keymap.set("v", "<C-a>", require("dial.map").inc_visual(), {noremap = true}) 146vim.keymap.set("n", "<C-x>", require("dial.map").dec_normal(), opts)
168vim.keymap.set("v", "<C-x>", require("dial.map").dec_visual(), {noremap = true}) 147vim.keymap.set("v", "<C-a>", require("dial.map").inc_visual(), opts)
169vim.keymap.set("v", "g<C-a>", require("dial.map").inc_gvisual(), {noremap = true}) 148vim.keymap.set("v", "<C-x>", require("dial.map").dec_visual(), opts)
170vim.keymap.set("v", "g<C-x>", require("dial.map").dec_gvisual(), {noremap = true}) 149vim.keymap.set("v", "g<C-a>", require("dial.map").inc_gvisual(), opts)
150vim.keymap.set("v", "g<C-x>", require("dial.map").dec_gvisual(), opts)
151
152-- leap.nvim mappings
153vim.keymap.set('n', '`', '<Plug>(leap-forward)', opts)
154vim.keymap.set('n', '<Leader>`', '<Plug>(leap-backward)', opts)
155vim.keymap.set('v', '`', '<Plug>(leap-forward)', opts)
156vim.keymap.set('v', '<Leader>`', '<Plug>(leap-backward)', opts)
171 157
172-- }}} plug mappings -- 158-- }}} plug mappings --