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. PressSto 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.:xnearly equals to:wq, except that:xwon’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-yto accept the current directory,<Down>to enter the selected directory.
Chapter 3. Getting Around
keys:
sto enable the seek mode offlash.C-<Up>,C-<Down>,C-y,C-eto scroll the screen.<Space>fc, open the configuration directory of lazyvim.- set vim options in
lua/option.luafile:
| |
f/Fto find next/previous character, press again to continously forward/backward.;is set to repeat the operation by default. Or you can usefto jump to the third character after the current cursor.t/Tis same likef/F, butt/Tarrive right before the target character.w,e,bto go to “beginning of the next word”, “end of the next word”, “beginning of the previous word”.W,E,Bmove a little bigger, which omit punctuation.be/geto go to the end of previous word.A/Ito move to the end/beginning of a line and enter insert mode.^/$/0to move to the beginning/end/beginning of the line in normal mode.gg/Gto move to the beginning/end of the file.100G/100gg/:100to move to line 100.C-o/C-ito jump backward/farward in jump history.
Chapter 4. Opening Files
cwdis typically the directory where you enter nvim in the terminal, whileroot diris where there is a configuration file such as.git,package.json, etc.:LazyExtrasopens themini.filesplugin.mini.filesis 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>fFto find file (cwd).- Also, you can use
:lcdto temprarily change thecwdfor a buffer. sto 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.Xdelete the character before the cursor.Jto 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 pressqagain 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/