* Add colorschemes directory. vim-stuff
authormahlon
Sun, 22 Mar 2009 00:49:45 +0000
branchvim-stuff
changeset 3 db3e3abfc647
parent 2 6b33188f1694
child 4 4ffc0380b228
* Add colorschemes directory. * Add banner creation function to specky. * Fix specky quote switching so it works alongside the Surround plugin.
colorschemes/deveiate.vim
specky/doc/specky.txt
specky/plugin/specky.vim
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/colorschemes/deveiate.vim	Sun Mar 22 00:49:45 2009 +0000
@@ -0,0 +1,90 @@
+"
+" Vim color theme: DevEiate
+"
+" Gvim color definition file, based loosely on Michael Granger's
+" eye-pleasing theme for Textmate of the same name.
+"       Mahlon E. Smith <mahlon@martini.nu>
+"       Michael Granger <ged@faeriemud.org>
+"
+" Drop this into your ~/.vim/colors directory, then load it via
+"       :colorscheme deveiate
+"
+" $Id: deveiate.vim 72 2008-07-02 22:24:58Z mahlon $
+
+
+" ----------------------------------------
+" Color definition reference
+" ----------------------------------------
+" :help group-name
+" :help highlight-groups
+" :help cterm-colors
+
+set background=dark
+highlight clear
+let g:colors_name="deveiate"
+
+" ----------------------------------------
+" highlight groups
+" ----------------------------------------
+highlight Normal guifg=#f6dfb2 guibg=#00000f
+highlight LineNr guifg=#333333
+highlight Cursor guibg=yellow guifg=NONE
+highlight CursorLine guibg=#171520
+highlight Search guibg=#001632 guifg=NONE
+highlight Visual guibg=#001632 guifg=NONE
+highlight VisualNOS guibg=#001632 guifg=NONE
+highlight Question guifg=yellow
+highlight StatusLine guibg=#d4d2cb guifg=#292087
+highlight StatusLineNC guibg=#8372be guifg=#22115c
+highlight TabLine guibg=black guifg=#333333
+highlight TabLineSel guibg=#333333 guifg=#f8f8f8
+highlight TabLineFill guifg=black
+highlight WildMenu guifg=yellow guibg=#22115c
+highlight Pmenu guibg=black guifg=#da8d53
+highlight PmenuSel guibg=black guifg=#76a3d7
+highlight PmenuSbar guibg=black
+highlight PmenuThumb guibg=black guifg=#333333
+highlight Folded guifg=#8b98ab guibg=black
+highlight FoldColumn guifg=#8b98ab guibg=black
+highlight VertSplit guifg=black guibg=#333333
+highlight DiffAdd guifg=#f8f8f8 guibg=#253b22
+highlight DiffChange guifg=#f8f8f8 guibg=#4a410d
+highlight DiffDelete guifg=#f8f8f8 guibg=#420e09
+highlight DiffText guifg=white guibg=#7d6f20
+highlight NonText guifg=#222222
+
+" ----------------------------------------
+" syntax highlighting groups
+" ----------------------------------------
+highlight Comment guifg=#a82419
+highlight Constant guifg=#76a3d7
+highlight Function guifg=#9b859d
+highlight String guifg=#da8d53
+highlight Special guifg=#da8d53
+highlight PreProc gui=bold guifg=#00cbcd
+highlight Identifier guifg=#9bda8b
+highlight Number guifg=#9bda8b
+highlight Float guifg=#9bda8b
+highlight Statement guifg=#00cbcd
+highlight todo guibg=NONE guifg=yellow
+highlight MatchParen guifg=yellow guibg=NONE
+
+
+" ----------------------------------------
+" ruby specific syntax highlighting
+" ----------------------------------------
+highlight rubyConstant guifg=#76a3d7
+highlight rubyInstanceVariable guifg=#c2eaf4
+highlight rubyClassVariable guifg=#c2eaf4
+highlight rubySymbol guifg=#9bda8b
+highlight rubyEscape guifg=#ddf2a4
+highlight rubyInterpolation guifg=#ddf2a4
+highlight rubyClass guifg=#c3adc5
+highlight rubyPseudoVariable guifg=#9bda8b
+highlight rubyOperator guifg=#00cbcd
+
+" ----------------------------------------
+" other misc colors
+" ----------------------------------------
+highlight MyTagListFileName guifg=yellow guibg=NONE
+
--- a/specky/doc/specky.txt	Sun Mar 22 00:39:19 2009 +0000
+++ b/specky/doc/specky.txt	Sun Mar 22 00:49:45 2009 +0000
@@ -14,13 +14,14 @@
     2) Functionality................................|SpeckyFunctionality|
     3) Enabling Specky..............................|SpeckyVimrcExample|
     4) Configuration................................|SpeckyOptions|
