Getting solarized theme working with vim + vim-airline-themes - vim

I'm trying to get a vim-airline theme working with my vim, the theme I'm after is solarized dark.
The following is my .vimrc file:
# .vimrc
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
call vundle#begin()
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
<more plugins>
call vundle#end()
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline#extensions#tabline#formatter = 'default'
let g:airline_theme='solarized'
let g:airline_solarized_bg='dark'
And the following is what my editor looks like currently:
What am I missing here?

I only have the following configs in my Vimfiles and airline theme follows the main theme:
set laststatus=2
let g:airline_powerline_fonts = 1

Related

Vim phpcomplete (omnifunc) doesn't work, detects error while processing function phpcomplete#CompletePHP

while writing PHP, when I press (C-X) + (C-O) for auto completion this is the error I get
Error detected while processing function phpcomplete#CompletePHP[131]..function phpcomplete#CompletePHP[63]..phpcomplete#GetCurrentName
Space:
and when I retry pressing the keys this is the error I get
E565: Not allowed to change text or change window
and I can't reproduce the first error ("Error detected while processing...") unless I close vim and reopen it.
my .vimrc config is the following:
syntax on
call plug#begin()
Plug 'rust-lang/rust.vim'
Plug 'dense-analysis/ale'
Plug 'Valloric/YouCompleteMe'
Plug 'mattn/emmet-vim'
call plug#end()
set background=dark
set t_Co=256
set cmdheight=4
let g:ale_completion_enabled = 1
let g:ale_linters = {'rust': ['analyzer']}
let g:ale_sign_column_always = 1
let g:ale_fixers = { 'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_l ines'] }
let g:rustfmt_autosave = 1
:set omnifunc=phpcomplete#CompletePHP
:set omnifunc=csscomplete#CompleteCSS
:set omnifunc=htmlcomplete#CompleteTags
:set omnifunc=javascriptcomplete#CompleteJS
I use it for Rust, PHP and front end. autocompletion works well and smoothly for HTML, CSS and Javascript but not for PHP.
I'm on Debian 11 (Bullseye) and my vim version is 8.2.2434
thanks in advance :)

My Neovim LSP error message doesn't have a red color

