In my Linux machine files with the .sv
extension opens up by default with the verilog syntax highlighting scheme, however extension with .v
or .vs
don't.
I have to manually in gvim do a :set syntax=verilog
every time I open one of these files.
How do I make those file extensions .v
or .vs
open up in a verilog syntax highlighting by default ?
Thanks
After opening login.sh file in vim editor, press ESC key and type ':syntax on' to enable syntax highlighting. The file will look like the following image if syntax highlighting is on. Press ESC key and type, “syntax off” to disable syntax highlighting.
VIM is an alternative and advanced version of VI editor that enables Syntax highlighting feature in VI. Syntax highlighting means it can show some parts of text in another fonts and colors. VIM doesn't show whole file but have some limitations in highlighting particular keywords or text matching a pattern in a file.
The command to enable syntax highlighting in vim is :syntax on , if you want it to be active everytime you launch vim, just add a line containing syntax on in your . vimrc file. maybe your vim doesn't have filetype detection enabled, try adding filetype on to your .
If you want to select the entire line in a file, press V. Now when you press k or j to go up and down, vim will select the entire line above and below your cursor. Finally, you can select text in columns by pressing ctrl+v and moving up or down the block.
Add an auto-command to your .vimrc to do that for you:
autocmd BufNewFile,BufRead *.v,*.vs set syntax=verilog
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With