Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed some README formatting and added a .travis.yml file.

  • Loading branch information...
commit 2a1f15e1b545fb78bb4190d2086bb5b3cc5ad183 1 parent 2d90d5f
@samwho authored
Showing with 111 additions and 107 deletions.
  1. +4 −0 .travis.yml
  2. +107 −107 README.md
View
4 .travis.yml
@@ -0,0 +1,4 @@
+rvm:
+ - 1.8.7
+ - 1.9.2
+ - 1.9.3
View
214 README.md
@@ -14,13 +14,13 @@ Installation is standard for a Ruby gem:
Let's start by showing you a really small example:
``` ruby
- require 'vimcolorscheme'
+require 'vimcolorscheme'
- scheme = VimColorScheme.new :scheme_name, :dark do
+scheme = VimColorScheme.new :scheme_name, :dark do
- end
+end
- scheme.save_to_vim!
+scheme.save_to_vim!
```
Here we're starting a new vim color scheme with the name of `:scheme_name`
@@ -37,16 +37,16 @@ you would rather be prompted.
Let's expand this example to actually do something useful: highlight!
``` ruby
- require 'vimcolorscheme'
+require 'vimcolorscheme'
- scheme = VimColorScheme.new :scheme_name, :dark do
- highlight :Normal do
- guifg '#ffffff'
- guibg '#000000'
- end
+scheme = VimColorScheme.new :scheme_name, :dark do
+ highlight :Normal do
+ guifg '#ffffff'
+ guibg '#000000'
end
+end
- scheme.save_to_vim!
+scheme.save_to_vim!
```
The `highlight` method takes a name argument, which can be anything with a
@@ -65,18 +65,18 @@ and run it with:
And the output is:
``` vim
- set background=dark
+set background=dark
- highlight clear
+highlight clear
- if exists('syntax_on')
- syntax reset
- endif
+if exists('syntax_on')
+ syntax reset
+endif
- let g:colors_name = 'scheme_name'
+let g:colors_name = 'scheme_name'
- highlight Normal gui=NONE guifg=#ffffff guibg=#000000 cterm=NONE ctermfg=231
- ctermbg=16
+highlight Normal gui=NONE guifg=#ffffff guibg=#000000 cterm=NONE ctermfg=231
+ctermbg=16
```
The top part of the file is some obligatory boilerplate stuff such as setting
@@ -92,19 +92,19 @@ stop it happening, just explicitly set what you want the ctermfg attribute to
be:
``` ruby
- require 'vimcolorscheme'
+require 'vimcolorscheme'
- scheme = VimColorScheme.new :scheme_name, :dark do
- highlight :Normal do
- guifg '#ffffff'
- guibg '#000000'
+scheme = VimColorScheme.new :scheme_name, :dark do
+ highlight :Normal do
+ guifg '#ffffff'
+ guibg '#000000'
- ctermfg :none
- ctermbg :none
- end
+ ctermfg :none
+ ctermbg :none
end
+end
- scheme.save_to_vim!
+scheme.save_to_vim!
```
### What about bold and underline and stuff?
@@ -113,38 +113,38 @@ Setting the gui and cterm elements works slightly differently. These methods
take as many arguments you give them. Let's see an example:
``` ruby
- require 'vimcolorscheme'
+require 'vimcolorscheme'
- scheme = VimColorScheme.new :scheme_name, :dark do
- highlight :Normal do
- guifg '#ffffff'
- guibg '#000000'
+scheme = VimColorScheme.new :scheme_name, :dark do
+ highlight :Normal do
+ guifg '#ffffff'
+ guibg '#000000'
- ctermfg :none
- ctermbg :none
+ ctermfg :none
+ ctermbg :none
- gui :bold, :italic
- end
+ gui :bold, :italic
end
+end
- scheme.save_to_vim!
+scheme.save_to_vim!
```
And the corresponding output:
``` vim
- set background=dark
+set background=dark
- highlight clear
+highlight clear
- if exists('syntax_on')
- syntax reset
- endif
+if exists('syntax_on')
+ syntax reset
+endif
- let g:colors_name = 'scheme_name'
+let g:colors_name = 'scheme_name'
- highlight Normal gui=bold,italic guifg=#ffffff guibg=#000000 cterm=bold,italic
- ctermfg=NONE ctermbg=NONE
+highlight Normal gui=bold,italic guifg=#ffffff guibg=#000000 cterm=bold,italic
+ctermfg=NONE ctermbg=NONE
```
Notice how both `gui` _and_ `cterm` have been given bold and italic properties?
@@ -157,43 +157,43 @@ If you want to add comments into your resulting color scheme file that's
possible too! Check this out:
``` ruby
- require 'vimcolorscheme'
+require 'vimcolorscheme'
- scheme = VimColorScheme.new :scheme_name, :dark do
- comment "author: Sam Rose <samwho@lbak.co.uk>"
+scheme = VimColorScheme.new :scheme_name, :dark do
+ comment "author: Sam Rose <samwho@lbak.co.uk>"
- highlight :Normal do
- guifg '#ffffff'
- guibg '#000000'
+ highlight :Normal do
+ guifg '#ffffff'
+ guibg '#000000'
- ctermfg :none
- ctermbg :none
+ ctermfg :none
+ ctermbg :none
- gui :bold, :italic
- end
+ gui :bold, :italic
end
+end
- scheme.save_to_vim!
+scheme.save_to_vim!
```
See that `comment` line near the top? That tells people that I authored this
theme. Let's see what it looks like in the vim file:
``` vim
- " author: Sam Rose <samwho@lbak.co.uk>
+" author: Sam Rose <samwho@lbak.co.uk>
- set background=dark
+set background=dark
- highlight clear
+highlight clear
- if exists('syntax_on')
- syntax reset
- endif
+if exists('syntax_on')
+ syntax reset
+endif
- let g:colors_name = 'scheme_name'
+let g:colors_name = 'scheme_name'
- highlight Normal gui=bold,italic guifg=#ffffff guibg=#000000 cterm=bold,italic
- ctermfg=NONE ctermbg=NONE
+highlight Normal gui=bold,italic guifg=#ffffff guibg=#000000 cterm=bold,italic
+ctermfg=NONE ctermbg=NONE
```
We now have a comment at the top! Sweet. The astute among you may be curious
@@ -210,25 +210,25 @@ You can also insert comments using blocks. This following snippet of code is
exactly the same as the last one:
``` ruby
- require 'vimcolorscheme'
+require 'vimcolorscheme'
- scheme = VimColorScheme.new :scheme_name, :dark do
- comment do
- "author: Sam Rose <samwho@lbak.co.uk>"
- end
+scheme = VimColorScheme.new :scheme_name, :dark do
+ comment do
+ "author: Sam Rose <samwho@lbak.co.uk>"
+ end
- highlight :Normal do
- guifg '#ffffff'
- guibg '#000000'
+ highlight :Normal do
+ guifg '#ffffff'
+ guibg '#000000'
- ctermfg :none
- ctermbg :none
+ ctermfg :none
+ ctermbg :none
- gui :bold, :italic
- end
+ gui :bold, :italic
end
+end
- scheme.save_to_vim!
+scheme.save_to_vim!
```
## Raw input
@@ -239,52 +239,52 @@ do things such as define vim variable or insert if statements into our color
scheme file. Example:
``` ruby
- require 'vimcolorscheme'
+require 'vimcolorscheme'
- scheme = VimColorScheme.new :scheme_name, :dark do
- comment do
- "author: Sam Rose <samwho@lbak.co.uk>"
- end
+scheme = VimColorScheme.new :scheme_name, :dark do
+ comment do
+ "author: Sam Rose <samwho@lbak.co.uk>"
+ end
- raw "if version < 700"
- raw " finish"
- raw "endif\n"
+ raw "if version < 700"
+ raw " finish"
+ raw "endif\n"
- highlight :Normal do
- guifg '#ffffff'
- guibg '#000000'
+ highlight :Normal do
+ guifg '#ffffff'
+ guibg '#000000'
- ctermfg :none
- ctermbg :none
+ ctermfg :none
+ ctermbg :none
- gui :bold, :italic
- end
+ gui :bold, :italic
end
+end
- scheme.save_to_vim!
+scheme.save_to_vim!
```
Let's see what that gives us:
``` vim
- " author: Sam Rose <samwho@lbak.co.uk>
+" author: Sam Rose <samwho@lbak.co.uk>
- set background=dark
+set background=dark
- highlight clear
+highlight clear
- if exists('syntax_on')
- syntax reset
- endif
+if exists('syntax_on')
+ syntax reset
+endif
- let g:colors_name = 'scheme_name'
+let g:colors_name = 'scheme_name'
- if version < 700
- finish
- endif
+if version < 700
+ finish
+endif
- highlight Normal gui=bold,italic guifg=#ffffff guibg=#000000
- cterm=bold,italic ctermfg=NONE ctermbg=NONE
+highlight Normal gui=bold,italic guifg=#ffffff guibg=#000000
+cterm=bold,italic ctermfg=NONE ctermbg=NONE
```
As expected, the if statement is just pasted in verbatim. It's not pretty, but
Please sign in to comment.
Something went wrong with that request. Please try again.