ye-junzhe / BetterNvim

Coding in Neovim elegently

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 for coding in neovim (Works on both macOS and Linux)

  • VSCode-like Auto-completion setup
  • Plugin Manager: Lazy.nvim
  • Mason for native neovim LSP management
  • Tree-sitter for highlighting
  • Plugins: Lspsaga, Barbar, Lualine, Nvim-tree, Nvim-cmp, Todotree, Neogit ...
  • Neovide recommended
  • Font recommend: JetBrainsMono Nerd Font Mono

Installation

To show glyphs properly, please install nerdfonts first

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
  • IF ON LINUX
git clone --depth 1 https://github.com/ye-junzhe/BetterNvim.git -b linux $HOME/.config/nvim

Plugins and Lsps and Highlighting

Plugins

The most important

  • Call :Lazy the first time you open nvim, and then press U to update all the plugins
  • Remember to call :MasonUpdate first time entering neovim, else there won't be any packages showing in the Mason panel

Lsps

  • :Mason => Install Lsps(g? for help)
  • All configs in this folder
  • special setup for Rust development using rust-tools

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)

# 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 => Terminal
<leader>dw => Work space diagnostics
<leader>db => Buf diagnostics

# Barbar
Shift+h => Switch left
Shift+l => Switch right
mp => BufferPick
ctrl-p => 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


Languages

Language:Lua 100.0%