webBrowser


Ⅰ. 插件描述

Use vim as a web browser

Ⅱ. 基本信息

创建日期:  2012-11-17
使用用户:  1
Github星:  7
插件作者:  Alexandre Viau

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

See latest version on github: https://github.com/viaa/VimPlugins

Name: webBrowser.vim
Version: 1.6
Description: Uses the lynx text browser to browse websites and local files and return the rendered web pages inside vim. The links in the web pages may be "clicked" to follow them, so it turns vim into a simple web text based web browser. This plugin is based on the "browser.vim" plugin.
Author: Alexandre Viau (alexandreviau@gmail.com)
Website: The latest version is found on "vim.org"

Installation:  
Copy the plugin to the vim plugin directory.
In the lynx.cfg file, set the following parameters:
ACCEPT_ALL_COOKIES:TRUE
MAKE_LINKS_FOR_ALL_IMAGES:TRUE
Change the following paths to your lynx files:
let s:lynxPath = 'c:lynx'
let s:lynxExe = s:lynxPath . 'lynx.exe'
let s:lynxCfg = '-cfg=' . s:lynxPath . 'lynx.cfg'
let s:lynxLss = '-lss=' . s:lynxPath . 'lynx.lss'
let s:lynxCmd = s:lynxExe . ' ' . s:lynxCfg . ' ' . s:lynxLss
let s:lynxDumpPath = 'c:lynxdump'
let s:lynxToolsPath = 'c:lynxtools'

Usage:
<leader>wb :WebBrowser (Open a new web browser tab with the address specified)
<leader>wc :exe 'WebBrowser "' . @* . '"'<cr> (Open a new web browser tab with the address in the clipboard)
<leader>wg :exe 'WebBrowser www.google.com/search?q="' . input("Google ") . '"'<cr> (Do a google search using the specified search keywords and open the results in a new tab)
<leader>wp :exe 'WebBrowser www.wikipedia.com/wiki/"' . input("Wikipedia ") . '"'<cr> (Do a wikipedia search using the specified search keywords and open the results in a new tab)
<leader>wd :WebDump (Downloads the specified webpage without opening it in vim)
<space>l (Open link)
<space>h (Previous page ("back button"))
<space>j (Highlight links and go to next link)
<space>k (Highlight links and go to previous link)

Todo:

  • Redo the code that gets the link number and search for it at the end of the file (no need to move cursor) and to do it in a mapping, it may be done in a function
  • I added basicXmlParser in the plugin, add a webBrowser.xml file and in it, have 2 keys: history and favorites, which will be string of utl links
  • Add links bar like vimExplorer (favorites & history) with links not from utl but with brackets [http://yahoo.com] thus no need for utl
  • Use image_links and accept_all_cookies options in the command run from the plugin instead of having to modify the .cfg file

History
1.1

  • Changed the file format to unix
    1.2
  • Changed the mappings
    1.3
  • Now the lynx command and others are ran using a call to the system() function so that the dos prompt window is not displayed on the screen
  • Added suggested mappings in comments (<insert>, <delete>, etc)
  • Added folds
    1.4
  • Changed mappings wb etc to <leader>wb because it was causing my "w" key in normal mode to wait for another key
    1.5
  • Added the webdump command and function to download in batch
    1.6
  • Added documentation and usage

添加新评论