Skip to navigation
Logo Penaz's Area

cat /dev/random > penaz

Analyzing my NeoVim Configuration


Let's take a quick look at what's under the hood of my coding (and this blog too): my NeoVim configuration.

Hello everyone!

Contrary to many developers out there, I decided to avoid using a fully-fledged IDE for my work. My workflow involves jumping around folders, opening and closing files rapidly, so tabs may be distracting and switching workspaces may be cumbersome and slow.

This is why I decided to use NeoVim: I've been using Vim for a really long time, because I was curious about it, and after discovering how customizable it can be I just stuck with it: through university and now my current job.

This is my current setup (or at least a nice-ish screenshot of it):

A screen of my NeoVim, with some stuff inside

Let's have a (not so) quick look to what makes my setup tick. There will be a ton of plugins, as well as some customizations. Let's dive in!

The plugins

This is a huge part of my setup: I use a lot of plugins, but that's what comes with trying to get a single editor to do everything. Purists will be mad at me, and they can stay mad if they want. This fits my workflow, don't like it? Don't use it.

The plugins are not weighing down on the startup time too much, unless it's the first startup of the day: that takes around 4 to 8 seconds on HDD (still better than some IDEs). After that, the startup is almost instantaneous.

"==================================================
" Plugins
"==================================================
call plug#begin('~/.config/nvim/plugged')
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " New syntax highlight parser
Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}  " Syntax Highlight for Python Requirements
Plug 'Lenovsky/nuake' " Quake-Style terminal
Plug 'vim-pandoc/vim-pandoc-syntax', {'for': ['pandoc', 'markdown']} "Pandoc Syntax HL
Plug 'iamcco/markdown-preview.nvim', {'do': { -> mkdp#util#install() }, 'for': 'markdown'}
Plug 'neovim/nvim-lspconfig'  " Language Protocol Client
Plug 'ararslan/license-to-vim' "License insertion command
Plug 'norcalli/nvim-colorizer.lua'  " Highlight Color names/hex
Plug 'windwp/nvim-ts-autotag'  " Automatic Tag Closing via TreeSitter
Plug 'rhysd/committia.vim' " Better Git Commits
Plug 'tversteeg/registers.nvim'  " Registers Popup
Plug 'RRethy/vim-illuminate' " Highlight word under cursor
Plug 'tpope/vim-repeat' " Repeat Plugin commands via '.'
Plug 'svermeulen/vim-cutlass'  " Makes delete operations actually delete
Plug 'svermeulen/vim-yoink'  " YankRing
Plug 'svermeulen/vim-subversive'  " Substitution commands and visual paste+replace fixes
Plug 'tpope/vim-fugitive' " Git Support
Plug 'mhinz/vim-startify' "Start screen
Plug 'preservim/nerdcommenter' "Quick comments
Plug 'lukas-reineke/indent-blankline.nvim'  " Visual Indent Guides
Plug 'liuchengxu/vista.vim', {'on': ['Vista!!', 'Vista']}  " New tagbar plugin with LSP Support
Plug 'mbbill/undotree' " Undo tree
Plug 'tpope/vim-surround'  " Surround with quotes, parenthesis etc...
Plug 'junegunn/fzf', {'do': {-> fzf#install()}}  " Fuzzy search of files
Plug 'junegunn/fzf.vim' "FZF Integration for VIM
Plug 'Famiu/feline.nvim' " Nice Status Bar
Plug 'romgrk/barbar.nvim' " Nice Tabline
Plug 'rktjmp/lush.nvim'  " Color Scheme Assistant
Plug 'npxbr/gruvbox.nvim'  " Color Scheme
Plug 'junegunn/goyo.vim', {'on': 'Goyo'} " Zen-Style Writing
Plug 'godlygeek/tabular', {'on': 'Tabularize'} "Text Align
Plug 'lewis6991/gitsigns.nvim'  " Version Control Symbols on Rows
Plug 'matze/vim-move' "Moving rows with ALT+j and ALT+k
Plug 'wesQ3/vim-windowswap' "Swap Windows with <leader>ww
Plug 'mg979/vim-visual-multi' " Multiple Cursors (Ctrl+n)
Plug 'windwp/nvim-autopairs' "Parentheses completion
Plug 'ntpeters/vim-better-whitespace'  "Highlight and whitespace stripping
Plug 'vimlab/split-term.vim' "Split H/V Terminals
Plug 'terryma/vim-expand-region' " Expand region support
Plug 'vim-scripts/Toggle' "Toggle True/False >/<, etc...
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'  " Snippets +  Snippet collection
Plug 'junegunn/limelight.vim', {'on': 'Goyo'} " GoYo Zen Writing extension
Plug 'tyru/open-browser.vim', {'for': 'plantuml'} " Browser preview (used for plantuml)
Plug 'weirongxu/plantuml-previewer.vim', {'for': 'plantuml'} " Plantuml browser preview
Plug 'aklt/plantuml-syntax', {'for': 'plantuml'} " Plantuml syntax HL
Plug 'kyazdani42/nvim-web-devicons'  " Icons for plugins
Plug 'roxma/nvim-yarp'  " Dependency
Plug 'ncm2/ncm2'  " Autocomplete
Plug 'ncm2/ncm2-path'  " Path Autocomplete
Plug 'ncm2/ncm2-bufword'  " Buffer AutoComplete
Plug 'ncm2/ncm2-ultisnips'  " Ultisnips Autocomplete support
Plug 'ncm2/float-preview.nvim'  " Float Preview autocomplete support
Plug 'ncm2/ncm2-html-subscope' " Detects JS/CSS subscopes in HTML
Plug 'francoiscabrol/ranger.vim'  " Ranger Integration
Plug 'tpope/vim-speeddating' " Easy date increment
Plug 'wellle/visual-split.vim', {'on': ['VSResize', 'VSSplit', 'VSSplitAbove', 'VSSplitBelow']} " Splits that adapt to visual selection
Plug 'kkoomen/vim-doge', {'do': { -> doge#install() }, 'on': ['DogeGenerate', 'DogeCreateDocStandard']} " Much Docs, such generator, very wow
Plug 'dstein64/vim-startuptime' "Startup Time Profiling
Plug 'rbgrouleff/bclose.vim'  " Creates BClose command to close buffer without closing window
Plug 'unblevable/quick-scope'  " Highlight when pressing f/F/t/T/,/;
Plug 'p00f/nvim-ts-rainbow'  " Treesitter-powered Rainbow Parentheses
Plug 'rhysd/conflict-marker.vim'  "Helper for managing manual merge conflicts
Plug 'embear/vim-localvimrc'  " Enables per-folder VimRC (editor settings)
Plug 'chrisbra/NrrwRgn' " Narrow Region
Plug 'jceb/emmet.snippets' " Emmet plugin for ultisnips, e<tab>
Plug 'edluffy/specs.nvim'  " Animazione quando il cursore si sposta di molto
Plug 'folke/trouble.nvim'  " Schermata diagnostica migliorata (richiede LSP Interno)
Plug 'nvim-lua/plenary.nvim'  " Dependency of many lua plugins
Plug 'folke/todo-comments.nvim'  " TODOs/Fixes highlight
Plug 'onsails/lspkind-nvim'  " LSP Icons
Plug 'ray-x/lsp_signature.nvim'  " Signature Auto-help for nvim LSP
Plug 'folke/lsp-colors.nvim'  " Support for LSP colors
Plug 'kosayoda/nvim-lightbulb'  " Visible code actions
Plug 'kyazdani42/nvim-tree.lua'  " Lua NerdTree Replacement
Plug 'penaz91/fzf_dym'  " My 'Did you mean?' plugin
call plug#end()

Customizations

I don't live using only plugins, part of my workflow is tied to some custom-made functions. Here are the most notable customizations I use.

I made a "placeholder system", that allows me to quickly jump and fill in a label (using <leader>j ) that is highlighted in red. Such labels have <+THIS FORMAT+> and make it really easy for me to see them.

The "Placeholder System"

I also made a tiny local template repository, that in combination with the "placeholder system" and the localvimrc plugin allows me to have a nice "Template Menu" that I can then customize for my needs. This is all wrapped nicely by a custom FZF menu that allows me to select what template to insert.

The "Templates" Menu

This menu (bound to the F7 key) changes according to the project and the filetype I'm editing in the current buffer. I would love to make a plugin out of it one day, but as of now, it's a cluster of horrible VimScript coding and it's tightly tailored for my needs.

Another menu comes from my habit of using LanguageClient-NeoVim: a simple LSP Menu bound to the F5 key. Doesn't get any simpler than that.

The "LSP" Menu

And since there can't be too many menus, here is another one, this time bound to the F6 key: this is a "Miscellaneous operations" menu: I use it to append a modeline to the current file, pretty format XML or JSON, fixing Git Conflicts. It's a bag of tricks of sort.

The "Everything else" Menu

Oh, I also have a menu to select the License I bound to the :Licenses command. Because I can't remember the names in the license-to-vim plugin.

The only customization I managed to pull into a standalone plugin was a set of functions I made for a "did you mean?" prompt when I get a partial completion from ZSH. It was originally a plugin, I reworked it into my VimRC to work with FZF and then extracted it again into its own thing. I called it fzf_dym because I'm a very creative person.

Conclusions and future updates

This is just a random post I wanted to make, to see how things will change in the future and to "flex" a tiny bit (seems many do that lately, so why not).

I see the "moon" in my NeoVim's configuration future, to be precise a portoguese/brazilian moon: lua. NeoVim added native support for luaJIT as well as a new init.lua entrypoint. Maybe in the future I will have the chance to rewrite all the messy VimScript stuff into messy lua. We'll see what the future holds.

Thank you everyone for reading. Stay safe and healthy.

Penaz.