All Projects → vimhack → dotfiles

vimhack / dotfiles

Licence: MIT license
🍀 Vim/Neovim + Tmux + Zsh + Alacritty = Build your own fantastic development environment

Programming Languages

Vim Script
2826 projects
shell
77523 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to dotfiles

dotfiles
Poom's Neovim, Tmux, Fish and other configurations for macOS & Linux. Literally my entire world.
Stars: ✭ 36 (-44.62%)
Mutual labels:  tmux, vimrc, nvim, dotfile, tmux-conf
Dot-It-Up
A collection of dotfile scripts, plugins, and clever hacks so that you can become the master of your own OS! 🚀
Stars: ✭ 254 (+290.77%)
Mutual labels:  tmux, vimrc, zshrc, nvim, tmux-conf
dotfiles
A place to store config files so I can revert when my entire system crashes from entering the wrong character
Stars: ✭ 25 (-61.54%)
Mutual labels:  tmux, zshrc, nvim, tmux-conf
dotfiles
🚀 tmux, ohmyzsh, powerlevel10k, neovim 🔧
Stars: ✭ 24 (-63.08%)
Mutual labels:  tmux, zshrc, nvim, tmux-conf
nvim
Structure, documented, super fast neovim configuration. 可能是翻斗花园最好用的 neovim 配置[^1]。
Stars: ✭ 223 (+243.08%)
Mutual labels:  vimrc, ide, nvim, dotfile
dotfiles
my personal dotfiles managed by dotbot, zinit
Stars: ✭ 65 (+0%)
Mutual labels:  tmux, vimrc, zshrc, tmux-conf
configuration
Config files
Stars: ✭ 12 (-81.54%)
Mutual labels:  tmux, zshrc, ranger
dotfiles
My amazing vim, zsh and tmux config files
Stars: ✭ 25 (-61.54%)
Mutual labels:  tmux, vimrc, zshrc
dotfiles
shell, git, vim, tmux .etc dotfiles, managed via gnu stow
Stars: ✭ 20 (-69.23%)
Mutual labels:  tmux, vimrc, dotfile
kali-config
Linux colorful dotfiles.
Stars: ✭ 40 (-38.46%)
Mutual labels:  tmux, nvim, alacritty
Dotfiles
My configuration files
Stars: ✭ 89 (+36.92%)
Mutual labels:  tmux, vimrc, zshrc
dotfiles
My dotfiles based on Makefile
Stars: ✭ 150 (+130.77%)
Mutual labels:  tmux, zshrc, dotfile
dotfiles
🔯 A collection of my rc files (tmux, neovim, zsh, fish, poetry, git, ...etc) and utilities that make everyday coding fun!
Stars: ✭ 23 (-64.62%)
Mutual labels:  tmux, vimrc, zshrc
anyrc
🐚 Bring your shell environment to anywhere
Stars: ✭ 28 (-56.92%)
Mutual labels:  vimrc, zshrc, tmux-conf
dots
Code Smell Dotfiles
Stars: ✭ 163 (+150.77%)
Mutual labels:  tmux, nvim, alacritty
Dotfiles
⚡️ Awesome configurations for the development environments
Stars: ✭ 137 (+110.77%)
Mutual labels:  tmux, vimrc, zshrc
dotfiles
💾 personal configuration files
Stars: ✭ 42 (-35.38%)
Mutual labels:  tmux, nvim, alacritty
dotfiles
Dotfiles of Coelacanthus
Stars: ✭ 17 (-73.85%)
Mutual labels:  vimrc, zshrc, dotfile
Takumi
Takumi, clean and elegant dotfiles
Stars: ✭ 22 (-66.15%)
Mutual labels:  tmux, vimrc, nvim
Dotfiles
Get ready for dotfiles. Contains i3, i3blocks, rofi, dunst, picom, vim, tmux, and zsh.
Stars: ✭ 985 (+1415.38%)
Mutual labels:  tmux, vimrc, zshrc

Vimhack/dotfiles 🍀

Page Views Clones LICENSE

Vimhack/dotfiles is a Fantastic Development Environment, built with Vim/Neovim, Tmux, Zsh, Alacritty and many other related excellent open source softwares.

The supported platforms currently are macOS and Linux.

show

