사용자 도구

사이트 도구


raylib:install:vim_syntax_for_raylib_cpp
vim syntax for raylib cpp

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

다음 판
이전 판
raylib:install:vim_syntax_for_raylib_cpp [2025/12/25 21:44] – 만듦 이거니맨raylib:install:vim_syntax_for_raylib_cpp [2025/12/25 22:13] (현재) 이거니맨
줄 1: 줄 1:
 ===== Introduction =====  ===== Introduction ===== 
  
-This is Vim Syntax highlighting setting for Raylib. in C++ Developement. +This is Vim Syntax highlighting setting for [[https://github.com/raysan5/raylib|Raylib]]. in C++ Developement. 
  
  
 ===== Setting File =====  ===== Setting File ===== 
  
 +==== 1. Make File ==== 
  
 Your Custom Syntax File is Located at [~/.vim/after/syntax]  Your Custom Syntax File is Located at [~/.vim/after/syntax] 
줄 12: 줄 13:
  
  
-For Linux, This command will make cpp.vim +For Linux, This command will make cpp.vim  
  
 <code bash>  <code bash> 
 mkdir -p ~/.vim/after/syntax  mkdir -p ~/.vim/after/syntax 
-touch ~/.vim/after/syntax/cpp.vim((This is optional. Cause we command 'vim cpp.vim', then cpp.vim file is created))+cd ~/.vim/after/syntax  
 +touch ~/.vim/after/syntax/cpp.vim
 </code>  </code> 
  
-and we will Edit "cpp.vim" file. +Well, 'touch' command is unnessary. (or optional). Cause if we command 'vim cpp.vim', then cpp.vim file is created.  
 + 
 +Now, we will Edit "cpp.vim" file.  
 + 
 +==== 2. Edit File ====  
  
 For Visual Studio Code,  For Visual Studio Code, 
 <code bash> <code bash>
-code cpp.vim +code cpp.vim   
 +# code ~/.vim/after/syntax/cpp.vim
 </code> </code>
  
줄 29: 줄 37:
  
 <code vash> <code vash>
-vim cpp.vim +vim cpp.vim 
 +# vim ~/.vim/after/syntax/cpp.vim
 </code>  </code> 
  
 +===== Create Custom cpp.vim ===== 
 +
 +==== 1. cpp.vim ==== 
 +
 +This is my custom cpp.vim File For Raylib. 
 +
 +
 +<file vim "cpp.vim"> 
 +" Vim syntax file
 +" Language: C++  
 +" Specific Library : Raylib (https://github.com/raysan5/raylib)
 +" Author : Dongkun Lee (https://lawwiki.kr/doku.php/start)
 +" First Created at : 2025. 12. 25. (Christmas!!)
 +" ver 1.0 
 +
 +syn keyword raylibWindow InitWindow CloseWindow SetWindowState ClearWindowState ToggleFullscreen ToggleBorderlessWindowed  
 +syn keyword raylibWindow    GetScreenWidth GetScreenHeight GetRenderWidth GetRenderHeight GetMonitorCount GetCurrentMonitor 
 +syn keyword raylibDrawing BeginDrawing EndDrawing ClearBackground BeginMode2D EndMode2D BeginMode3D EndMode3D BeginTextureMode EndTextureMode 
 +syn keyword raylibConstant WindowShouldClose IsWindowReady IsWindowFullscreen IsWindowHidden
 +syn keyword raylibTiming    SetTargetFPS GetFrameTime GetTime GetFPS 
 +syn keyword raylibInput     IsKeyPressed IsKeyPressedRepeat IsKeyDown IsKeyReleased IsKeyUp GetKeyPressed GetCharPressed SetExitKey 
 +syn keyword raylibInput     IsMouseButtonPressed IsMouseButtonDown IsMouseButtonReleased IsMouseButtonUp GetMouseX GetMouseY GetMousePosition GetMouseDelta
 +
 +syn keyword raylibShape     DrawPixel DrawPixelV DrawLine DrawLineV DrawLineEx DrawCircle DrawRectangle DrawRectangleV DrawRectangleRec
 +syn keyword raylibShape     DrawFPS DrawText DrawTextEx DrawTextPro LoadFont LoadFontEx UnloadFont LoadUTF8 UnloadUTF8 
 +
 +
 +hi raylibWindow ctermfg=White ctermbg=Black cterm=NONE
 +hi raylibDrawing ctermfg=DarkCyan 
 +hi raylibConstant ctermfg=Magenta ctermbg=Black
 +hi raylibTiming ctermfg=White ctermbg=darkYellow
 +hi raylibInput ctermfg=DarkGreen ctermbg=Black
 +hi raylibShape ctermfg=DarkGreen 
 +</file> 
 +
 +==== 2. Keyword ==== 
 +
 +We can set VIM syntax keyword by this command 
 +
 +<code vim>
 +syn keyword (TITLE)  [keyword1, keyword2, .....]
 +</code> 
 +
 +You can find [[https://github.com/raysan5/raylib|Raylib]] keyword at [[https://www.raylib.com/cheatsheet/cheatsheet.html|Raylib CheatShet]]. 
 +
 +==== 3. color ==== 
 +
 +Color setting is like this 
 +
 +<code vim>
 +hi (TITLE)  ctermfg=(COLOR) ctermbg=(COLOR) cterm=(NONE/BOLD) 
 +</code> 
 +
 +
 +cterm : NONE / BOLD 
 +COLOR : You can find VIM Color constant at [[https://vi.stackexchange.com/questions/22635/ctermbg-and-ctermfg-are-backwards-or-incorrect-for-certain-highlighting-groups|this page.]]  
 +
 +
 +===== Conclusion ===== 
 +
 +Now we get an brillant Raylib Syntax Highlight for VIM Editor! 
  
 +{{:raylib:install:vimsyntaxforraylib.png?600|VIM Syntax for Raylib}}
raylib/install/vim_syntax_for_raylib_cpp.1766666642.txt.gz · 마지막으로 수정됨: 저자 이거니맨