86

GitHub - vermiculus/sx.el: Stack Exchange for Emacs

 6 years ago
source link: https://github.com/vermiculus/sx.el
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

SX – Stack Exchange for Emacs

SX is a full-featured Stack Exchange mode for GNU Emacs 24+. Using the official API, it provides a versatile experience for the Stack Exchange network within Emacs itself.

list-and-question.png

Features

As always, C-h m is the definitive resource for functionality, but here are a few highlights:

Viewing Questions

Question Lists

View questions with one of the sx-tab- commands. These translate roughly to the different ‘tabs’ that you can view on the official site. Implemented tabs include:

sx-tab-all-questionsAll questions. sx-tab-unansweredu Unanswered questions. sx-tab-unanswered-my-tagsU Unanswered questions in your followed tags. sx-tab-featuredf Featured questions. sx-tab-starred* Your starred questions. sx-tab-frontpageh The frontpage of the site. sx-tab-meta-or-mainm Toggle between the meta and main sites. sx-tab-newestn Newest questions first. sx-tab-topvotedv Highest-scoring questions first. sx-tab-weekw Hot questions of the week.

Inside SX buffers, you can switch to other tabs by typing s followed by the key listed with the tab above. You can also use sx-tab-switch (s t) to switch between tabs with completion. Each of these opens up a list of questions, and you can further customize the ordering of the list with O. Other keys include:

n and pNavigate the list. j and kNavigate while viewing the question in a separate buffer. s sSwitch site. vVisit the thing-at-point in your browser. wCopy the thing-at-point (usually a link). u and dUpvote and downvote. RETOpen the question buffer.

Questions and Answers

u and dUpvote and downvote the question, answer, or comment at point. aAdd an answer. eEdit the question or answer (or comment if it’s yours; the usual rules apply) *Star the question. KDelete the question/answer/comment if you are able. wCopy code at point.

Your Inbox

sx-inboxView your inbox RETVisit inbox item

Installation

SX is now available on MELPA! Both the stable release and the development version can be found there. Install it via the Package Menu or just run

M-x package-install RET sx RET

Authenticating

If you are going to be doing any asking/answering/commenting/upvoting/downvoting/ etc., you must use sx-authenticate to provide SX with an authentication token to act on your behalf.

After authentication, you will be redirected to the project page. This page will prominently display your authentication token. Keep this secret! It’s as good as your password as far as StackExchange is concerned. Copy and paste the token into the prompt in Emacs.

SX will store this authentication token in plain text in the sx folder of your .emacs.d. Please take any and all steps necessary to protect the security of your account. This token is as good as a password.

Sample Keybindings

With use-package

(require 'use-package)

(use-package sx
  :config
  (bind-keys :prefix "C-c s"
             :prefix-map my-sx-map
             :prefix-docstring "Global keymap for SX."
             ("q" . sx-tab-all-questions)
             ("i" . sx-inbox)
             ("o" . sx-open-link)
             ("u" . sx-tab-unanswered-my-tags)
             ("a" . sx-ask)
             ("s" . sx-search)))

Standard (With Prefix Key)

Shamelessly stolen from Endless Parentheses.

(define-prefix-command 'launcher-map)
(global-set-key (kbd "s-l") 'launcher-map)
(define-key launcher-map "qq" #'sx-tab-all-questions)
(define-key launcher-map "qi" #'sx-inbox)
(define-key launcher-map "qo" #'sx-open-link)
(define-key launcher-map "qu" #'sx-tab-unanswered-my-tags)
(define-key launcher-map "qa" #'sx-ask)
(define-key launcher-map "qs" #'sx-search)

Contributing

Please help contribute! Doing any of the following will help us immensely:

For a better view of all of the open issues, take a look at our lovely Waffle board. Feel free to take the torch on anything in backlog or ready. If you have thoughts on any other issues, don’t hesitate to chime in!

See also CONTRIBUTING.org.

Resources

Icons

SX has no explicit need for an icon, although standard SVG files have been gathered in resources/ if anyone would fancy a crack at it.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK