Navigation Menu

Skip to content

Commit

Permalink
updated for version 7.1b
Browse files Browse the repository at this point in the history
  • Loading branch information
vimboss committed May 10, 2007
1 parent bc17643 commit 6ce2c13
Show file tree
Hide file tree
Showing 7 changed files with 606 additions and 34 deletions.
8 changes: 4 additions & 4 deletions runtime/doc/eval.txt
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.1a. Last change: 2007 May 03 *eval.txt* For Vim version 7.1b. Last change: 2007 May 07




VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1684,7 +1684,7 @@ matchlist( {expr}, {pat}[, {start}[, {count}]])
matchstr( {expr}, {pat}[, {start}[, {count}]]) matchstr( {expr}, {pat}[, {start}[, {count}]])
String {count}'th match of {pat} in {expr} String {count}'th match of {pat} in {expr}
max({list}) Number maximum value of items in {list} max({list}) Number maximum value of items in {list}
min({list}) Number minumum value of items in {list} min({list}) Number minimum value of items in {list}
mkdir({name} [, {path} [, {prot}]]) mkdir({name} [, {path} [, {prot}]])
Number create directory {name} Number create directory {name}
mode() String current editing mode mode() String current editing mode
Expand Down Expand Up @@ -2511,7 +2511,7 @@ feedkeys({string} [, {mode}]) *feedkeys()*
{string}. {string}.
To include special keys into {string}, use double-quotes To include special keys into {string}, use double-quotes
and "\..." notation |expr-quote|. For example, and "\..." notation |expr-quote|. For example,
feedkeys("\<CR>") simulates pressing of the Enter key. But feedkeys("\<CR>") simulates pressing of the <Enter> key. But
feedkeys('\<CR>') pushes 5 characters. feedkeys('\<CR>') pushes 5 characters.
If {mode} is absent, keys are remapped. If {mode} is absent, keys are remapped.
{mode} is a String, which can contain these character flags: {mode} is a String, which can contain these character flags:
Expand Down Expand Up @@ -3677,7 +3677,7 @@ max({list}) Return the maximum value of all items in {list}.
An empty |List| results in zero. An empty |List| results in zero.


*min()* *min()*
min({list}) Return the minumum value of all items in {list}. min({list}) Return the minimum value of all items in {list}.
If {list} is not a list or one of the items in {list} cannot If {list} is not a list or one of the items in {list} cannot
be used as a Number this results in an error. be used as a Number this results in an error.
An empty |List| results in zero. An empty |List| results in zero.
Expand Down
4 changes: 2 additions & 2 deletions runtime/doc/usr_31.txt
@@ -1,4 +1,4 @@
*usr_31.txt* For Vim version 7.1a. Last change: 2006 Apr 24 *usr_31.txt* For Vim version 7.1b. Last change: 2007 May 08


VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar


Expand Down Expand Up @@ -248,7 +248,7 @@ you can set the 'lines' option to set a different window size: >
You don't want to do this in a terminal, since it's size is fixed (except for You don't want to do this in a terminal, since it's size is fixed (except for
an xterm that supports resizing). an xterm that supports resizing).
The gvimrc file is searched for in the same locations as the vimrc file. The gvimrc file is searched for in the same locations as the vimrc file.
Normally it's name is "~/.gvimrc" for Unix and "$VIM/_gvimrc" for MS-Windows. Normally its name is "~/.gvimrc" for Unix and "$VIM/_gvimrc" for MS-Windows.
The $MYGVIMRC environment variable is set to it, thus you can use this command The $MYGVIMRC environment variable is set to it, thus you can use this command
to edit the file, if you have one: > to edit the file, if you have one: >
Expand Down
70 changes: 51 additions & 19 deletions runtime/ftplugin/ruby.vim
Expand Up @@ -30,28 +30,21 @@ endif
if exists("loaded_matchit") && !exists("b:match_words") if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 0 let b:match_ignorecase = 0


