---
title: Vim Getting Started
h1: Vim Getting Started Notes
description: efefomatic welcome page.
author: JWRR
date: January 11, 2019
theme: a
...
[View markdown](vim-notes.md)
{{ toc }}

##@ Vim commands

I&apos;m not a Vi expert but I do fine just remembering this small set of commands. I wrote this web page with Vim.

```
unix_prompt> vi example.txt - start vi / vim
i - Enter insert mode. You need to be in insert mode to add text.
Esc Key - exit insert mode
Move up down left right - use the arrow keys
```

You can **NOT** be in Insert Mode when you do any of the following commands, so hit the Escape key.

```
:w - write and save edits
:q - quit
:wq - save and exit
:q! - quit  without
x - delete 1 character
dd - delete 1 line
gg - go to first line
G - go to last line
:5 - go to line 5
/abc - find string 'abc'
n - find next
u - undo
Ctrl-R - redo (Control R)
```

##@ Copy and Paste

This works for me over Putty.

```
1a. Left-mouse-button to select text.
1b. You can even select text from Windows (such as Word, IE, Firefox, notepad++). Just hit Ctrl-C after you select the text.
2. Move cursor to where you want to insert (using arrow keys)
3. Make sure you&apos;re in Insert Mode (press i)
4. Right-mouse-click to paste
```

If you want more details here is the
[Official Vim Documentation](http://www.vim.org/docs.php).


##@ Vi is frozen

You probably typed `k'ctrl+s . To recover type `l&apos;ctrl+q .

If you hit `k'ctrl+Z in vi/vim, enter **fg** (foreground) at the shell prompt to bring vim back.

##@ Setup / Configuration File

The Vim resource configuration file is located in your home directory
at **~/.vimrc** \
It is a hidden file (all files that start with dot are hidden files, so
to see it type **ls -a ~** .\
The vimrc setup file is just a text file that can be edited with vim (or emacs
LOL or my favorite nedit :).\

##@ Show Linenumbers in Vim

To show line numbers in Vim just type **:set number**.  To turn off line
numbers type **:set nonumbers**.\
To show line numbers by default just add **set number** to **.vimrc**.

##@ Blue Comments are hard to see with Vim Syntax highlighting

I use putty and with it&apos;s default dark background I can barely see the
blue comments.  The vim syntax highlighting scheme can be changed
with **:set background=dark**. To make this syntax highlighing change the
default add **set background=dark** to **.vimrc**.
If you don&apos;t want to change the entire Vim syntax color scheme, but just
want to change the comment&apos;s color try
this: **:highlight Comment ctermfg=green guifg=green gui=bold**
To save some typing the **highlight** command can be abbreviated to **hi**
Here is a link to official
[Vim Syntax Highlighting Documentation](http://vimdoc.sourceforge.net/htmldoc/usr_06.html)

