2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/rest/config.el -*- lexical-binding: t; -*-
|
2017-02-19 18:54:19 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! restclient
|
2018-05-25 00:46:11 +02:00
|
|
|
:mode ("\\.http\\'" . restclient-mode)
|
2017-05-07 02:27:18 +02:00
|
|
|
:config
|
2018-06-18 02:26:05 +02:00
|
|
|
(set-popup-rule! "^\\*HTTP Response" :size 0.4 :quit 'other)
|
2018-08-16 16:42:01 +02:00
|
|
|
|
|
|
|
;; Forces underlying SSL verification to prompt for self-signed or invalid
|
|
|
|
;; certs, rather than silently reject them.
|
|
|
|
(defun +rest*permit-self-signed-ssl (orig-fn &rest args)
|
|
|
|
(let (gnutls-verify-error tls-checktrust)
|
|
|
|
(apply orig-fn args)))
|
|
|
|
(advice-add #'restclient-http-do :around #'+rest*permit-self-signed-ssl)
|
|
|
|
|
2017-05-07 02:27:18 +02:00
|
|
|
(map! :mode restclient-mode
|
|
|
|
:n [M-return] 'restclient-http-send-current
|
2018-08-16 17:36:05 +02:00
|
|
|
:n "za" #'restclient-toggle-body-visibility
|
|
|
|
:n "zm" #'+rest/fold-all
|
|
|
|
:n "zr" #'outline-show-all
|
|
|
|
|
2017-05-07 02:27:18 +02:00
|
|
|
:localleader
|
|
|
|
:desc "Execute HTTP request" :n "e" 'restclient-http-send-current
|
|
|
|
:desc "Execute raw HTTP request" :n "E" 'restclient-http-send-current-raw
|
|
|
|
:desc "Copy curl command" :n "c" 'restclient-copy-curl-command))
|
2017-02-19 18:54:19 -05:00
|
|
|
|
2017-03-19 22:47:50 -04:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! company-restclient
|
2017-03-19 22:47:50 -04:00
|
|
|
:when (featurep! :completion company)
|
2017-02-19 18:54:19 -05:00
|
|
|
:after restclient
|
2018-06-15 02:58:12 +02:00
|
|
|
:config (set-company-backend! 'restclient-mode 'company-restclient))
|