vim6とvim7の組み込み関数の違い
vim7のfunctionsを参照していたところ、戻り値型や関数の数に違いがあったので差をみてみました。
同じ関数でも、パラメータによって返す型が違う事もあるようです。
関数の数は3倍くらい増えていました。
- vim6=60くらい
- vim7=200くらい
なるほど。
List型とDict型の使い方がvim7ではポイントになりそう。
vimヘルプより
※必要なパラメータは省略し戻り値の型のみピックアップしてみました。
vim6
append() 数値 argc() 数値 argv() 文字列 browse() 文字列 bufexists() 数値 bufloaded() 数値 bufname() 文 字列 bufnr() 数値 bufwinnr() 数値 byte2line() 数値 char2nr() 数値 col() 数値 confirm() 数値 delete() 数値 did_filetype() 数値 escape() 文字列 exists() 数値 expand() 文字列 filereadable() 数値 fnamemodify() 文字列 getcwd() 文字列 getftime() 数値 getline() 文字列 getwinposx() 数値 getwinposy() 数値 glob() 文字列 has() 数値 histadd() 文字列 histdel() 文字列 histget() 文字列 histnr() 数値 hlexists() 数値 hlID() 数値 hostname() 文字列 input() 文字列 isdirectory() 数値 libcall() 文字列 line() 数値 line2byte() 数値 localtime() 数値 maparg() 文字列 mapcheck() 文字列 match() 数値 matchend() 数値 matchstr() 文字列 nr2char() 文字列 rename() 数値 setline() 数値 strftime() 文字列 strlen() 数値 strpart() 文字列 strtrans() 文字列 substitute() 文字列 synID() 数値 synIDattr() 文字列 synIDtrans() 数値 system() 文字列 tempname() 文字列 virtcol() 数値 visualmode() 文字列 winbufnr() 数値 winheight() 数値 winnr() 数値
vim7
add() List append() 数値 argc() 数値 argv() 文字列 argv() List browse() 文字列 browsedir() 文字列 bufexists() 数値 bufloaded() 数値 bufname() 文字列 bufnr() 数値 bufwinnr() 数値 byte2line() 数値 byteidx() 数値 call() any changenr() 数値 char2nr() 数値 col() 数値 complete() 文字列 complete_add() 数値 complete_check() 数値 confirm() 数値 copy() any count() 数値 cscope_connection() 数値 cursor() 数値 deepcopy() any delete() 数値 did_filetype() 数値 diff_filler() 数値 diff_hlID() 数値 empty() 数値 escape() 文字列 eval() any exists() 数値 extend() List/Dict expand() 文字列 feedkeys() 数値 filereadable() 数値 filewritable() 数値 filter() List/Dict finddir() 文字列 findfile() 文字列 fnamemodify() 文字列 foldclosed() 数値 foldclosedend() 数値 foldlevel() 数値 foldtext() 文字列 foldtextresult() 文字列 foreground() 数値 function() Funcref garbagecollect() none get() any getbufline() List getbufvar() any getcmdline() 文字列 getcmdpos() 数値 getcmdtype() 文字列 getcwd() 文字列 getfperm() 文字列 getfsize() 数値 getfontname() 文字列 getftime() 数値 getftype() 文字列 getline() 文字列 getline() List getloclist() List getpos() List getqflist() List getreg() 文字列 getregtype() 文字列 gettabwinvar() any getwinposx() 数値 getwinposy() 数値 getwinvar() any glob() 文字列 globpath() 文字列 has() 数値 has_key() 数値 haslocaldir() 数値 hasmapto() 数値 histadd() 文字列 histdel() 文字列 histget() 文字列 histnr() 数値 hlexists() 数値 hlID() 数値 hostname() 文字列 iconv() 文字列 indent() 数値 index() 数値 input() 文字列 inputdialog() 文字列 inputlist() 数値 inputrestore() 数値 inputsave() 数値 inputsecret() 文字列 insert() List isdirectory() 数値 islocked() 数値 items() List join() 文字列 keys() List len() 数値 libcall() 文字列 libcallnr() 数値 line() 数値 line2byte() 数値 lispindent() 数値 localtime() 数値 maparg() 文字列 mapcheck() 文字列 match() 数値 matcharg() List matchend() 数値 matchlist() List matchstr() 文字列 max() 数値 min() 数値 mkdir() 数値 mode() 文字列 nextnonblank() 数値 nr2char() 文字列 pathshorten() 文字列 prevnonblank() 数値 printf() 文字列 pumvisible() 数値 range() List readfile() List reltime() List reltimestr() 文字列 remote_expr() 文字列 remote_foreground() 数値 remote_peek() 数値 remote_read() 文字列 remote_send() 文字列 remove() any rename() 数値 repeat() 文字列 resolve() 文字列 reverse() List search() 数値 searchdecl() 数値 searchpair() 数値 searchpairpos() List searchpos() List server2client() 数値 serverlist() 文字列 setbufvar() ??? setcmdpos() 数値 setline() 数値 setloclist() 数値 setpos() none setqflist() 数値 setreg() 数値 settabwinvar() ??? setwinvar() ??? shellescape() 文字列 simplify() 文字列 sort() List soundfold() 文字列 spellbadword() 文字列 spellsuggest() List split() List str2nr() 数値 strftime() 文字列 stridx() 数値 string() 文字列 strlen() 数値 strpart() 文字列 strridx() 数値 strtrans() 文字列 submatch() 文字列 substitute() 文字列 synID() 数値 synIDattr() 文字列 synIDtrans() 数値 system() 文字列 tabpagebuflist() List tabpagenr() 数値 tabpagewinnr() 数値 taglist() List tagfiles() List tempname() 文字列 tolower() 文字列 toupper() 文字列 tr() 文字列 type() 数値 values() List virtcol() 数値 visualmode() 文字列 winbufnr() 数値 wincol() 数値 winheight() 数値 winline() 数値 winnr() 数値 winrestcmd() 文字列 winrestview() None winsaveview() Dict winwidth() 数値 writefile() 数値