Re:Ask HN: What's the best piece of software you use every day?
by shoulder47834 on Saturday July 11, 2020 @06:28PM
(#23806700)
How do you get line numbers in Vi? I tried once but `:set number` put them inside the file!
[ Parent
| on HN ]
Re:Ask HN: What's the best piece of software you use every day?
by tkjef on Saturday July 11, 2020 @08:32PM
(#23807521)
to 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
Re:Ask HN: What's the best piece of software you use every day?
by jdan222 on Saturday July 11, 2020 @07:07PM
(#23806984)
I am pretty sure you have to add it to the configuration file for line numbers to display each time you open a new file.
Re:Ask HN: What's the best piece of software you use every day?
by ShinTakuya on Saturday July 11, 2020 @09:03PM
(#23807705)
So 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.