A client backend for the vim netclient plugin
Go to file
sloum 63a583b924 Updates readme 2024-01-24 14:59:23 -08:00
.gitignore Working gopher and http(s). Gemini to be added. 2023-07-04 22:49:13 -07:00
README.md Updates readme 2024-01-24 14:59:23 -08:00
go.mod Working gopher and http(s). Gemini to be added. 2023-07-04 22:49:13 -07:00
go.sum Working gopher and http(s). Gemini to be added. 2023-07-04 22:49:13 -07:00
main.go Removes some code that doesn't make much sense. Commented in case it needs to be added back later. 2023-07-07 20:24:21 -07:00
network.go More gracefully deals with gophermap errors 2023-07-07 19:55:26 -07:00

README.md

ncg

ncg was developed to be a custom client backend for the netclient vim plugin. It supports gopher, gemini, and http(s).

Pass a url, get a text rendering back (ie. not the html/gophermap/gemtext source).

Gopher/Gemini Query Responses

If a gemini request returns a type 10 response (a request for information from the user) the meta of the response (the question being asked) will be printed and the exist status will be 22. This is specifically to allow other programs to see the question being posed and know that it is from a gemini request. They can then query for the response and resubmit with the correct querystring.

Like the above with gemini, if a gopher request is of type 7 (a request for information from the user) Query: will be printed and the exit status will be 33

Other codes

An exist status of 1 indicates a general error and the text printed to the screen will be the error message.

Using with vim netclient plugin

In your .vimrc add the following:

let g:netclient_command = "ncg %s"

Make sure that the ncg binary is on your $PATH.

If you have not already set your leader, you will want to do so (also in your .vimrc):

let g:netclient_leader = "  "

The above sets a double space to be the netclient leader. Use whatever you like, but I find that comfortable. Once all that is done, you can open up vim to an empty document (or an existing one) and press <space><space>o. It will query for the URL you would like to visit. You use vim's undo for back and redo for forward. You can press a number for a given link followed by the follow command. So to follow link #5 do 5<space><space>f.

Have fun :-D

Run

ncg http://some-address.tld

Buid/Install

A go compiler is required to build.

go build
go install

License

FFSL