mjbrownie / swapit

vim plugin: Extensible Keyword Swapper
39 stars 8 forks source link

Buffer local swaplist #14

Closed inkarkat closed 10 years ago

inkarkat commented 10 years ago

With only one global g:swap_lists, setting the swaplist for one filetype overrides the previous filetype's list. This breaks swapping with multiple filetypes in parallel (e.g. a PHP and CSS file); the last opened filetype "wins".

Instead, a buffer-local variable should be used. Each buffer has its own swaplist (according to its filetype / manual :SwapList) definition then.

mjbrownie commented 10 years ago

Cheers, Thanks for this update. I was never happy with the original setup and the :ClearSwapList command was always a bit of a hack.

Speaking of FileType lists do you have any worth publishing? I was hoping for contributions (perhaps as separate archives).

inkarkat commented 10 years ago

Thank you for accepting all my recent pull requests so quickly.

I have customized your lists for CSS and HTML a bit, and added one swap list for ActionScript, but I mostly use an extended set of default swaps. Having more default swaps would be nice, on the other hand, it's also easy to set them up yourself.

mjbrownie commented 10 years ago

No probs. I'll try and publish the updates soon on vim.org. I have an optional syntax_hightlight feature I just cooked up that I'll post as well once it's working.