4 ms·
How do you get line numbers in Vi? I tried once but `:set number` put them inside the file!
by shoulder47834 6y ago
How do you get line numbers in Vi? I tried once but `:set number` put them inside the file!
- jdan222 6y agoI am pretty sure you have to add it to the configuration file for line numbers to display each time you open a new file.
- ShinTakuya 6y agoSo the "rc" in vimrc means "run commands". And while the term gets abused, by and large what's in vimrc can just be run directly by yourself in vim without a file. All the config file really does is run a list of commands on startup.
- tkjef 6y agoto get line numbers: :set nu to remove line numbers: :set nonu the line numbers aren't added to the file. they're just shown on the vi editor. and if you like vim & git i highly recommend: vim-gitgutter
- hanselot 6y ago:set rnu will give you relative line numbers from current line in both directions, so you can quickly 20jyy20kp to copy whatever is 20 lines down to here, etc etc. Its infinitely useful on servers. And you can script macros like nothing.