Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Version 0.7

Removed the alignment routine completely.  There are far more robust implementations of this sort of thing already. (vimscript #294)
  • Loading branch information...
commit e43dc32deee6ce4f0bab63bbe0fcd876ed68223a 1 parent d5ff795
@mahlonsmith mahlonsmith authored vim-scripts committed
View
73 doc/specky.txt
@@ -1,4 +1,4 @@
-*specky.txt* Last change: $Id: specky.txt 92 2008-08-06 19:49:52Z mahlon $
+*specky.txt* Last change: $Id: specky.txt 49 2008-08-15 13:32:40Z mahlon $
VIM REFERENCE MANUAL by Mahlon E. Smith
@@ -15,13 +15,12 @@ CONTENTS *SpeckyContents*
3) Enabling Specky..............................|SpeckyVimrcExample|
4) Configuration................................|SpeckyOptions|
4.1) Cycling quote styles...................|g:speckyQuoteSwitcherKey|
- 4.2) Beautify assignment lines..............|g:speckyAlignKey|
- 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|
+ 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|
5) Author.......................................|SpeckyAuthor|
6) License......................................|SpeckyLicense|
@@ -71,9 +70,6 @@ now do with a single key stroke:
- Dynamically switch string types for the word under the cursor
(double quoted, quoted, symbol)
- - Automatically align hash blocks and assignment lines of all shapes
- and sizes.
-
==============================================================================
@@ -83,7 +79,6 @@ now do with a single key stroke:
Here's what my config looks like. >
let g:speckyQuoteSwitcherKey = "<C-S>'"
- let g:speckyAlignKey = "<C-S>a"
let g:speckyRunRdocKey = "<C-S>r"
let g:speckySpecSwitcherKey = "<C-S>x"
let g:speckyRunSpecKey = "<C-S>s"
@@ -91,18 +86,14 @@ Here's what my config looks like. >
let g:speckyRunRdocCmd = "fri -L -f plain"
let g:speckyVertSplit = 1
- map <C-S>} vi}=vi}<C-S>a
-
With these bindings, all specky commands start with <ctrl-s> ("s" for
specky!), followed by a mnemonic function to run:
' ----> Quote cycling ~
- a ----> Align assignments ~
r ----> run Rdoc ~
x ----> code and spec eXchange ~
s ----> run Spec ~
- } ----> align contents of curly Braces ~
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
@@ -120,7 +111,6 @@ Please note that you must (at an optional minimum) set the respective binding
variables:
|g:speckyQuoteSwitcherKey|
- |g:speckyAlignKey|
|g:speckyRunRdocKey|
|g:speckySpecSwitcherKey|
|g:speckyRunSpecKey|
@@ -152,44 +142,7 @@ supported. (But hopefully will be soon.)
------------------------------------------------------------------------------
-4.2 *g:speckyAlignKey*
-
-
-Automatically line up consecutive assignments, or hash definitions.
-As an example:
->
- CONSTANT = "something" | CONSTANT = "something"
- LONG_CONSTANT = "woooo" | LONG_CONSTANT = "woooo"
-
-You can also line up arbitrary key/value pairs, so long as the separator is
-"sane". (Dashes, ascii art arrows, etc)
->
- Mahlon E. Smith -----> 5000 | Mahlon E. Smith -----> 5000
- Edward Reich -----> 4842 | Edward Reich -----> 4842
- Relvin Sanders -----> 3909 | Relvin Sanders -----> 3909
-
-This beautification works on a range of lines. It's probably easiest to use
-with vim's |visual-mode|.
-
-Here's a useful macro for aligning hashes, assuming you use the
-<ctrl-s>+a binding:
-
- :map <C-S>} vi}=vi}<C-S>a ~
-
-
-This auto aligns anything inside braces. if your cursor is anywhere within
-the hash.
->
- hash = { | hash = {
- :blah => 1, | :blah => 1,
- :woo => 2, | :woo => 2,
- :whatever => 3 | :whatever => 3
- } | }
-
-
-
-------------------------------------------------------------------------------
-4.3 *g:speckyRunRdocKey*
+4.2 *g:speckyRunRdocKey*
Setting this enables the display of rdoc documentation for the current
@@ -199,7 +152,7 @@ using this binding to "drill down" to the desired documentation.
------------------------------------------------------------------------------
-4.4 *g:speckySpecSwitcherKey*
+4.3 *g:speckySpecSwitcherKey*
Setting this enables spec to code switching, and visa versa.
@@ -217,7 +170,7 @@ convention.
------------------------------------------------------------------------------
-4.5 *g:speckyRunSpecKey*
+4.4 *g:speckyRunSpecKey*
Setting this variable allows you to run "spec" on the current buffer.
@@ -249,7 +202,7 @@ switch to the spec before running the command.
------------------------------------------------------------------------------
-4.6 *g:speckyRunSpecCmd*
+4.5 *g:speckyRunSpecCmd*
This is the program, with flags, that the current file is sent to when
@@ -265,7 +218,7 @@ supported too, though less useful.
------------------------------------------------------------------------------
-4.7 *g:speckyRunRdocCmd*
+4.6 *g:speckyRunRdocCmd*
If you prefer an rdoc display program other than "ri", you can set it
@@ -277,7 +230,7 @@ with this variable.
------------------------------------------------------------------------------
-4.8 *g:speckyVertSplit*
+4.7 *g:speckyVertSplit*
For both spec and rdoc commands, split the new window vertically instead of
View
46 plugin/specky.vim
@@ -2,7 +2,7 @@
"
" Specky!
" Mahlon E. Smith <mahlon@martini.nu>
-" $Id: specky.vim 92 2008-08-06 19:49:52Z mahlon $
+" $Id: specky.vim 49 2008-08-15 13:32:40Z mahlon $
"
" }}}
@@ -24,10 +24,6 @@ if exists( 'g:speckyRunRdocKey' )
execute 'map ' . g:speckyRunRdocKey . ' :call <SID>RunRdoc()<CR>'
endif
-if exists( 'g:speckyAlignKey' )
- execute 'map ' . g:speckyAlignKey . ' :call <SID>AlignAssignment()<CR>'
-endif
-
if exists( 'specky_loaded' )
finish
@@ -43,7 +39,6 @@ execute 'menu ' . s:menuloc . '.&Jump\ to\ code/spec :call <SID>SpecSwitcher()<C
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 . '.&Align\ assignments :call <SID>AlignAssignment()<CR>'
" }}}
@@ -302,45 +297,6 @@ endfunction
" }}}
-" AlignAssignment( range ) {{{
-"
-" Prettify =, =>, and --> lines as such.
-"
-function! <SID>AlignAssignment() range
-
- let l:pat = '[-=]\+>\?'
- let l:white = '\(\s\+\)\?'
- let l:longest = 0
-
- " First pass, find the longest lvalue in the selection, after removing
- " additional stray whitespace.
- "
- let l:curline = a:firstline
- while l:curline <= a:lastline
- " what's the separator?
- let l:char = ' ' . matchstr( getline( l:curline ), l:pat ) . ' '
- " remove stray whites
- call setline( l:curline, substitute( getline(l:curline), l:white . l:pat . l:white , l:char, '' ) )
- " is this the longest line we've seen so far?
- let l:curlength = match( getline( l:curline ), l:pat )
- let l:longest = l:curlength > l:longest ? l:curlength : l:longest
-
- let l:curline = l:curline + 1
- endwhile
-
- " Second pass, expand with spaces to align assignments
- "
- let l:curline = a:firstline
- while l:curline <= a:lastline
- let l:spaces_needed = l:longest - match( getline( l:curline ), l:pat )
- let l:char = ' ' . matchstr( getline( l:curline ), l:pat ) . ' '
- call setline( l:curline, substitute( getline(l:curline), l:char, repeat( ' ', l:spaces_needed ) . l:char, ''))
- let l:curline = l:curline + 1
- endwhile
-endfunction
-
-
-"}}}
" s:err( msg ) "{{{
" Notify of problems in a consistent fashion.
"
View
2  syntax/rdoc.vim
@@ -1,6 +1,6 @@
"
" specky: syntax highlighting for 'rdoc' output
-" $Id: rdoc.vim 93 2008-08-11 02:25:18Z mahlon $
+" $Id: rdoc.vim 46 2008-08-12 16:24:10Z mahlon $
" Separator lines
View
2  syntax/specrun.vim
@@ -1,6 +1,6 @@
"
" specky: syntax highlighting for the 'spec' script output
-" $Id: specrun.vim 80 2008-07-09 06:58:41Z mahlon $
+" $Id: specrun.vim 46 2008-08-12 16:24:10Z mahlon $
"
if has("folding")

0 comments on commit e43dc32

Please sign in to comment.
Something went wrong with that request. Please try again.