-        4.1) Cycling quote styles...................|g:speckyQuoteSwitcherKey|
-        4.2) Display ruby documentation.............|g:speckyRunRdocKey|
-        4.3) Toggle editing between spec and code...|g:speckySpecSwitcherKey|
-        4.4) Run specs for the current buffer.......|g:speckyRunSpecKey|
-        4.5) Modify the default spec command........|g:speckyRunSpecCmd|
-        4.6) Modify the default rdoc command........|g:speckyRunRdocCmd|
-        4.7) Split windows vertically...............|g:speckyVertSplit|
+        4.1) Create text banners....................|g:speckyBannerKey|
+        4.2) Cycling quote styles...................|g:speckyQuoteSwitcherKey|
+        4.3) Display ruby documentation.............|g:speckyRunRdocKey|
+        4.4) Toggle editing between spec and code...|g:speckySpecSwitcherKey|
+        4.5) Run specs for the current buffer.......|g:speckyRunSpecKey|
+        4.6) Modify the default spec command........|g:speckyRunSpecCmd|
+        4.7) Modify the default rdoc command........|g:speckyRunRdocCmd|
+        4.8) Split windows vertically...............|g:speckyVertSplit|
     5) Author.......................................|SpeckyAuthor|
     6) License......................................|SpeckyLicense|
 
@@ -48,9 +49,9 @@
 the easiest way to cherry pick the functionality that you'd like was to enable
 them via key bindings.  By doing this, Specky won't make assumptions about
 your current environment, and won't stomp on anything you don't want it to.
->
-    Specky won't do -anything- with your environment until you enable
-    the key bindings!!
+
+    Specky won't do -anything- with your environment until you enable ~
+    the key bindings!! ~
 
 After you've configured your bindings, here are some of the things you can
 now do with a single key stroke:
@@ -70,6 +71,7 @@
     - Dynamically switch string types for the word under the cursor
       (double quoted, quoted, symbol)
 
+    - Make lovely and quick comment banners for ruby code.
 
 
 ==============================================================================
@@ -78,6 +80,7 @@
 
 Here's what my config looks like. >
 
+    let g:speckyBannerKey = "<C-S>b"
     let g:speckyQuoteSwitcherKey = "<C-S>'"
     let g:speckyRunRdocKey = "<C-S>r"
     let g:speckySpecSwitcherKey = "<C-S>x"
@@ -90,6 +93,7 @@
 With these bindings, all specky commands start with <ctrl-s> ("s" for
 specky!), followed by a mnemonic function to run:
 
+    b ----> Banner creation ~
     ' ----> Quote cycling ~
     r ----> run Rdoc ~
     x ----> code and spec eXchange ~
@@ -97,7 +101,7 @@
 
 Of course, <ctrl-s> is a "suspend" signal for most terminals, so these
 bindings are meant for a |gui| environment, such as gvim.  Your mileage (and
-tastes) will doubtlessly vary.
+tastes) will doubtlessly vary.  Do what you will.  I won't judge you.
 
 
 
@@ -107,22 +111,51 @@
 
 Here are all of the available configuration options.
 
-Please note that you must (at an optional minimum) set the respective binding
-variables:
+Please note that you must set binding variables:
 
+    |g:speckyBannerKey|
     |g:speckyQuoteSwitcherKey|
     |g:speckyRunRdocKey|
     |g:speckySpecSwitcherKey|
     |g:speckyRunSpecKey|
 
-...in order to enable specky functionality.  See |SpeckyVimrcExample| for
-details. Any other options are entirely optional.  Put these into your
-|vimrc|, or wherever else you enjoy storing this kind of stuff.
+...in order to enable the respective specky functionality.  See
+|SpeckyVimrcExample| for details. Any other options are entirely optional.
+Put these into your |vimrc|, or wherever else you enjoy storing this kind of
+stuff.
 
 
 
 ------------------------------------------------------------------------------
-4.1                                                 *g:speckyQuoteSwitcherKey*
+4.1                                                        *g:speckyBannerKey*
+
+
+Setting this binding enables comment banner creation.
+
+This is purely a convenience routine, and a stylistic one at that.  I prefer
+large advertising of what "area" of code you are in, along with other
+miscellaneous labels for humans to read.  If this isn't how you roll, then by
+all means, don't enable this binding!  :)
+
+As an example -- you can just type:
+
+	instance methods ~
+
+Then hit the keystroke.  It will magically turn into: >
+
+  ########################################################################
+  ### I N S T A N C E   M E T H O D S
+  ########################################################################
+
+With all those saved extra keystrokes this might provide you per banner over
+the years, your RSI-free hands will thank you.  And the total time savings!!
+Oh man, what are you going to DO with all of that extra free time?
+The possibilities are staggering.
+
+
+
+------------------------------------------------------------------------------
+4.2                                                 *g:speckyQuoteSwitcherKey*
 
 
 Setting this binding enables quote "style switching".
@@ -136,13 +169,12 @@
 
     "string" -> 'string' -> :string -> "string" ... ~
 