For efficient and convenient use of shortcuts, I strongly recommend using HHKB keyboard, or a keyboard capable of changing the key position and change Caps to Ctrl.
If you use MacBook, you can use Karabiner-Elements to modify the Caps to left Ctrl easily.

Contents

📦 Requirements Installation

See here.

📀 Installation

To install, run the following from your terminal: (please backup your existing dotfiles first)

# Make sure the target directory is '~/.dotfiles'.
git clone --depth=1 https://github.com/vimhack/dotfiles.git ~/.dotfiles

# Zsh
ln -sf ~/.dotfiles/zsh/zshrc ~/.zshrc

# Vim
mkdir ~/.vim
ln -sf ~/.dotfiles/vim/vimrc ~/.vimrc
ln -sf ~/.dotfiles/vim/coc-settings.json ~/.vim/coc-settings.json

# Neovim
mkdir -p ~/.config/nvim && ln -sf ~/.dotfiles/vim/vimrc ~/.config/nvim/init.vim
ln -sf ~/.dotfiles/vim/coc-settings.json ~/.config/nvim/coc-settings.json

# Tmux
ln -sf ~/.dotfiles/tmux/tmux.conf ~/.tmux.conf
# Add your own configurations in this file.
touch ~/.tmux.local.conf

# Alacritty
mkdir -p ~/.dotfiles/alacritty
\cp ~/.dotfiles/alacritty/alacritty.yml ~/.config/alacritty/alacritty.yml
\cp ~/.dotfiles/alacritty/alacritty_private.yml ~/.alacritty_private.yml

Then open or reopen the alacritty, if it is the first time to run, you may need to wait a while, because the tmux plugins are automatically installed in the background.

In addition, when vim or nvim is started, if there are vim plugins that have been configured but not yet installed, they will be installed automatically.

To update:

cd ~/.dotfiles
git pull

Enjoy it😘

🍀 Colorscheme/Theme

In Terminal Command Line

Change colorscheme of Vim/Neovim and Alacritty

$ colorscheme

Current colorscheme is 'dracula', and it can be changed to one of the following list:

* gruvbox
* solarized
* molokai
* monokai
* rigel
* jellybeans
* nord
* tender
* one
* iceberg
* papercolor
* ayu
* ayu_mirage
* onehalf
* vadelma
* pencil
* srcery
* springnight
* google
* github
* embark
* off
* base16
* flat
* materia
* atelierdune
* oceanicnext
* gruvbox_light
* solarized_light
* one_light
* iceberg_light
* papercolor_light
* ayu_light
* onehalf_light
* vadelma_light
* pencil_light
* google_light
* github_light
* off_light
* cupertino
* atelierdune_light

For example, change colorscheme to 'atelierdune_light':

$ colorscheme atelierdune_light

or

$ cs atelierdune_light

💡 Light colorschemes are good in the morning or at a place with natural light.

Change font of Alacritty

$ font

Current font is 'Hasklug_Light', and it can be changed to one of the following list:

* Hack_Regular
* BlexMono_Book
* BlexMono_Light
* BlexMono_ExtraLight
* BlexMono_Thin
* SauceCodePro_Regular
* SauceCodePro_Light
* SauceCodePro_ExtraLight
* JetBrainsMono_Regular
* JetBrainsMono_Light
* JetBrainsMono_ExtraLight
* JetBrainsMono_Thin
* RobotoMono_Regular
* RobotoMono_Light
* RobotoMono_Thin
* Hasklug_Regular
* Hasklug_ExtraLight
* VictorMono_Regular
* VictorMono_Light
* VictorMono_ExtraLight
* VictorMono_Thin
* FantasqueSansMono_Regular
* LiterationMono_Book
* Lekton_Regular
* DejaVuSansMono_Book
* GoMono_Book
* mononoki_Regular
* Cousine_Regular
* SpaceMono_Regular
* UbuntuMono_Regular
* CodeNewRoman_Book
* CaskaydiaCove_Regular
* CaskaydiaCove_Light
* CaskaydiaCove_SemiLight
* CaskaydiaCove_ExtraLight
* FiraCode_Regular
* FiraCode_Light
* Hurmit_light
* DaddyTimeMono_Book
* OpenDyslexicMono_Regular
* Monofur_Book

For example, change font to 'Monofur_Book':

$ font Monofur_Book

or

$ ft Monofur_Book

Change font size of Alacritty

$ font-size

Current font size is '12', and it can be changed by:

$ font-size number

or

$ fs number

* number must between 1 and  200

Change opacity of Alacritty

$ opacity

Current opacity is '0.9', and it can be changed by:

$ opacity number

or

$ o number

* number must between 0 and 1

Toggle Vim/Neovim background transparent

$ toggle-vim-transparent

or

$ tv

Toggle Alacritty background transparent

$ toggle-alacritty-transparent

or

$ to

Print 256 colors

$ colors-print

or

$ c

$ print-256-hex-colors

or

$ hex

Print Icons

$ print-icons

or

$ icons

With Keyboard Shortcuts/Hotkey

ctrl a follows is the tmux prefix key.

Change colorscheme of Vim/Neovim and Alacritty randomly

ctrl a v

Change font of Alacritty randomly

ctrl a shift f

Toggle Alacritty background transparent

ctrl a shift o

Increase Alacritty background transparent

ctrl a ctrl k

Decrease Alacritty background transparent

ctrl a ctrl j

Toggle Tmux status line

ctrl a b

Toggle Tmux pane-border-status(pane name)

ctrl a ctrl b

In Vim Normal Mode

Toggle Vim/Neovim background color(light or dark)

,b

💡 Only support colorschemes that have both dark and light background color.

Toggle Vim/Neovim background transparent

,o

💡 Opacity of Alacritty(terminal) must be less than 1.

📺 Alacritty

Keyboard Shortcuts

Shortcut Action
Command h Hide the current Alacritty terminal
Command m Minimize the current Alacritty to the Dock
Command q/w Quit Alacritty
Command n Spawn new instance of Alacritty
Command f/b Search forward or backward
Command +/-/0 Increase/Decrease/Reset font size
Ctrl Command f Toggle full screen
Ctrl l Clear warning/error messages of Alacritty in status line
Command Option h Hiding all windows other than the current Alacritty

🐚 Zsh(OhMyZsh)

Reload ~/.zshrc

$ omz reload

or

$ exec zsh

fzf

  • $ ff

    Search file by fzf and then open it by vim.

  • Ctrl t

    List all files and dirs of the current dir, then select one and enter, it will paste the selected file name to the command line.

  • Option/Alt c

    List all dirs of the current dir, then select one and enter, it will switch to the selected dir.

  • Ctrl r

    List history commands, then input keywords and select the specific one, and enter, it will paste the selected command to the command line.

  • Ctrl k/j

    Select up or down in file/dir list or history command list.

  • Ctrl p/n

    The same as Ctrl k/j.

  • Ctrl c / Ctrl g / esc

    Quit from file/dir list or history command list.

Custom Commands

Adjust the system volume

$ vol

Usage of audio-volume:
  digit             Set volume value, 1~100
  -p, --print       Print all audio devices
  -n, --next        Switch to the next audio device
  -i device_id      Switch to the given audio device

Batch ssh remote hosts in multi-tmux-panes

$ s

Usage:
    ssh-sessions /yourpath/tmux_window[.extension]

Content format of /yourpath/tmux_window[.extension]:
    node1.example.com
    node2.example.com
    node3.exmaple.com
    ...

Note:
    Make sure the hosts in /yourpath/tmux_window.extension
    can login without password by ssh public key authentication.

Examples:
    $ ssh-sessions ~/.xxxhosts.ssh

    or

    $ ssh-sessions ~/.xxxhosts

    or

    $ ssh-sessions ~/xxxhosts

OhMyZsh Plugins

vi-mode

~/.oh-my-zsh/plugins/web-search/README.md

Enter Normal Mode

