终端安装与配置
安装 neovim
Mac 可以直接使用 Homebrew 直接安装
BASHbrew install neovim
tmux (option)
tmux config file path ~/.tmux.conf
BASHbrew instal tmux
fix clear
command terminal database is inaccessible
error
BASHcurl -LO https://invisible-island.net/datafiles/current/terminfo.src.gz && gunzip terminfo.src.gz /usr/bin/tic -xe tmux-256color terminfo.src sudo /usr/bin/tic -xe tmux-256color terminfo.src /usr/bin/tic -xe kitty-direct,tmux-256color terminfo.src infocmp -x tmux-256color
add set -g default-terminal "tmux-256color"
into .tmux.conf
tmux config
BASHset -g default-terminal "tmux-256color"` into `.tmux.conf # keymaps unbind C-b set -g prefix C-a
Neovim 配置
可以基于以下社区方案进行安装配置
LazyVim
LernaVim
AstroVim
下面我将以LazyVim
的安装作为示例
Requirement
BASHbrew install ripgrep brew install fd brew install tmux
Install lazyvim
BASHgit clone https://github.com/LazyVim/starter ~/.config/nvim rm -rf ~/.config/nvim/.git
- start
BASHnvim
macos should set
defaults write -g ApplePressAndHoldEnabled --bool false
Config keymap (Option)
According to your own preference.
BASH# ~/.config/nvim/lua/config/keymaps.lua keymap.set('n', 'jk', '<Esc>')
Shortcut key
- indent
cmd + shift + </>
- move up/down
A-j/k
- search content
leader s g
- search file
leader leader
- hover documentaion
shift k
- variable rename
leader c r
- search in buffer
leader f b
orleader ,
- split window
leader |
- close window
leader w d
- search TODO
leader s t
- search keymaps
leader s k
- switch numberline
leader u l
- replace in file
leader s r
- open git window
leader g
- add stage
leader
- commit
c
- quite lazygit window
q
- add stage
- open terminal
leader f t
- switch filetree
leader e
- toggle format on save
leader u f
- toggle diagnostics
leader u d
Tmux Shortcut
- create new window
C-a c
- close window
C-a x
- switch next window
C-a n
- quite terminal
exit
Quick selection
dependence flash
- remote mode
yr3y
copy 3 linesdr3d
delete 3 lines
- treesitter
yr [char] S