{"id":27064744,"url":"https://github.com/xxxbrian/ivimer","last_synced_at":"2025-07-14T23:08:59.899Z","repository":{"id":41850168,"uuid":"485810500","full_name":"xxxbrian/ivimer","owner":"xxxbrian","description":"All things about my vim","archived":false,"fork":false,"pushed_at":"2022-04-26T15:50:44.000Z","size":3970,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-31T05:19:13.469Z","etag":null,"topics":["vim","vim-cheatsheet","vimrc"],"latest_commit_sha":null,"homepage":"https://ivimer.bojin.co","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xxxbrian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-26T14:00:03.000Z","updated_at":"2024-03-11T13:26:41.000Z","dependencies_parsed_at":"2022-08-11T19:20:50.682Z","dependency_job_id":null,"html_url":"https://github.com/xxxbrian/ivimer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xxxbrian/ivimer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxxbrian%2Fivimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxxbrian%2Fivimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxxbrian%2Fivimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxxbrian%2Fivimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xxxbrian","download_url":"https://codeload.github.com/xxxbrian/ivimer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxxbrian%2Fivimer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265365699,"owners_count":23753379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vim","vim-cheatsheet","vimrc"],"created_at":"2025-04-05T17:18:45.989Z","updated_at":"2025-07-14T23:08:59.870Z","avatar_url":"https://github.com/xxxbrian.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vim cheat sheet\n\n- [Vim official website](https://www.vim.org/)\n- [Vim GitHub](https://github.com/vim/vim)\n- [English](./README.md) | [简体中文](./README_CN.md) | [繁體中文](./README_TC.md)\n\n## The power of repetition\n\n```\n.                   # Repeat (Dot) command, repeats the previous command\nN{command}          # Repeat a command N times, e.g. 10k, cursor moves up 10 lines\n```\n\n**In addition, the power of repetition should also be leveraged with macros and regular expressions to reduce repetitive operations.**\n\n## Cursor movement\n\n**Note: In normal mode, any of the actions can be repeated.**\n\nunit level.\n\n```\nh                   # Move the cursor to the left, equivalent to the \u003cLeft\u003e arrow key. (Note: the h key is on the left, press it to move the cursor left)\nj                   # Move the cursor down, equivalent to the \u003cDown\u003e arrow key. (Note: the j key has a downward protrusion, press this key to move the cursor down)\nk                   # Move the cursor up, equivalent to the \u003cUp\u003e arrow key. (Note: the k key is the opposite of the j key, press this key to move the cursor up)\nl                   # Move the cursor to the right, equivalent to the \u003cRight\u003e arrow key. (Note: the l key is on the right, press it to move the cursor to the right)\n```\n\nword level.\n\n```\nw                   # Move to the beginning of the next word separated by punctuation or space (w: word)\nW                   # Move to the beginning of the next space-separated word (W: Word)\ne                   # Move to the end of the next word separated by punctuation or space (e: end)\nE                   # Move to the end of the next space separated word (E: End)\nb                   # Move to the beginning of the previous word separated by punctuation or space (b: backward)\nB                   # Move to the beginning of the previous space-separated word (B: Backward)\n```\n\nblock level.\n\n```\n0                   # Jump to the beginning of the line, the number 0, the effect is equivalent to the \u003cHome\u003e key\n^                   # Jump to the non-blank character at the beginning of the line, you can use 0w instead of ^, which is more convenient to press\n$                   # Jump to the end of the line, the effect is equivalent to the \u003cEnd\u003e key\ngg                  # Jump to the first line, the effect is equivalent to Ctrl+\u003cHome\u003e\nG                   # Jump to the last line, the effect is equivalent to Ctrl+\u003cEnd\u003e\nNG                  # Jump to the Nth row, for example 10G is to move to the tenth row\n:N                  # Jump to the Nth line, for example: 10\u003cEnter\u003e is to move to the tenth line\nN%                  # Move to the N% position of the file, for example 10% is moved to the 10% position of the file\nN|                  # Move to N columns of the current row\n\u003cEnter\u003e             # Move to the first non-blank character in the next line\nN\u003cEnter\u003e            # Move the cursor down N lines\nge                  # Move backward to the end of the word\ngE                  # Move backward to the end of a word separated by a whitespace\n)                   # Move forward one sentence (separated by periods)\n(                   # Move backward one sentence (period separated）\n}                   # Move forward one paragraph (separated by blank lines)\n{                   # Move backward one paragraph (separated by blank lines)\n+                   # Move to the first non-blank character in the next line (same as the Enter key)\n-                   # Move to the first non-blank character in the previous line\nH                   # Move to the upper part of the screen (H: High)\nM                   # Move to the middle of the screen (M: Middle)\nL                   # Move to the bottom of the screen (L: Low)\ngm                  # Move to the middle of the line\ngj                  # Move the cursor down one screen line (ignore automatic line wrapping)\ngk                  # Move the cursor up one screen line (ignore auto-wrap)\nzz                  # Adjust the cursor line to the center of the screen\nzt                  # Adjust the cursor line to the upper part of the screen\nzb                  # Adjust the cursor line to the bottom of the screen\nCtrl+e              # Scroll up one line\nCtrl+y              # Scroll down one line\nCtrl+u              # Move up 1/2 a screen\nCtrl+d              # Move down 1/2 a screen\nCtrl+f              # Move forward one full screen\nCtrl+b              # Move back one full screen\n\u003cS+Up\u003e              # Hold down the \u003cShift\u003e key and then press the \u003cUp\u003e arrow key to page up\n\u003cS+Down\u003e            # Hold down the \u003cShift\u003e key and then press the \u003cDown\u003e arrow key to page down\n\u003cS+Left\u003e            # Hold down the \u003cShift\u003e key and press the \u003cLeft\u003e arrow key to move one word to the left\n\u003cS+Right\u003e           # Hold down the \u003cShift\u003e key and press the \u003cRight\u003e arrow key to move one word to the right\n```\n\n## Insert mode\n\n```\ni                   # Enter insert mode at the cursor\nI                   # Enter insert mode at the beginning of the line\na                   # Enter insert mode after the cursor\nA                   # Enter insert mode at the end of the line\no                   # Insert a new row in the next row and enter insert mode\nO                   # Insert a new row in the previous row and enter insert mode\ns                   # Delete the character under the cursor and insert text\nS                   # Delete the current line and insert text\ngi                  # Go to the position of the last insert mode\ngI                  # Insert text at the start of line (column 1)\n\u003cEsc\u003e               # Exit insert mode\nCtrl+[              # Exit insert mode (equivalent to \u003cEsc\u003e key)\nCtrl+C              # Like Ctrl-[ and \u003cEsc\u003e, but does not check for abbreviation\n```\n\n## Insert mode commands\n\n**Note: Enter insert mode by i, I, a, A, o, O, s, S command.**\n\n```\n\u003cUp\u003e                # Cursor up\n\u003cDown\u003e              # Cursor down\n\u003cLeft\u003e              # Move the cursor to the left\n\u003cRight\u003e             # Move the cursor to the right\n\u003cS+Up\u003e              # Hold down the \u003cShift\u003e key and then press the \u003cUp\u003e arrow key to page up\n\u003cS+Down\u003e            # Hold down the \u003cShift\u003e key and then press the \u003cDown\u003e arrow key to page down\n\u003cS+Left\u003e            # Hold down the \u003cShift\u003e key and press the \u003cLeft\u003e arrow key to move one word to the left\n\u003cS+Right\u003e           # Hold down the \u003cShift\u003e key and press the \u003cRight\u003e arrow key to move one word to the right\n\u003cPageUp\u003e            # Page up\n\u003cPageDown\u003e          # Page down\n\u003cDelete\u003e            # Delete the character at the cursor\n\u003cBackspace\u003e         # Backspace key is to delete characters backward\n\u003cHome\u003e              # Cursor jump to the beginning of the line\n\u003cEnd\u003e               # Cursor jump to end of line\nCtrl+d              # Decrease indent\nCtrl+f              # Decrease indent\nCtrl+t              # Increase indent\nCtrl+h              # Delete the previous character, equivalent to Backspace\nCtrl+o              # Temporarily exit insert mode, execute a single command and return to insert mode\nCtrl+u              # Delete all characters from the current line to the beginning of the line\nCtrl+w              # Delete a word before the cursor\nCtrl+\\ Ctrl+O       # Temporarily exit insert mode (cursor hold), execute a single command and return to insert mode\nCtrl+R 0            # Insert the contents of the register (internal clipboard No. 0), the register name can be followed by Ctrl+R\nCtrl+R \"            # Insert anonymous register content, which is equivalent to p paste in insert mode\nCtrl+R =            # Insert expression calculation result, equal sign followed by expression\nCtrl+R :            # Insert the last command line command\nCtrl+R /            # Insert the last search keyword\nCtrl+v {char}       # Insert non-numeric literals\nCtrl+v {code}       # Insert the ASCII/Unicode character encoding represented by three digits, such as Ctrl+v 065\nCtrl+v 065          # Insert a decimal ASCII character (two digits) 065 is the A character\nCtrl+v x41          # Insert hexadecimal ASCII characters (three numbers) x41 is the A character\nCtrl+v o101         # Insert octal ASCII characters (three numbers) o101 is the A character\nCtrl+v u1234        # Insert hexadecimal Unicode characters (four digits)\nCtrl+v U12345678    # Insert hexadecimal Unicode characters (eight digits)\nCtrl+K {ch1} {ch2}  # Insert digraph (see :h digraph), quickly enter Japanese or symbols, etc.\n```\n\n## Autocomplete\n\nIn insert mode, the most commonly used completion.\n\n```\nCtrl+n              # Automatic text completion in insert mode\nCtrl+P              # Automatic text completion in insert mode\nCtrl+e              # When there is a completion list, terminate this completion and continue typing\n```\n\n**Smart completion commands all start with the key combination Ctrl+X.**\n\n```\nCtrl+X              # Enter completion mode\nCtrl+X Ctrl+L       # Whole line completion\nCtrl+X Ctrl+N       # In insert mode, complete according to keywords in the current file\nCtrl+X Ctrl+K       # Completion according to dictionary\nCtrl+X Ctrl+T       # Completion according to the synonym dictionary\nCtrl+X Ctrl+F       # Complete file name in insert mode\nCtrl+X Ctrl+I       # Completion based on keywords in the header file\nCtrl+X Ctrl+]       # Complete according to tags\nCtrl+X Ctrl+D       # Complete macro definition\nCtrl+X Ctrl+V       # Completing Vim commands\nCtrl+X Ctrl+U       # User-defined completion method\nCtrl+X Ctrl+S       # Spelling suggestions, for example: an English word\nCtrl+X Ctrl+O       # Insert Omnifunc completion\n```\n\n## Text Editor\n\n```\nr                   # Replace the current character\nR                   # Enter replacement mode until you press \u003cEsc\u003e to leave\nJ                   # Delete a newline character and merge multiple lines into one line\ns                   # Replace character (delete the character at the cursor and enter the insert mode, the number can be connected in front)\nS                   # Replace line (delete the current line and enter the insert mode, the number can be accessed before)\ncc                  # Rewrite the current line (delete the current line and enter insert mode), same as S\ncw                  # Overwrite the current word at the beginning of the cursor\nciw                 # Rewrite the word under the cursor\ncaw                 # Rewrite the word under the cursor, and include leading and trailing spaces\nc0                  # Rewrite to the beginning of the line\nc^                  # Rewrite to the beginning of the line (the first non-zero character)\nc$                  # Rewrite to the end of the lin\nC                   # Rewrite to the end of the line (same as c$)\nci\"                 # Rewrite the content in double quotes\nci'                 # Rewrite the content in single quotes\ncib                 # Rewrite the content in parentheses\ncab                 # Rewrite the content in the parentheses (including the parentheses themselves)\nci)                 # Rewrite the content in parentheses\nci]                 # Rewrite the content in the brackets\nciB                 # Rewrite the content in the braces\ncaB                 # Rewrite the content in the braces (including the braces themselves)\nci}                 # Rewrite the content in the braces\ncit                 # Rewrite the content in the XML tag\ncis                 # Rewrite the current sentence\nc2w                 # Write two words instead\nct(                 # Rewrite before the parentheses\nx                   # Delete the current character, you can receive a number in front, 3x means delete three characters\nX                   # Delete characters forward\ndd                  # Delete (cut) a line\nd0                  # Delete (cut) to the beginning of the line\nd^                  # Delete (cut) to the beginning of the line (the first non-zero character)\nd$                  # Delete (cut) to the end of the line\nD                   # Delete (cut) to the end of the line (same as d$)\ndw                  # Delete (cut) the current word\ndiw                 # Delete (cut) the word under the cursor\ndaw                 # Delete (cut) the word under the cursor, and include leading and trailing spaces (if any)\ndi\"                 # Delete the content in double quotes\ndi'                 # Delete the content in single quotes\ndib                 # Delete the content in parentheses\ndi)                 # Delete the content in parentheses\ndab                 # Delete the content in the parentheses (including the parentheses themselves)\ndi]                 # Delete the content in the square brackets\ndiB                 # Delete the content in the braces\ndi}                 # Delete the content in the braces\ndaB                 # Delete the content inside the braces (including the braces themselves)\ndit                 # Delete the content in the tag in XML\ndis                 # Delete the current sentence\nd2w                 # Delete the next two words\ndt(                 # Delete to the front of the parenthesis\ndgg                 # Delete to the head of the file\ndG                  # Delete to the end of the file\nd}                  # Delete the next paragraph\nd{                  # Delete the previous paragraph\nNd                  # Delete N lines from the beginning of the current line\n:Nd                 # Delete line N\n:1,10d              # Delete 1~10 lines\n~                   # Replace case\ng~iw                # Replace the case of the current word\ngUiw                # Convert words to uppercase\nguiw                # Convert the current word to lowercase\nguu                 # Convert the entire line to lowercase\ngUU                 # Convert the entire line to uppercase\n\u003c\u003c                  # Reduce indent\n\u003e\u003e                  # Increase indent\n==                  # Auto indent\nCtrl+A              # Increase the number\nCtrl+X              # Reduce the number\n```\n\n## Text object\n\nNote: Only applicable to visual mode or after operator, for example: operation includes **select v, delete d, copy y, modify c**, etc.\n\n```\naw                  # Operate the entire word, excluding the delimiter (aw: a word)\naW                  # Manipulate entire words, including separators (aW: a Word)\niw                  # Operate the entire word, excluding the separator (iw: inner word)\niW                  # Operate the entire word, including the separator (iW: inner Word)\nis                  # Operate the entire sentence, excluding the separator (s: sentence)\nib                  # Operation contains block, from [( to ]) (b: block)\niB                  # Operation contains large blocks, from [{ to ]} (B: Block)\nab                  # Operate a block, from [( to ])(b: block)\naB                  # Operate a large block, from [{ to ]} (B: Block)\nap                  # Operate a paragraph (p: paragraph)\nip                  # Operation contains paragraph\ni)                  # Manipulate parentheses string\na)                  # Manipulate the string in the parentheses, including the parentheses themselves\ni]                  # Operation bracket string\na]                  # Operate the bracket string, including the bracket itself\ni}                  # Manipulate brace strings\na}                  # Manipulate brace strings, including the braces themselves\ni'                  # Operation single quoted string\na'                  # Manipulate a single quoted string, including the single quote itself\ni\"                  # Manipulate double quoted strings\na\"                  # Manipulate double quoted strings, including the double quotes themselves\na`                  # Manipulate a backtick string\ni`                  # Operation contains backquote string\na\u003e                  # Manipulate a \u003c\u003e block\ni\u003e                  # Operation contains \u003c\u003e block\nat                  # Manipulate a tag block, for example from \u003caaa\u003e to \u003c/aaa\u003e (t: tag)\nit                  # The operation contains a tag block, such as from \u003caaa\u003e to \u003c/aaa\u003e\n2i)                 # Operate outside the two parentheses\n2a)                 # Operate the outer two levels of parentheses, including the parentheses themselves\nNf)                 # Move to the Nth parenthesis\nNt)                 # Move to the Nth parenthesis\n```\n\n**The text object can be simply summarized as:**\n\n```\nci'、ci\"、ci(、ci[、ci{、ci\u003c                 # Change the text content in these paired punctuation marks separately\ndi'、di\"、di(、dib、di[、di{、diB、di\u003c        # Delete the text content in these paired punctuation marks respectively\nyi'、yi\"、yi(、yi[、yi{、yi\u003c                 # Copy the text content of these paired punctuation marks separately\nvi'、vi\"、vi(、vi[、vi{、vi\u003c                 # Select the text content in these paired punctuation marks respectively\n```\n\ncit、dit、yit、vit，Operate the content between a pair of tags separately, and edit HTML and XML are easy to use! In addition, if you change the above i to a, you can operate the matching punctuation and the content in the matching punctuation at the same time.\n\n## Move text\n\n```\n:[range]m[ove]{address}\n```\n\n**Parameter Description**\n\n- [range]: Indicates the range of rows to be moved\n- {address}: Indicates the target position of the movement, both of these parameters can be defaulted\n\nFor example\n\n```\n:m+1                # Move down 1 line\n:m-2                # Move up 1 line\n:8,10m2             # Move the contents of lines 8~10 of the currently opened file to the bottom of line 2\n```\n\n## Copy and paste\n\n**Format of the copy command**：\n\n```\n:[range]co[py]{address}\n```\n\nParameter Description：\n\n- [range]：Indicates the range of lines to be copied, where copy can be abbreviated as :co or :t\n- {address}：Indicates the destination of the copy. Both of these parameters can be defaulted to indicate the current line where the Vim cursor is located.\n\n\u003e For example: [:5copy.] means to copy line 5 of the file currently opened by Vim to the current line (indicated by .), that is, to create a copy of line 5 and place it below the current line.\n\nThe subscript lists some examples and uses of file copy using the abbreviation t of the copy command, which is used to understand the purpose of the copy command copy.\n\n```\n:3,5t.              # Copy the content from lines 3 to 5 below the current line\n:t5                 # Copy the current line below line 5\n:t.                 # Copy the current line below the current line (equivalent to yyp in normal mode)\n:t$                 # Copy the current line to the end of the text\n:'\u003c,'\u003et0            # Copy the highlighted line to the beginning of the file\n```\n\n**Copy and paste commands**\n\n```\np                   # After pasting to the cursor\nP                   # Paste before the cursor\nv                   # Enter visual mode\nV                   # Visual mode is marked by line\nCtrl+V              # Visual mode is marked by column\ny                   # Copy marked content\ny$                  # Copy the current position to the end of the line\nyy                  # Yank (copy) a line\nY                   # Copy the current line, same as yy\nyiw                 # Copy the current word\nNyy                 # Copy the contents of N lines under the cursor\nddp                 # Cut the current line and paste (first delete the current line, copy it to the register, and paste)\nv0                  # Select the current position to the beginning of the line\nv$                  # Select the current position to the end of the line\nviw                 # Select the current word\nvib                 # Select things in parentheses\nvi)                 # Select the content in parentheses\nvi]                 # Select the content in the square brackets\nviB                 # Select the content in the braces\nvi}                 # Select the content in the braces\nvis                 # Select the content in the sentence\nvab                 # Select the content in the parentheses (including the parentheses themselves)\nva)                 # Select the content in the parentheses (including the parentheses themselves)\nva]                 # Select the content in the brackets (including the brackets themselves)\nvaB                 # Select the content inside the braces (including the braces themselves)\nva}                 # Select the content inside the braces (including the braces themselves)\n:set paste          # Allow paste mode (to avoid automatic indentation affecting formatting when pasting)\n:set nopaste        # Prohibit paste mode\n\"?yy                # Copy the current line to the register?, The question mark represents the register name from 0-9\n\"?d3j               # Delete the contents of the three lines under the cursor and put them in the register?, The question mark represents the register name of 0-9\n\"?p                 # Paste the contents of the register? After the cursor\n\"?P                 # Paste the contents of the register? In front of the cursor\n:registers          # Display the contents of all registers\n:[range]y           # Copy range, for example: 20,30y is to copy 20 to 30 lines, and :10y is to copy the tenth line\n:[range]d           # Delete range, for example: 20,30d is to delete 20 to 30 lines, and :10d is to delete the tenth line\n\"_[command]         # Use [command] to delete content without copying (not polluting registers)\n\"*[command]         # Use [command] to copy the content to the system clipboard (requires the Vim version to have clipboard support)\n```\n\n## Revocation and restoration\n\n```\n[N]u                # The undo command can be combined. For example, Nu, N is any integer, which means to undo N operations, the same below. (u: undo)\n[N]U                # Undo the entire operation\nCtrl+r              # Cancel the last u command (r: redo)\nCtrl+R              # Rewind the previous command\n```\n\n## Find and replace\n\n**Find command in normal mode**\n\n```\n/pattern            # Search pattern from the cursor to the end of the file\n?pattern            # Search pattern from the cursor to the head of the file\nn                   # Search down for matching content\nN                   # Search forward\n%                   # Matching bracket movement, including (), {}, []. Combining the following two commands is quite powerful for programmers (premise: you need to move the cursor to the parentheses first)\n*                   # Search down the word under the cursor\n#                   # Search forward for the word under the cursor\nf{char}             # Search backward for the first character of the current line as {char}, 2fv can find the second character of v\nF{char}             # Search forward for the first character in the current line that is {char}\nt{char}             # Search backward before the first character in the current line that is {char}\nT{char}             # Search forward before the first character in the current line that is {char}\n;                   # Repeat the last character search command (f/t command)\n,                   # Reverse the direction to find the last character search command (f/t command)\ntx                  # Search the current line before the specified string\nfx                  # Search the current line to the specified string\n\u003cEsc\u003e               # Abandon the search. For example, after starting the f command, I found that I wanted to use the F command, and the \u003cEsc\u003e exit key gave up the search\n```\n\nNote: The \u003cEsc\u003e key can abort most commands.\n\n**Replace command in normal mode**\n\n```\n:[range]s[ubstitute]/{pattern}/{string}/[flags]\n```\n\nParameter Description：\n\n- pattern：It is the string to be replaced, which can be represented by regexp.\n- string：Replace pattern by string.\n- [range]：There are the following values.\n\n| [range] value | Description                                                                                           |\n| ------------- | ----------------------------------------------------------------------------------------------------- |\n| null          | Default cursor line                                                                                   |\n| .             | The current line where the cursor is                                                                  |\n| N             | Line N                                                                                                |\n| $             | the last line                                                                                         |\n| 'a            | Mark the line where a (has been marked with ma before)                                                |\n| $-1           | The penultimate row, you can add or subtract a certain value to a certain row to obtain a certain row |\n| 1,10          | Line 1~10                                                                                             |\n| 1,$           | First line to last line                                                                               |\n| 1,.           | First line to current line                                                                            |\n| .,$           | Current line to last line                                                                             |\n| 'a,'b         | Mark the line where a is located to the line where the mark b is located (marked with ma, mb before)  |\n| %             | All rows (equivalent to 1, $)                                                                         |\n| ?str?         | Search upwards from the current position and find the first line of str (str can be regular)          |\n| /str/         | Search down from the current position to find the first line of str (str can be regular)              |\n\nNote that all the above representation methods for range can be used to set the relative offset through + and-operations.\n\n- [flags] has the following values:\n\n| [flags]value | Description                                         |\n| ------------ | --------------------------------------------------- |\n| g            | Replace all matches (global) in the specified range |\n| c            | Ask the user to confirm before replacing (confirm)  |\n| e            | Ask the user to confirm before replacing (confirm)  |\n| i            | not case sensitive                                  |\n| null         | Only replace the first match in the specified range |\n\nFor example:\n\n```\n:s/p1/p2/g          # Replace all p1 with p2 in the current line\n:%s/p1/p2/g         # Replace all p1 with p2 in the current file\n:%s/p1/p2/gc        # Replace all p1 with p2 in the current file, and ask you whether to replace it everywhere\n:10,20s/p1/p2/g     # Replace all p1 in lines 10 to 20 with p2\n:%s/1\\\\2\\/3/123/g   # Replace \"1\\2/3\" with \"123\" (special characters are marked with backslashes)\n:%s/\\r//g           # Delete DOS line break ^M\n:%s///gn            # Count the number of matches in a pattern\n:%s/^\\s*$\\n//g      # Delete all blank lines in the Vim open file\n:g/^\\s*$/d          # Delete all blank lines in the Vim open file\n:%s/^M$//g          # Delete the explicit ^M symbol in the Vim file (operating system line break problem)\n```\n\n## Visual mode\n\n**Note: In Vim visual mode, you can select an editing area, and then perform operations such as inserting, deleting, replacing, and changing the case of the selected file content.**\n\n```\nv                   # Switch to character-oriented visual mode\nV                   # Switch to line-oriented visual mode\nCtrl+V              # Switch to block-oriented visual mode\n\u003e                   # Increase indent\n\u003c                   # Decrease indent\nd                   # Delete the highlighted text\nx                   # Delete the highlighted text\nc                   # Rewrite the text, that is, delete the highlighted text and enter the insert mode\ns                   # Rewrite the text, that is, delete the highlighted text and enter the insert mode\ny                   # Copy text\n~                   # Convert case\no                   # Jump to the other end of the marked area\nO                   # Jump to the other end of the marker block\nu                   # Marked area converted to lower case\nU                   # Convert marked area to uppercase\ngv                  # Reselect the last highlighted selection\ng Ctrl+G            # Show statistics of the selected area\nggVG                # Select full text\n\u003cEsc\u003e               # Press \u003cEsc\u003e to exit visual mode\n```\n\nIn addition: The Vim Normal command can execute commands in the normal mode in the command line mode. When the Normal command is combined with the Vim visualization mode, a lot of repetitive tasks can be completed with few operations.\n\n## Comment command\n\n**Multi-line comments**\n\n```\nCtrl+v              # Enter the command line mode, press Ctrl+v to enter the visual mode, then press j or k to select multiple lines and mark the lines that need to be commented\nI                   # Press the capital letter I, and then insert the comment character, such as #, //\n\u003cEsc\u003e               # Press the \u003cEsc\u003e key to comment all\n```\n\n**Uncomment multiple lines**\n\n```\nCtrl+v              # Enter the command line mode, press Ctrl+v to enter the visual mode, press the letter l to select the number of columns horizontally, such as #, // (need to select 2 columns)\nj or k              # Press the letter j, or k to select the comment symbol\nd                   # Press the d key to uncomment all\n```\n\n**Complex annotation**\n\n```\n:Start line, end line s/^/ comment character /g       # Add a comment at the beginning of the specified line\n:Start line, end line s/^ comment character //g       # Uncomment at the beginning of the specified line\n\n:3,5 s/^/#/g        # Comment lines 3-5\n:3,5 s/^#//g        # Uncomment lines 3-5\n\n:1,$ s/^/#/g        # Annotate the entire document\n:1,$ s/^#//g        # Uncomment the entire document\n\n:%s/^/#/g           # Annotate the entire document, this method is faster\n:%s/^#//g           # Uncomment the entire document\n```\n\n## Position movement\n\n```\nCtrl+O              # Jump to the previous position\nCtrl+I              # Jump to the next position\nCtrl+^              # Jump to alternate file (the previous file in the current window)\n%                   # Match jump to the corresponding {} () []\ngd                  # Jump to the local definition (the definition of the word under the cursor)\ngD                  # Jump to the global definition (the definition of the word under the cursor)\ngf                  # Open the file whose name is the file name under the cursor\n[[                  # Jump to the previous top-level function\n]]                  # Jump to the next top-level function\n[m                  # Jump to the previous member function\n]m                  # Jump to the next member function\n[{                  # Jump to the previous unmatched {\n]}                  # Jump to the next unmatched }\n[(                  # Jump to the previous unmatched (\n])                  # Jump to the next unmatched )\n[c                  # The last difference (when diffing)\n]c                  # The next difference (when diffing)\n[/                  # Jump to the beginning of the C comment\n]/                  # Jump to the end of the C comment\n``                  # Go back to the last jumped position\n''                  # Go back to the last jumped position\n`.                  # Back to the last edited position\n'.                  # Back to the last edited position\n```\n\n## Movement commands diagram\n\n![vim movement commands](./image/vim-movement_EN.png)\n\n## Open file\n\n```\nvim .               # Open the file manager, display the catalog file, edit by selecting the file\nvim filename        # Open or create a new file, and place the cursor at the beginning of the first line\nvim + filename      # Open the file and place the cursor at the beginning of the last line\nvim +n filename     # Open the file and place the cursor at the beginning of line n\nvim -c cmd file     # Before opening the file file, execute the specified Vim command cmd\nvim -b file         # Open the file in binary mode, some special characters (such as line break ^M) can be displayed in this mode\nvim -d file1 file2  # Use Vim to open file1 and file2 at the same time and diff the difference between the two files\nvim -r filename     # The system crashed the last time I was editing with Vim, restore the file\nvim -R file         # Open the file as read-only, but you can still use :wq! to write\nvim -M file         # The modification function is forcibly closed and cannot be used :wq! Write\nvim -o file1 file2  # When you want to open a Vim file in the terminal, split and display multiple files horizontally\nvim -O file1 file2  # When you want to open a Vim file in the terminal, split and display multiple files vertically\nvim -x file         # Open the file encrypted\nvim +/target file   # Open file and move the cursor to the first target string found\n```\n\n## Save and exit\n\n**Note: Save and exit in normal mode.**\n\n```\n:w                  # Write the file and save it, the time stamp of the file will be modified\n:w {filename}       # Save file by name\n:w !sudo tee %      # Save the file with super user privileges, you can also do this :w !sudo tee%\u003e /dev/null\n:wa                 # Save all files\n:wall               # Save all files\n:wqall              # Save all files and exit\n:q                  # Close the window where the cursor is located and exit (q: quit)\n:q!                 # Force quit (q: quit)\n:qa！               # Abandon all file operations and force exit\n:qall               # Abandon all file operations and exit\n:x                  # Save the file and exit, the time stamp of the file will not be modified\nZZ                  # Save the changed file, and close the exit window\nZQ                  # Close the window without saving the file\n```\n\n## File operations\n\n```\n:e[dit] {filename}  # Open the file and edit, open the file by the absolute or relative path of the file, Tab key to complete the path\n:e[dit] .           # Open the file manager, browse the files in the current directory, select and edit\n:e[dit]             # Reload current file\n:E[xplore]          # Open the file manager, and display the directory where the active buffer is located\n:saveas {filename}  # Save as specified file\n:o {filename}       # Open another file in the current window (o: open)\n:r {filename}       # Read the file and insert the content after the cursor\n:r !dir             # Capture and insert the output of the dir command after the cursor\n:on[ly]             # Close other windows except the window where the cursor is located, same as Ctrl+W o\n:clo[se]            # Close the file in the window where the cursor is, the same as Ctrl+W c\n:cd {path}          # Switch Vim current path\n:cd -               # Go back to the last current directory\n:pwd                # Show Vim current path\n:n[ew] {filename}   # Open a new window to edit the new file filename\n:new                # Open a new window to edit a new file\n:ene[w]             # Create a new file in the current window\n:vnew               # Edit the new file in a new window divided into left and right\n:tabnew             # Edit the new file in a new tab\n:fin[d] {file}      # Find the file {file} in path and edit it\n:f[ile]             # Display the current file name and cursor position\n:f[ile] {name}      # Set the current file name to name\n:files              # Show all alternate file names\n```\n\n## Opened file operation\n\n```\n:ls                 # Investigation cache list\n:bn                 # Switch to the next cache\n:bp                 # Switch to the previous cache\n:bd                 # Delete cache\n:b 1                # Switch to cache 1\n:b abc              # Switch to the cache whose file name starts with abc\n:badd {filename}    # Add files to the cache list\n:set hidden         # Set hidden mode (unsaved cache can be switched away or closed)\n:set nohidden       # Turn off the hidden mode (unsaved cache cannot be switched away or closed)\nn Ctrl+^            # To switch the cache, enter the numeric cache number first, then press Ctrl+6\n```\n\n## Multi-window operation\n\n\u003e The split-screen window is based on the Ctrl+W shortcut key, Ctrl is the control function key, W stands for Windom, and Ctrl+W stands for control window.\n\n```\n:sp {filename}      # Split the window horizontally and open the file in a new window filename\n:vs {filename}      # Split the window vertically and open the file in a new window filename\n:split              # Copy the current window to a horizontal window, the content is synchronized, the cursor can be different\n:vsplit             # Copy the current window to another vertical window, the content is synchronized, the cursor can be different\nCtrl+W              # Switch to the next window\nCtrl+W s            # Horizo​​ntal split window\nCtrl+W v            # Split window longitudinally\nCtrl+W w            # Cycle to the next window\nCtrl+W W            # Cycle to the previous window\nCtrl+W p            # Skip to the last visited window\nCtrl+W r            # reverse window\nCtrl+W c            # Close the current window, but cannot close the last window\nCtrl+W q            # Exit the current window, if it is the last window, close vi\nCtrl+W o            # Keep only the active window, close other (o: other) windows, same as :on[ly]\nCtrl+W h            # Jump to the left window\nCtrl+W j            # Jump to the window below\nCtrl+W k            # Jump to the upper window\nCtrl+W l            # Jump to the right window\nCtrl+W +            # Increase the row height of the current window, you can add a number in front\nCtrl+W -            # Decrease the row height of the current window, you can add a number in front\nCtrl+W \u003c            # Reduce the column width of the current window, you can add a number in front\nCtrl+W \u003e            # Increase the column width of the current window, you can add a number in front\nCtrl+W =            # Make all windows the same width and height\nCtrl+W H            # Move the current window to the far left\nCtrl+W J            # Move the current window to the bottom\nCtrl+W K            # Move the current window to the top\nCtrl+W L            # Move the current window to the far right\nCtrl+W x            # Exchange window\nCtrl+W f            # Open the file named under the cursor in a new window\nCtrl+W gf           # Open the file named under the cursor in a new tab\nCtrl+W T            # Move the current window to a new tab\nCtrl+W P            # Jump to the preview window\nCtrl+W z            # Close preview window\nCtrl+W _            # Maximize the current window vertically\nCtrl+W |            # Maximize the current window horizontally\n```\n\n## Tags\n\n```\n:tabs               # Show all tabs\n:tabe {filename}    # Open the file filename in a new tab\n:tabn[ext]          # Next tab\n:tabp[revious]      # Previous tab\n:tabc[lose]         # Close current tab\n:tabo[nly]          # Close other tabs\n:tabn N             # Switch to the Nth tab page, for example: tabn 3 Switch to the third tab page\n:tabm n             # Label move\n:tabfir[st]         # Switch to the first tab\n:tabl[ast]          # Switch to the last tab\n:tab help           # Open help in tab\n:tab drop {file}    # If the file has been opened by other tabs and windows, skip over, otherwise open a new tab\n:tab split          # Open the file in the current window in a new tab\n:tab ball           # Open all files in the cache with tabs\n:set showtabline=?  # Set to 0 to not display the tab page label, 1 will be displayed on demand, 2 will be permanently displayed\nNgt                 # Switch to the Nth tab page, for example, 2gt will switch to the second tab page\ngt                  # Next tab\ngT                  # Previous tab\n```\n\n## Vim bookmarks\n\n```\n:marks              # Show all bookmarks\nma                  # Save the current position to bookmark a, the lowercase letter of the book signature is in the file, and the uppercase global\n'a                  # Jump to the line of bookmark a\n`a                  # Jump to the location of bookmark a\n`.                  # Jump to the last edited line\n'A                  # Jump to full text bookmark A\n['                  # Jump to the previous bookmark\n]'                  # Jump to the next bookmark\n'\u003c                  # Jump to the beginning of the last visual mode selection area\n'\u003e                  # Jump to the end of the last visual mode selection area\n```\n\n## Spell Check\n\n```\n:set spell          # Turn on spell check\n:set nospell        # Turn off spell check\n]s                  # The next misspelled word\n[s                  # The last misspelled word\nzg                  # Add words to the spelling vocabulary\nzug                 # Undo the last word added\nz=                  # Spelling suggestion\n```\n\n## Code folding\n\n```\nzf{motion}          # Operator, manually define a fold (f:fold)\n:{range}fold        # Define the lines included in the range {range} as a fold\nzf                  # Create code folding\nzF                  # Specify the number of rows to create a fold\nza                  # Toggle fold\nzA                  # Switch folding recursively\nzc                  # Close a fold under the cursor (c: close)\nzC                  # Close all folds under the cursor (C: Close)\nzd                  # Delete the fold under the cursor\nzD                  # Recursively delete all folds\nzE                  # Delete all folds\nzi                  # Toggle fold\nzm                  # All codes are folded one level\nzM                  # Fold all code, set foldlevel=0, set foldenable\nzr                  # All codes open one layer\nzR                  # Open all code and set foldlevel to the maximum\nzn                  # Fold none, reset foldenable and open all codes\nzN                  # Fold Normal, reset foldenable and restore all folds\nzo                  # Open a layer of code\nzO                  # Turn on all code folding under the cursor\n```\n\n## Document encryption/decryption\n\n\u003e The document is encrypted. When you open the file, you will be prompted to enter the password twice in the lower left corner of the screen before you can operate. After saving the file and exiting, you must enter the normal password to open the file correctly, otherwise garbled characters will be displayed.\n\n```\nvim -x {filename}   # Enter the encryption password and confirm the password again. Note: Save the content without modifying it, otherwise the password setting will not take effect\n:X                  # Enter the encryption password in command mode and confirm the password again. Note: Save the content without modifying it, otherwise the password setting will not take effect\n:set key=password   # Enter the encryption password in command mode and confirm the password again. Note: Save the content without modifying it, otherwise the password setting will not take effect\n```\n\n\u003e Document decryption, set decryption by command mode.\n\n```\n:X                  # In command mode, directly press Enter to indicate that the password is empty. Note: Save the content without modifying it, otherwise the decryption setting will not take effect\n:set key=           # Set the key password to be empty in command mode. Note: Save the content without modifying it, otherwise the password setting will not take effect\n```\n\n## Macro recording\n\n**Macro is the function of recording and playback. It is an integration of a series of Vim command operations. Using macros can achieve a lot of repetitive work.**\n\n```\nqa                  # Start recording the macro named a\nq                   # End recording macro\n@a                  # Play the macro named a\n@@                  # Play the previous macro\n@:                  # Repeat the last ex command (colon command)\n```\n\n**Macro example**：You need to type a Tab key at the beginning of the following multi-line text to indent the beginning of the line.\n\n```\nset nu\nset tabstop=4\nset shiftwidth=4\nset softtabstop=4\nset autoindent\nset wrap\nsyntax on\n```\n\n### Record macro\n\n- Move the cursor to the first line first.\n- In Normal mode, press the q key and a letter to start recording. For example, press qa to register the macro as a.\n- Press I to insert at the beginning of the line, and press Tab in edit mode. Press \u003cEsc\u003e to return to Normal mode.\n- Press the j key to move the cursor to the next line.\n- Press the q key to finish recording.\n\n### Use macro\n\n- Using the macro a recorded above, press @a to play the macro named a.\n- Move the cursor to the second line in Normal mode, press @a, and use macro a again.\n- Press N@a for multiple operations, where N is a positive integer, which means that the macro is executed N times. For example, move the cursor to line 3, operate macro a on the remaining 5 lines, and press 5@a.\n\nThe above **recording macro, using macro** two common operations, complete the beginning of multiple lines of text, type a Tab key to indent the beginning of the line!\n\n## Other commands\n\n```\nga                  # Display the ASCII code or Unicode code of the character under the cursor\ng8                  # Display the UTF-8 encoding byte order of the character under the cursor\ngi                  # Go back to the place where you entered the insert last time, and switch to insert mode\nK                   # Query the help of the word under the cursor\nCtrl+G              # Display the name of the file being edited, as well as size and location information\ng Ctrl+G            # Display file size, number of characters, number of words and number of lines, also available in visual mode\nCtrl+PgUp           # On the last tab page, GVim OK, some terminal software needs to set the corresponding keyboard code\nCtrl+PgDown         # The next tab page, GVim OK, some terminal software needs to set the corresponding keyboard code\nCtrl+R Ctrl+W       # Insert the word under the cursor in command mode\nCtrl+Insert         # Copy to the system clipboard (GVIM)\nShift+Insert        # Paste the contents of the system clipboard (GVIM)\nCtrl+X Ctrl+E       # Scroll up in insert mode\nCtrl+X Ctrl+Y       # Scroll down in insert mode\n:map                # To view the map shortcuts of the current Vim configuration\n:inoremap           # To view the inoremap shortcuts of the current Vim configuration\n:nnoremap           # To view the nnoremap shortcuts of the current Vim configuration\n:set ff=unix        # Set change behavior unix\n:set ff=dos         # Set change behavior dos\n:set ff?            # View line break settings\n:set nohl           # Clear search highlight\n:set termcap        # See what will be received from the terminal and what commands will be sent to the terminal\n:set guicursor=     # Solve the problem of some strange characters in NeoVim in SecureCRT/PenguiNet\n:set t_RS= t_SH=    # Solve the strange characters in the Vim8.0 terminal function in SecureCRT/PenguiNet\n:set fo+=a          # Enable real-time automatic formatting of text segments\n:earlier 15m        # Go back to the contents of the file 15 minutes ago\n:.!date             # Insert time in current window\n:%!xxd              # Start binary editing\n:%!xxd -r           # Save binary edit\n:r !curl -sL {URL}  # After reading the URL content and adding it to the cursor\n:g/^\\s*$/d          # Delete blank lines\n:g/green/d          # Delete all lines containing green\n:v/green/d          # Delete all lines that do not contain green\n:g/gladiolli/#      # Search words and print the results, and add the line number before the results\n:g/ab.*cd.*efg/#    # Search for lines containing ab, cd and efg, print the result and line number\n:v/./,/./-j         # Compress blank lines\n:Man bash           # View man in Vim, first call :runtime! ftplugin/man.vim to activate\n/fred\\|joe          # Search for fred or joe\n/\\\u003c\\d\\d\\d\\d\\\u003e       # Search exactly four numbers\n/^\\n\\{3}            # Search for three consecutive blank lines\n```\n\n## History commands\n\nHistory command format:\n\n```\n:his[tory] [{name}] [{first}][, [{last}]]\n```\n\nParameter Description:\n\n- {name}：Specifies the history type.\n- {first}：Specifies the starting position of the command history, defaults to the first record.\n- {last}：Specifies where the command history ends, defaults to the last record.\n\nIn command line mode.\n\n```\n:his[tory]                # View the history of all commands entered in the command line mode\n:his[tory] all            # Show all types of history\n:history c 1,5            # List the first to fifth command line history\n:history search or / or ？ # View search history\n:call histdel(\"\")         # delete history\n:help :history            # See help for the :history command\n```\n\nIn normal mode.\n\n```\nq/                  # View search history used q/ entered\nq?                  # View usage q? Entered search history\nq:                  # View command line history\n```\n\n## Register\n\n**View register value.**\n\n```\n:reg                   # View all register values\n:reg {register}        # View the specified register value\n```\n\n**Recall register value.**\n\n```\n\"{register}            # Recall register value in normal mode\n:Ctrl+r \"registerName  # After entering Ctrl+r in command mode, Vim will automatically type \"register reference symbol\nCtrl+r registerName    # In insert mode (no need to enter register reference symbol \")\n```\n\n**Vim register classification**\n\n| Register name         | Citation method    | Description                                                                                                                                                                                                                                                                                                                                       |\n| --------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Unnamed register      | \"\"                 | The default register, all copy and modify operations (x, s, d, c, y) will copy the data to the unnamed register                                                                                                                                                                                                                                   |\n| Named register        | \"a - \"z or \"A - \"Z | {register} can only be one of 26 English letters, from a-z, A-Z register contents will be merged into the corresponding lowercase letters                                                                                                                                                                                                         |\n| Copy special register | \"0(Number 0)       | Only when the copy operation (y) is used, the data will be copied to the unnamed register and the copy special register at the same time                                                                                                                                                                                                          |\n| Numbered register     | \"1 - \"9            | All data without ranges ('(',')','{','}') and operations involving more than 1 line of delete and modify operations (x, s, d, c) will be copied to the stepwise temporary cache register , And when new data is added, it progresses step by step. The data of 1 is copied to 2, 2 to 3, and the contents of the last 9 registers will be deleted |\n| Black hole register   | \"\\_                | Almost all the data involved in the operation will be copied to the register. If you want the data to be operated not to pass through the register, you can specify a black hole register. The data will disappear when the register arrives, and it cannot be displayed and does not exist.                                                      |\n| System clipboard      | \"+ or \"\\*          | When interacting with the GUI external to Vim, you need to use a special system clipboard                                                                                                                                                                                                                                                         |\n| Expression register   | \"=                 | The most special one of all registers is used to calculate expressions. After entering the register application, it will prompt \"=\" in the command line, enter the expression as needed, and the result will be displayed at the cursor                                                                                                           |\n| Other registers       | -                  | -                                                                                                                                                                                                                                                                                                                                                 |\n\n## Vim configuration file\n\n\u003e Note: Vim configuration files are available in global and user versions, and user configuration files take precedence over global system configuration files.\n\n```\n:ve[rsion]          # Check the Vim version, and also check the priority order and location of Vim loading configuration files\n:echo $MYVIMRC      # Use this command in Vim command mode to output the location of the Vim configuration file\n:edit $MYVIMRC      # Use this command to open the Vim configuration file in Vim command mode\n:so[urce] $MYVIMRC  # After the Vim configuration file is changed, use this command to load the new configuration options. If the vimrc file happens to be the currently active buffer, this command can be simplified to: so %.\n:echo $VIM          # Output the location of the global vimrc configuration file, stored in the Vim installation directory\n:echo $HOME         # Output the location of the user vimrc configuration file, stored in the user's home directory\n```\n\n**Vim configuration instructions, please refer to [vimrc configuration file](../vimrc) for details. Note: Vim configuration can be set individually in command mode and only takes effect in the current window！**\n\n```\nsyntax              # List the defined grammar items\nsyntax clear        # Clear defined grammar rules\nsyntax on           # Allow syntax highlighting\nsyntax off          # Prohibit syntax highlighting\nset history=200     # Record 200 historical commands\nset bs=?            # Set Backspace key mode, modern editor is :set bs=eol,start,indent\nset sw=4            # Set the indent width to 4\nset ts=4            # Set the tab width to 4\nset noet            # Set not to expand Tab to space\nset et              # Set expand Tab to space\nset winaltkeys=no   # Set the normal capture of the Alt key under GVim\nset nowrap          # Turn off word wrap\nset ttimeout        # Allow terminal key detection to time out (the function key under the terminal is a series of scan codes starting with Esc)\nset ttm=100         # Set the terminal key detection timeout to 100 milliseconds\nset term=?          # Set the terminal type, such as the common xterm\nset ignorecase      # Set whether the search ignores case\nset smartcase       # Smart case, ignore case by default, unless the search content contains uppercase letters\nset list            # Set to display tabs and line breaks\nset nu              # Set the display line number, you can use :set nonu to prohibit the display line number\nset number          # Set the display line number, you can use :set nonumber to prohibit the display line number\nset relativenumber  # Set display relative line number (distance between other lines and current line)\nset paste           # Enter paste mode (disable indentation when pasting and other things that affect formatting)\nset nopaste         # End paste mode\nset spell           # Allow spell checking\nset hlsearch        # Set highlight search\nset ruler           # Always show cursor position\nset nocompatible    # The setting is not compatible with the original vi mode (must be set at the very beginning)\nset incsearch       # Dynamic incremental display of search results during search input\nset insertmode      # Vim is always in insert mode, use Ctrl+o to execute commands temporarily\nset all             # List all option settings\n```\n\n## Vim plugins\n\n**[vim-commentary](https://github.com/tpope/vim-commentary)**：Vim batch comment tool, you can comment multiple lines and remove multiple lines of comments.\n\n```\ngcc                 # Comment the current line\ngc{motion}          # Annotate the area marked by {motion}, such as gcap annotate the entire paragraph\ngci{                # Comment the content in braces\ngc                  # Press gc to annotate the selected area under Visual Mode\n:7,17Commentary     # Comment lines 7 to 17\n```\n\n**[NERDTree](https://github.com/preservim/nerdtree)**：This plugin is used to list the directory tree of the current path.\n\n```\n?                   # Quick help document\no                   # Open a directory or open a file, create a buffer, can also be used to open bookmarks\ngo                  # Open a file, but the cursor remains in NERDTree, creating a buffer\nt                   # Open a file and create a Tab, which is also effective for bookmarks\nT                   # Open a file, but the cursor still stays in NERDTree. Tab is created, which is also effective for bookmarks\ni                   # Split the window to create the file horizontally, creating a buffer\ngi                  # Split the window where the file was created horizontally, but the cursor remains in NERDTree\ns                   # Split the window that creates the file vertically, creating a buffer\ngs                  # Similar to gi and go\nx                   # Collapse the currently open directory\nX                   # Collapse all open directories\ne                   # Open the selected directory by file management\nD                   # Delete bookmark\nP                   # Uppercase, jump to the current root path\np                   # Lowercase, jump to the previous path where the cursor is located\nK                   # Jump to the first subpath\nJ                   # Jump to the last subpath\nC                   # Set the root path to the directory where the cursor is\nu                   # Set the parent directory as the root path\nU                   # Set the parent directory to follow the path, but keep the original directory open\nr                   # Refresh the directory where the cursor is\nR                   # Refresh the current root path\nI                   # Show or not show hidden files\nf                   # Turn file filters on and off\nq                   # Close NERDTree\nA                   # Show NERDTree in full screen, or close full screen\nCtrl+j Ctrl+k       # Move between directories and files at the same level, ignoring subdirectories and subfiles\n```\n\n**[asyncrun.vim](https://github.com/skywind3000/asyncrun.vim)**：The plug-in uses the asynchronous mechanism of Vim 8 / NeoVim, allowing you to run Shell commands in the background and display the results in Vim's Quickfix window in real time.\n\n```\n:AsyncRun ls        # Run the command ls asynchronously and output the result to quickfix. Use :copen to view\n:AsyncRun -raw ls   # Run the command asynchronously, the result of ls does not match errorformat\n```\n\n## Vim mode\n\n```\nNormal mode         # Press \u003cEsc\u003e or Ctrl+[ to enter, the file name is displayed in the lower left corner or empty\nInsert mode         # Press i to enter, the lower left corner shows --INSERT--\nVisual mode         # Press v to enter, the lower left corner shows --VISUAL--\nReplacement mode    # Press r or R to start, the lower left corner shows --REPLACE--\nCommand line mode   # Press : or / or ? To start\n```\n\n## External command\n\n```\n:!{command}         # Execute a one-time Shell command, the following command: :!pwd, change the directory in the current Vim mode\n:!!                 # Re-execute the most recently run command\n:sh[ell]            # Start an interactive Shell to execute multiple commands, the exit command exits and returns to Vim\n:!ls                # Run the external command ls and wait for the return\n:r !ls              # Capture the output of the external command ls and insert it after the cursor\n:w !sudo tee %      # sudo saves the current file in the future, it can also be like this :w !sudo tee % \u003e /dev/null\n:call system('ls')  # Call the ls command, but do not display the returned content\n:!start notepad     # Start Notepad under Windows, you can add silent at the top\n:sil !start cmd     # Open cmd in the current directory under Windows\n:%!prog             # Run a text filter program, such as sorting JSON format:%!python -m json.tool\n```\n\n## Quickfix window\n\n```\n:copen              # Open the quickfix window (view compilation, grep and other information)\n:copen 10           # Open the quickfix window and set the height to 10\n:cclose             # Close the quickfix window\n:cfirst             # Jump to the first error message in quickfix\n:clast              # Jump to the last error message in quickfix\n:cc [nr]            # View error [nr]\n:cnext              # Skip to the next error message in quickfix\n:cprev              # Jump to the previous error message in quickfix\n```\n\n## Help information\n\n```\n:h[elp] {command}   # To display the help of related commands, you can also enter :help instead of the command. To exit the help, you need to enter :q\n:h tutor            # Getting started document\n:h quickref         # Quick help\n:h index            # Query all keyboard command definitions in Vim\n:h summary          # Help you better use the built-in help system\n:h Ctrl+H           # Query what Ctrl+H does in normal mode\n:h i_Ctrl+H         # Query what does Ctrl+H do in insert mode\n:h i_\u003cUp\u003e           # Query what is on the arrow keys in insert mode\n:h pattern.txt      # Regular expression help\n:h eval             # Scripting help\n:h function-list    # View the list of functions in VimScript\n:h windows.txt      # Window help\n:h tabpage.txt      # Help on using tabs\n:h +timers          # Show help for the +timers feature\n:h :!               # See how to run external commands\n:h tips             # View the documentation of common techniques built into Vim\n:h set-termcap      # See how to set the key scan code\n:viu[sage]          # Displays help for common commands. The purpose is to simulate the corresponding Nvi commands\n:exu[sage]          # Displays help for the Ex command. The purpose is to simulate the corresponding Nvi commands\n:ve[rsion]          # View the Vim version, and also view the priority and location of the Vim load configuration file\n```\n\n## Vim keyboard diagram\n\n![vim keyboard diagram](./image/vim-keys_EN.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxxbrian%2Fivimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxxxbrian%2Fivimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxxbrian%2Fivimer/lists"}