You can use the program "vi" in terminal.
Do a search for the vi commands.
i = insert text
esc = takes you out of insert mode
qw = write the change of file to disk
q! = aborts and quits program
Shift : = to get you out of editing mode and allows you to
write the changes or quit the program
This is how I edited my XFree86 file for my Nvidia driver