Neovim configuration for Colemak users
NOTE: The contents of this repository are being moved to gczcn/dotfile/tree/main/nvim
- Dependencies
- Installation
- Basic Settings
- Keyboard Shortcuts
- Neovim >= 0.10 (nightly)
- curl
- git
- node.js
- npm
- ripgrep
- xclip (or other clipboard tools)
- make
- Lazygit
- z
- dotnet
- Optional:
- Install all the above dependencies
- Run
git clone https://github.com/gczcn/nvim.git ~/.config/nvim
to clone the repository - Run
npm install -g neovim
in terminal - Run
nvim
Opt | Value | Action |
---|---|---|
fileencoding |
'UTF-8' |
file content encoding for the buffer |
autowrite |
true |
Enable auto write |
number |
true |
Show numberline |
relativenumber |
true |
Show relative numberline |
completeopt |
{ "menu", "menuone", "noselect" } |
Options for insert mode completion |
signcolumn |
'yes' |
always show the sign column |
cursorline |
true |
highlight the text line of the cursor |
cursorcolumn |
true |
highlight the text column of the cursor |
scrolloff |
5 |
Lines of context |
sidescrolloff |
8 |
Colunms of context |
wrap |
false |
Disable Line wrap |
tabstop |
2 |
Number of space tabs count for |
softtabstop |
2 |
keep the default tab stop size |
shiftwidth |
2 |
number of space inserted for indentation |
shiftround |
true |
Round indent |
expandtab |
true |
Use spaces instead of tabs |
autoindent |
true |
Enable autoindent |
breakindent |
true |
wrap indent to match line start |
smartindent |
true |
Insert indents automatically |
ignorecase |
true |
Ignore case |
smartcase |
true |
case sensitive searching |
incsearch |
true |
enable incremental search |
whichwrap |
"b,s,<,>,[,],h,l" |
Move the beginning and end of a line across lines |
autoread |
true |
Automatically read modified files |
mouse |
"a" |
enable mouse support |
updatetime |
100 |
Save swap file and trigger CursorHold |
splitbelow |
true |
Put new windows below current |
splitright |
true |
Put new windows right of current |
termguicolors |
true |
True color support |
list |
true |
Show some hidden characters |
showmode |
false |
disable showing modes in command line |
foldenable |
true |
enable fold |
foldlevel |
99 |
set high foldlevel |
foldlevelstart |
99 |
start with all code unfolded |
foldcolumn |
"1" |
show foldcolumn |
conceallevel |
2 |
Hide * markup for bold and italic, but not markers with substitutions |
confirm |
true |
Confirm to save changes before exiting modified buffer |
colorcolumn |
"100" |
Line number reminder |
copyindent |
true |
copy the previous indentation on autoindenting |
expandtab |
true |
enable the use of space in tab |
history |
300 |
Save historical quantity |
linebreak |
true |
wrap lines at 'breakat' |
undofile |
true |
Save undo history |
winminwidth |
5 |
Minimum window width |
fillchars |
{foldopen='-',foldclose='>',} |
set fillchars |
Note: Some settings here refer to this repository: repository
leader key settings:
vim.g.mapleader = ' '
k
: switchs to INSERT
: mode (same as key i
in vanilla vim)
Q
: quits current vim window (same as command :q
in vanilla vim)
S
: saves the current file (same as command :w
in vanilla vim )
Shortcut | Action | Equivalent |
---|---|---|
u |
Cursor up a terminal line | k |
e |
Cursor down a terminal line | j |
n |
Cursor left | h |
i |
Cursor right | l |
U |
Cursor up 5 terminal line | 5k |
E |
Cursor down 5 terminal line | 5j |
N |
Cursor to the start of the line | 0 |
I |
Cursor to the end of t line | **$ |
h |
Move to the end of this word | e |
W |
Move cursor five words forward | 5w |
B |
Move cursor five words back | 5b |
Shortcut | Action | Equivalent |
---|---|---|
<M-u> |
Cursor up a terminal line | <up> |
<M-e> |
Cursor down a terminal line | <down> |
<M-n> |
Cursor left | <left> |
<M-i> |
Cursor right | <right> |
<M-U> |
Cursor up 5 terminal line | **:normal! 5k<> |
<M-E> |
Cursor down 5 terminal line | **:normal! 5j<> |
<M-N> |
Cursor to the start of the line | **:normal 0<> |
<M-I> |
Cursor to the end of the line | **:normal $<CR>ight> |
Shortcut | Action |
---|---|
<M-n> |
Cursor left |
<M-i> |
Cursor right |
<M-n> |
Cursor 5 spaces to the left |
<M-i> |
Cursor 5 spaces to the right |
Shortcut | Action | Equivalent |
---|---|---|
l |
undo | u |
L |
redo | u |
Shortcut | Action | Equivalent |
---|---|---|
; |
Enter Cmand mode | : |
<leader>r |
Run code | :RunCode |
Shortcut | Action | Equivalent |
---|---|---|
<M-y> |
Copy to system clipboard | "+y |
<M-p> |
Paste to system clipboard | "+gp |
<M-v> |
Paste to system clipboard (mode = i) | :normal"+gp<CR><right> |
Shortcut | Action |
---|---|
<leader>su |
Create a new horizontal split screen and place it above the current window |
<leader>se |
Create a new horizontal split screen and place it below the current window |
<leader>sn |
Create a new vertical split screen and place it left to the current window |
<leader>si |
Create a new vertical split screen and place it right to the current window |
<leader>sv |
Set the two splits to be vertical |
<leader>sh |
Set the two splits to be horizontal |
<leader>srv |
Rotate splits and arrange splits vertically |
<leader>srh |
Rotate splits and arrange splits horizontally |
Shortcut | Action |
---|---|
<leader>ww |
Move cursor to the next window |
<leader>wn |
Move cursor one window left |
<leader>wi |
Move cursor one window right |
<leader>wu |
Move cursor one window up |
<leader>we |
Move cursor one window down |