This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.
Please visit our production wiki at https://wiki.gentoo.org
Vim
Vim(Vi improved)은 vi 텍스트 편집기 기반의 텍스트 편집기입니다. 명령행 또는 그래픽 사용자 인터페이스의 독립 프로그램으로 사용할 수 있습니다.
설치
USE 플래그
USE flags for app-editors/vim Vim, an improved vi-style text editor
X
|
Link console vim against X11 libraries to enable title and clipboard features in xterm |
acl
|
Add support for Access Control Lists |
crypt
|
Use dev-libs/libsodium for crypto support |
cscope
|
Enable cscope interface |
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
gpm
|
Add support for sys-libs/gpm (Console-based mouse driver) |
lua
|
Enable Lua scripting support |
minimal
|
Install a very minimal build (disables, for example, plugins, fonts, most drivers, non-critical features) |
nls
|
Add Native Language Support (using gettext - GNU locale utilities) |
perl
|
Add optional support/bindings for the Perl language |
python
|
Add optional support/bindings for the Python language |
racket
|
Enable support for Scheme using dev-scheme/racket |
ruby
|
Add support/bindings for the Ruby language |
selinux
|
!!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur |
sound
|
Enable sound support |
tcl
|
Add support the Tcl language |
terminal
|
Enable terminal emulation support |
vim-pager
|
Install vimpager and vimmanpager links |
Emerge
X 윈도 시스템 지원 기능이 필요하지 않으면 app-editors/vim 꾸러미를 설치하십시오:
root #
emerge --ask app-editors/vim
추가 프로그램
Gvim
ncurses 기반 인터페이스(터미널용 /usr/bin/vim)와 마찬가지로 그래픽 인터페이스(X 윈도우 시스템용 /usr/bin/gvim) vim을 설치하려면, app-editors/gvim 꾸러미를 설치하십시오:
root #
emerge --ask app-editors/gvim
Vim-qt
또한 시험적 Qt 인터페이스 app-editors/vim-qt도 설치할 수 있습니다.
플러그인
app-vim 분류 항목에는 여러가지 문법 정의, 플러그인, 다른 Vim 관련 기능이 있습니다.
app-vim 분류 항목에 있는 꾸러미를 간단하게 살펴보려면 emerge 또는 eix를 사용하십시오.
user $
emerge --search "%@^app-vim"
user $
eix -cC app-vim
설정
파일
Vim은 사용자별 또는 시스템 전체 범위 설정 파일로 설정할 수 있습니다:
- /etc/vim/vimrc - 시스템 (전체) 영역 설정 파일.
- ~/.vimrc - 사용자별(로컬) 설정 파일. 틸데(~)는 사용자 자체 홈 폴더를 의미합니다.
사용법
시작하기
Vim은 30분 정도의 시간이 필요한 내장형 따라하기 문서가 있습니다. vimtutor 명령으로 시작하십시오:
user $
vimtutor
Color schemes
About a dozen color schemes are shipped with the base Vim package. They can be listed in last line mode by typing colorscheme, then pressing either Ctrl+d or pressing the Tab key twice:
:
colorscheme
blue darkblue default delek desert elflord evening industry koehler morning murphy pablo peachpuff ron shine slate torte zellner
They can be changed in Vim by using the colorscheme (alternatively use colo) command while in last line mode:
:
colorscheme peachpuff
Color schemes can be permanently applied in the .vimrc file:
~/.vimrc
colorscheme peachpuff syntax on
The first line sets the default color scheme while the last line activates the color scheme.
요령
명령행에서 ex 또는 ed처럼 vim 사용
Vim을 한 줄 작성기로 사용할 수 있습니다. 스크립트 또는 명령줄에서 의도치 않은 방법으로 내용을 바꿀때 사용할 수 있는 명령이 있습니다.
다음 명령에서는 file.txt 파일의 각각의 줄 앞에 #
을 추가합니다:
user $
vim -c ":%s/^/#/g" -c ":x" file.txt
Vim에 (-c
옵션을 통해) 명령을 전달하여 해석하고 처리하게 합니다. 첫번째 명령은 Vim의 대리 명령( sed와 매우 유사)이며, 그 다음 명령은 저장하고 편집기를 빠져나가는 Vim 명령입니다.
파일 인코딩 바꾸기
파일 인코딩을 UTF-8로 바꾸려면 다음 명령을(Vim 명령 모드에서) 사용하십시오:
:
e ++enc=utf8
앞에서 보여드린 요령처럼 마찬가지로 명령줄에서도 처리할 수 있습니다:
user $
vim -c ":wq! ++enc=utf8" file.txt
추가 참조
- Vim 배우기 - vim 사용법을 상당히 자세하게 설명합니다.
외부 자료
- Vim 문서 는 HTML, PDF, PS 형식의 설명서 (aka ":help" and Free VIM OPL Book), 자주 묻는 질문, 절차 설명, 따라하기 내용이 있습니다.
- A vim Tutorial and Primer - 최고의 vim 지침서. 우선 읽어보십시오.
- VIM Scripts/Plugins
- Vim for Humans (무료 전자책) - 복재한 후 소스 디렉터리로 cd 명령을 통해 이동한 후, mkdir dist 명령을 수행하고, rst/en/Makefile 에서 SPHINXBUILD의
sphinx2-build
명령 이름을sphinx-build
로 바꾸십시오. 그 다음 ./makedist.sh 명령을 실행하십시오. ./dist/vimpourleshumains/의 PDF 파일을 살펴보십시오. - Learning the vi and Vim Editors, 7th Edition O'Reilly Print ISBN: 978-0-596-52983-3, Ebook ISBN: 978-0-596-15935-1