Skip to content

Ngoc-Cac/nvim-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

404 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Neovim Configuration

This repository is where I keep track of my Neovim configuration, in case if I make any oopsies; I can restore the previous history.

Installation note for future-self

Terminal Configuration

Firstly, you need to install a Nerd Font. Some plugins use glyphs that is only provided by Nerd Fonts. See here for some fonts.

Secondly, make sure your terminal supports 256-color. It might be fine if your terminal doesn't support this, won't look nice though.

Getting Neovim

It's easy, just use a package manager or manually download one of the releases. See here for more information.

Now, running nvim before installing any plugins will definitely throw errors, because some plugins in this configuration requires some external configuration first.

Configuration and Setting Up Plugins

Depends on the machine, clone this repository to the appropriate location. On Linux, this will be ~/.config/nvim. On Windows, this will be ~/AppData/Local/nvim.

Installing treesitter-nvim

To start, the most cumbersome plugin is treesitter-nvim, so it is best to get this out of the way first. The plugin requires treesitter (of course) and a C compiler. The installation of treesitter is straight-forward, the installation of the C compiler can be quite annoying.

On Linux, several distributions are available, just download one and add them to your PATH. On Windows, this is a bit more complicated because it depends on your build environment. To check, run echo $MSYSTEM:

  • If it doesn't print anything, your system needs the msvc compiler. This will require Visual Studio :(.
  • Otherwise, install the mingw compiler.

Based on this, just follow the installation guide for the correponding environment.

Important

If your Windows uses the msvc compiler, you MUST install parsers within the Visual Studio's Developer Command Prompt.

This is because Visual Studio does not add the compiler to your PATH by default (you probably shouldn't add it yourself either). This then cause treesitter-nvim to throw errors when running :TSInstall (or :TSUpdate) because it won't be able to find the C compiler.

After this, installing mason.nvim should be prioritized. This plugin needs the following requirements. With nvim-lspconfig and mason-lspconfig installed as well, your LSP servers can now work.

Furthermore, if you intend to use pyright as a Python LSP server, then you also need to install node and npm. Plugins like markdown-preview.nvim also require npm or yarn.

Other than that, the rest should not need any manual set-up.

Plugins Used

These are listed in the order of dependency and usability.

First and necessary plugin is of course:

  • lazy.nvim: Plugin manager with lazy-loading support. Must install before any other plugins.

And, this is the colorscheme used:

Must Have
  • mason.nvim: A package manager for LSP servers and more. I mainly use this for LSP support.
  • nvim-lspconfig: A great helper to set up your LSP servers with no effort.
  • mason-lspconfig.nvim: This extends the nvim-lspconfig plugin with automatic enabling of installed LSP servers, so you don't have to manually enable it in your config anymore.
  • lazydev.nvim: This is an enhanced Lua LSP server which can recognizes your Neovim configuration. This is very useful during configuration with the code analysis.
  • blink.cmp: Completion engine that uses multiple sources to give suggestions.
  • nvim-treesitter: Plugin for managing tree-sitter parsers. I am mainly using this for syntax highlighting and enhanced text-objects.
  • nvim-autopairs: Auto-pairing when editing. This pretty much just speeds up the rest of the configuration for other plugins, so definitely needs to be installed right of the bat.
🌟Highly Recommended
  • nvim-treesitter-textobjects: Plugin for amazing syntactical text-objects.
  • auto-session: Just a super awesome plugins for managing workspaces.
  • nvim-ufo: This is an enhanced code folding plugin which allows for LSP support.
  • flash.nvim: An enhancement of the f, F, t, and T motions, allowing for teleportation across the file.
  • mini.surround: This is a complementary plugin to the nvim-autopairs plugin, which allows for better quick wrapping and pair-edits.
  • treesj: A plugin that splits and joins code using tree-sitter. This greatly speeds up editing when you need to reformat code.
  • vim-fugitive: A plugin that wraps around the git command to allow for editing hunks straight in your Neovim session.
  • gitsigns.nvim: A plugin that shows tracked Git changes in your sign columns. A nice visual that can help a lot when staging and commiting changes. It also also for diff preview and inline staging!
Nice Utilities
  • oil.nvim: Editable buffer for interacting with your file system. This is a very versatile plugin. NerdFonts for your terminal is needed to load file icons.
  • telescope.nvim: A fuzzy finder which allow for quick search of pretty much everything.
  • vim-python-pep8-indent: This is a plugin that correctly indents code on newlines (pressing <CR>).
  • fidget.nvim: This is a nice notification plugins that logs the progress of your LSPs, in case something goes wrong.
  • Comment.nvim: Code commenting with gcc and gc[motion] key mappings.
  • markdown-preview.nvim: A web-based Markdown preview plugin. This can be nice if you are testing some Markdown that is pushed to some remote source like GitHub.
  • multicursor.nvim: A plugin for multicursor editing. I rarely use this, but it does come in very handy when I neeed it.
UI Plugins
  • vim-airline: A nice status bar to look at.
  • nvim-notify: A plugin for beautiful and animated notification.
  • neoscroll.nvim: A plugin to animate your scrolling. I have this because it's smoother and less dis-orientating when I do a lot of <C-d> and <C-u>
Visual Guides
  • csvview.nvim: A plugin that that makes your csv files look like literal tables, with cells. This also providees text-objects too!
  • which-key.nvim: A plugin that shows you the available key-mappings as you type. A very nice thing to have if you don't remember things well.
  • indent-blankline.nvim: Basically what its name said, it's an identation guide.
  • nvim-colorizer.lua: Basically a CSS color previewer. This is nice when doing a lot of colour configuration, e.g., configuring your colorscheme.
  • log-highlight.nvim: This plugin adds syntax-highlight for log files. Very visually-appealing whenever you need to read one.

About

My Neovim configuration. Beware, it's bad!

Topics

Resources

Stars

Watchers

Forks

Contributors