inital checkin using existing vim and preparing for use of bash_magic

This commit is contained in:
2012-05-06 12:17:04 -07:00
commit 064a074ddf
1555 changed files with 361845 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
0.8.3 / 2011-09-26
==================
* Added missing background properties Fixes #5
0.8.2 / 2011-09-01
==================
* updated function list
* removed extra stylus from properties cluster

View File

@@ -0,0 +1,3 @@
" Stylus
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus

View File

@@ -0,0 +1,53 @@
" Vim filetype plugin
" Language: Stylus
" Maintainer: Marc Harter
" Credits: Tim Pope
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
let s:save_cpo = &cpo
set cpo-=C
" Define some defaults in case the included ftplugins don't set them.
let s:undo_ftplugin = ""
let s:browsefilter = "All Files (*.*)\t*.*\n"
let s:match_words = ""
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
unlet! b:did_ftplugin
" Override our defaults if these were set by an included ftplugin.
if exists("b:undo_ftplugin")
let s:undo_ftplugin = b:undo_ftplugin
unlet b:undo_ftplugin
endif
if exists("b:browsefilter")
let s:browsefilter = b:browsefilter
unlet b:browsefilter
endif
if exists("b:match_words")
let s:match_words = b:match_words
unlet b:match_words
endif
" Change the browse dialog on Win32 to show mainly Styl-related files
if has("gui_win32")
let b:browsefilter="Stylus Files (*.styl)\t*.styl\n" . s:browsefilter
endif
" Load the combined list of match_words for matchit.vim
if exists("loaded_matchit")
let b:match_words = s:match_words
endif
setlocal comments= commentstring=//\ %s
let b:undo_ftplugin = "setl cms< com< "
\ " | unlet! b:browsefilter b:match_words | " . s:undo_ftplugin
let &cpo = s:save_cpo
" vim:set sw=2:

View File

@@ -0,0 +1,52 @@
" Vim indent file
" Language: Stylus
" Maintainer: Marc Harter
" Last Change: 2010 May 21
" Based On: sass.vim from Tim Pope
if exists("b:did_indent")
finish
endif
unlet! b:did_indent
let b:did_indent = 1
setlocal autoindent sw=2 et
setlocal indentexpr=GetStylusIndent()
setlocal indentkeys=o,O,*<Return>,},],0),!^F
setlocal formatoptions+=r
if exists("*GetStylusIndent") " only define once
finish
endif
function! GetStylusIndent()
let lnum = prevnonblank(v:lnum-1)
if lnum == 0
return 0
endif
let line = substitute(getline(lnum),'\s\+$','','') " get last line strip ending whitespace
let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') " get current line, trimmed
let lastcol = strlen(line) " get last col in prev line
let line = substitute(line,'^\s\+','','') " then remove preceeding whitespace
let indent = indent(lnum) " get indent on prev line
let cindent = indent(v:lnum) " get indent on current line
let increase = indent + &sw " increase indent by the shift width
if indent == indent(lnum)
let indent = cindent <= indent ? -1 : increase
endif
let group = synIDattr(synID(lnum,lastcol,1),'name')
" for debugging only
echo group
" if group !~? 'css.*' && line =~? ')\s*$' " match user functions
" return increase
if group =~? '\v^%(cssTagName|cssClassName|cssIdentifier|cssSelectorOp|cssSelectorOp2|cssBraces|cssAttributeSelector|cssPseudoClass|cssPseudoClassId)$'
return increase
else
return indent
endif
endfunction
" vim:set sw=2;

View File

