/BetterNvim

A Modern Neovim setup, makes nvim an IDE.

Primary LanguageLua

BetterNvim

GitHub repo size GitHub last commit GitHub top language

📦 Installation

Preview

BetterNvim Dashboard BetterNvim Demo BetterNvim Coding1 BetterNvim Term

Introduction

This repo is to setup a modern IDE for coding in neovim (If run on Windows, need one modification (see here))

With more than 70 plugins installed

Still developing, so there are many commented out lines for future adjustment

  • VSCode-like Auto-completion setup
  • Mason for native neovim LSP management
  • treesitter for highlighting
  • Plugins: Lspsaga, bufferline, lualine, nvim-tree, vimspector, todotree ...
  • colorscheme : catppuccin
  • Neovide recommended
  • Font recommend: JetBrainsMono Nerd Font Mono

Installation

Automatically

To Install neovim run this command: (make sure you have git and bash installed before running)

curl -s https://raw.githubusercontent.com/ye-junzhe/BetterNvim/master/install.sh | bash -s

Manual

Install it manually by:

Optional: Backup existing nvim config

mv $HOME/.config/nvim $HOME/.config/nvim.old

Mandatory

  1. Cloning the repository
git clone https://github.com/ye-junzhe/BetterNvim.git $HOME/.config/nvim
  1. Installing the Plugins
nvim +PackerSync

Tagbar

Tagbar requires ctags to work, modify this line in options.lua

vim.g.tagbar_ctags_bin = "/path/to/ctags/bin"

Plugins and Lsps and Highlighting

Plugins

The most important

  • :w => In plugins-setup.lua to write the file and auto update neovim plugins
  • Remember to call :MasonUpdate first time entering neovim, else there won't be any packages showing in the Mason panel
  • Be sure to install Meslo font to show icons properly (If you are using iterm2, just install oh my zsh, and follow the instructions)

Lsps

  • :Mason => Install Lsps(g? for help)
  • All configs in this folder
  • special setup for Rust development
  • I write C/C++ code a lot so I have special clangd setup as well, you can also modify it freely in this file

Syntax highlighting

  • :TSInstall => Install tree-sitter highlighting for specific language
  • Configs in treesitter.lua

## Keybindings 🎥

Most Keybindings at [keymaps.lua](https://github.com/ye-junzhe/BetterNvim/blob/master/lua/Junzhe/core/keymaps.lua)

The rest of the settings are in the corresponding lua file of the plugin

`<D->` = `Command` on macOS, and it only works in neovide, changes needed if running on windows

**The `<leader>` key has been changed to `<space>`**
# Basic
<leader>e => File explorer(g? for help)
<leader>q => Tagbar
<leader>r => Todo-Tree
<leader>lg => Lazygit
<leader>w => Code minimap

# Telescope
<leader>ff => File search
<leader>fr => Recent file search
<leader>fw => Word search in current buffer
<leader>fs => Word search in all files

# Lspsaga
gh => Hover doc
gd => Definition
gf => Find definition and references
<leader>o => show symbols(silimar to tagbar)
<leader>a => Code actions
<leader>t => Terminal
<leader>dw => Work space diagnostics
<leader>db => Buf diagnostics

# Bufferline
Shift+h => Switch left
Shift+l => Switch right
ctrl+w => Close buffer

# Navigation
ctrl + h/j/k/l => navigate windows

# Hop
<leader>j => jump lines
ml => jump words

# Save and quit
W => Save
Q => Quit

# Bookmark
mm => Create and delete
mi => Add annotation
mc => Clear bookmarks
mx => Clear in all buffers
mn, mp => Navigate
ma => Show all