Putty color scheme
Linux man page들
왜냐면 당연히 cygwin이 linux가 아니므로;; (참고)
ubuntu 소스에서 man page를 가져와서 압축했다.
1.3메가.. posix 맨페이지도, 한글맨페이지도 받아다 압축했다.
man-pages-3.23
Man pages. 1.3MB
한글 man 페이지. 660KB
POSIX man page - 이게 가장 필요할 듯. POSIX 표준관련 man page다. 1.3메가
자기 홈디렉토리 아래
man 디렉토리를 만들고 그 아래에 man1~man8 디렉토리가 들어가도록 한다.
posix도 마찬가지로 man0p man1p man3p 디렉토리가 man 디렉토리 아래에 가도록 한다.
그리고,
~/.bash_profile에서
다음 구절을 추가하거나 주석 해제한다. 결국 당연히 man path를 추가하는 것임. (참고로 한글 man 페이지는 깔기를 추천하지 않음. 깨져나옴.)
# Set MANPATH so it includes users' private man if it exists
if [ -d "${HOME}/man" ]; then
MANPATH=${HOME}/man:${MANPATH}
fi
# 한글 man페이지는 ~/man/ko에 깔면 되긴 되는데.. 추천하지 않음. 한글 깨집니다.
if [ -d "${HOME}/man/ko" ]; then
MANPATH=${HOME}/man/ko:${MANPATH}
fi
cygwin + puttycyg로 윈도우에서 터미널 환경 꾸미기
cygwin으로 리눅스 비슷한 환경을 쓰려면 쓸만한 터미널이 문제입니다.
putty 를 쓰려면 ssh서버를 깔고 셋팅해야되는 단점이 있죠
puttycyg로 ssh를 통하지 않고 putty터미널을 cygwin 터미널-cygterm 으로 쓸 수 있습니다.
ssh 서버를 깔지 않아도 되고 커맨드창처럼 윈도 프로그램이 실행됩니다.
다음처럼 윈도 탐색기에서 터미널을 바로 열 수도 있죠.
cygwin 설치
http://www.cygwin.com/ 에서 cygwin setup 실행.
본인은 미러를 추가하였음.
http://ftp.daum.net/cygwin/
http://ftp.sayclub.co.kr/pub/cygwin/
putty cyg 설치
http://code.google.com/p/puttycyg/
puttycyg 실행
프로토콜을 cygterm으로 선택. 커맨드 라인은 – 로 합니다.
한글 설정
한글을 볼 수 있기 위해 putty 설정을 UTF8로 합니다.
이렇게 설정하기 전과 후 화면. 한글 보입니다.
ls에서 8비트문자 볼 수 있게 –show-control-char를 추가합니다.
평소 옵션으로 만들기 위해 ~/.bashrc 수정
한글 쓸 수 있게 하기 위해 ~/.inputrc 수정
# Allow 8-bit input/output
set meta-flag on
set convert-meta off
set input-meta on
set output-meta on
vi에서는
set encoding=cp949 termencoding=utf-8 fileencoding=cp949
해줘야 됩니다.
cp949(한글윈도우기본)인코딩을 쓰고 터미널은 UTF8을 쓰며 파일 저장은 cp949로 한다고 명시해야 평소쓰던 대로 잘 쓸 수 있음.
(수정하는 파일의 인코딩이 원래 utf8였으면 vi로 파일 열 때도 자동으로 파일 저장 옵션이 utf8로 변경됩니다. 위의 것은)
vim 설정
cygwin setup에서 vim 설치를 해야 합니다.
.vimrc에 저는 이렇게 했습니다.
"set encoding=cp949
set backup
" for hangul
set encoding=cp949 termencoding=utf-8 fileencoding=cp949
set fileformats=dos,unixset backupdir=~/.vim/backup
set scrolloff=3
syntax on
set bg=dark
set ruler
set cindent
set tags=./tags,tags,../tags
set sw=4
set ts=4
set smarttab
set hlsearch
set incsearch
set autowrite
set nostartofline
set backspace=indent,eol,start
set backspace=2
set bioskey
set showmatch
au BufNewFile,BufReadPost Makefile set noexpandtab
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
set formatoptions=croql
"set textwidth=80
set laststatus=2
map <F1> K
map <F2> mk[[?^[A-Za-z_].*(<CR>V"ky`k:echo "<C-R>k"<CR>
"fold
map <F3> v%zf
"unfold
map <F4> zo"Show prototype of the function
map <F8> [i
"Go to the declaration
map <F9> gd
"Go back
map <F10> ''
"Go to the definition
map <F11> <C-]>
"C-scope search from the files
map <S-F11> <C-\>s
"Go back from F11
map <F12> <C-t>" for mlcscope
set csprg=/usr/bin/mlcscope
" for mouse click
"set mouse=a
set mouse=n
"set mouse=v
팁 – 윈도 프로그램 실행시키기
path에 지정된 프로그램은 터미널에서 실행 가능합니다. cygwin+ssh로 했을 때는 할 수 없던 기능이죠
예를 들어 현재 경로에서 탐색기를 띄우려면
$ explorer .
을 실행하면 됩니다.
계산기는 calc
레지스트리 에디터는 regedit
특정 파일을 노트패드로 보고 싶으면
notepad 내파일.txt
하면 됩니다. :-)
쉽죠. 편리하고.
팁 – 커맨드라인에서 파일 이름 대소문자 구분 안하기
윈도우는 파일 이름에 대소문자 구분 안하니까
.bashrc에
shopt –s nocaseglob
추가하고
.inputrc에
set completion-ignore-case on
하면 된다.
cscope 사용
mlcscope란 패키지가 cygwin 기본이 되어있네요
예전엔 cscope 소스로 빌드해서 썼었는데
이거 설치하고
$ mlcscope -R
하면 소스들로부터 cscope.out 파일 생성됩니다.
vi에서 사용하려면 http://wiki.kldp.org/wiki.php/VimCscopeTutorial 참고하시면서 http://cscope.sourceforge.net/cscope_maps.vim 에서 cscope_maps.vim 파일 내려받아 ~/.vim/plugin 아래에 복사해두고
.vimrc 에서
" for mlcscope넣어주면 됩니다.
set csprg=/usr/bin/mlcscope
기존에 ctags로 사용하던 Ctrl+] Ctrl+t 가 cscope.out을 보고 동작하는 것도 보실 수 있습니다.
Tip: bash here
http://gleamynode.net/articles/1543/bas ··· puttycyg
PuTTYcyg를 이용한 “Bash Here” 컨텍스트 메뉴
이렇게 하면 탐색기에서 해당 폴더에서 마우스 오른클릭으로 bash창을 puttycyg로 띄울 수 있습니다.
- PuTTYcyg 최신 버전을 받아 C:\Cygwin\bin 디렉토리에 압축을 풀어 넣습니다.
- Cygwin 설치 프로그램에서 ‘chere‘ 패키지를 설치합니다.
- bash-here.zip을 다운로드합니다.
- 받은 ZIP 파일에서 bash-here.reg 파일을 풀고, 더블클릭해 시스템 레지스트리에 합칩니다.
- PuTTYcyg 최신 버전을 받아 D:\programs\puttycyg 디렉토리에 압축을 풀어 넣습니다.
- Cygwin 설치 프로그램에서 ‘chere‘ 패키지를 설치합니다.
- bash-here(2).zip을 받아서 bash-here.reg 파일을 풀고, 더블클릭해 시스템 레지스트리에 합칩니다.
Tip: bash 프롬프트
.bashrc에 다음과 같이 추가합니다.
TITLEBAR='\[\e]0;\w\007\]'; # Title bar(xterm이나 putty)에 현재 경로 나오도록.
#TITLEBAR='\[\e]0;\h \w\007\]'; # 사용자명과 현재 경로 나오도록.
#TITLEBAR=""
export PS1=${TITLEBAR}'\[\e[32m\]Daniel \[\e[33m\]\W\[\e[0m\] \$ '
c 라이브러리, posix man 페이지 보기
터미널에서 한글 보기
puttycyg cygwin 터미널로 쓸 수 있음
http://code.google.com/p/puttycyg/
Use PuTTY as a local Cygwin terminal.
PuTTYcyg is a patched version of PuTTY that, in addition to telnet, rlogin, ssh, and serial connections, can also be used as a local Cygwin terminal instead of the Windows console or xterm. See README.txt for more information.
여기 에서 추천받았습니다
cygwin 사용시 ssh서버 안깔고 로컬 터미널로 사용가능이라는 솔깃한 점이 :-)
체크해봐야지