{"id":240159,"date":"2016-12-31T10:49:42","date_gmt":"2016-12-31T02:49:42","guid":{"rendered":"http:\/\/www.systutorials.com\/?p=240159"},"modified":"2026-04-12T00:21:18","modified_gmt":"2026-04-11T16:21:18","slug":"vim-tutorial-beginners-vimtutor","status":"publish","type":"post","link":"https:\/\/www.systutorials.com\/vim-tutorial-beginners-vimtutor\/","title":{"rendered":"Mastering Vim: A Practical Guide to vimtutor"},"content":{"rendered":"<p>vimtutor is the most practical way to learn Vim. It&#8217;s an interactive lesson built directly into your editor that teaches through practice rather than passive reading. You launch it from the terminal with no setup required, and you get immediate feedback on every command you type.<\/p>\n<h2>Running vimtutor<\/h2>\n<p>From any terminal:<\/p>\n<pre><code class=\"language-bash\">vimtutor<\/code><\/pre>\n<p>This opens an interactive tutorial inside Vim itself. Budget 25\u201330 minutes to work through it, though actual time varies depending on how much you experiment with each lesson.<\/p>\n<p>For a tutorial in a different language:<\/p>\n<pre><code class=\"language-bash\">vimtutor de     # German\nvimtutor fr     # French\nvimtutor zh     # Chinese (simplified)\nvimtutor ru     # Russian<\/code><\/pre>\n<p>Run <code>vimtutor --help<\/code> to see all available languages on your system. The language codes follow your system&#8217;s locale settings.<\/p>\n<h2>What You&#8217;ll Learn: Seven Lessons<\/h2>\n<p>The tutorial builds sequentially\u2014each lesson assumes you&#8217;ve completed the previous one. Critical point: you must actually execute the commands. Reading alone doesn&#8217;t build muscle memory.<\/p>\n<h3>Lesson 1: Movement and Basic Editing<\/h3>\n<p>Master cursor movement using <code>hjkl<\/code> (left, down, up, right). These keys keep your hands on the home row, though Vim accepts arrow keys too.<\/p>\n<p>Essential editing commands:<\/p>\n<pre><code>x              delete character under cursor\ni              insert before cursor\na              append after cursor\nA              append at end of line\n:wq            write and quit\n:q!            quit without saving<\/code><\/pre>\n<h3>Lesson 2: Operators and Motions<\/h3>\n<p>Vim&#8217;s power comes from combining operators with motions. The pattern is <code>[operator][count][motion]<\/code>.<\/p>\n<p>Common combinations:<\/p>\n<pre><code>dw             delete word\nd$             delete to end of line\ndd             delete entire line\n2w             move forward two words\nd2w            delete two words\ncw             change word (delete and insert)\nc$             change to end of line\nyw             yank (copy) word\ny$             yank to end of line<\/code><\/pre>\n<p>Undo with <code>u<\/code>, redo with <code>Ctrl-R<\/code>. Vim maintains a full undo history\u2014you can undo multiple times or navigate with <code>:undolist<\/code> for complex undo trees.<\/p>\n<h3>Lesson 3: Putting and Replacing<\/h3>\n<p>After deleting or copying text, paste it back:<\/p>\n<pre><code>p              paste after cursor\nP              paste before cursor\nr              replace single character\nR              replace mode (overwrite characters)<\/code><\/pre>\n<p>When you delete something with <code>d<\/code>, Vim stores it in a register. Paste it with <code>p<\/code> or <code>P<\/code>. The same applies to yanked text\u2014copy with <code>y<\/code>, paste with <code>p<\/code>. Each register is independent, so you can store multiple text blocks simultaneously.<\/p>\n<h3>Lesson 4: Navigation and Search<\/h3>\n<p>Jump around files efficiently:<\/p>\n<pre><code>Ctrl-G         show file position and status\nG              jump to end of file\ngg             jump to start of file\n10G            jump to line 10\n:10            alternative: go to line 10\n\/pattern       search forward\n?pattern       search backward\nn              next match\nN              previous match\n%              jump to matching bracket or parenthesis\n*              search for word under cursor (forward)\n#              search for word under cursor (backward)<\/code><\/pre>\n<p>Search is case-sensitive by default. Make searches case-insensitive with <code>:set ignorecase<\/code> or use <code>\/pattern\\c<\/code> for a single case-insensitive search. The <code>:set smartcase<\/code> option makes searches case-sensitive only if your search pattern contains uppercase letters.<\/p>\n<h3>Lesson 5: External Commands and File Operations<\/h3>\n<p>Run shell commands without leaving Vim:<\/p>\n<pre><code>:!ls                    execute shell command\n:!rm filename           delete file via shell\n:w newfile.txt          write to new file\n:w !cat &gt; output.txt    pipe buffer to command\n:r filename.txt         insert file contents\n:r !ls                  insert command output<\/code><\/pre>\n<p>Visual mode lets you select and work with text ranges. Press <code>v<\/code> to enter Visual mode, select text using motions, then perform an action:<\/p>\n<pre><code>v{motion}:w file.txt    write selection to file\nv{motion}d              delete selection\nv{motion}y              copy selection\nv{motion}c              change selection<\/code><\/pre>\n<h3>Lesson 6: Text Manipulation<\/h3>\n<p>Insert new lines and switch modes:<\/p>\n<pre><code>o              open line below, enter Insert mode\nO              open line above, enter Insert mode\na              append after cursor\nR              Replace mode (overwrites as you type)\nv              Visual mode (character selection)\nV              Visual Line mode (full lines)\nCtrl-V         Visual Block mode (rectangular regions)<\/code><\/pre>\n<p>Copy text with <code>y<\/code> (yank). It works with motions just like <code>d<\/code>:<\/p>\n<pre><code>yw             yank word\ny$             yank to end of line\nyy             yank entire line<\/code><\/pre>\n<h3>Lesson 7: Help and Configuration<\/h3>\n<p>Access Vim&#8217;s built-in help:<\/p>\n<pre><code>:help                  open help index\n:help subject          search help for topic\n:help motion           learn about motions\n:help operator         learn about operators\nCtrl-W Ctrl-W          switch between help and buffer\n:q                     close help window<\/code><\/pre>\n<p>Create a <code>.vimrc<\/code> configuration file in your home directory to customize Vim:<\/p>\n<pre><code class=\"language-bash\"># Linux\/macOS\n~\/.vimrc\n\n# Windows\n~\/_vimrc<\/code><\/pre>\n<p>A minimal practical <code>.vimrc<\/code>:<\/p>\n<pre><code class=\"language-vim\">set nocompatible       \" disable legacy compatibility\nset number             \" show line numbers\nset relativenumber     \" show relative line numbers\nset expandtab          \" use spaces instead of tabs\nset shiftwidth=4       \" indent with 4 spaces\nset tabstop=4          \" display tabs as 4 spaces\nset autoindent         \" copy indent to new lines\nset ignorecase         \" ignore case in searches\nset smartcase          \" unless search contains uppercase\nset hlsearch           \" highlight search matches\nset incsearch          \" show matches while typing\nsyntax on              \" enable syntax highlighting\nset ruler              \" show cursor position\nset showcmd            \" show incomplete commands<\/code><\/pre>\n<p>Use <code>:set option<\/code> to enable a setting, <code>:set nooption<\/code> to disable it. Changes made with <code>:set<\/code> apply only to the current session; add them to <code>.vimrc<\/code> to persist them across sessions.<\/p>\n<h2>After Completing vimtutor<\/h2>\n<p>Explore deeper topics with these help commands:<\/p>\n<pre><code>:help user-manual      comprehensive user guide\n:help motion           all movement commands\n:help operator         all operators\n:help cmdline          command-line features\n:help registers        understanding Vim's registers\n:help visual-mode      advanced visual mode usage\n:help macros           recording and playing macros<\/code><\/pre>\n<p>View example configurations:<\/p>\n<pre><code>:echo $VIMRUNTIME      show Vim runtime directory<\/code><\/pre>\n<p>Then examine <code>$VIMRUNTIME\/defaults.vim<\/code> for additional configuration ideas.<\/p>\n<h2>Essential Commands for Productivity<\/h2>\n<p>Once comfortable with basics, these commands significantly boost your efficiency:<\/p>\n<pre><code>.              repeat last command\nqa             start recording macro in register a\nq              stop recording\n@a             play macro from register a\n@@             repeat last macro\nCtrl-A         increment number under cursor\nCtrl-X         decrement number under cursor\n&gt;              indent lines\n&lt;              unindent lines\nJ              join line below to current line\n~              toggle case of character\n:set list      show invisible characters (tabs, line endings)\n:set wrap      enable word wrapping<\/code><\/pre>\n<p>Macros are particularly powerful. Record a sequence with <code>qa<\/code>, type your commands, then press <code>q<\/code> to stop. Play it back with <code>@a<\/code> or repeat with <code>@@<\/code>. This is how you automate repetitive editing tasks.<\/p>\n<h2>Building Muscle Memory<\/h2>\n<p>The tutorial intentionally focuses on essentials. Vim has enormous depth\u2014<code>man vim<\/code> and <code>:help<\/code> will keep you learning for years. The approach that actually works: learn one new command daily, use it in real work, and let repetition build automaticity. Vim rewards consistent daily use far more than cramming knowledge.<\/p>\n<p>Start with vimtutor today. Spend 30 minutes on it. Then use Vim for actual work, consulting the help system as needed. Consistency matters more than comprehensiveness.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>vimtutor is the most practical way to learn Vim. It&#8217;s an interactive lesson built directly into your editor that teaches through practice rather than passive reading. You launch it from the terminal with no setup required, and you get immediate feedback on every command you type. Running vimtutor From any terminal: vimtutor This opens an&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[1153],"tags":[23,264,33,40,41,510,708,730,271,704,1069,447,287,452,1063,377,191,199,509,422,219,454,390,234,453,245,723,309],"class_list":["post-240159","post","type-post","status-publish","format-standard","hentry","category-linux-systems-administration","tag-bash","tag-c","tag-chinese","tag-command","tag-command-line","tag-console","tag-dd","tag-dos","tag-editor","tag-error","tag-how-to","tag-linux","tag-memory","tag-programming","tag-r","tag-screen","tag-script","tag-shell","tag-spring","tag-terminal","tag-time","tag-tutorial","tag-unix","tag-vim","tag-web","tag-windows","tag-www","tag-x"],"_links":{"self":[{"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/posts\/240159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/comments?post=240159"}],"version-history":[{"count":25,"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/posts\/240159\/revisions"}],"predecessor-version":[{"id":284441,"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/posts\/240159\/revisions\/284441"}],"wp:attachment":[{"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/media?parent=240159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/categories?post=240159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.systutorials.com\/wp-json\/wp\/v2\/tags?post=240159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}