Git Product home page Git Product logo

coc-github-users's Introduction

coc-github-users

An extension for coc.nvim that provides completions for GitHub usernames.

This is useful when writing git commit messages or when using hub pull-request to create a PR.

Allows you to search for users either by their username or real name.

Example

Installation

  1. Add the extension to coc.nvim:

    :CocInstall coc-github-users
    
  2. Create a GitHub personal access token so the extension can access the GitHub API.

    1. Go to the GitHub tokens page
    2. Click the Generate new token button
    3. Give the token a sensible name, e.g. coc-github-users
    4. The token doesn't need any scopes
    5. Click Generate token at the bottom of the page
  3. Either export the token as environment variable COC_GITHUB_USERS_TOKEN, or add it to your coc.nvim config (:CocConfig) with key coc.githubUsers.githubAccessToken.

How to use

Typing @ followed by 2 or more characters will trigger the extension. For example, if you type @cb3, you will get a list of autocomplete items for usernames starting with @cb3, including my username @cb372.

For users who have added their real name to their GitHub profile, you will see both their username and real name in the autocomplete item label.

You can search by real name by separating the names with underscores. For example, if you type @chris_birchall you will also get you an autocomplete list containing my username @cb372.

Github Enterprise support

If you have an internal GitHub enterprise installation at work, you can configure it like so:

{
  "coc.githubUsers.graphqlApiUrl": "http://your.internal.github.company.com/api/graphql",
  "coc.githubUsers.unixSocket": "/optional/path/to/unix.sock"
}

The unixSocket is optional, but useful if your company proxies all internal traffic through a local socket.

If you prefer ENV variables, you can configure:

  • COC_GITHUB_USERS_GRAPHQL_API_URL
  • COC_GITHUB_USERS_UNIX_SOCKET

in your shell environment instead.

coc-github-users's People

Contributors

cb372 avatar dependabot[bot] avatar dbalatero-stripe avatar

Stargazers

Jean-Pierre Chauvel avatar Nate-Wilkins avatar Sandro avatar Chauncey Garrett avatar

Watchers

 avatar James Cloos avatar  avatar

coc-github-users's Issues

[Bug] Doesn't work

I've set up the token in my coc-config but it seams to not work.
Using the latest version of coc.nvim

Output of :CocInfo:

undefined## versions

vim version: VIM - Vi IMproved 8.2 8023441
node version: v16.9.1
coc.nvim version: 0.0.80-03c9add7cd
coc.nvim directory: /home/dan/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2021-09-21T15:49:08.179 INFO (pid:57248) [plugin] - coc.nvim 0.0.80-03c9add7cd initialized with node: v16.9.1 after 64ms
2021-09-21T15:49:12.057 INFO (pid:57248) [completion-complete] - Results from: around
2021-09-21T15:49:15.547 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:25.615 INFO (pid:57248) [attach] - receive notification: showInfo []
2021-09-21T15:49:26.859 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:29.239 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:30.675 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:31.618 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:32.283 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:33.339 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:33.967 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:35.769 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:37.362 ERROR (pid:57248) [extension:coc-github-users] - TypeError: adapter is not a function
    at dispatchRequest (/home/dan/.config/coc/extensions/node_modules/coc-github-users/lib/index.js:5905:10)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
2021-09-21T15:49:37.362 INFO (pid:57248) [completion-complete] - Results from: around
2021-09-21T15:49:39.437 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:40.171 INFO (pid:57248) [attach] - receive notification: highlight []
2021-09-21T15:49:46.063 INFO (pid:57248) [attach] - receive notification: showInfo []

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.