Code Monkey home page Code Monkey logo

webbrowser's Introduction

This is a mirror of http://www.vim.org/scripts/script.php?script_id=4315

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 ([email protected])
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:\lynx\dump'
let s:lynxToolsPath = 'c:\lynx\tools'

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

webbrowser's People

Contributors

viaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.