When I code Fortran, and use tabs for indentation, Vim highlights those spaces in red, because in older Fortran the first 6 columns were special and reserved for labels/line numbers and continuation symbols. How can I make Vim stop doing that?
Thank you.
Add the following to your . vimrc: :nnoremap <silent> <CR> :nohlsearch<CR><CR> . Hit return in command mode, and the highlighting disappears.
Similarly, errors are generally highlighted in red color and it looks like vim does not know how the syntax should be handled for /etc/sysconfig/named . However, highlighting of error messages is done with the help of Error and ErrorMsg highlight groups.
Probably the easiest to remember is to run the :tabnew command while in normal mode. This will open a new tab with an empty buffer. If you want to edit a file in the new tab, you can run :tabnew filename and Vim will load the file in the new tab.
There are four main ways to use tabs in Vim: Always keep 'tabstop' at 8, set 'softtabstop' and 'shiftwidth' to 4 (or 3 or whatever you prefer) and use 'noexpandtab'. Then Vim will use a mix of tabs and spaces, but typing and will behave like a tab appears every 4 (or 3) characters.
Actually, tab is not part of the Fortran character set, and portable code should avoid it. So instead I'd recommend to configure vim to use spaces instead of tabs for indentation, see the "expandtab" option.
stop highlighting Tab
:hi link fortranTab NONE
start highlighting Tab
:hi link fortranTab Error
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