Multi-language programming for essential Ten Vim plugin

Original Address: http: //www.linuxeden.com/a/58769

Use these 10 Vim plugin that allows you to write code or operation and maintenance, I feel better.

I use  Vim  text editor for about 20 years. For some time, I have been custom-configure my Vim, but I will only use plug-ins in the last two years.

Recently, when I re-install the system (as I often do), I think this is a good opportunity, I would like to find the best Vim plugin in a variety of programming language environment, and how each of these plug-ins and languages ​​together.

Sometimes, I will use a specific plug-ins for specific language and configuration (for example, I just installed Rocannon in Ansible configuration), this does not go into detail. But Here's 10 Vim plug-ins are my favorite, regardless of which programming language to use, I almost always use them.

1、Volt

My first choice is not a plug-in, but it can be replaced with similar  Vundle  plug-ins, so in this introduction.

Volt  is not a dependent of Vim Vim plugin manager. You can use it to install the plug-in, and create a portfolio called "profile" plug-ins. You can use a simple command  volt profile set myprofile to enable the new configuration. So that I can do such things as to enable Python configured separately  indentpython  plug. Volt also provides an easy way for each plug-in configuration, these configurations will be shared between the "profile", and therefore only need to install a plug-in, you can use across multiple "profile".

Volt is still relatively new and not perfect (for example, no matter how much you want to use a "profile", each plug-in only one configuration file), but other than that, I found it very easy, fast and simple.

Volt plugin

Volt plugin

2、Vim-Rainbow

In addition to Python, nearly all mainstream programming languages ​​use brackets (parentheses, brackets and braces). Typically, they will use nested pairs of brackets, it is difficult to figure out a bracketed opening and closing zone. I found myself often number in parentheses, especially in complex Bash script to ensure correct.

This time it needs  vim-rainbow  plug! It is a different color is provided for each pair of brackets, it is easy to identify which bracket a pair of brackets. It is very useful and colorful.

vim-rainbow plugin

vim-rainbow plugin

3、lightline

Vim has many of these plug-ins, such as  Powerline , it will display the file you're dealing with in the bottom of the column, file location and file type and other information the cursor. These plug-ins have advantages and disadvantages, after a simple comparison, I chose  LightLine . It is relatively small, easy to install and expanded, and does not depend on other tools or plug-ins.

Lightline plugin

Lightline plugin

4、NERDTree

NERDTree  is a classic plug-ins. For larger projects, it can be hard to find the exact name and path of the file containing the content you want to edit. Use the shortcut keys (I'm using  F7, because I  .vimrc configured this shortcut), the search window will open with a vertical split-screen mode, you can easily find the desired file and open it. For large projects, it is essential plug-ins. For those who often forget file names are useful, like me.

NERDTree vim plugin

NERDTree vim plugin

5, NERD Comment

程序员们在写代码时,有时会遇到一些难以调试的问题,导致他们想要注释或不执行某段代码。这时候就需要 NERD Commenter 出场了。选择代码段,按 Leader 键 + cc,代码就会被注释掉。(标准的 Vim Leader 键 是 / 字符。)按 Leader 键 + cn,取消注释。对于大多数文件类型,NERD Commenter 会自动使用正确的注释符。例如,如果你正在编辑 BIND 区域文件,并将文件类型设置为 BIND 区域文件,Vim 会正确地使用 ;(分号)字符进行注释。

NERD Comment

NERD Commenter

6、Solarized

我喜欢我的 Vim 主题配色。我也喜欢终端的主题色。我一直在 Vim 上使用 Solarized 配色,并且将我的终端、文件夹配色和 Vim 设为一致。

但是,有时我会根据周边环境、屏幕亮度以及是否需要分享投屏,来切换明暗模式。

显然,你可以选择自己喜欢的任何配色方案,但我喜欢 Solarized,因为它有明暗模式功能,它可以简单快捷地切换两种模式。我的第二个选择是 Monokai。Volt 插件管理器让我可以轻松地在两者之间切换,因此我在 Python 编程时,使用 Monokai;Bash 编程时,使用 Solarized。

我没有给 Solarized 找相应的图片,因为本文中的所有其他图片都使用了 Solarized 中的浅色或深色效果,可以确认一下这些图片。

7、fzf

当寻找一个文件时,有时你想要一个文件浏览器,有时你只想在键盘上敲打出与文件名模糊匹配的内容,对吗?

fzf(全称 “模糊查找器”)插件提供了这一功能。打出 :FZF 并输入文件名内容。不断缩短的列表将显示出与你输入的文件名内容相匹配的一些文件。我经常使用它,最近使用它的频率估计比使用 NERDTree 还多。缺点是这个插件依赖于 fzf binary,因此也必须安装这个依赖包。它适用于 Fedora、Debian 和 Arch,据我所知并不在 EPEL 中。

fzf Vim plugin

fzf Vim plugin

8、ack

有时,你需要搜索包含特定行或特定单词的文件。我真的很喜欢使用 ack 插件,最好与 ag 结合使用,它俩的组合又被称为 “silver searcher”。这一组合的速度非常快,覆盖了 grep 或 vimgrep 的绝大多数使用场景。缺点是你需要安装 ack 或 ag 才能正常运行。好消息是 Fedora 和 EPEL7 都可以使用 ag 和 ack

ack vim plugin

ack vim plugin

9、gitgutter

大多数 IT 人员都使用 Git 和 Git 仓库中的文件进行工作。gitgutter 插件在行号附近添加了一列,通过符号显示该行的状态为:已更改(~)、已添加(+)或者已删除(-)。这有利于跟踪你所做的更改,并且可以使你专注于手头的任务,例如编写补丁来修复一个关键错误。

gitgutter vim plugin

gitgutter vim plugin

10、Tag List

If you write code in a large file, it is easy to forget your current location, you may need to scroll down to find a function. Use  Tag List  plugin, just type  :Tlist, will be able to show a vertical split-screen code contains variables, types, classes and functions, you can easily jump to these variables, types, classes and functions. This also works for multiple languages, such as Java, Python, and can use any  ctags file type function.

Tag List vim plugin

Tag List vim plugin

Described above 10 Vim plugin that makes me part-time as a system administrator and programmer's life easier. My favorite is 2456910

A programming font browsing online website: https: //app.programmingfonts.org/

Guess you like

Origin www.cnblogs.com/guochaoxxl/p/12057982.html