sublime setting - achishis2/achishis2.github.io GitHub Wiki

  1. ubuntu에 ctag, cscope μ„€μΉ˜(vim_ctags_cscope.pdf) >> vi 둜만 μž‘μ—…ν•˜μ‹€ 뢄듀은 ν•΄λ‹ΉνŒŒμΌ κΉŒμ§€λ§Œ λ³΄μ‹œλ©΄ λ©λ‹ˆλ‹€.

  2. sublime text 3 μ„€μΉ˜ > http://www.sublimetext.com/3

2.1 package controll μ„€μΉ˜ > https://packagecontrol.io/installation

2.2 sublime > preference > package control or Ctrl+shift+p package control: install package 클릭

2.3 ctags plugin 검색 & μ„€μΉ˜

2.4 cscope plugin 검색 & μ„€μΉ˜

  1. ctag indexing 방법

3.1 m40 μ†ŒμŠ€ν΄λ” 제일 μƒμœ„λ‘œ μ΄λ™ν•˜μ—¬ μ•„λž˜ μ»€λ§¨λ“œ (본인이 μ›ν•˜λŠ” μ·¨ν–₯에 따라 exclude μΆ”κ°€ κ°€λŠ₯)

ctags --languages=c++ --exclude=.git --exclude=build --exclude=out -R -f .tags
  1. cscope

4.1 μœ„μ™€ λ™μΌν•œ μœ„μΉ˜μ—μ„œ μ•„λž˜μ»€λ§¨λ“œ 톡해 cscope 파일 생성

find . -type f -and \( -name "*.c" -o -name "*.h" -o -name "*.cc" -o -name '*.cpp' -o -name '*.s' -o -name 'S' -o -name 'mm' \) -print > cscope.files

4.2 db 파일 생성

cscope -i cscope.files
  1. sublime text ν”„λ‘œμ νŠΈ 생성

5.1 sublime text μ‹€ν–‰μ‹œν‚¨ μƒνƒœμ—μ„œ μœ„μ—μ„œ μ–˜κΈ°ν•œ μ΅œμƒμœ„ 폴더λ₯Ό drag & drop

5.2 project > save project as ν•˜μ—¬ μ›ν•˜λŠ” μœ„μΉ˜μ— ν”„λ‘œμ νŠΈ 파일 μ €μž₯ (예 : test.sublme-project)

5.3 close project

5.4 File > open file ν•˜μ—¬ 5.2μ—μ„œ λ§Œλ“  ν”„λ‘œμ νŠΈ 파일(test.sublme-project) μ—΄μ–΄μ„œ μ•„λž˜μ™€ 같이 μˆ˜μ •

{
	"folders":
	[
		{
			"follow_symlinks": true,
			"path": "src", // m40 beta의 μ΅œμƒμœ„ ν΄λ”λ‘œ μ§€μ • 
			"file_exclude_patterns": [
				"*.vcproj",
				"*.vcxproj",
				"*.sln",
				"*.gitignore",
				"*.gitmodules",
				"*.vcxproj.*"
			],
			"folder_exclude_patterns": [
				"build",
				"out",
				".git",
				"Debug",
				"Release"
			]
		}
	],
	"settings": {
		"ctags_extra_tag_files": [
			"/home/tk/workspace/ct/beta/m42_2311_t/src/.tags" // 3.1 μ—μ„œ indexingν•œ ctag 파일 경둜둜 μ„€μ •
		]
	}
}

5.5 파일 μ €μž₯ν›„ ν”„λ‘œκ·Έλž¨ μ’…λ£Œ

5.6 Project > Open project 톡해 ν”„λ‘œμ νŠΈ μ˜€ν”ˆ

ν•œλ²ˆ μ…‹μ—…ν•΄λ†“μœΌλ©΄ ν”„λ‘œμ νŠΈ κ΄€λ ¨ν•΄μ„œλŠ” μˆ˜μ •ν•  것이 μ—†κ³  ν˜Ήμ‹œ μ†ŒμŠ€μ½”λ“œκ°€ μΆ”κ°€λ¬κ±°λ‚˜ baseκ°€ λ°”λ€Œμ—ˆμ„ 경우, 3번 & 4번만 command λ₯Ό 톡해 sync 맞좰 μ£Όμ‹œλ©΄ λ©λ‹ˆλ‹€.

  1. μ‚¬μš©λ²•

6.1 preferences > Package Setting > CTags > Key binding - user, Mouse binding - user λ₯Ό 톡해 단좕킀 확인 및 μˆ˜μ • κ°€λŠ₯

6.2 μ†ŒμŠ€ μΈμ‚¬μ΄νŠΈμ™€ λ™μΌν•˜κ²Œ ctrl+마우슀 click 으둜 function μ •μ˜λΆ€λΆ„ μ΄λ™ν•˜κ²Œ ν•˜λ €λ©΄

mouse binding > modifier : ["ctrl", "shift"] λ₯Ό modifier : ["ctrl"]둜 λ³€κ²½

6.1 cscope μ‹€ν–‰ >> ctrl + \

  • look up symbol : 심볼 검색
  • search for text string : λ¬Έμžμ—΄ 검색

6.2 file open >> ctrl + r

6.3 기타 λ“±λ“± μ‚¬μš©λ²•μ€ 메뉴얼 μ°Έμ‘°