Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 802327d

Browse files
.vimrc
1 parent 7278383 commit 802327d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎.vimrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func SetTitle()
139139
call append(line(".")+4, " ************************************************************************/")
140140
call append(line(".")+5, "")
141141
endif
142-
if &filetype == 'cpp'
142+
if expand("%:e") == 'cpp'
143143
call append(line(".")+6, "#include<iostream>")
144144
call append(line(".")+7, "using namespace std;")
145145
call append(line(".")+8, "")
@@ -148,6 +148,11 @@ func SetTitle()
148148
call append(line(".")+6, "#include<stdio.h>")
149149
call append(line(".")+7, "")
150150
endif
151+
if expand("%:e")== 'h'
152+
call append(line(".")+6, "#ifndef _".toupper(expand("%:r"))."_H")
153+
call append(line(".")+7, "#define _".toupper(expand("%:r"))."_H")
154+
call append(line(".")+8, "#endif")
155+
endif
151156
if &filetype == 'java'
152157
call append(line(".")+6,"public class ".expand("%:r"))
153158
call append(line(".")+7,"")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /