/
usr
/
share
/
vim
/
vim80
/
doc
/
/usr/share/vim/vim80/doc
mkdir
upload
Name
Size
Mode
Actions
arabic.txt
11936
0644
edit
dl
rm
autocmd.txt
65402
0644
edit
dl
rm
change.txt
74877
0644
edit
dl
rm
channel.txt
30819
0644
edit
dl
rm
cmdline.txt
47283
0644
edit
dl
rm
debug.txt
7182
0644
edit
dl
rm
debugger.txt
5744
0644
edit
dl
rm
develop.txt
22344
0644
edit
dl
rm
diff.txt
16525
0644
edit
dl
rm
digraph.txt
62123
0644
edit
dl
rm
editing.txt
73176
0644
edit
dl
rm
eval.txt
444462
0644
edit
dl
rm
farsi.txt
9703
0644
edit
dl
rm
filetype.txt
26647
0644
edit
dl
rm
fold.txt
23694
0644
edit
dl
rm
ft_ada.txt
18247
0644
edit
dl
rm
ft_rust.txt
9526
0644
edit
dl
rm
ft_sql.txt
30694
0644
edit
dl
rm
gui.txt
45592
0644
edit
dl
rm
gui_w32.txt
18916
0644
edit
dl
rm
gui_x11.txt
29480
0644
edit
dl
rm
hangulin.txt
3291
0644
edit
dl
rm
hebrew.txt
5714
0644
edit
dl
rm
help.txt
8578
0644
edit
dl
rm
helphelp.txt
14338
0644
edit
dl
rm
howto.txt
2911
0644
edit
dl
rm
if_cscop.txt
19361
0644
edit
dl
rm
if_lua.txt
14642
0644
edit
dl
rm
if_mzsch.txt
11823
0644
edit
dl
rm
if_ole.txt
7405
0644
edit
dl
rm
if_perl.txt
11149
0644
edit
dl
rm
if_pyth.txt
37944
0644
edit
dl
rm
if_ruby.txt
8014
0644
edit
dl
rm
if_sniff.txt
266
0644
edit
dl
rm
if_tcl.txt
23026
0644
edit
dl
rm
indent.txt
39427
0644
edit
dl
rm
index.txt
76443
0644
edit
dl
rm
insert.txt
83156
0644
edit
dl
rm
intro.txt
39226
0644
edit
dl
rm
map.txt
64668
0644
edit
dl
rm
mbyte.txt
59306
0644
edit
dl
rm
message.txt
31230
0644
edit
dl
rm
mlang.txt
7850
0644
edit
dl
rm
motion.txt
51602
0644
edit
dl
rm
netbeans.txt
36998
0644
edit
dl
rm
options.txt
389116
0644
edit
dl
rm
os_390.txt
4753
0644
edit
dl
rm
os_amiga.txt
5461
0644
edit
dl
rm
os_beos.txt
10983
0644
edit
dl
rm
os_dos.txt
12021
0644
edit
dl
rm
os_mac.txt
6851
0644
edit
dl
rm
os_mint.txt
1402
0644
edit
dl
rm
os_msdos.txt
518
0644
edit
dl
rm
os_os2.txt
294
0644
edit
dl
rm
os_qnx.txt
4071
0644
edit
dl
rm
os_risc.txt
323
0644
edit
dl
rm
os_unix.txt
2595
0644
edit
dl
rm
os_vms.txt
32100
0644
edit
dl
rm
os_win32.txt
13348
0644
edit
dl
rm
pattern.txt
59321
0644
edit
dl
rm
pi_getscript.txt
21078
0644
edit
dl
rm
pi_gzip.txt
1321
0644
edit
dl
rm
pi_logipat.txt
4186
0644
edit
dl
rm
pi_netrw.txt
175550
0644
edit
dl
rm
pi_paren.txt
2269
0644
edit
dl
rm
pi_spec.txt
4122
0644
edit
dl
rm
pi_tar.txt
6223
0644
edit
dl
rm
pi_vimball.txt
11853
0644
edit
dl
rm
pi_zip.txt
7229
0644
edit
dl
rm
print.txt
31158
0644
edit
dl
rm
quickfix.txt
69021
0644
edit
dl
rm
quickref.txt
71256
0644
edit
dl
rm
quotes.txt
12743
0644
edit
dl
rm
recover.txt
10694
0644
edit
dl
rm
remote.txt
8420
0644
edit
dl
rm
repeat.txt
39573
0644
edit
dl
rm
rileft.txt
4976
0644
edit
dl
rm
russian.txt
3090
0644
edit
dl
rm
scroll.txt
14071
0644
edit
dl
rm
sign.txt
6891
0644
edit
dl
rm
spell.txt
62781
0644
edit
dl
rm
sponsor.txt
7198
0644
edit
dl
rm
starting.txt
73622
0644
edit
dl
rm
syntax.txt
217471
0644
edit
dl
rm
tabpage.txt
16720
0644
edit
dl
rm
tags
328832
0644
edit
dl
rm
tagsrch.txt
36636
0644
edit
dl
rm
term.txt
45416
0644
edit
dl
rm
terminal.txt
33567
0644
edit
dl
rm
tips.txt
20556
0644
edit
dl
rm
todo.txt
296268
0644
edit
dl
rm
uganda.txt
14024
0644
edit
dl
rm
undo.txt
16539
0644
edit
dl
rm
usr_01.txt
7090
0644
edit
dl
rm
usr_02.txt
24339
0644
edit
dl
rm
usr_03.txt
23605
0644
edit
dl
rm
usr_04.txt
19082
0644
edit
dl
rm
usr_05.txt
23824
0644
edit
dl
rm
usr_06.txt
9587
0644
edit
dl
rm
usr_07.txt
15984
0644
edit
dl
rm
usr_08.txt
19374
0644
edit
dl
rm
usr_09.txt
11450
0644
edit
dl
rm
usr_10.txt
29180
0644
edit
dl
rm
usr_11.txt
12611
0644
edit
dl
rm
usr_12.txt
13424
0644
edit
dl
rm
usr_20.txt
13703
0644
edit
dl
rm
usr_21.txt
18373
0644
edit
dl
rm
usr_22.txt
14297
0644
edit
dl
rm
usr_23.txt
12588
0644
edit
dl
rm
usr_24.txt
20869
0644
edit
dl
rm
usr_25.txt
19114
0644
edit
dl
rm
usr_26.txt
8254
0644
edit
dl
rm
usr_27.txt
17723
0644
edit
dl
rm
usr_28.txt
16015
0644
edit
dl
rm
usr_29.txt
20116
0644
edit
dl
rm
usr_30.txt
22656
0644
edit
dl
rm
usr_31.txt
10394
0644
edit
dl
rm
usr_32.txt
5373
0644
edit
dl
rm
usr_40.txt
23184
0644
edit
dl
rm
usr_41.txt
89301
0644
edit
dl
rm
usr_42.txt
13798
0644
edit
dl
rm
usr_43.txt
7404
0644
edit
dl
rm
usr_44.txt
29211
0644
edit
dl
rm
usr_45.txt
17912
0644
edit
dl
rm
usr_90.txt
17661
0644
edit
dl
rm
usr_toc.txt
9218
0644
edit
dl
rm
various.txt
28852
0644
edit
dl
rm
version4.txt
13906
0644
edit
dl
rm
version5.txt
308543
0644
edit
dl
rm
version6.txt
577052
0644
edit
dl
rm
version7.txt
674766
0644
edit
dl
rm
version8.txt
684252
0644
edit
dl
rm
visual.txt
21843
0644
edit
dl
rm
vi_diff.txt
42812
0644
edit
dl
rm
windows.txt
53030
0644
edit
dl
rm
workshop.txt
4631
0644
edit
dl
rm
Edit:
/usr/share/vim/vim80/doc/if_ruby.txt
(8014B)
*if_ruby.txt* For Vim version 8.0. Last change: 2018 Mar 15 VIM REFERENCE MANUAL by Shugo Maeda The Ruby Interface to Vim *ruby* *Ruby* 1. Commands |ruby-commands| 2. The Vim module |ruby-vim| 3. Vim::Buffer objects |ruby-buffer| 4. Vim::Window objects |ruby-window| 5. Global variables |ruby-globals| 6. Dynamic loading |ruby-dynamic| {Vi does not have any of these commands} *E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273* The Ruby interface only works when Vim was compiled with the |+ruby| feature. The home page for ruby is http://www.ruby-lang.org/. You can find links for downloading Ruby there. ============================================================================== 1. Commands *ruby-commands* *:ruby* *:rub* :rub[y] {cmd} Execute Ruby command {cmd}. A command to try it out: > :ruby print "Hello" :rub[y] << {endpattern} {script} {endpattern} Execute Ruby script {script}. {endpattern} must NOT be preceded by any white space. If {endpattern} is omitted, it defaults to a dot '.' like for the |:append| and |:insert| commands. This form of the |:ruby| command is mainly useful for including ruby code in vim scripts. Note: This command doesn't work when the Ruby feature wasn't compiled in. To avoid errors, see |script-here|. Example Vim script: > function! RedGem() ruby << EOF class Garnet def initialize(s) @buffer = Vim::Buffer.current vimputs(s) end def vimputs(s) @buffer.append(@buffer.count,s) end end gem = Garnet.new("pretty") EOF endfunction < To see what version of Ruby you have: > :ruby print RUBY_VERSION < *:rubydo* *:rubyd* *E265* :[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the [range], with $_ being set to the text of each line in turn, without a trailing <EOL>. Setting $_ will change the text, but note that it is not possible to add or delete lines using this command. The default for [range] is the whole file: "1,$". *:rubyfile* *:rubyf* :rubyf[ile] {file} Execute the Ruby script in {file}. This is the same as `:ruby load 'file'`, but allows file name completion. Executing Ruby commands is not possible in the |sandbox|. ============================================================================== 2. The Vim module *ruby-vim* Ruby code gets all of its access to vim via the "Vim" module. Overview: > print "Hello" # displays a message Vim.command(cmd) # execute an Ex command num = Vim::Window.count # gets the number of windows w = Vim::Window[n] # gets window "n" cw = Vim::Window.current # gets the current window num = Vim::Buffer.count # gets the number of buffers b = Vim::Buffer[n] # gets buffer "n" cb = Vim::Buffer.current # gets the current buffer w.height = lines # sets the window height w.cursor = [row, col] # sets the window cursor position pos = w.cursor # gets an array [row, col] name = b.name # gets the buffer file name line = b[n] # gets a line from the buffer num = b.count # gets the number of lines b[n] = str # sets a line in the buffer b.delete(n) # deletes a line b.append(n, str) # appends a line after n line = Vim::Buffer.current.line # gets the current line num = Vim::Buffer.current.line_number # gets the current line number Vim::Buffer.current.line = "test" # sets the current line number < Module Functions: *ruby-message* Vim::message({msg}) Displays the message {msg}. *ruby-set_option* Vim::set_option({arg}) Sets a vim option. {arg} can be any argument that the ":set" command accepts. Note that this means that no spaces are allowed in the argument! See |:set|. *ruby-command* Vim::command({cmd}) Executes Ex command {cmd}. *ruby-evaluate* Vim::evaluate({expr}) Evaluates {expr} using the vim internal expression evaluator (see |expression|). Returns the expression result as: - a Integer if the Vim expression evaluates to a number - a Float if the Vim expression evaluates to a float - a String if the Vim expression evaluates to a string - a Array if the Vim expression evaluates to a Vim list - a Hash if the Vim expression evaluates to a Vim dictionary Dictionaries and lists are recursively expanded. ============================================================================== 3. Vim::Buffer objects *ruby-buffer* Vim::Buffer objects represent vim buffers. Class Methods: current Returns the current buffer object. count Returns the number of buffers. self[{n}] Returns the buffer object for the number {n}. The first number is 0. Methods: name Returns the name of the buffer. number Returns the number of the buffer. count Returns the number of lines. length Returns the number of lines. self[{n}] Returns a line from the buffer. {n} is the line number. self[{n}] = {str} Sets a line in the buffer. {n} is the line number. delete({n}) Deletes a line from the buffer. {n} is the line number. append({n}, {str}) Appends a line after the line {n}. line Returns the current line of the buffer if the buffer is active. line = {str} Sets the current line of the buffer if the buffer is active. line_number Returns the number of the current line if the buffer is active. ============================================================================== 4. Vim::Window objects *ruby-window* Vim::Window objects represent vim windows. Class Methods: current Returns the current window object. count Returns the number of windows. self[{n}] Returns the window object for the number {n}. The first number is 0. Methods: buffer Returns the buffer displayed in the window. height Returns the height of the window. height = {n} Sets the window height to {n}. width Returns the width of the window. width = {n} Sets the window width to {n}. cursor Returns a [row, col] array for the cursor position. cursor = [{row}, {col}] Sets the cursor position to {row} and {col}. ============================================================================== 5. Global variables *ruby-globals* There are two global variables. $curwin The current window object. $curbuf The current buffer object. ============================================================================== 6. Dynamic loading *ruby-dynamic* On MS-Windows and Unix the Ruby library can be loaded dynamically. The |:version| output then includes |+ruby/dyn|. This means that Vim will search for the Ruby DLL file or shared library only when needed. When you don't use the Ruby interface you don't need it, thus you can use Vim even though this library file is not on your system. MS-Windows ~ You need to install the right version of Ruby for this to work. You can find the package to download from: http://rubyinstaller.org/downloads/ Currently that is rubyinstaller-2.2.5.exe To use the Ruby interface the Ruby DLL must be in your search path. In a console window type "path" to see what directories are used. The 'rubydll' option can be also used to specify the Ruby DLL. The name of the DLL must match the Ruby version Vim was compiled with. Currently the name is "msvcrt-ruby220.dll". That is for Ruby 2.2.X. To know for sure edit "gvim.exe" and search for "ruby\d*.dll\c". If you want to build Vim with RubyInstaller 1.9 or 2.X using MSVC, you need some tricks. See the src/INSTALLpc.txt for detail. If Vim is built with RubyInstaller 2.4 or later, you may also need to add "C:\Ruby<version>\bin\ruby_builtin_dlls" to the PATH environment variable. Unix ~ The 'rubydll' option can be used to specify the Ruby shared library file instead of DYNAMIC_RUBY_DLL file what was specified at compile time. The version of the shared library must match the Ruby version Vim was compiled with. ============================================================================== vim:tw=78:ts=8:ft=help:norl:
Save
cmd:
run