Closed vladdoster closed 4 years ago
Woah, information overload ya'll! Too many people commenting on this
Hi,
I wasn't very active on GitHub the last months, but go through all the issues now.
\ { 'type': 'files', 'header': [' Recent files']},
\ { 'type': 'files', 'header': [' Current Directory: '.getcwd()]},
You use the internal files
function to for both lists, so no wonder why you'd get the same output. The type for the second line should be 'dir'
instead of 'files'
.
If you wanted to use a custom function instead, your s:lsCwd()
needs to be fixed, since systemlist()
takes a shell command, not a Vim function. For simplicity I'll just use ls -1
, but that might break in some cases.
function! s:lsCwd()
let files = systemlist('ls -1')
return map(files, "{'line': v:val, 'path': v:val}")
endfunction
let g:startify_lists = [
\ { 'type': 'files', 'header': [' Recent files']},
\ { 'type': function('s:lsCwd'), 'header': [' Current Directory: '.getcwd()]},
\ { 'type': 'sessions', 'header': [' Sessions']},
\ { 'type': 'bookmarks', 'header': [' Bookmarks']},
\ ]
It is listing the right dir, but the files in the list are the recent files... How can I get it to list the files in cwd? I have tried defining functions but to no avail.