Claws Garden

Lazyvim使用

Install Lazyvim

Lazyvim is a package manger for Neovim. The prerequisite of Lazyvim is installing Neovim. I suggest install neovim using homebrew, which can bring newer version than yum/apt.

First, install homebrew (the following command runs in all OSs):

1/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

This command has a strange point: it checks the sudo permission for the current user, but also verify the current user is not root. So if you’re using a new user without a SUDO password, now you need to set one in advance:

1sudo passwd

Install neovim via homebrew:

1brew install neovim

Finally, install Lazyvim:

1git clone https://github.com/LazyVim/starter ~/.config/nvim

The next time you launch the neovim, it will install all default plugins and you will get a fancy IDE-like terminal, where you are even able to use mouse to select “windows”:

1nvim . # open current directory in neovim.

image-20250619233353571

ECS is a very frequently used key in vim based editor, so remapping ecs to caps lock key is very useful.

Lazyvim Language Support

Lazyvim provide plugin bundles to support coding in programing languages. To install language plugin bundles(called “language”), type :LazyExtras to open extension management window. LazyExtras recommends extensions based on the current project opened, for example, if the current project contains .go file, it will recommend lang.go. The LazyExtras languages contain a set of plugin(LSP server plugin, formatter etc.). Move the cursor to certain language’s line and press x to enable the plugin. After enabling, close and reload the neovim tmo install the plugins.

The core language features in LazyVim is powered by LSP. LSP(Language Server Portocol) is a portocol used between a tool(the client, usually a editor) and a language smartness provider(the server) to integrate features like auto complete, go to definition, find all references and alike into the tool. Lazyvim doesn’t directly install/manage the LSP plugin, but uses Mason to install them. So if some plugin audo installation fails, you can check the Mason logs to debug.

Useful Mason Command:

Useful Operations

The opened file tag is called buffer in Lazyvim. <leader> is by default set to space key, when you press it, a little panel will appear in the right bottom cornor of the window, which prompt the next key to press and the action will be triggered.

Buffers:

Window Navigation:

File tree:

Searching

Terminal

Editor

Git

#工具