vim的进阶使用
文章平均质量分 85
dark_tone
编程自学者,喜爱专研未知。
智商不够
展开
-
第一章 vim中简化删除,光标移动和查找操作
在个人vim使用基础中,整理了最简单的常规用法,但对于vim这个软件来说,利用功能还远远不够。本质上讲,我们的代码编写工作是重复性的,凡是可以简化重复性操作的方式,都会成倍节省我们的时间。这正是vim的核心思想。一,命令行模式下简化删除:①删除单个字符:【x】②删除从光标开始到单词结尾:【dw】假设光标在r处,按下【dw】后ruct这4个字符被删掉了;假设光标在原创 2016-10-15 02:35:32 · 4862 阅读 · 0 评论 -
第六章 个人优化vim第三步 :主题colorscheme
主题就是别人设计好的配色风格,主题本身是跨平台的,并非linux下 vim专用。 visual studio,xcode等开发工具均可选用,类似于游戏中的皮肤。 打开一个Vim窗口,输入命令:color或:colorscheme后回车查看当前的颜色主题 可以看到当前的颜色主题为default。 vim自带了许多主题,我们怎么知道有哪些主题,又放在哪里呢? :echo $VIM原创 2016-10-20 04:48:03 · 13360 阅读 · 0 评论 -
第五章 个人优化vim第二步: 开启自带辅助
1. 在第一步快捷键修改完成后,个人使用vim编写代码的效率已经提高了不少。 要想知道更好的管理自定义快捷键,在vim普通模式下输入 :nmap “显示普通模式下自定义快捷键 或者进入vimrc文件,修改配置 nunmap “ 删除普通模式下某个自定义快捷键 umapclear “删除所有普通模式下自定义快捷键 “设置行号 set nu " 开启实时搜索功能原创 2016-10-20 04:15:40 · 2227 阅读 · 0 评论 -
第二章 再谈 【次数+操作符+动作命令】,及EX命令
前面记录了vim的简化方式,最理想的过程,追求的是一键移动,一键操作修改。达成这个目的除了宏作用之外,次数+操作符+动作命令也扮演了重要作用。【2dd】就是一个典型的次数+操作符+动作命令:【2】表明连续执行两次;【d】表示是一个剪切操作;【d】当一个操作符命令被连续调用两次时,表示作用于当前行;整体含义:连续删除两次当前行。值得注意的是,【d】本质上属于剪切操作,内容被复制到原创 2016-10-15 22:46:03 · 906 阅读 · 0 评论 -
第十八章 个人渣翻译 spf13插件---EasyMotion 使用教程
EasyMotion provides an interactive way to use motions in Vim. It quickly maps each possible jump destination to a key allowing very fast and straightforward movement. QuickStart EasyMotion is trigge原创 2016-10-28 01:39:50 · 3107 阅读 · 0 评论 -
第三章 标记位置mark,切换shell
第二章简述了EX命令格式,vim为几乎所有功能都提供了相应的EX命令。所以从这个角度来说,vim使用是否得心应手,就看掌握的EX命令是否足够多,足够熟练。mark标记,既是范围又可以跳转,vim会自动帮我们记录某些感兴趣的位置点。. ——最近编辑的位置0-9 ——最近使用的文件∧ ——最近插入的位置' ——上一次跳转前的位置" ——上一次退出文件时的位置[ ——上一次原创 2016-10-18 02:47:52 · 1332 阅读 · 0 评论 -
第十七章 个人渣翻译 spf13插件---Tagbar(ctags) 使用教程
看看Tagbar介绍: spf13-vim includes the Tagbar plugin. This plugin requires exuberant-ctags and will automatically generate tags for your open files. It also provides a panel to navigate easily via tag原创 2016-10-27 03:53:42 · 5928 阅读 · 2 评论 -
第十六章 spf13 插件---neosnippet使用教程
如前所述,neocomplete就是一个自动补全的插件。 它又额外附带了补全代码段的特性(模版补全),要想使用这种特性,必须安装另外的插件neosnippet或者ultisnips。 spf13集合包自动帮我们安装了neosnippet,因此可以使用模版补全的能力。 snippet与complete两个插件联系相当紧密,毕竟同一个作者制造的。 个人实践: 使用spf13提供的无论是在普通模式,原创 2016-10-26 01:45:01 · 4463 阅读 · 0 评论 -
第十五章 个人渣翻译 spf13 插件---neocomplete使用教程
首先看看spf13上对该插件的介绍: Neocomplete is an amazing autocomplete plugin with additional support for snippets. It can complete simulatiously from the dictionary, buffer, omnicomplete and snippets. This原创 2016-10-26 00:03:25 · 7762 阅读 · 0 评论 -
第十四章 个人渣翻译 spf13插件---NERDCommenter 使用教程
NERDCommenter allows you to wrangle your code comments, regardless of filetype. View help :NERDCommenter or checkout my post on NERDCommenter. QuickStart Toggle comments using c in Visual or Normal m原创 2016-10-25 04:56:26 · 2133 阅读 · 0 评论 -
第十三章 个人渣翻译 spf13插件---surround 使用教程
This plugin is a tool for dealing with pairs of "surroundings." Examples of surroundings include parentheses, quotes, and HTML tags. They are closely related to what Vim refers to as text-objects. Pro原创 2016-10-25 00:08:06 · 1895 阅读 · 0 评论 -
第十二章 个人渣翻译 spf13插件---ctrlp 使用教程
Ctrlp replaces the Command-T plugin with a 100% viml plugin. It provides an intuitive and fast mechanism to load files from the file system (with regex and fuzzy find), from open buffers, and from rec原创 2016-10-24 19:05:12 · 7221 阅读 · 0 评论 -
第八章 个人渣翻译 spf13插件---undotree 使用教程
在spf13官方文档里,对undotree这个插件的描述: Undotree If you undo changes and then make a new change, in most editors the changes you undid are gone forever, as their undo-history is a simple list. Since versio原创 2016-10-21 07:44:42 · 3808 阅读 · 1 评论 -
第四章 个人优化vim第一步 :快捷键修改
ubuntu默认的vim确实不好用,但它最强大的地方在于可修改的配置文件,以及专门为vim所开发的vimscript脚本语言。后者暂时不用学习,先来研究一下配置文件。vimrc 是控制 vim 行为的配置文件,位于 ~/.vimrc,不论 vim 窗口外观、显示字体,还是操作方式、快捷键、插件属性均可通过编辑该配置文件将 vim 调教成最适合你的编辑器。原创 2016-10-19 06:36:41 · 23985 阅读 · 2 评论 -
第七章 个人优化vim第四步:插件集合spf13安装与使用教程
经过前面三大步骤,个人配置的vim已经初具规模,适合初学者使用。 要想最大程度的发挥vim效能,还可以额外安装各种辅助插件。 但是对于初学者来说,可能花费大量时间精力用来配置各种vim插件并不合适。 于是有人弄出“懒人插件集合包”,可以一键安装。 其中最有名的就是spf13。 1. spf13的安装 Linux/Mac 在预先安装好Git 1.7+ and Vim 7.3+的机子上直接执行原创 2016-10-20 07:10:11 · 16047 阅读 · 3 评论 -
第十一章 个人渣翻译 spf13插件---nerdtree 使用教程(下)
下面来看看NERD tree中快捷键操作 2.3. NERD tree Mappings *NERDTreeMappings* Default Description~ help-tag~ Key~ o.......Open files, directories and bookmarks....................|NERDTree-o| go......Open s原创 2016-10-22 01:40:03 · 1516 阅读 · 0 评论 -
第十章 个人渣翻译 spf13插件---nerdtree 使用教程(中)
不得不说,nerdtree的官方文档挺长的,因此要分成上中下三篇文章来详写。 关于书签 2.2. Bookmarks *NERDTreeBookmarks* Bookmarks in the NERD tree are a way to tag files or directories of interest. For example, you could use bookmarks to原创 2016-10-21 20:53:59 · 1862 阅读 · 0 评论 -
第九章 个人渣翻译 spf13插件---nerdtree 使用教程(上)
首先看看spf13官方文档,对nertree的介绍 NERDTree is a file explorer plugin that provides "project drawer" functionality to your vim editing. You can learn more about it with :help NERDTree. QuickStart Launch usin原创 2016-10-21 10:37:59 · 3877 阅读 · 0 评论