Thanks to visit codestin.com
Credit goes to github.com

Skip to content
 
 

Latest commit

 

History

120 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BetterNvim

GitHub repo size GitHub last commit GitHub top language

📦 Installation

Preview

BetterNvim Dashboard BetterNvim Coding BetterNvim HoverDoc BetterNvim Errors BetterNvim FloatTerm

Introduction

This repo is to setup a modern IDE style coding experience in Neovim.

  • Supported OS

    • macOS(Tested on the latest macOS)
    • GNU/Linux(Tested on Debian 12 Bookworm)
    • Windows Subsystem for Linux(Tested on WSL Ubuntu)
  • Features:

    • VSCode-like Auto-completion setup
    • Plugin Manager: Lazy.nvim
    • Mason for native Neovim LSP management
    • Tree-sitter for syntax highlighting
    • Plugins: Lspsaga, Barbar, Lualine, Nvim-tree, Nvim-cmp, Todotree, Neogit ...
    • Neovide recommended for much smoother GUI animation

Installation

Prerequisites

  • Neovim >= 0.10.0
  • CMake
  • Make
  • fzf
  • ripgrep
  • fd-find
  • node
  • python3
  • tree-sitter-cli (Linux)

Glyphs

To show glyphs properly, please install Nerd Fonts first, and set your terminal to use it

Optional: Backup existing nvim config

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

Clone the repository

git clone --depth 1 https://github.com/ye-junzhe/BetterNvim.git $HOME/.config/nvim

Additional step for Linux

If Neovim on your machine is compiled from source, set a hard link to /usr/bin, for sudoers to find it

ln /path/to/nvim /usr/bin/nvim

Plugins and Lsps and Highlighting

Plugins

Initialization

  • Enter :Lazy, then press U to update all the plugins
  • Enter :MasonUpdate else there won't be any packages showing in the Mason panel
  • Enter TSUpdate to update all Tree-sitter parsers

Lsps

  • :Mason => Install Lsps(g? for help)
  • All configs in this folder
  • Mainly focusing on Rust development

Syntax highlighting

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

Keybindings 🎥

Keybindings at keymaps.lua And the rest of are in the corresponding *.lua file of the plugin

<D-> = Command on macOS

The <leader> key has been changed to <space>

Basic

<leader>e => nvim-tree (g? for help)
i => Change directory
I => Chanege to the parent folder
o => Unfold
O => Fold

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

# Lspsaga
gh => Hover doc
gd => Definition(In definition window, o/i => edit)
gf => Find definition and references
<leader>oo => show symbols(silimar to tagbar)
<leader>a => Code actions
<leader>t(open)/tt(close) || ctrl-t => Float Term
<leader>dw => Work space diagnostics
<leader>db => Buf diagnostics

# Barbar
Shift+h => Switch left
Shift+l => Switch right
Shift+f => Switch buffer forword
Shift+b => Switch buffer backword
mp => BufferPick
ctrl-p => BufferPin
ctrl-c => BufferCloseAllButCurrentOrPinned

# 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 => Next bookmark
ma => Show all

# Neogit(Magit clone for Neovim)
<leader>gg => Open Neogit

About

Coding in Neovim elegently

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages