Code Monkey home page Code Monkey logo

urlview.vim's People

Contributors

strboul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

robinovitch61

urlview.vim's Issues

Netrw gx problem

Cool plug-in. I am using iVim on an iPad, and I'm trying to utilize the plug-in but I'm running into a problem with the netrw gx command because of Apple restrictions. I'd like to add the command ":iopenurl URL_Here" right below the call s:OpenLink(l:chosen_url)

How do I do that?

It is likely something simple. Below is the help section about iopenurl from iVim.

=====

iVim adds one command to support the URL scheme opening |ios-open-url|.

:io[penurl] {url} :io :iopenurl
Open the {url} to invoke the iOS URL scheme workflow.

	Example: >
		:io https://www.example.com/search?q={@*%[Q}

<
It will launch Safari and open the site "www.example.com" and
do a search with the contents in the clipboard as the query.

	Note that it opens only one URL at a time.

Variable token ~

You need to use variable tokens to include useful info into an URL. The format
for a variable token is "{expr%[encode}".

a. the "{" and "}" are the opening and closing delimiter respectively.

As a result, they need to be backslash-escaped if you want to use them
literally in the URL. Note that nested token is not supported.

b. the "expr" is a vim |expression| which will be replaced with its value when
the whole URL is opened.

This expression will be evaluated by vim and errors will be given if it is
invalid. Note a) only expressions with value type "string" and "number" are
supported. b) tokens are evaluated one by one from left to right.

c. the "%[" is the indicator for a following URL encoding type.

d. the "encode" is the URL encoding type which is explained in details below.

Backslash escape ~

Sometimes you need to put certain characters literally into an URL. You can
put a backslash character before each to achieve this. For example, "{expr}"
will be treated literally instead of a variable token.

Because of its special meaning, a literal backslash always needs to be
backslash escaped, e.g. "\".

URL encoding ~

Certain characters in an URL need to be percent encoded for a successful
opening. Moreover, in different parts of an URL, the characters that need
encoding differ. iVim provides an URL encoding type to help with this.

A typical URL skeleton is

scheme://user:password@host:port/path?query#fragment

<
The following encoding types are available:

U:	indicates encoding for "user" part
PW:	"password" part
H:	"host" part
PT:	"path" part
Q:	"query" part, it is the default
F:	"fragment" part

For example, if you will include a variable token into the "host" part, you
need to indicate it as "{expr%[H}". Then iVim will encode its value for the
specific part automatically. Omitting the encoding part, e.g. "{expr}", will
encode it for the default "query" part. Note that they are case insensitive.
e.g. "%[Q" and "%[q" mean the same encoding.

Debug errors ~

iVim provides some debug errors when you try to open an URL but it has some
problems.

"token open character { expected":
a closing delimiter is encountered before an opening one.
"token close character } expected":
one opening delimiter is expecting a closing one but none given.
"nested token not allowed":
you are trying to put a variable token inside another one.
"unfinished character escaping":
there is a backslash at the end of the URL.
"invalid path: ...":
the URL is invalid
"failed to open URL: ...":
the system failed to open the given URL.

If the position of the problem can be located in the URL, it will be
highlighted as ">...<".

==============================================================================

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.