-Note that quote cycling only works with a |word|.  Sentences are not currently
-supported.  (But hopefully will be soon.)
+Note that quote cycling only works with a |word|.
 
 
 
 ------------------------------------------------------------------------------
-4.2                                                       *g:speckyRunRdocKey*
+4.3                                                       *g:speckyRunRdocKey*
 
 
 Setting this enables the display of rdoc documentation for the current
@@ -152,7 +184,7 @@
 
 
 ------------------------------------------------------------------------------
-4.3                                                  *g:speckySpecSwitcherKey*
+4.4                                                  *g:speckySpecSwitcherKey*
 
 
 Setting this enables spec to code switching, and visa versa.
@@ -170,7 +202,7 @@
 
 
 ------------------------------------------------------------------------------
-4.4                                                       *g:speckyRunSpecKey*
+4.5                                                       *g:speckyRunSpecKey*
 
 
 Setting this variable allows you to run "spec" on the current buffer.
@@ -202,7 +234,7 @@
 
 
 ------------------------------------------------------------------------------
-4.5                                                       *g:speckyRunSpecCmd*
+4.6                                                       *g:speckyRunSpecCmd*
 
 
 This is the program, with flags, that the current file is sent to when
@@ -218,7 +250,7 @@
 
 
 ------------------------------------------------------------------------------
-4.6                                                       *g:speckyRunRdocCmd*
+4.7                                                       *g:speckyRunRdocCmd*
 
 
 If you prefer an rdoc display program other than "ri", you can set it
@@ -230,7 +262,7 @@
 
 
 ------------------------------------------------------------------------------
-4.7                                                        *g:speckyVertSplit*
+4.8                                                        *g:speckyVertSplit*
 
 
 For both spec and rdoc commands, split the new window vertically instead of
@@ -255,7 +287,6 @@
 
 Specky is distributed under the BSD license.
     http://www.opensource.org/licenses/bsd-license.php
-
 >
     Copyright (c) 2008, Mahlon E. Smith <mahlon@martini.nu>
     All rights reserved.
@@ -285,6 +316,4 @@
 
 
 
-
 vim: set noet nosta sw=4 ts=4 ft=help :
-
--- a/specky/plugin/specky.vim	Sun Mar 22 00:39:19 2009 +0000
+++ b/specky/plugin/specky.vim	Sun Mar 22 00:49:45 2009 +0000
@@ -16,6 +16,10 @@
 	execute 'map ' . g:speckyQuoteSwitcherKey . ' :call <SID>QuoteSwitcher()<CR>'
 endif
 
+if exists( 'g:speckyBannerKey' )
+	execute 'map ' . g:speckyBannerKey . ' :call <SID>MakeBanner()<CR>'
+endif
+
 if exists( 'g:speckyRunSpecKey' )
 	execute 'map ' . g:speckyRunSpecKey . ' :call <SID>RunSpec()<CR>'
 endif
@@ -39,6 +43,7 @@
 execute 'menu ' . s:menuloc . '.Run\ &spec :call <SID>RunSpec()<CR>'
 execute 'menu ' . s:menuloc . '.&RDoc\ lookup :call <SID>RunRdoc()<CR>'
 execute 'menu ' . s:menuloc . '.Rotate\ &quote\ style :call <SID>QuoteSwitcher()<CR>'
+execute 'menu ' . s:menuloc . '.Make\ a\ &banner :call <SID>MakeBanner()<CR>'
 
 
 " }}}
@@ -114,23 +119,23 @@
 	if l:type == '"'
 		" Double quote to single
 		"
-		execute ":normal viWs'" . l:word . "'"
+		execute ":normal viWc'" . l:word . "'"
 
 	elseif l:type == "'"
 		if &ft == "ruby"
 			" Single quote to symbol
 			"
-			execute ':normal viWs:' . l:word
+			execute ':normal viWc:' . l:word
 		else
 			" Single quote to double
 			"
-			execute ':normal viWs"' . l:word . '"'
+			execute ':normal viWc"' . l:word . '"'
 		end
 
 	else
 		" Whatever to double quote
 		"
-		execute ':normal viWs"' . l:word . '"'
+		execute ':normal viWc"' . l:word . '"'
 	endif
 
 	" Move the cursor back into the cl:word
@@ -140,6 +145,23 @@
 
 
 " }}}
+" MakeBanner() {{{
+"
+" Create a quick banner from the current line's text.
+"
+function! <SID>MakeBanner()
+	let l:banner_text = toupper(join( split( getline('.'), '\zs' ), ' ' ))
+	let l:banner_text = substitute( l:banner_text, '^\s\+', '', '' )
+	let l:sep = repeat( '#', 72 )
+	let l:line = line('.')
+
+	call setline( l:line, l:sep )
+ 	call append( l:line, [ '### ' . l:banner_text, l:sep ] )
+	call cursor( l:line + 3, 0 )
+endfunction
+
+
+" }}}
 " RunSpec() {{{
 "
 " Run this function while in a spec file to run the specs within vim.