공개가능
It all started out innocently enough. You experimented with it once or twice in your first year of college, but Nano and Pico were easier – closer to what you had already been using during high school on the Windows machines and Macs. (..) Staying late one night to finish an assignment that was due at midnight, you happened to catch a glimpse over one of the quiet uber-programmer’s shoulders. Your eyes twinkled from the glow of rows upon rows of monitors in the darkened computer lab as you witnessed in awe the impossible patterns of code and text manipulation that flashed across the screen.
“How did you do that?” you asked, incredulous.
The pithy, monosyllabic answer uttered in response changed your life forever: “Vim.” 1
vi
command in Ubuntu – that’s vim.tiny
:terminal
이 편하고 ycm, jedi-vim 등의 plugin이 안 멈춘다는 주변 증언이 있음.My current choices throughout these slides are marked with an asterisk (*).
$ vimtutor
If you’ve went through vimtutor
, your hands probably know this:
Yanking, cut/pasting, jumping to a particular character etc.
Select current word:
*
Jump to matching bracket:
%
Jump to line 42:
:42
Jump to the third next slash:
3f/
새로고침:
:e
처음 vim을 열었던 디렉토리의 파일들 보기:
:e .
현재 디렉토리 파일들 보기:
:Ex[plore]
:Vex
:Sex
Generate a number sequence:
:put =range(1,3)
Delete blank lines:
:g/^$/d
Delete two paragraphs:
{2d}
Replace highlight:
y # first, yank to put into register
:%s//new-string/g # nothing in the first field, uses the las searched pattern
Show whole path of file:
1 # get first buffer
ctrl + g # show file name, etc.
# 2017-07-28
16:04 L 그건 그렇고 ㅋ 혹시 vim 관련 자료 추천해줄만한거 있어?
16:04 L vim 이제 막 익히기 시작한 사람들한테 추천해줄만한거 ㅋ
16:05 S Vimtutor?
16:05 L ...를 끝낸 사람들
16:05 S Groking vim?
- Q. I’ve heard a lot about Vim, both pros and cons. (..) What is the way you use Vim that makes you more productive than with a contemporary editor?
- A. Your problem with Vim is that you don’t grok vi. 4
dd
d
(verb): “delete”_
(subject): “this line”d_
yy
y
(verb): “yank”y_
ddP
: “delete line and paste back into place”yw
y'a
Delete two paragraphs:
{2d}
{
(subject): “beginning of paragraph”2
(prefix): “two”d
(verb): “delete”{
(subject): “end of paragraph”Delete blank lines:
:g/^$/d
:g
: “globally execute on lines which match a regex”
:%
(==:1,$
), :v
(conVerse, those do NOT match the regex):g/re/p
– globally paste some regex – grep!d
: “delete”ma
: ’a’라는 이름의 마크를 만든다.'a
: Go to mark ‘a’:reg
: view registers"0p
: paste register 0set expandtab
set tabstop=4 # how many columns a tab counts for
set softtabstop=4 # how many columns vim uses when you hit Tab in insert mode
set shiftwidth=4 # how many columns text is indented with the reindent operations (<< and >>)
,t
,d
set showtabline=1
C-]
: jump to a tagC-t
: return to original positionSee https://github.com/e9t/dotfiles/blob/master/.hammerspoon/init.lua
...
hs.hotkey.bind({"ctrl", "shift", "cmd"}, 'h', 'home', keyCode('home'), nil)
hs.hotkey.bind({"ctrl", "shift", "cmd"}, 'j', 'pagedown', keyCode('pagedown'), nil)
hs.hotkey.bind({"ctrl", "shift", "cmd"}, 'k', 'pageup', keyCode('pageup'), nil)
hs.hotkey.bind({"ctrl", "shift", "cmd"}, 'l', 'end', keyCode('end'), nil)
hs.hotkey.bind({"ctrl", "shift"}, 'h', keyCode('left'), keyCode('left'), nil)
hs.hotkey.bind({"ctrl", "shift"}, 'j', keyCode('down'), keyCode('down'), nil)
hs.hotkey.bind({"ctrl", "shift"}, 'k', keyCode('up'), keyCode('up'), nil)
hs.hotkey.bind({"ctrl", "shift"}, 'l', keyCode('right'), keyCode('right'), nil)
(Ba)sh:
Tmux: