GithubHelp home page GithubHelp logo

yifengyou / learn-vim Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 3.0 4.19 MB

vim基本学习

Vim Script 18.20% CSS 2.01% Ruby 23.85% HTML 12.07% JavaScript 33.45% Makefile 0.50% C 8.57% Python 0.57% Shell 0.79%

learn-vim's Introduction

Vim 基本功(Learn Vim)

20190917_193517_45

本仓库内容

  1. Vim基本功学习笔记
Something I hope you know before go into the coding~
First, please watch or star this repo, I'll be more happy if you follow me.
Bug report, questions and discussion are welcome, you can post an issue or pull a request.

目录


推荐 vim 配置方案

参考教程

图解Vim

20190917_192906_38

20190917_192921_43

20190917_192946_14

20190917_193008_29

小结

  • 永远不要用 CTRL-C 代替 完全不同的含义,容易错误中断运行的后台脚本
  • 很多人使用 CTRL-[ 代替 ,左手小指 CTRL,右手小指 [ 熟练后很方便
  • 某些终端中使用 Vim 8 内嵌终端如看到奇怪字符,使用 :set t_RS= t_SH= 解决
  • 某些终端中使用 NeoVim 如看到奇怪字符,使用 :set guicursor= 解决
  • 多使用 ciw, ci[, ci", ci( 以及 diw, di[, di", di( 命令来快速改写/删除文本
  • 在行内左右移动光标时,多使用w b e或W B E,而不是h l或方向键,这样会快很多
  • SHIFT 相当于移动加速键, w b e 移动光标很慢,但是 W B E 走的很快
  • 自己要善于总结新技巧,比如移动到行首非空字符时用 0w 命令比 ^ 命令更容易输入
  • 在空白行使用 dip 命令可以删除所有临近的空白行,viw 可以选择连续空白
  • 缩进时使用 >8j >} ap =i} == 会方便很多
  • 插入模式下,当你发现一个单词写错了,应该多用 CTRL-W 这比 快
  • y d c 命令可以很好结合 f t 和 /X 比如 dt) 和 y/end
  • c d x 命令会自动填充寄存器 "1 到 "9 , y 命令会自动填充 "0 寄存器
  • 用 v 命令选择文本时,可以用 o 掉头选择,有时很有用
  • 写文章时,可以写一段代码块,然后选中后执行 :!python 代码块就会被替换成结果
  • 搜索后经常使用 :nohl 来消除高亮,使用很频繁,可以 map 到 上
  • 搜索时可以用 CTRL-R CTRL-W 插入光标下的单词,命令模式也能这么用
  • 映射按键时,应该默认使用 noremap ,只有特别需要的时候使用 map
  • 当你觉得做某事很低效时,你应该停下来,u u u u 然后思考正确的高效方式来完成
  • 用 y复制文本后,命令模式中 CTRL-R 然后按双引号 0 可以插入之前复制内容
  • Windows 下的 GVim 可以设置 set rop=type:directx,renmode:5 增强显示

learn-vim's People

Contributors

yifengyou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.