autolist.nvim icon indicating copy to clipboard operation
autolist.nvim copied to clipboard

[FR] Renumbering when list items are moved around

Open raffaem opened this issue 1 year ago • 7 comments

Is it possible to renumber list elements as you move them around?

raffaem avatar Oct 16 '22 17:10 raffaem

If you have a key bind that moves lines around, you can add that to the auto list bindings for “renum”

gaoDean avatar Oct 16 '22 20:10 gaoDean

If you have a key bind that moves lines around, you can add that to the auto list bindings for “renum”

I didn't get that 😊

Where is renum in the lua files?

Do you have an example config snippet I can try?

raffaem avatar Oct 17 '22 01:10 raffaem

lets say u use <c-j> and <c-k> to move lines around in normal mode:

require("autolist").setup({
	normal_mappings = {
		recal = {
			"dd",
			"<c-k>",
			"<c-j>"
		}
	}
})

im pretty sure this works...

gaoDean avatar Oct 18 '22 06:10 gaoDean

I don't have particular mappings to move lines around, so I just did:

require("autolist").setup({
	normal_mappings = {
		recal = {
			"dd",
			"p"
		}
	}
})

and it seems to work.

Shouldn't this be the default?

raffaem avatar Oct 18 '22 06:10 raffaem

Ahh, yeah ok

bloomjobs avatar Oct 18 '22 06:10 bloomjobs

sorry that was my alt

gaoDean avatar Oct 18 '22 06:10 gaoDean

Maybe you should put this feature in the README under "An intro to autolist" and also the "recal" option in the example

IMHO it is not obvious that autolist.nvim has this feature.

Maybe also in the video :)

raffaem avatar Oct 18 '22 08:10 raffaem

Thanks for the tip, imma close this now.

gaoDean avatar Oct 22 '22 20:10 gaoDean