repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim/lua/bugabinga/surround.lua

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

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

	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.normal.visual { keys = 'm', command = '<Plug>(nvim-surround-visual)', category = 'surround', description = 'pair around selection' }
	map.normal.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 )