[
  {
    "path": ".gitignore",
    "content": "vim_passfile\n# ignore undo-files\n.*.un~\n# ignore swap files\n.*.sw*\n# pod html temp files\n*.tmp\n\n#others/*\n*.vba\n*.vmb\ntags\n"
  },
  {
    "path": "Makefile",
    "content": "SCRIPT=$(wildcard plugin/*.vim)\nNAME=\"vim_faq\"\nFAQ=$(NAME).txt\nPOD=others/$(NAME).pod\nDOC=$(wildcard doc/*.txt)\nPLUGIN=$(shell basename \"$$PWD\")\nVERSION=$(shell sed -n '/Version:/{s/^[^0-9]*\\([0-9]\\+\\)$$/\\1/;p}' $(SCRIPT))\n# generate pdf file\nDOPDF=1\n\n\n.PHONY: $(PLUGIN).vmb README\n.PHONY: all release vimball clean dist-clean install uninstall help updateheader docs\n\nall: updateheader help vimball uninstall install \n\nrelease: updateheader help docs README vimball uninstall install\n\nvimball: $(PLUGIN).vmb\n\nclean:\n\tfind . -type f \\( -name \"*.vba\" -o -name \"*.orig\" -o -name \"*.~*\" \\\n\t-o -name \".VimballRecord\" -o -name \".*.un~\" -o -name \"*.sw*\" -o \\\n\t-name tags -o -name \"*.tmp\" -o -name \"*.vmb\" \\) -delete\n\ndist-clean: clean\n\ninstall:\n\tvim -N -c':so %' -c':q!' $(PLUGIN)-$(VERSION).vmb\n\nuninstall:\n\tvim -N -c':RmVimball' -c':q!' $(PLUGIN)-$(VERSION).vmb\n\nREADME:\n\tcp -f $(DOC) README\n\n$(PLUGIN).vmb:\n\trm -f $(PLUGIN)-$(VERSION).vmb\n\tvim -N -c 'ru! vimballPlugin.vim' -c ':call append(\"0\", [ \"$(SCRIPT)\", \"$(DOC)\"])' -c '$$d' -c \":%MkVimball $(PLUGIN)-$(VERSION)  .\" -c':q!'\n\tif [ -f $(PLUGIN)-$(VERSION).vmb ]; then ln -f $(PLUGIN)-$(VERSION).vmb $(PLUGIN).vmb; fi\n     \n\nhelp:\n\tvim -u NONE -U NONE -N -c ':so vim_faq.vim|:CreateVimFAQHelp|wq' ${FAQ}\n\nupdateheader:\n\tvim -u NONE -U NONE -N -c '/^Last updated on: /s/: \\zs.*$$/\\=strftime(\"%d %B %Y\")/|wq' ${FAQ}\n\tvim -u NONE -U NONE -N -c '/^\" Last Change: /s/: \\zs.*$$/\\=strftime(\"%d %B %Y\")/|wq' ${SCRIPT}\n\tvim -u NONE -U NONE -N -c '/^\" Version:/s/\\d\\+/\\=submatch(0)+1/|wq' ${SCRIPT}\n\ndocs:\n\tvim -u NONE -U NONE -N -c ':$$s/Last updated on: \\zs.*$$/\\=strftime(\"%d %B %Y\")/|wq' ${FAQ}\n\tvim -u NONE -U NONE -N -c '/^\\\" GetLatestVimScripts: /s/\\d\\+\\s\\ze:AutoInstall:/\\=(submatch(0)+1).\" \"/|wq' ${SCRIPT}\n\tVERSION=$(shell sed -n '/Version:/{s/^.*\\(\\S\\?\\.\\?\\S\\+\\)$$/\\1/;p}' $(SCRIPT))\n\t# Generate additional formats\n\tvim -u NONE -U NONE -N -c ':so vim_faq.vim|:CreateVimPODFile|q' ${FAQ}\n\tpod2man --name=vimfaq --release=${VERSION} --center='https://vimhelp.org/vim_faq.txt.html' ${POD} > others/${NAME}.1\n\tpod2html --verbose --title=\"Vim FAQ\" ${POD} > others/${NAME}.html\n\tpod2text -c ${POD} > others/${NAME}.ansi\n\t@/bin/sh -c \"if test -x \\\"$$(which pod2pdf)\\\" && test ${DOPDF} -eq 1 ;\\\n\t    then echo 'Generating pdf version, this may take a while'; \\\n\t    pod2pdf --footer-text 'Vim FAQ' --icon vim.png \\\n\t    --icon-scale 0.3 --page-orientation portrait ${POD}\\\n\t    > others/${NAME}.pdf ; \\\n\telse \\\n\t    echo 'Skipping pdf generation' ; \\\n\tfi\"\n\trm -f *.tmp\n"
  },
  {
    "path": "README",
    "content": "*vim_faq.txt*\tFrequently Asked Questions\n\nLast updated on: 11 October 2025\n\n\t  VIM FAQ by: Christian Brabandt <cb@256bit.org>\n\nFrequently Asked Questions                                 *vim-faq* *Vim-FAQ*\n\nThis Vim FAQ is created from the questions and answers posted to the\nvim@vim.org user mailing list and the comp.editors newsgroup. There are\nseveral ways to solve a problem in Vim. This FAQ gives one of those several\npossibilities. You can explore the other ways using the information and\nlinks given in this FAQ. The credit for the answers in this FAQ goes to\nPeppe, Benji, Charles Campbell and numerous others. An online version of\nthis FAQ is available at https://vimhelp.org/vim_faq.txt.html\n\t\t\t\t\t\t\t\t*faq-index*\nINDEX ~\n                                                *faq-general-information*\nSECTION 1 - GENERAL INFORMATION ~\n|faq-1.1|   What is Vim?\n|faq-1.2|   Who wrote Vim?\n|faq-1.3|   Is Vim compatible with Vi?\n|faq-1.4|   What are some of the improvements of Vim over Vi?\n|faq-1.5|   Is Vim free?\n                                                        *faq-resources*\nSECTION 2 - RESOURCES ~\n|faq-2.1|   Where can I learn more about Vim?\n|faq-2.2|   Is there a mailing list available?\n|faq-2.3|   Is there an archive available for the Vim mailing lists?\n|faq-2.4|   Where can I get the Vim user manual in HTML/PDF/PS format?\n|faq-2.5|   I have a \"xyz\" (some) problem with Vim. How do I determine if it is\n\t  a problem with my setup or with Vim?\n|faq-2.6|   Where can I report bugs?\n|faq-2.7|   Where can the FAQ be found?\n|faq-2.8|   What if I don't find an answer in this FAQ?\n|faq-2.9|   I have a patch for implementing a Vim feature. Where do I send the\n\t  patch?\n|faq-2.10|  I have a Vim tip or developed a new Vim\n\t  syntax/indent/filetype/compiler plugin or developed a new script\n\t  or a colorscheme. Is there a public website where I can upload\n\t  this?\n                                                        *faq-availability*\nSECTION 3 - AVAILABILITY ~\n|faq-3.1|   What is the latest version of Vim?\n|faq-3.2|   Where can I find the latest version of Vim?\n|faq-3.3|   What platforms does it run on?\n|faq-3.4|   Where can I download the latest version of the Vim runtime files?\n                                                                *faq-help*\nSECTION 4 - HELP ~\n|faq-4.1|   How do I use the help files?\n|faq-4.2|   How do I search for a keyword in the Vim help files?\n|faq-4.3|   I am getting an error message E123, what did I do wrong?\n|faq-4.4|   Where can I read about the various modes in Vim?\n|faq-4.5|   How do I generate the Vim help tags file after adding a new Vim\n\t  help file?\n|faq-4.6|   Can I use compressed versions of the help files?\n                                                        *faq-editing-a-file*\nSECTION 5 - EDITING A FILE ~\n|faq-5.1|   How do I load a file in Vim for editing?\n|faq-5.2|   How do I save the current file in another name (save as) and edit\n\t  a new file?\n|faq-5.3|   How do I change the current directory to the directory of the\n\t  current file?\n|faq-5.4|   How do I write a file without the line feed (EOL) at the end of\n\t  the file?\n|faq-5.5|   How do I configure Vim to open a file at the last edited location?\n|faq-5.6|   When editing a file in Vim, which is being changed by an external\n\t  application, Vim opens a warning window (like the confirm dialog)\n\t  each time a change is detected. How do I disable this warning?\n|faq-5.7|   How do I edit a file whose name is under the cursor?\n|faq-5.8|   How do I reload/re-edit the current file?\n|faq-5.9|   How do I autosave a file periodically?\n|faq-5.10|  How do I open a file in read-only mode?\n|faq-5.11|  How do I open a file for editing without saving the modifications\n\t  to the current file?\n|faq-5.12|  How do I reduce the loading time for very large files in Vim?\n                                                *faq-editing-multiple-files*\nSECTION 6 - EDITING MULTIPLE FILES ~\n|faq-6.1|   How do I open multiple files at once from within Vim?\n|faq-6.2|   How do I switch between multiple files/buffers in Vim?\n|faq-6.3|   How do I open several files in Vim, with each file in a separate\n\t  window/tabpage?\n|faq-6.4|   How do I configure Vim to autoload several files at once similar\n\t  to \"work-sets\" or \"projects\"?\n|faq-6.5|   Is it possible to open multiple top level windows in a single\n\t  instance of Vim similar to Nedit or emacs?\n|faq-6.6|   How do I browse/explore directories from within Vim?\n|faq-6.7|   How do I edit files over a network using ftp/scp/rcp/http?\n                                                                *faq-backup*\nSECTION 7 - BACKUP ~\n|faq-7.1|   When I edit and save files, Vim creates a file with the same name\n\t  as the original file and a \"~\" character at the end. How do I stop\n\t  Vim from creating this file (or) How do I disable the Vim backup\n\t  file feature?\n|faq-7.2|   When I edit and save files, Vim creates a file with the same name\n\t  as the original file and a \".un~\" extension at the end. How do I\n\t  stop Vim from creating this file (or) How do I disable the Vim\n\t  undofile feature.\n|faq-7.3|   How do I configure Vim to store all the backup files in a\n\t  particular directory?\n|faq-7.4|   When I save a file with Vim, the file permissions are changed.\n\t  How do I configure Vim to save a file without changing the file\n\t  permissions?\n                                                                *faq-buffers*\nSECTION 8 - BUFFERS ~\n|faq-8.1|   I have made some modifications to a buffer. How do I edit another\n\t  buffer without saving the modified buffer and also without losing\n\t  the modifications?\n|faq-8.2|   How do I configure Vim to auto-save a modified buffer when\n\t  switching to another buffer?\n|faq-8.3|   How do I replace the buffer in the current window with a blank\n\t  buffer?\n|faq-8.4|   Is there a keyboard shortcut to load a buffer by the buffer\n\t  number?\n|faq-8.5|   How do I open all the current buffers in separate windows?\n|faq-8.6|   How do I close (delete) a buffer without exiting Vim?\n|faq-8.7|   When I use the command `:%bd` to delete all the buffers, not all\n\t  the buffers are deleted. Why?\n|faq-8.8|   How do I display the buffer number of the current buffer/file?\n|faq-8.9|   How do I delete a buffer without closing the window in which the\n\t  buffer is displayed?\n|faq-8.10|  How do I map the <Tab> key to cycle through and open all the\n\t  buffers?\n                                                                *faq-windows*\nSECTION 9 - WINDOWS ~\n|faq-9.1|   What is the difference between a Vim window and a buffer?\n|faq-9.2|   How do I increase the width of a Vim window?\n|faq-9.3|   How do I zoom into or out of a window?\n|faq-9.4|   How do I execute an ex command on all the open buffers or open\n\t  windows or all the files in the argument list?\n                                                                *faq-motion*\nSECTION 10 - MOTION ~\n|faq-10.1|  How do I jump to the beginning (first line) or end (last line) of\n\t  a file?\n|faq-10.2|  In insert mode, when I press the <Esc> key to go to command mode,\n\t  the cursor moves one character to the left (except when the\n\t  cursor is on the first character of the line). Is it possible to\n\t  change this behavior to keep the cursor at the same column?\n|faq-10.3|  How do I configure Vim to maintain the horizontal cursor position\n\t  when scrolling with the <Page Up>, <Page Down>, etc keys?\n|faq-10.4|  Some lines in a file are more than the screen width and they are\n\t  all wrapped. When I use the j, k keys to move from one line to\n\t  the next, the cursor is moved to the next line in the file\n\t  instead of the next line on the screen. How do I move from one\n\t  screen line to the next?\n|faq-10.5|  What is the definition of a sentence, paragraph and section in\n\t  Vim?\n|faq-10.6|  How do I jump to beginning or end of a sentence, paragraph or a\n\t  section?\n|faq-10.7|  I have lines in a file that extends beyond the right extent of the\n\t  screen. How do I move the Vim view to the right to see the text\n\t  off the screen?\n|faq-10.8|  How do I scroll two or more buffers simultaneously?\n|faq-10.9|  When I use my arrow keys, Vim changes modes, inserts weird\n\t  characters in my document but doesn't move the cursor properly.\n\t  What's going on?\n|faq-10.10| How do I configure Vim to move the cursor to the end of the\n\t  previous line, when the left arrow key is pressed and the cursor\n\t  is currently at the beginning of a line?\n|faq-10.11| How do I configure Vim to stay only in insert mode (modeless\n\t  editing)?\n|faq-10.12| How do I display some context lines when scrolling text?\n|faq-10.13| How do I go back to previous cursor locations?\n                                                        *faq-searching-text*\nSECTION 11 - SEARCHING TEXT ~\n|faq-11.1|  After I searched for a text with a pattern, all the matched text\n\t  stays highlighted. How do I turn off the highlighting\n\t  temporarily/permanently?\n|faq-11.2|  How do I enter a carriage return character in a search pattern?\n|faq-11.3|  How do I search for the character \"^M\"?\n|faq-11.4|  How can I search/replace characters that display as \"~R\", \"~S\",\n\t  etc.?\n|faq-11.5|  How do I highlight all the non-printable characters in a file?\n|faq-11.6|  How do I search for whole words in a file?\n|faq-11.7|  How do I search for the current word under the cursor?\n|faq-11.8|  How do I search for a word without regard to the case (uppercase\n\t  or lowercase)?\n|faq-11.9|  How do I search for words that occur twice consecutively?\n|faq-11.10| How do I count the number of times a particular word occurs in a\n\t  buffer?\n|faq-11.11| How do I place the cursor at the end of the matched word when\n\t  searching for a pattern?\n|faq-11.12| How do I search for an empty line?\n|faq-11.13| How do I search for a line containing only a single character?\n|faq-11.14| How do I search and replace a string in multiple files?\n|faq-11.15| I am using the `:s` substitute command in a mapping. When a\n\t  search for a pattern fails, the map terminates. I would like the\n\t  map to continue processing the next command, even if the\n\t  substitute command fails. How do I do this?\n|faq-11.16| How do I search for the n-th occurrence of a character in a\n\t  line?\n|faq-11.17| How do I replace a tab (or any other character) with a hard\n\t  return (newline) character?\n|faq-11.18| How do I search for a character by its ASCII value?\n|faq-11.19| How do I search for long lines?\n|faq-11.20| How do I display all the lines in the current buffer that\n\t  contain a specified pattern?\n|faq-11.21| How do I search for a text string that spans multiple lines?\n|faq-11.22| How do I search for a pattern only within a range of lines\n\t  in a buffer?\n|faq-11.23| How do I clear the last searched pattern?\n|faq-11.24| Why does this pattern \"a.\\{-}p\\@!\" not match?\n|faq-11.25| How can I use \"/\" within a pattern, without escaping it?\n|faq-11.26| How can I operate on a search match?\n                                                        *faq-changing-text*\nSECTION 12 - CHANGING TEXT ~\n|faq-12.1|  How do I delete all the trailing white space characters (SPACE\n\t  and TAB) at the end of all the lines in a file?\n|faq-12.2|  How do I replace all the occurrences of multiple consecutive\n\t  space characters to a single space?\n|faq-12.3|  How do I reduce a range of empty lines into one line only?\n|faq-12.4|  How do I delete all blank lines in a file? How do I remove all\n\t  the lines containing only space characters?\n|faq-12.5|  How do I copy/yank the current word?\n|faq-12.6|  How do I yank text from one position to another position within a\n\t  line, without yanking the entire line?\n|faq-12.7|  When I yank some text into a register, how do I append the text\n\t  to the current contents of the register?\n|faq-12.8|  How do I yank a complete sentence that spans over more than one\n\t  line?\n|faq-12.9|  How do I yank all the lines containing a pattern into a buffer?\n|faq-12.10| How do I delete all the lines in a file that do not contain a\n\t  pattern?\n|faq-12.11| How do I add a line before each line with \"pattern\" in it?\n|faq-12.12| Is there a way to operate on a line if the previous line\n\t  contains a particular pattern?\n|faq-12.13| How do I execute a command on all the lines containing a\n\t  pattern?\n|faq-12.14| Can I copy the character above the cursor to the current cursor\n\t  position?\n|faq-12.15| How do I insert a blank line above/below the current line\n\t  without entering insert mode?\n|faq-12.16| How do I insert the name of the current file into the current\n\t  buffer?\n|faq-12.17| How do I insert the contents of a Vim register into the current\n\t  buffer?\n|faq-12.18| How do I move the cursor past the end of line and insert some\n\t  characters at some columns after the end of the line?\n|faq-12.19| How to replace the word under the cursor (say: junk) with\n\t  \"foojunkbar\" in Vim?\n|faq-12.20| How do I replace a particular text in all the files in a\n\t  directory?\n|faq-12.21| I have some numbers in a file. How do I increment or decrement\n\t  the numbers in the file?\n|faq-12.22| How do I reuse the last used search pattern in a `:substitute`\n\t  command?\n|faq-12.23| How do I change the case of a string using the `:substitute`\n\t  command?\n|faq-12.24| How do I enter characters that are not present in the keyboard?\n|faq-12.25| Is there a command to remove any or all digraphs?\n|faq-12.26| In insert mode, when I press the backspace key, it erases only\n\t  the characters entered in this instance of insert mode. How do I\n\t  erase previously entered characters in insert mode using the\n\t  backspace key?\n|faq-12.27| I have a file which has lines longer than 72 characters\n\t  terminated with \"+\" and wrapped to the next line. How can I\n\t  quickly join the lines?\n|faq-12.28| How do I paste characterwise yanked text into separate lines?\n|faq-12.29| How do I change the case (uppercase, lowercase) of a word or\n\t  a character or a block of text?\n|faq-12.30| How do I enter ASCII characters that are not present in the\n\t  keyboard?\n|faq-12.31| How do I replace non-printable characters in a file?\n|faq-12.32| How do I remove duplicate lines from a buffer?\n|faq-12.33| How do I prefix all the lines in a file with the corresponding\n\t  line numbers?\n|faq-12.34| How do I exchange (swap) two characters or words or lines?\n|faq-12.35| How do I change the characters used as word delimiters?\n                                        *faq-completion-in-insert-mode*\nSECTION 13 - COMPLETION IN INSERT MODE ~\n|faq-13.1|  How do I complete words or lines in insert mode?\n|faq-13.2|  How do I complete file names in insert mode?\n|faq-13.3|  I am using CTRL-P/CTRL-N to complete words in insert mode. How do\n\t  I complete words that occur after the just completed word?\n                                                        *faq-text-formatting*\nSECTION 14 - TEXT FORMATTING ~\n|faq-14.1|  How do I format a text paragraph so that a new line is inserted\n\t  at the end of each wrapped line?\n|faq-14.2|  How do I format long lines in a file so that each line contains\n\t  less than \"n\" characters?\n|faq-14.3|  How do I join short lines to the form a paragraph?\n|faq-14.4|  How do I format bulleted and numbered lists?\n|faq-14.5|  How do I indent lines in insert mode?\n|faq-14.6|  How do I format/indent an entire file?\n|faq-14.7|  How do I increase or decrease the indentation of the current\n\t  line?\n|faq-14.8|  How do I indent a block/group of lines?\n|faq-14.9|  When I indent lines using the > or < key, the standard 8-tabstops\n\t  are used instead of the current 'tabstop' setting. Why?\n|faq-14.10| How do I turn off the automatic indentation of text?\n|faq-14.11| How do I configure Vim to automatically set the 'textwidth'\n\t  option to a particular value when I edit mails?\n|faq-14.12| Is there a way to make Vim auto-magically break lines?\n|faq-14.13| I am seeing a lot of ^M symbols in my file. I tried setting the\n\t  'fileformat' option to 'dos' and then 'unix' and then 'mac'.\n\t  None of these helped. How can I hide these symbols?\n|faq-14.14| When I paste some text into a Vim buffer from another\n\t  application, the alignment (indentation) of the new text is\n\t  messed up. How do I fix this?\n|faq-14.15| When there is a very long wrapped line (wrap is \"on\") and a line\n\t  doesn't fit entirely on the screen it is not displayed at all.\n\t  There are blank lines beginning with \"@\" symbol instead of\n\t  wrapped line. If I scroll the screen to fit the line the \"@\"\n\t  symbols disappear and the line is displayed again. What Vim\n\t  setting control this behavior?\n|faq-14.16| How do I convert all the tab characters in a file to space\n\t  characters?\n|faq-14.17| What Vim options can I use to edit text that will later go to a\n\t  word processor?\n|faq-14.18| How do I join lines without adding or removing any space\n\t  characters?\n                                                        *faq-visual-mode*\nSECTION 15 - VISUAL MODE ~\n|faq-15.1|  How do I do rectangular block copying?\n|faq-15.2|  How do I delete or change a column of text in a file?\n|faq-15.3|  How do I apply an ex-command on a set of visually selected lines?\n|faq-15.4|  How do I execute an ex command on a column of text selected in\n\t  Visual block mode?\n|faq-15.5|  How do I select the entire file in visual mode?\n|faq-15.6|  When I visually select a set of lines and press the > key to\n\t  indent the selected lines, the visual mode ends. How can I\n\t  reselect the region for further operation?  (or) How do I\n\t  re-select the last selected visual area again?\n|faq-15.7|  How do I jump to the beginning/end of a visually selected region?\n|faq-15.8|  When I select text with mouse and then press : to enter an ex\n\t  command, the selected text is replaced with the : character. How\n\t  do I execute an ex command on a text selected using the mouse\n\t  similar to the text selected using the visual mode?\n|faq-15.9|  When I select a block of text using the mouse, Vim goes into\n\t  selection mode instead of Visual mode. Why?\n                                                *faq-command-line-mode*\nSECTION 16 - COMMAND-LINE MODE ~\n|faq-16.1|  How do I use the name of the current file in the command mode or\n\t  an ex command line?\n|faq-16.2|  How do I edit the text in the Vim command-line effectively?\n|faq-16.3|  How do I switch from Vi mode to Ex mode?\n|faq-16.4|  How do I copy the output from an ex-command into a buffer?\n|faq-16.5|  When I press the <Tab> key to complete the name of a file in the\n\t  command mode, if there are more than one matching file names,\n\t  then Vim completes the first matching file name and displays a\n\t  list of all matching filenames. How do I configure Vim to only\n\t  display the list of all the matching filenames and not complete\n\t  the first one?\n|faq-16.6|  How do I copy text from a buffer to the command line and from the\n\t  command line to a buffer?\n|faq-16.7|  How do I put a command onto the command history without executing\n\t  it?\n|faq-16.8|  How do I increase the height of the command-line?\n                                                                *faq-viminfo*\nSECTION 17 - VIMINFO ~\n|faq-17.1|  When I invoke Vim, I get error messages about illegal characters\n\t  in the viminfo file. What should I do to get rid of these\n\t  messages?\n|faq-17.2|  How do I disable the viminfo feature?\n|faq-17.3|  How do I save and use Vim marks/commands across Vim sessions?\n                                                        *faq-remote-editing*\nSECTION 18 - REMOTE EDITING ~\n|faq-18.1|  How do I open a file with existing instance of gvim? What\n\t  happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n|faq-18.2|  How do I send a command to a Vim server to write all buffers to\n\t  disk?\n|faq-18.3|  Where can I get the documentation about the Vim remote server\n\t  functionality?\n                                                                *faq-options*\nSECTION 19 - OPTIONS ~\n|faq-19.1|  How do I configure Vim in a simple way?\n|faq-19.2|  How do I toggle the value of an option?\n|faq-19.3|  How do I set an option that affects only the current\n\t  buffer/window?\n|faq-19.4|  How do I use space characters for a Vim option value?\n|faq-19.5|  Can I add (embed) Vim option settings to the contents of a file?\n|faq-19.6|  How do I display the line numbers of all the lines in a file?\n|faq-19.7|  How do I change the width of the line numbers displayed using the\n\t  'number' option?\n|faq-19.8|  How do I display (view) all the invisible characters like space,\n\t  tabs and newlines in a file?\n|faq-19.9|  How do I configure Vim to always display the current line and\n\t  column number?\n|faq-19.10| How do I display the current Vim mode?\n|faq-19.11| How do I configure Vim to show pending/partial commands on the\n\t  status line?\n|faq-19.12| How do I configure the Vim status line to display different\n\t  settings/values?\n|faq-19.13| How do I configure Vim to display status line always?\n|faq-19.14| How do I make a Vim setting persistent across different Vim\n\t  invocations/instances/sessions?\n|faq-19.15| Why do I hear a beep (why does my window flash) about 1 second\n\t  after I hit the Escape key?\n|faq-19.16| How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n\t  deleting the characters I'm changing?\n|faq-19.17| How do I remove more than one flag using a single `:set` command\n\t  from a Vim option?\n                                                        *faq-mapping-keys*\nSECTION 20 - MAPPING KEYS ~\n|faq-20.1|  How do I know what a key is mapped to?\n|faq-20.2|  How do I list all the user-defined key mappings?\n|faq-20.3|  How do I unmap a key?\n|faq-20.4|  I am not able to create a mapping for the <xxx> key. What is\n\t  wrong?\n|faq-20.5|  Why does mapping the <C-...> key not work?\n|faq-20.6|  How do I map the numeric keypad keys?\n|faq-20.7|  How do I create a mapping that works only in visual mode?\n|faq-20.8|  How do I create a mapping that works only in normal and operator\n\t  pending mode (but not in visual mode)?\n|faq-20.9|  In a Vim script, how do I know which keys to use for my mappings,\n\t  so that the mapped key will not collide with an already used key?\n|faq-20.10| How do I map the escape key?\n|faq-20.11| How do I map a key to perform nothing?\n|faq-20.12| I want to use the <Tab> key to indent a block of text and\n\t  <Shift-Tab> key to unindent a block of text. How do I map the keys\n\t  to do this?  This behavior is similar to textpad, visual studio,\n\t  etc.\n|faq-20.13| In my mappings the special characters like <CR> are not\n\t  recognized. How can I configure Vim to recognize special\n\t  characters?\n|faq-20.14| How do I use the \"|\" to separate multiple commands in a map?\n|faq-20.15| If I have a mapping/abbreviation whose ending is the beginning of\n\t  another mapping/abbreviation, how do I keep the first from\n\t  expanding into the second one?\n|faq-20.16| Why does it take a second or more for Vim to process a key,\n\t  sometimes when I press a key?\n|faq-20.17| How do I map a key to run an external command using a visually\n\t  selected text?\n|faq-20.18| How do I map the CTRL-I key while still retaining the\n\t  functionality of the <Tab> key?\n|faq-20.19| How do I define a map to accept a count?\n|faq-20.20| How can I make my normal mode mapping work from within Insert\n\t  Mode?\n                                                        *faq-abbreviations*\nSECTION 21 - ABBREVIATIONS ~\n|faq-21.1|  How do I auto correct misspelled words?\n|faq-21.2|  How do I create multi-line abbreviations?\n|faq-21.3|  When my abbreviations are expanded, an additional space character\n\t  is added at the end of the expanded text. How do I avoid this\n\t  character?\n|faq-21.4|  How do I insert the current date/time stamp into the file?\n|faq-21.5|  How do I prevent an abbreviation from expanding in insert mode?\n                                                *faq-record-and-playback*\nSECTION 22 - RECORD AND PLAYBACK ~\n|faq-22.1|  How do I repeat an editing operation (insertion, deletion, paste,\n\t  etc)?\n|faq-22.2|  How I record and repeat a set of key sequences?\n|faq-22.3|  How do I edit/modify a recorded set of key sequences?\n|faq-22.4|  How do I write recorded key sequences to a file?\n|faq-22.5|  I am using register 0 to record my key sequences (i.e. q0 ....\n\t  q). In the recorded key sequences, I am yanking some text.  After\n\t  the first replay of the recorded key sequence, I am no longer\n\t  able to play it back.\n                                                        *faq-autocommands*\nSECTION 23 - AUTOCOMMANDS ~\n|faq-23.1|  How do I execute a command when I try to modify a read-only file?\n|faq-23.2|  How do I execute a command every time when entering a buffer?\n|faq-23.3|  How do I execute a command every time when entering a window?\n|faq-23.4|  From an autocmd, how can I determine the name of the file or the\n\t  buffer number for which the autocommand is executed?\n|faq-23.5|  How do I automatically save all the changed buffers whenever Vim\n\t  loses focus?\n|faq-23.6|  How do I execute/run a function when Vim exits to do some\n\t  cleanup?\n                                                        *faq-syntax-highlight*\nSECTION 24 - SYNTAX HIGHLIGHT ~\n|faq-24.1|  How do I turn off/on syntax highlighting?\n|faq-24.2|  How do I change the background and foreground colors used by Vim?\n|faq-24.3|  How do I change the highlight colors to suit a dark/light\n\t  background?\n|faq-24.4|  How do I change the color of the line numbers displayed when the\n\t  `:set number` command is used?\n|faq-24.5|  How do I change the background color used for a Visually selected\n\t  block?\n|faq-24.6|  How do I highlight the special characters (tabs, trailing spaces,\n\t  end of line, etc) displayed by the 'list' option?\n|faq-24.7|  How do I specify a colorscheme in my .vimrc/.gvimrc file, so that\n\t  Vim uses the specified colorscheme every time?\n|faq-24.8|  Vim syntax highlighting is broken. When I am editing a file, some\n\t  parts of the file is not syntax highlighted or syntax highlighted\n\t  incorrectly.\n|faq-24.9|  Is there a built-in function to syntax-highlight the\n\t  corresponding matching bracket?\n|faq-24.10| How do I turn off the C comment syntax highlighting?\n|faq-24.11| How do I add my own syntax extensions to the standard syntax\n\t  files supplied with Vim?\n|faq-24.12| How do I replace a standard syntax file that comes with the Vim\n\t  distribution with my own syntax file?\n|faq-24.13| How do I highlight all the characters after a particular column?\n|faq-24.14| How do I convert a source file (.c, .h, etc) with the Vim syntax\n\t  highlighting into a HTML file?\n|faq-24.15| How do I list the definition of all the current highlight\n\t  groups?\n|faq-24.16| How can I embed one syntax highlighting language into another\n\t  one?\n                                                *faq-vim-script-writing*\nSECTION 25 - VIM SCRIPT WRITING ~\n|faq-25.1|  How do I list the names of all the scripts sourced by Vim?\n|faq-25.2|  How do I debug Vim scripts?\n|faq-25.3|  How do I locate the script/plugin which sets a Vim option?\n|faq-25.4|  I am getting some error/informational messages from Vim (possibly\n\t  when running a script), the messages are cleared immediately. How\n\t  do I display the messages again?\n|faq-25.5|  How do I save and restore a plugin specific information across\n\t  Vim invocations?\n|faq-25.6|  How do I start insert mode from a Vim function?\n|faq-25.7|  How do I change the cursor position from within a Vim function?\n|faq-25.8|  How do I check the value of an environment variable in the .vimrc\n\t  file?\n|faq-25.9|  How do I check whether an environment variable is set or not from\n\t  a Vim function?\n|faq-25.10| How do I call/use the Vim built-in functions?\n|faq-25.11| I am using some normal mode commands in my Vim script. How do I\n\t  avoid using the user-defined mappings for these normal mode\n\t  commands and use the standard Vim functionality for these normal\n\t  mode commands?\n|faq-25.12| How do I get a visually selected text into a Vim variable or\n\t  register?\n|faq-25.13| I have some text in a Vim variable \"myvar\". I would like to use\n\t  this variable in a `:s` substitute command to replace a text\n\t  \"mytext\". How do I do this?\n|faq-25.14| A Vim variable (bno) contains a buffer number. How do I use this\n\t  variable to open the corresponding buffer?\n|faq-25.15| How do I store the value of a Vim option into a Vim variable?\n|faq-25.16| I have copied and inserted some text into a buffer from a Vim\n\t  function. How do I indent the inserted text from the Vim\n\t  function?\n|faq-25.17| How do I get the character under the cursor from a Vim script?\n|faq-25.18| How do I get the name of the current file without the extension?\n|faq-25.19| How do I get the basename of the current file?\n|faq-25.20| How do I get the output from a Vim function into the current\n\t  buffer?\n|faq-25.21| How do I call external programs from a Vim function?\n|faq-25.22| How do I get the return status of a program executed using the\n\t  `:!` command?\n|faq-25.23| How do I determine whether the current buffer is modified or\n\t  not?\n|faq-25.24| I would like to use the carriage return character in a normal\n\t  command from a Vim script. How do I specify the carriage return\n\t  character?\n|faq-25.25| How do I split long lines in a Vim script?\n|faq-25.26| When I try to \"execute\" my function using the `:execute Myfunc()`\n\t  command, the cursor is moved to the top of the current buffer.\n\t  Why?\n|faq-25.27| How do I source/execute the contents of a register?\n|faq-25.28| After calling a Vim function or a mapping, when I press the \"u\"\n\t  key to undo the last change, Vim undoes all the changes made by\n\t  the mapping/function. Why?\n|faq-25.29| How can I call a function defined with s: (script local\n\t  function) from another script/plugin?\n|faq-25.30| Is it possible to un-source a sourced script? In other words,\n\t  reverse all the commands executed by sourcing a script.\n                                                                *faq-plugins*\nSECTION 26 - PLUGINS ~\n|faq-26.1|  How do I set different options for different types of files?\n|faq-26.2|  I have downloaded a Vim plugin or a syntax file or a indent file,\n\t  or a color scheme or a filetype plugin from the web. Where should\n\t  I copy these files so that Vim will find them?\n|faq-26.3|  How do I extend an existing filetype plugin?\n|faq-26.4|  How do I turn off loading the Vim plugins?\n|faq-26.5|  How do I turn on/off loading the filetype plugins?\n|faq-26.6|  How do I override settings made in a file type plugin in the\n\t  global ftplugin directory for all the file types?\n|faq-26.7|  How do I disable the Vim directory browser plugin?\n|faq-26.8|  How do I set the filetype option for files with names matching a\n\t  particular pattern or depending on the file extension?\n                                                *faq-editing-program-files*\nSECTION 27 - EDITING PROGRAM FILES ~\n|faq-27.1|  How do I enable automatic indentation for C/C++ files?\n|faq-27.2|  How do I configure the indentation used for C/C++ files?\n|faq-27.3|  How do I turn off the automatic indentation feature?\n|faq-27.4|  How do I change the number of space characters used for the\n\t  automatic indentation?\n|faq-27.5|  I am editing a C program using Vim. How do I display the\n\t  definition of a macro or a variable?\n|faq-27.6|  I am editing a C program using Vim. How do I jump to the\n\t  beginning or end of a code block from within the block?\n|faq-27.7|  When editing C++ files and when inserting new lines above or\n\t  below a comment (//) line, Vim automatically inserts the C++\n\t  comment character (//) at the beginning of the line. How do I\n\t  disable this? \n|faq-27.8|  How do I add the comment character \"#\" to a set of lines at the\n\t  beginning of each line?\n|faq-27.9|  How do I edit a header file with the same name as the\n\t  corresponding C source file?\n|faq-27.10| How do I automatically insert comment leaders while typing\n\t  comments?\n                                                                *faq-quickfix*\nSECTION 28 - QUICKFIX ~\n|faq-28.1|  How do I build programs from Vim?\n|faq-28.2|  When I run the make command in Vim I get the errors listed as the\n\t  compiler compiles the program. When it finishes this list\n\t  disappears and I have to use the `:clist` command to see the error\n\t  message again. Is there any other way to see these error\n\t  messages?\n|faq-28.3|  How can I perform a command for each item in the\n\t  quickfix/location list?\n                                                                *faq-folding*\nSECTION 29 - FOLDING ~\n|faq-29.1|  How do I extend the Vim folding support?\n|faq-29.2|  When I enable folding by setting the 'foldmethod' option, all the\n\t  folds are closed. How do I prevent this?\n|faq-29.3|  How do I control how many folds will be opened when I start\n\t  editing a file?\n|faq-29.4|  How do I open and close folds using the mouse?\n|faq-29.5|  How do I change the text displayed for a closed fold?\n|faq-29.6|  How do I store and restore manually created folds across\n\t  different Vim invocations?\n|faq-29.7|  I have enabled syntax based folding. Why is Vim so slow?\n\n                                        *faq-vim-with-external-applications*\nSECTION 30 - VIM WITH EXTERNAL APPLICATIONS ~\n|faq-30.1|  Can I run a shell inside a Vim window?\n|faq-30.2|  How do I pass the word under the cursor to an external command?\n|faq-30.3|  How do I get the output of a shell command into a Vim buffer?\n|faq-30.4|  How do I pipe the contents of the current buffer to an external\n\t  command and replace the contents of the buffer with the output\n\t  from the command?\n|faq-30.5|  How do I sort a section of my file?\n|faq-30.6|  How do I use Vim as a pager?\n|faq-30.7|  How do I view Unix man pages from inside Vim?\n|faq-30.8|  How do I change the diff command used by the Vim diff support?\n|faq-30.9|  How do I use the Vim diff mode without folding?\n                                                                *faq-gui-vim*\nSECTION 31 - GUI VIM ~\n|faq-31.1|  How do I create buffer specific menus?\n|faq-31.2|  How do I change the font used by GUI Vim?\n|faq-31.3|  When starting GUI Vim, how do I specify the location of the GVIM\n\t  window?\n|faq-31.4|  How do I add a horizontal scrollbar in GVim?\n|faq-31.5|  How do I make the scrollbar appear in the left side by default?\n|faq-31.6|  How do I remove the Vim menubar?\n|faq-31.7|  I am using GUI Vim. When I press the <Alt> key and a letter, the\n\t  menu starting with that letter is selected. I don't want this\n\t  behavior as I want to map the <Alt>-<key> combination. How do I do\n\t  this?\n|faq-31.8|  Is it possible to scroll the text by dragging the scrollbar so\n\t  that the cursor stays in the original location?\n|faq-31.9|  How do I get gvim to start browsing files in a particular\n\t  directory when using the `:browse` command?\n|faq-31.10| For some questions, like when a file is changed outside of Vim,\n\t  Vim displays a GUI dialog box. How do I replace this GUI dialog\n\t  box with a console dialog box?\n|faq-31.11| I am trying to use GUI Vim as the editor for my xxx application.\n\t  When the xxx application launches GUI Vim to edit a file, the\n\t  control immediately returns to the xxx application. How do I\n\t  start GUI Vim, so that the control returns to the xxx\n\t  application only after I quit Vim?\n|faq-31.12| Why does the \"Select Font\" dialog doesn't show all the fonts\n\t  installed in my system?\n|faq-31.13| How do I use the mouse in Vim command-line mode?\n|faq-31.14| When I use the middle mouse button to scroll text, it pastes the\n\t  last copied text. How do I disable this behavior?\n|faq-31.15| How do I change the location and size of a GUI Vim window?\n|faq-31.16| When splitting the Vim window vertically, Vim changes\n\t  the position.\n                                                        *faq-vim-on-unix*\nSECTION 32 - VIM ON UNIX ~\n|faq-32.1|  I am running Vim in a xterm. When I press the CTRL-S key, Vim\n\t  freezes. What should I do now?\n|faq-32.2|  I am seeing weird screen update problems in Vim. What can I do to\n\t  solve this screen/display update problems?\n|faq-32.3|  I am using the terminal/console version of Vim. In insertmode,\n\t  When I press the backspace key, the character before the cursor\n\t  is not erased. How do I configure Vim to do this?\n|faq-32.4|  I am using Vim in a xterm. When I quit Vim, the screen contents\n\t  are restored back to the original contents. How do I disable\n\t  this?\n|faq-32.5|  When I start Vim, it takes quite a few seconds to start. How do I\n\t  minimize the startup time?\n|faq-32.6|  How can I make the cursor in gvim in unix stop blinking?\n|faq-32.7|  How do I change the menu font on GTK Vim?\n|faq-32.8|  How do I prevent CTRL-Z from suspending Vim?\n|faq-32.9|  When I kill the xterm running Vim, the Vim process continues to\n\t  run and takes up a lot of CPU (99%) time. Why is this happening?\n|faq-32.10| How do I get the Vim syntax highlighting to work in a Unix\n\t  terminal?\n                                                *faq-vim-on-ms-windows*\nSECTION 33 - VIM ON MS-WINDOWS ~\n|faq-33.1|  In MS-Windows, CTRL-V doesn't start the blockwise visual mode.\n\t  What happened?\n|faq-33.2|  When I press the CTRL-Y key, it acts like the CTRL-R key. How do\n\t  I configure Vim to treat CTRL-Y as CTRL-Y?\n|faq-33.3|  How do I start GUI Vim in a maximized window always?\n|faq-33.4|  After doing some editing operations, Vim freezes. The cursor\n\t  becomes an empty rectangle. I am not able enter any characters.\n\t  What is happening?\n|faq-33.5|  I am using Windows XP, the display speed of maximized GVim is\n\t  very slow. What can I do to speed the display updates?\n|faq-33.6|  What are the recommended settings for using Vim with cygwin?\n|faq-33.7|  I am trying to use GNU diff with Vim diff mode. When I run the\n\t  diff from command line, it works. When I try to use the diff with\n\t  Vim it doesn't work. What should I do now?\n|faq-33.8|  Is it possible to use Vim as an external editor for MS-Windows\n\t  Outlook email client?\n|faq-33.9|  I am using Vim to edit HTML files. How do I start internet\n\t  explorer with the current file to preview the HTML file?\n|faq-33.10| I would like to use Vim with Microsoft Visual Studio. How do I\n\t  do this?\n|faq-33.11| Where do I place the _vimrc and _gvimrc files?\n|faq-33.12| Every time I save a file, Vim warns about the file being changed\n\t  outside of Vim. Why?\n                                                                *faq-printing*\nSECTION 34 - PRINTING ~\n|faq-34.1|  How do I print a file along with line numbers for all the lines?\n|faq-34.2|  How do I print a file with the Vim syntax highlighting colors?\n                                                *faq-building-vim-from-source*\nSECTION 35 - BUILDING VIM FROM SOURCE ~\n|faq-35.1|  How do I build Vim from the sources on a Unix system?\n|faq-35.2|  How do I install Vim in my home directory or a directory other\n\t  than the default installation directory in Unix?\n|faq-35.3|  How do I build Vim from the sources on a MS-Windows system?\n|faq-35.4|  The Vim help, syntax, indent files are missing from my Vim\n\t  installation. How do I install these files?\n|faq-35.5|  I have built Vim from the source and installed the Vim package\n\t  using \"make install\". Do I need to keep the Vim source directory?\n|faq-35.6|  How do I determine the Vim features which are enabled at compile\n\t  time?\n|faq-35.7|  Can I build Vim without the GUI support?\n|faq-35.8|  When building Vim on a Unix system, I am getting \"undefined\n\t  reference to term_set_winsize\" error. How do I resolve this\n\t  error?\n|faq-35.9|  Vim configure keeps complaining about the lack of gtk-config\n\t  while trying to use GTK 2.03. This is correct, since in GTK 2\n\t  they moved to using the generic pkg-config. I can get pkg-config\n\t  to list the various includes and libs for gtk, but for some\n\t  reason the configure script still isn't picking this up.\n|faq-35.10| I did successfully download the sources and compiled Vim on\n\t  Unix. But feature ... still does not work. What is wrong and\n\t  how can I fix it?\n                                                                *faq-various*\nSECTION 36 - VARIOUS ~\n|faq-36.1|  How do I edit binary files with Vim?\n|faq-36.2|  How do I disable the visual error flash and the error beep?\n|faq-36.3|  How do I display the ascii value of a character displayed in a\n\t  buffer?\n|faq-36.4|  Can I use zero as a count for a Vim command?\n|faq-36.5|  How do I disable the Vim welcome screen?\n|faq-36.6|  How do I avoid the \"hit enter to continue\" prompt?\n|faq-36.7|  How do I invoke Vim from command line to run a group of commands\n\t  on a group of files?\n|faq-36.8|  How do I use a normal mode command from insert mode without\n\t  leaving the insert mode?\n|faq-36.9|  How do I start Vim in insert mode?\n|faq-36.10| How do I use Copy and Paste with Vim?\n|faq-36.11| Why shouldn't I modify the files in the system runtime\n\t  directory?\n                                                                *faq-unicode*\nSECTION 37 - UNICODE ~\n|faq-37.1|  Is it possible to create Unicode files using Vim?\n|faq-37.2|  Which Vim settings are particularly important for editing Unicode\n\t  files?\n|faq-37.3|  What is the 'encoding' option?\n|faq-37.4|  How does Vim name the various Unicode encodings?\n|faq-37.5|  How does Vim specify the presence or absence of a byte-order\n\t  mark?\n|faq-37.6|  What is the 'fileencoding' option?\n|faq-37.7|  What is the 'fileencodings' option?\n|faq-37.8|  What is the 'termencoding' option?\n|faq-37.9|  What is the 'bomb' option?\n|faq-37.10| Where can I find an example of a typical use of all these\n\t  options?\n|faq-37.11| How can I insert Unicode characters into a file using Vim?\n|faq-37.12| How can I know which digraphs are defined and for which\n\t  characters?\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-1*\nSECTION 1 - GENERAL INFORMATION ~\n\n \t\t\t\t\t\t\t\t*faq-1.1*\n1.1. What is Vim?\n\nVim stands for Vi IMproved. It used to be Vi IMitation, but there are so\nmany improvements that a name change was appropriate. Vim is a text editor\nwhich includes almost all the commands from the Unix program \"Vi\" and a lot\nof new ones. All commands can be given with the keyboard. This has the\nadvantage that you can keep your fingers on the keyboard and your eyes on\nthe screen. For those who want it, there is mouse support and a GUI version\nwith scrollbars and menus.\n\nVim is an editor, not a word processor. A word processor is used mainly\nto do layout of text. This means positioning it, changing the way it\nappears on output. More often than not, the final document is meant to\nbe printed or typeset or what have you, in order to present it in a\npleasing manner to others. Examples of word processors are Microsoft\nWord, FrameMaker, and OpenOffice Writer.\n\nAn editor is simply for entering text. Any typesetting or laying out of the\ndocument is secondary. With an editor, one's main concern is entering text,\nnot making the text look good. Examples of editors other than Vim and Vi\nare Emacs, TextMate, Ultraedit and gedit. And Notepad.\n\nFor more information, read:\n\n    |intro|\n\n \t\t\t\t\t\t\t\t*faq-1.2*\n1.2. Who wrote Vim?\n\nMost of Vim is based on Stevie and was written by Bram Moolenaar, with\ncontributions from too many people to mention here.\n\nFor more information, read:\n\n    |author|\n    |credits|\n\n \t\t\t\t\t\t\t\t*faq-1.3*\n1.3. Is Vim compatible with Vi?\n\nYes. Vim is very much compatible with Vi.  You can use the \"-C\"\ncommand-line flag to start Vim in Vi compatible mode: >\n\n    $ vim -C\n<\nYou can also use: >\n\n    $ vim -u NONE\n<\nYou can also set the 'compatible' option to enable Vi compatibility: >\n\n    :set compatible\n<\nIf you want to make sure, to start Vim in a 'nocompatible' mode to\noriginal Vi, supply the -N command line argument: >\n\n    $ vim -N\n<\nFor more information, read:\n\n    |-C|\n    |-N|\n    |'compatible'|\n    |compatible-default|\n\n \t\t\t\t\t\t\t\t*faq-1.4*\n1.4. What are some of the improvements of Vim over Vi?\n\nA short summary of the improvements of Vim over vi is listed below.  The\nlist shows that Vim is a thoroughly modern and feature-packed editor.\nStandard features of modern editors are implemented, and there is an equal\nemphasis on general power-user features and features for programmers.\n\nFeatures to modernise Vi: ~\n\n  Multi-level undo ~\n\n     Allows you to set the number of times you can undo your changes in a\n     file buffer. You can also redo an undone change.\n     Also starting with version 7.3 Vim can permanently store your undo\n     information, so that you can undo your changes which you have done\n     in a previous editing session.\n\n  Tabs, Multiple windows and buffers ~\n\n     Each file can be displayed in its own window. You can move easily from\n     one window to another. Each file opened during a Vim session also has\n     an associated buffer and you can easily jump from one to the other.\n     Also like any modern GUI, Vim supports opening several files in tabs.\n     You can do batch processing for tabs, buffers, windows and the\n     argumentlist.\n\n  Flexible insert mode ~\n\n     Vim allows you to use the arrow keys while in insert mode to move\n     around in the file. No more hitting <Esc>, moving around, then hitting\n     `i' or `a'.\n\n  Macros ~\n\n     Vim has a facility which allows you to record a sequence of typed\n     characters and repeat them any number of times.\n\n  Visual mode ~\n\n     You can highlight sections of text and execute operations on this\n     section of text only.\n\n  Block operators ~\n\n     Allow selection and highlighting of rectangular blocks of text in\n     order do execute specific operations on them.\n\n  Online help system ~\n\n     You can easily find help on any aspect of using Vim. Help is displayed\n     in its own window.\n\n  Command-line editing and history ~\n\n     History allows you to use the arrow keys to repeat or search for a\n     command that has already been typed. Allows you to match the beginning\n     of a command with the beginning of another similar command in the\n     history buffer. You can also edit a command to correct typos or change\n     a few values.\n\n  Command line completion. ~\n\n     Using the <Tab> key, you can complete commands, options, filenames,\n     etc. as needed.\n\n  Horizontal scrolling. ~\n\n     Long lines can be scrolled horizontally (with or without the GUI).\n\n  Unicode and internationalization improvements. ~\n\n     Vim is able to edit files in unicode encoding and uses internally an\n     utf-8 encoding. Additionally Vim can display text right to left\n     oriented.\n\nAdvanced user features: ~\n\n  Text formatting ~\n\n     With two keystrokes, you can format large sections of text, without\n     the use of external programs.\n\n  Completion in Insert mode ~\n\n     Vim provides several different possibilities to complete your text.\n     For example Vim can complete words while you are typing, by matching\n     the current word with other similar words in the file.\n\n  Jump tags ~\n\n     Just like in an internet browser, you can jump back to previous parts\n     of the text you were editing, and then forward again.  Your brain is\n     thus free to edit instead of navigate.\n\n  Automatic commands ~\n\n     Commands automatically executed when reading or writing a file,\n     jumping to another buffer, etc.\n\n  Viminfo ~\n\n     Allows storing of the command line history, marks and registers in a\n     file to be read on startup.  Therefore, you can recall old search\n     patterns, macros, etc., in a new Vim session.\n\n  Mouse support ~\n\n     The mouse is supported in an xterm and for MS-DOS. It can be used to\n     position the cursor, select the visual area, paste a register, etc.\n\n  Graphical User Interface (GUI) ~\n\n     There are several different graphical user interfaces available.\n     Also, it's very easy to add your own menus.  Of course, console vim is\n     still supported, and very widely used.\n\n  Scripting language ~\n\n     Vim has a powerful scripting language so new commands can be created.\n     You can also use Perl, Python, TCL, Lua and Ruby to achieve the same\n     thing!\n\n  Plugins ~\n\n     Extra functionality implemented via vim commands (regular commands or\n     the scripting language) that is automatically loaded on startup.\n     Examples: file explorer, network editing, enhanced autocompletion,\n     syntax checks.\n     More are being developed and shared on VimOnline all the time.\n\n  Syntax highlighting for many programming languages ~\n\n     Syntax highlighting (including concealing items) for hundreds of\n     programming languages is supported. Support for others can be\n     added.\n\n  Extended regular expressions ~\n\n     Vim supports extended regular expressions which are similar in\n     functionality to that of Perl regular expressions.\n\n  Integrated Spell checking ~\n\n     Spell checking has been integrated into Vim.\n\n  Diff mode ~\n\n     Vim can highlight the differences between two, three or four files.\n     Identical lines will be folded away and hidden.\n\n  Encryption using the blowfish algorithm ~\n\n     Vim allows to encrypt your files using the symmetric block cipher\n     blowfish as well as the swap file.\n\n  Extensive customizable ~\n\n     Vim can be tuned and customized to work like you want by setting\n     options. You can define your own commands, macros and even plugins\n     to extend its capabilities\n\n  Packages ~\n\n     Packages have been added to keep the installation of the growing\n     number of plugins manageable. This is a convenient way to get one\n     or more plugins, drop them in a directory and keep them updated.\n     Vim will load them automatically, or only when desired.\n\nProgramming performance features: ~\n\n  Edit-compile-edit speedup ~\n\n     You can compile within Vim and automatically jump to the location of\n     errors in the source code.\n\n  Indenting for many programming languages ~\n\n     C, C++, Java, Perl, XML and many other languages can be automatically\n     indented by vim while you type.  Support for others can be added.\n\n  Searching for words in include files ~\n\n     Vim allows you to search for a match of the word under the cursor in\n     the current and included files.\n\n  Advanced text objects ~\n\n     Instantly select, delete, copy, indent, format, change case, or ...\n     to all the text between ( and ), or { and }, or < and >, or [ and\n     ].  Or a word, sentence, or paragraph.  Very powerful.\n\n  Folding ~\n\n     Certain parts of the text can be \"folded\" away.  The best example is\n     the body of a function.  You can get an overview of the code, and then\n     open the fold of the function whose detail you need to see.\n\n  ctags and cscope integration ~\n\n     Using these two powerful programs, you can jump to a definition of a\n     function from a calling instance of it, and use other tricks to\n     navigate source code.\n\n  Integration of several programming languages ~\n\n     If you find the internal scripting language not powerful enough, you\n     can extend Vim using Lua, Ruby, Tcl, Perl and Python 2 and 3.\n\n  Asynchronous I/O support ~\n\n     Vim uses jobs and channels to talk to other programs\n     asynchronously. This allows to have e.g. a compiler run in the\n     background and open the quickfix list as soon as it is finished to\n     fix warnings and errors.\n\n  Timers ~\n\n     Timers are asynchronous and can fire once or repeatedly to invoke a\n     function to do any work.\n\nFor more information, read: ~\n\n    |vi-differences|\n\n \t\t\t\t\t\t\t\t*faq-1.5*\n1.5. Is Vim free?\n\nVim is Charityware. There are no restrictions on using or copying Vim, but\nthe author encourages you to make a donation to charity. A document\nexplaining how to do so is included in the distribution.\n\nFor more information, read:\n\n    |copyright|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-2*\nSECTION 2 - RESOURCES ~\n\n \t\t\t\t\t\t\t\t*faq-2.1*\n2.1. Where can I learn more about Vim?\n\nYou can post your Vim questions to the vim@vim.org mailing list.  You can\npost your Vim development related questions to the vim-dev@vim.org mailing\nlist. Vim does not have a newsgroup of its own. But the appropriate\nnewsgroup to post to is comp.editors.\n\n\"VimOnline\" is a web page that serves as a de facto homepage for vim,\nalthough the main purpose of it is to gather tips and scripts from\neverywhere.  Get involved!  The URL is https://www.vim.org\n\nFinally, read the Vi FAQ:\n\n    http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\nFinally, there are also some communities, where you can discuss features\nor ask questions:\n\n    https://vi.stackexchange.com\n    https://vim.reddit.com\n\nFor more information, read:\n\n    |mail-list|\n    |internet|\n\n \t\t\t\t\t\t\t\t*faq-2.2*\n2.2. Is there a mailing list available?\n\nThere are several:\n\n    NAME              DESCRIPTION ~\n    ----------------  --------------------------------------------- ~\n    vim-announce      Announcements of new releases\n    vim               General discussion\n    vim-dev           Patches, bug reports, development discussions\n    vim-mac           Macintosh discussion\n    vim-fr            General discussion in French\n\nOf these, only vim and vim-dev are of general interest. vim-announce is\nread-only to most people, and its messages are sent to the other lists as\nwell. The remaining four are very low volume.\n\n    ACTION            EMAIL SEND TO ~\n    ----------------  -------------------------- ~\n    To subscribe:     <NAME>-subscribe@vim.org\n    To unsubscribe:   <NAME>-unsubscribe@vim.org\n    To get help:      <NAME>-help@vim.org\n\nThe available mailing lists are also mentioned here:\n\n    https://www.vim.org/maillist.php\n\n \t\t\t\t\t\t\t\t*faq-2.3*\n2.3. Is there an archive available for the Vim mailing lists?\n\nYes. Visit https://groups.yahoo.com/, where name is one of:\nvimannounce, vim, vimdev, vim-fr, vim-mac, vim-vms.\n\nAlternatively, visit www.gmane.org to find out about GMANE, which allows\nyou to access the mailing lists as though they were newsgroups.  This\noffers some convenience to those who wish to browse the history or casually\nobserve the current threads.\n\n \t\t\t\t\t\t\t\t*faq-2.4*\n2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\n\nYou can download the HTML/PDF/PS format of the Vim user manual from:\n\n    https://vimdoc.sourceforge.net/\n\nNote, the user manual from that page is currently pretty outdated. It's\nbest to either use the documentation that comes with vim or use the\nonline version at https://vimhelp.org\n\nYou can find a pdf version of the full English help, including this faq\n(in letter, A4 and Ipad format) at:\n\n    https://nathangrigg.com/vimhelp/\n\nThis document is cross-referenced, so you can use the hyperlink\nfunctionality.\n\n \t\t\t\t\t\t\t\t*faq-2.5*\n2.5. I have a \"xyz\" (some) problem with Vim. How do I determine if it is a\n     problem with my setup or with Vim?  / Have I found a bug in Vim?\n\nFirst, you need to find out, whether the error is in the actual runtime\nfiles or any plugin that is distributed with Vim or whether it is a\nsimple side effect of any configuration option from your .vimrc or\n.gvimrc. So first, start vim like this: >\n\n    vim -u NONE -U NONE -N -i NONE\n<\nThis starts Vim in nocompatible mode (-N), without reading your viminfo\nfile (-i NONE), without reading any configuration file (-u NONE for not\nreading .vimrc file and -U NONE for not reading a .gvimrc file) or even\nplugin.\n\nIn this invocation, try to reproduce your problem. If the error\npersists, the chance is good you've found a bug in Vim (see also\nQuestion 2.6. |faq-2.6|)\n\nIf the error does not occur when starting Vim this way, then the problem\nis either related to some plugin of yours or some setting in one of your\nlocal setup files. You need to find out, what triggers the error, you\ntry starting Vim this way: >\n\n    vim -u NONE -U NONE -N\n<\nIf the error occurs, the problem is your .viminfo file. Simply delete\nthe viminfo file then. If the error does not occur, try: >\n\n    vim -u ~/.vimrc --noplugin -N -i NONE\n<\nThis will simply use your .vimrc as configuration file, but not load any\nplugins. If the error occurs this time, the error is possibly caused by\nsome configuration option inside your .vimrc file. Depending on the\nlength of your vimrc file, it can be quite hard to trace the origin\nwithin that file.\n\nThe best way is to add `:finish` command in the middle of your .vimrc.\nThen restart again using the same command line. If the error still\noccurs, the bug must be caused because of a setting in the first half of\nyour .vimrc. If it doesn't happen, the problematic setting must be in\nthe second half of your .vimrc. So move the `:finish` command to the\nmiddle of that half, of which you know that triggers the error and move\nyour way along, until you find the problematic option. If your .vimrc is\n350 lines long, you need at a maximum 9 tries to find the offending line\n(in practise, this can often be further reduced, since often lines\ndepend on each other).\n\nIf the problem does not occur, when only loading your .vimrc file, the\nerror must be caused by a plugin or another runtime file (indent\nautoload or syntax script). Check the output of the `:scriptnames` command\nto see what files have been loaded and for each one try to disable each\none by one and see which one triggers the bug. Often files that are\nloaded by vim, have a simple configuration variable to disable them, but\nyou need to check inside each file separately.\n\nYou can also use the -V command line argument to get more debug\ninformation to analyze the problem: >\n\n    $ vim -V2logfile\n<\nYou can increase the value passed to the -V argument to get more debug\ninformation. By also specifying a logfile name, this makes sure, the\ndebug messages don't appear on the screen and won't disturb you when\ntrying to reproduce the problem.\n\n\nFor more information, read:\n\n    |-u|\n    |-U|\n    |-N|\n    |-V|\n    |'verbose'|\n    |:verbose|\n    |:set-verbose|\n\n \t\t\t\t\t\t\t\t*faq-2.6*\n2.6. Where can I report bugs?\n\nFirst collect the required information using the following command: >\n\n    :source $VIMRUNTIME/bugreport.vim\n<\nNow send the resulting text from the above command to the bugs@vim.org\ne-mail address. There is also a public bug tracker available at\nhttps://github.com/vim/vim/issues. A copy of each message there\nwill be forwarded to the Vim Development list.\n\nThe Vim Development mailing list (see Question 2.2 |faq-2.2|) is a good place to\ndiscuss general bugs.  If the bug you find is with syntax highlighting,\na runtime file, or some other \"added feature\" (i.e. not directly\nprogrammed into vim), attempt to inform the maintainer of that feature.\nHis e-mail address will be mentioned at the top of the corresponding\nruntime file.\n\nFor more information, read:\n\n    |bug-reports|\n\n \t\t\t\t\t\t\t\t*faq-2.7*\n2.7. Where can the FAQ be found?\n\nThe FAQ can be found at https://vimhelp.org/vim_faq.txt.html.\nIt will be auto-generated from the source that is managed in the github\nrepository https://www.github.com/chrisbra/vim_faq (Patches are welcome).\n\nThe repository also includes the faq in different formats, e.g. manpage,\npdf file, html file, plain text version and a version in vim help format.\n\nA slightly older version (which doesn't seem to get updated anymore) can\nstill be found at VimOnline (https://www.vim.org/).\n\n \t\t\t\t\t\t\t\t*faq-2.8*\n2.8. What if I don't find an answer in this FAQ?\n\nThis FAQ covers mainly Vim-specific questions. You may find more\ninformation suitable for most Vi clones by reading the Vi FAQ. It is posted\nregularly on comp.editors. You can also find a copy at\n\n    http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\nAlso, since Vim has gathered so many features in the last few years,\nsuccessfully documenting the frequently asked questions here is a\nnear-impossible task. To make it possible, please email the maintainer if\nyou have a good question. A good question is one that you've tried to\nanswer yourself (remember, Vim has great documentation) but struggled.\n\n \t\t\t\t\t\t\t\t*faq-2.9*\n2.9. I have a patch for implementing a Vim feature. Where can I send this\n     patch?\n\nYou can send your patches to the Vim developer mailing list\nvim-dev@vim.org.\n\nFor more information, read:\n\n    |vim-dev|\n\n \t\t\t\t\t\t\t\t*faq-2.10*\n2.10. I have a Vim tip or developed a new Vim syntax/indent/filetype/\n      compiler plugin or developed a new script or a colorscheme.\n      Is there a public website where I can upload this?\n\nYes. You can use the Vim Online website to upload your plugins/scripts,\ncolorschemes, etc. The site is at https://www.vim.org\nNowadays people also seem to share their plugins/runtime files at\ngithub.\n\nTips can also be shared in the Wiki which you can find at\n\n    http://vim.wikia.com\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-3*\nSECTION 3 - AVAILABILITY ~\n\n \t\t\t\t\t\t\t\t*faq-3.1*\n3.1. What is the latest version of Vim?\n\nThe latest version of Vim is 8.2 released on 12th December 2019.\n\nThe release history of different versions of Vim is below:\n\n    VERSION         RELEASE DATE ~\n    --------------  -------------------- ~\n    Version 9.1     2nd January, 2024\n    Version 9.0     28th June, 2022\n    Version 8.2     12th December, 2019\n    Version 8.1     17th May, 2018\n    Version 8.0     12th September, 2016\n    Version 7.4     10th August, 2013\n    Version 7.3     15th August, 2010\n    Version 7.2     9th August, 2008\n    Version 7.1     12th May, 2007\n    Version 7.0     8th May, 2006\n    Version 6.4     15th October, 2005\n    Version 6.3     8th June, 2004\n    Version 6.2     1st June, 2003\n    Version 6.1     24th March, 2002\n    Version 6.0     27th September, 2001\n    Version 5.8     31st May, 2001\n    Version 5.7     24th June, 2000\n    Version 5.6     16th January, 2000\n    Version 5.5     21st September, 1999\n    Version 5.4     26th July, 1999\n    Version 5.3     31st August, 1998\n    Version 5.2     24th August, 1998\n    Version 5.1     7th April, 1998\n    Version 5.0     19th February, 1998\n    Version 4.6     13th March, 1997\n    Version 4.5     17th October, 1996\n    Version 4.2     5th July, 1996\n    Version 4.0     29th May, 1996\n    Version 3.0     12th August, 1994\n    Version 2.0     21st December, 1993\n    Version 1.27    23rd April, 1993\n    Version 1.17    21st April, 1992\n    Version 1.14    2nd November, 1991\n\nIf you are interested in the old release history, check out the\nvim-history git repository:\nhttps://github.com/vim/vim-history\nand especially for the release history:\nhttps://github.com/vim/vim-history#release-history\n\nFor more information, read:\n\n    |new-9|\n    |new-8|\n    |changed-9.1|\n    |changed-8.2|\n    |changed-8.1|\n\n \t\t\t\t\t\t\t\t*faq-3.2*\n3.2. Where can I find the latest version of Vim?\n\nYou can download the sources for the latest version of Vim from the\nGithub repository. The URL for this site is\n\n    https://github.com/vim/vim\n\nA mercurial mirror is also available:\n\n    https://www.vim.org/hgweb/vim/\n\nSome users keep updated repositories for distributing latest binary\nversions of Vim. You can find those repositories here:\n\n    http://vim.wikia.com/wiki/Where_to_download_Vim\n\n \t\t\t\t\t\t\t\t*faq-3.3*\n3.3. What platforms does it run on?\n\nAll Unix platforms.\nAll Windows platforms (10 and later).\nAmiga, Macintosh, MachTen, VMS, IBM z/OS.\n\nFor MS-DOS support has been removed with the latest releases of Vim.\n16-bit DOS: latest supported version 7.1\n32-bit DOS: latest supported version 7.3\nWindows XP and Visat: latest supported version 9.0\n\n \t\t\t\t\t\t\t\t*faq-3.4*\n3.4. Where can I download the latest version of the Vim runtime files?\n\nYou can download the latest version of the Vim runtime files (syntax files,\nfiletype plugins, compiler files, color schemes, documentation, indentation\nfiles and keymaps) from the Vim github repository\n\n    https://github.com/vim/vim/tree/master/runtime\n\nAnother way of downloading the runtime files is this: >\n\n    wget https://github.com/vim/vim/archive/master.tar.gz -O- |\n    tar zfx - vim-master/runtime/ --strip-components=1\n<\nSee also:\n\n    https://www.vim.org/runtime.php\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-4*\nSECTION 4 - HELP ~\n\n \t\t\t\t\t\t\t\t*faq-4.1*\n4.1. How do I use the help files?\n\nHelp can be found for all functions of Vim. In order to use it, use the\n`:help` command.  This will bring you to the main help page. On that first\npage, you will find explanations on how to move around. Basically, you move\naround in the help pages the same way you would in a read-only document.\nYou can jump to specific subjects by using tags. This can be done in two\nways:\n\n   * Use the CTRL-] command while standing on the name of a command\n     or option. This only works when the tag is a keyword.\n     <Ctrl-LeftMouse> and g<LeftMouse> work just like CTRL-].\n\n   * use the `:tag <subject>` command. This works with all characters.\n\nUse CTRL-T to jump back to previous positions in the help files. Use\n`:q` to close the help window.\n\nIf you want to jump to a specific subject on the help pages, use\n`:help {subject}` . If you don't know what to look for, try `:help index`\nto get a list of all available subjects. Use the standard search keys to\nlocate the information you want.\nYou can abbreviate the `:help` command as `:h`.\n\nFor searching the help, see the next Question 4.2. |faq-4.2|\n\nFor more information, read:\n\n    |online-help|\n\n \t\t\t\t\t\t\t\t*faq-4.2*\n4.2. How do I search for a keyword in the Vim help files?\n\na)  You can press the CTRL-D key after typing the help keyword to get a\n    list of all the help keywords containing the supplied pattern. You can\n    also use the meta characters like *, \\+, etc to specify the help\n    search pattern: >\n\n    :help init<C-D>\n    :help str*()<C-D>\n    :help '*indent<C-D>\n<\nb)  You can press the <Tab> key after typing a partial help keyword to expand\n    to the matching keyword. You can continue to press the <Tab> key to see\n    other keyword matches.\n\nc)  From the help window, you can use the `:tag` command to search for\n    keywords. For example, >\n\n    :tselect /window\n<\n    This command will list all the help keywords containing the text\n    \"window\". You can select one from the list and jump to it.\n\nd)  You can use the `:helpgrep` command to search for the given text in\n    all the help files. The quickfix window will be opened with all the\n    matching lines.\n\nFor more information, read:\n\n    |help-summary|\n    |c_CTRL-D|\n    |c_<Tab>|\n    |:tselect|\n    |:help|\n    |:helpgrep|\n\n \t\t\t\t\t\t\t\t*faq-4.3*\n4.3. I am getting an error message E123, what did I do wrong?\n\nYou can get more information about the error and the error message using:\n\n    |E123|\n\nFor more information, read:\n\n    |error-messages|\n\n \t\t\t\t\t\t\t\t*faq-4.4*\n4.4. Where can I read about the various modes in Vim?\n\nYou can get information about the different modes in Vim by reading\n\n    |vim-modes|\n\n \t\t\t\t\t\t\t\t*faq-4.5*\n4.5. How do I generate the Vim help tags file after adding a new Vim help\n     file?\n\nYou can use the `:helptags` command to regenerate the Vim help tag file\nfrom within Vim. For example: >\n\n    :cd $VIMRUNTIME/doc\n    :helptags .\n<\nTo update all \"doc\" directories in your 'runtimepath', you can use\n\n    :helptags ALL\n\nFor more information, read:\n\n    |:helptags|\n    |add-local-help|\n\n \t\t\t\t\t\t\t\t*faq-4.6*\n4.6. Can I use compressed versions of the help files?\n\nYes. You can compress the help files and still be able to view them with\nVim.  This makes accessing the help files a bit slower and requires the\n\"gzip\" utility. Follow these steps to compress and use the Vim help files:\n\n- Compress all the help files using \"gzip doc/*.txt\".\n\n- Edit the \"doc/tags\" file and change the \".txt\" to \".txt.gz\" using\n        :%s=\\(\\t.*\\.txt\\)\\t=\\1.gz\\t=\n\n- Add the following line to your vimrc:\n        set helpfile={dirname}/help.txt.gz\n\nWhere {dirname} is the directory where the help files are.  The gzip.vim\nplugin supplied with the standard Vim distribution will take care of\ndecompressing the files.  You must make sure that $VIMRUNTIME is set to\nwhere the other Vim files are, when they are not in the same location as\nthe compressed \"doc\" directory.\n\nNote, that the `:helpgrep` command does not work with compressed help pages.\n\nFor more information, read:\n\n    |gzip-helpfile|\n    |'helpfile'|\n    |gzip|\n    |$VIMRUNTIME|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-5*\nSECTION 5 - EDITING A FILE ~\n\n \t\t\t\t\t\t\t\t*faq-5.1*\n5.1. How do I load a file in Vim for editing?\n\nThere are several ways to load a file for editing. The simplest is to\nuse the `:e` (:edit) command: >\n\n    :e <filename>\n<\nYou can also use the `:n` (:next) command to load files into Vim: >\n\n    :n <filename(s)>\n<\nYou can also use the `:args` command to load files into Vim: >\n\n    :args <filename(s)>\n<\nFor more information, read:\n\n    |usr_07.txt|\n    |edit-files|\n    |:edit|\n    |:next_f|\n    |:args_f|\n\n \t\t\t\t\t\t\t\t*faq-5.2*\n5.2. How do I save the current file in another name (save as) and edit a\n     new file?\n\nYou can use the `:saveas` command to save the current file in another name: >\n\n    :saveas <newfilename>\n<\nAlternatively, you can also use the following commands: >\n\n    :w <newfilename>\n    :edit #\n<\nYou can also use the `:file` command, followed by `:w` command: >\n\n    :file <newfilename>\n    :w\n<\nFor more information, read:\n\n    |07.7|\n    |:saveas|\n    |:file_f|\n    |:w|\n\n \t\t\t\t\t\t\t\t*faq-5.3*\n5.3. How do I change the current directory to the directory of the current\n     file?\n\nYou can use the following command to change the current directory to the\ndirectory of the current file: >\n\n    :cd %:p:h\n<\nTo automatically change the current directory to the directory of the\ncurrent file, simply set the option 'autochdir'. >\n\n    :set autochdir\n<\nFor more information, read:\n\n    |:cd|\n    |:lcd|\n    |filename-modifiers|\n    |autocommand|\n    |'acd'|\n    |getcwd()|\n\n \t\t\t\t\t\t\t\t*faq-5.4*\n5.4. How do I write a file without the line feed (EOL) at the end of the\n     file?\n\nYou can turn off the 'eol' option and turn on the 'binary' option to write\na file without the EOL at the end of the file: >\n\n    :set binary\n    :set noeol\n    :w\n<\nAlternatively, you can use: >\n\n    :set noeol\n    :w ++bin\n<\nIf you rather only like Vim not to write missing EOLs, you can reset the\n'fixeol' option. This needs a Vim newer 7.4.785, so you should wrap this\nin an if condition in your .vimrc like this: >\n\n    if exists('+fixeol')\n        set nofixeol\n    endif\n<\nThis has the advantage of avoiding the many side effects that the\n'binary' option has.\n\nFor more information, read:\n\n    |'endofline'|\n    |'fixeol'|\n    |'binary'|\n    |23.4|\n\n \t\t\t\t\t\t\t\t*faq-5.5*\n5.5. How do I configure Vim to open a file at the last edited location?\n\nVim stores the cursor position of the last edited location for each buffer\nin the '\"' register. You can use the following autocmd in your .vimrc or\n.gvimrc file to open a file at the last edited location: >\n\n    au BufReadPost * if line(\"'\\\"\") > 0 && line(\"'\\\"\") <= line(\"$\") |\n                         \\ exe \"normal! g`\\\"\" | endif\n<\nAlternatively, you can simply source the vimrc_example.vim file, which is\ndistributed with Vim.\n\nFor more information, read:\n\n    |'quote|\n    |last-position-jump|\n    |vimrc_example.vim|\n\n \t\t\t\t\t\t\t\t*faq-5.6*\n5.6. When editing a file in Vim, which is being changed by an external\n     application, Vim opens a warning window (like the confirm dialog) each\n     time a change is detected. How do I disable this warning?\n\nYou can set the Vim 'autoread' option to automatically read the file again\nwhen it is changed outside of Vim: >\n\n    :set autoread\n<\nYou can also use the following autocommand: >\n\n    autocmd FileChangedShell *\n          \\ echohl WarningMsg |\n          \\ echo \"File has been changed outside of vim.\" |\n          \\ echohl None\n<\nFor more information, read:\n\n    |'autoread'|\n    |FileChangedShell|\n    |timestamp|\n    |:checktime|\n\n \t\t\t\t\t\t\t\t*faq-5.7*\n5.7. How do I edit a file whose name is under the cursor?\n\nYou can use the gf command to edit a file whose name is under the cursor.\nYou can use the CTRL-W f command to edit the file in a new window and\nfinally you can use CTRL-W gf top open a new tab page that contains the\nfile name under the cursor.\n\nFor more information, read:\n\n    |gf|\n    |CTRL-W_f|\n    |CTRL-W_gf|\n    |'isfname'|\n    |'path'|\n    |'suffixesadd'|\n    |'includeexpr'|\n\n \t\t\t\t\t\t\t\t*faq-5.8*\n5.8. How do I reload/re-edit the current file?\n\nYou can use the `:edit` command, without specifying a file name, to reload\nthe current file.  If you have made modifications to the file, you can use\n`:edit!` to force the reload of the current file (you will lose your\nmodifications, but depending on your 'undoreload' settings, those\nchanges might be saved into the undo history).\n\nFor more information, read:\n\n    |:edit|\n    |:edit!|\n    |'confirm'|\n    |'undoreload'|\n\n \t\t\t\t\t\t\t\t*faq-5.9*\n5.9. How do I autosave a file periodically?\n\nVim doesn't support auto-saving a file periodically.\n\nFor more information, read:\n\n    |'updatetime'|\n    |CursorHold|\n    |swap-file|\n\n \t\t\t\t\t\t\t\t*faq-5.10*\n5.10. How do I open a file in read-only mode?\n\nYou can open a file in read-only mode using the `:view` command: >\n\n    :view <filename>\n<\nThis command sets the 'readonly' option for the opened buffer. You can also\nuse the \"-R\" command-line option to open a file in read-only mode: >\n\n    $ vim -R <filename>\n<\nYou can also use the symbolic link executable \"view\" to open a file in\nread-only mode from the command-line: >\n\n    $ view <filename>\n<\nFor more information, read:\n\n    |07.6|\n    |'readonly'|\n    |'modifiable'|\n    |:view|\n    |:sview|\n    |view|\n    |-R|\n    |-M|\n\n \t\t\t\t\t\t\t\t*faq-5.11*\n5.11. How do I open a file for editing without saving the modifications to\n      the current file?\n\nYou can open a file for editing without saving the modifications to the\ncurrent file and without losing the changes using one of the following\nmethods: >\n\n    :split <new_filename>\n    :new <new_filename>\n<\nYou can also set the 'hidden' option and edit a new file: >\n\n    :set hidden\n    :e <new_filename>\n<\nIf you want to discard the changes made to the current file and load\nanother file for editing, then you can use the following command: >\n\n    :e! <new_filename>\n<\nFor more information, read:\n\n    |:edit!_f|\n    |'hidden'|\n    |:split|\n    |:new|\n\n \t\t\t\t\t\t\t\t*faq-5.12*\n5.12. How do I reduce the loading time for very large files in Vim?\n\nYou can use the following settings to reduce the loading time for\nvery large files in Vim: >\n\n    :set lazyredraw\n    :set noswapfile\n    :set undolevels=-1\n    :set eventignore=all\n    :set nohidden\n    :set syntax=off\n<\nNote that the above settings will disable many Vim features including the\nfollowing: Swap files support for crash recovery, undo support, syntax\nhighlighting, filetype detection and other autocommand based features.\n\nThere is also the LargeFile plugin available at\n\n    https://www.vim.org/scripts/script.php?script_id=1506\n\nwhich automatically sets these options, when working with large files\n(it is configurable, what is considered to be a large file, by default,\nit is 100MB).\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-6*\nSECTION 6 - EDITING MULTIPLE FILES ~\n\n \t\t\t\t\t\t\t\t*faq-6.1*\n6.1. How do I open multiple files at once from within Vim?\n\nMake a difference between args, buffers, tabs and windows. They are all\ndifferent things in VIM.\n\nargs is a list of arguments. Buffers are place to edit text, almost\nalways attached to a file but not necessarily. Window is a place for a\nbuffer and tab is set of windows, better name would be \"layout\".\n\nThere are several ways to open multiple files at once from within Vim. You\ncan use the `:next` command to specify a group of files: >\n\n    :next f1.txt f2.txt\n    :next *.c\n<\nYou can use the `:args` command to specify a group of files as arguments: >\n\n    :args f1.txt f2.txt\n    :args *.c\n<\nAfter loading the files, you can use the `:next` and `:prev` command to\nswitch between the files.\n\nTo execute command for all files in argument-list use `:argdo`\n\nFor more information, read:\n\n    |07.2|\n    |:next|\n    |:args_f|\n    |argument-list|\n\n \t\t\t\t\t\t\t\t*faq-6.2*\n6.2. How do I switch between multiple files/buffers in Vim?\n\nTo list all buffers use `:ls`, to list buffers without file attached to\n(also known as unlisted buffers, ex. scratch buffer and help-window) use\n`:ls!`\n\nThere are several ways to switch between multiple files. You can use the\n`:buffer` command to switch between multiple files. You can also shorten\ncommand as `:b` and use only part of the filename. For example, >\n\n    :buffer file1\n    :buffer file2\n    :b e2\n<\nYou can also use <TAB> after `:b` for autocompletion. Try also `:b`\nfollowed by CTRL-D to see all available buffers. This works also for\n`:e`.\n\nYou can also use the CTRL-^ key to switch between buffers. By specifying a\ncount before pressing the key, you can edit the buffer with that number.\nWithout the count, you can edit the alternate buffer by pressing CTRL-^\n\nYou can also use the `:e #` command to edit a particular buffer: >\n\n    :e #5\n<\nTo close a buffer use `:bd` -command.\n\nTo execute command for all files in buffer-list use `:bufdo`\n\nFor more information, read:\n\n    |edit-files|\n    |:buffer|\n    |CTRL-^|\n    |alternate-file|\n    |22.4|\n    |07.3|\n\n \t\t\t\t\t\t\t\t*faq-6.3*\n6.3. How do I open several files in Vim, with each file in a separate\n     window/tab?\n\nYou can use the -o and -O Vim command line arguments to open multiple files\nin separate horizontally or vertically split Vim windows. For example: >\n\n    $ vim -o3 f1.txt f2.txt f3.txt\n<\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate horizontally split Vim windows. >\n\n    $ vim -O3 f1.txt f2.txt f3.txt\n<\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate vertically split Vim windows. >\n\n    $ vim -p f1.txt f2.txt f3.txt\n<\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate tab windows. The option 'tabpagemax' defines, how many tabpages\ncan be opened at the same time, by default it is set to 10.\n\nFor more information, read:\n\n    |-o|\n    |-O|\n    |-p|\n    |startup-options|\n    |'tabpagemax'|\n\n \t\t\t\t\t\t\t\t*faq-6.4*\n6.4. How do I configure Vim to autoload several files at once similar to\n     \"work-sets\" or \"projects\"?\n\nYou can use the `:mksession` and the `:mkview` commands to autoload several\nfiles in Vim.\n\nThe `:mksession` command creates a Vim script that restores the current\nediting session. You can use the `:source` command to source the file\nproduced by the mksession command.\n\nThe `:mkview` command creates a Vim script that restores the contents of\nthe current window. You can use the `:loadview` command to load the view\nfor the current file.\n\nFor more information, read:\n\n    |21.4|\n    |21.5|\n    |views-sessions|\n    |'sessionoptions'|\n    |:mksession|\n    |:source|\n    |v:this_session|\n    |:mkview|\n    |:loadview|\n    |'viewdir'|\n    |buffers|\n\n \t\t\t\t\t\t\t\t*faq-6.5*\n6.5. Is it possible to open multiple top level windows in a single instance\n     of Vim similar to Nedit or Emacs?\n\nNo. It is currently not possible to open multiple top-level windows in a\nsingle instance of Vim. This feature is in the todo list.\n\n \t\t\t\t\t\t\t\t*faq-6.6*\n6.6. How do I browse/explore directories from within Vim?\n\nYou can use the netrw.vim plugin, supplied with the standard Vim\ninstallation, to browse/explore directories from within Vim. You can start\nthe file explorer using one of the following commands: >\n\n    :e <directory>\n    :Explore\n    :Sexplore\n    :Vexplore\n    :Texplore\n<\nFrom the file explorer, you can browse through directories, rename, delete\nand edit files.\n\nFor more information, read:\n\n    |netrw.vim|\n    |22.1|\n\n \t\t\t\t\t\t\t\t*faq-6.7*\n6.7. How do I edit files over a network using ftp/scp/rcp/http?\n\nYou can use the netrw.vim plugin, supplied with the standard Vim package,\nto edit files over a network using ftp/scp/rcp/http. Using this plugin, Vim\nwill transparently load and save the files over ftp/scp/rcp/http. For\nexample, to edit a file over ftp, you can use the following command: >\n\n    $ vim ftp://machine/path\n<\nFor more information, read:\n\n    |netrw.vim|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-7*\nSECTION 7 - BACKUP ~\n\n \t\t\t\t\t\t\t\t*faq-7.1*\n7.1. When I edit and save files, Vim creates a file with the same name as\n     the original file and a \"~\" character at the end. How do I stop Vim\n     from creating this file? (or) How do I disable the Vim backup file\n     feature?\n\nYou have set the 'backup' option, so Vim creates a backup file when saving\nthe original file. You can stop Vim from creating the backup file, by\nclearing the option: >\n\n    :set nobackup\n<\nNote that, by default this option is turned off. You have explicitly\nenabled the 'backup' option in one of the initialization files. You may\nalso have to turn off the 'writebackup' option: >\n\n    :set nowritebackup\n<\nFor more information, read:\n\n    |07.4|\n    |backup-table|\n    |'backup'|\n    |'writebackup'|\n    |'backupskip'|\n    |'backupdir'|\n    |'backupext'|\n    |'backupcopy'|\n    |backup|\n\n \t\t\t\t\t\t\t\t*faq-7.2*\n7.2. When I edit and save files, Vim creates a file with the same name as\n     the original file and a \"un~\" extension at the end. How do I stop Vim\n     from creating this file (or) How do I disable the Vim undofile feature?\n\nVim 7.3 contains as new feature persistent undo, that is, undo information\nwon't be lost when quitting Vim and be stored in a file that ends with\n\".un~\" You have set the 'undofile' option, so Vim creates an undo file when\nsaving the original file. You can stop Vim from creating the backup file,\nby clearing the option: >\n\n    :set noundofile\n<\nNote that, by default this option is turned off. You have explicitly\nenabled the 'undofile' option in one of the initialization files. If you\nwant your undofiles to be stored only in a particular directory, you can\npoint the 'undodir' option to a directory that will contain all your\naggregated undofiles.\n\nFor more information, read:\n\n    |'undodir'|\n    |'undofile'|\n    |undo-persistence|\n\n \t\t\t\t\t\t\t\t*faq-7.3*\n7.3. How do I configure Vim to store all the backup files in a particular\n     directory?\n\nYou can configure Vim to store all the backup files in a particular\ndirectory using the 'backupdir' option. For example, to store all the\nbackup files in the ~/backup directory, you can use the following command: >\n\n    :set backupdir=~/backup\n<\nFor more information, read:\n\n    |07.4|\n    |'backupdir'|\n    |backup|\n\n \t\t\t\t\t\t\t\t*faq-7.4*\n7.4. When I save a file with Vim, the file permissions are changed.\n     How do I configure Vim to save a file without changing the file\n     permissions?\n\nThis may happen, if the 'backupcopy' option is set to \"no\" or \"auto\". Note\nthat the default value for this option is set in such a way that this will\ncorrectly work in most of the cases. If the default doesn't work for you,\ntry setting the 'backupcopy' option to \"yes\" to keep the file permission\nwhen saving a file: >\n\n    :set backupcopy=yes\n<\nThis applies, only if you have configured Vim to make a backup whenever\noverwriting a file. By default, Vim will not backup files.\n\nFor more information, read:\n\n    |'backupcopy'|\n    |backup|\n    |'backup'|\n    |'writebackup'|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-8*\nSECTION 8 - BUFFERS ~\n\n \t\t\t\t\t\t\t\t*faq-8.1*\n8.1. I have made some modifications to a buffer. How do I edit another\n     buffer without saving the modified buffer and also without losing the\n     modifications?\n\nYou can set the 'hidden' option to edit a file without losing modifications\nto the current file: >\n\n    :set hidden\n<\nBy setting the 'hidden' option, you can also save the modification history\n(undo-history) for the buffer. Otherwise, as you switch between files, the\nundo-history will be lost (unless you use persistent undofiles).\n\nFor more information, read:\n\n    |'hidden'|\n    |hidden-quit|\n    |:hide|\n\n \t\t\t\t\t\t\t\t*faq-8.2*\n8.2. How do I configure Vim to auto-save a modified buffer when switching\n     to another buffer?\n\nYou can set the 'autowrite' option to auto-save a modified buffer when\nswitching to another buffer: >\n\n    :set autowrite\n<\nFor more information, read:\n\n    |'autowrite'|\n    |'autowriteall'|\n    |'hidden'|\n\n \t\t\t\t\t\t\t\t*faq-8.3*\n8.3. How do I replace the buffer in the current window with a blank buffer?\n\nYou can use the `:enew` command to load an empty buffer in place of the\nbuffer in the current window.\n\nFor more information, read:\n\n    |:enew|\n\n \t\t\t\t\t\t\t\t*faq-8.4*\n8.4. Is there a keyboard shortcut to load a buffer by the buffer number?\n\nYou can use the CTRL-^ command to load a buffer by specifying the buffer\nnumber. For example, to load buffer number 5, you have to use the 5 CTRL-^\ncommand.\n\nFor more information, read:\n\n    |CTRL-^|\n\n \t\t\t\t\t\t\t\t*faq-8.5*\n8.5. How do I open all the current buffers in separate windows?\n\nYou can use the `:ball` or `:sball` commands to open all the buffers\nin the buffer list: >\n\n    :ball\n<\nIf you want all buffers to be opened in new tabs, simply prefix the `:tab`\ncommand: >\n\n    :tab :sball\n<\nFor more information, read:\n\n    |:ball|\n\n \t\t\t\t\t\t\t\t*faq-8.6*\n8.6. How do I close (delete) a buffer without exiting Vim?\n\nYou can use any of `:bdelete`, `:bwipeout` or `:bunload` commands to\ndelete a buffer without exiting Vim. For example: >\n\n    :bdelete file1\n<\nFor more information, read:\n\n    |:bdelete|\n    |:bwipeout|\n    |:bunload|\n\n \t\t\t\t\t\t\t\t*faq-8.7*\n8.7. When I use the command `:%bd` to delete all the buffers, not all the\n     buffers are deleted. Why?\n\nIn the `:%bd` command, the \"%\" range will be replaced with the starting and\nending line numbers in the current buffer. Instead of using \"%\" as the\nrange, you should specify numbers for the range. For example, to delete all\nthe buffers, you can use the command `:1,9999bd`.\n\nFor more information, read:\n\n    |:bd|\n\n(This behaviour has been fixed with patch 7.4.530)\n\n \t\t\t\t\t\t\t\t*faq-8.8*\n8.8. How do I display the buffer number of the current buffer/file?\n\nYou can use 2<CTRL-G> command to display the buffer number for the current\nfile/buffer. Note the use of count before the CTRL-G command. If the count\nis greater than 1, then Vim will display the buffer number.\n\nYou can also use the following command to display the current buffer\nnumber: >\n\n    :echo bufnr(\"%\")\n<\nYou can also include the \"%n\" field to the 'statusline' option to display\nthe current buffer number on the statusline.\n\nFor more information, read:\n\n    |CTRL-G|\n    |bufnr()|\n    |:echo|\n    |'statusline'|\n\n \t\t\t\t\t\t\t\t*faq-8.9*\n8.9. How do I delete a buffer without closing the window in which the\n     buffer is displayed?\n\nYou can use the following command to open the next buffer and delete\nthe current buffer. >\n\n    :bnext | bdelete #\n<\nFor more information, read:\n\n    |:bnext|\n    |:bdelete|\n    |:buffers|\n\n \t\t\t\t\t\t\t\t*faq-8.10*\n8.10. How do I map the <Tab> key to cycle through and open all the buffers?\n\nYou can use the following two map commands, to map the <Ctrl-Tab> key to open\nthe next buffer and the <Ctrl-Shift-Tab> key to open the previous buffer: >\n\n    :nnoremap <C-Tab> :bnext<CR>\n    :nnoremap <S-C-Tab> :bprevious<CR>\n<\nNote, this might not work in the terminal version of Vim.\n\nFor more information, read:\n\n    |:bnext|\n    |:bprevious|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-9*\nSECTION 9 - WINDOWS ~\n\n \t\t\t\t\t\t\t\t*faq-9.1*\n9.1. What is the difference between a Vim window and a buffer?\n\nA Vim buffer is a file loaded into memory for editing. The original file\nremains unchanged until you write the buffer to the file. A Vim window is a\nviewport onto a buffer. You can use multiple windows on one buffer or\nseveral windows on different buffers.\n\nFor more information, read:\n\n    |usr_08.txt|\n    |22.4|\n    |windows-intro|\n    |Q_wi|\n\n \t\t\t\t\t\t\t\t*faq-9.2*\n9.2. How do I increase the width of a Vim window?\n\nYou can increase the width of a Vim window using one of the following\ncommands: >\n\n    :vert resize +N\n    :vert resize -N\n    :vert resize N\n<\nYou can also use CTRL-W < or CTRL-W > or CTRL-W | commands.\n\nFor more information, read:\n\n    |:vertical-resize|\n    |CTRL-W_>|\n    |CTRL-W_<|\n    |window-resize|\n\n \t\t\t\t\t\t\t\t*faq-9.3*\n9.3. How do I zoom into or out of a window?\n\nYou can zoom into a window (close all the windows except the current\nwindow) using the \"<CTRL-W>o\" command or the `:only` ex command.\n\nYou can use the \"<CTRL-W>_\" command or the `:resize` ex command to increase\nthe current window height to the highest possible without closing other\nwindows.\n\nYou can use the \"<CTRL-W>|\" command or the `:vertical resize` ex command to\nincrease the current window width to the highest possible without closing\nother windows.\n\nYou can use the \"<CTRL-W>=\" command to make the height and width of all the\nwindows equal.\n\nYou can also set the following options to get better results with the above\ncommands:\n\nMethod 1:\nSet the 'winminheight' option to 0: >\n\n    :set winminheight=0\n<\nBy default, this option is set to 1.\nThis option controls the minimum height of an inactive window (when it is\nnot the current window).  When the 'winminheight' option is set to 0, only\nthe status line will be displayed for inactive windows.\n\nMethod 2:\nSet the 'noequalalways' option and set the 'winheight' option to a large\nvalue (like 99999): >\n\n    :set noequalalways\n    :set winheight=99999\n<\nNow, the active window will always open to its maximum size, while the\nother windows will stay present, but shrunken to just a status line.\n\nWith any of the above mentioned methods, you cannot restore the window\nlayout after zooming into a window.  If you want to restore the Vim window\nlayout after zooming into a window, you can use the ZoomWin plugin. You can\ndownload this plugin from the Vim online website at:\n\n    https://www.vim.org/scripts/script.php?script_id=508\n\nFor more information, read:\n\n    |CTRL-W_o|\n    |window-resize|\n    |'winminheight'|\n    |'equalalways'|\n    |'winheight'|\n    |08.3|\n\n \t\t\t\t\t\t\t\t*faq-9.4*\n9.4. How do I execute an ex command on all the open buffers or open windows\n     or all the files in the argument list?\n\nYou can use the `:bufdo` command to execute an ex command on all the open\nbuffers.  You can use the `:windo` command to execute an ex command on all\nthe open windows.  You can use the `:argdo` command to execute an ex\ncommand on all the files specified in the argument list. And finally you\ncan use the `:tabdo` command to execute an ex command in all open tab pages.\n\nFor more information, read:\n\n    |:windo|\n    |:bufdo|\n    |:argdo|\n    |:tabdo|\n    |26.3|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-10*\nSECTION 10 - MOTION ~\n\n \t\t\t\t\t\t\t\t*faq-10.1*\n10.1. How do I jump to the beginning (first line) or end (last line) of a\n     file?\n\nYou can use \"G\" command to jump to the last line in the file and the \"gg\"\ncommand to jump to the first line in the file.\n\nFor more information, read:\n\n    |G|\n    |gg|\n\n \t\t\t\t\t\t\t\t*faq-10.2*\n10.2. In insert mode, when I press the <Esc> key to go to command mode, the\n     cursor moves one character to the left (except when the cursor is on\n     the first character of the line). Is it possible to change this\n     behavior to keep the cursor at the same column?\n\nNo. It is not possible to change this behavior. The cursor is always\npositioned on a valid character (unless you have virtual-edit mode\nenabled). So, if you are appending text to the end of a line, when you\nreturn to command mode the cursor *must* drop back onto the last character\nyou typed. For consistency sake, the cursor drops back everywhere, even if\nyou are in the middle of a line.\n\nYou can use the CTRL-O or CTRL-\\ CTRL-O command in insert mode to execute a\nsingle ex command and return back to insert mode without moving the cursor\ncolumn.\n\nFor more information, read:\n\n    |'virtualedit'|\n    |i_CTRL-O|\n    |i_CTRL-\\_CTRL-O|\n\n \t\t\t\t\t\t\t\t*faq-10.3*\n10.3. How do I configure Vim to maintain the horizontal cursor position when\n     scrolling with the <Page Up>, <Page Down>, etc keys?\n\nYou can reset the 'startofline' option to keep the cursor at the same\nhorizontal location when scrolling text: >\n\n    :set nostartofline\n<\nFor more information, read:\n\n    |'startofline'|\n\n \t\t\t\t\t\t\t\t*faq-10.4*\n10.4. Some lines in a file are more than the screen width and they are all\n     wrapped. When I use the j, k keys to move from one line to the next,\n     the cursor is moved to the next line in the file instead of the next\n     line on the screen. How do I move from one screen line to the next?\n\nYou can use the gj and gk commands to move from one screen line to the\nnext/previous screen line. The j and k commands move the cursor from one\nfile line to the next file line. You can also avoid the line wrapping by\nresetting the 'wrap' option: >\n\n    :set nowrap\n<\nFor more information, read:\n\n    |gj|\n    |gk|\n    |'wrap'|\n\nYou can use the following mappings: >\n\n    :map <Up> gk\n    :imap <Up> <C-o>gk\n    :map <Down> gj\n    :imap <Down> <C-o>gj\n    :noremap j gj\n    :noremap k gk\n<\n \t\t\t\t\t\t\t\t*faq-10.5*\n10.5. What is the definition of a sentence, paragraph and section in Vim?\n\nA sentence is defined as ending at a \".\", \"!\" or \"?\" followed by either the\nend of a line, or by a space (or two) or tab. Which characters and the\nnumber of spaces needed to constitute a sentence ending is determined by\nthe 'joinspaces' and 'cpoptions' options.\n\nA paragraph begins after each empty line, and also at each of a set of\nparagraph macros, specified by the pairs of characters in the 'paragraphs'\noption.\n\nA section begins after a form-feed (<C-L>) in the first column and at each\nof a set of section macros, specified by the pairs of characters in the\n'sections' option.\n\nFor more information, read:\n\n    |sentence|\n    |'joinspaces'|\n    |'cpoptions'|\n    |paragraph|\n    |section|\n    |word|\n\n \t\t\t\t\t\t\t\t*faq-10.6*\n10.6. How do I jump to beginning or end of a sentence, paragraph or a\n     section?\n\nYou can use the following motion commands to jump to the beginning or end\nof a sentence or a paragraph or a section:\n\n      motion  position    where ~\n      ------  ---------   ----------------- ~\n      (       beginning   current sentence\n      )       end         current sentence\n      {       beginning   current paragraph\n      }       end         current paragraph\n      []      end         previous section\n      [[      beginning   current section\n      ][      end         current section\n      ]]      beginning   next section\n\nEach of these motions can be preceded by a number which will extend the\njump forward (or backward).\n\nFor more information, read:\n\n    |object-motions|\n\n \t\t\t\t\t\t\t\t*faq-10.7*\n10.7. I have lines in a file that extends beyond the right extent of the\n     screen. How do I move the Vim view to the right to see the text off\n     the screen?\n\nYou can use one of the following commands to horizontally scroll the screen\nto the left or right:\n\n    cmd  scroll to ~\n    ---  -------------------------- ~\n    zl   scroll to the left\n    zh   scroll to the right\n    zL   scroll half a screenwidth to the left\n    zH   scroll half a screenwidth to the right\n    zs   scroll to position the cursor at the start of the screen\n    ze   scroll to position the cursor at the end of the screen\n\nYou can use the g0 command to move the cursor to the first character of the\nscreen line and the g$ command to move the cursor to the last character of\nthe screen line without scrolling the screen.\n\nFor more information, read:\n\n    |scroll-horizontal|\n\n \t\t\t\t\t\t\t\t*faq-10.8*\n10.8. How do I scroll two or more buffers simultaneously?\n\nYou can set the 'scrollbind' option for each of the buffers to scroll them\nsimultaneously.\n\nFor more information, read:\n\n    |'scrollbind'|\n    |scroll-binding|\n    |'scrollopt'|\n    |'cursorbind'|\n\n \t\t\t\t\t\t\t\t*faq-10.9*\n10.9. When I use my arrow keys, Vim changes modes, inserts weird characters\n     in my document but doesn't move the cursor properly. What's going on?\n\nThere are a couple of things that could be going on: either you are using\nVim over a slow connection or Vim doesn't understand the key sequence that\nyour keyboard is generating.\n\nIf you are working over a slow connection (such as a 2400 bps modem), you\ncan try to set the 'timeout' or 'ttimeout' option. These options, combined\nwith the 'timeoutlen' and 'ttimeoutlen' options, may fix the problem.\n\nThe preceding procedure will not work correctly if your terminal sends key\ncodes that Vim does not understand. In this situation, your best option is\nto map your key sequence to a matching cursor movement command and save\nthese mappings in a file. You can then `:source` the file whenever you work\nfrom that terminal.\n\nFor more information, read:\n\n    |'timeout'|\n    |'ttimeout'|\n    |'timeoutlen'|\n    |'ttimeoutlen'|\n    |:map|\n    |vt100-cursor-keys|\n\n \t\t\t\t\t\t\t\t*faq-10.10*\n10.10. How do I configure Vim to move the cursor to the end of the previous\n      line, when the left arrow key is pressed and the cursor is currently\n      at the beginning of a line?\n\nYou can add the \"<\" flag to the 'whichwrap' option to configure Vim to move\nthe cursor to the end of the previous line, when the left arrow key is\npressed and the cursor is currently at the beginning of a line: >\n\n    :set whichwrap+=<\n<\nSimilarly, to move the cursor the beginning of the next line, when the\nright arrow key is  pressed and the cursor is currently at the end of a\nline, add the \">\" flag to the 'whichwrap' option: >\n\n    :set whichwrap+=>\n<\nThe above will work only in normal and visual modes. To use this in insert\nand replace modes, add the \"[\" and \"]\" flags respectively.\n\nFor more information, read:\n\n    |'whichwrap'|\n    |05.7|\n\n \t\t\t\t\t\t\t\t*faq-10.11*\n10.11. How do I configure Vim to stay only in insert mode (modeless\n      editing)?\n\nYou can set the 'insertmode' option to configure Vim to stay only in insert\nmode: >\n\n    :set insertmode\n<\nBy setting this option, you can use Vim as a modeless editor. If you press\nthe <Esc> key, Vim will not go to the normal mode. To execute a single\nnormal mode command, you can press CTRL-O followed by the normal mode\ncommand.  To execute more than one normal command, you can use CTRL-L\nfollowed by the commands. To return to insert mode, press the <Esc> key. To\ndisable this option, reset the 'insertmode' option: >\n\n    :set noinsertmode\n<\nYou can also start vim using the \"evim\" command or you can use \"vim -y\" to\nuse Vim as a modeless editor.\n\nYou can also start Vim in insert mode using the `:startinsert` ex command.\n\nFor more information, read:\n\n    |'insertmode'|\n    |:startinsert|\n    |:stopinsert|\n    |i_CTRL-O|\n    |i_CTRL-L|\n    |evim|\n    |evim-keys|\n\n \t\t\t\t\t\t\t\t*faq-10.12*\n10.12. How do I display some context lines when scrolling text?\n\nYou can set the 'scrolloff' option to display a minimal number of screen\nlines (context) above and below the cursor. >\n\n    :set scrolloff=10\n<\nFor more information, read:\n\n    |'scrolloff'|\n    |'sidescrolloff'|\n\n \t\t\t\t\t\t\t\t*faq-10.13*\n10.13. How do I go back to previous cursor locations?\n\nYou can go back to the cursor location before the latest jump using the ''\nor `` command. You can use the CTRL-O command to go back to older cursor\npositions and the CTRL-I command to go to the newer cursor positions in the\njump list.\n\nFor more information, read:\n\n    |03.10|\n    |mark-motions|\n    |jump-motions|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-11*\nSECTION 11 - SEARCHING TEXT ~\n\n \t\t\t\t\t\t\t\t*faq-11.1*\n11.1. After I searched for a text with a pattern, all the matched text\n      stays highlighted. How do I turn off the highlighting\n      temporarily/permanently?\n\nThe 'hlsearch' option controls whether all the matches for the last\nsearched pattern are highlighted or not. By default, this option is not\nenabled. If this option is set in a system-wide vimrc file, then you can\nturn off the search highlighting by using the following command: >\n\n    :set nohlsearch\n<\nTo temporarily turn off the search highlighting, use >\n\n    :nohlsearch\n<\nYou can also clear the search highlighting, by searching for a pattern that\nis not in the current file (for example, search for the pattern \"asdf\").\n\nYou can use this mapping, to clear the search highlighting when\nredrawing the window pressing CTRL-L >\n\n    :nnoremap <silent> <C-L> <C-L>:nohls<CR>\n<\nFor more information, read:\n\n    |'hlsearch'|\n    |:nohlsearch|\n\n \t\t\t\t\t\t\t\t*faq-11.2*\n11.2. How do I enter a carriage return character in a search pattern?\n\nYou can either use \"\\r\" or <CTRL-V><CTRL-M> to enter a carriage return\ncharacter in a pattern. In Vim scripts, it is better to use \"\\r\" for the\ncarriage return character.\n\nFor more information, read:\n\n    |sub-replace-special|\n\n \t\t\t\t\t\t\t\t*faq-11.3*\n11.3. How do I search for the character ^M?\n\nYou can enter the ^M character in a search command by first pressing the\nCTRL-V key and then pressing the CTRL-M key. >\n\n    /^V^M\n<\nYou can also use the \"\\r\" character. In Vim scripts, \"\\r\" is preferred.\n\nFor more information, read:\n\n    |c_CTRL-V|\n    |using_CTRL-V|\n    |/\\r|\n\n \t\t\t\t\t\t\t\t*faq-11.4*\n11.4. How can I search/replace characters that display as \"~R\", \"~S\", etc.?\n\nYou can use the \"ga\" command to display the ASCII value/code for the\nspecial character. For example, let us say the ASCII value is 142. Then you\ncan use the following command to search for the special character: >\n\n    /^V142\n<\nwhere, ^V is entered by pressing CTRL-V.\n\nFor more information, read:\n\n    |ga|\n    |using_CTRL-V|\n    |24.8|\n\n \t\t\t\t\t\t\t\t*faq-11.5*\n11.5. How do I highlight all the non-printable characters in a file?\n\nYou can use the following commands and search pattern to highlight all the\nnon-printable characters in a file: >\n\n    :set hlsearch\n    /\\(\\p\\|$\\)\\@!.\n<\nFor more information, read:\n\n    |/\\p|\n    |/bar|\n    |/$|\n    |/\\(|\n    |/\\@!|\n    |'hlsearch'|\n\n \t\t\t\t\t\t\t\t*faq-11.6*\n11.6. How do I search for whole words in a file?\n\nYou can search for whole words in a file using the \\< and \\> atoms. For\nexample: >\n\n    /\\<myword\\>\n<\nThe \\< atom matches the beginning of the word and the \\> atom matches the\nend of the word.\n\nFor more information, read:\n\n    |/\\<|\n    |/\\>|\n\n \t\t\t\t\t\t\t\t*faq-11.7*\n11.7. How do I search for the current word under the cursor?\n\nYou can press the * key to search forward for the current word under the\ncursor.  To search backward, you can press the # key. Note that only whole\nkeywords will be searched using these commands.\n\nFor more information, read:\n\n    |star|\n    |#|\n    |gstar|\n    |g#|\n    |03.8|\n    |search-commands|\n\n \t\t\t\t\t\t\t\t*faq-11.8*\n11.8. How do I search for a word without regard to the case (uppercase or\n      lowercase)?\n\nTo always ignore case while searching for a pattern, set the 'ignorecase'\noption: >\n\n    :set ignorecase\n<\nTo ignore case only when searching a particular pattern, use the special \\c\ndirective: >\n\n    /\\c<pattern>\n<\nFor more information, read:\n\n    |'ignorecase'|\n    |/ignorecase|\n    |/\\c|\n\n \t\t\t\t\t\t\t\t*faq-11.9*\n11.9. How do I search for words that occur twice consecutively?\n\nYou can use one of the following search commands to locate words that occur\ntwice consecutively: >\n\n     /\\(\\<\\w\\+\\)\\_s\\+\\1\\>\n     /\\(\\<\\k\\+\\)\\_s\\+\\1\\>\n<\nThe main difference is the use of \"\\w\" and \"\\k\", where the latter is based\non the 'iskeyword' option which may include accented and other language\nspecific characters.\n\nFor more information, read:\n\n    |/\\1|\n    |/\\(|\n    |/\\)|\n    |/\\<|\n    |/\\>|\n    |/\\w|\n    |/\\k|\n    |/\\+|\n    |/\\_x|\n    |'iskeyword'|\n\n \t\t\t\t\t\t\t\t*faq-11.10*\n11.10. How do I count the number of times a particular word occurs in a\n       buffer?\n\nYou can use the following set of commands to count the number of times a\nparticular word occurs in a buffer: >\n\n    :let cnt=0\n    :g/\\<your_word\\>/let cnt=cnt+1\n    :echo cnt\n<\nThis only counts the number of lines where the word occurs. You can also\nuse the following command: >\n\n    :%s/\\<word\\>/&/gn\n<\nTo count the number of alphabetic words in a file, you can use >\n\n    :%s/\\a\\+/&/gn\n<\nTo count the number of words made up of non-space characters, you can use >\n\n    :%s/\\S\\+/&/gn\n<\nFor more information, read:\n\n    |count-items|\n    |word-count|\n    |v_g_CTRL-G|\n    |12.5|\n    |:s_flags|\n\n \t\t\t\t\t\t\t\t*faq-11.11*\n11.11. How do I place the cursor at the end of the matched word when\n       searching for a pattern?\n\nYou can use the \"e\" offset to the search command to place the cursor at the\nend of the matched word. For example >\n\n    /mypattern/e\n<\nFor more information about search offsets, read:\n\n    |search-offset|\n    |/|\n\n \t\t\t\t\t\t\t\t*faq-11.12*\n11.12. How do I search for an empty line?\n\nYou can search for an empty line using: >\n\n    /^$\n<\n    or >\n\n    /^\\s*$\n<\nThe latter also matches lines, that consist only of white space, while the\nformer only matches true empty lines. For more information, read:\n\n    |/^|\n    |/$|\n    |/\\s|\n    |/star|\n    |search-commands|\n\n \t\t\t\t\t\t\t\t*faq-11.13*\n11.13. How do I search for a line containing only a single character?\n\nYou can search for a line containing only a single character using: >\n\n    /^\\s*\\a\\s*$\n<\nFor more information, read:\n\n    |/^|\n    |/\\a|\n    |/\\s|\n    |/star|\n    |/$|\n\n \t\t\t\t\t\t\t\t*faq-11.14*\n11.14. How do I search and replace a string in multiple files?\n\nYou can use the `:argdo`, `:bufdo`, `:windo` or `:tabdo` commands to execute\nan ex command on multiple files. For example: >\n\n    :argdo %s/foo/bar/g|upd\n<\nFor more information, read:\n\n    |:argdo|\n    |:bufdo|\n    |:windo|\n    |:tabdo|\n\n \t\t\t\t\t\t\t\t*faq-11.15*\n11.15. I am using the `:s` substitute command in a mapping. When a search\n       for a pattern fails, the map terminates. I would like the map to\n       continue processing the next command, even if the substitute command\n       fails. How do I do this?\n\nYou can use the \"e\" flag to the substitute command to continue processing\nother commands in a map, when a pattern is not found.\n\nFor more information, read:\n\n    |:s_flags|\n\n \t\t\t\t\t\t\t\t*faq-11.16*\n11.16. How do I search for the n-th occurrence of a character in a line?\n\nTo search for the n-th occurrence of a character in a line, you can prefix\nthe \"f\" command with a number. For example, to search for the 5th\noccurrence of the character @ in a line, you can use the command 5f@. This\nassumes the cursor is at the beginning of the line - and that this first\ncharacter is not the one your are looking for.\n\nFor more information, read:\n\n    |f|\n    |F|\n    |t|\n    |T|\n    |;|\n    |,|\n\n \t\t\t\t\t\t\t\t*faq-11.17*\n11.17. How do I replace a tab (or any other character) with a hard return\n       (newline) character?\n\nYou can replace a tab (or any other character) with a hard return (newline)\ncharacter using the following command: >\n\n    :s/\\t/\\r/\n<\nNote that in the above command, if you use \\n instead of \\r, then the tab\ncharacters will not be replaced by a new-line character.\n\nFor more information, read:\n\n    |sub-replace-special|\n    |NL-used-for-Nul|\n    |CR-used-for-NL|\n\n \t\t\t\t\t\t\t\t*faq-11.18*\n11.18. How do I search for a character by its ASCII value?\n\nYou can search for a character by its ASCII value by pressing CTRL-V\nfollowed by the decimal or hexadecimal or octal value of that character in\nthe search \"/\" command.  To determine the ASCII value of a character you\ncan use the `:ascii` or the \"ga\" command.\n\nFor example, to search for the ASCII character with value 188, you can\nuse one of the following search commands: >\n\n    /<CTRL-V>188\n    /<CTRL-V>o274\n    /<CTRL-V>xBC\n    /<CTRL-V>u00bc\n<\nYou can also search for the character with the decimal/octal/hex number\nusing a collation [] like this: >\n\n    /[\\d188]\n    /[\\o274]\n    /[\\xbc]\n    /[\\u00bc]\n<\nAlternatively, you can use the special atom \\%d \\%o \\%x \\%u: >\n\n    /\\%d188\n    /\\%o274\n    /\\%xbc\n    /\\%u00bc\n<\nOr you use digraphs to enter the character. For example enter: >\n\n    /CTRL-K14\n<\nto search for the above character.\n\nFor more information, read:\n\n    |i_CTRL-V_digit|\n    |:ascii|\n    |ga|\n    |/\\]|\n    |/\\%d|\n    |digraphs|\n\n \t\t\t\t\t\t\t\t*faq-11.19*\n11.19. How do I search for long lines?\n\nYou can search for long lines or lines containing more than a specific\nnumber of characters using the Vim regular-expressions in the search\ncommand. For example, to search for all the lines containing more than 80\ncharacters, you can use one of the following commands: >\n\n    /^.\\{80}.\\+$\n    /^.*\\%>80c.*$\n    /^.*\\%>80v.*$\n<\nFor more information, read:\n\n    |/\\{|\n    |/\\%c|\n    |/\\%v|\n\n \t\t\t\t\t\t\t\t*faq-11.20*\n11.20. How do I display all the lines in the current buffer that contain a\n       specified pattern?\n\nYou can use the following command to display all the lines in the current\nbuffer that contain a specified pattern: >\n\n    :g/<pattern>/p\n<\nFor example, the following command will display all the lines in the\ncurrent buffer that contain \"vim\": >\n\n    :g/vim/p\n<\nSince `:p` is the default command to be executed for the ex command `:g`, you\ncan also use: >\n\n    :g/vim\n<\nIf you also want the corresponding line numbers, then you can use the\nfollowing command: >\n\n    :g/<pattern>/#\n<\nFor more information, read:\n\n    |:global|\n    |:print|\n    |:number|\n\n \t\t\t\t\t\t\t\t*faq-11.21*\n11.21. How do I search for a text string that spans multiple lines?\n\nYou can search for a text string that spans multiple lines using the \\_x\nregular expression atom. For example, to search for the text string \"Hello\nWorld\", you can use the following search command: >\n\n    /Hello\\_sWorld\n<\nThis will match the word \"Hello\" followed by a newline character and then\nthe word \"World\" at the beginning of the next line. This will also match\nthe word \"Hello\" immediately followed by a space character and then the\nword \"World\". When searching for the \"Hello World\" string, to include the\nspace characters at the end and beginning of the line, you can use the\nfollowing search command: >\n\n    /Hello\\_s\\+World\n<\nFor more information, read:\n\n    |27.8|\n    |pattern-atoms|\n    |/\\_|\n    |pattern-searches|\n\n \t\t\t\t\t\t\t\t*faq-11.22*\n11.22. How do I search for a pattern within the specified range of lines\n       in a buffer?\n\nYou can search for a pattern within a range of lines using the \\%>l\nand \\%<l regular expression atoms.\n\nFor example, to search for the word \"white\" between the lines 10 and 30 in\na buffer, you can use the following command: >\n\n    /white\\%>9l\\%<31l\n<\nFor more information, read:\n\n    |/\\%l|\n\n \t\t\t\t\t\t\t\t*faq-11.23*\n11.23. How do I clear the last searched pattern?\n\nThe last searched pattern is stored in the \"/\" register. You can clear\nthis register using the following command: >\n\n    :let @/=\"\"\n<\nTo clear the last search pattern whenever a buffer is unloaded, you can use\nthe following command: >\n\n    :autocmd BufUnload * let @/ = \"\"\n<\nFor more information, read:\n\n    |@/|\n    |:let-@|\n    |autocmd-searchpat|\n    |last-pattern|\n\n \t\t\t\t\t\t\t\t*faq-11.24*\n11.24. Why does this pattern \"a.\\{-}p\\@!\" not match?\n\n\"\\{-}\" doesn't just mean \"as few as possible\", it means \"as few as\npossible to make the whole pattern succeed\". If it didn't match the \"p\",\nthe whole pattern would fail (because of the \"p\\@!\") so it does match\nthe \"p\". It is a longer match, but it is the shortest match that makes\nthe whole pattern succeed.\n\nIf you wanted \"as few as possible regardless\" you would use \"\\@>\", which\nbasically divides a pattern up so that the pieces either side behave\nindependently. If the pattern were \"a.\\{-}\\@>p\\@!\" then \".\\{-}\" would\nalways match nothing because that's the smallest match that can succeed\nwhen there are not other restrictions. The whole pattern then would\nbehave the same as \"ap\\@!\", i.e. it would match any \"a\" not followed by\na \"p\").\n\nThis means, it matches as few as possible \"a\"s without trying to keep\ngoing until Vim finds the longest match. This means, it will still match\n\"ap\".\n\n \t\t\t\t\t\t\t\t*faq-11.25*\n11.25. How can I use \"/\" within a pattern, without escaping it?\n\nWhen using / to search for a pattern, you need to escape all \"/\" within\nthe pattern, because they would otherwise terminate the pattern. So you\ncan't directly search for /usr/share/doc/ but need to search for\n\\/usr\\/share\\/doc\\/\n\nThe easiest solution around that, would be to use \"?\" to start a\nbackward search and afterwards use /<CR> to use the last search-pattern\nin forward direction.\n\nIf you have a Vim, that has the eval-feature built in (which needs at\nleast a normal built or higher), you can also directly paste the pattern\ninto the search register:\n\n:let @/ = '/usr/share/doc/'\n\nThen use \"n\" to jump to the next occurrence.\n\nSee also the help at\n\n    |@/|\n    |/<CR>|\n\n \t\t\t\t\t\t\t\t*faq-11.26*\n11.26. How can I operate on a search match?\n\nThe \"gn\" command makes it easy to operate on regions of text that match\nthe current search pattern. By default, it will search forward for the\nlast used search pattern and visually select the match. If the cursor is\nalready on the match, it will be visually selected. If you used the \"gn\"\ncommand after an operator (e.g. \"c\" to change text), it will be applied\non the match.\n\nIf Visual mode is active before using gn, the visual selection will be\nextended until the end of the next match.\n\nThe \"gN\" commands works similar but searches backwards.\n\nThis allows to repeat simple operations on each match. For example, you\nmight want to change each occurence of apples by peaches. So you search\nusing \"/apple\" then you can use \"cgnpeach<Esc>\" to replace the current\nmatch by peach. Now you can use the dot \".\" command to redo the\nreplacement for the rest of the buffer.\n\nSee also the help at\n\n    |gn|\n    |gN|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-12*\nSECTION 12 - CHANGING TEXT ~\n\n \t\t\t\t\t\t\t\t*faq-12.1*\n12.1. How do I delete all the trailing white space characters (SPACE and\n      TAB) at the end of all the lines in a file?\n\nYou can use the `:substitute` command on the entire file to search and\nremove all the trailing white space characters: >\n\n    :%s/\\s\\+$//\n<\nFor more information, read:\n\n    |:%|\n    |:s|\n    |/\\s|\n    |/\\+|\n    |/$|\n\n \t\t\t\t\t\t\t\t*faq-12.2*\n12.2. How do I replace all the occurrences of multiple consecutive space\n      characters to a single space?\n\nYou can use the following command to replace all the occurrences of\nmultiple consecutive space characters to a single space: >\n\n    :%s/ \\{2,}/ /g\n<\nAlternatively use: >\n\n    :%s/  \\+/ /g\n<\nFor more information, read:\n\n    |:%|\n    |:s|\n    |/\\{|\n    |:s_flags|\n\n \t\t\t\t\t\t\t\t*faq-12.3*\n12.3. How do I reduce a range of empty lines into one line only?\n\nYou can use the following command to reduce a range of empty lines into one\nline only: >\n\n    :v/./.,/./-1join\n<\nThe explanation for this command is below:\n\n    part            description ~\n    -----           -------------------------- ~\n    :v/./           Execute the following command for all lines not\n                    containing a character (empty lines).\n     .,             Use the current line as the start of the range of\n                    lines.\n     /./            Use the line containing a character as the last line.\n     -1             Adjust the range of lines to end with the line before\n                    the last line.\n     j              Join the lines in the range.\n\nNote that this will give an error message if the empty lines are at the end\nof the file. To correct this, you have to add a temporary line at the end\nof the file, execute the command and then remove the temporary line.\n\nFor more information, read:\n\n    |:v|\n    |:join|\n    |cmdline-ranges|\n    |collapse|\n\n \t\t\t\t\t\t\t\t*faq-12.4*\n12.4. How do I delete all blank lines in a file? How do I remove all the\n      lines containing only space characters?\n\nTo remove all blank lines, use the following command: >\n\n    :g/^$/d\n<\nTo remove all lines with only whitespace (spaces or tabs) in them, use the\nfollowing command: >\n\n    :g/^\\s\\+$/d\n<\nTo remove all the lines with only whitespace, if anything, use the\nfollowing command: >\n\n    :g/^\\s*$/d\n<\n \t\t\t\t\t\t\t\t*faq-12.5*\n12.5. How do I copy/yank the current word?\n\nYou can use the \"yiw\" (yank inner word without whitespace) command or the\n\"yaw\" (yank a word with whitespace) command to copy/yank the current\nword.\n\nFor more information, read:\n\n    |04.6|\n    |04.8|\n    |iw|\n    |yank|\n    |text-objects|\n    |objects|\n\n \t\t\t\t\t\t\t\t*faq-12.6*\n12.6. How do I yank text from one position to another position within a\n      line, without yanking the entire line?\n\nYou can specify a motion command with the yank operator (y) to yank text\nfrom one position to another position within a line. For example, to yank\nfrom the current cursor position till the next letter x, use yfx or Fx or\ntx or Tx. To yank till the nth column, use n|. To yank till the next\noccurrence of a \"word\", use /word. To do a yank till the nth column on\nanother line, first mark the position using the \"ma\" command, go to the\nstart of the yank position, and then yank till the mark using y`a (note the\ndirection of the quote)\n\nFor more information, read:\n\n    |yank|\n    |motion.txt|\n    |04.6|\n\n \t\t\t\t\t\t\t\t*faq-12.7*\n12.7. When I yank some text into a register, how do I append the text to\n      the current contents of the register?\n\nWhen you specify the register for some operation, if you use the upper-case\nfor the register name, then the new text will be appended to the existing\ncontents. For example, if you have some text in the register \"a\". If you\nwant to append some new text to this, you have to use the \"A\" register\nname. If you use the lowercase register name, then the contents of the\nregister will be overwritten with the new text.\n\nFor more information, read:\n\n    |quote|\n    |quote_alpha|\n    |10.1|\n\n \t\t\t\t\t\t\t\t*faq-12.8*\n12.8. How do I yank a complete sentence that spans over more than one line?\n\nTo yank a complete sentence that spans over more than one line you have to\nuse the yank operator followed by a motion command. For example: >\n\n        y)\n<\nFrom inside the sentence you can use \"yi)\" to yank the sentence.\n\nFor more information, read:\n\n    |yank|\n    |{motion}|\n    |object-motions|\n    |04.6|\n\n \t\t\t\t\t\t\t\t*faq-12.9*\n12.9. How do I yank all the lines containing a pattern into a buffer?\n\nYou can use the `:global` command to yank all the lines containing the\npattern into a register and then paste the contents of the register into\nthe buffer: >\n\n    :let @a=''\n    :g/mypattern/y A\n<\nThe first command, clears the contents of the register \"a\". The second\ncommand copies all the lines containing \"mypattern\" into the register \"a\".\nNote that the capital letter \"A\" is used to append the matched lines. Now\nyou can paste the contents of register \"a\" to a buffer using \"ap command.\n\nIf you only want to collect all matches, you can use a different\napproach. For that run the `:s` command with the flags \"gn\" so that it\nwon't actually  change the buffer (\"n\" flag) but select each match (\"g\"\nflag). Combining this with the \"\\=\" part in the replacement part, you\ncan copy each match to e.g. a list. Altogether this looks like this: >\n\n    :let list=[]\n    :%s/pattern/\\=add(list, submatch(0))/gn\n<\nNow all matches will be in the list and you can post process them as\nwanted.\n\nFor more information, read:\n\n    |:g|\n    |:y|\n    |:let-register|\n    |quote_alpha|\n    |put|\n    |registers|\n    |:registers|\n    |sub-replace-\\=|\n\n \t\t\t\t\t\t\t\t*faq-12.10*\n12.10. How do I delete all the lines in a file that do not contain a\n       pattern?\n\nYou can use `:v` command to delete all the lines that do not contain a\npattern: >\n\n    :v/pattern/d\n<\nor >\n\n    :g!/pattern/d\n<\nFor more information, read:\n\n    |:v|\n    |:g|\n\n \t\t\t\t\t\t\t\t*faq-12.11*\n12.11. How do I add a line before each line with \"pattern\" in it?\n\nYou can use the following command to add a line before each line with\n\"pattern\" in it: >\n\n    :g/pattern/normal! Oi<line of text goes here>\n<\nAlternatively you can yank the line using the Y command and then insert the\nline using the following command: >\n\n    :g/pattern/put!\n<\nFor more information, read:\n\n    |:g|\n    |:put|\n    |insert|\n    |0|\n\n \t\t\t\t\t\t\t\t*faq-12.12*\n12.12. Is there a way to operate on a line if the previous line contains a\n       particular pattern?\n\nYou can use the `:global` command to operate on a line, if the previous\nline contains a particular pattern: >\n\n    :g/<pattern>/+{cmd}\n<\nFor more information, read:\n\n    |:g|\n    |:range|\n\n \t\t\t\t\t\t\t\t*faq-12.13*\n12.13. How do I execute a command on all the lines containing a pattern?\n\nYou can use the `:global` (:g) command to execute a command on all the\nlines containing a pattern. >\n\n    :g/my pattern/d\n<\nIf you want to use a non-Ex command, then you can use the `:normal`\ncommand: >\n\n    :g/my pattern/normal {command}\n<\nUnless you want the normal mode commands to be remapped, consider using a\n`:normal!` command instead (note the \"!\").\n\nFor more information, read:\n\n    |:global|\n    |:v|\n    |:normal|\n\n \t\t\t\t\t\t\t\t*faq-12.14*\n12.14. Can I copy the character above the cursor to the current cursor\n       position?\n\nIn Insert mode, you can copy the character above the cursor to the current\ncursor position by typing CTRL-Y. The same can be done with the\ncharacters below the cursor by typing CTRL-E.\n\nFor more information, read:\n\n    |i_CTRL-Y|\n    |i_CTRL-E|\n\n \t\t\t\t\t\t\t\t*faq-12.15*\n12.15. How do I insert a blank line above/below the current line without\n       entering insert mode?\n\nYou can use the `:put` ex command to insert blank lines. For example, try >\n\n    :put =''\n    :put! =''\n<\nFor more information, read:\n\n    |:put|\n\n \t\t\t\t\t\t\t\t*faq-12.16*\n12.16. How do I insert the name of the current file into the current buffer?\n\nThere are several ways to insert the name of the current file into the\ncurrent buffer. In insert mode, you can use the <C-R>% or the\n<C-R>=expand(\"%\") command. In normal mode, you can use the `:put =@%`\ncommand.\n\nFor more information, read:\n\n    |i_CTRL-R|\n    |expand()|\n    |!!|\n\n \t\t\t\t\t\t\t\t*faq-12.17*\n12.17. How do I insert the contents of a Vim register into the current\n       buffer?\n\nIn insert mode, you can use the <CTRL-R><register> command to insert the\ncontents of <register>. For example, use <CTRL-R>a to insert the contents\nof register \"a\" into the current buffer.\n\nIn normal mode, you can use the `:put <register>` command to insert the\ncontents of <register>. For example, use the `:put d` command to insert\nthe contents of register \"d\" into the current buffer.\n\nFor more information, read:\n\n    |i_CTRL-R|\n    |i_CTRL-R_CTRL-R|\n    |i_CTRL-R_CTRL-O|\n    |i_CTRL-R_CTRL-P|\n    |:put|\n\n \t\t\t\t\t\t\t\t*faq-12.18*\n12.18. How do I move the cursor past the end of line and insert some\n       characters at some columns after the end of the line?\n\nYou can set the 'virtualedit' option to move the cursor past the\nend-of-line and insert characters in a column after the end-of-line. To\nstart the virtual mode, use >\n\n    :set virtualedit=all\n<\nFor more information, read:\n\n    |'virtualedit'|\n\n \t\t\t\t\t\t\t\t*faq-12.19*\n12.19. How to replace the word under the cursor (say: junk) with\n      \"foojunkbar\" in Vim?\n\nThere are several ways to do this. If the word is the first such word on\nthe line, use the following command: >\n\n    :exe \"s/\".expand(\"<cword>\").\"/foo&bar/\"\n<\nTo match specifically you could use a more complex substitution like this: >\n\n    :exe 's/\\<'.expand(\"<cword>\").'\\%>'.(col(\".\")-1).'c\\>/foo&bar/'\n<\nYou can also use the command: ciwfoo<C-R>\"bar<Esc>\n\nFor more information, read:\n\n    |:substitute|\n    |expand()|\n    |col()|\n    |/\\%c|\n\n \t\t\t\t\t\t\t\t*faq-12.20*\n12.20. How do I replace a particular text in all the files in a directory?\n\nYou can use the `:argdo` command to execute the substitute command on all\nthe files specified as arguments: >\n\n    :args *\n    :argdo %s/<your_text>/<replacement_text>/ge | update\n<\nFor more information, read:\n\n    |:args_f|\n    |:argdo|\n    |:s_flags|\n\n \t\t\t\t\t\t\t\t*faq-12.21*\n12.21. I have some numbers in a file. How do I increment or decrement the\n       numbers in the file?\n\nYou can use the CTRL-A key to increment the number and the CTRL-X key to\ndecrement the number. You can also specify the number to\nincrement/decrement from the number by specifying a count to the key. This\nworks for decimal, octal and hexadecimal numbers. You can change the base\nused by Vim for this operation by modifying the 'nrformats' option.\n\nFor more information, read:\n\n    |26.2|\n    |CTRL-A|\n    |CTRL-X|\n    |'nrformats'|\n\n \t\t\t\t\t\t\t\t*faq-12.22*\n12.22. How do I reuse the last used search pattern in a `:substitute`\n       command?\n\nTo reuse the last used search pattern in a `:substitute` command, don't\nspecify a new search pattern: >\n\n    :s/pattern/newtext/\n    :s//sometext/\n<\nIn the second `:s` command, as a search pattern is not specified, the\npattern specified in the first `:s` command \"pattern\" will be used.\n\nIf you want to change the search pattern but repeat the substitution\npattern you can use the special right hand side, you can use the tilde\ncharacter: >\n\n    :s/newpattern/~/\n<\nFor more information, read:\n\n    |:s|\n    |:&|\n    |:~|\n    |&|\n    |sub-replace-special|\n\n \t\t\t\t\t\t\t\t*faq-12.23*\n12.23. How do I change the case of a string using the `:substitute`\n       command?\n\nYou can use special characters in the replacement string for a\n`:substitute` command to change the case of the matched string. For\nexample, to change the case of the string \"MyString\" to all uppercase, you\ncan use the following command: >\n\n    :%s/MyString/\\U&/g\n<\nTo change the case to lowercase, you can use the following command: >\n\n    :%s/MyString/\\L&/g\n<\nTo change the case of the first character in all the words in the current\nline to uppercase, you can use the following command: >\n\n    :s/\\<\\(.\\)\\(\\k*\\)\\>/\\u\\1\\L\\2/g\n<\nFor more information, read:\n\n    |sub-replace-special|\n    |:substitute|\n    |/\\U|\n    |/\\L|\n    |/\\u|\n\n \t\t\t\t\t\t\t\t*faq-12.24*\n12.24. How do I enter characters that are not present in the keyboard?\n\nYou can use digraphs to enter characters that are not present in the\nkeyboard. You can use the `:digraphs` command to display all the currently\ndefined digraphs. You can add a new digraph to the list using the\n`:digraphs` command.\n\nFor more information, read:\n\n    |digraphs|\n    |'digraph'|\n    |24.9|\n\n \t\t\t\t\t\t\t\t*faq-12.25*\n12.25. Is there a command to remove any or all digraphs?\n\nNo. The digraphs table is defined at compile time. You can only add new\nones. Adding a command to remove digraphs is on the todo list.\n\n \t\t\t\t\t\t\t\t*faq-12.26*\n12.26. In insert mode, when I press the backspace key, it erases only the\n       characters entered in this instance of insert mode. How do I erase\n       previously entered characters in insert mode using the backspace\n       key?\n\nThis is traditional vi behaviour. You can set the 'backspace' option to\nerase previously entered characters in insert mode: >\n\n    :set backspace=indent,eol,start\n<\nFor more information, read:\n\n    |'backspace'|\n    |i_backspacing|\n\n \t\t\t\t\t\t\t\t*faq-12.27*\n12.27. I have a file which has lines longer than 72 characters terminated\n       with \"+\" and wrapped to the next line. How can I quickly join the\n       lines?\n\nYou can use the `:global` command to search and join the lines: >\n\n    :g/+$/j\n<\nThis will, however, only join every second line. A couple of more complex\nexamples which will join all consecutive lines with a \"+\" at the end are: >\n\n    :g/+$/,/\\(^\\|[^+]\\)$/j\n    :g/+$/mark a | .,/\\(^\\|[^+]\\)$/s/+$// | 'a,.j\n<\nFor more information, read:\n\n    |:g|\n    |:j|\n    |:mark|\n\n \t\t\t\t\t\t\t\t*faq-12.28*\n12.28. How do I paste characterwise yanked text into separate lines?\n\nYou can use the `:put` command to paste characterwise yanked text into new\nlines: >\n\n    :put =@\"\n<\nFor more information, read:\n\n    |:put|\n    |quote_=|\n\n \t\t\t\t\t\t\t\t*faq-12.29*\n12.29. How do I change the case (uppercase, lowercase) of a word or a\n       character or a block of text?\n\nYou can use the \"~\" command to switch the case of a character.\n\nYou can change the case of the word under the cursor to uppercase using the\n\"gUiw\" or \"viwU\" command and to lowercase using the \"guiw\" or \"viwu\"\ncommand.\n\nYou can switch the case (upper case to lower case and vice versa) of the\nword under the cursor using the \"viw~\" or \"g~iw\" command.\n\nYou can use the \"gUgU\" command to change the current line to uppercase and\nthe \"gugu\" command to change the current line to lowercase.\n\nYou can use the \"g~g~\" command to switch the case of the current line. You\ncan use the \"g~{motion}\" or \"{Visual}~\" commands to switch the case of a\nblock of text.\n\nIf you set 'tildeop' the \"~\" command behaves like an operator and expects\na motion command to act on. If you have >\n\n    :set tildeop\n<\nand you want to change the case from the current cursor position to the end\nof line, simply use \"~$\".\n\nFor more information, read:\n\n    |case|\n    |'tildeop'|\n\n \t\t\t\t\t\t\t\t*faq-12.30*\n12.30. How do I enter ASCII characters that are not present in the\n       keyboard?\n\nYou can enter ASCII characters that are not present in the keyboard by\npressing CTRL-V and then the ASCII character number. You can also use\ndigraphs to enter special ASCII characters.\n\nFor more information, read:\n\n    |i_CTRL-V_digit|\n    |digraphs|\n    |45.5|\n\n \t\t\t\t\t\t\t\t*faq-12.31*\n12.31. How do I replace non-printable characters in a file?\n\nTo replace a non-printable character, you have to first determine the ASCII\nvalue for the character. You can use the `:ascii` ex command or the \"ga\"\nnormal-mode command to display the ASCII value of the character under the\ncursor.\n\nYou can enter the non-printable character by entering CTRL-V followed by\nthe decimal number 1-255 (with no leading zero), or by x and a hex number\n00-FF, or by an octal number 0-0377 (with leading zero), or by u and a hex\nnumber 0-FFFF, or by U and a hex number 0-7FFFFFFF\n\nAnother alternative is to use the `:digraphs` ex command to display the\ndigraphs for all characters, together with their value in decimal and\nalpha. You can enter a non-printable character by entering CTRL-K followed\nby two alphanumeric characters (a digraph).\n\nFor more information, read:\n\n    |:ascii|\n    |i_CTRL-V|\n    |i_CTRL-V_digit|\n    |:digraphs|\n\n \t\t\t\t\t\t\t\t*faq-12.32*\n12.32. How do I remove duplicate lines from a buffer?\n\nYou can use the following user-defined command to remove all the duplicate\nlines from a buffer:\n\n:command -range=% Uniq <line1>,<line2>g/^\\%<<line2>l\\(.*\\)\\n\\1$/d\n\nAdd the above command to your .vimrc file and invoke `:Uniq` to remove all\nthe duplicate lines.\n\n \t\t\t\t\t\t\t\t*faq-12.33*\n12.33. How do I prefix all the lines in a file with the corresponding line\n       numbers?\n\nYou can prefix the lines in a file with the corresponding line number in\nseveral ways. Some of them are listed below: >\n\n    :%s/^/\\=line('.'). ' '\n    :%s/^/\\=printf('%5d ', line('.'))/\n    :%s/^/\\=strpart(line('.').'.     ', 0, 5)\n    :%s/^/\\=strpart('   ', strlen(line('.'))).line('.').'. '\n<\nThe last two commands will pad the line numbers with space characters.  The\nlast command will right align the numbers and the command before that will\nleft align the numbers.\n\nIf you don't want to number consecutive lines but rather non-consecutive\nregions, you can also use this idiom: >\n\n    :let i = 1\n    :g/TODO/s/^/\\=printf('%2d.',i)|let i+=1\n<\nThis first initializes the variable i with 1. In the next line, a `:g`\ncommand is used to perform a substitute command only on lines, that\nmatch \"TODO\". After the substitute command has taken place, the variable\ni will be incremented by 1.\n\nFor more information, read:\n\n    |sub-replace-special|\n    |line()|\n    |expr6|\n    |strpart()|\n    |printf()|\n    |:execute|\n    |:global|\n\n \t\t\t\t\t\t\t\t*faq-12.34*\n12.34. How do I exchange (swap) two characters or words or lines?\n\nYou can exchange two characters with the \"xp\" command sequence. The \"x\"\nwill delete the character under the cursor and \"p\" will paste the just\ndeleted character after the character under the cursor. This will result\nin exchanging the two characters.\n\nYou can exchange two words with the \"deep\" command sequence (start with the\ncursor in the blank space before the first word).\n\nYou can exchange two lines with the \"ddp\" command sequence. The \"dd\" will\ndelete the current line and \"p\" will paste the just deleted line after the\ncurrent line. This will result in exchanging the two lines.\n\nAll of the above operations will change the \" unnamed register.\n\nYou can use the `:m +` ex command to exchange two lines without changing the\nunnamed register.\n\nFor more information, read:\n\n    |x|\n    |p|\n    |dd|\n    |d|\n    |e|\n    |linewise-register|\n    |quotequote|\n    |:move|\n\n \t\t\t\t\t\t\t\t*faq-12.35*\n12.35. How do I change the characters used as word delimiters?\n\nVim uses the characters specified by the 'iskeyword' option as word\ndelimiters. The default setting for this option is \"@,48-57,_,192-255\".\n\nFor example, to add \":\" as a word delimiter, you can use >\n\n    :set iskeyword+=:\n<\nTo remove \"_\" as a word delimiter, you can use >\n\n    :set iskeyword-=_\n<\nFor more information, read:\n\n    |'iskeyword'|\n    |word|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-13*\nSECTION 13 - COMPLETION IN INSERT MODE ~\n\n \t\t\t\t\t\t\t\t*faq-13.1*\n13.1. How do I complete words or lines in insert mode?\n\nIn insert mode, you can complete words using the CTRL-P and CTRL-N keys.\nThe CTRL-N command searches forward for the next matching keyword.\nThe CTRL-P command searches backwards for the next matching keyword.\n\nIn insert mode, you can use the CTRL-X CTRL-L command sequence to complete\nlines that starts with the same characters as in the current line before\nthe cursor. To get the next matching line, press the CTRL-P or CTRL-N keys.\nThere are a lot of other keys/ways available to complete words in insert\nmode.\n\nVim supports completion of the following items: >\n\n    CTRL-X CTRL-L    whole lines\n    CTRL-X CTRL-N    keywords in the current file\n    CTRL-X CTRL-K    words from a dictionary\n    CTRL-X CTRL-T    words from a thesaurus\n    CTRL-X CTRL-I    current and included files\n    CTRL-X CTRL-]    tags\n    CTRL-X CTRL-F    file names\n    CTRL-X CTRL-D    macro definitions (also in included files)\n    CTRL-X CTRL-V    Vim command line\n    CTRL-X CTRL-U    User defined completion\n    CTRL-X CTRL-O    Omni completion\n<\nUser defined completions and omni completions are often set by filetype\nplugins.\n\nFor more information, read:\n\n    |24.3|\n    |ins-completion|\n\n \t\t\t\t\t\t\t\t*faq-13.2*\n13.2. How do I complete file names in insert mode?\n\nIn insert mode, you can use the CTRL-X CTRL-F command sequence to complete\nfilenames that start with the same characters as in the current line before\nthe cursor.\n\nFor more information, read:\n\n    |compl-filename|\n\n \t\t\t\t\t\t\t\t*faq-13.3*\n13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do I\n      complete words that occur after the just completed word?\n\nYou can use CTRL-X CTRL-N and CTRL-X CTRL-P keys to complete words that are\npresent after the just completed word.\n\nFor more information, read:\n\n    |i_CTRL-X_CTRL-P|\n    |i_CTRL-X_CTRL-N|\n    |ins-completion|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-14*\nSECTION 14 - TEXT FORMATTING ~\n\n \t\t\t\t\t\t\t\t*faq-14.1*\n14.1. How do I format a text paragraph so that a new line is inserted at\n      the end of each wrapped line?\n\nYou can use the \"gq\" command to format a paragraph. This will format the\ntext according to the current 'textwidth' setting. An alternative would be\nto use the \"gw\" command that formats like \"gq\" but does not move the\ncursor.\n\nNote that the gq operator can be used with a motion command to operate on a\nrange of text. For example: >\n\n    gqgq - Format the current line\n    gqap - Format current paragraph\n    gwap - Format current paragraph (and don't move cursor)\n    gq3j - Format the current and the next 3 lines\n<\nFor more information, read:\n\n    |gq|\n    |gw|\n    |formatting|\n    |usr_25.txt|\n    |motion.txt|\n\n \t\t\t\t\t\t\t\t*faq-14.2*\n14.2. How do I format long lines in a file so that each line contains less\n      than \"n\" characters?\n\nYou can set the 'textwidth' option to control the number of characters that\ncan be present in a line. For example, to set the maximum width of a line\nto 70 characters, you can use the following command: >\n\n    set textwidth=70\n<\nNow to break the long lines in a file to the length defined by the\n'textwidth' option, you can use >\n\n    :g/./normal gqq\n<\nFor more information, read:\n\n    |'textwidth'|\n    |gq|\n\n \t\t\t\t\t\t\t\t*faq-14.3*\n14.3. How do I join short lines to form a paragraph?\n\nFirst, make sure the 'textwidth' option is set to a high value: >\n\n    :set textwidth=99999\n<\nNext, join the short lines to form a paragraph using the command: >\n\n    1GgqG\n<\nThe above command will operate on the entire file. To do the formatting on\nall paragraphs in a specific range, use: >\n\n    :'a,'bg/\\S/normal gq}\n<\nFor more information, read:\n\n    |gq|\n    |G|\n    |gqq|\n\n \t\t\t\t\t\t\t\t*faq-14.4*\n14.4. How do I format bulleted and numbered lists?\n\nYou can configure Vim to format bulleted and numbered lists using the\n'formatoptions' option. For example, you can format the list of the\nfollowing format:\n\n  - this is a test. this is a test. this is a test. this is a test.\n  this is a test.\n\ninto this format:\n\n  - this is a test. this is a test. this is a test. this is a test.\n    this is a test.\n\nYou can use the \"n\" flag in the 'formatoptions' to align the text. >\n\n    :set fo+=n\n<\nWith this option, when formatting text, Vim will recognize numbered lists.\nFor this option to work, the 'autoindent' option also must be set.\n\nFor more information, read:\n\n    |'formatoptions'|\n    |fo-table|\n    |format-comments|\n\n \t\t\t\t\t\t\t\t*faq-14.5*\n14.5. How do I indent lines in insert mode?\n\nIn insert mode, you can press the CTRL-T key to insert one shiftwidth of\nindent at the start of the current line. In insert mode, you can use the\nCTRL-D key to delete on shiftwidth of indent at the start of the current\nline. You can also use the CTRL-O >> and CTRL-O << commands to indent the\ncurrent line in insert mode.\n\nFor more information, read:\n\n    |i_CTRL-T|\n    |i_CTRL-D|\n    |i_0_CTRL-D|\n    |i_CTRL-O|\n    |>>|\n    |<<|\n\n \t\t\t\t\t\t\t\t*faq-14.6*\n14.6. How do I format/indent an entire file?\n\nYou can format/indent an entire file using the gg=G command, where >\n\n    gg - Goto the beginning of the file\n    =  - apply indentation\n    G  - till end of file\n<\nFor more information, read:\n\n    |gg|\n    |=|\n    |G|\n    |'formatprg'|\n    |C-indenting|\n\n \t\t\t\t\t\t\t\t*faq-14.7*\n14.7. How do I increase or decrease the indentation of the current line?\n\nYou can use the \">>\" and \"<<\" commands to increase or decrease the\nindentation of the current line.\n\nFor more information, read:\n\n    |shift-left-right|\n    |>>|\n    |<<|\n    |'shiftwidth'|\n\n \t\t\t\t\t\t\t\t*faq-14.8*\n14.8. How do I indent a block/group of lines?\n\nYou can visually select the group of lines and press the > or < key to\nindent/unindent the lines. You can also use the following ex-command to\nindent the lines >\n\n    :10,20>\n<\nFor more information, read:\n\n    |shift-left-right|\n    |v_>|\n    |v_<|\n    |:<|\n    |:>|\n\n \t\t\t\t\t\t\t\t*faq-14.9*\n14.9. When I indent lines using the > or < key, the standard 8-tabstops are\n      used instead of the current 'tabstop' setting. Why?\n\nThe number of spaces used when lines are indented using the \">\" operator is\ncontrolled by the 'shiftwidth' option. The 'tabstop' setting is only\nused, when the 'shiftwidth' option is zero. >\n\n    :set shiftwidth=4\n<\nFor more information, read:\n\n    |'shiftwidth'|\n    |>>|\n    |'softtabstop'|\n\n \t\t\t\t\t\t\t\t*faq-14.10*\n14.10. How do I turn off the automatic indentation of text?\n\nBy default, the automatic indentation of text is not turned on. Check the\nconfiguration files (.vimrc, .gvimrc) for settings related to indentation.\nMake sure the `:filetype indent on` command is not present. If it is\npresent, remove it. Also, depending on your preference, you may also want\nto check the value of the 'autoindent', 'smartindent', 'cindent' and\n'indentexpr' options and turn them off as needed.\n\nFor more information, read:\n\n    |:filetype-indent-off|\n    |'autoindent'|\n    |'smartindent'|\n    |'cindent'|\n    |'indentexpr'|\n\n \t\t\t\t\t\t\t\t*faq-14.11*\n14.11. How do I configure Vim to automatically set the 'textwidth' option\n       to a particular value when I edit mails?\n\nYou can use the \"FileType\" autocommand to set the 'textwidth' option: >\n\n    autocmd FileType mail set tw=<your_value>\n<\nFor more information, read:\n\n    |:autocmd|\n    |FileType|\n    |usr_43.txt|\n\n \t\t\t\t\t\t\t\t*faq-14.12*\n14.12. Is there a way to make Vim auto-magically break lines?\n\nYes. Set the 'textwidth' option to the preferred length for a line. Then\nVim will auto-magically break the newly entered lines. For example: >\n\n    :set textwidth=75\n<\nFor more information, read:\n\n    |'textwidth'|\n    |ins-textwidth|\n    |'formatoptions'|\n    |fo-table|\n    |formatting|\n\n \t\t\t\t\t\t\t\t*faq-14.13*\n14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n       'fileformat' option to \"dos\" and then \"unix\" and then \"mac\". None of\n       these helped. How can I hide these symbols?\n\nWhen a file is loaded in Vim, the format of the file is determined as\nbelow:\n\n- If all the lines end with a new line (<NL>), then the fileformat is\n  \"unix\".\n- If all the lines end with a carriage return (<CR>) followed by a new line\n  (<NL>), then the fileformat is \"dos\".\n- If all the lines end with carriage return (<CR>), then the fileformat is\n  \"mac\".\n\nIf the file has some lines ending with <CR> and some lines ending with <CR>\nfollowed by a <NL>, then the fileformat is set to \"unix\".\n\nYou can change the format of the current file, by saving it explicitly in\ndos format: >\n\n    :w ++ff=dos\n<\nTo display the format of the current file, use >\n\n    :set fileformat?\n<\nThe above behavior is also controlled by the 'fileformats' option. You can\ntry the following commands: >\n\n    :set fileformats+=unix\n    :e <your_file>\n    :set fileformat=unix\n    :w\n<\nTo remove the carriage return (<CR>) character at the end of all the lines\nin the current file, you can use the following command: >\n\n    :%s/\\r$//\n<\nTo force Vim to use a particular file format, when editing a file, you can\nuse the following command: >\n\n    :e ++ff=dos filename\n<\nFor more information, read:\n\n    |'fileformats'|\n    |'fileformat'|\n    |file-formats|\n    |DOS-format-write|\n    |Unix-format-write|\n    |Mac-format-write|\n    |dos-file-formats|\n    |23.1|\n    |++ff|\n\n \t\t\t\t\t\t\t\t*faq-14.14*\n14.14. When I paste some text into a Vim buffer from another application,\n      the alignment (indentation) of the new text is messed up. How do I\n      fix this?\n\nWhen you paste text into a GUI Vim using the mouse, Vim is able to\ndetect that you are pasting text. So all the indentation related\nsettings (like autoindent, smartindent, cindent, etc.) are ignored and\nthe text is pasted literally.\n\nWhen pasting text into a Vim running in a terminal (like xterm) using\nthe mouse, Vim may not be able to detect that you are pasting text. This\ndepends on several things: the capability of the terminal to pass the\nmouse events to Vim, Vim is compiled to handle mouse events and access\nthe clipboard, the DISPLAY variable is set properly, the Vim 'mouse'\noption is set correctly.\n\nIf Vim is able to detect that you are pasting text using the mouse, then\nthe pasted text will be inserted literally.\n\nIf Vim is not able to detect that you are pasting using the mouse, then\nit will see the pasted text as though you literally typed the text.\nAfter the first line from the pasted text is inserted, when Vim\nencounters the newline character, because of the indentation settings,\nthe next line will start indented. The spaces at the beginning of the\nsecond line in the pasted text will be inserted leading to additional\nindentation. This will be repeated for subsequent lines. So the pasted\ntext will be inserted with stair case indentation.\n\nYou can fix this problem in a terminal Vim in several ways:\n\n1. Build Vim with the +mouse and +xterm_clipboard compile-time options.\n   The normal or big or huge build of Vim includes these options.  Set\n   the 'mouse' option to either \"a\" or include \"i\".  When pasting text\n   using the mouse, don't press the Shift key. This will work only if\n   Vim can access the X display. For more information, read the\n   following Vim help topics:\n\n    |+feature-list|\n    |'mouse'|\n    |<MiddleMouse>|\n    |x11-selection|\n    |xterm-clipboard|\n\n1.1 Some Linux distributions build their terminal vim packages\n    without X support.  This makes no sense and leaves many users\n    with the impression that Vim in terminal mode doesn't support\n    some operations such as properly pasting text with a mouse. >\n\n    If your distribution includes gvim, which it almost certainly\n    does these days, the solutions to this include the following.\n<\n    a)  Start Vim as >\n\n            gvim -v\n<\n    b)  Put this alias in your shell's configuration file, e.g.\n        ~/.bashrc: >\n\n            alias vim='gvim -v'\n<\n    c)  Put the following command in a file named \"vim\" and put that\n        file in your ~/bin directory: >\n\n            gvim -v \"$@\"\n<\n    d)  Link the distribution's gvim to ~/bin/vim with the following\n        command, which needs to be executed only once. >\n\n            ln -s $(which gvim) ~/bin/vim\n<\n    For c) and d), make sure that ~/bin precedes /usr/bin in your\n    PATH.\n\n2. Paste the text using the CTRL-R CTRL-O * command.  This will paste\n   the text literally without any automatic indentation. If you want to\n   paste the text and then fix the indentation, then you can use CTRL-R\n   CTRL-P *. These commands will work only if Vim can access the X\n   display. For more information, read the following Vim help topics:\n\n    |i_CTRL-R_CTRL-O|\n    |i_CTRL-R_CTRL-P|\n    |quotestar|\n\n3. Set the 'paste' option before pasting the text. This option will\n   disable the effect of all the indentation related settings. Make\n   sure to turn off this option using `:set nopaste` after pasting the\n   text. Otherwise the Vim indentation feature will not work.  Do not\n   permanently set the 'paste' option in your .vimrc file. If you are\n   going to repeat these steps often, then you can set the\n   'pastetoggle' option to a key. When you press the specified key,\n   the 'paste' option will be toggled. You can press the key once\n   before pasting the text and the press the key once after pasting\n   the text. Note that when the 'paste' option is set, all the\n   mappings and abbreviations are disabled.  For more information,\n   read the following Vim help topics:\n\n    |'paste'|\n    |'pastetoggle'|\n\nYou can also refer to the following topics in the user manual:\n\n    |04.7|\n    |09.3|\n\n \t\t\t\t\t\t\t\t*faq-14.15*\n14.15. When there is a very long wrapped line (wrap is \"on\") and a line\n      doesn't fit entirely on the screen it is not displayed at all. There\n      are blank lines beginning with \"@\" symbol instead of wrapped line. If\n      I scroll the screen to fit the line the \"@\" symbols disappear and the\n      line is displayed again. What Vim setting control this behavior?\n\nYou can set the 'display' option to \"lastline\" to display as much as\npossible of the last line in a window instead of displaying the \"@\"\nsymbols. >\n\n    :set display=lastline\n<\nFor more information, read:\n\n    |'display'|\n\n \t\t\t\t\t\t\t\t*faq-14.16*\n14.16. How do I convert all the tab characters in a file to space\n       characters?\n\nYou can use the `:retab` command to update all the tab characters in the\ncurrent file with the current setting of 'expandtab' and 'tabstop'. For\nexample, to convert all the tabs to white spaces, use >\n\n    :set expandtab\n    :retab\n<\nFor more information, read:\n\n    |:retab|\n    |'expandtab'|\n    |'tabstop'|\n    |25.3|\n\n \t\t\t\t\t\t\t\t*faq-14.17*\n14.17. What Vim options can I use to edit text that will later go to a word\n       processor?\n\nYou can set the following options to edit text that will later go into a\nword processor: >\n\n    :set wrap\n    :set linebreak\n    :set textwidth=0\n    :set showbreak=>>>\n<\nYou can use the \"gk\" and \"gj\" commands to move one screen line up and down.\nFor more information, read:\n\n    |'wrap'|\n    |'linebreak'|\n    |'textwidth'|\n    |'showbreak'|\n    |gk|\n    |gj|\n\n \t\t\t\t\t\t\t\t*faq-14.18*\n14.18. How do I join lines without adding or removing any space characters?\n\nBy default, when you join lines using the \"J\" or `:join` command, Vim will\nreplace the line break, leading white space and trailing white space with a\nsingle space character. If there are space characters at the end of a line\nor a line starts with the \")\" character, then Vim will not add a space\ncharacter.\n\nTo join lines without adding or removing any space characters, you can use\nthe gJ or `:join!` commands.\n\nFor more information, read:\n\n    |gJ|\n    |:join|\n    |J|\n    |10.5|\n    |'joinspaces'|\n    |'cpoptions'|\n    |'formatoptions'|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-15*\nSECTION 15 - VISUAL MODE ~\n\n \t\t\t\t\t\t\t\t*faq-15.1*\n15.1. How do I do rectangular block copying?\n\nYou can do rectangular block copying in Vim using the blockwise visual\nmode. To start blockwise visual mode use the CTRL-V key. Move the cursor\nusing any of the motion commands and then use the y operator to yank to\nvisually selected text.\n\nIf CTRL-V does not work as expected, it may have been remapped to CTRL-Q by\nthe mswin.vim script which is often sourced by a vimrc on Windows machines\nto mimic some common short cuts from other programs.\n\nFor more information, read:\n\n    |04.4|\n    |blockwise-visual|\n    |visual-mode|\n    |Q_vi|\n\n \t\t\t\t\t\t\t\t*faq-15.2*\n15.2. How do I delete or change a column of text in a file?\n\nYou can use the Vim block-wise visual mode to select the column of text and\napply an operator (delete, change, copy, etc) on it.\n\nFor more information, read:\n\n    |visual-block|\n    |visual-operators|\n\n \t\t\t\t\t\t\t\t*faq-15.3*\n15.3. How do I apply an ex-command on a set of visually selected lines?\n\nWhen you select a range of lines in visual mode, the < register is set to\nthe start of the visual region and the > register is set to the end of the\nvisual region. You can use these registers to specify the range for an ex\ncommand. After visually selecting the lines, press \":\" to go to the command\nmode.  Vim will automatically insert the visual range '<,'>. You can run\nany ex-command on the visual range.\n\nFor more information, read:\n\n    |v_:|\n    |'<|\n    |'>|\n\n \t\t\t\t\t\t\t\t*faq-15.4*\n15.4. How do I execute an ex command on a column of text selected in Visual\n      block mode?\n\nAll the ex commands operate on whole lines only. If you try to execute\nan ex command on a column of text selected in visual block mode, Vim\nwill operate on all the selected lines (instead of the selected\ncolumns). You can use the vis.vim or NrrwRgn plugin script from\nhttps://www.vim.org scripts archive to do this.\n\nFor more information, read:\n\n    |cmdline-ranges|\n    |10.3|\n    |cmdline-lines|\n\n \t\t\t\t\t\t\t\t*faq-15.5*\n15.5. How do I select the entire file in visual mode?\n\nYou can select the entire file in visual mode using ggVG. >\n\n    gg - go to the beginning of the file.\n    V  - Start linewise visual mode\n    G  - goto the end of the file.\n<\nFor more information, read:\n\n    |gg|\n    |linewise-visual|\n    |G|\n\n \t\t\t\t\t\t\t\t*faq-15.6*\n15.6. When I visually select a set of lines and press the > key to indent\n      the selected lines, the visual mode ends. How can I reselect the\n      region for further operation?  (or) How do I re-select the last\n      selected visual area again?\n\nYou can use the \"gv\" command to reselect the last selected visual area. You\ncan also use the marks '< and '> to jump to the beginning or the end of the\nlast selected visual area.\n\nFor more information, read:\n\n    |gv|\n    |'<|\n    |'>|\n\n \t\t\t\t\t\t\t\t*faq-15.7*\n15.7. How do I jump to the beginning/end of a visually selected region?\n\nYou can use the \"o\" command to jump to the beginning/end of a visually\nselected region.\n\nFor more information, read:\n\n    |v_o|\n\n \t\t\t\t\t\t\t\t*faq-15.8*\n15.8. When I select text with mouse and then press : to enter an ex\n      command, the selected text is replaced with the : character. How do I\n      execute an ex command on a text selected using the mouse similar to\n      the text selected using the visual mode?\n\nThis will happen if you have configured Vim to use select mode instead of\nVisual mode by setting the 'selectmode' option. Check the value of this\noption: >\n\n    :set selectmode?\n<\nThis mode is known as selectmode and is similar to the visual mode. This\noption is also automatically set when you use the \"behave mswin\" command.\nSelect mode looks like visual mode, but it is similar to the selection mode\nin MS-Windows.\n\nFor more information, read:\n\n    |Select-mode|\n    |'selectmode'|\n    |09.4|\n    |:behave|\n\n \t\t\t\t\t\t\t\t*faq-15.9*\n15.9. When I select a block of text using the mouse, Vim goes into\n      selection mode instead of Visual mode. Why?\n\nThe 'selectmode' option controls whether Select mode will be started when\nselecting a block of text using the mouse. To start Visual mode when\nselecting text using mouse, remove the \"mouse\" value from the 'selectmode'\noption: >\n\n    :set selectmode-=mouse\n<\nNote that by default, the 'selectmode' option will be set to empty, so that\nalways visual mode is used.\n\nFor more information, read:\n\n    |'selectmode'|\n    |Select-mode|\n    |:behave|\n\n \t\t\t\t\t\t\t\t*faq-15.10*\n15.10. How do I visually select the last copy/pasted text?\n\nYou can use the '[ and '] marks to visually select the last copy/pasted\ntext. The '[ mark is set to the beginning of the last changed/yanked text\nand the '] mark is set to the end of the last changed/yanked text. To\nvisually select this block of text use the command '[v']\n\nFor more information, read:\n\n    |'[|\n    |']|\n    |`a|\n    |v|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-16*\nSECTION 16 - COMMAND-LINE MODE ~\n\n \t\t\t\t\t\t\t\t*faq-16.1*\n16.1. How do I use the name of the current file in the command mode or an\n      ex command line?\n\nIn the command line, the \"%\" character represents the name of the current\nfile. In some commands, you have to use `expand(\"%\")` to get the filename: >\n\n    :!perl %\n<\nAnother example is to load the latex generated pdf file from the file you\nare currently editing: >\n\n    :!xpdf %<.pdf\n<\nFor more information, read:\n\n    |:_%|\n    |cmdline-special|\n    |expand()|\n\n \t\t\t\t\t\t\t\t*faq-16.2*\n16.2. How do I edit the text in the Vim command-line effectively?\n\nYou can use the command-line window for editing Vim command-line text. To\nopen the Vim command-line window use the \"q:\" command in normal mode. In\ncommand-line mode, use the CTRL-F key. In this window, the command line\nhistory will be displayed. You can use normal Vim keys/commands to edit any\nprevious/new command line. To execute a command line, press the\nenter/return key.\n\nIn a similar vain, the search history can be edited with \"q/\" and \"q?\"\ncommands.\n\nFor more information, read:\n\n    |cmdline-window|\n\n \t\t\t\t\t\t\t\t*faq-16.3*\n16.3. How do I switch from Vi mode to Ex mode?\n\nYou can use the Q command to switch from Vi mode to Ex mode. To switch from\nEx mode back to the Vi mode, use the `:vi` command.\n\nFor more information, read:\n\n    |Q|\n    |gQ|\n    |Ex-mode|\n    |:vi|\n\n \t\t\t\t\t\t\t\t*faq-16.4*\n16.4. How do I copy the output from an ex-command into a buffer?\n\nTo copy the output from an ex-command into a buffer, you have to first get\nthe command output into a register. You can use the `:redir` command to get\nthe output into a register. For example, >\n\n    :redir @a\n    :g/HelloWord/p\n    :redir END\n<\nNow the register \"a\" will contain the output from the ex command\n`:g/HelloWord/p`. Now you can paste the contents of the register \"a\" into a\nbuffer. You can also send or append the output of an ex-command into a file\nusing the `:redir` command.\n\nYou can prefix the `:global` command with `:silent`, to avoid having the\nlines printed to the screen.\n\nTo redirect the output from an ex-command to a file, you can use the\nfollowing set of commands: >\n\n    :redir > myfile\n    :g/HelloWord/p\n    :redir END\n<\nFor more information, read:\n\n    |:redir|\n    |:silent|\n\n \t\t\t\t\t\t\t\t*faq-16.5*\n16.5. When I press the <Tab> key to complete the name of a file in the\n      command mode, if there are more than one matching file names, then\n      Vim completes the first matching file name and displays a list of all\n      matching filenames. How do I configure Vim to only display the list\n      of all the matching filenames and not complete the first one?\n\nYou can modify the 'wildmode' option to configure the way Vim completes\nfilenames in the command mode. In this case, you can set the 'wildmode'\noption to \"list\": >\n\n    :set wildmode=list\n<\nFor more information, read:\n\n    |'wildmode'|\n\n \t\t\t\t\t\t\t\t*faq-16.6*\n16.6. How do I copy text from a buffer to the command line and from the\n      command line to a buffer?\n\nTo copy text from a buffer to the command line, after yanking the text from\nthe buffer, use \"<CTRL-R>0\" in the command line to paste the text. You can\nalso yank the text to a specific register and use CTRL-R <register> to\npaste the text to the command line.  You can use CTRL-R CTRL-W to paste the\nword under the cursor in the command line.\n\nTo copy text from the command line into a buffer, you can paste the\ncontents of the : register using the \":p command. The most recently\nexecuted command line is stored in the : register.\n\nAnother approach for copying and pasting text to and from the command line\nis to open the command line window using q: from normal mode or CTRL-F from\nthe command-line mode. In the command line window you can use all the Vim\ncommands to edit the command line.\n\nFor more information, read:\n\n    |c_CTRL-R|\n    |quote_:|\n    |cmdline-window|\n\n \t\t\t\t\t\t\t\t*faq-16.7*\n16.7. How do I put a command onto the command history without executing it?\n\nTo put a command onto the command history without executing it, press the\n<Esc> key to cancel the command.\n\nAn alternative solution, is to use the histadd() function like this: >\n\n    :call histadd(':', 'echo strftime(\"%c\")')\n<\nFor more information, read:\n\n    |c_<Esc>|\n    |histadd()|\n\n \t\t\t\t\t\t\t\t*faq-16.8*\n16.8. How do I increase the height of the command-line?\n\nYou can increase the height of the command-line by changing the 'cmdheight'\noption: >\n\n    :set cmdheight=2\n<\nFor more information, read:\n\n    |'cmdheight'|\n    |hit-enter|\n    |05.7|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-17*\nSECTION 17 - VIMINFO ~\n\n \t\t\t\t\t\t\t\t*faq-17.1*\n17.1. When I invoke Vim, I get error messages about illegal characters in\n      the viminfo file. What should I do to get rid of these messages?\n\nYou can remove the $HOME/.viminfo or the $HOME/_viminfo file to get rid of\nthese error messages.\n\nFor more information, read:\n\n    |viminfo-errors|\n    |viminfo-file-name|\n    |viminfo|\n    |21.3|\n\n \t\t\t\t\t\t\t\t*faq-17.2*\n17.2. How do I disable the viminfo feature?\n\nBy default, the viminfo feature is disabled. If the viminfo feature is\nenabled by a system-wide vimrc file, then you can disable the viminfo\nfeature by setting the 'viminfo' option to an empty string in your local\n.vimrc file: >\n\n    :set viminfo=\"\"\n<\nFor more information, read:\n\n    |'viminfo'|\n\n \t\t\t\t\t\t\t\t*faq-17.3*\n17.3. How do I save and use Vim marks/commands across Vim sessions?\n\nYou can save and restore Vim marks across Vim sessions using the viminfo\nfile. To use the viminfo file, make sure the 'viminfo' option is not empty.\nTo save and restore Vim marks, the 'viminfo' option should not contain the\n\"f\" flag or should have a value greater than zero for the \"f\" option.\n\nYou can also use the viminfo file to synchronize the commandline history\nacross different sessions using `:wvimfo` and `:rviminfo` commands together\nwith the FocusGained and FocusLost autocommands: >\n\n    augroup viminfo\n        au!\n        au FocusLost   * wviminfo\n        au FocusGained * rviminfo\n    augroup end\n<\nNote, this will only work reliably, when Vim can detect the FocusLost\nand FocusGained autocommands correctly. This means it should work with\nGVim but might depend on your terminal for konsole vim.\n\nFor more information, read:\n\n    |21.3|\n    |viminfo|\n    |'viminfo'|\n    |:wviminfo|\n    |:rviminfo|\n    |FocusLost|\n    |FocusGained|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-18*\nSECTION 18 - REMOTE EDITING ~\n\n \t\t\t\t\t\t\t\t*faq-18.1*\n18.1. How do I open a file with existing instance of gvim? What happened to\n      the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n\nStarting with Vim6, the OLE version of OpenWithVim.exe and SendToVim.exe\nVim utilities are replaced by the new client-server feature. To open the\nfile j.txt with an existing instance of Gvim (MyVim), use: >\n\n    $ gvim --servername MyVim --remote-silent j.txt\n<\nTo list the server names of all the currently running Vim instances, use >\n\n    $ vim --serverlist\n<\nTo get more information about client-server feature, read\n\n    |client-server|\n\n \t\t\t\t\t\t\t\t*faq-18.2*\n18.2. How do I send a command to a Vim server to write all buffers to disk?\n\nYou can use the Vim remote server functionality to do this: >\n\n    $ gvim --servername myVIM --remote-send \"<C-\\><C-N>:wall<CR>\"\n<\nFor more information, read:\n\n    |client-server|\n    |CTRL-\\_CTRL-N|\n    |:wall|\n\n \t\t\t\t\t\t\t\t*faq-18.3*\n18.3. Where can I get the documentation about the Vim remote server\n      functionality?\n\nYou can get more information about the Vim remote server functionality by\nreading\n\n    |client-server|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-19*\nSECTION 19 - OPTIONS ~\n\n \t\t\t\t\t\t\t\t*faq-19.1*\n19.1. How do I configure Vim in a simple way?\n\nYou can use the `:options` command to open the Vim option window: >\n\n    :options\n<\nThis window can be used for viewing and setting all the options.\n\nFor more information, read:\n\n    |:options|\n\n \t\t\t\t\t\t\t\t*faq-19.2*\n19.2. How do I toggle the value of an option?\n\nYou can prefix the option with \"inv\" to toggle the value of the option: >\n\n    :set invignorecase\n    :set invhlsearch\n<\nYou can also suffix the option with \"!\" to toggle the value: >\n\n    :set ignorecase!\n    :set hlsearch!\n<\nFor more information, read:\n\n    |set-option|\n\n \t\t\t\t\t\t\t\t*faq-19.3*\n19.3. How do I set an option that affects only the current buffer/window?\n\nSome of the Vim options can have a local or global value. A local value\napplies only to a specific buffer or window. A global value applies to all\nthe buffers or windows.\n\nWhen a Vim option is modified using the `:set` command, both the global and\nlocal values for the option are changed. You can use the `:setlocal`\ncommand to modify only the local value for the option and the `:setglobal`\ncommand to modify only the global value.\n\nYou can use the `:setlocal` command to set an option that will affect only\nthe current file/buffer: >\n\n    :setlocal textwidth=70\n<\nNote that not all options can have a local value. You can use `:setlocal`\ncommand to set an option locally to a buffer/window only if the option is\nallowed to have a local value.\n\nYou can also use the following command to set an option locally: >\n\n    :let &l:{option-name} = <value>\n<\nFor more information, read:\n\n    |:setlocal|\n    |local-options|\n\n \t\t\t\t\t\t\t\t*faq-19.4*\n19.4. How do I use space characters for a Vim option value?\n\nTo use space characters in a Vim option value, you have to escape the space\ncharacter. For example: >\n\n    :set tags=tags\\ /usr/tags\n<\nFor more information, read:\n\n    |option-backslash|\n\n \t\t\t\t\t\t\t\t*faq-19.5*\n19.5. Can I add (embed) Vim option settings to the contents of a file?\n\nYou can use modelines to add Vim option settings to the contents of a file.\nFor example, in a C file, you can add the following line to the top or the\nbottom of the file: >\n\n    /* vim:sw=4: */\n<\nThis will set the 'shiftwidth' option to 4, when editing that C file.\nFor this to work, the 'modeline' option should be set. By default, the\n'modeline' option is set. An alternative example is given in this document\nin the first line.\n\nThe 'modelines' settings specifies the number of\nlines that will be checked for the Vim set commands.\n\nFor more information, read:\n\n    |21.6|\n    |modeline|\n    |auto-setting|\n    |'modeline'|\n    |'modelines'|\n\n \t\t\t\t\t\t\t\t*faq-19.6*\n19.6. How do I display the line numbers of all the lines in a file?\n\nYou can set the 'number' option to display the line numbers for all the\nlines. >\n\n    :set number\n<\nFor more information, read:\n\n    |'number'|\n\n \t\t\t\t\t\t\t\t*faq-19.7*\n19.7. How do I change the width of the line numbers displayed using the\n      'number' option?\n\nYou can set the minimum number of columns to be used for line numbering by\nsetting the 'numberwidth' option: >\n\n    :set numberwidth=3\n<\nThis set's the width for the line number to 3 digits, which is enough, if\nyour buffer contains less than 999 lines. However, if your current buffer\ncontains more lines than 999, the 'numberwidth' will be adjusted accordingly,\nso that the maximum line number will fit on the screen.\n\n \t\t\t\t\t\t\t\t*faq-19.8*\n19.8. How do I display (view) all the invisible characters like space, tabs\n      and newlines in a file?\n\nYou can set the 'list' option to see all the invisible characters in your\nfile. >\n\n    :set list\n<\nWith this option set, you can view space characters, tabs, newlines,\ntrailing space characters and wrapped lines.\n\nTo not display the invisible characters (which is the default), you have to\nreset the 'list' option: >\n\n    :set nolist\n    (or)\n    :set list!\n<\nThe `:set list!` command will toggle the current setting of the boolean\n'list' option.\n\nYou can modify the 'listchars' option to configure how and which invisible\ncharacters are displayed. For example, with the following command all the\ntrailing space characters will be displayed with a \".\" character. >\n\n    :set listchars=trail:.\n<\nFor more information, read:\n\n    |'listchars'|\n    |'list'|\n\n \t\t\t\t\t\t\t\t*faq-19.9*\n19.9. How do I configure Vim to always display the current line and column\n      number?\n\nYou can set the 'ruler' option to display current column and line number in\nthe status line: >\n\n    :set ruler\n<\nFor more information, read:\n\n    |'ruler'|\n\n \t\t\t\t\t\t\t\t*faq-19.10*\n19.10. How do I display the current Vim mode?\n\nYou can set the 'showmode' option to display the current Vim mode. In\nInsert, Replace and Visual modes, Vim will display the current mode on the\nlast line. >\n\n    :set showmode\n<\nFor more information, read:\n\n    |'showmode'|\n\n \t\t\t\t\t\t\t\t*faq-19.11*\n19.11. How do I configure Vim to show pending/partial commands on the\n       status line?\n\nYou can set the 'showcmd' option to display pending/partial commands in the\nstatus line: >\n\n    :set showcmd\n<\nFor more information, read:\n\n    |'showcmd'|\n\n \t\t\t\t\t\t\t\t*faq-19.12*\n19.12. How do I configure the Vim status line to display different\n       settings/values?\n\nYou can set the 'statusline' option to display different values/settings in\nthe Vim status line.\n\nFor more information, read:\n\n    |'statusline'|\n    |'laststatus'|\n    |'rulerformat'|\n    |'ruler'|\n\n \t\t\t\t\t\t\t\t*faq-19.13*\n19.13. How do I configure Vim to display status line always?\n\nYou can set the 'laststatus' option to 2 to display the status line always. >\n\n    :set laststatus=2\n<\nFor more information, read:\n\n    |'laststatus'|\n\n \t\t\t\t\t\t\t\t*faq-19.14*\n19.14. How do I make a Vim setting persistent across different Vim\n       invocations/instances/sessions?\n\nTo make a Vim option setting persistent across different Vim instances, add\nyour setting to the .vimrc or .gvimrc file. You can also use the `:mkvimrc`\ncommand to generate a vimrc file for the current settings.\n\nFor more information, read:\n\n    |save-settings|\n    |vimrc|\n    |gvimrc|\n    |vimrc-intro|\n    |:mkvimrc|\n    |initialization|\n\n \t\t\t\t\t\t\t\t*faq-19.15*\n19.15. Why do I hear a beep (why does my window flash) about 1 second after\n       I hit the Escape key?\n\nThis is normal behavior. If your window flashes, then you've got the visual\nbell on. Otherwise, you should hear a beep.\n\nVim needs a timeout to tell the difference between a simple escape and,\nsay, a cursor key sequence.  When you press a key in normal mode (and even\nin insert mode) and that key is the beginning of a mapping, Vim waits a\ncertain amount of time to see if the rest of the mapping sequence follows.\nIf the mapping sequence is completed before a given timeout period, the\nmapping for that sequence of keys is applied. If you interrupt the mapping,\nthe normal actions associated with the keys are executed.\n\nFor example, if you have a mapping defined as `:imap vvv Vim is great!!`\nand you type \"vvv\" quickly, the \"Vim is great!!\" will be inserted into your\ntext. But if you type \"vv v\" then that is what will put into your text.\nThis is also true if you type \"vvv\" too slowly where \"too slowly\" is longer\nthan the value for the timeout option. Setting the timeout option to a\nlarger value can help alleviate problems that appear when using function\nkeys over a slow line.\n\nFor more information, read:\n\n    |'ttimeout'|\n\n \t\t\t\t\t\t\t\t*faq-19.16*\n19.16. How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n       deleting the characters I'm changing?\n\nTo make the \"c\" and \"s\" commands display a \"$\" instead of deleting the\ncharacters, add the $ flag to the 'cpoptions' option: >\n\n    :set cpoptions+=$\n<\nFor more information, read:\n\n    |'cpoptions'|\n\n \t\t\t\t\t\t\t\t*faq-19.17*\n19.17. How do I remove more than one flag using a single `:set` command\n       from a Vim option?\n\nYou can remove more than one flag from a Vim option using a single `:set`\ncommand, by specifying the flags in exactly the same order as they appear\nin the option. For example, if you use the following command to remove the\n\"t\" and \"n\" flags from the 'formatoptions' option: >\n\n    :set formatoptions-=tn\n<\nThe \"t\" and \"n\" flags will be removed from the 'formatoptions' option, only\nif the 'formatoptions' option contains these flags in this order: \"tn\".\nOtherwise, it will not remove the flags. To avoid this problem, you can\nremove the flags one by one: >\n\n    :set formatoptions-=t formatoptions-=n\n<\nFor more information, read:\n\n    |:set-=|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-20*\nSECTION 20 - MAPPING KEYS ~\n\n \t\t\t\t\t\t\t\t*faq-20.1*\n20.1. How do I know what a key is mapped to?\n\nTo see what a key is mapped to, use the following commands: >\n\n    :map <key>\n    :map! <key>\n<\nYou can also check the mappings in a particular mode using one of the\n`:cmap`, `:nmap`, `:vmap`, `:imap`, `:omap`, etc commands.\n\nTo find out, where the key has been mapped, prefix the `:verbose` command: >\n\n    :verbose :map <key>\n<\nFor more information, read:\n\n    |map-listing|\n    |map-overview|\n\n \t\t\t\t\t\t\t\t*faq-20.2*\n20.2. How do I list all the user-defined key mappings?\n\nYou can list all the user-defined key mappings using: >\n\n    :map\n<\nFor more information, read:\n\n    |map-listing|\n\n \t\t\t\t\t\t\t\t*faq-20.3*\n20.3. How do I unmap a previously mapped key?\n\nYou can unmap a previously mapped key using the `:unmap` command: >\n\n    :unmap <key>\n    :unmap! <key>\n<\nFor mode specific mappings, you can use one of the these commands: >\n\n    :nunmap\n    :vunmap\n    :ounmap\n    :iunmap\n    :lunmap\n    :cunmap\n<\nThe following command will fail to unmap a buffer-local mapped key: >\n\n    :unmap <key>\n<\nTo unmap a buffer-local mapped key, you have to use the <buffer> keyword in\nthe unmap command: >\n\n    :unmap <buffer> <key>\n    :unmap! <buffer> <key>\n<\nFor more information, read:\n\n    |:unmap|\n    |map-modes|\n    |:map-local|\n    |mapleader|\n\n \t\t\t\t\t\t\t\t*faq-20.4*\n20.4. I am not able to create a mapping for the <xxx> key. What is wrong?\n\n1) First make sure, the key is passed correctly to Vim. To determine if\n   this is the case, put Vim in Insert mode and then hit CTRL-V (or\n   CTRL-Q if your CTRL-V is remapped to the paste operation (e.g. on\n   Windows if you are using the mswin.vim script file) followed by your\n   key.\n\n   If nothing appears in the buffer (and assuming that you have\n   'showcmd' on, ^V remains displayed near the bottom right of the Vim\n   screen), then Vim doesn't get your key correctly and there is nothing\n   to be done, other than selecting a different key for your mapping or\n   using GVim, which should recognise the key correctly.\n\n2) Possibly, Vim gets your key, but sees it as no different than\n   something else. Say you want to map <Ctrl-Right>, then in Insert mode\n   hit CTRL-K followed by <Ctrl-Right>. If Vim displays <C-Right> it has\n   correctly seen the keystroke and you should be able to map it (by\n   using <C-Right> as your {lhs}). If it displays <Right> it has seen\n   the keystroke but as if you hadn't held <Ctrl> down: this means your\n   temrinal passes <Ctrl-Right> as if it were just <Right>. Anything else\n   means the key has been misidentified.\n\n3) If the key is seen, but not as itself and not as some recognizable\n   key, then there is probably an error in the terminal library for the\n   current terminal (termcap or terminfo database). In that case >\n\n        :set term?\n<\n   will tell you which termcap or terminfo Vim is using. You can try to\n   tell vim, what termcode to use in that terminal, by adding the\n   following to your vimrc: >\n\n        if &term == <termname>\n            set <C-Right>=<keycode>\n        endif\n<\n   where <termname> above should be replaced by the value of 'term'\n   (with quotes around it) and <keycode> by what you get when hitting\n   CTRL-V followed by <Ctrl-Right> in Insert mode (with nothing around\n   it). <C-Right> should be left as-is (9 characters). Don't forget that\n   in a `:set` command, white space is not allowed between the equal sign\n   and the value, and any space, double quote, vertical bar or backslash\n   present as part of the value must be backslash-escaped.\n\n   Now you should be able to see the keycode corresponding to the key\n   and you can create a mapping for the key using the following command: >\n\n        :map <C-Right>  <your_command_to_be_mapped>\n<\nFor more information, read:\n\n    |map-keys-fails|\n    |:map-special-keys|\n    |key-codes|\n\n \t\t\t\t\t\t\t\t*faq-20.5*\n20.5. Why does mapping the <C-...> key not work?\n\nThe only <Ctrl>-<printable-key> chords which Vim can reliably detect\n(because they are defined in the ASCII standard) are the following: >\n\n        CTRL-@                 0x00            NUL\n        CTRL-A to CTRL-Z       0x01 to 0x1A\n        CTRL-a to CTRL-z       0x01 to 0x1A\n        CTRL-[                 0x1B            ESC\n        CTRL-\\                 0x1C\n        CTRL-]                 0x1D\n        CTRL-^                 0x1E\n        CTRL-_                 0x1F\n        CTRL-?                 0x7F            DEL\n<\nMost of these, however, already have a function in Vim (and some are\naliases of other keys: CTRL-H and <BS>, CTRL-I and <Tab>, CTRL-M and <Enter>,\nCTRL-[ and <Esc>, CTRL-? and <Del>).\n\nThe \"safest\" keys to use in Vim for the {lhs} of a mapping are the F\nkeys, with or without Shift: <F2> to <F12> and <S-F1> to <S-F12>. (Some\nOSes, including mine, intercept <Ctrl-Fn> and <Alt-Fn>, which never reach an\napplication program such as vim or gvim).\n\nYou can try other combinations of <Ctrl> + any key, but they may either\nnot work everywhere (e.g. the terminal might not pass that key to Vim,\nor they might have unintended side effects (e.g. mapping <C-I> means\nalso to map <Tab>).\n\nThis is a known issue, that has been discussed and might be implemented\nin the future to enable Vim to distinguish between various keys even in\nconsole mode. (e.g.\nhttps://groups.google.com/d/msg/vim_dev/2bp9UdfZ63M/sajb9KM0pNYJ)\n\n \t\t\t\t\t\t\t\t*faq-20.6*\n20.6. How do I map the numeric keypad keys?\n\nFirst make sure that the numeric keypad keys are passed to Vim. Next, you\ncan use the following command to map the numeric keypad keys: >\n\n    :map <kSomething>  <your_command>\n<\nwhere, <kSomething> can be kHome, kEnd, kPageUp, kPageDown, kPlus, kMinus,\nkDivide, kMultiply, kEnter, etc.\n\nFor more information, read:\n\n    |key-codes|\n    |terminal-options|\n\n \t\t\t\t\t\t\t\t*faq-20.7*\n20.7. How do I create a mapping that works only in visual mode?\n\nYou can create mappings that work only in specific modes (normal, command,\ninsert, visual, etc). To create a mapping that works only in the visual\nmode, use the `:vmap` command: >\n\n    :vmap <F3> <your mapping here>\n<\nThis mapping will work in visual and select mode. If you want the map to\nwork only in visual mode (excluding select mode), use:\n >\n\n    :xmap <F3> <your mapping here>\n<\nand to have the mapping only work in select mode (but not visual mode),\nuse: >\n\n    :smap <F3> <your mapping here>\n<\nFor more information, read:\n\n    |:vmap|\n    |:xmap|\n    |:smap|\n    |map-modes|\n    |40.1|\n\n \t\t\t\t\t\t\t\t*faq-20.8*\n20.8. How do I create a mapping that works only in normal and operator\n   pending mode (but not in visual mode)?\n\nUsing `:map` creates a mapping that works in normal, visual+select mode and\noperator pending mode. You can use `:nmap` to have the mapping only work in\nnormal mode and `:vmap` to have the mapping only be defined for visual and\nselect mode or use `:omap` to have the mapping only defined in operator\npending mode.\n\nBut if you want to have a mapping defined, that works in both operator\npending mode and normal mode, but not in visual and select mode, you need\nto first define the mapping using `:map` and afterwards delete the mapping\nfor visual and select mode:\n\n\t:map <f3> <your mapping here>\n\t:vunmap <f3>\n\n \t\t\t\t\t\t\t\t*faq-20.9*\n20.9. In a Vim script, how do I know which keys to use for my mappings, so\n      that the mapped key will not collide with an already used key?\n\nVim uses most of the keys in the keyboard. You can use the <leader> prefix\nin maps to define keys which will not overlap with Vim keys. For example: >\n\n    :map <leader>S <C-W>s\n    :map <leader>j <C-W>j\n    :map <leader>k <C-W>k\n<\nwhere by default <leader> gets substituted with a backslash (\\), so the\nuser would enter >\n\n        \\s\n        \\j\n        \\k\n<\nto invoke the above map commands. The user can change the mapleader\nvariable to be whatever they wanted: >\n\n    :let mapleader = \",\"\n<\nWhen writing a plugin or other script, more often than not, it is advisable\nto use `:noremap` instead of `:map` to avoid side effects from user defined\nmappings.\n\nFor more information, read:\n\n    |<Leader>|\n    |<LocalLeader>|\n    |write-plugin|\n\n \t\t\t\t\t\t\t\t*faq-20.10*\n20.10. How do I map the escape key?\n\nYou can map the Escape key to some other key using the `:map` command. For\nexample, the following command maps the escape key to CTRL-O. >\n\n    :map <C-O> <Esc>\n<\n \t\t\t\t\t\t\t\t*faq-20.11*\n20.11. How do I map a key to perform nothing?\n\nYou can map a key to <Nop> to perform nothing when the key is pressed. For\nexample, with the following mappings, the <F7> key will do nothing when\npressed. >\n\n    :map <F7> <Nop>\n    :map! <F7> <Nop>\n<\nFor more information, read:\n\n    |<Nop>|\n    |:map|\n    |:map!|\n    |map-modes|\n\n \t\t\t\t\t\t\t\t*faq-20.12*\n20.12. I want to use the <Tab> key to indent a block of text and <Shift-Tab>\n       key to unindent a block of text. How do I map the keys to do this?\n       This behavior is similar to textpad, visual studio, etc.\n\nUse the following mapping: >\n\n    :inoremap <S-Tab> <C-O><lt><lt>\n    :nnoremap <Tab> >>\n    :nnoremap <S-Tab> <lt><lt>\n    :vnoremap <Tab> >\n    :vnoremap <S-Tab> <lt>\n<\nNote, that the <S-Tab> mapping will work only if Vim receives the correct\nkey sequence. This is mostly the case with GUI Vim.\n\nFor more information, read:\n\n    |:inoremap|\n    |:nnoremap|\n    |:vnoremap|\n    |<S-Tab>|\n    |i_CTRL-O|\n    |>>|\n    |<<|\n    |<lt>|\n\n \t\t\t\t\t\t\t\t*faq-20.13*\n20.13. In my mappings the special characters like <CR> are not recognized.\n       How can I configure Vim to recognize special characters?\n\nCheck the value of the 'cpoptions' option: >\n\n    :set cpoptions?\n<\nIf this option contains the \"<\" flag, then special characters will not be\nrecognized in mappings. Remove the \"<\" flag from 'cpoptions' option: >\n\n    :set cpo-=<\n<\nAlso, check the value of the 'compatible' option: >\n\n    :set compatible?\n<\nThe 'compatible' option must be reset: >\n\n    :set nocompatible\n<\nFor more information, read:\n\n    |'cpoptions'|\n    |'compatible'|\n\n \t\t\t\t\t\t\t\t*faq-20.14*\n20.14. How do I use the \"|\" to separate multiple commands in a map?\n\nYou can escape the \"|\" character using backslash (\\) to use \"|\" in a map. >\n\n    :map _l :!ls \\| more<CR>\n<\nYou can also try the following command: >\n\n    :map _l :!ls <bar> more<CR>\n<\nThere are also other ways to do this.\n\nFor more information, read:\n\n    |map_bar|\n\n \t\t\t\t\t\t\t\t*faq-20.15*\n20.15. If I have a mapping/abbreviation whose ending is the beginning of\n       another mapping/abbreviation, how do I keep the first from expanding\n       into the second one?\n\nInstead of using the `:map lhs rhs` command, use the `:noremap lhs rhs`\ncommand. For abbreviations, use \"noreabbrev lhs rhs\". The \"nore\" prefix\nprevents the mapping or abbreviation from being expanded again.\n\nFor more information, read:\n\n    |:noremap|\n    |:noreabbrev|\n\n \t\t\t\t\t\t\t\t*faq-20.16*\n20.16. Why does it take a second or more for Vim to process a key,\n       sometimes when I press a key?\n\nMake sure you have not defined a mapping for this key using the following\ncommand: >\n\n    :map <key>\n<\nIf a mapping is defined for this key and the mapped key contains more than\none character, then Vim will wait for the next character to be pressed to\ndetermine whether it is the mapped key or not. For example, if you have\nmapped \"ab\", then if you press \"a\", Vim will wait for the next key to be\npressed. If the next key is \"b\", Vim will execute the mapped sequence.\nOtherwise, Vim will proceed with the normal processing of \"a\" followed by\nthe next key. If the 'timeout' option is set (which is the default), then\nVim will timeout after waiting for the period specified with the\n'timeoutlen' option (default is 1 second).\n\nFor more information, read:\n\n    |map-typing|\n    |'timeoutlen'|\n    |'ttimeoutlen'|\n    |'timeout'|\n    |'ttimeout'|\n    |vt100-cursor-keys|\n    |slow-fast-terminal|\n\n \t\t\t\t\t\t\t\t*faq-20.17*\n20.17. How do I map a key to run an external command using a visually\n       selected text?\n\nYou can the `:vmap` command to map a key in the visual mode. In the mapped\ncommand sequence, you have to first yank the text. The yanked text is\navailable in the '\"' register. Now, you can use the contents of this\nregister to run the external command. For example, to run the external\ncommand \"perldoc\" on a visually selected text, you can use the following\nmapping: >\n\n    :vmap <F7> y:!exec \"!perldoc '\" . @\" . \"'\"<CR>\n<\nIf you want the mapping to work in the visual mode, but not with the\nhighlighted text, you can use the following command: >\n\n    :vmap <F7> :<C-U>!perldoc <cword><CR>\n<\nThe above mapping will use the word under the cursor instead of the\nhighlighted text. Note the use of the <C-U> before invoking the \"perldoc\"\nexternal command. The <C-U> is used to erase the range of text selected in\nthe visual mode and displayed on the command line. If the visual range is\nnot removed using <C-U>, then the output from the external command will\nreplace the visually selected text.\n\nFor more information, read:\n\n    |:vmap|\n    |quote_quote|\n    |:let-register|\n    |c_CTRL-U|\n    |:!cmd|\n\n \t\t\t\t\t\t\t\t*faq-20.18*\n20.18. How do I map the CTRL-I key while still retaining the functionality\n       of the <Tab> key?\n\nThe CTRL-I key and the <Tab> key produce the same keycode, so Vim cannot\ndistinguish between the CTRL-I and the <Tab> key. When you map the CTRL-I\nkey, the <Tab> key is also mapped (and vice versa). The same restriction\napplies for the CTRL-[ key and the <Esc> key.\n\nFor more information, read:\n\n    |keycodes|\n\n \t\t\t\t\t\t\t\t*faq-20.19*\n20.19. How do I define a map to accept a count?\n\nUse the @= command to use an expression. For example, >\n\n    nnoremap = @='3l'\n<\nNow you can specify a count to the \"=\" command.\n\n    |complex-repeat|\n\n \t\t\t\t\t\t\t\t*faq-20.20*\n20.20. How can I make my normal mode mapping work from within Insert\n       Mode?\n\nMappings in normal mode can be executed after CTRL-O from insert mode as\nwell but if there are more commands included in the mapping {rhs}, only the\nfirst one will be executed in normal mode and the rest of {rhs} will be\nprinted literally in insert mode. One of ways to workaround this problem is\nto make {rhs} be one command, via wrapping it to the function. For example: >\n\n    function GetFontNameOfFirstChar()\n    normal! 0\n    echo getfontname()\n    endfunction\n<\n    :nmap <F9> :call GetFontNameOfFirstChar()<CR>\n\nA more technical and detailed solution to this problem follows and can\nbe found at https://groups.google.com/group/vim_dev/msg/75f1f2dfc00908bb\n\nNot every normal mode-mapping is automatically suitable for execution via\nCTRL-O from within insert mode; you need to explicitly design your mappings\nfor that purpose.\n\nThe CTRL-O command allows execution of one normal mode command from\nwithin insert mode, then returns to insert mode. If a normal mode mapping\nconcatenates multiple normal mode commands, this breaks down in temporary\nnormal mode and literally inserts the second part of the command into the\nbuffer instead. To support execution of normal mode mappings from within\ninsert mode, these strategies can be used:\n\n1) Instead of concatenating multiple normal mode commands, use one `:normal`\n    mapping: >\n\n    :nnoremap <silent> zC :<C-U>normal! zCVzC<CR>\n<\n2) Concatenate multiple Ex commands via <Bar> on the rhs: >\n\n    :nnoremap zC :<C-U>call MyMap1()<Bar>call MyMap2()<CR>\n<\n3) Shadow normal mode mappings by insert mode mappings that\n    re-enter normal mode, then invoke the normal mode mapping: >\n\n    :nnoremap <silent> <SID>MyMap2 :<C-U>call MyMap2()<CR>\n    :inoremap <silent> <script> <SID>MyMap2 <C-\\><C-O><SID>MyMap2\n    :nnoremap <silent> <script> zC <SID>MyMap1<SID>MyMap2\n<\n4) Normal mode mappings that consist of multiple Ex command lines (and\n    where Ex commands cannot be concatenated via <Bar>) replace `:<C-U>`\n    with <SID>NM; the <SID>NM mapping enters normal mode for one ex command\n    line: >\n\n    :nnoremap <silent> <SID>NM :<C-U>\n    :inoremap <silent> <SID>NM <C-\\><C-O>:\n    :nnoremap <silent> <script> zC <SID>MyMap1<SID>NMcall MyMap2()<CR>\n<\n5)  If none of the above is possible, at least force normal mode for\n    subsequent commands via CTRL-\\ CTRL-N to avoid accidental insertion\n    of the remainder of the mapping. >\n\n    :nnoremap zC zC<C-\\><C-N>VzCzz\n<\n\nFor more information, read:\n\n    |i_CTRL-O|\n    |map_bar|\n    |i_CTRL-\\_CTRL-O|\n    |CTRL-\\_CTRL-N|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-21*\nSECTION 21 - ABBREVIATIONS ~\n\n \t\t\t\t\t\t\t\t*faq-21.1*\n21.1. How do I auto correct misspelled words?\n\nYou can auto correct misspelled words using abbreviations. For example, the\nfollowing abbreviation can be used to correct \"teh\" with \"the\": >\n\n    :abbreviate teh the\n<\nVim supports abbreviations in insert mode, replace mode and command-line\nmode.\n\nFor more information, read:\n\n    |24.7|\n    |abbreviations|\n    |Q_ab|\n\n \t\t\t\t\t\t\t\t*faq-21.2*\n21.2. How do I create multi-line abbreviations?\n\nYou can create multi-line abbreviations by embedding the \"<CR>\"\nkey code in the text: >\n\n    iabbrev #c --------------<CR>-- Date:<CR>--<CR>---------\n<\nWith the above abbreviation, when you type #c, it will be expanded to\nthe following text:\n\n--------------\n-- Date:\n--\n---------\n\nFor more information, read:\n\n    |abbreviations|\n\n \t\t\t\t\t\t\t\t*faq-21.3*\n21.3. When my abbreviations are expanded, an additional space character is\n      added at the end of the expanded text. How do I avoid this character?\n\nTo avoid an additional space character at the end of the expanded text, you\ncan expand the abbreviation by pressing the CTRL-] key.  The abbreviation\nwill be expanded without adding a space character at the end.\n\nAnother alternative is to use the following function and command: >\n\n    function! Eatchar(pat)\n        let c = nr2char(getchar())\n        return (c =~ a:pat) ? '' : c\n    endfunction\n    command! -nargs=+ Iabbr execute \"iabbr\" <q-args> . \"<C-R>=Eatchar('\\\\s')<CR>\"\n<\nNow, define your abbreviations using the new \"Iabbr\" command instead of the\nbuiltin `:iabbrev` command. With this command, after expanding the\nabbreviated text, the next typed space character will be discarded.\n\nFor more information, read:\n\n    |abbreviations|\n\n \t\t\t\t\t\t\t\t*faq-21.4*\n21.4. How do I insert the current date/time stamp into the file?\n\nYou can use the strftime() function to insert the current data/time stamp\nin a file. For example, you can use the following abbreviation: >\n\n    iabbrev dts <C-R>=strftime(\"%y/%m/%d %H:%M\")<CR>\n<\nWith this abbreviation, when you type dts in insert mode, it will be\nexpanded to the date/time stamp.\n\nSome other forms of the above abbreviation are listed below: >\n\n    iabbrev mdyl <C-R>=strftime(\"%a %d %b %Y\")<CR>\n    iabbrev mdys <C-R>=strftime(\"%y%m%d\")<CR>\n    iabbrev mdyc <C-R>=strftime(\"%c\")<CR>\n    iabbrev hml  <C-R>=strftime(\"%d/%m/%y %H:%M:%S\")<CR>\n    iabbrev hms  <C-R>=strftime(\"%H:%M:%S\")<CR>\n<\nFor more information, read:\n\n    |strftime()|\n    |i_CTRL-R|\n\n \t\t\t\t\t\t\t\t*faq-21.5*\n21.5. How do I prevent an abbreviation from expanding in insert mode?\n\nYou can prevent an abbreviation from expanding in insert mode by typing\nCTRL-V before the character after the abbreviated word.\n\nFor more information, read:\n\n    |abbreviations|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-22*\nSECTION 22 - RECORD AND PLAYBACK ~\n\n \t\t\t\t\t\t\t\t*faq-22.1*\n22.1. How do I repeat an editing operation (insertion, deletion, paste,\n      etc)?\n\nYou can repeat the last editing operation using the \".\" command. This will\nrepeat the last simple change like a insert, delete, change, paste, etc.\n\nFor more information, read:\n\n    |04.3|\n    |single-repeat|\n    |Q_re|\n\n \t\t\t\t\t\t\t\t*faq-22.2*\n22.2. How I record and repeat a set of key sequences?\n\nYou can use the \"q\" command in normal mode to record a set of key sequences\nand store it in a register. For example, in the normal mode you can press q\nfollowed by a register name {0-9a-bA-Z\"} to start the recording.  To\nend/stop the recording press q again. You can playback/repeat the recorded\nkey sequences by pressing @ followed by the register name. e.g. @a.\n\nAnother approach is to start Vim with the \"-w\" command-line argument. >\n\n    $ vim -w <file_name>\n<\nVim will record all the characters typed in the session in the\nspecified file \"file_name\". You can use the recorded file with the \"-s\"\ncommand line argument to play it back: >\n\n    $ vim -s <file_name>\n<\nFor more information, read:\n\n    |10.1|\n    |recording|\n    |-w|\n    |-s|\n\n \t\t\t\t\t\t\t\t*faq-22.3*\n22.3. How do I edit/modify a recorded set of key sequences?\n\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer, edit the pasted text and again\nyank the text into the register. You can also use the `:let` command to\nmodify the register. For example: >\n\n    :let @a = \"iHello World\\<Esc>\"\n<\nFor more information, read:\n\n    |recording|\n    |10.1|\n    |:let-register|\n    |<>|\n    |'cpoptions'|\n\n \t\t\t\t\t\t\t\t*faq-22.4*\n22.4. How do I write recorded key sequences to a file?\n\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer. Now you can save the buffer\ninto a file. You can also modify the pasted text and again yank into the\nregister to modify the recorded key sequence. For example, if you record a\nset of key sequences using qa ..... q. The recorded key sequences are\nstored in the register \"a\". You can paste the contents of register \"a\"\nusing \"ap.\n\nFor more information, read:\n\n    |recording|\n    |10.1|\n\n \t\t\t\t\t\t\t\t*faq-22.5*\n22.5. I am using register 0 to record my key sequences (i.e. q0 .... q).\n      In the recorded key sequences, I am yanking some text. After the\n      first replay of the recorded key sequence, I am no longer able to\n      play it back.\n\nRegister 0 contains the text from the last yank operation. In your recorded\nkey sequence, when the yank is performed, register 0 is overwritten with\nthe yanked text. So your recording stored in register 0 is lost. You have\nto use some other register.\n\nFor more information, read:\n\n    |registers|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-23*\nSECTION 23 - AUTOCOMMANDS ~\n\n \t\t\t\t\t\t\t\t*faq-23.1*\n23.1. How do I execute a command when I try to modify a read-only file?\n\nYou can use the FileChangedRO autocommand event to execute a command when a\nread-only file is modified. For example, you can use this event to checkout a\nread-only file: >\n\n    :autocmd FileChangedRO * call MyCheckoutFunction()\n<\nFor more information, read:\n\n    |FileChangedRO|\n\n \t\t\t\t\t\t\t\t*faq-23.2*\n23.2. How do I execute a command every time when entering a buffer?\n\nYou can use the BufEnter autocommand event to execute a command every time\nwhen entering a buffer. For example: >\n\n    :autocmd BufEnter *.c set formatoptions=croqt\n<\nFor more information, read:\n\n    |BufEnter|\n\n \t\t\t\t\t\t\t\t*faq-23.3*\n23.3. How do I execute a command every time when entering a window?\n\nYou can use the WinEnter autocommand event to execute a command every time\nwhen entering a window. For example: >\n\n    :autocmd WinEnter *.c call MyFunction()\n<\nFor more information, read:\n\n    |WinEnter|\n\n \t\t\t\t\t\t\t\t*faq-23.4*\n23.4. From an autocmd, how can I determine the name of the file or the\n      buffer number for which the autocommand is executed?\n\nYou can use the special words <afile> or <abuf> in an autocmd to get the\nname of the file or the buffer number for which the autocommand is\nexecuted.\n\nFor more information, read:\n\n    |:<afile>|\n    |:<abuf>|\n    |:<amatch>|\n\n \t\t\t\t\t\t\t\t*faq-23.5*\n23.5. How do I automatically save all the changed buffers whenever Vim\n      loses focus?\n\nYou can define an autocommand for the FocusLost event which will save all\nthe modified buffers whenever Vim loses focus: >\n\n    :autocmd FocusLost * wall\n<\nFor more information, read:\n\n    |FocusLost|\n    |:wall|\n\n \t\t\t\t\t\t\t\t*faq-23.6*\n23.6. How do I execute/run a function when Vim exits to do some cleanup?\n\nYou can use VimLeave autocmd event to execute a function just before Vim\nexits. For example, >\n\n    :autocmd VimLeave * call MyCleanupFunction()\n<\nFor more information, read:\n\n    |VimLeave|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-24*\nSECTION 24 - SYNTAX HIGHLIGHT ~\n\n \t\t\t\t\t\t\t\t*faq-24.1*\n24.1. How do I turn off/on syntax highlighting?\n\nBy default, the Vim syntax highlighting is turned off. To enable the syntax\nhighlighting, you can use one of the following commands: >\n\n    :syntax enable\n<\n    or >\n\n    :syntax on\n<\nTo disable the syntax highlighting, you can use the following command: >\n\n    :syntax off\n<\nFor more information, read:\n\n    |06.1|\n    |06.4|\n    |:syntax-enable|\n    |:syntax-on|\n    |:syn-clear|\n\n \t\t\t\t\t\t\t\t*faq-24.2*\n24.2. How do I change the background and foreground colors used by Vim?\n\nVim uses the \"Normal\" highlight group for the background and foreground\ncolors. To change the foreground/background colors, you have to modify the\n\"Normal\" highlight group. For example, to set the background color to blue\nand foreground color to white, you can use >\n\n    :highlight Normal ctermbg=blue ctermfg=white guibg=blue guifg=white\n<\nIf you are using the Motif or the Athena version of the GUI Vim, then you\ncan modify the foreground and background resource names in the .Xdefaults\nfiles to change the colors: >\n\n    Vim.foreground:     Black\n    Vim.background:     Wheat\n<\nYou can also use the \"-foreground\" and \"-background\" command-line arguments\nto specify the foreground and background colors. These arguments are\nsupported only in the Motif or Athena versions: >\n\n    $ gvim -foreground Black -background Wheat\n<\nFor more information, read:\n\n    |:highlight|\n    |.Xdefaults|\n    |-gui|\n\n \t\t\t\t\t\t\t\t*faq-24.3*\n24.3. How do I change the highlight colors to suit a dark/light background?\n\nYou can set the 'background' option to either \"dark\" or \"light\" to change\nthe highlight colors to suit a dark/light background: >\n\n    :set background=dark\n<\nFor more information, read:\n\n    |'background'|\n    |06.2|\n\n \t\t\t\t\t\t\t\t*faq-24.4*\n24.4. How do I change the color of the line numbers displayed when the\n      `:set number` command is used?\n\nThe line numbers displayed use the LineNr highlighting group. To display\nthe current colors used, use >\n\n    :hi LineNr\n<\nTo change the color modify the LineNr highlight group. For example: >\n\n    :hi linenr guifg=red guibg=black\n<\nThis will give red numbers on a black background in GVIM.\n\nFor more information, read:\n\n    |:highlight|\n\n \t\t\t\t\t\t\t\t*faq-24.5*\n24.5. How do I change the background color used for a Visually selected\n      block?\n\nYou can modify the \"Visual\" highlight group to change the color used for a\nvisually selected block: >\n\n    :highlight Visual guibg=red\n<\nFor more information, read:\n\n    |:highlight|\n    |hl-Visual|\n\n \t\t\t\t\t\t\t\t*faq-24.6*\n24.6. How do I highlight the special characters (tabs, trailing spaces, end\n      of line, etc) displayed by the 'list' option?\n\nYou can modify the \"NonText\" and \"SpecialKey\" highlight groups to highlight\nthe special characters displayed by the 'list' option: >\n\n    :highlight NonText guibg=red\n    :highlight SpecialKey guibg=green\n<\nThe \"NonText\" highlighting group is used for \"eol\", \"extends\" and\n\"precedes\" settings in the 'listchars' option.  The \"SpecialKey\"\nhighlighting group is used for the \"tab\" and \"trail\" settings.\n\nFor more information, read:\n\n    |'listchars'|\n    |hl-NonText|\n    |hl-SpecialKey|\n\n \t\t\t\t\t\t\t\t*faq-24.7*\n24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that Vim\n      uses the specified colorscheme every time?\n\nYou can specify the color scheme using the `:colorscheme` command in your\n.vimrc or .gvimrc file: >\n\n    colorscheme evening\n<\nFor more information, read:\n\n    |:colorscheme|\n\n \t\t\t\t\t\t\t\t*faq-24.8*\n24.8. Vim syntax highlighting is broken. When I am editing a file, some\n      parts of the file is not syntax highlighted or syntax highlighted\n      incorrectly.\n\nVim doesn't read the whole file to parse the text for syntax highlighting.\nIt starts parsing wherever you are viewing the file. That saves a lot of\ntime, but sometimes the colors are wrong. A simple fix is refreshing the\nscreen using the CTRL-L key. Or scroll back a bit and then forward again.\nYou can also use the command: >\n\n    :syntax sync fromstart\n<\nNote that this might considerably slow down the screen refreshing.\n\nFor more information, read:\n\n    |:syn-sync|\n    |:syn-sync-first|\n\n \t\t\t\t\t\t\t\t*faq-24.9*\n24.9. Is there a built-in function to syntax-highlight the corresponding\n      matching bracket?\n\nYes. Vim includes the matchparen Plugin as standard plugin that is enabled\nby default. Whenever the cursor moves over an item defined with the\n'matchpairs' option, Vim will highlight the corresponding bracket using the\nMatchParen highlighting group.\n\nHowever, if the corresponding parenthesis is not visible in the current\nwindow, the cursor won't jump to it.\n\nThe matchit plugin provides a similar function, that lets the cursor\njump to related items (e.g. \"if\", \"else\", \"endif\" items) and skips\nmatches in comments. This uses the % command to jump to corresponding\nitems. Though both plugins provide similar functions they are unrelated\nand work differently.\n\nFor more information, read:\n\n    |matchparen|\n    |'matchpairs'|\n    |matchit-install|\n    |matchit-intro|\n\n \t\t\t\t\t\t\t\t*faq-24.10*\n24.10. How do I turn off the C comment syntax highlighting?\n\nYou can use the following command to turn off C comment syntax\nhighlighting: >\n\n    :highlight clear comment\n<\nFor more information, read:\n\n    |ft-c-syntax|\n\n \t\t\t\t\t\t\t\t*faq-24.11*\n24.11. How do I add my own syntax extensions to the standard syntax files\n       supplied with Vim?\n\nYou should not modify the syntax files supplied with Vim to add your\nextensions. When you install the next version of Vim, you will lose your\nchanges. Instead you should create a file under the ~/.vim/after/syntax\ndirectory with the same name as the original syntax file and add your\nadditions to this file.\n\nFor more information, read:\n\n    |mysyntaxfile-add|\n    |'runtimepath'|\n\n \t\t\t\t\t\t\t\t*faq-24.12*\n24.12. How do I replace a standard syntax file that comes with the Vim\n       distribution with my own syntax file?\n\nYou can replace a standard syntax file that comes with the Vim distribution\nby creating a file with the same name as the original syntax file and\nplacing it in the vim runtime syntax (~/.vim/syntax) directory. For\nexample, to replace the c.vim syntax file in a Unix system, place the new\nc.vim in the ~/.vim/syntax directory. In a MS-Windows system, place the new\nsyntax file in the $HOME/vimfiles/syntax or $VIM/vimfiles/syntax directory.\n\nFor more information, read:\n\n    |mysyntaxfile-replace|\n    |44.11|\n    |mysyntaxfile|\n\n \t\t\t\t\t\t\t\t*faq-24.13*\n24.13. How do I highlight all the characters after a particular column?\n\nYou can use the `:match` command to highlight all the characters after a\nparticular column: >\n\n    :match Todo '\\%>75v.\\+'\n<\nThis will highlight all the characters after the 75th column.\n\nYou can also set the 'colorcolumn' option to highlight a particular\ncolumn:\n\n   :set colorcolumn=+2\n\nwhich highlights 2 columns after the current 'textwidth' setting\n(alternatively, you can use the exact column number).\n\nFor more information, read:\n\n    |:match|\n    |/\\%v|\n    |/\\+|\n    |/.|\n    |'colorcolumn'|\n\n \t\t\t\t\t\t\t\t*faq-24.14*\n24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n       highlighting into a HTML file?\n\nYou can use the 2html.vim script to convert a source file into a HTML file\nwith the Vim syntax highlighting. Use the following command: >\n\n    :TOhtml\n<\nFor more information, read:\n\n    |convert-to-HTML|\n    |:TOhtml|\n\n \t\t\t\t\t\t\t\t*faq-24.15*\n24.15. How do I list the definition of all the current highlight groups?\n\nYou can list the definition of all the current highlight groups using the\n`:highlight` (without any arguments) ex command.\n\nFor more information, read:\n\n    |:highlight|\n\n \t\t\t\t\t\t\t\t*faq-24.16*\n24.16. How can I embed one syntax highlighting language into another one?\n\nIt is possible to include one syntax highlighting into another one,\nhowever most of the currently deployed syntax highlighting scripts are\nnot prepared to be included into another syntax script.\n\nYou can however create your own custom script to define your own\nregions, which will be highlighted with a different language.\n\nSee the wiki for a comprehensive solution:\n\n    http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file\n\nFor more information, read:\n\n    |:syn-include|\n    |sh-awk|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-25*\nSECTION 25 - VIM SCRIPT WRITING ~\n\n \t\t\t\t\t\t\t\t*faq-25.1*\n25.1. How do I list the names of all the scripts sourced by Vim?\n\nYou can use the `:scriptnames` command to list the names of all the scripts\nsourced by Vim: >\n\n    :scriptnames\n<\nFor more information, read:\n\n    |:scriptnames|\n\n \t\t\t\t\t\t\t\t*faq-25.2*\n25.2. How do I debug Vim scripts?\n\nVim has built-in support for a primitive debugger to debug Vim plugins and\nscripts. Using this debugger you can set breakpoints and step through the\nplugin functions.\n\nFor more information, read:\n\n    |debug-scripts|\n    |-D|\n\n \t\t\t\t\t\t\t\t*faq-25.3*\n25.3. How do I locate the script/plugin which sets a Vim option?\n\nYou can use the `:verbose` command to locate the plugin/script which last\nmodified a Vim option. For example: >\n\n    :verbose set textwidth?\n<\nFor more information, read:\n\n    |:set-verbose|\n    |:verbose|\n\n \t\t\t\t\t\t\t\t*faq-25.4*\n25.4. I am getting some error/informational messages from Vim (possibly\n      when running a script), the messages are cleared immediately. How do\n      I display the messages again?\n\nYou can use the `:messages` command to display the previous messages. >\n\n    :messages\n<\nFor more information, read:\n\n    |:messages|\n    |:echoerr|\n    |:echomsg|\n    |message-history|\n\n \t\t\t\t\t\t\t\t*faq-25.5*\n25.5. How do I save and restore a plugin specific information across Vim\n      invocations?\n\nVim will save and restore global variables that start with an uppercase\nletter and don't contain a lower case letter. For this to work, the\n'viminfo' option must contain the \"!\" flag. Vim will store the variables in\nthe viminfo file.\n\nFor more information, read:\n\n    |'viminfo'|\n    |viminfo-file|\n    |variables|\n\n \t\t\t\t\t\t\t\t*faq-25.6*\n25.6. How do I start insert mode from a Vim function?\n\nYou can use the `:startinsert` command to start the insert mode from inside\na Vim function.\n\nFor more information, read:\n\n    |:startinsert|\n\n \t\t\t\t\t\t\t\t*faq-25.7*\n25.7. How do I change the cursor position from within a Vim function?\n\nYou can use the cursor() function to position the cursor. >\n\n        call cursor(lnum, col)\n<\nAlternatively, use the setpos() function: >\n\n        call setpos('.', [bufnum, lnum, col, off])\n<\nwhich set's the cursor in the buffer bufnum to line lnum, column col and\noffset for 'virtualedit'. You can use the getpos() function, to return a\nlist with these values, that can then be fed back to the setpos() function.\n\nIf you want to save and restore the viewpoint on a window, use the\nwinsaveview() and winrestview() function calls.\n\nYou can also use the following command to change the cursor position: >\n\n        exe \"normal! \" . lnum . \"G\" . col . \"|\"\n<\nFor more information, read:\n\n    |cursor()|\n    |bar|\n    |getpos()|\n    |setpos()|\n    |winsaveview()|\n    |winrestview()|\n\n \t\t\t\t\t\t\t\t*faq-25.8*\n25.8. How do I check the value of an environment variable in the .vimrc\n      file?\n\nYou can use prefix the environment variable name with the \"$\" character to\nuse it from a Vim script/function.  You can refer to the value of an\nenvironment variable using the $env_var syntax: >\n\n    if $EDITOR == 'vi'\n    endif\n<\nFor more information, read:\n\n    |expr-env|\n\n \t\t\t\t\t\t\t\t*faq-25.9*\n25.9. How do I check whether an environment variable is set or not from a\n      Vim function?\n\nYou can use the exists() function to check for the existence of an\nenvironment variable. >\n\n    if exists(\"$MY_ENV_VAR\")\n    endif\n<\nFor more information, read:\n\n    |exists()|\n    |expr-env|\n\n \t\t\t\t\t\t\t\t*faq-25.10*\n25.10. How do I call/use the Vim built-in functions?\n\nYou can use the `:call` command to invoke a Vim built-in function: >\n\n    :call cursor(10,20)\n<\nYou can use the `:echo` command to echo the value returned by a function: >\n\n    :echo char2nr('a')\n<\nYou can use the `:let` command to assign the value returned by a function\nto a variable: >\n\n    :let a = getline('.')\n<\nTo store the return value from a function into a Vim register, you can use\nthe following command: >\n\n    :let @a = system('ls')\n<\nThe above command will store the output of the \"ls\" command into\nthe register \"a\".\n\nFor more information, read:\n\n    |:call|\n    |:echo|\n    |:let|\n    |:let-register|\n    |user-functions|\n    |usr_41.txt|\n\n \t\t\t\t\t\t\t\t*faq-25.11*\n25.11. I am using some normal mode commands in my Vim script. How do I\n       avoid using the user-defined mappings for these normal mode commands\n       and use the standard Vim functionality for these normal mode\n       commands?\n\nYou can use the `:normal!` command in your script to invoke a normal-mode\ncommand. This will use the standard functionality of the normal mode\ncommand and will not use the user-defined mapping.\n\nFor more information, read:\n\n    |:normal|\n\n \t\t\t\t\t\t\t\t*faq-25.12*\n25.12. How do I get the current visually selected text into a Vim variable\n       or register?\n\nYou can get the current visually selected text into a Vim variable by\nyanking the text into Vim register and then assigning the contents of the\nregister into the variable: >\n\n    :normal! gvy\n    :let myvar = @\"\n<\nThe above command copies the visually selected text into the variable\n\"myvar\".\n\nYou can also use the command: >\n\n    :normal! gv\"*y\n<\nIn the above command, gv reselects the last visually selected text and the\nrest of the command copies the selected text into the * (clipboard)\nregister. Alternatively, you can set the \"a\" flag in the 'guioptions'\noption to automatically copy a visually selected text into the * register.\nTo do this as part of a visual map, you can use a command similar to the\none shown below: >\n\n    :vmap <F3> \"*y:call ...\n<\n\nFor more information, read:\n\n    |gv|\n    |:normal|\n    |:let-@|\n    |quotestar|\n    |clipboard|\n    |registers|\n\n \t\t\t\t\t\t\t\t*faq-25.13*\n25.13. I have some text in a Vim variable \"myvar\". I would like to use this\n       variable in a `:s` substitute command to replace a text \"mytext\".\n       How do I do this?\n\nYou can use the `:execute` command to evaluate the variable: >\n\n    :execute '%s/mytext/' . myvar . '/'\n<\nFor more information, read:\n\n    |:execute|\n\nYou can also use \"\\=\" in the substitute command to evaluate the variable: >\n\n    :%s/mytext/\\=myvar/\n<\nFor more information, read:\n\n    |sub-replace-special|\n\n \t\t\t\t\t\t\t\t*faq-25.14*\n25.14. A Vim variable (bno) contains a buffer number. How do I use this\n       variable to open the corresponding buffer?\n\nThe `:buffer` command will not accept a variable name. It accepts only a\nbuffer number or buffer name. You have to use the `:execute` command to\nevaluate the variable into the corresponding value. For example: >\n\n    :execute \"buffer \" . bno\n<\nFor more information, read:\n\n    |:execute|\n\n \t\t\t\t\t\t\t\t*faq-25.15*\n25.15. How do I store the value of a Vim option into a Vim variable?\n\nYou can prefix the option name with the \"&\" character and assign the option\nvalue to a Vim variable using the `:let` command. For example, to store the\nvalue of the 'textwidth' option into the Vim variable \"old_tw\", you can use\nthe following command: >\n\n    :let old_tw = &tw\n<\nTo explicitly save buffer local options, use the prefix \"l:\" >\n\n    :let old_tw = &l:tw\n<\nIf you want to explicitly select the global option, use the \"g:\" prefix to\nthe option name.\n\nTo do the opposite, to set the 'textwidth' option with the value stored in\nthe \"old_tw\" variable, you can use the following command: >\n\n    :let &tw = old_tw\n<\nFor more information, read:\n\n    |expr-option|\n    |:let-option|\n\n \t\t\t\t\t\t\t\t*faq-25.16*\n25.16. I have copied and inserted some text into a buffer from a Vim\n       function. How do I indent the inserted text from the Vim function?\n\nYou can use the following command to format the just inserted text: >\n\n    :normal '[=']\n<\nFor more information, read:\n\n    |'[|\n    |']|\n    |=|\n    |:normal|\n\n \t\t\t\t\t\t\t\t*faq-25.17*\n25.17. How do I get the character under the cursor from a Vim script?\n\nYou can use the getline() function and use string index [] to get the\ncharacter: >\n\n    :echo getline(\".\")[col(\".\") - 1]\n<\nIn the above command, getline(\".\") returns  the text in the current line.\nThe indexing of the string starts at zero, and you can get a single\ncharacter in a string by its index with the \"string[index]\" notation. The\ncol(\".\") returns the column of the cursor position; the adjustment is to\nget the right character of the string. However, this does NOT work with\nmultibyte characters as this command only returns the byte index.\n\nAlternatively, you can use the following sequence of commands to get the\ncharacter under the cursor: >\n\n    normal! vy\n    let ch=@\"\n<\nNote, that the above commands will change the '< and '> marks.\n\nFor more information, read:\n\n    |getline()|\n    |col()|\n    |expr-[]|\n\n \t\t\t\t\t\t\t\t*faq-25.18*\n25.18. How do I get the name of the current file without the extension?\n\nYou can get the name of the current file without the extension using: >\n\n    :echo expand(\"%:r\")\n<\nWith some commands, you can use the file name modifiers directly: >\n\n    :cd %:p:h\n    :!gcc -o %:r.o %\n    :!xpdf %<.pdf\n<\nFor more information, read:\n\n    |filename-modifiers|\n    |expand()|\n    |cmdline-special|\n    |fnamemodify()|\n\n \t\t\t\t\t\t\t\t*faq-25.19*\n25.19. How do I get the basename of the current file?\n\nYou can use the \":t\" filename modifier to get the basename of the current\nfile: >\n\n    :echo expand(\"%:t\")\n<\nFor more information, read:\n\n    |filename-modifiers|\n\n \t\t\t\t\t\t\t\t*faq-25.20*\n25.20. How do I get the output from a Vim function into the current buffer?\n\nYou can insert the return value from a function using the following command\nin insert mode: >\n\n    <C-R>=MyFunc()\n<\nNote, that this will only insert the return value of the function.\n\nFor more information, read:\n\n    |i_CTRL-R|\n    |i_CTRL-R_CTRL-R|\n    |i_CTRL-R_CTRL-O|\n    |expression|\n\n \t\t\t\t\t\t\t\t*faq-25.21*\n25.21. How do I call external programs from a Vim function?\n\nThere are several ways to call external programs from a Vim function. You\ncan use the builtin system() function to invoke external programs and get\nthe result: >\n\n    :let output = system(\"ls\")\n<\nYou can also use \"!\" ex-command to run an external command.\n\nFor more information, read:\n\n    |system()|\n    |:!|\n    |10.9|\n\n \t\t\t\t\t\t\t\t*faq-25.22*\n25.22. How do I get the return status of a program executed using the `:!`\n       command?\n\nYou can use the predefined Vim v:shell_error variable to get the return\nstatus of the last run shell command.\n\nFor more information, read:\n\n    |v:shell_error|\n\n \t\t\t\t\t\t\t\t*faq-25.23*\n25.23. How do I determine whether the current buffer is modified or not?\n\nYou can check the value of the 'modified' option to determine whether the\ncurrent buffer is modified: >\n\n    :set modified?\n<\nFrom a Vim script, you can check the value of the 'modified' option: >\n\n    if &modified\n        echo \"File is modified\"\n    endif\n<\nFor more information, read:\n\n    |'modified'|\n\n \t\t\t\t\t\t\t\t*faq-25.24*\n25.24. I would like to use the carriage return character in a normal\n       command from a Vim script. How do I specify the carriage return\n       character?\n\nYou can use the `:execute` command to specify the special (control)\ncharacter in a normal mode command: >\n\n    :execute \"normal \\<CR>\"\n    :execute \"normal ixxx\\<Esc>\"\n<\nFor more information, read:\n\n    |:execute|\n    |expr-quote|\n\n \t\t\t\t\t\t\t\t*faq-25.25*\n25.25. How do I split long lines in a Vim script?\n\nYou can split long lines in a Vim script by inserting the backslash\ncharacter (\"\\\") at the start of the next line. For example, >\n\n    set comments=sr:/*,mb:*,el:*/,\n                \\://,\n                \\b:#,\n                \\:%,\n                \\n:>,\n                \\fb:-\n<\nFor more information, read:\n\n    |line-continuation|\n\n \t\t\t\t\t\t\t\t*faq-25.26*\n25.26. When I try to \"execute\" my function using the `:execute Myfunc()`\n       command, the cursor is moved to the top of the current buffer.\n       Why?\n\nThe `:execute` command runs the ex command specified by the argument.\nIn the case of the following command: >\n\n    :execute Myfunc()\n<\nThe call to Myfunc() will return 0. The `:execute` command will run\nthe ex command `:0`, which moves the cursor to the top of the file.\nTo call a Vim function, you should use the `:call` command instead of the\n`:execute` command: >\n\n    :call Myfunc()\n<\nFor more information, read:\n\n    |:call|\n    |:execute|\n    |:echo|\n    |user-functions|\n    |41.5|\n    |41.6|\n    |cmdline-lines|\n\n \t\t\t\t\t\t\t\t*faq-25.27*\n25.27. How do I source/execute the contents of a register?\n\nIf you have yanked a set of Vim commands into a Vim register (for example\nregister \"a\"), then you can source the contents of the register using one\nof the following commands:\n\n    :@a\nor\n    :exe @a\n\nFor more information, read:\n\n    |:@|\n\n \t\t\t\t\t\t\t\t*faq-25.28*\n25.28. After calling a Vim function or a mapping, when I press the \"u\"\n       key to undo the last change, Vim undoes all the changes made by\n       the mapping/function. Why?\n\nWhen you call a function or a mapping, all the operations performed by the\nfunction/mapping are treated as one single operation. When you undo the\nlast operation by pressing \"u\", all the changes made by the\nfunction/mapping are reversed.\n\nFor more information, read:\n\n    |undo-redo|\n    |:map-undo|\n\n \t\t\t\t\t\t\t\t*faq-25.29*\n25.29. How can I call a function defined with s: (script local function)\n       from another script/plugin?\n\nThe s: prefix for a Vim function name is used to create a script local\nfunction. A script local function can be called only from within that\nscript and cannot be called from other scripts. To define a function in a\nscript/plugin, so that it can be called from other plugins/scripts, define\nthe function without the s: prefix.\n\nFor more information, read:\n\n    |script-variable|\n    |script-local|\n    |:scriptnames|\n\n \t\t\t\t\t\t\t\t*faq-25.30*\n25.30. Is it possible to un-source a sourced script? In other words, reverse\n       all the commands executed by sourcing a script.\n\nNo. It is not possible to reverse or undo all the commands executed by\nsourcing a script.\n\nFor more information, read:\n\n    |:source|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-26*\nSECTION 26 - PLUGINS ~\n\n \t\t\t\t\t\t\t\t*faq-26.1*\n26.1. How do I set different options for different types of files?\n\nYou can create filetype plugins to set different options for different\ntypes of files. You should first enable filetype plugins using the command: >\n\n    :filetype plugin on\n<\nA filetype plugin is a vim script that is loaded whenever Vim opens or\ncreates a file of that type.  For example, to ensure that the 'textwidth'\noption is set to 80 when editing a C program (filetype \"c\"), create one of\nthe following files: >\n\n        ~/.vim/ftplugin/c.vim (Unix)\n        %HOME%\\vimfiles\\ftplugin\\c.vim (Windows)\n<\nwith the following text in it: >\n\n        setlocal textwidth=80\n<\nYou can also use autocommands to set specific options when editing specific\ntype of files. For example, to set the 'textwidth' option to 75 for only\n*.txt files, you can use the following autocmd: >\n\n    autocmd BufRead *.txt setlocal textwidth=80\n<\nFor more information, read:\n\n    |filetype-plugin|\n    |add-filetype-plugin|\n    |:autocmd|\n    |40.3|\n\n \t\t\t\t\t\t\t\t*faq-26.2*\n26.2. I have downloaded a Vim plugin or a syntax file or a indent file, or\n      a color scheme or a filetype plugin from the web. Where should I copy\n      these files so that Vim will find them?\n\nYou can place the Vim runtime files (plugins, syntax files, indent files,\ncolor schemes, filetype plugins, etc) under one of the directories\nspecified in the 'runtimepath' option. To determine the current value of\nthe 'runtimepath' option, use the following command: >\n\n    :set runtimepath\n<\nFor Unix systems, this is usually the \"$HOME/.vim\" directory. For MS-Windows\nsystems, this is usually the $VIM\\vimfiles or $HOME\\vimfiles directory.\nDepending on the type of the runtime file, you have to place it under a\nspecific directory under the above runtime directory. The names of the\ndirectories are listed below:\n\n    name        description ~\n    ----------  ------------------ ~\n    colors/     color scheme files\n    compiler/   compiler files\n    doc/        documentation\n    ftplugin/   filetype plugins\n    indent/     indent scripts\n    keymap/     key mapping files\n    lang/       menu translations\n    plugin/     plugin scripts\n    syntax/     syntax files\n    tutor/      files for vimtutor\n\nFor more information, read:\n\n    |your-runtime-dir|\n    |'runtimepath'|\n    |:runtime|\n\n \t\t\t\t\t\t\t\t*faq-26.3*\n26.3. How do I extend an existing filetype plugin?\n\nYou can extend an existing filetype plugin by creating a file in the\nafter/ directory in any of the 'runtimepath' directories.\n\n\n- for small changes to be done after (and in addition to) what is\n  already done by the ftplugin installed with Vim, use an after-directory,\n  as follows (replacing foobar by the 'filetype' of the concerned\n  files):\n    - For changes private to one user:\n        - on Windows:\n            $HOME/vimfiles/after/ftplugin/foobar.vim\n        - on Unix-like OSes:\n            $HOME/.vim/after/ftplugin/foobar.vim\n    - For changes affecting all users on the system:\n        $VIM/vimfiles/after/ftplugin/foobar.vim\n\n- when replacing the whole filetype-plugin by a different version, or\n  when installing a new ftplugin for some filetype not yet supported by\n  Vim out of the box: use the same paths without the after/ in them. In\n  that case you should place near the start of your plugin an \"if...\n  finish... endif... let\" block like the one in the plugins distributed\n  with Vim.\n\nAll the above paths are given in Vim terminology (which is similar to\nUnix terminology, but is understood even by Vim for Windows); they don't\nexist by default, so the first time you need them you will have to\ncreate them using mkdir (on any OS including DOS/Windows) or md (on\nDOS/Windows only). $VIM and, on DOS/Windows, $HOME, do not necessarily\nexist outside Vim. If $HOME has no value (or no valid value) inside Vim,\nyou can use $VIM instead; but on any but possibly very old versions of\nWindows, $HOMEDRIVE and $HOMEPATH are defined by the system, and if\n$HOME is undefined at Vim startup, Vim will set it by expanding\n$HOMEDRIVE$HOMEPATH before sourcing your vimrc. To know which values Vim\nuses, you can type (in a running Vim): >\n\n    :echo $VIM\n    :echo $HOME\n<\n\nIf you placed the file in the after/ftplugin runtime directory, then Vim\nwill first source the existing filetype plugin file and then will source\nthe new file.  If you placed the file in the $VIMRTUNTIME/ftplugin runtime\ndirectory, then Vim will first source the new file and then will source the\nexisting filetype plugin file.\n\nFor more information, read:\n\n    |ftplugin-overrule|\n    |filetype-plugin|\n    |add-filetype-plugin|\n    |'runtimepath'|\n\n \t\t\t\t\t\t\t\t*faq-26.4*\n26.4. How do I turn off loading the Vim plugins?\n\nYou can reset the 'loadplugins' option to turn off loading the plugins: >\n\n    :set noloadplugins\n<\nYou can also specify the \"--noplugin\" command line argument to stop loading\nthe plugins: >\n\n    $ vim --noplugin\n<\nFor more information, read:\n\n    |'loadplugins'|\n    |--noplugin|\n    |load-plugins|\n\n \t\t\t\t\t\t\t\t*faq-26.5*\n26.5. How do I turn on/off loading the filetype plugins?\n\nBy default, Vim will not load the filetype plugins. You can configure Vim\nto load filetype plugins using the command: >\n\n    filetype plugin on\n<\nYou can turn off loading the filetype plugins using: >\n\n    filetype plugin off\n<\nFor more information, read:\n\n    |:filetype-plugin-on|\n    |:filetype-plugin-off|\n    |:filetype|\n\n \t\t\t\t\t\t\t\t*faq-26.6*\n26.6. How do I override settings made in a file type plugin in the global\n      ftplugin directory for all the file types?\n\nYou can use an autocommand triggered on the FileType event: >\n\n    au Filetype * set formatoptions=xyz\n<\nThis should at least be after \"filetype on\" in your vimrc. Best is to put\nit in your \"myfiletypefile\" file, so that it's always last.\n\nIf you want to override a setting for a particular filetype, then create a\nfile with the same name as the original filetype plugin in the\n~/.vim/after/ftplugin directory For example, to override a setting in the\nc.vim filetype plugin, create a c.vim file in the ~/.vim/after/ftplugin\ndirectory and add your preferences in this file.\n\nFor more information, read:\n\n    |ftplugin-overrule|\n    |ftplugins|\n    |myfiletypefile|\n\n \t\t\t\t\t\t\t\t*faq-26.7*\n26.7. How do I disable the Vim directory browser plugin?\n\nTo disable the directory browsing Vim plugin, add the following line to\nyour .vimrc file: >\n\n    let g:loaded_netrw = 1\n<\nFor more information, read:\n\n    |netrw|\n\n \t\t\t\t\t\t\t\t*faq-26.8*\n26.8. How do I set the filetype option for files with names matching a\n      particular pattern or depending on the file extension?\n\nYou can set the 'filetype' option for files with names matching a\nparticular pattern using an autocmd. For example, to set the 'filetype'\noption to \"c\" for all files with extension \".x\", you can use the following\nautocmd: >\n\n    autocmd! BufRead,BufNewFile *.x     setfiletype c\n<\nA better alternative to the above approach is to create a filetype.vim file\nin the ~/.vim directory (or in one of the directories specified in the\n'runtimepath' option) and add the following lines: >\n\n    \" my filetype file\n    if exists(\"did_load_filetypes\")\n        finish\n    endif\n    augroup filetypedetect\n        au! BufRead,BufNewFile *.x       setfiletype c\n    augroup END\n<\nFor more information, read:\n\n    |new-filetype|\n    |43.2|\n    |:setfiletype|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-27*\nSECTION 27 - EDITING PROGRAM FILES ~\n\n \t\t\t\t\t\t\t\t*faq-27.1*\n27.1. How do I enable automatic indentation for C/C++ files?\n\nYou can enable file-type based indentation using: >\n\n    :filetype indent on\n<\nIf you want to only enable automatic C indentation, then use: >\n\n    :set cindent\n<\nFor more information, read:\n\n    |'cindent'|\n    |C-indenting|\n    |filetype|\n\n \t\t\t\t\t\t\t\t*faq-27.2*\n27.2. How do I configure the indentation used for C/C++ files?\n\nYou can configure the Vim C indentation by modifying the value of the\n'cinoptions', 'cinkeys' and 'cinwords' options.\n\nFor more information, read:\n\n    |'cindent'|\n    |'cinoptions'|\n    |'cinkeys'|\n    |'cinwords'|\n    |C-indenting|\n    |cinoptions-values|\n    |'smartindent'|\n\n \t\t\t\t\t\t\t\t*faq-27.3*\n27.3. How do I turn off the automatic indentation feature?\n\nBy default, the automatic indentation is not turned on. You must have\nconfigured Vim to do automatic indentation in either .vimrc or .gvimrc\nfiles. You can disable automatic indentation using either, >\n\n    :filetype indent off\n<\nor >\n\n    :set nocindent\n<\nAlso, check the setting for the following options: >\n\n    :set autoindent?\n    :set smartindent?\n    :set indentexpr?\n<\nFor more information, read:\n\n    |'cindent'|\n    |:filetype-indent-off|\n    |'autoindent'|\n    |'smartindent'|\n    |'indentexpr'|\n\n \t\t\t\t\t\t\t\t*faq-27.4*\n27.4. How do I change the number of space characters used for the automatic\n      indentation?\n\nYou can modify the 'shiftwidth' option to change the number of space\ncharacters used for the automatic indentation: >\n\n    :set shiftwidth=4\n<\nFor more information, read:\n\n    |'shiftwidth'|\n\n \t\t\t\t\t\t\t\t*faq-27.5*\n27.5. I am editing a C program using Vim. How do I display the definition\n      of a macro or a variable?\n\nYou can use the \"[d\" command to display the definition of a macro, \"[i\"\ncommand to display the definition of a variable, \"gd\" to goto the local\ndeclaration of a variable and \"gD\" to go to the global Declaration.\n\nFor more information, read:\n\n    |[d|\n    |[i|\n    |gd|\n    |gD|\n    |include-search|\n    |29.4|\n    |29.5|\n\n \t\t\t\t\t\t\t\t*faq-27.6*\n27.6. I am editing a C program using Vim. How do I jump to the beginning or\n      end of a code block from within the block?\n\nYou can use \"[{\" command to jump to the beginning of the code block and \"]}\"\nto jump to the end of the code block from inside the block.\n\nFor more information, read:\n\n    |[{|\n    |]}|\n    |various-motions|\n\n \t\t\t\t\t\t\t\t*faq-27.7*\n27.7. When editing C++ files and when inserting new lines above or below a\n      comment (//) line, Vim automatically inserts the C++ comment\n      character (//) at the beginning of the line. How do I disable this?\n\nThis automatic insertion of the comment leader (//) when new lines\nare added is controlled by three flags in the 'formatoptions'\noption:  \"c\", \"r\" and \"o\".  \"c\" enables auto-wrapping of comment\nlines when typing extends beyond the right margin.  \"r\" enables the\nautomatic insertion of the comment leader when <Enter> is pressed\nwhile editing a comment line.  \"o\" enables the automatic insertion\nof the comment leader when a new line is opened above or below an\nexisting comment line by typing O or o in Normal mode.\n\nYou can stop Vim from automatically inserting the comment leader\nwhen typing <Enter> within a comment or when opening a new line by\nremoving the \"r\" and \"o\" flags from 'formatoptions'.\n\n   :set formatoptions-=r\n   :set formatoptions-=o\n\nThe default filetype plugin for C and C++ files\n($VIMRUNTIME/ftplugin/c.vim) adds the \"r\" and \"o\" flags to the\n'formatoptions' option.  If you want to override this for C++ files,\nthen you can add the above lines to the\n~/.vim/after/ftplugin/cpp.vim file.\n\nFor more information, read:\n\n    |'formatoptions'|\n    |30.6|\n    |format-comments|\n    |filetype-plugins|\n    |ftplugin-overrule|\n\n \t\t\t\t\t\t\t\t*faq-27.8*\n27.8. How do I add the comment character \"#\" to a set of lines at the\n      beginning of each line?\n\nFirst, select the first character in all the lines using visual block mode\n(CTRL-V). Press \"I\" to start inserting characters at the beginning of the\nline. Enter the comment character and then stop the insert mode by pressing\n<Esc>. Vim will automatically insert the entered characters at the\nbeginning of all the selected lines.\n\nFor more information, read:\n\n    |visual-block|\n    |blockwise-operators|\n    |v_b_I|\n\n \t\t\t\t\t\t\t\t*faq-27.9*\n27.9. How do I edit a header file with the same name as the corresponding C\n      source file?\n\nYou can use the following command to edit a header file with the same name\nas the corresponding C source file: >\n\n    :e %:t:r.h\n<\nYou can use the following command to edit the file in a new split window: >\n\n    :sp %:t:r.h\n<\nIn the above commands, the percent sign expands to the name of the current\nfile.  The `:t` modifier extracts the tail (last component) of the\nfilename. The `:r` modifier extracts the root of the filename.  The .h is\nappended to the resulting name to get the header filename.\n\nAnother approach is to use the following command: >\n\n    :sfind %:t:r.h\n<\nThis command will search for the header file in the directories specified\nin the 'path' option.\n\nFor more information, read:\n\n    |cmdline-special|\n    |filename-modifiers|\n    |:sfind|\n    |'path'|\n\n \t\t\t\t\t\t\t\t*faq-27.10*\n27.10. How do I automatically insert comment leaders while typing comments?\n\nTo automatically insert comment leaders while typing comments, add the \"r\"\nand \"o\" flags to the 'formatoptions' option. >\n\n    :set formatoptions+=ro\n<\nYou may also want to add the \"c\" flag to auto-wrap comments using the\n'textwidth' option setting and the \"q\" flag to format comments with the\n\"gq\" command: >\n\n    :set formatoptions=croq\n<\nFor more information, read:\n\n    |30.6|\n    |format-comments|\n    |'comments'|\n    |fo-table|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-28*\nSECTION 28 - QUICKFIX ~\n\n \t\t\t\t\t\t\t\t*faq-28.1*\n28.1. How do I build programs from Vim?\n\nYou can use the `:make` command to build programs from Vim. The `:make`\ncommand runs the program specified by the 'makeprg' option.\n\nFor more information, read:\n\n    |30.1|\n    |:make_makeprg|\n    |'makeprg'|\n    |'makeef'|\n    |:make|\n    |quickfix|\n\n \t\t\t\t\t\t\t\t*faq-28.2*\n28.2. When I run the make command in Vim I get the errors listed as the\n      compiler compiles the program. When it finishes this list disappears\n      and I have to use the `:clist` command to see the error message again.\n      Is there any other way to see these error messages?\n\nYou can use the `:copen` or `:cwindow` command to open the quickfix window\nthat contains the compiler output. You can select different error lines\nfrom this window and jump to the corresponding line in the source code.\n\nFor more information, read:\n\n    |:copen|\n    |:cwindow|\n    |quickfix|\n\n \t\t\t\t\t\t\t\t*faq-28.3*\n28.3. How can I perform a command for each item in the quickfix/location\n      list?\n\nStarting from Vim 7.4.858 Vim provides the new commands `:cfdo`, `:cdo`,\n`:lfdo` and `:ldo.` They work by iterating over all items in the quickfix\nlist and performing a command on each. The difference is, that the `:lfdo`\nand `:ldo` commands iterate over the location list entries, while the\n`:cfdo` and `:cdo` commands operate on the items in the quickfix list. Also,\nthe `:cfdo` and `:lfdo` operate on all different files, while the `:cdo` and\n`:ldo` commands operate on each item in the quickfix/location list.\n\nFor example you could vimgrep all C files in the current directory for a\nsearch string \"Foobar\": >\n\n    :vimgrep /Foobar/ *.c\n<\nand as this populates your quickfix list, you could simply replace all\noccurences by using: >\n\n    :cdo :%s/Foobar/Foobaz | upd\n<\nFor more information, read:\n\n    |:cfdo|\n    |:cdo|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-29*\nSECTION 29 - FOLDING ~\n\n \t\t\t\t\t\t\t\t*faq-29.1*\n29.1. How do I extend the Vim folding support?\n\nYou can use the 'foldexpr' option to fold using a user specified function.\nFor example, to fold subroutines of the following form into a single line: >\n\n    sub foo {\n      my $barf;\n      $barf = 3;\n      return $barf;\n    }\n<\nYou can use the following commands: >\n\n    set foldmethod=expr\n    set foldexpr=MyFoldExpr(v:lnum)\n    fun! MyFoldExpr(line)\n        let str = getline(a:line)\n        if str =~ '^sub\\>'\n            return '1'\n        elseif str =~ '^}'\n            return '<1'\n        else\n            return foldlevel(a:line - 1)\n        endif\n    endfun\n<\nFor more information, read:\n\n    |'foldexpr'|\n    |fold-expr|\n\n \t\t\t\t\t\t\t\t*faq-29.2*\n29.2. When I enable folding by setting the 'foldmethod' option, all the\n      folds are closed. How do I prevent this?\n\nYou can set the 'foldlevelstart' option to a particular value to close only\nfolds above the specified value. >\n\n    :set foldlevelstart=99\n<\nFor more information, read:\n\n    |'foldlevelstart'|\n    |'foldlevel'|\n    |fold-foldlevel|\n\n \t\t\t\t\t\t\t\t*faq-29.3*\n29.3. How do I control how many folds will be opened when I start editing a\n      file?\n\nYou can modify the 'foldlevelstart' option to control the number of folds\nthat will be opened when you start editing a file. To start editing with\nall the folds closed: >\n\n    :set foldlevelstart=0\n<\nTo start editing with all the folds opened, you can use >\n\n    :set foldlevelstart=999\n<\nFor more information, read:\n\n    |'foldlevelstart'|\n\n \t\t\t\t\t\t\t\t*faq-29.4*\n29.4. How do I open and close folds using the mouse?\n\nYou can click on the + and - characters displayed at the leftmost column to\nopen and close fold. For this to work, you have to set the 'foldcolumn'\nto a value greater than zero: >\n\n    :set foldcolumn=2\n<\nFor more information, read:\n\n    |'foldcolumn'|\n\n \t\t\t\t\t\t\t\t*faq-29.5*\n29.5. How do I change the text displayed for a closed fold?\n\nYou can use the 'foldtext' option to change the text displayed for a closed\nfold.\n\nFor more information, read:\n\n    |'foldtext'|\n    |fold-foldtext|\n    |'fillchars'|\n\n \t\t\t\t\t\t\t\t*faq-29.6*\n29.6. How do I store and restore manually created folds across different\n      Vim invocations?\n\nYou can use the `:mkview` command to store manually created folds. Later,\nyou can use the `:loadview` command to restore the folds. For this to work,\nthe 'viewoptions' must contain \"folds\".\n\nFor more information, read:\n\n    |28.4|\n    |:mkview|\n    |:loadview|\n    |'viewoptions'|\n    |'viewdir'|\n    |:mksession|\n    |'sessionoptions'|\n\n \t\t\t\t\t\t\t\t*faq-29.7*\n29.7. I have enabled syntax based folding. Why is Vim so slow?\n\nSyntax based folding is currently rather slow in Vim and will possibly\nslow down Vim considerably. There is an issue in the todo list to fix\nthis, but the todo list is rather long and it may take a while until\nthis will be fixed.\n\nYou can find the issue in the todo list, if you read\n\n    |todo.txt|\n\nfollowed by a search for \"folding with 'foldmethod'\"\n\nA workaround is to temporarily set the foldmethod to manual while in\ninsert mode. This is described in the wiki at:\n\n    http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-30*\nSECTION 30 - VIM WITH EXTERNAL APPLICATIONS ~\n\n \t\t\t\t\t\t\t\t*faq-30.1*\n30.1. Can I run a shell inside a Vim window?\n\nSince Version 8.1 Vim comes with a terminal window included. It allows\nto run a shell inside an ordinary Vim window (e.g. split) asynchronously\nand interact with the shell using the normal Vim commands.\n\nWhen the focus is in the terminal window, typed keys will be sent to\nthe job and is called terminal mode. You can click outside of the\nterminal window to move keyboard focus elsewhere, alternatively one can\nuse CTRL-W to novigate between different Vim windows. To feed CTRL-W into the\nterminal, one needs to use CTRL-W .\n\nTo map keys specifically for terminal mode, use the new `:tmap`\ncommand. After typing CTRL-W the terminal window will switch to\nTerminal-Normal mode (this can be used to move the cursor around, scroll\nthe window, etc. Just like normal mode).\n\nTo interact between the terminal and Vim, Vim implements several\ninterfaces using term_sendkeys(), terminal-api and the client-server\nmechanism.\n\nFor more information, read:\n\n    |terminal|\n    |mapmode-t|\n    |Terminal-Normal|\n    |terminal-communication|\n\n \t\t\t\t\t\t\t\t*faq-30.2*\n30.2. How do I pass the word under the cursor to an external command?\n\nYou can use the special keyword <cword> to pass the word under the cursor\nto an external command. For example: >\n\n    :!dict <cword>\n<\nFor more information, read:\n\n    |:<cword>|\n\n \t\t\t\t\t\t\t\t*faq-30.3*\n30.3. How do I get the output of a shell command into a Vim buffer?\n\nYou can use the `:r !` command to get the output of a shell command into a\nVim buffer. For example, to insert the output of the \"ls\" shell command,\nyou can use the following command: >\n\n    :r !ls\n<\nTo insert the output of the shell command above the first line use the\nfollowing command: >\n\n    :0r !ls\n<\nFor more information, read:\n\n    |:r!|\n\n \t\t\t\t\t\t\t\t*faq-30.4*\n30.4. How do I pipe the contents of the current buffer to an external\n      command and replace the contents of the buffer with the output from\n      the command?\n\nYou can use the :! command to pipe the contents of the current buffer to an\nexternal command and replace the contents of the buffer with the output\nfrom the command. For example, to sort the contents of the current buffer,\nusing the Unix sort command, you can use the following command: >\n\n    :%!sort\n<\nTo sort only lines 10-20, you can use the following command >\n\n    :10,20!sort\n<\nAlso, if you want to pipe a buffer to an external command but not put the\nresults back in the buffer, you can use >\n\n    :w !sort\n<\nThe above command will pipe the entire buffer to the sort command.  Note,\nthat the space between the \"w\" and the \"!\" is critical.  To pipe only a\nrange of lines, you can use >\n\n    :10,20w !sort\n<\nThe above command will pipe the lines 10-20 to the sort command.\n\nFor more information, read:\n\n    |:range!|\n    |10.9|\n    |:w_c|\n\n \t\t\t\t\t\t\t\t*faq-30.5*\n30.5. How do I sort a section of my file?\n\nYou use the `:sort` command like this:\n\n   :5,100sort\n\nUsing the `:sort` command provides many options, you can sort numerical on\nthe first found decimal number using:\n\n   :%sort n\n\nOr you can specify to sort on the text, starting at virtual column 8:\n\n   :%sort /.*\\%8v/\n\nAlternatively can pipe a section of the file to the Unix \"sort\" utility to\nsort the file. For example: >\n\n    :5,100!sort\n<\nYou can also use a visual block, and use the \"!sort\" command on the\nselected block.\n\nSee also:\n    |:sort|\n    |filter|\n\n \t\t\t\t\t\t\t\t*faq-30.6*\n30.6. How do I use Vim as a pager?\n\nYou can use Vim as a pager using the $VIMRUNTIME/macros/less.sh shell\nscript, supplied as part of the standard Vim distribution. This shell\nscript uses the $VIMRUNTIME/macros/less.vim Vim script to provide less like\nkey bindings.\n\nFor more information, read:\n\n    |less|\n\n \t\t\t\t\t\t\t\t*faq-30.7*\n30.7. How do I view Unix man pages from inside Vim?\n\nYou can view Unix man pages, inside Vim, using the man.vim plugin supplied\nas part of the standard Vim distribution. To use this plugin, add the\nfollowing line to your startup vimrc file: >\n\n    runtime ftplugin/man.vim\n<\nYou can also press the K key to run the program specified by the\n'keywordprg' option with the keyword under the cursor. By default,\n'keywordprg' is set to run man on the keyword under the cursor.\n\nFor more information, read:\n\n    |ft-man-plugin|\n    |K|\n    |'keywordprg'|\n\n \t\t\t\t\t\t\t\t*faq-30.8*\n30.8. How do I change the diff command used by the Vim diff support?\n\nBy default, the Vim diff support uses the 'diff' command. You can change\nthis by changing the 'diffexpr' option.\n\nFor more information, read:\n\n    |diff-diffexpr|\n    |'diffexpr'|\n\n \t\t\t\t\t\t\t\t*faq-30.9*\n30.9. How do I use the Vim diff mode without folding?\n\nYou can use the following command-line to start Vim with two filenames\nand use the diff mode without folding: >\n\n    $ vim -o file1 file2 \"+windo set diff scrollbind scrollopt+=hor nowrap\"\n<\nIf you like vertically split windows, then replace \"-o\" with \"-O\".\n\nFor more information, read:\n\n    |vimdiff|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-31*\nSECTION 31 - GUI VIM ~\n\n \t\t\t\t\t\t\t\t*faq-31.1*\n31.1. How do I create buffer specific menus?\n\nAdding support for buffer specific menus is in the Vim TODO list. In the\nmean time, you can try Michael Geddes's plugin, buffermenu.vim:\n\n    https://www.vim.org/scripts/script.php?script_id=246\n\n \t\t\t\t\t\t\t\t*faq-31.2*\n31.2. How do I change the font used by GUI Vim?\n\nYou can change the 'guifont' option to change the font used by GUI Vim.  To\ndisplay the current value of this option, you can use >\n\n    :set guifont?\n<\nYou can add the displayed font name to the .vimrc file to use the font\nacross Vim sessions. For example, add the following line to the .vimrc file\nto use Andale Mono font. >\n\n    set guifont=Andale_Mono:h10:cANSI\n<\nFor Win32, GTK and Photon version of Vim, you can use the following command\nto bringup a dialog which will help you in changing the guifont: >\n\n    :set guifont=*\n<\nYou can also use the -font Vim command line option to specify the font used\nfor normal text.\n\nFor more information, read:\n\n    |'guifont'|\n    |'guifontset'|\n    |'guifontwide'|\n    |font-sizes|\n    |-font|\n    |-boldfont|\n    |-italicfont|\n    |-menufont|\n    |-menufontset|\n\n \t\t\t\t\t\t\t\t*faq-31.3*\n31.3. When starting GUI Vim, how do I specify the location of the GVIM\n      window?\n\nYou can use the \"-geometry\" command line argument to specify the location\nof the GUI Vim window. For example: >\n\n    $ gvim -geometry 80x25+100+300\n<\nFor more information, read:\n\n    |31.4|\n    |-geom|\n\n \t\t\t\t\t\t\t\t*faq-31.4*\n31.4. How do I add a horizontal scrollbar in GVim?\n\nYou can enable the horizontal scrollbar by modifying the 'guioptions'\noption: >\n\n    :set guioptions+=b\n<\nFor more information, read:\n\n    |'guioptions'|\n    |gui-horiz-scroll|\n\n \t\t\t\t\t\t\t\t*faq-31.5*\n31.5. How do I make the scrollbar appear in the left side by default?\n\nYou can add the \"l\" flag to the 'guioptions' option to make the scrollbar\nappear in the left side. >\n\n    :set guioptions+=l\n    :set guioptions-=r\n<\nFor more information, read:\n\n    |'guioptions'|\n    |gui-scrollbars|\n\n \t\t\t\t\t\t\t\t*faq-31.6*\n31.6. How do I remove the Vim menubar?\n\nYou can remove the Vim menubar by removing the \"m\" flag from the\n'guioptions' option: >\n\n    :set guioptions-=m\n<\nFor more information, read:\n\n    |'guioptions'|\n\n \t\t\t\t\t\t\t\t*faq-31.7*\n31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the menu\n      starting with that letter is selected. I don't want this behavior as\n      I want to map the <Alt>-<key> combination. How do I do this?\n\nYou can use the 'winaltkeys' option to disable the use of the <Alt> key to\nselect a menu item: >\n\n    :set winaltkeys=no\n<\nFor more information, read:\n\n    |'winaltkeys'|\n    |:simalt|\n\n \t\t\t\t\t\t\t\t*faq-31.8*\n31.8. Is it possible to scroll the text by dragging the scrollbar so that\n      the cursor stays in the original location?\n\nThe way Vim is designed, the cursor position has to be in a visible spot in\nnormal, visual, select and insert mode. This cannot be changed without\nmodifying Vim. When the scrollbar is used, the cursor will be moved so that\nit is always visible. Another approach to solving this problem is to use\nthe Vim marks. You can mark the current cursor position using ma. Then\nscroll to a different part of the text and jump back to the old position\nusing `a. You can also try the following suggestion from the Vim Online\nwebsite:\n\n    http://vim.wikia.com/wiki/VimTip320\n\nFor more information, read:\n\n    |mark-motions|\n\n \t\t\t\t\t\t\t\t*faq-31.9*\n31.9. How do I get gvim to start browsing files in a particular directory\n      when using the `:browse` command?\n\nYou can set the 'browsedir' option to the default directory to use for the\n`:browse` command. >\n\n    :set browsedir='<your_dir>'\n<\nFor more information, read:\n\n    |'browsedir'|\n\n \t\t\t\t\t\t\t\t*faq-31.10*\n31.10. For some questions, like when a file is changed outside of Vim, Vim\n       displays a GUI dialog box. How do I replace this GUI dialog box with\n       a console dialog box?\n\nYou can set the \"c\" flag in the 'guioptions' option to configure Vim to use\nconsole dialogs instead of GUI dialogs: >\n\n    :set guioptions+=c\n<\nFor more information, read:\n\n    |'guioptions'|\n\n \t\t\t\t\t\t\t\t*faq-31.11*\n31.11. I am trying to use GUI Vim as the editor for my xxx application.\n       When the xxx application launches GUI Vim to edit a file, the\n       control immediately returns to the xxx application. How do I start\n       GUI Vim, so that the control returns to the xxx application only\n       after I quit Vim?\n\nYou have to start GUI Vim with the \"-f\" (foreground) command line option: >\n\n    $ gvim -f\n<\nBy default, GUI Vim will disconnect from the program that started Vim. With\nthe '-f' option, GUI Vim will not disconnect from the program that started\nit.\n\nFor more information, read:\n\n    |gui-fork|\n    |-f|\n\n \t\t\t\t\t\t\t\t*faq-31.12*\n31.12. Why does the \"Select Font\" dialog doesn't show all the fonts\n       installed in my system?\n\nVim supports only fixed width (mono-spaced) fonts. Proportional fonts are\nnot supported.  In the \"Select Font\" dialog, only fixed width fonts will be\ndisplayed.\n\nFor more information, read:\n\n    |font-sizes|\n    |'guifont'|\n\n \t\t\t\t\t\t\t\t*faq-31.13*\n31.13. How do I use the mouse in Vim command-line mode?\n\nYou can set the \"c\" flag in the 'mouse' option to use mouse in the Vim\ncommand-line mode: >\n\n    :set mouse+=c\n<\nFor more information, read:\n\n    |mouse-using|\n    |gui-mouse|\n    |09.2|\n\n \t\t\t\t\t\t\t\t*faq-31.14*\n31.14. When I use the middle mouse button to scroll text, it pastes the\n       last copied text. How do I disable this behavior?\n\nYou can map the middle mouse button to <Nop> to disable the middle mouse\nbutton: >\n\n    :map  <MiddleMouse> <Nop>\n    :map! <MiddleMouse> <Nop>\n<\nFor more information, read:\n\n    |gui-mouse-mapping|\n    |<Nop>|\n\n \t\t\t\t\t\t\t\t*faq-31.15*\n31.15. How do I change the location and size of a GUI Vim window?\n\nYou can use the `:winpos` command to change the Vim window position. To\nchange the size of the window, you can modify the 'lines' and 'columns'\noptions.\n\nFor example, the following commands will position the GUI Vim window at the\nX,Y co-ordinates 50,50 and set the number of lines to 50 and the number of\ncolumns to 80. >\n\n    :winpos 50 50\n    :set lines=50\n    :set columns=80\n<\nThe arguments to the `:winpos` command specify the pixel co-ordinates of the\nVim window. The 'lines' and 'columns' options specify the number of lines\nand characters to use for the height and the width of the window\nrespectively.\n\nFor more information, read:\n\n    |31.4|\n    |:winpos|\n    |'lines'|\n    |'columns'|\n    |GUIEnter|\n\n \t\t\t\t\t\t\t\t*faq-31.16*\n31.16. When splitting the Vim window vertically, Vim changes the position.\n\nThis is a known problem. When you are splitting the Vim window, Vim will\ntry to draw a scrollbar. Since this changes the gui window, Vim tries to\nresize its main window to keep the same position and this will cause Vim\nto move its position. This happens on Windows with a multi-window setup or\na window that was \"snapped\" to a certain position.\n\nA workaournd to this problem is, to remove gui scrollbars, e.g. >\n\n    :set guioptions-=L\n<\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-32*\nSECTION 32 - VIM ON UNIX ~\n\n \t\t\t\t\t\t\t\t*faq-32.1*\n32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim\n      freezes. What should I do now?\n\nMany terminal emulators and real terminal drivers use the CTRL-S key to\nstop the data from arriving so that you can stop a fast scrolling display\nto look at it (also allowed older terminals to slow down the computer so\nthat it did not get buffer overflows).  You can start the output again by\npressing the CTRL-Q key.\n\nWhen you press the CTRL-S key, the terminal driver will stop sending the\noutput data. As a result of this, it will look like Vim is hung. If you\npress the CTRL-Q key, then everything will be back to normal.\n\nYou can turn off the terminal driver flow control using the \"stty\" command: >\n\n    $ stty -ixon -ixoff\n<\nor, you can change the keys used for the terminal flow control, using the\nfollowing commands: >\n\n    $ stty stop <char>\n    $ stty start <char>\n<\n \t\t\t\t\t\t\t\t*faq-32.2*\n32.2. I am seeing weird screen update problems in Vim. What can I do to\n      solve this screen/display update problems?\n\nYou have to use a proper terminal emulator like xterm with correct TERM\nsettings (TERM=xterm) and a correct terminfo/termcap file.\nFor more information, read:\n\n    |'term'|\n\n \t\t\t\t\t\t\t\t*faq-32.3*\n32.3. I am using the terminal/console version of Vim. In insertmode, When I\n      press the backspace key, the character before the cursor is not\n      erased. How do I configure Vim to do this?\n\nYou have to make sure that Vim gets the correct keycode for the backpspace\nkey. You can try using the command: >\n\n    :fixdel\n<\nMake sure the TERM environment variable is set to the correct terminal\nname. You can try using the \"stty\" command: >\n\n    $ stty erase ^H\n<\nwhere, you have to enter the ^H character by pressing the CTRL-V key and\nthen the CTRL-H key. Also check the value of your 'backspace' setting.\n\nFor more information, read:\n\n    |:fixdel|\n    |Linux-backspace|\n    |NetBSD-backspace|\n    |'backspace'|\n\n \t\t\t\t\t\t\t\t*faq-32.4*\n32.4. I am using Vim in a xterm. When I quit Vim, the screen contents are\n      restored back to the original contents. How do I disable this?\n\nThe xterm has a capability called \"alternate screen\".  If this capability\nis present, vim switches to that alternate screen upon startup and back on\nexit, thus restoring the original screen contents.  To disable this\nfeature, add the following line to your .vimrc file: >\n\n    :set t_ti= t_te=\n<\nFor more information, read:\n\n    |'restorescreen'|\n    |xterm-screens|\n\n \t\t\t\t\t\t\t\t*faq-32.5*\n32.5. When I start Vim, it takes quite a few seconds to start. How do I\n      minimize the startup time?\n\nThis may be related to Vim opening the X display for setting the xterm\ntitle and using the X clipboard. Make sure the DISPLAY variable is set to\npoint to the correct host. Try using the command line: >\n\n    $ vim -X\n<\nThis will prevent Vim from opening the X display. With this command-line\noption, the X clipboard cannot be used and also Vim will not be able to\nchange the xterm title.\n\nYou can also set the 'clipboard' option to >\n\n    :set clipboard=exclude:.*\n<\nThis has the same effect as using the -X command-line argument.\n\nFor more information, read:\n\n    |-X|\n    |'clipboard'|\n\nIf the clipboard is not the cause of the slow startup, it might be a\nplugin that slows down Vim. In that case, you can use the --startuptime\nargument to debug this further. You can do: >\n\n    $ vim --startuptime vim_startup.log\n<\nand the timing will be written to the file vim_startup.log. For even\nmore advanced profiling, you can use the profiling feature, that is\navailable in huge builds of Vim. To do so, call Vim like this: >\n\n    $ vim --cmd 'profile start profile.log' \\\n      --cmd 'profile func *' \\\n      --cmd 'profile file *' \\\n      -c 'profdel func *' \\\n      -c 'profdel file *' \\\n      -c 'qa!'\n<\nAfter running this, you will have a file profile.log in your current\ndirectory. To further analyse this, open the file profile.log and run: >\n\n    \" Open profile.log file in vim first\n    :let timings=[]\n    :g/^SCRIPT/call add(timings, [getline('.')[len('SCRIPT  '):], matchstr(getline(line('.')+1), '^Sourced \\zs\\d\\+')]+map(getline(line('.')+2, line('.')+3), 'matchstr(v:val, ''\\d\\+\\.\\d\\+$'')'))\n    :enew\n    :call setline('.', ['count total (s)   self (s)  script']+map(copy(timings), 'printf(\"%5u %9s   %8s  %s\", v:val[1], v:val[2], v:val[3], v:val[0])'))\n<\nFor more information, read:\n\n    |--startuptime|\n    |profiling|\n\n \t\t\t\t\t\t\t\t*faq-32.6*\n32.6. How can I make the cursor in gvim in unix stop blinking?\n\nYou can modify the 'guicursor' option, to stop the cursor from blinking.\nFor example: >\n\n    :set guicursor=a:blinkon0\n<\nFor more information, read:\n\n    |'guicursor'|\n\n \t\t\t\t\t\t\t\t*faq-32.7*\n32.7. How do I change the menu font on GTK Vim?\n\nYou can modify the ~/.gtkrc file to change the menu font on GTK Vim. For\nexample: >\n\n    style \"default\"\n    { font =\"smooth09\" }\n    class \"*\" style \"default\"\n<\nThe last line changes the font of all widgets.\n\nFor more information, read:\n\n    |gui-gtk|\n\n \t\t\t\t\t\t\t\t*faq-32.8*\n32.8. How do I prevent CTRL-Z from suspending Vim?\n\nYou can map CTRL-Z to prevent the suspending. Here are some suggestions:\n\n- Make CTRL-Z do nothing: >\n\n    :map <C-Z> <Nop>\n<\n- Make CTRL-Z start a shell: >\n\n    :map <C-Z> :shell<CR>\n<\n- Make CTRL-Z give an error message: >\n\n    :map <C-Z> :\"suspending disabled<CR>\n<\nFor the last example, the double quote is necessary in order to keep the\nmessage on the status line.\n\n \t\t\t\t\t\t\t\t*faq-32.9*\n32.9. When I kill the xterm running Vim, the Vim process continues to run\n      and takes up a lot of CPU (99%) time. Why is this happening?\n\nWhen Vim is built with support for Python interface, you will have this\nproblem. This is a known problem with the python thread library and Vim.  To\nsolve this problem, use a Vim binary built without the Python interface.\n\nFor more information, read:\n\n    |+python|\n    |python|\n\n \t\t\t\t\t\t\t\t*faq-32.10*\n32.10. How do I get the Vim syntax highlighting to work in a Unix terminal?\n\nThe easiest and simplest way to get Vim syntax highlighting is to use the\nGUI version of Vim (GVIM). To get syntax highlighting to work in the\nconsole/terminal version of Vim, you have to run a terminal emulator (like\nXfree86 xterm or rxvt or dtterm) that supports color. Note that if a\nterminal emulator supports changing the background and foreground colors,\nthat does not mean that it also supports ANSI escape sequences for changing\nthe color. You can download the latest version of Xfree86 xterm from\nhttps://invisible-island.net/xterm/xterm.html\nYou can download the latest version of rxvt from https://rxvt.org\nYou have to install the terminfo/termcap file that supports colors for the\nterminal emulator. Also, set the TERM environment variable to the correct\nname of the term that supports colors.\n\nYou can use the colortest.vim script supplied with the Vim runtime\npackage to test the color setup. To use this script, follow these steps: >\n\n    :e $VIMRUNTIME/syntax/colortest.vim\n    :source %\n<\nFor more information, read:\n\n    |06.2|\n    |terminal-colors|\n    |termcap-colors|\n    |startup-terminal|\n    |xterm-color|\n    |colortest.vim|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-33*\nSECTION 33 - VIM ON MS-WINDOWS ~\n\n \t\t\t\t\t\t\t\t*faq-33.1*\n33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode. What\n      happened?\n\nThe mswin.vim script provides key mappings and options to make Vim behave\nlike a MS-Windows application. One of the keys mapped is CTRL-V which is\nused for pasting text in MS-Windows applications. This will disable the use\nof CTRL-V to start the blockwise visual mode. The mswin.vim script maps\nCTRL-Q for staring the blockwise visual mode. So you can use CTRL-Q instead\nof CTRL-V.\n\nFor more information, read:\n\n    |CTRL-V|\n    |CTRL-V-alternative|\n    |CTRL-Q|\n    |10.5|\n\n \t\t\t\t\t\t\t\t*faq-33.2*\n33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do I\n      configure Vim to treat CTRL-Y as CTRL-Y?\n\nThe mapping of the CTRL-Y key to the CTRL-R key is done by the mswin.vim\nscript. The mswin.vim script maps CTRL-Y to make Vim behave like a standard\nMS-Windows application. This is explained in `:help CTRL-Y`. You can either\ncomment out the line in mswin.vim that maps the CTRL-Y key or you can\nremove the line in your .vimrc file that sources the mswin.vim script.\n\n \t\t\t\t\t\t\t\t*faq-33.3*\n33.3. How do I start GUI Vim in a maximized window always?\n\nYou can use the `:simalt` command to maximize the Vim window. You can use\nthe GUIEnter autocmd to maximize the Vim window on startup: >\n\n    autocmd GUIEnter * simalt ~x\n<\nFor more information, read:\n\n    |:simalt|\n    |GUIEnter|\n    |gui-win32-maximized|\n\n \t\t\t\t\t\t\t\t*faq-33.4*\n33.4. After doing some editing operations, Vim freezes. The cursor becomes\n      an empty rectangle. I am not able enter any characters. What is\n      happening?\n\nMost probably, you used the mouse wheel to scroll the text in Vim. There is\na known problem in using intellimouse mouse wheel with Vim. To avoid this\nproblem, disable Universal scrolling support for Vim.\n\nFor more information, read:\n\n    |intellimouse-wheel-problems|\n\n \t\t\t\t\t\t\t\t*faq-33.5*\n33.5. I am using Windows XP, the display speed of maximized GVim is very\n      slow. What can I do to speed the display updates?\n\nThis may be due to the fact that you have enabled 'Smooth edges of screen\nfonts' in the display properties. Try turning off font smoothing or try\nchanging the smoothing method to \"Standard\".\n\n \t\t\t\t\t\t\t\t*faq-33.6*\n33.6. What are the recommended settings for using Vim with cygwin?\n\nYou may want to set the following shell related Vim settings: >\n\n    :set shellcmdflag=-c\n    :set shellquote=\n    :set shellslash          \" Use the forward slash for expansion.\n    :set shellxquote=\\\"\n    :set shell=d:\\cygwin\\bin\\bash.exe \" Use the bash shell\n    :set shellpipe=2>&1| tee\n    :set shellredir=>%s 2>&1\n<\n \t\t\t\t\t\t\t\t*faq-33.7*\n33.7. I am trying to use GNU diff with Vim diff mode. When I run the diff\n      from command line, it works. When I try to use the diff with Vim it\n      doesn't work. What should I do now?\n\nThere is a problem with using GNU diff with Vim. You can try using the\nGNU diff.exe built by Ron Aaron from the following link:\n\n    http://www.mossbayeng.com/~ron/vim/builds.html\n(This page no longer exists.)\n\n \t\t\t\t\t\t\t\t*faq-33.8*\n33.8. Is it possible to use Vim as an external editor for MS-Windows\n      Outlook email client?\n\nYou can use the \"cubiclevim\" COM Add-In to use Vim as an external editor\nfor MS-Windows Outlook email client. Visit the following URL for more\ninformation:\n\n    https://sourceforge.net/projects/cubiclevim/\n\nNote, that currently this works only with MS-Office 2000 and XP.\n\nAlso the plugin OutlookVim might be worth a look:\n\n    https://www.vim.org/scripts/script.php?script_id=3087\n\n \t\t\t\t\t\t\t\t*faq-33.9*\n33.9. I am using Vim to edit HTML files. How do I start internet explorer\n      with the current file to preview the HTML file?\n\nYou can use the following command: >\n\n    :!start c:\\progra~1\\intern~1\\iexplore.exe file://%:p<CR>\n<\n \t\t\t\t\t\t\t\t*faq-33.10*\n33.10. I would like to use Vim with Microsoft Visual Studio. How do I do\n       this?\n\nYou have to download and use the OLE version of Vim (for example:\ngvim61ole.zip). This file also contains instructions on how to use Vim with\nVisual Studio.\n\nFor more information, read:\n\n    |MSVisualStudio|\n\n \t\t\t\t\t\t\t\t*faq-33.11*\n33.11. Where do I place the _vimrc and _gvimrc files?\n\nYou can place the _vimrc and _gvimrc files under the directory pointed to\nby the VIM environment variable. If you are sharing this system with other\nusers, then you can place the files in a directory and set the HOME\nenvironment variable to this directory.\n\nFor more information, read:\n\n    |$HOME-use|\n    |_vimrc|\n\n \t\t\t\t\t\t\t\t*faq-33.12*\n33.12. Every time I save a file, Vim warns about the file being changed\n       outside of Vim. Why?\n\nIf you get the following warning message, every time you save a file: >\n\n    WARNING: The file has been changed since reading it!!!\n    Do you really want to write to it (y/n)?\n<\nthen this problem could be related to a bug in MS-Windows on the day\ndaylight saving time starts.  Vim remembers the timestamp of the file after\nit was written.  Just before the next write the timestamp is obtained again\nto check if the file was changed outside of Vim.  This works correctly,\nexcept on the day daylight saving time starts.\n\nThis problem will go away the next day after the day the daylight saving\ntime starts.\n\nFor more information, read:\n\n    |W11|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-34*\nSECTION 34 - PRINTING ~\n\n \t\t\t\t\t\t\t\t*faq-34.1*\n34.1. How do I print a file along with line numbers for all the lines?\n\nYou can set the 'printoptions' option and use the `:hardcopy` command to\nprint your file: >\n\n    :set printoptions=number:y\n    :hardcopy\n<\nFor more information, read:\n\n    |'printoptions'|\n    |:hardcopy|\n\n \t\t\t\t\t\t\t\t*faq-34.2*\n34.2. How do I print a file with the Vim syntax highlighting colors?\n\nYou can use the `:hardcopy` command to print a file with the Vim syntax\nhighlighting colors. You can also convert your file to a HTML file using\nthe 2html.vim script and print the HTML file.\n\nFor more information, read:\n\n    |syntax-printing|\n    |2html.vim|\n    |:hardcopy|\n    |printing|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-35*\nSECTION 35 - BUILDING VIM FROM SOURCE ~\n\n \t\t\t\t\t\t\t\t*faq-35.1*\n35.1. How do I build Vim from the sources on a Unix system?\n\nFor a Unix system, follow these steps to build Vim from the sources:\n\n- Download the source from the git repository:\n  https://github.com/vim/vim/releases/\n- Alternatively, download the source from the mercurial repository:\n  https://bitbucket.org/vim-mirror/vim/downloads/\n- Run the \"make\" command to configure and build Vim with the default\n  configuration.\n- Run \"make install\" command to install Vim in the default directory.\n\nTo enable/disable various Vim features, before running the \"make\" command\nyou can run the \"configure\" command with different flags to include/exclude\nthe various Vim features. To list all the available options for the\n\"configure\" command, use: >\n\n    $ configure --help\n<\nFor more information, read:\n\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.2*\n35.2. How do I install Vim in my home directory or a directory other\n      than the default installation directory in Unix?\n\nTo install Vim in a directory other than the default installation\ndirectory, you have to specify the directory using the --prefix option\nwhile running the configure script. >\n\n    $ ./configure --prefix=/users/xyz\n<\nYou can enable/disable various Vim feature by supplying different arguments\nto the configure script. For more information about all these options, run: >\n\n    $ ./configure --help\n<\nFor more information, read:\n\n    |install-home|\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.3*\n35.3. How do I build Vim from the sources on a MS-Windows system?\n\nFor a MS-Windows system, Vim can be built using either the Visual C++\ncompiler or the Borland C++ compiler or the Ming GCC compiler or the cygwin\ngcc compiler. Follow these steps to build Vim from the sources for\nMS-Windows:\n    - download the source from the git repository:\n      https://github.com/vim/vim/releases/\n    - Depending on the installed compiler, you can use the corresponding\n      makefile to build the Vim sources. For Visual C++ use the\n      Make_mvc.mak makefile, for borland C++ use the Make_bc5.mak makefile,\n      for ming GCC use the Make_ming.mak makefile, for cygwin gcc use the\n      Make_cyg.mak makefile.\n\nDepending on whether you want to build the GUI version of Vim or the\nconsole version of Vim, you have to pass different arguments to the\nmakefiles. After successfully building the sources, you can copy the\nvim.exe or gvim.exe file to the desired directory along with the files from\nthe runtime archive.\n\nFor more information, read:\n\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.4*\n35.4. The Vim help, syntax, indent files are missing from my Vim\n      installation. How do I install these files?\n\nThe Vim help, syntax, indent and other runtime files are part of the Vim\nruntime package. You need to download and install the Vim runtime package.\nFor example, for MS-Windows, the name of the Vim 6.1 runtime package is\nvim61rt.zip.\n\nFor more information, read:\n\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.5*\n35.5. I have built Vim from the source and installed the Vim package using\n      \"make install\". Do I need to keep the Vim source directory?\n\nNo. Once you have built and installed Vim in some directory other than the\noriginal source directory (for example, /usr/bin or /usr/local/bin), then\nyou can remove the source directory.\n\n \t\t\t\t\t\t\t\t*faq-35.6*\n35.6. How do I determine the Vim features which are enabled at compile\n      time?\n\nYou can use the `:version` command to determine the Vim features that are\nenabled at compile time. The features that are enabled will be prefixed\nwith a \"+\". The features that are not enabled will be prefixed with a \"-\".\n\nIf you want to test for a feature in a script, you can use the has()\nfunction: >\n\n    if has(\"menu\")\n        \" Set up some menus\n    endif\n<\nFor more information, read:\n\n    |:version|\n    |+feature-list|\n    |has()|\n\n \t\t\t\t\t\t\t\t*faq-35.7*\n35.7. Can I build Vim without the GUI support?\n\nYes. You can build Vim by optionally enabling/disabling many of the\nfeatures including GUI.\n\nFor more information, read:\n\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.8*\n35.8. When building Vim on a Unix system, I am getting \"undefined reference\n      to term_set_winsize\" error. How do I resolve this error?\n\nYou will get this error when the build process is not able to locate the\ntermlib, termcap or ncurses library. You have to install the ncurses-dev\npackage to resolve this error.\n\n \t\t\t\t\t\t\t\t*faq-35.9*\n35.9. Vim configure keeps complaining about the lack of gtk-config while\n      trying to use GTK 2.03. This is correct, since in GTK 2 they moved to\n      using the generic pkg-config. I can get pkg-config to list the\n      various includes and libs for gtk, but for some reason the configure\n      script still isn't picking this up.\n\nUse the following shell script named gtk-config: >\n\n    #!/bin/sh\n    pkg-config gtk+-2.0 $1 $2\n<\n \t\t\t\t\t\t\t\t*faq-35.10*\n35.10. I did successfully download the sources and compiled Vim on\n        Unix. But feature ... still does not work. What is wrong and\n        how can I fix it?\n\nYou should first check, that you are actually running your self compiled\nVim and not the system's provided version. So first check your $PATH\nsetting.\n\nDepending on your compile options, some features might not be included in\nyour build of Vim. You can use the `:version` command to determine the Vim\nfeatures that are enabled at compile time. The features that are enabled\nwill be prefixed with a \"+\". The features that are not enabled will be\nprefixed with a \"-\".\n\nThe easiest way to include all features is to build the huge version. To do\nthis, you have to specify the --with-features option while running the\nconfigure script: >\n\n    $ ./configure --with-features=huge\n<\nNevertheless, a feature could still be disabled at compile time, if the\nconfigure script can't find the required libraries for those features (e.g.\nfor clipboard integration, your Vim needs to be linked against the X11\ndevelopment libraries).\n\nThere are several ways to install the required libraries:\n\n1) On a Debian based distribution, you can use the package manager \"apt\"\n   to install all required dependencies. As superuser, run the command:\n\n   $ apt-get build-dep vim-gtk\n\n   This makes sure all required libraries needed to compile the vim-gtk\n   package will be installed. (This requires, that your sources list\n   contains deb-src entries. See your distribution manual on how to\n   enable this, if the above command did not work.)\n\n2) In openSUSE you can use the package manager \"zypper\" to install all\n   required libraries. This requires, that there is a source version of\n   the package installable from a configured repository (which by\n   default is not the case). Use:\n\n   $ zypper search -t srcpackage vim\n\n   to find out, whether or not there exists a source version in the\n   repository. If there is none, you'll need to add a source repository.\n   For openSUSE 11.2 you could use, e.g.\n\n   $ zypper ar\n   http://download.opensuse.org/source/distribution/11.2/repo/oss/src-11.2\n\n   (one line)\n\n   Once you have a source version available in your repositories, use\n   this command to install all needed requirements:\n\n   $ zypper source-install --build-deps-only vim\n\n3) On a Fedora/RedHat based system, you can use\n\n   $ yum-builddep vim-enhanced\n\n4) Run configure with your options and watch for missing libraries:\n\n   $ ./configure --with-features=huge 2>&1 |tee logfile\n\n   This will run configure and record the output into the file \"logfile\".\n   You need to check the logfile for missing dependencies. Consider this\n   output: >\n\n    checking --disable-gtktest argument... gtk test enabled\n    checking for pkg-config... /usr/bin/pkg-config\n    checking for GTK - version >= 2.2.0... no\n<\n    Here you can see, that the gtk libraries are missing and therefore\n    no GTK gui version can't be build. So you need to install the GTK\n    library in your system, with your package manager or by compiling it\n    yourself. Then run the configure script again and check, that it\n    finds the library.\n\nIn theory, those provided dependencies by your distribution might still\nlack some libraries, that are needed for features, that simply are not\nenabled in your distribution and therefore those commands in 1-3 won't\ninstall it. At the very least, this provides a jumping point and you need\nto track down the required missing packages using method 4 from above. But\nusually, this works good enough for most people and you won't have to\nbother with the fourth method.\n\nFor more information, read:\n\n    |:version|\n    |+feature-list|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-36*\nSECTION 36 - VARIOUS ~\n\n \t\t\t\t\t\t\t\t*faq-36.1*\n36.1. How do I edit binary files with Vim?\n\nYou can set the following options to edit binary files in Vim: >\n\n    :set binary\n    :set display=uhex\n<\nYou can also use the \"-b\" command-line option to edit a binary file: >\n\n    $ vim -b <binary_file_name>\n<\nYou can also use the xxd utility (part of the Vim distribution) to edit\nbinary files.\n\nFor more information, read:\n\n    |23.4|\n    |edit-binary|\n    |hex-editing|\n    |-b|\n    |'binary'|\n    |'endofline'|\n    |'display'|\n\n \t\t\t\t\t\t\t\t*faq-36.2*\n36.2. How do I disable the visual error flash and the error beep?\n\nYou can disable both the visual error flash and the error beep using the\nfollowing command: >\n\n    :set visualbell t_vb=\n<\nFor more information, read:\n\n    |'visualbell'|\n    |'errorbells'|\n    |t_vb|\n\n \t\t\t\t\t\t\t\t*faq-36.3*\n36.3. How do I display the ascii value of a character displayed in a\n      buffer?\n\nYou can use the \"ga\" command to display the ascii value of a displayed\ncharacter.\n\nFor more information, read:\n\n    |ga|\n    |:ascii|\n\n \t\t\t\t\t\t\t\t*faq-36.4*\n36.4. Can I use zero as a count for a Vim command?\n\nYou cannot use zero as a count for a Vim command, as \"0\" is a command on\nits own, moving to the first column of the line.\n\nFor more information, read:\n\n    |0|\n    |count|\n\n \t\t\t\t\t\t\t\t*faq-36.5*\n36.5. How do I disable the Vim welcome screen?\n\nYou can disable the Vim welcome screen, by adding the \"I\" flag to the\n'shortmess' option: >\n\n    :set shortmess+=I\n<\nFor more information, read:\n\n    |:intro|\n    |'shortmess'|\n\n \t\t\t\t\t\t\t\t*faq-36.6*\n36.6. How do I avoid the \"hit enter to continue\" prompt?\n\nVim will prompt you with the \"hit enter to continue\" prompt, if there are\nsome messages on the screen for you to read and the screen is about to be\nredrawn.  You can add the \"T\" flag to the 'shortmess' option to truncate\nall messages. This will help in avoiding the hit-enter prompt: >\n\n    :set shortmess+=T\n<\nYou can also increase the command height by setting the 'cmdheight' option: >\n\n    :set cmdheight=2\n<\nFor more information, read:\n\n    |hit-enter|\n    |avoid-hit-enter|\n    |'shortmess'|\n    |'cmdheight'|\n\n \t\t\t\t\t\t\t\t*faq-36.7*\n36.7. How do I invoke Vim from command line to run a group of commands on a\n      group of files?\n\nThere are several ways to invoke Vim from command line to run a group of\ncommands on a group of files. You can use a set of  \"-c\" command line\noptions to specify a group of commands: >\n\n    $ vim -c \"<ex_command_1>\" -c \"<ex_command_2>\" *.txt\n<\nEach of the ex-command specified with the \"-c\" command line option is\nexecuted one by one sequentially. You can also use a single \"-c\" command\nline option and the \"|\" character to separate the ex commands: >\n\n    $ vim -c \"<ex_command_1> | <ex_command_2>\" *.txt\n<\nIn the above command, if an ex command fails, then all the remaining ex\ncommands will not be executed.\n\nFor example, to replace \"ABC\" with \"DEF\" in a file from the command-line,\nyou can use the following command: >\n\n    $ vim -c \"%s/ABC/DEF/ge | update\" myfile.txt\n<\nTo replace \"ABC\" with \"DEF\" in multiple files from the command-line,\nyou can use the following command: >\n\n    $ vim -c \"argdo %s/ABC/DEF/ge | update\" *.txt\n<\nYou can store the group of commands into a file and use the \"-s\" command\nline option to run the commands on a set of files. For example, if the\ngroup of commands are stored in the file mycmds.txt, then you can use the\nfollowing command: >\n\n    $ vim -s mycmds.txt *.pl\n<\nFor more information, read:\n\n    |-c|\n    |-s|\n\n \t\t\t\t\t\t\t\t*faq-36.8*\n36.8. How do I use a normal mode command from insert mode without leaving\n      the insert mode?\n\nYou can use a normal command from insert mode, without leaving the insert\nmode, by first pressing the CTRL-O key and then follow that with a single\nnormal mode command.\n\nTo execute more than one normal mode command, press the CTRL-L key,\nfollowed by any number of normal mode commands and then press <Esc> to get\nback to the insert mode. (This only works, when the 'insertmode' option\nis set).\n\nFor more information, read:\n\n    |i_CTRL-O|\n    |i_CTRL-L|\n\n \t\t\t\t\t\t\t\t*faq-36.9*\n36.9. How do I start Vim in insert mode?\n\nYou can start Vim in insert mode using the `:startinsert` ex command. >\n\n    $ vim +startinsert myfile.txt\n<\nThe above command will open the file \"myfile.txt\" and start insert mode\nwith the cursor in front of the first character on the first line.  To open\nthe file and start appending after the last character on the last line,\nyou can use the following command: >\n\n    $ vim + +startinsert! myfile.txt\n<\nFor more information, read:\n\n    |:startinsert|\n\n \t\t\t\t\t\t\t\t*faq-36.10*\n36.10. How do I use Copy and Paste with Vim?\n\nYou should first check the output of the `:version` command and make\nsure that +xterm-clipboard is present.\n\nWhen running Vim in an xterm, you can either let Vim control the mouse\nor let xterm control the mouse. This is configured by the 'mouse' option.\n\nIf the 'mouse' option is not set (or set to the default value), then Vim will\nnot control the mouse. You cannot move the Vim text cursor using the\nmouse. When you select some text using the mouse, xterm will copy\nit to the X11 cut buffer. When you press both the mouse buttons,\nxterm will paste the text from the cut buffer.\n\nIf the 'mouse' option is set to \"a\" or some other value, then Vim controls\nthe mouse. The mode (normal or insert or visual, etc) in which Vim\ncontrols the mouse is configured by the 'mouse' option. You can move\nthe Vim text cursor using the mouse. When you select some text,\nthe 'clipboard' option setting is used to determine whether to transfer\nthe selected text to the clipboard or not. The default setting is to\ntransfer the selected text to the clipboard. If you want to use the\nxterm selection mechanism in this mode, then you can press the\n<Shift> key. If you press <Shift> key when selecting text using the\nmouse, then Vim doesn't control the mouse and xterm controls the\nmouse.\n\nIn the GUI mode, Copy and Paste should just work, depending on the 'mouse'\nsetting. For more information, read:\n\n    |'clipboard'|\n    |x11-selection|\n    |clipboard|\n    |'go-a'|\n    |'mouse'|\n    |xterm-copy-paste|\n    |09.3|\n\n \t\t\t\t\t\t\t\t*faq-36.11*\n36.11. Why shouldn't I modify the files in the system runtime directory?\n\nJust be careful about modifying files under $VIMRUNTIME, which usually\nis /usr/share/vim/vimXX (Unix) or C:\\Program Files\\vim\\vimXX\n(Windows) and XX being the version for which it applies, e.g. 73 for Vim\n7.3.\n\nOne should generally avoid modifying those files because they may be\nreplaced during an upgrade of your Vim installation and your changes\nwill be lost.  Also, if you upgrade to a new major or minor revision of\nVim (e.g., from 7.3 to 7.4), the new version of Vim will use a different\n$VIMRUNTIME directory and while your changes won't be lost, they will be\nignored.\n\nConsequently, take a look at\n\n    |filetypes|\n\nfor an explanation of several ways to modify Vim's response to\ndifferent filetypes and where to put those modifications so that\nthey will not be overwritten.\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-37*\nSECTION 37 - UNICODE ~\nAuthor: Tony Mechelynck <antoine.mechelynck AT belgacom.net>\n\n \t\t\t\t\t\t\t\t*faq-37.1*\n37.1. Is it possible to create Unicode files using Vim?\n\nYes. It may be more or less complicated depending on the keyboard and fonts\navailable to you, but it is always possible to encode any possible Unicode\ncodepoint (and some illegal ones) into a file. To create a Unicode file\nusing Vim, you should have compiled Vim with the \"+multi_byte\" compile-time\noption.  You can get more information about Unicode from the following\nsites:\n\n    http://www.unicode.org\n    https://www.cl.cam.ac.uk/~mgk25/unicode.html\n\nFor more information, read:\n\n    |multibyte|\n    |usr_45.txt|\n\n \t\t\t\t\t\t\t\t*faq-37.2*\n37.2. Which Vim settings are particularly important for editing Unicode\n      files?\n\nThe most important are the various \"encoding\" options, i.e., 'encoding',\n'fileencoding', 'fileencodings' and 'termencoding'. The boolean option\n'bomb' is also significant.\n\nFor more information, read:\n\n    |'encoding'|\n    |'fileencoding'|\n    |'fileencodings'|\n    |'termencoding'|\n    |'bomb'|\n\n \t\t\t\t\t\t\t\t*faq-37.3*\n37.3. What is the 'encoding' option?\n\nBasically, the 'encoding' option defines how Vim will represent your data\ninternally.  However, all Unicode encodings are represented internally as\nutf-8 and converted (if necessary) when reading and writing.\n\nFor more information, read:\n\n    |'encoding'|\n\n \t\t\t\t\t\t\t\t*faq-37.4*\n37.4. How does Vim name the various Unicode encodings?\n\nUtf-8 is called utf-8 or utf8; utf-16 is called ucs-2 or ucs2; utf-32 is\ncalled ucs-4 or ucs4. Also, you may specify endianness (except for utf-8\nwhich does not vary for endianness) by appending le for little-endian or be\nfor big-endian. If you create a file with an encoding of ucs-2 or ucs-4\nwithout specifying endianness, Vim will use what is typical of your\nmachine.\n\nFor more information, read:\n\n    |encoding-names|\n    |encoding-values|\n    |encoding-table|\n\n \t\t\t\t\t\t\t\t*faq-37.5*\n37.5. How does Vim specify the presence or absence of a byte-order mark?\n\nWhen reading a file, if the 'fileencodings' option includes \"ucs-bom\", Vim\nwill check for a byte-order mark. When writing a file, if the 'bomb' option\nis set, Vim will write a byte-order mark on files whose encoding warrants\nit.\n\nFor more information, read:\n\n    |'fileencodings'|\n    |'bomb'|\n\n \t\t\t\t\t\t\t\t*faq-37.6*\n37.6. What is the 'fileencoding' option?\n\nThe 'fileencoding' option defines the particular encoding which Vim will\nuse to write a file. If empty, then the value of the 'encoding' option is\nthe default.\n\nFor more information, read:\n\n    |'fileencoding'|\n\n \t\t\t\t\t\t\t\t*faq-37.7*\n37.7. What is the 'fileencodings' option?\n\nThe 'fileencodings' option defines the heuristics used by Vim when opening\nan existing file. It is a comma separated list of encodings. A special\nname, \"ucs-bom\" is used to indicate that Vim should check for the presence\nof a byte-order mark; however, it will not be recognised if it comes after\n\"utf-8\".  Normally, \"ucs-bom\" (if present) should be first in the list.\n\nWhen Vim opens a file, it checks it against the encodings listed in\n'fileencodings'. The first one that matches is used. If there is no match,\nthen Vim sets 'fileencoding' to the null string, i.e., the value of\n'encoding' will be used.\n\nFor more information, read:\n\n    |'fileencodings'|\n    |'encoding'|\n\n \t\t\t\t\t\t\t\t*faq-37.8*\n37.8. What is the 'termencoding' option?\n\nThe 'termencoding' option defines how your keyboard encodes the data you\ntype.  If empty, Vim assumes that it has the same value as 'encoding'.\nUsually it should be set to something that matches your locale.\n\nFor more information, read:\n\n    |'termencoding'|\n    |locale|\n\n \t\t\t\t\t\t\t\t*faq-37.9*\n37.9. What is the 'bomb' option?\n\nWhen reading a file with \"ucs-bom\" present in the 'fileencodings' option,\nVim will set the 'bomb' option on or off depending on the presence or\nabsence of a byte-order mark at the start of the file. When writing, Vim\nwill write a byte-order mark if the 'bomb' option is set. You may set or\nunset it manually do make Vim write, or not write, the b.o.m.\n\nFor more information, read:\n\n    |'bomb'|\n\n \t\t\t\t\t\t\t\t*faq-37.10*\n37.10. Where can I find an example of a typical use of all these options?\n\nThere is a \"tip\", with explains them in different words with an example, at\n\n    http://vim.wikia.com/wiki/VimTip246\n\n \t\t\t\t\t\t\t\t*faq-37.11*\n37.11. How can I insert Unicode characters into a file using Vim?\n\nSeveral methods are available:\n\n- Characters present on your keyboard can be typed in the usual way, even\n  those which require a \"dead-key\" prefix, like (for instance) the\n  circumflex on French keyboards.\n- Characters for which a digraph is defined can be typed as two characters\n  prefixed by CTRL-K.\n- If you have set the 'digraph' option, you can enter the characters for\n  which a digraph is defined as <char1><BS><char2>.\n- Any character can be entered by using a CTRL-V prefix (or CTRL-Q if\n  CTRL-V is remapped to paste from the clipboard).\n\nFor more information, read:\n\n    |digraphs|\n    |'digraph'|\n    |i_CTRL-V_digit|\n\n \t\t\t\t\t\t\t\t*faq-37.12*\n37.12. How can I know which digraphs are defined and for which characters?\n\nFirst set the 'encoding' option properly (for instance, to utf-8), then use\nthe `:digraphs` command to list the currently defined digraphs.\n\nAlternatively, the help file contains the complete set of all digraphs.\nSo you can easily search that list there.\n\nFor more information, read:\n\n    |:digraphs|\n    |'encoding'|\n    |digraph-table|\n\n\n vim:tw=78:ts=8:ft=help:norl:\n"
  },
  {
    "path": "doc/vim_faq.txt",
    "content": "*vim_faq.txt*\tFrequently Asked Questions\n\nLast updated on: 11 October 2025\n\n\t  VIM FAQ by: Christian Brabandt <cb@256bit.org>\n\nFrequently Asked Questions                                 *vim-faq* *Vim-FAQ*\n\nThis Vim FAQ is created from the questions and answers posted to the\nvim@vim.org user mailing list and the comp.editors newsgroup. There are\nseveral ways to solve a problem in Vim. This FAQ gives one of those several\npossibilities. You can explore the other ways using the information and\nlinks given in this FAQ. The credit for the answers in this FAQ goes to\nPeppe, Benji, Charles Campbell and numerous others. An online version of\nthis FAQ is available at https://vimhelp.org/vim_faq.txt.html\n\t\t\t\t\t\t\t\t*faq-index*\nINDEX ~\n                                                *faq-general-information*\nSECTION 1 - GENERAL INFORMATION ~\n|faq-1.1|   What is Vim?\n|faq-1.2|   Who wrote Vim?\n|faq-1.3|   Is Vim compatible with Vi?\n|faq-1.4|   What are some of the improvements of Vim over Vi?\n|faq-1.5|   Is Vim free?\n                                                        *faq-resources*\nSECTION 2 - RESOURCES ~\n|faq-2.1|   Where can I learn more about Vim?\n|faq-2.2|   Is there a mailing list available?\n|faq-2.3|   Is there an archive available for the Vim mailing lists?\n|faq-2.4|   Where can I get the Vim user manual in HTML/PDF/PS format?\n|faq-2.5|   I have a \"xyz\" (some) problem with Vim. How do I determine if it is\n\t  a problem with my setup or with Vim?\n|faq-2.6|   Where can I report bugs?\n|faq-2.7|   Where can the FAQ be found?\n|faq-2.8|   What if I don't find an answer in this FAQ?\n|faq-2.9|   I have a patch for implementing a Vim feature. Where do I send the\n\t  patch?\n|faq-2.10|  I have a Vim tip or developed a new Vim\n\t  syntax/indent/filetype/compiler plugin or developed a new script\n\t  or a colorscheme. Is there a public website where I can upload\n\t  this?\n                                                        *faq-availability*\nSECTION 3 - AVAILABILITY ~\n|faq-3.1|   What is the latest version of Vim?\n|faq-3.2|   Where can I find the latest version of Vim?\n|faq-3.3|   What platforms does it run on?\n|faq-3.4|   Where can I download the latest version of the Vim runtime files?\n                                                                *faq-help*\nSECTION 4 - HELP ~\n|faq-4.1|   How do I use the help files?\n|faq-4.2|   How do I search for a keyword in the Vim help files?\n|faq-4.3|   I am getting an error message E123, what did I do wrong?\n|faq-4.4|   Where can I read about the various modes in Vim?\n|faq-4.5|   How do I generate the Vim help tags file after adding a new Vim\n\t  help file?\n|faq-4.6|   Can I use compressed versions of the help files?\n                                                        *faq-editing-a-file*\nSECTION 5 - EDITING A FILE ~\n|faq-5.1|   How do I load a file in Vim for editing?\n|faq-5.2|   How do I save the current file in another name (save as) and edit\n\t  a new file?\n|faq-5.3|   How do I change the current directory to the directory of the\n\t  current file?\n|faq-5.4|   How do I write a file without the line feed (EOL) at the end of\n\t  the file?\n|faq-5.5|   How do I configure Vim to open a file at the last edited location?\n|faq-5.6|   When editing a file in Vim, which is being changed by an external\n\t  application, Vim opens a warning window (like the confirm dialog)\n\t  each time a change is detected. How do I disable this warning?\n|faq-5.7|   How do I edit a file whose name is under the cursor?\n|faq-5.8|   How do I reload/re-edit the current file?\n|faq-5.9|   How do I autosave a file periodically?\n|faq-5.10|  How do I open a file in read-only mode?\n|faq-5.11|  How do I open a file for editing without saving the modifications\n\t  to the current file?\n|faq-5.12|  How do I reduce the loading time for very large files in Vim?\n                                                *faq-editing-multiple-files*\nSECTION 6 - EDITING MULTIPLE FILES ~\n|faq-6.1|   How do I open multiple files at once from within Vim?\n|faq-6.2|   How do I switch between multiple files/buffers in Vim?\n|faq-6.3|   How do I open several files in Vim, with each file in a separate\n\t  window/tabpage?\n|faq-6.4|   How do I configure Vim to autoload several files at once similar\n\t  to \"work-sets\" or \"projects\"?\n|faq-6.5|   Is it possible to open multiple top level windows in a single\n\t  instance of Vim similar to Nedit or emacs?\n|faq-6.6|   How do I browse/explore directories from within Vim?\n|faq-6.7|   How do I edit files over a network using ftp/scp/rcp/http?\n                                                                *faq-backup*\nSECTION 7 - BACKUP ~\n|faq-7.1|   When I edit and save files, Vim creates a file with the same name\n\t  as the original file and a \"~\" character at the end. How do I stop\n\t  Vim from creating this file (or) How do I disable the Vim backup\n\t  file feature?\n|faq-7.2|   When I edit and save files, Vim creates a file with the same name\n\t  as the original file and a \".un~\" extension at the end. How do I\n\t  stop Vim from creating this file (or) How do I disable the Vim\n\t  undofile feature.\n|faq-7.3|   How do I configure Vim to store all the backup files in a\n\t  particular directory?\n|faq-7.4|   When I save a file with Vim, the file permissions are changed.\n\t  How do I configure Vim to save a file without changing the file\n\t  permissions?\n                                                                *faq-buffers*\nSECTION 8 - BUFFERS ~\n|faq-8.1|   I have made some modifications to a buffer. How do I edit another\n\t  buffer without saving the modified buffer and also without losing\n\t  the modifications?\n|faq-8.2|   How do I configure Vim to auto-save a modified buffer when\n\t  switching to another buffer?\n|faq-8.3|   How do I replace the buffer in the current window with a blank\n\t  buffer?\n|faq-8.4|   Is there a keyboard shortcut to load a buffer by the buffer\n\t  number?\n|faq-8.5|   How do I open all the current buffers in separate windows?\n|faq-8.6|   How do I close (delete) a buffer without exiting Vim?\n|faq-8.7|   When I use the command `:%bd` to delete all the buffers, not all\n\t  the buffers are deleted. Why?\n|faq-8.8|   How do I display the buffer number of the current buffer/file?\n|faq-8.9|   How do I delete a buffer without closing the window in which the\n\t  buffer is displayed?\n|faq-8.10|  How do I map the <Tab> key to cycle through and open all the\n\t  buffers?\n                                                                *faq-windows*\nSECTION 9 - WINDOWS ~\n|faq-9.1|   What is the difference between a Vim window and a buffer?\n|faq-9.2|   How do I increase the width of a Vim window?\n|faq-9.3|   How do I zoom into or out of a window?\n|faq-9.4|   How do I execute an ex command on all the open buffers or open\n\t  windows or all the files in the argument list?\n                                                                *faq-motion*\nSECTION 10 - MOTION ~\n|faq-10.1|  How do I jump to the beginning (first line) or end (last line) of\n\t  a file?\n|faq-10.2|  In insert mode, when I press the <Esc> key to go to command mode,\n\t  the cursor moves one character to the left (except when the\n\t  cursor is on the first character of the line). Is it possible to\n\t  change this behavior to keep the cursor at the same column?\n|faq-10.3|  How do I configure Vim to maintain the horizontal cursor position\n\t  when scrolling with the <Page Up>, <Page Down>, etc keys?\n|faq-10.4|  Some lines in a file are more than the screen width and they are\n\t  all wrapped. When I use the j, k keys to move from one line to\n\t  the next, the cursor is moved to the next line in the file\n\t  instead of the next line on the screen. How do I move from one\n\t  screen line to the next?\n|faq-10.5|  What is the definition of a sentence, paragraph and section in\n\t  Vim?\n|faq-10.6|  How do I jump to beginning or end of a sentence, paragraph or a\n\t  section?\n|faq-10.7|  I have lines in a file that extends beyond the right extent of the\n\t  screen. How do I move the Vim view to the right to see the text\n\t  off the screen?\n|faq-10.8|  How do I scroll two or more buffers simultaneously?\n|faq-10.9|  When I use my arrow keys, Vim changes modes, inserts weird\n\t  characters in my document but doesn't move the cursor properly.\n\t  What's going on?\n|faq-10.10| How do I configure Vim to move the cursor to the end of the\n\t  previous line, when the left arrow key is pressed and the cursor\n\t  is currently at the beginning of a line?\n|faq-10.11| How do I configure Vim to stay only in insert mode (modeless\n\t  editing)?\n|faq-10.12| How do I display some context lines when scrolling text?\n|faq-10.13| How do I go back to previous cursor locations?\n                                                        *faq-searching-text*\nSECTION 11 - SEARCHING TEXT ~\n|faq-11.1|  After I searched for a text with a pattern, all the matched text\n\t  stays highlighted. How do I turn off the highlighting\n\t  temporarily/permanently?\n|faq-11.2|  How do I enter a carriage return character in a search pattern?\n|faq-11.3|  How do I search for the character \"^M\"?\n|faq-11.4|  How can I search/replace characters that display as \"~R\", \"~S\",\n\t  etc.?\n|faq-11.5|  How do I highlight all the non-printable characters in a file?\n|faq-11.6|  How do I search for whole words in a file?\n|faq-11.7|  How do I search for the current word under the cursor?\n|faq-11.8|  How do I search for a word without regard to the case (uppercase\n\t  or lowercase)?\n|faq-11.9|  How do I search for words that occur twice consecutively?\n|faq-11.10| How do I count the number of times a particular word occurs in a\n\t  buffer?\n|faq-11.11| How do I place the cursor at the end of the matched word when\n\t  searching for a pattern?\n|faq-11.12| How do I search for an empty line?\n|faq-11.13| How do I search for a line containing only a single character?\n|faq-11.14| How do I search and replace a string in multiple files?\n|faq-11.15| I am using the `:s` substitute command in a mapping. When a\n\t  search for a pattern fails, the map terminates. I would like the\n\t  map to continue processing the next command, even if the\n\t  substitute command fails. How do I do this?\n|faq-11.16| How do I search for the n-th occurrence of a character in a\n\t  line?\n|faq-11.17| How do I replace a tab (or any other character) with a hard\n\t  return (newline) character?\n|faq-11.18| How do I search for a character by its ASCII value?\n|faq-11.19| How do I search for long lines?\n|faq-11.20| How do I display all the lines in the current buffer that\n\t  contain a specified pattern?\n|faq-11.21| How do I search for a text string that spans multiple lines?\n|faq-11.22| How do I search for a pattern only within a range of lines\n\t  in a buffer?\n|faq-11.23| How do I clear the last searched pattern?\n|faq-11.24| Why does this pattern \"a.\\{-}p\\@!\" not match?\n|faq-11.25| How can I use \"/\" within a pattern, without escaping it?\n|faq-11.26| How can I operate on a search match?\n                                                        *faq-changing-text*\nSECTION 12 - CHANGING TEXT ~\n|faq-12.1|  How do I delete all the trailing white space characters (SPACE\n\t  and TAB) at the end of all the lines in a file?\n|faq-12.2|  How do I replace all the occurrences of multiple consecutive\n\t  space characters to a single space?\n|faq-12.3|  How do I reduce a range of empty lines into one line only?\n|faq-12.4|  How do I delete all blank lines in a file? How do I remove all\n\t  the lines containing only space characters?\n|faq-12.5|  How do I copy/yank the current word?\n|faq-12.6|  How do I yank text from one position to another position within a\n\t  line, without yanking the entire line?\n|faq-12.7|  When I yank some text into a register, how do I append the text\n\t  to the current contents of the register?\n|faq-12.8|  How do I yank a complete sentence that spans over more than one\n\t  line?\n|faq-12.9|  How do I yank all the lines containing a pattern into a buffer?\n|faq-12.10| How do I delete all the lines in a file that do not contain a\n\t  pattern?\n|faq-12.11| How do I add a line before each line with \"pattern\" in it?\n|faq-12.12| Is there a way to operate on a line if the previous line\n\t  contains a particular pattern?\n|faq-12.13| How do I execute a command on all the lines containing a\n\t  pattern?\n|faq-12.14| Can I copy the character above the cursor to the current cursor\n\t  position?\n|faq-12.15| How do I insert a blank line above/below the current line\n\t  without entering insert mode?\n|faq-12.16| How do I insert the name of the current file into the current\n\t  buffer?\n|faq-12.17| How do I insert the contents of a Vim register into the current\n\t  buffer?\n|faq-12.18| How do I move the cursor past the end of line and insert some\n\t  characters at some columns after the end of the line?\n|faq-12.19| How to replace the word under the cursor (say: junk) with\n\t  \"foojunkbar\" in Vim?\n|faq-12.20| How do I replace a particular text in all the files in a\n\t  directory?\n|faq-12.21| I have some numbers in a file. How do I increment or decrement\n\t  the numbers in the file?\n|faq-12.22| How do I reuse the last used search pattern in a `:substitute`\n\t  command?\n|faq-12.23| How do I change the case of a string using the `:substitute`\n\t  command?\n|faq-12.24| How do I enter characters that are not present in the keyboard?\n|faq-12.25| Is there a command to remove any or all digraphs?\n|faq-12.26| In insert mode, when I press the backspace key, it erases only\n\t  the characters entered in this instance of insert mode. How do I\n\t  erase previously entered characters in insert mode using the\n\t  backspace key?\n|faq-12.27| I have a file which has lines longer than 72 characters\n\t  terminated with \"+\" and wrapped to the next line. How can I\n\t  quickly join the lines?\n|faq-12.28| How do I paste characterwise yanked text into separate lines?\n|faq-12.29| How do I change the case (uppercase, lowercase) of a word or\n\t  a character or a block of text?\n|faq-12.30| How do I enter ASCII characters that are not present in the\n\t  keyboard?\n|faq-12.31| How do I replace non-printable characters in a file?\n|faq-12.32| How do I remove duplicate lines from a buffer?\n|faq-12.33| How do I prefix all the lines in a file with the corresponding\n\t  line numbers?\n|faq-12.34| How do I exchange (swap) two characters or words or lines?\n|faq-12.35| How do I change the characters used as word delimiters?\n                                        *faq-completion-in-insert-mode*\nSECTION 13 - COMPLETION IN INSERT MODE ~\n|faq-13.1|  How do I complete words or lines in insert mode?\n|faq-13.2|  How do I complete file names in insert mode?\n|faq-13.3|  I am using CTRL-P/CTRL-N to complete words in insert mode. How do\n\t  I complete words that occur after the just completed word?\n                                                        *faq-text-formatting*\nSECTION 14 - TEXT FORMATTING ~\n|faq-14.1|  How do I format a text paragraph so that a new line is inserted\n\t  at the end of each wrapped line?\n|faq-14.2|  How do I format long lines in a file so that each line contains\n\t  less than \"n\" characters?\n|faq-14.3|  How do I join short lines to the form a paragraph?\n|faq-14.4|  How do I format bulleted and numbered lists?\n|faq-14.5|  How do I indent lines in insert mode?\n|faq-14.6|  How do I format/indent an entire file?\n|faq-14.7|  How do I increase or decrease the indentation of the current\n\t  line?\n|faq-14.8|  How do I indent a block/group of lines?\n|faq-14.9|  When I indent lines using the > or < key, the standard 8-tabstops\n\t  are used instead of the current 'tabstop' setting. Why?\n|faq-14.10| How do I turn off the automatic indentation of text?\n|faq-14.11| How do I configure Vim to automatically set the 'textwidth'\n\t  option to a particular value when I edit mails?\n|faq-14.12| Is there a way to make Vim auto-magically break lines?\n|faq-14.13| I am seeing a lot of ^M symbols in my file. I tried setting the\n\t  'fileformat' option to 'dos' and then 'unix' and then 'mac'.\n\t  None of these helped. How can I hide these symbols?\n|faq-14.14| When I paste some text into a Vim buffer from another\n\t  application, the alignment (indentation) of the new text is\n\t  messed up. How do I fix this?\n|faq-14.15| When there is a very long wrapped line (wrap is \"on\") and a line\n\t  doesn't fit entirely on the screen it is not displayed at all.\n\t  There are blank lines beginning with \"@\" symbol instead of\n\t  wrapped line. If I scroll the screen to fit the line the \"@\"\n\t  symbols disappear and the line is displayed again. What Vim\n\t  setting control this behavior?\n|faq-14.16| How do I convert all the tab characters in a file to space\n\t  characters?\n|faq-14.17| What Vim options can I use to edit text that will later go to a\n\t  word processor?\n|faq-14.18| How do I join lines without adding or removing any space\n\t  characters?\n                                                        *faq-visual-mode*\nSECTION 15 - VISUAL MODE ~\n|faq-15.1|  How do I do rectangular block copying?\n|faq-15.2|  How do I delete or change a column of text in a file?\n|faq-15.3|  How do I apply an ex-command on a set of visually selected lines?\n|faq-15.4|  How do I execute an ex command on a column of text selected in\n\t  Visual block mode?\n|faq-15.5|  How do I select the entire file in visual mode?\n|faq-15.6|  When I visually select a set of lines and press the > key to\n\t  indent the selected lines, the visual mode ends. How can I\n\t  reselect the region for further operation?  (or) How do I\n\t  re-select the last selected visual area again?\n|faq-15.7|  How do I jump to the beginning/end of a visually selected region?\n|faq-15.8|  When I select text with mouse and then press : to enter an ex\n\t  command, the selected text is replaced with the : character. How\n\t  do I execute an ex command on a text selected using the mouse\n\t  similar to the text selected using the visual mode?\n|faq-15.9|  When I select a block of text using the mouse, Vim goes into\n\t  selection mode instead of Visual mode. Why?\n                                                *faq-command-line-mode*\nSECTION 16 - COMMAND-LINE MODE ~\n|faq-16.1|  How do I use the name of the current file in the command mode or\n\t  an ex command line?\n|faq-16.2|  How do I edit the text in the Vim command-line effectively?\n|faq-16.3|  How do I switch from Vi mode to Ex mode?\n|faq-16.4|  How do I copy the output from an ex-command into a buffer?\n|faq-16.5|  When I press the <Tab> key to complete the name of a file in the\n\t  command mode, if there are more than one matching file names,\n\t  then Vim completes the first matching file name and displays a\n\t  list of all matching filenames. How do I configure Vim to only\n\t  display the list of all the matching filenames and not complete\n\t  the first one?\n|faq-16.6|  How do I copy text from a buffer to the command line and from the\n\t  command line to a buffer?\n|faq-16.7|  How do I put a command onto the command history without executing\n\t  it?\n|faq-16.8|  How do I increase the height of the command-line?\n                                                                *faq-viminfo*\nSECTION 17 - VIMINFO ~\n|faq-17.1|  When I invoke Vim, I get error messages about illegal characters\n\t  in the viminfo file. What should I do to get rid of these\n\t  messages?\n|faq-17.2|  How do I disable the viminfo feature?\n|faq-17.3|  How do I save and use Vim marks/commands across Vim sessions?\n                                                        *faq-remote-editing*\nSECTION 18 - REMOTE EDITING ~\n|faq-18.1|  How do I open a file with existing instance of gvim? What\n\t  happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n|faq-18.2|  How do I send a command to a Vim server to write all buffers to\n\t  disk?\n|faq-18.3|  Where can I get the documentation about the Vim remote server\n\t  functionality?\n                                                                *faq-options*\nSECTION 19 - OPTIONS ~\n|faq-19.1|  How do I configure Vim in a simple way?\n|faq-19.2|  How do I toggle the value of an option?\n|faq-19.3|  How do I set an option that affects only the current\n\t  buffer/window?\n|faq-19.4|  How do I use space characters for a Vim option value?\n|faq-19.5|  Can I add (embed) Vim option settings to the contents of a file?\n|faq-19.6|  How do I display the line numbers of all the lines in a file?\n|faq-19.7|  How do I change the width of the line numbers displayed using the\n\t  'number' option?\n|faq-19.8|  How do I display (view) all the invisible characters like space,\n\t  tabs and newlines in a file?\n|faq-19.9|  How do I configure Vim to always display the current line and\n\t  column number?\n|faq-19.10| How do I display the current Vim mode?\n|faq-19.11| How do I configure Vim to show pending/partial commands on the\n\t  status line?\n|faq-19.12| How do I configure the Vim status line to display different\n\t  settings/values?\n|faq-19.13| How do I configure Vim to display status line always?\n|faq-19.14| How do I make a Vim setting persistent across different Vim\n\t  invocations/instances/sessions?\n|faq-19.15| Why do I hear a beep (why does my window flash) about 1 second\n\t  after I hit the Escape key?\n|faq-19.16| How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n\t  deleting the characters I'm changing?\n|faq-19.17| How do I remove more than one flag using a single `:set` command\n\t  from a Vim option?\n                                                        *faq-mapping-keys*\nSECTION 20 - MAPPING KEYS ~\n|faq-20.1|  How do I know what a key is mapped to?\n|faq-20.2|  How do I list all the user-defined key mappings?\n|faq-20.3|  How do I unmap a key?\n|faq-20.4|  I am not able to create a mapping for the <xxx> key. What is\n\t  wrong?\n|faq-20.5|  Why does mapping the <C-...> key not work?\n|faq-20.6|  How do I map the numeric keypad keys?\n|faq-20.7|  How do I create a mapping that works only in visual mode?\n|faq-20.8|  How do I create a mapping that works only in normal and operator\n\t  pending mode (but not in visual mode)?\n|faq-20.9|  In a Vim script, how do I know which keys to use for my mappings,\n\t  so that the mapped key will not collide with an already used key?\n|faq-20.10| How do I map the escape key?\n|faq-20.11| How do I map a key to perform nothing?\n|faq-20.12| I want to use the <Tab> key to indent a block of text and\n\t  <Shift-Tab> key to unindent a block of text. How do I map the keys\n\t  to do this?  This behavior is similar to textpad, visual studio,\n\t  etc.\n|faq-20.13| In my mappings the special characters like <CR> are not\n\t  recognized. How can I configure Vim to recognize special\n\t  characters?\n|faq-20.14| How do I use the \"|\" to separate multiple commands in a map?\n|faq-20.15| If I have a mapping/abbreviation whose ending is the beginning of\n\t  another mapping/abbreviation, how do I keep the first from\n\t  expanding into the second one?\n|faq-20.16| Why does it take a second or more for Vim to process a key,\n\t  sometimes when I press a key?\n|faq-20.17| How do I map a key to run an external command using a visually\n\t  selected text?\n|faq-20.18| How do I map the CTRL-I key while still retaining the\n\t  functionality of the <Tab> key?\n|faq-20.19| How do I define a map to accept a count?\n|faq-20.20| How can I make my normal mode mapping work from within Insert\n\t  Mode?\n                                                        *faq-abbreviations*\nSECTION 21 - ABBREVIATIONS ~\n|faq-21.1|  How do I auto correct misspelled words?\n|faq-21.2|  How do I create multi-line abbreviations?\n|faq-21.3|  When my abbreviations are expanded, an additional space character\n\t  is added at the end of the expanded text. How do I avoid this\n\t  character?\n|faq-21.4|  How do I insert the current date/time stamp into the file?\n|faq-21.5|  How do I prevent an abbreviation from expanding in insert mode?\n                                                *faq-record-and-playback*\nSECTION 22 - RECORD AND PLAYBACK ~\n|faq-22.1|  How do I repeat an editing operation (insertion, deletion, paste,\n\t  etc)?\n|faq-22.2|  How I record and repeat a set of key sequences?\n|faq-22.3|  How do I edit/modify a recorded set of key sequences?\n|faq-22.4|  How do I write recorded key sequences to a file?\n|faq-22.5|  I am using register 0 to record my key sequences (i.e. q0 ....\n\t  q). In the recorded key sequences, I am yanking some text.  After\n\t  the first replay of the recorded key sequence, I am no longer\n\t  able to play it back.\n                                                        *faq-autocommands*\nSECTION 23 - AUTOCOMMANDS ~\n|faq-23.1|  How do I execute a command when I try to modify a read-only file?\n|faq-23.2|  How do I execute a command every time when entering a buffer?\n|faq-23.3|  How do I execute a command every time when entering a window?\n|faq-23.4|  From an autocmd, how can I determine the name of the file or the\n\t  buffer number for which the autocommand is executed?\n|faq-23.5|  How do I automatically save all the changed buffers whenever Vim\n\t  loses focus?\n|faq-23.6|  How do I execute/run a function when Vim exits to do some\n\t  cleanup?\n                                                        *faq-syntax-highlight*\nSECTION 24 - SYNTAX HIGHLIGHT ~\n|faq-24.1|  How do I turn off/on syntax highlighting?\n|faq-24.2|  How do I change the background and foreground colors used by Vim?\n|faq-24.3|  How do I change the highlight colors to suit a dark/light\n\t  background?\n|faq-24.4|  How do I change the color of the line numbers displayed when the\n\t  `:set number` command is used?\n|faq-24.5|  How do I change the background color used for a Visually selected\n\t  block?\n|faq-24.6|  How do I highlight the special characters (tabs, trailing spaces,\n\t  end of line, etc) displayed by the 'list' option?\n|faq-24.7|  How do I specify a colorscheme in my .vimrc/.gvimrc file, so that\n\t  Vim uses the specified colorscheme every time?\n|faq-24.8|  Vim syntax highlighting is broken. When I am editing a file, some\n\t  parts of the file is not syntax highlighted or syntax highlighted\n\t  incorrectly.\n|faq-24.9|  Is there a built-in function to syntax-highlight the\n\t  corresponding matching bracket?\n|faq-24.10| How do I turn off the C comment syntax highlighting?\n|faq-24.11| How do I add my own syntax extensions to the standard syntax\n\t  files supplied with Vim?\n|faq-24.12| How do I replace a standard syntax file that comes with the Vim\n\t  distribution with my own syntax file?\n|faq-24.13| How do I highlight all the characters after a particular column?\n|faq-24.14| How do I convert a source file (.c, .h, etc) with the Vim syntax\n\t  highlighting into a HTML file?\n|faq-24.15| How do I list the definition of all the current highlight\n\t  groups?\n|faq-24.16| How can I embed one syntax highlighting language into another\n\t  one?\n                                                *faq-vim-script-writing*\nSECTION 25 - VIM SCRIPT WRITING ~\n|faq-25.1|  How do I list the names of all the scripts sourced by Vim?\n|faq-25.2|  How do I debug Vim scripts?\n|faq-25.3|  How do I locate the script/plugin which sets a Vim option?\n|faq-25.4|  I am getting some error/informational messages from Vim (possibly\n\t  when running a script), the messages are cleared immediately. How\n\t  do I display the messages again?\n|faq-25.5|  How do I save and restore a plugin specific information across\n\t  Vim invocations?\n|faq-25.6|  How do I start insert mode from a Vim function?\n|faq-25.7|  How do I change the cursor position from within a Vim function?\n|faq-25.8|  How do I check the value of an environment variable in the .vimrc\n\t  file?\n|faq-25.9|  How do I check whether an environment variable is set or not from\n\t  a Vim function?\n|faq-25.10| How do I call/use the Vim built-in functions?\n|faq-25.11| I am using some normal mode commands in my Vim script. How do I\n\t  avoid using the user-defined mappings for these normal mode\n\t  commands and use the standard Vim functionality for these normal\n\t  mode commands?\n|faq-25.12| How do I get a visually selected text into a Vim variable or\n\t  register?\n|faq-25.13| I have some text in a Vim variable \"myvar\". I would like to use\n\t  this variable in a `:s` substitute command to replace a text\n\t  \"mytext\". How do I do this?\n|faq-25.14| A Vim variable (bno) contains a buffer number. How do I use this\n\t  variable to open the corresponding buffer?\n|faq-25.15| How do I store the value of a Vim option into a Vim variable?\n|faq-25.16| I have copied and inserted some text into a buffer from a Vim\n\t  function. How do I indent the inserted text from the Vim\n\t  function?\n|faq-25.17| How do I get the character under the cursor from a Vim script?\n|faq-25.18| How do I get the name of the current file without the extension?\n|faq-25.19| How do I get the basename of the current file?\n|faq-25.20| How do I get the output from a Vim function into the current\n\t  buffer?\n|faq-25.21| How do I call external programs from a Vim function?\n|faq-25.22| How do I get the return status of a program executed using the\n\t  `:!` command?\n|faq-25.23| How do I determine whether the current buffer is modified or\n\t  not?\n|faq-25.24| I would like to use the carriage return character in a normal\n\t  command from a Vim script. How do I specify the carriage return\n\t  character?\n|faq-25.25| How do I split long lines in a Vim script?\n|faq-25.26| When I try to \"execute\" my function using the `:execute Myfunc()`\n\t  command, the cursor is moved to the top of the current buffer.\n\t  Why?\n|faq-25.27| How do I source/execute the contents of a register?\n|faq-25.28| After calling a Vim function or a mapping, when I press the \"u\"\n\t  key to undo the last change, Vim undoes all the changes made by\n\t  the mapping/function. Why?\n|faq-25.29| How can I call a function defined with s: (script local\n\t  function) from another script/plugin?\n|faq-25.30| Is it possible to un-source a sourced script? In other words,\n\t  reverse all the commands executed by sourcing a script.\n                                                                *faq-plugins*\nSECTION 26 - PLUGINS ~\n|faq-26.1|  How do I set different options for different types of files?\n|faq-26.2|  I have downloaded a Vim plugin or a syntax file or a indent file,\n\t  or a color scheme or a filetype plugin from the web. Where should\n\t  I copy these files so that Vim will find them?\n|faq-26.3|  How do I extend an existing filetype plugin?\n|faq-26.4|  How do I turn off loading the Vim plugins?\n|faq-26.5|  How do I turn on/off loading the filetype plugins?\n|faq-26.6|  How do I override settings made in a file type plugin in the\n\t  global ftplugin directory for all the file types?\n|faq-26.7|  How do I disable the Vim directory browser plugin?\n|faq-26.8|  How do I set the filetype option for files with names matching a\n\t  particular pattern or depending on the file extension?\n                                                *faq-editing-program-files*\nSECTION 27 - EDITING PROGRAM FILES ~\n|faq-27.1|  How do I enable automatic indentation for C/C++ files?\n|faq-27.2|  How do I configure the indentation used for C/C++ files?\n|faq-27.3|  How do I turn off the automatic indentation feature?\n|faq-27.4|  How do I change the number of space characters used for the\n\t  automatic indentation?\n|faq-27.5|  I am editing a C program using Vim. How do I display the\n\t  definition of a macro or a variable?\n|faq-27.6|  I am editing a C program using Vim. How do I jump to the\n\t  beginning or end of a code block from within the block?\n|faq-27.7|  When editing C++ files and when inserting new lines above or\n\t  below a comment (//) line, Vim automatically inserts the C++\n\t  comment character (//) at the beginning of the line. How do I\n\t  disable this? \n|faq-27.8|  How do I add the comment character \"#\" to a set of lines at the\n\t  beginning of each line?\n|faq-27.9|  How do I edit a header file with the same name as the\n\t  corresponding C source file?\n|faq-27.10| How do I automatically insert comment leaders while typing\n\t  comments?\n                                                                *faq-quickfix*\nSECTION 28 - QUICKFIX ~\n|faq-28.1|  How do I build programs from Vim?\n|faq-28.2|  When I run the make command in Vim I get the errors listed as the\n\t  compiler compiles the program. When it finishes this list\n\t  disappears and I have to use the `:clist` command to see the error\n\t  message again. Is there any other way to see these error\n\t  messages?\n|faq-28.3|  How can I perform a command for each item in the\n\t  quickfix/location list?\n                                                                *faq-folding*\nSECTION 29 - FOLDING ~\n|faq-29.1|  How do I extend the Vim folding support?\n|faq-29.2|  When I enable folding by setting the 'foldmethod' option, all the\n\t  folds are closed. How do I prevent this?\n|faq-29.3|  How do I control how many folds will be opened when I start\n\t  editing a file?\n|faq-29.4|  How do I open and close folds using the mouse?\n|faq-29.5|  How do I change the text displayed for a closed fold?\n|faq-29.6|  How do I store and restore manually created folds across\n\t  different Vim invocations?\n|faq-29.7|  I have enabled syntax based folding. Why is Vim so slow?\n\n                                        *faq-vim-with-external-applications*\nSECTION 30 - VIM WITH EXTERNAL APPLICATIONS ~\n|faq-30.1|  Can I run a shell inside a Vim window?\n|faq-30.2|  How do I pass the word under the cursor to an external command?\n|faq-30.3|  How do I get the output of a shell command into a Vim buffer?\n|faq-30.4|  How do I pipe the contents of the current buffer to an external\n\t  command and replace the contents of the buffer with the output\n\t  from the command?\n|faq-30.5|  How do I sort a section of my file?\n|faq-30.6|  How do I use Vim as a pager?\n|faq-30.7|  How do I view Unix man pages from inside Vim?\n|faq-30.8|  How do I change the diff command used by the Vim diff support?\n|faq-30.9|  How do I use the Vim diff mode without folding?\n                                                                *faq-gui-vim*\nSECTION 31 - GUI VIM ~\n|faq-31.1|  How do I create buffer specific menus?\n|faq-31.2|  How do I change the font used by GUI Vim?\n|faq-31.3|  When starting GUI Vim, how do I specify the location of the GVIM\n\t  window?\n|faq-31.4|  How do I add a horizontal scrollbar in GVim?\n|faq-31.5|  How do I make the scrollbar appear in the left side by default?\n|faq-31.6|  How do I remove the Vim menubar?\n|faq-31.7|  I am using GUI Vim. When I press the <Alt> key and a letter, the\n\t  menu starting with that letter is selected. I don't want this\n\t  behavior as I want to map the <Alt>-<key> combination. How do I do\n\t  this?\n|faq-31.8|  Is it possible to scroll the text by dragging the scrollbar so\n\t  that the cursor stays in the original location?\n|faq-31.9|  How do I get gvim to start browsing files in a particular\n\t  directory when using the `:browse` command?\n|faq-31.10| For some questions, like when a file is changed outside of Vim,\n\t  Vim displays a GUI dialog box. How do I replace this GUI dialog\n\t  box with a console dialog box?\n|faq-31.11| I am trying to use GUI Vim as the editor for my xxx application.\n\t  When the xxx application launches GUI Vim to edit a file, the\n\t  control immediately returns to the xxx application. How do I\n\t  start GUI Vim, so that the control returns to the xxx\n\t  application only after I quit Vim?\n|faq-31.12| Why does the \"Select Font\" dialog doesn't show all the fonts\n\t  installed in my system?\n|faq-31.13| How do I use the mouse in Vim command-line mode?\n|faq-31.14| When I use the middle mouse button to scroll text, it pastes the\n\t  last copied text. How do I disable this behavior?\n|faq-31.15| How do I change the location and size of a GUI Vim window?\n|faq-31.16| When splitting the Vim window vertically, Vim changes\n\t  the position.\n                                                        *faq-vim-on-unix*\nSECTION 32 - VIM ON UNIX ~\n|faq-32.1|  I am running Vim in a xterm. When I press the CTRL-S key, Vim\n\t  freezes. What should I do now?\n|faq-32.2|  I am seeing weird screen update problems in Vim. What can I do to\n\t  solve this screen/display update problems?\n|faq-32.3|  I am using the terminal/console version of Vim. In insertmode,\n\t  When I press the backspace key, the character before the cursor\n\t  is not erased. How do I configure Vim to do this?\n|faq-32.4|  I am using Vim in a xterm. When I quit Vim, the screen contents\n\t  are restored back to the original contents. How do I disable\n\t  this?\n|faq-32.5|  When I start Vim, it takes quite a few seconds to start. How do I\n\t  minimize the startup time?\n|faq-32.6|  How can I make the cursor in gvim in unix stop blinking?\n|faq-32.7|  How do I change the menu font on GTK Vim?\n|faq-32.8|  How do I prevent CTRL-Z from suspending Vim?\n|faq-32.9|  When I kill the xterm running Vim, the Vim process continues to\n\t  run and takes up a lot of CPU (99%) time. Why is this happening?\n|faq-32.10| How do I get the Vim syntax highlighting to work in a Unix\n\t  terminal?\n                                                *faq-vim-on-ms-windows*\nSECTION 33 - VIM ON MS-WINDOWS ~\n|faq-33.1|  In MS-Windows, CTRL-V doesn't start the blockwise visual mode.\n\t  What happened?\n|faq-33.2|  When I press the CTRL-Y key, it acts like the CTRL-R key. How do\n\t  I configure Vim to treat CTRL-Y as CTRL-Y?\n|faq-33.3|  How do I start GUI Vim in a maximized window always?\n|faq-33.4|  After doing some editing operations, Vim freezes. The cursor\n\t  becomes an empty rectangle. I am not able enter any characters.\n\t  What is happening?\n|faq-33.5|  I am using Windows XP, the display speed of maximized GVim is\n\t  very slow. What can I do to speed the display updates?\n|faq-33.6|  What are the recommended settings for using Vim with cygwin?\n|faq-33.7|  I am trying to use GNU diff with Vim diff mode. When I run the\n\t  diff from command line, it works. When I try to use the diff with\n\t  Vim it doesn't work. What should I do now?\n|faq-33.8|  Is it possible to use Vim as an external editor for MS-Windows\n\t  Outlook email client?\n|faq-33.9|  I am using Vim to edit HTML files. How do I start internet\n\t  explorer with the current file to preview the HTML file?\n|faq-33.10| I would like to use Vim with Microsoft Visual Studio. How do I\n\t  do this?\n|faq-33.11| Where do I place the _vimrc and _gvimrc files?\n|faq-33.12| Every time I save a file, Vim warns about the file being changed\n\t  outside of Vim. Why?\n                                                                *faq-printing*\nSECTION 34 - PRINTING ~\n|faq-34.1|  How do I print a file along with line numbers for all the lines?\n|faq-34.2|  How do I print a file with the Vim syntax highlighting colors?\n                                                *faq-building-vim-from-source*\nSECTION 35 - BUILDING VIM FROM SOURCE ~\n|faq-35.1|  How do I build Vim from the sources on a Unix system?\n|faq-35.2|  How do I install Vim in my home directory or a directory other\n\t  than the default installation directory in Unix?\n|faq-35.3|  How do I build Vim from the sources on a MS-Windows system?\n|faq-35.4|  The Vim help, syntax, indent files are missing from my Vim\n\t  installation. How do I install these files?\n|faq-35.5|  I have built Vim from the source and installed the Vim package\n\t  using \"make install\". Do I need to keep the Vim source directory?\n|faq-35.6|  How do I determine the Vim features which are enabled at compile\n\t  time?\n|faq-35.7|  Can I build Vim without the GUI support?\n|faq-35.8|  When building Vim on a Unix system, I am getting \"undefined\n\t  reference to term_set_winsize\" error. How do I resolve this\n\t  error?\n|faq-35.9|  Vim configure keeps complaining about the lack of gtk-config\n\t  while trying to use GTK 2.03. This is correct, since in GTK 2\n\t  they moved to using the generic pkg-config. I can get pkg-config\n\t  to list the various includes and libs for gtk, but for some\n\t  reason the configure script still isn't picking this up.\n|faq-35.10| I did successfully download the sources and compiled Vim on\n\t  Unix. But feature ... still does not work. What is wrong and\n\t  how can I fix it?\n                                                                *faq-various*\nSECTION 36 - VARIOUS ~\n|faq-36.1|  How do I edit binary files with Vim?\n|faq-36.2|  How do I disable the visual error flash and the error beep?\n|faq-36.3|  How do I display the ascii value of a character displayed in a\n\t  buffer?\n|faq-36.4|  Can I use zero as a count for a Vim command?\n|faq-36.5|  How do I disable the Vim welcome screen?\n|faq-36.6|  How do I avoid the \"hit enter to continue\" prompt?\n|faq-36.7|  How do I invoke Vim from command line to run a group of commands\n\t  on a group of files?\n|faq-36.8|  How do I use a normal mode command from insert mode without\n\t  leaving the insert mode?\n|faq-36.9|  How do I start Vim in insert mode?\n|faq-36.10| How do I use Copy and Paste with Vim?\n|faq-36.11| Why shouldn't I modify the files in the system runtime\n\t  directory?\n                                                                *faq-unicode*\nSECTION 37 - UNICODE ~\n|faq-37.1|  Is it possible to create Unicode files using Vim?\n|faq-37.2|  Which Vim settings are particularly important for editing Unicode\n\t  files?\n|faq-37.3|  What is the 'encoding' option?\n|faq-37.4|  How does Vim name the various Unicode encodings?\n|faq-37.5|  How does Vim specify the presence or absence of a byte-order\n\t  mark?\n|faq-37.6|  What is the 'fileencoding' option?\n|faq-37.7|  What is the 'fileencodings' option?\n|faq-37.8|  What is the 'termencoding' option?\n|faq-37.9|  What is the 'bomb' option?\n|faq-37.10| Where can I find an example of a typical use of all these\n\t  options?\n|faq-37.11| How can I insert Unicode characters into a file using Vim?\n|faq-37.12| How can I know which digraphs are defined and for which\n\t  characters?\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-1*\nSECTION 1 - GENERAL INFORMATION ~\n\n \t\t\t\t\t\t\t\t*faq-1.1*\n1.1. What is Vim?\n\nVim stands for Vi IMproved. It used to be Vi IMitation, but there are so\nmany improvements that a name change was appropriate. Vim is a text editor\nwhich includes almost all the commands from the Unix program \"Vi\" and a lot\nof new ones. All commands can be given with the keyboard. This has the\nadvantage that you can keep your fingers on the keyboard and your eyes on\nthe screen. For those who want it, there is mouse support and a GUI version\nwith scrollbars and menus.\n\nVim is an editor, not a word processor. A word processor is used mainly\nto do layout of text. This means positioning it, changing the way it\nappears on output. More often than not, the final document is meant to\nbe printed or typeset or what have you, in order to present it in a\npleasing manner to others. Examples of word processors are Microsoft\nWord, FrameMaker, and OpenOffice Writer.\n\nAn editor is simply for entering text. Any typesetting or laying out of the\ndocument is secondary. With an editor, one's main concern is entering text,\nnot making the text look good. Examples of editors other than Vim and Vi\nare Emacs, TextMate, Ultraedit and gedit. And Notepad.\n\nFor more information, read:\n\n    |intro|\n\n \t\t\t\t\t\t\t\t*faq-1.2*\n1.2. Who wrote Vim?\n\nMost of Vim is based on Stevie and was written by Bram Moolenaar, with\ncontributions from too many people to mention here.\n\nFor more information, read:\n\n    |author|\n    |credits|\n\n \t\t\t\t\t\t\t\t*faq-1.3*\n1.3. Is Vim compatible with Vi?\n\nYes. Vim is very much compatible with Vi.  You can use the \"-C\"\ncommand-line flag to start Vim in Vi compatible mode: >\n\n    $ vim -C\n<\nYou can also use: >\n\n    $ vim -u NONE\n<\nYou can also set the 'compatible' option to enable Vi compatibility: >\n\n    :set compatible\n<\nIf you want to make sure, to start Vim in a 'nocompatible' mode to\noriginal Vi, supply the -N command line argument: >\n\n    $ vim -N\n<\nFor more information, read:\n\n    |-C|\n    |-N|\n    |'compatible'|\n    |compatible-default|\n\n \t\t\t\t\t\t\t\t*faq-1.4*\n1.4. What are some of the improvements of Vim over Vi?\n\nA short summary of the improvements of Vim over vi is listed below.  The\nlist shows that Vim is a thoroughly modern and feature-packed editor.\nStandard features of modern editors are implemented, and there is an equal\nemphasis on general power-user features and features for programmers.\n\nFeatures to modernise Vi: ~\n\n  Multi-level undo ~\n\n     Allows you to set the number of times you can undo your changes in a\n     file buffer. You can also redo an undone change.\n     Also starting with version 7.3 Vim can permanently store your undo\n     information, so that you can undo your changes which you have done\n     in a previous editing session.\n\n  Tabs, Multiple windows and buffers ~\n\n     Each file can be displayed in its own window. You can move easily from\n     one window to another. Each file opened during a Vim session also has\n     an associated buffer and you can easily jump from one to the other.\n     Also like any modern GUI, Vim supports opening several files in tabs.\n     You can do batch processing for tabs, buffers, windows and the\n     argumentlist.\n\n  Flexible insert mode ~\n\n     Vim allows you to use the arrow keys while in insert mode to move\n     around in the file. No more hitting <Esc>, moving around, then hitting\n     `i' or `a'.\n\n  Macros ~\n\n     Vim has a facility which allows you to record a sequence of typed\n     characters and repeat them any number of times.\n\n  Visual mode ~\n\n     You can highlight sections of text and execute operations on this\n     section of text only.\n\n  Block operators ~\n\n     Allow selection and highlighting of rectangular blocks of text in\n     order do execute specific operations on them.\n\n  Online help system ~\n\n     You can easily find help on any aspect of using Vim. Help is displayed\n     in its own window.\n\n  Command-line editing and history ~\n\n     History allows you to use the arrow keys to repeat or search for a\n     command that has already been typed. Allows you to match the beginning\n     of a command with the beginning of another similar command in the\n     history buffer. You can also edit a command to correct typos or change\n     a few values.\n\n  Command line completion. ~\n\n     Using the <Tab> key, you can complete commands, options, filenames,\n     etc. as needed.\n\n  Horizontal scrolling. ~\n\n     Long lines can be scrolled horizontally (with or without the GUI).\n\n  Unicode and internationalization improvements. ~\n\n     Vim is able to edit files in unicode encoding and uses internally an\n     utf-8 encoding. Additionally Vim can display text right to left\n     oriented.\n\nAdvanced user features: ~\n\n  Text formatting ~\n\n     With two keystrokes, you can format large sections of text, without\n     the use of external programs.\n\n  Completion in Insert mode ~\n\n     Vim provides several different possibilities to complete your text.\n     For example Vim can complete words while you are typing, by matching\n     the current word with other similar words in the file.\n\n  Jump tags ~\n\n     Just like in an internet browser, you can jump back to previous parts\n     of the text you were editing, and then forward again.  Your brain is\n     thus free to edit instead of navigate.\n\n  Automatic commands ~\n\n     Commands automatically executed when reading or writing a file,\n     jumping to another buffer, etc.\n\n  Viminfo ~\n\n     Allows storing of the command line history, marks and registers in a\n     file to be read on startup.  Therefore, you can recall old search\n     patterns, macros, etc., in a new Vim session.\n\n  Mouse support ~\n\n     The mouse is supported in an xterm and for MS-DOS. It can be used to\n     position the cursor, select the visual area, paste a register, etc.\n\n  Graphical User Interface (GUI) ~\n\n     There are several different graphical user interfaces available.\n     Also, it's very easy to add your own menus.  Of course, console vim is\n     still supported, and very widely used.\n\n  Scripting language ~\n\n     Vim has a powerful scripting language so new commands can be created.\n     You can also use Perl, Python, TCL, Lua and Ruby to achieve the same\n     thing!\n\n  Plugins ~\n\n     Extra functionality implemented via vim commands (regular commands or\n     the scripting language) that is automatically loaded on startup.\n     Examples: file explorer, network editing, enhanced autocompletion,\n     syntax checks.\n     More are being developed and shared on VimOnline all the time.\n\n  Syntax highlighting for many programming languages ~\n\n     Syntax highlighting (including concealing items) for hundreds of\n     programming languages is supported. Support for others can be\n     added.\n\n  Extended regular expressions ~\n\n     Vim supports extended regular expressions which are similar in\n     functionality to that of Perl regular expressions.\n\n  Integrated Spell checking ~\n\n     Spell checking has been integrated into Vim.\n\n  Diff mode ~\n\n     Vim can highlight the differences between two, three or four files.\n     Identical lines will be folded away and hidden.\n\n  Encryption using the blowfish algorithm ~\n\n     Vim allows to encrypt your files using the symmetric block cipher\n     blowfish as well as the swap file.\n\n  Extensive customizable ~\n\n     Vim can be tuned and customized to work like you want by setting\n     options. You can define your own commands, macros and even plugins\n     to extend its capabilities\n\n  Packages ~\n\n     Packages have been added to keep the installation of the growing\n     number of plugins manageable. This is a convenient way to get one\n     or more plugins, drop them in a directory and keep them updated.\n     Vim will load them automatically, or only when desired.\n\nProgramming performance features: ~\n\n  Edit-compile-edit speedup ~\n\n     You can compile within Vim and automatically jump to the location of\n     errors in the source code.\n\n  Indenting for many programming languages ~\n\n     C, C++, Java, Perl, XML and many other languages can be automatically\n     indented by vim while you type.  Support for others can be added.\n\n  Searching for words in include files ~\n\n     Vim allows you to search for a match of the word under the cursor in\n     the current and included files.\n\n  Advanced text objects ~\n\n     Instantly select, delete, copy, indent, format, change case, or ...\n     to all the text between ( and ), or { and }, or < and >, or [ and\n     ].  Or a word, sentence, or paragraph.  Very powerful.\n\n  Folding ~\n\n     Certain parts of the text can be \"folded\" away.  The best example is\n     the body of a function.  You can get an overview of the code, and then\n     open the fold of the function whose detail you need to see.\n\n  ctags and cscope integration ~\n\n     Using these two powerful programs, you can jump to a definition of a\n     function from a calling instance of it, and use other tricks to\n     navigate source code.\n\n  Integration of several programming languages ~\n\n     If you find the internal scripting language not powerful enough, you\n     can extend Vim using Lua, Ruby, Tcl, Perl and Python 2 and 3.\n\n  Asynchronous I/O support ~\n\n     Vim uses jobs and channels to talk to other programs\n     asynchronously. This allows to have e.g. a compiler run in the\n     background and open the quickfix list as soon as it is finished to\n     fix warnings and errors.\n\n  Timers ~\n\n     Timers are asynchronous and can fire once or repeatedly to invoke a\n     function to do any work.\n\nFor more information, read: ~\n\n    |vi-differences|\n\n \t\t\t\t\t\t\t\t*faq-1.5*\n1.5. Is Vim free?\n\nVim is Charityware. There are no restrictions on using or copying Vim, but\nthe author encourages you to make a donation to charity. A document\nexplaining how to do so is included in the distribution.\n\nFor more information, read:\n\n    |copyright|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-2*\nSECTION 2 - RESOURCES ~\n\n \t\t\t\t\t\t\t\t*faq-2.1*\n2.1. Where can I learn more about Vim?\n\nYou can post your Vim questions to the vim@vim.org mailing list.  You can\npost your Vim development related questions to the vim-dev@vim.org mailing\nlist. Vim does not have a newsgroup of its own. But the appropriate\nnewsgroup to post to is comp.editors.\n\n\"VimOnline\" is a web page that serves as a de facto homepage for vim,\nalthough the main purpose of it is to gather tips and scripts from\neverywhere.  Get involved!  The URL is https://www.vim.org\n\nFinally, read the Vi FAQ:\n\n    http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\nFinally, there are also some communities, where you can discuss features\nor ask questions:\n\n    https://vi.stackexchange.com\n    https://vim.reddit.com\n\nFor more information, read:\n\n    |mail-list|\n    |internet|\n\n \t\t\t\t\t\t\t\t*faq-2.2*\n2.2. Is there a mailing list available?\n\nThere are several:\n\n    NAME              DESCRIPTION ~\n    ----------------  --------------------------------------------- ~\n    vim-announce      Announcements of new releases\n    vim               General discussion\n    vim-dev           Patches, bug reports, development discussions\n    vim-mac           Macintosh discussion\n    vim-fr            General discussion in French\n\nOf these, only vim and vim-dev are of general interest. vim-announce is\nread-only to most people, and its messages are sent to the other lists as\nwell. The remaining four are very low volume.\n\n    ACTION            EMAIL SEND TO ~\n    ----------------  -------------------------- ~\n    To subscribe:     <NAME>-subscribe@vim.org\n    To unsubscribe:   <NAME>-unsubscribe@vim.org\n    To get help:      <NAME>-help@vim.org\n\nThe available mailing lists are also mentioned here:\n\n    https://www.vim.org/maillist.php\n\n \t\t\t\t\t\t\t\t*faq-2.3*\n2.3. Is there an archive available for the Vim mailing lists?\n\nYes. Visit https://groups.yahoo.com/, where name is one of:\nvimannounce, vim, vimdev, vim-fr, vim-mac, vim-vms.\n\nAlternatively, visit www.gmane.org to find out about GMANE, which allows\nyou to access the mailing lists as though they were newsgroups.  This\noffers some convenience to those who wish to browse the history or casually\nobserve the current threads.\n\n \t\t\t\t\t\t\t\t*faq-2.4*\n2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\n\nYou can download the HTML/PDF/PS format of the Vim user manual from:\n\n    https://vimdoc.sourceforge.net/\n\nNote, the user manual from that page is currently pretty outdated. It's\nbest to either use the documentation that comes with vim or use the\nonline version at https://vimhelp.org\n\nYou can find a pdf version of the full English help, including this faq\n(in letter, A4 and Ipad format) at:\n\n    https://nathangrigg.com/vimhelp/\n\nThis document is cross-referenced, so you can use the hyperlink\nfunctionality.\n\n \t\t\t\t\t\t\t\t*faq-2.5*\n2.5. I have a \"xyz\" (some) problem with Vim. How do I determine if it is a\n     problem with my setup or with Vim?  / Have I found a bug in Vim?\n\nFirst, you need to find out, whether the error is in the actual runtime\nfiles or any plugin that is distributed with Vim or whether it is a\nsimple side effect of any configuration option from your .vimrc or\n.gvimrc. So first, start vim like this: >\n\n    vim -u NONE -U NONE -N -i NONE\n<\nThis starts Vim in nocompatible mode (-N), without reading your viminfo\nfile (-i NONE), without reading any configuration file (-u NONE for not\nreading .vimrc file and -U NONE for not reading a .gvimrc file) or even\nplugin.\n\nIn this invocation, try to reproduce your problem. If the error\npersists, the chance is good you've found a bug in Vim (see also\nQuestion 2.6. |faq-2.6|)\n\nIf the error does not occur when starting Vim this way, then the problem\nis either related to some plugin of yours or some setting in one of your\nlocal setup files. You need to find out, what triggers the error, you\ntry starting Vim this way: >\n\n    vim -u NONE -U NONE -N\n<\nIf the error occurs, the problem is your .viminfo file. Simply delete\nthe viminfo file then. If the error does not occur, try: >\n\n    vim -u ~/.vimrc --noplugin -N -i NONE\n<\nThis will simply use your .vimrc as configuration file, but not load any\nplugins. If the error occurs this time, the error is possibly caused by\nsome configuration option inside your .vimrc file. Depending on the\nlength of your vimrc file, it can be quite hard to trace the origin\nwithin that file.\n\nThe best way is to add `:finish` command in the middle of your .vimrc.\nThen restart again using the same command line. If the error still\noccurs, the bug must be caused because of a setting in the first half of\nyour .vimrc. If it doesn't happen, the problematic setting must be in\nthe second half of your .vimrc. So move the `:finish` command to the\nmiddle of that half, of which you know that triggers the error and move\nyour way along, until you find the problematic option. If your .vimrc is\n350 lines long, you need at a maximum 9 tries to find the offending line\n(in practise, this can often be further reduced, since often lines\ndepend on each other).\n\nIf the problem does not occur, when only loading your .vimrc file, the\nerror must be caused by a plugin or another runtime file (indent\nautoload or syntax script). Check the output of the `:scriptnames` command\nto see what files have been loaded and for each one try to disable each\none by one and see which one triggers the bug. Often files that are\nloaded by vim, have a simple configuration variable to disable them, but\nyou need to check inside each file separately.\n\nYou can also use the -V command line argument to get more debug\ninformation to analyze the problem: >\n\n    $ vim -V2logfile\n<\nYou can increase the value passed to the -V argument to get more debug\ninformation. By also specifying a logfile name, this makes sure, the\ndebug messages don't appear on the screen and won't disturb you when\ntrying to reproduce the problem.\n\n\nFor more information, read:\n\n    |-u|\n    |-U|\n    |-N|\n    |-V|\n    |'verbose'|\n    |:verbose|\n    |:set-verbose|\n\n \t\t\t\t\t\t\t\t*faq-2.6*\n2.6. Where can I report bugs?\n\nFirst collect the required information using the following command: >\n\n    :source $VIMRUNTIME/bugreport.vim\n<\nNow send the resulting text from the above command to the bugs@vim.org\ne-mail address. There is also a public bug tracker available at\nhttps://github.com/vim/vim/issues. A copy of each message there\nwill be forwarded to the Vim Development list.\n\nThe Vim Development mailing list (see Question 2.2 |faq-2.2|) is a good place to\ndiscuss general bugs.  If the bug you find is with syntax highlighting,\na runtime file, or some other \"added feature\" (i.e. not directly\nprogrammed into vim), attempt to inform the maintainer of that feature.\nHis e-mail address will be mentioned at the top of the corresponding\nruntime file.\n\nFor more information, read:\n\n    |bug-reports|\n\n \t\t\t\t\t\t\t\t*faq-2.7*\n2.7. Where can the FAQ be found?\n\nThe FAQ can be found at https://vimhelp.org/vim_faq.txt.html.\nIt will be auto-generated from the source that is managed in the github\nrepository https://www.github.com/chrisbra/vim_faq (Patches are welcome).\n\nThe repository also includes the faq in different formats, e.g. manpage,\npdf file, html file, plain text version and a version in vim help format.\n\nA slightly older version (which doesn't seem to get updated anymore) can\nstill be found at VimOnline (https://www.vim.org/).\n\n \t\t\t\t\t\t\t\t*faq-2.8*\n2.8. What if I don't find an answer in this FAQ?\n\nThis FAQ covers mainly Vim-specific questions. You may find more\ninformation suitable for most Vi clones by reading the Vi FAQ. It is posted\nregularly on comp.editors. You can also find a copy at\n\n    http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\nAlso, since Vim has gathered so many features in the last few years,\nsuccessfully documenting the frequently asked questions here is a\nnear-impossible task. To make it possible, please email the maintainer if\nyou have a good question. A good question is one that you've tried to\nanswer yourself (remember, Vim has great documentation) but struggled.\n\n \t\t\t\t\t\t\t\t*faq-2.9*\n2.9. I have a patch for implementing a Vim feature. Where can I send this\n     patch?\n\nYou can send your patches to the Vim developer mailing list\nvim-dev@vim.org.\n\nFor more information, read:\n\n    |vim-dev|\n\n \t\t\t\t\t\t\t\t*faq-2.10*\n2.10. I have a Vim tip or developed a new Vim syntax/indent/filetype/\n      compiler plugin or developed a new script or a colorscheme.\n      Is there a public website where I can upload this?\n\nYes. You can use the Vim Online website to upload your plugins/scripts,\ncolorschemes, etc. The site is at https://www.vim.org\nNowadays people also seem to share their plugins/runtime files at\ngithub.\n\nTips can also be shared in the Wiki which you can find at\n\n    http://vim.wikia.com\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-3*\nSECTION 3 - AVAILABILITY ~\n\n \t\t\t\t\t\t\t\t*faq-3.1*\n3.1. What is the latest version of Vim?\n\nThe latest version of Vim is 8.2 released on 12th December 2019.\n\nThe release history of different versions of Vim is below:\n\n    VERSION         RELEASE DATE ~\n    --------------  -------------------- ~\n    Version 9.1     2nd January, 2024\n    Version 9.0     28th June, 2022\n    Version 8.2     12th December, 2019\n    Version 8.1     17th May, 2018\n    Version 8.0     12th September, 2016\n    Version 7.4     10th August, 2013\n    Version 7.3     15th August, 2010\n    Version 7.2     9th August, 2008\n    Version 7.1     12th May, 2007\n    Version 7.0     8th May, 2006\n    Version 6.4     15th October, 2005\n    Version 6.3     8th June, 2004\n    Version 6.2     1st June, 2003\n    Version 6.1     24th March, 2002\n    Version 6.0     27th September, 2001\n    Version 5.8     31st May, 2001\n    Version 5.7     24th June, 2000\n    Version 5.6     16th January, 2000\n    Version 5.5     21st September, 1999\n    Version 5.4     26th July, 1999\n    Version 5.3     31st August, 1998\n    Version 5.2     24th August, 1998\n    Version 5.1     7th April, 1998\n    Version 5.0     19th February, 1998\n    Version 4.6     13th March, 1997\n    Version 4.5     17th October, 1996\n    Version 4.2     5th July, 1996\n    Version 4.0     29th May, 1996\n    Version 3.0     12th August, 1994\n    Version 2.0     21st December, 1993\n    Version 1.27    23rd April, 1993\n    Version 1.17    21st April, 1992\n    Version 1.14    2nd November, 1991\n\nIf you are interested in the old release history, check out the\nvim-history git repository:\nhttps://github.com/vim/vim-history\nand especially for the release history:\nhttps://github.com/vim/vim-history#release-history\n\nFor more information, read:\n\n    |new-9|\n    |new-8|\n    |changed-9.1|\n    |changed-8.2|\n    |changed-8.1|\n\n \t\t\t\t\t\t\t\t*faq-3.2*\n3.2. Where can I find the latest version of Vim?\n\nYou can download the sources for the latest version of Vim from the\nGithub repository. The URL for this site is\n\n    https://github.com/vim/vim\n\nA mercurial mirror is also available:\n\n    https://www.vim.org/hgweb/vim/\n\nSome users keep updated repositories for distributing latest binary\nversions of Vim. You can find those repositories here:\n\n    http://vim.wikia.com/wiki/Where_to_download_Vim\n\n \t\t\t\t\t\t\t\t*faq-3.3*\n3.3. What platforms does it run on?\n\nAll Unix platforms.\nAll Windows platforms (10 and later).\nAmiga, Macintosh, MachTen, VMS, IBM z/OS.\n\nFor MS-DOS support has been removed with the latest releases of Vim.\n16-bit DOS: latest supported version 7.1\n32-bit DOS: latest supported version 7.3\nWindows XP and Visat: latest supported version 9.0\n\n \t\t\t\t\t\t\t\t*faq-3.4*\n3.4. Where can I download the latest version of the Vim runtime files?\n\nYou can download the latest version of the Vim runtime files (syntax files,\nfiletype plugins, compiler files, color schemes, documentation, indentation\nfiles and keymaps) from the Vim github repository\n\n    https://github.com/vim/vim/tree/master/runtime\n\nAnother way of downloading the runtime files is this: >\n\n    wget https://github.com/vim/vim/archive/master.tar.gz -O- |\n    tar zfx - vim-master/runtime/ --strip-components=1\n<\nSee also:\n\n    https://www.vim.org/runtime.php\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-4*\nSECTION 4 - HELP ~\n\n \t\t\t\t\t\t\t\t*faq-4.1*\n4.1. How do I use the help files?\n\nHelp can be found for all functions of Vim. In order to use it, use the\n`:help` command.  This will bring you to the main help page. On that first\npage, you will find explanations on how to move around. Basically, you move\naround in the help pages the same way you would in a read-only document.\nYou can jump to specific subjects by using tags. This can be done in two\nways:\n\n   * Use the CTRL-] command while standing on the name of a command\n     or option. This only works when the tag is a keyword.\n     <Ctrl-LeftMouse> and g<LeftMouse> work just like CTRL-].\n\n   * use the `:tag <subject>` command. This works with all characters.\n\nUse CTRL-T to jump back to previous positions in the help files. Use\n`:q` to close the help window.\n\nIf you want to jump to a specific subject on the help pages, use\n`:help {subject}` . If you don't know what to look for, try `:help index`\nto get a list of all available subjects. Use the standard search keys to\nlocate the information you want.\nYou can abbreviate the `:help` command as `:h`.\n\nFor searching the help, see the next Question 4.2. |faq-4.2|\n\nFor more information, read:\n\n    |online-help|\n\n \t\t\t\t\t\t\t\t*faq-4.2*\n4.2. How do I search for a keyword in the Vim help files?\n\na)  You can press the CTRL-D key after typing the help keyword to get a\n    list of all the help keywords containing the supplied pattern. You can\n    also use the meta characters like *, \\+, etc to specify the help\n    search pattern: >\n\n    :help init<C-D>\n    :help str*()<C-D>\n    :help '*indent<C-D>\n<\nb)  You can press the <Tab> key after typing a partial help keyword to expand\n    to the matching keyword. You can continue to press the <Tab> key to see\n    other keyword matches.\n\nc)  From the help window, you can use the `:tag` command to search for\n    keywords. For example, >\n\n    :tselect /window\n<\n    This command will list all the help keywords containing the text\n    \"window\". You can select one from the list and jump to it.\n\nd)  You can use the `:helpgrep` command to search for the given text in\n    all the help files. The quickfix window will be opened with all the\n    matching lines.\n\nFor more information, read:\n\n    |help-summary|\n    |c_CTRL-D|\n    |c_<Tab>|\n    |:tselect|\n    |:help|\n    |:helpgrep|\n\n \t\t\t\t\t\t\t\t*faq-4.3*\n4.3. I am getting an error message E123, what did I do wrong?\n\nYou can get more information about the error and the error message using:\n\n    |E123|\n\nFor more information, read:\n\n    |error-messages|\n\n \t\t\t\t\t\t\t\t*faq-4.4*\n4.4. Where can I read about the various modes in Vim?\n\nYou can get information about the different modes in Vim by reading\n\n    |vim-modes|\n\n \t\t\t\t\t\t\t\t*faq-4.5*\n4.5. How do I generate the Vim help tags file after adding a new Vim help\n     file?\n\nYou can use the `:helptags` command to regenerate the Vim help tag file\nfrom within Vim. For example: >\n\n    :cd $VIMRUNTIME/doc\n    :helptags .\n<\nTo update all \"doc\" directories in your 'runtimepath', you can use\n\n    :helptags ALL\n\nFor more information, read:\n\n    |:helptags|\n    |add-local-help|\n\n \t\t\t\t\t\t\t\t*faq-4.6*\n4.6. Can I use compressed versions of the help files?\n\nYes. You can compress the help files and still be able to view them with\nVim.  This makes accessing the help files a bit slower and requires the\n\"gzip\" utility. Follow these steps to compress and use the Vim help files:\n\n- Compress all the help files using \"gzip doc/*.txt\".\n\n- Edit the \"doc/tags\" file and change the \".txt\" to \".txt.gz\" using\n        :%s=\\(\\t.*\\.txt\\)\\t=\\1.gz\\t=\n\n- Add the following line to your vimrc:\n        set helpfile={dirname}/help.txt.gz\n\nWhere {dirname} is the directory where the help files are.  The gzip.vim\nplugin supplied with the standard Vim distribution will take care of\ndecompressing the files.  You must make sure that $VIMRUNTIME is set to\nwhere the other Vim files are, when they are not in the same location as\nthe compressed \"doc\" directory.\n\nNote, that the `:helpgrep` command does not work with compressed help pages.\n\nFor more information, read:\n\n    |gzip-helpfile|\n    |'helpfile'|\n    |gzip|\n    |$VIMRUNTIME|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-5*\nSECTION 5 - EDITING A FILE ~\n\n \t\t\t\t\t\t\t\t*faq-5.1*\n5.1. How do I load a file in Vim for editing?\n\nThere are several ways to load a file for editing. The simplest is to\nuse the `:e` (:edit) command: >\n\n    :e <filename>\n<\nYou can also use the `:n` (:next) command to load files into Vim: >\n\n    :n <filename(s)>\n<\nYou can also use the `:args` command to load files into Vim: >\n\n    :args <filename(s)>\n<\nFor more information, read:\n\n    |usr_07.txt|\n    |edit-files|\n    |:edit|\n    |:next_f|\n    |:args_f|\n\n \t\t\t\t\t\t\t\t*faq-5.2*\n5.2. How do I save the current file in another name (save as) and edit a\n     new file?\n\nYou can use the `:saveas` command to save the current file in another name: >\n\n    :saveas <newfilename>\n<\nAlternatively, you can also use the following commands: >\n\n    :w <newfilename>\n    :edit #\n<\nYou can also use the `:file` command, followed by `:w` command: >\n\n    :file <newfilename>\n    :w\n<\nFor more information, read:\n\n    |07.7|\n    |:saveas|\n    |:file_f|\n    |:w|\n\n \t\t\t\t\t\t\t\t*faq-5.3*\n5.3. How do I change the current directory to the directory of the current\n     file?\n\nYou can use the following command to change the current directory to the\ndirectory of the current file: >\n\n    :cd %:p:h\n<\nTo automatically change the current directory to the directory of the\ncurrent file, simply set the option 'autochdir'. >\n\n    :set autochdir\n<\nFor more information, read:\n\n    |:cd|\n    |:lcd|\n    |filename-modifiers|\n    |autocommand|\n    |'acd'|\n    |getcwd()|\n\n \t\t\t\t\t\t\t\t*faq-5.4*\n5.4. How do I write a file without the line feed (EOL) at the end of the\n     file?\n\nYou can turn off the 'eol' option and turn on the 'binary' option to write\na file without the EOL at the end of the file: >\n\n    :set binary\n    :set noeol\n    :w\n<\nAlternatively, you can use: >\n\n    :set noeol\n    :w ++bin\n<\nIf you rather only like Vim not to write missing EOLs, you can reset the\n'fixeol' option. This needs a Vim newer 7.4.785, so you should wrap this\nin an if condition in your .vimrc like this: >\n\n    if exists('+fixeol')\n        set nofixeol\n    endif\n<\nThis has the advantage of avoiding the many side effects that the\n'binary' option has.\n\nFor more information, read:\n\n    |'endofline'|\n    |'fixeol'|\n    |'binary'|\n    |23.4|\n\n \t\t\t\t\t\t\t\t*faq-5.5*\n5.5. How do I configure Vim to open a file at the last edited location?\n\nVim stores the cursor position of the last edited location for each buffer\nin the '\"' register. You can use the following autocmd in your .vimrc or\n.gvimrc file to open a file at the last edited location: >\n\n    au BufReadPost * if line(\"'\\\"\") > 0 && line(\"'\\\"\") <= line(\"$\") |\n                         \\ exe \"normal! g`\\\"\" | endif\n<\nAlternatively, you can simply source the vimrc_example.vim file, which is\ndistributed with Vim.\n\nFor more information, read:\n\n    |'quote|\n    |last-position-jump|\n    |vimrc_example.vim|\n\n \t\t\t\t\t\t\t\t*faq-5.6*\n5.6. When editing a file in Vim, which is being changed by an external\n     application, Vim opens a warning window (like the confirm dialog) each\n     time a change is detected. How do I disable this warning?\n\nYou can set the Vim 'autoread' option to automatically read the file again\nwhen it is changed outside of Vim: >\n\n    :set autoread\n<\nYou can also use the following autocommand: >\n\n    autocmd FileChangedShell *\n          \\ echohl WarningMsg |\n          \\ echo \"File has been changed outside of vim.\" |\n          \\ echohl None\n<\nFor more information, read:\n\n    |'autoread'|\n    |FileChangedShell|\n    |timestamp|\n    |:checktime|\n\n \t\t\t\t\t\t\t\t*faq-5.7*\n5.7. How do I edit a file whose name is under the cursor?\n\nYou can use the gf command to edit a file whose name is under the cursor.\nYou can use the CTRL-W f command to edit the file in a new window and\nfinally you can use CTRL-W gf top open a new tab page that contains the\nfile name under the cursor.\n\nFor more information, read:\n\n    |gf|\n    |CTRL-W_f|\n    |CTRL-W_gf|\n    |'isfname'|\n    |'path'|\n    |'suffixesadd'|\n    |'includeexpr'|\n\n \t\t\t\t\t\t\t\t*faq-5.8*\n5.8. How do I reload/re-edit the current file?\n\nYou can use the `:edit` command, without specifying a file name, to reload\nthe current file.  If you have made modifications to the file, you can use\n`:edit!` to force the reload of the current file (you will lose your\nmodifications, but depending on your 'undoreload' settings, those\nchanges might be saved into the undo history).\n\nFor more information, read:\n\n    |:edit|\n    |:edit!|\n    |'confirm'|\n    |'undoreload'|\n\n \t\t\t\t\t\t\t\t*faq-5.9*\n5.9. How do I autosave a file periodically?\n\nVim doesn't support auto-saving a file periodically.\n\nFor more information, read:\n\n    |'updatetime'|\n    |CursorHold|\n    |swap-file|\n\n \t\t\t\t\t\t\t\t*faq-5.10*\n5.10. How do I open a file in read-only mode?\n\nYou can open a file in read-only mode using the `:view` command: >\n\n    :view <filename>\n<\nThis command sets the 'readonly' option for the opened buffer. You can also\nuse the \"-R\" command-line option to open a file in read-only mode: >\n\n    $ vim -R <filename>\n<\nYou can also use the symbolic link executable \"view\" to open a file in\nread-only mode from the command-line: >\n\n    $ view <filename>\n<\nFor more information, read:\n\n    |07.6|\n    |'readonly'|\n    |'modifiable'|\n    |:view|\n    |:sview|\n    |view|\n    |-R|\n    |-M|\n\n \t\t\t\t\t\t\t\t*faq-5.11*\n5.11. How do I open a file for editing without saving the modifications to\n      the current file?\n\nYou can open a file for editing without saving the modifications to the\ncurrent file and without losing the changes using one of the following\nmethods: >\n\n    :split <new_filename>\n    :new <new_filename>\n<\nYou can also set the 'hidden' option and edit a new file: >\n\n    :set hidden\n    :e <new_filename>\n<\nIf you want to discard the changes made to the current file and load\nanother file for editing, then you can use the following command: >\n\n    :e! <new_filename>\n<\nFor more information, read:\n\n    |:edit!_f|\n    |'hidden'|\n    |:split|\n    |:new|\n\n \t\t\t\t\t\t\t\t*faq-5.12*\n5.12. How do I reduce the loading time for very large files in Vim?\n\nYou can use the following settings to reduce the loading time for\nvery large files in Vim: >\n\n    :set lazyredraw\n    :set noswapfile\n    :set undolevels=-1\n    :set eventignore=all\n    :set nohidden\n    :set syntax=off\n<\nNote that the above settings will disable many Vim features including the\nfollowing: Swap files support for crash recovery, undo support, syntax\nhighlighting, filetype detection and other autocommand based features.\n\nThere is also the LargeFile plugin available at\n\n    https://www.vim.org/scripts/script.php?script_id=1506\n\nwhich automatically sets these options, when working with large files\n(it is configurable, what is considered to be a large file, by default,\nit is 100MB).\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-6*\nSECTION 6 - EDITING MULTIPLE FILES ~\n\n \t\t\t\t\t\t\t\t*faq-6.1*\n6.1. How do I open multiple files at once from within Vim?\n\nMake a difference between args, buffers, tabs and windows. They are all\ndifferent things in VIM.\n\nargs is a list of arguments. Buffers are place to edit text, almost\nalways attached to a file but not necessarily. Window is a place for a\nbuffer and tab is set of windows, better name would be \"layout\".\n\nThere are several ways to open multiple files at once from within Vim. You\ncan use the `:next` command to specify a group of files: >\n\n    :next f1.txt f2.txt\n    :next *.c\n<\nYou can use the `:args` command to specify a group of files as arguments: >\n\n    :args f1.txt f2.txt\n    :args *.c\n<\nAfter loading the files, you can use the `:next` and `:prev` command to\nswitch between the files.\n\nTo execute command for all files in argument-list use `:argdo`\n\nFor more information, read:\n\n    |07.2|\n    |:next|\n    |:args_f|\n    |argument-list|\n\n \t\t\t\t\t\t\t\t*faq-6.2*\n6.2. How do I switch between multiple files/buffers in Vim?\n\nTo list all buffers use `:ls`, to list buffers without file attached to\n(also known as unlisted buffers, ex. scratch buffer and help-window) use\n`:ls!`\n\nThere are several ways to switch between multiple files. You can use the\n`:buffer` command to switch between multiple files. You can also shorten\ncommand as `:b` and use only part of the filename. For example, >\n\n    :buffer file1\n    :buffer file2\n    :b e2\n<\nYou can also use <TAB> after `:b` for autocompletion. Try also `:b`\nfollowed by CTRL-D to see all available buffers. This works also for\n`:e`.\n\nYou can also use the CTRL-^ key to switch between buffers. By specifying a\ncount before pressing the key, you can edit the buffer with that number.\nWithout the count, you can edit the alternate buffer by pressing CTRL-^\n\nYou can also use the `:e #` command to edit a particular buffer: >\n\n    :e #5\n<\nTo close a buffer use `:bd` -command.\n\nTo execute command for all files in buffer-list use `:bufdo`\n\nFor more information, read:\n\n    |edit-files|\n    |:buffer|\n    |CTRL-^|\n    |alternate-file|\n    |22.4|\n    |07.3|\n\n \t\t\t\t\t\t\t\t*faq-6.3*\n6.3. How do I open several files in Vim, with each file in a separate\n     window/tab?\n\nYou can use the -o and -O Vim command line arguments to open multiple files\nin separate horizontally or vertically split Vim windows. For example: >\n\n    $ vim -o3 f1.txt f2.txt f3.txt\n<\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate horizontally split Vim windows. >\n\n    $ vim -O3 f1.txt f2.txt f3.txt\n<\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate vertically split Vim windows. >\n\n    $ vim -p f1.txt f2.txt f3.txt\n<\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate tab windows. The option 'tabpagemax' defines, how many tabpages\ncan be opened at the same time, by default it is set to 10.\n\nFor more information, read:\n\n    |-o|\n    |-O|\n    |-p|\n    |startup-options|\n    |'tabpagemax'|\n\n \t\t\t\t\t\t\t\t*faq-6.4*\n6.4. How do I configure Vim to autoload several files at once similar to\n     \"work-sets\" or \"projects\"?\n\nYou can use the `:mksession` and the `:mkview` commands to autoload several\nfiles in Vim.\n\nThe `:mksession` command creates a Vim script that restores the current\nediting session. You can use the `:source` command to source the file\nproduced by the mksession command.\n\nThe `:mkview` command creates a Vim script that restores the contents of\nthe current window. You can use the `:loadview` command to load the view\nfor the current file.\n\nFor more information, read:\n\n    |21.4|\n    |21.5|\n    |views-sessions|\n    |'sessionoptions'|\n    |:mksession|\n    |:source|\n    |v:this_session|\n    |:mkview|\n    |:loadview|\n    |'viewdir'|\n    |buffers|\n\n \t\t\t\t\t\t\t\t*faq-6.5*\n6.5. Is it possible to open multiple top level windows in a single instance\n     of Vim similar to Nedit or Emacs?\n\nNo. It is currently not possible to open multiple top-level windows in a\nsingle instance of Vim. This feature is in the todo list.\n\n \t\t\t\t\t\t\t\t*faq-6.6*\n6.6. How do I browse/explore directories from within Vim?\n\nYou can use the netrw.vim plugin, supplied with the standard Vim\ninstallation, to browse/explore directories from within Vim. You can start\nthe file explorer using one of the following commands: >\n\n    :e <directory>\n    :Explore\n    :Sexplore\n    :Vexplore\n    :Texplore\n<\nFrom the file explorer, you can browse through directories, rename, delete\nand edit files.\n\nFor more information, read:\n\n    |netrw.vim|\n    |22.1|\n\n \t\t\t\t\t\t\t\t*faq-6.7*\n6.7. How do I edit files over a network using ftp/scp/rcp/http?\n\nYou can use the netrw.vim plugin, supplied with the standard Vim package,\nto edit files over a network using ftp/scp/rcp/http. Using this plugin, Vim\nwill transparently load and save the files over ftp/scp/rcp/http. For\nexample, to edit a file over ftp, you can use the following command: >\n\n    $ vim ftp://machine/path\n<\nFor more information, read:\n\n    |netrw.vim|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-7*\nSECTION 7 - BACKUP ~\n\n \t\t\t\t\t\t\t\t*faq-7.1*\n7.1. When I edit and save files, Vim creates a file with the same name as\n     the original file and a \"~\" character at the end. How do I stop Vim\n     from creating this file? (or) How do I disable the Vim backup file\n     feature?\n\nYou have set the 'backup' option, so Vim creates a backup file when saving\nthe original file. You can stop Vim from creating the backup file, by\nclearing the option: >\n\n    :set nobackup\n<\nNote that, by default this option is turned off. You have explicitly\nenabled the 'backup' option in one of the initialization files. You may\nalso have to turn off the 'writebackup' option: >\n\n    :set nowritebackup\n<\nFor more information, read:\n\n    |07.4|\n    |backup-table|\n    |'backup'|\n    |'writebackup'|\n    |'backupskip'|\n    |'backupdir'|\n    |'backupext'|\n    |'backupcopy'|\n    |backup|\n\n \t\t\t\t\t\t\t\t*faq-7.2*\n7.2. When I edit and save files, Vim creates a file with the same name as\n     the original file and a \"un~\" extension at the end. How do I stop Vim\n     from creating this file (or) How do I disable the Vim undofile feature?\n\nVim 7.3 contains as new feature persistent undo, that is, undo information\nwon't be lost when quitting Vim and be stored in a file that ends with\n\".un~\" You have set the 'undofile' option, so Vim creates an undo file when\nsaving the original file. You can stop Vim from creating the backup file,\nby clearing the option: >\n\n    :set noundofile\n<\nNote that, by default this option is turned off. You have explicitly\nenabled the 'undofile' option in one of the initialization files. If you\nwant your undofiles to be stored only in a particular directory, you can\npoint the 'undodir' option to a directory that will contain all your\naggregated undofiles.\n\nFor more information, read:\n\n    |'undodir'|\n    |'undofile'|\n    |undo-persistence|\n\n \t\t\t\t\t\t\t\t*faq-7.3*\n7.3. How do I configure Vim to store all the backup files in a particular\n     directory?\n\nYou can configure Vim to store all the backup files in a particular\ndirectory using the 'backupdir' option. For example, to store all the\nbackup files in the ~/backup directory, you can use the following command: >\n\n    :set backupdir=~/backup\n<\nFor more information, read:\n\n    |07.4|\n    |'backupdir'|\n    |backup|\n\n \t\t\t\t\t\t\t\t*faq-7.4*\n7.4. When I save a file with Vim, the file permissions are changed.\n     How do I configure Vim to save a file without changing the file\n     permissions?\n\nThis may happen, if the 'backupcopy' option is set to \"no\" or \"auto\". Note\nthat the default value for this option is set in such a way that this will\ncorrectly work in most of the cases. If the default doesn't work for you,\ntry setting the 'backupcopy' option to \"yes\" to keep the file permission\nwhen saving a file: >\n\n    :set backupcopy=yes\n<\nThis applies, only if you have configured Vim to make a backup whenever\noverwriting a file. By default, Vim will not backup files.\n\nFor more information, read:\n\n    |'backupcopy'|\n    |backup|\n    |'backup'|\n    |'writebackup'|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-8*\nSECTION 8 - BUFFERS ~\n\n \t\t\t\t\t\t\t\t*faq-8.1*\n8.1. I have made some modifications to a buffer. How do I edit another\n     buffer without saving the modified buffer and also without losing the\n     modifications?\n\nYou can set the 'hidden' option to edit a file without losing modifications\nto the current file: >\n\n    :set hidden\n<\nBy setting the 'hidden' option, you can also save the modification history\n(undo-history) for the buffer. Otherwise, as you switch between files, the\nundo-history will be lost (unless you use persistent undofiles).\n\nFor more information, read:\n\n    |'hidden'|\n    |hidden-quit|\n    |:hide|\n\n \t\t\t\t\t\t\t\t*faq-8.2*\n8.2. How do I configure Vim to auto-save a modified buffer when switching\n     to another buffer?\n\nYou can set the 'autowrite' option to auto-save a modified buffer when\nswitching to another buffer: >\n\n    :set autowrite\n<\nFor more information, read:\n\n    |'autowrite'|\n    |'autowriteall'|\n    |'hidden'|\n\n \t\t\t\t\t\t\t\t*faq-8.3*\n8.3. How do I replace the buffer in the current window with a blank buffer?\n\nYou can use the `:enew` command to load an empty buffer in place of the\nbuffer in the current window.\n\nFor more information, read:\n\n    |:enew|\n\n \t\t\t\t\t\t\t\t*faq-8.4*\n8.4. Is there a keyboard shortcut to load a buffer by the buffer number?\n\nYou can use the CTRL-^ command to load a buffer by specifying the buffer\nnumber. For example, to load buffer number 5, you have to use the 5 CTRL-^\ncommand.\n\nFor more information, read:\n\n    |CTRL-^|\n\n \t\t\t\t\t\t\t\t*faq-8.5*\n8.5. How do I open all the current buffers in separate windows?\n\nYou can use the `:ball` or `:sball` commands to open all the buffers\nin the buffer list: >\n\n    :ball\n<\nIf you want all buffers to be opened in new tabs, simply prefix the `:tab`\ncommand: >\n\n    :tab :sball\n<\nFor more information, read:\n\n    |:ball|\n\n \t\t\t\t\t\t\t\t*faq-8.6*\n8.6. How do I close (delete) a buffer without exiting Vim?\n\nYou can use any of `:bdelete`, `:bwipeout` or `:bunload` commands to\ndelete a buffer without exiting Vim. For example: >\n\n    :bdelete file1\n<\nFor more information, read:\n\n    |:bdelete|\n    |:bwipeout|\n    |:bunload|\n\n \t\t\t\t\t\t\t\t*faq-8.7*\n8.7. When I use the command `:%bd` to delete all the buffers, not all the\n     buffers are deleted. Why?\n\nIn the `:%bd` command, the \"%\" range will be replaced with the starting and\nending line numbers in the current buffer. Instead of using \"%\" as the\nrange, you should specify numbers for the range. For example, to delete all\nthe buffers, you can use the command `:1,9999bd`.\n\nFor more information, read:\n\n    |:bd|\n\n(This behaviour has been fixed with patch 7.4.530)\n\n \t\t\t\t\t\t\t\t*faq-8.8*\n8.8. How do I display the buffer number of the current buffer/file?\n\nYou can use 2<CTRL-G> command to display the buffer number for the current\nfile/buffer. Note the use of count before the CTRL-G command. If the count\nis greater than 1, then Vim will display the buffer number.\n\nYou can also use the following command to display the current buffer\nnumber: >\n\n    :echo bufnr(\"%\")\n<\nYou can also include the \"%n\" field to the 'statusline' option to display\nthe current buffer number on the statusline.\n\nFor more information, read:\n\n    |CTRL-G|\n    |bufnr()|\n    |:echo|\n    |'statusline'|\n\n \t\t\t\t\t\t\t\t*faq-8.9*\n8.9. How do I delete a buffer without closing the window in which the\n     buffer is displayed?\n\nYou can use the following command to open the next buffer and delete\nthe current buffer. >\n\n    :bnext | bdelete #\n<\nFor more information, read:\n\n    |:bnext|\n    |:bdelete|\n    |:buffers|\n\n \t\t\t\t\t\t\t\t*faq-8.10*\n8.10. How do I map the <Tab> key to cycle through and open all the buffers?\n\nYou can use the following two map commands, to map the <Ctrl-Tab> key to open\nthe next buffer and the <Ctrl-Shift-Tab> key to open the previous buffer: >\n\n    :nnoremap <C-Tab> :bnext<CR>\n    :nnoremap <S-C-Tab> :bprevious<CR>\n<\nNote, this might not work in the terminal version of Vim.\n\nFor more information, read:\n\n    |:bnext|\n    |:bprevious|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-9*\nSECTION 9 - WINDOWS ~\n\n \t\t\t\t\t\t\t\t*faq-9.1*\n9.1. What is the difference between a Vim window and a buffer?\n\nA Vim buffer is a file loaded into memory for editing. The original file\nremains unchanged until you write the buffer to the file. A Vim window is a\nviewport onto a buffer. You can use multiple windows on one buffer or\nseveral windows on different buffers.\n\nFor more information, read:\n\n    |usr_08.txt|\n    |22.4|\n    |windows-intro|\n    |Q_wi|\n\n \t\t\t\t\t\t\t\t*faq-9.2*\n9.2. How do I increase the width of a Vim window?\n\nYou can increase the width of a Vim window using one of the following\ncommands: >\n\n    :vert resize +N\n    :vert resize -N\n    :vert resize N\n<\nYou can also use CTRL-W < or CTRL-W > or CTRL-W | commands.\n\nFor more information, read:\n\n    |:vertical-resize|\n    |CTRL-W_>|\n    |CTRL-W_<|\n    |window-resize|\n\n \t\t\t\t\t\t\t\t*faq-9.3*\n9.3. How do I zoom into or out of a window?\n\nYou can zoom into a window (close all the windows except the current\nwindow) using the \"<CTRL-W>o\" command or the `:only` ex command.\n\nYou can use the \"<CTRL-W>_\" command or the `:resize` ex command to increase\nthe current window height to the highest possible without closing other\nwindows.\n\nYou can use the \"<CTRL-W>|\" command or the `:vertical resize` ex command to\nincrease the current window width to the highest possible without closing\nother windows.\n\nYou can use the \"<CTRL-W>=\" command to make the height and width of all the\nwindows equal.\n\nYou can also set the following options to get better results with the above\ncommands:\n\nMethod 1:\nSet the 'winminheight' option to 0: >\n\n    :set winminheight=0\n<\nBy default, this option is set to 1.\nThis option controls the minimum height of an inactive window (when it is\nnot the current window).  When the 'winminheight' option is set to 0, only\nthe status line will be displayed for inactive windows.\n\nMethod 2:\nSet the 'noequalalways' option and set the 'winheight' option to a large\nvalue (like 99999): >\n\n    :set noequalalways\n    :set winheight=99999\n<\nNow, the active window will always open to its maximum size, while the\nother windows will stay present, but shrunken to just a status line.\n\nWith any of the above mentioned methods, you cannot restore the window\nlayout after zooming into a window.  If you want to restore the Vim window\nlayout after zooming into a window, you can use the ZoomWin plugin. You can\ndownload this plugin from the Vim online website at:\n\n    https://www.vim.org/scripts/script.php?script_id=508\n\nFor more information, read:\n\n    |CTRL-W_o|\n    |window-resize|\n    |'winminheight'|\n    |'equalalways'|\n    |'winheight'|\n    |08.3|\n\n \t\t\t\t\t\t\t\t*faq-9.4*\n9.4. How do I execute an ex command on all the open buffers or open windows\n     or all the files in the argument list?\n\nYou can use the `:bufdo` command to execute an ex command on all the open\nbuffers.  You can use the `:windo` command to execute an ex command on all\nthe open windows.  You can use the `:argdo` command to execute an ex\ncommand on all the files specified in the argument list. And finally you\ncan use the `:tabdo` command to execute an ex command in all open tab pages.\n\nFor more information, read:\n\n    |:windo|\n    |:bufdo|\n    |:argdo|\n    |:tabdo|\n    |26.3|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-10*\nSECTION 10 - MOTION ~\n\n \t\t\t\t\t\t\t\t*faq-10.1*\n10.1. How do I jump to the beginning (first line) or end (last line) of a\n     file?\n\nYou can use \"G\" command to jump to the last line in the file and the \"gg\"\ncommand to jump to the first line in the file.\n\nFor more information, read:\n\n    |G|\n    |gg|\n\n \t\t\t\t\t\t\t\t*faq-10.2*\n10.2. In insert mode, when I press the <Esc> key to go to command mode, the\n     cursor moves one character to the left (except when the cursor is on\n     the first character of the line). Is it possible to change this\n     behavior to keep the cursor at the same column?\n\nNo. It is not possible to change this behavior. The cursor is always\npositioned on a valid character (unless you have virtual-edit mode\nenabled). So, if you are appending text to the end of a line, when you\nreturn to command mode the cursor *must* drop back onto the last character\nyou typed. For consistency sake, the cursor drops back everywhere, even if\nyou are in the middle of a line.\n\nYou can use the CTRL-O or CTRL-\\ CTRL-O command in insert mode to execute a\nsingle ex command and return back to insert mode without moving the cursor\ncolumn.\n\nFor more information, read:\n\n    |'virtualedit'|\n    |i_CTRL-O|\n    |i_CTRL-\\_CTRL-O|\n\n \t\t\t\t\t\t\t\t*faq-10.3*\n10.3. How do I configure Vim to maintain the horizontal cursor position when\n     scrolling with the <Page Up>, <Page Down>, etc keys?\n\nYou can reset the 'startofline' option to keep the cursor at the same\nhorizontal location when scrolling text: >\n\n    :set nostartofline\n<\nFor more information, read:\n\n    |'startofline'|\n\n \t\t\t\t\t\t\t\t*faq-10.4*\n10.4. Some lines in a file are more than the screen width and they are all\n     wrapped. When I use the j, k keys to move from one line to the next,\n     the cursor is moved to the next line in the file instead of the next\n     line on the screen. How do I move from one screen line to the next?\n\nYou can use the gj and gk commands to move from one screen line to the\nnext/previous screen line. The j and k commands move the cursor from one\nfile line to the next file line. You can also avoid the line wrapping by\nresetting the 'wrap' option: >\n\n    :set nowrap\n<\nFor more information, read:\n\n    |gj|\n    |gk|\n    |'wrap'|\n\nYou can use the following mappings: >\n\n    :map <Up> gk\n    :imap <Up> <C-o>gk\n    :map <Down> gj\n    :imap <Down> <C-o>gj\n    :noremap j gj\n    :noremap k gk\n<\n \t\t\t\t\t\t\t\t*faq-10.5*\n10.5. What is the definition of a sentence, paragraph and section in Vim?\n\nA sentence is defined as ending at a \".\", \"!\" or \"?\" followed by either the\nend of a line, or by a space (or two) or tab. Which characters and the\nnumber of spaces needed to constitute a sentence ending is determined by\nthe 'joinspaces' and 'cpoptions' options.\n\nA paragraph begins after each empty line, and also at each of a set of\nparagraph macros, specified by the pairs of characters in the 'paragraphs'\noption.\n\nA section begins after a form-feed (<C-L>) in the first column and at each\nof a set of section macros, specified by the pairs of characters in the\n'sections' option.\n\nFor more information, read:\n\n    |sentence|\n    |'joinspaces'|\n    |'cpoptions'|\n    |paragraph|\n    |section|\n    |word|\n\n \t\t\t\t\t\t\t\t*faq-10.6*\n10.6. How do I jump to beginning or end of a sentence, paragraph or a\n     section?\n\nYou can use the following motion commands to jump to the beginning or end\nof a sentence or a paragraph or a section:\n\n      motion  position    where ~\n      ------  ---------   ----------------- ~\n      (       beginning   current sentence\n      )       end         current sentence\n      {       beginning   current paragraph\n      }       end         current paragraph\n      []      end         previous section\n      [[      beginning   current section\n      ][      end         current section\n      ]]      beginning   next section\n\nEach of these motions can be preceded by a number which will extend the\njump forward (or backward).\n\nFor more information, read:\n\n    |object-motions|\n\n \t\t\t\t\t\t\t\t*faq-10.7*\n10.7. I have lines in a file that extends beyond the right extent of the\n     screen. How do I move the Vim view to the right to see the text off\n     the screen?\n\nYou can use one of the following commands to horizontally scroll the screen\nto the left or right:\n\n    cmd  scroll to ~\n    ---  -------------------------- ~\n    zl   scroll to the left\n    zh   scroll to the right\n    zL   scroll half a screenwidth to the left\n    zH   scroll half a screenwidth to the right\n    zs   scroll to position the cursor at the start of the screen\n    ze   scroll to position the cursor at the end of the screen\n\nYou can use the g0 command to move the cursor to the first character of the\nscreen line and the g$ command to move the cursor to the last character of\nthe screen line without scrolling the screen.\n\nFor more information, read:\n\n    |scroll-horizontal|\n\n \t\t\t\t\t\t\t\t*faq-10.8*\n10.8. How do I scroll two or more buffers simultaneously?\n\nYou can set the 'scrollbind' option for each of the buffers to scroll them\nsimultaneously.\n\nFor more information, read:\n\n    |'scrollbind'|\n    |scroll-binding|\n    |'scrollopt'|\n    |'cursorbind'|\n\n \t\t\t\t\t\t\t\t*faq-10.9*\n10.9. When I use my arrow keys, Vim changes modes, inserts weird characters\n     in my document but doesn't move the cursor properly. What's going on?\n\nThere are a couple of things that could be going on: either you are using\nVim over a slow connection or Vim doesn't understand the key sequence that\nyour keyboard is generating.\n\nIf you are working over a slow connection (such as a 2400 bps modem), you\ncan try to set the 'timeout' or 'ttimeout' option. These options, combined\nwith the 'timeoutlen' and 'ttimeoutlen' options, may fix the problem.\n\nThe preceding procedure will not work correctly if your terminal sends key\ncodes that Vim does not understand. In this situation, your best option is\nto map your key sequence to a matching cursor movement command and save\nthese mappings in a file. You can then `:source` the file whenever you work\nfrom that terminal.\n\nFor more information, read:\n\n    |'timeout'|\n    |'ttimeout'|\n    |'timeoutlen'|\n    |'ttimeoutlen'|\n    |:map|\n    |vt100-cursor-keys|\n\n \t\t\t\t\t\t\t\t*faq-10.10*\n10.10. How do I configure Vim to move the cursor to the end of the previous\n      line, when the left arrow key is pressed and the cursor is currently\n      at the beginning of a line?\n\nYou can add the \"<\" flag to the 'whichwrap' option to configure Vim to move\nthe cursor to the end of the previous line, when the left arrow key is\npressed and the cursor is currently at the beginning of a line: >\n\n    :set whichwrap+=<\n<\nSimilarly, to move the cursor the beginning of the next line, when the\nright arrow key is  pressed and the cursor is currently at the end of a\nline, add the \">\" flag to the 'whichwrap' option: >\n\n    :set whichwrap+=>\n<\nThe above will work only in normal and visual modes. To use this in insert\nand replace modes, add the \"[\" and \"]\" flags respectively.\n\nFor more information, read:\n\n    |'whichwrap'|\n    |05.7|\n\n \t\t\t\t\t\t\t\t*faq-10.11*\n10.11. How do I configure Vim to stay only in insert mode (modeless\n      editing)?\n\nYou can set the 'insertmode' option to configure Vim to stay only in insert\nmode: >\n\n    :set insertmode\n<\nBy setting this option, you can use Vim as a modeless editor. If you press\nthe <Esc> key, Vim will not go to the normal mode. To execute a single\nnormal mode command, you can press CTRL-O followed by the normal mode\ncommand.  To execute more than one normal command, you can use CTRL-L\nfollowed by the commands. To return to insert mode, press the <Esc> key. To\ndisable this option, reset the 'insertmode' option: >\n\n    :set noinsertmode\n<\nYou can also start vim using the \"evim\" command or you can use \"vim -y\" to\nuse Vim as a modeless editor.\n\nYou can also start Vim in insert mode using the `:startinsert` ex command.\n\nFor more information, read:\n\n    |'insertmode'|\n    |:startinsert|\n    |:stopinsert|\n    |i_CTRL-O|\n    |i_CTRL-L|\n    |evim|\n    |evim-keys|\n\n \t\t\t\t\t\t\t\t*faq-10.12*\n10.12. How do I display some context lines when scrolling text?\n\nYou can set the 'scrolloff' option to display a minimal number of screen\nlines (context) above and below the cursor. >\n\n    :set scrolloff=10\n<\nFor more information, read:\n\n    |'scrolloff'|\n    |'sidescrolloff'|\n\n \t\t\t\t\t\t\t\t*faq-10.13*\n10.13. How do I go back to previous cursor locations?\n\nYou can go back to the cursor location before the latest jump using the ''\nor `` command. You can use the CTRL-O command to go back to older cursor\npositions and the CTRL-I command to go to the newer cursor positions in the\njump list.\n\nFor more information, read:\n\n    |03.10|\n    |mark-motions|\n    |jump-motions|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-11*\nSECTION 11 - SEARCHING TEXT ~\n\n \t\t\t\t\t\t\t\t*faq-11.1*\n11.1. After I searched for a text with a pattern, all the matched text\n      stays highlighted. How do I turn off the highlighting\n      temporarily/permanently?\n\nThe 'hlsearch' option controls whether all the matches for the last\nsearched pattern are highlighted or not. By default, this option is not\nenabled. If this option is set in a system-wide vimrc file, then you can\nturn off the search highlighting by using the following command: >\n\n    :set nohlsearch\n<\nTo temporarily turn off the search highlighting, use >\n\n    :nohlsearch\n<\nYou can also clear the search highlighting, by searching for a pattern that\nis not in the current file (for example, search for the pattern \"asdf\").\n\nYou can use this mapping, to clear the search highlighting when\nredrawing the window pressing CTRL-L >\n\n    :nnoremap <silent> <C-L> <C-L>:nohls<CR>\n<\nFor more information, read:\n\n    |'hlsearch'|\n    |:nohlsearch|\n\n \t\t\t\t\t\t\t\t*faq-11.2*\n11.2. How do I enter a carriage return character in a search pattern?\n\nYou can either use \"\\r\" or <CTRL-V><CTRL-M> to enter a carriage return\ncharacter in a pattern. In Vim scripts, it is better to use \"\\r\" for the\ncarriage return character.\n\nFor more information, read:\n\n    |sub-replace-special|\n\n \t\t\t\t\t\t\t\t*faq-11.3*\n11.3. How do I search for the character ^M?\n\nYou can enter the ^M character in a search command by first pressing the\nCTRL-V key and then pressing the CTRL-M key. >\n\n    /^V^M\n<\nYou can also use the \"\\r\" character. In Vim scripts, \"\\r\" is preferred.\n\nFor more information, read:\n\n    |c_CTRL-V|\n    |using_CTRL-V|\n    |/\\r|\n\n \t\t\t\t\t\t\t\t*faq-11.4*\n11.4. How can I search/replace characters that display as \"~R\", \"~S\", etc.?\n\nYou can use the \"ga\" command to display the ASCII value/code for the\nspecial character. For example, let us say the ASCII value is 142. Then you\ncan use the following command to search for the special character: >\n\n    /^V142\n<\nwhere, ^V is entered by pressing CTRL-V.\n\nFor more information, read:\n\n    |ga|\n    |using_CTRL-V|\n    |24.8|\n\n \t\t\t\t\t\t\t\t*faq-11.5*\n11.5. How do I highlight all the non-printable characters in a file?\n\nYou can use the following commands and search pattern to highlight all the\nnon-printable characters in a file: >\n\n    :set hlsearch\n    /\\(\\p\\|$\\)\\@!.\n<\nFor more information, read:\n\n    |/\\p|\n    |/bar|\n    |/$|\n    |/\\(|\n    |/\\@!|\n    |'hlsearch'|\n\n \t\t\t\t\t\t\t\t*faq-11.6*\n11.6. How do I search for whole words in a file?\n\nYou can search for whole words in a file using the \\< and \\> atoms. For\nexample: >\n\n    /\\<myword\\>\n<\nThe \\< atom matches the beginning of the word and the \\> atom matches the\nend of the word.\n\nFor more information, read:\n\n    |/\\<|\n    |/\\>|\n\n \t\t\t\t\t\t\t\t*faq-11.7*\n11.7. How do I search for the current word under the cursor?\n\nYou can press the * key to search forward for the current word under the\ncursor.  To search backward, you can press the # key. Note that only whole\nkeywords will be searched using these commands.\n\nFor more information, read:\n\n    |star|\n    |#|\n    |gstar|\n    |g#|\n    |03.8|\n    |search-commands|\n\n \t\t\t\t\t\t\t\t*faq-11.8*\n11.8. How do I search for a word without regard to the case (uppercase or\n      lowercase)?\n\nTo always ignore case while searching for a pattern, set the 'ignorecase'\noption: >\n\n    :set ignorecase\n<\nTo ignore case only when searching a particular pattern, use the special \\c\ndirective: >\n\n    /\\c<pattern>\n<\nFor more information, read:\n\n    |'ignorecase'|\n    |/ignorecase|\n    |/\\c|\n\n \t\t\t\t\t\t\t\t*faq-11.9*\n11.9. How do I search for words that occur twice consecutively?\n\nYou can use one of the following search commands to locate words that occur\ntwice consecutively: >\n\n     /\\(\\<\\w\\+\\)\\_s\\+\\1\\>\n     /\\(\\<\\k\\+\\)\\_s\\+\\1\\>\n<\nThe main difference is the use of \"\\w\" and \"\\k\", where the latter is based\non the 'iskeyword' option which may include accented and other language\nspecific characters.\n\nFor more information, read:\n\n    |/\\1|\n    |/\\(|\n    |/\\)|\n    |/\\<|\n    |/\\>|\n    |/\\w|\n    |/\\k|\n    |/\\+|\n    |/\\_x|\n    |'iskeyword'|\n\n \t\t\t\t\t\t\t\t*faq-11.10*\n11.10. How do I count the number of times a particular word occurs in a\n       buffer?\n\nYou can use the following set of commands to count the number of times a\nparticular word occurs in a buffer: >\n\n    :let cnt=0\n    :g/\\<your_word\\>/let cnt=cnt+1\n    :echo cnt\n<\nThis only counts the number of lines where the word occurs. You can also\nuse the following command: >\n\n    :%s/\\<word\\>/&/gn\n<\nTo count the number of alphabetic words in a file, you can use >\n\n    :%s/\\a\\+/&/gn\n<\nTo count the number of words made up of non-space characters, you can use >\n\n    :%s/\\S\\+/&/gn\n<\nFor more information, read:\n\n    |count-items|\n    |word-count|\n    |v_g_CTRL-G|\n    |12.5|\n    |:s_flags|\n\n \t\t\t\t\t\t\t\t*faq-11.11*\n11.11. How do I place the cursor at the end of the matched word when\n       searching for a pattern?\n\nYou can use the \"e\" offset to the search command to place the cursor at the\nend of the matched word. For example >\n\n    /mypattern/e\n<\nFor more information about search offsets, read:\n\n    |search-offset|\n    |/|\n\n \t\t\t\t\t\t\t\t*faq-11.12*\n11.12. How do I search for an empty line?\n\nYou can search for an empty line using: >\n\n    /^$\n<\n    or >\n\n    /^\\s*$\n<\nThe latter also matches lines, that consist only of white space, while the\nformer only matches true empty lines. For more information, read:\n\n    |/^|\n    |/$|\n    |/\\s|\n    |/star|\n    |search-commands|\n\n \t\t\t\t\t\t\t\t*faq-11.13*\n11.13. How do I search for a line containing only a single character?\n\nYou can search for a line containing only a single character using: >\n\n    /^\\s*\\a\\s*$\n<\nFor more information, read:\n\n    |/^|\n    |/\\a|\n    |/\\s|\n    |/star|\n    |/$|\n\n \t\t\t\t\t\t\t\t*faq-11.14*\n11.14. How do I search and replace a string in multiple files?\n\nYou can use the `:argdo`, `:bufdo`, `:windo` or `:tabdo` commands to execute\nan ex command on multiple files. For example: >\n\n    :argdo %s/foo/bar/g|upd\n<\nFor more information, read:\n\n    |:argdo|\n    |:bufdo|\n    |:windo|\n    |:tabdo|\n\n \t\t\t\t\t\t\t\t*faq-11.15*\n11.15. I am using the `:s` substitute command in a mapping. When a search\n       for a pattern fails, the map terminates. I would like the map to\n       continue processing the next command, even if the substitute command\n       fails. How do I do this?\n\nYou can use the \"e\" flag to the substitute command to continue processing\nother commands in a map, when a pattern is not found.\n\nFor more information, read:\n\n    |:s_flags|\n\n \t\t\t\t\t\t\t\t*faq-11.16*\n11.16. How do I search for the n-th occurrence of a character in a line?\n\nTo search for the n-th occurrence of a character in a line, you can prefix\nthe \"f\" command with a number. For example, to search for the 5th\noccurrence of the character @ in a line, you can use the command 5f@. This\nassumes the cursor is at the beginning of the line - and that this first\ncharacter is not the one your are looking for.\n\nFor more information, read:\n\n    |f|\n    |F|\n    |t|\n    |T|\n    |;|\n    |,|\n\n \t\t\t\t\t\t\t\t*faq-11.17*\n11.17. How do I replace a tab (or any other character) with a hard return\n       (newline) character?\n\nYou can replace a tab (or any other character) with a hard return (newline)\ncharacter using the following command: >\n\n    :s/\\t/\\r/\n<\nNote that in the above command, if you use \\n instead of \\r, then the tab\ncharacters will not be replaced by a new-line character.\n\nFor more information, read:\n\n    |sub-replace-special|\n    |NL-used-for-Nul|\n    |CR-used-for-NL|\n\n \t\t\t\t\t\t\t\t*faq-11.18*\n11.18. How do I search for a character by its ASCII value?\n\nYou can search for a character by its ASCII value by pressing CTRL-V\nfollowed by the decimal or hexadecimal or octal value of that character in\nthe search \"/\" command.  To determine the ASCII value of a character you\ncan use the `:ascii` or the \"ga\" command.\n\nFor example, to search for the ASCII character with value 188, you can\nuse one of the following search commands: >\n\n    /<CTRL-V>188\n    /<CTRL-V>o274\n    /<CTRL-V>xBC\n    /<CTRL-V>u00bc\n<\nYou can also search for the character with the decimal/octal/hex number\nusing a collation [] like this: >\n\n    /[\\d188]\n    /[\\o274]\n    /[\\xbc]\n    /[\\u00bc]\n<\nAlternatively, you can use the special atom \\%d \\%o \\%x \\%u: >\n\n    /\\%d188\n    /\\%o274\n    /\\%xbc\n    /\\%u00bc\n<\nOr you use digraphs to enter the character. For example enter: >\n\n    /CTRL-K14\n<\nto search for the above character.\n\nFor more information, read:\n\n    |i_CTRL-V_digit|\n    |:ascii|\n    |ga|\n    |/\\]|\n    |/\\%d|\n    |digraphs|\n\n \t\t\t\t\t\t\t\t*faq-11.19*\n11.19. How do I search for long lines?\n\nYou can search for long lines or lines containing more than a specific\nnumber of characters using the Vim regular-expressions in the search\ncommand. For example, to search for all the lines containing more than 80\ncharacters, you can use one of the following commands: >\n\n    /^.\\{80}.\\+$\n    /^.*\\%>80c.*$\n    /^.*\\%>80v.*$\n<\nFor more information, read:\n\n    |/\\{|\n    |/\\%c|\n    |/\\%v|\n\n \t\t\t\t\t\t\t\t*faq-11.20*\n11.20. How do I display all the lines in the current buffer that contain a\n       specified pattern?\n\nYou can use the following command to display all the lines in the current\nbuffer that contain a specified pattern: >\n\n    :g/<pattern>/p\n<\nFor example, the following command will display all the lines in the\ncurrent buffer that contain \"vim\": >\n\n    :g/vim/p\n<\nSince `:p` is the default command to be executed for the ex command `:g`, you\ncan also use: >\n\n    :g/vim\n<\nIf you also want the corresponding line numbers, then you can use the\nfollowing command: >\n\n    :g/<pattern>/#\n<\nFor more information, read:\n\n    |:global|\n    |:print|\n    |:number|\n\n \t\t\t\t\t\t\t\t*faq-11.21*\n11.21. How do I search for a text string that spans multiple lines?\n\nYou can search for a text string that spans multiple lines using the \\_x\nregular expression atom. For example, to search for the text string \"Hello\nWorld\", you can use the following search command: >\n\n    /Hello\\_sWorld\n<\nThis will match the word \"Hello\" followed by a newline character and then\nthe word \"World\" at the beginning of the next line. This will also match\nthe word \"Hello\" immediately followed by a space character and then the\nword \"World\". When searching for the \"Hello World\" string, to include the\nspace characters at the end and beginning of the line, you can use the\nfollowing search command: >\n\n    /Hello\\_s\\+World\n<\nFor more information, read:\n\n    |27.8|\n    |pattern-atoms|\n    |/\\_|\n    |pattern-searches|\n\n \t\t\t\t\t\t\t\t*faq-11.22*\n11.22. How do I search for a pattern within the specified range of lines\n       in a buffer?\n\nYou can search for a pattern within a range of lines using the \\%>l\nand \\%<l regular expression atoms.\n\nFor example, to search for the word \"white\" between the lines 10 and 30 in\na buffer, you can use the following command: >\n\n    /white\\%>9l\\%<31l\n<\nFor more information, read:\n\n    |/\\%l|\n\n \t\t\t\t\t\t\t\t*faq-11.23*\n11.23. How do I clear the last searched pattern?\n\nThe last searched pattern is stored in the \"/\" register. You can clear\nthis register using the following command: >\n\n    :let @/=\"\"\n<\nTo clear the last search pattern whenever a buffer is unloaded, you can use\nthe following command: >\n\n    :autocmd BufUnload * let @/ = \"\"\n<\nFor more information, read:\n\n    |@/|\n    |:let-@|\n    |autocmd-searchpat|\n    |last-pattern|\n\n \t\t\t\t\t\t\t\t*faq-11.24*\n11.24. Why does this pattern \"a.\\{-}p\\@!\" not match?\n\n\"\\{-}\" doesn't just mean \"as few as possible\", it means \"as few as\npossible to make the whole pattern succeed\". If it didn't match the \"p\",\nthe whole pattern would fail (because of the \"p\\@!\") so it does match\nthe \"p\". It is a longer match, but it is the shortest match that makes\nthe whole pattern succeed.\n\nIf you wanted \"as few as possible regardless\" you would use \"\\@>\", which\nbasically divides a pattern up so that the pieces either side behave\nindependently. If the pattern were \"a.\\{-}\\@>p\\@!\" then \".\\{-}\" would\nalways match nothing because that's the smallest match that can succeed\nwhen there are not other restrictions. The whole pattern then would\nbehave the same as \"ap\\@!\", i.e. it would match any \"a\" not followed by\na \"p\").\n\nThis means, it matches as few as possible \"a\"s without trying to keep\ngoing until Vim finds the longest match. This means, it will still match\n\"ap\".\n\n \t\t\t\t\t\t\t\t*faq-11.25*\n11.25. How can I use \"/\" within a pattern, without escaping it?\n\nWhen using / to search for a pattern, you need to escape all \"/\" within\nthe pattern, because they would otherwise terminate the pattern. So you\ncan't directly search for /usr/share/doc/ but need to search for\n\\/usr\\/share\\/doc\\/\n\nThe easiest solution around that, would be to use \"?\" to start a\nbackward search and afterwards use /<CR> to use the last search-pattern\nin forward direction.\n\nIf you have a Vim, that has the eval-feature built in (which needs at\nleast a normal built or higher), you can also directly paste the pattern\ninto the search register:\n\n:let @/ = '/usr/share/doc/'\n\nThen use \"n\" to jump to the next occurrence.\n\nSee also the help at\n\n    |@/|\n    |/<CR>|\n\n \t\t\t\t\t\t\t\t*faq-11.26*\n11.26. How can I operate on a search match?\n\nThe \"gn\" command makes it easy to operate on regions of text that match\nthe current search pattern. By default, it will search forward for the\nlast used search pattern and visually select the match. If the cursor is\nalready on the match, it will be visually selected. If you used the \"gn\"\ncommand after an operator (e.g. \"c\" to change text), it will be applied\non the match.\n\nIf Visual mode is active before using gn, the visual selection will be\nextended until the end of the next match.\n\nThe \"gN\" commands works similar but searches backwards.\n\nThis allows to repeat simple operations on each match. For example, you\nmight want to change each occurence of apples by peaches. So you search\nusing \"/apple\" then you can use \"cgnpeach<Esc>\" to replace the current\nmatch by peach. Now you can use the dot \".\" command to redo the\nreplacement for the rest of the buffer.\n\nSee also the help at\n\n    |gn|\n    |gN|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-12*\nSECTION 12 - CHANGING TEXT ~\n\n \t\t\t\t\t\t\t\t*faq-12.1*\n12.1. How do I delete all the trailing white space characters (SPACE and\n      TAB) at the end of all the lines in a file?\n\nYou can use the `:substitute` command on the entire file to search and\nremove all the trailing white space characters: >\n\n    :%s/\\s\\+$//\n<\nFor more information, read:\n\n    |:%|\n    |:s|\n    |/\\s|\n    |/\\+|\n    |/$|\n\n \t\t\t\t\t\t\t\t*faq-12.2*\n12.2. How do I replace all the occurrences of multiple consecutive space\n      characters to a single space?\n\nYou can use the following command to replace all the occurrences of\nmultiple consecutive space characters to a single space: >\n\n    :%s/ \\{2,}/ /g\n<\nAlternatively use: >\n\n    :%s/  \\+/ /g\n<\nFor more information, read:\n\n    |:%|\n    |:s|\n    |/\\{|\n    |:s_flags|\n\n \t\t\t\t\t\t\t\t*faq-12.3*\n12.3. How do I reduce a range of empty lines into one line only?\n\nYou can use the following command to reduce a range of empty lines into one\nline only: >\n\n    :v/./.,/./-1join\n<\nThe explanation for this command is below:\n\n    part            description ~\n    -----           -------------------------- ~\n    :v/./           Execute the following command for all lines not\n                    containing a character (empty lines).\n     .,             Use the current line as the start of the range of\n                    lines.\n     /./            Use the line containing a character as the last line.\n     -1             Adjust the range of lines to end with the line before\n                    the last line.\n     j              Join the lines in the range.\n\nNote that this will give an error message if the empty lines are at the end\nof the file. To correct this, you have to add a temporary line at the end\nof the file, execute the command and then remove the temporary line.\n\nFor more information, read:\n\n    |:v|\n    |:join|\n    |cmdline-ranges|\n    |collapse|\n\n \t\t\t\t\t\t\t\t*faq-12.4*\n12.4. How do I delete all blank lines in a file? How do I remove all the\n      lines containing only space characters?\n\nTo remove all blank lines, use the following command: >\n\n    :g/^$/d\n<\nTo remove all lines with only whitespace (spaces or tabs) in them, use the\nfollowing command: >\n\n    :g/^\\s\\+$/d\n<\nTo remove all the lines with only whitespace, if anything, use the\nfollowing command: >\n\n    :g/^\\s*$/d\n<\n \t\t\t\t\t\t\t\t*faq-12.5*\n12.5. How do I copy/yank the current word?\n\nYou can use the \"yiw\" (yank inner word without whitespace) command or the\n\"yaw\" (yank a word with whitespace) command to copy/yank the current\nword.\n\nFor more information, read:\n\n    |04.6|\n    |04.8|\n    |iw|\n    |yank|\n    |text-objects|\n    |objects|\n\n \t\t\t\t\t\t\t\t*faq-12.6*\n12.6. How do I yank text from one position to another position within a\n      line, without yanking the entire line?\n\nYou can specify a motion command with the yank operator (y) to yank text\nfrom one position to another position within a line. For example, to yank\nfrom the current cursor position till the next letter x, use yfx or Fx or\ntx or Tx. To yank till the nth column, use n|. To yank till the next\noccurrence of a \"word\", use /word. To do a yank till the nth column on\nanother line, first mark the position using the \"ma\" command, go to the\nstart of the yank position, and then yank till the mark using y`a (note the\ndirection of the quote)\n\nFor more information, read:\n\n    |yank|\n    |motion.txt|\n    |04.6|\n\n \t\t\t\t\t\t\t\t*faq-12.7*\n12.7. When I yank some text into a register, how do I append the text to\n      the current contents of the register?\n\nWhen you specify the register for some operation, if you use the upper-case\nfor the register name, then the new text will be appended to the existing\ncontents. For example, if you have some text in the register \"a\". If you\nwant to append some new text to this, you have to use the \"A\" register\nname. If you use the lowercase register name, then the contents of the\nregister will be overwritten with the new text.\n\nFor more information, read:\n\n    |quote|\n    |quote_alpha|\n    |10.1|\n\n \t\t\t\t\t\t\t\t*faq-12.8*\n12.8. How do I yank a complete sentence that spans over more than one line?\n\nTo yank a complete sentence that spans over more than one line you have to\nuse the yank operator followed by a motion command. For example: >\n\n        y)\n<\nFrom inside the sentence you can use \"yi)\" to yank the sentence.\n\nFor more information, read:\n\n    |yank|\n    |{motion}|\n    |object-motions|\n    |04.6|\n\n \t\t\t\t\t\t\t\t*faq-12.9*\n12.9. How do I yank all the lines containing a pattern into a buffer?\n\nYou can use the `:global` command to yank all the lines containing the\npattern into a register and then paste the contents of the register into\nthe buffer: >\n\n    :let @a=''\n    :g/mypattern/y A\n<\nThe first command, clears the contents of the register \"a\". The second\ncommand copies all the lines containing \"mypattern\" into the register \"a\".\nNote that the capital letter \"A\" is used to append the matched lines. Now\nyou can paste the contents of register \"a\" to a buffer using \"ap command.\n\nIf you only want to collect all matches, you can use a different\napproach. For that run the `:s` command with the flags \"gn\" so that it\nwon't actually  change the buffer (\"n\" flag) but select each match (\"g\"\nflag). Combining this with the \"\\=\" part in the replacement part, you\ncan copy each match to e.g. a list. Altogether this looks like this: >\n\n    :let list=[]\n    :%s/pattern/\\=add(list, submatch(0))/gn\n<\nNow all matches will be in the list and you can post process them as\nwanted.\n\nFor more information, read:\n\n    |:g|\n    |:y|\n    |:let-register|\n    |quote_alpha|\n    |put|\n    |registers|\n    |:registers|\n    |sub-replace-\\=|\n\n \t\t\t\t\t\t\t\t*faq-12.10*\n12.10. How do I delete all the lines in a file that do not contain a\n       pattern?\n\nYou can use `:v` command to delete all the lines that do not contain a\npattern: >\n\n    :v/pattern/d\n<\nor >\n\n    :g!/pattern/d\n<\nFor more information, read:\n\n    |:v|\n    |:g|\n\n \t\t\t\t\t\t\t\t*faq-12.11*\n12.11. How do I add a line before each line with \"pattern\" in it?\n\nYou can use the following command to add a line before each line with\n\"pattern\" in it: >\n\n    :g/pattern/normal! Oi<line of text goes here>\n<\nAlternatively you can yank the line using the Y command and then insert the\nline using the following command: >\n\n    :g/pattern/put!\n<\nFor more information, read:\n\n    |:g|\n    |:put|\n    |insert|\n    |0|\n\n \t\t\t\t\t\t\t\t*faq-12.12*\n12.12. Is there a way to operate on a line if the previous line contains a\n       particular pattern?\n\nYou can use the `:global` command to operate on a line, if the previous\nline contains a particular pattern: >\n\n    :g/<pattern>/+{cmd}\n<\nFor more information, read:\n\n    |:g|\n    |:range|\n\n \t\t\t\t\t\t\t\t*faq-12.13*\n12.13. How do I execute a command on all the lines containing a pattern?\n\nYou can use the `:global` (:g) command to execute a command on all the\nlines containing a pattern. >\n\n    :g/my pattern/d\n<\nIf you want to use a non-Ex command, then you can use the `:normal`\ncommand: >\n\n    :g/my pattern/normal {command}\n<\nUnless you want the normal mode commands to be remapped, consider using a\n`:normal!` command instead (note the \"!\").\n\nFor more information, read:\n\n    |:global|\n    |:v|\n    |:normal|\n\n \t\t\t\t\t\t\t\t*faq-12.14*\n12.14. Can I copy the character above the cursor to the current cursor\n       position?\n\nIn Insert mode, you can copy the character above the cursor to the current\ncursor position by typing CTRL-Y. The same can be done with the\ncharacters below the cursor by typing CTRL-E.\n\nFor more information, read:\n\n    |i_CTRL-Y|\n    |i_CTRL-E|\n\n \t\t\t\t\t\t\t\t*faq-12.15*\n12.15. How do I insert a blank line above/below the current line without\n       entering insert mode?\n\nYou can use the `:put` ex command to insert blank lines. For example, try >\n\n    :put =''\n    :put! =''\n<\nFor more information, read:\n\n    |:put|\n\n \t\t\t\t\t\t\t\t*faq-12.16*\n12.16. How do I insert the name of the current file into the current buffer?\n\nThere are several ways to insert the name of the current file into the\ncurrent buffer. In insert mode, you can use the <C-R>% or the\n<C-R>=expand(\"%\") command. In normal mode, you can use the `:put =@%`\ncommand.\n\nFor more information, read:\n\n    |i_CTRL-R|\n    |expand()|\n    |!!|\n\n \t\t\t\t\t\t\t\t*faq-12.17*\n12.17. How do I insert the contents of a Vim register into the current\n       buffer?\n\nIn insert mode, you can use the <CTRL-R><register> command to insert the\ncontents of <register>. For example, use <CTRL-R>a to insert the contents\nof register \"a\" into the current buffer.\n\nIn normal mode, you can use the `:put <register>` command to insert the\ncontents of <register>. For example, use the `:put d` command to insert\nthe contents of register \"d\" into the current buffer.\n\nFor more information, read:\n\n    |i_CTRL-R|\n    |i_CTRL-R_CTRL-R|\n    |i_CTRL-R_CTRL-O|\n    |i_CTRL-R_CTRL-P|\n    |:put|\n\n \t\t\t\t\t\t\t\t*faq-12.18*\n12.18. How do I move the cursor past the end of line and insert some\n       characters at some columns after the end of the line?\n\nYou can set the 'virtualedit' option to move the cursor past the\nend-of-line and insert characters in a column after the end-of-line. To\nstart the virtual mode, use >\n\n    :set virtualedit=all\n<\nFor more information, read:\n\n    |'virtualedit'|\n\n \t\t\t\t\t\t\t\t*faq-12.19*\n12.19. How to replace the word under the cursor (say: junk) with\n      \"foojunkbar\" in Vim?\n\nThere are several ways to do this. If the word is the first such word on\nthe line, use the following command: >\n\n    :exe \"s/\".expand(\"<cword>\").\"/foo&bar/\"\n<\nTo match specifically you could use a more complex substitution like this: >\n\n    :exe 's/\\<'.expand(\"<cword>\").'\\%>'.(col(\".\")-1).'c\\>/foo&bar/'\n<\nYou can also use the command: ciwfoo<C-R>\"bar<Esc>\n\nFor more information, read:\n\n    |:substitute|\n    |expand()|\n    |col()|\n    |/\\%c|\n\n \t\t\t\t\t\t\t\t*faq-12.20*\n12.20. How do I replace a particular text in all the files in a directory?\n\nYou can use the `:argdo` command to execute the substitute command on all\nthe files specified as arguments: >\n\n    :args *\n    :argdo %s/<your_text>/<replacement_text>/ge | update\n<\nFor more information, read:\n\n    |:args_f|\n    |:argdo|\n    |:s_flags|\n\n \t\t\t\t\t\t\t\t*faq-12.21*\n12.21. I have some numbers in a file. How do I increment or decrement the\n       numbers in the file?\n\nYou can use the CTRL-A key to increment the number and the CTRL-X key to\ndecrement the number. You can also specify the number to\nincrement/decrement from the number by specifying a count to the key. This\nworks for decimal, octal and hexadecimal numbers. You can change the base\nused by Vim for this operation by modifying the 'nrformats' option.\n\nFor more information, read:\n\n    |26.2|\n    |CTRL-A|\n    |CTRL-X|\n    |'nrformats'|\n\n \t\t\t\t\t\t\t\t*faq-12.22*\n12.22. How do I reuse the last used search pattern in a `:substitute`\n       command?\n\nTo reuse the last used search pattern in a `:substitute` command, don't\nspecify a new search pattern: >\n\n    :s/pattern/newtext/\n    :s//sometext/\n<\nIn the second `:s` command, as a search pattern is not specified, the\npattern specified in the first `:s` command \"pattern\" will be used.\n\nIf you want to change the search pattern but repeat the substitution\npattern you can use the special right hand side, you can use the tilde\ncharacter: >\n\n    :s/newpattern/~/\n<\nFor more information, read:\n\n    |:s|\n    |:&|\n    |:~|\n    |&|\n    |sub-replace-special|\n\n \t\t\t\t\t\t\t\t*faq-12.23*\n12.23. How do I change the case of a string using the `:substitute`\n       command?\n\nYou can use special characters in the replacement string for a\n`:substitute` command to change the case of the matched string. For\nexample, to change the case of the string \"MyString\" to all uppercase, you\ncan use the following command: >\n\n    :%s/MyString/\\U&/g\n<\nTo change the case to lowercase, you can use the following command: >\n\n    :%s/MyString/\\L&/g\n<\nTo change the case of the first character in all the words in the current\nline to uppercase, you can use the following command: >\n\n    :s/\\<\\(.\\)\\(\\k*\\)\\>/\\u\\1\\L\\2/g\n<\nFor more information, read:\n\n    |sub-replace-special|\n    |:substitute|\n    |/\\U|\n    |/\\L|\n    |/\\u|\n\n \t\t\t\t\t\t\t\t*faq-12.24*\n12.24. How do I enter characters that are not present in the keyboard?\n\nYou can use digraphs to enter characters that are not present in the\nkeyboard. You can use the `:digraphs` command to display all the currently\ndefined digraphs. You can add a new digraph to the list using the\n`:digraphs` command.\n\nFor more information, read:\n\n    |digraphs|\n    |'digraph'|\n    |24.9|\n\n \t\t\t\t\t\t\t\t*faq-12.25*\n12.25. Is there a command to remove any or all digraphs?\n\nNo. The digraphs table is defined at compile time. You can only add new\nones. Adding a command to remove digraphs is on the todo list.\n\n \t\t\t\t\t\t\t\t*faq-12.26*\n12.26. In insert mode, when I press the backspace key, it erases only the\n       characters entered in this instance of insert mode. How do I erase\n       previously entered characters in insert mode using the backspace\n       key?\n\nThis is traditional vi behaviour. You can set the 'backspace' option to\nerase previously entered characters in insert mode: >\n\n    :set backspace=indent,eol,start\n<\nFor more information, read:\n\n    |'backspace'|\n    |i_backspacing|\n\n \t\t\t\t\t\t\t\t*faq-12.27*\n12.27. I have a file which has lines longer than 72 characters terminated\n       with \"+\" and wrapped to the next line. How can I quickly join the\n       lines?\n\nYou can use the `:global` command to search and join the lines: >\n\n    :g/+$/j\n<\nThis will, however, only join every second line. A couple of more complex\nexamples which will join all consecutive lines with a \"+\" at the end are: >\n\n    :g/+$/,/\\(^\\|[^+]\\)$/j\n    :g/+$/mark a | .,/\\(^\\|[^+]\\)$/s/+$// | 'a,.j\n<\nFor more information, read:\n\n    |:g|\n    |:j|\n    |:mark|\n\n \t\t\t\t\t\t\t\t*faq-12.28*\n12.28. How do I paste characterwise yanked text into separate lines?\n\nYou can use the `:put` command to paste characterwise yanked text into new\nlines: >\n\n    :put =@\"\n<\nFor more information, read:\n\n    |:put|\n    |quote_=|\n\n \t\t\t\t\t\t\t\t*faq-12.29*\n12.29. How do I change the case (uppercase, lowercase) of a word or a\n       character or a block of text?\n\nYou can use the \"~\" command to switch the case of a character.\n\nYou can change the case of the word under the cursor to uppercase using the\n\"gUiw\" or \"viwU\" command and to lowercase using the \"guiw\" or \"viwu\"\ncommand.\n\nYou can switch the case (upper case to lower case and vice versa) of the\nword under the cursor using the \"viw~\" or \"g~iw\" command.\n\nYou can use the \"gUgU\" command to change the current line to uppercase and\nthe \"gugu\" command to change the current line to lowercase.\n\nYou can use the \"g~g~\" command to switch the case of the current line. You\ncan use the \"g~{motion}\" or \"{Visual}~\" commands to switch the case of a\nblock of text.\n\nIf you set 'tildeop' the \"~\" command behaves like an operator and expects\na motion command to act on. If you have >\n\n    :set tildeop\n<\nand you want to change the case from the current cursor position to the end\nof line, simply use \"~$\".\n\nFor more information, read:\n\n    |case|\n    |'tildeop'|\n\n \t\t\t\t\t\t\t\t*faq-12.30*\n12.30. How do I enter ASCII characters that are not present in the\n       keyboard?\n\nYou can enter ASCII characters that are not present in the keyboard by\npressing CTRL-V and then the ASCII character number. You can also use\ndigraphs to enter special ASCII characters.\n\nFor more information, read:\n\n    |i_CTRL-V_digit|\n    |digraphs|\n    |45.5|\n\n \t\t\t\t\t\t\t\t*faq-12.31*\n12.31. How do I replace non-printable characters in a file?\n\nTo replace a non-printable character, you have to first determine the ASCII\nvalue for the character. You can use the `:ascii` ex command or the \"ga\"\nnormal-mode command to display the ASCII value of the character under the\ncursor.\n\nYou can enter the non-printable character by entering CTRL-V followed by\nthe decimal number 1-255 (with no leading zero), or by x and a hex number\n00-FF, or by an octal number 0-0377 (with leading zero), or by u and a hex\nnumber 0-FFFF, or by U and a hex number 0-7FFFFFFF\n\nAnother alternative is to use the `:digraphs` ex command to display the\ndigraphs for all characters, together with their value in decimal and\nalpha. You can enter a non-printable character by entering CTRL-K followed\nby two alphanumeric characters (a digraph).\n\nFor more information, read:\n\n    |:ascii|\n    |i_CTRL-V|\n    |i_CTRL-V_digit|\n    |:digraphs|\n\n \t\t\t\t\t\t\t\t*faq-12.32*\n12.32. How do I remove duplicate lines from a buffer?\n\nYou can use the following user-defined command to remove all the duplicate\nlines from a buffer:\n\n:command -range=% Uniq <line1>,<line2>g/^\\%<<line2>l\\(.*\\)\\n\\1$/d\n\nAdd the above command to your .vimrc file and invoke `:Uniq` to remove all\nthe duplicate lines.\n\n \t\t\t\t\t\t\t\t*faq-12.33*\n12.33. How do I prefix all the lines in a file with the corresponding line\n       numbers?\n\nYou can prefix the lines in a file with the corresponding line number in\nseveral ways. Some of them are listed below: >\n\n    :%s/^/\\=line('.'). ' '\n    :%s/^/\\=printf('%5d ', line('.'))/\n    :%s/^/\\=strpart(line('.').'.     ', 0, 5)\n    :%s/^/\\=strpart('   ', strlen(line('.'))).line('.').'. '\n<\nThe last two commands will pad the line numbers with space characters.  The\nlast command will right align the numbers and the command before that will\nleft align the numbers.\n\nIf you don't want to number consecutive lines but rather non-consecutive\nregions, you can also use this idiom: >\n\n    :let i = 1\n    :g/TODO/s/^/\\=printf('%2d.',i)|let i+=1\n<\nThis first initializes the variable i with 1. In the next line, a `:g`\ncommand is used to perform a substitute command only on lines, that\nmatch \"TODO\". After the substitute command has taken place, the variable\ni will be incremented by 1.\n\nFor more information, read:\n\n    |sub-replace-special|\n    |line()|\n    |expr6|\n    |strpart()|\n    |printf()|\n    |:execute|\n    |:global|\n\n \t\t\t\t\t\t\t\t*faq-12.34*\n12.34. How do I exchange (swap) two characters or words or lines?\n\nYou can exchange two characters with the \"xp\" command sequence. The \"x\"\nwill delete the character under the cursor and \"p\" will paste the just\ndeleted character after the character under the cursor. This will result\nin exchanging the two characters.\n\nYou can exchange two words with the \"deep\" command sequence (start with the\ncursor in the blank space before the first word).\n\nYou can exchange two lines with the \"ddp\" command sequence. The \"dd\" will\ndelete the current line and \"p\" will paste the just deleted line after the\ncurrent line. This will result in exchanging the two lines.\n\nAll of the above operations will change the \" unnamed register.\n\nYou can use the `:m +` ex command to exchange two lines without changing the\nunnamed register.\n\nFor more information, read:\n\n    |x|\n    |p|\n    |dd|\n    |d|\n    |e|\n    |linewise-register|\n    |quotequote|\n    |:move|\n\n \t\t\t\t\t\t\t\t*faq-12.35*\n12.35. How do I change the characters used as word delimiters?\n\nVim uses the characters specified by the 'iskeyword' option as word\ndelimiters. The default setting for this option is \"@,48-57,_,192-255\".\n\nFor example, to add \":\" as a word delimiter, you can use >\n\n    :set iskeyword+=:\n<\nTo remove \"_\" as a word delimiter, you can use >\n\n    :set iskeyword-=_\n<\nFor more information, read:\n\n    |'iskeyword'|\n    |word|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-13*\nSECTION 13 - COMPLETION IN INSERT MODE ~\n\n \t\t\t\t\t\t\t\t*faq-13.1*\n13.1. How do I complete words or lines in insert mode?\n\nIn insert mode, you can complete words using the CTRL-P and CTRL-N keys.\nThe CTRL-N command searches forward for the next matching keyword.\nThe CTRL-P command searches backwards for the next matching keyword.\n\nIn insert mode, you can use the CTRL-X CTRL-L command sequence to complete\nlines that starts with the same characters as in the current line before\nthe cursor. To get the next matching line, press the CTRL-P or CTRL-N keys.\nThere are a lot of other keys/ways available to complete words in insert\nmode.\n\nVim supports completion of the following items: >\n\n    CTRL-X CTRL-L    whole lines\n    CTRL-X CTRL-N    keywords in the current file\n    CTRL-X CTRL-K    words from a dictionary\n    CTRL-X CTRL-T    words from a thesaurus\n    CTRL-X CTRL-I    current and included files\n    CTRL-X CTRL-]    tags\n    CTRL-X CTRL-F    file names\n    CTRL-X CTRL-D    macro definitions (also in included files)\n    CTRL-X CTRL-V    Vim command line\n    CTRL-X CTRL-U    User defined completion\n    CTRL-X CTRL-O    Omni completion\n<\nUser defined completions and omni completions are often set by filetype\nplugins.\n\nFor more information, read:\n\n    |24.3|\n    |ins-completion|\n\n \t\t\t\t\t\t\t\t*faq-13.2*\n13.2. How do I complete file names in insert mode?\n\nIn insert mode, you can use the CTRL-X CTRL-F command sequence to complete\nfilenames that start with the same characters as in the current line before\nthe cursor.\n\nFor more information, read:\n\n    |compl-filename|\n\n \t\t\t\t\t\t\t\t*faq-13.3*\n13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do I\n      complete words that occur after the just completed word?\n\nYou can use CTRL-X CTRL-N and CTRL-X CTRL-P keys to complete words that are\npresent after the just completed word.\n\nFor more information, read:\n\n    |i_CTRL-X_CTRL-P|\n    |i_CTRL-X_CTRL-N|\n    |ins-completion|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-14*\nSECTION 14 - TEXT FORMATTING ~\n\n \t\t\t\t\t\t\t\t*faq-14.1*\n14.1. How do I format a text paragraph so that a new line is inserted at\n      the end of each wrapped line?\n\nYou can use the \"gq\" command to format a paragraph. This will format the\ntext according to the current 'textwidth' setting. An alternative would be\nto use the \"gw\" command that formats like \"gq\" but does not move the\ncursor.\n\nNote that the gq operator can be used with a motion command to operate on a\nrange of text. For example: >\n\n    gqgq - Format the current line\n    gqap - Format current paragraph\n    gwap - Format current paragraph (and don't move cursor)\n    gq3j - Format the current and the next 3 lines\n<\nFor more information, read:\n\n    |gq|\n    |gw|\n    |formatting|\n    |usr_25.txt|\n    |motion.txt|\n\n \t\t\t\t\t\t\t\t*faq-14.2*\n14.2. How do I format long lines in a file so that each line contains less\n      than \"n\" characters?\n\nYou can set the 'textwidth' option to control the number of characters that\ncan be present in a line. For example, to set the maximum width of a line\nto 70 characters, you can use the following command: >\n\n    set textwidth=70\n<\nNow to break the long lines in a file to the length defined by the\n'textwidth' option, you can use >\n\n    :g/./normal gqq\n<\nFor more information, read:\n\n    |'textwidth'|\n    |gq|\n\n \t\t\t\t\t\t\t\t*faq-14.3*\n14.3. How do I join short lines to form a paragraph?\n\nFirst, make sure the 'textwidth' option is set to a high value: >\n\n    :set textwidth=99999\n<\nNext, join the short lines to form a paragraph using the command: >\n\n    1GgqG\n<\nThe above command will operate on the entire file. To do the formatting on\nall paragraphs in a specific range, use: >\n\n    :'a,'bg/\\S/normal gq}\n<\nFor more information, read:\n\n    |gq|\n    |G|\n    |gqq|\n\n \t\t\t\t\t\t\t\t*faq-14.4*\n14.4. How do I format bulleted and numbered lists?\n\nYou can configure Vim to format bulleted and numbered lists using the\n'formatoptions' option. For example, you can format the list of the\nfollowing format:\n\n  - this is a test. this is a test. this is a test. this is a test.\n  this is a test.\n\ninto this format:\n\n  - this is a test. this is a test. this is a test. this is a test.\n    this is a test.\n\nYou can use the \"n\" flag in the 'formatoptions' to align the text. >\n\n    :set fo+=n\n<\nWith this option, when formatting text, Vim will recognize numbered lists.\nFor this option to work, the 'autoindent' option also must be set.\n\nFor more information, read:\n\n    |'formatoptions'|\n    |fo-table|\n    |format-comments|\n\n \t\t\t\t\t\t\t\t*faq-14.5*\n14.5. How do I indent lines in insert mode?\n\nIn insert mode, you can press the CTRL-T key to insert one shiftwidth of\nindent at the start of the current line. In insert mode, you can use the\nCTRL-D key to delete on shiftwidth of indent at the start of the current\nline. You can also use the CTRL-O >> and CTRL-O << commands to indent the\ncurrent line in insert mode.\n\nFor more information, read:\n\n    |i_CTRL-T|\n    |i_CTRL-D|\n    |i_0_CTRL-D|\n    |i_CTRL-O|\n    |>>|\n    |<<|\n\n \t\t\t\t\t\t\t\t*faq-14.6*\n14.6. How do I format/indent an entire file?\n\nYou can format/indent an entire file using the gg=G command, where >\n\n    gg - Goto the beginning of the file\n    =  - apply indentation\n    G  - till end of file\n<\nFor more information, read:\n\n    |gg|\n    |=|\n    |G|\n    |'formatprg'|\n    |C-indenting|\n\n \t\t\t\t\t\t\t\t*faq-14.7*\n14.7. How do I increase or decrease the indentation of the current line?\n\nYou can use the \">>\" and \"<<\" commands to increase or decrease the\nindentation of the current line.\n\nFor more information, read:\n\n    |shift-left-right|\n    |>>|\n    |<<|\n    |'shiftwidth'|\n\n \t\t\t\t\t\t\t\t*faq-14.8*\n14.8. How do I indent a block/group of lines?\n\nYou can visually select the group of lines and press the > or < key to\nindent/unindent the lines. You can also use the following ex-command to\nindent the lines >\n\n    :10,20>\n<\nFor more information, read:\n\n    |shift-left-right|\n    |v_>|\n    |v_<|\n    |:<|\n    |:>|\n\n \t\t\t\t\t\t\t\t*faq-14.9*\n14.9. When I indent lines using the > or < key, the standard 8-tabstops are\n      used instead of the current 'tabstop' setting. Why?\n\nThe number of spaces used when lines are indented using the \">\" operator is\ncontrolled by the 'shiftwidth' option. The 'tabstop' setting is only\nused, when the 'shiftwidth' option is zero. >\n\n    :set shiftwidth=4\n<\nFor more information, read:\n\n    |'shiftwidth'|\n    |>>|\n    |'softtabstop'|\n\n \t\t\t\t\t\t\t\t*faq-14.10*\n14.10. How do I turn off the automatic indentation of text?\n\nBy default, the automatic indentation of text is not turned on. Check the\nconfiguration files (.vimrc, .gvimrc) for settings related to indentation.\nMake sure the `:filetype indent on` command is not present. If it is\npresent, remove it. Also, depending on your preference, you may also want\nto check the value of the 'autoindent', 'smartindent', 'cindent' and\n'indentexpr' options and turn them off as needed.\n\nFor more information, read:\n\n    |:filetype-indent-off|\n    |'autoindent'|\n    |'smartindent'|\n    |'cindent'|\n    |'indentexpr'|\n\n \t\t\t\t\t\t\t\t*faq-14.11*\n14.11. How do I configure Vim to automatically set the 'textwidth' option\n       to a particular value when I edit mails?\n\nYou can use the \"FileType\" autocommand to set the 'textwidth' option: >\n\n    autocmd FileType mail set tw=<your_value>\n<\nFor more information, read:\n\n    |:autocmd|\n    |FileType|\n    |usr_43.txt|\n\n \t\t\t\t\t\t\t\t*faq-14.12*\n14.12. Is there a way to make Vim auto-magically break lines?\n\nYes. Set the 'textwidth' option to the preferred length for a line. Then\nVim will auto-magically break the newly entered lines. For example: >\n\n    :set textwidth=75\n<\nFor more information, read:\n\n    |'textwidth'|\n    |ins-textwidth|\n    |'formatoptions'|\n    |fo-table|\n    |formatting|\n\n \t\t\t\t\t\t\t\t*faq-14.13*\n14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n       'fileformat' option to \"dos\" and then \"unix\" and then \"mac\". None of\n       these helped. How can I hide these symbols?\n\nWhen a file is loaded in Vim, the format of the file is determined as\nbelow:\n\n- If all the lines end with a new line (<NL>), then the fileformat is\n  \"unix\".\n- If all the lines end with a carriage return (<CR>) followed by a new line\n  (<NL>), then the fileformat is \"dos\".\n- If all the lines end with carriage return (<CR>), then the fileformat is\n  \"mac\".\n\nIf the file has some lines ending with <CR> and some lines ending with <CR>\nfollowed by a <NL>, then the fileformat is set to \"unix\".\n\nYou can change the format of the current file, by saving it explicitly in\ndos format: >\n\n    :w ++ff=dos\n<\nTo display the format of the current file, use >\n\n    :set fileformat?\n<\nThe above behavior is also controlled by the 'fileformats' option. You can\ntry the following commands: >\n\n    :set fileformats+=unix\n    :e <your_file>\n    :set fileformat=unix\n    :w\n<\nTo remove the carriage return (<CR>) character at the end of all the lines\nin the current file, you can use the following command: >\n\n    :%s/\\r$//\n<\nTo force Vim to use a particular file format, when editing a file, you can\nuse the following command: >\n\n    :e ++ff=dos filename\n<\nFor more information, read:\n\n    |'fileformats'|\n    |'fileformat'|\n    |file-formats|\n    |DOS-format-write|\n    |Unix-format-write|\n    |Mac-format-write|\n    |dos-file-formats|\n    |23.1|\n    |++ff|\n\n \t\t\t\t\t\t\t\t*faq-14.14*\n14.14. When I paste some text into a Vim buffer from another application,\n      the alignment (indentation) of the new text is messed up. How do I\n      fix this?\n\nWhen you paste text into a GUI Vim using the mouse, Vim is able to\ndetect that you are pasting text. So all the indentation related\nsettings (like autoindent, smartindent, cindent, etc.) are ignored and\nthe text is pasted literally.\n\nWhen pasting text into a Vim running in a terminal (like xterm) using\nthe mouse, Vim may not be able to detect that you are pasting text. This\ndepends on several things: the capability of the terminal to pass the\nmouse events to Vim, Vim is compiled to handle mouse events and access\nthe clipboard, the DISPLAY variable is set properly, the Vim 'mouse'\noption is set correctly.\n\nIf Vim is able to detect that you are pasting text using the mouse, then\nthe pasted text will be inserted literally.\n\nIf Vim is not able to detect that you are pasting using the mouse, then\nit will see the pasted text as though you literally typed the text.\nAfter the first line from the pasted text is inserted, when Vim\nencounters the newline character, because of the indentation settings,\nthe next line will start indented. The spaces at the beginning of the\nsecond line in the pasted text will be inserted leading to additional\nindentation. This will be repeated for subsequent lines. So the pasted\ntext will be inserted with stair case indentation.\n\nYou can fix this problem in a terminal Vim in several ways:\n\n1. Build Vim with the +mouse and +xterm_clipboard compile-time options.\n   The normal or big or huge build of Vim includes these options.  Set\n   the 'mouse' option to either \"a\" or include \"i\".  When pasting text\n   using the mouse, don't press the Shift key. This will work only if\n   Vim can access the X display. For more information, read the\n   following Vim help topics:\n\n    |+feature-list|\n    |'mouse'|\n    |<MiddleMouse>|\n    |x11-selection|\n    |xterm-clipboard|\n\n1.1 Some Linux distributions build their terminal vim packages\n    without X support.  This makes no sense and leaves many users\n    with the impression that Vim in terminal mode doesn't support\n    some operations such as properly pasting text with a mouse. >\n\n    If your distribution includes gvim, which it almost certainly\n    does these days, the solutions to this include the following.\n<\n    a)  Start Vim as >\n\n            gvim -v\n<\n    b)  Put this alias in your shell's configuration file, e.g.\n        ~/.bashrc: >\n\n            alias vim='gvim -v'\n<\n    c)  Put the following command in a file named \"vim\" and put that\n        file in your ~/bin directory: >\n\n            gvim -v \"$@\"\n<\n    d)  Link the distribution's gvim to ~/bin/vim with the following\n        command, which needs to be executed only once. >\n\n            ln -s $(which gvim) ~/bin/vim\n<\n    For c) and d), make sure that ~/bin precedes /usr/bin in your\n    PATH.\n\n2. Paste the text using the CTRL-R CTRL-O * command.  This will paste\n   the text literally without any automatic indentation. If you want to\n   paste the text and then fix the indentation, then you can use CTRL-R\n   CTRL-P *. These commands will work only if Vim can access the X\n   display. For more information, read the following Vim help topics:\n\n    |i_CTRL-R_CTRL-O|\n    |i_CTRL-R_CTRL-P|\n    |quotestar|\n\n3. Set the 'paste' option before pasting the text. This option will\n   disable the effect of all the indentation related settings. Make\n   sure to turn off this option using `:set nopaste` after pasting the\n   text. Otherwise the Vim indentation feature will not work.  Do not\n   permanently set the 'paste' option in your .vimrc file. If you are\n   going to repeat these steps often, then you can set the\n   'pastetoggle' option to a key. When you press the specified key,\n   the 'paste' option will be toggled. You can press the key once\n   before pasting the text and the press the key once after pasting\n   the text. Note that when the 'paste' option is set, all the\n   mappings and abbreviations are disabled.  For more information,\n   read the following Vim help topics:\n\n    |'paste'|\n    |'pastetoggle'|\n\nYou can also refer to the following topics in the user manual:\n\n    |04.7|\n    |09.3|\n\n \t\t\t\t\t\t\t\t*faq-14.15*\n14.15. When there is a very long wrapped line (wrap is \"on\") and a line\n      doesn't fit entirely on the screen it is not displayed at all. There\n      are blank lines beginning with \"@\" symbol instead of wrapped line. If\n      I scroll the screen to fit the line the \"@\" symbols disappear and the\n      line is displayed again. What Vim setting control this behavior?\n\nYou can set the 'display' option to \"lastline\" to display as much as\npossible of the last line in a window instead of displaying the \"@\"\nsymbols. >\n\n    :set display=lastline\n<\nFor more information, read:\n\n    |'display'|\n\n \t\t\t\t\t\t\t\t*faq-14.16*\n14.16. How do I convert all the tab characters in a file to space\n       characters?\n\nYou can use the `:retab` command to update all the tab characters in the\ncurrent file with the current setting of 'expandtab' and 'tabstop'. For\nexample, to convert all the tabs to white spaces, use >\n\n    :set expandtab\n    :retab\n<\nFor more information, read:\n\n    |:retab|\n    |'expandtab'|\n    |'tabstop'|\n    |25.3|\n\n \t\t\t\t\t\t\t\t*faq-14.17*\n14.17. What Vim options can I use to edit text that will later go to a word\n       processor?\n\nYou can set the following options to edit text that will later go into a\nword processor: >\n\n    :set wrap\n    :set linebreak\n    :set textwidth=0\n    :set showbreak=>>>\n<\nYou can use the \"gk\" and \"gj\" commands to move one screen line up and down.\nFor more information, read:\n\n    |'wrap'|\n    |'linebreak'|\n    |'textwidth'|\n    |'showbreak'|\n    |gk|\n    |gj|\n\n \t\t\t\t\t\t\t\t*faq-14.18*\n14.18. How do I join lines without adding or removing any space characters?\n\nBy default, when you join lines using the \"J\" or `:join` command, Vim will\nreplace the line break, leading white space and trailing white space with a\nsingle space character. If there are space characters at the end of a line\nor a line starts with the \")\" character, then Vim will not add a space\ncharacter.\n\nTo join lines without adding or removing any space characters, you can use\nthe gJ or `:join!` commands.\n\nFor more information, read:\n\n    |gJ|\n    |:join|\n    |J|\n    |10.5|\n    |'joinspaces'|\n    |'cpoptions'|\n    |'formatoptions'|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-15*\nSECTION 15 - VISUAL MODE ~\n\n \t\t\t\t\t\t\t\t*faq-15.1*\n15.1. How do I do rectangular block copying?\n\nYou can do rectangular block copying in Vim using the blockwise visual\nmode. To start blockwise visual mode use the CTRL-V key. Move the cursor\nusing any of the motion commands and then use the y operator to yank to\nvisually selected text.\n\nIf CTRL-V does not work as expected, it may have been remapped to CTRL-Q by\nthe mswin.vim script which is often sourced by a vimrc on Windows machines\nto mimic some common short cuts from other programs.\n\nFor more information, read:\n\n    |04.4|\n    |blockwise-visual|\n    |visual-mode|\n    |Q_vi|\n\n \t\t\t\t\t\t\t\t*faq-15.2*\n15.2. How do I delete or change a column of text in a file?\n\nYou can use the Vim block-wise visual mode to select the column of text and\napply an operator (delete, change, copy, etc) on it.\n\nFor more information, read:\n\n    |visual-block|\n    |visual-operators|\n\n \t\t\t\t\t\t\t\t*faq-15.3*\n15.3. How do I apply an ex-command on a set of visually selected lines?\n\nWhen you select a range of lines in visual mode, the < register is set to\nthe start of the visual region and the > register is set to the end of the\nvisual region. You can use these registers to specify the range for an ex\ncommand. After visually selecting the lines, press \":\" to go to the command\nmode.  Vim will automatically insert the visual range '<,'>. You can run\nany ex-command on the visual range.\n\nFor more information, read:\n\n    |v_:|\n    |'<|\n    |'>|\n\n \t\t\t\t\t\t\t\t*faq-15.4*\n15.4. How do I execute an ex command on a column of text selected in Visual\n      block mode?\n\nAll the ex commands operate on whole lines only. If you try to execute\nan ex command on a column of text selected in visual block mode, Vim\nwill operate on all the selected lines (instead of the selected\ncolumns). You can use the vis.vim or NrrwRgn plugin script from\nhttps://www.vim.org scripts archive to do this.\n\nFor more information, read:\n\n    |cmdline-ranges|\n    |10.3|\n    |cmdline-lines|\n\n \t\t\t\t\t\t\t\t*faq-15.5*\n15.5. How do I select the entire file in visual mode?\n\nYou can select the entire file in visual mode using ggVG. >\n\n    gg - go to the beginning of the file.\n    V  - Start linewise visual mode\n    G  - goto the end of the file.\n<\nFor more information, read:\n\n    |gg|\n    |linewise-visual|\n    |G|\n\n \t\t\t\t\t\t\t\t*faq-15.6*\n15.6. When I visually select a set of lines and press the > key to indent\n      the selected lines, the visual mode ends. How can I reselect the\n      region for further operation?  (or) How do I re-select the last\n      selected visual area again?\n\nYou can use the \"gv\" command to reselect the last selected visual area. You\ncan also use the marks '< and '> to jump to the beginning or the end of the\nlast selected visual area.\n\nFor more information, read:\n\n    |gv|\n    |'<|\n    |'>|\n\n \t\t\t\t\t\t\t\t*faq-15.7*\n15.7. How do I jump to the beginning/end of a visually selected region?\n\nYou can use the \"o\" command to jump to the beginning/end of a visually\nselected region.\n\nFor more information, read:\n\n    |v_o|\n\n \t\t\t\t\t\t\t\t*faq-15.8*\n15.8. When I select text with mouse and then press : to enter an ex\n      command, the selected text is replaced with the : character. How do I\n      execute an ex command on a text selected using the mouse similar to\n      the text selected using the visual mode?\n\nThis will happen if you have configured Vim to use select mode instead of\nVisual mode by setting the 'selectmode' option. Check the value of this\noption: >\n\n    :set selectmode?\n<\nThis mode is known as selectmode and is similar to the visual mode. This\noption is also automatically set when you use the \"behave mswin\" command.\nSelect mode looks like visual mode, but it is similar to the selection mode\nin MS-Windows.\n\nFor more information, read:\n\n    |Select-mode|\n    |'selectmode'|\n    |09.4|\n    |:behave|\n\n \t\t\t\t\t\t\t\t*faq-15.9*\n15.9. When I select a block of text using the mouse, Vim goes into\n      selection mode instead of Visual mode. Why?\n\nThe 'selectmode' option controls whether Select mode will be started when\nselecting a block of text using the mouse. To start Visual mode when\nselecting text using mouse, remove the \"mouse\" value from the 'selectmode'\noption: >\n\n    :set selectmode-=mouse\n<\nNote that by default, the 'selectmode' option will be set to empty, so that\nalways visual mode is used.\n\nFor more information, read:\n\n    |'selectmode'|\n    |Select-mode|\n    |:behave|\n\n \t\t\t\t\t\t\t\t*faq-15.10*\n15.10. How do I visually select the last copy/pasted text?\n\nYou can use the '[ and '] marks to visually select the last copy/pasted\ntext. The '[ mark is set to the beginning of the last changed/yanked text\nand the '] mark is set to the end of the last changed/yanked text. To\nvisually select this block of text use the command '[v']\n\nFor more information, read:\n\n    |'[|\n    |']|\n    |`a|\n    |v|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-16*\nSECTION 16 - COMMAND-LINE MODE ~\n\n \t\t\t\t\t\t\t\t*faq-16.1*\n16.1. How do I use the name of the current file in the command mode or an\n      ex command line?\n\nIn the command line, the \"%\" character represents the name of the current\nfile. In some commands, you have to use `expand(\"%\")` to get the filename: >\n\n    :!perl %\n<\nAnother example is to load the latex generated pdf file from the file you\nare currently editing: >\n\n    :!xpdf %<.pdf\n<\nFor more information, read:\n\n    |:_%|\n    |cmdline-special|\n    |expand()|\n\n \t\t\t\t\t\t\t\t*faq-16.2*\n16.2. How do I edit the text in the Vim command-line effectively?\n\nYou can use the command-line window for editing Vim command-line text. To\nopen the Vim command-line window use the \"q:\" command in normal mode. In\ncommand-line mode, use the CTRL-F key. In this window, the command line\nhistory will be displayed. You can use normal Vim keys/commands to edit any\nprevious/new command line. To execute a command line, press the\nenter/return key.\n\nIn a similar vain, the search history can be edited with \"q/\" and \"q?\"\ncommands.\n\nFor more information, read:\n\n    |cmdline-window|\n\n \t\t\t\t\t\t\t\t*faq-16.3*\n16.3. How do I switch from Vi mode to Ex mode?\n\nYou can use the Q command to switch from Vi mode to Ex mode. To switch from\nEx mode back to the Vi mode, use the `:vi` command.\n\nFor more information, read:\n\n    |Q|\n    |gQ|\n    |Ex-mode|\n    |:vi|\n\n \t\t\t\t\t\t\t\t*faq-16.4*\n16.4. How do I copy the output from an ex-command into a buffer?\n\nTo copy the output from an ex-command into a buffer, you have to first get\nthe command output into a register. You can use the `:redir` command to get\nthe output into a register. For example, >\n\n    :redir @a\n    :g/HelloWord/p\n    :redir END\n<\nNow the register \"a\" will contain the output from the ex command\n`:g/HelloWord/p`. Now you can paste the contents of the register \"a\" into a\nbuffer. You can also send or append the output of an ex-command into a file\nusing the `:redir` command.\n\nYou can prefix the `:global` command with `:silent`, to avoid having the\nlines printed to the screen.\n\nTo redirect the output from an ex-command to a file, you can use the\nfollowing set of commands: >\n\n    :redir > myfile\n    :g/HelloWord/p\n    :redir END\n<\nFor more information, read:\n\n    |:redir|\n    |:silent|\n\n \t\t\t\t\t\t\t\t*faq-16.5*\n16.5. When I press the <Tab> key to complete the name of a file in the\n      command mode, if there are more than one matching file names, then\n      Vim completes the first matching file name and displays a list of all\n      matching filenames. How do I configure Vim to only display the list\n      of all the matching filenames and not complete the first one?\n\nYou can modify the 'wildmode' option to configure the way Vim completes\nfilenames in the command mode. In this case, you can set the 'wildmode'\noption to \"list\": >\n\n    :set wildmode=list\n<\nFor more information, read:\n\n    |'wildmode'|\n\n \t\t\t\t\t\t\t\t*faq-16.6*\n16.6. How do I copy text from a buffer to the command line and from the\n      command line to a buffer?\n\nTo copy text from a buffer to the command line, after yanking the text from\nthe buffer, use \"<CTRL-R>0\" in the command line to paste the text. You can\nalso yank the text to a specific register and use CTRL-R <register> to\npaste the text to the command line.  You can use CTRL-R CTRL-W to paste the\nword under the cursor in the command line.\n\nTo copy text from the command line into a buffer, you can paste the\ncontents of the : register using the \":p command. The most recently\nexecuted command line is stored in the : register.\n\nAnother approach for copying and pasting text to and from the command line\nis to open the command line window using q: from normal mode or CTRL-F from\nthe command-line mode. In the command line window you can use all the Vim\ncommands to edit the command line.\n\nFor more information, read:\n\n    |c_CTRL-R|\n    |quote_:|\n    |cmdline-window|\n\n \t\t\t\t\t\t\t\t*faq-16.7*\n16.7. How do I put a command onto the command history without executing it?\n\nTo put a command onto the command history without executing it, press the\n<Esc> key to cancel the command.\n\nAn alternative solution, is to use the histadd() function like this: >\n\n    :call histadd(':', 'echo strftime(\"%c\")')\n<\nFor more information, read:\n\n    |c_<Esc>|\n    |histadd()|\n\n \t\t\t\t\t\t\t\t*faq-16.8*\n16.8. How do I increase the height of the command-line?\n\nYou can increase the height of the command-line by changing the 'cmdheight'\noption: >\n\n    :set cmdheight=2\n<\nFor more information, read:\n\n    |'cmdheight'|\n    |hit-enter|\n    |05.7|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-17*\nSECTION 17 - VIMINFO ~\n\n \t\t\t\t\t\t\t\t*faq-17.1*\n17.1. When I invoke Vim, I get error messages about illegal characters in\n      the viminfo file. What should I do to get rid of these messages?\n\nYou can remove the $HOME/.viminfo or the $HOME/_viminfo file to get rid of\nthese error messages.\n\nFor more information, read:\n\n    |viminfo-errors|\n    |viminfo-file-name|\n    |viminfo|\n    |21.3|\n\n \t\t\t\t\t\t\t\t*faq-17.2*\n17.2. How do I disable the viminfo feature?\n\nBy default, the viminfo feature is disabled. If the viminfo feature is\nenabled by a system-wide vimrc file, then you can disable the viminfo\nfeature by setting the 'viminfo' option to an empty string in your local\n.vimrc file: >\n\n    :set viminfo=\"\"\n<\nFor more information, read:\n\n    |'viminfo'|\n\n \t\t\t\t\t\t\t\t*faq-17.3*\n17.3. How do I save and use Vim marks/commands across Vim sessions?\n\nYou can save and restore Vim marks across Vim sessions using the viminfo\nfile. To use the viminfo file, make sure the 'viminfo' option is not empty.\nTo save and restore Vim marks, the 'viminfo' option should not contain the\n\"f\" flag or should have a value greater than zero for the \"f\" option.\n\nYou can also use the viminfo file to synchronize the commandline history\nacross different sessions using `:wvimfo` and `:rviminfo` commands together\nwith the FocusGained and FocusLost autocommands: >\n\n    augroup viminfo\n        au!\n        au FocusLost   * wviminfo\n        au FocusGained * rviminfo\n    augroup end\n<\nNote, this will only work reliably, when Vim can detect the FocusLost\nand FocusGained autocommands correctly. This means it should work with\nGVim but might depend on your terminal for konsole vim.\n\nFor more information, read:\n\n    |21.3|\n    |viminfo|\n    |'viminfo'|\n    |:wviminfo|\n    |:rviminfo|\n    |FocusLost|\n    |FocusGained|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-18*\nSECTION 18 - REMOTE EDITING ~\n\n \t\t\t\t\t\t\t\t*faq-18.1*\n18.1. How do I open a file with existing instance of gvim? What happened to\n      the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n\nStarting with Vim6, the OLE version of OpenWithVim.exe and SendToVim.exe\nVim utilities are replaced by the new client-server feature. To open the\nfile j.txt with an existing instance of Gvim (MyVim), use: >\n\n    $ gvim --servername MyVim --remote-silent j.txt\n<\nTo list the server names of all the currently running Vim instances, use >\n\n    $ vim --serverlist\n<\nTo get more information about client-server feature, read\n\n    |client-server|\n\n \t\t\t\t\t\t\t\t*faq-18.2*\n18.2. How do I send a command to a Vim server to write all buffers to disk?\n\nYou can use the Vim remote server functionality to do this: >\n\n    $ gvim --servername myVIM --remote-send \"<C-\\><C-N>:wall<CR>\"\n<\nFor more information, read:\n\n    |client-server|\n    |CTRL-\\_CTRL-N|\n    |:wall|\n\n \t\t\t\t\t\t\t\t*faq-18.3*\n18.3. Where can I get the documentation about the Vim remote server\n      functionality?\n\nYou can get more information about the Vim remote server functionality by\nreading\n\n    |client-server|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-19*\nSECTION 19 - OPTIONS ~\n\n \t\t\t\t\t\t\t\t*faq-19.1*\n19.1. How do I configure Vim in a simple way?\n\nYou can use the `:options` command to open the Vim option window: >\n\n    :options\n<\nThis window can be used for viewing and setting all the options.\n\nFor more information, read:\n\n    |:options|\n\n \t\t\t\t\t\t\t\t*faq-19.2*\n19.2. How do I toggle the value of an option?\n\nYou can prefix the option with \"inv\" to toggle the value of the option: >\n\n    :set invignorecase\n    :set invhlsearch\n<\nYou can also suffix the option with \"!\" to toggle the value: >\n\n    :set ignorecase!\n    :set hlsearch!\n<\nFor more information, read:\n\n    |set-option|\n\n \t\t\t\t\t\t\t\t*faq-19.3*\n19.3. How do I set an option that affects only the current buffer/window?\n\nSome of the Vim options can have a local or global value. A local value\napplies only to a specific buffer or window. A global value applies to all\nthe buffers or windows.\n\nWhen a Vim option is modified using the `:set` command, both the global and\nlocal values for the option are changed. You can use the `:setlocal`\ncommand to modify only the local value for the option and the `:setglobal`\ncommand to modify only the global value.\n\nYou can use the `:setlocal` command to set an option that will affect only\nthe current file/buffer: >\n\n    :setlocal textwidth=70\n<\nNote that not all options can have a local value. You can use `:setlocal`\ncommand to set an option locally to a buffer/window only if the option is\nallowed to have a local value.\n\nYou can also use the following command to set an option locally: >\n\n    :let &l:{option-name} = <value>\n<\nFor more information, read:\n\n    |:setlocal|\n    |local-options|\n\n \t\t\t\t\t\t\t\t*faq-19.4*\n19.4. How do I use space characters for a Vim option value?\n\nTo use space characters in a Vim option value, you have to escape the space\ncharacter. For example: >\n\n    :set tags=tags\\ /usr/tags\n<\nFor more information, read:\n\n    |option-backslash|\n\n \t\t\t\t\t\t\t\t*faq-19.5*\n19.5. Can I add (embed) Vim option settings to the contents of a file?\n\nYou can use modelines to add Vim option settings to the contents of a file.\nFor example, in a C file, you can add the following line to the top or the\nbottom of the file: >\n\n    /* vim:sw=4: */\n<\nThis will set the 'shiftwidth' option to 4, when editing that C file.\nFor this to work, the 'modeline' option should be set. By default, the\n'modeline' option is set. An alternative example is given in this document\nin the first line.\n\nThe 'modelines' settings specifies the number of\nlines that will be checked for the Vim set commands.\n\nFor more information, read:\n\n    |21.6|\n    |modeline|\n    |auto-setting|\n    |'modeline'|\n    |'modelines'|\n\n \t\t\t\t\t\t\t\t*faq-19.6*\n19.6. How do I display the line numbers of all the lines in a file?\n\nYou can set the 'number' option to display the line numbers for all the\nlines. >\n\n    :set number\n<\nFor more information, read:\n\n    |'number'|\n\n \t\t\t\t\t\t\t\t*faq-19.7*\n19.7. How do I change the width of the line numbers displayed using the\n      'number' option?\n\nYou can set the minimum number of columns to be used for line numbering by\nsetting the 'numberwidth' option: >\n\n    :set numberwidth=3\n<\nThis set's the width for the line number to 3 digits, which is enough, if\nyour buffer contains less than 999 lines. However, if your current buffer\ncontains more lines than 999, the 'numberwidth' will be adjusted accordingly,\nso that the maximum line number will fit on the screen.\n\n \t\t\t\t\t\t\t\t*faq-19.8*\n19.8. How do I display (view) all the invisible characters like space, tabs\n      and newlines in a file?\n\nYou can set the 'list' option to see all the invisible characters in your\nfile. >\n\n    :set list\n<\nWith this option set, you can view space characters, tabs, newlines,\ntrailing space characters and wrapped lines.\n\nTo not display the invisible characters (which is the default), you have to\nreset the 'list' option: >\n\n    :set nolist\n    (or)\n    :set list!\n<\nThe `:set list!` command will toggle the current setting of the boolean\n'list' option.\n\nYou can modify the 'listchars' option to configure how and which invisible\ncharacters are displayed. For example, with the following command all the\ntrailing space characters will be displayed with a \".\" character. >\n\n    :set listchars=trail:.\n<\nFor more information, read:\n\n    |'listchars'|\n    |'list'|\n\n \t\t\t\t\t\t\t\t*faq-19.9*\n19.9. How do I configure Vim to always display the current line and column\n      number?\n\nYou can set the 'ruler' option to display current column and line number in\nthe status line: >\n\n    :set ruler\n<\nFor more information, read:\n\n    |'ruler'|\n\n \t\t\t\t\t\t\t\t*faq-19.10*\n19.10. How do I display the current Vim mode?\n\nYou can set the 'showmode' option to display the current Vim mode. In\nInsert, Replace and Visual modes, Vim will display the current mode on the\nlast line. >\n\n    :set showmode\n<\nFor more information, read:\n\n    |'showmode'|\n\n \t\t\t\t\t\t\t\t*faq-19.11*\n19.11. How do I configure Vim to show pending/partial commands on the\n       status line?\n\nYou can set the 'showcmd' option to display pending/partial commands in the\nstatus line: >\n\n    :set showcmd\n<\nFor more information, read:\n\n    |'showcmd'|\n\n \t\t\t\t\t\t\t\t*faq-19.12*\n19.12. How do I configure the Vim status line to display different\n       settings/values?\n\nYou can set the 'statusline' option to display different values/settings in\nthe Vim status line.\n\nFor more information, read:\n\n    |'statusline'|\n    |'laststatus'|\n    |'rulerformat'|\n    |'ruler'|\n\n \t\t\t\t\t\t\t\t*faq-19.13*\n19.13. How do I configure Vim to display status line always?\n\nYou can set the 'laststatus' option to 2 to display the status line always. >\n\n    :set laststatus=2\n<\nFor more information, read:\n\n    |'laststatus'|\n\n \t\t\t\t\t\t\t\t*faq-19.14*\n19.14. How do I make a Vim setting persistent across different Vim\n       invocations/instances/sessions?\n\nTo make a Vim option setting persistent across different Vim instances, add\nyour setting to the .vimrc or .gvimrc file. You can also use the `:mkvimrc`\ncommand to generate a vimrc file for the current settings.\n\nFor more information, read:\n\n    |save-settings|\n    |vimrc|\n    |gvimrc|\n    |vimrc-intro|\n    |:mkvimrc|\n    |initialization|\n\n \t\t\t\t\t\t\t\t*faq-19.15*\n19.15. Why do I hear a beep (why does my window flash) about 1 second after\n       I hit the Escape key?\n\nThis is normal behavior. If your window flashes, then you've got the visual\nbell on. Otherwise, you should hear a beep.\n\nVim needs a timeout to tell the difference between a simple escape and,\nsay, a cursor key sequence.  When you press a key in normal mode (and even\nin insert mode) and that key is the beginning of a mapping, Vim waits a\ncertain amount of time to see if the rest of the mapping sequence follows.\nIf the mapping sequence is completed before a given timeout period, the\nmapping for that sequence of keys is applied. If you interrupt the mapping,\nthe normal actions associated with the keys are executed.\n\nFor example, if you have a mapping defined as `:imap vvv Vim is great!!`\nand you type \"vvv\" quickly, the \"Vim is great!!\" will be inserted into your\ntext. But if you type \"vv v\" then that is what will put into your text.\nThis is also true if you type \"vvv\" too slowly where \"too slowly\" is longer\nthan the value for the timeout option. Setting the timeout option to a\nlarger value can help alleviate problems that appear when using function\nkeys over a slow line.\n\nFor more information, read:\n\n    |'ttimeout'|\n\n \t\t\t\t\t\t\t\t*faq-19.16*\n19.16. How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n       deleting the characters I'm changing?\n\nTo make the \"c\" and \"s\" commands display a \"$\" instead of deleting the\ncharacters, add the $ flag to the 'cpoptions' option: >\n\n    :set cpoptions+=$\n<\nFor more information, read:\n\n    |'cpoptions'|\n\n \t\t\t\t\t\t\t\t*faq-19.17*\n19.17. How do I remove more than one flag using a single `:set` command\n       from a Vim option?\n\nYou can remove more than one flag from a Vim option using a single `:set`\ncommand, by specifying the flags in exactly the same order as they appear\nin the option. For example, if you use the following command to remove the\n\"t\" and \"n\" flags from the 'formatoptions' option: >\n\n    :set formatoptions-=tn\n<\nThe \"t\" and \"n\" flags will be removed from the 'formatoptions' option, only\nif the 'formatoptions' option contains these flags in this order: \"tn\".\nOtherwise, it will not remove the flags. To avoid this problem, you can\nremove the flags one by one: >\n\n    :set formatoptions-=t formatoptions-=n\n<\nFor more information, read:\n\n    |:set-=|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-20*\nSECTION 20 - MAPPING KEYS ~\n\n \t\t\t\t\t\t\t\t*faq-20.1*\n20.1. How do I know what a key is mapped to?\n\nTo see what a key is mapped to, use the following commands: >\n\n    :map <key>\n    :map! <key>\n<\nYou can also check the mappings in a particular mode using one of the\n`:cmap`, `:nmap`, `:vmap`, `:imap`, `:omap`, etc commands.\n\nTo find out, where the key has been mapped, prefix the `:verbose` command: >\n\n    :verbose :map <key>\n<\nFor more information, read:\n\n    |map-listing|\n    |map-overview|\n\n \t\t\t\t\t\t\t\t*faq-20.2*\n20.2. How do I list all the user-defined key mappings?\n\nYou can list all the user-defined key mappings using: >\n\n    :map\n<\nFor more information, read:\n\n    |map-listing|\n\n \t\t\t\t\t\t\t\t*faq-20.3*\n20.3. How do I unmap a previously mapped key?\n\nYou can unmap a previously mapped key using the `:unmap` command: >\n\n    :unmap <key>\n    :unmap! <key>\n<\nFor mode specific mappings, you can use one of the these commands: >\n\n    :nunmap\n    :vunmap\n    :ounmap\n    :iunmap\n    :lunmap\n    :cunmap\n<\nThe following command will fail to unmap a buffer-local mapped key: >\n\n    :unmap <key>\n<\nTo unmap a buffer-local mapped key, you have to use the <buffer> keyword in\nthe unmap command: >\n\n    :unmap <buffer> <key>\n    :unmap! <buffer> <key>\n<\nFor more information, read:\n\n    |:unmap|\n    |map-modes|\n    |:map-local|\n    |mapleader|\n\n \t\t\t\t\t\t\t\t*faq-20.4*\n20.4. I am not able to create a mapping for the <xxx> key. What is wrong?\n\n1) First make sure, the key is passed correctly to Vim. To determine if\n   this is the case, put Vim in Insert mode and then hit CTRL-V (or\n   CTRL-Q if your CTRL-V is remapped to the paste operation (e.g. on\n   Windows if you are using the mswin.vim script file) followed by your\n   key.\n\n   If nothing appears in the buffer (and assuming that you have\n   'showcmd' on, ^V remains displayed near the bottom right of the Vim\n   screen), then Vim doesn't get your key correctly and there is nothing\n   to be done, other than selecting a different key for your mapping or\n   using GVim, which should recognise the key correctly.\n\n2) Possibly, Vim gets your key, but sees it as no different than\n   something else. Say you want to map <Ctrl-Right>, then in Insert mode\n   hit CTRL-K followed by <Ctrl-Right>. If Vim displays <C-Right> it has\n   correctly seen the keystroke and you should be able to map it (by\n   using <C-Right> as your {lhs}). If it displays <Right> it has seen\n   the keystroke but as if you hadn't held <Ctrl> down: this means your\n   temrinal passes <Ctrl-Right> as if it were just <Right>. Anything else\n   means the key has been misidentified.\n\n3) If the key is seen, but not as itself and not as some recognizable\n   key, then there is probably an error in the terminal library for the\n   current terminal (termcap or terminfo database). In that case >\n\n        :set term?\n<\n   will tell you which termcap or terminfo Vim is using. You can try to\n   tell vim, what termcode to use in that terminal, by adding the\n   following to your vimrc: >\n\n        if &term == <termname>\n            set <C-Right>=<keycode>\n        endif\n<\n   where <termname> above should be replaced by the value of 'term'\n   (with quotes around it) and <keycode> by what you get when hitting\n   CTRL-V followed by <Ctrl-Right> in Insert mode (with nothing around\n   it). <C-Right> should be left as-is (9 characters). Don't forget that\n   in a `:set` command, white space is not allowed between the equal sign\n   and the value, and any space, double quote, vertical bar or backslash\n   present as part of the value must be backslash-escaped.\n\n   Now you should be able to see the keycode corresponding to the key\n   and you can create a mapping for the key using the following command: >\n\n        :map <C-Right>  <your_command_to_be_mapped>\n<\nFor more information, read:\n\n    |map-keys-fails|\n    |:map-special-keys|\n    |key-codes|\n\n \t\t\t\t\t\t\t\t*faq-20.5*\n20.5. Why does mapping the <C-...> key not work?\n\nThe only <Ctrl>-<printable-key> chords which Vim can reliably detect\n(because they are defined in the ASCII standard) are the following: >\n\n        CTRL-@                 0x00            NUL\n        CTRL-A to CTRL-Z       0x01 to 0x1A\n        CTRL-a to CTRL-z       0x01 to 0x1A\n        CTRL-[                 0x1B            ESC\n        CTRL-\\                 0x1C\n        CTRL-]                 0x1D\n        CTRL-^                 0x1E\n        CTRL-_                 0x1F\n        CTRL-?                 0x7F            DEL\n<\nMost of these, however, already have a function in Vim (and some are\naliases of other keys: CTRL-H and <BS>, CTRL-I and <Tab>, CTRL-M and <Enter>,\nCTRL-[ and <Esc>, CTRL-? and <Del>).\n\nThe \"safest\" keys to use in Vim for the {lhs} of a mapping are the F\nkeys, with or without Shift: <F2> to <F12> and <S-F1> to <S-F12>. (Some\nOSes, including mine, intercept <Ctrl-Fn> and <Alt-Fn>, which never reach an\napplication program such as vim or gvim).\n\nYou can try other combinations of <Ctrl> + any key, but they may either\nnot work everywhere (e.g. the terminal might not pass that key to Vim,\nor they might have unintended side effects (e.g. mapping <C-I> means\nalso to map <Tab>).\n\nThis is a known issue, that has been discussed and might be implemented\nin the future to enable Vim to distinguish between various keys even in\nconsole mode. (e.g.\nhttps://groups.google.com/d/msg/vim_dev/2bp9UdfZ63M/sajb9KM0pNYJ)\n\n \t\t\t\t\t\t\t\t*faq-20.6*\n20.6. How do I map the numeric keypad keys?\n\nFirst make sure that the numeric keypad keys are passed to Vim. Next, you\ncan use the following command to map the numeric keypad keys: >\n\n    :map <kSomething>  <your_command>\n<\nwhere, <kSomething> can be kHome, kEnd, kPageUp, kPageDown, kPlus, kMinus,\nkDivide, kMultiply, kEnter, etc.\n\nFor more information, read:\n\n    |key-codes|\n    |terminal-options|\n\n \t\t\t\t\t\t\t\t*faq-20.7*\n20.7. How do I create a mapping that works only in visual mode?\n\nYou can create mappings that work only in specific modes (normal, command,\ninsert, visual, etc). To create a mapping that works only in the visual\nmode, use the `:vmap` command: >\n\n    :vmap <F3> <your mapping here>\n<\nThis mapping will work in visual and select mode. If you want the map to\nwork only in visual mode (excluding select mode), use:\n >\n\n    :xmap <F3> <your mapping here>\n<\nand to have the mapping only work in select mode (but not visual mode),\nuse: >\n\n    :smap <F3> <your mapping here>\n<\nFor more information, read:\n\n    |:vmap|\n    |:xmap|\n    |:smap|\n    |map-modes|\n    |40.1|\n\n \t\t\t\t\t\t\t\t*faq-20.8*\n20.8. How do I create a mapping that works only in normal and operator\n   pending mode (but not in visual mode)?\n\nUsing `:map` creates a mapping that works in normal, visual+select mode and\noperator pending mode. You can use `:nmap` to have the mapping only work in\nnormal mode and `:vmap` to have the mapping only be defined for visual and\nselect mode or use `:omap` to have the mapping only defined in operator\npending mode.\n\nBut if you want to have a mapping defined, that works in both operator\npending mode and normal mode, but not in visual and select mode, you need\nto first define the mapping using `:map` and afterwards delete the mapping\nfor visual and select mode:\n\n\t:map <f3> <your mapping here>\n\t:vunmap <f3>\n\n \t\t\t\t\t\t\t\t*faq-20.9*\n20.9. In a Vim script, how do I know which keys to use for my mappings, so\n      that the mapped key will not collide with an already used key?\n\nVim uses most of the keys in the keyboard. You can use the <leader> prefix\nin maps to define keys which will not overlap with Vim keys. For example: >\n\n    :map <leader>S <C-W>s\n    :map <leader>j <C-W>j\n    :map <leader>k <C-W>k\n<\nwhere by default <leader> gets substituted with a backslash (\\), so the\nuser would enter >\n\n        \\s\n        \\j\n        \\k\n<\nto invoke the above map commands. The user can change the mapleader\nvariable to be whatever they wanted: >\n\n    :let mapleader = \",\"\n<\nWhen writing a plugin or other script, more often than not, it is advisable\nto use `:noremap` instead of `:map` to avoid side effects from user defined\nmappings.\n\nFor more information, read:\n\n    |<Leader>|\n    |<LocalLeader>|\n    |write-plugin|\n\n \t\t\t\t\t\t\t\t*faq-20.10*\n20.10. How do I map the escape key?\n\nYou can map the Escape key to some other key using the `:map` command. For\nexample, the following command maps the escape key to CTRL-O. >\n\n    :map <C-O> <Esc>\n<\n \t\t\t\t\t\t\t\t*faq-20.11*\n20.11. How do I map a key to perform nothing?\n\nYou can map a key to <Nop> to perform nothing when the key is pressed. For\nexample, with the following mappings, the <F7> key will do nothing when\npressed. >\n\n    :map <F7> <Nop>\n    :map! <F7> <Nop>\n<\nFor more information, read:\n\n    |<Nop>|\n    |:map|\n    |:map!|\n    |map-modes|\n\n \t\t\t\t\t\t\t\t*faq-20.12*\n20.12. I want to use the <Tab> key to indent a block of text and <Shift-Tab>\n       key to unindent a block of text. How do I map the keys to do this?\n       This behavior is similar to textpad, visual studio, etc.\n\nUse the following mapping: >\n\n    :inoremap <S-Tab> <C-O><lt><lt>\n    :nnoremap <Tab> >>\n    :nnoremap <S-Tab> <lt><lt>\n    :vnoremap <Tab> >\n    :vnoremap <S-Tab> <lt>\n<\nNote, that the <S-Tab> mapping will work only if Vim receives the correct\nkey sequence. This is mostly the case with GUI Vim.\n\nFor more information, read:\n\n    |:inoremap|\n    |:nnoremap|\n    |:vnoremap|\n    |<S-Tab>|\n    |i_CTRL-O|\n    |>>|\n    |<<|\n    |<lt>|\n\n \t\t\t\t\t\t\t\t*faq-20.13*\n20.13. In my mappings the special characters like <CR> are not recognized.\n       How can I configure Vim to recognize special characters?\n\nCheck the value of the 'cpoptions' option: >\n\n    :set cpoptions?\n<\nIf this option contains the \"<\" flag, then special characters will not be\nrecognized in mappings. Remove the \"<\" flag from 'cpoptions' option: >\n\n    :set cpo-=<\n<\nAlso, check the value of the 'compatible' option: >\n\n    :set compatible?\n<\nThe 'compatible' option must be reset: >\n\n    :set nocompatible\n<\nFor more information, read:\n\n    |'cpoptions'|\n    |'compatible'|\n\n \t\t\t\t\t\t\t\t*faq-20.14*\n20.14. How do I use the \"|\" to separate multiple commands in a map?\n\nYou can escape the \"|\" character using backslash (\\) to use \"|\" in a map. >\n\n    :map _l :!ls \\| more<CR>\n<\nYou can also try the following command: >\n\n    :map _l :!ls <bar> more<CR>\n<\nThere are also other ways to do this.\n\nFor more information, read:\n\n    |map_bar|\n\n \t\t\t\t\t\t\t\t*faq-20.15*\n20.15. If I have a mapping/abbreviation whose ending is the beginning of\n       another mapping/abbreviation, how do I keep the first from expanding\n       into the second one?\n\nInstead of using the `:map lhs rhs` command, use the `:noremap lhs rhs`\ncommand. For abbreviations, use \"noreabbrev lhs rhs\". The \"nore\" prefix\nprevents the mapping or abbreviation from being expanded again.\n\nFor more information, read:\n\n    |:noremap|\n    |:noreabbrev|\n\n \t\t\t\t\t\t\t\t*faq-20.16*\n20.16. Why does it take a second or more for Vim to process a key,\n       sometimes when I press a key?\n\nMake sure you have not defined a mapping for this key using the following\ncommand: >\n\n    :map <key>\n<\nIf a mapping is defined for this key and the mapped key contains more than\none character, then Vim will wait for the next character to be pressed to\ndetermine whether it is the mapped key or not. For example, if you have\nmapped \"ab\", then if you press \"a\", Vim will wait for the next key to be\npressed. If the next key is \"b\", Vim will execute the mapped sequence.\nOtherwise, Vim will proceed with the normal processing of \"a\" followed by\nthe next key. If the 'timeout' option is set (which is the default), then\nVim will timeout after waiting for the period specified with the\n'timeoutlen' option (default is 1 second).\n\nFor more information, read:\n\n    |map-typing|\n    |'timeoutlen'|\n    |'ttimeoutlen'|\n    |'timeout'|\n    |'ttimeout'|\n    |vt100-cursor-keys|\n    |slow-fast-terminal|\n\n \t\t\t\t\t\t\t\t*faq-20.17*\n20.17. How do I map a key to run an external command using a visually\n       selected text?\n\nYou can the `:vmap` command to map a key in the visual mode. In the mapped\ncommand sequence, you have to first yank the text. The yanked text is\navailable in the '\"' register. Now, you can use the contents of this\nregister to run the external command. For example, to run the external\ncommand \"perldoc\" on a visually selected text, you can use the following\nmapping: >\n\n    :vmap <F7> y:!exec \"!perldoc '\" . @\" . \"'\"<CR>\n<\nIf you want the mapping to work in the visual mode, but not with the\nhighlighted text, you can use the following command: >\n\n    :vmap <F7> :<C-U>!perldoc <cword><CR>\n<\nThe above mapping will use the word under the cursor instead of the\nhighlighted text. Note the use of the <C-U> before invoking the \"perldoc\"\nexternal command. The <C-U> is used to erase the range of text selected in\nthe visual mode and displayed on the command line. If the visual range is\nnot removed using <C-U>, then the output from the external command will\nreplace the visually selected text.\n\nFor more information, read:\n\n    |:vmap|\n    |quote_quote|\n    |:let-register|\n    |c_CTRL-U|\n    |:!cmd|\n\n \t\t\t\t\t\t\t\t*faq-20.18*\n20.18. How do I map the CTRL-I key while still retaining the functionality\n       of the <Tab> key?\n\nThe CTRL-I key and the <Tab> key produce the same keycode, so Vim cannot\ndistinguish between the CTRL-I and the <Tab> key. When you map the CTRL-I\nkey, the <Tab> key is also mapped (and vice versa). The same restriction\napplies for the CTRL-[ key and the <Esc> key.\n\nFor more information, read:\n\n    |keycodes|\n\n \t\t\t\t\t\t\t\t*faq-20.19*\n20.19. How do I define a map to accept a count?\n\nUse the @= command to use an expression. For example, >\n\n    nnoremap = @='3l'\n<\nNow you can specify a count to the \"=\" command.\n\n    |complex-repeat|\n\n \t\t\t\t\t\t\t\t*faq-20.20*\n20.20. How can I make my normal mode mapping work from within Insert\n       Mode?\n\nMappings in normal mode can be executed after CTRL-O from insert mode as\nwell but if there are more commands included in the mapping {rhs}, only the\nfirst one will be executed in normal mode and the rest of {rhs} will be\nprinted literally in insert mode. One of ways to workaround this problem is\nto make {rhs} be one command, via wrapping it to the function. For example: >\n\n    function GetFontNameOfFirstChar()\n    normal! 0\n    echo getfontname()\n    endfunction\n<\n    :nmap <F9> :call GetFontNameOfFirstChar()<CR>\n\nA more technical and detailed solution to this problem follows and can\nbe found at https://groups.google.com/group/vim_dev/msg/75f1f2dfc00908bb\n\nNot every normal mode-mapping is automatically suitable for execution via\nCTRL-O from within insert mode; you need to explicitly design your mappings\nfor that purpose.\n\nThe CTRL-O command allows execution of one normal mode command from\nwithin insert mode, then returns to insert mode. If a normal mode mapping\nconcatenates multiple normal mode commands, this breaks down in temporary\nnormal mode and literally inserts the second part of the command into the\nbuffer instead. To support execution of normal mode mappings from within\ninsert mode, these strategies can be used:\n\n1) Instead of concatenating multiple normal mode commands, use one `:normal`\n    mapping: >\n\n    :nnoremap <silent> zC :<C-U>normal! zCVzC<CR>\n<\n2) Concatenate multiple Ex commands via <Bar> on the rhs: >\n\n    :nnoremap zC :<C-U>call MyMap1()<Bar>call MyMap2()<CR>\n<\n3) Shadow normal mode mappings by insert mode mappings that\n    re-enter normal mode, then invoke the normal mode mapping: >\n\n    :nnoremap <silent> <SID>MyMap2 :<C-U>call MyMap2()<CR>\n    :inoremap <silent> <script> <SID>MyMap2 <C-\\><C-O><SID>MyMap2\n    :nnoremap <silent> <script> zC <SID>MyMap1<SID>MyMap2\n<\n4) Normal mode mappings that consist of multiple Ex command lines (and\n    where Ex commands cannot be concatenated via <Bar>) replace `:<C-U>`\n    with <SID>NM; the <SID>NM mapping enters normal mode for one ex command\n    line: >\n\n    :nnoremap <silent> <SID>NM :<C-U>\n    :inoremap <silent> <SID>NM <C-\\><C-O>:\n    :nnoremap <silent> <script> zC <SID>MyMap1<SID>NMcall MyMap2()<CR>\n<\n5)  If none of the above is possible, at least force normal mode for\n    subsequent commands via CTRL-\\ CTRL-N to avoid accidental insertion\n    of the remainder of the mapping. >\n\n    :nnoremap zC zC<C-\\><C-N>VzCzz\n<\n\nFor more information, read:\n\n    |i_CTRL-O|\n    |map_bar|\n    |i_CTRL-\\_CTRL-O|\n    |CTRL-\\_CTRL-N|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-21*\nSECTION 21 - ABBREVIATIONS ~\n\n \t\t\t\t\t\t\t\t*faq-21.1*\n21.1. How do I auto correct misspelled words?\n\nYou can auto correct misspelled words using abbreviations. For example, the\nfollowing abbreviation can be used to correct \"teh\" with \"the\": >\n\n    :abbreviate teh the\n<\nVim supports abbreviations in insert mode, replace mode and command-line\nmode.\n\nFor more information, read:\n\n    |24.7|\n    |abbreviations|\n    |Q_ab|\n\n \t\t\t\t\t\t\t\t*faq-21.2*\n21.2. How do I create multi-line abbreviations?\n\nYou can create multi-line abbreviations by embedding the \"<CR>\"\nkey code in the text: >\n\n    iabbrev #c --------------<CR>-- Date:<CR>--<CR>---------\n<\nWith the above abbreviation, when you type #c, it will be expanded to\nthe following text:\n\n--------------\n-- Date:\n--\n---------\n\nFor more information, read:\n\n    |abbreviations|\n\n \t\t\t\t\t\t\t\t*faq-21.3*\n21.3. When my abbreviations are expanded, an additional space character is\n      added at the end of the expanded text. How do I avoid this character?\n\nTo avoid an additional space character at the end of the expanded text, you\ncan expand the abbreviation by pressing the CTRL-] key.  The abbreviation\nwill be expanded without adding a space character at the end.\n\nAnother alternative is to use the following function and command: >\n\n    function! Eatchar(pat)\n        let c = nr2char(getchar())\n        return (c =~ a:pat) ? '' : c\n    endfunction\n    command! -nargs=+ Iabbr execute \"iabbr\" <q-args> . \"<C-R>=Eatchar('\\\\s')<CR>\"\n<\nNow, define your abbreviations using the new \"Iabbr\" command instead of the\nbuiltin `:iabbrev` command. With this command, after expanding the\nabbreviated text, the next typed space character will be discarded.\n\nFor more information, read:\n\n    |abbreviations|\n\n \t\t\t\t\t\t\t\t*faq-21.4*\n21.4. How do I insert the current date/time stamp into the file?\n\nYou can use the strftime() function to insert the current data/time stamp\nin a file. For example, you can use the following abbreviation: >\n\n    iabbrev dts <C-R>=strftime(\"%y/%m/%d %H:%M\")<CR>\n<\nWith this abbreviation, when you type dts in insert mode, it will be\nexpanded to the date/time stamp.\n\nSome other forms of the above abbreviation are listed below: >\n\n    iabbrev mdyl <C-R>=strftime(\"%a %d %b %Y\")<CR>\n    iabbrev mdys <C-R>=strftime(\"%y%m%d\")<CR>\n    iabbrev mdyc <C-R>=strftime(\"%c\")<CR>\n    iabbrev hml  <C-R>=strftime(\"%d/%m/%y %H:%M:%S\")<CR>\n    iabbrev hms  <C-R>=strftime(\"%H:%M:%S\")<CR>\n<\nFor more information, read:\n\n    |strftime()|\n    |i_CTRL-R|\n\n \t\t\t\t\t\t\t\t*faq-21.5*\n21.5. How do I prevent an abbreviation from expanding in insert mode?\n\nYou can prevent an abbreviation from expanding in insert mode by typing\nCTRL-V before the character after the abbreviated word.\n\nFor more information, read:\n\n    |abbreviations|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-22*\nSECTION 22 - RECORD AND PLAYBACK ~\n\n \t\t\t\t\t\t\t\t*faq-22.1*\n22.1. How do I repeat an editing operation (insertion, deletion, paste,\n      etc)?\n\nYou can repeat the last editing operation using the \".\" command. This will\nrepeat the last simple change like a insert, delete, change, paste, etc.\n\nFor more information, read:\n\n    |04.3|\n    |single-repeat|\n    |Q_re|\n\n \t\t\t\t\t\t\t\t*faq-22.2*\n22.2. How I record and repeat a set of key sequences?\n\nYou can use the \"q\" command in normal mode to record a set of key sequences\nand store it in a register. For example, in the normal mode you can press q\nfollowed by a register name {0-9a-bA-Z\"} to start the recording.  To\nend/stop the recording press q again. You can playback/repeat the recorded\nkey sequences by pressing @ followed by the register name. e.g. @a.\n\nAnother approach is to start Vim with the \"-w\" command-line argument. >\n\n    $ vim -w <file_name>\n<\nVim will record all the characters typed in the session in the\nspecified file \"file_name\". You can use the recorded file with the \"-s\"\ncommand line argument to play it back: >\n\n    $ vim -s <file_name>\n<\nFor more information, read:\n\n    |10.1|\n    |recording|\n    |-w|\n    |-s|\n\n \t\t\t\t\t\t\t\t*faq-22.3*\n22.3. How do I edit/modify a recorded set of key sequences?\n\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer, edit the pasted text and again\nyank the text into the register. You can also use the `:let` command to\nmodify the register. For example: >\n\n    :let @a = \"iHello World\\<Esc>\"\n<\nFor more information, read:\n\n    |recording|\n    |10.1|\n    |:let-register|\n    |<>|\n    |'cpoptions'|\n\n \t\t\t\t\t\t\t\t*faq-22.4*\n22.4. How do I write recorded key sequences to a file?\n\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer. Now you can save the buffer\ninto a file. You can also modify the pasted text and again yank into the\nregister to modify the recorded key sequence. For example, if you record a\nset of key sequences using qa ..... q. The recorded key sequences are\nstored in the register \"a\". You can paste the contents of register \"a\"\nusing \"ap.\n\nFor more information, read:\n\n    |recording|\n    |10.1|\n\n \t\t\t\t\t\t\t\t*faq-22.5*\n22.5. I am using register 0 to record my key sequences (i.e. q0 .... q).\n      In the recorded key sequences, I am yanking some text. After the\n      first replay of the recorded key sequence, I am no longer able to\n      play it back.\n\nRegister 0 contains the text from the last yank operation. In your recorded\nkey sequence, when the yank is performed, register 0 is overwritten with\nthe yanked text. So your recording stored in register 0 is lost. You have\nto use some other register.\n\nFor more information, read:\n\n    |registers|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-23*\nSECTION 23 - AUTOCOMMANDS ~\n\n \t\t\t\t\t\t\t\t*faq-23.1*\n23.1. How do I execute a command when I try to modify a read-only file?\n\nYou can use the FileChangedRO autocommand event to execute a command when a\nread-only file is modified. For example, you can use this event to checkout a\nread-only file: >\n\n    :autocmd FileChangedRO * call MyCheckoutFunction()\n<\nFor more information, read:\n\n    |FileChangedRO|\n\n \t\t\t\t\t\t\t\t*faq-23.2*\n23.2. How do I execute a command every time when entering a buffer?\n\nYou can use the BufEnter autocommand event to execute a command every time\nwhen entering a buffer. For example: >\n\n    :autocmd BufEnter *.c set formatoptions=croqt\n<\nFor more information, read:\n\n    |BufEnter|\n\n \t\t\t\t\t\t\t\t*faq-23.3*\n23.3. How do I execute a command every time when entering a window?\n\nYou can use the WinEnter autocommand event to execute a command every time\nwhen entering a window. For example: >\n\n    :autocmd WinEnter *.c call MyFunction()\n<\nFor more information, read:\n\n    |WinEnter|\n\n \t\t\t\t\t\t\t\t*faq-23.4*\n23.4. From an autocmd, how can I determine the name of the file or the\n      buffer number for which the autocommand is executed?\n\nYou can use the special words <afile> or <abuf> in an autocmd to get the\nname of the file or the buffer number for which the autocommand is\nexecuted.\n\nFor more information, read:\n\n    |:<afile>|\n    |:<abuf>|\n    |:<amatch>|\n\n \t\t\t\t\t\t\t\t*faq-23.5*\n23.5. How do I automatically save all the changed buffers whenever Vim\n      loses focus?\n\nYou can define an autocommand for the FocusLost event which will save all\nthe modified buffers whenever Vim loses focus: >\n\n    :autocmd FocusLost * wall\n<\nFor more information, read:\n\n    |FocusLost|\n    |:wall|\n\n \t\t\t\t\t\t\t\t*faq-23.6*\n23.6. How do I execute/run a function when Vim exits to do some cleanup?\n\nYou can use VimLeave autocmd event to execute a function just before Vim\nexits. For example, >\n\n    :autocmd VimLeave * call MyCleanupFunction()\n<\nFor more information, read:\n\n    |VimLeave|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-24*\nSECTION 24 - SYNTAX HIGHLIGHT ~\n\n \t\t\t\t\t\t\t\t*faq-24.1*\n24.1. How do I turn off/on syntax highlighting?\n\nBy default, the Vim syntax highlighting is turned off. To enable the syntax\nhighlighting, you can use one of the following commands: >\n\n    :syntax enable\n<\n    or >\n\n    :syntax on\n<\nTo disable the syntax highlighting, you can use the following command: >\n\n    :syntax off\n<\nFor more information, read:\n\n    |06.1|\n    |06.4|\n    |:syntax-enable|\n    |:syntax-on|\n    |:syn-clear|\n\n \t\t\t\t\t\t\t\t*faq-24.2*\n24.2. How do I change the background and foreground colors used by Vim?\n\nVim uses the \"Normal\" highlight group for the background and foreground\ncolors. To change the foreground/background colors, you have to modify the\n\"Normal\" highlight group. For example, to set the background color to blue\nand foreground color to white, you can use >\n\n    :highlight Normal ctermbg=blue ctermfg=white guibg=blue guifg=white\n<\nIf you are using the Motif or the Athena version of the GUI Vim, then you\ncan modify the foreground and background resource names in the .Xdefaults\nfiles to change the colors: >\n\n    Vim.foreground:     Black\n    Vim.background:     Wheat\n<\nYou can also use the \"-foreground\" and \"-background\" command-line arguments\nto specify the foreground and background colors. These arguments are\nsupported only in the Motif or Athena versions: >\n\n    $ gvim -foreground Black -background Wheat\n<\nFor more information, read:\n\n    |:highlight|\n    |.Xdefaults|\n    |-gui|\n\n \t\t\t\t\t\t\t\t*faq-24.3*\n24.3. How do I change the highlight colors to suit a dark/light background?\n\nYou can set the 'background' option to either \"dark\" or \"light\" to change\nthe highlight colors to suit a dark/light background: >\n\n    :set background=dark\n<\nFor more information, read:\n\n    |'background'|\n    |06.2|\n\n \t\t\t\t\t\t\t\t*faq-24.4*\n24.4. How do I change the color of the line numbers displayed when the\n      `:set number` command is used?\n\nThe line numbers displayed use the LineNr highlighting group. To display\nthe current colors used, use >\n\n    :hi LineNr\n<\nTo change the color modify the LineNr highlight group. For example: >\n\n    :hi linenr guifg=red guibg=black\n<\nThis will give red numbers on a black background in GVIM.\n\nFor more information, read:\n\n    |:highlight|\n\n \t\t\t\t\t\t\t\t*faq-24.5*\n24.5. How do I change the background color used for a Visually selected\n      block?\n\nYou can modify the \"Visual\" highlight group to change the color used for a\nvisually selected block: >\n\n    :highlight Visual guibg=red\n<\nFor more information, read:\n\n    |:highlight|\n    |hl-Visual|\n\n \t\t\t\t\t\t\t\t*faq-24.6*\n24.6. How do I highlight the special characters (tabs, trailing spaces, end\n      of line, etc) displayed by the 'list' option?\n\nYou can modify the \"NonText\" and \"SpecialKey\" highlight groups to highlight\nthe special characters displayed by the 'list' option: >\n\n    :highlight NonText guibg=red\n    :highlight SpecialKey guibg=green\n<\nThe \"NonText\" highlighting group is used for \"eol\", \"extends\" and\n\"precedes\" settings in the 'listchars' option.  The \"SpecialKey\"\nhighlighting group is used for the \"tab\" and \"trail\" settings.\n\nFor more information, read:\n\n    |'listchars'|\n    |hl-NonText|\n    |hl-SpecialKey|\n\n \t\t\t\t\t\t\t\t*faq-24.7*\n24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that Vim\n      uses the specified colorscheme every time?\n\nYou can specify the color scheme using the `:colorscheme` command in your\n.vimrc or .gvimrc file: >\n\n    colorscheme evening\n<\nFor more information, read:\n\n    |:colorscheme|\n\n \t\t\t\t\t\t\t\t*faq-24.8*\n24.8. Vim syntax highlighting is broken. When I am editing a file, some\n      parts of the file is not syntax highlighted or syntax highlighted\n      incorrectly.\n\nVim doesn't read the whole file to parse the text for syntax highlighting.\nIt starts parsing wherever you are viewing the file. That saves a lot of\ntime, but sometimes the colors are wrong. A simple fix is refreshing the\nscreen using the CTRL-L key. Or scroll back a bit and then forward again.\nYou can also use the command: >\n\n    :syntax sync fromstart\n<\nNote that this might considerably slow down the screen refreshing.\n\nFor more information, read:\n\n    |:syn-sync|\n    |:syn-sync-first|\n\n \t\t\t\t\t\t\t\t*faq-24.9*\n24.9. Is there a built-in function to syntax-highlight the corresponding\n      matching bracket?\n\nYes. Vim includes the matchparen Plugin as standard plugin that is enabled\nby default. Whenever the cursor moves over an item defined with the\n'matchpairs' option, Vim will highlight the corresponding bracket using the\nMatchParen highlighting group.\n\nHowever, if the corresponding parenthesis is not visible in the current\nwindow, the cursor won't jump to it.\n\nThe matchit plugin provides a similar function, that lets the cursor\njump to related items (e.g. \"if\", \"else\", \"endif\" items) and skips\nmatches in comments. This uses the % command to jump to corresponding\nitems. Though both plugins provide similar functions they are unrelated\nand work differently.\n\nFor more information, read:\n\n    |matchparen|\n    |'matchpairs'|\n    |matchit-install|\n    |matchit-intro|\n\n \t\t\t\t\t\t\t\t*faq-24.10*\n24.10. How do I turn off the C comment syntax highlighting?\n\nYou can use the following command to turn off C comment syntax\nhighlighting: >\n\n    :highlight clear comment\n<\nFor more information, read:\n\n    |ft-c-syntax|\n\n \t\t\t\t\t\t\t\t*faq-24.11*\n24.11. How do I add my own syntax extensions to the standard syntax files\n       supplied with Vim?\n\nYou should not modify the syntax files supplied with Vim to add your\nextensions. When you install the next version of Vim, you will lose your\nchanges. Instead you should create a file under the ~/.vim/after/syntax\ndirectory with the same name as the original syntax file and add your\nadditions to this file.\n\nFor more information, read:\n\n    |mysyntaxfile-add|\n    |'runtimepath'|\n\n \t\t\t\t\t\t\t\t*faq-24.12*\n24.12. How do I replace a standard syntax file that comes with the Vim\n       distribution with my own syntax file?\n\nYou can replace a standard syntax file that comes with the Vim distribution\nby creating a file with the same name as the original syntax file and\nplacing it in the vim runtime syntax (~/.vim/syntax) directory. For\nexample, to replace the c.vim syntax file in a Unix system, place the new\nc.vim in the ~/.vim/syntax directory. In a MS-Windows system, place the new\nsyntax file in the $HOME/vimfiles/syntax or $VIM/vimfiles/syntax directory.\n\nFor more information, read:\n\n    |mysyntaxfile-replace|\n    |44.11|\n    |mysyntaxfile|\n\n \t\t\t\t\t\t\t\t*faq-24.13*\n24.13. How do I highlight all the characters after a particular column?\n\nYou can use the `:match` command to highlight all the characters after a\nparticular column: >\n\n    :match Todo '\\%>75v.\\+'\n<\nThis will highlight all the characters after the 75th column.\n\nYou can also set the 'colorcolumn' option to highlight a particular\ncolumn:\n\n   :set colorcolumn=+2\n\nwhich highlights 2 columns after the current 'textwidth' setting\n(alternatively, you can use the exact column number).\n\nFor more information, read:\n\n    |:match|\n    |/\\%v|\n    |/\\+|\n    |/.|\n    |'colorcolumn'|\n\n \t\t\t\t\t\t\t\t*faq-24.14*\n24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n       highlighting into a HTML file?\n\nYou can use the 2html.vim script to convert a source file into a HTML file\nwith the Vim syntax highlighting. Use the following command: >\n\n    :TOhtml\n<\nFor more information, read:\n\n    |convert-to-HTML|\n    |:TOhtml|\n\n \t\t\t\t\t\t\t\t*faq-24.15*\n24.15. How do I list the definition of all the current highlight groups?\n\nYou can list the definition of all the current highlight groups using the\n`:highlight` (without any arguments) ex command.\n\nFor more information, read:\n\n    |:highlight|\n\n \t\t\t\t\t\t\t\t*faq-24.16*\n24.16. How can I embed one syntax highlighting language into another one?\n\nIt is possible to include one syntax highlighting into another one,\nhowever most of the currently deployed syntax highlighting scripts are\nnot prepared to be included into another syntax script.\n\nYou can however create your own custom script to define your own\nregions, which will be highlighted with a different language.\n\nSee the wiki for a comprehensive solution:\n\n    http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file\n\nFor more information, read:\n\n    |:syn-include|\n    |sh-awk|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-25*\nSECTION 25 - VIM SCRIPT WRITING ~\n\n \t\t\t\t\t\t\t\t*faq-25.1*\n25.1. How do I list the names of all the scripts sourced by Vim?\n\nYou can use the `:scriptnames` command to list the names of all the scripts\nsourced by Vim: >\n\n    :scriptnames\n<\nFor more information, read:\n\n    |:scriptnames|\n\n \t\t\t\t\t\t\t\t*faq-25.2*\n25.2. How do I debug Vim scripts?\n\nVim has built-in support for a primitive debugger to debug Vim plugins and\nscripts. Using this debugger you can set breakpoints and step through the\nplugin functions.\n\nFor more information, read:\n\n    |debug-scripts|\n    |-D|\n\n \t\t\t\t\t\t\t\t*faq-25.3*\n25.3. How do I locate the script/plugin which sets a Vim option?\n\nYou can use the `:verbose` command to locate the plugin/script which last\nmodified a Vim option. For example: >\n\n    :verbose set textwidth?\n<\nFor more information, read:\n\n    |:set-verbose|\n    |:verbose|\n\n \t\t\t\t\t\t\t\t*faq-25.4*\n25.4. I am getting some error/informational messages from Vim (possibly\n      when running a script), the messages are cleared immediately. How do\n      I display the messages again?\n\nYou can use the `:messages` command to display the previous messages. >\n\n    :messages\n<\nFor more information, read:\n\n    |:messages|\n    |:echoerr|\n    |:echomsg|\n    |message-history|\n\n \t\t\t\t\t\t\t\t*faq-25.5*\n25.5. How do I save and restore a plugin specific information across Vim\n      invocations?\n\nVim will save and restore global variables that start with an uppercase\nletter and don't contain a lower case letter. For this to work, the\n'viminfo' option must contain the \"!\" flag. Vim will store the variables in\nthe viminfo file.\n\nFor more information, read:\n\n    |'viminfo'|\n    |viminfo-file|\n    |variables|\n\n \t\t\t\t\t\t\t\t*faq-25.6*\n25.6. How do I start insert mode from a Vim function?\n\nYou can use the `:startinsert` command to start the insert mode from inside\na Vim function.\n\nFor more information, read:\n\n    |:startinsert|\n\n \t\t\t\t\t\t\t\t*faq-25.7*\n25.7. How do I change the cursor position from within a Vim function?\n\nYou can use the cursor() function to position the cursor. >\n\n        call cursor(lnum, col)\n<\nAlternatively, use the setpos() function: >\n\n        call setpos('.', [bufnum, lnum, col, off])\n<\nwhich set's the cursor in the buffer bufnum to line lnum, column col and\noffset for 'virtualedit'. You can use the getpos() function, to return a\nlist with these values, that can then be fed back to the setpos() function.\n\nIf you want to save and restore the viewpoint on a window, use the\nwinsaveview() and winrestview() function calls.\n\nYou can also use the following command to change the cursor position: >\n\n        exe \"normal! \" . lnum . \"G\" . col . \"|\"\n<\nFor more information, read:\n\n    |cursor()|\n    |bar|\n    |getpos()|\n    |setpos()|\n    |winsaveview()|\n    |winrestview()|\n\n \t\t\t\t\t\t\t\t*faq-25.8*\n25.8. How do I check the value of an environment variable in the .vimrc\n      file?\n\nYou can use prefix the environment variable name with the \"$\" character to\nuse it from a Vim script/function.  You can refer to the value of an\nenvironment variable using the $env_var syntax: >\n\n    if $EDITOR == 'vi'\n    endif\n<\nFor more information, read:\n\n    |expr-env|\n\n \t\t\t\t\t\t\t\t*faq-25.9*\n25.9. How do I check whether an environment variable is set or not from a\n      Vim function?\n\nYou can use the exists() function to check for the existence of an\nenvironment variable. >\n\n    if exists(\"$MY_ENV_VAR\")\n    endif\n<\nFor more information, read:\n\n    |exists()|\n    |expr-env|\n\n \t\t\t\t\t\t\t\t*faq-25.10*\n25.10. How do I call/use the Vim built-in functions?\n\nYou can use the `:call` command to invoke a Vim built-in function: >\n\n    :call cursor(10,20)\n<\nYou can use the `:echo` command to echo the value returned by a function: >\n\n    :echo char2nr('a')\n<\nYou can use the `:let` command to assign the value returned by a function\nto a variable: >\n\n    :let a = getline('.')\n<\nTo store the return value from a function into a Vim register, you can use\nthe following command: >\n\n    :let @a = system('ls')\n<\nThe above command will store the output of the \"ls\" command into\nthe register \"a\".\n\nFor more information, read:\n\n    |:call|\n    |:echo|\n    |:let|\n    |:let-register|\n    |user-functions|\n    |usr_41.txt|\n\n \t\t\t\t\t\t\t\t*faq-25.11*\n25.11. I am using some normal mode commands in my Vim script. How do I\n       avoid using the user-defined mappings for these normal mode commands\n       and use the standard Vim functionality for these normal mode\n       commands?\n\nYou can use the `:normal!` command in your script to invoke a normal-mode\ncommand. This will use the standard functionality of the normal mode\ncommand and will not use the user-defined mapping.\n\nFor more information, read:\n\n    |:normal|\n\n \t\t\t\t\t\t\t\t*faq-25.12*\n25.12. How do I get the current visually selected text into a Vim variable\n       or register?\n\nYou can get the current visually selected text into a Vim variable by\nyanking the text into Vim register and then assigning the contents of the\nregister into the variable: >\n\n    :normal! gvy\n    :let myvar = @\"\n<\nThe above command copies the visually selected text into the variable\n\"myvar\".\n\nYou can also use the command: >\n\n    :normal! gv\"*y\n<\nIn the above command, gv reselects the last visually selected text and the\nrest of the command copies the selected text into the * (clipboard)\nregister. Alternatively, you can set the \"a\" flag in the 'guioptions'\noption to automatically copy a visually selected text into the * register.\nTo do this as part of a visual map, you can use a command similar to the\none shown below: >\n\n    :vmap <F3> \"*y:call ...\n<\n\nFor more information, read:\n\n    |gv|\n    |:normal|\n    |:let-@|\n    |quotestar|\n    |clipboard|\n    |registers|\n\n \t\t\t\t\t\t\t\t*faq-25.13*\n25.13. I have some text in a Vim variable \"myvar\". I would like to use this\n       variable in a `:s` substitute command to replace a text \"mytext\".\n       How do I do this?\n\nYou can use the `:execute` command to evaluate the variable: >\n\n    :execute '%s/mytext/' . myvar . '/'\n<\nFor more information, read:\n\n    |:execute|\n\nYou can also use \"\\=\" in the substitute command to evaluate the variable: >\n\n    :%s/mytext/\\=myvar/\n<\nFor more information, read:\n\n    |sub-replace-special|\n\n \t\t\t\t\t\t\t\t*faq-25.14*\n25.14. A Vim variable (bno) contains a buffer number. How do I use this\n       variable to open the corresponding buffer?\n\nThe `:buffer` command will not accept a variable name. It accepts only a\nbuffer number or buffer name. You have to use the `:execute` command to\nevaluate the variable into the corresponding value. For example: >\n\n    :execute \"buffer \" . bno\n<\nFor more information, read:\n\n    |:execute|\n\n \t\t\t\t\t\t\t\t*faq-25.15*\n25.15. How do I store the value of a Vim option into a Vim variable?\n\nYou can prefix the option name with the \"&\" character and assign the option\nvalue to a Vim variable using the `:let` command. For example, to store the\nvalue of the 'textwidth' option into the Vim variable \"old_tw\", you can use\nthe following command: >\n\n    :let old_tw = &tw\n<\nTo explicitly save buffer local options, use the prefix \"l:\" >\n\n    :let old_tw = &l:tw\n<\nIf you want to explicitly select the global option, use the \"g:\" prefix to\nthe option name.\n\nTo do the opposite, to set the 'textwidth' option with the value stored in\nthe \"old_tw\" variable, you can use the following command: >\n\n    :let &tw = old_tw\n<\nFor more information, read:\n\n    |expr-option|\n    |:let-option|\n\n \t\t\t\t\t\t\t\t*faq-25.16*\n25.16. I have copied and inserted some text into a buffer from a Vim\n       function. How do I indent the inserted text from the Vim function?\n\nYou can use the following command to format the just inserted text: >\n\n    :normal '[=']\n<\nFor more information, read:\n\n    |'[|\n    |']|\n    |=|\n    |:normal|\n\n \t\t\t\t\t\t\t\t*faq-25.17*\n25.17. How do I get the character under the cursor from a Vim script?\n\nYou can use the getline() function and use string index [] to get the\ncharacter: >\n\n    :echo getline(\".\")[col(\".\") - 1]\n<\nIn the above command, getline(\".\") returns  the text in the current line.\nThe indexing of the string starts at zero, and you can get a single\ncharacter in a string by its index with the \"string[index]\" notation. The\ncol(\".\") returns the column of the cursor position; the adjustment is to\nget the right character of the string. However, this does NOT work with\nmultibyte characters as this command only returns the byte index.\n\nAlternatively, you can use the following sequence of commands to get the\ncharacter under the cursor: >\n\n    normal! vy\n    let ch=@\"\n<\nNote, that the above commands will change the '< and '> marks.\n\nFor more information, read:\n\n    |getline()|\n    |col()|\n    |expr-[]|\n\n \t\t\t\t\t\t\t\t*faq-25.18*\n25.18. How do I get the name of the current file without the extension?\n\nYou can get the name of the current file without the extension using: >\n\n    :echo expand(\"%:r\")\n<\nWith some commands, you can use the file name modifiers directly: >\n\n    :cd %:p:h\n    :!gcc -o %:r.o %\n    :!xpdf %<.pdf\n<\nFor more information, read:\n\n    |filename-modifiers|\n    |expand()|\n    |cmdline-special|\n    |fnamemodify()|\n\n \t\t\t\t\t\t\t\t*faq-25.19*\n25.19. How do I get the basename of the current file?\n\nYou can use the \":t\" filename modifier to get the basename of the current\nfile: >\n\n    :echo expand(\"%:t\")\n<\nFor more information, read:\n\n    |filename-modifiers|\n\n \t\t\t\t\t\t\t\t*faq-25.20*\n25.20. How do I get the output from a Vim function into the current buffer?\n\nYou can insert the return value from a function using the following command\nin insert mode: >\n\n    <C-R>=MyFunc()\n<\nNote, that this will only insert the return value of the function.\n\nFor more information, read:\n\n    |i_CTRL-R|\n    |i_CTRL-R_CTRL-R|\n    |i_CTRL-R_CTRL-O|\n    |expression|\n\n \t\t\t\t\t\t\t\t*faq-25.21*\n25.21. How do I call external programs from a Vim function?\n\nThere are several ways to call external programs from a Vim function. You\ncan use the builtin system() function to invoke external programs and get\nthe result: >\n\n    :let output = system(\"ls\")\n<\nYou can also use \"!\" ex-command to run an external command.\n\nFor more information, read:\n\n    |system()|\n    |:!|\n    |10.9|\n\n \t\t\t\t\t\t\t\t*faq-25.22*\n25.22. How do I get the return status of a program executed using the `:!`\n       command?\n\nYou can use the predefined Vim v:shell_error variable to get the return\nstatus of the last run shell command.\n\nFor more information, read:\n\n    |v:shell_error|\n\n \t\t\t\t\t\t\t\t*faq-25.23*\n25.23. How do I determine whether the current buffer is modified or not?\n\nYou can check the value of the 'modified' option to determine whether the\ncurrent buffer is modified: >\n\n    :set modified?\n<\nFrom a Vim script, you can check the value of the 'modified' option: >\n\n    if &modified\n        echo \"File is modified\"\n    endif\n<\nFor more information, read:\n\n    |'modified'|\n\n \t\t\t\t\t\t\t\t*faq-25.24*\n25.24. I would like to use the carriage return character in a normal\n       command from a Vim script. How do I specify the carriage return\n       character?\n\nYou can use the `:execute` command to specify the special (control)\ncharacter in a normal mode command: >\n\n    :execute \"normal \\<CR>\"\n    :execute \"normal ixxx\\<Esc>\"\n<\nFor more information, read:\n\n    |:execute|\n    |expr-quote|\n\n \t\t\t\t\t\t\t\t*faq-25.25*\n25.25. How do I split long lines in a Vim script?\n\nYou can split long lines in a Vim script by inserting the backslash\ncharacter (\"\\\") at the start of the next line. For example, >\n\n    set comments=sr:/*,mb:*,el:*/,\n                \\://,\n                \\b:#,\n                \\:%,\n                \\n:>,\n                \\fb:-\n<\nFor more information, read:\n\n    |line-continuation|\n\n \t\t\t\t\t\t\t\t*faq-25.26*\n25.26. When I try to \"execute\" my function using the `:execute Myfunc()`\n       command, the cursor is moved to the top of the current buffer.\n       Why?\n\nThe `:execute` command runs the ex command specified by the argument.\nIn the case of the following command: >\n\n    :execute Myfunc()\n<\nThe call to Myfunc() will return 0. The `:execute` command will run\nthe ex command `:0`, which moves the cursor to the top of the file.\nTo call a Vim function, you should use the `:call` command instead of the\n`:execute` command: >\n\n    :call Myfunc()\n<\nFor more information, read:\n\n    |:call|\n    |:execute|\n    |:echo|\n    |user-functions|\n    |41.5|\n    |41.6|\n    |cmdline-lines|\n\n \t\t\t\t\t\t\t\t*faq-25.27*\n25.27. How do I source/execute the contents of a register?\n\nIf you have yanked a set of Vim commands into a Vim register (for example\nregister \"a\"), then you can source the contents of the register using one\nof the following commands:\n\n    :@a\nor\n    :exe @a\n\nFor more information, read:\n\n    |:@|\n\n \t\t\t\t\t\t\t\t*faq-25.28*\n25.28. After calling a Vim function or a mapping, when I press the \"u\"\n       key to undo the last change, Vim undoes all the changes made by\n       the mapping/function. Why?\n\nWhen you call a function or a mapping, all the operations performed by the\nfunction/mapping are treated as one single operation. When you undo the\nlast operation by pressing \"u\", all the changes made by the\nfunction/mapping are reversed.\n\nFor more information, read:\n\n    |undo-redo|\n    |:map-undo|\n\n \t\t\t\t\t\t\t\t*faq-25.29*\n25.29. How can I call a function defined with s: (script local function)\n       from another script/plugin?\n\nThe s: prefix for a Vim function name is used to create a script local\nfunction. A script local function can be called only from within that\nscript and cannot be called from other scripts. To define a function in a\nscript/plugin, so that it can be called from other plugins/scripts, define\nthe function without the s: prefix.\n\nFor more information, read:\n\n    |script-variable|\n    |script-local|\n    |:scriptnames|\n\n \t\t\t\t\t\t\t\t*faq-25.30*\n25.30. Is it possible to un-source a sourced script? In other words, reverse\n       all the commands executed by sourcing a script.\n\nNo. It is not possible to reverse or undo all the commands executed by\nsourcing a script.\n\nFor more information, read:\n\n    |:source|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-26*\nSECTION 26 - PLUGINS ~\n\n \t\t\t\t\t\t\t\t*faq-26.1*\n26.1. How do I set different options for different types of files?\n\nYou can create filetype plugins to set different options for different\ntypes of files. You should first enable filetype plugins using the command: >\n\n    :filetype plugin on\n<\nA filetype plugin is a vim script that is loaded whenever Vim opens or\ncreates a file of that type.  For example, to ensure that the 'textwidth'\noption is set to 80 when editing a C program (filetype \"c\"), create one of\nthe following files: >\n\n        ~/.vim/ftplugin/c.vim (Unix)\n        %HOME%\\vimfiles\\ftplugin\\c.vim (Windows)\n<\nwith the following text in it: >\n\n        setlocal textwidth=80\n<\nYou can also use autocommands to set specific options when editing specific\ntype of files. For example, to set the 'textwidth' option to 75 for only\n*.txt files, you can use the following autocmd: >\n\n    autocmd BufRead *.txt setlocal textwidth=80\n<\nFor more information, read:\n\n    |filetype-plugin|\n    |add-filetype-plugin|\n    |:autocmd|\n    |40.3|\n\n \t\t\t\t\t\t\t\t*faq-26.2*\n26.2. I have downloaded a Vim plugin or a syntax file or a indent file, or\n      a color scheme or a filetype plugin from the web. Where should I copy\n      these files so that Vim will find them?\n\nYou can place the Vim runtime files (plugins, syntax files, indent files,\ncolor schemes, filetype plugins, etc) under one of the directories\nspecified in the 'runtimepath' option. To determine the current value of\nthe 'runtimepath' option, use the following command: >\n\n    :set runtimepath\n<\nFor Unix systems, this is usually the \"$HOME/.vim\" directory. For MS-Windows\nsystems, this is usually the $VIM\\vimfiles or $HOME\\vimfiles directory.\nDepending on the type of the runtime file, you have to place it under a\nspecific directory under the above runtime directory. The names of the\ndirectories are listed below:\n\n    name        description ~\n    ----------  ------------------ ~\n    colors/     color scheme files\n    compiler/   compiler files\n    doc/        documentation\n    ftplugin/   filetype plugins\n    indent/     indent scripts\n    keymap/     key mapping files\n    lang/       menu translations\n    plugin/     plugin scripts\n    syntax/     syntax files\n    tutor/      files for vimtutor\n\nFor more information, read:\n\n    |your-runtime-dir|\n    |'runtimepath'|\n    |:runtime|\n\n \t\t\t\t\t\t\t\t*faq-26.3*\n26.3. How do I extend an existing filetype plugin?\n\nYou can extend an existing filetype plugin by creating a file in the\nafter/ directory in any of the 'runtimepath' directories.\n\n\n- for small changes to be done after (and in addition to) what is\n  already done by the ftplugin installed with Vim, use an after-directory,\n  as follows (replacing foobar by the 'filetype' of the concerned\n  files):\n    - For changes private to one user:\n        - on Windows:\n            $HOME/vimfiles/after/ftplugin/foobar.vim\n        - on Unix-like OSes:\n            $HOME/.vim/after/ftplugin/foobar.vim\n    - For changes affecting all users on the system:\n        $VIM/vimfiles/after/ftplugin/foobar.vim\n\n- when replacing the whole filetype-plugin by a different version, or\n  when installing a new ftplugin for some filetype not yet supported by\n  Vim out of the box: use the same paths without the after/ in them. In\n  that case you should place near the start of your plugin an \"if...\n  finish... endif... let\" block like the one in the plugins distributed\n  with Vim.\n\nAll the above paths are given in Vim terminology (which is similar to\nUnix terminology, but is understood even by Vim for Windows); they don't\nexist by default, so the first time you need them you will have to\ncreate them using mkdir (on any OS including DOS/Windows) or md (on\nDOS/Windows only). $VIM and, on DOS/Windows, $HOME, do not necessarily\nexist outside Vim. If $HOME has no value (or no valid value) inside Vim,\nyou can use $VIM instead; but on any but possibly very old versions of\nWindows, $HOMEDRIVE and $HOMEPATH are defined by the system, and if\n$HOME is undefined at Vim startup, Vim will set it by expanding\n$HOMEDRIVE$HOMEPATH before sourcing your vimrc. To know which values Vim\nuses, you can type (in a running Vim): >\n\n    :echo $VIM\n    :echo $HOME\n<\n\nIf you placed the file in the after/ftplugin runtime directory, then Vim\nwill first source the existing filetype plugin file and then will source\nthe new file.  If you placed the file in the $VIMRTUNTIME/ftplugin runtime\ndirectory, then Vim will first source the new file and then will source the\nexisting filetype plugin file.\n\nFor more information, read:\n\n    |ftplugin-overrule|\n    |filetype-plugin|\n    |add-filetype-plugin|\n    |'runtimepath'|\n\n \t\t\t\t\t\t\t\t*faq-26.4*\n26.4. How do I turn off loading the Vim plugins?\n\nYou can reset the 'loadplugins' option to turn off loading the plugins: >\n\n    :set noloadplugins\n<\nYou can also specify the \"--noplugin\" command line argument to stop loading\nthe plugins: >\n\n    $ vim --noplugin\n<\nFor more information, read:\n\n    |'loadplugins'|\n    |--noplugin|\n    |load-plugins|\n\n \t\t\t\t\t\t\t\t*faq-26.5*\n26.5. How do I turn on/off loading the filetype plugins?\n\nBy default, Vim will not load the filetype plugins. You can configure Vim\nto load filetype plugins using the command: >\n\n    filetype plugin on\n<\nYou can turn off loading the filetype plugins using: >\n\n    filetype plugin off\n<\nFor more information, read:\n\n    |:filetype-plugin-on|\n    |:filetype-plugin-off|\n    |:filetype|\n\n \t\t\t\t\t\t\t\t*faq-26.6*\n26.6. How do I override settings made in a file type plugin in the global\n      ftplugin directory for all the file types?\n\nYou can use an autocommand triggered on the FileType event: >\n\n    au Filetype * set formatoptions=xyz\n<\nThis should at least be after \"filetype on\" in your vimrc. Best is to put\nit in your \"myfiletypefile\" file, so that it's always last.\n\nIf you want to override a setting for a particular filetype, then create a\nfile with the same name as the original filetype plugin in the\n~/.vim/after/ftplugin directory For example, to override a setting in the\nc.vim filetype plugin, create a c.vim file in the ~/.vim/after/ftplugin\ndirectory and add your preferences in this file.\n\nFor more information, read:\n\n    |ftplugin-overrule|\n    |ftplugins|\n    |myfiletypefile|\n\n \t\t\t\t\t\t\t\t*faq-26.7*\n26.7. How do I disable the Vim directory browser plugin?\n\nTo disable the directory browsing Vim plugin, add the following line to\nyour .vimrc file: >\n\n    let g:loaded_netrw = 1\n<\nFor more information, read:\n\n    |netrw|\n\n \t\t\t\t\t\t\t\t*faq-26.8*\n26.8. How do I set the filetype option for files with names matching a\n      particular pattern or depending on the file extension?\n\nYou can set the 'filetype' option for files with names matching a\nparticular pattern using an autocmd. For example, to set the 'filetype'\noption to \"c\" for all files with extension \".x\", you can use the following\nautocmd: >\n\n    autocmd! BufRead,BufNewFile *.x     setfiletype c\n<\nA better alternative to the above approach is to create a filetype.vim file\nin the ~/.vim directory (or in one of the directories specified in the\n'runtimepath' option) and add the following lines: >\n\n    \" my filetype file\n    if exists(\"did_load_filetypes\")\n        finish\n    endif\n    augroup filetypedetect\n        au! BufRead,BufNewFile *.x       setfiletype c\n    augroup END\n<\nFor more information, read:\n\n    |new-filetype|\n    |43.2|\n    |:setfiletype|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-27*\nSECTION 27 - EDITING PROGRAM FILES ~\n\n \t\t\t\t\t\t\t\t*faq-27.1*\n27.1. How do I enable automatic indentation for C/C++ files?\n\nYou can enable file-type based indentation using: >\n\n    :filetype indent on\n<\nIf you want to only enable automatic C indentation, then use: >\n\n    :set cindent\n<\nFor more information, read:\n\n    |'cindent'|\n    |C-indenting|\n    |filetype|\n\n \t\t\t\t\t\t\t\t*faq-27.2*\n27.2. How do I configure the indentation used for C/C++ files?\n\nYou can configure the Vim C indentation by modifying the value of the\n'cinoptions', 'cinkeys' and 'cinwords' options.\n\nFor more information, read:\n\n    |'cindent'|\n    |'cinoptions'|\n    |'cinkeys'|\n    |'cinwords'|\n    |C-indenting|\n    |cinoptions-values|\n    |'smartindent'|\n\n \t\t\t\t\t\t\t\t*faq-27.3*\n27.3. How do I turn off the automatic indentation feature?\n\nBy default, the automatic indentation is not turned on. You must have\nconfigured Vim to do automatic indentation in either .vimrc or .gvimrc\nfiles. You can disable automatic indentation using either, >\n\n    :filetype indent off\n<\nor >\n\n    :set nocindent\n<\nAlso, check the setting for the following options: >\n\n    :set autoindent?\n    :set smartindent?\n    :set indentexpr?\n<\nFor more information, read:\n\n    |'cindent'|\n    |:filetype-indent-off|\n    |'autoindent'|\n    |'smartindent'|\n    |'indentexpr'|\n\n \t\t\t\t\t\t\t\t*faq-27.4*\n27.4. How do I change the number of space characters used for the automatic\n      indentation?\n\nYou can modify the 'shiftwidth' option to change the number of space\ncharacters used for the automatic indentation: >\n\n    :set shiftwidth=4\n<\nFor more information, read:\n\n    |'shiftwidth'|\n\n \t\t\t\t\t\t\t\t*faq-27.5*\n27.5. I am editing a C program using Vim. How do I display the definition\n      of a macro or a variable?\n\nYou can use the \"[d\" command to display the definition of a macro, \"[i\"\ncommand to display the definition of a variable, \"gd\" to goto the local\ndeclaration of a variable and \"gD\" to go to the global Declaration.\n\nFor more information, read:\n\n    |[d|\n    |[i|\n    |gd|\n    |gD|\n    |include-search|\n    |29.4|\n    |29.5|\n\n \t\t\t\t\t\t\t\t*faq-27.6*\n27.6. I am editing a C program using Vim. How do I jump to the beginning or\n      end of a code block from within the block?\n\nYou can use \"[{\" command to jump to the beginning of the code block and \"]}\"\nto jump to the end of the code block from inside the block.\n\nFor more information, read:\n\n    |[{|\n    |]}|\n    |various-motions|\n\n \t\t\t\t\t\t\t\t*faq-27.7*\n27.7. When editing C++ files and when inserting new lines above or below a\n      comment (//) line, Vim automatically inserts the C++ comment\n      character (//) at the beginning of the line. How do I disable this?\n\nThis automatic insertion of the comment leader (//) when new lines\nare added is controlled by three flags in the 'formatoptions'\noption:  \"c\", \"r\" and \"o\".  \"c\" enables auto-wrapping of comment\nlines when typing extends beyond the right margin.  \"r\" enables the\nautomatic insertion of the comment leader when <Enter> is pressed\nwhile editing a comment line.  \"o\" enables the automatic insertion\nof the comment leader when a new line is opened above or below an\nexisting comment line by typing O or o in Normal mode.\n\nYou can stop Vim from automatically inserting the comment leader\nwhen typing <Enter> within a comment or when opening a new line by\nremoving the \"r\" and \"o\" flags from 'formatoptions'.\n\n   :set formatoptions-=r\n   :set formatoptions-=o\n\nThe default filetype plugin for C and C++ files\n($VIMRUNTIME/ftplugin/c.vim) adds the \"r\" and \"o\" flags to the\n'formatoptions' option.  If you want to override this for C++ files,\nthen you can add the above lines to the\n~/.vim/after/ftplugin/cpp.vim file.\n\nFor more information, read:\n\n    |'formatoptions'|\n    |30.6|\n    |format-comments|\n    |filetype-plugins|\n    |ftplugin-overrule|\n\n \t\t\t\t\t\t\t\t*faq-27.8*\n27.8. How do I add the comment character \"#\" to a set of lines at the\n      beginning of each line?\n\nFirst, select the first character in all the lines using visual block mode\n(CTRL-V). Press \"I\" to start inserting characters at the beginning of the\nline. Enter the comment character and then stop the insert mode by pressing\n<Esc>. Vim will automatically insert the entered characters at the\nbeginning of all the selected lines.\n\nFor more information, read:\n\n    |visual-block|\n    |blockwise-operators|\n    |v_b_I|\n\n \t\t\t\t\t\t\t\t*faq-27.9*\n27.9. How do I edit a header file with the same name as the corresponding C\n      source file?\n\nYou can use the following command to edit a header file with the same name\nas the corresponding C source file: >\n\n    :e %:t:r.h\n<\nYou can use the following command to edit the file in a new split window: >\n\n    :sp %:t:r.h\n<\nIn the above commands, the percent sign expands to the name of the current\nfile.  The `:t` modifier extracts the tail (last component) of the\nfilename. The `:r` modifier extracts the root of the filename.  The .h is\nappended to the resulting name to get the header filename.\n\nAnother approach is to use the following command: >\n\n    :sfind %:t:r.h\n<\nThis command will search for the header file in the directories specified\nin the 'path' option.\n\nFor more information, read:\n\n    |cmdline-special|\n    |filename-modifiers|\n    |:sfind|\n    |'path'|\n\n \t\t\t\t\t\t\t\t*faq-27.10*\n27.10. How do I automatically insert comment leaders while typing comments?\n\nTo automatically insert comment leaders while typing comments, add the \"r\"\nand \"o\" flags to the 'formatoptions' option. >\n\n    :set formatoptions+=ro\n<\nYou may also want to add the \"c\" flag to auto-wrap comments using the\n'textwidth' option setting and the \"q\" flag to format comments with the\n\"gq\" command: >\n\n    :set formatoptions=croq\n<\nFor more information, read:\n\n    |30.6|\n    |format-comments|\n    |'comments'|\n    |fo-table|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-28*\nSECTION 28 - QUICKFIX ~\n\n \t\t\t\t\t\t\t\t*faq-28.1*\n28.1. How do I build programs from Vim?\n\nYou can use the `:make` command to build programs from Vim. The `:make`\ncommand runs the program specified by the 'makeprg' option.\n\nFor more information, read:\n\n    |30.1|\n    |:make_makeprg|\n    |'makeprg'|\n    |'makeef'|\n    |:make|\n    |quickfix|\n\n \t\t\t\t\t\t\t\t*faq-28.2*\n28.2. When I run the make command in Vim I get the errors listed as the\n      compiler compiles the program. When it finishes this list disappears\n      and I have to use the `:clist` command to see the error message again.\n      Is there any other way to see these error messages?\n\nYou can use the `:copen` or `:cwindow` command to open the quickfix window\nthat contains the compiler output. You can select different error lines\nfrom this window and jump to the corresponding line in the source code.\n\nFor more information, read:\n\n    |:copen|\n    |:cwindow|\n    |quickfix|\n\n \t\t\t\t\t\t\t\t*faq-28.3*\n28.3. How can I perform a command for each item in the quickfix/location\n      list?\n\nStarting from Vim 7.4.858 Vim provides the new commands `:cfdo`, `:cdo`,\n`:lfdo` and `:ldo.` They work by iterating over all items in the quickfix\nlist and performing a command on each. The difference is, that the `:lfdo`\nand `:ldo` commands iterate over the location list entries, while the\n`:cfdo` and `:cdo` commands operate on the items in the quickfix list. Also,\nthe `:cfdo` and `:lfdo` operate on all different files, while the `:cdo` and\n`:ldo` commands operate on each item in the quickfix/location list.\n\nFor example you could vimgrep all C files in the current directory for a\nsearch string \"Foobar\": >\n\n    :vimgrep /Foobar/ *.c\n<\nand as this populates your quickfix list, you could simply replace all\noccurences by using: >\n\n    :cdo :%s/Foobar/Foobaz | upd\n<\nFor more information, read:\n\n    |:cfdo|\n    |:cdo|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-29*\nSECTION 29 - FOLDING ~\n\n \t\t\t\t\t\t\t\t*faq-29.1*\n29.1. How do I extend the Vim folding support?\n\nYou can use the 'foldexpr' option to fold using a user specified function.\nFor example, to fold subroutines of the following form into a single line: >\n\n    sub foo {\n      my $barf;\n      $barf = 3;\n      return $barf;\n    }\n<\nYou can use the following commands: >\n\n    set foldmethod=expr\n    set foldexpr=MyFoldExpr(v:lnum)\n    fun! MyFoldExpr(line)\n        let str = getline(a:line)\n        if str =~ '^sub\\>'\n            return '1'\n        elseif str =~ '^}'\n            return '<1'\n        else\n            return foldlevel(a:line - 1)\n        endif\n    endfun\n<\nFor more information, read:\n\n    |'foldexpr'|\n    |fold-expr|\n\n \t\t\t\t\t\t\t\t*faq-29.2*\n29.2. When I enable folding by setting the 'foldmethod' option, all the\n      folds are closed. How do I prevent this?\n\nYou can set the 'foldlevelstart' option to a particular value to close only\nfolds above the specified value. >\n\n    :set foldlevelstart=99\n<\nFor more information, read:\n\n    |'foldlevelstart'|\n    |'foldlevel'|\n    |fold-foldlevel|\n\n \t\t\t\t\t\t\t\t*faq-29.3*\n29.3. How do I control how many folds will be opened when I start editing a\n      file?\n\nYou can modify the 'foldlevelstart' option to control the number of folds\nthat will be opened when you start editing a file. To start editing with\nall the folds closed: >\n\n    :set foldlevelstart=0\n<\nTo start editing with all the folds opened, you can use >\n\n    :set foldlevelstart=999\n<\nFor more information, read:\n\n    |'foldlevelstart'|\n\n \t\t\t\t\t\t\t\t*faq-29.4*\n29.4. How do I open and close folds using the mouse?\n\nYou can click on the + and - characters displayed at the leftmost column to\nopen and close fold. For this to work, you have to set the 'foldcolumn'\nto a value greater than zero: >\n\n    :set foldcolumn=2\n<\nFor more information, read:\n\n    |'foldcolumn'|\n\n \t\t\t\t\t\t\t\t*faq-29.5*\n29.5. How do I change the text displayed for a closed fold?\n\nYou can use the 'foldtext' option to change the text displayed for a closed\nfold.\n\nFor more information, read:\n\n    |'foldtext'|\n    |fold-foldtext|\n    |'fillchars'|\n\n \t\t\t\t\t\t\t\t*faq-29.6*\n29.6. How do I store and restore manually created folds across different\n      Vim invocations?\n\nYou can use the `:mkview` command to store manually created folds. Later,\nyou can use the `:loadview` command to restore the folds. For this to work,\nthe 'viewoptions' must contain \"folds\".\n\nFor more information, read:\n\n    |28.4|\n    |:mkview|\n    |:loadview|\n    |'viewoptions'|\n    |'viewdir'|\n    |:mksession|\n    |'sessionoptions'|\n\n \t\t\t\t\t\t\t\t*faq-29.7*\n29.7. I have enabled syntax based folding. Why is Vim so slow?\n\nSyntax based folding is currently rather slow in Vim and will possibly\nslow down Vim considerably. There is an issue in the todo list to fix\nthis, but the todo list is rather long and it may take a while until\nthis will be fixed.\n\nYou can find the issue in the todo list, if you read\n\n    |todo.txt|\n\nfollowed by a search for \"folding with 'foldmethod'\"\n\nA workaround is to temporarily set the foldmethod to manual while in\ninsert mode. This is described in the wiki at:\n\n    http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-30*\nSECTION 30 - VIM WITH EXTERNAL APPLICATIONS ~\n\n \t\t\t\t\t\t\t\t*faq-30.1*\n30.1. Can I run a shell inside a Vim window?\n\nSince Version 8.1 Vim comes with a terminal window included. It allows\nto run a shell inside an ordinary Vim window (e.g. split) asynchronously\nand interact with the shell using the normal Vim commands.\n\nWhen the focus is in the terminal window, typed keys will be sent to\nthe job and is called terminal mode. You can click outside of the\nterminal window to move keyboard focus elsewhere, alternatively one can\nuse CTRL-W to novigate between different Vim windows. To feed CTRL-W into the\nterminal, one needs to use CTRL-W .\n\nTo map keys specifically for terminal mode, use the new `:tmap`\ncommand. After typing CTRL-W the terminal window will switch to\nTerminal-Normal mode (this can be used to move the cursor around, scroll\nthe window, etc. Just like normal mode).\n\nTo interact between the terminal and Vim, Vim implements several\ninterfaces using term_sendkeys(), terminal-api and the client-server\nmechanism.\n\nFor more information, read:\n\n    |terminal|\n    |mapmode-t|\n    |Terminal-Normal|\n    |terminal-communication|\n\n \t\t\t\t\t\t\t\t*faq-30.2*\n30.2. How do I pass the word under the cursor to an external command?\n\nYou can use the special keyword <cword> to pass the word under the cursor\nto an external command. For example: >\n\n    :!dict <cword>\n<\nFor more information, read:\n\n    |:<cword>|\n\n \t\t\t\t\t\t\t\t*faq-30.3*\n30.3. How do I get the output of a shell command into a Vim buffer?\n\nYou can use the `:r !` command to get the output of a shell command into a\nVim buffer. For example, to insert the output of the \"ls\" shell command,\nyou can use the following command: >\n\n    :r !ls\n<\nTo insert the output of the shell command above the first line use the\nfollowing command: >\n\n    :0r !ls\n<\nFor more information, read:\n\n    |:r!|\n\n \t\t\t\t\t\t\t\t*faq-30.4*\n30.4. How do I pipe the contents of the current buffer to an external\n      command and replace the contents of the buffer with the output from\n      the command?\n\nYou can use the :! command to pipe the contents of the current buffer to an\nexternal command and replace the contents of the buffer with the output\nfrom the command. For example, to sort the contents of the current buffer,\nusing the Unix sort command, you can use the following command: >\n\n    :%!sort\n<\nTo sort only lines 10-20, you can use the following command >\n\n    :10,20!sort\n<\nAlso, if you want to pipe a buffer to an external command but not put the\nresults back in the buffer, you can use >\n\n    :w !sort\n<\nThe above command will pipe the entire buffer to the sort command.  Note,\nthat the space between the \"w\" and the \"!\" is critical.  To pipe only a\nrange of lines, you can use >\n\n    :10,20w !sort\n<\nThe above command will pipe the lines 10-20 to the sort command.\n\nFor more information, read:\n\n    |:range!|\n    |10.9|\n    |:w_c|\n\n \t\t\t\t\t\t\t\t*faq-30.5*\n30.5. How do I sort a section of my file?\n\nYou use the `:sort` command like this:\n\n   :5,100sort\n\nUsing the `:sort` command provides many options, you can sort numerical on\nthe first found decimal number using:\n\n   :%sort n\n\nOr you can specify to sort on the text, starting at virtual column 8:\n\n   :%sort /.*\\%8v/\n\nAlternatively can pipe a section of the file to the Unix \"sort\" utility to\nsort the file. For example: >\n\n    :5,100!sort\n<\nYou can also use a visual block, and use the \"!sort\" command on the\nselected block.\n\nSee also:\n    |:sort|\n    |filter|\n\n \t\t\t\t\t\t\t\t*faq-30.6*\n30.6. How do I use Vim as a pager?\n\nYou can use Vim as a pager using the $VIMRUNTIME/macros/less.sh shell\nscript, supplied as part of the standard Vim distribution. This shell\nscript uses the $VIMRUNTIME/macros/less.vim Vim script to provide less like\nkey bindings.\n\nFor more information, read:\n\n    |less|\n\n \t\t\t\t\t\t\t\t*faq-30.7*\n30.7. How do I view Unix man pages from inside Vim?\n\nYou can view Unix man pages, inside Vim, using the man.vim plugin supplied\nas part of the standard Vim distribution. To use this plugin, add the\nfollowing line to your startup vimrc file: >\n\n    runtime ftplugin/man.vim\n<\nYou can also press the K key to run the program specified by the\n'keywordprg' option with the keyword under the cursor. By default,\n'keywordprg' is set to run man on the keyword under the cursor.\n\nFor more information, read:\n\n    |ft-man-plugin|\n    |K|\n    |'keywordprg'|\n\n \t\t\t\t\t\t\t\t*faq-30.8*\n30.8. How do I change the diff command used by the Vim diff support?\n\nBy default, the Vim diff support uses the 'diff' command. You can change\nthis by changing the 'diffexpr' option.\n\nFor more information, read:\n\n    |diff-diffexpr|\n    |'diffexpr'|\n\n \t\t\t\t\t\t\t\t*faq-30.9*\n30.9. How do I use the Vim diff mode without folding?\n\nYou can use the following command-line to start Vim with two filenames\nand use the diff mode without folding: >\n\n    $ vim -o file1 file2 \"+windo set diff scrollbind scrollopt+=hor nowrap\"\n<\nIf you like vertically split windows, then replace \"-o\" with \"-O\".\n\nFor more information, read:\n\n    |vimdiff|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-31*\nSECTION 31 - GUI VIM ~\n\n \t\t\t\t\t\t\t\t*faq-31.1*\n31.1. How do I create buffer specific menus?\n\nAdding support for buffer specific menus is in the Vim TODO list. In the\nmean time, you can try Michael Geddes's plugin, buffermenu.vim:\n\n    https://www.vim.org/scripts/script.php?script_id=246\n\n \t\t\t\t\t\t\t\t*faq-31.2*\n31.2. How do I change the font used by GUI Vim?\n\nYou can change the 'guifont' option to change the font used by GUI Vim.  To\ndisplay the current value of this option, you can use >\n\n    :set guifont?\n<\nYou can add the displayed font name to the .vimrc file to use the font\nacross Vim sessions. For example, add the following line to the .vimrc file\nto use Andale Mono font. >\n\n    set guifont=Andale_Mono:h10:cANSI\n<\nFor Win32, GTK and Photon version of Vim, you can use the following command\nto bringup a dialog which will help you in changing the guifont: >\n\n    :set guifont=*\n<\nYou can also use the -font Vim command line option to specify the font used\nfor normal text.\n\nFor more information, read:\n\n    |'guifont'|\n    |'guifontset'|\n    |'guifontwide'|\n    |font-sizes|\n    |-font|\n    |-boldfont|\n    |-italicfont|\n    |-menufont|\n    |-menufontset|\n\n \t\t\t\t\t\t\t\t*faq-31.3*\n31.3. When starting GUI Vim, how do I specify the location of the GVIM\n      window?\n\nYou can use the \"-geometry\" command line argument to specify the location\nof the GUI Vim window. For example: >\n\n    $ gvim -geometry 80x25+100+300\n<\nFor more information, read:\n\n    |31.4|\n    |-geom|\n\n \t\t\t\t\t\t\t\t*faq-31.4*\n31.4. How do I add a horizontal scrollbar in GVim?\n\nYou can enable the horizontal scrollbar by modifying the 'guioptions'\noption: >\n\n    :set guioptions+=b\n<\nFor more information, read:\n\n    |'guioptions'|\n    |gui-horiz-scroll|\n\n \t\t\t\t\t\t\t\t*faq-31.5*\n31.5. How do I make the scrollbar appear in the left side by default?\n\nYou can add the \"l\" flag to the 'guioptions' option to make the scrollbar\nappear in the left side. >\n\n    :set guioptions+=l\n    :set guioptions-=r\n<\nFor more information, read:\n\n    |'guioptions'|\n    |gui-scrollbars|\n\n \t\t\t\t\t\t\t\t*faq-31.6*\n31.6. How do I remove the Vim menubar?\n\nYou can remove the Vim menubar by removing the \"m\" flag from the\n'guioptions' option: >\n\n    :set guioptions-=m\n<\nFor more information, read:\n\n    |'guioptions'|\n\n \t\t\t\t\t\t\t\t*faq-31.7*\n31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the menu\n      starting with that letter is selected. I don't want this behavior as\n      I want to map the <Alt>-<key> combination. How do I do this?\n\nYou can use the 'winaltkeys' option to disable the use of the <Alt> key to\nselect a menu item: >\n\n    :set winaltkeys=no\n<\nFor more information, read:\n\n    |'winaltkeys'|\n    |:simalt|\n\n \t\t\t\t\t\t\t\t*faq-31.8*\n31.8. Is it possible to scroll the text by dragging the scrollbar so that\n      the cursor stays in the original location?\n\nThe way Vim is designed, the cursor position has to be in a visible spot in\nnormal, visual, select and insert mode. This cannot be changed without\nmodifying Vim. When the scrollbar is used, the cursor will be moved so that\nit is always visible. Another approach to solving this problem is to use\nthe Vim marks. You can mark the current cursor position using ma. Then\nscroll to a different part of the text and jump back to the old position\nusing `a. You can also try the following suggestion from the Vim Online\nwebsite:\n\n    http://vim.wikia.com/wiki/VimTip320\n\nFor more information, read:\n\n    |mark-motions|\n\n \t\t\t\t\t\t\t\t*faq-31.9*\n31.9. How do I get gvim to start browsing files in a particular directory\n      when using the `:browse` command?\n\nYou can set the 'browsedir' option to the default directory to use for the\n`:browse` command. >\n\n    :set browsedir='<your_dir>'\n<\nFor more information, read:\n\n    |'browsedir'|\n\n \t\t\t\t\t\t\t\t*faq-31.10*\n31.10. For some questions, like when a file is changed outside of Vim, Vim\n       displays a GUI dialog box. How do I replace this GUI dialog box with\n       a console dialog box?\n\nYou can set the \"c\" flag in the 'guioptions' option to configure Vim to use\nconsole dialogs instead of GUI dialogs: >\n\n    :set guioptions+=c\n<\nFor more information, read:\n\n    |'guioptions'|\n\n \t\t\t\t\t\t\t\t*faq-31.11*\n31.11. I am trying to use GUI Vim as the editor for my xxx application.\n       When the xxx application launches GUI Vim to edit a file, the\n       control immediately returns to the xxx application. How do I start\n       GUI Vim, so that the control returns to the xxx application only\n       after I quit Vim?\n\nYou have to start GUI Vim with the \"-f\" (foreground) command line option: >\n\n    $ gvim -f\n<\nBy default, GUI Vim will disconnect from the program that started Vim. With\nthe '-f' option, GUI Vim will not disconnect from the program that started\nit.\n\nFor more information, read:\n\n    |gui-fork|\n    |-f|\n\n \t\t\t\t\t\t\t\t*faq-31.12*\n31.12. Why does the \"Select Font\" dialog doesn't show all the fonts\n       installed in my system?\n\nVim supports only fixed width (mono-spaced) fonts. Proportional fonts are\nnot supported.  In the \"Select Font\" dialog, only fixed width fonts will be\ndisplayed.\n\nFor more information, read:\n\n    |font-sizes|\n    |'guifont'|\n\n \t\t\t\t\t\t\t\t*faq-31.13*\n31.13. How do I use the mouse in Vim command-line mode?\n\nYou can set the \"c\" flag in the 'mouse' option to use mouse in the Vim\ncommand-line mode: >\n\n    :set mouse+=c\n<\nFor more information, read:\n\n    |mouse-using|\n    |gui-mouse|\n    |09.2|\n\n \t\t\t\t\t\t\t\t*faq-31.14*\n31.14. When I use the middle mouse button to scroll text, it pastes the\n       last copied text. How do I disable this behavior?\n\nYou can map the middle mouse button to <Nop> to disable the middle mouse\nbutton: >\n\n    :map  <MiddleMouse> <Nop>\n    :map! <MiddleMouse> <Nop>\n<\nFor more information, read:\n\n    |gui-mouse-mapping|\n    |<Nop>|\n\n \t\t\t\t\t\t\t\t*faq-31.15*\n31.15. How do I change the location and size of a GUI Vim window?\n\nYou can use the `:winpos` command to change the Vim window position. To\nchange the size of the window, you can modify the 'lines' and 'columns'\noptions.\n\nFor example, the following commands will position the GUI Vim window at the\nX,Y co-ordinates 50,50 and set the number of lines to 50 and the number of\ncolumns to 80. >\n\n    :winpos 50 50\n    :set lines=50\n    :set columns=80\n<\nThe arguments to the `:winpos` command specify the pixel co-ordinates of the\nVim window. The 'lines' and 'columns' options specify the number of lines\nand characters to use for the height and the width of the window\nrespectively.\n\nFor more information, read:\n\n    |31.4|\n    |:winpos|\n    |'lines'|\n    |'columns'|\n    |GUIEnter|\n\n \t\t\t\t\t\t\t\t*faq-31.16*\n31.16. When splitting the Vim window vertically, Vim changes the position.\n\nThis is a known problem. When you are splitting the Vim window, Vim will\ntry to draw a scrollbar. Since this changes the gui window, Vim tries to\nresize its main window to keep the same position and this will cause Vim\nto move its position. This happens on Windows with a multi-window setup or\na window that was \"snapped\" to a certain position.\n\nA workaournd to this problem is, to remove gui scrollbars, e.g. >\n\n    :set guioptions-=L\n<\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-32*\nSECTION 32 - VIM ON UNIX ~\n\n \t\t\t\t\t\t\t\t*faq-32.1*\n32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim\n      freezes. What should I do now?\n\nMany terminal emulators and real terminal drivers use the CTRL-S key to\nstop the data from arriving so that you can stop a fast scrolling display\nto look at it (also allowed older terminals to slow down the computer so\nthat it did not get buffer overflows).  You can start the output again by\npressing the CTRL-Q key.\n\nWhen you press the CTRL-S key, the terminal driver will stop sending the\noutput data. As a result of this, it will look like Vim is hung. If you\npress the CTRL-Q key, then everything will be back to normal.\n\nYou can turn off the terminal driver flow control using the \"stty\" command: >\n\n    $ stty -ixon -ixoff\n<\nor, you can change the keys used for the terminal flow control, using the\nfollowing commands: >\n\n    $ stty stop <char>\n    $ stty start <char>\n<\n \t\t\t\t\t\t\t\t*faq-32.2*\n32.2. I am seeing weird screen update problems in Vim. What can I do to\n      solve this screen/display update problems?\n\nYou have to use a proper terminal emulator like xterm with correct TERM\nsettings (TERM=xterm) and a correct terminfo/termcap file.\nFor more information, read:\n\n    |'term'|\n\n \t\t\t\t\t\t\t\t*faq-32.3*\n32.3. I am using the terminal/console version of Vim. In insertmode, When I\n      press the backspace key, the character before the cursor is not\n      erased. How do I configure Vim to do this?\n\nYou have to make sure that Vim gets the correct keycode for the backpspace\nkey. You can try using the command: >\n\n    :fixdel\n<\nMake sure the TERM environment variable is set to the correct terminal\nname. You can try using the \"stty\" command: >\n\n    $ stty erase ^H\n<\nwhere, you have to enter the ^H character by pressing the CTRL-V key and\nthen the CTRL-H key. Also check the value of your 'backspace' setting.\n\nFor more information, read:\n\n    |:fixdel|\n    |Linux-backspace|\n    |NetBSD-backspace|\n    |'backspace'|\n\n \t\t\t\t\t\t\t\t*faq-32.4*\n32.4. I am using Vim in a xterm. When I quit Vim, the screen contents are\n      restored back to the original contents. How do I disable this?\n\nThe xterm has a capability called \"alternate screen\".  If this capability\nis present, vim switches to that alternate screen upon startup and back on\nexit, thus restoring the original screen contents.  To disable this\nfeature, add the following line to your .vimrc file: >\n\n    :set t_ti= t_te=\n<\nFor more information, read:\n\n    |'restorescreen'|\n    |xterm-screens|\n\n \t\t\t\t\t\t\t\t*faq-32.5*\n32.5. When I start Vim, it takes quite a few seconds to start. How do I\n      minimize the startup time?\n\nThis may be related to Vim opening the X display for setting the xterm\ntitle and using the X clipboard. Make sure the DISPLAY variable is set to\npoint to the correct host. Try using the command line: >\n\n    $ vim -X\n<\nThis will prevent Vim from opening the X display. With this command-line\noption, the X clipboard cannot be used and also Vim will not be able to\nchange the xterm title.\n\nYou can also set the 'clipboard' option to >\n\n    :set clipboard=exclude:.*\n<\nThis has the same effect as using the -X command-line argument.\n\nFor more information, read:\n\n    |-X|\n    |'clipboard'|\n\nIf the clipboard is not the cause of the slow startup, it might be a\nplugin that slows down Vim. In that case, you can use the --startuptime\nargument to debug this further. You can do: >\n\n    $ vim --startuptime vim_startup.log\n<\nand the timing will be written to the file vim_startup.log. For even\nmore advanced profiling, you can use the profiling feature, that is\navailable in huge builds of Vim. To do so, call Vim like this: >\n\n    $ vim --cmd 'profile start profile.log' \\\n      --cmd 'profile func *' \\\n      --cmd 'profile file *' \\\n      -c 'profdel func *' \\\n      -c 'profdel file *' \\\n      -c 'qa!'\n<\nAfter running this, you will have a file profile.log in your current\ndirectory. To further analyse this, open the file profile.log and run: >\n\n    \" Open profile.log file in vim first\n    :let timings=[]\n    :g/^SCRIPT/call add(timings, [getline('.')[len('SCRIPT  '):], matchstr(getline(line('.')+1), '^Sourced \\zs\\d\\+')]+map(getline(line('.')+2, line('.')+3), 'matchstr(v:val, ''\\d\\+\\.\\d\\+$'')'))\n    :enew\n    :call setline('.', ['count total (s)   self (s)  script']+map(copy(timings), 'printf(\"%5u %9s   %8s  %s\", v:val[1], v:val[2], v:val[3], v:val[0])'))\n<\nFor more information, read:\n\n    |--startuptime|\n    |profiling|\n\n \t\t\t\t\t\t\t\t*faq-32.6*\n32.6. How can I make the cursor in gvim in unix stop blinking?\n\nYou can modify the 'guicursor' option, to stop the cursor from blinking.\nFor example: >\n\n    :set guicursor=a:blinkon0\n<\nFor more information, read:\n\n    |'guicursor'|\n\n \t\t\t\t\t\t\t\t*faq-32.7*\n32.7. How do I change the menu font on GTK Vim?\n\nYou can modify the ~/.gtkrc file to change the menu font on GTK Vim. For\nexample: >\n\n    style \"default\"\n    { font =\"smooth09\" }\n    class \"*\" style \"default\"\n<\nThe last line changes the font of all widgets.\n\nFor more information, read:\n\n    |gui-gtk|\n\n \t\t\t\t\t\t\t\t*faq-32.8*\n32.8. How do I prevent CTRL-Z from suspending Vim?\n\nYou can map CTRL-Z to prevent the suspending. Here are some suggestions:\n\n- Make CTRL-Z do nothing: >\n\n    :map <C-Z> <Nop>\n<\n- Make CTRL-Z start a shell: >\n\n    :map <C-Z> :shell<CR>\n<\n- Make CTRL-Z give an error message: >\n\n    :map <C-Z> :\"suspending disabled<CR>\n<\nFor the last example, the double quote is necessary in order to keep the\nmessage on the status line.\n\n \t\t\t\t\t\t\t\t*faq-32.9*\n32.9. When I kill the xterm running Vim, the Vim process continues to run\n      and takes up a lot of CPU (99%) time. Why is this happening?\n\nWhen Vim is built with support for Python interface, you will have this\nproblem. This is a known problem with the python thread library and Vim.  To\nsolve this problem, use a Vim binary built without the Python interface.\n\nFor more information, read:\n\n    |+python|\n    |python|\n\n \t\t\t\t\t\t\t\t*faq-32.10*\n32.10. How do I get the Vim syntax highlighting to work in a Unix terminal?\n\nThe easiest and simplest way to get Vim syntax highlighting is to use the\nGUI version of Vim (GVIM). To get syntax highlighting to work in the\nconsole/terminal version of Vim, you have to run a terminal emulator (like\nXfree86 xterm or rxvt or dtterm) that supports color. Note that if a\nterminal emulator supports changing the background and foreground colors,\nthat does not mean that it also supports ANSI escape sequences for changing\nthe color. You can download the latest version of Xfree86 xterm from\nhttps://invisible-island.net/xterm/xterm.html\nYou can download the latest version of rxvt from https://rxvt.org\nYou have to install the terminfo/termcap file that supports colors for the\nterminal emulator. Also, set the TERM environment variable to the correct\nname of the term that supports colors.\n\nYou can use the colortest.vim script supplied with the Vim runtime\npackage to test the color setup. To use this script, follow these steps: >\n\n    :e $VIMRUNTIME/syntax/colortest.vim\n    :source %\n<\nFor more information, read:\n\n    |06.2|\n    |terminal-colors|\n    |termcap-colors|\n    |startup-terminal|\n    |xterm-color|\n    |colortest.vim|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-33*\nSECTION 33 - VIM ON MS-WINDOWS ~\n\n \t\t\t\t\t\t\t\t*faq-33.1*\n33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode. What\n      happened?\n\nThe mswin.vim script provides key mappings and options to make Vim behave\nlike a MS-Windows application. One of the keys mapped is CTRL-V which is\nused for pasting text in MS-Windows applications. This will disable the use\nof CTRL-V to start the blockwise visual mode. The mswin.vim script maps\nCTRL-Q for staring the blockwise visual mode. So you can use CTRL-Q instead\nof CTRL-V.\n\nFor more information, read:\n\n    |CTRL-V|\n    |CTRL-V-alternative|\n    |CTRL-Q|\n    |10.5|\n\n \t\t\t\t\t\t\t\t*faq-33.2*\n33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do I\n      configure Vim to treat CTRL-Y as CTRL-Y?\n\nThe mapping of the CTRL-Y key to the CTRL-R key is done by the mswin.vim\nscript. The mswin.vim script maps CTRL-Y to make Vim behave like a standard\nMS-Windows application. This is explained in `:help CTRL-Y`. You can either\ncomment out the line in mswin.vim that maps the CTRL-Y key or you can\nremove the line in your .vimrc file that sources the mswin.vim script.\n\n \t\t\t\t\t\t\t\t*faq-33.3*\n33.3. How do I start GUI Vim in a maximized window always?\n\nYou can use the `:simalt` command to maximize the Vim window. You can use\nthe GUIEnter autocmd to maximize the Vim window on startup: >\n\n    autocmd GUIEnter * simalt ~x\n<\nFor more information, read:\n\n    |:simalt|\n    |GUIEnter|\n    |gui-win32-maximized|\n\n \t\t\t\t\t\t\t\t*faq-33.4*\n33.4. After doing some editing operations, Vim freezes. The cursor becomes\n      an empty rectangle. I am not able enter any characters. What is\n      happening?\n\nMost probably, you used the mouse wheel to scroll the text in Vim. There is\na known problem in using intellimouse mouse wheel with Vim. To avoid this\nproblem, disable Universal scrolling support for Vim.\n\nFor more information, read:\n\n    |intellimouse-wheel-problems|\n\n \t\t\t\t\t\t\t\t*faq-33.5*\n33.5. I am using Windows XP, the display speed of maximized GVim is very\n      slow. What can I do to speed the display updates?\n\nThis may be due to the fact that you have enabled 'Smooth edges of screen\nfonts' in the display properties. Try turning off font smoothing or try\nchanging the smoothing method to \"Standard\".\n\n \t\t\t\t\t\t\t\t*faq-33.6*\n33.6. What are the recommended settings for using Vim with cygwin?\n\nYou may want to set the following shell related Vim settings: >\n\n    :set shellcmdflag=-c\n    :set shellquote=\n    :set shellslash          \" Use the forward slash for expansion.\n    :set shellxquote=\\\"\n    :set shell=d:\\cygwin\\bin\\bash.exe \" Use the bash shell\n    :set shellpipe=2>&1| tee\n    :set shellredir=>%s 2>&1\n<\n \t\t\t\t\t\t\t\t*faq-33.7*\n33.7. I am trying to use GNU diff with Vim diff mode. When I run the diff\n      from command line, it works. When I try to use the diff with Vim it\n      doesn't work. What should I do now?\n\nThere is a problem with using GNU diff with Vim. You can try using the\nGNU diff.exe built by Ron Aaron from the following link:\n\n    http://www.mossbayeng.com/~ron/vim/builds.html\n(This page no longer exists.)\n\n \t\t\t\t\t\t\t\t*faq-33.8*\n33.8. Is it possible to use Vim as an external editor for MS-Windows\n      Outlook email client?\n\nYou can use the \"cubiclevim\" COM Add-In to use Vim as an external editor\nfor MS-Windows Outlook email client. Visit the following URL for more\ninformation:\n\n    https://sourceforge.net/projects/cubiclevim/\n\nNote, that currently this works only with MS-Office 2000 and XP.\n\nAlso the plugin OutlookVim might be worth a look:\n\n    https://www.vim.org/scripts/script.php?script_id=3087\n\n \t\t\t\t\t\t\t\t*faq-33.9*\n33.9. I am using Vim to edit HTML files. How do I start internet explorer\n      with the current file to preview the HTML file?\n\nYou can use the following command: >\n\n    :!start c:\\progra~1\\intern~1\\iexplore.exe file://%:p<CR>\n<\n \t\t\t\t\t\t\t\t*faq-33.10*\n33.10. I would like to use Vim with Microsoft Visual Studio. How do I do\n       this?\n\nYou have to download and use the OLE version of Vim (for example:\ngvim61ole.zip). This file also contains instructions on how to use Vim with\nVisual Studio.\n\nFor more information, read:\n\n    |MSVisualStudio|\n\n \t\t\t\t\t\t\t\t*faq-33.11*\n33.11. Where do I place the _vimrc and _gvimrc files?\n\nYou can place the _vimrc and _gvimrc files under the directory pointed to\nby the VIM environment variable. If you are sharing this system with other\nusers, then you can place the files in a directory and set the HOME\nenvironment variable to this directory.\n\nFor more information, read:\n\n    |$HOME-use|\n    |_vimrc|\n\n \t\t\t\t\t\t\t\t*faq-33.12*\n33.12. Every time I save a file, Vim warns about the file being changed\n       outside of Vim. Why?\n\nIf you get the following warning message, every time you save a file: >\n\n    WARNING: The file has been changed since reading it!!!\n    Do you really want to write to it (y/n)?\n<\nthen this problem could be related to a bug in MS-Windows on the day\ndaylight saving time starts.  Vim remembers the timestamp of the file after\nit was written.  Just before the next write the timestamp is obtained again\nto check if the file was changed outside of Vim.  This works correctly,\nexcept on the day daylight saving time starts.\n\nThis problem will go away the next day after the day the daylight saving\ntime starts.\n\nFor more information, read:\n\n    |W11|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-34*\nSECTION 34 - PRINTING ~\n\n \t\t\t\t\t\t\t\t*faq-34.1*\n34.1. How do I print a file along with line numbers for all the lines?\n\nYou can set the 'printoptions' option and use the `:hardcopy` command to\nprint your file: >\n\n    :set printoptions=number:y\n    :hardcopy\n<\nFor more information, read:\n\n    |'printoptions'|\n    |:hardcopy|\n\n \t\t\t\t\t\t\t\t*faq-34.2*\n34.2. How do I print a file with the Vim syntax highlighting colors?\n\nYou can use the `:hardcopy` command to print a file with the Vim syntax\nhighlighting colors. You can also convert your file to a HTML file using\nthe 2html.vim script and print the HTML file.\n\nFor more information, read:\n\n    |syntax-printing|\n    |2html.vim|\n    |:hardcopy|\n    |printing|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-35*\nSECTION 35 - BUILDING VIM FROM SOURCE ~\n\n \t\t\t\t\t\t\t\t*faq-35.1*\n35.1. How do I build Vim from the sources on a Unix system?\n\nFor a Unix system, follow these steps to build Vim from the sources:\n\n- Download the source from the git repository:\n  https://github.com/vim/vim/releases/\n- Alternatively, download the source from the mercurial repository:\n  https://bitbucket.org/vim-mirror/vim/downloads/\n- Run the \"make\" command to configure and build Vim with the default\n  configuration.\n- Run \"make install\" command to install Vim in the default directory.\n\nTo enable/disable various Vim features, before running the \"make\" command\nyou can run the \"configure\" command with different flags to include/exclude\nthe various Vim features. To list all the available options for the\n\"configure\" command, use: >\n\n    $ configure --help\n<\nFor more information, read:\n\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.2*\n35.2. How do I install Vim in my home directory or a directory other\n      than the default installation directory in Unix?\n\nTo install Vim in a directory other than the default installation\ndirectory, you have to specify the directory using the --prefix option\nwhile running the configure script. >\n\n    $ ./configure --prefix=/users/xyz\n<\nYou can enable/disable various Vim feature by supplying different arguments\nto the configure script. For more information about all these options, run: >\n\n    $ ./configure --help\n<\nFor more information, read:\n\n    |install-home|\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.3*\n35.3. How do I build Vim from the sources on a MS-Windows system?\n\nFor a MS-Windows system, Vim can be built using either the Visual C++\ncompiler or the Borland C++ compiler or the Ming GCC compiler or the cygwin\ngcc compiler. Follow these steps to build Vim from the sources for\nMS-Windows:\n    - download the source from the git repository:\n      https://github.com/vim/vim/releases/\n    - Depending on the installed compiler, you can use the corresponding\n      makefile to build the Vim sources. For Visual C++ use the\n      Make_mvc.mak makefile, for borland C++ use the Make_bc5.mak makefile,\n      for ming GCC use the Make_ming.mak makefile, for cygwin gcc use the\n      Make_cyg.mak makefile.\n\nDepending on whether you want to build the GUI version of Vim or the\nconsole version of Vim, you have to pass different arguments to the\nmakefiles. After successfully building the sources, you can copy the\nvim.exe or gvim.exe file to the desired directory along with the files from\nthe runtime archive.\n\nFor more information, read:\n\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.4*\n35.4. The Vim help, syntax, indent files are missing from my Vim\n      installation. How do I install these files?\n\nThe Vim help, syntax, indent and other runtime files are part of the Vim\nruntime package. You need to download and install the Vim runtime package.\nFor example, for MS-Windows, the name of the Vim 6.1 runtime package is\nvim61rt.zip.\n\nFor more information, read:\n\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.5*\n35.5. I have built Vim from the source and installed the Vim package using\n      \"make install\". Do I need to keep the Vim source directory?\n\nNo. Once you have built and installed Vim in some directory other than the\noriginal source directory (for example, /usr/bin or /usr/local/bin), then\nyou can remove the source directory.\n\n \t\t\t\t\t\t\t\t*faq-35.6*\n35.6. How do I determine the Vim features which are enabled at compile\n      time?\n\nYou can use the `:version` command to determine the Vim features that are\nenabled at compile time. The features that are enabled will be prefixed\nwith a \"+\". The features that are not enabled will be prefixed with a \"-\".\n\nIf you want to test for a feature in a script, you can use the has()\nfunction: >\n\n    if has(\"menu\")\n        \" Set up some menus\n    endif\n<\nFor more information, read:\n\n    |:version|\n    |+feature-list|\n    |has()|\n\n \t\t\t\t\t\t\t\t*faq-35.7*\n35.7. Can I build Vim without the GUI support?\n\nYes. You can build Vim by optionally enabling/disabling many of the\nfeatures including GUI.\n\nFor more information, read:\n\n    |install|\n\n \t\t\t\t\t\t\t\t*faq-35.8*\n35.8. When building Vim on a Unix system, I am getting \"undefined reference\n      to term_set_winsize\" error. How do I resolve this error?\n\nYou will get this error when the build process is not able to locate the\ntermlib, termcap or ncurses library. You have to install the ncurses-dev\npackage to resolve this error.\n\n \t\t\t\t\t\t\t\t*faq-35.9*\n35.9. Vim configure keeps complaining about the lack of gtk-config while\n      trying to use GTK 2.03. This is correct, since in GTK 2 they moved to\n      using the generic pkg-config. I can get pkg-config to list the\n      various includes and libs for gtk, but for some reason the configure\n      script still isn't picking this up.\n\nUse the following shell script named gtk-config: >\n\n    #!/bin/sh\n    pkg-config gtk+-2.0 $1 $2\n<\n \t\t\t\t\t\t\t\t*faq-35.10*\n35.10. I did successfully download the sources and compiled Vim on\n        Unix. But feature ... still does not work. What is wrong and\n        how can I fix it?\n\nYou should first check, that you are actually running your self compiled\nVim and not the system's provided version. So first check your $PATH\nsetting.\n\nDepending on your compile options, some features might not be included in\nyour build of Vim. You can use the `:version` command to determine the Vim\nfeatures that are enabled at compile time. The features that are enabled\nwill be prefixed with a \"+\". The features that are not enabled will be\nprefixed with a \"-\".\n\nThe easiest way to include all features is to build the huge version. To do\nthis, you have to specify the --with-features option while running the\nconfigure script: >\n\n    $ ./configure --with-features=huge\n<\nNevertheless, a feature could still be disabled at compile time, if the\nconfigure script can't find the required libraries for those features (e.g.\nfor clipboard integration, your Vim needs to be linked against the X11\ndevelopment libraries).\n\nThere are several ways to install the required libraries:\n\n1) On a Debian based distribution, you can use the package manager \"apt\"\n   to install all required dependencies. As superuser, run the command:\n\n   $ apt-get build-dep vim-gtk\n\n   This makes sure all required libraries needed to compile the vim-gtk\n   package will be installed. (This requires, that your sources list\n   contains deb-src entries. See your distribution manual on how to\n   enable this, if the above command did not work.)\n\n2) In openSUSE you can use the package manager \"zypper\" to install all\n   required libraries. This requires, that there is a source version of\n   the package installable from a configured repository (which by\n   default is not the case). Use:\n\n   $ zypper search -t srcpackage vim\n\n   to find out, whether or not there exists a source version in the\n   repository. If there is none, you'll need to add a source repository.\n   For openSUSE 11.2 you could use, e.g.\n\n   $ zypper ar\n   http://download.opensuse.org/source/distribution/11.2/repo/oss/src-11.2\n\n   (one line)\n\n   Once you have a source version available in your repositories, use\n   this command to install all needed requirements:\n\n   $ zypper source-install --build-deps-only vim\n\n3) On a Fedora/RedHat based system, you can use\n\n   $ yum-builddep vim-enhanced\n\n4) Run configure with your options and watch for missing libraries:\n\n   $ ./configure --with-features=huge 2>&1 |tee logfile\n\n   This will run configure and record the output into the file \"logfile\".\n   You need to check the logfile for missing dependencies. Consider this\n   output: >\n\n    checking --disable-gtktest argument... gtk test enabled\n    checking for pkg-config... /usr/bin/pkg-config\n    checking for GTK - version >= 2.2.0... no\n<\n    Here you can see, that the gtk libraries are missing and therefore\n    no GTK gui version can't be build. So you need to install the GTK\n    library in your system, with your package manager or by compiling it\n    yourself. Then run the configure script again and check, that it\n    finds the library.\n\nIn theory, those provided dependencies by your distribution might still\nlack some libraries, that are needed for features, that simply are not\nenabled in your distribution and therefore those commands in 1-3 won't\ninstall it. At the very least, this provides a jumping point and you need\nto track down the required missing packages using method 4 from above. But\nusually, this works good enough for most people and you won't have to\nbother with the fourth method.\n\nFor more information, read:\n\n    |:version|\n    |+feature-list|\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-36*\nSECTION 36 - VARIOUS ~\n\n \t\t\t\t\t\t\t\t*faq-36.1*\n36.1. How do I edit binary files with Vim?\n\nYou can set the following options to edit binary files in Vim: >\n\n    :set binary\n    :set display=uhex\n<\nYou can also use the \"-b\" command-line option to edit a binary file: >\n\n    $ vim -b <binary_file_name>\n<\nYou can also use the xxd utility (part of the Vim distribution) to edit\nbinary files.\n\nFor more information, read:\n\n    |23.4|\n    |edit-binary|\n    |hex-editing|\n    |-b|\n    |'binary'|\n    |'endofline'|\n    |'display'|\n\n \t\t\t\t\t\t\t\t*faq-36.2*\n36.2. How do I disable the visual error flash and the error beep?\n\nYou can disable both the visual error flash and the error beep using the\nfollowing command: >\n\n    :set visualbell t_vb=\n<\nFor more information, read:\n\n    |'visualbell'|\n    |'errorbells'|\n    |t_vb|\n\n \t\t\t\t\t\t\t\t*faq-36.3*\n36.3. How do I display the ascii value of a character displayed in a\n      buffer?\n\nYou can use the \"ga\" command to display the ascii value of a displayed\ncharacter.\n\nFor more information, read:\n\n    |ga|\n    |:ascii|\n\n \t\t\t\t\t\t\t\t*faq-36.4*\n36.4. Can I use zero as a count for a Vim command?\n\nYou cannot use zero as a count for a Vim command, as \"0\" is a command on\nits own, moving to the first column of the line.\n\nFor more information, read:\n\n    |0|\n    |count|\n\n \t\t\t\t\t\t\t\t*faq-36.5*\n36.5. How do I disable the Vim welcome screen?\n\nYou can disable the Vim welcome screen, by adding the \"I\" flag to the\n'shortmess' option: >\n\n    :set shortmess+=I\n<\nFor more information, read:\n\n    |:intro|\n    |'shortmess'|\n\n \t\t\t\t\t\t\t\t*faq-36.6*\n36.6. How do I avoid the \"hit enter to continue\" prompt?\n\nVim will prompt you with the \"hit enter to continue\" prompt, if there are\nsome messages on the screen for you to read and the screen is about to be\nredrawn.  You can add the \"T\" flag to the 'shortmess' option to truncate\nall messages. This will help in avoiding the hit-enter prompt: >\n\n    :set shortmess+=T\n<\nYou can also increase the command height by setting the 'cmdheight' option: >\n\n    :set cmdheight=2\n<\nFor more information, read:\n\n    |hit-enter|\n    |avoid-hit-enter|\n    |'shortmess'|\n    |'cmdheight'|\n\n \t\t\t\t\t\t\t\t*faq-36.7*\n36.7. How do I invoke Vim from command line to run a group of commands on a\n      group of files?\n\nThere are several ways to invoke Vim from command line to run a group of\ncommands on a group of files. You can use a set of  \"-c\" command line\noptions to specify a group of commands: >\n\n    $ vim -c \"<ex_command_1>\" -c \"<ex_command_2>\" *.txt\n<\nEach of the ex-command specified with the \"-c\" command line option is\nexecuted one by one sequentially. You can also use a single \"-c\" command\nline option and the \"|\" character to separate the ex commands: >\n\n    $ vim -c \"<ex_command_1> | <ex_command_2>\" *.txt\n<\nIn the above command, if an ex command fails, then all the remaining ex\ncommands will not be executed.\n\nFor example, to replace \"ABC\" with \"DEF\" in a file from the command-line,\nyou can use the following command: >\n\n    $ vim -c \"%s/ABC/DEF/ge | update\" myfile.txt\n<\nTo replace \"ABC\" with \"DEF\" in multiple files from the command-line,\nyou can use the following command: >\n\n    $ vim -c \"argdo %s/ABC/DEF/ge | update\" *.txt\n<\nYou can store the group of commands into a file and use the \"-s\" command\nline option to run the commands on a set of files. For example, if the\ngroup of commands are stored in the file mycmds.txt, then you can use the\nfollowing command: >\n\n    $ vim -s mycmds.txt *.pl\n<\nFor more information, read:\n\n    |-c|\n    |-s|\n\n \t\t\t\t\t\t\t\t*faq-36.8*\n36.8. How do I use a normal mode command from insert mode without leaving\n      the insert mode?\n\nYou can use a normal command from insert mode, without leaving the insert\nmode, by first pressing the CTRL-O key and then follow that with a single\nnormal mode command.\n\nTo execute more than one normal mode command, press the CTRL-L key,\nfollowed by any number of normal mode commands and then press <Esc> to get\nback to the insert mode. (This only works, when the 'insertmode' option\nis set).\n\nFor more information, read:\n\n    |i_CTRL-O|\n    |i_CTRL-L|\n\n \t\t\t\t\t\t\t\t*faq-36.9*\n36.9. How do I start Vim in insert mode?\n\nYou can start Vim in insert mode using the `:startinsert` ex command. >\n\n    $ vim +startinsert myfile.txt\n<\nThe above command will open the file \"myfile.txt\" and start insert mode\nwith the cursor in front of the first character on the first line.  To open\nthe file and start appending after the last character on the last line,\nyou can use the following command: >\n\n    $ vim + +startinsert! myfile.txt\n<\nFor more information, read:\n\n    |:startinsert|\n\n \t\t\t\t\t\t\t\t*faq-36.10*\n36.10. How do I use Copy and Paste with Vim?\n\nYou should first check the output of the `:version` command and make\nsure that +xterm-clipboard is present.\n\nWhen running Vim in an xterm, you can either let Vim control the mouse\nor let xterm control the mouse. This is configured by the 'mouse' option.\n\nIf the 'mouse' option is not set (or set to the default value), then Vim will\nnot control the mouse. You cannot move the Vim text cursor using the\nmouse. When you select some text using the mouse, xterm will copy\nit to the X11 cut buffer. When you press both the mouse buttons,\nxterm will paste the text from the cut buffer.\n\nIf the 'mouse' option is set to \"a\" or some other value, then Vim controls\nthe mouse. The mode (normal or insert or visual, etc) in which Vim\ncontrols the mouse is configured by the 'mouse' option. You can move\nthe Vim text cursor using the mouse. When you select some text,\nthe 'clipboard' option setting is used to determine whether to transfer\nthe selected text to the clipboard or not. The default setting is to\ntransfer the selected text to the clipboard. If you want to use the\nxterm selection mechanism in this mode, then you can press the\n<Shift> key. If you press <Shift> key when selecting text using the\nmouse, then Vim doesn't control the mouse and xterm controls the\nmouse.\n\nIn the GUI mode, Copy and Paste should just work, depending on the 'mouse'\nsetting. For more information, read:\n\n    |'clipboard'|\n    |x11-selection|\n    |clipboard|\n    |'go-a'|\n    |'mouse'|\n    |xterm-copy-paste|\n    |09.3|\n\n \t\t\t\t\t\t\t\t*faq-36.11*\n36.11. Why shouldn't I modify the files in the system runtime directory?\n\nJust be careful about modifying files under $VIMRUNTIME, which usually\nis /usr/share/vim/vimXX (Unix) or C:\\Program Files\\vim\\vimXX\n(Windows) and XX being the version for which it applies, e.g. 73 for Vim\n7.3.\n\nOne should generally avoid modifying those files because they may be\nreplaced during an upgrade of your Vim installation and your changes\nwill be lost.  Also, if you upgrade to a new major or minor revision of\nVim (e.g., from 7.3 to 7.4), the new version of Vim will use a different\n$VIMRUNTIME directory and while your changes won't be lost, they will be\nignored.\n\nConsequently, take a look at\n\n    |filetypes|\n\nfor an explanation of several ways to modify Vim's response to\ndifferent filetypes and where to put those modifications so that\nthey will not be overwritten.\n\n=============================================================================\n \t\t\t\t\t\t\t\t*faq-37*\nSECTION 37 - UNICODE ~\nAuthor: Tony Mechelynck <antoine.mechelynck AT belgacom.net>\n\n \t\t\t\t\t\t\t\t*faq-37.1*\n37.1. Is it possible to create Unicode files using Vim?\n\nYes. It may be more or less complicated depending on the keyboard and fonts\navailable to you, but it is always possible to encode any possible Unicode\ncodepoint (and some illegal ones) into a file. To create a Unicode file\nusing Vim, you should have compiled Vim with the \"+multi_byte\" compile-time\noption.  You can get more information about Unicode from the following\nsites:\n\n    http://www.unicode.org\n    https://www.cl.cam.ac.uk/~mgk25/unicode.html\n\nFor more information, read:\n\n    |multibyte|\n    |usr_45.txt|\n\n \t\t\t\t\t\t\t\t*faq-37.2*\n37.2. Which Vim settings are particularly important for editing Unicode\n      files?\n\nThe most important are the various \"encoding\" options, i.e., 'encoding',\n'fileencoding', 'fileencodings' and 'termencoding'. The boolean option\n'bomb' is also significant.\n\nFor more information, read:\n\n    |'encoding'|\n    |'fileencoding'|\n    |'fileencodings'|\n    |'termencoding'|\n    |'bomb'|\n\n \t\t\t\t\t\t\t\t*faq-37.3*\n37.3. What is the 'encoding' option?\n\nBasically, the 'encoding' option defines how Vim will represent your data\ninternally.  However, all Unicode encodings are represented internally as\nutf-8 and converted (if necessary) when reading and writing.\n\nFor more information, read:\n\n    |'encoding'|\n\n \t\t\t\t\t\t\t\t*faq-37.4*\n37.4. How does Vim name the various Unicode encodings?\n\nUtf-8 is called utf-8 or utf8; utf-16 is called ucs-2 or ucs2; utf-32 is\ncalled ucs-4 or ucs4. Also, you may specify endianness (except for utf-8\nwhich does not vary for endianness) by appending le for little-endian or be\nfor big-endian. If you create a file with an encoding of ucs-2 or ucs-4\nwithout specifying endianness, Vim will use what is typical of your\nmachine.\n\nFor more information, read:\n\n    |encoding-names|\n    |encoding-values|\n    |encoding-table|\n\n \t\t\t\t\t\t\t\t*faq-37.5*\n37.5. How does Vim specify the presence or absence of a byte-order mark?\n\nWhen reading a file, if the 'fileencodings' option includes \"ucs-bom\", Vim\nwill check for a byte-order mark. When writing a file, if the 'bomb' option\nis set, Vim will write a byte-order mark on files whose encoding warrants\nit.\n\nFor more information, read:\n\n    |'fileencodings'|\n    |'bomb'|\n\n \t\t\t\t\t\t\t\t*faq-37.6*\n37.6. What is the 'fileencoding' option?\n\nThe 'fileencoding' option defines the particular encoding which Vim will\nuse to write a file. If empty, then the value of the 'encoding' option is\nthe default.\n\nFor more information, read:\n\n    |'fileencoding'|\n\n \t\t\t\t\t\t\t\t*faq-37.7*\n37.7. What is the 'fileencodings' option?\n\nThe 'fileencodings' option defines the heuristics used by Vim when opening\nan existing file. It is a comma separated list of encodings. A special\nname, \"ucs-bom\" is used to indicate that Vim should check for the presence\nof a byte-order mark; however, it will not be recognised if it comes after\n\"utf-8\".  Normally, \"ucs-bom\" (if present) should be first in the list.\n\nWhen Vim opens a file, it checks it against the encodings listed in\n'fileencodings'. The first one that matches is used. If there is no match,\nthen Vim sets 'fileencoding' to the null string, i.e., the value of\n'encoding' will be used.\n\nFor more information, read:\n\n    |'fileencodings'|\n    |'encoding'|\n\n \t\t\t\t\t\t\t\t*faq-37.8*\n37.8. What is the 'termencoding' option?\n\nThe 'termencoding' option defines how your keyboard encodes the data you\ntype.  If empty, Vim assumes that it has the same value as 'encoding'.\nUsually it should be set to something that matches your locale.\n\nFor more information, read:\n\n    |'termencoding'|\n    |locale|\n\n \t\t\t\t\t\t\t\t*faq-37.9*\n37.9. What is the 'bomb' option?\n\nWhen reading a file with \"ucs-bom\" present in the 'fileencodings' option,\nVim will set the 'bomb' option on or off depending on the presence or\nabsence of a byte-order mark at the start of the file. When writing, Vim\nwill write a byte-order mark if the 'bomb' option is set. You may set or\nunset it manually do make Vim write, or not write, the b.o.m.\n\nFor more information, read:\n\n    |'bomb'|\n\n \t\t\t\t\t\t\t\t*faq-37.10*\n37.10. Where can I find an example of a typical use of all these options?\n\nThere is a \"tip\", with explains them in different words with an example, at\n\n    http://vim.wikia.com/wiki/VimTip246\n\n \t\t\t\t\t\t\t\t*faq-37.11*\n37.11. How can I insert Unicode characters into a file using Vim?\n\nSeveral methods are available:\n\n- Characters present on your keyboard can be typed in the usual way, even\n  those which require a \"dead-key\" prefix, like (for instance) the\n  circumflex on French keyboards.\n- Characters for which a digraph is defined can be typed as two characters\n  prefixed by CTRL-K.\n- If you have set the 'digraph' option, you can enter the characters for\n  which a digraph is defined as <char1><BS><char2>.\n- Any character can be entered by using a CTRL-V prefix (or CTRL-Q if\n  CTRL-V is remapped to paste from the clipboard).\n\nFor more information, read:\n\n    |digraphs|\n    |'digraph'|\n    |i_CTRL-V_digit|\n\n \t\t\t\t\t\t\t\t*faq-37.12*\n37.12. How can I know which digraphs are defined and for which characters?\n\nFirst set the 'encoding' option properly (for instance, to utf-8), then use\nthe `:digraphs` command to list the currently defined digraphs.\n\nAlternatively, the help file contains the complete set of all digraphs.\nSo you can easily search that list there.\n\nFor more information, read:\n\n    |:digraphs|\n    |'encoding'|\n    |digraph-table|\n\n\n vim:tw=78:ts=8:ft=help:norl:\n"
  },
  {
    "path": "others/vim_faq.1",
    "content": ".\\\" -*- mode: troff; coding: utf-8 -*-\n.\\\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)\n.\\\"\n.\\\" Standard preamble:\n.\\\" ========================================================================\n.de Sp \\\" Vertical space (when we can't use .PP)\n.if t .sp .5v\n.if n .sp\n..\n.de Vb \\\" Begin verbatim text\n.ft CW\n.nf\n.ne \\\\$1\n..\n.de Ve \\\" End verbatim text\n.ft R\n.fi\n..\n.\\\" \\*(C` and \\*(C' are quotes in nroff, nothing in troff, for use with C<>.\n.ie n \\{\\\n.    ds C` \"\"\n.    ds C' \"\"\n'br\\}\n.el\\{\\\n.    ds C`\n.    ds C'\n'br\\}\n.\\\"\n.\\\" Escape single quotes in literal strings from groff's Unicode transform.\n.ie \\n(.g .ds Aq \\(aq\n.el       .ds Aq '\n.\\\"\n.\\\" If the F register is >0, we'll generate index entries on stderr for\n.\\\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index\n.\\\" entries marked with X<> in POD.  Of course, you'll have to process the\n.\\\" output yourself in some meaningful fashion.\n.\\\"\n.\\\" Avoid warning from groff about undefined register 'F'.\n.de IX\n..\n.nr rF 0\n.if \\n(.g .if rF .nr rF 1\n.if (\\n(rF:(\\n(.g==0)) \\{\\\n.    if \\nF \\{\\\n.        de IX\n.        tm Index:\\\\$1\\t\\\\n%\\t\"\\\\$2\"\n..\n.        if !\\nF==2 \\{\\\n.            nr % 0\n.            nr F 2\n.        \\}\n.    \\}\n.\\}\n.rr rF\n.\\\" ========================================================================\n.\\\"\n.IX Title \"vimfaq 1\"\n.TH vimfaq 1 2025-10-11 65 https://vimhelp.org/vim_faq.txt.html\n.\\\" For nroff, turn off justification.  Always turn off hyphenation; it makes\n.\\\" way too many mistakes in technical documents.\n.if n .ad l\n.nh\n.SH DESCRIPTION\n.IX Header \"DESCRIPTION\"\nThis Vim FAQ is created from the questions and answers posted to the\nvim@vim.org user mailing list and the comp.editors newsgroup. There are\nseveral ways to solve a problem in Vim. This FAQ gives one of those several\npossibilities. You can explore the other ways using the information and\nlinks given in this FAQ. The credit for the answers in this FAQ goes to\nPeppe, Benji, Charles Campbell and numerous others. An online version of\nthis FAQ is available at https://vimhelp.org/vim_faq.txt.html\n.SH \"GENERAL INFORMATION\"\n.IX Header \"GENERAL INFORMATION\"\n.Vb 5\n\\& 1.1. What is Vim?\n\\& 1.2. Who wrote Vim?\n\\& 1.3. Is Vim compatible with Vi?\n\\& 1.4. What are some of the improvements of Vim over Vi?\n\\& 1.5. Is Vim free?\n.Ve\n.SH RESOURCES\n.IX Header \"RESOURCES\"\n.Vb 10\n\\& 2.1. Where can I learn more about Vim?\n\\& 2.2. Is there a mailing list available?\n\\& 2.3. Is there an archive available for the Vim mailing lists?\n\\& 2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\n\\& 2.5. I have a \"xyz\" (some) problem with Vim. How do I determine if it is\n\\&      a problem with my setup or with Vim?\n\\& 2.6. Where can I report bugs?\n\\& 2.7. Where can the FAQ be found?\n\\& 2.8. What if I don\\*(Aqt find an answer in this FAQ?\n\\& 2.9. I have a patch for implementing a Vim feature. Where do I send the\n\\&      patch?\n\\& 2.10. I have a Vim tip or developed a new Vim\n\\&       syntax/indent/filetype/compiler plugin or developed a new script\n\\&       or a colorscheme. Is there a public website where I can upload\n\\&       this?\n.Ve\n.SH AVAILABILITY\n.IX Header \"AVAILABILITY\"\n.Vb 4\n\\& 3.1. What is the latest version of Vim?\n\\& 3.2. Where can I find the latest version of Vim?\n\\& 3.3. What platforms does it run on?\n\\& 3.4. Where can I download the latest version of the Vim runtime files?\n.Ve\n.SH HELP\n.IX Header \"HELP\"\n.Vb 7\n\\& 4.1. How do I use the help files?\n\\& 4.2. How do I search for a keyword in the Vim help files?\n\\& 4.3. I am getting an error message E123, what did I do wrong?\n\\& 4.4. Where can I read about the various modes in Vim?\n\\& 4.5. How do I generate the Vim help tags file after adding a new Vim\n\\&      help file?\n\\& 4.6. Can I use compressed versions of the help files?\n.Ve\n.SH \"EDITING A FILE\"\n.IX Header \"EDITING A FILE\"\n.Vb 10\n\\& 5.1. How do I load a file in Vim for editing?\n\\& 5.2. How do I save the current file in another name (save as) and edit\n\\&      a new file?\n\\& 5.3. How do I change the current directory to the directory of the\n\\&      current file?\n\\& 5.4. How do I write a file without the line feed (EOL) at the end of\n\\&      the file?\n\\& 5.5. How do I configure Vim to open a file at the last edited location?\n\\& 5.6. When editing a file in Vim, which is being changed by an external\n\\&      application, Vim opens a warning window (like the confirm dialog)\n\\&      each time a change is detected. How do I disable this warning?\n\\& 5.7. How do I edit a file whose name is under the cursor?\n\\& 5.8. How do I reload/re\\-edit the current file?\n\\& 5.9. How do I autosave a file periodically?\n\\& 5.10. How do I open a file in read\\-only mode?\n\\& 5.11. How do I open a file for editing without saving the modifications\n\\&       to the current file?\n\\& 5.12. How do I reduce the loading time for very large files in Vim?\n.Ve\n.SH \"EDITING MULTIPLE FILES\"\n.IX Header \"EDITING MULTIPLE FILES\"\n.Vb 10\n\\& 6.1. How do I open multiple files at once from within Vim?\n\\& 6.2. How do I switch between multiple files/buffers in Vim?\n\\& 6.3. How do I open several files in Vim, with each file in a separate\n\\&      window/tabpage?\n\\& 6.4. How do I configure Vim to autoload several files at once similar\n\\&      to \"work\\-sets\" or \"projects\"?\n\\& 6.5. Is it possible to open multiple top level windows in a single\n\\&      instance of Vim similar to Nedit or emacs?\n\\& 6.6. How do I browse/explore directories from within Vim?\n\\& 6.7. How do I edit files over a network using ftp/scp/rcp/http?\n.Ve\n.SH BACKUP\n.IX Header \"BACKUP\"\n.Vb 10\n\\& 7.1. When I edit and save files, Vim creates a file with the same name\n\\&      as the original file and a \"~\" character at the end. How do I stop\n\\&      Vim from creating this file (or) How do I disable the Vim backup\n\\&      file feature?\n\\& 7.2. When I edit and save files, Vim creates a file with the same name\n\\&      as the original file and a \".un~\" extension at the end. How do I\n\\&      stop Vim from creating this file (or) How do I disable the Vim\n\\&      undofile feature.\n\\& 7.3. How do I configure Vim to store all the backup files in a\n\\&      particular directory?\n\\& 7.4. When I save a file with Vim, the file permissions are changed.\n\\&      How do I configure Vim to save a file without changing the file\n\\&      permissions?\n.Ve\n.SH BUFFERS\n.IX Header \"BUFFERS\"\n.Vb 10\n\\& 8.1. I have made some modifications to a buffer. How do I edit another\n\\&      buffer without saving the modified buffer and also without losing\n\\&      the modifications?\n\\& 8.2. How do I configure Vim to auto\\-save a modified buffer when\n\\&      switching to another buffer?\n\\& 8.3. How do I replace the buffer in the current window with a blank\n\\&      buffer?\n\\& 8.4. Is there a keyboard shortcut to load a buffer by the buffer\n\\&      number?\n\\& 8.5. How do I open all the current buffers in separate windows?\n\\& 8.6. How do I close (delete) a buffer without exiting Vim?\n\\& 8.7. When I use the command \\`:%bd\\` to delete all the buffers, not all\n\\&      the buffers are deleted. Why?\n\\& 8.8. How do I display the buffer number of the current buffer/file?\n\\& 8.9. How do I delete a buffer without closing the window in which the\n\\&      buffer is displayed?\n\\& 8.10. How do I map the <Tab> key to cycle through and open all the\n\\&       buffers?\n.Ve\n.SH WINDOWS\n.IX Header \"WINDOWS\"\n.Vb 5\n\\& 9.1. What is the difference between a Vim window and a buffer?\n\\& 9.2. How do I increase the width of a Vim window?\n\\& 9.3. How do I zoom into or out of a window?\n\\& 9.4. How do I execute an ex command on all the open buffers or open\n\\&      windows or all the files in the argument list?\n.Ve\n.SH MOTION\n.IX Header \"MOTION\"\n.Vb 10\n\\& 10.1. How do I jump to the beginning (first line) or end (last line) of\n\\&       a file?\n\\& 10.2. In insert mode, when I press the <Esc> key to go to command mode,\n\\&       the cursor moves one character to the left (except when the\n\\&       cursor is on the first character of the line). Is it possible to\n\\&       change this behavior to keep the cursor at the same column?\n\\& 10.3. How do I configure Vim to maintain the horizontal cursor position\n\\&       when scrolling with the <Page Up>, <Page Down>, etc keys?\n\\& 10.4. Some lines in a file are more than the screen width and they are\n\\&       all wrapped. When I use the j, k keys to move from one line to\n\\&       the next, the cursor is moved to the next line in the file\n\\&       instead of the next line on the screen. How do I move from one\n\\&       screen line to the next?\n\\& 10.5. What is the definition of a sentence, paragraph and section in\n\\&       Vim?\n\\& 10.6. How do I jump to beginning or end of a sentence, paragraph or a\n\\&       section?\n\\& 10.7. I have lines in a file that extends beyond the right extent of the\n\\&       screen. How do I move the Vim view to the right to see the text\n\\&       off the screen?\n\\& 10.8. How do I scroll two or more buffers simultaneously?\n\\& 10.9. When I use my arrow keys, Vim changes modes, inserts weird\n\\&       characters in my document but doesn\\*(Aqt move the cursor properly.\n\\&       What\\*(Aqs going on?\n\\& 10.10. How do I configure Vim to move the cursor to the end of the\n\\&        previous line, when the left arrow key is pressed and the cursor\n\\&        is currently at the beginning of a line?\n\\& 10.11. How do I configure Vim to stay only in insert mode (modeless\n\\&        editing)?\n\\& 10.12. How do I display some context lines when scrolling text?\n\\& 10.13. How do I go back to previous cursor locations?\n.Ve\n.SH \"SEARCHING TEXT\"\n.IX Header \"SEARCHING TEXT\"\n.Vb 10\n\\& 11.1. After I searched for a text with a pattern, all the matched text\n\\&       stays highlighted. How do I turn off the highlighting\n\\&       temporarily/permanently?\n\\& 11.2. How do I enter a carriage return character in a search pattern?\n\\& 11.3. How do I search for the character \"^M\"?\n\\& 11.4. How can I search/replace characters that display as \"~R\", \"~S\",\n\\&       etc.?\n\\& 11.5. How do I highlight all the non\\-printable characters in a file?\n\\& 11.6. How do I search for whole words in a file?\n\\& 11.7. How do I search for the current word under the cursor?\n\\& 11.8. How do I search for a word without regard to the case (uppercase\n\\&       or lowercase)?\n\\& 11.9. How do I search for words that occur twice consecutively?\n\\& 11.10. How do I count the number of times a particular word occurs in a\n\\&        buffer?\n\\& 11.11. How do I place the cursor at the end of the matched word when\n\\&        searching for a pattern?\n\\& 11.12. How do I search for an empty line?\n\\& 11.13. How do I search for a line containing only a single character?\n\\& 11.14. How do I search and replace a string in multiple files?\n\\& 11.15. I am using the \\`:s\\` substitute command in a mapping. When a\n\\&        search for a pattern fails, the map terminates. I would like the\n\\&        map to continue processing the next command, even if the\n\\&        substitute command fails. How do I do this?\n\\& 11.16. How do I search for the n\\-th occurrence of a character in a\n\\&        line?\n\\& 11.17. How do I replace a tab (or any other character) with a hard\n\\&        return (newline) character?\n\\& 11.18. How do I search for a character by its ASCII value?\n\\& 11.19. How do I search for long lines?\n\\& 11.20. How do I display all the lines in the current buffer that\n\\&        contain a specified pattern?\n\\& 11.21. How do I search for a text string that spans multiple lines?\n\\& 11.22. How do I search for a pattern only within a range of lines\n\\&        in a buffer?\n\\& 11.23. How do I clear the last searched pattern?\n\\& 11.24. Why does this pattern \"a.\\e{\\-}p\\e@!\" not match?\n\\& 11.25. How can I use \"/\" within a pattern, without escaping it?\n\\& 11.26. How can I operate on a search match?\n.Ve\n.SH \"CHANGING TEXT\"\n.IX Header \"CHANGING TEXT\"\n.Vb 10\n\\& 12.1. How do I delete all the trailing white space characters (SPACE\n\\&       and TAB) at the end of all the lines in a file?\n\\& 12.2. How do I replace all the occurrences of multiple consecutive\n\\&       space characters to a single space?\n\\& 12.3. How do I reduce a range of empty lines into one line only?\n\\& 12.4. How do I delete all blank lines in a file? How do I remove all\n\\&       the lines containing only space characters?\n\\& 12.5. How do I copy/yank the current word?\n\\& 12.6. How do I yank text from one position to another position within a\n\\&       line, without yanking the entire line?\n\\& 12.7. When I yank some text into a register, how do I append the text\n\\&       to the current contents of the register?\n\\& 12.8. How do I yank a complete sentence that spans over more than one\n\\&       line?\n\\& 12.9. How do I yank all the lines containing a pattern into a buffer?\n\\& 12.10. How do I delete all the lines in a file that do not contain a\n\\&        pattern?\n\\& 12.11. How do I add a line before each line with \"pattern\" in it?\n\\& 12.12. Is there a way to operate on a line if the previous line\n\\&        contains a particular pattern?\n\\& 12.13. How do I execute a command on all the lines containing a\n\\&        pattern?\n\\& 12.14. Can I copy the character above the cursor to the current cursor\n\\&        position?\n\\& 12.15. How do I insert a blank line above/below the current line\n\\&        without entering insert mode?\n\\& 12.16. How do I insert the name of the current file into the current\n\\&        buffer?\n\\& 12.17. How do I insert the contents of a Vim register into the current\n\\&        buffer?\n\\& 12.18. How do I move the cursor past the end of line and insert some\n\\&        characters at some columns after the end of the line?\n\\& 12.19. How to replace the word under the cursor (say: junk) with\n\\&        \"foojunkbar\" in Vim?\n\\& 12.20. How do I replace a particular text in all the files in a\n\\&        directory?\n\\& 12.21. I have some numbers in a file. How do I increment or decrement\n\\&        the numbers in the file?\n\\& 12.22. How do I reuse the last used search pattern in a \\`:substitute\\`\n\\&        command?\n\\& 12.23. How do I change the case of a string using the \\`:substitute\\`\n\\&        command?\n\\& 12.24. How do I enter characters that are not present in the keyboard?\n\\& 12.25. Is there a command to remove any or all digraphs?\n\\& 12.26. In insert mode, when I press the backspace key, it erases only\n\\&        the characters entered in this instance of insert mode. How do I\n\\&        erase previously entered characters in insert mode using the\n\\&        backspace key?\n\\& 12.27. I have a file which has lines longer than 72 characters\n\\&        terminated with \"+\" and wrapped to the next line. How can I\n\\&        quickly join the lines?\n\\& 12.28. How do I paste characterwise yanked text into separate lines?\n\\& 12.29. How do I change the case (uppercase, lowercase) of a word or\n\\&        a character or a block of text?\n\\& 12.30. How do I enter ASCII characters that are not present in the\n\\&        keyboard?\n\\& 12.31. How do I replace non\\-printable characters in a file?\n\\& 12.32. How do I remove duplicate lines from a buffer?\n\\& 12.33. How do I prefix all the lines in a file with the corresponding\n\\&        line numbers?\n\\& 12.34. How do I exchange (swap) two characters or words or lines?\n\\& 12.35. How do I change the characters used as word delimiters?\n.Ve\n.SH \"COMPLETION IN INSERT MODE\"\n.IX Header \"COMPLETION IN INSERT MODE\"\n.Vb 4\n\\& 13.1. How do I complete words or lines in insert mode?\n\\& 13.2. How do I complete file names in insert mode?\n\\& 13.3. I am using CTRL\\-P/CTRL\\-N to complete words in insert mode. How do\n\\&       I complete words that occur after the just completed word?\n.Ve\n.SH \"TEXT FORMATTING\"\n.IX Header \"TEXT FORMATTING\"\n.Vb 10\n\\& 14.1. How do I format a text paragraph so that a new line is inserted\n\\&       at the end of each wrapped line?\n\\& 14.2. How do I format long lines in a file so that each line contains\n\\&       less than \"n\" characters?\n\\& 14.3. How do I join short lines to the form a paragraph?\n\\& 14.4. How do I format bulleted and numbered lists?\n\\& 14.5. How do I indent lines in insert mode?\n\\& 14.6. How do I format/indent an entire file?\n\\& 14.7. How do I increase or decrease the indentation of the current\n\\&       line?\n\\& 14.8. How do I indent a block/group of lines?\n\\& 14.9. When I indent lines using the > or < key, the standard 8\\-tabstops\n\\&       are used instead of the current \\*(Aqtabstop\\*(Aq setting. Why?\n\\& 14.10. How do I turn off the automatic indentation of text?\n\\& 14.11. How do I configure Vim to automatically set the \\*(Aqtextwidth\\*(Aq\n\\&        option to a particular value when I edit mails?\n\\& 14.12. Is there a way to make Vim auto\\-magically break lines?\n\\& 14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n\\&        \\*(Aqfileformat\\*(Aq option to \\*(Aqdos\\*(Aq and then \\*(Aqunix\\*(Aq and then \\*(Aqmac\\*(Aq.\n\\&        None of these helped. How can I hide these symbols?\n\\& 14.14. When I paste some text into a Vim buffer from another\n\\&        application, the alignment (indentation) of the new text is\n\\&        messed up. How do I fix this?\n\\& 14.15. When there is a very long wrapped line (wrap is \"on\") and a line\n\\&        doesn\\*(Aqt fit entirely on the screen it is not displayed at all.\n\\&        There are blank lines beginning with \"@\" symbol instead of\n\\&        wrapped line. If I scroll the screen to fit the line the \"@\"\n\\&        symbols disappear and the line is displayed again. What Vim\n\\&        setting control this behavior?\n\\& 14.16. How do I convert all the tab characters in a file to space\n\\&        characters?\n\\& 14.17. What Vim options can I use to edit text that will later go to a\n\\&        word processor?\n\\& 14.18. How do I join lines without adding or removing any space\n\\&        characters?\n.Ve\n.SH \"VISUAL MODE\"\n.IX Header \"VISUAL MODE\"\n.Vb 10\n\\& 15.1. How do I do rectangular block copying?\n\\& 15.2. How do I delete or change a column of text in a file?\n\\& 15.3. How do I apply an ex\\-command on a set of visually selected lines?\n\\& 15.4. How do I execute an ex command on a column of text selected in\n\\&       Visual block mode?\n\\& 15.5. How do I select the entire file in visual mode?\n\\& 15.6. When I visually select a set of lines and press the > key to\n\\&       indent the selected lines, the visual mode ends. How can I\n\\&       reselect the region for further operation?  (or) How do I\n\\&       re\\-select the last selected visual area again?\n\\& 15.7. How do I jump to the beginning/end of a visually selected region?\n\\& 15.8. When I select text with mouse and then press : to enter an ex\n\\&       command, the selected text is replaced with the : character. How\n\\&       do I execute an ex command on a text selected using the mouse\n\\&       similar to the text selected using the visual mode?\n\\& 15.9. When I select a block of text using the mouse, Vim goes into\n\\&       selection mode instead of Visual mode. Why?\n.Ve\n.SH \"COMMAND-LINE MODE\"\n.IX Header \"COMMAND-LINE MODE\"\n.Vb 10\n\\& 16.1. How do I use the name of the current file in the command mode or\n\\&       an ex command line?\n\\& 16.2. How do I edit the text in the Vim command\\-line effectively?\n\\& 16.3. How do I switch from Vi mode to Ex mode?\n\\& 16.4. How do I copy the output from an ex\\-command into a buffer?\n\\& 16.5. When I press the <Tab> key to complete the name of a file in the\n\\&       command mode, if there are more than one matching file names,\n\\&       then Vim completes the first matching file name and displays a\n\\&       list of all matching filenames. How do I configure Vim to only\n\\&       display the list of all the matching filenames and not complete\n\\&       the first one?\n\\& 16.6. How do I copy text from a buffer to the command line and from the\n\\&       command line to a buffer?\n\\& 16.7. How do I put a command onto the command history without executing\n\\&       it?\n\\& 16.8. How do I increase the height of the command\\-line?\n.Ve\n.SH VIMINFO\n.IX Header \"VIMINFO\"\n.Vb 5\n\\& 17.1. When I invoke Vim, I get error messages about illegal characters\n\\&       in the viminfo file. What should I do to get rid of these\n\\&       messages?\n\\& 17.2. How do I disable the viminfo feature?\n\\& 17.3. How do I save and use Vim marks/commands across Vim sessions?\n.Ve\n.SH \"REMOTE EDITING\"\n.IX Header \"REMOTE EDITING\"\n.Vb 6\n\\& 18.1. How do I open a file with existing instance of gvim? What\n\\&       happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n\\& 18.2. How do I send a command to a Vim server to write all buffers to\n\\&       disk?\n\\& 18.3. Where can I get the documentation about the Vim remote server\n\\&       functionality?\n.Ve\n.SH OPTIONS\n.IX Header \"OPTIONS\"\n.Vb 10\n\\& 19.1. How do I configure Vim in a simple way?\n\\& 19.2. How do I toggle the value of an option?\n\\& 19.3. How do I set an option that affects only the current\n\\&       buffer/window?\n\\& 19.4. How do I use space characters for a Vim option value?\n\\& 19.5. Can I add (embed) Vim option settings to the contents of a file?\n\\& 19.6. How do I display the line numbers of all the lines in a file?\n\\& 19.7. How do I change the width of the line numbers displayed using the\n\\&       \\*(Aqnumber\\*(Aq option?\n\\& 19.8. How do I display (view) all the invisible characters like space,\n\\&       tabs and newlines in a file?\n\\& 19.9. How do I configure Vim to always display the current line and\n\\&       column number?\n\\& 19.10. How do I display the current Vim mode?\n\\& 19.11. How do I configure Vim to show pending/partial commands on the\n\\&        status line?\n\\& 19.12. How do I configure the Vim status line to display different\n\\&        settings/values?\n\\& 19.13. How do I configure Vim to display status line always?\n\\& 19.14. How do I make a Vim setting persistent across different Vim\n\\&        invocations/instances/sessions?\n\\& 19.15. Why do I hear a beep (why does my window flash) about 1 second\n\\&        after I hit the Escape key?\n\\& 19.16. How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n\\&        deleting the characters I\\*(Aqm changing?\n\\& 19.17. How do I remove more than one flag using a single \\`:set\\` command\n\\&        from a Vim option?\n.Ve\n.SH \"MAPPING KEYS\"\n.IX Header \"MAPPING KEYS\"\n.Vb 10\n\\& 20.1. How do I know what a key is mapped to?\n\\& 20.2. How do I list all the user\\-defined key mappings?\n\\& 20.3. How do I unmap a key?\n\\& 20.4. I am not able to create a mapping for the <xxx> key. What is\n\\&       wrong?\n\\& 20.5. Why does mapping the <C\\-...> key not work?\n\\& 20.6. How do I map the numeric keypad keys?\n\\& 20.7. How do I create a mapping that works only in visual mode?\n\\& 20.8. How do I create a mapping that works only in normal and operator\n\\&       pending mode (but not in visual mode)?\n\\& 20.9. In a Vim script, how do I know which keys to use for my mappings,\n\\&       so that the mapped key will not collide with an already used key?\n\\& 20.10. How do I map the escape key?\n\\& 20.11. How do I map a key to perform nothing?\n\\& 20.12. I want to use the <Tab> key to indent a block of text and\n\\&        <Shift\\-Tab> key to unindent a block of text. How do I map the keys\n\\&        to do this?  This behavior is similar to textpad, visual studio,\n\\&        etc.\n\\& 20.13. In my mappings the special characters like <CR> are not\n\\&        recognized. How can I configure Vim to recognize special\n\\&        characters?\n\\& 20.14. How do I use the \"|\" to separate multiple commands in a map?\n\\& 20.15. If I have a mapping/abbreviation whose ending is the beginning of\n\\&        another mapping/abbreviation, how do I keep the first from\n\\&        expanding into the second one?\n\\& 20.16. Why does it take a second or more for Vim to process a key,\n\\&        sometimes when I press a key?\n\\& 20.17. How do I map a key to run an external command using a visually\n\\&        selected text?\n\\& 20.18. How do I map the CTRL\\-I key while still retaining the\n\\&        functionality of the <Tab> key?\n\\& 20.19. How do I define a map to accept a count?\n\\& 20.20. How can I make my normal mode mapping work from within Insert\n\\&        Mode?\n.Ve\n.SH ABBREVIATIONS\n.IX Header \"ABBREVIATIONS\"\n.Vb 7\n\\& 21.1. How do I auto correct misspelled words?\n\\& 21.2. How do I create multi\\-line abbreviations?\n\\& 21.3. When my abbreviations are expanded, an additional space character\n\\&       is added at the end of the expanded text. How do I avoid this\n\\&       character?\n\\& 21.4. How do I insert the current date/time stamp into the file?\n\\& 21.5. How do I prevent an abbreviation from expanding in insert mode?\n.Ve\n.SH \"RECORD AND PLAYBACK\"\n.IX Header \"RECORD AND PLAYBACK\"\n.Vb 9\n\\& 22.1. How do I repeat an editing operation (insertion, deletion, paste,\n\\&       etc)?\n\\& 22.2. How I record and repeat a set of key sequences?\n\\& 22.3. How do I edit/modify a recorded set of key sequences?\n\\& 22.4. How do I write recorded key sequences to a file?\n\\& 22.5. I am using register 0 to record my key sequences (i.e. q0 ....\n\\&       q). In the recorded key sequences, I am yanking some text.  After\n\\&       the first replay of the recorded key sequence, I am no longer\n\\&       able to play it back.\n.Ve\n.SH AUTOCOMMANDS\n.IX Header \"AUTOCOMMANDS\"\n.Vb 9\n\\& 23.1. How do I execute a command when I try to modify a read\\-only file?\n\\& 23.2. How do I execute a command every time when entering a buffer?\n\\& 23.3. How do I execute a command every time when entering a window?\n\\& 23.4. From an autocmd, how can I determine the name of the file or the\n\\&       buffer number for which the autocommand is executed?\n\\& 23.5. How do I automatically save all the changed buffers whenever Vim\n\\&       loses focus?\n\\& 23.6. How do I execute/run a function when Vim exits to do some\n\\&       cleanup?\n.Ve\n.SH \"SYNTAX HIGHLIGHT\"\n.IX Header \"SYNTAX HIGHLIGHT\"\n.Vb 10\n\\& 24.1. How do I turn off/on syntax highlighting?\n\\& 24.2. How do I change the background and foreground colors used by Vim?\n\\& 24.3. How do I change the highlight colors to suit a dark/light\n\\&       background?\n\\& 24.4. How do I change the color of the line numbers displayed when the\n\\&       \\`:set number\\` command is used?\n\\& 24.5. How do I change the background color used for a Visually selected\n\\&       block?\n\\& 24.6. How do I highlight the special characters (tabs, trailing spaces,\n\\&       end of line, etc) displayed by the \\*(Aqlist\\*(Aq option?\n\\& 24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that\n\\&       Vim uses the specified colorscheme every time?\n\\& 24.8. Vim syntax highlighting is broken. When I am editing a file, some\n\\&       parts of the file is not syntax highlighted or syntax highlighted\n\\&       incorrectly.\n\\& 24.9. Is there a built\\-in function to syntax\\-highlight the\n\\&       corresponding matching bracket?\n\\& 24.10. How do I turn off the C comment syntax highlighting?\n\\& 24.11. How do I add my own syntax extensions to the standard syntax\n\\&        files supplied with Vim?\n\\& 24.12. How do I replace a standard syntax file that comes with the Vim\n\\&        distribution with my own syntax file?\n\\& 24.13. How do I highlight all the characters after a particular column?\n\\& 24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n\\&        highlighting into a HTML file?\n\\& 24.15. How do I list the definition of all the current highlight\n\\&        groups?\n\\& 24.16. How can I embed one syntax highlighting language into another\n\\&        one?\n.Ve\n.SH \"VIM SCRIPT WRITING\"\n.IX Header \"VIM SCRIPT WRITING\"\n.Vb 10\n\\& 25.1. How do I list the names of all the scripts sourced by Vim?\n\\& 25.2. How do I debug Vim scripts?\n\\& 25.3. How do I locate the script/plugin which sets a Vim option?\n\\& 25.4. I am getting some error/informational messages from Vim (possibly\n\\&       when running a script), the messages are cleared immediately. How\n\\&       do I display the messages again?\n\\& 25.5. How do I save and restore a plugin specific information across\n\\&       Vim invocations?\n\\& 25.6. How do I start insert mode from a Vim function?\n\\& 25.7. How do I change the cursor position from within a Vim function?\n\\& 25.8. How do I check the value of an environment variable in the .vimrc\n\\&       file?\n\\& 25.9. How do I check whether an environment variable is set or not from\n\\&       a Vim function?\n\\& 25.10. How do I call/use the Vim built\\-in functions?\n\\& 25.11. I am using some normal mode commands in my Vim script. How do I\n\\&        avoid using the user\\-defined mappings for these normal mode\n\\&        commands and use the standard Vim functionality for these normal\n\\&        mode commands?\n\\& 25.12. How do I get a visually selected text into a Vim variable or\n\\&        register?\n\\& 25.13. I have some text in a Vim variable \"myvar\". I would like to use\n\\&        this variable in a \\`:s\\` substitute command to replace a text\n\\&        \"mytext\". How do I do this?\n\\& 25.14. A Vim variable (bno) contains a buffer number. How do I use this\n\\&        variable to open the corresponding buffer?\n\\& 25.15. How do I store the value of a Vim option into a Vim variable?\n\\& 25.16. I have copied and inserted some text into a buffer from a Vim\n\\&        function. How do I indent the inserted text from the Vim\n\\&        function?\n\\& 25.17. How do I get the character under the cursor from a Vim script?\n\\& 25.18. How do I get the name of the current file without the extension?\n\\& 25.19. How do I get the basename of the current file?\n\\& 25.20. How do I get the output from a Vim function into the current\n\\&        buffer?\n\\& 25.21. How do I call external programs from a Vim function?\n\\& 25.22. How do I get the return status of a program executed using the\n\\&        \\`:!\\` command?\n\\& 25.23. How do I determine whether the current buffer is modified or\n\\&        not?\n\\& 25.24. I would like to use the carriage return character in a normal\n\\&        command from a Vim script. How do I specify the carriage return\n\\&        character?\n\\& 25.25. How do I split long lines in a Vim script?\n\\& 25.26. When I try to \"execute\" my function using the \\`:execute Myfunc()\\`\n\\&        command, the cursor is moved to the top of the current buffer.\n\\&        Why?\n\\& 25.27. How do I source/execute the contents of a register?\n\\& 25.28. After calling a Vim function or a mapping, when I press the \"u\"\n\\&        key to undo the last change, Vim undoes all the changes made by\n\\&        the mapping/function. Why?\n\\& 25.29. How can I call a function defined with s: (script local\n\\&        function) from another script/plugin?\n\\& 25.30. Is it possible to un\\-source a sourced script? In other words,\n\\&        reverse all the commands executed by sourcing a script.\n.Ve\n.SH PLUGINS\n.IX Header \"PLUGINS\"\n.Vb 12\n\\& 26.1. How do I set different options for different types of files?\n\\& 26.2. I have downloaded a Vim plugin or a syntax file or a indent file,\n\\&       or a color scheme or a filetype plugin from the web. Where should\n\\&       I copy these files so that Vim will find them?\n\\& 26.3. How do I extend an existing filetype plugin?\n\\& 26.4. How do I turn off loading the Vim plugins?\n\\& 26.5. How do I turn on/off loading the filetype plugins?\n\\& 26.6. How do I override settings made in a file type plugin in the\n\\&       global ftplugin directory for all the file types?\n\\& 26.7. How do I disable the Vim directory browser plugin?\n\\& 26.8. How do I set the filetype option for files with names matching a\n\\&       particular pattern or depending on the file extension?\n.Ve\n.SH \"EDITING PROGRAM FILES\"\n.IX Header \"EDITING PROGRAM FILES\"\n.Vb 10\n\\& 27.1. How do I enable automatic indentation for C/C++ files?\n\\& 27.2. How do I configure the indentation used for C/C++ files?\n\\& 27.3. How do I turn off the automatic indentation feature?\n\\& 27.4. How do I change the number of space characters used for the\n\\&       automatic indentation?\n\\& 27.5. I am editing a C program using Vim. How do I display the\n\\&       definition of a macro or a variable?\n\\& 27.6. I am editing a C program using Vim. How do I jump to the\n\\&       beginning or end of a code block from within the block?\n\\& 27.7. When editing C++ files and when inserting new lines above or\n\\&       below a comment (//) line, Vim automatically inserts the C++\n\\&       comment character (//) at the beginning of the line. How do I\n\\&       disable this? (*Updated*)\n\\& 27.8. How do I add the comment character \"#\" to a set of lines at the\n\\&       beginning of each line?\n\\& 27.9. How do I edit a header file with the same name as the\n\\&       corresponding C source file?\n\\& 27.10. How do I automatically insert comment leaders while typing\n\\&        comments?\n.Ve\n.SH QUICKFIX\n.IX Header \"QUICKFIX\"\n.Vb 8\n\\& 28.1. How do I build programs from Vim?\n\\& 28.2. When I run the make command in Vim I get the errors listed as the\n\\&       compiler compiles the program. When it finishes this list\n\\&       disappears and I have to use the \\`:clist\\` command to see the error\n\\&       message again. Is there any other way to see these error\n\\&       messages?\n\\& 28.3. How can I perform a command for each item in the\n\\&       quickfix/location list?\n.Ve\n.SH FOLDING\n.IX Header \"FOLDING\"\n.Vb 10\n\\& 29.1. How do I extend the Vim folding support?\n\\& 29.2. When I enable folding by setting the \\*(Aqfoldmethod\\*(Aq option, all the\n\\&       folds are closed. How do I prevent this?\n\\& 29.3. How do I control how many folds will be opened when I start\n\\&       editing a file?\n\\& 29.4. How do I open and close folds using the mouse?\n\\& 29.5. How do I change the text displayed for a closed fold?\n\\& 29.6. How do I store and restore manually created folds across\n\\&       different Vim invocations?\n\\& 29.7. I have enabled syntax based folding. Why is Vim so slow?\n.Ve\n.SH \"VIM WITH EXTERNAL APPLICATIONS\"\n.IX Header \"VIM WITH EXTERNAL APPLICATIONS\"\n.Vb 11\n\\& 30.1. Can I run a shell inside a Vim window?\n\\& 30.2. How do I pass the word under the cursor to an external command?\n\\& 30.3. How do I get the output of a shell command into a Vim buffer?\n\\& 30.4. How do I pipe the contents of the current buffer to an external\n\\&       command and replace the contents of the buffer with the output\n\\&       from the command?\n\\& 30.5. How do I sort a section of my file?\n\\& 30.6. How do I use Vim as a pager?\n\\& 30.7. How do I view Unix man pages from inside Vim?\n\\& 30.8. How do I change the diff command used by the Vim diff support?\n\\& 30.9. How do I use the Vim diff mode without folding?\n.Ve\n.SH \"GUI VIM\"\n.IX Header \"GUI VIM\"\n.Vb 10\n\\& 31.1. How do I create buffer specific menus?\n\\& 31.2. How do I change the font used by GUI Vim?\n\\& 31.3. When starting GUI Vim, how do I specify the location of the GVIM\n\\&       window?\n\\& 31.4. How do I add a horizontal scrollbar in GVim?\n\\& 31.5. How do I make the scrollbar appear in the left side by default?\n\\& 31.6. How do I remove the Vim menubar?\n\\& 31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the\n\\&       menu starting with that letter is selected. I don\\*(Aqt want this\n\\&       behavior as I want to map the <Alt>\\-<key> combination. How do I do\n\\&       this?\n\\& 31.8. Is it possible to scroll the text by dragging the scrollbar so\n\\&       that the cursor stays in the original location?\n\\& 31.9. How do I get gvim to start browsing files in a particular\n\\&       directory when using the \\`:browse\\` command?\n\\& 31.10. For some questions, like when a file is changed outside of Vim,\n\\&        Vim displays a GUI dialog box. How do I replace this GUI dialog\n\\&        box with a console dialog box?\n\\& 31.11. I am trying to use GUI Vim as the editor for my xxx application.\n\\&        When the xxx application launches GUI Vim to edit a file, the\n\\&        control immediately returns to the xxx application. How do I\n\\&        start GUI Vim, so that the control returns to the xxx\n\\&        application only after I quit Vim?\n\\& 31.12. Why does the \"Select Font\" dialog doesn\\*(Aqt show all the fonts\n\\&        installed in my system?\n\\& 31.13. How do I use the mouse in Vim command\\-line mode?\n\\& 31.14. When I use the middle mouse button to scroll text, it pastes the\n\\&        last copied text. How do I disable this behavior?\n\\& 31.15. How do I change the location and size of a GUI Vim window?\n\\& 31.16. When splitting the Vim window vertically, Vim changes\n\\&        the position.\n.Ve\n.SH \"VIM ON UNIX\"\n.IX Header \"VIM ON UNIX\"\n.Vb 10\n\\& 32.1. I am running Vim in a xterm. When I press the CTRL\\-S key, Vim\n\\&       freezes. What should I do now?\n\\& 32.2. I am seeing weird screen update problems in Vim. What can I do to\n\\&       solve this screen/display update problems?\n\\& 32.3. I am using the terminal/console version of Vim. In insertmode,\n\\&       When I press the backspace key, the character before the cursor\n\\&       is not erased. How do I configure Vim to do this?\n\\& 32.4. I am using Vim in a xterm. When I quit Vim, the screen contents\n\\&       are restored back to the original contents. How do I disable\n\\&       this?\n\\& 32.5. When I start Vim, it takes quite a few seconds to start. How do I\n\\&       minimize the startup time?\n\\& 32.6. How can I make the cursor in gvim in unix stop blinking?\n\\& 32.7. How do I change the menu font on GTK Vim?\n\\& 32.8. How do I prevent CTRL\\-Z from suspending Vim?\n\\& 32.9. When I kill the xterm running Vim, the Vim process continues to\n\\&       run and takes up a lot of CPU (99%) time. Why is this happening?\n\\& 32.10. How do I get the Vim syntax highlighting to work in a Unix\n\\&        terminal?\n.Ve\n.SH \"VIM ON MS-WINDOWS\"\n.IX Header \"VIM ON MS-WINDOWS\"\n.Vb 10\n\\& 33.1. In MS\\-Windows, CTRL\\-V doesn\\*(Aqt start the blockwise visual mode.\n\\&       What happened?\n\\& 33.2. When I press the CTRL\\-Y key, it acts like the CTRL\\-R key. How do\n\\&       I configure Vim to treat CTRL\\-Y as CTRL\\-Y?\n\\& 33.3. How do I start GUI Vim in a maximized window always?\n\\& 33.4. After doing some editing operations, Vim freezes. The cursor\n\\&       becomes an empty rectangle. I am not able enter any characters.\n\\&       What is happening?\n\\& 33.5. I am using Windows XP, the display speed of maximized GVim is\n\\&       very slow. What can I do to speed the display updates?\n\\& 33.6. What are the recommended settings for using Vim with cygwin?\n\\& 33.7. I am trying to use GNU diff with Vim diff mode. When I run the\n\\&       diff from command line, it works. When I try to use the diff with\n\\&       Vim it doesn\\*(Aqt work. What should I do now?\n\\& 33.8. Is it possible to use Vim as an external editor for MS\\-Windows\n\\&       Outlook email client?\n\\& 33.9. I am using Vim to edit HTML files. How do I start internet\n\\&       explorer with the current file to preview the HTML file?\n\\& 33.10. I would like to use Vim with Microsoft Visual Studio. How do I\n\\&        do this?\n\\& 33.11. Where do I place the _vimrc and _gvimrc files?\n\\& 33.12. Every time I save a file, Vim warns about the file being changed\n\\&        outside of Vim. Why?\n.Ve\n.SH PRINTING\n.IX Header \"PRINTING\"\n.Vb 2\n\\& 34.1. How do I print a file along with line numbers for all the lines?\n\\& 34.2. How do I print a file with the Vim syntax highlighting colors?\n.Ve\n.SH \"BUILDING VIM FROM SOURCE\"\n.IX Header \"BUILDING VIM FROM SOURCE\"\n.Vb 10\n\\& 35.1. How do I build Vim from the sources on a Unix system?\n\\& 35.2. How do I install Vim in my home directory or a directory other\n\\&       than the default installation directory in Unix?\n\\& 35.3. How do I build Vim from the sources on a MS\\-Windows system?\n\\& 35.4. The Vim help, syntax, indent files are missing from my Vim\n\\&       installation. How do I install these files?\n\\& 35.5. I have built Vim from the source and installed the Vim package\n\\&       using \"make install\". Do I need to keep the Vim source directory?\n\\& 35.6. How do I determine the Vim features which are enabled at compile\n\\&       time?\n\\& 35.7. Can I build Vim without the GUI support?\n\\& 35.8. When building Vim on a Unix system, I am getting \"undefined\n\\&       reference to term_set_winsize\" error. How do I resolve this\n\\&       error?\n\\& 35.9. Vim configure keeps complaining about the lack of gtk\\-config\n\\&       while trying to use GTK 2.03. This is correct, since in GTK 2\n\\&       they moved to using the generic pkg\\-config. I can get pkg\\-config\n\\&       to list the various includes and libs for gtk, but for some\n\\&       reason the configure script still isn\\*(Aqt picking this up.\n\\& 35.10. I did successfully download the sources and compiled Vim on\n\\&        Unix. But feature ... still does not work. What is wrong and\n\\&        how can I fix it?\n.Ve\n.SH VARIOUS\n.IX Header \"VARIOUS\"\n.Vb 10\n\\& 36.1. How do I edit binary files with Vim?\n\\& 36.2. How do I disable the visual error flash and the error beep?\n\\& 36.3. How do I display the ascii value of a character displayed in a\n\\&       buffer?\n\\& 36.4. Can I use zero as a count for a Vim command?\n\\& 36.5. How do I disable the Vim welcome screen?\n\\& 36.6. How do I avoid the \"hit enter to continue\" prompt?\n\\& 36.7. How do I invoke Vim from command line to run a group of commands\n\\&       on a group of files?\n\\& 36.8. How do I use a normal mode command from insert mode without\n\\&       leaving the insert mode?\n\\& 36.9. How do I start Vim in insert mode?\n\\& 36.10. How do I use Copy and Paste with Vim?\n\\& 36.11. Why shouldn\\*(Aqt I modify the files in the system runtime\n\\&        directory?\n.Ve\n.SH UNICODE\n.IX Header \"UNICODE\"\n.Vb 10\n\\& 37.1. Is it possible to create Unicode files using Vim?\n\\& 37.2. Which Vim settings are particularly important for editing Unicode\n\\&       files?\n\\& 37.3. What is the \\*(Aqencoding\\*(Aq option?\n\\& 37.4. How does Vim name the various Unicode encodings?\n\\& 37.5. How does Vim specify the presence or absence of a byte\\-order\n\\&       mark?\n\\& 37.6. What is the \\*(Aqfileencoding\\*(Aq option?\n\\& 37.7. What is the \\*(Aqfileencodings\\*(Aq option?\n\\& 37.8. What is the \\*(Aqtermencoding\\*(Aq option?\n\\& 37.9. What is the \\*(Aqbomb\\*(Aq option?\n\\& 37.10. Where can I find an example of a typical use of all these\n\\&        options?\n\\& 37.11. How can I insert Unicode characters into a file using Vim?\n\\& 37.12. How can I know which digraphs are defined and for which\n\\&        characters?\n.Ve\n.SH \"GENERAL INFORMATION\"\n.IX Header \"GENERAL INFORMATION\"\n.SS \"1.1. What is Vim?\"\n.IX Subsection \"1.1. What is Vim?\"\nVim stands for Vi IMproved. It used to be Vi IMitation, but there are so\nmany improvements that a name change was appropriate. Vim is a text editor\nwhich includes almost all the commands from the Unix program \"Vi\" and a lot\nof new ones. All commands can be given with the keyboard. This has the\nadvantage that you can keep your fingers on the keyboard and your eyes on\nthe screen. For those who want it, there is mouse support and a GUI version\nwith scrollbars and menus.\n.PP\nVim is an editor, not a word processor. A word processor is used mainly\nto do layout of text. This means positioning it, changing the way it\nappears on output. More often than not, the final document is meant to\nbe printed or typeset or what have you, in order to present it in a\npleasing manner to others. Examples of word processors are Microsoft\nWord, FrameMaker, and OpenOffice Writer.\n.PP\nAn editor is simply for entering text. Any typesetting or laying out of the\ndocument is secondary. With an editor, one's main concern is entering text,\nnot making the text look good. Examples of editors other than Vim and Vi\nare Emacs, TextMate, Ultraedit and gedit. And Notepad.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help intro\\fR\n.SS \"1.2. Who wrote Vim?\"\n.IX Subsection \"1.2. Who wrote Vim?\"\nMost of Vim is based on Stevie and was written by Bram Moolenaar, with\ncontributions from too many people to mention here.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help author\\fR\n.PP\n\\&\\fB:help credits\\fR\n.SS \"1.3. Is Vim compatible with Vi?\"\n.IX Subsection \"1.3. Is Vim compatible with Vi?\"\nYes. Vim is very much compatible with Vi.  You can use the \"\\-C\"\ncommand-line flag to start Vim in Vi compatible mode:\n.PP\n.Vb 1\n\\& $ vim \\-C\n.Ve\n.PP\nYou can also use:\n.PP\n.Vb 1\n\\& $ vim \\-u NONE\n.Ve\n.PP\nYou can also set the 'compatible' option to enable Vi compatibility:\n.PP\n.Vb 1\n\\& :set compatible\n.Ve\n.PP\nIf you want to make sure, to start Vim in a 'nocompatible' mode to\noriginal Vi, supply the \\-N command line argument:\n.PP\n.Vb 1\n\\& $ vim \\-N\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help \\-C\\fR\n.PP\n\\&\\fB:help \\-N\\fR\n.PP\n\\&\\fB:help 'compatible'\\fR\n.PP\n\\&\\fB:help compatible-default\\fR\n.SS \"1.4. What are some of the improvements of Vim over Vi?\"\n.IX Subsection \"1.4. What are some of the improvements of Vim over Vi?\"\nA short summary of the improvements of Vim over vi is listed below.  The\nlist shows that Vim is a thoroughly modern and feature-packed editor.\nStandard features of modern editors are implemented, and there is an equal\nemphasis on general power-user features and features for programmers.\n.PP\n\\fIFeatures to modernise Vi:\\fR\n.IX Subsection \"Features to modernise Vi:\"\n.PP\nMulti-level undo\n.IX Subsection \"Multi-level undo\"\n.PP\n.Vb 5\n\\&  Allows you to set the number of times you can undo your changes in a\n\\&  file buffer. You can also redo an undone change.\n\\&  Also starting with version 7.3 Vim can permanently store your undo\n\\&  information, so that you can undo your changes which you have done\n\\&  in a previous editing session.\n.Ve\n.PP\nTabs, Multiple windows and buffers\n.IX Subsection \"Tabs, Multiple windows and buffers\"\n.PP\n.Vb 6\n\\&  Each file can be displayed in its own window. You can move easily from\n\\&  one window to another. Each file opened during a Vim session also has\n\\&  an associated buffer and you can easily jump from one to the other.\n\\&  Also like any modern GUI, Vim supports opening several files in tabs.\n\\&  You can do batch processing for tabs, buffers, windows and the\n\\&  argumentlist.\n.Ve\n.PP\nFlexible insert mode\n.IX Subsection \"Flexible insert mode\"\n.PP\n.Vb 3\n\\&  Vim allows you to use the arrow keys while in insert mode to move\n\\&  around in the file. No more hitting <Esc>, moving around, then hitting\n\\&  \\`i\\*(Aq or \\`a\\*(Aq.\n.Ve\n.PP\nMacros\n.IX Subsection \"Macros\"\n.PP\n.Vb 2\n\\&  Vim has a facility which allows you to record a sequence of typed\n\\&  characters and repeat them any number of times.\n.Ve\n.PP\nVisual mode\n.IX Subsection \"Visual mode\"\n.PP\n.Vb 2\n\\&  You can highlight sections of text and execute operations on this\n\\&  section of text only.\n.Ve\n.PP\nBlock operators\n.IX Subsection \"Block operators\"\n.PP\n.Vb 2\n\\&  Allow selection and highlighting of rectangular blocks of text in\n\\&  order do execute specific operations on them.\n.Ve\n.PP\nOnline help system\n.IX Subsection \"Online help system\"\n.PP\n.Vb 2\n\\&  You can easily find help on any aspect of using Vim. Help is displayed\n\\&  in its own window.\n.Ve\n.PP\nCommand-line editing and history\n.IX Subsection \"Command-line editing and history\"\n.PP\n.Vb 5\n\\&  History allows you to use the arrow keys to repeat or search for a\n\\&  command that has already been typed. Allows you to match the beginning\n\\&  of a command with the beginning of another similar command in the\n\\&  history buffer. You can also edit a command to correct typos or change\n\\&  a few values.\n.Ve\n.PP\nCommand line completion.\n.IX Subsection \"Command line completion.\"\n.PP\n.Vb 2\n\\&  Using the <Tab> key, you can complete commands, options, filenames,\n\\&  etc. as needed.\n.Ve\n.PP\nHorizontal scrolling.\n.IX Subsection \"Horizontal scrolling.\"\n.PP\n.Vb 1\n\\&  Long lines can be scrolled horizontally (with or without the GUI).\n.Ve\n.PP\nUnicode and internationalization improvements.\n.IX Subsection \"Unicode and internationalization improvements.\"\n.PP\n.Vb 3\n\\&  Vim is able to edit files in unicode encoding and uses internally an\n\\&  utf\\-8 encoding. Additionally Vim can display text right to left\n\\&  oriented.\n.Ve\n.PP\n\\fIAdvanced user features:\\fR\n.IX Subsection \"Advanced user features:\"\n.PP\nText formatting\n.IX Subsection \"Text formatting\"\n.PP\n.Vb 2\n\\&  With two keystrokes, you can format large sections of text, without\n\\&  the use of external programs.\n.Ve\n.PP\nCompletion in Insert mode\n.IX Subsection \"Completion in Insert mode\"\n.PP\n.Vb 3\n\\&  Vim provides several different possibilities to complete your text.\n\\&  For example Vim can complete words while you are typing, by matching\n\\&  the current word with other similar words in the file.\n.Ve\n.PP\nJump tags\n.IX Subsection \"Jump tags\"\n.PP\n.Vb 3\n\\&  Just like in an internet browser, you can jump back to previous parts\n\\&  of the text you were editing, and then forward again.  Your brain is\n\\&  thus free to edit instead of navigate.\n.Ve\n.PP\nAutomatic commands\n.IX Subsection \"Automatic commands\"\n.PP\n.Vb 2\n\\&  Commands automatically executed when reading or writing a file,\n\\&  jumping to another buffer, etc.\n.Ve\n.PP\nViminfo\n.IX Subsection \"Viminfo\"\n.PP\n.Vb 3\n\\&  Allows storing of the command line history, marks and registers in a\n\\&  file to be read on startup.  Therefore, you can recall old search\n\\&  patterns, macros, etc., in a new Vim session.\n.Ve\n.PP\nMouse support\n.IX Subsection \"Mouse support\"\n.PP\n.Vb 2\n\\&  The mouse is supported in an xterm and for MS\\-DOS. It can be used to\n\\&  position the cursor, select the visual area, paste a register, etc.\n.Ve\n.PP\nGraphical User Interface (GUI)\n.IX Subsection \"Graphical User Interface (GUI)\"\n.PP\n.Vb 3\n\\&  There are several different graphical user interfaces available.\n\\&  Also, it\\*(Aqs very easy to add your own menus.  Of course, console vim is\n\\&  still supported, and very widely used.\n.Ve\n.PP\nScripting language\n.IX Subsection \"Scripting language\"\n.PP\n.Vb 3\n\\&  Vim has a powerful scripting language so new commands can be created.\n\\&  You can also use Perl, Python, TCL, Lua and Ruby to achieve the same\n\\&  thing!\n.Ve\n.PP\nPlugins\n.IX Subsection \"Plugins\"\n.PP\n.Vb 5\n\\&  Extra functionality implemented via vim commands (regular commands or\n\\&  the scripting language) that is automatically loaded on startup.\n\\&  Examples: file explorer, network editing, enhanced autocompletion,\n\\&  syntax checks.\n\\&  More are being developed and shared on VimOnline all the time.\n.Ve\n.PP\nSyntax highlighting for many programming languages\n.IX Subsection \"Syntax highlighting for many programming languages\"\n.PP\n.Vb 3\n\\&  Syntax highlighting (including concealing items) for hundreds of\n\\&  programming languages is supported. Support for others can be\n\\&  added.\n.Ve\n.PP\nExtended regular expressions\n.IX Subsection \"Extended regular expressions\"\n.PP\n.Vb 2\n\\&  Vim supports extended regular expressions which are similar in\n\\&  functionality to that of Perl regular expressions.\n.Ve\n.PP\nIntegrated Spell checking\n.IX Subsection \"Integrated Spell checking\"\n.PP\n.Vb 1\n\\&  Spell checking has been integrated into Vim.\n.Ve\n.PP\nDiff mode\n.IX Subsection \"Diff mode\"\n.PP\n.Vb 2\n\\&  Vim can highlight the differences between two, three or four files.\n\\&  Identical lines will be folded away and hidden.\n.Ve\n.PP\nEncryption using the blowfish algorithm\n.IX Subsection \"Encryption using the blowfish algorithm\"\n.PP\n.Vb 2\n\\&  Vim allows to encrypt your files using the symmetric block cipher\n\\&  blowfish as well as the swap file.\n.Ve\n.PP\nExtensive customizable\n.IX Subsection \"Extensive customizable\"\n.PP\n.Vb 3\n\\&  Vim can be tuned and customized to work like you want by setting\n\\&  options. You can define your own commands, macros and even plugins\n\\&  to extend its capabilities\n.Ve\n.PP\nPackages\n.IX Subsection \"Packages\"\n.PP\n.Vb 4\n\\&  Packages have been added to keep the installation of the growing\n\\&  number of plugins manageable. This is a convenient way to get one\n\\&  or more plugins, drop them in a directory and keep them updated.\n\\&  Vim will load them automatically, or only when desired.\n.Ve\n.PP\n\\fIProgramming performance features:\\fR\n.IX Subsection \"Programming performance features:\"\n.PP\nEdit-compile-edit speedup\n.IX Subsection \"Edit-compile-edit speedup\"\n.PP\n.Vb 2\n\\&  You can compile within Vim and automatically jump to the location of\n\\&  errors in the source code.\n.Ve\n.PP\nIndenting for many programming languages\n.IX Subsection \"Indenting for many programming languages\"\n.PP\n.Vb 2\n\\&  C, C++, Java, Perl, XML and many other languages can be automatically\n\\&  indented by vim while you type.  Support for others can be added.\n.Ve\n.PP\nSearching for words in include files\n.IX Subsection \"Searching for words in include files\"\n.PP\n.Vb 2\n\\&  Vim allows you to search for a match of the word under the cursor in\n\\&  the current and included files.\n.Ve\n.PP\nAdvanced text objects\n.IX Subsection \"Advanced text objects\"\n.PP\n.Vb 3\n\\&  Instantly select, delete, copy, indent, format, change case, or ...\n\\&  to all the text between ( and ), or { and }, or < and >, or [ and\n\\&  ].  Or a word, sentence, or paragraph.  Very powerful.\n.Ve\n.PP\nFolding\n.IX Subsection \"Folding\"\n.PP\n.Vb 3\n\\&  Certain parts of the text can be \"folded\" away.  The best example is\n\\&  the body of a function.  You can get an overview of the code, and then\n\\&  open the fold of the function whose detail you need to see.\n.Ve\n.PP\nctags and cscope integration\n.IX Subsection \"ctags and cscope integration\"\n.PP\n.Vb 3\n\\&  Using these two powerful programs, you can jump to a definition of a\n\\&  function from a calling instance of it, and use other tricks to\n\\&  navigate source code.\n.Ve\n.PP\nIntegration of several programming languages\n.IX Subsection \"Integration of several programming languages\"\n.PP\n.Vb 2\n\\&  If you find the internal scripting language not powerful enough, you\n\\&  can extend Vim using Lua, Ruby, Tcl, Perl and Python 2 and 3.\n.Ve\n.PP\nAsynchronous I/O support\n.IX Subsection \"Asynchronous I/O support\"\n.PP\n.Vb 4\n\\&  Vim uses jobs and channels to talk to other programs\n\\&  asynchronously. This allows to have e.g. a compiler run in the\n\\&  background and open the quickfix list as soon as it is finished to\n\\&  fix warnings and errors.\n.Ve\n.PP\nTimers\n.IX Subsection \"Timers\"\n.PP\n.Vb 2\n\\&  Timers are asynchronous and can fire once or repeatedly to invoke a\n\\&  function to do any work.\n.Ve\n.PP\n\\fIFor more information, read:\\fR\n.IX Subsection \"For more information, read:\"\n.PP\n\\&\\fB:help vi-differences\\fR\n.SS \"1.5. Is Vim free?\"\n.IX Subsection \"1.5. Is Vim free?\"\nVim is Charityware. There are no restrictions on using or copying Vim, but\nthe author encourages you to make a donation to charity. A document\nexplaining how to do so is included in the distribution.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help copyright\\fR\n.SH RESOURCES\n.IX Header \"RESOURCES\"\n.SS \"2.1. Where can I learn more about Vim?\"\n.IX Subsection \"2.1. Where can I learn more about Vim?\"\nYou can post your Vim questions to the vim@vim.org mailing list.  You can\npost your Vim development related questions to the vim\\-dev@vim.org mailing\nlist. Vim does not have a newsgroup of its own. But the appropriate\nnewsgroup to post to is comp.editors.\n.PP\n\"VimOnline\" is a web page that serves as a de facto homepage for vim,\nalthough the main purpose of it is to gather tips and scripts from\neverywhere.  Get involved!  The URL is https://www.vim.org\n.PP\nFinally, read the Vi FAQ:\n.PP\n.Vb 1\n\\& http://www.faqs.org/faqs/editor\\-faq/vi/part1/index.html\n.Ve\n.PP\nFinally, there are also some communities, where you can discuss features\nor ask questions:\n.PP\n.Vb 2\n\\& https://vi.stackexchange.com\n\\& https://vim.reddit.com\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help mail-list\\fR\n.PP\n\\&\\fB:help internet\\fR\n.SS \"2.2. Is there a mailing list available?\"\n.IX Subsection \"2.2. Is there a mailing list available?\"\nThere are several:\n.PP\n.Vb 7\n\\& NAME              DESCRIPTION\n\\& \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-  \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\\& vim\\-announce      Announcements of new releases\n\\& vim               General discussion\n\\& vim\\-dev           Patches, bug reports, development discussions\n\\& vim\\-mac           Macintosh discussion\n\\& vim\\-fr            General discussion in French\n.Ve\n.PP\nOf these, only vim and vim-dev are of general interest. vim-announce is\nread-only to most people, and its messages are sent to the other lists as\nwell. The remaining four are very low volume.\n.PP\n.Vb 5\n\\& ACTION            EMAIL SEND TO\n\\& \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-  \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\\& To subscribe:     <NAME>\\-subscribe@vim.org\n\\& To unsubscribe:   <NAME>\\-unsubscribe@vim.org\n\\& To get help:      <NAME>\\-help@vim.org\n.Ve\n.PP\nThe available mailing lists are also mentioned here:\n.PP\n.Vb 1\n\\& https://www.vim.org/maillist.php\n.Ve\n.SS \"2.3. Is there an archive available for the Vim mailing lists?\"\n.IX Subsection \"2.3. Is there an archive available for the Vim mailing lists?\"\nYes. Visit https://groups.yahoo.com/, where name is one of:\nvimannounce, vim, vimdev, vim-fr, vim-mac, vim-vms.\n.PP\nAlternatively, visit www.gmane.org to find out about GMANE, which allows\nyou to access the mailing lists as though they were newsgroups.  This\noffers some convenience to those who wish to browse the history or casually\nobserve the current threads.\n.SS \"2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\"\n.IX Subsection \"2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\"\nYou can download the HTML/PDF/PS format of the Vim user manual from:\n.PP\n.Vb 1\n\\& https://vimdoc.sourceforge.net/\n.Ve\n.PP\nNote, the user manual from that page is currently pretty outdated. It's\nbest to either use the documentation that comes with vim or use the\nonline version at https://vimhelp.org\n.PP\nYou can find a pdf version of the full English help, including this faq\n(in letter, A4 and Ipad format) at:\n.PP\n.Vb 1\n\\& https://nathangrigg.com/vimhelp/\n.Ve\n.PP\nThis document is cross-referenced, so you can use the hyperlink\nfunctionality.\n.SS \"2.5. I have a \"\"xyz\"\" (some) problem with Vim. How do I determine if it is a problem with my setup or with Vim?  / Have I found a bug in Vim?\"\n.IX Subsection \"2.5. I have a \"\"xyz\"\" (some) problem with Vim. How do I determine if it is a problem with my setup or with Vim? / Have I found a bug in Vim?\"\nFirst, you need to find out, whether the error is in the actual runtime\nfiles or any plugin that is distributed with Vim or whether it is a\nsimple side effect of any configuration option from your .vimrc or\n\\&.gvimrc. So first, start vim like this:\n.PP\n.Vb 1\n\\& vim \\-u NONE \\-U NONE \\-N \\-i NONE\n.Ve\n.PP\nThis starts Vim in nocompatible mode (\\-N), without reading your viminfo\nfile (\\-i NONE), without reading any configuration file (\\-u NONE for not\nreading .vimrc file and \\-U NONE for not reading a .gvimrc file) or even\nplugin.\n.PP\nIn this invocation, try to reproduce your problem. If the error\npersists, the chance is good you've found a bug in Vim (see also\nQuestion 2.6.)\n.PP\nIf the error does not occur when starting Vim this way, then the problem\nis either related to some plugin of yours or some setting in one of your\nlocal setup files. You need to find out, what triggers the error, you\ntry starting Vim this way:\n.PP\n.Vb 1\n\\& vim \\-u NONE \\-U NONE \\-N\n.Ve\n.PP\nIf the error occurs, the problem is your .viminfo file. Simply delete\nthe viminfo file then. If the error does not occur, try:\n.PP\n.Vb 1\n\\& vim \\-u ~/.vimrc \\-\\-noplugin \\-N \\-i NONE\n.Ve\n.PP\nThis will simply use your .vimrc as configuration file, but not load any\nplugins. If the error occurs this time, the error is possibly caused by\nsome configuration option inside your .vimrc file. Depending on the\nlength of your vimrc file, it can be quite hard to trace the origin\nwithin that file.\n.PP\nThe best way is to add `:finish` command in the middle of your .vimrc.\nThen restart again using the same command line. If the error still\noccurs, the bug must be caused because of a setting in the first half of\nyour .vimrc. If it doesn't happen, the problematic setting must be in\nthe second half of your .vimrc. So move the `:finish` command to the\nmiddle of that half, of which you know that triggers the error and move\nyour way along, until you find the problematic option. If your .vimrc is\n350 lines long, you need at a maximum 9 tries to find the offending line\n(in practise, this can often be further reduced, since often lines\ndepend on each other).\n.PP\nIf the problem does not occur, when only loading your .vimrc file, the\nerror must be caused by a plugin or another runtime file (indent\nautoload or syntax script). Check the output of the `:scriptnames` command\nto see what files have been loaded and for each one try to disable each\none by one and see which one triggers the bug. Often files that are\nloaded by vim, have a simple configuration variable to disable them, but\nyou need to check inside each file separately.\n.PP\nYou can also use the \\-V command line argument to get more debug\ninformation to analyze the problem:\n.PP\n.Vb 1\n\\& $ vim \\-V2logfile\n.Ve\n.PP\nYou can increase the value passed to the \\-V argument to get more debug\ninformation. By also specifying a logfile name, this makes sure, the\ndebug messages don't appear on the screen and won't disturb you when\ntrying to reproduce the problem.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help \\-u\\fR\n.PP\n\\&\\fB:help \\-U\\fR\n.PP\n\\&\\fB:help \\-N\\fR\n.PP\n\\&\\fB:help \\-V\\fR\n.PP\n\\&\\fB:help 'verbose'\\fR\n.PP\n\\&\\fB:help :verbose\\fR\n.PP\n\\&\\fB:help :set\\-verbose\\fR\n.SS \"2.6. Where can I report bugs?\"\n.IX Subsection \"2.6. Where can I report bugs?\"\nFirst collect the required information using the following command:\n.PP\n.Vb 1\n\\& :source $VIMRUNTIME/bugreport.vim\n.Ve\n.PP\nNow send the resulting text from the above command to the bugs@vim.org\ne\\-mail address. There is also a public bug tracker available at\nhttps://github.com/vim/vim/issues. A copy of each message there\nwill be forwarded to the Vim Development list.\n.PP\nThe Vim Development mailing list (see Question 2.2) is a good place to\ndiscuss general bugs.  If the bug you find is with syntax highlighting,\na runtime file, or some other \"added feature\" (i.e. not directly\nprogrammed into vim), attempt to inform the maintainer of that feature.\nHis e\\-mail address will be mentioned at the top of the corresponding\nruntime file.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help bug-reports\\fR\n.SS \"2.7. Where can the FAQ be found?\"\n.IX Subsection \"2.7. Where can the FAQ be found?\"\nThe FAQ can be found at https://vimhelp.org/vim_faq.txt.html.\nIt will be auto-generated from the source that is managed in the github\nrepository https://www.github.com/chrisbra/vim_faq (Patches are welcome).\n.PP\nThe repository also includes the faq in different formats, e.g. manpage,\npdf file, html file, plain text version and a version in vim help format.\n.PP\nA slightly older version (which doesn't seem to get updated anymore) can\nstill be found at VimOnline (https://www.vim.org/).\n.SS \"2.8. What if I don't find an answer in this FAQ?\"\n.IX Subsection \"2.8. What if I don't find an answer in this FAQ?\"\nThis FAQ covers mainly Vim-specific questions. You may find more\ninformation suitable for most Vi clones by reading the Vi FAQ. It is posted\nregularly on comp.editors. You can also find a copy at\n.PP\n.Vb 1\n\\& http://www.faqs.org/faqs/editor\\-faq/vi/part1/index.html\n.Ve\n.PP\nAlso, since Vim has gathered so many features in the last few years,\nsuccessfully documenting the frequently asked questions here is a\nnear-impossible task. To make it possible, please email the maintainer if\nyou have a good question. A good question is one that you've tried to\nanswer yourself (remember, Vim has great documentation) but struggled.\n.SS \"2.9. I have a patch for implementing a Vim feature. Where can I send this patch?\"\n.IX Subsection \"2.9. I have a patch for implementing a Vim feature. Where can I send this patch?\"\nYou can send your patches to the Vim developer mailing list\nvim\\-dev@vim.org.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help vim-dev\\fR\n.SS \"2.10. I have a Vim tip or developed a new Vim syntax/indent/filetype/ compiler plugin or developed a new script or a colorscheme. Is there a public website where I can upload this?\"\n.IX Subsection \"2.10. I have a Vim tip or developed a new Vim syntax/indent/filetype/ compiler plugin or developed a new script or a colorscheme. Is there a public website where I can upload this?\"\nYes. You can use the Vim Online website to upload your plugins/scripts,\ncolorschemes, etc. The site is at https://www.vim.org\nNowadays people also seem to share their plugins/runtime files at\ngithub.\n.PP\nTips can also be shared in the Wiki which you can find at\n.PP\n.Vb 1\n\\& http://vim.wikia.com\n.Ve\n.SH AVAILABILITY\n.IX Header \"AVAILABILITY\"\n.SS \"3.1. What is the latest version of Vim?\"\n.IX Subsection \"3.1. What is the latest version of Vim?\"\nThe latest version of Vim is 8.2 released on 12th December 2019.\n.PP\nThe release history of different versions of Vim is below:\n.PP\n.Vb 10\n\\& VERSION         RELEASE DATE\n\\& \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-  \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\\& Version 9.1     2nd January, 2024\n\\& Version 9.0     28th June, 2022\n\\& Version 8.2     12th December, 2019\n\\& Version 8.1     17th May, 2018\n\\& Version 8.0     12th September, 2016\n\\& Version 7.4     10th August, 2013\n\\& Version 7.3     15th August, 2010\n\\& Version 7.2     9th August, 2008\n\\& Version 7.1     12th May, 2007\n\\& Version 7.0     8th May, 2006\n\\& Version 6.4     15th October, 2005\n\\& Version 6.3     8th June, 2004\n\\& Version 6.2     1st June, 2003\n\\& Version 6.1     24th March, 2002\n\\& Version 6.0     27th September, 2001\n\\& Version 5.8     31st May, 2001\n\\& Version 5.7     24th June, 2000\n\\& Version 5.6     16th January, 2000\n\\& Version 5.5     21st September, 1999\n\\& Version 5.4     26th July, 1999\n\\& Version 5.3     31st August, 1998\n\\& Version 5.2     24th August, 1998\n\\& Version 5.1     7th April, 1998\n\\& Version 5.0     19th February, 1998\n\\& Version 4.6     13th March, 1997\n\\& Version 4.5     17th October, 1996\n\\& Version 4.2     5th July, 1996\n\\& Version 4.0     29th May, 1996\n\\& Version 3.0     12th August, 1994\n\\& Version 2.0     21st December, 1993\n\\& Version 1.27    23rd April, 1993\n\\& Version 1.17    21st April, 1992\n\\& Version 1.14    2nd November, 1991\n.Ve\n.PP\nIf you are interested in the old release history, check out the\nvim-history git repository:\nhttps://github.com/vim/vim\\-history\nand especially for the release history:\nhttps://github.com/vim/vim\\-history#release\\-history\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help new\\-9\\fR\n.PP\n\\&\\fB:help new\\-8\\fR\n.PP\n\\&\\fB:help changed\\-9.1\\fR\n.PP\n\\&\\fB:help changed\\-8.2\\fR\n.PP\n\\&\\fB:help changed\\-8.1\\fR\n.SS \"3.2. Where can I find the latest version of Vim?\"\n.IX Subsection \"3.2. Where can I find the latest version of Vim?\"\nYou can download the sources for the latest version of Vim from the\nGithub repository. The URL for this site is\n.PP\n.Vb 1\n\\& https://github.com/vim/vim\n.Ve\n.PP\nA mercurial mirror is also available:\n.PP\n.Vb 1\n\\& https://www.vim.org/hgweb/vim/\n.Ve\n.PP\nSome users keep updated repositories for distributing latest binary\nversions of Vim. You can find those repositories here:\n.PP\n.Vb 1\n\\& http://vim.wikia.com/wiki/Where_to_download_Vim\n.Ve\n.SS \"3.3. What platforms does it run on?\"\n.IX Subsection \"3.3. What platforms does it run on?\"\nAll Unix platforms.\nAll Windows platforms (10 and later).\nAmiga, Macintosh, MachTen, VMS, IBM z/OS.\n.PP\nFor MS-DOS support has been removed with the latest releases of Vim.\n16\\-bit DOS: latest supported version 7.1\n32\\-bit DOS: latest supported version 7.3\nWindows XP and Visat: latest supported version 9.0\n.SS \"3.4. Where can I download the latest version of the Vim runtime files?\"\n.IX Subsection \"3.4. Where can I download the latest version of the Vim runtime files?\"\nYou can download the latest version of the Vim runtime files (syntax files,\nfiletype plugins, compiler files, color schemes, documentation, indentation\nfiles and keymaps) from the Vim github repository\n.PP\n.Vb 1\n\\& https://github.com/vim/vim/tree/master/runtime\n.Ve\n.PP\nAnother way of downloading the runtime files is this:\n.PP\n.Vb 2\n\\& wget https://github.com/vim/vim/archive/master.tar.gz \\-O\\- |\n\\& tar zfx \\- vim\\-master/runtime/ \\-\\-strip\\-components=1\n.Ve\n.PP\nSee also:\n.PP\n.Vb 1\n\\& https://www.vim.org/runtime.php\n.Ve\n.SH HELP\n.IX Header \"HELP\"\n.SS \"4.1. How do I use the help files?\"\n.IX Subsection \"4.1. How do I use the help files?\"\nHelp can be found for all functions of Vim. In order to use it, use the\n`:help` command.  This will bring you to the main help page. On that first\npage, you will find explanations on how to move around. Basically, you move\naround in the help pages the same way you would in a read-only document.\nYou can jump to specific subjects by using tags. This can be done in two\nways:\n.PP\n.Vb 3\n\\&   * Use the CTRL\\-] command while standing on the name of a command\n\\&  or option. This only works when the tag is a keyword.\n\\&  <Ctrl\\-LeftMouse> and g<LeftMouse> work just like CTRL\\-].\n\\&\n\\&   * use the \\`:tag <subject>\\` command. This works with all characters.\n.Ve\n.PP\nUse CTRL-T to jump back to previous positions in the help files. Use\n`:q` to close the help window.\n.PP\nIf you want to jump to a specific subject on the help pages, use\n`:help {subject}` . If you don't know what to look for, try `:help index`\nto get a list of all available subjects. Use the standard search keys to\nlocate the information you want.\nYou can abbreviate the `:help` command as `:h`.\n.PP\nFor searching the help, see the next Question 4.2.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help online-help\\fR\n.SS \"4.2. How do I search for a keyword in the Vim help files?\"\n.IX Subsection \"4.2. How do I search for a keyword in the Vim help files?\"\na)  You can press the CTRL-D key after typing the help keyword to get a\n list of all the help keywords containing the supplied pattern. You can\n also use the meta characters like *, \\e+, etc to specify the help\n search pattern:\n.PP\n\\&\\fB:help init<C\\-D\\fR>\n.PP\n\\&\\fB:help str*()<C\\-D\\fR>\n.PP\n\\&\\fB:help '*indent<C\\-D\\fR>\n.PP\nb)  You can press the <Tab> key after typing a partial help keyword to expand\n to the matching keyword. You can continue to press the <Tab> key to see\n other keyword matches.\n.PP\nc)  From the help window, you can use the `:tag` command to search for\n keywords. For example,\n.PP\n.Vb 1\n\\& :tselect /window\n\\&\n\\& This command will list all the help keywords containing the text\n\\& \"window\". You can select one from the list and jump to it.\n.Ve\n.PP\nd)  You can use the `:helpgrep` command to search for the given text in\n all the help files. The quickfix window will be opened with all the\n matching lines.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help help-summary\\fR\n.PP\n\\&\\fB:help c_CTRL\\-D\\fR\n.PP\n\\&\\fB:help c_<Tab\\fR>\n.PP\n\\&\\fB:help :tselect\\fR\n.PP\n\\&\\fB:help :help\\fR\n.PP\n\\&\\fB:help :helpgrep\\fR\n.SS \"4.3. I am getting an error message E123, what did I do wrong?\"\n.IX Subsection \"4.3. I am getting an error message E123, what did I do wrong?\"\nYou can get more information about the error and the error message using:\n.PP\n\\&\\fB:help E123\\fR\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help error-messages\\fR\n.SS \"4.4. Where can I read about the various modes in Vim?\"\n.IX Subsection \"4.4. Where can I read about the various modes in Vim?\"\nYou can get information about the different modes in Vim by reading\n.PP\n\\&\\fB:help vim-modes\\fR\n.SS \"4.5. How do I generate the Vim help tags file after adding a new Vim help file?\"\n.IX Subsection \"4.5. How do I generate the Vim help tags file after adding a new Vim help file?\"\nYou can use the `:helptags` command to regenerate the Vim help tag file\nfrom within Vim. For example:\n.PP\n.Vb 2\n\\& :cd $VIMRUNTIME/doc\n\\& :helptags .\n.Ve\n.PP\nTo update all \"doc\" directories in your 'runtimepath', you can use\n.PP\n.Vb 1\n\\& :helptags ALL\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :helptags\\fR\n.PP\n\\&\\fB:help add-local-help\\fR\n.SS \"4.6. Can I use compressed versions of the help files?\"\n.IX Subsection \"4.6. Can I use compressed versions of the help files?\"\nYes. You can compress the help files and still be able to view them with\nVim.  This makes accessing the help files a bit slower and requires the\n\"gzip\" utility. Follow these steps to compress and use the Vim help files:\n.PP\n\\&\\- Compress all the help files using \"gzip doc/*.txt\".\n.PP\n\\&\\- Edit the \"doc/tags\" file and change the \".txt\" to \".txt.gz\" using\n     :%s=\\e(\\et.*\\e.txt\\e)\\et=\\e1.gz\\et=\n.PP\n\\&\\- Add the following line to your vimrc:\n     set helpfile={dirname}/help.txt.gz\n.PP\nWhere {dirname} is the directory where the help files are.  The gzip.vim\nplugin supplied with the standard Vim distribution will take care of\ndecompressing the files.  You must make sure that \\f(CW$VIMRUNTIME\\fR is set to\nwhere the other Vim files are, when they are not in the same location as\nthe compressed \"doc\" directory.\n.PP\nNote, that the `:helpgrep` command does not work with compressed help pages.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gzip-helpfile\\fR\n.PP\n\\&\\fB:help 'helpfile'\\fR\n.PP\n\\&\\fB:help gzip\\fR\n.PP\n\\&\\fB:help \\fR\\f(CB$VIMRUNTIME\\fR\n.SH \"EDITING A FILE\"\n.IX Header \"EDITING A FILE\"\n.SS \"5.1. How do I load a file in Vim for editing?\"\n.IX Subsection \"5.1. How do I load a file in Vim for editing?\"\nThere are several ways to load a file for editing. The simplest is to\nuse the `:e` (:edit) command:\n.PP\n.Vb 1\n\\& :e <filename>\n.Ve\n.PP\nYou can also use the `:n` (:next) command to load files into Vim:\n.PP\n.Vb 1\n\\& :n <filename(s)>\n.Ve\n.PP\nYou can also use the `:args` command to load files into Vim:\n.PP\n.Vb 1\n\\& :args <filename(s)>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help usr_07.txt\\fR\n.PP\n\\&\\fB:help edit-files\\fR\n.PP\n\\&\\fB:help :edit\\fR\n.PP\n\\&\\fB:help :next_f\\fR\n.PP\n\\&\\fB:help :args_f\\fR\n.SS \"5.2. How do I save the current file in another name (save as) and edit a new file?\"\n.IX Subsection \"5.2. How do I save the current file in another name (save as) and edit a new file?\"\nYou can use the `:saveas` command to save the current file in another name:\n.PP\n.Vb 1\n\\& :saveas <newfilename>\n.Ve\n.PP\nAlternatively, you can also use the following commands:\n.PP\n.Vb 2\n\\& :w <newfilename>\n\\& :edit #\n.Ve\n.PP\nYou can also use the `:file` command, followed by `:w` command:\n.PP\n.Vb 2\n\\& :file <newfilename>\n\\& :w\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 07.7\\fR\n.PP\n\\&\\fB:help :saveas\\fR\n.PP\n\\&\\fB:help :file_f\\fR\n.PP\n\\&\\fB:help :w\\fR\n.SS \"5.3. How do I change the current directory to the directory of the current file?\"\n.IX Subsection \"5.3. How do I change the current directory to the directory of the current file?\"\nYou can use the following command to change the current directory to the\ndirectory of the current file:\n.PP\n.Vb 1\n\\& :cd %:p:h\n.Ve\n.PP\nTo automatically change the current directory to the directory of the\ncurrent file, simply set the option 'autochdir'.\n.PP\n.Vb 1\n\\& :set autochdir\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :cd\\fR\n.PP\n\\&\\fB:help :lcd\\fR\n.PP\n\\&\\fB:help filename-modifiers\\fR\n.PP\n\\&\\fB:help autocommand\\fR\n.PP\n\\&\\fB:help 'acd'\\fR\n.PP\n\\&\\fB:help getcwd()\\fR\n.SS \"5.4. How do I write a file without the line feed (EOL) at the end of the file?\"\n.IX Subsection \"5.4. How do I write a file without the line feed (EOL) at the end of the file?\"\nYou can turn off the 'eol' option and turn on the 'binary' option to write\na file without the EOL at the end of the file:\n.PP\n.Vb 3\n\\& :set binary\n\\& :set noeol\n\\& :w\n.Ve\n.PP\nAlternatively, you can use:\n.PP\n.Vb 2\n\\& :set noeol\n\\& :w ++bin\n.Ve\n.PP\nIf you rather only like Vim not to write missing EOLs, you can reset the\n\\&'fixeol' option. This needs a Vim newer 7.4.785, so you should wrap this\nin an if condition in your .vimrc like this:\n.PP\n.Vb 3\n\\& if exists(\\*(Aq+fixeol\\*(Aq)\n\\&     set nofixeol\n\\& endif\n.Ve\n.PP\nThis has the advantage of avoiding the many side effects that the\n\\&'binary' option has.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'endofline'\\fR\n.PP\n\\&\\fB:help 'fixeol'\\fR\n.PP\n\\&\\fB:help 'binary'\\fR\n.PP\n\\&\\fB:help 23.4\\fR\n.SS \"5.5. How do I configure Vim to open a file at the last edited location?\"\n.IX Subsection \"5.5. How do I configure Vim to open a file at the last edited location?\"\nVim stores the cursor position of the last edited location for each buffer\nin the '\"' register. You can use the following autocmd in your .vimrc or\n\\&.gvimrc file to open a file at the last edited location:\n.PP\n.Vb 2\n\\& au BufReadPost * if line(\"\\*(Aq\\e\"\") > 0 && line(\"\\*(Aq\\e\"\") <= line(\"$\") |\n\\&                      \\e exe \"normal! g\\`\\e\"\" | endif\n.Ve\n.PP\nAlternatively, you can simply source the vimrc_example.vim file, which is\ndistributed with Vim.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help '\"\\fR\n.PP\n\\&\\fB:help last-position-jump\\fR\n.PP\n\\&\\fB:help vimrc_example.vim\\fR\n.SS \"5.6. When editing a file in Vim, which is being changed by an external application, Vim opens a warning window (like the confirm dialog) each time a change is detected. How do I disable this warning?\"\n.IX Subsection \"5.6. When editing a file in Vim, which is being changed by an external application, Vim opens a warning window (like the confirm dialog) each time a change is detected. How do I disable this warning?\"\nYou can set the Vim 'autoread' option to automatically read the file again\nwhen it is changed outside of Vim:\n.PP\n.Vb 1\n\\& :set autoread\n.Ve\n.PP\nYou can also use the following autocommand:\n.PP\n.Vb 4\n\\& autocmd FileChangedShell *\n\\&       \\e echohl WarningMsg |\n\\&       \\e echo \"File has been changed outside of vim.\" |\n\\&       \\e echohl None\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'autoread'\\fR\n.PP\n\\&\\fB:help FileChangedShell\\fR\n.PP\n\\&\\fB:help timestamp\\fR\n.PP\n\\&\\fB:help :checktime\\fR\n.SS \"5.7. How do I edit a file whose name is under the cursor?\"\n.IX Subsection \"5.7. How do I edit a file whose name is under the cursor?\"\nYou can use the gf command to edit a file whose name is under the cursor.\nYou can use the CTRL-W f command to edit the file in a new window and\nfinally you can use CTRL-W gf top open a new tab page that contains the\nfile name under the cursor.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gf\\fR\n.PP\n\\&\\fB:help CTRL\\-W_f\\fR\n.PP\n\\&\\fB:help CTRL\\-W_gf\\fR\n.PP\n\\&\\fB:help 'isfname'\\fR\n.PP\n\\&\\fB:help 'path'\\fR\n.PP\n\\&\\fB:help 'suffixesadd'\\fR\n.PP\n\\&\\fB:help 'includeexpr'\\fR\n.SS \"5.8. How do I reload/re\\-edit the current file?\"\n.IX Subsection \"5.8. How do I reload/re-edit the current file?\"\nYou can use the `:edit` command, without specifying a file name, to reload\nthe current file.  If you have made modifications to the file, you can use\n`:edit!` to force the reload of the current file (you will lose your\nmodifications, but depending on your 'undoreload' settings, those\nchanges might be saved into the undo history).\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :edit\\fR\n.PP\n\\&\\fB:help :edit!\\fR\n.PP\n\\&\\fB:help 'confirm'\\fR\n.PP\n\\&\\fB:help 'undoreload'\\fR\n.SS \"5.9. How do I autosave a file periodically?\"\n.IX Subsection \"5.9. How do I autosave a file periodically?\"\nVim doesn't support auto-saving a file periodically.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'updatetime'\\fR\n.PP\n\\&\\fB:help CursorHold\\fR\n.PP\n\\&\\fB:help swap-file\\fR\n.SS \"5.10. How do I open a file in read-only mode?\"\n.IX Subsection \"5.10. How do I open a file in read-only mode?\"\nYou can open a file in read-only mode using the `:view` command:\n.PP\n.Vb 1\n\\& :view <filename>\n.Ve\n.PP\nThis command sets the 'readonly' option for the opened buffer. You can also\nuse the \"\\-R\" command-line option to open a file in read-only mode:\n.PP\n.Vb 1\n\\& $ vim \\-R <filename>\n.Ve\n.PP\nYou can also use the symbolic link executable \"view\" to open a file in\nread-only mode from the command-line:\n.PP\n.Vb 1\n\\& $ view <filename>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 07.6\\fR\n.PP\n\\&\\fB:help 'readonly'\\fR\n.PP\n\\&\\fB:help 'modifiable'\\fR\n.PP\n\\&\\fB:help :view\\fR\n.PP\n\\&\\fB:help :sview\\fR\n.PP\n\\&\\fB:help view\\fR\n.PP\n\\&\\fB:help \\-R\\fR\n.PP\n\\&\\fB:help \\-M\\fR\n.SS \"5.11. How do I open a file for editing without saving the modifications to the current file?\"\n.IX Subsection \"5.11. How do I open a file for editing without saving the modifications to the current file?\"\nYou can open a file for editing without saving the modifications to the\ncurrent file and without losing the changes using one of the following\nmethods:\n.PP\n.Vb 2\n\\& :split <new_filename>\n\\& :new <new_filename>\n.Ve\n.PP\nYou can also set the 'hidden' option and edit a new file:\n.PP\n.Vb 2\n\\& :set hidden\n\\& :e <new_filename>\n.Ve\n.PP\nIf you want to discard the changes made to the current file and load\nanother file for editing, then you can use the following command:\n.PP\n.Vb 1\n\\& :e! <new_filename>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :edit!_f\\fR\n.PP\n\\&\\fB:help 'hidden'\\fR\n.PP\n\\&\\fB:help :split\\fR\n.PP\n\\&\\fB:help :new\\fR\n.SS \"5.12. How do I reduce the loading time for very large files in Vim?\"\n.IX Subsection \"5.12. How do I reduce the loading time for very large files in Vim?\"\nYou can use the following settings to reduce the loading time for\nvery large files in Vim:\n.PP\n.Vb 6\n\\& :set lazyredraw\n\\& :set noswapfile\n\\& :set undolevels=\\-1\n\\& :set eventignore=all\n\\& :set nohidden\n\\& :set syntax=off\n.Ve\n.PP\nNote that the above settings will disable many Vim features including the\nfollowing: Swap files support for crash recovery, undo support, syntax\nhighlighting, filetype detection and other autocommand based features.\n.PP\nThere is also the LargeFile plugin available at\n.PP\n.Vb 1\n\\& https://www.vim.org/scripts/script.php?script_id=1506\n.Ve\n.PP\nwhich automatically sets these options, when working with large files\n(it is configurable, what is considered to be a large file, by default,\nit is 100MB).\n.SH \"EDITING MULTIPLE FILES\"\n.IX Header \"EDITING MULTIPLE FILES\"\n.SS \"6.1. How do I open multiple files at once from within Vim?\"\n.IX Subsection \"6.1. How do I open multiple files at once from within Vim?\"\nMake a difference between args, buffers, tabs and windows. They are all\ndifferent things in VIM.\n.PP\nargs is a list of arguments. Buffers are place to edit text, almost\nalways attached to a file but not necessarily. Window is a place for a\nbuffer and tab is set of windows, better name would be \"layout\".\n.PP\nThere are several ways to open multiple files at once from within Vim. You\ncan use the `:next` command to specify a group of files:\n.PP\n.Vb 2\n\\& :next f1.txt f2.txt\n\\& :next *.c\n.Ve\n.PP\nYou can use the `:args` command to specify a group of files as arguments:\n.PP\n.Vb 2\n\\& :args f1.txt f2.txt\n\\& :args *.c\n.Ve\n.PP\nAfter loading the files, you can use the `:next` and `:prev` command to\nswitch between the files.\n.PP\nTo execute command for all files in argument-list use `:argdo`\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 07.2\\fR\n.PP\n\\&\\fB:help :next\\fR\n.PP\n\\&\\fB:help :args_f\\fR\n.PP\n\\&\\fB:help argument-list\\fR\n.SS \"6.2. How do I switch between multiple files/buffers in Vim?\"\n.IX Subsection \"6.2. How do I switch between multiple files/buffers in Vim?\"\nTo list all buffers use `:ls`, to list buffers without file attached to\n(also known as unlisted buffers, ex. scratch buffer and help-window) use\n`:ls!`\n.PP\nThere are several ways to switch between multiple files. You can use the\n`:buffer` command to switch between multiple files. You can also shorten\ncommand as `:b` and use only part of the filename. For example,\n.PP\n.Vb 3\n\\& :buffer file1\n\\& :buffer file2\n\\& :b e2\n.Ve\n.PP\nYou can also use <TAB> after `:b` for autocompletion. Try also `:b`\nfollowed by CTRL-D to see all available buffers. This works also for\n`:e`.\n.PP\nYou can also use the CTRL\\-^ key to switch between buffers. By specifying a\ncount before pressing the key, you can edit the buffer with that number.\nWithout the count, you can edit the alternate buffer by pressing CTRL\\-^\n.PP\nYou can also use the `:e #` command to edit a particular buffer:\n.PP\n.Vb 1\n\\& :e #5\n.Ve\n.PP\nTo close a buffer use `:bd` \\-command.\n.PP\nTo execute command for all files in buffer-list use `:bufdo`\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help edit-files\\fR\n.PP\n\\&\\fB:help :buffer\\fR\n.PP\n\\&\\fB:help CTRL\\-^\\fR\n.PP\n\\&\\fB:help alternate-file\\fR\n.PP\n\\&\\fB:help 22.4\\fR\n.PP\n\\&\\fB:help 07.3\\fR\n.SS \"6.3. How do I open several files in Vim, with each file in a separate window/tab?\"\n.IX Subsection \"6.3. How do I open several files in Vim, with each file in a separate window/tab?\"\nYou can use the \\-o and \\-O Vim command line arguments to open multiple files\nin separate horizontally or vertically split Vim windows. For example:\n.PP\n.Vb 1\n\\& $ vim \\-o3 f1.txt f2.txt f3.txt\n.Ve\n.PP\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate horizontally split Vim windows.\n.PP\n.Vb 1\n\\& $ vim \\-O3 f1.txt f2.txt f3.txt\n.Ve\n.PP\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate vertically split Vim windows.\n.PP\n.Vb 1\n\\& $ vim \\-p f1.txt f2.txt f3.txt\n.Ve\n.PP\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate tab windows. The option 'tabpagemax' defines, how many tabpages\ncan be opened at the same time, by default it is set to 10.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help \\-o\\fR\n.PP\n\\&\\fB:help \\-O\\fR\n.PP\n\\&\\fB:help \\-p\\fR\n.PP\n\\&\\fB:help startup-options\\fR\n.PP\n\\&\\fB:help 'tabpagemax'\\fR\n.SS \"6.4. How do I configure Vim to autoload several files at once similar to \"\"work-sets\"\" or \"\"projects\"\"?\"\n.IX Subsection \"6.4. How do I configure Vim to autoload several files at once similar to \"\"work-sets\"\" or \"\"projects\"\"?\"\nYou can use the `:mksession` and the `:mkview` commands to autoload several\nfiles in Vim.\n.PP\nThe `:mksession` command creates a Vim script that restores the current\nediting session. You can use the `:source` command to source the file\nproduced by the mksession command.\n.PP\nThe `:mkview` command creates a Vim script that restores the contents of\nthe current window. You can use the `:loadview` command to load the view\nfor the current file.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 21.4\\fR\n.PP\n\\&\\fB:help 21.5\\fR\n.PP\n\\&\\fB:help views-sessions\\fR\n.PP\n\\&\\fB:help 'sessionoptions'\\fR\n.PP\n\\&\\fB:help :mksession\\fR\n.PP\n\\&\\fB:help :source\\fR\n.PP\n\\&\\fB:help v:this_session\\fR\n.PP\n\\&\\fB:help :mkview\\fR\n.PP\n\\&\\fB:help :loadview\\fR\n.PP\n\\&\\fB:help 'viewdir'\\fR\n.PP\n\\&\\fB:help buffers\\fR\n.SS \"6.5. Is it possible to open multiple top level windows in a single instance of Vim similar to Nedit or Emacs?\"\n.IX Subsection \"6.5. Is it possible to open multiple top level windows in a single instance of Vim similar to Nedit or Emacs?\"\nNo. It is currently not possible to open multiple top-level windows in a\nsingle instance of Vim. This feature is in the todo list.\n.SS \"6.6. How do I browse/explore directories from within Vim?\"\n.IX Subsection \"6.6. How do I browse/explore directories from within Vim?\"\nYou can use the netrw.vim plugin, supplied with the standard Vim\ninstallation, to browse/explore directories from within Vim. You can start\nthe file explorer using one of the following commands:\n.PP\n.Vb 5\n\\& :e <directory>\n\\& :Explore\n\\& :Sexplore\n\\& :Vexplore\n\\& :Texplore\n.Ve\n.PP\nFrom the file explorer, you can browse through directories, rename, delete\nand edit files.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help netrw.vim\\fR\n.PP\n\\&\\fB:help 22.1\\fR\n.SS \"6.7. How do I edit files over a network using ftp/scp/rcp/http?\"\n.IX Subsection \"6.7. How do I edit files over a network using ftp/scp/rcp/http?\"\nYou can use the netrw.vim plugin, supplied with the standard Vim package,\nto edit files over a network using ftp/scp/rcp/http. Using this plugin, Vim\nwill transparently load and save the files over ftp/scp/rcp/http. For\nexample, to edit a file over ftp, you can use the following command:\n.PP\n.Vb 1\n\\& $ vim ftp://machine/path\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help netrw.vim\\fR\n.SH BACKUP\n.IX Header \"BACKUP\"\n.SS \"7.1. When I edit and save files, Vim creates a file with the same name as the original file and a \"\"~\"\" character at the end. How do I stop Vim from creating this file? (or) How do I disable the Vim backup file feature?\"\n.IX Subsection \"7.1. When I edit and save files, Vim creates a file with the same name as the original file and a \"\"~\"\" character at the end. How do I stop Vim from creating this file? (or) How do I disable the Vim backup file feature?\"\nYou have set the 'backup' option, so Vim creates a backup file when saving\nthe original file. You can stop Vim from creating the backup file, by\nclearing the option:\n.PP\n.Vb 1\n\\& :set nobackup\n.Ve\n.PP\nNote that, by default this option is turned off. You have explicitly\nenabled the 'backup' option in one of the initialization files. You may\nalso have to turn off the 'writebackup' option:\n.PP\n.Vb 1\n\\& :set nowritebackup\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 07.4\\fR\n.PP\n\\&\\fB:help backup-table\\fR\n.PP\n\\&\\fB:help 'backup'\\fR\n.PP\n\\&\\fB:help 'writebackup'\\fR\n.PP\n\\&\\fB:help 'backupskip'\\fR\n.PP\n\\&\\fB:help 'backupdir'\\fR\n.PP\n\\&\\fB:help 'backupext'\\fR\n.PP\n\\&\\fB:help 'backupcopy'\\fR\n.PP\n\\&\\fB:help backup\\fR\n.SS \"7.2. When I edit and save files, Vim creates a file with the same name as the original file and a \"\"un~\"\" extension at the end. How do I stop Vim from creating this file (or) How do I disable the Vim undofile feature?\"\n.IX Subsection \"7.2. When I edit and save files, Vim creates a file with the same name as the original file and a \"\"un~\"\" extension at the end. How do I stop Vim from creating this file (or) How do I disable the Vim undofile feature?\"\nVim 7.3 contains as new feature persistent undo, that is, undo information\nwon't be lost when quitting Vim and be stored in a file that ends with\n\".un~\" You have set the 'undofile' option, so Vim creates an undo file when\nsaving the original file. You can stop Vim from creating the backup file,\nby clearing the option:\n.PP\n.Vb 1\n\\& :set noundofile\n.Ve\n.PP\nNote that, by default this option is turned off. You have explicitly\nenabled the 'undofile' option in one of the initialization files. If you\nwant your undofiles to be stored only in a particular directory, you can\npoint the 'undodir' option to a directory that will contain all your\naggregated undofiles.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'undodir'\\fR\n.PP\n\\&\\fB:help 'undofile'\\fR\n.PP\n\\&\\fB:help undo-persistence\\fR\n.SS \"7.3. How do I configure Vim to store all the backup files in a particular directory?\"\n.IX Subsection \"7.3. How do I configure Vim to store all the backup files in a particular directory?\"\nYou can configure Vim to store all the backup files in a particular\ndirectory using the 'backupdir' option. For example, to store all the\nbackup files in the ~/backup directory, you can use the following command:\n.PP\n.Vb 1\n\\& :set backupdir=~/backup\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 07.4\\fR\n.PP\n\\&\\fB:help 'backupdir'\\fR\n.PP\n\\&\\fB:help backup\\fR\n.SS \"7.4. When I save a file with Vim, the file permissions are changed. How do I configure Vim to save a file without changing the file permissions?\"\n.IX Subsection \"7.4. When I save a file with Vim, the file permissions are changed. How do I configure Vim to save a file without changing the file permissions?\"\nThis may happen, if the 'backupcopy' option is set to \"no\" or \"auto\". Note\nthat the default value for this option is set in such a way that this will\ncorrectly work in most of the cases. If the default doesn't work for you,\ntry setting the 'backupcopy' option to \"yes\" to keep the file permission\nwhen saving a file:\n.PP\n.Vb 1\n\\& :set backupcopy=yes\n.Ve\n.PP\nThis applies, only if you have configured Vim to make a backup whenever\noverwriting a file. By default, Vim will not backup files.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'backupcopy'\\fR\n.PP\n\\&\\fB:help backup\\fR\n.PP\n\\&\\fB:help 'backup'\\fR\n.PP\n\\&\\fB:help 'writebackup'\\fR\n.SH BUFFERS\n.IX Header \"BUFFERS\"\n.SS \"8.1. I have made some modifications to a buffer. How do I edit another buffer without saving the modified buffer and also without losing the modifications?\"\n.IX Subsection \"8.1. I have made some modifications to a buffer. How do I edit another buffer without saving the modified buffer and also without losing the modifications?\"\nYou can set the 'hidden' option to edit a file without losing modifications\nto the current file:\n.PP\n.Vb 1\n\\& :set hidden\n.Ve\n.PP\nBy setting the 'hidden' option, you can also save the modification history\n(undo-history) for the buffer. Otherwise, as you switch between files, the\nundo-history will be lost (unless you use persistent undofiles).\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'hidden'\\fR\n.PP\n\\&\\fB:help hidden-quit\\fR\n.PP\n\\&\\fB:help :hide\\fR\n.SS \"8.2. How do I configure Vim to auto-save a modified buffer when switching to another buffer?\"\n.IX Subsection \"8.2. How do I configure Vim to auto-save a modified buffer when switching to another buffer?\"\nYou can set the 'autowrite' option to auto-save a modified buffer when\nswitching to another buffer:\n.PP\n.Vb 1\n\\& :set autowrite\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'autowrite'\\fR\n.PP\n\\&\\fB:help 'autowriteall'\\fR\n.PP\n\\&\\fB:help 'hidden'\\fR\n.SS \"8.3. How do I replace the buffer in the current window with a blank buffer?\"\n.IX Subsection \"8.3. How do I replace the buffer in the current window with a blank buffer?\"\nYou can use the `:enew` command to load an empty buffer in place of the\nbuffer in the current window.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :enew\\fR\n.SS \"8.4. Is there a keyboard shortcut to load a buffer by the buffer number?\"\n.IX Subsection \"8.4. Is there a keyboard shortcut to load a buffer by the buffer number?\"\nYou can use the CTRL\\-^ command to load a buffer by specifying the buffer\nnumber. For example, to load buffer number 5, you have to use the 5 CTRL\\-^\ncommand.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help CTRL\\-^\\fR\n.SS \"8.5. How do I open all the current buffers in separate windows?\"\n.IX Subsection \"8.5. How do I open all the current buffers in separate windows?\"\nYou can use the `:ball` or `:sball` commands to open all the buffers\nin the buffer list:\n.PP\n.Vb 1\n\\& :ball\n.Ve\n.PP\nIf you want all buffers to be opened in new tabs, simply prefix the `:tab`\ncommand:\n.PP\n.Vb 1\n\\& :tab :sball\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :ball\\fR\n.SS \"8.6. How do I close (delete) a buffer without exiting Vim?\"\n.IX Subsection \"8.6. How do I close (delete) a buffer without exiting Vim?\"\nYou can use any of `:bdelete`, `:bwipeout` or `:bunload` commands to\ndelete a buffer without exiting Vim. For example:\n.PP\n.Vb 1\n\\& :bdelete file1\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :bdelete\\fR\n.PP\n\\&\\fB:help :bwipeout\\fR\n.PP\n\\&\\fB:help :bunload\\fR\n.SS \"8.7. When I use the command `:%bd` to delete all the buffers, not all the buffers are deleted. Why?\"\n.IX Subsection \"8.7. When I use the command `:%bd` to delete all the buffers, not all the buffers are deleted. Why?\"\nIn the `:%bd` command, the \"%\" range will be replaced with the starting and\nending line numbers in the current buffer. Instead of using \"%\" as the\nrange, you should specify numbers for the range. For example, to delete all\nthe buffers, you can use the command `:1,9999bd`.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :bd\\fR\n.PP\n(This behaviour has been fixed with patch 7.4.530)\n.SS \"8.8. How do I display the buffer number of the current buffer/file?\"\n.IX Subsection \"8.8. How do I display the buffer number of the current buffer/file?\"\nYou can use 2<CTRL\\-G> command to display the buffer number for the current\nfile/buffer. Note the use of count before the CTRL-G command. If the count\nis greater than 1, then Vim will display the buffer number.\n.PP\nYou can also use the following command to display the current buffer\nnumber:\n.PP\n.Vb 1\n\\& :echo bufnr(\"%\")\n.Ve\n.PP\nYou can also include the \"%n\" field to the 'statusline' option to display\nthe current buffer number on the statusline.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help CTRL-G\\fR\n.PP\n\\&\\fB:help bufnr()\\fR\n.PP\n\\&\\fB:help :echo\\fR\n.PP\n\\&\\fB:help 'statusline'\\fR\n.SS \"8.9. How do I delete a buffer without closing the window in which the buffer is displayed?\"\n.IX Subsection \"8.9. How do I delete a buffer without closing the window in which the buffer is displayed?\"\nYou can use the following command to open the next buffer and delete\nthe current buffer.\n.PP\n.Vb 1\n\\& :bnext | bdelete #\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :bnext\\fR\n.PP\n\\&\\fB:help :bdelete\\fR\n.PP\n\\&\\fB:help :buffers\\fR\n.SS \"8.10. How do I map the <Tab> key to cycle through and open all the buffers?\"\n.IX Subsection \"8.10. How do I map the <Tab> key to cycle through and open all the buffers?\"\nYou can use the following two map commands, to map the <Ctrl\\-Tab> key to open\nthe next buffer and the <Ctrl\\-Shift\\-Tab> key to open the previous buffer:\n.PP\n.Vb 2\n\\& :nnoremap <C\\-Tab> :bnext<CR>\n\\& :nnoremap <S\\-C\\-Tab> :bprevious<CR>\n.Ve\n.PP\nNote, this might not work in the terminal version of Vim.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :bnext\\fR\n.PP\n\\&\\fB:help :bprevious\\fR\n.SH WINDOWS\n.IX Header \"WINDOWS\"\n.SS \"9.1. What is the difference between a Vim window and a buffer?\"\n.IX Subsection \"9.1. What is the difference between a Vim window and a buffer?\"\nA Vim buffer is a file loaded into memory for editing. The original file\nremains unchanged until you write the buffer to the file. A Vim window is a\nviewport onto a buffer. You can use multiple windows on one buffer or\nseveral windows on different buffers.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help usr_08.txt\\fR\n.PP\n\\&\\fB:help 22.4\\fR\n.PP\n\\&\\fB:help windows-intro\\fR\n.PP\n\\&\\fB:help Q_wi\\fR\n.SS \"9.2. How do I increase the width of a Vim window?\"\n.IX Subsection \"9.2. How do I increase the width of a Vim window?\"\nYou can increase the width of a Vim window using one of the following\ncommands:\n.PP\n.Vb 3\n\\& :vert resize +N\n\\& :vert resize \\-N\n\\& :vert resize N\n.Ve\n.PP\nYou can also use CTRL-W < or CTRL-W > or CTRL-W | commands.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :vertical\\-resize\\fR\n.PP\n\\&\\fB:help CTRL\\-W_\\fR>\n.PP\n\\&\\fB:help CTRL\\-W_<\\fR\n.PP\n\\&\\fB:help window-resize\\fR\n.SS \"9.3. How do I zoom into or out of a window?\"\n.IX Subsection \"9.3. How do I zoom into or out of a window?\"\nYou can zoom into a window (close all the windows except the current\nwindow) using the \"<CTRL\\-W>o\" command or the `:only` ex command.\n.PP\nYou can use the \"<CTRL\\-W>_\" command or the `:resize` ex command to increase\nthe current window height to the highest possible without closing other\nwindows.\n.PP\nYou can use the \"<CTRL\\-W>|\" command or the `:vertical resize` ex command to\nincrease the current window width to the highest possible without closing\nother windows.\n.PP\nYou can use the \"<CTRL\\-W>=\" command to make the height and width of all the\nwindows equal.\n.PP\nYou can also set the following options to get better results with the above\ncommands:\n.PP\nMethod 1:\nSet the 'winminheight' option to 0:\n.PP\n.Vb 1\n\\& :set winminheight=0\n.Ve\n.PP\nBy default, this option is set to 1.\nThis option controls the minimum height of an inactive window (when it is\nnot the current window).  When the 'winminheight' option is set to 0, only\nthe status line will be displayed for inactive windows.\n.PP\nMethod 2:\nSet the 'noequalalways' option and set the 'winheight' option to a large\nvalue (like 99999):\n.PP\n.Vb 2\n\\& :set noequalalways\n\\& :set winheight=99999\n.Ve\n.PP\nNow, the active window will always open to its maximum size, while the\nother windows will stay present, but shrunken to just a status line.\n.PP\nWith any of the above mentioned methods, you cannot restore the window\nlayout after zooming into a window.  If you want to restore the Vim window\nlayout after zooming into a window, you can use the ZoomWin plugin. You can\ndownload this plugin from the Vim online website at:\n.PP\n.Vb 1\n\\& https://www.vim.org/scripts/script.php?script_id=508\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help CTRL\\-W_o\\fR\n.PP\n\\&\\fB:help window-resize\\fR\n.PP\n\\&\\fB:help 'winminheight'\\fR\n.PP\n\\&\\fB:help 'equalalways'\\fR\n.PP\n\\&\\fB:help 'winheight'\\fR\n.PP\n\\&\\fB:help 08.3\\fR\n.SS \"9.4. How do I execute an ex command on all the open buffers or open windows or all the files in the argument list?\"\n.IX Subsection \"9.4. How do I execute an ex command on all the open buffers or open windows or all the files in the argument list?\"\nYou can use the `:bufdo` command to execute an ex command on all the open\nbuffers.  You can use the `:windo` command to execute an ex command on all\nthe open windows.  You can use the `:argdo` command to execute an ex\ncommand on all the files specified in the argument list. And finally you\ncan use the `:tabdo` command to execute an ex command in all open tab pages.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :windo\\fR\n.PP\n\\&\\fB:help :bufdo\\fR\n.PP\n\\&\\fB:help :argdo\\fR\n.PP\n\\&\\fB:help :tabdo\\fR\n.PP\n\\&\\fB:help 26.3\\fR\n.SH MOTION\n.IX Header \"MOTION\"\n.SS \"10.1. How do I jump to the beginning (first line) or end (last line) of a file?\"\n.IX Subsection \"10.1. How do I jump to the beginning (first line) or end (last line) of a file?\"\nYou can use \"G\" command to jump to the last line in the file and the \"gg\"\ncommand to jump to the first line in the file.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help G\\fR\n.PP\n\\&\\fB:help gg\\fR\n.SS \"10.2. In insert mode, when I press the <Esc> key to go to command mode, the cursor moves one character to the left (except when the cursor is on the first character of the line). Is it possible to change this behavior to keep the cursor at the same column?\"\n.IX Subsection \"10.2. In insert mode, when I press the <Esc> key to go to command mode, the cursor moves one character to the left (except when the cursor is on the first character of the line). Is it possible to change this behavior to keep the cursor at the same column?\"\nNo. It is not possible to change this behavior. The cursor is *always*\npositioned on a valid character (unless you have virtual-edit mode\nenabled). So, if you are appending text to the end of a line, when you\nreturn to command mode the cursor *must* drop back onto the last character\nyou typed. For consistency sake, the cursor drops back everywhere, even if\nyou are in the middle of a line.\n.PP\nYou can use the CTRL-O or CTRL\\-\\e CTRL-O command in insert mode to execute a\nsingle ex command and return back to insert mode without moving the cursor\ncolumn.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'virtualedit'\\fR\n.PP\n\\&\\fB:help i_CTRL\\-O\\fR\n.PP\n\\&\\fB:help i_CTRL\\-\\e_CTRL\\-O\\fR\n.SS \"10.3. How do I configure Vim to maintain the horizontal cursor position when scrolling with the <Page Up>, <Page Down>, etc keys?\"\n.IX Subsection \"10.3. How do I configure Vim to maintain the horizontal cursor position when scrolling with the <Page Up>, <Page Down>, etc keys?\"\nYou can reset the 'startofline' option to keep the cursor at the same\nhorizontal location when scrolling text:\n.PP\n.Vb 1\n\\& :set nostartofline\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'startofline'\\fR\n.SS \"10.4. Some lines in a file are more than the screen width and they are all wrapped. When I use the j, k keys to move from one line to the next, the cursor is moved to the next line in the file instead of the next line on the screen. How do I move from one screen line to the next?\"\n.IX Subsection \"10.4. Some lines in a file are more than the screen width and they are all wrapped. When I use the j, k keys to move from one line to the next, the cursor is moved to the next line in the file instead of the next line on the screen. How do I move from one screen line to the next?\"\nYou can use the gj and gk commands to move from one screen line to the\nnext/previous screen line. The j and k commands move the cursor from one\nfile line to the next file line. You can also avoid the line wrapping by\nresetting the 'wrap' option:\n.PP\n.Vb 1\n\\& :set nowrap\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gj\\fR\n.PP\n\\&\\fB:help gk\\fR\n.PP\n\\&\\fB:help 'wrap'\\fR\n.PP\nYou can use the following mappings:\n.PP\n.Vb 6\n\\& :map <Up> gk\n\\& :imap <Up> <C\\-o>gk\n\\& :map <Down> gj\n\\& :imap <Down> <C\\-o>gj\n\\& :noremap j gj\n\\& :noremap k gk\n.Ve\n.SS \"10.5. What is the definition of a sentence, paragraph and section in Vim?\"\n.IX Subsection \"10.5. What is the definition of a sentence, paragraph and section in Vim?\"\nA sentence is defined as ending at a \".\", \"!\" or \"?\" followed by either the\nend of a line, or by a space (or two) or tab. Which characters and the\nnumber of spaces needed to constitute a sentence ending is determined by\nthe 'joinspaces' and 'cpoptions' options.\n.PP\nA paragraph begins after each empty line, and also at each of a set of\nparagraph macros, specified by the pairs of characters in the 'paragraphs'\noption.\n.PP\nA section begins after a form-feed (<C\\-L>) in the first column and at each\nof a set of section macros, specified by the pairs of characters in the\n\\&'sections' option.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help sentence\\fR\n.PP\n\\&\\fB:help 'joinspaces'\\fR\n.PP\n\\&\\fB:help 'cpoptions'\\fR\n.PP\n\\&\\fB:help paragraph\\fR\n.PP\n\\&\\fB:help section\\fR\n.PP\n\\&\\fB:help word\\fR\n.SS \"10.6. How do I jump to beginning or end of a sentence, paragraph or a section?\"\n.IX Subsection \"10.6. How do I jump to beginning or end of a sentence, paragraph or a section?\"\nYou can use the following motion commands to jump to the beginning or end\nof a sentence or a paragraph or a section:\n.PP\n.Vb 10\n\\&   motion  position    where\n\\&   \\-\\-\\-\\-\\-\\-  \\-\\-\\-\\-\\-\\-\\-\\-\\-   \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\\&   (       beginning   current sentence\n\\&   )       end         current sentence\n\\&   {       beginning   current paragraph\n\\&   }       end         current paragraph\n\\&   []      end         previous section\n\\&   [[      beginning   current section\n\\&   ][      end         current section\n\\&   ]]      beginning   next section\n.Ve\n.PP\nEach of these motions can be preceded by a number which will extend the\njump forward (or backward).\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help object-motions\\fR\n.SS \"10.7. I have lines in a file that extends beyond the right extent of the screen. How do I move the Vim view to the right to see the text off the screen?\"\n.IX Subsection \"10.7. I have lines in a file that extends beyond the right extent of the screen. How do I move the Vim view to the right to see the text off the screen?\"\nYou can use one of the following commands to horizontally scroll the screen\nto the left or right:\n.PP\n.Vb 8\n\\& cmd  scroll to\n\\& \\-\\-\\-  \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\\& zl   scroll to the left\n\\& zh   scroll to the right\n\\& zL   scroll half a screenwidth to the left\n\\& zH   scroll half a screenwidth to the right\n\\& zs   scroll to position the cursor at the start of the screen\n\\& ze   scroll to position the cursor at the end of the screen\n.Ve\n.PP\nYou can use the g0 command to move the cursor to the first character of the\nscreen line and the g$ command to move the cursor to the last character of\nthe screen line without scrolling the screen.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help scroll-horizontal\\fR\n.SS \"10.8. How do I scroll two or more buffers simultaneously?\"\n.IX Subsection \"10.8. How do I scroll two or more buffers simultaneously?\"\nYou can set the 'scrollbind' option for each of the buffers to scroll them\nsimultaneously.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'scrollbind'\\fR\n.PP\n\\&\\fB:help scroll-binding\\fR\n.PP\n\\&\\fB:help 'scrollopt'\\fR\n.PP\n\\&\\fB:help 'cursorbind'\\fR\n.SS \"10.9. When I use my arrow keys, Vim changes modes, inserts weird characters in my document but doesn't move the cursor properly. What's going on?\"\n.IX Subsection \"10.9. When I use my arrow keys, Vim changes modes, inserts weird characters in my document but doesn't move the cursor properly. What's going on?\"\nThere are a couple of things that could be going on: either you are using\nVim over a slow connection or Vim doesn't understand the key sequence that\nyour keyboard is generating.\n.PP\nIf you are working over a slow connection (such as a 2400 bps modem), you\ncan try to set the 'timeout' or 'ttimeout' option. These options, combined\nwith the 'timeoutlen' and 'ttimeoutlen' options, may fix the problem.\n.PP\nThe preceding procedure will not work correctly if your terminal sends key\ncodes that Vim does not understand. In this situation, your best option is\nto map your key sequence to a matching cursor movement command and save\nthese mappings in a file. You can then `:source` the file whenever you work\nfrom that terminal.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'timeout'\\fR\n.PP\n\\&\\fB:help 'ttimeout'\\fR\n.PP\n\\&\\fB:help 'timeoutlen'\\fR\n.PP\n\\&\\fB:help 'ttimeoutlen'\\fR\n.PP\n\\&\\fB:help :map\\fR\n.PP\n\\&\\fB:help vt100\\-cursor\\-keys\\fR\n.SS \"10.10. How do I configure Vim to move the cursor to the end of the previous line, when the left arrow key is pressed and the cursor is currently at the beginning of a line?\"\n.IX Subsection \"10.10. How do I configure Vim to move the cursor to the end of the previous line, when the left arrow key is pressed and the cursor is currently at the beginning of a line?\"\nYou can add the \"<\" flag to the 'whichwrap' option to configure Vim to move\nthe cursor to the end of the previous line, when the left arrow key is\npressed and the cursor is currently at the beginning of a line:\n.PP\n.Vb 1\n\\& :set whichwrap+=<\n.Ve\n.PP\nSimilarly, to move the cursor the beginning of the next line, when the\nright arrow key is  pressed and the cursor is currently at the end of a\nline, add the \">\" flag to the 'whichwrap' option:\n.PP\n.Vb 1\n\\& :set whichwrap+=>\n.Ve\n.PP\nThe above will work only in normal and visual modes. To use this in insert\nand replace modes, add the \"[\" and \"]\" flags respectively.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'whichwrap'\\fR\n.PP\n\\&\\fB:help 05.7\\fR\n.SS \"10.11. How do I configure Vim to stay only in insert mode (modeless editing)?\"\n.IX Subsection \"10.11. How do I configure Vim to stay only in insert mode (modeless editing)?\"\nYou can set the 'insertmode' option to configure Vim to stay only in insert\nmode:\n.PP\n.Vb 1\n\\& :set insertmode\n.Ve\n.PP\nBy setting this option, you can use Vim as a modeless editor. If you press\nthe <Esc> key, Vim will not go to the normal mode. To execute a single\nnormal mode command, you can press CTRL-O followed by the normal mode\ncommand.  To execute more than one normal command, you can use CTRL-L\nfollowed by the commands. To return to insert mode, press the <Esc> key. To\ndisable this option, reset the 'insertmode' option:\n.PP\n.Vb 1\n\\& :set noinsertmode\n.Ve\n.PP\nYou can also start vim using the \"evim\" command or you can use \"vim \\-y\" to\nuse Vim as a modeless editor.\n.PP\nYou can also start Vim in insert mode using the `:startinsert` ex command.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'insertmode'\\fR\n.PP\n\\&\\fB:help :startinsert\\fR\n.PP\n\\&\\fB:help :stopinsert\\fR\n.PP\n\\&\\fB:help i_CTRL\\-O\\fR\n.PP\n\\&\\fB:help i_CTRL\\-L\\fR\n.PP\n\\&\\fB:help evim\\fR\n.PP\n\\&\\fB:help evim-keys\\fR\n.SS \"10.12. How do I display some context lines when scrolling text?\"\n.IX Subsection \"10.12. How do I display some context lines when scrolling text?\"\nYou can set the 'scrolloff' option to display a minimal number of screen\nlines (context) above and below the cursor.\n.PP\n.Vb 1\n\\& :set scrolloff=10\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'scrolloff'\\fR\n.PP\n\\&\\fB:help 'sidescrolloff'\\fR\n.SS \"10.13. How do I go back to previous cursor locations?\"\n.IX Subsection \"10.13. How do I go back to previous cursor locations?\"\nYou can go back to the cursor location before the latest jump using the ''\nor `` command. You can use the CTRL-O command to go back to older cursor\npositions and the CTRL-I command to go to the newer cursor positions in the\njump list.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 03.10\\fR\n.PP\n\\&\\fB:help mark-motions\\fR\n.PP\n\\&\\fB:help jump-motions\\fR\n.SH \"SEARCHING TEXT\"\n.IX Header \"SEARCHING TEXT\"\n.SS \"11.1. After I searched for a text with a pattern, all the matched text stays highlighted. How do I turn off the highlighting temporarily/permanently?\"\n.IX Subsection \"11.1. After I searched for a text with a pattern, all the matched text stays highlighted. How do I turn off the highlighting temporarily/permanently?\"\nThe 'hlsearch' option controls whether all the matches for the last\nsearched pattern are highlighted or not. By default, this option is not\nenabled. If this option is set in a system-wide vimrc file, then you can\nturn off the search highlighting by using the following command:\n.PP\n.Vb 1\n\\& :set nohlsearch\n.Ve\n.PP\nTo temporarily turn off the search highlighting, use\n.PP\n.Vb 1\n\\& :nohlsearch\n.Ve\n.PP\nYou can also clear the search highlighting, by searching for a pattern that\nis not in the current file (for example, search for the pattern \"asdf\").\n.PP\nYou can use this mapping, to clear the search highlighting when\nredrawing the window pressing CTRL-L\n.PP\n.Vb 1\n\\& :nnoremap <silent> <C\\-L> <C\\-L>:nohls<CR>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'hlsearch'\\fR\n.PP\n\\&\\fB:help :nohlsearch\\fR\n.SS \"11.2. How do I enter a carriage return character in a search pattern?\"\n.IX Subsection \"11.2. How do I enter a carriage return character in a search pattern?\"\nYou can either use \"\\er\" or <CTRL\\-V><CTRL\\-M> to enter a carriage return\ncharacter in a pattern. In Vim scripts, it is better to use \"\\er\" for the\ncarriage return character.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help sub-replace-special\\fR\n.SS \"11.3. How do I search for the character ^M?\"\n.IX Subsection \"11.3. How do I search for the character ^M?\"\nYou can enter the ^M character in a search command by first pressing the\nCTRL-V key and then pressing the CTRL-M key.\n.PP\n.Vb 1\n\\& /^V^M\n.Ve\n.PP\nYou can also use the \"\\er\" character. In Vim scripts, \"\\er\" is preferred.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help c_CTRL\\-V\\fR\n.PP\n\\&\\fB:help using_CTRL\\-V\\fR\n.PP\n\\&\\fB:help /\\er\\fR\n.SS \"11.4. How can I search/replace characters that display as \"\"~R\"\", \"\"~S\"\", etc.?\"\n.IX Subsection \"11.4. How can I search/replace characters that display as \"\"~R\"\", \"\"~S\"\", etc.?\"\nYou can use the \"ga\" command to display the ASCII value/code for the\nspecial character. For example, let us say the ASCII value is 142. Then you\ncan use the following command to search for the special character:\n.PP\n.Vb 1\n\\& /^V142\n.Ve\n.PP\nwhere, ^V is entered by pressing CTRL-V.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help ga\\fR\n.PP\n\\&\\fB:help using_CTRL\\-V\\fR\n.PP\n\\&\\fB:help 24.8\\fR\n.SS \"11.5. How do I highlight all the non-printable characters in a file?\"\n.IX Subsection \"11.5. How do I highlight all the non-printable characters in a file?\"\nYou can use the following commands and search pattern to highlight all the\nnon-printable characters in a file:\n.PP\n.Vb 2\n\\& :set hlsearch\n\\& /\\e(\\ep\\e|$\\e)\\e@!.\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help /\\ep\\fR\n.PP\n\\&\\fB:help /bar\\fR\n.PP\n\\&\\fB:help /$\\fR\n.PP\n\\&\\fB:help /\\e(\\fR\n.PP\n\\&\\fB:help /\\e@!\\fR\n.PP\n\\&\\fB:help 'hlsearch'\\fR\n.SS \"11.6. How do I search for whole words in a file?\"\n.IX Subsection \"11.6. How do I search for whole words in a file?\"\nYou can search for whole words in a file using the \\e< and \\e> atoms. For\nexample:\n.PP\n.Vb 1\n\\& /\\e<myword\\e>\n.Ve\n.PP\nThe \\e< atom matches the beginning of the word and the \\e> atom matches the\nend of the word.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help /\\e<\\fR\n.PP\n\\&\\fB:help /\\e\\fR>\n.SS \"11.7. How do I search for the current word under the cursor?\"\n.IX Subsection \"11.7. How do I search for the current word under the cursor?\"\nYou can press the * key to search forward for the current word under the\ncursor.  To search backward, you can press the # key. Note that only whole\nkeywords will be searched using these commands.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help star\\fR\n.PP\n\\&\\fB:help #\\fR\n.PP\n\\&\\fB:help gstar\\fR\n.PP\n\\&\\fB:help g#\\fR\n.PP\n\\&\\fB:help 03.8\\fR\n.PP\n\\&\\fB:help search-commands\\fR\n.SS \"11.8. How do I search for a word without regard to the case (uppercase or lowercase)?\"\n.IX Subsection \"11.8. How do I search for a word without regard to the case (uppercase or lowercase)?\"\nTo always ignore case while searching for a pattern, set the 'ignorecase'\noption:\n.PP\n.Vb 1\n\\& :set ignorecase\n.Ve\n.PP\nTo ignore case only when searching a particular pattern, use the special \\ec\ndirective:\n.PP\n.Vb 1\n\\& /\\ec<pattern>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'ignorecase'\\fR\n.PP\n\\&\\fB:help /ignorecase\\fR\n.PP\n\\&\\fB:help /\\ec\\fR\n.SS \"11.9. How do I search for words that occur twice consecutively?\"\n.IX Subsection \"11.9. How do I search for words that occur twice consecutively?\"\nYou can use one of the following search commands to locate words that occur\ntwice consecutively:\n.PP\n.Vb 2\n\\&  /\\e(\\e<\\ew\\e+\\e)\\e_s\\e+\\e1\\e>\n\\&  /\\e(\\e<\\ek\\e+\\e)\\e_s\\e+\\e1\\e>\n.Ve\n.PP\nThe main difference is the use of \"\\ew\" and \"\\ek\", where the latter is based\non the 'iskeyword' option which may include accented and other language\nspecific characters.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help /\\e1\\fR\n.PP\n\\&\\fB:help /\\e(\\fR\n.PP\n\\&\\fB:help /\\e)\\fR\n.PP\n\\&\\fB:help /\\e<\\fR\n.PP\n\\&\\fB:help /\\e\\fR>\n.PP\n\\&\\fB:help /\\ew\\fR\n.PP\n\\&\\fB:help /\\ek\\fR\n.PP\n\\&\\fB:help /\\e+\\fR\n.PP\n\\&\\fB:help /\\e_x\\fR\n.PP\n\\&\\fB:help 'iskeyword'\\fR\n.SS \"11.10. How do I count the number of times a particular word occurs in a buffer?\"\n.IX Subsection \"11.10. How do I count the number of times a particular word occurs in a buffer?\"\nYou can use the following set of commands to count the number of times a\nparticular word occurs in a buffer:\n.PP\n.Vb 3\n\\& :let cnt=0\n\\& :g/\\e<your_word\\e>/let cnt=cnt+1\n\\& :echo cnt\n.Ve\n.PP\nThis only counts the number of lines where the word occurs. You can also\nuse the following command:\n.PP\n.Vb 1\n\\& :%s/\\e<word\\e>/&/gn\n.Ve\n.PP\nTo count the number of alphabetic words in a file, you can use\n.PP\n.Vb 1\n\\& :%s/\\ea\\e+/&/gn\n.Ve\n.PP\nTo count the number of words made up of non-space characters, you can use\n.PP\n.Vb 1\n\\& :%s/\\eS\\e+/&/gn\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help count-items\\fR\n.PP\n\\&\\fB:help word-count\\fR\n.PP\n\\&\\fB:help v_g_CTRL\\-G\\fR\n.PP\n\\&\\fB:help 12.5\\fR\n.PP\n\\&\\fB:help :s_flags\\fR\n.SS \"11.11. How do I place the cursor at the end of the matched word when searching for a pattern?\"\n.IX Subsection \"11.11. How do I place the cursor at the end of the matched word when searching for a pattern?\"\nYou can use the \"e\" offset to the search command to place the cursor at the\nend of the matched word. For example\n.PP\n.Vb 1\n\\& /mypattern/e\n.Ve\n.PP\nFor more information about search offsets, read:\n.PP\n\\&\\fB:help search-offset\\fR\n.PP\n\\&\\fB:help /\\fR\n.SS \"11.12. How do I search for an empty line?\"\n.IX Subsection \"11.12. How do I search for an empty line?\"\nYou can search for an empty line using:\n.PP\n.Vb 1\n\\& /^$\n\\&\n\\& or\n\\&\n\\& /^\\es*$\n.Ve\n.PP\nThe latter also matches lines, that consist only of white space, while the\nformer only matches true empty lines. For more information, read:\n.PP\n\\&\\fB:help /^\\fR\n.PP\n\\&\\fB:help /$\\fR\n.PP\n\\&\\fB:help /\\es\\fR\n.PP\n\\&\\fB:help /star\\fR\n.PP\n\\&\\fB:help search-commands\\fR\n.SS \"11.13. How do I search for a line containing only a single character?\"\n.IX Subsection \"11.13. How do I search for a line containing only a single character?\"\nYou can search for a line containing only a single character using:\n.PP\n.Vb 1\n\\& /^\\es*\\ea\\es*$\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help /^\\fR\n.PP\n\\&\\fB:help /\\ea\\fR\n.PP\n\\&\\fB:help /\\es\\fR\n.PP\n\\&\\fB:help /star\\fR\n.PP\n\\&\\fB:help /$\\fR\n.SS \"11.14. How do I search and replace a string in multiple files?\"\n.IX Subsection \"11.14. How do I search and replace a string in multiple files?\"\nYou can use the `:argdo`, `:bufdo`, `:windo` or `:tabdo` commands to execute\nan ex command on multiple files. For example:\n.PP\n.Vb 1\n\\& :argdo %s/foo/bar/g|upd\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :argdo\\fR\n.PP\n\\&\\fB:help :bufdo\\fR\n.PP\n\\&\\fB:help :windo\\fR\n.PP\n\\&\\fB:help :tabdo\\fR\n.SS \"11.15. I am using the `:s` substitute command in a mapping. When a search for a pattern fails, the map terminates. I would like the map to continue processing the next command, even if the substitute command fails. How do I do this?\"\n.IX Subsection \"11.15. I am using the `:s` substitute command in a mapping. When a search for a pattern fails, the map terminates. I would like the map to continue processing the next command, even if the substitute command fails. How do I do this?\"\nYou can use the \"e\" flag to the substitute command to continue processing\nother commands in a map, when a pattern is not found.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :s_flags\\fR\n.SS \"11.16. How do I search for the n\\-th occurrence of a character in a line?\"\n.IX Subsection \"11.16. How do I search for the n-th occurrence of a character in a line?\"\nTo search for the n\\-th occurrence of a character in a line, you can prefix\nthe \"f\" command with a number. For example, to search for the 5th\noccurrence of the character @ in a line, you can use the command 5f@. This\nassumes the cursor is at the beginning of the line \\- and that this first\ncharacter is not the one your are looking for.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help f\\fR\n.PP\n\\&\\fB:help F\\fR\n.PP\n\\&\\fB:help t\\fR\n.PP\n\\&\\fB:help T\\fR\n.PP\n\\&\\fB:help ;\\fR\n.PP\n\\&\\fB:help ,\\fR\n.SS \"11.17. How do I replace a tab (or any other character) with a hard return (newline) character?\"\n.IX Subsection \"11.17. How do I replace a tab (or any other character) with a hard return (newline) character?\"\nYou can replace a tab (or any other character) with a hard return (newline)\ncharacter using the following command:\n.PP\n.Vb 1\n\\& :s/\\et/\\er/\n.Ve\n.PP\nNote that in the above command, if you use \\en instead of \\er, then the tab\ncharacters will not be replaced by a new-line character.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help sub-replace-special\\fR\n.PP\n\\&\\fB:help NL-used-for-Nul\\fR\n.PP\n\\&\\fB:help CR-used-for-NL\\fR\n.SS \"11.18. How do I search for a character by its ASCII value?\"\n.IX Subsection \"11.18. How do I search for a character by its ASCII value?\"\nYou can search for a character by its ASCII value by pressing CTRL-V\nfollowed by the decimal or hexadecimal or octal value of that character in\nthe search \"/\" command.  To determine the ASCII value of a character you\ncan use the `:ascii` or the \"ga\" command.\n.PP\nFor example, to search for the ASCII character with value 188, you can\nuse one of the following search commands:\n.PP\n.Vb 4\n\\& /<CTRL\\-V>188\n\\& /<CTRL\\-V>o274\n\\& /<CTRL\\-V>xBC\n\\& /<CTRL\\-V>u00bc\n.Ve\n.PP\nYou can also search for the character with the decimal/octal/hex number\nusing a collation [] like this:\n.PP\n.Vb 4\n\\& /[\\ed188]\n\\& /[\\eo274]\n\\& /[\\exbc]\n\\& /[\\eu00bc]\n.Ve\n.PP\nAlternatively, you can use the special atom \\e%d \\e%o \\e%x \\e%u:\n.PP\n.Vb 4\n\\& /\\e%d188\n\\& /\\e%o274\n\\& /\\e%xbc\n\\& /\\e%u00bc\n.Ve\n.PP\nOr you use digraphs to enter the character. For example enter:\n.PP\n.Vb 1\n\\& /CTRL\\-K14\n.Ve\n.PP\nto search for the above character.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-V_digit\\fR\n.PP\n\\&\\fB:help :ascii\\fR\n.PP\n\\&\\fB:help ga\\fR\n.PP\n\\&\\fB:help /\\e]\\fR\n.PP\n\\&\\fB:help /\\e%d\\fR\n.PP\n\\&\\fB:help digraphs\\fR\n.SS \"11.19. How do I search for long lines?\"\n.IX Subsection \"11.19. How do I search for long lines?\"\nYou can search for long lines or lines containing more than a specific\nnumber of characters using the Vim regular-expressions in the search\ncommand. For example, to search for all the lines containing more than 80\ncharacters, you can use one of the following commands:\n.PP\n.Vb 3\n\\& /^.\\e{80}.\\e+$\n\\& /^.*\\e%>80c.*$\n\\& /^.*\\e%>80v.*$\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help /\\e{\\fR\n.PP\n\\&\\fB:help /\\e%c\\fR\n.PP\n\\&\\fB:help /\\e%v\\fR\n.SS \"11.20. How do I display all the lines in the current buffer that contain a specified pattern?\"\n.IX Subsection \"11.20. How do I display all the lines in the current buffer that contain a specified pattern?\"\nYou can use the following command to display all the lines in the current\nbuffer that contain a specified pattern:\n.PP\n.Vb 1\n\\& :g/<pattern>/p\n.Ve\n.PP\nFor example, the following command will display all the lines in the\ncurrent buffer that contain \"vim\":\n.PP\n.Vb 1\n\\& :g/vim/p\n.Ve\n.PP\nSince `:p` is the default command to be executed for the ex command `:g`, you\ncan also use:\n.PP\n.Vb 1\n\\& :g/vim\n.Ve\n.PP\nIf you also want the corresponding line numbers, then you can use the\nfollowing command:\n.PP\n.Vb 1\n\\& :g/<pattern>/#\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :global\\fR\n.PP\n\\&\\fB:help :print\\fR\n.PP\n\\&\\fB:help :number\\fR\n.SS \"11.21. How do I search for a text string that spans multiple lines?\"\n.IX Subsection \"11.21. How do I search for a text string that spans multiple lines?\"\nYou can search for a text string that spans multiple lines using the \\e_x\nregular expression atom. For example, to search for the text string \"Hello\nWorld\", you can use the following search command:\n.PP\n.Vb 1\n\\& /Hello\\e_sWorld\n.Ve\n.PP\nThis will match the word \"Hello\" followed by a newline character and then\nthe word \"World\" at the beginning of the next line. This will also match\nthe word \"Hello\" immediately followed by a space character and then the\nword \"World\". When searching for the \"Hello World\" string, to include the\nspace characters at the end and beginning of the line, you can use the\nfollowing search command:\n.PP\n.Vb 1\n\\& /Hello\\e_s\\e+World\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 27.8\\fR\n.PP\n\\&\\fB:help pattern-atoms\\fR\n.PP\n\\&\\fB:help /\\e_\\fR\n.PP\n\\&\\fB:help pattern-searches\\fR\n.SS \"11.22. How do I search for a pattern within the specified range of lines in a buffer?\"\n.IX Subsection \"11.22. How do I search for a pattern within the specified range of lines in a buffer?\"\nYou can search for a pattern within a range of lines using the \\e%>l\nand \\e%<l regular expression atoms.\n.PP\nFor example, to search for the word \"white\" between the lines 10 and 30 in\na buffer, you can use the following command:\n.PP\n.Vb 1\n\\& /white\\e%>9l\\e%<31l\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help /\\e%l\\fR\n.SS \"11.23. How do I clear the last searched pattern?\"\n.IX Subsection \"11.23. How do I clear the last searched pattern?\"\nThe last searched pattern is stored in the \"/\" register. You can clear\nthis register using the following command:\n.PP\n.Vb 1\n\\& :let @/=\"\"\n.Ve\n.PP\nTo clear the last search pattern whenever a buffer is unloaded, you can use\nthe following command:\n.PP\n.Vb 1\n\\& :autocmd BufUnload * let @/ = \"\"\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help @/\\fR\n.PP\n\\&\\fB:help :let\\-@\\fR\n.PP\n\\&\\fB:help autocmd-searchpat\\fR\n.PP\n\\&\\fB:help last-pattern\\fR\n.SS \"11.24. Why does this pattern \"\"a.\\e{\\-}p\\e@!\"\" not match?\"\n.IX Subsection \"11.24. Why does this pattern \"\"a.{-}p@!\"\" not match?\"\n\"\\e{\\-}\" doesn't just mean \"as few as possible\", it means \"as few as\npossible to make the whole pattern succeed\". If it didn't match the \"p\",\nthe whole pattern would fail (because of the \"p\\e@!\") so it does match\nthe \"p\". It is a longer match, but it is the shortest match that makes\nthe whole pattern succeed.\n.PP\nIf you wanted \"as few as possible regardless\" you would use \"\\e@>\", which\nbasically divides a pattern up so that the pieces either side behave\nindependently. If the pattern were \"a.\\e{\\-}\\e@>p\\e@!\" then \".\\e{\\-}\" would\nalways match nothing because that's the smallest match that can succeed\nwhen there are not other restrictions. The whole pattern then would\nbehave the same as \"ap\\e@!\", i.e. it would match any \"a\" not followed by\na \"p\").\n.PP\nThis means, it matches as few as possible \"a\"s without trying to keep\ngoing until Vim finds the longest match. This means, it will still match\n\"ap\".\n.SS \"11.25. How can I use \"\"/\"\" within a pattern, without escaping it?\"\n.IX Subsection \"11.25. How can I use \"\"/\"\" within a pattern, without escaping it?\"\nWhen using / to search for a pattern, you need to escape all \"/\" within\nthe pattern, because they would otherwise terminate the pattern. So you\ncan't directly search for /usr/share/doc/ but need to search for\n\\&\\e/usr\\e/share\\e/doc\\e/\n.PP\nThe easiest solution around that, would be to use \"?\" to start a\nbackward search and afterwards use /<CR> to use the last search-pattern\nin forward direction.\n.PP\nIf you have a Vim, that has the eval-feature built in (which needs at\nleast a normal built or higher), you can also directly paste the pattern\ninto the search register:\n.PP\n:let @/ = '/usr/share/doc/'\n.PP\nThen use \"n\" to jump to the next occurrence.\n.PP\nSee also the help at\n.PP\n\\&\\fB:help @/\\fR\n.PP\n\\&\\fB:help /<CR\\fR>\n.SS \"11.26. How can I operate on a search match?\"\n.IX Subsection \"11.26. How can I operate on a search match?\"\nThe \"gn\" command makes it easy to operate on regions of text that match\nthe current search pattern. By default, it will search forward for the\nlast used search pattern and visually select the match. If the cursor is\nalready on the match, it will be visually selected. If you used the \"gn\"\ncommand after an operator (e.g. \"c\" to change text), it will be applied\non the match.\n.PP\nIf Visual mode is active before using gn, the visual selection will be\nextended until the end of the next match.\n.PP\nThe \"gN\" commands works similar but searches backwards.\n.PP\nThis allows to repeat simple operations on each match. For example, you\nmight want to change each occurence of apples by peaches. So you search\nusing \"/apple\" then you can use \"cgnpeach<Esc>\" to replace the current\nmatch by peach. Now you can use the dot \".\" command to redo the\nreplacement for the rest of the buffer.\n.PP\nSee also the help at\n.PP\n\\&\\fB:help gn\\fR\n.PP\n\\&\\fB:help gN\\fR\n.SH \"CHANGING TEXT\"\n.IX Header \"CHANGING TEXT\"\n.SS \"12.1. How do I delete all the trailing white space characters (SPACE and TAB) at the end of all the lines in a file?\"\n.IX Subsection \"12.1. How do I delete all the trailing white space characters (SPACE and TAB) at the end of all the lines in a file?\"\nYou can use the `:substitute` command on the entire file to search and\nremove all the trailing white space characters:\n.PP\n.Vb 1\n\\& :%s/\\es\\e+$//\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :%\\fR\n.PP\n\\&\\fB:help :s\\fR\n.PP\n\\&\\fB:help /\\es\\fR\n.PP\n\\&\\fB:help /\\e+\\fR\n.PP\n\\&\\fB:help /$\\fR\n.SS \"12.2. How do I replace all the occurrences of multiple consecutive space characters to a single space?\"\n.IX Subsection \"12.2. How do I replace all the occurrences of multiple consecutive space characters to a single space?\"\nYou can use the following command to replace all the occurrences of\nmultiple consecutive space characters to a single space:\n.PP\n.Vb 1\n\\& :%s/ \\e{2,}/ /g\n.Ve\n.PP\nAlternatively use:\n.PP\n.Vb 1\n\\& :%s/  \\e+/ /g\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :%\\fR\n.PP\n\\&\\fB:help :s\\fR\n.PP\n\\&\\fB:help /\\e{\\fR\n.PP\n\\&\\fB:help :s_flags\\fR\n.SS \"12.3. How do I reduce a range of empty lines into one line only?\"\n.IX Subsection \"12.3. How do I reduce a range of empty lines into one line only?\"\nYou can use the following command to reduce a range of empty lines into one\nline only:\n.PP\n.Vb 1\n\\& :v/./.,/./\\-1join\n.Ve\n.PP\nThe explanation for this command is below:\n.PP\n.Vb 10\n\\& part            description\n\\& \\-\\-\\-\\-\\-           \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\\& :v/./           Execute the following command for all lines not\n\\&                 containing a character (empty lines).\n\\&  .,             Use the current line as the start of the range of\n\\&                 lines.\n\\&  /./            Use the line containing a character as the last line.\n\\&  \\-1             Adjust the range of lines to end with the line before\n\\&                 the last line.\n\\&  j              Join the lines in the range.\n.Ve\n.PP\nNote that this will give an error message if the empty lines are at the end\nof the file. To correct this, you have to add a temporary line at the end\nof the file, execute the command and then remove the temporary line.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :v\\fR\n.PP\n\\&\\fB:help :join\\fR\n.PP\n\\&\\fB:help cmdline-ranges\\fR\n.PP\n\\&\\fB:help collapse\\fR\n.SS \"12.4. How do I delete all blank lines in a file? How do I remove all the lines containing only space characters?\"\n.IX Subsection \"12.4. How do I delete all blank lines in a file? How do I remove all the lines containing only space characters?\"\nTo remove all blank lines, use the following command:\n.PP\n.Vb 1\n\\& :g/^$/d\n.Ve\n.PP\nTo remove all lines with only whitespace (spaces or tabs) in them, use the\nfollowing command:\n.PP\n.Vb 1\n\\& :g/^\\es\\e+$/d\n.Ve\n.PP\nTo remove all the lines with only whitespace, if anything, use the\nfollowing command:\n.PP\n.Vb 1\n\\& :g/^\\es*$/d\n.Ve\n.SS \"12.5. How do I copy/yank the current word?\"\n.IX Subsection \"12.5. How do I copy/yank the current word?\"\nYou can use the \"yiw\" (yank inner word without whitespace) command or the\n\"yaw\" (yank a word with whitespace) command to copy/yank the current\nword.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 04.6\\fR\n.PP\n\\&\\fB:help 04.8\\fR\n.PP\n\\&\\fB:help iw\\fR\n.PP\n\\&\\fB:help yank\\fR\n.PP\n\\&\\fB:help text-objects\\fR\n.PP\n\\&\\fB:help objects\\fR\n.SS \"12.6. How do I yank text from one position to another position within a line, without yanking the entire line?\"\n.IX Subsection \"12.6. How do I yank text from one position to another position within a line, without yanking the entire line?\"\nYou can specify a motion command with the yank operator (y) to yank text\nfrom one position to another position within a line. For example, to yank\nfrom the current cursor position till the next letter x, use yfx or Fx or\ntx or Tx. To yank till the nth column, use n|. To yank till the next\noccurrence of a \"word\", use /word. To do a yank till the nth column on\nanother line, first mark the position using the \"ma\" command, go to the\nstart of the yank position, and then yank till the mark using y`a (note the\ndirection of the quote)\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help yank\\fR\n.PP\n\\&\\fB:help motion.txt\\fR\n.PP\n\\&\\fB:help 04.6\\fR\n.SS \"12.7. When I yank some text into a register, how do I append the text to the current contents of the register?\"\n.IX Subsection \"12.7. When I yank some text into a register, how do I append the text to the current contents of the register?\"\nWhen you specify the register for some operation, if you use the upper-case\nfor the register name, then the new text will be appended to the existing\ncontents. For example, if you have some text in the register \"a\". If you\nwant to append some new text to this, you have to use the \"A\" register\nname. If you use the lowercase register name, then the contents of the\nregister will be overwritten with the new text.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help quote\\fR\n.PP\n\\&\\fB:help quote_alpha\\fR\n.PP\n\\&\\fB:help 10.1\\fR\n.SS \"12.8. How do I yank a complete sentence that spans over more than one line?\"\n.IX Subsection \"12.8. How do I yank a complete sentence that spans over more than one line?\"\nTo yank a complete sentence that spans over more than one line you have to\nuse the yank operator followed by a motion command. For example:\n.PP\n.Vb 1\n\\&     y)\n.Ve\n.PP\nFrom inside the sentence you can use \"yi)\" to yank the sentence.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help yank\\fR\n.PP\n\\&\\fB:help {motion}\\fR\n.PP\n\\&\\fB:help object-motions\\fR\n.PP\n\\&\\fB:help 04.6\\fR\n.SS \"12.9. How do I yank all the lines containing a pattern into a buffer?\"\n.IX Subsection \"12.9. How do I yank all the lines containing a pattern into a buffer?\"\nYou can use the `:global` command to yank all the lines containing the\npattern into a register and then paste the contents of the register into\nthe buffer:\n.PP\n.Vb 2\n\\& :let @a=\\*(Aq\\*(Aq\n\\& :g/mypattern/y A\n.Ve\n.PP\nThe first command, clears the contents of the register \"a\". The second\ncommand copies all the lines containing \"mypattern\" into the register \"a\".\nNote that the capital letter \"A\" is used to append the matched lines. Now\nyou can paste the contents of register \"a\" to a buffer using \"ap command.\n.PP\nIf you only want to collect all matches, you can use a different\napproach. For that run the `:s` command with the flags \"gn\" so that it\nwon't actually  change the buffer (\"n\" flag) but select each match (\"g\"\nflag). Combining this with the \"\\e=\" part in the replacement part, you\ncan copy each match to e.g. a list. Altogether this looks like this:\n.PP\n.Vb 2\n\\& :let list=[]\n\\& :%s/pattern/\\e=add(list, submatch(0))/gn\n.Ve\n.PP\nNow all matches will be in the list and you can post process them as\nwanted.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :g\\fR\n.PP\n\\&\\fB:help :y\\fR\n.PP\n\\&\\fB:help :let\\-register\\fR\n.PP\n\\&\\fB:help quote_alpha\\fR\n.PP\n\\&\\fB:help put\\fR\n.PP\n\\&\\fB:help registers\\fR\n.PP\n\\&\\fB:help :registers\\fR\n.PP\n\\&\\fB:help sub\\-replace\\-\\e=\\fR\n.SS \"12.10. How do I delete all the lines in a file that do not contain a pattern?\"\n.IX Subsection \"12.10. How do I delete all the lines in a file that do not contain a pattern?\"\nYou can use `:v` command to delete all the lines that do not contain a\npattern:\n.PP\n.Vb 1\n\\& :v/pattern/d\n.Ve\n.PP\nor\n.PP\n.Vb 1\n\\& :g!/pattern/d\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :v\\fR\n.PP\n\\&\\fB:help :g\\fR\n.SS \"12.11. How do I add a line before each line with \"\"pattern\"\" in it?\"\n.IX Subsection \"12.11. How do I add a line before each line with \"\"pattern\"\" in it?\"\nYou can use the following command to add a line before each line with\n\"pattern\" in it:\n.PP\n.Vb 1\n\\& :g/pattern/normal! Oi<line of text goes here>\n.Ve\n.PP\nAlternatively you can yank the line using the Y command and then insert the\nline using the following command:\n.PP\n.Vb 1\n\\& :g/pattern/put!\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :g\\fR\n.PP\n\\&\\fB:help :put\\fR\n.PP\n\\&\\fB:help insert\\fR\n.PP\n\\&\\fB:help 0\\fR\n.SS \"12.12. Is there a way to operate on a line if the previous line contains a particular pattern?\"\n.IX Subsection \"12.12. Is there a way to operate on a line if the previous line contains a particular pattern?\"\nYou can use the `:global` command to operate on a line, if the previous\nline contains a particular pattern:\n.PP\n.Vb 1\n\\& :g/<pattern>/+{cmd}\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :g\\fR\n.PP\n\\&\\fB:help :range\\fR\n.SS \"12.13. How do I execute a command on all the lines containing a pattern?\"\n.IX Subsection \"12.13. How do I execute a command on all the lines containing a pattern?\"\nYou can use the `:global` (:g) command to execute a command on all the\nlines containing a pattern.\n.PP\n.Vb 1\n\\& :g/my pattern/d\n.Ve\n.PP\nIf you want to use a non-Ex command, then you can use the `:normal`\ncommand:\n.PP\n.Vb 1\n\\& :g/my pattern/normal {command}\n.Ve\n.PP\nUnless you want the normal mode commands to be remapped, consider using a\n`:normal!` command instead (note the \"!\").\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :global\\fR\n.PP\n\\&\\fB:help :v\\fR\n.PP\n\\&\\fB:help :normal\\fR\n.SS \"12.14. Can I copy the character above the cursor to the current cursor position?\"\n.IX Subsection \"12.14. Can I copy the character above the cursor to the current cursor position?\"\nIn Insert mode, you can copy the character above the cursor to the current\ncursor position by typing CTRL-Y. The same can be done with the\ncharacters below the cursor by typing CTRL-E.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-Y\\fR\n.PP\n\\&\\fB:help i_CTRL\\-E\\fR\n.SS \"12.15. How do I insert a blank line above/below the current line without entering insert mode?\"\n.IX Subsection \"12.15. How do I insert a blank line above/below the current line without entering insert mode?\"\nYou can use the `:put` ex command to insert blank lines. For example, try\n.PP\n.Vb 2\n\\& :put =\\*(Aq\\*(Aq\n\\& :put! =\\*(Aq\\*(Aq\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :put\\fR\n.SS \"12.16. How do I insert the name of the current file into the current buffer?\"\n.IX Subsection \"12.16. How do I insert the name of the current file into the current buffer?\"\nThere are several ways to insert the name of the current file into the\ncurrent buffer. In insert mode, you can use the <C\\-R>% or the\n<C\\-R>=expand(\"%\") command. In normal mode, you can use the `:put =@%`\ncommand.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-R\\fR\n.PP\n\\&\\fB:help expand()\\fR\n.PP\n\\&\\fB:help !!\\fR\n.SS \"12.17. How do I insert the contents of a Vim register into the current buffer?\"\n.IX Subsection \"12.17. How do I insert the contents of a Vim register into the current buffer?\"\nIn insert mode, you can use the <CTRL\\-R><register> command to insert the\ncontents of <register>. For example, use <CTRL\\-R>a to insert the contents\nof register \"a\" into the current buffer.\n.PP\nIn normal mode, you can use the `:put <register>` command to insert the\ncontents of <register>. For example, use the `:put d` command to insert\nthe contents of register \"d\" into the current buffer.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-R\\fR\n.PP\n\\&\\fB:help i_CTRL\\-R_CTRL\\-R\\fR\n.PP\n\\&\\fB:help i_CTRL\\-R_CTRL\\-O\\fR\n.PP\n\\&\\fB:help i_CTRL\\-R_CTRL\\-P\\fR\n.PP\n\\&\\fB:help :put\\fR\n.SS \"12.18. How do I move the cursor past the end of line and insert some characters at some columns after the end of the line?\"\n.IX Subsection \"12.18. How do I move the cursor past the end of line and insert some characters at some columns after the end of the line?\"\nYou can set the 'virtualedit' option to move the cursor past the\nend-of-line and insert characters in a column after the end-of-line. To\nstart the virtual mode, use\n.PP\n.Vb 1\n\\& :set virtualedit=all\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'virtualedit'\\fR\n.SS \"12.19. How to replace the word under the cursor (say: junk) with \"\"foojunkbar\"\" in Vim?\"\n.IX Subsection \"12.19. How to replace the word under the cursor (say: junk) with \"\"foojunkbar\"\" in Vim?\"\nThere are several ways to do this. If the word is the first such word on\nthe line, use the following command:\n.PP\n.Vb 1\n\\& :exe \"s/\".expand(\"<cword>\").\"/foo&bar/\"\n.Ve\n.PP\nTo match specifically you could use a more complex substitution like this:\n.PP\n.Vb 1\n\\& :exe \\*(Aqs/\\e<\\*(Aq.expand(\"<cword>\").\\*(Aq\\e%>\\*(Aq.(col(\".\")\\-1).\\*(Aqc\\e>/foo&bar/\\*(Aq\n.Ve\n.PP\nYou can also use the command: ciwfoo<C\\-R>\"bar<Esc>\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :substitute\\fR\n.PP\n\\&\\fB:help expand()\\fR\n.PP\n\\&\\fB:help col()\\fR\n.PP\n\\&\\fB:help /\\e%c\\fR\n.SS \"12.20. How do I replace a particular text in all the files in a directory?\"\n.IX Subsection \"12.20. How do I replace a particular text in all the files in a directory?\"\nYou can use the `:argdo` command to execute the substitute command on all\nthe files specified as arguments:\n.PP\n.Vb 2\n\\& :args *\n\\& :argdo %s/<your_text>/<replacement_text>/ge | update\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :args_f\\fR\n.PP\n\\&\\fB:help :argdo\\fR\n.PP\n\\&\\fB:help :s_flags\\fR\n.SS \"12.21. I have some numbers in a file. How do I increment or decrement the numbers in the file?\"\n.IX Subsection \"12.21. I have some numbers in a file. How do I increment or decrement the numbers in the file?\"\nYou can use the CTRL-A key to increment the number and the CTRL-X key to\ndecrement the number. You can also specify the number to\nincrement/decrement from the number by specifying a count to the key. This\nworks for decimal, octal and hexadecimal numbers. You can change the base\nused by Vim for this operation by modifying the 'nrformats' option.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 26.2\\fR\n.PP\n\\&\\fB:help CTRL-A\\fR\n.PP\n\\&\\fB:help CTRL-X\\fR\n.PP\n\\&\\fB:help 'nrformats'\\fR\n.SS \"12.22. How do I reuse the last used search pattern in a `:substitute` command?\"\n.IX Subsection \"12.22. How do I reuse the last used search pattern in a `:substitute` command?\"\nTo reuse the last used search pattern in a `:substitute` command, don't\nspecify a new search pattern:\n.PP\n.Vb 2\n\\& :s/pattern/newtext/\n\\& :s//sometext/\n.Ve\n.PP\nIn the second `:s` command, as a search pattern is not specified, the\npattern specified in the first `:s` command \"pattern\" will be used.\n.PP\nIf you want to change the search pattern but repeat the substitution\npattern you can use the special right hand side, you can use the tilde\ncharacter:\n.PP\n.Vb 1\n\\& :s/newpattern/~/\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :s\\fR\n.PP\n\\&\\fB:help :&\\fR\n.PP\n\\&\\fB:help :~\\fR\n.PP\n\\&\\fB:help &\\fR\n.PP\n\\&\\fB:help sub-replace-special\\fR\n.SS \"12.23. How do I change the case of a string using the `:substitute` command?\"\n.IX Subsection \"12.23. How do I change the case of a string using the `:substitute` command?\"\nYou can use special characters in the replacement string for a\n`:substitute` command to change the case of the matched string. For\nexample, to change the case of the string \"MyString\" to all uppercase, you\ncan use the following command:\n.PP\n.Vb 1\n\\& :%s/MyString/\\eU&/g\n.Ve\n.PP\nTo change the case to lowercase, you can use the following command:\n.PP\n.Vb 1\n\\& :%s/MyString/\\eL&/g\n.Ve\n.PP\nTo change the case of the first character in all the words in the current\nline to uppercase, you can use the following command:\n.PP\n.Vb 1\n\\& :s/\\e<\\e(.\\e)\\e(\\ek*\\e)\\e>/\\eu\\e1\\eL\\e2/g\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help sub-replace-special\\fR\n.PP\n\\&\\fB:help :substitute\\fR\n.PP\n\\&\\fB:help /\\eU\\fR\n.PP\n\\&\\fB:help /\\eL\\fR\n.PP\n\\&\\fB:help /\\eu\\fR\n.SS \"12.24. How do I enter characters that are not present in the keyboard?\"\n.IX Subsection \"12.24. How do I enter characters that are not present in the keyboard?\"\nYou can use digraphs to enter characters that are not present in the\nkeyboard. You can use the `:digraphs` command to display all the currently\ndefined digraphs. You can add a new digraph to the list using the\n`:digraphs` command.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help digraphs\\fR\n.PP\n\\&\\fB:help 'digraph'\\fR\n.PP\n\\&\\fB:help 24.9\\fR\n.SS \"12.25. Is there a command to remove any or all digraphs?\"\n.IX Subsection \"12.25. Is there a command to remove any or all digraphs?\"\nNo. The digraphs table is defined at compile time. You can only add new\nones. Adding a command to remove digraphs is on the todo list.\n.SS \"12.26. In insert mode, when I press the backspace key, it erases only the characters entered in this instance of insert mode. How do I erase previously entered characters in insert mode using the backspace key?\"\n.IX Subsection \"12.26. In insert mode, when I press the backspace key, it erases only the characters entered in this instance of insert mode. How do I erase previously entered characters in insert mode using the backspace key?\"\nThis is traditional vi behaviour. You can set the 'backspace' option to\nerase previously entered characters in insert mode:\n.PP\n.Vb 1\n\\& :set backspace=indent,eol,start\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'backspace'\\fR\n.PP\n\\&\\fB:help i_backspacing\\fR\n.SS \"12.27. I have a file which has lines longer than 72 characters terminated with \"\"+\"\" and wrapped to the next line. How can I quickly join the lines?\"\n.IX Subsection \"12.27. I have a file which has lines longer than 72 characters terminated with \"\"+\"\" and wrapped to the next line. How can I quickly join the lines?\"\nYou can use the `:global` command to search and join the lines:\n.PP\n.Vb 1\n\\& :g/+$/j\n.Ve\n.PP\nThis will, however, only join every second line. A couple of more complex\nexamples which will join all consecutive lines with a \"+\" at the end are:\n.PP\n.Vb 2\n\\& :g/+$/,/\\e(^\\e|[^+]\\e)$/j\n\\& :g/+$/mark a | .,/\\e(^\\e|[^+]\\e)$/s/+$// | \\*(Aqa,.j\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :g\\fR\n.PP\n\\&\\fB:help :j\\fR\n.PP\n\\&\\fB:help :mark\\fR\n.SS \"12.28. How do I paste characterwise yanked text into separate lines?\"\n.IX Subsection \"12.28. How do I paste characterwise yanked text into separate lines?\"\nYou can use the `:put` command to paste characterwise yanked text into new\nlines:\n.PP\n.Vb 1\n\\& :put =@\"\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :put\\fR\n.PP\n\\&\\fB:help quote_=\\fR\n.SS \"12.29. How do I change the case (uppercase, lowercase) of a word or a character or a block of text?\"\n.IX Subsection \"12.29. How do I change the case (uppercase, lowercase) of a word or a character or a block of text?\"\nYou can use the \"~\" command to switch the case of a character.\n.PP\nYou can change the case of the word under the cursor to uppercase using the\n\"gUiw\" or \"viwU\" command and to lowercase using the \"guiw\" or \"viwu\"\ncommand.\n.PP\nYou can switch the case (upper case to lower case and vice versa) of the\nword under the cursor using the \"viw~\" or \"g~iw\" command.\n.PP\nYou can use the \"gUgU\" command to change the current line to uppercase and\nthe \"gugu\" command to change the current line to lowercase.\n.PP\nYou can use the \"g~g~\" command to switch the case of the current line. You\ncan use the \"g~{motion}\" or \"{Visual}~\" commands to switch the case of a\nblock of text.\n.PP\nIf you set 'tildeop' the \"~\" command behaves like an operator and expects\na motion command to act on. If you have\n.PP\n.Vb 1\n\\& :set tildeop\n.Ve\n.PP\nand you want to change the case from the current cursor position to the end\nof line, simply use \"~$\".\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help case\\fR\n.PP\n\\&\\fB:help 'tildeop'\\fR\n.SS \"12.30. How do I enter ASCII characters that are not present in the keyboard?\"\n.IX Subsection \"12.30. How do I enter ASCII characters that are not present in the keyboard?\"\nYou can enter ASCII characters that are not present in the keyboard by\npressing CTRL-V and then the ASCII character number. You can also use\ndigraphs to enter special ASCII characters.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-V_digit\\fR\n.PP\n\\&\\fB:help digraphs\\fR\n.PP\n\\&\\fB:help 45.5\\fR\n.SS \"12.31. How do I replace non-printable characters in a file?\"\n.IX Subsection \"12.31. How do I replace non-printable characters in a file?\"\nTo replace a non-printable character, you have to first determine the ASCII\nvalue for the character. You can use the `:ascii` ex command or the \"ga\"\nnormal-mode command to display the ASCII value of the character under the\ncursor.\n.PP\nYou can enter the non-printable character by entering CTRL-V followed by\nthe decimal number 1\\-255 (with no leading zero), or by x and a hex number\n00\\-FF, or by an octal number 0\\-0377 (with leading zero), or by u and a hex\nnumber 0\\-FFFF, or by U and a hex number 0\\-7FFFFFFF\n.PP\nAnother alternative is to use the `:digraphs` ex command to display the\ndigraphs for all characters, together with their value in decimal and\nalpha. You can enter a non-printable character by entering CTRL-K followed\nby two alphanumeric characters (a digraph).\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :ascii\\fR\n.PP\n\\&\\fB:help i_CTRL\\-V\\fR\n.PP\n\\&\\fB:help i_CTRL\\-V_digit\\fR\n.PP\n\\&\\fB:help :digraphs\\fR\n.SS \"12.32. How do I remove duplicate lines from a buffer?\"\n.IX Subsection \"12.32. How do I remove duplicate lines from a buffer?\"\nYou can use the following user-defined command to remove all the duplicate\nlines from a buffer:\n.PP\n:command \\-range=% Uniq <line1>,<line2>g/^\\e%<<line2>l\\e(.*\\e)\\en\\e1$/d\n.PP\nAdd the above command to your .vimrc file and invoke `:Uniq` to remove all\nthe duplicate lines.\n.SS \"12.33. How do I prefix all the lines in a file with the corresponding line numbers?\"\n.IX Subsection \"12.33. How do I prefix all the lines in a file with the corresponding line numbers?\"\nYou can prefix the lines in a file with the corresponding line number in\nseveral ways. Some of them are listed below:\n.PP\n.Vb 4\n\\& :%s/^/\\e=line(\\*(Aq.\\*(Aq). \\*(Aq \\*(Aq\n\\& :%s/^/\\e=printf(\\*(Aq%5d \\*(Aq, line(\\*(Aq.\\*(Aq))/\n\\& :%s/^/\\e=strpart(line(\\*(Aq.\\*(Aq).\\*(Aq.     \\*(Aq, 0, 5)\n\\& :%s/^/\\e=strpart(\\*(Aq   \\*(Aq, strlen(line(\\*(Aq.\\*(Aq))).line(\\*(Aq.\\*(Aq).\\*(Aq. \\*(Aq\n.Ve\n.PP\nThe last two commands will pad the line numbers with space characters.  The\nlast command will right align the numbers and the command before that will\nleft align the numbers.\n.PP\nIf you don't want to number consecutive lines but rather non-consecutive\nregions, you can also use this idiom:\n.PP\n.Vb 2\n\\& :let i = 1\n\\& :g/TODO/s/^/\\e=printf(\\*(Aq%2d.\\*(Aq,i)|let i+=1\n.Ve\n.PP\nThis first initializes the variable i with 1. In the next line, a `:g`\ncommand is used to perform a substitute command only on lines, that\nmatch \"TODO\". After the substitute command has taken place, the variable\ni will be incremented by 1.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help sub-replace-special\\fR\n.PP\n\\&\\fB:help line()\\fR\n.PP\n\\&\\fB:help expr6\\fR\n.PP\n\\&\\fB:help strpart()\\fR\n.PP\n\\&\\fB:help printf()\\fR\n.PP\n\\&\\fB:help :execute\\fR\n.PP\n\\&\\fB:help :global\\fR\n.SS \"12.34. How do I exchange (swap) two characters or words or lines?\"\n.IX Subsection \"12.34. How do I exchange (swap) two characters or words or lines?\"\nYou can exchange two characters with the \"xp\" command sequence. The \"x\"\nwill delete the character under the cursor and \"p\" will paste the just\ndeleted character after the character under the cursor. This will result\nin exchanging the two characters.\n.PP\nYou can exchange two words with the \"deep\" command sequence (start with the\ncursor in the blank space before the first word).\n.PP\nYou can exchange two lines with the \"ddp\" command sequence. The \"dd\" will\ndelete the current line and \"p\" will paste the just deleted line after the\ncurrent line. This will result in exchanging the two lines.\n.PP\nAll of the above operations will change the \" unnamed register.\n.PP\nYou can use the `:m +` ex command to exchange two lines without changing the\nunnamed register.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help x\\fR\n.PP\n\\&\\fB:help p\\fR\n.PP\n\\&\\fB:help dd\\fR\n.PP\n\\&\\fB:help d\\fR\n.PP\n\\&\\fB:help e\\fR\n.PP\n\\&\\fB:help linewise-register\\fR\n.PP\n\\&\\fB:help quotequote\\fR\n.PP\n\\&\\fB:help :move\\fR\n.SS \"12.35. How do I change the characters used as word delimiters?\"\n.IX Subsection \"12.35. How do I change the characters used as word delimiters?\"\nVim uses the characters specified by the 'iskeyword' option as word\ndelimiters. The default setting for this option is \"@,48\\-57,_,192\\-255\".\n.PP\nFor example, to add \":\" as a word delimiter, you can use\n.PP\n.Vb 1\n\\& :set iskeyword+=:\n.Ve\n.PP\nTo remove \"_\" as a word delimiter, you can use\n.PP\n.Vb 1\n\\& :set iskeyword\\-=_\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'iskeyword'\\fR\n.PP\n\\&\\fB:help word\\fR\n.SH \"COMPLETION IN INSERT MODE\"\n.IX Header \"COMPLETION IN INSERT MODE\"\n.SS \"13.1. How do I complete words or lines in insert mode?\"\n.IX Subsection \"13.1. How do I complete words or lines in insert mode?\"\nIn insert mode, you can complete words using the CTRL-P and CTRL-N keys.\nThe CTRL-N command searches forward for the next matching keyword.\nThe CTRL-P command searches backwards for the next matching keyword.\n.PP\nIn insert mode, you can use the CTRL-X CTRL-L command sequence to complete\nlines that starts with the same characters as in the current line before\nthe cursor. To get the next matching line, press the CTRL-P or CTRL-N keys.\nThere are a lot of other keys/ways available to complete words in insert\nmode.\n.PP\nVim supports completion of the following items:\n.PP\n.Vb 11\n\\& CTRL\\-X CTRL\\-L    whole lines\n\\& CTRL\\-X CTRL\\-N    keywords in the current file\n\\& CTRL\\-X CTRL\\-K    words from a dictionary\n\\& CTRL\\-X CTRL\\-T    words from a thesaurus\n\\& CTRL\\-X CTRL\\-I    current and included files\n\\& CTRL\\-X CTRL\\-]    tags\n\\& CTRL\\-X CTRL\\-F    file names\n\\& CTRL\\-X CTRL\\-D    macro definitions (also in included files)\n\\& CTRL\\-X CTRL\\-V    Vim command line\n\\& CTRL\\-X CTRL\\-U    User defined completion\n\\& CTRL\\-X CTRL\\-O    Omni completion\n.Ve\n.PP\nUser defined completions and omni completions are often set by filetype\nplugins.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 24.3\\fR\n.PP\n\\&\\fB:help ins-completion\\fR\n.SS \"13.2. How do I complete file names in insert mode?\"\n.IX Subsection \"13.2. How do I complete file names in insert mode?\"\nIn insert mode, you can use the CTRL-X CTRL-F command sequence to complete\nfilenames that start with the same characters as in the current line before\nthe cursor.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help compl-filename\\fR\n.SS \"13.3. I am using CTRL\\-P/CTRL\\-N to complete words in insert mode. How do I complete words that occur after the just completed word?\"\n.IX Subsection \"13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do I complete words that occur after the just completed word?\"\nYou can use CTRL-X CTRL-N and CTRL-X CTRL-P keys to complete words that are\npresent after the just completed word.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-X_CTRL\\-P\\fR\n.PP\n\\&\\fB:help i_CTRL\\-X_CTRL\\-N\\fR\n.PP\n\\&\\fB:help ins-completion\\fR\n.SH \"TEXT FORMATTING\"\n.IX Header \"TEXT FORMATTING\"\n.SS \"14.1. How do I format a text paragraph so that a new line is inserted at the end of each wrapped line?\"\n.IX Subsection \"14.1. How do I format a text paragraph so that a new line is inserted at the end of each wrapped line?\"\nYou can use the \"gq\" command to format a paragraph. This will format the\ntext according to the current 'textwidth' setting. An alternative would be\nto use the \"gw\" command that formats like \"gq\" but does not move the\ncursor.\n.PP\nNote that the gq operator can be used with a motion command to operate on a\nrange of text. For example:\n.PP\n.Vb 4\n\\& gqgq \\- Format the current line\n\\& gqap \\- Format current paragraph\n\\& gwap \\- Format current paragraph (and don\\*(Aqt move cursor)\n\\& gq3j \\- Format the current and the next 3 lines\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gq\\fR\n.PP\n\\&\\fB:help gw\\fR\n.PP\n\\&\\fB:help formatting\\fR\n.PP\n\\&\\fB:help usr_25.txt\\fR\n.PP\n\\&\\fB:help motion.txt\\fR\n.SS \"14.2. How do I format long lines in a file so that each line contains less than \"\"n\"\" characters?\"\n.IX Subsection \"14.2. How do I format long lines in a file so that each line contains less than \"\"n\"\" characters?\"\nYou can set the 'textwidth' option to control the number of characters that\ncan be present in a line. For example, to set the maximum width of a line\nto 70 characters, you can use the following command:\n.PP\n.Vb 1\n\\& set textwidth=70\n.Ve\n.PP\nNow to break the long lines in a file to the length defined by the\n\\&'textwidth' option, you can use\n.PP\n.Vb 1\n\\& :g/./normal gqq\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'textwidth'\\fR\n.PP\n\\&\\fB:help gq\\fR\n.SS \"14.3. How do I join short lines to form a paragraph?\"\n.IX Subsection \"14.3. How do I join short lines to form a paragraph?\"\nFirst, make sure the 'textwidth' option is set to a high value:\n.PP\n.Vb 1\n\\& :set textwidth=99999\n.Ve\n.PP\nNext, join the short lines to form a paragraph using the command:\n.PP\n.Vb 1\n\\& 1GgqG\n.Ve\n.PP\nThe above command will operate on the entire file. To do the formatting on\nall paragraphs in a specific range, use:\n.PP\n.Vb 1\n\\& :\\*(Aqa,\\*(Aqbg/\\eS/normal gq}\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gq\\fR\n.PP\n\\&\\fB:help G\\fR\n.PP\n\\&\\fB:help gqq\\fR\n.SS \"14.4. How do I format bulleted and numbered lists?\"\n.IX Subsection \"14.4. How do I format bulleted and numbered lists?\"\nYou can configure Vim to format bulleted and numbered lists using the\n\\&'formatoptions' option. For example, you can format the list of the\nfollowing format:\n.PP\n.Vb 2\n\\&  \\- this is a test. this is a test. this is a test. this is a test.\n\\&  this is a test.\n.Ve\n.PP\ninto this format:\n.PP\n.Vb 2\n\\&  \\- this is a test. this is a test. this is a test. this is a test.\n\\& this is a test.\n.Ve\n.PP\nYou can use the \"n\" flag in the 'formatoptions' to align the text.\n.PP\n.Vb 1\n\\& :set fo+=n\n.Ve\n.PP\nWith this option, when formatting text, Vim will recognize numbered lists.\nFor this option to work, the 'autoindent' option also must be set.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'formatoptions'\\fR\n.PP\n\\&\\fB:help fo-table\\fR\n.PP\n\\&\\fB:help format-comments\\fR\n.SS \"14.5. How do I indent lines in insert mode?\"\n.IX Subsection \"14.5. How do I indent lines in insert mode?\"\nIn insert mode, you can press the CTRL-T key to insert one shiftwidth of\nindent at the start of the current line. In insert mode, you can use the\nCTRL-D key to delete on shiftwidth of indent at the start of the current\nline. You can also use the CTRL-O >> and CTRL-O << commands to indent the\ncurrent line in insert mode.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-T\\fR\n.PP\n\\&\\fB:help i_CTRL\\-D\\fR\n.PP\n\\&\\fB:help i_0_CTRL\\-D\\fR\n.PP\n\\&\\fB:help i_CTRL\\-O\\fR\n.PP\n\\&\\fB:help \\fR>>\n.PP\n\\&\\fB:help <<\\fR\n.SS \"14.6. How do I format/indent an entire file?\"\n.IX Subsection \"14.6. How do I format/indent an entire file?\"\nYou can format/indent an entire file using the gg=G command, where\n.PP\n.Vb 3\n\\& gg \\- Goto the beginning of the file\n\\& =  \\- apply indentation\n\\& G  \\- till end of file\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gg\\fR\n.PP\n\\&\\fB:help =\\fR\n.PP\n\\&\\fB:help G\\fR\n.PP\n\\&\\fB:help 'formatprg'\\fR\n.PP\n\\&\\fB:help C\\-indenting\\fR\n.SS \"14.7. How do I increase or decrease the indentation of the current line?\"\n.IX Subsection \"14.7. How do I increase or decrease the indentation of the current line?\"\nYou can use the \">>\" and \"<<\" commands to increase or decrease the\nindentation of the current line.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help shift-left-right\\fR\n.PP\n\\&\\fB:help \\fR>>\n.PP\n\\&\\fB:help <<\\fR\n.PP\n\\&\\fB:help 'shiftwidth'\\fR\n.SS \"14.8. How do I indent a block/group of lines?\"\n.IX Subsection \"14.8. How do I indent a block/group of lines?\"\nYou can visually select the group of lines and press the > or < key to\nindent/unindent the lines. You can also use the following ex-command to\nindent the lines\n.PP\n.Vb 1\n\\& :10,20>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help shift-left-right\\fR\n.PP\n\\&\\fB:help v_\\fR>\n.PP\n\\&\\fB:help v_<\\fR\n.PP\n\\&\\fB:help :<\\fR\n.PP\n\\&\\fB:help :\\fR>\n.SS \"14.9. When I indent lines using the > or < key, the standard 8\\-tabstops are used instead of the current 'tabstop' setting. Why?\"\n.IX Subsection \"14.9. When I indent lines using the > or < key, the standard 8-tabstops are used instead of the current 'tabstop' setting. Why?\"\nThe number of spaces used when lines are indented using the \">\" operator is\ncontrolled by the 'shiftwidth' option. The 'tabstop' setting is only\nused, when the 'shiftwidth' option is zero.\n.PP\n.Vb 1\n\\& :set shiftwidth=4\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'shiftwidth'\\fR\n.PP\n\\&\\fB:help \\fR>>\n.PP\n\\&\\fB:help 'softtabstop'\\fR\n.SS \"14.10. How do I turn off the automatic indentation of text?\"\n.IX Subsection \"14.10. How do I turn off the automatic indentation of text?\"\nBy default, the automatic indentation of text is not turned on. Check the\nconfiguration files (.vimrc, .gvimrc) for settings related to indentation.\nMake sure the `:filetype indent on` command is not present. If it is\npresent, remove it. Also, depending on your preference, you may also want\nto check the value of the 'autoindent', 'smartindent', 'cindent' and\n\\&'indentexpr' options and turn them off as needed.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :filetype\\-indent\\-off\\fR\n.PP\n\\&\\fB:help 'autoindent'\\fR\n.PP\n\\&\\fB:help 'smartindent'\\fR\n.PP\n\\&\\fB:help 'cindent'\\fR\n.PP\n\\&\\fB:help 'indentexpr'\\fR\n.SS \"14.11. How do I configure Vim to automatically set the 'textwidth' option to a particular value when I edit mails?\"\n.IX Subsection \"14.11. How do I configure Vim to automatically set the 'textwidth' option to a particular value when I edit mails?\"\nYou can use the \"FileType\" autocommand to set the 'textwidth' option:\n.PP\n.Vb 1\n\\& autocmd FileType mail set tw=<your_value>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :autocmd\\fR\n.PP\n\\&\\fB:help FileType\\fR\n.PP\n\\&\\fB:help usr_43.txt\\fR\n.SS \"14.12. Is there a way to make Vim auto-magically break lines?\"\n.IX Subsection \"14.12. Is there a way to make Vim auto-magically break lines?\"\nYes. Set the 'textwidth' option to the preferred length for a line. Then\nVim will auto-magically break the newly entered lines. For example:\n.PP\n.Vb 1\n\\& :set textwidth=75\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'textwidth'\\fR\n.PP\n\\&\\fB:help ins-textwidth\\fR\n.PP\n\\&\\fB:help 'formatoptions'\\fR\n.PP\n\\&\\fB:help fo-table\\fR\n.PP\n\\&\\fB:help formatting\\fR\n.SS \"14.13. I am seeing a lot of ^M symbols in my file. I tried setting the 'fileformat' option to \"\"dos\"\" and then \"\"unix\"\" and then \"\"mac\"\". None of these helped. How can I hide these symbols?\"\n.IX Subsection \"14.13. I am seeing a lot of ^M symbols in my file. I tried setting the 'fileformat' option to \"\"dos\"\" and then \"\"unix\"\" and then \"\"mac\"\". None of these helped. How can I hide these symbols?\"\nWhen a file is loaded in Vim, the format of the file is determined as\nbelow:\n.PP\n\\&\\- If all the lines end with a new line (<NL>), then the fileformat is\n  \"unix\".\n\\&\\- If all the lines end with a carriage return (<CR>) followed by a new line\n  (<NL>), then the fileformat is \"dos\".\n\\&\\- If all the lines end with carriage return (<CR>), then the fileformat is\n  \"mac\".\n.PP\nIf the file has some lines ending with <CR> and some lines ending with <CR>\nfollowed by a <NL>, then the fileformat is set to \"unix\".\n.PP\nYou can change the format of the current file, by saving it explicitly in\ndos format:\n.PP\n.Vb 1\n\\& :w ++ff=dos\n.Ve\n.PP\nTo display the format of the current file, use\n.PP\n.Vb 1\n\\& :set fileformat?\n.Ve\n.PP\nThe above behavior is also controlled by the 'fileformats' option. You can\ntry the following commands:\n.PP\n.Vb 4\n\\& :set fileformats+=unix\n\\& :e <your_file>\n\\& :set fileformat=unix\n\\& :w\n.Ve\n.PP\nTo remove the carriage return (<CR>) character at the end of all the lines\nin the current file, you can use the following command:\n.PP\n.Vb 1\n\\& :%s/\\er$//\n.Ve\n.PP\nTo force Vim to use a particular file format, when editing a file, you can\nuse the following command:\n.PP\n.Vb 1\n\\& :e ++ff=dos filename\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'fileformats'\\fR\n.PP\n\\&\\fB:help 'fileformat'\\fR\n.PP\n\\&\\fB:help file-formats\\fR\n.PP\n\\&\\fB:help DOS-format-write\\fR\n.PP\n\\&\\fB:help Unix-format-write\\fR\n.PP\n\\&\\fB:help Mac-format-write\\fR\n.PP\n\\&\\fB:help dos-file-formats\\fR\n.PP\n\\&\\fB:help 23.1\\fR\n.PP\n\\&\\fB:help ++ff\\fR\n.SS \"14.14. When I paste some text into a Vim buffer from another application, the alignment (indentation) of the new text is messed up. How do I fix this?\"\n.IX Subsection \"14.14. When I paste some text into a Vim buffer from another application, the alignment (indentation) of the new text is messed up. How do I fix this?\"\nWhen you paste text into a GUI Vim using the mouse, Vim is able to\ndetect that you are pasting text. So all the indentation related\nsettings (like autoindent, smartindent, cindent, etc.) are ignored and\nthe text is pasted literally.\n.PP\nWhen pasting text into a Vim running in a terminal (like xterm) using\nthe mouse, Vim may not be able to detect that you are pasting text. This\ndepends on several things: the capability of the terminal to pass the\nmouse events to Vim, Vim is compiled to handle mouse events and access\nthe clipboard, the DISPLAY variable is set properly, the Vim 'mouse'\noption is set correctly.\n.PP\nIf Vim is able to detect that you are pasting text using the mouse, then\nthe pasted text will be inserted literally.\n.PP\nIf Vim is not able to detect that you are pasting using the mouse, then\nit will see the pasted text as though you literally typed the text.\nAfter the first line from the pasted text is inserted, when Vim\nencounters the newline character, because of the indentation settings,\nthe next line will start indented. The spaces at the beginning of the\nsecond line in the pasted text will be inserted leading to additional\nindentation. This will be repeated for subsequent lines. So the pasted\ntext will be inserted with stair case indentation.\n.PP\nYou can fix this problem in a terminal Vim in several ways:\n.PP\n1. Build Vim with the +mouse and +xterm_clipboard compile-time options.\n   The normal or big or huge build of Vim includes these options.  Set\n   the 'mouse' option to either \"a\" or include \"i\".  When pasting text\n   using the mouse, don't press the Shift key. This will work only if\n   Vim can access the X display. For more information, read the\n   following Vim help topics:\n.PP\n\\&\\fB:help +feature\\-list\\fR\n.PP\n\\&\\fB:help 'mouse'\\fR\n.PP\n\\&\\fB:help <MiddleMouse\\fR>\n.PP\n\\&\\fB:help x11\\-selection\\fR\n.PP\n\\&\\fB:help xterm-clipboard\\fR\n.PP\n1.1 Some Linux distributions build their terminal vim packages\n without X support.  This makes no sense and leaves many users\n with the impression that Vim in terminal mode doesn't support\n some operations such as properly pasting text with a mouse.\n.PP\n.Vb 2\n\\& If your distribution includes gvim, which it almost certainly\n\\& does these days, the solutions to this include the following.\n\\&\n\\& a)  Start Vim as\n\\&\n\\&         gvim \\-v\n\\&\n\\& b)  Put this alias in your shell\\*(Aqs configuration file, e.g.\n\\&     ~/.bashrc:\n\\&\n\\&         alias vim=\\*(Aqgvim \\-v\\*(Aq\n\\&\n\\& c)  Put the following command in a file named \"vim\" and put that\n\\&     file in your ~/bin directory:\n\\&\n\\&         gvim \\-v \"$@\"\n\\&\n\\& d)  Link the distribution\\*(Aqs gvim to ~/bin/vim with the following\n\\&     command, which needs to be executed only once.\n\\&\n\\&         ln \\-s $(which gvim) ~/bin/vim\n\\&\n\\& For c) and d), make sure that ~/bin precedes /usr/bin in your\n\\& PATH.\n.Ve\n.PP\n2. Paste the text using the CTRL-R CTRL-O * command.  This will paste\n   the text literally without any automatic indentation. If you want to\n   paste the text and then fix the indentation, then you can use CTRL-R\n   CTRL-P *. These commands will work only if Vim can access the X\n   display. For more information, read the following Vim help topics:\n.PP\n\\&\\fB:help i_CTRL\\-R_CTRL\\-O\\fR\n.PP\n\\&\\fB:help i_CTRL\\-R_CTRL\\-P\\fR\n.PP\n\\&\\fB:help quotestar\\fR\n.PP\n3. Set the 'paste' option before pasting the text. This option will\n   disable the effect of all the indentation related settings. Make\n   sure to turn off this option using `:set nopaste` after pasting the\n   text. Otherwise the Vim indentation feature will not work.  Do not\n   permanently set the 'paste' option in your .vimrc file. If you are\n   going to repeat these steps often, then you can set the\n   'pastetoggle' option to a key. When you press the specified key,\n   the 'paste' option will be toggled. You can press the key once\n   before pasting the text and the press the key once after pasting\n   the text. Note that when the 'paste' option is set, all the\n   mappings and abbreviations are disabled.  For more information,\n   read the following Vim help topics:\n.PP\n\\&\\fB:help 'paste'\\fR\n.PP\n\\&\\fB:help 'pastetoggle'\\fR\n.PP\nYou can also refer to the following topics in the user manual:\n.PP\n\\&\\fB:help 04.7\\fR\n.PP\n\\&\\fB:help 09.3\\fR\n.SS \"14.15. When there is a very long wrapped line (wrap is \"\"on\"\") and a line doesn't fit entirely on the screen it is not displayed at all. There are blank lines beginning with \"\"@\"\" symbol instead of wrapped line. If I scroll the screen to fit the line the \"\"@\"\" symbols disappear and the line is displayed again. What Vim setting control this behavior?\"\n.IX Subsection \"14.15. When there is a very long wrapped line (wrap is \"\"on\"\") and a line doesn't fit entirely on the screen it is not displayed at all. There are blank lines beginning with \"\"@\"\" symbol instead of wrapped line. If I scroll the screen to fit the line the \"\"@\"\" symbols disappear and the line is displayed again. What Vim setting control this behavior?\"\nYou can set the 'display' option to \"lastline\" to display as much as\npossible of the last line in a window instead of displaying the \"@\"\nsymbols.\n.PP\n.Vb 1\n\\& :set display=lastline\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'display'\\fR\n.SS \"14.16. How do I convert all the tab characters in a file to space characters?\"\n.IX Subsection \"14.16. How do I convert all the tab characters in a file to space characters?\"\nYou can use the `:retab` command to update all the tab characters in the\ncurrent file with the current setting of 'expandtab' and 'tabstop'. For\nexample, to convert all the tabs to white spaces, use\n.PP\n.Vb 2\n\\& :set expandtab\n\\& :retab\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :retab\\fR\n.PP\n\\&\\fB:help 'expandtab'\\fR\n.PP\n\\&\\fB:help 'tabstop'\\fR\n.PP\n\\&\\fB:help 25.3\\fR\n.SS \"14.17. What Vim options can I use to edit text that will later go to a word processor?\"\n.IX Subsection \"14.17. What Vim options can I use to edit text that will later go to a word processor?\"\nYou can set the following options to edit text that will later go into a\nword processor:\n.PP\n.Vb 4\n\\& :set wrap\n\\& :set linebreak\n\\& :set textwidth=0\n\\& :set showbreak=>>>\n.Ve\n.PP\nYou can use the \"gk\" and \"gj\" commands to move one screen line up and down.\nFor more information, read:\n.PP\n\\&\\fB:help 'wrap'\\fR\n.PP\n\\&\\fB:help 'linebreak'\\fR\n.PP\n\\&\\fB:help 'textwidth'\\fR\n.PP\n\\&\\fB:help 'showbreak'\\fR\n.PP\n\\&\\fB:help gk\\fR\n.PP\n\\&\\fB:help gj\\fR\n.SS \"14.18. How do I join lines without adding or removing any space characters?\"\n.IX Subsection \"14.18. How do I join lines without adding or removing any space characters?\"\nBy default, when you join lines using the \"J\" or `:join` command, Vim will\nreplace the line break, leading white space and trailing white space with a\nsingle space character. If there are space characters at the end of a line\nor a line starts with the \")\" character, then Vim will not add a space\ncharacter.\n.PP\nTo join lines without adding or removing any space characters, you can use\nthe gJ or `:join!` commands.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gJ\\fR\n.PP\n\\&\\fB:help :join\\fR\n.PP\n\\&\\fB:help J\\fR\n.PP\n\\&\\fB:help 10.5\\fR\n.PP\n\\&\\fB:help 'joinspaces'\\fR\n.PP\n\\&\\fB:help 'cpoptions'\\fR\n.PP\n\\&\\fB:help 'formatoptions'\\fR\n.SH \"VISUAL MODE\"\n.IX Header \"VISUAL MODE\"\n.SS \"15.1. How do I do rectangular block copying?\"\n.IX Subsection \"15.1. How do I do rectangular block copying?\"\nYou can do rectangular block copying in Vim using the blockwise visual\nmode. To start blockwise visual mode use the CTRL-V key. Move the cursor\nusing any of the motion commands and then use the y operator to yank to\nvisually selected text.\n.PP\nIf CTRL-V does not work as expected, it may have been remapped to CTRL-Q by\nthe mswin.vim script which is often sourced by a vimrc on Windows machines\nto mimic some common short cuts from other programs.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 04.4\\fR\n.PP\n\\&\\fB:help blockwise-visual\\fR\n.PP\n\\&\\fB:help visual-mode\\fR\n.PP\n\\&\\fB:help Q_vi\\fR\n.SS \"15.2. How do I delete or change a column of text in a file?\"\n.IX Subsection \"15.2. How do I delete or change a column of text in a file?\"\nYou can use the Vim block-wise visual mode to select the column of text and\napply an operator (delete, change, copy, etc) on it.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help visual-block\\fR\n.PP\n\\&\\fB:help visual-operators\\fR\n.SS \"15.3. How do I apply an ex-command on a set of visually selected lines?\"\n.IX Subsection \"15.3. How do I apply an ex-command on a set of visually selected lines?\"\nWhen you select a range of lines in visual mode, the < register is set to\nthe start of the visual region and the > register is set to the end of the\nvisual region. You can use these registers to specify the range for an ex\ncommand. After visually selecting the lines, press \":\" to go to the command\nmode.  Vim will automatically insert the visual range '<,'>. You can run\nany ex-command on the visual range.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help v_:\\fR\n.PP\n\\&\\fB:help '<\\fR\n.PP\n\\&\\fB:help '\\fR>\n.SS \"15.4. How do I execute an ex command on a column of text selected in Visual block mode?\"\n.IX Subsection \"15.4. How do I execute an ex command on a column of text selected in Visual block mode?\"\nAll the ex commands operate on whole lines only. If you try to execute\nan ex command on a column of text selected in visual block mode, Vim\nwill operate on all the selected lines (instead of the selected\ncolumns). You can use the vis.vim or NrrwRgn plugin script from\nhttps://www.vim.org scripts archive to do this.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help cmdline-ranges\\fR\n.PP\n\\&\\fB:help 10.3\\fR\n.PP\n\\&\\fB:help cmdline-lines\\fR\n.SS \"15.5. How do I select the entire file in visual mode?\"\n.IX Subsection \"15.5. How do I select the entire file in visual mode?\"\nYou can select the entire file in visual mode using ggVG.\n.PP\n.Vb 3\n\\& gg \\- go to the beginning of the file.\n\\& V  \\- Start linewise visual mode\n\\& G  \\- goto the end of the file.\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gg\\fR\n.PP\n\\&\\fB:help linewise-visual\\fR\n.PP\n\\&\\fB:help G\\fR\n.SS \"15.6. When I visually select a set of lines and press the > key to indent the selected lines, the visual mode ends. How can I reselect the region for further operation?  (or) How do I re-select the last selected visual area again?\"\n.IX Subsection \"15.6. When I visually select a set of lines and press the > key to indent the selected lines, the visual mode ends. How can I reselect the region for further operation? (or) How do I re-select the last selected visual area again?\"\nYou can use the \"gv\" command to reselect the last selected visual area. You\ncan also use the marks '< and '> to jump to the beginning or the end of the\nlast selected visual area.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gv\\fR\n.PP\n\\&\\fB:help '<\\fR\n.PP\n\\&\\fB:help '\\fR>\n.SS \"15.7. How do I jump to the beginning/end of a visually selected region?\"\n.IX Subsection \"15.7. How do I jump to the beginning/end of a visually selected region?\"\nYou can use the \"o\" command to jump to the beginning/end of a visually\nselected region.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help v_o\\fR\n.SS \"15.8. When I select text with mouse and then press : to enter an ex command, the selected text is replaced with the : character. How do I execute an ex command on a text selected using the mouse similar to the text selected using the visual mode?\"\n.IX Subsection \"15.8. When I select text with mouse and then press : to enter an ex command, the selected text is replaced with the : character. How do I execute an ex command on a text selected using the mouse similar to the text selected using the visual mode?\"\nThis will happen if you have configured Vim to use select mode instead of\nVisual mode by setting the 'selectmode' option. Check the value of this\noption:\n.PP\n.Vb 1\n\\& :set selectmode?\n.Ve\n.PP\nThis mode is known as selectmode and is similar to the visual mode. This\noption is also automatically set when you use the \"behave mswin\" command.\nSelect mode looks like visual mode, but it is similar to the selection mode\nin MS-Windows.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help Select-mode\\fR\n.PP\n\\&\\fB:help 'selectmode'\\fR\n.PP\n\\&\\fB:help 09.4\\fR\n.PP\n\\&\\fB:help :behave\\fR\n.SS \"15.9. When I select a block of text using the mouse, Vim goes into selection mode instead of Visual mode. Why?\"\n.IX Subsection \"15.9. When I select a block of text using the mouse, Vim goes into selection mode instead of Visual mode. Why?\"\nThe 'selectmode' option controls whether Select mode will be started when\nselecting a block of text using the mouse. To start Visual mode when\nselecting text using mouse, remove the \"mouse\" value from the 'selectmode'\noption:\n.PP\n.Vb 1\n\\& :set selectmode\\-=mouse\n.Ve\n.PP\nNote that by default, the 'selectmode' option will be set to empty, so that\nalways visual mode is used.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'selectmode'\\fR\n.PP\n\\&\\fB:help Select-mode\\fR\n.PP\n\\&\\fB:help :behave\\fR\n.SS \"15.10. How do I visually select the last copy/pasted text?\"\n.IX Subsection \"15.10. How do I visually select the last copy/pasted text?\"\nYou can use the '[ and '] marks to visually select the last copy/pasted\ntext. The '[ mark is set to the beginning of the last changed/yanked text\nand the '] mark is set to the end of the last changed/yanked text. To\nvisually select this block of text use the command '[v']\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help '[\\fR\n.PP\n\\&\\fB:help ']\\fR\n.PP\n\\&\\fB:help `a\\fR\n.PP\n\\&\\fB:help v\\fR\n.SH \"COMMAND-LINE MODE\"\n.IX Header \"COMMAND-LINE MODE\"\n.SS \"16.1. How do I use the name of the current file in the command mode or an ex command line?\"\n.IX Subsection \"16.1. How do I use the name of the current file in the command mode or an ex command line?\"\nIn the command line, the \"%\" character represents the name of the current\nfile. In some commands, you have to use `expand(\"%\")` to get the filename:\n.PP\n.Vb 1\n\\& :!perl %\n.Ve\n.PP\nAnother example is to load the latex generated pdf file from the file you\nare currently editing:\n.PP\n.Vb 1\n\\& :!xpdf %<.pdf\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :_%\\fR\n.PP\n\\&\\fB:help cmdline-special\\fR\n.PP\n\\&\\fB:help expand()\\fR\n.SS \"16.2. How do I edit the text in the Vim command-line effectively?\"\n.IX Subsection \"16.2. How do I edit the text in the Vim command-line effectively?\"\nYou can use the command-line window for editing Vim command-line text. To\nopen the Vim command-line window use the \"q:\" command in normal mode. In\ncommand-line mode, use the CTRL-F key. In this window, the command line\nhistory will be displayed. You can use normal Vim keys/commands to edit any\nprevious/new command line. To execute a command line, press the\nenter/return key.\n.PP\nIn a similar vain, the search history can be edited with \"q/\" and \"q?\"\ncommands.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help cmdline-window\\fR\n.SS \"16.3. How do I switch from Vi mode to Ex mode?\"\n.IX Subsection \"16.3. How do I switch from Vi mode to Ex mode?\"\nYou can use the Q command to switch from Vi mode to Ex mode. To switch from\nEx mode back to the Vi mode, use the `:vi` command.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help Q\\fR\n.PP\n\\&\\fB:help gQ\\fR\n.PP\n\\&\\fB:help Ex-mode\\fR\n.PP\n\\&\\fB:help :vi\\fR\n.SS \"16.4. How do I copy the output from an ex-command into a buffer?\"\n.IX Subsection \"16.4. How do I copy the output from an ex-command into a buffer?\"\nTo copy the output from an ex-command into a buffer, you have to first get\nthe command output into a register. You can use the `:redir` command to get\nthe output into a register. For example,\n.PP\n.Vb 3\n\\& :redir @a\n\\& :g/HelloWord/p\n\\& :redir END\n.Ve\n.PP\nNow the register \"a\" will contain the output from the ex command\n`:g/HelloWord/p`. Now you can paste the contents of the register \"a\" into a\nbuffer. You can also send or append the output of an ex-command into a file\nusing the `:redir` command.\n.PP\nYou can prefix the `:global` command with `:silent`, to avoid having the\nlines printed to the screen.\n.PP\nTo redirect the output from an ex-command to a file, you can use the\nfollowing set of commands:\n.PP\n.Vb 3\n\\& :redir > myfile\n\\& :g/HelloWord/p\n\\& :redir END\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :redir\\fR\n.PP\n\\&\\fB:help :silent\\fR\n.SS \"16.5. When I press the <Tab> key to complete the name of a file in the command mode, if there are more than one matching file names, then Vim completes the first matching file name and displays a list of all matching filenames. How do I configure Vim to only display the list of all the matching filenames and not complete the first one?\"\n.IX Subsection \"16.5. When I press the <Tab> key to complete the name of a file in the command mode, if there are more than one matching file names, then Vim completes the first matching file name and displays a list of all matching filenames. How do I configure Vim to only display the list of all the matching filenames and not complete the first one?\"\nYou can modify the 'wildmode' option to configure the way Vim completes\nfilenames in the command mode. In this case, you can set the 'wildmode'\noption to \"list\":\n.PP\n.Vb 1\n\\& :set wildmode=list\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'wildmode'\\fR\n.SS \"16.6. How do I copy text from a buffer to the command line and from the command line to a buffer?\"\n.IX Subsection \"16.6. How do I copy text from a buffer to the command line and from the command line to a buffer?\"\nTo copy text from a buffer to the command line, after yanking the text from\nthe buffer, use \"<CTRL\\-R>0\" in the command line to paste the text. You can\nalso yank the text to a specific register and use CTRL-R <register> to\npaste the text to the command line.  You can use CTRL-R CTRL-W to paste the\nword under the cursor in the command line.\n.PP\nTo copy text from the command line into a buffer, you can paste the\ncontents of the : register using the \":p command. The most recently\nexecuted command line is stored in the : register.\n.PP\nAnother approach for copying and pasting text to and from the command line\nis to open the command line window using q: from normal mode or CTRL-F from\nthe command-line mode. In the command line window you can use all the Vim\ncommands to edit the command line.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help c_CTRL\\-R\\fR\n.PP\n\\&\\fB:help quote_:\\fR\n.PP\n\\&\\fB:help cmdline-window\\fR\n.SS \"16.7. How do I put a command onto the command history without executing it?\"\n.IX Subsection \"16.7. How do I put a command onto the command history without executing it?\"\nTo put a command onto the command history without executing it, press the\n<Esc> key to cancel the command.\n.PP\nAn alternative solution, is to use the \\fBhistadd()\\fR function like this:\n.PP\n.Vb 1\n\\& :call histadd(\\*(Aq:\\*(Aq, \\*(Aqecho strftime(\"%c\")\\*(Aq)\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help c_<Esc\\fR>\n.PP\n\\&\\fB:help histadd()\\fR\n.SS \"16.8. How do I increase the height of the command-line?\"\n.IX Subsection \"16.8. How do I increase the height of the command-line?\"\nYou can increase the height of the command-line by changing the 'cmdheight'\noption:\n.PP\n.Vb 1\n\\& :set cmdheight=2\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'cmdheight'\\fR\n.PP\n\\&\\fB:help hit-enter\\fR\n.PP\n\\&\\fB:help 05.7\\fR\n.SH VIMINFO\n.IX Header \"VIMINFO\"\n.SS \"17.1. When I invoke Vim, I get error messages about illegal characters in the viminfo file. What should I do to get rid of these messages?\"\n.IX Subsection \"17.1. When I invoke Vim, I get error messages about illegal characters in the viminfo file. What should I do to get rid of these messages?\"\nYou can remove the \\f(CW$HOME\\fR/.viminfo or the \\f(CW$HOME\\fR/_viminfo file to get rid of\nthese error messages.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help viminfo-errors\\fR\n.PP\n\\&\\fB:help viminfo-file-name\\fR\n.PP\n\\&\\fB:help viminfo\\fR\n.PP\n\\&\\fB:help 21.3\\fR\n.SS \"17.2. How do I disable the viminfo feature?\"\n.IX Subsection \"17.2. How do I disable the viminfo feature?\"\nBy default, the viminfo feature is disabled. If the viminfo feature is\nenabled by a system-wide vimrc file, then you can disable the viminfo\nfeature by setting the 'viminfo' option to an empty string in your local\n\\&.vimrc file:\n.PP\n.Vb 1\n\\& :set viminfo=\"\"\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'viminfo'\\fR\n.SS \"17.3. How do I save and use Vim marks/commands across Vim sessions?\"\n.IX Subsection \"17.3. How do I save and use Vim marks/commands across Vim sessions?\"\nYou can save and restore Vim marks across Vim sessions using the viminfo\nfile. To use the viminfo file, make sure the 'viminfo' option is not empty.\nTo save and restore Vim marks, the 'viminfo' option should not contain the\n\"f\" flag or should have a value greater than zero for the \"f\" option.\n.PP\nYou can also use the viminfo file to synchronize the commandline history\nacross different sessions using `:wvimfo` and `:rviminfo` commands together\nwith the FocusGained and FocusLost autocommands:\n.PP\n.Vb 5\n\\& augroup viminfo\n\\&     au!\n\\&     au FocusLost   * wviminfo\n\\&     au FocusGained * rviminfo\n\\& augroup end\n.Ve\n.PP\nNote, this will only work reliably, when Vim can detect the FocusLost\nand FocusGained autocommands correctly. This means it should work with\nGVim but might depend on your terminal for konsole vim.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 21.3\\fR\n.PP\n\\&\\fB:help viminfo\\fR\n.PP\n\\&\\fB:help 'viminfo'\\fR\n.PP\n\\&\\fB:help :wviminfo\\fR\n.PP\n\\&\\fB:help :rviminfo\\fR\n.PP\n\\&\\fB:help FocusLost\\fR\n.PP\n\\&\\fB:help FocusGained\\fR\n.SH \"REMOTE EDITING\"\n.IX Header \"REMOTE EDITING\"\n.SS \"18.1. How do I open a file with existing instance of gvim? What happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\"\n.IX Subsection \"18.1. How do I open a file with existing instance of gvim? What happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\"\nStarting with Vim6, the OLE version of OpenWithVim.exe and SendToVim.exe\nVim utilities are replaced by the new client-server feature. To open the\nfile j.txt with an existing instance of Gvim (MyVim), use:\n.PP\n.Vb 1\n\\& $ gvim \\-\\-servername MyVim \\-\\-remote\\-silent j.txt\n.Ve\n.PP\nTo list the server names of all the currently running Vim instances, use\n.PP\n.Vb 1\n\\& $ vim \\-\\-serverlist\n.Ve\n.PP\nTo get more information about client-server feature, read\n.PP\n\\&\\fB:help client-server\\fR\n.SS \"18.2. How do I send a command to a Vim server to write all buffers to disk?\"\n.IX Subsection \"18.2. How do I send a command to a Vim server to write all buffers to disk?\"\nYou can use the Vim remote server functionality to do this:\n.PP\n.Vb 1\n\\& $ gvim \\-\\-servername myVIM \\-\\-remote\\-send \"<C\\-\\e><C\\-N>:wall<CR>\"\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help client-server\\fR\n.PP\n\\&\\fB:help CTRL\\-\\e_CTRL\\-N\\fR\n.PP\n\\&\\fB:help :wall\\fR\n.SS \"18.3. Where can I get the documentation about the Vim remote server functionality?\"\n.IX Subsection \"18.3. Where can I get the documentation about the Vim remote server functionality?\"\nYou can get more information about the Vim remote server functionality by\nreading\n.PP\n\\&\\fB:help client-server\\fR\n.SH OPTIONS\n.IX Header \"OPTIONS\"\n.SS \"19.1. How do I configure Vim in a simple way?\"\n.IX Subsection \"19.1. How do I configure Vim in a simple way?\"\nYou can use the `:options` command to open the Vim option window:\n.PP\n.Vb 1\n\\& :options\n.Ve\n.PP\nThis window can be used for viewing and setting all the options.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :options\\fR\n.SS \"19.2. How do I toggle the value of an option?\"\n.IX Subsection \"19.2. How do I toggle the value of an option?\"\nYou can prefix the option with \"inv\" to toggle the value of the option:\n.PP\n.Vb 2\n\\& :set invignorecase\n\\& :set invhlsearch\n.Ve\n.PP\nYou can also suffix the option with \"!\" to toggle the value:\n.PP\n.Vb 2\n\\& :set ignorecase!\n\\& :set hlsearch!\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help set-option\\fR\n.SS \"19.3. How do I set an option that affects only the current buffer/window?\"\n.IX Subsection \"19.3. How do I set an option that affects only the current buffer/window?\"\nSome of the Vim options can have a local or global value. A local value\napplies only to a specific buffer or window. A global value applies to all\nthe buffers or windows.\n.PP\nWhen a Vim option is modified using the `:set` command, both the global and\nlocal values for the option are changed. You can use the `:setlocal`\ncommand to modify only the local value for the option and the `:setglobal`\ncommand to modify only the global value.\n.PP\nYou can use the `:setlocal` command to set an option that will affect only\nthe current file/buffer:\n.PP\n.Vb 1\n\\& :setlocal textwidth=70\n.Ve\n.PP\nNote that not all options can have a local value. You can use `:setlocal`\ncommand to set an option locally to a buffer/window only if the option is\nallowed to have a local value.\n.PP\nYou can also use the following command to set an option locally:\n.PP\n.Vb 1\n\\& :let &l:{option\\-name} = <value>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :setlocal\\fR\n.PP\n\\&\\fB:help local-options\\fR\n.SS \"19.4. How do I use space characters for a Vim option value?\"\n.IX Subsection \"19.4. How do I use space characters for a Vim option value?\"\nTo use space characters in a Vim option value, you have to escape the space\ncharacter. For example:\n.PP\n.Vb 1\n\\& :set tags=tags\\e /usr/tags\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help option-backslash\\fR\n.SS \"19.5. Can I add (embed) Vim option settings to the contents of a file?\"\n.IX Subsection \"19.5. Can I add (embed) Vim option settings to the contents of a file?\"\nYou can use modelines to add Vim option settings to the contents of a file.\nFor example, in a C file, you can add the following line to the top or the\nbottom of the file:\n.PP\n.Vb 1\n\\& /* vim:sw=4: */\n.Ve\n.PP\nThis will set the 'shiftwidth' option to 4, when editing that C file.\nFor this to work, the 'modeline' option should be set. By default, the\n\\&'modeline' option is set. An alternative example is given in this document\nin the first line.\n.PP\nThe 'modelines' settings specifies the number of\nlines that will be checked for the Vim set commands.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 21.6\\fR\n.PP\n\\&\\fB:help modeline\\fR\n.PP\n\\&\\fB:help auto-setting\\fR\n.PP\n\\&\\fB:help 'modeline'\\fR\n.PP\n\\&\\fB:help 'modelines'\\fR\n.SS \"19.6. How do I display the line numbers of all the lines in a file?\"\n.IX Subsection \"19.6. How do I display the line numbers of all the lines in a file?\"\nYou can set the 'number' option to display the line numbers for all the\nlines.\n.PP\n.Vb 1\n\\& :set number\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'number'\\fR\n.SS \"19.7. How do I change the width of the line numbers displayed using the 'number' option?\"\n.IX Subsection \"19.7. How do I change the width of the line numbers displayed using the 'number' option?\"\nYou can set the minimum number of columns to be used for line numbering by\nsetting the 'numberwidth' option:\n.PP\n.Vb 1\n\\& :set numberwidth=3\n.Ve\n.PP\nThis set's the width for the line number to 3 digits, which is enough, if\nyour buffer contains less than 999 lines. However, if your current buffer\ncontains more lines than 999, the 'numberwidth' will be adjusted accordingly,\nso that the maximum line number will fit on the screen.\n.SS \"19.8. How do I display (view) all the invisible characters like space, tabs and newlines in a file?\"\n.IX Subsection \"19.8. How do I display (view) all the invisible characters like space, tabs and newlines in a file?\"\nYou can set the 'list' option to see all the invisible characters in your\nfile.\n.PP\n.Vb 1\n\\& :set list\n.Ve\n.PP\nWith this option set, you can view space characters, tabs, newlines,\ntrailing space characters and wrapped lines.\n.PP\nTo not display the invisible characters (which is the default), you have to\nreset the 'list' option:\n.PP\n.Vb 3\n\\& :set nolist\n\\& (or)\n\\& :set list!\n.Ve\n.PP\nThe `:set list!` command will toggle the current setting of the boolean\n\\&'list' option.\n.PP\nYou can modify the 'listchars' option to configure how and which invisible\ncharacters are displayed. For example, with the following command all the\ntrailing space characters will be displayed with a \".\" character.\n.PP\n.Vb 1\n\\& :set listchars=trail:.\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'listchars'\\fR\n.PP\n\\&\\fB:help 'list'\\fR\n.SS \"19.9. How do I configure Vim to always display the current line and column number?\"\n.IX Subsection \"19.9. How do I configure Vim to always display the current line and column number?\"\nYou can set the 'ruler' option to display current column and line number in\nthe status line:\n.PP\n.Vb 1\n\\& :set ruler\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'ruler'\\fR\n.SS \"19.10. How do I display the current Vim mode?\"\n.IX Subsection \"19.10. How do I display the current Vim mode?\"\nYou can set the 'showmode' option to display the current Vim mode. In\nInsert, Replace and Visual modes, Vim will display the current mode on the\nlast line.\n.PP\n.Vb 1\n\\& :set showmode\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'showmode'\\fR\n.SS \"19.11. How do I configure Vim to show pending/partial commands on the status line?\"\n.IX Subsection \"19.11. How do I configure Vim to show pending/partial commands on the status line?\"\nYou can set the 'showcmd' option to display pending/partial commands in the\nstatus line:\n.PP\n.Vb 1\n\\& :set showcmd\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'showcmd'\\fR\n.SS \"19.12. How do I configure the Vim status line to display different settings/values?\"\n.IX Subsection \"19.12. How do I configure the Vim status line to display different settings/values?\"\nYou can set the 'statusline' option to display different values/settings in\nthe Vim status line.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'statusline'\\fR\n.PP\n\\&\\fB:help 'laststatus'\\fR\n.PP\n\\&\\fB:help 'rulerformat'\\fR\n.PP\n\\&\\fB:help 'ruler'\\fR\n.SS \"19.13. How do I configure Vim to display status line always?\"\n.IX Subsection \"19.13. How do I configure Vim to display status line always?\"\nYou can set the 'laststatus' option to 2 to display the status line always.\n.PP\n.Vb 1\n\\& :set laststatus=2\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'laststatus'\\fR\n.SS \"19.14. How do I make a Vim setting persistent across different Vim invocations/instances/sessions?\"\n.IX Subsection \"19.14. How do I make a Vim setting persistent across different Vim invocations/instances/sessions?\"\nTo make a Vim option setting persistent across different Vim instances, add\nyour setting to the .vimrc or .gvimrc file. You can also use the `:mkvimrc`\ncommand to generate a vimrc file for the current settings.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help save-settings\\fR\n.PP\n\\&\\fB:help vimrc\\fR\n.PP\n\\&\\fB:help gvimrc\\fR\n.PP\n\\&\\fB:help vimrc-intro\\fR\n.PP\n\\&\\fB:help :mkvimrc\\fR\n.PP\n\\&\\fB:help initialization\\fR\n.SS \"19.15. Why do I hear a beep (why does my window flash) about 1 second after I hit the Escape key?\"\n.IX Subsection \"19.15. Why do I hear a beep (why does my window flash) about 1 second after I hit the Escape key?\"\nThis is normal behavior. If your window flashes, then you've got the visual\nbell on. Otherwise, you should hear a beep.\n.PP\nVim needs a timeout to tell the difference between a simple escape and,\nsay, a cursor key sequence.  When you press a key in normal mode (and even\nin insert mode) and that key is the beginning of a mapping, Vim waits a\ncertain amount of time to see if the rest of the mapping sequence follows.\nIf the mapping sequence is completed before a given timeout period, the\nmapping for that sequence of keys is applied. If you interrupt the mapping,\nthe normal actions associated with the keys are executed.\n.PP\nFor example, if you have a mapping defined as `:imap vvv Vim is great!!`\nand you type \"vvv\" quickly, the \"Vim is great!!\" will be inserted into your\ntext. But if you type \"vv v\" then that is what will put into your text.\nThis is also true if you type \"vvv\" too slowly where \"too slowly\" is longer\nthan the value for the timeout option. Setting the timeout option to a\nlarger value can help alleviate problems that appear when using function\nkeys over a slow line.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'ttimeout'\\fR\n.SS \"19.16. How do I make the \"\"c\"\" and \"\"s\"\" commands display a \"\"$\"\" instead of deleting the characters I'm changing?\"\n.IX Subsection \"19.16. How do I make the \"\"c\"\" and \"\"s\"\" commands display a \"\"$\"\" instead of deleting the characters I'm changing?\"\nTo make the \"c\" and \"s\" commands display a \"$\" instead of deleting the\ncharacters, add the $ flag to the 'cpoptions' option:\n.PP\n.Vb 1\n\\& :set cpoptions+=$\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'cpoptions'\\fR\n.SS \"19.17. How do I remove more than one flag using a single `:set` command from a Vim option?\"\n.IX Subsection \"19.17. How do I remove more than one flag using a single `:set` command from a Vim option?\"\nYou can remove more than one flag from a Vim option using a single `:set`\ncommand, by specifying the flags in exactly the same order as they appear\nin the option. For example, if you use the following command to remove the\n\"t\" and \"n\" flags from the 'formatoptions' option:\n.PP\n.Vb 1\n\\& :set formatoptions\\-=tn\n.Ve\n.PP\nThe \"t\" and \"n\" flags will be removed from the 'formatoptions' option, only\nif the 'formatoptions' option contains these flags in this order: \"tn\".\nOtherwise, it will not remove the flags. To avoid this problem, you can\nremove the flags one by one:\n.PP\n.Vb 1\n\\& :set formatoptions\\-=t formatoptions\\-=n\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :set\\-=\\fR\n.SH \"MAPPING KEYS\"\n.IX Header \"MAPPING KEYS\"\n.SS \"20.1. How do I know what a key is mapped to?\"\n.IX Subsection \"20.1. How do I know what a key is mapped to?\"\nTo see what a key is mapped to, use the following commands:\n.PP\n.Vb 2\n\\& :map <key>\n\\& :map! <key>\n.Ve\n.PP\nYou can also check the mappings in a particular mode using one of the\n`:cmap`, `:nmap`, `:vmap`, `:imap`, `:omap`, etc commands.\n.PP\nTo find out, where the key has been mapped, prefix the `:verbose` command:\n.PP\n.Vb 1\n\\& :verbose :map <key>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help map-listing\\fR\n.PP\n\\&\\fB:help map-overview\\fR\n.SS \"20.2. How do I list all the user-defined key mappings?\"\n.IX Subsection \"20.2. How do I list all the user-defined key mappings?\"\nYou can list all the user-defined key mappings using:\n.PP\n.Vb 1\n\\& :map\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help map-listing\\fR\n.SS \"20.3. How do I unmap a previously mapped key?\"\n.IX Subsection \"20.3. How do I unmap a previously mapped key?\"\nYou can unmap a previously mapped key using the `:unmap` command:\n.PP\n.Vb 2\n\\& :unmap <key>\n\\& :unmap! <key>\n.Ve\n.PP\nFor mode specific mappings, you can use one of the these commands:\n.PP\n.Vb 6\n\\& :nunmap\n\\& :vunmap\n\\& :ounmap\n\\& :iunmap\n\\& :lunmap\n\\& :cunmap\n.Ve\n.PP\nThe following command will fail to unmap a buffer-local mapped key:\n.PP\n.Vb 1\n\\& :unmap <key>\n.Ve\n.PP\nTo unmap a buffer-local mapped key, you have to use the <buffer> keyword in\nthe unmap command:\n.PP\n.Vb 2\n\\& :unmap <buffer> <key>\n\\& :unmap! <buffer> <key>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :unmap\\fR\n.PP\n\\&\\fB:help map-modes\\fR\n.PP\n\\&\\fB:help :map\\-local\\fR\n.PP\n\\&\\fB:help mapleader\\fR\n.SS \"20.4. I am not able to create a mapping for the <xxx> key. What is wrong?\"\n.IX Subsection \"20.4. I am not able to create a mapping for the <xxx> key. What is wrong?\"\n1) First make sure, the key is passed correctly to Vim. To determine if\n   this is the case, put Vim in Insert mode and then hit CTRL-V (or\n   CTRL-Q if your CTRL-V is remapped to the paste operation (e.g. on\n   Windows if you are using the mswin.vim script file) followed by your\n   key.\n.PP\n.Vb 5\n\\&   If nothing appears in the buffer (and assuming that you have\n\\&   \\*(Aqshowcmd\\*(Aq on, ^V remains displayed near the bottom right of the Vim\n\\&   screen), then Vim doesn\\*(Aqt get your key correctly and there is nothing\n\\&   to be done, other than selecting a different key for your mapping or\n\\&   using GVim, which should recognise the key correctly.\n.Ve\n.PP\n2) Possibly, Vim gets your key, but sees it as no different than\n   something else. Say you want to map <Ctrl\\-Right>, then in Insert mode\n   hit CTRL-K followed by <Ctrl\\-Right>. If Vim displays <C\\-Right> it has\n   correctly seen the keystroke and you should be able to map it (by\n   using <C\\-Right> as your {lhs}). If it displays <Right> it has seen\n   the keystroke but as if you hadn't held <Ctrl> down: this means your\n   temrinal passes <Ctrl\\-Right> as if it were just <Right>. Anything else\n   means the key has been misidentified.\n.PP\n3) If the key is seen, but not as itself and not as some recognizable\n   key, then there is probably an error in the terminal library for the\n   current terminal (termcap or terminfo database). In that case\n.PP\n.Vb 1\n\\&     :set term?\n\\&\n\\&   will tell you which termcap or terminfo Vim is using. You can try to\n\\&   tell vim, what termcode to use in that terminal, by adding the\n\\&   following to your vimrc:\n\\&\n\\&     if &term == <termname>\n\\&         set <C\\-Right>=<keycode>\n\\&     endif\n\\&\n\\&   where <termname> above should be replaced by the value of \\*(Aqterm\\*(Aq\n\\&   (with quotes around it) and <keycode> by what you get when hitting\n\\&   CTRL\\-V followed by <Ctrl\\-Right> in Insert mode (with nothing around\n\\&   it). <C\\-Right> should be left as\\-is (9 characters). Don\\*(Aqt forget that\n\\&   in a \\`:set\\` command, white space is not allowed between the equal sign\n\\&   and the value, and any space, double quote, vertical bar or backslash\n\\&   present as part of the value must be backslash\\-escaped.\n\\&\n\\&   Now you should be able to see the keycode corresponding to the key\n\\&   and you can create a mapping for the key using the following command:\n\\&\n\\&     :map <C\\-Right>  <your_command_to_be_mapped>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help map-keys-fails\\fR\n.PP\n\\&\\fB:help :map\\-special\\-keys\\fR\n.PP\n\\&\\fB:help key-codes\\fR\n.SS \"20.5. Why does mapping the <C\\-...> key not work?\"\n.IX Subsection \"20.5. Why does mapping the <C-...> key not work?\"\nThe only <Ctrl>\\-<printable\\-key> chords which Vim can reliably detect\n(because they are defined in the ASCII standard) are the following:\n.PP\n.Vb 9\n\\&     CTRL\\-@                 0x00            NUL\n\\&     CTRL\\-A to CTRL\\-Z       0x01 to 0x1A\n\\&     CTRL\\-a to CTRL\\-z       0x01 to 0x1A\n\\&     CTRL\\-[                 0x1B            ESC\n\\&     CTRL\\-\\e                 0x1C\n\\&     CTRL\\-]                 0x1D\n\\&     CTRL\\-^                 0x1E\n\\&     CTRL\\-_                 0x1F\n\\&     CTRL\\-?                 0x7F            DEL\n.Ve\n.PP\nMost of these, however, already have a function in Vim (and some are\naliases of other keys: CTRL-H and <BS>, CTRL-I and <Tab>, CTRL-M and <Enter>,\nCTRL\\-[ and <Esc>, CTRL\\-? and <Del>).\n.PP\nThe \"safest\" keys to use in Vim for the {lhs} of a mapping are the F\nkeys, with or without Shift: <F2> to <F12> and <S\\-F1> to <S\\-F12>. (Some\nOSes, including mine, intercept <Ctrl\\-Fn> and <Alt\\-Fn>, which never reach an\napplication program such as vim or gvim).\n.PP\nYou can try other combinations of <Ctrl> + any key, but they may either\nnot work everywhere (e.g. the terminal might not pass that key to Vim,\nor they might have unintended side effects (e.g. mapping <C\\-I> means\nalso to map <Tab>).\n.PP\nThis is a known issue, that has been discussed and might be implemented\nin the future to enable Vim to distinguish between various keys even in\nconsole mode. (e.g.\nhttps://groups.google.com/d/msg/vim_dev/2bp9UdfZ63M/sajb9KM0pNYJ)\n.SS \"20.6. How do I map the numeric keypad keys?\"\n.IX Subsection \"20.6. How do I map the numeric keypad keys?\"\nFirst make sure that the numeric keypad keys are passed to Vim. Next, you\ncan use the following command to map the numeric keypad keys:\n.PP\n.Vb 1\n\\& :map <kSomething>  <your_command>\n.Ve\n.PP\nwhere, <kSomething> can be kHome, kEnd, kPageUp, kPageDown, kPlus, kMinus,\nkDivide, kMultiply, kEnter, etc.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help key-codes\\fR\n.PP\n\\&\\fB:help terminal-options\\fR\n.SS \"20.7. How do I create a mapping that works only in visual mode?\"\n.IX Subsection \"20.7. How do I create a mapping that works only in visual mode?\"\nYou can create mappings that work only in specific modes (normal, command,\ninsert, visual, etc). To create a mapping that works only in the visual\nmode, use the `:vmap` command:\n.PP\n.Vb 1\n\\& :vmap <F3> <your mapping here>\n.Ve\n.PP\nThis mapping will work in visual and select mode. If you want the map to\nwork only in visual mode (excluding select mode), use:\n.PP\n.Vb 1\n\\& :xmap <F3> <your mapping here>\n.Ve\n.PP\nand to have the mapping only work in select mode (but not visual mode),\nuse:\n.PP\n.Vb 1\n\\& :smap <F3> <your mapping here>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :vmap\\fR\n.PP\n\\&\\fB:help :xmap\\fR\n.PP\n\\&\\fB:help :smap\\fR\n.PP\n\\&\\fB:help map-modes\\fR\n.PP\n\\&\\fB:help 40.1\\fR\n.SS \"20.8. How do I create a mapping that works only in normal and operator pending mode (but not in visual mode)?\"\n.IX Subsection \"20.8. How do I create a mapping that works only in normal and operator pending mode (but not in visual mode)?\"\nUsing `:map` creates a mapping that works in normal, visual+select mode and\noperator pending mode. You can use `:nmap` to have the mapping only work in\nnormal mode and `:vmap` to have the mapping only be defined for visual and\nselect mode or use `:omap` to have the mapping only defined in operator\npending mode.\n.PP\nBut if you want to have a mapping defined, that works in both operator\npending mode and normal mode, but not in visual and select mode, you need\nto first define the mapping using `:map` and afterwards delete the mapping\nfor visual and select mode:\n.PP\n.Vb 2\n\\&        :map <f3> <your mapping here>\n\\&        :vunmap <f3>\n.Ve\n.SS \"20.9. In a Vim script, how do I know which keys to use for my mappings, so that the mapped key will not collide with an already used key?\"\n.IX Subsection \"20.9. In a Vim script, how do I know which keys to use for my mappings, so that the mapped key will not collide with an already used key?\"\nVim uses most of the keys in the keyboard. You can use the <leader> prefix\nin maps to define keys which will not overlap with Vim keys. For example:\n.PP\n.Vb 3\n\\& :map <leader>S <C\\-W>s\n\\& :map <leader>j <C\\-W>j\n\\& :map <leader>k <C\\-W>k\n.Ve\n.PP\nwhere by default <leader> gets substituted with a backslash (\\e), so the\nuser would enter\n.PP\n.Vb 3\n\\&     \\es\n\\&     \\ej\n\\&     \\ek\n.Ve\n.PP\nto invoke the above map commands. The user can change the mapleader\nvariable to be whatever they wanted:\n.PP\n.Vb 1\n\\& :let mapleader = \",\"\n.Ve\n.PP\nWhen writing a plugin or other script, more often than not, it is advisable\nto use `:noremap` instead of `:map` to avoid side effects from user defined\nmappings.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help <Leader\\fR>\n.PP\n\\&\\fB:help <LocalLeader\\fR>\n.PP\n\\&\\fB:help write-plugin\\fR\n.SS \"20.10. How do I map the escape key?\"\n.IX Subsection \"20.10. How do I map the escape key?\"\nYou can map the Escape key to some other key using the `:map` command. For\nexample, the following command maps the escape key to CTRL-O.\n.PP\n.Vb 1\n\\& :map <C\\-O> <Esc>\n.Ve\n.SS \"20.11. How do I map a key to perform nothing?\"\n.IX Subsection \"20.11. How do I map a key to perform nothing?\"\nYou can map a key to <Nop> to perform nothing when the key is pressed. For\nexample, with the following mappings, the <F7> key will do nothing when\npressed.\n.PP\n.Vb 2\n\\& :map <F7> <Nop>\n\\& :map! <F7> <Nop>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help <Nop\\fR>\n.PP\n\\&\\fB:help :map\\fR\n.PP\n\\&\\fB:help :map!\\fR\n.PP\n\\&\\fB:help map-modes\\fR\n.SS \"20.12. I want to use the <Tab> key to indent a block of text and <Shift\\-Tab> key to unindent a block of text. How do I map the keys to do this? This behavior is similar to textpad, visual studio, etc.\"\n.IX Subsection \"20.12. I want to use the <Tab> key to indent a block of text and <Shift-Tab> key to unindent a block of text. How do I map the keys to do this? This behavior is similar to textpad, visual studio, etc.\"\nUse the following mapping:\n.PP\n.Vb 5\n\\& :inoremap <S\\-Tab> <C\\-O><lt><lt>\n\\& :nnoremap <Tab> >>\n\\& :nnoremap <S\\-Tab> <lt><lt>\n\\& :vnoremap <Tab> >\n\\& :vnoremap <S\\-Tab> <lt>\n.Ve\n.PP\nNote, that the <S\\-Tab> mapping will work only if Vim receives the correct\nkey sequence. This is mostly the case with GUI Vim.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :inoremap\\fR\n.PP\n\\&\\fB:help :nnoremap\\fR\n.PP\n\\&\\fB:help :vnoremap\\fR\n.PP\n\\&\\fB:help <S\\-Tab\\fR>\n.PP\n\\&\\fB:help i_CTRL\\-O\\fR\n.PP\n\\&\\fB:help \\fR>>\n.PP\n\\&\\fB:help <<\\fR\n.PP\n\\&\\fB:help <lt\\fR>\n.SS \"20.13. In my mappings the special characters like <CR> are not recognized. How can I configure Vim to recognize special characters?\"\n.IX Subsection \"20.13. In my mappings the special characters like <CR> are not recognized. How can I configure Vim to recognize special characters?\"\nCheck the value of the 'cpoptions' option:\n.PP\n.Vb 1\n\\& :set cpoptions?\n.Ve\n.PP\nIf this option contains the \"<\" flag, then special characters will not be\nrecognized in mappings. Remove the \"<\" flag from 'cpoptions' option:\n.PP\n.Vb 1\n\\& :set cpo\\-=<\n.Ve\n.PP\nAlso, check the value of the 'compatible' option:\n.PP\n.Vb 1\n\\& :set compatible?\n.Ve\n.PP\nThe 'compatible' option must be reset:\n.PP\n.Vb 1\n\\& :set nocompatible\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'cpoptions'\\fR\n.PP\n\\&\\fB:help 'compatible'\\fR\n.SS \"20.14. How do I use the \"\"|\"\" to separate multiple commands in a map?\"\n.IX Subsection \"20.14. How do I use the \"\"|\"\" to separate multiple commands in a map?\"\nYou can escape the \"|\" character using backslash (\\e) to use \"|\" in a map.\n.PP\n.Vb 1\n\\& :map _l :!ls \\e| more<CR>\n.Ve\n.PP\nYou can also try the following command:\n.PP\n.Vb 1\n\\& :map _l :!ls <bar> more<CR>\n.Ve\n.PP\nThere are also other ways to do this.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help map_bar\\fR\n.SS \"20.15. If I have a mapping/abbreviation whose ending is the beginning of another mapping/abbreviation, how do I keep the first from expanding into the second one?\"\n.IX Subsection \"20.15. If I have a mapping/abbreviation whose ending is the beginning of another mapping/abbreviation, how do I keep the first from expanding into the second one?\"\nInstead of using the `:map lhs rhs` command, use the `:noremap lhs rhs`\ncommand. For abbreviations, use \"noreabbrev lhs rhs\". The \"nore\" prefix\nprevents the mapping or abbreviation from being expanded again.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :noremap\\fR\n.PP\n\\&\\fB:help :noreabbrev\\fR\n.SS \"20.16. Why does it take a second or more for Vim to process a key, sometimes when I press a key?\"\n.IX Subsection \"20.16. Why does it take a second or more for Vim to process a key, sometimes when I press a key?\"\nMake sure you have not defined a mapping for this key using the following\ncommand:\n.PP\n.Vb 1\n\\& :map <key>\n.Ve\n.PP\nIf a mapping is defined for this key and the mapped key contains more than\none character, then Vim will wait for the next character to be pressed to\ndetermine whether it is the mapped key or not. For example, if you have\nmapped \"ab\", then if you press \"a\", Vim will wait for the next key to be\npressed. If the next key is \"b\", Vim will execute the mapped sequence.\nOtherwise, Vim will proceed with the normal processing of \"a\" followed by\nthe next key. If the 'timeout' option is set (which is the default), then\nVim will timeout after waiting for the period specified with the\n\\&'timeoutlen' option (default is 1 second).\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help map-typing\\fR\n.PP\n\\&\\fB:help 'timeoutlen'\\fR\n.PP\n\\&\\fB:help 'ttimeoutlen'\\fR\n.PP\n\\&\\fB:help 'timeout'\\fR\n.PP\n\\&\\fB:help 'ttimeout'\\fR\n.PP\n\\&\\fB:help vt100\\-cursor\\-keys\\fR\n.PP\n\\&\\fB:help slow-fast-terminal\\fR\n.SS \"20.17. How do I map a key to run an external command using a visually selected text?\"\n.IX Subsection \"20.17. How do I map a key to run an external command using a visually selected text?\"\nYou can the `:vmap` command to map a key in the visual mode. In the mapped\ncommand sequence, you have to first yank the text. The yanked text is\navailable in the '\"' register. Now, you can use the contents of this\nregister to run the external command. For example, to run the external\ncommand \"perldoc\" on a visually selected text, you can use the following\nmapping:\n.PP\n.Vb 1\n\\& :vmap <F7> y:!exec \"!perldoc \\*(Aq\" . @\" . \"\\*(Aq\"<CR>\n.Ve\n.PP\nIf you want the mapping to work in the visual mode, but not with the\nhighlighted text, you can use the following command:\n.PP\n.Vb 1\n\\& :vmap <F7> :<C\\-U>!perldoc <cword><CR>\n.Ve\n.PP\nThe above mapping will use the word under the cursor instead of the\nhighlighted text. Note the use of the <C\\-U> before invoking the \"perldoc\"\nexternal command. The <C\\-U> is used to erase the range of text selected in\nthe visual mode and displayed on the command line. If the visual range is\nnot removed using <C\\-U>, then the output from the external command will\nreplace the visually selected text.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :vmap\\fR\n.PP\n\\&\\fB:help quote_quote\\fR\n.PP\n\\&\\fB:help :let\\-register\\fR\n.PP\n\\&\\fB:help c_CTRL\\-U\\fR\n.PP\n\\&\\fB:help :!cmd\\fR\n.SS \"20.18. How do I map the CTRL-I key while still retaining the functionality of the <Tab> key?\"\n.IX Subsection \"20.18. How do I map the CTRL-I key while still retaining the functionality of the <Tab> key?\"\nThe CTRL-I key and the <Tab> key produce the same keycode, so Vim cannot\ndistinguish between the CTRL-I and the <Tab> key. When you map the CTRL-I\nkey, the <Tab> key is also mapped (and vice versa). The same restriction\napplies for the CTRL\\-[ key and the <Esc> key.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help keycodes\\fR\n.SS \"20.19. How do I define a map to accept a count?\"\n.IX Subsection \"20.19. How do I define a map to accept a count?\"\nUse the @= command to use an expression. For example,\n.PP\n.Vb 1\n\\& nnoremap = @=\\*(Aq3l\\*(Aq\n.Ve\n.PP\nNow you can specify a count to the \"=\" command.\n.PP\n\\&\\fB:help complex-repeat\\fR\n.SS \"20.20. How can I make my normal mode mapping work from within Insert Mode?\"\n.IX Subsection \"20.20. How can I make my normal mode mapping work from within Insert Mode?\"\nMappings in normal mode can be executed after CTRL-O from insert mode as\nwell but if there are more commands included in the mapping {rhs}, only the\nfirst one will be executed in normal mode and the rest of {rhs} will be\nprinted literally in insert mode. One of ways to workaround this problem is\nto make {rhs} be one command, via wrapping it to the function. For example:\n.PP\n.Vb 4\n\\& function GetFontNameOfFirstChar()\n\\& normal! 0\n\\& echo getfontname()\n\\& endfunction\n\\&\n\\& :nmap <F9> :call GetFontNameOfFirstChar()<CR>\n.Ve\n.PP\nA more technical and detailed solution to this problem follows and can\nbe found at https://groups.google.com/group/vim_dev/msg/75f1f2dfc00908bb\n.PP\nNot every normal mode-mapping is automatically suitable for execution via\nCTRL-O from within insert mode; you need to explicitly design your mappings\nfor that purpose.\n.PP\nThe CTRL-O command allows execution of one normal mode command from\nwithin insert mode, then returns to insert mode. If a normal mode mapping\nconcatenates multiple normal mode commands, this breaks down in temporary\nnormal mode and literally inserts the second part of the command into the\nbuffer instead. To support execution of normal mode mappings from within\ninsert mode, these strategies can be used:\n.PP\n1) Instead of concatenating multiple normal mode commands, use one `:normal`\n mapping:\n.PP\n.Vb 1\n\\& :nnoremap <silent> zC :<C\\-U>normal! zCVzC<CR>\n.Ve\n.PP\n2) Concatenate multiple Ex commands via <Bar> on the rhs:\n.PP\n.Vb 1\n\\& :nnoremap zC :<C\\-U>call MyMap1()<Bar>call MyMap2()<CR>\n.Ve\n.PP\n3) Shadow normal mode mappings by insert mode mappings that\n re-enter normal mode, then invoke the normal mode mapping:\n.PP\n.Vb 3\n\\& :nnoremap <silent> <SID>MyMap2 :<C\\-U>call MyMap2()<CR>\n\\& :inoremap <silent> <script> <SID>MyMap2 <C\\-\\e><C\\-O><SID>MyMap2\n\\& :nnoremap <silent> <script> zC <SID>MyMap1<SID>MyMap2\n.Ve\n.PP\n4) Normal mode mappings that consist of multiple Ex command lines (and\n where Ex commands cannot be concatenated via <Bar>) replace `:<C\\-U>`\n with <SID>NM; the <SID>NM mapping enters normal mode for one ex command\n line:\n.PP\n.Vb 3\n\\& :nnoremap <silent> <SID>NM :<C\\-U>\n\\& :inoremap <silent> <SID>NM <C\\-\\e><C\\-O>:\n\\& :nnoremap <silent> <script> zC <SID>MyMap1<SID>NMcall MyMap2()<CR>\n.Ve\n.PP\n5)  If none of the above is possible, at least force normal mode for\n subsequent commands via CTRL\\-\\e CTRL-N to avoid accidental insertion\n of the remainder of the mapping.\n.PP\n.Vb 1\n\\& :nnoremap zC zC<C\\-\\e><C\\-N>VzCzz\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-O\\fR\n.PP\n\\&\\fB:help map_bar\\fR\n.PP\n\\&\\fB:help i_CTRL\\-\\e_CTRL\\-O\\fR\n.PP\n\\&\\fB:help CTRL\\-\\e_CTRL\\-N\\fR\n.SH ABBREVIATIONS\n.IX Header \"ABBREVIATIONS\"\n.SS \"21.1. How do I auto correct misspelled words?\"\n.IX Subsection \"21.1. How do I auto correct misspelled words?\"\nYou can auto correct misspelled words using abbreviations. For example, the\nfollowing abbreviation can be used to correct \"teh\" with \"the\":\n.PP\n.Vb 1\n\\& :abbreviate teh the\n.Ve\n.PP\nVim supports abbreviations in insert mode, replace mode and command-line\nmode.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 24.7\\fR\n.PP\n\\&\\fB:help abbreviations\\fR\n.PP\n\\&\\fB:help Q_ab\\fR\n.SS \"21.2. How do I create multi-line abbreviations?\"\n.IX Subsection \"21.2. How do I create multi-line abbreviations?\"\nYou can create multi-line abbreviations by embedding the \"<CR>\"\nkey code in the text:\n.PP\n.Vb 1\n\\& iabbrev #c \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-<CR>\\-\\- Date:<CR>\\-\\-<CR>\\-\\-\\-\\-\\-\\-\\-\\-\\-\n.Ve\n.PP\nWith the above abbreviation, when you type #c, it will be expanded to\nthe following text:\n.PP\n\\&\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\\&\\-\\- Date:\n\\&\\-\\-\n\\&\\-\\-\\-\\-\\-\\-\\-\\-\\-\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help abbreviations\\fR\n.SS \"21.3. When my abbreviations are expanded, an additional space character is added at the end of the expanded text. How do I avoid this character?\"\n.IX Subsection \"21.3. When my abbreviations are expanded, an additional space character is added at the end of the expanded text. How do I avoid this character?\"\nTo avoid an additional space character at the end of the expanded text, you\ncan expand the abbreviation by pressing the CTRL\\-] key.  The abbreviation\nwill be expanded without adding a space character at the end.\n.PP\nAnother alternative is to use the following function and command:\n.PP\n.Vb 5\n\\& function! Eatchar(pat)\n\\&     let c = nr2char(getchar())\n\\&     return (c =~ a:pat) ? \\*(Aq\\*(Aq : c\n\\& endfunction\n\\& command! \\-nargs=+ Iabbr execute \"iabbr\" <q\\-args> . \"<C\\-R>=Eatchar(\\*(Aq\\e\\es\\*(Aq)<CR>\"\n.Ve\n.PP\nNow, define your abbreviations using the new \"Iabbr\" command instead of the\nbuiltin `:iabbrev` command. With this command, after expanding the\nabbreviated text, the next typed space character will be discarded.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help abbreviations\\fR\n.SS \"21.4. How do I insert the current date/time stamp into the file?\"\n.IX Subsection \"21.4. How do I insert the current date/time stamp into the file?\"\nYou can use the \\fBstrftime()\\fR function to insert the current data/time stamp\nin a file. For example, you can use the following abbreviation:\n.PP\n.Vb 1\n\\& iabbrev dts <C\\-R>=strftime(\"%y/%m/%d %H:%M\")<CR>\n.Ve\n.PP\nWith this abbreviation, when you type dts in insert mode, it will be\nexpanded to the date/time stamp.\n.PP\nSome other forms of the above abbreviation are listed below:\n.PP\n.Vb 5\n\\& iabbrev mdyl <C\\-R>=strftime(\"%a %d %b %Y\")<CR>\n\\& iabbrev mdys <C\\-R>=strftime(\"%y%m%d\")<CR>\n\\& iabbrev mdyc <C\\-R>=strftime(\"%c\")<CR>\n\\& iabbrev hml  <C\\-R>=strftime(\"%d/%m/%y %H:%M:%S\")<CR>\n\\& iabbrev hms  <C\\-R>=strftime(\"%H:%M:%S\")<CR>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help strftime()\\fR\n.PP\n\\&\\fB:help i_CTRL\\-R\\fR\n.SS \"21.5. How do I prevent an abbreviation from expanding in insert mode?\"\n.IX Subsection \"21.5. How do I prevent an abbreviation from expanding in insert mode?\"\nYou can prevent an abbreviation from expanding in insert mode by typing\nCTRL-V before the character after the abbreviated word.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help abbreviations\\fR\n.SH \"RECORD AND PLAYBACK\"\n.IX Header \"RECORD AND PLAYBACK\"\n.SS \"22.1. How do I repeat an editing operation (insertion, deletion, paste, etc)?\"\n.IX Subsection \"22.1. How do I repeat an editing operation (insertion, deletion, paste, etc)?\"\nYou can repeat the last editing operation using the \".\" command. This will\nrepeat the last simple change like a insert, delete, change, paste, etc.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 04.3\\fR\n.PP\n\\&\\fB:help single-repeat\\fR\n.PP\n\\&\\fB:help Q_re\\fR\n.SS \"22.2. How I record and repeat a set of key sequences?\"\n.IX Subsection \"22.2. How I record and repeat a set of key sequences?\"\nYou can use the \"q\" command in normal mode to record a set of key sequences\nand store it in a register. For example, in the normal mode you can press q\nfollowed by a register name {0\\-9a\\-bA\\-Z\"} to start the recording.  To\nend/stop the recording press q again. You can playback/repeat the recorded\nkey sequences by pressing @ followed by the register name. e.g. \\f(CW@a\\fR.\n.PP\nAnother approach is to start Vim with the \"\\-w\" command-line argument.\n.PP\n.Vb 1\n\\& $ vim \\-w <file_name>\n.Ve\n.PP\nVim will record all the characters typed in the session in the\nspecified file \"file_name\". You can use the recorded file with the \"\\-s\"\ncommand line argument to play it back:\n.PP\n.Vb 1\n\\& $ vim \\-s <file_name>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 10.1\\fR\n.PP\n\\&\\fB:help recording\\fR\n.PP\n\\&\\fB:help \\-w\\fR\n.PP\n\\&\\fB:help \\-s\\fR\n.SS \"22.3. How do I edit/modify a recorded set of key sequences?\"\n.IX Subsection \"22.3. How do I edit/modify a recorded set of key sequences?\"\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer, edit the pasted text and again\nyank the text into the register. You can also use the `:let` command to\nmodify the register. For example:\n.PP\n.Vb 1\n\\& :let @a = \"iHello World\\e<Esc>\"\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help recording\\fR\n.PP\n\\&\\fB:help 10.1\\fR\n.PP\n\\&\\fB:help :let\\-register\\fR\n.PP\n\\&\\fB:help <\\fR>\n.PP\n\\&\\fB:help 'cpoptions'\\fR\n.SS \"22.4. How do I write recorded key sequences to a file?\"\n.IX Subsection \"22.4. How do I write recorded key sequences to a file?\"\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer. Now you can save the buffer\ninto a file. You can also modify the pasted text and again yank into the\nregister to modify the recorded key sequence. For example, if you record a\nset of key sequences using qa ..... q. The recorded key sequences are\nstored in the register \"a\". You can paste the contents of register \"a\"\nusing \"ap.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help recording\\fR\n.PP\n\\&\\fB:help 10.1\\fR\n.SS \"22.5. I am using register 0 to record my key sequences (i.e. q0 .... q). In the recorded key sequences, I am yanking some text. After the first replay of the recorded key sequence, I am no longer able to play it back.\"\n.IX Subsection \"22.5. I am using register 0 to record my key sequences (i.e. q0 .... q). In the recorded key sequences, I am yanking some text. After the first replay of the recorded key sequence, I am no longer able to play it back.\"\nRegister 0 contains the text from the last yank operation. In your recorded\nkey sequence, when the yank is performed, register 0 is overwritten with\nthe yanked text. So your recording stored in register 0 is lost. You have\nto use some other register.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help registers\\fR\n.SH AUTOCOMMANDS\n.IX Header \"AUTOCOMMANDS\"\n.SS \"23.1. How do I execute a command when I try to modify a read-only file?\"\n.IX Subsection \"23.1. How do I execute a command when I try to modify a read-only file?\"\nYou can use the FileChangedRO autocommand event to execute a command when a\nread-only file is modified. For example, you can use this event to checkout a\nread-only file:\n.PP\n.Vb 1\n\\& :autocmd FileChangedRO * call MyCheckoutFunction()\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help FileChangedRO\\fR\n.SS \"23.2. How do I execute a command every time when entering a buffer?\"\n.IX Subsection \"23.2. How do I execute a command every time when entering a buffer?\"\nYou can use the BufEnter autocommand event to execute a command every time\nwhen entering a buffer. For example:\n.PP\n.Vb 1\n\\& :autocmd BufEnter *.c set formatoptions=croqt\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help BufEnter\\fR\n.SS \"23.3. How do I execute a command every time when entering a window?\"\n.IX Subsection \"23.3. How do I execute a command every time when entering a window?\"\nYou can use the WinEnter autocommand event to execute a command every time\nwhen entering a window. For example:\n.PP\n.Vb 1\n\\& :autocmd WinEnter *.c call MyFunction()\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help WinEnter\\fR\n.SS \"23.4. From an autocmd, how can I determine the name of the file or the buffer number for which the autocommand is executed?\"\n.IX Subsection \"23.4. From an autocmd, how can I determine the name of the file or the buffer number for which the autocommand is executed?\"\nYou can use the special words <afile> or <abuf> in an autocmd to get the\nname of the file or the buffer number for which the autocommand is\nexecuted.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :<afile\\fR>\n.PP\n\\&\\fB:help :<abuf\\fR>\n.PP\n\\&\\fB:help :<amatch\\fR>\n.SS \"23.5. How do I automatically save all the changed buffers whenever Vim loses focus?\"\n.IX Subsection \"23.5. How do I automatically save all the changed buffers whenever Vim loses focus?\"\nYou can define an autocommand for the FocusLost event which will save all\nthe modified buffers whenever Vim loses focus:\n.PP\n.Vb 1\n\\& :autocmd FocusLost * wall\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help FocusLost\\fR\n.PP\n\\&\\fB:help :wall\\fR\n.SS \"23.6. How do I execute/run a function when Vim exits to do some cleanup?\"\n.IX Subsection \"23.6. How do I execute/run a function when Vim exits to do some cleanup?\"\nYou can use VimLeave autocmd event to execute a function just before Vim\nexits. For example,\n.PP\n.Vb 1\n\\& :autocmd VimLeave * call MyCleanupFunction()\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help VimLeave\\fR\n.SH \"SYNTAX HIGHLIGHT\"\n.IX Header \"SYNTAX HIGHLIGHT\"\n.SS \"24.1. How do I turn off/on syntax highlighting?\"\n.IX Subsection \"24.1. How do I turn off/on syntax highlighting?\"\nBy default, the Vim syntax highlighting is turned off. To enable the syntax\nhighlighting, you can use one of the following commands:\n.PP\n.Vb 1\n\\& :syntax enable\n\\&\n\\& or\n\\&\n\\& :syntax on\n.Ve\n.PP\nTo disable the syntax highlighting, you can use the following command:\n.PP\n.Vb 1\n\\& :syntax off\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 06.1\\fR\n.PP\n\\&\\fB:help 06.4\\fR\n.PP\n\\&\\fB:help :syntax\\-enable\\fR\n.PP\n\\&\\fB:help :syntax\\-on\\fR\n.PP\n\\&\\fB:help :syn\\-clear\\fR\n.SS \"24.2. How do I change the background and foreground colors used by Vim?\"\n.IX Subsection \"24.2. How do I change the background and foreground colors used by Vim?\"\nVim uses the \"Normal\" highlight group for the background and foreground\ncolors. To change the foreground/background colors, you have to modify the\n\"Normal\" highlight group. For example, to set the background color to blue\nand foreground color to white, you can use\n.PP\n.Vb 1\n\\& :highlight Normal ctermbg=blue ctermfg=white guibg=blue guifg=white\n.Ve\n.PP\nIf you are using the Motif or the Athena version of the GUI Vim, then you\ncan modify the foreground and background resource names in the .Xdefaults\nfiles to change the colors:\n.PP\n.Vb 2\n\\& Vim.foreground:     Black\n\\& Vim.background:     Wheat\n.Ve\n.PP\nYou can also use the \"\\-foreground\" and \"\\-background\" command-line arguments\nto specify the foreground and background colors. These arguments are\nsupported only in the Motif or Athena versions:\n.PP\n.Vb 1\n\\& $ gvim \\-foreground Black \\-background Wheat\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :highlight\\fR\n.PP\n\\&\\fB:help .Xdefaults\\fR\n.PP\n\\&\\fB:help \\-gui\\fR\n.SS \"24.3. How do I change the highlight colors to suit a dark/light background?\"\n.IX Subsection \"24.3. How do I change the highlight colors to suit a dark/light background?\"\nYou can set the 'background' option to either \"dark\" or \"light\" to change\nthe highlight colors to suit a dark/light background:\n.PP\n.Vb 1\n\\& :set background=dark\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'background'\\fR\n.PP\n\\&\\fB:help 06.2\\fR\n.SS \"24.4. How do I change the color of the line numbers displayed when the `:set number` command is used?\"\n.IX Subsection \"24.4. How do I change the color of the line numbers displayed when the `:set number` command is used?\"\nThe line numbers displayed use the LineNr highlighting group. To display\nthe current colors used, use\n.PP\n.Vb 1\n\\& :hi LineNr\n.Ve\n.PP\nTo change the color modify the LineNr highlight group. For example:\n.PP\n.Vb 1\n\\& :hi linenr guifg=red guibg=black\n.Ve\n.PP\nThis will give red numbers on a black background in GVIM.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :highlight\\fR\n.SS \"24.5. How do I change the background color used for a Visually selected block?\"\n.IX Subsection \"24.5. How do I change the background color used for a Visually selected block?\"\nYou can modify the \"Visual\" highlight group to change the color used for a\nvisually selected block:\n.PP\n.Vb 1\n\\& :highlight Visual guibg=red\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :highlight\\fR\n.PP\n\\&\\fB:help hl-Visual\\fR\n.SS \"24.6. How do I highlight the special characters (tabs, trailing spaces, end of line, etc) displayed by the 'list' option?\"\n.IX Subsection \"24.6. How do I highlight the special characters (tabs, trailing spaces, end of line, etc) displayed by the 'list' option?\"\nYou can modify the \"NonText\" and \"SpecialKey\" highlight groups to highlight\nthe special characters displayed by the 'list' option:\n.PP\n.Vb 2\n\\& :highlight NonText guibg=red\n\\& :highlight SpecialKey guibg=green\n.Ve\n.PP\nThe \"NonText\" highlighting group is used for \"eol\", \"extends\" and\n\"precedes\" settings in the 'listchars' option.  The \"SpecialKey\"\nhighlighting group is used for the \"tab\" and \"trail\" settings.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'listchars'\\fR\n.PP\n\\&\\fB:help hl-NonText\\fR\n.PP\n\\&\\fB:help hl-SpecialKey\\fR\n.SS \"24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that Vim uses the specified colorscheme every time?\"\n.IX Subsection \"24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that Vim uses the specified colorscheme every time?\"\nYou can specify the color scheme using the `:colorscheme` command in your\n\\&.vimrc or .gvimrc file:\n.PP\n.Vb 1\n\\& colorscheme evening\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :colorscheme\\fR\n.SS \"24.8. Vim syntax highlighting is broken. When I am editing a file, some parts of the file is not syntax highlighted or syntax highlighted incorrectly.\"\n.IX Subsection \"24.8. Vim syntax highlighting is broken. When I am editing a file, some parts of the file is not syntax highlighted or syntax highlighted incorrectly.\"\nVim doesn't read the whole file to parse the text for syntax highlighting.\nIt starts parsing wherever you are viewing the file. That saves a lot of\ntime, but sometimes the colors are wrong. A simple fix is refreshing the\nscreen using the CTRL-L key. Or scroll back a bit and then forward again.\nYou can also use the command:\n.PP\n.Vb 1\n\\& :syntax sync fromstart\n.Ve\n.PP\nNote that this might considerably slow down the screen refreshing.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :syn\\-sync\\fR\n.PP\n\\&\\fB:help :syn\\-sync\\-first\\fR\n.SS \"24.9. Is there a built-in function to syntax-highlight the corresponding matching bracket?\"\n.IX Subsection \"24.9. Is there a built-in function to syntax-highlight the corresponding matching bracket?\"\nYes. Vim includes the matchparen Plugin as standard plugin that is enabled\nby default. Whenever the cursor moves over an item defined with the\n\\&'matchpairs' option, Vim will highlight the corresponding bracket using the\nMatchParen highlighting group.\n.PP\nHowever, if the corresponding parenthesis is not visible in the current\nwindow, the cursor won't jump to it.\n.PP\nThe matchit plugin provides a similar function, that lets the cursor\njump to related items (e.g. \"if\", \"else\", \"endif\" items) and skips\nmatches in comments. This uses the % command to jump to corresponding\nitems. Though both plugins provide similar functions they are unrelated\nand work differently.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help matchparen\\fR\n.PP\n\\&\\fB:help 'matchpairs'\\fR\n.PP\n\\&\\fB:help matchit-install\\fR\n.PP\n\\&\\fB:help matchit-intro\\fR\n.SS \"24.10. How do I turn off the C comment syntax highlighting?\"\n.IX Subsection \"24.10. How do I turn off the C comment syntax highlighting?\"\nYou can use the following command to turn off C comment syntax\nhighlighting:\n.PP\n.Vb 1\n\\& :highlight clear comment\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help ft-c-syntax\\fR\n.SS \"24.11. How do I add my own syntax extensions to the standard syntax files supplied with Vim?\"\n.IX Subsection \"24.11. How do I add my own syntax extensions to the standard syntax files supplied with Vim?\"\nYou should not modify the syntax files supplied with Vim to add your\nextensions. When you install the next version of Vim, you will lose your\nchanges. Instead you should create a file under the ~/.vim/after/syntax\ndirectory with the same name as the original syntax file and add your\nadditions to this file.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help mysyntaxfile-add\\fR\n.PP\n\\&\\fB:help 'runtimepath'\\fR\n.SS \"24.12. How do I replace a standard syntax file that comes with the Vim distribution with my own syntax file?\"\n.IX Subsection \"24.12. How do I replace a standard syntax file that comes with the Vim distribution with my own syntax file?\"\nYou can replace a standard syntax file that comes with the Vim distribution\nby creating a file with the same name as the original syntax file and\nplacing it in the vim runtime syntax (~/.vim/syntax) directory. For\nexample, to replace the c.vim syntax file in a Unix system, place the new\nc.vim in the ~/.vim/syntax directory. In a MS-Windows system, place the new\nsyntax file in the \\f(CW$HOME\\fR/vimfiles/syntax or \\f(CW$VIM\\fR/vimfiles/syntax directory.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help mysyntaxfile-replace\\fR\n.PP\n\\&\\fB:help 44.11\\fR\n.PP\n\\&\\fB:help mysyntaxfile\\fR\n.SS \"24.13. How do I highlight all the characters after a particular column?\"\n.IX Subsection \"24.13. How do I highlight all the characters after a particular column?\"\nYou can use the `:match` command to highlight all the characters after a\nparticular column:\n.PP\n.Vb 1\n\\& :match Todo \\*(Aq\\e%>75v.\\e+\\*(Aq\n.Ve\n.PP\nThis will highlight all the characters after the 75th column.\n.PP\nYou can also set the 'colorcolumn' option to highlight a particular\ncolumn:\n.PP\n.Vb 1\n\\&   :set colorcolumn=+2\n.Ve\n.PP\nwhich highlights 2 columns after the current 'textwidth' setting\n(alternatively, you can use the exact column number).\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :match\\fR\n.PP\n\\&\\fB:help /\\e%v\\fR\n.PP\n\\&\\fB:help /\\e+\\fR\n.PP\n\\&\\fB:help /.\\fR\n.PP\n\\&\\fB:help 'colorcolumn'\\fR\n.SS \"24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax highlighting into a HTML file?\"\n.IX Subsection \"24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax highlighting into a HTML file?\"\nYou can use the 2html.vim script to convert a source file into a HTML file\nwith the Vim syntax highlighting. Use the following command:\n.PP\n.Vb 1\n\\& :TOhtml\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help convert-to-HTML\\fR\n.PP\n\\&\\fB:help :TOhtml\\fR\n.SS \"24.15. How do I list the definition of all the current highlight groups?\"\n.IX Subsection \"24.15. How do I list the definition of all the current highlight groups?\"\nYou can list the definition of all the current highlight groups using the\n`:highlight` (without any arguments) ex command.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :highlight\\fR\n.SS \"24.16. How can I embed one syntax highlighting language into another one?\"\n.IX Subsection \"24.16. How can I embed one syntax highlighting language into another one?\"\nIt is possible to include one syntax highlighting into another one,\nhowever most of the currently deployed syntax highlighting scripts are\nnot prepared to be included into another syntax script.\n.PP\nYou can however create your own custom script to define your own\nregions, which will be highlighted with a different language.\n.PP\nSee the wiki for a comprehensive solution:\n.PP\n.Vb 1\n\\& http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :syn\\-include\\fR\n.PP\n\\&\\fB:help sh-awk\\fR\n.SH \"VIM SCRIPT WRITING\"\n.IX Header \"VIM SCRIPT WRITING\"\n.SS \"25.1. How do I list the names of all the scripts sourced by Vim?\"\n.IX Subsection \"25.1. How do I list the names of all the scripts sourced by Vim?\"\nYou can use the `:scriptnames` command to list the names of all the scripts\nsourced by Vim:\n.PP\n.Vb 1\n\\& :scriptnames\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :scriptnames\\fR\n.SS \"25.2. How do I debug Vim scripts?\"\n.IX Subsection \"25.2. How do I debug Vim scripts?\"\nVim has built-in support for a primitive debugger to debug Vim plugins and\nscripts. Using this debugger you can set breakpoints and step through the\nplugin functions.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help debug-scripts\\fR\n.PP\n\\&\\fB:help \\-D\\fR\n.SS \"25.3. How do I locate the script/plugin which sets a Vim option?\"\n.IX Subsection \"25.3. How do I locate the script/plugin which sets a Vim option?\"\nYou can use the `:verbose` command to locate the plugin/script which last\nmodified a Vim option. For example:\n.PP\n.Vb 1\n\\& :verbose set textwidth?\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :set\\-verbose\\fR\n.PP\n\\&\\fB:help :verbose\\fR\n.SS \"25.4. I am getting some error/informational messages from Vim (possibly when running a script), the messages are cleared immediately. How do I display the messages again?\"\n.IX Subsection \"25.4. I am getting some error/informational messages from Vim (possibly when running a script), the messages are cleared immediately. How do I display the messages again?\"\nYou can use the `:messages` command to display the previous messages.\n.PP\n.Vb 1\n\\& :messages\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :messages\\fR\n.PP\n\\&\\fB:help :echoerr\\fR\n.PP\n\\&\\fB:help :echomsg\\fR\n.PP\n\\&\\fB:help message-history\\fR\n.SS \"25.5. How do I save and restore a plugin specific information across Vim invocations?\"\n.IX Subsection \"25.5. How do I save and restore a plugin specific information across Vim invocations?\"\nVim will save and restore global variables that start with an uppercase\nletter and don't contain a lower case letter. For this to work, the\n\\&'viminfo' option must contain the \"!\" flag. Vim will store the variables in\nthe viminfo file.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'viminfo'\\fR\n.PP\n\\&\\fB:help viminfo-file\\fR\n.PP\n\\&\\fB:help variables\\fR\n.SS \"25.6. How do I start insert mode from a Vim function?\"\n.IX Subsection \"25.6. How do I start insert mode from a Vim function?\"\nYou can use the `:startinsert` command to start the insert mode from inside\na Vim function.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :startinsert\\fR\n.SS \"25.7. How do I change the cursor position from within a Vim function?\"\n.IX Subsection \"25.7. How do I change the cursor position from within a Vim function?\"\nYou can use the \\fBcursor()\\fR function to position the cursor.\n.PP\n.Vb 1\n\\&     call cursor(lnum, col)\n.Ve\n.PP\nAlternatively, use the \\fBsetpos()\\fR function:\n.PP\n.Vb 1\n\\&     call setpos(\\*(Aq.\\*(Aq, [bufnum, lnum, col, off])\n.Ve\n.PP\nwhich set's the cursor in the buffer bufnum to line lnum, column col and\noffset for 'virtualedit'. You can use the \\fBgetpos()\\fR function, to return a\nlist with these values, that can then be fed back to the \\fBsetpos()\\fR function.\n.PP\nIf you want to save and restore the viewpoint on a window, use the\n\\&\\fBwinsaveview()\\fR and \\fBwinrestview()\\fR function calls.\n.PP\nYou can also use the following command to change the cursor position:\n.PP\n.Vb 1\n\\&     exe \"normal! \" . lnum . \"G\" . col . \"|\"\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help cursor()\\fR\n.PP\n\\&\\fB:help bar\\fR\n.PP\n\\&\\fB:help getpos()\\fR\n.PP\n\\&\\fB:help setpos()\\fR\n.PP\n\\&\\fB:help winsaveview()\\fR\n.PP\n\\&\\fB:help winrestview()\\fR\n.SS \"25.8. How do I check the value of an environment variable in the .vimrc file?\"\n.IX Subsection \"25.8. How do I check the value of an environment variable in the .vimrc file?\"\nYou can use prefix the environment variable name with the \"$\" character to\nuse it from a Vim script/function.  You can refer to the value of an\nenvironment variable using the \\f(CW$env_var\\fR syntax:\n.PP\n.Vb 2\n\\& if $EDITOR == \\*(Aqvi\\*(Aq\n\\& endif\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help expr-env\\fR\n.SS \"25.9. How do I check whether an environment variable is set or not from a Vim function?\"\n.IX Subsection \"25.9. How do I check whether an environment variable is set or not from a Vim function?\"\nYou can use the \\fBexists()\\fR function to check for the existence of an\nenvironment variable.\n.PP\n.Vb 2\n\\& if exists(\"$MY_ENV_VAR\")\n\\& endif\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help exists()\\fR\n.PP\n\\&\\fB:help expr-env\\fR\n.SS \"25.10. How do I call/use the Vim built-in functions?\"\n.IX Subsection \"25.10. How do I call/use the Vim built-in functions?\"\nYou can use the `:call` command to invoke a Vim built-in function:\n.PP\n.Vb 1\n\\& :call cursor(10,20)\n.Ve\n.PP\nYou can use the `:echo` command to echo the value returned by a function:\n.PP\n.Vb 1\n\\& :echo char2nr(\\*(Aqa\\*(Aq)\n.Ve\n.PP\nYou can use the `:let` command to assign the value returned by a function\nto a variable:\n.PP\n.Vb 1\n\\& :let a = getline(\\*(Aq.\\*(Aq)\n.Ve\n.PP\nTo store the return value from a function into a Vim register, you can use\nthe following command:\n.PP\n.Vb 1\n\\& :let @a = system(\\*(Aqls\\*(Aq)\n.Ve\n.PP\nThe above command will store the output of the \"ls\" command into\nthe register \"a\".\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :call\\fR\n.PP\n\\&\\fB:help :echo\\fR\n.PP\n\\&\\fB:help :let\\fR\n.PP\n\\&\\fB:help :let\\-register\\fR\n.PP\n\\&\\fB:help user-functions\\fR\n.PP\n\\&\\fB:help usr_41.txt\\fR\n.SS \"25.11. I am using some normal mode commands in my Vim script. How do I avoid using the user-defined mappings for these normal mode commands and use the standard Vim functionality for these normal mode commands?\"\n.IX Subsection \"25.11. I am using some normal mode commands in my Vim script. How do I avoid using the user-defined mappings for these normal mode commands and use the standard Vim functionality for these normal mode commands?\"\nYou can use the `:normal!` command in your script to invoke a normal-mode\ncommand. This will use the standard functionality of the normal mode\ncommand and will not use the user-defined mapping.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :normal\\fR\n.SS \"25.12. How do I get the current visually selected text into a Vim variable or register?\"\n.IX Subsection \"25.12. How do I get the current visually selected text into a Vim variable or register?\"\nYou can get the current visually selected text into a Vim variable by\nyanking the text into Vim register and then assigning the contents of the\nregister into the variable:\n.PP\n.Vb 2\n\\& :normal! gvy\n\\& :let myvar = @\"\n.Ve\n.PP\nThe above command copies the visually selected text into the variable\n\"myvar\".\n.PP\nYou can also use the command:\n.PP\n.Vb 1\n\\& :normal! gv\"*y\n.Ve\n.PP\nIn the above command, gv reselects the last visually selected text and the\nrest of the command copies the selected text into the * (clipboard)\nregister. Alternatively, you can set the \"a\" flag in the 'guioptions'\noption to automatically copy a visually selected text into the * register.\nTo do this as part of a visual map, you can use a command similar to the\none shown below:\n.PP\n.Vb 1\n\\& :vmap <F3> \"*y:call ...\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gv\\fR\n.PP\n\\&\\fB:help :normal\\fR\n.PP\n\\&\\fB:help :let\\-@\\fR\n.PP\n\\&\\fB:help quotestar\\fR\n.PP\n\\&\\fB:help clipboard\\fR\n.PP\n\\&\\fB:help registers\\fR\n.SS \"25.13. I have some text in a Vim variable \"\"myvar\"\". I would like to use this variable in a `:s` substitute command to replace a text \"\"mytext\"\". How do I do this?\"\n.IX Subsection \"25.13. I have some text in a Vim variable \"\"myvar\"\". I would like to use this variable in a `:s` substitute command to replace a text \"\"mytext\"\". How do I do this?\"\nYou can use the `:execute` command to evaluate the variable:\n.PP\n.Vb 1\n\\& :execute \\*(Aq%s/mytext/\\*(Aq . myvar . \\*(Aq/\\*(Aq\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :execute\\fR\n.PP\nYou can also use \"\\e=\" in the substitute command to evaluate the variable:\n.PP\n.Vb 1\n\\& :%s/mytext/\\e=myvar/\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help sub-replace-special\\fR\n.SS \"25.14. A Vim variable (bno) contains a buffer number. How do I use this variable to open the corresponding buffer?\"\n.IX Subsection \"25.14. A Vim variable (bno) contains a buffer number. How do I use this variable to open the corresponding buffer?\"\nThe `:buffer` command will not accept a variable name. It accepts only a\nbuffer number or buffer name. You have to use the `:execute` command to\nevaluate the variable into the corresponding value. For example:\n.PP\n.Vb 1\n\\& :execute \"buffer \" . bno\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :execute\\fR\n.SS \"25.15. How do I store the value of a Vim option into a Vim variable?\"\n.IX Subsection \"25.15. How do I store the value of a Vim option into a Vim variable?\"\nYou can prefix the option name with the \"&\" character and assign the option\nvalue to a Vim variable using the `:let` command. For example, to store the\nvalue of the 'textwidth' option into the Vim variable \"old_tw\", you can use\nthe following command:\n.PP\n.Vb 1\n\\& :let old_tw = &tw\n.Ve\n.PP\nTo explicitly save buffer local options, use the prefix \"l:\"\n.PP\n.Vb 1\n\\& :let old_tw = &l:tw\n.Ve\n.PP\nIf you want to explicitly select the global option, use the \"g:\" prefix to\nthe option name.\n.PP\nTo do the opposite, to set the 'textwidth' option with the value stored in\nthe \"old_tw\" variable, you can use the following command:\n.PP\n.Vb 1\n\\& :let &tw = old_tw\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help expr-option\\fR\n.PP\n\\&\\fB:help :let\\-option\\fR\n.SS \"25.16. I have copied and inserted some text into a buffer from a Vim function. How do I indent the inserted text from the Vim function?\"\n.IX Subsection \"25.16. I have copied and inserted some text into a buffer from a Vim function. How do I indent the inserted text from the Vim function?\"\nYou can use the following command to format the just inserted text:\n.PP\n.Vb 1\n\\& :normal \\*(Aq[=\\*(Aq]\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help '[\\fR\n.PP\n\\&\\fB:help ']\\fR\n.PP\n\\&\\fB:help =\\fR\n.PP\n\\&\\fB:help :normal\\fR\n.SS \"25.17. How do I get the character under the cursor from a Vim script?\"\n.IX Subsection \"25.17. How do I get the character under the cursor from a Vim script?\"\nYou can use the \\fBgetline()\\fR function and use string index [] to get the\ncharacter:\n.PP\n.Vb 1\n\\& :echo getline(\".\")[col(\".\") \\- 1]\n.Ve\n.PP\nIn the above command, getline(\".\") returns  the text in the current line.\nThe indexing of the string starts at zero, and you can get a single\ncharacter in a string by its index with the \"string[index]\" notation. The\ncol(\".\") returns the column of the cursor position; the adjustment is to\nget the right character of the string. However, this does NOT work with\nmultibyte characters as this command only returns the byte index.\n.PP\nAlternatively, you can use the following sequence of commands to get the\ncharacter under the cursor:\n.PP\n.Vb 2\n\\& normal! vy\n\\& let ch=@\"\n.Ve\n.PP\nNote, that the above commands will change the '< and '> marks.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help getline()\\fR\n.PP\n\\&\\fB:help col()\\fR\n.PP\n\\&\\fB:help expr\\-[]\\fR\n.SS \"25.18. How do I get the name of the current file without the extension?\"\n.IX Subsection \"25.18. How do I get the name of the current file without the extension?\"\nYou can get the name of the current file without the extension using:\n.PP\n.Vb 1\n\\& :echo expand(\"%:r\")\n.Ve\n.PP\nWith some commands, you can use the file name modifiers directly:\n.PP\n.Vb 3\n\\& :cd %:p:h\n\\& :!gcc \\-o %:r.o %\n\\& :!xpdf %<.pdf\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help filename-modifiers\\fR\n.PP\n\\&\\fB:help expand()\\fR\n.PP\n\\&\\fB:help cmdline-special\\fR\n.PP\n\\&\\fB:help fnamemodify()\\fR\n.SS \"25.19. How do I get the basename of the current file?\"\n.IX Subsection \"25.19. How do I get the basename of the current file?\"\nYou can use the \":t\" filename modifier to get the basename of the current\nfile:\n.PP\n.Vb 1\n\\& :echo expand(\"%:t\")\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help filename-modifiers\\fR\n.SS \"25.20. How do I get the output from a Vim function into the current buffer?\"\n.IX Subsection \"25.20. How do I get the output from a Vim function into the current buffer?\"\nYou can insert the return value from a function using the following command\nin insert mode:\n.PP\n.Vb 1\n\\& <C\\-R>=MyFunc()\n.Ve\n.PP\nNote, that this will only insert the return value of the function.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-R\\fR\n.PP\n\\&\\fB:help i_CTRL\\-R_CTRL\\-R\\fR\n.PP\n\\&\\fB:help i_CTRL\\-R_CTRL\\-O\\fR\n.PP\n\\&\\fB:help expression\\fR\n.SS \"25.21. How do I call external programs from a Vim function?\"\n.IX Subsection \"25.21. How do I call external programs from a Vim function?\"\nThere are several ways to call external programs from a Vim function. You\ncan use the builtin \\fBsystem()\\fR function to invoke external programs and get\nthe result:\n.PP\n.Vb 1\n\\& :let output = system(\"ls\")\n.Ve\n.PP\nYou can also use \"!\" ex-command to run an external command.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help system()\\fR\n.PP\n\\&\\fB:help :!\\fR\n.PP\n\\&\\fB:help 10.9\\fR\n.SS \"25.22. How do I get the return status of a program executed using the `:!` command?\"\n.IX Subsection \"25.22. How do I get the return status of a program executed using the `:!` command?\"\nYou can use the predefined Vim v:shell_error variable to get the return\nstatus of the last run shell command.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help v:shell_error\\fR\n.SS \"25.23. How do I determine whether the current buffer is modified or not?\"\n.IX Subsection \"25.23. How do I determine whether the current buffer is modified or not?\"\nYou can check the value of the 'modified' option to determine whether the\ncurrent buffer is modified:\n.PP\n.Vb 1\n\\& :set modified?\n.Ve\n.PP\nFrom a Vim script, you can check the value of the 'modified' option:\n.PP\n.Vb 3\n\\& if &modified\n\\&     echo \"File is modified\"\n\\& endif\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'modified'\\fR\n.SS \"25.24. I would like to use the carriage return character in a normal command from a Vim script. How do I specify the carriage return character?\"\n.IX Subsection \"25.24. I would like to use the carriage return character in a normal command from a Vim script. How do I specify the carriage return character?\"\nYou can use the `:execute` command to specify the special (control)\ncharacter in a normal mode command:\n.PP\n.Vb 2\n\\& :execute \"normal \\e<CR>\"\n\\& :execute \"normal ixxx\\e<Esc>\"\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :execute\\fR\n.PP\n\\&\\fB:help expr-quote\\fR\n.SS \"25.25. How do I split long lines in a Vim script?\"\n.IX Subsection \"25.25. How do I split long lines in a Vim script?\"\nYou can split long lines in a Vim script by inserting the backslash\ncharacter (\"\\e\") at the start of the next line. For example,\n.PP\n.Vb 6\n\\& set comments=sr:/*,mb:*,el:*/,\n\\&             \\e://,\n\\&             \\eb:#,\n\\&             \\e:%,\n\\&             \\en:>,\n\\&             \\efb:\\-\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help line-continuation\\fR\n.SS \"25.26. When I try to \"\"execute\"\" my function using the `:execute \\fBMyfunc()\\fP` command, the cursor is moved to the top of the current buffer. Why?\"\n.IX Subsection \"25.26. When I try to \"\"execute\"\" my function using the `:execute Myfunc()` command, the cursor is moved to the top of the current buffer. Why?\"\nThe `:execute` command runs the ex command specified by the argument.\nIn the case of the following command:\n.PP\n.Vb 1\n\\& :execute Myfunc()\n.Ve\n.PP\nThe call to \\fBMyfunc()\\fR will return 0. The `:execute` command will run\nthe ex command `:0`, which moves the cursor to the top of the file.\nTo call a Vim function, you should use the `:call` command instead of the\n`:execute` command:\n.PP\n.Vb 1\n\\& :call Myfunc()\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :call\\fR\n.PP\n\\&\\fB:help :execute\\fR\n.PP\n\\&\\fB:help :echo\\fR\n.PP\n\\&\\fB:help user-functions\\fR\n.PP\n\\&\\fB:help 41.5\\fR\n.PP\n\\&\\fB:help 41.6\\fR\n.PP\n\\&\\fB:help cmdline-lines\\fR\n.SS \"25.27. How do I source/execute the contents of a register?\"\n.IX Subsection \"25.27. How do I source/execute the contents of a register?\"\nIf you have yanked a set of Vim commands into a Vim register (for example\nregister \"a\"), then you can source the contents of the register using one\nof the following commands:\n.PP\n.Vb 3\n\\& :@a\n\\&or\n\\& :exe @a\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :@\\fR\n.SS \"25.28. After calling a Vim function or a mapping, when I press the \"\"u\"\" key to undo the last change, Vim undoes all the changes made by the mapping/function. Why?\"\n.IX Subsection \"25.28. After calling a Vim function or a mapping, when I press the \"\"u\"\" key to undo the last change, Vim undoes all the changes made by the mapping/function. Why?\"\nWhen you call a function or a mapping, all the operations performed by the\nfunction/mapping are treated as one single operation. When you undo the\nlast operation by pressing \"u\", all the changes made by the\nfunction/mapping are reversed.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help undo-redo\\fR\n.PP\n\\&\\fB:help :map\\-undo\\fR\n.SS \"25.29. How can I call a function defined with s: (script local function) from another script/plugin?\"\n.IX Subsection \"25.29. How can I call a function defined with s: (script local function) from another script/plugin?\"\nThe s: prefix for a Vim function name is used to create a script local\nfunction. A script local function can be called only from within that\nscript and cannot be called from other scripts. To define a function in a\nscript/plugin, so that it can be called from other plugins/scripts, define\nthe function without the s: prefix.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help script-variable\\fR\n.PP\n\\&\\fB:help script-local\\fR\n.PP\n\\&\\fB:help :scriptnames\\fR\n.SS \"25.30. Is it possible to un-source a sourced script? In other words, reverse all the commands executed by sourcing a script.\"\n.IX Subsection \"25.30. Is it possible to un-source a sourced script? In other words, reverse all the commands executed by sourcing a script.\"\nNo. It is not possible to reverse or undo all the commands executed by\nsourcing a script.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :source\\fR\n.SH PLUGINS\n.IX Header \"PLUGINS\"\n.SS \"26.1. How do I set different options for different types of files?\"\n.IX Subsection \"26.1. How do I set different options for different types of files?\"\nYou can create filetype plugins to set different options for different\ntypes of files. You should first enable filetype plugins using the command:\n.PP\n.Vb 1\n\\& :filetype plugin on\n.Ve\n.PP\nA filetype plugin is a vim script that is loaded whenever Vim opens or\ncreates a file of that type.  For example, to ensure that the 'textwidth'\noption is set to 80 when editing a C program (filetype \"c\"), create one of\nthe following files:\n.PP\n.Vb 2\n\\&     ~/.vim/ftplugin/c.vim (Unix)\n\\&     %HOME%\\evimfiles\\eftplugin\\ec.vim (Windows)\n.Ve\n.PP\nwith the following text in it:\n.PP\n.Vb 1\n\\&     setlocal textwidth=80\n.Ve\n.PP\nYou can also use autocommands to set specific options when editing specific\ntype of files. For example, to set the 'textwidth' option to 75 for only\n*.txt files, you can use the following autocmd:\n.PP\n.Vb 1\n\\& autocmd BufRead *.txt setlocal textwidth=80\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help filetype-plugin\\fR\n.PP\n\\&\\fB:help add-filetype-plugin\\fR\n.PP\n\\&\\fB:help :autocmd\\fR\n.PP\n\\&\\fB:help 40.3\\fR\n.SS \"26.2. I have downloaded a Vim plugin or a syntax file or a indent file, or a color scheme or a filetype plugin from the web. Where should I copy these files so that Vim will find them?\"\n.IX Subsection \"26.2. I have downloaded a Vim plugin or a syntax file or a indent file, or a color scheme or a filetype plugin from the web. Where should I copy these files so that Vim will find them?\"\nYou can place the Vim runtime files (plugins, syntax files, indent files,\ncolor schemes, filetype plugins, etc) under one of the directories\nspecified in the 'runtimepath' option. To determine the current value of\nthe 'runtimepath' option, use the following command:\n.PP\n.Vb 1\n\\& :set runtimepath\n.Ve\n.PP\nFor Unix systems, this is usually the \"$HOME/.vim\" directory. For MS-Windows\nsystems, this is usually the \\f(CW$VIM\\fR\\evimfiles or \\f(CW$HOME\\fR\\evimfiles directory.\nDepending on the type of the runtime file, you have to place it under a\nspecific directory under the above runtime directory. The names of the\ndirectories are listed below:\n.PP\n.Vb 12\n\\& name        description\n\\& \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-  \\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\\-\n\\& colors/     color scheme files\n\\& compiler/   compiler files\n\\& doc/        documentation\n\\& ftplugin/   filetype plugins\n\\& indent/     indent scripts\n\\& keymap/     key mapping files\n\\& lang/       menu translations\n\\& plugin/     plugin scripts\n\\& syntax/     syntax files\n\\& tutor/      files for vimtutor\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help your-runtime-dir\\fR\n.PP\n\\&\\fB:help 'runtimepath'\\fR\n.PP\n\\&\\fB:help :runtime\\fR\n.SS \"26.3. How do I extend an existing filetype plugin?\"\n.IX Subsection \"26.3. How do I extend an existing filetype plugin?\"\nYou can extend an existing filetype plugin by creating a file in the\nafter/ directory in any of the 'runtimepath' directories.\n.PP\n\\&\\- for small changes to be done after (and in addition to) what is\n  already done by the ftplugin installed with Vim, use an after-directory,\n  as follows (replacing foobar by the 'filetype' of the concerned\n  files):\n \\- For changes private to one user:\n     \\- on Windows:\n         \\f(CW$HOME\\fR/vimfiles/after/ftplugin/foobar.vim\n     \\- on Unix-like OSes:\n         \\f(CW$HOME\\fR/.vim/after/ftplugin/foobar.vim\n \\- For changes affecting all users on the system:\n     \\f(CW$VIM\\fR/vimfiles/after/ftplugin/foobar.vim\n.PP\n\\&\\- when replacing the whole filetype-plugin by a different version, or\n  when installing a new ftplugin for some filetype not yet supported by\n  Vim out of the box: use the same paths without the after/ in them. In\n  that case you should place near the start of your plugin an \"if...\n  finish... endif... let\" block like the one in the plugins distributed\n  with Vim.\n.PP\nAll the above paths are given in Vim terminology (which is similar to\nUnix terminology, but is understood even by Vim for Windows); they don't\nexist by default, so the first time you need them you will have to\ncreate them using mkdir (on any OS including DOS/Windows) or md (on\nDOS/Windows only). \\f(CW$VIM\\fR and, on DOS/Windows, \\f(CW$HOME\\fR, do not necessarily\nexist outside Vim. If \\f(CW$HOME\\fR has no value (or no valid value) inside Vim,\nyou can use \\f(CW$VIM\\fR instead; but on any but possibly very old versions of\nWindows, \\f(CW$HOMEDRIVE\\fR and \\f(CW$HOMEPATH\\fR are defined by the system, and if\n\\&\\f(CW$HOME\\fR is undefined at Vim startup, Vim will set it by expanding\n\\&\\f(CW$HOMEDRIVE\\fR$HOMEPATH before sourcing your vimrc. To know which values Vim\nuses, you can type (in a running Vim):\n.PP\n.Vb 2\n\\& :echo $VIM\n\\& :echo $HOME\n.Ve\n.PP\nIf you placed the file in the after/ftplugin runtime directory, then Vim\nwill first source the existing filetype plugin file and then will source\nthe new file.  If you placed the file in the \\f(CW$VIMRTUNTIME\\fR/ftplugin runtime\ndirectory, then Vim will first source the new file and then will source the\nexisting filetype plugin file.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help ftplugin-overrule\\fR\n.PP\n\\&\\fB:help filetype-plugin\\fR\n.PP\n\\&\\fB:help add-filetype-plugin\\fR\n.PP\n\\&\\fB:help 'runtimepath'\\fR\n.SS \"26.4. How do I turn off loading the Vim plugins?\"\n.IX Subsection \"26.4. How do I turn off loading the Vim plugins?\"\nYou can reset the 'loadplugins' option to turn off loading the plugins:\n.PP\n.Vb 1\n\\& :set noloadplugins\n.Ve\n.PP\nYou can also specify the \"\\-\\-noplugin\" command line argument to stop loading\nthe plugins:\n.PP\n.Vb 1\n\\& $ vim \\-\\-noplugin\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'loadplugins'\\fR\n.PP\n\\&\\fB:help \\-\\-noplugin\\fR\n.PP\n\\&\\fB:help load-plugins\\fR\n.SS \"26.5. How do I turn on/off loading the filetype plugins?\"\n.IX Subsection \"26.5. How do I turn on/off loading the filetype plugins?\"\nBy default, Vim will not load the filetype plugins. You can configure Vim\nto load filetype plugins using the command:\n.PP\n.Vb 1\n\\& filetype plugin on\n.Ve\n.PP\nYou can turn off loading the filetype plugins using:\n.PP\n.Vb 1\n\\& filetype plugin off\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :filetype\\-plugin\\-on\\fR\n.PP\n\\&\\fB:help :filetype\\-plugin\\-off\\fR\n.PP\n\\&\\fB:help :filetype\\fR\n.SS \"26.6. How do I override settings made in a file type plugin in the global ftplugin directory for all the file types?\"\n.IX Subsection \"26.6. How do I override settings made in a file type plugin in the global ftplugin directory for all the file types?\"\nYou can use an autocommand triggered on the FileType event:\n.PP\n.Vb 1\n\\& au Filetype * set formatoptions=xyz\n.Ve\n.PP\nThis should at least be after \"filetype on\" in your vimrc. Best is to put\nit in your \"myfiletypefile\" file, so that it's always last.\n.PP\nIf you want to override a setting for a particular filetype, then create a\nfile with the same name as the original filetype plugin in the\n~/.vim/after/ftplugin directory For example, to override a setting in the\nc.vim filetype plugin, create a c.vim file in the ~/.vim/after/ftplugin\ndirectory and add your preferences in this file.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help ftplugin-overrule\\fR\n.PP\n\\&\\fB:help ftplugins\\fR\n.PP\n\\&\\fB:help myfiletypefile\\fR\n.SS \"26.7. How do I disable the Vim directory browser plugin?\"\n.IX Subsection \"26.7. How do I disable the Vim directory browser plugin?\"\nTo disable the directory browsing Vim plugin, add the following line to\nyour .vimrc file:\n.PP\n.Vb 1\n\\& let g:loaded_netrw = 1\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help netrw\\fR\n.SS \"26.8. How do I set the filetype option for files with names matching a particular pattern or depending on the file extension?\"\n.IX Subsection \"26.8. How do I set the filetype option for files with names matching a particular pattern or depending on the file extension?\"\nYou can set the 'filetype' option for files with names matching a\nparticular pattern using an autocmd. For example, to set the 'filetype'\noption to \"c\" for all files with extension \".x\", you can use the following\nautocmd:\n.PP\n.Vb 1\n\\& autocmd! BufRead,BufNewFile *.x     setfiletype c\n.Ve\n.PP\nA better alternative to the above approach is to create a filetype.vim file\nin the ~/.vim directory (or in one of the directories specified in the\n\\&'runtimepath' option) and add the following lines:\n.PP\n.Vb 7\n\\& \" my filetype file\n\\& if exists(\"did_load_filetypes\")\n\\&     finish\n\\& endif\n\\& augroup filetypedetect\n\\&     au! BufRead,BufNewFile *.x       setfiletype c\n\\& augroup END\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help new-filetype\\fR\n.PP\n\\&\\fB:help 43.2\\fR\n.PP\n\\&\\fB:help :setfiletype\\fR\n.SH \"EDITING PROGRAM FILES\"\n.IX Header \"EDITING PROGRAM FILES\"\n.SS \"27.1. How do I enable automatic indentation for C/C++ files?\"\n.IX Subsection \"27.1. How do I enable automatic indentation for C/C++ files?\"\nYou can enable file-type based indentation using:\n.PP\n.Vb 1\n\\& :filetype indent on\n.Ve\n.PP\nIf you want to only enable automatic C indentation, then use:\n.PP\n.Vb 1\n\\& :set cindent\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'cindent'\\fR\n.PP\n\\&\\fB:help C\\-indenting\\fR\n.PP\n\\&\\fB:help filetype\\fR\n.SS \"27.2. How do I configure the indentation used for C/C++ files?\"\n.IX Subsection \"27.2. How do I configure the indentation used for C/C++ files?\"\nYou can configure the Vim C indentation by modifying the value of the\n\\&'cinoptions', 'cinkeys' and 'cinwords' options.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'cindent'\\fR\n.PP\n\\&\\fB:help 'cinoptions'\\fR\n.PP\n\\&\\fB:help 'cinkeys'\\fR\n.PP\n\\&\\fB:help 'cinwords'\\fR\n.PP\n\\&\\fB:help C\\-indenting\\fR\n.PP\n\\&\\fB:help cinoptions-values\\fR\n.PP\n\\&\\fB:help 'smartindent'\\fR\n.SS \"27.3. How do I turn off the automatic indentation feature?\"\n.IX Subsection \"27.3. How do I turn off the automatic indentation feature?\"\nBy default, the automatic indentation is not turned on. You must have\nconfigured Vim to do automatic indentation in either .vimrc or .gvimrc\nfiles. You can disable automatic indentation using either,\n.PP\n.Vb 1\n\\& :filetype indent off\n.Ve\n.PP\nor\n.PP\n.Vb 1\n\\& :set nocindent\n.Ve\n.PP\nAlso, check the setting for the following options:\n.PP\n.Vb 3\n\\& :set autoindent?\n\\& :set smartindent?\n\\& :set indentexpr?\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'cindent'\\fR\n.PP\n\\&\\fB:help :filetype\\-indent\\-off\\fR\n.PP\n\\&\\fB:help 'autoindent'\\fR\n.PP\n\\&\\fB:help 'smartindent'\\fR\n.PP\n\\&\\fB:help 'indentexpr'\\fR\n.SS \"27.4. How do I change the number of space characters used for the automatic indentation?\"\n.IX Subsection \"27.4. How do I change the number of space characters used for the automatic indentation?\"\nYou can modify the 'shiftwidth' option to change the number of space\ncharacters used for the automatic indentation:\n.PP\n.Vb 1\n\\& :set shiftwidth=4\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'shiftwidth'\\fR\n.SS \"27.5. I am editing a C program using Vim. How do I display the definition of a macro or a variable?\"\n.IX Subsection \"27.5. I am editing a C program using Vim. How do I display the definition of a macro or a variable?\"\nYou can use the \"[d\" command to display the definition of a macro, \"[i\"\ncommand to display the definition of a variable, \"gd\" to goto the local\ndeclaration of a variable and \"gD\" to go to the global Declaration.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help [d\\fR\n.PP\n\\&\\fB:help [i\\fR\n.PP\n\\&\\fB:help gd\\fR\n.PP\n\\&\\fB:help gD\\fR\n.PP\n\\&\\fB:help include-search\\fR\n.PP\n\\&\\fB:help 29.4\\fR\n.PP\n\\&\\fB:help 29.5\\fR\n.SS \"27.6. I am editing a C program using Vim. How do I jump to the beginning or end of a code block from within the block?\"\n.IX Subsection \"27.6. I am editing a C program using Vim. How do I jump to the beginning or end of a code block from within the block?\"\nYou can use \"[{\" command to jump to the beginning of the code block and \"]}\"\nto jump to the end of the code block from inside the block.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help [{\\fR\n.PP\n\\&\\fB:help ]}\\fR\n.PP\n\\&\\fB:help various-motions\\fR\n.SS \"27.7. When editing C++ files and when inserting new lines above or below a comment (//) line, Vim automatically inserts the C++ comment character (//) at the beginning of the line. How do I disable this?\"\n.IX Subsection \"27.7. When editing C++ files and when inserting new lines above or below a comment (//) line, Vim automatically inserts the C++ comment character (//) at the beginning of the line. How do I disable this?\"\nThis automatic insertion of the comment leader (//) when new lines\nare added is controlled by three flags in the 'formatoptions'\noption:  \"c\", \"r\" and \"o\".  \"c\" enables auto-wrapping of comment\nlines when typing extends beyond the right margin.  \"r\" enables the\nautomatic insertion of the comment leader when <Enter> is pressed\nwhile editing a comment line.  \"o\" enables the automatic insertion\nof the comment leader when a new line is opened above or below an\nexisting comment line by typing O or o in Normal mode.\n.PP\nYou can stop Vim from automatically inserting the comment leader\nwhen typing <Enter> within a comment or when opening a new line by\nremoving the \"r\" and \"o\" flags from 'formatoptions'.\n.PP\n.Vb 2\n\\&   :set formatoptions\\-=r\n\\&   :set formatoptions\\-=o\n.Ve\n.PP\nThe default filetype plugin for C and C++ files\n($VIMRUNTIME/ftplugin/c.vim) adds the \"r\" and \"o\" flags to the\n\\&'formatoptions' option.  If you want to override this for C++ files,\nthen you can add the above lines to the\n~/.vim/after/ftplugin/cpp.vim file.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'formatoptions'\\fR\n.PP\n\\&\\fB:help 30.6\\fR\n.PP\n\\&\\fB:help format-comments\\fR\n.PP\n\\&\\fB:help filetype-plugins\\fR\n.PP\n\\&\\fB:help ftplugin-overrule\\fR\n.SS \"27.8. How do I add the comment character \"\"#\"\" to a set of lines at the beginning of each line?\"\n.IX Subsection \"27.8. How do I add the comment character \"\"#\"\" to a set of lines at the beginning of each line?\"\nFirst, select the first character in all the lines using visual block mode\n(CTRL-V). Press \"I\" to start inserting characters at the beginning of the\nline. Enter the comment character and then stop the insert mode by pressing\n<Esc>. Vim will automatically insert the entered characters at the\nbeginning of all the selected lines.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help visual-block\\fR\n.PP\n\\&\\fB:help blockwise-operators\\fR\n.PP\n\\&\\fB:help v_b_I\\fR\n.SS \"27.9. How do I edit a header file with the same name as the corresponding C source file?\"\n.IX Subsection \"27.9. How do I edit a header file with the same name as the corresponding C source file?\"\nYou can use the following command to edit a header file with the same name\nas the corresponding C source file:\n.PP\n.Vb 1\n\\& :e %:t:r.h\n.Ve\n.PP\nYou can use the following command to edit the file in a new split window:\n.PP\n.Vb 1\n\\& :sp %:t:r.h\n.Ve\n.PP\nIn the above commands, the percent sign expands to the name of the current\nfile.  The `:t` modifier extracts the tail (last component) of the\nfilename. The `:r` modifier extracts the root of the filename.  The .h is\nappended to the resulting name to get the header filename.\n.PP\nAnother approach is to use the following command:\n.PP\n.Vb 1\n\\& :sfind %:t:r.h\n.Ve\n.PP\nThis command will search for the header file in the directories specified\nin the 'path' option.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help cmdline-special\\fR\n.PP\n\\&\\fB:help filename-modifiers\\fR\n.PP\n\\&\\fB:help :sfind\\fR\n.PP\n\\&\\fB:help 'path'\\fR\n.SS \"27.10. How do I automatically insert comment leaders while typing comments?\"\n.IX Subsection \"27.10. How do I automatically insert comment leaders while typing comments?\"\nTo automatically insert comment leaders while typing comments, add the \"r\"\nand \"o\" flags to the 'formatoptions' option.\n.PP\n.Vb 1\n\\& :set formatoptions+=ro\n.Ve\n.PP\nYou may also want to add the \"c\" flag to auto-wrap comments using the\n\\&'textwidth' option setting and the \"q\" flag to format comments with the\n\"gq\" command:\n.PP\n.Vb 1\n\\& :set formatoptions=croq\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 30.6\\fR\n.PP\n\\&\\fB:help format-comments\\fR\n.PP\n\\&\\fB:help 'comments'\\fR\n.PP\n\\&\\fB:help fo-table\\fR\n.SH QUICKFIX\n.IX Header \"QUICKFIX\"\n.SS \"28.1. How do I build programs from Vim?\"\n.IX Subsection \"28.1. How do I build programs from Vim?\"\nYou can use the `:make` command to build programs from Vim. The `:make`\ncommand runs the program specified by the 'makeprg' option.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 30.1\\fR\n.PP\n\\&\\fB:help :make_makeprg\\fR\n.PP\n\\&\\fB:help 'makeprg'\\fR\n.PP\n\\&\\fB:help 'makeef'\\fR\n.PP\n\\&\\fB:help :make\\fR\n.PP\n\\&\\fB:help quickfix\\fR\n.SS \"28.2. When I run the make command in Vim I get the errors listed as the compiler compiles the program. When it finishes this list disappears and I have to use the `:clist` command to see the error message again. Is there any other way to see these error messages?\"\n.IX Subsection \"28.2. When I run the make command in Vim I get the errors listed as the compiler compiles the program. When it finishes this list disappears and I have to use the `:clist` command to see the error message again. Is there any other way to see these error messages?\"\nYou can use the `:copen` or `:cwindow` command to open the quickfix window\nthat contains the compiler output. You can select different error lines\nfrom this window and jump to the corresponding line in the source code.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :copen\\fR\n.PP\n\\&\\fB:help :cwindow\\fR\n.PP\n\\&\\fB:help quickfix\\fR\n.SS \"28.3. How can I perform a command for each item in the quickfix/location list?\"\n.IX Subsection \"28.3. How can I perform a command for each item in the quickfix/location list?\"\nStarting from Vim 7.4.858 Vim provides the new commands `:cfdo`, `:cdo`,\n`:lfdo` and `:ldo.` They work by iterating over all items in the quickfix\nlist and performing a command on each. The difference is, that the `:lfdo`\nand `:ldo` commands iterate over the location list entries, while the\n`:cfdo` and `:cdo` commands operate on the items in the quickfix list. Also,\nthe `:cfdo` and `:lfdo` operate on all different files, while the `:cdo` and\n`:ldo` commands operate on each item in the quickfix/location list.\n.PP\nFor example you could vimgrep all C files in the current directory for a\nsearch string \"Foobar\":\n.PP\n.Vb 1\n\\& :vimgrep /Foobar/ *.c\n.Ve\n.PP\nand as this populates your quickfix list, you could simply replace all\noccurences by using:\n.PP\n.Vb 1\n\\& :cdo :%s/Foobar/Foobaz | upd\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :cfdo\\fR\n.PP\n\\&\\fB:help :cdo\\fR\n.SH FOLDING\n.IX Header \"FOLDING\"\n.SS \"29.1. How do I extend the Vim folding support?\"\n.IX Subsection \"29.1. How do I extend the Vim folding support?\"\nYou can use the 'foldexpr' option to fold using a user specified function.\nFor example, to fold subroutines of the following form into a single line:\n.PP\n.Vb 5\n\\& sub foo {\n\\&   my $barf;\n\\&   $barf = 3;\n\\&   return $barf;\n\\& }\n.Ve\n.PP\nYou can use the following commands:\n.PP\n.Vb 12\n\\& set foldmethod=expr\n\\& set foldexpr=MyFoldExpr(v:lnum)\n\\& fun! MyFoldExpr(line)\n\\&     let str = getline(a:line)\n\\&     if str =~ \\*(Aq^sub\\e>\\*(Aq\n\\&         return \\*(Aq1\\*(Aq\n\\&     elseif str =~ \\*(Aq^}\\*(Aq\n\\&         return \\*(Aq<1\\*(Aq\n\\&     else\n\\&         return foldlevel(a:line \\- 1)\n\\&     endif\n\\& endfun\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'foldexpr'\\fR\n.PP\n\\&\\fB:help fold-expr\\fR\n.SS \"29.2. When I enable folding by setting the 'foldmethod' option, all the folds are closed. How do I prevent this?\"\n.IX Subsection \"29.2. When I enable folding by setting the 'foldmethod' option, all the folds are closed. How do I prevent this?\"\nYou can set the 'foldlevelstart' option to a particular value to close only\nfolds above the specified value.\n.PP\n.Vb 1\n\\& :set foldlevelstart=99\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'foldlevelstart'\\fR\n.PP\n\\&\\fB:help 'foldlevel'\\fR\n.PP\n\\&\\fB:help fold-foldlevel\\fR\n.SS \"29.3. How do I control how many folds will be opened when I start editing a file?\"\n.IX Subsection \"29.3. How do I control how many folds will be opened when I start editing a file?\"\nYou can modify the 'foldlevelstart' option to control the number of folds\nthat will be opened when you start editing a file. To start editing with\nall the folds closed:\n.PP\n.Vb 1\n\\& :set foldlevelstart=0\n.Ve\n.PP\nTo start editing with all the folds opened, you can use\n.PP\n.Vb 1\n\\& :set foldlevelstart=999\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'foldlevelstart'\\fR\n.SS \"29.4. How do I open and close folds using the mouse?\"\n.IX Subsection \"29.4. How do I open and close folds using the mouse?\"\nYou can click on the + and \\- characters displayed at the leftmost column to\nopen and close fold. For this to work, you have to set the 'foldcolumn'\nto a value greater than zero:\n.PP\n.Vb 1\n\\& :set foldcolumn=2\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'foldcolumn'\\fR\n.SS \"29.5. How do I change the text displayed for a closed fold?\"\n.IX Subsection \"29.5. How do I change the text displayed for a closed fold?\"\nYou can use the 'foldtext' option to change the text displayed for a closed\nfold.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'foldtext'\\fR\n.PP\n\\&\\fB:help fold-foldtext\\fR\n.PP\n\\&\\fB:help 'fillchars'\\fR\n.SS \"29.6. How do I store and restore manually created folds across different Vim invocations?\"\n.IX Subsection \"29.6. How do I store and restore manually created folds across different Vim invocations?\"\nYou can use the `:mkview` command to store manually created folds. Later,\nyou can use the `:loadview` command to restore the folds. For this to work,\nthe 'viewoptions' must contain \"folds\".\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 28.4\\fR\n.PP\n\\&\\fB:help :mkview\\fR\n.PP\n\\&\\fB:help :loadview\\fR\n.PP\n\\&\\fB:help 'viewoptions'\\fR\n.PP\n\\&\\fB:help 'viewdir'\\fR\n.PP\n\\&\\fB:help :mksession\\fR\n.PP\n\\&\\fB:help 'sessionoptions'\\fR\n.SS \"29.7. I have enabled syntax based folding. Why is Vim so slow?\"\n.IX Subsection \"29.7. I have enabled syntax based folding. Why is Vim so slow?\"\nSyntax based folding is currently rather slow in Vim and will possibly\nslow down Vim considerably. There is an issue in the todo list to fix\nthis, but the todo list is rather long and it may take a while until\nthis will be fixed.\n.PP\nYou can find the issue in the todo list, if you read\n.PP\n\\&\\fB:help todo.txt\\fR\n.PP\nfollowed by a search for \"folding with 'foldmethod'\"\n.PP\nA workaround is to temporarily set the foldmethod to manual while in\ninsert mode. This is described in the wiki at:\n.PP\n.Vb 1\n\\& http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text\n.Ve\n.SH \"VIM WITH EXTERNAL APPLICATIONS\"\n.IX Header \"VIM WITH EXTERNAL APPLICATIONS\"\n.SS \"30.1. Can I run a shell inside a Vim window?\"\n.IX Subsection \"30.1. Can I run a shell inside a Vim window?\"\nSince Version 8.1 Vim comes with a terminal window included. It allows\nto run a shell inside an ordinary Vim window (e.g. split) asynchronously\nand interact with the shell using the normal Vim commands.\n.PP\nWhen the focus is in the terminal window, typed keys will be sent to\nthe job and is called terminal mode. You can click outside of the\nterminal window to move keyboard focus elsewhere, alternatively one can\nuse CTRL-W to novigate between different Vim windows. To feed CTRL-W into the\nterminal, one needs to use CTRL-W .\n.PP\nTo map keys specifically for terminal mode, use the new `:tmap`\ncommand. After typing CTRL-W the terminal window will switch to\nTerminal-Normal mode (this can be used to move the cursor around, scroll\nthe window, etc. Just like normal mode).\n.PP\nTo interact between the terminal and Vim, Vim implements several\ninterfaces using \\fBterm_sendkeys()\\fR, terminal-api and the client-server\nmechanism.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help terminal\\fR\n.PP\n\\&\\fB:help mapmode-t\\fR\n.PP\n\\&\\fB:help Terminal-Normal\\fR\n.PP\n\\&\\fB:help terminal-communication\\fR\n.SS \"30.2. How do I pass the word under the cursor to an external command?\"\n.IX Subsection \"30.2. How do I pass the word under the cursor to an external command?\"\nYou can use the special keyword <cword> to pass the word under the cursor\nto an external command. For example:\n.PP\n.Vb 1\n\\& :!dict <cword>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :<cword\\fR>\n.SS \"30.3. How do I get the output of a shell command into a Vim buffer?\"\n.IX Subsection \"30.3. How do I get the output of a shell command into a Vim buffer?\"\nYou can use the `:r !` command to get the output of a shell command into a\nVim buffer. For example, to insert the output of the \"ls\" shell command,\nyou can use the following command:\n.PP\n.Vb 1\n\\& :r !ls\n.Ve\n.PP\nTo insert the output of the shell command above the first line use the\nfollowing command:\n.PP\n.Vb 1\n\\& :0r !ls\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :r!\\fR\n.SS \"30.4. How do I pipe the contents of the current buffer to an external command and replace the contents of the buffer with the output from the command?\"\n.IX Subsection \"30.4. How do I pipe the contents of the current buffer to an external command and replace the contents of the buffer with the output from the command?\"\nYou can use the :! command to pipe the contents of the current buffer to an\nexternal command and replace the contents of the buffer with the output\nfrom the command. For example, to sort the contents of the current buffer,\nusing the Unix sort command, you can use the following command:\n.PP\n.Vb 1\n\\& :%!sort\n.Ve\n.PP\nTo sort only lines 10\\-20, you can use the following command\n.PP\n.Vb 1\n\\& :10,20!sort\n.Ve\n.PP\nAlso, if you want to pipe a buffer to an external command but not put the\nresults back in the buffer, you can use\n.PP\n.Vb 1\n\\& :w !sort\n.Ve\n.PP\nThe above command will pipe the entire buffer to the sort command.  Note,\nthat the space between the \"w\" and the \"!\" is critical.  To pipe only a\nrange of lines, you can use\n.PP\n.Vb 1\n\\& :10,20w !sort\n.Ve\n.PP\nThe above command will pipe the lines 10\\-20 to the sort command.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :range!\\fR\n.PP\n\\&\\fB:help 10.9\\fR\n.PP\n\\&\\fB:help :w_c\\fR\n.SS \"30.5. How do I sort a section of my file?\"\n.IX Subsection \"30.5. How do I sort a section of my file?\"\nYou use the `:sort` command like this:\n.PP\n.Vb 1\n\\&   :5,100sort\n.Ve\n.PP\nUsing the `:sort` command provides many options, you can sort numerical on\nthe first found decimal number using:\n.PP\n.Vb 1\n\\&   :%sort n\n.Ve\n.PP\nOr you can specify to sort on the text, starting at virtual column 8:\n.PP\n.Vb 1\n\\&   :%sort /.*\\e%8v/\n.Ve\n.PP\nAlternatively can pipe a section of the file to the Unix \"sort\" utility to\nsort the file. For example:\n.PP\n.Vb 1\n\\& :5,100!sort\n.Ve\n.PP\nYou can also use a visual block, and use the \"!sort\" command on the\nselected block.\n.PP\nSee also:\n\\&\\fB:help :sort\\fR\n.PP\n\\&\\fB:help filter\\fR\n.SS \"30.6. How do I use Vim as a pager?\"\n.IX Subsection \"30.6. How do I use Vim as a pager?\"\nYou can use Vim as a pager using the \\f(CW$VIMRUNTIME\\fR/macros/less.sh shell\nscript, supplied as part of the standard Vim distribution. This shell\nscript uses the \\f(CW$VIMRUNTIME\\fR/macros/less.vim Vim script to provide less like\nkey bindings.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help less\\fR\n.SS \"30.7. How do I view Unix man pages from inside Vim?\"\n.IX Subsection \"30.7. How do I view Unix man pages from inside Vim?\"\nYou can view Unix man pages, inside Vim, using the man.vim plugin supplied\nas part of the standard Vim distribution. To use this plugin, add the\nfollowing line to your startup vimrc file:\n.PP\n.Vb 1\n\\& runtime ftplugin/man.vim\n.Ve\n.PP\nYou can also press the K key to run the program specified by the\n\\&'keywordprg' option with the keyword under the cursor. By default,\n\\&'keywordprg' is set to run man on the keyword under the cursor.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help ft-man-plugin\\fR\n.PP\n\\&\\fB:help K\\fR\n.PP\n\\&\\fB:help 'keywordprg'\\fR\n.SS \"30.8. How do I change the diff command used by the Vim diff support?\"\n.IX Subsection \"30.8. How do I change the diff command used by the Vim diff support?\"\nBy default, the Vim diff support uses the 'diff' command. You can change\nthis by changing the 'diffexpr' option.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help diff-diffexpr\\fR\n.PP\n\\&\\fB:help 'diffexpr'\\fR\n.SS \"30.9. How do I use the Vim diff mode without folding?\"\n.IX Subsection \"30.9. How do I use the Vim diff mode without folding?\"\nYou can use the following command-line to start Vim with two filenames\nand use the diff mode without folding:\n.PP\n.Vb 1\n\\& $ vim \\-o file1 file2 \"+windo set diff scrollbind scrollopt+=hor nowrap\"\n.Ve\n.PP\nIf you like vertically split windows, then replace \"\\-o\" with \"\\-O\".\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help vimdiff\\fR\n.SH \"GUI VIM\"\n.IX Header \"GUI VIM\"\n.SS \"31.1. How do I create buffer specific menus?\"\n.IX Subsection \"31.1. How do I create buffer specific menus?\"\nAdding support for buffer specific menus is in the Vim TODO list. In the\nmean time, you can try Michael Geddes's plugin, buffermenu.vim:\n.PP\n.Vb 1\n\\& https://www.vim.org/scripts/script.php?script_id=246\n.Ve\n.SS \"31.2. How do I change the font used by GUI Vim?\"\n.IX Subsection \"31.2. How do I change the font used by GUI Vim?\"\nYou can change the 'guifont' option to change the font used by GUI Vim.  To\ndisplay the current value of this option, you can use\n.PP\n.Vb 1\n\\& :set guifont?\n.Ve\n.PP\nYou can add the displayed font name to the .vimrc file to use the font\nacross Vim sessions. For example, add the following line to the .vimrc file\nto use Andale Mono font.\n.PP\n.Vb 1\n\\& set guifont=Andale_Mono:h10:cANSI\n.Ve\n.PP\nFor Win32, GTK and Photon version of Vim, you can use the following command\nto bringup a dialog which will help you in changing the guifont:\n.PP\n.Vb 1\n\\& :set guifont=*\n.Ve\n.PP\nYou can also use the \\-font Vim command line option to specify the font used\nfor normal text.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'guifont'\\fR\n.PP\n\\&\\fB:help 'guifontset'\\fR\n.PP\n\\&\\fB:help 'guifontwide'\\fR\n.PP\n\\&\\fB:help font-sizes\\fR\n.PP\n\\&\\fB:help \\-font\\fR\n.PP\n\\&\\fB:help \\-boldfont\\fR\n.PP\n\\&\\fB:help \\-italicfont\\fR\n.PP\n\\&\\fB:help \\-menufont\\fR\n.PP\n\\&\\fB:help \\-menufontset\\fR\n.SS \"31.3. When starting GUI Vim, how do I specify the location of the GVIM window?\"\n.IX Subsection \"31.3. When starting GUI Vim, how do I specify the location of the GVIM window?\"\nYou can use the \"\\-geometry\" command line argument to specify the location\nof the GUI Vim window. For example:\n.PP\n.Vb 1\n\\& $ gvim \\-geometry 80x25+100+300\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 31.4\\fR\n.PP\n\\&\\fB:help \\-geom\\fR\n.SS \"31.4. How do I add a horizontal scrollbar in GVim?\"\n.IX Subsection \"31.4. How do I add a horizontal scrollbar in GVim?\"\nYou can enable the horizontal scrollbar by modifying the 'guioptions'\noption:\n.PP\n.Vb 1\n\\& :set guioptions+=b\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'guioptions'\\fR\n.PP\n\\&\\fB:help gui-horiz-scroll\\fR\n.SS \"31.5. How do I make the scrollbar appear in the left side by default?\"\n.IX Subsection \"31.5. How do I make the scrollbar appear in the left side by default?\"\nYou can add the \"l\" flag to the 'guioptions' option to make the scrollbar\nappear in the left side.\n.PP\n.Vb 2\n\\& :set guioptions+=l\n\\& :set guioptions\\-=r\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'guioptions'\\fR\n.PP\n\\&\\fB:help gui-scrollbars\\fR\n.SS \"31.6. How do I remove the Vim menubar?\"\n.IX Subsection \"31.6. How do I remove the Vim menubar?\"\nYou can remove the Vim menubar by removing the \"m\" flag from the\n\\&'guioptions' option:\n.PP\n.Vb 1\n\\& :set guioptions\\-=m\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'guioptions'\\fR\n.SS \"31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the menu starting with that letter is selected. I don't want this behavior as I want to map the <Alt>\\-<key> combination. How do I do this?\"\n.IX Subsection \"31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the menu starting with that letter is selected. I don't want this behavior as I want to map the <Alt>-<key> combination. How do I do this?\"\nYou can use the 'winaltkeys' option to disable the use of the <Alt> key to\nselect a menu item:\n.PP\n.Vb 1\n\\& :set winaltkeys=no\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'winaltkeys'\\fR\n.PP\n\\&\\fB:help :simalt\\fR\n.SS \"31.8. Is it possible to scroll the text by dragging the scrollbar so that the cursor stays in the original location?\"\n.IX Subsection \"31.8. Is it possible to scroll the text by dragging the scrollbar so that the cursor stays in the original location?\"\nThe way Vim is designed, the cursor position has to be in a visible spot in\nnormal, visual, select and insert mode. This cannot be changed without\nmodifying Vim. When the scrollbar is used, the cursor will be moved so that\nit is always visible. Another approach to solving this problem is to use\nthe Vim marks. You can mark the current cursor position using ma. Then\nscroll to a different part of the text and jump back to the old position\nusing `a. You can also try the following suggestion from the Vim Online\nwebsite:\n.PP\n.Vb 1\n\\& http://vim.wikia.com/wiki/VimTip320\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help mark-motions\\fR\n.SS \"31.9. How do I get gvim to start browsing files in a particular directory when using the `:browse` command?\"\n.IX Subsection \"31.9. How do I get gvim to start browsing files in a particular directory when using the `:browse` command?\"\nYou can set the 'browsedir' option to the default directory to use for the\n`:browse` command.\n.PP\n.Vb 1\n\\& :set browsedir=\\*(Aq<your_dir>\\*(Aq\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'browsedir'\\fR\n.SS \"31.10. For some questions, like when a file is changed outside of Vim, Vim displays a GUI dialog box. How do I replace this GUI dialog box with a console dialog box?\"\n.IX Subsection \"31.10. For some questions, like when a file is changed outside of Vim, Vim displays a GUI dialog box. How do I replace this GUI dialog box with a console dialog box?\"\nYou can set the \"c\" flag in the 'guioptions' option to configure Vim to use\nconsole dialogs instead of GUI dialogs:\n.PP\n.Vb 1\n\\& :set guioptions+=c\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'guioptions'\\fR\n.SS \"31.11. I am trying to use GUI Vim as the editor for my xxx application. When the xxx application launches GUI Vim to edit a file, the control immediately returns to the xxx application. How do I start GUI Vim, so that the control returns to the xxx application only after I quit Vim?\"\n.IX Subsection \"31.11. I am trying to use GUI Vim as the editor for my xxx application. When the xxx application launches GUI Vim to edit a file, the control immediately returns to the xxx application. How do I start GUI Vim, so that the control returns to the xxx application only after I quit Vim?\"\nYou have to start GUI Vim with the \"\\-f\" (foreground) command line option:\n.PP\n.Vb 1\n\\& $ gvim \\-f\n.Ve\n.PP\nBy default, GUI Vim will disconnect from the program that started Vim. With\nthe '\\-f' option, GUI Vim will not disconnect from the program that started\nit.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gui-fork\\fR\n.PP\n\\&\\fB:help \\-f\\fR\n.SS \"31.12. Why does the \"\"Select Font\"\" dialog doesn't show all the fonts installed in my system?\"\n.IX Subsection \"31.12. Why does the \"\"Select Font\"\" dialog doesn't show all the fonts installed in my system?\"\nVim supports only fixed width (mono-spaced) fonts. Proportional fonts are\nnot supported.  In the \"Select Font\" dialog, only fixed width fonts will be\ndisplayed.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help font-sizes\\fR\n.PP\n\\&\\fB:help 'guifont'\\fR\n.SS \"31.13. How do I use the mouse in Vim command-line mode?\"\n.IX Subsection \"31.13. How do I use the mouse in Vim command-line mode?\"\nYou can set the \"c\" flag in the 'mouse' option to use mouse in the Vim\ncommand-line mode:\n.PP\n.Vb 1\n\\& :set mouse+=c\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help mouse-using\\fR\n.PP\n\\&\\fB:help gui-mouse\\fR\n.PP\n\\&\\fB:help 09.2\\fR\n.SS \"31.14. When I use the middle mouse button to scroll text, it pastes the last copied text. How do I disable this behavior?\"\n.IX Subsection \"31.14. When I use the middle mouse button to scroll text, it pastes the last copied text. How do I disable this behavior?\"\nYou can map the middle mouse button to <Nop> to disable the middle mouse\nbutton:\n.PP\n.Vb 2\n\\& :map  <MiddleMouse> <Nop>\n\\& :map! <MiddleMouse> <Nop>\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gui-mouse-mapping\\fR\n.PP\n\\&\\fB:help <Nop\\fR>\n.SS \"31.15. How do I change the location and size of a GUI Vim window?\"\n.IX Subsection \"31.15. How do I change the location and size of a GUI Vim window?\"\nYou can use the `:winpos` command to change the Vim window position. To\nchange the size of the window, you can modify the 'lines' and 'columns'\noptions.\n.PP\nFor example, the following commands will position the GUI Vim window at the\nX,Y co-ordinates 50,50 and set the number of lines to 50 and the number of\ncolumns to 80.\n.PP\n.Vb 3\n\\& :winpos 50 50\n\\& :set lines=50\n\\& :set columns=80\n.Ve\n.PP\nThe arguments to the `:winpos` command specify the pixel co-ordinates of the\nVim window. The 'lines' and 'columns' options specify the number of lines\nand characters to use for the height and the width of the window\nrespectively.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 31.4\\fR\n.PP\n\\&\\fB:help :winpos\\fR\n.PP\n\\&\\fB:help 'lines'\\fR\n.PP\n\\&\\fB:help 'columns'\\fR\n.PP\n\\&\\fB:help GUIEnter\\fR\n.SS \"31.16. When splitting the Vim window vertically, Vim changes the position.\"\n.IX Subsection \"31.16. When splitting the Vim window vertically, Vim changes the position.\"\nThis is a known problem. When you are splitting the Vim window, Vim will\ntry to draw a scrollbar. Since this changes the gui window, Vim tries to\nresize its main window to keep the same position and this will cause Vim\nto move its position. This happens on Windows with a multi-window setup or\na window that was \"snapped\" to a certain position.\n.PP\nA workaournd to this problem is, to remove gui scrollbars, e.g.\n.PP\n.Vb 1\n\\& :set guioptions\\-=L\n.Ve\n.SH \"VIM ON UNIX\"\n.IX Header \"VIM ON UNIX\"\n.SS \"32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim freezes. What should I do now?\"\n.IX Subsection \"32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim freezes. What should I do now?\"\nMany terminal emulators and real terminal drivers use the CTRL-S key to\nstop the data from arriving so that you can stop a fast scrolling display\nto look at it (also allowed older terminals to slow down the computer so\nthat it did not get buffer overflows).  You can start the output again by\npressing the CTRL-Q key.\n.PP\nWhen you press the CTRL-S key, the terminal driver will stop sending the\noutput data. As a result of this, it will look like Vim is hung. If you\npress the CTRL-Q key, then everything will be back to normal.\n.PP\nYou can turn off the terminal driver flow control using the \"stty\" command:\n.PP\n.Vb 1\n\\& $ stty \\-ixon \\-ixoff\n.Ve\n.PP\nor, you can change the keys used for the terminal flow control, using the\nfollowing commands:\n.PP\n.Vb 2\n\\& $ stty stop <char>\n\\& $ stty start <char>\n.Ve\n.SS \"32.2. I am seeing weird screen update problems in Vim. What can I do to solve this screen/display update problems?\"\n.IX Subsection \"32.2. I am seeing weird screen update problems in Vim. What can I do to solve this screen/display update problems?\"\nYou have to use a proper terminal emulator like xterm with correct TERM\nsettings (TERM=xterm) and a correct terminfo/termcap file.\nFor more information, read:\n.PP\n\\&\\fB:help 'term'\\fR\n.SS \"32.3. I am using the terminal/console version of Vim. In insertmode, When I press the backspace key, the character before the cursor is not erased. How do I configure Vim to do this?\"\n.IX Subsection \"32.3. I am using the terminal/console version of Vim. In insertmode, When I press the backspace key, the character before the cursor is not erased. How do I configure Vim to do this?\"\nYou have to make sure that Vim gets the correct keycode for the backpspace\nkey. You can try using the command:\n.PP\n.Vb 1\n\\& :fixdel\n.Ve\n.PP\nMake sure the TERM environment variable is set to the correct terminal\nname. You can try using the \"stty\" command:\n.PP\n.Vb 1\n\\& $ stty erase ^H\n.Ve\n.PP\nwhere, you have to enter the ^H character by pressing the CTRL-V key and\nthen the CTRL-H key. Also check the value of your 'backspace' setting.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :fixdel\\fR\n.PP\n\\&\\fB:help Linux-backspace\\fR\n.PP\n\\&\\fB:help NetBSD-backspace\\fR\n.PP\n\\&\\fB:help 'backspace'\\fR\n.SS \"32.4. I am using Vim in a xterm. When I quit Vim, the screen contents are restored back to the original contents. How do I disable this?\"\n.IX Subsection \"32.4. I am using Vim in a xterm. When I quit Vim, the screen contents are restored back to the original contents. How do I disable this?\"\nThe xterm has a capability called \"alternate screen\".  If this capability\nis present, vim switches to that alternate screen upon startup and back on\nexit, thus restoring the original screen contents.  To disable this\nfeature, add the following line to your .vimrc file:\n.PP\n.Vb 1\n\\& :set t_ti= t_te=\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'restorescreen'\\fR\n.PP\n\\&\\fB:help xterm-screens\\fR\n.SS \"32.5. When I start Vim, it takes quite a few seconds to start. How do I minimize the startup time?\"\n.IX Subsection \"32.5. When I start Vim, it takes quite a few seconds to start. How do I minimize the startup time?\"\nThis may be related to Vim opening the X display for setting the xterm\ntitle and using the X clipboard. Make sure the DISPLAY variable is set to\npoint to the correct host. Try using the command line:\n.PP\n.Vb 1\n\\& $ vim \\-X\n.Ve\n.PP\nThis will prevent Vim from opening the X display. With this command-line\noption, the X clipboard cannot be used and also Vim will not be able to\nchange the xterm title.\n.PP\nYou can also set the 'clipboard' option to\n.PP\n.Vb 1\n\\& :set clipboard=exclude:.*\n.Ve\n.PP\nThis has the same effect as using the \\-X command-line argument.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help \\-X\\fR\n.PP\n\\&\\fB:help 'clipboard'\\fR\n.PP\nIf the clipboard is not the cause of the slow startup, it might be a\nplugin that slows down Vim. In that case, you can use the \\-\\-startuptime\nargument to debug this further. You can do:\n.PP\n.Vb 1\n\\& $ vim \\-\\-startuptime vim_startup.log\n.Ve\n.PP\nand the timing will be written to the file vim_startup.log. For even\nmore advanced profiling, you can use the profiling feature, that is\navailable in huge builds of Vim. To do so, call Vim like this:\n.PP\n.Vb 6\n\\& $ vim \\-\\-cmd \\*(Aqprofile start profile.log\\*(Aq \\e\n\\&   \\-\\-cmd \\*(Aqprofile func *\\*(Aq \\e\n\\&   \\-\\-cmd \\*(Aqprofile file *\\*(Aq \\e\n\\&   \\-c \\*(Aqprofdel func *\\*(Aq \\e\n\\&   \\-c \\*(Aqprofdel file *\\*(Aq \\e\n\\&   \\-c \\*(Aqqa!\\*(Aq\n.Ve\n.PP\nAfter running this, you will have a file profile.log in your current\ndirectory. To further analyse this, open the file profile.log and run:\n.PP\n.Vb 5\n\\& \" Open profile.log file in vim first\n\\& :let timings=[]\n\\& :g/^SCRIPT/call add(timings, [getline(\\*(Aq.\\*(Aq)[len(\\*(AqSCRIPT  \\*(Aq):], matchstr(getline(line(\\*(Aq.\\*(Aq)+1), \\*(Aq^Sourced \\ezs\\ed\\e+\\*(Aq)]+map(getline(line(\\*(Aq.\\*(Aq)+2, line(\\*(Aq.\\*(Aq)+3), \\*(Aqmatchstr(v:val, \\*(Aq\\*(Aq\\ed\\e+\\e.\\ed\\e+$\\*(Aq\\*(Aq)\\*(Aq))\n\\& :enew\n\\& :call setline(\\*(Aq.\\*(Aq, [\\*(Aqcount total (s)   self (s)  script\\*(Aq]+map(copy(timings), \\*(Aqprintf(\"%5u %9s   %8s  %s\", v:val[1], v:val[2], v:val[3], v:val[0])\\*(Aq))\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help \\-\\-startuptime\\fR\n.PP\n\\&\\fB:help profiling\\fR\n.SS \"32.6. How can I make the cursor in gvim in unix stop blinking?\"\n.IX Subsection \"32.6. How can I make the cursor in gvim in unix stop blinking?\"\nYou can modify the 'guicursor' option, to stop the cursor from blinking.\nFor example:\n.PP\n.Vb 1\n\\& :set guicursor=a:blinkon0\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'guicursor'\\fR\n.SS \"32.7. How do I change the menu font on GTK Vim?\"\n.IX Subsection \"32.7. How do I change the menu font on GTK Vim?\"\nYou can modify the ~/.gtkrc file to change the menu font on GTK Vim. For\nexample:\n.PP\n.Vb 3\n\\& style \"default\"\n\\& { font =\"smooth09\" }\n\\& class \"*\" style \"default\"\n.Ve\n.PP\nThe last line changes the font of all widgets.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help gui-gtk\\fR\n.SS \"32.8. How do I prevent CTRL-Z from suspending Vim?\"\n.IX Subsection \"32.8. How do I prevent CTRL-Z from suspending Vim?\"\nYou can map CTRL-Z to prevent the suspending. Here are some suggestions:\n.PP\n\\&\\- Make CTRL-Z do nothing:\n.PP\n.Vb 1\n\\& :map <C\\-Z> <Nop>\n.Ve\n.PP\n\\&\\- Make CTRL-Z start a shell:\n.PP\n.Vb 1\n\\& :map <C\\-Z> :shell<CR>\n.Ve\n.PP\n\\&\\- Make CTRL-Z give an error message:\n.PP\n.Vb 1\n\\& :map <C\\-Z> :\"suspending disabled<CR>\n.Ve\n.PP\nFor the last example, the double quote is necessary in order to keep the\nmessage on the status line.\n.SS \"32.9. When I kill the xterm running Vim, the Vim process continues to run and takes up a lot of CPU (99%) time. Why is this happening?\"\n.IX Subsection \"32.9. When I kill the xterm running Vim, the Vim process continues to run and takes up a lot of CPU (99%) time. Why is this happening?\"\nWhen Vim is built with support for Python interface, you will have this\nproblem. This is a known problem with the python thread library and Vim.  To\nsolve this problem, use a Vim binary built without the Python interface.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help +python\\fR\n.PP\n\\&\\fB:help python\\fR\n.SS \"32.10. How do I get the Vim syntax highlighting to work in a Unix terminal?\"\n.IX Subsection \"32.10. How do I get the Vim syntax highlighting to work in a Unix terminal?\"\nThe easiest and simplest way to get Vim syntax highlighting is to use the\nGUI version of Vim (GVIM). To get syntax highlighting to work in the\nconsole/terminal version of Vim, you have to run a terminal emulator (like\nXfree86 xterm or rxvt or dtterm) that supports color. Note that if a\nterminal emulator supports changing the background and foreground colors,\nthat does not mean that it also supports ANSI escape sequences for changing\nthe color. You can download the latest version of Xfree86 xterm from\nhttps://invisible\\-island.net/xterm/xterm.html\nYou can download the latest version of rxvt from https://rxvt.org\nYou have to install the terminfo/termcap file that supports colors for the\nterminal emulator. Also, set the TERM environment variable to the correct\nname of the term that supports colors.\n.PP\nYou can use the colortest.vim script supplied with the Vim runtime\npackage to test the color setup. To use this script, follow these steps:\n.PP\n.Vb 2\n\\& :e $VIMRUNTIME/syntax/colortest.vim\n\\& :source %\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 06.2\\fR\n.PP\n\\&\\fB:help terminal-colors\\fR\n.PP\n\\&\\fB:help termcap-colors\\fR\n.PP\n\\&\\fB:help startup-terminal\\fR\n.PP\n\\&\\fB:help xterm-color\\fR\n.PP\n\\&\\fB:help colortest.vim\\fR\n.SH \"VIM ON MS-WINDOWS\"\n.IX Header \"VIM ON MS-WINDOWS\"\n.SS \"33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode. What happened?\"\n.IX Subsection \"33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode. What happened?\"\nThe mswin.vim script provides key mappings and options to make Vim behave\nlike a MS-Windows application. One of the keys mapped is CTRL-V which is\nused for pasting text in MS-Windows applications. This will disable the use\nof CTRL-V to start the blockwise visual mode. The mswin.vim script maps\nCTRL-Q for staring the blockwise visual mode. So you can use CTRL-Q instead\nof CTRL-V.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help CTRL-V\\fR\n.PP\n\\&\\fB:help CTRL-V-alternative\\fR\n.PP\n\\&\\fB:help CTRL-Q\\fR\n.PP\n\\&\\fB:help 10.5\\fR\n.SS \"33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do I configure Vim to treat CTRL-Y as CTRL-Y?\"\n.IX Subsection \"33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do I configure Vim to treat CTRL-Y as CTRL-Y?\"\nThe mapping of the CTRL-Y key to the CTRL-R key is done by the mswin.vim\nscript. The mswin.vim script maps CTRL-Y to make Vim behave like a standard\nMS-Windows application. This is explained in `:help CTRL\\-Y`. You can either\ncomment out the line in mswin.vim that maps the CTRL-Y key or you can\nremove the line in your .vimrc file that sources the mswin.vim script.\n.SS \"33.3. How do I start GUI Vim in a maximized window always?\"\n.IX Subsection \"33.3. How do I start GUI Vim in a maximized window always?\"\nYou can use the `:simalt` command to maximize the Vim window. You can use\nthe GUIEnter autocmd to maximize the Vim window on startup:\n.PP\n.Vb 1\n\\& autocmd GUIEnter * simalt ~x\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :simalt\\fR\n.PP\n\\&\\fB:help GUIEnter\\fR\n.PP\n\\&\\fB:help gui\\-win32\\-maximized\\fR\n.SS \"33.4. After doing some editing operations, Vim freezes. The cursor becomes an empty rectangle. I am not able enter any characters. What is happening?\"\n.IX Subsection \"33.4. After doing some editing operations, Vim freezes. The cursor becomes an empty rectangle. I am not able enter any characters. What is happening?\"\nMost probably, you used the mouse wheel to scroll the text in Vim. There is\na known problem in using intellimouse mouse wheel with Vim. To avoid this\nproblem, disable Universal scrolling support for Vim.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help intellimouse-wheel-problems\\fR\n.SS \"33.5. I am using Windows XP, the display speed of maximized GVim is very slow. What can I do to speed the display updates?\"\n.IX Subsection \"33.5. I am using Windows XP, the display speed of maximized GVim is very slow. What can I do to speed the display updates?\"\nThis may be due to the fact that you have enabled 'Smooth edges of screen\nfonts' in the display properties. Try turning off font smoothing or try\nchanging the smoothing method to \"Standard\".\n.SS \"33.6. What are the recommended settings for using Vim with cygwin?\"\n.IX Subsection \"33.6. What are the recommended settings for using Vim with cygwin?\"\nYou may want to set the following shell related Vim settings:\n.PP\n.Vb 7\n\\& :set shellcmdflag=\\-c\n\\& :set shellquote=\n\\& :set shellslash          \" Use the forward slash for expansion.\n\\& :set shellxquote=\\e\"\n\\& :set shell=d:\\ecygwin\\ebin\\ebash.exe \" Use the bash shell\n\\& :set shellpipe=2>&1| tee\n\\& :set shellredir=>%s 2>&1\n.Ve\n.SS \"33.7. I am trying to use GNU diff with Vim diff mode. When I run the diff from command line, it works. When I try to use the diff with Vim it doesn't work. What should I do now?\"\n.IX Subsection \"33.7. I am trying to use GNU diff with Vim diff mode. When I run the diff from command line, it works. When I try to use the diff with Vim it doesn't work. What should I do now?\"\nThere is a problem with using GNU diff with Vim. You can try using the\nGNU diff.exe built by Ron Aaron from the following link:\n.PP\n.Vb 2\n\\& http://www.mossbayeng.com/~ron/vim/builds.html\n\\&(This page no longer exists.)\n.Ve\n.SS \"33.8. Is it possible to use Vim as an external editor for MS-Windows Outlook email client?\"\n.IX Subsection \"33.8. Is it possible to use Vim as an external editor for MS-Windows Outlook email client?\"\nYou can use the \"cubiclevim\" COM Add-In to use Vim as an external editor\nfor MS-Windows Outlook email client. Visit the following URL for more\ninformation:\n.PP\n.Vb 1\n\\& https://sourceforge.net/projects/cubiclevim/\n.Ve\n.PP\nNote, that currently this works only with MS-Office 2000 and XP.\n.PP\nAlso the plugin OutlookVim might be worth a look:\n.PP\n.Vb 1\n\\& https://www.vim.org/scripts/script.php?script_id=3087\n.Ve\n.SS \"33.9. I am using Vim to edit HTML files. How do I start internet explorer with the current file to preview the HTML file?\"\n.IX Subsection \"33.9. I am using Vim to edit HTML files. How do I start internet explorer with the current file to preview the HTML file?\"\nYou can use the following command:\n.PP\n.Vb 1\n\\& :!start c:\\eprogra~1\\eintern~1\\eiexplore.exe file://%:p<CR>\n.Ve\n.SS \"33.10. I would like to use Vim with Microsoft Visual Studio. How do I do this?\"\n.IX Subsection \"33.10. I would like to use Vim with Microsoft Visual Studio. How do I do this?\"\nYou have to download and use the OLE version of Vim (for example:\ngvim61ole.zip). This file also contains instructions on how to use Vim with\nVisual Studio.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help MSVisualStudio\\fR\n.SS \"33.11. Where do I place the _vimrc and _gvimrc files?\"\n.IX Subsection \"33.11. Where do I place the _vimrc and _gvimrc files?\"\nYou can place the _vimrc and _gvimrc files under the directory pointed to\nby the VIM environment variable. If you are sharing this system with other\nusers, then you can place the files in a directory and set the HOME\nenvironment variable to this directory.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help \\fR\\f(CB$HOME\\fR\\fB\\-use\\fR\n.PP\n\\&\\fB:help _vimrc\\fR\n.SS \"33.12. Every time I save a file, Vim warns about the file being changed outside of Vim. Why?\"\n.IX Subsection \"33.12. Every time I save a file, Vim warns about the file being changed outside of Vim. Why?\"\nIf you get the following warning message, every time you save a file:\n.PP\n.Vb 2\n\\& WARNING: The file has been changed since reading it!!!\n\\& Do you really want to write to it (y/n)?\n.Ve\n.PP\nthen this problem could be related to a bug in MS-Windows on the day\ndaylight saving time starts.  Vim remembers the timestamp of the file after\nit was written.  Just before the next write the timestamp is obtained again\nto check if the file was changed outside of Vim.  This works correctly,\nexcept on the day daylight saving time starts.\n.PP\nThis problem will go away the next day after the day the daylight saving\ntime starts.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help W11\\fR\n.SH PRINTING\n.IX Header \"PRINTING\"\n.SS \"34.1. How do I print a file along with line numbers for all the lines?\"\n.IX Subsection \"34.1. How do I print a file along with line numbers for all the lines?\"\nYou can set the 'printoptions' option and use the `:hardcopy` command to\nprint your file:\n.PP\n.Vb 2\n\\& :set printoptions=number:y\n\\& :hardcopy\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'printoptions'\\fR\n.PP\n\\&\\fB:help :hardcopy\\fR\n.SS \"34.2. How do I print a file with the Vim syntax highlighting colors?\"\n.IX Subsection \"34.2. How do I print a file with the Vim syntax highlighting colors?\"\nYou can use the `:hardcopy` command to print a file with the Vim syntax\nhighlighting colors. You can also convert your file to a HTML file using\nthe 2html.vim script and print the HTML file.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help syntax-printing\\fR\n.PP\n\\&\\fB:help 2html.vim\\fR\n.PP\n\\&\\fB:help :hardcopy\\fR\n.PP\n\\&\\fB:help printing\\fR\n.SH \"BUILDING VIM FROM SOURCE\"\n.IX Header \"BUILDING VIM FROM SOURCE\"\n.SS \"35.1. How do I build Vim from the sources on a Unix system?\"\n.IX Subsection \"35.1. How do I build Vim from the sources on a Unix system?\"\nFor a Unix system, follow these steps to build Vim from the sources:\n.PP\n\\&\\- Download the source from the git repository:\n  https://github.com/vim/vim/releases/\n\\&\\- Alternatively, download the source from the mercurial repository:\n  https://bitbucket.org/vim\\-mirror/vim/downloads/\n\\&\\- Run the \"make\" command to configure and build Vim with the default\n  configuration.\n\\&\\- Run \"make install\" command to install Vim in the default directory.\n.PP\nTo enable/disable various Vim features, before running the \"make\" command\nyou can run the \"configure\" command with different flags to include/exclude\nthe various Vim features. To list all the available options for the\n\"configure\" command, use:\n.PP\n.Vb 1\n\\& $ configure \\-\\-help\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help install\\fR\n.SS \"35.2. How do I install Vim in my home directory or a directory other than the default installation directory in Unix?\"\n.IX Subsection \"35.2. How do I install Vim in my home directory or a directory other than the default installation directory in Unix?\"\nTo install Vim in a directory other than the default installation\ndirectory, you have to specify the directory using the \\-\\-prefix option\nwhile running the configure script.\n.PP\n.Vb 1\n\\& $ ./configure \\-\\-prefix=/users/xyz\n.Ve\n.PP\nYou can enable/disable various Vim feature by supplying different arguments\nto the configure script. For more information about all these options, run:\n.PP\n.Vb 1\n\\& $ ./configure \\-\\-help\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help install-home\\fR\n.PP\n\\&\\fB:help install\\fR\n.SS \"35.3. How do I build Vim from the sources on a MS-Windows system?\"\n.IX Subsection \"35.3. How do I build Vim from the sources on a MS-Windows system?\"\nFor a MS-Windows system, Vim can be built using either the Visual C++\ncompiler or the Borland C++ compiler or the Ming GCC compiler or the cygwin\ngcc compiler. Follow these steps to build Vim from the sources for\nMS-Windows:\n \\- download the source from the git repository:\n   https://github.com/vim/vim/releases/\n \\- Depending on the installed compiler, you can use the corresponding\n   makefile to build the Vim sources. For Visual C++ use the\n   Make_mvc.mak makefile, for borland C++ use the Make_bc5.mak makefile,\n   for ming GCC use the Make_ming.mak makefile, for cygwin gcc use the\n   Make_cyg.mak makefile.\n.PP\nDepending on whether you want to build the GUI version of Vim or the\nconsole version of Vim, you have to pass different arguments to the\nmakefiles. After successfully building the sources, you can copy the\nvim.exe or gvim.exe file to the desired directory along with the files from\nthe runtime archive.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help install\\fR\n.SS \"35.4. The Vim help, syntax, indent files are missing from my Vim installation. How do I install these files?\"\n.IX Subsection \"35.4. The Vim help, syntax, indent files are missing from my Vim installation. How do I install these files?\"\nThe Vim help, syntax, indent and other runtime files are part of the Vim\nruntime package. You need to download and install the Vim runtime package.\nFor example, for MS-Windows, the name of the Vim 6.1 runtime package is\nvim61rt.zip.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help install\\fR\n.SS \"35.5. I have built Vim from the source and installed the Vim package using \"\"make install\"\". Do I need to keep the Vim source directory?\"\n.IX Subsection \"35.5. I have built Vim from the source and installed the Vim package using \"\"make install\"\". Do I need to keep the Vim source directory?\"\nNo. Once you have built and installed Vim in some directory other than the\noriginal source directory (for example, /usr/bin or /usr/local/bin), then\nyou can remove the source directory.\n.SS \"35.6. How do I determine the Vim features which are enabled at compile time?\"\n.IX Subsection \"35.6. How do I determine the Vim features which are enabled at compile time?\"\nYou can use the `:version` command to determine the Vim features that are\nenabled at compile time. The features that are enabled will be prefixed\nwith a \"+\". The features that are not enabled will be prefixed with a \"\\-\".\n.PP\nIf you want to test for a feature in a script, you can use the \\fBhas()\\fR\nfunction:\n.PP\n.Vb 3\n\\& if has(\"menu\")\n\\&     \" Set up some menus\n\\& endif\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :version\\fR\n.PP\n\\&\\fB:help +feature\\-list\\fR\n.PP\n\\&\\fB:help has()\\fR\n.SS \"35.7. Can I build Vim without the GUI support?\"\n.IX Subsection \"35.7. Can I build Vim without the GUI support?\"\nYes. You can build Vim by optionally enabling/disabling many of the\nfeatures including GUI.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help install\\fR\n.SS \"35.8. When building Vim on a Unix system, I am getting \"\"undefined reference to term_set_winsize\"\" error. How do I resolve this error?\"\n.IX Subsection \"35.8. When building Vim on a Unix system, I am getting \"\"undefined reference to term_set_winsize\"\" error. How do I resolve this error?\"\nYou will get this error when the build process is not able to locate the\ntermlib, termcap or ncurses library. You have to install the ncurses-dev\npackage to resolve this error.\n.SS \"35.9. Vim configure keeps complaining about the lack of gtk-config while trying to use GTK 2.03. This is correct, since in GTK 2 they moved to using the generic pkg-config. I can get pkg-config to list the various includes and libs for gtk, but for some reason the configure script still isn't picking this up.\"\n.IX Subsection \"35.9. Vim configure keeps complaining about the lack of gtk-config while trying to use GTK 2.03. This is correct, since in GTK 2 they moved to using the generic pkg-config. I can get pkg-config to list the various includes and libs for gtk, but for some reason the configure script still isn't picking this up.\"\nUse the following shell script named gtk-config:\n.PP\n.Vb 2\n\\& #!/bin/sh\n\\& pkg\\-config gtk+\\-2.0 $1 $2\n.Ve\n.SS \"35.10. I did successfully download the sources and compiled Vim on Unix. But feature ... still does not work. What is wrong and how can I fix it?\"\n.IX Subsection \"35.10. I did successfully download the sources and compiled Vim on Unix. But feature ... still does not work. What is wrong and how can I fix it?\"\nYou should first check, that you are actually running your self compiled\nVim and not the system's provided version. So first check your \\f(CW$PATH\\fR\nsetting.\n.PP\nDepending on your compile options, some features might not be included in\nyour build of Vim. You can use the `:version` command to determine the Vim\nfeatures that are enabled at compile time. The features that are enabled\nwill be prefixed with a \"+\". The features that are not enabled will be\nprefixed with a \"\\-\".\n.PP\nThe easiest way to include all features is to build the huge version. To do\nthis, you have to specify the \\-\\-with\\-features option while running the\nconfigure script:\n.PP\n.Vb 1\n\\& $ ./configure \\-\\-with\\-features=huge\n.Ve\n.PP\nNevertheless, a feature could still be disabled at compile time, if the\nconfigure script can't find the required libraries for those features (e.g.\nfor clipboard integration, your Vim needs to be linked against the X11\ndevelopment libraries).\n.PP\nThere are several ways to install the required libraries:\n.PP\n1) On a Debian based distribution, you can use the package manager \"apt\"\n   to install all required dependencies. As superuser, run the command:\n.PP\n.Vb 1\n\\&   $ apt\\-get build\\-dep vim\\-gtk\n\\&\n\\&   This makes sure all required libraries needed to compile the vim\\-gtk\n\\&   package will be installed. (This requires, that your sources list\n\\&   contains deb\\-src entries. See your distribution manual on how to\n\\&   enable this, if the above command did not work.)\n.Ve\n.PP\n2) In openSUSE you can use the package manager \"zypper\" to install all\n   required libraries. This requires, that there is a source version of\n   the package installable from a configured repository (which by\n   default is not the case). Use:\n.PP\n.Vb 1\n\\&   $ zypper search \\-t srcpackage vim\n\\&\n\\&   to find out, whether or not there exists a source version in the\n\\&   repository. If there is none, you\\*(Aqll need to add a source repository.\n\\&   For openSUSE 11.2 you could use, e.g.\n\\&\n\\&   $ zypper ar\n\\&   http://download.opensuse.org/source/distribution/11.2/repo/oss/src\\-11.2\n\\&\n\\&   (one line)\n\\&\n\\&   Once you have a source version available in your repositories, use\n\\&   this command to install all needed requirements:\n\\&\n\\&   $ zypper source\\-install \\-\\-build\\-deps\\-only vim\n.Ve\n.PP\n3) On a Fedora/RedHat based system, you can use\n.PP\n.Vb 1\n\\&   $ yum\\-builddep vim\\-enhanced\n.Ve\n.PP\n4) Run configure with your options and watch for missing libraries:\n.PP\n.Vb 1\n\\&   $ ./configure \\-\\-with\\-features=huge 2>&1 |tee logfile\n\\&\n\\&   This will run configure and record the output into the file \"logfile\".\n\\&   You need to check the logfile for missing dependencies. Consider this\n\\&   output:\n\\&\n\\& checking \\-\\-disable\\-gtktest argument... gtk test enabled\n\\& checking for pkg\\-config... /usr/bin/pkg\\-config\n\\& checking for GTK \\- version >= 2.2.0... no\n\\&\n\\& Here you can see, that the gtk libraries are missing and therefore\n\\& no GTK gui version can\\*(Aqt be build. So you need to install the GTK\n\\& library in your system, with your package manager or by compiling it\n\\& yourself. Then run the configure script again and check, that it\n\\& finds the library.\n.Ve\n.PP\nIn theory, those provided dependencies by your distribution might still\nlack some libraries, that are needed for features, that simply are not\nenabled in your distribution and therefore those commands in 1\\-3 won't\ninstall it. At the very least, this provides a jumping point and you need\nto track down the required missing packages using method 4 from above. But\nusually, this works good enough for most people and you won't have to\nbother with the fourth method.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :version\\fR\n.PP\n\\&\\fB:help +feature\\-list\\fR\n.SH VARIOUS\n.IX Header \"VARIOUS\"\n.SS \"36.1. How do I edit binary files with Vim?\"\n.IX Subsection \"36.1. How do I edit binary files with Vim?\"\nYou can set the following options to edit binary files in Vim:\n.PP\n.Vb 2\n\\& :set binary\n\\& :set display=uhex\n.Ve\n.PP\nYou can also use the \"\\-b\" command-line option to edit a binary file:\n.PP\n.Vb 1\n\\& $ vim \\-b <binary_file_name>\n.Ve\n.PP\nYou can also use the xxd utility (part of the Vim distribution) to edit\nbinary files.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 23.4\\fR\n.PP\n\\&\\fB:help edit-binary\\fR\n.PP\n\\&\\fB:help hex-editing\\fR\n.PP\n\\&\\fB:help \\-b\\fR\n.PP\n\\&\\fB:help 'binary'\\fR\n.PP\n\\&\\fB:help 'endofline'\\fR\n.PP\n\\&\\fB:help 'display'\\fR\n.SS \"36.2. How do I disable the visual error flash and the error beep?\"\n.IX Subsection \"36.2. How do I disable the visual error flash and the error beep?\"\nYou can disable both the visual error flash and the error beep using the\nfollowing command:\n.PP\n.Vb 1\n\\& :set visualbell t_vb=\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'visualbell'\\fR\n.PP\n\\&\\fB:help 'errorbells'\\fR\n.PP\n\\&\\fB:help t_vb\\fR\n.SS \"36.3. How do I display the ascii value of a character displayed in a buffer?\"\n.IX Subsection \"36.3. How do I display the ascii value of a character displayed in a buffer?\"\nYou can use the \"ga\" command to display the ascii value of a displayed\ncharacter.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help ga\\fR\n.PP\n\\&\\fB:help :ascii\\fR\n.SS \"36.4. Can I use zero as a count for a Vim command?\"\n.IX Subsection \"36.4. Can I use zero as a count for a Vim command?\"\nYou cannot use zero as a count for a Vim command, as \"0\" is a command on\nits own, moving to the first column of the line.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 0\\fR\n.PP\n\\&\\fB:help count\\fR\n.SS \"36.5. How do I disable the Vim welcome screen?\"\n.IX Subsection \"36.5. How do I disable the Vim welcome screen?\"\nYou can disable the Vim welcome screen, by adding the \"I\" flag to the\n\\&'shortmess' option:\n.PP\n.Vb 1\n\\& :set shortmess+=I\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :intro\\fR\n.PP\n\\&\\fB:help 'shortmess'\\fR\n.SS \"36.6. How do I avoid the \"\"hit enter to continue\"\" prompt?\"\n.IX Subsection \"36.6. How do I avoid the \"\"hit enter to continue\"\" prompt?\"\nVim will prompt you with the \"hit enter to continue\" prompt, if there are\nsome messages on the screen for you to read and the screen is about to be\nredrawn.  You can add the \"T\" flag to the 'shortmess' option to truncate\nall messages. This will help in avoiding the hit-enter prompt:\n.PP\n.Vb 1\n\\& :set shortmess+=T\n.Ve\n.PP\nYou can also increase the command height by setting the 'cmdheight' option:\n.PP\n.Vb 1\n\\& :set cmdheight=2\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help hit-enter\\fR\n.PP\n\\&\\fB:help avoid-hit-enter\\fR\n.PP\n\\&\\fB:help 'shortmess'\\fR\n.PP\n\\&\\fB:help 'cmdheight'\\fR\n.SS \"36.7. How do I invoke Vim from command line to run a group of commands on a group of files?\"\n.IX Subsection \"36.7. How do I invoke Vim from command line to run a group of commands on a group of files?\"\nThere are several ways to invoke Vim from command line to run a group of\ncommands on a group of files. You can use a set of  \"\\-c\" command line\noptions to specify a group of commands:\n.PP\n.Vb 1\n\\& $ vim \\-c \"<ex_command_1>\" \\-c \"<ex_command_2>\" *.txt\n.Ve\n.PP\nEach of the ex-command specified with the \"\\-c\" command line option is\nexecuted one by one sequentially. You can also use a single \"\\-c\" command\nline option and the \"|\" character to separate the ex commands:\n.PP\n.Vb 1\n\\& $ vim \\-c \"<ex_command_1> | <ex_command_2>\" *.txt\n.Ve\n.PP\nIn the above command, if an ex command fails, then all the remaining ex\ncommands will not be executed.\n.PP\nFor example, to replace \"ABC\" with \"DEF\" in a file from the command-line,\nyou can use the following command:\n.PP\n.Vb 1\n\\& $ vim \\-c \"%s/ABC/DEF/ge | update\" myfile.txt\n.Ve\n.PP\nTo replace \"ABC\" with \"DEF\" in multiple files from the command-line,\nyou can use the following command:\n.PP\n.Vb 1\n\\& $ vim \\-c \"argdo %s/ABC/DEF/ge | update\" *.txt\n.Ve\n.PP\nYou can store the group of commands into a file and use the \"\\-s\" command\nline option to run the commands on a set of files. For example, if the\ngroup of commands are stored in the file mycmds.txt, then you can use the\nfollowing command:\n.PP\n.Vb 1\n\\& $ vim \\-s mycmds.txt *.pl\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help \\-c\\fR\n.PP\n\\&\\fB:help \\-s\\fR\n.SS \"36.8. How do I use a normal mode command from insert mode without leaving the insert mode?\"\n.IX Subsection \"36.8. How do I use a normal mode command from insert mode without leaving the insert mode?\"\nYou can use a normal command from insert mode, without leaving the insert\nmode, by first pressing the CTRL-O key and then follow that with a single\nnormal mode command.\n.PP\nTo execute more than one normal mode command, press the CTRL-L key,\nfollowed by any number of normal mode commands and then press <Esc> to get\nback to the insert mode. (This only works, when the 'insertmode' option\nis set).\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help i_CTRL\\-O\\fR\n.PP\n\\&\\fB:help i_CTRL\\-L\\fR\n.SS \"36.9. How do I start Vim in insert mode?\"\n.IX Subsection \"36.9. How do I start Vim in insert mode?\"\nYou can start Vim in insert mode using the `:startinsert` ex command.\n.PP\n.Vb 1\n\\& $ vim +startinsert myfile.txt\n.Ve\n.PP\nThe above command will open the file \"myfile.txt\" and start insert mode\nwith the cursor in front of the first character on the first line.  To open\nthe file and start appending after the last character on the last line,\nyou can use the following command:\n.PP\n.Vb 1\n\\& $ vim + +startinsert! myfile.txt\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :startinsert\\fR\n.SS \"36.10. How do I use Copy and Paste with Vim?\"\n.IX Subsection \"36.10. How do I use Copy and Paste with Vim?\"\nYou should first check the output of the `:version` command and make\nsure that +xterm\\-clipboard is present.\n.PP\nWhen running Vim in an xterm, you can either let Vim control the mouse\nor let xterm control the mouse. This is configured by the 'mouse' option.\n.PP\nIf the 'mouse' option is not set (or set to the default value), then Vim will\nnot control the mouse. You cannot move the Vim text cursor using the\nmouse. When you select some text using the mouse, xterm will copy\nit to the X11 cut buffer. When you press both the mouse buttons,\nxterm will paste the text from the cut buffer.\n.PP\nIf the 'mouse' option is set to \"a\" or some other value, then Vim controls\nthe mouse. The mode (normal or insert or visual, etc) in which Vim\ncontrols the mouse is configured by the 'mouse' option. You can move\nthe Vim text cursor using the mouse. When you select some text,\nthe 'clipboard' option setting is used to determine whether to transfer\nthe selected text to the clipboard or not. The default setting is to\ntransfer the selected text to the clipboard. If you want to use the\nxterm selection mechanism in this mode, then you can press the\n<Shift> key. If you press <Shift> key when selecting text using the\nmouse, then Vim doesn't control the mouse and xterm controls the\nmouse.\n.PP\nIn the GUI mode, Copy and Paste should just work, depending on the 'mouse'\nsetting. For more information, read:\n.PP\n\\&\\fB:help 'clipboard'\\fR\n.PP\n\\&\\fB:help x11\\-selection\\fR\n.PP\n\\&\\fB:help clipboard\\fR\n.PP\n\\&\\fB:help 'go\\-a'\\fR\n.PP\n\\&\\fB:help 'mouse'\\fR\n.PP\n\\&\\fB:help xterm-copy-paste\\fR\n.PP\n\\&\\fB:help 09.3\\fR\n.SS \"36.11. Why shouldn't I modify the files in the system runtime directory?\"\n.IX Subsection \"36.11. Why shouldn't I modify the files in the system runtime directory?\"\nJust be careful about modifying files under \\f(CW$VIMRUNTIME\\fR, which usually\nis /usr/share/vim/vimXX (Unix) or C:\\eProgram Files\\evim\\evimXX\n(Windows) and XX being the version for which it applies, e.g. 73 for Vim\n=head2 7.3.\n.PP\nOne should generally avoid modifying those files because they may be\nreplaced during an upgrade of your Vim installation and your changes\nwill be lost.  Also, if you upgrade to a new major or minor revision of\nVim (e.g., from 7.3 to 7.4), the new version of Vim will use a different\n\\&\\f(CW$VIMRUNTIME\\fR directory and while your changes won't be lost, they will be\nignored.\n.PP\nConsequently, take a look at\n.PP\n\\&\\fB:help filetypes\\fR\n.PP\nfor an explanation of several ways to modify Vim's response to\ndifferent filetypes and where to put those modifications so that\nthey will not be overwritten.\n.SH UNICODE\n.IX Header \"UNICODE\"\nAuthor: Tony Mechelynck <antoine.mechelynck AT belgacom.net>\n.SS \"37.1. Is it possible to create Unicode files using Vim?\"\n.IX Subsection \"37.1. Is it possible to create Unicode files using Vim?\"\nYes. It may be more or less complicated depending on the keyboard and fonts\navailable to you, but it is always possible to encode any possible Unicode\ncodepoint (and some illegal ones) into a file. To create a Unicode file\nusing Vim, you should have compiled Vim with the \"+multi_byte\" compile-time\noption.  You can get more information about Unicode from the following\nsites:\n.PP\n.Vb 2\n\\& http://www.unicode.org\n\\& https://www.cl.cam.ac.uk/~mgk25/unicode.html\n.Ve\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help multibyte\\fR\n.PP\n\\&\\fB:help usr_45.txt\\fR\n.SS \"37.2. Which Vim settings are particularly important for editing Unicode files?\"\n.IX Subsection \"37.2. Which Vim settings are particularly important for editing Unicode files?\"\nThe most important are the various \"encoding\" options, i.e., 'encoding',\n\\&'fileencoding', 'fileencodings' and 'termencoding'. The boolean option\n\\&'bomb' is also significant.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'encoding'\\fR\n.PP\n\\&\\fB:help 'fileencoding'\\fR\n.PP\n\\&\\fB:help 'fileencodings'\\fR\n.PP\n\\&\\fB:help 'termencoding'\\fR\n.PP\n\\&\\fB:help 'bomb'\\fR\n.SS \"37.3. What is the 'encoding' option?\"\n.IX Subsection \"37.3. What is the 'encoding' option?\"\nBasically, the 'encoding' option defines how Vim will represent your data\ninternally.  However, all Unicode encodings are represented internally as\nutf\\-8 and converted (if necessary) when reading and writing.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'encoding'\\fR\n.SS \"37.4. How does Vim name the various Unicode encodings?\"\n.IX Subsection \"37.4. How does Vim name the various Unicode encodings?\"\nUtf\\-8 is called utf\\-8 or utf8; utf\\-16 is called ucs\\-2 or ucs2; utf\\-32 is\ncalled ucs\\-4 or ucs4. Also, you may specify endianness (except for utf\\-8\nwhich does not vary for endianness) by appending le for little-endian or be\nfor big-endian. If you create a file with an encoding of ucs\\-2 or ucs\\-4\nwithout specifying endianness, Vim will use what is typical of your\nmachine.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help encoding-names\\fR\n.PP\n\\&\\fB:help encoding-values\\fR\n.PP\n\\&\\fB:help encoding-table\\fR\n.SS \"37.5. How does Vim specify the presence or absence of a byte-order mark?\"\n.IX Subsection \"37.5. How does Vim specify the presence or absence of a byte-order mark?\"\nWhen reading a file, if the 'fileencodings' option includes \"ucs-bom\", Vim\nwill check for a byte-order mark. When writing a file, if the 'bomb' option\nis set, Vim will write a byte-order mark on files whose encoding warrants\nit.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'fileencodings'\\fR\n.PP\n\\&\\fB:help 'bomb'\\fR\n.SS \"37.6. What is the 'fileencoding' option?\"\n.IX Subsection \"37.6. What is the 'fileencoding' option?\"\nThe 'fileencoding' option defines the particular encoding which Vim will\nuse to write a file. If empty, then the value of the 'encoding' option is\nthe default.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'fileencoding'\\fR\n.SS \"37.7. What is the 'fileencodings' option?\"\n.IX Subsection \"37.7. What is the 'fileencodings' option?\"\nThe 'fileencodings' option defines the heuristics used by Vim when opening\nan existing file. It is a comma separated list of encodings. A special\nname, \"ucs-bom\" is used to indicate that Vim should check for the presence\nof a byte-order mark; however, it will not be recognised if it comes after\n\"utf\\-8\".  Normally, \"ucs-bom\" (if present) should be first in the list.\n.PP\nWhen Vim opens a file, it checks it against the encodings listed in\n\\&'fileencodings'. The first one that matches is used. If there is no match,\nthen Vim sets 'fileencoding' to the null string, i.e., the value of\n\\&'encoding' will be used.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'fileencodings'\\fR\n.PP\n\\&\\fB:help 'encoding'\\fR\n.SS \"37.8. What is the 'termencoding' option?\"\n.IX Subsection \"37.8. What is the 'termencoding' option?\"\nThe 'termencoding' option defines how your keyboard encodes the data you\ntype.  If empty, Vim assumes that it has the same value as 'encoding'.\nUsually it should be set to something that matches your locale.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'termencoding'\\fR\n.PP\n\\&\\fB:help locale\\fR\n.SS \"37.9. What is the 'bomb' option?\"\n.IX Subsection \"37.9. What is the 'bomb' option?\"\nWhen reading a file with \"ucs-bom\" present in the 'fileencodings' option,\nVim will set the 'bomb' option on or off depending on the presence or\nabsence of a byte-order mark at the start of the file. When writing, Vim\nwill write a byte-order mark if the 'bomb' option is set. You may set or\nunset it manually do make Vim write, or not write, the b.o.m.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help 'bomb'\\fR\n.SS \"37.10. Where can I find an example of a typical use of all these options?\"\n.IX Subsection \"37.10. Where can I find an example of a typical use of all these options?\"\nThere is a \"tip\", with explains them in different words with an example, at\n.PP\n.Vb 1\n\\& http://vim.wikia.com/wiki/VimTip246\n.Ve\n.SS \"37.11. How can I insert Unicode characters into a file using Vim?\"\n.IX Subsection \"37.11. How can I insert Unicode characters into a file using Vim?\"\nSeveral methods are available:\n.PP\n\\&\\- Characters present on your keyboard can be typed in the usual way, even\n  those which require a \"dead-key\" prefix, like (for instance) the\n  circumflex on French keyboards.\n\\&\\- Characters for which a digraph is defined can be typed as two characters\n  prefixed by CTRL-K.\n\\&\\- If you have set the 'digraph' option, you can enter the characters for\n  which a digraph is defined as <char1><BS><char2>.\n\\&\\- Any character can be entered by using a CTRL-V prefix (or CTRL-Q if\n  CTRL-V is remapped to paste from the clipboard).\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help digraphs\\fR\n.PP\n\\&\\fB:help 'digraph'\\fR\n.PP\n\\&\\fB:help i_CTRL\\-V_digit\\fR\n.SS \"37.12. How can I know which digraphs are defined and for which characters?\"\n.IX Subsection \"37.12. How can I know which digraphs are defined and for which characters?\"\nFirst set the 'encoding' option properly (for instance, to utf\\-8), then use\nthe `:digraphs` command to list the currently defined digraphs.\n.PP\nAlternatively, the help file contains the complete set of all digraphs.\nSo you can easily search that list there.\n.PP\nFor more information, read:\n.PP\n\\&\\fB:help :digraphs\\fR\n.PP\n\\&\\fB:help 'encoding'\\fR\n.PP\n\\&\\fB:help digraph-table\\fR\n.SH AUTHOR\n.IX Header \"AUTHOR\"\nCurrent Maintainer: Christian Brabandt <cb@256bit.org>\n.PP\nLast updated on: 11 October 2025\n"
  },
  {
    "path": "others/vim_faq.ansi",
    "content": "\u001b[1mDESCRIPTION\u001b[0m\n    This Vim FAQ is created from the questions and answers posted to the\n    vim@vim.org user mailing list and the comp.editors newsgroup. There are\n    several ways to solve a problem in Vim. This FAQ gives one of those\n    several possibilities. You can explore the other ways using the\n    information and links given in this FAQ. The credit for the answers in\n    this FAQ goes to Peppe, Benji, Charles Campbell and numerous others. An\n    online version of this FAQ is available at\n    https://vimhelp.org/vim_faq.txt.html\n\n\u001b[1mGENERAL INFORMATION\u001b[0m\n     1.1. What is Vim?\n     1.2. Who wrote Vim?\n     1.3. Is Vim compatible with Vi?\n     1.4. What are some of the improvements of Vim over Vi?\n     1.5. Is Vim free?\n\n\u001b[1mRESOURCES\u001b[0m\n     2.1. Where can I learn more about Vim?\n     2.2. Is there a mailing list available?\n     2.3. Is there an archive available for the Vim mailing lists?\n     2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\n     2.5. I have a \"xyz\" (some) problem with Vim. How do I determine if it is\n          a problem with my setup or with Vim?\n     2.6. Where can I report bugs?\n     2.7. Where can the FAQ be found?\n     2.8. What if I don't find an answer in this FAQ?\n     2.9. I have a patch for implementing a Vim feature. Where do I send the\n          patch?\n     2.10. I have a Vim tip or developed a new Vim\n           syntax/indent/filetype/compiler plugin or developed a new script\n           or a colorscheme. Is there a public website where I can upload\n           this?\n\n\u001b[1mAVAILABILITY\u001b[0m\n     3.1. What is the latest version of Vim?\n     3.2. Where can I find the latest version of Vim?\n     3.3. What platforms does it run on?\n     3.4. Where can I download the latest version of the Vim runtime files?\n\n\u001b[1mHELP\u001b[0m\n     4.1. How do I use the help files?\n     4.2. How do I search for a keyword in the Vim help files?\n     4.3. I am getting an error message E123, what did I do wrong?\n     4.4. Where can I read about the various modes in Vim?\n     4.5. How do I generate the Vim help tags file after adding a new Vim\n          help file?\n     4.6. Can I use compressed versions of the help files?\n\n\u001b[1mEDITING A FILE\u001b[0m\n     5.1. How do I load a file in Vim for editing?\n     5.2. How do I save the current file in another name (save as) and edit\n          a new file?\n     5.3. How do I change the current directory to the directory of the\n          current file?\n     5.4. How do I write a file without the line feed (EOL) at the end of\n          the file?\n     5.5. How do I configure Vim to open a file at the last edited location?\n     5.6. When editing a file in Vim, which is being changed by an external\n          application, Vim opens a warning window (like the confirm dialog)\n          each time a change is detected. How do I disable this warning?\n     5.7. How do I edit a file whose name is under the cursor?\n     5.8. How do I reload/re-edit the current file?\n     5.9. How do I autosave a file periodically?\n     5.10. How do I open a file in read-only mode?\n     5.11. How do I open a file for editing without saving the modifications\n           to the current file?\n     5.12. How do I reduce the loading time for very large files in Vim?\n\n\u001b[1mEDITING MULTIPLE FILES\u001b[0m\n     6.1. How do I open multiple files at once from within Vim?\n     6.2. How do I switch between multiple files/buffers in Vim?\n     6.3. How do I open several files in Vim, with each file in a separate\n          window/tabpage?\n     6.4. How do I configure Vim to autoload several files at once similar\n          to \"work-sets\" or \"projects\"?\n     6.5. Is it possible to open multiple top level windows in a single\n          instance of Vim similar to Nedit or emacs?\n     6.6. How do I browse/explore directories from within Vim?\n     6.7. How do I edit files over a network using ftp/scp/rcp/http?\n\n\u001b[1mBACKUP\u001b[0m\n     7.1. When I edit and save files, Vim creates a file with the same name\n          as the original file and a \"~\" character at the end. How do I stop\n          Vim from creating this file (or) How do I disable the Vim backup\n          file feature?\n     7.2. When I edit and save files, Vim creates a file with the same name\n          as the original file and a \".un~\" extension at the end. How do I\n          stop Vim from creating this file (or) How do I disable the Vim\n          undofile feature.\n     7.3. How do I configure Vim to store all the backup files in a\n          particular directory?\n     7.4. When I save a file with Vim, the file permissions are changed.\n          How do I configure Vim to save a file without changing the file\n          permissions?\n\n\u001b[1mBUFFERS\u001b[0m\n     8.1. I have made some modifications to a buffer. How do I edit another\n          buffer without saving the modified buffer and also without losing\n          the modifications?\n     8.2. How do I configure Vim to auto-save a modified buffer when\n          switching to another buffer?\n     8.3. How do I replace the buffer in the current window with a blank\n          buffer?\n     8.4. Is there a keyboard shortcut to load a buffer by the buffer\n          number?\n     8.5. How do I open all the current buffers in separate windows?\n     8.6. How do I close (delete) a buffer without exiting Vim?\n     8.7. When I use the command `:%bd` to delete all the buffers, not all\n          the buffers are deleted. Why?\n     8.8. How do I display the buffer number of the current buffer/file?\n     8.9. How do I delete a buffer without closing the window in which the\n          buffer is displayed?\n     8.10. How do I map the <Tab> key to cycle through and open all the\n           buffers?\n\n\u001b[1mWINDOWS\u001b[0m\n     9.1. What is the difference between a Vim window and a buffer?\n     9.2. How do I increase the width of a Vim window?\n     9.3. How do I zoom into or out of a window?\n     9.4. How do I execute an ex command on all the open buffers or open\n          windows or all the files in the argument list?\n\n\u001b[1mMOTION\u001b[0m\n     10.1. How do I jump to the beginning (first line) or end (last line) of\n           a file?\n     10.2. In insert mode, when I press the <Esc> key to go to command mode,\n           the cursor moves one character to the left (except when the\n           cursor is on the first character of the line). Is it possible to\n           change this behavior to keep the cursor at the same column?\n     10.3. How do I configure Vim to maintain the horizontal cursor position\n           when scrolling with the <Page Up>, <Page Down>, etc keys?\n     10.4. Some lines in a file are more than the screen width and they are\n           all wrapped. When I use the j, k keys to move from one line to\n           the next, the cursor is moved to the next line in the file\n           instead of the next line on the screen. How do I move from one\n           screen line to the next?\n     10.5. What is the definition of a sentence, paragraph and section in\n           Vim?\n     10.6. How do I jump to beginning or end of a sentence, paragraph or a\n           section?\n     10.7. I have lines in a file that extends beyond the right extent of the\n           screen. How do I move the Vim view to the right to see the text\n           off the screen?\n     10.8. How do I scroll two or more buffers simultaneously?\n     10.9. When I use my arrow keys, Vim changes modes, inserts weird\n           characters in my document but doesn't move the cursor properly.\n           What's going on?\n     10.10. How do I configure Vim to move the cursor to the end of the\n            previous line, when the left arrow key is pressed and the cursor\n            is currently at the beginning of a line?\n     10.11. How do I configure Vim to stay only in insert mode (modeless\n            editing)?\n     10.12. How do I display some context lines when scrolling text?\n     10.13. How do I go back to previous cursor locations?\n\n\u001b[1mSEARCHING TEXT\u001b[0m\n     11.1. After I searched for a text with a pattern, all the matched text\n           stays highlighted. How do I turn off the highlighting\n           temporarily/permanently?\n     11.2. How do I enter a carriage return character in a search pattern?\n     11.3. How do I search for the character \"^M\"?\n     11.4. How can I search/replace characters that display as \"~R\", \"~S\",\n           etc.?\n     11.5. How do I highlight all the non-printable characters in a file?\n     11.6. How do I search for whole words in a file?\n     11.7. How do I search for the current word under the cursor?\n     11.8. How do I search for a word without regard to the case (uppercase\n           or lowercase)?\n     11.9. How do I search for words that occur twice consecutively?\n     11.10. How do I count the number of times a particular word occurs in a\n            buffer?\n     11.11. How do I place the cursor at the end of the matched word when\n            searching for a pattern?\n     11.12. How do I search for an empty line?\n     11.13. How do I search for a line containing only a single character?\n     11.14. How do I search and replace a string in multiple files?\n     11.15. I am using the `:s` substitute command in a mapping. When a\n            search for a pattern fails, the map terminates. I would like the\n            map to continue processing the next command, even if the\n            substitute command fails. How do I do this?\n     11.16. How do I search for the n-th occurrence of a character in a\n            line?\n     11.17. How do I replace a tab (or any other character) with a hard\n            return (newline) character?\n     11.18. How do I search for a character by its ASCII value?\n     11.19. How do I search for long lines?\n     11.20. How do I display all the lines in the current buffer that\n            contain a specified pattern?\n     11.21. How do I search for a text string that spans multiple lines?\n     11.22. How do I search for a pattern only within a range of lines\n            in a buffer?\n     11.23. How do I clear the last searched pattern?\n     11.24. Why does this pattern \"a.\\{-}p\\@!\" not match?\n     11.25. How can I use \"/\" within a pattern, without escaping it?\n     11.26. How can I operate on a search match?\n\n\u001b[1mCHANGING TEXT\u001b[0m\n     12.1. How do I delete all the trailing white space characters (SPACE\n           and TAB) at the end of all the lines in a file?\n     12.2. How do I replace all the occurrences of multiple consecutive\n           space characters to a single space?\n     12.3. How do I reduce a range of empty lines into one line only?\n     12.4. How do I delete all blank lines in a file? How do I remove all\n           the lines containing only space characters?\n     12.5. How do I copy/yank the current word?\n     12.6. How do I yank text from one position to another position within a\n           line, without yanking the entire line?\n     12.7. When I yank some text into a register, how do I append the text\n           to the current contents of the register?\n     12.8. How do I yank a complete sentence that spans over more than one\n           line?\n     12.9. How do I yank all the lines containing a pattern into a buffer?\n     12.10. How do I delete all the lines in a file that do not contain a\n            pattern?\n     12.11. How do I add a line before each line with \"pattern\" in it?\n     12.12. Is there a way to operate on a line if the previous line\n            contains a particular pattern?\n     12.13. How do I execute a command on all the lines containing a\n            pattern?\n     12.14. Can I copy the character above the cursor to the current cursor\n            position?\n     12.15. How do I insert a blank line above/below the current line\n            without entering insert mode?\n     12.16. How do I insert the name of the current file into the current\n            buffer?\n     12.17. How do I insert the contents of a Vim register into the current\n            buffer?\n     12.18. How do I move the cursor past the end of line and insert some\n            characters at some columns after the end of the line?\n     12.19. How to replace the word under the cursor (say: junk) with\n            \"foojunkbar\" in Vim?\n     12.20. How do I replace a particular text in all the files in a\n            directory?\n     12.21. I have some numbers in a file. How do I increment or decrement\n            the numbers in the file?\n     12.22. How do I reuse the last used search pattern in a `:substitute`\n            command?\n     12.23. How do I change the case of a string using the `:substitute`\n            command?\n     12.24. How do I enter characters that are not present in the keyboard?\n     12.25. Is there a command to remove any or all digraphs?\n     12.26. In insert mode, when I press the backspace key, it erases only\n            the characters entered in this instance of insert mode. How do I\n            erase previously entered characters in insert mode using the\n            backspace key?\n     12.27. I have a file which has lines longer than 72 characters\n            terminated with \"+\" and wrapped to the next line. How can I\n            quickly join the lines?\n     12.28. How do I paste characterwise yanked text into separate lines?\n     12.29. How do I change the case (uppercase, lowercase) of a word or\n            a character or a block of text?\n     12.30. How do I enter ASCII characters that are not present in the\n            keyboard?\n     12.31. How do I replace non-printable characters in a file?\n     12.32. How do I remove duplicate lines from a buffer?\n     12.33. How do I prefix all the lines in a file with the corresponding\n            line numbers?\n     12.34. How do I exchange (swap) two characters or words or lines?\n     12.35. How do I change the characters used as word delimiters?\n\n\u001b[1mCOMPLETION IN INSERT MODE\u001b[0m\n     13.1. How do I complete words or lines in insert mode?\n     13.2. How do I complete file names in insert mode?\n     13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do\n           I complete words that occur after the just completed word?\n\n\u001b[1mTEXT FORMATTING\u001b[0m\n     14.1. How do I format a text paragraph so that a new line is inserted\n           at the end of each wrapped line?\n     14.2. How do I format long lines in a file so that each line contains\n           less than \"n\" characters?\n     14.3. How do I join short lines to the form a paragraph?\n     14.4. How do I format bulleted and numbered lists?\n     14.5. How do I indent lines in insert mode?\n     14.6. How do I format/indent an entire file?\n     14.7. How do I increase or decrease the indentation of the current\n           line?\n     14.8. How do I indent a block/group of lines?\n     14.9. When I indent lines using the > or < key, the standard 8-tabstops\n           are used instead of the current 'tabstop' setting. Why?\n     14.10. How do I turn off the automatic indentation of text?\n     14.11. How do I configure Vim to automatically set the 'textwidth'\n            option to a particular value when I edit mails?\n     14.12. Is there a way to make Vim auto-magically break lines?\n     14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n            'fileformat' option to 'dos' and then 'unix' and then 'mac'.\n            None of these helped. How can I hide these symbols?\n     14.14. When I paste some text into a Vim buffer from another\n            application, the alignment (indentation) of the new text is\n            messed up. How do I fix this?\n     14.15. When there is a very long wrapped line (wrap is \"on\") and a line\n            doesn't fit entirely on the screen it is not displayed at all.\n            There are blank lines beginning with \"@\" symbol instead of\n            wrapped line. If I scroll the screen to fit the line the \"@\"\n            symbols disappear and the line is displayed again. What Vim\n            setting control this behavior?\n     14.16. How do I convert all the tab characters in a file to space\n            characters?\n     14.17. What Vim options can I use to edit text that will later go to a\n            word processor?\n     14.18. How do I join lines without adding or removing any space\n            characters?\n\n\u001b[1mVISUAL MODE\u001b[0m\n     15.1. How do I do rectangular block copying?\n     15.2. How do I delete or change a column of text in a file?\n     15.3. How do I apply an ex-command on a set of visually selected lines?\n     15.4. How do I execute an ex command on a column of text selected in\n           Visual block mode?\n     15.5. How do I select the entire file in visual mode?\n     15.6. When I visually select a set of lines and press the > key to\n           indent the selected lines, the visual mode ends. How can I\n           reselect the region for further operation?  (or) How do I\n           re-select the last selected visual area again?\n     15.7. How do I jump to the beginning/end of a visually selected region?\n     15.8. When I select text with mouse and then press : to enter an ex\n           command, the selected text is replaced with the : character. How\n           do I execute an ex command on a text selected using the mouse\n           similar to the text selected using the visual mode?\n     15.9. When I select a block of text using the mouse, Vim goes into\n           selection mode instead of Visual mode. Why?\n\n\u001b[1mCOMMAND-LINE MODE\u001b[0m\n     16.1. How do I use the name of the current file in the command mode or\n           an ex command line?\n     16.2. How do I edit the text in the Vim command-line effectively?\n     16.3. How do I switch from Vi mode to Ex mode?\n     16.4. How do I copy the output from an ex-command into a buffer?\n     16.5. When I press the <Tab> key to complete the name of a file in the\n           command mode, if there are more than one matching file names,\n           then Vim completes the first matching file name and displays a\n           list of all matching filenames. How do I configure Vim to only\n           display the list of all the matching filenames and not complete\n           the first one?\n     16.6. How do I copy text from a buffer to the command line and from the\n           command line to a buffer?\n     16.7. How do I put a command onto the command history without executing\n           it?\n     16.8. How do I increase the height of the command-line?\n\n\u001b[1mVIMINFO\u001b[0m\n     17.1. When I invoke Vim, I get error messages about illegal characters\n           in the viminfo file. What should I do to get rid of these\n           messages?\n     17.2. How do I disable the viminfo feature?\n     17.3. How do I save and use Vim marks/commands across Vim sessions?\n\n\u001b[1mREMOTE EDITING\u001b[0m\n     18.1. How do I open a file with existing instance of gvim? What\n           happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n     18.2. How do I send a command to a Vim server to write all buffers to\n           disk?\n     18.3. Where can I get the documentation about the Vim remote server\n           functionality?\n\n\u001b[1mOPTIONS\u001b[0m\n     19.1. How do I configure Vim in a simple way?\n     19.2. How do I toggle the value of an option?\n     19.3. How do I set an option that affects only the current\n           buffer/window?\n     19.4. How do I use space characters for a Vim option value?\n     19.5. Can I add (embed) Vim option settings to the contents of a file?\n     19.6. How do I display the line numbers of all the lines in a file?\n     19.7. How do I change the width of the line numbers displayed using the\n           'number' option?\n     19.8. How do I display (view) all the invisible characters like space,\n           tabs and newlines in a file?\n     19.9. How do I configure Vim to always display the current line and\n           column number?\n     19.10. How do I display the current Vim mode?\n     19.11. How do I configure Vim to show pending/partial commands on the\n            status line?\n     19.12. How do I configure the Vim status line to display different\n            settings/values?\n     19.13. How do I configure Vim to display status line always?\n     19.14. How do I make a Vim setting persistent across different Vim\n            invocations/instances/sessions?\n     19.15. Why do I hear a beep (why does my window flash) about 1 second\n            after I hit the Escape key?\n     19.16. How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n            deleting the characters I'm changing?\n     19.17. How do I remove more than one flag using a single `:set` command\n            from a Vim option?\n\n\u001b[1mMAPPING KEYS\u001b[0m\n     20.1. How do I know what a key is mapped to?\n     20.2. How do I list all the user-defined key mappings?\n     20.3. How do I unmap a key?\n     20.4. I am not able to create a mapping for the <xxx> key. What is\n           wrong?\n     20.5. Why does mapping the <C-...> key not work?\n     20.6. How do I map the numeric keypad keys?\n     20.7. How do I create a mapping that works only in visual mode?\n     20.8. How do I create a mapping that works only in normal and operator\n           pending mode (but not in visual mode)?\n     20.9. In a Vim script, how do I know which keys to use for my mappings,\n           so that the mapped key will not collide with an already used key?\n     20.10. How do I map the escape key?\n     20.11. How do I map a key to perform nothing?\n     20.12. I want to use the <Tab> key to indent a block of text and\n            <Shift-Tab> key to unindent a block of text. How do I map the keys\n            to do this?  This behavior is similar to textpad, visual studio,\n            etc.\n     20.13. In my mappings the special characters like <CR> are not\n            recognized. How can I configure Vim to recognize special\n            characters?\n     20.14. How do I use the \"|\" to separate multiple commands in a map?\n     20.15. If I have a mapping/abbreviation whose ending is the beginning of\n            another mapping/abbreviation, how do I keep the first from\n            expanding into the second one?\n     20.16. Why does it take a second or more for Vim to process a key,\n            sometimes when I press a key?\n     20.17. How do I map a key to run an external command using a visually\n            selected text?\n     20.18. How do I map the CTRL-I key while still retaining the\n            functionality of the <Tab> key?\n     20.19. How do I define a map to accept a count?\n     20.20. How can I make my normal mode mapping work from within Insert\n            Mode?\n\n\u001b[1mABBREVIATIONS\u001b[0m\n     21.1. How do I auto correct misspelled words?\n     21.2. How do I create multi-line abbreviations?\n     21.3. When my abbreviations are expanded, an additional space character\n           is added at the end of the expanded text. How do I avoid this\n           character?\n     21.4. How do I insert the current date/time stamp into the file?\n     21.5. How do I prevent an abbreviation from expanding in insert mode?\n\n\u001b[1mRECORD AND PLAYBACK\u001b[0m\n     22.1. How do I repeat an editing operation (insertion, deletion, paste,\n           etc)?\n     22.2. How I record and repeat a set of key sequences?\n     22.3. How do I edit/modify a recorded set of key sequences?\n     22.4. How do I write recorded key sequences to a file?\n     22.5. I am using register 0 to record my key sequences (i.e. q0 ....\n           q). In the recorded key sequences, I am yanking some text.  After\n           the first replay of the recorded key sequence, I am no longer\n           able to play it back.\n\n\u001b[1mAUTOCOMMANDS\u001b[0m\n     23.1. How do I execute a command when I try to modify a read-only file?\n     23.2. How do I execute a command every time when entering a buffer?\n     23.3. How do I execute a command every time when entering a window?\n     23.4. From an autocmd, how can I determine the name of the file or the\n           buffer number for which the autocommand is executed?\n     23.5. How do I automatically save all the changed buffers whenever Vim\n           loses focus?\n     23.6. How do I execute/run a function when Vim exits to do some\n           cleanup?\n\n\u001b[1mSYNTAX HIGHLIGHT\u001b[0m\n     24.1. How do I turn off/on syntax highlighting?\n     24.2. How do I change the background and foreground colors used by Vim?\n     24.3. How do I change the highlight colors to suit a dark/light\n           background?\n     24.4. How do I change the color of the line numbers displayed when the\n           `:set number` command is used?\n     24.5. How do I change the background color used for a Visually selected\n           block?\n     24.6. How do I highlight the special characters (tabs, trailing spaces,\n           end of line, etc) displayed by the 'list' option?\n     24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that\n           Vim uses the specified colorscheme every time?\n     24.8. Vim syntax highlighting is broken. When I am editing a file, some\n           parts of the file is not syntax highlighted or syntax highlighted\n           incorrectly.\n     24.9. Is there a built-in function to syntax-highlight the\n           corresponding matching bracket?\n     24.10. How do I turn off the C comment syntax highlighting?\n     24.11. How do I add my own syntax extensions to the standard syntax\n            files supplied with Vim?\n     24.12. How do I replace a standard syntax file that comes with the Vim\n            distribution with my own syntax file?\n     24.13. How do I highlight all the characters after a particular column?\n     24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n            highlighting into a HTML file?\n     24.15. How do I list the definition of all the current highlight\n            groups?\n     24.16. How can I embed one syntax highlighting language into another\n            one?\n\n\u001b[1mVIM SCRIPT WRITING\u001b[0m\n     25.1. How do I list the names of all the scripts sourced by Vim?\n     25.2. How do I debug Vim scripts?\n     25.3. How do I locate the script/plugin which sets a Vim option?\n     25.4. I am getting some error/informational messages from Vim (possibly\n           when running a script), the messages are cleared immediately. How\n           do I display the messages again?\n     25.5. How do I save and restore a plugin specific information across\n           Vim invocations?\n     25.6. How do I start insert mode from a Vim function?\n     25.7. How do I change the cursor position from within a Vim function?\n     25.8. How do I check the value of an environment variable in the .vimrc\n           file?\n     25.9. How do I check whether an environment variable is set or not from\n           a Vim function?\n     25.10. How do I call/use the Vim built-in functions?\n     25.11. I am using some normal mode commands in my Vim script. How do I\n            avoid using the user-defined mappings for these normal mode\n            commands and use the standard Vim functionality for these normal\n            mode commands?\n     25.12. How do I get a visually selected text into a Vim variable or\n            register?\n     25.13. I have some text in a Vim variable \"myvar\". I would like to use\n            this variable in a `:s` substitute command to replace a text\n            \"mytext\". How do I do this?\n     25.14. A Vim variable (bno) contains a buffer number. How do I use this\n            variable to open the corresponding buffer?\n     25.15. How do I store the value of a Vim option into a Vim variable?\n     25.16. I have copied and inserted some text into a buffer from a Vim\n            function. How do I indent the inserted text from the Vim\n            function?\n     25.17. How do I get the character under the cursor from a Vim script?\n     25.18. How do I get the name of the current file without the extension?\n     25.19. How do I get the basename of the current file?\n     25.20. How do I get the output from a Vim function into the current\n            buffer?\n     25.21. How do I call external programs from a Vim function?\n     25.22. How do I get the return status of a program executed using the\n            `:!` command?\n     25.23. How do I determine whether the current buffer is modified or\n            not?\n     25.24. I would like to use the carriage return character in a normal\n            command from a Vim script. How do I specify the carriage return\n            character?\n     25.25. How do I split long lines in a Vim script?\n     25.26. When I try to \"execute\" my function using the `:execute Myfunc()`\n            command, the cursor is moved to the top of the current buffer.\n            Why?\n     25.27. How do I source/execute the contents of a register?\n     25.28. After calling a Vim function or a mapping, when I press the \"u\"\n            key to undo the last change, Vim undoes all the changes made by\n            the mapping/function. Why?\n     25.29. How can I call a function defined with s: (script local\n            function) from another script/plugin?\n     25.30. Is it possible to un-source a sourced script? In other words,\n            reverse all the commands executed by sourcing a script.\n\n\u001b[1mPLUGINS\u001b[0m\n     26.1. How do I set different options for different types of files?\n     26.2. I have downloaded a Vim plugin or a syntax file or a indent file,\n           or a color scheme or a filetype plugin from the web. Where should\n           I copy these files so that Vim will find them?\n     26.3. How do I extend an existing filetype plugin?\n     26.4. How do I turn off loading the Vim plugins?\n     26.5. How do I turn on/off loading the filetype plugins?\n     26.6. How do I override settings made in a file type plugin in the\n           global ftplugin directory for all the file types?\n     26.7. How do I disable the Vim directory browser plugin?\n     26.8. How do I set the filetype option for files with names matching a\n           particular pattern or depending on the file extension?\n\n\u001b[1mEDITING PROGRAM FILES\u001b[0m\n     27.1. How do I enable automatic indentation for C/C++ files?\n     27.2. How do I configure the indentation used for C/C++ files?\n     27.3. How do I turn off the automatic indentation feature?\n     27.4. How do I change the number of space characters used for the\n           automatic indentation?\n     27.5. I am editing a C program using Vim. How do I display the\n           definition of a macro or a variable?\n     27.6. I am editing a C program using Vim. How do I jump to the\n           beginning or end of a code block from within the block?\n     27.7. When editing C++ files and when inserting new lines above or\n           below a comment (//) line, Vim automatically inserts the C++\n           comment character (//) at the beginning of the line. How do I\n           disable this? (*Updated*)\n     27.8. How do I add the comment character \"#\" to a set of lines at the\n           beginning of each line?\n     27.9. How do I edit a header file with the same name as the\n           corresponding C source file?\n     27.10. How do I automatically insert comment leaders while typing\n            comments?\n\n\u001b[1mQUICKFIX\u001b[0m\n     28.1. How do I build programs from Vim?\n     28.2. When I run the make command in Vim I get the errors listed as the\n           compiler compiles the program. When it finishes this list\n           disappears and I have to use the `:clist` command to see the error\n           message again. Is there any other way to see these error\n           messages?\n     28.3. How can I perform a command for each item in the\n           quickfix/location list?\n\n\u001b[1mFOLDING\u001b[0m\n     29.1. How do I extend the Vim folding support?\n     29.2. When I enable folding by setting the 'foldmethod' option, all the\n           folds are closed. How do I prevent this?\n     29.3. How do I control how many folds will be opened when I start\n           editing a file?\n     29.4. How do I open and close folds using the mouse?\n     29.5. How do I change the text displayed for a closed fold?\n     29.6. How do I store and restore manually created folds across\n           different Vim invocations?\n     29.7. I have enabled syntax based folding. Why is Vim so slow?\n\n\u001b[1mVIM WITH EXTERNAL APPLICATIONS\u001b[0m\n     30.1. Can I run a shell inside a Vim window?\n     30.2. How do I pass the word under the cursor to an external command?\n     30.3. How do I get the output of a shell command into a Vim buffer?\n     30.4. How do I pipe the contents of the current buffer to an external\n           command and replace the contents of the buffer with the output\n           from the command?\n     30.5. How do I sort a section of my file?\n     30.6. How do I use Vim as a pager?\n     30.7. How do I view Unix man pages from inside Vim?\n     30.8. How do I change the diff command used by the Vim diff support?\n     30.9. How do I use the Vim diff mode without folding?\n\n\u001b[1mGUI VIM\u001b[0m\n     31.1. How do I create buffer specific menus?\n     31.2. How do I change the font used by GUI Vim?\n     31.3. When starting GUI Vim, how do I specify the location of the GVIM\n           window?\n     31.4. How do I add a horizontal scrollbar in GVim?\n     31.5. How do I make the scrollbar appear in the left side by default?\n     31.6. How do I remove the Vim menubar?\n     31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the\n           menu starting with that letter is selected. I don't want this\n           behavior as I want to map the <Alt>-<key> combination. How do I do\n           this?\n     31.8. Is it possible to scroll the text by dragging the scrollbar so\n           that the cursor stays in the original location?\n     31.9. How do I get gvim to start browsing files in a particular\n           directory when using the `:browse` command?\n     31.10. For some questions, like when a file is changed outside of Vim,\n            Vim displays a GUI dialog box. How do I replace this GUI dialog\n            box with a console dialog box?\n     31.11. I am trying to use GUI Vim as the editor for my xxx application.\n            When the xxx application launches GUI Vim to edit a file, the\n            control immediately returns to the xxx application. How do I\n            start GUI Vim, so that the control returns to the xxx\n            application only after I quit Vim?\n     31.12. Why does the \"Select Font\" dialog doesn't show all the fonts\n            installed in my system?\n     31.13. How do I use the mouse in Vim command-line mode?\n     31.14. When I use the middle mouse button to scroll text, it pastes the\n            last copied text. How do I disable this behavior?\n     31.15. How do I change the location and size of a GUI Vim window?\n     31.16. When splitting the Vim window vertically, Vim changes\n            the position.\n\n\u001b[1mVIM ON UNIX\u001b[0m\n     32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim\n           freezes. What should I do now?\n     32.2. I am seeing weird screen update problems in Vim. What can I do to\n           solve this screen/display update problems?\n     32.3. I am using the terminal/console version of Vim. In insertmode,\n           When I press the backspace key, the character before the cursor\n           is not erased. How do I configure Vim to do this?\n     32.4. I am using Vim in a xterm. When I quit Vim, the screen contents\n           are restored back to the original contents. How do I disable\n           this?\n     32.5. When I start Vim, it takes quite a few seconds to start. How do I\n           minimize the startup time?\n     32.6. How can I make the cursor in gvim in unix stop blinking?\n     32.7. How do I change the menu font on GTK Vim?\n     32.8. How do I prevent CTRL-Z from suspending Vim?\n     32.9. When I kill the xterm running Vim, the Vim process continues to\n           run and takes up a lot of CPU (99%) time. Why is this happening?\n     32.10. How do I get the Vim syntax highlighting to work in a Unix\n            terminal?\n\n\u001b[1mVIM ON MS-WINDOWS\u001b[0m\n     33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode.\n           What happened?\n     33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do\n           I configure Vim to treat CTRL-Y as CTRL-Y?\n     33.3. How do I start GUI Vim in a maximized window always?\n     33.4. After doing some editing operations, Vim freezes. The cursor\n           becomes an empty rectangle. I am not able enter any characters.\n           What is happening?\n     33.5. I am using Windows XP, the display speed of maximized GVim is\n           very slow. What can I do to speed the display updates?\n     33.6. What are the recommended settings for using Vim with cygwin?\n     33.7. I am trying to use GNU diff with Vim diff mode. When I run the\n           diff from command line, it works. When I try to use the diff with\n           Vim it doesn't work. What should I do now?\n     33.8. Is it possible to use Vim as an external editor for MS-Windows\n           Outlook email client?\n     33.9. I am using Vim to edit HTML files. How do I start internet\n           explorer with the current file to preview the HTML file?\n     33.10. I would like to use Vim with Microsoft Visual Studio. How do I\n            do this?\n     33.11. Where do I place the _vimrc and _gvimrc files?\n     33.12. Every time I save a file, Vim warns about the file being changed\n            outside of Vim. Why?\n\n\u001b[1mPRINTING\u001b[0m\n     34.1. How do I print a file along with line numbers for all the lines?\n     34.2. How do I print a file with the Vim syntax highlighting colors?\n\n\u001b[1mBUILDING VIM FROM SOURCE\u001b[0m\n     35.1. How do I build Vim from the sources on a Unix system?\n     35.2. How do I install Vim in my home directory or a directory other\n           than the default installation directory in Unix?\n     35.3. How do I build Vim from the sources on a MS-Windows system?\n     35.4. The Vim help, syntax, indent files are missing from my Vim\n           installation. How do I install these files?\n     35.5. I have built Vim from the source and installed the Vim package\n           using \"make install\". Do I need to keep the Vim source directory?\n     35.6. How do I determine the Vim features which are enabled at compile\n           time?\n     35.7. Can I build Vim without the GUI support?\n     35.8. When building Vim on a Unix system, I am getting \"undefined\n           reference to term_set_winsize\" error. How do I resolve this\n           error?\n     35.9. Vim configure keeps complaining about the lack of gtk-config\n           while trying to use GTK 2.03. This is correct, since in GTK 2\n           they moved to using the generic pkg-config. I can get pkg-config\n           to list the various includes and libs for gtk, but for some\n           reason the configure script still isn't picking this up.\n     35.10. I did successfully download the sources and compiled Vim on\n            Unix. But feature ... still does not work. What is wrong and\n            how can I fix it?\n\n\u001b[1mVARIOUS\u001b[0m\n     36.1. How do I edit binary files with Vim?\n     36.2. How do I disable the visual error flash and the error beep?\n     36.3. How do I display the ascii value of a character displayed in a\n           buffer?\n     36.4. Can I use zero as a count for a Vim command?\n     36.5. How do I disable the Vim welcome screen?\n     36.6. How do I avoid the \"hit enter to continue\" prompt?\n     36.7. How do I invoke Vim from command line to run a group of commands\n           on a group of files?\n     36.8. How do I use a normal mode command from insert mode without\n           leaving the insert mode?\n     36.9. How do I start Vim in insert mode?\n     36.10. How do I use Copy and Paste with Vim?\n     36.11. Why shouldn't I modify the files in the system runtime\n            directory?\n\n\u001b[1mUNICODE\u001b[0m\n     37.1. Is it possible to create Unicode files using Vim?\n     37.2. Which Vim settings are particularly important for editing Unicode\n           files?\n     37.3. What is the 'encoding' option?\n     37.4. How does Vim name the various Unicode encodings?\n     37.5. How does Vim specify the presence or absence of a byte-order\n           mark?\n     37.6. What is the 'fileencoding' option?\n     37.7. What is the 'fileencodings' option?\n     37.8. What is the 'termencoding' option?\n     37.9. What is the 'bomb' option?\n     37.10. Where can I find an example of a typical use of all these\n            options?\n     37.11. How can I insert Unicode characters into a file using Vim?\n     37.12. How can I know which digraphs are defined and for which\n            characters?\n\n\u001b[1mGENERAL INFORMATION\u001b[0m\n  \u001b[1m1.1. What is Vim?\u001b[0m\n    Vim stands for Vi IMproved. It used to be Vi IMitation, but there are so\n    many improvements that a name change was appropriate. Vim is a text\n    editor which includes almost all the commands from the Unix program \"Vi\"\n    and a lot of new ones. All commands can be given with the keyboard. This\n    has the advantage that you can keep your fingers on the keyboard and\n    your eyes on the screen. For those who want it, there is mouse support\n    and a GUI version with scrollbars and menus.\n\n    Vim is an editor, not a word processor. A word processor is used mainly\n    to do layout of text. This means positioning it, changing the way it\n    appears on output. More often than not, the final document is meant to\n    be printed or typeset or what have you, in order to present it in a\n    pleasing manner to others. Examples of word processors are Microsoft\n    Word, FrameMaker, and OpenOffice Writer.\n\n    An editor is simply for entering text. Any typesetting or laying out of\n    the document is secondary. With an editor, one's main concern is\n    entering text, not making the text look good. Examples of editors other\n    than Vim and Vi are Emacs, TextMate, Ultraedit and gedit. And Notepad.\n\n    For more information, read:\n\n    \u001b[1m:help intro\u001b[0m\n\n  \u001b[1m1.2. Who wrote Vim?\u001b[0m\n    Most of Vim is based on Stevie and was written by Bram Moolenaar, with\n    contributions from too many people to mention here.\n\n    For more information, read:\n\n    \u001b[1m:help author\u001b[0m\n\n    \u001b[1m:help credits\u001b[0m\n\n  \u001b[1m1.3. Is Vim compatible with Vi?\u001b[0m\n    Yes. Vim is very much compatible with Vi. You can use the \"-C\"\n    command-line flag to start Vim in Vi compatible mode:\n\n     $ vim -C\n\n    You can also use:\n\n     $ vim -u NONE\n\n    You can also set the 'compatible' option to enable Vi compatibility:\n\n     :set compatible\n\n    If you want to make sure, to start Vim in a 'nocompatible' mode to\n    original Vi, supply the -N command line argument:\n\n     $ vim -N\n\n    For more information, read:\n\n    \u001b[1m:help -C\u001b[0m\n\n    \u001b[1m:help -N\u001b[0m\n\n    \u001b[1m:help 'compatible'\u001b[0m\n\n    \u001b[1m:help compatible-default\u001b[0m\n\n  \u001b[1m1.4. What are some of the improvements of Vim over Vi?\u001b[0m\n    A short summary of the improvements of Vim over vi is listed below. The\n    list shows that Vim is a thoroughly modern and feature-packed editor.\n    Standard features of modern editors are implemented, and there is an\n    equal emphasis on general power-user features and features for\n    programmers.\n\n   Features to modernise Vi:\n   Multi-level undo\n      Allows you to set the number of times you can undo your changes in a\n      file buffer. You can also redo an undone change.\n      Also starting with version 7.3 Vim can permanently store your undo\n      information, so that you can undo your changes which you have done\n      in a previous editing session.\n\n   Tabs, Multiple windows and buffers\n      Each file can be displayed in its own window. You can move easily from\n      one window to another. Each file opened during a Vim session also has\n      an associated buffer and you can easily jump from one to the other.\n      Also like any modern GUI, Vim supports opening several files in tabs.\n      You can do batch processing for tabs, buffers, windows and the\n      argumentlist.\n\n   Flexible insert mode\n      Vim allows you to use the arrow keys while in insert mode to move\n      around in the file. No more hitting <Esc>, moving around, then hitting\n      `i' or `a'.\n\n   Macros\n      Vim has a facility which allows you to record a sequence of typed\n      characters and repeat them any number of times.\n\n   Visual mode\n      You can highlight sections of text and execute operations on this\n      section of text only.\n\n   Block operators\n      Allow selection and highlighting of rectangular blocks of text in\n      order do execute specific operations on them.\n\n   Online help system\n      You can easily find help on any aspect of using Vim. Help is displayed\n      in its own window.\n\n   Command-line editing and history\n      History allows you to use the arrow keys to repeat or search for a\n      command that has already been typed. Allows you to match the beginning\n      of a command with the beginning of another similar command in the\n      history buffer. You can also edit a command to correct typos or change\n      a few values.\n\n   Command line completion.\n      Using the <Tab> key, you can complete commands, options, filenames,\n      etc. as needed.\n\n   Horizontal scrolling.\n      Long lines can be scrolled horizontally (with or without the GUI).\n\n   Unicode and internationalization improvements.\n      Vim is able to edit files in unicode encoding and uses internally an\n      utf-8 encoding. Additionally Vim can display text right to left\n      oriented.\n\n   Advanced user features:\n   Text formatting\n      With two keystrokes, you can format large sections of text, without\n      the use of external programs.\n\n   Completion in Insert mode\n      Vim provides several different possibilities to complete your text.\n      For example Vim can complete words while you are typing, by matching\n      the current word with other similar words in the file.\n\n   Jump tags\n      Just like in an internet browser, you can jump back to previous parts\n      of the text you were editing, and then forward again.  Your brain is\n      thus free to edit instead of navigate.\n\n   Automatic commands\n      Commands automatically executed when reading or writing a file,\n      jumping to another buffer, etc.\n\n   Viminfo\n      Allows storing of the command line history, marks and registers in a\n      file to be read on startup.  Therefore, you can recall old search\n      patterns, macros, etc., in a new Vim session.\n\n   Mouse support\n      The mouse is supported in an xterm and for MS-DOS. It can be used to\n      position the cursor, select the visual area, paste a register, etc.\n\n   Graphical User Interface (GUI)\n      There are several different graphical user interfaces available.\n      Also, it's very easy to add your own menus.  Of course, console vim is\n      still supported, and very widely used.\n\n   Scripting language\n      Vim has a powerful scripting language so new commands can be created.\n      You can also use Perl, Python, TCL, Lua and Ruby to achieve the same\n      thing!\n\n   Plugins\n      Extra functionality implemented via vim commands (regular commands or\n      the scripting language) that is automatically loaded on startup.\n      Examples: file explorer, network editing, enhanced autocompletion,\n      syntax checks.\n      More are being developed and shared on VimOnline all the time.\n\n   Syntax highlighting for many programming languages\n      Syntax highlighting (including concealing items) for hundreds of\n      programming languages is supported. Support for others can be\n      added.\n\n   Extended regular expressions\n      Vim supports extended regular expressions which are similar in\n      functionality to that of Perl regular expressions.\n\n   Integrated Spell checking\n      Spell checking has been integrated into Vim.\n\n   Diff mode\n      Vim can highlight the differences between two, three or four files.\n      Identical lines will be folded away and hidden.\n\n   Encryption using the blowfish algorithm\n      Vim allows to encrypt your files using the symmetric block cipher\n      blowfish as well as the swap file.\n\n   Extensive customizable\n      Vim can be tuned and customized to work like you want by setting\n      options. You can define your own commands, macros and even plugins\n      to extend its capabilities\n\n   Packages\n      Packages have been added to keep the installation of the growing\n      number of plugins manageable. This is a convenient way to get one\n      or more plugins, drop them in a directory and keep them updated.\n      Vim will load them automatically, or only when desired.\n\n   Programming performance features:\n   Edit-compile-edit speedup\n      You can compile within Vim and automatically jump to the location of\n      errors in the source code.\n\n   Indenting for many programming languages\n      C, C++, Java, Perl, XML and many other languages can be automatically\n      indented by vim while you type.  Support for others can be added.\n\n   Searching for words in include files\n      Vim allows you to search for a match of the word under the cursor in\n      the current and included files.\n\n   Advanced text objects\n      Instantly select, delete, copy, indent, format, change case, or ...\n      to all the text between ( and ), or { and }, or < and >, or [ and\n      ].  Or a word, sentence, or paragraph.  Very powerful.\n\n   Folding\n      Certain parts of the text can be \"folded\" away.  The best example is\n      the body of a function.  You can get an overview of the code, and then\n      open the fold of the function whose detail you need to see.\n\n   ctags and cscope integration\n      Using these two powerful programs, you can jump to a definition of a\n      function from a calling instance of it, and use other tricks to\n      navigate source code.\n\n   Integration of several programming languages\n      If you find the internal scripting language not powerful enough, you\n      can extend Vim using Lua, Ruby, Tcl, Perl and Python 2 and 3.\n\n   Asynchronous I/O support\n      Vim uses jobs and channels to talk to other programs\n      asynchronously. This allows to have e.g. a compiler run in the\n      background and open the quickfix list as soon as it is finished to\n      fix warnings and errors.\n\n   Timers\n      Timers are asynchronous and can fire once or repeatedly to invoke a\n      function to do any work.\n\n   For more information, read:\n    \u001b[1m:help vi-differences\u001b[0m\n\n  \u001b[1m1.5. Is Vim free?\u001b[0m\n    Vim is Charityware. There are no restrictions on using or copying Vim,\n    but the author encourages you to make a donation to charity. A document\n    explaining how to do so is included in the distribution.\n\n    For more information, read:\n\n    \u001b[1m:help copyright\u001b[0m\n\n\u001b[1mRESOURCES\u001b[0m\n  \u001b[1m2.1. Where can I learn more about Vim?\u001b[0m\n    You can post your Vim questions to the vim@vim.org mailing list. You can\n    post your Vim development related questions to the vim-dev@vim.org\n    mailing list. Vim does not have a newsgroup of its own. But the\n    appropriate newsgroup to post to is comp.editors.\n\n    \"VimOnline\" is a web page that serves as a de facto homepage for vim,\n    although the main purpose of it is to gather tips and scripts from\n    everywhere. Get involved! The URL is https://www.vim.org\n\n    Finally, read the Vi FAQ:\n\n     http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\n    Finally, there are also some communities, where you can discuss features\n    or ask questions:\n\n     https://vi.stackexchange.com\n     https://vim.reddit.com\n\n    For more information, read:\n\n    \u001b[1m:help mail-list\u001b[0m\n\n    \u001b[1m:help internet\u001b[0m\n\n  \u001b[1m2.2. Is there a mailing list available?\u001b[0m\n    There are several:\n\n     NAME              DESCRIPTION\n     ----------------  ---------------------------------------------\n     vim-announce      Announcements of new releases\n     vim               General discussion\n     vim-dev           Patches, bug reports, development discussions\n     vim-mac           Macintosh discussion\n     vim-fr            General discussion in French\n\n    Of these, only vim and vim-dev are of general interest. vim-announce is\n    read-only to most people, and its messages are sent to the other lists\n    as well. The remaining four are very low volume.\n\n     ACTION            EMAIL SEND TO\n     ----------------  --------------------------\n     To subscribe:     <NAME>-subscribe@vim.org\n     To unsubscribe:   <NAME>-unsubscribe@vim.org\n     To get help:      <NAME>-help@vim.org\n\n    The available mailing lists are also mentioned here:\n\n     https://www.vim.org/maillist.php\n\n  \u001b[1m2.3. Is there an archive available for the Vim mailing lists?\u001b[0m\n    Yes. Visit https://groups.yahoo.com/, where name is one of: vimannounce,\n    vim, vimdev, vim-fr, vim-mac, vim-vms.\n\n    Alternatively, visit www.gmane.org to find out about GMANE, which allows\n    you to access the mailing lists as though they were newsgroups. This\n    offers some convenience to those who wish to browse the history or\n    casually observe the current threads.\n\n  \u001b[1m2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\u001b[0m\n    You can download the HTML/PDF/PS format of the Vim user manual from:\n\n     https://vimdoc.sourceforge.net/\n\n    Note, the user manual from that page is currently pretty outdated. It's\n    best to either use the documentation that comes with vim or use the\n    online version at https://vimhelp.org\n\n    You can find a pdf version of the full English help, including this faq\n    (in letter, A4 and Ipad format) at:\n\n     https://nathangrigg.com/vimhelp/\n\n    This document is cross-referenced, so you can use the hyperlink\n    functionality.\n\n  \u001b[1m2.5. I have a \"xyz\" (some) problem with Vim. How do I determine if it is a\n  problem with my setup or with Vim?  / Have I found a bug in Vim?\u001b[0m\n    First, you need to find out, whether the error is in the actual runtime\n    files or any plugin that is distributed with Vim or whether it is a\n    simple side effect of any configuration option from your .vimrc or\n    .gvimrc. So first, start vim like this:\n\n     vim -u NONE -U NONE -N -i NONE\n\n    This starts Vim in nocompatible mode (-N), without reading your viminfo\n    file (-i NONE), without reading any configuration file (-u NONE for not\n    reading .vimrc file and -U NONE for not reading a .gvimrc file) or even\n    plugin.\n\n    In this invocation, try to reproduce your problem. If the error\n    persists, the chance is good you've found a bug in Vim (see also\n    Question 2.6.)\n\n    If the error does not occur when starting Vim this way, then the problem\n    is either related to some plugin of yours or some setting in one of your\n    local setup files. You need to find out, what triggers the error, you\n    try starting Vim this way:\n\n     vim -u NONE -U NONE -N\n\n    If the error occurs, the problem is your .viminfo file. Simply delete\n    the viminfo file then. If the error does not occur, try:\n\n     vim -u ~/.vimrc --noplugin -N -i NONE\n\n    This will simply use your .vimrc as configuration file, but not load any\n    plugins. If the error occurs this time, the error is possibly caused by\n    some configuration option inside your .vimrc file. Depending on the\n    length of your vimrc file, it can be quite hard to trace the origin\n    within that file.\n\n    The best way is to add `:finish` command in the middle of your .vimrc.\n    Then restart again using the same command line. If the error still\n    occurs, the bug must be caused because of a setting in the first half of\n    your .vimrc. If it doesn't happen, the problematic setting must be in\n    the second half of your .vimrc. So move the `:finish` command to the\n    middle of that half, of which you know that triggers the error and move\n    your way along, until you find the problematic option. If your .vimrc is\n    350 lines long, you need at a maximum 9 tries to find the offending line\n    (in practise, this can often be further reduced, since often lines\n    depend on each other).\n\n    If the problem does not occur, when only loading your .vimrc file, the\n    error must be caused by a plugin or another runtime file (indent\n    autoload or syntax script). Check the output of the `:scriptnames`\n    command to see what files have been loaded and for each one try to\n    disable each one by one and see which one triggers the bug. Often files\n    that are loaded by vim, have a simple configuration variable to disable\n    them, but you need to check inside each file separately.\n\n    You can also use the -V command line argument to get more debug\n    information to analyze the problem:\n\n     $ vim -V2logfile\n\n    You can increase the value passed to the -V argument to get more debug\n    information. By also specifying a logfile name, this makes sure, the\n    debug messages don't appear on the screen and won't disturb you when\n    trying to reproduce the problem.\n\n    For more information, read:\n\n    \u001b[1m:help -u\u001b[0m\n\n    \u001b[1m:help -U\u001b[0m\n\n    \u001b[1m:help -N\u001b[0m\n\n    \u001b[1m:help -V\u001b[0m\n\n    \u001b[1m:help 'verbose'\u001b[0m\n\n    \u001b[1m:help :verbose\u001b[0m\n\n    \u001b[1m:help :set-verbose\u001b[0m\n\n  \u001b[1m2.6. Where can I report bugs?\u001b[0m\n    First collect the required information using the following command:\n\n     :source $VIMRUNTIME/bugreport.vim\n\n    Now send the resulting text from the above command to the bugs@vim.org\n    e-mail address. There is also a public bug tracker available at\n    https://github.com/vim/vim/issues. A copy of each message there will be\n    forwarded to the Vim Development list.\n\n    The Vim Development mailing list (see Question 2.2) is a good place to\n    discuss general bugs. If the bug you find is with syntax highlighting, a\n    runtime file, or some other \"added feature\" (i.e. not directly\n    programmed into vim), attempt to inform the maintainer of that feature.\n    His e-mail address will be mentioned at the top of the corresponding\n    runtime file.\n\n    For more information, read:\n\n    \u001b[1m:help bug-reports\u001b[0m\n\n  \u001b[1m2.7. Where can the FAQ be found?\u001b[0m\n    The FAQ can be found at https://vimhelp.org/vim_faq.txt.html. It will be\n    auto-generated from the source that is managed in the github repository\n    https://www.github.com/chrisbra/vim_faq (Patches are welcome).\n\n    The repository also includes the faq in different formats, e.g. manpage,\n    pdf file, html file, plain text version and a version in vim help\n    format.\n\n    A slightly older version (which doesn't seem to get updated anymore) can\n    still be found at VimOnline (https://www.vim.org/).\n\n  \u001b[1m2.8. What if I don't find an answer in this FAQ?\u001b[0m\n    This FAQ covers mainly Vim-specific questions. You may find more\n    information suitable for most Vi clones by reading the Vi FAQ. It is\n    posted regularly on comp.editors. You can also find a copy at\n\n     http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\n    Also, since Vim has gathered so many features in the last few years,\n    successfully documenting the frequently asked questions here is a\n    near-impossible task. To make it possible, please email the maintainer\n    if you have a good question. A good question is one that you've tried to\n    answer yourself (remember, Vim has great documentation) but struggled.\n\n  \u001b[1m2.9. I have a patch for implementing a Vim feature. Where can I send this\n  patch?\u001b[0m\n    You can send your patches to the Vim developer mailing list\n    vim-dev@vim.org.\n\n    For more information, read:\n\n    \u001b[1m:help vim-dev\u001b[0m\n\n  \u001b[1m2.10. I have a Vim tip or developed a new Vim syntax/indent/filetype/\n   compiler plugin or developed a new script or a colorscheme.\n   Is there a public website where I can upload this?\u001b[0m\n    Yes. You can use the Vim Online website to upload your plugins/scripts,\n    colorschemes, etc. The site is at https://www.vim.org Nowadays people\n    also seem to share their plugins/runtime files at github.\n\n    Tips can also be shared in the Wiki which you can find at\n\n     http://vim.wikia.com\n\n\u001b[1mAVAILABILITY\u001b[0m\n  \u001b[1m3.1. What is the latest version of Vim?\u001b[0m\n    The latest version of Vim is 8.2 released on 12th December 2019.\n\n    The release history of different versions of Vim is below:\n\n     VERSION         RELEASE DATE\n     --------------  --------------------\n     Version 9.1     2nd January, 2024\n     Version 9.0     28th June, 2022\n     Version 8.2     12th December, 2019\n     Version 8.1     17th May, 2018\n     Version 8.0     12th September, 2016\n     Version 7.4     10th August, 2013\n     Version 7.3     15th August, 2010\n     Version 7.2     9th August, 2008\n     Version 7.1     12th May, 2007\n     Version 7.0     8th May, 2006\n     Version 6.4     15th October, 2005\n     Version 6.3     8th June, 2004\n     Version 6.2     1st June, 2003\n     Version 6.1     24th March, 2002\n     Version 6.0     27th September, 2001\n     Version 5.8     31st May, 2001\n     Version 5.7     24th June, 2000\n     Version 5.6     16th January, 2000\n     Version 5.5     21st September, 1999\n     Version 5.4     26th July, 1999\n     Version 5.3     31st August, 1998\n     Version 5.2     24th August, 1998\n     Version 5.1     7th April, 1998\n     Version 5.0     19th February, 1998\n     Version 4.6     13th March, 1997\n     Version 4.5     17th October, 1996\n     Version 4.2     5th July, 1996\n     Version 4.0     29th May, 1996\n     Version 3.0     12th August, 1994\n     Version 2.0     21st December, 1993\n     Version 1.27    23rd April, 1993\n     Version 1.17    21st April, 1992\n     Version 1.14    2nd November, 1991\n\n    If you are interested in the old release history, check out the\n    vim-history git repository: https://github.com/vim/vim-history and\n    especially for the release history:\n    https://github.com/vim/vim-history#release-history\n\n    For more information, read:\n\n    \u001b[1m:help new-9\u001b[0m\n\n    \u001b[1m:help new-8\u001b[0m\n\n    \u001b[1m:help changed-9.1\u001b[0m\n\n    \u001b[1m:help changed-8.2\u001b[0m\n\n    \u001b[1m:help changed-8.1\u001b[0m\n\n  \u001b[1m3.2. Where can I find the latest version of Vim?\u001b[0m\n    You can download the sources for the latest version of Vim from the\n    Github repository. The URL for this site is\n\n     https://github.com/vim/vim\n\n    A mercurial mirror is also available:\n\n     https://www.vim.org/hgweb/vim/\n\n    Some users keep updated repositories for distributing latest binary\n    versions of Vim. You can find those repositories here:\n\n     http://vim.wikia.com/wiki/Where_to_download_Vim\n\n  \u001b[1m3.3. What platforms does it run on?\u001b[0m\n    All Unix platforms. All Windows platforms (10 and later). Amiga,\n    Macintosh, MachTen, VMS, IBM z/OS.\n\n    For MS-DOS support has been removed with the latest releases of Vim.\n    16-bit DOS: latest supported version 7.1 32-bit DOS: latest supported\n    version 7.3 Windows XP and Visat: latest supported version 9.0\n\n  \u001b[1m3.4. Where can I download the latest version of the Vim runtime files?\u001b[0m\n    You can download the latest version of the Vim runtime files (syntax\n    files, filetype plugins, compiler files, color schemes, documentation,\n    indentation files and keymaps) from the Vim github repository\n\n     https://github.com/vim/vim/tree/master/runtime\n\n    Another way of downloading the runtime files is this:\n\n     wget https://github.com/vim/vim/archive/master.tar.gz -O- |\n     tar zfx - vim-master/runtime/ --strip-components=1\n\n    See also:\n\n     https://www.vim.org/runtime.php\n\n\u001b[1mHELP\u001b[0m\n  \u001b[1m4.1. How do I use the help files?\u001b[0m\n    Help can be found for all functions of Vim. In order to use it, use the\n    `:help` command. This will bring you to the main help page. On that\n    first page, you will find explanations on how to move around. Basically,\n    you move around in the help pages the same way you would in a read-only\n    document. You can jump to specific subjects by using tags. This can be\n    done in two ways:\n\n       * Use the CTRL-] command while standing on the name of a command\n      or option. This only works when the tag is a keyword.\n      <Ctrl-LeftMouse> and g<LeftMouse> work just like CTRL-].\n\n       * use the `:tag <subject>` command. This works with all characters.\n\n    Use CTRL-T to jump back to previous positions in the help files. Use\n    `:q` to close the help window.\n\n    If you want to jump to a specific subject on the help pages, use `:help\n    {subject}` . If you don't know what to look for, try `:help index` to\n    get a list of all available subjects. Use the standard search keys to\n    locate the information you want. You can abbreviate the `:help` command\n    as `:h`.\n\n    For searching the help, see the next Question 4.2.\n\n    For more information, read:\n\n    \u001b[1m:help online-help\u001b[0m\n\n  \u001b[1m4.2. How do I search for a keyword in the Vim help files?\u001b[0m\n    a) You can press the CTRL-D key after typing the help keyword to get a\n    list of all the help keywords containing the supplied pattern. You can\n    also use the meta characters like *, \\+, etc to specify the help search\n    pattern:\n\n    \u001b[1m:help init<C-D\u001b[0m>\n\n    \u001b[1m:help str*()<C-D\u001b[0m>\n\n    \u001b[1m:help '*indent<C-D\u001b[0m>\n\n    b) You can press the <Tab> key after typing a partial help keyword to\n    expand to the matching keyword. You can continue to press the <Tab> key\n    to see other keyword matches.\n\n    c) From the help window, you can use the `:tag` command to search for\n    keywords. For example,\n\n     :tselect /window\n\n     This command will list all the help keywords containing the text\n     \"window\". You can select one from the list and jump to it.\n\n    d) You can use the `:helpgrep` command to search for the given text in\n    all the help files. The quickfix window will be opened with all the\n    matching lines.\n\n    For more information, read:\n\n    \u001b[1m:help help-summary\u001b[0m\n\n    \u001b[1m:help c_CTRL-D\u001b[0m\n\n    \u001b[1m:help c_<Tab\u001b[0m>\n\n    \u001b[1m:help :tselect\u001b[0m\n\n    \u001b[1m:help :help\u001b[0m\n\n    \u001b[1m:help :helpgrep\u001b[0m\n\n  \u001b[1m4.3. I am getting an error message E123, what did I do wrong?\u001b[0m\n    You can get more information about the error and the error message\n    using:\n\n    \u001b[1m:help E123\u001b[0m\n\n    For more information, read:\n\n    \u001b[1m:help error-messages\u001b[0m\n\n  \u001b[1m4.4. Where can I read about the various modes in Vim?\u001b[0m\n    You can get information about the different modes in Vim by reading\n\n    \u001b[1m:help vim-modes\u001b[0m\n\n  \u001b[1m4.5. How do I generate the Vim help tags file after adding a new Vim help\n  file?\u001b[0m\n    You can use the `:helptags` command to regenerate the Vim help tag file\n    from within Vim. For example:\n\n     :cd $VIMRUNTIME/doc\n     :helptags .\n\n    To update all \"doc\" directories in your 'runtimepath', you can use\n\n     :helptags ALL\n\n    For more information, read:\n\n    \u001b[1m:help :helptags\u001b[0m\n\n    \u001b[1m:help add-local-help\u001b[0m\n\n  \u001b[1m4.6. Can I use compressed versions of the help files?\u001b[0m\n    Yes. You can compress the help files and still be able to view them with\n    Vim. This makes accessing the help files a bit slower and requires the\n    \"gzip\" utility. Follow these steps to compress and use the Vim help\n    files:\n\n    - Compress all the help files using \"gzip doc/*.txt\".\n\n    - Edit the \"doc/tags\" file and change the \".txt\" to \".txt.gz\" using\n    :%s=\\(\\t.*\\.txt\\)\\t=\\1.gz\\t=\n\n    - Add the following line to your vimrc: set\n    helpfile={dirname}/help.txt.gz\n\n    Where {dirname} is the directory where the help files are. The gzip.vim\n    plugin supplied with the standard Vim distribution will take care of\n    decompressing the files. You must make sure that $VIMRUNTIME is set to\n    where the other Vim files are, when they are not in the same location as\n    the compressed \"doc\" directory.\n\n    Note, that the `:helpgrep` command does not work with compressed help\n    pages.\n\n    For more information, read:\n\n    \u001b[1m:help gzip-helpfile\u001b[0m\n\n    \u001b[1m:help 'helpfile'\u001b[0m\n\n    \u001b[1m:help gzip\u001b[0m\n\n    \u001b[1m:help $VIMRUNTIME\u001b[0m\n\n\u001b[1mEDITING A FILE\u001b[0m\n  \u001b[1m5.1. How do I load a file in Vim for editing?\u001b[0m\n    There are several ways to load a file for editing. The simplest is to\n    use the `:e` (:edit) command:\n\n     :e <filename>\n\n    You can also use the `:n` (:next) command to load files into Vim:\n\n     :n <filename(s)>\n\n    You can also use the `:args` command to load files into Vim:\n\n     :args <filename(s)>\n\n    For more information, read:\n\n    \u001b[1m:help usr_07.txt\u001b[0m\n\n    \u001b[1m:help edit-files\u001b[0m\n\n    \u001b[1m:help :edit\u001b[0m\n\n    \u001b[1m:help :next_f\u001b[0m\n\n    \u001b[1m:help :args_f\u001b[0m\n\n  \u001b[1m5.2. How do I save the current file in another name (save as) and edit a\n  new file?\u001b[0m\n    You can use the `:saveas` command to save the current file in another\n    name:\n\n     :saveas <newfilename>\n\n    Alternatively, you can also use the following commands:\n\n     :w <newfilename>\n     :edit #\n\n    You can also use the `:file` command, followed by `:w` command:\n\n     :file <newfilename>\n     :w\n\n    For more information, read:\n\n    \u001b[1m:help 07.7\u001b[0m\n\n    \u001b[1m:help :saveas\u001b[0m\n\n    \u001b[1m:help :file_f\u001b[0m\n\n    \u001b[1m:help :w\u001b[0m\n\n  \u001b[1m5.3. How do I change the current directory to the directory of the current\n  file?\u001b[0m\n    You can use the following command to change the current directory to the\n    directory of the current file:\n\n     :cd %:p:h\n\n    To automatically change the current directory to the directory of the\n    current file, simply set the option 'autochdir'.\n\n     :set autochdir\n\n    For more information, read:\n\n    \u001b[1m:help :cd\u001b[0m\n\n    \u001b[1m:help :lcd\u001b[0m\n\n    \u001b[1m:help filename-modifiers\u001b[0m\n\n    \u001b[1m:help autocommand\u001b[0m\n\n    \u001b[1m:help 'acd'\u001b[0m\n\n    \u001b[1m:help getcwd()\u001b[0m\n\n  \u001b[1m5.4. How do I write a file without the line feed (EOL) at the end of the\n  file?\u001b[0m\n    You can turn off the 'eol' option and turn on the 'binary' option to\n    write a file without the EOL at the end of the file:\n\n     :set binary\n     :set noeol\n     :w\n\n    Alternatively, you can use:\n\n     :set noeol\n     :w ++bin\n\n    If you rather only like Vim not to write missing EOLs, you can reset the\n    'fixeol' option. This needs a Vim newer 7.4.785, so you should wrap this\n    in an if condition in your .vimrc like this:\n\n     if exists('+fixeol')\n         set nofixeol\n     endif\n\n    This has the advantage of avoiding the many side effects that the\n    'binary' option has.\n\n    For more information, read:\n\n    \u001b[1m:help 'endofline'\u001b[0m\n\n    \u001b[1m:help 'fixeol'\u001b[0m\n\n    \u001b[1m:help 'binary'\u001b[0m\n\n    \u001b[1m:help 23.4\u001b[0m\n\n  \u001b[1m5.5. How do I configure Vim to open a file at the last edited location?\u001b[0m\n    Vim stores the cursor position of the last edited location for each\n    buffer in the '\"' register. You can use the following autocmd in your\n    .vimrc or .gvimrc file to open a file at the last edited location:\n\n     au BufReadPost * if line(\"'\\\"\") > 0 && line(\"'\\\"\") <= line(\"$\") |\n                          \\ exe \"normal! g`\\\"\" | endif\n\n    Alternatively, you can simply source the vimrc_example.vim file, which\n    is distributed with Vim.\n\n    For more information, read:\n\n    \u001b[1m:help '\"\u001b[0m\n\n    \u001b[1m:help last-position-jump\u001b[0m\n\n    \u001b[1m:help vimrc_example.vim\u001b[0m\n\n  \u001b[1m5.6. When editing a file in Vim, which is being changed by an external\n  application, Vim opens a warning window (like the confirm dialog) each\n  time a change is detected. How do I disable this warning?\u001b[0m\n    You can set the Vim 'autoread' option to automatically read the file\n    again when it is changed outside of Vim:\n\n     :set autoread\n\n    You can also use the following autocommand:\n\n     autocmd FileChangedShell *\n           \\ echohl WarningMsg |\n           \\ echo \"File has been changed outside of vim.\" |\n           \\ echohl None\n\n    For more information, read:\n\n    \u001b[1m:help 'autoread'\u001b[0m\n\n    \u001b[1m:help FileChangedShell\u001b[0m\n\n    \u001b[1m:help timestamp\u001b[0m\n\n    \u001b[1m:help :checktime\u001b[0m\n\n  \u001b[1m5.7. How do I edit a file whose name is under the cursor?\u001b[0m\n    You can use the gf command to edit a file whose name is under the\n    cursor. You can use the CTRL-W f command to edit the file in a new\n    window and finally you can use CTRL-W gf top open a new tab page that\n    contains the file name under the cursor.\n\n    For more information, read:\n\n    \u001b[1m:help gf\u001b[0m\n\n    \u001b[1m:help CTRL-W_f\u001b[0m\n\n    \u001b[1m:help CTRL-W_gf\u001b[0m\n\n    \u001b[1m:help 'isfname'\u001b[0m\n\n    \u001b[1m:help 'path'\u001b[0m\n\n    \u001b[1m:help 'suffixesadd'\u001b[0m\n\n    \u001b[1m:help 'includeexpr'\u001b[0m\n\n  \u001b[1m5.8. How do I reload/re-edit the current file?\u001b[0m\n    You can use the `:edit` command, without specifying a file name, to\n    reload the current file. If you have made modifications to the file, you\n    can use `:edit!` to force the reload of the current file (you will lose\n    your modifications, but depending on your 'undoreload' settings, those\n    changes might be saved into the undo history).\n\n    For more information, read:\n\n    \u001b[1m:help :edit\u001b[0m\n\n    \u001b[1m:help :edit!\u001b[0m\n\n    \u001b[1m:help 'confirm'\u001b[0m\n\n    \u001b[1m:help 'undoreload'\u001b[0m\n\n  \u001b[1m5.9. How do I autosave a file periodically?\u001b[0m\n    Vim doesn't support auto-saving a file periodically.\n\n    For more information, read:\n\n    \u001b[1m:help 'updatetime'\u001b[0m\n\n    \u001b[1m:help CursorHold\u001b[0m\n\n    \u001b[1m:help swap-file\u001b[0m\n\n  \u001b[1m5.10. How do I open a file in read-only mode?\u001b[0m\n    You can open a file in read-only mode using the `:view` command:\n\n     :view <filename>\n\n    This command sets the 'readonly' option for the opened buffer. You can\n    also use the \"-R\" command-line option to open a file in read-only mode:\n\n     $ vim -R <filename>\n\n    You can also use the symbolic link executable \"view\" to open a file in\n    read-only mode from the command-line:\n\n     $ view <filename>\n\n    For more information, read:\n\n    \u001b[1m:help 07.6\u001b[0m\n\n    \u001b[1m:help 'readonly'\u001b[0m\n\n    \u001b[1m:help 'modifiable'\u001b[0m\n\n    \u001b[1m:help :view\u001b[0m\n\n    \u001b[1m:help :sview\u001b[0m\n\n    \u001b[1m:help view\u001b[0m\n\n    \u001b[1m:help -R\u001b[0m\n\n    \u001b[1m:help -M\u001b[0m\n\n  \u001b[1m5.11. How do I open a file for editing without saving the modifications to\n   the current file?\u001b[0m\n    You can open a file for editing without saving the modifications to the\n    current file and without losing the changes using one of the following\n    methods:\n\n     :split <new_filename>\n     :new <new_filename>\n\n    You can also set the 'hidden' option and edit a new file:\n\n     :set hidden\n     :e <new_filename>\n\n    If you want to discard the changes made to the current file and load\n    another file for editing, then you can use the following command:\n\n     :e! <new_filename>\n\n    For more information, read:\n\n    \u001b[1m:help :edit!_f\u001b[0m\n\n    \u001b[1m:help 'hidden'\u001b[0m\n\n    \u001b[1m:help :split\u001b[0m\n\n    \u001b[1m:help :new\u001b[0m\n\n  \u001b[1m5.12. How do I reduce the loading time for very large files in Vim?\u001b[0m\n    You can use the following settings to reduce the loading time for very\n    large files in Vim:\n\n     :set lazyredraw\n     :set noswapfile\n     :set undolevels=-1\n     :set eventignore=all\n     :set nohidden\n     :set syntax=off\n\n    Note that the above settings will disable many Vim features including\n    the following: Swap files support for crash recovery, undo support,\n    syntax highlighting, filetype detection and other autocommand based\n    features.\n\n    There is also the LargeFile plugin available at\n\n     https://www.vim.org/scripts/script.php?script_id=1506\n\n    which automatically sets these options, when working with large files\n    (it is configurable, what is considered to be a large file, by default,\n    it is 100MB).\n\n\u001b[1mEDITING MULTIPLE FILES\u001b[0m\n  \u001b[1m6.1. How do I open multiple files at once from within Vim?\u001b[0m\n    Make a difference between args, buffers, tabs and windows. They are all\n    different things in VIM.\n\n    args is a list of arguments. Buffers are place to edit text, almost\n    always attached to a file but not necessarily. Window is a place for a\n    buffer and tab is set of windows, better name would be \"layout\".\n\n    There are several ways to open multiple files at once from within Vim.\n    You can use the `:next` command to specify a group of files:\n\n     :next f1.txt f2.txt\n     :next *.c\n\n    You can use the `:args` command to specify a group of files as\n    arguments:\n\n     :args f1.txt f2.txt\n     :args *.c\n\n    After loading the files, you can use the `:next` and `:prev` command to\n    switch between the files.\n\n    To execute command for all files in argument-list use `:argdo`\n\n    For more information, read:\n\n    \u001b[1m:help 07.2\u001b[0m\n\n    \u001b[1m:help :next\u001b[0m\n\n    \u001b[1m:help :args_f\u001b[0m\n\n    \u001b[1m:help argument-list\u001b[0m\n\n  \u001b[1m6.2. How do I switch between multiple files/buffers in Vim?\u001b[0m\n    To list all buffers use `:ls`, to list buffers without file attached to\n    (also known as unlisted buffers, ex. scratch buffer and help-window) use\n    `:ls!`\n\n    There are several ways to switch between multiple files. You can use the\n    `:buffer` command to switch between multiple files. You can also shorten\n    command as `:b` and use only part of the filename. For example,\n\n     :buffer file1\n     :buffer file2\n     :b e2\n\n    You can also use <TAB> after `:b` for autocompletion. Try also `:b`\n    followed by CTRL-D to see all available buffers. This works also for\n    `:e`.\n\n    You can also use the CTRL-^ key to switch between buffers. By specifying\n    a count before pressing the key, you can edit the buffer with that\n    number. Without the count, you can edit the alternate buffer by pressing\n    CTRL-^\n\n    You can also use the `:e #` command to edit a particular buffer:\n\n     :e #5\n\n    To close a buffer use `:bd` -command.\n\n    To execute command for all files in buffer-list use `:bufdo`\n\n    For more information, read:\n\n    \u001b[1m:help edit-files\u001b[0m\n\n    \u001b[1m:help :buffer\u001b[0m\n\n    \u001b[1m:help CTRL-^\u001b[0m\n\n    \u001b[1m:help alternate-file\u001b[0m\n\n    \u001b[1m:help 22.4\u001b[0m\n\n    \u001b[1m:help 07.3\u001b[0m\n\n  \u001b[1m6.3. How do I open several files in Vim, with each file in a separate\n  window/tab?\u001b[0m\n    You can use the -o and -O Vim command line arguments to open multiple\n    files in separate horizontally or vertically split Vim windows. For\n    example:\n\n     $ vim -o3 f1.txt f2.txt f3.txt\n\n    The above command will open the files f1.txt, f2.txt and f3.txt in three\n    separate horizontally split Vim windows.\n\n     $ vim -O3 f1.txt f2.txt f3.txt\n\n    The above command will open the files f1.txt, f2.txt and f3.txt in three\n    separate vertically split Vim windows.\n\n     $ vim -p f1.txt f2.txt f3.txt\n\n    The above command will open the files f1.txt, f2.txt and f3.txt in three\n    separate tab windows. The option 'tabpagemax' defines, how many tabpages\n    can be opened at the same time, by default it is set to 10.\n\n    For more information, read:\n\n    \u001b[1m:help -o\u001b[0m\n\n    \u001b[1m:help -O\u001b[0m\n\n    \u001b[1m:help -p\u001b[0m\n\n    \u001b[1m:help startup-options\u001b[0m\n\n    \u001b[1m:help 'tabpagemax'\u001b[0m\n\n  \u001b[1m6.4. How do I configure Vim to autoload several files at once similar to\n  \"work-sets\" or \"projects\"?\u001b[0m\n    You can use the `:mksession` and the `:mkview` commands to autoload\n    several files in Vim.\n\n    The `:mksession` command creates a Vim script that restores the current\n    editing session. You can use the `:source` command to source the file\n    produced by the mksession command.\n\n    The `:mkview` command creates a Vim script that restores the contents of\n    the current window. You can use the `:loadview` command to load the view\n    for the current file.\n\n    For more information, read:\n\n    \u001b[1m:help 21.4\u001b[0m\n\n    \u001b[1m:help 21.5\u001b[0m\n\n    \u001b[1m:help views-sessions\u001b[0m\n\n    \u001b[1m:help 'sessionoptions'\u001b[0m\n\n    \u001b[1m:help :mksession\u001b[0m\n\n    \u001b[1m:help :source\u001b[0m\n\n    \u001b[1m:help v:this_session\u001b[0m\n\n    \u001b[1m:help :mkview\u001b[0m\n\n    \u001b[1m:help :loadview\u001b[0m\n\n    \u001b[1m:help 'viewdir'\u001b[0m\n\n    \u001b[1m:help buffers\u001b[0m\n\n  \u001b[1m6.5. Is it possible to open multiple top level windows in a single instance\n  of Vim similar to Nedit or Emacs?\u001b[0m\n    No. It is currently not possible to open multiple top-level windows in a\n    single instance of Vim. This feature is in the todo list.\n\n  \u001b[1m6.6. How do I browse/explore directories from within Vim?\u001b[0m\n    You can use the netrw.vim plugin, supplied with the standard Vim\n    installation, to browse/explore directories from within Vim. You can\n    start the file explorer using one of the following commands:\n\n     :e <directory>\n     :Explore\n     :Sexplore\n     :Vexplore\n     :Texplore\n\n    From the file explorer, you can browse through directories, rename,\n    delete and edit files.\n\n    For more information, read:\n\n    \u001b[1m:help netrw.vim\u001b[0m\n\n    \u001b[1m:help 22.1\u001b[0m\n\n  \u001b[1m6.7. How do I edit files over a network using ftp/scp/rcp/http?\u001b[0m\n    You can use the netrw.vim plugin, supplied with the standard Vim\n    package, to edit files over a network using ftp/scp/rcp/http. Using this\n    plugin, Vim will transparently load and save the files over\n    ftp/scp/rcp/http. For example, to edit a file over ftp, you can use the\n    following command:\n\n     $ vim ftp://machine/path\n\n    For more information, read:\n\n    \u001b[1m:help netrw.vim\u001b[0m\n\n\u001b[1mBACKUP\u001b[0m\n  \u001b[1m7.1. When I edit and save files, Vim creates a file with the same name as\n  the original file and a \"~\" character at the end. How do I stop Vim\n  from creating this file? (or) How do I disable the Vim backup file\n  feature?\u001b[0m\n    You have set the 'backup' option, so Vim creates a backup file when\n    saving the original file. You can stop Vim from creating the backup\n    file, by clearing the option:\n\n     :set nobackup\n\n    Note that, by default this option is turned off. You have explicitly\n    enabled the 'backup' option in one of the initialization files. You may\n    also have to turn off the 'writebackup' option:\n\n     :set nowritebackup\n\n    For more information, read:\n\n    \u001b[1m:help 07.4\u001b[0m\n\n    \u001b[1m:help backup-table\u001b[0m\n\n    \u001b[1m:help 'backup'\u001b[0m\n\n    \u001b[1m:help 'writebackup'\u001b[0m\n\n    \u001b[1m:help 'backupskip'\u001b[0m\n\n    \u001b[1m:help 'backupdir'\u001b[0m\n\n    \u001b[1m:help 'backupext'\u001b[0m\n\n    \u001b[1m:help 'backupcopy'\u001b[0m\n\n    \u001b[1m:help backup\u001b[0m\n\n  \u001b[1m7.2. When I edit and save files, Vim creates a file with the same name as\n  the original file and a \"un~\" extension at the end. How do I stop Vim\n  from creating this file (or) How do I disable the Vim undofile feature?\u001b[0m\n    Vim 7.3 contains as new feature persistent undo, that is, undo\n    information won't be lost when quitting Vim and be stored in a file that\n    ends with \".un~\" You have set the 'undofile' option, so Vim creates an\n    undo file when saving the original file. You can stop Vim from creating\n    the backup file, by clearing the option:\n\n     :set noundofile\n\n    Note that, by default this option is turned off. You have explicitly\n    enabled the 'undofile' option in one of the initialization files. If you\n    want your undofiles to be stored only in a particular directory, you can\n    point the 'undodir' option to a directory that will contain all your\n    aggregated undofiles.\n\n    For more information, read:\n\n    \u001b[1m:help 'undodir'\u001b[0m\n\n    \u001b[1m:help 'undofile'\u001b[0m\n\n    \u001b[1m:help undo-persistence\u001b[0m\n\n  \u001b[1m7.3. How do I configure Vim to store all the backup files in a particular\n  directory?\u001b[0m\n    You can configure Vim to store all the backup files in a particular\n    directory using the 'backupdir' option. For example, to store all the\n    backup files in the ~/backup directory, you can use the following\n    command:\n\n     :set backupdir=~/backup\n\n    For more information, read:\n\n    \u001b[1m:help 07.4\u001b[0m\n\n    \u001b[1m:help 'backupdir'\u001b[0m\n\n    \u001b[1m:help backup\u001b[0m\n\n  \u001b[1m7.4. When I save a file with Vim, the file permissions are changed.\n  How do I configure Vim to save a file without changing the file\n  permissions?\u001b[0m\n    This may happen, if the 'backupcopy' option is set to \"no\" or \"auto\".\n    Note that the default value for this option is set in such a way that\n    this will correctly work in most of the cases. If the default doesn't\n    work for you, try setting the 'backupcopy' option to \"yes\" to keep the\n    file permission when saving a file:\n\n     :set backupcopy=yes\n\n    This applies, only if you have configured Vim to make a backup whenever\n    overwriting a file. By default, Vim will not backup files.\n\n    For more information, read:\n\n    \u001b[1m:help 'backupcopy'\u001b[0m\n\n    \u001b[1m:help backup\u001b[0m\n\n    \u001b[1m:help 'backup'\u001b[0m\n\n    \u001b[1m:help 'writebackup'\u001b[0m\n\n\u001b[1mBUFFERS\u001b[0m\n  \u001b[1m8.1. I have made some modifications to a buffer. How do I edit another\n  buffer without saving the modified buffer and also without losing the\n  modifications?\u001b[0m\n    You can set the 'hidden' option to edit a file without losing\n    modifications to the current file:\n\n     :set hidden\n\n    By setting the 'hidden' option, you can also save the modification\n    history (undo-history) for the buffer. Otherwise, as you switch between\n    files, the undo-history will be lost (unless you use persistent\n    undofiles).\n\n    For more information, read:\n\n    \u001b[1m:help 'hidden'\u001b[0m\n\n    \u001b[1m:help hidden-quit\u001b[0m\n\n    \u001b[1m:help :hide\u001b[0m\n\n  \u001b[1m8.2. How do I configure Vim to auto-save a modified buffer when switching\n  to another buffer?\u001b[0m\n    You can set the 'autowrite' option to auto-save a modified buffer when\n    switching to another buffer:\n\n     :set autowrite\n\n    For more information, read:\n\n    \u001b[1m:help 'autowrite'\u001b[0m\n\n    \u001b[1m:help 'autowriteall'\u001b[0m\n\n    \u001b[1m:help 'hidden'\u001b[0m\n\n  \u001b[1m8.3. How do I replace the buffer in the current window with a blank buffer?\u001b[0m\n    You can use the `:enew` command to load an empty buffer in place of the\n    buffer in the current window.\n\n    For more information, read:\n\n    \u001b[1m:help :enew\u001b[0m\n\n  \u001b[1m8.4. Is there a keyboard shortcut to load a buffer by the buffer number?\u001b[0m\n    You can use the CTRL-^ command to load a buffer by specifying the buffer\n    number. For example, to load buffer number 5, you have to use the 5\n    CTRL-^ command.\n\n    For more information, read:\n\n    \u001b[1m:help CTRL-^\u001b[0m\n\n  \u001b[1m8.5. How do I open all the current buffers in separate windows?\u001b[0m\n    You can use the `:ball` or `:sball` commands to open all the buffers in\n    the buffer list:\n\n     :ball\n\n    If you want all buffers to be opened in new tabs, simply prefix the\n    `:tab` command:\n\n     :tab :sball\n\n    For more information, read:\n\n    \u001b[1m:help :ball\u001b[0m\n\n  \u001b[1m8.6. How do I close (delete) a buffer without exiting Vim?\u001b[0m\n    You can use any of `:bdelete`, `:bwipeout` or `:bunload` commands to\n    delete a buffer without exiting Vim. For example:\n\n     :bdelete file1\n\n    For more information, read:\n\n    \u001b[1m:help :bdelete\u001b[0m\n\n    \u001b[1m:help :bwipeout\u001b[0m\n\n    \u001b[1m:help :bunload\u001b[0m\n\n  \u001b[1m8.7. When I use the command `:%bd` to delete all the buffers, not all the\n  buffers are deleted. Why?\u001b[0m\n    In the `:%bd` command, the \"%\" range will be replaced with the starting\n    and ending line numbers in the current buffer. Instead of using \"%\" as\n    the range, you should specify numbers for the range. For example, to\n    delete all the buffers, you can use the command `:1,9999bd`.\n\n    For more information, read:\n\n    \u001b[1m:help :bd\u001b[0m\n\n    (This behaviour has been fixed with patch 7.4.530)\n\n  \u001b[1m8.8. How do I display the buffer number of the current buffer/file?\u001b[0m\n    You can use 2<CTRL-G> command to display the buffer number for the\n    current file/buffer. Note the use of count before the CTRL-G command. If\n    the count is greater than 1, then Vim will display the buffer number.\n\n    You can also use the following command to display the current buffer\n    number:\n\n     :echo bufnr(\"%\")\n\n    You can also include the \"%n\" field to the 'statusline' option to\n    display the current buffer number on the statusline.\n\n    For more information, read:\n\n    \u001b[1m:help CTRL-G\u001b[0m\n\n    \u001b[1m:help bufnr()\u001b[0m\n\n    \u001b[1m:help :echo\u001b[0m\n\n    \u001b[1m:help 'statusline'\u001b[0m\n\n  \u001b[1m8.9. How do I delete a buffer without closing the window in which the\n  buffer is displayed?\u001b[0m\n    You can use the following command to open the next buffer and delete the\n    current buffer.\n\n     :bnext | bdelete #\n\n    For more information, read:\n\n    \u001b[1m:help :bnext\u001b[0m\n\n    \u001b[1m:help :bdelete\u001b[0m\n\n    \u001b[1m:help :buffers\u001b[0m\n\n  \u001b[1m8.10. How do I map the <Tab> key to cycle through and open all the buffers?\u001b[0m\n    You can use the following two map commands, to map the <Ctrl-Tab> key to\n    open the next buffer and the <Ctrl-Shift-Tab> key to open the previous\n    buffer:\n\n     :nnoremap <C-Tab> :bnext<CR>\n     :nnoremap <S-C-Tab> :bprevious<CR>\n\n    Note, this might not work in the terminal version of Vim.\n\n    For more information, read:\n\n    \u001b[1m:help :bnext\u001b[0m\n\n    \u001b[1m:help :bprevious\u001b[0m\n\n\u001b[1mWINDOWS\u001b[0m\n  \u001b[1m9.1. What is the difference between a Vim window and a buffer?\u001b[0m\n    A Vim buffer is a file loaded into memory for editing. The original file\n    remains unchanged until you write the buffer to the file. A Vim window\n    is a viewport onto a buffer. You can use multiple windows on one buffer\n    or several windows on different buffers.\n\n    For more information, read:\n\n    \u001b[1m:help usr_08.txt\u001b[0m\n\n    \u001b[1m:help 22.4\u001b[0m\n\n    \u001b[1m:help windows-intro\u001b[0m\n\n    \u001b[1m:help Q_wi\u001b[0m\n\n  \u001b[1m9.2. How do I increase the width of a Vim window?\u001b[0m\n    You can increase the width of a Vim window using one of the following\n    commands:\n\n     :vert resize +N\n     :vert resize -N\n     :vert resize N\n\n    You can also use CTRL-W < or CTRL-W > or CTRL-W | commands.\n\n    For more information, read:\n\n    \u001b[1m:help :vertical-resize\u001b[0m\n\n    \u001b[1m:help CTRL-W_\u001b[0m>\n\n    \u001b[1m:help CTRL-W_<\u001b[0m\n\n    \u001b[1m:help window-resize\u001b[0m\n\n  \u001b[1m9.3. How do I zoom into or out of a window?\u001b[0m\n    You can zoom into a window (close all the windows except the current\n    window) using the \"<CTRL-W>o\" command or the `:only` ex command.\n\n    You can use the \"<CTRL-W>_\" command or the `:resize` ex command to\n    increase the current window height to the highest possible without\n    closing other windows.\n\n    You can use the \"<CTRL-W>|\" command or the `:vertical resize` ex command\n    to increase the current window width to the highest possible without\n    closing other windows.\n\n    You can use the \"<CTRL-W>=\" command to make the height and width of all\n    the windows equal.\n\n    You can also set the following options to get better results with the\n    above commands:\n\n    Method 1: Set the 'winminheight' option to 0:\n\n     :set winminheight=0\n\n    By default, this option is set to 1. This option controls the minimum\n    height of an inactive window (when it is not the current window). When\n    the 'winminheight' option is set to 0, only the status line will be\n    displayed for inactive windows.\n\n    Method 2: Set the 'noequalalways' option and set the 'winheight' option\n    to a large value (like 99999):\n\n     :set noequalalways\n     :set winheight=99999\n\n    Now, the active window will always open to its maximum size, while the\n    other windows will stay present, but shrunken to just a status line.\n\n    With any of the above mentioned methods, you cannot restore the window\n    layout after zooming into a window. If you want to restore the Vim\n    window layout after zooming into a window, you can use the ZoomWin\n    plugin. You can download this plugin from the Vim online website at:\n\n     https://www.vim.org/scripts/script.php?script_id=508\n\n    For more information, read:\n\n    \u001b[1m:help CTRL-W_o\u001b[0m\n\n    \u001b[1m:help window-resize\u001b[0m\n\n    \u001b[1m:help 'winminheight'\u001b[0m\n\n    \u001b[1m:help 'equalalways'\u001b[0m\n\n    \u001b[1m:help 'winheight'\u001b[0m\n\n    \u001b[1m:help 08.3\u001b[0m\n\n  \u001b[1m9.4. How do I execute an ex command on all the open buffers or open windows\n  or all the files in the argument list?\u001b[0m\n    You can use the `:bufdo` command to execute an ex command on all the\n    open buffers. You can use the `:windo` command to execute an ex command\n    on all the open windows. You can use the `:argdo` command to execute an\n    ex command on all the files specified in the argument list. And finally\n    you can use the `:tabdo` command to execute an ex command in all open\n    tab pages.\n\n    For more information, read:\n\n    \u001b[1m:help :windo\u001b[0m\n\n    \u001b[1m:help :bufdo\u001b[0m\n\n    \u001b[1m:help :argdo\u001b[0m\n\n    \u001b[1m:help :tabdo\u001b[0m\n\n    \u001b[1m:help 26.3\u001b[0m\n\n\u001b[1mMOTION\u001b[0m\n  \u001b[1m10.1. How do I jump to the beginning (first line) or end (last line) of a\n  file?\u001b[0m\n    You can use \"G\" command to jump to the last line in the file and the\n    \"gg\" command to jump to the first line in the file.\n\n    For more information, read:\n\n    \u001b[1m:help G\u001b[0m\n\n    \u001b[1m:help gg\u001b[0m\n\n  \u001b[1m10.2. In insert mode, when I press the <Esc> key to go to command mode, the\n  cursor moves one character to the left (except when the cursor is on\n  the first character of the line). Is it possible to change this\n  behavior to keep the cursor at the same column?\u001b[0m\n    No. It is not possible to change this behavior. The cursor is *always*\n    positioned on a valid character (unless you have virtual-edit mode\n    enabled). So, if you are appending text to the end of a line, when you\n    return to command mode the cursor *must* drop back onto the last\n    character you typed. For consistency sake, the cursor drops back\n    everywhere, even if you are in the middle of a line.\n\n    You can use the CTRL-O or CTRL-\\ CTRL-O command in insert mode to\n    execute a single ex command and return back to insert mode without\n    moving the cursor column.\n\n    For more information, read:\n\n    \u001b[1m:help 'virtualedit'\u001b[0m\n\n    \u001b[1m:help i_CTRL-O\u001b[0m\n\n    \u001b[1m:help i_CTRL-\\_CTRL-O\u001b[0m\n\n  \u001b[1m10.3. How do I configure Vim to maintain the horizontal cursor position when\n  scrolling with the <Page Up>, <Page Down>, etc keys?\u001b[0m\n    You can reset the 'startofline' option to keep the cursor at the same\n    horizontal location when scrolling text:\n\n     :set nostartofline\n\n    For more information, read:\n\n    \u001b[1m:help 'startofline'\u001b[0m\n\n  \u001b[1m10.4. Some lines in a file are more than the screen width and they are all\n  wrapped. When I use the j, k keys to move from one line to the next,\n  the cursor is moved to the next line in the file instead of the next\n  line on the screen. How do I move from one screen line to the next?\u001b[0m\n    You can use the gj and gk commands to move from one screen line to the\n    next/previous screen line. The j and k commands move the cursor from one\n    file line to the next file line. You can also avoid the line wrapping by\n    resetting the 'wrap' option:\n\n     :set nowrap\n\n    For more information, read:\n\n    \u001b[1m:help gj\u001b[0m\n\n    \u001b[1m:help gk\u001b[0m\n\n    \u001b[1m:help 'wrap'\u001b[0m\n\n    You can use the following mappings:\n\n     :map <Up> gk\n     :imap <Up> <C-o>gk\n     :map <Down> gj\n     :imap <Down> <C-o>gj\n     :noremap j gj\n     :noremap k gk\n\n  \u001b[1m10.5. What is the definition of a sentence, paragraph and section in Vim?\u001b[0m\n    A sentence is defined as ending at a \".\", \"!\" or \"?\" followed by either\n    the end of a line, or by a space (or two) or tab. Which characters and\n    the number of spaces needed to constitute a sentence ending is\n    determined by the 'joinspaces' and 'cpoptions' options.\n\n    A paragraph begins after each empty line, and also at each of a set of\n    paragraph macros, specified by the pairs of characters in the\n    'paragraphs' option.\n\n    A section begins after a form-feed (<C-L>) in the first column and at\n    each of a set of section macros, specified by the pairs of characters in\n    the 'sections' option.\n\n    For more information, read:\n\n    \u001b[1m:help sentence\u001b[0m\n\n    \u001b[1m:help 'joinspaces'\u001b[0m\n\n    \u001b[1m:help 'cpoptions'\u001b[0m\n\n    \u001b[1m:help paragraph\u001b[0m\n\n    \u001b[1m:help section\u001b[0m\n\n    \u001b[1m:help word\u001b[0m\n\n  \u001b[1m10.6. How do I jump to beginning or end of a sentence, paragraph or a\n  section?\u001b[0m\n    You can use the following motion commands to jump to the beginning or\n    end of a sentence or a paragraph or a section:\n\n       motion  position    where\n       ------  ---------   -----------------\n       (       beginning   current sentence\n       )       end         current sentence\n       {       beginning   current paragraph\n       }       end         current paragraph\n       []      end         previous section\n       [[      beginning   current section\n       ][      end         current section\n       ]]      beginning   next section\n\n    Each of these motions can be preceded by a number which will extend the\n    jump forward (or backward).\n\n    For more information, read:\n\n    \u001b[1m:help object-motions\u001b[0m\n\n  \u001b[1m10.7. I have lines in a file that extends beyond the right extent of the\n  screen. How do I move the Vim view to the right to see the text off\n  the screen?\u001b[0m\n    You can use one of the following commands to horizontally scroll the\n    screen to the left or right:\n\n     cmd  scroll to\n     ---  --------------------------\n     zl   scroll to the left\n     zh   scroll to the right\n     zL   scroll half a screenwidth to the left\n     zH   scroll half a screenwidth to the right\n     zs   scroll to position the cursor at the start of the screen\n     ze   scroll to position the cursor at the end of the screen\n\n    You can use the g0 command to move the cursor to the first character of\n    the screen line and the g$ command to move the cursor to the last\n    character of the screen line without scrolling the screen.\n\n    For more information, read:\n\n    \u001b[1m:help scroll-horizontal\u001b[0m\n\n  \u001b[1m10.8. How do I scroll two or more buffers simultaneously?\u001b[0m\n    You can set the 'scrollbind' option for each of the buffers to scroll\n    them simultaneously.\n\n    For more information, read:\n\n    \u001b[1m:help 'scrollbind'\u001b[0m\n\n    \u001b[1m:help scroll-binding\u001b[0m\n\n    \u001b[1m:help 'scrollopt'\u001b[0m\n\n    \u001b[1m:help 'cursorbind'\u001b[0m\n\n  \u001b[1m10.9. When I use my arrow keys, Vim changes modes, inserts weird characters\n  in my document but doesn't move the cursor properly. What's going on?\u001b[0m\n    There are a couple of things that could be going on: either you are\n    using Vim over a slow connection or Vim doesn't understand the key\n    sequence that your keyboard is generating.\n\n    If you are working over a slow connection (such as a 2400 bps modem),\n    you can try to set the 'timeout' or 'ttimeout' option. These options,\n    combined with the 'timeoutlen' and 'ttimeoutlen' options, may fix the\n    problem.\n\n    The preceding procedure will not work correctly if your terminal sends\n    key codes that Vim does not understand. In this situation, your best\n    option is to map your key sequence to a matching cursor movement command\n    and save these mappings in a file. You can then `:source` the file\n    whenever you work from that terminal.\n\n    For more information, read:\n\n    \u001b[1m:help 'timeout'\u001b[0m\n\n    \u001b[1m:help 'ttimeout'\u001b[0m\n\n    \u001b[1m:help 'timeoutlen'\u001b[0m\n\n    \u001b[1m:help 'ttimeoutlen'\u001b[0m\n\n    \u001b[1m:help :map\u001b[0m\n\n    \u001b[1m:help vt100-cursor-keys\u001b[0m\n\n  \u001b[1m10.10. How do I configure Vim to move the cursor to the end of the previous\n   line, when the left arrow key is pressed and the cursor is currently\n   at the beginning of a line?\u001b[0m\n    You can add the \"<\" flag to the 'whichwrap' option to configure Vim to\n    move the cursor to the end of the previous line, when the left arrow key\n    is pressed and the cursor is currently at the beginning of a line:\n\n     :set whichwrap+=<\n\n    Similarly, to move the cursor the beginning of the next line, when the\n    right arrow key is pressed and the cursor is currently at the end of a\n    line, add the \">\" flag to the 'whichwrap' option:\n\n     :set whichwrap+=>\n\n    The above will work only in normal and visual modes. To use this in\n    insert and replace modes, add the \"[\" and \"]\" flags respectively.\n\n    For more information, read:\n\n    \u001b[1m:help 'whichwrap'\u001b[0m\n\n    \u001b[1m:help 05.7\u001b[0m\n\n  \u001b[1m10.11. How do I configure Vim to stay only in insert mode (modeless\n   editing)?\u001b[0m\n    You can set the 'insertmode' option to configure Vim to stay only in\n    insert mode:\n\n     :set insertmode\n\n    By setting this option, you can use Vim as a modeless editor. If you\n    press the <Esc> key, Vim will not go to the normal mode. To execute a\n    single normal mode command, you can press CTRL-O followed by the normal\n    mode command. To execute more than one normal command, you can use\n    CTRL-L followed by the commands. To return to insert mode, press the\n    <Esc> key. To disable this option, reset the 'insertmode' option:\n\n     :set noinsertmode\n\n    You can also start vim using the \"evim\" command or you can use \"vim -y\"\n    to use Vim as a modeless editor.\n\n    You can also start Vim in insert mode using the `:startinsert` ex\n    command.\n\n    For more information, read:\n\n    \u001b[1m:help 'insertmode'\u001b[0m\n\n    \u001b[1m:help :startinsert\u001b[0m\n\n    \u001b[1m:help :stopinsert\u001b[0m\n\n    \u001b[1m:help i_CTRL-O\u001b[0m\n\n    \u001b[1m:help i_CTRL-L\u001b[0m\n\n    \u001b[1m:help evim\u001b[0m\n\n    \u001b[1m:help evim-keys\u001b[0m\n\n  \u001b[1m10.12. How do I display some context lines when scrolling text?\u001b[0m\n    You can set the 'scrolloff' option to display a minimal number of screen\n    lines (context) above and below the cursor.\n\n     :set scrolloff=10\n\n    For more information, read:\n\n    \u001b[1m:help 'scrolloff'\u001b[0m\n\n    \u001b[1m:help 'sidescrolloff'\u001b[0m\n\n  \u001b[1m10.13. How do I go back to previous cursor locations?\u001b[0m\n    You can go back to the cursor location before the latest jump using the\n    '' or `` command. You can use the CTRL-O command to go back to older\n    cursor positions and the CTRL-I command to go to the newer cursor\n    positions in the jump list.\n\n    For more information, read:\n\n    \u001b[1m:help 03.10\u001b[0m\n\n    \u001b[1m:help mark-motions\u001b[0m\n\n    \u001b[1m:help jump-motions\u001b[0m\n\n\u001b[1mSEARCHING TEXT\u001b[0m\n  \u001b[1m11.1. After I searched for a text with a pattern, all the matched text\n   stays highlighted. How do I turn off the highlighting\n   temporarily/permanently?\u001b[0m\n    The 'hlsearch' option controls whether all the matches for the last\n    searched pattern are highlighted or not. By default, this option is not\n    enabled. If this option is set in a system-wide vimrc file, then you can\n    turn off the search highlighting by using the following command:\n\n     :set nohlsearch\n\n    To temporarily turn off the search highlighting, use\n\n     :nohlsearch\n\n    You can also clear the search highlighting, by searching for a pattern\n    that is not in the current file (for example, search for the pattern\n    \"asdf\").\n\n    You can use this mapping, to clear the search highlighting when\n    redrawing the window pressing CTRL-L\n\n     :nnoremap <silent> <C-L> <C-L>:nohls<CR>\n\n    For more information, read:\n\n    \u001b[1m:help 'hlsearch'\u001b[0m\n\n    \u001b[1m:help :nohlsearch\u001b[0m\n\n  \u001b[1m11.2. How do I enter a carriage return character in a search pattern?\u001b[0m\n    You can either use \"\\r\" or <CTRL-V><CTRL-M> to enter a carriage return\n    character in a pattern. In Vim scripts, it is better to use \"\\r\" for the\n    carriage return character.\n\n    For more information, read:\n\n    \u001b[1m:help sub-replace-special\u001b[0m\n\n  \u001b[1m11.3. How do I search for the character ^M?\u001b[0m\n    You can enter the ^M character in a search command by first pressing the\n    CTRL-V key and then pressing the CTRL-M key.\n\n     /^V^M\n\n    You can also use the \"\\r\" character. In Vim scripts, \"\\r\" is preferred.\n\n    For more information, read:\n\n    \u001b[1m:help c_CTRL-V\u001b[0m\n\n    \u001b[1m:help using_CTRL-V\u001b[0m\n\n    \u001b[1m:help /\\r\u001b[0m\n\n  \u001b[1m11.4. How can I search/replace characters that display as \"~R\", \"~S\", etc.?\u001b[0m\n    You can use the \"ga\" command to display the ASCII value/code for the\n    special character. For example, let us say the ASCII value is 142. Then\n    you can use the following command to search for the special character:\n\n     /^V142\n\n    where, ^V is entered by pressing CTRL-V.\n\n    For more information, read:\n\n    \u001b[1m:help ga\u001b[0m\n\n    \u001b[1m:help using_CTRL-V\u001b[0m\n\n    \u001b[1m:help 24.8\u001b[0m\n\n  \u001b[1m11.5. How do I highlight all the non-printable characters in a file?\u001b[0m\n    You can use the following commands and search pattern to highlight all\n    the non-printable characters in a file:\n\n     :set hlsearch\n     /\\(\\p\\|$\\)\\@!.\n\n    For more information, read:\n\n    \u001b[1m:help /\\p\u001b[0m\n\n    \u001b[1m:help /bar\u001b[0m\n\n    \u001b[1m:help /$\u001b[0m\n\n    \u001b[1m:help /\\(\u001b[0m\n\n    \u001b[1m:help /\\@!\u001b[0m\n\n    \u001b[1m:help 'hlsearch'\u001b[0m\n\n  \u001b[1m11.6. How do I search for whole words in a file?\u001b[0m\n    You can search for whole words in a file using the \\< and \\> atoms. For\n    example:\n\n     /\\<myword\\>\n\n    The \\< atom matches the beginning of the word and the \\> atom matches\n    the end of the word.\n\n    For more information, read:\n\n    \u001b[1m:help /\\<\u001b[0m\n\n    \u001b[1m:help /\\\u001b[0m>\n\n  \u001b[1m11.7. How do I search for the current word under the cursor?\u001b[0m\n    You can press the * key to search forward for the current word under the\n    cursor. To search backward, you can press the # key. Note that only\n    whole keywords will be searched using these commands.\n\n    For more information, read:\n\n    \u001b[1m:help star\u001b[0m\n\n    \u001b[1m:help #\u001b[0m\n\n    \u001b[1m:help gstar\u001b[0m\n\n    \u001b[1m:help g#\u001b[0m\n\n    \u001b[1m:help 03.8\u001b[0m\n\n    \u001b[1m:help search-commands\u001b[0m\n\n  \u001b[1m11.8. How do I search for a word without regard to the case (uppercase or\n   lowercase)?\u001b[0m\n    To always ignore case while searching for a pattern, set the\n    'ignorecase' option:\n\n     :set ignorecase\n\n    To ignore case only when searching a particular pattern, use the special\n    \\c directive:\n\n     /\\c<pattern>\n\n    For more information, read:\n\n    \u001b[1m:help 'ignorecase'\u001b[0m\n\n    \u001b[1m:help /ignorecase\u001b[0m\n\n    \u001b[1m:help /\\c\u001b[0m\n\n  \u001b[1m11.9. How do I search for words that occur twice consecutively?\u001b[0m\n    You can use one of the following search commands to locate words that\n    occur twice consecutively:\n\n      /\\(\\<\\w\\+\\)\\_s\\+\\1\\>\n      /\\(\\<\\k\\+\\)\\_s\\+\\1\\>\n\n    The main difference is the use of \"\\w\" and \"\\k\", where the latter is\n    based on the 'iskeyword' option which may include accented and other\n    language specific characters.\n\n    For more information, read:\n\n    \u001b[1m:help /\\1\u001b[0m\n\n    \u001b[1m:help /\\(\u001b[0m\n\n    \u001b[1m:help /\\)\u001b[0m\n\n    \u001b[1m:help /\\<\u001b[0m\n\n    \u001b[1m:help /\\\u001b[0m>\n\n    \u001b[1m:help /\\w\u001b[0m\n\n    \u001b[1m:help /\\k\u001b[0m\n\n    \u001b[1m:help /\\+\u001b[0m\n\n    \u001b[1m:help /\\_x\u001b[0m\n\n    \u001b[1m:help 'iskeyword'\u001b[0m\n\n  \u001b[1m11.10. How do I count the number of times a particular word occurs in a\n    buffer?\u001b[0m\n    You can use the following set of commands to count the number of times a\n    particular word occurs in a buffer:\n\n     :let cnt=0\n     :g/\\<your_word\\>/let cnt=cnt+1\n     :echo cnt\n\n    This only counts the number of lines where the word occurs. You can also\n    use the following command:\n\n     :%s/\\<word\\>/&/gn\n\n    To count the number of alphabetic words in a file, you can use\n\n     :%s/\\a\\+/&/gn\n\n    To count the number of words made up of non-space characters, you can\n    use\n\n     :%s/\\S\\+/&/gn\n\n    For more information, read:\n\n    \u001b[1m:help count-items\u001b[0m\n\n    \u001b[1m:help word-count\u001b[0m\n\n    \u001b[1m:help v_g_CTRL-G\u001b[0m\n\n    \u001b[1m:help 12.5\u001b[0m\n\n    \u001b[1m:help :s_flags\u001b[0m\n\n  \u001b[1m11.11. How do I place the cursor at the end of the matched word when\n    searching for a pattern?\u001b[0m\n    You can use the \"e\" offset to the search command to place the cursor at\n    the end of the matched word. For example\n\n     /mypattern/e\n\n    For more information about search offsets, read:\n\n    \u001b[1m:help search-offset\u001b[0m\n\n    \u001b[1m:help /\u001b[0m\n\n  \u001b[1m11.12. How do I search for an empty line?\u001b[0m\n    You can search for an empty line using:\n\n     /^$\n\n     or\n\n     /^\\s*$\n\n    The latter also matches lines, that consist only of white space, while\n    the former only matches true empty lines. For more information, read:\n\n    \u001b[1m:help /^\u001b[0m\n\n    \u001b[1m:help /$\u001b[0m\n\n    \u001b[1m:help /\\s\u001b[0m\n\n    \u001b[1m:help /star\u001b[0m\n\n    \u001b[1m:help search-commands\u001b[0m\n\n  \u001b[1m11.13. How do I search for a line containing only a single character?\u001b[0m\n    You can search for a line containing only a single character using:\n\n     /^\\s*\\a\\s*$\n\n    For more information, read:\n\n    \u001b[1m:help /^\u001b[0m\n\n    \u001b[1m:help /\\a\u001b[0m\n\n    \u001b[1m:help /\\s\u001b[0m\n\n    \u001b[1m:help /star\u001b[0m\n\n    \u001b[1m:help /$\u001b[0m\n\n  \u001b[1m11.14. How do I search and replace a string in multiple files?\u001b[0m\n    You can use the `:argdo`, `:bufdo`, `:windo` or `:tabdo` commands to\n    execute an ex command on multiple files. For example:\n\n     :argdo %s/foo/bar/g|upd\n\n    For more information, read:\n\n    \u001b[1m:help :argdo\u001b[0m\n\n    \u001b[1m:help :bufdo\u001b[0m\n\n    \u001b[1m:help :windo\u001b[0m\n\n    \u001b[1m:help :tabdo\u001b[0m\n\n  \u001b[1m11.15. I am using the `:s` substitute command in a mapping. When a search\n    for a pattern fails, the map terminates. I would like the map to\n    continue processing the next command, even if the substitute command\n    fails. How do I do this?\u001b[0m\n    You can use the \"e\" flag to the substitute command to continue\n    processing other commands in a map, when a pattern is not found.\n\n    For more information, read:\n\n    \u001b[1m:help :s_flags\u001b[0m\n\n  \u001b[1m11.16. How do I search for the n-th occurrence of a character in a line?\u001b[0m\n    To search for the n-th occurrence of a character in a line, you can\n    prefix the \"f\" command with a number. For example, to search for the 5th\n    occurrence of the character @ in a line, you can use the command 5f@.\n    This assumes the cursor is at the beginning of the line - and that this\n    first character is not the one your are looking for.\n\n    For more information, read:\n\n    \u001b[1m:help f\u001b[0m\n\n    \u001b[1m:help F\u001b[0m\n\n    \u001b[1m:help t\u001b[0m\n\n    \u001b[1m:help T\u001b[0m\n\n    \u001b[1m:help ;\u001b[0m\n\n    \u001b[1m:help ,\u001b[0m\n\n  \u001b[1m11.17. How do I replace a tab (or any other character) with a hard return\n    (newline) character?\u001b[0m\n    You can replace a tab (or any other character) with a hard return\n    (newline) character using the following command:\n\n     :s/\\t/\\r/\n\n    Note that in the above command, if you use \\n instead of \\r, then the\n    tab characters will not be replaced by a new-line character.\n\n    For more information, read:\n\n    \u001b[1m:help sub-replace-special\u001b[0m\n\n    \u001b[1m:help NL-used-for-Nul\u001b[0m\n\n    \u001b[1m:help CR-used-for-NL\u001b[0m\n\n  \u001b[1m11.18. How do I search for a character by its ASCII value?\u001b[0m\n    You can search for a character by its ASCII value by pressing CTRL-V\n    followed by the decimal or hexadecimal or octal value of that character\n    in the search \"/\" command. To determine the ASCII value of a character\n    you can use the `:ascii` or the \"ga\" command.\n\n    For example, to search for the ASCII character with value 188, you can\n    use one of the following search commands:\n\n     /<CTRL-V>188\n     /<CTRL-V>o274\n     /<CTRL-V>xBC\n     /<CTRL-V>u00bc\n\n    You can also search for the character with the decimal/octal/hex number\n    using a collation [] like this:\n\n     /[\\d188]\n     /[\\o274]\n     /[\\xbc]\n     /[\\u00bc]\n\n    Alternatively, you can use the special atom \\%d \\%o \\%x \\%u:\n\n     /\\%d188\n     /\\%o274\n     /\\%xbc\n     /\\%u00bc\n\n    Or you use digraphs to enter the character. For example enter:\n\n     /CTRL-K14\n\n    to search for the above character.\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-V_digit\u001b[0m\n\n    \u001b[1m:help :ascii\u001b[0m\n\n    \u001b[1m:help ga\u001b[0m\n\n    \u001b[1m:help /\\]\u001b[0m\n\n    \u001b[1m:help /\\%d\u001b[0m\n\n    \u001b[1m:help digraphs\u001b[0m\n\n  \u001b[1m11.19. How do I search for long lines?\u001b[0m\n    You can search for long lines or lines containing more than a specific\n    number of characters using the Vim regular-expressions in the search\n    command. For example, to search for all the lines containing more than\n    80 characters, you can use one of the following commands:\n\n     /^.\\{80}.\\+$\n     /^.*\\%>80c.*$\n     /^.*\\%>80v.*$\n\n    For more information, read:\n\n    \u001b[1m:help /\\{\u001b[0m\n\n    \u001b[1m:help /\\%c\u001b[0m\n\n    \u001b[1m:help /\\%v\u001b[0m\n\n  \u001b[1m11.20. How do I display all the lines in the current buffer that contain a\n    specified pattern?\u001b[0m\n    You can use the following command to display all the lines in the\n    current buffer that contain a specified pattern:\n\n     :g/<pattern>/p\n\n    For example, the following command will display all the lines in the\n    current buffer that contain \"vim\":\n\n     :g/vim/p\n\n    Since `:p` is the default command to be executed for the ex command\n    `:g`, you can also use:\n\n     :g/vim\n\n    If you also want the corresponding line numbers, then you can use the\n    following command:\n\n     :g/<pattern>/#\n\n    For more information, read:\n\n    \u001b[1m:help :global\u001b[0m\n\n    \u001b[1m:help :print\u001b[0m\n\n    \u001b[1m:help :number\u001b[0m\n\n  \u001b[1m11.21. How do I search for a text string that spans multiple lines?\u001b[0m\n    You can search for a text string that spans multiple lines using the \\_x\n    regular expression atom. For example, to search for the text string\n    \"Hello World\", you can use the following search command:\n\n     /Hello\\_sWorld\n\n    This will match the word \"Hello\" followed by a newline character and\n    then the word \"World\" at the beginning of the next line. This will also\n    match the word \"Hello\" immediately followed by a space character and\n    then the word \"World\". When searching for the \"Hello World\" string, to\n    include the space characters at the end and beginning of the line, you\n    can use the following search command:\n\n     /Hello\\_s\\+World\n\n    For more information, read:\n\n    \u001b[1m:help 27.8\u001b[0m\n\n    \u001b[1m:help pattern-atoms\u001b[0m\n\n    \u001b[1m:help /\\_\u001b[0m\n\n    \u001b[1m:help pattern-searches\u001b[0m\n\n  \u001b[1m11.22. How do I search for a pattern within the specified range of lines\n    in a buffer?\u001b[0m\n    You can search for a pattern within a range of lines using the \\%>l and\n    \\%<l regular expression atoms.\n\n    For example, to search for the word \"white\" between the lines 10 and 30\n    in a buffer, you can use the following command:\n\n     /white\\%>9l\\%<31l\n\n    For more information, read:\n\n    \u001b[1m:help /\\%l\u001b[0m\n\n  \u001b[1m11.23. How do I clear the last searched pattern?\u001b[0m\n    The last searched pattern is stored in the \"/\" register. You can clear\n    this register using the following command:\n\n     :let @/=\"\"\n\n    To clear the last search pattern whenever a buffer is unloaded, you can\n    use the following command:\n\n     :autocmd BufUnload * let @/ = \"\"\n\n    For more information, read:\n\n    \u001b[1m:help @/\u001b[0m\n\n    \u001b[1m:help :let-@\u001b[0m\n\n    \u001b[1m:help autocmd-searchpat\u001b[0m\n\n    \u001b[1m:help last-pattern\u001b[0m\n\n  \u001b[1m11.24. Why does this pattern \"a.\\{-}p\\@!\" not match?\u001b[0m\n    \"\\{-}\" doesn't just mean \"as few as possible\", it means \"as few as\n    possible to make the whole pattern succeed\". If it didn't match the \"p\",\n    the whole pattern would fail (because of the \"p\\@!\") so it does match\n    the \"p\". It is a longer match, but it is the shortest match that makes\n    the whole pattern succeed.\n\n    If you wanted \"as few as possible regardless\" you would use \"\\@>\", which\n    basically divides a pattern up so that the pieces either side behave\n    independently. If the pattern were \"a.\\{-}\\@>p\\@!\" then \".\\{-}\" would\n    always match nothing because that's the smallest match that can succeed\n    when there are not other restrictions. The whole pattern then would\n    behave the same as \"ap\\@!\", i.e. it would match any \"a\" not followed by\n    a \"p\").\n\n    This means, it matches as few as possible \"a\"s without trying to keep\n    going until Vim finds the longest match. This means, it will still match\n    \"ap\".\n\n  \u001b[1m11.25. How can I use \"/\" within a pattern, without escaping it?\u001b[0m\n    When using / to search for a pattern, you need to escape all \"/\" within\n    the pattern, because they would otherwise terminate the pattern. So you\n    can't directly search for /usr/share/doc/ but need to search for\n    \\/usr\\/share\\/doc\\/\n\n    The easiest solution around that, would be to use \"?\" to start a\n    backward search and afterwards use /<CR> to use the last search-pattern\n    in forward direction.\n\n    If you have a Vim, that has the eval-feature built in (which needs at\n    least a normal built or higher), you can also directly paste the pattern\n    into the search register:\n\n    :let @/ = '/usr/share/doc/'\n\n    Then use \"n\" to jump to the next occurrence.\n\n    See also the help at\n\n    \u001b[1m:help @/\u001b[0m\n\n    \u001b[1m:help /<CR\u001b[0m>\n\n  \u001b[1m11.26. How can I operate on a search match?\u001b[0m\n    The \"gn\" command makes it easy to operate on regions of text that match\n    the current search pattern. By default, it will search forward for the\n    last used search pattern and visually select the match. If the cursor is\n    already on the match, it will be visually selected. If you used the \"gn\"\n    command after an operator (e.g. \"c\" to change text), it will be applied\n    on the match.\n\n    If Visual mode is active before using gn, the visual selection will be\n    extended until the end of the next match.\n\n    The \"gN\" commands works similar but searches backwards.\n\n    This allows to repeat simple operations on each match. For example, you\n    might want to change each occurence of apples by peaches. So you search\n    using \"/apple\" then you can use \"cgnpeach<Esc>\" to replace the current\n    match by peach. Now you can use the dot \".\" command to redo the\n    replacement for the rest of the buffer.\n\n    See also the help at\n\n    \u001b[1m:help gn\u001b[0m\n\n    \u001b[1m:help gN\u001b[0m\n\n\u001b[1mCHANGING TEXT\u001b[0m\n  \u001b[1m12.1. How do I delete all the trailing white space characters (SPACE and\n   TAB) at the end of all the lines in a file?\u001b[0m\n    You can use the `:substitute` command on the entire file to search and\n    remove all the trailing white space characters:\n\n     :%s/\\s\\+$//\n\n    For more information, read:\n\n    \u001b[1m:help :%\u001b[0m\n\n    \u001b[1m:help :s\u001b[0m\n\n    \u001b[1m:help /\\s\u001b[0m\n\n    \u001b[1m:help /\\+\u001b[0m\n\n    \u001b[1m:help /$\u001b[0m\n\n  \u001b[1m12.2. How do I replace all the occurrences of multiple consecutive space\n   characters to a single space?\u001b[0m\n    You can use the following command to replace all the occurrences of\n    multiple consecutive space characters to a single space:\n\n     :%s/ \\{2,}/ /g\n\n    Alternatively use:\n\n     :%s/  \\+/ /g\n\n    For more information, read:\n\n    \u001b[1m:help :%\u001b[0m\n\n    \u001b[1m:help :s\u001b[0m\n\n    \u001b[1m:help /\\{\u001b[0m\n\n    \u001b[1m:help :s_flags\u001b[0m\n\n  \u001b[1m12.3. How do I reduce a range of empty lines into one line only?\u001b[0m\n    You can use the following command to reduce a range of empty lines into\n    one line only:\n\n     :v/./.,/./-1join\n\n    The explanation for this command is below:\n\n     part            description\n     -----           --------------------------\n     :v/./           Execute the following command for all lines not\n                     containing a character (empty lines).\n      .,             Use the current line as the start of the range of\n                     lines.\n      /./            Use the line containing a character as the last line.\n      -1             Adjust the range of lines to end with the line before\n                     the last line.\n      j              Join the lines in the range.\n\n    Note that this will give an error message if the empty lines are at the\n    end of the file. To correct this, you have to add a temporary line at\n    the end of the file, execute the command and then remove the temporary\n    line.\n\n    For more information, read:\n\n    \u001b[1m:help :v\u001b[0m\n\n    \u001b[1m:help :join\u001b[0m\n\n    \u001b[1m:help cmdline-ranges\u001b[0m\n\n    \u001b[1m:help collapse\u001b[0m\n\n  \u001b[1m12.4. How do I delete all blank lines in a file? How do I remove all the\n   lines containing only space characters?\u001b[0m\n    To remove all blank lines, use the following command:\n\n     :g/^$/d\n\n    To remove all lines with only whitespace (spaces or tabs) in them, use\n    the following command:\n\n     :g/^\\s\\+$/d\n\n    To remove all the lines with only whitespace, if anything, use the\n    following command:\n\n     :g/^\\s*$/d\n\n  \u001b[1m12.5. How do I copy/yank the current word?\u001b[0m\n    You can use the \"yiw\" (yank inner word without whitespace) command or\n    the \"yaw\" (yank a word with whitespace) command to copy/yank the current\n    word.\n\n    For more information, read:\n\n    \u001b[1m:help 04.6\u001b[0m\n\n    \u001b[1m:help 04.8\u001b[0m\n\n    \u001b[1m:help iw\u001b[0m\n\n    \u001b[1m:help yank\u001b[0m\n\n    \u001b[1m:help text-objects\u001b[0m\n\n    \u001b[1m:help objects\u001b[0m\n\n  \u001b[1m12.6. How do I yank text from one position to another position within a\n   line, without yanking the entire line?\u001b[0m\n    You can specify a motion command with the yank operator (y) to yank text\n    from one position to another position within a line. For example, to\n    yank from the current cursor position till the next letter x, use yfx or\n    Fx or tx or Tx. To yank till the nth column, use n|. To yank till the\n    next occurrence of a \"word\", use /word. To do a yank till the nth column\n    on another line, first mark the position using the \"ma\" command, go to\n    the start of the yank position, and then yank till the mark using y`a\n    (note the direction of the quote)\n\n    For more information, read:\n\n    \u001b[1m:help yank\u001b[0m\n\n    \u001b[1m:help motion.txt\u001b[0m\n\n    \u001b[1m:help 04.6\u001b[0m\n\n  \u001b[1m12.7. When I yank some text into a register, how do I append the text to\n   the current contents of the register?\u001b[0m\n    When you specify the register for some operation, if you use the\n    upper-case for the register name, then the new text will be appended to\n    the existing contents. For example, if you have some text in the\n    register \"a\". If you want to append some new text to this, you have to\n    use the \"A\" register name. If you use the lowercase register name, then\n    the contents of the register will be overwritten with the new text.\n\n    For more information, read:\n\n    \u001b[1m:help quote\u001b[0m\n\n    \u001b[1m:help quote_alpha\u001b[0m\n\n    \u001b[1m:help 10.1\u001b[0m\n\n  \u001b[1m12.8. How do I yank a complete sentence that spans over more than one line?\u001b[0m\n    To yank a complete sentence that spans over more than one line you have\n    to use the yank operator followed by a motion command. For example:\n\n         y)\n\n    From inside the sentence you can use \"yi)\" to yank the sentence.\n\n    For more information, read:\n\n    \u001b[1m:help yank\u001b[0m\n\n    \u001b[1m:help {motion}\u001b[0m\n\n    \u001b[1m:help object-motions\u001b[0m\n\n    \u001b[1m:help 04.6\u001b[0m\n\n  \u001b[1m12.9. How do I yank all the lines containing a pattern into a buffer?\u001b[0m\n    You can use the `:global` command to yank all the lines containing the\n    pattern into a register and then paste the contents of the register into\n    the buffer:\n\n     :let @a=''\n     :g/mypattern/y A\n\n    The first command, clears the contents of the register \"a\". The second\n    command copies all the lines containing \"mypattern\" into the register\n    \"a\". Note that the capital letter \"A\" is used to append the matched\n    lines. Now you can paste the contents of register \"a\" to a buffer using\n    \"ap command.\n\n    If you only want to collect all matches, you can use a different\n    approach. For that run the `:s` command with the flags \"gn\" so that it\n    won't actually change the buffer (\"n\" flag) but select each match (\"g\"\n    flag). Combining this with the \"\\=\" part in the replacement part, you\n    can copy each match to e.g. a list. Altogether this looks like this:\n\n     :let list=[]\n     :%s/pattern/\\=add(list, submatch(0))/gn\n\n    Now all matches will be in the list and you can post process them as\n    wanted.\n\n    For more information, read:\n\n    \u001b[1m:help :g\u001b[0m\n\n    \u001b[1m:help :y\u001b[0m\n\n    \u001b[1m:help :let-register\u001b[0m\n\n    \u001b[1m:help quote_alpha\u001b[0m\n\n    \u001b[1m:help put\u001b[0m\n\n    \u001b[1m:help registers\u001b[0m\n\n    \u001b[1m:help :registers\u001b[0m\n\n    \u001b[1m:help sub-replace-\\=\u001b[0m\n\n  \u001b[1m12.10. How do I delete all the lines in a file that do not contain a\n    pattern?\u001b[0m\n    You can use `:v` command to delete all the lines that do not contain a\n    pattern:\n\n     :v/pattern/d\n\n    or\n\n     :g!/pattern/d\n\n    For more information, read:\n\n    \u001b[1m:help :v\u001b[0m\n\n    \u001b[1m:help :g\u001b[0m\n\n  \u001b[1m12.11. How do I add a line before each line with \"pattern\" in it?\u001b[0m\n    You can use the following command to add a line before each line with\n    \"pattern\" in it:\n\n     :g/pattern/normal! Oi<line of text goes here>\n\n    Alternatively you can yank the line using the Y command and then insert\n    the line using the following command:\n\n     :g/pattern/put!\n\n    For more information, read:\n\n    \u001b[1m:help :g\u001b[0m\n\n    \u001b[1m:help :put\u001b[0m\n\n    \u001b[1m:help insert\u001b[0m\n\n    \u001b[1m:help 0\u001b[0m\n\n  \u001b[1m12.12. Is there a way to operate on a line if the previous line contains a\n    particular pattern?\u001b[0m\n    You can use the `:global` command to operate on a line, if the previous\n    line contains a particular pattern:\n\n     :g/<pattern>/+{cmd}\n\n    For more information, read:\n\n    \u001b[1m:help :g\u001b[0m\n\n    \u001b[1m:help :range\u001b[0m\n\n  \u001b[1m12.13. How do I execute a command on all the lines containing a pattern?\u001b[0m\n    You can use the `:global` (:g) command to execute a command on all the\n    lines containing a pattern.\n\n     :g/my pattern/d\n\n    If you want to use a non-Ex command, then you can use the `:normal`\n    command:\n\n     :g/my pattern/normal {command}\n\n    Unless you want the normal mode commands to be remapped, consider using\n    a `:normal!` command instead (note the \"!\").\n\n    For more information, read:\n\n    \u001b[1m:help :global\u001b[0m\n\n    \u001b[1m:help :v\u001b[0m\n\n    \u001b[1m:help :normal\u001b[0m\n\n  \u001b[1m12.14. Can I copy the character above the cursor to the current cursor\n    position?\u001b[0m\n    In Insert mode, you can copy the character above the cursor to the\n    current cursor position by typing CTRL-Y. The same can be done with the\n    characters below the cursor by typing CTRL-E.\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-Y\u001b[0m\n\n    \u001b[1m:help i_CTRL-E\u001b[0m\n\n  \u001b[1m12.15. How do I insert a blank line above/below the current line without\n    entering insert mode?\u001b[0m\n    You can use the `:put` ex command to insert blank lines. For example,\n    try\n\n     :put =''\n     :put! =''\n\n    For more information, read:\n\n    \u001b[1m:help :put\u001b[0m\n\n  \u001b[1m12.16. How do I insert the name of the current file into the current buffer?\u001b[0m\n    There are several ways to insert the name of the current file into the\n    current buffer. In insert mode, you can use the <C-R>% or the\n    <C-R>=expand(\"%\") command. In normal mode, you can use the `:put =@%`\n    command.\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-R\u001b[0m\n\n    \u001b[1m:help expand()\u001b[0m\n\n    \u001b[1m:help !!\u001b[0m\n\n  \u001b[1m12.17. How do I insert the contents of a Vim register into the current\n    buffer?\u001b[0m\n    In insert mode, you can use the <CTRL-R><register> command to insert the\n    contents of <register>. For example, use <CTRL-R>a to insert the\n    contents of register \"a\" into the current buffer.\n\n    In normal mode, you can use the `:put <register>` command to insert the\n    contents of <register>. For example, use the `:put d` command to insert\n    the contents of register \"d\" into the current buffer.\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-R\u001b[0m\n\n    \u001b[1m:help i_CTRL-R_CTRL-R\u001b[0m\n\n    \u001b[1m:help i_CTRL-R_CTRL-O\u001b[0m\n\n    \u001b[1m:help i_CTRL-R_CTRL-P\u001b[0m\n\n    \u001b[1m:help :put\u001b[0m\n\n  \u001b[1m12.18. How do I move the cursor past the end of line and insert some\n    characters at some columns after the end of the line?\u001b[0m\n    You can set the 'virtualedit' option to move the cursor past the\n    end-of-line and insert characters in a column after the end-of-line. To\n    start the virtual mode, use\n\n     :set virtualedit=all\n\n    For more information, read:\n\n    \u001b[1m:help 'virtualedit'\u001b[0m\n\n  \u001b[1m12.19. How to replace the word under the cursor (say: junk) with\n   \"foojunkbar\" in Vim?\u001b[0m\n    There are several ways to do this. If the word is the first such word on\n    the line, use the following command:\n\n     :exe \"s/\".expand(\"<cword>\").\"/foo&bar/\"\n\n    To match specifically you could use a more complex substitution like\n    this:\n\n     :exe 's/\\<'.expand(\"<cword>\").'\\%>'.(col(\".\")-1).'c\\>/foo&bar/'\n\n    You can also use the command: ciwfoo<C-R>\"bar<Esc>\n\n    For more information, read:\n\n    \u001b[1m:help :substitute\u001b[0m\n\n    \u001b[1m:help expand()\u001b[0m\n\n    \u001b[1m:help col()\u001b[0m\n\n    \u001b[1m:help /\\%c\u001b[0m\n\n  \u001b[1m12.20. How do I replace a particular text in all the files in a directory?\u001b[0m\n    You can use the `:argdo` command to execute the substitute command on\n    all the files specified as arguments:\n\n     :args *\n     :argdo %s/<your_text>/<replacement_text>/ge | update\n\n    For more information, read:\n\n    \u001b[1m:help :args_f\u001b[0m\n\n    \u001b[1m:help :argdo\u001b[0m\n\n    \u001b[1m:help :s_flags\u001b[0m\n\n  \u001b[1m12.21. I have some numbers in a file. How do I increment or decrement the\n    numbers in the file?\u001b[0m\n    You can use the CTRL-A key to increment the number and the CTRL-X key to\n    decrement the number. You can also specify the number to\n    increment/decrement from the number by specifying a count to the key.\n    This works for decimal, octal and hexadecimal numbers. You can change\n    the base used by Vim for this operation by modifying the 'nrformats'\n    option.\n\n    For more information, read:\n\n    \u001b[1m:help 26.2\u001b[0m\n\n    \u001b[1m:help CTRL-A\u001b[0m\n\n    \u001b[1m:help CTRL-X\u001b[0m\n\n    \u001b[1m:help 'nrformats'\u001b[0m\n\n  \u001b[1m12.22. How do I reuse the last used search pattern in a `:substitute`\n    command?\u001b[0m\n    To reuse the last used search pattern in a `:substitute` command, don't\n    specify a new search pattern:\n\n     :s/pattern/newtext/\n     :s//sometext/\n\n    In the second `:s` command, as a search pattern is not specified, the\n    pattern specified in the first `:s` command \"pattern\" will be used.\n\n    If you want to change the search pattern but repeat the substitution\n    pattern you can use the special right hand side, you can use the tilde\n    character:\n\n     :s/newpattern/~/\n\n    For more information, read:\n\n    \u001b[1m:help :s\u001b[0m\n\n    \u001b[1m:help :&\u001b[0m\n\n    \u001b[1m:help :~\u001b[0m\n\n    \u001b[1m:help &\u001b[0m\n\n    \u001b[1m:help sub-replace-special\u001b[0m\n\n  \u001b[1m12.23. How do I change the case of a string using the `:substitute`\n    command?\u001b[0m\n    You can use special characters in the replacement string for a\n    `:substitute` command to change the case of the matched string. For\n    example, to change the case of the string \"MyString\" to all uppercase,\n    you can use the following command:\n\n     :%s/MyString/\\U&/g\n\n    To change the case to lowercase, you can use the following command:\n\n     :%s/MyString/\\L&/g\n\n    To change the case of the first character in all the words in the\n    current line to uppercase, you can use the following command:\n\n     :s/\\<\\(.\\)\\(\\k*\\)\\>/\\u\\1\\L\\2/g\n\n    For more information, read:\n\n    \u001b[1m:help sub-replace-special\u001b[0m\n\n    \u001b[1m:help :substitute\u001b[0m\n\n    \u001b[1m:help /\\U\u001b[0m\n\n    \u001b[1m:help /\\L\u001b[0m\n\n    \u001b[1m:help /\\u\u001b[0m\n\n  \u001b[1m12.24. How do I enter characters that are not present in the keyboard?\u001b[0m\n    You can use digraphs to enter characters that are not present in the\n    keyboard. You can use the `:digraphs` command to display all the\n    currently defined digraphs. You can add a new digraph to the list using\n    the `:digraphs` command.\n\n    For more information, read:\n\n    \u001b[1m:help digraphs\u001b[0m\n\n    \u001b[1m:help 'digraph'\u001b[0m\n\n    \u001b[1m:help 24.9\u001b[0m\n\n  \u001b[1m12.25. Is there a command to remove any or all digraphs?\u001b[0m\n    No. The digraphs table is defined at compile time. You can only add new\n    ones. Adding a command to remove digraphs is on the todo list.\n\n  \u001b[1m12.26. In insert mode, when I press the backspace key, it erases only the\n    characters entered in this instance of insert mode. How do I erase\n    previously entered characters in insert mode using the backspace\n    key?\u001b[0m\n    This is traditional vi behaviour. You can set the 'backspace' option to\n    erase previously entered characters in insert mode:\n\n     :set backspace=indent,eol,start\n\n    For more information, read:\n\n    \u001b[1m:help 'backspace'\u001b[0m\n\n    \u001b[1m:help i_backspacing\u001b[0m\n\n  \u001b[1m12.27. I have a file which has lines longer than 72 characters terminated\n    with \"+\" and wrapped to the next line. How can I quickly join the\n    lines?\u001b[0m\n    You can use the `:global` command to search and join the lines:\n\n     :g/+$/j\n\n    This will, however, only join every second line. A couple of more\n    complex examples which will join all consecutive lines with a \"+\" at the\n    end are:\n\n     :g/+$/,/\\(^\\|[^+]\\)$/j\n     :g/+$/mark a | .,/\\(^\\|[^+]\\)$/s/+$// | 'a,.j\n\n    For more information, read:\n\n    \u001b[1m:help :g\u001b[0m\n\n    \u001b[1m:help :j\u001b[0m\n\n    \u001b[1m:help :mark\u001b[0m\n\n  \u001b[1m12.28. How do I paste characterwise yanked text into separate lines?\u001b[0m\n    You can use the `:put` command to paste characterwise yanked text into\n    new lines:\n\n     :put =@\"\n\n    For more information, read:\n\n    \u001b[1m:help :put\u001b[0m\n\n    \u001b[1m:help quote_=\u001b[0m\n\n  \u001b[1m12.29. How do I change the case (uppercase, lowercase) of a word or a\n    character or a block of text?\u001b[0m\n    You can use the \"~\" command to switch the case of a character.\n\n    You can change the case of the word under the cursor to uppercase using\n    the \"gUiw\" or \"viwU\" command and to lowercase using the \"guiw\" or \"viwu\"\n    command.\n\n    You can switch the case (upper case to lower case and vice versa) of the\n    word under the cursor using the \"viw~\" or \"g~iw\" command.\n\n    You can use the \"gUgU\" command to change the current line to uppercase\n    and the \"gugu\" command to change the current line to lowercase.\n\n    You can use the \"g~g~\" command to switch the case of the current line.\n    You can use the \"g~{motion}\" or \"{Visual}~\" commands to switch the case\n    of a block of text.\n\n    If you set 'tildeop' the \"~\" command behaves like an operator and\n    expects a motion command to act on. If you have\n\n     :set tildeop\n\n    and you want to change the case from the current cursor position to the\n    end of line, simply use \"~$\".\n\n    For more information, read:\n\n    \u001b[1m:help case\u001b[0m\n\n    \u001b[1m:help 'tildeop'\u001b[0m\n\n  \u001b[1m12.30. How do I enter ASCII characters that are not present in the\n    keyboard?\u001b[0m\n    You can enter ASCII characters that are not present in the keyboard by\n    pressing CTRL-V and then the ASCII character number. You can also use\n    digraphs to enter special ASCII characters.\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-V_digit\u001b[0m\n\n    \u001b[1m:help digraphs\u001b[0m\n\n    \u001b[1m:help 45.5\u001b[0m\n\n  \u001b[1m12.31. How do I replace non-printable characters in a file?\u001b[0m\n    To replace a non-printable character, you have to first determine the\n    ASCII value for the character. You can use the `:ascii` ex command or\n    the \"ga\" normal-mode command to display the ASCII value of the character\n    under the cursor.\n\n    You can enter the non-printable character by entering CTRL-V followed by\n    the decimal number 1-255 (with no leading zero), or by x and a hex\n    number 00-FF, or by an octal number 0-0377 (with leading zero), or by u\n    and a hex number 0-FFFF, or by U and a hex number 0-7FFFFFFF\n\n    Another alternative is to use the `:digraphs` ex command to display the\n    digraphs for all characters, together with their value in decimal and\n    alpha. You can enter a non-printable character by entering CTRL-K\n    followed by two alphanumeric characters (a digraph).\n\n    For more information, read:\n\n    \u001b[1m:help :ascii\u001b[0m\n\n    \u001b[1m:help i_CTRL-V\u001b[0m\n\n    \u001b[1m:help i_CTRL-V_digit\u001b[0m\n\n    \u001b[1m:help :digraphs\u001b[0m\n\n  \u001b[1m12.32. How do I remove duplicate lines from a buffer?\u001b[0m\n    You can use the following user-defined command to remove all the\n    duplicate lines from a buffer:\n\n    :command -range=% Uniq <line1>,<line2>g/^\\%<<line2>l\\(.*\\)\\n\\1$/d\n\n    Add the above command to your .vimrc file and invoke `:Uniq` to remove\n    all the duplicate lines.\n\n  \u001b[1m12.33. How do I prefix all the lines in a file with the corresponding line\n    numbers?\u001b[0m\n    You can prefix the lines in a file with the corresponding line number in\n    several ways. Some of them are listed below:\n\n     :%s/^/\\=line('.'). ' '\n     :%s/^/\\=printf('%5d ', line('.'))/\n     :%s/^/\\=strpart(line('.').'.     ', 0, 5)\n     :%s/^/\\=strpart('   ', strlen(line('.'))).line('.').'. '\n\n    The last two commands will pad the line numbers with space characters.\n    The last command will right align the numbers and the command before\n    that will left align the numbers.\n\n    If you don't want to number consecutive lines but rather non-consecutive\n    regions, you can also use this idiom:\n\n     :let i = 1\n     :g/TODO/s/^/\\=printf('%2d.',i)|let i+=1\n\n    This first initializes the variable i with 1. In the next line, a `:g`\n    command is used to perform a substitute command only on lines, that\n    match \"TODO\". After the substitute command has taken place, the variable\n    i will be incremented by 1.\n\n    For more information, read:\n\n    \u001b[1m:help sub-replace-special\u001b[0m\n\n    \u001b[1m:help line()\u001b[0m\n\n    \u001b[1m:help expr6\u001b[0m\n\n    \u001b[1m:help strpart()\u001b[0m\n\n    \u001b[1m:help printf()\u001b[0m\n\n    \u001b[1m:help :execute\u001b[0m\n\n    \u001b[1m:help :global\u001b[0m\n\n  \u001b[1m12.34. How do I exchange (swap) two characters or words or lines?\u001b[0m\n    You can exchange two characters with the \"xp\" command sequence. The \"x\"\n    will delete the character under the cursor and \"p\" will paste the just\n    deleted character after the character under the cursor. This will result\n    in exchanging the two characters.\n\n    You can exchange two words with the \"deep\" command sequence (start with\n    the cursor in the blank space before the first word).\n\n    You can exchange two lines with the \"ddp\" command sequence. The \"dd\"\n    will delete the current line and \"p\" will paste the just deleted line\n    after the current line. This will result in exchanging the two lines.\n\n    All of the above operations will change the \" unnamed register.\n\n    You can use the `:m +` ex command to exchange two lines without changing\n    the unnamed register.\n\n    For more information, read:\n\n    \u001b[1m:help x\u001b[0m\n\n    \u001b[1m:help p\u001b[0m\n\n    \u001b[1m:help dd\u001b[0m\n\n    \u001b[1m:help d\u001b[0m\n\n    \u001b[1m:help e\u001b[0m\n\n    \u001b[1m:help linewise-register\u001b[0m\n\n    \u001b[1m:help quotequote\u001b[0m\n\n    \u001b[1m:help :move\u001b[0m\n\n  \u001b[1m12.35. How do I change the characters used as word delimiters?\u001b[0m\n    Vim uses the characters specified by the 'iskeyword' option as word\n    delimiters. The default setting for this option is \"@,48-57,_,192-255\".\n\n    For example, to add \":\" as a word delimiter, you can use\n\n     :set iskeyword+=:\n\n    To remove \"_\" as a word delimiter, you can use\n\n     :set iskeyword-=_\n\n    For more information, read:\n\n    \u001b[1m:help 'iskeyword'\u001b[0m\n\n    \u001b[1m:help word\u001b[0m\n\n\u001b[1mCOMPLETION IN INSERT MODE\u001b[0m\n  \u001b[1m13.1. How do I complete words or lines in insert mode?\u001b[0m\n    In insert mode, you can complete words using the CTRL-P and CTRL-N keys.\n    The CTRL-N command searches forward for the next matching keyword. The\n    CTRL-P command searches backwards for the next matching keyword.\n\n    In insert mode, you can use the CTRL-X CTRL-L command sequence to\n    complete lines that starts with the same characters as in the current\n    line before the cursor. To get the next matching line, press the CTRL-P\n    or CTRL-N keys. There are a lot of other keys/ways available to complete\n    words in insert mode.\n\n    Vim supports completion of the following items:\n\n     CTRL-X CTRL-L    whole lines\n     CTRL-X CTRL-N    keywords in the current file\n     CTRL-X CTRL-K    words from a dictionary\n     CTRL-X CTRL-T    words from a thesaurus\n     CTRL-X CTRL-I    current and included files\n     CTRL-X CTRL-]    tags\n     CTRL-X CTRL-F    file names\n     CTRL-X CTRL-D    macro definitions (also in included files)\n     CTRL-X CTRL-V    Vim command line\n     CTRL-X CTRL-U    User defined completion\n     CTRL-X CTRL-O    Omni completion\n\n    User defined completions and omni completions are often set by filetype\n    plugins.\n\n    For more information, read:\n\n    \u001b[1m:help 24.3\u001b[0m\n\n    \u001b[1m:help ins-completion\u001b[0m\n\n  \u001b[1m13.2. How do I complete file names in insert mode?\u001b[0m\n    In insert mode, you can use the CTRL-X CTRL-F command sequence to\n    complete filenames that start with the same characters as in the current\n    line before the cursor.\n\n    For more information, read:\n\n    \u001b[1m:help compl-filename\u001b[0m\n\n  \u001b[1m13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do I\n   complete words that occur after the just completed word?\u001b[0m\n    You can use CTRL-X CTRL-N and CTRL-X CTRL-P keys to complete words that\n    are present after the just completed word.\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-X_CTRL-P\u001b[0m\n\n    \u001b[1m:help i_CTRL-X_CTRL-N\u001b[0m\n\n    \u001b[1m:help ins-completion\u001b[0m\n\n\u001b[1mTEXT FORMATTING\u001b[0m\n  \u001b[1m14.1. How do I format a text paragraph so that a new line is inserted at\n   the end of each wrapped line?\u001b[0m\n    You can use the \"gq\" command to format a paragraph. This will format the\n    text according to the current 'textwidth' setting. An alternative would\n    be to use the \"gw\" command that formats like \"gq\" but does not move the\n    cursor.\n\n    Note that the gq operator can be used with a motion command to operate\n    on a range of text. For example:\n\n     gqgq - Format the current line\n     gqap - Format current paragraph\n     gwap - Format current paragraph (and don't move cursor)\n     gq3j - Format the current and the next 3 lines\n\n    For more information, read:\n\n    \u001b[1m:help gq\u001b[0m\n\n    \u001b[1m:help gw\u001b[0m\n\n    \u001b[1m:help formatting\u001b[0m\n\n    \u001b[1m:help usr_25.txt\u001b[0m\n\n    \u001b[1m:help motion.txt\u001b[0m\n\n  \u001b[1m14.2. How do I format long lines in a file so that each line contains less\n   than \"n\" characters?\u001b[0m\n    You can set the 'textwidth' option to control the number of characters\n    that can be present in a line. For example, to set the maximum width of\n    a line to 70 characters, you can use the following command:\n\n     set textwidth=70\n\n    Now to break the long lines in a file to the length defined by the\n    'textwidth' option, you can use\n\n     :g/./normal gqq\n\n    For more information, read:\n\n    \u001b[1m:help 'textwidth'\u001b[0m\n\n    \u001b[1m:help gq\u001b[0m\n\n  \u001b[1m14.3. How do I join short lines to form a paragraph?\u001b[0m\n    First, make sure the 'textwidth' option is set to a high value:\n\n     :set textwidth=99999\n\n    Next, join the short lines to form a paragraph using the command:\n\n     1GgqG\n\n    The above command will operate on the entire file. To do the formatting\n    on all paragraphs in a specific range, use:\n\n     :'a,'bg/\\S/normal gq}\n\n    For more information, read:\n\n    \u001b[1m:help gq\u001b[0m\n\n    \u001b[1m:help G\u001b[0m\n\n    \u001b[1m:help gqq\u001b[0m\n\n  \u001b[1m14.4. How do I format bulleted and numbered lists?\u001b[0m\n    You can configure Vim to format bulleted and numbered lists using the\n    'formatoptions' option. For example, you can format the list of the\n    following format:\n\n      - this is a test. this is a test. this is a test. this is a test.\n      this is a test.\n\n    into this format:\n\n      - this is a test. this is a test. this is a test. this is a test.\n     this is a test.\n\n    You can use the \"n\" flag in the 'formatoptions' to align the text.\n\n     :set fo+=n\n\n    With this option, when formatting text, Vim will recognize numbered\n    lists. For this option to work, the 'autoindent' option also must be\n    set.\n\n    For more information, read:\n\n    \u001b[1m:help 'formatoptions'\u001b[0m\n\n    \u001b[1m:help fo-table\u001b[0m\n\n    \u001b[1m:help format-comments\u001b[0m\n\n  \u001b[1m14.5. How do I indent lines in insert mode?\u001b[0m\n    In insert mode, you can press the CTRL-T key to insert one shiftwidth of\n    indent at the start of the current line. In insert mode, you can use the\n    CTRL-D key to delete on shiftwidth of indent at the start of the current\n    line. You can also use the CTRL-O >> and CTRL-O << commands to indent\n    the current line in insert mode.\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-T\u001b[0m\n\n    \u001b[1m:help i_CTRL-D\u001b[0m\n\n    \u001b[1m:help i_0_CTRL-D\u001b[0m\n\n    \u001b[1m:help i_CTRL-O\u001b[0m\n\n    \u001b[1m:help \u001b[0m>>\n\n    \u001b[1m:help <<\u001b[0m\n\n  \u001b[1m14.6. How do I format/indent an entire file?\u001b[0m\n    You can format/indent an entire file using the gg=G command, where\n\n     gg - Goto the beginning of the file\n     =  - apply indentation\n     G  - till end of file\n\n    For more information, read:\n\n    \u001b[1m:help gg\u001b[0m\n\n    \u001b[1m:help =\u001b[0m\n\n    \u001b[1m:help G\u001b[0m\n\n    \u001b[1m:help 'formatprg'\u001b[0m\n\n    \u001b[1m:help C-indenting\u001b[0m\n\n  \u001b[1m14.7. How do I increase or decrease the indentation of the current line?\u001b[0m\n    You can use the \">>\" and \"<<\" commands to increase or decrease the\n    indentation of the current line.\n\n    For more information, read:\n\n    \u001b[1m:help shift-left-right\u001b[0m\n\n    \u001b[1m:help \u001b[0m>>\n\n    \u001b[1m:help <<\u001b[0m\n\n    \u001b[1m:help 'shiftwidth'\u001b[0m\n\n  \u001b[1m14.8. How do I indent a block/group of lines?\u001b[0m\n    You can visually select the group of lines and press the > or < key to\n    indent/unindent the lines. You can also use the following ex-command to\n    indent the lines\n\n     :10,20>\n\n    For more information, read:\n\n    \u001b[1m:help shift-left-right\u001b[0m\n\n    \u001b[1m:help v_\u001b[0m>\n\n    \u001b[1m:help v_<\u001b[0m\n\n    \u001b[1m:help :<\u001b[0m\n\n    \u001b[1m:help :\u001b[0m>\n\n  \u001b[1m14.9. When I indent lines using the > or < key, the standard 8-tabstops are\n   used instead of the current 'tabstop' setting. Why?\u001b[0m\n    The number of spaces used when lines are indented using the \">\" operator\n    is controlled by the 'shiftwidth' option. The 'tabstop' setting is only\n    used, when the 'shiftwidth' option is zero.\n\n     :set shiftwidth=4\n\n    For more information, read:\n\n    \u001b[1m:help 'shiftwidth'\u001b[0m\n\n    \u001b[1m:help \u001b[0m>>\n\n    \u001b[1m:help 'softtabstop'\u001b[0m\n\n  \u001b[1m14.10. How do I turn off the automatic indentation of text?\u001b[0m\n    By default, the automatic indentation of text is not turned on. Check\n    the configuration files (.vimrc, .gvimrc) for settings related to\n    indentation. Make sure the `:filetype indent on` command is not present.\n    If it is present, remove it. Also, depending on your preference, you may\n    also want to check the value of the 'autoindent', 'smartindent',\n    'cindent' and 'indentexpr' options and turn them off as needed.\n\n    For more information, read:\n\n    \u001b[1m:help :filetype-indent-off\u001b[0m\n\n    \u001b[1m:help 'autoindent'\u001b[0m\n\n    \u001b[1m:help 'smartindent'\u001b[0m\n\n    \u001b[1m:help 'cindent'\u001b[0m\n\n    \u001b[1m:help 'indentexpr'\u001b[0m\n\n  \u001b[1m14.11. How do I configure Vim to automatically set the 'textwidth' option\n    to a particular value when I edit mails?\u001b[0m\n    You can use the \"FileType\" autocommand to set the 'textwidth' option:\n\n     autocmd FileType mail set tw=<your_value>\n\n    For more information, read:\n\n    \u001b[1m:help :autocmd\u001b[0m\n\n    \u001b[1m:help FileType\u001b[0m\n\n    \u001b[1m:help usr_43.txt\u001b[0m\n\n  \u001b[1m14.12. Is there a way to make Vim auto-magically break lines?\u001b[0m\n    Yes. Set the 'textwidth' option to the preferred length for a line. Then\n    Vim will auto-magically break the newly entered lines. For example:\n\n     :set textwidth=75\n\n    For more information, read:\n\n    \u001b[1m:help 'textwidth'\u001b[0m\n\n    \u001b[1m:help ins-textwidth\u001b[0m\n\n    \u001b[1m:help 'formatoptions'\u001b[0m\n\n    \u001b[1m:help fo-table\u001b[0m\n\n    \u001b[1m:help formatting\u001b[0m\n\n  \u001b[1m14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n    'fileformat' option to \"dos\" and then \"unix\" and then \"mac\". None of\n    these helped. How can I hide these symbols?\u001b[0m\n    When a file is loaded in Vim, the format of the file is determined as\n    below:\n\n    - If all the lines end with a new line (<NL>), then the fileformat is\n    \"unix\". - If all the lines end with a carriage return (<CR>) followed by\n    a new line (<NL>), then the fileformat is \"dos\". - If all the lines end\n    with carriage return (<CR>), then the fileformat is \"mac\".\n\n    If the file has some lines ending with <CR> and some lines ending with\n    <CR> followed by a <NL>, then the fileformat is set to \"unix\".\n\n    You can change the format of the current file, by saving it explicitly\n    in dos format:\n\n     :w ++ff=dos\n\n    To display the format of the current file, use\n\n     :set fileformat?\n\n    The above behavior is also controlled by the 'fileformats' option. You\n    can try the following commands:\n\n     :set fileformats+=unix\n     :e <your_file>\n     :set fileformat=unix\n     :w\n\n    To remove the carriage return (<CR>) character at the end of all the\n    lines in the current file, you can use the following command:\n\n     :%s/\\r$//\n\n    To force Vim to use a particular file format, when editing a file, you\n    can use the following command:\n\n     :e ++ff=dos filename\n\n    For more information, read:\n\n    \u001b[1m:help 'fileformats'\u001b[0m\n\n    \u001b[1m:help 'fileformat'\u001b[0m\n\n    \u001b[1m:help file-formats\u001b[0m\n\n    \u001b[1m:help DOS-format-write\u001b[0m\n\n    \u001b[1m:help Unix-format-write\u001b[0m\n\n    \u001b[1m:help Mac-format-write\u001b[0m\n\n    \u001b[1m:help dos-file-formats\u001b[0m\n\n    \u001b[1m:help 23.1\u001b[0m\n\n    \u001b[1m:help ++ff\u001b[0m\n\n  \u001b[1m14.14. When I paste some text into a Vim buffer from another application,\n   the alignment (indentation) of the new text is messed up. How do I\n   fix this?\u001b[0m\n    When you paste text into a GUI Vim using the mouse, Vim is able to\n    detect that you are pasting text. So all the indentation related\n    settings (like autoindent, smartindent, cindent, etc.) are ignored and\n    the text is pasted literally.\n\n    When pasting text into a Vim running in a terminal (like xterm) using\n    the mouse, Vim may not be able to detect that you are pasting text. This\n    depends on several things: the capability of the terminal to pass the\n    mouse events to Vim, Vim is compiled to handle mouse events and access\n    the clipboard, the DISPLAY variable is set properly, the Vim 'mouse'\n    option is set correctly.\n\n    If Vim is able to detect that you are pasting text using the mouse, then\n    the pasted text will be inserted literally.\n\n    If Vim is not able to detect that you are pasting using the mouse, then\n    it will see the pasted text as though you literally typed the text.\n    After the first line from the pasted text is inserted, when Vim\n    encounters the newline character, because of the indentation settings,\n    the next line will start indented. The spaces at the beginning of the\n    second line in the pasted text will be inserted leading to additional\n    indentation. This will be repeated for subsequent lines. So the pasted\n    text will be inserted with stair case indentation.\n\n    You can fix this problem in a terminal Vim in several ways:\n\n    1. Build Vim with the +mouse and +xterm_clipboard compile-time options.\n    The normal or big or huge build of Vim includes these options. Set the\n    'mouse' option to either \"a\" or include \"i\". When pasting text using the\n    mouse, don't press the Shift key. This will work only if Vim can access\n    the X display. For more information, read the following Vim help topics:\n\n    \u001b[1m:help +feature-list\u001b[0m\n\n    \u001b[1m:help 'mouse'\u001b[0m\n\n    \u001b[1m:help <MiddleMouse\u001b[0m>\n\n    \u001b[1m:help x11-selection\u001b[0m\n\n    \u001b[1m:help xterm-clipboard\u001b[0m\n\n    1.1 Some Linux distributions build their terminal vim packages without X\n    support. This makes no sense and leaves many users with the impression\n    that Vim in terminal mode doesn't support some operations such as\n    properly pasting text with a mouse.\n\n     If your distribution includes gvim, which it almost certainly\n     does these days, the solutions to this include the following.\n\n     a)  Start Vim as\n\n             gvim -v\n\n     b)  Put this alias in your shell's configuration file, e.g.\n         ~/.bashrc:\n\n             alias vim='gvim -v'\n\n     c)  Put the following command in a file named \"vim\" and put that\n         file in your ~/bin directory:\n\n             gvim -v \"$@\"\n\n     d)  Link the distribution's gvim to ~/bin/vim with the following\n         command, which needs to be executed only once.\n\n             ln -s $(which gvim) ~/bin/vim\n\n     For c) and d), make sure that ~/bin precedes /usr/bin in your\n     PATH.\n\n    2. Paste the text using the CTRL-R CTRL-O * command. This will paste the\n    text literally without any automatic indentation. If you want to paste\n    the text and then fix the indentation, then you can use CTRL-R CTRL-P *.\n    These commands will work only if Vim can access the X display. For more\n    information, read the following Vim help topics:\n\n    \u001b[1m:help i_CTRL-R_CTRL-O\u001b[0m\n\n    \u001b[1m:help i_CTRL-R_CTRL-P\u001b[0m\n\n    \u001b[1m:help quotestar\u001b[0m\n\n    3. Set the 'paste' option before pasting the text. This option will\n    disable the effect of all the indentation related settings. Make sure to\n    turn off this option using `:set nopaste` after pasting the text.\n    Otherwise the Vim indentation feature will not work. Do not permanently\n    set the 'paste' option in your .vimrc file. If you are going to repeat\n    these steps often, then you can set the 'pastetoggle' option to a key.\n    When you press the specified key, the 'paste' option will be toggled.\n    You can press the key once before pasting the text and the press the key\n    once after pasting the text. Note that when the 'paste' option is set,\n    all the mappings and abbreviations are disabled. For more information,\n    read the following Vim help topics:\n\n    \u001b[1m:help 'paste'\u001b[0m\n\n    \u001b[1m:help 'pastetoggle'\u001b[0m\n\n    You can also refer to the following topics in the user manual:\n\n    \u001b[1m:help 04.7\u001b[0m\n\n    \u001b[1m:help 09.3\u001b[0m\n\n  \u001b[1m14.15. When there is a very long wrapped line (wrap is \"on\") and a line\n   doesn't fit entirely on the screen it is not displayed at all. There\n   are blank lines beginning with \"@\" symbol instead of wrapped line. If\n   I scroll the screen to fit the line the \"@\" symbols disappear and the\n   line is displayed again. What Vim setting control this behavior?\u001b[0m\n    You can set the 'display' option to \"lastline\" to display as much as\n    possible of the last line in a window instead of displaying the \"@\"\n    symbols.\n\n     :set display=lastline\n\n    For more information, read:\n\n    \u001b[1m:help 'display'\u001b[0m\n\n  \u001b[1m14.16. How do I convert all the tab characters in a file to space\n    characters?\u001b[0m\n    You can use the `:retab` command to update all the tab characters in the\n    current file with the current setting of 'expandtab' and 'tabstop'. For\n    example, to convert all the tabs to white spaces, use\n\n     :set expandtab\n     :retab\n\n    For more information, read:\n\n    \u001b[1m:help :retab\u001b[0m\n\n    \u001b[1m:help 'expandtab'\u001b[0m\n\n    \u001b[1m:help 'tabstop'\u001b[0m\n\n    \u001b[1m:help 25.3\u001b[0m\n\n  \u001b[1m14.17. What Vim options can I use to edit text that will later go to a word\n    processor?\u001b[0m\n    You can set the following options to edit text that will later go into a\n    word processor:\n\n     :set wrap\n     :set linebreak\n     :set textwidth=0\n     :set showbreak=>>>\n\n    You can use the \"gk\" and \"gj\" commands to move one screen line up and\n    down. For more information, read:\n\n    \u001b[1m:help 'wrap'\u001b[0m\n\n    \u001b[1m:help 'linebreak'\u001b[0m\n\n    \u001b[1m:help 'textwidth'\u001b[0m\n\n    \u001b[1m:help 'showbreak'\u001b[0m\n\n    \u001b[1m:help gk\u001b[0m\n\n    \u001b[1m:help gj\u001b[0m\n\n  \u001b[1m14.18. How do I join lines without adding or removing any space characters?\u001b[0m\n    By default, when you join lines using the \"J\" or `:join` command, Vim\n    will replace the line break, leading white space and trailing white\n    space with a single space character. If there are space characters at\n    the end of a line or a line starts with the \")\" character, then Vim will\n    not add a space character.\n\n    To join lines without adding or removing any space characters, you can\n    use the gJ or `:join!` commands.\n\n    For more information, read:\n\n    \u001b[1m:help gJ\u001b[0m\n\n    \u001b[1m:help :join\u001b[0m\n\n    \u001b[1m:help J\u001b[0m\n\n    \u001b[1m:help 10.5\u001b[0m\n\n    \u001b[1m:help 'joinspaces'\u001b[0m\n\n    \u001b[1m:help 'cpoptions'\u001b[0m\n\n    \u001b[1m:help 'formatoptions'\u001b[0m\n\n\u001b[1mVISUAL MODE\u001b[0m\n  \u001b[1m15.1. How do I do rectangular block copying?\u001b[0m\n    You can do rectangular block copying in Vim using the blockwise visual\n    mode. To start blockwise visual mode use the CTRL-V key. Move the cursor\n    using any of the motion commands and then use the y operator to yank to\n    visually selected text.\n\n    If CTRL-V does not work as expected, it may have been remapped to CTRL-Q\n    by the mswin.vim script which is often sourced by a vimrc on Windows\n    machines to mimic some common short cuts from other programs.\n\n    For more information, read:\n\n    \u001b[1m:help 04.4\u001b[0m\n\n    \u001b[1m:help blockwise-visual\u001b[0m\n\n    \u001b[1m:help visual-mode\u001b[0m\n\n    \u001b[1m:help Q_vi\u001b[0m\n\n  \u001b[1m15.2. How do I delete or change a column of text in a file?\u001b[0m\n    You can use the Vim block-wise visual mode to select the column of text\n    and apply an operator (delete, change, copy, etc) on it.\n\n    For more information, read:\n\n    \u001b[1m:help visual-block\u001b[0m\n\n    \u001b[1m:help visual-operators\u001b[0m\n\n  \u001b[1m15.3. How do I apply an ex-command on a set of visually selected lines?\u001b[0m\n    When you select a range of lines in visual mode, the < register is set\n    to the start of the visual region and the > register is set to the end\n    of the visual region. You can use these registers to specify the range\n    for an ex command. After visually selecting the lines, press \":\" to go\n    to the command mode. Vim will automatically insert the visual range\n    '<,'>. You can run any ex-command on the visual range.\n\n    For more information, read:\n\n    \u001b[1m:help v_:\u001b[0m\n\n    \u001b[1m:help '<\u001b[0m\n\n    \u001b[1m:help '\u001b[0m>\n\n  \u001b[1m15.4. How do I execute an ex command on a column of text selected in Visual\n   block mode?\u001b[0m\n    All the ex commands operate on whole lines only. If you try to execute\n    an ex command on a column of text selected in visual block mode, Vim\n    will operate on all the selected lines (instead of the selected\n    columns). You can use the vis.vim or NrrwRgn plugin script from\n    https://www.vim.org scripts archive to do this.\n\n    For more information, read:\n\n    \u001b[1m:help cmdline-ranges\u001b[0m\n\n    \u001b[1m:help 10.3\u001b[0m\n\n    \u001b[1m:help cmdline-lines\u001b[0m\n\n  \u001b[1m15.5. How do I select the entire file in visual mode?\u001b[0m\n    You can select the entire file in visual mode using ggVG.\n\n     gg - go to the beginning of the file.\n     V  - Start linewise visual mode\n     G  - goto the end of the file.\n\n    For more information, read:\n\n    \u001b[1m:help gg\u001b[0m\n\n    \u001b[1m:help linewise-visual\u001b[0m\n\n    \u001b[1m:help G\u001b[0m\n\n  \u001b[1m15.6. When I visually select a set of lines and press the > key to indent\n   the selected lines, the visual mode ends. How can I reselect the\n   region for further operation?  (or) How do I re-select the last\n   selected visual area again?\u001b[0m\n    You can use the \"gv\" command to reselect the last selected visual area.\n    You can also use the marks '< and '> to jump to the beginning or the end\n    of the last selected visual area.\n\n    For more information, read:\n\n    \u001b[1m:help gv\u001b[0m\n\n    \u001b[1m:help '<\u001b[0m\n\n    \u001b[1m:help '\u001b[0m>\n\n  \u001b[1m15.7. How do I jump to the beginning/end of a visually selected region?\u001b[0m\n    You can use the \"o\" command to jump to the beginning/end of a visually\n    selected region.\n\n    For more information, read:\n\n    \u001b[1m:help v_o\u001b[0m\n\n  \u001b[1m15.8. When I select text with mouse and then press : to enter an ex\n   command, the selected text is replaced with the : character. How do I\n   execute an ex command on a text selected using the mouse similar to\n   the text selected using the visual mode?\u001b[0m\n    This will happen if you have configured Vim to use select mode instead\n    of Visual mode by setting the 'selectmode' option. Check the value of\n    this option:\n\n     :set selectmode?\n\n    This mode is known as selectmode and is similar to the visual mode. This\n    option is also automatically set when you use the \"behave mswin\"\n    command. Select mode looks like visual mode, but it is similar to the\n    selection mode in MS-Windows.\n\n    For more information, read:\n\n    \u001b[1m:help Select-mode\u001b[0m\n\n    \u001b[1m:help 'selectmode'\u001b[0m\n\n    \u001b[1m:help 09.4\u001b[0m\n\n    \u001b[1m:help :behave\u001b[0m\n\n  \u001b[1m15.9. When I select a block of text using the mouse, Vim goes into\n   selection mode instead of Visual mode. Why?\u001b[0m\n    The 'selectmode' option controls whether Select mode will be started\n    when selecting a block of text using the mouse. To start Visual mode\n    when selecting text using mouse, remove the \"mouse\" value from the\n    'selectmode' option:\n\n     :set selectmode-=mouse\n\n    Note that by default, the 'selectmode' option will be set to empty, so\n    that always visual mode is used.\n\n    For more information, read:\n\n    \u001b[1m:help 'selectmode'\u001b[0m\n\n    \u001b[1m:help Select-mode\u001b[0m\n\n    \u001b[1m:help :behave\u001b[0m\n\n  \u001b[1m15.10. How do I visually select the last copy/pasted text?\u001b[0m\n    You can use the '[ and '] marks to visually select the last copy/pasted\n    text. The '[ mark is set to the beginning of the last changed/yanked\n    text and the '] mark is set to the end of the last changed/yanked text.\n    To visually select this block of text use the command '[v']\n\n    For more information, read:\n\n    \u001b[1m:help '[\u001b[0m\n\n    \u001b[1m:help ']\u001b[0m\n\n    \u001b[1m:help `a\u001b[0m\n\n    \u001b[1m:help v\u001b[0m\n\n\u001b[1mCOMMAND-LINE MODE\u001b[0m\n  \u001b[1m16.1. How do I use the name of the current file in the command mode or an\n   ex command line?\u001b[0m\n    In the command line, the \"%\" character represents the name of the\n    current file. In some commands, you have to use `expand(\"%\")` to get the\n    filename:\n\n     :!perl %\n\n    Another example is to load the latex generated pdf file from the file\n    you are currently editing:\n\n     :!xpdf %<.pdf\n\n    For more information, read:\n\n    \u001b[1m:help :_%\u001b[0m\n\n    \u001b[1m:help cmdline-special\u001b[0m\n\n    \u001b[1m:help expand()\u001b[0m\n\n  \u001b[1m16.2. How do I edit the text in the Vim command-line effectively?\u001b[0m\n    You can use the command-line window for editing Vim command-line text.\n    To open the Vim command-line window use the \"q:\" command in normal mode.\n    In command-line mode, use the CTRL-F key. In this window, the command\n    line history will be displayed. You can use normal Vim keys/commands to\n    edit any previous/new command line. To execute a command line, press the\n    enter/return key.\n\n    In a similar vain, the search history can be edited with \"q/\" and \"q?\"\n    commands.\n\n    For more information, read:\n\n    \u001b[1m:help cmdline-window\u001b[0m\n\n  \u001b[1m16.3. How do I switch from Vi mode to Ex mode?\u001b[0m\n    You can use the Q command to switch from Vi mode to Ex mode. To switch\n    from Ex mode back to the Vi mode, use the `:vi` command.\n\n    For more information, read:\n\n    \u001b[1m:help Q\u001b[0m\n\n    \u001b[1m:help gQ\u001b[0m\n\n    \u001b[1m:help Ex-mode\u001b[0m\n\n    \u001b[1m:help :vi\u001b[0m\n\n  \u001b[1m16.4. How do I copy the output from an ex-command into a buffer?\u001b[0m\n    To copy the output from an ex-command into a buffer, you have to first\n    get the command output into a register. You can use the `:redir` command\n    to get the output into a register. For example,\n\n     :redir @a\n     :g/HelloWord/p\n     :redir END\n\n    Now the register \"a\" will contain the output from the ex command\n    `:g/HelloWord/p`. Now you can paste the contents of the register \"a\"\n    into a buffer. You can also send or append the output of an ex-command\n    into a file using the `:redir` command.\n\n    You can prefix the `:global` command with `:silent`, to avoid having the\n    lines printed to the screen.\n\n    To redirect the output from an ex-command to a file, you can use the\n    following set of commands:\n\n     :redir > myfile\n     :g/HelloWord/p\n     :redir END\n\n    For more information, read:\n\n    \u001b[1m:help :redir\u001b[0m\n\n    \u001b[1m:help :silent\u001b[0m\n\n  \u001b[1m16.5. When I press the <Tab> key to complete the name of a file in the\n   command mode, if there are more than one matching file names, then\n   Vim completes the first matching file name and displays a list of all\n   matching filenames. How do I configure Vim to only display the list\n   of all the matching filenames and not complete the first one?\u001b[0m\n    You can modify the 'wildmode' option to configure the way Vim completes\n    filenames in the command mode. In this case, you can set the 'wildmode'\n    option to \"list\":\n\n     :set wildmode=list\n\n    For more information, read:\n\n    \u001b[1m:help 'wildmode'\u001b[0m\n\n  \u001b[1m16.6. How do I copy text from a buffer to the command line and from the\n   command line to a buffer?\u001b[0m\n    To copy text from a buffer to the command line, after yanking the text\n    from the buffer, use \"<CTRL-R>0\" in the command line to paste the text.\n    You can also yank the text to a specific register and use CTRL-R\n    <register> to paste the text to the command line. You can use CTRL-R\n    CTRL-W to paste the word under the cursor in the command line.\n\n    To copy text from the command line into a buffer, you can paste the\n    contents of the : register using the \":p command. The most recently\n    executed command line is stored in the : register.\n\n    Another approach for copying and pasting text to and from the command\n    line is to open the command line window using q: from normal mode or\n    CTRL-F from the command-line mode. In the command line window you can\n    use all the Vim commands to edit the command line.\n\n    For more information, read:\n\n    \u001b[1m:help c_CTRL-R\u001b[0m\n\n    \u001b[1m:help quote_:\u001b[0m\n\n    \u001b[1m:help cmdline-window\u001b[0m\n\n  \u001b[1m16.7. How do I put a command onto the command history without executing it?\u001b[0m\n    To put a command onto the command history without executing it, press\n    the <Esc> key to cancel the command.\n\n    An alternative solution, is to use the histadd() function like this:\n\n     :call histadd(':', 'echo strftime(\"%c\")')\n\n    For more information, read:\n\n    \u001b[1m:help c_<Esc\u001b[0m>\n\n    \u001b[1m:help histadd()\u001b[0m\n\n  \u001b[1m16.8. How do I increase the height of the command-line?\u001b[0m\n    You can increase the height of the command-line by changing the\n    'cmdheight' option:\n\n     :set cmdheight=2\n\n    For more information, read:\n\n    \u001b[1m:help 'cmdheight'\u001b[0m\n\n    \u001b[1m:help hit-enter\u001b[0m\n\n    \u001b[1m:help 05.7\u001b[0m\n\n\u001b[1mVIMINFO\u001b[0m\n  \u001b[1m17.1. When I invoke Vim, I get error messages about illegal characters in\n   the viminfo file. What should I do to get rid of these messages?\u001b[0m\n    You can remove the $HOME/.viminfo or the $HOME/_viminfo file to get rid\n    of these error messages.\n\n    For more information, read:\n\n    \u001b[1m:help viminfo-errors\u001b[0m\n\n    \u001b[1m:help viminfo-file-name\u001b[0m\n\n    \u001b[1m:help viminfo\u001b[0m\n\n    \u001b[1m:help 21.3\u001b[0m\n\n  \u001b[1m17.2. How do I disable the viminfo feature?\u001b[0m\n    By default, the viminfo feature is disabled. If the viminfo feature is\n    enabled by a system-wide vimrc file, then you can disable the viminfo\n    feature by setting the 'viminfo' option to an empty string in your local\n    .vimrc file:\n\n     :set viminfo=\"\"\n\n    For more information, read:\n\n    \u001b[1m:help 'viminfo'\u001b[0m\n\n  \u001b[1m17.3. How do I save and use Vim marks/commands across Vim sessions?\u001b[0m\n    You can save and restore Vim marks across Vim sessions using the viminfo\n    file. To use the viminfo file, make sure the 'viminfo' option is not\n    empty. To save and restore Vim marks, the 'viminfo' option should not\n    contain the \"f\" flag or should have a value greater than zero for the\n    \"f\" option.\n\n    You can also use the viminfo file to synchronize the commandline history\n    across different sessions using `:wvimfo` and `:rviminfo` commands\n    together with the FocusGained and FocusLost autocommands:\n\n     augroup viminfo\n         au!\n         au FocusLost   * wviminfo\n         au FocusGained * rviminfo\n     augroup end\n\n    Note, this will only work reliably, when Vim can detect the FocusLost\n    and FocusGained autocommands correctly. This means it should work with\n    GVim but might depend on your terminal for konsole vim.\n\n    For more information, read:\n\n    \u001b[1m:help 21.3\u001b[0m\n\n    \u001b[1m:help viminfo\u001b[0m\n\n    \u001b[1m:help 'viminfo'\u001b[0m\n\n    \u001b[1m:help :wviminfo\u001b[0m\n\n    \u001b[1m:help :rviminfo\u001b[0m\n\n    \u001b[1m:help FocusLost\u001b[0m\n\n    \u001b[1m:help FocusGained\u001b[0m\n\n\u001b[1mREMOTE EDITING\u001b[0m\n  \u001b[1m18.1. How do I open a file with existing instance of gvim? What happened to\n   the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\u001b[0m\n    Starting with Vim6, the OLE version of OpenWithVim.exe and SendToVim.exe\n    Vim utilities are replaced by the new client-server feature. To open the\n    file j.txt with an existing instance of Gvim (MyVim), use:\n\n     $ gvim --servername MyVim --remote-silent j.txt\n\n    To list the server names of all the currently running Vim instances, use\n\n     $ vim --serverlist\n\n    To get more information about client-server feature, read\n\n    \u001b[1m:help client-server\u001b[0m\n\n  \u001b[1m18.2. How do I send a command to a Vim server to write all buffers to disk?\u001b[0m\n    You can use the Vim remote server functionality to do this:\n\n     $ gvim --servername myVIM --remote-send \"<C-\\><C-N>:wall<CR>\"\n\n    For more information, read:\n\n    \u001b[1m:help client-server\u001b[0m\n\n    \u001b[1m:help CTRL-\\_CTRL-N\u001b[0m\n\n    \u001b[1m:help :wall\u001b[0m\n\n  \u001b[1m18.3. Where can I get the documentation about the Vim remote server\n   functionality?\u001b[0m\n    You can get more information about the Vim remote server functionality\n    by reading\n\n    \u001b[1m:help client-server\u001b[0m\n\n\u001b[1mOPTIONS\u001b[0m\n  \u001b[1m19.1. How do I configure Vim in a simple way?\u001b[0m\n    You can use the `:options` command to open the Vim option window:\n\n     :options\n\n    This window can be used for viewing and setting all the options.\n\n    For more information, read:\n\n    \u001b[1m:help :options\u001b[0m\n\n  \u001b[1m19.2. How do I toggle the value of an option?\u001b[0m\n    You can prefix the option with \"inv\" to toggle the value of the option:\n\n     :set invignorecase\n     :set invhlsearch\n\n    You can also suffix the option with \"!\" to toggle the value:\n\n     :set ignorecase!\n     :set hlsearch!\n\n    For more information, read:\n\n    \u001b[1m:help set-option\u001b[0m\n\n  \u001b[1m19.3. How do I set an option that affects only the current buffer/window?\u001b[0m\n    Some of the Vim options can have a local or global value. A local value\n    applies only to a specific buffer or window. A global value applies to\n    all the buffers or windows.\n\n    When a Vim option is modified using the `:set` command, both the global\n    and local values for the option are changed. You can use the `:setlocal`\n    command to modify only the local value for the option and the\n    `:setglobal` command to modify only the global value.\n\n    You can use the `:setlocal` command to set an option that will affect\n    only the current file/buffer:\n\n     :setlocal textwidth=70\n\n    Note that not all options can have a local value. You can use\n    `:setlocal` command to set an option locally to a buffer/window only if\n    the option is allowed to have a local value.\n\n    You can also use the following command to set an option locally:\n\n     :let &l:{option-name} = <value>\n\n    For more information, read:\n\n    \u001b[1m:help :setlocal\u001b[0m\n\n    \u001b[1m:help local-options\u001b[0m\n\n  \u001b[1m19.4. How do I use space characters for a Vim option value?\u001b[0m\n    To use space characters in a Vim option value, you have to escape the\n    space character. For example:\n\n     :set tags=tags\\ /usr/tags\n\n    For more information, read:\n\n    \u001b[1m:help option-backslash\u001b[0m\n\n  \u001b[1m19.5. Can I add (embed) Vim option settings to the contents of a file?\u001b[0m\n    You can use modelines to add Vim option settings to the contents of a\n    file. For example, in a C file, you can add the following line to the\n    top or the bottom of the file:\n\n     /* vim:sw=4: */\n\n    This will set the 'shiftwidth' option to 4, when editing that C file.\n    For this to work, the 'modeline' option should be set. By default, the\n    'modeline' option is set. An alternative example is given in this\n    document in the first line.\n\n    The 'modelines' settings specifies the number of lines that will be\n    checked for the Vim set commands.\n\n    For more information, read:\n\n    \u001b[1m:help 21.6\u001b[0m\n\n    \u001b[1m:help modeline\u001b[0m\n\n    \u001b[1m:help auto-setting\u001b[0m\n\n    \u001b[1m:help 'modeline'\u001b[0m\n\n    \u001b[1m:help 'modelines'\u001b[0m\n\n  \u001b[1m19.6. How do I display the line numbers of all the lines in a file?\u001b[0m\n    You can set the 'number' option to display the line numbers for all the\n    lines.\n\n     :set number\n\n    For more information, read:\n\n    \u001b[1m:help 'number'\u001b[0m\n\n  \u001b[1m19.7. How do I change the width of the line numbers displayed using the\n   'number' option?\u001b[0m\n    You can set the minimum number of columns to be used for line numbering\n    by setting the 'numberwidth' option:\n\n     :set numberwidth=3\n\n    This set's the width for the line number to 3 digits, which is enough,\n    if your buffer contains less than 999 lines. However, if your current\n    buffer contains more lines than 999, the 'numberwidth' will be adjusted\n    accordingly, so that the maximum line number will fit on the screen.\n\n  \u001b[1m19.8. How do I display (view) all the invisible characters like space, tabs\n   and newlines in a file?\u001b[0m\n    You can set the 'list' option to see all the invisible characters in\n    your file.\n\n     :set list\n\n    With this option set, you can view space characters, tabs, newlines,\n    trailing space characters and wrapped lines.\n\n    To not display the invisible characters (which is the default), you have\n    to reset the 'list' option:\n\n     :set nolist\n     (or)\n     :set list!\n\n    The `:set list!` command will toggle the current setting of the boolean\n    'list' option.\n\n    You can modify the 'listchars' option to configure how and which\n    invisible characters are displayed. For example, with the following\n    command all the trailing space characters will be displayed with a \".\"\n    character.\n\n     :set listchars=trail:.\n\n    For more information, read:\n\n    \u001b[1m:help 'listchars'\u001b[0m\n\n    \u001b[1m:help 'list'\u001b[0m\n\n  \u001b[1m19.9. How do I configure Vim to always display the current line and column\n   number?\u001b[0m\n    You can set the 'ruler' option to display current column and line number\n    in the status line:\n\n     :set ruler\n\n    For more information, read:\n\n    \u001b[1m:help 'ruler'\u001b[0m\n\n  \u001b[1m19.10. How do I display the current Vim mode?\u001b[0m\n    You can set the 'showmode' option to display the current Vim mode. In\n    Insert, Replace and Visual modes, Vim will display the current mode on\n    the last line.\n\n     :set showmode\n\n    For more information, read:\n\n    \u001b[1m:help 'showmode'\u001b[0m\n\n  \u001b[1m19.11. How do I configure Vim to show pending/partial commands on the\n    status line?\u001b[0m\n    You can set the 'showcmd' option to display pending/partial commands in\n    the status line:\n\n     :set showcmd\n\n    For more information, read:\n\n    \u001b[1m:help 'showcmd'\u001b[0m\n\n  \u001b[1m19.12. How do I configure the Vim status line to display different\n    settings/values?\u001b[0m\n    You can set the 'statusline' option to display different values/settings\n    in the Vim status line.\n\n    For more information, read:\n\n    \u001b[1m:help 'statusline'\u001b[0m\n\n    \u001b[1m:help 'laststatus'\u001b[0m\n\n    \u001b[1m:help 'rulerformat'\u001b[0m\n\n    \u001b[1m:help 'ruler'\u001b[0m\n\n  \u001b[1m19.13. How do I configure Vim to display status line always?\u001b[0m\n    You can set the 'laststatus' option to 2 to display the status line\n    always.\n\n     :set laststatus=2\n\n    For more information, read:\n\n    \u001b[1m:help 'laststatus'\u001b[0m\n\n  \u001b[1m19.14. How do I make a Vim setting persistent across different Vim\n    invocations/instances/sessions?\u001b[0m\n    To make a Vim option setting persistent across different Vim instances,\n    add your setting to the .vimrc or .gvimrc file. You can also use the\n    `:mkvimrc` command to generate a vimrc file for the current settings.\n\n    For more information, read:\n\n    \u001b[1m:help save-settings\u001b[0m\n\n    \u001b[1m:help vimrc\u001b[0m\n\n    \u001b[1m:help gvimrc\u001b[0m\n\n    \u001b[1m:help vimrc-intro\u001b[0m\n\n    \u001b[1m:help :mkvimrc\u001b[0m\n\n    \u001b[1m:help initialization\u001b[0m\n\n  \u001b[1m19.15. Why do I hear a beep (why does my window flash) about 1 second after\n    I hit the Escape key?\u001b[0m\n    This is normal behavior. If your window flashes, then you've got the\n    visual bell on. Otherwise, you should hear a beep.\n\n    Vim needs a timeout to tell the difference between a simple escape and,\n    say, a cursor key sequence. When you press a key in normal mode (and\n    even in insert mode) and that key is the beginning of a mapping, Vim\n    waits a certain amount of time to see if the rest of the mapping\n    sequence follows. If the mapping sequence is completed before a given\n    timeout period, the mapping for that sequence of keys is applied. If you\n    interrupt the mapping, the normal actions associated with the keys are\n    executed.\n\n    For example, if you have a mapping defined as `:imap vvv Vim is great!!`\n    and you type \"vvv\" quickly, the \"Vim is great!!\" will be inserted into\n    your text. But if you type \"vv v\" then that is what will put into your\n    text. This is also true if you type \"vvv\" too slowly where \"too slowly\"\n    is longer than the value for the timeout option. Setting the timeout\n    option to a larger value can help alleviate problems that appear when\n    using function keys over a slow line.\n\n    For more information, read:\n\n    \u001b[1m:help 'ttimeout'\u001b[0m\n\n  \u001b[1m19.16. How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n    deleting the characters I'm changing?\u001b[0m\n    To make the \"c\" and \"s\" commands display a \"$\" instead of deleting the\n    characters, add the $ flag to the 'cpoptions' option:\n\n     :set cpoptions+=$\n\n    For more information, read:\n\n    \u001b[1m:help 'cpoptions'\u001b[0m\n\n  \u001b[1m19.17. How do I remove more than one flag using a single `:set` command\n    from a Vim option?\u001b[0m\n    You can remove more than one flag from a Vim option using a single\n    `:set` command, by specifying the flags in exactly the same order as\n    they appear in the option. For example, if you use the following command\n    to remove the \"t\" and \"n\" flags from the 'formatoptions' option:\n\n     :set formatoptions-=tn\n\n    The \"t\" and \"n\" flags will be removed from the 'formatoptions' option,\n    only if the 'formatoptions' option contains these flags in this order:\n    \"tn\". Otherwise, it will not remove the flags. To avoid this problem,\n    you can remove the flags one by one:\n\n     :set formatoptions-=t formatoptions-=n\n\n    For more information, read:\n\n    \u001b[1m:help :set-=\u001b[0m\n\n\u001b[1mMAPPING KEYS\u001b[0m\n  \u001b[1m20.1. How do I know what a key is mapped to?\u001b[0m\n    To see what a key is mapped to, use the following commands:\n\n     :map <key>\n     :map! <key>\n\n    You can also check the mappings in a particular mode using one of the\n    `:cmap`, `:nmap`, `:vmap`, `:imap`, `:omap`, etc commands.\n\n    To find out, where the key has been mapped, prefix the `:verbose`\n    command:\n\n     :verbose :map <key>\n\n    For more information, read:\n\n    \u001b[1m:help map-listing\u001b[0m\n\n    \u001b[1m:help map-overview\u001b[0m\n\n  \u001b[1m20.2. How do I list all the user-defined key mappings?\u001b[0m\n    You can list all the user-defined key mappings using:\n\n     :map\n\n    For more information, read:\n\n    \u001b[1m:help map-listing\u001b[0m\n\n  \u001b[1m20.3. How do I unmap a previously mapped key?\u001b[0m\n    You can unmap a previously mapped key using the `:unmap` command:\n\n     :unmap <key>\n     :unmap! <key>\n\n    For mode specific mappings, you can use one of the these commands:\n\n     :nunmap\n     :vunmap\n     :ounmap\n     :iunmap\n     :lunmap\n     :cunmap\n\n    The following command will fail to unmap a buffer-local mapped key:\n\n     :unmap <key>\n\n    To unmap a buffer-local mapped key, you have to use the <buffer> keyword\n    in the unmap command:\n\n     :unmap <buffer> <key>\n     :unmap! <buffer> <key>\n\n    For more information, read:\n\n    \u001b[1m:help :unmap\u001b[0m\n\n    \u001b[1m:help map-modes\u001b[0m\n\n    \u001b[1m:help :map-local\u001b[0m\n\n    \u001b[1m:help mapleader\u001b[0m\n\n  \u001b[1m20.4. I am not able to create a mapping for the <xxx> key. What is wrong?\u001b[0m\n    1) First make sure, the key is passed correctly to Vim. To determine if\n    this is the case, put Vim in Insert mode and then hit CTRL-V (or CTRL-Q\n    if your CTRL-V is remapped to the paste operation (e.g. on Windows if\n    you are using the mswin.vim script file) followed by your key.\n\n       If nothing appears in the buffer (and assuming that you have\n       'showcmd' on, ^V remains displayed near the bottom right of the Vim\n       screen), then Vim doesn't get your key correctly and there is nothing\n       to be done, other than selecting a different key for your mapping or\n       using GVim, which should recognise the key correctly.\n\n    2) Possibly, Vim gets your key, but sees it as no different than\n    something else. Say you want to map <Ctrl-Right>, then in Insert mode\n    hit CTRL-K followed by <Ctrl-Right>. If Vim displays <C-Right> it has\n    correctly seen the keystroke and you should be able to map it (by using\n    <C-Right> as your {lhs}). If it displays <Right> it has seen the\n    keystroke but as if you hadn't held <Ctrl> down: this means your\n    temrinal passes <Ctrl-Right> as if it were just <Right>. Anything else\n    means the key has been misidentified.\n\n    3) If the key is seen, but not as itself and not as some recognizable\n    key, then there is probably an error in the terminal library for the\n    current terminal (termcap or terminfo database). In that case\n\n         :set term?\n\n       will tell you which termcap or terminfo Vim is using. You can try to\n       tell vim, what termcode to use in that terminal, by adding the\n       following to your vimrc:\n\n         if &term == <termname>\n             set <C-Right>=<keycode>\n         endif\n\n       where <termname> above should be replaced by the value of 'term'\n       (with quotes around it) and <keycode> by what you get when hitting\n       CTRL-V followed by <Ctrl-Right> in Insert mode (with nothing around\n       it). <C-Right> should be left as-is (9 characters). Don't forget that\n       in a `:set` command, white space is not allowed between the equal sign\n       and the value, and any space, double quote, vertical bar or backslash\n       present as part of the value must be backslash-escaped.\n\n       Now you should be able to see the keycode corresponding to the key\n       and you can create a mapping for the key using the following command:\n\n         :map <C-Right>  <your_command_to_be_mapped>\n\n    For more information, read:\n\n    \u001b[1m:help map-keys-fails\u001b[0m\n\n    \u001b[1m:help :map-special-keys\u001b[0m\n\n    \u001b[1m:help key-codes\u001b[0m\n\n  \u001b[1m20.5. Why does mapping the <C-...> key not work?\u001b[0m\n    The only <Ctrl>-<printable-key> chords which Vim can reliably detect\n    (because they are defined in the ASCII standard) are the following:\n\n         CTRL-@                 0x00            NUL\n         CTRL-A to CTRL-Z       0x01 to 0x1A\n         CTRL-a to CTRL-z       0x01 to 0x1A\n         CTRL-[                 0x1B            ESC\n         CTRL-\\                 0x1C\n         CTRL-]                 0x1D\n         CTRL-^                 0x1E\n         CTRL-_                 0x1F\n         CTRL-?                 0x7F            DEL\n\n    Most of these, however, already have a function in Vim (and some are\n    aliases of other keys: CTRL-H and <BS>, CTRL-I and <Tab>, CTRL-M and\n    <Enter>, CTRL-[ and <Esc>, CTRL-? and <Del>).\n\n    The \"safest\" keys to use in Vim for the {lhs} of a mapping are the F\n    keys, with or without Shift: <F2> to <F12> and <S-F1> to <S-F12>. (Some\n    OSes, including mine, intercept <Ctrl-Fn> and <Alt-Fn>, which never\n    reach an application program such as vim or gvim).\n\n    You can try other combinations of <Ctrl> + any key, but they may either\n    not work everywhere (e.g. the terminal might not pass that key to Vim,\n    or they might have unintended side effects (e.g. mapping <C-I> means\n    also to map <Tab>).\n\n    This is a known issue, that has been discussed and might be implemented\n    in the future to enable Vim to distinguish between various keys even in\n    console mode. (e.g.\n    https://groups.google.com/d/msg/vim_dev/2bp9UdfZ63M/sajb9KM0pNYJ)\n\n  \u001b[1m20.6. How do I map the numeric keypad keys?\u001b[0m\n    First make sure that the numeric keypad keys are passed to Vim. Next,\n    you can use the following command to map the numeric keypad keys:\n\n     :map <kSomething>  <your_command>\n\n    where, <kSomething> can be kHome, kEnd, kPageUp, kPageDown, kPlus,\n    kMinus, kDivide, kMultiply, kEnter, etc.\n\n    For more information, read:\n\n    \u001b[1m:help key-codes\u001b[0m\n\n    \u001b[1m:help terminal-options\u001b[0m\n\n  \u001b[1m20.7. How do I create a mapping that works only in visual mode?\u001b[0m\n    You can create mappings that work only in specific modes (normal,\n    command, insert, visual, etc). To create a mapping that works only in\n    the visual mode, use the `:vmap` command:\n\n     :vmap <F3> <your mapping here>\n\n    This mapping will work in visual and select mode. If you want the map to\n    work only in visual mode (excluding select mode), use:\n\n     :xmap <F3> <your mapping here>\n\n    and to have the mapping only work in select mode (but not visual mode),\n    use:\n\n     :smap <F3> <your mapping here>\n\n    For more information, read:\n\n    \u001b[1m:help :vmap\u001b[0m\n\n    \u001b[1m:help :xmap\u001b[0m\n\n    \u001b[1m:help :smap\u001b[0m\n\n    \u001b[1m:help map-modes\u001b[0m\n\n    \u001b[1m:help 40.1\u001b[0m\n\n  \u001b[1m20.8. How do I create a mapping that works only in normal and operator\n   pending mode (but not in visual mode)?\u001b[0m\n    Using `:map` creates a mapping that works in normal, visual+select mode\n    and operator pending mode. You can use `:nmap` to have the mapping only\n    work in normal mode and `:vmap` to have the mapping only be defined for\n    visual and select mode or use `:omap` to have the mapping only defined\n    in operator pending mode.\n\n    But if you want to have a mapping defined, that works in both operator\n    pending mode and normal mode, but not in visual and select mode, you\n    need to first define the mapping using `:map` and afterwards delete the\n    mapping for visual and select mode:\n\n            :map <f3> <your mapping here>\n            :vunmap <f3>\n\n  \u001b[1m20.9. In a Vim script, how do I know which keys to use for my mappings, so\n   that the mapped key will not collide with an already used key?\u001b[0m\n    Vim uses most of the keys in the keyboard. You can use the <leader>\n    prefix in maps to define keys which will not overlap with Vim keys. For\n    example:\n\n     :map <leader>S <C-W>s\n     :map <leader>j <C-W>j\n     :map <leader>k <C-W>k\n\n    where by default <leader> gets substituted with a backslash (\\), so the\n    user would enter\n\n         \\s\n         \\j\n         \\k\n\n    to invoke the above map commands. The user can change the mapleader\n    variable to be whatever they wanted:\n\n     :let mapleader = \",\"\n\n    When writing a plugin or other script, more often than not, it is\n    advisable to use `:noremap` instead of `:map` to avoid side effects from\n    user defined mappings.\n\n    For more information, read:\n\n    \u001b[1m:help <Leader\u001b[0m>\n\n    \u001b[1m:help <LocalLeader\u001b[0m>\n\n    \u001b[1m:help write-plugin\u001b[0m\n\n  \u001b[1m20.10. How do I map the escape key?\u001b[0m\n    You can map the Escape key to some other key using the `:map` command.\n    For example, the following command maps the escape key to CTRL-O.\n\n     :map <C-O> <Esc>\n\n  \u001b[1m20.11. How do I map a key to perform nothing?\u001b[0m\n    You can map a key to <Nop> to perform nothing when the key is pressed.\n    For example, with the following mappings, the <F7> key will do nothing\n    when pressed.\n\n     :map <F7> <Nop>\n     :map! <F7> <Nop>\n\n    For more information, read:\n\n    \u001b[1m:help <Nop\u001b[0m>\n\n    \u001b[1m:help :map\u001b[0m\n\n    \u001b[1m:help :map!\u001b[0m\n\n    \u001b[1m:help map-modes\u001b[0m\n\n  \u001b[1m20.12. I want to use the <Tab> key to indent a block of text and <Shift-Tab>\n    key to unindent a block of text. How do I map the keys to do this?\n    This behavior is similar to textpad, visual studio, etc.\u001b[0m\n    Use the following mapping:\n\n     :inoremap <S-Tab> <C-O><lt><lt>\n     :nnoremap <Tab> >>\n     :nnoremap <S-Tab> <lt><lt>\n     :vnoremap <Tab> >\n     :vnoremap <S-Tab> <lt>\n\n    Note, that the <S-Tab> mapping will work only if Vim receives the\n    correct key sequence. This is mostly the case with GUI Vim.\n\n    For more information, read:\n\n    \u001b[1m:help :inoremap\u001b[0m\n\n    \u001b[1m:help :nnoremap\u001b[0m\n\n    \u001b[1m:help :vnoremap\u001b[0m\n\n    \u001b[1m:help <S-Tab\u001b[0m>\n\n    \u001b[1m:help i_CTRL-O\u001b[0m\n\n    \u001b[1m:help \u001b[0m>>\n\n    \u001b[1m:help <<\u001b[0m\n\n    \u001b[1m:help <lt\u001b[0m>\n\n  \u001b[1m20.13. In my mappings the special characters like <CR> are not recognized.\n    How can I configure Vim to recognize special characters?\u001b[0m\n    Check the value of the 'cpoptions' option:\n\n     :set cpoptions?\n\n    If this option contains the \"<\" flag, then special characters will not\n    be recognized in mappings. Remove the \"<\" flag from 'cpoptions' option:\n\n     :set cpo-=<\n\n    Also, check the value of the 'compatible' option:\n\n     :set compatible?\n\n    The 'compatible' option must be reset:\n\n     :set nocompatible\n\n    For more information, read:\n\n    \u001b[1m:help 'cpoptions'\u001b[0m\n\n    \u001b[1m:help 'compatible'\u001b[0m\n\n  \u001b[1m20.14. How do I use the \"|\" to separate multiple commands in a map?\u001b[0m\n    You can escape the \"|\" character using backslash (\\) to use \"|\" in a\n    map.\n\n     :map _l :!ls \\| more<CR>\n\n    You can also try the following command:\n\n     :map _l :!ls <bar> more<CR>\n\n    There are also other ways to do this.\n\n    For more information, read:\n\n    \u001b[1m:help map_bar\u001b[0m\n\n  \u001b[1m20.15. If I have a mapping/abbreviation whose ending is the beginning of\n    another mapping/abbreviation, how do I keep the first from expanding\n    into the second one?\u001b[0m\n    Instead of using the `:map lhs rhs` command, use the `:noremap lhs rhs`\n    command. For abbreviations, use \"noreabbrev lhs rhs\". The \"nore\" prefix\n    prevents the mapping or abbreviation from being expanded again.\n\n    For more information, read:\n\n    \u001b[1m:help :noremap\u001b[0m\n\n    \u001b[1m:help :noreabbrev\u001b[0m\n\n  \u001b[1m20.16. Why does it take a second or more for Vim to process a key,\n    sometimes when I press a key?\u001b[0m\n    Make sure you have not defined a mapping for this key using the\n    following command:\n\n     :map <key>\n\n    If a mapping is defined for this key and the mapped key contains more\n    than one character, then Vim will wait for the next character to be\n    pressed to determine whether it is the mapped key or not. For example,\n    if you have mapped \"ab\", then if you press \"a\", Vim will wait for the\n    next key to be pressed. If the next key is \"b\", Vim will execute the\n    mapped sequence. Otherwise, Vim will proceed with the normal processing\n    of \"a\" followed by the next key. If the 'timeout' option is set (which\n    is the default), then Vim will timeout after waiting for the period\n    specified with the 'timeoutlen' option (default is 1 second).\n\n    For more information, read:\n\n    \u001b[1m:help map-typing\u001b[0m\n\n    \u001b[1m:help 'timeoutlen'\u001b[0m\n\n    \u001b[1m:help 'ttimeoutlen'\u001b[0m\n\n    \u001b[1m:help 'timeout'\u001b[0m\n\n    \u001b[1m:help 'ttimeout'\u001b[0m\n\n    \u001b[1m:help vt100-cursor-keys\u001b[0m\n\n    \u001b[1m:help slow-fast-terminal\u001b[0m\n\n  \u001b[1m20.17. How do I map a key to run an external command using a visually\n    selected text?\u001b[0m\n    You can the `:vmap` command to map a key in the visual mode. In the\n    mapped command sequence, you have to first yank the text. The yanked\n    text is available in the '\"' register. Now, you can use the contents of\n    this register to run the external command. For example, to run the\n    external command \"perldoc\" on a visually selected text, you can use the\n    following mapping:\n\n     :vmap <F7> y:!exec \"!perldoc '\" . @\" . \"'\"<CR>\n\n    If you want the mapping to work in the visual mode, but not with the\n    highlighted text, you can use the following command:\n\n     :vmap <F7> :<C-U>!perldoc <cword><CR>\n\n    The above mapping will use the word under the cursor instead of the\n    highlighted text. Note the use of the <C-U> before invoking the\n    \"perldoc\" external command. The <C-U> is used to erase the range of text\n    selected in the visual mode and displayed on the command line. If the\n    visual range is not removed using <C-U>, then the output from the\n    external command will replace the visually selected text.\n\n    For more information, read:\n\n    \u001b[1m:help :vmap\u001b[0m\n\n    \u001b[1m:help quote_quote\u001b[0m\n\n    \u001b[1m:help :let-register\u001b[0m\n\n    \u001b[1m:help c_CTRL-U\u001b[0m\n\n    \u001b[1m:help :!cmd\u001b[0m\n\n  \u001b[1m20.18. How do I map the CTRL-I key while still retaining the functionality\n    of the <Tab> key?\u001b[0m\n    The CTRL-I key and the <Tab> key produce the same keycode, so Vim cannot\n    distinguish between the CTRL-I and the <Tab> key. When you map the\n    CTRL-I key, the <Tab> key is also mapped (and vice versa). The same\n    restriction applies for the CTRL-[ key and the <Esc> key.\n\n    For more information, read:\n\n    \u001b[1m:help keycodes\u001b[0m\n\n  \u001b[1m20.19. How do I define a map to accept a count?\u001b[0m\n    Use the @= command to use an expression. For example,\n\n     nnoremap = @='3l'\n\n    Now you can specify a count to the \"=\" command.\n\n    \u001b[1m:help complex-repeat\u001b[0m\n\n  \u001b[1m20.20. How can I make my normal mode mapping work from within Insert\n    Mode?\u001b[0m\n    Mappings in normal mode can be executed after CTRL-O from insert mode as\n    well but if there are more commands included in the mapping {rhs}, only\n    the first one will be executed in normal mode and the rest of {rhs} will\n    be printed literally in insert mode. One of ways to workaround this\n    problem is to make {rhs} be one command, via wrapping it to the\n    function. For example:\n\n     function GetFontNameOfFirstChar()\n     normal! 0\n     echo getfontname()\n     endfunction\n\n     :nmap <F9> :call GetFontNameOfFirstChar()<CR>\n\n    A more technical and detailed solution to this problem follows and can\n    be found at https://groups.google.com/group/vim_dev/msg/75f1f2dfc00908bb\n\n    Not every normal mode-mapping is automatically suitable for execution\n    via CTRL-O from within insert mode; you need to explicitly design your\n    mappings for that purpose.\n\n    The CTRL-O command allows execution of one normal mode command from\n    within insert mode, then returns to insert mode. If a normal mode\n    mapping concatenates multiple normal mode commands, this breaks down in\n    temporary normal mode and literally inserts the second part of the\n    command into the buffer instead. To support execution of normal mode\n    mappings from within insert mode, these strategies can be used:\n\n    1) Instead of concatenating multiple normal mode commands, use one\n    `:normal` mapping:\n\n     :nnoremap <silent> zC :<C-U>normal! zCVzC<CR>\n\n    2) Concatenate multiple Ex commands via <Bar> on the rhs:\n\n     :nnoremap zC :<C-U>call MyMap1()<Bar>call MyMap2()<CR>\n\n    3) Shadow normal mode mappings by insert mode mappings that re-enter\n    normal mode, then invoke the normal mode mapping:\n\n     :nnoremap <silent> <SID>MyMap2 :<C-U>call MyMap2()<CR>\n     :inoremap <silent> <script> <SID>MyMap2 <C-\\><C-O><SID>MyMap2\n     :nnoremap <silent> <script> zC <SID>MyMap1<SID>MyMap2\n\n    4) Normal mode mappings that consist of multiple Ex command lines (and\n    where Ex commands cannot be concatenated via <Bar>) replace `:<C-U>`\n    with <SID>NM; the <SID>NM mapping enters normal mode for one ex command\n    line:\n\n     :nnoremap <silent> <SID>NM :<C-U>\n     :inoremap <silent> <SID>NM <C-\\><C-O>:\n     :nnoremap <silent> <script> zC <SID>MyMap1<SID>NMcall MyMap2()<CR>\n\n    5) If none of the above is possible, at least force normal mode for\n    subsequent commands via CTRL-\\ CTRL-N to avoid accidental insertion of\n    the remainder of the mapping.\n\n     :nnoremap zC zC<C-\\><C-N>VzCzz\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-O\u001b[0m\n\n    \u001b[1m:help map_bar\u001b[0m\n\n    \u001b[1m:help i_CTRL-\\_CTRL-O\u001b[0m\n\n    \u001b[1m:help CTRL-\\_CTRL-N\u001b[0m\n\n\u001b[1mABBREVIATIONS\u001b[0m\n  \u001b[1m21.1. How do I auto correct misspelled words?\u001b[0m\n    You can auto correct misspelled words using abbreviations. For example,\n    the following abbreviation can be used to correct \"teh\" with \"the\":\n\n     :abbreviate teh the\n\n    Vim supports abbreviations in insert mode, replace mode and command-line\n    mode.\n\n    For more information, read:\n\n    \u001b[1m:help 24.7\u001b[0m\n\n    \u001b[1m:help abbreviations\u001b[0m\n\n    \u001b[1m:help Q_ab\u001b[0m\n\n  \u001b[1m21.2. How do I create multi-line abbreviations?\u001b[0m\n    You can create multi-line abbreviations by embedding the \"<CR>\" key code\n    in the text:\n\n     iabbrev #c --------------<CR>-- Date:<CR>--<CR>---------\n\n    With the above abbreviation, when you type #c, it will be expanded to\n    the following text:\n\n    -------------- -- Date: -- ---------\n\n    For more information, read:\n\n    \u001b[1m:help abbreviations\u001b[0m\n\n  \u001b[1m21.3. When my abbreviations are expanded, an additional space character is\n   added at the end of the expanded text. How do I avoid this character?\u001b[0m\n    To avoid an additional space character at the end of the expanded text,\n    you can expand the abbreviation by pressing the CTRL-] key. The\n    abbreviation will be expanded without adding a space character at the\n    end.\n\n    Another alternative is to use the following function and command:\n\n     function! Eatchar(pat)\n         let c = nr2char(getchar())\n         return (c =~ a:pat) ? '' : c\n     endfunction\n     command! -nargs=+ Iabbr execute \"iabbr\" <q-args> . \"<C-R>=Eatchar('\\\\s')<CR>\"\n\n    Now, define your abbreviations using the new \"Iabbr\" command instead of\n    the builtin `:iabbrev` command. With this command, after expanding the\n    abbreviated text, the next typed space character will be discarded.\n\n    For more information, read:\n\n    \u001b[1m:help abbreviations\u001b[0m\n\n  \u001b[1m21.4. How do I insert the current date/time stamp into the file?\u001b[0m\n    You can use the strftime() function to insert the current data/time\n    stamp in a file. For example, you can use the following abbreviation:\n\n     iabbrev dts <C-R>=strftime(\"%y/%m/%d %H:%M\")<CR>\n\n    With this abbreviation, when you type dts in insert mode, it will be\n    expanded to the date/time stamp.\n\n    Some other forms of the above abbreviation are listed below:\n\n     iabbrev mdyl <C-R>=strftime(\"%a %d %b %Y\")<CR>\n     iabbrev mdys <C-R>=strftime(\"%y%m%d\")<CR>\n     iabbrev mdyc <C-R>=strftime(\"%c\")<CR>\n     iabbrev hml  <C-R>=strftime(\"%d/%m/%y %H:%M:%S\")<CR>\n     iabbrev hms  <C-R>=strftime(\"%H:%M:%S\")<CR>\n\n    For more information, read:\n\n    \u001b[1m:help strftime()\u001b[0m\n\n    \u001b[1m:help i_CTRL-R\u001b[0m\n\n  \u001b[1m21.5. How do I prevent an abbreviation from expanding in insert mode?\u001b[0m\n    You can prevent an abbreviation from expanding in insert mode by typing\n    CTRL-V before the character after the abbreviated word.\n\n    For more information, read:\n\n    \u001b[1m:help abbreviations\u001b[0m\n\n\u001b[1mRECORD AND PLAYBACK\u001b[0m\n  \u001b[1m22.1. How do I repeat an editing operation (insertion, deletion, paste,\n   etc)?\u001b[0m\n    You can repeat the last editing operation using the \".\" command. This\n    will repeat the last simple change like a insert, delete, change, paste,\n    etc.\n\n    For more information, read:\n\n    \u001b[1m:help 04.3\u001b[0m\n\n    \u001b[1m:help single-repeat\u001b[0m\n\n    \u001b[1m:help Q_re\u001b[0m\n\n  \u001b[1m22.2. How I record and repeat a set of key sequences?\u001b[0m\n    You can use the \"q\" command in normal mode to record a set of key\n    sequences and store it in a register. For example, in the normal mode\n    you can press q followed by a register name {0-9a-bA-Z\"} to start the\n    recording. To end/stop the recording press q again. You can\n    playback/repeat the recorded key sequences by pressing @ followed by the\n    register name. e.g. @a.\n\n    Another approach is to start Vim with the \"-w\" command-line argument.\n\n     $ vim -w <file_name>\n\n    Vim will record all the characters typed in the session in the specified\n    file \"file_name\". You can use the recorded file with the \"-s\" command\n    line argument to play it back:\n\n     $ vim -s <file_name>\n\n    For more information, read:\n\n    \u001b[1m:help 10.1\u001b[0m\n\n    \u001b[1m:help recording\u001b[0m\n\n    \u001b[1m:help -w\u001b[0m\n\n    \u001b[1m:help -s\u001b[0m\n\n  \u001b[1m22.3. How do I edit/modify a recorded set of key sequences?\u001b[0m\n    The recorded key sequences are stored in a register. You can paste the\n    contents of the register into a Vim buffer, edit the pasted text and\n    again yank the text into the register. You can also use the `:let`\n    command to modify the register. For example:\n\n     :let @a = \"iHello World\\<Esc>\"\n\n    For more information, read:\n\n    \u001b[1m:help recording\u001b[0m\n\n    \u001b[1m:help 10.1\u001b[0m\n\n    \u001b[1m:help :let-register\u001b[0m\n\n    \u001b[1m:help <\u001b[0m>\n\n    \u001b[1m:help 'cpoptions'\u001b[0m\n\n  \u001b[1m22.4. How do I write recorded key sequences to a file?\u001b[0m\n    The recorded key sequences are stored in a register. You can paste the\n    contents of the register into a Vim buffer. Now you can save the buffer\n    into a file. You can also modify the pasted text and again yank into the\n    register to modify the recorded key sequence. For example, if you record\n    a set of key sequences using qa ..... q. The recorded key sequences are\n    stored in the register \"a\". You can paste the contents of register \"a\"\n    using \"ap.\n\n    For more information, read:\n\n    \u001b[1m:help recording\u001b[0m\n\n    \u001b[1m:help 10.1\u001b[0m\n\n  \u001b[1m22.5. I am using register 0 to record my key sequences (i.e. q0 .... q).\n   In the recorded key sequences, I am yanking some text. After the\n   first replay of the recorded key sequence, I am no longer able to\n   play it back.\u001b[0m\n    Register 0 contains the text from the last yank operation. In your\n    recorded key sequence, when the yank is performed, register 0 is\n    overwritten with the yanked text. So your recording stored in register 0\n    is lost. You have to use some other register.\n\n    For more information, read:\n\n    \u001b[1m:help registers\u001b[0m\n\n\u001b[1mAUTOCOMMANDS\u001b[0m\n  \u001b[1m23.1. How do I execute a command when I try to modify a read-only file?\u001b[0m\n    You can use the FileChangedRO autocommand event to execute a command\n    when a read-only file is modified. For example, you can use this event\n    to checkout a read-only file:\n\n     :autocmd FileChangedRO * call MyCheckoutFunction()\n\n    For more information, read:\n\n    \u001b[1m:help FileChangedRO\u001b[0m\n\n  \u001b[1m23.2. How do I execute a command every time when entering a buffer?\u001b[0m\n    You can use the BufEnter autocommand event to execute a command every\n    time when entering a buffer. For example:\n\n     :autocmd BufEnter *.c set formatoptions=croqt\n\n    For more information, read:\n\n    \u001b[1m:help BufEnter\u001b[0m\n\n  \u001b[1m23.3. How do I execute a command every time when entering a window?\u001b[0m\n    You can use the WinEnter autocommand event to execute a command every\n    time when entering a window. For example:\n\n     :autocmd WinEnter *.c call MyFunction()\n\n    For more information, read:\n\n    \u001b[1m:help WinEnter\u001b[0m\n\n  \u001b[1m23.4. From an autocmd, how can I determine the name of the file or the\n   buffer number for which the autocommand is executed?\u001b[0m\n    You can use the special words <afile> or <abuf> in an autocmd to get the\n    name of the file or the buffer number for which the autocommand is\n    executed.\n\n    For more information, read:\n\n    \u001b[1m:help :<afile\u001b[0m>\n\n    \u001b[1m:help :<abuf\u001b[0m>\n\n    \u001b[1m:help :<amatch\u001b[0m>\n\n  \u001b[1m23.5. How do I automatically save all the changed buffers whenever Vim\n   loses focus?\u001b[0m\n    You can define an autocommand for the FocusLost event which will save\n    all the modified buffers whenever Vim loses focus:\n\n     :autocmd FocusLost * wall\n\n    For more information, read:\n\n    \u001b[1m:help FocusLost\u001b[0m\n\n    \u001b[1m:help :wall\u001b[0m\n\n  \u001b[1m23.6. How do I execute/run a function when Vim exits to do some cleanup?\u001b[0m\n    You can use VimLeave autocmd event to execute a function just before Vim\n    exits. For example,\n\n     :autocmd VimLeave * call MyCleanupFunction()\n\n    For more information, read:\n\n    \u001b[1m:help VimLeave\u001b[0m\n\n\u001b[1mSYNTAX HIGHLIGHT\u001b[0m\n  \u001b[1m24.1. How do I turn off/on syntax highlighting?\u001b[0m\n    By default, the Vim syntax highlighting is turned off. To enable the\n    syntax highlighting, you can use one of the following commands:\n\n     :syntax enable\n\n     or\n\n     :syntax on\n\n    To disable the syntax highlighting, you can use the following command:\n\n     :syntax off\n\n    For more information, read:\n\n    \u001b[1m:help 06.1\u001b[0m\n\n    \u001b[1m:help 06.4\u001b[0m\n\n    \u001b[1m:help :syntax-enable\u001b[0m\n\n    \u001b[1m:help :syntax-on\u001b[0m\n\n    \u001b[1m:help :syn-clear\u001b[0m\n\n  \u001b[1m24.2. How do I change the background and foreground colors used by Vim?\u001b[0m\n    Vim uses the \"Normal\" highlight group for the background and foreground\n    colors. To change the foreground/background colors, you have to modify\n    the \"Normal\" highlight group. For example, to set the background color\n    to blue and foreground color to white, you can use\n\n     :highlight Normal ctermbg=blue ctermfg=white guibg=blue guifg=white\n\n    If you are using the Motif or the Athena version of the GUI Vim, then\n    you can modify the foreground and background resource names in the\n    .Xdefaults files to change the colors:\n\n     Vim.foreground:     Black\n     Vim.background:     Wheat\n\n    You can also use the \"-foreground\" and \"-background\" command-line\n    arguments to specify the foreground and background colors. These\n    arguments are supported only in the Motif or Athena versions:\n\n     $ gvim -foreground Black -background Wheat\n\n    For more information, read:\n\n    \u001b[1m:help :highlight\u001b[0m\n\n    \u001b[1m:help .Xdefaults\u001b[0m\n\n    \u001b[1m:help -gui\u001b[0m\n\n  \u001b[1m24.3. How do I change the highlight colors to suit a dark/light background?\u001b[0m\n    You can set the 'background' option to either \"dark\" or \"light\" to\n    change the highlight colors to suit a dark/light background:\n\n     :set background=dark\n\n    For more information, read:\n\n    \u001b[1m:help 'background'\u001b[0m\n\n    \u001b[1m:help 06.2\u001b[0m\n\n  \u001b[1m24.4. How do I change the color of the line numbers displayed when the\n   `:set number` command is used?\u001b[0m\n    The line numbers displayed use the LineNr highlighting group. To display\n    the current colors used, use\n\n     :hi LineNr\n\n    To change the color modify the LineNr highlight group. For example:\n\n     :hi linenr guifg=red guibg=black\n\n    This will give red numbers on a black background in GVIM.\n\n    For more information, read:\n\n    \u001b[1m:help :highlight\u001b[0m\n\n  \u001b[1m24.5. How do I change the background color used for a Visually selected\n   block?\u001b[0m\n    You can modify the \"Visual\" highlight group to change the color used for\n    a visually selected block:\n\n     :highlight Visual guibg=red\n\n    For more information, read:\n\n    \u001b[1m:help :highlight\u001b[0m\n\n    \u001b[1m:help hl-Visual\u001b[0m\n\n  \u001b[1m24.6. How do I highlight the special characters (tabs, trailing spaces, end\n   of line, etc) displayed by the 'list' option?\u001b[0m\n    You can modify the \"NonText\" and \"SpecialKey\" highlight groups to\n    highlight the special characters displayed by the 'list' option:\n\n     :highlight NonText guibg=red\n     :highlight SpecialKey guibg=green\n\n    The \"NonText\" highlighting group is used for \"eol\", \"extends\" and\n    \"precedes\" settings in the 'listchars' option. The \"SpecialKey\"\n    highlighting group is used for the \"tab\" and \"trail\" settings.\n\n    For more information, read:\n\n    \u001b[1m:help 'listchars'\u001b[0m\n\n    \u001b[1m:help hl-NonText\u001b[0m\n\n    \u001b[1m:help hl-SpecialKey\u001b[0m\n\n  \u001b[1m24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that Vim\n   uses the specified colorscheme every time?\u001b[0m\n    You can specify the color scheme using the `:colorscheme` command in\n    your .vimrc or .gvimrc file:\n\n     colorscheme evening\n\n    For more information, read:\n\n    \u001b[1m:help :colorscheme\u001b[0m\n\n  \u001b[1m24.8. Vim syntax highlighting is broken. When I am editing a file, some\n   parts of the file is not syntax highlighted or syntax highlighted\n   incorrectly.\u001b[0m\n    Vim doesn't read the whole file to parse the text for syntax\n    highlighting. It starts parsing wherever you are viewing the file. That\n    saves a lot of time, but sometimes the colors are wrong. A simple fix is\n    refreshing the screen using the CTRL-L key. Or scroll back a bit and\n    then forward again. You can also use the command:\n\n     :syntax sync fromstart\n\n    Note that this might considerably slow down the screen refreshing.\n\n    For more information, read:\n\n    \u001b[1m:help :syn-sync\u001b[0m\n\n    \u001b[1m:help :syn-sync-first\u001b[0m\n\n  \u001b[1m24.9. Is there a built-in function to syntax-highlight the corresponding\n   matching bracket?\u001b[0m\n    Yes. Vim includes the matchparen Plugin as standard plugin that is\n    enabled by default. Whenever the cursor moves over an item defined with\n    the 'matchpairs' option, Vim will highlight the corresponding bracket\n    using the MatchParen highlighting group.\n\n    However, if the corresponding parenthesis is not visible in the current\n    window, the cursor won't jump to it.\n\n    The matchit plugin provides a similar function, that lets the cursor\n    jump to related items (e.g. \"if\", \"else\", \"endif\" items) and skips\n    matches in comments. This uses the % command to jump to corresponding\n    items. Though both plugins provide similar functions they are unrelated\n    and work differently.\n\n    For more information, read:\n\n    \u001b[1m:help matchparen\u001b[0m\n\n    \u001b[1m:help 'matchpairs'\u001b[0m\n\n    \u001b[1m:help matchit-install\u001b[0m\n\n    \u001b[1m:help matchit-intro\u001b[0m\n\n  \u001b[1m24.10. How do I turn off the C comment syntax highlighting?\u001b[0m\n    You can use the following command to turn off C comment syntax\n    highlighting:\n\n     :highlight clear comment\n\n    For more information, read:\n\n    \u001b[1m:help ft-c-syntax\u001b[0m\n\n  \u001b[1m24.11. How do I add my own syntax extensions to the standard syntax files\n    supplied with Vim?\u001b[0m\n    You should not modify the syntax files supplied with Vim to add your\n    extensions. When you install the next version of Vim, you will lose your\n    changes. Instead you should create a file under the ~/.vim/after/syntax\n    directory with the same name as the original syntax file and add your\n    additions to this file.\n\n    For more information, read:\n\n    \u001b[1m:help mysyntaxfile-add\u001b[0m\n\n    \u001b[1m:help 'runtimepath'\u001b[0m\n\n  \u001b[1m24.12. How do I replace a standard syntax file that comes with the Vim\n    distribution with my own syntax file?\u001b[0m\n    You can replace a standard syntax file that comes with the Vim\n    distribution by creating a file with the same name as the original\n    syntax file and placing it in the vim runtime syntax (~/.vim/syntax)\n    directory. For example, to replace the c.vim syntax file in a Unix\n    system, place the new c.vim in the ~/.vim/syntax directory. In a\n    MS-Windows system, place the new syntax file in the\n    $HOME/vimfiles/syntax or $VIM/vimfiles/syntax directory.\n\n    For more information, read:\n\n    \u001b[1m:help mysyntaxfile-replace\u001b[0m\n\n    \u001b[1m:help 44.11\u001b[0m\n\n    \u001b[1m:help mysyntaxfile\u001b[0m\n\n  \u001b[1m24.13. How do I highlight all the characters after a particular column?\u001b[0m\n    You can use the `:match` command to highlight all the characters after a\n    particular column:\n\n     :match Todo '\\%>75v.\\+'\n\n    This will highlight all the characters after the 75th column.\n\n    You can also set the 'colorcolumn' option to highlight a particular\n    column:\n\n       :set colorcolumn=+2\n\n    which highlights 2 columns after the current 'textwidth' setting\n    (alternatively, you can use the exact column number).\n\n    For more information, read:\n\n    \u001b[1m:help :match\u001b[0m\n\n    \u001b[1m:help /\\%v\u001b[0m\n\n    \u001b[1m:help /\\+\u001b[0m\n\n    \u001b[1m:help /.\u001b[0m\n\n    \u001b[1m:help 'colorcolumn'\u001b[0m\n\n  \u001b[1m24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n    highlighting into a HTML file?\u001b[0m\n    You can use the 2html.vim script to convert a source file into a HTML\n    file with the Vim syntax highlighting. Use the following command:\n\n     :TOhtml\n\n    For more information, read:\n\n    \u001b[1m:help convert-to-HTML\u001b[0m\n\n    \u001b[1m:help :TOhtml\u001b[0m\n\n  \u001b[1m24.15. How do I list the definition of all the current highlight groups?\u001b[0m\n    You can list the definition of all the current highlight groups using\n    the `:highlight` (without any arguments) ex command.\n\n    For more information, read:\n\n    \u001b[1m:help :highlight\u001b[0m\n\n  \u001b[1m24.16. How can I embed one syntax highlighting language into another one?\u001b[0m\n    It is possible to include one syntax highlighting into another one,\n    however most of the currently deployed syntax highlighting scripts are\n    not prepared to be included into another syntax script.\n\n    You can however create your own custom script to define your own\n    regions, which will be highlighted with a different language.\n\n    See the wiki for a comprehensive solution:\n\n     http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file\n\n    For more information, read:\n\n    \u001b[1m:help :syn-include\u001b[0m\n\n    \u001b[1m:help sh-awk\u001b[0m\n\n\u001b[1mVIM SCRIPT WRITING\u001b[0m\n  \u001b[1m25.1. How do I list the names of all the scripts sourced by Vim?\u001b[0m\n    You can use the `:scriptnames` command to list the names of all the\n    scripts sourced by Vim:\n\n     :scriptnames\n\n    For more information, read:\n\n    \u001b[1m:help :scriptnames\u001b[0m\n\n  \u001b[1m25.2. How do I debug Vim scripts?\u001b[0m\n    Vim has built-in support for a primitive debugger to debug Vim plugins\n    and scripts. Using this debugger you can set breakpoints and step\n    through the plugin functions.\n\n    For more information, read:\n\n    \u001b[1m:help debug-scripts\u001b[0m\n\n    \u001b[1m:help -D\u001b[0m\n\n  \u001b[1m25.3. How do I locate the script/plugin which sets a Vim option?\u001b[0m\n    You can use the `:verbose` command to locate the plugin/script which\n    last modified a Vim option. For example:\n\n     :verbose set textwidth?\n\n    For more information, read:\n\n    \u001b[1m:help :set-verbose\u001b[0m\n\n    \u001b[1m:help :verbose\u001b[0m\n\n  \u001b[1m25.4. I am getting some error/informational messages from Vim (possibly\n   when running a script), the messages are cleared immediately. How do\n   I display the messages again?\u001b[0m\n    You can use the `:messages` command to display the previous messages.\n\n     :messages\n\n    For more information, read:\n\n    \u001b[1m:help :messages\u001b[0m\n\n    \u001b[1m:help :echoerr\u001b[0m\n\n    \u001b[1m:help :echomsg\u001b[0m\n\n    \u001b[1m:help message-history\u001b[0m\n\n  \u001b[1m25.5. How do I save and restore a plugin specific information across Vim\n   invocations?\u001b[0m\n    Vim will save and restore global variables that start with an uppercase\n    letter and don't contain a lower case letter. For this to work, the\n    'viminfo' option must contain the \"!\" flag. Vim will store the variables\n    in the viminfo file.\n\n    For more information, read:\n\n    \u001b[1m:help 'viminfo'\u001b[0m\n\n    \u001b[1m:help viminfo-file\u001b[0m\n\n    \u001b[1m:help variables\u001b[0m\n\n  \u001b[1m25.6. How do I start insert mode from a Vim function?\u001b[0m\n    You can use the `:startinsert` command to start the insert mode from\n    inside a Vim function.\n\n    For more information, read:\n\n    \u001b[1m:help :startinsert\u001b[0m\n\n  \u001b[1m25.7. How do I change the cursor position from within a Vim function?\u001b[0m\n    You can use the cursor() function to position the cursor.\n\n         call cursor(lnum, col)\n\n    Alternatively, use the setpos() function:\n\n         call setpos('.', [bufnum, lnum, col, off])\n\n    which set's the cursor in the buffer bufnum to line lnum, column col and\n    offset for 'virtualedit'. You can use the getpos() function, to return a\n    list with these values, that can then be fed back to the setpos()\n    function.\n\n    If you want to save and restore the viewpoint on a window, use the\n    winsaveview() and winrestview() function calls.\n\n    You can also use the following command to change the cursor position:\n\n         exe \"normal! \" . lnum . \"G\" . col . \"|\"\n\n    For more information, read:\n\n    \u001b[1m:help cursor()\u001b[0m\n\n    \u001b[1m:help bar\u001b[0m\n\n    \u001b[1m:help getpos()\u001b[0m\n\n    \u001b[1m:help setpos()\u001b[0m\n\n    \u001b[1m:help winsaveview()\u001b[0m\n\n    \u001b[1m:help winrestview()\u001b[0m\n\n  \u001b[1m25.8. How do I check the value of an environment variable in the .vimrc\n   file?\u001b[0m\n    You can use prefix the environment variable name with the \"$\" character\n    to use it from a Vim script/function. You can refer to the value of an\n    environment variable using the $env_var syntax:\n\n     if $EDITOR == 'vi'\n     endif\n\n    For more information, read:\n\n    \u001b[1m:help expr-env\u001b[0m\n\n  \u001b[1m25.9. How do I check whether an environment variable is set or not from a\n   Vim function?\u001b[0m\n    You can use the exists() function to check for the existence of an\n    environment variable.\n\n     if exists(\"$MY_ENV_VAR\")\n     endif\n\n    For more information, read:\n\n    \u001b[1m:help exists()\u001b[0m\n\n    \u001b[1m:help expr-env\u001b[0m\n\n  \u001b[1m25.10. How do I call/use the Vim built-in functions?\u001b[0m\n    You can use the `:call` command to invoke a Vim built-in function:\n\n     :call cursor(10,20)\n\n    You can use the `:echo` command to echo the value returned by a\n    function:\n\n     :echo char2nr('a')\n\n    You can use the `:let` command to assign the value returned by a\n    function to a variable:\n\n     :let a = getline('.')\n\n    To store the return value from a function into a Vim register, you can\n    use the following command:\n\n     :let @a = system('ls')\n\n    The above command will store the output of the \"ls\" command into the\n    register \"a\".\n\n    For more information, read:\n\n    \u001b[1m:help :call\u001b[0m\n\n    \u001b[1m:help :echo\u001b[0m\n\n    \u001b[1m:help :let\u001b[0m\n\n    \u001b[1m:help :let-register\u001b[0m\n\n    \u001b[1m:help user-functions\u001b[0m\n\n    \u001b[1m:help usr_41.txt\u001b[0m\n\n  \u001b[1m25.11. I am using some normal mode commands in my Vim script. How do I\n    avoid using the user-defined mappings for these normal mode commands\n    and use the standard Vim functionality for these normal mode\n    commands?\u001b[0m\n    You can use the `:normal!` command in your script to invoke a\n    normal-mode command. This will use the standard functionality of the\n    normal mode command and will not use the user-defined mapping.\n\n    For more information, read:\n\n    \u001b[1m:help :normal\u001b[0m\n\n  \u001b[1m25.12. How do I get the current visually selected text into a Vim variable\n    or register?\u001b[0m\n    You can get the current visually selected text into a Vim variable by\n    yanking the text into Vim register and then assigning the contents of\n    the register into the variable:\n\n     :normal! gvy\n     :let myvar = @\"\n\n    The above command copies the visually selected text into the variable\n    \"myvar\".\n\n    You can also use the command:\n\n     :normal! gv\"*y\n\n    In the above command, gv reselects the last visually selected text and\n    the rest of the command copies the selected text into the * (clipboard)\n    register. Alternatively, you can set the \"a\" flag in the 'guioptions'\n    option to automatically copy a visually selected text into the *\n    register. To do this as part of a visual map, you can use a command\n    similar to the one shown below:\n\n     :vmap <F3> \"*y:call ...\n\n    For more information, read:\n\n    \u001b[1m:help gv\u001b[0m\n\n    \u001b[1m:help :normal\u001b[0m\n\n    \u001b[1m:help :let-@\u001b[0m\n\n    \u001b[1m:help quotestar\u001b[0m\n\n    \u001b[1m:help clipboard\u001b[0m\n\n    \u001b[1m:help registers\u001b[0m\n\n  \u001b[1m25.13. I have some text in a Vim variable \"myvar\". I would like to use this\n    variable in a `:s` substitute command to replace a text \"mytext\".\n    How do I do this?\u001b[0m\n    You can use the `:execute` command to evaluate the variable:\n\n     :execute '%s/mytext/' . myvar . '/'\n\n    For more information, read:\n\n    \u001b[1m:help :execute\u001b[0m\n\n    You can also use \"\\=\" in the substitute command to evaluate the\n    variable:\n\n     :%s/mytext/\\=myvar/\n\n    For more information, read:\n\n    \u001b[1m:help sub-replace-special\u001b[0m\n\n  \u001b[1m25.14. A Vim variable (bno) contains a buffer number. How do I use this\n    variable to open the corresponding buffer?\u001b[0m\n    The `:buffer` command will not accept a variable name. It accepts only a\n    buffer number or buffer name. You have to use the `:execute` command to\n    evaluate the variable into the corresponding value. For example:\n\n     :execute \"buffer \" . bno\n\n    For more information, read:\n\n    \u001b[1m:help :execute\u001b[0m\n\n  \u001b[1m25.15. How do I store the value of a Vim option into a Vim variable?\u001b[0m\n    You can prefix the option name with the \"&\" character and assign the\n    option value to a Vim variable using the `:let` command. For example, to\n    store the value of the 'textwidth' option into the Vim variable\n    \"old_tw\", you can use the following command:\n\n     :let old_tw = &tw\n\n    To explicitly save buffer local options, use the prefix \"l:\"\n\n     :let old_tw = &l:tw\n\n    If you want to explicitly select the global option, use the \"g:\" prefix\n    to the option name.\n\n    To do the opposite, to set the 'textwidth' option with the value stored\n    in the \"old_tw\" variable, you can use the following command:\n\n     :let &tw = old_tw\n\n    For more information, read:\n\n    \u001b[1m:help expr-option\u001b[0m\n\n    \u001b[1m:help :let-option\u001b[0m\n\n  \u001b[1m25.16. I have copied and inserted some text into a buffer from a Vim\n    function. How do I indent the inserted text from the Vim function?\u001b[0m\n    You can use the following command to format the just inserted text:\n\n     :normal '[=']\n\n    For more information, read:\n\n    \u001b[1m:help '[\u001b[0m\n\n    \u001b[1m:help ']\u001b[0m\n\n    \u001b[1m:help =\u001b[0m\n\n    \u001b[1m:help :normal\u001b[0m\n\n  \u001b[1m25.17. How do I get the character under the cursor from a Vim script?\u001b[0m\n    You can use the getline() function and use string index [] to get the\n    character:\n\n     :echo getline(\".\")[col(\".\") - 1]\n\n    In the above command, getline(\".\") returns the text in the current line.\n    The indexing of the string starts at zero, and you can get a single\n    character in a string by its index with the \"string[index]\" notation.\n    The col(\".\") returns the column of the cursor position; the adjustment\n    is to get the right character of the string. However, this does NOT work\n    with multibyte characters as this command only returns the byte index.\n\n    Alternatively, you can use the following sequence of commands to get the\n    character under the cursor:\n\n     normal! vy\n     let ch=@\"\n\n    Note, that the above commands will change the '< and '> marks.\n\n    For more information, read:\n\n    \u001b[1m:help getline()\u001b[0m\n\n    \u001b[1m:help col()\u001b[0m\n\n    \u001b[1m:help expr-[]\u001b[0m\n\n  \u001b[1m25.18. How do I get the name of the current file without the extension?\u001b[0m\n    You can get the name of the current file without the extension using:\n\n     :echo expand(\"%:r\")\n\n    With some commands, you can use the file name modifiers directly:\n\n     :cd %:p:h\n     :!gcc -o %:r.o %\n     :!xpdf %<.pdf\n\n    For more information, read:\n\n    \u001b[1m:help filename-modifiers\u001b[0m\n\n    \u001b[1m:help expand()\u001b[0m\n\n    \u001b[1m:help cmdline-special\u001b[0m\n\n    \u001b[1m:help fnamemodify()\u001b[0m\n\n  \u001b[1m25.19. How do I get the basename of the current file?\u001b[0m\n    You can use the \":t\" filename modifier to get the basename of the\n    current file:\n\n     :echo expand(\"%:t\")\n\n    For more information, read:\n\n    \u001b[1m:help filename-modifiers\u001b[0m\n\n  \u001b[1m25.20. How do I get the output from a Vim function into the current buffer?\u001b[0m\n    You can insert the return value from a function using the following\n    command in insert mode:\n\n     <C-R>=MyFunc()\n\n    Note, that this will only insert the return value of the function.\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-R\u001b[0m\n\n    \u001b[1m:help i_CTRL-R_CTRL-R\u001b[0m\n\n    \u001b[1m:help i_CTRL-R_CTRL-O\u001b[0m\n\n    \u001b[1m:help expression\u001b[0m\n\n  \u001b[1m25.21. How do I call external programs from a Vim function?\u001b[0m\n    There are several ways to call external programs from a Vim function.\n    You can use the builtin system() function to invoke external programs\n    and get the result:\n\n     :let output = system(\"ls\")\n\n    You can also use \"!\" ex-command to run an external command.\n\n    For more information, read:\n\n    \u001b[1m:help system()\u001b[0m\n\n    \u001b[1m:help :!\u001b[0m\n\n    \u001b[1m:help 10.9\u001b[0m\n\n  \u001b[1m25.22. How do I get the return status of a program executed using the `:!`\n    command?\u001b[0m\n    You can use the predefined Vim v:shell_error variable to get the return\n    status of the last run shell command.\n\n    For more information, read:\n\n    \u001b[1m:help v:shell_error\u001b[0m\n\n  \u001b[1m25.23. How do I determine whether the current buffer is modified or not?\u001b[0m\n    You can check the value of the 'modified' option to determine whether\n    the current buffer is modified:\n\n     :set modified?\n\n    From a Vim script, you can check the value of the 'modified' option:\n\n     if &modified\n         echo \"File is modified\"\n     endif\n\n    For more information, read:\n\n    \u001b[1m:help 'modified'\u001b[0m\n\n  \u001b[1m25.24. I would like to use the carriage return character in a normal\n    command from a Vim script. How do I specify the carriage return\n    character?\u001b[0m\n    You can use the `:execute` command to specify the special (control)\n    character in a normal mode command:\n\n     :execute \"normal \\<CR>\"\n     :execute \"normal ixxx\\<Esc>\"\n\n    For more information, read:\n\n    \u001b[1m:help :execute\u001b[0m\n\n    \u001b[1m:help expr-quote\u001b[0m\n\n  \u001b[1m25.25. How do I split long lines in a Vim script?\u001b[0m\n    You can split long lines in a Vim script by inserting the backslash\n    character (\"\\\") at the start of the next line. For example,\n\n     set comments=sr:/*,mb:*,el:*/,\n                 \\://,\n                 \\b:#,\n                 \\:%,\n                 \\n:>,\n                 \\fb:-\n\n    For more information, read:\n\n    \u001b[1m:help line-continuation\u001b[0m\n\n  \u001b[1m25.26. When I try to \"execute\" my function using the `:execute Myfunc()`\n    command, the cursor is moved to the top of the current buffer.\n    Why?\u001b[0m\n    The `:execute` command runs the ex command specified by the argument. In\n    the case of the following command:\n\n     :execute Myfunc()\n\n    The call to Myfunc() will return 0. The `:execute` command will run the\n    ex command `:0`, which moves the cursor to the top of the file. To call\n    a Vim function, you should use the `:call` command instead of the\n    `:execute` command:\n\n     :call Myfunc()\n\n    For more information, read:\n\n    \u001b[1m:help :call\u001b[0m\n\n    \u001b[1m:help :execute\u001b[0m\n\n    \u001b[1m:help :echo\u001b[0m\n\n    \u001b[1m:help user-functions\u001b[0m\n\n    \u001b[1m:help 41.5\u001b[0m\n\n    \u001b[1m:help 41.6\u001b[0m\n\n    \u001b[1m:help cmdline-lines\u001b[0m\n\n  \u001b[1m25.27. How do I source/execute the contents of a register?\u001b[0m\n    If you have yanked a set of Vim commands into a Vim register (for\n    example register \"a\"), then you can source the contents of the register\n    using one of the following commands:\n\n     :@a\n    or\n     :exe @a\n\n    For more information, read:\n\n    \u001b[1m:help :@\u001b[0m\n\n  \u001b[1m25.28. After calling a Vim function or a mapping, when I press the \"u\"\n    key to undo the last change, Vim undoes all the changes made by\n    the mapping/function. Why?\u001b[0m\n    When you call a function or a mapping, all the operations performed by\n    the function/mapping are treated as one single operation. When you undo\n    the last operation by pressing \"u\", all the changes made by the\n    function/mapping are reversed.\n\n    For more information, read:\n\n    \u001b[1m:help undo-redo\u001b[0m\n\n    \u001b[1m:help :map-undo\u001b[0m\n\n  \u001b[1m25.29. How can I call a function defined with s: (script local function)\n    from another script/plugin?\u001b[0m\n    The s: prefix for a Vim function name is used to create a script local\n    function. A script local function can be called only from within that\n    script and cannot be called from other scripts. To define a function in\n    a script/plugin, so that it can be called from other plugins/scripts,\n    define the function without the s: prefix.\n\n    For more information, read:\n\n    \u001b[1m:help script-variable\u001b[0m\n\n    \u001b[1m:help script-local\u001b[0m\n\n    \u001b[1m:help :scriptnames\u001b[0m\n\n  \u001b[1m25.30. Is it possible to un-source a sourced script? In other words, reverse\n    all the commands executed by sourcing a script.\u001b[0m\n    No. It is not possible to reverse or undo all the commands executed by\n    sourcing a script.\n\n    For more information, read:\n\n    \u001b[1m:help :source\u001b[0m\n\n\u001b[1mPLUGINS\u001b[0m\n  \u001b[1m26.1. How do I set different options for different types of files?\u001b[0m\n    You can create filetype plugins to set different options for different\n    types of files. You should first enable filetype plugins using the\n    command:\n\n     :filetype plugin on\n\n    A filetype plugin is a vim script that is loaded whenever Vim opens or\n    creates a file of that type. For example, to ensure that the 'textwidth'\n    option is set to 80 when editing a C program (filetype \"c\"), create one\n    of the following files:\n\n         ~/.vim/ftplugin/c.vim (Unix)\n         %HOME%\\vimfiles\\ftplugin\\c.vim (Windows)\n\n    with the following text in it:\n\n         setlocal textwidth=80\n\n    You can also use autocommands to set specific options when editing\n    specific type of files. For example, to set the 'textwidth' option to 75\n    for only *.txt files, you can use the following autocmd:\n\n     autocmd BufRead *.txt setlocal textwidth=80\n\n    For more information, read:\n\n    \u001b[1m:help filetype-plugin\u001b[0m\n\n    \u001b[1m:help add-filetype-plugin\u001b[0m\n\n    \u001b[1m:help :autocmd\u001b[0m\n\n    \u001b[1m:help 40.3\u001b[0m\n\n  \u001b[1m26.2. I have downloaded a Vim plugin or a syntax file or a indent file, or\n   a color scheme or a filetype plugin from the web. Where should I copy\n   these files so that Vim will find them?\u001b[0m\n    You can place the Vim runtime files (plugins, syntax files, indent\n    files, color schemes, filetype plugins, etc) under one of the\n    directories specified in the 'runtimepath' option. To determine the\n    current value of the 'runtimepath' option, use the following command:\n\n     :set runtimepath\n\n    For Unix systems, this is usually the \"$HOME/.vim\" directory. For\n    MS-Windows systems, this is usually the $VIM\\vimfiles or $HOME\\vimfiles\n    directory. Depending on the type of the runtime file, you have to place\n    it under a specific directory under the above runtime directory. The\n    names of the directories are listed below:\n\n     name        description\n     ----------  ------------------\n     colors/     color scheme files\n     compiler/   compiler files\n     doc/        documentation\n     ftplugin/   filetype plugins\n     indent/     indent scripts\n     keymap/     key mapping files\n     lang/       menu translations\n     plugin/     plugin scripts\n     syntax/     syntax files\n     tutor/      files for vimtutor\n\n    For more information, read:\n\n    \u001b[1m:help your-runtime-dir\u001b[0m\n\n    \u001b[1m:help 'runtimepath'\u001b[0m\n\n    \u001b[1m:help :runtime\u001b[0m\n\n  \u001b[1m26.3. How do I extend an existing filetype plugin?\u001b[0m\n    You can extend an existing filetype plugin by creating a file in the\n    after/ directory in any of the 'runtimepath' directories.\n\n    - for small changes to be done after (and in addition to) what is\n    already done by the ftplugin installed with Vim, use an after-directory,\n    as follows (replacing foobar by the 'filetype' of the concerned files):\n    - For changes private to one user: - on Windows:\n    $HOME/vimfiles/after/ftplugin/foobar.vim - on Unix-like OSes:\n    $HOME/.vim/after/ftplugin/foobar.vim - For changes affecting all users\n    on the system: $VIM/vimfiles/after/ftplugin/foobar.vim\n\n    - when replacing the whole filetype-plugin by a different version, or\n    when installing a new ftplugin for some filetype not yet supported by\n    Vim out of the box: use the same paths without the after/ in them. In\n    that case you should place near the start of your plugin an \"if...\n    finish... endif... let\" block like the one in the plugins distributed\n    with Vim.\n\n    All the above paths are given in Vim terminology (which is similar to\n    Unix terminology, but is understood even by Vim for Windows); they don't\n    exist by default, so the first time you need them you will have to\n    create them using mkdir (on any OS including DOS/Windows) or md (on\n    DOS/Windows only). $VIM and, on DOS/Windows, $HOME, do not necessarily\n    exist outside Vim. If $HOME has no value (or no valid value) inside Vim,\n    you can use $VIM instead; but on any but possibly very old versions of\n    Windows, $HOMEDRIVE and $HOMEPATH are defined by the system, and if\n    $HOME is undefined at Vim startup, Vim will set it by expanding\n    $HOMEDRIVE$HOMEPATH before sourcing your vimrc. To know which values Vim\n    uses, you can type (in a running Vim):\n\n     :echo $VIM\n     :echo $HOME\n\n    If you placed the file in the after/ftplugin runtime directory, then Vim\n    will first source the existing filetype plugin file and then will source\n    the new file. If you placed the file in the $VIMRTUNTIME/ftplugin\n    runtime directory, then Vim will first source the new file and then will\n    source the existing filetype plugin file.\n\n    For more information, read:\n\n    \u001b[1m:help ftplugin-overrule\u001b[0m\n\n    \u001b[1m:help filetype-plugin\u001b[0m\n\n    \u001b[1m:help add-filetype-plugin\u001b[0m\n\n    \u001b[1m:help 'runtimepath'\u001b[0m\n\n  \u001b[1m26.4. How do I turn off loading the Vim plugins?\u001b[0m\n    You can reset the 'loadplugins' option to turn off loading the plugins:\n\n     :set noloadplugins\n\n    You can also specify the \"--noplugin\" command line argument to stop\n    loading the plugins:\n\n     $ vim --noplugin\n\n    For more information, read:\n\n    \u001b[1m:help 'loadplugins'\u001b[0m\n\n    \u001b[1m:help --noplugin\u001b[0m\n\n    \u001b[1m:help load-plugins\u001b[0m\n\n  \u001b[1m26.5. How do I turn on/off loading the filetype plugins?\u001b[0m\n    By default, Vim will not load the filetype plugins. You can configure\n    Vim to load filetype plugins using the command:\n\n     filetype plugin on\n\n    You can turn off loading the filetype plugins using:\n\n     filetype plugin off\n\n    For more information, read:\n\n    \u001b[1m:help :filetype-plugin-on\u001b[0m\n\n    \u001b[1m:help :filetype-plugin-off\u001b[0m\n\n    \u001b[1m:help :filetype\u001b[0m\n\n  \u001b[1m26.6. How do I override settings made in a file type plugin in the global\n   ftplugin directory for all the file types?\u001b[0m\n    You can use an autocommand triggered on the FileType event:\n\n     au Filetype * set formatoptions=xyz\n\n    This should at least be after \"filetype on\" in your vimrc. Best is to\n    put it in your \"myfiletypefile\" file, so that it's always last.\n\n    If you want to override a setting for a particular filetype, then create\n    a file with the same name as the original filetype plugin in the\n    ~/.vim/after/ftplugin directory For example, to override a setting in\n    the c.vim filetype plugin, create a c.vim file in the\n    ~/.vim/after/ftplugin directory and add your preferences in this file.\n\n    For more information, read:\n\n    \u001b[1m:help ftplugin-overrule\u001b[0m\n\n    \u001b[1m:help ftplugins\u001b[0m\n\n    \u001b[1m:help myfiletypefile\u001b[0m\n\n  \u001b[1m26.7. How do I disable the Vim directory browser plugin?\u001b[0m\n    To disable the directory browsing Vim plugin, add the following line to\n    your .vimrc file:\n\n     let g:loaded_netrw = 1\n\n    For more information, read:\n\n    \u001b[1m:help netrw\u001b[0m\n\n  \u001b[1m26.8. How do I set the filetype option for files with names matching a\n   particular pattern or depending on the file extension?\u001b[0m\n    You can set the 'filetype' option for files with names matching a\n    particular pattern using an autocmd. For example, to set the 'filetype'\n    option to \"c\" for all files with extension \".x\", you can use the\n    following autocmd:\n\n     autocmd! BufRead,BufNewFile *.x     setfiletype c\n\n    A better alternative to the above approach is to create a filetype.vim\n    file in the ~/.vim directory (or in one of the directories specified in\n    the 'runtimepath' option) and add the following lines:\n\n     \" my filetype file\n     if exists(\"did_load_filetypes\")\n         finish\n     endif\n     augroup filetypedetect\n         au! BufRead,BufNewFile *.x       setfiletype c\n     augroup END\n\n    For more information, read:\n\n    \u001b[1m:help new-filetype\u001b[0m\n\n    \u001b[1m:help 43.2\u001b[0m\n\n    \u001b[1m:help :setfiletype\u001b[0m\n\n\u001b[1mEDITING PROGRAM FILES\u001b[0m\n  \u001b[1m27.1. How do I enable automatic indentation for C/C++ files?\u001b[0m\n    You can enable file-type based indentation using:\n\n     :filetype indent on\n\n    If you want to only enable automatic C indentation, then use:\n\n     :set cindent\n\n    For more information, read:\n\n    \u001b[1m:help 'cindent'\u001b[0m\n\n    \u001b[1m:help C-indenting\u001b[0m\n\n    \u001b[1m:help filetype\u001b[0m\n\n  \u001b[1m27.2. How do I configure the indentation used for C/C++ files?\u001b[0m\n    You can configure the Vim C indentation by modifying the value of the\n    'cinoptions', 'cinkeys' and 'cinwords' options.\n\n    For more information, read:\n\n    \u001b[1m:help 'cindent'\u001b[0m\n\n    \u001b[1m:help 'cinoptions'\u001b[0m\n\n    \u001b[1m:help 'cinkeys'\u001b[0m\n\n    \u001b[1m:help 'cinwords'\u001b[0m\n\n    \u001b[1m:help C-indenting\u001b[0m\n\n    \u001b[1m:help cinoptions-values\u001b[0m\n\n    \u001b[1m:help 'smartindent'\u001b[0m\n\n  \u001b[1m27.3. How do I turn off the automatic indentation feature?\u001b[0m\n    By default, the automatic indentation is not turned on. You must have\n    configured Vim to do automatic indentation in either .vimrc or .gvimrc\n    files. You can disable automatic indentation using either,\n\n     :filetype indent off\n\n    or\n\n     :set nocindent\n\n    Also, check the setting for the following options:\n\n     :set autoindent?\n     :set smartindent?\n     :set indentexpr?\n\n    For more information, read:\n\n    \u001b[1m:help 'cindent'\u001b[0m\n\n    \u001b[1m:help :filetype-indent-off\u001b[0m\n\n    \u001b[1m:help 'autoindent'\u001b[0m\n\n    \u001b[1m:help 'smartindent'\u001b[0m\n\n    \u001b[1m:help 'indentexpr'\u001b[0m\n\n  \u001b[1m27.4. How do I change the number of space characters used for the automatic\n   indentation?\u001b[0m\n    You can modify the 'shiftwidth' option to change the number of space\n    characters used for the automatic indentation:\n\n     :set shiftwidth=4\n\n    For more information, read:\n\n    \u001b[1m:help 'shiftwidth'\u001b[0m\n\n  \u001b[1m27.5. I am editing a C program using Vim. How do I display the definition\n   of a macro or a variable?\u001b[0m\n    You can use the \"[d\" command to display the definition of a macro, \"[i\"\n    command to display the definition of a variable, \"gd\" to goto the local\n    declaration of a variable and \"gD\" to go to the global Declaration.\n\n    For more information, read:\n\n    \u001b[1m:help [d\u001b[0m\n\n    \u001b[1m:help [i\u001b[0m\n\n    \u001b[1m:help gd\u001b[0m\n\n    \u001b[1m:help gD\u001b[0m\n\n    \u001b[1m:help include-search\u001b[0m\n\n    \u001b[1m:help 29.4\u001b[0m\n\n    \u001b[1m:help 29.5\u001b[0m\n\n  \u001b[1m27.6. I am editing a C program using Vim. How do I jump to the beginning or\n   end of a code block from within the block?\u001b[0m\n    You can use \"[{\" command to jump to the beginning of the code block and\n    \"]}\" to jump to the end of the code block from inside the block.\n\n    For more information, read:\n\n    \u001b[1m:help [{\u001b[0m\n\n    \u001b[1m:help ]}\u001b[0m\n\n    \u001b[1m:help various-motions\u001b[0m\n\n  \u001b[1m27.7. When editing C++ files and when inserting new lines above or below a\n   comment (//) line, Vim automatically inserts the C++ comment\n   character (//) at the beginning of the line. How do I disable this?\u001b[0m\n    This automatic insertion of the comment leader (//) when new lines are\n    added is controlled by three flags in the 'formatoptions' option: \"c\",\n    \"r\" and \"o\". \"c\" enables auto-wrapping of comment lines when typing\n    extends beyond the right margin. \"r\" enables the automatic insertion of\n    the comment leader when <Enter> is pressed while editing a comment line.\n    \"o\" enables the automatic insertion of the comment leader when a new\n    line is opened above or below an existing comment line by typing O or o\n    in Normal mode.\n\n    You can stop Vim from automatically inserting the comment leader when\n    typing <Enter> within a comment or when opening a new line by removing\n    the \"r\" and \"o\" flags from 'formatoptions'.\n\n       :set formatoptions-=r\n       :set formatoptions-=o\n\n    The default filetype plugin for C and C++ files\n    ($VIMRUNTIME/ftplugin/c.vim) adds the \"r\" and \"o\" flags to the\n    'formatoptions' option. If you want to override this for C++ files, then\n    you can add the above lines to the ~/.vim/after/ftplugin/cpp.vim file.\n\n    For more information, read:\n\n    \u001b[1m:help 'formatoptions'\u001b[0m\n\n    \u001b[1m:help 30.6\u001b[0m\n\n    \u001b[1m:help format-comments\u001b[0m\n\n    \u001b[1m:help filetype-plugins\u001b[0m\n\n    \u001b[1m:help ftplugin-overrule\u001b[0m\n\n  \u001b[1m27.8. How do I add the comment character \"#\" to a set of lines at the\n   beginning of each line?\u001b[0m\n    First, select the first character in all the lines using visual block\n    mode (CTRL-V). Press \"I\" to start inserting characters at the beginning\n    of the line. Enter the comment character and then stop the insert mode\n    by pressing <Esc>. Vim will automatically insert the entered characters\n    at the beginning of all the selected lines.\n\n    For more information, read:\n\n    \u001b[1m:help visual-block\u001b[0m\n\n    \u001b[1m:help blockwise-operators\u001b[0m\n\n    \u001b[1m:help v_b_I\u001b[0m\n\n  \u001b[1m27.9. How do I edit a header file with the same name as the corresponding C\n   source file?\u001b[0m\n    You can use the following command to edit a header file with the same\n    name as the corresponding C source file:\n\n     :e %:t:r.h\n\n    You can use the following command to edit the file in a new split\n    window:\n\n     :sp %:t:r.h\n\n    In the above commands, the percent sign expands to the name of the\n    current file. The `:t` modifier extracts the tail (last component) of\n    the filename. The `:r` modifier extracts the root of the filename. The\n    .h is appended to the resulting name to get the header filename.\n\n    Another approach is to use the following command:\n\n     :sfind %:t:r.h\n\n    This command will search for the header file in the directories\n    specified in the 'path' option.\n\n    For more information, read:\n\n    \u001b[1m:help cmdline-special\u001b[0m\n\n    \u001b[1m:help filename-modifiers\u001b[0m\n\n    \u001b[1m:help :sfind\u001b[0m\n\n    \u001b[1m:help 'path'\u001b[0m\n\n  \u001b[1m27.10. How do I automatically insert comment leaders while typing comments?\u001b[0m\n    To automatically insert comment leaders while typing comments, add the\n    \"r\" and \"o\" flags to the 'formatoptions' option.\n\n     :set formatoptions+=ro\n\n    You may also want to add the \"c\" flag to auto-wrap comments using the\n    'textwidth' option setting and the \"q\" flag to format comments with the\n    \"gq\" command:\n\n     :set formatoptions=croq\n\n    For more information, read:\n\n    \u001b[1m:help 30.6\u001b[0m\n\n    \u001b[1m:help format-comments\u001b[0m\n\n    \u001b[1m:help 'comments'\u001b[0m\n\n    \u001b[1m:help fo-table\u001b[0m\n\n\u001b[1mQUICKFIX\u001b[0m\n  \u001b[1m28.1. How do I build programs from Vim?\u001b[0m\n    You can use the `:make` command to build programs from Vim. The `:make`\n    command runs the program specified by the 'makeprg' option.\n\n    For more information, read:\n\n    \u001b[1m:help 30.1\u001b[0m\n\n    \u001b[1m:help :make_makeprg\u001b[0m\n\n    \u001b[1m:help 'makeprg'\u001b[0m\n\n    \u001b[1m:help 'makeef'\u001b[0m\n\n    \u001b[1m:help :make\u001b[0m\n\n    \u001b[1m:help quickfix\u001b[0m\n\n  \u001b[1m28.2. When I run the make command in Vim I get the errors listed as the\n   compiler compiles the program. When it finishes this list disappears\n   and I have to use the `:clist` command to see the error message again.\n   Is there any other way to see these error messages?\u001b[0m\n    You can use the `:copen` or `:cwindow` command to open the quickfix\n    window that contains the compiler output. You can select different error\n    lines from this window and jump to the corresponding line in the source\n    code.\n\n    For more information, read:\n\n    \u001b[1m:help :copen\u001b[0m\n\n    \u001b[1m:help :cwindow\u001b[0m\n\n    \u001b[1m:help quickfix\u001b[0m\n\n  \u001b[1m28.3. How can I perform a command for each item in the quickfix/location\n   list?\u001b[0m\n    Starting from Vim 7.4.858 Vim provides the new commands `:cfdo`, `:cdo`,\n    `:lfdo` and `:ldo.` They work by iterating over all items in the\n    quickfix list and performing a command on each. The difference is, that\n    the `:lfdo` and `:ldo` commands iterate over the location list entries,\n    while the `:cfdo` and `:cdo` commands operate on the items in the\n    quickfix list. Also, the `:cfdo` and `:lfdo` operate on all different\n    files, while the `:cdo` and `:ldo` commands operate on each item in the\n    quickfix/location list.\n\n    For example you could vimgrep all C files in the current directory for a\n    search string \"Foobar\":\n\n     :vimgrep /Foobar/ *.c\n\n    and as this populates your quickfix list, you could simply replace all\n    occurences by using:\n\n     :cdo :%s/Foobar/Foobaz | upd\n\n    For more information, read:\n\n    \u001b[1m:help :cfdo\u001b[0m\n\n    \u001b[1m:help :cdo\u001b[0m\n\n\u001b[1mFOLDING\u001b[0m\n  \u001b[1m29.1. How do I extend the Vim folding support?\u001b[0m\n    You can use the 'foldexpr' option to fold using a user specified\n    function. For example, to fold subroutines of the following form into a\n    single line:\n\n     sub foo {\n       my $barf;\n       $barf = 3;\n       return $barf;\n     }\n\n    You can use the following commands:\n\n     set foldmethod=expr\n     set foldexpr=MyFoldExpr(v:lnum)\n     fun! MyFoldExpr(line)\n         let str = getline(a:line)\n         if str =~ '^sub\\>'\n             return '1'\n         elseif str =~ '^}'\n             return '<1'\n         else\n             return foldlevel(a:line - 1)\n         endif\n     endfun\n\n    For more information, read:\n\n    \u001b[1m:help 'foldexpr'\u001b[0m\n\n    \u001b[1m:help fold-expr\u001b[0m\n\n  \u001b[1m29.2. When I enable folding by setting the 'foldmethod' option, all the\n   folds are closed. How do I prevent this?\u001b[0m\n    You can set the 'foldlevelstart' option to a particular value to close\n    only folds above the specified value.\n\n     :set foldlevelstart=99\n\n    For more information, read:\n\n    \u001b[1m:help 'foldlevelstart'\u001b[0m\n\n    \u001b[1m:help 'foldlevel'\u001b[0m\n\n    \u001b[1m:help fold-foldlevel\u001b[0m\n\n  \u001b[1m29.3. How do I control how many folds will be opened when I start editing a\n   file?\u001b[0m\n    You can modify the 'foldlevelstart' option to control the number of\n    folds that will be opened when you start editing a file. To start\n    editing with all the folds closed:\n\n     :set foldlevelstart=0\n\n    To start editing with all the folds opened, you can use\n\n     :set foldlevelstart=999\n\n    For more information, read:\n\n    \u001b[1m:help 'foldlevelstart'\u001b[0m\n\n  \u001b[1m29.4. How do I open and close folds using the mouse?\u001b[0m\n    You can click on the + and - characters displayed at the leftmost column\n    to open and close fold. For this to work, you have to set the\n    'foldcolumn' to a value greater than zero:\n\n     :set foldcolumn=2\n\n    For more information, read:\n\n    \u001b[1m:help 'foldcolumn'\u001b[0m\n\n  \u001b[1m29.5. How do I change the text displayed for a closed fold?\u001b[0m\n    You can use the 'foldtext' option to change the text displayed for a\n    closed fold.\n\n    For more information, read:\n\n    \u001b[1m:help 'foldtext'\u001b[0m\n\n    \u001b[1m:help fold-foldtext\u001b[0m\n\n    \u001b[1m:help 'fillchars'\u001b[0m\n\n  \u001b[1m29.6. How do I store and restore manually created folds across different\n   Vim invocations?\u001b[0m\n    You can use the `:mkview` command to store manually created folds.\n    Later, you can use the `:loadview` command to restore the folds. For\n    this to work, the 'viewoptions' must contain \"folds\".\n\n    For more information, read:\n\n    \u001b[1m:help 28.4\u001b[0m\n\n    \u001b[1m:help :mkview\u001b[0m\n\n    \u001b[1m:help :loadview\u001b[0m\n\n    \u001b[1m:help 'viewoptions'\u001b[0m\n\n    \u001b[1m:help 'viewdir'\u001b[0m\n\n    \u001b[1m:help :mksession\u001b[0m\n\n    \u001b[1m:help 'sessionoptions'\u001b[0m\n\n  \u001b[1m29.7. I have enabled syntax based folding. Why is Vim so slow?\u001b[0m\n    Syntax based folding is currently rather slow in Vim and will possibly\n    slow down Vim considerably. There is an issue in the todo list to fix\n    this, but the todo list is rather long and it may take a while until\n    this will be fixed.\n\n    You can find the issue in the todo list, if you read\n\n    \u001b[1m:help todo.txt\u001b[0m\n\n    followed by a search for \"folding with 'foldmethod'\"\n\n    A workaround is to temporarily set the foldmethod to manual while in\n    insert mode. This is described in the wiki at:\n\n     http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text\n\n\u001b[1mVIM WITH EXTERNAL APPLICATIONS\u001b[0m\n  \u001b[1m30.1. Can I run a shell inside a Vim window?\u001b[0m\n    Since Version 8.1 Vim comes with a terminal window included. It allows\n    to run a shell inside an ordinary Vim window (e.g. split) asynchronously\n    and interact with the shell using the normal Vim commands.\n\n    When the focus is in the terminal window, typed keys will be sent to the\n    job and is called terminal mode. You can click outside of the terminal\n    window to move keyboard focus elsewhere, alternatively one can use\n    CTRL-W to novigate between different Vim windows. To feed CTRL-W into\n    the terminal, one needs to use CTRL-W .\n\n    To map keys specifically for terminal mode, use the new `:tmap` command.\n    After typing CTRL-W the terminal window will switch to Terminal-Normal\n    mode (this can be used to move the cursor around, scroll the window,\n    etc. Just like normal mode).\n\n    To interact between the terminal and Vim, Vim implements several\n    interfaces using term_sendkeys(), terminal-api and the client-server\n    mechanism.\n\n    For more information, read:\n\n    \u001b[1m:help terminal\u001b[0m\n\n    \u001b[1m:help mapmode-t\u001b[0m\n\n    \u001b[1m:help Terminal-Normal\u001b[0m\n\n    \u001b[1m:help terminal-communication\u001b[0m\n\n  \u001b[1m30.2. How do I pass the word under the cursor to an external command?\u001b[0m\n    You can use the special keyword <cword> to pass the word under the\n    cursor to an external command. For example:\n\n     :!dict <cword>\n\n    For more information, read:\n\n    \u001b[1m:help :<cword\u001b[0m>\n\n  \u001b[1m30.3. How do I get the output of a shell command into a Vim buffer?\u001b[0m\n    You can use the `:r !` command to get the output of a shell command into\n    a Vim buffer. For example, to insert the output of the \"ls\" shell\n    command, you can use the following command:\n\n     :r !ls\n\n    To insert the output of the shell command above the first line use the\n    following command:\n\n     :0r !ls\n\n    For more information, read:\n\n    \u001b[1m:help :r!\u001b[0m\n\n  \u001b[1m30.4. How do I pipe the contents of the current buffer to an external\n   command and replace the contents of the buffer with the output from\n   the command?\u001b[0m\n    You can use the :! command to pipe the contents of the current buffer to\n    an external command and replace the contents of the buffer with the\n    output from the command. For example, to sort the contents of the\n    current buffer, using the Unix sort command, you can use the following\n    command:\n\n     :%!sort\n\n    To sort only lines 10-20, you can use the following command\n\n     :10,20!sort\n\n    Also, if you want to pipe a buffer to an external command but not put\n    the results back in the buffer, you can use\n\n     :w !sort\n\n    The above command will pipe the entire buffer to the sort command. Note,\n    that the space between the \"w\" and the \"!\" is critical. To pipe only a\n    range of lines, you can use\n\n     :10,20w !sort\n\n    The above command will pipe the lines 10-20 to the sort command.\n\n    For more information, read:\n\n    \u001b[1m:help :range!\u001b[0m\n\n    \u001b[1m:help 10.9\u001b[0m\n\n    \u001b[1m:help :w_c\u001b[0m\n\n  \u001b[1m30.5. How do I sort a section of my file?\u001b[0m\n    You use the `:sort` command like this:\n\n       :5,100sort\n\n    Using the `:sort` command provides many options, you can sort numerical\n    on the first found decimal number using:\n\n       :%sort n\n\n    Or you can specify to sort on the text, starting at virtual column 8:\n\n       :%sort /.*\\%8v/\n\n    Alternatively can pipe a section of the file to the Unix \"sort\" utility\n    to sort the file. For example:\n\n     :5,100!sort\n\n    You can also use a visual block, and use the \"!sort\" command on the\n    selected block.\n\n    See also: \u001b[1m:help :sort\u001b[0m\n\n    \u001b[1m:help filter\u001b[0m\n\n  \u001b[1m30.6. How do I use Vim as a pager?\u001b[0m\n    You can use Vim as a pager using the $VIMRUNTIME/macros/less.sh shell\n    script, supplied as part of the standard Vim distribution. This shell\n    script uses the $VIMRUNTIME/macros/less.vim Vim script to provide less\n    like key bindings.\n\n    For more information, read:\n\n    \u001b[1m:help less\u001b[0m\n\n  \u001b[1m30.7. How do I view Unix man pages from inside Vim?\u001b[0m\n    You can view Unix man pages, inside Vim, using the man.vim plugin\n    supplied as part of the standard Vim distribution. To use this plugin,\n    add the following line to your startup vimrc file:\n\n     runtime ftplugin/man.vim\n\n    You can also press the K key to run the program specified by the\n    'keywordprg' option with the keyword under the cursor. By default,\n    'keywordprg' is set to run man on the keyword under the cursor.\n\n    For more information, read:\n\n    \u001b[1m:help ft-man-plugin\u001b[0m\n\n    \u001b[1m:help K\u001b[0m\n\n    \u001b[1m:help 'keywordprg'\u001b[0m\n\n  \u001b[1m30.8. How do I change the diff command used by the Vim diff support?\u001b[0m\n    By default, the Vim diff support uses the 'diff' command. You can change\n    this by changing the 'diffexpr' option.\n\n    For more information, read:\n\n    \u001b[1m:help diff-diffexpr\u001b[0m\n\n    \u001b[1m:help 'diffexpr'\u001b[0m\n\n  \u001b[1m30.9. How do I use the Vim diff mode without folding?\u001b[0m\n    You can use the following command-line to start Vim with two filenames\n    and use the diff mode without folding:\n\n     $ vim -o file1 file2 \"+windo set diff scrollbind scrollopt+=hor nowrap\"\n\n    If you like vertically split windows, then replace \"-o\" with \"-O\".\n\n    For more information, read:\n\n    \u001b[1m:help vimdiff\u001b[0m\n\n\u001b[1mGUI VIM\u001b[0m\n  \u001b[1m31.1. How do I create buffer specific menus?\u001b[0m\n    Adding support for buffer specific menus is in the Vim TODO list. In the\n    mean time, you can try Michael Geddes's plugin, buffermenu.vim:\n\n     https://www.vim.org/scripts/script.php?script_id=246\n\n  \u001b[1m31.2. How do I change the font used by GUI Vim?\u001b[0m\n    You can change the 'guifont' option to change the font used by GUI Vim.\n    To display the current value of this option, you can use\n\n     :set guifont?\n\n    You can add the displayed font name to the .vimrc file to use the font\n    across Vim sessions. For example, add the following line to the .vimrc\n    file to use Andale Mono font.\n\n     set guifont=Andale_Mono:h10:cANSI\n\n    For Win32, GTK and Photon version of Vim, you can use the following\n    command to bringup a dialog which will help you in changing the guifont:\n\n     :set guifont=*\n\n    You can also use the -font Vim command line option to specify the font\n    used for normal text.\n\n    For more information, read:\n\n    \u001b[1m:help 'guifont'\u001b[0m\n\n    \u001b[1m:help 'guifontset'\u001b[0m\n\n    \u001b[1m:help 'guifontwide'\u001b[0m\n\n    \u001b[1m:help font-sizes\u001b[0m\n\n    \u001b[1m:help -font\u001b[0m\n\n    \u001b[1m:help -boldfont\u001b[0m\n\n    \u001b[1m:help -italicfont\u001b[0m\n\n    \u001b[1m:help -menufont\u001b[0m\n\n    \u001b[1m:help -menufontset\u001b[0m\n\n  \u001b[1m31.3. When starting GUI Vim, how do I specify the location of the GVIM\n   window?\u001b[0m\n    You can use the \"-geometry\" command line argument to specify the\n    location of the GUI Vim window. For example:\n\n     $ gvim -geometry 80x25+100+300\n\n    For more information, read:\n\n    \u001b[1m:help 31.4\u001b[0m\n\n    \u001b[1m:help -geom\u001b[0m\n\n  \u001b[1m31.4. How do I add a horizontal scrollbar in GVim?\u001b[0m\n    You can enable the horizontal scrollbar by modifying the 'guioptions'\n    option:\n\n     :set guioptions+=b\n\n    For more information, read:\n\n    \u001b[1m:help 'guioptions'\u001b[0m\n\n    \u001b[1m:help gui-horiz-scroll\u001b[0m\n\n  \u001b[1m31.5. How do I make the scrollbar appear in the left side by default?\u001b[0m\n    You can add the \"l\" flag to the 'guioptions' option to make the\n    scrollbar appear in the left side.\n\n     :set guioptions+=l\n     :set guioptions-=r\n\n    For more information, read:\n\n    \u001b[1m:help 'guioptions'\u001b[0m\n\n    \u001b[1m:help gui-scrollbars\u001b[0m\n\n  \u001b[1m31.6. How do I remove the Vim menubar?\u001b[0m\n    You can remove the Vim menubar by removing the \"m\" flag from the\n    'guioptions' option:\n\n     :set guioptions-=m\n\n    For more information, read:\n\n    \u001b[1m:help 'guioptions'\u001b[0m\n\n  \u001b[1m31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the menu\n   starting with that letter is selected. I don't want this behavior as\n   I want to map the <Alt>-<key> combination. How do I do this?\u001b[0m\n    You can use the 'winaltkeys' option to disable the use of the <Alt> key\n    to select a menu item:\n\n     :set winaltkeys=no\n\n    For more information, read:\n\n    \u001b[1m:help 'winaltkeys'\u001b[0m\n\n    \u001b[1m:help :simalt\u001b[0m\n\n  \u001b[1m31.8. Is it possible to scroll the text by dragging the scrollbar so that\n   the cursor stays in the original location?\u001b[0m\n    The way Vim is designed, the cursor position has to be in a visible spot\n    in normal, visual, select and insert mode. This cannot be changed\n    without modifying Vim. When the scrollbar is used, the cursor will be\n    moved so that it is always visible. Another approach to solving this\n    problem is to use the Vim marks. You can mark the current cursor\n    position using ma. Then scroll to a different part of the text and jump\n    back to the old position using `a. You can also try the following\n    suggestion from the Vim Online website:\n\n     http://vim.wikia.com/wiki/VimTip320\n\n    For more information, read:\n\n    \u001b[1m:help mark-motions\u001b[0m\n\n  \u001b[1m31.9. How do I get gvim to start browsing files in a particular directory\n   when using the `:browse` command?\u001b[0m\n    You can set the 'browsedir' option to the default directory to use for\n    the `:browse` command.\n\n     :set browsedir='<your_dir>'\n\n    For more information, read:\n\n    \u001b[1m:help 'browsedir'\u001b[0m\n\n  \u001b[1m31.10. For some questions, like when a file is changed outside of Vim, Vim\n    displays a GUI dialog box. How do I replace this GUI dialog box with\n    a console dialog box?\u001b[0m\n    You can set the \"c\" flag in the 'guioptions' option to configure Vim to\n    use console dialogs instead of GUI dialogs:\n\n     :set guioptions+=c\n\n    For more information, read:\n\n    \u001b[1m:help 'guioptions'\u001b[0m\n\n  \u001b[1m31.11. I am trying to use GUI Vim as the editor for my xxx application.\n    When the xxx application launches GUI Vim to edit a file, the\n    control immediately returns to the xxx application. How do I start\n    GUI Vim, so that the control returns to the xxx application only\n    after I quit Vim?\u001b[0m\n    You have to start GUI Vim with the \"-f\" (foreground) command line\n    option:\n\n     $ gvim -f\n\n    By default, GUI Vim will disconnect from the program that started Vim.\n    With the '-f' option, GUI Vim will not disconnect from the program that\n    started it.\n\n    For more information, read:\n\n    \u001b[1m:help gui-fork\u001b[0m\n\n    \u001b[1m:help -f\u001b[0m\n\n  \u001b[1m31.12. Why does the \"Select Font\" dialog doesn't show all the fonts\n    installed in my system?\u001b[0m\n    Vim supports only fixed width (mono-spaced) fonts. Proportional fonts\n    are not supported. In the \"Select Font\" dialog, only fixed width fonts\n    will be displayed.\n\n    For more information, read:\n\n    \u001b[1m:help font-sizes\u001b[0m\n\n    \u001b[1m:help 'guifont'\u001b[0m\n\n  \u001b[1m31.13. How do I use the mouse in Vim command-line mode?\u001b[0m\n    You can set the \"c\" flag in the 'mouse' option to use mouse in the Vim\n    command-line mode:\n\n     :set mouse+=c\n\n    For more information, read:\n\n    \u001b[1m:help mouse-using\u001b[0m\n\n    \u001b[1m:help gui-mouse\u001b[0m\n\n    \u001b[1m:help 09.2\u001b[0m\n\n  \u001b[1m31.14. When I use the middle mouse button to scroll text, it pastes the\n    last copied text. How do I disable this behavior?\u001b[0m\n    You can map the middle mouse button to <Nop> to disable the middle mouse\n    button:\n\n     :map  <MiddleMouse> <Nop>\n     :map! <MiddleMouse> <Nop>\n\n    For more information, read:\n\n    \u001b[1m:help gui-mouse-mapping\u001b[0m\n\n    \u001b[1m:help <Nop\u001b[0m>\n\n  \u001b[1m31.15. How do I change the location and size of a GUI Vim window?\u001b[0m\n    You can use the `:winpos` command to change the Vim window position. To\n    change the size of the window, you can modify the 'lines' and 'columns'\n    options.\n\n    For example, the following commands will position the GUI Vim window at\n    the X,Y co-ordinates 50,50 and set the number of lines to 50 and the\n    number of columns to 80.\n\n     :winpos 50 50\n     :set lines=50\n     :set columns=80\n\n    The arguments to the `:winpos` command specify the pixel co-ordinates of\n    the Vim window. The 'lines' and 'columns' options specify the number of\n    lines and characters to use for the height and the width of the window\n    respectively.\n\n    For more information, read:\n\n    \u001b[1m:help 31.4\u001b[0m\n\n    \u001b[1m:help :winpos\u001b[0m\n\n    \u001b[1m:help 'lines'\u001b[0m\n\n    \u001b[1m:help 'columns'\u001b[0m\n\n    \u001b[1m:help GUIEnter\u001b[0m\n\n  \u001b[1m31.16. When splitting the Vim window vertically, Vim changes the position.\u001b[0m\n    This is a known problem. When you are splitting the Vim window, Vim will\n    try to draw a scrollbar. Since this changes the gui window, Vim tries to\n    resize its main window to keep the same position and this will cause Vim\n    to move its position. This happens on Windows with a multi-window setup\n    or a window that was \"snapped\" to a certain position.\n\n    A workaournd to this problem is, to remove gui scrollbars, e.g.\n\n     :set guioptions-=L\n\n\u001b[1mVIM ON UNIX\u001b[0m\n  \u001b[1m32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim\n   freezes. What should I do now?\u001b[0m\n    Many terminal emulators and real terminal drivers use the CTRL-S key to\n    stop the data from arriving so that you can stop a fast scrolling\n    display to look at it (also allowed older terminals to slow down the\n    computer so that it did not get buffer overflows). You can start the\n    output again by pressing the CTRL-Q key.\n\n    When you press the CTRL-S key, the terminal driver will stop sending the\n    output data. As a result of this, it will look like Vim is hung. If you\n    press the CTRL-Q key, then everything will be back to normal.\n\n    You can turn off the terminal driver flow control using the \"stty\"\n    command:\n\n     $ stty -ixon -ixoff\n\n    or, you can change the keys used for the terminal flow control, using\n    the following commands:\n\n     $ stty stop <char>\n     $ stty start <char>\n\n  \u001b[1m32.2. I am seeing weird screen update problems in Vim. What can I do to\n   solve this screen/display update problems?\u001b[0m\n    You have to use a proper terminal emulator like xterm with correct TERM\n    settings (TERM=xterm) and a correct terminfo/termcap file. For more\n    information, read:\n\n    \u001b[1m:help 'term'\u001b[0m\n\n  \u001b[1m32.3. I am using the terminal/console version of Vim. In insertmode, When I\n   press the backspace key, the character before the cursor is not\n   erased. How do I configure Vim to do this?\u001b[0m\n    You have to make sure that Vim gets the correct keycode for the\n    backpspace key. You can try using the command:\n\n     :fixdel\n\n    Make sure the TERM environment variable is set to the correct terminal\n    name. You can try using the \"stty\" command:\n\n     $ stty erase ^H\n\n    where, you have to enter the ^H character by pressing the CTRL-V key and\n    then the CTRL-H key. Also check the value of your 'backspace' setting.\n\n    For more information, read:\n\n    \u001b[1m:help :fixdel\u001b[0m\n\n    \u001b[1m:help Linux-backspace\u001b[0m\n\n    \u001b[1m:help NetBSD-backspace\u001b[0m\n\n    \u001b[1m:help 'backspace'\u001b[0m\n\n  \u001b[1m32.4. I am using Vim in a xterm. When I quit Vim, the screen contents are\n   restored back to the original contents. How do I disable this?\u001b[0m\n    The xterm has a capability called \"alternate screen\". If this capability\n    is present, vim switches to that alternate screen upon startup and back\n    on exit, thus restoring the original screen contents. To disable this\n    feature, add the following line to your .vimrc file:\n\n     :set t_ti= t_te=\n\n    For more information, read:\n\n    \u001b[1m:help 'restorescreen'\u001b[0m\n\n    \u001b[1m:help xterm-screens\u001b[0m\n\n  \u001b[1m32.5. When I start Vim, it takes quite a few seconds to start. How do I\n   minimize the startup time?\u001b[0m\n    This may be related to Vim opening the X display for setting the xterm\n    title and using the X clipboard. Make sure the DISPLAY variable is set\n    to point to the correct host. Try using the command line:\n\n     $ vim -X\n\n    This will prevent Vim from opening the X display. With this command-line\n    option, the X clipboard cannot be used and also Vim will not be able to\n    change the xterm title.\n\n    You can also set the 'clipboard' option to\n\n     :set clipboard=exclude:.*\n\n    This has the same effect as using the -X command-line argument.\n\n    For more information, read:\n\n    \u001b[1m:help -X\u001b[0m\n\n    \u001b[1m:help 'clipboard'\u001b[0m\n\n    If the clipboard is not the cause of the slow startup, it might be a\n    plugin that slows down Vim. In that case, you can use the --startuptime\n    argument to debug this further. You can do:\n\n     $ vim --startuptime vim_startup.log\n\n    and the timing will be written to the file vim_startup.log. For even\n    more advanced profiling, you can use the profiling feature, that is\n    available in huge builds of Vim. To do so, call Vim like this:\n\n     $ vim --cmd 'profile start profile.log' \\\n       --cmd 'profile func *' \\\n       --cmd 'profile file *' \\\n       -c 'profdel func *' \\\n       -c 'profdel file *' \\\n       -c 'qa!'\n\n    After running this, you will have a file profile.log in your current\n    directory. To further analyse this, open the file profile.log and run:\n\n     \" Open profile.log file in vim first\n     :let timings=[]\n     :g/^SCRIPT/call add(timings, [getline('.')[len('SCRIPT  '):], matchstr(getline(line('.')+1), '^Sourced \\zs\\d\\+')]+map(getline(line('.')+2, line('.')+3), 'matchstr(v:val, ''\\d\\+\\.\\d\\+$'')'))\n     :enew\n     :call setline('.', ['count total (s)   self (s)  script']+map(copy(timings), 'printf(\"%5u %9s   %8s  %s\", v:val[1], v:val[2], v:val[3], v:val[0])'))\n\n    For more information, read:\n\n    \u001b[1m:help --startuptime\u001b[0m\n\n    \u001b[1m:help profiling\u001b[0m\n\n  \u001b[1m32.6. How can I make the cursor in gvim in unix stop blinking?\u001b[0m\n    You can modify the 'guicursor' option, to stop the cursor from blinking.\n    For example:\n\n     :set guicursor=a:blinkon0\n\n    For more information, read:\n\n    \u001b[1m:help 'guicursor'\u001b[0m\n\n  \u001b[1m32.7. How do I change the menu font on GTK Vim?\u001b[0m\n    You can modify the ~/.gtkrc file to change the menu font on GTK Vim. For\n    example:\n\n     style \"default\"\n     { font =\"smooth09\" }\n     class \"*\" style \"default\"\n\n    The last line changes the font of all widgets.\n\n    For more information, read:\n\n    \u001b[1m:help gui-gtk\u001b[0m\n\n  \u001b[1m32.8. How do I prevent CTRL-Z from suspending Vim?\u001b[0m\n    You can map CTRL-Z to prevent the suspending. Here are some suggestions:\n\n    - Make CTRL-Z do nothing:\n\n     :map <C-Z> <Nop>\n\n    - Make CTRL-Z start a shell:\n\n     :map <C-Z> :shell<CR>\n\n    - Make CTRL-Z give an error message:\n\n     :map <C-Z> :\"suspending disabled<CR>\n\n    For the last example, the double quote is necessary in order to keep the\n    message on the status line.\n\n  \u001b[1m32.9. When I kill the xterm running Vim, the Vim process continues to run\n   and takes up a lot of CPU (99%) time. Why is this happening?\u001b[0m\n    When Vim is built with support for Python interface, you will have this\n    problem. This is a known problem with the python thread library and Vim.\n    To solve this problem, use a Vim binary built without the Python\n    interface.\n\n    For more information, read:\n\n    \u001b[1m:help +python\u001b[0m\n\n    \u001b[1m:help python\u001b[0m\n\n  \u001b[1m32.10. How do I get the Vim syntax highlighting to work in a Unix terminal?\u001b[0m\n    The easiest and simplest way to get Vim syntax highlighting is to use\n    the GUI version of Vim (GVIM). To get syntax highlighting to work in the\n    console/terminal version of Vim, you have to run a terminal emulator\n    (like Xfree86 xterm or rxvt or dtterm) that supports color. Note that if\n    a terminal emulator supports changing the background and foreground\n    colors, that does not mean that it also supports ANSI escape sequences\n    for changing the color. You can download the latest version of Xfree86\n    xterm from https://invisible-island.net/xterm/xterm.html You can\n    download the latest version of rxvt from https://rxvt.org You have to\n    install the terminfo/termcap file that supports colors for the terminal\n    emulator. Also, set the TERM environment variable to the correct name of\n    the term that supports colors.\n\n    You can use the colortest.vim script supplied with the Vim runtime\n    package to test the color setup. To use this script, follow these steps:\n\n     :e $VIMRUNTIME/syntax/colortest.vim\n     :source %\n\n    For more information, read:\n\n    \u001b[1m:help 06.2\u001b[0m\n\n    \u001b[1m:help terminal-colors\u001b[0m\n\n    \u001b[1m:help termcap-colors\u001b[0m\n\n    \u001b[1m:help startup-terminal\u001b[0m\n\n    \u001b[1m:help xterm-color\u001b[0m\n\n    \u001b[1m:help colortest.vim\u001b[0m\n\n\u001b[1mVIM ON MS-WINDOWS\u001b[0m\n  \u001b[1m33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode. What\n   happened?\u001b[0m\n    The mswin.vim script provides key mappings and options to make Vim\n    behave like a MS-Windows application. One of the keys mapped is CTRL-V\n    which is used for pasting text in MS-Windows applications. This will\n    disable the use of CTRL-V to start the blockwise visual mode. The\n    mswin.vim script maps CTRL-Q for staring the blockwise visual mode. So\n    you can use CTRL-Q instead of CTRL-V.\n\n    For more information, read:\n\n    \u001b[1m:help CTRL-V\u001b[0m\n\n    \u001b[1m:help CTRL-V-alternative\u001b[0m\n\n    \u001b[1m:help CTRL-Q\u001b[0m\n\n    \u001b[1m:help 10.5\u001b[0m\n\n  \u001b[1m33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do I\n   configure Vim to treat CTRL-Y as CTRL-Y?\u001b[0m\n    The mapping of the CTRL-Y key to the CTRL-R key is done by the mswin.vim\n    script. The mswin.vim script maps CTRL-Y to make Vim behave like a\n    standard MS-Windows application. This is explained in `:help CTRL-Y`.\n    You can either comment out the line in mswin.vim that maps the CTRL-Y\n    key or you can remove the line in your .vimrc file that sources the\n    mswin.vim script.\n\n  \u001b[1m33.3. How do I start GUI Vim in a maximized window always?\u001b[0m\n    You can use the `:simalt` command to maximize the Vim window. You can\n    use the GUIEnter autocmd to maximize the Vim window on startup:\n\n     autocmd GUIEnter * simalt ~x\n\n    For more information, read:\n\n    \u001b[1m:help :simalt\u001b[0m\n\n    \u001b[1m:help GUIEnter\u001b[0m\n\n    \u001b[1m:help gui-win32-maximized\u001b[0m\n\n  \u001b[1m33.4. After doing some editing operations, Vim freezes. The cursor becomes\n   an empty rectangle. I am not able enter any characters. What is\n   happening?\u001b[0m\n    Most probably, you used the mouse wheel to scroll the text in Vim. There\n    is a known problem in using intellimouse mouse wheel with Vim. To avoid\n    this problem, disable Universal scrolling support for Vim.\n\n    For more information, read:\n\n    \u001b[1m:help intellimouse-wheel-problems\u001b[0m\n\n  \u001b[1m33.5. I am using Windows XP, the display speed of maximized GVim is very\n   slow. What can I do to speed the display updates?\u001b[0m\n    This may be due to the fact that you have enabled 'Smooth edges of\n    screen fonts' in the display properties. Try turning off font smoothing\n    or try changing the smoothing method to \"Standard\".\n\n  \u001b[1m33.6. What are the recommended settings for using Vim with cygwin?\u001b[0m\n    You may want to set the following shell related Vim settings:\n\n     :set shellcmdflag=-c\n     :set shellquote=\n     :set shellslash          \" Use the forward slash for expansion.\n     :set shellxquote=\\\"\n     :set shell=d:\\cygwin\\bin\\bash.exe \" Use the bash shell\n     :set shellpipe=2>&1| tee\n     :set shellredir=>%s 2>&1\n\n  \u001b[1m33.7. I am trying to use GNU diff with Vim diff mode. When I run the diff\n   from command line, it works. When I try to use the diff with Vim it\n   doesn't work. What should I do now?\u001b[0m\n    There is a problem with using GNU diff with Vim. You can try using the\n    GNU diff.exe built by Ron Aaron from the following link:\n\n     http://www.mossbayeng.com/~ron/vim/builds.html\n    (This page no longer exists.)\n\n  \u001b[1m33.8. Is it possible to use Vim as an external editor for MS-Windows\n   Outlook email client?\u001b[0m\n    You can use the \"cubiclevim\" COM Add-In to use Vim as an external editor\n    for MS-Windows Outlook email client. Visit the following URL for more\n    information:\n\n     https://sourceforge.net/projects/cubiclevim/\n\n    Note, that currently this works only with MS-Office 2000 and XP.\n\n    Also the plugin OutlookVim might be worth a look:\n\n     https://www.vim.org/scripts/script.php?script_id=3087\n\n  \u001b[1m33.9. I am using Vim to edit HTML files. How do I start internet explorer\n   with the current file to preview the HTML file?\u001b[0m\n    You can use the following command:\n\n     :!start c:\\progra~1\\intern~1\\iexplore.exe file://%:p<CR>\n\n  \u001b[1m33.10. I would like to use Vim with Microsoft Visual Studio. How do I do\n    this?\u001b[0m\n    You have to download and use the OLE version of Vim (for example:\n    gvim61ole.zip). This file also contains instructions on how to use Vim\n    with Visual Studio.\n\n    For more information, read:\n\n    \u001b[1m:help MSVisualStudio\u001b[0m\n\n  \u001b[1m33.11. Where do I place the _vimrc and _gvimrc files?\u001b[0m\n    You can place the _vimrc and _gvimrc files under the directory pointed\n    to by the VIM environment variable. If you are sharing this system with\n    other users, then you can place the files in a directory and set the\n    HOME environment variable to this directory.\n\n    For more information, read:\n\n    \u001b[1m:help $HOME-use\u001b[0m\n\n    \u001b[1m:help _vimrc\u001b[0m\n\n  \u001b[1m33.12. Every time I save a file, Vim warns about the file being changed\n    outside of Vim. Why?\u001b[0m\n    If you get the following warning message, every time you save a file:\n\n     WARNING: The file has been changed since reading it!!!\n     Do you really want to write to it (y/n)?\n\n    then this problem could be related to a bug in MS-Windows on the day\n    daylight saving time starts. Vim remembers the timestamp of the file\n    after it was written. Just before the next write the timestamp is\n    obtained again to check if the file was changed outside of Vim. This\n    works correctly, except on the day daylight saving time starts.\n\n    This problem will go away the next day after the day the daylight saving\n    time starts.\n\n    For more information, read:\n\n    \u001b[1m:help W11\u001b[0m\n\n\u001b[1mPRINTING\u001b[0m\n  \u001b[1m34.1. How do I print a file along with line numbers for all the lines?\u001b[0m\n    You can set the 'printoptions' option and use the `:hardcopy` command to\n    print your file:\n\n     :set printoptions=number:y\n     :hardcopy\n\n    For more information, read:\n\n    \u001b[1m:help 'printoptions'\u001b[0m\n\n    \u001b[1m:help :hardcopy\u001b[0m\n\n  \u001b[1m34.2. How do I print a file with the Vim syntax highlighting colors?\u001b[0m\n    You can use the `:hardcopy` command to print a file with the Vim syntax\n    highlighting colors. You can also convert your file to a HTML file using\n    the 2html.vim script and print the HTML file.\n\n    For more information, read:\n\n    \u001b[1m:help syntax-printing\u001b[0m\n\n    \u001b[1m:help 2html.vim\u001b[0m\n\n    \u001b[1m:help :hardcopy\u001b[0m\n\n    \u001b[1m:help printing\u001b[0m\n\n\u001b[1mBUILDING VIM FROM SOURCE\u001b[0m\n  \u001b[1m35.1. How do I build Vim from the sources on a Unix system?\u001b[0m\n    For a Unix system, follow these steps to build Vim from the sources:\n\n    - Download the source from the git repository:\n    https://github.com/vim/vim/releases/ - Alternatively, download the\n    source from the mercurial repository:\n    https://bitbucket.org/vim-mirror/vim/downloads/ - Run the \"make\" command\n    to configure and build Vim with the default configuration. - Run \"make\n    install\" command to install Vim in the default directory.\n\n    To enable/disable various Vim features, before running the \"make\"\n    command you can run the \"configure\" command with different flags to\n    include/exclude the various Vim features. To list all the available\n    options for the \"configure\" command, use:\n\n     $ configure --help\n\n    For more information, read:\n\n    \u001b[1m:help install\u001b[0m\n\n  \u001b[1m35.2. How do I install Vim in my home directory or a directory other\n   than the default installation directory in Unix?\u001b[0m\n    To install Vim in a directory other than the default installation\n    directory, you have to specify the directory using the --prefix option\n    while running the configure script.\n\n     $ ./configure --prefix=/users/xyz\n\n    You can enable/disable various Vim feature by supplying different\n    arguments to the configure script. For more information about all these\n    options, run:\n\n     $ ./configure --help\n\n    For more information, read:\n\n    \u001b[1m:help install-home\u001b[0m\n\n    \u001b[1m:help install\u001b[0m\n\n  \u001b[1m35.3. How do I build Vim from the sources on a MS-Windows system?\u001b[0m\n    For a MS-Windows system, Vim can be built using either the Visual C++\n    compiler or the Borland C++ compiler or the Ming GCC compiler or the\n    cygwin gcc compiler. Follow these steps to build Vim from the sources\n    for MS-Windows: - download the source from the git repository:\n    https://github.com/vim/vim/releases/ - Depending on the installed\n    compiler, you can use the corresponding makefile to build the Vim\n    sources. For Visual C++ use the Make_mvc.mak makefile, for borland C++\n    use the Make_bc5.mak makefile, for ming GCC use the Make_ming.mak\n    makefile, for cygwin gcc use the Make_cyg.mak makefile.\n\n    Depending on whether you want to build the GUI version of Vim or the\n    console version of Vim, you have to pass different arguments to the\n    makefiles. After successfully building the sources, you can copy the\n    vim.exe or gvim.exe file to the desired directory along with the files\n    from the runtime archive.\n\n    For more information, read:\n\n    \u001b[1m:help install\u001b[0m\n\n  \u001b[1m35.4. The Vim help, syntax, indent files are missing from my Vim\n   installation. How do I install these files?\u001b[0m\n    The Vim help, syntax, indent and other runtime files are part of the Vim\n    runtime package. You need to download and install the Vim runtime\n    package. For example, for MS-Windows, the name of the Vim 6.1 runtime\n    package is vim61rt.zip.\n\n    For more information, read:\n\n    \u001b[1m:help install\u001b[0m\n\n  \u001b[1m35.5. I have built Vim from the source and installed the Vim package using\n   \"make install\". Do I need to keep the Vim source directory?\u001b[0m\n    No. Once you have built and installed Vim in some directory other than\n    the original source directory (for example, /usr/bin or /usr/local/bin),\n    then you can remove the source directory.\n\n  \u001b[1m35.6. How do I determine the Vim features which are enabled at compile\n   time?\u001b[0m\n    You can use the `:version` command to determine the Vim features that\n    are enabled at compile time. The features that are enabled will be\n    prefixed with a \"+\". The features that are not enabled will be prefixed\n    with a \"-\".\n\n    If you want to test for a feature in a script, you can use the has()\n    function:\n\n     if has(\"menu\")\n         \" Set up some menus\n     endif\n\n    For more information, read:\n\n    \u001b[1m:help :version\u001b[0m\n\n    \u001b[1m:help +feature-list\u001b[0m\n\n    \u001b[1m:help has()\u001b[0m\n\n  \u001b[1m35.7. Can I build Vim without the GUI support?\u001b[0m\n    Yes. You can build Vim by optionally enabling/disabling many of the\n    features including GUI.\n\n    For more information, read:\n\n    \u001b[1m:help install\u001b[0m\n\n  \u001b[1m35.8. When building Vim on a Unix system, I am getting \"undefined reference\n   to term_set_winsize\" error. How do I resolve this error?\u001b[0m\n    You will get this error when the build process is not able to locate the\n    termlib, termcap or ncurses library. You have to install the ncurses-dev\n    package to resolve this error.\n\n  \u001b[1m35.9. Vim configure keeps complaining about the lack of gtk-config while\n   trying to use GTK 2.03. This is correct, since in GTK 2 they moved to\n   using the generic pkg-config. I can get pkg-config to list the\n   various includes and libs for gtk, but for some reason the configure\n   script still isn't picking this up.\u001b[0m\n    Use the following shell script named gtk-config:\n\n     #!/bin/sh\n     pkg-config gtk+-2.0 $1 $2\n\n  \u001b[1m35.10. I did successfully download the sources and compiled Vim on\n     Unix. But feature ... still does not work. What is wrong and\n     how can I fix it?\u001b[0m\n    You should first check, that you are actually running your self compiled\n    Vim and not the system's provided version. So first check your $PATH\n    setting.\n\n    Depending on your compile options, some features might not be included\n    in your build of Vim. You can use the `:version` command to determine\n    the Vim features that are enabled at compile time. The features that are\n    enabled will be prefixed with a \"+\". The features that are not enabled\n    will be prefixed with a \"-\".\n\n    The easiest way to include all features is to build the huge version. To\n    do this, you have to specify the --with-features option while running\n    the configure script:\n\n     $ ./configure --with-features=huge\n\n    Nevertheless, a feature could still be disabled at compile time, if the\n    configure script can't find the required libraries for those features\n    (e.g. for clipboard integration, your Vim needs to be linked against the\n    X11 development libraries).\n\n    There are several ways to install the required libraries:\n\n    1) On a Debian based distribution, you can use the package manager \"apt\"\n    to install all required dependencies. As superuser, run the command:\n\n       $ apt-get build-dep vim-gtk\n\n       This makes sure all required libraries needed to compile the vim-gtk\n       package will be installed. (This requires, that your sources list\n       contains deb-src entries. See your distribution manual on how to\n       enable this, if the above command did not work.)\n\n    2) In openSUSE you can use the package manager \"zypper\" to install all\n    required libraries. This requires, that there is a source version of the\n    package installable from a configured repository (which by default is\n    not the case). Use:\n\n       $ zypper search -t srcpackage vim\n\n       to find out, whether or not there exists a source version in the\n       repository. If there is none, you'll need to add a source repository.\n       For openSUSE 11.2 you could use, e.g.\n\n       $ zypper ar\n       http://download.opensuse.org/source/distribution/11.2/repo/oss/src-11.2\n\n       (one line)\n\n       Once you have a source version available in your repositories, use\n       this command to install all needed requirements:\n\n       $ zypper source-install --build-deps-only vim\n\n    3) On a Fedora/RedHat based system, you can use\n\n       $ yum-builddep vim-enhanced\n\n    4) Run configure with your options and watch for missing libraries:\n\n       $ ./configure --with-features=huge 2>&1 |tee logfile\n\n       This will run configure and record the output into the file \"logfile\".\n       You need to check the logfile for missing dependencies. Consider this\n       output:\n\n     checking --disable-gtktest argument... gtk test enabled\n     checking for pkg-config... /usr/bin/pkg-config\n     checking for GTK - version >= 2.2.0... no\n\n     Here you can see, that the gtk libraries are missing and therefore\n     no GTK gui version can't be build. So you need to install the GTK\n     library in your system, with your package manager or by compiling it\n     yourself. Then run the configure script again and check, that it\n     finds the library.\n\n    In theory, those provided dependencies by your distribution might still\n    lack some libraries, that are needed for features, that simply are not\n    enabled in your distribution and therefore those commands in 1-3 won't\n    install it. At the very least, this provides a jumping point and you\n    need to track down the required missing packages using method 4 from\n    above. But usually, this works good enough for most people and you won't\n    have to bother with the fourth method.\n\n    For more information, read:\n\n    \u001b[1m:help :version\u001b[0m\n\n    \u001b[1m:help +feature-list\u001b[0m\n\n\u001b[1mVARIOUS\u001b[0m\n  \u001b[1m36.1. How do I edit binary files with Vim?\u001b[0m\n    You can set the following options to edit binary files in Vim:\n\n     :set binary\n     :set display=uhex\n\n    You can also use the \"-b\" command-line option to edit a binary file:\n\n     $ vim -b <binary_file_name>\n\n    You can also use the xxd utility (part of the Vim distribution) to edit\n    binary files.\n\n    For more information, read:\n\n    \u001b[1m:help 23.4\u001b[0m\n\n    \u001b[1m:help edit-binary\u001b[0m\n\n    \u001b[1m:help hex-editing\u001b[0m\n\n    \u001b[1m:help -b\u001b[0m\n\n    \u001b[1m:help 'binary'\u001b[0m\n\n    \u001b[1m:help 'endofline'\u001b[0m\n\n    \u001b[1m:help 'display'\u001b[0m\n\n  \u001b[1m36.2. How do I disable the visual error flash and the error beep?\u001b[0m\n    You can disable both the visual error flash and the error beep using the\n    following command:\n\n     :set visualbell t_vb=\n\n    For more information, read:\n\n    \u001b[1m:help 'visualbell'\u001b[0m\n\n    \u001b[1m:help 'errorbells'\u001b[0m\n\n    \u001b[1m:help t_vb\u001b[0m\n\n  \u001b[1m36.3. How do I display the ascii value of a character displayed in a\n   buffer?\u001b[0m\n    You can use the \"ga\" command to display the ascii value of a displayed\n    character.\n\n    For more information, read:\n\n    \u001b[1m:help ga\u001b[0m\n\n    \u001b[1m:help :ascii\u001b[0m\n\n  \u001b[1m36.4. Can I use zero as a count for a Vim command?\u001b[0m\n    You cannot use zero as a count for a Vim command, as \"0\" is a command on\n    its own, moving to the first column of the line.\n\n    For more information, read:\n\n    \u001b[1m:help 0\u001b[0m\n\n    \u001b[1m:help count\u001b[0m\n\n  \u001b[1m36.5. How do I disable the Vim welcome screen?\u001b[0m\n    You can disable the Vim welcome screen, by adding the \"I\" flag to the\n    'shortmess' option:\n\n     :set shortmess+=I\n\n    For more information, read:\n\n    \u001b[1m:help :intro\u001b[0m\n\n    \u001b[1m:help 'shortmess'\u001b[0m\n\n  \u001b[1m36.6. How do I avoid the \"hit enter to continue\" prompt?\u001b[0m\n    Vim will prompt you with the \"hit enter to continue\" prompt, if there\n    are some messages on the screen for you to read and the screen is about\n    to be redrawn. You can add the \"T\" flag to the 'shortmess' option to\n    truncate all messages. This will help in avoiding the hit-enter prompt:\n\n     :set shortmess+=T\n\n    You can also increase the command height by setting the 'cmdheight'\n    option:\n\n     :set cmdheight=2\n\n    For more information, read:\n\n    \u001b[1m:help hit-enter\u001b[0m\n\n    \u001b[1m:help avoid-hit-enter\u001b[0m\n\n    \u001b[1m:help 'shortmess'\u001b[0m\n\n    \u001b[1m:help 'cmdheight'\u001b[0m\n\n  \u001b[1m36.7. How do I invoke Vim from command line to run a group of commands on a\n   group of files?\u001b[0m\n    There are several ways to invoke Vim from command line to run a group of\n    commands on a group of files. You can use a set of \"-c\" command line\n    options to specify a group of commands:\n\n     $ vim -c \"<ex_command_1>\" -c \"<ex_command_2>\" *.txt\n\n    Each of the ex-command specified with the \"-c\" command line option is\n    executed one by one sequentially. You can also use a single \"-c\" command\n    line option and the \"|\" character to separate the ex commands:\n\n     $ vim -c \"<ex_command_1> | <ex_command_2>\" *.txt\n\n    In the above command, if an ex command fails, then all the remaining ex\n    commands will not be executed.\n\n    For example, to replace \"ABC\" with \"DEF\" in a file from the\n    command-line, you can use the following command:\n\n     $ vim -c \"%s/ABC/DEF/ge | update\" myfile.txt\n\n    To replace \"ABC\" with \"DEF\" in multiple files from the command-line, you\n    can use the following command:\n\n     $ vim -c \"argdo %s/ABC/DEF/ge | update\" *.txt\n\n    You can store the group of commands into a file and use the \"-s\" command\n    line option to run the commands on a set of files. For example, if the\n    group of commands are stored in the file mycmds.txt, then you can use\n    the following command:\n\n     $ vim -s mycmds.txt *.pl\n\n    For more information, read:\n\n    \u001b[1m:help -c\u001b[0m\n\n    \u001b[1m:help -s\u001b[0m\n\n  \u001b[1m36.8. How do I use a normal mode command from insert mode without leaving\n   the insert mode?\u001b[0m\n    You can use a normal command from insert mode, without leaving the\n    insert mode, by first pressing the CTRL-O key and then follow that with\n    a single normal mode command.\n\n    To execute more than one normal mode command, press the CTRL-L key,\n    followed by any number of normal mode commands and then press <Esc> to\n    get back to the insert mode. (This only works, when the 'insertmode'\n    option is set).\n\n    For more information, read:\n\n    \u001b[1m:help i_CTRL-O\u001b[0m\n\n    \u001b[1m:help i_CTRL-L\u001b[0m\n\n  \u001b[1m36.9. How do I start Vim in insert mode?\u001b[0m\n    You can start Vim in insert mode using the `:startinsert` ex command.\n\n     $ vim +startinsert myfile.txt\n\n    The above command will open the file \"myfile.txt\" and start insert mode\n    with the cursor in front of the first character on the first line. To\n    open the file and start appending after the last character on the last\n    line, you can use the following command:\n\n     $ vim + +startinsert! myfile.txt\n\n    For more information, read:\n\n    \u001b[1m:help :startinsert\u001b[0m\n\n  \u001b[1m36.10. How do I use Copy and Paste with Vim?\u001b[0m\n    You should first check the output of the `:version` command and make\n    sure that +xterm-clipboard is present.\n\n    When running Vim in an xterm, you can either let Vim control the mouse\n    or let xterm control the mouse. This is configured by the 'mouse'\n    option.\n\n    If the 'mouse' option is not set (or set to the default value), then Vim\n    will not control the mouse. You cannot move the Vim text cursor using\n    the mouse. When you select some text using the mouse, xterm will copy it\n    to the X11 cut buffer. When you press both the mouse buttons, xterm will\n    paste the text from the cut buffer.\n\n    If the 'mouse' option is set to \"a\" or some other value, then Vim\n    controls the mouse. The mode (normal or insert or visual, etc) in which\n    Vim controls the mouse is configured by the 'mouse' option. You can move\n    the Vim text cursor using the mouse. When you select some text, the\n    'clipboard' option setting is used to determine whether to transfer the\n    selected text to the clipboard or not. The default setting is to\n    transfer the selected text to the clipboard. If you want to use the\n    xterm selection mechanism in this mode, then you can press the <Shift>\n    key. If you press <Shift> key when selecting text using the mouse, then\n    Vim doesn't control the mouse and xterm controls the mouse.\n\n    In the GUI mode, Copy and Paste should just work, depending on the\n    'mouse' setting. For more information, read:\n\n    \u001b[1m:help 'clipboard'\u001b[0m\n\n    \u001b[1m:help x11-selection\u001b[0m\n\n    \u001b[1m:help clipboard\u001b[0m\n\n    \u001b[1m:help 'go-a'\u001b[0m\n\n    \u001b[1m:help 'mouse'\u001b[0m\n\n    \u001b[1m:help xterm-copy-paste\u001b[0m\n\n    \u001b[1m:help 09.3\u001b[0m\n\n  \u001b[1m36.11. Why shouldn't I modify the files in the system runtime directory?\u001b[0m\n    Just be careful about modifying files under $VIMRUNTIME, which usually\n    is /usr/share/vim/vimXX (Unix) or C:\\Program Files\\vim\\vimXX (Windows)\n    and XX being the version for which it applies, e.g. 73 for Vim =head2\n    7.3.\n\n    One should generally avoid modifying those files because they may be\n    replaced during an upgrade of your Vim installation and your changes\n    will be lost. Also, if you upgrade to a new major or minor revision of\n    Vim (e.g., from 7.3 to 7.4), the new version of Vim will use a different\n    $VIMRUNTIME directory and while your changes won't be lost, they will be\n    ignored.\n\n    Consequently, take a look at\n\n    \u001b[1m:help filetypes\u001b[0m\n\n    for an explanation of several ways to modify Vim's response to different\n    filetypes and where to put those modifications so that they will not be\n    overwritten.\n\n\u001b[1mUNICODE\u001b[0m\n    Author: Tony Mechelynck <antoine.mechelynck AT belgacom.net>\n\n  \u001b[1m37.1. Is it possible to create Unicode files using Vim?\u001b[0m\n    Yes. It may be more or less complicated depending on the keyboard and\n    fonts available to you, but it is always possible to encode any possible\n    Unicode codepoint (and some illegal ones) into a file. To create a\n    Unicode file using Vim, you should have compiled Vim with the\n    \"+multi_byte\" compile-time option. You can get more information about\n    Unicode from the following sites:\n\n     http://www.unicode.org\n     https://www.cl.cam.ac.uk/~mgk25/unicode.html\n\n    For more information, read:\n\n    \u001b[1m:help multibyte\u001b[0m\n\n    \u001b[1m:help usr_45.txt\u001b[0m\n\n  \u001b[1m37.2. Which Vim settings are particularly important for editing Unicode\n   files?\u001b[0m\n    The most important are the various \"encoding\" options, i.e., 'encoding',\n    'fileencoding', 'fileencodings' and 'termencoding'. The boolean option\n    'bomb' is also significant.\n\n    For more information, read:\n\n    \u001b[1m:help 'encoding'\u001b[0m\n\n    \u001b[1m:help 'fileencoding'\u001b[0m\n\n    \u001b[1m:help 'fileencodings'\u001b[0m\n\n    \u001b[1m:help 'termencoding'\u001b[0m\n\n    \u001b[1m:help 'bomb'\u001b[0m\n\n  \u001b[1m37.3. What is the 'encoding' option?\u001b[0m\n    Basically, the 'encoding' option defines how Vim will represent your\n    data internally. However, all Unicode encodings are represented\n    internally as utf-8 and converted (if necessary) when reading and\n    writing.\n\n    For more information, read:\n\n    \u001b[1m:help 'encoding'\u001b[0m\n\n  \u001b[1m37.4. How does Vim name the various Unicode encodings?\u001b[0m\n    Utf-8 is called utf-8 or utf8; utf-16 is called ucs-2 or ucs2; utf-32 is\n    called ucs-4 or ucs4. Also, you may specify endianness (except for utf-8\n    which does not vary for endianness) by appending le for little-endian or\n    be for big-endian. If you create a file with an encoding of ucs-2 or\n    ucs-4 without specifying endianness, Vim will use what is typical of\n    your machine.\n\n    For more information, read:\n\n    \u001b[1m:help encoding-names\u001b[0m\n\n    \u001b[1m:help encoding-values\u001b[0m\n\n    \u001b[1m:help encoding-table\u001b[0m\n\n  \u001b[1m37.5. How does Vim specify the presence or absence of a byte-order mark?\u001b[0m\n    When reading a file, if the 'fileencodings' option includes \"ucs-bom\",\n    Vim will check for a byte-order mark. When writing a file, if the 'bomb'\n    option is set, Vim will write a byte-order mark on files whose encoding\n    warrants it.\n\n    For more information, read:\n\n    \u001b[1m:help 'fileencodings'\u001b[0m\n\n    \u001b[1m:help 'bomb'\u001b[0m\n\n  \u001b[1m37.6. What is the 'fileencoding' option?\u001b[0m\n    The 'fileencoding' option defines the particular encoding which Vim will\n    use to write a file. If empty, then the value of the 'encoding' option\n    is the default.\n\n    For more information, read:\n\n    \u001b[1m:help 'fileencoding'\u001b[0m\n\n  \u001b[1m37.7. What is the 'fileencodings' option?\u001b[0m\n    The 'fileencodings' option defines the heuristics used by Vim when\n    opening an existing file. It is a comma separated list of encodings. A\n    special name, \"ucs-bom\" is used to indicate that Vim should check for\n    the presence of a byte-order mark; however, it will not be recognised if\n    it comes after \"utf-8\". Normally, \"ucs-bom\" (if present) should be first\n    in the list.\n\n    When Vim opens a file, it checks it against the encodings listed in\n    'fileencodings'. The first one that matches is used. If there is no\n    match, then Vim sets 'fileencoding' to the null string, i.e., the value\n    of 'encoding' will be used.\n\n    For more information, read:\n\n    \u001b[1m:help 'fileencodings'\u001b[0m\n\n    \u001b[1m:help 'encoding'\u001b[0m\n\n  \u001b[1m37.8. What is the 'termencoding' option?\u001b[0m\n    The 'termencoding' option defines how your keyboard encodes the data you\n    type. If empty, Vim assumes that it has the same value as 'encoding'.\n    Usually it should be set to something that matches your locale.\n\n    For more information, read:\n\n    \u001b[1m:help 'termencoding'\u001b[0m\n\n    \u001b[1m:help locale\u001b[0m\n\n  \u001b[1m37.9. What is the 'bomb' option?\u001b[0m\n    When reading a file with \"ucs-bom\" present in the 'fileencodings'\n    option, Vim will set the 'bomb' option on or off depending on the\n    presence or absence of a byte-order mark at the start of the file. When\n    writing, Vim will write a byte-order mark if the 'bomb' option is set.\n    You may set or unset it manually do make Vim write, or not write, the\n    b.o.m.\n\n    For more information, read:\n\n    \u001b[1m:help 'bomb'\u001b[0m\n\n  \u001b[1m37.10. Where can I find an example of a typical use of all these options?\u001b[0m\n    There is a \"tip\", with explains them in different words with an example,\n    at\n\n     http://vim.wikia.com/wiki/VimTip246\n\n  \u001b[1m37.11. How can I insert Unicode characters into a file using Vim?\u001b[0m\n    Several methods are available:\n\n    - Characters present on your keyboard can be typed in the usual way,\n    even those which require a \"dead-key\" prefix, like (for instance) the\n    circumflex on French keyboards. - Characters for which a digraph is\n    defined can be typed as two characters prefixed by CTRL-K. - If you have\n    set the 'digraph' option, you can enter the characters for which a\n    digraph is defined as <char1><BS><char2>. - Any character can be entered\n    by using a CTRL-V prefix (or CTRL-Q if CTRL-V is remapped to paste from\n    the clipboard).\n\n    For more information, read:\n\n    \u001b[1m:help digraphs\u001b[0m\n\n    \u001b[1m:help 'digraph'\u001b[0m\n\n    \u001b[1m:help i_CTRL-V_digit\u001b[0m\n\n  \u001b[1m37.12. How can I know which digraphs are defined and for which characters?\u001b[0m\n    First set the 'encoding' option properly (for instance, to utf-8), then\n    use the `:digraphs` command to list the currently defined digraphs.\n\n    Alternatively, the help file contains the complete set of all digraphs.\n    So you can easily search that list there.\n\n    For more information, read:\n\n    \u001b[1m:help :digraphs\u001b[0m\n\n    \u001b[1m:help 'encoding'\u001b[0m\n\n    \u001b[1m:help digraph-table\u001b[0m\n\n\u001b[1mAUTHOR\u001b[0m\n    Current Maintainer: Christian Brabandt <cb@256bit.org>\n\n    Last updated on: 11 October 2025\n\n"
  },
  {
    "path": "others/vim_faq.html",
    "content": "<?xml version=\"1.0\" ?>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title>Vim FAQ</title>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n<link rev=\"made\" href=\"mailto:root@localhost\" />\n</head>\n\n<body>\n\n\n\n<ul id=\"index\">\n  <li><a href=\"#DESCRIPTION\">DESCRIPTION</a></li>\n  <li><a href=\"#GENERAL-INFORMATION\">GENERAL INFORMATION</a></li>\n  <li><a href=\"#RESOURCES\">RESOURCES</a></li>\n  <li><a href=\"#AVAILABILITY\">AVAILABILITY</a></li>\n  <li><a href=\"#HELP\">HELP</a></li>\n  <li><a href=\"#EDITING-A-FILE\">EDITING A FILE</a></li>\n  <li><a href=\"#EDITING-MULTIPLE-FILES\">EDITING MULTIPLE FILES</a></li>\n  <li><a href=\"#BACKUP\">BACKUP</a></li>\n  <li><a href=\"#BUFFERS\">BUFFERS</a></li>\n  <li><a href=\"#WINDOWS\">WINDOWS</a></li>\n  <li><a href=\"#MOTION\">MOTION</a></li>\n  <li><a href=\"#SEARCHING-TEXT\">SEARCHING TEXT</a></li>\n  <li><a href=\"#CHANGING-TEXT\">CHANGING TEXT</a></li>\n  <li><a href=\"#COMPLETION-IN-INSERT-MODE\">COMPLETION IN INSERT MODE</a></li>\n  <li><a href=\"#TEXT-FORMATTING\">TEXT FORMATTING</a></li>\n  <li><a href=\"#VISUAL-MODE\">VISUAL MODE</a></li>\n  <li><a href=\"#COMMAND-LINE-MODE\">COMMAND-LINE MODE</a></li>\n  <li><a href=\"#VIMINFO\">VIMINFO</a></li>\n  <li><a href=\"#REMOTE-EDITING\">REMOTE EDITING</a></li>\n  <li><a href=\"#OPTIONS\">OPTIONS</a></li>\n  <li><a href=\"#MAPPING-KEYS\">MAPPING KEYS</a></li>\n  <li><a href=\"#ABBREVIATIONS\">ABBREVIATIONS</a></li>\n  <li><a href=\"#RECORD-AND-PLAYBACK\">RECORD AND PLAYBACK</a></li>\n  <li><a href=\"#AUTOCOMMANDS\">AUTOCOMMANDS</a></li>\n  <li><a href=\"#SYNTAX-HIGHLIGHT\">SYNTAX HIGHLIGHT</a></li>\n  <li><a href=\"#VIM-SCRIPT-WRITING\">VIM SCRIPT WRITING</a></li>\n  <li><a href=\"#PLUGINS\">PLUGINS</a></li>\n  <li><a href=\"#EDITING-PROGRAM-FILES\">EDITING PROGRAM FILES</a></li>\n  <li><a href=\"#QUICKFIX\">QUICKFIX</a></li>\n  <li><a href=\"#FOLDING\">FOLDING</a></li>\n  <li><a href=\"#VIM-WITH-EXTERNAL-APPLICATIONS\">VIM WITH EXTERNAL APPLICATIONS</a></li>\n  <li><a href=\"#GUI-VIM\">GUI VIM</a></li>\n  <li><a href=\"#VIM-ON-UNIX\">VIM ON UNIX</a></li>\n  <li><a href=\"#VIM-ON-MS-WINDOWS\">VIM ON MS-WINDOWS</a></li>\n  <li><a href=\"#PRINTING\">PRINTING</a></li>\n  <li><a href=\"#BUILDING-VIM-FROM-SOURCE\">BUILDING VIM FROM SOURCE</a></li>\n  <li><a href=\"#VARIOUS\">VARIOUS</a></li>\n  <li><a href=\"#UNICODE\">UNICODE</a></li>\n  <li><a href=\"#GENERAL-INFORMATION1\">GENERAL INFORMATION</a>\n    <ul>\n      <li><a href=\"#What-is-Vim\">1.1. What is Vim?</a></li>\n      <li><a href=\"#Who-wrote-Vim\">1.2. Who wrote Vim?</a></li>\n      <li><a href=\"#Is-Vim-compatible-with-Vi\">1.3. Is Vim compatible with Vi?</a></li>\n      <li><a href=\"#What-are-some-of-the-improvements-of-Vim-over-Vi\">1.4. What are some of the improvements of Vim over Vi?</a>\n        <ul>\n          <li><a href=\"#Features-to-modernise-Vi\">Features to modernise Vi:</a>\n            <ul>\n              <li><a href=\"#Multi-level-undo\">Multi-level undo</a></li>\n              <li><a href=\"#Tabs-Multiple-windows-and-buffers\">Tabs, Multiple windows and buffers</a></li>\n              <li><a href=\"#Flexible-insert-mode\">Flexible insert mode</a></li>\n              <li><a href=\"#Macros\">Macros</a></li>\n              <li><a href=\"#Visual-mode\">Visual mode</a></li>\n              <li><a href=\"#Block-operators\">Block operators</a></li>\n              <li><a href=\"#Online-help-system\">Online help system</a></li>\n              <li><a href=\"#Command-line-editing-and-history\">Command-line editing and history</a></li>\n              <li><a href=\"#Command-line-completion\">Command line completion.</a></li>\n              <li><a href=\"#Horizontal-scrolling\">Horizontal scrolling.</a></li>\n              <li><a href=\"#Unicode-and-internationalization-improvements\">Unicode and internationalization improvements.</a></li>\n            </ul>\n          </li>\n          <li><a href=\"#Advanced-user-features\">Advanced user features:</a>\n            <ul>\n              <li><a href=\"#Text-formatting\">Text formatting</a></li>\n              <li><a href=\"#Completion-in-Insert-mode\">Completion in Insert mode</a></li>\n              <li><a href=\"#Jump-tags\">Jump tags</a></li>\n              <li><a href=\"#Automatic-commands\">Automatic commands</a></li>\n              <li><a href=\"#Viminfo\">Viminfo</a></li>\n              <li><a href=\"#Mouse-support\">Mouse support</a></li>\n              <li><a href=\"#Graphical-User-Interface-GUI\">Graphical User Interface (GUI)</a></li>\n              <li><a href=\"#Scripting-language\">Scripting language</a></li>\n              <li><a href=\"#Plugins\">Plugins</a></li>\n              <li><a href=\"#Syntax-highlighting-for-many-programming-languages\">Syntax highlighting for many programming languages</a></li>\n              <li><a href=\"#Extended-regular-expressions\">Extended regular expressions</a></li>\n              <li><a href=\"#Integrated-Spell-checking\">Integrated Spell checking</a></li>\n              <li><a href=\"#Diff-mode\">Diff mode</a></li>\n              <li><a href=\"#Encryption-using-the-blowfish-algorithm\">Encryption using the blowfish algorithm</a></li>\n              <li><a href=\"#Extensive-customizable\">Extensive customizable</a></li>\n              <li><a href=\"#Packages\">Packages</a></li>\n            </ul>\n          </li>\n          <li><a href=\"#Programming-performance-features\">Programming performance features:</a>\n            <ul>\n              <li><a href=\"#Edit-compile-edit-speedup\">Edit-compile-edit speedup</a></li>\n              <li><a href=\"#Indenting-for-many-programming-languages\">Indenting for many programming languages</a></li>\n              <li><a href=\"#Searching-for-words-in-include-files\">Searching for words in include files</a></li>\n              <li><a href=\"#Advanced-text-objects\">Advanced text objects</a></li>\n              <li><a href=\"#Folding\">Folding</a></li>\n              <li><a href=\"#ctags-and-cscope-integration\">ctags and cscope integration</a></li>\n              <li><a href=\"#Integration-of-several-programming-languages\">Integration of several programming languages</a></li>\n              <li><a href=\"#Asynchronous-I-O-support\">Asynchronous I/O support</a></li>\n              <li><a href=\"#Timers\">Timers</a></li>\n            </ul>\n          </li>\n          <li><a href=\"#For-more-information-read\">For more information, read:</a></li>\n        </ul>\n      </li>\n      <li><a href=\"#Is-Vim-free\">1.5. Is Vim free?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#RESOURCES1\">RESOURCES</a>\n    <ul>\n      <li><a href=\"#Where-can-I-learn-more-about-Vim\">2.1. Where can I learn more about Vim?</a></li>\n      <li><a href=\"#Is-there-a-mailing-list-available\">2.2. Is there a mailing list available?</a></li>\n      <li><a href=\"#Is-there-an-archive-available-for-the-Vim-mailing-lists\">2.3. Is there an archive available for the Vim mailing lists?</a></li>\n      <li><a href=\"#Where-can-I-get-the-Vim-user-manual-in-HTML-PDF-PS-format\">2.4. Where can I get the Vim user manual in HTML/PDF/PS format?</a></li>\n      <li><a href=\"#I-have-a-xyz-some-problem-with-Vim.-How-do-I-determine-if-it-is-a-problem-with-my-setup-or-with-Vim-Have-I-found-a-bug-in-Vim\">2.5. I have a &quot;xyz&quot; (some) problem with Vim. How do I determine if it is a problem with my setup or with Vim? / Have I found a bug in Vim?</a></li>\n      <li><a href=\"#Where-can-I-report-bugs\">2.6. Where can I report bugs?</a></li>\n      <li><a href=\"#Where-can-the-FAQ-be-found\">2.7. Where can the FAQ be found?</a></li>\n      <li><a href=\"#What-if-I-dont-find-an-answer-in-this-FAQ\">2.8. What if I don&#39;t find an answer in this FAQ?</a></li>\n      <li><a href=\"#I-have-a-patch-for-implementing-a-Vim-feature.-Where-can-I-send-this-patch\">2.9. I have a patch for implementing a Vim feature. Where can I send this patch?</a></li>\n      <li><a href=\"#I-have-a-Vim-tip-or-developed-a-new-Vim-syntax-indent-filetype-compiler-plugin-or-developed-a-new-script-or-a-colorscheme.-Is-there-a-public-website-where-I-can-upload-this\">2.10. I have a Vim tip or developed a new Vim syntax/indent/filetype/ compiler plugin or developed a new script or a colorscheme. Is there a public website where I can upload this?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#AVAILABILITY1\">AVAILABILITY</a>\n    <ul>\n      <li><a href=\"#What-is-the-latest-version-of-Vim\">3.1. What is the latest version of Vim?</a></li>\n      <li><a href=\"#Where-can-I-find-the-latest-version-of-Vim\">3.2. Where can I find the latest version of Vim?</a></li>\n      <li><a href=\"#What-platforms-does-it-run-on\">3.3. What platforms does it run on?</a></li>\n      <li><a href=\"#Where-can-I-download-the-latest-version-of-the-Vim-runtime-files\">3.4. Where can I download the latest version of the Vim runtime files?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#HELP1\">HELP</a>\n    <ul>\n      <li><a href=\"#How-do-I-use-the-help-files\">4.1. How do I use the help files?</a></li>\n      <li><a href=\"#How-do-I-search-for-a-keyword-in-the-Vim-help-files\">4.2. How do I search for a keyword in the Vim help files?</a></li>\n      <li><a href=\"#I-am-getting-an-error-message-E123-what-did-I-do-wrong\">4.3. I am getting an error message E123, what did I do wrong?</a></li>\n      <li><a href=\"#Where-can-I-read-about-the-various-modes-in-Vim\">4.4. Where can I read about the various modes in Vim?</a></li>\n      <li><a href=\"#How-do-I-generate-the-Vim-help-tags-file-after-adding-a-new-Vim-help-file\">4.5. How do I generate the Vim help tags file after adding a new Vim help file?</a></li>\n      <li><a href=\"#Can-I-use-compressed-versions-of-the-help-files\">4.6. Can I use compressed versions of the help files?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#EDITING-A-FILE1\">EDITING A FILE</a>\n    <ul>\n      <li><a href=\"#How-do-I-load-a-file-in-Vim-for-editing\">5.1. How do I load a file in Vim for editing?</a></li>\n      <li><a href=\"#How-do-I-save-the-current-file-in-another-name-save-as-and-edit-a-new-file\">5.2. How do I save the current file in another name (save as) and edit a new file?</a></li>\n      <li><a href=\"#How-do-I-change-the-current-directory-to-the-directory-of-the-current-file\">5.3. How do I change the current directory to the directory of the current file?</a></li>\n      <li><a href=\"#How-do-I-write-a-file-without-the-line-feed-EOL-at-the-end-of-the-file\">5.4. How do I write a file without the line feed (EOL) at the end of the file?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-open-a-file-at-the-last-edited-location\">5.5. How do I configure Vim to open a file at the last edited location?</a></li>\n      <li><a href=\"#When-editing-a-file-in-Vim-which-is-being-changed-by-an-external-application-Vim-opens-a-warning-window-like-the-confirm-dialog-each-time-a-change-is-detected.-How-do-I-disable-this-warning\">5.6. When editing a file in Vim, which is being changed by an external application, Vim opens a warning window (like the confirm dialog) each time a change is detected. How do I disable this warning?</a></li>\n      <li><a href=\"#How-do-I-edit-a-file-whose-name-is-under-the-cursor\">5.7. How do I edit a file whose name is under the cursor?</a></li>\n      <li><a href=\"#How-do-I-reload-re-edit-the-current-file\">5.8. How do I reload/re-edit the current file?</a></li>\n      <li><a href=\"#How-do-I-autosave-a-file-periodically\">5.9. How do I autosave a file periodically?</a></li>\n      <li><a href=\"#How-do-I-open-a-file-in-read-only-mode\">5.10. How do I open a file in read-only mode?</a></li>\n      <li><a href=\"#How-do-I-open-a-file-for-editing-without-saving-the-modifications-to-the-current-file\">5.11. How do I open a file for editing without saving the modifications to the current file?</a></li>\n      <li><a href=\"#How-do-I-reduce-the-loading-time-for-very-large-files-in-Vim\">5.12. How do I reduce the loading time for very large files in Vim?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#EDITING-MULTIPLE-FILES1\">EDITING MULTIPLE FILES</a>\n    <ul>\n      <li><a href=\"#How-do-I-open-multiple-files-at-once-from-within-Vim\">6.1. How do I open multiple files at once from within Vim?</a></li>\n      <li><a href=\"#How-do-I-switch-between-multiple-files-buffers-in-Vim\">6.2. How do I switch between multiple files/buffers in Vim?</a></li>\n      <li><a href=\"#How-do-I-open-several-files-in-Vim-with-each-file-in-a-separate-window-tab\">6.3. How do I open several files in Vim, with each file in a separate window/tab?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-autoload-several-files-at-once-similar-to-work-sets-or-projects\">6.4. How do I configure Vim to autoload several files at once similar to &quot;work-sets&quot; or &quot;projects&quot;?</a></li>\n      <li><a href=\"#Is-it-possible-to-open-multiple-top-level-windows-in-a-single-instance-of-Vim-similar-to-Nedit-or-Emacs\">6.5. Is it possible to open multiple top level windows in a single instance of Vim similar to Nedit or Emacs?</a></li>\n      <li><a href=\"#How-do-I-browse-explore-directories-from-within-Vim\">6.6. How do I browse/explore directories from within Vim?</a></li>\n      <li><a href=\"#How-do-I-edit-files-over-a-network-using-ftp-scp-rcp-http\">6.7. How do I edit files over a network using ftp/scp/rcp/http?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#BACKUP1\">BACKUP</a>\n    <ul>\n      <li><a href=\"#When-I-edit-and-save-files-Vim-creates-a-file-with-the-same-name-as-the-original-file-and-a-character-at-the-end.-How-do-I-stop-Vim-from-creating-this-file-or-How-do-I-disable-the-Vim-backup-file-feature\">7.1. When I edit and save files, Vim creates a file with the same name as the original file and a &quot;~&quot; character at the end. How do I stop Vim from creating this file? (or) How do I disable the Vim backup file feature?</a></li>\n      <li><a href=\"#When-I-edit-and-save-files-Vim-creates-a-file-with-the-same-name-as-the-original-file-and-a-un-extension-at-the-end.-How-do-I-stop-Vim-from-creating-this-file-or-How-do-I-disable-the-Vim-undofile-feature\">7.2. When I edit and save files, Vim creates a file with the same name as the original file and a &quot;un~&quot; extension at the end. How do I stop Vim from creating this file (or) How do I disable the Vim undofile feature?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-store-all-the-backup-files-in-a-particular-directory\">7.3. How do I configure Vim to store all the backup files in a particular directory?</a></li>\n      <li><a href=\"#When-I-save-a-file-with-Vim-the-file-permissions-are-changed.-How-do-I-configure-Vim-to-save-a-file-without-changing-the-file-permissions\">7.4. When I save a file with Vim, the file permissions are changed. How do I configure Vim to save a file without changing the file permissions?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#BUFFERS1\">BUFFERS</a>\n    <ul>\n      <li><a href=\"#I-have-made-some-modifications-to-a-buffer.-How-do-I-edit-another-buffer-without-saving-the-modified-buffer-and-also-without-losing-the-modifications\">8.1. I have made some modifications to a buffer. How do I edit another buffer without saving the modified buffer and also without losing the modifications?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-auto-save-a-modified-buffer-when-switching-to-another-buffer\">8.2. How do I configure Vim to auto-save a modified buffer when switching to another buffer?</a></li>\n      <li><a href=\"#How-do-I-replace-the-buffer-in-the-current-window-with-a-blank-buffer\">8.3. How do I replace the buffer in the current window with a blank buffer?</a></li>\n      <li><a href=\"#Is-there-a-keyboard-shortcut-to-load-a-buffer-by-the-buffer-number\">8.4. Is there a keyboard shortcut to load a buffer by the buffer number?</a></li>\n      <li><a href=\"#How-do-I-open-all-the-current-buffers-in-separate-windows\">8.5. How do I open all the current buffers in separate windows?</a></li>\n      <li><a href=\"#How-do-I-close-delete-a-buffer-without-exiting-Vim\">8.6. How do I close (delete) a buffer without exiting Vim?</a></li>\n      <li><a href=\"#When-I-use-the-command-%3A-bd-to-delete-all-the-buffers-not-all-the-buffers-are-deleted.-Why\">8.7. When I use the command `:%bd` to delete all the buffers, not all the buffers are deleted. Why?</a></li>\n      <li><a href=\"#How-do-I-display-the-buffer-number-of-the-current-buffer-file\">8.8. How do I display the buffer number of the current buffer/file?</a></li>\n      <li><a href=\"#How-do-I-delete-a-buffer-without-closing-the-window-in-which-the-buffer-is-displayed\">8.9. How do I delete a buffer without closing the window in which the buffer is displayed?</a></li>\n      <li><a href=\"#How-do-I-map-the-Tab-key-to-cycle-through-and-open-all-the-buffers\">8.10. How do I map the &lt;Tab&gt; key to cycle through and open all the buffers?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#WINDOWS1\">WINDOWS</a>\n    <ul>\n      <li><a href=\"#What-is-the-difference-between-a-Vim-window-and-a-buffer\">9.1. What is the difference between a Vim window and a buffer?</a></li>\n      <li><a href=\"#How-do-I-increase-the-width-of-a-Vim-window\">9.2. How do I increase the width of a Vim window?</a></li>\n      <li><a href=\"#How-do-I-zoom-into-or-out-of-a-window\">9.3. How do I zoom into or out of a window?</a></li>\n      <li><a href=\"#How-do-I-execute-an-ex-command-on-all-the-open-buffers-or-open-windows-or-all-the-files-in-the-argument-list\">9.4. How do I execute an ex command on all the open buffers or open windows or all the files in the argument list?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#MOTION1\">MOTION</a>\n    <ul>\n      <li><a href=\"#How-do-I-jump-to-the-beginning-first-line-or-end-last-line-of-a-file\">10.1. How do I jump to the beginning (first line) or end (last line) of a file?</a></li>\n      <li><a href=\"#In-insert-mode-when-I-press-the-Esc-key-to-go-to-command-mode-the-cursor-moves-one-character-to-the-left-except-when-the-cursor-is-on-the-first-character-of-the-line-.-Is-it-possible-to-change-this-behavior-to-keep-the-cursor-at-the-same-column\">10.2. In insert mode, when I press the &lt;Esc&gt; key to go to command mode, the cursor moves one character to the left (except when the cursor is on the first character of the line). Is it possible to change this behavior to keep the cursor at the same column?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-maintain-the-horizontal-cursor-position-when-scrolling-with-the-Page-Up-Page-Down-etc-keys\">10.3. How do I configure Vim to maintain the horizontal cursor position when scrolling with the &lt;Page Up&gt;, &lt;Page Down&gt;, etc keys?</a></li>\n      <li><a href=\"#Some-lines-in-a-file-are-more-than-the-screen-width-and-they-are-all-wrapped.-When-I-use-the-j-k-keys-to-move-from-one-line-to-the-next-the-cursor-is-moved-to-the-next-line-in-the-file-instead-of-the-next-line-on-the-screen.-How-do-I-move-from-one-screen-line-to-the-next\">10.4. Some lines in a file are more than the screen width and they are all wrapped. When I use the j, k keys to move from one line to the next, the cursor is moved to the next line in the file instead of the next line on the screen. How do I move from one screen line to the next?</a></li>\n      <li><a href=\"#What-is-the-definition-of-a-sentence-paragraph-and-section-in-Vim\">10.5. What is the definition of a sentence, paragraph and section in Vim?</a></li>\n      <li><a href=\"#How-do-I-jump-to-beginning-or-end-of-a-sentence-paragraph-or-a-section\">10.6. How do I jump to beginning or end of a sentence, paragraph or a section?</a></li>\n      <li><a href=\"#I-have-lines-in-a-file-that-extends-beyond-the-right-extent-of-the-screen.-How-do-I-move-the-Vim-view-to-the-right-to-see-the-text-off-the-screen\">10.7. I have lines in a file that extends beyond the right extent of the screen. How do I move the Vim view to the right to see the text off the screen?</a></li>\n      <li><a href=\"#How-do-I-scroll-two-or-more-buffers-simultaneously\">10.8. How do I scroll two or more buffers simultaneously?</a></li>\n      <li><a href=\"#When-I-use-my-arrow-keys-Vim-changes-modes-inserts-weird-characters-in-my-document-but-doesnt-move-the-cursor-properly.-Whats-going-on\">10.9. When I use my arrow keys, Vim changes modes, inserts weird characters in my document but doesn&#39;t move the cursor properly. What&#39;s going on?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-move-the-cursor-to-the-end-of-the-previous-line-when-the-left-arrow-key-is-pressed-and-the-cursor-is-currently-at-the-beginning-of-a-line\">10.10. How do I configure Vim to move the cursor to the end of the previous line, when the left arrow key is pressed and the cursor is currently at the beginning of a line?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-stay-only-in-insert-mode-modeless-editing\">10.11. How do I configure Vim to stay only in insert mode (modeless editing)?</a></li>\n      <li><a href=\"#How-do-I-display-some-context-lines-when-scrolling-text\">10.12. How do I display some context lines when scrolling text?</a></li>\n      <li><a href=\"#How-do-I-go-back-to-previous-cursor-locations\">10.13. How do I go back to previous cursor locations?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#SEARCHING-TEXT1\">SEARCHING TEXT</a>\n    <ul>\n      <li><a href=\"#After-I-searched-for-a-text-with-a-pattern-all-the-matched-text-stays-highlighted.-How-do-I-turn-off-the-highlighting-temporarily-permanently\">11.1. After I searched for a text with a pattern, all the matched text stays highlighted. How do I turn off the highlighting temporarily/permanently?</a></li>\n      <li><a href=\"#How-do-I-enter-a-carriage-return-character-in-a-search-pattern\">11.2. How do I enter a carriage return character in a search pattern?</a></li>\n      <li><a href=\"#How-do-I-search-for-the-character-M\">11.3. How do I search for the character ^M?</a></li>\n      <li><a href=\"#How-can-I-search-replace-characters-that-display-as-R-S-etc\">11.4. How can I search/replace characters that display as &quot;~R&quot;, &quot;~S&quot;, etc.?</a></li>\n      <li><a href=\"#How-do-I-highlight-all-the-non-printable-characters-in-a-file\">11.5. How do I highlight all the non-printable characters in a file?</a></li>\n      <li><a href=\"#How-do-I-search-for-whole-words-in-a-file\">11.6. How do I search for whole words in a file?</a></li>\n      <li><a href=\"#How-do-I-search-for-the-current-word-under-the-cursor\">11.7. How do I search for the current word under the cursor?</a></li>\n      <li><a href=\"#How-do-I-search-for-a-word-without-regard-to-the-case-uppercase-or-lowercase\">11.8. How do I search for a word without regard to the case (uppercase or lowercase)?</a></li>\n      <li><a href=\"#How-do-I-search-for-words-that-occur-twice-consecutively\">11.9. How do I search for words that occur twice consecutively?</a></li>\n      <li><a href=\"#How-do-I-count-the-number-of-times-a-particular-word-occurs-in-a-buffer\">11.10. How do I count the number of times a particular word occurs in a buffer?</a></li>\n      <li><a href=\"#How-do-I-place-the-cursor-at-the-end-of-the-matched-word-when-searching-for-a-pattern\">11.11. How do I place the cursor at the end of the matched word when searching for a pattern?</a></li>\n      <li><a href=\"#How-do-I-search-for-an-empty-line\">11.12. How do I search for an empty line?</a></li>\n      <li><a href=\"#How-do-I-search-for-a-line-containing-only-a-single-character\">11.13. How do I search for a line containing only a single character?</a></li>\n      <li><a href=\"#How-do-I-search-and-replace-a-string-in-multiple-files\">11.14. How do I search and replace a string in multiple files?</a></li>\n      <li><a href=\"#I-am-using-the-%3As-substitute-command-in-a-mapping.-When-a-search-for-a-pattern-fails-the-map-terminates.-I-would-like-the-map-to-continue-processing-the-next-command-even-if-the-substitute-command-fails.-How-do-I-do-this\">11.15. I am using the `:s` substitute command in a mapping. When a search for a pattern fails, the map terminates. I would like the map to continue processing the next command, even if the substitute command fails. How do I do this?</a></li>\n      <li><a href=\"#How-do-I-search-for-the-n-th-occurrence-of-a-character-in-a-line\">11.16. How do I search for the n-th occurrence of a character in a line?</a></li>\n      <li><a href=\"#How-do-I-replace-a-tab-or-any-other-character-with-a-hard-return-newline-character\">11.17. How do I replace a tab (or any other character) with a hard return (newline) character?</a></li>\n      <li><a href=\"#How-do-I-search-for-a-character-by-its-ASCII-value\">11.18. How do I search for a character by its ASCII value?</a></li>\n      <li><a href=\"#How-do-I-search-for-long-lines\">11.19. How do I search for long lines?</a></li>\n      <li><a href=\"#How-do-I-display-all-the-lines-in-the-current-buffer-that-contain-a-specified-pattern\">11.20. How do I display all the lines in the current buffer that contain a specified pattern?</a></li>\n      <li><a href=\"#How-do-I-search-for-a-text-string-that-spans-multiple-lines\">11.21. How do I search for a text string that spans multiple lines?</a></li>\n      <li><a href=\"#How-do-I-search-for-a-pattern-within-the-specified-range-of-lines-in-a-buffer\">11.22. How do I search for a pattern within the specified range of lines in a buffer?</a></li>\n      <li><a href=\"#How-do-I-clear-the-last-searched-pattern\">11.23. How do I clear the last searched pattern?</a></li>\n      <li><a href=\"#Why-does-this-pattern-a.---p-not-match\">11.24. Why does this pattern &quot;a.\\{-}p\\@!&quot; not match?</a></li>\n      <li><a href=\"#How-can-I-use-within-a-pattern-without-escaping-it\">11.25. How can I use &quot;/&quot; within a pattern, without escaping it?</a></li>\n      <li><a href=\"#How-can-I-operate-on-a-search-match\">11.26. How can I operate on a search match?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#CHANGING-TEXT1\">CHANGING TEXT</a>\n    <ul>\n      <li><a href=\"#How-do-I-delete-all-the-trailing-white-space-characters-SPACE-and-TAB-at-the-end-of-all-the-lines-in-a-file\">12.1. How do I delete all the trailing white space characters (SPACE and TAB) at the end of all the lines in a file?</a></li>\n      <li><a href=\"#How-do-I-replace-all-the-occurrences-of-multiple-consecutive-space-characters-to-a-single-space\">12.2. How do I replace all the occurrences of multiple consecutive space characters to a single space?</a></li>\n      <li><a href=\"#How-do-I-reduce-a-range-of-empty-lines-into-one-line-only\">12.3. How do I reduce a range of empty lines into one line only?</a></li>\n      <li><a href=\"#How-do-I-delete-all-blank-lines-in-a-file-How-do-I-remove-all-the-lines-containing-only-space-characters\">12.4. How do I delete all blank lines in a file? How do I remove all the lines containing only space characters?</a></li>\n      <li><a href=\"#How-do-I-copy-yank-the-current-word\">12.5. How do I copy/yank the current word?</a></li>\n      <li><a href=\"#How-do-I-yank-text-from-one-position-to-another-position-within-a-line-without-yanking-the-entire-line\">12.6. How do I yank text from one position to another position within a line, without yanking the entire line?</a></li>\n      <li><a href=\"#When-I-yank-some-text-into-a-register-how-do-I-append-the-text-to-the-current-contents-of-the-register\">12.7. When I yank some text into a register, how do I append the text to the current contents of the register?</a></li>\n      <li><a href=\"#How-do-I-yank-a-complete-sentence-that-spans-over-more-than-one-line\">12.8. How do I yank a complete sentence that spans over more than one line?</a></li>\n      <li><a href=\"#How-do-I-yank-all-the-lines-containing-a-pattern-into-a-buffer\">12.9. How do I yank all the lines containing a pattern into a buffer?</a></li>\n      <li><a href=\"#How-do-I-delete-all-the-lines-in-a-file-that-do-not-contain-a-pattern\">12.10. How do I delete all the lines in a file that do not contain a pattern?</a></li>\n      <li><a href=\"#How-do-I-add-a-line-before-each-line-with-pattern-in-it\">12.11. How do I add a line before each line with &quot;pattern&quot; in it?</a></li>\n      <li><a href=\"#Is-there-a-way-to-operate-on-a-line-if-the-previous-line-contains-a-particular-pattern\">12.12. Is there a way to operate on a line if the previous line contains a particular pattern?</a></li>\n      <li><a href=\"#How-do-I-execute-a-command-on-all-the-lines-containing-a-pattern\">12.13. How do I execute a command on all the lines containing a pattern?</a></li>\n      <li><a href=\"#Can-I-copy-the-character-above-the-cursor-to-the-current-cursor-position\">12.14. Can I copy the character above the cursor to the current cursor position?</a></li>\n      <li><a href=\"#How-do-I-insert-a-blank-line-above-below-the-current-line-without-entering-insert-mode\">12.15. How do I insert a blank line above/below the current line without entering insert mode?</a></li>\n      <li><a href=\"#How-do-I-insert-the-name-of-the-current-file-into-the-current-buffer\">12.16. How do I insert the name of the current file into the current buffer?</a></li>\n      <li><a href=\"#How-do-I-insert-the-contents-of-a-Vim-register-into-the-current-buffer\">12.17. How do I insert the contents of a Vim register into the current buffer?</a></li>\n      <li><a href=\"#How-do-I-move-the-cursor-past-the-end-of-line-and-insert-some-characters-at-some-columns-after-the-end-of-the-line\">12.18. How do I move the cursor past the end of line and insert some characters at some columns after the end of the line?</a></li>\n      <li><a href=\"#How-to-replace-the-word-under-the-cursor-say%3A-junk-with-foojunkbar-in-Vim\">12.19. How to replace the word under the cursor (say: junk) with &quot;foojunkbar&quot; in Vim?</a></li>\n      <li><a href=\"#How-do-I-replace-a-particular-text-in-all-the-files-in-a-directory\">12.20. How do I replace a particular text in all the files in a directory?</a></li>\n      <li><a href=\"#I-have-some-numbers-in-a-file.-How-do-I-increment-or-decrement-the-numbers-in-the-file\">12.21. I have some numbers in a file. How do I increment or decrement the numbers in the file?</a></li>\n      <li><a href=\"#How-do-I-reuse-the-last-used-search-pattern-in-a-%3Asubstitute-command\">12.22. How do I reuse the last used search pattern in a `:substitute` command?</a></li>\n      <li><a href=\"#How-do-I-change-the-case-of-a-string-using-the-%3Asubstitute-command\">12.23. How do I change the case of a string using the `:substitute` command?</a></li>\n      <li><a href=\"#How-do-I-enter-characters-that-are-not-present-in-the-keyboard\">12.24. How do I enter characters that are not present in the keyboard?</a></li>\n      <li><a href=\"#Is-there-a-command-to-remove-any-or-all-digraphs\">12.25. Is there a command to remove any or all digraphs?</a></li>\n      <li><a href=\"#In-insert-mode-when-I-press-the-backspace-key-it-erases-only-the-characters-entered-in-this-instance-of-insert-mode.-How-do-I-erase-previously-entered-characters-in-insert-mode-using-the-backspace-key\">12.26. In insert mode, when I press the backspace key, it erases only the characters entered in this instance of insert mode. How do I erase previously entered characters in insert mode using the backspace key?</a></li>\n      <li><a href=\"#I-have-a-file-which-has-lines-longer-than-72-characters-terminated-with-and-wrapped-to-the-next-line.-How-can-I-quickly-join-the-lines\">12.27. I have a file which has lines longer than 72 characters terminated with &quot;+&quot; and wrapped to the next line. How can I quickly join the lines?</a></li>\n      <li><a href=\"#How-do-I-paste-characterwise-yanked-text-into-separate-lines\">12.28. How do I paste characterwise yanked text into separate lines?</a></li>\n      <li><a href=\"#How-do-I-change-the-case-uppercase-lowercase-of-a-word-or-a-character-or-a-block-of-text\">12.29. How do I change the case (uppercase, lowercase) of a word or a character or a block of text?</a></li>\n      <li><a href=\"#How-do-I-enter-ASCII-characters-that-are-not-present-in-the-keyboard\">12.30. How do I enter ASCII characters that are not present in the keyboard?</a></li>\n      <li><a href=\"#How-do-I-replace-non-printable-characters-in-a-file\">12.31. How do I replace non-printable characters in a file?</a></li>\n      <li><a href=\"#How-do-I-remove-duplicate-lines-from-a-buffer\">12.32. How do I remove duplicate lines from a buffer?</a></li>\n      <li><a href=\"#How-do-I-prefix-all-the-lines-in-a-file-with-the-corresponding-line-numbers\">12.33. How do I prefix all the lines in a file with the corresponding line numbers?</a></li>\n      <li><a href=\"#How-do-I-exchange-swap-two-characters-or-words-or-lines\">12.34. How do I exchange (swap) two characters or words or lines?</a></li>\n      <li><a href=\"#How-do-I-change-the-characters-used-as-word-delimiters\">12.35. How do I change the characters used as word delimiters?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#COMPLETION-IN-INSERT-MODE1\">COMPLETION IN INSERT MODE</a>\n    <ul>\n      <li><a href=\"#How-do-I-complete-words-or-lines-in-insert-mode\">13.1. How do I complete words or lines in insert mode?</a></li>\n      <li><a href=\"#How-do-I-complete-file-names-in-insert-mode\">13.2. How do I complete file names in insert mode?</a></li>\n      <li><a href=\"#I-am-using-CTRL-P-CTRL-N-to-complete-words-in-insert-mode.-How-do-I-complete-words-that-occur-after-the-just-completed-word\">13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do I complete words that occur after the just completed word?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#TEXT-FORMATTING1\">TEXT FORMATTING</a>\n    <ul>\n      <li><a href=\"#How-do-I-format-a-text-paragraph-so-that-a-new-line-is-inserted-at-the-end-of-each-wrapped-line\">14.1. How do I format a text paragraph so that a new line is inserted at the end of each wrapped line?</a></li>\n      <li><a href=\"#How-do-I-format-long-lines-in-a-file-so-that-each-line-contains-less-than-n-characters\">14.2. How do I format long lines in a file so that each line contains less than &quot;n&quot; characters?</a></li>\n      <li><a href=\"#How-do-I-join-short-lines-to-form-a-paragraph\">14.3. How do I join short lines to form a paragraph?</a></li>\n      <li><a href=\"#How-do-I-format-bulleted-and-numbered-lists\">14.4. How do I format bulleted and numbered lists?</a></li>\n      <li><a href=\"#How-do-I-indent-lines-in-insert-mode\">14.5. How do I indent lines in insert mode?</a></li>\n      <li><a href=\"#How-do-I-format-indent-an-entire-file\">14.6. How do I format/indent an entire file?</a></li>\n      <li><a href=\"#How-do-I-increase-or-decrease-the-indentation-of-the-current-line\">14.7. How do I increase or decrease the indentation of the current line?</a></li>\n      <li><a href=\"#How-do-I-indent-a-block-group-of-lines\">14.8. How do I indent a block/group of lines?</a></li>\n      <li><a href=\"#When-I-indent-lines-using-the-or-key-the-standard-8-tabstops-are-used-instead-of-the-current-tabstop-setting.-Why\">14.9. When I indent lines using the &gt; or &lt; key, the standard 8-tabstops are used instead of the current &#39;tabstop&#39; setting. Why?</a></li>\n      <li><a href=\"#How-do-I-turn-off-the-automatic-indentation-of-text\">14.10. How do I turn off the automatic indentation of text?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-automatically-set-the-textwidth-option-to-a-particular-value-when-I-edit-mails\">14.11. How do I configure Vim to automatically set the &#39;textwidth&#39; option to a particular value when I edit mails?</a></li>\n      <li><a href=\"#Is-there-a-way-to-make-Vim-auto-magically-break-lines\">14.12. Is there a way to make Vim auto-magically break lines?</a></li>\n      <li><a href=\"#I-am-seeing-a-lot-of-M-symbols-in-my-file.-I-tried-setting-the-fileformat-option-to-dos-and-then-unix-and-then-mac.-None-of-these-helped.-How-can-I-hide-these-symbols\">14.13. I am seeing a lot of ^M symbols in my file. I tried setting the &#39;fileformat&#39; option to &quot;dos&quot; and then &quot;unix&quot; and then &quot;mac&quot;. None of these helped. How can I hide these symbols?</a></li>\n      <li><a href=\"#When-I-paste-some-text-into-a-Vim-buffer-from-another-application-the-alignment-indentation-of-the-new-text-is-messed-up.-How-do-I-fix-this\">14.14. When I paste some text into a Vim buffer from another application, the alignment (indentation) of the new text is messed up. How do I fix this?</a></li>\n      <li><a href=\"#When-there-is-a-very-long-wrapped-line-wrap-is-on-and-a-line-doesnt-fit-entirely-on-the-screen-it-is-not-displayed-at-all.-There-are-blank-lines-beginning-with-symbol-instead-of-wrapped-line.-If-I-scroll-the-screen-to-fit-the-line-the-symbols-disappear-and-the-line-is-displayed-again.-What-Vim-setting-control-this-behavior\">14.15. When there is a very long wrapped line (wrap is &quot;on&quot;) and a line doesn&#39;t fit entirely on the screen it is not displayed at all. There are blank lines beginning with &quot;@&quot; symbol instead of wrapped line. If I scroll the screen to fit the line the &quot;@&quot; symbols disappear and the line is displayed again. What Vim setting control this behavior?</a></li>\n      <li><a href=\"#How-do-I-convert-all-the-tab-characters-in-a-file-to-space-characters\">14.16. How do I convert all the tab characters in a file to space characters?</a></li>\n      <li><a href=\"#What-Vim-options-can-I-use-to-edit-text-that-will-later-go-to-a-word-processor\">14.17. What Vim options can I use to edit text that will later go to a word processor?</a></li>\n      <li><a href=\"#How-do-I-join-lines-without-adding-or-removing-any-space-characters\">14.18. How do I join lines without adding or removing any space characters?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#VISUAL-MODE1\">VISUAL MODE</a>\n    <ul>\n      <li><a href=\"#How-do-I-do-rectangular-block-copying\">15.1. How do I do rectangular block copying?</a></li>\n      <li><a href=\"#How-do-I-delete-or-change-a-column-of-text-in-a-file\">15.2. How do I delete or change a column of text in a file?</a></li>\n      <li><a href=\"#How-do-I-apply-an-ex-command-on-a-set-of-visually-selected-lines\">15.3. How do I apply an ex-command on a set of visually selected lines?</a></li>\n      <li><a href=\"#How-do-I-execute-an-ex-command-on-a-column-of-text-selected-in-Visual-block-mode\">15.4. How do I execute an ex command on a column of text selected in Visual block mode?</a></li>\n      <li><a href=\"#How-do-I-select-the-entire-file-in-visual-mode\">15.5. How do I select the entire file in visual mode?</a></li>\n      <li><a href=\"#When-I-visually-select-a-set-of-lines-and-press-the-key-to-indent-the-selected-lines-the-visual-mode-ends.-How-can-I-reselect-the-region-for-further-operation-or-How-do-I-re-select-the-last-selected-visual-area-again\">15.6. When I visually select a set of lines and press the &gt; key to indent the selected lines, the visual mode ends. How can I reselect the region for further operation? (or) How do I re-select the last selected visual area again?</a></li>\n      <li><a href=\"#How-do-I-jump-to-the-beginning-end-of-a-visually-selected-region\">15.7. How do I jump to the beginning/end of a visually selected region?</a></li>\n      <li><a href=\"#When-I-select-text-with-mouse-and-then-press-%3A-to-enter-an-ex-command-the-selected-text-is-replaced-with-the-%3A-character.-How-do-I-execute-an-ex-command-on-a-text-selected-using-the-mouse-similar-to-the-text-selected-using-the-visual-mode\">15.8. When I select text with mouse and then press : to enter an ex command, the selected text is replaced with the : character. How do I execute an ex command on a text selected using the mouse similar to the text selected using the visual mode?</a></li>\n      <li><a href=\"#When-I-select-a-block-of-text-using-the-mouse-Vim-goes-into-selection-mode-instead-of-Visual-mode.-Why\">15.9. When I select a block of text using the mouse, Vim goes into selection mode instead of Visual mode. Why?</a></li>\n      <li><a href=\"#How-do-I-visually-select-the-last-copy-pasted-text\">15.10. How do I visually select the last copy/pasted text?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#COMMAND-LINE-MODE1\">COMMAND-LINE MODE</a>\n    <ul>\n      <li><a href=\"#How-do-I-use-the-name-of-the-current-file-in-the-command-mode-or-an-ex-command-line\">16.1. How do I use the name of the current file in the command mode or an ex command line?</a></li>\n      <li><a href=\"#How-do-I-edit-the-text-in-the-Vim-command-line-effectively\">16.2. How do I edit the text in the Vim command-line effectively?</a></li>\n      <li><a href=\"#How-do-I-switch-from-Vi-mode-to-Ex-mode\">16.3. How do I switch from Vi mode to Ex mode?</a></li>\n      <li><a href=\"#How-do-I-copy-the-output-from-an-ex-command-into-a-buffer\">16.4. How do I copy the output from an ex-command into a buffer?</a></li>\n      <li><a href=\"#When-I-press-the-Tab-key-to-complete-the-name-of-a-file-in-the-command-mode-if-there-are-more-than-one-matching-file-names-then-Vim-completes-the-first-matching-file-name-and-displays-a-list-of-all-matching-filenames.-How-do-I-configure-Vim-to-only-display-the-list-of-all-the-matching-filenames-and-not-complete-the-first-one\">16.5. When I press the &lt;Tab&gt; key to complete the name of a file in the command mode, if there are more than one matching file names, then Vim completes the first matching file name and displays a list of all matching filenames. How do I configure Vim to only display the list of all the matching filenames and not complete the first one?</a></li>\n      <li><a href=\"#How-do-I-copy-text-from-a-buffer-to-the-command-line-and-from-the-command-line-to-a-buffer\">16.6. How do I copy text from a buffer to the command line and from the command line to a buffer?</a></li>\n      <li><a href=\"#How-do-I-put-a-command-onto-the-command-history-without-executing-it\">16.7. How do I put a command onto the command history without executing it?</a></li>\n      <li><a href=\"#How-do-I-increase-the-height-of-the-command-line\">16.8. How do I increase the height of the command-line?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#VIMINFO1\">VIMINFO</a>\n    <ul>\n      <li><a href=\"#When-I-invoke-Vim-I-get-error-messages-about-illegal-characters-in-the-viminfo-file.-What-should-I-do-to-get-rid-of-these-messages\">17.1. When I invoke Vim, I get error messages about illegal characters in the viminfo file. What should I do to get rid of these messages?</a></li>\n      <li><a href=\"#How-do-I-disable-the-viminfo-feature\">17.2. How do I disable the viminfo feature?</a></li>\n      <li><a href=\"#How-do-I-save-and-use-Vim-marks-commands-across-Vim-sessions\">17.3. How do I save and use Vim marks/commands across Vim sessions?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#REMOTE-EDITING1\">REMOTE EDITING</a>\n    <ul>\n      <li><a href=\"#How-do-I-open-a-file-with-existing-instance-of-gvim-What-happened-to-the-Vim-5.x-OpenWithVim.exe-and-SendToVim.exe-files\">18.1. How do I open a file with existing instance of gvim? What happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?</a></li>\n      <li><a href=\"#How-do-I-send-a-command-to-a-Vim-server-to-write-all-buffers-to-disk\">18.2. How do I send a command to a Vim server to write all buffers to disk?</a></li>\n      <li><a href=\"#Where-can-I-get-the-documentation-about-the-Vim-remote-server-functionality\">18.3. Where can I get the documentation about the Vim remote server functionality?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#OPTIONS1\">OPTIONS</a>\n    <ul>\n      <li><a href=\"#How-do-I-configure-Vim-in-a-simple-way\">19.1. How do I configure Vim in a simple way?</a></li>\n      <li><a href=\"#How-do-I-toggle-the-value-of-an-option\">19.2. How do I toggle the value of an option?</a></li>\n      <li><a href=\"#How-do-I-set-an-option-that-affects-only-the-current-buffer-window\">19.3. How do I set an option that affects only the current buffer/window?</a></li>\n      <li><a href=\"#How-do-I-use-space-characters-for-a-Vim-option-value\">19.4. How do I use space characters for a Vim option value?</a></li>\n      <li><a href=\"#Can-I-add-embed-Vim-option-settings-to-the-contents-of-a-file\">19.5. Can I add (embed) Vim option settings to the contents of a file?</a></li>\n      <li><a href=\"#How-do-I-display-the-line-numbers-of-all-the-lines-in-a-file\">19.6. How do I display the line numbers of all the lines in a file?</a></li>\n      <li><a href=\"#How-do-I-change-the-width-of-the-line-numbers-displayed-using-the-number-option\">19.7. How do I change the width of the line numbers displayed using the &#39;number&#39; option?</a></li>\n      <li><a href=\"#How-do-I-display-view-all-the-invisible-characters-like-space-tabs-and-newlines-in-a-file\">19.8. How do I display (view) all the invisible characters like space, tabs and newlines in a file?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-always-display-the-current-line-and-column-number\">19.9. How do I configure Vim to always display the current line and column number?</a></li>\n      <li><a href=\"#How-do-I-display-the-current-Vim-mode\">19.10. How do I display the current Vim mode?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-show-pending-partial-commands-on-the-status-line\">19.11. How do I configure Vim to show pending/partial commands on the status line?</a></li>\n      <li><a href=\"#How-do-I-configure-the-Vim-status-line-to-display-different-settings-values\">19.12. How do I configure the Vim status line to display different settings/values?</a></li>\n      <li><a href=\"#How-do-I-configure-Vim-to-display-status-line-always\">19.13. How do I configure Vim to display status line always?</a></li>\n      <li><a href=\"#How-do-I-make-a-Vim-setting-persistent-across-different-Vim-invocations-instances-sessions\">19.14. How do I make a Vim setting persistent across different Vim invocations/instances/sessions?</a></li>\n      <li><a href=\"#Why-do-I-hear-a-beep-why-does-my-window-flash-about-1-second-after-I-hit-the-Escape-key\">19.15. Why do I hear a beep (why does my window flash) about 1 second after I hit the Escape key?</a></li>\n      <li><a href=\"#How-do-I-make-the-c-and-s-commands-display-a-instead-of-deleting-the-characters-Im-changing\">19.16. How do I make the &quot;c&quot; and &quot;s&quot; commands display a &quot;$&quot; instead of deleting the characters I&#39;m changing?</a></li>\n      <li><a href=\"#How-do-I-remove-more-than-one-flag-using-a-single-%3Aset-command-from-a-Vim-option\">19.17. How do I remove more than one flag using a single `:set` command from a Vim option?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#MAPPING-KEYS1\">MAPPING KEYS</a>\n    <ul>\n      <li><a href=\"#How-do-I-know-what-a-key-is-mapped-to\">20.1. How do I know what a key is mapped to?</a></li>\n      <li><a href=\"#How-do-I-list-all-the-user-defined-key-mappings\">20.2. How do I list all the user-defined key mappings?</a></li>\n      <li><a href=\"#How-do-I-unmap-a-previously-mapped-key\">20.3. How do I unmap a previously mapped key?</a></li>\n      <li><a href=\"#I-am-not-able-to-create-a-mapping-for-the-xxx-key.-What-is-wrong\">20.4. I am not able to create a mapping for the &lt;xxx&gt; key. What is wrong?</a></li>\n      <li><a href=\"#Why-does-mapping-the-C-...-key-not-work\">20.5. Why does mapping the &lt;C-...&gt; key not work?</a></li>\n      <li><a href=\"#How-do-I-map-the-numeric-keypad-keys\">20.6. How do I map the numeric keypad keys?</a></li>\n      <li><a href=\"#How-do-I-create-a-mapping-that-works-only-in-visual-mode\">20.7. How do I create a mapping that works only in visual mode?</a></li>\n      <li><a href=\"#How-do-I-create-a-mapping-that-works-only-in-normal-and-operator-pending-mode-but-not-in-visual-mode\">20.8. How do I create a mapping that works only in normal and operator pending mode (but not in visual mode)?</a></li>\n      <li><a href=\"#In-a-Vim-script-how-do-I-know-which-keys-to-use-for-my-mappings-so-that-the-mapped-key-will-not-collide-with-an-already-used-key\">20.9. In a Vim script, how do I know which keys to use for my mappings, so that the mapped key will not collide with an already used key?</a></li>\n      <li><a href=\"#How-do-I-map-the-escape-key\">20.10. How do I map the escape key?</a></li>\n      <li><a href=\"#How-do-I-map-a-key-to-perform-nothing\">20.11. How do I map a key to perform nothing?</a></li>\n      <li><a href=\"#I-want-to-use-the-Tab-key-to-indent-a-block-of-text-and-Shift-Tab-key-to-unindent-a-block-of-text.-How-do-I-map-the-keys-to-do-this-This-behavior-is-similar-to-textpad-visual-studio-etc\">20.12. I want to use the &lt;Tab&gt; key to indent a block of text and &lt;Shift-Tab&gt; key to unindent a block of text. How do I map the keys to do this? This behavior is similar to textpad, visual studio, etc.</a></li>\n      <li><a href=\"#In-my-mappings-the-special-characters-like-CR-are-not-recognized.-How-can-I-configure-Vim-to-recognize-special-characters\">20.13. In my mappings the special characters like &lt;CR&gt; are not recognized. How can I configure Vim to recognize special characters?</a></li>\n      <li><a href=\"#How-do-I-use-the-to-separate-multiple-commands-in-a-map\">20.14. How do I use the &quot;|&quot; to separate multiple commands in a map?</a></li>\n      <li><a href=\"#If-I-have-a-mapping-abbreviation-whose-ending-is-the-beginning-of-another-mapping-abbreviation-how-do-I-keep-the-first-from-expanding-into-the-second-one\">20.15. If I have a mapping/abbreviation whose ending is the beginning of another mapping/abbreviation, how do I keep the first from expanding into the second one?</a></li>\n      <li><a href=\"#Why-does-it-take-a-second-or-more-for-Vim-to-process-a-key-sometimes-when-I-press-a-key\">20.16. Why does it take a second or more for Vim to process a key, sometimes when I press a key?</a></li>\n      <li><a href=\"#How-do-I-map-a-key-to-run-an-external-command-using-a-visually-selected-text\">20.17. How do I map a key to run an external command using a visually selected text?</a></li>\n      <li><a href=\"#How-do-I-map-the-CTRL-I-key-while-still-retaining-the-functionality-of-the-Tab-key\">20.18. How do I map the CTRL-I key while still retaining the functionality of the &lt;Tab&gt; key?</a></li>\n      <li><a href=\"#How-do-I-define-a-map-to-accept-a-count\">20.19. How do I define a map to accept a count?</a></li>\n      <li><a href=\"#How-can-I-make-my-normal-mode-mapping-work-from-within-Insert-Mode\">20.20. How can I make my normal mode mapping work from within Insert Mode?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#ABBREVIATIONS1\">ABBREVIATIONS</a>\n    <ul>\n      <li><a href=\"#How-do-I-auto-correct-misspelled-words\">21.1. How do I auto correct misspelled words?</a></li>\n      <li><a href=\"#How-do-I-create-multi-line-abbreviations\">21.2. How do I create multi-line abbreviations?</a></li>\n      <li><a href=\"#When-my-abbreviations-are-expanded-an-additional-space-character-is-added-at-the-end-of-the-expanded-text.-How-do-I-avoid-this-character\">21.3. When my abbreviations are expanded, an additional space character is added at the end of the expanded text. How do I avoid this character?</a></li>\n      <li><a href=\"#How-do-I-insert-the-current-date-time-stamp-into-the-file\">21.4. How do I insert the current date/time stamp into the file?</a></li>\n      <li><a href=\"#How-do-I-prevent-an-abbreviation-from-expanding-in-insert-mode\">21.5. How do I prevent an abbreviation from expanding in insert mode?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#RECORD-AND-PLAYBACK1\">RECORD AND PLAYBACK</a>\n    <ul>\n      <li><a href=\"#How-do-I-repeat-an-editing-operation-insertion-deletion-paste-etc\">22.1. How do I repeat an editing operation (insertion, deletion, paste, etc)?</a></li>\n      <li><a href=\"#How-I-record-and-repeat-a-set-of-key-sequences\">22.2. How I record and repeat a set of key sequences?</a></li>\n      <li><a href=\"#How-do-I-edit-modify-a-recorded-set-of-key-sequences\">22.3. How do I edit/modify a recorded set of key sequences?</a></li>\n      <li><a href=\"#How-do-I-write-recorded-key-sequences-to-a-file\">22.4. How do I write recorded key sequences to a file?</a></li>\n      <li><a href=\"#I-am-using-register-0-to-record-my-key-sequences-i.e.-q0-....-q-.-In-the-recorded-key-sequences-I-am-yanking-some-text.-After-the-first-replay-of-the-recorded-key-sequence-I-am-no-longer-able-to-play-it-back\">22.5. I am using register 0 to record my key sequences (i.e. q0 .... q). In the recorded key sequences, I am yanking some text. After the first replay of the recorded key sequence, I am no longer able to play it back.</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#AUTOCOMMANDS1\">AUTOCOMMANDS</a>\n    <ul>\n      <li><a href=\"#How-do-I-execute-a-command-when-I-try-to-modify-a-read-only-file\">23.1. How do I execute a command when I try to modify a read-only file?</a></li>\n      <li><a href=\"#How-do-I-execute-a-command-every-time-when-entering-a-buffer\">23.2. How do I execute a command every time when entering a buffer?</a></li>\n      <li><a href=\"#How-do-I-execute-a-command-every-time-when-entering-a-window\">23.3. How do I execute a command every time when entering a window?</a></li>\n      <li><a href=\"#From-an-autocmd-how-can-I-determine-the-name-of-the-file-or-the-buffer-number-for-which-the-autocommand-is-executed\">23.4. From an autocmd, how can I determine the name of the file or the buffer number for which the autocommand is executed?</a></li>\n      <li><a href=\"#How-do-I-automatically-save-all-the-changed-buffers-whenever-Vim-loses-focus\">23.5. How do I automatically save all the changed buffers whenever Vim loses focus?</a></li>\n      <li><a href=\"#How-do-I-execute-run-a-function-when-Vim-exits-to-do-some-cleanup\">23.6. How do I execute/run a function when Vim exits to do some cleanup?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#SYNTAX-HIGHLIGHT1\">SYNTAX HIGHLIGHT</a>\n    <ul>\n      <li><a href=\"#How-do-I-turn-off-on-syntax-highlighting\">24.1. How do I turn off/on syntax highlighting?</a></li>\n      <li><a href=\"#How-do-I-change-the-background-and-foreground-colors-used-by-Vim\">24.2. How do I change the background and foreground colors used by Vim?</a></li>\n      <li><a href=\"#How-do-I-change-the-highlight-colors-to-suit-a-dark-light-background\">24.3. How do I change the highlight colors to suit a dark/light background?</a></li>\n      <li><a href=\"#How-do-I-change-the-color-of-the-line-numbers-displayed-when-the-%3Aset-number-command-is-used\">24.4. How do I change the color of the line numbers displayed when the `:set number` command is used?</a></li>\n      <li><a href=\"#How-do-I-change-the-background-color-used-for-a-Visually-selected-block\">24.5. How do I change the background color used for a Visually selected block?</a></li>\n      <li><a href=\"#How-do-I-highlight-the-special-characters-tabs-trailing-spaces-end-of-line-etc-displayed-by-the-list-option\">24.6. How do I highlight the special characters (tabs, trailing spaces, end of line, etc) displayed by the &#39;list&#39; option?</a></li>\n      <li><a href=\"#How-do-I-specify-a-colorscheme-in-my-.vimrc-.gvimrc-file-so-that-Vim-uses-the-specified-colorscheme-every-time\">24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that Vim uses the specified colorscheme every time?</a></li>\n      <li><a href=\"#Vim-syntax-highlighting-is-broken.-When-I-am-editing-a-file-some-parts-of-the-file-is-not-syntax-highlighted-or-syntax-highlighted-incorrectly\">24.8. Vim syntax highlighting is broken. When I am editing a file, some parts of the file is not syntax highlighted or syntax highlighted incorrectly.</a></li>\n      <li><a href=\"#Is-there-a-built-in-function-to-syntax-highlight-the-corresponding-matching-bracket\">24.9. Is there a built-in function to syntax-highlight the corresponding matching bracket?</a></li>\n      <li><a href=\"#How-do-I-turn-off-the-C-comment-syntax-highlighting\">24.10. How do I turn off the C comment syntax highlighting?</a></li>\n      <li><a href=\"#How-do-I-add-my-own-syntax-extensions-to-the-standard-syntax-files-supplied-with-Vim\">24.11. How do I add my own syntax extensions to the standard syntax files supplied with Vim?</a></li>\n      <li><a href=\"#How-do-I-replace-a-standard-syntax-file-that-comes-with-the-Vim-distribution-with-my-own-syntax-file\">24.12. How do I replace a standard syntax file that comes with the Vim distribution with my own syntax file?</a></li>\n      <li><a href=\"#How-do-I-highlight-all-the-characters-after-a-particular-column\">24.13. How do I highlight all the characters after a particular column?</a></li>\n      <li><a href=\"#How-do-I-convert-a-source-file-.c-.h-etc-with-the-Vim-syntax-highlighting-into-a-HTML-file\">24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax highlighting into a HTML file?</a></li>\n      <li><a href=\"#How-do-I-list-the-definition-of-all-the-current-highlight-groups\">24.15. How do I list the definition of all the current highlight groups?</a></li>\n      <li><a href=\"#How-can-I-embed-one-syntax-highlighting-language-into-another-one\">24.16. How can I embed one syntax highlighting language into another one?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#VIM-SCRIPT-WRITING1\">VIM SCRIPT WRITING</a>\n    <ul>\n      <li><a href=\"#How-do-I-list-the-names-of-all-the-scripts-sourced-by-Vim\">25.1. How do I list the names of all the scripts sourced by Vim?</a></li>\n      <li><a href=\"#How-do-I-debug-Vim-scripts\">25.2. How do I debug Vim scripts?</a></li>\n      <li><a href=\"#How-do-I-locate-the-script-plugin-which-sets-a-Vim-option\">25.3. How do I locate the script/plugin which sets a Vim option?</a></li>\n      <li><a href=\"#I-am-getting-some-error-informational-messages-from-Vim-possibly-when-running-a-script-the-messages-are-cleared-immediately.-How-do-I-display-the-messages-again\">25.4. I am getting some error/informational messages from Vim (possibly when running a script), the messages are cleared immediately. How do I display the messages again?</a></li>\n      <li><a href=\"#How-do-I-save-and-restore-a-plugin-specific-information-across-Vim-invocations\">25.5. How do I save and restore a plugin specific information across Vim invocations?</a></li>\n      <li><a href=\"#How-do-I-start-insert-mode-from-a-Vim-function\">25.6. How do I start insert mode from a Vim function?</a></li>\n      <li><a href=\"#How-do-I-change-the-cursor-position-from-within-a-Vim-function\">25.7. How do I change the cursor position from within a Vim function?</a></li>\n      <li><a href=\"#How-do-I-check-the-value-of-an-environment-variable-in-the-.vimrc-file\">25.8. How do I check the value of an environment variable in the .vimrc file?</a></li>\n      <li><a href=\"#How-do-I-check-whether-an-environment-variable-is-set-or-not-from-a-Vim-function\">25.9. How do I check whether an environment variable is set or not from a Vim function?</a></li>\n      <li><a href=\"#How-do-I-call-use-the-Vim-built-in-functions\">25.10. How do I call/use the Vim built-in functions?</a></li>\n      <li><a href=\"#I-am-using-some-normal-mode-commands-in-my-Vim-script.-How-do-I-avoid-using-the-user-defined-mappings-for-these-normal-mode-commands-and-use-the-standard-Vim-functionality-for-these-normal-mode-commands\">25.11. I am using some normal mode commands in my Vim script. How do I avoid using the user-defined mappings for these normal mode commands and use the standard Vim functionality for these normal mode commands?</a></li>\n      <li><a href=\"#How-do-I-get-the-current-visually-selected-text-into-a-Vim-variable-or-register\">25.12. How do I get the current visually selected text into a Vim variable or register?</a></li>\n      <li><a href=\"#I-have-some-text-in-a-Vim-variable-myvar.-I-would-like-to-use-this-variable-in-a-%3As-substitute-command-to-replace-a-text-mytext.-How-do-I-do-this\">25.13. I have some text in a Vim variable &quot;myvar&quot;. I would like to use this variable in a `:s` substitute command to replace a text &quot;mytext&quot;. How do I do this?</a></li>\n      <li><a href=\"#A-Vim-variable-bno-contains-a-buffer-number.-How-do-I-use-this-variable-to-open-the-corresponding-buffer\">25.14. A Vim variable (bno) contains a buffer number. How do I use this variable to open the corresponding buffer?</a></li>\n      <li><a href=\"#How-do-I-store-the-value-of-a-Vim-option-into-a-Vim-variable\">25.15. How do I store the value of a Vim option into a Vim variable?</a></li>\n      <li><a href=\"#I-have-copied-and-inserted-some-text-into-a-buffer-from-a-Vim-function.-How-do-I-indent-the-inserted-text-from-the-Vim-function\">25.16. I have copied and inserted some text into a buffer from a Vim function. How do I indent the inserted text from the Vim function?</a></li>\n      <li><a href=\"#How-do-I-get-the-character-under-the-cursor-from-a-Vim-script\">25.17. How do I get the character under the cursor from a Vim script?</a></li>\n      <li><a href=\"#How-do-I-get-the-name-of-the-current-file-without-the-extension\">25.18. How do I get the name of the current file without the extension?</a></li>\n      <li><a href=\"#How-do-I-get-the-basename-of-the-current-file\">25.19. How do I get the basename of the current file?</a></li>\n      <li><a href=\"#How-do-I-get-the-output-from-a-Vim-function-into-the-current-buffer\">25.20. How do I get the output from a Vim function into the current buffer?</a></li>\n      <li><a href=\"#How-do-I-call-external-programs-from-a-Vim-function\">25.21. How do I call external programs from a Vim function?</a></li>\n      <li><a href=\"#How-do-I-get-the-return-status-of-a-program-executed-using-the-%3A-command\">25.22. How do I get the return status of a program executed using the `:!` command?</a></li>\n      <li><a href=\"#How-do-I-determine-whether-the-current-buffer-is-modified-or-not\">25.23. How do I determine whether the current buffer is modified or not?</a></li>\n      <li><a href=\"#I-would-like-to-use-the-carriage-return-character-in-a-normal-command-from-a-Vim-script.-How-do-I-specify-the-carriage-return-character\">25.24. I would like to use the carriage return character in a normal command from a Vim script. How do I specify the carriage return character?</a></li>\n      <li><a href=\"#How-do-I-split-long-lines-in-a-Vim-script\">25.25. How do I split long lines in a Vim script?</a></li>\n      <li><a href=\"#When-I-try-to-execute-my-function-using-the-%3Aexecute-Myfunc-command-the-cursor-is-moved-to-the-top-of-the-current-buffer.-Why\">25.26. When I try to &quot;execute&quot; my function using the `:execute Myfunc()` command, the cursor is moved to the top of the current buffer. Why?</a></li>\n      <li><a href=\"#How-do-I-source-execute-the-contents-of-a-register\">25.27. How do I source/execute the contents of a register?</a></li>\n      <li><a href=\"#After-calling-a-Vim-function-or-a-mapping-when-I-press-the-u-key-to-undo-the-last-change-Vim-undoes-all-the-changes-made-by-the-mapping-function.-Why\">25.28. After calling a Vim function or a mapping, when I press the &quot;u&quot; key to undo the last change, Vim undoes all the changes made by the mapping/function. Why?</a></li>\n      <li><a href=\"#How-can-I-call-a-function-defined-with-s%3A-script-local-function-from-another-script-plugin\">25.29. How can I call a function defined with s: (script local function) from another script/plugin?</a></li>\n      <li><a href=\"#Is-it-possible-to-un-source-a-sourced-script-In-other-words-reverse-all-the-commands-executed-by-sourcing-a-script\">25.30. Is it possible to un-source a sourced script? In other words, reverse all the commands executed by sourcing a script.</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#PLUGINS1\">PLUGINS</a>\n    <ul>\n      <li><a href=\"#How-do-I-set-different-options-for-different-types-of-files\">26.1. How do I set different options for different types of files?</a></li>\n      <li><a href=\"#I-have-downloaded-a-Vim-plugin-or-a-syntax-file-or-a-indent-file-or-a-color-scheme-or-a-filetype-plugin-from-the-web.-Where-should-I-copy-these-files-so-that-Vim-will-find-them\">26.2. I have downloaded a Vim plugin or a syntax file or a indent file, or a color scheme or a filetype plugin from the web. Where should I copy these files so that Vim will find them?</a></li>\n      <li><a href=\"#How-do-I-extend-an-existing-filetype-plugin\">26.3. How do I extend an existing filetype plugin?</a></li>\n      <li><a href=\"#How-do-I-turn-off-loading-the-Vim-plugins\">26.4. How do I turn off loading the Vim plugins?</a></li>\n      <li><a href=\"#How-do-I-turn-on-off-loading-the-filetype-plugins\">26.5. How do I turn on/off loading the filetype plugins?</a></li>\n      <li><a href=\"#How-do-I-override-settings-made-in-a-file-type-plugin-in-the-global-ftplugin-directory-for-all-the-file-types\">26.6. How do I override settings made in a file type plugin in the global ftplugin directory for all the file types?</a></li>\n      <li><a href=\"#How-do-I-disable-the-Vim-directory-browser-plugin\">26.7. How do I disable the Vim directory browser plugin?</a></li>\n      <li><a href=\"#How-do-I-set-the-filetype-option-for-files-with-names-matching-a-particular-pattern-or-depending-on-the-file-extension\">26.8. How do I set the filetype option for files with names matching a particular pattern or depending on the file extension?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#EDITING-PROGRAM-FILES1\">EDITING PROGRAM FILES</a>\n    <ul>\n      <li><a href=\"#How-do-I-enable-automatic-indentation-for-C-C-files\">27.1. How do I enable automatic indentation for C/C++ files?</a></li>\n      <li><a href=\"#How-do-I-configure-the-indentation-used-for-C-C-files\">27.2. How do I configure the indentation used for C/C++ files?</a></li>\n      <li><a href=\"#How-do-I-turn-off-the-automatic-indentation-feature\">27.3. How do I turn off the automatic indentation feature?</a></li>\n      <li><a href=\"#How-do-I-change-the-number-of-space-characters-used-for-the-automatic-indentation\">27.4. How do I change the number of space characters used for the automatic indentation?</a></li>\n      <li><a href=\"#I-am-editing-a-C-program-using-Vim.-How-do-I-display-the-definition-of-a-macro-or-a-variable\">27.5. I am editing a C program using Vim. How do I display the definition of a macro or a variable?</a></li>\n      <li><a href=\"#I-am-editing-a-C-program-using-Vim.-How-do-I-jump-to-the-beginning-or-end-of-a-code-block-from-within-the-block\">27.6. I am editing a C program using Vim. How do I jump to the beginning or end of a code block from within the block?</a></li>\n      <li><a href=\"#When-editing-C-files-and-when-inserting-new-lines-above-or-below-a-comment-line-Vim-automatically-inserts-the-C-comment-character-at-the-beginning-of-the-line.-How-do-I-disable-this\">27.7. When editing C++ files and when inserting new lines above or below a comment (//) line, Vim automatically inserts the C++ comment character (//) at the beginning of the line. How do I disable this?</a></li>\n      <li><a href=\"#How-do-I-add-the-comment-character-to-a-set-of-lines-at-the-beginning-of-each-line\">27.8. How do I add the comment character &quot;#&quot; to a set of lines at the beginning of each line?</a></li>\n      <li><a href=\"#How-do-I-edit-a-header-file-with-the-same-name-as-the-corresponding-C-source-file\">27.9. How do I edit a header file with the same name as the corresponding C source file?</a></li>\n      <li><a href=\"#How-do-I-automatically-insert-comment-leaders-while-typing-comments\">27.10. How do I automatically insert comment leaders while typing comments?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#QUICKFIX1\">QUICKFIX</a>\n    <ul>\n      <li><a href=\"#How-do-I-build-programs-from-Vim\">28.1. How do I build programs from Vim?</a></li>\n      <li><a href=\"#When-I-run-the-make-command-in-Vim-I-get-the-errors-listed-as-the-compiler-compiles-the-program.-When-it-finishes-this-list-disappears-and-I-have-to-use-the-%3Aclist-command-to-see-the-error-message-again.-Is-there-any-other-way-to-see-these-error-messages\">28.2. When I run the make command in Vim I get the errors listed as the compiler compiles the program. When it finishes this list disappears and I have to use the `:clist` command to see the error message again. Is there any other way to see these error messages?</a></li>\n      <li><a href=\"#How-can-I-perform-a-command-for-each-item-in-the-quickfix-location-list\">28.3. How can I perform a command for each item in the quickfix/location list?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#FOLDING1\">FOLDING</a>\n    <ul>\n      <li><a href=\"#How-do-I-extend-the-Vim-folding-support\">29.1. How do I extend the Vim folding support?</a></li>\n      <li><a href=\"#When-I-enable-folding-by-setting-the-foldmethod-option-all-the-folds-are-closed.-How-do-I-prevent-this\">29.2. When I enable folding by setting the &#39;foldmethod&#39; option, all the folds are closed. How do I prevent this?</a></li>\n      <li><a href=\"#How-do-I-control-how-many-folds-will-be-opened-when-I-start-editing-a-file\">29.3. How do I control how many folds will be opened when I start editing a file?</a></li>\n      <li><a href=\"#How-do-I-open-and-close-folds-using-the-mouse\">29.4. How do I open and close folds using the mouse?</a></li>\n      <li><a href=\"#How-do-I-change-the-text-displayed-for-a-closed-fold\">29.5. How do I change the text displayed for a closed fold?</a></li>\n      <li><a href=\"#How-do-I-store-and-restore-manually-created-folds-across-different-Vim-invocations\">29.6. How do I store and restore manually created folds across different Vim invocations?</a></li>\n      <li><a href=\"#I-have-enabled-syntax-based-folding.-Why-is-Vim-so-slow\">29.7. I have enabled syntax based folding. Why is Vim so slow?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#VIM-WITH-EXTERNAL-APPLICATIONS1\">VIM WITH EXTERNAL APPLICATIONS</a>\n    <ul>\n      <li><a href=\"#Can-I-run-a-shell-inside-a-Vim-window\">30.1. Can I run a shell inside a Vim window?</a></li>\n      <li><a href=\"#How-do-I-pass-the-word-under-the-cursor-to-an-external-command\">30.2. How do I pass the word under the cursor to an external command?</a></li>\n      <li><a href=\"#How-do-I-get-the-output-of-a-shell-command-into-a-Vim-buffer\">30.3. How do I get the output of a shell command into a Vim buffer?</a></li>\n      <li><a href=\"#How-do-I-pipe-the-contents-of-the-current-buffer-to-an-external-command-and-replace-the-contents-of-the-buffer-with-the-output-from-the-command\">30.4. How do I pipe the contents of the current buffer to an external command and replace the contents of the buffer with the output from the command?</a></li>\n      <li><a href=\"#How-do-I-sort-a-section-of-my-file\">30.5. How do I sort a section of my file?</a></li>\n      <li><a href=\"#How-do-I-use-Vim-as-a-pager\">30.6. How do I use Vim as a pager?</a></li>\n      <li><a href=\"#How-do-I-view-Unix-man-pages-from-inside-Vim\">30.7. How do I view Unix man pages from inside Vim?</a></li>\n      <li><a href=\"#How-do-I-change-the-diff-command-used-by-the-Vim-diff-support\">30.8. How do I change the diff command used by the Vim diff support?</a></li>\n      <li><a href=\"#How-do-I-use-the-Vim-diff-mode-without-folding\">30.9. How do I use the Vim diff mode without folding?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#GUI-VIM1\">GUI VIM</a>\n    <ul>\n      <li><a href=\"#How-do-I-create-buffer-specific-menus\">31.1. How do I create buffer specific menus?</a></li>\n      <li><a href=\"#How-do-I-change-the-font-used-by-GUI-Vim\">31.2. How do I change the font used by GUI Vim?</a></li>\n      <li><a href=\"#When-starting-GUI-Vim-how-do-I-specify-the-location-of-the-GVIM-window\">31.3. When starting GUI Vim, how do I specify the location of the GVIM window?</a></li>\n      <li><a href=\"#How-do-I-add-a-horizontal-scrollbar-in-GVim\">31.4. How do I add a horizontal scrollbar in GVim?</a></li>\n      <li><a href=\"#How-do-I-make-the-scrollbar-appear-in-the-left-side-by-default\">31.5. How do I make the scrollbar appear in the left side by default?</a></li>\n      <li><a href=\"#How-do-I-remove-the-Vim-menubar\">31.6. How do I remove the Vim menubar?</a></li>\n      <li><a href=\"#I-am-using-GUI-Vim.-When-I-press-the-Alt-key-and-a-letter-the-menu-starting-with-that-letter-is-selected.-I-dont-want-this-behavior-as-I-want-to-map-the-Alt-key-combination.-How-do-I-do-this\">31.7. I am using GUI Vim. When I press the &lt;Alt&gt; key and a letter, the menu starting with that letter is selected. I don&#39;t want this behavior as I want to map the &lt;Alt&gt;-&lt;key&gt; combination. How do I do this?</a></li>\n      <li><a href=\"#Is-it-possible-to-scroll-the-text-by-dragging-the-scrollbar-so-that-the-cursor-stays-in-the-original-location\">31.8. Is it possible to scroll the text by dragging the scrollbar so that the cursor stays in the original location?</a></li>\n      <li><a href=\"#How-do-I-get-gvim-to-start-browsing-files-in-a-particular-directory-when-using-the-%3Abrowse-command\">31.9. How do I get gvim to start browsing files in a particular directory when using the `:browse` command?</a></li>\n      <li><a href=\"#For-some-questions-like-when-a-file-is-changed-outside-of-Vim-Vim-displays-a-GUI-dialog-box.-How-do-I-replace-this-GUI-dialog-box-with-a-console-dialog-box\">31.10. For some questions, like when a file is changed outside of Vim, Vim displays a GUI dialog box. How do I replace this GUI dialog box with a console dialog box?</a></li>\n      <li><a href=\"#I-am-trying-to-use-GUI-Vim-as-the-editor-for-my-xxx-application.-When-the-xxx-application-launches-GUI-Vim-to-edit-a-file-the-control-immediately-returns-to-the-xxx-application.-How-do-I-start-GUI-Vim-so-that-the-control-returns-to-the-xxx-application-only-after-I-quit-Vim\">31.11. I am trying to use GUI Vim as the editor for my xxx application. When the xxx application launches GUI Vim to edit a file, the control immediately returns to the xxx application. How do I start GUI Vim, so that the control returns to the xxx application only after I quit Vim?</a></li>\n      <li><a href=\"#Why-does-the-Select-Font-dialog-doesnt-show-all-the-fonts-installed-in-my-system\">31.12. Why does the &quot;Select Font&quot; dialog doesn&#39;t show all the fonts installed in my system?</a></li>\n      <li><a href=\"#How-do-I-use-the-mouse-in-Vim-command-line-mode\">31.13. How do I use the mouse in Vim command-line mode?</a></li>\n      <li><a href=\"#When-I-use-the-middle-mouse-button-to-scroll-text-it-pastes-the-last-copied-text.-How-do-I-disable-this-behavior\">31.14. When I use the middle mouse button to scroll text, it pastes the last copied text. How do I disable this behavior?</a></li>\n      <li><a href=\"#How-do-I-change-the-location-and-size-of-a-GUI-Vim-window\">31.15. How do I change the location and size of a GUI Vim window?</a></li>\n      <li><a href=\"#When-splitting-the-Vim-window-vertically-Vim-changes-the-position\">31.16. When splitting the Vim window vertically, Vim changes the position.</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#VIM-ON-UNIX1\">VIM ON UNIX</a>\n    <ul>\n      <li><a href=\"#I-am-running-Vim-in-a-xterm.-When-I-press-the-CTRL-S-key-Vim-freezes.-What-should-I-do-now\">32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim freezes. What should I do now?</a></li>\n      <li><a href=\"#I-am-seeing-weird-screen-update-problems-in-Vim.-What-can-I-do-to-solve-this-screen-display-update-problems\">32.2. I am seeing weird screen update problems in Vim. What can I do to solve this screen/display update problems?</a></li>\n      <li><a href=\"#I-am-using-the-terminal-console-version-of-Vim.-In-insertmode-When-I-press-the-backspace-key-the-character-before-the-cursor-is-not-erased.-How-do-I-configure-Vim-to-do-this\">32.3. I am using the terminal/console version of Vim. In insertmode, When I press the backspace key, the character before the cursor is not erased. How do I configure Vim to do this?</a></li>\n      <li><a href=\"#I-am-using-Vim-in-a-xterm.-When-I-quit-Vim-the-screen-contents-are-restored-back-to-the-original-contents.-How-do-I-disable-this\">32.4. I am using Vim in a xterm. When I quit Vim, the screen contents are restored back to the original contents. How do I disable this?</a></li>\n      <li><a href=\"#When-I-start-Vim-it-takes-quite-a-few-seconds-to-start.-How-do-I-minimize-the-startup-time\">32.5. When I start Vim, it takes quite a few seconds to start. How do I minimize the startup time?</a></li>\n      <li><a href=\"#How-can-I-make-the-cursor-in-gvim-in-unix-stop-blinking\">32.6. How can I make the cursor in gvim in unix stop blinking?</a></li>\n      <li><a href=\"#How-do-I-change-the-menu-font-on-GTK-Vim\">32.7. How do I change the menu font on GTK Vim?</a></li>\n      <li><a href=\"#How-do-I-prevent-CTRL-Z-from-suspending-Vim\">32.8. How do I prevent CTRL-Z from suspending Vim?</a></li>\n      <li><a href=\"#When-I-kill-the-xterm-running-Vim-the-Vim-process-continues-to-run-and-takes-up-a-lot-of-CPU-99-time.-Why-is-this-happening\">32.9. When I kill the xterm running Vim, the Vim process continues to run and takes up a lot of CPU (99%) time. Why is this happening?</a></li>\n      <li><a href=\"#How-do-I-get-the-Vim-syntax-highlighting-to-work-in-a-Unix-terminal\">32.10. How do I get the Vim syntax highlighting to work in a Unix terminal?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#VIM-ON-MS-WINDOWS1\">VIM ON MS-WINDOWS</a>\n    <ul>\n      <li><a href=\"#In-MS-Windows-CTRL-V-doesnt-start-the-blockwise-visual-mode.-What-happened\">33.1. In MS-Windows, CTRL-V doesn&#39;t start the blockwise visual mode. What happened?</a></li>\n      <li><a href=\"#When-I-press-the-CTRL-Y-key-it-acts-like-the-CTRL-R-key.-How-do-I-configure-Vim-to-treat-CTRL-Y-as-CTRL-Y\">33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do I configure Vim to treat CTRL-Y as CTRL-Y?</a></li>\n      <li><a href=\"#How-do-I-start-GUI-Vim-in-a-maximized-window-always\">33.3. How do I start GUI Vim in a maximized window always?</a></li>\n      <li><a href=\"#After-doing-some-editing-operations-Vim-freezes.-The-cursor-becomes-an-empty-rectangle.-I-am-not-able-enter-any-characters.-What-is-happening\">33.4. After doing some editing operations, Vim freezes. The cursor becomes an empty rectangle. I am not able enter any characters. What is happening?</a></li>\n      <li><a href=\"#I-am-using-Windows-XP-the-display-speed-of-maximized-GVim-is-very-slow.-What-can-I-do-to-speed-the-display-updates\">33.5. I am using Windows XP, the display speed of maximized GVim is very slow. What can I do to speed the display updates?</a></li>\n      <li><a href=\"#What-are-the-recommended-settings-for-using-Vim-with-cygwin\">33.6. What are the recommended settings for using Vim with cygwin?</a></li>\n      <li><a href=\"#I-am-trying-to-use-GNU-diff-with-Vim-diff-mode.-When-I-run-the-diff-from-command-line-it-works.-When-I-try-to-use-the-diff-with-Vim-it-doesnt-work.-What-should-I-do-now\">33.7. I am trying to use GNU diff with Vim diff mode. When I run the diff from command line, it works. When I try to use the diff with Vim it doesn&#39;t work. What should I do now?</a></li>\n      <li><a href=\"#Is-it-possible-to-use-Vim-as-an-external-editor-for-MS-Windows-Outlook-email-client\">33.8. Is it possible to use Vim as an external editor for MS-Windows Outlook email client?</a></li>\n      <li><a href=\"#I-am-using-Vim-to-edit-HTML-files.-How-do-I-start-internet-explorer-with-the-current-file-to-preview-the-HTML-file\">33.9. I am using Vim to edit HTML files. How do I start internet explorer with the current file to preview the HTML file?</a></li>\n      <li><a href=\"#I-would-like-to-use-Vim-with-Microsoft-Visual-Studio.-How-do-I-do-this\">33.10. I would like to use Vim with Microsoft Visual Studio. How do I do this?</a></li>\n      <li><a href=\"#Where-do-I-place-the-_vimrc-and-_gvimrc-files\">33.11. Where do I place the _vimrc and _gvimrc files?</a></li>\n      <li><a href=\"#Every-time-I-save-a-file-Vim-warns-about-the-file-being-changed-outside-of-Vim.-Why\">33.12. Every time I save a file, Vim warns about the file being changed outside of Vim. Why?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#PRINTING1\">PRINTING</a>\n    <ul>\n      <li><a href=\"#How-do-I-print-a-file-along-with-line-numbers-for-all-the-lines\">34.1. How do I print a file along with line numbers for all the lines?</a></li>\n      <li><a href=\"#How-do-I-print-a-file-with-the-Vim-syntax-highlighting-colors\">34.2. How do I print a file with the Vim syntax highlighting colors?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#BUILDING-VIM-FROM-SOURCE1\">BUILDING VIM FROM SOURCE</a>\n    <ul>\n      <li><a href=\"#How-do-I-build-Vim-from-the-sources-on-a-Unix-system\">35.1. How do I build Vim from the sources on a Unix system?</a></li>\n      <li><a href=\"#How-do-I-install-Vim-in-my-home-directory-or-a-directory-other-than-the-default-installation-directory-in-Unix\">35.2. How do I install Vim in my home directory or a directory other than the default installation directory in Unix?</a></li>\n      <li><a href=\"#How-do-I-build-Vim-from-the-sources-on-a-MS-Windows-system\">35.3. How do I build Vim from the sources on a MS-Windows system?</a></li>\n      <li><a href=\"#The-Vim-help-syntax-indent-files-are-missing-from-my-Vim-installation.-How-do-I-install-these-files\">35.4. The Vim help, syntax, indent files are missing from my Vim installation. How do I install these files?</a></li>\n      <li><a href=\"#I-have-built-Vim-from-the-source-and-installed-the-Vim-package-using-make-install.-Do-I-need-to-keep-the-Vim-source-directory\">35.5. I have built Vim from the source and installed the Vim package using &quot;make install&quot;. Do I need to keep the Vim source directory?</a></li>\n      <li><a href=\"#How-do-I-determine-the-Vim-features-which-are-enabled-at-compile-time\">35.6. How do I determine the Vim features which are enabled at compile time?</a></li>\n      <li><a href=\"#Can-I-build-Vim-without-the-GUI-support\">35.7. Can I build Vim without the GUI support?</a></li>\n      <li><a href=\"#When-building-Vim-on-a-Unix-system-I-am-getting-undefined-reference-to-term_set_winsize-error.-How-do-I-resolve-this-error\">35.8. When building Vim on a Unix system, I am getting &quot;undefined reference to term_set_winsize&quot; error. How do I resolve this error?</a></li>\n      <li><a href=\"#Vim-configure-keeps-complaining-about-the-lack-of-gtk-config-while-trying-to-use-GTK-2.03.-This-is-correct-since-in-GTK-2-they-moved-to-using-the-generic-pkg-config.-I-can-get-pkg-config-to-list-the-various-includes-and-libs-for-gtk-but-for-some-reason-the-configure-script-still-isnt-picking-this-up\">35.9. Vim configure keeps complaining about the lack of gtk-config while trying to use GTK 2.03. This is correct, since in GTK 2 they moved to using the generic pkg-config. I can get pkg-config to list the various includes and libs for gtk, but for some reason the configure script still isn&#39;t picking this up.</a></li>\n      <li><a href=\"#I-did-successfully-download-the-sources-and-compiled-Vim-on-Unix.-But-feature-...-still-does-not-work.-What-is-wrong-and-how-can-I-fix-it\">35.10. I did successfully download the sources and compiled Vim on Unix. But feature ... still does not work. What is wrong and how can I fix it?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#VARIOUS1\">VARIOUS</a>\n    <ul>\n      <li><a href=\"#How-do-I-edit-binary-files-with-Vim\">36.1. How do I edit binary files with Vim?</a></li>\n      <li><a href=\"#How-do-I-disable-the-visual-error-flash-and-the-error-beep\">36.2. How do I disable the visual error flash and the error beep?</a></li>\n      <li><a href=\"#How-do-I-display-the-ascii-value-of-a-character-displayed-in-a-buffer\">36.3. How do I display the ascii value of a character displayed in a buffer?</a></li>\n      <li><a href=\"#Can-I-use-zero-as-a-count-for-a-Vim-command\">36.4. Can I use zero as a count for a Vim command?</a></li>\n      <li><a href=\"#How-do-I-disable-the-Vim-welcome-screen\">36.5. How do I disable the Vim welcome screen?</a></li>\n      <li><a href=\"#How-do-I-avoid-the-hit-enter-to-continue-prompt\">36.6. How do I avoid the &quot;hit enter to continue&quot; prompt?</a></li>\n      <li><a href=\"#How-do-I-invoke-Vim-from-command-line-to-run-a-group-of-commands-on-a-group-of-files\">36.7. How do I invoke Vim from command line to run a group of commands on a group of files?</a></li>\n      <li><a href=\"#How-do-I-use-a-normal-mode-command-from-insert-mode-without-leaving-the-insert-mode\">36.8. How do I use a normal mode command from insert mode without leaving the insert mode?</a></li>\n      <li><a href=\"#How-do-I-start-Vim-in-insert-mode\">36.9. How do I start Vim in insert mode?</a></li>\n      <li><a href=\"#How-do-I-use-Copy-and-Paste-with-Vim\">36.10. How do I use Copy and Paste with Vim?</a></li>\n      <li><a href=\"#Why-shouldnt-I-modify-the-files-in-the-system-runtime-directory\">36.11. Why shouldn&#39;t I modify the files in the system runtime directory?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#UNICODE1\">UNICODE</a>\n    <ul>\n      <li><a href=\"#Is-it-possible-to-create-Unicode-files-using-Vim\">37.1. Is it possible to create Unicode files using Vim?</a></li>\n      <li><a href=\"#Which-Vim-settings-are-particularly-important-for-editing-Unicode-files\">37.2. Which Vim settings are particularly important for editing Unicode files?</a></li>\n      <li><a href=\"#What-is-the-encoding-option\">37.3. What is the &#39;encoding&#39; option?</a></li>\n      <li><a href=\"#How-does-Vim-name-the-various-Unicode-encodings\">37.4. How does Vim name the various Unicode encodings?</a></li>\n      <li><a href=\"#How-does-Vim-specify-the-presence-or-absence-of-a-byte-order-mark\">37.5. How does Vim specify the presence or absence of a byte-order mark?</a></li>\n      <li><a href=\"#What-is-the-fileencoding-option\">37.6. What is the &#39;fileencoding&#39; option?</a></li>\n      <li><a href=\"#What-is-the-fileencodings-option\">37.7. What is the &#39;fileencodings&#39; option?</a></li>\n      <li><a href=\"#What-is-the-termencoding-option\">37.8. What is the &#39;termencoding&#39; option?</a></li>\n      <li><a href=\"#What-is-the-bomb-option\">37.9. What is the &#39;bomb&#39; option?</a></li>\n      <li><a href=\"#Where-can-I-find-an-example-of-a-typical-use-of-all-these-options\">37.10. Where can I find an example of a typical use of all these options?</a></li>\n      <li><a href=\"#How-can-I-insert-Unicode-characters-into-a-file-using-Vim\">37.11. How can I insert Unicode characters into a file using Vim?</a></li>\n      <li><a href=\"#How-can-I-know-which-digraphs-are-defined-and-for-which-characters\">37.12. How can I know which digraphs are defined and for which characters?</a></li>\n    </ul>\n  </li>\n  <li><a href=\"#AUTHOR\">AUTHOR</a></li>\n</ul>\n\n<h1 id=\"DESCRIPTION\">DESCRIPTION</h1>\n\n<p>This Vim FAQ is created from the questions and answers posted to the vim@vim.org user mailing list and the comp.editors newsgroup. There are several ways to solve a problem in Vim. This FAQ gives one of those several possibilities. You can explore the other ways using the information and links given in this FAQ. The credit for the answers in this FAQ goes to Peppe, Benji, Charles Campbell and numerous others. An online version of this FAQ is available at https://vimhelp.org/vim_faq.txt.html</p>\n\n<h1 id=\"GENERAL-INFORMATION\">GENERAL INFORMATION</h1>\n\n<pre><code>1.1. What is Vim?\n1.2. Who wrote Vim?\n1.3. Is Vim compatible with Vi?\n1.4. What are some of the improvements of Vim over Vi?\n1.5. Is Vim free?</code></pre>\n\n<h1 id=\"RESOURCES\">RESOURCES</h1>\n\n<pre><code>2.1. Where can I learn more about Vim?\n2.2. Is there a mailing list available?\n2.3. Is there an archive available for the Vim mailing lists?\n2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\n2.5. I have a &quot;xyz&quot; (some) problem with Vim. How do I determine if it is\n     a problem with my setup or with Vim?\n2.6. Where can I report bugs?\n2.7. Where can the FAQ be found?\n2.8. What if I don&#39;t find an answer in this FAQ?\n2.9. I have a patch for implementing a Vim feature. Where do I send the\n     patch?\n2.10. I have a Vim tip or developed a new Vim\n      syntax/indent/filetype/compiler plugin or developed a new script\n      or a colorscheme. Is there a public website where I can upload\n      this?</code></pre>\n\n<h1 id=\"AVAILABILITY\">AVAILABILITY</h1>\n\n<pre><code>3.1. What is the latest version of Vim?\n3.2. Where can I find the latest version of Vim?\n3.3. What platforms does it run on?\n3.4. Where can I download the latest version of the Vim runtime files?</code></pre>\n\n<h1 id=\"HELP\">HELP</h1>\n\n<pre><code>4.1. How do I use the help files?\n4.2. How do I search for a keyword in the Vim help files?\n4.3. I am getting an error message E123, what did I do wrong?\n4.4. Where can I read about the various modes in Vim?\n4.5. How do I generate the Vim help tags file after adding a new Vim\n     help file?\n4.6. Can I use compressed versions of the help files?</code></pre>\n\n<h1 id=\"EDITING-A-FILE\">EDITING A FILE</h1>\n\n<pre><code>5.1. How do I load a file in Vim for editing?\n5.2. How do I save the current file in another name (save as) and edit\n     a new file?\n5.3. How do I change the current directory to the directory of the\n     current file?\n5.4. How do I write a file without the line feed (EOL) at the end of\n     the file?\n5.5. How do I configure Vim to open a file at the last edited location?\n5.6. When editing a file in Vim, which is being changed by an external\n     application, Vim opens a warning window (like the confirm dialog)\n     each time a change is detected. How do I disable this warning?\n5.7. How do I edit a file whose name is under the cursor?\n5.8. How do I reload/re-edit the current file?\n5.9. How do I autosave a file periodically?\n5.10. How do I open a file in read-only mode?\n5.11. How do I open a file for editing without saving the modifications\n      to the current file?\n5.12. How do I reduce the loading time for very large files in Vim?</code></pre>\n\n<h1 id=\"EDITING-MULTIPLE-FILES\">EDITING MULTIPLE FILES</h1>\n\n<pre><code>6.1. How do I open multiple files at once from within Vim?\n6.2. How do I switch between multiple files/buffers in Vim?\n6.3. How do I open several files in Vim, with each file in a separate\n     window/tabpage?\n6.4. How do I configure Vim to autoload several files at once similar\n     to &quot;work-sets&quot; or &quot;projects&quot;?\n6.5. Is it possible to open multiple top level windows in a single\n     instance of Vim similar to Nedit or emacs?\n6.6. How do I browse/explore directories from within Vim?\n6.7. How do I edit files over a network using ftp/scp/rcp/http?</code></pre>\n\n<h1 id=\"BACKUP\">BACKUP</h1>\n\n<pre><code>7.1. When I edit and save files, Vim creates a file with the same name\n     as the original file and a &quot;~&quot; character at the end. How do I stop\n     Vim from creating this file (or) How do I disable the Vim backup\n     file feature?\n7.2. When I edit and save files, Vim creates a file with the same name\n     as the original file and a &quot;.un~&quot; extension at the end. How do I\n     stop Vim from creating this file (or) How do I disable the Vim\n     undofile feature.\n7.3. How do I configure Vim to store all the backup files in a\n     particular directory?\n7.4. When I save a file with Vim, the file permissions are changed.\n     How do I configure Vim to save a file without changing the file\n     permissions?</code></pre>\n\n<h1 id=\"BUFFERS\">BUFFERS</h1>\n\n<pre><code>8.1. I have made some modifications to a buffer. How do I edit another\n     buffer without saving the modified buffer and also without losing\n     the modifications?\n8.2. How do I configure Vim to auto-save a modified buffer when\n     switching to another buffer?\n8.3. How do I replace the buffer in the current window with a blank\n     buffer?\n8.4. Is there a keyboard shortcut to load a buffer by the buffer\n     number?\n8.5. How do I open all the current buffers in separate windows?\n8.6. How do I close (delete) a buffer without exiting Vim?\n8.7. When I use the command `:%bd` to delete all the buffers, not all\n     the buffers are deleted. Why?\n8.8. How do I display the buffer number of the current buffer/file?\n8.9. How do I delete a buffer without closing the window in which the\n     buffer is displayed?\n8.10. How do I map the &lt;Tab&gt; key to cycle through and open all the\n      buffers?</code></pre>\n\n<h1 id=\"WINDOWS\">WINDOWS</h1>\n\n<pre><code>9.1. What is the difference between a Vim window and a buffer?\n9.2. How do I increase the width of a Vim window?\n9.3. How do I zoom into or out of a window?\n9.4. How do I execute an ex command on all the open buffers or open\n     windows or all the files in the argument list?</code></pre>\n\n<h1 id=\"MOTION\">MOTION</h1>\n\n<pre><code>10.1. How do I jump to the beginning (first line) or end (last line) of\n      a file?\n10.2. In insert mode, when I press the &lt;Esc&gt; key to go to command mode,\n      the cursor moves one character to the left (except when the\n      cursor is on the first character of the line). Is it possible to\n      change this behavior to keep the cursor at the same column?\n10.3. How do I configure Vim to maintain the horizontal cursor position\n      when scrolling with the &lt;Page Up&gt;, &lt;Page Down&gt;, etc keys?\n10.4. Some lines in a file are more than the screen width and they are\n      all wrapped. When I use the j, k keys to move from one line to\n      the next, the cursor is moved to the next line in the file\n      instead of the next line on the screen. How do I move from one\n      screen line to the next?\n10.5. What is the definition of a sentence, paragraph and section in\n      Vim?\n10.6. How do I jump to beginning or end of a sentence, paragraph or a\n      section?\n10.7. I have lines in a file that extends beyond the right extent of the\n      screen. How do I move the Vim view to the right to see the text\n      off the screen?\n10.8. How do I scroll two or more buffers simultaneously?\n10.9. When I use my arrow keys, Vim changes modes, inserts weird\n      characters in my document but doesn&#39;t move the cursor properly.\n      What&#39;s going on?\n10.10. How do I configure Vim to move the cursor to the end of the\n       previous line, when the left arrow key is pressed and the cursor\n       is currently at the beginning of a line?\n10.11. How do I configure Vim to stay only in insert mode (modeless\n       editing)?\n10.12. How do I display some context lines when scrolling text?\n10.13. How do I go back to previous cursor locations?</code></pre>\n\n<h1 id=\"SEARCHING-TEXT\">SEARCHING TEXT</h1>\n\n<pre><code>11.1. After I searched for a text with a pattern, all the matched text\n      stays highlighted. How do I turn off the highlighting\n      temporarily/permanently?\n11.2. How do I enter a carriage return character in a search pattern?\n11.3. How do I search for the character &quot;^M&quot;?\n11.4. How can I search/replace characters that display as &quot;~R&quot;, &quot;~S&quot;,\n      etc.?\n11.5. How do I highlight all the non-printable characters in a file?\n11.6. How do I search for whole words in a file?\n11.7. How do I search for the current word under the cursor?\n11.8. How do I search for a word without regard to the case (uppercase\n      or lowercase)?\n11.9. How do I search for words that occur twice consecutively?\n11.10. How do I count the number of times a particular word occurs in a\n       buffer?\n11.11. How do I place the cursor at the end of the matched word when\n       searching for a pattern?\n11.12. How do I search for an empty line?\n11.13. How do I search for a line containing only a single character?\n11.14. How do I search and replace a string in multiple files?\n11.15. I am using the `:s` substitute command in a mapping. When a\n       search for a pattern fails, the map terminates. I would like the\n       map to continue processing the next command, even if the\n       substitute command fails. How do I do this?\n11.16. How do I search for the n-th occurrence of a character in a\n       line?\n11.17. How do I replace a tab (or any other character) with a hard\n       return (newline) character?\n11.18. How do I search for a character by its ASCII value?\n11.19. How do I search for long lines?\n11.20. How do I display all the lines in the current buffer that\n       contain a specified pattern?\n11.21. How do I search for a text string that spans multiple lines?\n11.22. How do I search for a pattern only within a range of lines\n       in a buffer?\n11.23. How do I clear the last searched pattern?\n11.24. Why does this pattern &quot;a.\\{-}p\\@!&quot; not match?\n11.25. How can I use &quot;/&quot; within a pattern, without escaping it?\n11.26. How can I operate on a search match?</code></pre>\n\n<h1 id=\"CHANGING-TEXT\">CHANGING TEXT</h1>\n\n<pre><code>12.1. How do I delete all the trailing white space characters (SPACE\n      and TAB) at the end of all the lines in a file?\n12.2. How do I replace all the occurrences of multiple consecutive\n      space characters to a single space?\n12.3. How do I reduce a range of empty lines into one line only?\n12.4. How do I delete all blank lines in a file? How do I remove all\n      the lines containing only space characters?\n12.5. How do I copy/yank the current word?\n12.6. How do I yank text from one position to another position within a\n      line, without yanking the entire line?\n12.7. When I yank some text into a register, how do I append the text\n      to the current contents of the register?\n12.8. How do I yank a complete sentence that spans over more than one\n      line?\n12.9. How do I yank all the lines containing a pattern into a buffer?\n12.10. How do I delete all the lines in a file that do not contain a\n       pattern?\n12.11. How do I add a line before each line with &quot;pattern&quot; in it?\n12.12. Is there a way to operate on a line if the previous line\n       contains a particular pattern?\n12.13. How do I execute a command on all the lines containing a\n       pattern?\n12.14. Can I copy the character above the cursor to the current cursor\n       position?\n12.15. How do I insert a blank line above/below the current line\n       without entering insert mode?\n12.16. How do I insert the name of the current file into the current\n       buffer?\n12.17. How do I insert the contents of a Vim register into the current\n       buffer?\n12.18. How do I move the cursor past the end of line and insert some\n       characters at some columns after the end of the line?\n12.19. How to replace the word under the cursor (say: junk) with\n       &quot;foojunkbar&quot; in Vim?\n12.20. How do I replace a particular text in all the files in a\n       directory?\n12.21. I have some numbers in a file. How do I increment or decrement\n       the numbers in the file?\n12.22. How do I reuse the last used search pattern in a `:substitute`\n       command?\n12.23. How do I change the case of a string using the `:substitute`\n       command?\n12.24. How do I enter characters that are not present in the keyboard?\n12.25. Is there a command to remove any or all digraphs?\n12.26. In insert mode, when I press the backspace key, it erases only\n       the characters entered in this instance of insert mode. How do I\n       erase previously entered characters in insert mode using the\n       backspace key?\n12.27. I have a file which has lines longer than 72 characters\n       terminated with &quot;+&quot; and wrapped to the next line. How can I\n       quickly join the lines?\n12.28. How do I paste characterwise yanked text into separate lines?\n12.29. How do I change the case (uppercase, lowercase) of a word or\n       a character or a block of text?\n12.30. How do I enter ASCII characters that are not present in the\n       keyboard?\n12.31. How do I replace non-printable characters in a file?\n12.32. How do I remove duplicate lines from a buffer?\n12.33. How do I prefix all the lines in a file with the corresponding\n       line numbers?\n12.34. How do I exchange (swap) two characters or words or lines?\n12.35. How do I change the characters used as word delimiters?</code></pre>\n\n<h1 id=\"COMPLETION-IN-INSERT-MODE\">COMPLETION IN INSERT MODE</h1>\n\n<pre><code>13.1. How do I complete words or lines in insert mode?\n13.2. How do I complete file names in insert mode?\n13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do\n      I complete words that occur after the just completed word?</code></pre>\n\n<h1 id=\"TEXT-FORMATTING\">TEXT FORMATTING</h1>\n\n<pre><code>14.1. How do I format a text paragraph so that a new line is inserted\n      at the end of each wrapped line?\n14.2. How do I format long lines in a file so that each line contains\n      less than &quot;n&quot; characters?\n14.3. How do I join short lines to the form a paragraph?\n14.4. How do I format bulleted and numbered lists?\n14.5. How do I indent lines in insert mode?\n14.6. How do I format/indent an entire file?\n14.7. How do I increase or decrease the indentation of the current\n      line?\n14.8. How do I indent a block/group of lines?\n14.9. When I indent lines using the &gt; or &lt; key, the standard 8-tabstops\n      are used instead of the current &#39;tabstop&#39; setting. Why?\n14.10. How do I turn off the automatic indentation of text?\n14.11. How do I configure Vim to automatically set the &#39;textwidth&#39;\n       option to a particular value when I edit mails?\n14.12. Is there a way to make Vim auto-magically break lines?\n14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n       &#39;fileformat&#39; option to &#39;dos&#39; and then &#39;unix&#39; and then &#39;mac&#39;.\n       None of these helped. How can I hide these symbols?\n14.14. When I paste some text into a Vim buffer from another\n       application, the alignment (indentation) of the new text is\n       messed up. How do I fix this?\n14.15. When there is a very long wrapped line (wrap is &quot;on&quot;) and a line\n       doesn&#39;t fit entirely on the screen it is not displayed at all.\n       There are blank lines beginning with &quot;@&quot; symbol instead of\n       wrapped line. If I scroll the screen to fit the line the &quot;@&quot;\n       symbols disappear and the line is displayed again. What Vim\n       setting control this behavior?\n14.16. How do I convert all the tab characters in a file to space\n       characters?\n14.17. What Vim options can I use to edit text that will later go to a\n       word processor?\n14.18. How do I join lines without adding or removing any space\n       characters?</code></pre>\n\n<h1 id=\"VISUAL-MODE\">VISUAL MODE</h1>\n\n<pre><code>15.1. How do I do rectangular block copying?\n15.2. How do I delete or change a column of text in a file?\n15.3. How do I apply an ex-command on a set of visually selected lines?\n15.4. How do I execute an ex command on a column of text selected in\n      Visual block mode?\n15.5. How do I select the entire file in visual mode?\n15.6. When I visually select a set of lines and press the &gt; key to\n      indent the selected lines, the visual mode ends. How can I\n      reselect the region for further operation?  (or) How do I\n      re-select the last selected visual area again?\n15.7. How do I jump to the beginning/end of a visually selected region?\n15.8. When I select text with mouse and then press : to enter an ex\n      command, the selected text is replaced with the : character. How\n      do I execute an ex command on a text selected using the mouse\n      similar to the text selected using the visual mode?\n15.9. When I select a block of text using the mouse, Vim goes into\n      selection mode instead of Visual mode. Why?</code></pre>\n\n<h1 id=\"COMMAND-LINE-MODE\">COMMAND-LINE MODE</h1>\n\n<pre><code>16.1. How do I use the name of the current file in the command mode or\n      an ex command line?\n16.2. How do I edit the text in the Vim command-line effectively?\n16.3. How do I switch from Vi mode to Ex mode?\n16.4. How do I copy the output from an ex-command into a buffer?\n16.5. When I press the &lt;Tab&gt; key to complete the name of a file in the\n      command mode, if there are more than one matching file names,\n      then Vim completes the first matching file name and displays a\n      list of all matching filenames. How do I configure Vim to only\n      display the list of all the matching filenames and not complete\n      the first one?\n16.6. How do I copy text from a buffer to the command line and from the\n      command line to a buffer?\n16.7. How do I put a command onto the command history without executing\n      it?\n16.8. How do I increase the height of the command-line?</code></pre>\n\n<h1 id=\"VIMINFO\">VIMINFO</h1>\n\n<pre><code>17.1. When I invoke Vim, I get error messages about illegal characters\n      in the viminfo file. What should I do to get rid of these\n      messages?\n17.2. How do I disable the viminfo feature?\n17.3. How do I save and use Vim marks/commands across Vim sessions?</code></pre>\n\n<h1 id=\"REMOTE-EDITING\">REMOTE EDITING</h1>\n\n<pre><code>18.1. How do I open a file with existing instance of gvim? What\n      happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n18.2. How do I send a command to a Vim server to write all buffers to\n      disk?\n18.3. Where can I get the documentation about the Vim remote server\n      functionality?</code></pre>\n\n<h1 id=\"OPTIONS\">OPTIONS</h1>\n\n<pre><code>19.1. How do I configure Vim in a simple way?\n19.2. How do I toggle the value of an option?\n19.3. How do I set an option that affects only the current\n      buffer/window?\n19.4. How do I use space characters for a Vim option value?\n19.5. Can I add (embed) Vim option settings to the contents of a file?\n19.6. How do I display the line numbers of all the lines in a file?\n19.7. How do I change the width of the line numbers displayed using the\n      &#39;number&#39; option?\n19.8. How do I display (view) all the invisible characters like space,\n      tabs and newlines in a file?\n19.9. How do I configure Vim to always display the current line and\n      column number?\n19.10. How do I display the current Vim mode?\n19.11. How do I configure Vim to show pending/partial commands on the\n       status line?\n19.12. How do I configure the Vim status line to display different\n       settings/values?\n19.13. How do I configure Vim to display status line always?\n19.14. How do I make a Vim setting persistent across different Vim\n       invocations/instances/sessions?\n19.15. Why do I hear a beep (why does my window flash) about 1 second\n       after I hit the Escape key?\n19.16. How do I make the &quot;c&quot; and &quot;s&quot; commands display a &quot;$&quot; instead of\n       deleting the characters I&#39;m changing?\n19.17. How do I remove more than one flag using a single `:set` command\n       from a Vim option?</code></pre>\n\n<h1 id=\"MAPPING-KEYS\">MAPPING KEYS</h1>\n\n<pre><code>20.1. How do I know what a key is mapped to?\n20.2. How do I list all the user-defined key mappings?\n20.3. How do I unmap a key?\n20.4. I am not able to create a mapping for the &lt;xxx&gt; key. What is\n      wrong?\n20.5. Why does mapping the &lt;C-...&gt; key not work?\n20.6. How do I map the numeric keypad keys?\n20.7. How do I create a mapping that works only in visual mode?\n20.8. How do I create a mapping that works only in normal and operator\n      pending mode (but not in visual mode)?\n20.9. In a Vim script, how do I know which keys to use for my mappings,\n      so that the mapped key will not collide with an already used key?\n20.10. How do I map the escape key?\n20.11. How do I map a key to perform nothing?\n20.12. I want to use the &lt;Tab&gt; key to indent a block of text and\n       &lt;Shift-Tab&gt; key to unindent a block of text. How do I map the keys\n       to do this?  This behavior is similar to textpad, visual studio,\n       etc.\n20.13. In my mappings the special characters like &lt;CR&gt; are not\n       recognized. How can I configure Vim to recognize special\n       characters?\n20.14. How do I use the &quot;|&quot; to separate multiple commands in a map?\n20.15. If I have a mapping/abbreviation whose ending is the beginning of\n       another mapping/abbreviation, how do I keep the first from\n       expanding into the second one?\n20.16. Why does it take a second or more for Vim to process a key,\n       sometimes when I press a key?\n20.17. How do I map a key to run an external command using a visually\n       selected text?\n20.18. How do I map the CTRL-I key while still retaining the\n       functionality of the &lt;Tab&gt; key?\n20.19. How do I define a map to accept a count?\n20.20. How can I make my normal mode mapping work from within Insert\n       Mode?</code></pre>\n\n<h1 id=\"ABBREVIATIONS\">ABBREVIATIONS</h1>\n\n<pre><code>21.1. How do I auto correct misspelled words?\n21.2. How do I create multi-line abbreviations?\n21.3. When my abbreviations are expanded, an additional space character\n      is added at the end of the expanded text. How do I avoid this\n      character?\n21.4. How do I insert the current date/time stamp into the file?\n21.5. How do I prevent an abbreviation from expanding in insert mode?</code></pre>\n\n<h1 id=\"RECORD-AND-PLAYBACK\">RECORD AND PLAYBACK</h1>\n\n<pre><code>22.1. How do I repeat an editing operation (insertion, deletion, paste,\n      etc)?\n22.2. How I record and repeat a set of key sequences?\n22.3. How do I edit/modify a recorded set of key sequences?\n22.4. How do I write recorded key sequences to a file?\n22.5. I am using register 0 to record my key sequences (i.e. q0 ....\n      q). In the recorded key sequences, I am yanking some text.  After\n      the first replay of the recorded key sequence, I am no longer\n      able to play it back.</code></pre>\n\n<h1 id=\"AUTOCOMMANDS\">AUTOCOMMANDS</h1>\n\n<pre><code>23.1. How do I execute a command when I try to modify a read-only file?\n23.2. How do I execute a command every time when entering a buffer?\n23.3. How do I execute a command every time when entering a window?\n23.4. From an autocmd, how can I determine the name of the file or the\n      buffer number for which the autocommand is executed?\n23.5. How do I automatically save all the changed buffers whenever Vim\n      loses focus?\n23.6. How do I execute/run a function when Vim exits to do some\n      cleanup?</code></pre>\n\n<h1 id=\"SYNTAX-HIGHLIGHT\">SYNTAX HIGHLIGHT</h1>\n\n<pre><code>24.1. How do I turn off/on syntax highlighting?\n24.2. How do I change the background and foreground colors used by Vim?\n24.3. How do I change the highlight colors to suit a dark/light\n      background?\n24.4. How do I change the color of the line numbers displayed when the\n      `:set number` command is used?\n24.5. How do I change the background color used for a Visually selected\n      block?\n24.6. How do I highlight the special characters (tabs, trailing spaces,\n      end of line, etc) displayed by the &#39;list&#39; option?\n24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that\n      Vim uses the specified colorscheme every time?\n24.8. Vim syntax highlighting is broken. When I am editing a file, some\n      parts of the file is not syntax highlighted or syntax highlighted\n      incorrectly.\n24.9. Is there a built-in function to syntax-highlight the\n      corresponding matching bracket?\n24.10. How do I turn off the C comment syntax highlighting?\n24.11. How do I add my own syntax extensions to the standard syntax\n       files supplied with Vim?\n24.12. How do I replace a standard syntax file that comes with the Vim\n       distribution with my own syntax file?\n24.13. How do I highlight all the characters after a particular column?\n24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n       highlighting into a HTML file?\n24.15. How do I list the definition of all the current highlight\n       groups?\n24.16. How can I embed one syntax highlighting language into another\n       one?</code></pre>\n\n<h1 id=\"VIM-SCRIPT-WRITING\">VIM SCRIPT WRITING</h1>\n\n<pre><code>25.1. How do I list the names of all the scripts sourced by Vim?\n25.2. How do I debug Vim scripts?\n25.3. How do I locate the script/plugin which sets a Vim option?\n25.4. I am getting some error/informational messages from Vim (possibly\n      when running a script), the messages are cleared immediately. How\n      do I display the messages again?\n25.5. How do I save and restore a plugin specific information across\n      Vim invocations?\n25.6. How do I start insert mode from a Vim function?\n25.7. How do I change the cursor position from within a Vim function?\n25.8. How do I check the value of an environment variable in the .vimrc\n      file?\n25.9. How do I check whether an environment variable is set or not from\n      a Vim function?\n25.10. How do I call/use the Vim built-in functions?\n25.11. I am using some normal mode commands in my Vim script. How do I\n       avoid using the user-defined mappings for these normal mode\n       commands and use the standard Vim functionality for these normal\n       mode commands?\n25.12. How do I get a visually selected text into a Vim variable or\n       register?\n25.13. I have some text in a Vim variable &quot;myvar&quot;. I would like to use\n       this variable in a `:s` substitute command to replace a text\n       &quot;mytext&quot;. How do I do this?\n25.14. A Vim variable (bno) contains a buffer number. How do I use this\n       variable to open the corresponding buffer?\n25.15. How do I store the value of a Vim option into a Vim variable?\n25.16. I have copied and inserted some text into a buffer from a Vim\n       function. How do I indent the inserted text from the Vim\n       function?\n25.17. How do I get the character under the cursor from a Vim script?\n25.18. How do I get the name of the current file without the extension?\n25.19. How do I get the basename of the current file?\n25.20. How do I get the output from a Vim function into the current\n       buffer?\n25.21. How do I call external programs from a Vim function?\n25.22. How do I get the return status of a program executed using the\n       `:!` command?\n25.23. How do I determine whether the current buffer is modified or\n       not?\n25.24. I would like to use the carriage return character in a normal\n       command from a Vim script. How do I specify the carriage return\n       character?\n25.25. How do I split long lines in a Vim script?\n25.26. When I try to &quot;execute&quot; my function using the `:execute Myfunc()`\n       command, the cursor is moved to the top of the current buffer.\n       Why?\n25.27. How do I source/execute the contents of a register?\n25.28. After calling a Vim function or a mapping, when I press the &quot;u&quot;\n       key to undo the last change, Vim undoes all the changes made by\n       the mapping/function. Why?\n25.29. How can I call a function defined with s: (script local\n       function) from another script/plugin?\n25.30. Is it possible to un-source a sourced script? In other words,\n       reverse all the commands executed by sourcing a script.</code></pre>\n\n<h1 id=\"PLUGINS\">PLUGINS</h1>\n\n<pre><code>26.1. How do I set different options for different types of files?\n26.2. I have downloaded a Vim plugin or a syntax file or a indent file,\n      or a color scheme or a filetype plugin from the web. Where should\n      I copy these files so that Vim will find them?\n26.3. How do I extend an existing filetype plugin?\n26.4. How do I turn off loading the Vim plugins?\n26.5. How do I turn on/off loading the filetype plugins?\n26.6. How do I override settings made in a file type plugin in the\n      global ftplugin directory for all the file types?\n26.7. How do I disable the Vim directory browser plugin?\n26.8. How do I set the filetype option for files with names matching a\n      particular pattern or depending on the file extension?</code></pre>\n\n<h1 id=\"EDITING-PROGRAM-FILES\">EDITING PROGRAM FILES</h1>\n\n<pre><code>27.1. How do I enable automatic indentation for C/C++ files?\n27.2. How do I configure the indentation used for C/C++ files?\n27.3. How do I turn off the automatic indentation feature?\n27.4. How do I change the number of space characters used for the\n      automatic indentation?\n27.5. I am editing a C program using Vim. How do I display the\n      definition of a macro or a variable?\n27.6. I am editing a C program using Vim. How do I jump to the\n      beginning or end of a code block from within the block?\n27.7. When editing C++ files and when inserting new lines above or\n      below a comment (//) line, Vim automatically inserts the C++\n      comment character (//) at the beginning of the line. How do I\n      disable this? (*Updated*)\n27.8. How do I add the comment character &quot;#&quot; to a set of lines at the\n      beginning of each line?\n27.9. How do I edit a header file with the same name as the\n      corresponding C source file?\n27.10. How do I automatically insert comment leaders while typing\n       comments?</code></pre>\n\n<h1 id=\"QUICKFIX\">QUICKFIX</h1>\n\n<pre><code>28.1. How do I build programs from Vim?\n28.2. When I run the make command in Vim I get the errors listed as the\n      compiler compiles the program. When it finishes this list\n      disappears and I have to use the `:clist` command to see the error\n      message again. Is there any other way to see these error\n      messages?\n28.3. How can I perform a command for each item in the\n      quickfix/location list?</code></pre>\n\n<h1 id=\"FOLDING\">FOLDING</h1>\n\n<pre><code>29.1. How do I extend the Vim folding support?\n29.2. When I enable folding by setting the &#39;foldmethod&#39; option, all the\n      folds are closed. How do I prevent this?\n29.3. How do I control how many folds will be opened when I start\n      editing a file?\n29.4. How do I open and close folds using the mouse?\n29.5. How do I change the text displayed for a closed fold?\n29.6. How do I store and restore manually created folds across\n      different Vim invocations?\n29.7. I have enabled syntax based folding. Why is Vim so slow?</code></pre>\n\n<h1 id=\"VIM-WITH-EXTERNAL-APPLICATIONS\">VIM WITH EXTERNAL APPLICATIONS</h1>\n\n<pre><code>30.1. Can I run a shell inside a Vim window?\n30.2. How do I pass the word under the cursor to an external command?\n30.3. How do I get the output of a shell command into a Vim buffer?\n30.4. How do I pipe the contents of the current buffer to an external\n      command and replace the contents of the buffer with the output\n      from the command?\n30.5. How do I sort a section of my file?\n30.6. How do I use Vim as a pager?\n30.7. How do I view Unix man pages from inside Vim?\n30.8. How do I change the diff command used by the Vim diff support?\n30.9. How do I use the Vim diff mode without folding?</code></pre>\n\n<h1 id=\"GUI-VIM\">GUI VIM</h1>\n\n<pre><code>31.1. How do I create buffer specific menus?\n31.2. How do I change the font used by GUI Vim?\n31.3. When starting GUI Vim, how do I specify the location of the GVIM\n      window?\n31.4. How do I add a horizontal scrollbar in GVim?\n31.5. How do I make the scrollbar appear in the left side by default?\n31.6. How do I remove the Vim menubar?\n31.7. I am using GUI Vim. When I press the &lt;Alt&gt; key and a letter, the\n      menu starting with that letter is selected. I don&#39;t want this\n      behavior as I want to map the &lt;Alt&gt;-&lt;key&gt; combination. How do I do\n      this?\n31.8. Is it possible to scroll the text by dragging the scrollbar so\n      that the cursor stays in the original location?\n31.9. How do I get gvim to start browsing files in a particular\n      directory when using the `:browse` command?\n31.10. For some questions, like when a file is changed outside of Vim,\n       Vim displays a GUI dialog box. How do I replace this GUI dialog\n       box with a console dialog box?\n31.11. I am trying to use GUI Vim as the editor for my xxx application.\n       When the xxx application launches GUI Vim to edit a file, the\n       control immediately returns to the xxx application. How do I\n       start GUI Vim, so that the control returns to the xxx\n       application only after I quit Vim?\n31.12. Why does the &quot;Select Font&quot; dialog doesn&#39;t show all the fonts\n       installed in my system?\n31.13. How do I use the mouse in Vim command-line mode?\n31.14. When I use the middle mouse button to scroll text, it pastes the\n       last copied text. How do I disable this behavior?\n31.15. How do I change the location and size of a GUI Vim window?\n31.16. When splitting the Vim window vertically, Vim changes\n       the position.</code></pre>\n\n<h1 id=\"VIM-ON-UNIX\">VIM ON UNIX</h1>\n\n<pre><code>32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim\n      freezes. What should I do now?\n32.2. I am seeing weird screen update problems in Vim. What can I do to\n      solve this screen/display update problems?\n32.3. I am using the terminal/console version of Vim. In insertmode,\n      When I press the backspace key, the character before the cursor\n      is not erased. How do I configure Vim to do this?\n32.4. I am using Vim in a xterm. When I quit Vim, the screen contents\n      are restored back to the original contents. How do I disable\n      this?\n32.5. When I start Vim, it takes quite a few seconds to start. How do I\n      minimize the startup time?\n32.6. How can I make the cursor in gvim in unix stop blinking?\n32.7. How do I change the menu font on GTK Vim?\n32.8. How do I prevent CTRL-Z from suspending Vim?\n32.9. When I kill the xterm running Vim, the Vim process continues to\n      run and takes up a lot of CPU (99%) time. Why is this happening?\n32.10. How do I get the Vim syntax highlighting to work in a Unix\n       terminal?</code></pre>\n\n<h1 id=\"VIM-ON-MS-WINDOWS\">VIM ON MS-WINDOWS</h1>\n\n<pre><code>33.1. In MS-Windows, CTRL-V doesn&#39;t start the blockwise visual mode.\n      What happened?\n33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do\n      I configure Vim to treat CTRL-Y as CTRL-Y?\n33.3. How do I start GUI Vim in a maximized window always?\n33.4. After doing some editing operations, Vim freezes. The cursor\n      becomes an empty rectangle. I am not able enter any characters.\n      What is happening?\n33.5. I am using Windows XP, the display speed of maximized GVim is\n      very slow. What can I do to speed the display updates?\n33.6. What are the recommended settings for using Vim with cygwin?\n33.7. I am trying to use GNU diff with Vim diff mode. When I run the\n      diff from command line, it works. When I try to use the diff with\n      Vim it doesn&#39;t work. What should I do now?\n33.8. Is it possible to use Vim as an external editor for MS-Windows\n      Outlook email client?\n33.9. I am using Vim to edit HTML files. How do I start internet\n      explorer with the current file to preview the HTML file?\n33.10. I would like to use Vim with Microsoft Visual Studio. How do I\n       do this?\n33.11. Where do I place the _vimrc and _gvimrc files?\n33.12. Every time I save a file, Vim warns about the file being changed\n       outside of Vim. Why?</code></pre>\n\n<h1 id=\"PRINTING\">PRINTING</h1>\n\n<pre><code>34.1. How do I print a file along with line numbers for all the lines?\n34.2. How do I print a file with the Vim syntax highlighting colors?</code></pre>\n\n<h1 id=\"BUILDING-VIM-FROM-SOURCE\">BUILDING VIM FROM SOURCE</h1>\n\n<pre><code>35.1. How do I build Vim from the sources on a Unix system?\n35.2. How do I install Vim in my home directory or a directory other\n      than the default installation directory in Unix?\n35.3. How do I build Vim from the sources on a MS-Windows system?\n35.4. The Vim help, syntax, indent files are missing from my Vim\n      installation. How do I install these files?\n35.5. I have built Vim from the source and installed the Vim package\n      using &quot;make install&quot;. Do I need to keep the Vim source directory?\n35.6. How do I determine the Vim features which are enabled at compile\n      time?\n35.7. Can I build Vim without the GUI support?\n35.8. When building Vim on a Unix system, I am getting &quot;undefined\n      reference to term_set_winsize&quot; error. How do I resolve this\n      error?\n35.9. Vim configure keeps complaining about the lack of gtk-config\n      while trying to use GTK 2.03. This is correct, since in GTK 2\n      they moved to using the generic pkg-config. I can get pkg-config\n      to list the various includes and libs for gtk, but for some\n      reason the configure script still isn&#39;t picking this up.\n35.10. I did successfully download the sources and compiled Vim on\n       Unix. But feature ... still does not work. What is wrong and\n       how can I fix it?</code></pre>\n\n<h1 id=\"VARIOUS\">VARIOUS</h1>\n\n<pre><code>36.1. How do I edit binary files with Vim?\n36.2. How do I disable the visual error flash and the error beep?\n36.3. How do I display the ascii value of a character displayed in a\n      buffer?\n36.4. Can I use zero as a count for a Vim command?\n36.5. How do I disable the Vim welcome screen?\n36.6. How do I avoid the &quot;hit enter to continue&quot; prompt?\n36.7. How do I invoke Vim from command line to run a group of commands\n      on a group of files?\n36.8. How do I use a normal mode command from insert mode without\n      leaving the insert mode?\n36.9. How do I start Vim in insert mode?\n36.10. How do I use Copy and Paste with Vim?\n36.11. Why shouldn&#39;t I modify the files in the system runtime\n       directory?</code></pre>\n\n<h1 id=\"UNICODE\">UNICODE</h1>\n\n<pre><code>37.1. Is it possible to create Unicode files using Vim?\n37.2. Which Vim settings are particularly important for editing Unicode\n      files?\n37.3. What is the &#39;encoding&#39; option?\n37.4. How does Vim name the various Unicode encodings?\n37.5. How does Vim specify the presence or absence of a byte-order\n      mark?\n37.6. What is the &#39;fileencoding&#39; option?\n37.7. What is the &#39;fileencodings&#39; option?\n37.8. What is the &#39;termencoding&#39; option?\n37.9. What is the &#39;bomb&#39; option?\n37.10. Where can I find an example of a typical use of all these\n       options?\n37.11. How can I insert Unicode characters into a file using Vim?\n37.12. How can I know which digraphs are defined and for which\n       characters?</code></pre>\n\n<h1 id=\"GENERAL-INFORMATION1\">GENERAL INFORMATION</h1>\n\n<h2 id=\"What-is-Vim\">1.1. What is Vim?</h2>\n\n<p>Vim stands for Vi IMproved. It used to be Vi IMitation, but there are so many improvements that a name change was appropriate. Vim is a text editor which includes almost all the commands from the Unix program &quot;Vi&quot; and a lot of new ones. All commands can be given with the keyboard. This has the advantage that you can keep your fingers on the keyboard and your eyes on the screen. For those who want it, there is mouse support and a GUI version with scrollbars and menus.</p>\n\n<p>Vim is an editor, not a word processor. A word processor is used mainly to do layout of text. This means positioning it, changing the way it appears on output. More often than not, the final document is meant to be printed or typeset or what have you, in order to present it in a pleasing manner to others. Examples of word processors are Microsoft Word, FrameMaker, and OpenOffice Writer.</p>\n\n<p>An editor is simply for entering text. Any typesetting or laying out of the document is secondary. With an editor, one&#39;s main concern is entering text, not making the text look good. Examples of editors other than Vim and Vi are Emacs, TextMate, Ultraedit and gedit. And Notepad.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help intro</b></p>\n\n<h2 id=\"Who-wrote-Vim\">1.2. Who wrote Vim?</h2>\n\n<p>Most of Vim is based on Stevie and was written by Bram Moolenaar, with contributions from too many people to mention here.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help author</b></p>\n\n<p><b>:help credits</b></p>\n\n<h2 id=\"Is-Vim-compatible-with-Vi\">1.3. Is Vim compatible with Vi?</h2>\n\n<p>Yes. Vim is very much compatible with Vi. You can use the &quot;-C&quot; command-line flag to start Vim in Vi compatible mode:</p>\n\n<pre><code>$ vim -C</code></pre>\n\n<p>You can also use:</p>\n\n<pre><code>$ vim -u NONE</code></pre>\n\n<p>You can also set the &#39;compatible&#39; option to enable Vi compatibility:</p>\n\n<pre><code>:set compatible</code></pre>\n\n<p>If you want to make sure, to start Vim in a &#39;nocompatible&#39; mode to original Vi, supply the -N command line argument:</p>\n\n<pre><code>$ vim -N</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help -C</b></p>\n\n<p><b>:help -N</b></p>\n\n<p><b>:help &#39;compatible&#39;</b></p>\n\n<p><b>:help compatible-default</b></p>\n\n<h2 id=\"What-are-some-of-the-improvements-of-Vim-over-Vi\">1.4. What are some of the improvements of Vim over Vi?</h2>\n\n<p>A short summary of the improvements of Vim over vi is listed below. The list shows that Vim is a thoroughly modern and feature-packed editor. Standard features of modern editors are implemented, and there is an equal emphasis on general power-user features and features for programmers.</p>\n\n<h3 id=\"Features-to-modernise-Vi\">Features to modernise Vi:</h3>\n\n<h4 id=\"Multi-level-undo\">Multi-level undo</h4>\n\n<pre><code>Allows you to set the number of times you can undo your changes in a\nfile buffer. You can also redo an undone change.\nAlso starting with version 7.3 Vim can permanently store your undo\ninformation, so that you can undo your changes which you have done\nin a previous editing session.</code></pre>\n\n<h4 id=\"Tabs-Multiple-windows-and-buffers\">Tabs, Multiple windows and buffers</h4>\n\n<pre><code>Each file can be displayed in its own window. You can move easily from\none window to another. Each file opened during a Vim session also has\nan associated buffer and you can easily jump from one to the other.\nAlso like any modern GUI, Vim supports opening several files in tabs.\nYou can do batch processing for tabs, buffers, windows and the\nargumentlist.</code></pre>\n\n<h4 id=\"Flexible-insert-mode\">Flexible insert mode</h4>\n\n<pre><code>Vim allows you to use the arrow keys while in insert mode to move\naround in the file. No more hitting &lt;Esc&gt;, moving around, then hitting\n`i&#39; or `a&#39;.</code></pre>\n\n<h4 id=\"Macros\">Macros</h4>\n\n<pre><code>Vim has a facility which allows you to record a sequence of typed\ncharacters and repeat them any number of times.</code></pre>\n\n<h4 id=\"Visual-mode\">Visual mode</h4>\n\n<pre><code>You can highlight sections of text and execute operations on this\nsection of text only.</code></pre>\n\n<h4 id=\"Block-operators\">Block operators</h4>\n\n<pre><code>Allow selection and highlighting of rectangular blocks of text in\norder do execute specific operations on them.</code></pre>\n\n<h4 id=\"Online-help-system\">Online help system</h4>\n\n<pre><code>You can easily find help on any aspect of using Vim. Help is displayed\nin its own window.</code></pre>\n\n<h4 id=\"Command-line-editing-and-history\">Command-line editing and history</h4>\n\n<pre><code>History allows you to use the arrow keys to repeat or search for a\ncommand that has already been typed. Allows you to match the beginning\nof a command with the beginning of another similar command in the\nhistory buffer. You can also edit a command to correct typos or change\na few values.</code></pre>\n\n<h4 id=\"Command-line-completion\">Command line completion.</h4>\n\n<pre><code>Using the &lt;Tab&gt; key, you can complete commands, options, filenames,\netc. as needed.</code></pre>\n\n<h4 id=\"Horizontal-scrolling\">Horizontal scrolling.</h4>\n\n<pre><code>Long lines can be scrolled horizontally (with or without the GUI).</code></pre>\n\n<h4 id=\"Unicode-and-internationalization-improvements\">Unicode and internationalization improvements.</h4>\n\n<pre><code>Vim is able to edit files in unicode encoding and uses internally an\nutf-8 encoding. Additionally Vim can display text right to left\noriented.</code></pre>\n\n<h3 id=\"Advanced-user-features\">Advanced user features:</h3>\n\n<h4 id=\"Text-formatting\">Text formatting</h4>\n\n<pre><code>With two keystrokes, you can format large sections of text, without\nthe use of external programs.</code></pre>\n\n<h4 id=\"Completion-in-Insert-mode\">Completion in Insert mode</h4>\n\n<pre><code>Vim provides several different possibilities to complete your text.\nFor example Vim can complete words while you are typing, by matching\nthe current word with other similar words in the file.</code></pre>\n\n<h4 id=\"Jump-tags\">Jump tags</h4>\n\n<pre><code>Just like in an internet browser, you can jump back to previous parts\nof the text you were editing, and then forward again.  Your brain is\nthus free to edit instead of navigate.</code></pre>\n\n<h4 id=\"Automatic-commands\">Automatic commands</h4>\n\n<pre><code>Commands automatically executed when reading or writing a file,\njumping to another buffer, etc.</code></pre>\n\n<h4 id=\"Viminfo\">Viminfo</h4>\n\n<pre><code>Allows storing of the command line history, marks and registers in a\nfile to be read on startup.  Therefore, you can recall old search\npatterns, macros, etc., in a new Vim session.</code></pre>\n\n<h4 id=\"Mouse-support\">Mouse support</h4>\n\n<pre><code>The mouse is supported in an xterm and for MS-DOS. It can be used to\nposition the cursor, select the visual area, paste a register, etc.</code></pre>\n\n<h4 id=\"Graphical-User-Interface-GUI\">Graphical User Interface (GUI)</h4>\n\n<pre><code>There are several different graphical user interfaces available.\nAlso, it&#39;s very easy to add your own menus.  Of course, console vim is\nstill supported, and very widely used.</code></pre>\n\n<h4 id=\"Scripting-language\">Scripting language</h4>\n\n<pre><code>Vim has a powerful scripting language so new commands can be created.\nYou can also use Perl, Python, TCL, Lua and Ruby to achieve the same\nthing!</code></pre>\n\n<h4 id=\"Plugins\">Plugins</h4>\n\n<pre><code>Extra functionality implemented via vim commands (regular commands or\nthe scripting language) that is automatically loaded on startup.\nExamples: file explorer, network editing, enhanced autocompletion,\nsyntax checks.\nMore are being developed and shared on VimOnline all the time.</code></pre>\n\n<h4 id=\"Syntax-highlighting-for-many-programming-languages\">Syntax highlighting for many programming languages</h4>\n\n<pre><code>Syntax highlighting (including concealing items) for hundreds of\nprogramming languages is supported. Support for others can be\nadded.</code></pre>\n\n<h4 id=\"Extended-regular-expressions\">Extended regular expressions</h4>\n\n<pre><code>Vim supports extended regular expressions which are similar in\nfunctionality to that of Perl regular expressions.</code></pre>\n\n<h4 id=\"Integrated-Spell-checking\">Integrated Spell checking</h4>\n\n<pre><code>Spell checking has been integrated into Vim.</code></pre>\n\n<h4 id=\"Diff-mode\">Diff mode</h4>\n\n<pre><code>Vim can highlight the differences between two, three or four files.\nIdentical lines will be folded away and hidden.</code></pre>\n\n<h4 id=\"Encryption-using-the-blowfish-algorithm\">Encryption using the blowfish algorithm</h4>\n\n<pre><code>Vim allows to encrypt your files using the symmetric block cipher\nblowfish as well as the swap file.</code></pre>\n\n<h4 id=\"Extensive-customizable\">Extensive customizable</h4>\n\n<pre><code>Vim can be tuned and customized to work like you want by setting\noptions. You can define your own commands, macros and even plugins\nto extend its capabilities</code></pre>\n\n<h4 id=\"Packages\">Packages</h4>\n\n<pre><code>Packages have been added to keep the installation of the growing\nnumber of plugins manageable. This is a convenient way to get one\nor more plugins, drop them in a directory and keep them updated.\nVim will load them automatically, or only when desired.</code></pre>\n\n<h3 id=\"Programming-performance-features\">Programming performance features:</h3>\n\n<h4 id=\"Edit-compile-edit-speedup\">Edit-compile-edit speedup</h4>\n\n<pre><code>You can compile within Vim and automatically jump to the location of\nerrors in the source code.</code></pre>\n\n<h4 id=\"Indenting-for-many-programming-languages\">Indenting for many programming languages</h4>\n\n<pre><code>C, C++, Java, Perl, XML and many other languages can be automatically\nindented by vim while you type.  Support for others can be added.</code></pre>\n\n<h4 id=\"Searching-for-words-in-include-files\">Searching for words in include files</h4>\n\n<pre><code>Vim allows you to search for a match of the word under the cursor in\nthe current and included files.</code></pre>\n\n<h4 id=\"Advanced-text-objects\">Advanced text objects</h4>\n\n<pre><code>Instantly select, delete, copy, indent, format, change case, or ...\nto all the text between ( and ), or { and }, or &lt; and &gt;, or [ and\n].  Or a word, sentence, or paragraph.  Very powerful.</code></pre>\n\n<h4 id=\"Folding\">Folding</h4>\n\n<pre><code>Certain parts of the text can be &quot;folded&quot; away.  The best example is\nthe body of a function.  You can get an overview of the code, and then\nopen the fold of the function whose detail you need to see.</code></pre>\n\n<h4 id=\"ctags-and-cscope-integration\">ctags and cscope integration</h4>\n\n<pre><code>Using these two powerful programs, you can jump to a definition of a\nfunction from a calling instance of it, and use other tricks to\nnavigate source code.</code></pre>\n\n<h4 id=\"Integration-of-several-programming-languages\">Integration of several programming languages</h4>\n\n<pre><code>If you find the internal scripting language not powerful enough, you\ncan extend Vim using Lua, Ruby, Tcl, Perl and Python 2 and 3.</code></pre>\n\n<h4 id=\"Asynchronous-I-O-support\">Asynchronous I/O support</h4>\n\n<pre><code>Vim uses jobs and channels to talk to other programs\nasynchronously. This allows to have e.g. a compiler run in the\nbackground and open the quickfix list as soon as it is finished to\nfix warnings and errors.</code></pre>\n\n<h4 id=\"Timers\">Timers</h4>\n\n<pre><code>Timers are asynchronous and can fire once or repeatedly to invoke a\nfunction to do any work.</code></pre>\n\n<h3 id=\"For-more-information-read\">For more information, read:</h3>\n\n<p><b>:help vi-differences</b></p>\n\n<h2 id=\"Is-Vim-free\">1.5. Is Vim free?</h2>\n\n<p>Vim is Charityware. There are no restrictions on using or copying Vim, but the author encourages you to make a donation to charity. A document explaining how to do so is included in the distribution.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help copyright</b></p>\n\n<h1 id=\"RESOURCES1\">RESOURCES</h1>\n\n<h2 id=\"Where-can-I-learn-more-about-Vim\">2.1. Where can I learn more about Vim?</h2>\n\n<p>You can post your Vim questions to the vim@vim.org mailing list. You can post your Vim development related questions to the vim-dev@vim.org mailing list. Vim does not have a newsgroup of its own. But the appropriate newsgroup to post to is comp.editors.</p>\n\n<p>&quot;VimOnline&quot; is a web page that serves as a de facto homepage for vim, although the main purpose of it is to gather tips and scripts from everywhere. Get involved! The URL is https://www.vim.org</p>\n\n<p>Finally, read the Vi FAQ:</p>\n\n<pre><code>http://www.faqs.org/faqs/editor-faq/vi/part1/index.html</code></pre>\n\n<p>Finally, there are also some communities, where you can discuss features or ask questions:</p>\n\n<pre><code>https://vi.stackexchange.com\nhttps://vim.reddit.com</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help mail-list</b></p>\n\n<p><b>:help internet</b></p>\n\n<h2 id=\"Is-there-a-mailing-list-available\">2.2. Is there a mailing list available?</h2>\n\n<p>There are several:</p>\n\n<pre><code>NAME              DESCRIPTION\n----------------  ---------------------------------------------\nvim-announce      Announcements of new releases\nvim               General discussion\nvim-dev           Patches, bug reports, development discussions\nvim-mac           Macintosh discussion\nvim-fr            General discussion in French</code></pre>\n\n<p>Of these, only vim and vim-dev are of general interest. vim-announce is read-only to most people, and its messages are sent to the other lists as well. The remaining four are very low volume.</p>\n\n<pre><code>ACTION            EMAIL SEND TO\n----------------  --------------------------\nTo subscribe:     &lt;NAME&gt;-subscribe@vim.org\nTo unsubscribe:   &lt;NAME&gt;-unsubscribe@vim.org\nTo get help:      &lt;NAME&gt;-help@vim.org</code></pre>\n\n<p>The available mailing lists are also mentioned here:</p>\n\n<pre><code>https://www.vim.org/maillist.php</code></pre>\n\n<h2 id=\"Is-there-an-archive-available-for-the-Vim-mailing-lists\">2.3. Is there an archive available for the Vim mailing lists?</h2>\n\n<p>Yes. Visit https://groups.yahoo.com/, where name is one of: vimannounce, vim, vimdev, vim-fr, vim-mac, vim-vms.</p>\n\n<p>Alternatively, visit www.gmane.org to find out about GMANE, which allows you to access the mailing lists as though they were newsgroups. This offers some convenience to those who wish to browse the history or casually observe the current threads.</p>\n\n<h2 id=\"Where-can-I-get-the-Vim-user-manual-in-HTML-PDF-PS-format\">2.4. Where can I get the Vim user manual in HTML/PDF/PS format?</h2>\n\n<p>You can download the HTML/PDF/PS format of the Vim user manual from:</p>\n\n<pre><code>https://vimdoc.sourceforge.net/</code></pre>\n\n<p>Note, the user manual from that page is currently pretty outdated. It&#39;s best to either use the documentation that comes with vim or use the online version at https://vimhelp.org</p>\n\n<p>You can find a pdf version of the full English help, including this faq (in letter, A4 and Ipad format) at:</p>\n\n<pre><code>https://nathangrigg.com/vimhelp/</code></pre>\n\n<p>This document is cross-referenced, so you can use the hyperlink functionality.</p>\n\n<h2 id=\"I-have-a-xyz-some-problem-with-Vim.-How-do-I-determine-if-it-is-a-problem-with-my-setup-or-with-Vim-Have-I-found-a-bug-in-Vim\">2.5. I have a &quot;xyz&quot; (some) problem with Vim. How do I determine if it is a problem with my setup or with Vim? / Have I found a bug in Vim?</h2>\n\n<p>First, you need to find out, whether the error is in the actual runtime files or any plugin that is distributed with Vim or whether it is a simple side effect of any configuration option from your .vimrc or .gvimrc. So first, start vim like this:</p>\n\n<pre><code>vim -u NONE -U NONE -N -i NONE</code></pre>\n\n<p>This starts Vim in nocompatible mode (-N), without reading your viminfo file (-i NONE), without reading any configuration file (-u NONE for not reading .vimrc file and -U NONE for not reading a .gvimrc file) or even plugin.</p>\n\n<p>In this invocation, try to reproduce your problem. If the error persists, the chance is good you&#39;ve found a bug in Vim (see also Question 2.6.)</p>\n\n<p>If the error does not occur when starting Vim this way, then the problem is either related to some plugin of yours or some setting in one of your local setup files. You need to find out, what triggers the error, you try starting Vim this way:</p>\n\n<pre><code>vim -u NONE -U NONE -N</code></pre>\n\n<p>If the error occurs, the problem is your .viminfo file. Simply delete the viminfo file then. If the error does not occur, try:</p>\n\n<pre><code>vim -u ~/.vimrc --noplugin -N -i NONE</code></pre>\n\n<p>This will simply use your .vimrc as configuration file, but not load any plugins. If the error occurs this time, the error is possibly caused by some configuration option inside your .vimrc file. Depending on the length of your vimrc file, it can be quite hard to trace the origin within that file.</p>\n\n<p>The best way is to add `:finish` command in the middle of your .vimrc. Then restart again using the same command line. If the error still occurs, the bug must be caused because of a setting in the first half of your .vimrc. If it doesn&#39;t happen, the problematic setting must be in the second half of your .vimrc. So move the `:finish` command to the middle of that half, of which you know that triggers the error and move your way along, until you find the problematic option. If your .vimrc is 350 lines long, you need at a maximum 9 tries to find the offending line (in practise, this can often be further reduced, since often lines depend on each other).</p>\n\n<p>If the problem does not occur, when only loading your .vimrc file, the error must be caused by a plugin or another runtime file (indent autoload or syntax script). Check the output of the `:scriptnames` command to see what files have been loaded and for each one try to disable each one by one and see which one triggers the bug. Often files that are loaded by vim, have a simple configuration variable to disable them, but you need to check inside each file separately.</p>\n\n<p>You can also use the -V command line argument to get more debug information to analyze the problem:</p>\n\n<pre><code>$ vim -V2logfile</code></pre>\n\n<p>You can increase the value passed to the -V argument to get more debug information. By also specifying a logfile name, this makes sure, the debug messages don&#39;t appear on the screen and won&#39;t disturb you when trying to reproduce the problem.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help -u</b></p>\n\n<p><b>:help -U</b></p>\n\n<p><b>:help -N</b></p>\n\n<p><b>:help -V</b></p>\n\n<p><b>:help &#39;verbose&#39;</b></p>\n\n<p><b>:help :verbose</b></p>\n\n<p><b>:help :set-verbose</b></p>\n\n<h2 id=\"Where-can-I-report-bugs\">2.6. Where can I report bugs?</h2>\n\n<p>First collect the required information using the following command:</p>\n\n<pre><code>:source $VIMRUNTIME/bugreport.vim</code></pre>\n\n<p>Now send the resulting text from the above command to the bugs@vim.org e-mail address. There is also a public bug tracker available at https://github.com/vim/vim/issues. A copy of each message there will be forwarded to the Vim Development list.</p>\n\n<p>The Vim Development mailing list (see Question 2.2) is a good place to discuss general bugs. If the bug you find is with syntax highlighting, a runtime file, or some other &quot;added feature&quot; (i.e. not directly programmed into vim), attempt to inform the maintainer of that feature. His e-mail address will be mentioned at the top of the corresponding runtime file.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help bug-reports</b></p>\n\n<h2 id=\"Where-can-the-FAQ-be-found\">2.7. Where can the FAQ be found?</h2>\n\n<p>The FAQ can be found at https://vimhelp.org/vim_faq.txt.html. It will be auto-generated from the source that is managed in the github repository https://www.github.com/chrisbra/vim_faq (Patches are welcome).</p>\n\n<p>The repository also includes the faq in different formats, e.g. manpage, pdf file, html file, plain text version and a version in vim help format.</p>\n\n<p>A slightly older version (which doesn&#39;t seem to get updated anymore) can still be found at VimOnline (https://www.vim.org/).</p>\n\n<h2 id=\"What-if-I-dont-find-an-answer-in-this-FAQ\">2.8. What if I don&#39;t find an answer in this FAQ?</h2>\n\n<p>This FAQ covers mainly Vim-specific questions. You may find more information suitable for most Vi clones by reading the Vi FAQ. It is posted regularly on comp.editors. You can also find a copy at</p>\n\n<pre><code>http://www.faqs.org/faqs/editor-faq/vi/part1/index.html</code></pre>\n\n<p>Also, since Vim has gathered so many features in the last few years, successfully documenting the frequently asked questions here is a near-impossible task. To make it possible, please email the maintainer if you have a good question. A good question is one that you&#39;ve tried to answer yourself (remember, Vim has great documentation) but struggled.</p>\n\n<h2 id=\"I-have-a-patch-for-implementing-a-Vim-feature.-Where-can-I-send-this-patch\">2.9. I have a patch for implementing a Vim feature. Where can I send this patch?</h2>\n\n<p>You can send your patches to the Vim developer mailing list vim-dev@vim.org.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help vim-dev</b></p>\n\n<h2 id=\"I-have-a-Vim-tip-or-developed-a-new-Vim-syntax-indent-filetype-compiler-plugin-or-developed-a-new-script-or-a-colorscheme.-Is-there-a-public-website-where-I-can-upload-this\">2.10. I have a Vim tip or developed a new Vim syntax/indent/filetype/ compiler plugin or developed a new script or a colorscheme. Is there a public website where I can upload this?</h2>\n\n<p>Yes. You can use the Vim Online website to upload your plugins/scripts, colorschemes, etc. The site is at https://www.vim.org Nowadays people also seem to share their plugins/runtime files at github.</p>\n\n<p>Tips can also be shared in the Wiki which you can find at</p>\n\n<pre><code>http://vim.wikia.com</code></pre>\n\n<h1 id=\"AVAILABILITY1\">AVAILABILITY</h1>\n\n<h2 id=\"What-is-the-latest-version-of-Vim\">3.1. What is the latest version of Vim?</h2>\n\n<p>The latest version of Vim is 8.2 released on 12th December 2019.</p>\n\n<p>The release history of different versions of Vim is below:</p>\n\n<pre><code>VERSION         RELEASE DATE\n--------------  --------------------\nVersion 9.1     2nd January, 2024\nVersion 9.0     28th June, 2022\nVersion 8.2     12th December, 2019\nVersion 8.1     17th May, 2018\nVersion 8.0     12th September, 2016\nVersion 7.4     10th August, 2013\nVersion 7.3     15th August, 2010\nVersion 7.2     9th August, 2008\nVersion 7.1     12th May, 2007\nVersion 7.0     8th May, 2006\nVersion 6.4     15th October, 2005\nVersion 6.3     8th June, 2004\nVersion 6.2     1st June, 2003\nVersion 6.1     24th March, 2002\nVersion 6.0     27th September, 2001\nVersion 5.8     31st May, 2001\nVersion 5.7     24th June, 2000\nVersion 5.6     16th January, 2000\nVersion 5.5     21st September, 1999\nVersion 5.4     26th July, 1999\nVersion 5.3     31st August, 1998\nVersion 5.2     24th August, 1998\nVersion 5.1     7th April, 1998\nVersion 5.0     19th February, 1998\nVersion 4.6     13th March, 1997\nVersion 4.5     17th October, 1996\nVersion 4.2     5th July, 1996\nVersion 4.0     29th May, 1996\nVersion 3.0     12th August, 1994\nVersion 2.0     21st December, 1993\nVersion 1.27    23rd April, 1993\nVersion 1.17    21st April, 1992\nVersion 1.14    2nd November, 1991</code></pre>\n\n<p>If you are interested in the old release history, check out the vim-history git repository: https://github.com/vim/vim-history and especially for the release history: https://github.com/vim/vim-history#release-history</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help new-9</b></p>\n\n<p><b>:help new-8</b></p>\n\n<p><b>:help changed-9.1</b></p>\n\n<p><b>:help changed-8.2</b></p>\n\n<p><b>:help changed-8.1</b></p>\n\n<h2 id=\"Where-can-I-find-the-latest-version-of-Vim\">3.2. Where can I find the latest version of Vim?</h2>\n\n<p>You can download the sources for the latest version of Vim from the Github repository. The URL for this site is</p>\n\n<pre><code>https://github.com/vim/vim</code></pre>\n\n<p>A mercurial mirror is also available:</p>\n\n<pre><code>https://www.vim.org/hgweb/vim/</code></pre>\n\n<p>Some users keep updated repositories for distributing latest binary versions of Vim. You can find those repositories here:</p>\n\n<pre><code>http://vim.wikia.com/wiki/Where_to_download_Vim</code></pre>\n\n<h2 id=\"What-platforms-does-it-run-on\">3.3. What platforms does it run on?</h2>\n\n<p>All Unix platforms. All Windows platforms (10 and later). Amiga, Macintosh, MachTen, VMS, IBM z/OS.</p>\n\n<p>For MS-DOS support has been removed with the latest releases of Vim. 16-bit DOS: latest supported version 7.1 32-bit DOS: latest supported version 7.3 Windows XP and Visat: latest supported version 9.0</p>\n\n<h2 id=\"Where-can-I-download-the-latest-version-of-the-Vim-runtime-files\">3.4. Where can I download the latest version of the Vim runtime files?</h2>\n\n<p>You can download the latest version of the Vim runtime files (syntax files, filetype plugins, compiler files, color schemes, documentation, indentation files and keymaps) from the Vim github repository</p>\n\n<pre><code>https://github.com/vim/vim/tree/master/runtime</code></pre>\n\n<p>Another way of downloading the runtime files is this:</p>\n\n<pre><code>wget https://github.com/vim/vim/archive/master.tar.gz -O- |\ntar zfx - vim-master/runtime/ --strip-components=1</code></pre>\n\n<p>See also:</p>\n\n<pre><code>https://www.vim.org/runtime.php</code></pre>\n\n<h1 id=\"HELP1\">HELP</h1>\n\n<h2 id=\"How-do-I-use-the-help-files\">4.1. How do I use the help files?</h2>\n\n<p>Help can be found for all functions of Vim. In order to use it, use the `:help` command. This will bring you to the main help page. On that first page, you will find explanations on how to move around. Basically, you move around in the help pages the same way you would in a read-only document. You can jump to specific subjects by using tags. This can be done in two ways:</p>\n\n<pre><code> * Use the CTRL-] command while standing on the name of a command\nor option. This only works when the tag is a keyword.\n&lt;Ctrl-LeftMouse&gt; and g&lt;LeftMouse&gt; work just like CTRL-].\n\n * use the `:tag &lt;subject&gt;` command. This works with all characters.</code></pre>\n\n<p>Use CTRL-T to jump back to previous positions in the help files. Use `:q` to close the help window.</p>\n\n<p>If you want to jump to a specific subject on the help pages, use `:help {subject}` . If you don&#39;t know what to look for, try `:help index` to get a list of all available subjects. Use the standard search keys to locate the information you want. You can abbreviate the `:help` command as `:h`.</p>\n\n<p>For searching the help, see the next Question 4.2.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help online-help</b></p>\n\n<h2 id=\"How-do-I-search-for-a-keyword-in-the-Vim-help-files\">4.2. How do I search for a keyword in the Vim help files?</h2>\n\n<p>a) You can press the CTRL-D key after typing the help keyword to get a list of all the help keywords containing the supplied pattern. You can also use the meta characters like *, \\+, etc to specify the help search pattern:</p>\n\n<p><b>:help init&lt;C-D</b>&gt;</p>\n\n<p><b>:help str*()&lt;C-D</b>&gt;</p>\n\n<p><b>:help &#39;*indent&lt;C-D</b>&gt;</p>\n\n<p>b) You can press the &lt;Tab&gt; key after typing a partial help keyword to expand to the matching keyword. You can continue to press the &lt;Tab&gt; key to see other keyword matches.</p>\n\n<p>c) From the help window, you can use the `:tag` command to search for keywords. For example,</p>\n\n<pre><code>:tselect /window\n\nThis command will list all the help keywords containing the text\n&quot;window&quot;. You can select one from the list and jump to it.</code></pre>\n\n<p>d) You can use the `:helpgrep` command to search for the given text in all the help files. The quickfix window will be opened with all the matching lines.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help help-summary</b></p>\n\n<p><b>:help c_CTRL-D</b></p>\n\n<p><b>:help c_&lt;Tab</b>&gt;</p>\n\n<p><b>:help :tselect</b></p>\n\n<p><b>:help :help</b></p>\n\n<p><b>:help :helpgrep</b></p>\n\n<h2 id=\"I-am-getting-an-error-message-E123-what-did-I-do-wrong\">4.3. I am getting an error message E123, what did I do wrong?</h2>\n\n<p>You can get more information about the error and the error message using:</p>\n\n<p><b>:help E123</b></p>\n\n<p>For more information, read:</p>\n\n<p><b>:help error-messages</b></p>\n\n<h2 id=\"Where-can-I-read-about-the-various-modes-in-Vim\">4.4. Where can I read about the various modes in Vim?</h2>\n\n<p>You can get information about the different modes in Vim by reading</p>\n\n<p><b>:help vim-modes</b></p>\n\n<h2 id=\"How-do-I-generate-the-Vim-help-tags-file-after-adding-a-new-Vim-help-file\">4.5. How do I generate the Vim help tags file after adding a new Vim help file?</h2>\n\n<p>You can use the `:helptags` command to regenerate the Vim help tag file from within Vim. For example:</p>\n\n<pre><code>:cd $VIMRUNTIME/doc\n:helptags .</code></pre>\n\n<p>To update all &quot;doc&quot; directories in your &#39;runtimepath&#39;, you can use</p>\n\n<pre><code>:helptags ALL</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :helptags</b></p>\n\n<p><b>:help add-local-help</b></p>\n\n<h2 id=\"Can-I-use-compressed-versions-of-the-help-files\">4.6. Can I use compressed versions of the help files?</h2>\n\n<p>Yes. You can compress the help files and still be able to view them with Vim. This makes accessing the help files a bit slower and requires the &quot;gzip&quot; utility. Follow these steps to compress and use the Vim help files:</p>\n\n<p>- Compress all the help files using &quot;gzip doc/*.txt&quot;.</p>\n\n<p>- Edit the &quot;doc/tags&quot; file and change the &quot;.txt&quot; to &quot;.txt.gz&quot; using :%s=\\(\\t.*\\.txt\\)\\t=\\1.gz\\t=</p>\n\n<p>- Add the following line to your vimrc: set helpfile={dirname}/help.txt.gz</p>\n\n<p>Where {dirname} is the directory where the help files are. The gzip.vim plugin supplied with the standard Vim distribution will take care of decompressing the files. You must make sure that $VIMRUNTIME is set to where the other Vim files are, when they are not in the same location as the compressed &quot;doc&quot; directory.</p>\n\n<p>Note, that the `:helpgrep` command does not work with compressed help pages.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help gzip-helpfile</b></p>\n\n<p><b>:help &#39;helpfile&#39;</b></p>\n\n<p><b>:help gzip</b></p>\n\n<p><b>:help $VIMRUNTIME</b></p>\n\n<h1 id=\"EDITING-A-FILE1\">EDITING A FILE</h1>\n\n<h2 id=\"How-do-I-load-a-file-in-Vim-for-editing\">5.1. How do I load a file in Vim for editing?</h2>\n\n<p>There are several ways to load a file for editing. The simplest is to use the `:e` (:edit) command:</p>\n\n<pre><code>:e &lt;filename&gt;</code></pre>\n\n<p>You can also use the `:n` (:next) command to load files into Vim:</p>\n\n<pre><code>:n &lt;filename(s)&gt;</code></pre>\n\n<p>You can also use the `:args` command to load files into Vim:</p>\n\n<pre><code>:args &lt;filename(s)&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help usr_07.txt</b></p>\n\n<p><b>:help edit-files</b></p>\n\n<p><b>:help :edit</b></p>\n\n<p><b>:help :next_f</b></p>\n\n<p><b>:help :args_f</b></p>\n\n<h2 id=\"How-do-I-save-the-current-file-in-another-name-save-as-and-edit-a-new-file\">5.2. How do I save the current file in another name (save as) and edit a new file?</h2>\n\n<p>You can use the `:saveas` command to save the current file in another name:</p>\n\n<pre><code>:saveas &lt;newfilename&gt;</code></pre>\n\n<p>Alternatively, you can also use the following commands:</p>\n\n<pre><code>:w &lt;newfilename&gt;\n:edit #</code></pre>\n\n<p>You can also use the `:file` command, followed by `:w` command:</p>\n\n<pre><code>:file &lt;newfilename&gt;\n:w</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 07.7</b></p>\n\n<p><b>:help :saveas</b></p>\n\n<p><b>:help :file_f</b></p>\n\n<p><b>:help :w</b></p>\n\n<h2 id=\"How-do-I-change-the-current-directory-to-the-directory-of-the-current-file\">5.3. How do I change the current directory to the directory of the current file?</h2>\n\n<p>You can use the following command to change the current directory to the directory of the current file:</p>\n\n<pre><code>:cd %:p:h</code></pre>\n\n<p>To automatically change the current directory to the directory of the current file, simply set the option &#39;autochdir&#39;.</p>\n\n<pre><code>:set autochdir</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :cd</b></p>\n\n<p><b>:help :lcd</b></p>\n\n<p><b>:help filename-modifiers</b></p>\n\n<p><b>:help autocommand</b></p>\n\n<p><b>:help &#39;acd&#39;</b></p>\n\n<p><b>:help getcwd()</b></p>\n\n<h2 id=\"How-do-I-write-a-file-without-the-line-feed-EOL-at-the-end-of-the-file\">5.4. How do I write a file without the line feed (EOL) at the end of the file?</h2>\n\n<p>You can turn off the &#39;eol&#39; option and turn on the &#39;binary&#39; option to write a file without the EOL at the end of the file:</p>\n\n<pre><code>:set binary\n:set noeol\n:w</code></pre>\n\n<p>Alternatively, you can use:</p>\n\n<pre><code>:set noeol\n:w ++bin</code></pre>\n\n<p>If you rather only like Vim not to write missing EOLs, you can reset the &#39;fixeol&#39; option. This needs a Vim newer 7.4.785, so you should wrap this in an if condition in your .vimrc like this:</p>\n\n<pre><code>if exists(&#39;+fixeol&#39;)\n    set nofixeol\nendif</code></pre>\n\n<p>This has the advantage of avoiding the many side effects that the &#39;binary&#39; option has.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;endofline&#39;</b></p>\n\n<p><b>:help &#39;fixeol&#39;</b></p>\n\n<p><b>:help &#39;binary&#39;</b></p>\n\n<p><b>:help 23.4</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-open-a-file-at-the-last-edited-location\">5.5. How do I configure Vim to open a file at the last edited location?</h2>\n\n<p>Vim stores the cursor position of the last edited location for each buffer in the &#39;&quot;&#39; register. You can use the following autocmd in your .vimrc or .gvimrc file to open a file at the last edited location:</p>\n\n<pre><code>au BufReadPost * if line(&quot;&#39;\\&quot;&quot;) &gt; 0 &amp;&amp; line(&quot;&#39;\\&quot;&quot;) &lt;= line(&quot;$&quot;) |\n                     \\ exe &quot;normal! g`\\&quot;&quot; | endif</code></pre>\n\n<p>Alternatively, you can simply source the vimrc_example.vim file, which is distributed with Vim.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;&quot;</b></p>\n\n<p><b>:help last-position-jump</b></p>\n\n<p><b>:help vimrc_example.vim</b></p>\n\n<h2 id=\"When-editing-a-file-in-Vim-which-is-being-changed-by-an-external-application-Vim-opens-a-warning-window-like-the-confirm-dialog-each-time-a-change-is-detected.-How-do-I-disable-this-warning\">5.6. When editing a file in Vim, which is being changed by an external application, Vim opens a warning window (like the confirm dialog) each time a change is detected. How do I disable this warning?</h2>\n\n<p>You can set the Vim &#39;autoread&#39; option to automatically read the file again when it is changed outside of Vim:</p>\n\n<pre><code>:set autoread</code></pre>\n\n<p>You can also use the following autocommand:</p>\n\n<pre><code>autocmd FileChangedShell *\n      \\ echohl WarningMsg |\n      \\ echo &quot;File has been changed outside of vim.&quot; |\n      \\ echohl None</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;autoread&#39;</b></p>\n\n<p><b>:help FileChangedShell</b></p>\n\n<p><b>:help timestamp</b></p>\n\n<p><b>:help :checktime</b></p>\n\n<h2 id=\"How-do-I-edit-a-file-whose-name-is-under-the-cursor\">5.7. How do I edit a file whose name is under the cursor?</h2>\n\n<p>You can use the gf command to edit a file whose name is under the cursor. You can use the CTRL-W f command to edit the file in a new window and finally you can use CTRL-W gf top open a new tab page that contains the file name under the cursor.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help gf</b></p>\n\n<p><b>:help CTRL-W_f</b></p>\n\n<p><b>:help CTRL-W_gf</b></p>\n\n<p><b>:help &#39;isfname&#39;</b></p>\n\n<p><b>:help &#39;path&#39;</b></p>\n\n<p><b>:help &#39;suffixesadd&#39;</b></p>\n\n<p><b>:help &#39;includeexpr&#39;</b></p>\n\n<h2 id=\"How-do-I-reload-re-edit-the-current-file\">5.8. How do I reload/re-edit the current file?</h2>\n\n<p>You can use the `:edit` command, without specifying a file name, to reload the current file. If you have made modifications to the file, you can use `:edit!` to force the reload of the current file (you will lose your modifications, but depending on your &#39;undoreload&#39; settings, those changes might be saved into the undo history).</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :edit</b></p>\n\n<p><b>:help :edit!</b></p>\n\n<p><b>:help &#39;confirm&#39;</b></p>\n\n<p><b>:help &#39;undoreload&#39;</b></p>\n\n<h2 id=\"How-do-I-autosave-a-file-periodically\">5.9. How do I autosave a file periodically?</h2>\n\n<p>Vim doesn&#39;t support auto-saving a file periodically.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;updatetime&#39;</b></p>\n\n<p><b>:help CursorHold</b></p>\n\n<p><b>:help swap-file</b></p>\n\n<h2 id=\"How-do-I-open-a-file-in-read-only-mode\">5.10. How do I open a file in read-only mode?</h2>\n\n<p>You can open a file in read-only mode using the `:view` command:</p>\n\n<pre><code>:view &lt;filename&gt;</code></pre>\n\n<p>This command sets the &#39;readonly&#39; option for the opened buffer. You can also use the &quot;-R&quot; command-line option to open a file in read-only mode:</p>\n\n<pre><code>$ vim -R &lt;filename&gt;</code></pre>\n\n<p>You can also use the symbolic link executable &quot;view&quot; to open a file in read-only mode from the command-line:</p>\n\n<pre><code>$ view &lt;filename&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 07.6</b></p>\n\n<p><b>:help &#39;readonly&#39;</b></p>\n\n<p><b>:help &#39;modifiable&#39;</b></p>\n\n<p><b>:help :view</b></p>\n\n<p><b>:help :sview</b></p>\n\n<p><b>:help view</b></p>\n\n<p><b>:help -R</b></p>\n\n<p><b>:help -M</b></p>\n\n<h2 id=\"How-do-I-open-a-file-for-editing-without-saving-the-modifications-to-the-current-file\">5.11. How do I open a file for editing without saving the modifications to the current file?</h2>\n\n<p>You can open a file for editing without saving the modifications to the current file and without losing the changes using one of the following methods:</p>\n\n<pre><code>:split &lt;new_filename&gt;\n:new &lt;new_filename&gt;</code></pre>\n\n<p>You can also set the &#39;hidden&#39; option and edit a new file:</p>\n\n<pre><code>:set hidden\n:e &lt;new_filename&gt;</code></pre>\n\n<p>If you want to discard the changes made to the current file and load another file for editing, then you can use the following command:</p>\n\n<pre><code>:e! &lt;new_filename&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :edit!_f</b></p>\n\n<p><b>:help &#39;hidden&#39;</b></p>\n\n<p><b>:help :split</b></p>\n\n<p><b>:help :new</b></p>\n\n<h2 id=\"How-do-I-reduce-the-loading-time-for-very-large-files-in-Vim\">5.12. How do I reduce the loading time for very large files in Vim?</h2>\n\n<p>You can use the following settings to reduce the loading time for very large files in Vim:</p>\n\n<pre><code>:set lazyredraw\n:set noswapfile\n:set undolevels=-1\n:set eventignore=all\n:set nohidden\n:set syntax=off</code></pre>\n\n<p>Note that the above settings will disable many Vim features including the following: Swap files support for crash recovery, undo support, syntax highlighting, filetype detection and other autocommand based features.</p>\n\n<p>There is also the LargeFile plugin available at</p>\n\n<pre><code>https://www.vim.org/scripts/script.php?script_id=1506</code></pre>\n\n<p>which automatically sets these options, when working with large files (it is configurable, what is considered to be a large file, by default, it is 100MB).</p>\n\n<h1 id=\"EDITING-MULTIPLE-FILES1\">EDITING MULTIPLE FILES</h1>\n\n<h2 id=\"How-do-I-open-multiple-files-at-once-from-within-Vim\">6.1. How do I open multiple files at once from within Vim?</h2>\n\n<p>Make a difference between args, buffers, tabs and windows. They are all different things in VIM.</p>\n\n<p>args is a list of arguments. Buffers are place to edit text, almost always attached to a file but not necessarily. Window is a place for a buffer and tab is set of windows, better name would be &quot;layout&quot;.</p>\n\n<p>There are several ways to open multiple files at once from within Vim. You can use the `:next` command to specify a group of files:</p>\n\n<pre><code>:next f1.txt f2.txt\n:next *.c</code></pre>\n\n<p>You can use the `:args` command to specify a group of files as arguments:</p>\n\n<pre><code>:args f1.txt f2.txt\n:args *.c</code></pre>\n\n<p>After loading the files, you can use the `:next` and `:prev` command to switch between the files.</p>\n\n<p>To execute command for all files in argument-list use `:argdo`</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 07.2</b></p>\n\n<p><b>:help :next</b></p>\n\n<p><b>:help :args_f</b></p>\n\n<p><b>:help argument-list</b></p>\n\n<h2 id=\"How-do-I-switch-between-multiple-files-buffers-in-Vim\">6.2. How do I switch between multiple files/buffers in Vim?</h2>\n\n<p>To list all buffers use `:ls`, to list buffers without file attached to (also known as unlisted buffers, ex. scratch buffer and help-window) use `:ls!`</p>\n\n<p>There are several ways to switch between multiple files. You can use the `:buffer` command to switch between multiple files. You can also shorten command as `:b` and use only part of the filename. For example,</p>\n\n<pre><code>:buffer file1\n:buffer file2\n:b e2</code></pre>\n\n<p>You can also use &lt;TAB&gt; after `:b` for autocompletion. Try also `:b` followed by CTRL-D to see all available buffers. This works also for `:e`.</p>\n\n<p>You can also use the CTRL-^ key to switch between buffers. By specifying a count before pressing the key, you can edit the buffer with that number. Without the count, you can edit the alternate buffer by pressing CTRL-^</p>\n\n<p>You can also use the `:e #` command to edit a particular buffer:</p>\n\n<pre><code>:e #5</code></pre>\n\n<p>To close a buffer use `:bd` -command.</p>\n\n<p>To execute command for all files in buffer-list use `:bufdo`</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help edit-files</b></p>\n\n<p><b>:help :buffer</b></p>\n\n<p><b>:help CTRL-^</b></p>\n\n<p><b>:help alternate-file</b></p>\n\n<p><b>:help 22.4</b></p>\n\n<p><b>:help 07.3</b></p>\n\n<h2 id=\"How-do-I-open-several-files-in-Vim-with-each-file-in-a-separate-window-tab\">6.3. How do I open several files in Vim, with each file in a separate window/tab?</h2>\n\n<p>You can use the -o and -O Vim command line arguments to open multiple files in separate horizontally or vertically split Vim windows. For example:</p>\n\n<pre><code>$ vim -o3 f1.txt f2.txt f3.txt</code></pre>\n\n<p>The above command will open the files f1.txt, f2.txt and f3.txt in three separate horizontally split Vim windows.</p>\n\n<pre><code>$ vim -O3 f1.txt f2.txt f3.txt</code></pre>\n\n<p>The above command will open the files f1.txt, f2.txt and f3.txt in three separate vertically split Vim windows.</p>\n\n<pre><code>$ vim -p f1.txt f2.txt f3.txt</code></pre>\n\n<p>The above command will open the files f1.txt, f2.txt and f3.txt in three separate tab windows. The option &#39;tabpagemax&#39; defines, how many tabpages can be opened at the same time, by default it is set to 10.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help -o</b></p>\n\n<p><b>:help -O</b></p>\n\n<p><b>:help -p</b></p>\n\n<p><b>:help startup-options</b></p>\n\n<p><b>:help &#39;tabpagemax&#39;</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-autoload-several-files-at-once-similar-to-work-sets-or-projects\">6.4. How do I configure Vim to autoload several files at once similar to &quot;work-sets&quot; or &quot;projects&quot;?</h2>\n\n<p>You can use the `:mksession` and the `:mkview` commands to autoload several files in Vim.</p>\n\n<p>The `:mksession` command creates a Vim script that restores the current editing session. You can use the `:source` command to source the file produced by the mksession command.</p>\n\n<p>The `:mkview` command creates a Vim script that restores the contents of the current window. You can use the `:loadview` command to load the view for the current file.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 21.4</b></p>\n\n<p><b>:help 21.5</b></p>\n\n<p><b>:help views-sessions</b></p>\n\n<p><b>:help &#39;sessionoptions&#39;</b></p>\n\n<p><b>:help :mksession</b></p>\n\n<p><b>:help :source</b></p>\n\n<p><b>:help v:this_session</b></p>\n\n<p><b>:help :mkview</b></p>\n\n<p><b>:help :loadview</b></p>\n\n<p><b>:help &#39;viewdir&#39;</b></p>\n\n<p><b>:help buffers</b></p>\n\n<h2 id=\"Is-it-possible-to-open-multiple-top-level-windows-in-a-single-instance-of-Vim-similar-to-Nedit-or-Emacs\">6.5. Is it possible to open multiple top level windows in a single instance of Vim similar to Nedit or Emacs?</h2>\n\n<p>No. It is currently not possible to open multiple top-level windows in a single instance of Vim. This feature is in the todo list.</p>\n\n<h2 id=\"How-do-I-browse-explore-directories-from-within-Vim\">6.6. How do I browse/explore directories from within Vim?</h2>\n\n<p>You can use the netrw.vim plugin, supplied with the standard Vim installation, to browse/explore directories from within Vim. You can start the file explorer using one of the following commands:</p>\n\n<pre><code>:e &lt;directory&gt;\n:Explore\n:Sexplore\n:Vexplore\n:Texplore</code></pre>\n\n<p>From the file explorer, you can browse through directories, rename, delete and edit files.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help netrw.vim</b></p>\n\n<p><b>:help 22.1</b></p>\n\n<h2 id=\"How-do-I-edit-files-over-a-network-using-ftp-scp-rcp-http\">6.7. How do I edit files over a network using ftp/scp/rcp/http?</h2>\n\n<p>You can use the netrw.vim plugin, supplied with the standard Vim package, to edit files over a network using ftp/scp/rcp/http. Using this plugin, Vim will transparently load and save the files over ftp/scp/rcp/http. For example, to edit a file over ftp, you can use the following command:</p>\n\n<pre><code>$ vim ftp://machine/path</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help netrw.vim</b></p>\n\n<h1 id=\"BACKUP1\">BACKUP</h1>\n\n<h2 id=\"When-I-edit-and-save-files-Vim-creates-a-file-with-the-same-name-as-the-original-file-and-a-character-at-the-end.-How-do-I-stop-Vim-from-creating-this-file-or-How-do-I-disable-the-Vim-backup-file-feature\">7.1. When I edit and save files, Vim creates a file with the same name as the original file and a &quot;~&quot; character at the end. How do I stop Vim from creating this file? (or) How do I disable the Vim backup file feature?</h2>\n\n<p>You have set the &#39;backup&#39; option, so Vim creates a backup file when saving the original file. You can stop Vim from creating the backup file, by clearing the option:</p>\n\n<pre><code>:set nobackup</code></pre>\n\n<p>Note that, by default this option is turned off. You have explicitly enabled the &#39;backup&#39; option in one of the initialization files. You may also have to turn off the &#39;writebackup&#39; option:</p>\n\n<pre><code>:set nowritebackup</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 07.4</b></p>\n\n<p><b>:help backup-table</b></p>\n\n<p><b>:help &#39;backup&#39;</b></p>\n\n<p><b>:help &#39;writebackup&#39;</b></p>\n\n<p><b>:help &#39;backupskip&#39;</b></p>\n\n<p><b>:help &#39;backupdir&#39;</b></p>\n\n<p><b>:help &#39;backupext&#39;</b></p>\n\n<p><b>:help &#39;backupcopy&#39;</b></p>\n\n<p><b>:help backup</b></p>\n\n<h2 id=\"When-I-edit-and-save-files-Vim-creates-a-file-with-the-same-name-as-the-original-file-and-a-un-extension-at-the-end.-How-do-I-stop-Vim-from-creating-this-file-or-How-do-I-disable-the-Vim-undofile-feature\">7.2. When I edit and save files, Vim creates a file with the same name as the original file and a &quot;un~&quot; extension at the end. How do I stop Vim from creating this file (or) How do I disable the Vim undofile feature?</h2>\n\n<p>Vim 7.3 contains as new feature persistent undo, that is, undo information won&#39;t be lost when quitting Vim and be stored in a file that ends with &quot;.un~&quot; You have set the &#39;undofile&#39; option, so Vim creates an undo file when saving the original file. You can stop Vim from creating the backup file, by clearing the option:</p>\n\n<pre><code>:set noundofile</code></pre>\n\n<p>Note that, by default this option is turned off. You have explicitly enabled the &#39;undofile&#39; option in one of the initialization files. If you want your undofiles to be stored only in a particular directory, you can point the &#39;undodir&#39; option to a directory that will contain all your aggregated undofiles.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;undodir&#39;</b></p>\n\n<p><b>:help &#39;undofile&#39;</b></p>\n\n<p><b>:help undo-persistence</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-store-all-the-backup-files-in-a-particular-directory\">7.3. How do I configure Vim to store all the backup files in a particular directory?</h2>\n\n<p>You can configure Vim to store all the backup files in a particular directory using the &#39;backupdir&#39; option. For example, to store all the backup files in the ~/backup directory, you can use the following command:</p>\n\n<pre><code>:set backupdir=~/backup</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 07.4</b></p>\n\n<p><b>:help &#39;backupdir&#39;</b></p>\n\n<p><b>:help backup</b></p>\n\n<h2 id=\"When-I-save-a-file-with-Vim-the-file-permissions-are-changed.-How-do-I-configure-Vim-to-save-a-file-without-changing-the-file-permissions\">7.4. When I save a file with Vim, the file permissions are changed. How do I configure Vim to save a file without changing the file permissions?</h2>\n\n<p>This may happen, if the &#39;backupcopy&#39; option is set to &quot;no&quot; or &quot;auto&quot;. Note that the default value for this option is set in such a way that this will correctly work in most of the cases. If the default doesn&#39;t work for you, try setting the &#39;backupcopy&#39; option to &quot;yes&quot; to keep the file permission when saving a file:</p>\n\n<pre><code>:set backupcopy=yes</code></pre>\n\n<p>This applies, only if you have configured Vim to make a backup whenever overwriting a file. By default, Vim will not backup files.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;backupcopy&#39;</b></p>\n\n<p><b>:help backup</b></p>\n\n<p><b>:help &#39;backup&#39;</b></p>\n\n<p><b>:help &#39;writebackup&#39;</b></p>\n\n<h1 id=\"BUFFERS1\">BUFFERS</h1>\n\n<h2 id=\"I-have-made-some-modifications-to-a-buffer.-How-do-I-edit-another-buffer-without-saving-the-modified-buffer-and-also-without-losing-the-modifications\">8.1. I have made some modifications to a buffer. How do I edit another buffer without saving the modified buffer and also without losing the modifications?</h2>\n\n<p>You can set the &#39;hidden&#39; option to edit a file without losing modifications to the current file:</p>\n\n<pre><code>:set hidden</code></pre>\n\n<p>By setting the &#39;hidden&#39; option, you can also save the modification history (undo-history) for the buffer. Otherwise, as you switch between files, the undo-history will be lost (unless you use persistent undofiles).</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;hidden&#39;</b></p>\n\n<p><b>:help hidden-quit</b></p>\n\n<p><b>:help :hide</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-auto-save-a-modified-buffer-when-switching-to-another-buffer\">8.2. How do I configure Vim to auto-save a modified buffer when switching to another buffer?</h2>\n\n<p>You can set the &#39;autowrite&#39; option to auto-save a modified buffer when switching to another buffer:</p>\n\n<pre><code>:set autowrite</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;autowrite&#39;</b></p>\n\n<p><b>:help &#39;autowriteall&#39;</b></p>\n\n<p><b>:help &#39;hidden&#39;</b></p>\n\n<h2 id=\"How-do-I-replace-the-buffer-in-the-current-window-with-a-blank-buffer\">8.3. How do I replace the buffer in the current window with a blank buffer?</h2>\n\n<p>You can use the `:enew` command to load an empty buffer in place of the buffer in the current window.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :enew</b></p>\n\n<h2 id=\"Is-there-a-keyboard-shortcut-to-load-a-buffer-by-the-buffer-number\">8.4. Is there a keyboard shortcut to load a buffer by the buffer number?</h2>\n\n<p>You can use the CTRL-^ command to load a buffer by specifying the buffer number. For example, to load buffer number 5, you have to use the 5 CTRL-^ command.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help CTRL-^</b></p>\n\n<h2 id=\"How-do-I-open-all-the-current-buffers-in-separate-windows\">8.5. How do I open all the current buffers in separate windows?</h2>\n\n<p>You can use the `:ball` or `:sball` commands to open all the buffers in the buffer list:</p>\n\n<pre><code>:ball</code></pre>\n\n<p>If you want all buffers to be opened in new tabs, simply prefix the `:tab` command:</p>\n\n<pre><code>:tab :sball</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :ball</b></p>\n\n<h2 id=\"How-do-I-close-delete-a-buffer-without-exiting-Vim\">8.6. How do I close (delete) a buffer without exiting Vim?</h2>\n\n<p>You can use any of `:bdelete`, `:bwipeout` or `:bunload` commands to delete a buffer without exiting Vim. For example:</p>\n\n<pre><code>:bdelete file1</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :bdelete</b></p>\n\n<p><b>:help :bwipeout</b></p>\n\n<p><b>:help :bunload</b></p>\n\n<h2 id=\"When-I-use-the-command-:-bd-to-delete-all-the-buffers-not-all-the-buffers-are-deleted.-Why\">8.7. When I use the command `:%bd` to delete all the buffers, not all the buffers are deleted. Why?</h2>\n\n<p>In the `:%bd` command, the &quot;%&quot; range will be replaced with the starting and ending line numbers in the current buffer. Instead of using &quot;%&quot; as the range, you should specify numbers for the range. For example, to delete all the buffers, you can use the command `:1,9999bd`.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :bd</b></p>\n\n<p>(This behaviour has been fixed with patch 7.4.530)</p>\n\n<h2 id=\"How-do-I-display-the-buffer-number-of-the-current-buffer-file\">8.8. How do I display the buffer number of the current buffer/file?</h2>\n\n<p>You can use 2&lt;CTRL-G&gt; command to display the buffer number for the current file/buffer. Note the use of count before the CTRL-G command. If the count is greater than 1, then Vim will display the buffer number.</p>\n\n<p>You can also use the following command to display the current buffer number:</p>\n\n<pre><code>:echo bufnr(&quot;%&quot;)</code></pre>\n\n<p>You can also include the &quot;%n&quot; field to the &#39;statusline&#39; option to display the current buffer number on the statusline.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help CTRL-G</b></p>\n\n<p><b>:help bufnr()</b></p>\n\n<p><b>:help :echo</b></p>\n\n<p><b>:help &#39;statusline&#39;</b></p>\n\n<h2 id=\"How-do-I-delete-a-buffer-without-closing-the-window-in-which-the-buffer-is-displayed\">8.9. How do I delete a buffer without closing the window in which the buffer is displayed?</h2>\n\n<p>You can use the following command to open the next buffer and delete the current buffer.</p>\n\n<pre><code>:bnext | bdelete #</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :bnext</b></p>\n\n<p><b>:help :bdelete</b></p>\n\n<p><b>:help :buffers</b></p>\n\n<h2 id=\"How-do-I-map-the-Tab-key-to-cycle-through-and-open-all-the-buffers\">8.10. How do I map the &lt;Tab&gt; key to cycle through and open all the buffers?</h2>\n\n<p>You can use the following two map commands, to map the &lt;Ctrl-Tab&gt; key to open the next buffer and the &lt;Ctrl-Shift-Tab&gt; key to open the previous buffer:</p>\n\n<pre><code>:nnoremap &lt;C-Tab&gt; :bnext&lt;CR&gt;\n:nnoremap &lt;S-C-Tab&gt; :bprevious&lt;CR&gt;</code></pre>\n\n<p>Note, this might not work in the terminal version of Vim.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :bnext</b></p>\n\n<p><b>:help :bprevious</b></p>\n\n<h1 id=\"WINDOWS1\">WINDOWS</h1>\n\n<h2 id=\"What-is-the-difference-between-a-Vim-window-and-a-buffer\">9.1. What is the difference between a Vim window and a buffer?</h2>\n\n<p>A Vim buffer is a file loaded into memory for editing. The original file remains unchanged until you write the buffer to the file. A Vim window is a viewport onto a buffer. You can use multiple windows on one buffer or several windows on different buffers.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help usr_08.txt</b></p>\n\n<p><b>:help 22.4</b></p>\n\n<p><b>:help windows-intro</b></p>\n\n<p><b>:help Q_wi</b></p>\n\n<h2 id=\"How-do-I-increase-the-width-of-a-Vim-window\">9.2. How do I increase the width of a Vim window?</h2>\n\n<p>You can increase the width of a Vim window using one of the following commands:</p>\n\n<pre><code>:vert resize +N\n:vert resize -N\n:vert resize N</code></pre>\n\n<p>You can also use CTRL-W &lt; or CTRL-W &gt; or CTRL-W | commands.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :vertical-resize</b></p>\n\n<p><b>:help CTRL-W_</b>&gt;</p>\n\n<p><b>:help CTRL-W_&lt;</b></p>\n\n<p><b>:help window-resize</b></p>\n\n<h2 id=\"How-do-I-zoom-into-or-out-of-a-window\">9.3. How do I zoom into or out of a window?</h2>\n\n<p>You can zoom into a window (close all the windows except the current window) using the &quot;&lt;CTRL-W&gt;o&quot; command or the `:only` ex command.</p>\n\n<p>You can use the &quot;&lt;CTRL-W&gt;_&quot; command or the `:resize` ex command to increase the current window height to the highest possible without closing other windows.</p>\n\n<p>You can use the &quot;&lt;CTRL-W&gt;|&quot; command or the `:vertical resize` ex command to increase the current window width to the highest possible without closing other windows.</p>\n\n<p>You can use the &quot;&lt;CTRL-W&gt;=&quot; command to make the height and width of all the windows equal.</p>\n\n<p>You can also set the following options to get better results with the above commands:</p>\n\n<p>Method 1: Set the &#39;winminheight&#39; option to 0:</p>\n\n<pre><code>:set winminheight=0</code></pre>\n\n<p>By default, this option is set to 1. This option controls the minimum height of an inactive window (when it is not the current window). When the &#39;winminheight&#39; option is set to 0, only the status line will be displayed for inactive windows.</p>\n\n<p>Method 2: Set the &#39;noequalalways&#39; option and set the &#39;winheight&#39; option to a large value (like 99999):</p>\n\n<pre><code>:set noequalalways\n:set winheight=99999</code></pre>\n\n<p>Now, the active window will always open to its maximum size, while the other windows will stay present, but shrunken to just a status line.</p>\n\n<p>With any of the above mentioned methods, you cannot restore the window layout after zooming into a window. If you want to restore the Vim window layout after zooming into a window, you can use the ZoomWin plugin. You can download this plugin from the Vim online website at:</p>\n\n<pre><code>https://www.vim.org/scripts/script.php?script_id=508</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help CTRL-W_o</b></p>\n\n<p><b>:help window-resize</b></p>\n\n<p><b>:help &#39;winminheight&#39;</b></p>\n\n<p><b>:help &#39;equalalways&#39;</b></p>\n\n<p><b>:help &#39;winheight&#39;</b></p>\n\n<p><b>:help 08.3</b></p>\n\n<h2 id=\"How-do-I-execute-an-ex-command-on-all-the-open-buffers-or-open-windows-or-all-the-files-in-the-argument-list\">9.4. How do I execute an ex command on all the open buffers or open windows or all the files in the argument list?</h2>\n\n<p>You can use the `:bufdo` command to execute an ex command on all the open buffers. You can use the `:windo` command to execute an ex command on all the open windows. You can use the `:argdo` command to execute an ex command on all the files specified in the argument list. And finally you can use the `:tabdo` command to execute an ex command in all open tab pages.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :windo</b></p>\n\n<p><b>:help :bufdo</b></p>\n\n<p><b>:help :argdo</b></p>\n\n<p><b>:help :tabdo</b></p>\n\n<p><b>:help 26.3</b></p>\n\n<h1 id=\"MOTION1\">MOTION</h1>\n\n<h2 id=\"How-do-I-jump-to-the-beginning-first-line-or-end-last-line-of-a-file\">10.1. How do I jump to the beginning (first line) or end (last line) of a file?</h2>\n\n<p>You can use &quot;G&quot; command to jump to the last line in the file and the &quot;gg&quot; command to jump to the first line in the file.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help G</b></p>\n\n<p><b>:help gg</b></p>\n\n<h2 id=\"In-insert-mode-when-I-press-the-Esc-key-to-go-to-command-mode-the-cursor-moves-one-character-to-the-left-except-when-the-cursor-is-on-the-first-character-of-the-line-.-Is-it-possible-to-change-this-behavior-to-keep-the-cursor-at-the-same-column\">10.2. In insert mode, when I press the &lt;Esc&gt; key to go to command mode, the cursor moves one character to the left (except when the cursor is on the first character of the line). Is it possible to change this behavior to keep the cursor at the same column?</h2>\n\n<p>No. It is not possible to change this behavior. The cursor is *always* positioned on a valid character (unless you have virtual-edit mode enabled). So, if you are appending text to the end of a line, when you return to command mode the cursor *must* drop back onto the last character you typed. For consistency sake, the cursor drops back everywhere, even if you are in the middle of a line.</p>\n\n<p>You can use the CTRL-O or CTRL-\\ CTRL-O command in insert mode to execute a single ex command and return back to insert mode without moving the cursor column.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;virtualedit&#39;</b></p>\n\n<p><b>:help i_CTRL-O</b></p>\n\n<p><b>:help i_CTRL-\\_CTRL-O</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-maintain-the-horizontal-cursor-position-when-scrolling-with-the-Page-Up-Page-Down-etc-keys\">10.3. How do I configure Vim to maintain the horizontal cursor position when scrolling with the &lt;Page Up&gt;, &lt;Page Down&gt;, etc keys?</h2>\n\n<p>You can reset the &#39;startofline&#39; option to keep the cursor at the same horizontal location when scrolling text:</p>\n\n<pre><code>:set nostartofline</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;startofline&#39;</b></p>\n\n<h2 id=\"Some-lines-in-a-file-are-more-than-the-screen-width-and-they-are-all-wrapped.-When-I-use-the-j-k-keys-to-move-from-one-line-to-the-next-the-cursor-is-moved-to-the-next-line-in-the-file-instead-of-the-next-line-on-the-screen.-How-do-I-move-from-one-screen-line-to-the-next\">10.4. Some lines in a file are more than the screen width and they are all wrapped. When I use the j, k keys to move from one line to the next, the cursor is moved to the next line in the file instead of the next line on the screen. How do I move from one screen line to the next?</h2>\n\n<p>You can use the gj and gk commands to move from one screen line to the next/previous screen line. The j and k commands move the cursor from one file line to the next file line. You can also avoid the line wrapping by resetting the &#39;wrap&#39; option:</p>\n\n<pre><code>:set nowrap</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help gj</b></p>\n\n<p><b>:help gk</b></p>\n\n<p><b>:help &#39;wrap&#39;</b></p>\n\n<p>You can use the following mappings:</p>\n\n<pre><code>:map &lt;Up&gt; gk\n:imap &lt;Up&gt; &lt;C-o&gt;gk\n:map &lt;Down&gt; gj\n:imap &lt;Down&gt; &lt;C-o&gt;gj\n:noremap j gj\n:noremap k gk</code></pre>\n\n<h2 id=\"What-is-the-definition-of-a-sentence-paragraph-and-section-in-Vim\">10.5. What is the definition of a sentence, paragraph and section in Vim?</h2>\n\n<p>A sentence is defined as ending at a &quot;.&quot;, &quot;!&quot; or &quot;?&quot; followed by either the end of a line, or by a space (or two) or tab. Which characters and the number of spaces needed to constitute a sentence ending is determined by the &#39;joinspaces&#39; and &#39;cpoptions&#39; options.</p>\n\n<p>A paragraph begins after each empty line, and also at each of a set of paragraph macros, specified by the pairs of characters in the &#39;paragraphs&#39; option.</p>\n\n<p>A section begins after a form-feed (&lt;C-L&gt;) in the first column and at each of a set of section macros, specified by the pairs of characters in the &#39;sections&#39; option.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help sentence</b></p>\n\n<p><b>:help &#39;joinspaces&#39;</b></p>\n\n<p><b>:help &#39;cpoptions&#39;</b></p>\n\n<p><b>:help paragraph</b></p>\n\n<p><b>:help section</b></p>\n\n<p><b>:help word</b></p>\n\n<h2 id=\"How-do-I-jump-to-beginning-or-end-of-a-sentence-paragraph-or-a-section\">10.6. How do I jump to beginning or end of a sentence, paragraph or a section?</h2>\n\n<p>You can use the following motion commands to jump to the beginning or end of a sentence or a paragraph or a section:</p>\n\n<pre><code>motion  position    where\n------  ---------   -----------------\n(       beginning   current sentence\n)       end         current sentence\n{       beginning   current paragraph\n}       end         current paragraph\n[]      end         previous section\n[[      beginning   current section\n][      end         current section\n]]      beginning   next section</code></pre>\n\n<p>Each of these motions can be preceded by a number which will extend the jump forward (or backward).</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help object-motions</b></p>\n\n<h2 id=\"I-have-lines-in-a-file-that-extends-beyond-the-right-extent-of-the-screen.-How-do-I-move-the-Vim-view-to-the-right-to-see-the-text-off-the-screen\">10.7. I have lines in a file that extends beyond the right extent of the screen. How do I move the Vim view to the right to see the text off the screen?</h2>\n\n<p>You can use one of the following commands to horizontally scroll the screen to the left or right:</p>\n\n<pre><code>cmd  scroll to\n---  --------------------------\nzl   scroll to the left\nzh   scroll to the right\nzL   scroll half a screenwidth to the left\nzH   scroll half a screenwidth to the right\nzs   scroll to position the cursor at the start of the screen\nze   scroll to position the cursor at the end of the screen</code></pre>\n\n<p>You can use the g0 command to move the cursor to the first character of the screen line and the g$ command to move the cursor to the last character of the screen line without scrolling the screen.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help scroll-horizontal</b></p>\n\n<h2 id=\"How-do-I-scroll-two-or-more-buffers-simultaneously\">10.8. How do I scroll two or more buffers simultaneously?</h2>\n\n<p>You can set the &#39;scrollbind&#39; option for each of the buffers to scroll them simultaneously.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;scrollbind&#39;</b></p>\n\n<p><b>:help scroll-binding</b></p>\n\n<p><b>:help &#39;scrollopt&#39;</b></p>\n\n<p><b>:help &#39;cursorbind&#39;</b></p>\n\n<h2 id=\"When-I-use-my-arrow-keys-Vim-changes-modes-inserts-weird-characters-in-my-document-but-doesnt-move-the-cursor-properly.-Whats-going-on\">10.9. When I use my arrow keys, Vim changes modes, inserts weird characters in my document but doesn&#39;t move the cursor properly. What&#39;s going on?</h2>\n\n<p>There are a couple of things that could be going on: either you are using Vim over a slow connection or Vim doesn&#39;t understand the key sequence that your keyboard is generating.</p>\n\n<p>If you are working over a slow connection (such as a 2400 bps modem), you can try to set the &#39;timeout&#39; or &#39;ttimeout&#39; option. These options, combined with the &#39;timeoutlen&#39; and &#39;ttimeoutlen&#39; options, may fix the problem.</p>\n\n<p>The preceding procedure will not work correctly if your terminal sends key codes that Vim does not understand. In this situation, your best option is to map your key sequence to a matching cursor movement command and save these mappings in a file. You can then `:source` the file whenever you work from that terminal.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;timeout&#39;</b></p>\n\n<p><b>:help &#39;ttimeout&#39;</b></p>\n\n<p><b>:help &#39;timeoutlen&#39;</b></p>\n\n<p><b>:help &#39;ttimeoutlen&#39;</b></p>\n\n<p><b>:help :map</b></p>\n\n<p><b>:help vt100-cursor-keys</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-move-the-cursor-to-the-end-of-the-previous-line-when-the-left-arrow-key-is-pressed-and-the-cursor-is-currently-at-the-beginning-of-a-line\">10.10. How do I configure Vim to move the cursor to the end of the previous line, when the left arrow key is pressed and the cursor is currently at the beginning of a line?</h2>\n\n<p>You can add the &quot;&lt;&quot; flag to the &#39;whichwrap&#39; option to configure Vim to move the cursor to the end of the previous line, when the left arrow key is pressed and the cursor is currently at the beginning of a line:</p>\n\n<pre><code>:set whichwrap+=&lt;</code></pre>\n\n<p>Similarly, to move the cursor the beginning of the next line, when the right arrow key is pressed and the cursor is currently at the end of a line, add the &quot;&gt;&quot; flag to the &#39;whichwrap&#39; option:</p>\n\n<pre><code>:set whichwrap+=&gt;</code></pre>\n\n<p>The above will work only in normal and visual modes. To use this in insert and replace modes, add the &quot;[&quot; and &quot;]&quot; flags respectively.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;whichwrap&#39;</b></p>\n\n<p><b>:help 05.7</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-stay-only-in-insert-mode-modeless-editing\">10.11. How do I configure Vim to stay only in insert mode (modeless editing)?</h2>\n\n<p>You can set the &#39;insertmode&#39; option to configure Vim to stay only in insert mode:</p>\n\n<pre><code>:set insertmode</code></pre>\n\n<p>By setting this option, you can use Vim as a modeless editor. If you press the &lt;Esc&gt; key, Vim will not go to the normal mode. To execute a single normal mode command, you can press CTRL-O followed by the normal mode command. To execute more than one normal command, you can use CTRL-L followed by the commands. To return to insert mode, press the &lt;Esc&gt; key. To disable this option, reset the &#39;insertmode&#39; option:</p>\n\n<pre><code>:set noinsertmode</code></pre>\n\n<p>You can also start vim using the &quot;evim&quot; command or you can use &quot;vim -y&quot; to use Vim as a modeless editor.</p>\n\n<p>You can also start Vim in insert mode using the `:startinsert` ex command.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;insertmode&#39;</b></p>\n\n<p><b>:help :startinsert</b></p>\n\n<p><b>:help :stopinsert</b></p>\n\n<p><b>:help i_CTRL-O</b></p>\n\n<p><b>:help i_CTRL-L</b></p>\n\n<p><b>:help evim</b></p>\n\n<p><b>:help evim-keys</b></p>\n\n<h2 id=\"How-do-I-display-some-context-lines-when-scrolling-text\">10.12. How do I display some context lines when scrolling text?</h2>\n\n<p>You can set the &#39;scrolloff&#39; option to display a minimal number of screen lines (context) above and below the cursor.</p>\n\n<pre><code>:set scrolloff=10</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;scrolloff&#39;</b></p>\n\n<p><b>:help &#39;sidescrolloff&#39;</b></p>\n\n<h2 id=\"How-do-I-go-back-to-previous-cursor-locations\">10.13. How do I go back to previous cursor locations?</h2>\n\n<p>You can go back to the cursor location before the latest jump using the &#39;&#39; or `` command. You can use the CTRL-O command to go back to older cursor positions and the CTRL-I command to go to the newer cursor positions in the jump list.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 03.10</b></p>\n\n<p><b>:help mark-motions</b></p>\n\n<p><b>:help jump-motions</b></p>\n\n<h1 id=\"SEARCHING-TEXT1\">SEARCHING TEXT</h1>\n\n<h2 id=\"After-I-searched-for-a-text-with-a-pattern-all-the-matched-text-stays-highlighted.-How-do-I-turn-off-the-highlighting-temporarily-permanently\">11.1. After I searched for a text with a pattern, all the matched text stays highlighted. How do I turn off the highlighting temporarily/permanently?</h2>\n\n<p>The &#39;hlsearch&#39; option controls whether all the matches for the last searched pattern are highlighted or not. By default, this option is not enabled. If this option is set in a system-wide vimrc file, then you can turn off the search highlighting by using the following command:</p>\n\n<pre><code>:set nohlsearch</code></pre>\n\n<p>To temporarily turn off the search highlighting, use</p>\n\n<pre><code>:nohlsearch</code></pre>\n\n<p>You can also clear the search highlighting, by searching for a pattern that is not in the current file (for example, search for the pattern &quot;asdf&quot;).</p>\n\n<p>You can use this mapping, to clear the search highlighting when redrawing the window pressing CTRL-L</p>\n\n<pre><code>:nnoremap &lt;silent&gt; &lt;C-L&gt; &lt;C-L&gt;:nohls&lt;CR&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;hlsearch&#39;</b></p>\n\n<p><b>:help :nohlsearch</b></p>\n\n<h2 id=\"How-do-I-enter-a-carriage-return-character-in-a-search-pattern\">11.2. How do I enter a carriage return character in a search pattern?</h2>\n\n<p>You can either use &quot;\\r&quot; or &lt;CTRL-V&gt;&lt;CTRL-M&gt; to enter a carriage return character in a pattern. In Vim scripts, it is better to use &quot;\\r&quot; for the carriage return character.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help sub-replace-special</b></p>\n\n<h2 id=\"How-do-I-search-for-the-character-M\">11.3. How do I search for the character ^M?</h2>\n\n<p>You can enter the ^M character in a search command by first pressing the CTRL-V key and then pressing the CTRL-M key.</p>\n\n<pre><code>/^V^M</code></pre>\n\n<p>You can also use the &quot;\\r&quot; character. In Vim scripts, &quot;\\r&quot; is preferred.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help c_CTRL-V</b></p>\n\n<p><b>:help using_CTRL-V</b></p>\n\n<p><b>:help /\\r</b></p>\n\n<h2 id=\"How-can-I-search-replace-characters-that-display-as-R-S-etc\">11.4. How can I search/replace characters that display as &quot;~R&quot;, &quot;~S&quot;, etc.?</h2>\n\n<p>You can use the &quot;ga&quot; command to display the ASCII value/code for the special character. For example, let us say the ASCII value is 142. Then you can use the following command to search for the special character:</p>\n\n<pre><code>/^V142</code></pre>\n\n<p>where, ^V is entered by pressing CTRL-V.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help ga</b></p>\n\n<p><b>:help using_CTRL-V</b></p>\n\n<p><b>:help 24.8</b></p>\n\n<h2 id=\"How-do-I-highlight-all-the-non-printable-characters-in-a-file\">11.5. How do I highlight all the non-printable characters in a file?</h2>\n\n<p>You can use the following commands and search pattern to highlight all the non-printable characters in a file:</p>\n\n<pre><code>:set hlsearch\n/\\(\\p\\|$\\)\\@!.</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help /\\p</b></p>\n\n<p><b>:help /bar</b></p>\n\n<p><b>:help /$</b></p>\n\n<p><b>:help /\\(</b></p>\n\n<p><b>:help /\\@!</b></p>\n\n<p><b>:help &#39;hlsearch&#39;</b></p>\n\n<h2 id=\"How-do-I-search-for-whole-words-in-a-file\">11.6. How do I search for whole words in a file?</h2>\n\n<p>You can search for whole words in a file using the \\&lt; and \\&gt; atoms. For example:</p>\n\n<pre><code>/\\&lt;myword\\&gt;</code></pre>\n\n<p>The \\&lt; atom matches the beginning of the word and the \\&gt; atom matches the end of the word.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help /\\&lt;</b></p>\n\n<p><b>:help /\\</b>&gt;</p>\n\n<h2 id=\"How-do-I-search-for-the-current-word-under-the-cursor\">11.7. How do I search for the current word under the cursor?</h2>\n\n<p>You can press the * key to search forward for the current word under the cursor. To search backward, you can press the # key. Note that only whole keywords will be searched using these commands.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help star</b></p>\n\n<p><b>:help #</b></p>\n\n<p><b>:help gstar</b></p>\n\n<p><b>:help g#</b></p>\n\n<p><b>:help 03.8</b></p>\n\n<p><b>:help search-commands</b></p>\n\n<h2 id=\"How-do-I-search-for-a-word-without-regard-to-the-case-uppercase-or-lowercase\">11.8. How do I search for a word without regard to the case (uppercase or lowercase)?</h2>\n\n<p>To always ignore case while searching for a pattern, set the &#39;ignorecase&#39; option:</p>\n\n<pre><code>:set ignorecase</code></pre>\n\n<p>To ignore case only when searching a particular pattern, use the special \\c directive:</p>\n\n<pre><code>/\\c&lt;pattern&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;ignorecase&#39;</b></p>\n\n<p><b>:help /ignorecase</b></p>\n\n<p><b>:help /\\c</b></p>\n\n<h2 id=\"How-do-I-search-for-words-that-occur-twice-consecutively\">11.9. How do I search for words that occur twice consecutively?</h2>\n\n<p>You can use one of the following search commands to locate words that occur twice consecutively:</p>\n\n<pre><code>/\\(\\&lt;\\w\\+\\)\\_s\\+\\1\\&gt;\n/\\(\\&lt;\\k\\+\\)\\_s\\+\\1\\&gt;</code></pre>\n\n<p>The main difference is the use of &quot;\\w&quot; and &quot;\\k&quot;, where the latter is based on the &#39;iskeyword&#39; option which may include accented and other language specific characters.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help /\\1</b></p>\n\n<p><b>:help /\\(</b></p>\n\n<p><b>:help /\\)</b></p>\n\n<p><b>:help /\\&lt;</b></p>\n\n<p><b>:help /\\</b>&gt;</p>\n\n<p><b>:help /\\w</b></p>\n\n<p><b>:help /\\k</b></p>\n\n<p><b>:help /\\+</b></p>\n\n<p><b>:help /\\_x</b></p>\n\n<p><b>:help &#39;iskeyword&#39;</b></p>\n\n<h2 id=\"How-do-I-count-the-number-of-times-a-particular-word-occurs-in-a-buffer\">11.10. How do I count the number of times a particular word occurs in a buffer?</h2>\n\n<p>You can use the following set of commands to count the number of times a particular word occurs in a buffer:</p>\n\n<pre><code>:let cnt=0\n:g/\\&lt;your_word\\&gt;/let cnt=cnt+1\n:echo cnt</code></pre>\n\n<p>This only counts the number of lines where the word occurs. You can also use the following command:</p>\n\n<pre><code>:%s/\\&lt;word\\&gt;/&amp;/gn</code></pre>\n\n<p>To count the number of alphabetic words in a file, you can use</p>\n\n<pre><code>:%s/\\a\\+/&amp;/gn</code></pre>\n\n<p>To count the number of words made up of non-space characters, you can use</p>\n\n<pre><code>:%s/\\S\\+/&amp;/gn</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help count-items</b></p>\n\n<p><b>:help word-count</b></p>\n\n<p><b>:help v_g_CTRL-G</b></p>\n\n<p><b>:help 12.5</b></p>\n\n<p><b>:help :s_flags</b></p>\n\n<h2 id=\"How-do-I-place-the-cursor-at-the-end-of-the-matched-word-when-searching-for-a-pattern\">11.11. How do I place the cursor at the end of the matched word when searching for a pattern?</h2>\n\n<p>You can use the &quot;e&quot; offset to the search command to place the cursor at the end of the matched word. For example</p>\n\n<pre><code>/mypattern/e</code></pre>\n\n<p>For more information about search offsets, read:</p>\n\n<p><b>:help search-offset</b></p>\n\n<p><b>:help /</b></p>\n\n<h2 id=\"How-do-I-search-for-an-empty-line\">11.12. How do I search for an empty line?</h2>\n\n<p>You can search for an empty line using:</p>\n\n<pre><code>/^$\n\nor\n\n/^\\s*$</code></pre>\n\n<p>The latter also matches lines, that consist only of white space, while the former only matches true empty lines. For more information, read:</p>\n\n<p><b>:help /^</b></p>\n\n<p><b>:help /$</b></p>\n\n<p><b>:help /\\s</b></p>\n\n<p><b>:help /star</b></p>\n\n<p><b>:help search-commands</b></p>\n\n<h2 id=\"How-do-I-search-for-a-line-containing-only-a-single-character\">11.13. How do I search for a line containing only a single character?</h2>\n\n<p>You can search for a line containing only a single character using:</p>\n\n<pre><code>/^\\s*\\a\\s*$</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help /^</b></p>\n\n<p><b>:help /\\a</b></p>\n\n<p><b>:help /\\s</b></p>\n\n<p><b>:help /star</b></p>\n\n<p><b>:help /$</b></p>\n\n<h2 id=\"How-do-I-search-and-replace-a-string-in-multiple-files\">11.14. How do I search and replace a string in multiple files?</h2>\n\n<p>You can use the `:argdo`, `:bufdo`, `:windo` or `:tabdo` commands to execute an ex command on multiple files. For example:</p>\n\n<pre><code>:argdo %s/foo/bar/g|upd</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :argdo</b></p>\n\n<p><b>:help :bufdo</b></p>\n\n<p><b>:help :windo</b></p>\n\n<p><b>:help :tabdo</b></p>\n\n<h2 id=\"I-am-using-the-:s-substitute-command-in-a-mapping.-When-a-search-for-a-pattern-fails-the-map-terminates.-I-would-like-the-map-to-continue-processing-the-next-command-even-if-the-substitute-command-fails.-How-do-I-do-this\">11.15. I am using the `:s` substitute command in a mapping. When a search for a pattern fails, the map terminates. I would like the map to continue processing the next command, even if the substitute command fails. How do I do this?</h2>\n\n<p>You can use the &quot;e&quot; flag to the substitute command to continue processing other commands in a map, when a pattern is not found.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :s_flags</b></p>\n\n<h2 id=\"How-do-I-search-for-the-n-th-occurrence-of-a-character-in-a-line\">11.16. How do I search for the n-th occurrence of a character in a line?</h2>\n\n<p>To search for the n-th occurrence of a character in a line, you can prefix the &quot;f&quot; command with a number. For example, to search for the 5th occurrence of the character @ in a line, you can use the command 5f@. This assumes the cursor is at the beginning of the line - and that this first character is not the one your are looking for.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help f</b></p>\n\n<p><b>:help F</b></p>\n\n<p><b>:help t</b></p>\n\n<p><b>:help T</b></p>\n\n<p><b>:help ;</b></p>\n\n<p><b>:help ,</b></p>\n\n<h2 id=\"How-do-I-replace-a-tab-or-any-other-character-with-a-hard-return-newline-character\">11.17. How do I replace a tab (or any other character) with a hard return (newline) character?</h2>\n\n<p>You can replace a tab (or any other character) with a hard return (newline) character using the following command:</p>\n\n<pre><code>:s/\\t/\\r/</code></pre>\n\n<p>Note that in the above command, if you use \\n instead of \\r, then the tab characters will not be replaced by a new-line character.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help sub-replace-special</b></p>\n\n<p><b>:help NL-used-for-Nul</b></p>\n\n<p><b>:help CR-used-for-NL</b></p>\n\n<h2 id=\"How-do-I-search-for-a-character-by-its-ASCII-value\">11.18. How do I search for a character by its ASCII value?</h2>\n\n<p>You can search for a character by its ASCII value by pressing CTRL-V followed by the decimal or hexadecimal or octal value of that character in the search &quot;/&quot; command. To determine the ASCII value of a character you can use the `:ascii` or the &quot;ga&quot; command.</p>\n\n<p>For example, to search for the ASCII character with value 188, you can use one of the following search commands:</p>\n\n<pre><code>/&lt;CTRL-V&gt;188\n/&lt;CTRL-V&gt;o274\n/&lt;CTRL-V&gt;xBC\n/&lt;CTRL-V&gt;u00bc</code></pre>\n\n<p>You can also search for the character with the decimal/octal/hex number using a collation [] like this:</p>\n\n<pre><code>/[\\d188]\n/[\\o274]\n/[\\xbc]\n/[\\u00bc]</code></pre>\n\n<p>Alternatively, you can use the special atom \\%d \\%o \\%x \\%u:</p>\n\n<pre><code>/\\%d188\n/\\%o274\n/\\%xbc\n/\\%u00bc</code></pre>\n\n<p>Or you use digraphs to enter the character. For example enter:</p>\n\n<pre><code>/CTRL-K14</code></pre>\n\n<p>to search for the above character.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-V_digit</b></p>\n\n<p><b>:help :ascii</b></p>\n\n<p><b>:help ga</b></p>\n\n<p><b>:help /\\]</b></p>\n\n<p><b>:help /\\%d</b></p>\n\n<p><b>:help digraphs</b></p>\n\n<h2 id=\"How-do-I-search-for-long-lines\">11.19. How do I search for long lines?</h2>\n\n<p>You can search for long lines or lines containing more than a specific number of characters using the Vim regular-expressions in the search command. For example, to search for all the lines containing more than 80 characters, you can use one of the following commands:</p>\n\n<pre><code>/^.\\{80}.\\+$\n/^.*\\%&gt;80c.*$\n/^.*\\%&gt;80v.*$</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help /\\{</b></p>\n\n<p><b>:help /\\%c</b></p>\n\n<p><b>:help /\\%v</b></p>\n\n<h2 id=\"How-do-I-display-all-the-lines-in-the-current-buffer-that-contain-a-specified-pattern\">11.20. How do I display all the lines in the current buffer that contain a specified pattern?</h2>\n\n<p>You can use the following command to display all the lines in the current buffer that contain a specified pattern:</p>\n\n<pre><code>:g/&lt;pattern&gt;/p</code></pre>\n\n<p>For example, the following command will display all the lines in the current buffer that contain &quot;vim&quot;:</p>\n\n<pre><code>:g/vim/p</code></pre>\n\n<p>Since `:p` is the default command to be executed for the ex command `:g`, you can also use:</p>\n\n<pre><code>:g/vim</code></pre>\n\n<p>If you also want the corresponding line numbers, then you can use the following command:</p>\n\n<pre><code>:g/&lt;pattern&gt;/#</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :global</b></p>\n\n<p><b>:help :print</b></p>\n\n<p><b>:help :number</b></p>\n\n<h2 id=\"How-do-I-search-for-a-text-string-that-spans-multiple-lines\">11.21. How do I search for a text string that spans multiple lines?</h2>\n\n<p>You can search for a text string that spans multiple lines using the \\_x regular expression atom. For example, to search for the text string &quot;Hello World&quot;, you can use the following search command:</p>\n\n<pre><code>/Hello\\_sWorld</code></pre>\n\n<p>This will match the word &quot;Hello&quot; followed by a newline character and then the word &quot;World&quot; at the beginning of the next line. This will also match the word &quot;Hello&quot; immediately followed by a space character and then the word &quot;World&quot;. When searching for the &quot;Hello World&quot; string, to include the space characters at the end and beginning of the line, you can use the following search command:</p>\n\n<pre><code>/Hello\\_s\\+World</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 27.8</b></p>\n\n<p><b>:help pattern-atoms</b></p>\n\n<p><b>:help /\\_</b></p>\n\n<p><b>:help pattern-searches</b></p>\n\n<h2 id=\"How-do-I-search-for-a-pattern-within-the-specified-range-of-lines-in-a-buffer\">11.22. How do I search for a pattern within the specified range of lines in a buffer?</h2>\n\n<p>You can search for a pattern within a range of lines using the \\%&gt;l and \\%&lt;l regular expression atoms.</p>\n\n<p>For example, to search for the word &quot;white&quot; between the lines 10 and 30 in a buffer, you can use the following command:</p>\n\n<pre><code>/white\\%&gt;9l\\%&lt;31l</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help /\\%l</b></p>\n\n<h2 id=\"How-do-I-clear-the-last-searched-pattern\">11.23. How do I clear the last searched pattern?</h2>\n\n<p>The last searched pattern is stored in the &quot;/&quot; register. You can clear this register using the following command:</p>\n\n<pre><code>:let @/=&quot;&quot;</code></pre>\n\n<p>To clear the last search pattern whenever a buffer is unloaded, you can use the following command:</p>\n\n<pre><code>:autocmd BufUnload * let @/ = &quot;&quot;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help @/</b></p>\n\n<p><b>:help :let-@</b></p>\n\n<p><b>:help autocmd-searchpat</b></p>\n\n<p><b>:help last-pattern</b></p>\n\n<h2 id=\"Why-does-this-pattern-a.---p-not-match\">11.24. Why does this pattern &quot;a.\\{-}p\\@!&quot; not match?</h2>\n\n<p>&quot;\\{-}&quot; doesn&#39;t just mean &quot;as few as possible&quot;, it means &quot;as few as possible to make the whole pattern succeed&quot;. If it didn&#39;t match the &quot;p&quot;, the whole pattern would fail (because of the &quot;p\\@!&quot;) so it does match the &quot;p&quot;. It is a longer match, but it is the shortest match that makes the whole pattern succeed.</p>\n\n<p>If you wanted &quot;as few as possible regardless&quot; you would use &quot;\\@&gt;&quot;, which basically divides a pattern up so that the pieces either side behave independently. If the pattern were &quot;a.\\{-}\\@&gt;p\\@!&quot; then &quot;.\\{-}&quot; would always match nothing because that&#39;s the smallest match that can succeed when there are not other restrictions. The whole pattern then would behave the same as &quot;ap\\@!&quot;, i.e. it would match any &quot;a&quot; not followed by a &quot;p&quot;).</p>\n\n<p>This means, it matches as few as possible &quot;a&quot;s without trying to keep going until Vim finds the longest match. This means, it will still match &quot;ap&quot;.</p>\n\n<h2 id=\"How-can-I-use-within-a-pattern-without-escaping-it\">11.25. How can I use &quot;/&quot; within a pattern, without escaping it?</h2>\n\n<p>When using / to search for a pattern, you need to escape all &quot;/&quot; within the pattern, because they would otherwise terminate the pattern. So you can&#39;t directly search for /usr/share/doc/ but need to search for \\/usr\\/share\\/doc\\/</p>\n\n<p>The easiest solution around that, would be to use &quot;?&quot; to start a backward search and afterwards use /&lt;CR&gt; to use the last search-pattern in forward direction.</p>\n\n<p>If you have a Vim, that has the eval-feature built in (which needs at least a normal built or higher), you can also directly paste the pattern into the search register:</p>\n\n<p>:let @/ = &#39;/usr/share/doc/&#39;</p>\n\n<p>Then use &quot;n&quot; to jump to the next occurrence.</p>\n\n<p>See also the help at</p>\n\n<p><b>:help @/</b></p>\n\n<p><b>:help /&lt;CR</b>&gt;</p>\n\n<h2 id=\"How-can-I-operate-on-a-search-match\">11.26. How can I operate on a search match?</h2>\n\n<p>The &quot;gn&quot; command makes it easy to operate on regions of text that match the current search pattern. By default, it will search forward for the last used search pattern and visually select the match. If the cursor is already on the match, it will be visually selected. If you used the &quot;gn&quot; command after an operator (e.g. &quot;c&quot; to change text), it will be applied on the match.</p>\n\n<p>If Visual mode is active before using gn, the visual selection will be extended until the end of the next match.</p>\n\n<p>The &quot;gN&quot; commands works similar but searches backwards.</p>\n\n<p>This allows to repeat simple operations on each match. For example, you might want to change each occurence of apples by peaches. So you search using &quot;/apple&quot; then you can use &quot;cgnpeach&lt;Esc&gt;&quot; to replace the current match by peach. Now you can use the dot &quot;.&quot; command to redo the replacement for the rest of the buffer.</p>\n\n<p>See also the help at</p>\n\n<p><b>:help gn</b></p>\n\n<p><b>:help gN</b></p>\n\n<h1 id=\"CHANGING-TEXT1\">CHANGING TEXT</h1>\n\n<h2 id=\"How-do-I-delete-all-the-trailing-white-space-characters-SPACE-and-TAB-at-the-end-of-all-the-lines-in-a-file\">12.1. How do I delete all the trailing white space characters (SPACE and TAB) at the end of all the lines in a file?</h2>\n\n<p>You can use the `:substitute` command on the entire file to search and remove all the trailing white space characters:</p>\n\n<pre><code>:%s/\\s\\+$//</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :%</b></p>\n\n<p><b>:help :s</b></p>\n\n<p><b>:help /\\s</b></p>\n\n<p><b>:help /\\+</b></p>\n\n<p><b>:help /$</b></p>\n\n<h2 id=\"How-do-I-replace-all-the-occurrences-of-multiple-consecutive-space-characters-to-a-single-space\">12.2. How do I replace all the occurrences of multiple consecutive space characters to a single space?</h2>\n\n<p>You can use the following command to replace all the occurrences of multiple consecutive space characters to a single space:</p>\n\n<pre><code>:%s/ \\{2,}/ /g</code></pre>\n\n<p>Alternatively use:</p>\n\n<pre><code>:%s/  \\+/ /g</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :%</b></p>\n\n<p><b>:help :s</b></p>\n\n<p><b>:help /\\{</b></p>\n\n<p><b>:help :s_flags</b></p>\n\n<h2 id=\"How-do-I-reduce-a-range-of-empty-lines-into-one-line-only\">12.3. How do I reduce a range of empty lines into one line only?</h2>\n\n<p>You can use the following command to reduce a range of empty lines into one line only:</p>\n\n<pre><code>:v/./.,/./-1join</code></pre>\n\n<p>The explanation for this command is below:</p>\n\n<pre><code>part            description\n-----           --------------------------\n:v/./           Execute the following command for all lines not\n                containing a character (empty lines).\n .,             Use the current line as the start of the range of\n                lines.\n /./            Use the line containing a character as the last line.\n -1             Adjust the range of lines to end with the line before\n                the last line.\n j              Join the lines in the range.</code></pre>\n\n<p>Note that this will give an error message if the empty lines are at the end of the file. To correct this, you have to add a temporary line at the end of the file, execute the command and then remove the temporary line.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :v</b></p>\n\n<p><b>:help :join</b></p>\n\n<p><b>:help cmdline-ranges</b></p>\n\n<p><b>:help collapse</b></p>\n\n<h2 id=\"How-do-I-delete-all-blank-lines-in-a-file-How-do-I-remove-all-the-lines-containing-only-space-characters\">12.4. How do I delete all blank lines in a file? How do I remove all the lines containing only space characters?</h2>\n\n<p>To remove all blank lines, use the following command:</p>\n\n<pre><code>:g/^$/d</code></pre>\n\n<p>To remove all lines with only whitespace (spaces or tabs) in them, use the following command:</p>\n\n<pre><code>:g/^\\s\\+$/d</code></pre>\n\n<p>To remove all the lines with only whitespace, if anything, use the following command:</p>\n\n<pre><code>:g/^\\s*$/d</code></pre>\n\n<h2 id=\"How-do-I-copy-yank-the-current-word\">12.5. How do I copy/yank the current word?</h2>\n\n<p>You can use the &quot;yiw&quot; (yank inner word without whitespace) command or the &quot;yaw&quot; (yank a word with whitespace) command to copy/yank the current word.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 04.6</b></p>\n\n<p><b>:help 04.8</b></p>\n\n<p><b>:help iw</b></p>\n\n<p><b>:help yank</b></p>\n\n<p><b>:help text-objects</b></p>\n\n<p><b>:help objects</b></p>\n\n<h2 id=\"How-do-I-yank-text-from-one-position-to-another-position-within-a-line-without-yanking-the-entire-line\">12.6. How do I yank text from one position to another position within a line, without yanking the entire line?</h2>\n\n<p>You can specify a motion command with the yank operator (y) to yank text from one position to another position within a line. For example, to yank from the current cursor position till the next letter x, use yfx or Fx or tx or Tx. To yank till the nth column, use n|. To yank till the next occurrence of a &quot;word&quot;, use /word. To do a yank till the nth column on another line, first mark the position using the &quot;ma&quot; command, go to the start of the yank position, and then yank till the mark using y`a (note the direction of the quote)</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help yank</b></p>\n\n<p><b>:help motion.txt</b></p>\n\n<p><b>:help 04.6</b></p>\n\n<h2 id=\"When-I-yank-some-text-into-a-register-how-do-I-append-the-text-to-the-current-contents-of-the-register\">12.7. When I yank some text into a register, how do I append the text to the current contents of the register?</h2>\n\n<p>When you specify the register for some operation, if you use the upper-case for the register name, then the new text will be appended to the existing contents. For example, if you have some text in the register &quot;a&quot;. If you want to append some new text to this, you have to use the &quot;A&quot; register name. If you use the lowercase register name, then the contents of the register will be overwritten with the new text.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help quote</b></p>\n\n<p><b>:help quote_alpha</b></p>\n\n<p><b>:help 10.1</b></p>\n\n<h2 id=\"How-do-I-yank-a-complete-sentence-that-spans-over-more-than-one-line\">12.8. How do I yank a complete sentence that spans over more than one line?</h2>\n\n<p>To yank a complete sentence that spans over more than one line you have to use the yank operator followed by a motion command. For example:</p>\n\n<pre><code>y)</code></pre>\n\n<p>From inside the sentence you can use &quot;yi)&quot; to yank the sentence.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help yank</b></p>\n\n<p><b>:help {motion}</b></p>\n\n<p><b>:help object-motions</b></p>\n\n<p><b>:help 04.6</b></p>\n\n<h2 id=\"How-do-I-yank-all-the-lines-containing-a-pattern-into-a-buffer\">12.9. How do I yank all the lines containing a pattern into a buffer?</h2>\n\n<p>You can use the `:global` command to yank all the lines containing the pattern into a register and then paste the contents of the register into the buffer:</p>\n\n<pre><code>:let @a=&#39;&#39;\n:g/mypattern/y A</code></pre>\n\n<p>The first command, clears the contents of the register &quot;a&quot;. The second command copies all the lines containing &quot;mypattern&quot; into the register &quot;a&quot;. Note that the capital letter &quot;A&quot; is used to append the matched lines. Now you can paste the contents of register &quot;a&quot; to a buffer using &quot;ap command.</p>\n\n<p>If you only want to collect all matches, you can use a different approach. For that run the `:s` command with the flags &quot;gn&quot; so that it won&#39;t actually change the buffer (&quot;n&quot; flag) but select each match (&quot;g&quot; flag). Combining this with the &quot;\\=&quot; part in the replacement part, you can copy each match to e.g. a list. Altogether this looks like this:</p>\n\n<pre><code>:let list=[]\n:%s/pattern/\\=add(list, submatch(0))/gn</code></pre>\n\n<p>Now all matches will be in the list and you can post process them as wanted.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :g</b></p>\n\n<p><b>:help :y</b></p>\n\n<p><b>:help :let-register</b></p>\n\n<p><b>:help quote_alpha</b></p>\n\n<p><b>:help put</b></p>\n\n<p><b>:help registers</b></p>\n\n<p><b>:help :registers</b></p>\n\n<p><b>:help sub-replace-\\=</b></p>\n\n<h2 id=\"How-do-I-delete-all-the-lines-in-a-file-that-do-not-contain-a-pattern\">12.10. How do I delete all the lines in a file that do not contain a pattern?</h2>\n\n<p>You can use `:v` command to delete all the lines that do not contain a pattern:</p>\n\n<pre><code>:v/pattern/d</code></pre>\n\n<p>or</p>\n\n<pre><code>:g!/pattern/d</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :v</b></p>\n\n<p><b>:help :g</b></p>\n\n<h2 id=\"How-do-I-add-a-line-before-each-line-with-pattern-in-it\">12.11. How do I add a line before each line with &quot;pattern&quot; in it?</h2>\n\n<p>You can use the following command to add a line before each line with &quot;pattern&quot; in it:</p>\n\n<pre><code>:g/pattern/normal! Oi&lt;line of text goes here&gt;</code></pre>\n\n<p>Alternatively you can yank the line using the Y command and then insert the line using the following command:</p>\n\n<pre><code>:g/pattern/put!</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :g</b></p>\n\n<p><b>:help :put</b></p>\n\n<p><b>:help insert</b></p>\n\n<p><b>:help 0</b></p>\n\n<h2 id=\"Is-there-a-way-to-operate-on-a-line-if-the-previous-line-contains-a-particular-pattern\">12.12. Is there a way to operate on a line if the previous line contains a particular pattern?</h2>\n\n<p>You can use the `:global` command to operate on a line, if the previous line contains a particular pattern:</p>\n\n<pre><code>:g/&lt;pattern&gt;/+{cmd}</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :g</b></p>\n\n<p><b>:help :range</b></p>\n\n<h2 id=\"How-do-I-execute-a-command-on-all-the-lines-containing-a-pattern\">12.13. How do I execute a command on all the lines containing a pattern?</h2>\n\n<p>You can use the `:global` (:g) command to execute a command on all the lines containing a pattern.</p>\n\n<pre><code>:g/my pattern/d</code></pre>\n\n<p>If you want to use a non-Ex command, then you can use the `:normal` command:</p>\n\n<pre><code>:g/my pattern/normal {command}</code></pre>\n\n<p>Unless you want the normal mode commands to be remapped, consider using a `:normal!` command instead (note the &quot;!&quot;).</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :global</b></p>\n\n<p><b>:help :v</b></p>\n\n<p><b>:help :normal</b></p>\n\n<h2 id=\"Can-I-copy-the-character-above-the-cursor-to-the-current-cursor-position\">12.14. Can I copy the character above the cursor to the current cursor position?</h2>\n\n<p>In Insert mode, you can copy the character above the cursor to the current cursor position by typing CTRL-Y. The same can be done with the characters below the cursor by typing CTRL-E.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-Y</b></p>\n\n<p><b>:help i_CTRL-E</b></p>\n\n<h2 id=\"How-do-I-insert-a-blank-line-above-below-the-current-line-without-entering-insert-mode\">12.15. How do I insert a blank line above/below the current line without entering insert mode?</h2>\n\n<p>You can use the `:put` ex command to insert blank lines. For example, try</p>\n\n<pre><code>:put =&#39;&#39;\n:put! =&#39;&#39;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :put</b></p>\n\n<h2 id=\"How-do-I-insert-the-name-of-the-current-file-into-the-current-buffer\">12.16. How do I insert the name of the current file into the current buffer?</h2>\n\n<p>There are several ways to insert the name of the current file into the current buffer. In insert mode, you can use the &lt;C-R&gt;% or the &lt;C-R&gt;=expand(&quot;%&quot;) command. In normal mode, you can use the `:put =@%` command.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-R</b></p>\n\n<p><b>:help expand()</b></p>\n\n<p><b>:help !!</b></p>\n\n<h2 id=\"How-do-I-insert-the-contents-of-a-Vim-register-into-the-current-buffer\">12.17. How do I insert the contents of a Vim register into the current buffer?</h2>\n\n<p>In insert mode, you can use the &lt;CTRL-R&gt;&lt;register&gt; command to insert the contents of &lt;register&gt;. For example, use &lt;CTRL-R&gt;a to insert the contents of register &quot;a&quot; into the current buffer.</p>\n\n<p>In normal mode, you can use the `:put &lt;register&gt;` command to insert the contents of &lt;register&gt;. For example, use the `:put d` command to insert the contents of register &quot;d&quot; into the current buffer.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-R</b></p>\n\n<p><b>:help i_CTRL-R_CTRL-R</b></p>\n\n<p><b>:help i_CTRL-R_CTRL-O</b></p>\n\n<p><b>:help i_CTRL-R_CTRL-P</b></p>\n\n<p><b>:help :put</b></p>\n\n<h2 id=\"How-do-I-move-the-cursor-past-the-end-of-line-and-insert-some-characters-at-some-columns-after-the-end-of-the-line\">12.18. How do I move the cursor past the end of line and insert some characters at some columns after the end of the line?</h2>\n\n<p>You can set the &#39;virtualedit&#39; option to move the cursor past the end-of-line and insert characters in a column after the end-of-line. To start the virtual mode, use</p>\n\n<pre><code>:set virtualedit=all</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;virtualedit&#39;</b></p>\n\n<h2 id=\"How-to-replace-the-word-under-the-cursor-say:-junk-with-foojunkbar-in-Vim\">12.19. How to replace the word under the cursor (say: junk) with &quot;foojunkbar&quot; in Vim?</h2>\n\n<p>There are several ways to do this. If the word is the first such word on the line, use the following command:</p>\n\n<pre><code>:exe &quot;s/&quot;.expand(&quot;&lt;cword&gt;&quot;).&quot;/foo&amp;bar/&quot;</code></pre>\n\n<p>To match specifically you could use a more complex substitution like this:</p>\n\n<pre><code>:exe &#39;s/\\&lt;&#39;.expand(&quot;&lt;cword&gt;&quot;).&#39;\\%&gt;&#39;.(col(&quot;.&quot;)-1).&#39;c\\&gt;/foo&amp;bar/&#39;</code></pre>\n\n<p>You can also use the command: ciwfoo&lt;C-R&gt;&quot;bar&lt;Esc&gt;</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :substitute</b></p>\n\n<p><b>:help expand()</b></p>\n\n<p><b>:help col()</b></p>\n\n<p><b>:help /\\%c</b></p>\n\n<h2 id=\"How-do-I-replace-a-particular-text-in-all-the-files-in-a-directory\">12.20. How do I replace a particular text in all the files in a directory?</h2>\n\n<p>You can use the `:argdo` command to execute the substitute command on all the files specified as arguments:</p>\n\n<pre><code>:args *\n:argdo %s/&lt;your_text&gt;/&lt;replacement_text&gt;/ge | update</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :args_f</b></p>\n\n<p><b>:help :argdo</b></p>\n\n<p><b>:help :s_flags</b></p>\n\n<h2 id=\"I-have-some-numbers-in-a-file.-How-do-I-increment-or-decrement-the-numbers-in-the-file\">12.21. I have some numbers in a file. How do I increment or decrement the numbers in the file?</h2>\n\n<p>You can use the CTRL-A key to increment the number and the CTRL-X key to decrement the number. You can also specify the number to increment/decrement from the number by specifying a count to the key. This works for decimal, octal and hexadecimal numbers. You can change the base used by Vim for this operation by modifying the &#39;nrformats&#39; option.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 26.2</b></p>\n\n<p><b>:help CTRL-A</b></p>\n\n<p><b>:help CTRL-X</b></p>\n\n<p><b>:help &#39;nrformats&#39;</b></p>\n\n<h2 id=\"How-do-I-reuse-the-last-used-search-pattern-in-a-:substitute-command\">12.22. How do I reuse the last used search pattern in a `:substitute` command?</h2>\n\n<p>To reuse the last used search pattern in a `:substitute` command, don&#39;t specify a new search pattern:</p>\n\n<pre><code>:s/pattern/newtext/\n:s//sometext/</code></pre>\n\n<p>In the second `:s` command, as a search pattern is not specified, the pattern specified in the first `:s` command &quot;pattern&quot; will be used.</p>\n\n<p>If you want to change the search pattern but repeat the substitution pattern you can use the special right hand side, you can use the tilde character:</p>\n\n<pre><code>:s/newpattern/~/</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :s</b></p>\n\n<p><b>:help :&amp;</b></p>\n\n<p><b>:help :~</b></p>\n\n<p><b>:help &amp;</b></p>\n\n<p><b>:help sub-replace-special</b></p>\n\n<h2 id=\"How-do-I-change-the-case-of-a-string-using-the-:substitute-command\">12.23. How do I change the case of a string using the `:substitute` command?</h2>\n\n<p>You can use special characters in the replacement string for a `:substitute` command to change the case of the matched string. For example, to change the case of the string &quot;MyString&quot; to all uppercase, you can use the following command:</p>\n\n<pre><code>:%s/MyString/\\U&amp;/g</code></pre>\n\n<p>To change the case to lowercase, you can use the following command:</p>\n\n<pre><code>:%s/MyString/\\L&amp;/g</code></pre>\n\n<p>To change the case of the first character in all the words in the current line to uppercase, you can use the following command:</p>\n\n<pre><code>:s/\\&lt;\\(.\\)\\(\\k*\\)\\&gt;/\\u\\1\\L\\2/g</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help sub-replace-special</b></p>\n\n<p><b>:help :substitute</b></p>\n\n<p><b>:help /\\U</b></p>\n\n<p><b>:help /\\L</b></p>\n\n<p><b>:help /\\u</b></p>\n\n<h2 id=\"How-do-I-enter-characters-that-are-not-present-in-the-keyboard\">12.24. How do I enter characters that are not present in the keyboard?</h2>\n\n<p>You can use digraphs to enter characters that are not present in the keyboard. You can use the `:digraphs` command to display all the currently defined digraphs. You can add a new digraph to the list using the `:digraphs` command.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help digraphs</b></p>\n\n<p><b>:help &#39;digraph&#39;</b></p>\n\n<p><b>:help 24.9</b></p>\n\n<h2 id=\"Is-there-a-command-to-remove-any-or-all-digraphs\">12.25. Is there a command to remove any or all digraphs?</h2>\n\n<p>No. The digraphs table is defined at compile time. You can only add new ones. Adding a command to remove digraphs is on the todo list.</p>\n\n<h2 id=\"In-insert-mode-when-I-press-the-backspace-key-it-erases-only-the-characters-entered-in-this-instance-of-insert-mode.-How-do-I-erase-previously-entered-characters-in-insert-mode-using-the-backspace-key\">12.26. In insert mode, when I press the backspace key, it erases only the characters entered in this instance of insert mode. How do I erase previously entered characters in insert mode using the backspace key?</h2>\n\n<p>This is traditional vi behaviour. You can set the &#39;backspace&#39; option to erase previously entered characters in insert mode:</p>\n\n<pre><code>:set backspace=indent,eol,start</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;backspace&#39;</b></p>\n\n<p><b>:help i_backspacing</b></p>\n\n<h2 id=\"I-have-a-file-which-has-lines-longer-than-72-characters-terminated-with-and-wrapped-to-the-next-line.-How-can-I-quickly-join-the-lines\">12.27. I have a file which has lines longer than 72 characters terminated with &quot;+&quot; and wrapped to the next line. How can I quickly join the lines?</h2>\n\n<p>You can use the `:global` command to search and join the lines:</p>\n\n<pre><code>:g/+$/j</code></pre>\n\n<p>This will, however, only join every second line. A couple of more complex examples which will join all consecutive lines with a &quot;+&quot; at the end are:</p>\n\n<pre><code>:g/+$/,/\\(^\\|[^+]\\)$/j\n:g/+$/mark a | .,/\\(^\\|[^+]\\)$/s/+$// | &#39;a,.j</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :g</b></p>\n\n<p><b>:help :j</b></p>\n\n<p><b>:help :mark</b></p>\n\n<h2 id=\"How-do-I-paste-characterwise-yanked-text-into-separate-lines\">12.28. How do I paste characterwise yanked text into separate lines?</h2>\n\n<p>You can use the `:put` command to paste characterwise yanked text into new lines:</p>\n\n<pre><code>:put =@&quot;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :put</b></p>\n\n<p><b>:help quote_=</b></p>\n\n<h2 id=\"How-do-I-change-the-case-uppercase-lowercase-of-a-word-or-a-character-or-a-block-of-text\">12.29. How do I change the case (uppercase, lowercase) of a word or a character or a block of text?</h2>\n\n<p>You can use the &quot;~&quot; command to switch the case of a character.</p>\n\n<p>You can change the case of the word under the cursor to uppercase using the &quot;gUiw&quot; or &quot;viwU&quot; command and to lowercase using the &quot;guiw&quot; or &quot;viwu&quot; command.</p>\n\n<p>You can switch the case (upper case to lower case and vice versa) of the word under the cursor using the &quot;viw~&quot; or &quot;g~iw&quot; command.</p>\n\n<p>You can use the &quot;gUgU&quot; command to change the current line to uppercase and the &quot;gugu&quot; command to change the current line to lowercase.</p>\n\n<p>You can use the &quot;g~g~&quot; command to switch the case of the current line. You can use the &quot;g~{motion}&quot; or &quot;{Visual}~&quot; commands to switch the case of a block of text.</p>\n\n<p>If you set &#39;tildeop&#39; the &quot;~&quot; command behaves like an operator and expects a motion command to act on. If you have</p>\n\n<pre><code>:set tildeop</code></pre>\n\n<p>and you want to change the case from the current cursor position to the end of line, simply use &quot;~$&quot;.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help case</b></p>\n\n<p><b>:help &#39;tildeop&#39;</b></p>\n\n<h2 id=\"How-do-I-enter-ASCII-characters-that-are-not-present-in-the-keyboard\">12.30. How do I enter ASCII characters that are not present in the keyboard?</h2>\n\n<p>You can enter ASCII characters that are not present in the keyboard by pressing CTRL-V and then the ASCII character number. You can also use digraphs to enter special ASCII characters.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-V_digit</b></p>\n\n<p><b>:help digraphs</b></p>\n\n<p><b>:help 45.5</b></p>\n\n<h2 id=\"How-do-I-replace-non-printable-characters-in-a-file\">12.31. How do I replace non-printable characters in a file?</h2>\n\n<p>To replace a non-printable character, you have to first determine the ASCII value for the character. You can use the `:ascii` ex command or the &quot;ga&quot; normal-mode command to display the ASCII value of the character under the cursor.</p>\n\n<p>You can enter the non-printable character by entering CTRL-V followed by the decimal number 1-255 (with no leading zero), or by x and a hex number 00-FF, or by an octal number 0-0377 (with leading zero), or by u and a hex number 0-FFFF, or by U and a hex number 0-7FFFFFFF</p>\n\n<p>Another alternative is to use the `:digraphs` ex command to display the digraphs for all characters, together with their value in decimal and alpha. You can enter a non-printable character by entering CTRL-K followed by two alphanumeric characters (a digraph).</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :ascii</b></p>\n\n<p><b>:help i_CTRL-V</b></p>\n\n<p><b>:help i_CTRL-V_digit</b></p>\n\n<p><b>:help :digraphs</b></p>\n\n<h2 id=\"How-do-I-remove-duplicate-lines-from-a-buffer\">12.32. How do I remove duplicate lines from a buffer?</h2>\n\n<p>You can use the following user-defined command to remove all the duplicate lines from a buffer:</p>\n\n<p>:command -range=% Uniq &lt;line1&gt;,&lt;line2&gt;g/^\\%&lt;&lt;line2&gt;l\\(.*\\)\\n\\1$/d</p>\n\n<p>Add the above command to your .vimrc file and invoke `:Uniq` to remove all the duplicate lines.</p>\n\n<h2 id=\"How-do-I-prefix-all-the-lines-in-a-file-with-the-corresponding-line-numbers\">12.33. How do I prefix all the lines in a file with the corresponding line numbers?</h2>\n\n<p>You can prefix the lines in a file with the corresponding line number in several ways. Some of them are listed below:</p>\n\n<pre><code>:%s/^/\\=line(&#39;.&#39;). &#39; &#39;\n:%s/^/\\=printf(&#39;%5d &#39;, line(&#39;.&#39;))/\n:%s/^/\\=strpart(line(&#39;.&#39;).&#39;.     &#39;, 0, 5)\n:%s/^/\\=strpart(&#39;   &#39;, strlen(line(&#39;.&#39;))).line(&#39;.&#39;).&#39;. &#39;</code></pre>\n\n<p>The last two commands will pad the line numbers with space characters. The last command will right align the numbers and the command before that will left align the numbers.</p>\n\n<p>If you don&#39;t want to number consecutive lines but rather non-consecutive regions, you can also use this idiom:</p>\n\n<pre><code>:let i = 1\n:g/TODO/s/^/\\=printf(&#39;%2d.&#39;,i)|let i+=1</code></pre>\n\n<p>This first initializes the variable i with 1. In the next line, a `:g` command is used to perform a substitute command only on lines, that match &quot;TODO&quot;. After the substitute command has taken place, the variable i will be incremented by 1.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help sub-replace-special</b></p>\n\n<p><b>:help line()</b></p>\n\n<p><b>:help expr6</b></p>\n\n<p><b>:help strpart()</b></p>\n\n<p><b>:help printf()</b></p>\n\n<p><b>:help :execute</b></p>\n\n<p><b>:help :global</b></p>\n\n<h2 id=\"How-do-I-exchange-swap-two-characters-or-words-or-lines\">12.34. How do I exchange (swap) two characters or words or lines?</h2>\n\n<p>You can exchange two characters with the &quot;xp&quot; command sequence. The &quot;x&quot; will delete the character under the cursor and &quot;p&quot; will paste the just deleted character after the character under the cursor. This will result in exchanging the two characters.</p>\n\n<p>You can exchange two words with the &quot;deep&quot; command sequence (start with the cursor in the blank space before the first word).</p>\n\n<p>You can exchange two lines with the &quot;ddp&quot; command sequence. The &quot;dd&quot; will delete the current line and &quot;p&quot; will paste the just deleted line after the current line. This will result in exchanging the two lines.</p>\n\n<p>All of the above operations will change the &quot; unnamed register.</p>\n\n<p>You can use the `:m +` ex command to exchange two lines without changing the unnamed register.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help x</b></p>\n\n<p><b>:help p</b></p>\n\n<p><b>:help dd</b></p>\n\n<p><b>:help d</b></p>\n\n<p><b>:help e</b></p>\n\n<p><b>:help linewise-register</b></p>\n\n<p><b>:help quotequote</b></p>\n\n<p><b>:help :move</b></p>\n\n<h2 id=\"How-do-I-change-the-characters-used-as-word-delimiters\">12.35. How do I change the characters used as word delimiters?</h2>\n\n<p>Vim uses the characters specified by the &#39;iskeyword&#39; option as word delimiters. The default setting for this option is &quot;@,48-57,_,192-255&quot;.</p>\n\n<p>For example, to add &quot;:&quot; as a word delimiter, you can use</p>\n\n<pre><code>:set iskeyword+=:</code></pre>\n\n<p>To remove &quot;_&quot; as a word delimiter, you can use</p>\n\n<pre><code>:set iskeyword-=_</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;iskeyword&#39;</b></p>\n\n<p><b>:help word</b></p>\n\n<h1 id=\"COMPLETION-IN-INSERT-MODE1\">COMPLETION IN INSERT MODE</h1>\n\n<h2 id=\"How-do-I-complete-words-or-lines-in-insert-mode\">13.1. How do I complete words or lines in insert mode?</h2>\n\n<p>In insert mode, you can complete words using the CTRL-P and CTRL-N keys. The CTRL-N command searches forward for the next matching keyword. The CTRL-P command searches backwards for the next matching keyword.</p>\n\n<p>In insert mode, you can use the CTRL-X CTRL-L command sequence to complete lines that starts with the same characters as in the current line before the cursor. To get the next matching line, press the CTRL-P or CTRL-N keys. There are a lot of other keys/ways available to complete words in insert mode.</p>\n\n<p>Vim supports completion of the following items:</p>\n\n<pre><code>CTRL-X CTRL-L    whole lines\nCTRL-X CTRL-N    keywords in the current file\nCTRL-X CTRL-K    words from a dictionary\nCTRL-X CTRL-T    words from a thesaurus\nCTRL-X CTRL-I    current and included files\nCTRL-X CTRL-]    tags\nCTRL-X CTRL-F    file names\nCTRL-X CTRL-D    macro definitions (also in included files)\nCTRL-X CTRL-V    Vim command line\nCTRL-X CTRL-U    User defined completion\nCTRL-X CTRL-O    Omni completion</code></pre>\n\n<p>User defined completions and omni completions are often set by filetype plugins.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 24.3</b></p>\n\n<p><b>:help ins-completion</b></p>\n\n<h2 id=\"How-do-I-complete-file-names-in-insert-mode\">13.2. How do I complete file names in insert mode?</h2>\n\n<p>In insert mode, you can use the CTRL-X CTRL-F command sequence to complete filenames that start with the same characters as in the current line before the cursor.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help compl-filename</b></p>\n\n<h2 id=\"I-am-using-CTRL-P-CTRL-N-to-complete-words-in-insert-mode.-How-do-I-complete-words-that-occur-after-the-just-completed-word\">13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do I complete words that occur after the just completed word?</h2>\n\n<p>You can use CTRL-X CTRL-N and CTRL-X CTRL-P keys to complete words that are present after the just completed word.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-X_CTRL-P</b></p>\n\n<p><b>:help i_CTRL-X_CTRL-N</b></p>\n\n<p><b>:help ins-completion</b></p>\n\n<h1 id=\"TEXT-FORMATTING1\">TEXT FORMATTING</h1>\n\n<h2 id=\"How-do-I-format-a-text-paragraph-so-that-a-new-line-is-inserted-at-the-end-of-each-wrapped-line\">14.1. How do I format a text paragraph so that a new line is inserted at the end of each wrapped line?</h2>\n\n<p>You can use the &quot;gq&quot; command to format a paragraph. This will format the text according to the current &#39;textwidth&#39; setting. An alternative would be to use the &quot;gw&quot; command that formats like &quot;gq&quot; but does not move the cursor.</p>\n\n<p>Note that the gq operator can be used with a motion command to operate on a range of text. For example:</p>\n\n<pre><code>gqgq - Format the current line\ngqap - Format current paragraph\ngwap - Format current paragraph (and don&#39;t move cursor)\ngq3j - Format the current and the next 3 lines</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help gq</b></p>\n\n<p><b>:help gw</b></p>\n\n<p><b>:help formatting</b></p>\n\n<p><b>:help usr_25.txt</b></p>\n\n<p><b>:help motion.txt</b></p>\n\n<h2 id=\"How-do-I-format-long-lines-in-a-file-so-that-each-line-contains-less-than-n-characters\">14.2. How do I format long lines in a file so that each line contains less than &quot;n&quot; characters?</h2>\n\n<p>You can set the &#39;textwidth&#39; option to control the number of characters that can be present in a line. For example, to set the maximum width of a line to 70 characters, you can use the following command:</p>\n\n<pre><code>set textwidth=70</code></pre>\n\n<p>Now to break the long lines in a file to the length defined by the &#39;textwidth&#39; option, you can use</p>\n\n<pre><code>:g/./normal gqq</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;textwidth&#39;</b></p>\n\n<p><b>:help gq</b></p>\n\n<h2 id=\"How-do-I-join-short-lines-to-form-a-paragraph\">14.3. How do I join short lines to form a paragraph?</h2>\n\n<p>First, make sure the &#39;textwidth&#39; option is set to a high value:</p>\n\n<pre><code>:set textwidth=99999</code></pre>\n\n<p>Next, join the short lines to form a paragraph using the command:</p>\n\n<pre><code>1GgqG</code></pre>\n\n<p>The above command will operate on the entire file. To do the formatting on all paragraphs in a specific range, use:</p>\n\n<pre><code>:&#39;a,&#39;bg/\\S/normal gq}</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help gq</b></p>\n\n<p><b>:help G</b></p>\n\n<p><b>:help gqq</b></p>\n\n<h2 id=\"How-do-I-format-bulleted-and-numbered-lists\">14.4. How do I format bulleted and numbered lists?</h2>\n\n<p>You can configure Vim to format bulleted and numbered lists using the &#39;formatoptions&#39; option. For example, you can format the list of the following format:</p>\n\n<pre><code>- this is a test. this is a test. this is a test. this is a test.\nthis is a test.</code></pre>\n\n<p>into this format:</p>\n\n<pre><code> - this is a test. this is a test. this is a test. this is a test.\nthis is a test.</code></pre>\n\n<p>You can use the &quot;n&quot; flag in the &#39;formatoptions&#39; to align the text.</p>\n\n<pre><code>:set fo+=n</code></pre>\n\n<p>With this option, when formatting text, Vim will recognize numbered lists. For this option to work, the &#39;autoindent&#39; option also must be set.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;formatoptions&#39;</b></p>\n\n<p><b>:help fo-table</b></p>\n\n<p><b>:help format-comments</b></p>\n\n<h2 id=\"How-do-I-indent-lines-in-insert-mode\">14.5. How do I indent lines in insert mode?</h2>\n\n<p>In insert mode, you can press the CTRL-T key to insert one shiftwidth of indent at the start of the current line. In insert mode, you can use the CTRL-D key to delete on shiftwidth of indent at the start of the current line. You can also use the CTRL-O &gt;&gt; and CTRL-O &lt;&lt; commands to indent the current line in insert mode.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-T</b></p>\n\n<p><b>:help i_CTRL-D</b></p>\n\n<p><b>:help i_0_CTRL-D</b></p>\n\n<p><b>:help i_CTRL-O</b></p>\n\n<p><b>:help </b>&gt;&gt;</p>\n\n<p><b>:help &lt;&lt;</b></p>\n\n<h2 id=\"How-do-I-format-indent-an-entire-file\">14.6. How do I format/indent an entire file?</h2>\n\n<p>You can format/indent an entire file using the gg=G command, where</p>\n\n<pre><code>gg - Goto the beginning of the file\n=  - apply indentation\nG  - till end of file</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help gg</b></p>\n\n<p><b>:help =</b></p>\n\n<p><b>:help G</b></p>\n\n<p><b>:help &#39;formatprg&#39;</b></p>\n\n<p><b>:help C-indenting</b></p>\n\n<h2 id=\"How-do-I-increase-or-decrease-the-indentation-of-the-current-line\">14.7. How do I increase or decrease the indentation of the current line?</h2>\n\n<p>You can use the &quot;&gt;&gt;&quot; and &quot;&lt;&lt;&quot; commands to increase or decrease the indentation of the current line.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help shift-left-right</b></p>\n\n<p><b>:help </b>&gt;&gt;</p>\n\n<p><b>:help &lt;&lt;</b></p>\n\n<p><b>:help &#39;shiftwidth&#39;</b></p>\n\n<h2 id=\"How-do-I-indent-a-block-group-of-lines\">14.8. How do I indent a block/group of lines?</h2>\n\n<p>You can visually select the group of lines and press the &gt; or &lt; key to indent/unindent the lines. You can also use the following ex-command to indent the lines</p>\n\n<pre><code>:10,20&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help shift-left-right</b></p>\n\n<p><b>:help v_</b>&gt;</p>\n\n<p><b>:help v_&lt;</b></p>\n\n<p><b>:help :&lt;</b></p>\n\n<p><b>:help :</b>&gt;</p>\n\n<h2 id=\"When-I-indent-lines-using-the-or-key-the-standard-8-tabstops-are-used-instead-of-the-current-tabstop-setting.-Why\">14.9. When I indent lines using the &gt; or &lt; key, the standard 8-tabstops are used instead of the current &#39;tabstop&#39; setting. Why?</h2>\n\n<p>The number of spaces used when lines are indented using the &quot;&gt;&quot; operator is controlled by the &#39;shiftwidth&#39; option. The &#39;tabstop&#39; setting is only used, when the &#39;shiftwidth&#39; option is zero.</p>\n\n<pre><code>:set shiftwidth=4</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;shiftwidth&#39;</b></p>\n\n<p><b>:help </b>&gt;&gt;</p>\n\n<p><b>:help &#39;softtabstop&#39;</b></p>\n\n<h2 id=\"How-do-I-turn-off-the-automatic-indentation-of-text\">14.10. How do I turn off the automatic indentation of text?</h2>\n\n<p>By default, the automatic indentation of text is not turned on. Check the configuration files (.vimrc, .gvimrc) for settings related to indentation. Make sure the `:filetype indent on` command is not present. If it is present, remove it. Also, depending on your preference, you may also want to check the value of the &#39;autoindent&#39;, &#39;smartindent&#39;, &#39;cindent&#39; and &#39;indentexpr&#39; options and turn them off as needed.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :filetype-indent-off</b></p>\n\n<p><b>:help &#39;autoindent&#39;</b></p>\n\n<p><b>:help &#39;smartindent&#39;</b></p>\n\n<p><b>:help &#39;cindent&#39;</b></p>\n\n<p><b>:help &#39;indentexpr&#39;</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-automatically-set-the-textwidth-option-to-a-particular-value-when-I-edit-mails\">14.11. How do I configure Vim to automatically set the &#39;textwidth&#39; option to a particular value when I edit mails?</h2>\n\n<p>You can use the &quot;FileType&quot; autocommand to set the &#39;textwidth&#39; option:</p>\n\n<pre><code>autocmd FileType mail set tw=&lt;your_value&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :autocmd</b></p>\n\n<p><b>:help FileType</b></p>\n\n<p><b>:help usr_43.txt</b></p>\n\n<h2 id=\"Is-there-a-way-to-make-Vim-auto-magically-break-lines\">14.12. Is there a way to make Vim auto-magically break lines?</h2>\n\n<p>Yes. Set the &#39;textwidth&#39; option to the preferred length for a line. Then Vim will auto-magically break the newly entered lines. For example:</p>\n\n<pre><code>:set textwidth=75</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;textwidth&#39;</b></p>\n\n<p><b>:help ins-textwidth</b></p>\n\n<p><b>:help &#39;formatoptions&#39;</b></p>\n\n<p><b>:help fo-table</b></p>\n\n<p><b>:help formatting</b></p>\n\n<h2 id=\"I-am-seeing-a-lot-of-M-symbols-in-my-file.-I-tried-setting-the-fileformat-option-to-dos-and-then-unix-and-then-mac.-None-of-these-helped.-How-can-I-hide-these-symbols\">14.13. I am seeing a lot of ^M symbols in my file. I tried setting the &#39;fileformat&#39; option to &quot;dos&quot; and then &quot;unix&quot; and then &quot;mac&quot;. None of these helped. How can I hide these symbols?</h2>\n\n<p>When a file is loaded in Vim, the format of the file is determined as below:</p>\n\n<p>- If all the lines end with a new line (&lt;NL&gt;), then the fileformat is &quot;unix&quot;. - If all the lines end with a carriage return (&lt;CR&gt;) followed by a new line (&lt;NL&gt;), then the fileformat is &quot;dos&quot;. - If all the lines end with carriage return (&lt;CR&gt;), then the fileformat is &quot;mac&quot;.</p>\n\n<p>If the file has some lines ending with &lt;CR&gt; and some lines ending with &lt;CR&gt; followed by a &lt;NL&gt;, then the fileformat is set to &quot;unix&quot;.</p>\n\n<p>You can change the format of the current file, by saving it explicitly in dos format:</p>\n\n<pre><code>:w ++ff=dos</code></pre>\n\n<p>To display the format of the current file, use</p>\n\n<pre><code>:set fileformat?</code></pre>\n\n<p>The above behavior is also controlled by the &#39;fileformats&#39; option. You can try the following commands:</p>\n\n<pre><code>:set fileformats+=unix\n:e &lt;your_file&gt;\n:set fileformat=unix\n:w</code></pre>\n\n<p>To remove the carriage return (&lt;CR&gt;) character at the end of all the lines in the current file, you can use the following command:</p>\n\n<pre><code>:%s/\\r$//</code></pre>\n\n<p>To force Vim to use a particular file format, when editing a file, you can use the following command:</p>\n\n<pre><code>:e ++ff=dos filename</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;fileformats&#39;</b></p>\n\n<p><b>:help &#39;fileformat&#39;</b></p>\n\n<p><b>:help file-formats</b></p>\n\n<p><b>:help DOS-format-write</b></p>\n\n<p><b>:help Unix-format-write</b></p>\n\n<p><b>:help Mac-format-write</b></p>\n\n<p><b>:help dos-file-formats</b></p>\n\n<p><b>:help 23.1</b></p>\n\n<p><b>:help ++ff</b></p>\n\n<h2 id=\"When-I-paste-some-text-into-a-Vim-buffer-from-another-application-the-alignment-indentation-of-the-new-text-is-messed-up.-How-do-I-fix-this\">14.14. When I paste some text into a Vim buffer from another application, the alignment (indentation) of the new text is messed up. How do I fix this?</h2>\n\n<p>When you paste text into a GUI Vim using the mouse, Vim is able to detect that you are pasting text. So all the indentation related settings (like autoindent, smartindent, cindent, etc.) are ignored and the text is pasted literally.</p>\n\n<p>When pasting text into a Vim running in a terminal (like xterm) using the mouse, Vim may not be able to detect that you are pasting text. This depends on several things: the capability of the terminal to pass the mouse events to Vim, Vim is compiled to handle mouse events and access the clipboard, the DISPLAY variable is set properly, the Vim &#39;mouse&#39; option is set correctly.</p>\n\n<p>If Vim is able to detect that you are pasting text using the mouse, then the pasted text will be inserted literally.</p>\n\n<p>If Vim is not able to detect that you are pasting using the mouse, then it will see the pasted text as though you literally typed the text. After the first line from the pasted text is inserted, when Vim encounters the newline character, because of the indentation settings, the next line will start indented. The spaces at the beginning of the second line in the pasted text will be inserted leading to additional indentation. This will be repeated for subsequent lines. So the pasted text will be inserted with stair case indentation.</p>\n\n<p>You can fix this problem in a terminal Vim in several ways:</p>\n\n<p>1. Build Vim with the +mouse and +xterm_clipboard compile-time options. The normal or big or huge build of Vim includes these options. Set the &#39;mouse&#39; option to either &quot;a&quot; or include &quot;i&quot;. When pasting text using the mouse, don&#39;t press the Shift key. This will work only if Vim can access the X display. For more information, read the following Vim help topics:</p>\n\n<p><b>:help +feature-list</b></p>\n\n<p><b>:help &#39;mouse&#39;</b></p>\n\n<p><b>:help &lt;MiddleMouse</b>&gt;</p>\n\n<p><b>:help x11-selection</b></p>\n\n<p><b>:help xterm-clipboard</b></p>\n\n<p>1.1 Some Linux distributions build their terminal vim packages without X support. This makes no sense and leaves many users with the impression that Vim in terminal mode doesn&#39;t support some operations such as properly pasting text with a mouse.</p>\n\n<pre><code>If your distribution includes gvim, which it almost certainly\ndoes these days, the solutions to this include the following.\n\na)  Start Vim as\n\n        gvim -v\n\nb)  Put this alias in your shell&#39;s configuration file, e.g.\n    ~/.bashrc:\n\n        alias vim=&#39;gvim -v&#39;\n\nc)  Put the following command in a file named &quot;vim&quot; and put that\n    file in your ~/bin directory:\n\n        gvim -v &quot;$@&quot;\n\nd)  Link the distribution&#39;s gvim to ~/bin/vim with the following\n    command, which needs to be executed only once.\n\n        ln -s $(which gvim) ~/bin/vim\n\nFor c) and d), make sure that ~/bin precedes /usr/bin in your\nPATH.</code></pre>\n\n<p>2. Paste the text using the CTRL-R CTRL-O * command. This will paste the text literally without any automatic indentation. If you want to paste the text and then fix the indentation, then you can use CTRL-R CTRL-P *. These commands will work only if Vim can access the X display. For more information, read the following Vim help topics:</p>\n\n<p><b>:help i_CTRL-R_CTRL-O</b></p>\n\n<p><b>:help i_CTRL-R_CTRL-P</b></p>\n\n<p><b>:help quotestar</b></p>\n\n<p>3. Set the &#39;paste&#39; option before pasting the text. This option will disable the effect of all the indentation related settings. Make sure to turn off this option using `:set nopaste` after pasting the text. Otherwise the Vim indentation feature will not work. Do not permanently set the &#39;paste&#39; option in your .vimrc file. If you are going to repeat these steps often, then you can set the &#39;pastetoggle&#39; option to a key. When you press the specified key, the &#39;paste&#39; option will be toggled. You can press the key once before pasting the text and the press the key once after pasting the text. Note that when the &#39;paste&#39; option is set, all the mappings and abbreviations are disabled. For more information, read the following Vim help topics:</p>\n\n<p><b>:help &#39;paste&#39;</b></p>\n\n<p><b>:help &#39;pastetoggle&#39;</b></p>\n\n<p>You can also refer to the following topics in the user manual:</p>\n\n<p><b>:help 04.7</b></p>\n\n<p><b>:help 09.3</b></p>\n\n<h2 id=\"When-there-is-a-very-long-wrapped-line-wrap-is-on-and-a-line-doesnt-fit-entirely-on-the-screen-it-is-not-displayed-at-all.-There-are-blank-lines-beginning-with-symbol-instead-of-wrapped-line.-If-I-scroll-the-screen-to-fit-the-line-the-symbols-disappear-and-the-line-is-displayed-again.-What-Vim-setting-control-this-behavior\">14.15. When there is a very long wrapped line (wrap is &quot;on&quot;) and a line doesn&#39;t fit entirely on the screen it is not displayed at all. There are blank lines beginning with &quot;@&quot; symbol instead of wrapped line. If I scroll the screen to fit the line the &quot;@&quot; symbols disappear and the line is displayed again. What Vim setting control this behavior?</h2>\n\n<p>You can set the &#39;display&#39; option to &quot;lastline&quot; to display as much as possible of the last line in a window instead of displaying the &quot;@&quot; symbols.</p>\n\n<pre><code>:set display=lastline</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;display&#39;</b></p>\n\n<h2 id=\"How-do-I-convert-all-the-tab-characters-in-a-file-to-space-characters\">14.16. How do I convert all the tab characters in a file to space characters?</h2>\n\n<p>You can use the `:retab` command to update all the tab characters in the current file with the current setting of &#39;expandtab&#39; and &#39;tabstop&#39;. For example, to convert all the tabs to white spaces, use</p>\n\n<pre><code>:set expandtab\n:retab</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :retab</b></p>\n\n<p><b>:help &#39;expandtab&#39;</b></p>\n\n<p><b>:help &#39;tabstop&#39;</b></p>\n\n<p><b>:help 25.3</b></p>\n\n<h2 id=\"What-Vim-options-can-I-use-to-edit-text-that-will-later-go-to-a-word-processor\">14.17. What Vim options can I use to edit text that will later go to a word processor?</h2>\n\n<p>You can set the following options to edit text that will later go into a word processor:</p>\n\n<pre><code>:set wrap\n:set linebreak\n:set textwidth=0\n:set showbreak=&gt;&gt;&gt;</code></pre>\n\n<p>You can use the &quot;gk&quot; and &quot;gj&quot; commands to move one screen line up and down. For more information, read:</p>\n\n<p><b>:help &#39;wrap&#39;</b></p>\n\n<p><b>:help &#39;linebreak&#39;</b></p>\n\n<p><b>:help &#39;textwidth&#39;</b></p>\n\n<p><b>:help &#39;showbreak&#39;</b></p>\n\n<p><b>:help gk</b></p>\n\n<p><b>:help gj</b></p>\n\n<h2 id=\"How-do-I-join-lines-without-adding-or-removing-any-space-characters\">14.18. How do I join lines without adding or removing any space characters?</h2>\n\n<p>By default, when you join lines using the &quot;J&quot; or `:join` command, Vim will replace the line break, leading white space and trailing white space with a single space character. If there are space characters at the end of a line or a line starts with the &quot;)&quot; character, then Vim will not add a space character.</p>\n\n<p>To join lines without adding or removing any space characters, you can use the gJ or `:join!` commands.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help gJ</b></p>\n\n<p><b>:help :join</b></p>\n\n<p><b>:help J</b></p>\n\n<p><b>:help 10.5</b></p>\n\n<p><b>:help &#39;joinspaces&#39;</b></p>\n\n<p><b>:help &#39;cpoptions&#39;</b></p>\n\n<p><b>:help &#39;formatoptions&#39;</b></p>\n\n<h1 id=\"VISUAL-MODE1\">VISUAL MODE</h1>\n\n<h2 id=\"How-do-I-do-rectangular-block-copying\">15.1. How do I do rectangular block copying?</h2>\n\n<p>You can do rectangular block copying in Vim using the blockwise visual mode. To start blockwise visual mode use the CTRL-V key. Move the cursor using any of the motion commands and then use the y operator to yank to visually selected text.</p>\n\n<p>If CTRL-V does not work as expected, it may have been remapped to CTRL-Q by the mswin.vim script which is often sourced by a vimrc on Windows machines to mimic some common short cuts from other programs.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 04.4</b></p>\n\n<p><b>:help blockwise-visual</b></p>\n\n<p><b>:help visual-mode</b></p>\n\n<p><b>:help Q_vi</b></p>\n\n<h2 id=\"How-do-I-delete-or-change-a-column-of-text-in-a-file\">15.2. How do I delete or change a column of text in a file?</h2>\n\n<p>You can use the Vim block-wise visual mode to select the column of text and apply an operator (delete, change, copy, etc) on it.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help visual-block</b></p>\n\n<p><b>:help visual-operators</b></p>\n\n<h2 id=\"How-do-I-apply-an-ex-command-on-a-set-of-visually-selected-lines\">15.3. How do I apply an ex-command on a set of visually selected lines?</h2>\n\n<p>When you select a range of lines in visual mode, the &lt; register is set to the start of the visual region and the &gt; register is set to the end of the visual region. You can use these registers to specify the range for an ex command. After visually selecting the lines, press &quot;:&quot; to go to the command mode. Vim will automatically insert the visual range &#39;&lt;,&#39;&gt;. You can run any ex-command on the visual range.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help v_:</b></p>\n\n<p><b>:help &#39;&lt;</b></p>\n\n<p><b>:help &#39;</b>&gt;</p>\n\n<h2 id=\"How-do-I-execute-an-ex-command-on-a-column-of-text-selected-in-Visual-block-mode\">15.4. How do I execute an ex command on a column of text selected in Visual block mode?</h2>\n\n<p>All the ex commands operate on whole lines only. If you try to execute an ex command on a column of text selected in visual block mode, Vim will operate on all the selected lines (instead of the selected columns). You can use the vis.vim or NrrwRgn plugin script from https://www.vim.org scripts archive to do this.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help cmdline-ranges</b></p>\n\n<p><b>:help 10.3</b></p>\n\n<p><b>:help cmdline-lines</b></p>\n\n<h2 id=\"How-do-I-select-the-entire-file-in-visual-mode\">15.5. How do I select the entire file in visual mode?</h2>\n\n<p>You can select the entire file in visual mode using ggVG.</p>\n\n<pre><code>gg - go to the beginning of the file.\nV  - Start linewise visual mode\nG  - goto the end of the file.</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help gg</b></p>\n\n<p><b>:help linewise-visual</b></p>\n\n<p><b>:help G</b></p>\n\n<h2 id=\"When-I-visually-select-a-set-of-lines-and-press-the-key-to-indent-the-selected-lines-the-visual-mode-ends.-How-can-I-reselect-the-region-for-further-operation-or-How-do-I-re-select-the-last-selected-visual-area-again\">15.6. When I visually select a set of lines and press the &gt; key to indent the selected lines, the visual mode ends. How can I reselect the region for further operation? (or) How do I re-select the last selected visual area again?</h2>\n\n<p>You can use the &quot;gv&quot; command to reselect the last selected visual area. You can also use the marks &#39;&lt; and &#39;&gt; to jump to the beginning or the end of the last selected visual area.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help gv</b></p>\n\n<p><b>:help &#39;&lt;</b></p>\n\n<p><b>:help &#39;</b>&gt;</p>\n\n<h2 id=\"How-do-I-jump-to-the-beginning-end-of-a-visually-selected-region\">15.7. How do I jump to the beginning/end of a visually selected region?</h2>\n\n<p>You can use the &quot;o&quot; command to jump to the beginning/end of a visually selected region.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help v_o</b></p>\n\n<h2 id=\"When-I-select-text-with-mouse-and-then-press-:-to-enter-an-ex-command-the-selected-text-is-replaced-with-the-:-character.-How-do-I-execute-an-ex-command-on-a-text-selected-using-the-mouse-similar-to-the-text-selected-using-the-visual-mode\">15.8. When I select text with mouse and then press : to enter an ex command, the selected text is replaced with the : character. How do I execute an ex command on a text selected using the mouse similar to the text selected using the visual mode?</h2>\n\n<p>This will happen if you have configured Vim to use select mode instead of Visual mode by setting the &#39;selectmode&#39; option. Check the value of this option:</p>\n\n<pre><code>:set selectmode?</code></pre>\n\n<p>This mode is known as selectmode and is similar to the visual mode. This option is also automatically set when you use the &quot;behave mswin&quot; command. Select mode looks like visual mode, but it is similar to the selection mode in MS-Windows.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help Select-mode</b></p>\n\n<p><b>:help &#39;selectmode&#39;</b></p>\n\n<p><b>:help 09.4</b></p>\n\n<p><b>:help :behave</b></p>\n\n<h2 id=\"When-I-select-a-block-of-text-using-the-mouse-Vim-goes-into-selection-mode-instead-of-Visual-mode.-Why\">15.9. When I select a block of text using the mouse, Vim goes into selection mode instead of Visual mode. Why?</h2>\n\n<p>The &#39;selectmode&#39; option controls whether Select mode will be started when selecting a block of text using the mouse. To start Visual mode when selecting text using mouse, remove the &quot;mouse&quot; value from the &#39;selectmode&#39; option:</p>\n\n<pre><code>:set selectmode-=mouse</code></pre>\n\n<p>Note that by default, the &#39;selectmode&#39; option will be set to empty, so that always visual mode is used.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;selectmode&#39;</b></p>\n\n<p><b>:help Select-mode</b></p>\n\n<p><b>:help :behave</b></p>\n\n<h2 id=\"How-do-I-visually-select-the-last-copy-pasted-text\">15.10. How do I visually select the last copy/pasted text?</h2>\n\n<p>You can use the &#39;[ and &#39;] marks to visually select the last copy/pasted text. The &#39;[ mark is set to the beginning of the last changed/yanked text and the &#39;] mark is set to the end of the last changed/yanked text. To visually select this block of text use the command &#39;[v&#39;]</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;[</b></p>\n\n<p><b>:help &#39;]</b></p>\n\n<p><b>:help `a</b></p>\n\n<p><b>:help v</b></p>\n\n<h1 id=\"COMMAND-LINE-MODE1\">COMMAND-LINE MODE</h1>\n\n<h2 id=\"How-do-I-use-the-name-of-the-current-file-in-the-command-mode-or-an-ex-command-line\">16.1. How do I use the name of the current file in the command mode or an ex command line?</h2>\n\n<p>In the command line, the &quot;%&quot; character represents the name of the current file. In some commands, you have to use `expand(&quot;%&quot;)` to get the filename:</p>\n\n<pre><code>:!perl %</code></pre>\n\n<p>Another example is to load the latex generated pdf file from the file you are currently editing:</p>\n\n<pre><code>:!xpdf %&lt;.pdf</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :_%</b></p>\n\n<p><b>:help cmdline-special</b></p>\n\n<p><b>:help expand()</b></p>\n\n<h2 id=\"How-do-I-edit-the-text-in-the-Vim-command-line-effectively\">16.2. How do I edit the text in the Vim command-line effectively?</h2>\n\n<p>You can use the command-line window for editing Vim command-line text. To open the Vim command-line window use the &quot;q:&quot; command in normal mode. In command-line mode, use the CTRL-F key. In this window, the command line history will be displayed. You can use normal Vim keys/commands to edit any previous/new command line. To execute a command line, press the enter/return key.</p>\n\n<p>In a similar vain, the search history can be edited with &quot;q/&quot; and &quot;q?&quot; commands.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help cmdline-window</b></p>\n\n<h2 id=\"How-do-I-switch-from-Vi-mode-to-Ex-mode\">16.3. How do I switch from Vi mode to Ex mode?</h2>\n\n<p>You can use the Q command to switch from Vi mode to Ex mode. To switch from Ex mode back to the Vi mode, use the `:vi` command.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help Q</b></p>\n\n<p><b>:help gQ</b></p>\n\n<p><b>:help Ex-mode</b></p>\n\n<p><b>:help :vi</b></p>\n\n<h2 id=\"How-do-I-copy-the-output-from-an-ex-command-into-a-buffer\">16.4. How do I copy the output from an ex-command into a buffer?</h2>\n\n<p>To copy the output from an ex-command into a buffer, you have to first get the command output into a register. You can use the `:redir` command to get the output into a register. For example,</p>\n\n<pre><code>:redir @a\n:g/HelloWord/p\n:redir END</code></pre>\n\n<p>Now the register &quot;a&quot; will contain the output from the ex command `:g/HelloWord/p`. Now you can paste the contents of the register &quot;a&quot; into a buffer. You can also send or append the output of an ex-command into a file using the `:redir` command.</p>\n\n<p>You can prefix the `:global` command with `:silent`, to avoid having the lines printed to the screen.</p>\n\n<p>To redirect the output from an ex-command to a file, you can use the following set of commands:</p>\n\n<pre><code>:redir &gt; myfile\n:g/HelloWord/p\n:redir END</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :redir</b></p>\n\n<p><b>:help :silent</b></p>\n\n<h2 id=\"When-I-press-the-Tab-key-to-complete-the-name-of-a-file-in-the-command-mode-if-there-are-more-than-one-matching-file-names-then-Vim-completes-the-first-matching-file-name-and-displays-a-list-of-all-matching-filenames.-How-do-I-configure-Vim-to-only-display-the-list-of-all-the-matching-filenames-and-not-complete-the-first-one\">16.5. When I press the &lt;Tab&gt; key to complete the name of a file in the command mode, if there are more than one matching file names, then Vim completes the first matching file name and displays a list of all matching filenames. How do I configure Vim to only display the list of all the matching filenames and not complete the first one?</h2>\n\n<p>You can modify the &#39;wildmode&#39; option to configure the way Vim completes filenames in the command mode. In this case, you can set the &#39;wildmode&#39; option to &quot;list&quot;:</p>\n\n<pre><code>:set wildmode=list</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;wildmode&#39;</b></p>\n\n<h2 id=\"How-do-I-copy-text-from-a-buffer-to-the-command-line-and-from-the-command-line-to-a-buffer\">16.6. How do I copy text from a buffer to the command line and from the command line to a buffer?</h2>\n\n<p>To copy text from a buffer to the command line, after yanking the text from the buffer, use &quot;&lt;CTRL-R&gt;0&quot; in the command line to paste the text. You can also yank the text to a specific register and use CTRL-R &lt;register&gt; to paste the text to the command line. You can use CTRL-R CTRL-W to paste the word under the cursor in the command line.</p>\n\n<p>To copy text from the command line into a buffer, you can paste the contents of the : register using the &quot;:p command. The most recently executed command line is stored in the : register.</p>\n\n<p>Another approach for copying and pasting text to and from the command line is to open the command line window using q: from normal mode or CTRL-F from the command-line mode. In the command line window you can use all the Vim commands to edit the command line.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help c_CTRL-R</b></p>\n\n<p><b>:help quote_:</b></p>\n\n<p><b>:help cmdline-window</b></p>\n\n<h2 id=\"How-do-I-put-a-command-onto-the-command-history-without-executing-it\">16.7. How do I put a command onto the command history without executing it?</h2>\n\n<p>To put a command onto the command history without executing it, press the &lt;Esc&gt; key to cancel the command.</p>\n\n<p>An alternative solution, is to use the histadd() function like this:</p>\n\n<pre><code>:call histadd(&#39;:&#39;, &#39;echo strftime(&quot;%c&quot;)&#39;)</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help c_&lt;Esc</b>&gt;</p>\n\n<p><b>:help histadd()</b></p>\n\n<h2 id=\"How-do-I-increase-the-height-of-the-command-line\">16.8. How do I increase the height of the command-line?</h2>\n\n<p>You can increase the height of the command-line by changing the &#39;cmdheight&#39; option:</p>\n\n<pre><code>:set cmdheight=2</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;cmdheight&#39;</b></p>\n\n<p><b>:help hit-enter</b></p>\n\n<p><b>:help 05.7</b></p>\n\n<h1 id=\"VIMINFO1\">VIMINFO</h1>\n\n<h2 id=\"When-I-invoke-Vim-I-get-error-messages-about-illegal-characters-in-the-viminfo-file.-What-should-I-do-to-get-rid-of-these-messages\">17.1. When I invoke Vim, I get error messages about illegal characters in the viminfo file. What should I do to get rid of these messages?</h2>\n\n<p>You can remove the $HOME/.viminfo or the $HOME/_viminfo file to get rid of these error messages.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help viminfo-errors</b></p>\n\n<p><b>:help viminfo-file-name</b></p>\n\n<p><b>:help viminfo</b></p>\n\n<p><b>:help 21.3</b></p>\n\n<h2 id=\"How-do-I-disable-the-viminfo-feature\">17.2. How do I disable the viminfo feature?</h2>\n\n<p>By default, the viminfo feature is disabled. If the viminfo feature is enabled by a system-wide vimrc file, then you can disable the viminfo feature by setting the &#39;viminfo&#39; option to an empty string in your local .vimrc file:</p>\n\n<pre><code>:set viminfo=&quot;&quot;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;viminfo&#39;</b></p>\n\n<h2 id=\"How-do-I-save-and-use-Vim-marks-commands-across-Vim-sessions\">17.3. How do I save and use Vim marks/commands across Vim sessions?</h2>\n\n<p>You can save and restore Vim marks across Vim sessions using the viminfo file. To use the viminfo file, make sure the &#39;viminfo&#39; option is not empty. To save and restore Vim marks, the &#39;viminfo&#39; option should not contain the &quot;f&quot; flag or should have a value greater than zero for the &quot;f&quot; option.</p>\n\n<p>You can also use the viminfo file to synchronize the commandline history across different sessions using `:wvimfo` and `:rviminfo` commands together with the FocusGained and FocusLost autocommands:</p>\n\n<pre><code>augroup viminfo\n    au!\n    au FocusLost   * wviminfo\n    au FocusGained * rviminfo\naugroup end</code></pre>\n\n<p>Note, this will only work reliably, when Vim can detect the FocusLost and FocusGained autocommands correctly. This means it should work with GVim but might depend on your terminal for konsole vim.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 21.3</b></p>\n\n<p><b>:help viminfo</b></p>\n\n<p><b>:help &#39;viminfo&#39;</b></p>\n\n<p><b>:help :wviminfo</b></p>\n\n<p><b>:help :rviminfo</b></p>\n\n<p><b>:help FocusLost</b></p>\n\n<p><b>:help FocusGained</b></p>\n\n<h1 id=\"REMOTE-EDITING1\">REMOTE EDITING</h1>\n\n<h2 id=\"How-do-I-open-a-file-with-existing-instance-of-gvim-What-happened-to-the-Vim-5.x-OpenWithVim.exe-and-SendToVim.exe-files\">18.1. How do I open a file with existing instance of gvim? What happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?</h2>\n\n<p>Starting with Vim6, the OLE version of OpenWithVim.exe and SendToVim.exe Vim utilities are replaced by the new client-server feature. To open the file j.txt with an existing instance of Gvim (MyVim), use:</p>\n\n<pre><code>$ gvim --servername MyVim --remote-silent j.txt</code></pre>\n\n<p>To list the server names of all the currently running Vim instances, use</p>\n\n<pre><code>$ vim --serverlist</code></pre>\n\n<p>To get more information about client-server feature, read</p>\n\n<p><b>:help client-server</b></p>\n\n<h2 id=\"How-do-I-send-a-command-to-a-Vim-server-to-write-all-buffers-to-disk\">18.2. How do I send a command to a Vim server to write all buffers to disk?</h2>\n\n<p>You can use the Vim remote server functionality to do this:</p>\n\n<pre><code>$ gvim --servername myVIM --remote-send &quot;&lt;C-\\&gt;&lt;C-N&gt;:wall&lt;CR&gt;&quot;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help client-server</b></p>\n\n<p><b>:help CTRL-\\_CTRL-N</b></p>\n\n<p><b>:help :wall</b></p>\n\n<h2 id=\"Where-can-I-get-the-documentation-about-the-Vim-remote-server-functionality\">18.3. Where can I get the documentation about the Vim remote server functionality?</h2>\n\n<p>You can get more information about the Vim remote server functionality by reading</p>\n\n<p><b>:help client-server</b></p>\n\n<h1 id=\"OPTIONS1\">OPTIONS</h1>\n\n<h2 id=\"How-do-I-configure-Vim-in-a-simple-way\">19.1. How do I configure Vim in a simple way?</h2>\n\n<p>You can use the `:options` command to open the Vim option window:</p>\n\n<pre><code>:options</code></pre>\n\n<p>This window can be used for viewing and setting all the options.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :options</b></p>\n\n<h2 id=\"How-do-I-toggle-the-value-of-an-option\">19.2. How do I toggle the value of an option?</h2>\n\n<p>You can prefix the option with &quot;inv&quot; to toggle the value of the option:</p>\n\n<pre><code>:set invignorecase\n:set invhlsearch</code></pre>\n\n<p>You can also suffix the option with &quot;!&quot; to toggle the value:</p>\n\n<pre><code>:set ignorecase!\n:set hlsearch!</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help set-option</b></p>\n\n<h2 id=\"How-do-I-set-an-option-that-affects-only-the-current-buffer-window\">19.3. How do I set an option that affects only the current buffer/window?</h2>\n\n<p>Some of the Vim options can have a local or global value. A local value applies only to a specific buffer or window. A global value applies to all the buffers or windows.</p>\n\n<p>When a Vim option is modified using the `:set` command, both the global and local values for the option are changed. You can use the `:setlocal` command to modify only the local value for the option and the `:setglobal` command to modify only the global value.</p>\n\n<p>You can use the `:setlocal` command to set an option that will affect only the current file/buffer:</p>\n\n<pre><code>:setlocal textwidth=70</code></pre>\n\n<p>Note that not all options can have a local value. You can use `:setlocal` command to set an option locally to a buffer/window only if the option is allowed to have a local value.</p>\n\n<p>You can also use the following command to set an option locally:</p>\n\n<pre><code>:let &amp;l:{option-name} = &lt;value&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :setlocal</b></p>\n\n<p><b>:help local-options</b></p>\n\n<h2 id=\"How-do-I-use-space-characters-for-a-Vim-option-value\">19.4. How do I use space characters for a Vim option value?</h2>\n\n<p>To use space characters in a Vim option value, you have to escape the space character. For example:</p>\n\n<pre><code>:set tags=tags\\ /usr/tags</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help option-backslash</b></p>\n\n<h2 id=\"Can-I-add-embed-Vim-option-settings-to-the-contents-of-a-file\">19.5. Can I add (embed) Vim option settings to the contents of a file?</h2>\n\n<p>You can use modelines to add Vim option settings to the contents of a file. For example, in a C file, you can add the following line to the top or the bottom of the file:</p>\n\n<pre><code>/* vim:sw=4: */</code></pre>\n\n<p>This will set the &#39;shiftwidth&#39; option to 4, when editing that C file. For this to work, the &#39;modeline&#39; option should be set. By default, the &#39;modeline&#39; option is set. An alternative example is given in this document in the first line.</p>\n\n<p>The &#39;modelines&#39; settings specifies the number of lines that will be checked for the Vim set commands.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 21.6</b></p>\n\n<p><b>:help modeline</b></p>\n\n<p><b>:help auto-setting</b></p>\n\n<p><b>:help &#39;modeline&#39;</b></p>\n\n<p><b>:help &#39;modelines&#39;</b></p>\n\n<h2 id=\"How-do-I-display-the-line-numbers-of-all-the-lines-in-a-file\">19.6. How do I display the line numbers of all the lines in a file?</h2>\n\n<p>You can set the &#39;number&#39; option to display the line numbers for all the lines.</p>\n\n<pre><code>:set number</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;number&#39;</b></p>\n\n<h2 id=\"How-do-I-change-the-width-of-the-line-numbers-displayed-using-the-number-option\">19.7. How do I change the width of the line numbers displayed using the &#39;number&#39; option?</h2>\n\n<p>You can set the minimum number of columns to be used for line numbering by setting the &#39;numberwidth&#39; option:</p>\n\n<pre><code>:set numberwidth=3</code></pre>\n\n<p>This set&#39;s the width for the line number to 3 digits, which is enough, if your buffer contains less than 999 lines. However, if your current buffer contains more lines than 999, the &#39;numberwidth&#39; will be adjusted accordingly, so that the maximum line number will fit on the screen.</p>\n\n<h2 id=\"How-do-I-display-view-all-the-invisible-characters-like-space-tabs-and-newlines-in-a-file\">19.8. How do I display (view) all the invisible characters like space, tabs and newlines in a file?</h2>\n\n<p>You can set the &#39;list&#39; option to see all the invisible characters in your file.</p>\n\n<pre><code>:set list</code></pre>\n\n<p>With this option set, you can view space characters, tabs, newlines, trailing space characters and wrapped lines.</p>\n\n<p>To not display the invisible characters (which is the default), you have to reset the &#39;list&#39; option:</p>\n\n<pre><code>:set nolist\n(or)\n:set list!</code></pre>\n\n<p>The `:set list!` command will toggle the current setting of the boolean &#39;list&#39; option.</p>\n\n<p>You can modify the &#39;listchars&#39; option to configure how and which invisible characters are displayed. For example, with the following command all the trailing space characters will be displayed with a &quot;.&quot; character.</p>\n\n<pre><code>:set listchars=trail:.</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;listchars&#39;</b></p>\n\n<p><b>:help &#39;list&#39;</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-always-display-the-current-line-and-column-number\">19.9. How do I configure Vim to always display the current line and column number?</h2>\n\n<p>You can set the &#39;ruler&#39; option to display current column and line number in the status line:</p>\n\n<pre><code>:set ruler</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;ruler&#39;</b></p>\n\n<h2 id=\"How-do-I-display-the-current-Vim-mode\">19.10. How do I display the current Vim mode?</h2>\n\n<p>You can set the &#39;showmode&#39; option to display the current Vim mode. In Insert, Replace and Visual modes, Vim will display the current mode on the last line.</p>\n\n<pre><code>:set showmode</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;showmode&#39;</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-show-pending-partial-commands-on-the-status-line\">19.11. How do I configure Vim to show pending/partial commands on the status line?</h2>\n\n<p>You can set the &#39;showcmd&#39; option to display pending/partial commands in the status line:</p>\n\n<pre><code>:set showcmd</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;showcmd&#39;</b></p>\n\n<h2 id=\"How-do-I-configure-the-Vim-status-line-to-display-different-settings-values\">19.12. How do I configure the Vim status line to display different settings/values?</h2>\n\n<p>You can set the &#39;statusline&#39; option to display different values/settings in the Vim status line.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;statusline&#39;</b></p>\n\n<p><b>:help &#39;laststatus&#39;</b></p>\n\n<p><b>:help &#39;rulerformat&#39;</b></p>\n\n<p><b>:help &#39;ruler&#39;</b></p>\n\n<h2 id=\"How-do-I-configure-Vim-to-display-status-line-always\">19.13. How do I configure Vim to display status line always?</h2>\n\n<p>You can set the &#39;laststatus&#39; option to 2 to display the status line always.</p>\n\n<pre><code>:set laststatus=2</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;laststatus&#39;</b></p>\n\n<h2 id=\"How-do-I-make-a-Vim-setting-persistent-across-different-Vim-invocations-instances-sessions\">19.14. How do I make a Vim setting persistent across different Vim invocations/instances/sessions?</h2>\n\n<p>To make a Vim option setting persistent across different Vim instances, add your setting to the .vimrc or .gvimrc file. You can also use the `:mkvimrc` command to generate a vimrc file for the current settings.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help save-settings</b></p>\n\n<p><b>:help vimrc</b></p>\n\n<p><b>:help gvimrc</b></p>\n\n<p><b>:help vimrc-intro</b></p>\n\n<p><b>:help :mkvimrc</b></p>\n\n<p><b>:help initialization</b></p>\n\n<h2 id=\"Why-do-I-hear-a-beep-why-does-my-window-flash-about-1-second-after-I-hit-the-Escape-key\">19.15. Why do I hear a beep (why does my window flash) about 1 second after I hit the Escape key?</h2>\n\n<p>This is normal behavior. If your window flashes, then you&#39;ve got the visual bell on. Otherwise, you should hear a beep.</p>\n\n<p>Vim needs a timeout to tell the difference between a simple escape and, say, a cursor key sequence. When you press a key in normal mode (and even in insert mode) and that key is the beginning of a mapping, Vim waits a certain amount of time to see if the rest of the mapping sequence follows. If the mapping sequence is completed before a given timeout period, the mapping for that sequence of keys is applied. If you interrupt the mapping, the normal actions associated with the keys are executed.</p>\n\n<p>For example, if you have a mapping defined as `:imap vvv Vim is great!!` and you type &quot;vvv&quot; quickly, the &quot;Vim is great!!&quot; will be inserted into your text. But if you type &quot;vv v&quot; then that is what will put into your text. This is also true if you type &quot;vvv&quot; too slowly where &quot;too slowly&quot; is longer than the value for the timeout option. Setting the timeout option to a larger value can help alleviate problems that appear when using function keys over a slow line.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;ttimeout&#39;</b></p>\n\n<h2 id=\"How-do-I-make-the-c-and-s-commands-display-a-instead-of-deleting-the-characters-Im-changing\">19.16. How do I make the &quot;c&quot; and &quot;s&quot; commands display a &quot;$&quot; instead of deleting the characters I&#39;m changing?</h2>\n\n<p>To make the &quot;c&quot; and &quot;s&quot; commands display a &quot;$&quot; instead of deleting the characters, add the $ flag to the &#39;cpoptions&#39; option:</p>\n\n<pre><code>:set cpoptions+=$</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;cpoptions&#39;</b></p>\n\n<h2 id=\"How-do-I-remove-more-than-one-flag-using-a-single-:set-command-from-a-Vim-option\">19.17. How do I remove more than one flag using a single `:set` command from a Vim option?</h2>\n\n<p>You can remove more than one flag from a Vim option using a single `:set` command, by specifying the flags in exactly the same order as they appear in the option. For example, if you use the following command to remove the &quot;t&quot; and &quot;n&quot; flags from the &#39;formatoptions&#39; option:</p>\n\n<pre><code>:set formatoptions-=tn</code></pre>\n\n<p>The &quot;t&quot; and &quot;n&quot; flags will be removed from the &#39;formatoptions&#39; option, only if the &#39;formatoptions&#39; option contains these flags in this order: &quot;tn&quot;. Otherwise, it will not remove the flags. To avoid this problem, you can remove the flags one by one:</p>\n\n<pre><code>:set formatoptions-=t formatoptions-=n</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :set-=</b></p>\n\n<h1 id=\"MAPPING-KEYS1\">MAPPING KEYS</h1>\n\n<h2 id=\"How-do-I-know-what-a-key-is-mapped-to\">20.1. How do I know what a key is mapped to?</h2>\n\n<p>To see what a key is mapped to, use the following commands:</p>\n\n<pre><code>:map &lt;key&gt;\n:map! &lt;key&gt;</code></pre>\n\n<p>You can also check the mappings in a particular mode using one of the `:cmap`, `:nmap`, `:vmap`, `:imap`, `:omap`, etc commands.</p>\n\n<p>To find out, where the key has been mapped, prefix the `:verbose` command:</p>\n\n<pre><code>:verbose :map &lt;key&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help map-listing</b></p>\n\n<p><b>:help map-overview</b></p>\n\n<h2 id=\"How-do-I-list-all-the-user-defined-key-mappings\">20.2. How do I list all the user-defined key mappings?</h2>\n\n<p>You can list all the user-defined key mappings using:</p>\n\n<pre><code>:map</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help map-listing</b></p>\n\n<h2 id=\"How-do-I-unmap-a-previously-mapped-key\">20.3. How do I unmap a previously mapped key?</h2>\n\n<p>You can unmap a previously mapped key using the `:unmap` command:</p>\n\n<pre><code>:unmap &lt;key&gt;\n:unmap! &lt;key&gt;</code></pre>\n\n<p>For mode specific mappings, you can use one of the these commands:</p>\n\n<pre><code>:nunmap\n:vunmap\n:ounmap\n:iunmap\n:lunmap\n:cunmap</code></pre>\n\n<p>The following command will fail to unmap a buffer-local mapped key:</p>\n\n<pre><code>:unmap &lt;key&gt;</code></pre>\n\n<p>To unmap a buffer-local mapped key, you have to use the &lt;buffer&gt; keyword in the unmap command:</p>\n\n<pre><code>:unmap &lt;buffer&gt; &lt;key&gt;\n:unmap! &lt;buffer&gt; &lt;key&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :unmap</b></p>\n\n<p><b>:help map-modes</b></p>\n\n<p><b>:help :map-local</b></p>\n\n<p><b>:help mapleader</b></p>\n\n<h2 id=\"I-am-not-able-to-create-a-mapping-for-the-xxx-key.-What-is-wrong\">20.4. I am not able to create a mapping for the &lt;xxx&gt; key. What is wrong?</h2>\n\n<p>1) First make sure, the key is passed correctly to Vim. To determine if this is the case, put Vim in Insert mode and then hit CTRL-V (or CTRL-Q if your CTRL-V is remapped to the paste operation (e.g. on Windows if you are using the mswin.vim script file) followed by your key.</p>\n\n<pre><code>If nothing appears in the buffer (and assuming that you have\n&#39;showcmd&#39; on, ^V remains displayed near the bottom right of the Vim\nscreen), then Vim doesn&#39;t get your key correctly and there is nothing\nto be done, other than selecting a different key for your mapping or\nusing GVim, which should recognise the key correctly.</code></pre>\n\n<p>2) Possibly, Vim gets your key, but sees it as no different than something else. Say you want to map &lt;Ctrl-Right&gt;, then in Insert mode hit CTRL-K followed by &lt;Ctrl-Right&gt;. If Vim displays &lt;C-Right&gt; it has correctly seen the keystroke and you should be able to map it (by using &lt;C-Right&gt; as your {lhs}). If it displays &lt;Right&gt; it has seen the keystroke but as if you hadn&#39;t held &lt;Ctrl&gt; down: this means your temrinal passes &lt;Ctrl-Right&gt; as if it were just &lt;Right&gt;. Anything else means the key has been misidentified.</p>\n\n<p>3) If the key is seen, but not as itself and not as some recognizable key, then there is probably an error in the terminal library for the current terminal (termcap or terminfo database). In that case</p>\n\n<pre><code>  :set term?\n\nwill tell you which termcap or terminfo Vim is using. You can try to\ntell vim, what termcode to use in that terminal, by adding the\nfollowing to your vimrc:\n\n  if &amp;term == &lt;termname&gt;\n      set &lt;C-Right&gt;=&lt;keycode&gt;\n  endif\n\nwhere &lt;termname&gt; above should be replaced by the value of &#39;term&#39;\n(with quotes around it) and &lt;keycode&gt; by what you get when hitting\nCTRL-V followed by &lt;Ctrl-Right&gt; in Insert mode (with nothing around\nit). &lt;C-Right&gt; should be left as-is (9 characters). Don&#39;t forget that\nin a `:set` command, white space is not allowed between the equal sign\nand the value, and any space, double quote, vertical bar or backslash\npresent as part of the value must be backslash-escaped.\n\nNow you should be able to see the keycode corresponding to the key\nand you can create a mapping for the key using the following command:\n\n  :map &lt;C-Right&gt;  &lt;your_command_to_be_mapped&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help map-keys-fails</b></p>\n\n<p><b>:help :map-special-keys</b></p>\n\n<p><b>:help key-codes</b></p>\n\n<h2 id=\"Why-does-mapping-the-C-...-key-not-work\">20.5. Why does mapping the &lt;C-...&gt; key not work?</h2>\n\n<p>The only &lt;Ctrl&gt;-&lt;printable-key&gt; chords which Vim can reliably detect (because they are defined in the ASCII standard) are the following:</p>\n\n<pre><code>CTRL-@                 0x00            NUL\nCTRL-A to CTRL-Z       0x01 to 0x1A\nCTRL-a to CTRL-z       0x01 to 0x1A\nCTRL-[                 0x1B            ESC\nCTRL-\\                 0x1C\nCTRL-]                 0x1D\nCTRL-^                 0x1E\nCTRL-_                 0x1F\nCTRL-?                 0x7F            DEL</code></pre>\n\n<p>Most of these, however, already have a function in Vim (and some are aliases of other keys: CTRL-H and &lt;BS&gt;, CTRL-I and &lt;Tab&gt;, CTRL-M and &lt;Enter&gt;, CTRL-[ and &lt;Esc&gt;, CTRL-? and &lt;Del&gt;).</p>\n\n<p>The &quot;safest&quot; keys to use in Vim for the {lhs} of a mapping are the F keys, with or without Shift: &lt;F2&gt; to &lt;F12&gt; and &lt;S-F1&gt; to &lt;S-F12&gt;. (Some OSes, including mine, intercept &lt;Ctrl-Fn&gt; and &lt;Alt-Fn&gt;, which never reach an application program such as vim or gvim).</p>\n\n<p>You can try other combinations of &lt;Ctrl&gt; + any key, but they may either not work everywhere (e.g. the terminal might not pass that key to Vim, or they might have unintended side effects (e.g. mapping &lt;C-I&gt; means also to map &lt;Tab&gt;).</p>\n\n<p>This is a known issue, that has been discussed and might be implemented in the future to enable Vim to distinguish between various keys even in console mode. (e.g. https://groups.google.com/d/msg/vim_dev/2bp9UdfZ63M/sajb9KM0pNYJ)</p>\n\n<h2 id=\"How-do-I-map-the-numeric-keypad-keys\">20.6. How do I map the numeric keypad keys?</h2>\n\n<p>First make sure that the numeric keypad keys are passed to Vim. Next, you can use the following command to map the numeric keypad keys:</p>\n\n<pre><code>:map &lt;kSomething&gt;  &lt;your_command&gt;</code></pre>\n\n<p>where, &lt;kSomething&gt; can be kHome, kEnd, kPageUp, kPageDown, kPlus, kMinus, kDivide, kMultiply, kEnter, etc.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help key-codes</b></p>\n\n<p><b>:help terminal-options</b></p>\n\n<h2 id=\"How-do-I-create-a-mapping-that-works-only-in-visual-mode\">20.7. How do I create a mapping that works only in visual mode?</h2>\n\n<p>You can create mappings that work only in specific modes (normal, command, insert, visual, etc). To create a mapping that works only in the visual mode, use the `:vmap` command:</p>\n\n<pre><code>:vmap &lt;F3&gt; &lt;your mapping here&gt;</code></pre>\n\n<p>This mapping will work in visual and select mode. If you want the map to work only in visual mode (excluding select mode), use:</p>\n\n<pre><code>:xmap &lt;F3&gt; &lt;your mapping here&gt;</code></pre>\n\n<p>and to have the mapping only work in select mode (but not visual mode), use:</p>\n\n<pre><code>:smap &lt;F3&gt; &lt;your mapping here&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :vmap</b></p>\n\n<p><b>:help :xmap</b></p>\n\n<p><b>:help :smap</b></p>\n\n<p><b>:help map-modes</b></p>\n\n<p><b>:help 40.1</b></p>\n\n<h2 id=\"How-do-I-create-a-mapping-that-works-only-in-normal-and-operator-pending-mode-but-not-in-visual-mode\">20.8. How do I create a mapping that works only in normal and operator pending mode (but not in visual mode)?</h2>\n\n<p>Using `:map` creates a mapping that works in normal, visual+select mode and operator pending mode. You can use `:nmap` to have the mapping only work in normal mode and `:vmap` to have the mapping only be defined for visual and select mode or use `:omap` to have the mapping only defined in operator pending mode.</p>\n\n<p>But if you want to have a mapping defined, that works in both operator pending mode and normal mode, but not in visual and select mode, you need to first define the mapping using `:map` and afterwards delete the mapping for visual and select mode:</p>\n\n<pre><code>:map &lt;f3&gt; &lt;your mapping here&gt;\n:vunmap &lt;f3&gt;</code></pre>\n\n<h2 id=\"In-a-Vim-script-how-do-I-know-which-keys-to-use-for-my-mappings-so-that-the-mapped-key-will-not-collide-with-an-already-used-key\">20.9. In a Vim script, how do I know which keys to use for my mappings, so that the mapped key will not collide with an already used key?</h2>\n\n<p>Vim uses most of the keys in the keyboard. You can use the &lt;leader&gt; prefix in maps to define keys which will not overlap with Vim keys. For example:</p>\n\n<pre><code>:map &lt;leader&gt;S &lt;C-W&gt;s\n:map &lt;leader&gt;j &lt;C-W&gt;j\n:map &lt;leader&gt;k &lt;C-W&gt;k</code></pre>\n\n<p>where by default &lt;leader&gt; gets substituted with a backslash (\\), so the user would enter</p>\n\n<pre><code>\\s\n\\j\n\\k</code></pre>\n\n<p>to invoke the above map commands. The user can change the mapleader variable to be whatever they wanted:</p>\n\n<pre><code>:let mapleader = &quot;,&quot;</code></pre>\n\n<p>When writing a plugin or other script, more often than not, it is advisable to use `:noremap` instead of `:map` to avoid side effects from user defined mappings.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &lt;Leader</b>&gt;</p>\n\n<p><b>:help &lt;LocalLeader</b>&gt;</p>\n\n<p><b>:help write-plugin</b></p>\n\n<h2 id=\"How-do-I-map-the-escape-key\">20.10. How do I map the escape key?</h2>\n\n<p>You can map the Escape key to some other key using the `:map` command. For example, the following command maps the escape key to CTRL-O.</p>\n\n<pre><code>:map &lt;C-O&gt; &lt;Esc&gt;</code></pre>\n\n<h2 id=\"How-do-I-map-a-key-to-perform-nothing\">20.11. How do I map a key to perform nothing?</h2>\n\n<p>You can map a key to &lt;Nop&gt; to perform nothing when the key is pressed. For example, with the following mappings, the &lt;F7&gt; key will do nothing when pressed.</p>\n\n<pre><code>:map &lt;F7&gt; &lt;Nop&gt;\n:map! &lt;F7&gt; &lt;Nop&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &lt;Nop</b>&gt;</p>\n\n<p><b>:help :map</b></p>\n\n<p><b>:help :map!</b></p>\n\n<p><b>:help map-modes</b></p>\n\n<h2 id=\"I-want-to-use-the-Tab-key-to-indent-a-block-of-text-and-Shift-Tab-key-to-unindent-a-block-of-text.-How-do-I-map-the-keys-to-do-this-This-behavior-is-similar-to-textpad-visual-studio-etc\">20.12. I want to use the &lt;Tab&gt; key to indent a block of text and &lt;Shift-Tab&gt; key to unindent a block of text. How do I map the keys to do this? This behavior is similar to textpad, visual studio, etc.</h2>\n\n<p>Use the following mapping:</p>\n\n<pre><code>:inoremap &lt;S-Tab&gt; &lt;C-O&gt;&lt;lt&gt;&lt;lt&gt;\n:nnoremap &lt;Tab&gt; &gt;&gt;\n:nnoremap &lt;S-Tab&gt; &lt;lt&gt;&lt;lt&gt;\n:vnoremap &lt;Tab&gt; &gt;\n:vnoremap &lt;S-Tab&gt; &lt;lt&gt;</code></pre>\n\n<p>Note, that the &lt;S-Tab&gt; mapping will work only if Vim receives the correct key sequence. This is mostly the case with GUI Vim.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :inoremap</b></p>\n\n<p><b>:help :nnoremap</b></p>\n\n<p><b>:help :vnoremap</b></p>\n\n<p><b>:help &lt;S-Tab</b>&gt;</p>\n\n<p><b>:help i_CTRL-O</b></p>\n\n<p><b>:help </b>&gt;&gt;</p>\n\n<p><b>:help &lt;&lt;</b></p>\n\n<p><b>:help &lt;lt</b>&gt;</p>\n\n<h2 id=\"In-my-mappings-the-special-characters-like-CR-are-not-recognized.-How-can-I-configure-Vim-to-recognize-special-characters\">20.13. In my mappings the special characters like &lt;CR&gt; are not recognized. How can I configure Vim to recognize special characters?</h2>\n\n<p>Check the value of the &#39;cpoptions&#39; option:</p>\n\n<pre><code>:set cpoptions?</code></pre>\n\n<p>If this option contains the &quot;&lt;&quot; flag, then special characters will not be recognized in mappings. Remove the &quot;&lt;&quot; flag from &#39;cpoptions&#39; option:</p>\n\n<pre><code>:set cpo-=&lt;</code></pre>\n\n<p>Also, check the value of the &#39;compatible&#39; option:</p>\n\n<pre><code>:set compatible?</code></pre>\n\n<p>The &#39;compatible&#39; option must be reset:</p>\n\n<pre><code>:set nocompatible</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;cpoptions&#39;</b></p>\n\n<p><b>:help &#39;compatible&#39;</b></p>\n\n<h2 id=\"How-do-I-use-the-to-separate-multiple-commands-in-a-map\">20.14. How do I use the &quot;|&quot; to separate multiple commands in a map?</h2>\n\n<p>You can escape the &quot;|&quot; character using backslash (\\) to use &quot;|&quot; in a map.</p>\n\n<pre><code>:map _l :!ls \\| more&lt;CR&gt;</code></pre>\n\n<p>You can also try the following command:</p>\n\n<pre><code>:map _l :!ls &lt;bar&gt; more&lt;CR&gt;</code></pre>\n\n<p>There are also other ways to do this.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help map_bar</b></p>\n\n<h2 id=\"If-I-have-a-mapping-abbreviation-whose-ending-is-the-beginning-of-another-mapping-abbreviation-how-do-I-keep-the-first-from-expanding-into-the-second-one\">20.15. If I have a mapping/abbreviation whose ending is the beginning of another mapping/abbreviation, how do I keep the first from expanding into the second one?</h2>\n\n<p>Instead of using the `:map lhs rhs` command, use the `:noremap lhs rhs` command. For abbreviations, use &quot;noreabbrev lhs rhs&quot;. The &quot;nore&quot; prefix prevents the mapping or abbreviation from being expanded again.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :noremap</b></p>\n\n<p><b>:help :noreabbrev</b></p>\n\n<h2 id=\"Why-does-it-take-a-second-or-more-for-Vim-to-process-a-key-sometimes-when-I-press-a-key\">20.16. Why does it take a second or more for Vim to process a key, sometimes when I press a key?</h2>\n\n<p>Make sure you have not defined a mapping for this key using the following command:</p>\n\n<pre><code>:map &lt;key&gt;</code></pre>\n\n<p>If a mapping is defined for this key and the mapped key contains more than one character, then Vim will wait for the next character to be pressed to determine whether it is the mapped key or not. For example, if you have mapped &quot;ab&quot;, then if you press &quot;a&quot;, Vim will wait for the next key to be pressed. If the next key is &quot;b&quot;, Vim will execute the mapped sequence. Otherwise, Vim will proceed with the normal processing of &quot;a&quot; followed by the next key. If the &#39;timeout&#39; option is set (which is the default), then Vim will timeout after waiting for the period specified with the &#39;timeoutlen&#39; option (default is 1 second).</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help map-typing</b></p>\n\n<p><b>:help &#39;timeoutlen&#39;</b></p>\n\n<p><b>:help &#39;ttimeoutlen&#39;</b></p>\n\n<p><b>:help &#39;timeout&#39;</b></p>\n\n<p><b>:help &#39;ttimeout&#39;</b></p>\n\n<p><b>:help vt100-cursor-keys</b></p>\n\n<p><b>:help slow-fast-terminal</b></p>\n\n<h2 id=\"How-do-I-map-a-key-to-run-an-external-command-using-a-visually-selected-text\">20.17. How do I map a key to run an external command using a visually selected text?</h2>\n\n<p>You can the `:vmap` command to map a key in the visual mode. In the mapped command sequence, you have to first yank the text. The yanked text is available in the &#39;&quot;&#39; register. Now, you can use the contents of this register to run the external command. For example, to run the external command &quot;perldoc&quot; on a visually selected text, you can use the following mapping:</p>\n\n<pre><code>:vmap &lt;F7&gt; y:!exec &quot;!perldoc &#39;&quot; . @&quot; . &quot;&#39;&quot;&lt;CR&gt;</code></pre>\n\n<p>If you want the mapping to work in the visual mode, but not with the highlighted text, you can use the following command:</p>\n\n<pre><code>:vmap &lt;F7&gt; :&lt;C-U&gt;!perldoc &lt;cword&gt;&lt;CR&gt;</code></pre>\n\n<p>The above mapping will use the word under the cursor instead of the highlighted text. Note the use of the &lt;C-U&gt; before invoking the &quot;perldoc&quot; external command. The &lt;C-U&gt; is used to erase the range of text selected in the visual mode and displayed on the command line. If the visual range is not removed using &lt;C-U&gt;, then the output from the external command will replace the visually selected text.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :vmap</b></p>\n\n<p><b>:help quote_quote</b></p>\n\n<p><b>:help :let-register</b></p>\n\n<p><b>:help c_CTRL-U</b></p>\n\n<p><b>:help :!cmd</b></p>\n\n<h2 id=\"How-do-I-map-the-CTRL-I-key-while-still-retaining-the-functionality-of-the-Tab-key\">20.18. How do I map the CTRL-I key while still retaining the functionality of the &lt;Tab&gt; key?</h2>\n\n<p>The CTRL-I key and the &lt;Tab&gt; key produce the same keycode, so Vim cannot distinguish between the CTRL-I and the &lt;Tab&gt; key. When you map the CTRL-I key, the &lt;Tab&gt; key is also mapped (and vice versa). The same restriction applies for the CTRL-[ key and the &lt;Esc&gt; key.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help keycodes</b></p>\n\n<h2 id=\"How-do-I-define-a-map-to-accept-a-count\">20.19. How do I define a map to accept a count?</h2>\n\n<p>Use the @= command to use an expression. For example,</p>\n\n<pre><code>nnoremap = @=&#39;3l&#39;</code></pre>\n\n<p>Now you can specify a count to the &quot;=&quot; command.</p>\n\n<p><b>:help complex-repeat</b></p>\n\n<h2 id=\"How-can-I-make-my-normal-mode-mapping-work-from-within-Insert-Mode\">20.20. How can I make my normal mode mapping work from within Insert Mode?</h2>\n\n<p>Mappings in normal mode can be executed after CTRL-O from insert mode as well but if there are more commands included in the mapping {rhs}, only the first one will be executed in normal mode and the rest of {rhs} will be printed literally in insert mode. One of ways to workaround this problem is to make {rhs} be one command, via wrapping it to the function. For example:</p>\n\n<pre><code>function GetFontNameOfFirstChar()\nnormal! 0\necho getfontname()\nendfunction\n\n:nmap &lt;F9&gt; :call GetFontNameOfFirstChar()&lt;CR&gt;</code></pre>\n\n<p>A more technical and detailed solution to this problem follows and can be found at https://groups.google.com/group/vim_dev/msg/75f1f2dfc00908bb</p>\n\n<p>Not every normal mode-mapping is automatically suitable for execution via CTRL-O from within insert mode; you need to explicitly design your mappings for that purpose.</p>\n\n<p>The CTRL-O command allows execution of one normal mode command from within insert mode, then returns to insert mode. If a normal mode mapping concatenates multiple normal mode commands, this breaks down in temporary normal mode and literally inserts the second part of the command into the buffer instead. To support execution of normal mode mappings from within insert mode, these strategies can be used:</p>\n\n<p>1) Instead of concatenating multiple normal mode commands, use one `:normal` mapping:</p>\n\n<pre><code>:nnoremap &lt;silent&gt; zC :&lt;C-U&gt;normal! zCVzC&lt;CR&gt;</code></pre>\n\n<p>2) Concatenate multiple Ex commands via &lt;Bar&gt; on the rhs:</p>\n\n<pre><code>:nnoremap zC :&lt;C-U&gt;call MyMap1()&lt;Bar&gt;call MyMap2()&lt;CR&gt;</code></pre>\n\n<p>3) Shadow normal mode mappings by insert mode mappings that re-enter normal mode, then invoke the normal mode mapping:</p>\n\n<pre><code>:nnoremap &lt;silent&gt; &lt;SID&gt;MyMap2 :&lt;C-U&gt;call MyMap2()&lt;CR&gt;\n:inoremap &lt;silent&gt; &lt;script&gt; &lt;SID&gt;MyMap2 &lt;C-\\&gt;&lt;C-O&gt;&lt;SID&gt;MyMap2\n:nnoremap &lt;silent&gt; &lt;script&gt; zC &lt;SID&gt;MyMap1&lt;SID&gt;MyMap2</code></pre>\n\n<p>4) Normal mode mappings that consist of multiple Ex command lines (and where Ex commands cannot be concatenated via &lt;Bar&gt;) replace `:&lt;C-U&gt;` with &lt;SID&gt;NM; the &lt;SID&gt;NM mapping enters normal mode for one ex command line:</p>\n\n<pre><code>:nnoremap &lt;silent&gt; &lt;SID&gt;NM :&lt;C-U&gt;\n:inoremap &lt;silent&gt; &lt;SID&gt;NM &lt;C-\\&gt;&lt;C-O&gt;:\n:nnoremap &lt;silent&gt; &lt;script&gt; zC &lt;SID&gt;MyMap1&lt;SID&gt;NMcall MyMap2()&lt;CR&gt;</code></pre>\n\n<p>5) If none of the above is possible, at least force normal mode for subsequent commands via CTRL-\\ CTRL-N to avoid accidental insertion of the remainder of the mapping.</p>\n\n<pre><code>:nnoremap zC zC&lt;C-\\&gt;&lt;C-N&gt;VzCzz</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-O</b></p>\n\n<p><b>:help map_bar</b></p>\n\n<p><b>:help i_CTRL-\\_CTRL-O</b></p>\n\n<p><b>:help CTRL-\\_CTRL-N</b></p>\n\n<h1 id=\"ABBREVIATIONS1\">ABBREVIATIONS</h1>\n\n<h2 id=\"How-do-I-auto-correct-misspelled-words\">21.1. How do I auto correct misspelled words?</h2>\n\n<p>You can auto correct misspelled words using abbreviations. For example, the following abbreviation can be used to correct &quot;teh&quot; with &quot;the&quot;:</p>\n\n<pre><code>:abbreviate teh the</code></pre>\n\n<p>Vim supports abbreviations in insert mode, replace mode and command-line mode.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 24.7</b></p>\n\n<p><b>:help abbreviations</b></p>\n\n<p><b>:help Q_ab</b></p>\n\n<h2 id=\"How-do-I-create-multi-line-abbreviations\">21.2. How do I create multi-line abbreviations?</h2>\n\n<p>You can create multi-line abbreviations by embedding the &quot;&lt;CR&gt;&quot; key code in the text:</p>\n\n<pre><code>iabbrev #c --------------&lt;CR&gt;-- Date:&lt;CR&gt;--&lt;CR&gt;---------</code></pre>\n\n<p>With the above abbreviation, when you type #c, it will be expanded to the following text:</p>\n\n<p>-------------- -- Date: -- ---------</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help abbreviations</b></p>\n\n<h2 id=\"When-my-abbreviations-are-expanded-an-additional-space-character-is-added-at-the-end-of-the-expanded-text.-How-do-I-avoid-this-character\">21.3. When my abbreviations are expanded, an additional space character is added at the end of the expanded text. How do I avoid this character?</h2>\n\n<p>To avoid an additional space character at the end of the expanded text, you can expand the abbreviation by pressing the CTRL-] key. The abbreviation will be expanded without adding a space character at the end.</p>\n\n<p>Another alternative is to use the following function and command:</p>\n\n<pre><code>function! Eatchar(pat)\n    let c = nr2char(getchar())\n    return (c =~ a:pat) ? &#39;&#39; : c\nendfunction\ncommand! -nargs=+ Iabbr execute &quot;iabbr&quot; &lt;q-args&gt; . &quot;&lt;C-R&gt;=Eatchar(&#39;\\\\s&#39;)&lt;CR&gt;&quot;</code></pre>\n\n<p>Now, define your abbreviations using the new &quot;Iabbr&quot; command instead of the builtin `:iabbrev` command. With this command, after expanding the abbreviated text, the next typed space character will be discarded.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help abbreviations</b></p>\n\n<h2 id=\"How-do-I-insert-the-current-date-time-stamp-into-the-file\">21.4. How do I insert the current date/time stamp into the file?</h2>\n\n<p>You can use the strftime() function to insert the current data/time stamp in a file. For example, you can use the following abbreviation:</p>\n\n<pre><code>iabbrev dts &lt;C-R&gt;=strftime(&quot;%y/%m/%d %H:%M&quot;)&lt;CR&gt;</code></pre>\n\n<p>With this abbreviation, when you type dts in insert mode, it will be expanded to the date/time stamp.</p>\n\n<p>Some other forms of the above abbreviation are listed below:</p>\n\n<pre><code>iabbrev mdyl &lt;C-R&gt;=strftime(&quot;%a %d %b %Y&quot;)&lt;CR&gt;\niabbrev mdys &lt;C-R&gt;=strftime(&quot;%y%m%d&quot;)&lt;CR&gt;\niabbrev mdyc &lt;C-R&gt;=strftime(&quot;%c&quot;)&lt;CR&gt;\niabbrev hml  &lt;C-R&gt;=strftime(&quot;%d/%m/%y %H:%M:%S&quot;)&lt;CR&gt;\niabbrev hms  &lt;C-R&gt;=strftime(&quot;%H:%M:%S&quot;)&lt;CR&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help strftime()</b></p>\n\n<p><b>:help i_CTRL-R</b></p>\n\n<h2 id=\"How-do-I-prevent-an-abbreviation-from-expanding-in-insert-mode\">21.5. How do I prevent an abbreviation from expanding in insert mode?</h2>\n\n<p>You can prevent an abbreviation from expanding in insert mode by typing CTRL-V before the character after the abbreviated word.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help abbreviations</b></p>\n\n<h1 id=\"RECORD-AND-PLAYBACK1\">RECORD AND PLAYBACK</h1>\n\n<h2 id=\"How-do-I-repeat-an-editing-operation-insertion-deletion-paste-etc\">22.1. How do I repeat an editing operation (insertion, deletion, paste, etc)?</h2>\n\n<p>You can repeat the last editing operation using the &quot;.&quot; command. This will repeat the last simple change like a insert, delete, change, paste, etc.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 04.3</b></p>\n\n<p><b>:help single-repeat</b></p>\n\n<p><b>:help Q_re</b></p>\n\n<h2 id=\"How-I-record-and-repeat-a-set-of-key-sequences\">22.2. How I record and repeat a set of key sequences?</h2>\n\n<p>You can use the &quot;q&quot; command in normal mode to record a set of key sequences and store it in a register. For example, in the normal mode you can press q followed by a register name {0-9a-bA-Z&quot;} to start the recording. To end/stop the recording press q again. You can playback/repeat the recorded key sequences by pressing @ followed by the register name. e.g. @a.</p>\n\n<p>Another approach is to start Vim with the &quot;-w&quot; command-line argument.</p>\n\n<pre><code>$ vim -w &lt;file_name&gt;</code></pre>\n\n<p>Vim will record all the characters typed in the session in the specified file &quot;file_name&quot;. You can use the recorded file with the &quot;-s&quot; command line argument to play it back:</p>\n\n<pre><code>$ vim -s &lt;file_name&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 10.1</b></p>\n\n<p><b>:help recording</b></p>\n\n<p><b>:help -w</b></p>\n\n<p><b>:help -s</b></p>\n\n<h2 id=\"How-do-I-edit-modify-a-recorded-set-of-key-sequences\">22.3. How do I edit/modify a recorded set of key sequences?</h2>\n\n<p>The recorded key sequences are stored in a register. You can paste the contents of the register into a Vim buffer, edit the pasted text and again yank the text into the register. You can also use the `:let` command to modify the register. For example:</p>\n\n<pre><code>:let @a = &quot;iHello World\\&lt;Esc&gt;&quot;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help recording</b></p>\n\n<p><b>:help 10.1</b></p>\n\n<p><b>:help :let-register</b></p>\n\n<p><b>:help &lt;</b>&gt;</p>\n\n<p><b>:help &#39;cpoptions&#39;</b></p>\n\n<h2 id=\"How-do-I-write-recorded-key-sequences-to-a-file\">22.4. How do I write recorded key sequences to a file?</h2>\n\n<p>The recorded key sequences are stored in a register. You can paste the contents of the register into a Vim buffer. Now you can save the buffer into a file. You can also modify the pasted text and again yank into the register to modify the recorded key sequence. For example, if you record a set of key sequences using qa ..... q. The recorded key sequences are stored in the register &quot;a&quot;. You can paste the contents of register &quot;a&quot; using &quot;ap.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help recording</b></p>\n\n<p><b>:help 10.1</b></p>\n\n<h2 id=\"I-am-using-register-0-to-record-my-key-sequences-i.e.-q0-....-q-.-In-the-recorded-key-sequences-I-am-yanking-some-text.-After-the-first-replay-of-the-recorded-key-sequence-I-am-no-longer-able-to-play-it-back\">22.5. I am using register 0 to record my key sequences (i.e. q0 .... q). In the recorded key sequences, I am yanking some text. After the first replay of the recorded key sequence, I am no longer able to play it back.</h2>\n\n<p>Register 0 contains the text from the last yank operation. In your recorded key sequence, when the yank is performed, register 0 is overwritten with the yanked text. So your recording stored in register 0 is lost. You have to use some other register.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help registers</b></p>\n\n<h1 id=\"AUTOCOMMANDS1\">AUTOCOMMANDS</h1>\n\n<h2 id=\"How-do-I-execute-a-command-when-I-try-to-modify-a-read-only-file\">23.1. How do I execute a command when I try to modify a read-only file?</h2>\n\n<p>You can use the FileChangedRO autocommand event to execute a command when a read-only file is modified. For example, you can use this event to checkout a read-only file:</p>\n\n<pre><code>:autocmd FileChangedRO * call MyCheckoutFunction()</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help FileChangedRO</b></p>\n\n<h2 id=\"How-do-I-execute-a-command-every-time-when-entering-a-buffer\">23.2. How do I execute a command every time when entering a buffer?</h2>\n\n<p>You can use the BufEnter autocommand event to execute a command every time when entering a buffer. For example:</p>\n\n<pre><code>:autocmd BufEnter *.c set formatoptions=croqt</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help BufEnter</b></p>\n\n<h2 id=\"How-do-I-execute-a-command-every-time-when-entering-a-window\">23.3. How do I execute a command every time when entering a window?</h2>\n\n<p>You can use the WinEnter autocommand event to execute a command every time when entering a window. For example:</p>\n\n<pre><code>:autocmd WinEnter *.c call MyFunction()</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help WinEnter</b></p>\n\n<h2 id=\"From-an-autocmd-how-can-I-determine-the-name-of-the-file-or-the-buffer-number-for-which-the-autocommand-is-executed\">23.4. From an autocmd, how can I determine the name of the file or the buffer number for which the autocommand is executed?</h2>\n\n<p>You can use the special words &lt;afile&gt; or &lt;abuf&gt; in an autocmd to get the name of the file or the buffer number for which the autocommand is executed.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :&lt;afile</b>&gt;</p>\n\n<p><b>:help :&lt;abuf</b>&gt;</p>\n\n<p><b>:help :&lt;amatch</b>&gt;</p>\n\n<h2 id=\"How-do-I-automatically-save-all-the-changed-buffers-whenever-Vim-loses-focus\">23.5. How do I automatically save all the changed buffers whenever Vim loses focus?</h2>\n\n<p>You can define an autocommand for the FocusLost event which will save all the modified buffers whenever Vim loses focus:</p>\n\n<pre><code>:autocmd FocusLost * wall</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help FocusLost</b></p>\n\n<p><b>:help :wall</b></p>\n\n<h2 id=\"How-do-I-execute-run-a-function-when-Vim-exits-to-do-some-cleanup\">23.6. How do I execute/run a function when Vim exits to do some cleanup?</h2>\n\n<p>You can use VimLeave autocmd event to execute a function just before Vim exits. For example,</p>\n\n<pre><code>:autocmd VimLeave * call MyCleanupFunction()</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help VimLeave</b></p>\n\n<h1 id=\"SYNTAX-HIGHLIGHT1\">SYNTAX HIGHLIGHT</h1>\n\n<h2 id=\"How-do-I-turn-off-on-syntax-highlighting\">24.1. How do I turn off/on syntax highlighting?</h2>\n\n<p>By default, the Vim syntax highlighting is turned off. To enable the syntax highlighting, you can use one of the following commands:</p>\n\n<pre><code>:syntax enable\n\nor\n\n:syntax on</code></pre>\n\n<p>To disable the syntax highlighting, you can use the following command:</p>\n\n<pre><code>:syntax off</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 06.1</b></p>\n\n<p><b>:help 06.4</b></p>\n\n<p><b>:help :syntax-enable</b></p>\n\n<p><b>:help :syntax-on</b></p>\n\n<p><b>:help :syn-clear</b></p>\n\n<h2 id=\"How-do-I-change-the-background-and-foreground-colors-used-by-Vim\">24.2. How do I change the background and foreground colors used by Vim?</h2>\n\n<p>Vim uses the &quot;Normal&quot; highlight group for the background and foreground colors. To change the foreground/background colors, you have to modify the &quot;Normal&quot; highlight group. For example, to set the background color to blue and foreground color to white, you can use</p>\n\n<pre><code>:highlight Normal ctermbg=blue ctermfg=white guibg=blue guifg=white</code></pre>\n\n<p>If you are using the Motif or the Athena version of the GUI Vim, then you can modify the foreground and background resource names in the .Xdefaults files to change the colors:</p>\n\n<pre><code>Vim.foreground:     Black\nVim.background:     Wheat</code></pre>\n\n<p>You can also use the &quot;-foreground&quot; and &quot;-background&quot; command-line arguments to specify the foreground and background colors. These arguments are supported only in the Motif or Athena versions:</p>\n\n<pre><code>$ gvim -foreground Black -background Wheat</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :highlight</b></p>\n\n<p><b>:help .Xdefaults</b></p>\n\n<p><b>:help -gui</b></p>\n\n<h2 id=\"How-do-I-change-the-highlight-colors-to-suit-a-dark-light-background\">24.3. How do I change the highlight colors to suit a dark/light background?</h2>\n\n<p>You can set the &#39;background&#39; option to either &quot;dark&quot; or &quot;light&quot; to change the highlight colors to suit a dark/light background:</p>\n\n<pre><code>:set background=dark</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;background&#39;</b></p>\n\n<p><b>:help 06.2</b></p>\n\n<h2 id=\"How-do-I-change-the-color-of-the-line-numbers-displayed-when-the-:set-number-command-is-used\">24.4. How do I change the color of the line numbers displayed when the `:set number` command is used?</h2>\n\n<p>The line numbers displayed use the LineNr highlighting group. To display the current colors used, use</p>\n\n<pre><code>:hi LineNr</code></pre>\n\n<p>To change the color modify the LineNr highlight group. For example:</p>\n\n<pre><code>:hi linenr guifg=red guibg=black</code></pre>\n\n<p>This will give red numbers on a black background in GVIM.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :highlight</b></p>\n\n<h2 id=\"How-do-I-change-the-background-color-used-for-a-Visually-selected-block\">24.5. How do I change the background color used for a Visually selected block?</h2>\n\n<p>You can modify the &quot;Visual&quot; highlight group to change the color used for a visually selected block:</p>\n\n<pre><code>:highlight Visual guibg=red</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :highlight</b></p>\n\n<p><b>:help hl-Visual</b></p>\n\n<h2 id=\"How-do-I-highlight-the-special-characters-tabs-trailing-spaces-end-of-line-etc-displayed-by-the-list-option\">24.6. How do I highlight the special characters (tabs, trailing spaces, end of line, etc) displayed by the &#39;list&#39; option?</h2>\n\n<p>You can modify the &quot;NonText&quot; and &quot;SpecialKey&quot; highlight groups to highlight the special characters displayed by the &#39;list&#39; option:</p>\n\n<pre><code>:highlight NonText guibg=red\n:highlight SpecialKey guibg=green</code></pre>\n\n<p>The &quot;NonText&quot; highlighting group is used for &quot;eol&quot;, &quot;extends&quot; and &quot;precedes&quot; settings in the &#39;listchars&#39; option. The &quot;SpecialKey&quot; highlighting group is used for the &quot;tab&quot; and &quot;trail&quot; settings.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;listchars&#39;</b></p>\n\n<p><b>:help hl-NonText</b></p>\n\n<p><b>:help hl-SpecialKey</b></p>\n\n<h2 id=\"How-do-I-specify-a-colorscheme-in-my-.vimrc-.gvimrc-file-so-that-Vim-uses-the-specified-colorscheme-every-time\">24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that Vim uses the specified colorscheme every time?</h2>\n\n<p>You can specify the color scheme using the `:colorscheme` command in your .vimrc or .gvimrc file:</p>\n\n<pre><code>colorscheme evening</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :colorscheme</b></p>\n\n<h2 id=\"Vim-syntax-highlighting-is-broken.-When-I-am-editing-a-file-some-parts-of-the-file-is-not-syntax-highlighted-or-syntax-highlighted-incorrectly\">24.8. Vim syntax highlighting is broken. When I am editing a file, some parts of the file is not syntax highlighted or syntax highlighted incorrectly.</h2>\n\n<p>Vim doesn&#39;t read the whole file to parse the text for syntax highlighting. It starts parsing wherever you are viewing the file. That saves a lot of time, but sometimes the colors are wrong. A simple fix is refreshing the screen using the CTRL-L key. Or scroll back a bit and then forward again. You can also use the command:</p>\n\n<pre><code>:syntax sync fromstart</code></pre>\n\n<p>Note that this might considerably slow down the screen refreshing.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :syn-sync</b></p>\n\n<p><b>:help :syn-sync-first</b></p>\n\n<h2 id=\"Is-there-a-built-in-function-to-syntax-highlight-the-corresponding-matching-bracket\">24.9. Is there a built-in function to syntax-highlight the corresponding matching bracket?</h2>\n\n<p>Yes. Vim includes the matchparen Plugin as standard plugin that is enabled by default. Whenever the cursor moves over an item defined with the &#39;matchpairs&#39; option, Vim will highlight the corresponding bracket using the MatchParen highlighting group.</p>\n\n<p>However, if the corresponding parenthesis is not visible in the current window, the cursor won&#39;t jump to it.</p>\n\n<p>The matchit plugin provides a similar function, that lets the cursor jump to related items (e.g. &quot;if&quot;, &quot;else&quot;, &quot;endif&quot; items) and skips matches in comments. This uses the % command to jump to corresponding items. Though both plugins provide similar functions they are unrelated and work differently.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help matchparen</b></p>\n\n<p><b>:help &#39;matchpairs&#39;</b></p>\n\n<p><b>:help matchit-install</b></p>\n\n<p><b>:help matchit-intro</b></p>\n\n<h2 id=\"How-do-I-turn-off-the-C-comment-syntax-highlighting\">24.10. How do I turn off the C comment syntax highlighting?</h2>\n\n<p>You can use the following command to turn off C comment syntax highlighting:</p>\n\n<pre><code>:highlight clear comment</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help ft-c-syntax</b></p>\n\n<h2 id=\"How-do-I-add-my-own-syntax-extensions-to-the-standard-syntax-files-supplied-with-Vim\">24.11. How do I add my own syntax extensions to the standard syntax files supplied with Vim?</h2>\n\n<p>You should not modify the syntax files supplied with Vim to add your extensions. When you install the next version of Vim, you will lose your changes. Instead you should create a file under the ~/.vim/after/syntax directory with the same name as the original syntax file and add your additions to this file.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help mysyntaxfile-add</b></p>\n\n<p><b>:help &#39;runtimepath&#39;</b></p>\n\n<h2 id=\"How-do-I-replace-a-standard-syntax-file-that-comes-with-the-Vim-distribution-with-my-own-syntax-file\">24.12. How do I replace a standard syntax file that comes with the Vim distribution with my own syntax file?</h2>\n\n<p>You can replace a standard syntax file that comes with the Vim distribution by creating a file with the same name as the original syntax file and placing it in the vim runtime syntax (~/.vim/syntax) directory. For example, to replace the c.vim syntax file in a Unix system, place the new c.vim in the ~/.vim/syntax directory. In a MS-Windows system, place the new syntax file in the $HOME/vimfiles/syntax or $VIM/vimfiles/syntax directory.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help mysyntaxfile-replace</b></p>\n\n<p><b>:help 44.11</b></p>\n\n<p><b>:help mysyntaxfile</b></p>\n\n<h2 id=\"How-do-I-highlight-all-the-characters-after-a-particular-column\">24.13. How do I highlight all the characters after a particular column?</h2>\n\n<p>You can use the `:match` command to highlight all the characters after a particular column:</p>\n\n<pre><code>:match Todo &#39;\\%&gt;75v.\\+&#39;</code></pre>\n\n<p>This will highlight all the characters after the 75th column.</p>\n\n<p>You can also set the &#39;colorcolumn&#39; option to highlight a particular column:</p>\n\n<pre><code>:set colorcolumn=+2</code></pre>\n\n<p>which highlights 2 columns after the current &#39;textwidth&#39; setting (alternatively, you can use the exact column number).</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :match</b></p>\n\n<p><b>:help /\\%v</b></p>\n\n<p><b>:help /\\+</b></p>\n\n<p><b>:help /.</b></p>\n\n<p><b>:help &#39;colorcolumn&#39;</b></p>\n\n<h2 id=\"How-do-I-convert-a-source-file-.c-.h-etc-with-the-Vim-syntax-highlighting-into-a-HTML-file\">24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax highlighting into a HTML file?</h2>\n\n<p>You can use the 2html.vim script to convert a source file into a HTML file with the Vim syntax highlighting. Use the following command:</p>\n\n<pre><code>:TOhtml</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help convert-to-HTML</b></p>\n\n<p><b>:help :TOhtml</b></p>\n\n<h2 id=\"How-do-I-list-the-definition-of-all-the-current-highlight-groups\">24.15. How do I list the definition of all the current highlight groups?</h2>\n\n<p>You can list the definition of all the current highlight groups using the `:highlight` (without any arguments) ex command.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :highlight</b></p>\n\n<h2 id=\"How-can-I-embed-one-syntax-highlighting-language-into-another-one\">24.16. How can I embed one syntax highlighting language into another one?</h2>\n\n<p>It is possible to include one syntax highlighting into another one, however most of the currently deployed syntax highlighting scripts are not prepared to be included into another syntax script.</p>\n\n<p>You can however create your own custom script to define your own regions, which will be highlighted with a different language.</p>\n\n<p>See the wiki for a comprehensive solution:</p>\n\n<pre><code>http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :syn-include</b></p>\n\n<p><b>:help sh-awk</b></p>\n\n<h1 id=\"VIM-SCRIPT-WRITING1\">VIM SCRIPT WRITING</h1>\n\n<h2 id=\"How-do-I-list-the-names-of-all-the-scripts-sourced-by-Vim\">25.1. How do I list the names of all the scripts sourced by Vim?</h2>\n\n<p>You can use the `:scriptnames` command to list the names of all the scripts sourced by Vim:</p>\n\n<pre><code>:scriptnames</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :scriptnames</b></p>\n\n<h2 id=\"How-do-I-debug-Vim-scripts\">25.2. How do I debug Vim scripts?</h2>\n\n<p>Vim has built-in support for a primitive debugger to debug Vim plugins and scripts. Using this debugger you can set breakpoints and step through the plugin functions.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help debug-scripts</b></p>\n\n<p><b>:help -D</b></p>\n\n<h2 id=\"How-do-I-locate-the-script-plugin-which-sets-a-Vim-option\">25.3. How do I locate the script/plugin which sets a Vim option?</h2>\n\n<p>You can use the `:verbose` command to locate the plugin/script which last modified a Vim option. For example:</p>\n\n<pre><code>:verbose set textwidth?</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :set-verbose</b></p>\n\n<p><b>:help :verbose</b></p>\n\n<h2 id=\"I-am-getting-some-error-informational-messages-from-Vim-possibly-when-running-a-script-the-messages-are-cleared-immediately.-How-do-I-display-the-messages-again\">25.4. I am getting some error/informational messages from Vim (possibly when running a script), the messages are cleared immediately. How do I display the messages again?</h2>\n\n<p>You can use the `:messages` command to display the previous messages.</p>\n\n<pre><code>:messages</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :messages</b></p>\n\n<p><b>:help :echoerr</b></p>\n\n<p><b>:help :echomsg</b></p>\n\n<p><b>:help message-history</b></p>\n\n<h2 id=\"How-do-I-save-and-restore-a-plugin-specific-information-across-Vim-invocations\">25.5. How do I save and restore a plugin specific information across Vim invocations?</h2>\n\n<p>Vim will save and restore global variables that start with an uppercase letter and don&#39;t contain a lower case letter. For this to work, the &#39;viminfo&#39; option must contain the &quot;!&quot; flag. Vim will store the variables in the viminfo file.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;viminfo&#39;</b></p>\n\n<p><b>:help viminfo-file</b></p>\n\n<p><b>:help variables</b></p>\n\n<h2 id=\"How-do-I-start-insert-mode-from-a-Vim-function\">25.6. How do I start insert mode from a Vim function?</h2>\n\n<p>You can use the `:startinsert` command to start the insert mode from inside a Vim function.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :startinsert</b></p>\n\n<h2 id=\"How-do-I-change-the-cursor-position-from-within-a-Vim-function\">25.7. How do I change the cursor position from within a Vim function?</h2>\n\n<p>You can use the cursor() function to position the cursor.</p>\n\n<pre><code>call cursor(lnum, col)</code></pre>\n\n<p>Alternatively, use the setpos() function:</p>\n\n<pre><code>call setpos(&#39;.&#39;, [bufnum, lnum, col, off])</code></pre>\n\n<p>which set&#39;s the cursor in the buffer bufnum to line lnum, column col and offset for &#39;virtualedit&#39;. You can use the getpos() function, to return a list with these values, that can then be fed back to the setpos() function.</p>\n\n<p>If you want to save and restore the viewpoint on a window, use the winsaveview() and winrestview() function calls.</p>\n\n<p>You can also use the following command to change the cursor position:</p>\n\n<pre><code>exe &quot;normal! &quot; . lnum . &quot;G&quot; . col . &quot;|&quot;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help cursor()</b></p>\n\n<p><b>:help bar</b></p>\n\n<p><b>:help getpos()</b></p>\n\n<p><b>:help setpos()</b></p>\n\n<p><b>:help winsaveview()</b></p>\n\n<p><b>:help winrestview()</b></p>\n\n<h2 id=\"How-do-I-check-the-value-of-an-environment-variable-in-the-.vimrc-file\">25.8. How do I check the value of an environment variable in the .vimrc file?</h2>\n\n<p>You can use prefix the environment variable name with the &quot;$&quot; character to use it from a Vim script/function. You can refer to the value of an environment variable using the $env_var syntax:</p>\n\n<pre><code>if $EDITOR == &#39;vi&#39;\nendif</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help expr-env</b></p>\n\n<h2 id=\"How-do-I-check-whether-an-environment-variable-is-set-or-not-from-a-Vim-function\">25.9. How do I check whether an environment variable is set or not from a Vim function?</h2>\n\n<p>You can use the exists() function to check for the existence of an environment variable.</p>\n\n<pre><code>if exists(&quot;$MY_ENV_VAR&quot;)\nendif</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help exists()</b></p>\n\n<p><b>:help expr-env</b></p>\n\n<h2 id=\"How-do-I-call-use-the-Vim-built-in-functions\">25.10. How do I call/use the Vim built-in functions?</h2>\n\n<p>You can use the `:call` command to invoke a Vim built-in function:</p>\n\n<pre><code>:call cursor(10,20)</code></pre>\n\n<p>You can use the `:echo` command to echo the value returned by a function:</p>\n\n<pre><code>:echo char2nr(&#39;a&#39;)</code></pre>\n\n<p>You can use the `:let` command to assign the value returned by a function to a variable:</p>\n\n<pre><code>:let a = getline(&#39;.&#39;)</code></pre>\n\n<p>To store the return value from a function into a Vim register, you can use the following command:</p>\n\n<pre><code>:let @a = system(&#39;ls&#39;)</code></pre>\n\n<p>The above command will store the output of the &quot;ls&quot; command into the register &quot;a&quot;.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :call</b></p>\n\n<p><b>:help :echo</b></p>\n\n<p><b>:help :let</b></p>\n\n<p><b>:help :let-register</b></p>\n\n<p><b>:help user-functions</b></p>\n\n<p><b>:help usr_41.txt</b></p>\n\n<h2 id=\"I-am-using-some-normal-mode-commands-in-my-Vim-script.-How-do-I-avoid-using-the-user-defined-mappings-for-these-normal-mode-commands-and-use-the-standard-Vim-functionality-for-these-normal-mode-commands\">25.11. I am using some normal mode commands in my Vim script. How do I avoid using the user-defined mappings for these normal mode commands and use the standard Vim functionality for these normal mode commands?</h2>\n\n<p>You can use the `:normal!` command in your script to invoke a normal-mode command. This will use the standard functionality of the normal mode command and will not use the user-defined mapping.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :normal</b></p>\n\n<h2 id=\"How-do-I-get-the-current-visually-selected-text-into-a-Vim-variable-or-register\">25.12. How do I get the current visually selected text into a Vim variable or register?</h2>\n\n<p>You can get the current visually selected text into a Vim variable by yanking the text into Vim register and then assigning the contents of the register into the variable:</p>\n\n<pre><code>:normal! gvy\n:let myvar = @&quot;</code></pre>\n\n<p>The above command copies the visually selected text into the variable &quot;myvar&quot;.</p>\n\n<p>You can also use the command:</p>\n\n<pre><code>:normal! gv&quot;*y</code></pre>\n\n<p>In the above command, gv reselects the last visually selected text and the rest of the command copies the selected text into the * (clipboard) register. Alternatively, you can set the &quot;a&quot; flag in the &#39;guioptions&#39; option to automatically copy a visually selected text into the * register. To do this as part of a visual map, you can use a command similar to the one shown below:</p>\n\n<pre><code>:vmap &lt;F3&gt; &quot;*y:call ...</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help gv</b></p>\n\n<p><b>:help :normal</b></p>\n\n<p><b>:help :let-@</b></p>\n\n<p><b>:help quotestar</b></p>\n\n<p><b>:help clipboard</b></p>\n\n<p><b>:help registers</b></p>\n\n<h2 id=\"I-have-some-text-in-a-Vim-variable-myvar.-I-would-like-to-use-this-variable-in-a-:s-substitute-command-to-replace-a-text-mytext.-How-do-I-do-this\">25.13. I have some text in a Vim variable &quot;myvar&quot;. I would like to use this variable in a `:s` substitute command to replace a text &quot;mytext&quot;. How do I do this?</h2>\n\n<p>You can use the `:execute` command to evaluate the variable:</p>\n\n<pre><code>:execute &#39;%s/mytext/&#39; . myvar . &#39;/&#39;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :execute</b></p>\n\n<p>You can also use &quot;\\=&quot; in the substitute command to evaluate the variable:</p>\n\n<pre><code>:%s/mytext/\\=myvar/</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help sub-replace-special</b></p>\n\n<h2 id=\"A-Vim-variable-bno-contains-a-buffer-number.-How-do-I-use-this-variable-to-open-the-corresponding-buffer\">25.14. A Vim variable (bno) contains a buffer number. How do I use this variable to open the corresponding buffer?</h2>\n\n<p>The `:buffer` command will not accept a variable name. It accepts only a buffer number or buffer name. You have to use the `:execute` command to evaluate the variable into the corresponding value. For example:</p>\n\n<pre><code>:execute &quot;buffer &quot; . bno</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :execute</b></p>\n\n<h2 id=\"How-do-I-store-the-value-of-a-Vim-option-into-a-Vim-variable\">25.15. How do I store the value of a Vim option into a Vim variable?</h2>\n\n<p>You can prefix the option name with the &quot;&amp;&quot; character and assign the option value to a Vim variable using the `:let` command. For example, to store the value of the &#39;textwidth&#39; option into the Vim variable &quot;old_tw&quot;, you can use the following command:</p>\n\n<pre><code>:let old_tw = &amp;tw</code></pre>\n\n<p>To explicitly save buffer local options, use the prefix &quot;l:&quot;</p>\n\n<pre><code>:let old_tw = &amp;l:tw</code></pre>\n\n<p>If you want to explicitly select the global option, use the &quot;g:&quot; prefix to the option name.</p>\n\n<p>To do the opposite, to set the &#39;textwidth&#39; option with the value stored in the &quot;old_tw&quot; variable, you can use the following command:</p>\n\n<pre><code>:let &amp;tw = old_tw</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help expr-option</b></p>\n\n<p><b>:help :let-option</b></p>\n\n<h2 id=\"I-have-copied-and-inserted-some-text-into-a-buffer-from-a-Vim-function.-How-do-I-indent-the-inserted-text-from-the-Vim-function\">25.16. I have copied and inserted some text into a buffer from a Vim function. How do I indent the inserted text from the Vim function?</h2>\n\n<p>You can use the following command to format the just inserted text:</p>\n\n<pre><code>:normal &#39;[=&#39;]</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;[</b></p>\n\n<p><b>:help &#39;]</b></p>\n\n<p><b>:help =</b></p>\n\n<p><b>:help :normal</b></p>\n\n<h2 id=\"How-do-I-get-the-character-under-the-cursor-from-a-Vim-script\">25.17. How do I get the character under the cursor from a Vim script?</h2>\n\n<p>You can use the getline() function and use string index [] to get the character:</p>\n\n<pre><code>:echo getline(&quot;.&quot;)[col(&quot;.&quot;) - 1]</code></pre>\n\n<p>In the above command, getline(&quot;.&quot;) returns the text in the current line. The indexing of the string starts at zero, and you can get a single character in a string by its index with the &quot;string[index]&quot; notation. The col(&quot;.&quot;) returns the column of the cursor position; the adjustment is to get the right character of the string. However, this does NOT work with multibyte characters as this command only returns the byte index.</p>\n\n<p>Alternatively, you can use the following sequence of commands to get the character under the cursor:</p>\n\n<pre><code>normal! vy\nlet ch=@&quot;</code></pre>\n\n<p>Note, that the above commands will change the &#39;&lt; and &#39;&gt; marks.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help getline()</b></p>\n\n<p><b>:help col()</b></p>\n\n<p><b>:help expr-[]</b></p>\n\n<h2 id=\"How-do-I-get-the-name-of-the-current-file-without-the-extension\">25.18. How do I get the name of the current file without the extension?</h2>\n\n<p>You can get the name of the current file without the extension using:</p>\n\n<pre><code>:echo expand(&quot;%:r&quot;)</code></pre>\n\n<p>With some commands, you can use the file name modifiers directly:</p>\n\n<pre><code>:cd %:p:h\n:!gcc -o %:r.o %\n:!xpdf %&lt;.pdf</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help filename-modifiers</b></p>\n\n<p><b>:help expand()</b></p>\n\n<p><b>:help cmdline-special</b></p>\n\n<p><b>:help fnamemodify()</b></p>\n\n<h2 id=\"How-do-I-get-the-basename-of-the-current-file\">25.19. How do I get the basename of the current file?</h2>\n\n<p>You can use the &quot;:t&quot; filename modifier to get the basename of the current file:</p>\n\n<pre><code>:echo expand(&quot;%:t&quot;)</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help filename-modifiers</b></p>\n\n<h2 id=\"How-do-I-get-the-output-from-a-Vim-function-into-the-current-buffer\">25.20. How do I get the output from a Vim function into the current buffer?</h2>\n\n<p>You can insert the return value from a function using the following command in insert mode:</p>\n\n<pre><code>&lt;C-R&gt;=MyFunc()</code></pre>\n\n<p>Note, that this will only insert the return value of the function.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-R</b></p>\n\n<p><b>:help i_CTRL-R_CTRL-R</b></p>\n\n<p><b>:help i_CTRL-R_CTRL-O</b></p>\n\n<p><b>:help expression</b></p>\n\n<h2 id=\"How-do-I-call-external-programs-from-a-Vim-function\">25.21. How do I call external programs from a Vim function?</h2>\n\n<p>There are several ways to call external programs from a Vim function. You can use the builtin system() function to invoke external programs and get the result:</p>\n\n<pre><code>:let output = system(&quot;ls&quot;)</code></pre>\n\n<p>You can also use &quot;!&quot; ex-command to run an external command.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help system()</b></p>\n\n<p><b>:help :!</b></p>\n\n<p><b>:help 10.9</b></p>\n\n<h2 id=\"How-do-I-get-the-return-status-of-a-program-executed-using-the-:-command\">25.22. How do I get the return status of a program executed using the `:!` command?</h2>\n\n<p>You can use the predefined Vim v:shell_error variable to get the return status of the last run shell command.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help v:shell_error</b></p>\n\n<h2 id=\"How-do-I-determine-whether-the-current-buffer-is-modified-or-not\">25.23. How do I determine whether the current buffer is modified or not?</h2>\n\n<p>You can check the value of the &#39;modified&#39; option to determine whether the current buffer is modified:</p>\n\n<pre><code>:set modified?</code></pre>\n\n<p>From a Vim script, you can check the value of the &#39;modified&#39; option:</p>\n\n<pre><code>if &amp;modified\n    echo &quot;File is modified&quot;\nendif</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;modified&#39;</b></p>\n\n<h2 id=\"I-would-like-to-use-the-carriage-return-character-in-a-normal-command-from-a-Vim-script.-How-do-I-specify-the-carriage-return-character\">25.24. I would like to use the carriage return character in a normal command from a Vim script. How do I specify the carriage return character?</h2>\n\n<p>You can use the `:execute` command to specify the special (control) character in a normal mode command:</p>\n\n<pre><code>:execute &quot;normal \\&lt;CR&gt;&quot;\n:execute &quot;normal ixxx\\&lt;Esc&gt;&quot;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :execute</b></p>\n\n<p><b>:help expr-quote</b></p>\n\n<h2 id=\"How-do-I-split-long-lines-in-a-Vim-script\">25.25. How do I split long lines in a Vim script?</h2>\n\n<p>You can split long lines in a Vim script by inserting the backslash character (&quot;\\&quot;) at the start of the next line. For example,</p>\n\n<pre><code>set comments=sr:/*,mb:*,el:*/,\n            \\://,\n            \\b:#,\n            \\:%,\n            \\n:&gt;,\n            \\fb:-</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help line-continuation</b></p>\n\n<h2 id=\"When-I-try-to-execute-my-function-using-the-:execute-Myfunc-command-the-cursor-is-moved-to-the-top-of-the-current-buffer.-Why\">25.26. When I try to &quot;execute&quot; my function using the `:execute Myfunc()` command, the cursor is moved to the top of the current buffer. Why?</h2>\n\n<p>The `:execute` command runs the ex command specified by the argument. In the case of the following command:</p>\n\n<pre><code>:execute Myfunc()</code></pre>\n\n<p>The call to Myfunc() will return 0. The `:execute` command will run the ex command `:0`, which moves the cursor to the top of the file. To call a Vim function, you should use the `:call` command instead of the `:execute` command:</p>\n\n<pre><code>:call Myfunc()</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :call</b></p>\n\n<p><b>:help :execute</b></p>\n\n<p><b>:help :echo</b></p>\n\n<p><b>:help user-functions</b></p>\n\n<p><b>:help 41.5</b></p>\n\n<p><b>:help 41.6</b></p>\n\n<p><b>:help cmdline-lines</b></p>\n\n<h2 id=\"How-do-I-source-execute-the-contents-of-a-register\">25.27. How do I source/execute the contents of a register?</h2>\n\n<p>If you have yanked a set of Vim commands into a Vim register (for example register &quot;a&quot;), then you can source the contents of the register using one of the following commands:</p>\n\n<pre><code> :@a\nor\n :exe @a</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :@</b></p>\n\n<h2 id=\"After-calling-a-Vim-function-or-a-mapping-when-I-press-the-u-key-to-undo-the-last-change-Vim-undoes-all-the-changes-made-by-the-mapping-function.-Why\">25.28. After calling a Vim function or a mapping, when I press the &quot;u&quot; key to undo the last change, Vim undoes all the changes made by the mapping/function. Why?</h2>\n\n<p>When you call a function or a mapping, all the operations performed by the function/mapping are treated as one single operation. When you undo the last operation by pressing &quot;u&quot;, all the changes made by the function/mapping are reversed.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help undo-redo</b></p>\n\n<p><b>:help :map-undo</b></p>\n\n<h2 id=\"How-can-I-call-a-function-defined-with-s:-script-local-function-from-another-script-plugin\">25.29. How can I call a function defined with s: (script local function) from another script/plugin?</h2>\n\n<p>The s: prefix for a Vim function name is used to create a script local function. A script local function can be called only from within that script and cannot be called from other scripts. To define a function in a script/plugin, so that it can be called from other plugins/scripts, define the function without the s: prefix.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help script-variable</b></p>\n\n<p><b>:help script-local</b></p>\n\n<p><b>:help :scriptnames</b></p>\n\n<h2 id=\"Is-it-possible-to-un-source-a-sourced-script-In-other-words-reverse-all-the-commands-executed-by-sourcing-a-script\">25.30. Is it possible to un-source a sourced script? In other words, reverse all the commands executed by sourcing a script.</h2>\n\n<p>No. It is not possible to reverse or undo all the commands executed by sourcing a script.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :source</b></p>\n\n<h1 id=\"PLUGINS1\">PLUGINS</h1>\n\n<h2 id=\"How-do-I-set-different-options-for-different-types-of-files\">26.1. How do I set different options for different types of files?</h2>\n\n<p>You can create filetype plugins to set different options for different types of files. You should first enable filetype plugins using the command:</p>\n\n<pre><code>:filetype plugin on</code></pre>\n\n<p>A filetype plugin is a vim script that is loaded whenever Vim opens or creates a file of that type. For example, to ensure that the &#39;textwidth&#39; option is set to 80 when editing a C program (filetype &quot;c&quot;), create one of the following files:</p>\n\n<pre><code>~/.vim/ftplugin/c.vim (Unix)\n%HOME%\\vimfiles\\ftplugin\\c.vim (Windows)</code></pre>\n\n<p>with the following text in it:</p>\n\n<pre><code>setlocal textwidth=80</code></pre>\n\n<p>You can also use autocommands to set specific options when editing specific type of files. For example, to set the &#39;textwidth&#39; option to 75 for only *.txt files, you can use the following autocmd:</p>\n\n<pre><code>autocmd BufRead *.txt setlocal textwidth=80</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help filetype-plugin</b></p>\n\n<p><b>:help add-filetype-plugin</b></p>\n\n<p><b>:help :autocmd</b></p>\n\n<p><b>:help 40.3</b></p>\n\n<h2 id=\"I-have-downloaded-a-Vim-plugin-or-a-syntax-file-or-a-indent-file-or-a-color-scheme-or-a-filetype-plugin-from-the-web.-Where-should-I-copy-these-files-so-that-Vim-will-find-them\">26.2. I have downloaded a Vim plugin or a syntax file or a indent file, or a color scheme or a filetype plugin from the web. Where should I copy these files so that Vim will find them?</h2>\n\n<p>You can place the Vim runtime files (plugins, syntax files, indent files, color schemes, filetype plugins, etc) under one of the directories specified in the &#39;runtimepath&#39; option. To determine the current value of the &#39;runtimepath&#39; option, use the following command:</p>\n\n<pre><code>:set runtimepath</code></pre>\n\n<p>For Unix systems, this is usually the &quot;$HOME/.vim&quot; directory. For MS-Windows systems, this is usually the $VIM\\vimfiles or $HOME\\vimfiles directory. Depending on the type of the runtime file, you have to place it under a specific directory under the above runtime directory. The names of the directories are listed below:</p>\n\n<pre><code>name        description\n----------  ------------------\ncolors/     color scheme files\ncompiler/   compiler files\ndoc/        documentation\nftplugin/   filetype plugins\nindent/     indent scripts\nkeymap/     key mapping files\nlang/       menu translations\nplugin/     plugin scripts\nsyntax/     syntax files\ntutor/      files for vimtutor</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help your-runtime-dir</b></p>\n\n<p><b>:help &#39;runtimepath&#39;</b></p>\n\n<p><b>:help :runtime</b></p>\n\n<h2 id=\"How-do-I-extend-an-existing-filetype-plugin\">26.3. How do I extend an existing filetype plugin?</h2>\n\n<p>You can extend an existing filetype plugin by creating a file in the after/ directory in any of the &#39;runtimepath&#39; directories.</p>\n\n<p>- for small changes to be done after (and in addition to) what is already done by the ftplugin installed with Vim, use an after-directory, as follows (replacing foobar by the &#39;filetype&#39; of the concerned files): - For changes private to one user: - on Windows: $HOME/vimfiles/after/ftplugin/foobar.vim - on Unix-like OSes: $HOME/.vim/after/ftplugin/foobar.vim - For changes affecting all users on the system: $VIM/vimfiles/after/ftplugin/foobar.vim</p>\n\n<p>- when replacing the whole filetype-plugin by a different version, or when installing a new ftplugin for some filetype not yet supported by Vim out of the box: use the same paths without the after/ in them. In that case you should place near the start of your plugin an &quot;if... finish... endif... let&quot; block like the one in the plugins distributed with Vim.</p>\n\n<p>All the above paths are given in Vim terminology (which is similar to Unix terminology, but is understood even by Vim for Windows); they don&#39;t exist by default, so the first time you need them you will have to create them using mkdir (on any OS including DOS/Windows) or md (on DOS/Windows only). $VIM and, on DOS/Windows, $HOME, do not necessarily exist outside Vim. If $HOME has no value (or no valid value) inside Vim, you can use $VIM instead; but on any but possibly very old versions of Windows, $HOMEDRIVE and $HOMEPATH are defined by the system, and if $HOME is undefined at Vim startup, Vim will set it by expanding $HOMEDRIVE$HOMEPATH before sourcing your vimrc. To know which values Vim uses, you can type (in a running Vim):</p>\n\n<pre><code>:echo $VIM\n:echo $HOME</code></pre>\n\n<p>If you placed the file in the after/ftplugin runtime directory, then Vim will first source the existing filetype plugin file and then will source the new file. If you placed the file in the $VIMRTUNTIME/ftplugin runtime directory, then Vim will first source the new file and then will source the existing filetype plugin file.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help ftplugin-overrule</b></p>\n\n<p><b>:help filetype-plugin</b></p>\n\n<p><b>:help add-filetype-plugin</b></p>\n\n<p><b>:help &#39;runtimepath&#39;</b></p>\n\n<h2 id=\"How-do-I-turn-off-loading-the-Vim-plugins\">26.4. How do I turn off loading the Vim plugins?</h2>\n\n<p>You can reset the &#39;loadplugins&#39; option to turn off loading the plugins:</p>\n\n<pre><code>:set noloadplugins</code></pre>\n\n<p>You can also specify the &quot;--noplugin&quot; command line argument to stop loading the plugins:</p>\n\n<pre><code>$ vim --noplugin</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;loadplugins&#39;</b></p>\n\n<p><b>:help --noplugin</b></p>\n\n<p><b>:help load-plugins</b></p>\n\n<h2 id=\"How-do-I-turn-on-off-loading-the-filetype-plugins\">26.5. How do I turn on/off loading the filetype plugins?</h2>\n\n<p>By default, Vim will not load the filetype plugins. You can configure Vim to load filetype plugins using the command:</p>\n\n<pre><code>filetype plugin on</code></pre>\n\n<p>You can turn off loading the filetype plugins using:</p>\n\n<pre><code>filetype plugin off</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :filetype-plugin-on</b></p>\n\n<p><b>:help :filetype-plugin-off</b></p>\n\n<p><b>:help :filetype</b></p>\n\n<h2 id=\"How-do-I-override-settings-made-in-a-file-type-plugin-in-the-global-ftplugin-directory-for-all-the-file-types\">26.6. How do I override settings made in a file type plugin in the global ftplugin directory for all the file types?</h2>\n\n<p>You can use an autocommand triggered on the FileType event:</p>\n\n<pre><code>au Filetype * set formatoptions=xyz</code></pre>\n\n<p>This should at least be after &quot;filetype on&quot; in your vimrc. Best is to put it in your &quot;myfiletypefile&quot; file, so that it&#39;s always last.</p>\n\n<p>If you want to override a setting for a particular filetype, then create a file with the same name as the original filetype plugin in the ~/.vim/after/ftplugin directory For example, to override a setting in the c.vim filetype plugin, create a c.vim file in the ~/.vim/after/ftplugin directory and add your preferences in this file.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help ftplugin-overrule</b></p>\n\n<p><b>:help ftplugins</b></p>\n\n<p><b>:help myfiletypefile</b></p>\n\n<h2 id=\"How-do-I-disable-the-Vim-directory-browser-plugin\">26.7. How do I disable the Vim directory browser plugin?</h2>\n\n<p>To disable the directory browsing Vim plugin, add the following line to your .vimrc file:</p>\n\n<pre><code>let g:loaded_netrw = 1</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help netrw</b></p>\n\n<h2 id=\"How-do-I-set-the-filetype-option-for-files-with-names-matching-a-particular-pattern-or-depending-on-the-file-extension\">26.8. How do I set the filetype option for files with names matching a particular pattern or depending on the file extension?</h2>\n\n<p>You can set the &#39;filetype&#39; option for files with names matching a particular pattern using an autocmd. For example, to set the &#39;filetype&#39; option to &quot;c&quot; for all files with extension &quot;.x&quot;, you can use the following autocmd:</p>\n\n<pre><code>autocmd! BufRead,BufNewFile *.x     setfiletype c</code></pre>\n\n<p>A better alternative to the above approach is to create a filetype.vim file in the ~/.vim directory (or in one of the directories specified in the &#39;runtimepath&#39; option) and add the following lines:</p>\n\n<pre><code>&quot; my filetype file\nif exists(&quot;did_load_filetypes&quot;)\n    finish\nendif\naugroup filetypedetect\n    au! BufRead,BufNewFile *.x       setfiletype c\naugroup END</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help new-filetype</b></p>\n\n<p><b>:help 43.2</b></p>\n\n<p><b>:help :setfiletype</b></p>\n\n<h1 id=\"EDITING-PROGRAM-FILES1\">EDITING PROGRAM FILES</h1>\n\n<h2 id=\"How-do-I-enable-automatic-indentation-for-C-C-files\">27.1. How do I enable automatic indentation for C/C++ files?</h2>\n\n<p>You can enable file-type based indentation using:</p>\n\n<pre><code>:filetype indent on</code></pre>\n\n<p>If you want to only enable automatic C indentation, then use:</p>\n\n<pre><code>:set cindent</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;cindent&#39;</b></p>\n\n<p><b>:help C-indenting</b></p>\n\n<p><b>:help filetype</b></p>\n\n<h2 id=\"How-do-I-configure-the-indentation-used-for-C-C-files\">27.2. How do I configure the indentation used for C/C++ files?</h2>\n\n<p>You can configure the Vim C indentation by modifying the value of the &#39;cinoptions&#39;, &#39;cinkeys&#39; and &#39;cinwords&#39; options.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;cindent&#39;</b></p>\n\n<p><b>:help &#39;cinoptions&#39;</b></p>\n\n<p><b>:help &#39;cinkeys&#39;</b></p>\n\n<p><b>:help &#39;cinwords&#39;</b></p>\n\n<p><b>:help C-indenting</b></p>\n\n<p><b>:help cinoptions-values</b></p>\n\n<p><b>:help &#39;smartindent&#39;</b></p>\n\n<h2 id=\"How-do-I-turn-off-the-automatic-indentation-feature\">27.3. How do I turn off the automatic indentation feature?</h2>\n\n<p>By default, the automatic indentation is not turned on. You must have configured Vim to do automatic indentation in either .vimrc or .gvimrc files. You can disable automatic indentation using either,</p>\n\n<pre><code>:filetype indent off</code></pre>\n\n<p>or</p>\n\n<pre><code>:set nocindent</code></pre>\n\n<p>Also, check the setting for the following options:</p>\n\n<pre><code>:set autoindent?\n:set smartindent?\n:set indentexpr?</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;cindent&#39;</b></p>\n\n<p><b>:help :filetype-indent-off</b></p>\n\n<p><b>:help &#39;autoindent&#39;</b></p>\n\n<p><b>:help &#39;smartindent&#39;</b></p>\n\n<p><b>:help &#39;indentexpr&#39;</b></p>\n\n<h2 id=\"How-do-I-change-the-number-of-space-characters-used-for-the-automatic-indentation\">27.4. How do I change the number of space characters used for the automatic indentation?</h2>\n\n<p>You can modify the &#39;shiftwidth&#39; option to change the number of space characters used for the automatic indentation:</p>\n\n<pre><code>:set shiftwidth=4</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;shiftwidth&#39;</b></p>\n\n<h2 id=\"I-am-editing-a-C-program-using-Vim.-How-do-I-display-the-definition-of-a-macro-or-a-variable\">27.5. I am editing a C program using Vim. How do I display the definition of a macro or a variable?</h2>\n\n<p>You can use the &quot;[d&quot; command to display the definition of a macro, &quot;[i&quot; command to display the definition of a variable, &quot;gd&quot; to goto the local declaration of a variable and &quot;gD&quot; to go to the global Declaration.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help [d</b></p>\n\n<p><b>:help [i</b></p>\n\n<p><b>:help gd</b></p>\n\n<p><b>:help gD</b></p>\n\n<p><b>:help include-search</b></p>\n\n<p><b>:help 29.4</b></p>\n\n<p><b>:help 29.5</b></p>\n\n<h2 id=\"I-am-editing-a-C-program-using-Vim.-How-do-I-jump-to-the-beginning-or-end-of-a-code-block-from-within-the-block\">27.6. I am editing a C program using Vim. How do I jump to the beginning or end of a code block from within the block?</h2>\n\n<p>You can use &quot;[{&quot; command to jump to the beginning of the code block and &quot;]}&quot; to jump to the end of the code block from inside the block.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help [{</b></p>\n\n<p><b>:help ]}</b></p>\n\n<p><b>:help various-motions</b></p>\n\n<h2 id=\"When-editing-C-files-and-when-inserting-new-lines-above-or-below-a-comment-line-Vim-automatically-inserts-the-C-comment-character-at-the-beginning-of-the-line.-How-do-I-disable-this\">27.7. When editing C++ files and when inserting new lines above or below a comment (//) line, Vim automatically inserts the C++ comment character (//) at the beginning of the line. How do I disable this?</h2>\n\n<p>This automatic insertion of the comment leader (//) when new lines are added is controlled by three flags in the &#39;formatoptions&#39; option: &quot;c&quot;, &quot;r&quot; and &quot;o&quot;. &quot;c&quot; enables auto-wrapping of comment lines when typing extends beyond the right margin. &quot;r&quot; enables the automatic insertion of the comment leader when &lt;Enter&gt; is pressed while editing a comment line. &quot;o&quot; enables the automatic insertion of the comment leader when a new line is opened above or below an existing comment line by typing O or o in Normal mode.</p>\n\n<p>You can stop Vim from automatically inserting the comment leader when typing &lt;Enter&gt; within a comment or when opening a new line by removing the &quot;r&quot; and &quot;o&quot; flags from &#39;formatoptions&#39;.</p>\n\n<pre><code>:set formatoptions-=r\n:set formatoptions-=o</code></pre>\n\n<p>The default filetype plugin for C and C++ files ($VIMRUNTIME/ftplugin/c.vim) adds the &quot;r&quot; and &quot;o&quot; flags to the &#39;formatoptions&#39; option. If you want to override this for C++ files, then you can add the above lines to the ~/.vim/after/ftplugin/cpp.vim file.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;formatoptions&#39;</b></p>\n\n<p><b>:help 30.6</b></p>\n\n<p><b>:help format-comments</b></p>\n\n<p><b>:help filetype-plugins</b></p>\n\n<p><b>:help ftplugin-overrule</b></p>\n\n<h2 id=\"How-do-I-add-the-comment-character-to-a-set-of-lines-at-the-beginning-of-each-line\">27.8. How do I add the comment character &quot;#&quot; to a set of lines at the beginning of each line?</h2>\n\n<p>First, select the first character in all the lines using visual block mode (CTRL-V). Press &quot;I&quot; to start inserting characters at the beginning of the line. Enter the comment character and then stop the insert mode by pressing &lt;Esc&gt;. Vim will automatically insert the entered characters at the beginning of all the selected lines.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help visual-block</b></p>\n\n<p><b>:help blockwise-operators</b></p>\n\n<p><b>:help v_b_I</b></p>\n\n<h2 id=\"How-do-I-edit-a-header-file-with-the-same-name-as-the-corresponding-C-source-file\">27.9. How do I edit a header file with the same name as the corresponding C source file?</h2>\n\n<p>You can use the following command to edit a header file with the same name as the corresponding C source file:</p>\n\n<pre><code>:e %:t:r.h</code></pre>\n\n<p>You can use the following command to edit the file in a new split window:</p>\n\n<pre><code>:sp %:t:r.h</code></pre>\n\n<p>In the above commands, the percent sign expands to the name of the current file. The `:t` modifier extracts the tail (last component) of the filename. The `:r` modifier extracts the root of the filename. The .h is appended to the resulting name to get the header filename.</p>\n\n<p>Another approach is to use the following command:</p>\n\n<pre><code>:sfind %:t:r.h</code></pre>\n\n<p>This command will search for the header file in the directories specified in the &#39;path&#39; option.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help cmdline-special</b></p>\n\n<p><b>:help filename-modifiers</b></p>\n\n<p><b>:help :sfind</b></p>\n\n<p><b>:help &#39;path&#39;</b></p>\n\n<h2 id=\"How-do-I-automatically-insert-comment-leaders-while-typing-comments\">27.10. How do I automatically insert comment leaders while typing comments?</h2>\n\n<p>To automatically insert comment leaders while typing comments, add the &quot;r&quot; and &quot;o&quot; flags to the &#39;formatoptions&#39; option.</p>\n\n<pre><code>:set formatoptions+=ro</code></pre>\n\n<p>You may also want to add the &quot;c&quot; flag to auto-wrap comments using the &#39;textwidth&#39; option setting and the &quot;q&quot; flag to format comments with the &quot;gq&quot; command:</p>\n\n<pre><code>:set formatoptions=croq</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 30.6</b></p>\n\n<p><b>:help format-comments</b></p>\n\n<p><b>:help &#39;comments&#39;</b></p>\n\n<p><b>:help fo-table</b></p>\n\n<h1 id=\"QUICKFIX1\">QUICKFIX</h1>\n\n<h2 id=\"How-do-I-build-programs-from-Vim\">28.1. How do I build programs from Vim?</h2>\n\n<p>You can use the `:make` command to build programs from Vim. The `:make` command runs the program specified by the &#39;makeprg&#39; option.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 30.1</b></p>\n\n<p><b>:help :make_makeprg</b></p>\n\n<p><b>:help &#39;makeprg&#39;</b></p>\n\n<p><b>:help &#39;makeef&#39;</b></p>\n\n<p><b>:help :make</b></p>\n\n<p><b>:help quickfix</b></p>\n\n<h2 id=\"When-I-run-the-make-command-in-Vim-I-get-the-errors-listed-as-the-compiler-compiles-the-program.-When-it-finishes-this-list-disappears-and-I-have-to-use-the-:clist-command-to-see-the-error-message-again.-Is-there-any-other-way-to-see-these-error-messages\">28.2. When I run the make command in Vim I get the errors listed as the compiler compiles the program. When it finishes this list disappears and I have to use the `:clist` command to see the error message again. Is there any other way to see these error messages?</h2>\n\n<p>You can use the `:copen` or `:cwindow` command to open the quickfix window that contains the compiler output. You can select different error lines from this window and jump to the corresponding line in the source code.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :copen</b></p>\n\n<p><b>:help :cwindow</b></p>\n\n<p><b>:help quickfix</b></p>\n\n<h2 id=\"How-can-I-perform-a-command-for-each-item-in-the-quickfix-location-list\">28.3. How can I perform a command for each item in the quickfix/location list?</h2>\n\n<p>Starting from Vim 7.4.858 Vim provides the new commands `:cfdo`, `:cdo`, `:lfdo` and `:ldo.` They work by iterating over all items in the quickfix list and performing a command on each. The difference is, that the `:lfdo` and `:ldo` commands iterate over the location list entries, while the `:cfdo` and `:cdo` commands operate on the items in the quickfix list. Also, the `:cfdo` and `:lfdo` operate on all different files, while the `:cdo` and `:ldo` commands operate on each item in the quickfix/location list.</p>\n\n<p>For example you could vimgrep all C files in the current directory for a search string &quot;Foobar&quot;:</p>\n\n<pre><code>:vimgrep /Foobar/ *.c</code></pre>\n\n<p>and as this populates your quickfix list, you could simply replace all occurences by using:</p>\n\n<pre><code>:cdo :%s/Foobar/Foobaz | upd</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :cfdo</b></p>\n\n<p><b>:help :cdo</b></p>\n\n<h1 id=\"FOLDING1\">FOLDING</h1>\n\n<h2 id=\"How-do-I-extend-the-Vim-folding-support\">29.1. How do I extend the Vim folding support?</h2>\n\n<p>You can use the &#39;foldexpr&#39; option to fold using a user specified function. For example, to fold subroutines of the following form into a single line:</p>\n\n<pre><code>sub foo {\n  my $barf;\n  $barf = 3;\n  return $barf;\n}</code></pre>\n\n<p>You can use the following commands:</p>\n\n<pre><code>set foldmethod=expr\nset foldexpr=MyFoldExpr(v:lnum)\nfun! MyFoldExpr(line)\n    let str = getline(a:line)\n    if str =~ &#39;^sub\\&gt;&#39;\n        return &#39;1&#39;\n    elseif str =~ &#39;^}&#39;\n        return &#39;&lt;1&#39;\n    else\n        return foldlevel(a:line - 1)\n    endif\nendfun</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;foldexpr&#39;</b></p>\n\n<p><b>:help fold-expr</b></p>\n\n<h2 id=\"When-I-enable-folding-by-setting-the-foldmethod-option-all-the-folds-are-closed.-How-do-I-prevent-this\">29.2. When I enable folding by setting the &#39;foldmethod&#39; option, all the folds are closed. How do I prevent this?</h2>\n\n<p>You can set the &#39;foldlevelstart&#39; option to a particular value to close only folds above the specified value.</p>\n\n<pre><code>:set foldlevelstart=99</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;foldlevelstart&#39;</b></p>\n\n<p><b>:help &#39;foldlevel&#39;</b></p>\n\n<p><b>:help fold-foldlevel</b></p>\n\n<h2 id=\"How-do-I-control-how-many-folds-will-be-opened-when-I-start-editing-a-file\">29.3. How do I control how many folds will be opened when I start editing a file?</h2>\n\n<p>You can modify the &#39;foldlevelstart&#39; option to control the number of folds that will be opened when you start editing a file. To start editing with all the folds closed:</p>\n\n<pre><code>:set foldlevelstart=0</code></pre>\n\n<p>To start editing with all the folds opened, you can use</p>\n\n<pre><code>:set foldlevelstart=999</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;foldlevelstart&#39;</b></p>\n\n<h2 id=\"How-do-I-open-and-close-folds-using-the-mouse\">29.4. How do I open and close folds using the mouse?</h2>\n\n<p>You can click on the + and - characters displayed at the leftmost column to open and close fold. For this to work, you have to set the &#39;foldcolumn&#39; to a value greater than zero:</p>\n\n<pre><code>:set foldcolumn=2</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;foldcolumn&#39;</b></p>\n\n<h2 id=\"How-do-I-change-the-text-displayed-for-a-closed-fold\">29.5. How do I change the text displayed for a closed fold?</h2>\n\n<p>You can use the &#39;foldtext&#39; option to change the text displayed for a closed fold.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;foldtext&#39;</b></p>\n\n<p><b>:help fold-foldtext</b></p>\n\n<p><b>:help &#39;fillchars&#39;</b></p>\n\n<h2 id=\"How-do-I-store-and-restore-manually-created-folds-across-different-Vim-invocations\">29.6. How do I store and restore manually created folds across different Vim invocations?</h2>\n\n<p>You can use the `:mkview` command to store manually created folds. Later, you can use the `:loadview` command to restore the folds. For this to work, the &#39;viewoptions&#39; must contain &quot;folds&quot;.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 28.4</b></p>\n\n<p><b>:help :mkview</b></p>\n\n<p><b>:help :loadview</b></p>\n\n<p><b>:help &#39;viewoptions&#39;</b></p>\n\n<p><b>:help &#39;viewdir&#39;</b></p>\n\n<p><b>:help :mksession</b></p>\n\n<p><b>:help &#39;sessionoptions&#39;</b></p>\n\n<h2 id=\"I-have-enabled-syntax-based-folding.-Why-is-Vim-so-slow\">29.7. I have enabled syntax based folding. Why is Vim so slow?</h2>\n\n<p>Syntax based folding is currently rather slow in Vim and will possibly slow down Vim considerably. There is an issue in the todo list to fix this, but the todo list is rather long and it may take a while until this will be fixed.</p>\n\n<p>You can find the issue in the todo list, if you read</p>\n\n<p><b>:help todo.txt</b></p>\n\n<p>followed by a search for &quot;folding with &#39;foldmethod&#39;&quot;</p>\n\n<p>A workaround is to temporarily set the foldmethod to manual while in insert mode. This is described in the wiki at:</p>\n\n<pre><code>http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text</code></pre>\n\n<h1 id=\"VIM-WITH-EXTERNAL-APPLICATIONS1\">VIM WITH EXTERNAL APPLICATIONS</h1>\n\n<h2 id=\"Can-I-run-a-shell-inside-a-Vim-window\">30.1. Can I run a shell inside a Vim window?</h2>\n\n<p>Since Version 8.1 Vim comes with a terminal window included. It allows to run a shell inside an ordinary Vim window (e.g. split) asynchronously and interact with the shell using the normal Vim commands.</p>\n\n<p>When the focus is in the terminal window, typed keys will be sent to the job and is called terminal mode. You can click outside of the terminal window to move keyboard focus elsewhere, alternatively one can use CTRL-W to novigate between different Vim windows. To feed CTRL-W into the terminal, one needs to use CTRL-W .</p>\n\n<p>To map keys specifically for terminal mode, use the new `:tmap` command. After typing CTRL-W the terminal window will switch to Terminal-Normal mode (this can be used to move the cursor around, scroll the window, etc. Just like normal mode).</p>\n\n<p>To interact between the terminal and Vim, Vim implements several interfaces using term_sendkeys(), terminal-api and the client-server mechanism.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help terminal</b></p>\n\n<p><b>:help mapmode-t</b></p>\n\n<p><b>:help Terminal-Normal</b></p>\n\n<p><b>:help terminal-communication</b></p>\n\n<h2 id=\"How-do-I-pass-the-word-under-the-cursor-to-an-external-command\">30.2. How do I pass the word under the cursor to an external command?</h2>\n\n<p>You can use the special keyword &lt;cword&gt; to pass the word under the cursor to an external command. For example:</p>\n\n<pre><code>:!dict &lt;cword&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :&lt;cword</b>&gt;</p>\n\n<h2 id=\"How-do-I-get-the-output-of-a-shell-command-into-a-Vim-buffer\">30.3. How do I get the output of a shell command into a Vim buffer?</h2>\n\n<p>You can use the `:r !` command to get the output of a shell command into a Vim buffer. For example, to insert the output of the &quot;ls&quot; shell command, you can use the following command:</p>\n\n<pre><code>:r !ls</code></pre>\n\n<p>To insert the output of the shell command above the first line use the following command:</p>\n\n<pre><code>:0r !ls</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :r!</b></p>\n\n<h2 id=\"How-do-I-pipe-the-contents-of-the-current-buffer-to-an-external-command-and-replace-the-contents-of-the-buffer-with-the-output-from-the-command\">30.4. How do I pipe the contents of the current buffer to an external command and replace the contents of the buffer with the output from the command?</h2>\n\n<p>You can use the :! command to pipe the contents of the current buffer to an external command and replace the contents of the buffer with the output from the command. For example, to sort the contents of the current buffer, using the Unix sort command, you can use the following command:</p>\n\n<pre><code>:%!sort</code></pre>\n\n<p>To sort only lines 10-20, you can use the following command</p>\n\n<pre><code>:10,20!sort</code></pre>\n\n<p>Also, if you want to pipe a buffer to an external command but not put the results back in the buffer, you can use</p>\n\n<pre><code>:w !sort</code></pre>\n\n<p>The above command will pipe the entire buffer to the sort command. Note, that the space between the &quot;w&quot; and the &quot;!&quot; is critical. To pipe only a range of lines, you can use</p>\n\n<pre><code>:10,20w !sort</code></pre>\n\n<p>The above command will pipe the lines 10-20 to the sort command.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :range!</b></p>\n\n<p><b>:help 10.9</b></p>\n\n<p><b>:help :w_c</b></p>\n\n<h2 id=\"How-do-I-sort-a-section-of-my-file\">30.5. How do I sort a section of my file?</h2>\n\n<p>You use the `:sort` command like this:</p>\n\n<pre><code>:5,100sort</code></pre>\n\n<p>Using the `:sort` command provides many options, you can sort numerical on the first found decimal number using:</p>\n\n<pre><code>:%sort n</code></pre>\n\n<p>Or you can specify to sort on the text, starting at virtual column 8:</p>\n\n<pre><code>:%sort /.*\\%8v/</code></pre>\n\n<p>Alternatively can pipe a section of the file to the Unix &quot;sort&quot; utility to sort the file. For example:</p>\n\n<pre><code>:5,100!sort</code></pre>\n\n<p>You can also use a visual block, and use the &quot;!sort&quot; command on the selected block.</p>\n\n<p>See also: <b>:help :sort</b></p>\n\n<p><b>:help filter</b></p>\n\n<h2 id=\"How-do-I-use-Vim-as-a-pager\">30.6. How do I use Vim as a pager?</h2>\n\n<p>You can use Vim as a pager using the $VIMRUNTIME/macros/less.sh shell script, supplied as part of the standard Vim distribution. This shell script uses the $VIMRUNTIME/macros/less.vim Vim script to provide less like key bindings.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help less</b></p>\n\n<h2 id=\"How-do-I-view-Unix-man-pages-from-inside-Vim\">30.7. How do I view Unix man pages from inside Vim?</h2>\n\n<p>You can view Unix man pages, inside Vim, using the man.vim plugin supplied as part of the standard Vim distribution. To use this plugin, add the following line to your startup vimrc file:</p>\n\n<pre><code>runtime ftplugin/man.vim</code></pre>\n\n<p>You can also press the K key to run the program specified by the &#39;keywordprg&#39; option with the keyword under the cursor. By default, &#39;keywordprg&#39; is set to run man on the keyword under the cursor.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help ft-man-plugin</b></p>\n\n<p><b>:help K</b></p>\n\n<p><b>:help &#39;keywordprg&#39;</b></p>\n\n<h2 id=\"How-do-I-change-the-diff-command-used-by-the-Vim-diff-support\">30.8. How do I change the diff command used by the Vim diff support?</h2>\n\n<p>By default, the Vim diff support uses the &#39;diff&#39; command. You can change this by changing the &#39;diffexpr&#39; option.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help diff-diffexpr</b></p>\n\n<p><b>:help &#39;diffexpr&#39;</b></p>\n\n<h2 id=\"How-do-I-use-the-Vim-diff-mode-without-folding\">30.9. How do I use the Vim diff mode without folding?</h2>\n\n<p>You can use the following command-line to start Vim with two filenames and use the diff mode without folding:</p>\n\n<pre><code>$ vim -o file1 file2 &quot;+windo set diff scrollbind scrollopt+=hor nowrap&quot;</code></pre>\n\n<p>If you like vertically split windows, then replace &quot;-o&quot; with &quot;-O&quot;.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help vimdiff</b></p>\n\n<h1 id=\"GUI-VIM1\">GUI VIM</h1>\n\n<h2 id=\"How-do-I-create-buffer-specific-menus\">31.1. How do I create buffer specific menus?</h2>\n\n<p>Adding support for buffer specific menus is in the Vim TODO list. In the mean time, you can try Michael Geddes&#39;s plugin, buffermenu.vim:</p>\n\n<pre><code>https://www.vim.org/scripts/script.php?script_id=246</code></pre>\n\n<h2 id=\"How-do-I-change-the-font-used-by-GUI-Vim\">31.2. How do I change the font used by GUI Vim?</h2>\n\n<p>You can change the &#39;guifont&#39; option to change the font used by GUI Vim. To display the current value of this option, you can use</p>\n\n<pre><code>:set guifont?</code></pre>\n\n<p>You can add the displayed font name to the .vimrc file to use the font across Vim sessions. For example, add the following line to the .vimrc file to use Andale Mono font.</p>\n\n<pre><code>set guifont=Andale_Mono:h10:cANSI</code></pre>\n\n<p>For Win32, GTK and Photon version of Vim, you can use the following command to bringup a dialog which will help you in changing the guifont:</p>\n\n<pre><code>:set guifont=*</code></pre>\n\n<p>You can also use the -font Vim command line option to specify the font used for normal text.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;guifont&#39;</b></p>\n\n<p><b>:help &#39;guifontset&#39;</b></p>\n\n<p><b>:help &#39;guifontwide&#39;</b></p>\n\n<p><b>:help font-sizes</b></p>\n\n<p><b>:help -font</b></p>\n\n<p><b>:help -boldfont</b></p>\n\n<p><b>:help -italicfont</b></p>\n\n<p><b>:help -menufont</b></p>\n\n<p><b>:help -menufontset</b></p>\n\n<h2 id=\"When-starting-GUI-Vim-how-do-I-specify-the-location-of-the-GVIM-window\">31.3. When starting GUI Vim, how do I specify the location of the GVIM window?</h2>\n\n<p>You can use the &quot;-geometry&quot; command line argument to specify the location of the GUI Vim window. For example:</p>\n\n<pre><code>$ gvim -geometry 80x25+100+300</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 31.4</b></p>\n\n<p><b>:help -geom</b></p>\n\n<h2 id=\"How-do-I-add-a-horizontal-scrollbar-in-GVim\">31.4. How do I add a horizontal scrollbar in GVim?</h2>\n\n<p>You can enable the horizontal scrollbar by modifying the &#39;guioptions&#39; option:</p>\n\n<pre><code>:set guioptions+=b</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;guioptions&#39;</b></p>\n\n<p><b>:help gui-horiz-scroll</b></p>\n\n<h2 id=\"How-do-I-make-the-scrollbar-appear-in-the-left-side-by-default\">31.5. How do I make the scrollbar appear in the left side by default?</h2>\n\n<p>You can add the &quot;l&quot; flag to the &#39;guioptions&#39; option to make the scrollbar appear in the left side.</p>\n\n<pre><code>:set guioptions+=l\n:set guioptions-=r</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;guioptions&#39;</b></p>\n\n<p><b>:help gui-scrollbars</b></p>\n\n<h2 id=\"How-do-I-remove-the-Vim-menubar\">31.6. How do I remove the Vim menubar?</h2>\n\n<p>You can remove the Vim menubar by removing the &quot;m&quot; flag from the &#39;guioptions&#39; option:</p>\n\n<pre><code>:set guioptions-=m</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;guioptions&#39;</b></p>\n\n<h2 id=\"I-am-using-GUI-Vim.-When-I-press-the-Alt-key-and-a-letter-the-menu-starting-with-that-letter-is-selected.-I-dont-want-this-behavior-as-I-want-to-map-the-Alt-key-combination.-How-do-I-do-this\">31.7. I am using GUI Vim. When I press the &lt;Alt&gt; key and a letter, the menu starting with that letter is selected. I don&#39;t want this behavior as I want to map the &lt;Alt&gt;-&lt;key&gt; combination. How do I do this?</h2>\n\n<p>You can use the &#39;winaltkeys&#39; option to disable the use of the &lt;Alt&gt; key to select a menu item:</p>\n\n<pre><code>:set winaltkeys=no</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;winaltkeys&#39;</b></p>\n\n<p><b>:help :simalt</b></p>\n\n<h2 id=\"Is-it-possible-to-scroll-the-text-by-dragging-the-scrollbar-so-that-the-cursor-stays-in-the-original-location\">31.8. Is it possible to scroll the text by dragging the scrollbar so that the cursor stays in the original location?</h2>\n\n<p>The way Vim is designed, the cursor position has to be in a visible spot in normal, visual, select and insert mode. This cannot be changed without modifying Vim. When the scrollbar is used, the cursor will be moved so that it is always visible. Another approach to solving this problem is to use the Vim marks. You can mark the current cursor position using ma. Then scroll to a different part of the text and jump back to the old position using `a. You can also try the following suggestion from the Vim Online website:</p>\n\n<pre><code>http://vim.wikia.com/wiki/VimTip320</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help mark-motions</b></p>\n\n<h2 id=\"How-do-I-get-gvim-to-start-browsing-files-in-a-particular-directory-when-using-the-:browse-command\">31.9. How do I get gvim to start browsing files in a particular directory when using the `:browse` command?</h2>\n\n<p>You can set the &#39;browsedir&#39; option to the default directory to use for the `:browse` command.</p>\n\n<pre><code>:set browsedir=&#39;&lt;your_dir&gt;&#39;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;browsedir&#39;</b></p>\n\n<h2 id=\"For-some-questions-like-when-a-file-is-changed-outside-of-Vim-Vim-displays-a-GUI-dialog-box.-How-do-I-replace-this-GUI-dialog-box-with-a-console-dialog-box\">31.10. For some questions, like when a file is changed outside of Vim, Vim displays a GUI dialog box. How do I replace this GUI dialog box with a console dialog box?</h2>\n\n<p>You can set the &quot;c&quot; flag in the &#39;guioptions&#39; option to configure Vim to use console dialogs instead of GUI dialogs:</p>\n\n<pre><code>:set guioptions+=c</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;guioptions&#39;</b></p>\n\n<h2 id=\"I-am-trying-to-use-GUI-Vim-as-the-editor-for-my-xxx-application.-When-the-xxx-application-launches-GUI-Vim-to-edit-a-file-the-control-immediately-returns-to-the-xxx-application.-How-do-I-start-GUI-Vim-so-that-the-control-returns-to-the-xxx-application-only-after-I-quit-Vim\">31.11. I am trying to use GUI Vim as the editor for my xxx application. When the xxx application launches GUI Vim to edit a file, the control immediately returns to the xxx application. How do I start GUI Vim, so that the control returns to the xxx application only after I quit Vim?</h2>\n\n<p>You have to start GUI Vim with the &quot;-f&quot; (foreground) command line option:</p>\n\n<pre><code>$ gvim -f</code></pre>\n\n<p>By default, GUI Vim will disconnect from the program that started Vim. With the &#39;-f&#39; option, GUI Vim will not disconnect from the program that started it.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help gui-fork</b></p>\n\n<p><b>:help -f</b></p>\n\n<h2 id=\"Why-does-the-Select-Font-dialog-doesnt-show-all-the-fonts-installed-in-my-system\">31.12. Why does the &quot;Select Font&quot; dialog doesn&#39;t show all the fonts installed in my system?</h2>\n\n<p>Vim supports only fixed width (mono-spaced) fonts. Proportional fonts are not supported. In the &quot;Select Font&quot; dialog, only fixed width fonts will be displayed.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help font-sizes</b></p>\n\n<p><b>:help &#39;guifont&#39;</b></p>\n\n<h2 id=\"How-do-I-use-the-mouse-in-Vim-command-line-mode\">31.13. How do I use the mouse in Vim command-line mode?</h2>\n\n<p>You can set the &quot;c&quot; flag in the &#39;mouse&#39; option to use mouse in the Vim command-line mode:</p>\n\n<pre><code>:set mouse+=c</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help mouse-using</b></p>\n\n<p><b>:help gui-mouse</b></p>\n\n<p><b>:help 09.2</b></p>\n\n<h2 id=\"When-I-use-the-middle-mouse-button-to-scroll-text-it-pastes-the-last-copied-text.-How-do-I-disable-this-behavior\">31.14. When I use the middle mouse button to scroll text, it pastes the last copied text. How do I disable this behavior?</h2>\n\n<p>You can map the middle mouse button to &lt;Nop&gt; to disable the middle mouse button:</p>\n\n<pre><code>:map  &lt;MiddleMouse&gt; &lt;Nop&gt;\n:map! &lt;MiddleMouse&gt; &lt;Nop&gt;</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help gui-mouse-mapping</b></p>\n\n<p><b>:help &lt;Nop</b>&gt;</p>\n\n<h2 id=\"How-do-I-change-the-location-and-size-of-a-GUI-Vim-window\">31.15. How do I change the location and size of a GUI Vim window?</h2>\n\n<p>You can use the `:winpos` command to change the Vim window position. To change the size of the window, you can modify the &#39;lines&#39; and &#39;columns&#39; options.</p>\n\n<p>For example, the following commands will position the GUI Vim window at the X,Y co-ordinates 50,50 and set the number of lines to 50 and the number of columns to 80.</p>\n\n<pre><code>:winpos 50 50\n:set lines=50\n:set columns=80</code></pre>\n\n<p>The arguments to the `:winpos` command specify the pixel co-ordinates of the Vim window. The &#39;lines&#39; and &#39;columns&#39; options specify the number of lines and characters to use for the height and the width of the window respectively.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 31.4</b></p>\n\n<p><b>:help :winpos</b></p>\n\n<p><b>:help &#39;lines&#39;</b></p>\n\n<p><b>:help &#39;columns&#39;</b></p>\n\n<p><b>:help GUIEnter</b></p>\n\n<h2 id=\"When-splitting-the-Vim-window-vertically-Vim-changes-the-position\">31.16. When splitting the Vim window vertically, Vim changes the position.</h2>\n\n<p>This is a known problem. When you are splitting the Vim window, Vim will try to draw a scrollbar. Since this changes the gui window, Vim tries to resize its main window to keep the same position and this will cause Vim to move its position. This happens on Windows with a multi-window setup or a window that was &quot;snapped&quot; to a certain position.</p>\n\n<p>A workaournd to this problem is, to remove gui scrollbars, e.g.</p>\n\n<pre><code>:set guioptions-=L</code></pre>\n\n<h1 id=\"VIM-ON-UNIX1\">VIM ON UNIX</h1>\n\n<h2 id=\"I-am-running-Vim-in-a-xterm.-When-I-press-the-CTRL-S-key-Vim-freezes.-What-should-I-do-now\">32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim freezes. What should I do now?</h2>\n\n<p>Many terminal emulators and real terminal drivers use the CTRL-S key to stop the data from arriving so that you can stop a fast scrolling display to look at it (also allowed older terminals to slow down the computer so that it did not get buffer overflows). You can start the output again by pressing the CTRL-Q key.</p>\n\n<p>When you press the CTRL-S key, the terminal driver will stop sending the output data. As a result of this, it will look like Vim is hung. If you press the CTRL-Q key, then everything will be back to normal.</p>\n\n<p>You can turn off the terminal driver flow control using the &quot;stty&quot; command:</p>\n\n<pre><code>$ stty -ixon -ixoff</code></pre>\n\n<p>or, you can change the keys used for the terminal flow control, using the following commands:</p>\n\n<pre><code>$ stty stop &lt;char&gt;\n$ stty start &lt;char&gt;</code></pre>\n\n<h2 id=\"I-am-seeing-weird-screen-update-problems-in-Vim.-What-can-I-do-to-solve-this-screen-display-update-problems\">32.2. I am seeing weird screen update problems in Vim. What can I do to solve this screen/display update problems?</h2>\n\n<p>You have to use a proper terminal emulator like xterm with correct TERM settings (TERM=xterm) and a correct terminfo/termcap file. For more information, read:</p>\n\n<p><b>:help &#39;term&#39;</b></p>\n\n<h2 id=\"I-am-using-the-terminal-console-version-of-Vim.-In-insertmode-When-I-press-the-backspace-key-the-character-before-the-cursor-is-not-erased.-How-do-I-configure-Vim-to-do-this\">32.3. I am using the terminal/console version of Vim. In insertmode, When I press the backspace key, the character before the cursor is not erased. How do I configure Vim to do this?</h2>\n\n<p>You have to make sure that Vim gets the correct keycode for the backpspace key. You can try using the command:</p>\n\n<pre><code>:fixdel</code></pre>\n\n<p>Make sure the TERM environment variable is set to the correct terminal name. You can try using the &quot;stty&quot; command:</p>\n\n<pre><code>$ stty erase ^H</code></pre>\n\n<p>where, you have to enter the ^H character by pressing the CTRL-V key and then the CTRL-H key. Also check the value of your &#39;backspace&#39; setting.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :fixdel</b></p>\n\n<p><b>:help Linux-backspace</b></p>\n\n<p><b>:help NetBSD-backspace</b></p>\n\n<p><b>:help &#39;backspace&#39;</b></p>\n\n<h2 id=\"I-am-using-Vim-in-a-xterm.-When-I-quit-Vim-the-screen-contents-are-restored-back-to-the-original-contents.-How-do-I-disable-this\">32.4. I am using Vim in a xterm. When I quit Vim, the screen contents are restored back to the original contents. How do I disable this?</h2>\n\n<p>The xterm has a capability called &quot;alternate screen&quot;. If this capability is present, vim switches to that alternate screen upon startup and back on exit, thus restoring the original screen contents. To disable this feature, add the following line to your .vimrc file:</p>\n\n<pre><code>:set t_ti= t_te=</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;restorescreen&#39;</b></p>\n\n<p><b>:help xterm-screens</b></p>\n\n<h2 id=\"When-I-start-Vim-it-takes-quite-a-few-seconds-to-start.-How-do-I-minimize-the-startup-time\">32.5. When I start Vim, it takes quite a few seconds to start. How do I minimize the startup time?</h2>\n\n<p>This may be related to Vim opening the X display for setting the xterm title and using the X clipboard. Make sure the DISPLAY variable is set to point to the correct host. Try using the command line:</p>\n\n<pre><code>$ vim -X</code></pre>\n\n<p>This will prevent Vim from opening the X display. With this command-line option, the X clipboard cannot be used and also Vim will not be able to change the xterm title.</p>\n\n<p>You can also set the &#39;clipboard&#39; option to</p>\n\n<pre><code>:set clipboard=exclude:.*</code></pre>\n\n<p>This has the same effect as using the -X command-line argument.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help -X</b></p>\n\n<p><b>:help &#39;clipboard&#39;</b></p>\n\n<p>If the clipboard is not the cause of the slow startup, it might be a plugin that slows down Vim. In that case, you can use the --startuptime argument to debug this further. You can do:</p>\n\n<pre><code>$ vim --startuptime vim_startup.log</code></pre>\n\n<p>and the timing will be written to the file vim_startup.log. For even more advanced profiling, you can use the profiling feature, that is available in huge builds of Vim. To do so, call Vim like this:</p>\n\n<pre><code>$ vim --cmd &#39;profile start profile.log&#39; \\\n  --cmd &#39;profile func *&#39; \\\n  --cmd &#39;profile file *&#39; \\\n  -c &#39;profdel func *&#39; \\\n  -c &#39;profdel file *&#39; \\\n  -c &#39;qa!&#39;</code></pre>\n\n<p>After running this, you will have a file profile.log in your current directory. To further analyse this, open the file profile.log and run:</p>\n\n<pre><code>&quot; Open profile.log file in vim first\n:let timings=[]\n:g/^SCRIPT/call add(timings, [getline(&#39;.&#39;)[len(&#39;SCRIPT  &#39;):], matchstr(getline(line(&#39;.&#39;)+1), &#39;^Sourced \\zs\\d\\+&#39;)]+map(getline(line(&#39;.&#39;)+2, line(&#39;.&#39;)+3), &#39;matchstr(v:val, &#39;&#39;\\d\\+\\.\\d\\+$&#39;&#39;)&#39;))\n:enew\n:call setline(&#39;.&#39;, [&#39;count total (s)   self (s)  script&#39;]+map(copy(timings), &#39;printf(&quot;%5u %9s   %8s  %s&quot;, v:val[1], v:val[2], v:val[3], v:val[0])&#39;))</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help --startuptime</b></p>\n\n<p><b>:help profiling</b></p>\n\n<h2 id=\"How-can-I-make-the-cursor-in-gvim-in-unix-stop-blinking\">32.6. How can I make the cursor in gvim in unix stop blinking?</h2>\n\n<p>You can modify the &#39;guicursor&#39; option, to stop the cursor from blinking. For example:</p>\n\n<pre><code>:set guicursor=a:blinkon0</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;guicursor&#39;</b></p>\n\n<h2 id=\"How-do-I-change-the-menu-font-on-GTK-Vim\">32.7. How do I change the menu font on GTK Vim?</h2>\n\n<p>You can modify the ~/.gtkrc file to change the menu font on GTK Vim. For example:</p>\n\n<pre><code>style &quot;default&quot;\n{ font =&quot;smooth09&quot; }\nclass &quot;*&quot; style &quot;default&quot;</code></pre>\n\n<p>The last line changes the font of all widgets.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help gui-gtk</b></p>\n\n<h2 id=\"How-do-I-prevent-CTRL-Z-from-suspending-Vim\">32.8. How do I prevent CTRL-Z from suspending Vim?</h2>\n\n<p>You can map CTRL-Z to prevent the suspending. Here are some suggestions:</p>\n\n<p>- Make CTRL-Z do nothing:</p>\n\n<pre><code>:map &lt;C-Z&gt; &lt;Nop&gt;</code></pre>\n\n<p>- Make CTRL-Z start a shell:</p>\n\n<pre><code>:map &lt;C-Z&gt; :shell&lt;CR&gt;</code></pre>\n\n<p>- Make CTRL-Z give an error message:</p>\n\n<pre><code>:map &lt;C-Z&gt; :&quot;suspending disabled&lt;CR&gt;</code></pre>\n\n<p>For the last example, the double quote is necessary in order to keep the message on the status line.</p>\n\n<h2 id=\"When-I-kill-the-xterm-running-Vim-the-Vim-process-continues-to-run-and-takes-up-a-lot-of-CPU-99-time.-Why-is-this-happening\">32.9. When I kill the xterm running Vim, the Vim process continues to run and takes up a lot of CPU (99%) time. Why is this happening?</h2>\n\n<p>When Vim is built with support for Python interface, you will have this problem. This is a known problem with the python thread library and Vim. To solve this problem, use a Vim binary built without the Python interface.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help +python</b></p>\n\n<p><b>:help python</b></p>\n\n<h2 id=\"How-do-I-get-the-Vim-syntax-highlighting-to-work-in-a-Unix-terminal\">32.10. How do I get the Vim syntax highlighting to work in a Unix terminal?</h2>\n\n<p>The easiest and simplest way to get Vim syntax highlighting is to use the GUI version of Vim (GVIM). To get syntax highlighting to work in the console/terminal version of Vim, you have to run a terminal emulator (like Xfree86 xterm or rxvt or dtterm) that supports color. Note that if a terminal emulator supports changing the background and foreground colors, that does not mean that it also supports ANSI escape sequences for changing the color. You can download the latest version of Xfree86 xterm from https://invisible-island.net/xterm/xterm.html You can download the latest version of rxvt from https://rxvt.org You have to install the terminfo/termcap file that supports colors for the terminal emulator. Also, set the TERM environment variable to the correct name of the term that supports colors.</p>\n\n<p>You can use the colortest.vim script supplied with the Vim runtime package to test the color setup. To use this script, follow these steps:</p>\n\n<pre><code>:e $VIMRUNTIME/syntax/colortest.vim\n:source %</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help 06.2</b></p>\n\n<p><b>:help terminal-colors</b></p>\n\n<p><b>:help termcap-colors</b></p>\n\n<p><b>:help startup-terminal</b></p>\n\n<p><b>:help xterm-color</b></p>\n\n<p><b>:help colortest.vim</b></p>\n\n<h1 id=\"VIM-ON-MS-WINDOWS1\">VIM ON MS-WINDOWS</h1>\n\n<h2 id=\"In-MS-Windows-CTRL-V-doesnt-start-the-blockwise-visual-mode.-What-happened\">33.1. In MS-Windows, CTRL-V doesn&#39;t start the blockwise visual mode. What happened?</h2>\n\n<p>The mswin.vim script provides key mappings and options to make Vim behave like a MS-Windows application. One of the keys mapped is CTRL-V which is used for pasting text in MS-Windows applications. This will disable the use of CTRL-V to start the blockwise visual mode. The mswin.vim script maps CTRL-Q for staring the blockwise visual mode. So you can use CTRL-Q instead of CTRL-V.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help CTRL-V</b></p>\n\n<p><b>:help CTRL-V-alternative</b></p>\n\n<p><b>:help CTRL-Q</b></p>\n\n<p><b>:help 10.5</b></p>\n\n<h2 id=\"When-I-press-the-CTRL-Y-key-it-acts-like-the-CTRL-R-key.-How-do-I-configure-Vim-to-treat-CTRL-Y-as-CTRL-Y\">33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do I configure Vim to treat CTRL-Y as CTRL-Y?</h2>\n\n<p>The mapping of the CTRL-Y key to the CTRL-R key is done by the mswin.vim script. The mswin.vim script maps CTRL-Y to make Vim behave like a standard MS-Windows application. This is explained in `:help CTRL-Y`. You can either comment out the line in mswin.vim that maps the CTRL-Y key or you can remove the line in your .vimrc file that sources the mswin.vim script.</p>\n\n<h2 id=\"How-do-I-start-GUI-Vim-in-a-maximized-window-always\">33.3. How do I start GUI Vim in a maximized window always?</h2>\n\n<p>You can use the `:simalt` command to maximize the Vim window. You can use the GUIEnter autocmd to maximize the Vim window on startup:</p>\n\n<pre><code>autocmd GUIEnter * simalt ~x</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :simalt</b></p>\n\n<p><b>:help GUIEnter</b></p>\n\n<p><b>:help gui-win32-maximized</b></p>\n\n<h2 id=\"After-doing-some-editing-operations-Vim-freezes.-The-cursor-becomes-an-empty-rectangle.-I-am-not-able-enter-any-characters.-What-is-happening\">33.4. After doing some editing operations, Vim freezes. The cursor becomes an empty rectangle. I am not able enter any characters. What is happening?</h2>\n\n<p>Most probably, you used the mouse wheel to scroll the text in Vim. There is a known problem in using intellimouse mouse wheel with Vim. To avoid this problem, disable Universal scrolling support for Vim.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help intellimouse-wheel-problems</b></p>\n\n<h2 id=\"I-am-using-Windows-XP-the-display-speed-of-maximized-GVim-is-very-slow.-What-can-I-do-to-speed-the-display-updates\">33.5. I am using Windows XP, the display speed of maximized GVim is very slow. What can I do to speed the display updates?</h2>\n\n<p>This may be due to the fact that you have enabled &#39;Smooth edges of screen fonts&#39; in the display properties. Try turning off font smoothing or try changing the smoothing method to &quot;Standard&quot;.</p>\n\n<h2 id=\"What-are-the-recommended-settings-for-using-Vim-with-cygwin\">33.6. What are the recommended settings for using Vim with cygwin?</h2>\n\n<p>You may want to set the following shell related Vim settings:</p>\n\n<pre><code>:set shellcmdflag=-c\n:set shellquote=\n:set shellslash          &quot; Use the forward slash for expansion.\n:set shellxquote=\\&quot;\n:set shell=d:\\cygwin\\bin\\bash.exe &quot; Use the bash shell\n:set shellpipe=2&gt;&amp;1| tee\n:set shellredir=&gt;%s 2&gt;&amp;1</code></pre>\n\n<h2 id=\"I-am-trying-to-use-GNU-diff-with-Vim-diff-mode.-When-I-run-the-diff-from-command-line-it-works.-When-I-try-to-use-the-diff-with-Vim-it-doesnt-work.-What-should-I-do-now\">33.7. I am trying to use GNU diff with Vim diff mode. When I run the diff from command line, it works. When I try to use the diff with Vim it doesn&#39;t work. What should I do now?</h2>\n\n<p>There is a problem with using GNU diff with Vim. You can try using the GNU diff.exe built by Ron Aaron from the following link:</p>\n\n<pre><code> http://www.mossbayeng.com/~ron/vim/builds.html\n(This page no longer exists.)</code></pre>\n\n<h2 id=\"Is-it-possible-to-use-Vim-as-an-external-editor-for-MS-Windows-Outlook-email-client\">33.8. Is it possible to use Vim as an external editor for MS-Windows Outlook email client?</h2>\n\n<p>You can use the &quot;cubiclevim&quot; COM Add-In to use Vim as an external editor for MS-Windows Outlook email client. Visit the following URL for more information:</p>\n\n<pre><code>https://sourceforge.net/projects/cubiclevim/</code></pre>\n\n<p>Note, that currently this works only with MS-Office 2000 and XP.</p>\n\n<p>Also the plugin OutlookVim might be worth a look:</p>\n\n<pre><code>https://www.vim.org/scripts/script.php?script_id=3087</code></pre>\n\n<h2 id=\"I-am-using-Vim-to-edit-HTML-files.-How-do-I-start-internet-explorer-with-the-current-file-to-preview-the-HTML-file\">33.9. I am using Vim to edit HTML files. How do I start internet explorer with the current file to preview the HTML file?</h2>\n\n<p>You can use the following command:</p>\n\n<pre><code>:!start c:\\progra~1\\intern~1\\iexplore.exe file://%:p&lt;CR&gt;</code></pre>\n\n<h2 id=\"I-would-like-to-use-Vim-with-Microsoft-Visual-Studio.-How-do-I-do-this\">33.10. I would like to use Vim with Microsoft Visual Studio. How do I do this?</h2>\n\n<p>You have to download and use the OLE version of Vim (for example: gvim61ole.zip). This file also contains instructions on how to use Vim with Visual Studio.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help MSVisualStudio</b></p>\n\n<h2 id=\"Where-do-I-place-the-_vimrc-and-_gvimrc-files\">33.11. Where do I place the _vimrc and _gvimrc files?</h2>\n\n<p>You can place the _vimrc and _gvimrc files under the directory pointed to by the VIM environment variable. If you are sharing this system with other users, then you can place the files in a directory and set the HOME environment variable to this directory.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help $HOME-use</b></p>\n\n<p><b>:help _vimrc</b></p>\n\n<h2 id=\"Every-time-I-save-a-file-Vim-warns-about-the-file-being-changed-outside-of-Vim.-Why\">33.12. Every time I save a file, Vim warns about the file being changed outside of Vim. Why?</h2>\n\n<p>If you get the following warning message, every time you save a file:</p>\n\n<pre><code>WARNING: The file has been changed since reading it!!!\nDo you really want to write to it (y/n)?</code></pre>\n\n<p>then this problem could be related to a bug in MS-Windows on the day daylight saving time starts. Vim remembers the timestamp of the file after it was written. Just before the next write the timestamp is obtained again to check if the file was changed outside of Vim. This works correctly, except on the day daylight saving time starts.</p>\n\n<p>This problem will go away the next day after the day the daylight saving time starts.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help W11</b></p>\n\n<h1 id=\"PRINTING1\">PRINTING</h1>\n\n<h2 id=\"How-do-I-print-a-file-along-with-line-numbers-for-all-the-lines\">34.1. How do I print a file along with line numbers for all the lines?</h2>\n\n<p>You can set the &#39;printoptions&#39; option and use the `:hardcopy` command to print your file:</p>\n\n<pre><code>:set printoptions=number:y\n:hardcopy</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;printoptions&#39;</b></p>\n\n<p><b>:help :hardcopy</b></p>\n\n<h2 id=\"How-do-I-print-a-file-with-the-Vim-syntax-highlighting-colors\">34.2. How do I print a file with the Vim syntax highlighting colors?</h2>\n\n<p>You can use the `:hardcopy` command to print a file with the Vim syntax highlighting colors. You can also convert your file to a HTML file using the 2html.vim script and print the HTML file.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help syntax-printing</b></p>\n\n<p><b>:help 2html.vim</b></p>\n\n<p><b>:help :hardcopy</b></p>\n\n<p><b>:help printing</b></p>\n\n<h1 id=\"BUILDING-VIM-FROM-SOURCE1\">BUILDING VIM FROM SOURCE</h1>\n\n<h2 id=\"How-do-I-build-Vim-from-the-sources-on-a-Unix-system\">35.1. How do I build Vim from the sources on a Unix system?</h2>\n\n<p>For a Unix system, follow these steps to build Vim from the sources:</p>\n\n<p>- Download the source from the git repository: https://github.com/vim/vim/releases/ - Alternatively, download the source from the mercurial repository: https://bitbucket.org/vim-mirror/vim/downloads/ - Run the &quot;make&quot; command to configure and build Vim with the default configuration. - Run &quot;make install&quot; command to install Vim in the default directory.</p>\n\n<p>To enable/disable various Vim features, before running the &quot;make&quot; command you can run the &quot;configure&quot; command with different flags to include/exclude the various Vim features. To list all the available options for the &quot;configure&quot; command, use:</p>\n\n<pre><code>$ configure --help</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help install</b></p>\n\n<h2 id=\"How-do-I-install-Vim-in-my-home-directory-or-a-directory-other-than-the-default-installation-directory-in-Unix\">35.2. How do I install Vim in my home directory or a directory other than the default installation directory in Unix?</h2>\n\n<p>To install Vim in a directory other than the default installation directory, you have to specify the directory using the --prefix option while running the configure script.</p>\n\n<pre><code>$ ./configure --prefix=/users/xyz</code></pre>\n\n<p>You can enable/disable various Vim feature by supplying different arguments to the configure script. For more information about all these options, run:</p>\n\n<pre><code>$ ./configure --help</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help install-home</b></p>\n\n<p><b>:help install</b></p>\n\n<h2 id=\"How-do-I-build-Vim-from-the-sources-on-a-MS-Windows-system\">35.3. How do I build Vim from the sources on a MS-Windows system?</h2>\n\n<p>For a MS-Windows system, Vim can be built using either the Visual C++ compiler or the Borland C++ compiler or the Ming GCC compiler or the cygwin gcc compiler. Follow these steps to build Vim from the sources for MS-Windows: - download the source from the git repository: https://github.com/vim/vim/releases/ - Depending on the installed compiler, you can use the corresponding makefile to build the Vim sources. For Visual C++ use the Make_mvc.mak makefile, for borland C++ use the Make_bc5.mak makefile, for ming GCC use the Make_ming.mak makefile, for cygwin gcc use the Make_cyg.mak makefile.</p>\n\n<p>Depending on whether you want to build the GUI version of Vim or the console version of Vim, you have to pass different arguments to the makefiles. After successfully building the sources, you can copy the vim.exe or gvim.exe file to the desired directory along with the files from the runtime archive.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help install</b></p>\n\n<h2 id=\"The-Vim-help-syntax-indent-files-are-missing-from-my-Vim-installation.-How-do-I-install-these-files\">35.4. The Vim help, syntax, indent files are missing from my Vim installation. How do I install these files?</h2>\n\n<p>The Vim help, syntax, indent and other runtime files are part of the Vim runtime package. You need to download and install the Vim runtime package. For example, for MS-Windows, the name of the Vim 6.1 runtime package is vim61rt.zip.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help install</b></p>\n\n<h2 id=\"I-have-built-Vim-from-the-source-and-installed-the-Vim-package-using-make-install.-Do-I-need-to-keep-the-Vim-source-directory\">35.5. I have built Vim from the source and installed the Vim package using &quot;make install&quot;. Do I need to keep the Vim source directory?</h2>\n\n<p>No. Once you have built and installed Vim in some directory other than the original source directory (for example, /usr/bin or /usr/local/bin), then you can remove the source directory.</p>\n\n<h2 id=\"How-do-I-determine-the-Vim-features-which-are-enabled-at-compile-time\">35.6. How do I determine the Vim features which are enabled at compile time?</h2>\n\n<p>You can use the `:version` command to determine the Vim features that are enabled at compile time. The features that are enabled will be prefixed with a &quot;+&quot;. The features that are not enabled will be prefixed with a &quot;-&quot;.</p>\n\n<p>If you want to test for a feature in a script, you can use the has() function:</p>\n\n<pre><code>if has(&quot;menu&quot;)\n    &quot; Set up some menus\nendif</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :version</b></p>\n\n<p><b>:help +feature-list</b></p>\n\n<p><b>:help has()</b></p>\n\n<h2 id=\"Can-I-build-Vim-without-the-GUI-support\">35.7. Can I build Vim without the GUI support?</h2>\n\n<p>Yes. You can build Vim by optionally enabling/disabling many of the features including GUI.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help install</b></p>\n\n<h2 id=\"When-building-Vim-on-a-Unix-system-I-am-getting-undefined-reference-to-term_set_winsize-error.-How-do-I-resolve-this-error\">35.8. When building Vim on a Unix system, I am getting &quot;undefined reference to term_set_winsize&quot; error. How do I resolve this error?</h2>\n\n<p>You will get this error when the build process is not able to locate the termlib, termcap or ncurses library. You have to install the ncurses-dev package to resolve this error.</p>\n\n<h2 id=\"Vim-configure-keeps-complaining-about-the-lack-of-gtk-config-while-trying-to-use-GTK-2.03.-This-is-correct-since-in-GTK-2-they-moved-to-using-the-generic-pkg-config.-I-can-get-pkg-config-to-list-the-various-includes-and-libs-for-gtk-but-for-some-reason-the-configure-script-still-isnt-picking-this-up\">35.9. Vim configure keeps complaining about the lack of gtk-config while trying to use GTK 2.03. This is correct, since in GTK 2 they moved to using the generic pkg-config. I can get pkg-config to list the various includes and libs for gtk, but for some reason the configure script still isn&#39;t picking this up.</h2>\n\n<p>Use the following shell script named gtk-config:</p>\n\n<pre><code>#!/bin/sh\npkg-config gtk+-2.0 $1 $2</code></pre>\n\n<h2 id=\"I-did-successfully-download-the-sources-and-compiled-Vim-on-Unix.-But-feature-...-still-does-not-work.-What-is-wrong-and-how-can-I-fix-it\">35.10. I did successfully download the sources and compiled Vim on Unix. But feature ... still does not work. What is wrong and how can I fix it?</h2>\n\n<p>You should first check, that you are actually running your self compiled Vim and not the system&#39;s provided version. So first check your $PATH setting.</p>\n\n<p>Depending on your compile options, some features might not be included in your build of Vim. You can use the `:version` command to determine the Vim features that are enabled at compile time. The features that are enabled will be prefixed with a &quot;+&quot;. The features that are not enabled will be prefixed with a &quot;-&quot;.</p>\n\n<p>The easiest way to include all features is to build the huge version. To do this, you have to specify the --with-features option while running the configure script:</p>\n\n<pre><code>$ ./configure --with-features=huge</code></pre>\n\n<p>Nevertheless, a feature could still be disabled at compile time, if the configure script can&#39;t find the required libraries for those features (e.g. for clipboard integration, your Vim needs to be linked against the X11 development libraries).</p>\n\n<p>There are several ways to install the required libraries:</p>\n\n<p>1) On a Debian based distribution, you can use the package manager &quot;apt&quot; to install all required dependencies. As superuser, run the command:</p>\n\n<pre><code>$ apt-get build-dep vim-gtk\n\nThis makes sure all required libraries needed to compile the vim-gtk\npackage will be installed. (This requires, that your sources list\ncontains deb-src entries. See your distribution manual on how to\nenable this, if the above command did not work.)</code></pre>\n\n<p>2) In openSUSE you can use the package manager &quot;zypper&quot; to install all required libraries. This requires, that there is a source version of the package installable from a configured repository (which by default is not the case). Use:</p>\n\n<pre><code>$ zypper search -t srcpackage vim\n\nto find out, whether or not there exists a source version in the\nrepository. If there is none, you&#39;ll need to add a source repository.\nFor openSUSE 11.2 you could use, e.g.\n\n$ zypper ar\nhttp://download.opensuse.org/source/distribution/11.2/repo/oss/src-11.2\n\n(one line)\n\nOnce you have a source version available in your repositories, use\nthis command to install all needed requirements:\n\n$ zypper source-install --build-deps-only vim</code></pre>\n\n<p>3) On a Fedora/RedHat based system, you can use</p>\n\n<pre><code>$ yum-builddep vim-enhanced</code></pre>\n\n<p>4) Run configure with your options and watch for missing libraries:</p>\n\n<pre><code>  $ ./configure --with-features=huge 2&gt;&amp;1 |tee logfile\n\n  This will run configure and record the output into the file &quot;logfile&quot;.\n  You need to check the logfile for missing dependencies. Consider this\n  output:\n\nchecking --disable-gtktest argument... gtk test enabled\nchecking for pkg-config... /usr/bin/pkg-config\nchecking for GTK - version &gt;= 2.2.0... no\n\nHere you can see, that the gtk libraries are missing and therefore\nno GTK gui version can&#39;t be build. So you need to install the GTK\nlibrary in your system, with your package manager or by compiling it\nyourself. Then run the configure script again and check, that it\nfinds the library.</code></pre>\n\n<p>In theory, those provided dependencies by your distribution might still lack some libraries, that are needed for features, that simply are not enabled in your distribution and therefore those commands in 1-3 won&#39;t install it. At the very least, this provides a jumping point and you need to track down the required missing packages using method 4 from above. But usually, this works good enough for most people and you won&#39;t have to bother with the fourth method.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :version</b></p>\n\n<p><b>:help +feature-list</b></p>\n\n<h1 id=\"VARIOUS1\">VARIOUS</h1>\n\n<h2 id=\"How-do-I-edit-binary-files-with-Vim\">36.1. How do I edit binary files with Vim?</h2>\n\n<p>You can set the following options to edit binary files in Vim:</p>\n\n<pre><code>:set binary\n:set display=uhex</code></pre>\n\n<p>You can also use the &quot;-b&quot; command-line option to edit a binary file:</p>\n\n<pre><code>$ vim -b &lt;binary_file_name&gt;</code></pre>\n\n<p>You can also use the xxd utility (part of the Vim distribution) to edit binary files.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 23.4</b></p>\n\n<p><b>:help edit-binary</b></p>\n\n<p><b>:help hex-editing</b></p>\n\n<p><b>:help -b</b></p>\n\n<p><b>:help &#39;binary&#39;</b></p>\n\n<p><b>:help &#39;endofline&#39;</b></p>\n\n<p><b>:help &#39;display&#39;</b></p>\n\n<h2 id=\"How-do-I-disable-the-visual-error-flash-and-the-error-beep\">36.2. How do I disable the visual error flash and the error beep?</h2>\n\n<p>You can disable both the visual error flash and the error beep using the following command:</p>\n\n<pre><code>:set visualbell t_vb=</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;visualbell&#39;</b></p>\n\n<p><b>:help &#39;errorbells&#39;</b></p>\n\n<p><b>:help t_vb</b></p>\n\n<h2 id=\"How-do-I-display-the-ascii-value-of-a-character-displayed-in-a-buffer\">36.3. How do I display the ascii value of a character displayed in a buffer?</h2>\n\n<p>You can use the &quot;ga&quot; command to display the ascii value of a displayed character.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help ga</b></p>\n\n<p><b>:help :ascii</b></p>\n\n<h2 id=\"Can-I-use-zero-as-a-count-for-a-Vim-command\">36.4. Can I use zero as a count for a Vim command?</h2>\n\n<p>You cannot use zero as a count for a Vim command, as &quot;0&quot; is a command on its own, moving to the first column of the line.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help 0</b></p>\n\n<p><b>:help count</b></p>\n\n<h2 id=\"How-do-I-disable-the-Vim-welcome-screen\">36.5. How do I disable the Vim welcome screen?</h2>\n\n<p>You can disable the Vim welcome screen, by adding the &quot;I&quot; flag to the &#39;shortmess&#39; option:</p>\n\n<pre><code>:set shortmess+=I</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :intro</b></p>\n\n<p><b>:help &#39;shortmess&#39;</b></p>\n\n<h2 id=\"How-do-I-avoid-the-hit-enter-to-continue-prompt\">36.6. How do I avoid the &quot;hit enter to continue&quot; prompt?</h2>\n\n<p>Vim will prompt you with the &quot;hit enter to continue&quot; prompt, if there are some messages on the screen for you to read and the screen is about to be redrawn. You can add the &quot;T&quot; flag to the &#39;shortmess&#39; option to truncate all messages. This will help in avoiding the hit-enter prompt:</p>\n\n<pre><code>:set shortmess+=T</code></pre>\n\n<p>You can also increase the command height by setting the &#39;cmdheight&#39; option:</p>\n\n<pre><code>:set cmdheight=2</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help hit-enter</b></p>\n\n<p><b>:help avoid-hit-enter</b></p>\n\n<p><b>:help &#39;shortmess&#39;</b></p>\n\n<p><b>:help &#39;cmdheight&#39;</b></p>\n\n<h2 id=\"How-do-I-invoke-Vim-from-command-line-to-run-a-group-of-commands-on-a-group-of-files\">36.7. How do I invoke Vim from command line to run a group of commands on a group of files?</h2>\n\n<p>There are several ways to invoke Vim from command line to run a group of commands on a group of files. You can use a set of &quot;-c&quot; command line options to specify a group of commands:</p>\n\n<pre><code>$ vim -c &quot;&lt;ex_command_1&gt;&quot; -c &quot;&lt;ex_command_2&gt;&quot; *.txt</code></pre>\n\n<p>Each of the ex-command specified with the &quot;-c&quot; command line option is executed one by one sequentially. You can also use a single &quot;-c&quot; command line option and the &quot;|&quot; character to separate the ex commands:</p>\n\n<pre><code>$ vim -c &quot;&lt;ex_command_1&gt; | &lt;ex_command_2&gt;&quot; *.txt</code></pre>\n\n<p>In the above command, if an ex command fails, then all the remaining ex commands will not be executed.</p>\n\n<p>For example, to replace &quot;ABC&quot; with &quot;DEF&quot; in a file from the command-line, you can use the following command:</p>\n\n<pre><code>$ vim -c &quot;%s/ABC/DEF/ge | update&quot; myfile.txt</code></pre>\n\n<p>To replace &quot;ABC&quot; with &quot;DEF&quot; in multiple files from the command-line, you can use the following command:</p>\n\n<pre><code>$ vim -c &quot;argdo %s/ABC/DEF/ge | update&quot; *.txt</code></pre>\n\n<p>You can store the group of commands into a file and use the &quot;-s&quot; command line option to run the commands on a set of files. For example, if the group of commands are stored in the file mycmds.txt, then you can use the following command:</p>\n\n<pre><code>$ vim -s mycmds.txt *.pl</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help -c</b></p>\n\n<p><b>:help -s</b></p>\n\n<h2 id=\"How-do-I-use-a-normal-mode-command-from-insert-mode-without-leaving-the-insert-mode\">36.8. How do I use a normal mode command from insert mode without leaving the insert mode?</h2>\n\n<p>You can use a normal command from insert mode, without leaving the insert mode, by first pressing the CTRL-O key and then follow that with a single normal mode command.</p>\n\n<p>To execute more than one normal mode command, press the CTRL-L key, followed by any number of normal mode commands and then press &lt;Esc&gt; to get back to the insert mode. (This only works, when the &#39;insertmode&#39; option is set).</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help i_CTRL-O</b></p>\n\n<p><b>:help i_CTRL-L</b></p>\n\n<h2 id=\"How-do-I-start-Vim-in-insert-mode\">36.9. How do I start Vim in insert mode?</h2>\n\n<p>You can start Vim in insert mode using the `:startinsert` ex command.</p>\n\n<pre><code>$ vim +startinsert myfile.txt</code></pre>\n\n<p>The above command will open the file &quot;myfile.txt&quot; and start insert mode with the cursor in front of the first character on the first line. To open the file and start appending after the last character on the last line, you can use the following command:</p>\n\n<pre><code>$ vim + +startinsert! myfile.txt</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help :startinsert</b></p>\n\n<h2 id=\"How-do-I-use-Copy-and-Paste-with-Vim\">36.10. How do I use Copy and Paste with Vim?</h2>\n\n<p>You should first check the output of the `:version` command and make sure that +xterm-clipboard is present.</p>\n\n<p>When running Vim in an xterm, you can either let Vim control the mouse or let xterm control the mouse. This is configured by the &#39;mouse&#39; option.</p>\n\n<p>If the &#39;mouse&#39; option is not set (or set to the default value), then Vim will not control the mouse. You cannot move the Vim text cursor using the mouse. When you select some text using the mouse, xterm will copy it to the X11 cut buffer. When you press both the mouse buttons, xterm will paste the text from the cut buffer.</p>\n\n<p>If the &#39;mouse&#39; option is set to &quot;a&quot; or some other value, then Vim controls the mouse. The mode (normal or insert or visual, etc) in which Vim controls the mouse is configured by the &#39;mouse&#39; option. You can move the Vim text cursor using the mouse. When you select some text, the &#39;clipboard&#39; option setting is used to determine whether to transfer the selected text to the clipboard or not. The default setting is to transfer the selected text to the clipboard. If you want to use the xterm selection mechanism in this mode, then you can press the &lt;Shift&gt; key. If you press &lt;Shift&gt; key when selecting text using the mouse, then Vim doesn&#39;t control the mouse and xterm controls the mouse.</p>\n\n<p>In the GUI mode, Copy and Paste should just work, depending on the &#39;mouse&#39; setting. For more information, read:</p>\n\n<p><b>:help &#39;clipboard&#39;</b></p>\n\n<p><b>:help x11-selection</b></p>\n\n<p><b>:help clipboard</b></p>\n\n<p><b>:help &#39;go-a&#39;</b></p>\n\n<p><b>:help &#39;mouse&#39;</b></p>\n\n<p><b>:help xterm-copy-paste</b></p>\n\n<p><b>:help 09.3</b></p>\n\n<h2 id=\"Why-shouldnt-I-modify-the-files-in-the-system-runtime-directory\">36.11. Why shouldn&#39;t I modify the files in the system runtime directory?</h2>\n\n<p>Just be careful about modifying files under $VIMRUNTIME, which usually is /usr/share/vim/vimXX (Unix) or C:\\Program Files\\vim\\vimXX (Windows) and XX being the version for which it applies, e.g. 73 for Vim =head2 7.3.</p>\n\n<p>One should generally avoid modifying those files because they may be replaced during an upgrade of your Vim installation and your changes will be lost. Also, if you upgrade to a new major or minor revision of Vim (e.g., from 7.3 to 7.4), the new version of Vim will use a different $VIMRUNTIME directory and while your changes won&#39;t be lost, they will be ignored.</p>\n\n<p>Consequently, take a look at</p>\n\n<p><b>:help filetypes</b></p>\n\n<p>for an explanation of several ways to modify Vim&#39;s response to different filetypes and where to put those modifications so that they will not be overwritten.</p>\n\n<h1 id=\"UNICODE1\">UNICODE</h1>\n\n<p>Author: Tony Mechelynck &lt;antoine.mechelynck AT belgacom.net&gt;</p>\n\n<h2 id=\"Is-it-possible-to-create-Unicode-files-using-Vim\">37.1. Is it possible to create Unicode files using Vim?</h2>\n\n<p>Yes. It may be more or less complicated depending on the keyboard and fonts available to you, but it is always possible to encode any possible Unicode codepoint (and some illegal ones) into a file. To create a Unicode file using Vim, you should have compiled Vim with the &quot;+multi_byte&quot; compile-time option. You can get more information about Unicode from the following sites:</p>\n\n<pre><code>http://www.unicode.org\nhttps://www.cl.cam.ac.uk/~mgk25/unicode.html</code></pre>\n\n<p>For more information, read:</p>\n\n<p><b>:help multibyte</b></p>\n\n<p><b>:help usr_45.txt</b></p>\n\n<h2 id=\"Which-Vim-settings-are-particularly-important-for-editing-Unicode-files\">37.2. Which Vim settings are particularly important for editing Unicode files?</h2>\n\n<p>The most important are the various &quot;encoding&quot; options, i.e., &#39;encoding&#39;, &#39;fileencoding&#39;, &#39;fileencodings&#39; and &#39;termencoding&#39;. The boolean option &#39;bomb&#39; is also significant.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;encoding&#39;</b></p>\n\n<p><b>:help &#39;fileencoding&#39;</b></p>\n\n<p><b>:help &#39;fileencodings&#39;</b></p>\n\n<p><b>:help &#39;termencoding&#39;</b></p>\n\n<p><b>:help &#39;bomb&#39;</b></p>\n\n<h2 id=\"What-is-the-encoding-option\">37.3. What is the &#39;encoding&#39; option?</h2>\n\n<p>Basically, the &#39;encoding&#39; option defines how Vim will represent your data internally. However, all Unicode encodings are represented internally as utf-8 and converted (if necessary) when reading and writing.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;encoding&#39;</b></p>\n\n<h2 id=\"How-does-Vim-name-the-various-Unicode-encodings\">37.4. How does Vim name the various Unicode encodings?</h2>\n\n<p>Utf-8 is called utf-8 or utf8; utf-16 is called ucs-2 or ucs2; utf-32 is called ucs-4 or ucs4. Also, you may specify endianness (except for utf-8 which does not vary for endianness) by appending le for little-endian or be for big-endian. If you create a file with an encoding of ucs-2 or ucs-4 without specifying endianness, Vim will use what is typical of your machine.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help encoding-names</b></p>\n\n<p><b>:help encoding-values</b></p>\n\n<p><b>:help encoding-table</b></p>\n\n<h2 id=\"How-does-Vim-specify-the-presence-or-absence-of-a-byte-order-mark\">37.5. How does Vim specify the presence or absence of a byte-order mark?</h2>\n\n<p>When reading a file, if the &#39;fileencodings&#39; option includes &quot;ucs-bom&quot;, Vim will check for a byte-order mark. When writing a file, if the &#39;bomb&#39; option is set, Vim will write a byte-order mark on files whose encoding warrants it.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;fileencodings&#39;</b></p>\n\n<p><b>:help &#39;bomb&#39;</b></p>\n\n<h2 id=\"What-is-the-fileencoding-option\">37.6. What is the &#39;fileencoding&#39; option?</h2>\n\n<p>The &#39;fileencoding&#39; option defines the particular encoding which Vim will use to write a file. If empty, then the value of the &#39;encoding&#39; option is the default.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;fileencoding&#39;</b></p>\n\n<h2 id=\"What-is-the-fileencodings-option\">37.7. What is the &#39;fileencodings&#39; option?</h2>\n\n<p>The &#39;fileencodings&#39; option defines the heuristics used by Vim when opening an existing file. It is a comma separated list of encodings. A special name, &quot;ucs-bom&quot; is used to indicate that Vim should check for the presence of a byte-order mark; however, it will not be recognised if it comes after &quot;utf-8&quot;. Normally, &quot;ucs-bom&quot; (if present) should be first in the list.</p>\n\n<p>When Vim opens a file, it checks it against the encodings listed in &#39;fileencodings&#39;. The first one that matches is used. If there is no match, then Vim sets &#39;fileencoding&#39; to the null string, i.e., the value of &#39;encoding&#39; will be used.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;fileencodings&#39;</b></p>\n\n<p><b>:help &#39;encoding&#39;</b></p>\n\n<h2 id=\"What-is-the-termencoding-option\">37.8. What is the &#39;termencoding&#39; option?</h2>\n\n<p>The &#39;termencoding&#39; option defines how your keyboard encodes the data you type. If empty, Vim assumes that it has the same value as &#39;encoding&#39;. Usually it should be set to something that matches your locale.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;termencoding&#39;</b></p>\n\n<p><b>:help locale</b></p>\n\n<h2 id=\"What-is-the-bomb-option\">37.9. What is the &#39;bomb&#39; option?</h2>\n\n<p>When reading a file with &quot;ucs-bom&quot; present in the &#39;fileencodings&#39; option, Vim will set the &#39;bomb&#39; option on or off depending on the presence or absence of a byte-order mark at the start of the file. When writing, Vim will write a byte-order mark if the &#39;bomb&#39; option is set. You may set or unset it manually do make Vim write, or not write, the b.o.m.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help &#39;bomb&#39;</b></p>\n\n<h2 id=\"Where-can-I-find-an-example-of-a-typical-use-of-all-these-options\">37.10. Where can I find an example of a typical use of all these options?</h2>\n\n<p>There is a &quot;tip&quot;, with explains them in different words with an example, at</p>\n\n<pre><code>http://vim.wikia.com/wiki/VimTip246</code></pre>\n\n<h2 id=\"How-can-I-insert-Unicode-characters-into-a-file-using-Vim\">37.11. How can I insert Unicode characters into a file using Vim?</h2>\n\n<p>Several methods are available:</p>\n\n<p>- Characters present on your keyboard can be typed in the usual way, even those which require a &quot;dead-key&quot; prefix, like (for instance) the circumflex on French keyboards. - Characters for which a digraph is defined can be typed as two characters prefixed by CTRL-K. - If you have set the &#39;digraph&#39; option, you can enter the characters for which a digraph is defined as &lt;char1&gt;&lt;BS&gt;&lt;char2&gt;. - Any character can be entered by using a CTRL-V prefix (or CTRL-Q if CTRL-V is remapped to paste from the clipboard).</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help digraphs</b></p>\n\n<p><b>:help &#39;digraph&#39;</b></p>\n\n<p><b>:help i_CTRL-V_digit</b></p>\n\n<h2 id=\"How-can-I-know-which-digraphs-are-defined-and-for-which-characters\">37.12. How can I know which digraphs are defined and for which characters?</h2>\n\n<p>First set the &#39;encoding&#39; option properly (for instance, to utf-8), then use the `:digraphs` command to list the currently defined digraphs.</p>\n\n<p>Alternatively, the help file contains the complete set of all digraphs. So you can easily search that list there.</p>\n\n<p>For more information, read:</p>\n\n<p><b>:help :digraphs</b></p>\n\n<p><b>:help &#39;encoding&#39;</b></p>\n\n<p><b>:help digraph-table</b></p>\n\n<h1 id=\"AUTHOR\">AUTHOR</h1>\n\n<p>Current Maintainer: Christian Brabandt &lt;cb@256bit.org&gt;</p>\n\n<p>Last updated on: 11 October 2025</p>\n\n\n</body>\n\n</html>\n\n\n"
  },
  {
    "path": "others/vim_faq.pod",
    "content": "vim:tw=72:wrap:fo=tcqn2:sw=4:sts=4:et:spell:spelllang=en\n=pod\n\n=encoding utf-8\n\n=head1 DESCRIPTION\n\nThis Vim FAQ is created from the questions and answers posted to the\nvim@vim.org user mailing list and the comp.editors newsgroup. There are\nseveral ways to solve a problem in Vim. This FAQ gives one of those several\npossibilities. You can explore the other ways using the information and\nlinks given in this FAQ. The credit for the answers in this FAQ goes to\nPeppe, Benji, Charles Campbell and numerous others. An online version of\nthis FAQ is available at https://vimhelp.org/vim_faq.txt.html\n\n\n=head1 GENERAL INFORMATION\n\n 1.1. What is Vim?\n 1.2. Who wrote Vim?\n 1.3. Is Vim compatible with Vi?\n 1.4. What are some of the improvements of Vim over Vi?\n 1.5. Is Vim free?\n\n=head1 RESOURCES\n\n 2.1. Where can I learn more about Vim?\n 2.2. Is there a mailing list available?\n 2.3. Is there an archive available for the Vim mailing lists?\n 2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\n 2.5. I have a \"xyz\" (some) problem with Vim. How do I determine if it is\n      a problem with my setup or with Vim?\n 2.6. Where can I report bugs?\n 2.7. Where can the FAQ be found?\n 2.8. What if I don't find an answer in this FAQ?\n 2.9. I have a patch for implementing a Vim feature. Where do I send the\n      patch?\n 2.10. I have a Vim tip or developed a new Vim\n       syntax/indent/filetype/compiler plugin or developed a new script\n       or a colorscheme. Is there a public website where I can upload\n       this?\n\n=head1 AVAILABILITY\n\n 3.1. What is the latest version of Vim?\n 3.2. Where can I find the latest version of Vim?\n 3.3. What platforms does it run on?\n 3.4. Where can I download the latest version of the Vim runtime files?\n\n=head1 HELP\n\n 4.1. How do I use the help files?\n 4.2. How do I search for a keyword in the Vim help files?\n 4.3. I am getting an error message E123, what did I do wrong?\n 4.4. Where can I read about the various modes in Vim?\n 4.5. How do I generate the Vim help tags file after adding a new Vim\n      help file?\n 4.6. Can I use compressed versions of the help files?\n\n=head1 EDITING A FILE\n\n 5.1. How do I load a file in Vim for editing?\n 5.2. How do I save the current file in another name (save as) and edit\n      a new file?\n 5.3. How do I change the current directory to the directory of the\n      current file?\n 5.4. How do I write a file without the line feed (EOL) at the end of\n      the file?\n 5.5. How do I configure Vim to open a file at the last edited location?\n 5.6. When editing a file in Vim, which is being changed by an external\n      application, Vim opens a warning window (like the confirm dialog)\n      each time a change is detected. How do I disable this warning?\n 5.7. How do I edit a file whose name is under the cursor?\n 5.8. How do I reload/re-edit the current file?\n 5.9. How do I autosave a file periodically?\n 5.10. How do I open a file in read-only mode?\n 5.11. How do I open a file for editing without saving the modifications\n       to the current file?\n 5.12. How do I reduce the loading time for very large files in Vim?\n\n=head1 EDITING MULTIPLE FILES\n\n 6.1. How do I open multiple files at once from within Vim?\n 6.2. How do I switch between multiple files/buffers in Vim?\n 6.3. How do I open several files in Vim, with each file in a separate\n      window/tabpage?\n 6.4. How do I configure Vim to autoload several files at once similar\n      to \"work-sets\" or \"projects\"?\n 6.5. Is it possible to open multiple top level windows in a single\n      instance of Vim similar to Nedit or emacs?\n 6.6. How do I browse/explore directories from within Vim?\n 6.7. How do I edit files over a network using ftp/scp/rcp/http?\n\n=head1 BACKUP\n\n 7.1. When I edit and save files, Vim creates a file with the same name\n      as the original file and a \"~\" character at the end. How do I stop\n      Vim from creating this file (or) How do I disable the Vim backup\n      file feature?\n 7.2. When I edit and save files, Vim creates a file with the same name\n      as the original file and a \".un~\" extension at the end. How do I\n      stop Vim from creating this file (or) How do I disable the Vim\n      undofile feature.\n 7.3. How do I configure Vim to store all the backup files in a\n      particular directory?\n 7.4. When I save a file with Vim, the file permissions are changed.\n      How do I configure Vim to save a file without changing the file\n      permissions?\n\n=head1 BUFFERS\n\n 8.1. I have made some modifications to a buffer. How do I edit another\n      buffer without saving the modified buffer and also without losing\n      the modifications?\n 8.2. How do I configure Vim to auto-save a modified buffer when\n      switching to another buffer?\n 8.3. How do I replace the buffer in the current window with a blank\n      buffer?\n 8.4. Is there a keyboard shortcut to load a buffer by the buffer\n      number?\n 8.5. How do I open all the current buffers in separate windows?\n 8.6. How do I close (delete) a buffer without exiting Vim?\n 8.7. When I use the command `:%bd` to delete all the buffers, not all\n      the buffers are deleted. Why?\n 8.8. How do I display the buffer number of the current buffer/file?\n 8.9. How do I delete a buffer without closing the window in which the\n      buffer is displayed?\n 8.10. How do I map the <Tab> key to cycle through and open all the\n       buffers?\n\n=head1 WINDOWS\n\n 9.1. What is the difference between a Vim window and a buffer?\n 9.2. How do I increase the width of a Vim window?\n 9.3. How do I zoom into or out of a window?\n 9.4. How do I execute an ex command on all the open buffers or open\n      windows or all the files in the argument list?\n\n=head1 MOTION\n\n 10.1. How do I jump to the beginning (first line) or end (last line) of\n       a file?\n 10.2. In insert mode, when I press the <Esc> key to go to command mode,\n       the cursor moves one character to the left (except when the\n       cursor is on the first character of the line). Is it possible to\n       change this behavior to keep the cursor at the same column?\n 10.3. How do I configure Vim to maintain the horizontal cursor position\n       when scrolling with the <Page Up>, <Page Down>, etc keys?\n 10.4. Some lines in a file are more than the screen width and they are\n       all wrapped. When I use the j, k keys to move from one line to\n       the next, the cursor is moved to the next line in the file\n       instead of the next line on the screen. How do I move from one\n       screen line to the next?\n 10.5. What is the definition of a sentence, paragraph and section in\n       Vim?\n 10.6. How do I jump to beginning or end of a sentence, paragraph or a\n       section?\n 10.7. I have lines in a file that extends beyond the right extent of the\n       screen. How do I move the Vim view to the right to see the text\n       off the screen?\n 10.8. How do I scroll two or more buffers simultaneously?\n 10.9. When I use my arrow keys, Vim changes modes, inserts weird\n       characters in my document but doesn't move the cursor properly.\n       What's going on?\n 10.10. How do I configure Vim to move the cursor to the end of the\n        previous line, when the left arrow key is pressed and the cursor\n        is currently at the beginning of a line?\n 10.11. How do I configure Vim to stay only in insert mode (modeless\n        editing)?\n 10.12. How do I display some context lines when scrolling text?\n 10.13. How do I go back to previous cursor locations?\n\n=head1 SEARCHING TEXT\n\n 11.1. After I searched for a text with a pattern, all the matched text\n       stays highlighted. How do I turn off the highlighting\n       temporarily/permanently?\n 11.2. How do I enter a carriage return character in a search pattern?\n 11.3. How do I search for the character \"^M\"?\n 11.4. How can I search/replace characters that display as \"~R\", \"~S\",\n       etc.?\n 11.5. How do I highlight all the non-printable characters in a file?\n 11.6. How do I search for whole words in a file?\n 11.7. How do I search for the current word under the cursor?\n 11.8. How do I search for a word without regard to the case (uppercase\n       or lowercase)?\n 11.9. How do I search for words that occur twice consecutively?\n 11.10. How do I count the number of times a particular word occurs in a\n        buffer?\n 11.11. How do I place the cursor at the end of the matched word when\n        searching for a pattern?\n 11.12. How do I search for an empty line?\n 11.13. How do I search for a line containing only a single character?\n 11.14. How do I search and replace a string in multiple files?\n 11.15. I am using the `:s` substitute command in a mapping. When a\n        search for a pattern fails, the map terminates. I would like the\n        map to continue processing the next command, even if the\n        substitute command fails. How do I do this?\n 11.16. How do I search for the n-th occurrence of a character in a\n        line?\n 11.17. How do I replace a tab (or any other character) with a hard\n        return (newline) character?\n 11.18. How do I search for a character by its ASCII value?\n 11.19. How do I search for long lines?\n 11.20. How do I display all the lines in the current buffer that\n        contain a specified pattern?\n 11.21. How do I search for a text string that spans multiple lines?\n 11.22. How do I search for a pattern only within a range of lines\n        in a buffer?\n 11.23. How do I clear the last searched pattern?\n 11.24. Why does this pattern \"a.\\{-}p\\@!\" not match?\n 11.25. How can I use \"/\" within a pattern, without escaping it?\n 11.26. How can I operate on a search match?\n\n=head1 CHANGING TEXT\n\n 12.1. How do I delete all the trailing white space characters (SPACE\n       and TAB) at the end of all the lines in a file?\n 12.2. How do I replace all the occurrences of multiple consecutive\n       space characters to a single space?\n 12.3. How do I reduce a range of empty lines into one line only?\n 12.4. How do I delete all blank lines in a file? How do I remove all\n       the lines containing only space characters?\n 12.5. How do I copy/yank the current word?\n 12.6. How do I yank text from one position to another position within a\n       line, without yanking the entire line?\n 12.7. When I yank some text into a register, how do I append the text\n       to the current contents of the register?\n 12.8. How do I yank a complete sentence that spans over more than one\n       line?\n 12.9. How do I yank all the lines containing a pattern into a buffer?\n 12.10. How do I delete all the lines in a file that do not contain a\n        pattern?\n 12.11. How do I add a line before each line with \"pattern\" in it?\n 12.12. Is there a way to operate on a line if the previous line\n        contains a particular pattern?\n 12.13. How do I execute a command on all the lines containing a\n        pattern?\n 12.14. Can I copy the character above the cursor to the current cursor\n        position?\n 12.15. How do I insert a blank line above/below the current line\n        without entering insert mode?\n 12.16. How do I insert the name of the current file into the current\n        buffer?\n 12.17. How do I insert the contents of a Vim register into the current\n        buffer?\n 12.18. How do I move the cursor past the end of line and insert some\n        characters at some columns after the end of the line?\n 12.19. How to replace the word under the cursor (say: junk) with\n        \"foojunkbar\" in Vim?\n 12.20. How do I replace a particular text in all the files in a\n        directory?\n 12.21. I have some numbers in a file. How do I increment or decrement\n        the numbers in the file?\n 12.22. How do I reuse the last used search pattern in a `:substitute`\n        command?\n 12.23. How do I change the case of a string using the `:substitute`\n        command?\n 12.24. How do I enter characters that are not present in the keyboard?\n 12.25. Is there a command to remove any or all digraphs?\n 12.26. In insert mode, when I press the backspace key, it erases only\n        the characters entered in this instance of insert mode. How do I\n        erase previously entered characters in insert mode using the\n        backspace key?\n 12.27. I have a file which has lines longer than 72 characters\n        terminated with \"+\" and wrapped to the next line. How can I\n        quickly join the lines?\n 12.28. How do I paste characterwise yanked text into separate lines?\n 12.29. How do I change the case (uppercase, lowercase) of a word or\n        a character or a block of text?\n 12.30. How do I enter ASCII characters that are not present in the\n        keyboard?\n 12.31. How do I replace non-printable characters in a file?\n 12.32. How do I remove duplicate lines from a buffer?\n 12.33. How do I prefix all the lines in a file with the corresponding\n        line numbers?\n 12.34. How do I exchange (swap) two characters or words or lines?\n 12.35. How do I change the characters used as word delimiters?\n\n=head1 COMPLETION IN INSERT MODE\n\n 13.1. How do I complete words or lines in insert mode?\n 13.2. How do I complete file names in insert mode?\n 13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do\n       I complete words that occur after the just completed word?\n\n=head1 TEXT FORMATTING\n\n 14.1. How do I format a text paragraph so that a new line is inserted\n       at the end of each wrapped line?\n 14.2. How do I format long lines in a file so that each line contains\n       less than \"n\" characters?\n 14.3. How do I join short lines to the form a paragraph?\n 14.4. How do I format bulleted and numbered lists?\n 14.5. How do I indent lines in insert mode?\n 14.6. How do I format/indent an entire file?\n 14.7. How do I increase or decrease the indentation of the current\n       line?\n 14.8. How do I indent a block/group of lines?\n 14.9. When I indent lines using the > or < key, the standard 8-tabstops\n       are used instead of the current 'tabstop' setting. Why?\n 14.10. How do I turn off the automatic indentation of text?\n 14.11. How do I configure Vim to automatically set the 'textwidth'\n        option to a particular value when I edit mails?\n 14.12. Is there a way to make Vim auto-magically break lines?\n 14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n        'fileformat' option to 'dos' and then 'unix' and then 'mac'.\n        None of these helped. How can I hide these symbols?\n 14.14. When I paste some text into a Vim buffer from another\n        application, the alignment (indentation) of the new text is\n        messed up. How do I fix this?\n 14.15. When there is a very long wrapped line (wrap is \"on\") and a line\n        doesn't fit entirely on the screen it is not displayed at all.\n        There are blank lines beginning with \"@\" symbol instead of\n        wrapped line. If I scroll the screen to fit the line the \"@\"\n        symbols disappear and the line is displayed again. What Vim\n        setting control this behavior?\n 14.16. How do I convert all the tab characters in a file to space\n        characters?\n 14.17. What Vim options can I use to edit text that will later go to a\n        word processor?\n 14.18. How do I join lines without adding or removing any space\n        characters?\n\n=head1 VISUAL MODE\n\n 15.1. How do I do rectangular block copying?\n 15.2. How do I delete or change a column of text in a file?\n 15.3. How do I apply an ex-command on a set of visually selected lines?\n 15.4. How do I execute an ex command on a column of text selected in\n       Visual block mode?\n 15.5. How do I select the entire file in visual mode?\n 15.6. When I visually select a set of lines and press the > key to\n       indent the selected lines, the visual mode ends. How can I\n       reselect the region for further operation?  (or) How do I\n       re-select the last selected visual area again?\n 15.7. How do I jump to the beginning/end of a visually selected region?\n 15.8. When I select text with mouse and then press : to enter an ex\n       command, the selected text is replaced with the : character. How\n       do I execute an ex command on a text selected using the mouse\n       similar to the text selected using the visual mode?\n 15.9. When I select a block of text using the mouse, Vim goes into\n       selection mode instead of Visual mode. Why?\n\n=head1 COMMAND-LINE MODE\n\n 16.1. How do I use the name of the current file in the command mode or\n       an ex command line?\n 16.2. How do I edit the text in the Vim command-line effectively?\n 16.3. How do I switch from Vi mode to Ex mode?\n 16.4. How do I copy the output from an ex-command into a buffer?\n 16.5. When I press the <Tab> key to complete the name of a file in the\n       command mode, if there are more than one matching file names,\n       then Vim completes the first matching file name and displays a\n       list of all matching filenames. How do I configure Vim to only\n       display the list of all the matching filenames and not complete\n       the first one?\n 16.6. How do I copy text from a buffer to the command line and from the\n       command line to a buffer?\n 16.7. How do I put a command onto the command history without executing\n       it?\n 16.8. How do I increase the height of the command-line?\n\n=head1 VIMINFO\n\n 17.1. When I invoke Vim, I get error messages about illegal characters\n       in the viminfo file. What should I do to get rid of these\n       messages?\n 17.2. How do I disable the viminfo feature?\n 17.3. How do I save and use Vim marks/commands across Vim sessions?\n\n=head1 REMOTE EDITING\n\n 18.1. How do I open a file with existing instance of gvim? What\n       happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n 18.2. How do I send a command to a Vim server to write all buffers to\n       disk?\n 18.3. Where can I get the documentation about the Vim remote server\n       functionality?\n\n=head1 OPTIONS\n\n 19.1. How do I configure Vim in a simple way?\n 19.2. How do I toggle the value of an option?\n 19.3. How do I set an option that affects only the current\n       buffer/window?\n 19.4. How do I use space characters for a Vim option value?\n 19.5. Can I add (embed) Vim option settings to the contents of a file?\n 19.6. How do I display the line numbers of all the lines in a file?\n 19.7. How do I change the width of the line numbers displayed using the\n       'number' option?\n 19.8. How do I display (view) all the invisible characters like space,\n       tabs and newlines in a file?\n 19.9. How do I configure Vim to always display the current line and\n       column number?\n 19.10. How do I display the current Vim mode?\n 19.11. How do I configure Vim to show pending/partial commands on the\n        status line?\n 19.12. How do I configure the Vim status line to display different\n        settings/values?\n 19.13. How do I configure Vim to display status line always?\n 19.14. How do I make a Vim setting persistent across different Vim\n        invocations/instances/sessions?\n 19.15. Why do I hear a beep (why does my window flash) about 1 second\n        after I hit the Escape key?\n 19.16. How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n        deleting the characters I'm changing?\n 19.17. How do I remove more than one flag using a single `:set` command\n        from a Vim option?\n\n=head1 MAPPING KEYS\n\n 20.1. How do I know what a key is mapped to?\n 20.2. How do I list all the user-defined key mappings?\n 20.3. How do I unmap a key?\n 20.4. I am not able to create a mapping for the <xxx> key. What is\n       wrong?\n 20.5. Why does mapping the <C-...> key not work?\n 20.6. How do I map the numeric keypad keys?\n 20.7. How do I create a mapping that works only in visual mode?\n 20.8. How do I create a mapping that works only in normal and operator\n       pending mode (but not in visual mode)?\n 20.9. In a Vim script, how do I know which keys to use for my mappings,\n       so that the mapped key will not collide with an already used key?\n 20.10. How do I map the escape key?\n 20.11. How do I map a key to perform nothing?\n 20.12. I want to use the <Tab> key to indent a block of text and\n        <Shift-Tab> key to unindent a block of text. How do I map the keys\n        to do this?  This behavior is similar to textpad, visual studio,\n        etc.\n 20.13. In my mappings the special characters like <CR> are not\n        recognized. How can I configure Vim to recognize special\n        characters?\n 20.14. How do I use the \"|\" to separate multiple commands in a map?\n 20.15. If I have a mapping/abbreviation whose ending is the beginning of\n        another mapping/abbreviation, how do I keep the first from\n        expanding into the second one?\n 20.16. Why does it take a second or more for Vim to process a key,\n        sometimes when I press a key?\n 20.17. How do I map a key to run an external command using a visually\n        selected text?\n 20.18. How do I map the CTRL-I key while still retaining the\n        functionality of the <Tab> key?\n 20.19. How do I define a map to accept a count?\n 20.20. How can I make my normal mode mapping work from within Insert\n        Mode?\n\n=head1 ABBREVIATIONS\n\n 21.1. How do I auto correct misspelled words?\n 21.2. How do I create multi-line abbreviations?\n 21.3. When my abbreviations are expanded, an additional space character\n       is added at the end of the expanded text. How do I avoid this\n       character?\n 21.4. How do I insert the current date/time stamp into the file?\n 21.5. How do I prevent an abbreviation from expanding in insert mode?\n\n=head1 RECORD AND PLAYBACK\n\n 22.1. How do I repeat an editing operation (insertion, deletion, paste,\n       etc)?\n 22.2. How I record and repeat a set of key sequences?\n 22.3. How do I edit/modify a recorded set of key sequences?\n 22.4. How do I write recorded key sequences to a file?\n 22.5. I am using register 0 to record my key sequences (i.e. q0 ....\n       q). In the recorded key sequences, I am yanking some text.  After\n       the first replay of the recorded key sequence, I am no longer\n       able to play it back.\n\n=head1 AUTOCOMMANDS\n\n 23.1. How do I execute a command when I try to modify a read-only file?\n 23.2. How do I execute a command every time when entering a buffer?\n 23.3. How do I execute a command every time when entering a window?\n 23.4. From an autocmd, how can I determine the name of the file or the\n       buffer number for which the autocommand is executed?\n 23.5. How do I automatically save all the changed buffers whenever Vim\n       loses focus?\n 23.6. How do I execute/run a function when Vim exits to do some\n       cleanup?\n\n=head1 SYNTAX HIGHLIGHT\n\n 24.1. How do I turn off/on syntax highlighting?\n 24.2. How do I change the background and foreground colors used by Vim?\n 24.3. How do I change the highlight colors to suit a dark/light\n       background?\n 24.4. How do I change the color of the line numbers displayed when the\n       `:set number` command is used?\n 24.5. How do I change the background color used for a Visually selected\n       block?\n 24.6. How do I highlight the special characters (tabs, trailing spaces,\n       end of line, etc) displayed by the 'list' option?\n 24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that\n       Vim uses the specified colorscheme every time?\n 24.8. Vim syntax highlighting is broken. When I am editing a file, some\n       parts of the file is not syntax highlighted or syntax highlighted\n       incorrectly.\n 24.9. Is there a built-in function to syntax-highlight the\n       corresponding matching bracket?\n 24.10. How do I turn off the C comment syntax highlighting?\n 24.11. How do I add my own syntax extensions to the standard syntax\n        files supplied with Vim?\n 24.12. How do I replace a standard syntax file that comes with the Vim\n        distribution with my own syntax file?\n 24.13. How do I highlight all the characters after a particular column?\n 24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n        highlighting into a HTML file?\n 24.15. How do I list the definition of all the current highlight\n        groups?\n 24.16. How can I embed one syntax highlighting language into another\n        one?\n\n=head1 VIM SCRIPT WRITING\n\n 25.1. How do I list the names of all the scripts sourced by Vim?\n 25.2. How do I debug Vim scripts?\n 25.3. How do I locate the script/plugin which sets a Vim option?\n 25.4. I am getting some error/informational messages from Vim (possibly\n       when running a script), the messages are cleared immediately. How\n       do I display the messages again?\n 25.5. How do I save and restore a plugin specific information across\n       Vim invocations?\n 25.6. How do I start insert mode from a Vim function?\n 25.7. How do I change the cursor position from within a Vim function?\n 25.8. How do I check the value of an environment variable in the .vimrc\n       file?\n 25.9. How do I check whether an environment variable is set or not from\n       a Vim function?\n 25.10. How do I call/use the Vim built-in functions?\n 25.11. I am using some normal mode commands in my Vim script. How do I\n        avoid using the user-defined mappings for these normal mode\n        commands and use the standard Vim functionality for these normal\n        mode commands?\n 25.12. How do I get a visually selected text into a Vim variable or\n        register?\n 25.13. I have some text in a Vim variable \"myvar\". I would like to use\n        this variable in a `:s` substitute command to replace a text\n        \"mytext\". How do I do this?\n 25.14. A Vim variable (bno) contains a buffer number. How do I use this\n        variable to open the corresponding buffer?\n 25.15. How do I store the value of a Vim option into a Vim variable?\n 25.16. I have copied and inserted some text into a buffer from a Vim\n        function. How do I indent the inserted text from the Vim\n        function?\n 25.17. How do I get the character under the cursor from a Vim script?\n 25.18. How do I get the name of the current file without the extension?\n 25.19. How do I get the basename of the current file?\n 25.20. How do I get the output from a Vim function into the current\n        buffer?\n 25.21. How do I call external programs from a Vim function?\n 25.22. How do I get the return status of a program executed using the\n        `:!` command?\n 25.23. How do I determine whether the current buffer is modified or\n        not?\n 25.24. I would like to use the carriage return character in a normal\n        command from a Vim script. How do I specify the carriage return\n        character?\n 25.25. How do I split long lines in a Vim script?\n 25.26. When I try to \"execute\" my function using the `:execute Myfunc()`\n        command, the cursor is moved to the top of the current buffer.\n        Why?\n 25.27. How do I source/execute the contents of a register?\n 25.28. After calling a Vim function or a mapping, when I press the \"u\"\n        key to undo the last change, Vim undoes all the changes made by\n        the mapping/function. Why?\n 25.29. How can I call a function defined with s: (script local\n        function) from another script/plugin?\n 25.30. Is it possible to un-source a sourced script? In other words,\n        reverse all the commands executed by sourcing a script.\n\n=head1 PLUGINS\n\n 26.1. How do I set different options for different types of files?\n 26.2. I have downloaded a Vim plugin or a syntax file or a indent file,\n       or a color scheme or a filetype plugin from the web. Where should\n       I copy these files so that Vim will find them?\n 26.3. How do I extend an existing filetype plugin?\n 26.4. How do I turn off loading the Vim plugins?\n 26.5. How do I turn on/off loading the filetype plugins?\n 26.6. How do I override settings made in a file type plugin in the\n       global ftplugin directory for all the file types?\n 26.7. How do I disable the Vim directory browser plugin?\n 26.8. How do I set the filetype option for files with names matching a\n       particular pattern or depending on the file extension?\n\n=head1 EDITING PROGRAM FILES\n\n 27.1. How do I enable automatic indentation for C/C++ files?\n 27.2. How do I configure the indentation used for C/C++ files?\n 27.3. How do I turn off the automatic indentation feature?\n 27.4. How do I change the number of space characters used for the\n       automatic indentation?\n 27.5. I am editing a C program using Vim. How do I display the\n       definition of a macro or a variable?\n 27.6. I am editing a C program using Vim. How do I jump to the\n       beginning or end of a code block from within the block?\n 27.7. When editing C++ files and when inserting new lines above or\n       below a comment (//) line, Vim automatically inserts the C++\n       comment character (//) at the beginning of the line. How do I\n       disable this? (*Updated*)\n 27.8. How do I add the comment character \"#\" to a set of lines at the\n       beginning of each line?\n 27.9. How do I edit a header file with the same name as the\n       corresponding C source file?\n 27.10. How do I automatically insert comment leaders while typing\n        comments?\n\n=head1 QUICKFIX\n\n 28.1. How do I build programs from Vim?\n 28.2. When I run the make command in Vim I get the errors listed as the\n       compiler compiles the program. When it finishes this list\n       disappears and I have to use the `:clist` command to see the error\n       message again. Is there any other way to see these error\n       messages?\n 28.3. How can I perform a command for each item in the\n       quickfix/location list?\n\n=head1 FOLDING\n\n 29.1. How do I extend the Vim folding support?\n 29.2. When I enable folding by setting the 'foldmethod' option, all the\n       folds are closed. How do I prevent this?\n 29.3. How do I control how many folds will be opened when I start\n       editing a file?\n 29.4. How do I open and close folds using the mouse?\n 29.5. How do I change the text displayed for a closed fold?\n 29.6. How do I store and restore manually created folds across\n       different Vim invocations?\n 29.7. I have enabled syntax based folding. Why is Vim so slow?\n\n\n=head1 VIM WITH EXTERNAL APPLICATIONS\n\n 30.1. Can I run a shell inside a Vim window?\n 30.2. How do I pass the word under the cursor to an external command?\n 30.3. How do I get the output of a shell command into a Vim buffer?\n 30.4. How do I pipe the contents of the current buffer to an external\n       command and replace the contents of the buffer with the output\n       from the command?\n 30.5. How do I sort a section of my file?\n 30.6. How do I use Vim as a pager?\n 30.7. How do I view Unix man pages from inside Vim?\n 30.8. How do I change the diff command used by the Vim diff support?\n 30.9. How do I use the Vim diff mode without folding?\n\n=head1 GUI VIM\n\n 31.1. How do I create buffer specific menus?\n 31.2. How do I change the font used by GUI Vim?\n 31.3. When starting GUI Vim, how do I specify the location of the GVIM\n       window?\n 31.4. How do I add a horizontal scrollbar in GVim?\n 31.5. How do I make the scrollbar appear in the left side by default?\n 31.6. How do I remove the Vim menubar?\n 31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the\n       menu starting with that letter is selected. I don't want this\n       behavior as I want to map the <Alt>-<key> combination. How do I do\n       this?\n 31.8. Is it possible to scroll the text by dragging the scrollbar so\n       that the cursor stays in the original location?\n 31.9. How do I get gvim to start browsing files in a particular\n       directory when using the `:browse` command?\n 31.10. For some questions, like when a file is changed outside of Vim,\n        Vim displays a GUI dialog box. How do I replace this GUI dialog\n        box with a console dialog box?\n 31.11. I am trying to use GUI Vim as the editor for my xxx application.\n        When the xxx application launches GUI Vim to edit a file, the\n        control immediately returns to the xxx application. How do I\n        start GUI Vim, so that the control returns to the xxx\n        application only after I quit Vim?\n 31.12. Why does the \"Select Font\" dialog doesn't show all the fonts\n        installed in my system?\n 31.13. How do I use the mouse in Vim command-line mode?\n 31.14. When I use the middle mouse button to scroll text, it pastes the\n        last copied text. How do I disable this behavior?\n 31.15. How do I change the location and size of a GUI Vim window?\n 31.16. When splitting the Vim window vertically, Vim changes\n        the position.\n\n=head1 VIM ON UNIX\n\n 32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim\n       freezes. What should I do now?\n 32.2. I am seeing weird screen update problems in Vim. What can I do to\n       solve this screen/display update problems?\n 32.3. I am using the terminal/console version of Vim. In insertmode,\n       When I press the backspace key, the character before the cursor\n       is not erased. How do I configure Vim to do this?\n 32.4. I am using Vim in a xterm. When I quit Vim, the screen contents\n       are restored back to the original contents. How do I disable\n       this?\n 32.5. When I start Vim, it takes quite a few seconds to start. How do I\n       minimize the startup time?\n 32.6. How can I make the cursor in gvim in unix stop blinking?\n 32.7. How do I change the menu font on GTK Vim?\n 32.8. How do I prevent CTRL-Z from suspending Vim?\n 32.9. When I kill the xterm running Vim, the Vim process continues to\n       run and takes up a lot of CPU (99%) time. Why is this happening?\n 32.10. How do I get the Vim syntax highlighting to work in a Unix\n        terminal?\n\n=head1 VIM ON MS-WINDOWS\n\n 33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode.\n       What happened?\n 33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do\n       I configure Vim to treat CTRL-Y as CTRL-Y?\n 33.3. How do I start GUI Vim in a maximized window always?\n 33.4. After doing some editing operations, Vim freezes. The cursor\n       becomes an empty rectangle. I am not able enter any characters.\n       What is happening?\n 33.5. I am using Windows XP, the display speed of maximized GVim is\n       very slow. What can I do to speed the display updates?\n 33.6. What are the recommended settings for using Vim with cygwin?\n 33.7. I am trying to use GNU diff with Vim diff mode. When I run the\n       diff from command line, it works. When I try to use the diff with\n       Vim it doesn't work. What should I do now?\n 33.8. Is it possible to use Vim as an external editor for MS-Windows\n       Outlook email client?\n 33.9. I am using Vim to edit HTML files. How do I start internet\n       explorer with the current file to preview the HTML file?\n 33.10. I would like to use Vim with Microsoft Visual Studio. How do I\n        do this?\n 33.11. Where do I place the _vimrc and _gvimrc files?\n 33.12. Every time I save a file, Vim warns about the file being changed\n        outside of Vim. Why?\n\n=head1 PRINTING\n\n 34.1. How do I print a file along with line numbers for all the lines?\n 34.2. How do I print a file with the Vim syntax highlighting colors?\n\n=head1 BUILDING VIM FROM SOURCE\n\n 35.1. How do I build Vim from the sources on a Unix system?\n 35.2. How do I install Vim in my home directory or a directory other\n       than the default installation directory in Unix?\n 35.3. How do I build Vim from the sources on a MS-Windows system?\n 35.4. The Vim help, syntax, indent files are missing from my Vim\n       installation. How do I install these files?\n 35.5. I have built Vim from the source and installed the Vim package\n       using \"make install\". Do I need to keep the Vim source directory?\n 35.6. How do I determine the Vim features which are enabled at compile\n       time?\n 35.7. Can I build Vim without the GUI support?\n 35.8. When building Vim on a Unix system, I am getting \"undefined\n       reference to term_set_winsize\" error. How do I resolve this\n       error?\n 35.9. Vim configure keeps complaining about the lack of gtk-config\n       while trying to use GTK 2.03. This is correct, since in GTK 2\n       they moved to using the generic pkg-config. I can get pkg-config\n       to list the various includes and libs for gtk, but for some\n       reason the configure script still isn't picking this up.\n 35.10. I did successfully download the sources and compiled Vim on\n        Unix. But feature ... still does not work. What is wrong and\n        how can I fix it?\n\n=head1 VARIOUS\n\n 36.1. How do I edit binary files with Vim?\n 36.2. How do I disable the visual error flash and the error beep?\n 36.3. How do I display the ascii value of a character displayed in a\n       buffer?\n 36.4. Can I use zero as a count for a Vim command?\n 36.5. How do I disable the Vim welcome screen?\n 36.6. How do I avoid the \"hit enter to continue\" prompt?\n 36.7. How do I invoke Vim from command line to run a group of commands\n       on a group of files?\n 36.8. How do I use a normal mode command from insert mode without\n       leaving the insert mode?\n 36.9. How do I start Vim in insert mode?\n 36.10. How do I use Copy and Paste with Vim?\n 36.11. Why shouldn't I modify the files in the system runtime\n        directory?\n\n=head1 UNICODE\n\n 37.1. Is it possible to create Unicode files using Vim?\n 37.2. Which Vim settings are particularly important for editing Unicode\n       files?\n 37.3. What is the 'encoding' option?\n 37.4. How does Vim name the various Unicode encodings?\n 37.5. How does Vim specify the presence or absence of a byte-order\n       mark?\n 37.6. What is the 'fileencoding' option?\n 37.7. What is the 'fileencodings' option?\n 37.8. What is the 'termencoding' option?\n 37.9. What is the 'bomb' option?\n 37.10. Where can I find an example of a typical use of all these\n        options?\n 37.11. How can I insert Unicode characters into a file using Vim?\n 37.12. How can I know which digraphs are defined and for which\n        characters?\n\n\n\n=head1 GENERAL INFORMATION\n\n\n\n=head2 1.1. What is Vim?\n\nVim stands for Vi IMproved. It used to be Vi IMitation, but there are so\nmany improvements that a name change was appropriate. Vim is a text editor\nwhich includes almost all the commands from the Unix program \"Vi\" and a lot\nof new ones. All commands can be given with the keyboard. This has the\nadvantage that you can keep your fingers on the keyboard and your eyes on\nthe screen. For those who want it, there is mouse support and a GUI version\nwith scrollbars and menus.\n\nVim is an editor, not a word processor. A word processor is used mainly\nto do layout of text. This means positioning it, changing the way it\nappears on output. More often than not, the final document is meant to\nbe printed or typeset or what have you, in order to present it in a\npleasing manner to others. Examples of word processors are Microsoft\nWord, FrameMaker, and OpenOffice Writer.\n\nAn editor is simply for entering text. Any typesetting or laying out of the\ndocument is secondary. With an editor, one's main concern is entering text,\nnot making the text look good. Examples of editors other than Vim and Vi\nare Emacs, TextMate, Ultraedit and gedit. And Notepad.\n\nFor more information, read:\n\nB<:help intro>\n\n\n\n=head2 1.2. Who wrote Vim?\n\nMost of Vim is based on Stevie and was written by Bram Moolenaar, with\ncontributions from too many people to mention here.\n\nFor more information, read:\n\nB<:help author>\n\nB<:help credits>\n\n\n\n=head2 1.3. Is Vim compatible with Vi?\n\nYes. Vim is very much compatible with Vi.  You can use the \"-C\"\ncommand-line flag to start Vim in Vi compatible mode:\n\n $ vim -C\n\nYou can also use:\n\n $ vim -u NONE\n\nYou can also set the 'compatible' option to enable Vi compatibility:\n\n :set compatible\n\nIf you want to make sure, to start Vim in a 'nocompatible' mode to\noriginal Vi, supply the -N command line argument:\n\n $ vim -N\n\nFor more information, read:\n\nB<:help -C>\n\nB<:help -N>\n\nB<:help 'compatible'>\n\nB<:help compatible-default>\n\n\n\n=head2 1.4. What are some of the improvements of Vim over Vi?\n\nA short summary of the improvements of Vim over vi is listed below.  The\nlist shows that Vim is a thoroughly modern and feature-packed editor.\nStandard features of modern editors are implemented, and there is an equal\nemphasis on general power-user features and features for programmers.\n\n=head3 Features to modernise Vi:\n\n=head4   Multi-level undo\n\n  Allows you to set the number of times you can undo your changes in a\n  file buffer. You can also redo an undone change.\n  Also starting with version 7.3 Vim can permanently store your undo\n  information, so that you can undo your changes which you have done\n  in a previous editing session.\n\n=head4   Tabs, Multiple windows and buffers\n\n  Each file can be displayed in its own window. You can move easily from\n  one window to another. Each file opened during a Vim session also has\n  an associated buffer and you can easily jump from one to the other.\n  Also like any modern GUI, Vim supports opening several files in tabs.\n  You can do batch processing for tabs, buffers, windows and the\n  argumentlist.\n\n=head4   Flexible insert mode\n\n  Vim allows you to use the arrow keys while in insert mode to move\n  around in the file. No more hitting <Esc>, moving around, then hitting\n  `i' or `a'.\n\n=head4   Macros\n\n  Vim has a facility which allows you to record a sequence of typed\n  characters and repeat them any number of times.\n\n=head4   Visual mode\n\n  You can highlight sections of text and execute operations on this\n  section of text only.\n\n=head4   Block operators\n\n  Allow selection and highlighting of rectangular blocks of text in\n  order do execute specific operations on them.\n\n=head4   Online help system\n\n  You can easily find help on any aspect of using Vim. Help is displayed\n  in its own window.\n\n=head4   Command-line editing and history\n\n  History allows you to use the arrow keys to repeat or search for a\n  command that has already been typed. Allows you to match the beginning\n  of a command with the beginning of another similar command in the\n  history buffer. You can also edit a command to correct typos or change\n  a few values.\n\n=head4   Command line completion.\n\n  Using the <Tab> key, you can complete commands, options, filenames,\n  etc. as needed.\n\n=head4   Horizontal scrolling.\n\n  Long lines can be scrolled horizontally (with or without the GUI).\n\n=head4   Unicode and internationalization improvements.\n\n  Vim is able to edit files in unicode encoding and uses internally an\n  utf-8 encoding. Additionally Vim can display text right to left\n  oriented.\n\n=head3 Advanced user features:\n\n=head4   Text formatting\n\n  With two keystrokes, you can format large sections of text, without\n  the use of external programs.\n\n=head4   Completion in Insert mode\n\n  Vim provides several different possibilities to complete your text.\n  For example Vim can complete words while you are typing, by matching\n  the current word with other similar words in the file.\n\n=head4   Jump tags\n\n  Just like in an internet browser, you can jump back to previous parts\n  of the text you were editing, and then forward again.  Your brain is\n  thus free to edit instead of navigate.\n\n=head4   Automatic commands\n\n  Commands automatically executed when reading or writing a file,\n  jumping to another buffer, etc.\n\n=head4   Viminfo\n\n  Allows storing of the command line history, marks and registers in a\n  file to be read on startup.  Therefore, you can recall old search\n  patterns, macros, etc., in a new Vim session.\n\n=head4   Mouse support\n\n  The mouse is supported in an xterm and for MS-DOS. It can be used to\n  position the cursor, select the visual area, paste a register, etc.\n\n=head4   Graphical User Interface (GUI)\n\n  There are several different graphical user interfaces available.\n  Also, it's very easy to add your own menus.  Of course, console vim is\n  still supported, and very widely used.\n\n=head4   Scripting language\n\n  Vim has a powerful scripting language so new commands can be created.\n  You can also use Perl, Python, TCL, Lua and Ruby to achieve the same\n  thing!\n\n=head4   Plugins\n\n  Extra functionality implemented via vim commands (regular commands or\n  the scripting language) that is automatically loaded on startup.\n  Examples: file explorer, network editing, enhanced autocompletion,\n  syntax checks.\n  More are being developed and shared on VimOnline all the time.\n\n=head4   Syntax highlighting for many programming languages\n\n  Syntax highlighting (including concealing items) for hundreds of\n  programming languages is supported. Support for others can be\n  added.\n\n=head4   Extended regular expressions\n\n  Vim supports extended regular expressions which are similar in\n  functionality to that of Perl regular expressions.\n\n=head4   Integrated Spell checking\n\n  Spell checking has been integrated into Vim.\n\n=head4   Diff mode\n\n  Vim can highlight the differences between two, three or four files.\n  Identical lines will be folded away and hidden.\n\n=head4   Encryption using the blowfish algorithm\n\n  Vim allows to encrypt your files using the symmetric block cipher\n  blowfish as well as the swap file.\n\n=head4   Extensive customizable\n\n  Vim can be tuned and customized to work like you want by setting\n  options. You can define your own commands, macros and even plugins\n  to extend its capabilities\n\n=head4   Packages\n\n  Packages have been added to keep the installation of the growing\n  number of plugins manageable. This is a convenient way to get one\n  or more plugins, drop them in a directory and keep them updated.\n  Vim will load them automatically, or only when desired.\n\n=head3 Programming performance features:\n\n=head4   Edit-compile-edit speedup\n\n  You can compile within Vim and automatically jump to the location of\n  errors in the source code.\n\n=head4   Indenting for many programming languages\n\n  C, C++, Java, Perl, XML and many other languages can be automatically\n  indented by vim while you type.  Support for others can be added.\n\n=head4   Searching for words in include files\n\n  Vim allows you to search for a match of the word under the cursor in\n  the current and included files.\n\n=head4   Advanced text objects\n\n  Instantly select, delete, copy, indent, format, change case, or ...\n  to all the text between ( and ), or { and }, or < and >, or [ and\n  ].  Or a word, sentence, or paragraph.  Very powerful.\n\n=head4   Folding\n\n  Certain parts of the text can be \"folded\" away.  The best example is\n  the body of a function.  You can get an overview of the code, and then\n  open the fold of the function whose detail you need to see.\n\n=head4   ctags and cscope integration\n\n  Using these two powerful programs, you can jump to a definition of a\n  function from a calling instance of it, and use other tricks to\n  navigate source code.\n\n=head4   Integration of several programming languages\n\n  If you find the internal scripting language not powerful enough, you\n  can extend Vim using Lua, Ruby, Tcl, Perl and Python 2 and 3.\n\n=head4   Asynchronous I/O support\n\n  Vim uses jobs and channels to talk to other programs\n  asynchronously. This allows to have e.g. a compiler run in the\n  background and open the quickfix list as soon as it is finished to\n  fix warnings and errors.\n\n=head4   Timers\n\n  Timers are asynchronous and can fire once or repeatedly to invoke a\n  function to do any work.\n\n=head3 For more information, read:\n\nB<:help vi-differences>\n\n\n\n=head2 1.5. Is Vim free?\n\nVim is Charityware. There are no restrictions on using or copying Vim, but\nthe author encourages you to make a donation to charity. A document\nexplaining how to do so is included in the distribution.\n\nFor more information, read:\n\nB<:help copyright>\n\n\n\n\n=head1 RESOURCES\n\n\n\n=head2 2.1. Where can I learn more about Vim?\n\nYou can post your Vim questions to the vim@vim.org mailing list.  You can\npost your Vim development related questions to the vim-dev@vim.org mailing\nlist. Vim does not have a newsgroup of its own. But the appropriate\nnewsgroup to post to is comp.editors.\n\n\"VimOnline\" is a web page that serves as a de facto homepage for vim,\nalthough the main purpose of it is to gather tips and scripts from\neverywhere.  Get involved!  The URL is https://www.vim.org\n\nFinally, read the Vi FAQ:\n\n http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\nFinally, there are also some communities, where you can discuss features\nor ask questions:\n\n https://vi.stackexchange.com\n https://vim.reddit.com\n\nFor more information, read:\n\nB<:help mail-list>\n\nB<:help internet>\n\n\n\n=head2 2.2. Is there a mailing list available?\n\nThere are several:\n\n NAME              DESCRIPTION\n ----------------  ---------------------------------------------\n vim-announce      Announcements of new releases\n vim               General discussion\n vim-dev           Patches, bug reports, development discussions\n vim-mac           Macintosh discussion\n vim-fr            General discussion in French\n\nOf these, only vim and vim-dev are of general interest. vim-announce is\nread-only to most people, and its messages are sent to the other lists as\nwell. The remaining four are very low volume.\n\n ACTION            EMAIL SEND TO\n ----------------  --------------------------\n To subscribe:     <NAME>-subscribe@vim.org\n To unsubscribe:   <NAME>-unsubscribe@vim.org\n To get help:      <NAME>-help@vim.org\n\nThe available mailing lists are also mentioned here:\n\n https://www.vim.org/maillist.php\n\n\n=head2 2.3. Is there an archive available for the Vim mailing lists?\n\nYes. Visit https://groups.yahoo.com/, where name is one of:\nvimannounce, vim, vimdev, vim-fr, vim-mac, vim-vms.\n\nAlternatively, visit www.gmane.org to find out about GMANE, which allows\nyou to access the mailing lists as though they were newsgroups.  This\noffers some convenience to those who wish to browse the history or casually\nobserve the current threads.\n\n\n=head2 2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\n\nYou can download the HTML/PDF/PS format of the Vim user manual from:\n\n https://vimdoc.sourceforge.net/\n\nNote, the user manual from that page is currently pretty outdated. It's\nbest to either use the documentation that comes with vim or use the\nonline version at https://vimhelp.org\n\nYou can find a pdf version of the full English help, including this faq\n(in letter, A4 and Ipad format) at:\n\n https://nathangrigg.com/vimhelp/\n\nThis document is cross-referenced, so you can use the hyperlink\nfunctionality.\n\n\n=head2 2.5. I have a \"xyz\" (some) problem with Vim. How do I determine if it is a\n  problem with my setup or with Vim?  / Have I found a bug in Vim?\n\nFirst, you need to find out, whether the error is in the actual runtime\nfiles or any plugin that is distributed with Vim or whether it is a\nsimple side effect of any configuration option from your .vimrc or\n.gvimrc. So first, start vim like this:\n\n vim -u NONE -U NONE -N -i NONE\n\nThis starts Vim in nocompatible mode (-N), without reading your viminfo\nfile (-i NONE), without reading any configuration file (-u NONE for not\nreading .vimrc file and -U NONE for not reading a .gvimrc file) or even\nplugin.\n\nIn this invocation, try to reproduce your problem. If the error\npersists, the chance is good you've found a bug in Vim (see also\nQuestion 2.6.)\n\nIf the error does not occur when starting Vim this way, then the problem\nis either related to some plugin of yours or some setting in one of your\nlocal setup files. You need to find out, what triggers the error, you\ntry starting Vim this way:\n\n vim -u NONE -U NONE -N\n\nIf the error occurs, the problem is your .viminfo file. Simply delete\nthe viminfo file then. If the error does not occur, try:\n\n vim -u ~/.vimrc --noplugin -N -i NONE\n\nThis will simply use your .vimrc as configuration file, but not load any\nplugins. If the error occurs this time, the error is possibly caused by\nsome configuration option inside your .vimrc file. Depending on the\nlength of your vimrc file, it can be quite hard to trace the origin\nwithin that file.\n\nThe best way is to add `:finish` command in the middle of your .vimrc.\nThen restart again using the same command line. If the error still\noccurs, the bug must be caused because of a setting in the first half of\nyour .vimrc. If it doesn't happen, the problematic setting must be in\nthe second half of your .vimrc. So move the `:finish` command to the\nmiddle of that half, of which you know that triggers the error and move\nyour way along, until you find the problematic option. If your .vimrc is\n350 lines long, you need at a maximum 9 tries to find the offending line\n(in practise, this can often be further reduced, since often lines\ndepend on each other).\n\nIf the problem does not occur, when only loading your .vimrc file, the\nerror must be caused by a plugin or another runtime file (indent\nautoload or syntax script). Check the output of the `:scriptnames` command\nto see what files have been loaded and for each one try to disable each\none by one and see which one triggers the bug. Often files that are\nloaded by vim, have a simple configuration variable to disable them, but\nyou need to check inside each file separately.\n\nYou can also use the -V command line argument to get more debug\ninformation to analyze the problem:\n\n $ vim -V2logfile\n\nYou can increase the value passed to the -V argument to get more debug\ninformation. By also specifying a logfile name, this makes sure, the\ndebug messages don't appear on the screen and won't disturb you when\ntrying to reproduce the problem.\n\n\nFor more information, read:\n\nB<:help -u>\n\nB<:help -U>\n\nB<:help -N>\n\nB<:help -V>\n\nB<:help 'verbose'>\n\nB<:help :verbose>\n\nB<:help :set-verbose>\n\n\n\n=head2 2.6. Where can I report bugs?\n\nFirst collect the required information using the following command:\n\n :source $VIMRUNTIME/bugreport.vim\n\nNow send the resulting text from the above command to the bugs@vim.org\ne-mail address. There is also a public bug tracker available at\nhttps://github.com/vim/vim/issues. A copy of each message there\nwill be forwarded to the Vim Development list.\n\nThe Vim Development mailing list (see Question 2.2) is a good place to\ndiscuss general bugs.  If the bug you find is with syntax highlighting,\na runtime file, or some other \"added feature\" (i.e. not directly\nprogrammed into vim), attempt to inform the maintainer of that feature.\nHis e-mail address will be mentioned at the top of the corresponding\nruntime file.\n\nFor more information, read:\n\nB<:help bug-reports>\n\n\n\n=head2 2.7. Where can the FAQ be found?\n\nThe FAQ can be found at https://vimhelp.org/vim_faq.txt.html.\nIt will be auto-generated from the source that is managed in the github\nrepository https://www.github.com/chrisbra/vim_faq (Patches are welcome).\n\nThe repository also includes the faq in different formats, e.g. manpage,\npdf file, html file, plain text version and a version in vim help format.\n\nA slightly older version (which doesn't seem to get updated anymore) can\nstill be found at VimOnline (https://www.vim.org/).\n\n\n=head2 2.8. What if I don't find an answer in this FAQ?\n\nThis FAQ covers mainly Vim-specific questions. You may find more\ninformation suitable for most Vi clones by reading the Vi FAQ. It is posted\nregularly on comp.editors. You can also find a copy at\n\n http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\nAlso, since Vim has gathered so many features in the last few years,\nsuccessfully documenting the frequently asked questions here is a\nnear-impossible task. To make it possible, please email the maintainer if\nyou have a good question. A good question is one that you've tried to\nanswer yourself (remember, Vim has great documentation) but struggled.\n\n\n=head2 2.9. I have a patch for implementing a Vim feature. Where can I send this\n  patch?\n\nYou can send your patches to the Vim developer mailing list\nvim-dev@vim.org.\n\nFor more information, read:\n\nB<:help vim-dev>\n\n\n\n=head2 2.10. I have a Vim tip or developed a new Vim syntax/indent/filetype/\n   compiler plugin or developed a new script or a colorscheme.\n   Is there a public website where I can upload this?\n\nYes. You can use the Vim Online website to upload your plugins/scripts,\ncolorschemes, etc. The site is at https://www.vim.org\nNowadays people also seem to share their plugins/runtime files at\ngithub.\n\nTips can also be shared in the Wiki which you can find at\n\n http://vim.wikia.com\n\n\n\n=head1 AVAILABILITY\n\n\n\n=head2 3.1. What is the latest version of Vim?\n\nThe latest version of Vim is 8.2 released on 12th December 2019.\n\nThe release history of different versions of Vim is below:\n\n VERSION         RELEASE DATE\n --------------  --------------------\n Version 9.1     2nd January, 2024\n Version 9.0     28th June, 2022\n Version 8.2     12th December, 2019\n Version 8.1     17th May, 2018\n Version 8.0     12th September, 2016\n Version 7.4     10th August, 2013\n Version 7.3     15th August, 2010\n Version 7.2     9th August, 2008\n Version 7.1     12th May, 2007\n Version 7.0     8th May, 2006\n Version 6.4     15th October, 2005\n Version 6.3     8th June, 2004\n Version 6.2     1st June, 2003\n Version 6.1     24th March, 2002\n Version 6.0     27th September, 2001\n Version 5.8     31st May, 2001\n Version 5.7     24th June, 2000\n Version 5.6     16th January, 2000\n Version 5.5     21st September, 1999\n Version 5.4     26th July, 1999\n Version 5.3     31st August, 1998\n Version 5.2     24th August, 1998\n Version 5.1     7th April, 1998\n Version 5.0     19th February, 1998\n Version 4.6     13th March, 1997\n Version 4.5     17th October, 1996\n Version 4.2     5th July, 1996\n Version 4.0     29th May, 1996\n Version 3.0     12th August, 1994\n Version 2.0     21st December, 1993\n Version 1.27    23rd April, 1993\n Version 1.17    21st April, 1992\n Version 1.14    2nd November, 1991\n\nIf you are interested in the old release history, check out the\nvim-history git repository:\nhttps://github.com/vim/vim-history\nand especially for the release history:\nhttps://github.com/vim/vim-history#release-history\n\nFor more information, read:\n\nB<:help new-9>\n\nB<:help new-8>\n\nB<:help changed-9.1>\n\nB<:help changed-8.2>\n\nB<:help changed-8.1>\n\n\n\n=head2 3.2. Where can I find the latest version of Vim?\n\nYou can download the sources for the latest version of Vim from the\nGithub repository. The URL for this site is\n\n https://github.com/vim/vim\n\nA mercurial mirror is also available:\n\n https://www.vim.org/hgweb/vim/\n\nSome users keep updated repositories for distributing latest binary\nversions of Vim. You can find those repositories here:\n\n http://vim.wikia.com/wiki/Where_to_download_Vim\n\n\n=head2 3.3. What platforms does it run on?\n\nAll Unix platforms.\nAll Windows platforms (10 and later).\nAmiga, Macintosh, MachTen, VMS, IBM z/OS.\n\nFor MS-DOS support has been removed with the latest releases of Vim.\n16-bit DOS: latest supported version 7.1\n32-bit DOS: latest supported version 7.3\nWindows XP and Visat: latest supported version 9.0\n\n\n=head2 3.4. Where can I download the latest version of the Vim runtime files?\n\nYou can download the latest version of the Vim runtime files (syntax files,\nfiletype plugins, compiler files, color schemes, documentation, indentation\nfiles and keymaps) from the Vim github repository\n\n https://github.com/vim/vim/tree/master/runtime\n\nAnother way of downloading the runtime files is this:\n\n wget https://github.com/vim/vim/archive/master.tar.gz -O- |\n tar zfx - vim-master/runtime/ --strip-components=1\n\nSee also:\n\n https://www.vim.org/runtime.php\n\n\n\n=head1 HELP\n\n\n\n=head2 4.1. How do I use the help files?\n\nHelp can be found for all functions of Vim. In order to use it, use the\n`:help` command.  This will bring you to the main help page. On that first\npage, you will find explanations on how to move around. Basically, you move\naround in the help pages the same way you would in a read-only document.\nYou can jump to specific subjects by using tags. This can be done in two\nways:\n\n   * Use the CTRL-] command while standing on the name of a command\n  or option. This only works when the tag is a keyword.\n  <Ctrl-LeftMouse> and g<LeftMouse> work just like CTRL-].\n\n   * use the `:tag <subject>` command. This works with all characters.\n\nUse CTRL-T to jump back to previous positions in the help files. Use\n`:q` to close the help window.\n\nIf you want to jump to a specific subject on the help pages, use\n`:help {subject}` . If you don't know what to look for, try `:help index`\nto get a list of all available subjects. Use the standard search keys to\nlocate the information you want.\nYou can abbreviate the `:help` command as `:h`.\n\nFor searching the help, see the next Question 4.2.\n\nFor more information, read:\n\nB<:help online-help>\n\n\n\n=head2 4.2. How do I search for a keyword in the Vim help files?\n\na)  You can press the CTRL-D key after typing the help keyword to get a\n list of all the help keywords containing the supplied pattern. You can\n also use the meta characters like *, \\+, etc to specify the help\n search pattern:\n\nB<:help init<C-D>>\n\nB<:help str*()<C-D>>\n\nB<:help '*indent<C-D>>\n\n\nb)  You can press the <Tab> key after typing a partial help keyword to expand\n to the matching keyword. You can continue to press the <Tab> key to see\n other keyword matches.\n\nc)  From the help window, you can use the `:tag` command to search for\n keywords. For example,\n\n :tselect /window\n\n This command will list all the help keywords containing the text\n \"window\". You can select one from the list and jump to it.\n\nd)  You can use the `:helpgrep` command to search for the given text in\n all the help files. The quickfix window will be opened with all the\n matching lines.\n\nFor more information, read:\n\nB<:help help-summary>\n\nB<:help c_CTRL-D>\n\nB<:help c_<Tab>>\n\nB<:help :tselect>\n\nB<:help :help>\n\nB<:help :helpgrep>\n\n\n\n=head2 4.3. I am getting an error message E123, what did I do wrong?\n\nYou can get more information about the error and the error message using:\n\nB<:help E123>\n\n\nFor more information, read:\n\nB<:help error-messages>\n\n\n\n=head2 4.4. Where can I read about the various modes in Vim?\n\nYou can get information about the different modes in Vim by reading\n\nB<:help vim-modes>\n\n\n\n=head2 4.5. How do I generate the Vim help tags file after adding a new Vim help\n  file?\n\nYou can use the `:helptags` command to regenerate the Vim help tag file\nfrom within Vim. For example:\n\n :cd $VIMRUNTIME/doc\n :helptags .\n\nTo update all \"doc\" directories in your 'runtimepath', you can use\n\n :helptags ALL\n\nFor more information, read:\n\nB<:help :helptags>\n\nB<:help add-local-help>\n\n\n\n=head2 4.6. Can I use compressed versions of the help files?\n\nYes. You can compress the help files and still be able to view them with\nVim.  This makes accessing the help files a bit slower and requires the\n\"gzip\" utility. Follow these steps to compress and use the Vim help files:\n\n- Compress all the help files using \"gzip doc/*.txt\".\n\n- Edit the \"doc/tags\" file and change the \".txt\" to \".txt.gz\" using\n     :%s=\\(\\t.*\\.txt\\)\\t=\\1.gz\\t=\n\n- Add the following line to your vimrc:\n     set helpfile={dirname}/help.txt.gz\n\nWhere {dirname} is the directory where the help files are.  The gzip.vim\nplugin supplied with the standard Vim distribution will take care of\ndecompressing the files.  You must make sure that $VIMRUNTIME is set to\nwhere the other Vim files are, when they are not in the same location as\nthe compressed \"doc\" directory.\n\nNote, that the `:helpgrep` command does not work with compressed help pages.\n\nFor more information, read:\n\nB<:help gzip-helpfile>\n\nB<:help 'helpfile'>\n\nB<:help gzip>\n\nB<:help $VIMRUNTIME>\n\n\n\n\n=head1 EDITING A FILE\n\n\n\n=head2 5.1. How do I load a file in Vim for editing?\n\nThere are several ways to load a file for editing. The simplest is to\nuse the `:e` (:edit) command:\n\n :e <filename>\n\nYou can also use the `:n` (:next) command to load files into Vim:\n\n :n <filename(s)>\n\nYou can also use the `:args` command to load files into Vim:\n\n :args <filename(s)>\n\nFor more information, read:\n\nB<:help usr_07.txt>\n\nB<:help edit-files>\n\nB<:help :edit>\n\nB<:help :next_f>\n\nB<:help :args_f>\n\n\n\n=head2 5.2. How do I save the current file in another name (save as) and edit a\n  new file?\n\nYou can use the `:saveas` command to save the current file in another name:\n\n :saveas <newfilename>\n\nAlternatively, you can also use the following commands:\n\n :w <newfilename>\n :edit #\n\nYou can also use the `:file` command, followed by `:w` command:\n\n :file <newfilename>\n :w\n\nFor more information, read:\n\nB<:help 07.7>\n\nB<:help :saveas>\n\nB<:help :file_f>\n\nB<:help :w>\n\n\n\n=head2 5.3. How do I change the current directory to the directory of the current\n  file?\n\nYou can use the following command to change the current directory to the\ndirectory of the current file:\n\n :cd %:p:h\n\nTo automatically change the current directory to the directory of the\ncurrent file, simply set the option 'autochdir'.\n\n :set autochdir\n\nFor more information, read:\n\nB<:help :cd>\n\nB<:help :lcd>\n\nB<:help filename-modifiers>\n\nB<:help autocommand>\n\nB<:help 'acd'>\n\nB<:help getcwd()>\n\n\n\n=head2 5.4. How do I write a file without the line feed (EOL) at the end of the\n  file?\n\nYou can turn off the 'eol' option and turn on the 'binary' option to write\na file without the EOL at the end of the file:\n\n :set binary\n :set noeol\n :w\n\nAlternatively, you can use:\n\n :set noeol\n :w ++bin\n\nIf you rather only like Vim not to write missing EOLs, you can reset the\n'fixeol' option. This needs a Vim newer 7.4.785, so you should wrap this\nin an if condition in your .vimrc like this:\n\n if exists('+fixeol')\n     set nofixeol\n endif\n\nThis has the advantage of avoiding the many side effects that the\n'binary' option has.\n\nFor more information, read:\n\nB<:help 'endofline'>\n\nB<:help 'fixeol'>\n\nB<:help 'binary'>\n\nB<:help 23.4>\n\n\n\n=head2 5.5. How do I configure Vim to open a file at the last edited location?\n\nVim stores the cursor position of the last edited location for each buffer\nin the '\"' register. You can use the following autocmd in your .vimrc or\n.gvimrc file to open a file at the last edited location:\n\n au BufReadPost * if line(\"'\\\"\") > 0 && line(\"'\\\"\") <= line(\"$\") |\n                      \\ exe \"normal! g`\\\"\" | endif\n\nAlternatively, you can simply source the vimrc_example.vim file, which is\ndistributed with Vim.\n\nFor more information, read:\n\nB<:help '\">\n\nB<:help last-position-jump>\n\nB<:help vimrc_example.vim>\n\n\n\n=head2 5.6. When editing a file in Vim, which is being changed by an external\n  application, Vim opens a warning window (like the confirm dialog) each\n  time a change is detected. How do I disable this warning?\n\nYou can set the Vim 'autoread' option to automatically read the file again\nwhen it is changed outside of Vim:\n\n :set autoread\n\nYou can also use the following autocommand:\n\n autocmd FileChangedShell *\n       \\ echohl WarningMsg |\n       \\ echo \"File has been changed outside of vim.\" |\n       \\ echohl None\n\nFor more information, read:\n\nB<:help 'autoread'>\n\nB<:help FileChangedShell>\n\nB<:help timestamp>\n\nB<:help :checktime>\n\n\n\n=head2 5.7. How do I edit a file whose name is under the cursor?\n\nYou can use the gf command to edit a file whose name is under the cursor.\nYou can use the CTRL-W f command to edit the file in a new window and\nfinally you can use CTRL-W gf top open a new tab page that contains the\nfile name under the cursor.\n\nFor more information, read:\n\nB<:help gf>\n\nB<:help CTRL-W_f>\n\nB<:help CTRL-W_gf>\n\nB<:help 'isfname'>\n\nB<:help 'path'>\n\nB<:help 'suffixesadd'>\n\nB<:help 'includeexpr'>\n\n\n\n=head2 5.8. How do I reload/re-edit the current file?\n\nYou can use the `:edit` command, without specifying a file name, to reload\nthe current file.  If you have made modifications to the file, you can use\n`:edit!` to force the reload of the current file (you will lose your\nmodifications, but depending on your 'undoreload' settings, those\nchanges might be saved into the undo history).\n\nFor more information, read:\n\nB<:help :edit>\n\nB<:help :edit!>\n\nB<:help 'confirm'>\n\nB<:help 'undoreload'>\n\n\n\n=head2 5.9. How do I autosave a file periodically?\n\nVim doesn't support auto-saving a file periodically.\n\nFor more information, read:\n\nB<:help 'updatetime'>\n\nB<:help CursorHold>\n\nB<:help swap-file>\n\n\n\n=head2 5.10. How do I open a file in read-only mode?\n\nYou can open a file in read-only mode using the `:view` command:\n\n :view <filename>\n\nThis command sets the 'readonly' option for the opened buffer. You can also\nuse the \"-R\" command-line option to open a file in read-only mode:\n\n $ vim -R <filename>\n\nYou can also use the symbolic link executable \"view\" to open a file in\nread-only mode from the command-line:\n\n $ view <filename>\n\nFor more information, read:\n\nB<:help 07.6>\n\nB<:help 'readonly'>\n\nB<:help 'modifiable'>\n\nB<:help :view>\n\nB<:help :sview>\n\nB<:help view>\n\nB<:help -R>\n\nB<:help -M>\n\n\n\n=head2 5.11. How do I open a file for editing without saving the modifications to\n   the current file?\n\nYou can open a file for editing without saving the modifications to the\ncurrent file and without losing the changes using one of the following\nmethods:\n\n :split <new_filename>\n :new <new_filename>\n\nYou can also set the 'hidden' option and edit a new file:\n\n :set hidden\n :e <new_filename>\n\nIf you want to discard the changes made to the current file and load\nanother file for editing, then you can use the following command:\n\n :e! <new_filename>\n\nFor more information, read:\n\nB<:help :edit!_f>\n\nB<:help 'hidden'>\n\nB<:help :split>\n\nB<:help :new>\n\n\n\n=head2 5.12. How do I reduce the loading time for very large files in Vim?\n\nYou can use the following settings to reduce the loading time for\nvery large files in Vim:\n\n :set lazyredraw\n :set noswapfile\n :set undolevels=-1\n :set eventignore=all\n :set nohidden\n :set syntax=off\n\nNote that the above settings will disable many Vim features including the\nfollowing: Swap files support for crash recovery, undo support, syntax\nhighlighting, filetype detection and other autocommand based features.\n\nThere is also the LargeFile plugin available at\n\n https://www.vim.org/scripts/script.php?script_id=1506\n\nwhich automatically sets these options, when working with large files\n(it is configurable, what is considered to be a large file, by default,\nit is 100MB).\n\n\n\n=head1 EDITING MULTIPLE FILES\n\n\n\n=head2 6.1. How do I open multiple files at once from within Vim?\n\nMake a difference between args, buffers, tabs and windows. They are all\ndifferent things in VIM.\n\nargs is a list of arguments. Buffers are place to edit text, almost\nalways attached to a file but not necessarily. Window is a place for a\nbuffer and tab is set of windows, better name would be \"layout\".\n\nThere are several ways to open multiple files at once from within Vim. You\ncan use the `:next` command to specify a group of files:\n\n :next f1.txt f2.txt\n :next *.c\n\nYou can use the `:args` command to specify a group of files as arguments:\n\n :args f1.txt f2.txt\n :args *.c\n\nAfter loading the files, you can use the `:next` and `:prev` command to\nswitch between the files.\n\nTo execute command for all files in argument-list use `:argdo`\n\nFor more information, read:\n\nB<:help 07.2>\n\nB<:help :next>\n\nB<:help :args_f>\n\nB<:help argument-list>\n\n\n\n=head2 6.2. How do I switch between multiple files/buffers in Vim?\n\nTo list all buffers use `:ls`, to list buffers without file attached to\n(also known as unlisted buffers, ex. scratch buffer and help-window) use\n`:ls!`\n\nThere are several ways to switch between multiple files. You can use the\n`:buffer` command to switch between multiple files. You can also shorten\ncommand as `:b` and use only part of the filename. For example,\n\n :buffer file1\n :buffer file2\n :b e2\n\nYou can also use <TAB> after `:b` for autocompletion. Try also `:b`\nfollowed by CTRL-D to see all available buffers. This works also for\n`:e`.\n\nYou can also use the CTRL-^ key to switch between buffers. By specifying a\ncount before pressing the key, you can edit the buffer with that number.\nWithout the count, you can edit the alternate buffer by pressing CTRL-^\n\nYou can also use the `:e #` command to edit a particular buffer:\n\n :e #5\n\nTo close a buffer use `:bd` -command.\n\nTo execute command for all files in buffer-list use `:bufdo`\n\nFor more information, read:\n\nB<:help edit-files>\n\nB<:help :buffer>\n\nB<:help CTRL-^>\n\nB<:help alternate-file>\n\nB<:help 22.4>\n\nB<:help 07.3>\n\n\n\n=head2 6.3. How do I open several files in Vim, with each file in a separate\n  window/tab?\n\nYou can use the -o and -O Vim command line arguments to open multiple files\nin separate horizontally or vertically split Vim windows. For example:\n\n $ vim -o3 f1.txt f2.txt f3.txt\n\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate horizontally split Vim windows.\n\n $ vim -O3 f1.txt f2.txt f3.txt\n\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate vertically split Vim windows.\n\n $ vim -p f1.txt f2.txt f3.txt\n\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate tab windows. The option 'tabpagemax' defines, how many tabpages\ncan be opened at the same time, by default it is set to 10.\n\nFor more information, read:\n\nB<:help -o>\n\nB<:help -O>\n\nB<:help -p>\n\nB<:help startup-options>\n\nB<:help 'tabpagemax'>\n\n\n\n=head2 6.4. How do I configure Vim to autoload several files at once similar to\n  \"work-sets\" or \"projects\"?\n\nYou can use the `:mksession` and the `:mkview` commands to autoload several\nfiles in Vim.\n\nThe `:mksession` command creates a Vim script that restores the current\nediting session. You can use the `:source` command to source the file\nproduced by the mksession command.\n\nThe `:mkview` command creates a Vim script that restores the contents of\nthe current window. You can use the `:loadview` command to load the view\nfor the current file.\n\nFor more information, read:\n\nB<:help 21.4>\n\nB<:help 21.5>\n\nB<:help views-sessions>\n\nB<:help 'sessionoptions'>\n\nB<:help :mksession>\n\nB<:help :source>\n\nB<:help v:this_session>\n\nB<:help :mkview>\n\nB<:help :loadview>\n\nB<:help 'viewdir'>\n\nB<:help buffers>\n\n\n\n=head2 6.5. Is it possible to open multiple top level windows in a single instance\n  of Vim similar to Nedit or Emacs?\n\nNo. It is currently not possible to open multiple top-level windows in a\nsingle instance of Vim. This feature is in the todo list.\n\n\n=head2 6.6. How do I browse/explore directories from within Vim?\n\nYou can use the netrw.vim plugin, supplied with the standard Vim\ninstallation, to browse/explore directories from within Vim. You can start\nthe file explorer using one of the following commands:\n\n :e <directory>\n :Explore\n :Sexplore\n :Vexplore\n :Texplore\n\nFrom the file explorer, you can browse through directories, rename, delete\nand edit files.\n\nFor more information, read:\n\nB<:help netrw.vim>\n\nB<:help 22.1>\n\n\n\n=head2 6.7. How do I edit files over a network using ftp/scp/rcp/http?\n\nYou can use the netrw.vim plugin, supplied with the standard Vim package,\nto edit files over a network using ftp/scp/rcp/http. Using this plugin, Vim\nwill transparently load and save the files over ftp/scp/rcp/http. For\nexample, to edit a file over ftp, you can use the following command:\n\n $ vim ftp://machine/path\n\nFor more information, read:\n\nB<:help netrw.vim>\n\n\n\n\n=head1 BACKUP\n\n\n\n=head2 7.1. When I edit and save files, Vim creates a file with the same name as\n  the original file and a \"~\" character at the end. How do I stop Vim\n  from creating this file? (or) How do I disable the Vim backup file\n  feature?\n\nYou have set the 'backup' option, so Vim creates a backup file when saving\nthe original file. You can stop Vim from creating the backup file, by\nclearing the option:\n\n :set nobackup\n\nNote that, by default this option is turned off. You have explicitly\nenabled the 'backup' option in one of the initialization files. You may\nalso have to turn off the 'writebackup' option:\n\n :set nowritebackup\n\nFor more information, read:\n\nB<:help 07.4>\n\nB<:help backup-table>\n\nB<:help 'backup'>\n\nB<:help 'writebackup'>\n\nB<:help 'backupskip'>\n\nB<:help 'backupdir'>\n\nB<:help 'backupext'>\n\nB<:help 'backupcopy'>\n\nB<:help backup>\n\n\n\n=head2 7.2. When I edit and save files, Vim creates a file with the same name as\n  the original file and a \"un~\" extension at the end. How do I stop Vim\n  from creating this file (or) How do I disable the Vim undofile feature?\n\nVim 7.3 contains as new feature persistent undo, that is, undo information\nwon't be lost when quitting Vim and be stored in a file that ends with\n\".un~\" You have set the 'undofile' option, so Vim creates an undo file when\nsaving the original file. You can stop Vim from creating the backup file,\nby clearing the option:\n\n :set noundofile\n\nNote that, by default this option is turned off. You have explicitly\nenabled the 'undofile' option in one of the initialization files. If you\nwant your undofiles to be stored only in a particular directory, you can\npoint the 'undodir' option to a directory that will contain all your\naggregated undofiles.\n\nFor more information, read:\n\nB<:help 'undodir'>\n\nB<:help 'undofile'>\n\nB<:help undo-persistence>\n\n\n\n=head2 7.3. How do I configure Vim to store all the backup files in a particular\n  directory?\n\nYou can configure Vim to store all the backup files in a particular\ndirectory using the 'backupdir' option. For example, to store all the\nbackup files in the ~/backup directory, you can use the following command:\n\n :set backupdir=~/backup\n\nFor more information, read:\n\nB<:help 07.4>\n\nB<:help 'backupdir'>\n\nB<:help backup>\n\n\n\n=head2 7.4. When I save a file with Vim, the file permissions are changed.\n  How do I configure Vim to save a file without changing the file\n  permissions?\n\nThis may happen, if the 'backupcopy' option is set to \"no\" or \"auto\". Note\nthat the default value for this option is set in such a way that this will\ncorrectly work in most of the cases. If the default doesn't work for you,\ntry setting the 'backupcopy' option to \"yes\" to keep the file permission\nwhen saving a file:\n\n :set backupcopy=yes\n\nThis applies, only if you have configured Vim to make a backup whenever\noverwriting a file. By default, Vim will not backup files.\n\nFor more information, read:\n\nB<:help 'backupcopy'>\n\nB<:help backup>\n\nB<:help 'backup'>\n\nB<:help 'writebackup'>\n\n\n\n\n=head1 BUFFERS\n\n\n\n=head2 8.1. I have made some modifications to a buffer. How do I edit another\n  buffer without saving the modified buffer and also without losing the\n  modifications?\n\nYou can set the 'hidden' option to edit a file without losing modifications\nto the current file:\n\n :set hidden\n\nBy setting the 'hidden' option, you can also save the modification history\n(undo-history) for the buffer. Otherwise, as you switch between files, the\nundo-history will be lost (unless you use persistent undofiles).\n\nFor more information, read:\n\nB<:help 'hidden'>\n\nB<:help hidden-quit>\n\nB<:help :hide>\n\n\n\n=head2 8.2. How do I configure Vim to auto-save a modified buffer when switching\n  to another buffer?\n\nYou can set the 'autowrite' option to auto-save a modified buffer when\nswitching to another buffer:\n\n :set autowrite\n\nFor more information, read:\n\nB<:help 'autowrite'>\n\nB<:help 'autowriteall'>\n\nB<:help 'hidden'>\n\n\n\n=head2 8.3. How do I replace the buffer in the current window with a blank buffer?\n\nYou can use the `:enew` command to load an empty buffer in place of the\nbuffer in the current window.\n\nFor more information, read:\n\nB<:help :enew>\n\n\n\n=head2 8.4. Is there a keyboard shortcut to load a buffer by the buffer number?\n\nYou can use the CTRL-^ command to load a buffer by specifying the buffer\nnumber. For example, to load buffer number 5, you have to use the 5 CTRL-^\ncommand.\n\nFor more information, read:\n\nB<:help CTRL-^>\n\n\n\n=head2 8.5. How do I open all the current buffers in separate windows?\n\nYou can use the `:ball` or `:sball` commands to open all the buffers\nin the buffer list:\n\n :ball\n\nIf you want all buffers to be opened in new tabs, simply prefix the `:tab`\ncommand:\n\n :tab :sball\n\nFor more information, read:\n\nB<:help :ball>\n\n\n\n=head2 8.6. How do I close (delete) a buffer without exiting Vim?\n\nYou can use any of `:bdelete`, `:bwipeout` or `:bunload` commands to\ndelete a buffer without exiting Vim. For example:\n\n :bdelete file1\n\nFor more information, read:\n\nB<:help :bdelete>\n\nB<:help :bwipeout>\n\nB<:help :bunload>\n\n\n\n=head2 8.7. When I use the command `:%bd` to delete all the buffers, not all the\n  buffers are deleted. Why?\n\nIn the `:%bd` command, the \"%\" range will be replaced with the starting and\nending line numbers in the current buffer. Instead of using \"%\" as the\nrange, you should specify numbers for the range. For example, to delete all\nthe buffers, you can use the command `:1,9999bd`.\n\nFor more information, read:\n\nB<:help :bd>\n\n\n(This behaviour has been fixed with patch 7.4.530)\n\n\n=head2 8.8. How do I display the buffer number of the current buffer/file?\n\nYou can use 2<CTRL-G> command to display the buffer number for the current\nfile/buffer. Note the use of count before the CTRL-G command. If the count\nis greater than 1, then Vim will display the buffer number.\n\nYou can also use the following command to display the current buffer\nnumber:\n\n :echo bufnr(\"%\")\n\nYou can also include the \"%n\" field to the 'statusline' option to display\nthe current buffer number on the statusline.\n\nFor more information, read:\n\nB<:help CTRL-G>\n\nB<:help bufnr()>\n\nB<:help :echo>\n\nB<:help 'statusline'>\n\n\n\n=head2 8.9. How do I delete a buffer without closing the window in which the\n  buffer is displayed?\n\nYou can use the following command to open the next buffer and delete\nthe current buffer.\n\n :bnext | bdelete #\n\nFor more information, read:\n\nB<:help :bnext>\n\nB<:help :bdelete>\n\nB<:help :buffers>\n\n\n\n=head2 8.10. How do I map the <Tab> key to cycle through and open all the buffers?\n\nYou can use the following two map commands, to map the <Ctrl-Tab> key to open\nthe next buffer and the <Ctrl-Shift-Tab> key to open the previous buffer:\n\n :nnoremap <C-Tab> :bnext<CR>\n :nnoremap <S-C-Tab> :bprevious<CR>\n\nNote, this might not work in the terminal version of Vim.\n\nFor more information, read:\n\nB<:help :bnext>\n\nB<:help :bprevious>\n\n\n\n\n=head1 WINDOWS\n\n\n\n=head2 9.1. What is the difference between a Vim window and a buffer?\n\nA Vim buffer is a file loaded into memory for editing. The original file\nremains unchanged until you write the buffer to the file. A Vim window is a\nviewport onto a buffer. You can use multiple windows on one buffer or\nseveral windows on different buffers.\n\nFor more information, read:\n\nB<:help usr_08.txt>\n\nB<:help 22.4>\n\nB<:help windows-intro>\n\nB<:help Q_wi>\n\n\n\n=head2 9.2. How do I increase the width of a Vim window?\n\nYou can increase the width of a Vim window using one of the following\ncommands:\n\n :vert resize +N\n :vert resize -N\n :vert resize N\n\nYou can also use CTRL-W < or CTRL-W > or CTRL-W | commands.\n\nFor more information, read:\n\nB<:help :vertical-resize>\n\nB<:help CTRL-W_>>\n\nB<:help CTRL-W_<>\n\nB<:help window-resize>\n\n\n\n=head2 9.3. How do I zoom into or out of a window?\n\nYou can zoom into a window (close all the windows except the current\nwindow) using the \"<CTRL-W>o\" command or the `:only` ex command.\n\nYou can use the \"<CTRL-W>_\" command or the `:resize` ex command to increase\nthe current window height to the highest possible without closing other\nwindows.\n\nYou can use the \"<CTRL-W>|\" command or the `:vertical resize` ex command to\nincrease the current window width to the highest possible without closing\nother windows.\n\nYou can use the \"<CTRL-W>=\" command to make the height and width of all the\nwindows equal.\n\nYou can also set the following options to get better results with the above\ncommands:\n\nMethod 1:\nSet the 'winminheight' option to 0:\n\n :set winminheight=0\n\nBy default, this option is set to 1.\nThis option controls the minimum height of an inactive window (when it is\nnot the current window).  When the 'winminheight' option is set to 0, only\nthe status line will be displayed for inactive windows.\n\nMethod 2:\nSet the 'noequalalways' option and set the 'winheight' option to a large\nvalue (like 99999):\n\n :set noequalalways\n :set winheight=99999\n\nNow, the active window will always open to its maximum size, while the\nother windows will stay present, but shrunken to just a status line.\n\nWith any of the above mentioned methods, you cannot restore the window\nlayout after zooming into a window.  If you want to restore the Vim window\nlayout after zooming into a window, you can use the ZoomWin plugin. You can\ndownload this plugin from the Vim online website at:\n\n https://www.vim.org/scripts/script.php?script_id=508\n\nFor more information, read:\n\nB<:help CTRL-W_o>\n\nB<:help window-resize>\n\nB<:help 'winminheight'>\n\nB<:help 'equalalways'>\n\nB<:help 'winheight'>\n\nB<:help 08.3>\n\n\n\n=head2 9.4. How do I execute an ex command on all the open buffers or open windows\n  or all the files in the argument list?\n\nYou can use the `:bufdo` command to execute an ex command on all the open\nbuffers.  You can use the `:windo` command to execute an ex command on all\nthe open windows.  You can use the `:argdo` command to execute an ex\ncommand on all the files specified in the argument list. And finally you\ncan use the `:tabdo` command to execute an ex command in all open tab pages.\n\nFor more information, read:\n\nB<:help :windo>\n\nB<:help :bufdo>\n\nB<:help :argdo>\n\nB<:help :tabdo>\n\nB<:help 26.3>\n\n\n\n\n=head1 MOTION\n\n\n\n=head2 10.1. How do I jump to the beginning (first line) or end (last line) of a\n  file?\n\nYou can use \"G\" command to jump to the last line in the file and the \"gg\"\ncommand to jump to the first line in the file.\n\nFor more information, read:\n\nB<:help G>\n\nB<:help gg>\n\n\n\n=head2 10.2. In insert mode, when I press the <Esc> key to go to command mode, the\n  cursor moves one character to the left (except when the cursor is on\n  the first character of the line). Is it possible to change this\n  behavior to keep the cursor at the same column?\n\nNo. It is not possible to change this behavior. The cursor is *always*\npositioned on a valid character (unless you have virtual-edit mode\nenabled). So, if you are appending text to the end of a line, when you\nreturn to command mode the cursor *must* drop back onto the last character\nyou typed. For consistency sake, the cursor drops back everywhere, even if\nyou are in the middle of a line.\n\nYou can use the CTRL-O or CTRL-\\ CTRL-O command in insert mode to execute a\nsingle ex command and return back to insert mode without moving the cursor\ncolumn.\n\nFor more information, read:\n\nB<:help 'virtualedit'>\n\nB<:help i_CTRL-O>\n\nB<:help i_CTRL-\\_CTRL-O>\n\n\n\n=head2 10.3. How do I configure Vim to maintain the horizontal cursor position when\n  scrolling with the <Page Up>, <Page Down>, etc keys?\n\nYou can reset the 'startofline' option to keep the cursor at the same\nhorizontal location when scrolling text:\n\n :set nostartofline\n\nFor more information, read:\n\nB<:help 'startofline'>\n\n\n\n=head2 10.4. Some lines in a file are more than the screen width and they are all\n  wrapped. When I use the j, k keys to move from one line to the next,\n  the cursor is moved to the next line in the file instead of the next\n  line on the screen. How do I move from one screen line to the next?\n\nYou can use the gj and gk commands to move from one screen line to the\nnext/previous screen line. The j and k commands move the cursor from one\nfile line to the next file line. You can also avoid the line wrapping by\nresetting the 'wrap' option:\n\n :set nowrap\n\nFor more information, read:\n\nB<:help gj>\n\nB<:help gk>\n\nB<:help 'wrap'>\n\n\nYou can use the following mappings:\n\n :map <Up> gk\n :imap <Up> <C-o>gk\n :map <Down> gj\n :imap <Down> <C-o>gj\n :noremap j gj\n :noremap k gk\n\n\n=head2 10.5. What is the definition of a sentence, paragraph and section in Vim?\n\nA sentence is defined as ending at a \".\", \"!\" or \"?\" followed by either the\nend of a line, or by a space (or two) or tab. Which characters and the\nnumber of spaces needed to constitute a sentence ending is determined by\nthe 'joinspaces' and 'cpoptions' options.\n\nA paragraph begins after each empty line, and also at each of a set of\nparagraph macros, specified by the pairs of characters in the 'paragraphs'\noption.\n\nA section begins after a form-feed (<C-L>) in the first column and at each\nof a set of section macros, specified by the pairs of characters in the\n'sections' option.\n\nFor more information, read:\n\nB<:help sentence>\n\nB<:help 'joinspaces'>\n\nB<:help 'cpoptions'>\n\nB<:help paragraph>\n\nB<:help section>\n\nB<:help word>\n\n\n\n=head2 10.6. How do I jump to beginning or end of a sentence, paragraph or a\n  section?\n\nYou can use the following motion commands to jump to the beginning or end\nof a sentence or a paragraph or a section:\n\n   motion  position    where\n   ------  ---------   -----------------\n   (       beginning   current sentence\n   )       end         current sentence\n   {       beginning   current paragraph\n   }       end         current paragraph\n   []      end         previous section\n   [[      beginning   current section\n   ][      end         current section\n   ]]      beginning   next section\n\nEach of these motions can be preceded by a number which will extend the\njump forward (or backward).\n\nFor more information, read:\n\nB<:help object-motions>\n\n\n\n=head2 10.7. I have lines in a file that extends beyond the right extent of the\n  screen. How do I move the Vim view to the right to see the text off\n  the screen?\n\nYou can use one of the following commands to horizontally scroll the screen\nto the left or right:\n\n cmd  scroll to\n ---  --------------------------\n zl   scroll to the left\n zh   scroll to the right\n zL   scroll half a screenwidth to the left\n zH   scroll half a screenwidth to the right\n zs   scroll to position the cursor at the start of the screen\n ze   scroll to position the cursor at the end of the screen\n\nYou can use the g0 command to move the cursor to the first character of the\nscreen line and the g$ command to move the cursor to the last character of\nthe screen line without scrolling the screen.\n\nFor more information, read:\n\nB<:help scroll-horizontal>\n\n\n\n=head2 10.8. How do I scroll two or more buffers simultaneously?\n\nYou can set the 'scrollbind' option for each of the buffers to scroll them\nsimultaneously.\n\nFor more information, read:\n\nB<:help 'scrollbind'>\n\nB<:help scroll-binding>\n\nB<:help 'scrollopt'>\n\nB<:help 'cursorbind'>\n\n\n\n=head2 10.9. When I use my arrow keys, Vim changes modes, inserts weird characters\n  in my document but doesn't move the cursor properly. What's going on?\n\nThere are a couple of things that could be going on: either you are using\nVim over a slow connection or Vim doesn't understand the key sequence that\nyour keyboard is generating.\n\nIf you are working over a slow connection (such as a 2400 bps modem), you\ncan try to set the 'timeout' or 'ttimeout' option. These options, combined\nwith the 'timeoutlen' and 'ttimeoutlen' options, may fix the problem.\n\nThe preceding procedure will not work correctly if your terminal sends key\ncodes that Vim does not understand. In this situation, your best option is\nto map your key sequence to a matching cursor movement command and save\nthese mappings in a file. You can then `:source` the file whenever you work\nfrom that terminal.\n\nFor more information, read:\n\nB<:help 'timeout'>\n\nB<:help 'ttimeout'>\n\nB<:help 'timeoutlen'>\n\nB<:help 'ttimeoutlen'>\n\nB<:help :map>\n\nB<:help vt100-cursor-keys>\n\n\n\n=head2 10.10. How do I configure Vim to move the cursor to the end of the previous\n   line, when the left arrow key is pressed and the cursor is currently\n   at the beginning of a line?\n\nYou can add the \"<\" flag to the 'whichwrap' option to configure Vim to move\nthe cursor to the end of the previous line, when the left arrow key is\npressed and the cursor is currently at the beginning of a line:\n\n :set whichwrap+=<\n\nSimilarly, to move the cursor the beginning of the next line, when the\nright arrow key is  pressed and the cursor is currently at the end of a\nline, add the \">\" flag to the 'whichwrap' option:\n\n :set whichwrap+=>\n\nThe above will work only in normal and visual modes. To use this in insert\nand replace modes, add the \"[\" and \"]\" flags respectively.\n\nFor more information, read:\n\nB<:help 'whichwrap'>\n\nB<:help 05.7>\n\n\n\n=head2 10.11. How do I configure Vim to stay only in insert mode (modeless\n   editing)?\n\nYou can set the 'insertmode' option to configure Vim to stay only in insert\nmode:\n\n :set insertmode\n\nBy setting this option, you can use Vim as a modeless editor. If you press\nthe <Esc> key, Vim will not go to the normal mode. To execute a single\nnormal mode command, you can press CTRL-O followed by the normal mode\ncommand.  To execute more than one normal command, you can use CTRL-L\nfollowed by the commands. To return to insert mode, press the <Esc> key. To\ndisable this option, reset the 'insertmode' option:\n\n :set noinsertmode\n\nYou can also start vim using the \"evim\" command or you can use \"vim -y\" to\nuse Vim as a modeless editor.\n\nYou can also start Vim in insert mode using the `:startinsert` ex command.\n\nFor more information, read:\n\nB<:help 'insertmode'>\n\nB<:help :startinsert>\n\nB<:help :stopinsert>\n\nB<:help i_CTRL-O>\n\nB<:help i_CTRL-L>\n\nB<:help evim>\n\nB<:help evim-keys>\n\n\n\n=head2 10.12. How do I display some context lines when scrolling text?\n\nYou can set the 'scrolloff' option to display a minimal number of screen\nlines (context) above and below the cursor.\n\n :set scrolloff=10\n\nFor more information, read:\n\nB<:help 'scrolloff'>\n\nB<:help 'sidescrolloff'>\n\n\n\n=head2 10.13. How do I go back to previous cursor locations?\n\nYou can go back to the cursor location before the latest jump using the ''\nor `` command. You can use the CTRL-O command to go back to older cursor\npositions and the CTRL-I command to go to the newer cursor positions in the\njump list.\n\nFor more information, read:\n\nB<:help 03.10>\n\nB<:help mark-motions>\n\nB<:help jump-motions>\n\n\n\n\n=head1 SEARCHING TEXT\n\n\n\n=head2 11.1. After I searched for a text with a pattern, all the matched text\n   stays highlighted. How do I turn off the highlighting\n   temporarily/permanently?\n\nThe 'hlsearch' option controls whether all the matches for the last\nsearched pattern are highlighted or not. By default, this option is not\nenabled. If this option is set in a system-wide vimrc file, then you can\nturn off the search highlighting by using the following command:\n\n :set nohlsearch\n\nTo temporarily turn off the search highlighting, use\n\n :nohlsearch\n\nYou can also clear the search highlighting, by searching for a pattern that\nis not in the current file (for example, search for the pattern \"asdf\").\n\nYou can use this mapping, to clear the search highlighting when\nredrawing the window pressing CTRL-L\n\n :nnoremap <silent> <C-L> <C-L>:nohls<CR>\n\nFor more information, read:\n\nB<:help 'hlsearch'>\n\nB<:help :nohlsearch>\n\n\n\n=head2 11.2. How do I enter a carriage return character in a search pattern?\n\nYou can either use \"\\r\" or <CTRL-V><CTRL-M> to enter a carriage return\ncharacter in a pattern. In Vim scripts, it is better to use \"\\r\" for the\ncarriage return character.\n\nFor more information, read:\n\nB<:help sub-replace-special>\n\n\n\n=head2 11.3. How do I search for the character ^M?\n\nYou can enter the ^M character in a search command by first pressing the\nCTRL-V key and then pressing the CTRL-M key.\n\n /^V^M\n\nYou can also use the \"\\r\" character. In Vim scripts, \"\\r\" is preferred.\n\nFor more information, read:\n\nB<:help c_CTRL-V>\n\nB<:help using_CTRL-V>\n\nB<:help /\\r>\n\n\n\n=head2 11.4. How can I search/replace characters that display as \"~R\", \"~S\", etc.?\n\nYou can use the \"ga\" command to display the ASCII value/code for the\nspecial character. For example, let us say the ASCII value is 142. Then you\ncan use the following command to search for the special character:\n\n /^V142\n\nwhere, ^V is entered by pressing CTRL-V.\n\nFor more information, read:\n\nB<:help ga>\n\nB<:help using_CTRL-V>\n\nB<:help 24.8>\n\n\n\n=head2 11.5. How do I highlight all the non-printable characters in a file?\n\nYou can use the following commands and search pattern to highlight all the\nnon-printable characters in a file:\n\n :set hlsearch\n /\\(\\p\\|$\\)\\@!.\n\nFor more information, read:\n\nB<:help /\\p>\n\nB<:help /bar>\n\nB<:help /$>\n\nB<:help /\\(>\n\nB<:help /\\@!>\n\nB<:help 'hlsearch'>\n\n\n\n=head2 11.6. How do I search for whole words in a file?\n\nYou can search for whole words in a file using the \\< and \\> atoms. For\nexample:\n\n /\\<myword\\>\n\nThe \\< atom matches the beginning of the word and the \\> atom matches the\nend of the word.\n\nFor more information, read:\n\nB<:help /\\<>\n\nB<:help /\\>>\n\n\n\n=head2 11.7. How do I search for the current word under the cursor?\n\nYou can press the * key to search forward for the current word under the\ncursor.  To search backward, you can press the # key. Note that only whole\nkeywords will be searched using these commands.\n\nFor more information, read:\n\nB<:help star>\n\nB<:help #>\n\nB<:help gstar>\n\nB<:help g#>\n\nB<:help 03.8>\n\nB<:help search-commands>\n\n\n\n=head2 11.8. How do I search for a word without regard to the case (uppercase or\n   lowercase)?\n\nTo always ignore case while searching for a pattern, set the 'ignorecase'\noption:\n\n :set ignorecase\n\nTo ignore case only when searching a particular pattern, use the special \\c\ndirective:\n\n /\\c<pattern>\n\nFor more information, read:\n\nB<:help 'ignorecase'>\n\nB<:help /ignorecase>\n\nB<:help /\\c>\n\n\n\n=head2 11.9. How do I search for words that occur twice consecutively?\n\nYou can use one of the following search commands to locate words that occur\ntwice consecutively:\n\n  /\\(\\<\\w\\+\\)\\_s\\+\\1\\>\n  /\\(\\<\\k\\+\\)\\_s\\+\\1\\>\n\nThe main difference is the use of \"\\w\" and \"\\k\", where the latter is based\non the 'iskeyword' option which may include accented and other language\nspecific characters.\n\nFor more information, read:\n\nB<:help /\\1>\n\nB<:help /\\(>\n\nB<:help /\\)>\n\nB<:help /\\<>\n\nB<:help /\\>>\n\nB<:help /\\w>\n\nB<:help /\\k>\n\nB<:help /\\+>\n\nB<:help /\\_x>\n\nB<:help 'iskeyword'>\n\n\n\n=head2 11.10. How do I count the number of times a particular word occurs in a\n    buffer?\n\nYou can use the following set of commands to count the number of times a\nparticular word occurs in a buffer:\n\n :let cnt=0\n :g/\\<your_word\\>/let cnt=cnt+1\n :echo cnt\n\nThis only counts the number of lines where the word occurs. You can also\nuse the following command:\n\n :%s/\\<word\\>/&/gn\n\nTo count the number of alphabetic words in a file, you can use\n\n :%s/\\a\\+/&/gn\n\nTo count the number of words made up of non-space characters, you can use\n\n :%s/\\S\\+/&/gn\n\nFor more information, read:\n\nB<:help count-items>\n\nB<:help word-count>\n\nB<:help v_g_CTRL-G>\n\nB<:help 12.5>\n\nB<:help :s_flags>\n\n\n\n=head2 11.11. How do I place the cursor at the end of the matched word when\n    searching for a pattern?\n\nYou can use the \"e\" offset to the search command to place the cursor at the\nend of the matched word. For example\n\n /mypattern/e\n\nFor more information about search offsets, read:\n\nB<:help search-offset>\n\nB<:help />\n\n\n\n=head2 11.12. How do I search for an empty line?\n\nYou can search for an empty line using:\n\n /^$\n\n or\n\n /^\\s*$\n\nThe latter also matches lines, that consist only of white space, while the\nformer only matches true empty lines. For more information, read:\n\nB<:help /^>\n\nB<:help /$>\n\nB<:help /\\s>\n\nB<:help /star>\n\nB<:help search-commands>\n\n\n\n=head2 11.13. How do I search for a line containing only a single character?\n\nYou can search for a line containing only a single character using:\n\n /^\\s*\\a\\s*$\n\nFor more information, read:\n\nB<:help /^>\n\nB<:help /\\a>\n\nB<:help /\\s>\n\nB<:help /star>\n\nB<:help /$>\n\n\n\n=head2 11.14. How do I search and replace a string in multiple files?\n\nYou can use the `:argdo`, `:bufdo`, `:windo` or `:tabdo` commands to execute\nan ex command on multiple files. For example:\n\n :argdo %s/foo/bar/g|upd\n\nFor more information, read:\n\nB<:help :argdo>\n\nB<:help :bufdo>\n\nB<:help :windo>\n\nB<:help :tabdo>\n\n\n\n=head2 11.15. I am using the `:s` substitute command in a mapping. When a search\n    for a pattern fails, the map terminates. I would like the map to\n    continue processing the next command, even if the substitute command\n    fails. How do I do this?\n\nYou can use the \"e\" flag to the substitute command to continue processing\nother commands in a map, when a pattern is not found.\n\nFor more information, read:\n\nB<:help :s_flags>\n\n\n\n=head2 11.16. How do I search for the n-th occurrence of a character in a line?\n\nTo search for the n-th occurrence of a character in a line, you can prefix\nthe \"f\" command with a number. For example, to search for the 5th\noccurrence of the character @ in a line, you can use the command 5f@. This\nassumes the cursor is at the beginning of the line - and that this first\ncharacter is not the one your are looking for.\n\nFor more information, read:\n\nB<:help f>\n\nB<:help F>\n\nB<:help t>\n\nB<:help T>\n\nB<:help ;>\n\nB<:help ,>\n\n\n\n=head2 11.17. How do I replace a tab (or any other character) with a hard return\n    (newline) character?\n\nYou can replace a tab (or any other character) with a hard return (newline)\ncharacter using the following command:\n\n :s/\\t/\\r/\n\nNote that in the above command, if you use \\n instead of \\r, then the tab\ncharacters will not be replaced by a new-line character.\n\nFor more information, read:\n\nB<:help sub-replace-special>\n\nB<:help NL-used-for-Nul>\n\nB<:help CR-used-for-NL>\n\n\n\n=head2 11.18. How do I search for a character by its ASCII value?\n\nYou can search for a character by its ASCII value by pressing CTRL-V\nfollowed by the decimal or hexadecimal or octal value of that character in\nthe search \"/\" command.  To determine the ASCII value of a character you\ncan use the `:ascii` or the \"ga\" command.\n\nFor example, to search for the ASCII character with value 188, you can\nuse one of the following search commands:\n\n /<CTRL-V>188\n /<CTRL-V>o274\n /<CTRL-V>xBC\n /<CTRL-V>u00bc\n\nYou can also search for the character with the decimal/octal/hex number\nusing a collation [] like this:\n\n /[\\d188]\n /[\\o274]\n /[\\xbc]\n /[\\u00bc]\n\nAlternatively, you can use the special atom \\%d \\%o \\%x \\%u:\n\n /\\%d188\n /\\%o274\n /\\%xbc\n /\\%u00bc\n\nOr you use digraphs to enter the character. For example enter:\n\n /CTRL-K14\n\nto search for the above character.\n\nFor more information, read:\n\nB<:help i_CTRL-V_digit>\n\nB<:help :ascii>\n\nB<:help ga>\n\nB<:help /\\]>\n\nB<:help /\\%d>\n\nB<:help digraphs>\n\n\n\n=head2 11.19. How do I search for long lines?\n\nYou can search for long lines or lines containing more than a specific\nnumber of characters using the Vim regular-expressions in the search\ncommand. For example, to search for all the lines containing more than 80\ncharacters, you can use one of the following commands:\n\n /^.\\{80}.\\+$\n /^.*\\%>80c.*$\n /^.*\\%>80v.*$\n\nFor more information, read:\n\nB<:help /\\{>\n\nB<:help /\\%c>\n\nB<:help /\\%v>\n\n\n\n=head2 11.20. How do I display all the lines in the current buffer that contain a\n    specified pattern?\n\nYou can use the following command to display all the lines in the current\nbuffer that contain a specified pattern:\n\n :g/<pattern>/p\n\nFor example, the following command will display all the lines in the\ncurrent buffer that contain \"vim\":\n\n :g/vim/p\n\nSince `:p` is the default command to be executed for the ex command `:g`, you\ncan also use:\n\n :g/vim\n\nIf you also want the corresponding line numbers, then you can use the\nfollowing command:\n\n :g/<pattern>/#\n\nFor more information, read:\n\nB<:help :global>\n\nB<:help :print>\n\nB<:help :number>\n\n\n\n=head2 11.21. How do I search for a text string that spans multiple lines?\n\nYou can search for a text string that spans multiple lines using the \\_x\nregular expression atom. For example, to search for the text string \"Hello\nWorld\", you can use the following search command:\n\n /Hello\\_sWorld\n\nThis will match the word \"Hello\" followed by a newline character and then\nthe word \"World\" at the beginning of the next line. This will also match\nthe word \"Hello\" immediately followed by a space character and then the\nword \"World\". When searching for the \"Hello World\" string, to include the\nspace characters at the end and beginning of the line, you can use the\nfollowing search command:\n\n /Hello\\_s\\+World\n\nFor more information, read:\n\nB<:help 27.8>\n\nB<:help pattern-atoms>\n\nB<:help /\\_>\n\nB<:help pattern-searches>\n\n\n\n=head2 11.22. How do I search for a pattern within the specified range of lines\n    in a buffer?\n\nYou can search for a pattern within a range of lines using the \\%>l\nand \\%<l regular expression atoms.\n\nFor example, to search for the word \"white\" between the lines 10 and 30 in\na buffer, you can use the following command:\n\n /white\\%>9l\\%<31l\n\nFor more information, read:\n\nB<:help /\\%l>\n\n\n\n=head2 11.23. How do I clear the last searched pattern?\n\nThe last searched pattern is stored in the \"/\" register. You can clear\nthis register using the following command:\n\n :let @/=\"\"\n\nTo clear the last search pattern whenever a buffer is unloaded, you can use\nthe following command:\n\n :autocmd BufUnload * let @/ = \"\"\n\nFor more information, read:\n\nB<:help @/>\n\nB<:help :let-@>\n\nB<:help autocmd-searchpat>\n\nB<:help last-pattern>\n\n\n\n=head2 11.24. Why does this pattern \"a.\\{-}p\\@!\" not match?\n\n\"\\{-}\" doesn't just mean \"as few as possible\", it means \"as few as\npossible to make the whole pattern succeed\". If it didn't match the \"p\",\nthe whole pattern would fail (because of the \"p\\@!\") so it does match\nthe \"p\". It is a longer match, but it is the shortest match that makes\nthe whole pattern succeed.\n\nIf you wanted \"as few as possible regardless\" you would use \"\\@>\", which\nbasically divides a pattern up so that the pieces either side behave\nindependently. If the pattern were \"a.\\{-}\\@>p\\@!\" then \".\\{-}\" would\nalways match nothing because that's the smallest match that can succeed\nwhen there are not other restrictions. The whole pattern then would\nbehave the same as \"ap\\@!\", i.e. it would match any \"a\" not followed by\na \"p\").\n\nThis means, it matches as few as possible \"a\"s without trying to keep\ngoing until Vim finds the longest match. This means, it will still match\n\"ap\".\n\n\n=head2 11.25. How can I use \"/\" within a pattern, without escaping it?\n\nWhen using / to search for a pattern, you need to escape all \"/\" within\nthe pattern, because they would otherwise terminate the pattern. So you\ncan't directly search for /usr/share/doc/ but need to search for\n\\/usr\\/share\\/doc\\/\n\nThe easiest solution around that, would be to use \"?\" to start a\nbackward search and afterwards use /<CR> to use the last search-pattern\nin forward direction.\n\nIf you have a Vim, that has the eval-feature built in (which needs at\nleast a normal built or higher), you can also directly paste the pattern\ninto the search register:\n\n:let @/ = '/usr/share/doc/'\n\nThen use \"n\" to jump to the next occurrence.\n\nSee also the help at\n\nB<:help @/>\n\nB<:help /<CR>>\n\n\n\n=head2 11.26. How can I operate on a search match?\n\nThe \"gn\" command makes it easy to operate on regions of text that match\nthe current search pattern. By default, it will search forward for the\nlast used search pattern and visually select the match. If the cursor is\nalready on the match, it will be visually selected. If you used the \"gn\"\ncommand after an operator (e.g. \"c\" to change text), it will be applied\non the match.\n\nIf Visual mode is active before using gn, the visual selection will be\nextended until the end of the next match.\n\nThe \"gN\" commands works similar but searches backwards.\n\nThis allows to repeat simple operations on each match. For example, you\nmight want to change each occurence of apples by peaches. So you search\nusing \"/apple\" then you can use \"cgnpeach<Esc>\" to replace the current\nmatch by peach. Now you can use the dot \".\" command to redo the\nreplacement for the rest of the buffer.\n\nSee also the help at\n\nB<:help gn>\n\nB<:help gN>\n\n\n\n\n=head1 CHANGING TEXT\n\n\n\n=head2 12.1. How do I delete all the trailing white space characters (SPACE and\n   TAB) at the end of all the lines in a file?\n\nYou can use the `:substitute` command on the entire file to search and\nremove all the trailing white space characters:\n\n :%s/\\s\\+$//\n\nFor more information, read:\n\nB<:help :%>\n\nB<:help :s>\n\nB<:help /\\s>\n\nB<:help /\\+>\n\nB<:help /$>\n\n\n\n=head2 12.2. How do I replace all the occurrences of multiple consecutive space\n   characters to a single space?\n\nYou can use the following command to replace all the occurrences of\nmultiple consecutive space characters to a single space:\n\n :%s/ \\{2,}/ /g\n\nAlternatively use:\n\n :%s/  \\+/ /g\n\nFor more information, read:\n\nB<:help :%>\n\nB<:help :s>\n\nB<:help /\\{>\n\nB<:help :s_flags>\n\n\n\n=head2 12.3. How do I reduce a range of empty lines into one line only?\n\nYou can use the following command to reduce a range of empty lines into one\nline only:\n\n :v/./.,/./-1join\n\nThe explanation for this command is below:\n\n part            description\n -----           --------------------------\n :v/./           Execute the following command for all lines not\n                 containing a character (empty lines).\n  .,             Use the current line as the start of the range of\n                 lines.\n  /./            Use the line containing a character as the last line.\n  -1             Adjust the range of lines to end with the line before\n                 the last line.\n  j              Join the lines in the range.\n\nNote that this will give an error message if the empty lines are at the end\nof the file. To correct this, you have to add a temporary line at the end\nof the file, execute the command and then remove the temporary line.\n\nFor more information, read:\n\nB<:help :v>\n\nB<:help :join>\n\nB<:help cmdline-ranges>\n\nB<:help collapse>\n\n\n\n=head2 12.4. How do I delete all blank lines in a file? How do I remove all the\n   lines containing only space characters?\n\nTo remove all blank lines, use the following command:\n\n :g/^$/d\n\nTo remove all lines with only whitespace (spaces or tabs) in them, use the\nfollowing command:\n\n :g/^\\s\\+$/d\n\nTo remove all the lines with only whitespace, if anything, use the\nfollowing command:\n\n :g/^\\s*$/d\n\n\n=head2 12.5. How do I copy/yank the current word?\n\nYou can use the \"yiw\" (yank inner word without whitespace) command or the\n\"yaw\" (yank a word with whitespace) command to copy/yank the current\nword.\n\nFor more information, read:\n\nB<:help 04.6>\n\nB<:help 04.8>\n\nB<:help iw>\n\nB<:help yank>\n\nB<:help text-objects>\n\nB<:help objects>\n\n\n\n=head2 12.6. How do I yank text from one position to another position within a\n   line, without yanking the entire line?\n\nYou can specify a motion command with the yank operator (y) to yank text\nfrom one position to another position within a line. For example, to yank\nfrom the current cursor position till the next letter x, use yfx or Fx or\ntx or Tx. To yank till the nth column, use n|. To yank till the next\noccurrence of a \"word\", use /word. To do a yank till the nth column on\nanother line, first mark the position using the \"ma\" command, go to the\nstart of the yank position, and then yank till the mark using y`a (note the\ndirection of the quote)\n\nFor more information, read:\n\nB<:help yank>\n\nB<:help motion.txt>\n\nB<:help 04.6>\n\n\n\n=head2 12.7. When I yank some text into a register, how do I append the text to\n   the current contents of the register?\n\nWhen you specify the register for some operation, if you use the upper-case\nfor the register name, then the new text will be appended to the existing\ncontents. For example, if you have some text in the register \"a\". If you\nwant to append some new text to this, you have to use the \"A\" register\nname. If you use the lowercase register name, then the contents of the\nregister will be overwritten with the new text.\n\nFor more information, read:\n\nB<:help quote>\n\nB<:help quote_alpha>\n\nB<:help 10.1>\n\n\n\n=head2 12.8. How do I yank a complete sentence that spans over more than one line?\n\nTo yank a complete sentence that spans over more than one line you have to\nuse the yank operator followed by a motion command. For example:\n\n     y)\n\nFrom inside the sentence you can use \"yi)\" to yank the sentence.\n\nFor more information, read:\n\nB<:help yank>\n\nB<:help {motion}>\n\nB<:help object-motions>\n\nB<:help 04.6>\n\n\n\n=head2 12.9. How do I yank all the lines containing a pattern into a buffer?\n\nYou can use the `:global` command to yank all the lines containing the\npattern into a register and then paste the contents of the register into\nthe buffer:\n\n :let @a=''\n :g/mypattern/y A\n\nThe first command, clears the contents of the register \"a\". The second\ncommand copies all the lines containing \"mypattern\" into the register \"a\".\nNote that the capital letter \"A\" is used to append the matched lines. Now\nyou can paste the contents of register \"a\" to a buffer using \"ap command.\n\nIf you only want to collect all matches, you can use a different\napproach. For that run the `:s` command with the flags \"gn\" so that it\nwon't actually  change the buffer (\"n\" flag) but select each match (\"g\"\nflag). Combining this with the \"\\=\" part in the replacement part, you\ncan copy each match to e.g. a list. Altogether this looks like this:\n\n :let list=[]\n :%s/pattern/\\=add(list, submatch(0))/gn\n\nNow all matches will be in the list and you can post process them as\nwanted.\n\nFor more information, read:\n\nB<:help :g>\n\nB<:help :y>\n\nB<:help :let-register>\n\nB<:help quote_alpha>\n\nB<:help put>\n\nB<:help registers>\n\nB<:help :registers>\n\nB<:help sub-replace-\\=>\n\n\n\n=head2 12.10. How do I delete all the lines in a file that do not contain a\n    pattern?\n\nYou can use `:v` command to delete all the lines that do not contain a\npattern:\n\n :v/pattern/d\n\nor\n\n :g!/pattern/d\n\nFor more information, read:\n\nB<:help :v>\n\nB<:help :g>\n\n\n\n=head2 12.11. How do I add a line before each line with \"pattern\" in it?\n\nYou can use the following command to add a line before each line with\n\"pattern\" in it:\n\n :g/pattern/normal! Oi<line of text goes here>\n\nAlternatively you can yank the line using the Y command and then insert the\nline using the following command:\n\n :g/pattern/put!\n\nFor more information, read:\n\nB<:help :g>\n\nB<:help :put>\n\nB<:help insert>\n\nB<:help 0>\n\n\n\n=head2 12.12. Is there a way to operate on a line if the previous line contains a\n    particular pattern?\n\nYou can use the `:global` command to operate on a line, if the previous\nline contains a particular pattern:\n\n :g/<pattern>/+{cmd}\n\nFor more information, read:\n\nB<:help :g>\n\nB<:help :range>\n\n\n\n=head2 12.13. How do I execute a command on all the lines containing a pattern?\n\nYou can use the `:global` (:g) command to execute a command on all the\nlines containing a pattern.\n\n :g/my pattern/d\n\nIf you want to use a non-Ex command, then you can use the `:normal`\ncommand:\n\n :g/my pattern/normal {command}\n\nUnless you want the normal mode commands to be remapped, consider using a\n`:normal!` command instead (note the \"!\").\n\nFor more information, read:\n\nB<:help :global>\n\nB<:help :v>\n\nB<:help :normal>\n\n\n\n=head2 12.14. Can I copy the character above the cursor to the current cursor\n    position?\n\nIn Insert mode, you can copy the character above the cursor to the current\ncursor position by typing CTRL-Y. The same can be done with the\ncharacters below the cursor by typing CTRL-E.\n\nFor more information, read:\n\nB<:help i_CTRL-Y>\n\nB<:help i_CTRL-E>\n\n\n\n=head2 12.15. How do I insert a blank line above/below the current line without\n    entering insert mode?\n\nYou can use the `:put` ex command to insert blank lines. For example, try\n\n :put =''\n :put! =''\n\nFor more information, read:\n\nB<:help :put>\n\n\n\n=head2 12.16. How do I insert the name of the current file into the current buffer?\n\nThere are several ways to insert the name of the current file into the\ncurrent buffer. In insert mode, you can use the <C-R>% or the\n<C-R>=expand(\"%\") command. In normal mode, you can use the `:put =@%`\ncommand.\n\nFor more information, read:\n\nB<:help i_CTRL-R>\n\nB<:help expand()>\n\nB<:help !!>\n\n\n\n=head2 12.17. How do I insert the contents of a Vim register into the current\n    buffer?\n\nIn insert mode, you can use the <CTRL-R><register> command to insert the\ncontents of <register>. For example, use <CTRL-R>a to insert the contents\nof register \"a\" into the current buffer.\n\nIn normal mode, you can use the `:put <register>` command to insert the\ncontents of <register>. For example, use the `:put d` command to insert\nthe contents of register \"d\" into the current buffer.\n\nFor more information, read:\n\nB<:help i_CTRL-R>\n\nB<:help i_CTRL-R_CTRL-R>\n\nB<:help i_CTRL-R_CTRL-O>\n\nB<:help i_CTRL-R_CTRL-P>\n\nB<:help :put>\n\n\n\n=head2 12.18. How do I move the cursor past the end of line and insert some\n    characters at some columns after the end of the line?\n\nYou can set the 'virtualedit' option to move the cursor past the\nend-of-line and insert characters in a column after the end-of-line. To\nstart the virtual mode, use\n\n :set virtualedit=all\n\nFor more information, read:\n\nB<:help 'virtualedit'>\n\n\n\n=head2 12.19. How to replace the word under the cursor (say: junk) with\n   \"foojunkbar\" in Vim?\n\nThere are several ways to do this. If the word is the first such word on\nthe line, use the following command:\n\n :exe \"s/\".expand(\"<cword>\").\"/foo&bar/\"\n\nTo match specifically you could use a more complex substitution like this:\n\n :exe 's/\\<'.expand(\"<cword>\").'\\%>'.(col(\".\")-1).'c\\>/foo&bar/'\n\nYou can also use the command: ciwfoo<C-R>\"bar<Esc>\n\nFor more information, read:\n\nB<:help :substitute>\n\nB<:help expand()>\n\nB<:help col()>\n\nB<:help /\\%c>\n\n\n\n=head2 12.20. How do I replace a particular text in all the files in a directory?\n\nYou can use the `:argdo` command to execute the substitute command on all\nthe files specified as arguments:\n\n :args *\n :argdo %s/<your_text>/<replacement_text>/ge | update\n\nFor more information, read:\n\nB<:help :args_f>\n\nB<:help :argdo>\n\nB<:help :s_flags>\n\n\n\n=head2 12.21. I have some numbers in a file. How do I increment or decrement the\n    numbers in the file?\n\nYou can use the CTRL-A key to increment the number and the CTRL-X key to\ndecrement the number. You can also specify the number to\nincrement/decrement from the number by specifying a count to the key. This\nworks for decimal, octal and hexadecimal numbers. You can change the base\nused by Vim for this operation by modifying the 'nrformats' option.\n\nFor more information, read:\n\nB<:help 26.2>\n\nB<:help CTRL-A>\n\nB<:help CTRL-X>\n\nB<:help 'nrformats'>\n\n\n\n=head2 12.22. How do I reuse the last used search pattern in a `:substitute`\n    command?\n\nTo reuse the last used search pattern in a `:substitute` command, don't\nspecify a new search pattern:\n\n :s/pattern/newtext/\n :s//sometext/\n\nIn the second `:s` command, as a search pattern is not specified, the\npattern specified in the first `:s` command \"pattern\" will be used.\n\nIf you want to change the search pattern but repeat the substitution\npattern you can use the special right hand side, you can use the tilde\ncharacter:\n\n :s/newpattern/~/\n\nFor more information, read:\n\nB<:help :s>\n\nB<:help :&>\n\nB<:help :~>\n\nB<:help &>\n\nB<:help sub-replace-special>\n\n\n\n=head2 12.23. How do I change the case of a string using the `:substitute`\n    command?\n\nYou can use special characters in the replacement string for a\n`:substitute` command to change the case of the matched string. For\nexample, to change the case of the string \"MyString\" to all uppercase, you\ncan use the following command:\n\n :%s/MyString/\\U&/g\n\nTo change the case to lowercase, you can use the following command:\n\n :%s/MyString/\\L&/g\n\nTo change the case of the first character in all the words in the current\nline to uppercase, you can use the following command:\n\n :s/\\<\\(.\\)\\(\\k*\\)\\>/\\u\\1\\L\\2/g\n\nFor more information, read:\n\nB<:help sub-replace-special>\n\nB<:help :substitute>\n\nB<:help /\\U>\n\nB<:help /\\L>\n\nB<:help /\\u>\n\n\n\n=head2 12.24. How do I enter characters that are not present in the keyboard?\n\nYou can use digraphs to enter characters that are not present in the\nkeyboard. You can use the `:digraphs` command to display all the currently\ndefined digraphs. You can add a new digraph to the list using the\n`:digraphs` command.\n\nFor more information, read:\n\nB<:help digraphs>\n\nB<:help 'digraph'>\n\nB<:help 24.9>\n\n\n\n=head2 12.25. Is there a command to remove any or all digraphs?\n\nNo. The digraphs table is defined at compile time. You can only add new\nones. Adding a command to remove digraphs is on the todo list.\n\n\n=head2 12.26. In insert mode, when I press the backspace key, it erases only the\n    characters entered in this instance of insert mode. How do I erase\n    previously entered characters in insert mode using the backspace\n    key?\n\nThis is traditional vi behaviour. You can set the 'backspace' option to\nerase previously entered characters in insert mode:\n\n :set backspace=indent,eol,start\n\nFor more information, read:\n\nB<:help 'backspace'>\n\nB<:help i_backspacing>\n\n\n\n=head2 12.27. I have a file which has lines longer than 72 characters terminated\n    with \"+\" and wrapped to the next line. How can I quickly join the\n    lines?\n\nYou can use the `:global` command to search and join the lines:\n\n :g/+$/j\n\nThis will, however, only join every second line. A couple of more complex\nexamples which will join all consecutive lines with a \"+\" at the end are:\n\n :g/+$/,/\\(^\\|[^+]\\)$/j\n :g/+$/mark a | .,/\\(^\\|[^+]\\)$/s/+$// | 'a,.j\n\nFor more information, read:\n\nB<:help :g>\n\nB<:help :j>\n\nB<:help :mark>\n\n\n\n=head2 12.28. How do I paste characterwise yanked text into separate lines?\n\nYou can use the `:put` command to paste characterwise yanked text into new\nlines:\n\n :put =@\"\n\nFor more information, read:\n\nB<:help :put>\n\nB<:help quote_=>\n\n\n\n=head2 12.29. How do I change the case (uppercase, lowercase) of a word or a\n    character or a block of text?\n\nYou can use the \"~\" command to switch the case of a character.\n\nYou can change the case of the word under the cursor to uppercase using the\n\"gUiw\" or \"viwU\" command and to lowercase using the \"guiw\" or \"viwu\"\ncommand.\n\nYou can switch the case (upper case to lower case and vice versa) of the\nword under the cursor using the \"viw~\" or \"g~iw\" command.\n\nYou can use the \"gUgU\" command to change the current line to uppercase and\nthe \"gugu\" command to change the current line to lowercase.\n\nYou can use the \"g~g~\" command to switch the case of the current line. You\ncan use the \"g~{motion}\" or \"{Visual}~\" commands to switch the case of a\nblock of text.\n\nIf you set 'tildeop' the \"~\" command behaves like an operator and expects\na motion command to act on. If you have\n\n :set tildeop\n\nand you want to change the case from the current cursor position to the end\nof line, simply use \"~$\".\n\nFor more information, read:\n\nB<:help case>\n\nB<:help 'tildeop'>\n\n\n\n=head2 12.30. How do I enter ASCII characters that are not present in the\n    keyboard?\n\nYou can enter ASCII characters that are not present in the keyboard by\npressing CTRL-V and then the ASCII character number. You can also use\ndigraphs to enter special ASCII characters.\n\nFor more information, read:\n\nB<:help i_CTRL-V_digit>\n\nB<:help digraphs>\n\nB<:help 45.5>\n\n\n\n=head2 12.31. How do I replace non-printable characters in a file?\n\nTo replace a non-printable character, you have to first determine the ASCII\nvalue for the character. You can use the `:ascii` ex command or the \"ga\"\nnormal-mode command to display the ASCII value of the character under the\ncursor.\n\nYou can enter the non-printable character by entering CTRL-V followed by\nthe decimal number 1-255 (with no leading zero), or by x and a hex number\n00-FF, or by an octal number 0-0377 (with leading zero), or by u and a hex\nnumber 0-FFFF, or by U and a hex number 0-7FFFFFFF\n\nAnother alternative is to use the `:digraphs` ex command to display the\ndigraphs for all characters, together with their value in decimal and\nalpha. You can enter a non-printable character by entering CTRL-K followed\nby two alphanumeric characters (a digraph).\n\nFor more information, read:\n\nB<:help :ascii>\n\nB<:help i_CTRL-V>\n\nB<:help i_CTRL-V_digit>\n\nB<:help :digraphs>\n\n\n\n=head2 12.32. How do I remove duplicate lines from a buffer?\n\nYou can use the following user-defined command to remove all the duplicate\nlines from a buffer:\n\n:command -range=% Uniq <line1>,<line2>g/^\\%<<line2>l\\(.*\\)\\n\\1$/d\n\nAdd the above command to your .vimrc file and invoke `:Uniq` to remove all\nthe duplicate lines.\n\n\n=head2 12.33. How do I prefix all the lines in a file with the corresponding line\n    numbers?\n\nYou can prefix the lines in a file with the corresponding line number in\nseveral ways. Some of them are listed below:\n\n :%s/^/\\=line('.'). ' '\n :%s/^/\\=printf('%5d ', line('.'))/\n :%s/^/\\=strpart(line('.').'.     ', 0, 5)\n :%s/^/\\=strpart('   ', strlen(line('.'))).line('.').'. '\n\nThe last two commands will pad the line numbers with space characters.  The\nlast command will right align the numbers and the command before that will\nleft align the numbers.\n\nIf you don't want to number consecutive lines but rather non-consecutive\nregions, you can also use this idiom:\n\n :let i = 1\n :g/TODO/s/^/\\=printf('%2d.',i)|let i+=1\n\nThis first initializes the variable i with 1. In the next line, a `:g`\ncommand is used to perform a substitute command only on lines, that\nmatch \"TODO\". After the substitute command has taken place, the variable\ni will be incremented by 1.\n\nFor more information, read:\n\nB<:help sub-replace-special>\n\nB<:help line()>\n\nB<:help expr6>\n\nB<:help strpart()>\n\nB<:help printf()>\n\nB<:help :execute>\n\nB<:help :global>\n\n\n\n=head2 12.34. How do I exchange (swap) two characters or words or lines?\n\nYou can exchange two characters with the \"xp\" command sequence. The \"x\"\nwill delete the character under the cursor and \"p\" will paste the just\ndeleted character after the character under the cursor. This will result\nin exchanging the two characters.\n\nYou can exchange two words with the \"deep\" command sequence (start with the\ncursor in the blank space before the first word).\n\nYou can exchange two lines with the \"ddp\" command sequence. The \"dd\" will\ndelete the current line and \"p\" will paste the just deleted line after the\ncurrent line. This will result in exchanging the two lines.\n\nAll of the above operations will change the \" unnamed register.\n\nYou can use the `:m +` ex command to exchange two lines without changing the\nunnamed register.\n\nFor more information, read:\n\nB<:help x>\n\nB<:help p>\n\nB<:help dd>\n\nB<:help d>\n\nB<:help e>\n\nB<:help linewise-register>\n\nB<:help quotequote>\n\nB<:help :move>\n\n\n\n=head2 12.35. How do I change the characters used as word delimiters?\n\nVim uses the characters specified by the 'iskeyword' option as word\ndelimiters. The default setting for this option is \"@,48-57,_,192-255\".\n\nFor example, to add \":\" as a word delimiter, you can use\n\n :set iskeyword+=:\n\nTo remove \"_\" as a word delimiter, you can use\n\n :set iskeyword-=_\n\nFor more information, read:\n\nB<:help 'iskeyword'>\n\nB<:help word>\n\n\n\n\n=head1 COMPLETION IN INSERT MODE\n\n\n\n=head2 13.1. How do I complete words or lines in insert mode?\n\nIn insert mode, you can complete words using the CTRL-P and CTRL-N keys.\nThe CTRL-N command searches forward for the next matching keyword.\nThe CTRL-P command searches backwards for the next matching keyword.\n\nIn insert mode, you can use the CTRL-X CTRL-L command sequence to complete\nlines that starts with the same characters as in the current line before\nthe cursor. To get the next matching line, press the CTRL-P or CTRL-N keys.\nThere are a lot of other keys/ways available to complete words in insert\nmode.\n\nVim supports completion of the following items:\n\n CTRL-X CTRL-L    whole lines\n CTRL-X CTRL-N    keywords in the current file\n CTRL-X CTRL-K    words from a dictionary\n CTRL-X CTRL-T    words from a thesaurus\n CTRL-X CTRL-I    current and included files\n CTRL-X CTRL-]    tags\n CTRL-X CTRL-F    file names\n CTRL-X CTRL-D    macro definitions (also in included files)\n CTRL-X CTRL-V    Vim command line\n CTRL-X CTRL-U    User defined completion\n CTRL-X CTRL-O    Omni completion\n\nUser defined completions and omni completions are often set by filetype\nplugins.\n\nFor more information, read:\n\nB<:help 24.3>\n\nB<:help ins-completion>\n\n\n\n=head2 13.2. How do I complete file names in insert mode?\n\nIn insert mode, you can use the CTRL-X CTRL-F command sequence to complete\nfilenames that start with the same characters as in the current line before\nthe cursor.\n\nFor more information, read:\n\nB<:help compl-filename>\n\n\n\n=head2 13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do I\n   complete words that occur after the just completed word?\n\nYou can use CTRL-X CTRL-N and CTRL-X CTRL-P keys to complete words that are\npresent after the just completed word.\n\nFor more information, read:\n\nB<:help i_CTRL-X_CTRL-P>\n\nB<:help i_CTRL-X_CTRL-N>\n\nB<:help ins-completion>\n\n\n\n\n=head1 TEXT FORMATTING\n\n\n\n=head2 14.1. How do I format a text paragraph so that a new line is inserted at\n   the end of each wrapped line?\n\nYou can use the \"gq\" command to format a paragraph. This will format the\ntext according to the current 'textwidth' setting. An alternative would be\nto use the \"gw\" command that formats like \"gq\" but does not move the\ncursor.\n\nNote that the gq operator can be used with a motion command to operate on a\nrange of text. For example:\n\n gqgq - Format the current line\n gqap - Format current paragraph\n gwap - Format current paragraph (and don't move cursor)\n gq3j - Format the current and the next 3 lines\n\nFor more information, read:\n\nB<:help gq>\n\nB<:help gw>\n\nB<:help formatting>\n\nB<:help usr_25.txt>\n\nB<:help motion.txt>\n\n\n\n=head2 14.2. How do I format long lines in a file so that each line contains less\n   than \"n\" characters?\n\nYou can set the 'textwidth' option to control the number of characters that\ncan be present in a line. For example, to set the maximum width of a line\nto 70 characters, you can use the following command:\n\n set textwidth=70\n\nNow to break the long lines in a file to the length defined by the\n'textwidth' option, you can use\n\n :g/./normal gqq\n\nFor more information, read:\n\nB<:help 'textwidth'>\n\nB<:help gq>\n\n\n\n=head2 14.3. How do I join short lines to form a paragraph?\n\nFirst, make sure the 'textwidth' option is set to a high value:\n\n :set textwidth=99999\n\nNext, join the short lines to form a paragraph using the command:\n\n 1GgqG\n\nThe above command will operate on the entire file. To do the formatting on\nall paragraphs in a specific range, use:\n\n :'a,'bg/\\S/normal gq}\n\nFor more information, read:\n\nB<:help gq>\n\nB<:help G>\n\nB<:help gqq>\n\n\n\n=head2 14.4. How do I format bulleted and numbered lists?\n\nYou can configure Vim to format bulleted and numbered lists using the\n'formatoptions' option. For example, you can format the list of the\nfollowing format:\n\n  - this is a test. this is a test. this is a test. this is a test.\n  this is a test.\n\ninto this format:\n\n  - this is a test. this is a test. this is a test. this is a test.\n this is a test.\n\nYou can use the \"n\" flag in the 'formatoptions' to align the text.\n\n :set fo+=n\n\nWith this option, when formatting text, Vim will recognize numbered lists.\nFor this option to work, the 'autoindent' option also must be set.\n\nFor more information, read:\n\nB<:help 'formatoptions'>\n\nB<:help fo-table>\n\nB<:help format-comments>\n\n\n\n=head2 14.5. How do I indent lines in insert mode?\n\nIn insert mode, you can press the CTRL-T key to insert one shiftwidth of\nindent at the start of the current line. In insert mode, you can use the\nCTRL-D key to delete on shiftwidth of indent at the start of the current\nline. You can also use the CTRL-O >> and CTRL-O << commands to indent the\ncurrent line in insert mode.\n\nFor more information, read:\n\nB<:help i_CTRL-T>\n\nB<:help i_CTRL-D>\n\nB<:help i_0_CTRL-D>\n\nB<:help i_CTRL-O>\n\nB<:help >>>\n\nB<:help <<>\n\n\n\n=head2 14.6. How do I format/indent an entire file?\n\nYou can format/indent an entire file using the gg=G command, where\n\n gg - Goto the beginning of the file\n =  - apply indentation\n G  - till end of file\n\nFor more information, read:\n\nB<:help gg>\n\nB<:help =>\n\nB<:help G>\n\nB<:help 'formatprg'>\n\nB<:help C-indenting>\n\n\n\n=head2 14.7. How do I increase or decrease the indentation of the current line?\n\nYou can use the \">>\" and \"<<\" commands to increase or decrease the\nindentation of the current line.\n\nFor more information, read:\n\nB<:help shift-left-right>\n\nB<:help >>>\n\nB<:help <<>\n\nB<:help 'shiftwidth'>\n\n\n\n=head2 14.8. How do I indent a block/group of lines?\n\nYou can visually select the group of lines and press the > or < key to\nindent/unindent the lines. You can also use the following ex-command to\nindent the lines\n\n :10,20>\n\nFor more information, read:\n\nB<:help shift-left-right>\n\nB<:help v_>>\n\nB<:help v_<>\n\nB<:help :<>\n\nB<:help :>>\n\n\n\n=head2 14.9. When I indent lines using the > or < key, the standard 8-tabstops are\n   used instead of the current 'tabstop' setting. Why?\n\nThe number of spaces used when lines are indented using the \">\" operator is\ncontrolled by the 'shiftwidth' option. The 'tabstop' setting is only\nused, when the 'shiftwidth' option is zero.\n\n :set shiftwidth=4\n\nFor more information, read:\n\nB<:help 'shiftwidth'>\n\nB<:help >>>\n\nB<:help 'softtabstop'>\n\n\n\n=head2 14.10. How do I turn off the automatic indentation of text?\n\nBy default, the automatic indentation of text is not turned on. Check the\nconfiguration files (.vimrc, .gvimrc) for settings related to indentation.\nMake sure the `:filetype indent on` command is not present. If it is\npresent, remove it. Also, depending on your preference, you may also want\nto check the value of the 'autoindent', 'smartindent', 'cindent' and\n'indentexpr' options and turn them off as needed.\n\nFor more information, read:\n\nB<:help :filetype-indent-off>\n\nB<:help 'autoindent'>\n\nB<:help 'smartindent'>\n\nB<:help 'cindent'>\n\nB<:help 'indentexpr'>\n\n\n\n=head2 14.11. How do I configure Vim to automatically set the 'textwidth' option\n    to a particular value when I edit mails?\n\nYou can use the \"FileType\" autocommand to set the 'textwidth' option:\n\n autocmd FileType mail set tw=<your_value>\n\nFor more information, read:\n\nB<:help :autocmd>\n\nB<:help FileType>\n\nB<:help usr_43.txt>\n\n\n\n=head2 14.12. Is there a way to make Vim auto-magically break lines?\n\nYes. Set the 'textwidth' option to the preferred length for a line. Then\nVim will auto-magically break the newly entered lines. For example:\n\n :set textwidth=75\n\nFor more information, read:\n\nB<:help 'textwidth'>\n\nB<:help ins-textwidth>\n\nB<:help 'formatoptions'>\n\nB<:help fo-table>\n\nB<:help formatting>\n\n\n\n=head2 14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n    'fileformat' option to \"dos\" and then \"unix\" and then \"mac\". None of\n    these helped. How can I hide these symbols?\n\nWhen a file is loaded in Vim, the format of the file is determined as\nbelow:\n\n- If all the lines end with a new line (<NL>), then the fileformat is\n  \"unix\".\n- If all the lines end with a carriage return (<CR>) followed by a new line\n  (<NL>), then the fileformat is \"dos\".\n- If all the lines end with carriage return (<CR>), then the fileformat is\n  \"mac\".\n\nIf the file has some lines ending with <CR> and some lines ending with <CR>\nfollowed by a <NL>, then the fileformat is set to \"unix\".\n\nYou can change the format of the current file, by saving it explicitly in\ndos format:\n\n :w ++ff=dos\n\nTo display the format of the current file, use\n\n :set fileformat?\n\nThe above behavior is also controlled by the 'fileformats' option. You can\ntry the following commands:\n\n :set fileformats+=unix\n :e <your_file>\n :set fileformat=unix\n :w\n\nTo remove the carriage return (<CR>) character at the end of all the lines\nin the current file, you can use the following command:\n\n :%s/\\r$//\n\nTo force Vim to use a particular file format, when editing a file, you can\nuse the following command:\n\n :e ++ff=dos filename\n\nFor more information, read:\n\nB<:help 'fileformats'>\n\nB<:help 'fileformat'>\n\nB<:help file-formats>\n\nB<:help DOS-format-write>\n\nB<:help Unix-format-write>\n\nB<:help Mac-format-write>\n\nB<:help dos-file-formats>\n\nB<:help 23.1>\n\nB<:help ++ff>\n\n\n\n=head2 14.14. When I paste some text into a Vim buffer from another application,\n   the alignment (indentation) of the new text is messed up. How do I\n   fix this?\n\nWhen you paste text into a GUI Vim using the mouse, Vim is able to\ndetect that you are pasting text. So all the indentation related\nsettings (like autoindent, smartindent, cindent, etc.) are ignored and\nthe text is pasted literally.\n\nWhen pasting text into a Vim running in a terminal (like xterm) using\nthe mouse, Vim may not be able to detect that you are pasting text. This\ndepends on several things: the capability of the terminal to pass the\nmouse events to Vim, Vim is compiled to handle mouse events and access\nthe clipboard, the DISPLAY variable is set properly, the Vim 'mouse'\noption is set correctly.\n\nIf Vim is able to detect that you are pasting text using the mouse, then\nthe pasted text will be inserted literally.\n\nIf Vim is not able to detect that you are pasting using the mouse, then\nit will see the pasted text as though you literally typed the text.\nAfter the first line from the pasted text is inserted, when Vim\nencounters the newline character, because of the indentation settings,\nthe next line will start indented. The spaces at the beginning of the\nsecond line in the pasted text will be inserted leading to additional\nindentation. This will be repeated for subsequent lines. So the pasted\ntext will be inserted with stair case indentation.\n\nYou can fix this problem in a terminal Vim in several ways:\n\n1. Build Vim with the +mouse and +xterm_clipboard compile-time options.\n   The normal or big or huge build of Vim includes these options.  Set\n   the 'mouse' option to either \"a\" or include \"i\".  When pasting text\n   using the mouse, don't press the Shift key. This will work only if\n   Vim can access the X display. For more information, read the\n   following Vim help topics:\n\nB<:help +feature-list>\n\nB<:help 'mouse'>\n\nB<:help <MiddleMouse>>\n\nB<:help x11-selection>\n\nB<:help xterm-clipboard>\n\n\n1.1 Some Linux distributions build their terminal vim packages\n without X support.  This makes no sense and leaves many users\n with the impression that Vim in terminal mode doesn't support\n some operations such as properly pasting text with a mouse.\n\n If your distribution includes gvim, which it almost certainly\n does these days, the solutions to this include the following.\n\n a)  Start Vim as\n\n         gvim -v\n\n b)  Put this alias in your shell's configuration file, e.g.\n     ~/.bashrc:\n\n         alias vim='gvim -v'\n\n c)  Put the following command in a file named \"vim\" and put that\n     file in your ~/bin directory:\n\n         gvim -v \"$@\"\n\n d)  Link the distribution's gvim to ~/bin/vim with the following\n     command, which needs to be executed only once.\n\n         ln -s $(which gvim) ~/bin/vim\n\n For c) and d), make sure that ~/bin precedes /usr/bin in your\n PATH.\n\n2. Paste the text using the CTRL-R CTRL-O * command.  This will paste\n   the text literally without any automatic indentation. If you want to\n   paste the text and then fix the indentation, then you can use CTRL-R\n   CTRL-P *. These commands will work only if Vim can access the X\n   display. For more information, read the following Vim help topics:\n\nB<:help i_CTRL-R_CTRL-O>\n\nB<:help i_CTRL-R_CTRL-P>\n\nB<:help quotestar>\n\n\n3. Set the 'paste' option before pasting the text. This option will\n   disable the effect of all the indentation related settings. Make\n   sure to turn off this option using `:set nopaste` after pasting the\n   text. Otherwise the Vim indentation feature will not work.  Do not\n   permanently set the 'paste' option in your .vimrc file. If you are\n   going to repeat these steps often, then you can set the\n   'pastetoggle' option to a key. When you press the specified key,\n   the 'paste' option will be toggled. You can press the key once\n   before pasting the text and the press the key once after pasting\n   the text. Note that when the 'paste' option is set, all the\n   mappings and abbreviations are disabled.  For more information,\n   read the following Vim help topics:\n\nB<:help 'paste'>\n\nB<:help 'pastetoggle'>\n\n\nYou can also refer to the following topics in the user manual:\n\nB<:help 04.7>\n\nB<:help 09.3>\n\n\n\n=head2 14.15. When there is a very long wrapped line (wrap is \"on\") and a line\n   doesn't fit entirely on the screen it is not displayed at all. There\n   are blank lines beginning with \"@\" symbol instead of wrapped line. If\n   I scroll the screen to fit the line the \"@\" symbols disappear and the\n   line is displayed again. What Vim setting control this behavior?\n\nYou can set the 'display' option to \"lastline\" to display as much as\npossible of the last line in a window instead of displaying the \"@\"\nsymbols.\n\n :set display=lastline\n\nFor more information, read:\n\nB<:help 'display'>\n\n\n\n=head2 14.16. How do I convert all the tab characters in a file to space\n    characters?\n\nYou can use the `:retab` command to update all the tab characters in the\ncurrent file with the current setting of 'expandtab' and 'tabstop'. For\nexample, to convert all the tabs to white spaces, use\n\n :set expandtab\n :retab\n\nFor more information, read:\n\nB<:help :retab>\n\nB<:help 'expandtab'>\n\nB<:help 'tabstop'>\n\nB<:help 25.3>\n\n\n\n=head2 14.17. What Vim options can I use to edit text that will later go to a word\n    processor?\n\nYou can set the following options to edit text that will later go into a\nword processor:\n\n :set wrap\n :set linebreak\n :set textwidth=0\n :set showbreak=>>>\n\nYou can use the \"gk\" and \"gj\" commands to move one screen line up and down.\nFor more information, read:\n\nB<:help 'wrap'>\n\nB<:help 'linebreak'>\n\nB<:help 'textwidth'>\n\nB<:help 'showbreak'>\n\nB<:help gk>\n\nB<:help gj>\n\n\n\n=head2 14.18. How do I join lines without adding or removing any space characters?\n\nBy default, when you join lines using the \"J\" or `:join` command, Vim will\nreplace the line break, leading white space and trailing white space with a\nsingle space character. If there are space characters at the end of a line\nor a line starts with the \")\" character, then Vim will not add a space\ncharacter.\n\nTo join lines without adding or removing any space characters, you can use\nthe gJ or `:join!` commands.\n\nFor more information, read:\n\nB<:help gJ>\n\nB<:help :join>\n\nB<:help J>\n\nB<:help 10.5>\n\nB<:help 'joinspaces'>\n\nB<:help 'cpoptions'>\n\nB<:help 'formatoptions'>\n\n\n\n\n=head1 VISUAL MODE\n\n\n\n=head2 15.1. How do I do rectangular block copying?\n\nYou can do rectangular block copying in Vim using the blockwise visual\nmode. To start blockwise visual mode use the CTRL-V key. Move the cursor\nusing any of the motion commands and then use the y operator to yank to\nvisually selected text.\n\nIf CTRL-V does not work as expected, it may have been remapped to CTRL-Q by\nthe mswin.vim script which is often sourced by a vimrc on Windows machines\nto mimic some common short cuts from other programs.\n\nFor more information, read:\n\nB<:help 04.4>\n\nB<:help blockwise-visual>\n\nB<:help visual-mode>\n\nB<:help Q_vi>\n\n\n\n=head2 15.2. How do I delete or change a column of text in a file?\n\nYou can use the Vim block-wise visual mode to select the column of text and\napply an operator (delete, change, copy, etc) on it.\n\nFor more information, read:\n\nB<:help visual-block>\n\nB<:help visual-operators>\n\n\n\n=head2 15.3. How do I apply an ex-command on a set of visually selected lines?\n\nWhen you select a range of lines in visual mode, the < register is set to\nthe start of the visual region and the > register is set to the end of the\nvisual region. You can use these registers to specify the range for an ex\ncommand. After visually selecting the lines, press \":\" to go to the command\nmode.  Vim will automatically insert the visual range '<,'>. You can run\nany ex-command on the visual range.\n\nFor more information, read:\n\nB<:help v_:>\n\nB<:help '<>\n\nB<:help '>>\n\n\n\n=head2 15.4. How do I execute an ex command on a column of text selected in Visual\n   block mode?\n\nAll the ex commands operate on whole lines only. If you try to execute\nan ex command on a column of text selected in visual block mode, Vim\nwill operate on all the selected lines (instead of the selected\ncolumns). You can use the vis.vim or NrrwRgn plugin script from\nhttps://www.vim.org scripts archive to do this.\n\nFor more information, read:\n\nB<:help cmdline-ranges>\n\nB<:help 10.3>\n\nB<:help cmdline-lines>\n\n\n\n=head2 15.5. How do I select the entire file in visual mode?\n\nYou can select the entire file in visual mode using ggVG.\n\n gg - go to the beginning of the file.\n V  - Start linewise visual mode\n G  - goto the end of the file.\n\nFor more information, read:\n\nB<:help gg>\n\nB<:help linewise-visual>\n\nB<:help G>\n\n\n\n=head2 15.6. When I visually select a set of lines and press the > key to indent\n   the selected lines, the visual mode ends. How can I reselect the\n   region for further operation?  (or) How do I re-select the last\n   selected visual area again?\n\nYou can use the \"gv\" command to reselect the last selected visual area. You\ncan also use the marks '< and '> to jump to the beginning or the end of the\nlast selected visual area.\n\nFor more information, read:\n\nB<:help gv>\n\nB<:help '<>\n\nB<:help '>>\n\n\n\n=head2 15.7. How do I jump to the beginning/end of a visually selected region?\n\nYou can use the \"o\" command to jump to the beginning/end of a visually\nselected region.\n\nFor more information, read:\n\nB<:help v_o>\n\n\n\n=head2 15.8. When I select text with mouse and then press : to enter an ex\n   command, the selected text is replaced with the : character. How do I\n   execute an ex command on a text selected using the mouse similar to\n   the text selected using the visual mode?\n\nThis will happen if you have configured Vim to use select mode instead of\nVisual mode by setting the 'selectmode' option. Check the value of this\noption:\n\n :set selectmode?\n\nThis mode is known as selectmode and is similar to the visual mode. This\noption is also automatically set when you use the \"behave mswin\" command.\nSelect mode looks like visual mode, but it is similar to the selection mode\nin MS-Windows.\n\nFor more information, read:\n\nB<:help Select-mode>\n\nB<:help 'selectmode'>\n\nB<:help 09.4>\n\nB<:help :behave>\n\n\n\n=head2 15.9. When I select a block of text using the mouse, Vim goes into\n   selection mode instead of Visual mode. Why?\n\nThe 'selectmode' option controls whether Select mode will be started when\nselecting a block of text using the mouse. To start Visual mode when\nselecting text using mouse, remove the \"mouse\" value from the 'selectmode'\noption:\n\n :set selectmode-=mouse\n\nNote that by default, the 'selectmode' option will be set to empty, so that\nalways visual mode is used.\n\nFor more information, read:\n\nB<:help 'selectmode'>\n\nB<:help Select-mode>\n\nB<:help :behave>\n\n\n\n=head2 15.10. How do I visually select the last copy/pasted text?\n\nYou can use the '[ and '] marks to visually select the last copy/pasted\ntext. The '[ mark is set to the beginning of the last changed/yanked text\nand the '] mark is set to the end of the last changed/yanked text. To\nvisually select this block of text use the command '[v']\n\nFor more information, read:\n\nB<:help '[>\n\nB<:help ']>\n\nB<:help `a>\n\nB<:help v>\n\n\n\n\n=head1 COMMAND-LINE MODE\n\n\n\n=head2 16.1. How do I use the name of the current file in the command mode or an\n   ex command line?\n\nIn the command line, the \"%\" character represents the name of the current\nfile. In some commands, you have to use `expand(\"%\")` to get the filename:\n\n :!perl %\n\nAnother example is to load the latex generated pdf file from the file you\nare currently editing:\n\n :!xpdf %<.pdf\n\nFor more information, read:\n\nB<:help :_%>\n\nB<:help cmdline-special>\n\nB<:help expand()>\n\n\n\n=head2 16.2. How do I edit the text in the Vim command-line effectively?\n\nYou can use the command-line window for editing Vim command-line text. To\nopen the Vim command-line window use the \"q:\" command in normal mode. In\ncommand-line mode, use the CTRL-F key. In this window, the command line\nhistory will be displayed. You can use normal Vim keys/commands to edit any\nprevious/new command line. To execute a command line, press the\nenter/return key.\n\nIn a similar vain, the search history can be edited with \"q/\" and \"q?\"\ncommands.\n\nFor more information, read:\n\nB<:help cmdline-window>\n\n\n\n=head2 16.3. How do I switch from Vi mode to Ex mode?\n\nYou can use the Q command to switch from Vi mode to Ex mode. To switch from\nEx mode back to the Vi mode, use the `:vi` command.\n\nFor more information, read:\n\nB<:help Q>\n\nB<:help gQ>\n\nB<:help Ex-mode>\n\nB<:help :vi>\n\n\n\n=head2 16.4. How do I copy the output from an ex-command into a buffer?\n\nTo copy the output from an ex-command into a buffer, you have to first get\nthe command output into a register. You can use the `:redir` command to get\nthe output into a register. For example,\n\n :redir @a\n :g/HelloWord/p\n :redir END\n\nNow the register \"a\" will contain the output from the ex command\n`:g/HelloWord/p`. Now you can paste the contents of the register \"a\" into a\nbuffer. You can also send or append the output of an ex-command into a file\nusing the `:redir` command.\n\nYou can prefix the `:global` command with `:silent`, to avoid having the\nlines printed to the screen.\n\nTo redirect the output from an ex-command to a file, you can use the\nfollowing set of commands:\n\n :redir > myfile\n :g/HelloWord/p\n :redir END\n\nFor more information, read:\n\nB<:help :redir>\n\nB<:help :silent>\n\n\n\n=head2 16.5. When I press the <Tab> key to complete the name of a file in the\n   command mode, if there are more than one matching file names, then\n   Vim completes the first matching file name and displays a list of all\n   matching filenames. How do I configure Vim to only display the list\n   of all the matching filenames and not complete the first one?\n\nYou can modify the 'wildmode' option to configure the way Vim completes\nfilenames in the command mode. In this case, you can set the 'wildmode'\noption to \"list\":\n\n :set wildmode=list\n\nFor more information, read:\n\nB<:help 'wildmode'>\n\n\n\n=head2 16.6. How do I copy text from a buffer to the command line and from the\n   command line to a buffer?\n\nTo copy text from a buffer to the command line, after yanking the text from\nthe buffer, use \"<CTRL-R>0\" in the command line to paste the text. You can\nalso yank the text to a specific register and use CTRL-R <register> to\npaste the text to the command line.  You can use CTRL-R CTRL-W to paste the\nword under the cursor in the command line.\n\nTo copy text from the command line into a buffer, you can paste the\ncontents of the : register using the \":p command. The most recently\nexecuted command line is stored in the : register.\n\nAnother approach for copying and pasting text to and from the command line\nis to open the command line window using q: from normal mode or CTRL-F from\nthe command-line mode. In the command line window you can use all the Vim\ncommands to edit the command line.\n\nFor more information, read:\n\nB<:help c_CTRL-R>\n\nB<:help quote_:>\n\nB<:help cmdline-window>\n\n\n\n=head2 16.7. How do I put a command onto the command history without executing it?\n\nTo put a command onto the command history without executing it, press the\n<Esc> key to cancel the command.\n\nAn alternative solution, is to use the histadd() function like this:\n\n :call histadd(':', 'echo strftime(\"%c\")')\n\nFor more information, read:\n\nB<:help c_<Esc>>\n\nB<:help histadd()>\n\n\n\n=head2 16.8. How do I increase the height of the command-line?\n\nYou can increase the height of the command-line by changing the 'cmdheight'\noption:\n\n :set cmdheight=2\n\nFor more information, read:\n\nB<:help 'cmdheight'>\n\nB<:help hit-enter>\n\nB<:help 05.7>\n\n\n\n\n=head1 VIMINFO\n\n\n\n=head2 17.1. When I invoke Vim, I get error messages about illegal characters in\n   the viminfo file. What should I do to get rid of these messages?\n\nYou can remove the $HOME/.viminfo or the $HOME/_viminfo file to get rid of\nthese error messages.\n\nFor more information, read:\n\nB<:help viminfo-errors>\n\nB<:help viminfo-file-name>\n\nB<:help viminfo>\n\nB<:help 21.3>\n\n\n\n=head2 17.2. How do I disable the viminfo feature?\n\nBy default, the viminfo feature is disabled. If the viminfo feature is\nenabled by a system-wide vimrc file, then you can disable the viminfo\nfeature by setting the 'viminfo' option to an empty string in your local\n.vimrc file:\n\n :set viminfo=\"\"\n\nFor more information, read:\n\nB<:help 'viminfo'>\n\n\n\n=head2 17.3. How do I save and use Vim marks/commands across Vim sessions?\n\nYou can save and restore Vim marks across Vim sessions using the viminfo\nfile. To use the viminfo file, make sure the 'viminfo' option is not empty.\nTo save and restore Vim marks, the 'viminfo' option should not contain the\n\"f\" flag or should have a value greater than zero for the \"f\" option.\n\nYou can also use the viminfo file to synchronize the commandline history\nacross different sessions using `:wvimfo` and `:rviminfo` commands together\nwith the FocusGained and FocusLost autocommands:\n\n augroup viminfo\n     au!\n     au FocusLost   * wviminfo\n     au FocusGained * rviminfo\n augroup end\n\nNote, this will only work reliably, when Vim can detect the FocusLost\nand FocusGained autocommands correctly. This means it should work with\nGVim but might depend on your terminal for konsole vim.\n\nFor more information, read:\n\nB<:help 21.3>\n\nB<:help viminfo>\n\nB<:help 'viminfo'>\n\nB<:help :wviminfo>\n\nB<:help :rviminfo>\n\nB<:help FocusLost>\n\nB<:help FocusGained>\n\n\n\n\n=head1 REMOTE EDITING\n\n\n\n=head2 18.1. How do I open a file with existing instance of gvim? What happened to\n   the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n\nStarting with Vim6, the OLE version of OpenWithVim.exe and SendToVim.exe\nVim utilities are replaced by the new client-server feature. To open the\nfile j.txt with an existing instance of Gvim (MyVim), use:\n\n $ gvim --servername MyVim --remote-silent j.txt\n\nTo list the server names of all the currently running Vim instances, use\n\n $ vim --serverlist\n\nTo get more information about client-server feature, read\n\nB<:help client-server>\n\n\n\n=head2 18.2. How do I send a command to a Vim server to write all buffers to disk?\n\nYou can use the Vim remote server functionality to do this:\n\n $ gvim --servername myVIM --remote-send \"<C-\\><C-N>:wall<CR>\"\n\nFor more information, read:\n\nB<:help client-server>\n\nB<:help CTRL-\\_CTRL-N>\n\nB<:help :wall>\n\n\n\n=head2 18.3. Where can I get the documentation about the Vim remote server\n   functionality?\n\nYou can get more information about the Vim remote server functionality by\nreading\n\nB<:help client-server>\n\n\n\n\n=head1 OPTIONS\n\n\n\n=head2 19.1. How do I configure Vim in a simple way?\n\nYou can use the `:options` command to open the Vim option window:\n\n :options\n\nThis window can be used for viewing and setting all the options.\n\nFor more information, read:\n\nB<:help :options>\n\n\n\n=head2 19.2. How do I toggle the value of an option?\n\nYou can prefix the option with \"inv\" to toggle the value of the option:\n\n :set invignorecase\n :set invhlsearch\n\nYou can also suffix the option with \"!\" to toggle the value:\n\n :set ignorecase!\n :set hlsearch!\n\nFor more information, read:\n\nB<:help set-option>\n\n\n\n=head2 19.3. How do I set an option that affects only the current buffer/window?\n\nSome of the Vim options can have a local or global value. A local value\napplies only to a specific buffer or window. A global value applies to all\nthe buffers or windows.\n\nWhen a Vim option is modified using the `:set` command, both the global and\nlocal values for the option are changed. You can use the `:setlocal`\ncommand to modify only the local value for the option and the `:setglobal`\ncommand to modify only the global value.\n\nYou can use the `:setlocal` command to set an option that will affect only\nthe current file/buffer:\n\n :setlocal textwidth=70\n\nNote that not all options can have a local value. You can use `:setlocal`\ncommand to set an option locally to a buffer/window only if the option is\nallowed to have a local value.\n\nYou can also use the following command to set an option locally:\n\n :let &l:{option-name} = <value>\n\nFor more information, read:\n\nB<:help :setlocal>\n\nB<:help local-options>\n\n\n\n=head2 19.4. How do I use space characters for a Vim option value?\n\nTo use space characters in a Vim option value, you have to escape the space\ncharacter. For example:\n\n :set tags=tags\\ /usr/tags\n\nFor more information, read:\n\nB<:help option-backslash>\n\n\n\n=head2 19.5. Can I add (embed) Vim option settings to the contents of a file?\n\nYou can use modelines to add Vim option settings to the contents of a file.\nFor example, in a C file, you can add the following line to the top or the\nbottom of the file:\n\n /* vim:sw=4: */\n\nThis will set the 'shiftwidth' option to 4, when editing that C file.\nFor this to work, the 'modeline' option should be set. By default, the\n'modeline' option is set. An alternative example is given in this document\nin the first line.\n\nThe 'modelines' settings specifies the number of\nlines that will be checked for the Vim set commands.\n\nFor more information, read:\n\nB<:help 21.6>\n\nB<:help modeline>\n\nB<:help auto-setting>\n\nB<:help 'modeline'>\n\nB<:help 'modelines'>\n\n\n\n=head2 19.6. How do I display the line numbers of all the lines in a file?\n\nYou can set the 'number' option to display the line numbers for all the\nlines.\n\n :set number\n\nFor more information, read:\n\nB<:help 'number'>\n\n\n\n=head2 19.7. How do I change the width of the line numbers displayed using the\n   'number' option?\n\nYou can set the minimum number of columns to be used for line numbering by\nsetting the 'numberwidth' option:\n\n :set numberwidth=3\n\nThis set's the width for the line number to 3 digits, which is enough, if\nyour buffer contains less than 999 lines. However, if your current buffer\ncontains more lines than 999, the 'numberwidth' will be adjusted accordingly,\nso that the maximum line number will fit on the screen.\n\n\n=head2 19.8. How do I display (view) all the invisible characters like space, tabs\n   and newlines in a file?\n\nYou can set the 'list' option to see all the invisible characters in your\nfile.\n\n :set list\n\nWith this option set, you can view space characters, tabs, newlines,\ntrailing space characters and wrapped lines.\n\nTo not display the invisible characters (which is the default), you have to\nreset the 'list' option:\n\n :set nolist\n (or)\n :set list!\n\nThe `:set list!` command will toggle the current setting of the boolean\n'list' option.\n\nYou can modify the 'listchars' option to configure how and which invisible\ncharacters are displayed. For example, with the following command all the\ntrailing space characters will be displayed with a \".\" character.\n\n :set listchars=trail:.\n\nFor more information, read:\n\nB<:help 'listchars'>\n\nB<:help 'list'>\n\n\n\n=head2 19.9. How do I configure Vim to always display the current line and column\n   number?\n\nYou can set the 'ruler' option to display current column and line number in\nthe status line:\n\n :set ruler\n\nFor more information, read:\n\nB<:help 'ruler'>\n\n\n\n=head2 19.10. How do I display the current Vim mode?\n\nYou can set the 'showmode' option to display the current Vim mode. In\nInsert, Replace and Visual modes, Vim will display the current mode on the\nlast line.\n\n :set showmode\n\nFor more information, read:\n\nB<:help 'showmode'>\n\n\n\n=head2 19.11. How do I configure Vim to show pending/partial commands on the\n    status line?\n\nYou can set the 'showcmd' option to display pending/partial commands in the\nstatus line:\n\n :set showcmd\n\nFor more information, read:\n\nB<:help 'showcmd'>\n\n\n\n=head2 19.12. How do I configure the Vim status line to display different\n    settings/values?\n\nYou can set the 'statusline' option to display different values/settings in\nthe Vim status line.\n\nFor more information, read:\n\nB<:help 'statusline'>\n\nB<:help 'laststatus'>\n\nB<:help 'rulerformat'>\n\nB<:help 'ruler'>\n\n\n\n=head2 19.13. How do I configure Vim to display status line always?\n\nYou can set the 'laststatus' option to 2 to display the status line always.\n\n :set laststatus=2\n\nFor more information, read:\n\nB<:help 'laststatus'>\n\n\n\n=head2 19.14. How do I make a Vim setting persistent across different Vim\n    invocations/instances/sessions?\n\nTo make a Vim option setting persistent across different Vim instances, add\nyour setting to the .vimrc or .gvimrc file. You can also use the `:mkvimrc`\ncommand to generate a vimrc file for the current settings.\n\nFor more information, read:\n\nB<:help save-settings>\n\nB<:help vimrc>\n\nB<:help gvimrc>\n\nB<:help vimrc-intro>\n\nB<:help :mkvimrc>\n\nB<:help initialization>\n\n\n\n=head2 19.15. Why do I hear a beep (why does my window flash) about 1 second after\n    I hit the Escape key?\n\nThis is normal behavior. If your window flashes, then you've got the visual\nbell on. Otherwise, you should hear a beep.\n\nVim needs a timeout to tell the difference between a simple escape and,\nsay, a cursor key sequence.  When you press a key in normal mode (and even\nin insert mode) and that key is the beginning of a mapping, Vim waits a\ncertain amount of time to see if the rest of the mapping sequence follows.\nIf the mapping sequence is completed before a given timeout period, the\nmapping for that sequence of keys is applied. If you interrupt the mapping,\nthe normal actions associated with the keys are executed.\n\nFor example, if you have a mapping defined as `:imap vvv Vim is great!!`\nand you type \"vvv\" quickly, the \"Vim is great!!\" will be inserted into your\ntext. But if you type \"vv v\" then that is what will put into your text.\nThis is also true if you type \"vvv\" too slowly where \"too slowly\" is longer\nthan the value for the timeout option. Setting the timeout option to a\nlarger value can help alleviate problems that appear when using function\nkeys over a slow line.\n\nFor more information, read:\n\nB<:help 'ttimeout'>\n\n\n\n=head2 19.16. How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n    deleting the characters I'm changing?\n\nTo make the \"c\" and \"s\" commands display a \"$\" instead of deleting the\ncharacters, add the $ flag to the 'cpoptions' option:\n\n :set cpoptions+=$\n\nFor more information, read:\n\nB<:help 'cpoptions'>\n\n\n\n=head2 19.17. How do I remove more than one flag using a single `:set` command\n    from a Vim option?\n\nYou can remove more than one flag from a Vim option using a single `:set`\ncommand, by specifying the flags in exactly the same order as they appear\nin the option. For example, if you use the following command to remove the\n\"t\" and \"n\" flags from the 'formatoptions' option:\n\n :set formatoptions-=tn\n\nThe \"t\" and \"n\" flags will be removed from the 'formatoptions' option, only\nif the 'formatoptions' option contains these flags in this order: \"tn\".\nOtherwise, it will not remove the flags. To avoid this problem, you can\nremove the flags one by one:\n\n :set formatoptions-=t formatoptions-=n\n\nFor more information, read:\n\nB<:help :set-=>\n\n\n\n\n=head1 MAPPING KEYS\n\n\n\n=head2 20.1. How do I know what a key is mapped to?\n\nTo see what a key is mapped to, use the following commands:\n\n :map <key>\n :map! <key>\n\nYou can also check the mappings in a particular mode using one of the\n`:cmap`, `:nmap`, `:vmap`, `:imap`, `:omap`, etc commands.\n\nTo find out, where the key has been mapped, prefix the `:verbose` command:\n\n :verbose :map <key>\n\nFor more information, read:\n\nB<:help map-listing>\n\nB<:help map-overview>\n\n\n\n=head2 20.2. How do I list all the user-defined key mappings?\n\nYou can list all the user-defined key mappings using:\n\n :map\n\nFor more information, read:\n\nB<:help map-listing>\n\n\n\n=head2 20.3. How do I unmap a previously mapped key?\n\nYou can unmap a previously mapped key using the `:unmap` command:\n\n :unmap <key>\n :unmap! <key>\n\nFor mode specific mappings, you can use one of the these commands:\n\n :nunmap\n :vunmap\n :ounmap\n :iunmap\n :lunmap\n :cunmap\n\nThe following command will fail to unmap a buffer-local mapped key:\n\n :unmap <key>\n\nTo unmap a buffer-local mapped key, you have to use the <buffer> keyword in\nthe unmap command:\n\n :unmap <buffer> <key>\n :unmap! <buffer> <key>\n\nFor more information, read:\n\nB<:help :unmap>\n\nB<:help map-modes>\n\nB<:help :map-local>\n\nB<:help mapleader>\n\n\n\n=head2 20.4. I am not able to create a mapping for the <xxx> key. What is wrong?\n\n1) First make sure, the key is passed correctly to Vim. To determine if\n   this is the case, put Vim in Insert mode and then hit CTRL-V (or\n   CTRL-Q if your CTRL-V is remapped to the paste operation (e.g. on\n   Windows if you are using the mswin.vim script file) followed by your\n   key.\n\n   If nothing appears in the buffer (and assuming that you have\n   'showcmd' on, ^V remains displayed near the bottom right of the Vim\n   screen), then Vim doesn't get your key correctly and there is nothing\n   to be done, other than selecting a different key for your mapping or\n   using GVim, which should recognise the key correctly.\n\n2) Possibly, Vim gets your key, but sees it as no different than\n   something else. Say you want to map <Ctrl-Right>, then in Insert mode\n   hit CTRL-K followed by <Ctrl-Right>. If Vim displays <C-Right> it has\n   correctly seen the keystroke and you should be able to map it (by\n   using <C-Right> as your {lhs}). If it displays <Right> it has seen\n   the keystroke but as if you hadn't held <Ctrl> down: this means your\n   temrinal passes <Ctrl-Right> as if it were just <Right>. Anything else\n   means the key has been misidentified.\n\n3) If the key is seen, but not as itself and not as some recognizable\n   key, then there is probably an error in the terminal library for the\n   current terminal (termcap or terminfo database). In that case\n\n     :set term?\n\n   will tell you which termcap or terminfo Vim is using. You can try to\n   tell vim, what termcode to use in that terminal, by adding the\n   following to your vimrc:\n\n     if &term == <termname>\n         set <C-Right>=<keycode>\n     endif\n\n   where <termname> above should be replaced by the value of 'term'\n   (with quotes around it) and <keycode> by what you get when hitting\n   CTRL-V followed by <Ctrl-Right> in Insert mode (with nothing around\n   it). <C-Right> should be left as-is (9 characters). Don't forget that\n   in a `:set` command, white space is not allowed between the equal sign\n   and the value, and any space, double quote, vertical bar or backslash\n   present as part of the value must be backslash-escaped.\n\n   Now you should be able to see the keycode corresponding to the key\n   and you can create a mapping for the key using the following command:\n\n     :map <C-Right>  <your_command_to_be_mapped>\n\nFor more information, read:\n\nB<:help map-keys-fails>\n\nB<:help :map-special-keys>\n\nB<:help key-codes>\n\n\n\n=head2 20.5. Why does mapping the <C-...> key not work?\n\nThe only <Ctrl>-<printable-key> chords which Vim can reliably detect\n(because they are defined in the ASCII standard) are the following:\n\n     CTRL-@                 0x00            NUL\n     CTRL-A to CTRL-Z       0x01 to 0x1A\n     CTRL-a to CTRL-z       0x01 to 0x1A\n     CTRL-[                 0x1B            ESC\n     CTRL-\\                 0x1C\n     CTRL-]                 0x1D\n     CTRL-^                 0x1E\n     CTRL-_                 0x1F\n     CTRL-?                 0x7F            DEL\n\nMost of these, however, already have a function in Vim (and some are\naliases of other keys: CTRL-H and <BS>, CTRL-I and <Tab>, CTRL-M and <Enter>,\nCTRL-[ and <Esc>, CTRL-? and <Del>).\n\nThe \"safest\" keys to use in Vim for the {lhs} of a mapping are the F\nkeys, with or without Shift: <F2> to <F12> and <S-F1> to <S-F12>. (Some\nOSes, including mine, intercept <Ctrl-Fn> and <Alt-Fn>, which never reach an\napplication program such as vim or gvim).\n\nYou can try other combinations of <Ctrl> + any key, but they may either\nnot work everywhere (e.g. the terminal might not pass that key to Vim,\nor they might have unintended side effects (e.g. mapping <C-I> means\nalso to map <Tab>).\n\nThis is a known issue, that has been discussed and might be implemented\nin the future to enable Vim to distinguish between various keys even in\nconsole mode. (e.g.\nhttps://groups.google.com/d/msg/vim_dev/2bp9UdfZ63M/sajb9KM0pNYJ)\n\n\n=head2 20.6. How do I map the numeric keypad keys?\n\nFirst make sure that the numeric keypad keys are passed to Vim. Next, you\ncan use the following command to map the numeric keypad keys:\n\n :map <kSomething>  <your_command>\n\nwhere, <kSomething> can be kHome, kEnd, kPageUp, kPageDown, kPlus, kMinus,\nkDivide, kMultiply, kEnter, etc.\n\nFor more information, read:\n\nB<:help key-codes>\n\nB<:help terminal-options>\n\n\n\n=head2 20.7. How do I create a mapping that works only in visual mode?\n\nYou can create mappings that work only in specific modes (normal, command,\ninsert, visual, etc). To create a mapping that works only in the visual\nmode, use the `:vmap` command:\n\n :vmap <F3> <your mapping here>\n\nThis mapping will work in visual and select mode. If you want the map to\nwork only in visual mode (excluding select mode), use:\n\n\n :xmap <F3> <your mapping here>\n\nand to have the mapping only work in select mode (but not visual mode),\nuse:\n\n :smap <F3> <your mapping here>\n\nFor more information, read:\n\nB<:help :vmap>\n\nB<:help :xmap>\n\nB<:help :smap>\n\nB<:help map-modes>\n\nB<:help 40.1>\n\n\n\n=head2 20.8. How do I create a mapping that works only in normal and operator\n   pending mode (but not in visual mode)?\n\nUsing `:map` creates a mapping that works in normal, visual+select mode and\noperator pending mode. You can use `:nmap` to have the mapping only work in\nnormal mode and `:vmap` to have the mapping only be defined for visual and\nselect mode or use `:omap` to have the mapping only defined in operator\npending mode.\n\nBut if you want to have a mapping defined, that works in both operator\npending mode and normal mode, but not in visual and select mode, you need\nto first define the mapping using `:map` and afterwards delete the mapping\nfor visual and select mode:\n\n\t:map <f3> <your mapping here>\n\t:vunmap <f3>\n\n\n=head2 20.9. In a Vim script, how do I know which keys to use for my mappings, so\n   that the mapped key will not collide with an already used key?\n\nVim uses most of the keys in the keyboard. You can use the <leader> prefix\nin maps to define keys which will not overlap with Vim keys. For example:\n\n :map <leader>S <C-W>s\n :map <leader>j <C-W>j\n :map <leader>k <C-W>k\n\nwhere by default <leader> gets substituted with a backslash (\\), so the\nuser would enter\n\n     \\s\n     \\j\n     \\k\n\nto invoke the above map commands. The user can change the mapleader\nvariable to be whatever they wanted:\n\n :let mapleader = \",\"\n\nWhen writing a plugin or other script, more often than not, it is advisable\nto use `:noremap` instead of `:map` to avoid side effects from user defined\nmappings.\n\nFor more information, read:\n\nB<:help <Leader>>\n\nB<:help <LocalLeader>>\n\nB<:help write-plugin>\n\n\n\n=head2 20.10. How do I map the escape key?\n\nYou can map the Escape key to some other key using the `:map` command. For\nexample, the following command maps the escape key to CTRL-O.\n\n :map <C-O> <Esc>\n\n\n=head2 20.11. How do I map a key to perform nothing?\n\nYou can map a key to <Nop> to perform nothing when the key is pressed. For\nexample, with the following mappings, the <F7> key will do nothing when\npressed.\n\n :map <F7> <Nop>\n :map! <F7> <Nop>\n\nFor more information, read:\n\nB<:help <Nop>>\n\nB<:help :map>\n\nB<:help :map!>\n\nB<:help map-modes>\n\n\n\n=head2 20.12. I want to use the <Tab> key to indent a block of text and <Shift-Tab>\n    key to unindent a block of text. How do I map the keys to do this?\n    This behavior is similar to textpad, visual studio, etc.\n\nUse the following mapping:\n\n :inoremap <S-Tab> <C-O><lt><lt>\n :nnoremap <Tab> >>\n :nnoremap <S-Tab> <lt><lt>\n :vnoremap <Tab> >\n :vnoremap <S-Tab> <lt>\n\nNote, that the <S-Tab> mapping will work only if Vim receives the correct\nkey sequence. This is mostly the case with GUI Vim.\n\nFor more information, read:\n\nB<:help :inoremap>\n\nB<:help :nnoremap>\n\nB<:help :vnoremap>\n\nB<:help <S-Tab>>\n\nB<:help i_CTRL-O>\n\nB<:help >>>\n\nB<:help <<>\n\nB<:help <lt>>\n\n\n\n=head2 20.13. In my mappings the special characters like <CR> are not recognized.\n    How can I configure Vim to recognize special characters?\n\nCheck the value of the 'cpoptions' option:\n\n :set cpoptions?\n\nIf this option contains the \"<\" flag, then special characters will not be\nrecognized in mappings. Remove the \"<\" flag from 'cpoptions' option:\n\n :set cpo-=<\n\nAlso, check the value of the 'compatible' option:\n\n :set compatible?\n\nThe 'compatible' option must be reset:\n\n :set nocompatible\n\nFor more information, read:\n\nB<:help 'cpoptions'>\n\nB<:help 'compatible'>\n\n\n\n=head2 20.14. How do I use the \"|\" to separate multiple commands in a map?\n\nYou can escape the \"|\" character using backslash (\\) to use \"|\" in a map.\n\n :map _l :!ls \\| more<CR>\n\nYou can also try the following command:\n\n :map _l :!ls <bar> more<CR>\n\nThere are also other ways to do this.\n\nFor more information, read:\n\nB<:help map_bar>\n\n\n\n=head2 20.15. If I have a mapping/abbreviation whose ending is the beginning of\n    another mapping/abbreviation, how do I keep the first from expanding\n    into the second one?\n\nInstead of using the `:map lhs rhs` command, use the `:noremap lhs rhs`\ncommand. For abbreviations, use \"noreabbrev lhs rhs\". The \"nore\" prefix\nprevents the mapping or abbreviation from being expanded again.\n\nFor more information, read:\n\nB<:help :noremap>\n\nB<:help :noreabbrev>\n\n\n\n=head2 20.16. Why does it take a second or more for Vim to process a key,\n    sometimes when I press a key?\n\nMake sure you have not defined a mapping for this key using the following\ncommand:\n\n :map <key>\n\nIf a mapping is defined for this key and the mapped key contains more than\none character, then Vim will wait for the next character to be pressed to\ndetermine whether it is the mapped key or not. For example, if you have\nmapped \"ab\", then if you press \"a\", Vim will wait for the next key to be\npressed. If the next key is \"b\", Vim will execute the mapped sequence.\nOtherwise, Vim will proceed with the normal processing of \"a\" followed by\nthe next key. If the 'timeout' option is set (which is the default), then\nVim will timeout after waiting for the period specified with the\n'timeoutlen' option (default is 1 second).\n\nFor more information, read:\n\nB<:help map-typing>\n\nB<:help 'timeoutlen'>\n\nB<:help 'ttimeoutlen'>\n\nB<:help 'timeout'>\n\nB<:help 'ttimeout'>\n\nB<:help vt100-cursor-keys>\n\nB<:help slow-fast-terminal>\n\n\n\n=head2 20.17. How do I map a key to run an external command using a visually\n    selected text?\n\nYou can the `:vmap` command to map a key in the visual mode. In the mapped\ncommand sequence, you have to first yank the text. The yanked text is\navailable in the '\"' register. Now, you can use the contents of this\nregister to run the external command. For example, to run the external\ncommand \"perldoc\" on a visually selected text, you can use the following\nmapping:\n\n :vmap <F7> y:!exec \"!perldoc '\" . @\" . \"'\"<CR>\n\nIf you want the mapping to work in the visual mode, but not with the\nhighlighted text, you can use the following command:\n\n :vmap <F7> :<C-U>!perldoc <cword><CR>\n\nThe above mapping will use the word under the cursor instead of the\nhighlighted text. Note the use of the <C-U> before invoking the \"perldoc\"\nexternal command. The <C-U> is used to erase the range of text selected in\nthe visual mode and displayed on the command line. If the visual range is\nnot removed using <C-U>, then the output from the external command will\nreplace the visually selected text.\n\nFor more information, read:\n\nB<:help :vmap>\n\nB<:help quote_quote>\n\nB<:help :let-register>\n\nB<:help c_CTRL-U>\n\nB<:help :!cmd>\n\n\n\n=head2 20.18. How do I map the CTRL-I key while still retaining the functionality\n    of the <Tab> key?\n\nThe CTRL-I key and the <Tab> key produce the same keycode, so Vim cannot\ndistinguish between the CTRL-I and the <Tab> key. When you map the CTRL-I\nkey, the <Tab> key is also mapped (and vice versa). The same restriction\napplies for the CTRL-[ key and the <Esc> key.\n\nFor more information, read:\n\nB<:help keycodes>\n\n\n\n=head2 20.19. How do I define a map to accept a count?\n\nUse the @= command to use an expression. For example,\n\n nnoremap = @='3l'\n\nNow you can specify a count to the \"=\" command.\n\nB<:help complex-repeat>\n\n\n\n=head2 20.20. How can I make my normal mode mapping work from within Insert\n    Mode?\n\nMappings in normal mode can be executed after CTRL-O from insert mode as\nwell but if there are more commands included in the mapping {rhs}, only the\nfirst one will be executed in normal mode and the rest of {rhs} will be\nprinted literally in insert mode. One of ways to workaround this problem is\nto make {rhs} be one command, via wrapping it to the function. For example:\n\n function GetFontNameOfFirstChar()\n normal! 0\n echo getfontname()\n endfunction\n\n :nmap <F9> :call GetFontNameOfFirstChar()<CR>\n\nA more technical and detailed solution to this problem follows and can\nbe found at https://groups.google.com/group/vim_dev/msg/75f1f2dfc00908bb\n\nNot every normal mode-mapping is automatically suitable for execution via\nCTRL-O from within insert mode; you need to explicitly design your mappings\nfor that purpose.\n\nThe CTRL-O command allows execution of one normal mode command from\nwithin insert mode, then returns to insert mode. If a normal mode mapping\nconcatenates multiple normal mode commands, this breaks down in temporary\nnormal mode and literally inserts the second part of the command into the\nbuffer instead. To support execution of normal mode mappings from within\ninsert mode, these strategies can be used:\n\n1) Instead of concatenating multiple normal mode commands, use one `:normal`\n mapping:\n\n :nnoremap <silent> zC :<C-U>normal! zCVzC<CR>\n\n2) Concatenate multiple Ex commands via <Bar> on the rhs:\n\n :nnoremap zC :<C-U>call MyMap1()<Bar>call MyMap2()<CR>\n\n3) Shadow normal mode mappings by insert mode mappings that\n re-enter normal mode, then invoke the normal mode mapping:\n\n :nnoremap <silent> <SID>MyMap2 :<C-U>call MyMap2()<CR>\n :inoremap <silent> <script> <SID>MyMap2 <C-\\><C-O><SID>MyMap2\n :nnoremap <silent> <script> zC <SID>MyMap1<SID>MyMap2\n\n4) Normal mode mappings that consist of multiple Ex command lines (and\n where Ex commands cannot be concatenated via <Bar>) replace `:<C-U>`\n with <SID>NM; the <SID>NM mapping enters normal mode for one ex command\n line:\n\n :nnoremap <silent> <SID>NM :<C-U>\n :inoremap <silent> <SID>NM <C-\\><C-O>:\n :nnoremap <silent> <script> zC <SID>MyMap1<SID>NMcall MyMap2()<CR>\n\n5)  If none of the above is possible, at least force normal mode for\n subsequent commands via CTRL-\\ CTRL-N to avoid accidental insertion\n of the remainder of the mapping.\n\n :nnoremap zC zC<C-\\><C-N>VzCzz\n\n\nFor more information, read:\n\nB<:help i_CTRL-O>\n\nB<:help map_bar>\n\nB<:help i_CTRL-\\_CTRL-O>\n\nB<:help CTRL-\\_CTRL-N>\n\n\n\n\n=head1 ABBREVIATIONS\n\n\n\n=head2 21.1. How do I auto correct misspelled words?\n\nYou can auto correct misspelled words using abbreviations. For example, the\nfollowing abbreviation can be used to correct \"teh\" with \"the\":\n\n :abbreviate teh the\n\nVim supports abbreviations in insert mode, replace mode and command-line\nmode.\n\nFor more information, read:\n\nB<:help 24.7>\n\nB<:help abbreviations>\n\nB<:help Q_ab>\n\n\n\n=head2 21.2. How do I create multi-line abbreviations?\n\nYou can create multi-line abbreviations by embedding the \"<CR>\"\nkey code in the text:\n\n iabbrev #c --------------<CR>-- Date:<CR>--<CR>---------\n\nWith the above abbreviation, when you type #c, it will be expanded to\nthe following text:\n\n--------------\n-- Date:\n--\n---------\n\nFor more information, read:\n\nB<:help abbreviations>\n\n\n\n=head2 21.3. When my abbreviations are expanded, an additional space character is\n   added at the end of the expanded text. How do I avoid this character?\n\nTo avoid an additional space character at the end of the expanded text, you\ncan expand the abbreviation by pressing the CTRL-] key.  The abbreviation\nwill be expanded without adding a space character at the end.\n\nAnother alternative is to use the following function and command:\n\n function! Eatchar(pat)\n     let c = nr2char(getchar())\n     return (c =~ a:pat) ? '' : c\n endfunction\n command! -nargs=+ Iabbr execute \"iabbr\" <q-args> . \"<C-R>=Eatchar('\\\\s')<CR>\"\n\nNow, define your abbreviations using the new \"Iabbr\" command instead of the\nbuiltin `:iabbrev` command. With this command, after expanding the\nabbreviated text, the next typed space character will be discarded.\n\nFor more information, read:\n\nB<:help abbreviations>\n\n\n\n=head2 21.4. How do I insert the current date/time stamp into the file?\n\nYou can use the strftime() function to insert the current data/time stamp\nin a file. For example, you can use the following abbreviation:\n\n iabbrev dts <C-R>=strftime(\"%y/%m/%d %H:%M\")<CR>\n\nWith this abbreviation, when you type dts in insert mode, it will be\nexpanded to the date/time stamp.\n\nSome other forms of the above abbreviation are listed below:\n\n iabbrev mdyl <C-R>=strftime(\"%a %d %b %Y\")<CR>\n iabbrev mdys <C-R>=strftime(\"%y%m%d\")<CR>\n iabbrev mdyc <C-R>=strftime(\"%c\")<CR>\n iabbrev hml  <C-R>=strftime(\"%d/%m/%y %H:%M:%S\")<CR>\n iabbrev hms  <C-R>=strftime(\"%H:%M:%S\")<CR>\n\nFor more information, read:\n\nB<:help strftime()>\n\nB<:help i_CTRL-R>\n\n\n\n=head2 21.5. How do I prevent an abbreviation from expanding in insert mode?\n\nYou can prevent an abbreviation from expanding in insert mode by typing\nCTRL-V before the character after the abbreviated word.\n\nFor more information, read:\n\nB<:help abbreviations>\n\n\n\n\n=head1 RECORD AND PLAYBACK\n\n\n\n=head2 22.1. How do I repeat an editing operation (insertion, deletion, paste,\n   etc)?\n\nYou can repeat the last editing operation using the \".\" command. This will\nrepeat the last simple change like a insert, delete, change, paste, etc.\n\nFor more information, read:\n\nB<:help 04.3>\n\nB<:help single-repeat>\n\nB<:help Q_re>\n\n\n\n=head2 22.2. How I record and repeat a set of key sequences?\n\nYou can use the \"q\" command in normal mode to record a set of key sequences\nand store it in a register. For example, in the normal mode you can press q\nfollowed by a register name {0-9a-bA-Z\"} to start the recording.  To\nend/stop the recording press q again. You can playback/repeat the recorded\nkey sequences by pressing @ followed by the register name. e.g. @a.\n\nAnother approach is to start Vim with the \"-w\" command-line argument.\n\n $ vim -w <file_name>\n\nVim will record all the characters typed in the session in the\nspecified file \"file_name\". You can use the recorded file with the \"-s\"\ncommand line argument to play it back:\n\n $ vim -s <file_name>\n\nFor more information, read:\n\nB<:help 10.1>\n\nB<:help recording>\n\nB<:help -w>\n\nB<:help -s>\n\n\n\n=head2 22.3. How do I edit/modify a recorded set of key sequences?\n\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer, edit the pasted text and again\nyank the text into the register. You can also use the `:let` command to\nmodify the register. For example:\n\n :let @a = \"iHello World\\<Esc>\"\n\nFor more information, read:\n\nB<:help recording>\n\nB<:help 10.1>\n\nB<:help :let-register>\n\nB<:help <>>\n\nB<:help 'cpoptions'>\n\n\n\n=head2 22.4. How do I write recorded key sequences to a file?\n\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer. Now you can save the buffer\ninto a file. You can also modify the pasted text and again yank into the\nregister to modify the recorded key sequence. For example, if you record a\nset of key sequences using qa ..... q. The recorded key sequences are\nstored in the register \"a\". You can paste the contents of register \"a\"\nusing \"ap.\n\nFor more information, read:\n\nB<:help recording>\n\nB<:help 10.1>\n\n\n\n=head2 22.5. I am using register 0 to record my key sequences (i.e. q0 .... q).\n   In the recorded key sequences, I am yanking some text. After the\n   first replay of the recorded key sequence, I am no longer able to\n   play it back.\n\nRegister 0 contains the text from the last yank operation. In your recorded\nkey sequence, when the yank is performed, register 0 is overwritten with\nthe yanked text. So your recording stored in register 0 is lost. You have\nto use some other register.\n\nFor more information, read:\n\nB<:help registers>\n\n\n\n\n=head1 AUTOCOMMANDS\n\n\n\n=head2 23.1. How do I execute a command when I try to modify a read-only file?\n\nYou can use the FileChangedRO autocommand event to execute a command when a\nread-only file is modified. For example, you can use this event to checkout a\nread-only file:\n\n :autocmd FileChangedRO * call MyCheckoutFunction()\n\nFor more information, read:\n\nB<:help FileChangedRO>\n\n\n\n=head2 23.2. How do I execute a command every time when entering a buffer?\n\nYou can use the BufEnter autocommand event to execute a command every time\nwhen entering a buffer. For example:\n\n :autocmd BufEnter *.c set formatoptions=croqt\n\nFor more information, read:\n\nB<:help BufEnter>\n\n\n\n=head2 23.3. How do I execute a command every time when entering a window?\n\nYou can use the WinEnter autocommand event to execute a command every time\nwhen entering a window. For example:\n\n :autocmd WinEnter *.c call MyFunction()\n\nFor more information, read:\n\nB<:help WinEnter>\n\n\n\n=head2 23.4. From an autocmd, how can I determine the name of the file or the\n   buffer number for which the autocommand is executed?\n\nYou can use the special words <afile> or <abuf> in an autocmd to get the\nname of the file or the buffer number for which the autocommand is\nexecuted.\n\nFor more information, read:\n\nB<:help :<afile>>\n\nB<:help :<abuf>>\n\nB<:help :<amatch>>\n\n\n\n=head2 23.5. How do I automatically save all the changed buffers whenever Vim\n   loses focus?\n\nYou can define an autocommand for the FocusLost event which will save all\nthe modified buffers whenever Vim loses focus:\n\n :autocmd FocusLost * wall\n\nFor more information, read:\n\nB<:help FocusLost>\n\nB<:help :wall>\n\n\n\n=head2 23.6. How do I execute/run a function when Vim exits to do some cleanup?\n\nYou can use VimLeave autocmd event to execute a function just before Vim\nexits. For example,\n\n :autocmd VimLeave * call MyCleanupFunction()\n\nFor more information, read:\n\nB<:help VimLeave>\n\n\n\n\n=head1 SYNTAX HIGHLIGHT\n\n\n\n=head2 24.1. How do I turn off/on syntax highlighting?\n\nBy default, the Vim syntax highlighting is turned off. To enable the syntax\nhighlighting, you can use one of the following commands:\n\n :syntax enable\n\n or\n\n :syntax on\n\nTo disable the syntax highlighting, you can use the following command:\n\n :syntax off\n\nFor more information, read:\n\nB<:help 06.1>\n\nB<:help 06.4>\n\nB<:help :syntax-enable>\n\nB<:help :syntax-on>\n\nB<:help :syn-clear>\n\n\n\n=head2 24.2. How do I change the background and foreground colors used by Vim?\n\nVim uses the \"Normal\" highlight group for the background and foreground\ncolors. To change the foreground/background colors, you have to modify the\n\"Normal\" highlight group. For example, to set the background color to blue\nand foreground color to white, you can use\n\n :highlight Normal ctermbg=blue ctermfg=white guibg=blue guifg=white\n\nIf you are using the Motif or the Athena version of the GUI Vim, then you\ncan modify the foreground and background resource names in the .Xdefaults\nfiles to change the colors:\n\n Vim.foreground:     Black\n Vim.background:     Wheat\n\nYou can also use the \"-foreground\" and \"-background\" command-line arguments\nto specify the foreground and background colors. These arguments are\nsupported only in the Motif or Athena versions:\n\n $ gvim -foreground Black -background Wheat\n\nFor more information, read:\n\nB<:help :highlight>\n\nB<:help .Xdefaults>\n\nB<:help -gui>\n\n\n\n=head2 24.3. How do I change the highlight colors to suit a dark/light background?\n\nYou can set the 'background' option to either \"dark\" or \"light\" to change\nthe highlight colors to suit a dark/light background:\n\n :set background=dark\n\nFor more information, read:\n\nB<:help 'background'>\n\nB<:help 06.2>\n\n\n\n=head2 24.4. How do I change the color of the line numbers displayed when the\n   `:set number` command is used?\n\nThe line numbers displayed use the LineNr highlighting group. To display\nthe current colors used, use\n\n :hi LineNr\n\nTo change the color modify the LineNr highlight group. For example:\n\n :hi linenr guifg=red guibg=black\n\nThis will give red numbers on a black background in GVIM.\n\nFor more information, read:\n\nB<:help :highlight>\n\n\n\n=head2 24.5. How do I change the background color used for a Visually selected\n   block?\n\nYou can modify the \"Visual\" highlight group to change the color used for a\nvisually selected block:\n\n :highlight Visual guibg=red\n\nFor more information, read:\n\nB<:help :highlight>\n\nB<:help hl-Visual>\n\n\n\n=head2 24.6. How do I highlight the special characters (tabs, trailing spaces, end\n   of line, etc) displayed by the 'list' option?\n\nYou can modify the \"NonText\" and \"SpecialKey\" highlight groups to highlight\nthe special characters displayed by the 'list' option:\n\n :highlight NonText guibg=red\n :highlight SpecialKey guibg=green\n\nThe \"NonText\" highlighting group is used for \"eol\", \"extends\" and\n\"precedes\" settings in the 'listchars' option.  The \"SpecialKey\"\nhighlighting group is used for the \"tab\" and \"trail\" settings.\n\nFor more information, read:\n\nB<:help 'listchars'>\n\nB<:help hl-NonText>\n\nB<:help hl-SpecialKey>\n\n\n\n=head2 24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that Vim\n   uses the specified colorscheme every time?\n\nYou can specify the color scheme using the `:colorscheme` command in your\n.vimrc or .gvimrc file:\n\n colorscheme evening\n\nFor more information, read:\n\nB<:help :colorscheme>\n\n\n\n=head2 24.8. Vim syntax highlighting is broken. When I am editing a file, some\n   parts of the file is not syntax highlighted or syntax highlighted\n   incorrectly.\n\nVim doesn't read the whole file to parse the text for syntax highlighting.\nIt starts parsing wherever you are viewing the file. That saves a lot of\ntime, but sometimes the colors are wrong. A simple fix is refreshing the\nscreen using the CTRL-L key. Or scroll back a bit and then forward again.\nYou can also use the command:\n\n :syntax sync fromstart\n\nNote that this might considerably slow down the screen refreshing.\n\nFor more information, read:\n\nB<:help :syn-sync>\n\nB<:help :syn-sync-first>\n\n\n\n=head2 24.9. Is there a built-in function to syntax-highlight the corresponding\n   matching bracket?\n\nYes. Vim includes the matchparen Plugin as standard plugin that is enabled\nby default. Whenever the cursor moves over an item defined with the\n'matchpairs' option, Vim will highlight the corresponding bracket using the\nMatchParen highlighting group.\n\nHowever, if the corresponding parenthesis is not visible in the current\nwindow, the cursor won't jump to it.\n\nThe matchit plugin provides a similar function, that lets the cursor\njump to related items (e.g. \"if\", \"else\", \"endif\" items) and skips\nmatches in comments. This uses the % command to jump to corresponding\nitems. Though both plugins provide similar functions they are unrelated\nand work differently.\n\nFor more information, read:\n\nB<:help matchparen>\n\nB<:help 'matchpairs'>\n\nB<:help matchit-install>\n\nB<:help matchit-intro>\n\n\n\n=head2 24.10. How do I turn off the C comment syntax highlighting?\n\nYou can use the following command to turn off C comment syntax\nhighlighting:\n\n :highlight clear comment\n\nFor more information, read:\n\nB<:help ft-c-syntax>\n\n\n\n=head2 24.11. How do I add my own syntax extensions to the standard syntax files\n    supplied with Vim?\n\nYou should not modify the syntax files supplied with Vim to add your\nextensions. When you install the next version of Vim, you will lose your\nchanges. Instead you should create a file under the ~/.vim/after/syntax\ndirectory with the same name as the original syntax file and add your\nadditions to this file.\n\nFor more information, read:\n\nB<:help mysyntaxfile-add>\n\nB<:help 'runtimepath'>\n\n\n\n=head2 24.12. How do I replace a standard syntax file that comes with the Vim\n    distribution with my own syntax file?\n\nYou can replace a standard syntax file that comes with the Vim distribution\nby creating a file with the same name as the original syntax file and\nplacing it in the vim runtime syntax (~/.vim/syntax) directory. For\nexample, to replace the c.vim syntax file in a Unix system, place the new\nc.vim in the ~/.vim/syntax directory. In a MS-Windows system, place the new\nsyntax file in the $HOME/vimfiles/syntax or $VIM/vimfiles/syntax directory.\n\nFor more information, read:\n\nB<:help mysyntaxfile-replace>\n\nB<:help 44.11>\n\nB<:help mysyntaxfile>\n\n\n\n=head2 24.13. How do I highlight all the characters after a particular column?\n\nYou can use the `:match` command to highlight all the characters after a\nparticular column:\n\n :match Todo '\\%>75v.\\+'\n\nThis will highlight all the characters after the 75th column.\n\nYou can also set the 'colorcolumn' option to highlight a particular\ncolumn:\n\n   :set colorcolumn=+2\n\nwhich highlights 2 columns after the current 'textwidth' setting\n(alternatively, you can use the exact column number).\n\nFor more information, read:\n\nB<:help :match>\n\nB<:help /\\%v>\n\nB<:help /\\+>\n\nB<:help /.>\n\nB<:help 'colorcolumn'>\n\n\n\n=head2 24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n    highlighting into a HTML file?\n\nYou can use the 2html.vim script to convert a source file into a HTML file\nwith the Vim syntax highlighting. Use the following command:\n\n :TOhtml\n\nFor more information, read:\n\nB<:help convert-to-HTML>\n\nB<:help :TOhtml>\n\n\n\n=head2 24.15. How do I list the definition of all the current highlight groups?\n\nYou can list the definition of all the current highlight groups using the\n`:highlight` (without any arguments) ex command.\n\nFor more information, read:\n\nB<:help :highlight>\n\n\n\n=head2 24.16. How can I embed one syntax highlighting language into another one?\n\nIt is possible to include one syntax highlighting into another one,\nhowever most of the currently deployed syntax highlighting scripts are\nnot prepared to be included into another syntax script.\n\nYou can however create your own custom script to define your own\nregions, which will be highlighted with a different language.\n\nSee the wiki for a comprehensive solution:\n\n http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file\n\nFor more information, read:\n\nB<:help :syn-include>\n\nB<:help sh-awk>\n\n\n\n\n=head1 VIM SCRIPT WRITING\n\n\n\n=head2 25.1. How do I list the names of all the scripts sourced by Vim?\n\nYou can use the `:scriptnames` command to list the names of all the scripts\nsourced by Vim:\n\n :scriptnames\n\nFor more information, read:\n\nB<:help :scriptnames>\n\n\n\n=head2 25.2. How do I debug Vim scripts?\n\nVim has built-in support for a primitive debugger to debug Vim plugins and\nscripts. Using this debugger you can set breakpoints and step through the\nplugin functions.\n\nFor more information, read:\n\nB<:help debug-scripts>\n\nB<:help -D>\n\n\n\n=head2 25.3. How do I locate the script/plugin which sets a Vim option?\n\nYou can use the `:verbose` command to locate the plugin/script which last\nmodified a Vim option. For example:\n\n :verbose set textwidth?\n\nFor more information, read:\n\nB<:help :set-verbose>\n\nB<:help :verbose>\n\n\n\n=head2 25.4. I am getting some error/informational messages from Vim (possibly\n   when running a script), the messages are cleared immediately. How do\n   I display the messages again?\n\nYou can use the `:messages` command to display the previous messages.\n\n :messages\n\nFor more information, read:\n\nB<:help :messages>\n\nB<:help :echoerr>\n\nB<:help :echomsg>\n\nB<:help message-history>\n\n\n\n=head2 25.5. How do I save and restore a plugin specific information across Vim\n   invocations?\n\nVim will save and restore global variables that start with an uppercase\nletter and don't contain a lower case letter. For this to work, the\n'viminfo' option must contain the \"!\" flag. Vim will store the variables in\nthe viminfo file.\n\nFor more information, read:\n\nB<:help 'viminfo'>\n\nB<:help viminfo-file>\n\nB<:help variables>\n\n\n\n=head2 25.6. How do I start insert mode from a Vim function?\n\nYou can use the `:startinsert` command to start the insert mode from inside\na Vim function.\n\nFor more information, read:\n\nB<:help :startinsert>\n\n\n\n=head2 25.7. How do I change the cursor position from within a Vim function?\n\nYou can use the cursor() function to position the cursor.\n\n     call cursor(lnum, col)\n\nAlternatively, use the setpos() function:\n\n     call setpos('.', [bufnum, lnum, col, off])\n\nwhich set's the cursor in the buffer bufnum to line lnum, column col and\noffset for 'virtualedit'. You can use the getpos() function, to return a\nlist with these values, that can then be fed back to the setpos() function.\n\nIf you want to save and restore the viewpoint on a window, use the\nwinsaveview() and winrestview() function calls.\n\nYou can also use the following command to change the cursor position:\n\n     exe \"normal! \" . lnum . \"G\" . col . \"|\"\n\nFor more information, read:\n\nB<:help cursor()>\n\nB<:help bar>\n\nB<:help getpos()>\n\nB<:help setpos()>\n\nB<:help winsaveview()>\n\nB<:help winrestview()>\n\n\n\n=head2 25.8. How do I check the value of an environment variable in the .vimrc\n   file?\n\nYou can use prefix the environment variable name with the \"$\" character to\nuse it from a Vim script/function.  You can refer to the value of an\nenvironment variable using the $env_var syntax:\n\n if $EDITOR == 'vi'\n endif\n\nFor more information, read:\n\nB<:help expr-env>\n\n\n\n=head2 25.9. How do I check whether an environment variable is set or not from a\n   Vim function?\n\nYou can use the exists() function to check for the existence of an\nenvironment variable.\n\n if exists(\"$MY_ENV_VAR\")\n endif\n\nFor more information, read:\n\nB<:help exists()>\n\nB<:help expr-env>\n\n\n\n=head2 25.10. How do I call/use the Vim built-in functions?\n\nYou can use the `:call` command to invoke a Vim built-in function:\n\n :call cursor(10,20)\n\nYou can use the `:echo` command to echo the value returned by a function:\n\n :echo char2nr('a')\n\nYou can use the `:let` command to assign the value returned by a function\nto a variable:\n\n :let a = getline('.')\n\nTo store the return value from a function into a Vim register, you can use\nthe following command:\n\n :let @a = system('ls')\n\nThe above command will store the output of the \"ls\" command into\nthe register \"a\".\n\nFor more information, read:\n\nB<:help :call>\n\nB<:help :echo>\n\nB<:help :let>\n\nB<:help :let-register>\n\nB<:help user-functions>\n\nB<:help usr_41.txt>\n\n\n\n=head2 25.11. I am using some normal mode commands in my Vim script. How do I\n    avoid using the user-defined mappings for these normal mode commands\n    and use the standard Vim functionality for these normal mode\n    commands?\n\nYou can use the `:normal!` command in your script to invoke a normal-mode\ncommand. This will use the standard functionality of the normal mode\ncommand and will not use the user-defined mapping.\n\nFor more information, read:\n\nB<:help :normal>\n\n\n\n=head2 25.12. How do I get the current visually selected text into a Vim variable\n    or register?\n\nYou can get the current visually selected text into a Vim variable by\nyanking the text into Vim register and then assigning the contents of the\nregister into the variable:\n\n :normal! gvy\n :let myvar = @\"\n\nThe above command copies the visually selected text into the variable\n\"myvar\".\n\nYou can also use the command:\n\n :normal! gv\"*y\n\nIn the above command, gv reselects the last visually selected text and the\nrest of the command copies the selected text into the * (clipboard)\nregister. Alternatively, you can set the \"a\" flag in the 'guioptions'\noption to automatically copy a visually selected text into the * register.\nTo do this as part of a visual map, you can use a command similar to the\none shown below:\n\n :vmap <F3> \"*y:call ...\n\n\nFor more information, read:\n\nB<:help gv>\n\nB<:help :normal>\n\nB<:help :let-@>\n\nB<:help quotestar>\n\nB<:help clipboard>\n\nB<:help registers>\n\n\n\n=head2 25.13. I have some text in a Vim variable \"myvar\". I would like to use this\n    variable in a `:s` substitute command to replace a text \"mytext\".\n    How do I do this?\n\nYou can use the `:execute` command to evaluate the variable:\n\n :execute '%s/mytext/' . myvar . '/'\n\nFor more information, read:\n\nB<:help :execute>\n\n\nYou can also use \"\\=\" in the substitute command to evaluate the variable:\n\n :%s/mytext/\\=myvar/\n\nFor more information, read:\n\nB<:help sub-replace-special>\n\n\n\n=head2 25.14. A Vim variable (bno) contains a buffer number. How do I use this\n    variable to open the corresponding buffer?\n\nThe `:buffer` command will not accept a variable name. It accepts only a\nbuffer number or buffer name. You have to use the `:execute` command to\nevaluate the variable into the corresponding value. For example:\n\n :execute \"buffer \" . bno\n\nFor more information, read:\n\nB<:help :execute>\n\n\n\n=head2 25.15. How do I store the value of a Vim option into a Vim variable?\n\nYou can prefix the option name with the \"&\" character and assign the option\nvalue to a Vim variable using the `:let` command. For example, to store the\nvalue of the 'textwidth' option into the Vim variable \"old_tw\", you can use\nthe following command:\n\n :let old_tw = &tw\n\nTo explicitly save buffer local options, use the prefix \"l:\"\n\n :let old_tw = &l:tw\n\nIf you want to explicitly select the global option, use the \"g:\" prefix to\nthe option name.\n\nTo do the opposite, to set the 'textwidth' option with the value stored in\nthe \"old_tw\" variable, you can use the following command:\n\n :let &tw = old_tw\n\nFor more information, read:\n\nB<:help expr-option>\n\nB<:help :let-option>\n\n\n\n=head2 25.16. I have copied and inserted some text into a buffer from a Vim\n    function. How do I indent the inserted text from the Vim function?\n\nYou can use the following command to format the just inserted text:\n\n :normal '[=']\n\nFor more information, read:\n\nB<:help '[>\n\nB<:help ']>\n\nB<:help =>\n\nB<:help :normal>\n\n\n\n=head2 25.17. How do I get the character under the cursor from a Vim script?\n\nYou can use the getline() function and use string index [] to get the\ncharacter:\n\n :echo getline(\".\")[col(\".\") - 1]\n\nIn the above command, getline(\".\") returns  the text in the current line.\nThe indexing of the string starts at zero, and you can get a single\ncharacter in a string by its index with the \"string[index]\" notation. The\ncol(\".\") returns the column of the cursor position; the adjustment is to\nget the right character of the string. However, this does NOT work with\nmultibyte characters as this command only returns the byte index.\n\nAlternatively, you can use the following sequence of commands to get the\ncharacter under the cursor:\n\n normal! vy\n let ch=@\"\n\nNote, that the above commands will change the '< and '> marks.\n\nFor more information, read:\n\nB<:help getline()>\n\nB<:help col()>\n\nB<:help expr-[]>\n\n\n\n=head2 25.18. How do I get the name of the current file without the extension?\n\nYou can get the name of the current file without the extension using:\n\n :echo expand(\"%:r\")\n\nWith some commands, you can use the file name modifiers directly:\n\n :cd %:p:h\n :!gcc -o %:r.o %\n :!xpdf %<.pdf\n\nFor more information, read:\n\nB<:help filename-modifiers>\n\nB<:help expand()>\n\nB<:help cmdline-special>\n\nB<:help fnamemodify()>\n\n\n\n=head2 25.19. How do I get the basename of the current file?\n\nYou can use the \":t\" filename modifier to get the basename of the current\nfile:\n\n :echo expand(\"%:t\")\n\nFor more information, read:\n\nB<:help filename-modifiers>\n\n\n\n=head2 25.20. How do I get the output from a Vim function into the current buffer?\n\nYou can insert the return value from a function using the following command\nin insert mode:\n\n <C-R>=MyFunc()\n\nNote, that this will only insert the return value of the function.\n\nFor more information, read:\n\nB<:help i_CTRL-R>\n\nB<:help i_CTRL-R_CTRL-R>\n\nB<:help i_CTRL-R_CTRL-O>\n\nB<:help expression>\n\n\n\n=head2 25.21. How do I call external programs from a Vim function?\n\nThere are several ways to call external programs from a Vim function. You\ncan use the builtin system() function to invoke external programs and get\nthe result:\n\n :let output = system(\"ls\")\n\nYou can also use \"!\" ex-command to run an external command.\n\nFor more information, read:\n\nB<:help system()>\n\nB<:help :!>\n\nB<:help 10.9>\n\n\n\n=head2 25.22. How do I get the return status of a program executed using the `:!`\n    command?\n\nYou can use the predefined Vim v:shell_error variable to get the return\nstatus of the last run shell command.\n\nFor more information, read:\n\nB<:help v:shell_error>\n\n\n\n=head2 25.23. How do I determine whether the current buffer is modified or not?\n\nYou can check the value of the 'modified' option to determine whether the\ncurrent buffer is modified:\n\n :set modified?\n\nFrom a Vim script, you can check the value of the 'modified' option:\n\n if &modified\n     echo \"File is modified\"\n endif\n\nFor more information, read:\n\nB<:help 'modified'>\n\n\n\n=head2 25.24. I would like to use the carriage return character in a normal\n    command from a Vim script. How do I specify the carriage return\n    character?\n\nYou can use the `:execute` command to specify the special (control)\ncharacter in a normal mode command:\n\n :execute \"normal \\<CR>\"\n :execute \"normal ixxx\\<Esc>\"\n\nFor more information, read:\n\nB<:help :execute>\n\nB<:help expr-quote>\n\n\n\n=head2 25.25. How do I split long lines in a Vim script?\n\nYou can split long lines in a Vim script by inserting the backslash\ncharacter (\"\\\") at the start of the next line. For example,\n\n set comments=sr:/*,mb:*,el:*/,\n             \\://,\n             \\b:#,\n             \\:%,\n             \\n:>,\n             \\fb:-\n\nFor more information, read:\n\nB<:help line-continuation>\n\n\n\n=head2 25.26. When I try to \"execute\" my function using the `:execute Myfunc()`\n    command, the cursor is moved to the top of the current buffer.\n    Why?\n\nThe `:execute` command runs the ex command specified by the argument.\nIn the case of the following command:\n\n :execute Myfunc()\n\nThe call to Myfunc() will return 0. The `:execute` command will run\nthe ex command `:0`, which moves the cursor to the top of the file.\nTo call a Vim function, you should use the `:call` command instead of the\n`:execute` command:\n\n :call Myfunc()\n\nFor more information, read:\n\nB<:help :call>\n\nB<:help :execute>\n\nB<:help :echo>\n\nB<:help user-functions>\n\nB<:help 41.5>\n\nB<:help 41.6>\n\nB<:help cmdline-lines>\n\n\n\n=head2 25.27. How do I source/execute the contents of a register?\n\nIf you have yanked a set of Vim commands into a Vim register (for example\nregister \"a\"), then you can source the contents of the register using one\nof the following commands:\n\n :@a\nor\n :exe @a\n\nFor more information, read:\n\nB<:help :@>\n\n\n\n=head2 25.28. After calling a Vim function or a mapping, when I press the \"u\"\n    key to undo the last change, Vim undoes all the changes made by\n    the mapping/function. Why?\n\nWhen you call a function or a mapping, all the operations performed by the\nfunction/mapping are treated as one single operation. When you undo the\nlast operation by pressing \"u\", all the changes made by the\nfunction/mapping are reversed.\n\nFor more information, read:\n\nB<:help undo-redo>\n\nB<:help :map-undo>\n\n\n\n=head2 25.29. How can I call a function defined with s: (script local function)\n    from another script/plugin?\n\nThe s: prefix for a Vim function name is used to create a script local\nfunction. A script local function can be called only from within that\nscript and cannot be called from other scripts. To define a function in a\nscript/plugin, so that it can be called from other plugins/scripts, define\nthe function without the s: prefix.\n\nFor more information, read:\n\nB<:help script-variable>\n\nB<:help script-local>\n\nB<:help :scriptnames>\n\n\n\n=head2 25.30. Is it possible to un-source a sourced script? In other words, reverse\n    all the commands executed by sourcing a script.\n\nNo. It is not possible to reverse or undo all the commands executed by\nsourcing a script.\n\nFor more information, read:\n\nB<:help :source>\n\n\n\n\n=head1 PLUGINS\n\n\n\n=head2 26.1. How do I set different options for different types of files?\n\nYou can create filetype plugins to set different options for different\ntypes of files. You should first enable filetype plugins using the command:\n\n :filetype plugin on\n\nA filetype plugin is a vim script that is loaded whenever Vim opens or\ncreates a file of that type.  For example, to ensure that the 'textwidth'\noption is set to 80 when editing a C program (filetype \"c\"), create one of\nthe following files:\n\n     ~/.vim/ftplugin/c.vim (Unix)\n     %HOME%\\vimfiles\\ftplugin\\c.vim (Windows)\n\nwith the following text in it:\n\n     setlocal textwidth=80\n\nYou can also use autocommands to set specific options when editing specific\ntype of files. For example, to set the 'textwidth' option to 75 for only\n*.txt files, you can use the following autocmd:\n\n autocmd BufRead *.txt setlocal textwidth=80\n\nFor more information, read:\n\nB<:help filetype-plugin>\n\nB<:help add-filetype-plugin>\n\nB<:help :autocmd>\n\nB<:help 40.3>\n\n\n\n=head2 26.2. I have downloaded a Vim plugin or a syntax file or a indent file, or\n   a color scheme or a filetype plugin from the web. Where should I copy\n   these files so that Vim will find them?\n\nYou can place the Vim runtime files (plugins, syntax files, indent files,\ncolor schemes, filetype plugins, etc) under one of the directories\nspecified in the 'runtimepath' option. To determine the current value of\nthe 'runtimepath' option, use the following command:\n\n :set runtimepath\n\nFor Unix systems, this is usually the \"$HOME/.vim\" directory. For MS-Windows\nsystems, this is usually the $VIM\\vimfiles or $HOME\\vimfiles directory.\nDepending on the type of the runtime file, you have to place it under a\nspecific directory under the above runtime directory. The names of the\ndirectories are listed below:\n\n name        description\n ----------  ------------------\n colors/     color scheme files\n compiler/   compiler files\n doc/        documentation\n ftplugin/   filetype plugins\n indent/     indent scripts\n keymap/     key mapping files\n lang/       menu translations\n plugin/     plugin scripts\n syntax/     syntax files\n tutor/      files for vimtutor\n\nFor more information, read:\n\nB<:help your-runtime-dir>\n\nB<:help 'runtimepath'>\n\nB<:help :runtime>\n\n\n\n=head2 26.3. How do I extend an existing filetype plugin?\n\nYou can extend an existing filetype plugin by creating a file in the\nafter/ directory in any of the 'runtimepath' directories.\n\n\n- for small changes to be done after (and in addition to) what is\n  already done by the ftplugin installed with Vim, use an after-directory,\n  as follows (replacing foobar by the 'filetype' of the concerned\n  files):\n - For changes private to one user:\n     - on Windows:\n         $HOME/vimfiles/after/ftplugin/foobar.vim\n     - on Unix-like OSes:\n         $HOME/.vim/after/ftplugin/foobar.vim\n - For changes affecting all users on the system:\n     $VIM/vimfiles/after/ftplugin/foobar.vim\n\n- when replacing the whole filetype-plugin by a different version, or\n  when installing a new ftplugin for some filetype not yet supported by\n  Vim out of the box: use the same paths without the after/ in them. In\n  that case you should place near the start of your plugin an \"if...\n  finish... endif... let\" block like the one in the plugins distributed\n  with Vim.\n\nAll the above paths are given in Vim terminology (which is similar to\nUnix terminology, but is understood even by Vim for Windows); they don't\nexist by default, so the first time you need them you will have to\ncreate them using mkdir (on any OS including DOS/Windows) or md (on\nDOS/Windows only). $VIM and, on DOS/Windows, $HOME, do not necessarily\nexist outside Vim. If $HOME has no value (or no valid value) inside Vim,\nyou can use $VIM instead; but on any but possibly very old versions of\nWindows, $HOMEDRIVE and $HOMEPATH are defined by the system, and if\n$HOME is undefined at Vim startup, Vim will set it by expanding\n$HOMEDRIVE$HOMEPATH before sourcing your vimrc. To know which values Vim\nuses, you can type (in a running Vim):\n\n :echo $VIM\n :echo $HOME\n\n\nIf you placed the file in the after/ftplugin runtime directory, then Vim\nwill first source the existing filetype plugin file and then will source\nthe new file.  If you placed the file in the $VIMRTUNTIME/ftplugin runtime\ndirectory, then Vim will first source the new file and then will source the\nexisting filetype plugin file.\n\nFor more information, read:\n\nB<:help ftplugin-overrule>\n\nB<:help filetype-plugin>\n\nB<:help add-filetype-plugin>\n\nB<:help 'runtimepath'>\n\n\n\n=head2 26.4. How do I turn off loading the Vim plugins?\n\nYou can reset the 'loadplugins' option to turn off loading the plugins:\n\n :set noloadplugins\n\nYou can also specify the \"--noplugin\" command line argument to stop loading\nthe plugins:\n\n $ vim --noplugin\n\nFor more information, read:\n\nB<:help 'loadplugins'>\n\nB<:help --noplugin>\n\nB<:help load-plugins>\n\n\n\n=head2 26.5. How do I turn on/off loading the filetype plugins?\n\nBy default, Vim will not load the filetype plugins. You can configure Vim\nto load filetype plugins using the command:\n\n filetype plugin on\n\nYou can turn off loading the filetype plugins using:\n\n filetype plugin off\n\nFor more information, read:\n\nB<:help :filetype-plugin-on>\n\nB<:help :filetype-plugin-off>\n\nB<:help :filetype>\n\n\n\n=head2 26.6. How do I override settings made in a file type plugin in the global\n   ftplugin directory for all the file types?\n\nYou can use an autocommand triggered on the FileType event:\n\n au Filetype * set formatoptions=xyz\n\nThis should at least be after \"filetype on\" in your vimrc. Best is to put\nit in your \"myfiletypefile\" file, so that it's always last.\n\nIf you want to override a setting for a particular filetype, then create a\nfile with the same name as the original filetype plugin in the\n~/.vim/after/ftplugin directory For example, to override a setting in the\nc.vim filetype plugin, create a c.vim file in the ~/.vim/after/ftplugin\ndirectory and add your preferences in this file.\n\nFor more information, read:\n\nB<:help ftplugin-overrule>\n\nB<:help ftplugins>\n\nB<:help myfiletypefile>\n\n\n\n=head2 26.7. How do I disable the Vim directory browser plugin?\n\nTo disable the directory browsing Vim plugin, add the following line to\nyour .vimrc file:\n\n let g:loaded_netrw = 1\n\nFor more information, read:\n\nB<:help netrw>\n\n\n\n=head2 26.8. How do I set the filetype option for files with names matching a\n   particular pattern or depending on the file extension?\n\nYou can set the 'filetype' option for files with names matching a\nparticular pattern using an autocmd. For example, to set the 'filetype'\noption to \"c\" for all files with extension \".x\", you can use the following\nautocmd:\n\n autocmd! BufRead,BufNewFile *.x     setfiletype c\n\nA better alternative to the above approach is to create a filetype.vim file\nin the ~/.vim directory (or in one of the directories specified in the\n'runtimepath' option) and add the following lines:\n\n \" my filetype file\n if exists(\"did_load_filetypes\")\n     finish\n endif\n augroup filetypedetect\n     au! BufRead,BufNewFile *.x       setfiletype c\n augroup END\n\nFor more information, read:\n\nB<:help new-filetype>\n\nB<:help 43.2>\n\nB<:help :setfiletype>\n\n\n\n\n=head1 EDITING PROGRAM FILES\n\n\n\n=head2 27.1. How do I enable automatic indentation for C/C++ files?\n\nYou can enable file-type based indentation using:\n\n :filetype indent on\n\nIf you want to only enable automatic C indentation, then use:\n\n :set cindent\n\nFor more information, read:\n\nB<:help 'cindent'>\n\nB<:help C-indenting>\n\nB<:help filetype>\n\n\n\n=head2 27.2. How do I configure the indentation used for C/C++ files?\n\nYou can configure the Vim C indentation by modifying the value of the\n'cinoptions', 'cinkeys' and 'cinwords' options.\n\nFor more information, read:\n\nB<:help 'cindent'>\n\nB<:help 'cinoptions'>\n\nB<:help 'cinkeys'>\n\nB<:help 'cinwords'>\n\nB<:help C-indenting>\n\nB<:help cinoptions-values>\n\nB<:help 'smartindent'>\n\n\n\n=head2 27.3. How do I turn off the automatic indentation feature?\n\nBy default, the automatic indentation is not turned on. You must have\nconfigured Vim to do automatic indentation in either .vimrc or .gvimrc\nfiles. You can disable automatic indentation using either,\n\n :filetype indent off\n\nor\n\n :set nocindent\n\nAlso, check the setting for the following options:\n\n :set autoindent?\n :set smartindent?\n :set indentexpr?\n\nFor more information, read:\n\nB<:help 'cindent'>\n\nB<:help :filetype-indent-off>\n\nB<:help 'autoindent'>\n\nB<:help 'smartindent'>\n\nB<:help 'indentexpr'>\n\n\n\n=head2 27.4. How do I change the number of space characters used for the automatic\n   indentation?\n\nYou can modify the 'shiftwidth' option to change the number of space\ncharacters used for the automatic indentation:\n\n :set shiftwidth=4\n\nFor more information, read:\n\nB<:help 'shiftwidth'>\n\n\n\n=head2 27.5. I am editing a C program using Vim. How do I display the definition\n   of a macro or a variable?\n\nYou can use the \"[d\" command to display the definition of a macro, \"[i\"\ncommand to display the definition of a variable, \"gd\" to goto the local\ndeclaration of a variable and \"gD\" to go to the global Declaration.\n\nFor more information, read:\n\nB<:help [d>\n\nB<:help [i>\n\nB<:help gd>\n\nB<:help gD>\n\nB<:help include-search>\n\nB<:help 29.4>\n\nB<:help 29.5>\n\n\n\n=head2 27.6. I am editing a C program using Vim. How do I jump to the beginning or\n   end of a code block from within the block?\n\nYou can use \"[{\" command to jump to the beginning of the code block and \"]}\"\nto jump to the end of the code block from inside the block.\n\nFor more information, read:\n\nB<:help [{>\n\nB<:help ]}>\n\nB<:help various-motions>\n\n\n\n=head2 27.7. When editing C++ files and when inserting new lines above or below a\n   comment (//) line, Vim automatically inserts the C++ comment\n   character (//) at the beginning of the line. How do I disable this?\n\nThis automatic insertion of the comment leader (//) when new lines\nare added is controlled by three flags in the 'formatoptions'\noption:  \"c\", \"r\" and \"o\".  \"c\" enables auto-wrapping of comment\nlines when typing extends beyond the right margin.  \"r\" enables the\nautomatic insertion of the comment leader when <Enter> is pressed\nwhile editing a comment line.  \"o\" enables the automatic insertion\nof the comment leader when a new line is opened above or below an\nexisting comment line by typing O or o in Normal mode.\n\nYou can stop Vim from automatically inserting the comment leader\nwhen typing <Enter> within a comment or when opening a new line by\nremoving the \"r\" and \"o\" flags from 'formatoptions'.\n\n   :set formatoptions-=r\n   :set formatoptions-=o\n\nThe default filetype plugin for C and C++ files\n($VIMRUNTIME/ftplugin/c.vim) adds the \"r\" and \"o\" flags to the\n'formatoptions' option.  If you want to override this for C++ files,\nthen you can add the above lines to the\n~/.vim/after/ftplugin/cpp.vim file.\n\nFor more information, read:\n\nB<:help 'formatoptions'>\n\nB<:help 30.6>\n\nB<:help format-comments>\n\nB<:help filetype-plugins>\n\nB<:help ftplugin-overrule>\n\n\n\n=head2 27.8. How do I add the comment character \"#\" to a set of lines at the\n   beginning of each line?\n\nFirst, select the first character in all the lines using visual block mode\n(CTRL-V). Press \"I\" to start inserting characters at the beginning of the\nline. Enter the comment character and then stop the insert mode by pressing\n<Esc>. Vim will automatically insert the entered characters at the\nbeginning of all the selected lines.\n\nFor more information, read:\n\nB<:help visual-block>\n\nB<:help blockwise-operators>\n\nB<:help v_b_I>\n\n\n\n=head2 27.9. How do I edit a header file with the same name as the corresponding C\n   source file?\n\nYou can use the following command to edit a header file with the same name\nas the corresponding C source file:\n\n :e %:t:r.h\n\nYou can use the following command to edit the file in a new split window:\n\n :sp %:t:r.h\n\nIn the above commands, the percent sign expands to the name of the current\nfile.  The `:t` modifier extracts the tail (last component) of the\nfilename. The `:r` modifier extracts the root of the filename.  The .h is\nappended to the resulting name to get the header filename.\n\nAnother approach is to use the following command:\n\n :sfind %:t:r.h\n\nThis command will search for the header file in the directories specified\nin the 'path' option.\n\nFor more information, read:\n\nB<:help cmdline-special>\n\nB<:help filename-modifiers>\n\nB<:help :sfind>\n\nB<:help 'path'>\n\n\n\n=head2 27.10. How do I automatically insert comment leaders while typing comments?\n\nTo automatically insert comment leaders while typing comments, add the \"r\"\nand \"o\" flags to the 'formatoptions' option.\n\n :set formatoptions+=ro\n\nYou may also want to add the \"c\" flag to auto-wrap comments using the\n'textwidth' option setting and the \"q\" flag to format comments with the\n\"gq\" command:\n\n :set formatoptions=croq\n\nFor more information, read:\n\nB<:help 30.6>\n\nB<:help format-comments>\n\nB<:help 'comments'>\n\nB<:help fo-table>\n\n\n\n\n=head1 QUICKFIX\n\n\n\n=head2 28.1. How do I build programs from Vim?\n\nYou can use the `:make` command to build programs from Vim. The `:make`\ncommand runs the program specified by the 'makeprg' option.\n\nFor more information, read:\n\nB<:help 30.1>\n\nB<:help :make_makeprg>\n\nB<:help 'makeprg'>\n\nB<:help 'makeef'>\n\nB<:help :make>\n\nB<:help quickfix>\n\n\n\n=head2 28.2. When I run the make command in Vim I get the errors listed as the\n   compiler compiles the program. When it finishes this list disappears\n   and I have to use the `:clist` command to see the error message again.\n   Is there any other way to see these error messages?\n\nYou can use the `:copen` or `:cwindow` command to open the quickfix window\nthat contains the compiler output. You can select different error lines\nfrom this window and jump to the corresponding line in the source code.\n\nFor more information, read:\n\nB<:help :copen>\n\nB<:help :cwindow>\n\nB<:help quickfix>\n\n\n\n=head2 28.3. How can I perform a command for each item in the quickfix/location\n   list?\n\nStarting from Vim 7.4.858 Vim provides the new commands `:cfdo`, `:cdo`,\n`:lfdo` and `:ldo.` They work by iterating over all items in the quickfix\nlist and performing a command on each. The difference is, that the `:lfdo`\nand `:ldo` commands iterate over the location list entries, while the\n`:cfdo` and `:cdo` commands operate on the items in the quickfix list. Also,\nthe `:cfdo` and `:lfdo` operate on all different files, while the `:cdo` and\n`:ldo` commands operate on each item in the quickfix/location list.\n\nFor example you could vimgrep all C files in the current directory for a\nsearch string \"Foobar\":\n\n :vimgrep /Foobar/ *.c\n\nand as this populates your quickfix list, you could simply replace all\noccurences by using:\n\n :cdo :%s/Foobar/Foobaz | upd\n\nFor more information, read:\n\nB<:help :cfdo>\n\nB<:help :cdo>\n\n\n\n\n=head1 FOLDING\n\n\n\n=head2 29.1. How do I extend the Vim folding support?\n\nYou can use the 'foldexpr' option to fold using a user specified function.\nFor example, to fold subroutines of the following form into a single line:\n\n sub foo {\n   my $barf;\n   $barf = 3;\n   return $barf;\n }\n\nYou can use the following commands:\n\n set foldmethod=expr\n set foldexpr=MyFoldExpr(v:lnum)\n fun! MyFoldExpr(line)\n     let str = getline(a:line)\n     if str =~ '^sub\\>'\n         return '1'\n     elseif str =~ '^}'\n         return '<1'\n     else\n         return foldlevel(a:line - 1)\n     endif\n endfun\n\nFor more information, read:\n\nB<:help 'foldexpr'>\n\nB<:help fold-expr>\n\n\n\n=head2 29.2. When I enable folding by setting the 'foldmethod' option, all the\n   folds are closed. How do I prevent this?\n\nYou can set the 'foldlevelstart' option to a particular value to close only\nfolds above the specified value.\n\n :set foldlevelstart=99\n\nFor more information, read:\n\nB<:help 'foldlevelstart'>\n\nB<:help 'foldlevel'>\n\nB<:help fold-foldlevel>\n\n\n\n=head2 29.3. How do I control how many folds will be opened when I start editing a\n   file?\n\nYou can modify the 'foldlevelstart' option to control the number of folds\nthat will be opened when you start editing a file. To start editing with\nall the folds closed:\n\n :set foldlevelstart=0\n\nTo start editing with all the folds opened, you can use\n\n :set foldlevelstart=999\n\nFor more information, read:\n\nB<:help 'foldlevelstart'>\n\n\n\n=head2 29.4. How do I open and close folds using the mouse?\n\nYou can click on the + and - characters displayed at the leftmost column to\nopen and close fold. For this to work, you have to set the 'foldcolumn'\nto a value greater than zero:\n\n :set foldcolumn=2\n\nFor more information, read:\n\nB<:help 'foldcolumn'>\n\n\n\n=head2 29.5. How do I change the text displayed for a closed fold?\n\nYou can use the 'foldtext' option to change the text displayed for a closed\nfold.\n\nFor more information, read:\n\nB<:help 'foldtext'>\n\nB<:help fold-foldtext>\n\nB<:help 'fillchars'>\n\n\n\n=head2 29.6. How do I store and restore manually created folds across different\n   Vim invocations?\n\nYou can use the `:mkview` command to store manually created folds. Later,\nyou can use the `:loadview` command to restore the folds. For this to work,\nthe 'viewoptions' must contain \"folds\".\n\nFor more information, read:\n\nB<:help 28.4>\n\nB<:help :mkview>\n\nB<:help :loadview>\n\nB<:help 'viewoptions'>\n\nB<:help 'viewdir'>\n\nB<:help :mksession>\n\nB<:help 'sessionoptions'>\n\n\n\n=head2 29.7. I have enabled syntax based folding. Why is Vim so slow?\n\nSyntax based folding is currently rather slow in Vim and will possibly\nslow down Vim considerably. There is an issue in the todo list to fix\nthis, but the todo list is rather long and it may take a while until\nthis will be fixed.\n\nYou can find the issue in the todo list, if you read\n\nB<:help todo.txt>\n\n\nfollowed by a search for \"folding with 'foldmethod'\"\n\nA workaround is to temporarily set the foldmethod to manual while in\ninsert mode. This is described in the wiki at:\n\n http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text\n\n\n\n=head1 VIM WITH EXTERNAL APPLICATIONS\n\n\n\n=head2 30.1. Can I run a shell inside a Vim window?\n\nSince Version 8.1 Vim comes with a terminal window included. It allows\nto run a shell inside an ordinary Vim window (e.g. split) asynchronously\nand interact with the shell using the normal Vim commands.\n\nWhen the focus is in the terminal window, typed keys will be sent to\nthe job and is called terminal mode. You can click outside of the\nterminal window to move keyboard focus elsewhere, alternatively one can\nuse CTRL-W to novigate between different Vim windows. To feed CTRL-W into the\nterminal, one needs to use CTRL-W .\n\nTo map keys specifically for terminal mode, use the new `:tmap`\ncommand. After typing CTRL-W the terminal window will switch to\nTerminal-Normal mode (this can be used to move the cursor around, scroll\nthe window, etc. Just like normal mode).\n\nTo interact between the terminal and Vim, Vim implements several\ninterfaces using term_sendkeys(), terminal-api and the client-server\nmechanism.\n\nFor more information, read:\n\nB<:help terminal>\n\nB<:help mapmode-t>\n\nB<:help Terminal-Normal>\n\nB<:help terminal-communication>\n\n\n\n=head2 30.2. How do I pass the word under the cursor to an external command?\n\nYou can use the special keyword <cword> to pass the word under the cursor\nto an external command. For example:\n\n :!dict <cword>\n\nFor more information, read:\n\nB<:help :<cword>>\n\n\n\n=head2 30.3. How do I get the output of a shell command into a Vim buffer?\n\nYou can use the `:r !` command to get the output of a shell command into a\nVim buffer. For example, to insert the output of the \"ls\" shell command,\nyou can use the following command:\n\n :r !ls\n\nTo insert the output of the shell command above the first line use the\nfollowing command:\n\n :0r !ls\n\nFor more information, read:\n\nB<:help :r!>\n\n\n\n=head2 30.4. How do I pipe the contents of the current buffer to an external\n   command and replace the contents of the buffer with the output from\n   the command?\n\nYou can use the :! command to pipe the contents of the current buffer to an\nexternal command and replace the contents of the buffer with the output\nfrom the command. For example, to sort the contents of the current buffer,\nusing the Unix sort command, you can use the following command:\n\n :%!sort\n\nTo sort only lines 10-20, you can use the following command\n\n :10,20!sort\n\nAlso, if you want to pipe a buffer to an external command but not put the\nresults back in the buffer, you can use\n\n :w !sort\n\nThe above command will pipe the entire buffer to the sort command.  Note,\nthat the space between the \"w\" and the \"!\" is critical.  To pipe only a\nrange of lines, you can use\n\n :10,20w !sort\n\nThe above command will pipe the lines 10-20 to the sort command.\n\nFor more information, read:\n\nB<:help :range!>\n\nB<:help 10.9>\n\nB<:help :w_c>\n\n\n\n=head2 30.5. How do I sort a section of my file?\n\nYou use the `:sort` command like this:\n\n   :5,100sort\n\nUsing the `:sort` command provides many options, you can sort numerical on\nthe first found decimal number using:\n\n   :%sort n\n\nOr you can specify to sort on the text, starting at virtual column 8:\n\n   :%sort /.*\\%8v/\n\nAlternatively can pipe a section of the file to the Unix \"sort\" utility to\nsort the file. For example:\n\n :5,100!sort\n\nYou can also use a visual block, and use the \"!sort\" command on the\nselected block.\n\nSee also:\nB<:help :sort>\n\nB<:help filter>\n\n\n\n=head2 30.6. How do I use Vim as a pager?\n\nYou can use Vim as a pager using the $VIMRUNTIME/macros/less.sh shell\nscript, supplied as part of the standard Vim distribution. This shell\nscript uses the $VIMRUNTIME/macros/less.vim Vim script to provide less like\nkey bindings.\n\nFor more information, read:\n\nB<:help less>\n\n\n\n=head2 30.7. How do I view Unix man pages from inside Vim?\n\nYou can view Unix man pages, inside Vim, using the man.vim plugin supplied\nas part of the standard Vim distribution. To use this plugin, add the\nfollowing line to your startup vimrc file:\n\n runtime ftplugin/man.vim\n\nYou can also press the K key to run the program specified by the\n'keywordprg' option with the keyword under the cursor. By default,\n'keywordprg' is set to run man on the keyword under the cursor.\n\nFor more information, read:\n\nB<:help ft-man-plugin>\n\nB<:help K>\n\nB<:help 'keywordprg'>\n\n\n\n=head2 30.8. How do I change the diff command used by the Vim diff support?\n\nBy default, the Vim diff support uses the 'diff' command. You can change\nthis by changing the 'diffexpr' option.\n\nFor more information, read:\n\nB<:help diff-diffexpr>\n\nB<:help 'diffexpr'>\n\n\n\n=head2 30.9. How do I use the Vim diff mode without folding?\n\nYou can use the following command-line to start Vim with two filenames\nand use the diff mode without folding:\n\n $ vim -o file1 file2 \"+windo set diff scrollbind scrollopt+=hor nowrap\"\n\nIf you like vertically split windows, then replace \"-o\" with \"-O\".\n\nFor more information, read:\n\nB<:help vimdiff>\n\n\n\n\n=head1 GUI VIM\n\n\n\n=head2 31.1. How do I create buffer specific menus?\n\nAdding support for buffer specific menus is in the Vim TODO list. In the\nmean time, you can try Michael Geddes's plugin, buffermenu.vim:\n\n https://www.vim.org/scripts/script.php?script_id=246\n\n\n=head2 31.2. How do I change the font used by GUI Vim?\n\nYou can change the 'guifont' option to change the font used by GUI Vim.  To\ndisplay the current value of this option, you can use\n\n :set guifont?\n\nYou can add the displayed font name to the .vimrc file to use the font\nacross Vim sessions. For example, add the following line to the .vimrc file\nto use Andale Mono font.\n\n set guifont=Andale_Mono:h10:cANSI\n\nFor Win32, GTK and Photon version of Vim, you can use the following command\nto bringup a dialog which will help you in changing the guifont:\n\n :set guifont=*\n\nYou can also use the -font Vim command line option to specify the font used\nfor normal text.\n\nFor more information, read:\n\nB<:help 'guifont'>\n\nB<:help 'guifontset'>\n\nB<:help 'guifontwide'>\n\nB<:help font-sizes>\n\nB<:help -font>\n\nB<:help -boldfont>\n\nB<:help -italicfont>\n\nB<:help -menufont>\n\nB<:help -menufontset>\n\n\n\n=head2 31.3. When starting GUI Vim, how do I specify the location of the GVIM\n   window?\n\nYou can use the \"-geometry\" command line argument to specify the location\nof the GUI Vim window. For example:\n\n $ gvim -geometry 80x25+100+300\n\nFor more information, read:\n\nB<:help 31.4>\n\nB<:help -geom>\n\n\n\n=head2 31.4. How do I add a horizontal scrollbar in GVim?\n\nYou can enable the horizontal scrollbar by modifying the 'guioptions'\noption:\n\n :set guioptions+=b\n\nFor more information, read:\n\nB<:help 'guioptions'>\n\nB<:help gui-horiz-scroll>\n\n\n\n=head2 31.5. How do I make the scrollbar appear in the left side by default?\n\nYou can add the \"l\" flag to the 'guioptions' option to make the scrollbar\nappear in the left side.\n\n :set guioptions+=l\n :set guioptions-=r\n\nFor more information, read:\n\nB<:help 'guioptions'>\n\nB<:help gui-scrollbars>\n\n\n\n=head2 31.6. How do I remove the Vim menubar?\n\nYou can remove the Vim menubar by removing the \"m\" flag from the\n'guioptions' option:\n\n :set guioptions-=m\n\nFor more information, read:\n\nB<:help 'guioptions'>\n\n\n\n=head2 31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the menu\n   starting with that letter is selected. I don't want this behavior as\n   I want to map the <Alt>-<key> combination. How do I do this?\n\nYou can use the 'winaltkeys' option to disable the use of the <Alt> key to\nselect a menu item:\n\n :set winaltkeys=no\n\nFor more information, read:\n\nB<:help 'winaltkeys'>\n\nB<:help :simalt>\n\n\n\n=head2 31.8. Is it possible to scroll the text by dragging the scrollbar so that\n   the cursor stays in the original location?\n\nThe way Vim is designed, the cursor position has to be in a visible spot in\nnormal, visual, select and insert mode. This cannot be changed without\nmodifying Vim. When the scrollbar is used, the cursor will be moved so that\nit is always visible. Another approach to solving this problem is to use\nthe Vim marks. You can mark the current cursor position using ma. Then\nscroll to a different part of the text and jump back to the old position\nusing `a. You can also try the following suggestion from the Vim Online\nwebsite:\n\n http://vim.wikia.com/wiki/VimTip320\n\nFor more information, read:\n\nB<:help mark-motions>\n\n\n\n=head2 31.9. How do I get gvim to start browsing files in a particular directory\n   when using the `:browse` command?\n\nYou can set the 'browsedir' option to the default directory to use for the\n`:browse` command.\n\n :set browsedir='<your_dir>'\n\nFor more information, read:\n\nB<:help 'browsedir'>\n\n\n\n=head2 31.10. For some questions, like when a file is changed outside of Vim, Vim\n    displays a GUI dialog box. How do I replace this GUI dialog box with\n    a console dialog box?\n\nYou can set the \"c\" flag in the 'guioptions' option to configure Vim to use\nconsole dialogs instead of GUI dialogs:\n\n :set guioptions+=c\n\nFor more information, read:\n\nB<:help 'guioptions'>\n\n\n\n=head2 31.11. I am trying to use GUI Vim as the editor for my xxx application.\n    When the xxx application launches GUI Vim to edit a file, the\n    control immediately returns to the xxx application. How do I start\n    GUI Vim, so that the control returns to the xxx application only\n    after I quit Vim?\n\nYou have to start GUI Vim with the \"-f\" (foreground) command line option:\n\n $ gvim -f\n\nBy default, GUI Vim will disconnect from the program that started Vim. With\nthe '-f' option, GUI Vim will not disconnect from the program that started\nit.\n\nFor more information, read:\n\nB<:help gui-fork>\n\nB<:help -f>\n\n\n\n=head2 31.12. Why does the \"Select Font\" dialog doesn't show all the fonts\n    installed in my system?\n\nVim supports only fixed width (mono-spaced) fonts. Proportional fonts are\nnot supported.  In the \"Select Font\" dialog, only fixed width fonts will be\ndisplayed.\n\nFor more information, read:\n\nB<:help font-sizes>\n\nB<:help 'guifont'>\n\n\n\n=head2 31.13. How do I use the mouse in Vim command-line mode?\n\nYou can set the \"c\" flag in the 'mouse' option to use mouse in the Vim\ncommand-line mode:\n\n :set mouse+=c\n\nFor more information, read:\n\nB<:help mouse-using>\n\nB<:help gui-mouse>\n\nB<:help 09.2>\n\n\n\n=head2 31.14. When I use the middle mouse button to scroll text, it pastes the\n    last copied text. How do I disable this behavior?\n\nYou can map the middle mouse button to <Nop> to disable the middle mouse\nbutton:\n\n :map  <MiddleMouse> <Nop>\n :map! <MiddleMouse> <Nop>\n\nFor more information, read:\n\nB<:help gui-mouse-mapping>\n\nB<:help <Nop>>\n\n\n\n=head2 31.15. How do I change the location and size of a GUI Vim window?\n\nYou can use the `:winpos` command to change the Vim window position. To\nchange the size of the window, you can modify the 'lines' and 'columns'\noptions.\n\nFor example, the following commands will position the GUI Vim window at the\nX,Y co-ordinates 50,50 and set the number of lines to 50 and the number of\ncolumns to 80.\n\n :winpos 50 50\n :set lines=50\n :set columns=80\n\nThe arguments to the `:winpos` command specify the pixel co-ordinates of the\nVim window. The 'lines' and 'columns' options specify the number of lines\nand characters to use for the height and the width of the window\nrespectively.\n\nFor more information, read:\n\nB<:help 31.4>\n\nB<:help :winpos>\n\nB<:help 'lines'>\n\nB<:help 'columns'>\n\nB<:help GUIEnter>\n\n\n\n=head2 31.16. When splitting the Vim window vertically, Vim changes the position.\n\nThis is a known problem. When you are splitting the Vim window, Vim will\ntry to draw a scrollbar. Since this changes the gui window, Vim tries to\nresize its main window to keep the same position and this will cause Vim\nto move its position. This happens on Windows with a multi-window setup or\na window that was \"snapped\" to a certain position.\n\nA workaournd to this problem is, to remove gui scrollbars, e.g.\n\n :set guioptions-=L\n\n\n\n=head1 VIM ON UNIX\n\n\n\n=head2 32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim\n   freezes. What should I do now?\n\nMany terminal emulators and real terminal drivers use the CTRL-S key to\nstop the data from arriving so that you can stop a fast scrolling display\nto look at it (also allowed older terminals to slow down the computer so\nthat it did not get buffer overflows).  You can start the output again by\npressing the CTRL-Q key.\n\nWhen you press the CTRL-S key, the terminal driver will stop sending the\noutput data. As a result of this, it will look like Vim is hung. If you\npress the CTRL-Q key, then everything will be back to normal.\n\nYou can turn off the terminal driver flow control using the \"stty\" command:\n\n $ stty -ixon -ixoff\n\nor, you can change the keys used for the terminal flow control, using the\nfollowing commands:\n\n $ stty stop <char>\n $ stty start <char>\n\n\n=head2 32.2. I am seeing weird screen update problems in Vim. What can I do to\n   solve this screen/display update problems?\n\nYou have to use a proper terminal emulator like xterm with correct TERM\nsettings (TERM=xterm) and a correct terminfo/termcap file.\nFor more information, read:\n\nB<:help 'term'>\n\n\n\n=head2 32.3. I am using the terminal/console version of Vim. In insertmode, When I\n   press the backspace key, the character before the cursor is not\n   erased. How do I configure Vim to do this?\n\nYou have to make sure that Vim gets the correct keycode for the backpspace\nkey. You can try using the command:\n\n :fixdel\n\nMake sure the TERM environment variable is set to the correct terminal\nname. You can try using the \"stty\" command:\n\n $ stty erase ^H\n\nwhere, you have to enter the ^H character by pressing the CTRL-V key and\nthen the CTRL-H key. Also check the value of your 'backspace' setting.\n\nFor more information, read:\n\nB<:help :fixdel>\n\nB<:help Linux-backspace>\n\nB<:help NetBSD-backspace>\n\nB<:help 'backspace'>\n\n\n\n=head2 32.4. I am using Vim in a xterm. When I quit Vim, the screen contents are\n   restored back to the original contents. How do I disable this?\n\nThe xterm has a capability called \"alternate screen\".  If this capability\nis present, vim switches to that alternate screen upon startup and back on\nexit, thus restoring the original screen contents.  To disable this\nfeature, add the following line to your .vimrc file:\n\n :set t_ti= t_te=\n\nFor more information, read:\n\nB<:help 'restorescreen'>\n\nB<:help xterm-screens>\n\n\n\n=head2 32.5. When I start Vim, it takes quite a few seconds to start. How do I\n   minimize the startup time?\n\nThis may be related to Vim opening the X display for setting the xterm\ntitle and using the X clipboard. Make sure the DISPLAY variable is set to\npoint to the correct host. Try using the command line:\n\n $ vim -X\n\nThis will prevent Vim from opening the X display. With this command-line\noption, the X clipboard cannot be used and also Vim will not be able to\nchange the xterm title.\n\nYou can also set the 'clipboard' option to\n\n :set clipboard=exclude:.*\n\nThis has the same effect as using the -X command-line argument.\n\nFor more information, read:\n\nB<:help -X>\n\nB<:help 'clipboard'>\n\n\nIf the clipboard is not the cause of the slow startup, it might be a\nplugin that slows down Vim. In that case, you can use the --startuptime\nargument to debug this further. You can do:\n\n $ vim --startuptime vim_startup.log\n\nand the timing will be written to the file vim_startup.log. For even\nmore advanced profiling, you can use the profiling feature, that is\navailable in huge builds of Vim. To do so, call Vim like this:\n\n $ vim --cmd 'profile start profile.log' \\\n   --cmd 'profile func *' \\\n   --cmd 'profile file *' \\\n   -c 'profdel func *' \\\n   -c 'profdel file *' \\\n   -c 'qa!'\n\nAfter running this, you will have a file profile.log in your current\ndirectory. To further analyse this, open the file profile.log and run:\n\n \" Open profile.log file in vim first\n :let timings=[]\n :g/^SCRIPT/call add(timings, [getline('.')[len('SCRIPT  '):], matchstr(getline(line('.')+1), '^Sourced \\zs\\d\\+')]+map(getline(line('.')+2, line('.')+3), 'matchstr(v:val, ''\\d\\+\\.\\d\\+$'')'))\n :enew\n :call setline('.', ['count total (s)   self (s)  script']+map(copy(timings), 'printf(\"%5u %9s   %8s  %s\", v:val[1], v:val[2], v:val[3], v:val[0])'))\n\nFor more information, read:\n\nB<:help --startuptime>\n\nB<:help profiling>\n\n\n\n=head2 32.6. How can I make the cursor in gvim in unix stop blinking?\n\nYou can modify the 'guicursor' option, to stop the cursor from blinking.\nFor example:\n\n :set guicursor=a:blinkon0\n\nFor more information, read:\n\nB<:help 'guicursor'>\n\n\n\n=head2 32.7. How do I change the menu font on GTK Vim?\n\nYou can modify the ~/.gtkrc file to change the menu font on GTK Vim. For\nexample:\n\n style \"default\"\n { font =\"smooth09\" }\n class \"*\" style \"default\"\n\nThe last line changes the font of all widgets.\n\nFor more information, read:\n\nB<:help gui-gtk>\n\n\n\n=head2 32.8. How do I prevent CTRL-Z from suspending Vim?\n\nYou can map CTRL-Z to prevent the suspending. Here are some suggestions:\n\n- Make CTRL-Z do nothing:\n\n :map <C-Z> <Nop>\n\n- Make CTRL-Z start a shell:\n\n :map <C-Z> :shell<CR>\n\n- Make CTRL-Z give an error message:\n\n :map <C-Z> :\"suspending disabled<CR>\n\nFor the last example, the double quote is necessary in order to keep the\nmessage on the status line.\n\n\n=head2 32.9. When I kill the xterm running Vim, the Vim process continues to run\n   and takes up a lot of CPU (99%) time. Why is this happening?\n\nWhen Vim is built with support for Python interface, you will have this\nproblem. This is a known problem with the python thread library and Vim.  To\nsolve this problem, use a Vim binary built without the Python interface.\n\nFor more information, read:\n\nB<:help +python>\n\nB<:help python>\n\n\n\n=head2 32.10. How do I get the Vim syntax highlighting to work in a Unix terminal?\n\nThe easiest and simplest way to get Vim syntax highlighting is to use the\nGUI version of Vim (GVIM). To get syntax highlighting to work in the\nconsole/terminal version of Vim, you have to run a terminal emulator (like\nXfree86 xterm or rxvt or dtterm) that supports color. Note that if a\nterminal emulator supports changing the background and foreground colors,\nthat does not mean that it also supports ANSI escape sequences for changing\nthe color. You can download the latest version of Xfree86 xterm from\nhttps://invisible-island.net/xterm/xterm.html\nYou can download the latest version of rxvt from https://rxvt.org\nYou have to install the terminfo/termcap file that supports colors for the\nterminal emulator. Also, set the TERM environment variable to the correct\nname of the term that supports colors.\n\nYou can use the colortest.vim script supplied with the Vim runtime\npackage to test the color setup. To use this script, follow these steps:\n\n :e $VIMRUNTIME/syntax/colortest.vim\n :source %\n\nFor more information, read:\n\nB<:help 06.2>\n\nB<:help terminal-colors>\n\nB<:help termcap-colors>\n\nB<:help startup-terminal>\n\nB<:help xterm-color>\n\nB<:help colortest.vim>\n\n\n\n\n=head1 VIM ON MS-WINDOWS\n\n\n\n=head2 33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode. What\n   happened?\n\nThe mswin.vim script provides key mappings and options to make Vim behave\nlike a MS-Windows application. One of the keys mapped is CTRL-V which is\nused for pasting text in MS-Windows applications. This will disable the use\nof CTRL-V to start the blockwise visual mode. The mswin.vim script maps\nCTRL-Q for staring the blockwise visual mode. So you can use CTRL-Q instead\nof CTRL-V.\n\nFor more information, read:\n\nB<:help CTRL-V>\n\nB<:help CTRL-V-alternative>\n\nB<:help CTRL-Q>\n\nB<:help 10.5>\n\n\n\n=head2 33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do I\n   configure Vim to treat CTRL-Y as CTRL-Y?\n\nThe mapping of the CTRL-Y key to the CTRL-R key is done by the mswin.vim\nscript. The mswin.vim script maps CTRL-Y to make Vim behave like a standard\nMS-Windows application. This is explained in `:help CTRL-Y`. You can either\ncomment out the line in mswin.vim that maps the CTRL-Y key or you can\nremove the line in your .vimrc file that sources the mswin.vim script.\n\n\n=head2 33.3. How do I start GUI Vim in a maximized window always?\n\nYou can use the `:simalt` command to maximize the Vim window. You can use\nthe GUIEnter autocmd to maximize the Vim window on startup:\n\n autocmd GUIEnter * simalt ~x\n\nFor more information, read:\n\nB<:help :simalt>\n\nB<:help GUIEnter>\n\nB<:help gui-win32-maximized>\n\n\n\n=head2 33.4. After doing some editing operations, Vim freezes. The cursor becomes\n   an empty rectangle. I am not able enter any characters. What is\n   happening?\n\nMost probably, you used the mouse wheel to scroll the text in Vim. There is\na known problem in using intellimouse mouse wheel with Vim. To avoid this\nproblem, disable Universal scrolling support for Vim.\n\nFor more information, read:\n\nB<:help intellimouse-wheel-problems>\n\n\n\n=head2 33.5. I am using Windows XP, the display speed of maximized GVim is very\n   slow. What can I do to speed the display updates?\n\nThis may be due to the fact that you have enabled 'Smooth edges of screen\nfonts' in the display properties. Try turning off font smoothing or try\nchanging the smoothing method to \"Standard\".\n\n\n=head2 33.6. What are the recommended settings for using Vim with cygwin?\n\nYou may want to set the following shell related Vim settings:\n\n :set shellcmdflag=-c\n :set shellquote=\n :set shellslash          \" Use the forward slash for expansion.\n :set shellxquote=\\\"\n :set shell=d:\\cygwin\\bin\\bash.exe \" Use the bash shell\n :set shellpipe=2>&1| tee\n :set shellredir=>%s 2>&1\n\n\n=head2 33.7. I am trying to use GNU diff with Vim diff mode. When I run the diff\n   from command line, it works. When I try to use the diff with Vim it\n   doesn't work. What should I do now?\n\nThere is a problem with using GNU diff with Vim. You can try using the\nGNU diff.exe built by Ron Aaron from the following link:\n\n http://www.mossbayeng.com/~ron/vim/builds.html\n(This page no longer exists.)\n\n\n=head2 33.8. Is it possible to use Vim as an external editor for MS-Windows\n   Outlook email client?\n\nYou can use the \"cubiclevim\" COM Add-In to use Vim as an external editor\nfor MS-Windows Outlook email client. Visit the following URL for more\ninformation:\n\n https://sourceforge.net/projects/cubiclevim/\n\nNote, that currently this works only with MS-Office 2000 and XP.\n\nAlso the plugin OutlookVim might be worth a look:\n\n https://www.vim.org/scripts/script.php?script_id=3087\n\n\n=head2 33.9. I am using Vim to edit HTML files. How do I start internet explorer\n   with the current file to preview the HTML file?\n\nYou can use the following command:\n\n :!start c:\\progra~1\\intern~1\\iexplore.exe file://%:p<CR>\n\n\n=head2 33.10. I would like to use Vim with Microsoft Visual Studio. How do I do\n    this?\n\nYou have to download and use the OLE version of Vim (for example:\ngvim61ole.zip). This file also contains instructions on how to use Vim with\nVisual Studio.\n\nFor more information, read:\n\nB<:help MSVisualStudio>\n\n\n\n=head2 33.11. Where do I place the _vimrc and _gvimrc files?\n\nYou can place the _vimrc and _gvimrc files under the directory pointed to\nby the VIM environment variable. If you are sharing this system with other\nusers, then you can place the files in a directory and set the HOME\nenvironment variable to this directory.\n\nFor more information, read:\n\nB<:help $HOME-use>\n\nB<:help _vimrc>\n\n\n\n=head2 33.12. Every time I save a file, Vim warns about the file being changed\n    outside of Vim. Why?\n\nIf you get the following warning message, every time you save a file:\n\n WARNING: The file has been changed since reading it!!!\n Do you really want to write to it (y/n)?\n\nthen this problem could be related to a bug in MS-Windows on the day\ndaylight saving time starts.  Vim remembers the timestamp of the file after\nit was written.  Just before the next write the timestamp is obtained again\nto check if the file was changed outside of Vim.  This works correctly,\nexcept on the day daylight saving time starts.\n\nThis problem will go away the next day after the day the daylight saving\ntime starts.\n\nFor more information, read:\n\nB<:help W11>\n\n\n\n\n=head1 PRINTING\n\n\n\n=head2 34.1. How do I print a file along with line numbers for all the lines?\n\nYou can set the 'printoptions' option and use the `:hardcopy` command to\nprint your file:\n\n :set printoptions=number:y\n :hardcopy\n\nFor more information, read:\n\nB<:help 'printoptions'>\n\nB<:help :hardcopy>\n\n\n\n=head2 34.2. How do I print a file with the Vim syntax highlighting colors?\n\nYou can use the `:hardcopy` command to print a file with the Vim syntax\nhighlighting colors. You can also convert your file to a HTML file using\nthe 2html.vim script and print the HTML file.\n\nFor more information, read:\n\nB<:help syntax-printing>\n\nB<:help 2html.vim>\n\nB<:help :hardcopy>\n\nB<:help printing>\n\n\n\n\n=head1 BUILDING VIM FROM SOURCE\n\n\n\n=head2 35.1. How do I build Vim from the sources on a Unix system?\n\nFor a Unix system, follow these steps to build Vim from the sources:\n\n- Download the source from the git repository:\n  https://github.com/vim/vim/releases/\n- Alternatively, download the source from the mercurial repository:\n  https://bitbucket.org/vim-mirror/vim/downloads/\n- Run the \"make\" command to configure and build Vim with the default\n  configuration.\n- Run \"make install\" command to install Vim in the default directory.\n\nTo enable/disable various Vim features, before running the \"make\" command\nyou can run the \"configure\" command with different flags to include/exclude\nthe various Vim features. To list all the available options for the\n\"configure\" command, use:\n\n $ configure --help\n\nFor more information, read:\n\nB<:help install>\n\n\n\n=head2 35.2. How do I install Vim in my home directory or a directory other\n   than the default installation directory in Unix?\n\nTo install Vim in a directory other than the default installation\ndirectory, you have to specify the directory using the --prefix option\nwhile running the configure script.\n\n $ ./configure --prefix=/users/xyz\n\nYou can enable/disable various Vim feature by supplying different arguments\nto the configure script. For more information about all these options, run:\n\n $ ./configure --help\n\nFor more information, read:\n\nB<:help install-home>\n\nB<:help install>\n\n\n\n=head2 35.3. How do I build Vim from the sources on a MS-Windows system?\n\nFor a MS-Windows system, Vim can be built using either the Visual C++\ncompiler or the Borland C++ compiler or the Ming GCC compiler or the cygwin\ngcc compiler. Follow these steps to build Vim from the sources for\nMS-Windows:\n - download the source from the git repository:\n   https://github.com/vim/vim/releases/\n - Depending on the installed compiler, you can use the corresponding\n   makefile to build the Vim sources. For Visual C++ use the\n   Make_mvc.mak makefile, for borland C++ use the Make_bc5.mak makefile,\n   for ming GCC use the Make_ming.mak makefile, for cygwin gcc use the\n   Make_cyg.mak makefile.\n\nDepending on whether you want to build the GUI version of Vim or the\nconsole version of Vim, you have to pass different arguments to the\nmakefiles. After successfully building the sources, you can copy the\nvim.exe or gvim.exe file to the desired directory along with the files from\nthe runtime archive.\n\nFor more information, read:\n\nB<:help install>\n\n\n\n=head2 35.4. The Vim help, syntax, indent files are missing from my Vim\n   installation. How do I install these files?\n\nThe Vim help, syntax, indent and other runtime files are part of the Vim\nruntime package. You need to download and install the Vim runtime package.\nFor example, for MS-Windows, the name of the Vim 6.1 runtime package is\nvim61rt.zip.\n\nFor more information, read:\n\nB<:help install>\n\n\n\n=head2 35.5. I have built Vim from the source and installed the Vim package using\n   \"make install\". Do I need to keep the Vim source directory?\n\nNo. Once you have built and installed Vim in some directory other than the\noriginal source directory (for example, /usr/bin or /usr/local/bin), then\nyou can remove the source directory.\n\n\n=head2 35.6. How do I determine the Vim features which are enabled at compile\n   time?\n\nYou can use the `:version` command to determine the Vim features that are\nenabled at compile time. The features that are enabled will be prefixed\nwith a \"+\". The features that are not enabled will be prefixed with a \"-\".\n\nIf you want to test for a feature in a script, you can use the has()\nfunction:\n\n if has(\"menu\")\n     \" Set up some menus\n endif\n\nFor more information, read:\n\nB<:help :version>\n\nB<:help +feature-list>\n\nB<:help has()>\n\n\n\n=head2 35.7. Can I build Vim without the GUI support?\n\nYes. You can build Vim by optionally enabling/disabling many of the\nfeatures including GUI.\n\nFor more information, read:\n\nB<:help install>\n\n\n\n=head2 35.8. When building Vim on a Unix system, I am getting \"undefined reference\n   to term_set_winsize\" error. How do I resolve this error?\n\nYou will get this error when the build process is not able to locate the\ntermlib, termcap or ncurses library. You have to install the ncurses-dev\npackage to resolve this error.\n\n\n=head2 35.9. Vim configure keeps complaining about the lack of gtk-config while\n   trying to use GTK 2.03. This is correct, since in GTK 2 they moved to\n   using the generic pkg-config. I can get pkg-config to list the\n   various includes and libs for gtk, but for some reason the configure\n   script still isn't picking this up.\n\nUse the following shell script named gtk-config:\n\n #!/bin/sh\n pkg-config gtk+-2.0 $1 $2\n\n\n=head2 35.10. I did successfully download the sources and compiled Vim on\n     Unix. But feature ... still does not work. What is wrong and\n     how can I fix it?\n\nYou should first check, that you are actually running your self compiled\nVim and not the system's provided version. So first check your $PATH\nsetting.\n\nDepending on your compile options, some features might not be included in\nyour build of Vim. You can use the `:version` command to determine the Vim\nfeatures that are enabled at compile time. The features that are enabled\nwill be prefixed with a \"+\". The features that are not enabled will be\nprefixed with a \"-\".\n\nThe easiest way to include all features is to build the huge version. To do\nthis, you have to specify the --with-features option while running the\nconfigure script:\n\n $ ./configure --with-features=huge\n\nNevertheless, a feature could still be disabled at compile time, if the\nconfigure script can't find the required libraries for those features (e.g.\nfor clipboard integration, your Vim needs to be linked against the X11\ndevelopment libraries).\n\nThere are several ways to install the required libraries:\n\n1) On a Debian based distribution, you can use the package manager \"apt\"\n   to install all required dependencies. As superuser, run the command:\n\n   $ apt-get build-dep vim-gtk\n\n   This makes sure all required libraries needed to compile the vim-gtk\n   package will be installed. (This requires, that your sources list\n   contains deb-src entries. See your distribution manual on how to\n   enable this, if the above command did not work.)\n\n2) In openSUSE you can use the package manager \"zypper\" to install all\n   required libraries. This requires, that there is a source version of\n   the package installable from a configured repository (which by\n   default is not the case). Use:\n\n   $ zypper search -t srcpackage vim\n\n   to find out, whether or not there exists a source version in the\n   repository. If there is none, you'll need to add a source repository.\n   For openSUSE 11.2 you could use, e.g.\n\n   $ zypper ar\n   http://download.opensuse.org/source/distribution/11.2/repo/oss/src-11.2\n\n   (one line)\n\n   Once you have a source version available in your repositories, use\n   this command to install all needed requirements:\n\n   $ zypper source-install --build-deps-only vim\n\n3) On a Fedora/RedHat based system, you can use\n\n   $ yum-builddep vim-enhanced\n\n4) Run configure with your options and watch for missing libraries:\n\n   $ ./configure --with-features=huge 2>&1 |tee logfile\n\n   This will run configure and record the output into the file \"logfile\".\n   You need to check the logfile for missing dependencies. Consider this\n   output:\n\n checking --disable-gtktest argument... gtk test enabled\n checking for pkg-config... /usr/bin/pkg-config\n checking for GTK - version >= 2.2.0... no\n\n Here you can see, that the gtk libraries are missing and therefore\n no GTK gui version can't be build. So you need to install the GTK\n library in your system, with your package manager or by compiling it\n yourself. Then run the configure script again and check, that it\n finds the library.\n\nIn theory, those provided dependencies by your distribution might still\nlack some libraries, that are needed for features, that simply are not\nenabled in your distribution and therefore those commands in 1-3 won't\ninstall it. At the very least, this provides a jumping point and you need\nto track down the required missing packages using method 4 from above. But\nusually, this works good enough for most people and you won't have to\nbother with the fourth method.\n\nFor more information, read:\n\nB<:help :version>\n\nB<:help +feature-list>\n\n\n\n\n=head1 VARIOUS\n\n\n\n=head2 36.1. How do I edit binary files with Vim?\n\nYou can set the following options to edit binary files in Vim:\n\n :set binary\n :set display=uhex\n\nYou can also use the \"-b\" command-line option to edit a binary file:\n\n $ vim -b <binary_file_name>\n\nYou can also use the xxd utility (part of the Vim distribution) to edit\nbinary files.\n\nFor more information, read:\n\nB<:help 23.4>\n\nB<:help edit-binary>\n\nB<:help hex-editing>\n\nB<:help -b>\n\nB<:help 'binary'>\n\nB<:help 'endofline'>\n\nB<:help 'display'>\n\n\n\n=head2 36.2. How do I disable the visual error flash and the error beep?\n\nYou can disable both the visual error flash and the error beep using the\nfollowing command:\n\n :set visualbell t_vb=\n\nFor more information, read:\n\nB<:help 'visualbell'>\n\nB<:help 'errorbells'>\n\nB<:help t_vb>\n\n\n\n=head2 36.3. How do I display the ascii value of a character displayed in a\n   buffer?\n\nYou can use the \"ga\" command to display the ascii value of a displayed\ncharacter.\n\nFor more information, read:\n\nB<:help ga>\n\nB<:help :ascii>\n\n\n\n=head2 36.4. Can I use zero as a count for a Vim command?\n\nYou cannot use zero as a count for a Vim command, as \"0\" is a command on\nits own, moving to the first column of the line.\n\nFor more information, read:\n\nB<:help 0>\n\nB<:help count>\n\n\n\n=head2 36.5. How do I disable the Vim welcome screen?\n\nYou can disable the Vim welcome screen, by adding the \"I\" flag to the\n'shortmess' option:\n\n :set shortmess+=I\n\nFor more information, read:\n\nB<:help :intro>\n\nB<:help 'shortmess'>\n\n\n\n=head2 36.6. How do I avoid the \"hit enter to continue\" prompt?\n\nVim will prompt you with the \"hit enter to continue\" prompt, if there are\nsome messages on the screen for you to read and the screen is about to be\nredrawn.  You can add the \"T\" flag to the 'shortmess' option to truncate\nall messages. This will help in avoiding the hit-enter prompt:\n\n :set shortmess+=T\n\nYou can also increase the command height by setting the 'cmdheight' option:\n\n :set cmdheight=2\n\nFor more information, read:\n\nB<:help hit-enter>\n\nB<:help avoid-hit-enter>\n\nB<:help 'shortmess'>\n\nB<:help 'cmdheight'>\n\n\n\n=head2 36.7. How do I invoke Vim from command line to run a group of commands on a\n   group of files?\n\nThere are several ways to invoke Vim from command line to run a group of\ncommands on a group of files. You can use a set of  \"-c\" command line\noptions to specify a group of commands:\n\n $ vim -c \"<ex_command_1>\" -c \"<ex_command_2>\" *.txt\n\nEach of the ex-command specified with the \"-c\" command line option is\nexecuted one by one sequentially. You can also use a single \"-c\" command\nline option and the \"|\" character to separate the ex commands:\n\n $ vim -c \"<ex_command_1> | <ex_command_2>\" *.txt\n\nIn the above command, if an ex command fails, then all the remaining ex\ncommands will not be executed.\n\nFor example, to replace \"ABC\" with \"DEF\" in a file from the command-line,\nyou can use the following command:\n\n $ vim -c \"%s/ABC/DEF/ge | update\" myfile.txt\n\nTo replace \"ABC\" with \"DEF\" in multiple files from the command-line,\nyou can use the following command:\n\n $ vim -c \"argdo %s/ABC/DEF/ge | update\" *.txt\n\nYou can store the group of commands into a file and use the \"-s\" command\nline option to run the commands on a set of files. For example, if the\ngroup of commands are stored in the file mycmds.txt, then you can use the\nfollowing command:\n\n $ vim -s mycmds.txt *.pl\n\nFor more information, read:\n\nB<:help -c>\n\nB<:help -s>\n\n\n\n=head2 36.8. How do I use a normal mode command from insert mode without leaving\n   the insert mode?\n\nYou can use a normal command from insert mode, without leaving the insert\nmode, by first pressing the CTRL-O key and then follow that with a single\nnormal mode command.\n\nTo execute more than one normal mode command, press the CTRL-L key,\nfollowed by any number of normal mode commands and then press <Esc> to get\nback to the insert mode. (This only works, when the 'insertmode' option\nis set).\n\nFor more information, read:\n\nB<:help i_CTRL-O>\n\nB<:help i_CTRL-L>\n\n\n\n=head2 36.9. How do I start Vim in insert mode?\n\nYou can start Vim in insert mode using the `:startinsert` ex command.\n\n $ vim +startinsert myfile.txt\n\nThe above command will open the file \"myfile.txt\" and start insert mode\nwith the cursor in front of the first character on the first line.  To open\nthe file and start appending after the last character on the last line,\nyou can use the following command:\n\n $ vim + +startinsert! myfile.txt\n\nFor more information, read:\n\nB<:help :startinsert>\n\n\n\n=head2 36.10. How do I use Copy and Paste with Vim?\n\nYou should first check the output of the `:version` command and make\nsure that +xterm-clipboard is present.\n\nWhen running Vim in an xterm, you can either let Vim control the mouse\nor let xterm control the mouse. This is configured by the 'mouse' option.\n\nIf the 'mouse' option is not set (or set to the default value), then Vim will\nnot control the mouse. You cannot move the Vim text cursor using the\nmouse. When you select some text using the mouse, xterm will copy\nit to the X11 cut buffer. When you press both the mouse buttons,\nxterm will paste the text from the cut buffer.\n\nIf the 'mouse' option is set to \"a\" or some other value, then Vim controls\nthe mouse. The mode (normal or insert or visual, etc) in which Vim\ncontrols the mouse is configured by the 'mouse' option. You can move\nthe Vim text cursor using the mouse. When you select some text,\nthe 'clipboard' option setting is used to determine whether to transfer\nthe selected text to the clipboard or not. The default setting is to\ntransfer the selected text to the clipboard. If you want to use the\nxterm selection mechanism in this mode, then you can press the\n<Shift> key. If you press <Shift> key when selecting text using the\nmouse, then Vim doesn't control the mouse and xterm controls the\nmouse.\n\nIn the GUI mode, Copy and Paste should just work, depending on the 'mouse'\nsetting. For more information, read:\n\nB<:help 'clipboard'>\n\nB<:help x11-selection>\n\nB<:help clipboard>\n\nB<:help 'go-a'>\n\nB<:help 'mouse'>\n\nB<:help xterm-copy-paste>\n\nB<:help 09.3>\n\n\n\n=head2 36.11. Why shouldn't I modify the files in the system runtime directory?\n\nJust be careful about modifying files under $VIMRUNTIME, which usually\nis /usr/share/vim/vimXX (Unix) or C:\\Program Files\\vim\\vimXX\n(Windows) and XX being the version for which it applies, e.g. 73 for Vim\n=head2 7.3.\n\nOne should generally avoid modifying those files because they may be\nreplaced during an upgrade of your Vim installation and your changes\nwill be lost.  Also, if you upgrade to a new major or minor revision of\nVim (e.g., from 7.3 to 7.4), the new version of Vim will use a different\n$VIMRUNTIME directory and while your changes won't be lost, they will be\nignored.\n\nConsequently, take a look at\n\nB<:help filetypes>\n\n\nfor an explanation of several ways to modify Vim's response to\ndifferent filetypes and where to put those modifications so that\nthey will not be overwritten.\n\n\n\n=head1 UNICODE\n\nAuthor: Tony Mechelynck <antoine.mechelynck AT belgacom.net>\n\n\n=head2 37.1. Is it possible to create Unicode files using Vim?\n\nYes. It may be more or less complicated depending on the keyboard and fonts\navailable to you, but it is always possible to encode any possible Unicode\ncodepoint (and some illegal ones) into a file. To create a Unicode file\nusing Vim, you should have compiled Vim with the \"+multi_byte\" compile-time\noption.  You can get more information about Unicode from the following\nsites:\n\n http://www.unicode.org\n https://www.cl.cam.ac.uk/~mgk25/unicode.html\n\nFor more information, read:\n\nB<:help multibyte>\n\nB<:help usr_45.txt>\n\n\n\n=head2 37.2. Which Vim settings are particularly important for editing Unicode\n   files?\n\nThe most important are the various \"encoding\" options, i.e., 'encoding',\n'fileencoding', 'fileencodings' and 'termencoding'. The boolean option\n'bomb' is also significant.\n\nFor more information, read:\n\nB<:help 'encoding'>\n\nB<:help 'fileencoding'>\n\nB<:help 'fileencodings'>\n\nB<:help 'termencoding'>\n\nB<:help 'bomb'>\n\n\n\n=head2 37.3. What is the 'encoding' option?\n\nBasically, the 'encoding' option defines how Vim will represent your data\ninternally.  However, all Unicode encodings are represented internally as\nutf-8 and converted (if necessary) when reading and writing.\n\nFor more information, read:\n\nB<:help 'encoding'>\n\n\n\n=head2 37.4. How does Vim name the various Unicode encodings?\n\nUtf-8 is called utf-8 or utf8; utf-16 is called ucs-2 or ucs2; utf-32 is\ncalled ucs-4 or ucs4. Also, you may specify endianness (except for utf-8\nwhich does not vary for endianness) by appending le for little-endian or be\nfor big-endian. If you create a file with an encoding of ucs-2 or ucs-4\nwithout specifying endianness, Vim will use what is typical of your\nmachine.\n\nFor more information, read:\n\nB<:help encoding-names>\n\nB<:help encoding-values>\n\nB<:help encoding-table>\n\n\n\n=head2 37.5. How does Vim specify the presence or absence of a byte-order mark?\n\nWhen reading a file, if the 'fileencodings' option includes \"ucs-bom\", Vim\nwill check for a byte-order mark. When writing a file, if the 'bomb' option\nis set, Vim will write a byte-order mark on files whose encoding warrants\nit.\n\nFor more information, read:\n\nB<:help 'fileencodings'>\n\nB<:help 'bomb'>\n\n\n\n=head2 37.6. What is the 'fileencoding' option?\n\nThe 'fileencoding' option defines the particular encoding which Vim will\nuse to write a file. If empty, then the value of the 'encoding' option is\nthe default.\n\nFor more information, read:\n\nB<:help 'fileencoding'>\n\n\n\n=head2 37.7. What is the 'fileencodings' option?\n\nThe 'fileencodings' option defines the heuristics used by Vim when opening\nan existing file. It is a comma separated list of encodings. A special\nname, \"ucs-bom\" is used to indicate that Vim should check for the presence\nof a byte-order mark; however, it will not be recognised if it comes after\n\"utf-8\".  Normally, \"ucs-bom\" (if present) should be first in the list.\n\nWhen Vim opens a file, it checks it against the encodings listed in\n'fileencodings'. The first one that matches is used. If there is no match,\nthen Vim sets 'fileencoding' to the null string, i.e., the value of\n'encoding' will be used.\n\nFor more information, read:\n\nB<:help 'fileencodings'>\n\nB<:help 'encoding'>\n\n\n\n=head2 37.8. What is the 'termencoding' option?\n\nThe 'termencoding' option defines how your keyboard encodes the data you\ntype.  If empty, Vim assumes that it has the same value as 'encoding'.\nUsually it should be set to something that matches your locale.\n\nFor more information, read:\n\nB<:help 'termencoding'>\n\nB<:help locale>\n\n\n\n=head2 37.9. What is the 'bomb' option?\n\nWhen reading a file with \"ucs-bom\" present in the 'fileencodings' option,\nVim will set the 'bomb' option on or off depending on the presence or\nabsence of a byte-order mark at the start of the file. When writing, Vim\nwill write a byte-order mark if the 'bomb' option is set. You may set or\nunset it manually do make Vim write, or not write, the b.o.m.\n\nFor more information, read:\n\nB<:help 'bomb'>\n\n\n\n=head2 37.10. Where can I find an example of a typical use of all these options?\n\nThere is a \"tip\", with explains them in different words with an example, at\n\n http://vim.wikia.com/wiki/VimTip246\n\n\n=head2 37.11. How can I insert Unicode characters into a file using Vim?\n\nSeveral methods are available:\n\n- Characters present on your keyboard can be typed in the usual way, even\n  those which require a \"dead-key\" prefix, like (for instance) the\n  circumflex on French keyboards.\n- Characters for which a digraph is defined can be typed as two characters\n  prefixed by CTRL-K.\n- If you have set the 'digraph' option, you can enter the characters for\n  which a digraph is defined as <char1><BS><char2>.\n- Any character can be entered by using a CTRL-V prefix (or CTRL-Q if\n  CTRL-V is remapped to paste from the clipboard).\n\nFor more information, read:\n\nB<:help digraphs>\n\nB<:help 'digraph'>\n\nB<:help i_CTRL-V_digit>\n\n\n\n=head2 37.12. How can I know which digraphs are defined and for which characters?\n\nFirst set the 'encoding' option properly (for instance, to utf-8), then use\nthe `:digraphs` command to list the currently defined digraphs.\n\nAlternatively, the help file contains the complete set of all digraphs.\nSo you can easily search that list there.\n\nFor more information, read:\n\nB<:help :digraphs>\n\nB<:help 'encoding'>\n\nB<:help digraph-table>\n\n\n\n\n=head1 AUTHOR\n\nCurrent Maintainer: Christian Brabandt <cb@256bit.org>\n\nLast updated on: 11 October 2025\n"
  },
  {
    "path": "plugin/faq_plugin.vim",
    "content": "\" VIM_FAQ - The Vim faq from http://vimdoc.sourceforge.net/\n\" -------------------------------------------------------------\n\" Version:  65\n\" Maintainer:  Christian Brabandt\n\" Last Change: 11 October 2025\n\"\n\" Script: \n\" GetLatestVimScripts: 3298 65 :AutoInstall: faq_plugin.vim\n\"\n\"\n\" empty stub. This plugin contains only of the documentation\n\" and the GLVS headers for |GLVS|\n"
  },
  {
    "path": "post.pl",
    "content": "#!/usr/bin/perl\nuse strict;\nuse warnings;\n\nuse WWW::Mechanize;\n\nsub GetPassword() {\n\tmy $i=0;\n\tmy @pass;\n\tmy $passfile=\"./vim_passfile\"; # line1: username, line2: password\n\topen(PASS, '<',$passfile) or die \"Can't open passwordfile: $passfile\\n\";\n\twhile(<PASS>){\n\t\tchomp;\n\t\t$pass[$i++] = $_;\n\t}\n\tclose(PASS);\n\treturn @pass;\n}\n\nmy $sid=3298;\nmy $vim_required_version=6.0;\nmy $file;\nmy @files=glob('*.vmb');\n#my $scriptversion=shift @ARGV;\nmy $scriptversion = 0;\nmy $versioncomment=shift @ARGV;\n\n\n\nmy @userpasswordpair = GetPassword();\nfor (@files) {\n\tmy $f = $_ if [ -f $_ ] && $_ =~ /\\w+-(\\d+)\\.vmb/;\n\tif ($1 > $scriptversion) {\n\t\t$scriptversion=$1;\n\t\t$file = $f;\n\t}\n}\n\n# Error Checking\nunless ($file){\n\tprint \"Didn't find a file to upload!\\n\";\n\texit;\n}\nunless ($versioncomment){\n\tprint \"Please enter comment!\\n\";\n\texit;\n}\n$versioncomment.=\"\\n(automatically uploaded)\";\n\nmy $mech=WWW::Mechanize->new(autocheck => 1);\n$mech->get(\"http://www.vim.org/login.php\");\n$mech->submit_form(\n    form_name => \"login\",\n    with_fields => {\n        userName => $userpasswordpair[0],\n        password => $userpasswordpair[1],\n    },\n);\n$mech->get(\"http://www.vim.org/scripts/script.php?script_id=$sid\");\n$mech->follow_link(text => 'upload new version');\n$mech->form_name(\"script\");\n$mech->field(script_file => $file);\n$mech->field(vim_version => $vim_required_version);\n$mech->field(script_version => $scriptversion);\n$mech->field(version_comment => $versioncomment);\n$mech->click_button(value => \"upload\");\nprint \"Upload $file Version: $scriptversion complete\\n\"\n"
  },
  {
    "path": "vim_faq.txt",
    "content": "vim:tw=72:wrap:fo=tcqn2:sw=4:sts=4:et:spell:spelllang=en\n\nThis Vim FAQ is created from the questions and answers posted to the\nvim@vim.org user mailing list and the comp.editors newsgroup. There are\nseveral ways to solve a problem in Vim. This FAQ gives one of those several\npossibilities. You can explore the other ways using the information and\nlinks given in this FAQ. The credit for the answers in this FAQ goes to\nPeppe, Benji, Charles Campbell and numerous others. An online version of\nthis FAQ is available at https://vimhelp.org/vim_faq.txt.html\n\nINDEX\n\nSECTION 1 - GENERAL INFORMATION\n    1.1. What is Vim?\n    1.2. Who wrote Vim?\n    1.3. Is Vim compatible with Vi?\n    1.4. What are some of the improvements of Vim over Vi?\n    1.5. Is Vim free?\n\nSECTION 2 - RESOURCES\n    2.1. Where can I learn more about Vim?\n    2.2. Is there a mailing list available?\n    2.3. Is there an archive available for the Vim mailing lists?\n    2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\n    2.5. I have a \"xyz\" (some) problem with Vim. How do I determine if it is\n         a problem with my setup or with Vim?\n    2.6. Where can I report bugs?\n    2.7. Where can the FAQ be found?\n    2.8. What if I don't find an answer in this FAQ?\n    2.9. I have a patch for implementing a Vim feature. Where do I send the\n         patch?\n    2.10. I have a Vim tip or developed a new Vim\n          syntax/indent/filetype/compiler plugin or developed a new script\n          or a colorscheme. Is there a public website where I can upload\n          this?\n\nSECTION 3 - AVAILABILITY\n    3.1. What is the latest version of Vim?\n    3.2. Where can I find the latest version of Vim?\n    3.3. What platforms does it run on?\n    3.4. Where can I download the latest version of the Vim runtime files?\n\nSECTION 4 - HELP\n    4.1. How do I use the help files?\n    4.2. How do I search for a keyword in the Vim help files?\n    4.3. I am getting an error message E123, what did I do wrong?\n    4.4. Where can I read about the various modes in Vim?\n    4.5. How do I generate the Vim help tags file after adding a new Vim\n         help file?\n    4.6. Can I use compressed versions of the help files?\n\nSECTION 5 - EDITING A FILE\n    5.1. How do I load a file in Vim for editing?\n    5.2. How do I save the current file in another name (save as) and edit\n         a new file?\n    5.3. How do I change the current directory to the directory of the\n         current file?\n    5.4. How do I write a file without the line feed (EOL) at the end of\n         the file?\n    5.5. How do I configure Vim to open a file at the last edited location?\n    5.6. When editing a file in Vim, which is being changed by an external\n         application, Vim opens a warning window (like the confirm dialog)\n         each time a change is detected. How do I disable this warning?\n    5.7. How do I edit a file whose name is under the cursor?\n    5.8. How do I reload/re-edit the current file?\n    5.9. How do I autosave a file periodically?\n    5.10. How do I open a file in read-only mode?\n    5.11. How do I open a file for editing without saving the modifications\n          to the current file?\n    5.12. How do I reduce the loading time for very large files in Vim?\n\nSECTION 6 - EDITING MULTIPLE FILES\n    6.1. How do I open multiple files at once from within Vim?\n    6.2. How do I switch between multiple files/buffers in Vim?\n    6.3. How do I open several files in Vim, with each file in a separate\n         window/tabpage?\n    6.4. How do I configure Vim to autoload several files at once similar\n         to \"work-sets\" or \"projects\"?\n    6.5. Is it possible to open multiple top level windows in a single\n         instance of Vim similar to Nedit or emacs?\n    6.6. How do I browse/explore directories from within Vim?\n    6.7. How do I edit files over a network using ftp/scp/rcp/http?\n\nSECTION 7 - BACKUP\n    7.1. When I edit and save files, Vim creates a file with the same name\n         as the original file and a \"~\" character at the end. How do I stop\n         Vim from creating this file (or) How do I disable the Vim backup\n         file feature?\n    7.2. When I edit and save files, Vim creates a file with the same name\n         as the original file and a \".un~\" extension at the end. How do I\n         stop Vim from creating this file (or) How do I disable the Vim\n         undofile feature.\n    7.3. How do I configure Vim to store all the backup files in a\n         particular directory?\n    7.4. When I save a file with Vim, the file permissions are changed.\n         How do I configure Vim to save a file without changing the file\n         permissions?\n\nSECTION 8 - BUFFERS\n    8.1. I have made some modifications to a buffer. How do I edit another\n         buffer without saving the modified buffer and also without losing\n         the modifications?\n    8.2. How do I configure Vim to auto-save a modified buffer when\n         switching to another buffer?\n    8.3. How do I replace the buffer in the current window with a blank\n         buffer?\n    8.4. Is there a keyboard shortcut to load a buffer by the buffer\n         number?\n    8.5. How do I open all the current buffers in separate windows?\n    8.6. How do I close (delete) a buffer without exiting Vim?\n    8.7. When I use the command `:%bd` to delete all the buffers, not all\n         the buffers are deleted. Why?\n    8.8. How do I display the buffer number of the current buffer/file?\n    8.9. How do I delete a buffer without closing the window in which the\n         buffer is displayed?\n    8.10. How do I map the <Tab> key to cycle through and open all the\n          buffers?\n\nSECTION 9 - WINDOWS\n    9.1. What is the difference between a Vim window and a buffer?\n    9.2. How do I increase the width of a Vim window?\n    9.3. How do I zoom into or out of a window?\n    9.4. How do I execute an ex command on all the open buffers or open\n         windows or all the files in the argument list?\n\nSECTION 10 - MOTION\n    10.1. How do I jump to the beginning (first line) or end (last line) of\n          a file?\n    10.2. In insert mode, when I press the <Esc> key to go to command mode,\n          the cursor moves one character to the left (except when the\n          cursor is on the first character of the line). Is it possible to\n          change this behavior to keep the cursor at the same column?\n    10.3. How do I configure Vim to maintain the horizontal cursor position\n          when scrolling with the <Page Up>, <Page Down>, etc keys?\n    10.4. Some lines in a file are more than the screen width and they are\n          all wrapped. When I use the j, k keys to move from one line to\n          the next, the cursor is moved to the next line in the file\n          instead of the next line on the screen. How do I move from one\n          screen line to the next?\n    10.5. What is the definition of a sentence, paragraph and section in\n          Vim?\n    10.6. How do I jump to beginning or end of a sentence, paragraph or a\n          section?\n    10.7. I have lines in a file that extends beyond the right extent of the\n          screen. How do I move the Vim view to the right to see the text\n          off the screen?\n    10.8. How do I scroll two or more buffers simultaneously?\n    10.9. When I use my arrow keys, Vim changes modes, inserts weird\n          characters in my document but doesn't move the cursor properly.\n          What's going on?\n    10.10. How do I configure Vim to move the cursor to the end of the\n           previous line, when the left arrow key is pressed and the cursor\n           is currently at the beginning of a line?\n    10.11. How do I configure Vim to stay only in insert mode (modeless\n           editing)?\n    10.12. How do I display some context lines when scrolling text?\n    10.13. How do I go back to previous cursor locations?\n\nSECTION 11 - SEARCHING TEXT\n    11.1. After I searched for a text with a pattern, all the matched text\n          stays highlighted. How do I turn off the highlighting\n          temporarily/permanently?\n    11.2. How do I enter a carriage return character in a search pattern?\n    11.3. How do I search for the character \"^M\"?\n    11.4. How can I search/replace characters that display as \"~R\", \"~S\",\n          etc.?\n    11.5. How do I highlight all the non-printable characters in a file?\n    11.6. How do I search for whole words in a file?\n    11.7. How do I search for the current word under the cursor?\n    11.8. How do I search for a word without regard to the case (uppercase\n          or lowercase)?\n    11.9. How do I search for words that occur twice consecutively?\n    11.10. How do I count the number of times a particular word occurs in a\n           buffer?\n    11.11. How do I place the cursor at the end of the matched word when\n           searching for a pattern?\n    11.12. How do I search for an empty line?\n    11.13. How do I search for a line containing only a single character?\n    11.14. How do I search and replace a string in multiple files?\n    11.15. I am using the `:s` substitute command in a mapping. When a\n           search for a pattern fails, the map terminates. I would like the\n           map to continue processing the next command, even if the\n           substitute command fails. How do I do this?\n    11.16. How do I search for the n-th occurrence of a character in a\n           line?\n    11.17. How do I replace a tab (or any other character) with a hard\n           return (newline) character?\n    11.18. How do I search for a character by its ASCII value?\n    11.19. How do I search for long lines?\n    11.20. How do I display all the lines in the current buffer that\n           contain a specified pattern?\n    11.21. How do I search for a text string that spans multiple lines?\n    11.22. How do I search for a pattern only within a range of lines\n           in a buffer?\n    11.23. How do I clear the last searched pattern?\n    11.24. Why does this pattern \"a.\\{-}p\\@!\" not match?\n    11.25. How can I use \"/\" within a pattern, without escaping it?\n    11.26. How can I operate on a search match?\n\nSECTION 12 - CHANGING TEXT\n    12.1. How do I delete all the trailing white space characters (SPACE\n          and TAB) at the end of all the lines in a file?\n    12.2. How do I replace all the occurrences of multiple consecutive\n          space characters to a single space?\n    12.3. How do I reduce a range of empty lines into one line only?\n    12.4. How do I delete all blank lines in a file? How do I remove all\n          the lines containing only space characters?\n    12.5. How do I copy/yank the current word?\n    12.6. How do I yank text from one position to another position within a\n          line, without yanking the entire line?\n    12.7. When I yank some text into a register, how do I append the text\n          to the current contents of the register?\n    12.8. How do I yank a complete sentence that spans over more than one\n          line?\n    12.9. How do I yank all the lines containing a pattern into a buffer?\n    12.10. How do I delete all the lines in a file that do not contain a\n           pattern?\n    12.11. How do I add a line before each line with \"pattern\" in it?\n    12.12. Is there a way to operate on a line if the previous line\n           contains a particular pattern?\n    12.13. How do I execute a command on all the lines containing a\n           pattern?\n    12.14. Can I copy the character above the cursor to the current cursor\n           position?\n    12.15. How do I insert a blank line above/below the current line\n           without entering insert mode?\n    12.16. How do I insert the name of the current file into the current\n           buffer?\n    12.17. How do I insert the contents of a Vim register into the current\n           buffer?\n    12.18. How do I move the cursor past the end of line and insert some\n           characters at some columns after the end of the line?\n    12.19. How to replace the word under the cursor (say: junk) with\n           \"foojunkbar\" in Vim?\n    12.20. How do I replace a particular text in all the files in a\n           directory?\n    12.21. I have some numbers in a file. How do I increment or decrement\n           the numbers in the file?\n    12.22. How do I reuse the last used search pattern in a `:substitute`\n           command?\n    12.23. How do I change the case of a string using the `:substitute`\n           command?\n    12.24. How do I enter characters that are not present in the keyboard?\n    12.25. Is there a command to remove any or all digraphs?\n    12.26. In insert mode, when I press the backspace key, it erases only\n           the characters entered in this instance of insert mode. How do I\n           erase previously entered characters in insert mode using the\n           backspace key?\n    12.27. I have a file which has lines longer than 72 characters\n           terminated with \"+\" and wrapped to the next line. How can I\n           quickly join the lines?\n    12.28. How do I paste characterwise yanked text into separate lines?\n    12.29. How do I change the case (uppercase, lowercase) of a word or\n           a character or a block of text?\n    12.30. How do I enter ASCII characters that are not present in the\n           keyboard?\n    12.31. How do I replace non-printable characters in a file?\n    12.32. How do I remove duplicate lines from a buffer?\n    12.33. How do I prefix all the lines in a file with the corresponding\n           line numbers?\n    12.34. How do I exchange (swap) two characters or words or lines?\n    12.35. How do I change the characters used as word delimiters?\n\nSECTION 13 - COMPLETION IN INSERT MODE\n    13.1. How do I complete words or lines in insert mode?\n    13.2. How do I complete file names in insert mode?\n    13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do\n          I complete words that occur after the just completed word?\n\nSECTION 14 - TEXT FORMATTING\n    14.1. How do I format a text paragraph so that a new line is inserted\n          at the end of each wrapped line?\n    14.2. How do I format long lines in a file so that each line contains\n          less than \"n\" characters?\n    14.3. How do I join short lines to the form a paragraph?\n    14.4. How do I format bulleted and numbered lists?\n    14.5. How do I indent lines in insert mode?\n    14.6. How do I format/indent an entire file?\n    14.7. How do I increase or decrease the indentation of the current\n          line?\n    14.8. How do I indent a block/group of lines?\n    14.9. When I indent lines using the > or < key, the standard 8-tabstops\n          are used instead of the current 'tabstop' setting. Why?\n    14.10. How do I turn off the automatic indentation of text?\n    14.11. How do I configure Vim to automatically set the 'textwidth'\n           option to a particular value when I edit mails?\n    14.12. Is there a way to make Vim auto-magically break lines?\n    14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n           'fileformat' option to 'dos' and then 'unix' and then 'mac'.\n           None of these helped. How can I hide these symbols?\n    14.14. When I paste some text into a Vim buffer from another\n           application, the alignment (indentation) of the new text is\n           messed up. How do I fix this?\n    14.15. When there is a very long wrapped line (wrap is \"on\") and a line\n           doesn't fit entirely on the screen it is not displayed at all.\n           There are blank lines beginning with \"@\" symbol instead of\n           wrapped line. If I scroll the screen to fit the line the \"@\"\n           symbols disappear and the line is displayed again. What Vim\n           setting control this behavior?\n    14.16. How do I convert all the tab characters in a file to space\n           characters?\n    14.17. What Vim options can I use to edit text that will later go to a\n           word processor?\n    14.18. How do I join lines without adding or removing any space\n           characters?\n\nSECTION 15 - VISUAL MODE\n    15.1. How do I do rectangular block copying?\n    15.2. How do I delete or change a column of text in a file?\n    15.3. How do I apply an ex-command on a set of visually selected lines?\n    15.4. How do I execute an ex command on a column of text selected in\n          Visual block mode?\n    15.5. How do I select the entire file in visual mode?\n    15.6. When I visually select a set of lines and press the > key to\n          indent the selected lines, the visual mode ends. How can I\n          reselect the region for further operation?  (or) How do I\n          re-select the last selected visual area again?\n    15.7. How do I jump to the beginning/end of a visually selected region?\n    15.8. When I select text with mouse and then press : to enter an ex\n          command, the selected text is replaced with the : character. How\n          do I execute an ex command on a text selected using the mouse\n          similar to the text selected using the visual mode?\n    15.9. When I select a block of text using the mouse, Vim goes into\n          selection mode instead of Visual mode. Why?\n\nSECTION 16 - COMMAND-LINE MODE\n    16.1. How do I use the name of the current file in the command mode or\n          an ex command line?\n    16.2. How do I edit the text in the Vim command-line effectively?\n    16.3. How do I switch from Vi mode to Ex mode?\n    16.4. How do I copy the output from an ex-command into a buffer?\n    16.5. When I press the <Tab> key to complete the name of a file in the\n          command mode, if there are more than one matching file names,\n          then Vim completes the first matching file name and displays a\n          list of all matching filenames. How do I configure Vim to only\n          display the list of all the matching filenames and not complete\n          the first one?\n    16.6. How do I copy text from a buffer to the command line and from the\n          command line to a buffer?\n    16.7. How do I put a command onto the command history without executing\n          it?\n    16.8. How do I increase the height of the command-line?\n\nSECTION 17 - VIMINFO\n    17.1. When I invoke Vim, I get error messages about illegal characters\n          in the viminfo file. What should I do to get rid of these\n          messages?\n    17.2. How do I disable the viminfo feature?\n    17.3. How do I save and use Vim marks/commands across Vim sessions?\n\nSECTION 18 - REMOTE EDITING\n    18.1. How do I open a file with existing instance of gvim? What\n          happened to the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n    18.2. How do I send a command to a Vim server to write all buffers to\n          disk?\n    18.3. Where can I get the documentation about the Vim remote server\n          functionality?\n\nSECTION 19 - OPTIONS\n    19.1. How do I configure Vim in a simple way?\n    19.2. How do I toggle the value of an option?\n    19.3. How do I set an option that affects only the current\n          buffer/window?\n    19.4. How do I use space characters for a Vim option value?\n    19.5. Can I add (embed) Vim option settings to the contents of a file?\n    19.6. How do I display the line numbers of all the lines in a file?\n    19.7. How do I change the width of the line numbers displayed using the\n          'number' option?\n    19.8. How do I display (view) all the invisible characters like space,\n          tabs and newlines in a file?\n    19.9. How do I configure Vim to always display the current line and\n          column number?\n    19.10. How do I display the current Vim mode?\n    19.11. How do I configure Vim to show pending/partial commands on the\n           status line?\n    19.12. How do I configure the Vim status line to display different\n           settings/values?\n    19.13. How do I configure Vim to display status line always?\n    19.14. How do I make a Vim setting persistent across different Vim\n           invocations/instances/sessions?\n    19.15. Why do I hear a beep (why does my window flash) about 1 second\n           after I hit the Escape key?\n    19.16. How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n           deleting the characters I'm changing?\n    19.17. How do I remove more than one flag using a single `:set` command\n           from a Vim option?\n\nSECTION 20 - MAPPING KEYS\n    20.1. How do I know what a key is mapped to?\n    20.2. How do I list all the user-defined key mappings?\n    20.3. How do I unmap a key?\n    20.4. I am not able to create a mapping for the <xxx> key. What is\n          wrong?\n    20.5. Why does mapping the <C-...> key not work?\n    20.6. How do I map the numeric keypad keys?\n    20.7. How do I create a mapping that works only in visual mode?\n    20.8. How do I create a mapping that works only in normal and operator\n          pending mode (but not in visual mode)?\n    20.9. In a Vim script, how do I know which keys to use for my mappings,\n          so that the mapped key will not collide with an already used key?\n    20.10. How do I map the escape key?\n    20.11. How do I map a key to perform nothing?\n    20.12. I want to use the <Tab> key to indent a block of text and\n           <Shift-Tab> key to unindent a block of text. How do I map the keys\n           to do this?  This behavior is similar to textpad, visual studio,\n           etc.\n    20.13. In my mappings the special characters like <CR> are not\n           recognized. How can I configure Vim to recognize special\n           characters?\n    20.14. How do I use the \"|\" to separate multiple commands in a map?\n    20.15. If I have a mapping/abbreviation whose ending is the beginning of\n           another mapping/abbreviation, how do I keep the first from\n           expanding into the second one?\n    20.16. Why does it take a second or more for Vim to process a key,\n           sometimes when I press a key?\n    20.17. How do I map a key to run an external command using a visually\n           selected text?\n    20.18. How do I map the CTRL-I key while still retaining the\n           functionality of the <Tab> key?\n    20.19. How do I define a map to accept a count?\n    20.20. How can I make my normal mode mapping work from within Insert\n           Mode?\n\nSECTION 21 - ABBREVIATIONS\n    21.1. How do I auto correct misspelled words?\n    21.2. How do I create multi-line abbreviations?\n    21.3. When my abbreviations are expanded, an additional space character\n          is added at the end of the expanded text. How do I avoid this\n          character?\n    21.4. How do I insert the current date/time stamp into the file?\n    21.5. How do I prevent an abbreviation from expanding in insert mode?\n\nSECTION 22 - RECORD AND PLAYBACK\n    22.1. How do I repeat an editing operation (insertion, deletion, paste,\n          etc)?\n    22.2. How I record and repeat a set of key sequences?\n    22.3. How do I edit/modify a recorded set of key sequences?\n    22.4. How do I write recorded key sequences to a file?\n    22.5. I am using register 0 to record my key sequences (i.e. q0 ....\n          q). In the recorded key sequences, I am yanking some text.  After\n          the first replay of the recorded key sequence, I am no longer\n          able to play it back.\n\nSECTION 23 - AUTOCOMMANDS\n    23.1. How do I execute a command when I try to modify a read-only file?\n    23.2. How do I execute a command every time when entering a buffer?\n    23.3. How do I execute a command every time when entering a window?\n    23.4. From an autocmd, how can I determine the name of the file or the\n          buffer number for which the autocommand is executed?\n    23.5. How do I automatically save all the changed buffers whenever Vim\n          loses focus?\n    23.6. How do I execute/run a function when Vim exits to do some\n          cleanup?\n\nSECTION 24 - SYNTAX HIGHLIGHT\n    24.1. How do I turn off/on syntax highlighting?\n    24.2. How do I change the background and foreground colors used by Vim?\n    24.3. How do I change the highlight colors to suit a dark/light\n          background?\n    24.4. How do I change the color of the line numbers displayed when the\n          `:set number` command is used?\n    24.5. How do I change the background color used for a Visually selected\n          block?\n    24.6. How do I highlight the special characters (tabs, trailing spaces,\n          end of line, etc) displayed by the 'list' option?\n    24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that\n          Vim uses the specified colorscheme every time?\n    24.8. Vim syntax highlighting is broken. When I am editing a file, some\n          parts of the file is not syntax highlighted or syntax highlighted\n          incorrectly.\n    24.9. Is there a built-in function to syntax-highlight the\n          corresponding matching bracket?\n    24.10. How do I turn off the C comment syntax highlighting?\n    24.11. How do I add my own syntax extensions to the standard syntax\n           files supplied with Vim?\n    24.12. How do I replace a standard syntax file that comes with the Vim\n           distribution with my own syntax file?\n    24.13. How do I highlight all the characters after a particular column?\n    24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n           highlighting into a HTML file?\n    24.15. How do I list the definition of all the current highlight\n           groups?\n    24.16. How can I embed one syntax highlighting language into another\n           one?\n\nSECTION 25 - VIM SCRIPT WRITING\n    25.1. How do I list the names of all the scripts sourced by Vim?\n    25.2. How do I debug Vim scripts?\n    25.3. How do I locate the script/plugin which sets a Vim option?\n    25.4. I am getting some error/informational messages from Vim (possibly\n          when running a script), the messages are cleared immediately. How\n          do I display the messages again?\n    25.5. How do I save and restore a plugin specific information across\n          Vim invocations?\n    25.6. How do I start insert mode from a Vim function?\n    25.7. How do I change the cursor position from within a Vim function?\n    25.8. How do I check the value of an environment variable in the .vimrc\n          file?\n    25.9. How do I check whether an environment variable is set or not from\n          a Vim function?\n    25.10. How do I call/use the Vim built-in functions?\n    25.11. I am using some normal mode commands in my Vim script. How do I\n           avoid using the user-defined mappings for these normal mode\n           commands and use the standard Vim functionality for these normal\n           mode commands?\n    25.12. How do I get a visually selected text into a Vim variable or\n           register?\n    25.13. I have some text in a Vim variable \"myvar\". I would like to use\n           this variable in a `:s` substitute command to replace a text\n           \"mytext\". How do I do this?\n    25.14. A Vim variable (bno) contains a buffer number. How do I use this\n           variable to open the corresponding buffer?\n    25.15. How do I store the value of a Vim option into a Vim variable?\n    25.16. I have copied and inserted some text into a buffer from a Vim\n           function. How do I indent the inserted text from the Vim\n           function?\n    25.17. How do I get the character under the cursor from a Vim script?\n    25.18. How do I get the name of the current file without the extension?\n    25.19. How do I get the basename of the current file?\n    25.20. How do I get the output from a Vim function into the current\n           buffer?\n    25.21. How do I call external programs from a Vim function?\n    25.22. How do I get the return status of a program executed using the\n           `:!` command?\n    25.23. How do I determine whether the current buffer is modified or\n           not?\n    25.24. I would like to use the carriage return character in a normal\n           command from a Vim script. How do I specify the carriage return\n           character?\n    25.25. How do I split long lines in a Vim script?\n    25.26. When I try to \"execute\" my function using the `:execute Myfunc()`\n           command, the cursor is moved to the top of the current buffer.\n           Why?\n    25.27. How do I source/execute the contents of a register?\n    25.28. After calling a Vim function or a mapping, when I press the \"u\"\n           key to undo the last change, Vim undoes all the changes made by\n           the mapping/function. Why?\n    25.29. How can I call a function defined with s: (script local\n           function) from another script/plugin?\n    25.30. Is it possible to un-source a sourced script? In other words,\n           reverse all the commands executed by sourcing a script.\n\nSECTION 26 - PLUGINS\n    26.1. How do I set different options for different types of files?\n    26.2. I have downloaded a Vim plugin or a syntax file or a indent file,\n          or a color scheme or a filetype plugin from the web. Where should\n          I copy these files so that Vim will find them?\n    26.3. How do I extend an existing filetype plugin?\n    26.4. How do I turn off loading the Vim plugins?\n    26.5. How do I turn on/off loading the filetype plugins?\n    26.6. How do I override settings made in a file type plugin in the\n          global ftplugin directory for all the file types?\n    26.7. How do I disable the Vim directory browser plugin?\n    26.8. How do I set the filetype option for files with names matching a\n          particular pattern or depending on the file extension?\n\nSECTION 27 - EDITING PROGRAM FILES\n    27.1. How do I enable automatic indentation for C/C++ files?\n    27.2. How do I configure the indentation used for C/C++ files?\n    27.3. How do I turn off the automatic indentation feature?\n    27.4. How do I change the number of space characters used for the\n          automatic indentation?\n    27.5. I am editing a C program using Vim. How do I display the\n          definition of a macro or a variable?\n    27.6. I am editing a C program using Vim. How do I jump to the\n          beginning or end of a code block from within the block?\n    27.7. When editing C++ files and when inserting new lines above or\n          below a comment (//) line, Vim automatically inserts the C++\n          comment character (//) at the beginning of the line. How do I\n          disable this? (*Updated*)\n    27.8. How do I add the comment character \"#\" to a set of lines at the\n          beginning of each line?\n    27.9. How do I edit a header file with the same name as the\n          corresponding C source file?\n    27.10. How do I automatically insert comment leaders while typing\n           comments?\n\nSECTION 28 - QUICKFIX\n    28.1. How do I build programs from Vim?\n    28.2. When I run the make command in Vim I get the errors listed as the\n          compiler compiles the program. When it finishes this list\n          disappears and I have to use the `:clist` command to see the error\n          message again. Is there any other way to see these error\n          messages?\n    28.3. How can I perform a command for each item in the\n          quickfix/location list?\n\nSECTION 29 - FOLDING\n    29.1. How do I extend the Vim folding support?\n    29.2. When I enable folding by setting the 'foldmethod' option, all the\n          folds are closed. How do I prevent this?\n    29.3. How do I control how many folds will be opened when I start\n          editing a file?\n    29.4. How do I open and close folds using the mouse?\n    29.5. How do I change the text displayed for a closed fold?\n    29.6. How do I store and restore manually created folds across\n          different Vim invocations?\n    29.7. I have enabled syntax based folding. Why is Vim so slow?\n\n\nSECTION 30 - VIM WITH EXTERNAL APPLICATIONS\n    30.1. Can I run a shell inside a Vim window?\n    30.2. How do I pass the word under the cursor to an external command?\n    30.3. How do I get the output of a shell command into a Vim buffer?\n    30.4. How do I pipe the contents of the current buffer to an external\n          command and replace the contents of the buffer with the output\n          from the command?\n    30.5. How do I sort a section of my file?\n    30.6. How do I use Vim as a pager?\n    30.7. How do I view Unix man pages from inside Vim?\n    30.8. How do I change the diff command used by the Vim diff support?\n    30.9. How do I use the Vim diff mode without folding?\n\nSECTION 31 - GUI VIM\n    31.1. How do I create buffer specific menus?\n    31.2. How do I change the font used by GUI Vim?\n    31.3. When starting GUI Vim, how do I specify the location of the GVIM\n          window?\n    31.4. How do I add a horizontal scrollbar in GVim?\n    31.5. How do I make the scrollbar appear in the left side by default?\n    31.6. How do I remove the Vim menubar?\n    31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the\n          menu starting with that letter is selected. I don't want this\n          behavior as I want to map the <Alt>-<key> combination. How do I do\n          this?\n    31.8. Is it possible to scroll the text by dragging the scrollbar so\n          that the cursor stays in the original location?\n    31.9. How do I get gvim to start browsing files in a particular\n          directory when using the `:browse` command?\n    31.10. For some questions, like when a file is changed outside of Vim,\n           Vim displays a GUI dialog box. How do I replace this GUI dialog\n           box with a console dialog box?\n    31.11. I am trying to use GUI Vim as the editor for my xxx application.\n           When the xxx application launches GUI Vim to edit a file, the\n           control immediately returns to the xxx application. How do I\n           start GUI Vim, so that the control returns to the xxx\n           application only after I quit Vim?\n    31.12. Why does the \"Select Font\" dialog doesn't show all the fonts\n           installed in my system?\n    31.13. How do I use the mouse in Vim command-line mode?\n    31.14. When I use the middle mouse button to scroll text, it pastes the\n           last copied text. How do I disable this behavior?\n    31.15. How do I change the location and size of a GUI Vim window?\n    31.16. When splitting the Vim window vertically, Vim changes\n           the position.\n\nSECTION 32 - VIM ON UNIX\n    32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim\n          freezes. What should I do now?\n    32.2. I am seeing weird screen update problems in Vim. What can I do to\n          solve this screen/display update problems?\n    32.3. I am using the terminal/console version of Vim. In insertmode,\n          When I press the backspace key, the character before the cursor\n          is not erased. How do I configure Vim to do this?\n    32.4. I am using Vim in a xterm. When I quit Vim, the screen contents\n          are restored back to the original contents. How do I disable\n          this?\n    32.5. When I start Vim, it takes quite a few seconds to start. How do I\n          minimize the startup time?\n    32.6. How can I make the cursor in gvim in unix stop blinking?\n    32.7. How do I change the menu font on GTK Vim?\n    32.8. How do I prevent CTRL-Z from suspending Vim?\n    32.9. When I kill the xterm running Vim, the Vim process continues to\n          run and takes up a lot of CPU (99%) time. Why is this happening?\n    32.10. How do I get the Vim syntax highlighting to work in a Unix\n           terminal?\n\nSECTION 33 - VIM ON MS-WINDOWS\n    33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode.\n          What happened?\n    33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do\n          I configure Vim to treat CTRL-Y as CTRL-Y?\n    33.3. How do I start GUI Vim in a maximized window always?\n    33.4. After doing some editing operations, Vim freezes. The cursor\n          becomes an empty rectangle. I am not able enter any characters.\n          What is happening?\n    33.5. I am using Windows XP, the display speed of maximized GVim is\n          very slow. What can I do to speed the display updates?\n    33.6. What are the recommended settings for using Vim with cygwin?\n    33.7. I am trying to use GNU diff with Vim diff mode. When I run the\n          diff from command line, it works. When I try to use the diff with\n          Vim it doesn't work. What should I do now?\n    33.8. Is it possible to use Vim as an external editor for MS-Windows\n          Outlook email client?\n    33.9. I am using Vim to edit HTML files. How do I start internet\n          explorer with the current file to preview the HTML file?\n    33.10. I would like to use Vim with Microsoft Visual Studio. How do I\n           do this?\n    33.11. Where do I place the _vimrc and _gvimrc files?\n    33.12. Every time I save a file, Vim warns about the file being changed\n           outside of Vim. Why?\n\nSECTION 34 - PRINTING\n    34.1. How do I print a file along with line numbers for all the lines?\n    34.2. How do I print a file with the Vim syntax highlighting colors?\n\nSECTION 35 - BUILDING VIM FROM SOURCE\n    35.1. How do I build Vim from the sources on a Unix system?\n    35.2. How do I install Vim in my home directory or a directory other\n          than the default installation directory in Unix?\n    35.3. How do I build Vim from the sources on a MS-Windows system?\n    35.4. The Vim help, syntax, indent files are missing from my Vim\n          installation. How do I install these files?\n    35.5. I have built Vim from the source and installed the Vim package\n          using \"make install\". Do I need to keep the Vim source directory?\n    35.6. How do I determine the Vim features which are enabled at compile\n          time?\n    35.7. Can I build Vim without the GUI support?\n    35.8. When building Vim on a Unix system, I am getting \"undefined\n          reference to term_set_winsize\" error. How do I resolve this\n          error?\n    35.9. Vim configure keeps complaining about the lack of gtk-config\n          while trying to use GTK 2.03. This is correct, since in GTK 2\n          they moved to using the generic pkg-config. I can get pkg-config\n          to list the various includes and libs for gtk, but for some\n          reason the configure script still isn't picking this up.\n    35.10. I did successfully download the sources and compiled Vim on\n           Unix. But feature ... still does not work. What is wrong and\n           how can I fix it?\n\nSECTION 36 - VARIOUS\n    36.1. How do I edit binary files with Vim?\n    36.2. How do I disable the visual error flash and the error beep?\n    36.3. How do I display the ascii value of a character displayed in a\n          buffer?\n    36.4. Can I use zero as a count for a Vim command?\n    36.5. How do I disable the Vim welcome screen?\n    36.6. How do I avoid the \"hit enter to continue\" prompt?\n    36.7. How do I invoke Vim from command line to run a group of commands\n          on a group of files?\n    36.8. How do I use a normal mode command from insert mode without\n          leaving the insert mode?\n    36.9. How do I start Vim in insert mode?\n    36.10. How do I use Copy and Paste with Vim?\n    36.11. Why shouldn't I modify the files in the system runtime\n           directory?\n\nSECTION 37 - UNICODE\n    37.1. Is it possible to create Unicode files using Vim?\n    37.2. Which Vim settings are particularly important for editing Unicode\n          files?\n    37.3. What is the 'encoding' option?\n    37.4. How does Vim name the various Unicode encodings?\n    37.5. How does Vim specify the presence or absence of a byte-order\n          mark?\n    37.6. What is the 'fileencoding' option?\n    37.7. What is the 'fileencodings' option?\n    37.8. What is the 'termencoding' option?\n    37.9. What is the 'bomb' option?\n    37.10. Where can I find an example of a typical use of all these\n           options?\n    37.11. How can I insert Unicode characters into a file using Vim?\n    37.12. How can I know which digraphs are defined and for which\n           characters?\n\n\n=============================================================================\n\nSECTION 1 - GENERAL INFORMATION\n\n\n1.1. What is Vim?\n\nVim stands for Vi IMproved. It used to be Vi IMitation, but there are so\nmany improvements that a name change was appropriate. Vim is a text editor\nwhich includes almost all the commands from the Unix program \"Vi\" and a lot\nof new ones. All commands can be given with the keyboard. This has the\nadvantage that you can keep your fingers on the keyboard and your eyes on\nthe screen. For those who want it, there is mouse support and a GUI version\nwith scrollbars and menus.\n\nVim is an editor, not a word processor. A word processor is used mainly\nto do layout of text. This means positioning it, changing the way it\nappears on output. More often than not, the final document is meant to\nbe printed or typeset or what have you, in order to present it in a\npleasing manner to others. Examples of word processors are Microsoft\nWord, FrameMaker, and OpenOffice Writer.\n\nAn editor is simply for entering text. Any typesetting or laying out of the\ndocument is secondary. With an editor, one's main concern is entering text,\nnot making the text look good. Examples of editors other than Vim and Vi\nare Emacs, TextMate, Ultraedit and gedit. And Notepad.\n\nFor more information, read:\n\n    :help intro\n\n\n1.2. Who wrote Vim?\n\nMost of Vim is based on Stevie and was written by Bram Moolenaar, with\ncontributions from too many people to mention here.\n\nFor more information, read:\n\n    :help author\n    :help credits\n\n\n1.3. Is Vim compatible with Vi?\n\nYes. Vim is very much compatible with Vi.  You can use the \"-C\"\ncommand-line flag to start Vim in Vi compatible mode:\n\n    $ vim -C\n\nYou can also use:\n\n    $ vim -u NONE\n\nYou can also set the 'compatible' option to enable Vi compatibility:\n\n    :set compatible\n\nIf you want to make sure, to start Vim in a 'nocompatible' mode to\noriginal Vi, supply the -N command line argument:\n\n    $ vim -N\n\nFor more information, read:\n\n    :help -C\n    :help -N\n    :help 'compatible'\n    :help compatible-default\n\n\n1.4. What are some of the improvements of Vim over Vi?\n\nA short summary of the improvements of Vim over vi is listed below.  The\nlist shows that Vim is a thoroughly modern and feature-packed editor.\nStandard features of modern editors are implemented, and there is an equal\nemphasis on general power-user features and features for programmers.\n\nFeatures to modernise Vi:\n\n  Multi-level undo\n\n     Allows you to set the number of times you can undo your changes in a\n     file buffer. You can also redo an undone change.\n     Also starting with version 7.3 Vim can permanently store your undo\n     information, so that you can undo your changes which you have done\n     in a previous editing session.\n\n  Tabs, Multiple windows and buffers\n\n     Each file can be displayed in its own window. You can move easily from\n     one window to another. Each file opened during a Vim session also has\n     an associated buffer and you can easily jump from one to the other.\n     Also like any modern GUI, Vim supports opening several files in tabs.\n     You can do batch processing for tabs, buffers, windows and the\n     argumentlist.\n\n  Flexible insert mode\n\n     Vim allows you to use the arrow keys while in insert mode to move\n     around in the file. No more hitting <Esc>, moving around, then hitting\n     `i' or `a'.\n\n  Macros\n\n     Vim has a facility which allows you to record a sequence of typed\n     characters and repeat them any number of times.\n\n  Visual mode\n\n     You can highlight sections of text and execute operations on this\n     section of text only.\n\n  Block operators\n\n     Allow selection and highlighting of rectangular blocks of text in\n     order do execute specific operations on them.\n\n  Online help system\n\n     You can easily find help on any aspect of using Vim. Help is displayed\n     in its own window.\n\n  Command-line editing and history\n\n     History allows you to use the arrow keys to repeat or search for a\n     command that has already been typed. Allows you to match the beginning\n     of a command with the beginning of another similar command in the\n     history buffer. You can also edit a command to correct typos or change\n     a few values.\n\n  Command line completion.\n\n     Using the <Tab> key, you can complete commands, options, filenames,\n     etc. as needed.\n\n  Horizontal scrolling.\n\n     Long lines can be scrolled horizontally (with or without the GUI).\n\n  Unicode and internationalization improvements.\n\n     Vim is able to edit files in unicode encoding and uses internally an\n     utf-8 encoding. Additionally Vim can display text right to left\n     oriented.\n\nAdvanced user features:\n\n  Text formatting\n\n     With two keystrokes, you can format large sections of text, without\n     the use of external programs.\n\n  Completion in Insert mode\n\n     Vim provides several different possibilities to complete your text.\n     For example Vim can complete words while you are typing, by matching\n     the current word with other similar words in the file.\n\n  Jump tags\n\n     Just like in an internet browser, you can jump back to previous parts\n     of the text you were editing, and then forward again.  Your brain is\n     thus free to edit instead of navigate.\n\n  Automatic commands\n\n     Commands automatically executed when reading or writing a file,\n     jumping to another buffer, etc.\n\n  Viminfo\n\n     Allows storing of the command line history, marks and registers in a\n     file to be read on startup.  Therefore, you can recall old search\n     patterns, macros, etc., in a new Vim session.\n\n  Mouse support\n\n     The mouse is supported in an xterm and for MS-DOS. It can be used to\n     position the cursor, select the visual area, paste a register, etc.\n\n  Graphical User Interface (GUI)\n\n     There are several different graphical user interfaces available.\n     Also, it's very easy to add your own menus.  Of course, console vim is\n     still supported, and very widely used.\n\n  Scripting language\n\n     Vim has a powerful scripting language so new commands can be created.\n     You can also use Perl, Python, TCL, Lua and Ruby to achieve the same\n     thing!\n\n  Plugins\n\n     Extra functionality implemented via vim commands (regular commands or\n     the scripting language) that is automatically loaded on startup.\n     Examples: file explorer, network editing, enhanced autocompletion,\n     syntax checks.\n     More are being developed and shared on VimOnline all the time.\n\n  Syntax highlighting for many programming languages\n\n     Syntax highlighting (including concealing items) for hundreds of\n     programming languages is supported. Support for others can be\n     added.\n\n  Extended regular expressions\n\n     Vim supports extended regular expressions which are similar in\n     functionality to that of Perl regular expressions.\n\n  Integrated Spell checking\n\n     Spell checking has been integrated into Vim.\n\n  Diff mode\n\n     Vim can highlight the differences between two, three or four files.\n     Identical lines will be folded away and hidden.\n\n  Encryption using the blowfish algorithm\n\n     Vim allows to encrypt your files using the symmetric block cipher\n     blowfish as well as the swap file.\n\n  Extensive customizable\n\n     Vim can be tuned and customized to work like you want by setting\n     options. You can define your own commands, macros and even plugins\n     to extend its capabilities\n\n  Packages\n\n     Packages have been added to keep the installation of the growing\n     number of plugins manageable. This is a convenient way to get one\n     or more plugins, drop them in a directory and keep them updated.\n     Vim will load them automatically, or only when desired.\n\nProgramming performance features:\n\n  Edit-compile-edit speedup\n\n     You can compile within Vim and automatically jump to the location of\n     errors in the source code.\n\n  Indenting for many programming languages\n\n     C, C++, Java, Perl, XML and many other languages can be automatically\n     indented by vim while you type.  Support for others can be added.\n\n  Searching for words in include files\n\n     Vim allows you to search for a match of the word under the cursor in\n     the current and included files.\n\n  Advanced text objects\n\n     Instantly select, delete, copy, indent, format, change case, or ...\n     to all the text between ( and ), or { and }, or < and >, or [ and\n     ].  Or a word, sentence, or paragraph.  Very powerful.\n\n  Folding\n\n     Certain parts of the text can be \"folded\" away.  The best example is\n     the body of a function.  You can get an overview of the code, and then\n     open the fold of the function whose detail you need to see.\n\n  ctags and cscope integration\n\n     Using these two powerful programs, you can jump to a definition of a\n     function from a calling instance of it, and use other tricks to\n     navigate source code.\n\n  Integration of several programming languages\n\n     If you find the internal scripting language not powerful enough, you\n     can extend Vim using Lua, Ruby, Tcl, Perl and Python 2 and 3.\n\n  Asynchronous I/O support\n\n     Vim uses jobs and channels to talk to other programs\n     asynchronously. This allows to have e.g. a compiler run in the\n     background and open the quickfix list as soon as it is finished to\n     fix warnings and errors.\n\n  Timers\n\n     Timers are asynchronous and can fire once or repeatedly to invoke a\n     function to do any work.\n\nFor more information, read:\n\n    :help vi-differences\n\n\n1.5. Is Vim free?\n\nVim is Charityware. There are no restrictions on using or copying Vim, but\nthe author encourages you to make a donation to charity. A document\nexplaining how to do so is included in the distribution.\n\nFor more information, read:\n\n    :help copyright\n\n\n=============================================================================\n\nSECTION 2 - RESOURCES\n\n\n2.1. Where can I learn more about Vim?\n\nYou can post your Vim questions to the vim@vim.org mailing list.  You can\npost your Vim development related questions to the vim-dev@vim.org mailing\nlist. Vim does not have a newsgroup of its own. But the appropriate\nnewsgroup to post to is comp.editors.\n\n\"VimOnline\" is a web page that serves as a de facto homepage for vim,\nalthough the main purpose of it is to gather tips and scripts from\neverywhere.  Get involved!  The URL is https://www.vim.org\n\nFinally, read the Vi FAQ:\n\n    http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\nFinally, there are also some communities, where you can discuss features\nor ask questions:\n\n    https://vi.stackexchange.com\n    https://vim.reddit.com\n\nFor more information, read:\n\n    :help mail-list\n    :help internet\n\n\n2.2. Is there a mailing list available?\n\nThere are several:\n\n    NAME              DESCRIPTION\n    ----------------  ---------------------------------------------\n    vim-announce      Announcements of new releases\n    vim               General discussion\n    vim-dev           Patches, bug reports, development discussions\n    vim-mac           Macintosh discussion\n    vim-fr            General discussion in French\n\nOf these, only vim and vim-dev are of general interest. vim-announce is\nread-only to most people, and its messages are sent to the other lists as\nwell. The remaining four are very low volume.\n\n    ACTION            EMAIL SEND TO\n    ----------------  --------------------------\n    To subscribe:     <NAME>-subscribe@vim.org\n    To unsubscribe:   <NAME>-unsubscribe@vim.org\n    To get help:      <NAME>-help@vim.org\n\nThe available mailing lists are also mentioned here:\n\n    https://www.vim.org/maillist.php\n\n\n2.3. Is there an archive available for the Vim mailing lists?\n\nYes. Visit https://groups.yahoo.com/, where name is one of:\nvimannounce, vim, vimdev, vim-fr, vim-mac, vim-vms.\n\nAlternatively, visit www.gmane.org to find out about GMANE, which allows\nyou to access the mailing lists as though they were newsgroups.  This\noffers some convenience to those who wish to browse the history or casually\nobserve the current threads.\n\n\n2.4. Where can I get the Vim user manual in HTML/PDF/PS format?\n\nYou can download the HTML/PDF/PS format of the Vim user manual from:\n\n    https://vimdoc.sourceforge.net/\n\nNote, the user manual from that page is currently pretty outdated. It's\nbest to either use the documentation that comes with vim or use the\nonline version at https://vimhelp.org\n\nYou can find a pdf version of the full English help, including this faq\n(in letter, A4 and Ipad format) at:\n\n    https://nathangrigg.com/vimhelp/\n\nThis document is cross-referenced, so you can use the hyperlink\nfunctionality.\n\n\n2.5. I have a \"xyz\" (some) problem with Vim. How do I determine if it is a\n     problem with my setup or with Vim?  / Have I found a bug in Vim?\n\nFirst, you need to find out, whether the error is in the actual runtime\nfiles or any plugin that is distributed with Vim or whether it is a\nsimple side effect of any configuration option from your .vimrc or\n.gvimrc. So first, start vim like this:\n\n    vim -u NONE -U NONE -N -i NONE\n\nThis starts Vim in nocompatible mode (-N), without reading your viminfo\nfile (-i NONE), without reading any configuration file (-u NONE for not\nreading .vimrc file and -U NONE for not reading a .gvimrc file) or even\nplugin.\n\nIn this invocation, try to reproduce your problem. If the error\npersists, the chance is good you've found a bug in Vim (see also\nQuestion 2.6.)\n\nIf the error does not occur when starting Vim this way, then the problem\nis either related to some plugin of yours or some setting in one of your\nlocal setup files. You need to find out, what triggers the error, you\ntry starting Vim this way:\n\n    vim -u NONE -U NONE -N\n\nIf the error occurs, the problem is your .viminfo file. Simply delete\nthe viminfo file then. If the error does not occur, try:\n\n    vim -u ~/.vimrc --noplugin -N -i NONE\n\nThis will simply use your .vimrc as configuration file, but not load any\nplugins. If the error occurs this time, the error is possibly caused by\nsome configuration option inside your .vimrc file. Depending on the\nlength of your vimrc file, it can be quite hard to trace the origin\nwithin that file.\n\nThe best way is to add `:finish` command in the middle of your .vimrc.\nThen restart again using the same command line. If the error still\noccurs, the bug must be caused because of a setting in the first half of\nyour .vimrc. If it doesn't happen, the problematic setting must be in\nthe second half of your .vimrc. So move the `:finish` command to the\nmiddle of that half, of which you know that triggers the error and move\nyour way along, until you find the problematic option. If your .vimrc is\n350 lines long, you need at a maximum 9 tries to find the offending line\n(in practise, this can often be further reduced, since often lines\ndepend on each other).\n\nIf the problem does not occur, when only loading your .vimrc file, the\nerror must be caused by a plugin or another runtime file (indent\nautoload or syntax script). Check the output of the `:scriptnames` command\nto see what files have been loaded and for each one try to disable each\none by one and see which one triggers the bug. Often files that are\nloaded by vim, have a simple configuration variable to disable them, but\nyou need to check inside each file separately.\n\nYou can also use the -V command line argument to get more debug\ninformation to analyze the problem:\n\n    $ vim -V2logfile\n\nYou can increase the value passed to the -V argument to get more debug\ninformation. By also specifying a logfile name, this makes sure, the\ndebug messages don't appear on the screen and won't disturb you when\ntrying to reproduce the problem.\n\n\nFor more information, read:\n\n    :help -u\n    :help -U\n    :help -N\n    :help -V\n    :help 'verbose'\n    :help :verbose\n    :help :set-verbose\n\n\n2.6. Where can I report bugs?\n\nFirst collect the required information using the following command:\n\n    :source $VIMRUNTIME/bugreport.vim\n\nNow send the resulting text from the above command to the bugs@vim.org\ne-mail address. There is also a public bug tracker available at\nhttps://github.com/vim/vim/issues. A copy of each message there\nwill be forwarded to the Vim Development list.\n\nThe Vim Development mailing list (see Question 2.2) is a good place to\ndiscuss general bugs.  If the bug you find is with syntax highlighting,\na runtime file, or some other \"added feature\" (i.e. not directly\nprogrammed into vim), attempt to inform the maintainer of that feature.\nHis e-mail address will be mentioned at the top of the corresponding\nruntime file.\n\nFor more information, read:\n\n    :help bug-reports\n\n\n2.7. Where can the FAQ be found?\n\nThe FAQ can be found at https://vimhelp.org/vim_faq.txt.html.\nIt will be auto-generated from the source that is managed in the github\nrepository https://www.github.com/chrisbra/vim_faq (Patches are welcome).\n\nThe repository also includes the faq in different formats, e.g. manpage,\npdf file, html file, plain text version and a version in vim help format.\n\nA slightly older version (which doesn't seem to get updated anymore) can\nstill be found at VimOnline (https://www.vim.org/).\n\n\n2.8. What if I don't find an answer in this FAQ?\n\nThis FAQ covers mainly Vim-specific questions. You may find more\ninformation suitable for most Vi clones by reading the Vi FAQ. It is posted\nregularly on comp.editors. You can also find a copy at\n\n    http://www.faqs.org/faqs/editor-faq/vi/part1/index.html\n\nAlso, since Vim has gathered so many features in the last few years,\nsuccessfully documenting the frequently asked questions here is a\nnear-impossible task. To make it possible, please email the maintainer if\nyou have a good question. A good question is one that you've tried to\nanswer yourself (remember, Vim has great documentation) but struggled.\n\n\n2.9. I have a patch for implementing a Vim feature. Where can I send this\n     patch?\n\nYou can send your patches to the Vim developer mailing list\nvim-dev@vim.org.\n\nFor more information, read:\n\n    :help vim-dev\n\n\n2.10. I have a Vim tip or developed a new Vim syntax/indent/filetype/\n      compiler plugin or developed a new script or a colorscheme.\n      Is there a public website where I can upload this?\n\nYes. You can use the Vim Online website to upload your plugins/scripts,\ncolorschemes, etc. The site is at https://www.vim.org\nNowadays people also seem to share their plugins/runtime files at\ngithub.\n\nTips can also be shared in the Wiki which you can find at\n\n    http://vim.wikia.com\n\n\n=============================================================================\n\nSECTION 3 - AVAILABILITY\n\n\n3.1. What is the latest version of Vim?\n\nThe latest version of Vim is 8.2 released on 12th December 2019.\n\nThe release history of different versions of Vim is below:\n\n    VERSION         RELEASE DATE\n    --------------  --------------------\n    Version 9.1     2nd January, 2024\n    Version 9.0     28th June, 2022\n    Version 8.2     12th December, 2019\n    Version 8.1     17th May, 2018\n    Version 8.0     12th September, 2016\n    Version 7.4     10th August, 2013\n    Version 7.3     15th August, 2010\n    Version 7.2     9th August, 2008\n    Version 7.1     12th May, 2007\n    Version 7.0     8th May, 2006\n    Version 6.4     15th October, 2005\n    Version 6.3     8th June, 2004\n    Version 6.2     1st June, 2003\n    Version 6.1     24th March, 2002\n    Version 6.0     27th September, 2001\n    Version 5.8     31st May, 2001\n    Version 5.7     24th June, 2000\n    Version 5.6     16th January, 2000\n    Version 5.5     21st September, 1999\n    Version 5.4     26th July, 1999\n    Version 5.3     31st August, 1998\n    Version 5.2     24th August, 1998\n    Version 5.1     7th April, 1998\n    Version 5.0     19th February, 1998\n    Version 4.6     13th March, 1997\n    Version 4.5     17th October, 1996\n    Version 4.2     5th July, 1996\n    Version 4.0     29th May, 1996\n    Version 3.0     12th August, 1994\n    Version 2.0     21st December, 1993\n    Version 1.27    23rd April, 1993\n    Version 1.17    21st April, 1992\n    Version 1.14    2nd November, 1991\n\nIf you are interested in the old release history, check out the\nvim-history git repository:\nhttps://github.com/vim/vim-history\nand especially for the release history:\nhttps://github.com/vim/vim-history#release-history\n\nFor more information, read:\n\n    :help new-9\n    :help new-8\n    :help changed-9.1\n    :help changed-8.2\n    :help changed-8.1\n\n\n3.2. Where can I find the latest version of Vim?\n\nYou can download the sources for the latest version of Vim from the\nGithub repository. The URL for this site is\n\n    https://github.com/vim/vim\n\nA mercurial mirror is also available:\n\n    https://www.vim.org/hgweb/vim/\n\nSome users keep updated repositories for distributing latest binary\nversions of Vim. You can find those repositories here:\n\n    http://vim.wikia.com/wiki/Where_to_download_Vim\n\n\n3.3. What platforms does it run on?\n\nAll Unix platforms.\nAll Windows platforms (10 and later).\nAmiga, Macintosh, MachTen, VMS, IBM z/OS.\n\nFor MS-DOS support has been removed with the latest releases of Vim.\n16-bit DOS: latest supported version 7.1\n32-bit DOS: latest supported version 7.3\nWindows XP and Visat: latest supported version 9.0\n\n\n3.4. Where can I download the latest version of the Vim runtime files?\n\nYou can download the latest version of the Vim runtime files (syntax files,\nfiletype plugins, compiler files, color schemes, documentation, indentation\nfiles and keymaps) from the Vim github repository\n\n    https://github.com/vim/vim/tree/master/runtime\n\nAnother way of downloading the runtime files is this:\n\n    wget https://github.com/vim/vim/archive/master.tar.gz -O- |\n    tar zfx - vim-master/runtime/ --strip-components=1\n\nSee also:\n\n    https://www.vim.org/runtime.php\n\n\n=============================================================================\n\nSECTION 4 - HELP\n\n\n4.1. How do I use the help files?\n\nHelp can be found for all functions of Vim. In order to use it, use the\n`:help` command.  This will bring you to the main help page. On that first\npage, you will find explanations on how to move around. Basically, you move\naround in the help pages the same way you would in a read-only document.\nYou can jump to specific subjects by using tags. This can be done in two\nways:\n\n   * Use the CTRL-] command while standing on the name of a command\n     or option. This only works when the tag is a keyword.\n     <Ctrl-LeftMouse> and g<LeftMouse> work just like CTRL-].\n\n   * use the `:tag <subject>` command. This works with all characters.\n\nUse CTRL-T to jump back to previous positions in the help files. Use\n`:q` to close the help window.\n\nIf you want to jump to a specific subject on the help pages, use\n`:help {subject}` . If you don't know what to look for, try `:help index`\nto get a list of all available subjects. Use the standard search keys to\nlocate the information you want.\nYou can abbreviate the `:help` command as `:h`.\n\nFor searching the help, see the next Question 4.2.\n\nFor more information, read:\n\n    :help online-help\n\n\n4.2. How do I search for a keyword in the Vim help files?\n\na)  You can press the CTRL-D key after typing the help keyword to get a\n    list of all the help keywords containing the supplied pattern. You can\n    also use the meta characters like *, \\+, etc to specify the help\n    search pattern:\n\n    :help init<C-D>\n    :help str*()<C-D>\n    :help '*indent<C-D>\n\nb)  You can press the <Tab> key after typing a partial help keyword to expand\n    to the matching keyword. You can continue to press the <Tab> key to see\n    other keyword matches.\n\nc)  From the help window, you can use the `:tag` command to search for\n    keywords. For example,\n\n    :tselect /window\n\n    This command will list all the help keywords containing the text\n    \"window\". You can select one from the list and jump to it.\n\nd)  You can use the `:helpgrep` command to search for the given text in\n    all the help files. The quickfix window will be opened with all the\n    matching lines.\n\nFor more information, read:\n\n    :help help-summary\n    :help c_CTRL-D\n    :help c_<Tab>\n    :help :tselect\n    :help :help\n    :help :helpgrep\n\n\n4.3. I am getting an error message E123, what did I do wrong?\n\nYou can get more information about the error and the error message using:\n\n    :help E123\n\nFor more information, read:\n\n    :help error-messages\n\n\n4.4. Where can I read about the various modes in Vim?\n\nYou can get information about the different modes in Vim by reading\n\n    :help vim-modes\n\n\n4.5. How do I generate the Vim help tags file after adding a new Vim help\n     file?\n\nYou can use the `:helptags` command to regenerate the Vim help tag file\nfrom within Vim. For example:\n\n    :cd $VIMRUNTIME/doc\n    :helptags .\n\nTo update all \"doc\" directories in your 'runtimepath', you can use\n\n    :helptags ALL\n\nFor more information, read:\n\n    :help :helptags\n    :help add-local-help\n\n\n4.6. Can I use compressed versions of the help files?\n\nYes. You can compress the help files and still be able to view them with\nVim.  This makes accessing the help files a bit slower and requires the\n\"gzip\" utility. Follow these steps to compress and use the Vim help files:\n\n- Compress all the help files using \"gzip doc/*.txt\".\n\n- Edit the \"doc/tags\" file and change the \".txt\" to \".txt.gz\" using\n        :%s=\\(\\t.*\\.txt\\)\\t=\\1.gz\\t=\n\n- Add the following line to your vimrc:\n        set helpfile={dirname}/help.txt.gz\n\nWhere {dirname} is the directory where the help files are.  The gzip.vim\nplugin supplied with the standard Vim distribution will take care of\ndecompressing the files.  You must make sure that $VIMRUNTIME is set to\nwhere the other Vim files are, when they are not in the same location as\nthe compressed \"doc\" directory.\n\nNote, that the `:helpgrep` command does not work with compressed help pages.\n\nFor more information, read:\n\n    :help gzip-helpfile\n    :help 'helpfile'\n    :help gzip\n    :help $VIMRUNTIME\n\n\n=============================================================================\n\nSECTION 5 - EDITING A FILE\n\n\n5.1. How do I load a file in Vim for editing?\n\nThere are several ways to load a file for editing. The simplest is to\nuse the `:e` (:edit) command:\n\n    :e <filename>\n\nYou can also use the `:n` (:next) command to load files into Vim:\n\n    :n <filename(s)>\n\nYou can also use the `:args` command to load files into Vim:\n\n    :args <filename(s)>\n\nFor more information, read:\n\n    :help usr_07.txt\n    :help edit-files\n    :help :edit\n    :help :next_f\n    :help :args_f\n\n\n5.2. How do I save the current file in another name (save as) and edit a\n     new file?\n\nYou can use the `:saveas` command to save the current file in another name:\n\n    :saveas <newfilename>\n\nAlternatively, you can also use the following commands:\n\n    :w <newfilename>\n    :edit #\n\nYou can also use the `:file` command, followed by `:w` command:\n\n    :file <newfilename>\n    :w\n\nFor more information, read:\n\n    :help 07.7\n    :help :saveas\n    :help :file_f\n    :help :w\n\n\n5.3. How do I change the current directory to the directory of the current\n     file?\n\nYou can use the following command to change the current directory to the\ndirectory of the current file:\n\n    :cd %:p:h\n\nTo automatically change the current directory to the directory of the\ncurrent file, simply set the option 'autochdir'.\n\n    :set autochdir\n\nFor more information, read:\n\n    :help :cd\n    :help :lcd\n    :help filename-modifiers\n    :help autocommand\n    :help 'acd'\n    :help getcwd()\n\n\n5.4. How do I write a file without the line feed (EOL) at the end of the\n     file?\n\nYou can turn off the 'eol' option and turn on the 'binary' option to write\na file without the EOL at the end of the file:\n\n    :set binary\n    :set noeol\n    :w\n\nAlternatively, you can use:\n\n    :set noeol\n    :w ++bin\n\nIf you rather only like Vim not to write missing EOLs, you can reset the\n'fixeol' option. This needs a Vim newer 7.4.785, so you should wrap this\nin an if condition in your .vimrc like this:\n\n    if exists('+fixeol')\n        set nofixeol\n    endif\n\nThis has the advantage of avoiding the many side effects that the\n'binary' option has.\n\nFor more information, read:\n\n    :help 'endofline'\n    :help 'fixeol'\n    :help 'binary'\n    :help 23.4\n\n\n5.5. How do I configure Vim to open a file at the last edited location?\n\nVim stores the cursor position of the last edited location for each buffer\nin the '\"' register. You can use the following autocmd in your .vimrc or\n.gvimrc file to open a file at the last edited location:\n\n    au BufReadPost * if line(\"'\\\"\") > 0 && line(\"'\\\"\") <= line(\"$\") |\n                         \\ exe \"normal! g`\\\"\" | endif\n\nAlternatively, you can simply source the vimrc_example.vim file, which is\ndistributed with Vim.\n\nFor more information, read:\n\n    :help '\"\n    :help last-position-jump\n    :help vimrc_example.vim\n\n\n5.6. When editing a file in Vim, which is being changed by an external\n     application, Vim opens a warning window (like the confirm dialog) each\n     time a change is detected. How do I disable this warning?\n\nYou can set the Vim 'autoread' option to automatically read the file again\nwhen it is changed outside of Vim:\n\n    :set autoread\n\nYou can also use the following autocommand:\n\n    autocmd FileChangedShell *\n          \\ echohl WarningMsg |\n          \\ echo \"File has been changed outside of vim.\" |\n          \\ echohl None\n\nFor more information, read:\n\n    :help 'autoread'\n    :help FileChangedShell\n    :help timestamp\n    :help :checktime\n\n\n5.7. How do I edit a file whose name is under the cursor?\n\nYou can use the gf command to edit a file whose name is under the cursor.\nYou can use the CTRL-W f command to edit the file in a new window and\nfinally you can use CTRL-W gf top open a new tab page that contains the\nfile name under the cursor.\n\nFor more information, read:\n\n    :help gf\n    :help CTRL-W_f\n    :help CTRL-W_gf\n    :help 'isfname'\n    :help 'path'\n    :help 'suffixesadd'\n    :help 'includeexpr'\n\n\n5.8. How do I reload/re-edit the current file?\n\nYou can use the `:edit` command, without specifying a file name, to reload\nthe current file.  If you have made modifications to the file, you can use\n`:edit!` to force the reload of the current file (you will lose your\nmodifications, but depending on your 'undoreload' settings, those\nchanges might be saved into the undo history).\n\nFor more information, read:\n\n    :help :edit\n    :help :edit!\n    :help 'confirm'\n    :help 'undoreload'\n\n\n5.9. How do I autosave a file periodically?\n\nVim doesn't support auto-saving a file periodically.\n\nFor more information, read:\n\n    :help 'updatetime'\n    :help CursorHold\n    :help swap-file\n\n\n5.10. How do I open a file in read-only mode?\n\nYou can open a file in read-only mode using the `:view` command:\n\n    :view <filename>\n\nThis command sets the 'readonly' option for the opened buffer. You can also\nuse the \"-R\" command-line option to open a file in read-only mode:\n\n    $ vim -R <filename>\n\nYou can also use the symbolic link executable \"view\" to open a file in\nread-only mode from the command-line:\n\n    $ view <filename>\n\nFor more information, read:\n\n    :help 07.6\n    :help 'readonly'\n    :help 'modifiable'\n    :help :view\n    :help :sview\n    :help view\n    :help -R\n    :help -M\n\n\n5.11. How do I open a file for editing without saving the modifications to\n      the current file?\n\nYou can open a file for editing without saving the modifications to the\ncurrent file and without losing the changes using one of the following\nmethods:\n\n    :split <new_filename>\n    :new <new_filename>\n\nYou can also set the 'hidden' option and edit a new file:\n\n    :set hidden\n    :e <new_filename>\n\nIf you want to discard the changes made to the current file and load\nanother file for editing, then you can use the following command:\n\n    :e! <new_filename>\n\nFor more information, read:\n\n    :help :edit!_f\n    :help 'hidden'\n    :help :split\n    :help :new\n\n\n5.12. How do I reduce the loading time for very large files in Vim?\n\nYou can use the following settings to reduce the loading time for\nvery large files in Vim:\n\n    :set lazyredraw\n    :set noswapfile\n    :set undolevels=-1\n    :set eventignore=all\n    :set nohidden\n    :set syntax=off\n\nNote that the above settings will disable many Vim features including the\nfollowing: Swap files support for crash recovery, undo support, syntax\nhighlighting, filetype detection and other autocommand based features.\n\nThere is also the LargeFile plugin available at\n\n    https://www.vim.org/scripts/script.php?script_id=1506\n\nwhich automatically sets these options, when working with large files\n(it is configurable, what is considered to be a large file, by default,\nit is 100MB).\n\n\n=============================================================================\n\nSECTION 6 - EDITING MULTIPLE FILES\n\n\n6.1. How do I open multiple files at once from within Vim?\n\nMake a difference between args, buffers, tabs and windows. They are all\ndifferent things in VIM.\n\nargs is a list of arguments. Buffers are place to edit text, almost\nalways attached to a file but not necessarily. Window is a place for a\nbuffer and tab is set of windows, better name would be \"layout\".\n\nThere are several ways to open multiple files at once from within Vim. You\ncan use the `:next` command to specify a group of files:\n\n    :next f1.txt f2.txt\n    :next *.c\n\nYou can use the `:args` command to specify a group of files as arguments:\n\n    :args f1.txt f2.txt\n    :args *.c\n\nAfter loading the files, you can use the `:next` and `:prev` command to\nswitch between the files.\n\nTo execute command for all files in argument-list use `:argdo`\n\nFor more information, read:\n\n    :help 07.2\n    :help :next\n    :help :args_f\n    :help argument-list\n\n\n6.2. How do I switch between multiple files/buffers in Vim?\n\nTo list all buffers use `:ls`, to list buffers without file attached to\n(also known as unlisted buffers, ex. scratch buffer and help-window) use\n`:ls!`\n\nThere are several ways to switch between multiple files. You can use the\n`:buffer` command to switch between multiple files. You can also shorten\ncommand as `:b` and use only part of the filename. For example,\n\n    :buffer file1\n    :buffer file2\n    :b e2\n\nYou can also use <TAB> after `:b` for autocompletion. Try also `:b`\nfollowed by CTRL-D to see all available buffers. This works also for\n`:e`.\n\nYou can also use the CTRL-^ key to switch between buffers. By specifying a\ncount before pressing the key, you can edit the buffer with that number.\nWithout the count, you can edit the alternate buffer by pressing CTRL-^\n\nYou can also use the `:e #` command to edit a particular buffer:\n\n    :e #5\n\nTo close a buffer use `:bd` -command.\n\nTo execute command for all files in buffer-list use `:bufdo`\n\nFor more information, read:\n\n    :help edit-files\n    :help :buffer\n    :help CTRL-^\n    :help alternate-file\n    :help 22.4\n    :help 07.3\n\n\n6.3. How do I open several files in Vim, with each file in a separate\n     window/tab?\n\nYou can use the -o and -O Vim command line arguments to open multiple files\nin separate horizontally or vertically split Vim windows. For example:\n\n    $ vim -o3 f1.txt f2.txt f3.txt\n\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate horizontally split Vim windows.\n\n    $ vim -O3 f1.txt f2.txt f3.txt\n\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate vertically split Vim windows.\n\n    $ vim -p f1.txt f2.txt f3.txt\n\nThe above command will open the files f1.txt, f2.txt and f3.txt in three\nseparate tab windows. The option 'tabpagemax' defines, how many tabpages\ncan be opened at the same time, by default it is set to 10.\n\nFor more information, read:\n\n    :help -o\n    :help -O\n    :help -p\n    :help startup-options\n    :help 'tabpagemax'\n\n\n6.4. How do I configure Vim to autoload several files at once similar to\n     \"work-sets\" or \"projects\"?\n\nYou can use the `:mksession` and the `:mkview` commands to autoload several\nfiles in Vim.\n\nThe `:mksession` command creates a Vim script that restores the current\nediting session. You can use the `:source` command to source the file\nproduced by the mksession command.\n\nThe `:mkview` command creates a Vim script that restores the contents of\nthe current window. You can use the `:loadview` command to load the view\nfor the current file.\n\nFor more information, read:\n\n    :help 21.4\n    :help 21.5\n    :help views-sessions\n    :help 'sessionoptions'\n    :help :mksession\n    :help :source\n    :help v:this_session\n    :help :mkview\n    :help :loadview\n    :help 'viewdir'\n    :help buffers\n\n\n6.5. Is it possible to open multiple top level windows in a single instance\n     of Vim similar to Nedit or Emacs?\n\nNo. It is currently not possible to open multiple top-level windows in a\nsingle instance of Vim. This feature is in the todo list.\n\n\n6.6. How do I browse/explore directories from within Vim?\n\nYou can use the netrw.vim plugin, supplied with the standard Vim\ninstallation, to browse/explore directories from within Vim. You can start\nthe file explorer using one of the following commands:\n\n    :e <directory>\n    :Explore\n    :Sexplore\n    :Vexplore\n    :Texplore\n\nFrom the file explorer, you can browse through directories, rename, delete\nand edit files.\n\nFor more information, read:\n\n    :help netrw.vim\n    :help 22.1\n\n\n6.7. How do I edit files over a network using ftp/scp/rcp/http?\n\nYou can use the netrw.vim plugin, supplied with the standard Vim package,\nto edit files over a network using ftp/scp/rcp/http. Using this plugin, Vim\nwill transparently load and save the files over ftp/scp/rcp/http. For\nexample, to edit a file over ftp, you can use the following command:\n\n    $ vim ftp://machine/path\n\nFor more information, read:\n\n    :help netrw.vim\n\n\n=============================================================================\n\nSECTION 7 - BACKUP\n\n\n7.1. When I edit and save files, Vim creates a file with the same name as\n     the original file and a \"~\" character at the end. How do I stop Vim\n     from creating this file? (or) How do I disable the Vim backup file\n     feature?\n\nYou have set the 'backup' option, so Vim creates a backup file when saving\nthe original file. You can stop Vim from creating the backup file, by\nclearing the option:\n\n    :set nobackup\n\nNote that, by default this option is turned off. You have explicitly\nenabled the 'backup' option in one of the initialization files. You may\nalso have to turn off the 'writebackup' option:\n\n    :set nowritebackup\n\nFor more information, read:\n\n    :help 07.4\n    :help backup-table\n    :help 'backup'\n    :help 'writebackup'\n    :help 'backupskip'\n    :help 'backupdir'\n    :help 'backupext'\n    :help 'backupcopy'\n    :help backup\n\n\n7.2. When I edit and save files, Vim creates a file with the same name as\n     the original file and a \"un~\" extension at the end. How do I stop Vim\n     from creating this file (or) How do I disable the Vim undofile feature?\n\nVim 7.3 contains as new feature persistent undo, that is, undo information\nwon't be lost when quitting Vim and be stored in a file that ends with\n\".un~\" You have set the 'undofile' option, so Vim creates an undo file when\nsaving the original file. You can stop Vim from creating the backup file,\nby clearing the option:\n\n    :set noundofile\n\nNote that, by default this option is turned off. You have explicitly\nenabled the 'undofile' option in one of the initialization files. If you\nwant your undofiles to be stored only in a particular directory, you can\npoint the 'undodir' option to a directory that will contain all your\naggregated undofiles.\n\nFor more information, read:\n\n    :help 'undodir'\n    :help 'undofile'\n    :help undo-persistence\n\n\n7.3. How do I configure Vim to store all the backup files in a particular\n     directory?\n\nYou can configure Vim to store all the backup files in a particular\ndirectory using the 'backupdir' option. For example, to store all the\nbackup files in the ~/backup directory, you can use the following command:\n\n    :set backupdir=~/backup\n\nFor more information, read:\n\n    :help 07.4\n    :help 'backupdir'\n    :help backup\n\n\n7.4. When I save a file with Vim, the file permissions are changed.\n     How do I configure Vim to save a file without changing the file\n     permissions?\n\nThis may happen, if the 'backupcopy' option is set to \"no\" or \"auto\". Note\nthat the default value for this option is set in such a way that this will\ncorrectly work in most of the cases. If the default doesn't work for you,\ntry setting the 'backupcopy' option to \"yes\" to keep the file permission\nwhen saving a file:\n\n    :set backupcopy=yes\n\nThis applies, only if you have configured Vim to make a backup whenever\noverwriting a file. By default, Vim will not backup files.\n\nFor more information, read:\n\n    :help 'backupcopy'\n    :help backup\n    :help 'backup'\n    :help 'writebackup'\n\n\n=============================================================================\n\nSECTION 8 - BUFFERS\n\n\n8.1. I have made some modifications to a buffer. How do I edit another\n     buffer without saving the modified buffer and also without losing the\n     modifications?\n\nYou can set the 'hidden' option to edit a file without losing modifications\nto the current file:\n\n    :set hidden\n\nBy setting the 'hidden' option, you can also save the modification history\n(undo-history) for the buffer. Otherwise, as you switch between files, the\nundo-history will be lost (unless you use persistent undofiles).\n\nFor more information, read:\n\n    :help 'hidden'\n    :help hidden-quit\n    :help :hide\n\n\n8.2. How do I configure Vim to auto-save a modified buffer when switching\n     to another buffer?\n\nYou can set the 'autowrite' option to auto-save a modified buffer when\nswitching to another buffer:\n\n    :set autowrite\n\nFor more information, read:\n\n    :help 'autowrite'\n    :help 'autowriteall'\n    :help 'hidden'\n\n\n8.3. How do I replace the buffer in the current window with a blank buffer?\n\nYou can use the `:enew` command to load an empty buffer in place of the\nbuffer in the current window.\n\nFor more information, read:\n\n    :help :enew\n\n\n8.4. Is there a keyboard shortcut to load a buffer by the buffer number?\n\nYou can use the CTRL-^ command to load a buffer by specifying the buffer\nnumber. For example, to load buffer number 5, you have to use the 5 CTRL-^\ncommand.\n\nFor more information, read:\n\n    :help CTRL-^\n\n\n8.5. How do I open all the current buffers in separate windows?\n\nYou can use the `:ball` or `:sball` commands to open all the buffers\nin the buffer list:\n\n    :ball\n\nIf you want all buffers to be opened in new tabs, simply prefix the `:tab`\ncommand:\n\n    :tab :sball\n\nFor more information, read:\n\n    :help :ball\n\n\n8.6. How do I close (delete) a buffer without exiting Vim?\n\nYou can use any of `:bdelete`, `:bwipeout` or `:bunload` commands to\ndelete a buffer without exiting Vim. For example:\n\n    :bdelete file1\n\nFor more information, read:\n\n    :help :bdelete\n    :help :bwipeout\n    :help :bunload\n\n\n8.7. When I use the command `:%bd` to delete all the buffers, not all the\n     buffers are deleted. Why?\n\nIn the `:%bd` command, the \"%\" range will be replaced with the starting and\nending line numbers in the current buffer. Instead of using \"%\" as the\nrange, you should specify numbers for the range. For example, to delete all\nthe buffers, you can use the command `:1,9999bd`.\n\nFor more information, read:\n\n    :help :bd\n\n(This behaviour has been fixed with patch 7.4.530)\n\n\n8.8. How do I display the buffer number of the current buffer/file?\n\nYou can use 2<CTRL-G> command to display the buffer number for the current\nfile/buffer. Note the use of count before the CTRL-G command. If the count\nis greater than 1, then Vim will display the buffer number.\n\nYou can also use the following command to display the current buffer\nnumber:\n\n    :echo bufnr(\"%\")\n\nYou can also include the \"%n\" field to the 'statusline' option to display\nthe current buffer number on the statusline.\n\nFor more information, read:\n\n    :help CTRL-G\n    :help bufnr()\n    :help :echo\n    :help 'statusline'\n\n\n8.9. How do I delete a buffer without closing the window in which the\n     buffer is displayed?\n\nYou can use the following command to open the next buffer and delete\nthe current buffer.\n\n    :bnext | bdelete #\n\nFor more information, read:\n\n    :help :bnext\n    :help :bdelete\n    :help :buffers\n\n\n8.10. How do I map the <Tab> key to cycle through and open all the buffers?\n\nYou can use the following two map commands, to map the <Ctrl-Tab> key to open\nthe next buffer and the <Ctrl-Shift-Tab> key to open the previous buffer:\n\n    :nnoremap <C-Tab> :bnext<CR>\n    :nnoremap <S-C-Tab> :bprevious<CR>\n\nNote, this might not work in the terminal version of Vim.\n\nFor more information, read:\n\n    :help :bnext\n    :help :bprevious\n\n\n=============================================================================\n\nSECTION 9 - WINDOWS\n\n\n9.1. What is the difference between a Vim window and a buffer?\n\nA Vim buffer is a file loaded into memory for editing. The original file\nremains unchanged until you write the buffer to the file. A Vim window is a\nviewport onto a buffer. You can use multiple windows on one buffer or\nseveral windows on different buffers.\n\nFor more information, read:\n\n    :help usr_08.txt\n    :help 22.4\n    :help windows-intro\n    :help Q_wi\n\n\n9.2. How do I increase the width of a Vim window?\n\nYou can increase the width of a Vim window using one of the following\ncommands:\n\n    :vert resize +N\n    :vert resize -N\n    :vert resize N\n\nYou can also use CTRL-W < or CTRL-W > or CTRL-W | commands.\n\nFor more information, read:\n\n    :help :vertical-resize\n    :help CTRL-W_>\n    :help CTRL-W_<\n    :help window-resize\n\n\n9.3. How do I zoom into or out of a window?\n\nYou can zoom into a window (close all the windows except the current\nwindow) using the \"<CTRL-W>o\" command or the `:only` ex command.\n\nYou can use the \"<CTRL-W>_\" command or the `:resize` ex command to increase\nthe current window height to the highest possible without closing other\nwindows.\n\nYou can use the \"<CTRL-W>|\" command or the `:vertical resize` ex command to\nincrease the current window width to the highest possible without closing\nother windows.\n\nYou can use the \"<CTRL-W>=\" command to make the height and width of all the\nwindows equal.\n\nYou can also set the following options to get better results with the above\ncommands:\n\nMethod 1:\nSet the 'winminheight' option to 0:\n\n    :set winminheight=0\n\nBy default, this option is set to 1.\nThis option controls the minimum height of an inactive window (when it is\nnot the current window).  When the 'winminheight' option is set to 0, only\nthe status line will be displayed for inactive windows.\n\nMethod 2:\nSet the 'noequalalways' option and set the 'winheight' option to a large\nvalue (like 99999):\n\n    :set noequalalways\n    :set winheight=99999\n\nNow, the active window will always open to its maximum size, while the\nother windows will stay present, but shrunken to just a status line.\n\nWith any of the above mentioned methods, you cannot restore the window\nlayout after zooming into a window.  If you want to restore the Vim window\nlayout after zooming into a window, you can use the ZoomWin plugin. You can\ndownload this plugin from the Vim online website at:\n\n    https://www.vim.org/scripts/script.php?script_id=508\n\nFor more information, read:\n\n    :help CTRL-W_o\n    :help window-resize\n    :help 'winminheight'\n    :help 'equalalways'\n    :help 'winheight'\n    :help 08.3\n\n\n9.4. How do I execute an ex command on all the open buffers or open windows\n     or all the files in the argument list?\n\nYou can use the `:bufdo` command to execute an ex command on all the open\nbuffers.  You can use the `:windo` command to execute an ex command on all\nthe open windows.  You can use the `:argdo` command to execute an ex\ncommand on all the files specified in the argument list. And finally you\ncan use the `:tabdo` command to execute an ex command in all open tab pages.\n\nFor more information, read:\n\n    :help :windo\n    :help :bufdo\n    :help :argdo\n    :help :tabdo\n    :help 26.3\n\n\n=============================================================================\n\nSECTION 10 - MOTION\n\n\n10.1. How do I jump to the beginning (first line) or end (last line) of a\n     file?\n\nYou can use \"G\" command to jump to the last line in the file and the \"gg\"\ncommand to jump to the first line in the file.\n\nFor more information, read:\n\n    :help G\n    :help gg\n\n\n10.2. In insert mode, when I press the <Esc> key to go to command mode, the\n     cursor moves one character to the left (except when the cursor is on\n     the first character of the line). Is it possible to change this\n     behavior to keep the cursor at the same column?\n\nNo. It is not possible to change this behavior. The cursor is *always*\npositioned on a valid character (unless you have virtual-edit mode\nenabled). So, if you are appending text to the end of a line, when you\nreturn to command mode the cursor *must* drop back onto the last character\nyou typed. For consistency sake, the cursor drops back everywhere, even if\nyou are in the middle of a line.\n\nYou can use the CTRL-O or CTRL-\\ CTRL-O command in insert mode to execute a\nsingle ex command and return back to insert mode without moving the cursor\ncolumn.\n\nFor more information, read:\n\n    :help 'virtualedit'\n    :help i_CTRL-O\n    :help i_CTRL-\\_CTRL-O\n\n\n10.3. How do I configure Vim to maintain the horizontal cursor position when\n     scrolling with the <Page Up>, <Page Down>, etc keys?\n\nYou can reset the 'startofline' option to keep the cursor at the same\nhorizontal location when scrolling text:\n\n    :set nostartofline\n\nFor more information, read:\n\n    :help 'startofline'\n\n\n10.4. Some lines in a file are more than the screen width and they are all\n     wrapped. When I use the j, k keys to move from one line to the next,\n     the cursor is moved to the next line in the file instead of the next\n     line on the screen. How do I move from one screen line to the next?\n\nYou can use the gj and gk commands to move from one screen line to the\nnext/previous screen line. The j and k commands move the cursor from one\nfile line to the next file line. You can also avoid the line wrapping by\nresetting the 'wrap' option:\n\n    :set nowrap\n\nFor more information, read:\n\n    :help gj\n    :help gk\n    :help 'wrap'\n\nYou can use the following mappings:\n\n    :map <Up> gk\n    :imap <Up> <C-o>gk\n    :map <Down> gj\n    :imap <Down> <C-o>gj\n    :noremap j gj\n    :noremap k gk\n\n\n10.5. What is the definition of a sentence, paragraph and section in Vim?\n\nA sentence is defined as ending at a \".\", \"!\" or \"?\" followed by either the\nend of a line, or by a space (or two) or tab. Which characters and the\nnumber of spaces needed to constitute a sentence ending is determined by\nthe 'joinspaces' and 'cpoptions' options.\n\nA paragraph begins after each empty line, and also at each of a set of\nparagraph macros, specified by the pairs of characters in the 'paragraphs'\noption.\n\nA section begins after a form-feed (<C-L>) in the first column and at each\nof a set of section macros, specified by the pairs of characters in the\n'sections' option.\n\nFor more information, read:\n\n    :help sentence\n    :help 'joinspaces'\n    :help 'cpoptions'\n    :help paragraph\n    :help section\n    :help word\n\n\n10.6. How do I jump to beginning or end of a sentence, paragraph or a\n     section?\n\nYou can use the following motion commands to jump to the beginning or end\nof a sentence or a paragraph or a section:\n\n      motion  position    where\n      ------  ---------   -----------------\n      (       beginning   current sentence\n      )       end         current sentence\n      {       beginning   current paragraph\n      }       end         current paragraph\n      []      end         previous section\n      [[      beginning   current section\n      ][      end         current section\n      ]]      beginning   next section\n\nEach of these motions can be preceded by a number which will extend the\njump forward (or backward).\n\nFor more information, read:\n\n    :help object-motions\n\n\n10.7. I have lines in a file that extends beyond the right extent of the\n     screen. How do I move the Vim view to the right to see the text off\n     the screen?\n\nYou can use one of the following commands to horizontally scroll the screen\nto the left or right:\n\n    cmd  scroll to\n    ---  --------------------------\n    zl   scroll to the left\n    zh   scroll to the right\n    zL   scroll half a screenwidth to the left\n    zH   scroll half a screenwidth to the right\n    zs   scroll to position the cursor at the start of the screen\n    ze   scroll to position the cursor at the end of the screen\n\nYou can use the g0 command to move the cursor to the first character of the\nscreen line and the g$ command to move the cursor to the last character of\nthe screen line without scrolling the screen.\n\nFor more information, read:\n\n    :help scroll-horizontal\n\n\n10.8. How do I scroll two or more buffers simultaneously?\n\nYou can set the 'scrollbind' option for each of the buffers to scroll them\nsimultaneously.\n\nFor more information, read:\n\n    :help 'scrollbind'\n    :help scroll-binding\n    :help 'scrollopt'\n    :help 'cursorbind'\n\n\n10.9. When I use my arrow keys, Vim changes modes, inserts weird characters\n     in my document but doesn't move the cursor properly. What's going on?\n\nThere are a couple of things that could be going on: either you are using\nVim over a slow connection or Vim doesn't understand the key sequence that\nyour keyboard is generating.\n\nIf you are working over a slow connection (such as a 2400 bps modem), you\ncan try to set the 'timeout' or 'ttimeout' option. These options, combined\nwith the 'timeoutlen' and 'ttimeoutlen' options, may fix the problem.\n\nThe preceding procedure will not work correctly if your terminal sends key\ncodes that Vim does not understand. In this situation, your best option is\nto map your key sequence to a matching cursor movement command and save\nthese mappings in a file. You can then `:source` the file whenever you work\nfrom that terminal.\n\nFor more information, read:\n\n    :help 'timeout'\n    :help 'ttimeout'\n    :help 'timeoutlen'\n    :help 'ttimeoutlen'\n    :help :map\n    :help vt100-cursor-keys\n\n\n10.10. How do I configure Vim to move the cursor to the end of the previous\n      line, when the left arrow key is pressed and the cursor is currently\n      at the beginning of a line?\n\nYou can add the \"<\" flag to the 'whichwrap' option to configure Vim to move\nthe cursor to the end of the previous line, when the left arrow key is\npressed and the cursor is currently at the beginning of a line:\n\n    :set whichwrap+=<\n\nSimilarly, to move the cursor the beginning of the next line, when the\nright arrow key is  pressed and the cursor is currently at the end of a\nline, add the \">\" flag to the 'whichwrap' option:\n\n    :set whichwrap+=>\n\nThe above will work only in normal and visual modes. To use this in insert\nand replace modes, add the \"[\" and \"]\" flags respectively.\n\nFor more information, read:\n\n    :help 'whichwrap'\n    :help 05.7\n\n\n10.11. How do I configure Vim to stay only in insert mode (modeless\n      editing)?\n\nYou can set the 'insertmode' option to configure Vim to stay only in insert\nmode:\n\n    :set insertmode\n\nBy setting this option, you can use Vim as a modeless editor. If you press\nthe <Esc> key, Vim will not go to the normal mode. To execute a single\nnormal mode command, you can press CTRL-O followed by the normal mode\ncommand.  To execute more than one normal command, you can use CTRL-L\nfollowed by the commands. To return to insert mode, press the <Esc> key. To\ndisable this option, reset the 'insertmode' option:\n\n    :set noinsertmode\n\nYou can also start vim using the \"evim\" command or you can use \"vim -y\" to\nuse Vim as a modeless editor.\n\nYou can also start Vim in insert mode using the `:startinsert` ex command.\n\nFor more information, read:\n\n    :help 'insertmode'\n    :help :startinsert\n    :help :stopinsert\n    :help i_CTRL-O\n    :help i_CTRL-L\n    :help evim\n    :help evim-keys\n\n\n10.12. How do I display some context lines when scrolling text?\n\nYou can set the 'scrolloff' option to display a minimal number of screen\nlines (context) above and below the cursor.\n\n    :set scrolloff=10\n\nFor more information, read:\n\n    :help 'scrolloff'\n    :help 'sidescrolloff'\n\n\n10.13. How do I go back to previous cursor locations?\n\nYou can go back to the cursor location before the latest jump using the ''\nor `` command. You can use the CTRL-O command to go back to older cursor\npositions and the CTRL-I command to go to the newer cursor positions in the\njump list.\n\nFor more information, read:\n\n    :help 03.10\n    :help mark-motions\n    :help jump-motions\n\n\n=============================================================================\n\nSECTION 11 - SEARCHING TEXT\n\n\n11.1. After I searched for a text with a pattern, all the matched text\n      stays highlighted. How do I turn off the highlighting\n      temporarily/permanently?\n\nThe 'hlsearch' option controls whether all the matches for the last\nsearched pattern are highlighted or not. By default, this option is not\nenabled. If this option is set in a system-wide vimrc file, then you can\nturn off the search highlighting by using the following command:\n\n    :set nohlsearch\n\nTo temporarily turn off the search highlighting, use\n\n    :nohlsearch\n\nYou can also clear the search highlighting, by searching for a pattern that\nis not in the current file (for example, search for the pattern \"asdf\").\n\nYou can use this mapping, to clear the search highlighting when\nredrawing the window pressing CTRL-L\n\n    :nnoremap <silent> <C-L> <C-L>:nohls<CR>\n\nFor more information, read:\n\n    :help 'hlsearch'\n    :help :nohlsearch\n\n\n11.2. How do I enter a carriage return character in a search pattern?\n\nYou can either use \"\\r\" or <CTRL-V><CTRL-M> to enter a carriage return\ncharacter in a pattern. In Vim scripts, it is better to use \"\\r\" for the\ncarriage return character.\n\nFor more information, read:\n\n    :help sub-replace-special\n\n\n11.3. How do I search for the character ^M?\n\nYou can enter the ^M character in a search command by first pressing the\nCTRL-V key and then pressing the CTRL-M key.\n\n    /^V^M\n\nYou can also use the \"\\r\" character. In Vim scripts, \"\\r\" is preferred.\n\nFor more information, read:\n\n    :help c_CTRL-V\n    :help using_CTRL-V\n    :help /\\r\n\n\n11.4. How can I search/replace characters that display as \"~R\", \"~S\", etc.?\n\nYou can use the \"ga\" command to display the ASCII value/code for the\nspecial character. For example, let us say the ASCII value is 142. Then you\ncan use the following command to search for the special character:\n\n    /^V142\n\nwhere, ^V is entered by pressing CTRL-V.\n\nFor more information, read:\n\n    :help ga\n    :help using_CTRL-V\n    :help 24.8\n\n\n11.5. How do I highlight all the non-printable characters in a file?\n\nYou can use the following commands and search pattern to highlight all the\nnon-printable characters in a file:\n\n    :set hlsearch\n    /\\(\\p\\|$\\)\\@!.\n\nFor more information, read:\n\n    :help /\\p\n    :help /bar\n    :help /$\n    :help /\\(\n    :help /\\@!\n    :help 'hlsearch'\n\n\n11.6. How do I search for whole words in a file?\n\nYou can search for whole words in a file using the \\< and \\> atoms. For\nexample:\n\n    /\\<myword\\>\n\nThe \\< atom matches the beginning of the word and the \\> atom matches the\nend of the word.\n\nFor more information, read:\n\n    :help /\\<\n    :help /\\>\n\n\n11.7. How do I search for the current word under the cursor?\n\nYou can press the * key to search forward for the current word under the\ncursor.  To search backward, you can press the # key. Note that only whole\nkeywords will be searched using these commands.\n\nFor more information, read:\n\n    :help star\n    :help #\n    :help gstar\n    :help g#\n    :help 03.8\n    :help search-commands\n\n\n11.8. How do I search for a word without regard to the case (uppercase or\n      lowercase)?\n\nTo always ignore case while searching for a pattern, set the 'ignorecase'\noption:\n\n    :set ignorecase\n\nTo ignore case only when searching a particular pattern, use the special \\c\ndirective:\n\n    /\\c<pattern>\n\nFor more information, read:\n\n    :help 'ignorecase'\n    :help /ignorecase\n    :help /\\c\n\n\n11.9. How do I search for words that occur twice consecutively?\n\nYou can use one of the following search commands to locate words that occur\ntwice consecutively:\n\n     /\\(\\<\\w\\+\\)\\_s\\+\\1\\>\n     /\\(\\<\\k\\+\\)\\_s\\+\\1\\>\n\nThe main difference is the use of \"\\w\" and \"\\k\", where the latter is based\non the 'iskeyword' option which may include accented and other language\nspecific characters.\n\nFor more information, read:\n\n    :help /\\1\n    :help /\\(\n    :help /\\)\n    :help /\\<\n    :help /\\>\n    :help /\\w\n    :help /\\k\n    :help /\\+\n    :help /\\_x\n    :help 'iskeyword'\n\n\n11.10. How do I count the number of times a particular word occurs in a\n       buffer?\n\nYou can use the following set of commands to count the number of times a\nparticular word occurs in a buffer:\n\n    :let cnt=0\n    :g/\\<your_word\\>/let cnt=cnt+1\n    :echo cnt\n\nThis only counts the number of lines where the word occurs. You can also\nuse the following command:\n\n    :%s/\\<word\\>/&/gn\n\nTo count the number of alphabetic words in a file, you can use\n\n    :%s/\\a\\+/&/gn\n\nTo count the number of words made up of non-space characters, you can use\n\n    :%s/\\S\\+/&/gn\n\nFor more information, read:\n\n    :help count-items\n    :help word-count\n    :help v_g_CTRL-G\n    :help 12.5\n    :help :s_flags\n\n\n11.11. How do I place the cursor at the end of the matched word when\n       searching for a pattern?\n\nYou can use the \"e\" offset to the search command to place the cursor at the\nend of the matched word. For example\n\n    /mypattern/e\n\nFor more information about search offsets, read:\n\n    :help search-offset\n    :help /\n\n\n11.12. How do I search for an empty line?\n\nYou can search for an empty line using:\n\n    /^$\n\n    or\n\n    /^\\s*$\n\nThe latter also matches lines, that consist only of white space, while the\nformer only matches true empty lines. For more information, read:\n\n    :help /^\n    :help /$\n    :help /\\s\n    :help /star\n    :help search-commands\n\n\n11.13. How do I search for a line containing only a single character?\n\nYou can search for a line containing only a single character using:\n\n    /^\\s*\\a\\s*$\n\nFor more information, read:\n\n    :help /^\n    :help /\\a\n    :help /\\s\n    :help /star\n    :help /$\n\n\n11.14. How do I search and replace a string in multiple files?\n\nYou can use the `:argdo`, `:bufdo`, `:windo` or `:tabdo` commands to execute\nan ex command on multiple files. For example:\n\n    :argdo %s/foo/bar/g|upd\n\nFor more information, read:\n\n    :help :argdo\n    :help :bufdo\n    :help :windo\n    :help :tabdo\n\n\n11.15. I am using the `:s` substitute command in a mapping. When a search\n       for a pattern fails, the map terminates. I would like the map to\n       continue processing the next command, even if the substitute command\n       fails. How do I do this?\n\nYou can use the \"e\" flag to the substitute command to continue processing\nother commands in a map, when a pattern is not found.\n\nFor more information, read:\n\n    :help :s_flags\n\n\n11.16. How do I search for the n-th occurrence of a character in a line?\n\nTo search for the n-th occurrence of a character in a line, you can prefix\nthe \"f\" command with a number. For example, to search for the 5th\noccurrence of the character @ in a line, you can use the command 5f@. This\nassumes the cursor is at the beginning of the line - and that this first\ncharacter is not the one your are looking for.\n\nFor more information, read:\n\n    :help f\n    :help F\n    :help t\n    :help T\n    :help ;\n    :help ,\n\n\n11.17. How do I replace a tab (or any other character) with a hard return\n       (newline) character?\n\nYou can replace a tab (or any other character) with a hard return (newline)\ncharacter using the following command:\n\n    :s/\\t/\\r/\n\nNote that in the above command, if you use \\n instead of \\r, then the tab\ncharacters will not be replaced by a new-line character.\n\nFor more information, read:\n\n    :help sub-replace-special\n    :help NL-used-for-Nul\n    :help CR-used-for-NL\n\n\n11.18. How do I search for a character by its ASCII value?\n\nYou can search for a character by its ASCII value by pressing CTRL-V\nfollowed by the decimal or hexadecimal or octal value of that character in\nthe search \"/\" command.  To determine the ASCII value of a character you\ncan use the `:ascii` or the \"ga\" command.\n\nFor example, to search for the ASCII character with value 188, you can\nuse one of the following search commands:\n\n    /<CTRL-V>188\n    /<CTRL-V>o274\n    /<CTRL-V>xBC\n    /<CTRL-V>u00bc\n\nYou can also search for the character with the decimal/octal/hex number\nusing a collation [] like this:\n\n    /[\\d188]\n    /[\\o274]\n    /[\\xbc]\n    /[\\u00bc]\n\nAlternatively, you can use the special atom \\%d \\%o \\%x \\%u:\n\n    /\\%d188\n    /\\%o274\n    /\\%xbc\n    /\\%u00bc\n\nOr you use digraphs to enter the character. For example enter:\n\n    /CTRL-K14\n\nto search for the above character.\n\nFor more information, read:\n\n    :help i_CTRL-V_digit\n    :help :ascii\n    :help ga\n    :help /\\]\n    :help /\\%d\n    :help digraphs\n\n\n11.19. How do I search for long lines?\n\nYou can search for long lines or lines containing more than a specific\nnumber of characters using the Vim regular-expressions in the search\ncommand. For example, to search for all the lines containing more than 80\ncharacters, you can use one of the following commands:\n\n    /^.\\{80}.\\+$\n    /^.*\\%>80c.*$\n    /^.*\\%>80v.*$\n\nFor more information, read:\n\n    :help /\\{\n    :help /\\%c\n    :help /\\%v\n\n\n11.20. How do I display all the lines in the current buffer that contain a\n       specified pattern?\n\nYou can use the following command to display all the lines in the current\nbuffer that contain a specified pattern:\n\n    :g/<pattern>/p\n\nFor example, the following command will display all the lines in the\ncurrent buffer that contain \"vim\":\n\n    :g/vim/p\n\nSince `:p` is the default command to be executed for the ex command `:g`, you\ncan also use:\n\n    :g/vim\n\nIf you also want the corresponding line numbers, then you can use the\nfollowing command:\n\n    :g/<pattern>/#\n\nFor more information, read:\n\n    :help :global\n    :help :print\n    :help :number\n\n\n11.21. How do I search for a text string that spans multiple lines?\n\nYou can search for a text string that spans multiple lines using the \\_x\nregular expression atom. For example, to search for the text string \"Hello\nWorld\", you can use the following search command:\n\n    /Hello\\_sWorld\n\nThis will match the word \"Hello\" followed by a newline character and then\nthe word \"World\" at the beginning of the next line. This will also match\nthe word \"Hello\" immediately followed by a space character and then the\nword \"World\". When searching for the \"Hello World\" string, to include the\nspace characters at the end and beginning of the line, you can use the\nfollowing search command:\n\n    /Hello\\_s\\+World\n\nFor more information, read:\n\n    :help 27.8\n    :help pattern-atoms\n    :help /\\_\n    :help pattern-searches\n\n\n11.22. How do I search for a pattern within the specified range of lines\n       in a buffer?\n\nYou can search for a pattern within a range of lines using the \\%>l\nand \\%<l regular expression atoms.\n\nFor example, to search for the word \"white\" between the lines 10 and 30 in\na buffer, you can use the following command:\n\n    /white\\%>9l\\%<31l\n\nFor more information, read:\n\n    :help /\\%l\n\n\n11.23. How do I clear the last searched pattern?\n\nThe last searched pattern is stored in the \"/\" register. You can clear\nthis register using the following command:\n\n    :let @/=\"\"\n\nTo clear the last search pattern whenever a buffer is unloaded, you can use\nthe following command:\n\n    :autocmd BufUnload * let @/ = \"\"\n\nFor more information, read:\n\n    :help @/\n    :help :let-@\n    :help autocmd-searchpat\n    :help last-pattern\n\n\n11.24. Why does this pattern \"a.\\{-}p\\@!\" not match?\n\n\"\\{-}\" doesn't just mean \"as few as possible\", it means \"as few as\npossible to make the whole pattern succeed\". If it didn't match the \"p\",\nthe whole pattern would fail (because of the \"p\\@!\") so it does match\nthe \"p\". It is a longer match, but it is the shortest match that makes\nthe whole pattern succeed.\n\nIf you wanted \"as few as possible regardless\" you would use \"\\@>\", which\nbasically divides a pattern up so that the pieces either side behave\nindependently. If the pattern were \"a.\\{-}\\@>p\\@!\" then \".\\{-}\" would\nalways match nothing because that's the smallest match that can succeed\nwhen there are not other restrictions. The whole pattern then would\nbehave the same as \"ap\\@!\", i.e. it would match any \"a\" not followed by\na \"p\").\n\nThis means, it matches as few as possible \"a\"s without trying to keep\ngoing until Vim finds the longest match. This means, it will still match\n\"ap\".\n\n\n11.25. How can I use \"/\" within a pattern, without escaping it?\n\nWhen using / to search for a pattern, you need to escape all \"/\" within\nthe pattern, because they would otherwise terminate the pattern. So you\ncan't directly search for /usr/share/doc/ but need to search for\n\\/usr\\/share\\/doc\\/\n\nThe easiest solution around that, would be to use \"?\" to start a\nbackward search and afterwards use /<CR> to use the last search-pattern\nin forward direction.\n\nIf you have a Vim, that has the eval-feature built in (which needs at\nleast a normal built or higher), you can also directly paste the pattern\ninto the search register:\n\n:let @/ = '/usr/share/doc/'\n\nThen use \"n\" to jump to the next occurrence.\n\nSee also the help at\n\n    :help @/\n    :help /<CR>\n\n\n11.26. How can I operate on a search match?\n\nThe \"gn\" command makes it easy to operate on regions of text that match\nthe current search pattern. By default, it will search forward for the\nlast used search pattern and visually select the match. If the cursor is\nalready on the match, it will be visually selected. If you used the \"gn\"\ncommand after an operator (e.g. \"c\" to change text), it will be applied\non the match.\n\nIf Visual mode is active before using gn, the visual selection will be\nextended until the end of the next match.\n\nThe \"gN\" commands works similar but searches backwards.\n\nThis allows to repeat simple operations on each match. For example, you\nmight want to change each occurence of apples by peaches. So you search\nusing \"/apple\" then you can use \"cgnpeach<Esc>\" to replace the current\nmatch by peach. Now you can use the dot \".\" command to redo the\nreplacement for the rest of the buffer.\n\nSee also the help at\n\n    :help gn\n    :help gN\n\n\n=============================================================================\n\nSECTION 12 - CHANGING TEXT\n\n\n12.1. How do I delete all the trailing white space characters (SPACE and\n      TAB) at the end of all the lines in a file?\n\nYou can use the `:substitute` command on the entire file to search and\nremove all the trailing white space characters:\n\n    :%s/\\s\\+$//\n\nFor more information, read:\n\n    :help :%\n    :help :s\n    :help /\\s\n    :help /\\+\n    :help /$\n\n\n12.2. How do I replace all the occurrences of multiple consecutive space\n      characters to a single space?\n\nYou can use the following command to replace all the occurrences of\nmultiple consecutive space characters to a single space:\n\n    :%s/ \\{2,}/ /g\n\nAlternatively use:\n\n    :%s/  \\+/ /g\n\nFor more information, read:\n\n    :help :%\n    :help :s\n    :help /\\{\n    :help :s_flags\n\n\n12.3. How do I reduce a range of empty lines into one line only?\n\nYou can use the following command to reduce a range of empty lines into one\nline only:\n\n    :v/./.,/./-1join\n\nThe explanation for this command is below:\n\n    part            description\n    -----           --------------------------\n    :v/./           Execute the following command for all lines not\n                    containing a character (empty lines).\n     .,             Use the current line as the start of the range of\n                    lines.\n     /./            Use the line containing a character as the last line.\n     -1             Adjust the range of lines to end with the line before\n                    the last line.\n     j              Join the lines in the range.\n\nNote that this will give an error message if the empty lines are at the end\nof the file. To correct this, you have to add a temporary line at the end\nof the file, execute the command and then remove the temporary line.\n\nFor more information, read:\n\n    :help :v\n    :help :join\n    :help cmdline-ranges\n    :help collapse\n\n\n12.4. How do I delete all blank lines in a file? How do I remove all the\n      lines containing only space characters?\n\nTo remove all blank lines, use the following command:\n\n    :g/^$/d\n\nTo remove all lines with only whitespace (spaces or tabs) in them, use the\nfollowing command:\n\n    :g/^\\s\\+$/d\n\nTo remove all the lines with only whitespace, if anything, use the\nfollowing command:\n\n    :g/^\\s*$/d\n\n\n12.5. How do I copy/yank the current word?\n\nYou can use the \"yiw\" (yank inner word without whitespace) command or the\n\"yaw\" (yank a word with whitespace) command to copy/yank the current\nword.\n\nFor more information, read:\n\n    :help 04.6\n    :help 04.8\n    :help iw\n    :help yank\n    :help text-objects\n    :help objects\n\n\n12.6. How do I yank text from one position to another position within a\n      line, without yanking the entire line?\n\nYou can specify a motion command with the yank operator (y) to yank text\nfrom one position to another position within a line. For example, to yank\nfrom the current cursor position till the next letter x, use yfx or Fx or\ntx or Tx. To yank till the nth column, use n|. To yank till the next\noccurrence of a \"word\", use /word. To do a yank till the nth column on\nanother line, first mark the position using the \"ma\" command, go to the\nstart of the yank position, and then yank till the mark using y`a (note the\ndirection of the quote)\n\nFor more information, read:\n\n    :help yank\n    :help motion.txt\n    :help 04.6\n\n\n12.7. When I yank some text into a register, how do I append the text to\n      the current contents of the register?\n\nWhen you specify the register for some operation, if you use the upper-case\nfor the register name, then the new text will be appended to the existing\ncontents. For example, if you have some text in the register \"a\". If you\nwant to append some new text to this, you have to use the \"A\" register\nname. If you use the lowercase register name, then the contents of the\nregister will be overwritten with the new text.\n\nFor more information, read:\n\n    :help quote\n    :help quote_alpha\n    :help 10.1\n\n\n12.8. How do I yank a complete sentence that spans over more than one line?\n\nTo yank a complete sentence that spans over more than one line you have to\nuse the yank operator followed by a motion command. For example:\n\n        y)\n\nFrom inside the sentence you can use \"yi)\" to yank the sentence.\n\nFor more information, read:\n\n    :help yank\n    :help {motion}\n    :help object-motions\n    :help 04.6\n\n\n12.9. How do I yank all the lines containing a pattern into a buffer?\n\nYou can use the `:global` command to yank all the lines containing the\npattern into a register and then paste the contents of the register into\nthe buffer:\n\n    :let @a=''\n    :g/mypattern/y A\n\nThe first command, clears the contents of the register \"a\". The second\ncommand copies all the lines containing \"mypattern\" into the register \"a\".\nNote that the capital letter \"A\" is used to append the matched lines. Now\nyou can paste the contents of register \"a\" to a buffer using \"ap command.\n\nIf you only want to collect all matches, you can use a different\napproach. For that run the `:s` command with the flags \"gn\" so that it\nwon't actually  change the buffer (\"n\" flag) but select each match (\"g\"\nflag). Combining this with the \"\\=\" part in the replacement part, you\ncan copy each match to e.g. a list. Altogether this looks like this:\n\n    :let list=[]\n    :%s/pattern/\\=add(list, submatch(0))/gn\n\nNow all matches will be in the list and you can post process them as\nwanted.\n\nFor more information, read:\n\n    :help :g\n    :help :y\n    :help :let-register\n    :help quote_alpha\n    :help put\n    :help registers\n    :help :registers\n    :help sub-replace-\\=\n\n\n12.10. How do I delete all the lines in a file that do not contain a\n       pattern?\n\nYou can use `:v` command to delete all the lines that do not contain a\npattern:\n\n    :v/pattern/d\n\nor\n\n    :g!/pattern/d\n\nFor more information, read:\n\n    :help :v\n    :help :g\n\n\n12.11. How do I add a line before each line with \"pattern\" in it?\n\nYou can use the following command to add a line before each line with\n\"pattern\" in it:\n\n    :g/pattern/normal! Oi<line of text goes here>\n\nAlternatively you can yank the line using the Y command and then insert the\nline using the following command:\n\n    :g/pattern/put!\n\nFor more information, read:\n\n    :help :g\n    :help :put\n    :help insert\n    :help 0\n\n\n12.12. Is there a way to operate on a line if the previous line contains a\n       particular pattern?\n\nYou can use the `:global` command to operate on a line, if the previous\nline contains a particular pattern:\n\n    :g/<pattern>/+{cmd}\n\nFor more information, read:\n\n    :help :g\n    :help :range\n\n\n12.13. How do I execute a command on all the lines containing a pattern?\n\nYou can use the `:global` (:g) command to execute a command on all the\nlines containing a pattern.\n\n    :g/my pattern/d\n\nIf you want to use a non-Ex command, then you can use the `:normal`\ncommand:\n\n    :g/my pattern/normal {command}\n\nUnless you want the normal mode commands to be remapped, consider using a\n`:normal!` command instead (note the \"!\").\n\nFor more information, read:\n\n    :help :global\n    :help :v\n    :help :normal\n\n\n12.14. Can I copy the character above the cursor to the current cursor\n       position?\n\nIn Insert mode, you can copy the character above the cursor to the current\ncursor position by typing CTRL-Y. The same can be done with the\ncharacters below the cursor by typing CTRL-E.\n\nFor more information, read:\n\n    :help i_CTRL-Y\n    :help i_CTRL-E\n\n\n12.15. How do I insert a blank line above/below the current line without\n       entering insert mode?\n\nYou can use the `:put` ex command to insert blank lines. For example, try\n\n    :put =''\n    :put! =''\n\nFor more information, read:\n\n    :help :put\n\n\n12.16. How do I insert the name of the current file into the current buffer?\n\nThere are several ways to insert the name of the current file into the\ncurrent buffer. In insert mode, you can use the <C-R>% or the\n<C-R>=expand(\"%\") command. In normal mode, you can use the `:put =@%`\ncommand.\n\nFor more information, read:\n\n    :help i_CTRL-R\n    :help expand()\n    :help !!\n\n\n12.17. How do I insert the contents of a Vim register into the current\n       buffer?\n\nIn insert mode, you can use the <CTRL-R><register> command to insert the\ncontents of <register>. For example, use <CTRL-R>a to insert the contents\nof register \"a\" into the current buffer.\n\nIn normal mode, you can use the `:put <register>` command to insert the\ncontents of <register>. For example, use the `:put d` command to insert\nthe contents of register \"d\" into the current buffer.\n\nFor more information, read:\n\n    :help i_CTRL-R\n    :help i_CTRL-R_CTRL-R\n    :help i_CTRL-R_CTRL-O\n    :help i_CTRL-R_CTRL-P\n    :help :put\n\n\n12.18. How do I move the cursor past the end of line and insert some\n       characters at some columns after the end of the line?\n\nYou can set the 'virtualedit' option to move the cursor past the\nend-of-line and insert characters in a column after the end-of-line. To\nstart the virtual mode, use\n\n    :set virtualedit=all\n\nFor more information, read:\n\n    :help 'virtualedit'\n\n\n12.19. How to replace the word under the cursor (say: junk) with\n      \"foojunkbar\" in Vim?\n\nThere are several ways to do this. If the word is the first such word on\nthe line, use the following command:\n\n    :exe \"s/\".expand(\"<cword>\").\"/foo&bar/\"\n\nTo match specifically you could use a more complex substitution like this:\n\n    :exe 's/\\<'.expand(\"<cword>\").'\\%>'.(col(\".\")-1).'c\\>/foo&bar/'\n\nYou can also use the command: ciwfoo<C-R>\"bar<Esc>\n\nFor more information, read:\n\n    :help :substitute\n    :help expand()\n    :help col()\n    :help /\\%c\n\n\n12.20. How do I replace a particular text in all the files in a directory?\n\nYou can use the `:argdo` command to execute the substitute command on all\nthe files specified as arguments:\n\n    :args *\n    :argdo %s/<your_text>/<replacement_text>/ge | update\n\nFor more information, read:\n\n    :help :args_f\n    :help :argdo\n    :help :s_flags\n\n\n12.21. I have some numbers in a file. How do I increment or decrement the\n       numbers in the file?\n\nYou can use the CTRL-A key to increment the number and the CTRL-X key to\ndecrement the number. You can also specify the number to\nincrement/decrement from the number by specifying a count to the key. This\nworks for decimal, octal and hexadecimal numbers. You can change the base\nused by Vim for this operation by modifying the 'nrformats' option.\n\nFor more information, read:\n\n    :help 26.2\n    :help CTRL-A\n    :help CTRL-X\n    :help 'nrformats'\n\n\n12.22. How do I reuse the last used search pattern in a `:substitute`\n       command?\n\nTo reuse the last used search pattern in a `:substitute` command, don't\nspecify a new search pattern:\n\n    :s/pattern/newtext/\n    :s//sometext/\n\nIn the second `:s` command, as a search pattern is not specified, the\npattern specified in the first `:s` command \"pattern\" will be used.\n\nIf you want to change the search pattern but repeat the substitution\npattern you can use the special right hand side, you can use the tilde\ncharacter:\n\n    :s/newpattern/~/\n\nFor more information, read:\n\n    :help :s\n    :help :&\n    :help :~\n    :help &\n    :help sub-replace-special\n\n\n12.23. How do I change the case of a string using the `:substitute`\n       command?\n\nYou can use special characters in the replacement string for a\n`:substitute` command to change the case of the matched string. For\nexample, to change the case of the string \"MyString\" to all uppercase, you\ncan use the following command:\n\n    :%s/MyString/\\U&/g\n\nTo change the case to lowercase, you can use the following command:\n\n    :%s/MyString/\\L&/g\n\nTo change the case of the first character in all the words in the current\nline to uppercase, you can use the following command:\n\n    :s/\\<\\(.\\)\\(\\k*\\)\\>/\\u\\1\\L\\2/g\n\nFor more information, read:\n\n    :help sub-replace-special\n    :help :substitute\n    :help /\\U\n    :help /\\L\n    :help /\\u\n\n\n12.24. How do I enter characters that are not present in the keyboard?\n\nYou can use digraphs to enter characters that are not present in the\nkeyboard. You can use the `:digraphs` command to display all the currently\ndefined digraphs. You can add a new digraph to the list using the\n`:digraphs` command.\n\nFor more information, read:\n\n    :help digraphs\n    :help 'digraph'\n    :help 24.9\n\n\n12.25. Is there a command to remove any or all digraphs?\n\nNo. The digraphs table is defined at compile time. You can only add new\nones. Adding a command to remove digraphs is on the todo list.\n\n\n12.26. In insert mode, when I press the backspace key, it erases only the\n       characters entered in this instance of insert mode. How do I erase\n       previously entered characters in insert mode using the backspace\n       key?\n\nThis is traditional vi behaviour. You can set the 'backspace' option to\nerase previously entered characters in insert mode:\n\n    :set backspace=indent,eol,start\n\nFor more information, read:\n\n    :help 'backspace'\n    :help i_backspacing\n\n\n12.27. I have a file which has lines longer than 72 characters terminated\n       with \"+\" and wrapped to the next line. How can I quickly join the\n       lines?\n\nYou can use the `:global` command to search and join the lines:\n\n    :g/+$/j\n\nThis will, however, only join every second line. A couple of more complex\nexamples which will join all consecutive lines with a \"+\" at the end are:\n\n    :g/+$/,/\\(^\\|[^+]\\)$/j\n    :g/+$/mark a | .,/\\(^\\|[^+]\\)$/s/+$// | 'a,.j\n\nFor more information, read:\n\n    :help :g\n    :help :j\n    :help :mark\n\n\n12.28. How do I paste characterwise yanked text into separate lines?\n\nYou can use the `:put` command to paste characterwise yanked text into new\nlines:\n\n    :put =@\"\n\nFor more information, read:\n\n    :help :put\n    :help quote_=\n\n\n12.29. How do I change the case (uppercase, lowercase) of a word or a\n       character or a block of text?\n\nYou can use the \"~\" command to switch the case of a character.\n\nYou can change the case of the word under the cursor to uppercase using the\n\"gUiw\" or \"viwU\" command and to lowercase using the \"guiw\" or \"viwu\"\ncommand.\n\nYou can switch the case (upper case to lower case and vice versa) of the\nword under the cursor using the \"viw~\" or \"g~iw\" command.\n\nYou can use the \"gUgU\" command to change the current line to uppercase and\nthe \"gugu\" command to change the current line to lowercase.\n\nYou can use the \"g~g~\" command to switch the case of the current line. You\ncan use the \"g~{motion}\" or \"{Visual}~\" commands to switch the case of a\nblock of text.\n\nIf you set 'tildeop' the \"~\" command behaves like an operator and expects\na motion command to act on. If you have\n\n    :set tildeop\n\nand you want to change the case from the current cursor position to the end\nof line, simply use \"~$\".\n\nFor more information, read:\n\n    :help case\n    :help 'tildeop'\n\n\n12.30. How do I enter ASCII characters that are not present in the\n       keyboard?\n\nYou can enter ASCII characters that are not present in the keyboard by\npressing CTRL-V and then the ASCII character number. You can also use\ndigraphs to enter special ASCII characters.\n\nFor more information, read:\n\n    :help i_CTRL-V_digit\n    :help digraphs\n    :help 45.5\n\n\n12.31. How do I replace non-printable characters in a file?\n\nTo replace a non-printable character, you have to first determine the ASCII\nvalue for the character. You can use the `:ascii` ex command or the \"ga\"\nnormal-mode command to display the ASCII value of the character under the\ncursor.\n\nYou can enter the non-printable character by entering CTRL-V followed by\nthe decimal number 1-255 (with no leading zero), or by x and a hex number\n00-FF, or by an octal number 0-0377 (with leading zero), or by u and a hex\nnumber 0-FFFF, or by U and a hex number 0-7FFFFFFF\n\nAnother alternative is to use the `:digraphs` ex command to display the\ndigraphs for all characters, together with their value in decimal and\nalpha. You can enter a non-printable character by entering CTRL-K followed\nby two alphanumeric characters (a digraph).\n\nFor more information, read:\n\n    :help :ascii\n    :help i_CTRL-V\n    :help i_CTRL-V_digit\n    :help :digraphs\n\n\n12.32. How do I remove duplicate lines from a buffer?\n\nYou can use the following user-defined command to remove all the duplicate\nlines from a buffer:\n\n:command -range=% Uniq <line1>,<line2>g/^\\%<<line2>l\\(.*\\)\\n\\1$/d\n\nAdd the above command to your .vimrc file and invoke `:Uniq` to remove all\nthe duplicate lines.\n\n\n12.33. How do I prefix all the lines in a file with the corresponding line\n       numbers?\n\nYou can prefix the lines in a file with the corresponding line number in\nseveral ways. Some of them are listed below:\n\n    :%s/^/\\=line('.'). ' '\n    :%s/^/\\=printf('%5d ', line('.'))/\n    :%s/^/\\=strpart(line('.').'.     ', 0, 5)\n    :%s/^/\\=strpart('   ', strlen(line('.'))).line('.').'. '\n\nThe last two commands will pad the line numbers with space characters.  The\nlast command will right align the numbers and the command before that will\nleft align the numbers.\n\nIf you don't want to number consecutive lines but rather non-consecutive\nregions, you can also use this idiom:\n\n    :let i = 1\n    :g/TODO/s/^/\\=printf('%2d.',i)|let i+=1\n\nThis first initializes the variable i with 1. In the next line, a `:g`\ncommand is used to perform a substitute command only on lines, that\nmatch \"TODO\". After the substitute command has taken place, the variable\ni will be incremented by 1.\n\nFor more information, read:\n\n    :help sub-replace-special\n    :help line()\n    :help expr6\n    :help strpart()\n    :help printf()\n    :help :execute\n    :help :global\n\n\n12.34. How do I exchange (swap) two characters or words or lines?\n\nYou can exchange two characters with the \"xp\" command sequence. The \"x\"\nwill delete the character under the cursor and \"p\" will paste the just\ndeleted character after the character under the cursor. This will result\nin exchanging the two characters.\n\nYou can exchange two words with the \"deep\" command sequence (start with the\ncursor in the blank space before the first word).\n\nYou can exchange two lines with the \"ddp\" command sequence. The \"dd\" will\ndelete the current line and \"p\" will paste the just deleted line after the\ncurrent line. This will result in exchanging the two lines.\n\nAll of the above operations will change the \" unnamed register.\n\nYou can use the `:m +` ex command to exchange two lines without changing the\nunnamed register.\n\nFor more information, read:\n\n    :help x\n    :help p\n    :help dd\n    :help d\n    :help e\n    :help linewise-register\n    :help quotequote\n    :help :move\n\n\n12.35. How do I change the characters used as word delimiters?\n\nVim uses the characters specified by the 'iskeyword' option as word\ndelimiters. The default setting for this option is \"@,48-57,_,192-255\".\n\nFor example, to add \":\" as a word delimiter, you can use\n\n    :set iskeyword+=:\n\nTo remove \"_\" as a word delimiter, you can use\n\n    :set iskeyword-=_\n\nFor more information, read:\n\n    :help 'iskeyword'\n    :help word\n\n\n=============================================================================\n\nSECTION 13 - COMPLETION IN INSERT MODE\n\n\n13.1. How do I complete words or lines in insert mode?\n\nIn insert mode, you can complete words using the CTRL-P and CTRL-N keys.\nThe CTRL-N command searches forward for the next matching keyword.\nThe CTRL-P command searches backwards for the next matching keyword.\n\nIn insert mode, you can use the CTRL-X CTRL-L command sequence to complete\nlines that starts with the same characters as in the current line before\nthe cursor. To get the next matching line, press the CTRL-P or CTRL-N keys.\nThere are a lot of other keys/ways available to complete words in insert\nmode.\n\nVim supports completion of the following items:\n\n    CTRL-X CTRL-L    whole lines\n    CTRL-X CTRL-N    keywords in the current file\n    CTRL-X CTRL-K    words from a dictionary\n    CTRL-X CTRL-T    words from a thesaurus\n    CTRL-X CTRL-I    current and included files\n    CTRL-X CTRL-]    tags\n    CTRL-X CTRL-F    file names\n    CTRL-X CTRL-D    macro definitions (also in included files)\n    CTRL-X CTRL-V    Vim command line\n    CTRL-X CTRL-U    User defined completion\n    CTRL-X CTRL-O    Omni completion\n\nUser defined completions and omni completions are often set by filetype\nplugins.\n\nFor more information, read:\n\n    :help 24.3\n    :help ins-completion\n\n\n13.2. How do I complete file names in insert mode?\n\nIn insert mode, you can use the CTRL-X CTRL-F command sequence to complete\nfilenames that start with the same characters as in the current line before\nthe cursor.\n\nFor more information, read:\n\n    :help compl-filename\n\n\n13.3. I am using CTRL-P/CTRL-N to complete words in insert mode. How do I\n      complete words that occur after the just completed word?\n\nYou can use CTRL-X CTRL-N and CTRL-X CTRL-P keys to complete words that are\npresent after the just completed word.\n\nFor more information, read:\n\n    :help i_CTRL-X_CTRL-P\n    :help i_CTRL-X_CTRL-N\n    :help ins-completion\n\n\n=============================================================================\n\nSECTION 14 - TEXT FORMATTING\n\n\n14.1. How do I format a text paragraph so that a new line is inserted at\n      the end of each wrapped line?\n\nYou can use the \"gq\" command to format a paragraph. This will format the\ntext according to the current 'textwidth' setting. An alternative would be\nto use the \"gw\" command that formats like \"gq\" but does not move the\ncursor.\n\nNote that the gq operator can be used with a motion command to operate on a\nrange of text. For example:\n\n    gqgq - Format the current line\n    gqap - Format current paragraph\n    gwap - Format current paragraph (and don't move cursor)\n    gq3j - Format the current and the next 3 lines\n\nFor more information, read:\n\n    :help gq\n    :help gw\n    :help formatting\n    :help usr_25.txt\n    :help motion.txt\n\n\n14.2. How do I format long lines in a file so that each line contains less\n      than \"n\" characters?\n\nYou can set the 'textwidth' option to control the number of characters that\ncan be present in a line. For example, to set the maximum width of a line\nto 70 characters, you can use the following command:\n\n    set textwidth=70\n\nNow to break the long lines in a file to the length defined by the\n'textwidth' option, you can use\n\n    :g/./normal gqq\n\nFor more information, read:\n\n    :help 'textwidth'\n    :help gq\n\n\n14.3. How do I join short lines to form a paragraph?\n\nFirst, make sure the 'textwidth' option is set to a high value:\n\n    :set textwidth=99999\n\nNext, join the short lines to form a paragraph using the command:\n\n    1GgqG\n\nThe above command will operate on the entire file. To do the formatting on\nall paragraphs in a specific range, use:\n\n    :'a,'bg/\\S/normal gq}\n\nFor more information, read:\n\n    :help gq\n    :help G\n    :help gqq\n\n\n14.4. How do I format bulleted and numbered lists?\n\nYou can configure Vim to format bulleted and numbered lists using the\n'formatoptions' option. For example, you can format the list of the\nfollowing format:\n\n  - this is a test. this is a test. this is a test. this is a test.\n  this is a test.\n\ninto this format:\n\n  - this is a test. this is a test. this is a test. this is a test.\n    this is a test.\n\nYou can use the \"n\" flag in the 'formatoptions' to align the text.\n\n    :set fo+=n\n\nWith this option, when formatting text, Vim will recognize numbered lists.\nFor this option to work, the 'autoindent' option also must be set.\n\nFor more information, read:\n\n    :help 'formatoptions'\n    :help fo-table\n    :help format-comments\n\n\n14.5. How do I indent lines in insert mode?\n\nIn insert mode, you can press the CTRL-T key to insert one shiftwidth of\nindent at the start of the current line. In insert mode, you can use the\nCTRL-D key to delete on shiftwidth of indent at the start of the current\nline. You can also use the CTRL-O >> and CTRL-O << commands to indent the\ncurrent line in insert mode.\n\nFor more information, read:\n\n    :help i_CTRL-T\n    :help i_CTRL-D\n    :help i_0_CTRL-D\n    :help i_CTRL-O\n    :help >>\n    :help <<\n\n\n14.6. How do I format/indent an entire file?\n\nYou can format/indent an entire file using the gg=G command, where\n\n    gg - Goto the beginning of the file\n    =  - apply indentation\n    G  - till end of file\n\nFor more information, read:\n\n    :help gg\n    :help =\n    :help G\n    :help 'formatprg'\n    :help C-indenting\n\n\n14.7. How do I increase or decrease the indentation of the current line?\n\nYou can use the \">>\" and \"<<\" commands to increase or decrease the\nindentation of the current line.\n\nFor more information, read:\n\n    :help shift-left-right\n    :help >>\n    :help <<\n    :help 'shiftwidth'\n\n\n14.8. How do I indent a block/group of lines?\n\nYou can visually select the group of lines and press the > or < key to\nindent/unindent the lines. You can also use the following ex-command to\nindent the lines\n\n    :10,20>\n\nFor more information, read:\n\n    :help shift-left-right\n    :help v_>\n    :help v_<\n    :help :<\n    :help :>\n\n\n14.9. When I indent lines using the > or < key, the standard 8-tabstops are\n      used instead of the current 'tabstop' setting. Why?\n\nThe number of spaces used when lines are indented using the \">\" operator is\ncontrolled by the 'shiftwidth' option. The 'tabstop' setting is only\nused, when the 'shiftwidth' option is zero.\n\n    :set shiftwidth=4\n\nFor more information, read:\n\n    :help 'shiftwidth'\n    :help >>\n    :help 'softtabstop'\n\n\n14.10. How do I turn off the automatic indentation of text?\n\nBy default, the automatic indentation of text is not turned on. Check the\nconfiguration files (.vimrc, .gvimrc) for settings related to indentation.\nMake sure the `:filetype indent on` command is not present. If it is\npresent, remove it. Also, depending on your preference, you may also want\nto check the value of the 'autoindent', 'smartindent', 'cindent' and\n'indentexpr' options and turn them off as needed.\n\nFor more information, read:\n\n    :help :filetype-indent-off\n    :help 'autoindent'\n    :help 'smartindent'\n    :help 'cindent'\n    :help 'indentexpr'\n\n\n14.11. How do I configure Vim to automatically set the 'textwidth' option\n       to a particular value when I edit mails?\n\nYou can use the \"FileType\" autocommand to set the 'textwidth' option:\n\n    autocmd FileType mail set tw=<your_value>\n\nFor more information, read:\n\n    :help :autocmd\n    :help FileType\n    :help usr_43.txt\n\n\n14.12. Is there a way to make Vim auto-magically break lines?\n\nYes. Set the 'textwidth' option to the preferred length for a line. Then\nVim will auto-magically break the newly entered lines. For example:\n\n    :set textwidth=75\n\nFor more information, read:\n\n    :help 'textwidth'\n    :help ins-textwidth\n    :help 'formatoptions'\n    :help fo-table\n    :help formatting\n\n\n14.13. I am seeing a lot of ^M symbols in my file. I tried setting the\n       'fileformat' option to \"dos\" and then \"unix\" and then \"mac\". None of\n       these helped. How can I hide these symbols?\n\nWhen a file is loaded in Vim, the format of the file is determined as\nbelow:\n\n- If all the lines end with a new line (<NL>), then the fileformat is\n  \"unix\".\n- If all the lines end with a carriage return (<CR>) followed by a new line\n  (<NL>), then the fileformat is \"dos\".\n- If all the lines end with carriage return (<CR>), then the fileformat is\n  \"mac\".\n\nIf the file has some lines ending with <CR> and some lines ending with <CR>\nfollowed by a <NL>, then the fileformat is set to \"unix\".\n\nYou can change the format of the current file, by saving it explicitly in\ndos format:\n\n    :w ++ff=dos\n\nTo display the format of the current file, use\n\n    :set fileformat?\n\nThe above behavior is also controlled by the 'fileformats' option. You can\ntry the following commands:\n\n    :set fileformats+=unix\n    :e <your_file>\n    :set fileformat=unix\n    :w\n\nTo remove the carriage return (<CR>) character at the end of all the lines\nin the current file, you can use the following command:\n\n    :%s/\\r$//\n\nTo force Vim to use a particular file format, when editing a file, you can\nuse the following command:\n\n    :e ++ff=dos filename\n\nFor more information, read:\n\n    :help 'fileformats'\n    :help 'fileformat'\n    :help file-formats\n    :help DOS-format-write\n    :help Unix-format-write\n    :help Mac-format-write\n    :help dos-file-formats\n    :help 23.1\n    :help ++ff\n\n\n14.14. When I paste some text into a Vim buffer from another application,\n      the alignment (indentation) of the new text is messed up. How do I\n      fix this?\n\nWhen you paste text into a GUI Vim using the mouse, Vim is able to\ndetect that you are pasting text. So all the indentation related\nsettings (like autoindent, smartindent, cindent, etc.) are ignored and\nthe text is pasted literally.\n\nWhen pasting text into a Vim running in a terminal (like xterm) using\nthe mouse, Vim may not be able to detect that you are pasting text. This\ndepends on several things: the capability of the terminal to pass the\nmouse events to Vim, Vim is compiled to handle mouse events and access\nthe clipboard, the DISPLAY variable is set properly, the Vim 'mouse'\noption is set correctly.\n\nIf Vim is able to detect that you are pasting text using the mouse, then\nthe pasted text will be inserted literally.\n\nIf Vim is not able to detect that you are pasting using the mouse, then\nit will see the pasted text as though you literally typed the text.\nAfter the first line from the pasted text is inserted, when Vim\nencounters the newline character, because of the indentation settings,\nthe next line will start indented. The spaces at the beginning of the\nsecond line in the pasted text will be inserted leading to additional\nindentation. This will be repeated for subsequent lines. So the pasted\ntext will be inserted with stair case indentation.\n\nYou can fix this problem in a terminal Vim in several ways:\n\n1. Build Vim with the +mouse and +xterm_clipboard compile-time options.\n   The normal or big or huge build of Vim includes these options.  Set\n   the 'mouse' option to either \"a\" or include \"i\".  When pasting text\n   using the mouse, don't press the Shift key. This will work only if\n   Vim can access the X display. For more information, read the\n   following Vim help topics:\n\n    :help +feature-list\n    :help 'mouse'\n    :help <MiddleMouse>\n    :help x11-selection\n    :help xterm-clipboard\n\n1.1 Some Linux distributions build their terminal vim packages\n    without X support.  This makes no sense and leaves many users\n    with the impression that Vim in terminal mode doesn't support\n    some operations such as properly pasting text with a mouse.\n\n    If your distribution includes gvim, which it almost certainly\n    does these days, the solutions to this include the following.\n\n    a)  Start Vim as\n\n            gvim -v\n\n    b)  Put this alias in your shell's configuration file, e.g.\n        ~/.bashrc:\n\n            alias vim='gvim -v'\n\n    c)  Put the following command in a file named \"vim\" and put that\n        file in your ~/bin directory:\n\n            gvim -v \"$@\"\n\n    d)  Link the distribution's gvim to ~/bin/vim with the following\n        command, which needs to be executed only once.\n\n            ln -s $(which gvim) ~/bin/vim\n\n    For c) and d), make sure that ~/bin precedes /usr/bin in your\n    PATH.\n\n2. Paste the text using the CTRL-R CTRL-O * command.  This will paste\n   the text literally without any automatic indentation. If you want to\n   paste the text and then fix the indentation, then you can use CTRL-R\n   CTRL-P *. These commands will work only if Vim can access the X\n   display. For more information, read the following Vim help topics:\n\n    :help i_CTRL-R_CTRL-O\n    :help i_CTRL-R_CTRL-P\n    :help quotestar\n\n3. Set the 'paste' option before pasting the text. This option will\n   disable the effect of all the indentation related settings. Make\n   sure to turn off this option using `:set nopaste` after pasting the\n   text. Otherwise the Vim indentation feature will not work.  Do not\n   permanently set the 'paste' option in your .vimrc file. If you are\n   going to repeat these steps often, then you can set the\n   'pastetoggle' option to a key. When you press the specified key,\n   the 'paste' option will be toggled. You can press the key once\n   before pasting the text and the press the key once after pasting\n   the text. Note that when the 'paste' option is set, all the\n   mappings and abbreviations are disabled.  For more information,\n   read the following Vim help topics:\n\n    :help 'paste'\n    :help 'pastetoggle'\n\nYou can also refer to the following topics in the user manual:\n\n    :help 04.7\n    :help 09.3\n\n\n14.15. When there is a very long wrapped line (wrap is \"on\") and a line\n      doesn't fit entirely on the screen it is not displayed at all. There\n      are blank lines beginning with \"@\" symbol instead of wrapped line. If\n      I scroll the screen to fit the line the \"@\" symbols disappear and the\n      line is displayed again. What Vim setting control this behavior?\n\nYou can set the 'display' option to \"lastline\" to display as much as\npossible of the last line in a window instead of displaying the \"@\"\nsymbols.\n\n    :set display=lastline\n\nFor more information, read:\n\n    :help 'display'\n\n\n14.16. How do I convert all the tab characters in a file to space\n       characters?\n\nYou can use the `:retab` command to update all the tab characters in the\ncurrent file with the current setting of 'expandtab' and 'tabstop'. For\nexample, to convert all the tabs to white spaces, use\n\n    :set expandtab\n    :retab\n\nFor more information, read:\n\n    :help :retab\n    :help 'expandtab'\n    :help 'tabstop'\n    :help 25.3\n\n\n14.17. What Vim options can I use to edit text that will later go to a word\n       processor?\n\nYou can set the following options to edit text that will later go into a\nword processor:\n\n    :set wrap\n    :set linebreak\n    :set textwidth=0\n    :set showbreak=>>>\n\nYou can use the \"gk\" and \"gj\" commands to move one screen line up and down.\nFor more information, read:\n\n    :help 'wrap'\n    :help 'linebreak'\n    :help 'textwidth'\n    :help 'showbreak'\n    :help gk\n    :help gj\n\n\n14.18. How do I join lines without adding or removing any space characters?\n\nBy default, when you join lines using the \"J\" or `:join` command, Vim will\nreplace the line break, leading white space and trailing white space with a\nsingle space character. If there are space characters at the end of a line\nor a line starts with the \")\" character, then Vim will not add a space\ncharacter.\n\nTo join lines without adding or removing any space characters, you can use\nthe gJ or `:join!` commands.\n\nFor more information, read:\n\n    :help gJ\n    :help :join\n    :help J\n    :help 10.5\n    :help 'joinspaces'\n    :help 'cpoptions'\n    :help 'formatoptions'\n\n\n=============================================================================\n\nSECTION 15 - VISUAL MODE\n\n\n15.1. How do I do rectangular block copying?\n\nYou can do rectangular block copying in Vim using the blockwise visual\nmode. To start blockwise visual mode use the CTRL-V key. Move the cursor\nusing any of the motion commands and then use the y operator to yank to\nvisually selected text.\n\nIf CTRL-V does not work as expected, it may have been remapped to CTRL-Q by\nthe mswin.vim script which is often sourced by a vimrc on Windows machines\nto mimic some common short cuts from other programs.\n\nFor more information, read:\n\n    :help 04.4\n    :help blockwise-visual\n    :help visual-mode\n    :help Q_vi\n\n\n15.2. How do I delete or change a column of text in a file?\n\nYou can use the Vim block-wise visual mode to select the column of text and\napply an operator (delete, change, copy, etc) on it.\n\nFor more information, read:\n\n    :help visual-block\n    :help visual-operators\n\n\n15.3. How do I apply an ex-command on a set of visually selected lines?\n\nWhen you select a range of lines in visual mode, the < register is set to\nthe start of the visual region and the > register is set to the end of the\nvisual region. You can use these registers to specify the range for an ex\ncommand. After visually selecting the lines, press \":\" to go to the command\nmode.  Vim will automatically insert the visual range '<,'>. You can run\nany ex-command on the visual range.\n\nFor more information, read:\n\n    :help v_:\n    :help '<\n    :help '>\n\n\n15.4. How do I execute an ex command on a column of text selected in Visual\n      block mode?\n\nAll the ex commands operate on whole lines only. If you try to execute\nan ex command on a column of text selected in visual block mode, Vim\nwill operate on all the selected lines (instead of the selected\ncolumns). You can use the vis.vim or NrrwRgn plugin script from\nhttps://www.vim.org scripts archive to do this.\n\nFor more information, read:\n\n    :help cmdline-ranges\n    :help 10.3\n    :help cmdline-lines\n\n\n15.5. How do I select the entire file in visual mode?\n\nYou can select the entire file in visual mode using ggVG.\n\n    gg - go to the beginning of the file.\n    V  - Start linewise visual mode\n    G  - goto the end of the file.\n\nFor more information, read:\n\n    :help gg\n    :help linewise-visual\n    :help G\n\n\n15.6. When I visually select a set of lines and press the > key to indent\n      the selected lines, the visual mode ends. How can I reselect the\n      region for further operation?  (or) How do I re-select the last\n      selected visual area again?\n\nYou can use the \"gv\" command to reselect the last selected visual area. You\ncan also use the marks '< and '> to jump to the beginning or the end of the\nlast selected visual area.\n\nFor more information, read:\n\n    :help gv\n    :help '<\n    :help '>\n\n\n15.7. How do I jump to the beginning/end of a visually selected region?\n\nYou can use the \"o\" command to jump to the beginning/end of a visually\nselected region.\n\nFor more information, read:\n\n    :help v_o\n\n\n15.8. When I select text with mouse and then press : to enter an ex\n      command, the selected text is replaced with the : character. How do I\n      execute an ex command on a text selected using the mouse similar to\n      the text selected using the visual mode?\n\nThis will happen if you have configured Vim to use select mode instead of\nVisual mode by setting the 'selectmode' option. Check the value of this\noption:\n\n    :set selectmode?\n\nThis mode is known as selectmode and is similar to the visual mode. This\noption is also automatically set when you use the \"behave mswin\" command.\nSelect mode looks like visual mode, but it is similar to the selection mode\nin MS-Windows.\n\nFor more information, read:\n\n    :help Select-mode\n    :help 'selectmode'\n    :help 09.4\n    :help :behave\n\n\n15.9. When I select a block of text using the mouse, Vim goes into\n      selection mode instead of Visual mode. Why?\n\nThe 'selectmode' option controls whether Select mode will be started when\nselecting a block of text using the mouse. To start Visual mode when\nselecting text using mouse, remove the \"mouse\" value from the 'selectmode'\noption:\n\n    :set selectmode-=mouse\n\nNote that by default, the 'selectmode' option will be set to empty, so that\nalways visual mode is used.\n\nFor more information, read:\n\n    :help 'selectmode'\n    :help Select-mode\n    :help :behave\n\n\n15.10. How do I visually select the last copy/pasted text?\n\nYou can use the '[ and '] marks to visually select the last copy/pasted\ntext. The '[ mark is set to the beginning of the last changed/yanked text\nand the '] mark is set to the end of the last changed/yanked text. To\nvisually select this block of text use the command '[v']\n\nFor more information, read:\n\n    :help '[\n    :help ']\n    :help `a\n    :help v\n\n\n=============================================================================\n\nSECTION 16 - COMMAND-LINE MODE\n\n\n16.1. How do I use the name of the current file in the command mode or an\n      ex command line?\n\nIn the command line, the \"%\" character represents the name of the current\nfile. In some commands, you have to use `expand(\"%\")` to get the filename:\n\n    :!perl %\n\nAnother example is to load the latex generated pdf file from the file you\nare currently editing:\n\n    :!xpdf %<.pdf\n\nFor more information, read:\n\n    :help :_%\n    :help cmdline-special\n    :help expand()\n\n\n16.2. How do I edit the text in the Vim command-line effectively?\n\nYou can use the command-line window for editing Vim command-line text. To\nopen the Vim command-line window use the \"q:\" command in normal mode. In\ncommand-line mode, use the CTRL-F key. In this window, the command line\nhistory will be displayed. You can use normal Vim keys/commands to edit any\nprevious/new command line. To execute a command line, press the\nenter/return key.\n\nIn a similar vain, the search history can be edited with \"q/\" and \"q?\"\ncommands.\n\nFor more information, read:\n\n    :help cmdline-window\n\n\n16.3. How do I switch from Vi mode to Ex mode?\n\nYou can use the Q command to switch from Vi mode to Ex mode. To switch from\nEx mode back to the Vi mode, use the `:vi` command.\n\nFor more information, read:\n\n    :help Q\n    :help gQ\n    :help Ex-mode\n    :help :vi\n\n\n16.4. How do I copy the output from an ex-command into a buffer?\n\nTo copy the output from an ex-command into a buffer, you have to first get\nthe command output into a register. You can use the `:redir` command to get\nthe output into a register. For example,\n\n    :redir @a\n    :g/HelloWord/p\n    :redir END\n\nNow the register \"a\" will contain the output from the ex command\n`:g/HelloWord/p`. Now you can paste the contents of the register \"a\" into a\nbuffer. You can also send or append the output of an ex-command into a file\nusing the `:redir` command.\n\nYou can prefix the `:global` command with `:silent`, to avoid having the\nlines printed to the screen.\n\nTo redirect the output from an ex-command to a file, you can use the\nfollowing set of commands:\n\n    :redir > myfile\n    :g/HelloWord/p\n    :redir END\n\nFor more information, read:\n\n    :help :redir\n    :help :silent\n\n\n16.5. When I press the <Tab> key to complete the name of a file in the\n      command mode, if there are more than one matching file names, then\n      Vim completes the first matching file name and displays a list of all\n      matching filenames. How do I configure Vim to only display the list\n      of all the matching filenames and not complete the first one?\n\nYou can modify the 'wildmode' option to configure the way Vim completes\nfilenames in the command mode. In this case, you can set the 'wildmode'\noption to \"list\":\n\n    :set wildmode=list\n\nFor more information, read:\n\n    :help 'wildmode'\n\n\n16.6. How do I copy text from a buffer to the command line and from the\n      command line to a buffer?\n\nTo copy text from a buffer to the command line, after yanking the text from\nthe buffer, use \"<CTRL-R>0\" in the command line to paste the text. You can\nalso yank the text to a specific register and use CTRL-R <register> to\npaste the text to the command line.  You can use CTRL-R CTRL-W to paste the\nword under the cursor in the command line.\n\nTo copy text from the command line into a buffer, you can paste the\ncontents of the : register using the \":p command. The most recently\nexecuted command line is stored in the : register.\n\nAnother approach for copying and pasting text to and from the command line\nis to open the command line window using q: from normal mode or CTRL-F from\nthe command-line mode. In the command line window you can use all the Vim\ncommands to edit the command line.\n\nFor more information, read:\n\n    :help c_CTRL-R\n    :help quote_:\n    :help cmdline-window\n\n\n16.7. How do I put a command onto the command history without executing it?\n\nTo put a command onto the command history without executing it, press the\n<Esc> key to cancel the command.\n\nAn alternative solution, is to use the histadd() function like this:\n\n    :call histadd(':', 'echo strftime(\"%c\")')\n\nFor more information, read:\n\n    :help c_<Esc>\n    :help histadd()\n\n\n16.8. How do I increase the height of the command-line?\n\nYou can increase the height of the command-line by changing the 'cmdheight'\noption:\n\n    :set cmdheight=2\n\nFor more information, read:\n\n    :help 'cmdheight'\n    :help hit-enter\n    :help 05.7\n\n\n=============================================================================\n\nSECTION 17 - VIMINFO\n\n\n17.1. When I invoke Vim, I get error messages about illegal characters in\n      the viminfo file. What should I do to get rid of these messages?\n\nYou can remove the $HOME/.viminfo or the $HOME/_viminfo file to get rid of\nthese error messages.\n\nFor more information, read:\n\n    :help viminfo-errors\n    :help viminfo-file-name\n    :help viminfo\n    :help 21.3\n\n\n17.2. How do I disable the viminfo feature?\n\nBy default, the viminfo feature is disabled. If the viminfo feature is\nenabled by a system-wide vimrc file, then you can disable the viminfo\nfeature by setting the 'viminfo' option to an empty string in your local\n.vimrc file:\n\n    :set viminfo=\"\"\n\nFor more information, read:\n\n    :help 'viminfo'\n\n\n17.3. How do I save and use Vim marks/commands across Vim sessions?\n\nYou can save and restore Vim marks across Vim sessions using the viminfo\nfile. To use the viminfo file, make sure the 'viminfo' option is not empty.\nTo save and restore Vim marks, the 'viminfo' option should not contain the\n\"f\" flag or should have a value greater than zero for the \"f\" option.\n\nYou can also use the viminfo file to synchronize the commandline history\nacross different sessions using `:wvimfo` and `:rviminfo` commands together\nwith the FocusGained and FocusLost autocommands:\n\n    augroup viminfo\n        au!\n        au FocusLost   * wviminfo\n        au FocusGained * rviminfo\n    augroup end\n\nNote, this will only work reliably, when Vim can detect the FocusLost\nand FocusGained autocommands correctly. This means it should work with\nGVim but might depend on your terminal for konsole vim.\n\nFor more information, read:\n\n    :help 21.3\n    :help viminfo\n    :help 'viminfo'\n    :help :wviminfo\n    :help :rviminfo\n    :help FocusLost\n    :help FocusGained\n\n\n=============================================================================\n\nSECTION 18 - REMOTE EDITING\n\n\n18.1. How do I open a file with existing instance of gvim? What happened to\n      the Vim 5.x OpenWithVim.exe and SendToVim.exe files?\n\nStarting with Vim6, the OLE version of OpenWithVim.exe and SendToVim.exe\nVim utilities are replaced by the new client-server feature. To open the\nfile j.txt with an existing instance of Gvim (MyVim), use:\n\n    $ gvim --servername MyVim --remote-silent j.txt\n\nTo list the server names of all the currently running Vim instances, use\n\n    $ vim --serverlist\n\nTo get more information about client-server feature, read\n\n    :help client-server\n\n\n18.2. How do I send a command to a Vim server to write all buffers to disk?\n\nYou can use the Vim remote server functionality to do this:\n\n    $ gvim --servername myVIM --remote-send \"<C-\\><C-N>:wall<CR>\"\n\nFor more information, read:\n\n    :help client-server\n    :help CTRL-\\_CTRL-N\n    :help :wall\n\n\n18.3. Where can I get the documentation about the Vim remote server\n      functionality?\n\nYou can get more information about the Vim remote server functionality by\nreading\n\n    :help client-server\n\n\n=============================================================================\n\nSECTION 19 - OPTIONS\n\n\n19.1. How do I configure Vim in a simple way?\n\nYou can use the `:options` command to open the Vim option window:\n\n    :options\n\nThis window can be used for viewing and setting all the options.\n\nFor more information, read:\n\n    :help :options\n\n\n19.2. How do I toggle the value of an option?\n\nYou can prefix the option with \"inv\" to toggle the value of the option:\n\n    :set invignorecase\n    :set invhlsearch\n\nYou can also suffix the option with \"!\" to toggle the value:\n\n    :set ignorecase!\n    :set hlsearch!\n\nFor more information, read:\n\n    :help set-option\n\n\n19.3. How do I set an option that affects only the current buffer/window?\n\nSome of the Vim options can have a local or global value. A local value\napplies only to a specific buffer or window. A global value applies to all\nthe buffers or windows.\n\nWhen a Vim option is modified using the `:set` command, both the global and\nlocal values for the option are changed. You can use the `:setlocal`\ncommand to modify only the local value for the option and the `:setglobal`\ncommand to modify only the global value.\n\nYou can use the `:setlocal` command to set an option that will affect only\nthe current file/buffer:\n\n    :setlocal textwidth=70\n\nNote that not all options can have a local value. You can use `:setlocal`\ncommand to set an option locally to a buffer/window only if the option is\nallowed to have a local value.\n\nYou can also use the following command to set an option locally:\n\n    :let &l:{option-name} = <value>\n\nFor more information, read:\n\n    :help :setlocal\n    :help local-options\n\n\n19.4. How do I use space characters for a Vim option value?\n\nTo use space characters in a Vim option value, you have to escape the space\ncharacter. For example:\n\n    :set tags=tags\\ /usr/tags\n\nFor more information, read:\n\n    :help option-backslash\n\n\n19.5. Can I add (embed) Vim option settings to the contents of a file?\n\nYou can use modelines to add Vim option settings to the contents of a file.\nFor example, in a C file, you can add the following line to the top or the\nbottom of the file:\n\n    /* vim:sw=4: */\n\nThis will set the 'shiftwidth' option to 4, when editing that C file.\nFor this to work, the 'modeline' option should be set. By default, the\n'modeline' option is set. An alternative example is given in this document\nin the first line.\n\nThe 'modelines' settings specifies the number of\nlines that will be checked for the Vim set commands.\n\nFor more information, read:\n\n    :help 21.6\n    :help modeline\n    :help auto-setting\n    :help 'modeline'\n    :help 'modelines'\n\n\n19.6. How do I display the line numbers of all the lines in a file?\n\nYou can set the 'number' option to display the line numbers for all the\nlines.\n\n    :set number\n\nFor more information, read:\n\n    :help 'number'\n\n\n19.7. How do I change the width of the line numbers displayed using the\n      'number' option?\n\nYou can set the minimum number of columns to be used for line numbering by\nsetting the 'numberwidth' option:\n\n    :set numberwidth=3\n\nThis set's the width for the line number to 3 digits, which is enough, if\nyour buffer contains less than 999 lines. However, if your current buffer\ncontains more lines than 999, the 'numberwidth' will be adjusted accordingly,\nso that the maximum line number will fit on the screen.\n\n\n19.8. How do I display (view) all the invisible characters like space, tabs\n      and newlines in a file?\n\nYou can set the 'list' option to see all the invisible characters in your\nfile.\n\n    :set list\n\nWith this option set, you can view space characters, tabs, newlines,\ntrailing space characters and wrapped lines.\n\nTo not display the invisible characters (which is the default), you have to\nreset the 'list' option:\n\n    :set nolist\n    (or)\n    :set list!\n\nThe `:set list!` command will toggle the current setting of the boolean\n'list' option.\n\nYou can modify the 'listchars' option to configure how and which invisible\ncharacters are displayed. For example, with the following command all the\ntrailing space characters will be displayed with a \".\" character.\n\n    :set listchars=trail:.\n\nFor more information, read:\n\n    :help 'listchars'\n    :help 'list'\n\n\n19.9. How do I configure Vim to always display the current line and column\n      number?\n\nYou can set the 'ruler' option to display current column and line number in\nthe status line:\n\n    :set ruler\n\nFor more information, read:\n\n    :help 'ruler'\n\n\n19.10. How do I display the current Vim mode?\n\nYou can set the 'showmode' option to display the current Vim mode. In\nInsert, Replace and Visual modes, Vim will display the current mode on the\nlast line.\n\n    :set showmode\n\nFor more information, read:\n\n    :help 'showmode'\n\n\n19.11. How do I configure Vim to show pending/partial commands on the\n       status line?\n\nYou can set the 'showcmd' option to display pending/partial commands in the\nstatus line:\n\n    :set showcmd\n\nFor more information, read:\n\n    :help 'showcmd'\n\n\n19.12. How do I configure the Vim status line to display different\n       settings/values?\n\nYou can set the 'statusline' option to display different values/settings in\nthe Vim status line.\n\nFor more information, read:\n\n    :help 'statusline'\n    :help 'laststatus'\n    :help 'rulerformat'\n    :help 'ruler'\n\n\n19.13. How do I configure Vim to display status line always?\n\nYou can set the 'laststatus' option to 2 to display the status line always.\n\n    :set laststatus=2\n\nFor more information, read:\n\n    :help 'laststatus'\n\n\n19.14. How do I make a Vim setting persistent across different Vim\n       invocations/instances/sessions?\n\nTo make a Vim option setting persistent across different Vim instances, add\nyour setting to the .vimrc or .gvimrc file. You can also use the `:mkvimrc`\ncommand to generate a vimrc file for the current settings.\n\nFor more information, read:\n\n    :help save-settings\n    :help vimrc\n    :help gvimrc\n    :help vimrc-intro\n    :help :mkvimrc\n    :help initialization\n\n\n19.15. Why do I hear a beep (why does my window flash) about 1 second after\n       I hit the Escape key?\n\nThis is normal behavior. If your window flashes, then you've got the visual\nbell on. Otherwise, you should hear a beep.\n\nVim needs a timeout to tell the difference between a simple escape and,\nsay, a cursor key sequence.  When you press a key in normal mode (and even\nin insert mode) and that key is the beginning of a mapping, Vim waits a\ncertain amount of time to see if the rest of the mapping sequence follows.\nIf the mapping sequence is completed before a given timeout period, the\nmapping for that sequence of keys is applied. If you interrupt the mapping,\nthe normal actions associated with the keys are executed.\n\nFor example, if you have a mapping defined as `:imap vvv Vim is great!!`\nand you type \"vvv\" quickly, the \"Vim is great!!\" will be inserted into your\ntext. But if you type \"vv v\" then that is what will put into your text.\nThis is also true if you type \"vvv\" too slowly where \"too slowly\" is longer\nthan the value for the timeout option. Setting the timeout option to a\nlarger value can help alleviate problems that appear when using function\nkeys over a slow line.\n\nFor more information, read:\n\n    :help 'ttimeout'\n\n\n19.16. How do I make the \"c\" and \"s\" commands display a \"$\" instead of\n       deleting the characters I'm changing?\n\nTo make the \"c\" and \"s\" commands display a \"$\" instead of deleting the\ncharacters, add the $ flag to the 'cpoptions' option:\n\n    :set cpoptions+=$\n\nFor more information, read:\n\n    :help 'cpoptions'\n\n\n19.17. How do I remove more than one flag using a single `:set` command\n       from a Vim option?\n\nYou can remove more than one flag from a Vim option using a single `:set`\ncommand, by specifying the flags in exactly the same order as they appear\nin the option. For example, if you use the following command to remove the\n\"t\" and \"n\" flags from the 'formatoptions' option:\n\n    :set formatoptions-=tn\n\nThe \"t\" and \"n\" flags will be removed from the 'formatoptions' option, only\nif the 'formatoptions' option contains these flags in this order: \"tn\".\nOtherwise, it will not remove the flags. To avoid this problem, you can\nremove the flags one by one:\n\n    :set formatoptions-=t formatoptions-=n\n\nFor more information, read:\n\n    :help :set-=\n\n\n=============================================================================\n\nSECTION 20 - MAPPING KEYS\n\n\n20.1. How do I know what a key is mapped to?\n\nTo see what a key is mapped to, use the following commands:\n\n    :map <key>\n    :map! <key>\n\nYou can also check the mappings in a particular mode using one of the\n`:cmap`, `:nmap`, `:vmap`, `:imap`, `:omap`, etc commands.\n\nTo find out, where the key has been mapped, prefix the `:verbose` command:\n\n    :verbose :map <key>\n\nFor more information, read:\n\n    :help map-listing\n    :help map-overview\n\n\n20.2. How do I list all the user-defined key mappings?\n\nYou can list all the user-defined key mappings using:\n\n    :map\n\nFor more information, read:\n\n    :help map-listing\n\n\n20.3. How do I unmap a previously mapped key?\n\nYou can unmap a previously mapped key using the `:unmap` command:\n\n    :unmap <key>\n    :unmap! <key>\n\nFor mode specific mappings, you can use one of the these commands:\n\n    :nunmap\n    :vunmap\n    :ounmap\n    :iunmap\n    :lunmap\n    :cunmap\n\nThe following command will fail to unmap a buffer-local mapped key:\n\n    :unmap <key>\n\nTo unmap a buffer-local mapped key, you have to use the <buffer> keyword in\nthe unmap command:\n\n    :unmap <buffer> <key>\n    :unmap! <buffer> <key>\n\nFor more information, read:\n\n    :help :unmap\n    :help map-modes\n    :help :map-local\n    :help mapleader\n\n\n20.4. I am not able to create a mapping for the <xxx> key. What is wrong?\n\n1) First make sure, the key is passed correctly to Vim. To determine if\n   this is the case, put Vim in Insert mode and then hit CTRL-V (or\n   CTRL-Q if your CTRL-V is remapped to the paste operation (e.g. on\n   Windows if you are using the mswin.vim script file) followed by your\n   key.\n\n   If nothing appears in the buffer (and assuming that you have\n   'showcmd' on, ^V remains displayed near the bottom right of the Vim\n   screen), then Vim doesn't get your key correctly and there is nothing\n   to be done, other than selecting a different key for your mapping or\n   using GVim, which should recognise the key correctly.\n\n2) Possibly, Vim gets your key, but sees it as no different than\n   something else. Say you want to map <Ctrl-Right>, then in Insert mode\n   hit CTRL-K followed by <Ctrl-Right>. If Vim displays <C-Right> it has\n   correctly seen the keystroke and you should be able to map it (by\n   using <C-Right> as your {lhs}). If it displays <Right> it has seen\n   the keystroke but as if you hadn't held <Ctrl> down: this means your\n   temrinal passes <Ctrl-Right> as if it were just <Right>. Anything else\n   means the key has been misidentified.\n\n3) If the key is seen, but not as itself and not as some recognizable\n   key, then there is probably an error in the terminal library for the\n   current terminal (termcap or terminfo database). In that case\n\n        :set term?\n\n   will tell you which termcap or terminfo Vim is using. You can try to\n   tell vim, what termcode to use in that terminal, by adding the\n   following to your vimrc:\n\n        if &term == <termname>\n            set <C-Right>=<keycode>\n        endif\n\n   where <termname> above should be replaced by the value of 'term'\n   (with quotes around it) and <keycode> by what you get when hitting\n   CTRL-V followed by <Ctrl-Right> in Insert mode (with nothing around\n   it). <C-Right> should be left as-is (9 characters). Don't forget that\n   in a `:set` command, white space is not allowed between the equal sign\n   and the value, and any space, double quote, vertical bar or backslash\n   present as part of the value must be backslash-escaped.\n\n   Now you should be able to see the keycode corresponding to the key\n   and you can create a mapping for the key using the following command:\n\n        :map <C-Right>  <your_command_to_be_mapped>\n\nFor more information, read:\n\n    :help map-keys-fails\n    :help :map-special-keys\n    :help key-codes\n\n\n20.5. Why does mapping the <C-...> key not work?\n\nThe only <Ctrl>-<printable-key> chords which Vim can reliably detect\n(because they are defined in the ASCII standard) are the following:\n\n        CTRL-@                 0x00            NUL\n        CTRL-A to CTRL-Z       0x01 to 0x1A\n        CTRL-a to CTRL-z       0x01 to 0x1A\n        CTRL-[                 0x1B            ESC\n        CTRL-\\                 0x1C\n        CTRL-]                 0x1D\n        CTRL-^                 0x1E\n        CTRL-_                 0x1F\n        CTRL-?                 0x7F            DEL\n\nMost of these, however, already have a function in Vim (and some are\naliases of other keys: CTRL-H and <BS>, CTRL-I and <Tab>, CTRL-M and <Enter>,\nCTRL-[ and <Esc>, CTRL-? and <Del>).\n\nThe \"safest\" keys to use in Vim for the {lhs} of a mapping are the F\nkeys, with or without Shift: <F2> to <F12> and <S-F1> to <S-F12>. (Some\nOSes, including mine, intercept <Ctrl-Fn> and <Alt-Fn>, which never reach an\napplication program such as vim or gvim).\n\nYou can try other combinations of <Ctrl> + any key, but they may either\nnot work everywhere (e.g. the terminal might not pass that key to Vim,\nor they might have unintended side effects (e.g. mapping <C-I> means\nalso to map <Tab>).\n\nThis is a known issue, that has been discussed and might be implemented\nin the future to enable Vim to distinguish between various keys even in\nconsole mode. (e.g.\nhttps://groups.google.com/d/msg/vim_dev/2bp9UdfZ63M/sajb9KM0pNYJ)\n\n\n20.6. How do I map the numeric keypad keys?\n\nFirst make sure that the numeric keypad keys are passed to Vim. Next, you\ncan use the following command to map the numeric keypad keys:\n\n    :map <kSomething>  <your_command>\n\nwhere, <kSomething> can be kHome, kEnd, kPageUp, kPageDown, kPlus, kMinus,\nkDivide, kMultiply, kEnter, etc.\n\nFor more information, read:\n\n    :help key-codes\n    :help terminal-options\n\n\n20.7. How do I create a mapping that works only in visual mode?\n\nYou can create mappings that work only in specific modes (normal, command,\ninsert, visual, etc). To create a mapping that works only in the visual\nmode, use the `:vmap` command:\n\n    :vmap <F3> <your mapping here>\n\nThis mapping will work in visual and select mode. If you want the map to\nwork only in visual mode (excluding select mode), use:\n\n\n    :xmap <F3> <your mapping here>\n\nand to have the mapping only work in select mode (but not visual mode),\nuse:\n\n    :smap <F3> <your mapping here>\n\nFor more information, read:\n\n    :help :vmap\n    :help :xmap\n    :help :smap\n    :help map-modes\n    :help 40.1\n\n\n20.8. How do I create a mapping that works only in normal and operator\n   pending mode (but not in visual mode)?\n\nUsing `:map` creates a mapping that works in normal, visual+select mode and\noperator pending mode. You can use `:nmap` to have the mapping only work in\nnormal mode and `:vmap` to have the mapping only be defined for visual and\nselect mode or use `:omap` to have the mapping only defined in operator\npending mode.\n\nBut if you want to have a mapping defined, that works in both operator\npending mode and normal mode, but not in visual and select mode, you need\nto first define the mapping using `:map` and afterwards delete the mapping\nfor visual and select mode:\n\n\t:map <f3> <your mapping here>\n\t:vunmap <f3>\n\n\n20.9. In a Vim script, how do I know which keys to use for my mappings, so\n      that the mapped key will not collide with an already used key?\n\nVim uses most of the keys in the keyboard. You can use the <leader> prefix\nin maps to define keys which will not overlap with Vim keys. For example:\n\n    :map <leader>S <C-W>s\n    :map <leader>j <C-W>j\n    :map <leader>k <C-W>k\n\nwhere by default <leader> gets substituted with a backslash (\\), so the\nuser would enter\n\n        \\s\n        \\j\n        \\k\n\nto invoke the above map commands. The user can change the mapleader\nvariable to be whatever they wanted:\n\n    :let mapleader = \",\"\n\nWhen writing a plugin or other script, more often than not, it is advisable\nto use `:noremap` instead of `:map` to avoid side effects from user defined\nmappings.\n\nFor more information, read:\n\n    :help <Leader>\n    :help <LocalLeader>\n    :help write-plugin\n\n\n20.10. How do I map the escape key?\n\nYou can map the Escape key to some other key using the `:map` command. For\nexample, the following command maps the escape key to CTRL-O.\n\n    :map <C-O> <Esc>\n\n\n20.11. How do I map a key to perform nothing?\n\nYou can map a key to <Nop> to perform nothing when the key is pressed. For\nexample, with the following mappings, the <F7> key will do nothing when\npressed.\n\n    :map <F7> <Nop>\n    :map! <F7> <Nop>\n\nFor more information, read:\n\n    :help <Nop>\n    :help :map\n    :help :map!\n    :help map-modes\n\n\n20.12. I want to use the <Tab> key to indent a block of text and <Shift-Tab>\n       key to unindent a block of text. How do I map the keys to do this?\n       This behavior is similar to textpad, visual studio, etc.\n\nUse the following mapping:\n\n    :inoremap <S-Tab> <C-O><lt><lt>\n    :nnoremap <Tab> >>\n    :nnoremap <S-Tab> <lt><lt>\n    :vnoremap <Tab> >\n    :vnoremap <S-Tab> <lt>\n\nNote, that the <S-Tab> mapping will work only if Vim receives the correct\nkey sequence. This is mostly the case with GUI Vim.\n\nFor more information, read:\n\n    :help :inoremap\n    :help :nnoremap\n    :help :vnoremap\n    :help <S-Tab>\n    :help i_CTRL-O\n    :help >>\n    :help <<\n    :help <lt>\n\n\n20.13. In my mappings the special characters like <CR> are not recognized.\n       How can I configure Vim to recognize special characters?\n\nCheck the value of the 'cpoptions' option:\n\n    :set cpoptions?\n\nIf this option contains the \"<\" flag, then special characters will not be\nrecognized in mappings. Remove the \"<\" flag from 'cpoptions' option:\n\n    :set cpo-=<\n\nAlso, check the value of the 'compatible' option:\n\n    :set compatible?\n\nThe 'compatible' option must be reset:\n\n    :set nocompatible\n\nFor more information, read:\n\n    :help 'cpoptions'\n    :help 'compatible'\n\n\n20.14. How do I use the \"|\" to separate multiple commands in a map?\n\nYou can escape the \"|\" character using backslash (\\) to use \"|\" in a map.\n\n    :map _l :!ls \\| more<CR>\n\nYou can also try the following command:\n\n    :map _l :!ls <bar> more<CR>\n\nThere are also other ways to do this.\n\nFor more information, read:\n\n    :help map_bar\n\n\n20.15. If I have a mapping/abbreviation whose ending is the beginning of\n       another mapping/abbreviation, how do I keep the first from expanding\n       into the second one?\n\nInstead of using the `:map lhs rhs` command, use the `:noremap lhs rhs`\ncommand. For abbreviations, use \"noreabbrev lhs rhs\". The \"nore\" prefix\nprevents the mapping or abbreviation from being expanded again.\n\nFor more information, read:\n\n    :help :noremap\n    :help :noreabbrev\n\n\n20.16. Why does it take a second or more for Vim to process a key,\n       sometimes when I press a key?\n\nMake sure you have not defined a mapping for this key using the following\ncommand:\n\n    :map <key>\n\nIf a mapping is defined for this key and the mapped key contains more than\none character, then Vim will wait for the next character to be pressed to\ndetermine whether it is the mapped key or not. For example, if you have\nmapped \"ab\", then if you press \"a\", Vim will wait for the next key to be\npressed. If the next key is \"b\", Vim will execute the mapped sequence.\nOtherwise, Vim will proceed with the normal processing of \"a\" followed by\nthe next key. If the 'timeout' option is set (which is the default), then\nVim will timeout after waiting for the period specified with the\n'timeoutlen' option (default is 1 second).\n\nFor more information, read:\n\n    :help map-typing\n    :help 'timeoutlen'\n    :help 'ttimeoutlen'\n    :help 'timeout'\n    :help 'ttimeout'\n    :help vt100-cursor-keys\n    :help slow-fast-terminal\n\n\n20.17. How do I map a key to run an external command using a visually\n       selected text?\n\nYou can the `:vmap` command to map a key in the visual mode. In the mapped\ncommand sequence, you have to first yank the text. The yanked text is\navailable in the '\"' register. Now, you can use the contents of this\nregister to run the external command. For example, to run the external\ncommand \"perldoc\" on a visually selected text, you can use the following\nmapping:\n\n    :vmap <F7> y:!exec \"!perldoc '\" . @\" . \"'\"<CR>\n\nIf you want the mapping to work in the visual mode, but not with the\nhighlighted text, you can use the following command:\n\n    :vmap <F7> :<C-U>!perldoc <cword><CR>\n\nThe above mapping will use the word under the cursor instead of the\nhighlighted text. Note the use of the <C-U> before invoking the \"perldoc\"\nexternal command. The <C-U> is used to erase the range of text selected in\nthe visual mode and displayed on the command line. If the visual range is\nnot removed using <C-U>, then the output from the external command will\nreplace the visually selected text.\n\nFor more information, read:\n\n    :help :vmap\n    :help quote_quote\n    :help :let-register\n    :help c_CTRL-U\n    :help :!cmd\n\n\n20.18. How do I map the CTRL-I key while still retaining the functionality\n       of the <Tab> key?\n\nThe CTRL-I key and the <Tab> key produce the same keycode, so Vim cannot\ndistinguish between the CTRL-I and the <Tab> key. When you map the CTRL-I\nkey, the <Tab> key is also mapped (and vice versa). The same restriction\napplies for the CTRL-[ key and the <Esc> key.\n\nFor more information, read:\n\n    :help keycodes\n\n\n20.19. How do I define a map to accept a count?\n\nUse the @= command to use an expression. For example,\n\n    nnoremap = @='3l'\n\nNow you can specify a count to the \"=\" command.\n\n    :help complex-repeat\n\n\n20.20. How can I make my normal mode mapping work from within Insert\n       Mode?\n\nMappings in normal mode can be executed after CTRL-O from insert mode as\nwell but if there are more commands included in the mapping {rhs}, only the\nfirst one will be executed in normal mode and the rest of {rhs} will be\nprinted literally in insert mode. One of ways to workaround this problem is\nto make {rhs} be one command, via wrapping it to the function. For example:\n\n    function GetFontNameOfFirstChar()\n    normal! 0\n    echo getfontname()\n    endfunction\n\n    :nmap <F9> :call GetFontNameOfFirstChar()<CR>\n\nA more technical and detailed solution to this problem follows and can\nbe found at https://groups.google.com/group/vim_dev/msg/75f1f2dfc00908bb\n\nNot every normal mode-mapping is automatically suitable for execution via\nCTRL-O from within insert mode; you need to explicitly design your mappings\nfor that purpose.\n\nThe CTRL-O command allows execution of one normal mode command from\nwithin insert mode, then returns to insert mode. If a normal mode mapping\nconcatenates multiple normal mode commands, this breaks down in temporary\nnormal mode and literally inserts the second part of the command into the\nbuffer instead. To support execution of normal mode mappings from within\ninsert mode, these strategies can be used:\n\n1) Instead of concatenating multiple normal mode commands, use one `:normal`\n    mapping:\n\n    :nnoremap <silent> zC :<C-U>normal! zCVzC<CR>\n\n2) Concatenate multiple Ex commands via <Bar> on the rhs:\n\n    :nnoremap zC :<C-U>call MyMap1()<Bar>call MyMap2()<CR>\n\n3) Shadow normal mode mappings by insert mode mappings that\n    re-enter normal mode, then invoke the normal mode mapping:\n\n    :nnoremap <silent> <SID>MyMap2 :<C-U>call MyMap2()<CR>\n    :inoremap <silent> <script> <SID>MyMap2 <C-\\><C-O><SID>MyMap2\n    :nnoremap <silent> <script> zC <SID>MyMap1<SID>MyMap2\n\n4) Normal mode mappings that consist of multiple Ex command lines (and\n    where Ex commands cannot be concatenated via <Bar>) replace `:<C-U>`\n    with <SID>NM; the <SID>NM mapping enters normal mode for one ex command\n    line:\n\n    :nnoremap <silent> <SID>NM :<C-U>\n    :inoremap <silent> <SID>NM <C-\\><C-O>:\n    :nnoremap <silent> <script> zC <SID>MyMap1<SID>NMcall MyMap2()<CR>\n\n5)  If none of the above is possible, at least force normal mode for\n    subsequent commands via CTRL-\\ CTRL-N to avoid accidental insertion\n    of the remainder of the mapping.\n\n    :nnoremap zC zC<C-\\><C-N>VzCzz\n\n\nFor more information, read:\n\n    :help i_CTRL-O\n    :help map_bar\n    :help i_CTRL-\\_CTRL-O\n    :help CTRL-\\_CTRL-N\n\n\n=============================================================================\n\nSECTION 21 - ABBREVIATIONS\n\n\n21.1. How do I auto correct misspelled words?\n\nYou can auto correct misspelled words using abbreviations. For example, the\nfollowing abbreviation can be used to correct \"teh\" with \"the\":\n\n    :abbreviate teh the\n\nVim supports abbreviations in insert mode, replace mode and command-line\nmode.\n\nFor more information, read:\n\n    :help 24.7\n    :help abbreviations\n    :help Q_ab\n\n\n21.2. How do I create multi-line abbreviations?\n\nYou can create multi-line abbreviations by embedding the \"<CR>\"\nkey code in the text:\n\n    iabbrev #c --------------<CR>-- Date:<CR>--<CR>---------\n\nWith the above abbreviation, when you type #c, it will be expanded to\nthe following text:\n\n--------------\n-- Date:\n--\n---------\n\nFor more information, read:\n\n    :help abbreviations\n\n\n21.3. When my abbreviations are expanded, an additional space character is\n      added at the end of the expanded text. How do I avoid this character?\n\nTo avoid an additional space character at the end of the expanded text, you\ncan expand the abbreviation by pressing the CTRL-] key.  The abbreviation\nwill be expanded without adding a space character at the end.\n\nAnother alternative is to use the following function and command:\n\n    function! Eatchar(pat)\n        let c = nr2char(getchar())\n        return (c =~ a:pat) ? '' : c\n    endfunction\n    command! -nargs=+ Iabbr execute \"iabbr\" <q-args> . \"<C-R>=Eatchar('\\\\s')<CR>\"\n\nNow, define your abbreviations using the new \"Iabbr\" command instead of the\nbuiltin `:iabbrev` command. With this command, after expanding the\nabbreviated text, the next typed space character will be discarded.\n\nFor more information, read:\n\n    :help abbreviations\n\n\n21.4. How do I insert the current date/time stamp into the file?\n\nYou can use the strftime() function to insert the current data/time stamp\nin a file. For example, you can use the following abbreviation:\n\n    iabbrev dts <C-R>=strftime(\"%y/%m/%d %H:%M\")<CR>\n\nWith this abbreviation, when you type dts in insert mode, it will be\nexpanded to the date/time stamp.\n\nSome other forms of the above abbreviation are listed below:\n\n    iabbrev mdyl <C-R>=strftime(\"%a %d %b %Y\")<CR>\n    iabbrev mdys <C-R>=strftime(\"%y%m%d\")<CR>\n    iabbrev mdyc <C-R>=strftime(\"%c\")<CR>\n    iabbrev hml  <C-R>=strftime(\"%d/%m/%y %H:%M:%S\")<CR>\n    iabbrev hms  <C-R>=strftime(\"%H:%M:%S\")<CR>\n\nFor more information, read:\n\n    :help strftime()\n    :help i_CTRL-R\n\n\n21.5. How do I prevent an abbreviation from expanding in insert mode?\n\nYou can prevent an abbreviation from expanding in insert mode by typing\nCTRL-V before the character after the abbreviated word.\n\nFor more information, read:\n\n    :help abbreviations\n\n\n=============================================================================\n\nSECTION 22 - RECORD AND PLAYBACK\n\n\n22.1. How do I repeat an editing operation (insertion, deletion, paste,\n      etc)?\n\nYou can repeat the last editing operation using the \".\" command. This will\nrepeat the last simple change like a insert, delete, change, paste, etc.\n\nFor more information, read:\n\n    :help 04.3\n    :help single-repeat\n    :help Q_re\n\n\n22.2. How I record and repeat a set of key sequences?\n\nYou can use the \"q\" command in normal mode to record a set of key sequences\nand store it in a register. For example, in the normal mode you can press q\nfollowed by a register name {0-9a-bA-Z\"} to start the recording.  To\nend/stop the recording press q again. You can playback/repeat the recorded\nkey sequences by pressing @ followed by the register name. e.g. @a.\n\nAnother approach is to start Vim with the \"-w\" command-line argument.\n\n    $ vim -w <file_name>\n\nVim will record all the characters typed in the session in the\nspecified file \"file_name\". You can use the recorded file with the \"-s\"\ncommand line argument to play it back:\n\n    $ vim -s <file_name>\n\nFor more information, read:\n\n    :help 10.1\n    :help recording\n    :help -w\n    :help -s\n\n\n22.3. How do I edit/modify a recorded set of key sequences?\n\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer, edit the pasted text and again\nyank the text into the register. You can also use the `:let` command to\nmodify the register. For example:\n\n    :let @a = \"iHello World\\<Esc>\"\n\nFor more information, read:\n\n    :help recording\n    :help 10.1\n    :help :let-register\n    :help <>\n    :help 'cpoptions'\n\n\n22.4. How do I write recorded key sequences to a file?\n\nThe recorded key sequences are stored in a register. You can paste the\ncontents of the register into a Vim buffer. Now you can save the buffer\ninto a file. You can also modify the pasted text and again yank into the\nregister to modify the recorded key sequence. For example, if you record a\nset of key sequences using qa ..... q. The recorded key sequences are\nstored in the register \"a\". You can paste the contents of register \"a\"\nusing \"ap.\n\nFor more information, read:\n\n    :help recording\n    :help 10.1\n\n\n22.5. I am using register 0 to record my key sequences (i.e. q0 .... q).\n      In the recorded key sequences, I am yanking some text. After the\n      first replay of the recorded key sequence, I am no longer able to\n      play it back.\n\nRegister 0 contains the text from the last yank operation. In your recorded\nkey sequence, when the yank is performed, register 0 is overwritten with\nthe yanked text. So your recording stored in register 0 is lost. You have\nto use some other register.\n\nFor more information, read:\n\n    :help registers\n\n\n=============================================================================\n\nSECTION 23 - AUTOCOMMANDS\n\n\n23.1. How do I execute a command when I try to modify a read-only file?\n\nYou can use the FileChangedRO autocommand event to execute a command when a\nread-only file is modified. For example, you can use this event to checkout a\nread-only file:\n\n    :autocmd FileChangedRO * call MyCheckoutFunction()\n\nFor more information, read:\n\n    :help FileChangedRO\n\n\n23.2. How do I execute a command every time when entering a buffer?\n\nYou can use the BufEnter autocommand event to execute a command every time\nwhen entering a buffer. For example:\n\n    :autocmd BufEnter *.c set formatoptions=croqt\n\nFor more information, read:\n\n    :help BufEnter\n\n\n23.3. How do I execute a command every time when entering a window?\n\nYou can use the WinEnter autocommand event to execute a command every time\nwhen entering a window. For example:\n\n    :autocmd WinEnter *.c call MyFunction()\n\nFor more information, read:\n\n    :help WinEnter\n\n\n23.4. From an autocmd, how can I determine the name of the file or the\n      buffer number for which the autocommand is executed?\n\nYou can use the special words <afile> or <abuf> in an autocmd to get the\nname of the file or the buffer number for which the autocommand is\nexecuted.\n\nFor more information, read:\n\n    :help :<afile>\n    :help :<abuf>\n    :help :<amatch>\n\n\n23.5. How do I automatically save all the changed buffers whenever Vim\n      loses focus?\n\nYou can define an autocommand for the FocusLost event which will save all\nthe modified buffers whenever Vim loses focus:\n\n    :autocmd FocusLost * wall\n\nFor more information, read:\n\n    :help FocusLost\n    :help :wall\n\n\n23.6. How do I execute/run a function when Vim exits to do some cleanup?\n\nYou can use VimLeave autocmd event to execute a function just before Vim\nexits. For example,\n\n    :autocmd VimLeave * call MyCleanupFunction()\n\nFor more information, read:\n\n    :help VimLeave\n\n\n=============================================================================\n\nSECTION 24 - SYNTAX HIGHLIGHT\n\n\n24.1. How do I turn off/on syntax highlighting?\n\nBy default, the Vim syntax highlighting is turned off. To enable the syntax\nhighlighting, you can use one of the following commands:\n\n    :syntax enable\n\n    or\n\n    :syntax on\n\nTo disable the syntax highlighting, you can use the following command:\n\n    :syntax off\n\nFor more information, read:\n\n    :help 06.1\n    :help 06.4\n    :help :syntax-enable\n    :help :syntax-on\n    :help :syn-clear\n\n\n24.2. How do I change the background and foreground colors used by Vim?\n\nVim uses the \"Normal\" highlight group for the background and foreground\ncolors. To change the foreground/background colors, you have to modify the\n\"Normal\" highlight group. For example, to set the background color to blue\nand foreground color to white, you can use\n\n    :highlight Normal ctermbg=blue ctermfg=white guibg=blue guifg=white\n\nIf you are using the Motif or the Athena version of the GUI Vim, then you\ncan modify the foreground and background resource names in the .Xdefaults\nfiles to change the colors:\n\n    Vim.foreground:     Black\n    Vim.background:     Wheat\n\nYou can also use the \"-foreground\" and \"-background\" command-line arguments\nto specify the foreground and background colors. These arguments are\nsupported only in the Motif or Athena versions:\n\n    $ gvim -foreground Black -background Wheat\n\nFor more information, read:\n\n    :help :highlight\n    :help .Xdefaults\n    :help -gui\n\n\n24.3. How do I change the highlight colors to suit a dark/light background?\n\nYou can set the 'background' option to either \"dark\" or \"light\" to change\nthe highlight colors to suit a dark/light background:\n\n    :set background=dark\n\nFor more information, read:\n\n    :help 'background'\n    :help 06.2\n\n\n24.4. How do I change the color of the line numbers displayed when the\n      `:set number` command is used?\n\nThe line numbers displayed use the LineNr highlighting group. To display\nthe current colors used, use\n\n    :hi LineNr\n\nTo change the color modify the LineNr highlight group. For example:\n\n    :hi linenr guifg=red guibg=black\n\nThis will give red numbers on a black background in GVIM.\n\nFor more information, read:\n\n    :help :highlight\n\n\n24.5. How do I change the background color used for a Visually selected\n      block?\n\nYou can modify the \"Visual\" highlight group to change the color used for a\nvisually selected block:\n\n    :highlight Visual guibg=red\n\nFor more information, read:\n\n    :help :highlight\n    :help hl-Visual\n\n\n24.6. How do I highlight the special characters (tabs, trailing spaces, end\n      of line, etc) displayed by the 'list' option?\n\nYou can modify the \"NonText\" and \"SpecialKey\" highlight groups to highlight\nthe special characters displayed by the 'list' option:\n\n    :highlight NonText guibg=red\n    :highlight SpecialKey guibg=green\n\nThe \"NonText\" highlighting group is used for \"eol\", \"extends\" and\n\"precedes\" settings in the 'listchars' option.  The \"SpecialKey\"\nhighlighting group is used for the \"tab\" and \"trail\" settings.\n\nFor more information, read:\n\n    :help 'listchars'\n    :help hl-NonText\n    :help hl-SpecialKey\n\n\n24.7. How do I specify a colorscheme in my .vimrc/.gvimrc file, so that Vim\n      uses the specified colorscheme every time?\n\nYou can specify the color scheme using the `:colorscheme` command in your\n.vimrc or .gvimrc file:\n\n    colorscheme evening\n\nFor more information, read:\n\n    :help :colorscheme\n\n\n24.8. Vim syntax highlighting is broken. When I am editing a file, some\n      parts of the file is not syntax highlighted or syntax highlighted\n      incorrectly.\n\nVim doesn't read the whole file to parse the text for syntax highlighting.\nIt starts parsing wherever you are viewing the file. That saves a lot of\ntime, but sometimes the colors are wrong. A simple fix is refreshing the\nscreen using the CTRL-L key. Or scroll back a bit and then forward again.\nYou can also use the command:\n\n    :syntax sync fromstart\n\nNote that this might considerably slow down the screen refreshing.\n\nFor more information, read:\n\n    :help :syn-sync\n    :help :syn-sync-first\n\n\n24.9. Is there a built-in function to syntax-highlight the corresponding\n      matching bracket?\n\nYes. Vim includes the matchparen Plugin as standard plugin that is enabled\nby default. Whenever the cursor moves over an item defined with the\n'matchpairs' option, Vim will highlight the corresponding bracket using the\nMatchParen highlighting group.\n\nHowever, if the corresponding parenthesis is not visible in the current\nwindow, the cursor won't jump to it.\n\nThe matchit plugin provides a similar function, that lets the cursor\njump to related items (e.g. \"if\", \"else\", \"endif\" items) and skips\nmatches in comments. This uses the % command to jump to corresponding\nitems. Though both plugins provide similar functions they are unrelated\nand work differently.\n\nFor more information, read:\n\n    :help matchparen\n    :help 'matchpairs'\n    :help matchit-install\n    :help matchit-intro\n\n\n24.10. How do I turn off the C comment syntax highlighting?\n\nYou can use the following command to turn off C comment syntax\nhighlighting:\n\n    :highlight clear comment\n\nFor more information, read:\n\n    :help ft-c-syntax\n\n\n24.11. How do I add my own syntax extensions to the standard syntax files\n       supplied with Vim?\n\nYou should not modify the syntax files supplied with Vim to add your\nextensions. When you install the next version of Vim, you will lose your\nchanges. Instead you should create a file under the ~/.vim/after/syntax\ndirectory with the same name as the original syntax file and add your\nadditions to this file.\n\nFor more information, read:\n\n    :help mysyntaxfile-add\n    :help 'runtimepath'\n\n\n24.12. How do I replace a standard syntax file that comes with the Vim\n       distribution with my own syntax file?\n\nYou can replace a standard syntax file that comes with the Vim distribution\nby creating a file with the same name as the original syntax file and\nplacing it in the vim runtime syntax (~/.vim/syntax) directory. For\nexample, to replace the c.vim syntax file in a Unix system, place the new\nc.vim in the ~/.vim/syntax directory. In a MS-Windows system, place the new\nsyntax file in the $HOME/vimfiles/syntax or $VIM/vimfiles/syntax directory.\n\nFor more information, read:\n\n    :help mysyntaxfile-replace\n    :help 44.11\n    :help mysyntaxfile\n\n\n24.13. How do I highlight all the characters after a particular column?\n\nYou can use the `:match` command to highlight all the characters after a\nparticular column:\n\n    :match Todo '\\%>75v.\\+'\n\nThis will highlight all the characters after the 75th column.\n\nYou can also set the 'colorcolumn' option to highlight a particular\ncolumn:\n\n   :set colorcolumn=+2\n\nwhich highlights 2 columns after the current 'textwidth' setting\n(alternatively, you can use the exact column number).\n\nFor more information, read:\n\n    :help :match\n    :help /\\%v\n    :help /\\+\n    :help /.\n    :help 'colorcolumn'\n\n\n24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax\n       highlighting into a HTML file?\n\nYou can use the 2html.vim script to convert a source file into a HTML file\nwith the Vim syntax highlighting. Use the following command:\n\n    :TOhtml\n\nFor more information, read:\n\n    :help convert-to-HTML\n    :help :TOhtml\n\n\n24.15. How do I list the definition of all the current highlight groups?\n\nYou can list the definition of all the current highlight groups using the\n`:highlight` (without any arguments) ex command.\n\nFor more information, read:\n\n    :help :highlight\n\n\n24.16. How can I embed one syntax highlighting language into another one?\n\nIt is possible to include one syntax highlighting into another one,\nhowever most of the currently deployed syntax highlighting scripts are\nnot prepared to be included into another syntax script.\n\nYou can however create your own custom script to define your own\nregions, which will be highlighted with a different language.\n\nSee the wiki for a comprehensive solution:\n\n    http://vim.wikia.com/wiki/Different_syntax_highlighting_within_regions_of_a_file\n\nFor more information, read:\n\n    :help :syn-include\n    :help sh-awk\n\n\n=============================================================================\n\nSECTION 25 - VIM SCRIPT WRITING\n\n\n25.1. How do I list the names of all the scripts sourced by Vim?\n\nYou can use the `:scriptnames` command to list the names of all the scripts\nsourced by Vim:\n\n    :scriptnames\n\nFor more information, read:\n\n    :help :scriptnames\n\n\n25.2. How do I debug Vim scripts?\n\nVim has built-in support for a primitive debugger to debug Vim plugins and\nscripts. Using this debugger you can set breakpoints and step through the\nplugin functions.\n\nFor more information, read:\n\n    :help debug-scripts\n    :help -D\n\n\n25.3. How do I locate the script/plugin which sets a Vim option?\n\nYou can use the `:verbose` command to locate the plugin/script which last\nmodified a Vim option. For example:\n\n    :verbose set textwidth?\n\nFor more information, read:\n\n    :help :set-verbose\n    :help :verbose\n\n\n25.4. I am getting some error/informational messages from Vim (possibly\n      when running a script), the messages are cleared immediately. How do\n      I display the messages again?\n\nYou can use the `:messages` command to display the previous messages.\n\n    :messages\n\nFor more information, read:\n\n    :help :messages\n    :help :echoerr\n    :help :echomsg\n    :help message-history\n\n\n25.5. How do I save and restore a plugin specific information across Vim\n      invocations?\n\nVim will save and restore global variables that start with an uppercase\nletter and don't contain a lower case letter. For this to work, the\n'viminfo' option must contain the \"!\" flag. Vim will store the variables in\nthe viminfo file.\n\nFor more information, read:\n\n    :help 'viminfo'\n    :help viminfo-file\n    :help variables\n\n\n25.6. How do I start insert mode from a Vim function?\n\nYou can use the `:startinsert` command to start the insert mode from inside\na Vim function.\n\nFor more information, read:\n\n    :help :startinsert\n\n\n25.7. How do I change the cursor position from within a Vim function?\n\nYou can use the cursor() function to position the cursor.\n\n        call cursor(lnum, col)\n\nAlternatively, use the setpos() function:\n\n        call setpos('.', [bufnum, lnum, col, off])\n\nwhich set's the cursor in the buffer bufnum to line lnum, column col and\noffset for 'virtualedit'. You can use the getpos() function, to return a\nlist with these values, that can then be fed back to the setpos() function.\n\nIf you want to save and restore the viewpoint on a window, use the\nwinsaveview() and winrestview() function calls.\n\nYou can also use the following command to change the cursor position:\n\n        exe \"normal! \" . lnum . \"G\" . col . \"|\"\n\nFor more information, read:\n\n    :help cursor()\n    :help bar\n    :help getpos()\n    :help setpos()\n    :help winsaveview()\n    :help winrestview()\n\n\n25.8. How do I check the value of an environment variable in the .vimrc\n      file?\n\nYou can use prefix the environment variable name with the \"$\" character to\nuse it from a Vim script/function.  You can refer to the value of an\nenvironment variable using the $env_var syntax:\n\n    if $EDITOR == 'vi'\n    endif\n\nFor more information, read:\n\n    :help expr-env\n\n\n25.9. How do I check whether an environment variable is set or not from a\n      Vim function?\n\nYou can use the exists() function to check for the existence of an\nenvironment variable.\n\n    if exists(\"$MY_ENV_VAR\")\n    endif\n\nFor more information, read:\n\n    :help exists()\n    :help expr-env\n\n\n25.10. How do I call/use the Vim built-in functions?\n\nYou can use the `:call` command to invoke a Vim built-in function:\n\n    :call cursor(10,20)\n\nYou can use the `:echo` command to echo the value returned by a function:\n\n    :echo char2nr('a')\n\nYou can use the `:let` command to assign the value returned by a function\nto a variable:\n\n    :let a = getline('.')\n\nTo store the return value from a function into a Vim register, you can use\nthe following command:\n\n    :let @a = system('ls')\n\nThe above command will store the output of the \"ls\" command into\nthe register \"a\".\n\nFor more information, read:\n\n    :help :call\n    :help :echo\n    :help :let\n    :help :let-register\n    :help user-functions\n    :help usr_41.txt\n\n\n25.11. I am using some normal mode commands in my Vim script. How do I\n       avoid using the user-defined mappings for these normal mode commands\n       and use the standard Vim functionality for these normal mode\n       commands?\n\nYou can use the `:normal!` command in your script to invoke a normal-mode\ncommand. This will use the standard functionality of the normal mode\ncommand and will not use the user-defined mapping.\n\nFor more information, read:\n\n    :help :normal\n\n\n25.12. How do I get the current visually selected text into a Vim variable\n       or register?\n\nYou can get the current visually selected text into a Vim variable by\nyanking the text into Vim register and then assigning the contents of the\nregister into the variable:\n\n    :normal! gvy\n    :let myvar = @\"\n\nThe above command copies the visually selected text into the variable\n\"myvar\".\n\nYou can also use the command:\n\n    :normal! gv\"*y\n\nIn the above command, gv reselects the last visually selected text and the\nrest of the command copies the selected text into the * (clipboard)\nregister. Alternatively, you can set the \"a\" flag in the 'guioptions'\noption to automatically copy a visually selected text into the * register.\nTo do this as part of a visual map, you can use a command similar to the\none shown below:\n\n    :vmap <F3> \"*y:call ...\n\n\nFor more information, read:\n\n    :help gv\n    :help :normal\n    :help :let-@\n    :help quotestar\n    :help clipboard\n    :help registers\n\n\n25.13. I have some text in a Vim variable \"myvar\". I would like to use this\n       variable in a `:s` substitute command to replace a text \"mytext\".\n       How do I do this?\n\nYou can use the `:execute` command to evaluate the variable:\n\n    :execute '%s/mytext/' . myvar . '/'\n\nFor more information, read:\n\n    :help :execute\n\nYou can also use \"\\=\" in the substitute command to evaluate the variable:\n\n    :%s/mytext/\\=myvar/\n\nFor more information, read:\n\n    :help sub-replace-special\n\n\n25.14. A Vim variable (bno) contains a buffer number. How do I use this\n       variable to open the corresponding buffer?\n\nThe `:buffer` command will not accept a variable name. It accepts only a\nbuffer number or buffer name. You have to use the `:execute` command to\nevaluate the variable into the corresponding value. For example:\n\n    :execute \"buffer \" . bno\n\nFor more information, read:\n\n    :help :execute\n\n\n25.15. How do I store the value of a Vim option into a Vim variable?\n\nYou can prefix the option name with the \"&\" character and assign the option\nvalue to a Vim variable using the `:let` command. For example, to store the\nvalue of the 'textwidth' option into the Vim variable \"old_tw\", you can use\nthe following command:\n\n    :let old_tw = &tw\n\nTo explicitly save buffer local options, use the prefix \"l:\"\n\n    :let old_tw = &l:tw\n\nIf you want to explicitly select the global option, use the \"g:\" prefix to\nthe option name.\n\nTo do the opposite, to set the 'textwidth' option with the value stored in\nthe \"old_tw\" variable, you can use the following command:\n\n    :let &tw = old_tw\n\nFor more information, read:\n\n    :help expr-option\n    :help :let-option\n\n\n25.16. I have copied and inserted some text into a buffer from a Vim\n       function. How do I indent the inserted text from the Vim function?\n\nYou can use the following command to format the just inserted text:\n\n    :normal '[=']\n\nFor more information, read:\n\n    :help '[\n    :help ']\n    :help =\n    :help :normal\n\n\n25.17. How do I get the character under the cursor from a Vim script?\n\nYou can use the getline() function and use string index [] to get the\ncharacter:\n\n    :echo getline(\".\")[col(\".\") - 1]\n\nIn the above command, getline(\".\") returns  the text in the current line.\nThe indexing of the string starts at zero, and you can get a single\ncharacter in a string by its index with the \"string[index]\" notation. The\ncol(\".\") returns the column of the cursor position; the adjustment is to\nget the right character of the string. However, this does NOT work with\nmultibyte characters as this command only returns the byte index.\n\nAlternatively, you can use the following sequence of commands to get the\ncharacter under the cursor:\n\n    normal! vy\n    let ch=@\"\n\nNote, that the above commands will change the '< and '> marks.\n\nFor more information, read:\n\n    :help getline()\n    :help col()\n    :help expr-[]\n\n\n25.18. How do I get the name of the current file without the extension?\n\nYou can get the name of the current file without the extension using:\n\n    :echo expand(\"%:r\")\n\nWith some commands, you can use the file name modifiers directly:\n\n    :cd %:p:h\n    :!gcc -o %:r.o %\n    :!xpdf %<.pdf\n\nFor more information, read:\n\n    :help filename-modifiers\n    :help expand()\n    :help cmdline-special\n    :help fnamemodify()\n\n\n25.19. How do I get the basename of the current file?\n\nYou can use the \":t\" filename modifier to get the basename of the current\nfile:\n\n    :echo expand(\"%:t\")\n\nFor more information, read:\n\n    :help filename-modifiers\n\n\n25.20. How do I get the output from a Vim function into the current buffer?\n\nYou can insert the return value from a function using the following command\nin insert mode:\n\n    <C-R>=MyFunc()\n\nNote, that this will only insert the return value of the function.\n\nFor more information, read:\n\n    :help i_CTRL-R\n    :help i_CTRL-R_CTRL-R\n    :help i_CTRL-R_CTRL-O\n    :help expression\n\n\n25.21. How do I call external programs from a Vim function?\n\nThere are several ways to call external programs from a Vim function. You\ncan use the builtin system() function to invoke external programs and get\nthe result:\n\n    :let output = system(\"ls\")\n\nYou can also use \"!\" ex-command to run an external command.\n\nFor more information, read:\n\n    :help system()\n    :help :!\n    :help 10.9\n\n\n25.22. How do I get the return status of a program executed using the `:!`\n       command?\n\nYou can use the predefined Vim v:shell_error variable to get the return\nstatus of the last run shell command.\n\nFor more information, read:\n\n    :help v:shell_error\n\n\n25.23. How do I determine whether the current buffer is modified or not?\n\nYou can check the value of the 'modified' option to determine whether the\ncurrent buffer is modified:\n\n    :set modified?\n\nFrom a Vim script, you can check the value of the 'modified' option:\n\n    if &modified\n        echo \"File is modified\"\n    endif\n\nFor more information, read:\n\n    :help 'modified'\n\n\n25.24. I would like to use the carriage return character in a normal\n       command from a Vim script. How do I specify the carriage return\n       character?\n\nYou can use the `:execute` command to specify the special (control)\ncharacter in a normal mode command:\n\n    :execute \"normal \\<CR>\"\n    :execute \"normal ixxx\\<Esc>\"\n\nFor more information, read:\n\n    :help :execute\n    :help expr-quote\n\n\n25.25. How do I split long lines in a Vim script?\n\nYou can split long lines in a Vim script by inserting the backslash\ncharacter (\"\\\") at the start of the next line. For example,\n\n    set comments=sr:/*,mb:*,el:*/,\n                \\://,\n                \\b:#,\n                \\:%,\n                \\n:>,\n                \\fb:-\n\nFor more information, read:\n\n    :help line-continuation\n\n\n25.26. When I try to \"execute\" my function using the `:execute Myfunc()`\n       command, the cursor is moved to the top of the current buffer.\n       Why?\n\nThe `:execute` command runs the ex command specified by the argument.\nIn the case of the following command:\n\n    :execute Myfunc()\n\nThe call to Myfunc() will return 0. The `:execute` command will run\nthe ex command `:0`, which moves the cursor to the top of the file.\nTo call a Vim function, you should use the `:call` command instead of the\n`:execute` command:\n\n    :call Myfunc()\n\nFor more information, read:\n\n    :help :call\n    :help :execute\n    :help :echo\n    :help user-functions\n    :help 41.5\n    :help 41.6\n    :help cmdline-lines\n\n\n25.27. How do I source/execute the contents of a register?\n\nIf you have yanked a set of Vim commands into a Vim register (for example\nregister \"a\"), then you can source the contents of the register using one\nof the following commands:\n\n    :@a\nor\n    :exe @a\n\nFor more information, read:\n\n    :help :@\n\n\n25.28. After calling a Vim function or a mapping, when I press the \"u\"\n       key to undo the last change, Vim undoes all the changes made by\n       the mapping/function. Why?\n\nWhen you call a function or a mapping, all the operations performed by the\nfunction/mapping are treated as one single operation. When you undo the\nlast operation by pressing \"u\", all the changes made by the\nfunction/mapping are reversed.\n\nFor more information, read:\n\n    :help undo-redo\n    :help :map-undo\n\n\n25.29. How can I call a function defined with s: (script local function)\n       from another script/plugin?\n\nThe s: prefix for a Vim function name is used to create a script local\nfunction. A script local function can be called only from within that\nscript and cannot be called from other scripts. To define a function in a\nscript/plugin, so that it can be called from other plugins/scripts, define\nthe function without the s: prefix.\n\nFor more information, read:\n\n    :help script-variable\n    :help script-local\n    :help :scriptnames\n\n\n25.30. Is it possible to un-source a sourced script? In other words, reverse\n       all the commands executed by sourcing a script.\n\nNo. It is not possible to reverse or undo all the commands executed by\nsourcing a script.\n\nFor more information, read:\n\n    :help :source\n\n\n=============================================================================\n\nSECTION 26 - PLUGINS\n\n\n26.1. How do I set different options for different types of files?\n\nYou can create filetype plugins to set different options for different\ntypes of files. You should first enable filetype plugins using the command:\n\n    :filetype plugin on\n\nA filetype plugin is a vim script that is loaded whenever Vim opens or\ncreates a file of that type.  For example, to ensure that the 'textwidth'\noption is set to 80 when editing a C program (filetype \"c\"), create one of\nthe following files:\n\n        ~/.vim/ftplugin/c.vim (Unix)\n        %HOME%\\vimfiles\\ftplugin\\c.vim (Windows)\n\nwith the following text in it:\n\n        setlocal textwidth=80\n\nYou can also use autocommands to set specific options when editing specific\ntype of files. For example, to set the 'textwidth' option to 75 for only\n*.txt files, you can use the following autocmd:\n\n    autocmd BufRead *.txt setlocal textwidth=80\n\nFor more information, read:\n\n    :help filetype-plugin\n    :help add-filetype-plugin\n    :help :autocmd\n    :help 40.3\n\n\n26.2. I have downloaded a Vim plugin or a syntax file or a indent file, or\n      a color scheme or a filetype plugin from the web. Where should I copy\n      these files so that Vim will find them?\n\nYou can place the Vim runtime files (plugins, syntax files, indent files,\ncolor schemes, filetype plugins, etc) under one of the directories\nspecified in the 'runtimepath' option. To determine the current value of\nthe 'runtimepath' option, use the following command:\n\n    :set runtimepath\n\nFor Unix systems, this is usually the \"$HOME/.vim\" directory. For MS-Windows\nsystems, this is usually the $VIM\\vimfiles or $HOME\\vimfiles directory.\nDepending on the type of the runtime file, you have to place it under a\nspecific directory under the above runtime directory. The names of the\ndirectories are listed below:\n\n    name        description\n    ----------  ------------------\n    colors/     color scheme files\n    compiler/   compiler files\n    doc/        documentation\n    ftplugin/   filetype plugins\n    indent/     indent scripts\n    keymap/     key mapping files\n    lang/       menu translations\n    plugin/     plugin scripts\n    syntax/     syntax files\n    tutor/      files for vimtutor\n\nFor more information, read:\n\n    :help your-runtime-dir\n    :help 'runtimepath'\n    :help :runtime\n\n\n26.3. How do I extend an existing filetype plugin?\n\nYou can extend an existing filetype plugin by creating a file in the\nafter/ directory in any of the 'runtimepath' directories.\n\n\n- for small changes to be done after (and in addition to) what is\n  already done by the ftplugin installed with Vim, use an after-directory,\n  as follows (replacing foobar by the 'filetype' of the concerned\n  files):\n    - For changes private to one user:\n        - on Windows:\n            $HOME/vimfiles/after/ftplugin/foobar.vim\n        - on Unix-like OSes:\n            $HOME/.vim/after/ftplugin/foobar.vim\n    - For changes affecting all users on the system:\n        $VIM/vimfiles/after/ftplugin/foobar.vim\n\n- when replacing the whole filetype-plugin by a different version, or\n  when installing a new ftplugin for some filetype not yet supported by\n  Vim out of the box: use the same paths without the after/ in them. In\n  that case you should place near the start of your plugin an \"if...\n  finish... endif... let\" block like the one in the plugins distributed\n  with Vim.\n\nAll the above paths are given in Vim terminology (which is similar to\nUnix terminology, but is understood even by Vim for Windows); they don't\nexist by default, so the first time you need them you will have to\ncreate them using mkdir (on any OS including DOS/Windows) or md (on\nDOS/Windows only). $VIM and, on DOS/Windows, $HOME, do not necessarily\nexist outside Vim. If $HOME has no value (or no valid value) inside Vim,\nyou can use $VIM instead; but on any but possibly very old versions of\nWindows, $HOMEDRIVE and $HOMEPATH are defined by the system, and if\n$HOME is undefined at Vim startup, Vim will set it by expanding\n$HOMEDRIVE$HOMEPATH before sourcing your vimrc. To know which values Vim\nuses, you can type (in a running Vim):\n\n    :echo $VIM\n    :echo $HOME\n\n\nIf you placed the file in the after/ftplugin runtime directory, then Vim\nwill first source the existing filetype plugin file and then will source\nthe new file.  If you placed the file in the $VIMRTUNTIME/ftplugin runtime\ndirectory, then Vim will first source the new file and then will source the\nexisting filetype plugin file.\n\nFor more information, read:\n\n    :help ftplugin-overrule\n    :help filetype-plugin\n    :help add-filetype-plugin\n    :help 'runtimepath'\n\n\n26.4. How do I turn off loading the Vim plugins?\n\nYou can reset the 'loadplugins' option to turn off loading the plugins:\n\n    :set noloadplugins\n\nYou can also specify the \"--noplugin\" command line argument to stop loading\nthe plugins:\n\n    $ vim --noplugin\n\nFor more information, read:\n\n    :help 'loadplugins'\n    :help --noplugin\n    :help load-plugins\n\n\n26.5. How do I turn on/off loading the filetype plugins?\n\nBy default, Vim will not load the filetype plugins. You can configure Vim\nto load filetype plugins using the command:\n\n    filetype plugin on\n\nYou can turn off loading the filetype plugins using:\n\n    filetype plugin off\n\nFor more information, read:\n\n    :help :filetype-plugin-on\n    :help :filetype-plugin-off\n    :help :filetype\n\n\n26.6. How do I override settings made in a file type plugin in the global\n      ftplugin directory for all the file types?\n\nYou can use an autocommand triggered on the FileType event:\n\n    au Filetype * set formatoptions=xyz\n\nThis should at least be after \"filetype on\" in your vimrc. Best is to put\nit in your \"myfiletypefile\" file, so that it's always last.\n\nIf you want to override a setting for a particular filetype, then create a\nfile with the same name as the original filetype plugin in the\n~/.vim/after/ftplugin directory For example, to override a setting in the\nc.vim filetype plugin, create a c.vim file in the ~/.vim/after/ftplugin\ndirectory and add your preferences in this file.\n\nFor more information, read:\n\n    :help ftplugin-overrule\n    :help ftplugins\n    :help myfiletypefile\n\n\n26.7. How do I disable the Vim directory browser plugin?\n\nTo disable the directory browsing Vim plugin, add the following line to\nyour .vimrc file:\n\n    let g:loaded_netrw = 1\n\nFor more information, read:\n\n    :help netrw\n\n\n26.8. How do I set the filetype option for files with names matching a\n      particular pattern or depending on the file extension?\n\nYou can set the 'filetype' option for files with names matching a\nparticular pattern using an autocmd. For example, to set the 'filetype'\noption to \"c\" for all files with extension \".x\", you can use the following\nautocmd:\n\n    autocmd! BufRead,BufNewFile *.x     setfiletype c\n\nA better alternative to the above approach is to create a filetype.vim file\nin the ~/.vim directory (or in one of the directories specified in the\n'runtimepath' option) and add the following lines:\n\n    \" my filetype file\n    if exists(\"did_load_filetypes\")\n        finish\n    endif\n    augroup filetypedetect\n        au! BufRead,BufNewFile *.x       setfiletype c\n    augroup END\n\nFor more information, read:\n\n    :help new-filetype\n    :help 43.2\n    :help :setfiletype\n\n\n=============================================================================\n\nSECTION 27 - EDITING PROGRAM FILES\n\n\n27.1. How do I enable automatic indentation for C/C++ files?\n\nYou can enable file-type based indentation using:\n\n    :filetype indent on\n\nIf you want to only enable automatic C indentation, then use:\n\n    :set cindent\n\nFor more information, read:\n\n    :help 'cindent'\n    :help C-indenting\n    :help filetype\n\n\n27.2. How do I configure the indentation used for C/C++ files?\n\nYou can configure the Vim C indentation by modifying the value of the\n'cinoptions', 'cinkeys' and 'cinwords' options.\n\nFor more information, read:\n\n    :help 'cindent'\n    :help 'cinoptions'\n    :help 'cinkeys'\n    :help 'cinwords'\n    :help C-indenting\n    :help cinoptions-values\n    :help 'smartindent'\n\n\n27.3. How do I turn off the automatic indentation feature?\n\nBy default, the automatic indentation is not turned on. You must have\nconfigured Vim to do automatic indentation in either .vimrc or .gvimrc\nfiles. You can disable automatic indentation using either,\n\n    :filetype indent off\n\nor\n\n    :set nocindent\n\nAlso, check the setting for the following options:\n\n    :set autoindent?\n    :set smartindent?\n    :set indentexpr?\n\nFor more information, read:\n\n    :help 'cindent'\n    :help :filetype-indent-off\n    :help 'autoindent'\n    :help 'smartindent'\n    :help 'indentexpr'\n\n\n27.4. How do I change the number of space characters used for the automatic\n      indentation?\n\nYou can modify the 'shiftwidth' option to change the number of space\ncharacters used for the automatic indentation:\n\n    :set shiftwidth=4\n\nFor more information, read:\n\n    :help 'shiftwidth'\n\n\n27.5. I am editing a C program using Vim. How do I display the definition\n      of a macro or a variable?\n\nYou can use the \"[d\" command to display the definition of a macro, \"[i\"\ncommand to display the definition of a variable, \"gd\" to goto the local\ndeclaration of a variable and \"gD\" to go to the global Declaration.\n\nFor more information, read:\n\n    :help [d\n    :help [i\n    :help gd\n    :help gD\n    :help include-search\n    :help 29.4\n    :help 29.5\n\n\n27.6. I am editing a C program using Vim. How do I jump to the beginning or\n      end of a code block from within the block?\n\nYou can use \"[{\" command to jump to the beginning of the code block and \"]}\"\nto jump to the end of the code block from inside the block.\n\nFor more information, read:\n\n    :help [{\n    :help ]}\n    :help various-motions\n\n\n27.7. When editing C++ files and when inserting new lines above or below a\n      comment (//) line, Vim automatically inserts the C++ comment\n      character (//) at the beginning of the line. How do I disable this?\n\nThis automatic insertion of the comment leader (//) when new lines\nare added is controlled by three flags in the 'formatoptions'\noption:  \"c\", \"r\" and \"o\".  \"c\" enables auto-wrapping of comment\nlines when typing extends beyond the right margin.  \"r\" enables the\nautomatic insertion of the comment leader when <Enter> is pressed\nwhile editing a comment line.  \"o\" enables the automatic insertion\nof the comment leader when a new line is opened above or below an\nexisting comment line by typing O or o in Normal mode.\n\nYou can stop Vim from automatically inserting the comment leader\nwhen typing <Enter> within a comment or when opening a new line by\nremoving the \"r\" and \"o\" flags from 'formatoptions'.\n\n   :set formatoptions-=r\n   :set formatoptions-=o\n\nThe default filetype plugin for C and C++ files\n($VIMRUNTIME/ftplugin/c.vim) adds the \"r\" and \"o\" flags to the\n'formatoptions' option.  If you want to override this for C++ files,\nthen you can add the above lines to the\n~/.vim/after/ftplugin/cpp.vim file.\n\nFor more information, read:\n\n    :help 'formatoptions'\n    :help 30.6\n    :help format-comments\n    :help filetype-plugins\n    :help ftplugin-overrule\n\n\n27.8. How do I add the comment character \"#\" to a set of lines at the\n      beginning of each line?\n\nFirst, select the first character in all the lines using visual block mode\n(CTRL-V). Press \"I\" to start inserting characters at the beginning of the\nline. Enter the comment character and then stop the insert mode by pressing\n<Esc>. Vim will automatically insert the entered characters at the\nbeginning of all the selected lines.\n\nFor more information, read:\n\n    :help visual-block\n    :help blockwise-operators\n    :help v_b_I\n\n\n27.9. How do I edit a header file with the same name as the corresponding C\n      source file?\n\nYou can use the following command to edit a header file with the same name\nas the corresponding C source file:\n\n    :e %:t:r.h\n\nYou can use the following command to edit the file in a new split window:\n\n    :sp %:t:r.h\n\nIn the above commands, the percent sign expands to the name of the current\nfile.  The `:t` modifier extracts the tail (last component) of the\nfilename. The `:r` modifier extracts the root of the filename.  The .h is\nappended to the resulting name to get the header filename.\n\nAnother approach is to use the following command:\n\n    :sfind %:t:r.h\n\nThis command will search for the header file in the directories specified\nin the 'path' option.\n\nFor more information, read:\n\n    :help cmdline-special\n    :help filename-modifiers\n    :help :sfind\n    :help 'path'\n\n\n27.10. How do I automatically insert comment leaders while typing comments?\n\nTo automatically insert comment leaders while typing comments, add the \"r\"\nand \"o\" flags to the 'formatoptions' option.\n\n    :set formatoptions+=ro\n\nYou may also want to add the \"c\" flag to auto-wrap comments using the\n'textwidth' option setting and the \"q\" flag to format comments with the\n\"gq\" command:\n\n    :set formatoptions=croq\n\nFor more information, read:\n\n    :help 30.6\n    :help format-comments\n    :help 'comments'\n    :help fo-table\n\n\n=============================================================================\n\nSECTION 28 - QUICKFIX\n\n\n28.1. How do I build programs from Vim?\n\nYou can use the `:make` command to build programs from Vim. The `:make`\ncommand runs the program specified by the 'makeprg' option.\n\nFor more information, read:\n\n    :help 30.1\n    :help :make_makeprg\n    :help 'makeprg'\n    :help 'makeef'\n    :help :make\n    :help quickfix\n\n\n28.2. When I run the make command in Vim I get the errors listed as the\n      compiler compiles the program. When it finishes this list disappears\n      and I have to use the `:clist` command to see the error message again.\n      Is there any other way to see these error messages?\n\nYou can use the `:copen` or `:cwindow` command to open the quickfix window\nthat contains the compiler output. You can select different error lines\nfrom this window and jump to the corresponding line in the source code.\n\nFor more information, read:\n\n    :help :copen\n    :help :cwindow\n    :help quickfix\n\n\n28.3. How can I perform a command for each item in the quickfix/location\n      list?\n\nStarting from Vim 7.4.858 Vim provides the new commands `:cfdo`, `:cdo`,\n`:lfdo` and `:ldo.` They work by iterating over all items in the quickfix\nlist and performing a command on each. The difference is, that the `:lfdo`\nand `:ldo` commands iterate over the location list entries, while the\n`:cfdo` and `:cdo` commands operate on the items in the quickfix list. Also,\nthe `:cfdo` and `:lfdo` operate on all different files, while the `:cdo` and\n`:ldo` commands operate on each item in the quickfix/location list.\n\nFor example you could vimgrep all C files in the current directory for a\nsearch string \"Foobar\":\n\n    :vimgrep /Foobar/ *.c\n\nand as this populates your quickfix list, you could simply replace all\noccurences by using:\n\n    :cdo :%s/Foobar/Foobaz | upd\n\nFor more information, read:\n\n    :help :cfdo\n    :help :cdo\n\n\n=============================================================================\n\nSECTION 29 - FOLDING\n\n\n29.1. How do I extend the Vim folding support?\n\nYou can use the 'foldexpr' option to fold using a user specified function.\nFor example, to fold subroutines of the following form into a single line:\n\n    sub foo {\n      my $barf;\n      $barf = 3;\n      return $barf;\n    }\n\nYou can use the following commands:\n\n    set foldmethod=expr\n    set foldexpr=MyFoldExpr(v:lnum)\n    fun! MyFoldExpr(line)\n        let str = getline(a:line)\n        if str =~ '^sub\\>'\n            return '1'\n        elseif str =~ '^}'\n            return '<1'\n        else\n            return foldlevel(a:line - 1)\n        endif\n    endfun\n\nFor more information, read:\n\n    :help 'foldexpr'\n    :help fold-expr\n\n\n29.2. When I enable folding by setting the 'foldmethod' option, all the\n      folds are closed. How do I prevent this?\n\nYou can set the 'foldlevelstart' option to a particular value to close only\nfolds above the specified value.\n\n    :set foldlevelstart=99\n\nFor more information, read:\n\n    :help 'foldlevelstart'\n    :help 'foldlevel'\n    :help fold-foldlevel\n\n\n29.3. How do I control how many folds will be opened when I start editing a\n      file?\n\nYou can modify the 'foldlevelstart' option to control the number of folds\nthat will be opened when you start editing a file. To start editing with\nall the folds closed:\n\n    :set foldlevelstart=0\n\nTo start editing with all the folds opened, you can use\n\n    :set foldlevelstart=999\n\nFor more information, read:\n\n    :help 'foldlevelstart'\n\n\n29.4. How do I open and close folds using the mouse?\n\nYou can click on the + and - characters displayed at the leftmost column to\nopen and close fold. For this to work, you have to set the 'foldcolumn'\nto a value greater than zero:\n\n    :set foldcolumn=2\n\nFor more information, read:\n\n    :help 'foldcolumn'\n\n\n29.5. How do I change the text displayed for a closed fold?\n\nYou can use the 'foldtext' option to change the text displayed for a closed\nfold.\n\nFor more information, read:\n\n    :help 'foldtext'\n    :help fold-foldtext\n    :help 'fillchars'\n\n\n29.6. How do I store and restore manually created folds across different\n      Vim invocations?\n\nYou can use the `:mkview` command to store manually created folds. Later,\nyou can use the `:loadview` command to restore the folds. For this to work,\nthe 'viewoptions' must contain \"folds\".\n\nFor more information, read:\n\n    :help 28.4\n    :help :mkview\n    :help :loadview\n    :help 'viewoptions'\n    :help 'viewdir'\n    :help :mksession\n    :help 'sessionoptions'\n\n\n29.7. I have enabled syntax based folding. Why is Vim so slow?\n\nSyntax based folding is currently rather slow in Vim and will possibly\nslow down Vim considerably. There is an issue in the todo list to fix\nthis, but the todo list is rather long and it may take a while until\nthis will be fixed.\n\nYou can find the issue in the todo list, if you read\n\n    :help todo.txt\n\nfollowed by a search for \"folding with 'foldmethod'\"\n\nA workaround is to temporarily set the foldmethod to manual while in\ninsert mode. This is described in the wiki at:\n\n    http://vim.wikia.com/wiki/Keep_folds_closed_while_inserting_text\n\n\n=============================================================================\n\nSECTION 30 - VIM WITH EXTERNAL APPLICATIONS\n\n\n30.1. Can I run a shell inside a Vim window?\n\nSince Version 8.1 Vim comes with a terminal window included. It allows\nto run a shell inside an ordinary Vim window (e.g. split) asynchronously\nand interact with the shell using the normal Vim commands.\n\nWhen the focus is in the terminal window, typed keys will be sent to\nthe job and is called terminal mode. You can click outside of the\nterminal window to move keyboard focus elsewhere, alternatively one can\nuse CTRL-W to novigate between different Vim windows. To feed CTRL-W into the\nterminal, one needs to use CTRL-W .\n\nTo map keys specifically for terminal mode, use the new `:tmap`\ncommand. After typing CTRL-W the terminal window will switch to\nTerminal-Normal mode (this can be used to move the cursor around, scroll\nthe window, etc. Just like normal mode).\n\nTo interact between the terminal and Vim, Vim implements several\ninterfaces using term_sendkeys(), terminal-api and the client-server\nmechanism.\n\nFor more information, read:\n\n    :help terminal\n    :help mapmode-t\n    :help Terminal-Normal\n    :help terminal-communication\n\n\n30.2. How do I pass the word under the cursor to an external command?\n\nYou can use the special keyword <cword> to pass the word under the cursor\nto an external command. For example:\n\n    :!dict <cword>\n\nFor more information, read:\n\n    :help :<cword>\n\n\n30.3. How do I get the output of a shell command into a Vim buffer?\n\nYou can use the `:r !` command to get the output of a shell command into a\nVim buffer. For example, to insert the output of the \"ls\" shell command,\nyou can use the following command:\n\n    :r !ls\n\nTo insert the output of the shell command above the first line use the\nfollowing command:\n\n    :0r !ls\n\nFor more information, read:\n\n    :help :r!\n\n\n30.4. How do I pipe the contents of the current buffer to an external\n      command and replace the contents of the buffer with the output from\n      the command?\n\nYou can use the :! command to pipe the contents of the current buffer to an\nexternal command and replace the contents of the buffer with the output\nfrom the command. For example, to sort the contents of the current buffer,\nusing the Unix sort command, you can use the following command:\n\n    :%!sort\n\nTo sort only lines 10-20, you can use the following command\n\n    :10,20!sort\n\nAlso, if you want to pipe a buffer to an external command but not put the\nresults back in the buffer, you can use\n\n    :w !sort\n\nThe above command will pipe the entire buffer to the sort command.  Note,\nthat the space between the \"w\" and the \"!\" is critical.  To pipe only a\nrange of lines, you can use\n\n    :10,20w !sort\n\nThe above command will pipe the lines 10-20 to the sort command.\n\nFor more information, read:\n\n    :help :range!\n    :help 10.9\n    :help :w_c\n\n\n30.5. How do I sort a section of my file?\n\nYou use the `:sort` command like this:\n\n   :5,100sort\n\nUsing the `:sort` command provides many options, you can sort numerical on\nthe first found decimal number using:\n\n   :%sort n\n\nOr you can specify to sort on the text, starting at virtual column 8:\n\n   :%sort /.*\\%8v/\n\nAlternatively can pipe a section of the file to the Unix \"sort\" utility to\nsort the file. For example:\n\n    :5,100!sort\n\nYou can also use a visual block, and use the \"!sort\" command on the\nselected block.\n\nSee also:\n    :help :sort\n    :help filter\n\n\n30.6. How do I use Vim as a pager?\n\nYou can use Vim as a pager using the $VIMRUNTIME/macros/less.sh shell\nscript, supplied as part of the standard Vim distribution. This shell\nscript uses the $VIMRUNTIME/macros/less.vim Vim script to provide less like\nkey bindings.\n\nFor more information, read:\n\n    :help less\n\n\n30.7. How do I view Unix man pages from inside Vim?\n\nYou can view Unix man pages, inside Vim, using the man.vim plugin supplied\nas part of the standard Vim distribution. To use this plugin, add the\nfollowing line to your startup vimrc file:\n\n    runtime ftplugin/man.vim\n\nYou can also press the K key to run the program specified by the\n'keywordprg' option with the keyword under the cursor. By default,\n'keywordprg' is set to run man on the keyword under the cursor.\n\nFor more information, read:\n\n    :help ft-man-plugin\n    :help K\n    :help 'keywordprg'\n\n\n30.8. How do I change the diff command used by the Vim diff support?\n\nBy default, the Vim diff support uses the 'diff' command. You can change\nthis by changing the 'diffexpr' option.\n\nFor more information, read:\n\n    :help diff-diffexpr\n    :help 'diffexpr'\n\n\n30.9. How do I use the Vim diff mode without folding?\n\nYou can use the following command-line to start Vim with two filenames\nand use the diff mode without folding:\n\n    $ vim -o file1 file2 \"+windo set diff scrollbind scrollopt+=hor nowrap\"\n\nIf you like vertically split windows, then replace \"-o\" with \"-O\".\n\nFor more information, read:\n\n    :help vimdiff\n\n\n=============================================================================\n\nSECTION 31 - GUI VIM\n\n\n31.1. How do I create buffer specific menus?\n\nAdding support for buffer specific menus is in the Vim TODO list. In the\nmean time, you can try Michael Geddes's plugin, buffermenu.vim:\n\n    https://www.vim.org/scripts/script.php?script_id=246\n\n\n31.2. How do I change the font used by GUI Vim?\n\nYou can change the 'guifont' option to change the font used by GUI Vim.  To\ndisplay the current value of this option, you can use\n\n    :set guifont?\n\nYou can add the displayed font name to the .vimrc file to use the font\nacross Vim sessions. For example, add the following line to the .vimrc file\nto use Andale Mono font.\n\n    set guifont=Andale_Mono:h10:cANSI\n\nFor Win32, GTK and Photon version of Vim, you can use the following command\nto bringup a dialog which will help you in changing the guifont:\n\n    :set guifont=*\n\nYou can also use the -font Vim command line option to specify the font used\nfor normal text.\n\nFor more information, read:\n\n    :help 'guifont'\n    :help 'guifontset'\n    :help 'guifontwide'\n    :help font-sizes\n    :help -font\n    :help -boldfont\n    :help -italicfont\n    :help -menufont\n    :help -menufontset\n\n\n31.3. When starting GUI Vim, how do I specify the location of the GVIM\n      window?\n\nYou can use the \"-geometry\" command line argument to specify the location\nof the GUI Vim window. For example:\n\n    $ gvim -geometry 80x25+100+300\n\nFor more information, read:\n\n    :help 31.4\n    :help -geom\n\n\n31.4. How do I add a horizontal scrollbar in GVim?\n\nYou can enable the horizontal scrollbar by modifying the 'guioptions'\noption:\n\n    :set guioptions+=b\n\nFor more information, read:\n\n    :help 'guioptions'\n    :help gui-horiz-scroll\n\n\n31.5. How do I make the scrollbar appear in the left side by default?\n\nYou can add the \"l\" flag to the 'guioptions' option to make the scrollbar\nappear in the left side.\n\n    :set guioptions+=l\n    :set guioptions-=r\n\nFor more information, read:\n\n    :help 'guioptions'\n    :help gui-scrollbars\n\n\n31.6. How do I remove the Vim menubar?\n\nYou can remove the Vim menubar by removing the \"m\" flag from the\n'guioptions' option:\n\n    :set guioptions-=m\n\nFor more information, read:\n\n    :help 'guioptions'\n\n\n31.7. I am using GUI Vim. When I press the <Alt> key and a letter, the menu\n      starting with that letter is selected. I don't want this behavior as\n      I want to map the <Alt>-<key> combination. How do I do this?\n\nYou can use the 'winaltkeys' option to disable the use of the <Alt> key to\nselect a menu item:\n\n    :set winaltkeys=no\n\nFor more information, read:\n\n    :help 'winaltkeys'\n    :help :simalt\n\n\n31.8. Is it possible to scroll the text by dragging the scrollbar so that\n      the cursor stays in the original location?\n\nThe way Vim is designed, the cursor position has to be in a visible spot in\nnormal, visual, select and insert mode. This cannot be changed without\nmodifying Vim. When the scrollbar is used, the cursor will be moved so that\nit is always visible. Another approach to solving this problem is to use\nthe Vim marks. You can mark the current cursor position using ma. Then\nscroll to a different part of the text and jump back to the old position\nusing `a. You can also try the following suggestion from the Vim Online\nwebsite:\n\n    http://vim.wikia.com/wiki/VimTip320\n\nFor more information, read:\n\n    :help mark-motions\n\n\n31.9. How do I get gvim to start browsing files in a particular directory\n      when using the `:browse` command?\n\nYou can set the 'browsedir' option to the default directory to use for the\n`:browse` command.\n\n    :set browsedir='<your_dir>'\n\nFor more information, read:\n\n    :help 'browsedir'\n\n\n31.10. For some questions, like when a file is changed outside of Vim, Vim\n       displays a GUI dialog box. How do I replace this GUI dialog box with\n       a console dialog box?\n\nYou can set the \"c\" flag in the 'guioptions' option to configure Vim to use\nconsole dialogs instead of GUI dialogs:\n\n    :set guioptions+=c\n\nFor more information, read:\n\n    :help 'guioptions'\n\n\n31.11. I am trying to use GUI Vim as the editor for my xxx application.\n       When the xxx application launches GUI Vim to edit a file, the\n       control immediately returns to the xxx application. How do I start\n       GUI Vim, so that the control returns to the xxx application only\n       after I quit Vim?\n\nYou have to start GUI Vim with the \"-f\" (foreground) command line option:\n\n    $ gvim -f\n\nBy default, GUI Vim will disconnect from the program that started Vim. With\nthe '-f' option, GUI Vim will not disconnect from the program that started\nit.\n\nFor more information, read:\n\n    :help gui-fork\n    :help -f\n\n\n31.12. Why does the \"Select Font\" dialog doesn't show all the fonts\n       installed in my system?\n\nVim supports only fixed width (mono-spaced) fonts. Proportional fonts are\nnot supported.  In the \"Select Font\" dialog, only fixed width fonts will be\ndisplayed.\n\nFor more information, read:\n\n    :help font-sizes\n    :help 'guifont'\n\n\n31.13. How do I use the mouse in Vim command-line mode?\n\nYou can set the \"c\" flag in the 'mouse' option to use mouse in the Vim\ncommand-line mode:\n\n    :set mouse+=c\n\nFor more information, read:\n\n    :help mouse-using\n    :help gui-mouse\n    :help 09.2\n\n\n31.14. When I use the middle mouse button to scroll text, it pastes the\n       last copied text. How do I disable this behavior?\n\nYou can map the middle mouse button to <Nop> to disable the middle mouse\nbutton:\n\n    :map  <MiddleMouse> <Nop>\n    :map! <MiddleMouse> <Nop>\n\nFor more information, read:\n\n    :help gui-mouse-mapping\n    :help <Nop>\n\n\n31.15. How do I change the location and size of a GUI Vim window?\n\nYou can use the `:winpos` command to change the Vim window position. To\nchange the size of the window, you can modify the 'lines' and 'columns'\noptions.\n\nFor example, the following commands will position the GUI Vim window at the\nX,Y co-ordinates 50,50 and set the number of lines to 50 and the number of\ncolumns to 80.\n\n    :winpos 50 50\n    :set lines=50\n    :set columns=80\n\nThe arguments to the `:winpos` command specify the pixel co-ordinates of the\nVim window. The 'lines' and 'columns' options specify the number of lines\nand characters to use for the height and the width of the window\nrespectively.\n\nFor more information, read:\n\n    :help 31.4\n    :help :winpos\n    :help 'lines'\n    :help 'columns'\n    :help GUIEnter\n\n\n31.16. When splitting the Vim window vertically, Vim changes the position.\n\nThis is a known problem. When you are splitting the Vim window, Vim will\ntry to draw a scrollbar. Since this changes the gui window, Vim tries to\nresize its main window to keep the same position and this will cause Vim\nto move its position. This happens on Windows with a multi-window setup or\na window that was \"snapped\" to a certain position.\n\nA workaournd to this problem is, to remove gui scrollbars, e.g.\n\n    :set guioptions-=L\n\n\n=============================================================================\n\nSECTION 32 - VIM ON UNIX\n\n\n32.1. I am running Vim in a xterm. When I press the CTRL-S key, Vim\n      freezes. What should I do now?\n\nMany terminal emulators and real terminal drivers use the CTRL-S key to\nstop the data from arriving so that you can stop a fast scrolling display\nto look at it (also allowed older terminals to slow down the computer so\nthat it did not get buffer overflows).  You can start the output again by\npressing the CTRL-Q key.\n\nWhen you press the CTRL-S key, the terminal driver will stop sending the\noutput data. As a result of this, it will look like Vim is hung. If you\npress the CTRL-Q key, then everything will be back to normal.\n\nYou can turn off the terminal driver flow control using the \"stty\" command:\n\n    $ stty -ixon -ixoff\n\nor, you can change the keys used for the terminal flow control, using the\nfollowing commands:\n\n    $ stty stop <char>\n    $ stty start <char>\n\n\n32.2. I am seeing weird screen update problems in Vim. What can I do to\n      solve this screen/display update problems?\n\nYou have to use a proper terminal emulator like xterm with correct TERM\nsettings (TERM=xterm) and a correct terminfo/termcap file.\nFor more information, read:\n\n    :help 'term'\n\n\n32.3. I am using the terminal/console version of Vim. In insertmode, When I\n      press the backspace key, the character before the cursor is not\n      erased. How do I configure Vim to do this?\n\nYou have to make sure that Vim gets the correct keycode for the backpspace\nkey. You can try using the command:\n\n    :fixdel\n\nMake sure the TERM environment variable is set to the correct terminal\nname. You can try using the \"stty\" command:\n\n    $ stty erase ^H\n\nwhere, you have to enter the ^H character by pressing the CTRL-V key and\nthen the CTRL-H key. Also check the value of your 'backspace' setting.\n\nFor more information, read:\n\n    :help :fixdel\n    :help Linux-backspace\n    :help NetBSD-backspace\n    :help 'backspace'\n\n\n32.4. I am using Vim in a xterm. When I quit Vim, the screen contents are\n      restored back to the original contents. How do I disable this?\n\nThe xterm has a capability called \"alternate screen\".  If this capability\nis present, vim switches to that alternate screen upon startup and back on\nexit, thus restoring the original screen contents.  To disable this\nfeature, add the following line to your .vimrc file:\n\n    :set t_ti= t_te=\n\nFor more information, read:\n\n    :help 'restorescreen'\n    :help xterm-screens\n\n\n32.5. When I start Vim, it takes quite a few seconds to start. How do I\n      minimize the startup time?\n\nThis may be related to Vim opening the X display for setting the xterm\ntitle and using the X clipboard. Make sure the DISPLAY variable is set to\npoint to the correct host. Try using the command line:\n\n    $ vim -X\n\nThis will prevent Vim from opening the X display. With this command-line\noption, the X clipboard cannot be used and also Vim will not be able to\nchange the xterm title.\n\nYou can also set the 'clipboard' option to\n\n    :set clipboard=exclude:.*\n\nThis has the same effect as using the -X command-line argument.\n\nFor more information, read:\n\n    :help -X\n    :help 'clipboard'\n\nIf the clipboard is not the cause of the slow startup, it might be a\nplugin that slows down Vim. In that case, you can use the --startuptime\nargument to debug this further. You can do:\n\n    $ vim --startuptime vim_startup.log\n\nand the timing will be written to the file vim_startup.log. For even\nmore advanced profiling, you can use the profiling feature, that is\navailable in huge builds of Vim. To do so, call Vim like this:\n\n    $ vim --cmd 'profile start profile.log' \\\n      --cmd 'profile func *' \\\n      --cmd 'profile file *' \\\n      -c 'profdel func *' \\\n      -c 'profdel file *' \\\n      -c 'qa!'\n\nAfter running this, you will have a file profile.log in your current\ndirectory. To further analyse this, open the file profile.log and run:\n\n    \" Open profile.log file in vim first\n    :let timings=[]\n    :g/^SCRIPT/call add(timings, [getline('.')[len('SCRIPT  '):], matchstr(getline(line('.')+1), '^Sourced \\zs\\d\\+')]+map(getline(line('.')+2, line('.')+3), 'matchstr(v:val, ''\\d\\+\\.\\d\\+$'')'))\n    :enew\n    :call setline('.', ['count total (s)   self (s)  script']+map(copy(timings), 'printf(\"%5u %9s   %8s  %s\", v:val[1], v:val[2], v:val[3], v:val[0])'))\n\nFor more information, read:\n\n    :help --startuptime\n    :help profiling\n\n\n32.6. How can I make the cursor in gvim in unix stop blinking?\n\nYou can modify the 'guicursor' option, to stop the cursor from blinking.\nFor example:\n\n    :set guicursor=a:blinkon0\n\nFor more information, read:\n\n    :help 'guicursor'\n\n\n32.7. How do I change the menu font on GTK Vim?\n\nYou can modify the ~/.gtkrc file to change the menu font on GTK Vim. For\nexample:\n\n    style \"default\"\n    { font =\"smooth09\" }\n    class \"*\" style \"default\"\n\nThe last line changes the font of all widgets.\n\nFor more information, read:\n\n    :help gui-gtk\n\n\n32.8. How do I prevent CTRL-Z from suspending Vim?\n\nYou can map CTRL-Z to prevent the suspending. Here are some suggestions:\n\n- Make CTRL-Z do nothing:\n\n    :map <C-Z> <Nop>\n\n- Make CTRL-Z start a shell:\n\n    :map <C-Z> :shell<CR>\n\n- Make CTRL-Z give an error message:\n\n    :map <C-Z> :\"suspending disabled<CR>\n\nFor the last example, the double quote is necessary in order to keep the\nmessage on the status line.\n\n\n32.9. When I kill the xterm running Vim, the Vim process continues to run\n      and takes up a lot of CPU (99%) time. Why is this happening?\n\nWhen Vim is built with support for Python interface, you will have this\nproblem. This is a known problem with the python thread library and Vim.  To\nsolve this problem, use a Vim binary built without the Python interface.\n\nFor more information, read:\n\n    :help +python\n    :help python\n\n\n32.10. How do I get the Vim syntax highlighting to work in a Unix terminal?\n\nThe easiest and simplest way to get Vim syntax highlighting is to use the\nGUI version of Vim (GVIM). To get syntax highlighting to work in the\nconsole/terminal version of Vim, you have to run a terminal emulator (like\nXfree86 xterm or rxvt or dtterm) that supports color. Note that if a\nterminal emulator supports changing the background and foreground colors,\nthat does not mean that it also supports ANSI escape sequences for changing\nthe color. You can download the latest version of Xfree86 xterm from\nhttps://invisible-island.net/xterm/xterm.html\nYou can download the latest version of rxvt from https://rxvt.org\nYou have to install the terminfo/termcap file that supports colors for the\nterminal emulator. Also, set the TERM environment variable to the correct\nname of the term that supports colors.\n\nYou can use the colortest.vim script supplied with the Vim runtime\npackage to test the color setup. To use this script, follow these steps:\n\n    :e $VIMRUNTIME/syntax/colortest.vim\n    :source %\n\nFor more information, read:\n\n    :help 06.2\n    :help terminal-colors\n    :help termcap-colors\n    :help startup-terminal\n    :help xterm-color\n    :help colortest.vim\n\n\n=============================================================================\n\nSECTION 33 - VIM ON MS-WINDOWS\n\n\n33.1. In MS-Windows, CTRL-V doesn't start the blockwise visual mode. What\n      happened?\n\nThe mswin.vim script provides key mappings and options to make Vim behave\nlike a MS-Windows application. One of the keys mapped is CTRL-V which is\nused for pasting text in MS-Windows applications. This will disable the use\nof CTRL-V to start the blockwise visual mode. The mswin.vim script maps\nCTRL-Q for staring the blockwise visual mode. So you can use CTRL-Q instead\nof CTRL-V.\n\nFor more information, read:\n\n    :help CTRL-V\n    :help CTRL-V-alternative\n    :help CTRL-Q\n    :help 10.5\n\n\n33.2. When I press the CTRL-Y key, it acts like the CTRL-R key. How do I\n      configure Vim to treat CTRL-Y as CTRL-Y?\n\nThe mapping of the CTRL-Y key to the CTRL-R key is done by the mswin.vim\nscript. The mswin.vim script maps CTRL-Y to make Vim behave like a standard\nMS-Windows application. This is explained in `:help CTRL-Y`. You can either\ncomment out the line in mswin.vim that maps the CTRL-Y key or you can\nremove the line in your .vimrc file that sources the mswin.vim script.\n\n\n33.3. How do I start GUI Vim in a maximized window always?\n\nYou can use the `:simalt` command to maximize the Vim window. You can use\nthe GUIEnter autocmd to maximize the Vim window on startup:\n\n    autocmd GUIEnter * simalt ~x\n\nFor more information, read:\n\n    :help :simalt\n    :help GUIEnter\n    :help gui-win32-maximized\n\n\n33.4. After doing some editing operations, Vim freezes. The cursor becomes\n      an empty rectangle. I am not able enter any characters. What is\n      happening?\n\nMost probably, you used the mouse wheel to scroll the text in Vim. There is\na known problem in using intellimouse mouse wheel with Vim. To avoid this\nproblem, disable Universal scrolling support for Vim.\n\nFor more information, read:\n\n    :help intellimouse-wheel-problems\n\n\n33.5. I am using Windows XP, the display speed of maximized GVim is very\n      slow. What can I do to speed the display updates?\n\nThis may be due to the fact that you have enabled 'Smooth edges of screen\nfonts' in the display properties. Try turning off font smoothing or try\nchanging the smoothing method to \"Standard\".\n\n\n33.6. What are the recommended settings for using Vim with cygwin?\n\nYou may want to set the following shell related Vim settings:\n\n    :set shellcmdflag=-c\n    :set shellquote=\n    :set shellslash          \" Use the forward slash for expansion.\n    :set shellxquote=\\\"\n    :set shell=d:\\cygwin\\bin\\bash.exe \" Use the bash shell\n    :set shellpipe=2>&1| tee\n    :set shellredir=>%s 2>&1\n\n\n33.7. I am trying to use GNU diff with Vim diff mode. When I run the diff\n      from command line, it works. When I try to use the diff with Vim it\n      doesn't work. What should I do now?\n\nThere is a problem with using GNU diff with Vim. You can try using the\nGNU diff.exe built by Ron Aaron from the following link:\n\n    http://www.mossbayeng.com/~ron/vim/builds.html\n(This page no longer exists.)\n\n\n33.8. Is it possible to use Vim as an external editor for MS-Windows\n      Outlook email client?\n\nYou can use the \"cubiclevim\" COM Add-In to use Vim as an external editor\nfor MS-Windows Outlook email client. Visit the following URL for more\ninformation:\n\n    https://sourceforge.net/projects/cubiclevim/\n\nNote, that currently this works only with MS-Office 2000 and XP.\n\nAlso the plugin OutlookVim might be worth a look:\n\n    https://www.vim.org/scripts/script.php?script_id=3087\n\n\n33.9. I am using Vim to edit HTML files. How do I start internet explorer\n      with the current file to preview the HTML file?\n\nYou can use the following command:\n\n    :!start c:\\progra~1\\intern~1\\iexplore.exe file://%:p<CR>\n\n\n33.10. I would like to use Vim with Microsoft Visual Studio. How do I do\n       this?\n\nYou have to download and use the OLE version of Vim (for example:\ngvim61ole.zip). This file also contains instructions on how to use Vim with\nVisual Studio.\n\nFor more information, read:\n\n    :help MSVisualStudio\n\n\n33.11. Where do I place the _vimrc and _gvimrc files?\n\nYou can place the _vimrc and _gvimrc files under the directory pointed to\nby the VIM environment variable. If you are sharing this system with other\nusers, then you can place the files in a directory and set the HOME\nenvironment variable to this directory.\n\nFor more information, read:\n\n    :help $HOME-use\n    :help _vimrc\n\n\n33.12. Every time I save a file, Vim warns about the file being changed\n       outside of Vim. Why?\n\nIf you get the following warning message, every time you save a file:\n\n    WARNING: The file has been changed since reading it!!!\n    Do you really want to write to it (y/n)?\n\nthen this problem could be related to a bug in MS-Windows on the day\ndaylight saving time starts.  Vim remembers the timestamp of the file after\nit was written.  Just before the next write the timestamp is obtained again\nto check if the file was changed outside of Vim.  This works correctly,\nexcept on the day daylight saving time starts.\n\nThis problem will go away the next day after the day the daylight saving\ntime starts.\n\nFor more information, read:\n\n    :help W11\n\n\n=============================================================================\n\nSECTION 34 - PRINTING\n\n\n34.1. How do I print a file along with line numbers for all the lines?\n\nYou can set the 'printoptions' option and use the `:hardcopy` command to\nprint your file:\n\n    :set printoptions=number:y\n    :hardcopy\n\nFor more information, read:\n\n    :help 'printoptions'\n    :help :hardcopy\n\n\n34.2. How do I print a file with the Vim syntax highlighting colors?\n\nYou can use the `:hardcopy` command to print a file with the Vim syntax\nhighlighting colors. You can also convert your file to a HTML file using\nthe 2html.vim script and print the HTML file.\n\nFor more information, read:\n\n    :help syntax-printing\n    :help 2html.vim\n    :help :hardcopy\n    :help printing\n\n\n=============================================================================\n\nSECTION 35 - BUILDING VIM FROM SOURCE\n\n\n35.1. How do I build Vim from the sources on a Unix system?\n\nFor a Unix system, follow these steps to build Vim from the sources:\n\n- Download the source from the git repository:\n  https://github.com/vim/vim/releases/\n- Alternatively, download the source from the mercurial repository:\n  https://bitbucket.org/vim-mirror/vim/downloads/\n- Run the \"make\" command to configure and build Vim with the default\n  configuration.\n- Run \"make install\" command to install Vim in the default directory.\n\nTo enable/disable various Vim features, before running the \"make\" command\nyou can run the \"configure\" command with different flags to include/exclude\nthe various Vim features. To list all the available options for the\n\"configure\" command, use:\n\n    $ configure --help\n\nFor more information, read:\n\n    :help install\n\n\n35.2. How do I install Vim in my home directory or a directory other\n      than the default installation directory in Unix?\n\nTo install Vim in a directory other than the default installation\ndirectory, you have to specify the directory using the --prefix option\nwhile running the configure script.\n\n    $ ./configure --prefix=/users/xyz\n\nYou can enable/disable various Vim feature by supplying different arguments\nto the configure script. For more information about all these options, run:\n\n    $ ./configure --help\n\nFor more information, read:\n\n    :help install-home\n    :help install\n\n\n35.3. How do I build Vim from the sources on a MS-Windows system?\n\nFor a MS-Windows system, Vim can be built using either the Visual C++\ncompiler or the Borland C++ compiler or the Ming GCC compiler or the cygwin\ngcc compiler. Follow these steps to build Vim from the sources for\nMS-Windows:\n    - download the source from the git repository:\n      https://github.com/vim/vim/releases/\n    - Depending on the installed compiler, you can use the corresponding\n      makefile to build the Vim sources. For Visual C++ use the\n      Make_mvc.mak makefile, for borland C++ use the Make_bc5.mak makefile,\n      for ming GCC use the Make_ming.mak makefile, for cygwin gcc use the\n      Make_cyg.mak makefile.\n\nDepending on whether you want to build the GUI version of Vim or the\nconsole version of Vim, you have to pass different arguments to the\nmakefiles. After successfully building the sources, you can copy the\nvim.exe or gvim.exe file to the desired directory along with the files from\nthe runtime archive.\n\nFor more information, read:\n\n    :help install\n\n\n35.4. The Vim help, syntax, indent files are missing from my Vim\n      installation. How do I install these files?\n\nThe Vim help, syntax, indent and other runtime files are part of the Vim\nruntime package. You need to download and install the Vim runtime package.\nFor example, for MS-Windows, the name of the Vim 6.1 runtime package is\nvim61rt.zip.\n\nFor more information, read:\n\n    :help install\n\n\n35.5. I have built Vim from the source and installed the Vim package using\n      \"make install\". Do I need to keep the Vim source directory?\n\nNo. Once you have built and installed Vim in some directory other than the\noriginal source directory (for example, /usr/bin or /usr/local/bin), then\nyou can remove the source directory.\n\n\n35.6. How do I determine the Vim features which are enabled at compile\n      time?\n\nYou can use the `:version` command to determine the Vim features that are\nenabled at compile time. The features that are enabled will be prefixed\nwith a \"+\". The features that are not enabled will be prefixed with a \"-\".\n\nIf you want to test for a feature in a script, you can use the has()\nfunction:\n\n    if has(\"menu\")\n        \" Set up some menus\n    endif\n\nFor more information, read:\n\n    :help :version\n    :help +feature-list\n    :help has()\n\n\n35.7. Can I build Vim without the GUI support?\n\nYes. You can build Vim by optionally enabling/disabling many of the\nfeatures including GUI.\n\nFor more information, read:\n\n    :help install\n\n\n35.8. When building Vim on a Unix system, I am getting \"undefined reference\n      to term_set_winsize\" error. How do I resolve this error?\n\nYou will get this error when the build process is not able to locate the\ntermlib, termcap or ncurses library. You have to install the ncurses-dev\npackage to resolve this error.\n\n\n35.9. Vim configure keeps complaining about the lack of gtk-config while\n      trying to use GTK 2.03. This is correct, since in GTK 2 they moved to\n      using the generic pkg-config. I can get pkg-config to list the\n      various includes and libs for gtk, but for some reason the configure\n      script still isn't picking this up.\n\nUse the following shell script named gtk-config:\n\n    #!/bin/sh\n    pkg-config gtk+-2.0 $1 $2\n\n\n35.10. I did successfully download the sources and compiled Vim on\n        Unix. But feature ... still does not work. What is wrong and\n        how can I fix it?\n\nYou should first check, that you are actually running your self compiled\nVim and not the system's provided version. So first check your $PATH\nsetting.\n\nDepending on your compile options, some features might not be included in\nyour build of Vim. You can use the `:version` command to determine the Vim\nfeatures that are enabled at compile time. The features that are enabled\nwill be prefixed with a \"+\". The features that are not enabled will be\nprefixed with a \"-\".\n\nThe easiest way to include all features is to build the huge version. To do\nthis, you have to specify the --with-features option while running the\nconfigure script:\n\n    $ ./configure --with-features=huge\n\nNevertheless, a feature could still be disabled at compile time, if the\nconfigure script can't find the required libraries for those features (e.g.\nfor clipboard integration, your Vim needs to be linked against the X11\ndevelopment libraries).\n\nThere are several ways to install the required libraries:\n\n1) On a Debian based distribution, you can use the package manager \"apt\"\n   to install all required dependencies. As superuser, run the command:\n\n   $ apt-get build-dep vim-gtk\n\n   This makes sure all required libraries needed to compile the vim-gtk\n   package will be installed. (This requires, that your sources list\n   contains deb-src entries. See your distribution manual on how to\n   enable this, if the above command did not work.)\n\n2) In openSUSE you can use the package manager \"zypper\" to install all\n   required libraries. This requires, that there is a source version of\n   the package installable from a configured repository (which by\n   default is not the case). Use:\n\n   $ zypper search -t srcpackage vim\n\n   to find out, whether or not there exists a source version in the\n   repository. If there is none, you'll need to add a source repository.\n   For openSUSE 11.2 you could use, e.g.\n\n   $ zypper ar\n   http://download.opensuse.org/source/distribution/11.2/repo/oss/src-11.2\n\n   (one line)\n\n   Once you have a source version available in your repositories, use\n   this command to install all needed requirements:\n\n   $ zypper source-install --build-deps-only vim\n\n3) On a Fedora/RedHat based system, you can use\n\n   $ yum-builddep vim-enhanced\n\n4) Run configure with your options and watch for missing libraries:\n\n   $ ./configure --with-features=huge 2>&1 |tee logfile\n\n   This will run configure and record the output into the file \"logfile\".\n   You need to check the logfile for missing dependencies. Consider this\n   output:\n\n    checking --disable-gtktest argument... gtk test enabled\n    checking for pkg-config... /usr/bin/pkg-config\n    checking for GTK - version >= 2.2.0... no\n\n    Here you can see, that the gtk libraries are missing and therefore\n    no GTK gui version can't be build. So you need to install the GTK\n    library in your system, with your package manager or by compiling it\n    yourself. Then run the configure script again and check, that it\n    finds the library.\n\nIn theory, those provided dependencies by your distribution might still\nlack some libraries, that are needed for features, that simply are not\nenabled in your distribution and therefore those commands in 1-3 won't\ninstall it. At the very least, this provides a jumping point and you need\nto track down the required missing packages using method 4 from above. But\nusually, this works good enough for most people and you won't have to\nbother with the fourth method.\n\nFor more information, read:\n\n    :help :version\n    :help +feature-list\n\n\n=============================================================================\n\nSECTION 36 - VARIOUS\n\n\n36.1. How do I edit binary files with Vim?\n\nYou can set the following options to edit binary files in Vim:\n\n    :set binary\n    :set display=uhex\n\nYou can also use the \"-b\" command-line option to edit a binary file:\n\n    $ vim -b <binary_file_name>\n\nYou can also use the xxd utility (part of the Vim distribution) to edit\nbinary files.\n\nFor more information, read:\n\n    :help 23.4\n    :help edit-binary\n    :help hex-editing\n    :help -b\n    :help 'binary'\n    :help 'endofline'\n    :help 'display'\n\n\n36.2. How do I disable the visual error flash and the error beep?\n\nYou can disable both the visual error flash and the error beep using the\nfollowing command:\n\n    :set visualbell t_vb=\n\nFor more information, read:\n\n    :help 'visualbell'\n    :help 'errorbells'\n    :help t_vb\n\n\n36.3. How do I display the ascii value of a character displayed in a\n      buffer?\n\nYou can use the \"ga\" command to display the ascii value of a displayed\ncharacter.\n\nFor more information, read:\n\n    :help ga\n    :help :ascii\n\n\n36.4. Can I use zero as a count for a Vim command?\n\nYou cannot use zero as a count for a Vim command, as \"0\" is a command on\nits own, moving to the first column of the line.\n\nFor more information, read:\n\n    :help 0\n    :help count\n\n\n36.5. How do I disable the Vim welcome screen?\n\nYou can disable the Vim welcome screen, by adding the \"I\" flag to the\n'shortmess' option:\n\n    :set shortmess+=I\n\nFor more information, read:\n\n    :help :intro\n    :help 'shortmess'\n\n\n36.6. How do I avoid the \"hit enter to continue\" prompt?\n\nVim will prompt you with the \"hit enter to continue\" prompt, if there are\nsome messages on the screen for you to read and the screen is about to be\nredrawn.  You can add the \"T\" flag to the 'shortmess' option to truncate\nall messages. This will help in avoiding the hit-enter prompt:\n\n    :set shortmess+=T\n\nYou can also increase the command height by setting the 'cmdheight' option:\n\n    :set cmdheight=2\n\nFor more information, read:\n\n    :help hit-enter\n    :help avoid-hit-enter\n    :help 'shortmess'\n    :help 'cmdheight'\n\n\n36.7. How do I invoke Vim from command line to run a group of commands on a\n      group of files?\n\nThere are several ways to invoke Vim from command line to run a group of\ncommands on a group of files. You can use a set of  \"-c\" command line\noptions to specify a group of commands:\n\n    $ vim -c \"<ex_command_1>\" -c \"<ex_command_2>\" *.txt\n\nEach of the ex-command specified with the \"-c\" command line option is\nexecuted one by one sequentially. You can also use a single \"-c\" command\nline option and the \"|\" character to separate the ex commands:\n\n    $ vim -c \"<ex_command_1> | <ex_command_2>\" *.txt\n\nIn the above command, if an ex command fails, then all the remaining ex\ncommands will not be executed.\n\nFor example, to replace \"ABC\" with \"DEF\" in a file from the command-line,\nyou can use the following command:\n\n    $ vim -c \"%s/ABC/DEF/ge | update\" myfile.txt\n\nTo replace \"ABC\" with \"DEF\" in multiple files from the command-line,\nyou can use the following command:\n\n    $ vim -c \"argdo %s/ABC/DEF/ge | update\" *.txt\n\nYou can store the group of commands into a file and use the \"-s\" command\nline option to run the commands on a set of files. For example, if the\ngroup of commands are stored in the file mycmds.txt, then you can use the\nfollowing command:\n\n    $ vim -s mycmds.txt *.pl\n\nFor more information, read:\n\n    :help -c\n    :help -s\n\n\n36.8. How do I use a normal mode command from insert mode without leaving\n      the insert mode?\n\nYou can use a normal command from insert mode, without leaving the insert\nmode, by first pressing the CTRL-O key and then follow that with a single\nnormal mode command.\n\nTo execute more than one normal mode command, press the CTRL-L key,\nfollowed by any number of normal mode commands and then press <Esc> to get\nback to the insert mode. (This only works, when the 'insertmode' option\nis set).\n\nFor more information, read:\n\n    :help i_CTRL-O\n    :help i_CTRL-L\n\n\n36.9. How do I start Vim in insert mode?\n\nYou can start Vim in insert mode using the `:startinsert` ex command.\n\n    $ vim +startinsert myfile.txt\n\nThe above command will open the file \"myfile.txt\" and start insert mode\nwith the cursor in front of the first character on the first line.  To open\nthe file and start appending after the last character on the last line,\nyou can use the following command:\n\n    $ vim + +startinsert! myfile.txt\n\nFor more information, read:\n\n    :help :startinsert\n\n\n36.10. How do I use Copy and Paste with Vim?\n\nYou should first check the output of the `:version` command and make\nsure that +xterm-clipboard is present.\n\nWhen running Vim in an xterm, you can either let Vim control the mouse\nor let xterm control the mouse. This is configured by the 'mouse' option.\n\nIf the 'mouse' option is not set (or set to the default value), then Vim will\nnot control the mouse. You cannot move the Vim text cursor using the\nmouse. When you select some text using the mouse, xterm will copy\nit to the X11 cut buffer. When you press both the mouse buttons,\nxterm will paste the text from the cut buffer.\n\nIf the 'mouse' option is set to \"a\" or some other value, then Vim controls\nthe mouse. The mode (normal or insert or visual, etc) in which Vim\ncontrols the mouse is configured by the 'mouse' option. You can move\nthe Vim text cursor using the mouse. When you select some text,\nthe 'clipboard' option setting is used to determine whether to transfer\nthe selected text to the clipboard or not. The default setting is to\ntransfer the selected text to the clipboard. If you want to use the\nxterm selection mechanism in this mode, then you can press the\n<Shift> key. If you press <Shift> key when selecting text using the\nmouse, then Vim doesn't control the mouse and xterm controls the\nmouse.\n\nIn the GUI mode, Copy and Paste should just work, depending on the 'mouse'\nsetting. For more information, read:\n\n    :help 'clipboard'\n    :help x11-selection\n    :help clipboard\n    :help 'go-a'\n    :help 'mouse'\n    :help xterm-copy-paste\n    :help 09.3\n\n\n36.11. Why shouldn't I modify the files in the system runtime directory?\n\nJust be careful about modifying files under $VIMRUNTIME, which usually\nis /usr/share/vim/vimXX (Unix) or C:\\Program Files\\vim\\vimXX\n(Windows) and XX being the version for which it applies, e.g. 73 for Vim\n7.3.\n\nOne should generally avoid modifying those files because they may be\nreplaced during an upgrade of your Vim installation and your changes\nwill be lost.  Also, if you upgrade to a new major or minor revision of\nVim (e.g., from 7.3 to 7.4), the new version of Vim will use a different\n$VIMRUNTIME directory and while your changes won't be lost, they will be\nignored.\n\nConsequently, take a look at\n\n    :help filetypes\n\nfor an explanation of several ways to modify Vim's response to\ndifferent filetypes and where to put those modifications so that\nthey will not be overwritten.\n\n\n=============================================================================\n\nSECTION 37 - UNICODE\nAuthor: Tony Mechelynck <antoine.mechelynck AT belgacom.net>\n\n\n37.1. Is it possible to create Unicode files using Vim?\n\nYes. It may be more or less complicated depending on the keyboard and fonts\navailable to you, but it is always possible to encode any possible Unicode\ncodepoint (and some illegal ones) into a file. To create a Unicode file\nusing Vim, you should have compiled Vim with the \"+multi_byte\" compile-time\noption.  You can get more information about Unicode from the following\nsites:\n\n    http://www.unicode.org\n    https://www.cl.cam.ac.uk/~mgk25/unicode.html\n\nFor more information, read:\n\n    :help multibyte\n    :help usr_45.txt\n\n\n37.2. Which Vim settings are particularly important for editing Unicode\n      files?\n\nThe most important are the various \"encoding\" options, i.e., 'encoding',\n'fileencoding', 'fileencodings' and 'termencoding'. The boolean option\n'bomb' is also significant.\n\nFor more information, read:\n\n    :help 'encoding'\n    :help 'fileencoding'\n    :help 'fileencodings'\n    :help 'termencoding'\n    :help 'bomb'\n\n\n37.3. What is the 'encoding' option?\n\nBasically, the 'encoding' option defines how Vim will represent your data\ninternally.  However, all Unicode encodings are represented internally as\nutf-8 and converted (if necessary) when reading and writing.\n\nFor more information, read:\n\n    :help 'encoding'\n\n\n37.4. How does Vim name the various Unicode encodings?\n\nUtf-8 is called utf-8 or utf8; utf-16 is called ucs-2 or ucs2; utf-32 is\ncalled ucs-4 or ucs4. Also, you may specify endianness (except for utf-8\nwhich does not vary for endianness) by appending le for little-endian or be\nfor big-endian. If you create a file with an encoding of ucs-2 or ucs-4\nwithout specifying endianness, Vim will use what is typical of your\nmachine.\n\nFor more information, read:\n\n    :help encoding-names\n    :help encoding-values\n    :help encoding-table\n\n\n37.5. How does Vim specify the presence or absence of a byte-order mark?\n\nWhen reading a file, if the 'fileencodings' option includes \"ucs-bom\", Vim\nwill check for a byte-order mark. When writing a file, if the 'bomb' option\nis set, Vim will write a byte-order mark on files whose encoding warrants\nit.\n\nFor more information, read:\n\n    :help 'fileencodings'\n    :help 'bomb'\n\n\n37.6. What is the 'fileencoding' option?\n\nThe 'fileencoding' option defines the particular encoding which Vim will\nuse to write a file. If empty, then the value of the 'encoding' option is\nthe default.\n\nFor more information, read:\n\n    :help 'fileencoding'\n\n\n37.7. What is the 'fileencodings' option?\n\nThe 'fileencodings' option defines the heuristics used by Vim when opening\nan existing file. It is a comma separated list of encodings. A special\nname, \"ucs-bom\" is used to indicate that Vim should check for the presence\nof a byte-order mark; however, it will not be recognised if it comes after\n\"utf-8\".  Normally, \"ucs-bom\" (if present) should be first in the list.\n\nWhen Vim opens a file, it checks it against the encodings listed in\n'fileencodings'. The first one that matches is used. If there is no match,\nthen Vim sets 'fileencoding' to the null string, i.e., the value of\n'encoding' will be used.\n\nFor more information, read:\n\n    :help 'fileencodings'\n    :help 'encoding'\n\n\n37.8. What is the 'termencoding' option?\n\nThe 'termencoding' option defines how your keyboard encodes the data you\ntype.  If empty, Vim assumes that it has the same value as 'encoding'.\nUsually it should be set to something that matches your locale.\n\nFor more information, read:\n\n    :help 'termencoding'\n    :help locale\n\n\n37.9. What is the 'bomb' option?\n\nWhen reading a file with \"ucs-bom\" present in the 'fileencodings' option,\nVim will set the 'bomb' option on or off depending on the presence or\nabsence of a byte-order mark at the start of the file. When writing, Vim\nwill write a byte-order mark if the 'bomb' option is set. You may set or\nunset it manually do make Vim write, or not write, the b.o.m.\n\nFor more information, read:\n\n    :help 'bomb'\n\n\n37.10. Where can I find an example of a typical use of all these options?\n\nThere is a \"tip\", with explains them in different words with an example, at\n\n    http://vim.wikia.com/wiki/VimTip246\n\n\n37.11. How can I insert Unicode characters into a file using Vim?\n\nSeveral methods are available:\n\n- Characters present on your keyboard can be typed in the usual way, even\n  those which require a \"dead-key\" prefix, like (for instance) the\n  circumflex on French keyboards.\n- Characters for which a digraph is defined can be typed as two characters\n  prefixed by CTRL-K.\n- If you have set the 'digraph' option, you can enter the characters for\n  which a digraph is defined as <char1><BS><char2>.\n- Any character can be entered by using a CTRL-V prefix (or CTRL-Q if\n  CTRL-V is remapped to paste from the clipboard).\n\nFor more information, read:\n\n    :help digraphs\n    :help 'digraph'\n    :help i_CTRL-V_digit\n\n\n37.12. How can I know which digraphs are defined and for which characters?\n\nFirst set the 'encoding' option properly (for instance, to utf-8), then use\nthe `:digraphs` command to list the currently defined digraphs.\n\nAlternatively, the help file contains the complete set of all digraphs.\nSo you can easily search that list there.\n\nFor more information, read:\n\n    :help :digraphs\n    :help 'encoding'\n    :help digraph-table\n\n\n=============================================================================\n\nCurrent Maintainer: Christian Brabandt <cb@256bit.org>\nLast updated on: 11 October 2025\n"
  },
  {
    "path": "vim_faq.vim",
    "content": "\"*vim_faq.vim*\n\"  Last Change: September 4, 2018\n\"  Maintainer:  Paul Bolle <pebolle@tiscali.nl>\n\"  Version:     0.3 for Vim 8.x (tested on 8.1)\n\n\" Has this plugin already been loaded?\nif exists('loaded_vim_faq')\n  finish\nendif\nlet loaded_vim_faq = 1\n\n\"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\" Function: s:ReturnRestOfLine(pattern) \n\"   Search for the first line with {pattern} and return that line without it\n\" Arguments:\n\"   pattern: a valid {pat} for substitute ({expr}, {pat}, {sub}, {flags})\n\" Returns:\n\"   The first line in which {pattern} was found excluding the pattern or\n\"   an empty string\n\"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\nfunction! s:ReturnRestOfLine(pattern)\n    let s:current_line = line(\".\")\n    let s:current_col = col(\".\")\n    let s:substituted = \"\"\n    let s:line = search(a:pattern)\n    if s:line > 0\n        let s:gotten = getline(s:line)\n        let s:substituted = substitute(s:gotten, a:pattern, \"\", \"\")\n    endif\n      \" make sure the cursor is where it was when we called this function\n      call cursor (s:current_line, s:current_col)\n    return s:substituted\nendfunction\n\n\"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\" Function: s:ReturnSpaces(count) \n\"   Return a string of 'count' spaces\n\"   (I'm pretty sure I only wrote this function because I don't know all\n\"   tricks available to populate a replace string in ':s///')\n\" Arguments:\n\"   count: a number\n\" Returns:\n\"   A string of count spaces\n\"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\nfunction! s:ReturnSpaces(count)\n    return repeat(' ', a:count)\nendfunction\n\nfunction! MakePath(vim_doc_path)\n    \" Name of the document path based on the system we use:\n    if (has(\"unix\"))\n        let l:mkdir_cmd  = ':silent !mkdir -p '\n    else\n        let l:mkdir_cmd  = ':silent !mkdir '\n    endif\n\n    if (!(filewritable(a:vim_doc_path) == 2))\n        echomsg \"Creating doc path: \" . a:vim_doc_path\n        execute l:mkdir_cmd . a:vim_doc_path\n        if (!(filewritable(a:vim_doc_path) == 2))\n            \" Put a warning:\n           echomsg \"Unable to open documentation directory\"\n           echomsg \"Type :help add-local-help for more informations.\"\n        return 0\n        endif\n    endif\nendfunction\n\n\n\"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\" Function: VimifyAndInstallFaq(vim_faq_textfile, vim_doc_path) \n\"   Install vim_faq.txt in documentation.\n\"   This script will happily overwrite an already installed vim_faq.txt!\n\" Arguments:\n\"   vim_faq_textfile: full path to vim_faq.txt\n\"   vim_doc_path: full path to doc directory, e.g.: /home/pico/.vim/doc\n\" Return:\n\"   1 if a Vimified vim_faq.txt is installed, 0 otherwise.\n\" Note:\n\"   This script started as rewrite of s:SpellInstallDocumentation from \n\"   vimspell.vim. That script uses a smart way to determinate vim_doc_path.\n\"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\nfunction! VimifyAndInstallFaq(vim_faq_textfile, vim_doc_path)\n    \" Name of the document path based on the system we use:\n    if (has(\"unix\"))\n        \" On UNIX like system, using forward slash:\n        let l:slash_char = '/'\n        let l:mkdir_cmd  = ':silent !mkdir -p '\n    else\n        \" On M$ system, use backslash. Also mkdir syntax is different.\n        \" This should only work on W2K and up.\n        let l:slash_char = '\\'\n        let l:mkdir_cmd  = ':silent !mkdir '\n    endif\n\n\n    if (!(filewritable(a:vim_doc_path) == 2))\n        echomsg \"Creating doc path: \" . a:vim_doc_path\n        execute l:mkdir_cmd . a:vim_doc_path\n        if (!(filewritable(a:vim_doc_path) == 2))\n            \" Put a warning:\n           echomsg \"Unable to open documentation directory\"\n           echomsg \"Type :help add-local-help for more informations.\"\n\t   return\n        endif\n    endif\n\n\n    \" Exit if we have problem to access the document directory:\n    if !isdirectory(a:vim_doc_path)\n        return\n    endif\n\n    \" Full name of script and documentation file:\n    let l:doc_name = fnamemodify(a:vim_faq_textfile, ':t')\n    let l:faq_doc_file = a:vim_doc_path . l:slash_char . l:doc_name\n\n    \" Prepare window position restoring command:\n    if (strlen(@%))\n        let l:go_back = 'b ' . bufnr(\"%\")\n    else\n        let l:go_back = 'enew!'\n    endif\n\n    \" Create a new buffer & read in the plugin file (me):\n    setl nomodeline\n    exe 'enew!'\n    exe 'r ' . a:vim_faq_textfile\n\n    setl modeline\n    let l:buf = bufnr(\"%\")\n    setl noswapfile modifiable\n\n    norm gg\n\n    \" Here we start to Vimify\n\n    \" set tabstop=8\n    set ts=8\n\n    \" Remove first two lines\n    1,2d\n\n    let l:faq_author = s:ReturnRestOfLine (\"^Current Maintainer: \")\n    let l:faq_updated = s:ReturnRestOfLine (\"^Last updated on: \")\n\n    \"Insert header\n    call append(0, '*vim_faq.txt*\tFrequently Asked Questions')\n    call append(1, '')\n\"    call append(2, 'For instructions on installing this file, type >')\n\"   call append(3, '        :help add-local-help')\n\"   call append(4, 'inside Vim.')\n\"   call append(5, '')\n    call append(2, 'Last updated on: ' . l:faq_updated)\n    call append(3, '')\n    call append(4, '                VIM FAQ by: ' . l:faq_author)\n    call append(5, '')\n    call append(6, 'Frequently Asked Questions                                 *vim-faq* *Vim-FAQ*')\n\n    \" make 'helpHyperTextJumps' in index\n    %s/^ \\{4\\}\\([0-9]\\{1,2\\}\\.[0-9]\\{1,2\\}\\)\\. \\(\\w\\)/|faq-\\1| \\2/\n    \" this line is too long. It aligns the Questions at column 13\n    %s/^\\(|faq-[0-9]\\{1,2\\}\\.[0-9]\\{1,2\\}|\\) \\(.\\)/\\=submatch(1) . \n\t\\ s:ReturnSpaces(12 - strlen(submatch(1))) . submatch(2)/\n    \" Align 2nd, 3rd, etc. lines of questions at column 13 too ...\n    1,/==/s/^ \\{5,\\}\\(.\\)/\\t  \\1/\n\n    \" create 'helpHyperTextEntry' for INDEX (in questions)\n    %s/\\(\\nINDEX\\)/\\t\\t\\t\\t\\t\\t\\t\\t*faq-index*\\1/\n\n    \" make 'helpHeader' to INDEX.\n    %s/^INDEX\\zs$/ \\~/\n\n    \" create 'helpHyperTextEntries' in all sections (in questions)\n    \" This line is waaay too long .... Right llign, but the Entries always\n    \" start at a tabstop). Note: 78 - strlen(\"*faq-*) = 72\n    1,/^=\\+$/s/\\(\\nSECTION [0-9]\\+ - \\)\\(\\w.\\+\\)$/\\=s:ReturnSpaces(72 - \n\t\\ strlen(submatch(2)) - (72 - strlen(submatch(2))) % 8) . \"*faq-\" . \n\t\\ tolower(submatch(2)) . \"*\" . submatch(0)/\n\n    \" replace spaces in newly created 'helpHyperTextEntries'\n    g/^ \\+\\*faq-.*\\*$/s/\\([^ ]\\) /\\1-/g\n\n    \" create helpExamples with '>' and '<' (in general: blue)\n    %s/\\(\\n\\_^$\\)\\(\\(\\n \\{4\\}.*\\)\\+\\)\\(\\n\\_^\\)$/ >\\1\\2\\4</\n\n    \" RFC I prefer helHyperTextJumps here. What do other people think\n    \" (Paul Bolle)\n\n    \" but remove those helpExamples if these are ':help ...' examples\n    %s/ \\?>\\(\\n\\_^$\\)\\(\\(\\n \\{4\\}:help.*\\)\\+\\)\\(\\n^\\)<$/\\1\\2\\4/\n\n    \" but remove those helpExamples if these are 'http(s)://...' examples\n    %s/ \\?>\\(\\n\\_^$\\)\\(\\(\\n \\{4,\\}[a-z+]\\+:\\/\\/\\S*\\)\\+\\)\\(\\n^\\)<$/\\1\\2\\4/\n\n    \" remove helpExamples and set helpHeader if these are table style\n    %s/ \\?>\\(\\n\\_^$\\n\\%(\\s\\+\\w\\+\\)\\+\\)\\(\\n\\%(\\s\\+[-=]\\+\\)\\+\\)\\(\\%(\\n \\{4\\}.*\\)\\+\\n^\\)<$/\\1 \\~\\2 \\~\\3/\n\n    \" remove those helpExamples in SECTION 1.4.\n    /^1\\.4\\. What are some of the improvements/,/^\\ze\\n1\\.5\\. Is Vim free/s/\\( >$\\|^<$\\)//\n\n    \" make helpHeader in SECTION 1.4.\n    /^1\\.4\\. What are some of the improvements/,/^\\ze\\n1\\.5\\. Is Vim free/s/^\\(\\S.*:\\|  \\S.*\\)\\zs/ \\~/\n\n    \" make 'helpHyperTextJumps' from ':help ...' examples\n    %s/\\(^ \\{4\\}\\):help \\(.*\\)/\\1\\|\\2\\|/\n\n    \" and revert all that for a block of three <C-D> examples (in 4.2)\n    %s/\\(^ \\{4\\}\\)|\\(.*<C-D>\\)|/\\1:help \\2/ \n    %s/\\(\\n^$\\)\\(\\(\\n \\{4\\}:help .*<C-D>\\)\\+\\)\\(\\n^\\)$/ >\\1\\2\\4</\n\n    \" another special case in the helpHyperTextJump: '|'\"|' didn't work ...\n    %s/\\(^ \\{4\\}|'\\)\"\\(|\\)/\\1quote\\2/\n\n    \" make 'helpHyperTextEntries' to SECTIONs (in answers), e.g.: *faq-27*\n    norm! gg\n    /==/,$s/\\(\\nSECTION \\)\\([0-9]\\{1,2\\}\\)\\( -\\)/\n\t\\ \\t\\t\\t\\t\\t\\t\\t\\t*faq-\\2*\\1\\2\\3/\n\n    \" make 'helpHeader' to SECTIONs.\n    %s/^SECTION [0-9]\\{1,2\\} -.*\\zs$/ \\~/\n\n    \" make 'helpHyperTextEntries' to answers, e.g. *faq-12.1*\n    %s/\\(\\n\\)\\([0-9]\\{1,2\\}\\.[0-9]\\{1,2\\}\\)\\.\\(.\\)/\n\t\\ \\t\\t\\t\\t\\t\\t\\t\\t*faq-\\2*\\1\\2\\.\\3/\n\n    \" Add hyperlinks to references to other questions\n    %s/Question:\\? \\?\\(\\d\\+\\.\\d\\+\\)\\.\\?/& |faq-\\1|/\n\n    \" Remove (*New*) and (*Updated*), first if on separate line\n    %s/^\\s\\+(\\*\\(New\\|Updated\\)\\*)\\n//e\n    \" and now for the rest of those ...\n    %s/(\\*\\(New\\|Updated\\)\\*)//e\n    \n    \" don't install *faq* and *FAQ* tags\n    \"%s/\\*\\(faq\\|FAQ\\)\\*/\\1/g\n    \" don't tag *always*\n    %s/*always[*]/always/g\n\n    \" remove a few lines at the end\n    $-3,$d\n\n    \" remove some double blank lines\n    %s/\\(^\\s*$\\n\\)\\{2,\\}\\(^==*$\\)/\\1\\2/\n\n    \" Add modeline for help doc: the modeline string is mangled intentionally\n    \" to avoid it be recognized by VIM:\n    call append(line('$'), ' v' . 'im:tw=78:ts=8:ft=help:norl:')\n\n    \" Save the help document:\n    exe 'w! ' . l:faq_doc_file\n    exe l:go_back\n    exe 'bw ' . l:buf\n\n    \" Build help tags:\n    \"exe 'helptags ' . a:vim_doc_path\n\n    return 1\nendfunction\n\nfunc! MakePODFile(textfile)\n    /^INDEX/d\n    g/^=\\+$/d\n    call append(1,['=pod', '', '=encoding utf-8', '', '=head1 DESCRIPTION'])\n    /^1.4/,/^1.5/s/^.*:$/=head3 &/\n    /^1.4/,/^1.5/s/^\\s\\s\\S.*$/=head4 &/\n    %s/^SECTION \\d\\+ - \\(.\\+\\)$/=head1 \\1\\r/\n    %s/^\\d\\+\\.\\d\\+\\./=head2 &/\n    /^Current Maintainer:/s//=head1 AUTHOR\\r\\r&/\n    /^Last updated on:/s//\\r&/\n    \"call append('$', '=cut') Not needed in a pod file\n    \" Don't make it too wide\n    %s/^\\s\\{4}/ /\n    \" Generate bold text around help references\n    :%s/^\\s*\\(:help .*\\)$/B<\\1>\\r/\n    exe ':saveas! ' a:textfile\nendfunc\n\n:com! -bar CreateVimFAQHelp :echo VimifyAndInstallFaq(\"./vim_faq.txt\", \"./doc\")\n:com! -bar CreateVimPODFile :echo MakePODFile(\"./others/vim_faq.pod\")\n"
  }
]