@@ -0,0 +1,15 @@
# stylus.vim
Syntax hightlighting for [Stylus](http://learnboost.github.com/stylus/).
CSS3/HTML5 bundled in and adapted from [css3.vim](http://www.vim.org/scripts/script.php?script_id=3042) by Hsiaoming Young
## Installation
### Manual install
Unzip into your `.vim` directory
### Pathogen install
Clone this repo into your `.vim/bundle` directory
## Creds
This is based on the excellent work from Tim Pope on sass.vim.

View File

@@ -0,0 +1,91 @@
" Vim syntax file
" Language: Stylus
" Maintainer: Marc Harter
" Filenames: *.styl, *.stylus
" Based On: Tim Pope (sass.vim)
if exists("b:current_syntax")
finish
endif
runtime! syntax/css.vim
" Author: Hsiaoming Young (sopheryoung@gmail.com)
" CSS3 Syntax Adapted From: CSS3.vim - http://www.vim.org/scripts/script.php?script_id=3042
syn keyword cssTagName article aside audio bb canvas command datagrid
syn keyword cssTagName datalist details dialog embed figure footer
syn keyword cssTagName header hgroup keygen mark meter nav output
syn keyword cssTagName progress time ruby rt rp section time video
syn keyword cssCommonAttr contained contenteditable contextmenu draggable hidden item
syn keyword cssCommonAttr contained itemprop list subject spellcheck
syn match cssUIProp contained "\<box-sizing\>"
syn match cssUIProp contained "\<outline-\(width\|style\|offset\|color\)\>"
syn match cssUIProp contained "\<nav-\(index\|up\|right\|down\|left\)\>"
syn keyword cssUIProp contained resize outline
syn keyword cssCommonAttr contained columns
syn match cssCommonAttr contained "\<column-\(width\|span\|rule\|gap\|fill\|count\)\>"
syn match cssCommonAttr contained "\<column-rule-\(color\|width\|style\)\>"
syn match cssCommonAttr contained "\<column-break-\(after\|before\)\>"
syn match cssBoxProp "\<border-\(image\|radius\)\=\>" contained
syn match cssBoxProp "\<\(box-shadow\)\>" contained
syn match cssUIProp contained "\<\(transform\)\>"
syn match cssUIProp contained "\<\(transition\)\>"
syn keyword cssColorProp contained opacity
syn match cssTextAttr contained "\<text-shadow\|text-overflow\|word-wrap\>"
syn match cssColorProp contained "\<background\(-\(origin\|clip\|size\|position\|attachment\|image\|color\|repeat\)\)\="
syn match cssColor contained "\<rgb\s*(\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*)"
syn match cssColor contained "\<rgba\s*(\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*)"
syn match cssColor contained "\<hsl\s*(\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*)"
syn match cssColor contained "\<hsla\s*(\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*)"
syn match cssTextProp contained "\<word-wrap\>"
syn match cssTextProp contained "\<break-word\>"
syn match cssTextProp contained "\<break-all\>"
syn match cssTextProp contained "\<text-overflow\>"
syn match cssBoxProp contained "\<box-sizing\>"
syn match cssBoxProp contained "\<border-image\>"
syn match cssBoxProp contained "\<border-\(\(top-left\|top-right\|bottom-right\|bottom-left\)-radius\)\>"
" end CSS3 support
syn case ignore
syn region cssInclude start="@import" end="\n" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType
syn cluster stylusCssSelectors contains=cssTagName,cssSelector.*,cssIdentifier,cssAttributeSelector,cssPseudo.*,cssClassName
syn cluster stylusCssAttributes contains=css.*Attr,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp
syn region stylusDefinition matchgroup=cssBraces start="{" end="}" contains=TOP
" syn match stylusProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=css.*Prop skipwhite nextgroup=stylusCssAttribute contained containedin=stylusDefinition
syn match stylusProperty "^\s*\%([[:alnum:]-]\+\)" contains=css.*Prop skipwhite nextgroup=stylusCssAttribute
syn match stylusVariableAssignment "\%([[:alnum:]_-]\+\s*\)\@<==" nextgroup=stylusCssAttribute,stylusVariable skipwhite
syn match stylusCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@stylusCssAttributes,stylusFunction,stylusVariable,stylusControl,stylusUserFunction
syn match stylusUserFunction "^\s*\%([[:alnum:]_-]\+\)(\@="
syn match stylusUserFunction "\<\%([^)]*\)\>(\@=" contained
syn match stylusFunction "\<\%(red\|green\|blue\|alpha\|dark\|light\)\>(\@=" contained
syn match stylusFunction "\<\%(hue\|saturation\|lightness\|push\|unshift\|typeof\|unit\|match\)\>(\@=" contained
syn match stylusFunction "\<\%(hsla\|hsl\|rgba\|rgb\|lighten\|darken\)\>(\@=" contained
syn match stylusFunction "\<\%(abs\|ceil\|floor\|round\|min\|max\|even\|odd\|sum\|avg\|sin\|cos\|join\)\>(\@=" contained
syn match stylusFunction "\<\%(desaturate\|saturate\|unquote\|quote\|s\)\>(\@=" contained
syn match stylusFunction "\<\%(operate\|length\|warn\|error\|last\|p\|\)\>(\@=" contained
syn match stylusFunction "\<\%(opposite-position\|image-size\|add-property\)\>(\@=" contained
syn keyword stylusVariable null true false arguments
syn keyword stylusControl if else unless for in return
syn keyword stylusTodo FIXME NOTE TODO OPTIMIZE XXX contained
syn region stylusComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=stylusTodo,@Spell fold
syn region stylusCssComment start="/\*" end="\*/" contains=stylusTodo,@Spell fold
hi def link stylusCssComment Comment
hi def link stylusComment Comment
hi def link stylusTodo Todo
hi def link stylusVariable Identifier
hi def link stylusControl PreProc
hi def link stylusUserFunction PreProc
hi def link stylusFunction Function
let b:current_syntax = "stylus"
" vim:set sw=2:

View File

@@ -0,0 +1,60 @@
@import "nib"
// comment test
padding-overloaded = true;
padding = 2px;
primary-color = red;
if padding-overloaded
padding(x,y)
margin 15px
border-radius()
-webkit-border-radius arguments
-moz-border-radius arguments
border-radius arguments
.a-class
border-radius border-radius()
-moz-transform scale(1.2)
body a:hover
font 12px/1.4 "Lucida Grande", Arial, sans-serif
background black !important
text-shadow 2px 2px 2px #fff
td a:hover
font 12px
td
font 12px
[name="myprop"]
background rgba(255,255,255,0.5)
#container
border-radius 5px
color: #000
float: left
display: block
#myid
font 12px/1.4 "Lucida Grande", Arial, sans-serif
body a:hover
font 12px/1.4 "Lucida Grande", Arial, sans-serif
background black !important
text-shadow 2px 2px
color #ccc
#butter.gump tr
border min(2px)
min-width min(2px)
color red(10) lighten-by(he) border-radius() image-size()
border-radius border-radius()
form input {
padding: 5px
border: 1px solid
border-radius: 5px
}