No cursor in vim - vim

UPDATE 16-03-01:
I changed the highlight option to make text dark green, as you can see in the picture. Notice the cursor is on one of the parenthesis, making them both orange, but there's no cursor:
EDIT (SOLVED):
I just deleted the .vimrc file entirely and now the cursor is back so there was some typo or problem in there that messed with it.
ORIGINAL:
I don't have any cursor, box or line in vim. I'm using vim through the latest version of cmder. I'm new to vim but I couldn't find anyone else with a similar problem.

You can set cursorline using
set cursorline
in your ~/.vimrc file. But this looks clumsy with a long line
and you can remedied by highlighting cursorline
highlight CursorLine cterm=NONE ctermbg=NONE ctermfg=darkgreen
You can select your own colour, here I have used darkgreen.
where cterm is terminal colour, set to NONE
ctermbg back ground color of terminal. also set to NONE here

Please add the following to your ~/.vimrc
set nocompatible
set mouse=a
set cursorline
In a short, the behavior of VIM is configured by the ~/.vimrc file, you should add configurations in it for yourself.

Related

In vim, how to highlight a line while keeping syntax coloring?

In vim, I want to:
highlight a single line (e.g. :hi CursorLine ctermbg=black)
AND
maintain syntax highlighting
AND
not set up any custom color themes or similar
(note: adding a few lines to .vimrc is fine)
I've tried setting via :hi CursorLine ctermbg=black, but this results in changing the cursor highlight color but not maintaining syntax coloring.
not highlighted, and has syntax coloring:
highlighted, but loses syntax coloring:
in above example, I would want the string word to stay purple, if word stay yellow, etc., even though line is highlighted.
I also tried toggling :syntax off :syntax on, and not surprisingly this had no effect.
This question (Syntax highlighting in vim) seems similar to what I'm asking, but it's not because 1) I don't want to change the background, 2) I don't want to change theme, 3) it seems like OP here was having trouble with existing syntax color scheme and just wanted to be able to see things.
This question (Custom syntax coloring vim) seems similar to what I'm asking, but it's not because 1) I don't want to change existing syntax coloring, I want to keep it, 2) I don't want to add arbitrary syntax highlighting, I just want CursorLine to be highlighted while also maintaining syntax coloring.
I got my desired behavior by running :hi CursorLine ctermbg=black term=none cterm=none.
And while out of scope of my original question, running :set cursorline is also needed for the line highlighting to be displayed.
This seemed to work for me ...
:hi CursorLine cterm=NONE guifg=NONE

How to underline (rather than highlight) the current line in vim?

I believe it's possible to get an underline under the current line, rather than a highlight.
This adds the highlight in my .vimrc:
set cursorline
This is what I've tried adding to get an underline:
:highlight CursorLine gui=underline cterm=underline
But it appears to make no difference.
I'm using vim 7.4.629 on Centos 6.7 through putty, if that helps.
try :hi clear CursorLine to clear the current cusorline hl, then :hi CursorLine gui=underline cterm=underline
The color of underline is same as your ctermfg or guifg. You can either live with your "colorful" underline, or add cterm/guifg to make the underlined text and the underline same color.
:set cursorline
was the best solution for me, you can combine it with removing the cursorLine as the answer above mentions
For me it works best to highlight the cursor line only in Insert mode. To do so, I use the action snippet to activate cursor underlining (full line) whenever Insert mode is activated and later deactivating it upon leaving the mode.
au InsertEnter * set cul
au InsertLeave * set nocul

VIM Background color issue

I want my vim background to be dark but as you can see it's not, its half black half grey, im using ubuntu 15.10 with latest vim version. How to fix this?
pic
If you want your background was of all the same colour, which is set in your colorsheme, you need to comment the line about highlighting nonText.
" highlight Normal ctermbg=black
" highlight nonText ctermbg=black
If you wish to override the settings in your colorscheme, just uncomment the line about highlighting Normal
highlight Normal ctermbg=black
highlight nonText ctermbg=black
If you want to see the current settings of the highlighting, you can use :highlight command.
Read more in help
:h highlight-groups

How to change color of border in NERDTree?

How to change color of border in NERDTree to be transparent?
This should be fairly straightforward. The NERDTree plugin gets its colour settings globally. So adding something like this in your .vimrc file should do the trick:
highlight VertSplit ctermbg=NONE
highlight VertSplit ctermfg=NONE
Just a heads up though - this will change the settings for everything that uses the VertSplit such as split windows etc. If this isn't what you want then perhaps try disabling only the background (ctermbg). These are commands for the terminal version as well so if you have a gui then it would be guifg=NONE and guibg=NONE (I think).
Edit: Also make sure that you have the line Syntax enable in your .vimrc too.

Set vim bracket highlighting colors

I'm using :set showmatch to highlight the matching bracket or brace when the cursor is over one.
I'd like to change the highlight-color so that it's radically different from the cursor color, because I've got the situation shown in the screenshots.
When the cursor is over the second brace:
and when the cursor is to the immediate-right of the brace:
This uses my terminal color scheme, which is taken from Solarized. Unfortunately, it's a bit of a pain to see which highlight is the brace matching and which is the cursor, when the braces are close together.
Is there a vim setting I can use to change the color of that to, say, the bold magenta ANSI? I'm not particularly interested in remapping my ANSI colors within the terminal or shell - I'd like a vim-specific option, if it exists.
you can change the colors to, e.g., blue over green
hi MatchParen cterm=none ctermbg=green ctermfg=blue
just put it in your vimrc file.
basically, cterm determines the style, which can be none, underline or bold, while ctermbg and ctermfg are, as their names suggest, background and foreground colors, so change them as you see fit.
for your case, you may want
hi MatchParen cterm=bold ctermbg=none ctermfg=magenta
I'm using the vividchalk color scheme with macvim, and none of the various solutions I tried worked for me. But I searched the file:
~/.vim/colors/vividchalk.vim
for MatchParen and I found this line:
call s:hibg("MatchParen","#1100AA","DarkBlue",18)
I commented out that line, then I copied that line, and I changed it to:
call s:hibg("MatchParen","#FF0000","Red",18)
which succeeded in highlighting the matching parenthesis in red, which is a LOT easier to see. I hope that helps someone else.
If you want to briefly jump to the opening bracket/paren/brace when you type the closing bracket/paren/brace, then adding:
set showmatch
to ~/.vimrc worked for me.
A very handy trick is setting the cursor on a bracket/paren/brace and then typing % to jump to the matching bracket/paren/brace. That is especially useful when the matching bracket/paren/brace has scrolled off the page. Typing % a second time will jump back to where you came from.
Try :!ls $VIMRUNTIME/colors these are default color schemes Vim supply. Than change color scheme :colorscheme name find color scheme that You like and copy color scheme :!cp $VIMRUNTIME/colors/<name>.vim ~/.vim/colors/new_name.vim edit it and set with color scheme command or better add colorscheme name to vimrc file. After changes to color file :colorscheme name reloads Vim's colors. It's handy :vsp vim, edit colors file in one half, check changes in other. I used nye17 answer and add hi MatchParen line to my color_file.vim it work's just fine.
Links:
Vim help
How to control colors
About Termianl colors
The colours that I use for vim highlighting, (from my ~/.vimrc):
" set sensible highlight matches that don't obscure the text
:highlight MatchParen cterm=underline ctermbg=black ctermfg=NONE
:highlight MatchParen gui=underline guibg=black guifg=NONE
NONE uses the character colour from the
:colourscheme ron (or which ever you prefer from :!ls $VIMRUNTIME/colors )

Resources