First of all, use esc or Ctrl [ to enter Normal mode.

History
  • ctrl p : Previous command in history
  • ctrl n : Next command in history
  • / : Search backward in history
  • n : Repeat the last /
Vim edition
  • vv : Edit current command line in Vim
Movement
  • $ : To the end of the line
  • ^ : To the first non-blank character of the line
  • 0 : To the first character of the line
  • w : [count] words forward
  • W : [count] WORDS forward
  • e : Forward to the end of word [count] inclusive
  • E : Forward to the end of WORD [count] inclusive
  • b : [count] words backward
  • B : [count] WORDS backward
  • t{char} : Till before [count]'th occurrence of {char} to the right
  • T{char} : Till before [count]'th occurrence of {char} to the left
  • f{char} : To [count]'th occurrence of {char} to the right
  • F{char} : To [count]'th occurrence of {char} to the left
  • ; : Repeat latest f, t, F or T [count] times
  • , : Repeat latest f, t, F or T in opposite direction
Insertion
  • i : Insert text before the cursor
  • I : Insert text before the first character in the line
  • a : Append text after the cursor
  • A : Append text at the end of the line
  • o : Insert new command line below the current one
  • O : Insert new command line above the current one
Delete and Insert
  • ctrl-h : While in Insert mode: delete character before the cursor
  • ctrl-w : While in Insert mode: delete word before the cursor
  • d{motion} : Delete text that {motion} moves over
  • dd : Delete line
  • D : Delete characters under the cursor until the end of the line
  • c{motion} : Delete {motion} text and start insert
  • cc : Delete line and start insert
  • C : Delete to the end of the line and start insert
  • r{char} : Replace the character under the cursor with {char}
  • R : Enter replace mode: Each character replaces existing one
  • x : Delete count characters under and after the cursor
  • X : Delete count characters before the cursor

git

~/.oh-my-zsh/plugins/git/README.md

  • gst : git status
  • gsh : git show
  • ga : git add
  • gc : git commit -v
  • gp : git push
  • gpf : git push -f
  • glo : git log --oneline --decorate
  • glog : git log --oneline --decorate --graph
  • gl : git pull

gitignore

~/.oh-my-zsh/plugins/gitignore/README.md

  • gi list: List all the currently supported gitignore.io templates.
  • gi [TEMPLATENAME]: Show git-ignore output on the command line, e.g. gi java to exclude class and package files.
  • gi [TEMPLATENAME] >> .gitignore: Appending programming language settings to your projects .gitignore.

web-search

~/.oh-my-zsh/plugins/web-search/README.md

You can use the web-search plugin in these two forms:

  • web_search <context> <term> [more terms if you want]
  • <context> <term> [more terms if you want]

For example, these two are equivalent:

$ web_search google oh-my-zsh
$ google oh-my-zsh

Available search contexts are:

Context URL
bing https://www.bing.com/search?q=
google https://www.google.com/search?q=
yahoo https://search.yahoo.com/search?p=
ddg or duckduckgo https://www.duckduckgo.com/?q=
sp or startpage https://www.startpage.com/do/search?q=
yandex https://yandex.ru/yandsearch?text=
github https://github.com/search?q=
baidu https://www.baidu.com/s?wd=
ecosia https://www.ecosia.org/search?q=
goodreads https://www.goodreads.com/search?q=
qwant https://www.qwant.com/?q=
givero https://www.givero.com/search?q=
stackoverflow https://stackoverflow.com/search?q=
wolframalpha https://wolframalpha.com/input?i=
archive https://web.archive.org/web/*/
scholar https://scholar.google.com/scholar?q=

colorize

~/.oh-my-zsh/plugins/colorize/README.md

  • ccat <file> [files]: colorize the contents of the file (or files, if more than one are provided). If no files are passed it will colorize the standard input.

  • cless [less-options] <file> [files]: colorize the contents of the file (or files, if more than one are provided) and open less. If no files are passed it will colorize the standard input. The LESSOPEN and LESSCLOSE will be overwritten for this to work, but only in a local scope.

sudo

~/.oh-my-zsh/plugins/sudo/README.md

Easily prefix your current or previous commands with sudo by pressing esc twice.

copyfile

~/.oh-my-zsh/plugins/copyfile/README.md

  • copyfile <filename> : Puts the contents of a file in your system clipboard so you can paste it anywhere.

copydir

~/.oh-my-zsh/plugins/copydir/README.md

  • copydir : Copy the $PWD to the system clipboard.

aliases

~/.oh-my-zsh/plugins/aliases/README.md

With lots of 3rd-party amazing aliases installed, this plugin helps list the shortcuts that are currently available based on the plugins you have enabled.

  • acs : Group all alias
  • acs <keyword> : Quickly filter alias & highlight

🎹 Tmux

Prefix Key

Prefix Key: Ctrl a

All the following shortcuts keys must first press the prefix key.

Note that after pressing the prefix key, you need to release the prefix key first, and then press other specific shortcut keys.

Key Bindings

Common

  • ? : List key bindings
  • r : Reload ~/.tmux.conf
  • e : Edit ~/.tmux.conf
  • K : View help documents of the object in ~/.tmux.conf
  • d : Detach the current client

Session

  • s : Choose a session from a list
  • Option/Alt f : Search session
  • Ctrl c : Create new session
  • $ : Rename the current session
  • b : Toggle status line of the current session

Window

  • c : Create new window
  • , : Rename current window
  • . : Move current window
  • n : Select the next window
  • p : Select the previous window
  • 0-9: Select window 0-9
  • & : Kill current window
  • w : Choose a window from a list
  • f : Search window
  • i : Display window information

Pane

  • % : Split window horizontally
  • " : Split window vertically
  • <Space> : Select next layout
  • Ctrl E : Spread panes out evenly
  • x : Kill the active pane
  • z : Zoom the active pane
  • { / < : Swap the active pane with the pane above
  • } / > : Swap the active pane with the pane below
  • q : Display pane numbers(it will also display a letter if the number gather than 10), then press the specified number(or letter) to select it.
  • t : Show a clock in current pane
  • ! : Break pane to a new window
  • ; : Move to the previously active pane
  • k : Select the pane above the active pane
  • j : Select the pane below the active pane
  • h : Select the pane to the left of the active pane
  • l : Select the pane to the right of the active pane
  • o : Select the next pane
  • Ctrl o : Rotate through the panes
  • Option/Alt o : Rotate through the panes in reverse
  • m : Toggle the marked pane
  • K : Resize the pane up
  • J : Resize the pane down
  • H : Resize the pane left
  • L : Resize the pane right
  • Ctrl l : Clear all the messages(include history messages) in the active pane
  • Ctrl b : Toggle pane name of the current window's all panes
  • Ctrl t : Create a new pane that is 16% of the size of the current pane and below the current pane

Copy Mode

  • [ : Enter copy mode
  • ] : Paste the most recent paste buffer

NOTE: The followings is the operations after entered copy mode, no need to press the Prefix Key first.

  • q : Exit from copy mode
  • hjhl : Movements
  • v : Text select
  • V : Text line select
  • Ctrl v : Text block select
  • enter: Copy the selected text
  • esc : Escape from text selected
  • / : Search down
  • ? : Search up

Enabled vi-mode, many vi shortcuts can be used in this scenario.

Sync Mode

  • Ctrl y : Toggle sync mode

Tmux Plugins

tmux-plugins/tpm

Tmux Plugin Manager.

  • I : Install new plugins
  • U : Update all plugins
  • u : Uninstall plugins that not in ~/.tmux.conf

tmux-plugins/tmux-prefix-highlight

Plugin that highlights when you press tmux prefix key.

tmux-plugins/tmux-resurrect

This plugin saves all the little details from your tmux environment so it can be completely restored after a system restart (or when you feel like it).

  • Ctrl s : Save sessions
  • Ctrl r : Restore sessions from local backup

tmux-plugins/tmux-continuum

Continuous saving of tmux environment. Automatic restore when tmux is started.

tmux-plugins/tmux-copycat

Search
  • / : Regex search (strings work too)

    Example search entries:

    • foo : Searches for string foo
    • [0-9]+ : Regex search for numbers
Predefined searches
  • Ctrl f : Simple file search
  • Ctrl g : Jumping over git status files (best used after git status command: git status -sb)
  • Ctrl h : Jumping over SHA-1/SHA-256 hashes (best used after git log command)
  • Ctrl u : URL search (http, ftp and git urls)
  • Ctrl d : Number search (mnemonic d, as digit)
  • Ctrl i : IP address search
  • S : Jumping over string surrounded by ""

These start "copycat mode" and jump to first match.

Copycat mode bindings

These are enabled when you search with copycat:

  • n : Jumps to the next match
  • N : Jumps to the previous match
  • enter : Copy a highlighted match

tmux-plugins/tmux-yank

  • Tmux Normal Mode
    • y : Copies text from the command line to the clipboard.
    • Y : Copy the current pane's current working directory to the clipboard.
  • Tmux Copy Mode
    • y : Copy selection to system clipboard.
    • Y : Equivalent to copying a selection, and pasting it to the command line.

tmux-plugins/tmux-open

Plugin for opening highlighted selection directly from Tmux copy mode.

In Tmux Copy Mode:

  • o : Open a highlighted selection with the system default program. open for OS X or xdg-open for Linux.
  • Ctrl o : Open a highlighted selection with the $EDITOR
  • S : Search the highlighted selection directly by Google
  • B : Search the highlighted selection directly by Bing

ki-chi/tmux-inputmethod

Display current input method in the Tmux status line.

vimhack/tmux-show-colorscheme

Display current colorscheme/opacity/font/font-size of Vim and Alacritty in the Tmux status line.

vimhack/tmux-audio-volume

Display system volume in the Tmux status line.

vimhack/tmux-battery

Display battery status in the Tmux status line.

vimhack/tmux-cpu

Display cpu utilization and fan speed in the Tmux status line.

vimhack/tmux-onlinestatus

Display online status in the Tmux status line.

vimhack/tmux-weather

Display local weather information in the Tmux status line.

vimhack/tmux-moon-phase

Display moon phase emoji or icon or text in the Tmux status line.

FQA

  • In some cases, modifying ~/.tmux.conf cannot take effect after reload or restart Tmux, how to fix it?
$ tmux kill-server
  • Even if execute tmux kill-server, the new configuration still does not take effect.
$ ps axu|grep -v grep|grep tmux|awk '{print $2}'|xargs kill -9

💯 Vim/Neovim

Leader Key

The vim leader key has been changed from \(default) to ,.

, in the following shortcut keys represent the leader key.

Custom Key Bindings

Tabs Management

  • Normal Mode

    • Ctrl t : Create new tab
    • , 1/2/3... : Go to the specific tab
    • , 0 : Go to the last tab
    • Option/Alt 1/2/3... : Go to the specific tab
    • Option/Alt 0 : Go to the last tab
    • , fn : Go to the next tab
    • , fp : Go to the previous tab
    • , fh : Move the tab to the left
    • , fl : Move the tab to the right
    • , qo : Close all tabs except current one
    • , qq : Close current tab
    • , q 1/2/3 ... : Close the specific tab
    • , q 0 : Close the last tab
  • Insert Mode

    • Option/Alt 1/2/3... : Go to the specific tab
    • Option/Alt 0 : Go to the last tab

Cursor Movement

  • Normal Mode

    • Ctrl k/j/h/l : Move the cursor to up/down/left/right window
    • Ctrl e/y : Move the screen down or up by 3 lines step
    • 0 : Move the cursor to the first non-blank character, if already at the first character, then to the first character.
  • Insert Mode

    • Ctrl p/n/b/f : Move the cursor to up/down/left/right
    • Ctrl e : Move the cursor to the end of the line
    • Ctrl a: Press twice for moving the cursor to the first non-blank character, and press twice once again for moving the cursor to the first character.

      NOTE: Press twice coz Ctrl a is also the tmux prefix key.

    • Option/Alt b/f : Move the cursor to left/right by one word step
  • Visual Mode

    • 0 : Move the cursor to the first non-blank character, if it already at the first character, then to the first character.
  • Command-Line Mode

    • Ctrl b/f : Move the cursor to left/right
    • Ctrl p/n : Go through history commands from up/down
    • Ctrl a/e : Move the cursor to the first character or the end of the line
    • Option/Alt b/f : Move the cursor to left/right by one word step

Text Edit

  • Insert Mode

    • Ctrl h/l : Delete a character from left/right
    • Ctrl d : Delete from the cursor position to the end of the line.
    • Ctrl u : Delete from the cursor position to the head of the line.
    • Ctrl w : Delete a word from left
  • Visual Mode

    • , )/]/}/"/' : Surround the selected text by ) or ] or } or " or '
    • >/<: Use > or < to indent without exiting visual mode
  • Command-Line Mode

    • Ctrl h/l : Delete a character from left/right
    • Ctrl d : Delete from the cursor position to the end of the line.
    • Ctrl u : Delete from the cursor position to the head of the line.
    • Ctrl w : Delete a word from left

