Add definition and documentation keybindings

This commit is contained in:
mcbloch 2020-08-20 18:44:27 +02:00
parent f6f90c9791
commit fb4f5efb01

View file

@ -1,6 +1,7 @@
;;; lang/nim/config.el -*- lexical-binding: t; -*- ;;; lang/nim/config.el -*- lexical-binding: t; -*-
(after! nim-mode (after! nim-mode
:init
(add-hook! 'nim-mode-hook (add-hook! 'nim-mode-hook
(defun +nim-init-nimsuggest-mode-h () (defun +nim-init-nimsuggest-mode-h ()
"Conditionally load `nimsuggest-mode', instead of clumsily erroring out if "Conditionally load `nimsuggest-mode', instead of clumsily erroring out if
@ -19,9 +20,16 @@ windows."
:filter-return #'nimsuggest--get-temp-file-name :filter-return #'nimsuggest--get-temp-file-name
(replace-regexp-in-string "[* |<>\"?*]" "" path))) (replace-regexp-in-string "[* |<>\"?*]" "" path)))
:config
(set-lookup-handlers! '(nim-mode nimsuggest-mode)
:definition #'+nimsuggest-find-definition
:documentation #'nimsuggest-show-doc)
(map! :localleader (map! :localleader
:map nim-mode-map :map nim-mode-map
"b" #'nim-compile)) "b" #'nim-compile
"h" #'nimsuggest-show-doc
"d" #'nimsuggest-find-definition))
(use-package! flycheck-nim (use-package! flycheck-nim