Hi Christian ! On 8月20日, 下午7时19分, Christian Brabandt <cbli...@256bit.org> wrote: > Hi eliweiq001! > > > I see. There was 1 small problem. Use this slightly changed version > (which only selects C-files): > > fun! OpenLastModified(...) > let path=(!empty(a:1) ? a:1 : getcwd() ) > let files=split(glob(path . '/*.c', 1), '\n') > call filter(files, '!isdirectory(v:val)') > call sort(files, "CompareLastModified") > if !empty(files) > return ":tabe " . files[-1] > else > return ":echoerr 'No files found'" > endif > endfun > > func! CompareLastModified(a,b) > return getftime(a:a) == getftime(a:b) ? 0 : getftime(a:a) > getftime > (a:b) ? 1 : -1 > endfunc > > com! -complete=dir -nargs=? EditLastModified :exe OpenLastModified(<q-args>) > > So please in the command prompt type :EditLastModified followed by > Carriage Return. This will open the last modified file from the current > working directory (basically the directory that :pwd returns). You can > however optionally open the last modified file from a different > directory. Therefore you type: > :EditLastModified followed by a space followed by a directory, e.g. D:\ > followed by a return, e.g: > :EditLastModified D:\ > When using the 2nd form, you can use your Tab key to complete a > directory. > > Sorry for the confusion. > > regards, > Christian
It work! I am so happy! Thank you so much!! -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php