mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
@@ -152,6 +152,7 @@ SRC_ALL = \
|
||||
src/testdir/if_ver*.vim \
|
||||
src/testdir/color_ramp.vim \
|
||||
src/testdir/silent.wav \
|
||||
src/testdir/popupbounce.vim \
|
||||
src/proto.h \
|
||||
src/protodef.h \
|
||||
src/proto/arabic.pro \
|
||||
|
||||
+28
-28
@@ -45,37 +45,37 @@ LangString str_type_full ${LANG_SIMPCHINESE} \
|
||||
LangString str_section_old_ver ${LANG_SIMPCHINESE} \
|
||||
"卸载旧版本"
|
||||
LangString str_desc_old_ver ${LANG_SIMPCHINESE} \
|
||||
"卸载系统上旧版本的 Vim。"
|
||||
"卸载系统上已存在的 Vim 版本"
|
||||
|
||||
LangString str_section_exe ${LANG_SIMPCHINESE} \
|
||||
"安装 Vim 图形界面"
|
||||
LangString str_desc_exe ${LANG_SIMPCHINESE} \
|
||||
"安装 Vim 图形界面及脚本。此为必选安装。"
|
||||
"安装 Vim 图形界面及运行时文件。此项为必选。"
|
||||
|
||||
LangString str_section_console ${LANG_SIMPCHINESE} \
|
||||
"安装 Vim 命令行程序"
|
||||
"安装 Vim 控制台版本"
|
||||
LangString str_desc_console ${LANG_SIMPCHINESE} \
|
||||
"安装 Vim 命令行程序 (vim.exe)。该程序在命令行窗口中运行。"
|
||||
"安装 Vim 的控制台版本(vim.exe)。"
|
||||
|
||||
LangString str_section_batch ${LANG_SIMPCHINESE} \
|
||||
"安装批处理文件"
|
||||
LangString str_desc_batch ${LANG_SIMPCHINESE} \
|
||||
"为 Vim 的各种变体创建批处理程序,以便在命令行下运行 Vim。"
|
||||
"为 Vim 的各种变体创建批处理文件,以便在命令行下运行 Vim。"
|
||||
|
||||
LangString str_group_icons ${LANG_SIMPCHINESE} \
|
||||
"创建 Vim 图标"
|
||||
"创建图标"
|
||||
LangString str_desc_icons ${LANG_SIMPCHINESE} \
|
||||
"为 Vim 创建若干图标,以方便使用 Vim。"
|
||||
|
||||
LangString str_section_desktop ${LANG_SIMPCHINESE} \
|
||||
"在桌面上"
|
||||
"桌面图标"
|
||||
LangString str_desc_desktop ${LANG_SIMPCHINESE} \
|
||||
"在桌面上为 Vim 创建若干图标,以方便启动 Vim。"
|
||||
"创建 Vim 的桌面快捷方式图标。"
|
||||
|
||||
LangString str_section_start_menu ${LANG_SIMPCHINESE} \
|
||||
"在启动菜单的程序菜单下"
|
||||
"「开始」菜单程序组"
|
||||
LangString str_desc_start_menu ${LANG_SIMPCHINESE} \
|
||||
"在启动菜单的程序菜单下添加 Vim 组。适用于 Windows 95 及以上版本。"
|
||||
"在开始菜单中添加 Vim 程序组(适用于 Windows 95 及以上版本)"
|
||||
|
||||
#LangString str_section_quick_launch ${LANG_SIMPCHINESE} \
|
||||
# "在快速启动启动栏中"
|
||||
@@ -83,9 +83,9 @@ LangString str_desc_start_menu ${LANG_SIMPCHINESE} \
|
||||
# "在快速启动栏中添加 Vim 图标。"
|
||||
|
||||
LangString str_section_edit_with ${LANG_SIMPCHINESE} \
|
||||
"安装快捷菜单"
|
||||
"添加到快捷菜单"
|
||||
LangString str_desc_edit_with ${LANG_SIMPCHINESE} \
|
||||
"将 Vim 添加到“打开方式”快捷菜单中。"
|
||||
"将“用 Vim 编辑”添加到快捷菜单中。"
|
||||
|
||||
#LangString str_section_edit_with32 ${LANG_SIMPCHINESE} \
|
||||
# "32 位版本"
|
||||
@@ -98,10 +98,10 @@ LangString str_desc_edit_with ${LANG_SIMPCHINESE} \
|
||||
# "将 Vim 添加到 64 位程序的“打开方式”快捷菜单中。"
|
||||
|
||||
LangString str_section_vim_rc ${LANG_SIMPCHINESE} \
|
||||
"创建缺省配置文件"
|
||||
"创建默认配置文件"
|
||||
LangString str_desc_vim_rc ${LANG_SIMPCHINESE} \
|
||||
"在安装目录下生成缺省的 Vim 配置文件(_vimrc)。\
|
||||
如果该文件已经存在,则略过此项。"
|
||||
"在安装目录下生成默认的 Vim 配置文件(_vimrc)。\
|
||||
如果该文件已经存在,则跳过该项。"
|
||||
|
||||
LangString str_group_plugin ${LANG_SIMPCHINESE} \
|
||||
"创建插件目录"
|
||||
@@ -121,9 +121,9 @@ LangString str_desc_plugin_vim ${LANG_SIMPCHINESE} \
|
||||
该目录下的扩展插件。"
|
||||
|
||||
LangString str_section_vis_vim ${LANG_SIMPCHINESE} \
|
||||
"安装 VisVim 插件"
|
||||
"VisVim 插件"
|
||||
LangString str_desc_vis_vim ${LANG_SIMPCHINESE} \
|
||||
"安装用于与微软 Microsoft Visual Studio 进行集成的 VisVim 插件。"
|
||||
"安装与 Visual Studio 集成的 VisVim 插件。"
|
||||
|
||||
LangString str_section_nls ${LANG_SIMPCHINESE} \
|
||||
"安装多语言支持"
|
||||
@@ -153,12 +153,12 @@ LangString str_desc_rm_plugin_home ${LANG_SIMPCHINESE} \
|
||||
LangString str_unsection_plugin_vim ${LANG_SIMPCHINESE} \
|
||||
"公共插件目录"
|
||||
LangString str_desc_rm_plugin_vim ${LANG_SIMPCHINESE} \
|
||||
"Remove the plugin directories from Vim install directory."
|
||||
"从 Vim 安装目录下移除插件目录。"
|
||||
|
||||
LangString str_unsection_rootdir ${LANG_SIMPCHINESE} \
|
||||
"Remove the Vim root directory"
|
||||
"移除 Vim 主目录"
|
||||
LangString str_desc_rm_rootdir ${LANG_SIMPCHINESE} \
|
||||
"Remove the Vim root directory. It contains your Vim configuration files!"
|
||||
"移除 Vim 的主目录,该目录包含您的配置文件!"
|
||||
|
||||
|
||||
##############################################################################
|
||||
@@ -225,13 +225,13 @@ LangString str_msg_rm_exe_fail ${LANG_SIMPCHINESE} \
|
||||
# 该目录下仍有其他文件。"
|
||||
|
||||
LangString str_msg_uninstalling ${LANG_SIMPCHINESE} \
|
||||
"Uninstalling the old version..."
|
||||
"正在卸载旧版本..."
|
||||
|
||||
LangString str_msg_registering ${LANG_SIMPCHINESE} \
|
||||
"Registering..."
|
||||
"正在注册..."
|
||||
|
||||
LangString str_msg_unregistering ${LANG_SIMPCHINESE} \
|
||||
"Unregistering..."
|
||||
"正在取消注册..."
|
||||
|
||||
|
||||
##############################################################################
|
||||
@@ -239,12 +239,12 @@ LangString str_msg_unregistering ${LANG_SIMPCHINESE} \
|
||||
##############################################################################
|
||||
|
||||
LangString str_vimrc_page_title ${LANG_SIMPCHINESE} \
|
||||
"Choose _vimrc settings"
|
||||
"设置 _vimrc"
|
||||
LangString str_vimrc_page_subtitle ${LANG_SIMPCHINESE} \
|
||||
"Choose the settings for enhancement, keyboard and mouse."
|
||||
"选择键盘、鼠标和增强选项。"
|
||||
|
||||
LangString str_msg_compat_title ${LANG_SIMPCHINESE} \
|
||||
" Vi / Vim behavior "
|
||||
"Vi / Vim 行为"
|
||||
LangString str_msg_compat_desc ${LANG_SIMPCHINESE} \
|
||||
"&Compatibility and enhancements"
|
||||
LangString str_msg_compat_vi ${LANG_SIMPCHINESE} \
|
||||
@@ -257,7 +257,7 @@ LangString str_msg_compat_all ${LANG_SIMPCHINESE} \
|
||||
"Vim with all enhancements (load vimrc_example.vim) (Default)"
|
||||
|
||||
LangString str_msg_keymap_title ${LANG_SIMPCHINESE} \
|
||||
" Mappings "
|
||||
"键盘映射"
|
||||
LangString str_msg_keymap_desc ${LANG_SIMPCHINESE} \
|
||||
"&Remap a few keys for Windows (Ctrl-V, Ctrl-C, Ctrl-A, Ctrl-S, Ctrl-F, etc)"
|
||||
LangString str_msg_keymap_default ${LANG_SIMPCHINESE} \
|
||||
@@ -266,7 +266,7 @@ LangString str_msg_keymap_windows ${LANG_SIMPCHINESE} \
|
||||
"Remap a few keys"
|
||||
|
||||
LangString str_msg_mouse_title ${LANG_SIMPCHINESE} \
|
||||
" Mouse "
|
||||
"鼠标"
|
||||
LangString str_msg_mouse_desc ${LANG_SIMPCHINESE} \
|
||||
"&Behavior of right and left buttons"
|
||||
LangString str_msg_mouse_default ${LANG_SIMPCHINESE} \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
*editing.txt* For Vim version 8.1. Last change: 2019 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -593,7 +593,7 @@ You can use the argument list with the following commands, and with the
|
||||
expression functions |argc()| and |argv()|. These all work on the argument
|
||||
list of the current window.
|
||||
|
||||
*:ar* *:arg* *:args*
|
||||
*:ar* *:arg* *:args*
|
||||
:ar[gs] Print the argument list, with the current file in
|
||||
square brackets.
|
||||
|
||||
|
||||
+20
-18
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.1. Last change: 2019 Jun 06
|
||||
*eval.txt* For Vim version 8.1. Last change: 2019 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2623,12 +2623,12 @@ sin({expr}) Float sine of {expr}
|
||||
sinh({expr}) Float hyperbolic sine of {expr}
|
||||
sort({list} [, {func} [, {dict}]])
|
||||
List sort {list}, using {func} to compare
|
||||
sound_clear() none stop playing all sounds
|
||||
sound_playevent({name} [, {callback}])
|
||||
Number play an event sound
|
||||
sound_playfile({name} [, {callback}])
|
||||
Number play a sound file
|
||||
sound_playfile({path} [, {callback}])
|
||||
Number play sound file {path}
|
||||
sound_stop({id}) none stop playing sound {id}
|
||||
sound_stopall() none stop playing all sounds
|
||||
soundfold({word}) String sound-fold {word}
|
||||
spellbadword() String badly spelled word at cursor
|
||||
spellsuggest({word} [, {max} [, {capital}]])
|
||||
@@ -7360,7 +7360,7 @@ prop_remove({props} [, {lnum} [, {lnum-end}]])
|
||||
not just the first one
|
||||
A property matches when either "id" or "type" matches.
|
||||
If buffer "bufnr" does not exist you get an error message.
|
||||
If buffer 'bufnr" is not loaded then nothing happens.
|
||||
If buffer "bufnr" is not loaded then nothing happens.
|
||||
|
||||
Returns the number of properties that were removed.
|
||||
|
||||
@@ -8852,6 +8852,10 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
|
||||
return a:i1 - a:i2
|
||||
endfunc
|
||||
<
|
||||
sound_clear() *sound_clear()*
|
||||
Stop playing all sounds.
|
||||
{only available when compiled with the +sound feature}
|
||||
|
||||
*sound_playevent()*
|
||||
sound_playevent({name} [, {callback}])
|
||||
Play a sound identified by {name}. Which event names are
|
||||
@@ -8864,7 +8868,7 @@ sound_playevent({name} [, {callback}])
|
||||
finished. The first argument is the sound ID, the second
|
||||
argument is the status:
|
||||
0 sound was played to the end
|
||||
1 sound was interruped
|
||||
1 sound was interrupted
|
||||
2 error occured after sound started
|
||||
Example: >
|
||||
func Callback(id, status)
|
||||
@@ -8874,26 +8878,21 @@ sound_playevent({name} [, {callback}])
|
||||
|
||||
< Returns the sound ID, which can be passed to `sound_stop()`.
|
||||
Returns zero if the sound could not be played.
|
||||
{only available when compiled with the +sound feature}
|
||||
{only available when compiled with the |+sound| feature}
|
||||
|
||||
*sound_playfile()*
|
||||
sound_playfile({name} [, {callback}])
|
||||
Like `sound_playevent()` but play sound file {name}. {name}
|
||||
sound_playfile({path} [, {callback}])
|
||||
Like `sound_playevent()` but play sound file {path}. {path}
|
||||
must be a full path. On Ubuntu you may find files to play
|
||||
with this command: >
|
||||
:!find /usr/share/sounds -type f | grep -v index.theme
|
||||
|
||||
< {only available when compiled with the +sound feature}
|
||||
< {only available when compiled with the |+sound| feature}
|
||||
|
||||
|
||||
sound_stop({id}) *sound_stop()*
|
||||
Stop playing sound {id}. {id} must be previously returned by
|
||||
`sound_playevent()` or `sound_playfile()`.
|
||||
{only available when compiled with the +sound feature}
|
||||
|
||||
sound_stopall() *sound_stopall()*
|
||||
Stop playing all sounds.
|
||||
{only available when compiled with the +sound feature}
|
||||
{only available when compiled with the |+sound| feature}
|
||||
|
||||
*soundfold()*
|
||||
soundfold({word})
|
||||
@@ -13088,19 +13087,22 @@ Sometimes old syntax of functionality gets in the way of making Vim better.
|
||||
When support is taken away this will break older Vim scripts. To make this
|
||||
explicit the |:scriptversion| command can be used. When a Vim script is not
|
||||
compatible with older versions of Vim this will give an explicit error,
|
||||
instead of failing in mysterious ways. >
|
||||
instead of failing in mysterious ways.
|
||||
|
||||
*scriptversion-1* >
|
||||
:scriptversion 1
|
||||
< This is the original Vim script, same as not using a |:scriptversion|
|
||||
command. Can be used to go back to old syntax for a range of lines.
|
||||
Test for support with: >
|
||||
has('vimscript-1')
|
||||
|
||||
< *scriptversion-2* >
|
||||
:scriptversion 2
|
||||
< String concatenation with "." is not supported, use ".." instead.
|
||||
This avoids the ambiguity using "." for Dict member access and
|
||||
floating point numbers. Now ".5" means the number 0.5.
|
||||
>
|
||||
|
||||
*scriptversion-3* >
|
||||
:scriptversion 3
|
||||
< All |vim-variable|s must be prefixed by "v:". E.g. "version" doesn't
|
||||
work as |v:version| anymore, it can be used as a normal variable.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.1. Last change: 2019 May 25
|
||||
*index.txt* For Vim version 8.1. Last change: 2019 Jun 09
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1486,7 +1486,6 @@ tag command action ~
|
||||
|:perldo| :perld[o] execute Perl command for each line
|
||||
|:pop| :po[p] jump to older entry in tag stack
|
||||
|:popup| :popu[p] popup a menu by name
|
||||
|:popupclear| :popupc[lear] remove all popup windows
|
||||
|:ppop| :pp[op] ":pop" in preview window
|
||||
|:preserve| :pre[serve] write all text to swap file
|
||||
|:previous| :prev[ious] go to previous file in argument list
|
||||
|
||||
+120
-122
@@ -1,4 +1,4 @@
|
||||
*popup.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
*popup.txt* For Vim version 8.1. Last change: 2019 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Displaying text in floating window. *popup* *popup-window*
|
||||
|
||||
THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE
|
||||
THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE
|
||||
|
||||
1. Introduction |popup-intro|
|
||||
2. Functions |popup-functions|
|
||||
@@ -76,28 +76,21 @@ else. E.g. if you use `popup_atcursor()` the popup normally shows just above
|
||||
the current cursor position, but if the cursor is close to the top of the Vim
|
||||
window it will be placed below the cursor position.
|
||||
|
||||
When the screen scrolls up for output of an Ex command, popups move too, so
|
||||
that they will not cover the output.
|
||||
|
||||
|
||||
TODO:
|
||||
|
||||
Scrolling: When the screen scrolls up for output of an Ex command, what
|
||||
happens with popups?
|
||||
1. Stay where they are. Problem: listed text may go behind and can't be read.
|
||||
2. Scroll with the page. What if they get updated? Either postpone, or take
|
||||
the scroll offset into account.
|
||||
Probably 2. is the best choice.
|
||||
|
||||
|
||||
IMPLEMENTATION:
|
||||
- Code is in popupwin.c
|
||||
- buffers remain after a popup was deleted.
|
||||
- Why does 'nrformats' leak from the popup window buffer???
|
||||
- Make redrawing more efficient and avoid flicker.
|
||||
First draw popups, creating a mask, use the mask in screen_line() when
|
||||
drawing other windows and stuff. Mask contains zindex of popups.
|
||||
Keep mask until next update_screen(), use when drawing status lines.
|
||||
Remove update_popup() calls after draw_tabline()/updating statusline
|
||||
Fix redrawing problem with completion.
|
||||
Fix redrawing problem when scrolling non-current window
|
||||
- Add 'balloonpopup': instead of showing text, let the callback open a popup
|
||||
window and return the window ID. The popup will then be closed when the
|
||||
mouse moves, except when it moves inside the popup.
|
||||
- For the "moved" property also include mouse movement?
|
||||
- Make redrawing more efficient and avoid flicker:
|
||||
- put popup menu also put in popup_mask?
|
||||
- Disable commands, feedkeys(), CTRL-W, etc. in a popup window.
|
||||
Use NOT_IN_POPUP_WINDOW for more commands.
|
||||
- Invoke filter with character before mapping?
|
||||
@@ -111,10 +104,37 @@ IMPLEMENTATION:
|
||||
==============================================================================
|
||||
2. Functions *popup-functions*
|
||||
|
||||
THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE
|
||||
THIS IS UNDER DESIGN - ANYTHING MAY STILL CHANGE
|
||||
|
||||
[functions to be moved to eval.txt later, keep overview of functions here]
|
||||
|
||||
popup_atcursor({text}, {options}) *popup_atcursor()*
|
||||
Show the {text} above the cursor, and close it when the cursor
|
||||
moves. This works like: >
|
||||
call popup_create({text}, {
|
||||
\ 'pos': 'botleft',
|
||||
\ 'line': 'cursor-1',
|
||||
\ 'col': 'cursor',
|
||||
\ 'moved': 'WORD',
|
||||
\ })
|
||||
< Use {options} to change the properties.
|
||||
|
||||
|
||||
*popup_clear()*
|
||||
popup_clear() Emergency solution to a misbehaving plugin: close all popup
|
||||
windows.
|
||||
|
||||
|
||||
popup_close({id} [, {result}]) *popup_close()*
|
||||
Close popup {id}. The window and the associated buffer will
|
||||
be deleted.
|
||||
|
||||
If the popup has a callback it will be called just before the
|
||||
popup window is deleted. If the optional {result} is present
|
||||
it will be passed as the second argument of the callback.
|
||||
Otherwise zero is passed to the callback.
|
||||
|
||||
|
||||
popup_create({text}, {options}) *popup_create()*
|
||||
Open a popup window showing {text}, which is either:
|
||||
- a string
|
||||
@@ -133,18 +153,8 @@ popup_create({text}, {options}) *popup_create()*
|
||||
< In case of failure zero is returned.
|
||||
|
||||
|
||||
popup_close({id} [, {result}]) *popup_close()*
|
||||
Close popup {id}. The window and the associated buffer will
|
||||
be deleted.
|
||||
|
||||
If the popup has a callback it will be called just before the
|
||||
popup window is deleted. If the optional {result} is present
|
||||
it will be passed as the second argument of the callback.
|
||||
Otherwise zero is passed to the callback.
|
||||
|
||||
|
||||
popup_dialog({text}, {options}) *popup_dialog()*
|
||||
{not implemented yet}
|
||||
{not implemented yet}
|
||||
Just like |popup_create()| but with these default options: >
|
||||
call popup_create({text}, {
|
||||
\ 'pos': 'center',
|
||||
@@ -155,36 +165,67 @@ popup_dialog({text}, {options}) *popup_dialog()*
|
||||
< Use {options} to change the properties.
|
||||
|
||||
|
||||
popup_notification({text}, {options}) *popup_notification()*
|
||||
{not implemented yet}
|
||||
Show the {text} for 3 seconds at the top of the Vim window.
|
||||
This works like: >
|
||||
call popup_create({text}, {
|
||||
\ 'line': 1,
|
||||
\ 'col': 10,
|
||||
\ 'time': 3000,
|
||||
\ 'tab': -1,
|
||||
\ 'zindex': 200,
|
||||
\ 'highlight': 'WarningMsg',
|
||||
\ 'border': [],
|
||||
\ })
|
||||
< Use {options} to change the properties.
|
||||
popup_filter_menu({id}, {key}) *popup_filter_menu()*
|
||||
{not implemented yet}
|
||||
Filter that can be used for a popup. It handles the cursor
|
||||
keys to move the selected index in the popup. Space and Enter
|
||||
can be used to select an item. Invokes the "callback" of the
|
||||
popup menu with the index of the selected line as the second
|
||||
argument.
|
||||
|
||||
|
||||
popup_atcursor({text}, {options}) *popup_atcursor()*
|
||||
Show the {text} above the cursor, and close it when the cursor
|
||||
moves. This works like: >
|
||||
call popup_create({text}, {
|
||||
\ 'pos': 'botleft',
|
||||
\ 'line': 'cursor-1',
|
||||
\ 'col': 'cursor',
|
||||
\ 'moved': 'WORD',
|
||||
\ })
|
||||
< Use {options} to change the properties.
|
||||
popup_filter_yesno({id}, {key}) *popup_filter_yesno()*
|
||||
{not implemented yet}
|
||||
Filter that can be used for a popup. It handles only the keys
|
||||
'y', 'Y' and 'n' or 'N'. Invokes the "callback" of the
|
||||
popup menu with the 1 for 'y' or 'Y' and zero for 'n' or 'N'
|
||||
as the second argument. Pressing Esc and CTRL-C works like
|
||||
pressing 'n'.
|
||||
|
||||
|
||||
popup_getoptions({id}) *popup_getoptions()*
|
||||
Return the {options} for popup {id} in a Dict.
|
||||
A zero value means the option was not set. For "zindex" the
|
||||
default value is returned, not zero.
|
||||
|
||||
The "highlight" entry is omitted, use the 'wincolor' option
|
||||
for that: >
|
||||
let hl = getwinvar(winid, '&wincolor')
|
||||
|
||||
< If popup window {id} is not found an empty Dict is returned.
|
||||
|
||||
|
||||
popup_getpos({id}) *popup_getpos()*
|
||||
Return the position and size of popup {id}. Returns a Dict
|
||||
with these entries:
|
||||
col screen column of the popup, one-based
|
||||
line screen line of the popup, one-based
|
||||
width width of the whole popup in screen cells
|
||||
height height of the whole popup in screen cells
|
||||
core_col screen column of the text box
|
||||
core_line screen line of the text box
|
||||
core_width width of the text box in screen cells
|
||||
core_height height of the text box in screen cells
|
||||
visible one if the popup is displayed, zero if hidden
|
||||
Note that these are the actual screen positions. They differ
|
||||
from the values in `popup_getoptions()` for the sizing and
|
||||
positioning mechanism applied.
|
||||
|
||||
The "core_" values exclude the padding and border.
|
||||
|
||||
If popup window {id} is not found an empty Dict is returned.
|
||||
|
||||
|
||||
popup_hide({id}) *popup_hide()*
|
||||
If {id} is a displayed popup, hide it now. If the popup has a
|
||||
filter it will not be invoked for so long as the popup is
|
||||
hidden.
|
||||
If window {id} does not exist nothing happens. If window {id}
|
||||
exists but is not a popup window an error is given. *E993*
|
||||
|
||||
|
||||
popup_menu({text}, {options}) *popup_menu()*
|
||||
{not implemented yet}
|
||||
{not implemented yet}
|
||||
Show the {text} near the cursor, handle selecting one of the
|
||||
items with cursorkeys, and close it an item is selected with
|
||||
Space or Enter. {text} should have multiple lines to make this
|
||||
@@ -200,17 +241,6 @@ popup_menu({text}, {options}) *popup_menu()*
|
||||
"callback" to a function that handles the selected item.
|
||||
|
||||
|
||||
popup_hide({id}) *popup_hide()*
|
||||
If {id} is a displayed popup, hide it now. If the popup has a
|
||||
filter it will not be invoked for so long as the popup is
|
||||
hidden.
|
||||
If window {id} does not exist nothing happens. If window {id}
|
||||
exists but is not a popup window an error is given. *E993*
|
||||
|
||||
popup_show({id}) *popup_show()*
|
||||
If {id} is a hidden popup, show it now.
|
||||
For {id} see `popup_hide()`.
|
||||
|
||||
popup_move({id}, {options}) *popup_move()*
|
||||
Move popup {id} to the position speficied with {options}.
|
||||
{options} may contain the items from |popup_create()| that
|
||||
@@ -219,65 +249,32 @@ popup_move({id}, {options}) *popup_move()*
|
||||
For {id} see `popup_hide()`.
|
||||
|
||||
|
||||
popup_filter_menu({id}, {key}) *popup_filter_menu()*
|
||||
{not implemented yet}
|
||||
Filter that can be used for a popup. It handles the cursor
|
||||
keys to move the selected index in the popup. Space and Enter
|
||||
can be used to select an item. Invokes the "callback" of the
|
||||
popup menu with the index of the selected line as the second
|
||||
argument.
|
||||
popup_notification({text}, {options}) *popup_notification()*
|
||||
{not implemented yet}
|
||||
Show the {text} for 3 seconds at the top of the Vim window.
|
||||
This works like: >
|
||||
call popup_create({text}, {
|
||||
\ 'line': 1,
|
||||
\ 'col': 10,
|
||||
\ 'time': 3000,
|
||||
\ 'tab': -1,
|
||||
\ 'zindex': 200,
|
||||
\ 'highlight': 'WarningMsg',
|
||||
\ 'border': [],
|
||||
\ })
|
||||
< Use {options} to change the properties.
|
||||
|
||||
|
||||
popup_filter_yesno({id}, {key}) *popup_filter_yesno()*
|
||||
{not implemented yet}
|
||||
Filter that can be used for a popup. It handles only the keys
|
||||
'y', 'Y' and 'n' or 'N'. Invokes the "callback" of the
|
||||
popup menu with the 1 for 'y' or 'Y' and zero for 'n' or 'N'
|
||||
as the second argument. Pressing Esc and CTRL-C works like
|
||||
pressing 'n'.
|
||||
popup_show({id}) *popup_show()*
|
||||
If {id} is a hidden popup, show it now.
|
||||
For {id} see `popup_hide()`.
|
||||
|
||||
|
||||
popup_setoptions({id}, {options}) *popup_setoptions()*
|
||||
{not implemented yet}
|
||||
{not implemented yet}
|
||||
Override options in popup {id} with entries in {options}.
|
||||
|
||||
|
||||
popup_getoptions({id}) *popup_getoptions()*
|
||||
Return the {options} for popup {id} in a Dict.
|
||||
A zero value means the option was not set. For "zindex" the
|
||||
default value is returned, not zero.
|
||||
|
||||
The "highlight" entry is omitted, use the 'wincolor' option
|
||||
for that: >
|
||||
let hl = getwinvar(winid, '&wincolor')
|
||||
|
||||
< If popup window {id} is not found an empty Dict is returned.
|
||||
|
||||
popup_getpos({id}) *popup_getpos()*
|
||||
Return the position and size of popup {id}. Returns a Dict
|
||||
with these entries:
|
||||
col screen column of the popup, one-based
|
||||
line screen line of the popup, one-based
|
||||
width width of the whole popup in screen cells
|
||||
height height of the whole popup in screen cells
|
||||
core_col screen column of the text box
|
||||
core_line screen line of the text box
|
||||
core_width width of the text box in screen cells
|
||||
core_height height of the text box in screen cells
|
||||
visible one if the popup is displayed, zero if hidden
|
||||
Note that these are the actual screen positions. They differ
|
||||
from the values in `popup_getoptions()` for the sizing and
|
||||
positioning mechanism applied.
|
||||
|
||||
The "core_" values exclude the padding and border.
|
||||
|
||||
If popup window {id} is not found an empty Dict is returned.
|
||||
|
||||
|
||||
*:popupclear* *:popupc*
|
||||
:popupc[lear] Emergency solution to a misbehaving plugin: close all popup
|
||||
windows.
|
||||
|
||||
|
||||
POPUP BUFFER AND WINDOW *popup-buffer*
|
||||
|
||||
@@ -285,7 +282,7 @@ A new buffer is created to hold the text and text properties of the popup
|
||||
window. The buffer is always associated with the popup window and
|
||||
manipulation is restricted:
|
||||
- the buffer has no name
|
||||
- 'buftype' is "popup"
|
||||
- 'buftype' is "popup"
|
||||
- 'swapfile' is off
|
||||
- 'bufhidden' is "hide"
|
||||
- 'buflisted' is off
|
||||
@@ -405,7 +402,8 @@ The second argument of |popup_create()| is a dictionary with options:
|
||||
By default a double line is used all around when
|
||||
'encoding' is "utf-8", otherwise ASCII characters are
|
||||
used.
|
||||
zindex Priority for the popup, default 50.
|
||||
zindex Priority for the popup, default 50. Mininum value is
|
||||
1, maximum value is 32000.
|
||||
time Time in milliseconds after which the popup will close.
|
||||
When omitted |popup_close()| must be used.
|
||||
moved Specifies to close the popup if the cursor moved:
|
||||
@@ -416,7 +414,7 @@ The second argument of |popup_create()| is a dictionary with options:
|
||||
{start} or after {end}
|
||||
The popup also closes if the cursor moves to another
|
||||
line or to another window.
|
||||
filter A callback that can filter typed characters, see
|
||||
filter A callback that can filter typed characters, see
|
||||
|popup-filter|.
|
||||
callback A callback that is called when the popup closes, e.g.
|
||||
when using |popup_filter_menu()|, see |popup-callback|.
|
||||
@@ -478,7 +476,7 @@ key, e.g.: >
|
||||
return 1
|
||||
endif
|
||||
return 0
|
||||
endfunc
|
||||
endfunc
|
||||
|
||||
Currently the key is what results after any mapping. This may change...
|
||||
|
||||
@@ -496,7 +494,7 @@ Vim provides standard filters |popup_filter_menu()| and
|
||||
|
||||
Note that "x" is the normal way to close a popup. You may want to use Esc,
|
||||
but since many keys start with an Esc character, there may be a delay before
|
||||
Vim recognizes the Esc key. If you do use Esc, it is reecommended to set the
|
||||
Vim recognizes the Esc key. If you do use Esc, it is recommended to set the
|
||||
'ttimeoutlen' option to 100 and set 'timeout' and/or 'ttimeout'.
|
||||
|
||||
|
||||
|
||||
+7
-3
@@ -1373,6 +1373,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
+scrollbind various.txt /*+scrollbind*
|
||||
+signs various.txt /*+signs*
|
||||
+smartindent various.txt /*+smartindent*
|
||||
+sound various.txt /*+sound*
|
||||
+spell various.txt /*+spell*
|
||||
+startuptime various.txt /*+startuptime*
|
||||
+statusline various.txt /*+statusline*
|
||||
+sun_workshop various.txt /*+sun_workshop*
|
||||
@@ -2843,8 +2845,6 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:pop tagsrch.txt /*:pop*
|
||||
:popu gui.txt /*:popu*
|
||||
:popup gui.txt /*:popup*
|
||||
:popupc popup.txt /*:popupc*
|
||||
:popupclear popup.txt /*:popupclear*
|
||||
:pp windows.txt /*:pp*
|
||||
:ppop windows.txt /*:ppop*
|
||||
:pr various.txt /*:pr*
|
||||
@@ -8350,6 +8350,7 @@ popup-props popup.txt /*popup-props*
|
||||
popup-window popup.txt /*popup-window*
|
||||
popup.txt popup.txt /*popup.txt*
|
||||
popup_atcursor() popup.txt /*popup_atcursor()*
|
||||
popup_clear() popup.txt /*popup_clear()*
|
||||
popup_close() popup.txt /*popup_close()*
|
||||
popup_create() popup.txt /*popup_create()*
|
||||
popup_create-usage popup.txt /*popup_create-usage*
|
||||
@@ -8704,6 +8705,9 @@ script-variable eval.txt /*script-variable*
|
||||
scriptnames-dictionary eval.txt /*scriptnames-dictionary*
|
||||
scriptout-changed version4.txt /*scriptout-changed*
|
||||
scriptversion eval.txt /*scriptversion*
|
||||
scriptversion-1 eval.txt /*scriptversion-1*
|
||||
scriptversion-2 eval.txt /*scriptversion-2*
|
||||
scriptversion-3 eval.txt /*scriptversion-3*
|
||||
scroll-binding scroll.txt /*scroll-binding*
|
||||
scroll-cursor scroll.txt /*scroll-cursor*
|
||||
scroll-down scroll.txt /*scroll-down*
|
||||
@@ -8813,10 +8817,10 @@ slow-terminal term.txt /*slow-terminal*
|
||||
socket-interface channel.txt /*socket-interface*
|
||||
sort() eval.txt /*sort()*
|
||||
sorting change.txt /*sorting*
|
||||
sound_clear() eval.txt /*sound_clear()*
|
||||
sound_playevent() eval.txt /*sound_playevent()*
|
||||
sound_playfile() eval.txt /*sound_playfile()*
|
||||
sound_stop() eval.txt /*sound_stop()*
|
||||
sound_stopall() eval.txt /*sound_stopall()*
|
||||
soundfold() eval.txt /*soundfold()*
|
||||
space intro.txt /*space*
|
||||
spec-customizing pi_spec.txt /*spec-customizing*
|
||||
|
||||
+13
-10
@@ -1,4 +1,4 @@
|
||||
*tagsrch.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
*tagsrch.txt* For Vim version 8.1. Last change: 2019 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -85,18 +85,21 @@ changed, to avoid confusion when using ":tnext". It is changed when using
|
||||
":tag {name}".
|
||||
|
||||
The ignore-case matches are not found for a ":tag" command when:
|
||||
- the 'ignorecase' option is off and 'tagcase' is "followic"
|
||||
- 'tagcase' is "followic" and the 'ignorecase' option is off
|
||||
- 'tagcase' is "followscs" and the 'ignorecase' option is off and the
|
||||
'smartcase' option is off or the pattern contains an upper case character.
|
||||
- 'tagcase' is "match"
|
||||
- 'tagcase' is "smart" and the pattern contains an upper case character.
|
||||
- 'tagcase' is "followscs" and 'smartcase' option is on and the pattern
|
||||
contains an upper case character.
|
||||
|
||||
The ignore-case matches are found when:
|
||||
- a pattern is used (starting with a "/")
|
||||
- for ":tselect"
|
||||
- when 'tagcase' is "followic" and 'ignorecase' is off
|
||||
- when 'tagcase' is "match"
|
||||
- when 'tagcase' is "followscs" and the 'smartcase' option is off
|
||||
- when 'tagcase' is "followic" and 'ignorecase' is on
|
||||
- when 'tagcase' is "followscs" and 'ignorecase' is on or the 'smartcase'
|
||||
option is on and the pattern does not contain an upper case character
|
||||
- when 'tagcase' is "ignore"
|
||||
- when 'tagcase' is "smart" and the patter does not contain an upper case
|
||||
character
|
||||
|
||||
Note that using ignore-case tag searching disables binary searching in the
|
||||
tags file, which causes a slowdown. This can be avoided by fold-case sorting
|
||||
@@ -503,7 +506,7 @@ Some programs that generate tags files:
|
||||
ctags As found on most Unix systems. Only supports C. Only
|
||||
does the basic work.
|
||||
*Exuberant_ctags*
|
||||
exuberant ctags This a very good one. It works for C, C++, Java,
|
||||
exuberant ctags This is a very good one. It works for C, C++, Java,
|
||||
Fortran, Eiffel and others. It can generate tags for
|
||||
many items. See http://ctags.sourceforge.net.
|
||||
etags Connected to Emacs. Supports many languages.
|
||||
@@ -824,7 +827,7 @@ CTRL-W d Open a new window, with the cursor on the first
|
||||
(default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
*:che* *:chec* *:check* *:checkpath*
|
||||
*:che* *:chec* *:check* *:checkpath*
|
||||
:che[ckpath] List all the included files that could not be found.
|
||||
|
||||
:che[ckpath]! List all the included files.
|
||||
@@ -895,7 +898,7 @@ The following fields are optional:
|
||||
If the function returns |v:null| instead of a List, a standard tag lookup will
|
||||
be performed instead.
|
||||
|
||||
It is not allowed to change the tagstack from inside 'tagfunc'. *E986*
|
||||
It is not allowed to change the tagstack from inside 'tagfunc'. *E986*
|
||||
|
||||
The following is a hypothetical example of a function used for 'tagfunc'. It
|
||||
uses the output of |taglist()| to generate the result: a list of tags in the
|
||||
|
||||
+20
-8
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.1. Last change: 2019 Jun 06
|
||||
*todo.txt* For Vim version 8.1. Last change: 2019 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -42,23 +42,22 @@ Ongoing work on text properties, see src/textprop.c
|
||||
|
||||
Popup windows are being implemented, see |popup-window|.
|
||||
|
||||
Listener causes extra } to be inserted. (Paul Jolly, #4455)
|
||||
Include tests:
|
||||
test_assert.vim
|
||||
test_paste.vim
|
||||
shared.vim
|
||||
|
||||
Patch to fix session file when using multiple tabs. (Jason Franklin, 2019 May
|
||||
20)
|
||||
Also put :argadd commands at the start for all buffers, so that their order
|
||||
remains equal? Then %argdel to clean it up. Do try this with 'hidden' set.
|
||||
|
||||
Patch for Chinese translations for nsis. (#4407) Comments handled?
|
||||
|
||||
Patch to add v:searchstat. (Takuya Fujiwara, #4446) Should be independent of
|
||||
'shortmess', filled on demand and cached until search changes.
|
||||
|
||||
listener callback is invoked while another is still busy? (Paul Jolly)
|
||||
Should not happen because of text lock.
|
||||
Listener causes extra } to be inserted. (Paul Jolly, #4455)
|
||||
|
||||
When 'rightleft' is set search pattern is not displayed. (#4488)
|
||||
Caused by 8.1.1375 ?
|
||||
Improvement to Travis config: Ozaki Kiichi, #4521
|
||||
|
||||
'incsearch' with :s: (#3321)
|
||||
- Get E20 when using command history to get "'<,'>s/a/b" and no Visual area
|
||||
@@ -173,8 +172,14 @@ it's in a mapping. (2018 Oct 6, #2302, #3522)
|
||||
Internal diff doesn't handle binary file like external diff does. (Mike
|
||||
Williams, 2018 Oct 30)
|
||||
|
||||
Add "number" to 'signcolumn': Put signs in the number column if it exists.
|
||||
Otherwise behave like "yes". (Adam Stankiewicz, #4515)
|
||||
|
||||
Problem with :tlmenu: Detach item added with all modes? Issue #3563.
|
||||
|
||||
Patch to use timers in matchparen. (Daniel Hahler, #1338)
|
||||
Ready to include now?
|
||||
|
||||
The quoting of the [command] argument of :terminal is not clearly documented.
|
||||
Give a few examples. (#4288)
|
||||
|
||||
@@ -190,10 +195,17 @@ Problem with colors in terminal window. (Jason Franklin, 2019 May 12)
|
||||
Bug: "vipgw" does not put cursor back where it belongs. (Jason Franklin, 2019
|
||||
Mar 5)
|
||||
|
||||
Should we include some part of pull request #4505, not increment changedtick
|
||||
in some cases? E.g. for ":write" when the changed flag was already off, the
|
||||
buffer didn't change at all.
|
||||
|
||||
Patch to add getreginfo() and setreg() with an option to set the unnamed
|
||||
register "", So that registers can be saved and fully restored.
|
||||
(Andy Massimino, 2018 Aug 24, #3370)
|
||||
|
||||
Line numbers in profile are off when function was defined with ":execute".
|
||||
(Daniel Hahler, #4511)
|
||||
|
||||
Add a way to create an empty, hidden buffer. Like doing ":new|hide".
|
||||
":let buf = bufcreate('name')
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*various.txt* For Vim version 8.1. Last change: 2019 Jun 02
|
||||
*various.txt* For Vim version 8.1. Last change: 2019 Jun 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -430,6 +430,8 @@ m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn|
|
||||
T *+scrollbind* |'scrollbind'|
|
||||
B *+signs* |:sign|
|
||||
N *+smartindent* |'smartindent'|
|
||||
B *+sound* |sound_playevent()|, |sound_playfile()| functions, etc.
|
||||
N *+spell* spell checking support, see |spell|
|
||||
N *+startuptime* |--startuptime| argument
|
||||
N *+statusline* Options 'statusline', 'rulerformat' and special
|
||||
formats of 'titlestring' and 'iconstring'
|
||||
|
||||
@@ -4,9 +4,10 @@
|
||||
" Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
|
||||
" Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
|
||||
" Original author: Mario Eusebio
|
||||
" Last Change: Mon Jan 23 2017
|
||||
" added support for cell mode
|
||||
" Last Change: June 10 2019
|
||||
" added highlight rule for double-quoted string literals
|
||||
" Change History:
|
||||
" - double-quoted string literals added
|
||||
" - now highlights cell-mode separator comments
|
||||
" - 'global' and 'persistent' keyword are now recognized
|
||||
|
||||
@@ -40,6 +41,7 @@ syn match matlabLineContinuation "\.\{3}"
|
||||
" String
|
||||
" MT_ADDON - added 'skip' in order to deal with 'tic' escaping sequence
|
||||
syn region matlabString start=+'+ end=+'+ oneline skip=+''+
|
||||
syn region matlabStringArray start=+"+ end=+"+ oneline skip=+""+
|
||||
|
||||
" If you don't like tabs
|
||||
syn match matlabTab "\t"
|
||||
@@ -87,6 +89,7 @@ hi def link matlabExceptions Conditional
|
||||
hi def link matlabRepeat Repeat
|
||||
hi def link matlabTodo Todo
|
||||
hi def link matlabString String
|
||||
hi def link matlabStringArray String
|
||||
hi def link matlabDelimiter Identifier
|
||||
hi def link matlabTransposeOther Identifier
|
||||
hi def link matlabNumber Number
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: TypeScript
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Last Change: 2019 Jun 06
|
||||
" Last Change: 2019 Jun 07
|
||||
" Based On: Herrington Darkholme's yats.vim
|
||||
" Changes: See https:github.com/HerringtonDarkholme/yats.vim
|
||||
" Credits: See yats.vim
|
||||
@@ -791,6 +791,12 @@ if get(g:, 'yats_host_keyword', 1)
|
||||
syntax keyword typescriptNodeGlobal containedin=typescriptIdentifierName clearInterval
|
||||
hi def link typescriptNodeGlobal Structure
|
||||
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName describe it test
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName before after
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName beforeEach afterEach
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName beforeAll afterAll
|
||||
syntax keyword typescriptGlobal containedin=typescriptIdentifierName expect assert
|
||||
|
||||
"runtime syntax/yats/web.vim
|
||||
syntax keyword typescriptBOM containedin=typescriptIdentifierName AbortController
|
||||
syntax keyword typescriptBOM containedin=typescriptIdentifierName AbstractWorker AnalyserNode
|
||||
|
||||
@@ -0,0 +1,968 @@
|
||||
===============================================================================
|
||||
= 빔 길잡이 (VIM Tutor) 에 오신 것을 환영합니다 - Version 1.7 =
|
||||
===============================================================================
|
||||
|
||||
빔(Vim)은 이 길잡이에서 다 설명할 수 없을 만큼 많은 명령을 가진
|
||||
매우 강력한 편집기입니다. 이 길잡이는 빔을 쉽게 전천후 편집기로 사용할
|
||||
수 있도록 충분한 명령에 대해 설명하고 있습니다.
|
||||
|
||||
이 길잡이를 떼는 데에는 실습하는 데에 얼마나 시간을 쓰는 가에 따라서
|
||||
25-30 분 정도가 걸립니다.
|
||||
|
||||
이 연습에 포함된 명령은 내용을 고칩니다. 이 파일의 복사본을 만들어서
|
||||
연습하세요. (vimtutor 를 통해 시작했다면, 이미 복사본을 사용하는
|
||||
중입니다.)
|
||||
|
||||
중요한 것은, 이 길잡이가 직접 써보면서 배우도록 고려되어 있다는 것입니다.
|
||||
명령을 제대로 익히려면, 직접 실행해보는 것이 필요합니다. 내용을 읽는
|
||||
것만으로는, 명령을 잊어버리게 될 것입니다.
|
||||
|
||||
자 이제, Caps Lock(Shift-Lock) 키가 눌려있지 않은지 확인해보시고, j 키를
|
||||
충분히 눌러서 Lesson 1.1이 화면에 가득 차도록 움직여봅시다.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.1: 커서 움직이기
|
||||
|
||||
** 커서를 움직이려면, 표시된 대로 h,j,k,l 키를 누르십시오. **
|
||||
^
|
||||
k 힌트: h 키는 왼쪽에 있으며, 왼쪽으로 움직입니다.
|
||||
< h l > l 키는 오른쪽에 있으며, 오른쪽으로
|
||||
j 움직입니다.
|
||||
v j 키는 아래방향 화살표처럼 생겼습니다.
|
||||
|
||||
1. 익숙해질 때까지 커서를 스크린 상에서 움직여 보십시오.
|
||||
|
||||
2. 아래 방향키 (j)를 반복입력이 될 때까지 누르고 계십시오.
|
||||
이제 다음 lesson으로 가는 방법을 알게 되었습니다.
|
||||
|
||||
3. 아래 방향키를 이용하여, Lesson 1.2 로 가십시오.
|
||||
|
||||
참고: 원하지 않는 무언가가 입력이 되었다면, <ESC>를 눌러서, 명령 모드로
|
||||
돌아가십시오. 그 후에 원하는 명령을 다시 입력하십시오.
|
||||
|
||||
참고: 커서키 또한 작동할 것입니다. 하지만 hjkl에 익숙해지면, 커서키보다
|
||||
훨씬 빠르게 이동할 수 있을 것입니다. 정말요!
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.2: 빔을 시작하고 끝내기
|
||||
|
||||
|
||||
!! 주의: 아래 있는 단계를 실행하기 전에, 이 lesson 전체를 읽으십시오!!
|
||||
|
||||
1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
|
||||
|
||||
2. 다음과 같이 입력합니다: :q! <ENTER>
|
||||
이렇게 하면, 바뀐 내용을 *저장하지 않고* 편집기를 빠져나갑니다.
|
||||
|
||||
3. 쉘 프롬프트가 보인다면, 다시 길잡이로 돌아오기 위해 다음과 같이
|
||||
입력합니다.
|
||||
vimtutor <ENTER>
|
||||
또는 다음과 같을 수도 있습니다.
|
||||
vim tutor.ko <ENTER>
|
||||
|
||||
---> 'vim' 은 빔 편집기로 들어가는 것을 뜻하며, 'tutor.ko'는 편집하려는
|
||||
파일을 뜻합니다.
|
||||
|
||||
4. 위에서 이야기한 단계를 기억하였으며, 확신이 서면, 1에서 3까지를
|
||||
수행하여 편집기를 나갔다가 다시 들어와 보십시오.
|
||||
|
||||
주의: :q! <ENTER> 는 바뀐 내용을 저장하지 않습니다. 이 후 lesson에서
|
||||
어떻게 편집 내용을 저장하는지 배울 수 있습니다.
|
||||
|
||||
5. 그 후 커서를 아래로 움직여 Lesson 1.3 으로 가십시오.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.3: 텍스트 편집 - 지우기
|
||||
|
||||
|
||||
** 명령 모드에서 x 를 누르면 커서가 위치한 곳의 글자를 지울 수 있습니다. **
|
||||
|
||||
1. ----> 로 표시된 곳으로 커서를 옮겨보십시오.
|
||||
|
||||
2. 오타를 수정하기 위해, 커서를 지울 글자 위로 움직여 보십시오.
|
||||
|
||||
3. x 키를 눌러서 지워야할 글자를 지우십시오.
|
||||
|
||||
4. 2에서 4까지를 반복하여 문장이 올바르게 되도록 하여 보십시오.
|
||||
|
||||
---> The ccow jumpedd ovverr thhe mooon.
|
||||
|
||||
5. 문장이 정확해졌다면, Lesson 1.4로 가십시오.
|
||||
|
||||
주의: 이 길잡이를 보면서 외우려고 하지말고, 직접 사용해보면서 익히길
|
||||
바랍니다.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.4: 텍스트 편집 - 삽입 (INSERTION)
|
||||
|
||||
|
||||
** 명령 모드에서 i 를 누르면 텍스트를 입력할 수 있습니다. **
|
||||
|
||||
1. 커서를 첫번째 ---> 로 표시된 줄로 움직입니다.
|
||||
|
||||
2. 첫번째 줄을 두번째 줄과 똑같이 만들것입니다. 텍스트가 들어가야할
|
||||
곳 다음부터 첫번째 글자 위에 커서를 옮겨 놓습니다.
|
||||
|
||||
3. i 키를 누른 후, 필요한 내용을 입력합니다.
|
||||
|
||||
4. 수정한 후에는 <ESC> 를 눌러서 명령 모드로 돌아갑니다.
|
||||
문장을 올바르게 만들기 위해 2에서 4의 과정을 반복합니다.
|
||||
|
||||
---> There is text misng this .
|
||||
---> There is some text missing from this line.
|
||||
|
||||
5. 텍스트를 삽입하는 데에 익숙해졌다면, Lesson 1.5로 가십시오.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.5: 택스트 편집 - 추가 (APPENDING)
|
||||
|
||||
|
||||
** A 를 입력해 텍스트를 추가할 수 있습니다. **
|
||||
|
||||
1. 커서를 첫번째 ---> 로 표시된 줄로 움직입니다.
|
||||
커서가 문장 내 어디에 있던 상관없습니다.
|
||||
|
||||
2. A 키를 눌러 필요한 내용을 입력합니다.
|
||||
|
||||
3. 내용을 모두 입력한 후 <ESC>를 눌러 명령 모드로 돌아갑니다.
|
||||
|
||||
4. 커서를 두번째 ---> 로 표시된 줄로 움직입니다.
|
||||
문장을 올바르게 만들기 위해 2에서 3의 과정을 반복합니다.
|
||||
|
||||
---> There is some text missing from th
|
||||
There is some text missing from this line.
|
||||
---> There is also some text miss
|
||||
There is also some text missing here.
|
||||
|
||||
5. 텍스트를 추가하는 데 익숙해졌다면, Lesson 1.6으로 가십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.6: 파일 편집
|
||||
|
||||
** :wq 를 이용하여 파일을 저장하고 빠져나갈 수 있습니다. **
|
||||
|
||||
!! 주의: 아래 있는 단계를 실행하기 전에, 이 lesson 전체를 읽으십시오!!
|
||||
|
||||
1. lesson 1.2에서 배웠던 것처럼 :q!로 편집기를 나갈 수 있습니다.
|
||||
만약, 다른 터미널에 접근 가능하다면, 아래의 단계를 다른 터미널에서 해봅니다.
|
||||
|
||||
2. 쉘 프롬프트에 다음과 같이 입력합니다: vim tutor <ENTER>
|
||||
'vim' 은 빔 에디터 시작을 위한 명령어, 'tutor'는 수정하고자 하는
|
||||
파일의 이름 입니다.
|
||||
|
||||
3. 앞에서 배웠던 것처럼 텍스트를 삽입하고 지워보세요.
|
||||
|
||||
4. 다음 명령어를 이용해 파일 수정 부분을 저장하고 빠져나갑니다: :wq <ENTER>
|
||||
|
||||
5. 만약 1에서 vimtutor를 빠져나갔다가 다시 들어왔다면, 아래로 움직여 요약으로 넘어가도록 합시다.
|
||||
|
||||
6. 위 모든 단계를 다 읽고 이해한 후에 직접 해보세요.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 1 요약
|
||||
|
||||
|
||||
1. 커서를 움직일 때에는 화살표 키나 hjkl 키를 이용합니다.
|
||||
h (왼쪽) j (아래) k (위) l (오른쪽)
|
||||
|
||||
2. 쉘 프롬프트에서 빔을 시작하려면 vim FILENAME <ENTER>
|
||||
|
||||
3. 수정한 내용을 무시한 채로 빔에서 빠져나가려면 <ESC> :q! <ENTER>
|
||||
저장한 후 빔에서 빠져나가려면 <ESC> :wq <ENTER>
|
||||
|
||||
4. 명령 모드에서 커서가 위치한 곳의 글자를 지우려면 x 를 입력합니다.
|
||||
|
||||
5. 명령 모드에서 커서가 위치한 곳에 텍스트를 삽입하려면
|
||||
i 를 누른 후 텍스트를 입력하고 <ESC> 커서 앞에 삽입합니다.
|
||||
A 를 누른 후 텍스트를 입력하고 <ESC> 문장 뒤에 추가 합니다.
|
||||
|
||||
참고: <ESC>는 명령 모드로 돌아가는 데 쓰며, 원치 않는 명령이나 완전히 입력되지
|
||||
않은 명령을 취소하는 데에도 씁니다.
|
||||
|
||||
그럼 Lesson 2를 시작합시다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.1: 삭제(DELETION) 명령
|
||||
|
||||
|
||||
** 한 단어를 끝까지 지우려면 dw 라고 치면 됩니다. **
|
||||
|
||||
1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
|
||||
|
||||
2. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다.
|
||||
|
||||
3. 지워야할 단어의 처음으로 커서를 옮깁니다.
|
||||
|
||||
4. dw 라고 쳐서 그 단어를 지웁니다.
|
||||
|
||||
주의: 위에서 말한대로 하면 화면의 마지막 줄에 dw 라는 글자가 표시됩니다.
|
||||
잘못 쳤다면, <ESC> 를 눌러서 다시 시작하십시오.
|
||||
|
||||
---> There are a some words fun that don't belong paper in this sentence.
|
||||
|
||||
5. 3, 4번 과정을 다시 하여 문장을 정확하게 만든 뒤 Lesson 2.2로 가십시오.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.2: 다른 삭제 명령
|
||||
|
||||
** d$ 라고 치면 그 줄 끝까지 지워집니다. **
|
||||
|
||||
1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
|
||||
|
||||
2. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다.
|
||||
|
||||
3. 올바른 줄의 끝으로 커서를 옮깁니다. (첫번째로 나오는 . 다음입니다.)
|
||||
|
||||
4. d$ 라고 쳐서 줄 끝까지 지웁니다.
|
||||
|
||||
---> Somebody typed the end of this line twice. end of this line twice.
|
||||
|
||||
|
||||
5. 어떤 일이 일어났는지 이해하기 위해 Lesson 2.3 으로 가십시오.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.3: 명령과 적용 대상에 대해
|
||||
|
||||
|
||||
삭제 명령 d의 형식은 다음과 같습니다.
|
||||
|
||||
d 대상
|
||||
|
||||
여기서:
|
||||
d - 지우는 명령
|
||||
대상 - 아래에 제시된 대상에 대해 명령을 수행
|
||||
|
||||
적용 가능한 대상의 종류:
|
||||
w - 커서에서 그 단어의 끝까지 (공백 포함.)
|
||||
e - 커서에서 그 단어의 끝까지 (공백을 포함하지 않음.)
|
||||
$ - 커서에서 그 줄의 끝까지
|
||||
|
||||
예를 들어, de 는 커서의 위치부터 해당 단어의 끝까지 지웁니다.
|
||||
|
||||
참고: 호기심이 있다면, 명령 모드에서 명령 없이 대상을 입력해보십시오.
|
||||
위에서 이야기한 대상의 목록에 따라 커서가 움직이게 됩니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.4: 대상에 반복 적용하기
|
||||
|
||||
|
||||
** 대상 이전에 숫자를 넣어주면 그 만큼 반복 됩니다. **
|
||||
|
||||
1. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다.
|
||||
|
||||
2. 2w 입력하여 커서를 단어 두 개 뒤로 옮깁니다.
|
||||
|
||||
3. 3e 입력하여 커서를 뒤로 세 번째 단어의 끝으로 옮깁니다.
|
||||
|
||||
4. 0 (zero) 를 입력하여 문장의 시작부분으로 움직입니다.
|
||||
|
||||
5. 2에서 3까지를 다른 숫자로 반복해 봅니다.
|
||||
|
||||
---> This is just a line with words you can move around in.
|
||||
|
||||
6. Lesson 2.5로 가십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.5: 삭제에 반복 적용하기
|
||||
|
||||
|
||||
** 명령과 숫자를 함께 사용하면 그만큼 반복 수행 됩니다. **
|
||||
|
||||
위에서 삭제 명령과 대상의 조합과 같이, 대상 이전에 횟수를 넣어 더 많이 삭제 할 수 있습니다:
|
||||
d 횟수 대상
|
||||
|
||||
1. 아래 ---> 표시된 줄에서 커서를 첫번째 대문자 단어로 옮깁니다.
|
||||
|
||||
2. d2w를 입력하여 두 대문자 단어를 지웁니다.
|
||||
|
||||
3. 이어지는 대문자 단어들을 1에서 2까지의 단계를 이용해 횟수를 바꾸어 삭제해 봅니다.
|
||||
|
||||
---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.6: 줄 전체 조작하기
|
||||
|
||||
|
||||
|
||||
** dd 라고 치면 줄 전체를 지웁니다. **
|
||||
|
||||
줄 전체를 지우는 일이 잦기 때문에, Vi를 디자인 한 사람들은, 간단히 d를
|
||||
두번 연달아 치면 한 줄을 지울 수 있도록 하였습니다.
|
||||
|
||||
1. 커서를 아래 나온 단락의 두번째 줄로 가져가십시오.
|
||||
2. dd 를 입력하여 그 줄을 지우십시오.
|
||||
3. 그런 다음 네번째 줄로 가십시오.
|
||||
4. 2dd 라고 입력하여 두줄을 지웁니다. ( 횟수-명령-대상을 기억하세요. )
|
||||
|
||||
---> 1) Roses are red,
|
||||
---> 2) Mud is fun,
|
||||
---> 3) Violets are blue,
|
||||
---> 4) I have a car,
|
||||
---> 5) Clocks tell time,
|
||||
---> 6) Sugar is sweet
|
||||
---> 7) And so are you.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.7: 취소(UNDO) 명령
|
||||
|
||||
|
||||
** u 를 누르면 마지막 명령이 취소되며, U 는 줄 전체를 수정합니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 줄로 이동한 후 첫번째 잘못된 부분 위로 옮깁니다.
|
||||
2. x 를 입력하여 첫번째 잘못된 글자를 지웁니다.
|
||||
3. 그럼 이제 u 를 입력하여 마지막으로 수행된 명령을 취소합니다.
|
||||
4. 이번에는 x 명령을 이용하여 그 줄의 모든 에러를 수정해봅시다.
|
||||
5. 대문자 U 를 눌러서 그 줄을 원래 상태로 돌려놓아 보십시오.
|
||||
6. 이번에는 u 를 몇 번 눌러서 U 와 이전 명령을 취소해봅시다.
|
||||
7. CTRL-R (CTRL 키를 누른 상태에서 R을 누르는 것) 을 몇 번 눌러서
|
||||
명령을 다시 실행해봅시다. (취소한 것을 취소함.)
|
||||
|
||||
---> Fiix the errors oon thhis line and reeplace them witth undo.
|
||||
|
||||
8. 이 명령은 매우 유용합니다. 그럼 Lesson 2 요약으로 넘어가도록 합시다.
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 2 요약
|
||||
|
||||
|
||||
1. 커서가 위치한 곳부터 단어의 끝까지 지우려면: dw
|
||||
2. 커서가 위치한 곳부터 줄 끝까지 지우려면: d$
|
||||
3. 줄 전체를 지우려면: dd
|
||||
|
||||
4. 횟수와 함께 대상을 반복 시키려면: 2w
|
||||
5. 명령 모드에서 내리는 명령의 형식은 다음과 같습니다:
|
||||
|
||||
[횟수] 명령 대상 또는 명령 [횟수] 대상
|
||||
|
||||
여기서:
|
||||
횟수 - 그 명령을 몇 번 반복할 것인가
|
||||
명령 - 어떤 명령을 내릴 것인가 ( 예를 들어, 삭제인 경우는 d )
|
||||
대상 - 명령이 동작할 대상, 예를 들어 w (단어), $ (줄의 끝) 등.
|
||||
|
||||
6. 커서를 문장 맨 앞으로 옮기려면: 0
|
||||
|
||||
7. 이전 행동을 취소하려면: u (소문자 u)
|
||||
한 줄에서 수정한 것을 모두 취소하려면: U (대문자 U)
|
||||
취소한 것을 다시 실행하려면: CTRL-R
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.1: 붙이기(PUT) 명령
|
||||
|
||||
|
||||
** p 를 입력하여 마지막으로 지운 내용을 커서 뒤에 붙입니다. **
|
||||
|
||||
1. 아래에 있는 문단의 첫 줄로 커서를 움직이십시오.
|
||||
|
||||
2. dd 를 입력하여 그 줄을 지워서 빔의 버퍼에 저장합니다.
|
||||
|
||||
3. 아까 지운 줄이 가야할 위치의 *윗줄로* 커서를 옮깁니다.
|
||||
|
||||
4. 명령 모드에서, p 를 입력하여 그 줄을 제대로 된 자리로 옮깁니다.
|
||||
|
||||
5. 2에서 4를 반복하여 모든 줄의 순서를 바로 잡으십시오.
|
||||
|
||||
d) Can you learn too?
|
||||
b) Violets are blue,
|
||||
c) Intelligence is learned,
|
||||
a) Roses are red,
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.2: 치환(REPLACE) 명령
|
||||
|
||||
|
||||
** 커서 아래의 글자 하나를 바꾸려면, r 을 누른 후 바꿀 글자를 입력합니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫 줄로 옮깁니다.
|
||||
|
||||
2. 커서를 잘못된 첫 부분으로 옮깁니다.
|
||||
|
||||
3. r 을 누른 후, 잘못된 부분을 고쳐 쓸 글자를 입력합니다.
|
||||
|
||||
4. 2에서 3의 과정을 반복하여, 첫 줄의 오류를 수정하십시오.
|
||||
|
||||
---> Whan this lime was tuoed in, someone presswd some wrojg keys!
|
||||
---> When this line was typed in, someone pressed some wrong keys!
|
||||
|
||||
5. Lesson 3.2 로 이동합시다.
|
||||
|
||||
주의: 외우지 말고, 직접 해보면서 익혀야 한다는 것을 잊지 마십시오.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.3: 변환(CHANGE) 명령
|
||||
|
||||
|
||||
** 한 단어의 전체를 바꾸려면, ce 를 치십시오. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫줄로 옮깁니다.
|
||||
|
||||
2. 커서를 lubw 에서 u 위에 올려놓습니다.
|
||||
|
||||
3. ce 라고 명령한 후 단어를 정확하게 수정합니다. (이 경우, 'ine' 를 칩니다.)
|
||||
|
||||
4. <ESC> 를 누른 후 다음 에러로 갑니다 (수정되어야할 첫 글자로 갑니다.)
|
||||
|
||||
5. 3에서 4의 과정을 반복하여 첫번째 문장을 두번째 문장과 같도록 만듭니다.
|
||||
|
||||
---> This lubw has a few wptfd that mrrf changing usf the change command.
|
||||
---> This line has a few words that need changing using the change command.
|
||||
|
||||
ce 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있도록 한다는 것에
|
||||
유의합시다.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 3.4: c 를 이용한 다른 변환 명령
|
||||
|
||||
|
||||
** 변환 명령은 삭제할 때 이용한 대상에 대해 적용할 수 있습니다. **
|
||||
|
||||
1. 변환 명령은 삭제와 동일한 방식으로 동작합니다. 형식은 다음과 같습니다:
|
||||
|
||||
[횟수] c 대상 또는 c [횟수] 대상
|
||||
|
||||
2. 적용 가능한 대상 역시 같습니다. w (단어), $ (줄의 끝) 등이 있습니다.
|
||||
|
||||
3. ---> 로 표시된 첫줄로 이동합니다.
|
||||
|
||||
4. 첫 에러 위로 커서를 옮깁니다.
|
||||
|
||||
5. c$ 를 입력하여, 그 줄의 나머지가 두번째 줄처럼 되도록 수정한 후 <ESC> 를
|
||||
누르십시오.
|
||||
|
||||
---> The end of this line needs some help to make it like the second.
|
||||
---> The end of this line needs to be corrected using the c$ command.
|
||||
|
||||
참고: 입력하는 동안은 백스페이스를 이용할 수 있습니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 3 요약
|
||||
|
||||
|
||||
1. 이미 지운 내용을 되돌리려면, p 를 누르십시오. 이 명령은 커서 *다음에*
|
||||
지워진 내용을 붙입니다(PUT). (한 줄을 지운 경우에는 커서 다음 줄에
|
||||
지워진 내용이 붙습니다.)
|
||||
|
||||
2. 커서 아래의 글자를 치환하려면(REPLACE), r 을 누른 후 원래 글자 대신
|
||||
바꾸어 넣을 글자를 입력합니다.
|
||||
|
||||
3. 변환 명령(CHANGE)은 커서에서 부터 지정한 대상의 끝까지 바꿀 수 있는
|
||||
명령입니다. 예를 들어, 커서 위치에서 단어의 끝까지 바꾸려면 ce 를
|
||||
입력하면 되며, c$ 는 줄 끝까지 바꾸는 데 쓰입니다.
|
||||
|
||||
4. 변환 명령의 형식은 다음과 같습니다:
|
||||
|
||||
[횟수] c 대상 또는 c [횟수] 대상
|
||||
|
||||
계속해서 다음 Lesson 을 진행합시다.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.1: 위치와 파일의 상태
|
||||
|
||||
|
||||
** CTRL-G 를 누르면 파일 내에서의 현재 위치와 파일의 상태를 볼 수 있습니다.
|
||||
G 를 누르면 파일 내의 마지막 줄로 이동합니다. **
|
||||
|
||||
주의: 아래의 단계를 따라하기 전에, 이 Lesson 전체를 먼저 읽으십시오.
|
||||
|
||||
1. CTRL 키를 누른 상태에서 g 를 누릅니다. 파일 이름과 현재 위치한 줄이
|
||||
표시된 상태줄이 화면 아래에 표시될 것입니다. 3번째 단계를 위해 그
|
||||
줄 번호를 기억하고 계십시오.
|
||||
|
||||
참고: 커서가 화면 오른쪽 하단으로 옮겨진 것을 보인다면,
|
||||
이는 'ruler' 옵션을 세팅된 경우 입니다. (:help 'ruler' 를 참고 하세요.)
|
||||
|
||||
2. G 를 누르면 파일의 마지막으로 이동합니다.
|
||||
gg 를 누르면 파일의 시작 부분으로 이동합니다.
|
||||
|
||||
3. 아까 기억했던 줄 번호를 입력한 후 G 를 누르십시오. 이렇게 하면
|
||||
처음에 CTRL-G 를 눌렀던 장소로 되돌아가게 될 것입니다.
|
||||
(번호를 입력할 때, 이것은 화면에 표시되지 않습니다.)
|
||||
|
||||
4. 자신이 생겼다면, 1에서 3까지를 실행해보십시오.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.2: 찾기 명령
|
||||
|
||||
|
||||
** / 를 누른 후 검색할 문구를 입력하십시오. **
|
||||
|
||||
1. 명령 모드에서 / 를 입력하십시오. : 명령에서와 마찬가지로, 화면 아래에
|
||||
/ 와 커서가 표시될 것입니다.
|
||||
|
||||
2. 'errroor' 라고 친 후 <ENTER> 를 치십시오. 이 단어를 찾으려고 합니다.
|
||||
|
||||
3. 같은 문구를 다시 찾으려면, 간단히 n 을 입력하십시오.
|
||||
같은 문구를 반대 방향으로 찾으려면, Shift-N 을 입력하십시오.
|
||||
|
||||
4. 문구를 역방향으로 찾으려면, / 대신 ? 를 이용하면 됩니다.
|
||||
|
||||
5. 원래 있던 곳으로 돌아가기 위해서는 CTRL-O 를 이용하면 됩니다. 반복하면 더 이전으로도
|
||||
갈 수 있습니다. CTRL-I 로 다시 뒤로 갈 수도 있습니다.
|
||||
|
||||
---> "errroor" is not the way to spell error; errroor is an error.
|
||||
|
||||
참고: 찾는 중에 파일의 끝에 다다르게 되면, 파일의 처음부터 다시 찾게 됩니다.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.3: 괄호의 짝 찾기
|
||||
|
||||
|
||||
** % 를 눌러서 ), ], } 의 짝을 찾습니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 줄의 (, [, { 중 하나에 가져다 놓습니다.
|
||||
|
||||
2. % 를 입력해 봅시다.
|
||||
|
||||
3. 커서가 짝이 맞는 괄호로 이동할 것입니다.
|
||||
|
||||
4. % 를 입력하여, 이전 괄호로 되돌아 옵시다.
|
||||
|
||||
5. 커서를 다른 (,),[,],{ 혹은 } 로 움직여 % 를 입력해 봅니다.
|
||||
|
||||
---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
|
||||
|
||||
참고: 짝이 맞지 않는 괄호가 있는 프로그램을 디버깅할 때에 매우 유용합니다!
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.4: 치환(SUBTITUTE) 명령
|
||||
|
||||
|
||||
** :s/old/new/g 하면 'old' 를 'new' 로 치환(SUBTITUTE)합니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 줄에 가져다 놓습니다.
|
||||
|
||||
2. :s/thee/the 를 입력한 후 <ENTER> 를 칩니다. 이 명령은 그 줄에서
|
||||
처음으로 발견된 것만 바꾼다는 것에 주의하십시오.
|
||||
|
||||
3. 이번에는 :s/thee/the/g 를 입력합니다. 이는 그 줄 전체(globally)를
|
||||
치환한다는 것을 의미합니다.
|
||||
|
||||
---> thee best time to see thee flowers is in thee spring.
|
||||
|
||||
4. 두 줄 사이의 모든 문자열에 대해 치환하려면 다음과 같이 합니다,
|
||||
:#,#s/old/new/g #,# 는 두 줄의 줄번호를 뜻합니다.
|
||||
:%s/old/new/g 파일 전체에서 발견된 모든 것을 치환하는 경우입니다.
|
||||
:%s/old/new/gc 파일 전체에서 발견된 모든 것을 찾고, 치환할지 안
|
||||
할지 프롬프트로 명령합니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 4 요약
|
||||
|
||||
1. CTRL-G 파일의 상태와 파일 내에서의 현재 위치를 표시합니다.
|
||||
G 파일의 끝으로 이동합니다.
|
||||
숫자 G 해당 줄로 이동합니다.
|
||||
gg 첫 번째 라인으로 이동합니다.
|
||||
|
||||
2. / 를 입력한 후 문구를 입력하면 그 문구를 아랫방향으로 찾습니다.
|
||||
? 를 입력한 후 문구를 입력하면 윗방향으로 찾습니다.
|
||||
검색 후, n 을 입력하면 같은 방향으로 다음 문구를 찾으며,
|
||||
Shift-N 을 입력하면 반대 방향으로 찾습니다.
|
||||
CTRL-O 는 과거의 위치로, CTRL-I는 새로운 위치로 옮겨줍니다.
|
||||
|
||||
3. 커서가 (,),[,],{,} 위에 있을 때에 % 를 입력하면 상응하는 짝을
|
||||
찾아갑니다.
|
||||
|
||||
4. 어떤 줄에 처음 등장하는 old를 new로 바꾸려면 :s/old/new
|
||||
한 줄에 등장하는 모든 old를 new로 바꾸려면 :s/old/new/g
|
||||
두 줄 #,# 사이에서 치환을 하려면 :#,#s/old/new/g
|
||||
파일 내의 모든 문구를 치환하려면 :%s/old/new/g
|
||||
바꿀 때마다 확인을 거치려면 'c'를 붙여서 :%s/old/new/gc
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.1: 외부 명령 실행하는 방법
|
||||
|
||||
|
||||
** :! 을 입력한 후 실행하려는 명령을 입력하십시오. **
|
||||
|
||||
1. 친숙한 명령인 : 를 입력하면 커서가 화면 아래로 이동합니다. 명령을
|
||||
입력할 수 있게 됩니다.
|
||||
|
||||
2. 이제 ! (느낌표) 를 입력하십시오. 이렇게 하면 외부 쉘 명령을 실행할
|
||||
수 있습니다.
|
||||
|
||||
3. 시험삼아 ! 다음에 ls 를 입력한 후 <ENTER> 를 쳐보십시오. 쉘 프롬프트
|
||||
에서처럼 디렉토리의 목록이 출력될 것입니다. ls 가 동작하지 않는다면
|
||||
:!dir 을 시도해 보십시오.
|
||||
|
||||
참고: 어떤 외부 명령도 이 방법으로 실행할 수 있습니다.
|
||||
|
||||
참고: 모든 : 명령은 <ENTER> 를 쳐야 마무리 됩니다.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.2: 보다 자세한 파일 저장
|
||||
|
||||
|
||||
** 수정된 내용을 파일로 저장하려면, :w FILENAME 하십시오. **
|
||||
|
||||
1. :!dir 또는 :!ls 를 입력하여 디렉토리의 리스트를 얻어옵니다.
|
||||
위의 명령 후 <ENTER>를 쳐야한다는 것은 이미 알고 있을 것입니다.
|
||||
|
||||
2. TEST 처럼 존재하지 않는 파일 이름을 하나 고르십시오.
|
||||
|
||||
3. 이제 :w TEST 라고 입력하십시오. (TEST는 당신이 선택한 파일 이름입니다.)
|
||||
|
||||
4. 이렇게 하면 빔 길잡이 파일 전체를 TEST라는 이름으로 저장합니다.
|
||||
확인하려면, :!dir 을 다시 입력하여, 디렉토리를 살펴보십시오.
|
||||
|
||||
참고: 빔을 종료한 후, 빔을 다시 실행하여 TEST라는 파일을 열면, 그 파일은
|
||||
저장했을 때와 완벽히 같은 복사본일 것입니다.
|
||||
|
||||
5. 이제 그 파일을 지웁시다.
|
||||
(MS-DOS에서): !del TEST
|
||||
(Unix에서): !rm TEST
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.3: 선택적으로 저장하는 명령
|
||||
|
||||
** 파일의 일부를 저장하려면, v 대상 :w FILENAME 을 입력합니다. **
|
||||
|
||||
1. 이 줄로 커서를 가져옵니다.
|
||||
|
||||
2. v 를 누르고 커서를 아래 다섯번째로 옮깁니다. 이 때, 문자열들이 하이라이트 됨을 주목합니다.
|
||||
|
||||
3. : 를 누릅니다. 화면 하단에 :'<,'> 가 나타납니다.
|
||||
|
||||
4. w TEST 를 입력합니다. 여기서 TEST는 파일 이름이며 아직 생성되어 있지 않습니다. <ENTER>를
|
||||
누르기 전, :'<,'>w TEST 로 입력되었는지 확인 합니다.
|
||||
|
||||
5. 빔은 선택된 문장들을 TEST 파일에 입력합니다. :!dir 혹은 :!ls를 이용하여 파일이 만들어졌는지
|
||||
확인하십시오. 아직 삭제하지 마십시오! 다음 레슨에서 이 파일을 사용합니다.
|
||||
|
||||
참고 : v 를 눌러 비주얼(Visual) 선택을 시작합니다. 커서를 주변으로 움직여 선택 부분을 조절할 수
|
||||
있습니다. 그리고 명령어를 이용해 해당 문자열을 조작할 수 있습니다. 예를 들어, d 를 이용해
|
||||
삭제할 수도 있습니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.4: 파일 읽어들이기, 합치기
|
||||
|
||||
|
||||
** 어떤 파일의 내용을 삽입하려면, :r FILENAME 하십시오 **
|
||||
|
||||
1. 커서를 이 라인 바로 위로 옮기십시오.
|
||||
|
||||
주의: 3번째 단계를 실행하면, Lesson 5.3 을 보게 될 것입니다. 그렇게 되면
|
||||
이 lesson으로 다시 내려오십시오.
|
||||
|
||||
2. 이제 TEST 파일을 읽어들입시다. :r TEST 명령을 사용하십시오. TEST 는
|
||||
파일의 이름입니다. 읽어들인 파일은 커서가 위치한 문장 아래부터 놓이게 됩니다.
|
||||
|
||||
3. 파일이 읽어들여진 것을 확인하기 위해, 뒤로 이동해서 기존 버전과 파일에서
|
||||
읽어들인 버전, 이렇게 Lesson 5.3 이 두번 반복되었음을 확인하십시오.
|
||||
|
||||
참고: 외부 명령어의 결과값도 읽을 수 있습니다. 예를 들어, :r !ls 는 ls 명령어에 대한 결과값을
|
||||
읽어 커서 바로 아래에 합칩니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 5 요약
|
||||
|
||||
|
||||
1. :!command 를 이용하여 외부 명령을 실행합니다.
|
||||
|
||||
유용한 예:
|
||||
(MS-DOS) (Unix)
|
||||
:!dir :!ls - 디렉토리의 목록을 보여준다.
|
||||
:!del FILENAME :!rm FILENAME - FILENAME이라는 파일을 지운다.
|
||||
|
||||
2. :w FILENAME 하면 현재 빔에서 사용하는 파일을 FILENAME이라는 이름으로
|
||||
디스크에 저장합니다.
|
||||
|
||||
3. v 명령 :w FILENAME 은 비주얼 모드에서 선택된 문장들을 파일 FILENAME에 저장합니다.
|
||||
|
||||
4. :r FILENAME 은 디스크에서 FILENAME이라는 파일을 불러들여서 커서 위치
|
||||
뒤에 현재 파일을 집어넣습니다.
|
||||
|
||||
5. :r !dir 는 dir 명령어의 결과값을 현재 커서의 위치 아래에 붙힙니다.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.1: 새 줄 열기(OPEN) 명령
|
||||
|
||||
|
||||
** o 를 누르면 커서 아래에 줄을 만들고 편집 모드가 됩니다. **
|
||||
|
||||
1. 아래에 ---> 로 표시된 줄로 커서를 옮기십시오.
|
||||
|
||||
2. o (소문자)를 쳐서 커서 *아래에* 줄을 하나 여십시오. 편집 모드가 됩니다.
|
||||
|
||||
3. ---> 로 표시된 줄을 복사한 후 <ESC> 를 눌러서 편집 모드에서 나오십시오.
|
||||
|
||||
---> After typing o the cursor is placed on the open line in Insert mode.
|
||||
|
||||
4. 커서 *위에* 줄을 하나 만드려면, 소문자 o 대신 대문자 O 를 치면 됩니다.
|
||||
아래 있는 줄에 대해 이 명령을 내려보십시오.
|
||||
|
||||
---> Open up a line above this by typing O while the cursor is on this line.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.2: 추가(APPEND) 명령
|
||||
|
||||
|
||||
** a 를 누르면 커서 *다음에* 글을 입력할 수 있습니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫번째 줄의 끝으로 옮깁니다.
|
||||
|
||||
2. e 를 눌러 li 의 끝으로 커서를 옮깁니다.
|
||||
|
||||
3. 소문자 a 를 커서 아래 글자 *다음*에 글을 추가할 수 있습니다.
|
||||
|
||||
4. 아랫줄과 같이 문장을 완성해 봅니다. <ESC>를 이용해 편집(Insert) 모드를 나갑니다.
|
||||
|
||||
5. e 를 이용해 다음 고칠 단어로 움직여 3에서 4까지를 반복합니다.
|
||||
|
||||
참고: 그렇게 하시면 고작 줄의 끝에 추가를 하기 위해 i를 누르고, 커서 아래에
|
||||
있던 글자를 반복하고, 글을 끼워넣고, <ESC>를 눌러 명령 모드로 돌아와서,
|
||||
커서를 오른쪽으로 옮기고 마지막으로 x까지 눌러야 하는 번거로움을 피하실
|
||||
수 있습니다.
|
||||
|
||||
3. 이제 첫 줄을 완성하십시오. 추가 명령은 텍스트가 입력되는 위치 외에는
|
||||
편집 모드와 완전히 같다는 것을 유념하십시오.
|
||||
|
||||
---> This li will allow you to pract appendi text to a line.
|
||||
---> This line will allow you to practice appending text to a line.
|
||||
|
||||
참고: a, i 그리고 A 는 텍스트가 입력되는 위치 외에는 편집 모드와 완전히 같다는 것을 유념하십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.3: 치환(REPLACE) 의 다른 버전
|
||||
|
||||
|
||||
** 대문자 R 을 입력하면 하나 이상의 글자를 바꿀 수 있습니다. **
|
||||
|
||||
1. ---> 로 표시된 첫번째 줄로 움직여 커서를 xxx의 앞으로 옮깁니다.
|
||||
|
||||
2. R 을 입력한 후, 두번째 줄과 같은 숫자를 입력해 xxx를 치환합니다.
|
||||
|
||||
3. <ESC> 를 눌러 치환 모드를 빠져나갑니다. 나머지 문장은 그대로 남아 있는지 확인합니다.
|
||||
|
||||
4. 위 단계들 반복하여 남은 모든 xxx를 치환합니다.
|
||||
|
||||
---> Adding 123 to xxx gives you xxx.
|
||||
---> Adding 123 to 456 gives you 579.
|
||||
|
||||
주의: 치환 모드는 편집 모드와 비슷합니다. 하지만 입력된 문자들이 원래 문자들을 삭제하는 점이 다릅니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.4: 문자 복사 붙여넣기(COPY AND PASTE)
|
||||
|
||||
|
||||
** y 를 이용해 복사하고 p 로 붙여 넣습니다. **
|
||||
|
||||
1. ---> 로 표시된 줄로 움직여 커서를 "a)" 뒤로 옮깁니다.
|
||||
|
||||
2. v 를 눌러 비주얼 모드를 시작하고 "first" 바로 앞까지 커서를 움직입니다.
|
||||
|
||||
3. y 를 눌러 하이라이트 된 부분을 복사(yank (copy))합니다.
|
||||
|
||||
4. 커서를 다음 문장의 끝으로 옮깁니다: j$
|
||||
|
||||
5. p 를 눌러 문자열을 붙여 넣습니다.(paste) 그리고 second <ESC> 를 입력합니다.
|
||||
|
||||
6. 비주얼 모드를 이용해 " item."을 선택, y 로 복사, j$ 으로 다음 문장 끝으로 움직여
|
||||
p 로 단어를 붙여 넣습니다.
|
||||
|
||||
---> a) this is the first item.
|
||||
b)
|
||||
|
||||
참고: y 역시 명령어로 사용 가능합니다. 예를 들어, yw 는 한 단어를 복사합니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.5: 옵션 설정(SET)
|
||||
|
||||
** 찾기나 바꾸기에서 대소문자 구분을 없애기 위해 옵션을 설정합니다 **
|
||||
|
||||
1. 다음을 입력하여 'ignore' 를 찾으십시오: /ignore <ENTER>
|
||||
n 키를 이용하여 여러번 반복하십시오.
|
||||
|
||||
2. 'ic' (대소문자 구별 안함, Ignore case) 옵션을 설정하십시오:
|
||||
:set ic
|
||||
|
||||
3. n 키를 눌러서 'ignore' 를 다시 찾아보십시오.
|
||||
이제 ignore과 IGNORE 모두 검색되는 점을 주목합니다.
|
||||
|
||||
4. 'hlsearch' 와 'incsearch' 옵션을 설정합시다.
|
||||
:set hls is
|
||||
|
||||
5. 찾기 명령을 다시 입력하여, 어떤 일이 일어나는지 확인해 보십시오:
|
||||
/ignore
|
||||
|
||||
6. 대소문자 구별을 끄기 위해서는, 다음과 같이 입력합니다:
|
||||
:set noic
|
||||
|
||||
참고: 찾은 내용이 강조(HIGHLIGHT)된 것을 없애려면: :nohlsearch
|
||||
참고: 만약, 검색 한번에 대해서만 대소문자 구별 세팅을 끄고 싶다면 \c 를 이용할 수 있습니다.
|
||||
: /ignore\c <ENTER>
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 6 요약
|
||||
|
||||
|
||||
1. o 를 입력하면 커서 *아래에* 한 줄이 열리며, 커서는 편집 모드로
|
||||
열린 줄 위에 위치하게 됩니다.
|
||||
대문자 O 를 입력하면 커서가 있는 줄의 *위로* 새 줄을 열게 됩니다.
|
||||
|
||||
2. a 를 입력하면 커서 *다음에* 글을 입력할 수 있습니다.
|
||||
대문자 A 를 입력하면 자동으로 그 줄의 끝에 글자를 추가하게 됩니다.
|
||||
|
||||
3. e 를 입력하면 단어의 끝으로 움직입니다.
|
||||
|
||||
4. y 를 입력하면 복사(yank (copy))를, p 를 입력하면 붙여 넣기가 됩니다.
|
||||
|
||||
5. 대문자 R 을 입력하면 <ESC> 를 눌러서 나가기 전까지 바꾸기 모드가 됩니다.
|
||||
|
||||
6. ":set xxx" 를 하면 "xxx" 옵션이 설정됩니다.:
|
||||
'ic' 'ignorecase' 검색시 대소문자 구별을 하지 않습니다.
|
||||
'is' 'incsearch' 검색어에서 부분 검색 결과를 보여줍니다.
|
||||
'hls' 'hlsearch' 검색 결과값을 하이라이트해줍니다.
|
||||
옵션은 전체 이름 혹은 줄인 이름 모두 사용 가능합니다.
|
||||
|
||||
7. 앞에 "no"를 붙여 옵션을 끌 수 있습니다: :set noic
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 7.1: 온라인 도움말 명령
|
||||
|
||||
|
||||
** 온라인 도움말 시스템 사용하기 **
|
||||
|
||||
빔은 폭 넓은 온라인 도움말 시스템을 제공합니다. 도움말을 보려면,
|
||||
다음 세가지 중 하나를 시도해보십시오:
|
||||
- <HELP> 키를 누른다. (키가 있는 경우)
|
||||
- <F1> 키를 누른다. (키가 있는 경우)
|
||||
- :help <ENTER> 라고 입력한다.
|
||||
|
||||
도움말 창을 닫으려면 :q <ENTER> 라고 입력하십시오.
|
||||
CTRL-W CTRL-W 다른쪽 윈도우로 넘어갑니다.
|
||||
:q <ENTER> 도움말 윈도우를 닫습니다.
|
||||
|
||||
":help" 라는 명령에 인자를 주면 어떤 주제에 관한 도움말을 찾을 수 있습니다.
|
||||
다음 명령을 내려 보십시오. ( <ENTER> 키를 누르는 것을 잊지 마십시오.)
|
||||
|
||||
:help w
|
||||
:help c_CTRL-D
|
||||
:help insert-index
|
||||
:help user-manual
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 7.2: 시작 스크립트 만들기
|
||||
|
||||
** 빔의 기능 켜기 **
|
||||
|
||||
빔은 Vi 보다 훨씬 많은 기능을 가지고 있지만, 대부분은 기본적으로 작동하지
|
||||
않습니다. 더 많은 기능을 써보려면, "vimrc" 라는 파일을 만들어야 합니다.
|
||||
|
||||
1. "vimrc" 파일을 수정합시다. 이 파일은 사용하는 시스템에 따라 다릅니다:
|
||||
:e ~/.vimrc Unix의 경우
|
||||
:e $VIM/_vimrc MS-Windows의 경우
|
||||
|
||||
2. 이제 "vimrc"의 예제를 읽어들입니다:
|
||||
:r $VIMRUNTIME/vimrc_example.vim
|
||||
|
||||
3. 다음과 같이 하여 파일을 저장합니다:
|
||||
:w
|
||||
|
||||
다음 번에 빔을 시작하면, 구문 강조(syntax highlighting)이 사용될 것입니다.
|
||||
모든 원하는 설정을 이 "vimrc" 파일에 넣어둘 수 있습니다.
|
||||
더 자세한 내용은 :help vimrc-intro를 참고 하세요.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 7.3: 명령어 완성하기
|
||||
|
||||
|
||||
** CTRL-D 와 <TAB> 이용하여 명령어를 완성할 수 있습니다.**
|
||||
|
||||
1. 먼저 vim이 호환 모드가 아닌지를 확인합니다: :set nocp
|
||||
|
||||
2. 디렉토리에 파일이 존재하는지 먼저 확인 합니다.: :!ls 혹은 :!dir
|
||||
|
||||
3. 다음과 같이 명령어를 입력합니다: :e
|
||||
|
||||
4. CTRL-D 를 누르면 "e"로 시작하는 모든 명령어들을 볼 수 있습니다.
|
||||
|
||||
5. <TAB> 을 눌러 ":edit" 명령어를 완성해 봅니다.
|
||||
|
||||
6. 이제 빈칸 하나를 추가한 뒤, 존재 파일 이름을 앞 부분을 입력합니다: :edit FIL
|
||||
|
||||
7. <TAB> 을 눌러 파일 이름을 완성 시킵니다.
|
||||
|
||||
참고: 완성하기는 많은 명령어에서 사용할 수 있습니다. CTRL-D와 <TAB> 만 누르세요!
|
||||
특히, :help 에서 유용할 것입니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 7 요약
|
||||
|
||||
|
||||
1. 도움말을 열기 위해 :help 혹은 <F1> 혹은 <Help> 를 누릅니다.
|
||||
|
||||
2. cmd 에 대한 도움말을 보기 위해서는 :help cmd 를 입력합니다.
|
||||
|
||||
3. CTRL-W CTRL-W 를 이용해 다른 윈도우로 넘어갑니다.
|
||||
|
||||
4. :q 로 도움말 윈도우를 빠져나옵니다.
|
||||
|
||||
5. vimrc 시작 스크립트를 이용해 선호하는 세팅을 유지할 수 있습니다.
|
||||
|
||||
6. : 명령어를 입력할때, CTRL-D 를 눌러 가능한 명령어들을 볼수 있습니다.
|
||||
<TAB> 을 눌러 완성 가능합니다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
이것으로 빔 길잡이를 마칩니다. 이 길잡이는 빔 편집기에 대한 간략한 개요를
|
||||
보여주기 위한 의도로 제작되었으며, 이 편집기를 정말 간단히 사용하기에
|
||||
충분할 뿐입니다. 빔에는 이 길잡이와는 비교할 수 없을 만큼 훨씬 많은 명령이
|
||||
있습니다. 다음 사용자 매뉴얼을 읽으십시오: ":help user-manual"
|
||||
|
||||
보다 자세히 읽고 공부하려면, 다음 책을 추천해 드립니다:
|
||||
Vim - Vi Improved - by Steve Oualline
|
||||
출판사: New Riders
|
||||
이 책은 완전히 빔에 대해서만 다루고 있습니다. 특히 초보자들에게 유용합니다.
|
||||
많은 예제와 그림이 있습니다.
|
||||
다음을 참고하십시오: http://iccf-holland.org/click5.html
|
||||
|
||||
다음 책은 좀 오래된 책으로 빔보다는 Vi에 대해 다루고 있지만, 역시 추천할 만
|
||||
합니다:
|
||||
Learning the Vi Editor - by Linda Lamb
|
||||
출판사: O'Reilly & Associates Inc.
|
||||
Vi로 하고 싶은 거의 모든 것에 대해 알 수 있는 좋은 책입니다.
|
||||
여섯번째 개정판은 빔에 관한 내용을 포함하고 있습니다.
|
||||
|
||||
이 길잡이는 Colorado School of Mines의 Michael C. Pierce 와
|
||||
Robert K. Ware 가 Colorado State University의 Charles Smith 의 아이디어에
|
||||
착안하여 썼습니다.
|
||||
. E-mail: bware@mines.colorado.edu.
|
||||
|
||||
Modified for Vim by Bram Moolenaar.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
+291
-135
@@ -1,5 +1,5 @@
|
||||
===============================================================================
|
||||
= 빔 길잡이 (VIM Tutor) 에 오신 것을 환영합니다 - Version 1.5 =
|
||||
= 빔 길잡이 (VIM Tutor) 에 오신 것을 환영합니다 - Version 1.7 =
|
||||
===============================================================================
|
||||
|
||||
빔(Vim)은 이 길잡이에서 다 설명할 수 없을 만큼 많은 명령을 가진
|
||||
@@ -32,15 +32,15 @@
|
||||
1. 익숙해질 때까지 커서를 스크린 상에서 움직여 보십시오.
|
||||
|
||||
2. 아래 방향키 (j)를 반복입력이 될 때까지 누르고 계십시오.
|
||||
---> 이제 다음 lesson으로 가는 방법을 알게 되었습니다.
|
||||
이제 다음 lesson으로 가는 방법을 알게 되었습니다.
|
||||
|
||||
3. 아래 방향키를 이용하여, Lesson 1.2 로 가십시오.
|
||||
|
||||
참고: 원하지 않는 무언가가 입력이 되었다면, <ESC>를 눌러서, 명령 모드로
|
||||
돌아가십시오. 그 후에 원하는 명령을 다시 입력하십시오.
|
||||
돌아가십시오. 그 후에 원하는 명령을 다시 입력하십시오.
|
||||
|
||||
참고: 커서키 또한 작동할 것입니다. 하지만 hjkl에 익숙해지면, 커서키보다
|
||||
훨씬 빠르게 이동할 수 있을 것입니다.
|
||||
훨씬 빠르게 이동할 수 있을 것입니다. 정말요!
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.2: 빔을 시작하고 끝내기
|
||||
@@ -51,10 +51,7 @@
|
||||
1. <ESC> 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다.
|
||||
|
||||
2. 다음과 같이 입력합니다: :q! <ENTER>
|
||||
|
||||
---> 이렇게 하면, 바뀐 내용을 *저장하지 않고* 편집기를 빠져나갑니다.
|
||||
저장한 후 빠져나가려면 다음과 같이 입력합니다:
|
||||
:wq <ENTER>
|
||||
이렇게 하면, 바뀐 내용을 *저장하지 않고* 편집기를 빠져나갑니다.
|
||||
|
||||
3. 쉘 프롬프트가 보인다면, 다시 길잡이로 돌아오기 위해 다음과 같이
|
||||
입력합니다.
|
||||
@@ -66,8 +63,12 @@
|
||||
파일을 뜻합니다.
|
||||
|
||||
4. 위에서 이야기한 단계를 기억하였으며, 확신이 서면, 1에서 3까지를
|
||||
수행하여 편집기를 나갔다가 다시 들어와보십시오. 그 후 커서를 아래로
|
||||
움직여 Lesson 1.3 으로 가십시오.
|
||||
수행하여 편집기를 나갔다가 다시 들어와 보십시오.
|
||||
|
||||
주의: :q! <ENTER> 는 바뀐 내용을 저장하지 않습니다. 이 후 lesson에서
|
||||
어떻게 편집 내용을 저장하는지 배울 수 있습니다.
|
||||
|
||||
5. 그 후 커서를 아래로 움직여 Lesson 1.3 으로 가십시오.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.3: 텍스트 편집 - 지우기
|
||||
|
||||
@@ -110,10 +111,55 @@
|
||||
---> There is text misng this .
|
||||
---> There is some text missing from this line.
|
||||
|
||||
5. 텍스트를 삽입하는 데에 익숙해졌다면, 요약을 봐주십시오.
|
||||
5. 텍스트를 삽입하는 데에 익숙해졌다면, Lesson 1.5로 가십시오.
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.5: 택스트 편집 - 추가 (APPENDING)
|
||||
|
||||
|
||||
** A 를 입력해 텍스트를 추가할 수 있습니다. **
|
||||
|
||||
1. 커서를 첫번째 ---> 로 표시된 줄로 움직입니다.
|
||||
커서가 문장 내 어디에 있던 상관없습니다.
|
||||
|
||||
2. A 키를 눌러 필요한 내용을 입력합니다.
|
||||
|
||||
3. 내용을 모두 입력한 후 <ESC>를 눌러 명령 모드로 돌아갑니다.
|
||||
|
||||
4. 커서를 두번째 ---> 로 표시된 줄로 움직입니다.
|
||||
문장을 올바르게 만들기 위해 2에서 3의 과정을 반복합니다.
|
||||
|
||||
---> There is some text missing from th
|
||||
There is some text missing from this line.
|
||||
---> There is also some text miss
|
||||
There is also some text missing here.
|
||||
|
||||
5. 텍스트를 추가하는 데 익숙해졌다면, Lesson 1.6으로 가십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 1.6: 파일 편집
|
||||
|
||||
** :wq 를 이용하여 파일을 저장하고 빠져나갈 수 있습니다. **
|
||||
|
||||
!! 주의: 아래 있는 단계를 실행하기 전에, 이 lesson 전체를 읽으십시오!!
|
||||
|
||||
1. lesson 1.2에서 배웠던 것처럼 :q!로 편집기를 나갈 수 있습니다.
|
||||
만약, 다른 터미널에 접근 가능하다면, 아래의 단계를 다른 터미널에서 해봅니다.
|
||||
|
||||
2. 쉘 프롬프트에 다음과 같이 입력합니다: vim tutor <ENTER>
|
||||
'vim' 은 빔 에디터 시작을 위한 명령어, 'tutor'는 수정하고자 하는
|
||||
파일의 이름 입니다.
|
||||
|
||||
3. 앞에서 배웠던 것처럼 텍스트를 삽입하고 지워보세요.
|
||||
|
||||
4. 다음 명령어를 이용해 파일 수정 부분을 저장하고 빠져나갑니다: :wq <ENTER>
|
||||
|
||||
5. 만약 1에서 vimtutor를 빠져나갔다가 다시 들어왔다면, 아래로 움직여 요약으로 넘어가도록 합시다.
|
||||
|
||||
6. 위 모든 단계를 다 읽고 이해한 후에 직접 해보세요.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 1 요약
|
||||
|
||||
@@ -129,14 +175,14 @@
|
||||
4. 명령 모드에서 커서가 위치한 곳의 글자를 지우려면 x 를 입력합니다.
|
||||
|
||||
5. 명령 모드에서 커서가 위치한 곳에 텍스트를 삽입하려면
|
||||
i 를 누른 후 텍스트를 입력하고 <ESC> 를 누릅니다.
|
||||
i 를 누른 후 텍스트를 입력하고 <ESC> 커서 앞에 삽입합니다.
|
||||
A 를 누른 후 텍스트를 입력하고 <ESC> 문장 뒤에 추가 합니다.
|
||||
|
||||
참고: <ESC>는 명령 모드로 돌아가는 데 쓰며, 원치 않는 명령이나 완전히 입력되지
|
||||
않은 명령을 취소하는 데에도 씁니다.
|
||||
|
||||
그럼 Lesson 2를 시작합시다.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.1: 삭제(DELETION) 명령
|
||||
|
||||
@@ -180,15 +226,16 @@
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.3: 명령과 적용 대상에 대해
|
||||
|
||||
|
||||
|
||||
삭제 명령 d의 형식은 다음과 같습니다.
|
||||
|
||||
[횟수] d 대상 또는 d [횟수] 대상
|
||||
여기서
|
||||
횟수 - 명령을 몇 번 수행할 지 (옵션, 기본값=1).
|
||||
d 대상
|
||||
|
||||
여기서:
|
||||
d - 지우는 명령
|
||||
대상 - 아래에 제시된 대상에 대해 명령을 수행
|
||||
|
||||
@@ -197,13 +244,51 @@
|
||||
e - 커서에서 그 단어의 끝까지 (공백을 포함하지 않음.)
|
||||
$ - 커서에서 그 줄의 끝까지
|
||||
|
||||
예를 들어, de 는 커서의 위치부터 해당 단어의 끝까지 지웁니다.
|
||||
|
||||
참고: 호기심이 있다면, 명령 모드에서 명령 없이 대상을 입력해보십시오.
|
||||
위에서 이야기한 대상의 목록에 따라 커서가 움직이게 됩니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.4: 대상에 반복 적용하기
|
||||
|
||||
|
||||
** 대상 이전에 숫자를 넣어주면 그 만큼 반복 됩니다. **
|
||||
|
||||
1. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다.
|
||||
|
||||
2. 2w 입력하여 커서를 단어 두 개 뒤로 옮깁니다.
|
||||
|
||||
3. 3e 입력하여 커서를 뒤로 세 번째 단어의 끝으로 옮깁니다.
|
||||
|
||||
4. 0 (zero) 를 입력하여 문장의 시작부분으로 움직입니다.
|
||||
|
||||
5. 2에서 3까지를 다른 숫자로 반복해 봅니다.
|
||||
|
||||
---> This is just a line with words you can move around in.
|
||||
|
||||
6. Lesson 2.5로 가십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.4: '명령-대상' 에 대한 예외
|
||||
Lesson 2.5: 삭제에 반복 적용하기
|
||||
|
||||
|
||||
** 명령과 숫자를 함께 사용하면 그만큼 반복 수행 됩니다. **
|
||||
|
||||
위에서 삭제 명령과 대상의 조합과 같이, 대상 이전에 횟수를 넣어 더 많이 삭제 할 수 있습니다:
|
||||
d 횟수 대상
|
||||
|
||||
1. 아래 ---> 표시된 줄에서 커서를 첫번째 대문자 단어로 옮깁니다.
|
||||
|
||||
2. d2w를 입력하여 두 대문자 단어를 지웁니다.
|
||||
|
||||
3. 이어지는 대문자 단어들을 1에서 2까지의 단계를 이용해 횟수를 바꾸어 삭제해 봅니다.
|
||||
|
||||
---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.6: 줄 전체 조작하기
|
||||
|
||||
|
||||
|
||||
** dd 라고 치면 줄 전체를 지웁니다. **
|
||||
@@ -216,17 +301,17 @@
|
||||
3. 그런 다음 네번째 줄로 가십시오.
|
||||
4. 2dd 라고 입력하여 두줄을 지웁니다. ( 횟수-명령-대상을 기억하세요. )
|
||||
|
||||
1) Roses are red,
|
||||
2) Mud is fun,
|
||||
3) Violets are blue,
|
||||
4) I have a car,
|
||||
5) Clocks tell time,
|
||||
6) Sugar is sweet
|
||||
7) And so are you.
|
||||
---> 1) Roses are red,
|
||||
---> 2) Mud is fun,
|
||||
---> 3) Violets are blue,
|
||||
---> 4) I have a car,
|
||||
---> 5) Clocks tell time,
|
||||
---> 6) Sugar is sweet
|
||||
---> 7) And so are you.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 2.5: 취소(UNDO) 명령
|
||||
Lesson 2.7: 취소(UNDO) 명령
|
||||
|
||||
|
||||
** u 를 누르면 마지막 명령이 취소되며, U 는 줄 전체를 수정합니다. **
|
||||
@@ -252,20 +337,22 @@
|
||||
|
||||
|
||||
1. 커서가 위치한 곳부터 단어의 끝까지 지우려면: dw
|
||||
|
||||
2. 커서가 위치한 곳부터 줄 끝까지 지우려면: d$
|
||||
|
||||
3. 줄 전체를 지우려면: dd
|
||||
|
||||
4. 명령 모드에서 내리는 명령의 형식은 다음과 같습니다:
|
||||
4. 횟수와 함께 대상을 반복 시키려면: 2w
|
||||
5. 명령 모드에서 내리는 명령의 형식은 다음과 같습니다:
|
||||
|
||||
[횟수] 명령 대상 또는 명령 [횟수] 대상
|
||||
|
||||
여기서:
|
||||
횟수 - 그 명령을 몇 번 반복할 것인가
|
||||
명령 - 어떤 명령을 내릴 것인가 ( 예를 들어, 삭제인 경우는 d )
|
||||
대상 - 명령이 동작할 대상, 예를 들어 w (단어), $ (줄의 끝) 등.
|
||||
|
||||
5. 이전 행동을 취소하려면: u (소문자 u)
|
||||
6. 커서를 문장 맨 앞으로 옮기려면: 0
|
||||
|
||||
7. 이전 행동을 취소하려면: u (소문자 u)
|
||||
한 줄에서 수정한 것을 모두 취소하려면: U (대문자 U)
|
||||
취소한 것을 다시 실행하려면: CTRL-R
|
||||
|
||||
@@ -319,13 +406,13 @@
|
||||
Lesson 3.3: 변환(CHANGE) 명령
|
||||
|
||||
|
||||
** 한 단어의 일부나 전체를 바꾸려면, cw 를 치십시오. **
|
||||
** 한 단어의 전체를 바꾸려면, ce 를 치십시오. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫줄로 옮깁니다.
|
||||
|
||||
2. 커서를 lubw 에서 u 위에 올려놓습니다.
|
||||
|
||||
3. cw 라고 명령한 후 단어를 정확하게 수정합니다. (이 경우, 'ine' 를 칩니다.)
|
||||
3. ce 라고 명령한 후 단어를 정확하게 수정합니다. (이 경우, 'ine' 를 칩니다.)
|
||||
|
||||
4. <ESC> 를 누른 후 다음 에러로 갑니다 (수정되어야할 첫 글자로 갑니다.)
|
||||
|
||||
@@ -334,8 +421,8 @@
|
||||
---> This lubw has a few wptfd that mrrf changing usf the change command.
|
||||
---> This line has a few words that need changing using the change command.
|
||||
|
||||
cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있도록 한다는 것에
|
||||
주의합시다.
|
||||
ce 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있도록 한다는 것에
|
||||
유의합시다.
|
||||
|
||||
|
||||
|
||||
@@ -361,7 +448,7 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
---> The end of this line needs some help to make it like the second.
|
||||
---> The end of this line needs to be corrected using the c$ command.
|
||||
|
||||
|
||||
참고: 입력하는 동안은 백스페이스를 이용할 수 있습니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 3 요약
|
||||
@@ -375,7 +462,7 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
바꾸어 넣을 글자를 입력합니다.
|
||||
|
||||
3. 변환 명령(CHANGE)은 커서에서 부터 지정한 대상의 끝까지 바꿀 수 있는
|
||||
명령입니다. 예를 들어, 커서 위치에서 단어의 끝까지 바꾸려면, cw 를
|
||||
명령입니다. 예를 들어, 커서 위치에서 단어의 끝까지 바꾸려면 ce 를
|
||||
입력하면 되며, c$ 는 줄 끝까지 바꾸는 데 쓰입니다.
|
||||
|
||||
4. 변환 명령의 형식은 다음과 같습니다:
|
||||
@@ -390,8 +477,8 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
Lesson 4.1: 위치와 파일의 상태
|
||||
|
||||
|
||||
** CTRL-g 를 누르면 파일 내에서의 현재 위치와 파일의 상태를 볼 수 있습니다.
|
||||
SHIFT-G 를 누르면 파일 내의 마지막 줄로 이동합니다. **
|
||||
** CTRL-G 를 누르면 파일 내에서의 현재 위치와 파일의 상태를 볼 수 있습니다.
|
||||
G 를 누르면 파일 내의 마지막 줄로 이동합니다. **
|
||||
|
||||
주의: 아래의 단계를 따라하기 전에, 이 Lesson 전체를 먼저 읽으십시오.
|
||||
|
||||
@@ -399,10 +486,14 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
표시된 상태줄이 화면 아래에 표시될 것입니다. 3번째 단계를 위해 그
|
||||
줄 번호를 기억하고 계십시오.
|
||||
|
||||
2. SHIFT-G 를 누르면 파일의 마지막으로 이동합니다.
|
||||
참고: 커서가 화면 오른쪽 하단으로 옮겨진 것을 보인다면,
|
||||
이는 'ruler' 옵션을 세팅된 경우 입니다. (:help 'ruler' 를 참고 하세요.)
|
||||
|
||||
3. 아까 기억했던 줄 번호를 입력한 후 SHIFT-G 를 누르십시오. 이렇게 하면
|
||||
처음에 CTRL-g 를 눌렀던 장소로 되돌아가게 될 것입니다.
|
||||
2. G 를 누르면 파일의 마지막으로 이동합니다.
|
||||
gg 를 누르면 파일의 시작 부분으로 이동합니다.
|
||||
|
||||
3. 아까 기억했던 줄 번호를 입력한 후 G 를 누르십시오. 이렇게 하면
|
||||
처음에 CTRL-G 를 눌렀던 장소로 되돌아가게 될 것입니다.
|
||||
(번호를 입력할 때, 이것은 화면에 표시되지 않습니다.)
|
||||
|
||||
4. 자신이 생겼다면, 1에서 3까지를 실행해보십시오.
|
||||
@@ -425,6 +516,9 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
4. 문구를 역방향으로 찾으려면, / 대신 ? 를 이용하면 됩니다.
|
||||
|
||||
5. 원래 있던 곳으로 돌아가기 위해서는 CTRL-O 를 이용하면 됩니다. 반복하면 더 이전으로도
|
||||
갈 수 있습니다. CTRL-I 로 다시 뒤로 갈 수도 있습니다.
|
||||
|
||||
---> "errroor" is not the way to spell error; errroor is an error.
|
||||
|
||||
참고: 찾는 중에 파일의 끝에 다다르게 되면, 파일의 처음부터 다시 찾게 됩니다.
|
||||
@@ -444,17 +538,16 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
4. % 를 입력하여, 이전 괄호로 되돌아 옵시다.
|
||||
|
||||
5. 커서를 다른 (,),[,],{ 혹은 } 로 움직여 % 를 입력해 봅니다.
|
||||
|
||||
---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
|
||||
|
||||
참고: 짝이 맞지 않는 괄호가 있는 프로그램을 디버깅할 때에 매우 유용합니다!
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 4.4: 에러를 수정하는 방법
|
||||
Lesson 4.4: 치환(SUBTITUTE) 명령
|
||||
|
||||
|
||||
** :s/old/new/g 하면 'old' 를 'new' 로 치환(SUBTITUTE)합니다. **
|
||||
@@ -472,22 +565,22 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
4. 두 줄 사이의 모든 문자열에 대해 치환하려면 다음과 같이 합니다,
|
||||
:#,#s/old/new/g #,# 는 두 줄의 줄번호를 뜻합니다.
|
||||
:%s/old/new/g 파일 전체에서 발견된 모든 것을 치환하는 경우입니다.
|
||||
|
||||
|
||||
|
||||
:%s/old/new/gc 파일 전체에서 발견된 모든 것을 찾고, 치환할지 안
|
||||
할지 프롬프트로 명령합니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 4 요약
|
||||
|
||||
|
||||
1. CTRL-g 는 파일의 상태와 파일 내에서의 현재 위치를 표시합니다.
|
||||
SHIFT-G 는 파일의 끝으로 이동합니다. 줄번호를 입력한 후 SHIFT-G를
|
||||
입력하면, 그 줄로 이동합니다.
|
||||
|
||||
1. CTRL-G 파일의 상태와 파일 내에서의 현재 위치를 표시합니다.
|
||||
G 파일의 끝으로 이동합니다.
|
||||
숫자 G 해당 줄로 이동합니다.
|
||||
gg 첫 번째 라인으로 이동합니다.
|
||||
|
||||
2. / 를 입력한 후 문구를 입력하면 그 문구를 아랫방향으로 찾습니다.
|
||||
? 를 입력한 후 문구를 입력하면 윗방향으로 찾습니다.
|
||||
검색 후, n 을 입력하면 같은 방향으로 다음 문구를 찾으며,
|
||||
Shift-N 을 입력하면 반대 방향으로 찾습니다.
|
||||
CTRL-O 는 과거의 위치로, CTRL-I는 새로운 위치로 옮겨줍니다.
|
||||
|
||||
3. 커서가 (,),[,],{,} 위에 있을 때에 % 를 입력하면 상응하는 짝을
|
||||
찾아갑니다.
|
||||
@@ -548,25 +641,23 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.3: 선택적으로 저장하는 명령
|
||||
|
||||
** 파일의 일부를 저장하려면, v 대상 :w FILENAME 을 입력합니다. **
|
||||
|
||||
** 파일의 일부를 저장하려면, :#,# w FILENAME 하십시오. **
|
||||
|
||||
1. 다시 한번, :!dir 이나 :!ls 를 입력하여 디렉토리의 목록을 받아온 후
|
||||
TEST 같은 적합한 이름을 선택합니다.
|
||||
|
||||
2. 커서를 이 페이지의 처음으로 옮긴 후, Ctrl-g 를 입력하여 그 줄의 줄번호를
|
||||
알아냅니다. 이 번호를 기억하십시오!
|
||||
|
||||
3. 이제 이 페이지의 마지막으로 가서 Ctrl-g 를 다시 입력하십시오. 이 줄의
|
||||
줄번호 또한 기억하십시오!
|
||||
|
||||
4. 어떤 섹션만 파일로 저장하려면, :#,# w TEST 를 입력하면 됩니다. 이 때
|
||||
#,# 는 아까 기억했던 시작과 끝 줄번호 입니다. TEST는 파일 이름입니다.
|
||||
|
||||
5. :!dir 을 이용하여 파일이 만들어졌는지 확인하십시오. 지우지는 마십시오.
|
||||
1. 이 줄로 커서를 가져옵니다.
|
||||
|
||||
2. v 를 누르고 커서를 아래 다섯번째로 옮깁니다. 이 때, 문자열들이 하이라이트 됨을 주목합니다.
|
||||
|
||||
3. : 를 누릅니다. 화면 하단에 :'<,'> 가 나타납니다.
|
||||
|
||||
4. w TEST 를 입력합니다. 여기서 TEST는 파일 이름이며 아직 생성되어 있지 않습니다. <ENTER>를
|
||||
누르기 전, :'<,'>w TEST 로 입력되었는지 확인 합니다.
|
||||
|
||||
5. 빔은 선택된 문장들을 TEST 파일에 입력합니다. :!dir 혹은 :!ls를 이용하여 파일이 만들어졌는지
|
||||
확인하십시오. 아직 삭제하지 마십시오! 다음 레슨에서 이 파일을 사용합니다.
|
||||
|
||||
참고 : v 를 눌러 비주얼(Visual) 선택을 시작합니다. 커서를 주변으로 움직여 선택 부분을 조절할 수
|
||||
있습니다. 그리고 명령어를 이용해 해당 문자열을 조작할 수 있습니다. 예를 들어, d 를 이용해
|
||||
삭제할 수도 있습니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 5.4: 파일 읽어들이기, 합치기
|
||||
@@ -574,22 +665,19 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
** 어떤 파일의 내용을 삽입하려면, :r FILENAME 하십시오 **
|
||||
|
||||
1. :!dir 을 입력하여 아까 만든 TEST 파일이 그대로 있는지 확인하십시오.
|
||||
|
||||
2. 커서를 이 페이지의 처음으로 움직이십시오.
|
||||
|
||||
주의: 3번째 단계를 실행하면, Lesson 5.3 을 보게 될 것입니다. 그렇게 되면
|
||||
1. 커서를 이 라인 바로 위로 옮기십시오.
|
||||
|
||||
주의: 3번째 단계를 실행하면, Lesson 5.3 을 보게 될 것입니다. 그렇게 되면
|
||||
이 lesson으로 다시 내려오십시오.
|
||||
|
||||
2. 이제 TEST 파일을 읽어들입시다. :r TEST 명령을 사용하십시오. TEST 는
|
||||
파일의 이름입니다. 읽어들인 파일은 커서가 위치한 문장 아래부터 놓이게 됩니다.
|
||||
|
||||
3. 이제 TEST 파일을 읽어들입시다. :r TEST 명령을 사용하십시오. TEST 는
|
||||
파일의 이름입니다.
|
||||
|
||||
참고: 읽어들인 파일은 커서가 위치한 지점에서부터 놓이게 됩니다.
|
||||
|
||||
4. 파일이 읽어들여진 것을 확인하기 위해, 뒤로 이동해서 기존 버전과 파일에서
|
||||
3. 파일이 읽어들여진 것을 확인하기 위해, 뒤로 이동해서 기존 버전과 파일에서
|
||||
읽어들인 버전, 이렇게 Lesson 5.3 이 두번 반복되었음을 확인하십시오.
|
||||
|
||||
|
||||
참고: 외부 명령어의 결과값도 읽을 수 있습니다. 예를 들어, :r !ls 는 ls 명령어에 대한 결과값을
|
||||
읽어 커서 바로 아래에 합칩니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 5 요약
|
||||
@@ -605,14 +693,12 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
2. :w FILENAME 하면 현재 빔에서 사용하는 파일을 FILENAME이라는 이름으로
|
||||
디스크에 저장합니다.
|
||||
|
||||
3. :#,#w FILENAME 하면 #부터 #까지의 줄을 FILENAME이라는 파일로 저장합니다.
|
||||
3. v 명령 :w FILENAME 은 비주얼 모드에서 선택된 문장들을 파일 FILENAME에 저장합니다.
|
||||
|
||||
4. :r FILENAME 은 디스크에서 FILENAME이라는 파일을 불러들여서 커서 위치
|
||||
뒤에 현재 파일을 집어넣습니다.
|
||||
|
||||
|
||||
|
||||
|
||||
5. :r !dir 는 dir 명령어의 결과값을 현재 커서의 위치 아래에 붙힙니다.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -624,7 +710,6 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
1. 아래에 ---> 로 표시된 줄로 커서를 옮기십시오.
|
||||
|
||||
2. o (소문자)를 쳐서 커서 *아래에* 줄을 하나 여십시오. 편집 모드가 됩니다.
|
||||
Insert mode.
|
||||
|
||||
3. ---> 로 표시된 줄을 복사한 후 <ESC> 를 눌러서 편집 모드에서 나오십시오.
|
||||
|
||||
@@ -632,10 +717,8 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
|
||||
|
||||
4. 커서 *위에* 줄을 하나 만드려면, 소문자 o 대신 대문자 O 를 치면 됩니다.
|
||||
아래 있는 줄에 대해 이 명령을 내려보십시오.
|
||||
Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
|
||||
|
||||
|
||||
---> Open up a line above this by typing O while the cursor is on this line.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -644,11 +727,15 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
|
||||
** a 를 누르면 커서 *다음에* 글을 입력할 수 있습니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫번째 줄의 끝으로 옮깁니다. 명령 모드에서
|
||||
$ 를 이용하십시오.
|
||||
1. 커서를 ---> 로 표시된 첫번째 줄의 끝으로 옮깁니다.
|
||||
|
||||
2. e 를 눌러 li 의 끝으로 커서를 옮깁니다.
|
||||
|
||||
2. 소문자 a 를 커서 아래 글자 *다음*에 글을 추가할 수 있습니다.
|
||||
(대문자 A는 그 줄의 끝에 추가합니다.)
|
||||
3. 소문자 a 를 커서 아래 글자 *다음*에 글을 추가할 수 있습니다.
|
||||
|
||||
4. 아랫줄과 같이 문장을 완성해 봅니다. <ESC>를 이용해 편집(Insert) 모드를 나갑니다.
|
||||
|
||||
5. e 를 이용해 다음 고칠 단어로 움직여 3에서 4까지를 반복합니다.
|
||||
|
||||
참고: 그렇게 하시면 고작 줄의 끝에 추가를 하기 위해 i를 누르고, 커서 아래에
|
||||
있던 글자를 반복하고, 글을 끼워넣고, <ESC>를 눌러 명령 모드로 돌아와서,
|
||||
@@ -658,10 +745,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
3. 이제 첫 줄을 완성하십시오. 추가 명령은 텍스트가 입력되는 위치 외에는
|
||||
편집 모드와 완전히 같다는 것을 유념하십시오.
|
||||
|
||||
---> This line will allow you to practice
|
||||
---> This line will allow you to practice appending text to the end of a line.
|
||||
|
||||
---> This li will allow you to pract appendi text to a line.
|
||||
---> This line will allow you to practice appending text to a line.
|
||||
|
||||
참고: a, i 그리고 A 는 텍스트가 입력되는 위치 외에는 편집 모드와 완전히 같다는 것을 유념하십시오.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.3: 치환(REPLACE) 의 다른 버전
|
||||
@@ -669,37 +756,56 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
|
||||
** 대문자 R 을 입력하면 하나 이상의 글자를 바꿀 수 있습니다. **
|
||||
|
||||
1. 커서를 ---> 로 표시된 첫번째 줄로 옮기십시오.
|
||||
1. ---> 로 표시된 첫번째 줄로 움직여 커서를 xxx의 앞으로 옮깁니다.
|
||||
|
||||
2. 커서를 ---> 로 표시된 두번째 줄과 다른 첫번째 단어 위로 옮기십시오.
|
||||
('last' 입니다.)
|
||||
|
||||
3. R 을 입력한 후 첫번째 줄의 예전 텍스트 위에 새로운 글을 입력하여
|
||||
나머지 내용이 두번째 줄과 같아지도록 바꿉시다.
|
||||
|
||||
---> To make the first line the same as the last on this page use the keys.
|
||||
---> To make the first line the same as the second, type R and the new text.
|
||||
|
||||
4. <ESC> 를 눌러서 나가면, 바뀌지 않은 텍스트는 그대로 남게 됩니다.
|
||||
2. R 을 입력한 후, 두번째 줄과 같은 숫자를 입력해 xxx를 치환합니다.
|
||||
|
||||
3. <ESC> 를 눌러 치환 모드를 빠져나갑니다. 나머지 문장은 그대로 남아 있는지 확인합니다.
|
||||
|
||||
4. 위 단계들 반복하여 남은 모든 xxx를 치환합니다.
|
||||
|
||||
---> Adding 123 to xxx gives you xxx.
|
||||
---> Adding 123 to 456 gives you 579.
|
||||
|
||||
주의: 치환 모드는 편집 모드와 비슷합니다. 하지만 입력된 문자들이 원래 문자들을 삭제하는 점이 다릅니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.4: 옵션 설정(SET)
|
||||
Lesson 6.4: 문자 복사 붙여넣기(COPY AND PASTE)
|
||||
|
||||
|
||||
** y 를 이용해 복사하고 p 로 붙여 넣습니다. **
|
||||
|
||||
1. ---> 로 표시된 줄로 움직여 커서를 "a)" 뒤로 옮깁니다.
|
||||
|
||||
2. v 를 눌러 비주얼 모드를 시작하고 "first" 바로 앞까지 커서를 움직입니다.
|
||||
|
||||
3. y 를 눌러 하이라이트 된 부분을 복사(yank (copy))합니다.
|
||||
|
||||
4. 커서를 다음 문장의 끝으로 옮깁니다: j$
|
||||
|
||||
5. p 를 눌러 문자열을 붙여 넣습니다.(paste) 그리고 second <ESC> 를 입력합니다.
|
||||
|
||||
6. 비주얼 모드를 이용해 " item."을 선택, y 로 복사, j$ 으로 다음 문장 끝으로 움직여
|
||||
p 로 단어를 붙여 넣습니다.
|
||||
|
||||
---> a) this is the first item.
|
||||
b)
|
||||
|
||||
참고: y 역시 명령어로 사용 가능합니다. 예를 들어, yw 는 한 단어를 복사합니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 6.5: 옵션 설정(SET)
|
||||
|
||||
** 찾기나 바꾸기에서 대소문자 구분을 없애기 위해 옵션을 설정합니다 **
|
||||
|
||||
1. 다음을 입력하여 'ignore' 를 찾으십시오:
|
||||
/ignore
|
||||
n 키를 이용하여 여러번 반복하십시오.
|
||||
1. 다음을 입력하여 'ignore' 를 찾으십시오: /ignore <ENTER>
|
||||
n 키를 이용하여 여러번 반복하십시오.
|
||||
|
||||
2. 'ic' (대소문자 구별 안함, Ignore case) 옵션을 설정하십시오:
|
||||
:set ic
|
||||
|
||||
3. n 키를 눌러서 'ignore' 를 다시 찾아보십시오.
|
||||
n 키를 계속 눌러서 여러번 찾으십시오.
|
||||
3. n 키를 눌러서 'ignore' 를 다시 찾아보십시오.
|
||||
이제 ignore과 IGNORE 모두 검색되는 점을 주목합니다.
|
||||
|
||||
4. 'hlsearch' 와 'incsearch' 옵션을 설정합시다.
|
||||
:set hls is
|
||||
@@ -707,8 +813,13 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
5. 찾기 명령을 다시 입력하여, 어떤 일이 일어나는지 확인해 보십시오:
|
||||
/ignore
|
||||
|
||||
6. 찾은 내용이 강조(HIGHLIGHT)된 것을 없애려면, 다음과 같이 입력합니다:
|
||||
:nohlsearch
|
||||
6. 대소문자 구별을 끄기 위해서는, 다음과 같이 입력합니다:
|
||||
:set noic
|
||||
|
||||
참고: 찾은 내용이 강조(HIGHLIGHT)된 것을 없애려면: :nohlsearch
|
||||
참고: 만약, 검색 한번에 대해서만 대소문자 구별 세팅을 끄고 싶다면 \c 를 이용할 수 있습니다.
|
||||
: /ignore\c <ENTER>
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 6 요약
|
||||
|
||||
@@ -720,20 +831,22 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
2. a 를 입력하면 커서 *다음에* 글을 입력할 수 있습니다.
|
||||
대문자 A 를 입력하면 자동으로 그 줄의 끝에 글자를 추가하게 됩니다.
|
||||
|
||||
3. 대문자 R 을 입력하면 <ESC> 를 눌러서 나가기 전까지 바꾸기 모드가 됩니다.
|
||||
|
||||
4. ":set xxx" 를 하면 "xxx" 옵션이 설정됩니다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
3. e 를 입력하면 단어의 끝으로 움직입니다.
|
||||
|
||||
4. y 를 입력하면 복사(yank (copy))를, p 를 입력하면 붙여 넣기가 됩니다.
|
||||
|
||||
5. 대문자 R 을 입력하면 <ESC> 를 눌러서 나가기 전까지 바꾸기 모드가 됩니다.
|
||||
|
||||
6. ":set xxx" 를 하면 "xxx" 옵션이 설정됩니다.:
|
||||
'ic' 'ignorecase' 검색시 대소문자 구별을 하지 않습니다.
|
||||
'is' 'incsearch' 검색어에서 부분 검색 결과를 보여줍니다.
|
||||
'hls' 'hlsearch' 검색 결과값을 하이라이트해줍니다.
|
||||
옵션은 전체 이름 혹은 줄인 이름 모두 사용 가능합니다.
|
||||
|
||||
7. 앞에 "no"를 붙여 옵션을 끌 수 있습니다: :set noic
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 7: 온라인 도움말 명령
|
||||
LESSON 7.1: 온라인 도움말 명령
|
||||
|
||||
|
||||
** 온라인 도움말 시스템 사용하기 **
|
||||
@@ -745,18 +858,19 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
- :help <ENTER> 라고 입력한다.
|
||||
|
||||
도움말 창을 닫으려면 :q <ENTER> 라고 입력하십시오.
|
||||
CTRL-W CTRL-W 다른쪽 윈도우로 넘어갑니다.
|
||||
:q <ENTER> 도움말 윈도우를 닫습니다.
|
||||
|
||||
":help" 라는 명령에 인자를 주면 어떤 주제에 관한 도움말을 찾을 수 있습니다.
|
||||
다음 명령을 내려 보십시오. ( <ENTER> 키를 누르는 것을 잊지 마십시오.)
|
||||
|
||||
:help w
|
||||
:help c_<T
|
||||
:help c_CTRL-D
|
||||
:help insert-index
|
||||
:help user-manual
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
LESSON 8: 시작 스크립트 만들기
|
||||
LESSON 7.2: 시작 스크립트 만들기
|
||||
|
||||
** 빔의 기능 켜기 **
|
||||
|
||||
@@ -764,20 +878,64 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
않습니다. 더 많은 기능을 써보려면, "vimrc" 라는 파일을 만들어야 합니다.
|
||||
|
||||
1. "vimrc" 파일을 수정합시다. 이 파일은 사용하는 시스템에 따라 다릅니다:
|
||||
1. Start editing the "vimrc" file, this depends on your system:
|
||||
:edit ~/.vimrc Unix의 경우
|
||||
:edit $VIM/_vimrc MS-Windows의 경우
|
||||
:e ~/.vimrc Unix의 경우
|
||||
:e $VIM/_vimrc MS-Windows의 경우
|
||||
|
||||
2. 이제 "vimrc"의 예제를 읽어들입니다:
|
||||
|
||||
:read $VIMRUNTIME/vimrc_example.vim
|
||||
:r $VIMRUNTIME/vimrc_example.vim
|
||||
|
||||
3. 다음과 같이 하여 파일을 저장합니다:
|
||||
|
||||
:write
|
||||
:w
|
||||
|
||||
다음 번에 빔을 시작하면, 구문 강조(syntax highlighting)이 사용될 것입니다.
|
||||
모든 원하는 설정을 이 "vimrc" 파일에 넣어둘 수 있습니다.
|
||||
더 자세한 내용은 :help vimrc-intro를 참고 하세요.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 7.3: 명령어 완성하기
|
||||
|
||||
|
||||
** CTRL-D 와 <TAB> 이용하여 명령어를 완성할 수 있습니다.**
|
||||
|
||||
1. 먼저 vim이 호환 모드가 아닌지를 확인합니다: :set nocp
|
||||
|
||||
2. 디렉토리에 파일이 존재하는지 먼저 확인 합니다.: :!ls 혹은 :!dir
|
||||
|
||||
3. 다음과 같이 명령어를 입력합니다: :e
|
||||
|
||||
4. CTRL-D 를 누르면 "e"로 시작하는 모든 명령어들을 볼 수 있습니다.
|
||||
|
||||
5. <TAB> 을 눌러 ":edit" 명령어를 완성해 봅니다.
|
||||
|
||||
6. 이제 빈칸 하나를 추가한 뒤, 존재 파일 이름을 앞 부분을 입력합니다: :edit FIL
|
||||
|
||||
7. <TAB> 을 눌러 파일 이름을 완성 시킵니다.
|
||||
|
||||
참고: 완성하기는 많은 명령어에서 사용할 수 있습니다. CTRL-D와 <TAB> 만 누르세요!
|
||||
특히, :help 에서 유용할 것입니다.
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Lesson 7 요약
|
||||
|
||||
|
||||
1. 도움말을 열기 위해 :help 혹은 <F1> 혹은 <Help> 를 누릅니다.
|
||||
|
||||
2. cmd 에 대한 도움말을 보기 위해서는 :help cmd 를 입력합니다.
|
||||
|
||||
3. CTRL-W CTRL-W 를 이용해 다른 윈도우로 넘어갑니다.
|
||||
|
||||
4. :q 로 도움말 윈도우를 빠져나옵니다.
|
||||
|
||||
5. vimrc 시작 스크립트를 이용해 선호하는 세팅을 유지할 수 있습니다.
|
||||
|
||||
6. : 명령어를 입력할때, CTRL-D 를 눌러 가능한 명령어들을 볼수 있습니다.
|
||||
<TAB> 을 눌러 완성 가능합니다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -807,6 +965,4 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
|
||||
|
||||
Modified for Vim by Bram Moolenaar.
|
||||
|
||||
이 문서의 한국어 버전에 관한 문의는 다음 사이트로 해주십시오.
|
||||
http://wiki.kldp.org/wiki.php/VimTutorKo
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
+2
-1
@@ -812,6 +812,7 @@ static struct fst
|
||||
#endif
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
{"popup_atcursor", 2, 2, f_popup_atcursor},
|
||||
{"popup_clear", 0, 0, f_popup_clear},
|
||||
{"popup_close", 1, 2, f_popup_close},
|
||||
{"popup_create", 2, 2, f_popup_create},
|
||||
{"popup_getoptions", 1, 1, f_popup_getoptions},
|
||||
@@ -928,10 +929,10 @@ static struct fst
|
||||
#endif
|
||||
{"sort", 1, 3, f_sort},
|
||||
#ifdef FEAT_SOUND
|
||||
{"sound_clear", 0, 0, f_sound_clear},
|
||||
{"sound_playevent", 1, 2, f_sound_playevent},
|
||||
{"sound_playfile", 1, 2, f_sound_playfile},
|
||||
{"sound_stop", 1, 1, f_sound_stop},
|
||||
{"sound_stopall", 0, 0, f_sound_stopall},
|
||||
#endif
|
||||
{"soundfold", 1, 1, f_soundfold},
|
||||
{"spellbadword", 0, 1, f_spellbadword},
|
||||
|
||||
+12
-12
@@ -21,16 +21,16 @@ static const unsigned short cmdidxs1[26] =
|
||||
/* n */ 287,
|
||||
/* o */ 307,
|
||||
/* p */ 319,
|
||||
/* q */ 359,
|
||||
/* r */ 362,
|
||||
/* s */ 382,
|
||||
/* t */ 450,
|
||||
/* u */ 495,
|
||||
/* v */ 506,
|
||||
/* w */ 524,
|
||||
/* x */ 538,
|
||||
/* y */ 548,
|
||||
/* z */ 549
|
||||
/* q */ 358,
|
||||
/* r */ 361,
|
||||
/* s */ 381,
|
||||
/* t */ 449,
|
||||
/* u */ 494,
|
||||
/* v */ 505,
|
||||
/* w */ 523,
|
||||
/* x */ 537,
|
||||
/* y */ 547,
|
||||
/* z */ 548
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -56,7 +56,7 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* m */ { 1, 0, 0, 0, 9, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18 },
|
||||
/* n */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 10, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0 },
|
||||
/* o */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 0, 0, 0, 0, 0, 0, 9, 0, 11, 0, 0, 0 },
|
||||
/* p */ { 1, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 10, 0, 0, 17, 18, 27, 0, 28, 0, 29, 0 },
|
||||
/* p */ { 1, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 0, 0, 16, 17, 26, 0, 27, 0, 28, 0 },
|
||||
/* q */ { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 19, 0, 0, 0, 0 },
|
||||
/* s */ { 2, 6, 15, 0, 19, 23, 0, 25, 26, 0, 0, 29, 31, 35, 39, 41, 0, 49, 0, 50, 0, 62, 63, 0, 64, 0 },
|
||||
@@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][26] =
|
||||
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const int command_count = 562;
|
||||
static const int command_count = 561;
|
||||
|
||||
@@ -1097,9 +1097,6 @@ EX(CMD_pop, "pop", ex_tag,
|
||||
EX(CMD_popup, "popup", ex_popup,
|
||||
NEEDARG|EXTRA|BANG|TRLBAR|NOTRLCOM|CMDWIN,
|
||||
ADDR_NONE),
|
||||
EX(CMD_popupclear, "popupclear", ex_popupclear,
|
||||
TRLBAR,
|
||||
ADDR_NONE),
|
||||
EX(CMD_ppop, "ppop", ex_ptag,
|
||||
RANGE|BANG|COUNT|TRLBAR|ZEROR,
|
||||
ADDR_OTHER),
|
||||
|
||||
@@ -73,6 +73,7 @@ EXTERN short *TabPageIdxs INIT(= NULL);
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
// Array with size Rows x Columns containing zindex of popups.
|
||||
EXTERN short *popup_mask INIT(= NULL);
|
||||
EXTERN short *popup_mask_next INIT(= NULL);
|
||||
|
||||
// Flag set to TRUE when popup_mask needs to be updated.
|
||||
EXTERN int popup_mask_refresh INIT(= TRUE);
|
||||
|
||||
+4
-9
@@ -1247,6 +1247,9 @@ free_all_mem(void)
|
||||
/* screenlines (can't display anything now!) */
|
||||
free_screenlines();
|
||||
|
||||
# if defined(FEAT_SOUND)
|
||||
sound_free();
|
||||
# endif
|
||||
# if defined(USE_XSMP)
|
||||
xsmp_close();
|
||||
# endif
|
||||
@@ -3258,15 +3261,7 @@ call_shell(char_u *cmd, int opt)
|
||||
/* The external command may update a tags file, clear cached tags. */
|
||||
tag_freematch();
|
||||
|
||||
if (cmd == NULL || *p_sxq == NUL
|
||||
#if defined(FEAT_GUI_MSWIN) && defined(FEAT_TERMINAL)
|
||||
|| (
|
||||
# ifdef VIMDLL
|
||||
gui.in_use &&
|
||||
# endif
|
||||
vim_strchr(p_go, GO_TERMINAL) != NULL)
|
||||
#endif
|
||||
)
|
||||
if (cmd == NULL || *p_sxq == NUL)
|
||||
retval = mch_call_shell(cmd, opt);
|
||||
else
|
||||
{
|
||||
|
||||
+10
-8
@@ -571,8 +571,7 @@ popup_adjust_position(win_T *wp)
|
||||
|| org_width != wp->w_width
|
||||
|| org_height != wp->w_height)
|
||||
{
|
||||
// TODO: redraw only windows that were below the popup.
|
||||
redraw_all_later(NOT_VALID);
|
||||
redraw_all_later(VALID);
|
||||
popup_mask_refresh = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -710,6 +709,15 @@ popup_create(typval_T *argvars, typval_T *rettv, create_type_T type)
|
||||
popup_mask_refresh = TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* popup_clear()
|
||||
*/
|
||||
void
|
||||
f_popup_clear(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
{
|
||||
close_all_popups();
|
||||
}
|
||||
|
||||
/*
|
||||
* popup_create({text}, {options})
|
||||
*/
|
||||
@@ -928,12 +936,6 @@ close_all_popups(void)
|
||||
popup_close(curtab->tp_first_popupwin->w_id);
|
||||
}
|
||||
|
||||
void
|
||||
ex_popupclear(exarg_T *eap UNUSED)
|
||||
{
|
||||
close_all_popups();
|
||||
}
|
||||
|
||||
/*
|
||||
* popup_move({id}, {options})
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* popupwin.c */
|
||||
void popup_adjust_position(win_T *wp);
|
||||
void f_popup_clear(typval_T *argvars, typval_T *rettv);
|
||||
void f_popup_create(typval_T *argvars, typval_T *rettv);
|
||||
void f_popup_atcursor(typval_T *argvars, typval_T *rettv);
|
||||
int popup_any_visible(void);
|
||||
@@ -9,7 +10,6 @@ void f_popup_show(typval_T *argvars, typval_T *rettv);
|
||||
void popup_close(int id);
|
||||
void popup_close_tabpage(tabpage_T *tp, int id);
|
||||
void close_all_popups(void);
|
||||
void ex_popupclear(exarg_T *eap);
|
||||
void f_popup_move(typval_T *argvars, typval_T *rettv);
|
||||
void f_popup_getpos(typval_T *argvars, typval_T *rettv);
|
||||
void f_popup_getoptions(typval_T *argvars, typval_T *rettv);
|
||||
|
||||
@@ -16,7 +16,6 @@ int update_screen(int type_arg);
|
||||
int conceal_cursor_line(win_T *wp);
|
||||
void conceal_check_cursor_line(void);
|
||||
void update_debug_sign(buf_T *buf, linenr_T lnum);
|
||||
int may_update_popup_mask(int type_arg);
|
||||
void updateWindow(win_T *wp);
|
||||
int screen_get_current_line_off(void);
|
||||
void screen_line(int row, int coloff, int endcol, int clear_width, int flags);
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
void f_sound_playevent(typval_T *argvars, typval_T *rettv);
|
||||
void f_sound_playfile(typval_T *argvars, typval_T *rettv);
|
||||
void f_sound_stop(typval_T *argvars, typval_T *rettv);
|
||||
void f_sound_stopall(typval_T *argvars, typval_T *rettv);
|
||||
void f_sound_clear(typval_T *argvars, typval_T *rettv);
|
||||
void sound_free(void);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
+88
-32
@@ -122,6 +122,7 @@ static int redrawing_for_callback = 0;
|
||||
static schar_T *current_ScreenLine;
|
||||
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
static void may_update_popup_mask(int type);
|
||||
static void update_popups(void);
|
||||
#endif
|
||||
static void win_update(win_T *wp);
|
||||
@@ -616,8 +617,9 @@ update_screen(int type_arg)
|
||||
}
|
||||
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
// Update popup_mask if needed.
|
||||
type = may_update_popup_mask(type);
|
||||
// Update popup_mask if needed. This may set w_redraw_top and w_redraw_bot
|
||||
// in some windows.
|
||||
may_update_popup_mask(type);
|
||||
#endif
|
||||
|
||||
updating_screen = TRUE;
|
||||
@@ -1018,17 +1020,19 @@ get_wcr_attr(win_T *wp)
|
||||
}
|
||||
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
|
||||
/*
|
||||
* Update "popup_mask" if needed.
|
||||
* Also recomputes the popup size and positions.
|
||||
* Also updates "popup_visible".
|
||||
* If more redrawing is needed than "type_arg" a higher value is returned.
|
||||
* Also marks window lines for redrawing.
|
||||
*/
|
||||
int
|
||||
may_update_popup_mask(int type_arg)
|
||||
static void
|
||||
may_update_popup_mask(int type)
|
||||
{
|
||||
int type = type_arg;
|
||||
win_T *wp;
|
||||
short *mask;
|
||||
int line, col;
|
||||
|
||||
if (popup_mask_tab != curtab)
|
||||
popup_mask_refresh = TRUE;
|
||||
@@ -1042,14 +1046,22 @@ may_update_popup_mask(int type_arg)
|
||||
if (wp->w_popup_last_changedtick != CHANGEDTICK(wp->w_buffer))
|
||||
popup_mask_refresh = TRUE;
|
||||
if (!popup_mask_refresh)
|
||||
return type;
|
||||
return;
|
||||
}
|
||||
|
||||
// Need to update the mask, something has changed.
|
||||
popup_mask_refresh = FALSE;
|
||||
popup_mask_tab = curtab;
|
||||
|
||||
popup_visible = FALSE;
|
||||
vim_memset(popup_mask, 0, screen_Rows * screen_Columns * sizeof(short));
|
||||
|
||||
// If redrawing everything, just update "popup_mask".
|
||||
// If redrawing only what is needed, update "popup_mask_next" and then
|
||||
// compare with "popup_mask" to see what changed.
|
||||
if (type >= SOME_VALID)
|
||||
mask = popup_mask;
|
||||
else
|
||||
mask = popup_mask_next;
|
||||
vim_memset(mask, 0, screen_Rows * screen_Columns * sizeof(short));
|
||||
|
||||
// Find the window with the lowest zindex that hasn't been handled yet,
|
||||
// so that the window with a higher zindex overwrites the value in
|
||||
@@ -1057,10 +1069,7 @@ may_update_popup_mask(int type_arg)
|
||||
popup_reset_handled();
|
||||
while ((wp = find_next_popup(TRUE)) != NULL)
|
||||
{
|
||||
int top_off, bot_off;
|
||||
int left_off, right_off;
|
||||
short *p;
|
||||
int line, col;
|
||||
int height_extra, width_extra;
|
||||
|
||||
popup_visible = TRUE;
|
||||
|
||||
@@ -1068,30 +1077,71 @@ may_update_popup_mask(int type_arg)
|
||||
if (wp->w_popup_last_changedtick != CHANGEDTICK(wp->w_buffer))
|
||||
popup_adjust_position(wp);
|
||||
|
||||
// the position and size are for the inside, add the padding and
|
||||
// the width and height are for the inside, add the padding and
|
||||
// border
|
||||
top_off = wp->w_popup_padding[0] + wp->w_popup_border[0];
|
||||
bot_off = wp->w_popup_padding[2] + wp->w_popup_border[2];
|
||||
left_off = wp->w_popup_padding[3] + wp->w_popup_border[3];
|
||||
right_off = wp->w_popup_padding[1] + wp->w_popup_border[1];
|
||||
height_extra = wp->w_popup_padding[0] + wp->w_popup_border[0]
|
||||
+ wp->w_popup_padding[2] + wp->w_popup_border[2];
|
||||
width_extra = wp->w_popup_padding[3] + wp->w_popup_border[3]
|
||||
+ wp->w_popup_padding[1] + wp->w_popup_border[1];
|
||||
|
||||
for (line = wp->w_winrow + top_off;
|
||||
line < wp->w_winrow + wp->w_height + bot_off
|
||||
for (line = wp->w_winrow;
|
||||
line < wp->w_winrow + wp->w_height + height_extra
|
||||
&& line < screen_Rows; ++line)
|
||||
for (col = wp->w_wincol + left_off;
|
||||
col < wp->w_wincol + wp->w_width + right_off
|
||||
for (col = wp->w_wincol;
|
||||
col < wp->w_wincol + wp->w_width + width_extra
|
||||
&& col < screen_Columns; ++col)
|
||||
{
|
||||
p = popup_mask + line * screen_Columns + col;
|
||||
if (*p != wp->w_zindex)
|
||||
{
|
||||
*p = wp->w_zindex;
|
||||
type = NOT_VALID;
|
||||
}
|
||||
}
|
||||
mask[line * screen_Columns + col] = wp->w_zindex;
|
||||
}
|
||||
|
||||
return type;
|
||||
// Only check which lines are to be updated if not already
|
||||
// updating all lines.
|
||||
if (mask == popup_mask_next)
|
||||
for (line = 0; line < screen_Rows; ++line)
|
||||
{
|
||||
int col_done = 0;
|
||||
|
||||
for (col = 0; col < screen_Columns; ++col)
|
||||
{
|
||||
int off = line * screen_Columns + col;
|
||||
|
||||
if (popup_mask[off] != popup_mask_next[off])
|
||||
{
|
||||
popup_mask[off] = popup_mask_next[off];
|
||||
|
||||
// The screen position "line" / "col" needs to be redrawn.
|
||||
// Figure out what window that is and update w_redraw_top
|
||||
// and w_redr_bot. Only needs to be done for each window
|
||||
// line.
|
||||
if (col >= col_done)
|
||||
{
|
||||
linenr_T lnum;
|
||||
int line_cp = line;
|
||||
int col_cp = col;
|
||||
|
||||
// find the window where the row is in
|
||||
wp = mouse_find_win(&line_cp, &col_cp);
|
||||
if (wp != NULL)
|
||||
{
|
||||
if (line_cp >= wp->w_height)
|
||||
// In (or below) status line
|
||||
wp->w_redr_status = TRUE;
|
||||
// compute the position in the buffer line from the
|
||||
// position on the screen
|
||||
else if (mouse_comp_pos(wp, &line_cp, &col_cp,
|
||||
&lnum))
|
||||
// past bottom
|
||||
wp->w_redr_status = TRUE;
|
||||
else
|
||||
redrawWinline(wp, lnum);
|
||||
|
||||
// This line is going to be redrawn, no need to
|
||||
// check until the right side of the window.
|
||||
col_done = wp->w_wincol + wp->w_width - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -9161,6 +9211,7 @@ screenalloc(int doclear)
|
||||
short *new_TabPageIdxs;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
short *new_popup_mask;
|
||||
short *new_popup_mask_next;
|
||||
#endif
|
||||
tabpage_T *tp;
|
||||
static int entered = FALSE; /* avoid recursiveness */
|
||||
@@ -9245,6 +9296,7 @@ retry:
|
||||
new_TabPageIdxs = LALLOC_MULT(short, Columns);
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
new_popup_mask = LALLOC_MULT(short, Rows * Columns);
|
||||
new_popup_mask_next = LALLOC_MULT(short, Rows * Columns);
|
||||
#endif
|
||||
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
@@ -9290,6 +9342,7 @@ give_up:
|
||||
|| new_TabPageIdxs == NULL
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
|| new_popup_mask == NULL
|
||||
|| new_popup_mask_next == NULL
|
||||
#endif
|
||||
|| outofmem)
|
||||
{
|
||||
@@ -9313,6 +9366,7 @@ give_up:
|
||||
VIM_CLEAR(new_TabPageIdxs);
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
VIM_CLEAR(new_popup_mask);
|
||||
VIM_CLEAR(new_popup_mask_next);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -9402,6 +9456,7 @@ give_up:
|
||||
TabPageIdxs = new_TabPageIdxs;
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
popup_mask = new_popup_mask;
|
||||
popup_mask_next = new_popup_mask_next;
|
||||
vim_memset(popup_mask, 0, Rows * Columns * sizeof(short));
|
||||
popup_mask_refresh = TRUE;
|
||||
#endif
|
||||
@@ -9470,6 +9525,7 @@ free_screenlines(void)
|
||||
VIM_CLEAR(TabPageIdxs);
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
VIM_CLEAR(popup_mask);
|
||||
VIM_CLEAR(popup_mask_next);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -10076,7 +10132,7 @@ win_do_lines(
|
||||
}
|
||||
|
||||
#ifdef FEAT_TEXT_PROP
|
||||
// this doesn't work when tere are popups visible
|
||||
// this doesn't work when there are popups visible
|
||||
if (popup_visible)
|
||||
return FAIL;
|
||||
#endif
|
||||
|
||||
+10
-1
@@ -156,12 +156,18 @@ f_sound_playevent(typval_T *argvars, typval_T *rettv)
|
||||
sound_play_common(argvars, rettv, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* implementation of sound_playfile({path} [, {callback}])
|
||||
*/
|
||||
void
|
||||
f_sound_playfile(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
sound_play_common(argvars, rettv, TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* implementation of sound_stop({id})
|
||||
*/
|
||||
void
|
||||
f_sound_stop(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
{
|
||||
@@ -169,8 +175,11 @@ f_sound_stop(typval_T *argvars, typval_T *rettv UNUSED)
|
||||
ca_context_cancel(context, tv_get_number(&argvars[0]));
|
||||
}
|
||||
|
||||
/*
|
||||
* implementation of sound_clear()
|
||||
*/
|
||||
void
|
||||
f_sound_stopall(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
f_sound_clear(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
|
||||
{
|
||||
if (context != NULL)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
" Use this script to measure the redrawing performance when a popup is being
|
||||
" displayed. Usage with gcc:
|
||||
" cd src
|
||||
" # Edit Makefile to uncomment PROFILE_CFLAGS and PROFILE_LIBS
|
||||
" make reconfig
|
||||
" ./vim --clean -S testdir/popupbounce.vim main.c
|
||||
" gprof vim gmon.out | vim -
|
||||
|
||||
" using line contination
|
||||
set nocp
|
||||
|
||||
" don't switch screens when quitting, so we can read the frames/sec
|
||||
set t_te=
|
||||
|
||||
let winid = popup_create(['line1', 'line2', 'line3', 'line4'], {
|
||||
\ 'line' : 1,
|
||||
\ 'col' : 1,
|
||||
\ 'zindex' : 101,
|
||||
\ })
|
||||
redraw
|
||||
|
||||
let start = reltime()
|
||||
let framecount = 0
|
||||
|
||||
let line = 1.0
|
||||
let col = 1
|
||||
let downwards = 1
|
||||
let col_inc = 1
|
||||
let initial_speed = 0.2
|
||||
let speed = initial_speed
|
||||
let accel = 1.1
|
||||
let time = 0.1
|
||||
|
||||
let countdown = 0
|
||||
|
||||
while 1
|
||||
if downwards
|
||||
let speed += time * accel
|
||||
let line += speed
|
||||
else
|
||||
let speed -= time * accel
|
||||
let line -= speed
|
||||
endif
|
||||
|
||||
if line + 3 >= &lines
|
||||
let downwards = 0
|
||||
let speed = speed * 0.8
|
||||
let line = &lines - 3
|
||||
endif
|
||||
if !downwards && speed < 1.0
|
||||
let downwards = 1
|
||||
let speed = initial_speed
|
||||
if line + 4 > &lines && countdown == 0
|
||||
let countdown = 50
|
||||
endif
|
||||
endif
|
||||
|
||||
let col += col_inc
|
||||
if col + 4 >= &columns
|
||||
let col_inc = -1
|
||||
elseif col <= 1
|
||||
let col_inc = 1
|
||||
endif
|
||||
|
||||
call popup_move(winid, {'line': float2nr(line), 'col': col})
|
||||
redraw
|
||||
let framecount += 1
|
||||
if countdown > 0
|
||||
let countdown -= 1
|
||||
if countdown == 0
|
||||
break
|
||||
endif
|
||||
endif
|
||||
|
||||
endwhile
|
||||
|
||||
let elapsed = reltimefloat(reltime(start))
|
||||
echomsg framecount .. ' frames in ' .. string(elapsed) .. ' seconds, ' .. string(framecount / elapsed) .. ' frames/sec'
|
||||
|
||||
qa
|
||||
@@ -133,13 +133,6 @@ func RunTheTest(test)
|
||||
endtry
|
||||
endif
|
||||
|
||||
let message = 'Executed ' . a:test
|
||||
if has('reltime')
|
||||
let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds'
|
||||
endif
|
||||
call add(s:messages, message)
|
||||
let s:done += 1
|
||||
|
||||
if a:test =~ 'Test_nocatch_'
|
||||
" Function handles errors itself. This avoids skipping commands after the
|
||||
" error.
|
||||
@@ -193,6 +186,13 @@ func RunTheTest(test)
|
||||
endwhile
|
||||
|
||||
exe 'cd ' . save_cwd
|
||||
|
||||
let message = 'Executed ' . a:test
|
||||
if has('reltime')
|
||||
let message ..= ' in ' .. reltimestr(reltime(func_start)) .. ' seconds'
|
||||
endif
|
||||
call add(s:messages, message)
|
||||
let s:done += 1
|
||||
endfunc
|
||||
|
||||
func AfterTheTest()
|
||||
|
||||
@@ -61,7 +61,7 @@ func Test_simple_popup()
|
||||
call term_wait(buf)
|
||||
call term_sendkeys(buf, "0")
|
||||
call term_wait(buf)
|
||||
call term_sendkeys(buf, ":popupclear\<CR>")
|
||||
call term_sendkeys(buf, ":call popup_clear()\<CR>")
|
||||
call VerifyScreenDump(buf, 'Test_popupwin_08', {})
|
||||
|
||||
" clean up
|
||||
@@ -271,7 +271,7 @@ func Test_popup_in_tab()
|
||||
call assert_equal(0, popup_getpos(winid).visible)
|
||||
quit
|
||||
call assert_equal(1, popup_getpos(winid).visible)
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
" global popup is visible in any tab
|
||||
let winid = popup_create("text", {'tab': -1})
|
||||
@@ -280,7 +280,7 @@ func Test_popup_in_tab()
|
||||
call assert_equal(1, popup_getpos(winid).visible)
|
||||
quit
|
||||
call assert_equal(1, popup_getpos(winid).visible)
|
||||
popupclear
|
||||
call popup_clear()
|
||||
endfunc
|
||||
|
||||
func Test_popup_valid_arguments()
|
||||
@@ -288,13 +288,13 @@ func Test_popup_valid_arguments()
|
||||
let winid = popup_create("text", {"col": 0})
|
||||
let pos = popup_getpos(winid)
|
||||
call assert_inrange(&columns / 2 - 1, &columns / 2 + 1, pos.col)
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
" using cursor column has minimum value of 1
|
||||
let winid = popup_create("text", {"col": 'cursor-100'})
|
||||
let pos = popup_getpos(winid)
|
||||
call assert_equal(1, pos.col)
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
" center
|
||||
let winid = popup_create("text", {"pos": 'center'})
|
||||
@@ -303,57 +303,57 @@ func Test_popup_valid_arguments()
|
||||
call assert_inrange(around - 1, around + 1, pos.col)
|
||||
let around = (&lines - pos.height) / 2
|
||||
call assert_inrange(around - 1, around + 1, pos.line)
|
||||
popupclear
|
||||
call popup_clear()
|
||||
endfunc
|
||||
|
||||
func Test_popup_invalid_arguments()
|
||||
call assert_fails('call popup_create(666, {})', 'E714:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", "none")', 'E715:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
call assert_fails('call popup_create("text", {"col": "xxx"})', 'E475:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"col": "cursor8"})', 'E15:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"col": "cursor+x"})', 'E15:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"col": "cursor+8x"})', 'E15:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
call assert_fails('call popup_create("text", {"line": "xxx"})', 'E475:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"line": "cursor8"})', 'E15:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"line": "cursor+x"})', 'E15:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"line": "cursor+8x"})', 'E15:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
call assert_fails('call popup_create("text", {"pos": "there"})', 'E475:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"padding": "none"})', 'E714:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"border": "none"})', 'E714:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"borderhighlight": "none"})', 'E714:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create("text", {"borderchars": "none"})', 'E714:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
call assert_fails('call popup_create([{"text": "text"}, 666], {})', 'E715:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create([{"text": "text", "props": "none"}], {})', 'E714:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
call assert_fails('call popup_create([{"text": "text", "props": ["none"]}], {})', 'E715:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
endfunc
|
||||
|
||||
func Test_win_execute_closing_curwin()
|
||||
split
|
||||
let winid = popup_create('some text', {})
|
||||
call assert_fails('call win_execute(winid, winnr() .. "close")', 'E994')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
endfunc
|
||||
|
||||
func Test_win_execute_not_allowed()
|
||||
@@ -374,7 +374,7 @@ func Test_win_execute_not_allowed()
|
||||
call assert_fails('call win_execute(winid, "wincmd w")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "wincmd t")', 'E994:')
|
||||
call assert_fails('call win_execute(winid, "wincmd b")', 'E994:')
|
||||
popupclear
|
||||
call popup_clear()
|
||||
endfunc
|
||||
|
||||
func Test_popup_with_wrap()
|
||||
@@ -770,7 +770,7 @@ func Test_popup_filter()
|
||||
call assert_equal(-1, winbufnr(winid))
|
||||
|
||||
delfunc MyPopupFilter
|
||||
popupclear
|
||||
call popup_clear()
|
||||
endfunc
|
||||
|
||||
func Test_popup_close_callback()
|
||||
@@ -944,7 +944,7 @@ func Test_popup_position_adjust()
|
||||
endfor
|
||||
endfor
|
||||
|
||||
popupclear
|
||||
call popup_clear()
|
||||
%bwipe!
|
||||
endfunc
|
||||
|
||||
@@ -1010,7 +1010,7 @@ func Test_adjust_left_past_screen_width()
|
||||
call popup_close( p )
|
||||
redraw
|
||||
|
||||
popupclear
|
||||
call popup_clear()
|
||||
%bwipe!
|
||||
endfunc
|
||||
|
||||
@@ -1026,7 +1026,7 @@ func Test_popup_moved()
|
||||
" trigger the check for last_cursormoved by going into insert mode
|
||||
call feedkeys("li\<Esc>", 'xt')
|
||||
call assert_equal({}, popup_getpos(winid))
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
exe "normal gg0/word\<CR>"
|
||||
let winid = popup_atcursor('text', {'moved': 'word'})
|
||||
@@ -1034,7 +1034,7 @@ func Test_popup_moved()
|
||||
call assert_equal(1, popup_getpos(winid).visible)
|
||||
call feedkeys("hi\<Esc>", 'xt')
|
||||
call assert_equal({}, popup_getpos(winid))
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
exe "normal gg0/word\<CR>"
|
||||
let winid = popup_atcursor('text', {'moved': 'word'})
|
||||
@@ -1046,7 +1046,7 @@ func Test_popup_moved()
|
||||
call assert_equal(1, popup_getpos(winid).visible)
|
||||
call feedkeys("eli\<Esc>", 'xt')
|
||||
call assert_equal({}, popup_getpos(winid))
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
" WORD is the default
|
||||
exe "normal gg0/WORD\<CR>"
|
||||
@@ -1059,7 +1059,7 @@ func Test_popup_moved()
|
||||
call assert_equal(1, popup_getpos(winid).visible)
|
||||
call feedkeys("Eli\<Esc>", 'xt')
|
||||
call assert_equal({}, popup_getpos(winid))
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
exe "normal gg0/word\<CR>"
|
||||
let winid = popup_atcursor('text', {'moved': [5, 10]})
|
||||
@@ -1070,7 +1070,7 @@ func Test_popup_moved()
|
||||
call assert_equal(1, popup_getpos(winid).visible)
|
||||
call feedkeys("eli\<Esc>", 'xt')
|
||||
call assert_equal({}, popup_getpos(winid))
|
||||
popupclear
|
||||
call popup_clear()
|
||||
|
||||
bwipe!
|
||||
call test_override('ALL', 0)
|
||||
|
||||
@@ -41,7 +41,7 @@ func Test_play_silent()
|
||||
let id2 = sound_playfile(fname, 'PlayCallback')
|
||||
call assert_true(id2 > 0)
|
||||
sleep 20m
|
||||
call sound_stopall()
|
||||
call sound_clear()
|
||||
call assert_equal(id2, g:id)
|
||||
call assert_equal(1, g:result)
|
||||
endfunc
|
||||
|
||||
@@ -3262,15 +3262,19 @@ retnomove:
|
||||
|| curwin->w_cursor.col != old_cursor.col)
|
||||
count |= CURSOR_MOVED; /* Cursor has moved */
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
# ifdef FEAT_FOLDING
|
||||
if (mouse_char == '+')
|
||||
count |= MOUSE_FOLD_OPEN;
|
||||
else if (mouse_char != ' ')
|
||||
count |= MOUSE_FOLD_CLOSE;
|
||||
#endif
|
||||
# endif
|
||||
|
||||
return count;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Functions also used for popup windows.
|
||||
#if defined(FEAT_MOUSE) || defined(FEAT_TEXT_PROP) || defined(PROTO)
|
||||
|
||||
/*
|
||||
* Compute the position in the buffer line from the posn on the screen in
|
||||
@@ -3367,7 +3371,7 @@ mouse_comp_pos(
|
||||
* Returns NULL when something is wrong.
|
||||
*/
|
||||
win_T *
|
||||
mouse_find_win(int *rowp, int *colp UNUSED)
|
||||
mouse_find_win(int *rowp, int *colp)
|
||||
{
|
||||
frame_T *fp;
|
||||
win_T *wp;
|
||||
|
||||
@@ -792,6 +792,16 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1517,
|
||||
/**/
|
||||
1516,
|
||||
/**/
|
||||
1515,
|
||||
/**/
|
||||
1514,
|
||||
/**/
|
||||
1513,
|
||||
/**/
|
||||
1512,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user