Search code examples
vim

How do delete/remove a line using vim script


According to http://vimdoc.sourceforge.net/htmldoc/usr_41.html#function-list vim script has functions setline() and append() to modify the current buffer but how do i delete a line from within a script? With setline(1, "") the line is only emptied but I want to get rid of it.


Solution

  • You use the ex command :d. :5d deletes line 5.