I often use vim via terminal wrapper (e.g. gnome-terminal --disable-factory --command='vim /tmp/firefox12345.txt') to edit a textarea on websites, e.g. when writing this question.Whenever I put in a block of code I wonder if I can somehow:visually select whole indented part of text in the current bufferopen it in a new onechange the filetype to match the syntax (e.g. javascript)edit, write and close ithave vim update all my changes in the original buffer
Can I edit visually selected text in a different buffer?
visual mode
You may want to try the Emacs-inspired NrrwRgn (narrow region) plugin. Should allow you to do exactly what you ask - but you'll probably have to set filetype=javascript (as an example) yourself (or perhaps run filetype detect) in the narrowed region.