Luigit
repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by admin

neovim/lua/bugabinga/surround.lua

Raw
local map = require 'std.map'
local puk = require 'std.puk'

vim.g.nvim_surround_no_mappings = true

puk.defer 'nvim-surround' ( function ( surround )
	surround.setup {
		move_cursor = 'sticky',
	}

	map.insert { keys = '<C-g>s', command = '<Plug>(nvim-surround-insert)', category = 'surround', description = 'pair in insert', remap = true }
	map.insert { keys = '<C-g>S', command = '<Plug>(nvim-surround-insert-line)', category = 'surround', description = 'pair line in insert', remap = true }

	map.normal { keys = 'ma', command = '<Plug>(nvim-surround-normal)', category = 'surround', description = 'pair around motion' }
	map.normal { keys = 'ml', command = '<Plug>(nvim-surround-normal-cur)', category = 'surround', description = 'pair around current line' }
	map.normal { keys = 'mL', command = '<Plug>(nvim-surround-normal-cur-line)', category = 'surround', description = 'pair around current line, new lines' }
	map.normal { keys = 'mm', command = '<Plug>(nvim-surround-normal-line)', category = 'surround', description = 'pair around motion, new lines' }
	map.visual { keys = 'm', command = '<Plug>(nvim-surround-visual)', category = 'surround', description = 'pair around selection' }
	map.visual { keys = 'M', command = '<Plug>(nvim-surround-visual-line)', category = 'surround', description = 'pair around selection, new lines' }
	map.normal { keys = 'md', command = '<Plug>(nvim-surround-delete)', category = 'surround', description = 'delete' }
	map.normal { keys = 'mr', command = '<Plug>(nvim-surround-change)', category = 'surround', description = 'change' }
	map.normal { keys = 'mR', command = '<Plug>(nvim-surround-change-line)', category = 'surround', description = 'change pair, new lines' }
end )