Reputation: 1154
Vim can be configured to show line numbers by adding set number
to your .vimrc
.
How can I configure Vim to instead only show or hide line numbers for certain file extensions?
Examples:
.md
files.rb
, .js
, and .vue
filesA .vimrc
-based solution is probably preferable, but barring that, workarounds are welcome.
Upvotes: 4
Views: 928
Reputation: 792
Here's what you're looking for:
autocmd filetype markdown setlocal nonumber
for your first example, and
set nonumber
autocmd filetype ruby,javascript,vue setlocal number
Upvotes: 6