use poper emacs namespace, move keys to dedicated minor mode

This commit is contained in:
Maciej 2021-03-06 10:52:54 +02:00
parent 7f5f90ae4d
commit 76c7d665c7
Signed by: maciej
GPG key ID: 41D62D42D3B0D765
38 changed files with 337 additions and 221 deletions

50
lang/fsharp.el Normal file
View file

@ -0,0 +1,50 @@
;;; fsharp.el --- summary
;; Author: Maciej Szlosarczyk
;; Maintainer: Maciej Szlosarczyk
;; Version: 0.1-snapshot
;;; Commentary:
;; Fsharp configuration
;;; Code:
(require 'icejam-pkg-prog-mode "$HOME/.emacs.d/pkg/prog-mode.el")
(require 'icejam-pkg-flycheck "$HOME/.emacs.d/pkg/flycheck.el")
(use-package fsharp-mode
:requires (lsp-mode lsp-ui)
:ensure t
:defer t)
(defhydra my-fsharp/context-hydra (:color teal :hint nil)
"
^Fsharp actions^
^^^^^^^^-----------------------------------------------------------------------
_r_: Reload buffer _f_: Format buffer
_i_: Indent buffer _m_: iMenu
"
("q" nil "cancel" :color blue)
("r" revert-buffer-no-confirm)
("i" indent-region)
("f" lsp-format-buffer)
("m" lsp-ui-imenu))
(defun activate-fsharp-mode ()
"Activate F# goodies."
(set-indent 4)
(column-enforce-n 100)
(lsp-deferred)
(define-key fsharp-mode-map (kbd "C-c l") 'my-fsharp/context-hydra/body)
;; Company list override
(add-to-list (make-local-variable 'company-backends)
'(company-capf company-yasnippet)))
(add-hook 'fsharp-mode-hook 'activate-fsharp-mode)
(provide 'icejam-lang-fsharp)
;;; fsharp.el ends here