@@ -56,7 +56,9 @@ let s:MSWIN = has("win16") || has("win32") || has("win64") || has("win95")
56
56
if s: MSWIN
57
57
"
58
58
let s: escfilename = ' '
59
- let s: plugin_dir = $VIM .' \vimfiles\'
59
+ " Change plugin_dir to remain consistent with .vimrc windows runtime settings
60
+ " let s:plugin_dir = $VIM.'\vimfiles\'
61
+ let s: plugin_dir = $HOME .' \.vim\'
60
62
let s: C_CodeSnippets = s: plugin_dir .' c-support/codesnippets/'
61
63
let s: C_IndentErrorLog = $HOME .' .indent.errorlog'
62
64
let s: installation = ' system'
@@ -133,7 +135,9 @@ let s:C_GlobalTemplateFile = s:plugin_dir.'c-support/templates/Templates'
133
135
let s: C_GlobalTemplateDir = fnamemodify ( s: C_GlobalTemplateFile , " :p:h" ).' /'
134
136
let s: C_LocalTemplateFile = $HOME .' /.vim/c-support/templates/Templates'
135
137
let s: C_LocalTemplateDir = fnamemodify ( s: C_LocalTemplateFile , " :p:h" ).' /'
136
- let s: C_TemplateOverwrittenMsg= ' yes'
138
+ " Message not needed
139
+ " let s:C_TemplateOverwrittenMsg= 'yes'
140
+ let s: C_TemplateOverwrittenMsg= ' no'
137
141
let s: C_Ctrl_j = ' on'
138
142
"
139
143
let s: C_FormatDate = ' %x'
@@ -266,12 +270,12 @@ let s:C_ForTypes = [
266
270
\ ' unsigned int ' ,
267
271
\ ' unsigned long int ' ,
268
272
\ ' unsigned long ' ,
269
- \ ' unsigned short int ' ,
270
- \ ' unsigned short ' ,
271
- \ ' unsigned ' ,
273
+ \ ' unsigned short int ' ,
274
+ \ ' unsigned short ' ,
275
+ \ ' unsigned ' ,
272
276
\ ]
273
277
274
- let s: MsgInsNotAvail = " insertion not available for a fold"
278
+ let s: MsgInsNotAvail = " insertion not available for a fold"
275
279
276
280
" ------------------------------------------------------------------------------
277
281
@@ -2485,7 +2489,7 @@ function! C_Help( type )
2485
2489
endif
2486
2490
setlocal modifiable
2487
2491
"
2488
- if a: type == ' m'
2492
+ if a: type == ' m'
2489
2493
"
2490
2494
" Is there more than one manual ?
2491
2495
"
@@ -2501,7 +2505,7 @@ function! C_Help( type )
2501
2505
" Select manuals where the name exactly matches
2502
2506
"
2503
2507
for line in catalogs
2504
- if line = ~ ' ^' .item.' \s\+('
2508
+ if line = ~ ' ^' .item.' \s\+('
2505
2509
let itempart = split ( line , ' \s\+' )
2506
2510
let catalog = itempart[1 ][1 :-2 ]
2507
2511
if match ( catalog, ' .p$' ) == -1
@@ -2687,7 +2691,7 @@ function! C_ReadTemplates ( templatefile )
2687
2691
" -------------------------------------------------------------------------------
2688
2692
"
2689
2693
let string = matchlist ( line , s: C_TemplateIf )
2690
- if ! empty (string )
2694
+ if ! empty (string )
2691
2695
if ! has_key ( s: C_Template , string [1 ] )
2692
2696
" new s:style
2693
2697
let s: style = string [1 ]
@@ -2793,7 +2797,7 @@ endfunction " ---------- end of function C_StyleList ----------
2793
2797
2794
2798
" ------------------------------------------------------------------------------
2795
2799
" C_OpenFold {{{1
2796
- " Open fold and go to the first or last line of this fold.
2800
+ " Open fold and go to the first or last line of this fold.
2797
2801
" ------------------------------------------------------------------------------
2798
2802
function ! C_OpenFold ( mode )
2799
2803
if foldclosed (" ." ) >= 0
@@ -2825,7 +2829,7 @@ function! C_InsertTemplate ( key, ... )
2825
2829
return
2826
2830
endif
2827
2831
2828
- if &foldenable
2832
+ if &foldenable
2829
2833
let foldmethod_save = &foldmethod
2830
2834
set foldmethod = manual
2831
2835
endif
@@ -3008,7 +3012,7 @@ function! C_InsertTemplate ( key, ... )
3008
3012
" define a pattern to highlight
3009
3013
call C_HighlightJumpTargets ()
3010
3014
3011
- if &foldenable
3015
+ if &foldenable
3012
3016
" restore folding method
3013
3017
exe " set foldmethod=" .foldmethod_save
3014
3018
normal zv
@@ -3034,7 +3038,7 @@ function! C_JumpCtrlJ ()
3034
3038
" remove the target
3035
3039
call setline ( match , substitute ( getline (' .' ), s: C_TemplateJumpTarget1 .' \|' .s: C_TemplateJumpTarget2 , ' ' , ' ' ) )
3036
3040
else
3037
- " try to jump behind parenthesis or strings in the current line
3041
+ " try to jump behind parenthesis or strings in the current line
3038
3042
if match ( getline (" ." )[col (" ." ) - 1 ], " [\] })\" '`]" ) != 0
3039
3043
call search ( " [\] })\" '`]" , ' ' , line (" ." ) )
3040
3044
endif
@@ -3255,7 +3259,7 @@ endfunction " ---------- end of function C_DateAndTime ----------
3255
3259
" check for header or implementation file {{{1
3256
3260
" ------------------------------------------------------------------------------
3257
3261
function ! C_InsertTemplateWrapper ()
3258
- if index ( s: C_SourceCodeExtensionsList , expand (' %:e' ) ) >= 0
3262
+ if index ( s: C_SourceCodeExtensionsList , expand (' %:e' ) ) >= 0
3259
3263
call C_InsertTemplate (" comment.file-description" )
3260
3264
else
3261
3265
call C_InsertTemplate (" comment.file-description-header" )
@@ -3266,18 +3270,18 @@ endfunction " ---------- end of function C_InsertTemplateWrapper ----------
3266
3270
" -------------------------------------------------------------------------------
3267
3271
" Comment : C/C++ File Sections {{{1
3268
3272
" -------------------------------------------------------------------------------
3269
- let s: CFileSection = {
3270
- \ " Header\ File\ Includes" : " file-section-cpp-header-includes" ,
3271
- \ " Local\ Macros" : " file-section-cpp-macros" ,
3272
- \ " Local\ Type\ Def\. " : " file-section-cpp-typedefs" ,
3273
- \ " Local\ Data\ Types" : " file-section-cpp-data-types" ,
3274
- \ " Local\ Variables" : " file-section-cpp-local-variables" ,
3275
- \ " Local\ Prototypes" : " file-section-cpp-prototypes" ,
3276
- \ " Exp\.\ Function\ Def\. " : " file-section-cpp-function-defs-exported" ,
3277
- \ " Local\ Function\ Def\. " : " file-section-cpp-function-defs-local" ,
3278
- \ " Local\ Class\ Def\. " : " file-section-cpp-class-defs" ,
3279
- \ " Exp\.\ Class\ Impl\. " : " file-section-cpp-class-implementations-exported" ,
3280
- \ " Local\ Class\ Impl\. " : " file-section-cpp-class-implementations-local" ,
3273
+ let s: CFileSection = {
3274
+ \ " Header\ File\ Includes" : " file-section-cpp-header-includes" ,
3275
+ \ " Local\ Macros" : " file-section-cpp-macros" ,
3276
+ \ " Local\ Type\ Def\. " : " file-section-cpp-typedefs" ,
3277
+ \ " Local\ Data\ Types" : " file-section-cpp-data-types" ,
3278
+ \ " Local\ Variables" : " file-section-cpp-local-variables" ,
3279
+ \ " Local\ Prototypes" : " file-section-cpp-prototypes" ,
3280
+ \ " Exp\.\ Function\ Def\. " : " file-section-cpp-function-defs-exported" ,
3281
+ \ " Local\ Function\ Def\. " : " file-section-cpp-function-defs-local" ,
3282
+ \ " Local\ Class\ Def\. " : " file-section-cpp-class-defs" ,
3283
+ \ " Exp\.\ Class\ Impl\. " : " file-section-cpp-class-implementations-exported" ,
3284
+ \ " Local\ Class\ Impl\. " : " file-section-cpp-class-implementations-local" ,
3281
3285
\ " All\ sections,\ C" : " c" ,
3282
3286
\ " All\ sections,\ C++" : " cpp" ,
3283
3287
\ }
@@ -3290,7 +3294,7 @@ function! C_CFileSectionListInsert ( arg )
3290
3294
if has_key ( s: CFileSection , a: arg )
3291
3295
if s: CFileSection [a: arg ] == ' c' || s: CFileSection [a: arg ] == ' cpp'
3292
3296
call C_Comment_C_SectionAll ( ' comment.' .s: CFileSection [a: arg ] )
3293
- return
3297
+ return
3294
3298
endif
3295
3299
call C_InsertTemplate ( ' comment.' .s: CFileSection [a: arg ] )
3296
3300
else
@@ -3301,7 +3305,7 @@ endfunction " ---------- end of function C_CFileSectionListInsert ---------
3301
3305
" -------------------------------------------------------------------------------
3302
3306
" Comment : H File Sections {{{1
3303
3307
" -------------------------------------------------------------------------------
3304
- let s: HFileSection = {
3308
+ let s: HFileSection = {
3305
3309
\ " Header\ File\ Includes" : " file-section-hpp-header-includes" ,
3306
3310
\ " Exported\ Macros" : " file-section-hpp-macros" ,
3307
3311
\ " Exported\ Type\ Def\. " : " file-section-hpp-exported-typedefs" ,
@@ -3321,7 +3325,7 @@ function! C_HFileSectionListInsert ( arg )
3321
3325
if has_key ( s: HFileSection , a: arg )
3322
3326
if s: HFileSection [a: arg ] == ' c' || s: HFileSection [a: arg ] == ' cpp'
3323
3327
call C_Comment_C_SectionAll ( ' comment.' .s: HFileSection [a: arg ] )
3324
- return
3328
+ return
3325
3329
endif
3326
3330
call C_InsertTemplate ( ' comment.' .s: HFileSection [a: arg ] )
3327
3331
else
@@ -3332,7 +3336,7 @@ endfunction " ---------- end of function C_HFileSectionListInsert ---------
3332
3336
" -------------------------------------------------------------------------------
3333
3337
" Comment : Keyword Comments {{{1
3334
3338
" -------------------------------------------------------------------------------
3335
- let s: KeywordComment = {
3339
+ let s: KeywordComment = {
3336
3340
\ ' BUG' : ' keyword-bug' ,
3337
3341
\ ' COMPILER' : ' keyword-compiler' ,
3338
3342
\ ' TODO' : ' keyword-todo' ,
@@ -3350,7 +3354,7 @@ function! C_KeywordCommentListInsert ( arg )
3350
3354
if has_key ( s: KeywordComment , a: arg )
3351
3355
if s: KeywordComment [a: arg ] == ' c' || s: KeywordComment [a: arg ] == ' cpp'
3352
3356
call C_Comment_C_SectionAll ( ' comment.' .s: KeywordComment [a: arg ] )
3353
- return
3357
+ return
3354
3358
endif
3355
3359
call C_InsertTemplate ( ' comment.' .s: KeywordComment [a: arg ] )
3356
3360
else
@@ -3361,7 +3365,7 @@ endfunction " ---------- end of function C_KeywordCommentListInsert -------
3361
3365
" -------------------------------------------------------------------------------
3362
3366
" Comment : Special Comments {{{1
3363
3367
" -------------------------------------------------------------------------------
3364
- let s: SpecialComment = {
3368
+ let s: SpecialComment = {
3365
3369
\ ' EMPTY' : ' special-empty' ,
3366
3370
\ ' FALL\ THROUGH' : ' special-fall-through' ,
3367
3371
\ ' IMPL\.\ TYPE\ CONV' : ' special-implicit-type-conversion")' ,
@@ -3381,7 +3385,7 @@ function! C_SpecialCommentListInsert ( arg )
3381
3385
if has_key ( s: SpecialComment , a: arg )
3382
3386
if s: SpecialComment [a: arg ] == ' c' || s: SpecialComment [a: arg ] == ' cpp'
3383
3387
call C_Comment_C_SectionAll ( ' comment.' .s: SpecialComment [a: arg ] )
3384
- return
3388
+ return
3385
3389
endif
3386
3390
call C_InsertTemplate ( ' comment.' .s: SpecialComment [a: arg ] )
3387
3391
else
@@ -3520,7 +3524,7 @@ if has("autocmd")
3520
3524
"
3521
3525
else
3522
3526
" -------------------------------------------------------------------------------
3523
- " template styles are related to file extensions
3527
+ " template styles are related to file extensions
3524
3528
" -------------------------------------------------------------------------------
3525
3529
for [ pattern, stl ] in items ( g: C_Styles )
3526
3530
exe " autocmd BufNewFile,BufRead,BufEnter " .pattern." call C_Style( '" .stl ." ' )"
0 commit comments