Vim-ide,

Source: Internet
Author: User

Vim-ide,

Use vim to create your own editor

1. vimrc is the vim configuration file, which can be modified in two locations

1. etc/vim/vimrc // the general configuration files are suffixed with rc

2 .~ /. Vimrc // exists in the user directory,/home/User Name

~ /. High vimrc priority

Enter etc/vim/vimrc

 

Vimrc configuration http://www.cnblogs.com/wangj08/archive/2013/03/13/2957309.html

 

Ii. vim -- v view your vim version and download the corresponding vim-ide Software Package

1. tar zxvf vim-ide.tar.gz-C ~ /// Decompress the package;

2. decompress the package to the current user directory to obtain the. vim hidden file.

3. Copy vimrc to your current configuration file.

Ln-s. vim/vimrc. vimrc

4. Copy. vim/. ycm_extra_conf.py to the user directory.

Cp ~ /. Vim/. ycm_extra_conf.py ~ /

// Note: the tags file records the location where each function is installed.

 

Iii. vim-ide shortcuts

, Dd generates function description at the beginning of the Function

, Da generates file description at the beginning of the file

, Dl generation adopts the publishing Protocol

, Jd jumps to the location of the function definition or header file

, F jumps between the header file and the source file and creates the header file with the corresponding name.

, Ta open the function list, in the right side

, O close the multi-window sill and only save the current window

, Bf displays the list of opened files

, Nn to open or close the file list

, Nl highlight after canceling the search

Backspace close tab buffer

, Tab move in tab

C-t create a new tab

: Ta fun jump to the specified Function Definition

V selected Function

, Zc collapse the current function

, Zr open the current function

, 8. Generate the tags file in the current directory

C-] Jump to the function definition and use Ctags

C-o return

 

Iv. Example

Note: For example, parentheses are paired. Press the esc key to enter the insert mode for the insert operation.

Run the program after editing

Gcc test. c-o test;

 

5. gcc

GCC only means gnu c Compiler. After so many years of development, GCC not only supports the C language, but also supports the Ada Language, C ++ language, Java language, Objective C language, Pascal Language, and COBOL language, and Mercury languages that support functional and logical programming. GCC doesn't just mean the gnu c Compiler, But it turns into the GNU Compiler Collection, which is also the meaning of the GNU Compiler family. On the other hand, speaking of GCC's support for operating system platforms and hardware platforms, it is simply a word: ubiquitous.

gcc test.c -o test

In essence, the above Compilation process is divided into four stages: Preprocessing (also called Preprocessing), Compilation, Assembly, and Linking ).

Gcc options
Man gcc view more options
Gcc [options] [filename]
-X language
-C only compiles and assembles files without linking them.
-S only compiles files without compilation or linking
-E: Only preprocessing files
-O [file] file2
-Lname (lower-case L) is used to specify the library file used:-lm uses libm. a (m is the library name)

-Idirname: add the directory specified by dirname to the program header file directory list.

Example: gcc foo. c-I/home/include-o foo
-Ldirname: add the directory specified by dirname to the directory list of the library file.

Example: gcc foo. c-L/home/lib-lfoo-o foo

-Static Link (add the library content to the program to form a complete executable program)
-W forbidden to generate warning information
-Wall: displays additional warning information

-Dmacro defines MACRO macros, which is equivalent to # define MACRO used in programs

For example, gcc-DDEBUG hello. c-o hello

Gcc-DNUM = 2 hello. c-o hello

-Strict requirements for pedantic to comply with ANSI standards
-G: Add debugging information
-P: information required to generate a prof
-Pg generates information used by gpof
-O (-O1) Optimizes the compiled code
-O2 is optimized at a higher level than-O
-O3 provides higher-level optimization
-V view gcc version information

-M *** optimized based on different Microprocessor

-I specifies the header file directory. Note that-I and there are no spaces before, <> and ""

-G indicates the debugging information. Which gdb list can be used for single-step debugging?

-On n = 0 ~ 3. Compilation optimization. The greater n, the better the optimization.

-Wall prompts more warning information

-D defines macros during compilation. Note that there is no space between-D and-D (it can be used to specify a macro in the compilation phase and then used in the Program)

-E: generate a preprocessing file.

-M generates the dependency between the. c file and the header file for Makefile, including the header file of the system library

-The dependency between the. c file and the header file generated by MM is used for Makefile, excluding the header file of the system library.

6. toolchain

Binutils is a group of programs used for compilation, linking, assembly, and other debugging purposes, including ar, as, ld, nm, objcopy, objdump, etc.

Https://linux.cn/lfs/LFS-BOOK-7.7-systemd/chapter06/binutils.html

Installed program:Addr2line, ar, as, c ++ filt, elfedit, gprof, ld, ld. bfd, nm, objcopy, objdump, ranlib, readelf, size, strings, and strip Installed Library:Libbfd. {a, so} And libopcodes. {a, so} Installation directory:Brief Introduction to/usr/lib/ldscripts

Addr2line

The Conversion Program address is the file name and line number. Given an address and executable file name, it uses debugging information in the executable file to determine the source file and line number associated with the address.

Ar

Create, modify, and extract archive files.

As

AGccThe output is compiled into the assembler of the target file.

C ++ filt

The linker is used to filter C ++ and Java symbols and prevent overload function conflicts.

Elfedit

Update the ELF File Header of the ELF File

Gprof

Show call relationship diagram configuration data

Ld

A Linker that combines multiple target and archive files into a single file, relocates data, and binds symbol references.

Ld. bfd

ToLd.

Nm

List symbols in a specified target file

Objcopy

Convert a type of target file to another type

Objdump

Displays the information of a given target file. You can use options to control the display of specific information. The displayed information is very useful for programmers who use compilation tools. Machine code, assembly code, and c code

Objdump-dSsx a. out> file

Ranlib

Generate an index for the content of the archive file and save it to the archive file. The index lists all archive file members-the symbols defined in the target file that can be relocated.

Readelf

Displays information about binary files of the ELF type.

Size

Lists the size and total size of each part of the target file.

Strings

For each given file, the output is a printable character sequence of no lower than the specified length (4 by default). For the target file, it only prints the strings of the initialization and boot parts by default, scan the entire file for other types of files.

Strip

Remove symbols from the target file

libbfd

Binary File description Library

libopcodes

A library used to process the "readable text" version of the opcode-processor command; used to build a library similarObjdumpTool

 

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.