My Neovim LSP error message doesn't have a red color:
Here is my vimrc file. I really don't know what the issue is.
syntax on
set guicursor=
set relativenumber
set noerrorbells
set tabstop=2 softtabstop=2
set shiftwidth=2
set expandtab
set smartindent
set nu
set nowrap
set smartcase
set noswapfile
set nobackup
set undodir=~/.vim/undodir
set undofile
set incsearch
set cursorline
set cursorcolumn
set updatetime=50
call plug#begin('~/.vim/plugged')
Plug 'gruvbox-community/gruvbox'
Plug 'preservim/nerdtree'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'scrooloose/syntastic'
Plug 'scrooloose/nerdcommenter'
Plug 'majutsushi/tagbar'
Plug 'vim-airline/vim-airline'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'airblade/vim-gitgutter'
Plug 'blueyed/vim-diminactive'
Plug 'mattn/emmet-vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'mileszs/ack.vim'
"Plug 'mxw/vim-jsx'
"Plug 'leafgarland/typescript-vim'
"Plug 'peitalin/vim-jsx-typescript'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/completion-nvim'
call plug#end()
let g:gruvbox_contrast_dark = 'hard'
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
let g:gruvbox_invert_selection='0'
colorscheme gruvbox
set background=dark
let loaded_matchparen = 1
let mapleader = " "
let g:airline#extensions#tabline#enabled = 1
let g:fzf_layout = { 'window': { 'window': 0.8, 'height': 0.8 } }
let $FZF_DEFAULT_OPTS='--reverse'
set completeopt=menuone,noinsert,noselect
let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy']
lua require'nvim_lsp'.tsserver.setup{ on_attach=require'completion'.on_attach }
map <C-\> :NERDTreeToggle<CR>
map <C-/> :TagbarToggle<CR>
nnoremap <leader>h :wincmd h<CR>
let g:gitgutter_map_keys = 0
nnoremap <leader>j :wincmd j<CR>
nnoremap <leader>k :wincmd k<CR>
nnoremap <leader>l :wincmd l<CR>
nnoremap <leader>pv :wincmd v<bar> :Ex <bar> :vertical resize 30<CR>
I am on Windows 10 and use the new Windows Terminal + NeoVim, my config is similar to yours with the same colorscheme. I fixed the color issue by adding this to my 'init.vim' file, before setting the colorscheme:
set termguicolors
The following options were recommended as a solution in different GitHub discussions, but they had no effect for me whatsoever:
let g:gruvbox_contrast_dark = 'hard'
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
let g:gruvbox_invert_selection='0'
set background=dark
To change the colors of diagnostic messages:
set termguicolors
hi DiagnosticError guifg=Red
hi DiagnosticWarn guifg=DarkOrange
hi DiagnosticInfo guifg=Blue
hi DiagnosticHint guifg=Green
Setting LspDiagnosticsVirtualTextError did not change colors in my case.
To see the highlights that you're currently using, run :hi. Since the list of highlights can be pretty long, you might want to open that list in a Vim buffer for easier searching and navigating:
:enew|pu=execute('hi')
See also this discussion on how to set LSP colors using Lua. The link was provided in a deleted answer to this question by user Marcel Arie.
For future reference, the old answers will probably fail, now there are more organized highlight groups for you to customize the colors of those, for example:
highlight LspDiagnosticsDefaultError guifg=#FF0000
For more detailed information read :help lsp-highlight-diagnostics and :help highlight.
Edit: Notice this needs to go after more general colorscheme settings such as colorscheme whatever that might overwrite your highlight
Here is the one that worked for me
hi LspDiagnosticsVirtualTextError guifg=Red ctermfg=Red
guifg is for GUI clients and ctermfg is for terminal clients
This should work for both terminal and gui clients
You can use
Plug 'folke/lsp-colors.nvim'
I removed "Plug 'leafgarland/typescript-vim' and it removed it fixed :D

vim-go/synstastic Errors not automatically displaying on save

I noticed that when I save a file and I have a syntax error in my code, the error quickfix window does not automatically appear. I recently rebuilt my system and simply copied over my .vim/ directory along with the same .vimrcfile. I've done this before and have never had any issues. However, if I manually enter :GoErrCheck or GoBuild, the window shows up. What gives?
Here is my .vimrc
execute pathogen#infect()
syntax on
filetype plugin indent on
set nu
set completeopt-=preview
set encoding=utf-8 " Set default encoding to UTF-8
set autoread
set laststatus=2
set noswapfile " Don't use swapfile
set nobackup " Don't create annoying backup files
"
nmap <Leader>t :TagbarToggle<CR>
autocmd FileType qf wincmd J
"CtrlP Settings
let g:ctrlp_show_hidden = 1
let g:neocomplete#enable_at_startup = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:molokai_original = 1
let mapleader=","
colorscheme molokai
Readme file in vim-go explains its usage with syantastic
Sometimes when using both vim-go and syntastic Vim will start lagging while saving and opening files. The following fixes this:
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
Another issue with vim-go and syntastic is that the location list window that contains the output of commands such as :GoBuild and :GoTest might not appear. To resolve this:
let g:go_list_type = "quickfix"
In this issue
One recommendation is to remove the lines
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes':
and use
let g:syntastic_go_checkers = ['govet', 'errcheck', 'go']
instead
Assuming you are talking about errors shown by syntastic, this issue is probably similar to the one discussed here : vim-go with syntastic
Synastic doesn't check Go files on save by default (anymore). Add this
to your .vimrc to make that happen:
let g:syntastic_go_checkers = ['go']

some vim airline themes doesn't work

