doomemacs/modules/lang/rest/config.el

34 lines
1.2 KiB
EmacsLisp
Raw Normal View History

;;; lang/rest/config.el -*- lexical-binding: t; -*-
2017-02-19 18:54:19 -05:00
(def-package! restclient
:mode ("\\.http\\'" . restclient-mode)
:config
(set-popup-rule! "^\\*HTTP Response" :size 0.4 :quit 'other)
2018-08-16 22:02:30 +02:00
;; line numbers aren't enabled by default in fundamental-mode-derived modes
(add-hook 'restclient-mode-hook #'display-line-numbers-mode)
2018-08-16 22:02:30 +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)
(map! :mode restclient-mode
:n [return] #'+rest/dwim-at-point
2018-08-16 17:36:05 +02:00
:n "za" #'restclient-toggle-body-visibility
:n "zm" #'+rest/fold-all
:n "zr" #'outline-show-all
:localleader
:n "e" #'restclient-http-send-current
:n "E" #'restclient-http-send-current-raw
:n "c" #'restclient-copy-curl-command))
2017-02-19 18:54:19 -05:00
(def-package! company-restclient
:when (featurep! :completion company)
2017-02-19 18:54:19 -05:00
:after restclient
:config (set-company-backend! 'restclient-mode 'company-restclient))