Skip to content

Instantly share code, notes, and snippets.

@chupaaaaaaan
Created May 13, 2019 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chupaaaaaaan/7b317cdcab3b7acda5a4fe440a96444d to your computer and use it in GitHub Desktop.
Save chupaaaaaaan/7b317cdcab3b7acda5a4fe440a96444d to your computer and use it in GitHub Desktop.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Develop Environment
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; yasnippet
(use-package yasnippet
:ensure t
:hook (after-init . yas-global-mode)
)
(use-package yasnippet-snippets
:ensure t
:after yasnippet)
;; company
(use-package company
:ensure t
:custom
(company-idle-delay 0)
(company-minimum-prefix-length 2)
(company-selection-wrap-around t)
:hook (after-init . global-company-mode)
:bind(:map company-active-map
("C-n" . company-select-next)
("C-p" . company-select-previous)
("C-s" . company-filter-candidates)
;;("<tab>" . company-complete-common-or-cycle)
("<tab>" . company-complete)
("M-n" . nil)
("M-p" . nil)
("C-h" . nil)
:map company-search-map
("<tab>" . company-complete)
;("<tab>" . company--insert-candidate)
("C-s" . company-select-next)
("C-r" . company-select-previous))
:config
(require 'company-yasnippet)
)
(use-package company-box
:ensure t
:hook (company-mode . company-box-mode)
:custom
(company-box-icons-alist 'company-box-icons-all-the-icons))
(use-package company-quickhelp
:ensure t
:hook (company-mode . company-quickhelp-mode))
;; flycheck
(use-package flycheck
:ensure t
:hook (after-init . global-flycheck-mode))
(use-package flycheck-posframe
:ensure t
:hook (flycheck-mode . flycheck-posframe-mode))
;; lsp
(use-package lsp-mode
:ensure t
:commands lsp
:custom
(lsp-prefer-flymake nil)
(lsp-document-sync-method 'incremental)
(lsp-enable-snippet t)
:config
(require 'lsp-clients))
(use-package lsp-ui
:ensure t
:hook (lsp-mode . lsp-ui-mode)
:custom-face
(lsp-ui-doc-background ((nil (:background "black"))))
:custom
(lsp-ui-doc-enable nil)
(lsp-ui-doc-header t)
(lsp-ui-doc-include-signature t)
(lsp-ui-doc-position 'bottom)
(lsp-ui-doc-max-width 150)
(lsp-ui-doc-max-height 30)
(lsp-ui-doc-use-childframe t)
(lsp-ui-doc-use-webkit t)
(lsp-ui-peek-enable t)
(lsp-ui-peek-peek-height 20)
(lsp-ui-peek-list-width 50)
(lsp-ui-peek-fontify 'on-demand)
(lsp-ui-flycheck-enable t)
(lsp-ui-flycheck-list-position 'bottom)
(lsp-ui-flycheck-live-reporting t)
(lsp-ui-sideline-enable nil)
:preface
;; https://ladicle.com/post/config/#lsp
(defun ladicle/toggle-lsp-ui-doc ()
(interactive)
(if lsp-ui-doc-mode
(progn
(lsp-ui-doc-mode -1)
(lsp-ui-doc--hide-frame))
(lsp-ui-doc-mode 1)))
:bind(:map lsp-ui-mode-map
("C-c C-r" . lsp-ui-peek-find-references)
("C-c C-j" . lsp-ui-peek-find-definitions)
("C-c i" . lsp-ui-peek-find-implementation)
("C-c d" . ladicle/toggle-lsp-ui-doc)))
(use-package company-lsp
;:disabled
:ensure t
:after (company lsp-mode)
:config
(add-to-list 'company-backends 'company-lsp)
;;(add-to-list 'company-backends 'company-yasnippet)
:custom
(company-lsp-cache-candidates t)
(company-lsp-async t)
(company-lsp-enable-snippet t)
(company-lsp-enable-recompletion t)
(company-lsp-match-candidate-predicate 'company-lsp-match-candidate-flex))
;; haskell
;; for ghc-8.0.2 and later
(use-package lsp-haskell
:ensure t
:hook ((haskell-mode . lsp)
; (haskell-mode . company-yasnippet)
)
:custom
(lsp-haskell-process-path-hie "hie-wrapper"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment