---
title: "5.convert_find_substitute"
author: "千絮泠泉"
date: "2019-01-30T16:18:15Z"
tags: []
categories: ["操作系统"]
slug: "5-convert-find-substitute"
draft: false
lastmod: "2019-01-30T16:18:15Z"
id: 2437263
url: "https://1971161579.iteye.com/blog/2437263"
---

```vim

" Insert
Shift-i/A               insert mode and move to head/tail
a/i                     cursor after/befor insert
[n]O/o                  line before/afer insert n times
[n]-i                   insert mode repeate n times


" Convert
~                       char upper/lower
g ~ w                   word upper/lower
g ~ $/g ~ ~             line upper/lower
gU/uw                   word upper/lower


" Find
F/f{char}               backwards/forewards find a char
t/T{char}               find a char before target
dt{char}/df{space}      delete from cursor to find target
/{char}                 command line find


" substitute
        [range][substitute]/{pattern}/{String}/[flags]
s/going/rolling/g               this line all "going" substitue to "rolling"
%s/going/rolling/g              % matches all range

Shift-r/R                       substitute mode
r                               char substitute
cw                              change word
c$/C                            change line after cursor



```