PageRenderTime 60ms CodeModel.GetById 37ms RepoModel.GetById 0ms app.codeStats 0ms

/.vim/ftplugin/c/c.xpt.vim

https://bitbucket.org/tigrus/vim
Vim Script | 110 lines | 75 code | 34 blank | 1 comment | 0 complexity | 050a9bf2232d16af0ba15a80397cb952 MD5 | raw file
  1. XPTemplate priority=lang
  2. XPTvar $TRUE 1
  3. XPTvar $FALSE 0
  4. XPTvar $NULL NULL
  5. XPTvar $BRif ' '
  6. XPTvar $BRloop ' '
  7. XPTvar $BRstc ' '
  8. XPTvar $BRfun \n
  9. XPTvar $VOID_LINE /* void */;
  10. XPTvar $CURSOR_PH /* cursor */
  11. XPTinclude
  12. \ _common/common
  13. XPTvar $CL /*
  14. XPTvar $CM *
  15. XPTvar $CR */
  16. XPTinclude
  17. \ _comment/doubleSign
  18. XPTinclude
  19. \ _condition/c.like
  20. \ _func/c.like
  21. \ _loops/c.while.like
  22. \ _preprocessor/c.like
  23. \ _structures/c.like
  24. \ _printf/c.like
  25. XPTinclude
  26. \ _loops/for
  27. let s:f = g:XPTfuncs()
  28. XPT _printfElts hidden
  29. XSET elts|pre=Echo('')
  30. XSET elts=c_printf_elts( R( 'pattern' ), ',' )
  31. "`pattern^"`elts^
  32. XPT printf " printf\(...)
  33. printf(`$SPop^`:_printfElts:^`$SPop^)
  34. XPT sprintf " sprintf\(...)
  35. sprintf(`$SPop^`str^,`$SPop^`:_printfElts:^`$SPop^)
  36. XPT snprintf " snprintf\(...)
  37. snprintf(`$SPop^`str^,`$SPop^`size^,`$SPop^`:_printfElts:^`$SPop^)
  38. XPT fprintf " fprintf\(...)
  39. fprintf(`$SPop^`stream^,`$SPop^`:_printfElts:^`$SPop^)
  40. XPT memcpy " memcpy (..., ..., sizeof (...) ... )
  41. memcpy( `dest^, `source^, sizeof(`type^int^) * `count^ )
  42. XPT memset " memset (..., ..., sizeof (...) ... )
  43. memset( `buffer^, `what^0^, sizeof( `type^int^ ) * `count^ )
  44. XPT malloc " malloc ( ... );
  45. (`type^int^*)malloc( sizeof( `type^ ) * `count^ )
  46. XPT assert " assert (.., msg)
  47. assert(`$SPop^`isTrue^,`$SPop^"`text^"`$SPop^)
  48. XPT fcomment
  49. /**
  50. * @author : `$author^ | `$email^
  51. * @description
  52. * `cursor^
  53. * @return {`int^} `desc^
  54. */
  55. XPT para syn=comment " comment parameter
  56. @param {`Object^} `name^ `desc^
  57. XPT filehead
  58. XSET cursor|pre=CURSOR
  59. /**-------------------------/// `sum^ \\\---------------------------
  60. *
  61. * <b>`function^</b>
  62. * @version : `1.0^
  63. * @since : `strftime("%Y %b %d")^
  64. *
  65. * @description :
  66. * `cursor^
  67. * @usage :
  68. *
  69. * @author : `$author^ | `$email^
  70. * @copyright `.com.cn^
  71. * @TODO :
  72. *
  73. *--------------------------\\\ `sum^ ///---------------------------*/
  74. ..XPT
  75. XPT call wraponly=param " ..( .. )
  76. `name^(`$SPop^`param^`$SPop^)