From 26be43256a94eb6c0b32c8cecaffd8be5b281e61 Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Fri, 19 Mar 2021 21:07:03 +0100 Subject: [PATCH] alternative based on lsp --- .gitignore | 3 +- init.el => custom.el | 0 lsp-based.el | 83 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) rename init.el => custom.el (100%) create mode 100644 lsp-based.el diff --git a/.gitignore b/.gitignore index a8edbc9..e37b203 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /* -!init.el +!custom.el +!lsp-based.el !.gitignore diff --git a/init.el b/custom.el similarity index 100% rename from init.el rename to custom.el diff --git a/lsp-based.el b/lsp-based.el new file mode 100644 index 0000000..dc6e2d8 --- /dev/null +++ b/lsp-based.el @@ -0,0 +1,83 @@ +(require 'package) +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) +(package-initialize) + +(setq package-selected-packages '(clojure-mode lsp-mode cider lsp-treemacs flycheck company paredit)) + +(when (cl-find-if-not #'package-installed-p package-selected-packages) + (package-refresh-contents) + (mapc #'package-install package-selected-packages)) + +(add-hook 'clojure-mode-hook 'lsp) +(add-hook 'clojurescript-mode-hook 'lsp) +(add-hook 'clojurec-mode-hook 'lsp) + +(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t) +(add-hook 'lisp-mode-hook 'enable-paredit-mode) +(add-hook 'clojure-mode-hook 'enable-paredit-mode) +(add-hook 'emacs-lisp-mode-hook 'enable-paredit-mode) +(add-hook 'eval-expression-minibuffer 'enable-paredit-mode) +;(add-hook 'clojure-mode-hook 'clojure-mode-hook) +(add-hook 'less-css-mode-hook 'hs-minor-mode) +(add-hook 'before-save-hook 'delete-trailing-whitespace) + + +(setq gc-cons-threshold (* 100 1024 1024) + read-process-output-max (* 1024 1024) + treemacs-space-between-root-nodes nil + company-minimum-prefix-length 1 + lsp-lens-enable t + lsp-signature-auto-activate nil + lsp-clojure-custom-server-command '("bash" "-c" "~/bin/clojure-lsp") + + inhibit-startup-message t + column-number-mode t + + ;; ido! + ido-enable-flex-matching t + ido-use-filename-at-point nil + ; lsp-enable-indentation nil ; uncomment to use cider indentation instead of lsp + ; lsp-enable-completion-at-point nil ; uncomment to use cider completion instead of lsp + ) + +;; ui stuff +(menu-bar-mode -1) +(tool-bar-mode -1) +(show-paren-mode 1) +(global-linum-mode 1) +(ivy-mode 1) + +;; indent all the stuff +(global-set-key [f12] 'lsp-format-buffer) + +;; custom key bindings +(global-set-key (kbd "C-M-SPC") 'just-one-space) +(global-set-key (kbd "C-x -") 'hs-toggle-hiding) + +;; recent files +(recentf-mode 1) +(setq recentf-max-menu-items 25) +(global-set-key "\C-x\ \C-r" 'recentf-open-files) + +;; helm - fuzzy matching on M-x +;;(package-initialize) +;;(require 'helm-config) +;;(helm-mode 1) +;;(global-set-key (kbd "M-x") 'helm-M-x) + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(custom-enabled-themes (quote (misterioso))) + '(initial-frame-alist (quote ((fullscreen . maximized)))) + '(package-selected-packages + (quote + (counsel editorconfig which-key idomenu paredit clojure-mode lsp-mode cider lsp-treemacs flycheck company)))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(default ((t (:inherit nil :stipple nil :background "#2d3743" :foreground "#e1e1e0" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 100 :width normal :foundry "DAMA" :family "monospace")))))