This Vim plugin provides features for interacting with some sourcehut services.
move webapi plugin check inside `srht#Paste()`
b0934d89 — William Durand 3 years ago
Add link to blog post in README
8b00914d — William Durand 3 years ago
Add author name/license of vim-gist



You can also use your local clone with git send-email.


This Vim plugin provides features for interacting with some sourcehut services. I wrote about why I created this plugin here.


In doubt, run :help srht.

This plugin provides the following features per service:

  • git.sr.ht:
    • if vim-fugitive is installed, this plugin will allow :GBrowse to open sourcehut URLs
  • paste.sr.ht:
    • create and retrieve pastes with :SrhtPaste [sha] (requires curl and the webapi-vim plugin)


  • g:srht_token_file: path to the file containing a sourcehut personal access token (which is only required for commands that interact with the sourcehut APIs)
    • default: ~/.srht-vim
  • g:srht_paste_default_visibility: default paste visibility
    • default: unlisted
  • g:srht_paste_domain: domain of the paste hosting service
    • default: paste.sr.ht
  • g:srht_git_domain: domain of the git hosting service
    • default: git.sr.ht


Install the srht.vim plugin using your favorite package manager, or use Vim's built-in package support:

$ mkdir -p ~/.vim/pack/willdurand/start
$ cd !$
$ git clone https://git.sr.ht/~willdurand/srht.vim
$ vim -u NONE -c "helptags srht.vim/doc" -c q


Send patches to my public inbox (please edit the [PATCH] line to include srht.vim: [PATCH srht.vim]).

#Extra credits

The :SrhtPaste feature is heavily inspired by the excellent vim-gist written by Yasuhiro Matsumoto and released under the BSD License (2-clause).


srht.vim is released under the MIT License. See the bundled LICENSE file for details.