Vim C-support code shortcut

Source: Internet
Author: User
Tags vimtag

Address: http://vitaminj.blogbus.com/logs/35851648.html

1. In ~ /. Vim/C-support/templates can be used to set copyright information, such as the author, mailbox, and copyright ownership. C or. the CPP file is visible and lists the locations where the template file is used. You can edit it by yourself.

2. \ If insert a general function

3. \ im insert Main Function

4. \ CFU insert function header, that is, Function Description

5. \ CFR inserts a frame comment, which can be used to write variable description

6. \ P <insert an include and place the cursor in <>

7. \ RC save and compile

8. \ RR run

9. \ Nr can be found in ~ /. Vim/C-support/codesnippetsCodeOr code block. Use this command

---------------------------------------------

C. Vim is a good C/C ++ helper code plug-in.

--------------------- Appendix: Detailed C. Vim hotkey -------------------------

-- Help ---------------------------------------------------------------

\ HM show manual for word under the cursor (n, I)
\ HP show plugin help (n, I)

-- Comments -----------------------------------------------------------

\ Cl end-of-line comment (n, V, I)
\ CJ adjust end-of-line comment (s) (N, V, I)
\ CS set end-of-line comment column (N)
\ C * Code-> comment /* */(N, V)
\ CC code-> comment // (n, V)
\ Co comment-> code (n, V)
\ CFR Frame Comment (n, I)
\ CFU function comment (n, I)
\ CME method description (n, I)
\ CCL class description (n, I)
\ CD date (n, V, I)
\ CT date \ & time (n, V, I)

-- Statements ---------------------------------------------------------

\ SD do {} While (n, V, I)
\ SF for (n, I)
\ SFO {} (N, V, I)
\ Si if (n, I)
\ SIF if {} (N, V, I)
\ Sie if else (n, V, I)
\ SIFE if {} Else {} (N, V, I)
\ SW while (n, I)
\ SWH while {} (N, V, I)
\ SS switch (n, V, I)
\ SC Case (n, I)
\ S {{} (N, V, I)

-- Preprocessor -------------------------------------------------------

\ P <# Include <> (N, I)
\ P "# include" "(n, I)
\ PD # define (n, I)
\ Pu # UNDEF (n, I)
\ Pie # If # else # endif (n, V, I)
\ Pid # ifdef # else # endif (n, V, I)
\ Pin # ifndef # else # endif (n, V, I)
\ PIND # ifndef # def # endif (n, V, I)
\ Pi0 # If 0 # endif (n, V, I)
\ Pr0 remove # If 0 # endif (n, I)
\ PE # error (n, I)
\ PL # Line (n, I)
\ PP # pragma (n, I)

-- Idioms -------------------------------------------------------------

\ If function (n, V, I)
\ ISF static function (n, V, I)
\ Im main () (N, V, I)
\ I0 for (x = 0; x <n; x + = 1) (N, V, I)
\ In For (x = n-1; x> = 0; X-= 1) (N, V, I)
\ IE Enum + typedef (n, I)
\ Is struct + typedef (n, I)
\ IU Union + typedef (n, I)
\ IP printf () (N, I)
\ ISC scanf () (N, I)
\ Ica p = calloc () (N, I)
\ Ima p = malloc () (N, I)
\ ISI sizeof () (N, V, I)
\ IAS assert () (N, V)
\ II open input file (n, I)
\ Io open output file (n, I)

-- Snippets -----------------------------------------------------------

\ Nr read code snippet (n, I)
\ NW write code snippet (n, V, I)
\ Ne edit code snippet (n, I)
\ NP pick up prototype (n, V, I)
\ Ni insert prototype (s) (N, I)
\ NC clear prototype (s) (N, I)
\ NS show prototype (s) (N, I)
\ NTL edit local templates (n, I)
\ NTG edit global templates (n, I)
\ NTR rebuild templates (n, I)

-- C ++ ----------------------------------------------------------------

\ + CO cout <Endl; (n, I)
\ + C Class (n, I)
\ + CN class (using new) (N, I)
\ + CI class implementation (n, I)
\ + CNI class (using new) Implementation (n, I)
\ + Mi method implementation (n, I)
\ + AI accessor implementation (n, I)

\ + Tc template class (n, I)
\ + TCN template class (using new) (N, I)
\ + TCI template class implementation (n, I)
\ + Tcni template class (using new) impl. (n, I)
\ + TMI template method implementation (n, I)
\ + Tai template accessor implementation (n, I)

\ + TF template function (n, I)
\ + EC error class (n, I)
\ + Tr try... catch (n, V, I)
\ + Ca catch (n, V, I)
\ + C. Catch (...) (N, V, I)

-- Run ----------------------------------------------------------------

\ RC save and compile (n, I)
\ RL Link (n, I)
\ RR run (n, I)
\ RA set Comand line arguments (n, I)
\ RM run make (n, I)
\ RG cmd. Line Arg. For make (n, I)
\ RP run splint (n, I)
\ Ri cmd. Line Arg. For splint (n, I)
\ Rk run codecheck (TM) (N, I)
\ Re cmd. Line Arg. For codecheck (TM) (N, I)
\ RD run indent (n, V, I)
\ RH hardcopy buffer (n, V, I)
\ Rs show plugin settings (n, I)
\ RX set xterm size (n, Only Linux/Unix & GUI)
\ Ro change output destination (n, I)

End

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.