Today i woke up with a simple idea.
It would great to have "stackoverflow synthax highlighting in vim".
Do you know a simple way to go SO style ?
Today i woke up with a simple idea.
It would great to have "stackoverflow synthax highlighting in vim".
Do you know a simple way to go SO style ?
Stack Overflow uses Markdown syntax, so this should do it (in Vim versions 7.3+, which ship with it):
:setf markdown
If you want to do customizations, it's best to define your own custom stackoverflow filetype by creating a file ~/.vim/syntax/stackoverflow.vim
with the following contents (and defining corresponding filetype detection rules):
" Quit when a syntax file was already loaded.
if exists('b:current_syntax') | finish | endif
runtime! syntax/markdown.vim syntax/markdown/*.vim
Since Stack Overflow is browser-based, you probably use a browser plugin to do the editing in Vim. I've described such a setup that can automatically set the filetype based on the currently edited URL for Firefox in my blog post Pentadactyl set filetype in external Vim editor based on URL.
Your question is fuzzy; if you mean to mark certain blocks as having a certain syntax (which on Stack Overflow can be done with language: lang-js
HTML comments), my SyntaxRange plugin enables you to define a different filetype syntax on regions of a buffer, either manually or automatically based on markers.