I am new to using Vim/MacVim environments and under a pre-existing configuration handed to me by a friend (sort of a newbie-starter-kit), there is a marked tab character which has not been followed with a piece of code, as can be seen in the screenshot below. Which option in Vim can be used to remove this effect?
Thanks in advance for the help.
The following will reveal the syntax group that colors the tab in such a way:
Put the cursor on the marked tab, then do the following:
:echo synIDattr(synID(line("."),col("."),1),"name")
It will show you the syntax group of the current character under the cursor. Then you can use the following to show the color assignment:
:hi <ouput from previous command>
From there you can start searching where in the vim config files the syntax and highlighting are assigned.
Related
How do i remove the row lines at the start of the line? I typed the command
:s/^/# /
while in command mode and it suddenly appeared. I typed the command again, but it's still in my editor. I was trying to comment out a few blocks of code. This is the stackoverflow page I was following: What's a quick way to comment/uncomment lines in Vim?
Please see the image below to see what I'm pertaining to. Thanks in advance!
Vim highlights the current search pattern; this is the 'incsearch' option; either you have it explicitly turned on in your ~/.vimrc, or you use a recent Vim 8 version that has this enabled by the defaults.
Check with :hi IncSearch; it should show the same white-underscore-onblack formatting as your screenshot. You can also use a :hi command to customize this (or choose a different colorscheme).
To turn this off, use
:nohlsearch
You can shorten that to :noh; some people also define a mapping to quickly clear this. Alternatively, you can also search for something else.
Comments keyword are damn highlighted in Macvim/terminal vim and keeps on irritating me. I am not a pro in customizing vim, but really want to get rid of them and have subtle grey keywords
You need to find out which syntax group causes the highlighting. :syn list shows all active groups, but it's easier when you install the SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor plugin. When you have the name of the offending syntax group, you can investigate where it comes from; (the last lines of) :scriptnames may help.
One solution in your case would be linking the syntax groups to the original Comment group, so that the distinction is lost. This can be done in ~/.vimrc:
:hi link FoundSyntaxGroupHere Comment
Comments were highlighted because of vim javascript plugin and by setting following inside .vimrc file, i am able to stop my comments from getting highlighted
let g:javascript_ignore_javaScriptdoc="1
I am using spf13-vim and whenever I press tab, I get these dots. They are there even when I press space.
How I can remove these dots. I want the indentation to happen but without dots. I searched a lot on the web but there is no information available or I could not find.
What changes should I do in my .vimrc to hide these dots?
EDIT
I tried ,ig command or added let g:indent_guides_enable_on_vim_startup = 0 in .vimrc.local but I am still getting the dots.
EDIT
:set nolist worked for me, as suggested by #Christian Brabandt in the comments
What you want to do goes by the term disabling tab highlighting. More information is here:
spf13-vim disable tab highlighting
Add set nolist to ~/.vimrc.local to override default spf13-vim settings.
That behaviour is caused by the following lines in .vimrc (233, 234):
set list
set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace
list mode is used to display whitespace and special characters, listchars allows to configure corresponding characters that will be displayed.
This is a screen of vim editing .bash_profile. It seem to have used some weird highlighting that I didn't explicitly turn on (e.g. around GaF)
using nohl doesn't help since I didn't initiate a search. I also tried using 'syntax off', but that just made all the font/text colours white, but the highlights were still in place.
Anyone know what this is, or how to turn it off?
Thanks
remove all highlighting.
hi clear
you can find out the group name and
hi clear group
to disable highlighting on one group
You need to find out which syntax group causes the highlighting. :syn list shows all active groups, but it's easier when you install the SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor plugin. When you have the name of the offending syntax group, you see to which highlight group this links to. Then check your colorscheme for its definition:
:highlight <groupname>
For me, I had an issue like this every time I opened the help window for any command. As the user #snowbound said in the comments, doing :set nospell solved the issue.
I want to expand on Kent and Ingo Karkat's answers for those that don't wish to install a plugin.
To find out the name of the highlight group in questions, you can use this:
" call `:exec SynGroup()` to show the highlight group under the cursor
function! SynGroup()
let l:s = synID(line('.'), col('.'), 1)
echo synIDattr(l:s, 'name') . ' -> ' . synIDattr(synIDtrans(l:s), 'name')
endfun
(My vimscript is bad, and I copied this from somewhere on the internet long ago. Thank you to that person.)
Anyway, as Kent said, you can use
hi clear <group>
to disable the highlighting for that group.
For example, :exec SynGroup() in vimscript comments gives you
vimLineComment -> Comment
Then you can use
hi clear Comment
To remove the highlighting.
See the screenshot of how I have vim configured below. The 'gutter' i.e. where the '+' and '~' symbols appear show my git status using this amazing sublime text port for vim: https://github.com/airblade/vim-gitgutter
How do I change the color of the gutter where there are no '+'/'~' symbols? I.e. the grey part? This is how you change the number column: VIM initial settings: change backgound color for line number on the left side? but I can't find how to change the 'gutter' color.
Any ideas?
Many thanks.
This "gutter" is called the signs column. (See :help signs for more information.) The highlight group associated with this column is called SignColumn, and can be set like this (using the example from the help section):
:highlight SignColumn guibg=darkgrey
To change the color in your ~/.vimrc so that your gutter is the same color as where your line numbers show up is the following:
highlight clear SignColumn
The git-gutter docs have some other helpful suggestions.
Another option that hasn't been mentioned is to eliminate the sign column entirely and put the signs into the number column.
Adding this to your ~/.vimrc
set signcolumn=number
produces
(this is using custom symbols with the Ale plugin in iterm Vim).
This is available in "full" Vim versions 7.4.2201 or newer that include the +signs feature (I use the version installed by Homebrew on MacOS).
From the screenshot, I think you're using https://github.com/altercation/vim-colors-solarized/ as your colorscheme, as I was. Another solution for this particular case is to switch to https://github.com/ericbn/vim-solarized, as #altercation's version has a bunch of open PRs fixing that very issue and no changes in the last decade.