Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More cycle groups, read me fix.

  • Loading branch information...
commit cc394e665872be8cbfb42b95b965519f3d7bad31 1 parent d5e4160
Zef Houssney authored
Showing with 17 additions and 8 deletions.
  1. +1 −1  README.textile
  2. +16 −7 plugin/cycle.vim
2  README.textile
View
@@ -2,7 +2,7 @@ h1. Cycle.vim
A vim plugin that allows you to toggle between pairs or lists of related words. The
default mappings are the same as those with which you can increment and decrement
-a number under the cursor: @<C-A>@ and @<C-X>@, respectively.
+a number under the cursor: <code><C-A></code> and <code><C-X></code>, respectively.
h2. Customization
23 plugin/cycle.vim
View
@@ -1,9 +1,9 @@
" cycle.vim - Toggle between related words
-if exists("g:loaded_cycle")
- finish
-endif
-let g:loaded_cycle = 1
+" if exists("g:loaded_cycle")
+" finish
+" endif
+" let g:loaded_cycle = 1
let s:options = [
\ ['==', '!='],
@@ -13,6 +13,7 @@ let s:options = [
\ ['if', 'unless'],
\ ['true', 'false'],
\ ['YES', 'NO'],
+ \ ['first', 'last'],
\]
" CSS/Sass/JavaScript/HTML
@@ -22,6 +23,7 @@ let s:options = s:options + [
\ ['top', 'bottom'],
\ ['margin', 'padding'],
\ ['height', 'width'],
+ \ ['absolute', 'relative'],
\ ['div', 'p', 'span'],
\ ['h1', 'h2', 'h3'],
\ ['png', 'jpg', 'gif'],
@@ -67,10 +69,17 @@ function! s:Cycle(word, direction)
endfunction
" Need to implement system to include things like this based on filetype
-" Ruby
+" Ruby (or Rails)
call AddCycleGroup(['else', 'elsif'])
-
-
+call AddCycleGroup(['include', 'require'])
+call AddCycleGroup(['class', 'module'])
+call AddCycleGroup(['Time', 'Date'])
+call AddCycleGroup(['present', 'blank'])
+
+" js/jQuery
+call AddCycleGroup(['show', 'hide'])
+call AddCycleGroup(['mouseover', 'mouseout'])
+call AddCycleGroup(['mouseenter', 'mouseleave'])
nnoremap <silent> <Plug>CycleNext :<C-U>call <SID>Cycle(expand("<cword>"), 1)<CR>
nnoremap <silent> <Plug>CyclePrevious :<C-U>call <SID>Cycle(expand("<cword>"), -1)<CR>
Please sign in to comment.
Something went wrong with that request. Please try again.