This is my configuration for nvim in the ubuntu environment, much of the information already comes from my old configuration in windows , in this new version several new plugins are added and the migration to lua begins
- Requirements
- Configuration
- Used plugins and their function
- Plugins Requirements
- Keyboard shortcuts
- Windows version (old)
- Special mentions
- How to keep it updated
- Credits
-
A plugin manager (I personally use Vim-Plug), but you can safely use any other, for example Vim-Vundle, and you would only have to change the lines to suit your plugin manager. For example using Vim-Vundle you would have to change the following:
set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " And any other plugin you want to change Plugin 'tpope/vim-fugitive' call vundle#end()
-
Once you have a plugin manager you will have to install the plugins that are in ".vimrc", in case of using vim-plug, you only have to put this command in the console and you should install them
:PlugInstall
-
To use the plugins you will also need:
- node or nvm
- python
Additionally you can improve the autocomplete for python by installing the following packagespip3 install pynvim pip3 install neovim pip3 install -U setuptools pip3 install python-language-server pip3 install 'python-language-server[all]' pip3 install git+git:https://github.com/psf/black pip3 install pyls-mypy pip3 install pyls-isort pip3 install pyls-black
You can configure everything to your liking, I leave it as it is more comfortable for me, below I will also describe most of the keyboard shortcuts (which are generally the defaults of the X plugin in particular)
-
There is an option enabled in the configuration (.vimrc) that will autosave the view (this includes, for example, where you were positioned before closing the file, if you created folds, they will also be saved, etc.)
" save the folds in the .vim/view directory autocmd BufWinLeave _._ mkview autocmd BufWinEnter _._ silent loadview
but it may generate lag and also it will execute with each new file and it will generate an error message if it is a new file (only the first time), it will also generate a folder called "view" in the nvim folder and in the vim folder
In windows
C:\Users\<username>\AppData\Local\nvim-data\view
orC:\Users\<username>\\.vim\view
That is why if it bothers you to have this enabled it is better that you delete it from the .vimrc
- Conquer of Completion for autocomplete
- ultisnips for snippets in Vim using CoC
- vim-snippets pack of snippets
- jedi jedi autocompletion library for VIM
- delimitMate vim plugin, provides insert mode auo-completion for quotes, parens, brackets, etc
- tokyonight theme a simple theme for nvim that I liked, nothing special
- lualine to make the statusline and tabline more beautiful
- nvim-web-devicons displays icons according to file type
- indentLine a vim plugin to display the indention levels with thin vertical lines
- nvim-tree file system explorer, to navigate between files in a more intuitive way
- vim-tmux-navigator for navigate seamlessly between vim and tmux splits using a consistent set of hotkeys
- vim-mundo undo tree visualizer
- vim-markdown markdown vim mode
- tabular required by vim-markdown
- markdown-preview markdown preview plugin for (neo)vim
- vim-gitgutter shows which lines have been added, modified, or removed when using git
- vim-fugitive to use git commands more quickly
- firenvim embed neovim in chrome, firefox, thunderbird & others.
- vim-sandwich set of operator and textobject plugins to search/select/edit sandwiched textobjects
- emmet-vim emmet-vim is a vim plug-in which provides support for expanding abbreviations similar to emmet
- winresizer very simple vim plugin for easy resizing of your vim windows
- vim-polyglot something like prettier but for many more languages and vim
- vim-commentary for commenting operations and styles
- asyncrun for running async shell commands
- better-escape a vim/neovim plugin for escaping insert mode without lagging
https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim
https://github.com/simnalamburt/vim-mundo#requirements
-
Check if the luabitop package is available by running
:lua bit.band(1,1)
in Neovim. If this throws an error, you will need to install it. -
Finally, install the Firenvim addon for your browser from Mozilla's store or Google's.
https://github.com/glacambre/firenvim#installing
https://github.com/kyazdani42/nvim-web-devicons#requirements
- BurntSushi/ripgrep is required for
live_grep
andgrep_string
- telescope-fzy-native.nvim telescope sorter to significantly improve sorting performance
- sharkdp/fd (finder)
- nvim-treesitter/nvim-treesitter (finder/preview)
- neovim LSP (picker)
- devicons (icons)
https://github.com/nvim-telescope/telescope.nvim#getting-started
- Neovim latest stable version or nightly
tar
andcurl
in your path (or alternativelygit
)- A C compiler in your path and libstdc++ installed (Windows users please read this!).
https://github.com/nvim-treesitter/nvim-treesitter
-
Vim 7.4, compiled with the
+python
flag. -
A C++ compiler supporting C++11.
-
Boost (Ubuntu: package
libboost-all-dev
). -
CMake (Ubuntu: package
cmake
). -
Python headers (Ubuntu: package
python-dev
). -
Optional, required for Unicode support: ICU (Ubuntu: package
libicu-dev
).
Pyenv users on Mac OS X: cpsm requires dynamic Python libraries, which pyenv does not build by default. If CMake indicates that it's using static libraries, e.g.:
-- Found PythonLibs: /Users/<username>/.pyenv/versions/3.5.2/lib/python3.5/config-3.5m/libpython3.5m.a
Rebuild with dynamic library support by running
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install <version>
.
Python 3 Support: If your Vim is compiled against Python 3 instead
(+python3
flag) the install script should detect this in most cases and
everything should just work. You may need different python headers installed
(e.g. python3-dev
on Ubuntu).
If the detection does not work for any reason you can set PY3=ON
or PY3=OFF
as appropriate when running ./install.sh
to override it.
https://github.com/nixprime/cpsm#requirements
On Ubuntu ... and other Debian-based Linux distributions.
If you run Ubuntu 19.04 (Disco Dingo) or newer, you can install the officially maintained package:
sudo apt install fd-find
Note that the binary is called fdfind
as the binary name fd
is already used
by another package.
It is recommended that after installation, you add a link to fd
by executing command
ln -s $(which fdfind) ~/.local/bin/fd
, in order to use fd
in the same way
as in this documentation.
Make sure that $HOME/.local/bin
is in your $PATH
.
If you use an older version of Ubuntu, you can download the latest .deb
package from the
release page and install it via:
sudo dpkg -i fd_8.3.2_amd64.deb # adapt version number and architecture
https://github.com/sharkdp/fd#on-ubuntu
- Requires
fd
from sharkdp/fd (see:h wilder#python_file_finder_pipeline()
on using other commands) - Requires
cpsm
from nixprime/cpsm - Requires
fzy-lua-native
from romgrk/fzy-lua-native - Requires
nvim-web-devicons
from kyazdani42/nvim-web-devicons orvim-devicons
from ryanoasis/vim-devicons ornerdfont.vim
from lambdalisue/nerdfont.vim
https://github.com/gelguy/wilder.nvim#advanced-config-for-neovim-only-or-vim-with-yarp
- Neovim 0.5 or later
- fzf (optional, 0.24.0 later)
- nvim-treesitter (optional)
https://github.com/kevinhwang91/nvim-bqf#requirements
I don't know the mimimal supported version. But if you only care about the ctags related feature, vim 7.4.1154+ should be enough. If you want to ctags to run asynchonously, Vim 8.0.27+ should be enough.
Otherwise, if you want to try any LSP related features, then you certainly need some plugins to retrive the LSP symbols, e.g., coc.nvim. When you have these LSP plugins set up, vista.vim should be ok to go as well.
In addition, if you want to search the symbols via fzf, you will have to install it first. Note that fzf 0.22.0 or above is required.
Vim 8
$ mkdir -p ~/.vim/pack/git-plugins/start
$ git clone https://github.com/liuchengxu/vista.vim.git --depth=1 ~/.vim/pack/git-plugins/start/vista.vim
NeoVim
$ mkdir -p ~/.local/share/nvim/site/pack/git-plugins/start
$ git clone https://github.com/liuchengxu/vista.vim.git --depth=1 ~/.local/share/nvim/site/pack/git-plugins/start/vista.vim
https://github.com/liuchengxu/vista.vim#requirement
I moved the keyboard shortcuts section to a separate file, because it's a lot of information, you can find it in keyboard-shortcuts
The windows version is the old version of this configuration and this is its repository, it keeps most of the keyboard shortcuts, so you can use that configuration without any problem
-
Using ultisnips and CoC when you complete a snippet you can use the '' key to jump to the next field to complete
-
:diffget
and:diffput
can be abbreviated asdo
anddp
respectively
To obtain the latest features of our plugins and plugin managers, we will need to update them from time to time
In order to update the plugin manager that I use (in this case it would be "Plug") we will need to put this command in the console and execute it
:PlugUpgrade
(each plugin manager may have a different way to update it)
Once an update is applied, I always recommend restarting nvim so that it does not throw errors if we continue to update something else. To update the plugins we are using (for example, coc, fugitive, ctrlp, nerdtree, etc) we will have to use this other command
:PlugUpdate
And finally to update the CoC extensions we are going to use the following command (as I mentioned above it is better to restart before executing it)
:CocUpdate