Others

  • Normal Mode

    • E : Edit ~/.vimrc or ~/.config/nvim/init.vim in the new split window
    • R : Reload ~/.vimrc or ~/.config/nvim/init.vim
    • Y : Copy from the cursor position to the end of the line
    • Ctrl s: Toggle spell check
    • , z : Zoom window
    • , n : Toggle line number
    • , va : Select all lines
    • , vf : Select from the current line to the end of line
    • , vb : Select from the current line to the first of line
    • , ya : Yank all lines
    • , yf : Yank from the current line to the end of line
    • , yb : Yank from the current line to the first of line
  • Insert Mode

    • Ctrl s: Toggle spell check
  • Command-Line Mode

    • :W : Use sudo to save

Custom Snippets

Markdown

Shortcut Output
,b Bold
,s sliced
,i italic
,d inline code
,c block code
,m - [ ]
,p ![img]()
,a [link]()
,l ---
,1 # H1
,2 ## H2
,3 ### H3
,4 #### H4
,5 #### H5
,6 #### H6

,f : Almost every shortcut above generates a placeholder (<++>), pressing ,f will jump the cursor to the placeholder and delete it at the same time.

,w : The same as ,f, but it will generate a blank line for you.

NOTE:
All above shortcuts are in the Vim Insert Mode.

