ed is a line editor. You might want to use "vim" instead. It is based on ed but you will be able to see an entire page at a time. Some people prefer "emacs" or other editors, but I don't know what you would have installed. Vim should be installed because, in order to make changes to /etc/sudoers, you need to use "visudo".
Vim is a stateful editor. To get into the edit mode you need to press "i" for insert, "a" for append, or "R" for replace. Pressing "ESC" will return you to the command mode where you can enter ":wq" to save your changes. Remember that you need to su to root before editiing files in /etc.