JohnBro / lazyvim-private-config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

💤 LazyVim

This is my private confif with LazyVim. Refer to the documentation to get started.

Installation

dashboard

Prerequisites

Unix/Linux

  1. Make a backup of your current Neovim files:
# required
mv ~/.config/nvim{,.bak}

# optional but recommended
mv ~/.local/share/nvim{,.bak}
mv ~/.local/state/nvim{,.bak}
mv ~/.cache/nvim{,.bak}
  1. Clone the starter
git clone https://git.johnbro.cn/Johnbro/lazyvim_private ~/.config/nvim
  1. Start the Neovim to lazy install all plugins nvim

  2. Run :checkhealth to see if any error/warning, then please solve it.

Windows

  1. Make a backup of your current Neovim files:
# required
Move-Item $env:LOCALAPPDATA\nvim $env:LOCALAPPDATA\nvim.bak

# optional but recommended
Move-Item $env:LOCALAPPDATA\nvim-data $env:LOCALAPPDATA\nvim-data.bak
  1. clone the private config
git clone https://git.johnbro.cn/Johnbro/lazyvim_private $env:LOCALAPPDATA\nvim
  1. Start Neovim to lazy install all plugins nvim

  2. Run :checkhealth to see if any error/warning, then please solve it.

Keymaps

I have many self customization based on LazyVim defaults, regards to all the defaults of LazyVim keymsp, please refer to https://www.lazyvim.org/keymaps.

  • Default <leader> is <space>.
  • Default <localleader> is changed as ,

General

Note that general keymaps won't take effect in vscode mode.

