This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+web-services/twitter/packages.el

115 lines
5.7 KiB
EmacsLisp
Raw Normal View History

2015-08-31 14:54:35 +00:00
;;; packages.el --- twitter Layer packages File for Spacemacs
;;
2018-01-04 07:00:25 +00:00
;; Copyright (c) 2012-2018 Sylvain Benner
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
2015-08-31 14:54:35 +00:00
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; List of all packages to install and/or initialize. Built-in packages
;; which require an initialization must be listed explicitly in the list.
(setq twitter-packages '(twittering-mode))
2015-08-31 14:54:35 +00:00
(defun twitter/init-twittering-mode ()
(use-package twittering-mode
:defer t
2015-08-31 14:54:35 +00:00
:init
(progn
(spacemacs/set-leader-keys "at" 'twit)
(setq twittering-initial-timeline-spec-string '(":home")
twittering-icon-mode t
twittering-use-icon-storage 1
twittering-enable-unread-status-notifier t
twittering-display-remaining t
twittering-edit-skeleton 'inherit-any
twittering-url-show-status nil
twittering-timeline-header ""
twittering-timeline-footer ""
twitter-images-directory (concat spacemacs-cache-directory "twitter")
twittering-status-format "%i %S, %RT{%FACE[bold]{%S}} %@ %FACE[shadow]{%p%f%L%r}\n%FOLD[ ]{%T}\n")
(unless (file-exists-p twitter-images-directory)
(make-directory twitter-images-directory))
)
2015-08-31 14:54:35 +00:00
:config
(progn
;; twittering mode overwrite the leader key
(define-key twittering-mode-map (kbd "SPC") spacemacs-default-map)
;; redefine better defaults
(let ((map twittering-mode-map))
(define-key map "?" 'spacemacs/twittering-mode-transient-state/body)
(define-key map "/" 'twittering-search)
(define-key map "a" 'twittering-toggle-activate-buffer)
(define-key map "b" 'twittering-favorite)
(define-key map "B" 'twittering-unfavorite)
(define-key map "d" 'twittering-direct-message)
(define-key map "e" 'twittering-edit-mode)
(define-key map "f" 'twittering-follow)
(define-key map "F" 'twittering-unfollow)
(define-key map "g" 'beginning-of-buffer)
(define-key map "G" 'end-of-buffer)
(define-key map "i" 'twittering-view-user-page)
(define-key map "Q" 'twittering-kill-buffer)
2016-03-24 14:19:42 +00:00
(define-key map "I" 'twittering-icon-mode)
(define-key map "j" 'twittering-goto-next-status)
(define-key map "J" 'twittering-goto-next-status-of-user)
(define-key map "k" 'twittering-goto-previous-status)
(define-key map "K" 'twittering-goto-previous-status-of-user)
(define-key map "n" 'twittering-update-status-interactive)
(define-key map "o" 'twittering-click)
(define-key map "r" 'twittering-native-retweet)
(define-key map "R" 'twittering-organic-retweet)
(define-key map "t" 'twittering-toggle-or-retrieve-replied-statuses)
(define-key map "u" 'twittering-current-timeline)
(define-key map "X" 'twittering-delete-status)
(define-key map "y" 'twittering-push-uri-onto-kill-ring)
(define-key map "Y" 'twittering-push-tweet-onto-kill-ring))
;; associated transient state
(spacemacs|define-transient-state twittering-mode
:title "Twittering Mode Transient State"
:doc "
Tweets^^^^^^ User^^^^ Other^^
^^^^^^ ^^^^ ^^
[_j_/_k_] down/up [_r_] retweet [_d_]^^ direct message [_a_] toggle auto-refresh
[_RET_]^^ open or reply [_R_] retweet & edit [_f_]^^ follow [_q_] quit
[_b_]^^ heart [_n_] post new tweet [_F_]^^ unfollow [_Q_] quit twitter
[_B_]^^ unheart [_t_] show thread [_i_]^^ profile [_u_] update
[_e_]^^ edit mode [_X_] delete tweet [_J_/_K_] down/up [_/_] search
2016-03-24 14:19:42 +00:00
[_g_]^^ first [_y_] yank url ^^^^ [_I_] toggle images
[_G_]^^ last [_Y_] yank tweet
[_o_]^^ open url"
:bindings
("?" nil :exit t)
("RET" twittering-enter :exit t)
("/" twittering-search :exit t)
("a" twittering-toggle-activate-buffer)
("b" twittering-favorite)
("B" twittering-unfavorite)
("d" twittering-direct-message :exit t)
("e" twittering-edit-mode :exit t)
("f" twittering-follow)
("F" twittering-unfollow)
("g" beginning-of-buffer)
("G" end-of-buffer)
("i" twittering-view-user-page)
("q" nil :exit t)
("Q" twittering-kill-buffer :exit t)
2016-03-24 14:19:42 +00:00
("I" twittering-icon-mode)
("j" twittering-goto-next-status)
("J" twittering-goto-next-status-of-user)
("k" twittering-goto-previous-status)
("K" twittering-goto-previous-status-of-user)
("n" twittering-update-status-interactive :exit t)
("o" twittering-click :exit t)
("r" twittering-native-retweet :exit t)
("R" twittering-organic-retweet :exit t)
("t" twittering-toggle-or-retrieve-replied-statuses :exit t)
("u" twittering-current-timeline)
("X" twittering-delete-status)
("y" twittering-push-uri-onto-kill-ring)
("Y" twittering-push-tweet-onto-kill-ring)))))