====== Vim Tag ====== * [[programming:ctags|ctags]] * [[vim:tagbar|Vim - Tagbar]] * [[vim:fzf|fzf.vim]] 를 통해 tags 생성과 현재 버퍼의 태그간 이동이 가능하다. * ''ctags''를 사용한 소스코드 내비게이션에 관해 정리한다. Vim 에서 소스를 관리하려면 필수적으로 익혀야 한다. ===== tags의 기본 ===== * 일단 ctags 설치 sudo apt-get install universal-ctags ===== vim-gutentags ===== * [[https://bolt80.com/gutentags/|Gutentags]] * [[https://vimawesome.com/plugin/vim-gutentags|vim-gutentags - Vim Awesome]] * https://github.com/ludovicchabant/vim-gutentags * 백그라운드에서 tags 자동 갱신 ===== TagList ===== * http://vim.sourceforge.net/scripts/script.php?script_id=273 * [[vim:tagbar|Vim - Tagbar]]가 더 좋다. * 소스 코드의 메소드 등의 목록을 바로 보고 이동할 수 있다. * " TagList " MS-Windows에서 ctags 경로 설정. 경로상에 공백이 있으면 안됐음. 리눅스의 경우 PATH가 잘 걸려 있으면 안해도 됨. let Tlist_Ctags_Cmd="C:\Programs\ctags554\ctags.exe" " Vim 크기 확장 안함. let Tlist_Inc_Winwidth=0 " 오른쪽에 태그리스트 보여줌 let Tlist_Use_Right_Window=1 nnoremap :TlistToggle nnoremap :w:TlistUpdate * 을 누르면 태그 리스트가 보이거나 숨기거나 한다. * 을 누르면, 변경된 소스파일을 저장하고, 태그 리스트의 데이터를 갱신한다. ===== 기타 플러그인 ===== * [[http://www.vim.org/scripts/script.php?script_id=3114|easytags]] * [[http://www.vim.org/scripts/script.php?script_id=2179|Source Explorer (SrcExpl) : A Source code Explorer for viewing definition(s) and contextual info ]] * [[http://www.vim.org/scripts/script.php?script_id=2018|ttags : Tag list browser (List, filter, preview, jump to tags)]] * [[http://vim.wikia.com/wiki/Auto_tags_by_project.vim|Auto tags by project.vim]] * [[https://github.com/zackhsi/fzf-tags/search?l=vim-script|zackhsi/fzf-tags]] ===== 참조 ===== * [[http://kltp.kldp.net/stories.php?story=02/04/18/8009516&topic=25|개발자를 위한 VIM 활용방법 - tags 활용]] * [[http://www.thegeekstuff.com/2009/04/ctags-taglist-vi-vim-editor-as-sourece-code-browser/|Ctags and Taglist: Convert Vim Editor to Beautiful Source Code Browser for Any Programming Language]] * [[http://vim.wikia.com/wiki/Browsing_programs_with_tags|Browsing Programs with tags]] * [[http://www.viper.pe.kr/cgi-bin/moin.cgi/ctags_%EC%99%80_vi_%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0|ctags와 vi 사용하기]] * [[https://my.yirum.net/universal-ctags-%EC%99%80-tagbar-%EC%84%A4%EC%B9%98/|universal-ctags 와 tagbar 설치 - YIRUM.NET]] * [[http://vim.wikia.com/wiki/Cscope|Cscope]]에 대해서도 정리해 볼 것. * [[https://johngrib.github.io/wiki/ctags/|ctags 명령어 - 기계인간 John Grib]] * [[https://courses.cs.washington.edu/courses/cse451/10au/tutorials/tutorial_ctags.html|Ctags Tutorial]] * [[https://kulkarniamit.github.io/whatwhyhow/howto/use-vim-ctags.html|Use vim with ctags | what-why-how]]