Put Your Own Customization

Add More Plugins

If you want to use other plugins that not in $HOME/.vimrc or $HOME/.config/nvim/init.vim, you can put them in $HOME/.vimrc.plugins.local.

For example:

" For distraction-free writing in Vim.
Plug 'junegunn/goyo.vim'

NOTE:
Do not put other configurations in $HOME/.vimrc.plugins.local, you should put them in $HOME/.vimrc.local.

Add More Configurations

You can put your own configurations in $HOME/.vimrc.local, it will be soured at the end of $HOME/.vimrc or $HOME/.config/nvim/init.vim.

For example:

" *** For plugin 'junegunn/goyo.vim'
" doc: https://github.com/junegunn/goyo.vim
" Usage:
"   :Goyo              Toggle Goyo
"   :Goyo [dimension]  Turn on or resize Goyo
"   :Goyo!             Turn Goyo off

let g:goyo_width = 120 " default: 80
let g:goyo_height = '85%' " default: 85%
let g:goyo_linenr = 1 " default: 0

function! s:goyo_enter()
  if executable('tmux') && strlen($TMUX)
    silent !tmux set status off
    silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z
  endif
  set noshowmode
  set noshowcmd
  set scrolloff=999
endfunction

function! s:goyo_leave()
  if executable('tmux') && strlen($TMUX)
    silent !tmux set status on
    silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z
  endif
  set showmode
  set showcmd
  set scrolloff=5
