说在前面的话 -- 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

最新文章

  1. winfrom 限制文本框小数点后两位
  2. python3.x + selenium 3.x 遇到的问题:Exception ignored in: &lt;bound method Service.__del__ of &lt;selenium.webdriver.firefox.service.Service object at 0x0045E450&gt;&gt;
  3. Python-Matplotlib安装及简单使用
  4. EC6 map 和 set
  5. php 实现 jsonp 数据接口
  6. mysql的优化措施,从sql优化做起
  7. php 用post请求调用接口api
  8. sudo apt-get update
  9. Andorid时间控件和日期控件
  10. 重温HTML的基础
  11. php高性能开发阅读笔记
  12. XP oracle32位客户端安装找不到orandce11.dll.dbl
  13. WinDBG相关
  14. 关于react16.4——上下文Context
  15. Java学习笔记26(异常)
  16. SignalR快速入门
  17. C#关键字as出现的错误
  18. Linux下编译ffmpeg并用GDB调试
  19. mysql java.sql.SQLException: Can&#39;t call commit when autocommit=true
  20. 20155322 2016-2017-2 《Java程序设计》实验二《Java面向对象程序设计》

热门文章

  1. Unity定制 Image、Text的对象生成
  2. 2017年开发者生态报告:Python最多人想尝试的编程语言(转载)
  3. ASP.NET MVC学习---(四)MVC初窥
  4. vscode - 安装离线插件
  5. 开发ionic准备之安卓模拟器设置(2)
  6. 如何用PS快速的批量制作连续号码数字编号图解
  7. STL学习笔记(变动性算法)
  8. Eclipse 使用 SVN 插件后改动用户方法汇总
  9. 【Excle数据透视表】如何在数据透视表顶部显示列总计数据
  10. 【VBA】获取当前工作表的用户名