I've just setup Neovim v0.4.4 with fzf.vim (commit) on a new machine running Manjaro using sudo pacman -Sy neovim. Previously (unknown version) the window for FZF has appeared in a split at the bottom but now it appears as a window in the middle of the window as in the screenshot below. How do I configure it to be a split at the bottom instead?
.vimrc:
call plug#begin('~/.vim/plugged')
" PlugInstall and PlugUpdate will clone fzf in ~/.fzf and run install script
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" Initialize plugin system
call plug#end()
map <C-F> :Files<CR>
There are five kinds of layout for fzf according to documentation:
window (your actual behavior)
down / up / left / right
For your requested setup, you should add in your .vimrc or where you are putting your settings the following line: let g:fzf_layout = { 'down': '~40%' } where the ~40% is the percentage of all your nvim window
Related
My vimrc is thus:
if empty(glob('~/.vim/autoload/plug.vim'))
silent !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 'lervag/vimtex'
Plug 'lifepillar/vim-mucomplete'
call plug#end()
set completeopt+=menuone
set completeopt+=noselect
let g:mucomplete#enable_auto_at_startup = 1
let g:mucomplete#can_complete = {}
let g:mucomplete#can_complete.tex = { 'omni': { t -> t =~# g:vimtex#re#neocomplete . '$' } }
I have taken the suggestion for can_complete.tex from official VimTex documentation with respect to having MUcomplete interact with VimTex.
I have the following content in bibfile.bib:
#Article{somekey,
title = {A super awesome paper}
}
With this configuration, I am able to have MUcomplete work fine for triggering automatic completion suggestion when \cite{ is typed and the option provided is somekey from the bibliography file.
However, on typing \ref{ in the hope of triggering automatic completion suggestions of equation labels in the .tex file, it fails to work.
Animated gif of the .tex file follows:
Is it possible to figure out why this could be the case and how to have have autocompletion triggered automatically as one types \ref{?
To aid in possibly reproducing the issue, here is the content of the .tex file shown in the animated gif:
\documentclass[11pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat}{2}
\text{ }& asdfasdf &&\quad\nonumber\\
\text{ }&89999\times 45\leq 88 &&\quad \forall\label{eq:1}\\
&abc &&\quad\exists\label{eq:okay}\\
&\times x &&\quad\forall\nonumber\\
&abcd &&\quad\nonumber
\end{alignat}
\bibliographystyle{apalike}
\bibliography{bibfile.bib}
\end{document}
Output of :echo g:vimtex#re#neocomplete is
\v\\%(%(\a*cite|Cite)\a*\*?%(\s*\[[^]]*\]){0,2}\s*\{[^}]*|%(\a*cites|Cites)%(\s*\([^)]*\)){0,2}%(%(\s*\[[^]]*\]){0,2}\s*\{[^}]*\})*%(\s*\[[^]]*\]){0,2}\s*\{[^}]*|bibentry\s*\{[^}]*|%(text|block)cquote\*?%(\s*\[[^]]*\]){0,2}\s*\{[^}]*|%(for|hy)\w*cquote\*?\{[^}]*}%(\s*\[[^]]*\]){0,2}\s*\{[^}]*|defbibentryset\{[^}]*}\{[^}]*|\a*ref%(\s*\{[^}]*|range\s*\{[^,}]*%(}\{)?)|hyperref\s*\[[^]]*|includegraphics\*?%(\s*\[[^]]*\]){0,2}\s*\{[^}]*|%(include%(only)?|input|subfile)\s*\{[^}]*|([cpdr]?(gls|Gls|GLS)|acr|Acr|ACR)\a*\s*\{[^}]*|(ac|Ac|AC)\s*\{[^}]*|includepdf%(\s*\[[^]]*\])?\s*\{[^}]*|includestandalone%(\s*\[[^]]*\])?\s*\{[^}]*|%(usepackage|RequirePackage|PassOptionsToPackage)%(\s*\[[^]]*\])?\s*\{[^}]*|documentclass%(\s*\[[^]]*\])?\s*\{[^}]*|begin%(\s*\[[^]]*\])?\s*\{[^}]*|end%(\s*\[[^]]*\])?\s*\{[^}]*|\a*)
This issue was resolved here
Essentially, one should have compiled the .tex file once as autocompletion of \ref{ requires parsing the .aux file that is generated only after compiling the document once.
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.
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.
Recently began using vim-go (or Ultimate vim) but I am not pleased with it. Is there an easy way to revert back to the regular vim that I was using and get rid of this vim-go entirely? I am assuming this vim-go is just a plugin as I am not very experienced with it.
Since vim-go is a plugin, you can just delete it from your vim directory (~/.vim on UNIX-like systems or ~\vimfiles on ms-windows).
Look for vim-go in ~/.vim/bundle, ~/.vim/pack/plugins/start or ~/.vim/plugged and remove it.
You may try this:
$ vi ~/.vimrc
Remove the line:
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
From:
call plug#begin()
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }
call plug#end()
At the end your .vimrc should looks like this:
call plug#begin()
call plug#end()