endfunction

autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()
" **********************************

Disable Default Plugins

If you want to disable some plugins in $HOME/.vimrc or $HOME/.config/nvim/init.vim, you can UnPlug them in $HOME/.vimrc.plugins.local.

For example:

" Disable input method auto switch feature.
UnPlug 'lyokha/vim-xkbswitch'
" Disable vim hardtime feature.
UnPlug 'takac/vim-hardtime'

Vim/Neovim Plugins

Code AutoCompletion

neoclide/coc.nvim
1. Symbol description of the completion menu
   [LS]  Language Server
    [S]  Snippets
   [US]  UltiSnips
   [TN]  TabNine
  [GOC]  Gocode
  [NEC]  Neco-vim
    [A]  Around
    [B]  Buffer
    [F]  File
      M  Module
      I  Interface
      S  Struct
      f  func
2. Key bindings
  • :C : Open ~/.vim/coc-settings.json
  • [/] g : Navigate chunks of current buffer
  • [/] c : Navigate conflicts of current buffer
  • , gd : Show chunk diff at current position
  • , gc : Show commit contains current position
  • <tab> : Use tab for trigger completion with characters ahead and navigate
  • g d/l : Go to definition position by create new tab way
  • g y : Go to type definition
  • g i : Go to implementation position
  • g r : Show related items in location list, and select one to go to
  • K : Use K to show documentation in preview window
  • , rn : Symbol renaming
  • Ctrl f/b: Scroll float windows/popups
  • <Space> e : Show all coc extensions
  • <Space> c : Show all coc commands
  • <Space> s : Show all completion sources of the current file type
  • <Space> p : Resume latest coc list
SirVer/ultisnips

UltiSnips is the ultimate solution for snippets in Vim.

honza/vim-snippets
  • snippets/* : snippets using snipMate format
  • UltiSnips/* : snippets using UltiSnips format
Shougo/neco-vim

The Vim Script completion source.

neoclide/coc-neco

Vim completon source for coc.nvim using neco-vim.

Raimondi/delimitMate

Provides insert mode auto-completion for quotes, parens, brackets, etc.

⚖️ License

This project is under the MIT License. See the LICENSE file for the full license text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].