specky/doc/specky.txt
branchvim-stuff
changeset 3 db3e3abfc647
parent 2 6b33188f1694
child 5 3346aa8d5364
equal deleted inserted replaced
2:6b33188f1694 3:db3e3abfc647
    12 
    12 
    13     1) Intro........................................|SpeckyIntro|
    13     1) Intro........................................|SpeckyIntro|
    14     2) Functionality................................|SpeckyFunctionality|
    14     2) Functionality................................|SpeckyFunctionality|
    15     3) Enabling Specky..............................|SpeckyVimrcExample|
    15     3) Enabling Specky..............................|SpeckyVimrcExample|
    16     4) Configuration................................|SpeckyOptions|
    16     4) Configuration................................|SpeckyOptions|
    17         4.1) Cycling quote styles...................|g:speckyQuoteSwitcherKey|
    17         4.1) Create text banners....................|g:speckyBannerKey|
    18         4.2) Display ruby documentation.............|g:speckyRunRdocKey|
    18         4.2) Cycling quote styles...................|g:speckyQuoteSwitcherKey|
    19         4.3) Toggle editing between spec and code...|g:speckySpecSwitcherKey|
    19         4.3) Display ruby documentation.............|g:speckyRunRdocKey|
    20         4.4) Run specs for the current buffer.......|g:speckyRunSpecKey|
    20         4.4) Toggle editing between spec and code...|g:speckySpecSwitcherKey|
    21         4.5) Modify the default spec command........|g:speckyRunSpecCmd|
    21         4.5) Run specs for the current buffer.......|g:speckyRunSpecKey|
    22         4.6) Modify the default rdoc command........|g:speckyRunRdocCmd|
    22         4.6) Modify the default spec command........|g:speckyRunSpecCmd|
    23         4.7) Split windows vertically...............|g:speckyVertSplit|
    23         4.7) Modify the default rdoc command........|g:speckyRunRdocCmd|
       
    24         4.8) Split windows vertically...............|g:speckyVertSplit|
    24     5) Author.......................................|SpeckyAuthor|
    25     5) Author.......................................|SpeckyAuthor|
    25     6) License......................................|SpeckyLicense|
    26     6) License......................................|SpeckyLicense|
    26 
    27 
    27 
    28 
    28 
    29 
    46 
    47 
    47 By default?  Nothing, unless you are comfortable using the menus.  I decided
    48 By default?  Nothing, unless you are comfortable using the menus.  I decided
    48 the easiest way to cherry pick the functionality that you'd like was to enable
    49 the easiest way to cherry pick the functionality that you'd like was to enable
    49 them via key bindings.  By doing this, Specky won't make assumptions about
    50 them via key bindings.  By doing this, Specky won't make assumptions about
    50 your current environment, and won't stomp on anything you don't want it to.
    51 your current environment, and won't stomp on anything you don't want it to.
    51 >
    52 
    52     Specky won't do -anything- with your environment until you enable
    53     Specky won't do -anything- with your environment until you enable ~
    53     the key bindings!!
    54     the key bindings!! ~
    54 
    55 
    55 After you've configured your bindings, here are some of the things you can
    56 After you've configured your bindings, here are some of the things you can
    56 now do with a single key stroke:
    57 now do with a single key stroke:
    57 >
    58 >
    58     - Switch back and forth from code to testing spec 
    59     - Switch back and forth from code to testing spec 
    68     - View rdoc of the word under the cursor
    69     - View rdoc of the word under the cursor
    69 
    70 
    70     - Dynamically switch string types for the word under the cursor
    71     - Dynamically switch string types for the word under the cursor
    71       (double quoted, quoted, symbol)
    72       (double quoted, quoted, symbol)
    72 
    73 
       
    74     - Make lovely and quick comment banners for ruby code.
    73 
    75 
    74 
    76 
    75 ==============================================================================
    77 ==============================================================================
    76 3. ENABLING-SPECKY                                        *SpeckyVimrcExample*
    78 3. ENABLING-SPECKY                                        *SpeckyVimrcExample*
    77 
    79 
    78 
    80 
    79 Here's what my config looks like. >
    81 Here's what my config looks like. >
    80 
    82 
       
    83     let g:speckyBannerKey = "<C-S>b"
    81     let g:speckyQuoteSwitcherKey = "<C-S>'"
    84     let g:speckyQuoteSwitcherKey = "<C-S>'"
    82     let g:speckyRunRdocKey = "<C-S>r"
    85     let g:speckyRunRdocKey = "<C-S>r"
    83     let g:speckySpecSwitcherKey = "<C-S>x"
    86     let g:speckySpecSwitcherKey = "<C-S>x"
    84     let g:speckyRunSpecKey = "<C-S>s"
    87     let g:speckyRunSpecKey = "<C-S>s"
    85     let g:speckyRunSpecCmd = "spec -fs -r loadpath.rb"
    88     let g:speckyRunSpecCmd = "spec -fs -r loadpath.rb"
    88 
    91 
    89 
    92 
    90 With these bindings, all specky commands start with <ctrl-s> ("s" for
    93 With these bindings, all specky commands start with <ctrl-s> ("s" for
    91 specky!), followed by a mnemonic function to run:
    94 specky!), followed by a mnemonic function to run:
    92 
    95 
       
    96     b ----> Banner creation ~
    93     ' ----> Quote cycling ~
    97     ' ----> Quote cycling ~
    94     r ----> run Rdoc ~
    98     r ----> run Rdoc ~
    95     x ----> code and spec eXchange ~
    99     x ----> code and spec eXchange ~
    96     s ----> run Spec ~
   100     s ----> run Spec ~
    97 
   101 
    98 Of course, <ctrl-s> is a "suspend" signal for most terminals, so these
   102 Of course, <ctrl-s> is a "suspend" signal for most terminals, so these
    99 bindings are meant for a |gui| environment, such as gvim.  Your mileage (and
   103 bindings are meant for a |gui| environment, such as gvim.  Your mileage (and
   100 tastes) will doubtlessly vary.
   104 tastes) will doubtlessly vary.  Do what you will.  I won't judge you.
   101 
   105 
   102 
   106 
   103 
   107 
   104 ==============================================================================
   108 ==============================================================================
   105 4. CONFIGURATION-OPTIONS                                       *SpeckyOptions*
   109 4. CONFIGURATION-OPTIONS                                       *SpeckyOptions*
   106 
   110 
   107 
   111 
   108 Here are all of the available configuration options.
   112 Here are all of the available configuration options.
   109 
   113 
   110 Please note that you must (at an optional minimum) set the respective binding
   114 Please note that you must set binding variables:
   111 variables:
   115 
   112 
   116     |g:speckyBannerKey|
   113     |g:speckyQuoteSwitcherKey|
   117     |g:speckyQuoteSwitcherKey|
   114     |g:speckyRunRdocKey|
   118     |g:speckyRunRdocKey|
   115     |g:speckySpecSwitcherKey|
   119     |g:speckySpecSwitcherKey|
   116     |g:speckyRunSpecKey|
   120     |g:speckyRunSpecKey|
   117 
   121 
   118 ...in order to enable specky functionality.  See |SpeckyVimrcExample| for
   122 ...in order to enable the respective specky functionality.  See
   119 details. Any other options are entirely optional.  Put these into your
   123 |SpeckyVimrcExample| for details. Any other options are entirely optional.
   120 |vimrc|, or wherever else you enjoy storing this kind of stuff.
   124 Put these into your |vimrc|, or wherever else you enjoy storing this kind of
   121 
   125 stuff.
   122 
   126 
   123 
   127 
   124 ------------------------------------------------------------------------------
   128 
   125 4.1                                                 *g:speckyQuoteSwitcherKey*
   129 ------------------------------------------------------------------------------
       
   130 4.1                                                        *g:speckyBannerKey*
       
   131 
       
   132 
       
   133 Setting this binding enables comment banner creation.
       
   134 
       
   135 This is purely a convenience routine, and a stylistic one at that.  I prefer
       
   136 large advertising of what "area" of code you are in, along with other
       
   137 miscellaneous labels for humans to read.  If this isn't how you roll, then by
       
   138 all means, don't enable this binding!  :)
       
   139 
       
   140 As an example -- you can just type:
       
   141 
       
   142 	instance methods ~
       
   143 
       
   144 Then hit the keystroke.  It will magically turn into: >
       
   145 
       
   146   ########################################################################
       
   147   ### I N S T A N C E   M E T H O D S
       
   148   ########################################################################
       
   149 
       
   150 With all those saved extra keystrokes this might provide you per banner over
       
   151 the years, your RSI-free hands will thank you.  And the total time savings!!
       
   152 Oh man, what are you going to DO with all of that extra free time?
       
   153 The possibilities are staggering.
       
   154 
       
   155 
       
   156 
       
   157 ------------------------------------------------------------------------------
       
   158 4.2                                                 *g:speckyQuoteSwitcherKey*
   126 
   159 
   127 
   160 
   128 Setting this binding enables quote "style switching".
   161 Setting this binding enables quote "style switching".
   129 
   162 
   130 If you aren't in ruby mode, this just changes the word under the cursor
   163 If you aren't in ruby mode, this just changes the word under the cursor
   134 
   167 
   135 In ruby mode, symbols are also put into the rotation.
   168 In ruby mode, symbols are also put into the rotation.
   136 
   169 
   137     "string" -> 'string' -> :string -> "string" ... ~
   170     "string" -> 'string' -> :string -> "string" ... ~
   138 
   171 
   139 Note that quote cycling only works with a |word|.  Sentences are not currently
   172 Note that quote cycling only works with a |word|.
   140 supported.  (But hopefully will be soon.)
   173 
   141 
   174 
   142 
   175 
   143 
   176 ------------------------------------------------------------------------------
   144 ------------------------------------------------------------------------------
   177 4.3                                                       *g:speckyRunRdocKey*
   145 4.2                                                       *g:speckyRunRdocKey*
       
   146 
   178 
   147 
   179 
   148 Setting this enables the display of rdoc documentation for the current
   180 Setting this enables the display of rdoc documentation for the current
   149 word under the cursor.  For lookups with multiple matches, you can continue
   181 word under the cursor.  For lookups with multiple matches, you can continue
   150 using this binding to "drill down" to the desired documentation.
   182 using this binding to "drill down" to the desired documentation.
   151          
   183          
   152 
   184 
   153 
   185 
   154 ------------------------------------------------------------------------------
   186 ------------------------------------------------------------------------------
   155 4.3                                                  *g:speckySpecSwitcherKey*
   187 4.4                                                  *g:speckySpecSwitcherKey*
   156 
   188 
   157 
   189 
   158 Setting this enables spec to code switching, and visa versa.
   190 Setting this enables spec to code switching, and visa versa.
   159 
   191 
   160 Switching uses path searching instead of reliance on directory structure in
   192 Switching uses path searching instead of reliance on directory structure in
   168  as a quick toggle for code and tests.
   200  as a quick toggle for code and tests.
   169 
   201 
   170 
   202 
   171 
   203 
   172 ------------------------------------------------------------------------------
   204 ------------------------------------------------------------------------------
   173 4.4                                                       *g:speckyRunSpecKey*
   205 4.5                                                       *g:speckyRunSpecKey*
   174 
   206 
   175 
   207 
   176 Setting this variable allows you to run "spec" on the current buffer.
   208 Setting this variable allows you to run "spec" on the current buffer.
   177 
   209 
   178 All output is sent to a syntax highlighted scratch buffer. This new window is
   210 All output is sent to a syntax highlighted scratch buffer. This new window is
   200 switch to the spec before running the command.
   232 switch to the spec before running the command.
   201 
   233 
   202 
   234 
   203 
   235 
   204 ------------------------------------------------------------------------------
   236 ------------------------------------------------------------------------------
   205 4.5                                                       *g:speckyRunSpecCmd*
   237 4.6                                                       *g:speckyRunSpecCmd*
   206 
   238 
   207 
   239 
   208 This is the program, with flags, that the current file is sent to when
   240 This is the program, with flags, that the current file is sent to when
   209 executing the |g:speckyRunSpecKey| keybinding.
   241 executing the |g:speckyRunSpecKey| keybinding.
   210 
   242 
   216         spec -fs
   248         spec -fs
   217 
   249 
   218 
   250 
   219 
   251 
   220 ------------------------------------------------------------------------------
   252 ------------------------------------------------------------------------------
   221 4.6                                                       *g:speckyRunRdocCmd*
   253 4.7                                                       *g:speckyRunRdocCmd*
   222 
   254 
   223 
   255 
   224 If you prefer an rdoc display program other than "ri", you can set it
   256 If you prefer an rdoc display program other than "ri", you can set it
   225 with this variable.
   257 with this variable.
   226 
   258 
   228         ri
   260         ri
   229 
   261 
   230 
   262 
   231 
   263 
   232 ------------------------------------------------------------------------------
   264 ------------------------------------------------------------------------------
   233 4.7                                                        *g:speckyVertSplit*
   265 4.8                                                        *g:speckyVertSplit*
   234 
   266 
   235 
   267 
   236 For both spec and rdoc commands, split the new window vertically instead of
   268 For both spec and rdoc commands, split the new window vertically instead of
   237 horizontally.
   269 horizontally.
   238 
   270 
   253 6. LICENSE                                                     *SpeckyLicense*
   285 6. LICENSE                                                     *SpeckyLicense*
   254 
   286 
   255 
   287 
   256 Specky is distributed under the BSD license.
   288 Specky is distributed under the BSD license.
   257     http://www.opensource.org/licenses/bsd-license.php
   289     http://www.opensource.org/licenses/bsd-license.php
   258 
       
   259 >
   290 >
   260     Copyright (c) 2008, Mahlon E. Smith <mahlon@martini.nu>
   291     Copyright (c) 2008, Mahlon E. Smith <mahlon@martini.nu>
   261     All rights reserved.
   292     All rights reserved.
   262 
   293 
   263     Redistribution and use in source and binary forms, with or without
   294     Redistribution and use in source and binary forms, with or without
   283     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   314     NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   284     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   315     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   285 
   316 
   286 
   317 
   287 
   318 
   288 
       
   289 vim: set noet nosta sw=4 ts=4 ft=help :
   319 vim: set noet nosta sw=4 ts=4 ft=help :
   290