Here are a few basic vi commands that I have found helpful in adding and deleting information in a file from the command line.
dd – delete a line
i – change to insert mode
/ – perform a search query
n – move to the next result in the search
:wq – save the file and exit