Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

reordered functions

  • Loading branch information...
commit 0b7665be19c8c622f5ef1bcee7bbd5d5b4379cbf 1 parent 6f8e561
@chrisbra authored
Showing with 36 additions and 36 deletions.
  1. +36 −36 autoload/ftimproved.vim
View
72 autoload/ftimproved.vim
@@ -104,6 +104,42 @@ fun! <sid>HighlightMatch(char) "{{{1
echohl Normal
endif
endfu
+fun! <sid>CheckSearchWrap(pat, fwd, cnt) "{{{1
+ " Check, if search would warp around
+ let counter = 1
+ let oldpos = getpos('.')
+
+ while a:cnt >= counter
+ let line = search(a:pat, (a:fwd ? '' : 'b') .'W')
+ if !line
+ " don't return anything, if the search would wrap around
+ call setpos('.', oldpos)
+ return 1
+ endif
+ let counter+=1
+ endw
+ call setpos('.', oldpos)
+ return 0
+endfun
+
+fun! <sid>Map(lhs, rhs) "{{{1
+ if !hasmapto(a:rhs, 'nxo')
+ for mode in split('nxo', '\zs')
+ exe mode. "noremap <silent> <expr> <unique>" a:lhs
+ \ substitute(a:rhs, 'X', '"'.mode.'"', '')
+ endfor
+ endif
+endfun
+
+fun! <sid>Unmap(lhs) "{{{1
+ "if hasmapto('ftimproved#FTCommand', 'nov')
+ if !empty(maparg(a:lhs, 'nov'))
+ exe "nunmap" a:lhs
+ exe "xunmap" a:lhs
+ exe "ounmap" a:lhs
+ endif
+endfun
+
fun! ftimproved#ColonCommand(f, mode) "{{{1
" should be a noop
if !exists("s:searchforward")
@@ -296,42 +332,6 @@ fun! ftimproved#FTCommand(f, fwd, mode) "{{{1
endtry
endfun
-fun! <sid>CheckSearchWrap(pat, fwd, cnt) "{{{1
- " Check, if search would warp around
- let counter = 1
- let oldpos = getpos('.')
-
- while a:cnt >= counter
- let line = search(a:pat, (a:fwd ? '' : 'b') .'W')
- if !line
- " don't return anything, if the search would wrap around
- call setpos('.', oldpos)
- return 1
- endif
- let counter+=1
- endw
- call setpos('.', oldpos)
- return 0
-endfun
-
-fun! <sid>Map(lhs, rhs) "{{{1
- if !hasmapto(a:rhs, 'nxo')
- for mode in split('nxo', '\zs')
- exe mode. "noremap <silent> <expr> <unique>" a:lhs
- \ substitute(a:rhs, 'X', '"'.mode.'"', '')
- endfor
- endif
-endfun
-
-fun! <sid>Unmap(lhs) "{{{1
- "if hasmapto('ftimproved#FTCommand', 'nov')
- if !empty(maparg(a:lhs, 'nov'))
- exe "nunmap" a:lhs
- exe "xunmap" a:lhs
- exe "ounmap" a:lhs
- endif
-endfun
-
fun! ftimproved#Activate(enable) "{{{1
if a:enable
" Disable the remapping of those keys by the yankring plugin
Please sign in to comment.
Something went wrong with that request. Please try again.