내용으로 건너뛰기
사용자 도구
로그인
사이트 도구
도구
문서 보기
이전 판
백링크
최근 바뀜
미디어 관리
사이트맵
로그인
최근 바뀜
미디어 관리
사이트맵
기술자료
작업공간
개인공간
사이트맵
추적:
kb:scite
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== Scite ====== * A free source code editor for Win32 and X * GTK 기반의 Scintilla라는 텍스트 편집 컴포넌트를 이용해 만들어진 텍스트 편집기다. * UltraEdit이 펄, 파이썬 문법을 제대로 지원하지 않아 다른 에디터를 찾다가 알게 되었다. 물론 [VIM] 같은 경우, 이들 문법을 완벽히 지원하지만 탭 컨트롤이 없기 때문에 여러 파일을 동시에 편집할 때 불편했다. * 딱히 설치 프로그램이 없기 때문에 윈도우즈에서 사용할 때는 확장자 문제가 좀 귀찮다. (윈도우즈 인스톨러가 따로 있기는 있는 모양이다.) * [[Scite]] 하나만으로는 모든 텍스트 작업을 편하게 하기는 어려울 듯 하다. 묘하게 불편한 점이 몇가지 있다. 개인적으로는 파이썬/Lua 작업할 때만 쓰고 있다. [[Eclipse]] 에디터도 괜찮지만, 뭔가 배울 게 많아서 좌절 중. OTL * [[Lua]] VM이 내장되어 있다. 덕분에 어느 정도의 프로그래밍이 가능하다. ====== 참고 ====== ===== 선택한 라인 정렬하기 ===== <code lua> function split_lines(str) local t = {n = 0} local function helper(line) if string.len(line) > 0 then table.insert(t, line) end end helper((string.gsub(str, "(.-)\r?\n", helper))) return t end function sort_selected_lines() local buf = {} local sel = editor:GetSelText() buf = split_lines(sel) table.sort(buf) out = table.concat(buf, "\n") editor:ReplaceSel(out .. "\n") end </code> <code> command.name.2.*=Sort Selected Lines command.mode.2.*=subsystem:lua,savebefore:no,groupundo command.shortcut.2.*=Ctrl+4 command.2.*=sort_selected_lines </code> ===== 단어 전체 선택하기 ===== [[http://lua-users.org/wiki/SciteWordSelect]] 페이지에 기본적인 기능이 있기는 하나, 한글 처리가 안 되는 관계로 좀 수정해줘야한다. SciTEGlobal.properties 파일을 열어서 아래와 같은 내용을 추가한다. <code> ext.lua.startup.script=$(SciteDefaultHome)\scite.lua command.name.1.*=Select Word command.mode.1.*=subsystem:lua,savebefore:no,groupundo command.shortcut.1.*=Ctrl+W command.1.*=select_word </code> 그 다음 ext.lua.startup.script에 해당하는 루아 파일을 생성한다. 위의 예에서는 "scite 실행 파일이 존재하는 디렉토리\scite.lua" 파일이다. 그 파일 안에다 다음과 같은 내용을 집어넣는다. <code lua> WORD_SEPERATORS = { [32] = true, -- (sp) [33] = true, -- ! [34] = true, -- " [35] = true, -- # [36] = true, -- $ [37] = true, -- % [38] = true, -- & [39] = true, -- ' [40] = true, -- ( [41] = true, -- ) [42] = true, -- * [43] = true, -- + [44] = true, -- , [45] = true, -- - [46] = true, -- . [47] = true, -- / [60] = true, -- < [61] = true, -- = [62] = true, -- > [63] = true, -- ? [64] = true, -- @ [91] = true, -- [ [92] = true, -- \ [93] = true, -- ] [94] = true, -- ^ [96] = true, -- ` [123] = true, -- { [124] = true, -- | [125] = true, -- } [126] = true -- ~ } function is_word_char(char) if (-1 < char and char < 32) or WORD_SEPERATORS[char] then return false else return true end end function select_word() local begin_pos = editor.CurrentPos local end_pos = begin_pos while is_word_char(editor.CharAt[begin_pos-1]) do begin_pos = begin_pos - 1 end while is_word_char(editor.CharAt[end_pos]) do end_pos = end_pos + 1 end if begin_pos ~= end_pos then editor.SelectionStart = begin_pos editor.SelectionEnd = end_pos end end </code> 보기는 안 좋다만 어쨌든 이것으로 OK. ===== 싱글 인스턴스 ===== 여러 파일을 따로 클릭해서 열 경우, Scite 윈도우가 여러 개 뜨게 되는데, <code>SciTEGlobal.properties</code> 파일을 열어서 check.if.already.open 항목을 1로 해주면, Scite 윈도우가 떠있는 경우, 그 윈도우 내부의 새로운 탭으로 들어가게 된다. ===== 코드페이지 설정 ===== SciTEGlobal.properties 파일을 열어서 code.page 항목을 찾아 값을 949로 해준다. 한글 텍스트를 다른 프로그램에다 붙여넣기할 때 깨지지 않게 해준다. ===== 탭바 활성화 ===== 탭바가 기본적으로 비활성화되어 있기 때문에, 설정 파일에서 tabbar.visible 변수를 1로 해줘야한다. 또한 buffers 변수를 1 이상으로 해줘야한다. buffers 변수 또한 기본적으로 주석 처리 되어있으니 주의. ===== 폭이 일정한 폰트 사용하기 ===== 1.61 이하 버전에서는 전역 설정 파일에다가 "use.monospaced = 1" 항목만 추가하면 되었으나, 1.62 버전으로 올라가면서 해당 항목이 사라지고 다음과 같은 내용을 집어넣어야한다. <code> font.base=font:Courier New,size:10 #font.base=$(font.monospace) font.small=$(font.monospace) font.comment=$(font.monospace) font.text=$(font.monospace) font.text.comment=$(font.monospace) font.embedded.base=$(font.monospace) font.embedded.comment=$(font.monospace) font.vbs=$(font.monospace) </code> ====== 링크 ====== * [[http://www.scintilla.org]] \\ Scintilla 및 Scite 공식 사이트. \\ 루아 인터페이스에 관한 내용은 [[http://scintilla.sourceforge.net/SciTELua.html 여기]]에... * [[http://www.burgaud.com/scite-context-menu/]] \\ 윈도우즈용 Scite를 사용할 때 필수(?)인 "Context Menu Extension for Scite"를 다운로드 받을 수 있는 곳. * [[http://lua-users.org/wiki/SciteScripts]] \\ 각종 사이트 스크립트
kb/scite.txt
· 마지막으로 수정됨: 2014/11/06 21:02 (바깥 편집)
문서 도구
문서 보기
이전 판
백링크
맨 위로