Giter Site home page Giter Site logo

blog's People

Contributors

yuchencc avatar

blog's Issues

#1 VIM常用指令备忘大全

VIM常用指令备忘大全


vim是一款很好用的编辑器,可以仅仅用键盘就能完成一大堆编辑,但是其反人类的指令按键却是我们这种window使用多年者的硬伤。整理了一些常用的,因为开始用vim的不多,以后会慢慢补充更新。

这边的指令排序和vimtutor中略有不同,仅按我个人的使用频率与认知排序的

摘录至vimtutor

1、文件定位

行号 + G 定位到具体行
G 定位到文件最后一行
gg 定位到文件第一行
CTRL + G 显示当前打开的文件名和所在行

2、查找

/ + 查找的字符
下一个对象:n
上一个对象:N
**反向查找使用 '?' 替代 '/'

3、删除

X 删除光标所在位置的字符
d+w 删除光标所在位置的单词
d+d 删除光标所在位置整行
d+$ 从当前光标删除到行末

4、插入

i 在光标所在字符 进入insert模式
a 在光标的下一个字符 进入insert模式

5、撤销

u 撤销最后执行的命令(最后一次的命令)
U 撤销对整行的修改(最后一次的批量命令)

6、复制黏贴

y 点击v进入可视模式,复制选中文本
p 黏贴复制或者删除的文本(linux里没有剪切,剪切就是删除黏贴的意思)

7、修改(整合 删除+插入)

c + c 删除整行并进入insert模式
c + $ 从当前光标删除到行末并进入insert模式

8、配对字符查找

在一行中的任何一个 (、[ 或 { 处,输入 % 可以查找配对的括号 )、]、}


在VIM中执行外部命令的方法

:! + xxx外部命令,如 :!ls


##小结:总结了一些前端学习中,可能遇到的使用vim的快捷键,熟练掌握后将大大提升vim的使用效率。有些复杂的命令没有列出,可能是使用率较小或者目前学习知识尚未涉及到。

希望对大家的学习一样有帮助

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.