Skip to content

Latest commit

 

History

History
79 lines (54 loc) · 1.63 KB

File metadata and controls

79 lines (54 loc) · 1.63 KB

vi

NAME

vim - Vi IMproved, a programmers text editor

SYNOPSIS

vim [options] [file ..]

vim [options] -

vim [options] -t tag

vim [options] -q [errorfile]

ex gex view

gvim gview vimx evim eview

rvim rview rgvim rgview

DESCRIPTION

Vim is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text. It is especially useful for editing programs.

COMMANDS

To search and replace globally in a file

:%s/search/replace/g

How to paste yaml in vi

  • When you try to paste yaml directly
- name: install packages
  pip:
    name: openshift==0.11.2
  tags:
    - docker-image
    - full-deploy
    - code-deploy
  • After pasting it in vi. 0_0
- name: install packages
    pip:
                name: openshift==0.11.2
                  tags:
                              - docker-image
                                    - full-deploy
                                          - code-deploy
  • Turn off the auto-ident when you paste code in exec mode reference link
:set paste                                                                                                                                                                                                  
  • Now go to insert mode and paste the yaml ( you should see -- INSERT (paste) -- at the bottom)
- name: install packages
  pip:
    name: openshift==0.11.2
  tags:
    - docker-image
    - full-deploy
    - code-deploy
  • You can turn it back on