I currently use Iterm2, and Vim 7.4 with the Minimalist Vim Plugin Manager. While opening a file through Vim, I get the error:
Error detected while processing MYDIRECTORY/.vimrc:
line 19:
E185: Cannot find color scheme 'onedark'
Press ENTER or type command to continue
The onedark theme doesn't load, but if, in Vim, I type :colorscheme onedark, it loads perfectly.
My .vimrc is as follows:
set t_Co=256
set autoindent
set mouse=a
set number
set shiftwidth=0
set tabstop=4
"let g:airline_theme='onedark'
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux."
if (has("nvim"))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
if (has("termguicolors"))
set termguicolors
endif
set background=dark
colorscheme onedark
syntax on
call plug#begin('~/.vim/plugged')
"Make sure you use single quotes
"ATOM Text Editor Default Syntax Theme"
Plug 'https://github.com/joshdick/onedark.vim.git'
"Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
"Any valid git URL is allowed
Plug 'https://github.com/junegunn/vim-github-dashboard.git'
"Multiple Plug commands can be written in a single line using |
"separators
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
"On-demand loading
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
"Using a non-master branch
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
"Using a tagged release; wildcard allowed (requires git 1.9.2 or
"above)
Plug 'fatih/vim-go', { 'tag': '*' }
"Plugin options
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
"Plugin outside /.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '/.fzf', 'do': './install --all' }
Plug 'https://github.com/exvim/ex-autocomplpop'
"Initialize plugin system
call plug#end()
What should I do?
The way vim-plug works is this:
call plug#begin('~/.vim/plugged')
creates a bunch of functions/commands and sets a bunch of options,
Plug 'https://github.com/joshdick/onedark.vim.git'
adds that resource to an internal list,
call plug#end()
actually installs all your plugins in ~/.vim/plugged if they are not there and sets up your :help 'runtimepath' to the correct value that tells Vim where to look for plugins.
So, basically, you can't expect a plugin installed by vim-plug to be available before vim-plug did its magic.
Moving colorscheme onedark below call plug#end() should solve your problem.
Related
I've been using Vim for about 6 month and finally reached the level where I can't live without it.
I'm really grateful for those who wrote great tutorials or blog posts, and kindly answered easy questions which helped be alot.
Since I started using the autocompletion Plugin, Jedi, characters from the autocompletion window still remain in main window after the autocompletion window is disappeared. I thought this problem was only limited to the Jedi Plugin, but after I changed it into COC Plugin, I still experience the same problem.
I've searched quite a lot and couldn't find any thread about this problem and now I'm starting to think this problem is only occuring to me.
Solution to the problem is the best, but I'll be still grateful for any suggestions, link to a other thread.
I attached my .vimrc below.
Vim 8.2
Windows 10
" vim runtime config file
" Written by Knowblesse 2020
" Adapted from miguelgrinberg/.vimrc
"""""""""""""""""""""""""""""""""""
" Basics "
"""""""""""""""""""""""""""""""""""
" Sane text files
set fileformat=unix " uses line ending LF (not DOS-style CR LF)
set encoding=utf-8
set fileencoding=utf-8
" View
set number
set colorcolumn=100
set nowrap
set hlsearch
set relativenumber
set scrolloff=8
set scrolloff=8
set splitright
set clipboard=unnamedplus
" Tab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
" Font
if has('unix')
echo "Unix Mode"
set guifont=Bitstream\ Vera\ Sans\ Mono\ 12
else
echo "Window Mode"
set guifont=Bitstream\ Vera\ Sans\ Mono:h12
endif
"""""""""""""""""""""""""""""""""""
" Key Bindings "
"""""""""""""""""""""""""""""""""""
imap jk <Esc>
nmap <Tab> >>
nmap <S-tab> <<
vmap < <gv
vmap > >gv
map <leader>t :call NERDTreeToggle()<CR>
"remove highlighted
nmap <leader>] : nohlsearch<CR>
"delete buffer w/o closing the current window
nmap <leader>q :bp\|bd #<CR>
"faster editting
if has('unix')
nmap <leader>vv :e ~/VCF/vimrc/vimrc.vim <CR>
else
nmap <leader>vv :e C:\VCF\vimrc\vimrc.vim <CR>
endif
"""""""""""""""""""""""""""""""""""
" Color Scheme "
"""""""""""""""""""""""""""""""""""
syntax on
colorscheme monokai
filetype on
filetype plugin indent on
"""""""""""""""""""""""""""""""""""
" Plugin "
"""""""""""""""""""""""""""""""""""
"monokai theme is manually installed
"ctag is manually installed
call plug#begin()
Plug 'yegappan/taglist'
Plug 'tpope/vim-sensible'
Plug 'mg979/vim-visual-multi'
"buffer lists instead of tab
Plug 'ap/vim-buftabline'
"NERD
Plug 'preservim/nerdtree'
"Git
Plug 'airblade/vim-gitgutter'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tpope/vim-fugitive'
"Coding
Plug 'davidhalter/jedi-vim'
Plug 'ervandew/supertab'
"Plug 'dense-analysis/ale'
Plug 'itchyny/lightline.vim'
"Color theme
Plug 'joshdick/onedark.vim'
"Table generataion
Plug 'dhruvasagar/vim-table-mode'
"Vertical line generation
Plug 'Yggdroot/indentLine'
" For Testing .....................
"Auto Commplete
Plug 'neoclide/coc.nvim', {'branch': 'release'}
"Arduino
Plug 'stevearc/vim-arduino'
call plug#end()
Red arrows shows remaining characters
For some reason folding really won't work in neovim for me. I've tried a few different folding plugins and they all just say 'E490: No fold found' when I try to fold a code block.
Am I using it correctly? I'm going to the top of a block, eg a for loop and pressing zc while in normal mode.
" plugins
call plug#begin()
" Plug 'numirias/semshi', {'do': ':UpdateRemotePlugins'}
" Plug 'vim-airline/vim-airline'
" Plug 'tmhedberg/SimpylFold'
Plug 'scrooloose/nerdtree'
Plug 'joshdick/onedark.vim'
Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
" Plug 'Konfekt/Fastfold'
call plug#end()
" custom mappings - imap: insert mode, nmap: normal mode
imap jk <Esc>
nmap <C-o> o<Esc>k
" show relative and absolute line numbers
:set relativenumber
:set number
:set nu
" use system clipboard for copy pasting
:set clipboard=unnamedplus
colorscheme onedark
set ts=4 sw=4
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
You need to use a plugin like SimplyFold.
You seem to have it in your config file above, but it's commented out. Uncomment the line:
" Plug 'tmhedberg/SimpylFold'
I have installed via vim-plug the altercation/solarized colorscheme.
and here is my ~/.vimrc
call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree'
Plug 'fatih/vim-go'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'lifepillar/vim-solarized8'
Plug 'altercation/solarized'
call plug#end()
syntax on
filetype indent plugin on
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
set background=dark
colorscheme solarized
However, when opening vim:
▶ vim ~/.vimrc
Error detected while processing /Users/pantelis/.vimrc:
line 20:
E185: Cannot find colour scheme 'solarized'
Press ENTER or type command to continue
Any idea why the color scheme cannot be found?
edit: just for the record, here is the output of PlugStatus
You've installed solarized8, therefore, use:
colorscheme solarized8
altercation/solarized is not a vim script repo. Instead, it's the solarized color project repository, therefore Plug won't load the expected vim-script. i.e. solarized colorscheme isn't installed in your vim.
When I use vim in bash with the standard MacOS terminal I get this whacky artifact behavior, especially with JSON files. The wrong line numbers will show, and the wrong lines will show. When I move the cursor around, it will 'uncover' the actual characters in those positions, and result in a crazy mess of curly brackets or line numbers (in the case of a JSON file).
When I run vim in bash with iTerm2, the vim window only takes up a set amount of space, which is often less than half the area of the entire terminal window.
Perhaps there's some issue with my .vimrc file?
" ----- Native Vim Configuration -----
let g:netrw_altv=1
let g:netrw_liststyle=3
"autocmd BufNewFile,BufRead *.json set ft=javascript
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set expandtab
set number
" ----- Vim Plugin Manager -----
if empty(glob('~/.vim/autoload/plug.vim'))
!curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'morhetz/gruvbox'
Plug 'tpope/vim-fugitive'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'godlygeek/tabular'
Plug 'prettier/vim-prettier', {
\ 'do': 'npm install',
\ 'for': ['javascript', 'css', 'scss', 'json'] }
Plug 'scrooloose/syntastic',
Plug 'mxw/vim-jsx',
Plug 'tpope/vim-surround',
Plug 'mattn/emmet-vim'
call plug#end()
" ----- Vim Plugin Configuration -----
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
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
if executable('ag')
" Use Ag over Grep
set grepprg=ag\ --nogroup\ --nocolor
" Use ag in CtrlP for listing files, does respect .gitignore
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
endif
colorscheme gruvbox
let g:gruvbox_termcolors = '256'
let g:gruvbox_contrast_dark = 'medium'
let g:gruvbox_contrast_light = 'soft'
set background=dark
Other potential factors: I am using ssh to connect to a pretty beat-up server.
The graphics card on my machine seems to be somewhat flawed. Periodically my display will flash black and I see polygonal glitches when I am using the graphics card.
I am new to vim. I have written my default settings in the vimrc file. My vimrc file has been given below. In that file I have written set ai command for auto-indentation. But it isn't working. I have to write the command every time I start working on vim.
I also have a plugin vim-indent-guides installed. I want the command IndentGuidesEnable to be run when vim starts. But I am failing here also. What I am doing wrong?
call plug#begin()
Plug 'chriskempson/base16-vim'
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'}
Plug 'scrooloose/syntastic'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'bling/vim-airline'
Plug 'majutsushi/tagbar'
Plug 'scrooloose/nerdcommenter'
Plug 'airblade/vim-gitgutter'
Plug 'valloric/youcompleteme'
Plug 'pangloss/vim-javascript'
Plug 'easymotion/vim-easymotion'
Plug 'vim-airline/vim-airline'
Plug 'godlygeek/tabular'
Plug 'honza/vim-snippets'
Plug 'ervandew/supertab'
Plug 'tpope/vim-repeat'
Plug 'mattn/emmet-vim'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'shougo/unite.vim'
Plug 'terryma/vim-multiple-cursors'
call plug#end()
set number
set paste
set runtimepath^=~/.vim/bundle/ctrlp.vim
set foldmethod=indent
set foldlevel=99
set tabstop=4
set softtabstop=4
set shiftwidth=4
set textwidth=79
set expandtab
set fileformat=unix
set ai
set list listchars=tab:→\ ,eol:↲,nbsp:␣,trail:•,extends:⟩,precedes:⟨
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap <space> za
autocmd VimEnter * NERDTreeToggle .
autocmd VimEnter * IndentGuidesEnable