0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.0c10

This commit is contained in:
Bram Moolenaar 2006-04-05 20:41:53 +00:00
parent e2f98b95c8
commit 910f66f90c
128 changed files with 11811 additions and 2961 deletions

View File

@ -361,8 +361,7 @@ SRC_MAC = \
src/INSTALLmac.txt \ src/INSTALLmac.txt \
src/dehqx.py \ src/dehqx.py \
src/gui_mac.c \ src/gui_mac.c \
src/gui_mac.icns \ src/os_mac_rsrc/*.icns \
src/doc-txt.icns \
src/os_mac.h \ src/os_mac.h \
src/os_mac.rsr.hqx \ src/os_mac.rsr.hqx \
src/os_mac_conv.c \ src/os_mac_conv.c \
@ -522,7 +521,6 @@ RT_SCRIPTS = \
# Unix runtime # Unix runtime
RT_UNIX = \ RT_UNIX = \
README_unix.txt \ README_unix.txt \
runtime/KVim.desktop \
runtime/hi16-action-make.png \ runtime/hi16-action-make.png \
runtime/hi22-action-make.png \ runtime/hi22-action-make.png \
runtime/vim16x16.png \ runtime/vim16x16.png \

View File

@ -1,44 +0,0 @@
# KDE Config File
[Desktop Entry]
Type=Application
Exec=kvim -f %F
Icon=kvim
MiniIcon=kvim
DocPath=kvim/index.html
Comment=
Comment[xx]=xx
Terminal=0
Name=KVim
Name[eo]=VIM-fasado
Name[sv]=Kvim
Name[xx]=xx
Comment=Text Editor
Comment[ar]=محرر نصوص
Comment[bg]=Текст Редактор
Comment[de]=Texteditor
Comment[el]=Διορθωτής Κειμένου
Comment[eo]=Tekstredaktilo
Comment[et]=Tekstiredaktor
Comment[eu]=Testu Editorea
Comment[fi]=Tekstieditori
Comment[he]=עורך טקסט
Comment[is]=Textaritill
Comment[ja]=
Comment[lt]=Teksto redaktorius
Comment[mt]=Editur tat-test
Comment[pt_BR]=Editor de Texto
Comment[ro]=Editor de text
Comment[ru]=редактор
Comment[sk]=Textový editor
Comment[sl]=Urejevalnik besedil
Comment[ta]=¯¨Ã ¦¾¡ÌôÀ¡Ç÷
Comment[tr]=Metin Düzenleyici
Comment[uk]=Редактор текстів
Comment[vi]=Trình son văn bn
Comment[xx]=xx
Comment[zh_CN]=
Comment[zh_TW]=
MimeType=application/mathml+xml;application/xhtml+xml;application/x-perl;application/x-python;application/x-shellscript;audio/x-mpegurl;audio/x-scpls;image/svg+xml;message/news;message/rfc822;text/calendar;text/css;text/english;text/html;text/mrml;text/plain;text/rdf;text/rss;text/rtf;text/sgml;text/vnd.wap.wml;text/x-adasrc;text/x-bibtex;text/x-chdr;text/x-c++hdr;text/x-csrc;text/x-c++src;text/x-csv;text/x-diff;text/x-java;text/x-katefilelist;text/x-latex;text/x-log;text/x-lyx;text/x-makefile;text/xmcd;text/xml;text/x-moc;text/x-mswinurl;text/x-objcsrc;text/x-pascal;text/x-perl;text/x-python;text/x-tcl;text/x-tex;text/x-vcalendar;text/x-vcard;text/x-xslfo;text/x-xslt
X-KDE-StartupNotify=true
X-KDE-AuthorizeAction=shell access

View File

@ -1,6 +1,6 @@
" Vim autoload file for editing compressed files. " Vim autoload file for editing compressed files.
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Jul 26 " Last Change: 2006 Mar 31
" These functions are used by the gzip plugin. " These functions are used by the gzip plugin.
@ -84,9 +84,14 @@ fun gzip#read(cmd)
'[,']d _ '[,']d _
endif endif
" read in the uncompressed lines "'[-1r tmp" " read in the uncompressed lines "'[-1r tmp"
" Use ++edit if the buffer was empty, keep the 'ff' and 'fenc' options.
setlocal nobin setlocal nobin
if exists(":lockmarks") if exists(":lockmarks")
execute "silent lockmarks " . l . "r " . tmp if empty
execute "silent lockmarks " . l . "r ++edit " . tmp
else
execute "silent lockmarks " . l . "r " . tmp
endif
else else
execute "silent " . l . "r " . tmp execute "silent " . l . "r " . tmp
endif endif

View File

@ -1,7 +1,7 @@
" netrw.vim: Handles file transfer and remote directory listing across a network " netrw.vim: Handles file transfer and remote directory listing across a network
" AUTOLOAD PORTION " AUTOLOAD PORTION
" Date: Mar 22, 2006 " Date: Mar 31, 2006
" Version: 83 " Version: 84
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
@ -23,7 +23,7 @@
if &cp || exists("g:loaded_netrw") if &cp || exists("g:loaded_netrw")
finish finish
endif endif
let g:loaded_netrw = "v83" let g:loaded_netrw = "v84"
if v:version < 700 if v:version < 700
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None
finish finish
@ -404,8 +404,9 @@ fun! netrw#NetRead(mode,...)
call s:NetMethod(choice) call s:NetMethod(choice)
" Check if NetBrowse() should be handling this request " Check if NetBrowse() should be handling this request
" call Decho("checking if netlist: choice<".choice."> netrw_list_cmd<".g:netrw_list_cmd.">") " call Decho("checking if NetBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">")
if choice =~ "^.*[\/]$" if choice =~ "^.*[\/]$"
" call Decho("yes, choice matches '^.*[\/]$'")
keepjumps call s:NetBrowse(choice) keepjumps call s:NetBrowse(choice)
" call Dret("NetRead") " call Dret("NetRead")
return return
@ -457,6 +458,7 @@ fun! netrw#NetRead(mode,...)
elseif b:netrw_method == 2 " read with ftp + <.netrc> elseif b:netrw_method == 2 " read with ftp + <.netrc>
" call Decho("read via ftp+.netrc (method #2)") " call Decho("read via ftp+.netrc (method #2)")
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape) let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
" call Decho("netrw_fname<".netrw_fname.">")
new new
setlocal ff=unix setlocal ff=unix
exe "put ='".g:netrw_ftpmode."'" exe "put ='".g:netrw_ftpmode."'"
@ -780,7 +782,7 @@ fun! s:NetGetFile(readcmd, tfile, method)
" call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")") " call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")")
call NetReadFixup(a:method, line1, line2) call NetReadFixup(a:method, line1, line2)
" else " Decho " else " Decho
" call Decho("NetReadFixup() not called, doesn't exist") " call Decho("NetReadFixup() not called, doesn't exist (line1=".line1." line2=".line2.")")
endif endif
" update the Buffers menu " update the Buffers menu
@ -1239,7 +1241,6 @@ fun! s:NetBrowse(dirname)
exe "silent doau BufReadPre ".fname exe "silent doau BufReadPre ".fname
silent call netrw#NetRead(2,method."://".user.machine."/".path) silent call netrw#NetRead(2,method."://".user.machine."/".path)
exe "silent doau BufReadPost ".fname exe "silent doau BufReadPost ".fname
keepjumps 1d
" save certain window-oriented variables into buffer-oriented variables " save certain window-oriented variables into buffer-oriented variables
call s:SetBufWinVars() call s:SetBufWinVars()
@ -1352,7 +1353,7 @@ fun! s:NetBrowse(dirname)
endif endif
let w:netrw_bannercnt= w:netrw_bannercnt + 1 let w:netrw_bannercnt= w:netrw_bannercnt + 1
endif endif
keepjumps put ='\" Quick Help: ?:help -:go up dir D:delete R:rename s:sort-by x:exec' keepjumps put ='\" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec'
keepjumps put ='\" ===========================================================================' keepjumps put ='\" ==========================================================================='
" remote read the requested directory listing " remote read the requested directory listing
@ -2943,7 +2944,7 @@ fun! netrw#DirBrowse(dirname)
endif endif
let w:netrw_bannercnt= w:netrw_bannercnt + 1 let w:netrw_bannercnt= w:netrw_bannercnt + 1
endif endif
keepjumps put ='\" Quick Help: ?:help -:go up dir D:delete R:rename s:sort-by x:exec' keepjumps put ='\" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec'
keepjumps put ='\" ============================================================================' keepjumps put ='\" ============================================================================'
let w:netrw_bannercnt= w:netrw_bannercnt + 2 let w:netrw_bannercnt= w:netrw_bannercnt + 2

View File

@ -1,7 +1,7 @@
" Vim completion script " Vim completion script
" Language: PHP " Language: PHP
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Mar --- " Last Change: 2006 Apr 05
" "
" TODO: " TODO:
" - Class aware completion: " - Class aware completion:
@ -47,400 +47,594 @@ function! phpcomplete#CompletePHP(findstart, base)
" We can be also inside of phpString with HTML tags. Deal with " We can be also inside of phpString with HTML tags. Deal with
" it later (time, not lines). " it later (time, not lines).
endif endif
else
" If exists b:php_menu it means completion was already constructed we
" don't need to do anything more
if exists("b:php_menu")
return b:php_menu
endif
" Initialize base return lists
let res = []
" a:base is very short - we need context
if exists("b:compl_context")
let context = b:compl_context
unlet! b:compl_context
endif
if !exists('g:php_builtin_functions') endif
call phpcomplete#LoadData() " If exists b:php_menu it means completion was already constructed we
endif " don't need to do anything more
if exists("b:php_menu")
return b:php_menu
endif
" Initialize base return lists
let res = []
let res2 = []
" a:base is very short - we need context
if exists("b:compl_context")
let context = b:compl_context
unlet! b:compl_context
endif
let scontext = substitute(context, if !exists('g:php_builtin_functions')
\ '\$\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*$', '', '') call phpcomplete#LoadData()
endif
if scontext =~ '\(=\s*new\|extends\)\s\+$' let scontext = substitute(context, '\$\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*$', '', '')
" Complete class name
" Internal solution for finding classes in current file.
let file = getline(1, '$')
call filter(file,
\ 'v:val =~ "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let jfile = join(file, ' ')
let int_values = split(jfile, 'class\s\+')
let int_classes = {}
for i in int_values
let c_name = matchstr(i, '^[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
if c_name != ''
let int_classes[c_name] = ''
endif
endfor
" Prepare list of functions from tags file if scontext =~ '\(=\s*new\|extends\)\s\+$'
let ext_classes = {} " Complete class name
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")')) " Internal solution for finding classes in current file.
if fnames != '' let file = getline(1, '$')
exe 'silent! vimgrep /^'.a:base.'.*\tc\(\t\|$\)/j '.fnames call filter(file,
let qflist = getqflist() \ 'v:val =~ "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
for field in qflist let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
" [:space:] thing: we don't have to be so strict when let jfile = join(file, ' ')
" dealing with tags files - entries there were already let int_values = split(jfile, 'class\s\+')
" checked by ctags. let int_classes = {}
let item = matchstr(field['text'], '^[^[:space:]]\+') for i in int_values
let ext_classes[item] = '' let c_name = matchstr(i, '^[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
endfor if c_name != ''
let int_classes[c_name] = ''
endif endif
endfor
call extend(int_classes, ext_classes) " Prepare list of functions from tags file
let ext_classes = {}
for m in sort(keys(int_classes)) let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
if m =~ '^'.a:base if fnames != ''
call add(res, m) exe 'silent! vimgrep /^'.a:base.'.*\tc\(\t\|$\)/j '.fnames
endif let qflist = getqflist()
for field in qflist
" [:space:] thing: we don't have to be so strict when
" dealing with tags files - entries there were already
" checked by ctags.
let item = matchstr(field['text'], '^[^[:space:]]\+')
let ext_classes[item] = ''
endfor endfor
endif
let int_list = res call extend(int_classes, ext_classes)
let final_menu = [] for m in sort(keys(int_classes))
for i in int_list if m =~ '^'.a:base
let final_menu += [{'word':i, 'kind':'c'}] call add(res, m)
endfor endif
endfor
return final_menu let int_list = res
elseif scontext =~ '\(->\|::\)$' let final_menu = []
" Complete user functions and variables for i in int_list
" Internal solution for current file. let final_menu += [{'word':i, 'kind':'c'}]
" That seems as unnecessary repeating of functions but there are endfor
" few not so subtle differences as not appending of $ and addition
" of 'kind' tag (not necessary in regular completion) return final_menu
if a:base =~ '^\$'
let adddollar = '$' elseif scontext =~ '\(->\|::\)$'
" Complete user functions and variables
" Internal solution for current file.
" That seems as unnecessary repeating of functions but there are
" few not so subtle differences as not appending of $ and addition
" of 'kind' tag (not necessary in regular completion)
if scontext =~ '->$' && scontext !~ '\$this->$'
" Get name of the class
let classname = phpcomplete#GetClassName(scontext)
" Get location of class definition, we have to iterate through all
" tags files separately because we need relative path from current
" file to the exact file (tags file can be in different dir)
if classname != ''
let classlocation = phpcomplete#GetClassLocation(classname)
else else
let adddollar = '' let classlocation = ''
endif endif
let file = getline(1, '$')
let jfile = join(file, ' ') if filereadable(classlocation)
let sfile = split(jfile, '\$') let classfile = readfile(classlocation)
let int_vars = {} let classcontent = ''
for i in sfile let classcontent .= "\n".phpcomplete#GetClassContents(classfile, classname)
if i =~ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*=\s*new' let sccontent = split(classcontent, "\n")
let val = matchstr(i, '^[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*').'->'
else " YES, YES, YES! - we have whole content including extends!
let val = matchstr(i, '^[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*') " Now we need to get two elements: public functions and public
endif " vars
if val !~ '' " NO, NO, NO! - third separate filtering looking for content
let int_vars[adddollar.val] = '' " :(, but all of them have differences. To squeeze them into
endif " one implementation would require many additional arguments
endfor " and ifs. No good solution
" Functions declared with public keyword or without any
" ctags has good support for PHP, use tags file for external " keyword are public
" variables let functions = filter(deepcopy(sccontent),
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")')) \ 'v:val =~ "^\\s*\\(public\\s\\*\\)\\?function"')
let ext_vars = {} let jfuncs = join(functions, ' ')
if fnames != '' let sfuncs = split(jfuncs, 'function\s\+')
let sbase = substitute(a:base, '^\$', '', '') let c_functions = {}
exe 'silent! vimgrep /^'.sbase.'.*\tv\(\t\|$\)/j '.fnames for i in sfuncs
let qflist = getqflist() let f_name = matchstr(i,
for field in qflist \ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let item = matchstr(field['text'], '^[^[:space:]]\+') let f_args = matchstr(i,
" Add -> if it is possible object declaration \ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*{')
let classname = '' if f_name != ''
if field['text'] =~ item.'\s*=\s*new\s\+' let c_functions[f_name.'('] = f_args
let item = item.'->'
let classname = matchstr(field['text'],
\ '=\s*new\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze')
endif endif
let ext_vars[adddollar.item] = classname
endfor endfor
endif " Variables declared with var or with public keyword are
" public
" Now we have all variables in int_vars dictionary let variables = filter(deepcopy(sccontent),
call extend(int_vars, ext_vars) \ 'v:val =~ "^\\s*\\(public\\|var\\)\\s\\+\\$"')
let jvars = join(variables, ' ')
" Internal solution for finding functions in current file. let svars = split(jvars, '\$')
let file = getline(1, '$') let c_variables = {}
call filter(file, for i in svars
\ 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("') let c_var = matchstr(i,
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")')) \ '^\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let jfile = join(file, ' ') if c_var != ''
let int_values = split(jfile, 'function\s\+') let c_variables[c_var] = ''
let int_functions = {}
for i in int_values
let f_name = matchstr(i,
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let f_args = matchstr(i,
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*{')
let int_functions[f_name.'('] = f_args
endfor
" Prepare list of functions from tags file
let ext_functions = {}
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\tf\(\t\|$\)/j '.fnames
let qflist = getqflist()
for field in qflist
" File name
let item = matchstr(field['text'], '^[^[:space:]]\+')
let fname = matchstr(field['text'], '\t\zs\f\+\ze')
let prototype = matchstr(field['text'],
\ 'function\s\+&\?[^[:space:]]\+\s*(\s*\zs.\{-}\ze\s*)\s*{\?')
let ext_functions[item.'('] = prototype.') - '.fname
endfor
endif
let all_values = {}
call extend(all_values, int_functions)
call extend(all_values, ext_functions)
call extend(all_values, int_vars) " external variables are already in
call extend(all_values, g:php_builtin_object_functions)
for m in sort(keys(all_values))
if m =~ '\(^\|::\)'.a:base
call add(res, m)
endif
endfor
let start_list = res
let final_list = []
for i in start_list
if has_key(int_vars, i)
let class = ' '
if all_values[i] != ''
let class = i.' class '
endif endif
let final_list += [{'word':i, 'info':class.all_values[i], 'kind':'v'}] endfor
else
let final_list += let all_values = {}
\ [{'word':substitute(i, '.*::', '', ''), call extend(all_values, c_functions)
\ 'info':i.all_values[i], call extend(all_values, c_variables)
\ 'kind':'f'}] call extend(all_values, g:php_builtin_object_functions)
endif
endfor for m in sort(keys(all_values))
if m =~ '^'.a:base && m !~ '::'
call add(res, m)
elseif m =~ '::'.a:base
call add(res2, m)
endif
endfor
let start_list = res + res2
let final_list = []
for i in start_list
if has_key(c_variables, i)
let class = ' '
if all_values[i] != ''
let class = i.' class '
endif
let final_list +=
\ [{'word':i,
\ 'info':class.all_values[i],
\ 'kind':'v'}]
else
let final_list +=
\ [{'word':substitute(i, '.*::', '', ''),
\ 'info':i.all_values[i].')',
\ 'kind':'f'}]
endif
endfor
return final_list
endif
return final_list
endif endif
if a:base =~ '^\$' if a:base =~ '^\$'
" Complete variables let adddollar = '$'
" Built-in variables {{{
let g:php_builtin_vars = {'$GLOBALS':'',
\ '$_SERVER':'',
\ '$_GET':'',
\ '$_POST':'',
\ '$_COOKIE':'',
\ '$_FILES':'',
\ '$_ENV':'',
\ '$_REQUEST':'',
\ '$_SESSION':'',
\ '$HTTP_SERVER_VARS':'',
\ '$HTTP_ENV_VARS':'',
\ '$HTTP_COOKIE_VARS':'',
\ '$HTTP_GET_VARS':'',
\ '$HTTP_POST_VARS':'',
\ '$HTTP_POST_FILES':'',
\ '$HTTP_SESSION_VARS':'',
\ '$php_errormsg':'',
\ '$this':''
\ }
" }}}
" Internal solution for current file.
let file = getline(1, '$')
let jfile = join(file, ' ')
let int_vals = split(jfile, '\ze\$')
let int_vars = {}
for i in int_vals
if i =~ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*=\s*new'
let val = matchstr(i,
\ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*').'->'
else
let val = matchstr(i,
\ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
endif
if val != ''
let int_vars[val] = ''
endif
endfor
call extend(int_vars,g:php_builtin_vars)
" ctags has good support for PHP, use tags file for external
" variables
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let ext_vars = {}
if fnames != ''
let sbase = substitute(a:base, '^\$', '', '')
exe 'silent! vimgrep /^'.sbase.'.*\tv\(\t\|$\)/j '.fnames
let qflist = getqflist()
for field in qflist
let item = '$'.matchstr(field['text'], '^[^[:space:]]\+')
let m_menu = ''
" Add -> if it is possible object declaration
" How to detect if previous line is help line?
if field['text'] =~ item.'\s*=\s*new\s\+'
let item = item.'->'
let m_menu = matchstr(field['text'],
\ '=\s*new\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze')
endif
let ext_vars[item] = m_menu
endfor
endif
call extend(int_vars, ext_vars)
let g:a0 = keys(int_vars)
for m in sort(keys(int_vars))
if m =~ '^\'.a:base
call add(res, m)
endif
endfor
let int_list = res
let int_dict = []
for i in int_list
if int_vars[i] != ''
let class = ' '
if int_vars[i] != ''
let class = i.' class '
endif
let int_dict += [{'word':i, 'info':class.int_vars[i], 'kind':'v'}]
else
let int_dict += [{'word':i, 'kind':'v'}]
endif
endfor
return int_dict
else else
" Complete everything else - let adddollar = ''
" + functions, DONE endif
" + keywords of language DONE let file = getline(1, '$')
" + defines (constant definitions), DONE let jfile = join(file, ' ')
" + extend keywords for predefined constants, DONE let sfile = split(jfile, '\$')
" + classes (after new), DONE let int_vars = {}
" + limit choice after -> and :: to funcs and vars DONE for i in sfile
if i =~ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*=\s*new'
" Internal solution for finding functions in current file. let val = matchstr(i, '^[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*').'->'
let file = getline(1, '$') else
call filter(file, 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("') let val = matchstr(i, '^[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let jfile = join(file, ' ')
let int_values = split(jfile, 'function\s\+')
let int_functions = {}
for i in int_values
let f_name = matchstr(i,
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let f_args = matchstr(i,
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\s*\zs.\{-}\ze\s*)\_s*{')
let int_functions[f_name.'('] = f_args.')'
endfor
" Prepare list of functions from tags file
let ext_functions = {}
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\tf\(\t\|$\)/j '.fnames
let qflist = getqflist()
for field in qflist
" File name
let item = matchstr(field['text'], '^[^[:space:]]\+')
let fname = matchstr(field['text'], '\t\zs\f\+\ze')
let prototype = matchstr(field['text'],
\ 'function\s\+&\?[^[:space:]]\+\s*(\s*\zs.\{-}\ze\s*)\s*{\?')
let ext_functions[item.'('] = prototype.') - '.fname
endfor
endif endif
if val !~ ''
" All functions let int_vars[adddollar.val] = ''
call extend(int_functions, ext_functions)
call extend(int_functions, g:php_builtin_functions)
" Internal solution for finding constants in current file
let file = getline(1, '$')
call filter(file, 'v:val =~ "define\\s*("')
let jfile = join(file, ' ')
let int_values = split(jfile, 'define\s*(\s*')
let int_constants = {}
for i in int_values
let c_name = matchstr(i, '\(["'']\)\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze\1')
" let c_value = matchstr(i,
" \ '\(["'']\)[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\1\s*,\s*\zs.\{-}\ze\s*)')
if c_name != ''
let int_constants[c_name] = '' " c_value
endif
endfor
" Prepare list of constants from tags file
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let ext_constants = {}
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\td\(\t\|$\)/j '.fnames
let qflist = getqflist()
for field in qflist
let item = matchstr(field['text'], '^[^[:space:]]\+')
let ext_constants[item] = ''
endfor
endif endif
endfor
" All constants
call extend(int_constants, ext_constants) " ctags has good support for PHP, use tags file for external
" Treat keywords as constants " variables
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let all_values = {} let ext_vars = {}
if fnames != ''
" One big dictionary of functions let sbase = substitute(a:base, '^\$', '', '')
call extend(all_values, int_functions) exe 'silent! vimgrep /^'.sbase.'.*\tv\(\t\|$\)/j '.fnames
let qflist = getqflist()
" Add constants for field in qflist
call extend(all_values, int_constants) let item = matchstr(field['text'], '^[^[:space:]]\+')
" Add keywords " Add -> if it is possible object declaration
call extend(all_values, b:php_keywords) let classname = ''
if field['text'] =~ item.'\s*=\s*new\s\+'
for m in sort(keys(all_values)) let item = item.'->'
if m =~ '^'.a:base let classname = matchstr(field['text'],
call add(res, m) \ '=\s*new\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze')
endif endif
let ext_vars[adddollar.item] = classname
endfor endfor
let int_list = res
let final_list = []
for i in int_list
if has_key(int_functions, i)
let final_list +=
\ [{'word':i,
\ 'info':i.int_functions[i],
\ 'kind':'f'}]
elseif has_key(int_constants, i)
let final_list += [{'word':i, 'kind':'d'}]
else
let final_list += [{'word':i}]
endif
endfor
return final_list
endif endif
" Now we have all variables in int_vars dictionary
call extend(int_vars, ext_vars)
" Internal solution for finding functions in current file.
let file = getline(1, '$')
call filter(file,
\ 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let jfile = join(file, ' ')
let int_values = split(jfile, 'function\s\+')
let int_functions = {}
for i in int_values
let f_name = matchstr(i,
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let f_args = matchstr(i,
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\zs.\{-}\ze)\_s*{')
let int_functions[f_name.'('] = f_args.')'
endfor
" Prepare list of functions from tags file
let ext_functions = {}
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\tf\(\t\|$\)/j '.fnames
let qflist = getqflist()
for field in qflist
" File name
let item = matchstr(field['text'], '^[^[:space:]]\+')
let fname = matchstr(field['text'], '\t\zs\f\+\ze')
let prototype = matchstr(field['text'],
\ 'function\s\+&\?[^[:space:]]\+\s*(\s*\zs.\{-}\ze\s*)\s*{\?')
let ext_functions[item.'('] = prototype.') - '.fname
endfor
endif
let all_values = {}
call extend(all_values, int_functions)
call extend(all_values, ext_functions)
call extend(all_values, int_vars) " external variables are already in
call extend(all_values, g:php_builtin_object_functions)
for m in sort(keys(all_values))
if m =~ '\(^\|::\)'.a:base
call add(res, m)
endif
endfor
let start_list = res
let final_list = []
for i in start_list
if has_key(int_vars, i)
let class = ' '
if all_values[i] != ''
let class = i.' class '
endif
let final_list += [{'word':i, 'info':class.all_values[i], 'kind':'v'}]
else
let final_list +=
\ [{'word':substitute(i, '.*::', '', ''),
\ 'info':i.all_values[i],
\ 'kind':'f'}]
endif
endfor
return final_list
endif endif
if a:base =~ '^\$'
" Complete variables
" Built-in variables {{{
let g:php_builtin_vars = {'$GLOBALS':'',
\ '$_SERVER':'',
\ '$_GET':'',
\ '$_POST':'',
\ '$_COOKIE':'',
\ '$_FILES':'',
\ '$_ENV':'',
\ '$_REQUEST':'',
\ '$_SESSION':'',
\ '$HTTP_SERVER_VARS':'',
\ '$HTTP_ENV_VARS':'',
\ '$HTTP_COOKIE_VARS':'',
\ '$HTTP_GET_VARS':'',
\ '$HTTP_POST_VARS':'',
\ '$HTTP_POST_FILES':'',
\ '$HTTP_SESSION_VARS':'',
\ '$php_errormsg':'',
\ '$this':''
\ }
" }}}
" Internal solution for current file.
let file = getline(1, '$')
let jfile = join(file, ' ')
let int_vals = split(jfile, '\ze\$')
let int_vars = {}
for i in int_vals
if i =~ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*=\s*new'
let val = matchstr(i,
\ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*').'->'
else
let val = matchstr(i,
\ '^\$[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*')
endif
if val != ''
let int_vars[val] = ''
endif
endfor
call extend(int_vars,g:php_builtin_vars)
" ctags has support for PHP, use tags file for external variables
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let ext_vars = {}
if fnames != ''
let sbase = substitute(a:base, '^\$', '', '')
exe 'silent! vimgrep /^'.sbase.'.*\tv\(\t\|$\)/j '.fnames
let qflist = getqflist()
for field in qflist
let item = '$'.matchstr(field['text'], '^[^[:space:]]\+')
let m_menu = ''
" Add -> if it is possible object declaration
if field['text'] =~ item.'\s*=\s*new\s\+'
let item = item.'->'
let m_menu = matchstr(field['text'],
\ '=\s*new\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze')
endif
let ext_vars[item] = m_menu
endfor
endif
call extend(int_vars, ext_vars)
let g:a0 = keys(int_vars)
for m in sort(keys(int_vars))
if m =~ '^\'.a:base
call add(res, m)
endif
endfor
let int_list = res
let int_dict = []
for i in int_list
if int_vars[i] != ''
let class = ' '
if int_vars[i] != ''
let class = i.' class '
endif
let int_dict += [{'word':i, 'info':class.int_vars[i], 'kind':'v'}]
else
let int_dict += [{'word':i, 'kind':'v'}]
endif
endfor
return int_dict
else
" Complete everything else -
" + functions, DONE
" + keywords of language DONE
" + defines (constant definitions), DONE
" + extend keywords for predefined constants, DONE
" + classes (after new), DONE
" + limit choice after -> and :: to funcs and vars DONE
" Internal solution for finding functions in current file.
let file = getline(1, '$')
call filter(file,
\ 'v:val =~ "function\\s\\+&\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*("')
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let jfile = join(file, ' ')
let int_values = split(jfile, 'function\s\+')
let int_functions = {}
for i in int_values
let f_name = matchstr(i,
\ '^&\?\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
let f_args = matchstr(i,
\ '^&\?[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\s*(\s*\zs.\{-}\ze\s*)\_s*{')
let int_functions[f_name.'('] = f_args.')'
endfor
" Prepare list of functions from tags file
let ext_functions = {}
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\tf\(\t\|$\)/j '.fnames
let qflist = getqflist()
for field in qflist
" File name
let item = matchstr(field['text'], '^[^[:space:]]\+')
let fname = matchstr(field['text'], '\t\zs\f\+\ze')
let prototype = matchstr(field['text'],
\ 'function\s\+&\?[^[:space:]]\+\s*(\s*\zs.\{-}\ze\s*)\s*{\?')
let ext_functions[item.'('] = prototype.') - '.fname
endfor
endif
" All functions
call extend(int_functions, ext_functions)
call extend(int_functions, g:php_builtin_functions)
" Internal solution for finding constants in current file
let file = getline(1, '$')
call filter(file, 'v:val =~ "define\\s*("')
let jfile = join(file, ' ')
let int_values = split(jfile, 'define\s*(\s*')
let int_constants = {}
for i in int_values
let c_name = matchstr(i, '\(["'']\)\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze\1')
" let c_value = matchstr(i,
" \ '\(["'']\)[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\1\s*,\s*\zs.\{-}\ze\s*)')
if c_name != ''
let int_constants[c_name] = '' " c_value
endif
endfor
" Prepare list of constants from tags file
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
let ext_constants = {}
if fnames != ''
exe 'silent! vimgrep /^'.a:base.'.*\td\(\t\|$\)/j '.fnames
let qflist = getqflist()
for field in qflist
let item = matchstr(field['text'], '^[^[:space:]]\+')
let ext_constants[item] = ''
endfor
endif
" All constants
call extend(int_constants, ext_constants)
" Treat keywords as constants
let all_values = {}
" One big dictionary of functions
call extend(all_values, int_functions)
" Add constants
call extend(all_values, int_constants)
" Add keywords
call extend(all_values, g:php_keywords)
for m in sort(keys(all_values))
if m =~ '^'.a:base
call add(res, m)
endif
endfor
let int_list = res
let final_list = []
for i in int_list
if has_key(int_functions, i)
let final_list +=
\ [{'word':i,
\ 'info':i.int_functions[i],
\ 'kind':'f'}]
elseif has_key(int_constants, i)
let final_list += [{'word':i, 'kind':'d'}]
else
let final_list += [{'word':i}]
endif
endfor
return final_list
endif
endfunction endfunction
function! phpcomplete#GetClassName(scontext) " {{{
" Get class name
" Class name can be detected in few ways:
" @var $myVar class
" line above
" or line in tags file
let object = matchstr(a:scontext, '\zs[a-zA-Z_0-9\x7f-\xff]\+\ze->')
let i = 1
while i < line('.')
let line = getline(line('.')-i)
if line =~ '^\s*\*\/\?\s*$'
let i += 1
continue
else
if line =~ '@var\s\+\$'.object.'\s\+[a-zA-Z_0-9\x7f-\xff]\+'
let classname = matchstr(line, '@var\s\+\$'.object.'\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+')
return classname
else
break
endif
endif
endwhile
" OK, first way failed, now check tags file(s)
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
exe 'silent! vimgrep /^'.object.'.*\$'.object.'.*=\s*new\s\+.*\tv\(\t\|$\)/j '.fnames
let qflist = getqflist()
if len(qflist) == 0
return []
endif
" In all properly managed projects it should be one item list, even if it
" *is* longer we cannot solve conflicts, assume it is first element
let classname = matchstr(qflist[0]['text'], '=\s*new\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze')
return classname
endfunction
" }}}
function! phpcomplete#GetClassLocation(classname) " {{{
" Get class location
for fname in tagfiles()
let fhead = fnamemodify(fname, ":h")
if fhead != ''
let psep = '/'
let fhead .= psep
endif
let fname = escape(fname, " \\")
exe 'silent! vimgrep /^'.a:classname.'.*\tc\(\t\|$\)/j '.fname
let qflist = getqflist()
" As in GetClassName we can manage only one element
let classlocation = matchstr(qflist[0]['text'], '\t\zs\f\+\ze\t')
" And only one class location
if classlocation != ''
let pset = '/' " Note: slash is potential problem!
let classlocation = fhead.classlocation
return classlocation
endif
endfor
endfunction
" }}}
function! phpcomplete#GetClassContents(file, name) " {{{
let cfile = join(a:file, "\n")
" We use new buffer and (later) normal! because
" this is the most efficient way. The other way
" is to go through the looong string looking for
" matching {}
below 1new
0put =cfile
call search('class\s\+'.a:name)
let cfline = line('.')
" Catch extends
if getline('.') =~ 'extends'
let extends_class = matchstr(getline('.'),
\ 'class\s\+'.a:name.'\s\+extends\s\+\zs[a-zA-Z_0-9\x7f-\xff]\+\ze')
else
let extends_class = ''
endif
normal! %
let classc = getline(cfline, ".")
let classcontent = join(classc, "\n")
bw! %
if extends_class != ''
let classlocation = phpcomplete#GetClassLocation(extends_class)
if filereadable(classlocation)
let classfile = readfile(classlocation)
let classcontent .= "\n".phpcomplete#GetClassContents(classfile, extends_class)
endif
endif
return classcontent
endfunction
" }}}
function! phpcomplete#LoadData() " {{{ function! phpcomplete#LoadData() " {{{
" Keywords/reserved words, all other special things {{{ " Keywords/reserved words, all other special things {{{
" Later it is possible to add some help to values, or type of " Later it is possible to add some help to values, or type of
" defined variable " defined variable
let b:php_keywords = { let g:php_keywords = {
\ 'PHP_SELF':'', \ 'PHP_SELF':'',
\ 'argv':'', \ 'argv':'',
\ 'argc':'', \ 'argc':'',

View File

@ -1,8 +1,8 @@
" Vim completion script " Vim completion script
" Language: SQL " Language: SQL
" Maintainer: David Fishburn <fishburn@ianywhere.com> " Maintainer: David Fishburn <fishburn@ianywhere.com>
" Version: 1.0 " Version: 2.0
" Last Change: Tue Mar 28 2006 4:39:49 PM " Last Change: Mon Apr 03 2006 10:21:36 PM
" Set completion with CTRL-X CTRL-O to autoloaded function. " Set completion with CTRL-X CTRL-O to autoloaded function.
" This check is in place in case this script is " This check is in place in case this script is
@ -21,20 +21,20 @@ endif
let g:loaded_sql_completion = 1 let g:loaded_sql_completion = 1
" Maintains filename of dictionary " Maintains filename of dictionary
let s:sql_file_table = "" let s:sql_file_table = ""
let s:sql_file_procedure = "" let s:sql_file_procedure = ""
let s:sql_file_view = "" let s:sql_file_view = ""
" Define various arrays to be used for caching " Define various arrays to be used for caching
let s:tbl_name = [] let s:tbl_name = []
let s:tbl_alias = [] let s:tbl_alias = []
let s:tbl_cols = [] let s:tbl_cols = []
let s:syn_list = [] let s:syn_list = []
let s:syn_value = [] let s:syn_value = []
" Used in conjunction with the syntaxcomplete plugin " Used in conjunction with the syntaxcomplete plugin
let s:save_inc = "" let s:save_inc = ""
let s:save_exc = "" let s:save_exc = ""
if exists('g:omni_syntax_group_include_sql') if exists('g:omni_syntax_group_include_sql')
let s:save_inc = g:omni_syntax_group_include_sql let s:save_inc = g:omni_syntax_group_include_sql
endif endif
@ -43,12 +43,23 @@ if exists('g:omni_syntax_group_exclude_sql')
endif endif
" Used with the column list " Used with the column list
let s:save_prev_table = "" let s:save_prev_table = ""
" Default the option to verify table alias " Default the option to verify table alias
if !exists('g:omni_sql_use_tbl_alias') if !exists('g:omni_sql_use_tbl_alias')
let g:omni_sql_use_tbl_alias = 'a' let g:omni_sql_use_tbl_alias = 'a'
endif endif
" Default syntax items to precache
if !exists('g:omni_sql_precache_syntax_groups')
let g:omni_sql_precache_syntax_groups = [
\ 'syntax',
\ 'sqlKeyword',
\ 'sqlFunction',
\ 'sqlOption',
\ 'sqlType',
\ 'sqlStatement'
\ ]
endif
" This function is used for the 'omnifunc' option. " This function is used for the 'omnifunc' option.
function! sqlcomplete#Complete(findstart, base) function! sqlcomplete#Complete(findstart, base)
@ -60,6 +71,8 @@ function! sqlcomplete#Complete(findstart, base)
let compl_type = b:sql_compl_type let compl_type = b:sql_compl_type
endif endif
" First pass through this function determines how much of the line should
" be replaced by whatever is chosen from the completion list
if a:findstart if a:findstart
" Locate the start of the item, including "." " Locate the start of the item, including "."
let line = getline('.') let line = getline('.')
@ -68,15 +81,16 @@ function! sqlcomplete#Complete(findstart, base)
while start > 0 while start > 0
if line[start - 1] =~ '\w' if line[start - 1] =~ '\w'
let start -= 1 let start -= 1
elseif line[start - 1] =~ '\.' && compl_type =~ 'column\|table' elseif line[start - 1] =~ '\.' && compl_type =~ 'column'
" If the completion type is table or column " If the completion type is column then assume we are looking
" Then assume we are looking for column completion " for column completion column_type can be either
" column_type can be either 'column' or 'column_csv' " 'column' or 'column_csv'
if lastword == -1 if lastword == -1 && compl_type == 'column'
" Do not replace the table name prefix or alias
" if completing only a single column name
let lastword = start let lastword = start
endif endif
let start -= 1 let start -= 1
let b:sql_compl_type = 'column'
else else
break break
endif endif
@ -92,8 +106,12 @@ function! sqlcomplete#Complete(findstart, base)
return lastword return lastword
endif endif
" Second pass through this function will determine what data to put inside
" of the completion list
" s:prepended is set by the first pass
let base = s:prepended . a:base let base = s:prepended . a:base
" Default the completion list to an empty list
let compl_list = [] let compl_list = []
" Default to table name completion " Default to table name completion
@ -178,36 +196,8 @@ function! sqlcomplete#Complete(findstart, base)
let s:tbl_cols = [] let s:tbl_cols = []
let s:syn_list = [] let s:syn_list = []
let s:syn_value = [] let s:syn_value = []
return []
else else
" Default to empty or not found let compl_list = s:SQLCGetSyntaxList(compl_type)
let compl_list = []
" Check if we have already cached the syntax list
let list_idx = index(s:syn_list, compl_type, 0, &ignorecase)
if list_idx > -1
" Return previously cached value
let compl_list = s:syn_value[list_idx]
else
" Request the syntax list items from the
" syntax completion plugin
if compl_type == 'syntax'
" Handle this special case. This allows the user
" to indicate they want all the syntax items available,
" so do not specify a specific include list.
let g:omni_syntax_group_include_sql = ''
else
" The user has specified a specific syntax group
let g:omni_syntax_group_include_sql = compl_type
endif
let g:omni_syntax_group_exclude_sql = ''
let syn_value = OmniSyntaxList()
let g:omni_syntax_group_include_sql = s:save_inc
let g:omni_syntax_group_exclude_sql = s:save_exc
" Cache these values for later use
let s:syn_list = add( s:syn_list, compl_type )
let s:syn_value = add( s:syn_value, syn_value )
let compl_list = syn_value
endif
endif endif
if base != '' if base != ''
@ -217,6 +207,10 @@ function! sqlcomplete#Complete(findstart, base)
let compl_list = filter(copy(compl_list), expr) let compl_list = filter(copy(compl_list), expr)
endif endif
if exists('b:sql_compl_savefunc') && b:sql_compl_savefunc != ""
let &omnifunc = b:sql_compl_savefunc
endif
return compl_list return compl_list
endfunc endfunc
@ -232,6 +226,70 @@ function! s:SQLCErrorMsg(msg)
echohl None echohl None
endfunction endfunction
function! sqlcomplete#PreCacheSyntax(...)
let syn_group_arr = []
if a:0 > 0
let syn_group_arr = a:1
else
let syn_group_arr = g:omni_sql_precache_syntax_groups
endif
if !empty(syn_group_arr)
for group_name in syn_group_arr
call s:SQLCGetSyntaxList(group_name)
endfor
endif
endfunction
function! sqlcomplete#Map(type)
" Tell the SQL plugin what you want to complete
let b:sql_compl_type=a:type
" Record previous omnifunc, if the SQL completion
" is being used in conjunction with other filetype
" completion plugins
if &omnifunc != "" && &omnifunc != 'sqlcomplete#Complete'
" Record the previous omnifunc, the plugin
" will automatically set this back so that it
" does not interfere with other ftplugins settings
let b:sql_compl_savefunc=&omnifunc
endif
" Set the OMNI func for the SQL completion plugin
let &omnifunc='sqlcomplete#Complete'
endfunction
function! s:SQLCGetSyntaxList(syn_group)
let syn_group = a:syn_group
let compl_list = []
" Check if we have already cached the syntax list
let list_idx = index(s:syn_list, syn_group, 0, &ignorecase)
if list_idx > -1
" Return previously cached value
let compl_list = s:syn_value[list_idx]
else
" Request the syntax list items from the
" syntax completion plugin
if syn_group == 'syntax'
" Handle this special case. This allows the user
" to indicate they want all the syntax items available,
" so do not specify a specific include list.
let g:omni_syntax_group_include_sql = ''
else
" The user has specified a specific syntax group
let g:omni_syntax_group_include_sql = syn_group
endif
let g:omni_syntax_group_exclude_sql = ''
let syn_value = OmniSyntaxList()
let g:omni_syntax_group_include_sql = s:save_inc
let g:omni_syntax_group_exclude_sql = s:save_exc
" Cache these values for later use
let s:syn_list = add( s:syn_list, syn_group )
let s:syn_value = add( s:syn_value, syn_value )
let compl_list = syn_value
endif
return compl_list
endfunction
function! s:SQLCCheck4dbext() function! s:SQLCCheck4dbext()
if !exists('g:loaded_dbext') if !exists('g:loaded_dbext')
let msg = "The dbext plugin must be loaded for dynamic SQL completion" let msg = "The dbext plugin must be loaded for dynamic SQL completion"

View File

@ -1,6 +1,6 @@
" tar.vim: Handles browsing tarfiles " tar.vim: Handles browsing tarfiles
" AUTOLOAD PORTION " AUTOLOAD PORTION
" Date: Dec 24, 2005 " Date: Mar 27, 2006
" Version: 7 " Version: 7
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> " Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" License: Vim License (see vim's :help license) " License: Vim License (see vim's :help license)
@ -25,6 +25,7 @@ if exists("g:loaded_tar")
finish finish
endif endif
let g:loaded_tar= "v7" let g:loaded_tar= "v7"
"call Decho("loading autoload/tar.vim")
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Default Settings: {{{1 " Default Settings: {{{1
@ -34,6 +35,9 @@ endif
if !exists("g:tar_readoptions") if !exists("g:tar_readoptions")
let g:tar_readoptions= "OPxf" let g:tar_readoptions= "OPxf"
endif endif
if !exists("g:tar_cmd")
let g:tar_cmd= "tar"
endif
if !exists("g:tar_writeoptions") if !exists("g:tar_writeoptions")
let g:tar_writeoptions= "uf" let g:tar_writeoptions= "uf"
endif endif
@ -50,14 +54,15 @@ fun! tar#Browse(tarfile)
set report=10 set report=10
" sanity checks " sanity checks
if !executable("tar") if !executable(g:tar_cmd)
echohl Error | echo '***error*** (tar#Browse) "tar" not available on your system' echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
call inputsave()|call input("Press <cr> to continue")|call inputrestore() call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep let &report= repkeep
" call Dret("tar#Browse") " call Dret("tar#Browse")
return return
endif endif
if !filereadable(a:tarfile) if !filereadable(a:tarfile)
" call Decho('a:tarfile<'.a:tarfile.'> not filereadable')
if a:tarfile !~# '^\a\+://' if a:tarfile !~# '^\a\+://'
" if its an url, don't complain, let url-handlers such as vim do its thing " if its an url, don't complain, let url-handlers such as vim do its thing
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
@ -80,20 +85,33 @@ fun! tar#Browse(tarfile)
set ft=tar set ft=tar
" give header " give header
" call Decho("printing header")
exe "$put ='".'\"'." tar.vim version ".g:loaded_tar."'" exe "$put ='".'\"'." tar.vim version ".g:loaded_tar."'"
exe "$put ='".'\"'." Browsing tarfile ".a:tarfile."'" exe "$put ='".'\"'." Browsing tarfile ".a:tarfile."'"
exe "$put ='".'\"'." Select a file with cursor and press ENTER"."'" exe "$put ='".'\"'." Select a file with cursor and press ENTER"."'"
0d 0d
$ $
if a:tarfile =~# '\.\(gz\|tgz\)$' let tarfile= a:tarfile
exe "silent r! gzip -d -c '".a:tarfile."'| tar -".g:tar_browseoptions." - " if has("win32") && executable("cygpath")
elseif a:tarfile =~# '\.bz2$' " assuming cygwin
exe "silent r! bzip2 -d -c '".a:tarfile."'| tar -".g:tar_browseoptions." - " let tarfile=substitute(system("cygpath -u ".tarfile),'\n$','','e')
else endif
exe "silent r! tar -".g:tar_browseoptions." '".a:tarfile."'" if tarfile =~# '\.\(gz\|tgz\)$'
" call Decho("exe silent r! gzip -d -c '".tarfile."'| tar -".g:tar_browseoptions." - ")
exe "silent r! gzip -d -c '".tarfile."'| tar -".g:tar_browseoptions." - "
elseif tarfile =~# '\.bz2$'
" call Decho("exe silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_browseoptions." - ")
exe "silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_browseoptions." - "
else
" call Decho("exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." '".tarfile."'")
exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." '".tarfile."'"
endif
if v:shell_error != 0
echohl Error | echo '***error*** (tar#Browse) while browsing; check your g:tar_browseoptions<".g:tar_browseoptions.">"
" call Dret("tar#Browse : w:tarfile<".w:tarfile.">")
return
endif endif
silent %g@/$@d
setlocal noma nomod ro setlocal noma nomod ro
noremap <silent> <buffer> <cr> :call <SID>TarBrowseSelect()<cr> noremap <silent> <buffer> <cr> :call <SID>TarBrowseSelect()<cr>
@ -121,12 +139,21 @@ fun! s:TarBrowseSelect()
" about to make a new window, need to use w:tarfile " about to make a new window, need to use w:tarfile
let tarfile= w:tarfile let tarfile= w:tarfile
let curfile= expand("%") let curfile= expand("%")
if has("win32") && executable("cygpath")
" assuming cygwin
let tarfile=substitute(system("cygpath -u ".tarfile),'\n$','','e')
endif
new new
wincmd _ wincmd _
let s:tblfile_{winnr()}= curfile let s:tblfile_{winnr()}= curfile
" call Decho("exe e tarfile:".tarfile.':'.fname) " if has("unix")
exe "e tarfile:".tarfile.':'.fname "" call Decho("exe e tarfile:".tarfile.':'.fname)
" exe "e tarfile:".tarfile.':'.fname
" elseif has("win32")
" call tar#Read("tarfile:".tarfile.':'.fname,1)
" endif
call tar#Read("tarfile:".tarfile.':'.fname,1)
filetype detect filetype detect
let &report= repkeep let &report= repkeep
@ -141,7 +168,12 @@ fun! tar#Read(fname,mode)
set report=10 set report=10
let tarfile = substitute(a:fname,'tarfile:\(.\{-}\):.*$','\1','') let tarfile = substitute(a:fname,'tarfile:\(.\{-}\):.*$','\1','')
let fname = substitute(a:fname,'tarfile:.\{-}:\(.*\)$','\1','') let fname = substitute(a:fname,'tarfile:.\{-}:\(.*\)$','\1','')
" call Decho("tarfile<".tarfile."> fname<".fname.">") if has("win32") && executable("cygpath")
" assuming cygwin
let tarfile=substitute(system("cygpath -u ".tarfile),'\n$','','e')
endif
" call Decho("tarfile<".tarfile.">")
" call Decho("fname<".fname.">")
if tarfile =~# '\.\(gz\|tgz\)$' if tarfile =~# '\.\(gz\|tgz\)$'
" call Decho("exe silent r! gzip -d -c '".tarfile."'| tar -OPxf - '".fname."'") " call Decho("exe silent r! gzip -d -c '".tarfile."'| tar -OPxf - '".fname."'")
@ -151,7 +183,7 @@ fun! tar#Read(fname,mode)
exe "silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_readoptions." - '".fname."'" exe "silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_readoptions." - '".fname."'"
else else
" call Decho("exe silent r! tar -".g:tar_readoptions." '".tarfile."' '".fname."'") " call Decho("exe silent r! tar -".g:tar_readoptions." '".tarfile."' '".fname."'")
exe "silent r! tar -".g:tar_readoptions." '".tarfile."' '".fname."'" exe "silent r! ".g:tar_cmd." -".g:tar_readoptions." '".tarfile."' '".fname."'"
endif endif
let w:tarfile= a:fname let w:tarfile= a:fname
exe "file tarfile:".fname exe "file tarfile:".fname
@ -172,8 +204,8 @@ fun! tar#Write(fname)
set report=10 set report=10
" sanity checks " sanity checks
if !executable("tar") if !executable(g:tar_cmd)
echohl Error | echo '***error*** (tar#Browse) "tar" not available on your system' echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
call inputsave()|call input("Press <cr> to continue")|call inputrestore() call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep let &report= repkeep
" call Dret("tar#Write") " call Dret("tar#Write")

View File

@ -1,7 +1,7 @@
" vimball : construct a file containing both paths and files " vimball : construct a file containing both paths and files
" Author: Charles E. Campbell, Jr. " Author: Charles E. Campbell, Jr.
" Date: Mar 22, 2006 " Date: Mar 31, 2006
" Version: 5 " Version: 6
" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim " GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
" Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. " Copyright: (c) 2004-2006 by Charles E. Campbell, Jr.
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt " The VIM LICENSE applies to Vimball.vim, and Vimball.txt
@ -15,7 +15,7 @@ if &cp || exists("g:loaded_vimball")
finish finish
endif endif
let s:keepcpo = &cpo let s:keepcpo = &cpo
let g:loaded_vimball = "v5" let g:loaded_vimball = "v6"
set cpo&vim set cpo&vim
" ===================================================================== " =====================================================================
@ -190,7 +190,7 @@ fun! vimball#Vimball(really)
" call Decho("yanked ".fsize." lines into register-a") " call Decho("yanked ".fsize." lines into register-a")
" call Decho("didhelp<".didhelp."> fname<".fname.">") " call Decho("didhelp<".didhelp."> fname<".fname.">")
if didhelp == "" && fname =~ 'doc/[^/]\+\.txt$' if a:really && didhelp == "" && fname =~ 'doc/[^/]\+\.txt$'
let didhelp= substitute(fname,'^\(.*\<doc\)[/\\][^.]*\.txt$','\1','e') let didhelp= substitute(fname,'^\(.*\<doc\)[/\\][^.]*\.txt$','\1','e')
" call Decho("didhelp<".didhelp.">") " call Decho("didhelp<".didhelp.">")
endif endif

View File

@ -1,13 +1,13 @@
" Vim completion script " Vim completion script
" Language: XML " Language: XML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Mar 19 " Last Change: 2006 Mar 31
" This function will create Dictionary with users namespace strings and values " This function will create Dictionary with users namespace strings and values
" canonical (system) names of data files. Names should be lowercase, " canonical (system) names of data files. Names should be lowercase,
" descriptive to avoid any future conflicts. For example 'xhtml10s' should be " descriptive to avoid any future conflicts. For example 'xhtml10s' should be
" name for data of XHTML 1.0 Strict and 'xhtml10t' for XHTML 1.0 Transitional " name for data of XHTML 1.0 Strict and 'xhtml10t' for XHTML 1.0 Transitional
" User interface will be provided by XMLns command defined ... " User interface will be provided by XMLns command defined in ftplugin/xml.vim
" Currently supported canonicals are: " Currently supported canonicals are:
" xhtml10s - XHTML 1.0 Strict " xhtml10s - XHTML 1.0 Strict
" xsl - XSL " xsl - XSL
@ -224,8 +224,13 @@ function! xmlcomplete#CompleteTags(findstart, base)
let attrs = ['encoding', 'version="1.0"', 'version'] let attrs = ['encoding', 'version="1.0"', 'version']
elseif tag =~ '^!' elseif tag =~ '^!'
" Don't make completion at all " Don't make completion at all
"
return [] return []
else else
if !has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, tag)
" Abandon when data file isn't complete
return []
endif
let attrs = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1]) let attrs = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1])
endif endif
@ -324,6 +329,10 @@ function! xmlcomplete#CompleteTags(findstart, base)
let tags = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}) let tags = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]})
call filter(tags, 'v:val !~ "^vimxml"') call filter(tags, 'v:val !~ "^vimxml"')
else else
if !has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, tag)
" Abandon when data file isn't complete
return []
endif
let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0] let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0]
endif endif

View File

@ -75,11 +75,15 @@ fun! zip#Browse(zipfile)
0d 0d
$ $
" call Decho("exe silent r! unzip -l '".escape(a:zipfile,s:zipfile_escape)."'") " call Decho("exe silent r! unzip -l '".a:zipfile."'")
exe "silent r! unzip -l ".escape(a:zipfile,s:zipfile_escape) exe "silent r! unzip -l '".a:zipfile."'"
" call Decho("line 6: ".getline(6))
let namecol= stridx(getline(6),'Name') + 1
" call Decho("namecol=".namecol)
4,$g/^\s*----/d
4,$g/^\s*\a/d
$d $d
silent 4,$v/^\s\+\d\+\s\{0,5}\d/d exe 'silent 4,$s/^.*\%'.namecol.'c//'
silent 4,$s/^\%(.*\)\s\+\(\S\)/\1/
setlocal noma nomod ro setlocal noma nomod ro
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr> noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
@ -114,15 +118,15 @@ fun! s:ZipBrowseSelect()
" get zipfile to the new-window " get zipfile to the new-window
let zipfile= substitute(w:zipfile,'.zip$','','e') let zipfile= substitute(w:zipfile,'.zip$','','e')
let curfile= escape(expand("%"),s:zipfile_escape) let curfile= expand("%")
" call Decho("zipfile<".zipfile.">") " call Decho("zipfile<".zipfile.">")
" call Decho("curfile<".curfile.">") " call Decho("curfile<".curfile.">")
new new
wincmd _ wincmd _
let s:zipfile_{winnr()}= curfile let s:zipfile_{winnr()}= curfile
" call Decho("exe e zipfile:".escape(zipfile,s:zipfile_escape).':'.fname) " call Decho("exe e zipfile:".escape(zipfile,s:zipfile_escape).':'.escape(fname,s:zipfile_escape))
exe "e zipfile:".escape(zipfile,s:zipfile_escape).':'.fname exe "e zipfile:".escape(zipfile,s:zipfile_escape).':'.escape(fname,s:zipfile_escape)
filetype detect filetype detect
let &report= repkeep let &report= repkeep
@ -140,8 +144,8 @@ fun! zip#Read(fname,mode)
let fname = substitute(a:fname,'zipfile:.\{-}:\([^\\].*\)$','\1','') let fname = substitute(a:fname,'zipfile:.\{-}:\([^\\].*\)$','\1','')
" call Decho("zipfile<".zipfile."> fname<".fname.">") " call Decho("zipfile<".zipfile."> fname<".fname.">")
" call Decho("exe r! unzip -p '".escape(zipfile,s:zipfile_escape)."' ".fname) " call Decho("exe r! unzip -p '".zipfile."' '".fname."'")
exe "r! unzip -p ".escape(zipfile,s:zipfile_escape)." ".fname exe "silent r! unzip -p '".zipfile."' '".fname."'"
" cleanup " cleanup
0d 0d
@ -154,7 +158,7 @@ endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" zip#Write: {{{2 " zip#Write: {{{2
fun! zip#Write(fname) fun! zip#Write(fname)
" call Dfunc("zip#Write(fname<".a:fname.") zipfile_".winnr()."<".s:zipfile_{winnr()}.">") " call Dfunc("zip#Write(fname<".a:fname.">) zipfile_".winnr()."<".s:zipfile_{winnr()}.">")
let repkeep= &report let repkeep= &report
set report=10 set report=10
@ -211,6 +215,7 @@ fun! zip#Write(fname)
if executable("cygpath") if executable("cygpath")
let dirpath = substitute(system("cygpath ".dirpath),'\n','','e') let dirpath = substitute(system("cygpath ".dirpath),'\n','','e')
endif endif
" call Decho("mkdir(dirpath<".dirpath.">,p)")
call mkdir(dirpath,"p") call mkdir(dirpath,"p")
endif endif
if zipfile !~ '/' if zipfile !~ '/'
@ -218,13 +223,13 @@ fun! zip#Write(fname)
endif endif
" call Decho("zipfile<".zipfile."> fname<".fname.">") " call Decho("zipfile<".zipfile."> fname<".fname.">")
exe "w! ".fname exe "w! ".escape(fname,s:zipfile_escape)
if executable("cygpath") if executable("cygpath")
let zipfile = substitute(system("cygpath ".zipfile),'\n','','e') let zipfile = substitute(system("cygpath ".zipfile),'\n','','e')
endif endif
" call Decho("zip -u ".zipfile.".zip ".fname) " call Decho("zip -u '".zipfile.".zip' '".fname."'")
call system("zip -u ".zipfile.".zip ".fname) call system("zip -u '".zipfile.".zip' '".fname."'")
if v:shell_error != 0 if v:shell_error != 0
echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore() call inputsave()|call input("Press <cr> to continue")|call inputrestore()

View File

@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.0c. Last change: 2006 Mar 15 *autocmd.txt* For Vim version 7.0c. Last change: 2006 Apr 04
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -510,6 +510,10 @@ FileChangedRO Before making the first change to a read-only
just before the change is applied to the text. just before the change is applied to the text.
WARNING: If the autocommand moves the cursor WARNING: If the autocommand moves the cursor
the effect of the change is undefined. the effect of the change is undefined.
*E788*
It is not allowed to change to another buffer
here. You can reload the buffer but not edit
another one.
*FileChangedShell* *FileChangedShell*
FileChangedShell When Vim notices that the modification time of FileChangedShell When Vim notices that the modification time of
a file has changed since editing started. a file has changed since editing started.

View File

@ -1,4 +1,4 @@
*diff.txt* For Vim version 7.0c. Last change: 2006 Mar 15 *diff.txt* For Vim version 7.0c. Last change: 2006 Apr 04
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -272,6 +272,10 @@ buffer: >
Note that deleted lines are displayed, but not counted as text lines. You Note that deleted lines are displayed, but not counted as text lines. You
can't move the cursor into them. To fill the deleted lines with the lines can't move the cursor into them. To fill the deleted lines with the lines
from another buffer use ":diffget" on the line below them. from another buffer use ":diffget" on the line below them.
*E787*
When the buffer that is about to be modified is read-only and the autocommand
that is triggered by |FileChangedRO| changes buffers the command will fail.
The autocommand must not change buffers.
The [bufspec] argument above can be a buffer number, a pattern for a buffer The [bufspec] argument above can be a buffer number, a pattern for a buffer
name or a part of a buffer name. Examples: name or a part of a buffer name. Examples:

View File

@ -1,4 +1,4 @@
*editing.txt* For Vim version 7.0c. Last change: 2006 Mar 06 *editing.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -422,14 +422,18 @@ name. Line breaks also separate names.
The [++opt] argument can be used to force the value of 'fileformat', The [++opt] argument can be used to force the value of 'fileformat',
'fileencoding' or 'binary' to a value for one command, and to specify the 'fileencoding' or 'binary' to a value for one command, and to specify the
behavior for bad characters. The form is: > behavior for bad characters. The form is: >
++{optname}
Or: >
++{optname}={value} ++{optname}={value}
Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin* Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin* *++edit*
ff or fileformat overrides 'fileformat' ff or fileformat overrides 'fileformat'
enc or encoding overrides 'fileencoding' enc or encoding overrides 'fileencoding'
bin or binary sets 'binary' bin or binary sets 'binary'
nobin or nobinary resets 'binary' nobin or nobinary resets 'binary'
bad specifies behavior for bad characters bad specifies behavior for bad characters
edit for |:read| only: keep option values as if editing
a file
{value} cannot contain white space. It can be any valid value for these {value} cannot contain white space. It can be any valid value for these
options. Examples: > options. Examples: >
@ -897,6 +901,7 @@ used, for example, when the write fails and you want to try again later with
The [!] is needed to overwrite an existing file. The [!] is needed to overwrite an existing file.
When 'filetype' is empty filetype detection is done When 'filetype' is empty filetype detection is done
with the new name, before the file is written. with the new name, before the file is written.
When the write was successful 'readonly' is reset.
{not in Vi} {not in Vi}
*:up* *:update* *:up* *:update*

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.0c. Last change: 2006 Mar 29 *eval.txt* For Vim version 7.0c. Last change: 2006 Apr 04
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -110,8 +110,8 @@ around the arguments, to invoke the function it refers to. Example: >
:let Fn = function("MyFunc") :let Fn = function("MyFunc")
:echo Fn() :echo Fn()
< *E704* *E705* *E707* < *E704* *E705* *E707*
A Funcref variable must start with a capital, "s:", "w:" or "b:". You cannot A Funcref variable must start with a capital, "s:", "w:", "t:" or "b:". You
have both a Funcref variable and a function with the same name. cannot have both a Funcref variable and a function with the same name.
A special case is defining a function and directly assigning its Funcref to a A special case is defining a function and directly assigning its Funcref to a
Dictionary entry. Example: > Dictionary entry. Example: >
@ -504,7 +504,7 @@ the function was invoked from.
It is also possible to add a function without the "dict" attribute as a It is also possible to add a function without the "dict" attribute as a
Funcref to a Dictionary, but the "self" variable is not available then. Funcref to a Dictionary, but the "self" variable is not available then.
*numbered-function* *numbered-function* *anonymous-function*
To avoid the extra name for the function it can be defined and directly To avoid the extra name for the function it can be defined and directly
assigned to a Dictionary in this way: > assigned to a Dictionary in this way: >
:let mydict = {'data': [0, 1, 2, 3]} :let mydict = {'data': [0, 1, 2, 3]}
@ -1030,6 +1030,7 @@ specified by what is prepended:
(nothing) In a function: local to a function; otherwise: global (nothing) In a function: local to a function; otherwise: global
|buffer-variable| b: Local to the current buffer. |buffer-variable| b: Local to the current buffer.
|window-variable| w: Local to the current window. |window-variable| w: Local to the current window.
|tabpage-variable| t: Local to the current tab page.
|global-variable| g: Global. |global-variable| g: Global.
|local-variable| l: Local to a function. |local-variable| l: Local to a function.
|script-variable| s: Local to a |:source|'ed Vim script. |script-variable| s: Local to a |:source|'ed Vim script.
@ -1063,6 +1064,11 @@ b:changedtick The total number of changes to the current buffer. It is
A variable name that is preceded with "w:" is local to the current window. It A variable name that is preceded with "w:" is local to the current window. It
is deleted when the window is closed. is deleted when the window is closed.
*tabpage-variable* *t:var*
A variable name that is preceded with "t:" is local to the current tab page,
It is deleted when the tab page is closed. {not available when compiled
without the +windows feature}
*global-variable* *g:var* *global-variable* *g:var*
Inside functions global variables are accessed with "g:". Omitting this will Inside functions global variables are accessed with "g:". Omitting this will
access a variable local to a function. But "g:" can also be used in any other access a variable local to a function. But "g:" can also be used in any other
@ -1628,6 +1634,7 @@ mapcheck( {name}[, {mode} [, {abbr}]])
String check for mappings matching {name} String check for mappings matching {name}
match( {expr}, {pat}[, {start}[, {count}]]) match( {expr}, {pat}[, {start}[, {count}]])
Number position where {pat} matches in {expr} Number position where {pat} matches in {expr}
matcharg( {nr}) List arguments of |:match|
matchend( {expr}, {pat}[, {start}[, {count}]]) matchend( {expr}, {pat}[, {start}[, {count}]])
Number position where {pat} ends in {expr} Number position where {pat} ends in {expr}
matchlist( {expr}, {pat}[, {start}[, {count}]]) matchlist( {expr}, {pat}[, {start}[, {count}]])
@ -1641,6 +1648,7 @@ mkdir({name} [, {path} [, {prot}]])
mode() String current editing mode mode() String current editing mode
nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
nr2char( {expr}) String single char with ASCII value {expr} nr2char( {expr}) String single char with ASCII value {expr}
pathshorten( {expr}) String shorten directory names in a path
prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum} prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum}
printf( {fmt}, {expr1}...) String format text printf( {fmt}, {expr1}...) String format text
pumvisible() Number whether popup menu is visible pumvisible() Number whether popup menu is visible
@ -2252,6 +2260,9 @@ executable({expr}) *executable()*
extension. extension.
On MS-DOS and MS-Windows it only checks if the file exists and On MS-DOS and MS-Windows it only checks if the file exists and
is not a directory, not if it's really executable. is not a directory, not if it's really executable.
On MS-Windows an executable in the same directory as Vim is
always found. Since this directory is added to $PATH it
should also work to execute it |win32-PATH|.
The result is a Number: The result is a Number:
1 exists 1 exists
0 does not exist 0 does not exist
@ -2720,10 +2731,10 @@ getfontname([{name}]) *getfontname()*
Otherwise the actual font name is returned, or {name} if the Otherwise the actual font name is returned, or {name} if the
GUI does not support obtaining the real name. GUI does not support obtaining the real name.
Only works when the GUI is running, thus not you your vimrc or Only works when the GUI is running, thus not you your vimrc or
Note that the GTK 2 GUI accepts any font name, thus checking
for a valid name does not work.
gvimrc file. Use the |GUIEnter| autocommand to use this gvimrc file. Use the |GUIEnter| autocommand to use this
function just after the GUI has started. function just after the GUI has started.
Note that the GTK 2 GUI accepts any font name, thus checking
for a valid name does not work.
getfperm({fname}) *getfperm()* getfperm({fname}) *getfperm()*
The result is a String, which is the read, write, and execute The result is a String, which is the read, write, and execute
@ -3137,9 +3148,9 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()*
NOTE: Command-line completion is not supported. NOTE: Command-line completion is not supported.
inputlist({textlist}) *inputlist()* inputlist({textlist}) *inputlist()*
{textlist} must be a list of strings. This list is displayed, {textlist} must be a |List| of strings. This |List| is
one string per line. The user will be prompted to enter a displayed, one string per line. The user will be prompted to
number, which is returned. enter a number, which is returned.
The user can also select an item by clicking on it with the The user can also select an item by clicking on it with the
mouse. For the first string 0 is returned. When clicking mouse. For the first string 0 is returned. When clicking
above the first item a negative number is returned. When above the first item a negative number is returned. When
@ -3196,7 +3207,7 @@ isdirectory({directory}) *isdirectory()*
exist, or isn't a directory, the result is FALSE. {directory} exist, or isn't a directory, the result is FALSE. {directory}
is any expression, which is used as a String. is any expression, which is used as a String.
islocked({expr}) *islocked()* islocked({expr}) *islocked()* *E786*
The result is a Number, which is non-zero when {expr} is the The result is a Number, which is non-zero when {expr} is the
name of a locked variable. name of a locked variable.
{expr} must be the name of a variable, |List| item or {expr} must be the name of a variable, |List| item or
@ -3479,6 +3490,18 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()*
the pattern. 'smartcase' is NOT used. The matching is always the pattern. 'smartcase' is NOT used. The matching is always
done like 'magic' is set and 'cpoptions' is empty. done like 'magic' is set and 'cpoptions' is empty.
matcharg({nr}) *matcharg()*
Selects the {nr} match item, as set with a |:match|,
|:2match| or |:3match| command.
Return a |List| with two elements:
The name of the highlight group used
The pattern used.
When {nr} is not 1, 2 or 3 returns an empty |List|.
When there is no match item set returns ['', ''].
This is usef to save and restore a |:match|.
matchend({expr}, {pat}[, {start}[, {count}]]) *matchend()* matchend({expr}, {pat}[, {start}[, {count}]]) *matchend()*
Same as match(), but return the index of first character after Same as match(), but return the index of first character after
the match. Example: > the match. Example: >
@ -3598,6 +3621,15 @@ getpos({expr}) Get the position for {expr}. For possible values of {expr}
call setpos('.', save_cursor) call setpos('.', save_cursor)
< Also see |setpos()|. < Also see |setpos()|.
pathshorten({expr}) *pathshorten()*
Shorten directory names in the path {expr} and return the
result. The tail, the file name, is kept as-is. The other
components in the path are reduced to single letters. Leading
'~' and '.' characters are kept. Example: >
:echo pathshorten('~/.vim/autoload/myfile.vim')
< ~/.v/a/myfile.vim ~
It doesn't matter if the path exists or not.
prevnonblank({lnum}) *prevnonblank()* prevnonblank({lnum}) *prevnonblank()*
Return the line number of the first line at or above {lnum} Return the line number of the first line at or above {lnum}
that is not blank. Example: > that is not blank. Example: >
@ -5036,7 +5068,6 @@ gui Compiled with GUI enabled.
gui_athena Compiled with Athena GUI. gui_athena Compiled with Athena GUI.
gui_gtk Compiled with GTK+ GUI (any version). gui_gtk Compiled with GTK+ GUI (any version).
gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined). gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined).
gui_kde Compiled with KDE GUI |KVim|
gui_mac Compiled with Macintosh GUI. gui_mac Compiled with Macintosh GUI.
gui_motif Compiled with Motif GUI. gui_motif Compiled with Motif GUI.
gui_photon Compiled with Photon GUI. gui_photon Compiled with Photon GUI.
@ -5654,6 +5685,7 @@ This would call the function "my_func_whizz(parameter)".
g: global variables g: global variables
b: local buffer variables b: local buffer variables
w: local window variables w: local window variables
t: local tab page variables
s: script-local variables s: script-local variables
l: local function variables l: local function variables
v: Vim variables. v: Vim variables.
@ -5711,8 +5743,8 @@ This would call the function "my_func_whizz(parameter)".
Note that when two variables refer to the same |List| Note that when two variables refer to the same |List|
and you lock one of them, the |List| will also be and you lock one of them, the |List| will also be
locked when used through the other variable. Example: locked when used through the other variable.
> Example: >
:let l = [0, 1, 2, 3] :let l = [0, 1, 2, 3]
:let cl = l :let cl = l
:lockvar l :lockvar l

View File

@ -1,4 +1,4 @@
*gui.txt* For Vim version 7.0c. Last change: 2006 Mar 20 *gui.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -36,6 +36,10 @@ The X11 version of Vim can run both in GUI and in non-GUI mode. See
|gui-x11-start|. |gui-x11-start|.
*gui-init* *gvimrc* *.gvimrc* *_gvimrc* *gui-init* *gvimrc* *.gvimrc* *_gvimrc*
The gvimrc file is where GUI-specific startup commands should be placed. It
is always sourced after the |vimrc| file. If you have one then the $MYGVIMRC
environment variable has its name.
When the GUI starts up initializations are carried out, in this order: When the GUI starts up initializations are carried out, in this order:
- The 'term' option is set to "builgin_gui" and terminal options are reset to - The 'term' option is set to "builgin_gui" and terminal options are reset to
their default value for the GUI |terminal-options|. their default value for the GUI |terminal-options|.
@ -66,6 +70,8 @@ When the GUI starts up initializations are carried out, in this order:
- For Win32, when $HOME is not set, "$VIM\_gvimrc" is used. - For Win32, when $HOME is not set, "$VIM\_gvimrc" is used.
- When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice - When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice
versa. versa.
The name of the first file found is stored in $MYGVIMRC, unless it was
already set.
- If the 'exrc' option is set (which is NOT the default) the file ./.gvimrc - If the 'exrc' option is set (which is NOT the default) the file ./.gvimrc
is sourced, if it exists and isn't the same file as the system or user is sourced, if it exists and isn't the same file as the system or user
gvimrc file. If this file is not owned by you, some security restrictions gvimrc file. If this file is not owned by you, some security restrictions

View File

@ -1,4 +1,4 @@
*hangulin.txt* For Vim version 7.0c. Last change: 2005 Mar 29 *hangulin.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Chi-Deok Hwang and Sung-Hyun Nam VIM REFERENCE MANUAL by Chi-Deok Hwang and Sung-Hyun Nam
@ -48,7 +48,7 @@ If both are set, VIM_KEYBOARD has higher priority.
Hangul Fonts Hangul Fonts
------------ ------------
You can set text font using $HOME/.Xdefaults or $HOME/.gvimrc. You can set text font using $HOME/.Xdefaults or in your gvimrc file.
But to use Hangul, you should set 'guifontset' in your vimrc. But to use Hangul, you should set 'guifontset' in your vimrc.
$HOME/.Xdefaults: > $HOME/.Xdefaults: >

View File

@ -1,4 +1,4 @@
*help.txt* For Vim version 7.0c. Last change: 2006 Mar 24 *help.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM - main help file VIM - main help file
k k
@ -85,7 +85,7 @@ Making Vim Run ~
|usr_90.txt| Installing Vim |usr_90.txt| Installing Vim
REFERENCE MANUAL: These files explain every detail of Vim. *ref-toc* REFERENCE MANUAL: These files explain every detail of Vim. *reference_toc*
General subjects ~ General subjects ~
|intro.txt| general introduction to Vim; notation used in help files |intro.txt| general introduction to Vim; notation used in help files
@ -195,6 +195,12 @@ Standard plugins ~
|pi_zip.txt| Zip archive explorer |pi_zip.txt| Zip archive explorer
LOCAL ADDITIONS: *local-additions* LOCAL ADDITIONS: *local-additions*
|cecutil.txt| DrChip's Utilities Jun 11, 2004
|example.txt| Example for a locally added help file
|matchit.txt| Extended "%" matching
|test.txt| Testing the hélp cömmånd nôw
|typecorr.txt| Plugin for correcting typing mistakes
|helpp.txt| Dummy line to avoid an error message
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*bars* Bars example *bars* Bars example

View File

@ -1,4 +1,4 @@
*howto.txt* For Vim version 7.0c. Last change: 2001 Sep 03 *howto.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -75,7 +75,7 @@ How to ... *howdoi* *how-do-i* *howto* *how-to*
|auto-setting| set options automatically |auto-setting| set options automatically
|term-dependent-settings| set options depending on terminal name |term-dependent-settings| set options depending on terminal name
|save-settings| save settings |save-settings| save settings
|:quote| comment my exrc/vimrc/gvimrc files |:quote| comment my .vim files
|'helpheight'| change the default help height |'helpheight'| change the default help height
|'highlight'| set various highlighting modes |'highlight'| set various highlighting modes
|'title'| set the window title |'title'| set the window title

View File

@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.0c. Last change: 2006 Mar 29 *insert.txt* For Vim version 7.0c. Last change: 2006 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1004,10 +1004,12 @@ List.
Each list item can either be a string or a Dictionary. When it is a string it Each list item can either be a string or a Dictionary. When it is a string it
is used as the completion. When it is a Dictionary it can contain these is used as the completion. When it is a Dictionary it can contain these
items: items:
word the completion, mandatory word the text that will be inserted, mandatory
abbr abbreviation of "word", to be used in the menu abbr abbreviation of "word"; when not empty it is used in
menu extra text for the popup menu the menu instead of "word"
info more information about the item menu extra text for the popup menu, after "word" or "abbr"
info more information about the item, can be displayed in a
preview window
kind single letter indicating the type of completion kind single letter indicating the type of completion
icase when non-zero case is to be ignored; when omitted icase when non-zero case is to be ignored; when omitted
the 'ignorecase' option is used the 'ignorecase' option is used
@ -1291,6 +1293,14 @@ Script completes:
- after $ variables name - after $ variables name
- if variable was declared as object add "->", if tags file is available show - if variable was declared as object add "->", if tags file is available show
name of class name of class
- after "->" complete only function and variable names specific for given
class. To find class location and contents tags file is required. Because
PHP isn't strongly typed language user can use @var tag to declare class: >
/* @var $myVar myClass */
$myVar->
<
Still, to find myClass contents tags file is required.
- function names with additonal info: - function names with additonal info:
- in case of built-in functions list of possible arguments and after | type - in case of built-in functions list of possible arguments and after | type
@ -1375,6 +1385,12 @@ It will also dynamically complete tables, procedures, views and column lists
with data pulled directly from within a database. For detailed instructions with data pulled directly from within a database. For detailed instructions
and a tutorial see |omni-sql-completion|. and a tutorial see |omni-sql-completion|.
The SQL completion plugin can be used in conjunction with other completion
plugins. For example, the PHP filetype has it's own completion plugin.
Since PHP is often used to generate dynamic website by accessing a database,
the SQL completion plugin can also be enabled. This allows you to complete
PHP code and SQL code at the same time.
XML *ft-xml-omni* XML *ft-xml-omni*
@ -1634,11 +1650,15 @@ NOTE: ":append" and ":insert" don't work properly in between ":if" and
10. Inserting a file *inserting-file* 10. Inserting a file *inserting-file*
*:r* *:re* *:read* *:r* *:re* *:read*
:r[ead] [name] Insert the file [name] (default: current file) below :r[ead] [++opt] [name]
Insert the file [name] (default: current file) below
the cursor. the cursor.
See |++opt| for the possible values of [++opt].
:{range}r[ead] [name] Insert the file [name] (default: current file) below :{range}r[ead] [++opt] [name]
Insert the file [name] (default: current file) below
the specified line. the specified line.
See |++opt| for the possible values of [++opt].
*:r!* *:read!* *:r!* *:read!*
:r[ead] !{cmd} Execute {cmd} and insert its standard output below :r[ead] !{cmd} Execute {cmd} and insert its standard output below
@ -1663,6 +1683,14 @@ If a file name is given with ":r", it becomes the alternate file. This can be
used, for example, when you want to edit that file instead: ":e! #". This can used, for example, when you want to edit that file instead: ":e! #". This can
be switched off by removing the 'a' flag from the 'cpoptions' option. be switched off by removing the 'a' flag from the 'cpoptions' option.
Of the [++opt] arguments one is specifically for ":read", the ++edit argument.
This is useful when the ":read" command is actually used to read a file into
the buffer as if editing that file. Use this command in an empty buffer: >
:read ++edit filename
The effect is that the 'fileformat', 'fileencoding', 'bomb', etc. options are
set to what has been detected for "filename". Note that a single empty line
remains, you may want to delete it.
*file-read* *file-read*
The 'fileformat' option sets the <EOL> style for a file: The 'fileformat' option sets the <EOL> style for a file:
'fileformat' characters name ~ 'fileformat' characters name ~

View File

@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 7.0c. Last change: 2006 Mar 29 *mbyte.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Bram Moolenaar et al. VIM REFERENCE MANUAL by Bram Moolenaar et al.
@ -985,7 +985,7 @@ Cursor color when IME or XIM is on *CursorIM*
This works in the same way when using XIM. This works in the same way when using XIM.
You can select cursor color when status is on by using highlight group You can select cursor color when status is on by using highlight group
CursorIM. For example, add these lines to your _gvimrc: > CursorIM. For example, add these lines to your |gvimrc|: >
if has('multi_byte_ime') if has('multi_byte_ime')
highlight Cursor guifg=NONE guibg=Green highlight Cursor guifg=NONE guibg=Green

View File

@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0c. Last change: 2006 Mar 29 *options.txt* For Vim version 7.0c. Last change: 2006 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -684,8 +684,7 @@ A jump table for the options with a short description can be found at |Q_op|.
or selected. or selected.
This option is provided for backward compatibility with the Vim This option is provided for backward compatibility with the Vim
released with Sun ONE Studio 4 Enterprise Edition. released with Sun ONE Studio 4 Enterprise Edition.
Note: When this option is on some plugins may not work. The directory Note: When this option is on some plugins may not work.
browser sets if off.
*'arabic'* *'arab'* *'noarabic'* *'noarab'* *'arabic'* *'arab'* *'noarabic'* *'noarab'*
'arabic' 'arab' boolean (default off) 'arabic' 'arab' boolean (default off)
@ -1488,8 +1487,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|fold-marker|. |fold-marker|.
*'compatible'* *'cp'* *'nocompatible'* *'nocp'* *'compatible'* *'cp'* *'nocompatible'* *'nocp'*
'compatible' 'cp' boolean (default on, off when a .vimrc or .gvimrc file 'compatible' 'cp' boolean (default on, off when a |vimrc| or |gvimrc|
is found) file is found)
global global
{not in Vi} {not in Vi}
This option has the effect of making Vim either more Vi-compatible, or This option has the effect of making Vim either more Vi-compatible, or
@ -1504,10 +1503,10 @@ A jump table for the options with a short description can be found at |Q_op|.
options. This default was chosen for those people who want to use Vim options. This default was chosen for those people who want to use Vim
just like Vi, and don't even (want to) know about the 'compatible' just like Vi, and don't even (want to) know about the 'compatible'
option. option.
When a ".vimrc" or ".gvimrc" file is found while Vim is starting up, When a |vimrc| or |gvimrc| file is found while Vim is starting up,
this option is switched off, and all options that have not been this option is switched off, and all options that have not been
modified will be set to the Vim defaults. Effectively, this means modified will be set to the Vim defaults. Effectively, this means
that when a ".vimrc" or ".gvimrc" file exists, Vim will use the Vim that when a |vimrc| or |gvimrc| file exists, Vim will use the Vim
defaults, otherwise it will use the Vi defaults. (Note: This doesn't defaults, otherwise it will use the Vi defaults. (Note: This doesn't
happen for the system-wide vimrc or gvimrc file). Also see happen for the system-wide vimrc or gvimrc file). Also see
|compatible-default| and |posix-compliance|. |compatible-default| and |posix-compliance|.
@ -2719,6 +2718,8 @@ A jump table for the options with a short description can be found at |Q_op|.
< This is similar to the default, except that these characters will also < This is similar to the default, except that these characters will also
be used when there is highlighting. be used when there is highlighting.
for "stl" and "stlnc" only single-byte values are supported.
The highlighting used for these items: The highlighting used for these items:
item highlight group ~ item highlight group ~
stl:c StatusLine |hl-StatusLine| stl:c StatusLine |hl-StatusLine|
@ -2894,6 +2895,7 @@ A jump table for the options with a short description can be found at |Q_op|.
quickfix ":cn", ":crew", ":make", etc. quickfix ":cn", ":crew", ":make", etc.
search search for a pattern: "/", "n", "*", "gd", etc. search search for a pattern: "/", "n", "*", "gd", etc.
(not for a search pattern in a ":" command) (not for a search pattern in a ":" command)
Also for |[s| and |]s|.
tag jumping to a tag: ":ta", CTRL-T, etc. tag jumping to a tag: ":ta", CTRL-T, etc.
undo undo or redo: "u" and CTRL-R undo undo or redo: "u" and CTRL-R
When the command is part of a mapping this option is not used. Add When the command is part of a mapping this option is not used. Add
@ -3332,7 +3334,7 @@ A jump table for the options with a short description can be found at |Q_op|.
can use "gvim -f" or ":gui -f" to start the GUI in the can use "gvim -f" or ":gui -f" to start the GUI in the
foreground. |gui-fork| foreground. |gui-fork|
Note: Set this option in the vimrc file. The forking may have Note: Set this option in the vimrc file. The forking may have
happened already when the gvimrc file is read. happened already when the |gvimrc| file is read.
'i' Use a Vim icon. For GTK with KDE it is used in the left-upper 'i' Use a Vim icon. For GTK with KDE it is used in the left-upper
corner of the window. It's black&white on non-GTK, because of corner of the window. It's black&white on non-GTK, because of
@ -3341,7 +3343,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'm' Menu bar is present. 'm' Menu bar is present.
'M' The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note 'M' The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note
that this flag must be added in the .vimrc file, before that this flag must be added in the .vimrc file, before
switching on syntax or filetype recognition (when the .gvimrc switching on syntax or filetype recognition (when the |gvimrc|
file is sourced the system menu has already been loaded; the file is sourced the system menu has already been loaded; the
":syntax on" and ":filetype on" commands load the menu too). ":syntax on" and ":filetype on" commands load the menu too).
'g' Grey menu items: Make menu items that are not active grey. If 'g' Grey menu items: Make menu items that are not active grey. If
@ -3374,7 +3376,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'p' Use Pointer callbacks for X11 GUI. This is required for some 'p' Use Pointer callbacks for X11 GUI. This is required for some
window managers. If the cursor is not blinking or hollow at window managers. If the cursor is not blinking or hollow at
the right moment, try adding this flag. This must be done the right moment, try adding this flag. This must be done
before starting the GUI. Set it in your gvimrc. Adding or before starting the GUI. Set it in your |gvimrc|. Adding or
removing it after the GUI has started has no effect. removing it after the GUI has started has no effect.
'F' Add a footer. Only for Motif. See |gui-footer|. 'F' Add a footer. Only for Motif. See |gui-footer|.
@ -3469,7 +3471,7 @@ A jump table for the options with a short description can be found at |Q_op|.
"8:SpecialKey,@:NonText,d:Directory, "8:SpecialKey,@:NonText,d:Directory,
e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg, e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,
M:ModeMsg,n:LineNr,r:Question, M:ModeMsg,n:LineNr,r:Question,
s:StatusLine,S:StatusLineNC,c:VertSplit s:StatusLine,S:StatusLineNC,c:VertSplit,
t:Title,v:Visual,w:WarningMsg,W:WildMenu, t:Title,v:Visual,w:WarningMsg,W:WildMenu,
f:Folded,F:FoldColumn,A:DiffAdd, f:Folded,F:FoldColumn,A:DiffAdd,
C:DiffChange,D:DiffDelete,T:DiffText, C:DiffChange,D:DiffDelete,T:DiffText,
@ -3560,7 +3562,7 @@ A jump table for the options with a short description can be found at |Q_op|.
highlight all of the matched text. However, this depends on where the highlight all of the matched text. However, this depends on where the
search starts. This will be the first line in the window or the first search starts. This will be the first line in the window or the first
line below a closed fold. A match in a previous line which is not line below a closed fold. A match in a previous line which is not
drawn may not continue in an newly drawn line. drawn may not continue in a newly drawn line.
NOTE: This option is reset when 'compatible' is set. NOTE: This option is reset when 'compatible' is set.
*'history'* *'hi'* *'history'* *'hi'*
@ -4265,7 +4267,7 @@ A jump table for the options with a short description can be found at |Q_op|.
The characters ':' and ',' should not be used. UTF-8 characters can The characters ':' and ',' should not be used. UTF-8 characters can
be used when 'encoding' is "utf-8", otherwise only printable be used when 'encoding' is "utf-8", otherwise only printable
characters are allowed. characters are allowed. All characters must be single width.
Examples: > Examples: >
:set lcs=tab:>-,trail:- :set lcs=tab:>-,trail:-
@ -5369,6 +5371,8 @@ A jump table for the options with a short description can be found at |Q_op|.
going back to the other window, it still uses the going back to the other window, it still uses the
same relative offset. same relative offset.
Also see |scroll-binding|. Also see |scroll-binding|.
When 'diff' mode is active there always is vertical scroll binding,
even when "ver" isn't there.
*'sections'* *'sect'* *'sections'* *'sect'*
'sections' 'sect' string (default "SHNHH HUnhsh") 'sections' 'sect' string (default "SHNHH HUnhsh")
@ -5969,8 +5973,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|zg| and |zw| commands can be used to access each. This allows using |zg| and |zw| commands can be used to access each. This allows using
a personal word list file and a project word list file. a personal word list file and a project word list file.
When a word is added while this option is empty Vim will set it for When a word is added while this option is empty Vim will set it for
you: Using the first "spell" directory in 'runtimepath' that is you: Using the first directory in 'runtimepath' that is writable. If
writable and the first language name that appears in 'spelllang', there is no "spell" directory yet it will be created. For the file
name the first language name that appears in 'spelllang' is used,
ignoring the region. ignoring the region.
The resulting ".spl" file will be used for spell checking, it does not The resulting ".spl" file will be used for spell checking, it does not
have to appear in 'spelllang'. have to appear in 'spelllang'.

View File

@ -1,4 +1,4 @@
*os_dos.txt* For Vim version 7.0c. Last change: 2006 Feb 14 *os_dos.txt* For Vim version 7.0c. Last change: 2006 Mar 30
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -77,10 +77,11 @@ is especially useful when using a Unix-like 'shell'.
============================================================================== ==============================================================================
3. Standard mappings *dos-standard-mappings* 3. Standard mappings *dos-standard-mappings*
CTRL-PageUp cursor to first screen line *<C-PageUp>* The mappings for CTRL-PageUp and CTRL-PageDown have been removed, they now
CTRL-PageDown cursor to last screen line, last character *<C-PageDown>* jump to the next or previous tab page |<C-PageUp>| |<C-PageDown>|
These mappings accomplish this: If you want them to move to the first and last screen line you can use these
mappings:
key key code Normal/Visual mode Insert mode ~ key key code Normal/Visual mode Insert mode ~
CTRL-PageUp <M-N><M-C-D> H <C-O>H CTRL-PageUp <M-N><M-C-D> H <C-O>H

View File

@ -1,4 +1,4 @@
*os_win32.txt* For Vim version 7.0c. Last change: 2005 Mar 29 *os_win32.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by George Reilly VIM REFERENCE MANUAL by George Reilly
@ -87,6 +87,12 @@ The only kind of terminal type that the Win32 version of Vim understands is
probably get very strange behavior from Vim. Therefore Vim does not obtain probably get very strange behavior from Vim. Therefore Vim does not obtain
the default value of 'term' from the environment variable "TERM". the default value of 'term' from the environment variable "TERM".
$PATH *win32-PATH*
The directory of the Vim executable is appended to $PATH. This is mostly to
make "!xxd' work, as it is in the Tools menu. And it also means that when
executable() returns 1 the executable can actually be executed.
============================================================================== ==============================================================================
3. Restore screen contents *win32-restore* 3. Restore screen contents *win32-restore*

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 7.0c. Last change: 2006 Mar 25 *pattern.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1220,6 +1220,9 @@ Finally, these constructs are unique to Perl:
'ignorecase' does not apply, use |/\c| in the pattern to 'ignorecase' does not apply, use |/\c| in the pattern to
ignore case. Otherwise case is not ignored. ignore case. Otherwise case is not ignored.
Also see |matcharg()|, it returns the highlight group and
pattern of a previous :match command.
Another example, which highlights all characters in virtual Another example, which highlights all characters in virtual
column 72 and more: > column 72 and more: >
:highlight rightMargin term=bold ctermfg=blue guifg=blue :highlight rightMargin term=bold ctermfg=blue guifg=blue
@ -1235,10 +1238,10 @@ Finally, these constructs are unique to Perl:
Clear a previously defined match pattern. Clear a previously defined match pattern.
:2mat[ch] {group} /{pattern}/ :2mat[ch] {group} /{pattern}/ *:2match*
:2mat[ch] :2mat[ch]
:2mat[ch] none :2mat[ch] none
:3mat[ch] {group} /{pattern}/ :3mat[ch] {group} /{pattern}/ *:3match*
:3mat[ch] :3mat[ch]
:3mat[ch] none :3mat[ch] none
Just like |:match| above, but set a separate match. Thus Just like |:match| above, but set a separate match. Thus

View File

@ -1,4 +1,4 @@
*pi_paren.txt* For Vim version 7.0c. Last change: 2006 Mar 29 *pi_paren.txt* For Vim version 7.0c. Last change: 2006 Apr 03
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -38,9 +38,13 @@ in a string or comment syntax item, then matches inside string and comment
syntax items are ignored. Any syntax items with "string" or "comment" syntax items are ignored. Any syntax items with "string" or "comment"
somewhere in their name are considered string or comment items. somewhere in their name are considered string or comment items.
The search is limited to what is visible in the window. The plugin doesn't The search is limited to avoid a delay when moving the cursor. The limits
search further than 100 lines to avoid a long delay when there are closed are:
folds. - What is visible in the window.
- 100 lines above or below the cursor to avoid a long delay when there are
closed folds.
- 'synmaxcolumn' times 2 bytes before or after the cursor to avoid a delay
in a long line with syntax highlighting.
============================================================================== ==============================================================================
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,6 +1,8 @@
*tar.txt* For Vim version 7.0c. Last change: 2006 Mar 24 *tar.txt* For Vim version 7.0c. Last change: 2006 Mar 24
Tar File Interface +====================+
| Tar File Interface |
+====================+
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM> Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first) (remove NOSPAM from Campbell's email first)
@ -12,7 +14,8 @@ Copyright: The GPL (gnu public license) applies to *tar-copyright*
1. Contents *tar* *tar-contents* 1. Contents *tar* *tar-contents*
1. Contents..................................................|tar-contents| 1. Contents..................................................|tar-contents|
2. Usage.....................................................|tar-usage| 2. Usage.....................................................|tar-usage|
3. History...................................................|tar-history| 3. Options...................................................|tar-options|
4. History...................................................|tar-history|
============================================================================== ==============================================================================
2. Usage *tar-usage* *tar-manual* 2. Usage *tar-usage* *tar-manual*
@ -24,7 +27,25 @@ Copyright: The GPL (gnu public license) applies to *tar-copyright*
tar archives via the plugin. tar archives via the plugin.
============================================================================== ==============================================================================
3. History *tar-history* 3. Options *tar-options*
These options are variables that one may change, typically in one's
<.vimrc> file.
Default
Variable Value Explanation
*g:tar_browseoptions* "Ptf" used to get a list of contents
*g:tar_readoptions* "OPxf" used to extract a file from a tarball
*g:tar_cmd* "tar" the name of the tar program
*g:tar_writeoptions* "uf" used to update/replace a file
==============================================================================
4. History *tar-history*
v7 Mar 22, 2006 * work on making tar plugin work across network
Mar 27, 2006 * g:tar_cmd now available for users to change the name
of the tar program to be used. By default, of course,
its "tar".
v6 Dec 21, 2005 * writing to files not in directories caused problems - v6 Dec 21, 2005 * writing to files not in directories caused problems -
fixed (pointed out by Christian Robinson) fixed (pointed out by Christian Robinson)
v5 Nov 22, 2005 * report option workaround installed v5 Nov 22, 2005 * report option workaround installed

View File

@ -1,18 +1,20 @@
*zip.txt* For Vim version 7.0c. Last change: 2006 Mar 24 *zip.txt* For Vim version 7.0c. Last change: 2006 Apr 03
Zip File Interface +====================+
| Zip File Interface |
+====================+
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM> Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first) (remove NOSPAM from Campbell's email first)
Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1 *zip-copyright* Copyright: Copyright (C) 2005,2006 Charles E Campbell, Jr {{{1 *zip-copyright*
Permission is hereby granted to use and distribute this code, Permission is hereby granted to use and distribute this code,
with or without modifications, provided that this copyright with or without modifications, provided that this copyright
notice is copied with it. Like anything else that's free, notice is copied with it. Like anything else that's free,
zip.vim, zipPlugin.vim, and pi_zip.txt are provided *as is* zip.vim, zipPlugin.vim, and pi_zip.txt are provided *as is*
and it comes with no warranty of any kind, either expressed or and it comes with no warranty of any kind, either expressed or
implied. By using this plugin, you agree that in no event will implied. By using this plugin, you agree that in no event will
the copyright holder be liable for any damages resulting from the copyright holder be liable for any damages resulting from
the use of this software. the use of this software.
============================================================================== ==============================================================================
1. Contents *zip* *zip-contents* 1. Contents *zip* *zip-contents*

View File

@ -1,4 +1,4 @@
*spell.txt* For Vim version 7.0c. Last change: 2006 Mar 27 *spell.txt* For Vim version 7.0c. Last change: 2006 Apr 03
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -500,7 +500,7 @@ then Vim will try to guess.
:mkspell ~/.vim/spell/en /tmp/en_US /tmp/en_CA /tmp/en_AU :mkspell ~/.vim/spell/en /tmp/en_US /tmp/en_CA /tmp/en_AU
< This combines the English word lists for US, CA and AU < This combines the English word lists for US, CA and AU
into one en.spl file. into one en.spl file.
Up to eight regions can be combined. *E754* *755* Up to eight regions can be combined. *E754* *E755*
The REP and SAL items of the first .aff file where The REP and SAL items of the first .aff file where
they appear are used. |spell-REP| |spell-SAL| they appear are used. |spell-REP| |spell-SAL|
@ -1058,36 +1058,8 @@ Specifically, the affix flags can be used for:
- Making the word with the affix rare, by using the |spell-RARE| flag. - Making the word with the affix rare, by using the |spell-RARE| flag.
- Exclude the word with the affix from compounding, by using the - Exclude the word with the affix from compounding, by using the
|spell-COMPOUNDFORBIDFLAG| flag. |spell-COMPOUNDFORBIDFLAG| flag.
- Allow the word with the affix to be part of a compound word on the side of
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- the affix with the |spell-COMPOUNDPERMITFLAG|.
OLD STUFF: This needs to be rewritten to use affix flags.
*spell-affix-rare*
An extra item for Vim is the "rare" flag. It must come after the other
fields, before a comment. When used then all words that use the affix will be
marked as rare words. Examples:
PFX F 0 nene . rare ~
SFX F 0 oin n rare # hardly ever used ~
However, if the word also appears as a good word in another way (e.g., in
another region) it won't be marked as rare.
*spell-affix-nocomp*
Another extra item for Vim is the "nocomp" flag. It must come after the other
fields, before a comment. It can be either before or after "rare". When
present then all words that use the affix will not be part of a compound word.
Example:
affix file:
COMPOUNDFLAG c ~
SFX a Y 2 ~
SFX a 0 s . ~
SFX a 0 ize . nocomp ~
dictionary:
word/c ~
util/ac ~
This allows for "wordutil" and "wordutils" but not "wordutilize".
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
*spell-PFXPOSTPONE* *spell-PFXPOSTPONE*
When an affix file has very many prefixes that apply to many words it's not When an affix file has very many prefixes that apply to many words it's not
@ -1146,6 +1118,11 @@ words that are correct for the language, but are hardly ever used and could be
a typing mistake anyway. When the same word is found as good it won't be a typing mistake anyway. When the same word is found as good it won't be
highlighted as rare. highlighted as rare.
This flag can also be used on an affix, so that a basic word is not rare but
the basic word plus affix is rare |spell-affix-flags|. However, if the word
also appears as a good word in another way (e.g., in another region) it won't
be marked as rare.
BAD WORDS *spell-BAD* BAD WORDS *spell-BAD*
@ -1243,6 +1220,12 @@ A specific example: Allow a compound to be made of two words and a dash:
This allows for the word "start-end", but not "startend". This allows for the word "start-end", but not "startend".
An additional implied rule is that, without further flags, a word with a
prefix cannot be compounded after another word, and a word with a suffix
cannot be compounded with a following word. Thus the affix cannot appear
on the inside of a compound word. This can be changed with the
|spell-COMPOUNDPERMITFLAG|.
*spell-NEEDCOMPOUND* *spell-NEEDCOMPOUND*
The NEEDCOMPOUND flag is used to require that a word is used as part of a The NEEDCOMPOUND flag is used to require that a word is used as part of a
compound word. The word itself is not a good word. Example: compound word. The word itself is not a good word. Example:
@ -1282,13 +1265,24 @@ COMPOUNDWORDMAX words or contains up to COMPOUNDSYLMAX syllables.
*spell-COMPOUNDFORBIDFLAG* *spell-COMPOUNDFORBIDFLAG*
The COMPOUNDFORBIDFLAG specifies a flag that can be used on an affix. It The COMPOUNDFORBIDFLAG specifies a flag that can be used on an affix. It
means that the word plus affix cannot be used in a compound word. means that the word plus affix cannot be used in a compound word. Example:
affix file:
COMPOUNDFLAG c ~
COMPOUNDFORBIDFLAG x ~
SFX a Y 2 ~
SFX a 0 s . ~
SFX a 0 ize/x . ~
dictionary:
word/c ~
util/ac ~
This allows for "wordutil" and "wordutils" but not "wordutilize".
*spell-COMPOUNDPERMITFLAG* *spell-COMPOUNDPERMITFLAG*
The COMPOUNDPERMITFLAG specifies a flag that can be used on an affix. It The COMPOUNDPERMITFLAG specifies a flag that can be used on an affix. It
means that the word plus affix can also be used in a compound word in a way means that the word plus affix can also be used in a compound word in a way
where the affix ends up halfway the word. where the affix ends up halfway the word. Without this flag that is not
NOT IMPLEMENTED YET. allowed.
*spell-COMPOUNDROOT* *spell-COMPOUNDROOT*
The COMPOUNDROOT flag is used for words in the dictionary that are already a The COMPOUNDROOT flag is used for words in the dictionary that are already a
@ -1309,9 +1303,9 @@ With the example "ideeen" has three syllables, counted by "i", "ee" and "e".
Only case-folded letters need to be included. Only case-folded letters need to be included.
Above another way to restrict compounding was mentioned above: adding "nocomp" Above another way to restrict compounding was mentioned above: Adding the
after an affix causes all words that are made with that affix not be be used |spell-COMPOUNDFORBIDFLAG| flag to an affix causes all words that are made
for compounding. |spell-affix-nocomp| with that affix not be be used for compounding.
UNLIMITED COMPOUNDING *spell-NOBREAK* UNLIMITED COMPOUNDING *spell-NOBREAK*

View File

@ -1,4 +1,4 @@
*sql.txt* For Vim version 7.0c. Last change: Tue Mar 28 2006 9:33:14 PM *sql.txt* For Vim version 7.0c. Last change: Mon Apr 03 2006 10:34:00 PM
by David Fishburn by David Fishburn
@ -26,7 +26,8 @@ features for navigation, indentation and syntax highlighting.
4.3.3 Complete Procedures |sql-completion-procedures| 4.3.3 Complete Procedures |sql-completion-procedures|
4.3.4 Complete Views |sql-completion-views| 4.3.4 Complete Views |sql-completion-views|
4.4 Completion Customization |sql-completion-customization| 4.4 Completion Customization |sql-completion-customization|
4.5 Customizing Maps |sql-completion-maps| 4.5 SQL Maps |sql-completion-maps|
4.6 Using with other filetypes |sql-completion-filetypes|
============================================================================== ==============================================================================
1. Navigation *sql-navigation* 1. Navigation *sql-navigation*
@ -321,41 +322,48 @@ procedures names and more.
--------------- ---------------
The static popups created contain items defined by the active syntax rules The static popups created contain items defined by the active syntax rules
while editing a file with a filetype of SQL. The plugin defines (by default) while editing a file with a filetype of SQL. The plugin defines (by default)
various maps to help the user refine which list of items they wish displayed. various maps to help the user refine the list of items to be displayed.
The defaults static maps are: > The defaults static maps are: >
imap <buffer> <C-C>a <C-\><C-O>:let b:sql_compl_type='syntax'<CR><C-X><C-O> imap <buffer> <C-C>a <C-\><C-O>:call sqlcomplete#Map('syntax')<CR><C-X><C-O>
imap <buffer> <C-C>s <C-\><C-O>:let b:sql_compl_type='sqlStatement'<CR><C-X><C-O> imap <buffer> <C-C>k <C-\><C-O>:call sqlcomplete#Map('sqlKeyword')<CR><C-X><C-O>
imap <buffer> <C-C>f <C-\><C-O>:let b:sql_compl_type='sqlFunction'<CR><C-X><C-O> imap <buffer> <C-C>f <C-\><C-O>:call sqlcomplete#Map('sqlFunction')<CR><C-X><C-O>
imap <buffer> <C-C>k <C-\><C-O>:let b:sql_compl_type='sqlKeyword'<CR><C-X><C-O> imap <buffer> <C-C>o <C-\><C-O>:call sqlcomplete#Map('sqlOption')<CR><C-X><C-O>
imap <buffer> <C-C>o <C-\><C-O>:let b:sql_compl_type='sqlOption'<CR><C-X><C-O> imap <buffer> <C-C>T <C-\><C-O>:call sqlcomplete#Map('sqlType')<CR><C-X><C-O>
imap <buffer> <C-C>T <C-\><C-O>:let b:sql_compl_type='sqlType'<CR><C-X><C-O> imap <buffer> <C-C>s <C-\><C-O>:call sqlcomplete#Map('sqlStatement')<CR><C-X><C-O>
< <
The static maps (which are based on the syntax highlight groups) follow this The static maps (which are based on the syntax highlight groups) follow this
format: > format: >
imap <buffer> <C-C>k <C-\><C-O>:let b:sql_compl_type='sqlKeyword'<CR><C-X><C-O> imap <buffer> <C-C>k <C-\><C-O>:call sqlcomplete#Map('sqlKeyword')<CR><C-X><C-O>
< <
This command breaks down as: > This command breaks down as: >
imap - Create an insert map imap - Create an insert map
<buffer> - Only for this buffer <buffer> - Only for this buffer
<C-C>k - Your choice of key map <C-C>k - Your choice of key map
<C-\><C-O> - Execute one command, return to Insert mode <C-\><C-O> - Execute one command, return to Insert mode
:let b:sql_compl_type= - Choose the highlight group's entries to display. :call sqlcomplete#Map( - Allows the SQL completion plugin to perform some
housekeeping functions to allow it to be used in
conjunction with other completion plugins.
Indicate which item you want the SQL completion
plugin to complete.
In this case we are asking the plugin to display
items from the syntax highlight group
'sqlKeyword'.
You can view a list of highlight group names to You can view a list of highlight group names to
choose from by executing the choose from by executing the
:syntax list :syntax list
command while editing a SQL file. command while editing a SQL file.
'sqlKeyword' - Display the items for the sqlKeyword highlight 'sqlKeyword' - Display the items for the sqlKeyword highlight
group group
<CR> - Execute the :let command )<CR> - Execute the :let command
<C-X><C-O> - Trigger the standard omni completion key stroke. <C-X><C-O> - Trigger the standard omni completion key stroke.
By setting the b:sql_compl_type variable, this Passing in 'sqlKeyword' instructs the SQL
instructs the SQL completion plugin to populate completion plugin to populate the popup with
the popup with items from the sqlKeyword highlight items from the sqlKeyword highlight group. The
group. The plugin will also cache this result plugin will also cache this result until Vim is
until Vim is restarted. The syntax list is restarted. The syntax list is retrieved using
retrieved using the syntaxcomplete plugin. the syntaxcomplete plugin.
< <
Setting b:sql_compl_type = 'syntax' is a special case. This instructs the Using the 'syntax' keyword is a special case. This instructs the
syntaxcomplete plugin to retrieve all syntax items. So this will effectively syntaxcomplete plugin to retrieve all syntax items. So this will effectively
work for any of Vim's SQL syntax files. At the time of writing this includes work for any of Vim's SQL syntax files. At the time of writing this includes
10 different syntax files for the different dialects of SQL (see section 3 10 different syntax files for the different dialects of SQL (see section 3
@ -383,7 +391,7 @@ order for the dynamic feature to be enabled you must have the dbext.vim
plugin installed, (http://vim.sourceforge.net/script.php?script_id=356). plugin installed, (http://vim.sourceforge.net/script.php?script_id=356).
Dynamic mode is used by several features of the SQL completion plugin. Dynamic mode is used by several features of the SQL completion plugin.
After installing the dbext plugin see the |dbext-tutorial| for additional After installing the dbext plugin see the dbext-tutorial for additional
configuration and usage. The dbext plugin allows the SQL completion plugin configuration and usage. The dbext plugin allows the SQL completion plugin
to display a list of tables, procedures, views and columns. > to display a list of tables, procedures, views and columns. >
Table List Table List
@ -403,9 +411,7 @@ the space bar):
Stored Procedure List - <C-C>p Stored Procedure List - <C-C>p
View List - <C-C>v View List - <C-C>v
Column List - <C-C>c Column List - <C-C>c
- .<C-X><C-O> - Windows platform only
- If <C-X><C-O> is pressed following a period
it is assumed you are asking for a column list.
- When viewing a popup window displaying the list - When viewing a popup window displaying the list
of tables, you can press <C-Right>, this will of tables, you can press <C-Right>, this will
replace the table currently highlighted with replace the table currently highlighted with
@ -418,7 +424,7 @@ The SQL completion plugin caches various lists that are displayed in
the popup window. This makes the re-displaying of these lists very the popup window. This makes the re-displaying of these lists very
fast. If new tables or columns are added to the database it may become fast. If new tables or columns are added to the database it may become
necessary to clear the plugins cache. The default map for this is: > necessary to clear the plugins cache. The default map for this is: >
imap <buffer> <C-C>R <C-O>:let b:sql_compl_type='ResetCache'<CR><C-X><C-O> imap <buffer> <C-C>R <C-\><C-O>:call sqlcomplete#Map('ResetCache')<CR><C-X><C-O>
< <
4.3 SQL Tutorial *sql-completion-tutorial* 4.3 SQL Tutorial *sql-completion-tutorial*
@ -472,7 +478,7 @@ is to run the command, :DBListTable. If a list of tables is shown, you know
dbext.vim is working as expected. If not, please consult the dbext.txt dbext.vim is working as expected. If not, please consult the dbext.txt
documentation. documentation.
Assuming you have followed the |dbext-tutorial| you can press <C-C>t to Assuming you have followed the dbext-tutorial you can press <C-C>t to
display a list of tables. There is a delay while dbext is creating the table display a list of tables. There is a delay while dbext is creating the table
list. After the list is displayed press <C-W>. This will remove both the list. After the list is displayed press <C-W>. This will remove both the
popup window and the table name already chosen when the list became active. > popup window and the table name already chosen when the list became active. >
@ -496,7 +502,7 @@ platforms since *nix does not recognize CTRL and the right arrow held down
together. If you wish to enable this functionality on a *nix platform choose together. If you wish to enable this functionality on a *nix platform choose
a key and create this mapping (see |sql-completion-maps| for further a key and create this mapping (see |sql-completion-maps| for further
details on where to create this imap): > details on where to create this imap): >
imap <buffer> <your_keystroke> <CR><C-\><C-O>:let b:sql_compl_type='column'<CR><C-X><C-O> imap <buffer> <your_keystroke> <CR><C-\><C-O>:call sqlcomplete#Map('column')<CR><C-X><C-O>
< <
Example of using column completion: Example of using column completion:
- Press <C-C>t again to display the list of tables. - Press <C-C>t again to display the list of tables.
@ -611,9 +617,65 @@ your |vimrc|: >
MYTABLENAME --> M MYTABLENAME --> M
< <
4.5 Customizing Maps *sql-completion-maps* 4.5 SQL Maps *sql-completion-maps*
-------------------- ------------
The default SQL maps have been described in other sections of this document in
greater detail. Here is a list of the maps with a brief description of each.
Static Maps
-----------
These are maps which use populate the completion list using Vim's syntax
highlighting rules. >
<C-C>a
< - Displays all SQL syntax items. >
<C-C>k
< - Displays all SQL syntax items defined as 'sqlKeyword'. >
<C-C>f
< - Displays all SQL syntax items defined as 'sqlFunction. >
<C-C>o
< - Displays all SQL syntax items defined as 'sqlOption'. >
<C-C>T
< - Displays all SQL syntax items defined as 'sqlType'. >
<C-C>s
< - Displays all SQL syntax items defined as 'sqlStatement'. >
Dynamic Maps
------------
These are maps which use populate the completion list using the dbext.vim plugin. >
<C-C>t
< - Displays a list of tables. >
<C-C>p
< - Displays a list of procedures. >
<C-C>v
< - Displays a list of views. >
<C-C>c
< - Displays a list of columns for a specific table. >
<C-C>l
< - Displays a comma separated list of columns for a specific table. >
<C-C>L
< - Displays a comma separated list of columns for a specific table.
This should only be used when the completion window is active. >
<C-Right>
< - Displays a list of columns for the table currently highlighted in
the completion window. <C-Right> is not recognized on most Unix
systems, so this maps is only created on the Windows platform.
If you would like the same feature on Unix, choose a different key
and make the same map in your vimrc.
This should only be used when the completion window is active. >
<C-Left>
< - Displays the list of tables.
<C-Left> is not recognized on most Unix systems, so this maps is
only created on the Windows platform. If you would like the same
feature on Unix, choose a different key and make the same map in
your vimrc.
This should only be used when the completion window is active. >
<C-C>R
< - This maps removes all cached items and forces the SQL completion
to regenerate the list of items.
Customizing Maps
----------------
You can create as many additional key maps as you like. Generally, the maps You can create as many additional key maps as you like. Generally, the maps
will be specifying different syntax highlight groups. will be specifying different syntax highlight groups.
@ -624,7 +686,7 @@ your |vimrc|: >
< <
Do no edit ftplugin/sql.vim directly! If you change this file your changes Do no edit ftplugin/sql.vim directly! If you change this file your changes
will be over written on future updates. Vim has a special directory structure will be over written on future updates. Vim has a special directory structure
that allows you to make customizations without changing the files that are which allows you to make customizations without changing the files that are
included with the Vim distribution. If you wish to customize the maps included with the Vim distribution. If you wish to customize the maps
create an after/ftplugin/sql.vim (see |after-directory|) and place the same create an after/ftplugin/sql.vim (see |after-directory|) and place the same
maps from the ftplugin/sql.vim in it using your own key strokes. <C-C> was maps from the ftplugin/sql.vim in it using your own key strokes. <C-C> was
@ -632,4 +694,44 @@ chosen since it will work on both Windows and *nix platforms. On the windows
platform you can also use <C-Space> or ALT keys. platform you can also use <C-Space> or ALT keys.
4.6 Using with other filetypes *sql-completion-filetypes*
------------------------------
Many times SQL can be used with different filetypes. For example Perl, Java,
PHP, Javascript can all interact with a database. Often you need both the SQL
completion as well as the completion capabilities for the current language you
are editing.
This can be enabled easily with the following steps (assuming a Perl file): >
1. :e test.pl
2. :set filetype=sql
3. :set ft=perl
Step 1
------
Begins by editing a Perl file. Vim automatically sets the filetype to
"perl". By default, Vim runs the appropriate filetype file
ftplugin/perl.vim. If you are using the syntax completion plugin by following
the directions at |ft-syntax-omni| then the |'omnifunc'| option has been set to
"syntax#Complete". Pressing <C-X><C-O> will display the omni popup containing
the syntax items for Perl.
Step 2
------
Manually setting the filetype to 'sql' will also fire the appropriate filetype
files ftplugin/sql.vim. This file will define a number of buffer specific
maps for SQL completion, see |sql-completion-maps|. Now these maps have
been created and the SQL completion plugin has been initialized. All SQL
syntax items have been cached in preparation. The SQL filetype script detects
we are attempting to use two different completion plugins. Since the SQL maps
begin with <C-C>, the maps will toggle the |'omnifunc'| when in use. So you
can use <C-X><C-O> to continue using the completion for Perl (using the syntax
completion plugin) and <C-C> to use the SQL completion features.
Step 3
------
Setting the filetype back to Perl sets all the usual "perl" related items back
as they were.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*starting.txt* For Vim version 7.0c. Last change: 2006 Mar 26 *starting.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -413,7 +413,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
process and exits the current one. "-f" should be used when process and exits the current one. "-f" should be used when
gvim is started by a program that will wait for the edit gvim is started by a program that will wait for the edit
session to finish (e.g., mail or readnews). If you want gvim session to finish (e.g., mail or readnews). If you want gvim
never to fork, include 'f' in 'guioptions' in your .gvimrc. never to fork, include 'f' in 'guioptions' in your |gvimrc|.
Careful: You can use "-gf" to start the GUI in the foreground, Careful: You can use "-gf" to start the GUI in the foreground,
but "-fg" is used to specify the foreground color. |gui-fork| but "-fg" is used to specify the foreground color. |gui-fork|
{not in Vi} {not in Vi}
@ -430,7 +430,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
< Also consider using autocommands; see |autocommand|. < Also consider using autocommands; see |autocommand|.
When {vimrc} is equal to "NONE" (all uppercase), all When {vimrc} is equal to "NONE" (all uppercase), all
initializations from files and environment variables are initializations from files and environment variables are
skipped, including reading the .gvimrc file when the GUI skipped, including reading the |gvimrc| file when the GUI
starts. Loading plugins is also skipped. starts. Loading plugins is also skipped.
When {vimrc} is equal to "NORC" (all uppercase), this has the When {vimrc} is equal to "NORC" (all uppercase), this has the
same effect as "NONE", but loading plugins is not skipped. same effect as "NONE", but loading plugins is not skipped.
@ -440,7 +440,7 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
{not in Vi} {not in Vi}
*-U* *E230* *-U* *E230*
-U {gvimrc} The file "gvimrc" is read for initializations when the GUI -U {gvimrc} The file {gvimrc} is read for initializations when the GUI
starts. Other GUI initializations are skipped. When {gvimrc} starts. Other GUI initializations are skipped. When {gvimrc}
is equal to "NONE", no file is read for GUI initializations at is equal to "NONE", no file is read for GUI initializations at
all. |gui-init| all. |gui-init|
@ -761,7 +761,8 @@ accordingly. Vim proceeds in this order:
*VIMINIT* *.vimrc* *_vimrc* *EXINIT* *.exrc* *_exrc* *VIMINIT* *.vimrc* *_vimrc* *EXINIT* *.exrc* *_exrc*
c. Four places are searched for initializations. The first that exists c. Four places are searched for initializations. The first that exists
is used, the others are ignored. is used, the others are ignored. The $MYVIMRC environment variable is
set to the file that was first found, unless $MYVIMRC was already set.
- The environment variable VIMINIT (see also |compatible-default|) (*) - The environment variable VIMINIT (see also |compatible-default|) (*)
The value of $VIMINIT is used as an Ex command line. The value of $VIMINIT is used as an Ex command line.
- The user vimrc file(s): - The user vimrc file(s):
@ -905,7 +906,8 @@ resetting other options (see 'compatible'). But only the options that have
not been set or reset will be changed. This has the same effect like the not been set or reset will be changed. This has the same effect like the
value of 'compatible' had this value when starting Vim. Note that this value of 'compatible' had this value when starting Vim. Note that this
doesn't happen for the system-wide vimrc file. It does also happen for gvimrc doesn't happen for the system-wide vimrc file. It does also happen for gvimrc
files. files. The $MYVIMRC or $MYGVIMRC file will be set to the first found vimrc
and/or gvimrc file.
But there is a side effect of setting or resetting 'compatible' at the moment But there is a side effect of setting or resetting 'compatible' at the moment
a .vimrc file is found: Mappings are interpreted the moment they are a .vimrc file is found: Mappings are interpreted the moment they are

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.0c. Last change: 2006 Mar 28 *syntax.txt* For Vim version 7.0c. Last change: 2006 Apr 04
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -81,14 +81,14 @@ automatically selected if the 'fileformats' option is not empty.
NOTE: When using reverse video ("gvim -fg white -bg black"), the default value NOTE: When using reverse video ("gvim -fg white -bg black"), the default value
of 'background' will not be set until the GUI window is opened, which is after of 'background' will not be set until the GUI window is opened, which is after
reading the .gvimrc. This will cause the wrong default highlighting to be reading the |gvimrc|. This will cause the wrong default highlighting to be
used. To set the default value of 'background' before switching on used. To set the default value of 'background' before switching on
highlighting, include the ":gui" command in the .gvimrc: > highlighting, include the ":gui" command in the |gvimrc|: >
:gui " open window and set default for 'background' :gui " open window and set default for 'background'
:syntax on " start highlighting, use 'background' to set colors :syntax on " start highlighting, use 'background' to set colors
NOTE: Using ":gui" in the .gvimrc means that "gvim -f" won't start in the NOTE: Using ":gui" in the |gvimrc| means that "gvim -f" won't start in the
foreground! Use ":gui -f" then. foreground! Use ":gui -f" then.
@ -1013,10 +1013,10 @@ source form if the fortran_free_source variable has been set, and assumes
fixed source form if the fortran_fixed_source variable has been set. If fixed source form if the fortran_fixed_source variable has been set. If
neither of these variables have been set, the syntax script attempts to neither of these variables have been set, the syntax script attempts to
determine which source form has been used by examining the first five columns determine which source form has been used by examining the first five columns
of the first 25 lines of your file. If no signs of free source form are of the first 250 lines of your file. If no signs of free source form are
detected, then the file is assumed to be in fixed source form. The algorithm detected, then the file is assumed to be in fixed source form. The algorithm
should work in the vast majority of cases. In some cases, such as a file that should work in the vast majority of cases. In some cases, such as a file that
begins with 25 or more full-line comments, the script may incorrectly decide begins with 250 or more full-line comments, the script may incorrectly decide
that the fortran code is in fixed form. If that happens, just add a that the fortran code is in fixed form. If that happens, just add a
non-comment statement beginning anywhere in the first five columns of the non-comment statement beginning anywhere in the first five columns of the
first twenty five lines, save (:w) and then reload (:e!) the file. first twenty five lines, save (:w) and then reload (:e!) the file.
@ -2304,7 +2304,7 @@ vimrc file: >
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax* SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
This covers the "normal" Unix (Bourne) sh, bash and the Korn shell. This covers the "normal" Unix (Borne) sh, bash and the Korn shell.
Vim attempts to determine which shell type is in use by specifying that Vim attempts to determine which shell type is in use by specifying that
various filenames are of specific types: > various filenames are of specific types: >
@ -2328,6 +2328,11 @@ variables in your <.vimrc>:
< sh: > < sh: >
let is_sh = 1 let is_sh = 1
If there's no "#! ..." line, and the user hasn't availed himself/herself of a
default sh.vim syntax setting as just shown, then syntax/sh.vim will assume
the Borne shell syntax. No need to quote RFCs or market penetration
statistics in error reports, please.
If, in your <.vimrc>, you set > If, in your <.vimrc>, you set >
let g:sh_fold_enabled= 1 let g:sh_fold_enabled= 1
> >
@ -3760,7 +3765,7 @@ term={attr-list} *attr-list* *highlight-term* *E418*
have the same effect. have the same effect.
"undercurl" is a curly underline. When "undercurl" is not possible "undercurl" is a curly underline. When "undercurl" is not possible
then "underline" is used. In general "undercurl" is only available in then "underline" is used. In general "undercurl" is only available in
the GUI. the GUI. The color is set with |highlight-guisp|.
start={term-list} *highlight-start* *E422* start={term-list} *highlight-start* *E422*
stop={term-list} *term-list* *highlight-stop* stop={term-list} *term-list* *highlight-stop*

View File

@ -1,4 +1,4 @@
*tabpage.txt* For Vim version 7.0c. Last change: 2006 Mar 03 *tabpage.txt* For Vim version 7.0c. Last change: 2006 Mar 31
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -119,12 +119,14 @@ Using the mouse: If the tab page line is displayed you can click in a tab page
label to switch to that tab page. Click where there is no label to go to the label to switch to that tab page. Click where there is no label to go to the
next tab page. |'tabline'| next tab page. |'tabline'|
:tabn[ext] *:tabn* *:tabnext* *gt* :tabn[ext] *:tabn* *:tabnext* *gt*
gt Go to the next tab page. Wraps around from the last to the gt *CTRL-<PageDown>* *<C-PageDown>*
<C-PageDown> Go to the next tab page. Wraps around from the last to the
first one. first one.
:tabn[ext] {count} :tabn[ext] {count}
{count}gt Go to tab page {count}. The first tab page has number one. {count}gt *CTRL-<PageUp>* *<C-PageUp>*
<C-PageUp> Go to tab page {count}. The first tab page has number one.
:tabp[revious] *:tabp* *:tabprevious* *gT* :tabp[revious] *:tabp* *:tabprevious* *gT*
@ -198,6 +200,8 @@ Diff mode works per tab page. You can see the diffs between several files
within one tab page. Other tab pages can show differences between other within one tab page. Other tab pages can show differences between other
files. files.
Variables local to a tab page start with "t:". |tabpage-variable|
The TabLeave and TabEnter autocommand events can be used to do something when The TabLeave and TabEnter autocommand events can be used to do something when
switching from one tab page to another. The exact order depends on what you switching from one tab page to another. The exact order depends on what you
are doing. When creating a new tab page this works as if you create a new are doing. When creating a new tab page this works as if you create a new

View File

@ -1042,6 +1042,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
++bad editing.txt /*++bad* ++bad editing.txt /*++bad*
++bin editing.txt /*++bin* ++bin editing.txt /*++bin*
++builtin_terms various.txt /*++builtin_terms* ++builtin_terms various.txt /*++builtin_terms*
++edit editing.txt /*++edit*
++enc editing.txt /*++enc* ++enc editing.txt /*++enc*
++ff editing.txt /*++ff* ++ff editing.txt /*++ff*
++nobin editing.txt /*++nobin* ++nobin editing.txt /*++nobin*
@ -1655,7 +1656,6 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
45.3 usr_45.txt /*45.3* 45.3 usr_45.txt /*45.3*
45.4 usr_45.txt /*45.4* 45.4 usr_45.txt /*45.4*
45.5 usr_45.txt /*45.5* 45.5 usr_45.txt /*45.5*
755 spell.txt /*755*
8g8 various.txt /*8g8* 8g8 various.txt /*8g8*
90.1 usr_90.txt /*90.1* 90.1 usr_90.txt /*90.1*
90.2 usr_90.txt /*90.2* 90.2 usr_90.txt /*90.2*
@ -1676,6 +1676,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:. cmdline.txt /*:.* :. cmdline.txt /*:.*
:/ cmdline.txt /*:\/* :/ cmdline.txt /*:\/*
:0file editing.txt /*:0file* :0file editing.txt /*:0file*
:2match pattern.txt /*:2match*
:3match pattern.txt /*:3match*
::. cmdline.txt /*::.* ::. cmdline.txt /*::.*
::8 cmdline.txt /*::8* ::8 cmdline.txt /*::8*
::e cmdline.txt /*::e* ::e cmdline.txt /*::e*
@ -2909,8 +2911,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
<C-LeftMouse> tagsrch.txt /*<C-LeftMouse>* <C-LeftMouse> tagsrch.txt /*<C-LeftMouse>*
<C-MouseDown> scroll.txt /*<C-MouseDown>* <C-MouseDown> scroll.txt /*<C-MouseDown>*
<C-MouseUp> scroll.txt /*<C-MouseUp>* <C-MouseUp> scroll.txt /*<C-MouseUp>*
<C-PageDown> os_dos.txt /*<C-PageDown>* <C-PageDown> tabpage.txt /*<C-PageDown>*
<C-PageUp> os_dos.txt /*<C-PageUp>* <C-PageUp> tabpage.txt /*<C-PageUp>*
<C-Right> motion.txt /*<C-Right>* <C-Right> motion.txt /*<C-Right>*
<C-RightMouse> tagsrch.txt /*<C-RightMouse>* <C-RightMouse> tagsrch.txt /*<C-RightMouse>*
<CR> motion.txt /*<CR>* <CR> motion.txt /*<CR>*
@ -3118,6 +3120,8 @@ C-indenting indent.txt /*C-indenting*
COMSPEC starting.txt /*COMSPEC* COMSPEC starting.txt /*COMSPEC*
CR-used-for-NL pattern.txt /*CR-used-for-NL* CR-used-for-NL pattern.txt /*CR-used-for-NL*
CTRL-6 editing.txt /*CTRL-6* CTRL-6 editing.txt /*CTRL-6*
CTRL-<PageDown> tabpage.txt /*CTRL-<PageDown>*
CTRL-<PageUp> tabpage.txt /*CTRL-<PageUp>*
CTRL-A change.txt /*CTRL-A* CTRL-A change.txt /*CTRL-A*
CTRL-B scroll.txt /*CTRL-B* CTRL-B scroll.txt /*CTRL-B*
CTRL-C pattern.txt /*CTRL-C* CTRL-C pattern.txt /*CTRL-C*
@ -3961,6 +3965,7 @@ E751 spell.txt /*E751*
E752 spell.txt /*E752* E752 spell.txt /*E752*
E753 spell.txt /*E753* E753 spell.txt /*E753*
E754 spell.txt /*E754* E754 spell.txt /*E754*
E755 spell.txt /*E755*
E756 spell.txt /*E756* E756 spell.txt /*E756*
E757 options.txt /*E757* E757 options.txt /*E757*
E758 spell.txt /*E758* E758 spell.txt /*E758*
@ -3994,6 +3999,9 @@ E782 spell.txt /*E782*
E783 spell.txt /*E783* E783 spell.txt /*E783*
E784 tabpage.txt /*E784* E784 tabpage.txt /*E784*
E785 eval.txt /*E785* E785 eval.txt /*E785*
E786 eval.txt /*E786*
E787 diff.txt /*E787*
E788 autocmd.txt /*E788*
E79 message.txt /*E79* E79 message.txt /*E79*
E80 message.txt /*E80* E80 message.txt /*E80*
E800 arabic.txt /*E800* E800 arabic.txt /*E800*
@ -4428,6 +4436,7 @@ alt intro.txt /*alt*
alt-input debugger.txt /*alt-input* alt-input debugger.txt /*alt-input*
alternate-file editing.txt /*alternate-file* alternate-file editing.txt /*alternate-file*
amiga-window starting.txt /*amiga-window* amiga-window starting.txt /*amiga-window*
anonymous-function eval.txt /*anonymous-function*
ant.vim syntax.txt /*ant.vim* ant.vim syntax.txt /*ant.vim*
ap motion.txt /*ap* ap motion.txt /*ap*
apache.vim syntax.txt /*apache.vim* apache.vim syntax.txt /*apache.vim*
@ -5398,6 +5407,10 @@ g:netrw_uid pi_netrw.txt /*g:netrw_uid*
g:netrw_use_nt_rcp pi_netrw.txt /*g:netrw_use_nt_rcp* g:netrw_use_nt_rcp pi_netrw.txt /*g:netrw_use_nt_rcp*
g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp* g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp*
g:netrw_winsize pi_netrw.txt /*g:netrw_winsize* g:netrw_winsize pi_netrw.txt /*g:netrw_winsize*
g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions*
g:tar_cmd pi_tar.txt /*g:tar_cmd*
g:tar_readoptions pi_tar.txt /*g:tar_readoptions*
g:tar_writeoptions pi_tar.txt /*g:tar_writeoptions*
g:var eval.txt /*g:var* g:var eval.txt /*g:var*
g; motion.txt /*g;* g; motion.txt /*g;*
g< message.txt /*g<* g< message.txt /*g<*
@ -6052,6 +6065,7 @@ masm.vim syntax.txt /*masm.vim*
match() eval.txt /*match()* match() eval.txt /*match()*
match-highlight pattern.txt /*match-highlight* match-highlight pattern.txt /*match-highlight*
match-parens tips.txt /*match-parens* match-parens tips.txt /*match-parens*
matcharg() eval.txt /*matcharg()*
matchend() eval.txt /*matchend()* matchend() eval.txt /*matchend()*
matchit-install usr_05.txt /*matchit-install* matchit-install usr_05.txt /*matchit-install*
matchlist() eval.txt /*matchlist()* matchlist() eval.txt /*matchlist()*
@ -6426,6 +6440,7 @@ pager message.txt /*pager*
papp.vim syntax.txt /*papp.vim* papp.vim syntax.txt /*papp.vim*
paragraph motion.txt /*paragraph* paragraph motion.txt /*paragraph*
pascal.vim syntax.txt /*pascal.vim* pascal.vim syntax.txt /*pascal.vim*
pathshorten() eval.txt /*pathshorten()*
pattern pattern.txt /*pattern* pattern pattern.txt /*pattern*
pattern-atoms pattern.txt /*pattern-atoms* pattern-atoms pattern.txt /*pattern-atoms*
pattern-multi-byte pattern.txt /*pattern-multi-byte* pattern-multi-byte pattern.txt /*pattern-multi-byte*
@ -6607,8 +6622,8 @@ recursive_mapping map.txt /*recursive_mapping*
redo undo.txt /*redo* redo undo.txt /*redo*
redo-register undo.txt /*redo-register* redo-register undo.txt /*redo-register*
ref intro.txt /*ref* ref intro.txt /*ref*
ref-toc help.txt /*ref-toc*
reference intro.txt /*reference* reference intro.txt /*reference*
reference_toc help.txt /*reference_toc*
regexp pattern.txt /*regexp* regexp pattern.txt /*regexp*
regexp-changes-5.4 version5.txt /*regexp-changes-5.4* regexp-changes-5.4 version5.txt /*regexp-changes-5.4*
register sponsor.txt /*register* register sponsor.txt /*register*
@ -6876,9 +6891,7 @@ spell-affix-chars spell.txt /*spell-affix-chars*
spell-affix-comment spell.txt /*spell-affix-comment* spell-affix-comment spell.txt /*spell-affix-comment*
spell-affix-flags spell.txt /*spell-affix-flags* spell-affix-flags spell.txt /*spell-affix-flags*
spell-affix-mbyte spell.txt /*spell-affix-mbyte* spell-affix-mbyte spell.txt /*spell-affix-mbyte*
spell-affix-nocomp spell.txt /*spell-affix-nocomp*
spell-affix-not-supported spell.txt /*spell-affix-not-supported* spell-affix-not-supported spell.txt /*spell-affix-not-supported*
spell-affix-rare spell.txt /*spell-affix-rare*
spell-affix-vim spell.txt /*spell-affix-vim* spell-affix-vim spell.txt /*spell-affix-vim*
spell-compound spell.txt /*spell-compound* spell-compound spell.txt /*spell-compound*
spell-dic-format spell.txt /*spell-dic-format* spell-dic-format spell.txt /*spell-dic-format*
@ -6913,6 +6926,7 @@ sql-completion sql.txt /*sql-completion*
sql-completion-columns sql.txt /*sql-completion-columns* sql-completion-columns sql.txt /*sql-completion-columns*
sql-completion-customization sql.txt /*sql-completion-customization* sql-completion-customization sql.txt /*sql-completion-customization*
sql-completion-dynamic sql.txt /*sql-completion-dynamic* sql-completion-dynamic sql.txt /*sql-completion-dynamic*
sql-completion-filetypes sql.txt /*sql-completion-filetypes*
sql-completion-maps sql.txt /*sql-completion-maps* sql-completion-maps sql.txt /*sql-completion-maps*
sql-completion-procedures sql.txt /*sql-completion-procedures* sql-completion-procedures sql.txt /*sql-completion-procedures*
sql-completion-static sql.txt /*sql-completion-static* sql-completion-static sql.txt /*sql-completion-static*
@ -7015,6 +7029,7 @@ system() eval.txt /*system()*
system-vimrc starting.txt /*system-vimrc* system-vimrc starting.txt /*system-vimrc*
s~ change.txt /*s~* s~ change.txt /*s~*
t motion.txt /*t* t motion.txt /*t*
t:var eval.txt /*t:var*
t_#2 term.txt /*t_#2* t_#2 term.txt /*t_#2*
t_#4 term.txt /*t_#4* t_#4 term.txt /*t_#4*
t_%1 term.txt /*t_%1* t_%1 term.txt /*t_%1*
@ -7174,6 +7189,7 @@ tab-page-intro tabpage.txt /*tab-page-intro*
tab-page-other tabpage.txt /*tab-page-other* tab-page-other tabpage.txt /*tab-page-other*
tabline-menu tabpage.txt /*tabline-menu* tabline-menu tabpage.txt /*tabline-menu*
tabpage tabpage.txt /*tabpage* tabpage tabpage.txt /*tabpage*
tabpage-variable eval.txt /*tabpage-variable*
tabpage.txt tabpage.txt /*tabpage.txt* tabpage.txt tabpage.txt /*tabpage.txt*
tabpagebuflist() eval.txt /*tabpagebuflist()* tabpagebuflist() eval.txt /*tabpagebuflist()*
tabpagenr() eval.txt /*tabpagenr()* tabpagenr() eval.txt /*tabpagenr()*
@ -7210,6 +7226,7 @@ tar-contents pi_tar.txt /*tar-contents*
tar-copyright pi_tar.txt /*tar-copyright* tar-copyright pi_tar.txt /*tar-copyright*
tar-history pi_tar.txt /*tar-history* tar-history pi_tar.txt /*tar-history*
tar-manual pi_tar.txt /*tar-manual* tar-manual pi_tar.txt /*tar-manual*
tar-options pi_tar.txt /*tar-options*
tar-usage pi_tar.txt /*tar-usage* tar-usage pi_tar.txt /*tar-usage*
tar.txt pi_tar.txt /*tar.txt* tar.txt pi_tar.txt /*tar.txt*
tcl if_tcl.txt /*tcl* tcl if_tcl.txt /*tcl*
@ -7663,6 +7680,7 @@ win16-truetype gui_w16.txt /*win16-truetype*
win16-various gui_w16.txt /*win16-various* win16-various gui_w16.txt /*win16-various*
win32 os_win32.txt /*win32* win32 os_win32.txt /*win32*
win32-!start gui_w32.txt /*win32-!start* win32-!start gui_w32.txt /*win32-!start*
win32-PATH os_win32.txt /*win32-PATH*
win32-colors gui_w32.txt /*win32-colors* win32-colors gui_w32.txt /*win32-colors*
win32-compiling os_win32.txt /*win32-compiling* win32-compiling os_win32.txt /*win32-compiling*
win32-curdir os_win32.txt /*win32-curdir* win32-curdir os_win32.txt /*win32-curdir*
@ -7682,6 +7700,7 @@ win32-win3.1 os_win32.txt /*win32-win3.1*
win32s os_win32.txt /*win32s* win32s os_win32.txt /*win32s*
winbufnr() eval.txt /*winbufnr()* winbufnr() eval.txt /*winbufnr()*
wincol() eval.txt /*wincol()* wincol() eval.txt /*wincol()*
window windows.txt /*window*
window-contents intro.txt /*window-contents* window-contents intro.txt /*window-contents*
window-exit editing.txt /*window-exit* window-exit editing.txt /*window-exit*
window-move-cursor windows.txt /*window-move-cursor* window-move-cursor windows.txt /*window-move-cursor*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0c. Last change: 2006 Mar 29 *todo.txt* For Vim version 7.0c. Last change: 2006 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,22 +30,22 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
When "search" is in 'foldopen' have [s and ]s open folds.
New Hungarian dictionary. (Laci Nemeth) New Hungarian dictionary. (Laci Nemeth)
test COMPOUNDFORBIDFLAG - Support flags on a suffix used for second level affixes.
implement use of COMPOUNDPERMITFLAG The flags may also be used for compounding. Default is an OR
implement use of CHECKCOMPOUND* flags, <compoptions> mechanism with the flags of the word.
implement using CHECKCOMPOUNDPATTERN: match words with sl_comppat[]. Adding "compset" flag on the affixes means the compound flags of the word
explain the use of affix flags, replace |spell-affix-rare| are not used?
- Set user variables to the names of the actually used user vimrc file, - implement use of CHECKCOMPOUND* flags, <compoptions> in .spl file
the first directory looked for user plugins/syntax files.
$MYVIMRC for .vimrc, $MYGVIMRC for .gvimrc, $MYRUNTIME/plugin for - Add CHECKCOMPOUNDCASE: when compounding make leading capital lower case.
runtime files? How is it supposed to work?
Also: when the environment variable exists, use it. If it doesn't
exist, set it. Requires good names: $VIM_USER_VIMRC $VIM_USER_DIR - implement using CHECKCOMPOUNDPATTERN: match words with sl_comppat[].
Add a menu item "Preferences" that does "sp $MYVIMRC".
Obey 'switchbuf' "useopen" value for windows in other tabs, e.g. for :sbuffer.
Or use another value, e.g., "usetab"?
Add more tests for all new functionality in Vim 7. Especially new functions. Add more tests for all new functionality in Vim 7. Especially new functions.
@ -641,7 +641,7 @@ Macintosh:
UnxUtils.zip archive. UnxUtils.zip archive.
Alternate one: http://www.pramodx.20m.com/tee_for_win32.htm, but Walter Alternate one: http://www.pramodx.20m.com/tee_for_win32.htm, but Walter
Briscoe says it's not as good. Briscoe says it's not as good.
8 'fillchars' doesn't work for multi-byte characters. 8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters.
8 Command line completion: buffers "foo.txt" and "../b/foo.txt", completing 8 Command line completion: buffers "foo.txt" and "../b/foo.txt", completing
":buf foo<Tab>" doesn't find the second one. (George V. Reilly) ":buf foo<Tab>" doesn't find the second one. (George V. Reilly)
7 Output for ":scriptnames" and ":breaklist" should shorten the file names: 7 Output for ":scriptnames" and ":breaklist" should shorten the file names:
@ -1090,7 +1090,6 @@ User Friendlier:
Tab pages: Tab pages:
9 Win32 GUI: menu for tab pages line.
9 GUI implementation for the tab pages line for other systems. 9 GUI implementation for the tab pages line for other systems.
8 Make GUI menu in tab pages line configurable. Like the popup menu. 8 Make GUI menu in tab pages line configurable. Like the popup menu.
8 tab pages in the session file, if "tabpages" in 'sessionoptions' 8 tab pages in the session file, if "tabpages" in 'sessionoptions'
@ -1106,28 +1105,14 @@ Tab pages:
Spell checking: Spell checking:
- Implement COMPOUNDFORBIDFLAG .
- Check out Hunspell 1.1.4. - Check out Hunspell 1.1.4.
The manpage doesn't match the source code... The manpage doesn't match the source code...
Try to make the newly added features compatible. Try to make the newly added features compatible.
what does MAXNGRAMSUGS do? what does MAXNGRAMSUGS do?
is COMPLEXPREFIXES necessary when we have flags for affixes? is COMPLEXPREFIXES necessary when we have flags for affixes?
- Look into Hungarian dictionary: hu_HU-1.0.tar.gz - Add a command the repeats ]s and z=, showing the misspelled word in its
This one doesn't match with Hunspell 1.1.4. context. Thus to spell-check a whole file.
- Add CHECKCOMPOUNDCASE: when compounding make leading capital lower case.
How is it supposed to work?
- When compounding Hunspell doesn't allow affixes inside the compound word,
only before and after it. COMPOUNDPERMITFLAG can be used to allow it.
Check Myspell and Aspell if they also work this way.
Thus a word + suffix needs a flag that it can't be used with a following
compound, and word + prefix can't be after another word in a compound.
- suggestion for "KG" to "kg" when it's keepcase. - suggestion for "KG" to "kg" when it's keepcase.
- Support flags on a suffix. Used for second level affixes, rare and
nocomp. The flags may also be used for compounding. Default is an OR
mechanism with the flags of the word. Adding "compset" on the affixes
means the compound flags of the word are not used.
Instead of "SFX a 0 add/FLAGS ." we could use "SFX a 0 add . /FLAGS" (or
support both).
- Support breakpoint character ? 0xb7 and ignore it? Makes it possible to - Support breakpoint character ? 0xb7 and ignore it? Makes it possible to
use same wordlist for hyphenation. use same wordlist for hyphenation.
- Compound word is accepted if nr of words is <= COMPOUNDWORDMAX OR nr of - Compound word is accepted if nr of words is <= COMPOUNDWORDMAX OR nr of
@ -1335,6 +1320,8 @@ Syntax highlighting:
cluster can be added to existing syntax items. cluster can be added to existing syntax items.
8 C syntax: Don't highlight {} as errors inside () when used like this: 8 C syntax: Don't highlight {} as errors inside () when used like this:
"({ something })", often used in GCC code. "({ something })", often used in GCC code.
7 Add a "startgroup" to a region. Used like "nextgroup" inside the region,
preferred item at the start of the region. (Charles Campbell)
8 When editing a new file without a name and giving it a name (by writing 8 When editing a new file without a name and giving it a name (by writing
it) and 'filetype' is not set, detect the filetype. Avoid doing it for it) and 'filetype' is not set, detect the filetype. Avoid doing it for
":wq file". ":wq file".
@ -2245,6 +2232,12 @@ Insert mode:
'cindent', 'smartindent': 'cindent', 'smartindent':
8 Aligning with "e" of "error" because of the ':' doesn't make sense:
cout << ( a ? f() : "error")
8 Wrong indent with default settings when (dl) appears in this line:
(dl)->barbar(
dk);
When "(dl)" is changed to "dl" it uses 'sw' * 2 as expected.
8 Wrong indent below ? : with (): 8 Wrong indent below ? : with ():
if ((a ? (b) : c) != 0) if ((a ? (b) : c) != 0)
aligns with ":". aligns with ":".

View File

@ -1,4 +1,4 @@
*usr_05.txt* For Vim version 7.0c. Last change: 2006 Mar 24 *usr_05.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -25,27 +25,27 @@ Table of contents: |usr_toc.txt|
*05.1* The vimrc file *vimrc-intro* *05.1* The vimrc file *vimrc-intro*
You probably got tired of typing commands that you use very often. To start You probably got tired of typing commands that you use very often. To start
with all your favorite option settings and mappings, you write them in what is Vim with all your favorite option settings and mappings, you write them in
called the vimrc file. Vim reads this file when it starts up. what is called the vimrc file. Vim executes the commands in this file when it
starts up.
If you have trouble finding your vimrc file, use this command: > If you already have a vimrc file (e.g., when your sysadmin has one setup for
you), you can edit it this way: >
:scriptnames :edit $MYVIMRC
One of the first files in the list should be called ".vimrc" or "_vimrc" and If you don't have a vimrc file yet, see |vimrc| to find out where you can
is located in your home directory.
If you don't have a vimrc file yet, see |vimrc| to find out where you can
create a vimrc file. Also, the ":version" command mentions the name of the create a vimrc file. Also, the ":version" command mentions the name of the
"user vimrc file" Vim looks for. "user vimrc file" Vim looks for.
For Unix this file is always used: > For Unix and Macintosh this file is always used and is recommended:
~/.vimrc ~/.vimrc ~
For MS-DOS and MS-Windows it is mostly one of these: > For MS-DOS and MS-Windows you can use one of these:
$HOME/_vimrc $HOME/_vimrc ~
$VIM/_vimrc $VIM/_vimrc ~
The vimrc file can contain all the commands that you type after a colon. The The vimrc file can contain all the commands that you type after a colon. The
most simple ones are for setting options. For example, if you want Vim to most simple ones are for setting options. For example, if you want Vim to

View File

@ -1,4 +1,4 @@
*usr_24.txt* For Vim version 7.0c. Last change: 2005 Apr 01 *usr_24.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -232,6 +232,32 @@ and go one directory level deeper, use CTRL-X CTRL-F again:
The results depend on what is found in your file system, of course. The The results depend on what is found in your file system, of course. The
matches are sorted alphabetically. matches are sorted alphabetically.
COMPLETING IN SOURCE CODE
Source code files are well structured. That makes it possible to do
completion in an intelligent way. In Vim this is called Omni completion. In
some other editors it's called intellisense, but that is a trademark.
The key to Omni completion is CTRL-X CTRL-O. Obviously the O stands for Omni
here, so that you can remember it easier. Let's use an example for editing C
source:
{ ~
struct foo *p; ~
p-> ~
The cursor is after "p->". Now type CTRL-X CTRL-O. Vim will offer you a list
of alternatives, which are the items that "struct foo" contains. That is
quite different from using CTRL-P, which would complete any word, while only
members of "struct foo" are valid here.
For Omni completion to work you may need to do some setup. For C code you
need to create a tags file and set the 'tags' option. That is explained
|ft-c-omni|. For other filetypes you may need to do something similar, look
below |compl-omni-filetypes|. It only works for specific filetypes. Check
the value of the 'omnifunc' option to find out if it would work.
============================================================================== ==============================================================================
*24.4* Repeating an insert *24.4* Repeating an insert

View File

@ -1,4 +1,4 @@
*usr_31.txt* For Vim version 7.0c. Last change: 2006 Mar 24 *usr_31.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -249,6 +249,11 @@ 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 it's 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
to edit the file, if you have one: >
:edit $MYGVIMRC
<
If for some reason you don't want to use the normal gvimrc file, you can If for some reason you don't want to use the normal gvimrc file, you can
specify another one with the "-U" argument: > specify another one with the "-U" argument: >

View File

@ -1,4 +1,4 @@
*usr_toc.txt* For Vim version 7.0c. Last change: 2006 Mar 24 *usr_toc.txt* For Vim version 7.0c. Last change: 2006 Apr 02
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -49,7 +49,7 @@ Making Vim Run
Reference manual Reference manual
|ref-toc| More detailed information for all commands |reference_toc| More detailed information for all commands
The user manual is available as a single, ready to print HTML and PDF file The user manual is available as a single, ready to print HTML and PDF file
here: here:

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0c. Last change: 2006 Mar 29 *version7.txt* For Vim version 7.0c. Last change: 2006 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -86,6 +86,12 @@ Minor incompatibilities:
For filetype detection: For many types, instead of ~/.dir/filename use For filetype detection: For many types, instead of ~/.dir/filename use
*/.dir/filename, so that it also works for other user's files. */.dir/filename, so that it also works for other user's files.
For quite a few filetypes the indent settings have been moved from the
filetype plugin to the indent plugin. If you used: >
:filetype plugin on
Then some indent settings may be missing. You need to use: >
:filetype plugin indent on
":0verbose" now sets 'verbose' to zero instead of one. ":0verbose" now sets 'verbose' to zero instead of one.
Removed the old and incomplete "VimBuddy" code. Removed the old and incomplete "VimBuddy" code.
@ -151,6 +157,10 @@ When defining a user command with |:command| the special items could be
abbreviated. This caused unexpected behavior, such as <li> being recognized abbreviated. This caused unexpected behavior, such as <li> being recognized
as <line1>. The items can no longer be abbreviated. as <line1>. The items can no longer be abbreviated.
When executing a FileChangedRO autocommand it is no longer allowed to switch
to another buffer or edit another file. This is to prevent crashes (the event
is triggered deep down in the code where changing buffers is not anticipated).
============================================================================== ==============================================================================
NEW FEATURES *new-7* NEW FEATURES *new-7*
@ -170,7 +180,7 @@ variable. Works for Numbers, Strings and composites of them. Then |eval()|
can be used to turn the string back into the variable value. can be used to turn the string back into the variable value.
The |:let| command can now use "+=". ":let var += expr" works like The |:let| command can now use "+=". ":let var += expr" works like
":let var = var + expr". "-=" and ".=" works in a similar way. ":let var = var + expr". "-=" and ".=" work in a similar way.
With the |:profile| command you can find out where your function or script With the |:profile| command you can find out where your function or script
wastes its time. wastes its time.
@ -277,6 +287,8 @@ window open a new tab instead.
The |--remote-tab| argument can be used to edit a file in a new tab page in an The |--remote-tab| argument can be used to edit a file in a new tab page in an
already running Vim server. already running Vim server.
Variables starting with "t:" are local to a tab page.
More info here: |tabpage| More info here: |tabpage|
The Win32 GUI tabs were implemented by Yegappan Lakshmanan. The Win32 GUI tabs were implemented by Yegappan Lakshmanan.
@ -747,6 +759,7 @@ New and extended functions: ~
|maparg()| extra argument: use abbreviation |maparg()| extra argument: use abbreviation
|mapcheck()| extra argument: use abbreviation |mapcheck()| extra argument: use abbreviation
|match()| extra argument: count |match()| extra argument: count
|matcharg()| return arguments of |:match| command
|matchend()| extra argument: count |matchend()| extra argument: count
|matchlist()| list with match and submatches of a pattern in a string |matchlist()| list with match and submatches of a pattern in a string
|matchstr()| extra argument: count |matchstr()| extra argument: count
@ -981,6 +994,11 @@ Vietnamese message translations and menu. (Phan Vinh Thinh)
Others: ~ Others: ~
The |:read| command has the |++edit| argument. This means it will use the
detected 'fileformat', 'fileencoding' and other options for the buffer. This
also fixes the problem that editing a compressed file didn't set these
options.
The Netbeans interface was updated for Sun Studio 10. The protocol number The Netbeans interface was updated for Sun Studio 10. The protocol number
goes from 2.2 to 2.3. (Gordon Prieur) goes from 2.2 to 2.3. (Gordon Prieur)
@ -1056,6 +1074,9 @@ will add a word, but exclude the part of the word that was already typed.
Ruby interface: add line number methods. (Ryan Paul) Ruby interface: add line number methods. (Ryan Paul)
The $MYVIMRC environment variable is set to the first found vimrc file.
The $MYGVIMRC environment variable is set to the first found gvimrc file.
============================================================================== ==============================================================================
IMPROVEMENTS *improvements-7* IMPROVEMENTS *improvements-7*
@ -2183,7 +2204,7 @@ Yu-sung, 2005 March 21)
Ruby interface: when inserting/deleting lines display wasn't updated. (Ryan Ruby interface: when inserting/deleting lines display wasn't updated. (Ryan
Paul) Paul)
--- fixes since Vim 6.0b --- --- fixes since Vim 7.0b ---
Getting the GCC version in configure didn't work with Solaris sed. First Getting the GCC version in configure didn't work with Solaris sed. First
strip any "darwin." and then get the version number. strip any "darwin." and then get the version number.
@ -2217,7 +2238,7 @@ apparently doesn't work everywhere. Use %H:%M:%S instead.
Typing BS at the "z=" prompt removed the prompt. Typing BS at the "z=" prompt removed the prompt.
--- fixes since Vim 6.0c --- --- fixes since Vim 7.0c ---
When jumping to another tab page the Vim window size was always set, even when When jumping to another tab page the Vim window size was always set, even when
nothing in the layout changed. nothing in the layout changed.
@ -2255,4 +2276,113 @@ line.
Win32: Set the default for 'isprint' back to the wrong default "@,~-255", Win32: Set the default for 'isprint' back to the wrong default "@,~-255",
because many people use Windows-1252 while 'encoding' is "latin1". because many people use Windows-1252 while 'encoding' is "latin1".
GTK: Added a workaround for gvim crashing when used over an untrusted ssh
link, caused by GTK doing something nasty. (Ed Catmur)
Win32: The font used for the tab page labels is too big. Use the system menu
font. (George Reilly)
Win32: Adjusting the window position and size to keep it on the screen didn't
work properly when the taskbar is on the left or top of the screen.
The installman.sh and installml.sh scripts use ${10}, that didn't work with
old shells. And use "test -f" instead of "test -e".
Win32: When 'encoding' was set in the vimrc then a directory argument for diff
mode didn't work.
GUI: at the inputlist() prompt the cursorshape was adjusted as if the windows
were still at their old position.
The parenmatch plugin didn't remember the highlighting per window.
Using ":bd" for a buffer that's the current window in another tab page caused
a crash.
For a new tab page the 'scroll' option wasn't set to a good default.
Using an end offset for a search "/pat/e" didn't work properly for multi-byte
text. (Yukihiro Nakadaira)
":s/\n/,/" doubled the text when used on the last line.
When "search" is in 'foldopen' "[s" and "]s" now open folds.
When using a numbered function "dict" can be omitted, but "self" didn't work
then. Always add FC_DICT to the function flags when it's part of a
dictionary.
When "--remote-tab" executes locally it left an empty tab page.
"gvim -u NONE", ":set cursorcolumn", "C" in the second line didn't update
text. Do update further lines even though the "$" is displayed.
VMS: Support GTK better, also enable +clientserver. (Zoltan Arpadffy)
When highlighting of statusline or tabline is changed there was no redraw to
show the effect.
Mac: Added "CFBundleIdentifier" to infplist.xml.
Added tabpage-local variables t:var.
Win32: Added double-click in tab pages line creates new tab. (Yegappan
Lakshmanan)
Motif: Added GUI tab pages line. (Yegappan Lakshmanan)
Fixed crash when 'lines' was set to 1000 in a modeline.
When init_spellfile() finds a writable directory in 'runtimepath' but it
doesn't contain a "spell" directory, create one.
Win32: executable() also finds "xxd" in the directory where Vim was started,
but "!xxd" doesn't work. Append the Vim starting directory to $PATH.
The tab page labels are shortened, directory names are reduced to a single
letter by default. Added the pathshorten() function to allow a user to do the
same.
":saveas" now resets 'readonly' if the file was successfully written.
Set $MYVIMRC file to the first found .vimrc file.
Set $MYGVIMRC file to the first found .gvimrc file.
Added menu item "Startup Settings" that edits the $MYVIMRC file
Added matcharg().
Error message E745 appeared twice. Renamed one to E786.
Fixed crash when using "au BufRead * Sexplore" and doing ":help". Was wiping
out a buffer that's still in a window.
":hardcopy" resulted in an error message when 'encoding' is "utf-8" and
'printencoding' is empty. Now it assumes latin1. (Mike Williams)
The check for the toolbar feature for Motif, depending on certain included
files, wasn't detailed enough, causing building to fail in gui_xmebw.c.
Using CTRL-E in Insert mode completion after CTRL-P inserted the first match
instead of the original text.
When displaying a UTF-8 character with a zero lower byte Vim might think the
previous character is double-wide.
The "nbsp" item of 'listchars' didn't work when 'encoding' was utf-8.
Motif: when Xm/xpm.h is missing gui_xmebw.c would not compile.
HAVE_XM_UNHIGHLIGHTT_H was missing a T.
Mac: Moved the .icns files into src/os_mac_rsrc, so that they can all be
copied at once. Adjusted the Info.plist file for three icons.
When Visual mode is active while switching to another tabpage could get ml_get
errors.
When 'list' is set, 'nowrap' the $ in the first column caused 'cursorcolumn'
to move to the right.
When a line wraps, 'cursorcolumn' was never displayed past the end of the
line.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,4 +1,4 @@
*vimball.txt* For Vim version 7.0c. Last change: 2006 Mar 24 *vimball.txt* For Vim version 7.0c. Last change: 2006 Apr 01
Vimball Archiver Vimball Archiver
@ -56,6 +56,9 @@ Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. *Vimball-copyright*
============================================================================== ==============================================================================
3. Vimball History *vimball-history* 3. Vimball History *vimball-history*
4 : Mar 31, 2006 * BufReadPost seems to fire twice; BufReadEnter
only fires once, so the "Source this file..."
message is now issued only once.
3 : Mar 20, 2006 * removed query, now requires sourcing to be 3 : Mar 20, 2006 * removed query, now requires sourcing to be
extracted (:so %). Message to that effect extracted (:so %). Message to that effect
included. included.

View File

@ -1,4 +1,4 @@
*windows.txt* For Vim version 7.0c. Last change: 2006 Mar 11 *windows.txt* For Vim version 7.0c. Last change: 2006 Apr 01
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -33,7 +33,7 @@ compile time}
disabled at compile time} disabled at compile time}
============================================================================== ==============================================================================
1. Introduction *windows-intro* 1. Introduction *windows-intro* *window*
A window is a viewport onto a buffer. You can use multiple windows on one A window is a viewport onto a buffer. You can use multiple windows on one
buffer, or several windows on different buffers. buffer, or several windows on different buffers.
@ -618,13 +618,15 @@ can also get to them with the buffer list commands, like ":bnext".
The |argument-list| is set, like with the |:next| command. The |argument-list| is set, like with the |:next| command.
The purpose of this command is that it can be used from a The purpose of this command is that it can be used from a
program that wants Vim to edit another file, e.g., a debugger. program that wants Vim to edit another file, e.g., a debugger.
When using the |:tab| modifier each argument is opened in a
tab page. The last window is used if it's empty.
{only available when compiled with the +gui feature} {only available when compiled with the +gui feature}
============================================================================== ==============================================================================
8. Do a command in all buffers or windows *list-repeat* 8. Do a command in all buffers or windows *list-repeat*
*:windo* *:windo*
:windo[!] {cmd} Execute {cmd} in each window. :windo {cmd} Execute {cmd} in each window.
It works like doing this: > It works like doing this: >
CTRL-W t CTRL-W t
:{cmd} :{cmd}

View File

@ -1,7 +1,7 @@
" Vim support file to detect file types " Vim support file to detect file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Mar 28 " Last Change: 2006 Apr 04
" Listen very carefully, I will say this only once " Listen very carefully, I will say this only once
if exists("did_load_filetypes") if exists("did_load_filetypes")
@ -146,7 +146,7 @@ au BufNewFile,BufRead *.asp
\ endif \ endif
" Grub (must be before catch *.lst) " Grub (must be before catch *.lst)
au BufNewFile,BufRead /boot/grub/menu.lst,/boot/grub/grub.conf setf grub au BufNewFile,BufRead /boot/grub/menu.lst,/boot/grub/grub.conf,/etc/grub.conf setf grub
" Assembly (all kinds) " Assembly (all kinds)
" *.lst is not pure assembly, it has two extra columns (address, byte codes) " *.lst is not pure assembly, it has two extra columns (address, byte codes)
@ -602,10 +602,10 @@ au BufNewFile,BufRead *.mas,*.master setf master
au BufNewFile,BufRead *.fs,*.ft setf forth au BufNewFile,BufRead *.fs,*.ft setf forth
" Fortran " Fortran
au BufNewFile,BufRead *.f,*.F,*.for,*.fpp,*.FPP*.ftn,*.f77,*.F77,*.f90,*.F90,*.f95,*.F95 setf fortran au BufNewFile,BufRead *.f,*.F,*.for,*.fpp,*.FPP,*.ftn,*.f77,*.F77,*.f90,*.F90,*.f95,*.F95 setf fortran
" FStab " FStab
au BufNewFile,BufRead fstab setf fstab au BufNewFile,BufRead fstab,mtab setf fstab
" GDB command files " GDB command files
au BufNewFile,BufRead .gdbinit setf gdb au BufNewFile,BufRead .gdbinit setf gdb
@ -880,7 +880,7 @@ au BufNewFile,BufRead *.ist,*.mst setf ist
au BufNewFile,BufRead *.man setf man au BufNewFile,BufRead *.man setf man
" Man config " Man config
au BufNewFile,BufRead /etc/man.conf setf manconf au BufNewFile,BufRead /etc/man.conf,man.config setf manconf
" Maple V " Maple V
au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple au BufNewFile,BufRead *.mv,*.mpl,*.mws setf maple
@ -1555,6 +1555,10 @@ au BufNewFile,BufRead *.sim setf simula
" SINDA " SINDA
au BufNewFile,BufRead *.sin,*.s85 setf sinda au BufNewFile,BufRead *.sin,*.s85 setf sinda
" SiSU
au BufNewFile,BufRead *.sst,*.ssm,*.ssi,*.-sst,*._ssi setf sisu
au BufNewFile,BufRead *.sst.meta,*.-sst.meta,*._sst.meta setf sisu
" SKILL " SKILL
au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill au BufNewFile,BufRead *.il,*.ils,*.cdf setf skill

View File

@ -1,10 +1,11 @@
" Vim settings file " Vim settings file
" Language: Fortran90 (and Fortran95, Fortran77, F and elf90) " Language: Fortran90 (and Fortran95, Fortran77, F and elf90)
" Version: 0.44 " Version: 0.45
" Last Change: 2003 May 18 " Last Change: 2006 Apr. 03
" URL: http://www.unb.ca/chem/ajit/ftplugin/fortran.vim " URL: http://www.unb.ca/chem/ajit/ftplugin/fortran.vim
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/> " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/>
" Usage: Do :help fortran-plugin from Vim " Usage: Do :help fortran-plugin from Vim
" Credits: Useful suggestions were made by Stefano Zacchiroli
" Only do these settings when not done yet for this buffer " Only do these settings when not done yet for this buffer
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
@ -26,11 +27,11 @@ if !exists("b:fortran_fixed_source")
else else
" f90 and f95 allow both fixed and free source form " f90 and f95 allow both fixed and free source form
" assume fixed source form unless signs of free source form " assume fixed source form unless signs of free source form
" are detected in the first five columns of the first 25 lines " are detected in the first five columns of the first 250 lines
" Detection becomes more accurate and time-consuming if more lines " Detection becomes more accurate and time-consuming if more lines
" are checked. Increase the limit below if you keep lots of comments at " are checked. Increase the limit below if you keep lots of comments at
" the very top of each file and you have a fast computer " the very top of each file and you have a fast computer
let s:lmax = 25 let s:lmax = 250
if ( s:lmax > line("$") ) if ( s:lmax > line("$") )
let s:lmax = line("$") let s:lmax = line("$")
endif endif
@ -73,7 +74,8 @@ endif
" Set 'formatoptions' to break comment and text lines but allow long lines " Set 'formatoptions' to break comment and text lines but allow long lines
setlocal fo+=tcql setlocal fo+=tcql
setlocal include=^#\\=\\s*include\\s\\+ setlocal include=^\\c#\\=\\s*include\\s\\+
setlocal suffixesadd+=.f95,.f90,.for,.f,.F,.f77,.ftn,.fpp
let s:cposet=&cpoptions let s:cposet=&cpoptions
set cpoptions-=C set cpoptions-=C
@ -83,6 +85,7 @@ if !exists("b:match_words")
let s:notend = '\%(\<end\s\+\)\@<!' let s:notend = '\%(\<end\s\+\)\@<!'
let s:notselect = '\%(\<select\s\+\)\@<!' let s:notselect = '\%(\<select\s\+\)\@<!'
let s:notelse = '\%(\<end\s\+\|\<else\s\+\)\@<!' let s:notelse = '\%(\<end\s\+\|\<else\s\+\)\@<!'
let s:notprocedure = '\%(\s\+procedure\>\)\@!'
let b:match_ignorecase = 1 let b:match_ignorecase = 1
let b:match_words = let b:match_words =
\ '\<select\s*case\>:' . s:notselect. '\<case\>:\<end\s*select\>,' . \ '\<select\s*case\>:' . s:notselect. '\<case\>:\<end\s*select\>,' .
@ -95,7 +98,7 @@ if !exists("b:match_words")
\ s:notend . '\<interface\>:\<end\s*interface\>,'. \ s:notend . '\<interface\>:\<end\s*interface\>,'.
\ s:notend . '\<subroutine\>:\<end\s*subroutine\>,'. \ s:notend . '\<subroutine\>:\<end\s*subroutine\>,'.
\ s:notend . '\<function\>:\<end\s*function\>,'. \ s:notend . '\<function\>:\<end\s*function\>,'.
\ s:notend . '\<module\>:\<end\s*module\>,'. \ s:notend . '\<module\>' . s:notprocedure . ':\<end\s*module\>,'.
\ s:notend . '\<program\>:\<end\s*program\>' \ s:notend . '\<program\>:\<end\s*program\>'
endif endif

View File

@ -2,7 +2,7 @@
" Language: Fortran95 (and Fortran90, Fortran77, F and elf90) " Language: Fortran95 (and Fortran90, Fortran77, F and elf90)
" Version: 0.36 " Version: 0.36
" URL: http://www.unb.ca/chem/ajit/indent/fortran.vim " URL: http://www.unb.ca/chem/ajit/indent/fortran.vim
" Last Change: 2004 Apr. 05 " Last Change: 2006 Apr. 02
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/> " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/>
" Usage: Do :help fortran-indent from Vim " Usage: Do :help fortran-indent from Vim
@ -12,9 +12,6 @@ if exists("b:did_indent")
endif endif
let b:did_indent = 1 let b:did_indent = 1
let s:cposet=&cpoptions
set cpoptions-=C
setlocal indentkeys+==~end,=~case,=~if,=~else,=~do,=~where,=~elsewhere,=~select setlocal indentkeys+==~end,=~case,=~if,=~else,=~do,=~where,=~elsewhere,=~select
setlocal indentkeys+==~endif,=~enddo,=~endwhere,=~endselect setlocal indentkeys+==~endif,=~enddo,=~endwhere,=~endselect
@ -30,11 +27,11 @@ if !exists("b:fortran_fixed_source")
else else
" f90 and f95 allow both fixed and free source form " f90 and f95 allow both fixed and free source form
" assume fixed source form unless signs of free source form " assume fixed source form unless signs of free source form
" are detected in the first five columns of the first 25 lines " are detected in the first five columns of the first 250 lines
" Detection becomes more accurate and time-consuming if more lines " Detection becomes more accurate and time-consuming if more lines
" are checked. Increase the limit below if you keep lots of comments at " are checked. Increase the limit below if you keep lots of comments at
" the very top of each file and you have a fast computer " the very top of each file and you have a fast computer
let s:lmax = 25 let s:lmax = 250
if ( s:lmax > line("$") ) if ( s:lmax > line("$") )
let s:lmax = line("$") let s:lmax = line("$")
endif endif
@ -64,6 +61,9 @@ else
endif endif
endif endif
let s:cposet=&cpoptions
set cpoptions-=C
function FortranGetIndent(lnum) function FortranGetIndent(lnum)
let ind = indent(a:lnum) let ind = indent(a:lnum)
let prevline=getline(a:lnum) let prevline=getline(a:lnum)

View File

@ -56,7 +56,7 @@ function GetPythonIndent(lnum)
" Trick: use the non-existing "dummy" variable to break out of the loop when " Trick: use the non-existing "dummy" variable to break out of the loop when
" going too far back. " going too far back.
call cursor(plnum, 1) call cursor(plnum, 1)
let parlnum = searchpair('(', '', ')', 'nbW', let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW',
\ "line('.') < " . (plnum - s:maxoff) . " ? dummy :" \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|String\\)$'") \ . " =~ '\\(Comment\\|String\\)$'")
@ -75,14 +75,14 @@ function GetPythonIndent(lnum)
" + b " + b
" + c) " + c)
call cursor(a:lnum, 1) call cursor(a:lnum, 1)
let p = searchpair('(', '', ')', 'bW', let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|String\\)$'") \ . " =~ '\\(Comment\\|String\\)$'")
if p > 0 if p > 0
if p == plnum if p == plnum
" When the start is inside parenthesis, only indent one 'shiftwidth'. " When the start is inside parenthesis, only indent one 'shiftwidth'.
let pp = searchpair('(', '', ')', 'bW', let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW',
\ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :"
\ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')"
\ . " =~ '\\(Comment\\|String\\)$'") \ . " =~ '\\(Comment\\|String\\)$'")

View File

@ -102,7 +102,7 @@ menutrans &Keymap &Tastatur-Belegung
" {{{ TOOLS / WERKZEUGE " {{{ TOOLS / WERKZEUGE
if has("spell") if has("spell")
menutrans &Spelling &Rechtschreibprüfung menutrans &Spelling &Rechtschreibung
menutrans &Spell\ Check\ On &Rechtschreibprüfung\ An menutrans &Spell\ Check\ On &Rechtschreibprüfung\ An
menutrans Spell\ Check\ &Off Rechtschreibprüfung\ &Aus menutrans Spell\ Check\ &Off Rechtschreibprüfung\ &Aus
menutrans To\ &Next\ error<Tab>]s Zum\ &Nächsten\ Fehler<Tab>]s menutrans To\ &Next\ error<Tab>]s Zum\ &Nächsten\ Fehler<Tab>]s

View File

@ -1,7 +1,7 @@
" Menu Translations: Italian / Italiano " Menu Translations: Italian / Italiano
" Maintainer: Antonio Colombo <azc10@yahoo.com> " Maintainer: Antonio Colombo <azc100@gmail.com>
" Vlad Sandrini <sator72@libero.it> " Vlad Sandrini <vlad.gently@gmail.com>
" Last Change: 2005 Aug 13 " Last Change: 2006 Apr 03
" Quit when menu translations have already been done. " Quit when menu translations have already been done.
if exists("did_menu_trans") if exists("did_menu_trans")
@ -33,6 +33,7 @@ let g:menutrans_help_dialog = "Batti un comando o una parola per cercare aiuto:\
" "
menut &Open\.\.\.<Tab>:e &Apri\.\.\.<Tab>:e menut &Open\.\.\.<Tab>:e &Apri\.\.\.<Tab>:e
menut Sp&lit-Open\.\.\.<Tab>:sp A&pri\ nuova\ Finestra\.\.\.<Tab>:sp menut Sp&lit-Open\.\.\.<Tab>:sp A&pri\ nuova\ Finestra\.\.\.<Tab>:sp
menut Open\ Tab\.\.\.<Tab>:tabnew Apri\ nuova\ &Linguetta\.\.\.<Tab>:tabnew
menut &New<Tab>:enew &Nuovo<Tab>:enew menut &New<Tab>:enew &Nuovo<Tab>:enew
menut &Close<Tab>:close &Chiudi<Tab>:close menut &Close<Tab>:close &Chiudi<Tab>:close
menut &Save<Tab>:w &Salva<Tab>:w menut &Save<Tab>:w &Salva<Tab>:w
@ -84,7 +85,7 @@ menut Always Sempre
menut Toggle\ Insert\ &Mode<Tab>:set\ im! &Modalità\ Inserimento\ /No<Tab>:set\ im! menut Toggle\ Insert\ &Mode<Tab>:set\ im! &Modalità\ Inserimento\ /No<Tab>:set\ im!
menut Toggle\ Vi\ C&ompatible<Tab>:set\ cp! C&ompatibile\ Vi\ /No<Tab>:set\ cp! menut Toggle\ Vi\ C&ompatible<Tab>:set\ cp! C&ompatibile\ Vi\ /No<Tab>:set\ cp!
menut Search\ &Path\.\.\. Ca&mmino\ di\ ricerca\.\.\. menut Search\ &Path\.\.\. &Percorso\ di\ ricerca\.\.\.
menut Ta&g\ Files\.\.\. File\ Ta&g\.\.\. menut Ta&g\ Files\.\.\. File\ Ta&g\.\.\.
" "
" Opzioni GUI " Opzioni GUI
@ -166,7 +167,7 @@ menut &Spell\ Check\ On Attiva\ &Controllo\ ortografico
menut Spell\ Check\ &Off &Disattiva\ controllo\ ortografico menut Spell\ Check\ &Off &Disattiva\ controllo\ ortografico
menut To\ &Next\ error<Tab>]s Errore\ &Seguente<tab>]s menut To\ &Next\ error<Tab>]s Errore\ &Seguente<tab>]s
menut To\ &Previous\ error<Tab>[s Errore\ &Precedente<tab>[s menut To\ &Previous\ error<Tab>[s Errore\ &Precedente<tab>[s
menut Suggest\ &Corrections<Tab>z? &Suggerimenti<Tab>z? menut Suggest\ &Corrections<Tab>z= &Suggerimenti<Tab>z=
menut &Repeat\ correction<Tab>:spellrepall &Ripeti\ correzione<Tab>:spellrepall menut &Repeat\ correction<Tab>:spellrepall &Ripeti\ correzione<Tab>:spellrepall
menut Set\ language\ to\ "en" Imposta\ lingua\ a\ "en" menut Set\ language\ to\ "en" Imposta\ lingua\ a\ "en"
menut Set\ language\ to\ "en_au" Imposta\ lingua\ a\ "en_au" menut Set\ language\ to\ "en_au" Imposta\ lingua\ a\ "en_au"

View File

@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus. " You can also use this as a start for your own set of menus.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Mar 09 " Last Change: 2006 Apr 02
" Note that ":an" (short for ":anoremenu") is often used to make a menu work " Note that ":an" (short for ":anoremenu") is often used to make a menu work
" in all modes and avoid side effects from mappings defined by the user. " in all modes and avoid side effects from mappings defined by the user.
@ -177,6 +177,28 @@ endif
an 20.425 &Edit.-SEP3- <Nop> an 20.425 &Edit.-SEP3- <Nop>
an 20.430 &Edit.Settings\ &Window :options<CR> an 20.430 &Edit.Settings\ &Window :options<CR>
an 20.435 &Edit.Startup\ &Settings :call <SID>EditVimrc()<CR>
fun! s:EditVimrc()
if $MYVIMRC != ''
let fname = "$MYVIMRC"
elseif has("win32") || has("dos32") || has("dos16") || has("os2")
if $HOME != ''
let fname = "$HOME/_vimrc"
else
let fname = "$VIM/_vimrc"
endif
elseif has("amiga")
let fname = "s:.vimrc"
else
let fname = "$HOME/.vimrc"
endif
if &mod
exe "split " . fname
else
exe "edit " . fname
endif
endfun
fun! s:FixFText() fun! s:FixFText()
" Fix text in nameless register to be used with :promptfind. " Fix text in nameless register to be used with :promptfind.

View File

@ -1,7 +1,7 @@
" Set options and add mapping such that Vim behaves a lot like MS-Windows " Set options and add mapping such that Vim behaves a lot like MS-Windows
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2006 Mar 28 " Last change: 2006 Apr 02
" bail out if this isn't wanted (mrsvim.vim uses this). " bail out if this isn't wanted (mrsvim.vim uses this).
if exists("g:skip_loading_mswin") && g:skip_loading_mswin if exists("g:skip_loading_mswin") && g:skip_loading_mswin
@ -83,6 +83,8 @@ noremap <C-A> gggH<C-O>G
inoremap <C-A> <C-O>gg<C-O>gH<C-O>G inoremap <C-A> <C-O>gg<C-O>gH<C-O>G
cnoremap <C-A> <C-C>gggH<C-O>G cnoremap <C-A> <C-C>gggH<C-O>G
onoremap <C-A> <C-C>gggH<C-O>G onoremap <C-A> <C-C>gggH<C-O>G
snoremap <C-A> <C-C>gggH<C-O>G
xnoremap <C-A> <C-C>ggVG
" CTRL-Tab is Next window " CTRL-Tab is Next window
noremap <C-Tab> <C-W>w noremap <C-Tab> <C-W>w

View File

@ -1,6 +1,6 @@
" Vim plugin for showing matching parens " Vim plugin for showing matching parens
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Mar 29 " Last Change: 2006 Apr 04
" Exit quickly when: " Exit quickly when:
" - this plugin was already loaded (or disabled) " - this plugin was already loaded (or disabled)
@ -16,8 +16,6 @@ augroup matchparen
autocmd! CursorMoved,CursorMovedI * call s:Highlight_Matching_Pair() autocmd! CursorMoved,CursorMovedI * call s:Highlight_Matching_Pair()
augroup END augroup END
let s:paren_hl_on = 0
" Skip the rest if it was already done. " Skip the rest if it was already done.
if exists("*s:Highlight_Matching_Pair") if exists("*s:Highlight_Matching_Pair")
finish finish
@ -30,9 +28,9 @@ set cpo-=C
" for any matching paren. " for any matching paren.
function! s:Highlight_Matching_Pair() function! s:Highlight_Matching_Pair()
" Remove any previous match. " Remove any previous match.
if s:paren_hl_on if exists('w:paren_hl_on') && w:paren_hl_on
3match none 3match none
let s:paren_hl_on = 0 let w:paren_hl_on = 0
endif endif
" Avoid that we remove the popup menu. " Avoid that we remove the popup menu.
@ -63,21 +61,25 @@ function! s:Highlight_Matching_Pair()
" Figure out the arguments for searchpairpos(). " Figure out the arguments for searchpairpos().
" Restrict the search to visible lines with "stopline". " Restrict the search to visible lines with "stopline".
" And avoid searching very far (e.g., for closed folds) " And avoid searching very far (e.g., for closed folds and long lines)
if i % 2 == 0 if i % 2 == 0
let s_flags = 'nW' let s_flags = 'nW'
let c2 = plist[i + 1] let c2 = plist[i + 1]
let stopline = line('w$') if has("byte_offset") && has("syntax_items") && &smc > 0
if stopline > c_lnum + 100 let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
let stopline = c_lnu + 100 let stopline = min([line('w$'), byte2line(stopbyte)])
else
let stopline = min([line('w$'), c_lnum + 100])
endif endif
else else
let s_flags = 'nbW' let s_flags = 'nbW'
let c2 = c let c2 = c
let c = plist[i - 1] let c = plist[i - 1]
let stopline = line('w0') if has("byte_offset") && has("syntax_items") && &smc > 0
if stopline < c_lnum - 100 let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
let stopline = c_lnu - 100 let stopline = max([line('w0'), byte2line(stopbyte)])
else
let stopline = max([line('w0'), c_lnum - 100])
endif endif
endif endif
if c == '[' if c == '['
@ -86,7 +88,7 @@ function! s:Highlight_Matching_Pair()
endif endif
" When not in a string or comment ignore matches inside them. " When not in a string or comment ignore matches inside them.
let s_skip ='synIDattr(synID(c_lnum, c_col - before, 0), "name") ' . let s_skip ='synIDattr(synID(line("."), col(".") - before, 0), "name") ' .
\ '=~? "string\\|comment"' \ '=~? "string\\|comment"'
execute 'if' s_skip '| let s_skip = 0 | endif' execute 'if' s_skip '| let s_skip = 0 | endif'
@ -105,7 +107,7 @@ function! s:Highlight_Matching_Pair()
if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$') if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$')
exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) .
\ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
let s:paren_hl_on = 1 let w:paren_hl_on = 1
endif endif
endfunction endfunction

View File

@ -21,7 +21,7 @@ set cpo&vim
com! -ra -na=+ -bang MkVimball call vimball#MkVimball(<line1>,<line2>,<bang>0,<f-args>) com! -ra -na=+ -bang MkVimball call vimball#MkVimball(<line1>,<line2>,<bang>0,<f-args>)
com! -na=0 UseVimball call vimball#Vimball(1) com! -na=0 UseVimball call vimball#Vimball(1)
com! -na=0 VimballList call vimball#Vimball(0) com! -na=0 VimballList call vimball#Vimball(0)
au BufReadPost *.vba echohl WarningMsg | echo "Source this file to extract it! (:so %)" | echohl None au BufEnter *.vba echohl WarningMsg | echo "Source this file to extract it! (:so %)" | echohl None
let &cpo= s:keepcpo let &cpo= s:keepcpo
unlet s:keepcpo unlet s:keepcpo

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: C " Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Jun 20 " Last Change: 2006 Apr 05
" Quit when a (custom) syntax file was already loaded " Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax") if exists("b:current_syntax")
@ -184,7 +184,7 @@ endif
if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu") if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
if exists("c_gnu") if exists("c_gnu")
syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ syn keyword cConstant __GNUC__ __FUNCTION__ __PRETTY_FUNCTION__ __func__
endif endif
syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__ syn keyword cConstant __LINE__ __FILE__ __DATE__ __TIME__ __STDC__
syn keyword cConstant __STDC_VERSION__ syn keyword cConstant __STDC_VERSION__
@ -195,6 +195,7 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN syn keyword cConstant SCHAR_MIN SINT_MIN SLONG_MIN SSHRT_MIN
syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX syn keyword cConstant SCHAR_MAX SINT_MAX SLONG_MAX SSHRT_MAX
if !exists("c_no_c99") if !exists("c_no_c99")
syn keyword cConstant __func__
syn keyword cConstant LLONG_MAX ULLONG_MAX syn keyword cConstant LLONG_MAX ULLONG_MAX
syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN syn keyword cConstant INT8_MIN INT16_MIN INT32_MIN INT64_MIN
syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX syn keyword cConstant INT8_MAX INT16_MAX INT32_MAX INT64_MAX

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: ROCKLinux .desc " Language: T2 / ROCK Linux .desc
" Maintainer: Piotr Esden-Tempski <esden@rocklinux.org> " Maintainer: René Rebe <rene@exactcode.de>, Piotr Esden-Tempski <esden@rocklinux.org>
" Last Change: 2002 Apr 23 " Last Change: 2006 Mar 30
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x: Quit when a syntax file was already loaded
@ -14,10 +14,11 @@ endif
" syntax definitions " syntax definitions
setl iskeyword+=- setl iskeyword+=-
syn keyword descFlag DIETLIBC contained syn keyword descFlag DIETLIBC KAFFE JAIL FPIC-QUIRK NO-LIBTOOL-QUIRK AUTOMAKE-QUIRK NO-AS-NEEDED NO-SSP contained
syn keyword descLicense Unknown GPL LGPL FDL MIT BSD OpenSource Free-to-use Commercial contained syn keyword descLicense Unknown GPL LGPL FDL MIT BSD OpenSource Free-to-use Commercial contained
" tags " tags
syn match descTag /^\[\(COPY\)\]/
syn match descTag /^\[\(I\|TITLE\)\]/ syn match descTag /^\[\(I\|TITLE\)\]/
syn match descTag /^\[\(T\|TEXT\)\]/ contained syn match descTag /^\[\(T\|TEXT\)\]/ contained
syn match descTag /^\[\(U\|URL\)\]/ syn match descTag /^\[\(U\|URL\)\]/
@ -29,6 +30,7 @@ syn match descTag /^\[\(E\|DEP\|DEPENDENCY\)\]/
syn match descTag /^\[\(R\|ARCH\|ARCHITECTURE\)\]/ syn match descTag /^\[\(R\|ARCH\|ARCHITECTURE\)\]/
syn match descTag /^\[\(L\|LICENSE\)\]/ contained syn match descTag /^\[\(L\|LICENSE\)\]/ contained
syn match descTag /^\[\(S\|STATUS\)\]/ syn match descTag /^\[\(S\|STATUS\)\]/
syn match descTag /^\[\(O\|CONF\)\]/
syn match descTag /^\[\(V\|VER\|VERSION\)\]/ syn match descTag /^\[\(V\|VER\|VERSION\)\]/
syn match descTag /^\[\(P\|PRI\|PRIORITY\)\]/ nextgroup=descInstall skipwhite syn match descTag /^\[\(P\|PRI\|PRIORITY\)\]/ nextgroup=descInstall skipwhite
syn match descTag /^\[\(D\|DOWN\|DOWNLOAD\)\]/ nextgroup=descSum skipwhite syn match descTag /^\[\(D\|DOWN\|DOWNLOAD\)\]/ nextgroup=descSum skipwhite
@ -36,7 +38,7 @@ syn match descTag /^\[\(D\|DOWN\|DOWNLOAD\)\]/ nextgroup=descSum skipwhite
" misc " misc
syn match descUrl /\w\+:\/\/\S\+/ syn match descUrl /\w\+:\/\/\S\+/
syn match descCategory /\w\+\/\w\+/ contained syn match descCategory /\w\+\/\w\+/ contained
syn match descEmail /<\w\+@[\.A-Za-z0-9]\+>/ syn match descEmail /<[\.A-Za-z0-9]\+@[\.A-Za-z0-9]\+>/
" priority tag " priority tag
syn match descInstallX /X/ contained syn match descInstallX /X/ contained

View File

@ -1,8 +1,8 @@
" Vim syntax file " Vim syntax file
" Language: Fortran95 (and Fortran90, Fortran77, F and elf90) " Language: Fortran95 (and Fortran90, Fortran77, F and elf90)
" Version: 0.86 " Version: 0.87
" URL: http://www.unb.ca/chem/ajit/syntax/fortran.vim " URL: http://www.unb.ca/chem/ajit/syntax/fortran.vim
" Last Change: 2003 Mar. 12 " Last Change: 2006 Apr. 04
" Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/> " Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/>
" Usage: Do :help fortran-syntax from Vim " Usage: Do :help fortran-syntax from Vim
" Credits: " Credits:
@ -74,7 +74,7 @@ if !exists("b:fortran_fixed_source")
" Detection becomes more accurate and time-consuming if more lines " Detection becomes more accurate and time-consuming if more lines
" are checked. Increase the limit below if you keep lots of comments at " are checked. Increase the limit below if you keep lots of comments at
" the very top of each file and you have a fast computer. " the very top of each file and you have a fast computer.
let b:lmax = 25 let b:lmax = 250
if ( b:lmax > line("$") ) if ( b:lmax > line("$") )
let b:lmax = line("$") let b:lmax = line("$")
endif endif
@ -94,10 +94,7 @@ endif
syn case ignore syn case ignore
if b:fortran_dialect == "f77" if b:fortran_dialect !=? "f77"
syn match fortranIdentifier "\<\a\(\a\|\d\)*\>" contains=fortranSerialNumber
else
syn match fortran90Identifier "\<\a\w*\>" contains=fortranSerialNumber
if version >= 600 if version >= 600
if b:fortran_fixed_source == 1 if b:fortran_fixed_source == 1
syn match fortranConstructName "^\s\{6,}\zs\a\w*\ze\s*:" syn match fortranConstructName "^\s\{6,}\zs\a\w*\ze\s*:"
@ -120,7 +117,9 @@ endif
syn match fortranUnitHeader "\<end\>" syn match fortranUnitHeader "\<end\>"
syn keyword fortranType character complex integer syn match fortranType "\<character\>"
syn match fortranType "\<complex\>"
syn match fortranType "\<integer\>"
syn keyword fortranType intrinsic syn keyword fortranType intrinsic
syn match fortranType "\<implicit\>" syn match fortranType "\<implicit\>"
syn keyword fortranStructure dimension syn keyword fortranStructure dimension
@ -129,7 +128,7 @@ syn match fortranUnitHeader "\<subroutine\>"
syn keyword fortranCall call syn keyword fortranCall call
syn match fortranUnitHeader "\<function\>" syn match fortranUnitHeader "\<function\>"
syn match fortranUnitHeader "\<program\>" syn match fortranUnitHeader "\<program\>"
syn keyword fortranStatement return stop syn keyword fortranKeyword return stop
syn keyword fortranConditional else then syn keyword fortranConditional else then
syn match fortranConditional "\<if\>" syn match fortranConditional "\<if\>"
syn match fortranRepeat "\<do\>" syn match fortranRepeat "\<do\>"
@ -137,7 +136,7 @@ syn match fortranRepeat "\<do\>"
syn keyword fortranTodo contained todo fixme syn keyword fortranTodo contained todo fixme
"Catch errors caused by too many right parentheses "Catch errors caused by too many right parentheses
syn region fortranParen transparent start="(" end=")" contains=ALLBUT,fortranParenError,@fortranCommentGroup,cIncluded syn region fortranParen transparent start="(" end=")" contains=ALLBUT,fortranParenError,@fortranCommentGroup,cIncluded,@spell
syn match fortranParenError ")" syn match fortranParenError ")"
syn match fortranOperator "\.\s*n\=eqv\s*\." syn match fortranOperator "\.\s*n\=eqv\s*\."
@ -146,8 +145,7 @@ syn match fortranOperator "\(+\|-\|/\|\*\)"
syn match fortranBoolean "\.\s*\(true\|false\)\s*\." syn match fortranBoolean "\.\s*\(true\|false\)\s*\."
syn keyword fortranReadWrite backspace close inquire open rewind endfile syn keyword fortranReadWrite backspace close endfile inquire open print read rewind write
syn keyword fortranReadWrite read write print
"If tabs are allowed then the left margin checks do not work "If tabs are allowed then the left margin checks do not work
if exists("fortran_have_tabs") if exists("fortran_have_tabs")
@ -156,36 +154,14 @@ else
syn match fortranTab "\t" syn match fortranTab "\t"
endif endif
syn keyword fortranIO unit file iostat access blank fmt form syn keyword fortranIO access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit
syn keyword fortranIO recl status exist opened number named name
syn keyword fortranIO sequential direct rec
syn keyword fortranIO formatted unformatted nextrec
syn keyword fortran66Intrinsic cabs ccos cexp clog csin csqrt syn keyword fortran66Intrinsic alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl
syn keyword fortran66Intrinsic dacos dasin datan datan2 dcos dcosh
syn keyword fortran66Intrinsic ddim dexp dint dlog dlog10 dmod dabs
syn keyword fortran66Intrinsic dnint dsign dsin dsinh dsqrt dtan
syn keyword fortran66Intrinsic dtanh iabs idim idnint isign idint ifix
syn keyword fortran66Intrinsic amax0 amax1 dmax1 max0 max1
syn keyword fortran66Intrinsic amin0 amin1 dmin1 min0 min1
syn keyword fortran66Intrinsic amod float sngl alog alog10
" Intrinsics provided by some vendors " Intrinsics provided by some vendors
syn keyword fortranExtraIntrinsic cdabs cdcos cdexp cdlog cdsin cdsqrt syn keyword fortranExtraIntrinsic algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama erf erfc gamma iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh
syn keyword fortranExtraIntrinsic cqabs cqcos cqexp cqlog cqsin cqsqrt
syn keyword fortranExtraIntrinsic qacos qasin qatan qatan2 qcos qcosh
syn keyword fortranExtraIntrinsic qdim qexp iqint qlog qlog10 qmod qabs
syn keyword fortranExtraIntrinsic qnint qsign qsin qsinh qsqrt qtan
syn keyword fortranExtraIntrinsic qtanh qmax1 qmin1
syn keyword fortranExtraIntrinsic dimag qimag dcmplx qcmplx dconjg qconjg
syn keyword fortranExtraIntrinsic gamma dgamma qgamma algama dlgama qlgama
syn keyword fortranExtraIntrinsic erf derf qerf erfc derfc qerfc
syn keyword fortranExtraIntrinsic dfloat
syn keyword fortran77Intrinsic abs acos aimag aint anint asin atan atan2 syn keyword fortran77Intrinsic abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh
syn keyword fortran77Intrinsic cos sin tan sinh cosh tanh exp log log10
syn keyword fortran77Intrinsic sign sqrt int cmplx nint min max conjg
syn keyword fortran77Intrinsic char ichar index
syn match fortran77Intrinsic "\<len\s*[(,]"me=s+3 syn match fortran77Intrinsic "\<len\s*[(,]"me=s+3
syn match fortran77Intrinsic "\<real\s*("me=s+4 syn match fortran77Intrinsic "\<real\s*("me=s+4
syn match fortranType "\<implicit\s\+real" syn match fortranType "\<implicit\s\+real"
@ -231,15 +207,16 @@ endif
syn keyword fortranTypeEx external syn keyword fortranTypeEx external
syn keyword fortranIOEx format syn keyword fortranIOEx format
syn keyword fortranStatementEx continue syn keyword fortranKeywordEx continue
syn match fortranStatementEx "\<go\s*to\>" syn match fortranKeywordEx "\<go\s*to\>"
syn region fortranStringEx start=+'+ end=+'+ contains=fortranContinueMark,fortranLeftMargin,fortranSerialNumber syn region fortranStringEx start=+'+ end=+'+ contains=fortranContinueMark,fortranLeftMargin,fortranSerialNumber
syn keyword fortran77IntrinsicEx dim lge lgt lle llt mod syn keyword fortran77IntrinsicEx dim lge lgt lle llt mod
syn keyword fortranStatementOb assign pause to syn keyword fortranKeywordOb assign pause to
if b:fortran_dialect != "f77" if b:fortran_dialect != "f77"
syn keyword fortranType type none syn match fortranType "\<type\>"
syn keyword fortranType none
syn keyword fortranStructure private public intent optional syn keyword fortranStructure private public intent optional
syn keyword fortranStructure pointer target allocatable syn keyword fortranStructure pointer target allocatable
@ -252,7 +229,7 @@ if b:fortran_dialect != "f77"
syn keyword fortranUnitHeader result operator assignment syn keyword fortranUnitHeader result operator assignment
syn match fortranUnitHeader "\<interface\>" syn match fortranUnitHeader "\<interface\>"
syn match fortranUnitHeader "\<recursive\>" syn match fortranUnitHeader "\<recursive\>"
syn keyword fortranStatement allocate deallocate nullify cycle exit syn keyword fortranKeyword allocate deallocate nullify cycle exit
syn match fortranConditional "\<select\>" syn match fortranConditional "\<select\>"
syn keyword fortranConditional case default where elsewhere syn keyword fortranConditional case default where elsewhere
@ -263,21 +240,9 @@ if b:fortran_dialect != "f77"
syn keyword fortranIO pad position action delim readwrite syn keyword fortranIO pad position action delim readwrite
syn keyword fortranIO eor advance nml syn keyword fortranIO eor advance nml
syn keyword fortran90Intrinsic adjustl adjustr all allocated any syn keyword fortran90Intrinsic adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack precision present product radix random_number random_seed range repeat reshape rrspacing
syn keyword fortran90Intrinsic associated bit_size btest ceiling syn keyword fortran90Intrinsic scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify
syn keyword fortran90Intrinsic count cshift date_and_time
syn keyword fortran90Intrinsic digits dot_product eoshift epsilon exponent
syn keyword fortran90Intrinsic floor fraction huge iand ibclr ibits ibset ieor
syn keyword fortran90Intrinsic ior ishft ishftc lbound len_trim
syn keyword fortran90Intrinsic matmul maxexponent maxloc maxval merge
syn keyword fortran90Intrinsic minexponent minloc minval modulo mvbits nearest
syn keyword fortran90Intrinsic pack present product radix random_number
syn match fortran90Intrinsic "\<not\>\(\s*\.\)\@!"me=s+3 syn match fortran90Intrinsic "\<not\>\(\s*\.\)\@!"me=s+3
syn keyword fortran90Intrinsic random_seed range repeat reshape rrspacing scale
syn keyword fortran90Intrinsic selected_int_kind selected_real_kind scan
syn keyword fortran90Intrinsic shape size spacing spread set_exponent
syn keyword fortran90Intrinsic tiny transpose trim ubound unpack verify
syn keyword fortran90Intrinsic precision sum system_clock
syn match fortran90Intrinsic "\<kind\>\s*[(,]"me=s+4 syn match fortran90Intrinsic "\<kind\>\s*[(,]"me=s+4
syn match fortranUnitHeader "\<end\s*function" syn match fortranUnitHeader "\<end\s*function"
@ -343,7 +308,7 @@ else
endif endif
if b:fortran_dialect != "f77" if b:fortran_dialect != "f77"
syn match fortranComment excludenl "!.*$" contains=@fortranCommentGroup syn match fortranComment excludenl "!.*$" contains=@fortranCommentGroup,@spell
endif endif
"cpp is often used with Fortran "cpp is often used with Fortran
@ -356,26 +321,27 @@ syn match cIncluded contained "<[^>]*>"
syn match cInclude "^\s*#\s*include\>\s*["<]" contains=cIncluded syn match cInclude "^\s*#\s*include\>\s*["<]" contains=cIncluded
"Synchronising limits assume that comment and continuation lines are not mixed "Synchronising limits assume that comment and continuation lines are not mixed
if (b:fortran_fixed_source == 0) if exists("fortran_fold") || exists("fortran_more_precise")
syn sync linecont "&" maxlines=40 syn sync fromstart
elseif (b:fortran_fixed_source == 0)
syn sync linecont "&" minlines=20
else else
syn sync minlines=20 syn sync minlines=20
endif endif
if version >= 600 && exists("fortran_fold") if version >= 600 && exists("fortran_fold")
syn sync fromstart
if (b:fortran_fixed_source == 1) if (b:fortran_fixed_source == 1)
syn region fortranProgram transparent fold keepend start="^\s*program\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\(program\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranModule syn region fortranProgram transparent fold keepend start="^\s*program\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\(program\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranModule
syn region fortranModule transparent fold keepend start="^\s*module\s\+\(procedure\)\@!\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\(module\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranProgram syn region fortranModule transparent fold keepend start="^\s*module\s\+\(procedure\)\@!\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\(module\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranProgram
syn region fortranFunction transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*function\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\($\|function\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule syn region fortranFunction transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*\(\(\(real \|integer \|logical \|complex \|double \s*precision \)\s*\((\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\|type\s\+(\s*\w\+\s*) \|character \((\(\s*len\s*=\)\=\s*\d\+\s*)\|(\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\=\s*function\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\($\|function\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule
syn region fortranSubroutine transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*subroutine\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\($\|subroutine\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule syn region fortranSubroutine transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*subroutine\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\($\|subroutine\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule
syn region fortranBlockData transparent fold keepend start="\<block\s*data\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\($\|block\s*data\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock syn region fortranBlockData transparent fold keepend start="\<block\s*data\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*\($\|block\s*data\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock
syn region fortranInterface transparent fold keepend extend start="^\s*interface\>" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*interface\>" contains=ALLBUT,fortranProgram,fortranModule,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock syn region fortranInterface transparent fold keepend extend start="^\s*interface\>" skip="^\([!c*]\|\s*#\).*$" excludenl end="\<end\s*interface\>" contains=ALLBUT,fortranProgram,fortranModule,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock
else else
syn region fortranProgram transparent fold keepend start="^\s*program\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\(program\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranModule syn region fortranProgram transparent fold keepend start="^\s*program\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\(program\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranModule
syn region fortranModule transparent fold keepend start="^\s*module\s\+\(procedure\)\@!\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\(module\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranProgram syn region fortranModule transparent fold keepend start="^\s*module\s\+\(procedure\)\@!\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\(module\(\s\+\z1\>\)\=\|$\)" contains=ALLBUT,fortranProgram
syn region fortranFunction transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*function\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\($\|function\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule syn region fortranFunction transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*\(\(\(real \|integer \|logical \|complex \|double \s*precision \)\s*\((\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\|type\s\+(\s*\w\+\s*) \|character \((\(\s*len\s*=\)\=\s*\d\+\s*)\|(\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\=\s*function\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\($\|function\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule
syn region fortranSubroutine transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*subroutine\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\($\|subroutine\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule syn region fortranSubroutine transparent fold keepend extend start="^\s*\(elemental \|pure \|recursive \)\=\s*subroutine\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\($\|subroutine\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule
syn region fortranBlockData transparent fold keepend start="\<block\s*data\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\($\|block\s*data\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock syn region fortranBlockData transparent fold keepend start="\<block\s*data\s\+\z(\a\w*\)" skip="^\s*[!#].*$" excludenl end="\<end\s*\($\|block\s*data\(\s\+\z1\>\)\=\)" contains=ALLBUT,fortranProgram,fortranModule,fortranSubroutine,fortranFunction,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock
syn region fortranInterface transparent fold keepend extend start="^\s*interface\>" skip="^\s*[!#].*$" excludenl end="\<end\s*interface\>" contains=ALLBUT,fortranProgram,fortranModule,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock syn region fortranInterface transparent fold keepend extend start="^\s*interface\>" skip="^\s*[!#].*$" excludenl end="\<end\s*interface\>" contains=ALLBUT,fortranProgram,fortranModule,fortran77Loop,fortranCase,fortran90Loop,fortranIfBlock
@ -422,31 +388,31 @@ if version >= 508 || !exists("did_fortran_syn_inits")
" fortranBlockData " fortranBlockData
" fortran77Loop, fortran90Loop, fortranIfBlock, fortranCase " fortran77Loop, fortran90Loop, fortranIfBlock, fortranCase
" fortranMultiCommentLines " fortranMultiCommentLines
HiLink fortranStatement Statement HiLink fortranKeyword Keyword
HiLink fortranConstructName Special HiLink fortranConstructName Identifier
HiLink fortranConditional Conditional HiLink fortranConditional Conditional
HiLink fortranRepeat Repeat HiLink fortranRepeat Repeat
HiLink fortranTodo Todo HiLink fortranTodo Todo
HiLink fortranContinueMark Todo HiLink fortranContinueMark Todo
HiLink fortranString String HiLink fortranString String
HiLink fortranNumber Number HiLink fortranNumber Number
HiLink fortranOperator Operator HiLink fortranOperator Operator
HiLink fortranBoolean Boolean HiLink fortranBoolean Boolean
HiLink fortranLabelError Error HiLink fortranLabelError Error
HiLink fortranObsolete Todo HiLink fortranObsolete Todo
HiLink fortranType Type HiLink fortranType Type
HiLink fortranStructure Type HiLink fortranStructure Type
HiLink fortranStorageClass StorageClass HiLink fortranStorageClass StorageClass
HiLink fortranCall fortranUnitHeader HiLink fortranCall fortranUnitHeader
HiLink fortranUnitHeader fortranPreCondit HiLink fortranUnitHeader fortranPreCondit
HiLink fortranReadWrite fortran90Intrinsic HiLink fortranReadWrite Keyword
HiLink fortranIO fortran90Intrinsic HiLink fortranIO Keyword
HiLink fortran95Intrinsic fortran90Intrinsic HiLink fortran95Intrinsic fortran90Intrinsic
HiLink fortran77Intrinsic fortran90Intrinsic HiLink fortran77Intrinsic fortran90Intrinsic
HiLink fortran90Intrinsic Special HiLink fortran90Intrinsic Function
if ( b:fortran_dialect == "elf" || b:fortran_dialect == "F" ) if ( b:fortran_dialect == "elf" || b:fortran_dialect == "F" )
HiLink fortranStatementOb fortranObsolete HiLink fortranKeywordOb fortranObsolete
HiLink fortran66Intrinsic fortranObsolete HiLink fortran66Intrinsic fortranObsolete
HiLink fortran77IntrinsicR fortranObsolete HiLink fortran77IntrinsicR fortranObsolete
HiLink fortranUnitHeaderR fortranObsolete HiLink fortranUnitHeaderR fortranObsolete
@ -454,47 +420,47 @@ if version >= 508 || !exists("did_fortran_syn_inits")
HiLink fortranStorageClassR fortranObsolete HiLink fortranStorageClassR fortranObsolete
HiLink fortran90StorageClassR fortranObsolete HiLink fortran90StorageClassR fortranObsolete
HiLink fortran77OperatorR fortranObsolete HiLink fortran77OperatorR fortranObsolete
HiLink fortranInclude fortranObsolete HiLink fortranInclude fortranObsolete
else else
HiLink fortranStatementOb Statement HiLink fortranKeywordOb fortranKeyword
HiLink fortran66Intrinsic fortran90Intrinsic HiLink fortran66Intrinsic fortran90Intrinsic
HiLink fortran77IntrinsicR fortran90Intrinsic HiLink fortran77IntrinsicR fortran90Intrinsic
HiLink fortranUnitHeaderR fortranPreCondit HiLink fortranUnitHeaderR fortranPreCondit
HiLink fortranTypeR fortranType HiLink fortranTypeR fortranType
HiLink fortranStorageClassR fortranStorageClass HiLink fortranStorageClassR fortranStorageClass
HiLink fortran77OperatorR fortranOperator HiLink fortran77OperatorR fortranOperator
HiLink fortranInclude Include HiLink fortranInclude Include
HiLink fortran90StorageClassR fortranStorageClass HiLink fortran90StorageClassR fortranStorageClass
endif endif
if ( b:fortran_dialect == "F" ) if ( b:fortran_dialect == "F" )
HiLink fortranLabelNumber fortranObsolete HiLink fortranLabelNumber fortranObsolete
HiLink fortranTarget fortranObsolete HiLink fortranTarget fortranObsolete
HiLink fortranFormatSpec fortranObsolete HiLink fortranFormatSpec fortranObsolete
HiLink fortranFloatDExp fortranObsolete HiLink fortranFloatDExp fortranObsolete
HiLink fortranFloatNoDec fortranObsolete HiLink fortranFloatNoDec fortranObsolete
HiLink fortranFloatIniDec fortranObsolete HiLink fortranFloatIniDec fortranObsolete
HiLink fortranFloatEndDec fortranObsolete HiLink fortranFloatEndDec fortranObsolete
HiLink fortranTypeEx fortranObsolete HiLink fortranTypeEx fortranObsolete
HiLink fortranIOEx fortranObsolete HiLink fortranIOEx fortranObsolete
HiLink fortranStatementEx fortranObsolete HiLink fortranKeywordEx fortranObsolete
HiLink fortranStringEx fortranObsolete HiLink fortranStringEx fortranObsolete
HiLink fortran77IntrinsicEx fortranObsolete HiLink fortran77IntrinsicEx fortranObsolete
HiLink fortranUnitHeaderEx fortranObsolete HiLink fortranUnitHeaderEx fortranObsolete
HiLink fortranConditionalEx fortranObsolete HiLink fortranConditionalEx fortranObsolete
HiLink fortran90IntrinsicEx fortranObsolete HiLink fortran90IntrinsicEx fortranObsolete
else else
HiLink fortranLabelNumber Special HiLink fortranLabelNumber Special
HiLink fortranTarget Special HiLink fortranTarget Special
HiLink fortranFormatSpec Identifier HiLink fortranFormatSpec Identifier
HiLink fortranFloatDExp fortranFloat HiLink fortranFloatDExp fortranFloat
HiLink fortranFloatNoDec fortranFloat HiLink fortranFloatNoDec fortranFloat
HiLink fortranFloatIniDec fortranFloat HiLink fortranFloatIniDec fortranFloat
HiLink fortranFloatEndDec fortranFloat HiLink fortranFloatEndDec fortranFloat
HiLink fortranTypeEx fortranType HiLink fortranTypeEx fortranType
HiLink fortranIOEx fortranIO HiLink fortranIOEx fortranIO
HiLink fortranStatementEx fortranStatement HiLink fortranKeywordEx fortranKeyword
HiLink fortranStringEx fortranString HiLink fortranStringEx fortranString
HiLink fortran77IntrinsicEx fortran90Intrinsic HiLink fortran77IntrinsicEx fortran90Intrinsic
HiLink fortranUnitHeaderEx fortranUnitHeader HiLink fortranUnitHeaderEx fortranUnitHeader
HiLink fortranConditionalEx fortranConditional HiLink fortranConditionalEx fortranConditional
@ -502,21 +468,18 @@ if version >= 508 || !exists("did_fortran_syn_inits")
endif endif
HiLink fortranFloat Float HiLink fortranFloat Float
HiLink fortran90Identifier fortranIdentifier HiLink fortranPreCondit PreCondit
"Uncomment the next line if you want all fortran variables to be highlighted
"HiLink fortranIdentifier Identifier
HiLink fortranPreCondit PreCondit
HiLink fortranInclude Include HiLink fortranInclude Include
HiLink cIncluded fortranString HiLink cIncluded fortranString
HiLink cInclude Include HiLink cInclude Include
HiLink cPreProc PreProc HiLink cPreProc PreProc
HiLink cPreCondit PreCondit HiLink cPreCondit PreCondit
HiLink fortranParenError Error HiLink fortranParenError Error
HiLink fortranComment Comment HiLink fortranComment Comment
HiLink fortranSerialNumber Todo HiLink fortranSerialNumber Todo
HiLink fortranTab Error HiLink fortranTab Error
" Vendor extensions " Vendor extensions
HiLink fortranExtraIntrinsic Special HiLink fortranExtraIntrinsic Function
delcommand HiLink delcommand HiLink
endif endif

View File

@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: R Help File " Language: R Help File
" Maintainer: Johannes Ranke <jranke@uni-bremen.de> " Maintainer: Johannes Ranke <jranke@uni-bremen.de>
" Last Change: 2006 Mär 06 " Last Change: 2006 Apr 05
" Version: 0.5 " Version: 0.5
" Remarks: - Now includes R syntax highlighting in the appropriate " Remarks: - Now includes R syntax highlighting in the appropriate
" sections if an r.vim file is in the same directory or in the " sections if an r.vim file is in the same directory or in the
@ -15,7 +15,7 @@
" Version Clears: {{{1 " Version Clears: {{{1
" For version 5.x: Clear all syntax items " For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded " For version 6.x and 7.x: Quit when a syntax file was already loaded
if version < 600 if version < 600
syntax clear syntax clear
elseif exists("b:current_syntax") elseif exists("b:current_syntax")
@ -36,7 +36,7 @@ let s:syntaxdir = expand("<sfile>:p:h") "look in the directory of this file
let s:rsyntax = s:syntaxdir . "/r.vim" let s:rsyntax = s:syntaxdir . "/r.vim"
if filereadable(s:rsyntax) if filereadable(s:rsyntax)
syn include @R <sfile>:p:h/r.vim syn include @R <sfile>:p:h/r.vim
elseif filereadable('/usr/share/vim/vim64/syntax/r.vim') "and debian location elseif filereadable('/usr/share/vim/vimcurrent/syntax/r.vim') "and debian location
syn include @R /usr/share/vim/vimcurrent/syntax/r.vim syn include @R /usr/share/vim/vimcurrent/syntax/r.vim
else else
syn match rhelpRComment /\#.*/ "if no r.vim is found, do comments syn match rhelpRComment /\#.*/ "if no r.vim is found, do comments
@ -46,12 +46,12 @@ syn region rhelpRcode matchgroup=Delimiter start="\\examples{" matchgroup=Delimi
syn region rhelpRcode matchgroup=Delimiter start="\\usage{" matchgroup=Delimiter transparent end=/}/ contains=@R,rhelpIdentifier syn region rhelpRcode matchgroup=Delimiter start="\\usage{" matchgroup=Delimiter transparent end=/}/ contains=@R,rhelpIdentifier
syn region rhelpRcode matchgroup=Delimiter start="\\synopsis{" matchgroup=Delimiter transparent end=/}/ contains=@R syn region rhelpRcode matchgroup=Delimiter start="\\synopsis{" matchgroup=Delimiter transparent end=/}/ contains=@R
syn region rhelpRcode matchgroup=Delimiter start="\\special{" matchgroup=Delimiter transparent end=/}/ contains=@R contained syn region rhelpRcode matchgroup=Delimiter start="\\special{" matchgroup=Delimiter transparent end=/}/ contains=@R contained
syn region rhelpRcode matchgroup=Delimiter start="\\code{" matchgroup=Delimiter transparent end=/}/ contains=@R contained syn region rhelpRcode matchgroup=Delimiter start="\\code{" matchgroup=Delimiter transparent end=/}/ contains=@R,rhelpLink contained
" Strings {{{1 " Strings {{{1
syn region rhelpString start=/"/ end=/"/ syn region rhelpString start=/"/ end=/"/
" Special TeX characters ( \$ \& \% \# \{ \} \_) {{{1 " Special characters ( \$ \& \% \# \{ \} \_) {{{1
syn match rhelpSpecialChar "\\[$&%#{}_]" syn match rhelpSpecialChar "\\[$&%#{}_]"
" Special Delimiters {{{1 " Special Delimiters {{{1

View File

@ -1,8 +1,8 @@
" Vim syntax file " Vim syntax file
" Language: Vim 7.0 script " Language: Vim 7.0 script
" Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz> " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
" Last Change: March 29, 2006 " Last Change: April 04, 2006
" Version: 7.0-37 NOT RELEASED " Version: 7.0-38
" Automatically generated keyword lists: {{{1 " Automatically generated keyword lists: {{{1
" Quit when a syntax file was already loaded {{{2 " Quit when a syntax file was already loaded {{{2
@ -55,7 +55,7 @@ syn match vimHLGroup contained "Conceal"
syn case match syn case match
" Function Names {{{2 " Function Names {{{2
syn keyword vimFuncName contained add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call changenr char2nr cindent col complete complete_add complete_check confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function garbagecollect get getbufline getbufvar getchar getcharmod getcmdline getcmdpos getcmdtype getcwd getfontname getfperm getfsize getftime getftype getline getloclist getpos getqflist getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputlist inputrestore inputsave inputsecret insert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matchend matchlist matchstr max min mkdir mode nextnonblank nr2char prevnonblank printf pumvisible range readfile reltime reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchdecl searchpair searchpairpos searchpos server2client serverlist setbufvar setcmdpos setline setloclist setpos setqflist setreg setwinvar simplify sort soundfold spellbadword spellsuggest split str2nr strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winrestview winsaveview winwidth writefile syn keyword vimFuncName contained add append argc argidx argv browse browsedir bufexists buflisted bufloaded bufname bufnr bufwinnr byte2line byteidx call changenr char2nr cindent col complete complete_add complete_check confirm copy count cscope_connection cursor deepcopy delete did_filetype diff_filler diff_hlID empty escape eval eventhandler executable exists expand expr8 extend filereadable filewritable filter finddir findfile fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreground function garbagecollect get getbufline getbufvar getchar getcharmod getcmdline getcmdpos getcmdtype getcwd getfontname getfperm getfsize getftime getftype getline getloclist getpos getqflist getreg getregtype getwinposx getwinposy getwinvar glob globpath has has_key hasmapto histadd histdel histget histnr hlexists hlID hostname iconv indent index input inputdialog inputlist inputrestore inputsave inputsecret insert isdirectory islocked items join keys len libcall libcallnr line line2byte lispindent localtime map maparg mapcheck match matcharg matchend matchlist matchstr max min mkdir mode nextnonblank nr2char pathshorten prevnonblank printf pumvisible range readfile reltime reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remove rename repeat resolve reverse search searchdecl searchpair searchpairpos searchpos server2client serverlist setbufvar setcmdpos setline setloclist setpos setqflist setreg setwinvar simplify sort soundfold spellbadword spellsuggest split str2nr strftime stridx string strlen strpart strridx strtrans submatch substitute synID synIDattr synIDtrans system tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tempname tolower toupper tr type values virtcol visualmode winbufnr wincol winheight winline winnr winrestcmd winrestview winsaveview winwidth writefile
"--- syntax above generated by mkvimvim --- "--- syntax above generated by mkvimvim ---
" Special Vim Highlighting (not automatic) {{{1 " Special Vim Highlighting (not automatic) {{{1

View File

@ -5,7 +5,7 @@
Vim to potężny edytor, który posiada wiele poleceń, zbyt dużo by Vim to potężny edytor, który posiada wiele poleceń, zbyt dużo by
wyjaśnić je wszystkie w tym tutorialu. Ten przewodnik ma nauczyć wyjaśnić je wszystkie w tym tutorialu. Ten przewodnik ma nauczyć
Cię posługiwać się wystarczająco wieloma komendami byś mógł łatwo Cię posługiwać się wystarczająco wieloma komendami byś mógł łatwo
używać Vim-a jako edytora ogólnego przeznaczenia. używać Vima jako edytora ogólnego przeznaczenia.
Czas potrzebny na ukończenie tutoriala to 25 do 30 minut i zależy Czas potrzebny na ukończenie tutoriala to 25 do 30 minut i zależy
od tego jak wiele czasu spędzisz na eksperymentowaniu. od tego jak wiele czasu spędzisz na eksperymentowaniu.
@ -15,10 +15,10 @@
wcześniej kopię tego pliku do ćwiczeń (jeśli zacząłeś komendą wcześniej kopię tego pliku do ćwiczeń (jeśli zacząłeś komendą
"vimtutor" to już pracujesz na kopii). "vimtutor" to już pracujesz na kopii).
Ważne jest, byś pamiętał, że przewodnik ten został zaprojektowany do Pamiętaj że przewodnik ten został zaprojektowany do nauki poprzez
nauki poprzez ćwiczenia. To oznacza, że musisz wykonywać polecenia ćwiczenia. Oznacza to, że musisz wykonywać polecenia by nauczyć się ich
by nauczyć się ich prawidłowo. Jeśli będziesz jedynie czytał tekst prawidłowo. Jeśli będziesz jedynie czytał tekst szybko zapomnisz wiele
szybko zapomnisz wiele poleceń! poleceń!
Teraz upewnij się, że nie masz wciśniętego CapsLocka i wciskaj j Teraz upewnij się, że nie masz wciśniętego CapsLocka i wciskaj j
tak długo dopóki Lekcja 1.1. nie wypełni całkowicie ekranu. tak długo dopóki Lekcja 1.1. nie wypełni całkowicie ekranu.
@ -45,7 +45,7 @@ Uwaga: Je
Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będziesz Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będziesz
w stanie poruszać się o wiele szybciej jak się tylko przyzwyczaisz. w stanie poruszać się o wiele szybciej jak się tylko przyzwyczaisz.
Naprawdę! Naprawdę!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 1.2.: WYCHODZENIE Z VIM-a Lekcja 1.2.: WYCHODZENIE Z VIM-a
@ -65,7 +65,7 @@ Uwaga: Klawisze kursora tak
wyjść i wrócić do edytora. wyjść i wrócić do edytora.
UWAGA: :q!<ENTER> porzuca wszelkie zmiany jakie zrobiłeś. W następnych UWAGA: :q!<ENTER> porzuca wszelkie zmiany jakie zrobiłeś. W następnych
lekcjach dowiesz się jak je zapamiętywać. lekcjach dowiesz się jak je zapamiętywać.
5. Przenieś kursor do lekcji 1.3. 5. Przenieś kursor do lekcji 1.3.
@ -150,16 +150,16 @@ UWAGA: Ucz si
1. Zakończ tutorial tak jak w lekcji 1.2.: :q! 1. Zakończ tutorial tak jak w lekcji 1.2.: :q!
2. W powłoce wydaj polecenie: vim tutor<ENTER> 2. W powłoce wydaj polecenie: vim tutor<ENTER>
"vim" jest poleceniem uruchamiającym edytor Vimm. 'tutor' to nazwa pliku "vim" jest poleceniem uruchamiającym edytor Vim. 'tutor' to nazwa pliku
jaki chcesz edytować. Użyj pliku jaki może zostać zmieniony. jaki chcesz edytować. Użyj pliku jaki może zostać zmieniony.
3. Dodaj i usuń tekst tak jak się nauczyłeś w poprzednich lekcjach. 3. Dodaj i usuń tekst tak jak się nauczyłeś w poprzednich lekcjach.
4. Zapisz plik ze zmianami w opuść Vima: :wq<ENTER> 4. Zapisz plik ze zmianami i opuść Vima: :wq<ENTER>
5. Uruchom ponownie vimtutor i przejdź do podsumowania lekcji. 5. Uruchom ponownie vimtutor i przejdź do podsumowania lekcji.
6. Po przeczytaniu wszystkich kroków i zrozumieniu ich: wykonaj je. 6. Po przeczytaniu wszystkich kroków i ich zrozumieniu: wykonaj je.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -168,21 +168,21 @@ UWAGA: Ucz si
1. Poruszasz kursorem używając "strzałek" i klawiszy hjkl . 1. Poruszasz kursorem używając "strzałek" i klawiszy hjkl .
h (w lewo) j (w dół) k (do góry) l (w prawo) h (w lewo) j (w dół) k (do góry) l (w prawo)
2. By wejść do Vim-a (z powłoki) wpisz: 2. By wejść do Vima (z powłoki) wpisz:
vim NAZWA_PLIKU<ENTER> vim NAZWA_PLIKU<ENTER>
3. By wyjść z Vim-a wpisz: 3. By wyjść z Vima wpisz:
<ESC> :q!<ENTER> by usunąc wszystkie zmiany. <ESC> :q!<ENTER> by usunąc wszystkie zmiany.
LUB: <ESC> :wq<ENTER> by zmiany zachować. LUB: <ESC> :wq<ENTER> by zmiany zachować.
4. By usunąć znak pod kursorem wciśnij: x 4. By usunąć znak pod kursorem wciśnij: x
5. By wstawić tekst przed kursorem lub dodać: 5. By wstawić tekst przed kursorem lub dodać:
i wpisz tekst <ESC> wstawi przed kursorem i wpisz tekst <ESC> wstawi przed kursorem
A wpisz tekst <ESC> doda na końcu linii A wpisz tekst <ESC> doda na końcu linii
UWAGA: Wciśnięcie <ESC> przeniesie Cię z powrotem do trybu Normal UWAGA: Wciśnięcie <ESC> przeniesie Cię z powrotem do trybu Normal
lub odwoła niechciane lub częściowo wprowadzone polecenia. lub odwoła niechciane lub częściowo wprowadzone polecenia.
Teraz możemy kontynuować i przejść do Lekcji 2. Teraz możemy kontynuować i przejść do Lekcji 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -197,11 +197,11 @@ Teraz mo
3. Przesuń kursor na początek wyrazu, które chcesz usunąć. 3. Przesuń kursor na początek wyrazu, które chcesz usunąć.
4. Wpisz dw by usunąc wyraz. 4. Wpisz dw by usunąć wyraz.
UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w . UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w .
Jeśli zobaczysz inny znak wpisałeś coś źle, wciśnij <ESC> i zacznij Jeśli zobaczysz inny znak oznacza to, że wpisałeś coś źle, wciśnij
od początku. <ESC> i zacznij od początku.
---> Jest tu parę papier wyrazów, które kamień nie należą do nożyce tego zdania. ---> Jest tu parę papier wyrazów, które kamień nie należą do nożyce tego zdania.
@ -306,13 +306,13 @@ UWAGA: Mno
** Wpisz dd aby usunąć całą linię. ** ** Wpisz dd aby usunąć całą linię. **
Z powodu częstości usuwania całych linii, projektanci VI zdecydowali, że Z powodu częstości usuwania całych linii, projektanci Vi zdecydowali, że
będzie łatwiej wpisać dwa razy d aby usunąć linię. będzie łatwiej wpisać dwa razy d aby usunąć linię.
1. Przenieś kursor do zdania poniżej. 1. Przenieś kursor do drugiego zdania z wierszyka poniżej.
2. Wpisz dd aby usunąc wiersz. 2. Wpisz dd aby usunąć wiersz.
3. Teraz przenieś się do czwartego wiersza. 3. Teraz przenieś się do czwartego wiersza.
4. Wpisz 2dd aby usunąc dwia wiersze. 4. Wpisz 2dd aby usunąc dwa wiersze.
---> 1) Róże czerwone, ---> 1) Róże czerwone,
---> 2) Błoto jest fajne, ---> 2) Błoto jest fajne,
@ -337,7 +337,7 @@ UWAGA: Mno
4. Tym razem popraw wszystkie błędy w linii używając polecenia x . 4. Tym razem popraw wszystkie błędy w linii używając polecenia x .
5. Teraz wciśnij wielkie U aby przywrócić linię do oryginalnego stanu. 5. Teraz wciśnij wielkie U aby przywrócić linię do oryginalnego stanu.
6. Teraz wciśnij u kilka razy by cofnąć U i poprzednie polecenia. 6. Teraz wciśnij u kilka razy by cofnąć U i poprzednie polecenia.
7. Teraz wpsz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R) 7. Teraz wpisz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R)
kilka razy, by cofnąć cofnięcia. kilka razy, by cofnąć cofnięcia.
---> Poopraw blędyyy w teej liniii i zaamiień je prrzez coofnij. ---> Poopraw blędyyy w teej liniii i zaamiień je prrzez coofnij.
@ -377,14 +377,14 @@ UWAGA: Mno
1. Przenieś kursor do pierwszej linii ---> poniżej. 1. Przenieś kursor do pierwszej linii ---> poniżej.
2. Wpisz dd aby usunąć linię i przechować w rejestrze Vim-a. 2. Wpisz dd aby usunąć linię i przechować w rejestrze Vima.
3. Przenieś kursor do linii c), POWYŻEJ tej gdzie usunięta linia powinna 3. Przenieś kursor do linii c), POWYŻEJ tej gdzie usunięta linia powinna
się znajdować. się znajdować.
4. Wciśnij p by wstawić linię poniżej kursora. 4. Wciśnij p by wstawić linię poniżej kursora.
5. Powtaj kroki 2. do 4. znajdą się w odpowiednim porządku. 5. Powtarzaj kroki 2. do 4. znajdą się w odpowiednim porządku.
---> d) Jak dwa aniołki. ---> d) Jak dwa aniołki.
---> b) Na dole fiołki, ---> b) Na dole fiołki,
@ -456,7 +456,7 @@ UWAGA: Pami
5. Wpisz c$ , popraw koniec wiersza i wciśnij <ESC>. 5. Wpisz c$ , popraw koniec wiersza i wciśnij <ESC>.
---> Koniec tego wiersza musi być poprawiony aby wyglądal tak jak drugi. ---> Koniec tego wiersza musi być poprawiony aby wyglądał tak jak drugi.
---> Koniec tego wiersza musi być poprawiony używając polecenia c$ . ---> Koniec tego wiersza musi być poprawiony używając polecenia c$ .
UWAGA: Możesz używać <BS> aby poprawiać błędy w czasie pisania. UWAGA: Możesz używać <BS> aby poprawiać błędy w czasie pisania.
@ -526,15 +526,15 @@ UWAGA: Mo
5. Aby wrócić gdzie byłeś wciśnij CTRL-O. Powtarzaj by wrócić dalej. CTRL-I 5. Aby wrócić gdzie byłeś wciśnij CTRL-O. Powtarzaj by wrócić dalej. CTRL-I
idzie do przodu. idzie do przodu.
UWAGA: 'błond' to nie jest metoda by przeliterować błąd; 'błond' to błąd. Uwaga: 'błond' to nie jest metoda by przeliterować błąd; 'błond' to błąd.
UWAGA: Kiedy szukanie osiągnie koniec pliku będzie kontynuowało od początku Uwaga: Kiedy szukanie osiągnie koniec pliku będzie kontynuowało od początku
o ile opcja 'wrapscan' nie została przestawiona. o ile opcja 'wrapscan' nie została przestawiona.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW Lekcja 4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW
** Wpisz % by znaleźć pasujący ),], lub } . ** ** Wpisz % by znaleźć parujący ), ], lub } . **
1. Umieść kursor na którymś z (, [, lub { w linii poniżej oznaczonej --->. 1. Umieść kursor na którymś z (, [, lub { w linii poniżej oznaczonej --->.
@ -548,7 +548,7 @@ o ile opcja 'wrapscan' nie zosta
---> To ( jest linia testowa z (, [, ] i {, } . )) ---> To ( jest linia testowa z (, [, ] i {, } . ))
UWAGA: Ta funkcja jest bardzo użyteczna w debuggowaniu programu Uwaga: Ta funkcja jest bardzo użyteczna w debuggowaniu programu
z niesparowanymi nawiasami! z niesparowanymi nawiasami!
@ -598,7 +598,7 @@ UWAGA: Ta funkcja jest bardzo u
By zamienić wszystkie stary na nowy w linii wpisz :s/stary/nowy/g By zamienić wszystkie stary na nowy w linii wpisz :s/stary/nowy/g
By zamienić frazy pomiędzy dwoma liniami # wpisz :#,#s/stary/nowy/g By zamienić frazy pomiędzy dwoma liniami # wpisz :#,#s/stary/nowy/g
By zamienić wszystkie wystąpienia w pliku wpisz :%s/stary/nowy/g By zamienić wszystkie wystąpienia w pliku wpisz :%s/stary/nowy/g
By Vim prosił Cię o potwierdzienie dodaj 'c' :%s/stary/nowy/gc By Vim prosił Cię o potwierdzenie dodaj 'c' :%s/stary/nowy/gc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 5.1.: JAK WYKONAĆ POLECENIA ZEWNĘTRZNE Lekcja 5.1.: JAK WYKONAĆ POLECENIA ZEWNĘTRZNE
@ -606,7 +606,7 @@ UWAGA: Ta funkcja jest bardzo u
** Wpisz :! a następnie zewnętrzne polecenie by je wykonać. ** ** Wpisz :! a następnie zewnętrzne polecenie by je wykonać. **
1. Wpisz znajome polecenie : by ustawić kursor na dole ekranu. To pozwala 1. Wpisz znajome polecenie : by ustawić kursor na dole ekranu. To pozwala
na wprowadzenie polecenia. na wprowadzenie komendy linii poleceń.
2. Teraz wstaw ! (wykrzyknik). To umożliwi Ci wykonanie dowolnego 2. Teraz wstaw ! (wykrzyknik). To umożliwi Ci wykonanie dowolnego
zewnętrznego polecenia powłoki. zewnętrznego polecenia powłoki.
@ -638,12 +638,12 @@ Uwaga: Wszystkie polecenia : musz
4. To polecenie zapamięta cały plik (Vim Tutor) pod nazwą TEST. 4. To polecenie zapamięta cały plik (Vim Tutor) pod nazwą TEST.
By to sprawdzić wpisz :!dir lub :!ls , żeby znowu zobaczyć listę plików. By to sprawdzić wpisz :!dir lub :!ls , żeby znowu zobaczyć listę plików.
Uwaga: Zauważ, że gdybyś teraz wyszedł z Vim-a, a następnie wszedł ponownie Uwaga: Zauważ, że gdybyś teraz wyszedł z Vima, a następnie wszedł ponownie
komendą vim TEST , plik byłby dokładną kopią tutoriala kiedy go poleceniem vim TEST , plik byłby dokładną kopią tutoriala kiedy go
zapisywałeś. zapisywałeś.
5. Teraz usuń plik wpisując: :!rm TEST 5. Teraz usuń plik wpisując (MS-DOS): :!del TEST
lub (Unix): :!rm TEST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU
@ -687,8 +687,8 @@ UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 5.3. Potem przejd
teraz dwie kopie Lekcji 5.3., oryginał i kopia z pliku. teraz dwie kopie Lekcji 5.3., oryginał i kopia z pliku.
UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład
:r !ls wczytuje wyjście polecenia ls i umieszcza je pod kursorem. :r !ls wczytuje wyjście polecenia ls i umieszcza je pod poniżej
kursora.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -703,7 +703,7 @@ UWAGA: Mo
:!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU. :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU.
2. :w NAZWA_PLIKU zapisuje obecny plik Vim-a na dysk z nazwą NAZWA_PLIKU. 2. :w NAZWA_PLIKU zapisuje obecny plik Vima na dysk z nazwą NAZWA_PLIKU.
3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU. 3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU.
@ -752,13 +752,13 @@ UWAGA: Mo
4. Dokończ wyraz tak jak w linii poniżej. Wciśnij <ESC> aby opuścić tryb 4. Dokończ wyraz tak jak w linii poniżej. Wciśnij <ESC> aby opuścić tryb
Insert. Insert.
5. Użyj e by przejść do kolejnego niedokończonego wyraze i powtarzaj kroki 5. Użyj e by przejść do kolejnego niedokończonego wyrazu i powtarzaj kroki
3. i 4. 3. i 4.
---> Ta li poz Ci ćwi dodaw teks do koń lin ---> Ta li poz Ci ćwi dodaw teks do koń lin
---> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii. ---> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii.
Uwaga: a , i and A prowadzą do trybu Insert, jedyną różnicą jest miejsce Uwaga: a , i oraz A prowadzą do trybu Insert, jedyną różnicą jest miejsce
gdzie nowe znaki będą dodawane. gdzie nowe znaki będą dodawane.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 6.3.: INNA WERSJA REPLACE (zamiana) Lekcja 6.3.: INNA WERSJA REPLACE (zamiana)
@ -789,7 +789,7 @@ UWAGA: Tryb Replace jest jak tryb Insert, ale ka
** użyj operatora y aby skopiować tekst i p aby go wkleić ** ** użyj operatora y aby skopiować tekst i p aby go wkleić **
1. Przejdź do linii oznaczonej ---> i umieśc kursor za "a)". 1. Przejdź do linii oznaczonej ---> i umieść kursor za "a)".
2. Wejdź w tryb Visual v i przenieś kursor na początek "pierwszy". 2. Wejdź w tryb Visual v i przenieś kursor na początek "pierwszy".
@ -799,8 +799,8 @@ UWAGA: Tryb Replace jest jak tryb Insert, ale ka
5. Wciśnij p aby wpakować (paste) tekst. Dodaj: a drugi<ESC> . 5. Wciśnij p aby wpakować (paste) tekst. Dodaj: a drugi<ESC> .
6. Użyj trybu Visual aby wybrać " element.", yankuj go y , przejdź do końca 6. Użyj trybu Wizualnego aby wybrać " element.", yankuj go y , przejdź do
następnej linii j$ i upakuj tam tekst z p . końca następnej linii j$ i upakuj tam tekst z p .
---> a) to jest pierwszy element. ---> a) to jest pierwszy element.
b) b)
@ -818,7 +818,7 @@ Uwaga: mo
2. Ustaw opcję 'ic' (Ignore case -- ignoruj wielkość liter) poprzez 2. Ustaw opcję 'ic' (Ignore case -- ignoruj wielkość liter) poprzez
wpisanie: :set ic wpisanie: :set ic
3. Teraz szukaj 'ignore' ponownie wciskując: n 3. Teraz szukaj 'ignore' ponownie wciskając: n
Zauważ, że Ignore i IGNORE także teraz znalezione. Zauważ, że Ignore i IGNORE także teraz znalezione.
4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is 4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is
@ -835,16 +835,18 @@ Uwaga: Aby ignorowa
1. Wpisanie o otwiera linię PONIŻEJ kursora. 1. Wpisanie o otwiera linię PONIŻEJ kursora.
Wpisanie wielkiego O otwiera linię POWYŻEJ kursora. Wpisanie O otwiera linię POWYŻEJ kursora.
2. Wpisz a by wstawić tekst ZA znakiem na, którym jest kursor.
Wpisanie wielkiego A dodaje tekst na końcu linii. 2. Wpisanie a by wstawić tekst ZA znakiem na, którym jest kursor.
Wpisanie A dodaje tekst na końcu linii.
3. Polecenie e przenosi do końca wyrazu. 3. Polecenie e przenosi do końca wyrazu.
4. Operato y yankuje (kopiuje) tekst, p pakuje (wkleja, paste) go. 4. Operator y yankuje (kopiuje) tekst, p pakuje (wkleja, paste) go.
5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki
nie zostanie wciśnięty <ESC>. nie zostanie wciśnięty <ESC>.
6. Wpisanie ":set xxx" ustawia opcję "xxx". Nietkóre opcje: 6. Wpisanie ":set xxx" ustawia opcję "xxx". Nietkóre opcje:
'ic' 'ignorecase' ignoruj wielkość znaków 'ic' 'ignorecase' ignoruj wielkość znaków
'is' 'incsearch' pokaż częściowe dopasowania 'is' 'incsearch' pokaż częściowe dopasowania
'hls' 'hlsearch' podświetl wszystkie dopasowania 'hls' 'hlsearch' podświetl wszystkie dopasowania
Możesz użyć zarówno długiej jak i krótkiej formy. Możesz użyć zarówno długiej jak i krótkiej formy.
7. Dodaj "no" aby wyłączyć opcję: :set noic 7. Dodaj "no" aby wyłączyć opcję: :set noic
@ -854,14 +856,14 @@ Uwaga: Aby ignorowa
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LEKCJA 7.1. JAK UZYSKAĆ POMOC LEKCJA 7.1. JAK UZYSKAĆ POMOC
** Użycie systemu pomocy on-line ** ** Użycie systemu pomocy on-line **
Vim posiada bardzo dobry system pomocy on-line. By zacząć spróbuj jednej Vim posiada bardzo dobry system pomocy on-line. By zacząć spróbuj jednej
z trzech możliwości: z trzech możliwości:
- wciśnij klawisz <HELP> (jeśli takowy posiadasz) - wciśnij klawisz <HELP> (jeśli taki masz)
- wciśnij klawisz <F1> (jeśli takowy posiadasz) - wciśnij klawisz <F1> (jeśli taki masz)
- wpisz :help<ENTER> - wpisz :help<ENTER>
Przeczytaj tekst w oknie pomocy aby dowiedzieć się jak działa pomoc. Przeczytaj tekst w oknie pomocy aby dowiedzieć się jak działa pomoc.
@ -878,7 +880,7 @@ Uwaga: Aby ignorowa
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO
** Włącz możliwości Vim-a ** ** Włącz możliwości Vima **
Vim ma o wiele więcej możliwości niż Vi, ale większość z nich jest domyślnie Vim ma o wiele więcej możliwości niż Vi, ale większość z nich jest domyślnie
wyłączona. Jeśli chcesz włączyć te możliwości na starcie musisz utworzyć wyłączona. Jeśli chcesz włączyć te możliwości na starcie musisz utworzyć
@ -943,23 +945,23 @@ UWAGA: Uzupe
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tutaj się kończy tutorial Vim-a. Został on pomyślany tak aby dać krótki Tutaj się kończy tutorial Vima. Został on pomyślany tak aby dać krótki
przegląd jego możliwości, wystarczający byś mógł go używać. Jest on przegląd jego możliwości, wystarczający byś mógł go używać. Jest on
daleki od kompletności ponieważ Vim ma o wiele, wiele więcej poleceń. daleki od kompletności ponieważ Vim ma o wiele, wiele więcej poleceń.
Dla dalszej nauki rekomendujemy książkę: Dla dalszej nauki rekomendujemy książkę:
Vim - Vi Improved - autor Steve Oualline Vim - Vi Improved - autor Steve Oualline
Wydawca: New Riders Wydawca: New Riders
Pierwsza ksiązka całkowicie poświęcona Vim-owi. Użyteczna zwłaszcza dla Pierwsza ksiązka całkowicie poświęcona Vimowi. Użyteczna zwłaszcza dla
początkujących. Zawiera wiele przykładów i ilustracji. początkujących. Zawiera wiele przykładów i ilustracji.
Zobacz http://iccf-holland.org./click5.html Zobacz http://iccf-holland.org./click5.html
Ta książka jest starsza i bardziej o Vi niż o Vim-ie, ale także warta Starsza pozycja i bardziej o Vi niż o Vimie, ale także warta
polecenia: polecenia:
Learning the Vi Editor - autor Linda Lamb Learning the Vi Editor - autor Linda Lamb
Wydawca: O'Reilly & Associates Inc. Wydawca: O'Reilly & Associates Inc.
To dobra książka by dowiedzieć się niemal wszystkiego co chciałbyś zrobić To dobra książka by dowiedzieć się niemal wszystkiego co chciałbyś zrobić
z Vi. Szósta edycja zawiera też informacje o Vim-ie. z Vi. Szósta edycja zawiera też informacje o Vimie.
Po polsku wydano: Po polsku wydano:
Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins
@ -967,10 +969,10 @@ UWAGA: Uzupe
ISBN: 83-7197-472-8 ISBN: 83-7197-472-8
http://helion.pl/ksiazki/vilek.htm http://helion.pl/ksiazki/vilek.htm
Jest to książeczka zawierająca spis poleceń vi i jego najważniejszych Jest to książeczka zawierająca spis poleceń vi i jego najważniejszych
klonów (między innymi Vim-a). klonów (między innymi Vima).
Edytor vi - autorzy Linda Lamb i Arnold Robbins Edytor vi - autorzy Linda Lamb i Arnold Robbins
Wydawca: Helion 2001 (O'Reilly) - wg 6 ang. wydania Wydawca: Helion 2001 (O'Reilly) - wg 6. ang. wydania
ISBN: 83-7197-539-2 ISBN: 83-7197-539-2
http://helion.pl/ksiazki/viedyt.htm http://helion.pl/ksiazki/viedyt.htm
Rozszerzona wersja Learning the Vi Editor w polskim tłumaczeniu. Rozszerzona wersja Learning the Vi Editor w polskim tłumaczeniu.
@ -980,7 +982,7 @@ UWAGA: Uzupe
Colorado State University. Colorado State University.
E-mail: bware@mines.colorado.edu. E-mail: bware@mines.colorado.edu.
Zmodyfikowane dla Vim-a przez Brama Moolenaara. Zmodyfikowane dla Vima przez Brama Moolenaara.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -988,4 +990,5 @@ UWAGA: Uzupe
Sierpień 2001, Sierpień 2001,
rev. Marzec 2002 rev. Marzec 2002
2nd rev. Wrzesień 2004 2nd rev. Wrzesień 2004
3rd rev. Marzec 2006
Wszelkie uwagi proszę kierować na: mikmach@wp.pl Wszelkie uwagi proszę kierować na: mikmach@wp.pl

View File

@ -5,7 +5,7 @@
Vim to potężny edytor, który posiada wiele poleceń, zbyt dużo by Vim to potężny edytor, który posiada wiele poleceń, zbyt dużo by
wyjaśnić je wszystkie w tym tutorialu. Ten przewodnik ma nauczyć wyjaśnić je wszystkie w tym tutorialu. Ten przewodnik ma nauczyć
Cię posługiwać się wystarczająco wieloma komendami byś mógł łatwo Cię posługiwać się wystarczająco wieloma komendami byś mógł łatwo
używać Vim-a jako edytora ogólnego przeznaczenia. używać Vima jako edytora ogólnego przeznaczenia.
Czas potrzebny na ukończenie tutoriala to 25 do 30 minut i zależy Czas potrzebny na ukończenie tutoriala to 25 do 30 minut i zależy
od tego jak wiele czasu spędzisz na eksperymentowaniu. od tego jak wiele czasu spędzisz na eksperymentowaniu.
@ -15,10 +15,10 @@
wcześniej kopię tego pliku do ćwiczeń (jeśli zacząłeś komendą wcześniej kopię tego pliku do ćwiczeń (jeśli zacząłeś komendą
"vimtutor" to już pracujesz na kopii). "vimtutor" to już pracujesz na kopii).
Ważne jest, byś pamiętał, że przewodnik ten został zaprojektowany do Pamiętaj że przewodnik ten został zaprojektowany do nauki poprzez
nauki poprzez ćwiczenia. To oznacza, że musisz wykonywać polecenia ćwiczenia. Oznacza to, że musisz wykonywać polecenia by nauczyć się ich
by nauczyć się ich prawidłowo. Jeśli będziesz jedynie czytał tekst prawidłowo. Jeśli będziesz jedynie czytał tekst szybko zapomnisz wiele
szybko zapomnisz wiele poleceń! poleceń!
Teraz upewnij się, że nie masz wciśniętego CapsLocka i wciskaj j Teraz upewnij się, że nie masz wciśniętego CapsLocka i wciskaj j
tak długo dopóki Lekcja 1.1. nie wypełni całkowicie ekranu. tak długo dopóki Lekcja 1.1. nie wypełni całkowicie ekranu.
@ -45,7 +45,7 @@ Uwaga: Je
Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będziesz Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będziesz
w stanie poruszać się o wiele szybciej jak się tylko przyzwyczaisz. w stanie poruszać się o wiele szybciej jak się tylko przyzwyczaisz.
Naprawdę! Naprawdę!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 1.2.: WYCHODZENIE Z VIM-a Lekcja 1.2.: WYCHODZENIE Z VIM-a
@ -65,7 +65,7 @@ Uwaga: Klawisze kursora tak
wyjść i wrócić do edytora. wyjść i wrócić do edytora.
UWAGA: :q!<ENTER> porzuca wszelkie zmiany jakie zrobiłeś. W następnych UWAGA: :q!<ENTER> porzuca wszelkie zmiany jakie zrobiłeś. W następnych
lekcjach dowiesz się jak je zapamiętywać. lekcjach dowiesz się jak je zapamiętywać.
5. Przenieś kursor do lekcji 1.3. 5. Przenieś kursor do lekcji 1.3.
@ -150,16 +150,16 @@ UWAGA: Ucz si
1. Zakończ tutorial tak jak w lekcji 1.2.: :q! 1. Zakończ tutorial tak jak w lekcji 1.2.: :q!
2. W powłoce wydaj polecenie: vim tutor<ENTER> 2. W powłoce wydaj polecenie: vim tutor<ENTER>
"vim" jest poleceniem uruchamiającym edytor Vimm. 'tutor' to nazwa pliku "vim" jest poleceniem uruchamiającym edytor Vim. 'tutor' to nazwa pliku
jaki chcesz edytować. Użyj pliku jaki może zostać zmieniony. jaki chcesz edytować. Użyj pliku jaki może zostać zmieniony.
3. Dodaj i usuń tekst tak jak się nauczyłeś w poprzednich lekcjach. 3. Dodaj i usuń tekst tak jak się nauczyłeś w poprzednich lekcjach.
4. Zapisz plik ze zmianami w opuść Vima: :wq<ENTER> 4. Zapisz plik ze zmianami i opuść Vima: :wq<ENTER>
5. Uruchom ponownie vimtutor i przejdź do podsumowania lekcji. 5. Uruchom ponownie vimtutor i przejdź do podsumowania lekcji.
6. Po przeczytaniu wszystkich kroków i zrozumieniu ich: wykonaj je. 6. Po przeczytaniu wszystkich kroków i ich zrozumieniu: wykonaj je.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -168,21 +168,21 @@ UWAGA: Ucz si
1. Poruszasz kursorem używając "strzałek" i klawiszy hjkl . 1. Poruszasz kursorem używając "strzałek" i klawiszy hjkl .
h (w lewo) j (w dół) k (do góry) l (w prawo) h (w lewo) j (w dół) k (do góry) l (w prawo)
2. By wejść do Vim-a (z powłoki) wpisz: 2. By wejść do Vima (z powłoki) wpisz:
vim NAZWA_PLIKU<ENTER> vim NAZWA_PLIKU<ENTER>
3. By wyjść z Vim-a wpisz: 3. By wyjść z Vima wpisz:
<ESC> :q!<ENTER> by usunąc wszystkie zmiany. <ESC> :q!<ENTER> by usunąc wszystkie zmiany.
LUB: <ESC> :wq<ENTER> by zmiany zachować. LUB: <ESC> :wq<ENTER> by zmiany zachować.
4. By usunąć znak pod kursorem wciśnij: x 4. By usunąć znak pod kursorem wciśnij: x
5. By wstawić tekst przed kursorem lub dodać: 5. By wstawić tekst przed kursorem lub dodać:
i wpisz tekst <ESC> wstawi przed kursorem i wpisz tekst <ESC> wstawi przed kursorem
A wpisz tekst <ESC> doda na końcu linii A wpisz tekst <ESC> doda na końcu linii
UWAGA: Wciśnięcie <ESC> przeniesie Cię z powrotem do trybu Normal UWAGA: Wciśnięcie <ESC> przeniesie Cię z powrotem do trybu Normal
lub odwoła niechciane lub częściowo wprowadzone polecenia. lub odwoła niechciane lub częściowo wprowadzone polecenia.
Teraz możemy kontynuować i przejść do Lekcji 2. Teraz możemy kontynuować i przejść do Lekcji 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -197,11 +197,11 @@ Teraz mo
3. Przesuń kursor na początek wyrazu, które chcesz usunąć. 3. Przesuń kursor na początek wyrazu, które chcesz usunąć.
4. Wpisz dw by usunąc wyraz. 4. Wpisz dw by usunąć wyraz.
UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w . UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w .
Jeśli zobaczysz inny znak wpisałeś coś źle, wciśnij <ESC> i zacznij Jeśli zobaczysz inny znak oznacza to, że wpisałeś coś źle, wciśnij
od początku. <ESC> i zacznij od początku.
---> Jest tu parę papier wyrazów, które kamień nie należą do nożyce tego zdania. ---> Jest tu parę papier wyrazów, które kamień nie należą do nożyce tego zdania.
@ -306,13 +306,13 @@ UWAGA: Mno
** Wpisz dd aby usunąć całą linię. ** ** Wpisz dd aby usunąć całą linię. **
Z powodu częstości usuwania całych linii, projektanci VI zdecydowali, że Z powodu częstości usuwania całych linii, projektanci Vi zdecydowali, że
będzie łatwiej wpisać dwa razy d aby usunąć linię. będzie łatwiej wpisać dwa razy d aby usunąć linię.
1. Przenieś kursor do zdania poniżej. 1. Przenieś kursor do drugiego zdania z wierszyka poniżej.
2. Wpisz dd aby usunąc wiersz. 2. Wpisz dd aby usunąć wiersz.
3. Teraz przenieś się do czwartego wiersza. 3. Teraz przenieś się do czwartego wiersza.
4. Wpisz 2dd aby usunąc dwia wiersze. 4. Wpisz 2dd aby usunąc dwa wiersze.
---> 1) Róże są czerwone, ---> 1) Róże są czerwone,
---> 2) Błoto jest fajne, ---> 2) Błoto jest fajne,
@ -337,7 +337,7 @@ UWAGA: Mno
4. Tym razem popraw wszystkie błędy w linii używając polecenia x . 4. Tym razem popraw wszystkie błędy w linii używając polecenia x .
5. Teraz wciśnij wielkie U aby przywrócić linię do oryginalnego stanu. 5. Teraz wciśnij wielkie U aby przywrócić linię do oryginalnego stanu.
6. Teraz wciśnij u kilka razy by cofnąć U i poprzednie polecenia. 6. Teraz wciśnij u kilka razy by cofnąć U i poprzednie polecenia.
7. Teraz wpsz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R) 7. Teraz wpisz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R)
kilka razy, by cofnąć cofnięcia. kilka razy, by cofnąć cofnięcia.
---> Poopraw blędyyy w teej liniii i zaamiień je prrzez coofnij. ---> Poopraw blędyyy w teej liniii i zaamiień je prrzez coofnij.
@ -377,14 +377,14 @@ UWAGA: Mno
1. Przenieś kursor do pierwszej linii ---> poniżej. 1. Przenieś kursor do pierwszej linii ---> poniżej.
2. Wpisz dd aby usunąć linię i przechować ją w rejestrze Vim-a. 2. Wpisz dd aby usunąć linię i przechować ją w rejestrze Vima.
3. Przenieś kursor do linii c), POWYŻEJ tej gdzie usunięta linia powinna 3. Przenieś kursor do linii c), POWYŻEJ tej gdzie usunięta linia powinna
się znajdować. się znajdować.
4. Wciśnij p by wstawić linię poniżej kursora. 4. Wciśnij p by wstawić linię poniżej kursora.
5. Powtaj kroki 2. do 4. aż znajdą się w odpowiednim porządku. 5. Powtarzaj kroki 2. do 4. aż znajdą się w odpowiednim porządku.
---> d) Jak dwa aniołki. ---> d) Jak dwa aniołki.
---> b) Na dole fiołki, ---> b) Na dole fiołki,
@ -456,7 +456,7 @@ UWAGA: Pami
5. Wpisz c$ , popraw koniec wiersza i wciśnij <ESC>. 5. Wpisz c$ , popraw koniec wiersza i wciśnij <ESC>.
---> Koniec tego wiersza musi być poprawiony aby wyglądal tak jak drugi. ---> Koniec tego wiersza musi być poprawiony aby wyglądał tak jak drugi.
---> Koniec tego wiersza musi być poprawiony używając polecenia c$ . ---> Koniec tego wiersza musi być poprawiony używając polecenia c$ .
UWAGA: Możesz używać <BS> aby poprawiać błędy w czasie pisania. UWAGA: Możesz używać <BS> aby poprawiać błędy w czasie pisania.
@ -526,15 +526,15 @@ UWAGA: Mo
5. Aby wrócić gdzie byłeś wciśnij CTRL-O. Powtarzaj by wrócić dalej. CTRL-I 5. Aby wrócić gdzie byłeś wciśnij CTRL-O. Powtarzaj by wrócić dalej. CTRL-I
idzie do przodu. idzie do przodu.
UWAGA: 'błond' to nie jest metoda by przeliterować błąd; 'błond' to błąd. Uwaga: 'błond' to nie jest metoda by przeliterować błąd; 'błond' to błąd.
UWAGA: Kiedy szukanie osiągnie koniec pliku będzie kontynuowało od początku Uwaga: Kiedy szukanie osiągnie koniec pliku będzie kontynuowało od początku
o ile opcja 'wrapscan' nie została przestawiona. o ile opcja 'wrapscan' nie została przestawiona.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW Lekcja 4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW
** Wpisz % by znaleźć pasujący ),], lub } . ** ** Wpisz % by znaleźć parujący ), ], lub } . **
1. Umieść kursor na którymś z (, [, lub { w linii poniżej oznaczonej --->. 1. Umieść kursor na którymś z (, [, lub { w linii poniżej oznaczonej --->.
@ -548,7 +548,7 @@ o ile opcja 'wrapscan' nie zosta
---> To ( jest linia testowa z (, [, ] i {, } . )) ---> To ( jest linia testowa z (, [, ] i {, } . ))
UWAGA: Ta funkcja jest bardzo użyteczna w debuggowaniu programu Uwaga: Ta funkcja jest bardzo użyteczna w debuggowaniu programu
z niesparowanymi nawiasami! z niesparowanymi nawiasami!
@ -598,7 +598,7 @@ UWAGA: Ta funkcja jest bardzo u
By zamienić wszystkie stary na nowy w linii wpisz :s/stary/nowy/g By zamienić wszystkie stary na nowy w linii wpisz :s/stary/nowy/g
By zamienić frazy pomiędzy dwoma liniami # wpisz :#,#s/stary/nowy/g By zamienić frazy pomiędzy dwoma liniami # wpisz :#,#s/stary/nowy/g
By zamienić wszystkie wystąpienia w pliku wpisz :%s/stary/nowy/g By zamienić wszystkie wystąpienia w pliku wpisz :%s/stary/nowy/g
By Vim prosił Cię o potwierdzienie dodaj 'c' :%s/stary/nowy/gc By Vim prosił Cię o potwierdzenie dodaj 'c' :%s/stary/nowy/gc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 5.1.: JAK WYKONAĆ POLECENIA ZEWNĘTRZNE Lekcja 5.1.: JAK WYKONAĆ POLECENIA ZEWNĘTRZNE
@ -606,7 +606,7 @@ UWAGA: Ta funkcja jest bardzo u
** Wpisz :! a następnie zewnętrzne polecenie by je wykonać. ** ** Wpisz :! a następnie zewnętrzne polecenie by je wykonać. **
1. Wpisz znajome polecenie : by ustawić kursor na dole ekranu. To pozwala 1. Wpisz znajome polecenie : by ustawić kursor na dole ekranu. To pozwala
na wprowadzenie polecenia. na wprowadzenie komendy linii poleceń.
2. Teraz wstaw ! (wykrzyknik). To umożliwi Ci wykonanie dowolnego 2. Teraz wstaw ! (wykrzyknik). To umożliwi Ci wykonanie dowolnego
zewnętrznego polecenia powłoki. zewnętrznego polecenia powłoki.
@ -638,12 +638,12 @@ Uwaga: Wszystkie polecenia : musz
4. To polecenie zapamięta cały plik (Vim Tutor) pod nazwą TEST. 4. To polecenie zapamięta cały plik (Vim Tutor) pod nazwą TEST.
By to sprawdzić wpisz :!dir lub :!ls , żeby znowu zobaczyć listę plików. By to sprawdzić wpisz :!dir lub :!ls , żeby znowu zobaczyć listę plików.
Uwaga: Zauważ, że gdybyś teraz wyszedł z Vim-a, a następnie wszedł ponownie Uwaga: Zauważ, że gdybyś teraz wyszedł z Vima, a następnie wszedł ponownie
komendą vim TEST , plik byłby dokładną kopią tutoriala kiedy go poleceniem vim TEST , plik byłby dokładną kopią tutoriala kiedy go
zapisywałeś. zapisywałeś.
5. Teraz usuń plik wpisując: :!rm TEST 5. Teraz usuń plik wpisując (MS-DOS): :!del TEST
lub (Unix): :!rm TEST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU
@ -687,8 +687,8 @@ UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 5.3. Potem przejd
teraz są dwie kopie Lekcji 5.3., oryginał i kopia z pliku. teraz są dwie kopie Lekcji 5.3., oryginał i kopia z pliku.
UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład
:r !ls wczytuje wyjście polecenia ls i umieszcza je pod kursorem. :r !ls wczytuje wyjście polecenia ls i umieszcza je pod poniżej
kursora.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -703,7 +703,7 @@ UWAGA: Mo
:!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU. :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU.
2. :w NAZWA_PLIKU zapisuje obecny plik Vim-a na dysk z nazwą NAZWA_PLIKU. 2. :w NAZWA_PLIKU zapisuje obecny plik Vima na dysk z nazwą NAZWA_PLIKU.
3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU. 3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU.
@ -752,13 +752,13 @@ UWAGA: Mo
4. Dokończ wyraz tak jak w linii poniżej. Wciśnij <ESC> aby opuścić tryb 4. Dokończ wyraz tak jak w linii poniżej. Wciśnij <ESC> aby opuścić tryb
Insert. Insert.
5. Użyj e by przejść do kolejnego niedokończonego wyraze i powtarzaj kroki 5. Użyj e by przejść do kolejnego niedokończonego wyrazu i powtarzaj kroki
3. i 4. 3. i 4.
---> Ta li poz Ci ćwi dodaw teks do koń lin ---> Ta li poz Ci ćwi dodaw teks do koń lin
---> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii. ---> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii.
Uwaga: a , i and A prowadzą do trybu Insert, jedyną różnicą jest miejsce Uwaga: a , i oraz A prowadzą do trybu Insert, jedyną różnicą jest miejsce
gdzie nowe znaki będą dodawane. gdzie nowe znaki będą dodawane.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 6.3.: INNA WERSJA REPLACE (zamiana) Lekcja 6.3.: INNA WERSJA REPLACE (zamiana)
@ -789,7 +789,7 @@ UWAGA: Tryb Replace jest jak tryb Insert, ale ka
** użyj operatora y aby skopiować tekst i p aby go wkleić ** ** użyj operatora y aby skopiować tekst i p aby go wkleić **
1. Przejdź do linii oznaczonej ---> i umieśc kursor za "a)". 1. Przejdź do linii oznaczonej ---> i umieść kursor za "a)".
2. Wejdź w tryb Visual v i przenieś kursor na początek "pierwszy". 2. Wejdź w tryb Visual v i przenieś kursor na początek "pierwszy".
@ -799,8 +799,8 @@ UWAGA: Tryb Replace jest jak tryb Insert, ale ka
5. Wciśnij p aby wpakować (paste) tekst. Dodaj: a drugi<ESC> . 5. Wciśnij p aby wpakować (paste) tekst. Dodaj: a drugi<ESC> .
6. Użyj trybu Visual aby wybrać " element.", yankuj go y , przejdź do końca 6. Użyj trybu Wizualnego aby wybrać " element.", yankuj go y , przejdź do
następnej linii j$ i upakuj tam tekst z p . końca następnej linii j$ i upakuj tam tekst z p .
---> a) to jest pierwszy element. ---> a) to jest pierwszy element.
b) b)
@ -818,7 +818,7 @@ Uwaga: mo
2. Ustaw opcję 'ic' (Ignore case -- ignoruj wielkość liter) poprzez 2. Ustaw opcję 'ic' (Ignore case -- ignoruj wielkość liter) poprzez
wpisanie: :set ic wpisanie: :set ic
3. Teraz szukaj 'ignore' ponownie wciskując: n 3. Teraz szukaj 'ignore' ponownie wciskając: n
Zauważ, że Ignore i IGNORE także są teraz znalezione. Zauważ, że Ignore i IGNORE także są teraz znalezione.
4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is 4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is
@ -835,16 +835,18 @@ Uwaga: Aby ignorowa
1. Wpisanie o otwiera linię PONIŻEJ kursora. 1. Wpisanie o otwiera linię PONIŻEJ kursora.
Wpisanie wielkiego O otwiera linię POWYŻEJ kursora. Wpisanie O otwiera linię POWYŻEJ kursora.
2. Wpisz a by wstawić tekst ZA znakiem na, którym jest kursor.
Wpisanie wielkiego A dodaje tekst na końcu linii. 2. Wpisanie a by wstawić tekst ZA znakiem na, którym jest kursor.
Wpisanie A dodaje tekst na końcu linii.
3. Polecenie e przenosi do końca wyrazu. 3. Polecenie e przenosi do końca wyrazu.
4. Operato y yankuje (kopiuje) tekst, p pakuje (wkleja, paste) go. 4. Operator y yankuje (kopiuje) tekst, p pakuje (wkleja, paste) go.
5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki
nie zostanie wciśnięty <ESC>. nie zostanie wciśnięty <ESC>.
6. Wpisanie ":set xxx" ustawia opcję "xxx". Nietkóre opcje: 6. Wpisanie ":set xxx" ustawia opcję "xxx". Nietkóre opcje:
'ic' 'ignorecase' ignoruj wielkość znaków 'ic' 'ignorecase' ignoruj wielkość znaków
'is' 'incsearch' pokaż częściowe dopasowania 'is' 'incsearch' pokaż częściowe dopasowania
'hls' 'hlsearch' podświetl wszystkie dopasowania 'hls' 'hlsearch' podświetl wszystkie dopasowania
Możesz użyć zarówno długiej jak i krótkiej formy. Możesz użyć zarówno długiej jak i krótkiej formy.
7. Dodaj "no" aby wyłączyć opcję: :set noic 7. Dodaj "no" aby wyłączyć opcję: :set noic
@ -854,14 +856,14 @@ Uwaga: Aby ignorowa
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LEKCJA 7.1. JAK UZYSKAĆ POMOC LEKCJA 7.1. JAK UZYSKAĆ POMOC
** Użycie systemu pomocy on-line ** ** Użycie systemu pomocy on-line **
Vim posiada bardzo dobry system pomocy on-line. By zacząć spróbuj jednej Vim posiada bardzo dobry system pomocy on-line. By zacząć spróbuj jednej
z trzech możliwości: z trzech możliwości:
- wciśnij klawisz <HELP> (jeśli takowy posiadasz) - wciśnij klawisz <HELP> (jeśli taki masz)
- wciśnij klawisz <F1> (jeśli takowy posiadasz) - wciśnij klawisz <F1> (jeśli taki masz)
- wpisz :help<ENTER> - wpisz :help<ENTER>
Przeczytaj tekst w oknie pomocy aby dowiedzieć się jak działa pomoc. Przeczytaj tekst w oknie pomocy aby dowiedzieć się jak działa pomoc.
@ -878,7 +880,7 @@ Uwaga: Aby ignorowa
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO
** Włącz możliwości Vim-a ** ** Włącz możliwości Vima **
Vim ma o wiele więcej możliwości niż Vi, ale większość z nich jest domyślnie Vim ma o wiele więcej możliwości niż Vi, ale większość z nich jest domyślnie
wyłączona. Jeśli chcesz włączyć te możliwości na starcie musisz utworzyć wyłączona. Jeśli chcesz włączyć te możliwości na starcie musisz utworzyć
@ -943,23 +945,23 @@ UWAGA: Uzupe
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tutaj się kończy tutorial Vim-a. Został on pomyślany tak aby dać krótki Tutaj się kończy tutorial Vima. Został on pomyślany tak aby dać krótki
przegląd jego możliwości, wystarczający byś mógł go używać. Jest on przegląd jego możliwości, wystarczający byś mógł go używać. Jest on
daleki od kompletności ponieważ Vim ma o wiele, wiele więcej poleceń. daleki od kompletności ponieważ Vim ma o wiele, wiele więcej poleceń.
Dla dalszej nauki rekomendujemy książkę: Dla dalszej nauki rekomendujemy książkę:
Vim - Vi Improved - autor Steve Oualline Vim - Vi Improved - autor Steve Oualline
Wydawca: New Riders Wydawca: New Riders
Pierwsza ksiązka całkowicie poświęcona Vim-owi. Użyteczna zwłaszcza dla Pierwsza ksiązka całkowicie poświęcona Vimowi. Użyteczna zwłaszcza dla
początkujących. Zawiera wiele przykładów i ilustracji. początkujących. Zawiera wiele przykładów i ilustracji.
Zobacz http://iccf-holland.org./click5.html Zobacz http://iccf-holland.org./click5.html
Ta książka jest starsza i bardziej o Vi niż o Vim-ie, ale także warta Starsza pozycja i bardziej o Vi niż o Vimie, ale także warta
polecenia: polecenia:
Learning the Vi Editor - autor Linda Lamb Learning the Vi Editor - autor Linda Lamb
Wydawca: O'Reilly & Associates Inc. Wydawca: O'Reilly & Associates Inc.
To dobra książka by dowiedzieć się niemal wszystkiego co chciałbyś zrobić To dobra książka by dowiedzieć się niemal wszystkiego co chciałbyś zrobić
z Vi. Szósta edycja zawiera też informacje o Vim-ie. z Vi. Szósta edycja zawiera też informacje o Vimie.
Po polsku wydano: Po polsku wydano:
Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins
@ -967,10 +969,10 @@ UWAGA: Uzupe
ISBN: 83-7197-472-8 ISBN: 83-7197-472-8
http://helion.pl/ksiazki/vilek.htm http://helion.pl/ksiazki/vilek.htm
Jest to książeczka zawierająca spis poleceń vi i jego najważniejszych Jest to książeczka zawierająca spis poleceń vi i jego najważniejszych
klonów (między innymi Vim-a). klonów (między innymi Vima).
Edytor vi - autorzy Linda Lamb i Arnold Robbins Edytor vi - autorzy Linda Lamb i Arnold Robbins
Wydawca: Helion 2001 (O'Reilly) - wg 6 ang. wydania Wydawca: Helion 2001 (O'Reilly) - wg 6. ang. wydania
ISBN: 83-7197-539-2 ISBN: 83-7197-539-2
http://helion.pl/ksiazki/viedyt.htm http://helion.pl/ksiazki/viedyt.htm
Rozszerzona wersja Learning the Vi Editor w polskim tłumaczeniu. Rozszerzona wersja Learning the Vi Editor w polskim tłumaczeniu.
@ -980,7 +982,7 @@ UWAGA: Uzupe
Colorado State University. Colorado State University.
E-mail: bware@mines.colorado.edu. E-mail: bware@mines.colorado.edu.
Zmodyfikowane dla Vim-a przez Brama Moolenaara. Zmodyfikowane dla Vima przez Brama Moolenaara.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -988,4 +990,5 @@ UWAGA: Uzupe
Sierpień 2001, Sierpień 2001,
rev. Marzec 2002 rev. Marzec 2002
2nd rev. Wrzesień 2004 2nd rev. Wrzesień 2004
3rd rev. Marzec 2006
Wszelkie uwagi proszę kierować na: mikmach@wp.pl Wszelkie uwagi proszę kierować na: mikmach@wp.pl

View File

@ -5,7 +5,7 @@
Vim to potężny edytor, który posiada wiele poleceń, zbyt dużo by Vim to potężny edytor, który posiada wiele poleceń, zbyt dużo by
wyjaśnić je wszystkie w tym tutorialu. Ten przewodnik ma nauczyć wyjaśnić je wszystkie w tym tutorialu. Ten przewodnik ma nauczyć
Cię posługiwać się wystarczająco wieloma komendami byś mógł łatwo Cię posługiwać się wystarczająco wieloma komendami byś mógł łatwo
używać Vim-a jako edytora ogólnego przeznaczenia. używać Vima jako edytora ogólnego przeznaczenia.
Czas potrzebny na ukończenie tutoriala to 25 do 30 minut i zależy Czas potrzebny na ukończenie tutoriala to 25 do 30 minut i zależy
od tego jak wiele czasu spędzisz na eksperymentowaniu. od tego jak wiele czasu spędzisz na eksperymentowaniu.
@ -15,10 +15,10 @@
wcześniej kopię tego pliku do ćwiczeń (jeśli zacząłeś komendą wcześniej kopię tego pliku do ćwiczeń (jeśli zacząłeś komendą
"vimtutor" to już pracujesz na kopii). "vimtutor" to już pracujesz na kopii).
Ważne jest, byś pamiętał, że przewodnik ten został zaprojektowany do Pamiętaj że przewodnik ten został zaprojektowany do nauki poprzez
nauki poprzez ćwiczenia. To oznacza, że musisz wykonywać polecenia ćwiczenia. Oznacza to, że musisz wykonywać polecenia by nauczyć się ich
by nauczyć się ich prawidłowo. Jeśli będziesz jedynie czytał tekst prawidłowo. Jeśli będziesz jedynie czytał tekst szybko zapomnisz wiele
szybko zapomnisz wiele poleceń! poleceń!
Teraz upewnij się, że nie masz wciśniętego CapsLocka i wciskaj j Teraz upewnij się, że nie masz wciśniętego CapsLocka i wciskaj j
tak długo dopóki Lekcja 1.1. nie wypełni całkowicie ekranu. tak długo dopóki Lekcja 1.1. nie wypełni całkowicie ekranu.
@ -45,7 +45,7 @@ Uwaga: Jeśli nie jesteś pewien czegoś co wpisałeś, wciśnij <ESC> by wróci
Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będziesz Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będziesz
w stanie poruszać się o wiele szybciej jak się tylko przyzwyczaisz. w stanie poruszać się o wiele szybciej jak się tylko przyzwyczaisz.
Naprawdę! Naprawdę!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 1.2.: WYCHODZENIE Z VIM-a Lekcja 1.2.: WYCHODZENIE Z VIM-a
@ -65,7 +65,7 @@ Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będzies
wyjść i wrócić do edytora. wyjść i wrócić do edytora.
UWAGA: :q!<ENTER> porzuca wszelkie zmiany jakie zrobiłeś. W następnych UWAGA: :q!<ENTER> porzuca wszelkie zmiany jakie zrobiłeś. W następnych
lekcjach dowiesz się jak je zapamiętywać. lekcjach dowiesz się jak je zapamiętywać.
5. Przenieś kursor do lekcji 1.3. 5. Przenieś kursor do lekcji 1.3.
@ -150,16 +150,16 @@ UWAGA: Ucz się przez ćwiczenie, nie wkuwanie.
1. Zakończ tutorial tak jak w lekcji 1.2.: :q! 1. Zakończ tutorial tak jak w lekcji 1.2.: :q!
2. W powłoce wydaj polecenie: vim tutor<ENTER> 2. W powłoce wydaj polecenie: vim tutor<ENTER>
"vim" jest poleceniem uruchamiającym edytor Vimm. 'tutor' to nazwa pliku "vim" jest poleceniem uruchamiającym edytor Vim. 'tutor' to nazwa pliku
jaki chcesz edytować. Użyj pliku jaki może zostać zmieniony. jaki chcesz edytować. Użyj pliku jaki może zostać zmieniony.
3. Dodaj i usuń tekst tak jak się nauczyłeś w poprzednich lekcjach. 3. Dodaj i usuń tekst tak jak się nauczyłeś w poprzednich lekcjach.
4. Zapisz plik ze zmianami w opuść Vima: :wq<ENTER> 4. Zapisz plik ze zmianami i opuść Vima: :wq<ENTER>
5. Uruchom ponownie vimtutor i przejdź do podsumowania lekcji. 5. Uruchom ponownie vimtutor i przejdź do podsumowania lekcji.
6. Po przeczytaniu wszystkich kroków i zrozumieniu ich: wykonaj je. 6. Po przeczytaniu wszystkich kroków i ich zrozumieniu: wykonaj je.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -168,21 +168,21 @@ UWAGA: Ucz się przez ćwiczenie, nie wkuwanie.
1. Poruszasz kursorem używając "strzałek" i klawiszy hjkl . 1. Poruszasz kursorem używając "strzałek" i klawiszy hjkl .
h (w lewo) j (w dół) k (do góry) l (w prawo) h (w lewo) j (w dół) k (do góry) l (w prawo)
2. By wejść do Vim-a (z powłoki) wpisz: 2. By wejść do Vima (z powłoki) wpisz:
vim NAZWA_PLIKU<ENTER> vim NAZWA_PLIKU<ENTER>
3. By wyjść z Vim-a wpisz: 3. By wyjść z Vima wpisz:
<ESC> :q!<ENTER> by usunąc wszystkie zmiany. <ESC> :q!<ENTER> by usunąc wszystkie zmiany.
LUB: <ESC> :wq<ENTER> by zmiany zachować. LUB: <ESC> :wq<ENTER> by zmiany zachować.
4. By usunąć znak pod kursorem wciśnij: x 4. By usunąć znak pod kursorem wciśnij: x
5. By wstawić tekst przed kursorem lub dodać: 5. By wstawić tekst przed kursorem lub dodać:
i wpisz tekst <ESC> wstawi przed kursorem i wpisz tekst <ESC> wstawi przed kursorem
A wpisz tekst <ESC> doda na końcu linii A wpisz tekst <ESC> doda na końcu linii
UWAGA: Wciśnięcie <ESC> przeniesie Cię z powrotem do trybu Normal UWAGA: Wciśnięcie <ESC> przeniesie Cię z powrotem do trybu Normal
lub odwoła niechciane lub częściowo wprowadzone polecenia. lub odwoła niechciane lub częściowo wprowadzone polecenia.
Teraz możemy kontynuować i przejść do Lekcji 2. Teraz możemy kontynuować i przejść do Lekcji 2.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -197,11 +197,11 @@ Teraz możemy kontynuować i przejść do Lekcji 2.
3. Przesuń kursor na początek wyrazu, które chcesz usunąć. 3. Przesuń kursor na początek wyrazu, które chcesz usunąć.
4. Wpisz dw by usunąc wyraz. 4. Wpisz dw by usunąć wyraz.
UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w . UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w .
Jeśli zobaczysz inny znak wpisałeś coś źle, wciśnij <ESC> i zacznij Jeśli zobaczysz inny znak oznacza to, że wpisałeś coś źle, wciśnij
od początku. <ESC> i zacznij od początku.
---> Jest tu parę papier wyrazów, które kamień nie należą do nożyce tego zdania. ---> Jest tu parę papier wyrazów, które kamień nie należą do nożyce tego zdania.
@ -306,13 +306,13 @@ UWAGA: Mnożnik pomiędzy operatorem d i ruchem działa podobnie do ruchu bez
** Wpisz dd aby usunąć całą linię. ** ** Wpisz dd aby usunąć całą linię. **
Z powodu częstości usuwania całych linii, projektanci VI zdecydowali, że Z powodu częstości usuwania całych linii, projektanci Vi zdecydowali, że
będzie łatwiej wpisać dwa razy d aby usunąć linię. będzie łatwiej wpisać dwa razy d aby usunąć linię.
1. Przenieś kursor do zdania poniżej. 1. Przenieś kursor do drugiego zdania z wierszyka poniżej.
2. Wpisz dd aby usunąc wiersz. 2. Wpisz dd aby usunąć wiersz.
3. Teraz przenieś się do czwartego wiersza. 3. Teraz przenieś się do czwartego wiersza.
4. Wpisz 2dd aby usunąc dwia wiersze. 4. Wpisz 2dd aby usunąc dwa wiersze.
---> 1) Róże są czerwone, ---> 1) Róże są czerwone,
---> 2) Błoto jest fajne, ---> 2) Błoto jest fajne,
@ -337,7 +337,7 @@ UWAGA: Mnożnik pomiędzy operatorem d i ruchem działa podobnie do ruchu bez
4. Tym razem popraw wszystkie błędy w linii używając polecenia x . 4. Tym razem popraw wszystkie błędy w linii używając polecenia x .
5. Teraz wciśnij wielkie U aby przywrócić linię do oryginalnego stanu. 5. Teraz wciśnij wielkie U aby przywrócić linię do oryginalnego stanu.
6. Teraz wciśnij u kilka razy by cofnąć U i poprzednie polecenia. 6. Teraz wciśnij u kilka razy by cofnąć U i poprzednie polecenia.
7. Teraz wpsz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R) 7. Teraz wpisz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R)
kilka razy, by cofnąć cofnięcia. kilka razy, by cofnąć cofnięcia.
---> Poopraw blędyyy w teej liniii i zaamiień je prrzez coofnij. ---> Poopraw blędyyy w teej liniii i zaamiień je prrzez coofnij.
@ -377,14 +377,14 @@ UWAGA: Mnożnik pomiędzy operatorem d i ruchem działa podobnie do ruchu bez
1. Przenieś kursor do pierwszej linii ---> poniżej. 1. Przenieś kursor do pierwszej linii ---> poniżej.
2. Wpisz dd aby usunąć linię i przechować ją w rejestrze Vim-a. 2. Wpisz dd aby usunąć linię i przechować ją w rejestrze Vima.
3. Przenieś kursor do linii c), POWYŻEJ tej gdzie usunięta linia powinna 3. Przenieś kursor do linii c), POWYŻEJ tej gdzie usunięta linia powinna
się znajdować. się znajdować.
4. Wciśnij p by wstawić linię poniżej kursora. 4. Wciśnij p by wstawić linię poniżej kursora.
5. Powtaj kroki 2. do 4. aż znajdą się w odpowiednim porządku. 5. Powtarzaj kroki 2. do 4. aż znajdą się w odpowiednim porządku.
---> d) Jak dwa aniołki. ---> d) Jak dwa aniołki.
---> b) Na dole fiołki, ---> b) Na dole fiołki,
@ -456,7 +456,7 @@ UWAGA: Pamiętaj by uczyć się ćwicząc, a nie pamięciowo.
5. Wpisz c$ , popraw koniec wiersza i wciśnij <ESC>. 5. Wpisz c$ , popraw koniec wiersza i wciśnij <ESC>.
---> Koniec tego wiersza musi być poprawiony aby wyglądal tak jak drugi. ---> Koniec tego wiersza musi być poprawiony aby wyglądał tak jak drugi.
---> Koniec tego wiersza musi być poprawiony używając polecenia c$ . ---> Koniec tego wiersza musi być poprawiony używając polecenia c$ .
UWAGA: Możesz używać <BS> aby poprawiać błędy w czasie pisania. UWAGA: Możesz używać <BS> aby poprawiać błędy w czasie pisania.
@ -526,15 +526,15 @@ UWAGA: Możesz też zobaczyć pozycję kursora w prawym, dolnym rogu ekranu.
5. Aby wrócić gdzie byłeś wciśnij CTRL-O. Powtarzaj by wrócić dalej. CTRL-I 5. Aby wrócić gdzie byłeś wciśnij CTRL-O. Powtarzaj by wrócić dalej. CTRL-I
idzie do przodu. idzie do przodu.
UWAGA: 'błond' to nie jest metoda by przeliterować błąd; 'błond' to błąd. Uwaga: 'błond' to nie jest metoda by przeliterować błąd; 'błond' to błąd.
UWAGA: Kiedy szukanie osiągnie koniec pliku będzie kontynuowało od początku Uwaga: Kiedy szukanie osiągnie koniec pliku będzie kontynuowało od początku
o ile opcja 'wrapscan' nie została przestawiona. o ile opcja 'wrapscan' nie została przestawiona.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW Lekcja 4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW
** Wpisz % by znaleźć pasujący ),], lub } . ** ** Wpisz % by znaleźć parujący ), ], lub } . **
1. Umieść kursor na którymś z (, [, lub { w linii poniżej oznaczonej --->. 1. Umieść kursor na którymś z (, [, lub { w linii poniżej oznaczonej --->.
@ -548,7 +548,7 @@ o ile opcja 'wrapscan' nie została przestawiona.
---> To ( jest linia testowa z (, [, ] i {, } . )) ---> To ( jest linia testowa z (, [, ] i {, } . ))
UWAGA: Ta funkcja jest bardzo użyteczna w debuggowaniu programu Uwaga: Ta funkcja jest bardzo użyteczna w debuggowaniu programu
z niesparowanymi nawiasami! z niesparowanymi nawiasami!
@ -598,7 +598,7 @@ UWAGA: Ta funkcja jest bardzo użyteczna w debuggowaniu programu
By zamienić wszystkie stary na nowy w linii wpisz :s/stary/nowy/g By zamienić wszystkie stary na nowy w linii wpisz :s/stary/nowy/g
By zamienić frazy pomiędzy dwoma liniami # wpisz :#,#s/stary/nowy/g By zamienić frazy pomiędzy dwoma liniami # wpisz :#,#s/stary/nowy/g
By zamienić wszystkie wystąpienia w pliku wpisz :%s/stary/nowy/g By zamienić wszystkie wystąpienia w pliku wpisz :%s/stary/nowy/g
By Vim prosił Cię o potwierdzienie dodaj 'c' :%s/stary/nowy/gc By Vim prosił Cię o potwierdzenie dodaj 'c' :%s/stary/nowy/gc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 5.1.: JAK WYKONAĆ POLECENIA ZEWNĘTRZNE Lekcja 5.1.: JAK WYKONAĆ POLECENIA ZEWNĘTRZNE
@ -606,7 +606,7 @@ UWAGA: Ta funkcja jest bardzo użyteczna w debuggowaniu programu
** Wpisz :! a następnie zewnętrzne polecenie by je wykonać. ** ** Wpisz :! a następnie zewnętrzne polecenie by je wykonać. **
1. Wpisz znajome polecenie : by ustawić kursor na dole ekranu. To pozwala 1. Wpisz znajome polecenie : by ustawić kursor na dole ekranu. To pozwala
na wprowadzenie polecenia. na wprowadzenie komendy linii poleceń.
2. Teraz wstaw ! (wykrzyknik). To umożliwi Ci wykonanie dowolnego 2. Teraz wstaw ! (wykrzyknik). To umożliwi Ci wykonanie dowolnego
zewnętrznego polecenia powłoki. zewnętrznego polecenia powłoki.
@ -638,12 +638,12 @@ Uwaga: Wszystkie polecenia : muszą być zakończone <ENTER>.
4. To polecenie zapamięta cały plik (Vim Tutor) pod nazwą TEST. 4. To polecenie zapamięta cały plik (Vim Tutor) pod nazwą TEST.
By to sprawdzić wpisz :!dir lub :!ls , żeby znowu zobaczyć listę plików. By to sprawdzić wpisz :!dir lub :!ls , żeby znowu zobaczyć listę plików.
Uwaga: Zauważ, że gdybyś teraz wyszedł z Vim-a, a następnie wszedł ponownie Uwaga: Zauważ, że gdybyś teraz wyszedł z Vima, a następnie wszedł ponownie
komendą vim TEST , plik byłby dokładną kopią tutoriala kiedy go poleceniem vim TEST , plik byłby dokładną kopią tutoriala kiedy go
zapisywałeś. zapisywałeś.
5. Teraz usuń plik wpisując: :!rm TEST 5. Teraz usuń plik wpisując (MS-DOS): :!del TEST
lub (Unix): :!rm TEST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU Lekcja 5.3.: WYBRANIE TEKSTU DO ZAPISU
@ -687,8 +687,8 @@ UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 5.3. Potem przejdź
teraz są dwie kopie Lekcji 5.3., oryginał i kopia z pliku. teraz są dwie kopie Lekcji 5.3., oryginał i kopia z pliku.
UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład
:r !ls wczytuje wyjście polecenia ls i umieszcza je pod kursorem. :r !ls wczytuje wyjście polecenia ls i umieszcza je pod poniżej
kursora.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -703,7 +703,7 @@ UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład
:!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU. :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU.
2. :w NAZWA_PLIKU zapisuje obecny plik Vim-a na dysk z nazwą NAZWA_PLIKU. 2. :w NAZWA_PLIKU zapisuje obecny plik Vima na dysk z nazwą NAZWA_PLIKU.
3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU. 3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU.
@ -752,13 +752,13 @@ UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład
4. Dokończ wyraz tak jak w linii poniżej. Wciśnij <ESC> aby opuścić tryb 4. Dokończ wyraz tak jak w linii poniżej. Wciśnij <ESC> aby opuścić tryb
Insert. Insert.
5. Użyj e by przejść do kolejnego niedokończonego wyraze i powtarzaj kroki 5. Użyj e by przejść do kolejnego niedokończonego wyrazu i powtarzaj kroki
3. i 4. 3. i 4.
---> Ta li poz Ci ćwi dodaw teks do koń lin ---> Ta li poz Ci ćwi dodaw teks do koń lin
---> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii. ---> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii.
Uwaga: a , i and A prowadzą do trybu Insert, jedyną różnicą jest miejsce Uwaga: a , i oraz A prowadzą do trybu Insert, jedyną różnicą jest miejsce
gdzie nowe znaki będą dodawane. gdzie nowe znaki będą dodawane.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lekcja 6.3.: INNA WERSJA REPLACE (zamiana) Lekcja 6.3.: INNA WERSJA REPLACE (zamiana)
@ -789,7 +789,7 @@ UWAGA: Tryb Replace jest jak tryb Insert, ale każdy znak usuwa istniejący
** użyj operatora y aby skopiować tekst i p aby go wkleić ** ** użyj operatora y aby skopiować tekst i p aby go wkleić **
1. Przejdź do linii oznaczonej ---> i umieśc kursor za "a)". 1. Przejdź do linii oznaczonej ---> i umieść kursor za "a)".
2. Wejdź w tryb Visual v i przenieś kursor na początek "pierwszy". 2. Wejdź w tryb Visual v i przenieś kursor na początek "pierwszy".
@ -799,8 +799,8 @@ UWAGA: Tryb Replace jest jak tryb Insert, ale każdy znak usuwa istniejący
5. Wciśnij p aby wpakować (paste) tekst. Dodaj: a drugi<ESC> . 5. Wciśnij p aby wpakować (paste) tekst. Dodaj: a drugi<ESC> .
6. Użyj trybu Visual aby wybrać " element.", yankuj go y , przejdź do końca 6. Użyj trybu Wizualnego aby wybrać " element.", yankuj go y , przejdź do
następnej linii j$ i upakuj tam tekst z p . końca następnej linii j$ i upakuj tam tekst z p .
---> a) to jest pierwszy element. ---> a) to jest pierwszy element.
b) b)
@ -818,7 +818,7 @@ Uwaga: możesz użyć y jako operatora; yw kopiuje jeden wyraz.
2. Ustaw opcję 'ic' (Ignore case -- ignoruj wielkość liter) poprzez 2. Ustaw opcję 'ic' (Ignore case -- ignoruj wielkość liter) poprzez
wpisanie: :set ic wpisanie: :set ic
3. Teraz szukaj 'ignore' ponownie wciskując: n 3. Teraz szukaj 'ignore' ponownie wciskając: n
Zauważ, że Ignore i IGNORE także są teraz znalezione. Zauważ, że Ignore i IGNORE także są teraz znalezione.
4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is 4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is
@ -835,16 +835,18 @@ Uwaga: Aby ignorować wielkość liter dla jednego wyszukiwania: /ignore\c<ENTER
1. Wpisanie o otwiera linię PONIŻEJ kursora. 1. Wpisanie o otwiera linię PONIŻEJ kursora.
Wpisanie wielkiego O otwiera linię POWYŻEJ kursora. Wpisanie O otwiera linię POWYŻEJ kursora.
2. Wpisz a by wstawić tekst ZA znakiem na, którym jest kursor.
Wpisanie wielkiego A dodaje tekst na końcu linii. 2. Wpisanie a by wstawić tekst ZA znakiem na, którym jest kursor.
Wpisanie A dodaje tekst na końcu linii.
3. Polecenie e przenosi do końca wyrazu. 3. Polecenie e przenosi do końca wyrazu.
4. Operato y yankuje (kopiuje) tekst, p pakuje (wkleja, paste) go. 4. Operator y yankuje (kopiuje) tekst, p pakuje (wkleja, paste) go.
5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki
nie zostanie wciśnięty <ESC>. nie zostanie wciśnięty <ESC>.
6. Wpisanie ":set xxx" ustawia opcję "xxx". Nietkóre opcje: 6. Wpisanie ":set xxx" ustawia opcję "xxx". Nietkóre opcje:
'ic' 'ignorecase' ignoruj wielkość znaków 'ic' 'ignorecase' ignoruj wielkość znaków
'is' 'incsearch' pokaż częściowe dopasowania 'is' 'incsearch' pokaż częściowe dopasowania
'hls' 'hlsearch' podświetl wszystkie dopasowania 'hls' 'hlsearch' podświetl wszystkie dopasowania
Możesz użyć zarówno długiej jak i krótkiej formy. Możesz użyć zarówno długiej jak i krótkiej formy.
7. Dodaj "no" aby wyłączyć opcję: :set noic 7. Dodaj "no" aby wyłączyć opcję: :set noic
@ -854,14 +856,14 @@ Uwaga: Aby ignorować wielkość liter dla jednego wyszukiwania: /ignore\c<ENTER
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LEKCJA 7.1. JAK UZYSKAĆ POMOC LEKCJA 7.1. JAK UZYSKAĆ POMOC
** Użycie systemu pomocy on-line ** ** Użycie systemu pomocy on-line **
Vim posiada bardzo dobry system pomocy on-line. By zacząć spróbuj jednej Vim posiada bardzo dobry system pomocy on-line. By zacząć spróbuj jednej
z trzech możliwości: z trzech możliwości:
- wciśnij klawisz <HELP> (jeśli takowy posiadasz) - wciśnij klawisz <HELP> (jeśli taki masz)
- wciśnij klawisz <F1> (jeśli takowy posiadasz) - wciśnij klawisz <F1> (jeśli taki masz)
- wpisz :help<ENTER> - wpisz :help<ENTER>
Przeczytaj tekst w oknie pomocy aby dowiedzieć się jak działa pomoc. Przeczytaj tekst w oknie pomocy aby dowiedzieć się jak działa pomoc.
@ -878,7 +880,7 @@ Uwaga: Aby ignorować wielkość liter dla jednego wyszukiwania: /ignore\c<ENTER
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO LEKCJA 7.2. TWORZENIE SKRYPTU STARTOWEGO
** Włącz możliwości Vim-a ** ** Włącz możliwości Vima **
Vim ma o wiele więcej możliwości niż Vi, ale większość z nich jest domyślnie Vim ma o wiele więcej możliwości niż Vi, ale większość z nich jest domyślnie
wyłączona. Jeśli chcesz włączyć te możliwości na starcie musisz utworzyć wyłączona. Jeśli chcesz włączyć te możliwości na starcie musisz utworzyć
@ -943,23 +945,23 @@ UWAGA: Uzupełnianie działa dla wielu poleceń. Spróbuj wcisnąć CTRL-D i <TA
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tutaj się kończy tutorial Vim-a. Został on pomyślany tak aby dać krótki Tutaj się kończy tutorial Vima. Został on pomyślany tak aby dać krótki
przegląd jego możliwości, wystarczający byś mógł go używać. Jest on przegląd jego możliwości, wystarczający byś mógł go używać. Jest on
daleki od kompletności ponieważ Vim ma o wiele, wiele więcej poleceń. daleki od kompletności ponieważ Vim ma o wiele, wiele więcej poleceń.
Dla dalszej nauki rekomendujemy książkę: Dla dalszej nauki rekomendujemy książkę:
Vim - Vi Improved - autor Steve Oualline Vim - Vi Improved - autor Steve Oualline
Wydawca: New Riders Wydawca: New Riders
Pierwsza ksiązka całkowicie poświęcona Vim-owi. Użyteczna zwłaszcza dla Pierwsza ksiązka całkowicie poświęcona Vimowi. Użyteczna zwłaszcza dla
początkujących. Zawiera wiele przykładów i ilustracji. początkujących. Zawiera wiele przykładów i ilustracji.
Zobacz http://iccf-holland.org./click5.html Zobacz http://iccf-holland.org./click5.html
Ta książka jest starsza i bardziej o Vi niż o Vim-ie, ale także warta Starsza pozycja i bardziej o Vi niż o Vimie, ale także warta
polecenia: polecenia:
Learning the Vi Editor - autor Linda Lamb Learning the Vi Editor - autor Linda Lamb
Wydawca: O'Reilly & Associates Inc. Wydawca: O'Reilly & Associates Inc.
To dobra książka by dowiedzieć się niemal wszystkiego co chciałbyś zrobić To dobra książka by dowiedzieć się niemal wszystkiego co chciałbyś zrobić
z Vi. Szósta edycja zawiera też informacje o Vim-ie. z Vi. Szósta edycja zawiera też informacje o Vimie.
Po polsku wydano: Po polsku wydano:
Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins
@ -967,10 +969,10 @@ UWAGA: Uzupełnianie działa dla wielu poleceń. Spróbuj wcisnąć CTRL-D i <TA
ISBN: 83-7197-472-8 ISBN: 83-7197-472-8
http://helion.pl/ksiazki/vilek.htm http://helion.pl/ksiazki/vilek.htm
Jest to książeczka zawierająca spis poleceń vi i jego najważniejszych Jest to książeczka zawierająca spis poleceń vi i jego najważniejszych
klonów (między innymi Vim-a). klonów (między innymi Vima).
Edytor vi - autorzy Linda Lamb i Arnold Robbins Edytor vi - autorzy Linda Lamb i Arnold Robbins
Wydawca: Helion 2001 (O'Reilly) - wg 6 ang. wydania Wydawca: Helion 2001 (O'Reilly) - wg 6. ang. wydania
ISBN: 83-7197-539-2 ISBN: 83-7197-539-2
http://helion.pl/ksiazki/viedyt.htm http://helion.pl/ksiazki/viedyt.htm
Rozszerzona wersja Learning the Vi Editor w polskim tłumaczeniu. Rozszerzona wersja Learning the Vi Editor w polskim tłumaczeniu.
@ -980,7 +982,7 @@ UWAGA: Uzupełnianie działa dla wielu poleceń. Spróbuj wcisnąć CTRL-D i <TA
Colorado State University. Colorado State University.
E-mail: bware@mines.colorado.edu. E-mail: bware@mines.colorado.edu.
Zmodyfikowane dla Vim-a przez Brama Moolenaara. Zmodyfikowane dla Vima przez Brama Moolenaara.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -988,4 +990,5 @@ UWAGA: Uzupełnianie działa dla wielu poleceń. Spróbuj wcisnąć CTRL-D i <TA
Sierpień 2001, Sierpień 2001,
rev. Marzec 2002 rev. Marzec 2002
2nd rev. Wrzesień 2004 2nd rev. Wrzesień 2004
3rd rev. Marzec 2006
Wszelkie uwagi proszę kierować na: mikmach@wp.pl Wszelkie uwagi proszę kierować na: mikmach@wp.pl

View File

@ -51,6 +51,7 @@
# NOTE: compilation on WinNT/2K/XP requires # NOTE: compilation on WinNT/2K/XP requires
# at least version 1.6.5 of Ruby. Earlier versions # at least version 1.6.5 of Ruby. Earlier versions
# of Ruby will cause a compile error on these systems. # of Ruby will cause a compile error on these systems.
# RUBY_VER_LONG same, but in format with dot. (1.6)
# DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (no) # DYNAMIC_RUBY no or yes: use yes to load the Ruby DLL dynamically (no)
# MBYTE no or yes: set to yes for multi-byte support (yes) # MBYTE no or yes: set to yes for multi-byte support (yes)
# NOTE: multi-byte support is broken in the Borland libraries, # NOTE: multi-byte support is broken in the Borland libraries,

View File

@ -2,7 +2,7 @@
# Makefile for Vim on OpenVMS # Makefile for Vim on OpenVMS
# #
# Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com> # Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com>
# Last change: 2006 Mar 24 # Last change: 2006 Mar 31
# #
# This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64 # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64
# with MMS and MMK # with MMS and MMK
@ -98,7 +98,8 @@ CCVER = YES
.IFDEF VAX .IFDEF VAX
.IFDEF DECC # VAX with DECC .IFDEF DECC # VAX with DECC
CC_DEF = cc/decc CC_DEF = cc # /decc # some system requires this switch
# but when it is not required /ver might fail
PREFIX = /prefix=all PREFIX = /prefix=all
.ELSE # VAX with VAXC .ELSE # VAX with VAXC
CC_DEF = cc CC_DEF = cc
@ -148,10 +149,11 @@ GUI = YES
# X/Motif/GTK executable (also works in terminal mode ) # X/Motif/GTK executable (also works in terminal mode )
.IFDEF GTK .IFDEF GTK
# define GTK root directory # NOTE: you need to set up your GTK_DIR (GTK root directory), because it is
# unique on every system - logicals are not accepted
# please note: directory should end with . in order to /trans=conc work # please note: directory should end with . in order to /trans=conc work
# example: GTK_DIR = $1$DGA104:[USERS.ZAY.WORK.GTK1210.] # Example: GTK_DIR = $1$DGA104:[USERS.ZAY.WORK.GTK1210.]
GTK_DIR = ALPHA$DKA0:[GTK128.] GTK_DIR = DKA0:[GTK1210.]
DEFS = "HAVE_CONFIG_H","FEAT_GUI_GTK" DEFS = "HAVE_CONFIG_H","FEAT_GUI_GTK"
LIBS = ,OS_VMS_GTK.OPT/OPT LIBS = ,OS_VMS_GTK.OPT/OPT
GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm GUI_FLAG = /name=(as_is,short)/float=ieee/ieee=denorm

View File

@ -1322,7 +1322,8 @@ DEST_MAN_FR_U = $(DEST_MAN_TOP)/fr.UTF-8$(MAN1DIR)
DEST_MAN_IT = $(DEST_MAN_TOP)/it$(MAN1DIR) DEST_MAN_IT = $(DEST_MAN_TOP)/it$(MAN1DIR)
DEST_MAN_IT_I = $(DEST_MAN_TOP)/it.ISO8859-1$(MAN1DIR) DEST_MAN_IT_I = $(DEST_MAN_TOP)/it.ISO8859-1$(MAN1DIR)
DEST_MAN_IT_U = $(DEST_MAN_TOP)/it.UTF-8$(MAN1DIR) DEST_MAN_IT_U = $(DEST_MAN_TOP)/it.UTF-8$(MAN1DIR)
DEST_MAN_PL = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR) DEST_MAN_PL = $(DEST_MAN_TOP)/pl$(MAN1DIR)
DEST_MAN_PL_I = $(DEST_MAN_TOP)/pl.ISO8859-2$(MAN1DIR)
DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR) DEST_MAN_PL_U = $(DEST_MAN_TOP)/pl.UTF-8$(MAN1DIR)
DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR) DEST_MAN_RU = $(DEST_MAN_TOP)/ru.KOI8-R$(MAN1DIR)
DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR) DEST_MAN_RU_U = $(DEST_MAN_TOP)/ru.UTF-8$(MAN1DIR)
@ -1523,8 +1524,8 @@ PRO_AUTO = \
$(ALL_GUI_PRO) \ $(ALL_GUI_PRO) \
$(TCL_PRO) $(TCL_PRO)
ICON_APP = gui_mac.icns # Resources used for the Mac are in one directory.
ICON_DOCTXT = doc-txt.icns RSRC_DIR = os_mac_rsrc
PRO_MANUAL = os_amiga.pro os_msdos.pro os_win16.pro os_win32.pro \ PRO_MANUAL = os_amiga.pro os_msdos.pro os_win16.pro os_win32.pro \
os_mswin.pro os_beos.pro os_vms.pro os_riscos.pro $(PERL_PRO) os_mswin.pro os_beos.pro os_vms.pro os_riscos.pro $(PERL_PRO)
@ -1905,6 +1906,7 @@ install-tool-languages:
-$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh xxd $(DEST_MAN_PL_I) "-pl" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh xxd $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
@ -1918,6 +1920,7 @@ install-languages: languages $(DEST_LANG) $(DEST_KMAP)
-$(SHELL) ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_IT_I) "-it" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_IT_U) "-it.UTF-8" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_PL) "-pl" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh install $(DEST_MAN_PL_I) "-pl" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) -$(SHELL) ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
@ -1935,6 +1938,8 @@ install-languages: languages $(DEST_LANG) $(DEST_KMAP)
$(DEST_MAN_IT_U) $(INSTALLMLARGS) $(DEST_MAN_IT_U) $(INSTALLMLARGS)
-$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \
$(DEST_MAN_PL) $(INSTALLMLARGS) $(DEST_MAN_PL) $(INSTALLMLARGS)
-$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \
$(DEST_MAN_PL_I) $(INSTALLMLARGS)
-$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \
$(DEST_MAN_PL_U) $(INSTALLMLARGS) $(DEST_MAN_PL_U) $(INSTALLMLARGS)
-$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \ -$(SHELL) ./installml.sh install "$(GUI_MAN_TARGETS)" \
@ -2077,6 +2082,7 @@ uninstall_runtime:
-$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT_I) "" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_IT_U) "" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL) "" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL_I) "" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS)
-$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS) -$(SHELL) ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS)
@ -2096,6 +2102,8 @@ uninstall_runtime:
$(DEST_MAN_IT_U) $(INSTALLMLARGS) $(DEST_MAN_IT_U) $(INSTALLMLARGS)
-$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
$(DEST_MAN_PL) $(INSTALLMLARGS) $(DEST_MAN_PL) $(INSTALLMLARGS)
-$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
$(DEST_MAN_PL_I) $(INSTALLMLARGS)
-$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
$(DEST_MAN_PL_U) $(INSTALLMLARGS) $(DEST_MAN_PL_U) $(INSTALLMLARGS)
-$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ -$(SHELL) ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
@ -2105,7 +2113,7 @@ uninstall_runtime:
-rm -f $(DEST_MAN)/xxd.1 -rm -f $(DEST_MAN)/xxd.1
-rm -f $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1 -rm -f $(DEST_MAN_FR)/xxd.1 $(DEST_MAN_FR_I)/xxd.1 $(DEST_MAN_FR_U)/xxd.1
-rm -f $(DEST_MAN_IT)/xxd.1 $(DEST_MAN_IT_I)/xxd.1 $(DEST_MAN_IT_U)/xxd.1 -rm -f $(DEST_MAN_IT)/xxd.1 $(DEST_MAN_IT_I)/xxd.1 $(DEST_MAN_IT_U)/xxd.1
-rm -f $(DEST_MAN_PL)/xxd.1 $(DEST_MAN_PL_U)/xxd.1 -rm -f $(DEST_MAN_PL)/xxd.1 $(DEST_MAN_PL_I)/xxd.1 $(DEST_MAN_PL_U)/xxd.1
-rm -f $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1 -rm -f $(DEST_MAN_RU)/xxd.1 $(DEST_MAN_RU_U)/xxd.1
-rm -f $(DEST_HELP)/*.txt $(DEST_HELP)/tags $(DEST_HELP)/*.pl -rm -f $(DEST_HELP)/*.txt $(DEST_HELP)/tags $(DEST_HELP)/*.pl
-rm -f $(DEST_HELP)/*.??x $(DEST_HELP)/tags-?? -rm -f $(DEST_HELP)/*.??x $(DEST_HELP)/tags-??
@ -2162,9 +2170,9 @@ shadow: runtime pixmaps
cp config.mk.dist $(SHADOWDIR) cp config.mk.dist $(SHADOWDIR)
mkdir $(SHADOWDIR)/xxd mkdir $(SHADOWDIR)/xxd
cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* . cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
if test -f $(ICON_APP); then \ if test -d $(RSRC_DIR); then \
cd $(SHADOWDIR); \ cd $(SHADOWDIR); \
ln -s ../$(ICON_APP) ../$(ICON_DOCTXT) ../os_mac.rsr.hqx ../dehqx.py .; \ ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
fi fi
mkdir $(SHADOWDIR)/testdir mkdir $(SHADOWDIR)/testdir
cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \ cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \
@ -2526,17 +2534,7 @@ VERSION = $(VIMMAJOR).$(VIMMINOR)
### Common flags ### Common flags
M4FLAGSX = $(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \ M4FLAGSX = $(M4FLAGS) -DAPP_EXE=$(VIMNAME) -DAPP_NAME=$(VIMNAME) \
-DAPP_VER=$(VERSION) -DICON_APP=$(ICON_APP) -DAPP_VER=$(VERSION)
### Icons
ICONS = $(RESDIR)/$(ICON_APP) $(RESDIR)/$(ICON_DOCTXT)
# If you uncomment the following lines the *.icns in the src directory will be
# detected by this Makefile automatically, and used for Vim.
#ICON_APP = $(shell if [ -e app.icns ] ; then echo app.icns ; else echo gui_mac.icns ; fi)
#ICON_DOC = $(shell if [ -e doc.icns ] ; then echo doc.icns ; else echo ; fi)
#ICON_DOCTXT = $(shell if [ -e doc-txt.icns ] ; then echo doc-txt.icns ; else echo ; fi)
#ICONS = $(addprefix $(RESDIR)/, $(ICON_APP) $(ICON_DOC) $(ICON_DOCTXT))
install_macosx: gui_bundle install_macosx: gui_bundle
# Remove the link to the runtime dir, don't want to copy all of that. # Remove the link to the runtime dir, don't want to copy all of that.
@ -2577,9 +2575,8 @@ bundle-info: bundle-dir
@echo "Creating Info.plist" @echo "Creating Info.plist"
m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist m4 $(M4FLAGSX) infplist.xml > $(APPDIR)/Contents/Info.plist
bundle-resource: bundle-dir bundle-icons bundle-rsrc bundle-resource: bundle-dir bundle-rsrc
cp -f $(RSRC_DIR)/*.icns $(RESDIR)
bundle-icons: $(ICONS)
### Classic resources ### Classic resources
# Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9) # Resource fork (in the form of a .rsrc file) for Classic Vim (Mac OS 9)
@ -2603,9 +2600,6 @@ $(APPDIR)/Contents:
-$(SHELL) ./mkinstalldirs $(APPDIR)/Contents/MacOS -$(SHELL) ./mkinstalldirs $(APPDIR)/Contents/MacOS
-$(SHELL) ./mkinstalldirs $(RESDIR)/English.lproj -$(SHELL) ./mkinstalldirs $(RESDIR)/English.lproj
$(RESDIR)/%.icns: %.icns
cp $< $@
############################################################################### ###############################################################################
### (automatically generated by 'make depend') ### (automatically generated by 'make depend')

69
src/auto/configure vendored
View File

@ -2781,7 +2781,10 @@ if test -z "$CFLAGS"; then
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
fi fi
if test "$GCC" = yes; then if test "$GCC" = yes; then
gccversion=`"$CC" --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[^0-9]*\([0-9]\.[0-9.]*\).*$/\1/g'` gccversion=`"$CC" -dumpversion`
if test "x$gccversion" = "x"; then
gccversion=`"$CC" --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[^0-9]*\([0-9]\.[0-9.]*\).*$/\1/g'`
fi
if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
echo 'GCC [34].0.[12] has a bug in the optimizer, disabling "-O#"' echo 'GCC [34].0.[12] has a bug in the optimizer, disabling "-O#"'
CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-O/'` CFLAGS=`echo "$CFLAGS" | sed 's/-O[23456789]/-O/'`
@ -9133,6 +9136,70 @@ fi
done done
if test $ac_cv_header_Xm_XpmP_h = yes; then
echo "$as_me:$LINENO: checking for XpmAttributes_21 in Xm/XpmP.h" >&5
echo $ECHO_N "checking for XpmAttributes_21 in Xm/XpmP.h... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <Xm/XpmP.h>
int
main ()
{
XpmAttributes_21 attr;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; cat >>confdefs.h <<\_ACEOF
#define XPMATTRIBUTES_TYPE XpmAttributes_21
_ACEOF
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; cat >>confdefs.h <<\_ACEOF
#define XPMATTRIBUTES_TYPE XpmAttributes
_ACEOF
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
else
cat >>confdefs.h <<\_ACEOF
#define XPMATTRIBUTES_TYPE XpmAttributes_21
_ACEOF
fi
CPPFLAGS=$cppflags_save CPPFLAGS=$cppflags_save
fi fi

View File

@ -1814,6 +1814,10 @@ buflist_getfile(n, lnum, options, forceit)
text_locked_msg(); text_locked_msg();
return FAIL; return FAIL;
} }
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return FAIL;
#endif
/* altfpos may be changed by getfile(), get it now */ /* altfpos may be changed by getfile(), get it now */
if (lnum == 0) if (lnum == 0)
@ -3316,6 +3320,12 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar, maxwidth, hltab, t
if (fillchar == 0) if (fillchar == 0)
fillchar = ' '; fillchar = ' ';
#ifdef FEAT_MBYTE
/* Can't handle a multi-byte fill character yet. */
else if (mb_char2len(fillchar) > 1)
fillchar = '-';
#endif
/* /*
* Get line & check if empty (cursorpos will show "0-1"). * Get line & check if empty (cursorpos will show "0-1").
* If inversion is possible we use it. Else '=' characters are used. * If inversion is possible we use it. Else '=' characters are used.
@ -4367,6 +4377,14 @@ do_arg_all(count, forceit, keep_tabs)
++autocmd_no_leave; ++autocmd_no_leave;
#endif #endif
win_enter(lastwin, FALSE); win_enter(lastwin, FALSE);
#ifdef FEAT_WINDOWS
/* ":drop all" should re-use an empty window to avoid "--remote-tab"
* leaving an empty tab page when executed locally. */
if (keep_tabs && bufempty() && curbuf->b_nwindows == 1
&& curbuf->b_ffname == NULL && !curbuf->b_changed)
use_firstwin = TRUE;
#endif
for (i = 0; i < count && i < alist->al_ga.ga_len && !got_int; ++i) for (i = 0; i < count && i < alist->al_ga.ga_len && !got_int; ++i)
{ {
if (alist == &global_alist && i == global_alist.al_ga.ga_len - 1) if (alist == &global_alist && i == global_alist.al_ga.ga_len - 1)

View File

@ -243,6 +243,9 @@
#undef HAVE_X11_XMU_EDITRES_H #undef HAVE_X11_XMU_EDITRES_H
#undef HAVE_X11_SM_SMLIB_H #undef HAVE_X11_SM_SMLIB_H
/* Define to the type of the XpmAttributes type. */
#undef XPMATTRIBUTES_TYPE
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
#undef HAVE_SYS_WAIT_H #undef HAVE_SYS_WAIT_H

View File

@ -29,7 +29,12 @@ if test -z "$CFLAGS"; then
test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall" test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce -Wall"
fi fi
if test "$GCC" = yes; then if test "$GCC" = yes; then
gccversion=`"$CC" --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'` dnl method that should work for nearly all versions
gccversion=`"$CC" -dumpversion`
if test "x$gccversion" = "x"; then
dnl old method; fall-back for when -dumpversion doesn't work
gccversion=`"$CC" --version | sed -e '2,$d' -e 's/darwin.//' -e 's/^[[^0-9]]*\([[0-9]]\.[[0-9.]]*\).*$/\1/g'`
fi
dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki dnl version 4.0.1 was reported to cause trouble on Macintosh by Marcin Dalecki
if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then if test "$gccversion" = "3.0.1" -o "$gccversion" = "3.0.2" -o "$gccversion" = "4.0.1"; then
echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"' echo 'GCC [[34]].0.[[12]] has a bug in the optimizer, disabling "-O#"'
@ -1897,6 +1902,17 @@ if test -z "$SKIP_MOTIF"; then
CPPFLAGS="$CPPFLAGS $X_CFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS"
AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \ AC_CHECK_HEADERS(Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h \
Xm/UnhighlightT.h) Xm/UnhighlightT.h)
if test $ac_cv_header_Xm_XpmP_h = yes; then
dnl Solaris uses XpmAttributes_21, very annoying.
AC_MSG_CHECKING([for XpmAttributes_21 in Xm/XpmP.h])
AC_TRY_COMPILE([#include <Xm/XpmP.h>], [XpmAttributes_21 attr;],
AC_MSG_RESULT(yes); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21),
AC_MSG_RESULT(no); AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes)
)
else
AC_DEFINE(XPMATTRIBUTES_TYPE, XpmAttributes_21)
fi
CPPFLAGS=$cppflags_save CPPFLAGS=$cppflags_save
fi fi

View File

@ -1000,7 +1000,8 @@ ex_diffpatch(eap)
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
/* Do filetype detection with the new name. */ /* Do filetype detection with the new name. */
do_cmdline_cmd((char_u *)":doau filetypedetect BufRead"); if (au_has_group((char_u *)"filetypedetect"))
do_cmdline_cmd((char_u *)":doau filetypedetect BufRead");
#endif #endif
} }
} }
@ -2056,6 +2057,19 @@ ex_diffgetput(eap)
aucmd_prepbuf(&aco, curtab->tp_diffbuf[idx_other]); aucmd_prepbuf(&aco, curtab->tp_diffbuf[idx_other]);
} }
/* May give the warning for a changed buffer here, which can trigger the
* FileChangedRO autocommand, which may do nasty things and mess
* everything up. */
if (!curbuf->b_changed)
{
change_warning(0);
if (diff_buf_idx(curbuf) != idx_to)
{
EMSG(_("E787: Buffer changed unexpectedly"));
return;
}
}
dprev = NULL; dprev = NULL;
for (dp = curtab->tp_first_diff; dp != NULL; ) for (dp = curtab->tp_first_diff; dp != NULL; )
{ {
@ -2131,7 +2145,8 @@ ex_diffgetput(eap)
nr = dp->df_lnum[idx_from] + start_skip + i; nr = dp->df_lnum[idx_from] + start_skip + i;
if (nr > curtab->tp_diffbuf[idx_from]->b_ml.ml_line_count) if (nr > curtab->tp_diffbuf[idx_from]->b_ml.ml_line_count)
break; break;
p = vim_strsave(ml_get_buf(curtab->tp_diffbuf[idx_from], nr, FALSE)); p = vim_strsave(ml_get_buf(curtab->tp_diffbuf[idx_from],
nr, FALSE));
if (p != NULL) if (p != NULL)
{ {
ml_append(lnum + i - 1, p, 0, FALSE); ml_append(lnum + i - 1, p, 0, FALSE);
@ -2154,7 +2169,8 @@ ex_diffgetput(eap)
/* Check if there are any other buffers and if the diff is /* Check if there are any other buffers and if the diff is
* equal in them. */ * equal in them. */
for (i = 0; i < DB_COUNT; ++i) for (i = 0; i < DB_COUNT; ++i)
if (curtab->tp_diffbuf[i] != NULL && i != idx_from && i != idx_to if (curtab->tp_diffbuf[i] != NULL && i != idx_from
&& i != idx_to
&& !diff_equal_entry(dp, idx_from, i)) && !diff_equal_entry(dp, idx_from, i))
break; break;
if (i == DB_COUNT) if (i == DB_COUNT)

Binary file not shown.

View File

@ -40,7 +40,7 @@
static char *ctrl_x_msgs[] = static char *ctrl_x_msgs[] =
{ {
N_(" Keyword completion (^N^P)"), /* ctrl_x_mode == 0, ^P/^N compl. */ N_(" Keyword completion (^N^P)"), /* ctrl_x_mode == 0, ^P/^N compl. */
N_(" ^X mode (^]^D^E^F^I^K^L^N^O^P^S^U^V^Y)"), N_(" ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)"),
NULL, NULL,
N_(" Whole line completion (^L^N^P)"), N_(" Whole line completion (^L^N^P)"),
N_(" File name completion (^F^N^P)"), N_(" File name completion (^F^N^P)"),
@ -53,7 +53,7 @@ static char *ctrl_x_msgs[] =
N_(" Command-line completion (^V^N^P)"), N_(" Command-line completion (^V^N^P)"),
N_(" User defined completion (^U^N^P)"), N_(" User defined completion (^U^N^P)"),
N_(" Omni completion (^O^N^P)"), N_(" Omni completion (^O^N^P)"),
N_(" Spelling suggestion (^S^N^P)"), N_(" Spelling suggestion (s^N^P)"),
N_(" Keyword Local completion (^N^P)"), N_(" Keyword Local completion (^N^P)"),
}; };
@ -3139,7 +3139,9 @@ ins_compl_prep(c)
case Ctrl_S: case Ctrl_S:
ctrl_x_mode = CTRL_X_SPELL; ctrl_x_mode = CTRL_X_SPELL;
#ifdef FEAT_SPELL #ifdef FEAT_SPELL
++emsg_off; /* Avoid getting the E756 error twice. */
spell_back_to_badword(); spell_back_to_badword();
--emsg_off;
#endif #endif
break; break;
case Ctrl_RSB: case Ctrl_RSB:
@ -3286,7 +3288,7 @@ ins_compl_prep(c)
if (compl_leader != NULL) if (compl_leader != NULL)
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col); ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
else if (compl_first_match != NULL) else if (compl_first_match != NULL)
ins_bytes(compl_first_match->cp_str ins_bytes(compl_orig_text
+ curwin->w_cursor.col - compl_col); + curwin->w_cursor.col - compl_col);
retval = TRUE; retval = TRUE;
} }

View File

@ -369,6 +369,9 @@ static void list_hashtable_vars __ARGS((hashtab_T *ht, char_u *prefix, int empty
static void list_glob_vars __ARGS((void)); static void list_glob_vars __ARGS((void));
static void list_buf_vars __ARGS((void)); static void list_buf_vars __ARGS((void));
static void list_win_vars __ARGS((void)); static void list_win_vars __ARGS((void));
#ifdef FEAT_WINDOWS
static void list_tab_vars __ARGS((void));
#endif
static void list_vim_vars __ARGS((void)); static void list_vim_vars __ARGS((void));
static void list_script_vars __ARGS((void)); static void list_script_vars __ARGS((void));
static void list_func_vars __ARGS((void)); static void list_func_vars __ARGS((void));
@ -567,6 +570,7 @@ static void f_map __ARGS((typval_T *argvars, typval_T *rettv));
static void f_maparg __ARGS((typval_T *argvars, typval_T *rettv)); static void f_maparg __ARGS((typval_T *argvars, typval_T *rettv));
static void f_mapcheck __ARGS((typval_T *argvars, typval_T *rettv)); static void f_mapcheck __ARGS((typval_T *argvars, typval_T *rettv));
static void f_match __ARGS((typval_T *argvars, typval_T *rettv)); static void f_match __ARGS((typval_T *argvars, typval_T *rettv));
static void f_matcharg __ARGS((typval_T *argvars, typval_T *rettv));
static void f_matchend __ARGS((typval_T *argvars, typval_T *rettv)); static void f_matchend __ARGS((typval_T *argvars, typval_T *rettv));
static void f_matchlist __ARGS((typval_T *argvars, typval_T *rettv)); static void f_matchlist __ARGS((typval_T *argvars, typval_T *rettv));
static void f_matchstr __ARGS((typval_T *argvars, typval_T *rettv)); static void f_matchstr __ARGS((typval_T *argvars, typval_T *rettv));
@ -578,6 +582,7 @@ static void f_mkdir __ARGS((typval_T *argvars, typval_T *rettv));
static void f_mode __ARGS((typval_T *argvars, typval_T *rettv)); static void f_mode __ARGS((typval_T *argvars, typval_T *rettv));
static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv)); static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv));
static void f_nr2char __ARGS((typval_T *argvars, typval_T *rettv)); static void f_nr2char __ARGS((typval_T *argvars, typval_T *rettv));
static void f_pathshorten __ARGS((typval_T *argvars, typval_T *rettv));
static void f_prevnonblank __ARGS((typval_T *argvars, typval_T *rettv)); static void f_prevnonblank __ARGS((typval_T *argvars, typval_T *rettv));
static void f_printf __ARGS((typval_T *argvars, typval_T *rettv)); static void f_printf __ARGS((typval_T *argvars, typval_T *rettv));
static void f_pumvisible __ARGS((typval_T *argvars, typval_T *rettv)); static void f_pumvisible __ARGS((typval_T *argvars, typval_T *rettv));
@ -1685,6 +1690,9 @@ ex_let(eap)
list_glob_vars(); list_glob_vars();
list_buf_vars(); list_buf_vars();
list_win_vars(); list_win_vars();
#ifdef FEAT_WINDOWS
list_tab_vars();
#endif
list_script_vars(); list_script_vars();
list_func_vars(); list_func_vars();
list_vim_vars(); list_vim_vars();
@ -1947,6 +1955,17 @@ list_win_vars()
list_hashtable_vars(&curwin->w_vars.dv_hashtab, (char_u *)"w:", TRUE); list_hashtable_vars(&curwin->w_vars.dv_hashtab, (char_u *)"w:", TRUE);
} }
#ifdef FEAT_WINDOWS
/*
* List tab page variables.
*/
static void
list_tab_vars()
{
list_hashtable_vars(&curtab->tp_vars.dv_hashtab, (char_u *)"t:", TRUE);
}
#endif
/* /*
* List Vim variables. * List Vim variables.
*/ */
@ -2043,6 +2062,9 @@ list_arg_vars(eap, arg)
case 'g': list_glob_vars(); break; case 'g': list_glob_vars(); break;
case 'b': list_buf_vars(); break; case 'b': list_buf_vars(); break;
case 'w': list_win_vars(); break; case 'w': list_win_vars(); break;
#ifdef FEAT_WINDOWS
case 't': list_tab_vars(); break;
#endif
case 'v': list_vim_vars(); break; case 'v': list_vim_vars(); break;
case 's': list_script_vars(); break; case 's': list_script_vars(); break;
case 'l': list_func_vars(); break; case 'l': list_func_vars(); break;
@ -3577,12 +3599,20 @@ get_user_var_name(xp, idx)
static long_u gdone; static long_u gdone;
static long_u bdone; static long_u bdone;
static long_u wdone; static long_u wdone;
#ifdef FEAT_WINDOWS
static long_u tdone;
#endif
static int vidx; static int vidx;
static hashitem_T *hi; static hashitem_T *hi;
hashtab_T *ht; hashtab_T *ht;
if (idx == 0) if (idx == 0)
{
gdone = bdone = wdone = vidx = 0; gdone = bdone = wdone = vidx = 0;
#ifdef FEAT_WINDOWS
tdone = 0;
#endif
}
/* Global variables */ /* Global variables */
if (gdone < globvarht.ht_used) if (gdone < globvarht.ht_used)
@ -3629,6 +3659,21 @@ get_user_var_name(xp, idx)
return cat_prefix_varname('w', hi->hi_key); return cat_prefix_varname('w', hi->hi_key);
} }
#ifdef FEAT_WINDOWS
/* t: variables */
ht = &curtab->tp_vars.dv_hashtab;
if (tdone < ht->ht_used)
{
if (tdone++ == 0)
hi = ht->ht_array;
else
++hi;
while (HASHITEM_EMPTY(hi))
++hi;
return cat_prefix_varname('t', hi->hi_key);
}
#endif
/* v: variables */ /* v: variables */
if (vidx < VV_LEN) if (vidx < VV_LEN)
return cat_prefix_varname('v', (char_u *)vimvars[vidx++].vv_name); return cat_prefix_varname('v', (char_u *)vimvars[vidx++].vv_name);
@ -5697,7 +5742,9 @@ list_append_string(l, str, len)
list_append(l, li); list_append(l, li);
li->li_tv.v_type = VAR_STRING; li->li_tv.v_type = VAR_STRING;
li->li_tv.v_lock = 0; li->li_tv.v_lock = 0;
if ((li->li_tv.vval.v_string = (len >= 0 ? vim_strnsave(str, len) if (str == NULL)
li->li_tv.vval.v_string = NULL;
else if ((li->li_tv.vval.v_string = (len >= 0 ? vim_strnsave(str, len)
: vim_strsave(str))) == NULL) : vim_strsave(str))) == NULL)
return FAIL; return FAIL;
return OK; return OK;
@ -5995,6 +6042,9 @@ garbage_collect()
int i; int i;
funccall_T *fc; funccall_T *fc;
int did_free = FALSE; int did_free = FALSE;
#ifdef FEAT_WINDOWS
tabpage_T *tp;
#endif
/* /*
* 1. Go through all accessible variables and mark all lists and dicts * 1. Go through all accessible variables and mark all lists and dicts
@ -6009,9 +6059,15 @@ garbage_collect()
set_ref_in_ht(&buf->b_vars.dv_hashtab, copyID); set_ref_in_ht(&buf->b_vars.dv_hashtab, copyID);
/* window-local variables */ /* window-local variables */
FOR_ALL_WINDOWS(wp) FOR_ALL_TAB_WINDOWS(tp, wp)
set_ref_in_ht(&wp->w_vars.dv_hashtab, copyID); set_ref_in_ht(&wp->w_vars.dv_hashtab, copyID);
#ifdef FEAT_WINDOWS
/* tabpage-local variables */
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
set_ref_in_ht(&tp->tp_vars.dv_hashtab, copyID);
#endif
/* global variables */ /* global variables */
set_ref_in_ht(&globvarht, copyID); set_ref_in_ht(&globvarht, copyID);
@ -7021,6 +7077,7 @@ static struct fst
{"maparg", 1, 3, f_maparg}, {"maparg", 1, 3, f_maparg},
{"mapcheck", 1, 3, f_mapcheck}, {"mapcheck", 1, 3, f_mapcheck},
{"match", 2, 4, f_match}, {"match", 2, 4, f_match},
{"matcharg", 1, 1, f_matcharg},
{"matchend", 2, 4, f_matchend}, {"matchend", 2, 4, f_matchend},
{"matchlist", 2, 4, f_matchlist}, {"matchlist", 2, 4, f_matchlist},
{"matchstr", 2, 4, f_matchstr}, {"matchstr", 2, 4, f_matchstr},
@ -7032,6 +7089,7 @@ static struct fst
{"mode", 0, 0, f_mode}, {"mode", 0, 0, f_mode},
{"nextnonblank", 1, 1, f_nextnonblank}, {"nextnonblank", 1, 1, f_nextnonblank},
{"nr2char", 1, 1, f_nr2char}, {"nr2char", 1, 1, f_nr2char},
{"pathshorten", 1, 1, f_pathshorten},
{"prevnonblank", 1, 1, f_prevnonblank}, {"prevnonblank", 1, 1, f_prevnonblank},
{"printf", 2, 19, f_printf}, {"printf", 2, 19, f_printf},
{"pumvisible", 0, 0, f_pumvisible}, {"pumvisible", 0, 0, f_pumvisible},
@ -11484,7 +11542,7 @@ f_islocked(argvars, rettv)
} }
} }
else if (lv.ll_range) else if (lv.ll_range)
EMSG(_("E745: Range not allowed")); EMSG(_("E786: Range not allowed"));
else if (lv.ll_newkey != NULL) else if (lv.ll_newkey != NULL)
EMSG2(_(e_dictkey), lv.ll_newkey); EMSG2(_(e_dictkey), lv.ll_newkey);
else if (lv.ll_list != NULL) else if (lv.ll_list != NULL)
@ -12119,6 +12177,30 @@ f_match(argvars, rettv)
find_some_match(argvars, rettv, 1); find_some_match(argvars, rettv, 1);
} }
/*
* "matcharg()" function
*/
static void
f_matcharg(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
if (rettv_list_alloc(rettv) == OK)
{
#ifdef FEAT_SEARCH_EXTRA
int mi = get_tv_number(&argvars[0]);
if (mi >= 1 && mi <= 3)
{
list_append_string(rettv->vval.v_list,
syn_id2name(curwin->w_match_id[mi - 1]), -1);
list_append_string(rettv->vval.v_list,
curwin->w_match_pat[mi - 1], -1);
}
#endif
}
}
/* /*
* "matchend()" function * "matchend()" function
*/ */
@ -12391,6 +12473,29 @@ f_nr2char(argvars, rettv)
rettv->vval.v_string = vim_strsave(buf); rettv->vval.v_string = vim_strsave(buf);
} }
/*
* "pathshorten()" function
*/
static void
f_pathshorten(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
char_u *p;
rettv->v_type = VAR_STRING;
p = get_tv_string_chk(&argvars[0]);
if (p == NULL)
rettv->vval.v_string = NULL;
else
{
p = vim_strsave(p);
rettv->vval.v_string = p;
if (p != NULL)
shorten_dir(p);
}
}
/* /*
* "prevnonblank()" function * "prevnonblank()" function
*/ */
@ -16658,6 +16763,10 @@ set_cmdarg(eap, oldarg)
len = 8; len = 8;
else else
len = 0; len = 0;
if (eap->read_edit)
len += 7;
if (eap->force_ff != 0) if (eap->force_ff != 0)
len += (unsigned)STRLEN(eap->cmd + eap->force_ff) + 6; len += (unsigned)STRLEN(eap->cmd + eap->force_ff) + 6;
# ifdef FEAT_MBYTE # ifdef FEAT_MBYTE
@ -16677,6 +16786,10 @@ set_cmdarg(eap, oldarg)
sprintf((char *)newval, " ++nobin"); sprintf((char *)newval, " ++nobin");
else else
*newval = NUL; *newval = NUL;
if (eap->read_edit)
STRCAT(newval, " ++edit");
if (eap->force_ff != 0) if (eap->force_ff != 0)
sprintf((char *)newval + STRLEN(newval), " ++ff=%s", sprintf((char *)newval + STRLEN(newval), " ++ff=%s",
eap->cmd + eap->force_ff); eap->cmd + eap->force_ff);
@ -17144,6 +17257,9 @@ find_var_in_ht(ht, varname, writing)
case 'v': return &vimvars_var; case 'v': return &vimvars_var;
case 'b': return &curbuf->b_bufvar; case 'b': return &curbuf->b_bufvar;
case 'w': return &curwin->w_winvar; case 'w': return &curwin->w_winvar;
#ifdef FEAT_WINDOWS
case 't': return &curtab->tp_winvar;
#endif
case 'l': return current_funccal == NULL case 'l': return current_funccal == NULL
? NULL : &current_funccal->l_vars_var; ? NULL : &current_funccal->l_vars_var;
case 'a': return current_funccal == NULL case 'a': return current_funccal == NULL
@ -17207,6 +17323,10 @@ find_var_ht(name, varname)
return &curbuf->b_vars.dv_hashtab; return &curbuf->b_vars.dv_hashtab;
if (*name == 'w') /* window variable */ if (*name == 'w') /* window variable */
return &curwin->w_vars.dv_hashtab; return &curwin->w_vars.dv_hashtab;
#ifdef FEAT_WINDOWS
if (*name == 't') /* tab page variable */
return &curtab->tp_vars.dv_hashtab;
#endif
if (*name == 'v') /* v: variable */ if (*name == 'v') /* v: variable */
return &vimvarht; return &vimvarht;
if (*name == 'a' && current_funccal != NULL) /* function argument */ if (*name == 'a' && current_funccal != NULL) /* function argument */
@ -18528,6 +18648,9 @@ ex_function(eap)
fudi.fd_di->di_tv.v_lock = 0; fudi.fd_di->di_tv.v_lock = 0;
fudi.fd_di->di_tv.vval.v_string = vim_strsave(name); fudi.fd_di->di_tv.vval.v_string = vim_strsave(name);
fp->uf_refcount = 1; fp->uf_refcount = 1;
/* behave like "dict" was used */
flags |= FC_DICT;
} }
/* insert the new function in the function list */ /* insert the new function in the function list */

View File

@ -2601,7 +2601,9 @@ do_write(eap)
/* If 'filetype' was empty try detecting it now. */ /* If 'filetype' was empty try detecting it now. */
if (*curbuf->b_p_ft == NUL) if (*curbuf->b_p_ft == NUL)
{ {
(void)do_doautocmd((char_u *)"filetypedetect BufRead", TRUE); if (au_has_group((char_u *)"filetypedetect"))
(void)do_doautocmd((char_u *)"filetypedetect BufRead",
TRUE);
do_modelines(0); do_modelines(0);
} }
#endif #endif
@ -2610,6 +2612,9 @@ do_write(eap)
retval = buf_write(curbuf, ffname, fname, eap->line1, eap->line2, retval = buf_write(curbuf, ffname, fname, eap->line1, eap->line2,
eap, eap->append, eap->forceit, TRUE, FALSE); eap, eap->append, eap->forceit, TRUE, FALSE);
/* After ":saveas fname" reset 'readonly'. */
if (eap->cmdidx == CMD_saveas && retval == OK)
curbuf->b_p_ro = FALSE;
} }
theend: theend:
@ -2698,7 +2703,6 @@ check_overwrite(eap, buf, fname, ffname, other)
} }
swapname = makeswapname(fname, ffname, curbuf, dir); swapname = makeswapname(fname, ffname, curbuf, dir);
r = vim_fexists(swapname); r = vim_fexists(swapname);
vim_free(swapname);
if (r) if (r)
{ {
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
@ -2711,7 +2715,10 @@ check_overwrite(eap, buf, fname, ffname, other)
swapname); swapname);
if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2) if (vim_dialog_yesno(VIM_QUESTION, NULL, buff, 2)
!= VIM_YES) != VIM_YES)
{
vim_free(swapname);
return FAIL; return FAIL;
}
eap->forceit = TRUE; eap->forceit = TRUE;
} }
else else
@ -2719,9 +2726,11 @@ check_overwrite(eap, buf, fname, ffname, other)
{ {
EMSG2(_("E768: Swap file exists: %s (:silent! overrides)"), EMSG2(_("E768: Swap file exists: %s (:silent! overrides)"),
swapname); swapname);
vim_free(swapname);
return FAIL; return FAIL;
} }
} }
vim_free(swapname);
} }
} }
return OK; return OK;
@ -2885,6 +2894,10 @@ getfile(fnum, ffname, sfname, setpm, lnum, forceit)
if (text_locked()) if (text_locked())
return 1; return 1;
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return 1;
#endif
if (fnum == 0) if (fnum == 0)
{ {
@ -4609,7 +4622,7 @@ do_sub(eap)
sub, sub_firstline, FALSE, p_magic, TRUE); sub, sub_firstline, FALSE, p_magic, TRUE);
/* When the match included the "$" of the last line it may /* When the match included the "$" of the last line it may
* include one line too much. */ * go beyond the last line of the buffer. */
if (nmatch > curbuf->b_ml.ml_line_count - sub_firstlnum + 1) if (nmatch > curbuf->b_ml.ml_line_count - sub_firstlnum + 1)
{ {
nmatch = curbuf->b_ml.ml_line_count - sub_firstlnum + 1; nmatch = curbuf->b_ml.ml_line_count - sub_firstlnum + 1;
@ -4701,6 +4714,15 @@ do_sub(eap)
/* Remember next character to be copied. */ /* Remember next character to be copied. */
copycol = regmatch.endpos[0].col; copycol = regmatch.endpos[0].col;
if (skip_match)
{
/* Already hit end of the buffer, sub_firstlnum is one
* less than what it ought to be. */
vim_free(sub_firstline);
sub_firstline = vim_strsave((char_u *)"");
copycol = 0;
}
/* /*
* Now the trick is to replace CTRL-M chars with a real line * Now the trick is to replace CTRL-M chars with a real line
* break. This would make it impossible to insert a CTRL-M in * break. This would make it impossible to insert a CTRL-M in
@ -5418,11 +5440,13 @@ ex_help(eap)
if (tag != NULL) if (tag != NULL)
do_tag(tag, DT_HELP, 1, FALSE, TRUE); do_tag(tag, DT_HELP, 1, FALSE, TRUE);
/* Delete the empty buffer if we're not using it. */ /* Delete the empty buffer if we're not using it. Careful: autocommands
* may have jumped to another window, check that the buffer is not in a
* window. */
if (empty_fnum != 0 && curbuf->b_fnum != empty_fnum) if (empty_fnum != 0 && curbuf->b_fnum != empty_fnum)
{ {
buf = buflist_findnr(empty_fnum); buf = buflist_findnr(empty_fnum);
if (buf != NULL) if (buf != NULL && buf->b_nwindows == 0)
wipe_buffer(buf, TRUE); wipe_buffer(buf, TRUE);
} }

View File

@ -1142,6 +1142,7 @@ struct exarg
int amount; /* number of '>' or '<' for shift command */ int amount; /* number of '>' or '<' for shift command */
int regname; /* register name (NUL if none) */ int regname; /* register name (NUL if none) */
int force_bin; /* 0, FORCE_BIN or FORCE_NOBIN */ int force_bin; /* 0, FORCE_BIN or FORCE_NOBIN */
int read_edit; /* ++edit argument */
int force_ff; /* ++ff= argument (index in cmd[]) */ int force_ff; /* ++ff= argument (index in cmd[]) */
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
int force_enc; /* ++enc= argument (index in cmd[]) */ int force_enc; /* ++enc= argument (index in cmd[]) */

View File

@ -2223,7 +2223,7 @@ ex_listdo(eap)
#endif #endif
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL) #if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
if (eap->cmdidx != CMD_windo) if (eap->cmdidx != CMD_windo && eap->cmdidx != CMD_tabdo)
/* Don't do syntax HL autocommands. Skipping the syntax file is a /* Don't do syntax HL autocommands. Skipping the syntax file is a
* great speed improvement. */ * great speed improvement. */
save_ei = au_event_disable(",Syntax"); save_ei = au_event_disable(",Syntax");
@ -2486,7 +2486,7 @@ source_callback(fname, cookie)
char_u *fname; char_u *fname;
void *cookie; void *cookie;
{ {
(void)do_source(fname, FALSE, FALSE); (void)do_source(fname, FALSE, DOSO_NONE);
} }
/* /*
@ -2669,7 +2669,7 @@ cmd_source(fname, eap)
); );
/* ":source" read ex commands */ /* ":source" read ex commands */
else if (do_source(fname, FALSE, FALSE) == FAIL) else if (do_source(fname, FALSE, DOSO_NONE) == FAIL)
EMSG2(_(e_notopen), fname); EMSG2(_(e_notopen), fname);
} }
@ -2766,7 +2766,7 @@ fopen_noinh_readbin(filename)
do_source(fname, check_other, is_vimrc) do_source(fname, check_other, is_vimrc)
char_u *fname; char_u *fname;
int check_other; /* check for .vimrc and _vimrc */ int check_other; /* check for .vimrc and _vimrc */
int is_vimrc; /* call vimrc_found() when file exists */ int is_vimrc; /* DOSO_ value */
{ {
struct source_cookie cookie; struct source_cookie cookie;
char_u *save_sourcing_name; char_u *save_sourcing_name;
@ -2873,8 +2873,10 @@ do_source(fname, check_other, is_vimrc)
sourcing_lnum, fname); sourcing_lnum, fname);
verbose_leave(); verbose_leave();
} }
if (is_vimrc) if (is_vimrc == DOSO_VIMRC)
vimrc_found(); vimrc_found(fname_exp, (char_u *)"MYVIMRC");
else if (is_vimrc == DOSO_GVIMRC)
vimrc_found(fname_exp, (char_u *)"MYGVIMRC");
#ifdef USE_CRNL #ifdef USE_CRNL
/* If no automatic file format: Set default to CR-NL. */ /* If no automatic file format: Set default to CR-NL. */

View File

@ -2176,6 +2176,14 @@ do_one_cmd(cmdlinep, sourcing,
errormsg = (char_u *)_(e_secure); errormsg = (char_u *)_(e_secure);
goto doend; goto doend;
} }
#ifdef FEAT_AUTOCMD
if (!(ea.argt & CMDWIN)
# ifdef FEAT_USR_CMDS
&& !USER_CMDIDX(ea.cmdidx)
# endif
&& curbuf_locked())
goto doend;
#endif
if (!ni && !(ea.argt & RANGE) && ea.addr_count > 0) if (!ni && !(ea.argt & RANGE) && ea.addr_count > 0)
{ {
@ -4587,6 +4595,14 @@ getargopt(eap)
return OK; return OK;
} }
/* ":read ++edit file" */
if (STRNCMP(arg, "edit", 4) == 0)
{
eap->read_edit = TRUE;
eap->arg = skipwhite(arg + 4);
return OK;
}
if (STRNCMP(arg, "ff", 2) == 0) if (STRNCMP(arg, "ff", 2) == 0)
{ {
arg += 2; arg += 2;
@ -6086,6 +6102,10 @@ ex_quit(eap)
text_locked_msg(); text_locked_msg();
return; return;
} }
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return;
#endif
#ifdef FEAT_NETBEANS_INTG #ifdef FEAT_NETBEANS_INTG
netbeansForcedQuit = eap->forceit; netbeansForcedQuit = eap->forceit;
@ -6155,6 +6175,10 @@ ex_quit_all(eap)
text_locked_msg(); text_locked_msg();
return; return;
} }
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return;
#endif
exiting = TRUE; exiting = TRUE;
if (eap->forceit || !check_changed_any(FALSE)) if (eap->forceit || !check_changed_any(FALSE))
@ -6175,7 +6199,11 @@ ex_close(eap)
cmdwin_result = K_IGNORE; cmdwin_result = K_IGNORE;
else else
# endif # endif
if (!text_locked()) if (!text_locked()
#ifdef FEAT_AUTOCMD
&& !curbuf_locked()
#endif
)
ex_win_close(eap->forceit, curwin, NULL); ex_win_close(eap->forceit, curwin, NULL);
} }
@ -6275,7 +6303,11 @@ ex_tabclose(eap)
return; return;
} }
} }
if (!text_locked()) if (!text_locked()
#ifdef FEAT_AUTOCMD
&& !curbuf_locked()
#endif
)
tabpage_close(eap->forceit); tabpage_close(eap->forceit);
} }
@ -6481,6 +6513,10 @@ ex_exit(eap)
text_locked_msg(); text_locked_msg();
return; return;
} }
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return;
#endif
/* /*
* if more files or windows we won't exit * if more files or windows we won't exit
@ -6596,6 +6632,10 @@ handle_drop(filec, filev, split)
/* Postpone this while editing the command line. */ /* Postpone this while editing the command line. */
if (text_locked()) if (text_locked())
return; return;
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return;
#endif
/* Check whether the current buffer is changed. If so, we will need /* Check whether the current buffer is changed. If so, we will need
* to split the current window or data could be lost. * to split the current window or data could be lost.
@ -10300,7 +10340,7 @@ ex_loadview(eap)
fname = get_view_file(*eap->arg); fname = get_view_file(*eap->arg);
if (fname != NULL) if (fname != NULL)
{ {
do_source(fname, FALSE, FALSE); do_source(fname, FALSE, DOSO_NONE);
vim_free(fname); vim_free(fname);
} }
} }
@ -10658,6 +10698,8 @@ ex_match(eap)
{ {
vim_free(curwin->w_match[mi].regprog); vim_free(curwin->w_match[mi].regprog);
curwin->w_match[mi].regprog = NULL; curwin->w_match[mi].regprog = NULL;
vim_free(curwin->w_match_pat[mi]);
curwin->w_match_pat[mi] = NULL;
redraw_later(SOME_VALID); /* always need a redraw */ redraw_later(SOME_VALID); /* always need a redraw */
} }
@ -10703,12 +10745,14 @@ ex_match(eap)
c = *end; c = *end;
*end = NUL; *end = NUL;
curwin->w_match[mi].regprog = vim_regcomp(p + 1, RE_MAGIC); curwin->w_match[mi].regprog = vim_regcomp(p + 1, RE_MAGIC);
*end = c;
if (curwin->w_match[mi].regprog == NULL) if (curwin->w_match[mi].regprog == NULL)
{ {
EMSG2(_(e_invarg2), p); EMSG2(_(e_invarg2), p);
*end = c;
return; return;
} }
curwin->w_match_pat[mi] = vim_strsave(p + 1);
*end = c;
} }
} }
eap->nextcmd = find_nextcmd(end); eap->nextcmd = find_nextcmd(end);

View File

@ -1942,6 +1942,23 @@ text_locked_msg()
EMSG(_(e_secure)); EMSG(_(e_secure));
} }
#if defined(FEAT_AUTOCMD) || defined(PROTO)
/*
* Check if "curbuf_lock" is set and return TRUE when it is and give an error
* message.
*/
int
curbuf_locked()
{
if (curbuf_lock > 0)
{
EMSG(_("E788: Not allowed to edit another buffer now"));
return TRUE;
}
return FALSE;
}
#endif
static int static int
cmdline_charsize(idx) cmdline_charsize(idx)
int idx; int idx;

View File

@ -753,7 +753,7 @@
/* /*
* GUI tabline * GUI tabline
*/ */
#if defined(FEAT_WINDOWS) && (defined(FEAT_GUI_GTK) \ #if defined(FEAT_WINDOWS) && (defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF)\
|| (defined(FEAT_GUI_MSWIN) && (!defined(_MSC_VER) || _MSC_VER > 1020))) || (defined(FEAT_GUI_MSWIN) && (!defined(_MSC_VER) || _MSC_VER > 1020)))
# define FEAT_GUI_TABLINE # define FEAT_GUI_TABLINE
#endif #endif

View File

@ -217,6 +217,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
{ {
int fd = 0; int fd = 0;
int newfile = (flags & READ_NEW); int newfile = (flags & READ_NEW);
int set_options = newfile || (eap != NULL && eap->read_edit);
int check_readonly; int check_readonly;
int filtering = (flags & READ_FILTER); int filtering = (flags & READ_FILTER);
int read_stdin = (flags & READ_STDIN); int read_stdin = (flags & READ_STDIN);
@ -416,7 +417,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
#endif #endif
/* set default 'fileformat' */ /* set default 'fileformat' */
if (newfile) if (set_options)
{ {
if (eap != NULL && eap->force_ff != 0) if (eap != NULL && eap->force_ff != 0)
set_fileformat(get_fileformat_force(curbuf, eap), OPT_LOCAL); set_fileformat(get_fileformat_force(curbuf, eap), OPT_LOCAL);
@ -622,7 +623,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
if ((check_readonly && file_readonly) || curbuf->b_help) if ((check_readonly && file_readonly) || curbuf->b_help)
curbuf->b_p_ro = TRUE; curbuf->b_p_ro = TRUE;
if (newfile) if (set_options)
{ {
curbuf->b_p_eol = TRUE; curbuf->b_p_eol = TRUE;
curbuf->b_start_eol = TRUE; curbuf->b_start_eol = TRUE;
@ -769,7 +770,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
if (eap != NULL && eap->bad_char != 0) if (eap != NULL && eap->bad_char != 0)
{ {
bad_char_behavior = eap->bad_char; bad_char_behavior = eap->bad_char;
if (newfile) if (set_options)
curbuf->b_bad_char = eap->bad_char; curbuf->b_bad_char = eap->bad_char;
} }
else else
@ -884,7 +885,7 @@ retry:
ml_delete(lnum--, FALSE); ml_delete(lnum--, FALSE);
file_rewind = FALSE; file_rewind = FALSE;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
if (newfile) if (set_options)
curbuf->b_p_bomb = FALSE; curbuf->b_p_bomb = FALSE;
conv_error = 0; conv_error = 0;
#endif #endif
@ -1326,7 +1327,7 @@ retry:
filesize += blen; filesize += blen;
size -= blen; size -= blen;
mch_memmove(ptr, ptr + blen, (size_t)size); mch_memmove(ptr, ptr + blen, (size_t)size);
if (newfile) if (set_options)
curbuf->b_p_bomb = TRUE; curbuf->b_p_bomb = TRUE;
} }
@ -1955,7 +1956,7 @@ rewind_retry:
fileformat = default_fileformat(); fileformat = default_fileformat();
/* if editing a new file: may set p_tx and p_ff */ /* if editing a new file: may set p_tx and p_ff */
if (newfile) if (set_options)
set_fileformat(fileformat, OPT_LOCAL); set_fileformat(fileformat, OPT_LOCAL);
} }
} }
@ -2037,7 +2038,7 @@ rewind_retry:
|| lseek(fd, (off_t)0L, SEEK_SET) == 0)) || lseek(fd, (off_t)0L, SEEK_SET) == 0))
{ {
fileformat = EOL_UNIX; fileformat = EOL_UNIX;
if (newfile) if (set_options)
set_fileformat(EOL_UNIX, OPT_LOCAL); set_fileformat(EOL_UNIX, OPT_LOCAL);
file_rewind = TRUE; file_rewind = TRUE;
keep_fileformat = TRUE; keep_fileformat = TRUE;
@ -2087,7 +2088,8 @@ failed:
&& *line_start == Ctrl_Z && *line_start == Ctrl_Z
&& ptr == line_start + 1)) && ptr == line_start + 1))
{ {
if (newfile) /* remember for when writing */ /* remember for when writing */
if (set_options)
curbuf->b_p_eol = FALSE; curbuf->b_p_eol = FALSE;
*ptr = NUL; *ptr = NUL;
if (ml_append(lnum, line_start, if (ml_append(lnum, line_start,
@ -2097,7 +2099,7 @@ failed:
read_no_eol_lnum = ++lnum; read_no_eol_lnum = ++lnum;
} }
if (newfile) if (set_options)
save_file_ff(curbuf); /* remember the current file format */ save_file_ff(curbuf); /* remember the current file format */
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
@ -2106,8 +2108,9 @@ failed:
#endif #endif
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
/* If editing a new file: set 'fenc' for the current buffer. */ /* If editing a new file: set 'fenc' for the current buffer.
if (newfile) * Also for ":read ++edit file". */
if (set_options)
set_string_option_direct((char_u *)"fenc", -1, fenc, set_string_option_direct((char_u *)"fenc", -1, fenc,
OPT_FREE|OPT_LOCAL, 0); OPT_FREE|OPT_LOCAL, 0);
if (fenc_alloced) if (fenc_alloced)
@ -2398,7 +2401,7 @@ failed:
/* Save the fileformat now, otherwise the buffer will be considered /* Save the fileformat now, otherwise the buffer will be considered
* modified if the format/encoding was automatically detected. */ * modified if the format/encoding was automatically detected. */
if (newfile) if (set_options)
save_file_ff(curbuf); save_file_ff(curbuf);
/* /*
@ -2482,6 +2485,7 @@ prep_exarg(eap, buf)
eap->force_ff = 7; eap->force_ff = 7;
eap->force_bin = buf->b_p_bin ? FORCE_BIN : FORCE_NOBIN; eap->force_bin = buf->b_p_bin ? FORCE_BIN : FORCE_NOBIN;
eap->read_edit = FALSE;
eap->forceit = FALSE; eap->forceit = FALSE;
return OK; return OK;
} }
@ -3705,7 +3709,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
} }
#endif #endif
/* When using ":w!" and writing to the current file, readonly makes no /* When using ":w!" and writing to the current file, 'readonly' makes no
* sense, reset it, unless 'Z' appears in 'cpoptions'. */ * sense, reset it, unless 'Z' appears in 'cpoptions'. */
if (forceit && overwriting && vim_strchr(p_cpo, CPO_KEEPRO) == NULL) if (forceit && overwriting && vim_strchr(p_cpo, CPO_KEEPRO) == NULL)
{ {
@ -4653,7 +4657,7 @@ set_rw_fname(fname, sfname)
/* Do filetype detection now if 'filetype' is empty. */ /* Do filetype detection now if 'filetype' is empty. */
if (*curbuf->b_p_ft == NUL) if (*curbuf->b_p_ft == NUL)
{ {
if (au_find_group((char_u *)"filetypedetect") != AUGROUP_ERROR) if (au_has_group((char_u *)"filetypedetect"))
(void)do_doautocmd((char_u *)"filetypedetect BufRead", FALSE); (void)do_doautocmd((char_u *)"filetypedetect BufRead", FALSE);
do_modelines(0); do_modelines(0);
} }
@ -7321,7 +7325,6 @@ au_find_group(name)
return AUGROUP_ERROR; return AUGROUP_ERROR;
} }
#if defined(FEAT_BROWSE) || defined(PROTO)
/* /*
* Return TRUE if augroup "name" exists. * Return TRUE if augroup "name" exists.
*/ */
@ -7331,7 +7334,6 @@ au_has_group(name)
{ {
return au_find_group(name) != AUGROUP_ERROR; return au_find_group(name) != AUGROUP_ERROR;
} }
#endif
/* /*
* ":augroup {name}". * ":augroup {name}".

View File

@ -1058,6 +1058,7 @@ typebuf_typed()
return typebuf.tb_maplen == 0; return typebuf.tb_maplen == 0;
} }
#if defined(FEAT_VISUAL) || defined(PROTO)
/* /*
* Return the number of characters that are mapped (or not typed). * Return the number of characters that are mapped (or not typed).
*/ */
@ -1066,6 +1067,7 @@ typebuf_maplen()
{ {
return typebuf.tb_maplen; return typebuf.tb_maplen;
} }
#endif
/* /*
* remove "len" characters from typebuf.tb_buf[typebuf.tb_off + offset] * remove "len" characters from typebuf.tb_buf[typebuf.tb_off + offset]
@ -4743,10 +4745,12 @@ static struct initmap
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
/* Use the Windows (CUA) keybindings. */ /* Use the Windows (CUA) keybindings. */
# ifdef FEAT_GUI # ifdef FEAT_GUI
# if 0 /* These are now used to move tab pages */
{(char_u *)"<C-PageUp> H", NORMAL+VIS_SEL}, {(char_u *)"<C-PageUp> H", NORMAL+VIS_SEL},
{(char_u *)"<C-PageUp> <C-O>H",INSERT}, {(char_u *)"<C-PageUp> <C-O>H",INSERT},
{(char_u *)"<C-PageDown> L$", NORMAL+VIS_SEL}, {(char_u *)"<C-PageDown> L$", NORMAL+VIS_SEL},
{(char_u *)"<C-PageDown> <C-O>L<C-O>$", INSERT}, {(char_u *)"<C-PageDown> <C-O>L<C-O>$", INSERT},
# endif
/* paste, copy and cut */ /* paste, copy and cut */
{(char_u *)"<S-Insert> \"*P", NORMAL}, {(char_u *)"<S-Insert> \"*P", NORMAL},
@ -4758,10 +4762,12 @@ static struct initmap
{(char_u *)"<C-X> \"*d", VIS_SEL}, {(char_u *)"<C-X> \"*d", VIS_SEL},
/* Missing: CTRL-C (cancel) and CTRL-V (block selection) */ /* Missing: CTRL-C (cancel) and CTRL-V (block selection) */
# else # else
# if 0 /* These are now used to move tab pages */
{(char_u *)"\316\204 H", NORMAL+VIS_SEL}, /* CTRL-PageUp is "H" */ {(char_u *)"\316\204 H", NORMAL+VIS_SEL}, /* CTRL-PageUp is "H" */
{(char_u *)"\316\204 \017H",INSERT}, /* CTRL-PageUp is "^OH"*/ {(char_u *)"\316\204 \017H",INSERT}, /* CTRL-PageUp is "^OH"*/
{(char_u *)"\316v L$", NORMAL+VIS_SEL}, /* CTRL-PageDown is "L$" */ {(char_u *)"\316v L$", NORMAL+VIS_SEL}, /* CTRL-PageDown is "L$" */
{(char_u *)"\316v \017L\017$", INSERT}, /* CTRL-PageDown ="^OL^O$"*/ {(char_u *)"\316v \017L\017$", INSERT}, /* CTRL-PageDown ="^OL^O$"*/
# endif
{(char_u *)"\316w <C-Home>", NORMAL+VIS_SEL}, {(char_u *)"\316w <C-Home>", NORMAL+VIS_SEL},
{(char_u *)"\316w <C-Home>", INSERT+CMDLINE}, {(char_u *)"\316w <C-Home>", INSERT+CMDLINE},
{(char_u *)"\316u <C-End>", NORMAL+VIS_SEL}, {(char_u *)"\316u <C-End>", NORMAL+VIS_SEL},

View File

@ -595,6 +595,11 @@ EXTERN int textlock INIT(= 0);
/* non-zero when changing text and jumping to /* non-zero when changing text and jumping to
* another window or buffer is not allowed */ * another window or buffer is not allowed */
#ifdef FEAT_AUTOCMD
EXTERN int curbuf_lock INIT(= 0);
/* non-zero when the current buffer can't be
* changed. Used for FileChangedRO. */
#endif
#ifdef FEAT_EVAL #ifdef FEAT_EVAL
# define HAVE_SANDBOX # define HAVE_SANDBOX
EXTERN int sandbox INIT(= 0); EXTERN int sandbox INIT(= 0);

View File

@ -335,7 +335,7 @@ gui_init()
if (vim_strchr(p_go, GO_NOSYSMENU) == NULL) if (vim_strchr(p_go, GO_NOSYSMENU) == NULL)
{ {
sys_menu = TRUE; sys_menu = TRUE;
do_source((char_u *)SYS_MENU_FILE, FALSE, FALSE); do_source((char_u *)SYS_MENU_FILE, FALSE, DOSO_NONE);
sys_menu = FALSE; sys_menu = FALSE;
} }
#endif #endif
@ -356,7 +356,7 @@ gui_init()
{ {
if (STRCMP(use_gvimrc, "NONE") != 0 if (STRCMP(use_gvimrc, "NONE") != 0
&& STRCMP(use_gvimrc, "NORC") != 0 && STRCMP(use_gvimrc, "NORC") != 0
&& do_source(use_gvimrc, FALSE, FALSE) != OK) && do_source(use_gvimrc, FALSE, DOSO_NONE) != OK)
EMSG2(_("E230: Cannot read from \"%s\""), use_gvimrc); EMSG2(_("E230: Cannot read from \"%s\""), use_gvimrc);
} }
else else
@ -365,7 +365,7 @@ gui_init()
* Get system wide defaults for gvim, only when file name defined. * Get system wide defaults for gvim, only when file name defined.
*/ */
#ifdef SYS_GVIMRC_FILE #ifdef SYS_GVIMRC_FILE
do_source((char_u *)SYS_GVIMRC_FILE, FALSE, FALSE); do_source((char_u *)SYS_GVIMRC_FILE, FALSE, DOSO_NONE);
#endif #endif
/* /*
@ -378,14 +378,16 @@ gui_init()
* The first that exists is used, the rest is ignored. * The first that exists is used, the rest is ignored.
*/ */
if (process_env((char_u *)"GVIMINIT", FALSE) == FAIL if (process_env((char_u *)"GVIMINIT", FALSE) == FAIL
&& do_source((char_u *)USR_GVIMRC_FILE, TRUE, TRUE) == FAIL && do_source((char_u *)USR_GVIMRC_FILE, TRUE,
DOSO_GVIMRC) == FAIL
#ifdef USR_GVIMRC_FILE2 #ifdef USR_GVIMRC_FILE2
&& do_source((char_u *)USR_GVIMRC_FILE2, TRUE, TRUE) == FAIL && do_source((char_u *)USR_GVIMRC_FILE2, TRUE,
DOSO_GVIMRC) == FAIL
#endif #endif
) )
{ {
#ifdef USR_GVIMRC_FILE3 #ifdef USR_GVIMRC_FILE3
(void)do_source((char_u *)USR_GVIMRC_FILE3, TRUE, TRUE); (void)do_source((char_u *)USR_GVIMRC_FILE3, TRUE, DOSO_GVIMRC);
#endif #endif
} }
@ -429,7 +431,7 @@ gui_init()
(char_u *)GVIMRC_FILE, FALSE) != FPC_SAME (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME
#endif #endif
) )
do_source((char_u *)GVIMRC_FILE, TRUE, TRUE); do_source((char_u *)GVIMRC_FILE, TRUE, DOSO_GVIMRC);
if (secure == 2) if (secure == 2)
need_wait_return = TRUE; need_wait_return = TRUE;
@ -1142,7 +1144,8 @@ gui_position_components(total_width)
text_area_y = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT; text_area_y = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT;
#endif #endif
#if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_MSWIN) # if defined(FEAT_GUI_TABLINE) && (defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_MOTIF))
if (gui_has_tabline()) if (gui_has_tabline())
text_area_y += TABLINE_HEIGHT; text_area_y += TABLINE_HEIGHT;
#endif #endif
@ -1228,9 +1231,10 @@ gui_get_base_height()
base_height += gui.toolbar_height; base_height += gui.toolbar_height;
# endif # endif
# endif # endif
# if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_MSWIN) # if defined(FEAT_GUI_TABLINE) && (defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_MOTIF))
if (gui_has_tabline()) if (gui_has_tabline())
base_height += TABLINE_HEIGHT; base_height += TABLINE_HEIGHT;
# endif # endif
# ifdef FEAT_FOOTER # ifdef FEAT_FOOTER
if (vim_strchr(p_go, GO_FOOTER) != NULL) if (vim_strchr(p_go, GO_FOOTER) != NULL)
@ -3448,8 +3452,9 @@ get_tabline_label(tp)
} }
else else
{ {
/* Get the buffer name into NameBuff[] */ /* Get the buffer name into NameBuff[] and shorten it. */
get_trans_bufname(tp == curtab ? curbuf : tp->tp_curwin->w_buffer); get_trans_bufname(tp == curtab ? curbuf : tp->tp_curwin->w_buffer);
shorten_dir(NameBuff);
wp = (tp == curtab) ? firstwin : tp->tp_firstwin; wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount) for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount)
@ -4571,11 +4576,11 @@ xy2win(x, y)
update_mouseshape(SHAPE_IDX_CLINE); update_mouseshape(SHAPE_IDX_CLINE);
# ifdef FEAT_VERTSPLIT # ifdef FEAT_VERTSPLIT
else if (!(State & CMDLINE) && W_VSEP_WIDTH(wp) > 0 && col == wp->w_width else if (!(State & CMDLINE) && W_VSEP_WIDTH(wp) > 0 && col == wp->w_width
&& (row != wp->w_height || !stl_connected(wp))) && (row != wp->w_height || !stl_connected(wp)) && msg_scrolled == 0)
update_mouseshape(SHAPE_IDX_VSEP); update_mouseshape(SHAPE_IDX_VSEP);
# endif # endif
else if (!(State & CMDLINE) && W_STATUS_HEIGHT(wp) > 0 else if (!(State & CMDLINE) && W_STATUS_HEIGHT(wp) > 0
&& row == wp->w_height) && row == wp->w_height && msg_scrolled == 0)
update_mouseshape(SHAPE_IDX_STATUS); update_mouseshape(SHAPE_IDX_STATUS);
else else
update_mouseshape(-2); update_mouseshape(-2);
@ -4825,6 +4830,7 @@ concat_esc(gap, text, what)
{ {
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
int l = (*mb_ptr2len)(text); int l = (*mb_ptr2len)(text);
if (l > 1) if (l > 1)
{ {
while (--l >= 0) while (--l >= 0)

View File

@ -161,6 +161,9 @@
#ifdef FEAT_GUI_MSWIN #ifdef FEAT_GUI_MSWIN
# define TABLINE_HEIGHT 22 # define TABLINE_HEIGHT 22
#endif #endif
#ifdef FEAT_GUI_MOTIF
# define TABLINE_HEIGHT 30
#endif
#if defined(NO_CONSOLE) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) #if defined(NO_CONSOLE) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
# define NO_CONSOLE_INPUT /* use no_console_input() to check if there # define NO_CONSOLE_INPUT /* use no_console_input() to check if there

View File

@ -9,10 +9,6 @@
#ifndef __GTK_FORM_H__ #ifndef __GTK_FORM_H__
#define __GTK_FORM_H__ #define __GTK_FORM_H__
#ifdef VMS
# include "gui_gtk_vms.h"
#endif
#include <gdk/gdk.h> #include <gdk/gdk.h>
#include <gtk/gtkcontainer.h> #include <gtk/gtkcontainer.h>

View File

@ -77,6 +77,7 @@
/* INTRINSIC.H omits proto if XtFree is defined */ /* INTRINSIC.H omits proto if XtFree is defined */
/* VMS_BEGIN_C_PLUS_PLUS */ /* VMS_BEGIN_C_PLUS_PLUS */
extern void XtFree(char*); extern void XtFree(char*);
extern void XTFREE(char*);
/* VMS_END_C_PLUS_PLUS */ /* VMS_END_C_PLUS_PLUS */
#define _XRegisterFilterByType _XREGISTERFILTERBYTYPE #define _XRegisterFilterByType _XREGISTERFILTERBYTYPE
@ -123,6 +124,7 @@ extern void XtFree(char*);
#define XCreateRegion XCREATEREGION #define XCreateRegion XCREATEREGION
#define XCreateSimpleWindow XCREATESIMPLEWINDOW #define XCreateSimpleWindow XCREATESIMPLEWINDOW
#define XCreateWindow XCREATEWINDOW #define XCreateWindow XCREATEWINDOW
#define XDefaultRootWindow XDEFAULTROOTWINDOW
#define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY #define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY
#define XDefineCursor XDEFINECURSOR #define XDefineCursor XDEFINECURSOR
#define XDeleteProperty XDELETEPROPERTY #define XDeleteProperty XDELETEPROPERTY
@ -186,6 +188,7 @@ extern void XtFree(char*);
#define XGetSubImage XGETSUBIMAGE #define XGetSubImage XGETSUBIMAGE
#define XGetVisualInfo XGETVISUALINFO #define XGetVisualInfo XGETVISUALINFO
#define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS #define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS
#define XGetWMIconName XGETWMICONNAME
#define XGetWMProtocols XGETWMPROTOCOLS #define XGetWMProtocols XGETWMPROTOCOLS
#define XGetWMHints XGETWMHINTS #define XGetWMHints XGETWMHINTS
#define XGetWMName XGETWMNAME #define XGetWMName XGETWMNAME
@ -289,6 +292,7 @@ extern void XtFree(char*);
#define XShapeCombineRectangles XSHAPECOMBINERECTANGLES #define XShapeCombineRectangles XSHAPECOMBINERECTANGLES
#define XShapeGetRectangles XSHAPEGETRECTANGLES #define XShapeGetRectangles XSHAPEGETRECTANGLES
#define XShrinkRegion XSHRINKREGION #define XShrinkRegion XSHRINKREGION
#define XStoreBuffer XSTOREBUFFER
#define XStoreColor XSTORECOLOR #define XStoreColor XSTORECOLOR
#define XStoreColors XSTORECOLORS #define XStoreColors XSTORECOLORS
#define XStoreName XSTORENAME #define XStoreName XSTORENAME
@ -603,7 +607,9 @@ extern void XtFree(char*);
#define XtUnmanageChild XTUNMANAGECHILD #define XtUnmanageChild XTUNMANAGECHILD
#define XtUnmanageChildren XTUNMANAGECHILDREN #define XtUnmanageChildren XTUNMANAGECHILDREN
#define XtUnrealizeWidget XTUNREALIZEWIDGET #define XtUnrealizeWidget XTUNREALIZEWIDGET
#define XtVaAppCreateShell XTVAAPPCREATESHELL
#define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET #define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET
#define XtVaCreatePopupShell XTVACREATEPOPUPSHELL
#define XtVaCreateWidget XTVACREATEWIDGET #define XtVaCreateWidget XTVACREATEWIDGET
#define XtVaGetValues XTVAGETVALUES #define XtVaGetValues XTVAGETVALUES
#define XtVaSetValues XTVASETVALUES #define XtVaSetValues XTVASETVALUES

Binary file not shown.

View File

@ -26,6 +26,7 @@
#include <Xm/LabelG.h> #include <Xm/LabelG.h>
#include <Xm/ToggleBG.h> #include <Xm/ToggleBG.h>
#include <Xm/SeparatoG.h> #include <Xm/SeparatoG.h>
#include <Xm/Notebook.h>
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/Xatom.h> #include <X11/Xatom.h>
@ -63,6 +64,11 @@ Widget textArea;
static Widget toolBarFrame; static Widget toolBarFrame;
static Widget toolBar; static Widget toolBar;
#endif #endif
#ifdef FEAT_GUI_TABLINE
static Widget tabLine;
static Widget tabLine_menu = 0;
static int showing_tabline = 0;
#endif
#ifdef FEAT_FOOTER #ifdef FEAT_FOOTER
static Widget footer; static Widget footer;
#endif #endif
@ -75,6 +81,11 @@ static Widget menuBar;
#endif #endif
static void scroll_cb __ARGS((Widget w, XtPointer client_data, XtPointer call_data)); static void scroll_cb __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
#ifdef FEAT_GUI_TABLINE
static void tabline_cb __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
static void tabline_button_cb __ARGS((Widget w, XtPointer client_data, XtPointer call_data));
static void tabline_menu_cb __ARGS((Widget w, XtPointer closure, XEvent *e, Boolean *continue_dispatch));
#endif
#ifdef FEAT_TOOLBAR #ifdef FEAT_TOOLBAR
# ifdef FEAT_FOOTER # ifdef FEAT_FOOTER
static void toolbarbutton_enter_cb __ARGS((Widget, XtPointer, XEvent *, Boolean *)); static void toolbarbutton_enter_cb __ARGS((Widget, XtPointer, XEvent *, Boolean *));
@ -120,6 +131,76 @@ scroll_cb(w, client_data, call_data)
gui_drag_scrollbar(sb, value, dragging); gui_drag_scrollbar(sb, value, dragging);
} }
#ifdef FEAT_GUI_TABLINE
/*ARGSUSED*/
static void
tabline_cb(w, client_data, call_data)
Widget w;
XtPointer client_data, call_data;
{
XmNotebookCallbackStruct *nptr;
nptr = (XmNotebookCallbackStruct *)call_data;
if (nptr->reason != (int)XmCR_NONE)
send_tabline_event(nptr->page_number);
}
/*ARGSUSED*/
static void
tabline_button_cb(w, client_data, call_data)
Widget w;
XtPointer client_data, call_data;
{
char_u string[3];
int cmd, tab_idx;
XtVaGetValues(w, XmNuserData, &cmd, NULL);
XtVaGetValues(tabLine_menu, XmNuserData, &tab_idx, NULL);
string[0] = CSI;
string[1] = KS_TABMENU;
string[2] = KE_FILLER;
add_to_input_buf(string, 3);
string[0] = tab_idx;
string[1] = (char_u)(long)cmd;
add_to_input_buf_csi(string, 2);
}
/*ARGSUSED*/
static void
tabline_menu_cb(w, closure, e, continue_dispatch)
Widget w;
XtPointer closure;
XEvent *e;
Boolean *continue_dispatch;
{
Widget tab_w;
XButtonPressedEvent *event;
int tab_idx = 0;
WidgetList children;
Cardinal numChildren;
event = (XButtonPressedEvent *)e;
if (event->button != Button3)
return;
if (event->subwindow != None)
{
tab_w = XtWindowToWidget(XtDisplay(w), event->subwindow);
if (tab_w != (Widget)0 && XmIsPushButton(tab_w))
XtVaGetValues(tab_w, XmNpageNumber, &tab_idx, NULL);
}
XtVaSetValues(tabLine_menu, XmNuserData, tab_idx, NULL);
XtVaGetValues(tabLine_menu, XmNchildren, &children, XmNnumChildren,
&numChildren, NULL);
XtManageChildren(children, numChildren);
XmMenuPosition(tabLine_menu, (XButtonPressedEvent *)e) ;
XtManageChild(tabLine_menu);
}
#endif
/* /*
* End of call-back routines * End of call-back routines
*/ */
@ -222,6 +303,13 @@ label_expose(_w, _event, _region)
void void
gui_x11_create_widgets() gui_x11_create_widgets()
{ {
#ifdef FEAT_GUI_TABLINE
Widget button;
Arg args[10];
int n;
XmString xms;
#endif
/* /*
* Install the 3D shade effect drawing routines. * Install the 3D shade effect drawing routines.
*/ */
@ -318,6 +406,57 @@ gui_x11_create_widgets()
#endif #endif
#ifdef FEAT_GUI_TABLINE
/* Create the Vim GUI tabline */
n = 0;
XtSetArg(args[n], XmNbindingType, XmNONE); n++;
XtSetArg(args[n], XmNorientation, XmVERTICAL); n++;
XtSetArg(args[n], XmNbackPageSize, XmNONE); n++;
XtSetArg(args[n], XmNbackPageNumber, 0); n++;
XtSetArg(args[n], XmNbackPagePlacement, XmTOP_RIGHT); n++;
XtSetArg(args[n], XmNmajorTabSpacing, 0); n++;
XtSetArg(args[n], XmNshadowThickness, 0); n++;
XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM); n++;
XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM); n++;
tabLine = XmCreateNotebook(vimForm, "Vim tabline", args, n);
XtAddCallback(tabLine, XmNpageChangedCallback, (XtCallbackProc)tabline_cb,
NULL);
XtAddEventHandler(tabLine, ButtonPressMask, False,
(XtEventHandler)tabline_menu_cb, NULL);
/* Create the tabline popup menu */
tabLine_menu = XmCreatePopupMenu(tabLine, "tabline popup", NULL, 0);
/* Add the buttons to the menu */
n = 0;
XtSetArg(args[n], XmNuserData, TABLINE_MENU_CLOSE); n++;
xms = XmStringCreate((char *)"Close tab", STRING_TAG);
XtSetArg(args[n], XmNlabelString, xms); n++;
button = XmCreatePushButton(tabLine_menu, "Close", args, n);
XtAddCallback(button, XmNactivateCallback,
(XtCallbackProc)tabline_button_cb, NULL);
XmStringFree(xms);
n = 0;
XtSetArg(args[n], XmNuserData, TABLINE_MENU_NEW); n++;
xms = XmStringCreate((char *)"New Tab", STRING_TAG);
XtSetArg(args[n], XmNlabelString, xms); n++;
button = XmCreatePushButton(tabLine_menu, "New Tab", args, n);
XtAddCallback(button, XmNactivateCallback,
(XtCallbackProc)tabline_button_cb, NULL);
XmStringFree(xms);
n = 0;
XtSetArg(args[n], XmNuserData, TABLINE_MENU_OPEN); n++;
xms = XmStringCreate((char *)"Open tab...", STRING_TAG);
XtSetArg(args[n], XmNlabelString, xms); n++;
button = XmCreatePushButton(tabLine_menu, "Open tab...", args, n);
XtAddCallback(button, XmNactivateCallback,
(XtCallbackProc)tabline_button_cb, NULL);
XmStringFree(xms);
#endif
textAreaForm = XtVaCreateManagedWidget("textAreaForm", textAreaForm = XtVaCreateManagedWidget("textAreaForm",
xmFormWidgetClass, vimForm, xmFormWidgetClass, vimForm,
XmNleftAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM,
@ -550,18 +689,46 @@ gui_mch_enable_menu(flag)
XmNtopAttachment, XmATTACH_WIDGET, XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, menuBar, XmNtopWidget, menuBar,
NULL); NULL);
XtVaSetValues(textAreaForm, #ifdef FEAT_GUI_TABLINE
XmNtopAttachment, XmATTACH_WIDGET, if (showing_tabline)
XmNtopWidget, XtParent(toolBar), {
NULL); XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, XtParent(toolBar),
NULL);
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, tabLine,
NULL);
}
else
#endif
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, XtParent(toolBar),
NULL);
} }
else else
#endif #endif
{ {
XtVaSetValues(textAreaForm, #ifdef FEAT_GUI_TABLINE
XmNtopAttachment, XmATTACH_WIDGET, if (showing_tabline)
XmNtopWidget, menuBar, {
NULL); XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, menuBar,
NULL);
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, tabLine,
NULL);
}
else
#endif
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, menuBar,
NULL);
} }
} }
else else
@ -573,17 +740,44 @@ gui_mch_enable_menu(flag)
XtVaSetValues(XtParent(toolBar), XtVaSetValues(XtParent(toolBar),
XmNtopAttachment, XmATTACH_FORM, XmNtopAttachment, XmATTACH_FORM,
NULL); NULL);
XtVaSetValues(textAreaForm, #ifdef FEAT_GUI_TABLINE
XmNtopAttachment, XmATTACH_WIDGET, if (showing_tabline)
XmNtopWidget, XtParent(toolBar), {
NULL); XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, XtParent(toolBar),
NULL);
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, tabLine,
NULL);
}
else
#endif
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, XtParent(toolBar),
NULL);
} }
else else
#endif #endif
{ {
XtVaSetValues(textAreaForm, #ifdef FEAT_GUI_TABLINE
XmNtopAttachment, XmATTACH_FORM, if (showing_tabline)
NULL); {
XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_FORM,
NULL);
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, tabLine,
NULL);
}
else
#endif
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_FORM,
NULL);
} }
} }
@ -2770,10 +2964,24 @@ gui_mch_show_toolbar(int showit)
} }
gui.toolbar_height = gui_mch_compute_toolbar_height(); gui.toolbar_height = gui_mch_compute_toolbar_height();
XtManageChild(XtParent(toolBar)); XtManageChild(XtParent(toolBar));
XtVaSetValues(textAreaForm, #ifdef FEAT_GUI_TABLINE
XmNtopAttachment, XmATTACH_WIDGET, if (showing_tabline)
XmNtopWidget, XtParent(toolBar), {
NULL); XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, XtParent(toolBar),
NULL);
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, tabLine,
NULL);
}
else
#endif
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, XtParent(toolBar),
NULL);
if (XtIsManaged(menuBar)) if (XtIsManaged(menuBar))
XtVaSetValues(XtParent(toolBar), XtVaSetValues(XtParent(toolBar),
XmNtopAttachment, XmATTACH_WIDGET, XmNtopAttachment, XmATTACH_WIDGET,
@ -2788,14 +2996,45 @@ gui_mch_show_toolbar(int showit)
{ {
gui.toolbar_height = 0; gui.toolbar_height = 0;
if (XtIsManaged(menuBar)) if (XtIsManaged(menuBar))
XtVaSetValues(textAreaForm, {
XmNtopAttachment, XmATTACH_WIDGET, #ifdef FEAT_GUI_TABLINE
XmNtopWidget, menuBar, if (showing_tabline)
NULL); {
XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, menuBar,
NULL);
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, tabLine,
NULL);
}
else
#endif
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, menuBar,
NULL);
}
else else
XtVaSetValues(textAreaForm, {
XmNtopAttachment, XmATTACH_FORM, #ifdef FEAT_GUI_TABLINE
NULL); if (showing_tabline)
{
XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_FORM,
NULL);
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, tabLine,
NULL);
}
else
#endif
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_FORM,
NULL);
}
XtUnmanageChild(XtParent(toolBar)); XtUnmanageChild(XtParent(toolBar));
} }
@ -2914,6 +3153,165 @@ toolbarbutton_leave_cb(w, client_data, event, cont)
# endif # endif
#endif #endif
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
/*
* Show or hide the tabline.
*/
void
gui_mch_show_tabline(int showit)
{
if (tabLine == (Widget)0)
return;
if (!showit != !showing_tabline)
{
if (showit)
{
XtManageChild(tabLine);
XtUnmanageChild(XtNameToWidget(tabLine, "PageScroller"));
#ifdef FEAT_MENU
# ifdef FEAT_TOOLBAR
if (XtIsManaged(XtParent(toolBar)))
XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, XtParent(toolBar), NULL);
else
# endif
if (XtIsManaged(menuBar))
XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, menuBar, NULL);
else
#endif
XtVaSetValues(tabLine,
XmNtopAttachment, XmATTACH_FORM, NULL);
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, tabLine,
NULL);
}
else
{
XtUnmanageChild(tabLine);
#ifdef FEAT_MENU
# ifdef FEAT_TOOLBAR
if (XtIsManaged(XtParent(toolBar)))
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, XtParent(toolBar), NULL);
else
# endif
if (XtIsManaged(menuBar))
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, menuBar, NULL);
else
#endif
XtVaSetValues(textAreaForm,
XmNtopAttachment, XmATTACH_FORM, NULL);
}
showing_tabline = showit;
}
}
/*
* Return TRUE when tabline is displayed.
*/
int
gui_mch_showing_tabline(void)
{
return tabLine != (Widget)0 && showing_tabline;
}
/*
* Update the labels of the tabline.
*/
void
gui_mch_update_tabline(void)
{
tabpage_T *tp;
int nr = 1, n;
Arg args[10];
int curtabidx = 0, currentpage;
Widget tab;
XmNotebookPageInfo page_info;
XmNotebookPageStatus page_status;
int last_page, tab_count;
if (tabLine == (Widget)0)
return;
/* Add a label for each tab page. They all contain the same text area. */
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next, ++nr)
{
if (tp == curtab)
curtabidx = nr;
page_status = XmNotebookGetPageInfo(tabLine, nr, &page_info);
if (page_status == XmPAGE_INVALID
|| page_info.major_tab_widget == (Widget)0)
{
/* Add the tab */
n = 0;
XtSetArg(args[n], XmNnotebookChildType, XmMAJOR_TAB); n++;
XtSetArg(args[n], XmNtraversalOn, False); n++;
XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING); n++;
XtSetArg(args[n], XmNhighlightThickness, 1); n++;
XtSetArg(args[n], XmNshadowThickness , 1); n++;
tab = XmCreatePushButton(tabLine, "-Empty-", args, n);
XtManageChild(tab);
}
else
tab = page_info.major_tab_widget;
XtVaSetValues(tab, XmNpageNumber, nr, NULL);
get_tabline_label(tp);
XtVaSetValues(tab, XtVaTypedArg, XmNlabelString, XmRString,
NameBuff, STRLEN(NameBuff) + 1, NULL);
}
tab_count = nr - 1;
XtVaGetValues(tabLine, XmNlastPageNumber, &last_page, NULL);
/* Remove any old labels. */
while (nr <= last_page)
{
if (XmNotebookGetPageInfo(tabLine, nr, &page_info) != XmPAGE_INVALID
&& page_info.page_number == nr
&& page_info.major_tab_widget != (Widget)0)
{
XtUnmanageChild(page_info.major_tab_widget);
XtDestroyWidget(page_info.major_tab_widget);
}
nr++;
}
XtVaSetValues(tabLine, XmNlastPageNumber, tab_count, NULL);
XtVaGetValues(tabLine, XmNcurrentPageNumber, &currentpage, NULL);
if (currentpage != curtabidx)
XtVaSetValues(tabLine, XmNcurrentPageNumber, curtabidx, NULL);
}
/*
* Set the current tab to "nr". First tab is 1.
*/
void
gui_mch_set_curtab(nr)
int nr;
{
int currentpage;
if (tabLine == (Widget)0)
return;
XtVaGetValues(tabLine, XmNcurrentPageNumber, &currentpage, NULL);
if (currentpage != nr)
XtVaSetValues(tabLine, XmNcurrentPageNumber, nr, NULL);
}
#endif
/* /*
* Set the colors of Widget "id" to the menu colors. * Set the colors of Widget "id" to the menu colors.
*/ */

View File

@ -727,6 +727,33 @@ _WndProc(
} }
return MyWindowProc(hwnd, uMsg, wParam, lParam); return MyWindowProc(hwnd, uMsg, wParam, lParam);
} }
case WM_LBUTTONDBLCLK:
{
/*
* If the user double clicked the tabline, create a new tab
*/
if (gui_mch_showing_tabline())
{
POINT pt;
RECT rect;
GetCursorPos((LPPOINT)&pt);
GetWindowRect(s_textArea, &rect);
if (pt.y < rect.top)
{
char_u string[3];
string[0] = CSI;
string[1] = KS_TABMENU;
string[2] = KE_FILLER;
add_to_input_buf(string, 3);
string[0] = 0;
string[1] = (char_u)(long)TABLINE_MENU_NEW;
add_to_input_buf_csi(string, 2);
}
}
return MyWindowProc(hwnd, uMsg, wParam, lParam);
}
#endif #endif
case WM_QUERYENDSESSION: /* System wants to go down. */ case WM_QUERYENDSESSION: /* System wants to go down. */
@ -1152,7 +1179,7 @@ gui_mch_init(void)
* Otherwise only characters in the active codepage will work. */ * Otherwise only characters in the active codepage will work. */
if (GetClassInfoW(s_hinst, szVimWndClassW, &wndclassw) == 0) if (GetClassInfoW(s_hinst, szVimWndClassW, &wndclassw) == 0)
{ {
wndclassw.style = 0; wndclassw.style = CS_DBLCLKS;
wndclassw.lpfnWndProc = _WndProc; wndclassw.lpfnWndProc = _WndProc;
wndclassw.cbClsExtra = 0; wndclassw.cbClsExtra = 0;
wndclassw.cbWndExtra = 0; wndclassw.cbWndExtra = 0;
@ -1183,7 +1210,7 @@ gui_mch_init(void)
if (GetClassInfo(s_hinst, szVimWndClass, &wndclass) == 0) if (GetClassInfo(s_hinst, szVimWndClass, &wndclass) == 0)
{ {
wndclass.style = 0; wndclass.style = CS_DBLCLKS;
wndclass.lpfnWndProc = _WndProc; wndclass.lpfnWndProc = _WndProc;
wndclass.cbClsExtra = 0; wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0; wndclass.cbWndExtra = 0;
@ -1412,11 +1439,13 @@ gui_mch_set_shellsize(int width, int height,
int win_xpos, win_ypos; int win_xpos, win_ypos;
WINDOWPLACEMENT wndpl; WINDOWPLACEMENT wndpl;
/* try to keep window completely on screen */ /* Try to keep window completely on screen. */
/* get size of the screen work area (excludes taskbar, appbars) */ /* Get position of the screen work area. This is the part that is not
* used by the taskbar or appbars. */
get_work_area(&workarea_rect); get_work_area(&workarea_rect);
/* get current posision of our window */ /* Get current posision of our window. Note that the .left and .top are
* relative to the work area. */
wndpl.length = sizeof(WINDOWPLACEMENT); wndpl.length = sizeof(WINDOWPLACEMENT);
GetWindowPlacement(s_hwnd, &wndpl); GetWindowPlacement(s_hwnd, &wndpl);
@ -1442,28 +1471,21 @@ gui_mch_set_shellsize(int width, int height,
#endif #endif
; ;
/* if the window is going off the screen, move it on to the screen */ /* If the window is going off the screen, move it on to the screen.
if ((direction & RESIZE_HOR) && win_xpos + win_width > workarea_rect.right) * win_xpos and win_ypos are relative to the workarea. */
win_xpos = workarea_rect.right - win_width; if ((direction & RESIZE_HOR)
&& workarea_rect.left + win_xpos + win_width > workarea_rect.right)
win_xpos = workarea_rect.right - win_width - workarea_rect.left;
if ((direction & RESIZE_HOR) && win_xpos < workarea_rect.left) if ((direction & RESIZE_HOR) && win_xpos < 0)
win_xpos = workarea_rect.left; win_xpos = 0;
if ((direction & RESIZE_VERT) if ((direction & RESIZE_VERT)
&& win_ypos + win_height > workarea_rect.bottom) && workarea_rect.top + win_ypos + win_height > workarea_rect.bottom)
win_ypos = workarea_rect.bottom - win_height; win_ypos = workarea_rect.bottom - win_height - workarea_rect.top;
if ((direction & RESIZE_VERT) && win_ypos < workarea_rect.top) if ((direction & RESIZE_VERT) && win_ypos < 0)
win_ypos = workarea_rect.top; win_ypos = 0;
/* When the taskbar is placed on the left or top of the screen,
* SetWindowPlacement() adds its width or height automatically, compensate
* for that. When the offset is over 400 it's probably something else,
* skip it then (just in case). */
if (workarea_rect.left > 0 && workarea_rect.left < 400)
win_xpos -= workarea_rect.left;
if (workarea_rect.top > 0 && workarea_rect.top < 400)
win_ypos -= workarea_rect.top;
wndpl.rcNormalPosition.left = win_xpos; wndpl.rcNormalPosition.left = win_xpos;
wndpl.rcNormalPosition.right = win_xpos + win_width; wndpl.rcNormalPosition.right = win_xpos + win_width;
@ -2290,13 +2312,13 @@ gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
get_work_area(&workarea_rect); get_work_area(&workarea_rect);
*screen_w = workarea_rect.right *screen_w = workarea_rect.right - workarea_rect.left
- GetSystemMetrics(SM_CXFRAME) * 2; - GetSystemMetrics(SM_CXFRAME) * 2;
/* FIXME: dirty trick: Because the gui_get_base_height() doesn't include /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include
* the menubar for MSwin, we subtract it from the screen height, so that * the menubar for MSwin, we subtract it from the screen height, so that
* the window size can be made to fit on the screen. */ * the window size can be made to fit on the screen. */
*screen_h = workarea_rect.bottom *screen_h = workarea_rect.bottom - workarea_rect.top
- GetSystemMetrics(SM_CYFRAME) * 2 - GetSystemMetrics(SM_CYFRAME) * 2
- GetSystemMetrics(SM_CYCAPTION) - GetSystemMetrics(SM_CYCAPTION)
#ifdef FEAT_MENU #ifdef FEAT_MENU
@ -3956,11 +3978,24 @@ get_toolbar_bitmap(vimmenu_T *menu)
static void static void
initialise_tabline(void) initialise_tabline(void)
{ {
# ifdef USE_SYSMENU_FONT
LOGFONT lfSysmenu;
# endif
InitCommonControls(); InitCommonControls();
s_tabhwnd = CreateWindow(WC_TABCONTROL, "", WS_CHILD|TCS_FOCUSNEVER, s_tabhwnd = CreateWindow(WC_TABCONTROL, "Vim tabline",
WS_CHILD|TCS_FOCUSNEVER,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, s_hwnd, NULL, s_hinst, NULL); CW_USEDEFAULT, s_hwnd, NULL, s_hinst, NULL);
# ifdef USE_SYSMENU_FONT
if (gui_w32_get_menu_font(&lfSysmenu) == OK)
{
HFONT font = CreateFontIndirect(&lfSysmenu);
SendMessage(s_tabhwnd, WM_SETFONT, (WPARAM) font, TRUE);
}
# endif
} }
#endif #endif

View File

@ -28,7 +28,7 @@
#include <Xm/XmP.h> #include <Xm/XmP.h>
#include <Xm/DrawP.h> #include <Xm/DrawP.h>
#if defined(HAVE_XM_TRAITP_H) && defined(HAVE_XM_MANAGER_H) \ #if defined(HAVE_XM_TRAITP_H) && defined(HAVE_XM_MANAGER_H) \
&& defined(HAVE_XM_UNHIGHLIGHT_H) && defined(HAVE_XM_XPMP_H) && defined(HAVE_XM_UNHIGHLIGHTT_H) && defined(HAVE_XM_XPMP_H)
# include <Xm/TraitP.h> # include <Xm/TraitP.h>
# include <Xm/Manager.h> # include <Xm/Manager.h>
# include <Xm/UnhighlightT.h> # include <Xm/UnhighlightT.h>
@ -274,7 +274,9 @@ static char * blank_xpm[] =
static void static void
set_pixmap(XmEnhancedButtonWidget eb) set_pixmap(XmEnhancedButtonWidget eb)
{ {
XpmAttributes attr; /* Configure defines XPMATTRIBUTES_TYPE as XpmAttributes or as
* XpmAttributes_21, depending on what is in Xm/XpmP.h. */
XPMATTRIBUTES_TYPE attr;
Pixmap sen_pix; Pixmap sen_pix;
Window root; Window root;
static XpmColorSymbol color[8] = { static XpmColorSymbol color[8] = {

View File

@ -2473,6 +2473,7 @@ mch_print_init(psettings, jobname, forceit)
double top; double top;
double bottom; double bottom;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
int props;
int cmap; int cmap;
char_u *p_encoding; char_u *p_encoding;
struct prt_ps_encoding_S *p_mbenc; struct prt_ps_encoding_S *p_mbenc;
@ -2510,22 +2511,26 @@ mch_print_init(psettings, jobname, forceit)
* This is to cope with the fact that various unicode encodings are * This is to cope with the fact that various unicode encodings are
* supported in more than one of CJK. */ * supported in more than one of CJK. */
p_mbenc = NULL; p_mbenc = NULL;
p_mbenc_first = NULL; props = enc_canon_props(p_encoding);
p_mbchar = NULL; if (!(props & ENC_8BIT) && (*p_penc != NUL || *p_pmcs != NUL))
for (cmap = 0; cmap < NUM_ELEMENTS(prt_ps_mbfonts); cmap++) {
if (prt_match_encoding((char *)p_encoding, &prt_ps_mbfonts[cmap], p_mbenc_first = NULL;
p_mbchar = NULL;
for (cmap = 0; cmap < NUM_ELEMENTS(prt_ps_mbfonts); cmap++)
if (prt_match_encoding((char *)p_encoding, &prt_ps_mbfonts[cmap],
&p_mbenc)) &p_mbenc))
{ {
if (p_mbenc_first == NULL) if (p_mbenc_first == NULL)
p_mbenc_first = p_mbenc; p_mbenc_first = p_mbenc;
if (prt_match_charset((char *)p_pmcs, &prt_ps_mbfonts[cmap], if (prt_match_charset((char *)p_pmcs, &prt_ps_mbfonts[cmap],
&p_mbchar)) &p_mbchar))
break; break;
} }
/* Use first encoding matched if no charset matched */ /* Use first encoding matched if no charset matched */
if (p_mbchar == NULL && p_mbenc_first != NULL) if (p_mbchar == NULL && p_mbenc_first != NULL)
p_mbenc = p_mbenc_first; p_mbenc = p_mbenc_first;
}
prt_out_mbyte = (p_mbenc != NULL); prt_out_mbyte = (p_mbenc != NULL);
if (prt_out_mbyte) if (prt_out_mbyte)

View File

@ -1111,14 +1111,23 @@ GetRegProp(dpy, regPropp, numItemsp, domsg)
int result, actualFormat; int result, actualFormat;
long_u bytesAfter; long_u bytesAfter;
Atom actualType; Atom actualType;
XErrorHandler old_handler;
*regPropp = NULL; *regPropp = NULL;
old_handler = XSetErrorHandler(x_error_check);
got_x_error = FALSE;
result = XGetWindowProperty(dpy, RootWindow(dpy, 0), registryProperty, 0L, result = XGetWindowProperty(dpy, RootWindow(dpy, 0), registryProperty, 0L,
(long)MAX_PROP_WORDS, False, (long)MAX_PROP_WORDS, False,
XA_STRING, &actualType, XA_STRING, &actualType,
&actualFormat, numItemsp, &bytesAfter, &actualFormat, numItemsp, &bytesAfter,
regPropp); regPropp);
XSync(dpy, FALSE);
(void)XSetErrorHandler(old_handler);
if (got_x_error)
return FAIL;
if (actualType == None) if (actualType == None)
{ {
/* No prop yet. Logically equal to the empty list */ /* No prop yet. Logically equal to the empty list */

View File

@ -4,6 +4,8 @@
<plist version="0.9"> <plist version="0.9">
<dict> <dict>
<key>CFBundleIdentifier</key>
<string>org.vim.Vim-APP_VER</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
@ -25,19 +27,40 @@
<key>CSResourcesFileMapped</key> <key>CSResourcesFileMapped</key>
<true/> <true/>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>ICON_APP</string> <string>app.icns</string>
<key>CFBundleDocumentTypes</key> <key>CFBundleDocumentTypes</key>
<array> <array>
<dict> <dict>
<key>CFBundleTypeExtensions</key> <key>CFBundleTypeExtensions</key>
<array> <array>
<string>*</string> <string>txt</string>
<string>text</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>text/plain</string>
</array> </array>
<key>CFBundleTypeIconFile</key> <key>CFBundleTypeIconFile</key>
<string>doc-txt.icns</string> <string>doc-txt.icns</string>
<key>CFBundleTypeName</key> <key>CFBundleTypeName</key>
<string>NSStringPboardType</string> <string>Text File</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>text/*</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>doc.icns</string>
<key>CFBundleTypeName</key>
<string>File</string>
<key>CFBundleTypeOSTypes</key> <key>CFBundleTypeOSTypes</key>
<array> <array>
<string>****</string> <string>****</string>

View File

@ -25,8 +25,11 @@ vimrcloc=$6
helpsource=$7 helpsource=$7
manmod=$8 manmod=$8
exename=$9 exename=$9
vimdiffname=${10} # older shells don't support ${10}
evimname=${11} shift
vimdiffname=$9
shift
evimname=$9
helpsubloc=$scriptloc/doc helpsubloc=$scriptloc/doc
synsubloc=$scriptloc/syntax synsubloc=$scriptloc/syntax

View File

@ -30,40 +30,48 @@ evimname=$6
exname=$7 exname=$7
viewname=$8 viewname=$8
rvimname=$9 rvimname=$9
rviewname=${10} # old shells don't understand ${10}
gvimname=${11} shift
gviewname=${12} rviewname=$9
rgvimname=${13} shift
rgviewname=${14} gvimname=$9
gvimdiffname=${15} shift
eviewname=${16} gviewname=$9
shift
rgvimname=$9
shift
rgviewname=$9
shift
gvimdiffname=$9
shift
eviewname=$9
if test $what = "install" -a \( -e $destdir/$vimname.1 -o -e $destdir/$vimdiffname.1 -o -e $destdir/$eviewname.1 \); then if test $what = "install" -a \( -f $destdir/$vimname.1 -o -f $destdir/$vimdiffname.1 -o -f $destdir/$eviewname.1 \); then
if test ! -d $destdir; then if test ! -d $destdir; then
echo creating $destdir echo creating $destdir
./mkinstalldirs $destdir ./mkinstalldirs $destdir
fi fi
# ex # ex
if test ! -e $destdir/$exname.1 -a -e $destdir/$vimname.1; then if test ! -f $destdir/$exname.1 -a -f $destdir/$vimname.1; then
echo creating link $destdir/$exname.1 echo creating link $destdir/$exname.1
cd $destdir; ln -s $vimname.1 $exname.1 cd $destdir; ln -s $vimname.1 $exname.1
fi fi
# view # view
if test ! -e $destdir/$viewname.1 -a -e $destdir/$vimname.1; then if test ! -f $destdir/$viewname.1 -a -f $destdir/$vimname.1; then
echo creating link $destdir/$viewname.1 echo creating link $destdir/$viewname.1
cd $destdir; ln -s $vimname.1 $viewname.1 cd $destdir; ln -s $vimname.1 $viewname.1
fi fi
# rvim # rvim
if test ! -e $destdir/$rvimname.1 -a -e $destdir/$vimname.1; then if test ! -f $destdir/$rvimname.1 -a -f $destdir/$vimname.1; then
echo creating link $destdir/$rvimname.1 echo creating link $destdir/$rvimname.1
cd $destdir; ln -s $vimname.1 $rvimname.1 cd $destdir; ln -s $vimname.1 $rvimname.1
fi fi
# rview # rview
if test ! -e $destdir/$rviewname.1 -a -e $destdir/$vimname.1; then if test ! -f $destdir/$rviewname.1 -a -f $destdir/$vimname.1; then
echo creating link $destdir/$rviewname.1 echo creating link $destdir/$rviewname.1
cd $destdir; ln -s $vimname.1 $rviewname.1 cd $destdir; ln -s $vimname.1 $rviewname.1
fi fi
@ -71,37 +79,37 @@ if test $what = "install" -a \( -e $destdir/$vimname.1 -o -e $destdir/$vimdiffna
# GUI targets are optional # GUI targets are optional
if test "$gui" = "yes"; then if test "$gui" = "yes"; then
# gvim # gvim
if test ! -e $destdir/$gvimname.1 -a -e $destdir/$vimname.1; then if test ! -f $destdir/$gvimname.1 -a -f $destdir/$vimname.1; then
echo creating link $destdir/$gvimname.1 echo creating link $destdir/$gvimname.1
cd $destdir; ln -s $vimname.1 $gvimname.1 cd $destdir; ln -s $vimname.1 $gvimname.1
fi fi
# gview # gview
if test ! -e $destdir/$gviewname.1 -a -e $destdir/$vimname.1; then if test ! -f $destdir/$gviewname.1 -a -f $destdir/$vimname.1; then
echo creating link $destdir/$gviewname.1 echo creating link $destdir/$gviewname.1
cd $destdir; ln -s $vimname.1 $gviewname.1 cd $destdir; ln -s $vimname.1 $gviewname.1
fi fi
# rgvim # rgvim
if test ! -e $destdir/$rgvimname.1 -a -e $destdir/$vimname.1; then if test ! -f $destdir/$rgvimname.1 -a -f $destdir/$vimname.1; then
echo creating link $destdir/$rgvimname.1 echo creating link $destdir/$rgvimname.1
cd $destdir; ln -s $vimname.1 $rgvimname.1 cd $destdir; ln -s $vimname.1 $rgvimname.1
fi fi
# rgview # rgview
if test ! -e $destdir/$rgviewname.1 -a -e $destdir/$vimname.1; then if test ! -f $destdir/$rgviewname.1 -a -f $destdir/$vimname.1; then
echo creating link $destdir/$rgviewname.1 echo creating link $destdir/$rgviewname.1
cd $destdir; ln -s $vimname.1 $rgviewname.1 cd $destdir; ln -s $vimname.1 $rgviewname.1
fi fi
# gvimdiff # gvimdiff
if test ! -e $destdir/$gvimdiffname.1 -a -e $destdir/$vimdiffname.1; then if test ! -f $destdir/$gvimdiffname.1 -a -f $destdir/$vimdiffname.1; then
echo creating link $destdir/$gvimdiffname.1 echo creating link $destdir/$gvimdiffname.1
cd $destdir; ln -s $vimdiffname.1 $gvimdiffname.1 cd $destdir; ln -s $vimdiffname.1 $gvimdiffname.1
fi fi
# eview # eview
if test ! -e $destdir/$eviewname.1 -a -e $destdir/$evimname.1; then if test ! -f $destdir/$eviewname.1 -a -f $destdir/$evimname.1; then
echo creating link $destdir/$eviewname.1 echo creating link $destdir/$eviewname.1
cd $destdir; ln -s $evimname.1 $eviewname.1 cd $destdir; ln -s $evimname.1 $eviewname.1
fi fi

View File

@ -724,6 +724,7 @@ installrtbase {virtual}{force}: $HELPSOURCE/vim.1 $DEST_VIM
$DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND
$DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_TUTOR $DEST_COMP $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_TUTOR $DEST_COMP
$DEST_SPELL $DEST_PRINT $DEST_SPELL $DEST_PRINT
:chmod 755 installman.sh
:sys ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN) "" $(INSTALLMANARGS)
:cd $HELPSOURCE :cd $HELPSOURCE
@ -855,6 +856,7 @@ installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
:copy xxd/xxd$EXESUF $DEST_BIN :copy xxd/xxd$EXESUF $DEST_BIN
:do strip $DEST_BIN/xxd$EXESUF :do strip $DEST_BIN/xxd$EXESUF
:chmod $BINMOD $DEST_BIN/xxd$EXESUF :chmod $BINMOD $DEST_BIN/xxd$EXESUF
:chmod 755 installman.sh
:sys ./installman.sh xxd $(DEST_MAN) "" $(INSTALLMANARGS) :sys ./installman.sh xxd $(DEST_MAN) "" $(INSTALLMANARGS)
# #
# install the runtime tools # install the runtime tools
@ -891,6 +893,7 @@ installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \
# install the language specific files for tools, if they were unpacked # install the language specific files for tools, if they were unpacked
install-tool-languages: install-tool-languages:
:chmod 755 installman.sh
:sys ./installman.sh xxd $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS) :sys ./installman.sh xxd $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
:sys ./installman.sh xxd $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS) :sys ./installman.sh xxd $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
:sys ./installman.sh xxd $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS) :sys ./installman.sh xxd $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
@ -904,6 +907,7 @@ install-tool-languages:
# install the language specific files, if they were unpacked # install the language specific files, if they were unpacked
install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
:chmod 755 installman.sh
:sys ./installman.sh install $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_FR) "-fr" $(INSTALLMANARGS)
:sys ./installman.sh install $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_FR_I) "-fr" $(INSTALLMANARGS)
:sys ./installman.sh install $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_FR_U) "-fr.UTF-8" $(INSTALLMANARGS)
@ -914,6 +918,7 @@ install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP
:sys ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_PL_U) "-pl.UTF-8" $(INSTALLMANARGS)
:sys ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_RU) "-ru" $(INSTALLMANARGS)
:sys ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS) :sys ./installman.sh install $(DEST_MAN_RU_U) "-ru.UTF-8" $(INSTALLMANARGS)
:chmod 755 installml.sh
:sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
$(DEST_MAN_FR) $(INSTALLMLARGS) $(DEST_MAN_FR) $(INSTALLMLARGS)
:sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
@ -1034,6 +1039,7 @@ INSTALLMLARGS = $(VIMNAME) $(VIMDIFFNAME) $(EVIMNAME) \
$(GVIMDIFFNAME) $(EVIEWNAME) $(GVIMDIFFNAME) $(EVIEWNAME)
installmanlinks {virtual}: installmanlinks {virtual}:
:chmod 755 installml.sh
:sys ./installml.sh install "$(GUI_MAN_TARGETS)" \ :sys ./installml.sh install "$(GUI_MAN_TARGETS)" \
$(DEST_MAN) $(INSTALLMLARGS) $(DEST_MAN) $(INSTALLMLARGS)
@ -1054,6 +1060,7 @@ uninstall {virtual}{force}: uninstall_runtime
# Note: "deldir" will fail if any files were added after "make install", that # Note: "deldir" will fail if any files were added after "make install", that
# is intentionally: Keep files the user added. # is intentionally: Keep files the user added.
uninstall_runtime {virtual}{force}: uninstall_runtime {virtual}{force}:
:chmod 755 installman.sh
:sys ./installman.sh uninstall $(DEST_MAN) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN) "" $(INSTALLMANARGS)
:sys ./installman.sh uninstall $(DEST_MAN_FR) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN_FR) "" $(INSTALLMANARGS)
:sys ./installman.sh uninstall $(DEST_MAN_FR_I) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN_FR_I) "" $(INSTALLMANARGS)
@ -1065,6 +1072,7 @@ uninstall_runtime {virtual}{force}:
:sys ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN_PL_U) "" $(INSTALLMANARGS)
:sys ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN_RU) "" $(INSTALLMANARGS)
:sys ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS) :sys ./installman.sh uninstall $(DEST_MAN_RU_U) "" $(INSTALLMANARGS)
:chmod 755 installml.sh
:sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \
$(DEST_MAN) $(INSTALLMLARGS) $(DEST_MAN) $(INSTALLMLARGS)
:sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \ :sys ./installml.sh uninstall "$(GUI_MAN_TARGETS)" \

View File

@ -2168,11 +2168,10 @@ scripterror:
#if defined(FEAT_MBYTE) && defined(WIN32) #if defined(FEAT_MBYTE) && defined(WIN32)
{ {
extern void used_file_arg(char *, int, int);
/* Remember this argument has been added to the argument list. /* Remember this argument has been added to the argument list.
* Needed when 'encoding' is changed. */ * Needed when 'encoding' is changed. */
used_file_arg(argv[0], parmp->literal, parmp->full_path); used_file_arg(argv[0], parmp->literal, parmp->full_path,
parmp->diff_mode);
} }
#endif #endif
} }
@ -2567,7 +2566,7 @@ source_startup_scripts(parmp)
*/ */
if (parmp->evim_mode) if (parmp->evim_mode)
{ {
(void)do_source((char_u *)EVIM_FILE, FALSE, FALSE); (void)do_source((char_u *)EVIM_FILE, FALSE, DOSO_NONE);
TIME_MSG("source evim file"); TIME_MSG("source evim file");
} }
@ -2589,7 +2588,7 @@ source_startup_scripts(parmp)
} }
else else
{ {
if (do_source(parmp->use_vimrc, FALSE, FALSE) != OK) if (do_source(parmp->use_vimrc, FALSE, DOSO_NONE) != OK)
EMSG2(_("E282: Cannot read from \"%s\""), parmp->use_vimrc); EMSG2(_("E282: Cannot read from \"%s\""), parmp->use_vimrc);
} }
} }
@ -2607,10 +2606,10 @@ source_startup_scripts(parmp)
* Get system wide defaults, if the file name is defined. * Get system wide defaults, if the file name is defined.
*/ */
#ifdef SYS_VIMRC_FILE #ifdef SYS_VIMRC_FILE
(void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, FALSE); (void)do_source((char_u *)SYS_VIMRC_FILE, FALSE, DOSO_NONE);
#endif #endif
#ifdef MACOS_X #ifdef MACOS_X
(void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, FALSE); (void)do_source((char_u *)"$VIMRUNTIME/macmap.vim", FALSE, DOSO_NONE);
#endif #endif
/* /*
@ -2625,18 +2624,20 @@ source_startup_scripts(parmp)
*/ */
if (process_env((char_u *)"VIMINIT", TRUE) != OK) if (process_env((char_u *)"VIMINIT", TRUE) != OK)
{ {
if (do_source((char_u *)USR_VIMRC_FILE, TRUE, TRUE) == FAIL if (do_source((char_u *)USR_VIMRC_FILE, TRUE, DOSO_VIMRC) == FAIL
#ifdef USR_VIMRC_FILE2 #ifdef USR_VIMRC_FILE2
&& do_source((char_u *)USR_VIMRC_FILE2, TRUE, TRUE) == FAIL && do_source((char_u *)USR_VIMRC_FILE2, TRUE,
DOSO_VIMRC) == FAIL
#endif #endif
#ifdef USR_VIMRC_FILE3 #ifdef USR_VIMRC_FILE3
&& do_source((char_u *)USR_VIMRC_FILE3, TRUE, TRUE) == FAIL && do_source((char_u *)USR_VIMRC_FILE3, TRUE,
DOSO_VIMRC) == FAIL
#endif #endif
&& process_env((char_u *)"EXINIT", FALSE) == FAIL && process_env((char_u *)"EXINIT", FALSE) == FAIL
&& do_source((char_u *)USR_EXRC_FILE, FALSE, FALSE) == FAIL) && do_source((char_u *)USR_EXRC_FILE, FALSE, DOSO_NONE) == FAIL)
{ {
#ifdef USR_EXRC_FILE2 #ifdef USR_EXRC_FILE2
(void)do_source((char_u *)USR_EXRC_FILE2, FALSE, FALSE); (void)do_source((char_u *)USR_EXRC_FILE2, FALSE, DOSO_NONE);
#endif #endif
} }
} }
@ -2674,7 +2675,7 @@ source_startup_scripts(parmp)
(char_u *)VIMRC_FILE, FALSE) != FPC_SAME (char_u *)VIMRC_FILE, FALSE) != FPC_SAME
#endif #endif
) )
i = do_source((char_u *)VIMRC_FILE, TRUE, TRUE); i = do_source((char_u *)VIMRC_FILE, TRUE, DOSO_VIMRC);
if (i == FAIL) if (i == FAIL)
{ {
@ -2692,7 +2693,7 @@ source_startup_scripts(parmp)
(char_u *)EXRC_FILE, FALSE) != FPC_SAME (char_u *)EXRC_FILE, FALSE) != FPC_SAME
#endif #endif
) )
(void)do_source((char_u *)EXRC_FILE, FALSE, FALSE); (void)do_source((char_u *)EXRC_FILE, FALSE, DOSO_NONE);
} }
} }
if (secure == 2) if (secure == 2)
@ -2739,7 +2740,7 @@ process_env(env, is_viminit)
if ((initstr = mch_getenv(env)) != NULL && *initstr != NUL) if ((initstr = mch_getenv(env)) != NULL && *initstr != NUL)
{ {
if (is_viminit) if (is_viminit)
vimrc_found(); vimrc_found(NULL, NULL);
save_sourcing_name = sourcing_name; save_sourcing_name = sourcing_name;
save_sourcing_lnum = sourcing_lnum; save_sourcing_lnum = sourcing_lnum;
sourcing_name = env; sourcing_name = env;

View File

@ -2437,7 +2437,10 @@ changed()
{ {
int save_msg_scroll = msg_scroll; int save_msg_scroll = msg_scroll;
/* Give a warning about changing a read-only file. This may also
* check-out the file, thus change "curbuf"! */
change_warning(0); change_warning(0);
/* Create a swap file if that is wanted. /* Create a swap file if that is wanted.
* Don't do this for "nofile" and "nowrite" buffer types. */ * Don't do this for "nofile" and "nowrite" buffer types. */
if (curbuf->b_may_swap if (curbuf->b_may_swap
@ -2913,7 +2916,9 @@ change_warning(col)
&& curbuf->b_p_ro) && curbuf->b_p_ro)
{ {
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
++curbuf_lock;
apply_autocmds(EVENT_FILECHANGEDRO, NULL, NULL, FALSE, curbuf); apply_autocmds(EVENT_FILECHANGEDRO, NULL, NULL, FALSE, curbuf);
--curbuf_lock;
if (!curbuf->b_p_ro) if (!curbuf->b_p_ro)
return; return;
#endif #endif
@ -4448,6 +4453,53 @@ vim_ispathlistsep(c)
} }
#endif #endif
#if defined(FEAT_GUI_TABLINE) || defined(FEAT_WINDOWS) \
|| defined(FEAT_EVAL) || defined(PROTO)
/*
* Shorten the path of a file from "~/foo/../.bar/fname" to "~/f/../.b/fname"
* It's done in-place.
*/
void
shorten_dir(str)
char_u *str;
{
char_u *tail, *s, *d;
int skip = FALSE;
tail = gettail(str);
d = str;
for (s = str; ; ++s)
{
if (s >= tail) /* copy the whole tail */
{
*d++ = *s;
if (*s == NUL)
break;
}
else if (vim_ispathsep(*s)) /* copy '/' and next char */
{
*d++ = *s;
skip = FALSE;
}
else if (!skip)
{
*d++ = *s; /* copy next char */
if (*s != '~' && *s != '.') /* and leading "~" and "." */
skip = TRUE;
# ifdef FEAT_MBYTE
if (has_mbyte)
{
int l = mb_ptr2len(s);
while (--l > 0)
*d++ = *s++;
}
# endif
}
}
}
#endif
/* /*
* Return TRUE if the directory of "fname" exists, FALSE otherwise. * Return TRUE if the directory of "fname" exists, FALSE otherwise.
* Also returns TRUE if there is no directory name. * Also returns TRUE if there is no directory name.

View File

@ -382,7 +382,7 @@ static const struct nv_cmd
{K_X2DRAG, nv_mouse, 0, 0}, {K_X2DRAG, nv_mouse, 0, 0},
{K_X2RELEASE, nv_mouse, 0, 0}, {K_X2RELEASE, nv_mouse, 0, 0},
#endif #endif
{K_IGNORE, nv_ignore, 0, 0}, {K_IGNORE, nv_ignore, NV_KEEPREG, 0},
{K_NOP, nv_nop, 0, 0}, {K_NOP, nv_nop, 0, 0},
{K_INS, nv_edit, 0, 0}, {K_INS, nv_edit, 0, 0},
{K_KINS, nv_edit, 0, 0}, {K_KINS, nv_edit, 0, 0},
@ -440,7 +440,7 @@ static const struct nv_cmd
{K_DROP, nv_drop, NV_STS, 0}, {K_DROP, nv_drop, NV_STS, 0},
#endif #endif
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
{K_CURSORHOLD, nv_cursorhold, 0, 0}, {K_CURSORHOLD, nv_cursorhold, NV_KEEPREG, 0},
#endif #endif
}; };
@ -572,8 +572,8 @@ normal_cmd(oap, toplevel)
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
pos_T old_pos; /* cursor position before command */ pos_T old_pos; /* cursor position before command */
int mapped_len; int mapped_len;
#endif
static int old_mapped_len = 0; static int old_mapped_len = 0;
#endif
int idx; int idx;
vim_memset(&ca, 0, sizeof(ca)); /* also resets ca.retval */ vim_memset(&ca, 0, sizeof(ca)); /* also resets ca.retval */
@ -624,6 +624,7 @@ normal_cmd(oap, toplevel)
LANGMAP_ADJUST(c, TRUE); LANGMAP_ADJUST(c, TRUE);
#endif #endif
#ifdef FEAT_VISUAL
/* /*
* If a mapping was started in Visual or Select mode, remember the length * If a mapping was started in Visual or Select mode, remember the length
* of the mapping. This is used below to not return to Insert mode for as * of the mapping. This is used below to not return to Insert mode for as
@ -632,11 +633,9 @@ normal_cmd(oap, toplevel)
if (restart_edit == 0) if (restart_edit == 0)
old_mapped_len = 0; old_mapped_len = 0;
else if (old_mapped_len else if (old_mapped_len
#ifdef FEAT_VISUAL || (VIsual_active && mapped_len == 0 && typebuf_maplen() > 0))
|| (VIsual_active && mapped_len == 0 && typebuf_maplen() > 0)
#endif
)
old_mapped_len = typebuf_maplen(); old_mapped_len = typebuf_maplen();
#endif
if (c == NUL) if (c == NUL)
c = K_ZERO; c = K_ZERO;
@ -805,6 +804,10 @@ getcount:
text_locked_msg(); text_locked_msg();
goto normal_end; goto normal_end;
} }
#ifdef FEAT_AUTOCMD
if ((nv_cmds[idx].cmd_flags & NV_NCW) && curbuf_locked())
goto normal_end;
#endif
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
/* /*
@ -1151,10 +1154,12 @@ getcount:
#endif #endif
} }
#ifdef FEAT_VISUAL
/* Get the length of mapped chars again after typing a count, second /* Get the length of mapped chars again after typing a count, second
* character or "z333<cr>". */ * character or "z333<cr>". */
if (old_mapped_len > 0) if (old_mapped_len > 0)
old_mapped_len = typebuf_maplen(); old_mapped_len = typebuf_maplen();
#endif
/* /*
* If an operation is pending, handle it... * If an operation is pending, handle it...
@ -1288,6 +1293,8 @@ normal_end:
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
&& ((restart_edit != 0 && !VIsual_active && old_mapped_len == 0) && ((restart_edit != 0 && !VIsual_active && old_mapped_len == 0)
|| restart_VIsual_select == 1) || restart_VIsual_select == 1)
#else
&& restart_edit != 0
#endif #endif
&& !(ca.retval & CA_COMMAND_BUSY) && !(ca.retval & CA_COMMAND_BUSY)
&& stuff_empty() && stuff_empty()
@ -1303,9 +1310,9 @@ normal_end:
#endif #endif
if (restart_edit != 0 if (restart_edit != 0
#ifdef FEAT_VISUAL #ifdef FEAT_VISUAL
&& !VIsual_active && !VIsual_active && old_mapped_len == 0
#endif #endif
&& old_mapped_len == 0) )
(void)edit(restart_edit, FALSE, 1L); (void)edit(restart_edit, FALSE, 1L);
} }
@ -4065,7 +4072,20 @@ nv_page(cap)
cmdarg_T *cap; cmdarg_T *cap;
{ {
if (!checkclearop(cap->oap)) if (!checkclearop(cap->oap))
{
#ifdef FEAT_WINDOWS
if (mod_mask & MOD_MASK_CTRL)
{
/* <C-PageUp>: tab page back; <C-PageDown>: tab page forward */
if (cap->arg == BACKWARD)
goto_tabpage(-(int)cap->count1);
else
goto_tabpage((int)cap->count0);
}
else
#endif
(void)onepage(cap->arg, cap->count1); (void)onepage(cap->arg, cap->count1);
}
} }
/* /*
@ -5914,6 +5934,13 @@ nv_gotofile(cap)
text_locked_msg(); text_locked_msg();
return; return;
} }
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
{
clearop(cap->oap);
return;
}
#endif
ptr = grab_file_name(cap->count1, &lnum); ptr = grab_file_name(cap->count1, &lnum);
@ -6424,6 +6451,10 @@ nv_brackets(cap)
clearopbeep(cap->oap); clearopbeep(cap->oap);
break; break;
} }
# ifdef FEAT_FOLDING
if (cap->oap->op_type == OP_NOP && (fdo_flags & FDO_SEARCH) && KeyTyped)
foldOpenCursor();
# endif
} }
#endif #endif

View File

@ -430,9 +430,8 @@ struct vimoption
#define ISK_LATIN1 (char_u *)"@,48-57,_,192-255" #define ISK_LATIN1 (char_u *)"@,48-57,_,192-255"
/* 'isprint' for latin1 is also used for MS-Windows, where 0x80 is used for /* 'isprint' for latin1 is also used for MS-Windows cp1252, where 0x80 is used
* the currency sign. This isn't really latin1 but Windows-1252, but we can't * for the currency sign. */
* detect that. */
#if defined(MSDOS) || defined(MSWIN) || defined(OS2) #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
# define ISP_LATIN1 (char_u *)"@,~-255" # define ISP_LATIN1 (char_u *)"@,~-255"
#else #else
@ -6727,6 +6726,8 @@ set_chars_option(varp)
s = p + len + 1; s = p + len + 1;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
c1 = mb_ptr2char_adv(&s); c1 = mb_ptr2char_adv(&s);
if (mb_char2cells(c1) > 1)
continue;
#else #else
c1 = *s++; c1 = *s++;
#endif #endif
@ -6736,6 +6737,8 @@ set_chars_option(varp)
continue; continue;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
c2 = mb_ptr2char_adv(&s); c2 = mb_ptr2char_adv(&s);
if (mb_char2cells(c2) > 1)
continue;
#else #else
c2 = *s++; c2 = *s++;
#endif #endif
@ -10241,11 +10244,16 @@ paste_option_changed()
* Reset 'compatible' and set the values for options that didn't get set yet * Reset 'compatible' and set the values for options that didn't get set yet
* to the Vim defaults. * to the Vim defaults.
* Don't do this if the 'compatible' option has been set or reset before. * Don't do this if the 'compatible' option has been set or reset before.
* When "fname" is not NULL, use it to set $"envname" when it wasn't set yet.
*/ */
void void
vimrc_found() vimrc_found(fname, envname)
char_u *fname;
char_u *envname;
{ {
int opt_idx; int opt_idx;
int dofree;
char_u *p;
if (!option_was_set((char_u *)"cp")) if (!option_was_set((char_u *)"cp"))
{ {
@ -10255,6 +10263,23 @@ vimrc_found()
set_option_default(opt_idx, OPT_FREE, FALSE); set_option_default(opt_idx, OPT_FREE, FALSE);
didset_options(); didset_options();
} }
if (fname != NULL)
{
p = vim_getenv(envname, &dofree);
if (p == NULL)
{
/* Set $MYVIMRC to the first vimrc file found. */
p = FullName_save(fname, FALSE);
if (p != NULL)
{
vim_setenv(envname, p);
vim_free(p);
}
}
else if (dofree)
vim_free(p);
}
} }
/* /*

BIN
src/os_mac_rsrc/app.icns Normal file

Binary file not shown.

Binary file not shown.

BIN
src/os_mac_rsrc/doc.icns Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More