Add Haskell support

This commit is contained in:
Zelong Kuang
2025-12-15 05:50:04 +11:00
parent 17d1eb859f
commit b73c09be8d
7 changed files with 38 additions and 13 deletions

View File

@@ -39,4 +39,5 @@
(require 'init-typst)
(require 'init-cc)
(require 'init-python)
(require 'init-haskell)
(require 'init-rust)

View File

@@ -10,12 +10,20 @@
(setq custom-file (expand-file-name "~/.emacs.d/custom.el"))
(load custom-file 'no-error 'no-message)
(setq use-short-answers t)
(setq frame-title-format "Emacs: %b")
(define-key global-map (kbd "C-<wheel-up>") nil)
(define-key global-map (kbd "C-<wheel-down>") nil)
(global-set-key (kbd "s-a") 'mark-whole-buffer) ;;对应Windows上面的Ctrl-a 全选
(global-set-key (kbd "s-c") 'kill-ring-save) ;;对应Windows上面的Ctrl-c 复制
(global-set-key (kbd "s-s") 'save-buffer) ;; 对应Windows上面的Ctrl-s 保存
(global-set-key (kbd "s-v") 'yank) ;对应Windows上面的Ctrl-v 粘贴
(global-set-key (kbd "s-z") 'undo) ;对应Windows上面的Ctrol-z 撤销
(setq kill-ring-max 200)
;; Save clipboard contents into kill-ring before replace them
(setq save-interprogram-paste-before-kill t)
;; Kill & Mark things easily
(use-package easy-kill
:bind (([remap kill-ring-save] . easy-kill)
@@ -27,12 +35,6 @@
:init (setq browse-kill-ring-separator "────────────────"
browse-kill-ring-separator-face 'shadow))
(global-set-key (kbd "s-a") 'mark-whole-buffer) ;;对应Windows上面的Ctrl-a 全选
(global-set-key (kbd "s-c") 'kill-ring-save) ;;对应Windows上面的Ctrl-c 复制
(global-set-key (kbd "s-s") 'save-buffer) ;; 对应Windows上面的Ctrl-s 保存
(global-set-key (kbd "s-v") 'yank) ;对应Windows上面的Ctrl-v 粘贴
(global-set-key (kbd "s-z") 'undo) ;对应Windows上面的Ctrol-z 撤销
(use-package exec-path-from-shell
:init
(when (memq window-system '(mac ns x))

View File

@@ -7,7 +7,7 @@
(when (treesit-available-p)
(use-package c-ts-mode
:ensure nil
:functions centaur-treesit-available-p
:functions treesit-available-p
:init
(setq c-ts-mode-indent-offset 2)

View File

@@ -39,6 +39,8 @@
(add-to-list 'eglot-server-programs
'(fish-mode . ("fish-lsp" "start")))))
(use-package docker-compose-mode)
(use-package leetcode)
(provide 'init-coding)

View File

@@ -226,11 +226,10 @@
(advice-add 'eglot-completion-at-point :around #'cape-wrap-nonexclusive)
(advice-add 'pcomplete-completions-at-point :around #'cape-wrap-nonexclusive))
(use-package yasnippet-capf
:after cape
:config
(add-to-list 'completion-at-point-functions #'yasnippet-capf))
;; (use-package yasnippet-capf
;; :after cape
;; :config
;; (add-to-list 'completion-at-point-functions #'yasnippet-capf))
(provide 'init-completion)

17
lisp/init-haskell.el Normal file
View File

@@ -0,0 +1,17 @@
;; -*- lexical-binding: t; -*-
(use-package haskell-mode
:hook (haskell-mode . haskell-collapse-mode)
:hook (haskell-mode . interactive-haskell-mode)
:mode (("\\.hs\\'" . haskell-mode))
:config
(setq haskell-process-suggest-remove-import-lines t
haskell-process-auto-import-loaded-modules t)
(add-hook 'haskell-mode-local-vars-hook #'lsp! 'append)
(add-hook 'haskell-literate-mode-local-vars-hook #'lsp! 'append)
(add-to-list 'completion-ignored-extensions ".hi")
)
(provide 'init-haskell)

View File

@@ -120,4 +120,8 @@
;; but you can use any other Nerd Font if you want
(nerd-icons-font-family "Symbols Nerd Font Mono"))
(use-package nerd-icons-ibuffer
:ensure t
:hook (ibuffer-mode-hook . nerd-icons-ibuffer-mode))
(provide 'init-ui)