Vim as IDE
来源:互联网 发布:二手车置换划算吗 知乎 编辑:程序博客网 时间:2024/05/14 18:35
Reblogged from: http://yannesposito.com/Scratch/en/blog/Vim-as-IDE/
This short article is about how the author use Vim as an IDE. Mainly by using some great plugins.
1. Vim Plugin Manager
There are a lot of Vim plugins. To manage them I use vim-plug
.
To install it:
☞ Note I have two parts in my .vimrc
. The first part contains the list of all my plugins. The second part contains the personal preferences I setted for each plugin. I’ll separate each part by ...
in the code.
2. Survival
2.1 Colorscheme
Before anything, you should protect your eyes using a readable and low contrast colorscheme.
For this I use solarized dark. To add it, you only have to write this in your ~/.vimrc
file:
2.2 Minimal hygiene
You should be able to see and destroy trailing whitespaces.
You can clean trailing whitespace with :FixWhitespace
.
And also you should see your 80th column.
3. File Management
One of the most important hidden skills in programming is the ability to search and find files in your projects.
The majority of people use something like NERDTree
. This is the classical left column with a tree of files of your project. I stopped to use this. And you should probably too.
I switched to unite. No left column lost. Faster to find files. Mainly it works like Spotlight on OS X.
First install ag
(the silver search). If you don’t know ack
or ag
your life is going to be upgraded. This is a simple but essential tool. It is mostly a grep
on steroids.
Now type space twice. A list of files appears. Start to type some letters of the file you are searching for. Select it, type return and bingo the file opens in a new horizontal split.
If something goes wrong just type <space>r
to reset the unite cache.
Now you are able to search file by name easily and efficiently.
Now search text in many files. For this you use ag
:
Don’t forget to add a space after the :Ag
.
These are two of the most powerful shortcut for working in a project. using °
which is nicely positioned on my azerty
keyboard. You should use a key close to *
.
So what °
is doing? It reads the string under the cursor and search for it in all files. Really useful to search where a function is used.
If you type <space>/
followed by a string, it will search for all occurrences of this string in the project files.
So with this you should already be able to navigate between files very easily.
4. Language Agnostic Plugins
4.1 Git
Show which line changed since your last commit.
And the “defacto” git plugin:
You can reset your changes from the latest git commit with :Gread
. You can stage your changes with :Gwrite
.
4.2 Align things
Just select and type Return
then space
. Type Return
many type to change the alignments.
If you want to align the second column, Return
then 2
then space
.
4.3 Basic auto completion: C-n
& C-p
Vim has a basic auto completion system. The shortcuts are C-n
and C-p
while you are in insert mode. This is generally good enough in most cases. For example when I open a file not in my configured languages.
- vim as a IDE
- vim as php ide
- VIM as Python IDE
- Vim as IDE
- vim as python IDE
- Vim As IDE
- [vim as ide]配置方法
- Vim as Python IDE on windows
- Vim as Python IDE on windows
- Turning vim as a modern python IDE
- Python -- Make vim as a python IDE
- Make Vim as Your Bash-IDE Using bash-support Plugin
- Vim as Python IDE on windows(转)
- Vim as Python IDE on windows(用VIM打造一个Python编程环境)
- Tutorial: Make Vim as Your C/C++ IDE Using c.vim Plugin
- Make Vim as Your Perl IDE Using perl-support.vim Plugin
- Tutorial: Make Vim as Your C/C++ IDE Using c.vim Plugin
- Tutorial: Make Vim as Your C/C++ IDE Using c.vim Plugin
- 英特尔成为了对Linux贡献最大的公司
- cf Round #292 (Div. 2)D. Drazil and Tiles 构造
- 安卓学习之数据存储之以文件方式存储
- 《Linus Torvalds自传》摘录
- C# WinForm中的SuspendLayout、ResumeLayout、PerformLayou
- Vim as IDE
- Leetcode NO.47 Permutations II
- Queue Team
- What Are Stakeholders – How To Identify Them?
- 在ASP.NET应用程序里执行定时器(Timer),运行于服务器端
- Java动态代理
- asp.net ajax updatepanel控件使用(网页自动部分更新)
- 局部刷新
- Restoring Numbers - CodeForces 509 D