Tutorial link: LazyVim for Ambitious Developers
In keybindings, C
means Ctrl
.
Chapter 1. Introduction and Installation
Use a GPU-accelerated terminal for installing LazyVim, such as: Kitty Terminal, Alacritty, Windows Terminal, etc.
For installation instructions, please refer to the official website
keys:
<Space>l
, n, open the lazy.nvim plugin manager. PressS
to sync the update.
Chapter 2. What is Modal Editing, Anyway?
In normal mode, "
can open available registers.
:x
is almost equivalent to :wq
, but :x
does not perform save operations when the file has not been modified.
keys:
C-R
, i, pop up the register menu."
, n, pop up the register menu.C-c
, can also exit the insert mode and enter the normal mode.:q!
, force to quit neovim without saving.:x
nearly equals to:wq
, except that:x
won’t execute the “save” operation if there is no modifications.:e <path>
to edit a new file,<Tab>
to cicyle through the available directories,C-y
to accept the current directory,<Down>
to enter the selected directory.
Chapter 3. Getting Around
keys:
s
to enable the seek mode offlash
.C-<Up>
,C-<Down>
,C-y
,C-e
to scroll the screen.<Space>fc
, open the configuration directory of lazyvim.- set vim options in
lua/option.lua
file:
|
|
f
/F
to find next/previous character, press again to continously forward/backward.;
is set to repeat the operation by default. Or you can usef
to jump to the third character after the current cursor.t
/T
is same likef
/F
, butt
/T
arrive right before the target character.w
,e
,b
to go to “beginning of the next word”, “end of the next word”, “beginning of the previous word”.W
,E
,B
move a little bigger, which omit punctuation.be
/ge
to go to the end of previous word.A
/I
to move to the end/beginning of a line and enter insert mode.^
/$
/0
to move to the beginning/end/beginning of the line in normal mode.gg
/G
to move to the beginning/end of the file.100G
/100gg
/:100
to move to line 100.C-o
/C-i
to jump backward/farward in jump history.
Chapter 4. Opening Files
cwd
is typically the directory where you enter nvim in the terminal, whileroot dir
is where there is a configuration file such as.git
,package.json
, etc.:LazyExtras
opens themini.files
plugin.mini.files
is compatible with many lazyvim text editing operations. Use=
to save modifications. To find and disable the same plugin again, pressx
.
keys:
<Space> q q
, closes the entire nvim window and save the session.<Space><Space>
/Space>ff
, find file (root dir), which is case insensitive and become sensitive right after there is a upper case character.<Space>fF
to find file (cwd).- Also, you can use
:lcd
to temprarily change thecwd
for a buffer. s
to enable the seek mode. Note that it will jump to the first character of the seeking word.
Chapter 5. Configuration and Plugin Basics
.config/nvim/lua/config/keymaps.lua
is generally used for setting key bindings in Neovim or those that come with lazyvim.
In plugin configuration parameters, keys set key bindings, and opts sets plugin-related option configurations.
Reference examples for various configurations:
- Disable a certain feature:
|
|
- Modiry a certain built-in plugin
mini.files
:
|
|
- Modify
nvim-cmp
:
|
|
- Configure
guess-indent
:
|
|
- Configure
nvim-spider
:
|
|
Chapter 6. Basic Editing
keys:
80i*<Escape>
will insert 80*
which is nifty.dsfoos
, delete from the cursor to the first character of the target wordfoo
.X
delete the character before the cursor.J
to join lines.gU<range>
converts a sequence of characters into uppercase, while thegu<range>
do the inverse.~
inverts the case of character under the cursor.q<reg_name>
will start recording a sequence of operations calledmacro
, and pressq
again will stop the recording. The fastest way to play back the latest macro is pressQ
, or you can use@<reg_name>
instead.
Chapter 7. Objects and Operator-Pending Mode
(
,{
move the cursor to the beginning of a sentence or paragraph, while)
,}
to the end.
debugger, python, time out error:
possible solutions:
- venv-selector nvim plugin should be installed.
- enable a venv for a project before starting debugging for python.
- make sure your python3.exe could be properly recognized. user/global.
:DapShowLog
- related plugin: nvim-dap
- related keywords: nvim-dap-python
possible references: Debugpy - Windows · Issue #118 · mfussenegger/nvim-dap-python · GitHub
Attach to debugpy · mfussenegger/nvim-dap · Discussion #846 · GitHub
reddit.com/r/neovim/comments/199jt2c/nvimdap_debugpy_cant_work_in_windows/