Created
January 13, 2012 17:29
-
-
Save nickjones/1607649 to your computer and use it in GitHub Desktop.
Vim syntax to html example (my .vimrc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>~/.vimrc</title> | |
<meta name="Generator" content="Vim/7.3"> | |
<meta name="plugin-version" content="vim7.3_v8"> | |
<meta name="syntax" content="vim"> | |
<meta name="settings" content="number_lines,use_css,expand_tabs"> | |
<style type="text/css"> | |
<!-- | |
pre { font-family: monospace; color: #eeeeee; background-color: #000000; } | |
body { font-family: monospace; color: #eeeeee; background-color: #000000; } | |
.lnr { color: #ddeeff; background-color: #222222; } | |
.Constant { color: #339999; } | |
.String { color: #66ff00; } | |
.Identifier { color: #ffcc00; } | |
.Special { color: #33aa00; } | |
.Normal { color: #eeeeee; background-color: #000000; } | |
.Type { color: #aaaa77; } | |
.Comment { color: #9933cc; font-style: italic; } | |
.PreProc { color: #aaffff; } | |
.Statement { color: #ff6600; } | |
--> | |
</style> | |
</head> | |
<body> | |
<pre> | |
<span class="lnr"> 1 </span><span class="Statement">set</span> <span class="PreProc">nocompatible</span> <span class="Comment">" Vim mode, not Vi</span> | |
<span class="lnr"> 2 </span><span class="Statement">syntax</span> <span class="Type">on</span> | |
<span class="lnr"> 3 </span><span class="Statement">filetype</span> <span class="Type">plugin</span> <span class="Type">indent</span> <span class="Type">on</span> | |
<span class="lnr"> 4 </span><span class="Statement">call</span> pathogen#<span class="Normal">infect</span><span class="Special">()</span> <span class="Comment">" Load up Tim Pope's stuff</span> | |
<span class="lnr"> 5 </span><span class="Statement">color</span> vividchalk | |
<span class="lnr"> 6 </span><span class="Statement">augroup</span> myfiletypes | |
<span class="lnr"> 7 </span> <span class="Statement">autocmd</span>! | |
<span class="lnr"> 8 </span> <span class="Statement">autocmd</span> <span class="Type">FileType</span> ruby,eruby,yaml,html,js,css <span class="Statement">setlocal</span> <span class="PreProc">autoindent</span> <span class="PreProc">expandtab</span> <span class="PreProc">shiftwidth</span>=2 <span class="PreProc">softtabstop</span>=2 | |
<span class="lnr"> 9 </span><span class="Statement">augroup</span> END | |
<span class="lnr">10 </span><span class="Statement">set</span> <span class="PreProc">nu</span> | |
<span class="lnr">11 </span><span class="Statement">set</span> <span class="PreProc">history</span>=1000 <span class="Comment">" Default is only 20</span> | |
<span class="lnr">12 </span><span class="Statement">set</span> <span class="PreProc">spell</span> <span class="Comment">" Enable spell checking</span> | |
<span class="lnr">13 </span><span class="Statement">if</span> <span class="Identifier">has</span><span class="Special">(</span><span class="String">"gui_running"</span><span class="Special">)</span> | |
<span class="lnr">14 </span> <span class="Statement">set</span> <span class="PreProc">cursorline</span> <span class="Comment">" Highlight the current line</span> | |
<span class="lnr">15 </span> <span class="Statement">hi</span> cursorline <span class="Type">guibg</span>=<span class="Constant">#333333</span> | |
<span class="lnr">16 </span> <span class="Statement">hi</span> CursorColumn <span class="Type">guibg</span>=<span class="Constant">#333333</span> | |
<span class="lnr">17 </span><span class="Statement">else</span> | |
<span class="lnr">18 </span><span class="Comment"> " Fix up the colors for bad spelling in Vim mode with Rxvt colors and</span> | |
<span class="lnr">19 </span><span class="Comment"> " vividchalk.</span> | |
<span class="lnr">20 </span> <span class="Statement">hi</span> SpellBad <span class="Type">ctermbg</span>=black <span class="Type">cterm</span>=<span class="PreProc">bold</span>,<span class="PreProc">underline</span> | |
<span class="lnr">21 </span><span class="Statement">endif</span> | |
<span class="lnr">22 </span><span class="Statement">set</span> <span class="PreProc">wildmenu</span> <span class="Comment">" Show list instead of just completing</span> | |
<span class="lnr">23 </span><span class="Statement">set</span> <span class="PreProc">wildmode</span>=list<span class="Statement">:</span>longest<span class="Statement">,</span>full <span class="Comment">" command <Tab> completion</span> | |
<span class="lnr">24 </span> | |
<span class="lnr">25 </span><span class="Comment">" Patch systemverilog.vim to match filenames</span> | |
<span class="lnr">26 </span><span class="Statement">augroup</span> filetypedetect | |
<span class="lnr">27 </span> <span class="Statement">au</span> <span class="Type">BufNewFile</span>,<span class="Type">BufRead</span> *.sv <span class="Statement">setf</span> systemverilog | |
<span class="lnr">28 </span><span class="Statement">augroup</span> END | |
<span class="lnr">29 </span> | |
<span class="lnr">30 </span><span class="Comment">" Execute open rspec buffer</span> | |
<span class="lnr">31 </span><span class="Comment">" Thanks to Ian Smith-Heisters</span> | |
<span class="lnr">32 </span><span class="Statement">function</span>! RunSpec<span class="Special">(</span>args<span class="Special">)</span> | |
<span class="lnr">33 </span> <span class="Statement">if</span> <span class="Identifier">exists</span><span class="Special">(</span><span class="String">"b:rails_root"</span><span class="Special">)</span> <span class="Statement">&&</span> <span class="Identifier">filereadable</span><span class="Special">(</span>b:rails_root <span class="Statement">.</span> <span class="String">"/script/spec"</span><span class="Special">)</span> | |
<span class="lnr">34 </span> <span class="Statement">let</span> spec <span class="Statement">=</span> b:rails_root <span class="Statement">.</span> <span class="String">"/script/spec"</span> | |
<span class="lnr">35 </span> <span class="Statement">else</span> | |
<span class="lnr">36 </span> <span class="Statement">let</span> spec <span class="Statement">=</span> <span class="String">"spec"</span> | |
<span class="lnr">37 </span> <span class="Statement">end</span> | |
<span class="lnr">38 </span> <span class="Statement">let</span> cmd <span class="Statement">=</span> <span class="String">":! "</span> <span class="Statement">.</span> spec <span class="Statement">.</span> <span class="String">" % -cfn "</span> <span class="Statement">.</span> <span class="Identifier">a:args</span> | |
<span class="lnr">39 </span> <span class="Statement">execute</span> cmd | |
<span class="lnr">40 </span><span class="Statement">endfunction</span> | |
<span class="lnr">41 </span> | |
<span class="lnr">42 </span><span class="Comment">" Mappings</span> | |
<span class="lnr">43 </span><span class="Comment">" run one rspec example or describe block based on cursor position</span> | |
<span class="lnr">44 </span><span class="Statement">map</span> !s :call RunSpec("-l " . <span class="Special"><</span><span class="Special">C-r</span><span class="Special">></span>=line('.')<span class="Special"><</span><span class="Special">CR</span><span class="Special">></span>)<span class="Special"><</span><span class="Special">CR</span><span class="Special">></span> | |
<span class="lnr">45 </span><span class="Comment">" run full rspec file</span> | |
<span class="lnr">46 </span><span class="Statement">map</span> !S :call RunSpec("")<span class="Special"><</span><span class="Special">CR</span><span class="Special">></span> | |
</pre> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment