diff options
Diffstat (limited to '.config/nvim/lua/mappings.lua')
-rw-r--r-- | .config/nvim/lua/mappings.lua | 46 |
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 |
19 | vim.keymap.set("n", "<leader>tc", "TurkishDeasciifyForce()", { expr = true }) | 9 | vim.keymap.set("n", "<leader>tc", "TurkishDeasciifyForce()", { expr = true }) |
20 | vim.keymap.set("n", "<leader>tctc", "TurkishDeasciifyForce() .. '_'", { expr = true }) | 10 | vim.keymap.set("n", "<leader>tctc", "TurkishDeasciifyForce() .. '_'", { expr = true }) |
@@ -95,22 +85,11 @@ vim.keymap.set('v', '<', '<gv') | |||
95 | vim.keymap.set('v', 'y', 'myy`y') | 85 | vim.keymap.set('v', 'y', 'myy`y') |
96 | vim.keymap.set('v', 'Y', 'myY`y') | 86 | vim.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 | ||
109 | vim.keymap.set('n', '`', '<Plug>Sneak_s') | ||
110 | vim.keymap.set('n', '`', '<Plug>Sneak_s') | ||
111 | vim.keymap.set('n', '<Leader>`', '<Plug>Sneak_S') | ||
112 | vim.keymap.set('n', "'", '`') | 89 | vim.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 |
115 | vim.keymap.set('n', 'p', '<Plug>(YoinkPaste_p)') | 94 | vim.keymap.set('n', 'p', '<Plug>(YoinkPaste_p)') |
116 | vim.keymap.set('n', 'P', '<Plug>(YoinkPaste_P)') | 95 | vim.keymap.set('n', 'P', '<Plug>(YoinkPaste_P)') |
@@ -162,11 +141,18 @@ vim.keymap.set('n', 'vr', ':NvimTreeRefresh<CR>') | |||
162 | vim.keymap.set('n', 'vs', ':NvimTreeFindFile<CR>') | 141 | vim.keymap.set('n', 'vs', ':NvimTreeFindFile<CR>') |
163 | 142 | ||
164 | -- dial.nvim mappings | 143 | -- dial.nvim mappings |
165 | vim.keymap.set("n", "<C-a>", require("dial.map").inc_normal(), {noremap = true}) | 144 | local opts = { noremap=true, silent=true } |
166 | vim.keymap.set("n", "<C-x>", require("dial.map").dec_normal(), {noremap = true}) | 145 | vim.keymap.set("n", "<C-a>", require("dial.map").inc_normal(), opts) |
167 | vim.keymap.set("v", "<C-a>", require("dial.map").inc_visual(), {noremap = true}) | 146 | vim.keymap.set("n", "<C-x>", require("dial.map").dec_normal(), opts) |
168 | vim.keymap.set("v", "<C-x>", require("dial.map").dec_visual(), {noremap = true}) | 147 | vim.keymap.set("v", "<C-a>", require("dial.map").inc_visual(), opts) |
169 | vim.keymap.set("v", "g<C-a>", require("dial.map").inc_gvisual(), {noremap = true}) | 148 | vim.keymap.set("v", "<C-x>", require("dial.map").dec_visual(), opts) |
170 | vim.keymap.set("v", "g<C-x>", require("dial.map").dec_gvisual(), {noremap = true}) | 149 | vim.keymap.set("v", "g<C-a>", require("dial.map").inc_gvisual(), opts) |
150 | vim.keymap.set("v", "g<C-x>", require("dial.map").dec_gvisual(), opts) | ||
151 | |||
152 | -- leap.nvim mappings | ||
153 | vim.keymap.set('n', '`', '<Plug>(leap-forward)', opts) | ||
154 | vim.keymap.set('n', '<Leader>`', '<Plug>(leap-backward)', opts) | ||
155 | vim.keymap.set('v', '`', '<Plug>(leap-forward)', opts) | ||
156 | vim.keymap.set('v', '<Leader>`', '<Plug>(leap-backward)', opts) | ||
171 | 157 | ||
172 | -- }}} plug mappings -- | 158 | -- }}} plug mappings -- |