I installed the vim-airlines and its themes with Vundle. I changed my .vimrc to the following format:
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
" call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
call vundle#begin('~/.vim/vundle_plugins')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" vim js plugin
Plugin 'pangloss/vim-javascript'
" auto complete
Plugin 'valloric/youcompleteme'
" file explorer
Plugin 'kien/ctrlp.vim'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-fugitive'
Plugin 'bling/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" Plugin 'vim-airline/vim-airline'
"
call vundle#end() " required
" nmap <F8> :TagbarToggle<CR>
let g:airline_theme= 'wombat'
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
set laststatus=2
"set background=light
filetype plugin indent on " required
but nothing happens. I mean the following picture:
There is no theme change even after quitting the vim and reopening it. I installed both 'vim-airline' and vim-airline-theme today. So they are up to date.
Any comments is appreciated.
Update
I'm using 64bit Linux Mint 17
Vim version 7.4
Had the same problem.
Just add this line to your .bashrc/.zshrc file: export TERM=xterm-256color

vimrc not being respected in terminal vim

some settings in the vimrc file i use are not being respected in terminal vim but when i use the gui mvim it works perfectly fine. I was wondering what I am doing wrong. I am also running iterm2 and using the same theme as being used in vim (Gotham). You can see the differences in the pictures I attach below.
Notice specifically the difference in colors, the gui version uses the correct colors.
terminal vim(incorrect version):
GUI version(correct colors):
here is the .vimrc I'm using
let g:startify_custom_header =
\ map(split(system('fortune | cowsay'), '\n'), '" ". v:val') + ['','']
let g:startify_custom_footer = [
\ '',
\ ]
let &t_Co=256
let base16colorspace=256
syntax enable
if strftime("%H") < 16
set background=light
colorscheme solarized
else
set background=dark
colorscheme gotham256
endif
set ttyfast
set magic
set showmatch
set clipboard=unnamed
set autoread
set encoding=utf8
set paste
set ignorecase
set smartcase
set number
set numberwidth=6
set guifont=Sauce_Code_Pro_Plus_Nerd_File_Types:h15
set guioptions-=L
set guioptions-=r
set invlist
set listchars=tab:▸\ ,eol:¬,trail:⋅,extends:❯,precedes:❮
highlight SpecialKey ctermbg=none " make the highlighting of tabs less annoying
set showbreak=↪
set wrap "turn on line wrapping
set wrapmargin=8 " wrap lines when coming within n characters from side
set linebreak " set soft wrapping
set showbreak=… " show ellipsis at breaking
set autoindent " automatically set indent of new line
set smartindent
let g:NERDTreeQuitOnOpen=1
" remove some files by extension
let NERDTreeIgnore = ['\.js.map$']
" Toggle NERDTree
nmap <silent> <leader>k :NERDTreeToggle<cr>
" expand to the path of the file in the current buffer
nmap <silent> <leader>y :NERDTreeFind<cr>
set ts=2 sw=2 et
let g:indent_guides_start_level = 1
let g:indent_guides_auto_colors = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:webdevicons_enable_airline_statusline = 0
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
highlight SyntasticErrorSign ctermfg=red ctermbg=237
highlight SyntasticWarningSign ctermfg=yellow ctermbg=237
highlight SyntasticStyleErrorSign ctermfg=red ctermbg=237
highlight SyntasticStyleWarningSign ctermfg=yellow ctermbg=237
call plug#begin()
Plug 'tpope/vim-sensible'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/syntastic'
Plug 'bling/vim-airline'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'Valloric/YouCompleteMe'
Plug 'mhinz/vim-startify'
Plug 'scrooloose/nerdcommenter'
Plug 'chriskempson/base16-vim'
Plug 'tpope/vim-fugitive'
Plug 'altercation/vim-colors-solarized'
Plug 'whatyouhide/vim-gotham'
Plug 'benmills/vimux'
Plug 'ryanoasis/vim-devicons'
call plug#end()

Resources