" TODO: improve optional do loops
let b:match_words = let b:match_words =
\ '\%(' . \ '\<\%(if\|unless\|case\|while\|until\|for\|do\|class\|module\|def\|begin\)\>=\@!' .
\ '\%(\%(\.\|\:\:\)\s*\|\:\)\@<!\<\%(class\|module\|begin\|def\|case\|for\|do\)\>' .
\ '\|' .
\ '\%(\%(^\|\.\.\.\=\|[{\:\,;([<>~\*/%&^|+-]\|\%(\<[_[\:lower\:]][_[\:alnum\:]]*\)\@<![!=?]\)\s*\)\@<=\%(if\|unless\|while\|until\)\>' .
\ '\)' .
\ ':' . \ ':' .
\ '\%(' . \ '\<\%(else\|elsif\|ensure\|when\|rescue\|break\|redo\|next\|retry\)\>' .
\ '\%(\%(\.\|\:\:\)\s*\|\:\)\@<!\<\%(else\|elsif\|ensure\|when\)\>' .
\ '\|' .
\ '\%(\%(^\|;\)\s*\)\@<=\<rescue\>' .
\ '\)' .
\ ':' . \ ':' .
\ '\%(\%(\.\|\:\:\)\s*\|\:\)\@<!\<end\>' . \ '\<end\>' .
\ ',{:},\[:\],(:)' \ ',{:},\[:\],(:)'


let b:match_skip = let b:match_skip =
\ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" . \ "synIDattr(synID(line('.'),col('.'),0),'name') =~ '" .
\ "\\<ruby\\%(String\\|StringDelimiter\\|ASCIICode\\|Interpolation\\|" . \ "\\<ruby\\%(String\\|StringDelimiter\\|ASCIICode\\|Escape\\|" .
\ "NoInterpolation\\|Escape\\|Comment\\|Documentation\\)\\>'" \ "Interpolation\\|NoInterpolation\\|Comment\\|Documentation\\|" .

\ "ConditionalModifier\\|RepeatModifier\\|OptionalDo\\|" .
\ "Function\\|BlockArgument\\|KeywordAsMethod\\|ClassVariable\\|" .
\ "InstanceVariable\\|GlobalVariable\\|Symbol\\)\\>'"
endif endif


setlocal formatoptions-=t formatoptions+=croql setlocal formatoptions-=t formatoptions+=croql
Expand Down Expand Up @@ -103,9 +96,26 @@ if has("gui_win32") && !exists("b:browsefilter")
endif endif


let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< kp<" let b:undo_ftplugin = "setl fo< inc< inex< sua< def< com< cms< path< kp<"
\ "| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip" \."| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip"
\ "| if exists('&ofu') && has('ruby') | setl ofu< | endif" \."| if exists('&ofu') && has('ruby') | setl ofu< | endif"
\ "| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif" \."| if has('balloon_eval') && exists('+bexpr') | setl bexpr< | endif"

if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")

noremap <silent> <buffer> [m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','b')<CR>
noremap <silent> <buffer> ]m :<C-U>call <SID>searchsyn('\<def\>','rubyDefine','')<CR>
noremap <silent> <buffer> [M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','b')<CR>
noremap <silent> <buffer> ]M :<C-U>call <SID>searchsyn('\<end\>','rubyDefine','')<CR>
noremap <silent> <buffer> [[ :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>','rubyModule\<Bar>rubyClass','b')<CR>
noremap <silent> <buffer> ]] :<C-U>call <SID>searchsyn('\<\%(class\<Bar>module\)\>','rubyModule\<Bar>rubyClass','')<CR>
noremap <silent> <buffer> [] :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','b')<CR>
noremap <silent> <buffer> ][ :<C-U>call <SID>searchsyn('\<end\>','rubyModule\<Bar>rubyClass','')<CR>
let b:undo_ftplugin = b:undo_ftplugin
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
endif


let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
Expand Down Expand Up @@ -155,7 +165,7 @@ function! RubyBalloonexpr()
return '' return ''
endif endif
silent! let res = substitute(system("ri -f simple -T \"".str.'"'),'\n$','','') silent! let res = substitute(system("ri -f simple -T \"".str.'"'),'\n$','','')
if res =~ '^Nothing known about' || res =~ '^Bad argument:' if res =~ '^Nothing known about' || res =~ '^Bad argument:' || res =~ '^More than one method'
return '' return ''
endif endif
return res return res
Expand All @@ -164,6 +174,28 @@ function! RubyBalloonexpr()
endif endif
endfunction endfunction


function! s:searchsyn(pattern,syn,flags)
norm! m'
let i = 0
let cnt = v:count ? v:count : 1
while i < cnt
let i = i + 1
let line = line('.')
let col = col('.')
let pos = search(a:pattern,'W'.a:flags)
while pos != 0 && s:synname() !~# a:syn
let pos = search(a:pattern,'W'.a:flags)
endwhile
if pos == 0
call cursor(line,col)
return
endif
endwhile
endfunction

function! s:synname()
return synIDattr(synID(line('.'),col('.'),0),'name')
endfunction


" "
" Instructions for enabling "matchit" support: " Instructions for enabling "matchit" support:
Expand Down

0 comments on commit 6ce2c13

Please sign in to comment.