-
Notifications
You must be signed in to change notification settings - Fork 18
Mappings
dcampos edited this page Jun 23, 2022
·
5 revisions
Some example mappings in Lua.
Using vim.keymap.set()
(Neovim 0.7+) allows creating mappings in a concise way, especially if you don't need to call setup()
for a different reason.
local mappings = require('snippy.mapping')
vim.keymap.set('i', '<Tab>', mappings.expand_or_advance('<Tab>'))
vim.keymap.set('s', '<Tab>', mappings.next('<Tab>'))
vim.keymap.set({ 'i', 's' }, '<S-Tab>', mappings.previous('<S-Tab>'))
vim.keymap.set('x', '<Tab>', mappings.cut_text, { remap = true })
vim.keymap.set('n', 'g<Tab>', mappings.cut_text, { remap = true })