How can you display the line numbers after opening a file in vi ?
-
:se ic
-
:se nu
-
:set G
-
ctrl+n
Reveal answer
Fill a bubble to check yourself
B
Correct answer
Explanation
In vi, the command :se nu (short for 'set number') displays line numbers in the editor. Option A's 'ic' stands for 'ignore case' which affects searching behavior, not display. Option D 'ctrl+n' is used for auto-completion in insert mode, not for toggling line numbers.
AI explanation
In vi/vim, the :set number command (abbreviated :se nu) toggles absolute line numbers in the left margin. :se ic sets ignorecase for searches, which is unrelated, and :set G and ctrl+n aren't valid ways to enable numbering (G alone just moves to end of file in command mode). So :se nu is the correct way to show line numbers.