mirror of
https://github.com/amix/vimrc
synced 2025-06-17 10:55:00 +08:00
Added and updated some plugins
Added: vim-ruby, typescript-vim, vim-javascript Updated: rust-vim
This commit is contained in:
109
sources_non_forked/vim-ruby/doc/ft-ruby-indent.txt
Normal file
109
sources_non_forked/vim-ruby/doc/ft-ruby-indent.txt
Normal file
@ -0,0 +1,109 @@
|
||||
RUBY *ft-ruby-indent*
|
||||
|
||||
Ruby: Access modifier indentation |ruby-access-modifier-indentation|
|
||||
Ruby: Block style indentation |ruby-block-style-indentation|
|
||||
Ruby: Assignment style indentation |ruby-assignment-style-indentation|
|
||||
|
||||
*ruby-access-modifier-indentation*
|
||||
*g:ruby_indent_access_modifier_style*
|
||||
Ruby: Access modifier indentation ~
|
||||
|
||||
Different access modifier indentation styles can be used by setting: >
|
||||
|
||||
:let g:ruby_indent_access_modifier_style = 'normal'
|
||||
:let g:ruby_indent_access_modifier_style = 'indent'
|
||||
:let g:ruby_indent_access_modifier_style = 'outdent'
|
||||
<
|
||||
By default, the "normal" access modifier style is used.
|
||||
|
||||
Access modifier style "normal":
|
||||
>
|
||||
class Indent
|
||||
private :method
|
||||
protected :method
|
||||
private
|
||||
def method; end
|
||||
protected
|
||||
def method; end
|
||||
public
|
||||
def method; end
|
||||
end
|
||||
<
|
||||
Access modifier style "indent":
|
||||
>
|
||||
class Indent
|
||||
private :method
|
||||
protected :method
|
||||
private
|
||||
def method; end
|
||||
protected
|
||||
def method; end
|
||||
public
|
||||
def method; end
|
||||
end
|
||||
<
|
||||
Access modifier style "outdent":
|
||||
>
|
||||
class Indent
|
||||
private :method
|
||||
protected :method
|
||||
private
|
||||
def method; end
|
||||
protected
|
||||
def method; end
|
||||
public
|
||||
def method; end
|
||||
end
|
||||
<
|
||||
*ruby-block-style-indentation*
|
||||
*g:ruby_indent_block_style*
|
||||
Ruby: Block style indentation ~
|
||||
|
||||
Different block indentation styles can be used by setting: >
|
||||
|
||||
:let g:ruby_indent_block_style = 'expression'
|
||||
:let g:ruby_indent_block_style = 'do'
|
||||
<
|
||||
By default, the "expression" block indent style is used.
|
||||
|
||||
Block indent style "expression":
|
||||
>
|
||||
first
|
||||
.second do |x|
|
||||
something
|
||||
end
|
||||
<
|
||||
Block indent style "do":
|
||||
>
|
||||
first
|
||||
.second do |x|
|
||||
something
|
||||
end
|
||||
<
|
||||
|
||||
*ruby-assignment-style-indentation*
|
||||
*g:ruby_indent_assignment_style*
|
||||
Ruby: Assignment style indentation ~
|
||||
|
||||
Different styles of indenting assignment for multiline expressions:
|
||||
>
|
||||
:let g:ruby_indent_assignment_style = 'hanging'
|
||||
:let g:ruby_indent_assignment_style = 'variable'
|
||||
<
|
||||
By default, the "hanging" style is used.
|
||||
|
||||
Assignment indent style "hanging":
|
||||
>
|
||||
x = if condition
|
||||
something
|
||||
end
|
||||
<
|
||||
Assignment indent style "variable":
|
||||
>
|
||||
x = if condition
|
||||
something
|
||||
end
|
||||
<
|
||||
|
||||
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
51
sources_non_forked/vim-ruby/doc/ft-ruby-omni.txt
Normal file
51
sources_non_forked/vim-ruby/doc/ft-ruby-omni.txt
Normal file
@ -0,0 +1,51 @@
|
||||
RUBY *ft-ruby-omni*
|
||||
|
||||
Completion of Ruby code requires that Vim be built with |+ruby|.
|
||||
|
||||
Ruby completion will parse your buffer on demand in order to provide a list of
|
||||
completions. These completions will be drawn from modules loaded by "require"
|
||||
and modules defined in the current buffer.
|
||||
|
||||
The completions provided by CTRL-X CTRL-O are sensitive to the context:
|
||||
|
||||
CONTEXT COMPLETIONS PROVIDED ~
|
||||
|
||||
1. Not inside a class definition Classes, constants and globals
|
||||
|
||||
2. Inside a class definition Methods or constants defined in the class
|
||||
|
||||
3. After '.', '::' or ':' Methods applicable to the object being
|
||||
dereferenced
|
||||
|
||||
4. After ':' or ':foo' Symbol name (beginning with "foo")
|
||||
|
||||
Notes:
|
||||
- Vim will load/evaluate code in order to provide completions. This may
|
||||
cause some code execution, which may be a concern. This is no longer
|
||||
enabled by default, to enable this feature add >
|
||||
let g:rubycomplete_buffer_loading = 1
|
||||
< - In context 1 above, Vim can parse the entire buffer to add a list of
|
||||
classes to the completion results. This feature is turned off by default,
|
||||
to enable it add >
|
||||
let g:rubycomplete_classes_in_global = 1
|
||||
< to your vimrc
|
||||
- In context 2 above, anonymous classes are not supported.
|
||||
- In context 3 above, Vim will attempt to determine the methods supported by
|
||||
the object.
|
||||
- Vim can detect and load the Rails environment for files within a rails
|
||||
project. The feature is disabled by default, to enable it add >
|
||||
let g:rubycomplete_rails = 1
|
||||
< to your vimrc
|
||||
- Vim can parse a Gemfile, in case gems are being implicitly required. To
|
||||
activate the feature: >
|
||||
let g:rubycomplete_load_gemfile = 1
|
||||
< To specify an alternative path, use: >
|
||||
let g:rubycomplete_gemfile_path = 'Gemfile.aux'
|
||||
< To use Bundler.require instead of parsing the Gemfile, set: >
|
||||
let g:rubycomplete_use_bundler = 1
|
||||
< To use custom paths that should be added to $LOAD_PATH to correctly
|
||||
resolve requires, set: >
|
||||
let g:rubycomplete_load_paths = ["/path/to/code", "./lib/example"]
|
||||
|
||||
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
79
sources_non_forked/vim-ruby/doc/ft-ruby-plugin.txt
Normal file
79
sources_non_forked/vim-ruby/doc/ft-ruby-plugin.txt
Normal file
@ -0,0 +1,79 @@
|
||||
RUBY *ft-ruby-plugin*
|
||||
|
||||
Ruby: Recommended settings |ruby-recommended|
|
||||
Ruby: Motion commands |ruby-motion|
|
||||
Ruby: Text objects |ruby-text-objects|
|
||||
|
||||
*ruby-recommended*
|
||||
*g:ruby_recommended_style*
|
||||
Ruby: Recommended settings ~
|
||||
|
||||
The `g:ruby_recommended_style` variable activates indentation settings
|
||||
according to the most common ruby convention: two spaces for indentation. It's
|
||||
turned on by default to ensure an unsurprising default experience for most
|
||||
ruby developers.
|
||||
|
||||
If you'd like to enforce your own style, it's possible to apply your own
|
||||
preferences in your own configuration in `after/ftplugin/ruby.vim`. You can
|
||||
also disable the setting by setting the variable to 0:
|
||||
>
|
||||
let g:ruby_recommended_style = 0
|
||||
<
|
||||
|
||||
*ruby-motion*
|
||||
Ruby: Motion commands ~
|
||||
|
||||
Vim provides motions such as |[m| and |]m| for jumping to the start or end of
|
||||
a method definition. Out of the box, these work for curly-bracket languages,
|
||||
but not for Ruby. The vim-ruby plugin enhances these motions, by making them
|
||||
also work on Ruby files.
|
||||
|
||||
*ruby-]m*
|
||||
]m Go to start of next method definition.
|
||||
|
||||
*ruby-]M*
|
||||
]M Go to end of next method definition.
|
||||
|
||||
*ruby-[m*
|
||||
[m Go to start of previous method definition.
|
||||
|
||||
*ruby-[M*
|
||||
[M Go to end of previous method definition.
|
||||
|
||||
*ruby-]]*
|
||||
]] Go to start of next module or class definition.
|
||||
|
||||
*ruby-][*
|
||||
][ Go to end of next module or class definition.
|
||||
|
||||
*ruby-[[*
|
||||
[[ Go to start of previous module or class definition.
|
||||
|
||||
*ruby-[]*
|
||||
[] Go to end of previous module or class definition.
|
||||
|
||||
*ruby-text-objects*
|
||||
Ruby: Text objects ~
|
||||
|
||||
Vim's |text-objects| can be used to select or operate upon regions of text
|
||||
that are defined by structure. The vim-ruby plugin adds text objects for
|
||||
operating on methods and classes.
|
||||
|
||||
*ruby-v_am* *ruby-am*
|
||||
am "a method", select from "def" until matching "end"
|
||||
keyword.
|
||||
|
||||
*ruby-v_im* *ruby-im*
|
||||
im "inner method", select contents of "def"/"end" block,
|
||||
excluding the "def" and "end" themselves.
|
||||
|
||||
*ruby-v_aM* *ruby-aM*
|
||||
aM "a class", select from "class" until matching "end"
|
||||
keyword.
|
||||
|
||||
*ruby-v_iM* *ruby-iM*
|
||||
iM "inner class", select contents of "class"/"end"
|
||||
block, excluding the "class" and "end" themselves.
|
||||
|
||||
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
118
sources_non_forked/vim-ruby/doc/ft-ruby-syntax.txt
Normal file
118
sources_non_forked/vim-ruby/doc/ft-ruby-syntax.txt
Normal file
@ -0,0 +1,118 @@
|
||||
RUBY *ruby.vim* *ft-ruby-syntax*
|
||||
|
||||
Ruby: Operator highlighting |ruby_operators|
|
||||
Ruby: Whitespace errors |ruby_space_errors|
|
||||
Ruby: Syntax errors |ruby_syntax_errors|
|
||||
Ruby: Folding |ruby_fold| |ruby_foldable_groups|
|
||||
Ruby: Reducing expensive operations |ruby_no_expensive| |ruby_minlines|
|
||||
Ruby: Spellchecking strings |ruby_spellcheck_strings|
|
||||
|
||||
*ruby_operators*
|
||||
Ruby: Operator highlighting ~
|
||||
|
||||
Operators, and pseudo operators, can be highlighted by defining: >
|
||||
|
||||
:let ruby_operators = 1
|
||||
:let ruby_pseudo_operators = 1
|
||||
<
|
||||
The supported pseudo operators are ., &., ::, *, **, &, <, << and ->.
|
||||
|
||||
*ruby_space_errors*
|
||||
Ruby: Whitespace errors ~
|
||||
|
||||
Whitespace errors can be highlighted by defining "ruby_space_errors": >
|
||||
|
||||
:let ruby_space_errors = 1
|
||||
<
|
||||
This will highlight trailing whitespace and tabs preceded by a space character
|
||||
as errors. This can be refined by defining "ruby_no_trail_space_error" and
|
||||
"ruby_no_tab_space_error" which will ignore trailing whitespace and tabs after
|
||||
spaces respectively.
|
||||
|
||||
*ruby_syntax_errors*
|
||||
Ruby: Syntax errors ~
|
||||
|
||||
Redundant line continuations and predefined global variable look-alikes (such
|
||||
as $# and $-z) can be highlighted as errors by defining:
|
||||
>
|
||||
:let ruby_line_continuation_error = 1
|
||||
:let ruby_global_variable_error = 1
|
||||
<
|
||||
*ruby_fold*
|
||||
Ruby: Folding ~
|
||||
|
||||
Folding can be enabled by defining "ruby_fold": >
|
||||
|
||||
:let ruby_fold = 1
|
||||
<
|
||||
This will set the value of 'foldmethod' to "syntax" locally to the current
|
||||
buffer or window, which will enable syntax-based folding when editing Ruby
|
||||
filetypes.
|
||||
|
||||
*ruby_foldable_groups*
|
||||
Default folding is rather detailed, i.e., small syntax units like "if", "do",
|
||||
"%w[]" may create corresponding fold levels.
|
||||
|
||||
You can set "ruby_foldable_groups" to restrict which groups are foldable: >
|
||||
|
||||
:let ruby_foldable_groups = 'if case %'
|
||||
<
|
||||
The value is a space-separated list of keywords:
|
||||
|
||||
keyword meaning ~
|
||||
-------- ------------------------------------- ~
|
||||
ALL Most block syntax (default)
|
||||
NONE Nothing
|
||||
if "if" or "unless" block
|
||||
def "def" block
|
||||
class "class" block
|
||||
module "module" block
|
||||
do "do" block
|
||||
begin "begin" block
|
||||
case "case" block
|
||||
for "for", "while", "until" loops
|
||||
{ Curly bracket block or hash literal
|
||||
[ Array literal
|
||||
% Literal with "%" notation, e.g.: %w(STRING), %!STRING!
|
||||
/ Regexp
|
||||
string String and shell command output (surrounded by ', ", `)
|
||||
: Symbol
|
||||
# Multiline comment
|
||||
<< Here documents
|
||||
__END__ Source code after "__END__" directive
|
||||
|
||||
NONE and ALL have priority, in that order, over all other folding groups.
|
||||
|
||||
*ruby_no_expensive*
|
||||
Ruby: Reducing expensive operations ~
|
||||
|
||||
By default, the "end" keyword is colorized according to the opening statement
|
||||
of the block it closes. While useful, this feature can be expensive; if you
|
||||
experience slow redrawing (or you are on a terminal with poor color support)
|
||||
you may want to turn it off by defining the "ruby_no_expensive" variable: >
|
||||
|
||||
:let ruby_no_expensive = 1
|
||||
<
|
||||
In this case the same color will be used for all control keywords.
|
||||
|
||||
*ruby_minlines*
|
||||
|
||||
If you do want this feature enabled, but notice highlighting errors while
|
||||
scrolling backwards, which are fixed when redrawing with CTRL-L, try setting
|
||||
the "ruby_minlines" variable to a value larger than 50: >
|
||||
|
||||
:let ruby_minlines = 100
|
||||
<
|
||||
Ideally, this value should be a number of lines large enough to embrace your
|
||||
largest class or module.
|
||||
|
||||
*ruby_spellcheck_strings*
|
||||
Ruby: Spellchecking strings ~
|
||||
|
||||
Ruby syntax will perform spellchecking of strings if you define
|
||||
"ruby_spellcheck_strings": >
|
||||
|
||||
:let ruby_spellcheck_strings = 1
|
||||
<
|
||||
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
Reference in New Issue
Block a user