VIM 笔记1

#author:felix
#date:2019-09-19

# terminal
#---------------------------------------
# ctrl+f  move forward
# ctrl+b  move back
# ctrl+a  move to the head
# ctrl+e  move to the end
# crtl+h  delete a char
# ctrl+w  delete a word
# ctrl+u  delete current comand


# VIM has Four model
# --normal  --insert  --command  --visual

# normal ----> insert  i/a/o  I/A/O
# insert ----> normal  ESC/ctrl+[
# normal ----> command  :
# normal <---> visual  v/V/ctrl+v

# ----------------------------------------
# u           undo
# ^           move to the line begining
# $           move to the line end
# [num]gg     move to the first[num] line
# gi          back to the last edit position and into the insert model
# G           move to the last line
# ctrl+o      back to the pre position
# H           jump to the head of the current page
# M           jump to the middle of the current page
# L           jump to the end of the current page
# ctrl+f      next page
# ctrl+b      pre page
# ctrl+d      next half page
# ctrl+u      pre half page
# zz          put current position into the screen middle

 

# w/W        move to the next word begining
# e/E          move to the next word end
# b/B          move to the pre word begining
# ge            move to the pre word end

# skills: "e/E" and "a"
#            "b/B" and "i"

# search in one line in the normal model
#-----------------------------------------
# f/F[char][;][,]   jump to the position of "char";
#                   ; jump to the next one
#                   , jump to the pre one
# t[char]         
# 0/^               jump to the first char
# $/g_              jump to the last char


# delete in vim
# x         delete a char
# [n]x      delete "n" chars
# dd        delete one line
# [n]dd     delete "n" lines
# daw       delete around word
# dt[char]  delete chars until "char"
# d0        delete chars before the current position
# d$        delete chars after the current position

# replace/change/substitute
#-----------------------------------------------------
# r        replace one char
# [n]r     replace "n" chars by one char
# R        replace one char repeatly
# s        delete one char and into the insert model
# [n]s     delete "n" chars and into the insert model  
# S         delete one line and into the insert model
# caw     change one word and into insert model
# c0       delete all chars before the current position and into insert model
# c$       delete all chars after the current position and into insert model
# C        delete all chars after the current position and into insert model
# ct[char] delete chars until "char"

# search in vim
# /[chars]           search forward
# ?[chars]           search backward
# */#                search current position word
# n/N                "n" move pre one; "N" move to next one
# set hls            set highlight line
# set incsearch      


# search and subsitute
# :[range]s/{pattern}/{string}/[flages]
#          range:  10,20 means 10-20 lines;  % means all
#          pattern: old strings
#          string:  new strings
#          flags:   g--global  c--comfirm   n--number

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值