Super-Easy VIM configuration

Source: Internet
Author: User

Https://github.com/ma6174/vim-deprecated Easy Installation Method:

Open the terminal and execute the following command to install it automatically:

wget -qO- https://raw.github.com/ma6174/vim/master/setup.sh | sh -x

or manually install it yourself: (in Ubuntu, for example)
    1. install Vim sudo apt-get Install vim
  • Install Ctags:sudo apt-get install ctags
  • Install some prerequisite programs:sudo apt-get install xclip vim-gnome astyle python-setuptools
  • Python Code formatting tool:sudo easy_install -ZU autopep8
  • sudo ln -s /usr/bin/ctags /usr/local/bin/ctags
  • Clone configuration file:cd ~/ && git clone git://github.com/ma6174/vim.git
  • mv ~/vim ~/.vim
  • mv ~/.vim/.vimrc ~/
  • Clone Bundle Program:git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
  • Open vim and Execute bundle program:BundleInstall
  • Re-open Vim to see the effect
Writing a Python program
  1. Auto Insert header information:
    • #!/usr/bin/env python
    • # coding=utf-8
  • Enter . or press TAB key to trigger the code completion function
  • :wCode errors and specifications are checked automatically after the code is saved
  • Press to F6 pep8 optimize code format by format
  • Press F5 to execute code with one click
Multi-window operation
    1. Use :sp + 文件名 to split a window horizontally
    • :vs + filename can split the window vertically
    • use ctrl + W to quickly toggle between Windows
Writing markdown Files
  1. write Markdown file (*.md ), press  MD   can generate the corresponding html File
  • After the build or in normal mode fi , you can use Firefox to open the appropriate html file preview
  • Of course, you can also use the Universal F5 key to convert and open the preview in one click
  • If there is some confusing information on the screen during the opening process, you can press Ctrl + l to restore
Quick Notes
    • Press \ to automatically annotate according to file type
How to use
  1. Press F5 to directly compile and execute C, C + +, Java code, and execute shell scripts, press "F8" to debug C, C + + code
  2. Automatically insert header, new C, C + + source files automatically inserted header: including file name, author, contact, establishment time, etc., the reader can change their own according to the requirements
  3. Map "Ctrl + A" To select All and copy shortcut keys for easy copying of code
  4. Press "F2" to directly eliminate blank lines in the code
  5. "F3" to list the current directory file, open the tree-like file directory
  6. Support mouse selection, direction key movement
  7. Code highlighting, auto indent, display line number, display status line
  8. Press "Ctrl + P" to complete the auto-completion
  9. []、{}、()、""、‘ ‘Automatic completion of all

Super-Easy VIM configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.