mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
commit
a026db8c9b
@ -1,88 +0,0 @@
|
||||
CNprober 翻译中...
|
||||
How to turn Vim into a full-fledged IDE
|
||||
================================================================================
|
||||
If you code a little, you know how handy an Integrated Development Environment (IE) can be. Java, C, Python, they all become a lot more accessible when the IDE software is checking the syntax for you, compiling in the background, or importing the libraries you need. On the other hand, if you are on Linux, you might also know how handy Vim can be when it comes to text editing. So naturally, you would like to get all the features of an IDE from Vim.
|
||||
|
||||
In fact, there are quite a few ways to do so. One could think of [c.vim][1] which attempts to transform Vim into a C oriented IDE, or [Eclim][2] which merges Vim into Eclipse. However, I would like to propose you a more generalist approach using only plugins. You do not want to bloat your editor with too many panels or features. Instead, the plugin approach lets you choose what you put into your Vim. As a bonus, the result will not be language-specific, allowing you to code in anything. So here is my **top 10 list of plugins which brings IDE features to Vim**.
|
||||
|
||||
### Bonus: Pathogen ###
|
||||
|
||||
First of all, we might not all be familiar with plugins for Vim, and how to install them. This is why the first plugin that I recommend is Pathogen, as it will allow you to install other plugins more easily. That way, if you want to install another plugin for Vim not listed here, you will be able to do so easily. The [official page][3] is really well documented, so go visit it to download and install. From there installing the rest of the plugins will be easy.
|
||||
|
||||
### 1. SuperTab ###
|
||||
|
||||
[![](https://farm6.staticflickr.com/5158/14332189422_34aeb086ed_z.jpg)][4]
|
||||
|
||||
The first thing we get used to in an IDE is auto-completion feature. For that, I like the plugin [SuperTab][5] which comes in quite handy, giving "super powers" to the tabulation key.
|
||||
|
||||
### 2. Syntastic ###
|
||||
|
||||
![](https://farm4.staticflickr.com/3894/14354095583_ce9b112b97_z.jpg)
|
||||
|
||||
If you tend to code in more than one language, it is really easy to confuse the syntax at some point. Hopefully, [syntastic][6] will check it for you, and tell you if should put brackets or parentheses for that conditional, or remind you that you forgot a semi-colon somewhere.
|
||||
|
||||
### 3. Auto Pairs ###
|
||||
|
||||
Another thing that drives most of the coders insane: did I write this last parenthesis or not?! Everyone hates counting with your finger all the parentheses you put so far. To deal with that, I use [Auto Pairs][7], which automatically inserts and formats parentheses and brackets.
|
||||
|
||||
### 4. NERD Commenter ###
|
||||
|
||||
Then if you are looking for a quick shortcut to comment code, regardless of the programming language, you can turn to [NERD Commenter][8]. Even if you are not a programmer, I really really recommend this plugin as it just so efficient while commenting bash scripts or anything in your system.
|
||||
|
||||
### 5. Snipmate ###
|
||||
|
||||
Any programmer knows that a good coders codes, but an excellent one reuses. For that, [snipmate][9] will easily insert code snippets into your file and greatly reduce your typing. It comes by default with a lot of snippets for various languages, but you can also easily add yours to the list.
|
||||
|
||||
### 6. NERDTree ###
|
||||
|
||||
![](https://farm4.staticflickr.com/3899/14332189462_d66b71cf7c_z.jpg)
|
||||
|
||||
To manage a big project, it is always a good idea to split the code into different files. Just basic good coding practices. And to keep all this files in mind, [NERDTree][10] is a nice file browser to use straight from Vim.
|
||||
|
||||
### 7. MiniBufferExplorer ###
|
||||
|
||||
![](https://farm4.staticflickr.com/3904/14332189492_209a3ee2dc_z.jpg)
|
||||
|
||||
To complement a file explorer, there is nothing better than a good buffer manager to have more than one file open at any time. [MiniBufferExplorer][11] does the job well and efficiently. It even sets different colors for your buffers as well as easy shortcuts to switch the focus.
|
||||
|
||||
### 8. Tag List ###
|
||||
|
||||
![](https://farm4.staticflickr.com/3889/14147244138_c04731826a_z.jpg)
|
||||
|
||||
When you have more than one file open at any given time, it is easy to forget what you put in them. To prevent that, [Tag List][12] is a code visualizer that will display the different variables and functions written in a nice compact format.
|
||||
|
||||
### 9. undotree ###
|
||||
|
||||
![](https://farm3.staticflickr.com/2913/14354095453_8bb87a3e31_z.jpg)
|
||||
|
||||
For all of us who like to undo, redo, and undo again some modifications to see how the compilation evolves, [undotree][13] is a nice plugin to see your undo and redo edits in a tree. This kind of functionality is clearly not limited to code, so this is a plugin that I like a lot.
|
||||
|
||||
### 10. gdbmgr ###
|
||||
|
||||
Finally, last but not least, anyone needs a good debugger at some point. If you like gdb, then [gdbmgr][14] is for you as it integrates the famous debugger to Vim.
|
||||
|
||||
To conclude, whether you are an insane coder or not, it is always handy to have a few extra functions of Vim at hand at any time. Like I said in the introduction, you do not have to install all these plugins if you do not need them, or you might want to install different ones. But this is definitely a solid basis.
|
||||
|
||||
What plugins do you use for Vim? Or how would you complement this top 10? Please let us know in the comments.
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/06/turn-vim-full-fledged-ide.html
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.vim.org/scripts/script.php?script_id=213
|
||||
[2]:http://eclim.org/
|
||||
[3]:https://github.com/tpope/vim-pathogen
|
||||
[4]:https://www.flickr.com/photos/xmodulo/14332189422/
|
||||
[5]:https://github.com/ervandew/supertab
|
||||
[6]:https://github.com/scrooloose/syntastic
|
||||
[7]:https://github.com/jiangmiao/auto-pairs
|
||||
[8]:https://github.com/scrooloose/nerdcommenter
|
||||
[9]:https://github.com/garbas/vim-snipmate
|
||||
[10]:https://github.com/scrooloose/nerdtree
|
||||
[11]:http://www.vim.org/scripts/script.php?script_id=159
|
||||
[12]:http://www.vim.org/scripts/script.php?script_id=273
|
||||
[13]:https://github.com/mbbill/undotree
|
||||
[14]:http://vim.sourceforge.net/scripts/script.php?script_id=4104
|
@ -0,0 +1,88 @@
|
||||
CNprober 翻译完成.travelwithheart@yeah.net, 619913541
|
||||
|
||||
如何将Vim打造成一个成熟的IDE
|
||||
================================================================================
|
||||
|
||||
如果你稍微写一点代码,就能知道“集成开发环境”(IDE)是多么的便利。不管是Java、C还是Python,当IDE会帮你检查语法、后台编译,或者自动导入你需要的库时,写代码就变得容易许多。另外,如果你工作在Linux上,你也会知道Vim在进行文本编辑的时候是多么的方便。所以,你可能会想从Vim中也获取这些IDE特性。
|
||||
|
||||
事实上,很少有方法可以帮你做到。有些人可能会想到试着把Vim打造成C语言IDE的 [c.vim][1], 或者把Vim集成到Eclipse里的 [Eclim][2] 。但是我想要告诉你的是一个更加通用的,只用插件实现的方案。你肯定不想因为安装了太多的面板和特性而让你的编辑器变得臃肿不堪。只用插件实现的方案可以让你只选择那些你想要集成到Vim的特性。这样做的额外的一个好处是,这个IDE不是专门针对某一种语言的,可以让你写任何类型的代码。下面就来看一下我的 **把IDE特性带进Vim的前10款插件** 吧。
|
||||
|
||||
### 先来个福利: Pathogen ###
|
||||
|
||||
首先,可能不是所有人都熟悉Vim的插件,也不知道怎么安装这些插件。所以,我推荐的第一个插件就是[Pathogen][3],因为这个插件会让你更容易安装其他插件。如果你要安装另外的没有在这里列出来的插件,用Pathogen会变得非常简单。[官方页面][3]文档写的非常好,去下载安装一个吧。接下来插件的安装也会变得容易很多。
|
||||
|
||||
### 1. SuperTab ###
|
||||
|
||||
[![](https://farm6.staticflickr.com/5158/14332189422_34aeb086ed_z.jpg)][4]
|
||||
|
||||
我们习惯于IDE的第一件事就是它的自动补全功能。所以,我习惯这个非常方便的,给了Tab键“超能力”的 [SuperTab][5] 插件。
|
||||
|
||||
### 2. Syntastic ###
|
||||
|
||||
![](https://farm4.staticflickr.com/3894/14354095583_ce9b112b97_z.jpg)
|
||||
|
||||
如果你需要使用超过一种语言进行编码,有时候是非常容易混淆不同语言之间的语法的。幸运的是,[syntastic][6] 会帮你检查,然后告诉你是否应该加上圆括号或者方括号,或者告诉你在某个地方,你忘了一个分号。
|
||||
|
||||
### 3. Auto Pairs ###
|
||||
|
||||
另外一件让程序员们抓狂的事是:我是不是少加了最后一个括号?!每个人都讨厌用手指去数那些隔的非常远的括号。为了处理这个问题,我用 [Auto Pairs][7] 插件,这个插件会自动插入和格式化方括号和圆括号。
|
||||
|
||||
### 4. NERD Commenter ###
|
||||
|
||||
如果你在找一个可以支持多种程序语言的注释代码的快捷键,你可以试试 [NERD Commenter][8]。即使你不是程序员,我也非常非常推荐这款插件,因为它会让你在注释bash 脚本或者其他任何东西的时候都会变得非常高效。
|
||||
|
||||
### 5. Snipmate ###
|
||||
|
||||
任何一个程序员都知道,好的coder写代码,杰出的coder重用代码。[snipmate][9] 可以容易的插入代码片段到你的文件里面,大大的减少了你敲键盘的次数。它默认的有很多各种语言的代码片段,你也可以非常容易的添加你自己。
|
||||
|
||||
### 6. NERDTree ###
|
||||
|
||||
![](https://farm4.staticflickr.com/3899/14332189462_d66b71cf7c_z.jpg)
|
||||
|
||||
管理一个大的项目时,把代码分散到不同的文件里面是非常好的主意。也是一个基本的编码原则。[NERDTree][10] 是一个不错的可以直接在Vim里使用的文件浏览器,它可以让你随时想到所有的文件。
|
||||
|
||||
### 7. MiniBufferExplorer ###
|
||||
|
||||
![](https://farm4.staticflickr.com/3904/14332189492_209a3ee2dc_z.jpg)
|
||||
|
||||
为了打造一个文件浏览器,支持同时打开多个文件,没有什么比一个好的缓冲区管理器更重要了。[MiniBufferExplorer][11] 就可以非常漂亮和高效地完成这个工作。它甚至为你的缓冲区设置了不同的颜色和切换快捷键。
|
||||
### 8. Tag List ###
|
||||
|
||||
![](https://farm4.staticflickr.com/3889/14147244138_c04731826a_z.jpg)
|
||||
|
||||
当你同时有多个文件打开时,很容易忘了你都在这些文件里添加了什么。为了防止你忘记,[Tag List][12] 这个代码查看器将会用一种漂亮简洁的格式展示不同的变量和函数。
|
||||
### 9. undotree ###
|
||||
|
||||
![](https://farm3.staticflickr.com/2913/14354095453_8bb87a3e31_z.jpg)
|
||||
|
||||
对于我们之中那些喜欢undo,redo然后又undo某些更改,然后依据这些来查看整个编辑完成过程的人来说, [undotree][13] 是一个不错插件,可以以一棵树的形式看到你的undo和redo历史。这个功能跟代码完全没有关系,所以这是我非常喜欢的一个插件。
|
||||
### 10. gdbmgr ###
|
||||
|
||||
最后,但并非不重要的是,每个人都在某时刻需要一个调试器。如果你喜欢gdb,那么[gbdmgr][14]就是为你准备的,因为它集成了那个著名的调试器到Vim中。
|
||||
|
||||
总结一下,不管你是不是一个疯狂的coder,能有一些额外的Vim功能在手总是非常方便的。像我在简介里说到的,如果你不需要,你不用安装这里所有的这些插件。或者你想要安装另外的也行,这些其实只是一个基础入门级的插件。
|
||||
|
||||
你在用Vim的什么插件?或者你想完善这个前10列表么?请在评论里告诉我们吧。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://xmodulo.com/2014/06/turn-vim-full-fledged-ide.html
|
||||
|
||||
译者:[love_daisy_love](https://github.com/CNprober) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.vim.org/scripts/script.php?script_id=213
|
||||
[2]:http://eclim.org/
|
||||
[3]:https://github.com/tpope/vim-pathogen
|
||||
[4]:https://www.flickr.com/photos/xmodulo/14332189422/
|
||||
[5]:https://github.com/ervandew/supertab
|
||||
[6]:https://github.com/scrooloose/syntastic
|
||||
[7]:https://github.com/jiangmiao/auto-pairs
|
||||
[8]:https://github.com/scrooloose/nerdcommenter
|
||||
[9]:https://github.com/garbas/vim-snipmate
|
||||
[10]:https://github.com/scrooloose/nerdtree
|
||||
[11]:http://www.vim.org/scripts/script.php?script_id=159
|
||||
[12]:http://www.vim.org/scripts/script.php?script_id=273
|
||||
[13]:https://github.com/mbbill/undotree
|
||||
[14]:http://vim.sourceforge.net/scripts/script.php?script_id=4104
|
Loading…
Reference in New Issue
Block a user