- Create a .dotfiles folder to track dotfiles
git init --bare $HOME/.dotfiles
- Add an alias
dotfiles
to your.zshrc
alias dotfiles='/usr/local/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
- Set git status to hide untracked files
dotfiles config --local status.showUntrackedFiles no
dotfiles status
# .zshrc
dotfiles add $HOME/.zshrc
dotfiles commit -m 'feat: add .zshrc'
# ZSH_CONFIG
dotfiles add $HOME/ZSH_CONFIG/*
dotfiles commit -m 'feat: add ZSH_CONFIG files'
# nvim
dotfiles add $HOME/.config/nvim/coc-settings.json
dotfiles add $HOME/.config/nvim/init.vim
dotfiles commit -m 'feat: add coc-settings, init.vim'
dotfiles remote add origin [email protected]:USERNAME/.dotfiles.git
dotfiles push -u origin master
- Switch to next tab
- In
NORMAL
mode, pressCtrl + e
- In
- Switch to previous tab
- In
NORMAL
mode, pressCtrl + w
- In
- Close tab
- In
NORMAL
mode, pressCtrl + q
- In
- Auto compile file
- In
NORMAL
mode, pressF5
- In
- Save file
- In
INSERT
mode, pressCtrl + s
- In
ds
: Delete brackets-
Press
ds
"
"Hello world!"
to change it to
Hello world!
-
cs
: Replace brackets- Press
cs
"(
to change it to"Hello world!"
(Hello world!)
- Press
cS
: Replace brackets and add text in new line- Press
cS
"{
to change it to"Hello world!"
{ Hello world! }
- Press
ys
: Add brackets- With the cursor on "Hello", press
ys
w
[
to change it toHello world!
[Hello] world!
- With the cursor on "Hello", press
yS
: Add brackets and add text in new line- With the cursor on "Hello", press
ys
w
[
to change it toHello world!
[ Hello ] world!
- With the cursor on "Hello", press
- Toggle NERDTree
- In
NORMAL
mode, press-
- In
- Use multiple cursors
- Select lines in
VISUAL
mode, pressCtrl + n
- Select lines in
- Add comments
- Select lines in
VISUAL
mode, press\
cc
- Select lines in
- Uncomments
- Select lines in
VISUAL
mode, press\
cu
- Select lines in
- Toggle NERDTree
- In
NORMAL
mode, press=
- In
- Go to tag/function/class
- In
NORMAL
mode, pressCtrl + ]
- In
- Go back to previos function
- In
NORMAL
mode, pressCtrl + t
- In
- Search for a particular tag
- In
NORMAL
mode, type:ts <tag>
- In
- Search lines in all buffers
- In
NORMAL
mode, press\
fl
- In
- Search lines in current buffer
- In
NORMAL
mode, press\
fb
- In
- Search files
- In
NORMAL
mode, press\
ff
- In
- Search git files (git ls-files)
- In
NORMAL
mode, press\
fg
- In
- Search git files (git status)
- In
NORMAL
mode, press\
f?
- In
- Use tag to search files
- In
NORMAL
mode, press\
ft
- In
- Use tag to search files
- In
NORMAL
mode, press\
ft
- In
- Search git commits (Requires fugitive.vim)
- In
NORMAL
mode, press\
fc
- In
- Search MRU file
- In
NORMAL
mode, press\
fh
- In
- Search history commands
- In
NORMAL
mode, press\
`fh?
- In