문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 마지막 판 양쪽 다음 판 | ||
vim:tips [2020/04/30 10:26] kwon37xi |
vim:tips [2021/05/13 08:38] kwon37xi |
||
---|---|---|---|
줄 136: | 줄 136: | ||
===== 명령행 문자열 replace ===== | ===== 명령행 문자열 replace ===== | ||
* command line / shell script 로 vim 명령을 실행하려면 '' | * command line / shell script 로 vim 명령을 실행하려면 '' | ||
- | * '' | + | * '' |
<code sh> | <code sh> | ||
vi -c " | vi -c " | ||
줄 159: | 줄 159: | ||
: | : | ||
</ | </ | ||
+ | |||
+ | ===== root 권한 파일 저장 ===== | ||
+ | * 일반 사용자로 root 권한 디렉토리의 파일을 편집하고 저장할 때 에러가 나면 | ||
+ | * '': | ||
+ | |||
+ | ===== 숫자/ | ||
+ | * [[https:// | ||
+ | * '' | ||
+ | * '' | ||
+ | * vertical block('' | ||
+ | * 알파벳도 증가시키기 | ||
+ | <code sh> | ||
+ | :set nrformats+=alpha | ||
+ | </ | ||
+ | |||
+ | ===== 커서 중앙 유지 ===== | ||
+ | * 화면상에서 커서 위치가 항상 화면 중앙에 오게 하는 방법 | ||
+ | * [[https:// | ||
+ | * '' | ||
+ | * '' | ||
+ | * ''< | ||
+ | <code vim> | ||
+ | nnoremap < | ||
+ | </ | ||
+ | * 최종 | ||
+ | |||
+ | < | ||
+ | set scrolloff=< | ||
+ | if !exists(' | ||
+ | augroup VCenterCursor | ||
+ | au! | ||
+ | au OptionSet *,*.* | ||
+ | \ if and( expand("< | ||
+ | \ | ||
+ | \ au! VCenterCursor WinEnter, | ||
+ | \ endif | ||
+ | augroup END | ||
+ | function VCenterCursor() | ||
+ | if !exists('# | ||
+ | let s: | ||
+ | let & | ||
+ | au VCenterCursor WinEnter, | ||
+ | \ let & | ||
+ | else | ||
+ | au! VCenterCursor WinEnter, | ||
+ | let & | ||
+ | endif | ||
+ | endfunction | ||
+ | endif | ||
+ | |||
+ | nnoremap < | ||
+ | </ | ||
+ | |||
+ | ===== 참조 ===== | ||
+ | * [[http:// | ||
+ | |||