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
Related
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
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
I installed YCM plugin. And I want YCM to complete left, right parenthesis.
I made a simple cpp source file. In main function, I declared
vector<int> v(10, 0);
when I pressed dot(.), vector member functions were shown.
member functions were shown
Then, I pressed downward arrow key and reached empty() function.
Everytime I press arrow key, YCM automatically complete function name. When I move recommendation menu, YCM ONLY complete function name. does not complete parenthesis. It is reasonable.
YCM complete function name
Finally, I pressed enter key(I chosed empty() function). However YCM did not complete parenthesis.
v.empty
So, I need to manually type left and right parenthesis.
I expected that when I pressed enter, YCM would complete parenthesis as well.
Is it possible to make YCM complete parenthesis?
below is my ~/.vimrc config.
let g:neocomplcache_enable_at_startup = 1
set completeopt-=preview
let g:ycm_add_preview_to_completeopt = 0
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('~/some/path/here')
Plugin 'delimitMate.vim'
Plugin 'VundleVim/Vundle.vim'
Plugin 'AutoComplPop'
Plugin 'Valloric/YouCompleteMe'
Plugin 'tpope/vim-fugitive'
Plugin 'L9'
Plugin 'git://git.wincent.com/command-t.git'
call vundle#end() " required
filetype plugin indent on " required
let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf = 0
"To avoid conflict snippets
let g:ycm_key_list_select_completion = ['<C-j>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-k>', '<Up>']
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_show_diagnostics_ui = 0
let g:ycm_enable_diagnostic_signs = 0
let g:ycm_echo_current_diagnostic = 0
let g:ycm_collect_identifiers_from_tags_files = 1
set backspace=2
if has("syntax")
syntax on
endif
set nu
set nuw=9
set magic
set ls=2
set sc
set cursorline
"set autoindent
set ts=4
set shiftwidth=4
set laststatus=2
set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F\
set hlsearch
set scrolloff=2
set showmatch
set showmode
set smarttab
set smartindent
set softtabstop=4
set tabstop=4
set ruler
set incsearch
set title
set wrap
set scrollbind
set background=dark
hi Comment term=bold cterm=bold ctermfg=green
syntax enable
" AutoComplPop customizing
function! InsertTabWrapper()
let col = col('.')-1
if !col||getline('.')[col-1]!~'\k'
return "\<TAB>"
else
if pumvisible()
return "\<C-N>"
else
return "\<C-N>\<C-P>"
end
endif
endfunction
" AutoComplPop end
inoremap <TAB> <c-r>=InsertTabWrapper()<cr>
hi Pmenu ctermbg=blue
hi PmenuSel ctermfg=yellow ctermbg=black
hi PmenuSbar ctermbg=red
"DelimitMate customizing
"BreakLine: Return TRUE if in the middle of {} or () in INSERT mode
fun BreakLine()
if (mode() == 'i')
return ((getline(".")[col(".")-2] == '{' && getline(".")[col(".")-1] == '}') ||
\(getline(".")[col(".")-2] == '(' && getline(".")[col(".")-1] == ')'))
else
return 0
endif
endfun
" Remap <Enter> to split the line and insert a new line in between if
" BreakLine return True
inoremap <expr> <CR> BreakLine() ? "<CR><ESC>O" : "<CR>"
"DelimitMate end
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 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()