Closed thomasmerz closed 1 year ago
Is the problem that the buffer's background changes colour? (The sign column's background looks wrong to me, in that its colour doesn't match the buffer's background, but that's the same in every screenshot so I presume you issue is about the buffer's background.)
What colorscheme do you use? In fact, is your vimrc online anywhere?
Is there any chance you could try the different gitgutter versions on the same computer? Then we could separate vim's changes from gitgutter's.
I'm running the same versions of gitgutter (e2056e5) and vim (MacVim 9.0 p1-1276) as your problematic ones, without trouble, so there's something else going on.
I updated vim-gitgutter
on my Linux Desktop to https://github.com/airblade/vim-gitgutter/commit/e2056e54c50c6f3fbf386108eeb013e2a7f14ae3 - also no problem. I will investigate what's different/wrong with my vim
on MacOS and vim-gitgutter
and give feedback when I found something helpful for this… 🤔
Does :verbose highlight Normal
tell you anything useful?
:verbose highlight Normal
Normal xxx ctermfg=231 ctermbg=236 guifg=#ffffff guibg=#333333
Last set from /usr/local/Cellar/macvim/9.0.1276/MacVim.app/Contents/Resources/vim/runtime/colors/desert.vim line 104
BTW:
I'm using colorscheme desert and this is my complete ~/.vimrc
:
" ---
" nice docu/wiki/help:
" http://vimdoc.sourceforge.net/htmldoc/
" https://vim.fandom.com/wiki/Vim_Tips_Wiki
" ---
" ---
" local settings:
" ---
if exists('$SSHHOME')
" this is needed for sshrc:
source $SSHHOME/.sshrc.d/.vim/vim-pathogen/autoload/pathogen.vim
" https://stackoverflow.com/questions/13080490/vim-pathogen-wont-load-e117-unknown-function-pathogeninfect
"set runtimepath+=~/.dotfiles/vim/autoload (and all the other subdirs)
endif
execute pathogen#infect()
let g:airline#extensions#tabline#enabled = 1
let g:syntastic_yaml_checkers = ['yamllint']
" https://github.com/z0mbix/vim-shfmt
let g:shfmt_extra_args = '-i 2'
"let g:shfmt_fmt_on_save = 1
" ---
" https://github.com/eth-p/vim-it2-touchbar#setup
" https://github.com/eth-p/vim-it2-touchbar/issues/1
function TouchBar()
TouchBarLabel F2 "koehler"
map <F2> :colorscheme koehler<CR>
map <F3> :colorscheme desert<CR>
colorscheme desert
endfunction
map <F4> :colorscheme koehler<CR>
map <F5> :colorscheme desert<CR>
" ---
" ---
" shared with my linux hosts:
" ---
" color(rscheme) is only usefull for gvim
" because it may make vim look pretty shitty:
"color darkblue
"color peachpuff
"color ron
colorscheme desert
" Add {cmd} to the list of commands that Vim will execute automatically on {event}
au BufWinEnter * silent! loadview " jump to position
au BufWinLeave * silent! mkview " jump to position
" VI config to save files with +x when a shebang is found on line 1
" https://www.commandlinefu.com/commands/view/7039/vi-config-to-save-files-with-x-when-a-shebang-is-found-on-line-1
function! MakeExecutable ()
if getline(1) =~ "^#!"
exec "silent !chmod +x '" . expand("%:p") . "'"
filetype detect
endif
endfunction
autocmd BufWritePost * call MakeExecutable()
au BufNewFile,BufRead Berksfile set ft=ruby
au BufNewFile,BufRead Gemfile set ft=ruby
au BufNewFile,BufRead Vagrantfile set ft=ruby
au BufNewFile,BufRead *.md set ft=markdown
" next two lines from https://stackoverflow.com/a/10410590
let blacklist = ['markdown', 'tex', 'cmake']
au BufWritePre * if index(blacklist, &ft) < 0 | :%s/\s\+$//e
highlight ExtraWhitespace ctermbg=red guibg=red " CKO
"match ExtraWhitespace /\s\+$/ " CKO
" https://stackoverflow.com/questions/3878692/aliasing-a-command-in-vim
cnoreabbrev Qa qa
cnoreabbrev Q q
cnoreabbrev W w
cnoreabbrev Wn wn
cnoreabbrev Wq wq
" https://wikileaks.org/ciav7p1/cms/page_7995535.html
" :hex
" Type the following to run the buffer through the xxd hex dump command on Linux:
cnoreabbrev hex %!xxd
cnoreabbrev nohex %!xxd -r
filetype plugin indent on
" https://wikileaks.org/ciav7p1/cms/page_4849889.html
" :w!!
" write the file when you accidentally opened it without the right (root) privileges
cmap w!! w !sudo tee % > /dev/null
" https://vim.fandom.com/wiki/Syntax-based_folding
" Syntax-based folding (keys: za or F12)
map <silent> <F12> za
" strg+n/b = next/previous file:
map <C-n> :next<CR>
map <C-b> :previous<CR>
map <C-i> :set ignorecase! ignorecase?<CR>
"set autoindent " Copy indent from current line when starting a new line
set background=dark " When set to "dark", Vim will try to use colors that look good on a dark background
" Don’t create backups/swp-files when editing files in certain directories
set backupskip=/tmp/*,/private/tmp/*,~/.password-store*
" don't create swp-files in current dir to prevent modification of modify-date
" if nothing was changed at all (but the swp-file was created and deleted):
set directory=~/temp,. " List of directory names for the swap file, separated with commas. … The swap file will be created in the first directory where this is possible
set encoding=utf-8 " Sets the character encoding used inside Vim
set expandtab " In Insert mode: Use the appropriate number of spaces to insert a <Tab>. … To insert a real tab when 'expandtab' is on, use CTRL-V<Tab>.
" Enable per-directory .vimrc files and disable unsafe commands in them
set exrc
set secure
"
set foldcolumn=4 " a column with the specified width is shown at the side of the window which indicates open and closed folds
set foldlevelstart=1 " Sets 'foldlevel' when starting to edit another buffer in a window.
" Useful to always start editing with all folds closed (value zero),
" some folds closed (one) or no folds closed (99).
set foldmarker={,} " The start and end marker used when 'foldmethod' is "marker"
set foldmethod=marker " The kind of folding used for the current window
" The kind of folding used for the current window. Possible values:
" |fold-manual| manual Folds are created manually.
" |fold-indent| indent Lines with equal indent form a fold.
" |fold-expr| expr 'foldexpr' gives the fold level of a line.
" |fold-marker| marker Markers are used to specify folds.
" |fold-syntax| syntax Syntax highlighting items specify folds.
" |fold-diff| diff Fold text that is not changed.
set foldnestmax=3 " Sets the maximum nesting of folds for the "indent" and "syntax" method
set foldtext=substitute(getline(v:foldstart),'{.*','{...}',) " An expression which is used to specify the text displayed for a closed fold
set hlsearch " When there is a previous search pattern, highlight all its matches
set incsearch " While typing a search command, show where the pattern
nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
set laststatus=2 " Always display the status line
" Show “invisible” characters
"set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
" how to represent invisible characters
set list " Useful to see the difference between tabs and spaces and for trailing blanks
set listchars=eol:⏎,tab:>-,trail:~,extends:>,precedes:<,nbsp:·
" eol: Character to show at the end of each line.
" tab: Two or three characters to be used to show a tab.
" space: Character to show for trailing spaces.
" extends: Character to show in the last column … and the line continues beyond the right of the screen
" precedes: Character to show in the first visible column of the physical line
set matchtime=5 " Tenths of a second to show the matching paren, when 'showmatch' is set
set modelines=5 " gives the number of lines that is checked for set commands
"set mouse=a " Enable the use of the mouse: all previous modes - may collide with cmd+c
set nocp " This option has the effect of making Vim either more Vi-compatible, or make Vim behave in a more useful way
set nofoldenable " When off, all folds are open
set number " Print the line number in front of each line
set ruler " Show the line and column number of the cursor position
"set shortmess=atI " Don’t show the intro message when starting Vim
silent! set smoothscroll " lets you handle wrapped text much better
"smoothscroll doesn't work with old vim versions
set scrolloff=1 " Minimal number of screen lines to keep above and below the cursor
set shiftwidth=2 " Number of spaces to use for each step of (auto)indent
set showcmd " Show (partial) command in the last line of the screen
set showmatch " When a bracket is inserted, briefly jump to the matching one
set showmode " If in Insert, Replace or Visual mode put a message on the last line
"set sidescrolloff=5 " The minimal number of screen columns to keep to the left and to the right of the cursor if 'nowrap' is set
set smartindent " Do smart autoindenting when starting a new line.
set smarttab " When on, a <Tab> in front of a line inserts blanks according to 'shiftwidth'
set tabstop=2 " Number of spaces that a <Tab> in the file counts for (any other value than 8 can make your file appear wrong in many places)
set wildmenu " command-line completion operates in an enhanced mode. On pressing 'wildchar' (usually <Tab>) to invoke completion
set wildmode=list:longest " Completion mode that is used for the character specified with 'wildchar'
" list:longest When more than one match, list all matches and complete till longest common string.
syntax on
" ---
" ---
" not used…
" ---
" spell-checking -------------
" http://vimdoc.sourceforge.net/htmldoc/spell.html#spell
"highlight SpellCap cterm=undercurl ctermbg=grey ctermfg=black
"highlight SpellBad cterm=undercurl ctermbg=red ctermfg=black
"highlight SpellRare cterm=undercurl ctermbg=cyan ctermfg=black
" ----------------------------
" https://stackoverflow.com/questions/250652/vim-initial-settings-change-background-color-for-line-number-on-the-left-side
"highlight LineNr ctermfg=grey ctermbg=white
"highlight LineNr guibg=NONE
"highlight LineNr ctermfg=grey ctermbg=black guibg=black guifg=grey
"highlight clear LineNr
"highlight clear SignColumn
"set cursorcolumn " cul: Useful to align text … Will make screen redrawing slower
"l
"set ignorecase " ic: Ignore case in search patterns
" ---
Just a guess, but you could try moving set background=dark
to before colorscheme ...
.
I see also some current updates in these plugins that I use:
https://github.com/vim-airline/vim-airline/commits/master https://github.com/tpope/vim-fugitive/commits/master https://github.com/eth-p/vim-it2-touchbar/commits/master https://github.com/tribela/vim-transparent/commits/master (!?)
Trying to disable all and enable one-by-one to find a "faulty" situation… Some minutes later: Found it!!!! vim-it2-touchbar
makes me "trouble"… not your plugin. So we can all now sleep (or work) well again using your fancy and lovely vim-plugin. I will close this issue. Thanks for your help ❤️
My Problem with vim-it2-touchbar
will soon be history when my new Macbook won't have a touch bar anymore… 🤔
Glad you fixed it!
Glad you helped me! Sometime it's sooooo simple, but someone needs a little "push" into the right direction which you gave me perfectly dosed well.
e2056e54c50c6f3fbf386108eeb013e2a7f14ae3 <-- this version turns opaque when changing content 2ee95686c5944f99b42dd04fec005b30497006de <-- this is an older version on a different computer, but everything is ok
"problematic" vim version:
"ok vim version:
Screenshot before changing/inserting (above: new version, below: old version):
Screenshot after changing/inserting (above: new version, below: old version):
I don't know if this is related to this old (and solved) issue #596? But this didn't fix my problem: