If you have Vim version 7 or greater, you can change the width of the "gutter" column used for numbering: To enable line numbers on startup, simply add the following to your vimrc.Īdding line numbers only to certain files Ĭreate a filetype plugin for each filetype where you'd like to have numbering enabled (see :help ftplugin-overrule) and add the following line: If you want to be able to toggle line numbers both in normal and insert mode, you can define these two mappings (in this example, they're bound to the F3 key): You can also define a mapping to toggle the option, for example:īy pressing Ctrl-N twice in normal mode, Vim toggles between showing and hiding line numbers. Entering the command again will hide them. Assuming no numbers are currently displayed, this command will display them. The following command is useful because it toggles the display of line numbers. This will turn off the line number display: 5 Adding line numbers only to certain files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |