Getting Vim FuzzyFinder to stop blinking when searching? - vim

I got FuzzyFinder set up, and it works pretty well, but when I'm doing ":FufCoverageFile", the file matching dropdown blinks every time I add or remove a character. When I'm typing to get search for a file, this turns out to be very, very distracting. Is there something I can do to stop the file finder from blinking distractingly?
https://github.com/vim-scripts/FuzzyFinder
vim --version:
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 31 2011 19:27:29)
Running OS X Lion.

This does not have to do with FuzzyFinder but instead has to do with your terminal not supporting whatever colors your menu is trying to be displayed in. These are set by Pmenu and PmenuSel.
Check :hi Pmenu and :hi PmenuSel to see what colors they are set to. Try :hi clear Pmenu and :hi clear PmenuSel to see if that stops it. If it does then it confirms my diagnosis. If your terminal supports 256 colors you may need to enable it. You can check your current $TERM with :echo $TERM.

Related

terminal Vim strikethrough

I'm trying to render strikethrough for markdown files in terminal vim. However, with the current plug-ins and colorscheme it either colors the text or underlines it. I'm nit-picky and I'd like the rendering of strikethrough.
Running :so $VIMRUNTIME/syntax/hitest.vim in a markdown file rightly shows the highlights including the underline/coloring, but also the groupname which is htmlStrike.
So I try adding the following to my init.vim(having read :h attr-list):
function s:ApplyStrikethrough()
highlight htmlStrike cterm=strikethrough
endfunction
autocmd FileType md call s:ApplyStrikethrough()
I've also tried the above without the autocmd, e.g. just highlight htmlStrike cterm=strikethrough. I've also tried highlight htmlStrike gui=strikethrough guisp='Red'. All I can accomplish is having no highlight at all...
I know my terminal (Kitty) is capable of rendering strikethrough, having run echo -e "\e[9mstrikethrough\e[0m".
OS: Manjaro Linux x86_64
WM: i3
shell: zsh 5.7.1
Vim: NVIM v0.4.3
Term: kitty 0.15.1
Any help is greatly appreciated, thank you!
I just ran into the same problem, and found a solution for normal vim after a while of researching.
I have put the following in my .vimrc
if &term =~ 'xterm\|kitty\|alacritty\|tmux'
let &t_Ts = "\e[9m" " Strikethrough
let &t_Te = "\e[29m"
let &t_Cs = "\e[4:3m" " Undercurl
let &t_Ce = "\e[4:0m"
endif
This will enable strikethrough and undercurl for xterm, kitty, alacritty and tmux terminals (identified by the TERM environment variable). Ideally the if-test should perhaps rely on the smxx, rmxx (standard) and So (kitty extension) capabilities from the terminfo database, but I don't know how to query it from a vim script.
This can be tested by for instance formatting the status line, or with the highlight group htmlStrike as in the question.
:hi StatusLine cterm=strikethrough`.
The trick for undercurl is mentioned in :help undercurl. :help terminal-output-codes lists the terminal codes vim knows about, which also reveals strikethrough. Note that the escape code for strikethrough is defined in ECMA-48 (called "Crossed-out"), while undercurl is defined by Kitty in its protocol extensions.
A quick note on neovim: For me, strikethrough worked out of the box with neovim, but undercurl fell back to normal underline. I have not investigated this beyond noting that neovim does not have the terminal-output-codes help topic.

Why is the default vim's background option is differrent when run in gnome-terminal and gnu-screen?

I'm using Ubuntu 16.04 LTS with vim 7.4 and screen installed. My question is why when I open vim in the default ubuntu terminal the background option is dark while open it in gnu-screen it is light.
You can see subtle different in syntax highlighting when open in those terminals.
Where did it get that values?
Let vim guess for the background values both gives light. (i.e :set bg& bg? )
I've been dive through the vimfiles but found no suspect.
Maybe it lies somewhere in vim's config files but I've not found out yet or is there another mechanism of setting the default background option in vim?
Summary
$ vim
:set bg?
background=dark
:set bg&
:set bg?
background=light
:q
$ screen
$ vim
:set bg?
background=light ???
:set bg&
:set bg?
background=light
vim's using an escape sequence from xterm's repertoire to ask what the background color is, which you can see in the block in term.c beginning with the comment
/* Check for background color response from the terminal:
*
* {lead}11;rgb:{rrrr}/{gggg}/{bbbb}{tail}
*
* {lead} can be <Esc>] or OSC
* {tail} can be '\007', <Esc>\ or STERM.
culminating in some code (which I'd recommend rewriting...):
{/* TODO: don't set option when already the right value */
LOG_TR("Received RBG");
rbg_status = RBG_GOT;
set_option_value((char_u *)"bg", 0L, (char_u *)(
(3 * '6' < tp[j+7] + tp[j+12] + tp[j+17])
? "light" : "dark"), 0);
which was added in mid-2015:
commit b5c3265521749fda81ae4b052de35a0d1209cf50
Author: Bram Moolenaar <Bram#vim.org>
Date: Thu Jun 25 17:03:36 2015 +0200
patch 7.4.757
Problem: Cannot detect the background color of a terminal.
Solution: Add T_RBG to request the background color if possible. (Lubomir
Rintel)
xterm patch #94 (March 1999) added the control sequence for querying colors:
extend dynamic colors control sequences to allow users to determine the colors and font which are currently active.
VTE's developers copied the feature early in 2014 (see #567444).
But GNU screen doesn't recognize the sequence (or its response), so it doesn't allow it to pass through.
By the way, there's more than one way that vim could have done this. I checked to see which method it used with strace.
From :help 'background':
[...]
For MS-DOS, Windows and OS/2 the default is "dark".
For other systems "dark" is used when 'term' is "linux",
"screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark
background. Otherwise the default is "light".
[...]

vim colorscheme shows wrong color

I want to change my colorscheme to this: earthsong on http://daylerees.github.io/
but it changes color something srange. like this (up: molokai, down: earthsong)
I try :colorscheme earthsong in vim, it gives same result.
I using vim on mac (latest version)
I got .vim code from https://github.com/daylerees/colour-schemes/blob/master/vim/colors/earthsong.vim
Can I get some help?
The very first place to look for help with an open source project is its issue tracker if it exists.
That colorscheme only uses your terminal palette. This means that you must adjust it to the colors used in the colorscheme which don't seem to be listed anywhere else than in the colorscheme itself.
If you use Vim 8 and an up-to-date iTerm you could tell Vim to use your GUI colors in the terminal with:
set termguicolors

Why does mvim clear highlight groups on startup?

I recently started using vim-makegreen with mvim.
The issue is that the red/green bars do not work with mvim. They do work with mvim -v (or otherwise console vim).
After further investigation it appears that the highlight groups that are defined as:
hi GreenBar term=reverse ctermfg=white ctermbg=green guifg=white guibg=green
hi RedBar term=reverse ctermfg=white ctermbg=red guifg=white guibg=red
within makegreen.vim are cleared by mvim just prior to calling the .gvimrc file. After mvim has started I get:
:hi RedBar
RedBar xxx cleared
:hi GreenBar
GreenBar xxx cleared
Does anyone have any insights into why mvim is clobbering highlight groups? The only work around that I have found thus far is to redefine them again inside .gvimrc. But this is clearly a pain. Trying to figure out if I am missing something here.
Update
I just stripped down my .vimrc and using pathogen I only place makegreen in bundle dir. The result is the same behavior.
My .vimrc has only one line:
call pathogen#infect()
The bundle directory only contains makegreen bundle. The autoload directory only has the pathogen.vim. I removed .gvimrc.
I then start mvim and execute :hi RedBar and get the same result as above. I used an echo statement to confirm that makegreen.vim is being sourced.
I installed mvim with brew install macvim. The version of macvim is 7.3(64) and I am on OSX Lion.
Update 2
I just took it a step further and removed the reliance on pathogen. Now I only have makegreen.vim in plugin directory and an empty .vimrc file. Same result.
Add let macvim_skip_colorscheme=1 to your ~/.vimrc. See the comment before the colorscheme is loaded in your global gvimrc:
" Load the MacVim color scheme. This can be disabled by loading another color
" scheme with the :colorscheme command, or by adding the line
" let macvim_skip_colorscheme=1
" to ~/.vimrc.
if !exists("macvim_skip_colorscheme") && !exists("colors_name")
colorscheme macvim
endif
All color schemes clear the highlights.
I had the same problem.
The workaround was to redefine GreenBar and RedBar in ~/.vimrc (or python.vim, etc.)

Vim colorscheme change

I'm having difficulty getting my colorscheme to change. I've opened both ~/.vimrc and /usr/share/vim/vimrc and added:
colorscheme desert
...and nothing. I noticed the color schemes are here:
/usr/share/vim/vim72/colors/desert.vim (...along with a bunch or others)
which seems like the wrong place so I:
cp /usr/share/vim/vim72/colors/desert.vim ~/.vim/colors/
and still no go.
Try setting your terminal colours in your .bashrc/.bash_profile to:
export TERM=xterm-256color
& in your .vimrc
let g:"your_colourscheme"_termcolors=256
& that should stick. Bit of a kludge I know but it should work.
Saves typing
:colorscheme whatever everytime you start Vim
Custom colorschemes should go in ~/.vim/colors/, and adding the colorscheme line in your ~/.vimrc should work. So it sounds like you're doing that right.
Double-check that you don't have some other colorscheme line lower down in your vimrc or in an included config file that might be overriding it.
Also double-check that your .vimrc is being loaded as expected. One easy way to tell is by trying to load a nonexistant colorscheme name - if the line is being parsed, then you should get an error like:
E185: Cannot find color scheme foobarbaz
If your colorscheme line is being correctly parsed, you need to check if your terminal is correctly configured to display the colors.
The situation with terminals is a mess when it comes to colors and fonts. It is quite probable that your terminal emulator (gnome-terminal? kterm?) and vim aren't using the same encodings for colors, or one is partially overriding the settings of the other. When it comes to the eternal war between console apps and modern colors and font rendering, your three options are:
Side with the old school, switch to xterm or rxvt, where the colors are more likely to just work, but got help you if you want antialiased fonts.
Side with the new school, sidestep the console entirely and use gvim, where fonts and colors will likely both just work.
Get caught in the middle and forever fight with getting fonts and colors to work properly for old console programs running in new terminal emulators, i.e. gnome-terminal, kterm, etc...
apt-get install vim or yum install vim <-- need full vim vs mini vim
ls /usr/share/vim/vim ##/colors <-- ## 72 or 73, etc list color schemes
cd ~
vi .vimrc
# Add the following two lines if the don't exist
syntax on
colorscheme elflord
# replace elfloard with what ever color scheme you like
If you are using vim-tiny in Ubuntu (the default one). Try to install vim-nox, vim-gtk or vim-gnome.
make sure that you are enabling syntax with :syntax enable.
Currently, using Ubuntu and VIM 8, I did this:
Browse to your user directory:
cd ~
Create and open a .vimrc file:
vim .vimrc
Click i for insert mode.
Type the following command below to enable syntax and give a specific colorscheme. This example uses the desert colorscheme:
syntax on
colorscheme desert
Hold Shift and hit : then type wq! to save and quit the file.
You should now be able to use vi and the colorscheme you choose to edit files on your Grid.
Below the default set of colour schemes for Vim 8:
blue
darkblue
delek
desert
elflord
evening
industry
koehler
morning
murphy
pablo
peachpuff
ron
shine
slate
torte
zellner

Resources