Permalink
Browse files

Formatting betterification

  • Loading branch information...
1 parent bcdc442 commit 9601a67d93192ba1e84a2964cbaca6f3ee892835 @chreekat committed Dec 23, 2012
Showing with 23 additions and 23 deletions.
  1. +23 −23 README.md
View
@@ -1,34 +1,34 @@
Ripped straight from an email I wrote to some friends, it's
-= Target Parentheses
+# Target Parentheses
Showing crosshairs on the cursor when it's on top of parentheses (or othere
elements of 'matchpairs'.
To hell with code files, here's the code:
```vim
- func! TargetMatchpairs()
- if !exists('b:targetAcquired')
- let b:targetAcquired = 0
- endif
- if !exists('b:matchPairs')
- " '[:],{,},(,)' --> '[]{}()'
- let b:matchPairs = substitute(&matchpairs, "[,:]", "", "g")
- endif
- let curChar = getline('.')[col('.') - 1]
- let targetInReticule = stridx(b:matchPairs, curChar) >= 0
- if targetInReticule && !b:targetAcquired
- set cuc cul
- let b:targetAcquired = 1
- elseif !targetInReticule && b:targetAcquired
- set nocuc nocul
- let b:targetAcquired = 0
- endif
- endfu
+func! TargetMatchpairs()
+ if !exists('b:targetAcquired')
+ let b:targetAcquired = 0
+ endif
+ if !exists('b:matchPairs')
+ " '[:],{,},(,)' --> '[]{}()'
+ let b:matchPairs = substitute(&matchpairs, "[,:]", "", "g")
+ endif
+ let curChar = getline('.')[col('.') - 1]
+ let targetInReticule = stridx(b:matchPairs, curChar) >= 0
+ if targetInReticule && !b:targetAcquired
+ set cuc cul
+ let b:targetAcquired = 1
+ elseif !targetInReticule && b:targetAcquired
+ set nocuc nocul
+ let b:targetAcquired = 0
+ endif
+endfu
- augroup TargetMatchpairs
- au!
- au CursorMoved,CursorMovedI * call TargetMatchpairs()
- augroup END
+augroup TargetMatchpairs
+ au!
+ au CursorMoved,CursorMovedI * call TargetMatchpairs()
+augroup END
```

0 comments on commit 9601a67

Please sign in to comment.