a byte of vim -- 学习摘要
说在前面的话 -- a byte of vim 是我见过的最介绍vim 最好的书,想了解强大的vim的人,或者是已经在使用vim而打算进一步了解的人,我感觉都应该看看这个,内容精炼但涵盖非常广,……“vim为什么这么强大”,当看完这本书时,我想你就能全然的了解了……此外。本书是一英文版,但非常easy,学语言的同一时候学习英语非常不多……
附上最新版的下载链接 http://download.csdn.net/detail/wuzhimang/8933257 ,当然上官网才是硬道理
下面是自己针对a byte of vim 做的学习摘要。原文的内容,方便自己以后使用与回顾 —— 由于好书(哪怕是工具书)读一两遍是不够的
## A Byte of Vim
1.Perface
"There is no great writing, only great rewriting." -- Louis Brandeis
"Vim if one of the few pieces of software that I use for nearly 10 hours a day." -- Authors
The mantra is *Concepts. Examples. Pithy*
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
2.Introduction
Powerful means following the paradigm of "Minimal effort. Maximal effect."
Press * Run :sp Run :50 Run :,100s/old/new/g Press gf
Run :colorscheme desert Run :nmap <c-s> :w<CR>
Run :mksession ~/latest_session.vim -> vim -S ~/latest_session.vim
Run :syntax on -> :set filetype=Wikipedia
Run :set foldmethod=indent Run :tabedit <file>
Press ctrl-n Run :0,10s/form/to/gc Run :%s/from/to/g
Run :help vim-modes-intro Run :edit hello.txt Run :e hello.txt
Run :help notation Run :help keycodes
Press db Press dw Press 2d3w
3.Modes
There are three basic modes in Vim - normal, insert and visual
Run :echo "hello world" Run :help usr_toc
Run :help index
Run :help vim-modes-intro Run :help mode-switching
a,A i,I o,O r,R s,S v,V
4.Typing Skills
vi/vim graphical cheat sheet
Press } { ( ) ~Press 3fh~
Press ctrl-o Press ctrl-i
Press ^ $ ctrl-f crtl-b
Press G H M L Press : help word-motions
Press :help cursor-motions
Press :help text-objects Press :help motion/various motions
5.Help
Run :help Run :help usr-manual
Run :help abbreviate Press ctrl-]
Run :helpgrep gt Run :cnext Run :cprev Run:clist
Press ma -> Press 'a Press ~
Run :let &keywordprg=':help'
"The true delight is in the finding out rather than in the knowing"
6.Editing Basics
Run :swapname Run :help swap-file
nmap <c-s> :w<CR>
imap <c-s> <Esc>:w<CR>a
Run :e ../tmp/test.txt cd pwd
Run :e C:\\shopping\\monday.txt
y -> yank
1G and | -> moves to the first line and the first column respectively
Run :dl dw
yy -> operation name twice, it will operate on the
yap -> yank the current paragraph
xp -> swap two characters
dwwP -> swap two words
m{a-zA-z} -> '{a-zA-Z}
"If I had eight hours to chop down a tree, I'd spent six hours sharpening my axe" -- Abraham Lincoln
u/U <-> ctrl-r --> undolevels :earlier 4m :later 45s
:undolist Run :help :undolist/undo-redo/usr_32.txt
set incsearch/ignorecase/smartcase --> /step /Step
Run :help vimrc-intro :help pattern
Run :/\<step\> /\d\+ /\d\*
7.Multiplicity
:set foldmethod=indent --> zc zo za
:nnoremap <space> za --> noremap
Run :help buffer-list :buffers :ls :bd 1
:e test.txt
:sp or ctrl-w s :vsp or ctrl-w v
ctrl-w r --> rotate the windows
ctrl-w K --> move the current windows to the topmost position
ctrl-w _ --> make the cutternt windows as big as possible
ctrl-w = --> make the windows 'equal' in height again
:resize 10
:help windows
:tabnew :tabc :help tabpage
:tab help tabpage :tabmove 0 :tabdo
:help setting-guitablabel
8.Personal Information Management
9.Scripting
qa --> to start recording the macro named as a (register)
gUl --> to switch the first letter to upper case
g# # g* *
q --> stop recording the macro
@a --> apply this to other lines
. --> repeat the last action
:colorscheme desert --> <tab> to cycle through the available schemes
:echo strlen(getline('.'))
:let len = strlen(getline('.'))
:echo "We have 'len' characters in this line."
:echo $HOME :echo &filetype :echo @a
:help function-list
:source capitalize.vim :call Capitalize()
:echo has("python")
:help eval :help python-commands :help perl-using
:help ruby-commands
10.Plugins
There are various kinds of plugins that can be written
--> vimrc --> global plugin --> filetype plugin
--> syntax highlighting plugin --> compiler plugin
vimrc --> for general customizations
gvimrc --> for GUI specific customizations
:help vimrc
the colon is optional when writing scripts in files
vim -u NONE -> start up Vim without any initialization scripts being run
:hlep -u :help starting
11.Programmers Editor
"Let's me reiterate that typing skills is critical for a programmer"
"We are typists first, programmers second"
:set filetype=vim $VIMRUNTIME/syntax --> the list of language types available
svn diff | vim -R -
:set autoindent :set smartindent
% -> bounce(curly bracket)
! -> shell commands :sh -> a full-fledged shell :%!sort
gf -> open the file gd -> move to the local definition of the variable name
gD -> the global declaration ]] ->
:help object-motions [I -> display all lines that contain they keyword under the cursor
:Vex -> :Sex ->
ctags cscope :make
omnicompletion -> pythoncomplete.vim -> ftplugin/<language>complete.vim
:runtime! autoload/pythoncomplete.vim
~/.vimrc -> autocmd FiltType python runtime! autoload/pythoncomplete.vim
ctrl-n ctrl-p
:help new-omni-completion
imap <c-space> <c-x><c-o> -> omnicompletion
snippet -> SnippetsEmu
:source % :runtime! ftplugin/python_snippets.vim
12.More
Modeline -> vim: noexpandtab
Portable Vim -> GVimPortable.exe
Upgrade plugins -> :GLVS(which stands for 'G'et 'L'atest 'V'im 'S'cripts)
-> :help getscript
Dr.Chip's plugins -> drawit.vim
Blog from Vim -> Vimpress plugin
Make Firefox work like Vim -> Vimperator add-on
Contribute to Vim -> :help development
Bram's talk on the seven habits -> "Seven habit of effective text editing"
Community -> hang out at the vim@vim.org
13.What Next
The other important resources -> "Best of Vim Tips" :help user-manual -> the all-important
:help new-7
a byte of vim -- 学习摘要的更多相关文章
- Linux学习系列之Linux入门(二)Vim学习
第二篇 Vim学习 主要内容: 基本命令: 插件扩展: 参考资料: vim是一个命令控制的文本编辑器,可以完成几乎我们想要做的所有工作,除了Emacs几乎没有其他的工具能和它匹敌.官方网站是:http ...
- Vi/VIM键盘图, Vi/vim学习图
Vi/vim学习图 引用: Vi键盘图片可视化教程 http://www.cnblogs.com/me115/archive/2010/11/16/1878295.html 网上的文章易流失.感谢分享 ...
- vim学习、各类插件配置与安装
vim学习.各类插件配置与安装 vim 插件 配置 1. vim学习 vim基础学习:根据网上流行基础文章<简明Vim练级攻略>,进阶书籍<vim实用技巧>.注:进阶书籍可以在 ...
- 推荐vim学习教程--《Vim 练级手册》
非常不错的vim学习资源,讲解的简单明了,可以作为速查工具,在忘记时就翻下.地址如下: <Vim 练级手册>
- VIM学习二: VIM配置代码及效果图
vim学习及插件 参见:http://www.cnblogs.com/caixu/p/6337926.html .vimrc配置 "***************************** ...
- vim学习之改头换面(基础配置)
还记得在线有个维护博客园的学长说过,这网站的前端做的贼丑,今日一看果真如此.其实我想说毕竟干货多,没有那么多花花肠子.下面开始进入正题. 在入坑了sublime.vscode.atom.notepad ...
- vim学习、各类插件配置与安装【转】
转自:https://www.cnblogs.com/forest-wow/p/6916531.html 1. vim学习 vim基础学习:根据网上流行基础文章<简明Vim练级攻略>,进阶 ...
- Linux之Vim学习
Linux之Vim学习 一般模式 光标移动 按键 作用 j或down方向键 向下移动一个字符 k或up方向键 向上移动一个字符 h或left方向键 向左移动一个字符 l或right方向键 向右移动一个 ...
- CSS学习摘要-定位实例
CSS学习摘要-定位实例 注:全文摘自MDN-CSS定位实例 列表消息盒子 我们研究的第一个例子是一个经典的选项卡消息框,你想用一块小区域包括大量信息时,一个非常常用的特征.这包括含有大信息量的应用, ...
随机推荐
- linux系统清理僵尸进程记录
在UNIX 系统中,一个进程结束了,但是他的父进程没有等待(调用wait / waitpid)他, 那么他将变成一个僵尸进程. 在fork()/execve()过程中,假设子进程结束时父进程仍存在, ...
- 高效重构 C++ 代码
引言 Martin Fowler的<重构:改善既有代码的设计>一书从2003年问世至今已有十几年时间了,按照计算机领域日新月异的变化速度,重构已经算是一门陈旧的技术了.但是陈旧并不代表不重 ...
- 大量数据更新导致fgc频繁引起jvm服务暂停。
线上跑的几台server突然出现大量fgc,因为在fgc过程的stop the world太久.引起其他应用訪问该server上的接口大量超时.(发生超时的时间点和fgc时间点一致) 先进行初步的优化 ...
- redhat mount iso as one yum repository
prepare redhat DVD iso rhel-server-6.4-x86_64-dvd.iso mount cd / mkdir /mnt/rhel mount -o loop rhel- ...
- Jenkins 无法下载插件的解决办法
有时候在安装插件时可能会出现下图的问题: 这应该是由于天朝的墙导致的,所以笔者就用了手动安装的方式 到https://wiki.jenkins-ci.org/display/JENKINS/Plugi ...
- Cocos2d-x 3.2 大富翁游戏项目开发-第七部分 获取角色路径_2
在编写获取路径方法前,我们先把角色须要的动画文件载入进来,角色的文件为png 和 plist格式. player1_anim.png.plist player1_anim.pn ...
- AndroidStudio怎么实现微信分享功能
在应用中添加微信分享功能,需要在微信开放平台上传你的应用,审核通过后方可使用此功能. https://open.weixin.qq.com/网址 申请的过程比较简单,这里就不追溯了,贴一个友情链接 h ...
- 倍福TwinCAT(贝福Beckhoff)基础教程5.1 TwinCAT如何执行系统命令
TwinCAT提供了一系列的执行Windows系统命令的方法 Name 描述 NT_Shutdown 关机操作系统 NT_AbortShutdown 取消关机操作系统命令 NT_Reboot 重启操作 ...
- Linux——使用国内镜像通过pip安装python的一些包
学习flask,安装virtualenv环境,这些带都ok,但是一安装包总是出错无法安装, http://e.pypi.python.org/这个就是官网了,清华大学提供的 建议非清华大学校内的使用这 ...
- C++ 智能指针详解(转)
C++ 智能指针详解 一.简介 由于 C++ 语言没有自动内存回收机制,程序员每次 new 出来的内存都要手动 delete.程序员忘记 delete,流程太复杂,最终导致没有 delete,异常 ...