Key Description Mode Note
n Motion with zz nzz New add
N Motion with zz Nzz New add
G Motion with zz Gzz New add
{ Motion with zz {zz New add
} Motion with zz i New add
jk Enter normal mode i New add
j Motion with g gj Keep with LazyVim
k Motion with g gk Keep with LazyVim
<C-h>,<C-j>,<C-k>, <C-l> Window motion n,t Keep with LazyVim
<C-Up>, <C-Down>, <C-Left>, <C-Right> Window width/height adjustment n Keep with LazyVim
<A-j>, <A-k> Move down/up n, i, v Keep with LazyVim
H, L, [b, ]b Pre/Next buffer n Delete from LazyVim
<leader>bb, <leader>` Switch to other buffer n Keep with LazyVim
<leader>bo Switch to other buffer n Keep with LazyVim
<leader>ur Redraw / clear hlsearch / diff update n Keep with LazyVim
<C-s> Save file n, v, x, i Keep with LazyVim
<leader>K, K Keywordprg n Keep with LazyVim
<leader>l, <leader>hl Lazy n Modify from LazyVim
<leader>fn New file n Keep with LazyVim
<leader>xl Location list n Keep with LazyVim
<leader>xq Quickfix list n Keep with LazyVim
<leader>uf Toggle format on save n Keep with LazyVim
<leader>us Toggle spelling n Keep with LazyVim
<leader>uw Toggle word wrap n Keep with LazyVim
<leader>ul Toggle line numbers n Keep with LazyVim
<leader>ud Toggle Diagnostics n Keep with LazyVim
<leader>uc Toggle Conceal n Keep with LazyVim
<leader>uh Toggle Inlay Hints n Keep with LazyVim
<leader>gg, <leader>gG Lazygit (root dir), Lazygit (cwd) n Keep with LazyVim
Inspect Pos Inspect Pos n Keep with LazyVim
<leader>L, <leader>hL LazyVim Changelog n Modify from LazyVim
<leader>fT, <leader>ft Terminal (root dir) or Terminal (cwd) n Keep with LazyVim
<C-/> Terminal (root dir) n Keep with LazyVim
<C-_> which_key_ignore n, t Keep with LazyVim
<Esc><Esc> Enter normal mode n, t Keep with LazyVim
<C-/> Hide terminal t Keep with LazyVim
<leader>ww, <leader>ww Other window, delete window n Keep with LazyVim
<leader>w-, <leader>w| Split window right or below n Keep with LazyVim
<leader>-, <leader>| Split window right or below n Keep with LazyVim
<leader><Tab>l Last tab n Keep with LazyVim
<leader><tab>f First tab n Keep with LazyVim
<leader><tab><tab> New tab n Keep with LazyVim
]<Tab>, <leader><tab>] Next tab n Modify from LazyVim
[<Tab>, <leader><tab>[ Previous tab n Modify LazyVim
<leader><tab>d Close tab n Keep with LazyVim
<C-a> <C-b>, move to beginning c New add
<Up> <C-p>, Previous select c New add
<Down> <C-n>, Next select c New add
<leader>D Dashboard n New add

LSP

Key Description Mode
<leader>cd Line Diagnostics n
<leader>cl Lsp Info n
gd Goto Definition n
gr References n
gD Goto Declaration n
gI Goto Implementation n
gy Goto T[y]pe Definition n
K Hover n
gK Signature Help n
<c-k> Signature Help i
]d Next Diagnostic n
[d Prev Diagnostic n
]e Next Error n
[e Prev Error n
]w Next Warning n
[w Prev Warning n
<leader>cf Format Document n
<leader>cf Format Range v
<leader>ca Code Action n, v
<leader>cA Source Action n
<leader>cr Rename n

bufferline.nvim #Ui

Key Description Mode
<leader>bp Toggle pin n
<leader>bP Delete non-pinned buffers n
<leader>be Pick Close buffers n
<leader>bh Close Left buffers n
<leader>bl Close Right buffers n
<leader>bO Close Other buffers n
<leader>bn Next buffer n
<leader>bp Previous buffer n
<leader>bj Jump buffer n
<leader>bD Sort by Directory n
<leader>bL Sort by Language n

flash.nvim #Plugins #Editor #VSCode

Key Description Mode
s Flash n, x, o
S Flash Treesitter n, o, x
r Remote Flash o
R Treesitter Search o, x
<c-s> Toggle Flash Search c

Mason.nvim #Plugins #Lsp

Key Description Mode
<leader>cm Mason n

mini.bufremove #Plugins #Editor

Key Description Mode
<leader>bd Delete Buffer n
<leader>bD Delete Buffer (Force) n

mini.pairs #Plugins #Coding

Key Description Mode
<leader>up Toggle auto pairs n

mini.surround #Plugins #Coding #VSCode

Key Description Mode
gsa Add surrounding n, v
gsd Delete surrounding n
gsf Find right surrounding n
gsF Find left surrounding n
gsh Highlight surrounding n
gsr Replace surrounding n
gsn Update MiniSurround.config.n_lines n

mini.comment #Plugins #Coding #VSCode

Key Description Mode
gc Toggle comment for a text or selected text n, x, o
gcc Toggle comment a line n

neo-tree.nvim #Plugins #Editor

Key Description Mode
<leader>fe Explorer NeoTree (root dir) n
<leader>fE Explorer NeoTree (cwd) n
<leader>e Explorer NeoTree (root dir) n
<leader>E Explorer NeoTree (cwd) n

noice.nvim #Plugins #Ui

Key Description Mode
<S-Enter> Redirect Cmdline c
<leader>snl Noice Last Message n
<leader>snh Noice History n
<leader>sna Noice All n
<leader>snd Dismiss All n
<c-f> Scroll forward i, n, s
<c-b> Scroll backward i, n, s

nvim-notify #Plugins #Ui

Key Description Mode
<leader>un Dismiss all Notifications n

nvim-spectre #Plugins #Editor

Key Description Mode
<leader>sr Replace in files (Spectre) n

nvim-treesitter #Plugins #Treesitter

Key Description Mode
<c-space>, Incremental selection n
<bs> Decrement selection x
]f Next func begin n
]F Next func end n
[f Previous func begin n
[F Previous func end n

nvim-treesitter-textobjects #Plugins #Treesitter #VSCode

Select, Swap, Move, ... based on text object. Please refer to https://github.com/nvim-treesitter/nvim-treesitter-textobjects for details.

persistence.nvim #Plugins #Util

Key Description Mode
<leader>qs Restore Session n
<leader>ql Restore Last Session n
<leader>qd Don't Save Current Session n

telescope.nvim #Plugins #Editor

Key Description Mode
<leader>,, <leader>bb Switch Buffer n
<leader>/ Grep (root dir) n
<leader>: Command History n
<leader><space> Find Files (root dir) n
<leader>fb, <leader>bb Buffers n
<leader>ff Find Files (root dir) n
<leader>fF Find Files (cwd) n
<leader>fr Recent n
<leader>fR Recent (cwd) n
<leader>gc commits n
<leader>gs status n
<leader>s"<leader>h" Registers n
<leader>sa<leader>ha Auto Commands n
<leader>sb Buffer n
<leader>sc<leader>hc Command History n
<leader>sC<leader>hC Commands n
<leader>sd Document diagnostics n
<leader>sD Workspace diagnostics n
<leader>sg Grep (root dir) n
<leader>sG Grep (cwd) n
<leader>sh, <leader>hh Help Pages n
<leader>sH, <leader>hH Search Highlight Groups n
<leader>sk, <leader>hk Key Maps n
<leader>sM, <leader>hm Man Pages n
<leader>sm Jump to Mark n
<leader>so, <leader>ho Options n
<leader>sR, <leader>hR Resume n
<leader>sw Word (root dir) n
<leader>sW Word (cwd) n
<leader>sw Selection (root dir) v
<leader>sW Selection (cwd) v
<leader>uC Colorscheme with preview n
<leader>ss Goto Symbol n
<leader>sS Goto Symbol (Workspace) n
<leader>hP Find Plugin Files n
<leader>fb Telescope file_browser n

todo-comments.nvim #Plugins #Editor

Key Description Mode
]t Next todo comment n
[t Previous todo comment n
<leader>xt Todo (Trouble) n
<leader>xT Todo/Fix/Fixme (Trouble) n
<leader>st Todo n
<leader>sT Todo/Fix/Fixme n

trouble.nvim #Plugins #Editor

Key Description Mode
<leader>xx Document Diagnostics (Trouble) n
<leader>xX Workspace Diagnostics (Trouble) n
<leader>xL Location List (Trouble) n
<leader>xQ Quickfix List (Trouble) n
[q Previous trouble/quickfix item n
]q Next trouble/quickfix item n

vim-illuminate #Plugins #Editor

Key Description Mode
]] Next Reference n
[[ Prev Reference n

gitsigns.nvim #Plugins #Editor

Key Description Mode
]h Next hunk n
[h Previous hunk n
<leader>ghb blame line with float window n
<leader>ghd Diff this n
<leader>ghD Diff this ~ n
<leader>ghp Preview hunk n
<leader>ghr Reset hunk n, v
<leader>ghR Reset buffer n
<leader>ghs Stage hunk n, v
<leader>ghS Stage buffer n
<leader>ghu Undo stage hunk n
ih Select hunk x, o
<leader>ugb toogle line blame n
<leader>ugg toggle diff inline n
<leader>ugl toggle line highlight n
<leader>ugn toggle number hightlight n

edgy.nvim #Extras #Ui

Part of lazyvim.plugins.extras.ui.edgy.

Key Description Mode
<leader>ue Edgy Toggle n
<leader>uE Edgy Select Window n

project.nvim #Extras #Util

Part of lazyvim.plugins.extras.util.project

Key Description Mode
<leader>fp Projects n

VSCode-Neovim #Extras #VSCode

Key Description Mode
<leader><space> Find n
<leader>/ Find in file n
<leader>ss Go to symbol n
<tab> Toggle fold n
za Toggle fold n
zc Fold n
zC Fola all n
zo Unfold n
zO Unfold n
zR Unfold Recursively n
j gj n
k gk n
<leader>bn Next Editor n
<leader>bp Previous Editor n
<leader>bb Quick Open n
<leader>bd Close Active Editor n
<leader>bO Close Other Editors n
<leader>ul Toggle sidebar visibility n
<leader>ur Toggle right sidebar n
<leader>ua Toggle Activity bar n

multicursors.nvim #User #Editor

Key Description Mode
<C-n> Multicursor start to select n, v

align.nvim #User #Editor #VSCode

ga as the leader to align the text, can be used in VSCode.

Key Description Mode
gaa Align to a char n, x
gas Align to 2 chars x
gaw Align to a string x, n
gar Align to a lua pattern x

Confiugration

Dashboard

Please refer to ui.lua. Modified from LazyVim:

  1. Change the dashboard logo to what i like.
  2. Add more startup menu item and decrease the padding.

Vscode

  1. Please install vscode-neovim and Neovim Ui Modifier in your vscode. WSL should also install Neovim Ui Modifier in remote.
  2. Please set neovim path in settings.
  3. LazyVim has some default vscode settings, please refer to https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/plugins/extras/vscode.lua.

If you want to add more plugins support for vscode, please choose a good:

  1. add vscode = true into plugin configuration.
  2. add cond = vim.g.vscode into plugin configuration. I think this way is better.

LazyVim default enable below plugins + flash.nvim:

local enabled = {
  "flit.nvim",
  "lazy.nvim",
  "leap.nvim",
  "mini.ai",
  "mini.comment",
  "mini.pairs",
  "mini.surround",
  "nvim-treesitter",
  "nvim-treesitter-textobjects",
  "nvim-ts-context-commentstring",
  "vim-repeat",
  "LazyVim",
}

Please check plugins/vscode.lua for my customization for vscode.

About

License:Apache License 2.0


Languages

Language:Lua 100.0%