It seems like I need to use a lot of shortcut tokens to do what I need in
vimscript - which is making my code unreadable, so are there regular
function calls for that?
For example, I need to write the following commands for their corresponding action:
Delete all the lines in the current buffer:
Read all the files in the current directory:
. would lead to an extra line)
To write forcefully:
All these tokens like
! are slightly difficult to ready sometimes, so are there some functional equivalent to those?
Here is what I have so far:
function! InitDir(...) let g:previous_directory = g:current_directory let g:current_directory = a:0 >= 1 ? a:1 : getcwd() :%delete :execute ".!ls " . g:current_directory :write! endfunction