I write a bunch of markdown with code blocks. When I visually select those blocks to generate screenshots, the language is always set to markdown, since that's the current buffers filetype.
def sample
puts 'Hello World'
end
func PrintHelloWorld() {
fmt.Println("Hello, World!")
}
It would be great to detect the language for the current visual selection. This should be quite doable if treesitter is installed.
- If treesitter is not available, fall back to the buffer filetype
- If there is no visual selection, there's nothing to do either
- If there's a visual selection but there are multiple file types for the selected lines fall back to the buffer filetype
- If there's a consistent detected language for the selected lines pass that to silicon
WDYT? I'd be happy to open a PR.
I write a bunch of markdown with code blocks. When I visually select those blocks to generate screenshots, the language is always set to markdown, since that's the current buffers filetype.
It would be great to detect the language for the current visual selection. This should be quite doable if
treesitteris installed.WDYT? I'd be happy to open a PR.