---
title: "vim技巧 随笔"
author: "shrek"
date: "2009-03-22T22:50:50Z"
tags: []
slug: "vim"
draft: false
lastmod: "2009-03-22T23:06:01Z"
id: 353313
url: "https://shrek.iteye.com/blog/353313"
---

文本块操作
di"   : 删除 "" 中的内容
di'   : 删除 '' 中的内容
di(   : 删除 () 中的内容
di<   : 删除 <> 中的内容
di 中的内容
di{   : 删除 {} 中的内容

详细可以看 :help text-objects

文本互换位置
:s/\(pattern1\)\(pattern2\)/\2\1/

小写转为大写
:s/\(\)/\u\1/g

首字母转为大写
:s/\</\u&/g