{"id":1726,"date":"2020-01-11T17:19:56","date_gmt":"2020-01-11T17:49:56","guid":{"rendered":"https:\/\/ultering.com\/it4us\/?p=1726"},"modified":"2020-08-30T16:16:34","modified_gmt":"2020-08-30T16:46:34","slug":"vim-editor-commands-summary","status":"publish","type":"post","link":"https:\/\/ultering.com\/it4us\/?p=1726","title":{"rendered":"VIM: COMMANDS&#8217; SUMMARY &#8211; CHEAT SHEET"},"content":{"rendered":"\r\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e451f0798c3\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e451f0798c3\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#NAVIGATION\" title=\"#NAVIGATION\">#NAVIGATION<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#CMDS_%E2%80%93_COMPLEMENTARY\" title=\"#CMDS &#8211; COMPLEMENTARY\">#CMDS &#8211; COMPLEMENTARY<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#validating_the_punctuation_matching\" title=\"#validating the punctuation matching\">#validating the punctuation matching<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#WINDOWS_SPLITTING\" title=\"#WINDOWS SPLITTING\">#WINDOWS SPLITTING<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#AUTO-COMPLETION\" title=\"#AUTO-COMPLETION\">#AUTO-COMPLETION<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#SEARCH\" title=\"#SEARCH\">#SEARCH<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#IGNORE_%E2%80%93_NON_SENSITIVE_CASE\" title=\"#IGNORE &#8211; NON SENSITIVE CASE\">#IGNORE &#8211; NON SENSITIVE CASE<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#cw\" title=\"#cw\">#cw<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Commands_and_regex_examples\" title=\"#Commands and regex examples:\">#Commands and regex examples:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#MARKS\" title=\"#MARKS\">#MARKS<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#copying_a_block\" title=\"#copying a block\">#copying a block<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#REPLACING\" title=\"#REPLACING\">#REPLACING<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#syntax\" title=\"#syntax\">#syntax<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#replace_str_or_substring\" title=\"#replace str or substring\">#replace str or substring<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#replace_just_words\" title=\"#replace just words\">#replace just words<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#replace_initial_words\" title=\"#replace initial words\">#replace initial words<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#replace_lines_that_contain_just_the_word\" title=\"#replace lines that contain just the word\">#replace lines that contain just the word<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#%E2%80%9DEscaped%E2%80%9D_characters_or_metacharacters\" title=\"#&#8221;Escaped&#8221; characters or metacharacters\">#&#8221;Escaped&#8221; characters or metacharacters<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Quantifiers_Greedy_and_Non-Greedy\" title=\"#Quantifiers, Greedy and Non-Greedy\">#Quantifiers, Greedy and Non-Greedy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Finding_duplicate_wordsEdit\" title=\"#Finding duplicate wordsEdit\">#Finding duplicate wordsEdit<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Finding_this_or_that_string\" title=\"#Finding this or that string\">#Finding this or that string<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Finding_this_or_that_word\" title=\"#Finding this or that word\">#Finding this or that word<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Replacement_using_the_last_search\" title=\"#Replacement using the last search\">#Replacement using the last search<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#TEXT_EDITIONfmtTABS\" title=\"#TEXT EDITION\/#fmt\/#TABS\">#TEXT EDITION\/#fmt\/#TABS<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#out_insert_mode\" title=\"#out insert mode\">#out insert mode<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#ESC_MODE\" title=\"#ESC MODE\">#ESC MODE<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Using_buffer_%E2%80%93_marks\" title=\"#Using buffer &#8211; marks\">#Using buffer &#8211; marks<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Using_visual_mode\" title=\"#Using visual mode\">#Using visual mode<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#KEYBOARD_TIPS\" title=\"#KEYBOARD TIPS\">#KEYBOARD TIPS<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#CONFIGURATION\" title=\"#CONFIGURATION\">#CONFIGURATION<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#TEMPLATE_0_simplest\" title=\"#TEMPLATE #0 (simplest)\">#TEMPLATE #0 (simplest)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#TEMPLATE_1\" title=\"#TEMPLATE #1\">#TEMPLATE #1<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#TEMPLATE_2\" title=\"#TEMPLATE #2\">#TEMPLATE #2<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#howto\" title=\"#howto\">#howto<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#COMMANDS_ESC_MODE\" title=\"#COMMANDS (ESC MODE)\">#COMMANDS (ESC MODE)<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#MOST_USED\" title=\"#MOST USED\">#MOST USED<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#EXTENDED_LIST\" title=\"#EXTENDED LIST\">#EXTENDED LIST<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-38\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#forcing_syntax\" title=\"#forcing syntax\">#forcing syntax<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-39\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#VAGRANT_CONSOLE\" title=\"#VAGRANT CONSOLE\">#VAGRANT CONSOLE<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-40\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#out_insert_mode-2\" title=\"#out insert mode\">#out insert mode<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-41\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#delete\" title=\"#delete\">#delete<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-42\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#VIM_RCCONFIGSETUP\" title=\"#.VIM RC\/#CONFIG\/#SETUP\">#.VIM RC\/#CONFIG\/#SETUP<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-43\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#TEXT_INDENT\" title=\"#TEXT INDENT\">#TEXT INDENT<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-44\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#In_insert_mode_to_tab\" title=\"#In insert mode, to tab:\">#In insert mode, to tab:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-45\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#_%E2%80%98_mode_%E2%80%93_summary\" title=\"# &#8216;:&#8217; mode &#8211; summary\"># &#8216;:&#8217; mode &#8211; summary<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-46\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#_%E2%80%98_mode_%E2%80%93_detailed\" title=\"# &#8216;:&#8217; mode &#8211; detailed:\"># &#8216;:&#8217; mode &#8211; detailed:<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-47\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#REGEX\" title=\"#REGEX\">#REGEX<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-48\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#SYMBOLS\" title=\"#SYMBOLS:\">#SYMBOLS:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-49\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#POSIX\" title=\"#POSIX\">#POSIX<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-50\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Ctrl_commands\" title=\"#Ctrl commands (^)\">#Ctrl commands (^)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-51\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#standard\" title=\"#standard\">#standard<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-52\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#VISUAL_MODE\" title=\"#VISUAL MODE\">#VISUAL MODE<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-53\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#SELECTING_UP_TO_THE_FIRST_PATTERN\" title=\"#SELECTING UP TO THE FIRST PATTERN\">#SELECTING UP TO THE FIRST PATTERN<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-54\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#OPENING_MANY_DOCS\" title=\"#OPENING MANY DOCS\">#OPENING MANY DOCS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-55\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#swap_file\" title=\"#swap file\">#swap file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-56\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#UTILS\" title=\"#UTILS\">#UTILS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-57\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#abbreviations\" title=\"#abbreviations\">#abbreviations<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-58\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#recovering_failures\" title=\"#recovering failures\">#recovering failures<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-59\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#tt%E2%80%9D_buffer_operations\" title=\"#tt&#8221; (buffer operations)\">#tt&#8221; (buffer operations)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-60\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#macro_to_key_shortcuts\" title=\"#macro to key shortcuts\">#macro to key shortcuts<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-61\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#Summary\" title=\"#Summary\">#Summary<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-62\" href=\"https:\/\/ultering.com\/it4us\/?p=1726\/#macro_to_inserting_mode\" title=\"#macro to inserting mode\">#macro to inserting mode<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"NAVIGATION\"><\/span>#NAVIGATION<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>@SEE:<br \/><a href=\"https:\/\/www.thegeekstuff.com\/2009\/03\/8-essential-vim-editor-navigation-fundamentals\/\">8 Essential Vim Editor Navigation Fundamentals<\/a><\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>k \u2013 navigate upwards<\/li>\r\n<li>j \u2013 navigate downwards<\/li>\r\n<li>l \u2013 navigate right side<\/li>\r\n<li>h \u2013 navigate left side<\/li>\r\n<li>0 \u2013 go to the starting of the current line.<\/li>\r\n<li>^ \u2013 go to the first non blank character of the line.<\/li>\r\n<li>$ \u2013 go to the end of the current line.<\/li>\r\n<li>g_ \u2013 go to the last non blank character of the line.<\/li>\r\n<li>H \u2013 Go to the first line of current screen.<\/li>\r\n<li>M \u2013 Go to the middle line of current screen.<\/li>\r\n<li>L \u2013 Go to the last line of current screen.<\/li>\r\n<li>ctrl+f \u2013 Jump forward one full screen.<\/li>\r\n<li>ctrl+b \u2013 Jump backwards one full screen<\/li>\r\n<li>ctrl+d \u2013 Jump forward (down) a half screen<\/li>\r\n<li>ctrl+u \u2013 Jump back (up) one half screen<\/li>\r\n<li>e \u2013 go to the end of the current word.<\/li>\r\n<li>E \u2013 go to the end of the current WORD.<\/li>\r\n<li>b \u2013 go to the previous (before) word.<\/li>\r\n<li>B \u2013 go to the previous (before) WORD.<\/li>\r\n<li>w \u2013 go to the next word.<\/li>\r\n<li>W \u2013 go to the next WORD.<\/li>\r\n<li><strong>{<\/strong>\u00a0\u2013 Go to the beginning of the current paragraph. By pressing { again and again move to the previous paragraph beginnings.<\/li>\r\n<li><strong>}<\/strong>\u00a0\u2013 Go to the end of the current paragraph. By pressing } again and again move to the next paragraph end, and again.<\/li>\r\n<li>N% \u2013 Go to the Nth percentage line of the file.<\/li>\r\n<li>NG \u2013 Go to the Nth line of the file.<\/li>\r\n<li>G \u2013 Go to the end of the file.<\/li>\r\n<li>`\u201d \u2013 Go to the position where you were in NORMAL MODE while last closing the file.<\/li>\r\n<li>`^ \u2013 Go to the position where you were in INSERT MODE while last closing the file.<\/li>\r\n<li>g \u2013 Go to the beginning of the file.<\/li>\r\n<li><strong>%<\/strong>\u00a0\u2013 Go to the matching braces, or parenthesis inside code.<\/li>\r\n<li>Use &#8216;.&#8217; to repeat the last command.<br \/>The command will be repeated considering the current caret position.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CMDS_%E2%80%93_COMPLEMENTARY\"><\/span>#CMDS &#8211; COMPLEMENTARY<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>Vu Lowercase line<br \/>VU Uppercase line<br \/>g~~ Invert case<br \/>vEU Switch word to uppercase<br \/>vE~ Modify word case<br \/>ggguG Set all text to lowercase<br \/>:set ignorecase Ignore case in searches<br \/>:set smartcase Ignore case in searches excepted if an uppercase letter is used<br \/>:%s\/\\&lt;.\/\\u&amp;\/g Sets first letter of each word to uppercase<br \/>:%s\/\\&lt;.\/\\l&amp;\/g Sets first letter of each word to lowercase<br \/>:%s\/.*\/\\u&amp; Sets first letter of each line to uppercase<br \/>:%s\/.*\/\\l&amp; Sets first letter of each line to lowercase<\/p>\r\n\r\n\r\n\r\n<p>:1,10 w outfile Saves lines 1 to 10 in outfile<br \/>:1,10 w &gt;&gt; outfile Appends lines 1 to 10 to outfile<br \/>:r infile Insert the content of infile<br \/>:23r infile Insert the content of infile under line 23<\/p>\r\n\r\n\r\n\r\n<p>Vim +N filename: Go to the Nth line of the file after opening it.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">vim +10 \/etc\/passwd<\/pre>\r\n\r\n\r\n\r\n<p>Vim +\/pattern filename: Go to the particular pattern\u2019s line inside the file, first occurrence from first. In the following example, it will open the README file and jump to the first occurrence of the word \u201cinstall\u201d.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">vim +\/install README<\/pre>\r\n\r\n\r\n\r\n<p><br \/>Vim +?patten filename: Go to the particular pattern\u2019s line inside the file, first occurrence from last. In the following example, it will open the README file and jump to the last occurrence of the word \u201cbug\u201d.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">vim +?bug README<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"validating_the_punctuation_matching\"><\/span>#validating the punctuation matching<span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n\r\n\r\n\r\n<p>Type &#8216;%&#8217; over the char to find its matcher: ( [ {<br \/>The vim lights a caret to its respective closing matcher character.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"WINDOWS_SPLITTING\"><\/span>#WINDOWS SPLITTING<span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n\r\n\r\n\r\n<p>:split to split window<br \/>:q close the current window<br \/>:^Wj move to the botton window<br \/>:^Wk move to the upper window<br \/>:q! close the window that contains the cursor<\/p>\r\n\r\n\r\n\r\n<p>:e filename Edit filename in current window<br \/>:split filename Split the window and open filename<br \/>ctrl-w up arrow Puts cursor in top window<br \/>ctrl-w ctrl-w Puts cursor in next window<br \/>ctrl-w_ Maximise current window<br \/>ctrl-w= Gives the same size to all windows<br \/>10 ctrl-w+ Add 10 lines to current window<br \/>:vsplit file Split window vertically<br \/>:sview file Same as :split in readonly mode<br \/>:hide Close current window<br \/>nly Close all windows, excepted current<br \/>:b 2 Open #2 in this window<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"AUTO-COMPLETION\"><\/span>#AUTO-COMPLETION<span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n\r\n\r\n\r\n<p>Ctrl+n Ctrl+p (in insert mode) Complete word<br \/>Ctrl+x Ctrl+l Complete line<br \/>:set dictionary=dict Define dict as a dictionnary<br \/>Ctrl+x Ctrl+k Complete with dictionnary<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"SEARCH\"><\/span>#SEARCH<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><strong>\/i<\/strong>\u00a0\u2013 Search for a pattern which will you take you to the next occurrence of it.<\/li>\r\n<li><strong>?i<\/strong>\u00a0\u2013 Search for a pattern which will you take you to the previous occurrence of it.<\/li>\r\n<li><strong>*\u00a0<\/strong>\u2013 Go to the next occurrence of the current word under the cursor.<\/li>\r\n<li><strong>#\u00a0<\/strong>\u2013 Go to the previous occurrence of the current word under the cursor.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>set hls = (hlsearch) highligh search<br \/>set is = (incsearch) incremental search &#8211; show result while you&#8217;re typing.<br \/>set magic\/nomagic =<br \/>the first is the default option, the second generates expressions with too much scapes<br \/>characters not useful to other programs. Use the default.<br \/>:\/ or \ud83d\ude15 = search<br \/>n = next ocurrence<br \/>shift + n = prior ocurrence<br \/>:s\/\/\/ = replacement<br \/>. = present line<br \/>$ = last line<br \/>% = all file.<br \/>:s\/a\/b\/g = change all &#8216;a&#8217; by &#8216;b&#8217; in the line.<br \/>:1,5s\/^\/#\/ = comment the first 5 lines.<br \/>:.,$s\/^\/#\/ = comment up to the end of the line.<br \/>:1,$s\/^\/#\/ comment up to the end of the file<br \/>:%s\/^.\/\/g deletes the first letter of each line<br \/>:%s\/^.\/\\u&amp;\/c turns to uppercase the first char.<br \/>:%s\/^.\/\\l&amp;\/c turns to lowercase the first char.<\/p>\r\n<p><strong>Notes:<\/strong><br \/>The &#8216;c&#8217; at the end of the command, produces a prompt to confirm the operation.<br \/>The &#8216;p&#8217; prints line after switching.<br \/>The &#8216;g&#8217; switches all occurrences.<br \/>Check other modifiers typing: :help :s_flags<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"IGNORE_%E2%80%93_NON_SENSITIVE_CASE\"><\/span>#IGNORE &#8211; NON SENSITIVE CASE<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>%s\/foo\/fooo\/gi = set ignore case<br \/>Dynamic search: under ESC mode type: \/string_to_search (not using &#8221; : mode&#8221;). Then press enter to go the found string.<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"cw\"><\/span>#cw<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>Searching and switching with next and cw:<br \/>1. Set caret on the word to be searched and switched.<br \/>2. Esc, cw, type the replacement.<br \/>3. On Esc mode, type &#8216;n&#8217; (next)<br \/>4. Found the word, type &#8216;.&#8217; (dot).<br \/>5. Go to step 3 until no more occurrences.<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Commands_and_regex_examples\"><\/span>#Commands and regex examples:<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>slash: \/ the scape is: \\\/ (it&#8217;s not a &#8216;v&#8217; letter, but a slash plus a backslash)<br \/>backslash \\ : the scape is: \\\\<br \/>SHIFT * over the word (note the expression generated and copy to do it manually if necessary)<br \/>:# searches all matches to the string pointed by caret<br \/>:\/word Search ?word? from top to bottom<br \/>:?word Search ?word? from bottom to top<br \/>n repeat the last command<br \/>:t(char) searches char on the line ahead caret pos<br \/>:T(char) searches char on the line behind caret pos<br \/>:; repeats the last command to t or T forward caret pos<br \/>:, repeats the last command to t or T forward caret pos<br \/>:s\/a\/b\/ searches the first occurrence on line and switches a by b.<br \/>:s\/a\/b\/g searches the all occurrences on line and switches a by b.<br \/>:%s\/a\/b\/g searches the all occurrances on text and switches a by b.<br \/>\/jo[ha]n Search ?john? or ?joan?<br \/>\/\\&lt; the Search ?the?, ?theatre? or ?then?<br \/>\/the\\&gt; Search ?the? or ?breathe?<br \/>\/\\&lt; the\\&gt; Search ?the?<br \/>\/\\&lt; ?.\\&gt; Search all words of 4 letters<br \/>\/\\\/ Search ?fred? but not ?alfred? or ?frederick?<br \/>\/fred\\|joe Search ?fred? or ?joe?<br \/>\/\\&lt;\\d\\d\\d\\d\\&gt; Search exactly 4 digits<br \/>\/^\\n\\{3} Find 3 empty lines<br \/>:bufdo \/searchstr\/ Search in all open files<br \/>Ctrl+a Increment number under the cursor<br \/>Ctrl+x Decrement number under cursor<br \/>ggVGg? Change text to Rot13<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"MARKS\"><\/span>#MARKS<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>To mark initial position &#8211; set the cursor on the position out of Insert mode and type &#8216;m&#8217; and the mark name(mMARK).<br \/>Example: mq (makes a mark identified by &#8216;q&#8217;).<br \/>To mark final position: command&#8217;mark_letter<br \/>to move use d&#8217;mark_letter (or c)<br \/>to copy use y&#8217;mark_letter<br \/>to paste use just p.<br \/>Example:<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"copying_a_block\"><\/span>#copying a block<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>select the 1st position and type: m&#8217;a<br \/>go to the last position and type: a&#8217;y<br \/>go to the new position where the block is supposed to be copied to and type: p<br \/>d&#8217;q (deletes from the mark &#8216;q&#8217; to the end position (current caret pos)).<br \/>y&#8217;q (copies from the mark &#8216;q&#8217; to the end position (current caret pos)).<br \/>Navigating using marks:<br \/>&#8216;mark_letter<\/p>\r\n<p><strong>Example:<\/strong><br \/>&#8216;r (goes to mark r)<br \/>mk Marks current position as k<br \/>&#8216;k Moves cursor to mark k<br \/>d&#8217;k Delete all until mark k<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"REPLACING\"><\/span>#REPLACING<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>Switches the first double hashes (&#8216;##&#8217;) by one.<br \/>Notice that the slashes (&#8216;\/&#8217;) were substituted by colons.<br \/>158 # enable this line if using txt2html pre-parsing, and disable the line above it<br \/>159 #done &lt; &#8220;$TEMP&#8221;<br \/>160<br \/>~<br \/>:158,159s:^##:#:<\/p>\r\n\r\n\r\n\r\n<p>The search and replace function is accomplished with the :s command.<br \/>It is commonly used in combination with ranges or the :g command (below).<\/p>\r\n\r\n\r\n\r\n<p>:s\/pattern\/string\/flags Replace pattern with string according to flags.<br \/>g Flag &#8211; Replace all occurrences of pattern<br \/>c Flag &#8211; Confirm replaces.<br \/>&amp; Repeat last :s command<\/p>\r\n\r\n\r\n\r\n<p>%s\/replaced\/replacement\/g (%..g &#8211; replaces across full text)<\/p>\r\n<p>Suppose you want to change the last slash on this command switching to backslash: | sed &#8220;s\/\u00f9\/&amp;ugrave;&#8221; \/.<br \/>Issue the following command:<\/p>\r\n<p>:%s\/[\/]$\/\\\\\/g<br \/>Replacing Examples:<br \/>:%s\/old\/new\/g Replace all occurences of ?old? by ?new? in file<br \/>:%s\/old\/new\/gw Replace all occurences with confirmation<br \/>:2,35s\/old\/new\/g Replace all occurences between lines 2 and 35<br \/>:5,$s\/old\/new\/g Replace all occurences from line 5 to EOF<br \/>:%s\/^\/hello\/g Replace the begining of each line by ?hello?<br \/>:%s\/$\/Harry\/g Replace the end of each line by ?Harry?<br \/>:%s\/onward\/forward\/gi Replace ?onward? by ?forward? , case unsensitive<br \/>:%s\/ *$\/\/g Delete all white spaces<br \/>:g\/string\/d Delete all lines containing ?string?<br \/>:v\/string\/d Delete all lines containing which didn&#8217;t contain ?string?<br \/>:s\/Bill\/Steve\/ Replace the first occurence of ?Bill? by ?Steve? in current line<br \/>:s\/Bill\/Steve\/g Replace ?Bill? by ?Steve? in current line<br \/>:%s\/Bill\/Steve\/g Replace ?Bill? by ?Steve? in all the file<br \/>:%s\/\\r\/\/g Delete DOS carriage returns (^M)<br \/>:%s\/\\r\/\\r\/g Transform DOS carriage returns in returns<br \/>:%s#&lt;[^&gt;]\\+&gt;##g Delete HTML tags but keeps text<br \/>:%s\/^\\(.*\\)\\n\\1$\/\\1\/ Delete lines which appears twice<\/p>\r\n\r\n\r\n\r\n<p>@SEE:<br \/><a href=\"http:\/\/vim.wikia.com\/wiki\/Search_patterns\">vim.wikia.com\/wiki\/Search_patterns<\/a><br \/><a href=\"http:\/\/vimregex.com\/\">vimregex.com\/<\/a><br \/><a href=\"http:\/\/vim.wikia.com\/wiki\/Search_patterns\">vim.wikia.com\/wiki\/Search_patterns<\/a><\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"syntax\"><\/span>#syntax<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>:range s[ubstitute]\/pattern\/string\/cgiI<br \/>For each line in the range replace a match of the pattern with the string where:<br \/>c Confirm each substitution<br \/>g Replace all occurrences in the line (without g &#8211; only first).<br \/>i Ignore case for the pattern.<br \/>I Don&#8217;t ignore case for the pattern.<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"replace_str_or_substring\"><\/span><span style=\"font-size: 1.6rem;\">#replace str or substring<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>:s\/vi\/VIM\/g<br \/>:1,5 s\/^\/#\/ = comment the first 5 lines.<br \/>***WRONG :1,5s\/^\/#\/ = comment the first 5 lines.<br \/>:%s\/a\/b\/g searchs the all occurrances on text and switches a by b.<br \/>:2,35 s\/old\/new\/g Replace all occurences between lines 2 and 35<br \/>:199,$ s\/local\/replace\/g<br \/>***WRONG :199,$ %s\/local\/replace\/g<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"replace_just_words\"><\/span>#replace just words<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>:s\/\\&lt;vi\\&gt;\/VIM\/g<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"replace_initial_words\"><\/span>#replace initial words<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>:s\/^vi\\&gt;\/VIMg<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"replace_lines_that_contain_just_the_word\"><\/span>#replace lines that contain just the word<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>s\/^vi$\/VIMg<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"%E2%80%9DEscaped%E2%80%9D_characters_or_metacharacters\"><\/span>#&#8221;Escaped&#8221; characters or metacharacters<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>. any character except new line<\/p>\r\n<p>\\s whitespace character<br \/>\\S non-whitespace character<br \/>\\d digit<br \/>\\D non-digit<br \/>\\x hex digit<br \/>\\X non-hex digit<br \/>\\o octal digit<br \/>\\O non-octal digit<br \/>\\h head of word character (a,b,c&#8230;z,A,B,C&#8230;Z and _)<br \/>\\H non-head of word character<br \/>\\p printable character<br \/>\\P like \\p, but excluding digits<br \/>\\w word character<br \/>\\W non-word character<br \/>\\a alphabetic character<br \/>\\A non-alphabetic character<br \/>\\l lowercase character<br \/>\\L non-lowercase character<br \/>\\u uppercase character<br \/>\\U non-uppercase character<\/p>\r\n\r\n\r\n\r\n<p><strong>Examples<\/strong><\/p>\r\n\r\n\r\n\r\n<p>&#8211; So, to match a date like 09\/01\/2000<br \/>\\d\\d\/\\d\\d\/\\d\\d\\d\\d<\/p>\r\n\r\n\r\n\r\n<p>&#8211; To match 6 letter word starting with a capital letter<br \/>\\u\\w\\w\\w\\w\\w<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"Quantifiers_Greedy_and_Non-Greedy\"><\/span><span style=\"font-size: 1.6rem;\">#Quantifiers, Greedy and Non-Greedy<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>* matches 0 or more of the preceding characters, ranges or metacharacters .* matches everything including empty line<br \/>\\+ matches 1 or more of the preceding characters&#8230;<br \/>\\= matches 0 or 1 more of the preceding characters&#8230;<br \/>\\{n,m} matches from n to m of the preceding characters&#8230;<br \/>\\{n} matches exactly n times of the preceding characters&#8230;<br \/>\\{,m} matches at most m (from 0 to m) of the preceding characters&#8230;<br \/>\\{n,} matches at least n of of the preceding characters&#8230;<br \/>where n and m are positive integers (&gt;0)<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Finding_duplicate_wordsEdit\"><\/span>#Finding duplicate wordsEdit<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>\\(\\&lt;\\w\\+\\&gt;\\)\\_s*\\1<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Finding_this_or_that_string\"><\/span>#Finding this or that string<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>\/red\\|green\\|blue\/<\/p>\r\n\r\n\r\n\r\n<p>&#8211; To replace all instances of &#8220;red&#8221; or &#8220;green&#8221; or &#8220;blue&#8221; with &#8220;purple&#8221;, enter:<br \/>:%s\/red\\|green\\|blue\/purple\/g<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Finding_this_or_that_word\"><\/span>#Finding this or that word<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>\\&lt;\\(red\\|green\\|blue\\)\\&gt;<br \/>s:\\&lt;\\(red\\|green\\|blue\\)\\&gt;:g<br \/>@FAIL: vi\/aix<\/p>\r\n\r\n\r\n\r\n<p>In a pattern, \\&lt; and \\&gt; respectively specify the beginning and end of a word, while \\( and \\) respectively specify the<br \/>beginning and end of a group (the pattern \\&lt;red\\|green\\|blue\\&gt;,<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"Replacement_using_the_last_search\"><\/span>#Replacement using the last search<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>After searching with the command \/\\&lt;\\(red\\|green\\|blue\\)\\&gt; you could change the whole words &#8220;red&#8221; or &#8220;green&#8221; or &#8220;blue&#8221; to &#8220;purple&#8221; by<br \/>entering the following (the search pattern is empty in this command, so it uses the last search):<br \/>:%s\/\/purple\/g<\/p>\r\n\r\n\r\n\r\n<p>In a substitute, you can use &amp; in the replacement to mean the &#8220;whole matched pattern&#8221; (everything that was found).<br \/>For example, the following will insert quotes around all occurrences of the whole words &#8220;red&#8221; and &#8220;green&#8221; and &#8220;blue&#8221;:<br \/>:%s\/\\&lt;\\(red\\|green\\|blue\\)\\&gt;\/&#8221;&amp;&#8221;\/g<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TEXT_EDITIONfmtTABS\"><\/span>#TEXT EDITION\/#fmt\/#TABS<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p><strong>***NOTE:\u00a0<\/strong>alternatively try: Fn + dd<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"out_insert_mode\"><\/span>#out insert mode<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>dd = delete<br \/>dw = delete word<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"ESC_MODE\"><\/span>#ESC MODE<span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n\r\n\r\n\r\n<p>:10 del 15 (deletes from 10th line up to 15th)<br \/>:10,12 co 17 (copies line 10 to 12 and pastes them under 17)<br \/>:10,12 mo 17 (copies line 10 to 12 and moves them under 17)<br \/>:d$ (deletes up to the end of the line)<br \/>:d# (deletes the lines between two matches to the string pointed by the caret)<br \/>:d3 (deletes 3 chars)<br \/>:d(Arrow right\/left) (delete char on right\/left)<\/p>\r\n\r\n\r\n\r\n<p>yy copies the current line to memory<br \/>3yy copies the next 3 lines to memory<br \/>[n]p pastes after cursor position repeating n times<br \/>[n]P pastes before cursor position repeating n times<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"Using_buffer_%E2%80%93_marks\"><\/span>#Using buffer &#8211; marks<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>set initial: mMark_letter<br \/>set final: command&#8217;mark_letter Example: d&#8217;q (delete from mark q up to the current caret position)<br \/>&#8220;rdd: deletes line and save to buffer r<br \/>&#8220;x5yy: copies 5 lines to buffer x<br \/>&#8220;bdw: cuts the word and saves to buffer w<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"Using_visual_mode\"><\/span>#Using visual mode<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>ESC mode. Type V and select the area.<br \/>y or x to yield or cut, respectively.<br \/>To past, use p.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"KEYBOARD_TIPS\"><\/span>#KEYBOARD TIPS<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>If using notebooks without numeric section, try:<br \/>Fn + shortcut.<br \/>Example: Fn + k<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CONFIGURATION\"><\/span>#CONFIGURATION<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TEMPLATE_0_simplest\"><\/span>#TEMPLATE #0 (simplest)<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>syntax on<br \/>set nu &#8220;enable enumeration<br \/>&#8220;set nonu &#8220;disable enumeration<br \/>set autoindent<br \/>set cmdheight=2 &#8220;command bar is 2 high<br \/>set backspace=indent,eol,start &#8220;set backspace function<br \/>set hlsearch &#8220;highlight searched things<br \/>set incsearch &#8220;incremental search<br \/>&#8220;set ignorecase &#8220;ignore case<br \/>set textwidth=0<br \/>set autoread &#8220;auto read when file is changed from outside<br \/>set ruler &#8220;show current position<br \/>set showmatch &#8220;show maching braces<br \/>set shiftwidth=2<br \/>set tabstop=2<br \/>set t_Co=256<br \/>set vb<br \/>&#8220;set gfn=Courier\/7<br \/>&#8220;set spell<br \/>&#8221; Toggle spell checking on and off with `,s`<br \/>let mapleader = &#8220;,&#8221;<br \/>nmap &lt;silent&gt; &lt;leader&gt;s :set spell!&lt;CR&gt;<br \/>&#8221; Set region to English USA<br \/>set spelllang=en_us<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TEMPLATE_1\"><\/span>#TEMPLATE #1<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p><strong>*** IMPORTANT NOTES:<\/strong><br \/>1. Edit .vimrc and switch &#8220;^M&#8221; to Ctrl+V ENTER. This cmd means &#8220;\\n&#8221;.<br \/>2. Switch the similar matches below as follow, by example:<br \/>^O = Ctrl+V Ctrl+O<br \/>^U = Ctrl+V Ctrl+U<br \/>so on&#8230; The &#8220;^&#8221; denotes the &#8220;Ctrl+V&#8221; cmd, a vim&#8217;s special caracter for .vimrc configuration.<\/p>\r\n\r\n\r\n\r\n<p>&#8220;last update: 05\/07\/10 13:45<br \/>syntax on<br \/>set nu title<br \/>set autoindent<br \/>set cmdheight=2 &#8220;command bar is 2 high<br \/>set backspace=indent,eol,start &#8220;set backspace function<br \/>set hlsearch &#8220;highlight searched things<br \/>set incsearch &#8220;incremental search<br \/>&#8220;set ignorecase &#8220;ignore case<br \/>set textwidth=0<br \/>set autoread &#8220;auto read when file is changed from outside<br \/>set ruler &#8220;show the current position<br \/>&#8220;set nu &#8220;show line number<br \/>set showmatch &#8220;show matching braces<br \/>set shiftwidth=2<br \/>set tabstop=2<br \/>set t_Co=256<br \/>set vb<br \/>&#8220;set gfn=Courier\/7<br \/>map ^O :set nu<br \/>map ^U :set nonu<br \/>map ^E :set spell<br \/>map ^N :set nospell<br \/>&#8221; converts windows eol to unix<br \/>map ^K :set ff=unix<br \/>map! tthsh #!\/bin\/sh^M# last update:^M# script name:^M# target:^M# syntax:^M#^M# alsdias &#8211; ^M# History:<br \/>map! @@@ alsdias@yahoo.com.br<br \/>&#8220;set spell<br \/>&#8221; Toggle spell checking on and off with `,s`<br \/>let mapleader = &#8220;,&#8221;<br \/>nmap &lt;silent&gt; &lt;leader&gt;s :set spell!&lt;CR&gt;<br \/>&#8221; Set region to English USA<br \/>set spelllang=en_us<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TEMPLATE_2\"><\/span>#TEMPLATE #2<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>standard<br \/>@SEE:<br \/>&#8211; methods of configuring:<br \/>@@bb#sslinux1;&lt;vim.htm&lt;configuration &#8211; methods<br \/>@SYNC: if compatible with vi:<br \/>.vim<br \/>@@vi;;;<\/p>\r\n\r\n\r\n\r\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\r\n<p>.exrc (example of vi&#8217;s config file for IBM&#8217;s AIX servers, using SSH terminal)<\/p>\r\n<\/blockquote>\r\n\r\n\r\n\r\n<p>&#8221; avoid using override (!) for each command that changes the file, otherwise to save you have to do w! or x!<\/p>\r\n\r\n\r\n\r\n<p>syntax on<br \/>&#8220;line number on\/off<br \/>set nu<br \/>set autoindent<br \/>set tabstop=2<br \/>set history=32<br \/>set window=42<br \/>set shiftwidth=2<br \/>set hardtabs=2<br \/>set scroll=21<br \/>&#8220;set directory=\/var\/tmp<br \/>&#8221; do not uncomment &#8211; @FAIL<br \/>&#8220;set directory=\/cygdrive\/f\/portables\/shell\/tmp<br \/>&#8220;mapping section &#8211; make sure that the customized shortcut does not conflict with the standard and :set commands keep a space before ENTER.<br \/>map ^A :set nu ^M<br \/>map ^C :set nonu ^M<br \/>&#8220;show EOL<br \/>map ^M :set list ^M<br \/>map ^R :set nolist ^M<br \/>map ^T ^[!^M\/cygdrive\/f\/portables\/shell\/sys -lu ^M<br \/>map ^H ^[!^M\/cygdrive\/f\/portables\/shell\/sys -hsh ^M<br \/>map ^O ^[!^M\/cygdrive\/f\/portables\/shell\/sys -ts ^M<br \/>&#8221; converts windows eol to unix<br \/>map ^K :set ff=unix<br \/>map ^X :syntax off ^M<br \/>ab @@@ Andre Luiz da Silva Dias\/Brazil\/Contr\/IBM, alsdias@br.ibm.com<br \/>ab my@ aluizsilvadias@gmail.com<\/p>\r\n\r\n\r\n\r\n<p><strong>*** NOTE:\u00a0<\/strong> use space before the final ENTER command, otherwise it interprets as a Ctrl+M command.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"howto\"><\/span>#howto<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>1- create a file with this content:<br \/>vi ~\/.vimrc<br \/>2- fix the mapping chars under mapping section<br \/>For instance, replace ^N by: Ctrl+V N<br \/>3- overwrite vi&#8217;s config:<br \/>cat exrc &gt; .exrc<br \/>4- if vi fails to start:<br \/>This procedure helps just in case a configuration fails.<br \/>If vi doesn&#8217;t start, do:<br \/>echo &#8220;&#8221; &gt; .exrc<br \/>Edit the template:<br \/>vi exrc<br \/>Comment the line that it is probably causing the malfunction.<br \/>Repeat step 3.<\/p>\r\n\r\n\r\n\r\n<p><strong>***NOTE:<\/strong><br \/>Before creating a shortcut, check if it doesn&#8217;t conflict with the standard ones.<br \/>@GOTO:__control<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"COMMANDS_ESC_MODE\"><\/span>#COMMANDS (ESC MODE)<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"MOST_USED\"><\/span>#MOST USED<span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n\r\n\r\n\r\n<p>&#8220;line number<br \/>set nu (turn no)<br \/>set nonu (turn off)<\/p>\r\n\r\n\r\n\r\n<p>syntax on<br \/>set nu ru vb title<br \/>set autoread<br \/>set tabstop=2<br \/>set incsearch<br \/>set hlsearch<br \/>set autoindent<br \/>set ic<br \/>set noic<\/p>\r\n\r\n\r\n\r\n<p><strong>NOTE:\u00a0<\/strong><br \/>To be used with ESC + : mode or into .vimrc file.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"EXTENDED_LIST\"><\/span>#EXTENDED LIST<span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n\r\n\r\n\r\n<p>The commands below may be used in configuration file .vimrc (or .exrc for vi) without the colon (:). Example: <em>set nu<\/em><\/p>\r\n\r\n\r\n\r\n<p>:set wm=10 Set Wrap Margin 10 spaces from right edge of screen<br \/>:set wm=0 Turn off Wrap Margin<br \/>:set all Display all options<br \/>:set Display current settings of options<br \/>:set nooption Unset option<br \/>:set ai Set Auto Indentation during text entry<br \/>:set ic Set Ignore Case during searches<br \/>:set nu Show line Numbers<br \/>:set sm Show Matching ( or { when ) or } is entered<br \/>:set wm=10 Set Wrap Margin 10 spaces from right edge of screen<\/p>\r\n\r\n\r\n\r\n<p>autoindent noai Supply indentation automatically<br \/>autowrite noaw Automatically write to file while editing<br \/>ignorecase noic Ignore case when searching<br \/>lisp nolisp (, {, ), and } commands deal with S-expressions<br \/>list nolist Tabs print as ^I; end of lines marked with $<br \/>magic nomagic The characters ., [, and * are special (&#8220;magical&#8221;) in scans<br \/>number nonu Lines are displayed prefixed with their line numbers<br \/>paragraphs para=IPLPPPQPbpP LI Macro names which start paragraphs<br \/>redraw nore Simulate a smart terminal on a dumb terminal<br \/>sections sect=NHSHH HU Macro names which start new sections<br \/>shiftwidth sw=8 Shift distance for &lt;, &gt;, and other &#8220;shift&#8221; commands<br \/>showmatch nosm Show matching ( or { locations as ) or } is typed, for example<br \/>showmode nosmd Show input mode description<br \/>slowopen slow Postpone display updates during inserts<br \/>term dumb The kind of terminal you are using<\/p>\r\n\r\n\r\n\r\n<p>\/ on just esc mode = dynamic search (like opera&#8217;s search)<br \/>DD = d$<br \/>^ww = deletes char<br \/>SHIFT i = insert a char and return to esc mode<br \/>\/\/ = repeats last search<br \/>&gt; = indents<br \/>CRTL + r = redo<br \/>Put the caret on a string and type &#8216;#&#8217;<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"forcing_syntax\"><\/span>#forcing syntax<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>:set syntax=sh<br \/>:set syntax=perl<br \/>:set syntax=php<br \/>&#8211; enable\/desable syntax<br \/>:set syntax on<br \/>:set syntax off<br \/>:syntax on<br \/>:syntax off<br \/>:set readonly!<br \/>:set autoindent<br \/>:set tabstop=2<br \/>:set history=32<br \/>:set window=42<br \/>:set shiftwidth=2<br \/>:set hardtabs=2<br \/>:set scroll=21<br \/>:set directory=\/var\/tmp<br \/>:set directory=\/cygdrive\/f\/portables\/shell\/tmp-<br \/>&#8211; line number on\/off<br \/>:map ^A :set nu ^M<br \/>:map ^C :set nonu ^M<br \/>&#8211; show EOL<br \/>:map ^M :set list ^M<br \/>:map ^R :set nolist ^M<\/p>\r\n\r\n\r\n\r\n<p>:help for help<br \/>:e# returns to the original text<br \/>:e %.sp opens a file whith the same name plus .sp extension. (% = file name)<br \/>:.= show caret&#8217;s line number<br \/>:ab abbreviation string_to_abbreviate (typing abbreviation in Insert mode restore string)<br \/>:una delete abbreviation<br \/>:set nu, ou set number<br \/>:set noCOMMAND to unset. For instance: set nonu to unset set nu.<br \/>:set cmdheight=2 &#8220;command bar is 2 high<br \/>:set backspace=indent,eol,start &#8220;set backspace function<br \/>:set hlsearch &#8220;highlight searched things<br \/>:set incsearch &#8220;incremental search<br \/>:set ignorecase &#8220;ignore case (or set ic)<br \/>:set noic = unset ignorecase<br \/>:set textwidth=0<br \/>:set autoread &#8220;auto read when file is changed from outside<br \/>:set ruler &#8220;show current position<br \/>:set showmatch &#8220;show maching braces<br \/>:set nu, ou set number<br \/>:set noCOMMAND to unset. For instance: set nonu to unset set nu.<br \/>:set autoread (auto read when file is changed from outside)<br \/>:set tabstop=2<br \/>:set autoindent<br \/>:.= show the current line number<br \/>:r arq reads the arq file and inserts its content from current caret position<br \/>:syntax on|off color syntax<br \/>:e filename Edit filename in current window<br \/>:e! path edits withot saving the prior<br \/>:vb visual bip (turn off audio bip)<br \/>:eb turn on error bip<br \/>:sol column navigation<br \/>:ru shows status line<br \/>:title shows file&#8217;s title<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"VAGRANT_CONSOLE\"><\/span>#VAGRANT CONSOLE<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>Use Fn + shortcut on notebooks without the numeric right section keyboard.<br \/>Navigation: go to _navigation.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"out_insert_mode-2\"><\/span>#out insert mode<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"delete\"><\/span>#delete<span class=\"ez-toc-section-end\"><\/span><\/h4>\r\n\r\n\r\n\r\n<p>Fn+dd = delete\u00a0 full line<br \/>Shift+dd = delete line content<br \/>Fn + D , S+$ = delete from current position up to the end of the line<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"VIM_RCCONFIGSETUP\"><\/span>#.VIM RC\/#CONFIG\/#SETUP<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>set nu<br \/>syntax on<br \/>set autoindent<br \/>set tabstop=2<br \/>set history=32<br \/>set window=42<br \/>set shiftwidth=2<br \/>set hardtabs=2<br \/>set scroll=21<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TEXT_INDENT\"><\/span>#TEXT INDENT<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"In_insert_mode_to_tab\"><\/span>#In insert mode, to tab:<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>^D de-indent current line<br \/>^T indent current line<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"_%E2%80%98_mode_%E2%80%93_summary\"><\/span># &#8216;:&#8217; mode &#8211; summary<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>:set autoindent Turn on auto-indent<br \/>:set smartindent Turn on intelligent auto-indent<br \/>:set shiftwidth=4 Defines 4 spaces as indent size<br \/>ctrl-t, ctrl-d Indent\/un-indent in insert mode<br \/>:set sw=3 # setting number of spaces to indent<br \/>:2,3&gt;&gt; # indenting the block from 2nd to 3rd line.<br \/>:2,3&lt;&lt; # returning the indentation to 2nd up to 3rd line.<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"_%E2%80%98_mode_%E2%80%93_detailed\"><\/span># &#8216;:&#8217; mode &#8211; detailed:<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>:tabnew Creates a new tab<br \/>gt Show next tab<br \/>:tabfirst Show first tab<br \/>:tablast Show last tab<br \/>:tabm n(position) Rearrange tabs<br \/>:tabdo %s\/foo\/bar\/g Execute a command in all tabs<br \/>:tab ball Puts all open files in tabs<br \/>&gt;&gt; Indent line by shiftwidth spaces<br \/>&lt;&lt; De-indent line by shiftwidth spaces<br \/>5&gt;&gt; Indent 5 lines<br \/>5== Re-indent 5 lines<br \/>&gt;% Increase indent of a braced or bracketed block (place cursor on brace first)<br \/>=% Reindent a braced or bracketed block (cursor on brace)<br \/>&lt;% Decrease indent of a braced or bracketed block (cursor on brace)<br \/>]p Paste text, aligning indentation with surroundings<br \/>=i{ Re-indent the &#8216;inner block&#8217;, i.e. the contents of the block<br \/>=a{ Re-indent &#8216;a block&#8217;, i.e. block and containing braces<br \/>=2a{ Re-indent &#8216;2 blocks&#8217;, i.e. this block and containing block<br \/>&gt;i{ Increase inner block indent<br \/>&lt;i{ Decrease inner block indent<\/p>\r\n\r\n\r\n\r\n<p>:%!fmt Align all lines<br \/>5!fmt Align the next 5 lines<\/p>\r\n\r\n\r\n\r\n<p><strong>Notes:<\/strong><br \/><br \/>= is an operator that formats\/indents text.<br \/>i{ is a text object that specifies the surrounding code block. It should be used together with v, =, etc.<br \/>==<br \/>formats the current line.<br \/>gg=G<br \/>whole text<br \/>Enter visual mode (V) , select the text and type &#8216;=&#8217;<br \/>or initial_line,final_line=<br \/>For instance: 1,10=<br \/>i{<br \/>Inner block, which means everything between { and } excluding the brackets. This can also be selected with i} and iB.<br \/>a{<br \/>A block, which means all the code between { and } including the brackets. This can also be selected with a} and aB.<br \/>i(<br \/>Inner parenthesis, meaning everything between ( and ) excluding the parentheses. Can also be selected with i) and ib.<br \/>a(<br \/>Parentheses, meaning everything between ( and ) including the parenthesis. Can also be selected with a) and ab.<br \/>i&lt;<br \/>Inner &lt; &gt; block, meaning everything between &lt; and &gt; excluding the brackets. Can also be selected with i&gt;.<br \/>a&lt;<br \/>A &lt; &gt; block, meaning everything between &lt; and &gt; including the brackets. Can also be selected with a&gt;.<br \/>i[<br \/>Inner [ ] block, meaning everything between [ and ] excluding the square brackets. Can also be selected with i].<br \/>a[<br \/>A [ ] block, meaning everything between [ and ], including the square brackets. This can also be selected with a].<\/p>\r\n\r\n\r\n\r\n<p>whole text<br \/>gg=G<br \/>indenting 1st level of a block<br \/>=i{<br \/>indenting 2nd level<br \/>=2i{<br \/>These are useful to reformat text paragraphs or chunks of code (NOTE: this does not work for python code&#8230;):<br \/>V= &#8211; select text, then reformat with =<br \/>= &#8211; will correct alignment of code<br \/>== &#8211; one line;<br \/>gq &#8211; reformat a paragraph<br \/>Options to change how automatic formatting is done:<br \/>:set formatoptions (default &#8220;tcq&#8221;)<br \/>t &#8211; textwidth<br \/>c &#8211; comments (plus leader &#8212; see :help comments)<br \/>q &#8211; allogw &#8216;gq&#8217; to work<br \/>n &#8211; numbered lists<br \/>2 &#8211; keep second line indent<br \/>1 &#8211; single letter words on next line<br \/>r &#8211; (in mail) comment leader after<br \/>Other related options:<br \/>:set wrapmargin<br \/>:set textwidth<\/p>\r\n\r\n\r\n\r\n<p>@See:<\/p>\r\n\r\n\r\n\r\n<p>stuff\/shifting blocks visually vim tips wiki.mht<br \/>http:\/\/vim.wikia.com\/wiki\/Shifting_blocks_visually<\/p>\r\n\r\n\r\n\r\n<p>stuff\/vim how do i indent multiple lines quickly in vi stack overflow.mht<br \/>http:\/\/stackoverflow.com\/questions\/235839\/how-do-i-indent-multiple-lines-quickly-in-vi<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"REGEX\"><\/span>#REGEX<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"SYMBOLS\"><\/span>#SYMBOLS:<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>* zero or more occurrences.<br \/>. just one character<br \/>^ at the beginning means that the match must be at the beginning.<br \/>$ at<br \/>the end means that the match must be at the end.<br \/>ignores itself.<br \/>[] returns true if the pattern inside it is found.<\/p>\r\n<p>The unique char to be ignored with &#8216;\\&#8217;, if just in the case, are: -]\\<br \/>&lt;font color=&#8221;red&#8221; size=&#8221;2&#8243;&gt;&#8217;^&#8217; inside [],<br \/>means negative.&lt;\/font&gt;<\/p>\r\n<p>For instance: [^0-9] no number occurence. Compare the &#8216;^&#8217; outside the square<br \/>brackets.<\/p>\r\n<p>( \\) saves the found pattern in a buffer (total of 9 buffers).<br \/>&lt; the pattern must be at the beginning of<br \/>a word.<br \/>&gt; the pattern must be at the end of a word.<br \/>~ repeats the last RE used.<\/p>\r\n\r\n\r\n\r\n<p>. (dot) Any single character except newline<br \/>* zero or more occurrences of any character<br \/>[&#8230;] Any single character specified in the set<br \/>[^&#8230;] Any single character not specified in the set<br \/>^ Anchor &#8211; the beginning of the line<br \/>$ Anchor &#8211; end of line<br \/>\\&lt; Anchor &#8211; beginning of the word<br \/>\\&gt; Anchor &#8211; end of the word<br \/>\\(&#8230;\\) Grouping &#8211; usually used to group conditions<br \/>\\n Contents of nth grouping<\/p>\r\n\r\n\r\n\r\n<p>\/Hello\/ Matches if the line contains the value Hello<br \/>\/^TEST$\/ Matches if the line contains TEST by itself<br \/>\/^[a-zA-Z]\/ Matches if the line starts with any letter<br \/>\/^[a-z].*\/ Matches if the first character of the line is a-z and there is at least one more of any character following it<br \/>\/2134$\/ Matches if line ends with 2134<br \/>\/\\(21|35\\)\/ Matches is the line contains 21 or 35<br \/>Note the use of ( ) with the pipe symbol to specify the &#8216;or&#8217; condition<br \/>\/[0-9]*\/ Matches if there are zero or more numbers in the line<br \/>\/^[^#]\/ Matches if the first character is not a # in the line<br \/>Notes:<br \/>1. Regular expressions are case sensitive<br \/>2. Regular expressions are to be used where pattern is specified<\/p>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"POSIX\"><\/span>#POSIX<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n[:upper:] [A-Z][:lower:][a-z][:alpha:] [A-Za-z] (try: [A-z])<br \/>[:space:] [ \\t\\n\\v\\f\\r]. For instance: :%\/s\/^[[:space:]]\/#\/g<br \/>(switches<br \/>initial spaces by &#8216;#&#8217;)<br \/>[:graph:] [^ \\t\\n\\v\\f\\r] printable characters.<br \/>[:alnum:] [A-Za-z0-9] chars and<br \/>numbers<br \/>[:digit:] [0-9] decimal numbers<br \/>[:xdigit:] [0-9A-Fa-f] hexadecimals<br \/>[:punct:] [.,!?:&#8230;] punctuation<br \/>chars<br \/>[:blank:] [ \\t] blank space and TAB<br \/>[:cntrl:] &#8211; control chars.<br \/>[:print:] printable chars<br \/>(see graph &#8211; I have doubt here &#8211; the doc made this = graph???)<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Ctrl_commands\"><\/span>#Ctrl commands (^)<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3><span class=\"ez-toc-section\" id=\"standard\"><\/span>#standard<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>^B page backward<br \/>^D scroll down<br \/>^E expose a line at the bottom of the screen<br \/>^F page forward<br \/>^G Positional status check<br \/>^I conflicts&#8230;<br \/>^J conflicts&#8230;<br \/>^L cleans messed text<br \/>^N next line, same column<br \/>^P previous line, same column<br \/>^U scroll up<br \/>^V return char (^M)<br \/>^Y expose a line at the top of the screen<br \/>^W erase a word during insert<br \/>^[ ESC char<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"VISUAL_MODE\"><\/span>#VISUAL MODE<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"SELECTING_UP_TO_THE_FIRST_PATTERN\"><\/span>#SELECTING UP TO THE FIRST PATTERN<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>1. Enter visual mode at the starting point<br \/>2. type \/ to enter in search mode<br \/>3. type the pattern. When found, use enter to return.<br \/>All area from the starting point up to the search is selected.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"OPENING_MANY_DOCS\"><\/span>#OPENING MANY DOCS<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>vim doc1 doc2<br \/>To navigate, use:<br \/>:n (go forward)<br \/>:rew (or :rewind &#8211; go backward)<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"swap_file\"><\/span>#swap file<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>To stop sending messages, delete it:<br \/>rm path\/.file.swp<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"UTILS\"><\/span>#UTILS<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>&gt;windows CR to nix conversion<br \/>%s\/^M\/\/g (where ^M is obtained by: Ctrl+V M).<\/p>\r\n\r\n\r\n\r\n<p>&gt;backslash to forward slash<br \/>%s\/\\\\\/\\\/\/g<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"abbreviations\"><\/span>#abbreviations<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>to set:<br \/>:ab abbreviation string_to_abbreviate<br \/>to invoke:<br \/>typing abbreviation in Insert mode restore string<br \/>to delete &#8211; use the reverse command &#8216;una&#8217;:<br \/>:una delete abbreviation<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"recovering_failures\"><\/span>#recovering failures<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>If just in the case, reboot system.<br \/>Type:<br \/>vim -r (it shows the files that can be recovered)<br \/>vim -r file (the specific file to be recovered)<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"tt%E2%80%9D_buffer_operations\"><\/span>#tt&#8221; (buffer operations)<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>Copy\/Cut\/Past from 26 available buffers.<br \/>To access the buffers, use quotes (&#8220;) plus a letter,<br \/>not on Insert or &#8216;:&#8217; modes:<br \/>&#8220;cdd (cuts the line where the cursor is on to buffer c)<br \/>&#8220;p (pastes the a&#8217;s content to the line where the cursor is on)<br \/>Syntax: BUFFER_LETTERcommand<br \/>Examples:<br \/>&#8220;rdd: deletes line and save to buffer r<br \/>&#8220;x5yy: copies 5 lines to buffer x<br \/>&#8220;bdw: cuts the word and saves to buffer w<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"macro_to_key_shortcuts\"><\/span>#macro to key shortcuts<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n\r\n\r\n\r\n<p>On VIM, macros as key mappings.<\/p>\r\n<p><strong>Syntax:<\/strong><br \/>:map key action<\/p>\r\n<p>To unmap (mapping delete):<br \/>:unmap key<\/p>\r\n<p>For instance:<br \/>:map ^x :set nu<br \/>means that each time its typed CRTL X, it&#8217;s gonna be the same as manually typing&#8217;:&#8217;command.<\/p>\r\n<p><strong>NOTE:<\/strong><br \/>In order to get CRTL X, it&#8217;s necessary to indicates a special character set typing<br \/>before the command.<br \/><br \/><strong>Example:<\/strong> CRTL V CRTL X (means CRTL X)<br \/><strong>Notation:<\/strong> ^X means CRTL X on the documentation.<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"Summary\"><\/span>#Summary<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>:map ^V^LETTER COMMAND<br \/>Example: :map ^V^X :set nu^V ENTER<br \/>To unset: unmap, unm<br \/>SPECIAL KEYS MATCHINGS (notice the format title in blue)<br \/>CRTL V CRTL letter = CRTL letter = ^letter<br \/>CRTL V ESC = ESC = ^[<br \/>CRTL V ENTER = ENTER = ^M<br \/>#F1&#8230;#F12 (FUNCTION-KEY) = #1&#8230;#12 = #1&#8230;#12<br \/>to enter into the include mode = CRTL V i (after this you type the text to be included)<br \/>To check this notation, edit for instance a VIM&#8217;s configuration file (.vimrc) and type:<br \/>map CRTL V ENTER<br \/>The result is:<br \/>map ^[<br \/>Example of a \/root\/.vimrc configuration file:<br \/>vim_vimrc_config.png<br \/>The same content on a text file &#8211; notice that the special characters are gone: vim_vimrc_config.txt<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"macro_to_inserting_mode\"><\/span>#macro to inserting mode<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n\r\n\r\n\r\n<p>A macro allow to type an alias that returns a string.<br \/>For instance, add this line to ~\/.vimrc:<br \/>map! @@@ alsdias@yahoo.com.br<\/p>\r\n\r\n\r\n\r\n<p>when you type fast 3time &#8216;@&#8217; (the cursor remains in the same place when it finds a macro alias), at the end it&#8217;s returned the email: &#8220;alsdias@yahoo.com.br&#8221; .<\/p>\r\n\r\n\r\n\r\n<p><strong>Note:<\/strong><br \/>The vim&#8217;s configuration file (~\/.vimrc) did not accept any command.<br \/>For instance, the mapping below didn&#8217;t work:<br \/><br \/><span style=\"color: #008000;\">map! ttbshReadFile while read line; do^M [ &#8220;$(echo $line | cut -c1)&#8221; = &#8216;#&#8217; ] &amp;&amp; continue^M [ &#8220;$line&#8221; ] || continue^M echo $line done &lt; &#8220;$file&#8221;^M<\/span><\/p>\r\n\r\n\r\n\r\n<p>but this another one was successful:<br \/><br \/><span style=\"color: #008000;\">map! ttbshImport import=&#8221;\/home\/alsdias\/dev\/scripts&#8221; ^M . &#8220;$import&#8221;\/toolBox.sh^M<\/span><\/p>\r\n\r\n\r\n\r\n<p>The &lt;em&gt;^M&lt;\/em&gt; character set means return of line, obtained typing &lt;em&gt;^V&lt;\/em&gt; plus &lt;em&gt;ENTER&lt;\/em&gt;.<\/p>\r\n\r\n\r\n\r\n<p>The prior macro mentioned before (without !) is used out of insert mode.<br \/>This kind of macro works into insert mode.<br \/>Same as MACRO TO KEY SHORTCUTS, but add a final &#8216;!&#8217; .<\/p>\r\n<p><strong>Example<\/strong>: <br \/>:map! @ alsdias@yahoo.com.br<br \/><br \/><strong>To unset:<\/strong><br \/>unmap!, unm!<\/p>\r\n<p><strong>Example #2:<\/strong><br \/><br \/>:map! @@@ alsdias@yahoo.com.br<\/p>\r\n<p>On the insert mode, type fast twice &#8216;@&#8217; to be returned<\/p>\r\n<p>To unmap (mapping delete):<br \/>:unmap! key<\/p>\r\n<p>&nbsp;<\/p>\r\n<!--CusAds0-->\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>#NAVIGATION @SEE:8 Essential Vim Editor Navigation Fundamentals k \u2013 navigate upwards j \u2013 navigate downwards l \u2013 navigate right side h \u2013 navigate left side 0 \u2013 go to the starting of the current line. ^ \u2013 go to the first non blank character of the line. $ \u2013 go to the end of the &#8230; <a href=\"https:\/\/ultering.com\/it4us\/?p=1726\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &#8220;VIM: COMMANDS&#8217; SUMMARY &#8211; CHEAT SHEET&#8221;<\/span> &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[92],"tags":[],"class_list":["post-1726","post","type-post","status-publish","format-standard","hentry","category-editors"],"_links":{"self":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/1726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1726"}],"version-history":[{"count":6,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/1726\/revisions"}],"predecessor-version":[{"id":4165,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=\/wp\/v2\/posts\/1726\/revisions\/4165"}],"wp:attachment":[{"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ultering.com\/it4us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}