vim-scaladoc


Ⅰ. 插件描述

Scaladoc for vim

Ⅱ. 基本信息

创建日期:  2012-10-04
使用用户:  7
Github星:  7
插件作者:  Mike Dreves

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'mdreves/vim-scaladoc'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'mdreves/vim-scaladoc'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'mdreves/vim-scaladoc'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/mdreves/vim-scaladoc

Ⅳ. 文档说明

# Overview

The vim-scaladoc plug-in is for use with Vim - who
would have thought? It allows you to open scaladoc documentation in your
favorite browser based on keyword selection. By default the plugin will
search the following locations for documentation:

The local project search is based on the current open file in VIM. If the file
contains a src directory in its path, then target/scala-x.x.x/api is
appended to the parent of this directory and added to the search path.

Requirements

This plugin requires VIM be compiled with +python. The plugin has been tested
on Mac and Linux. If you are using Windows, go sit in the corner and think
about what you have done :)

Installation

If you are using pathogen, then
simply copy and paste:

cd ~/.vim/bundle
git clone git://github.com/mdreves/vim-scaladoc.git

Once help tags have been generated, you can view the manual with
:help scaladoc.

Documentation

Documentation is available via VIM :help, but it's fairly simple:

:ScalaDoc list

http://www.scala-lang.org/api/current/scala/collection/immutable/List.html

:ScalaDoc mu queue

http://www.scala-lang.org/api/current/scala/collection/mutable/Queue.html

:ScalaDoc im queue

http://www.scala-lang.org/api/current/scala/collection/immutable/Queue.html

If multiple matches are found (e.g. :ScalaDoc queue), then a read-only
window will be opened to select a URL from.

Note: The first time :ScalaDoc is run it may be a bit slow as it downloads
and indexes the docs, but subsequent runs should be fast.

Configuration

A few variables are available to customize settings:

g:scaladoc            :  Enable (1) / Disable (0) plugin
                         (Default: 1)
g:scaladoc_cache_dir  :  Directory to store index caches in
                         (Default: `tmp` dir of install directory)
g:scaladoc_cache_ttl  :  TTL (days) for cached indexes
                         (Default: 15 days)
g:scaladoc_paths      :  Additional paths (comma sep) to search for
                         scaladocs (Default: '')

Note: The TTL applies to the official scaladoc site and to general cache

  1. Local API files are checked for modifications each time :ScalaDoc is
  2. in order to pickup changes from a local build.

There are no built-in mappings added for scaladoc, but it is simple enough to
add your own. For example:

nnoremap <F1> :call ScalaDoc(expand("<cword>"))<CR>

License

Copyright 2012 Mike Dreves

All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at:

http://opensource.org/licenses/eclipse-1.0.php

By using this software in any fashion, you are agreeing to be bound
by the terms of this license. You must not remove this notice, or any
other, from this software. Unless required by applicable law or agreed
to in writing, software distributed under the License is distributed
on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.

添加新评论