From 6214f60f72fea65baa9a84d0d3e190328a93bfeb Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Thu, 30 Jul 2020 23:02:28 +0200 Subject: [PATCH] Remove redundant modules, use rust-analyzer --- .gitignore | 1 + custom.el | 5 +-- init.el | 3 +- modules/jenga-emacs.el | 23 ----------- modules/jenga-init.el | 82 ++++++++++++++++++++++++++++++++++++++++ modules/jenga-prelude.el | 61 ------------------------------ modules/jenga-rust.el | 11 ++++-- modules/jenga-ui.el | 2 +- 8 files changed, 95 insertions(+), 93 deletions(-) delete mode 100644 modules/jenga-emacs.el create mode 100644 modules/jenga-init.el delete mode 100644 modules/jenga-prelude.el diff --git a/.gitignore b/.gitignore index e603d0d..a583f05 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ history ac-comphist.dat elpy/ .python* +recentf diff --git a/custom.el b/custom.el index 5cfa462..b63a384 100644 --- a/custom.el +++ b/custom.el @@ -4,9 +4,8 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(ffap-machine-p-known (quote reject)) - '(package-selected-packages - (quote - (ein-mumamo use-package)))) + '(org-agenda-files (quote ("~/dev/personal.todo"))) + '(package-selected-packages (quote (helm-lsp htmlize ein-mumamo use-package)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/init.el b/init.el index 431537a..654f089 100644 --- a/init.el +++ b/init.el @@ -15,8 +15,7 @@ (add-to-list 'load-path (concat dotfiles-dir "modules")) ;; Emacs customization / global plugin configuration -(require 'jenga-prelude) -(require 'jenga-emacs) +(require 'jenga-init) (require 'jenga-magit) (require 'jenga-org) (require 'jenga-ui) diff --git a/modules/jenga-emacs.el b/modules/jenga-emacs.el deleted file mode 100644 index 310fddd..0000000 --- a/modules/jenga-emacs.el +++ /dev/null @@ -1,23 +0,0 @@ -;; Persist command history -(savehist-mode 1) - -;; Enable C-r in evil -(use-package undo-tree - :ensure t) - -;;;; TAGS configuration. -;; Goto tag with M-. -(global-set-key "\M-." 'etags-select-find-tag) -;; Automatically load TAGS file (if exists) when opening emacs. -(let ((my-tags-file (locate-dominating-file default-directory "TAGS"))) - (when my-tags-file - (message "Loading tags file: %s" my-tags-file) - (visit-tags-table my-tags-file))) - -;; Resize windows -(global-set-key (kbd "S-C-h") 'shrink-window-horizontally) -(global-set-key (kbd "S-C-l") 'enlarge-window-horizontally) -(global-set-key (kbd "S-C-j") 'shrink-window) -(global-set-key (kbd "S-C-k") 'enlarge-window) - -(provide 'jenga-emacs) diff --git a/modules/jenga-init.el b/modules/jenga-init.el new file mode 100644 index 0000000..2ae3455 --- /dev/null +++ b/modules/jenga-init.el @@ -0,0 +1,82 @@ +;; Persist command history +(savehist-mode 1) + +;; Enable C-r in evil +(use-package undo-tree + :ensure t) + +;;;; TAGS configuration. +;; Goto tag with M-. +(global-set-key "\M-." 'etags-select-find-tag) +;; Automatically load TAGS file (if exists) when opening emacs. +(let ((my-tags-file (locate-dominating-file default-directory "TAGS"))) + (when my-tags-file + (message "Loading tags file: %s" my-tags-file) + (visit-tags-table my-tags-file))) + +;; Resize windows +(global-set-key (kbd "S-C-h") 'shrink-window-horizontally) +(global-set-key (kbd "S-C-l") 'enlarge-window-horizontally) +(global-set-key (kbd "S-C-j") 'shrink-window) +(global-set-key (kbd "S-C-k") 'enlarge-window) + +;;;; Company configuration. +(use-package company + :ensure t + :defer t + :init (global-company-mode) + :config + (progn + (add-to-list 'completion-styles 'initials t) + (bind-key "M-" #'company-complete company-mode-map) + (setq company-tooltip-align-annotations t + tab-always-indent 'complete) + (setq company-dabbrev-downcase nil)) + :diminish company-mode) + +;;;; Evil mode configuration. +(use-package evil + :ensure t + :init ;; tweak evil's configuration before loading it + (setq evil-search-module 'evil-search + evil-ex-complete-emacs-commands nil + evil-vsplit-window-right t + evil-split-window-below t + evil-shift-round nil + evil-want-C-u-scroll t) + :config ;; tweak evil after loading it + (evil-mode) + (setq evil-want-C-u-scroll t) + (eval-after-load "evil-maps" + ;; Unset Evil's "M-." keymap so that TAGS definitions can be followed. + (define-key evil-normal-state-map "\M-." nil))) + +(use-package undo-tree + :ensure t) + +;;;; Heml mode configuration. +(use-package helm + :diminish + :init (helm-mode t) + :bind + ("M-x" . helm-M-x) + ("C-x C-f" . helm-find-files) + ("C-x b" . helm-mini) ;; See buffers & recent files; more useful. + ("C-x r b" . helm-filtered-bookmarks) + ("C-x C-r" . helm-recentf) ;; Search for recently edited files + ("C-c i" . helm-imenu) + ("C-c h" . helm-command-prefix) + ("C-h a" . helm-apropos) + :config + (setq helm-autoresize-max-height 0 + helm-autoresize-min-height 20 + helm-split-window-in-side-p t + helm-move-to-line-cycle-in-source t + helm-ff-search-library-in-sexp t + helm-scroll-amount 8 + helm-ff-file-name-history-use-recentf t + helm-echo-input-in-header-line t) + (when (executable-find "firefox") + (setq helm-google-suggest-use-curl-p t))) + +(provide 'jenga-init) diff --git a/modules/jenga-prelude.el b/modules/jenga-prelude.el deleted file mode 100644 index 37e0763..0000000 --- a/modules/jenga-prelude.el +++ /dev/null @@ -1,61 +0,0 @@ -;;;; Company configuration. -(use-package company - :ensure t - :defer t - :init (global-company-mode) - :config - (progn - (add-to-list 'completion-styles 'initials t) - (bind-key "M-" #'company-complete company-mode-map) - (setq company-tooltip-align-annotations t - tab-always-indent 'complete) - (setq company-dabbrev-downcase nil)) - :diminish company-mode) - -;;;; Evil mode configuration. -(use-package evil - :ensure t - :init ;; tweak evil's configuration before loading it - (setq evil-search-module 'evil-search - evil-ex-complete-emacs-commands nil - evil-vsplit-window-right t - evil-split-window-below t - evil-shift-round nil - evil-want-C-u-scroll t) - :config ;; tweak evil after loading it - (evil-mode) - (setq evil-want-C-u-scroll t) - (eval-after-load "evil-maps" - ;; Unset Evil's "M-." keymap so that TAGS definitions can be followed. - (define-key evil-normal-state-map "\M-." nil))) - -(use-package undo-tree - :ensure t) - -;;;; Heml mode configuration. -(use-package helm - :requires helm-config - :init - (helm-mode 1) - (helm-autoresize-mode 1) - :bind - ("" . helm-execute-persistent-action) ; rebind tab to run persistent action - ("C-i" . helm-execute-persistent-action) ; make TAB work in terminal - ("C-z" . helm-select-action) ; list actions using C-z - :config - (setq helm-autoresize-max-height 0 - helm-autoresize-min-height 20 - helm-split-window-in-side-p t ; Open helm buffer inside current window, not occupy whole other window - helm-move-to-line-cycle-in-source t ; Move to end or beginning of source when reaching top or bottom of source. - helm-ff-search-library-in-sexp t ; Search for library in `require' and `declare-function' sexp. - helm-scroll-amount 8 ; Scroll 8 lines other window using M-/M- - helm-ff-file-name-history-use-recentf t - helm-echo-input-in-header-line t) - (global-unset-key (kbd "C-x c")) - (when (executable-find "firefox") - (setq helm-google-suggest-use-curl-p t)) - :bind - ("C-c h" . helm-command-prefix)) - - -(provide 'jenga-prelude) diff --git a/modules/jenga-rust.el b/modules/jenga-rust.el index 2a48179..9b3df25 100644 --- a/modules/jenga-rust.el +++ b/modules/jenga-rust.el @@ -15,9 +15,9 @@ (use-package lsp-ui :commands lsp-ui-mode :bind (:map lsp-ui-mode-map - ("M-." . lsp-ui-peek-find-definitions) - ("M-," . lsp-ui-peek-jump-backward) - ("M-?" . lsp-ui-peek-find-references) + ("M-." . lsp-ui-peek-find-definitions) + ("M-," . lsp-ui-peek-jump-backward) + ("M-?" . lsp-ui-peek-find-references) ("C-c u" . lsp-ui-imenu) ("C-c C-a" . lsp-ui-sideline-apply-code-actions)) :config (setq lsp-ui-peek-enable t)) @@ -27,6 +27,11 @@ (setq rust-format-on-save t) :hook (rust-mode . lsp)) +(use-package lsp-rust + :after lsp-mode + :config + (setq lsp-rust-server 'rust-analyzer)) + ;; Add keybindings for interacting with Cargo (use-package cargo diff --git a/modules/jenga-ui.el b/modules/jenga-ui.el index 1fc97ac..e89ca76 100644 --- a/modules/jenga-ui.el +++ b/modules/jenga-ui.el @@ -25,7 +25,7 @@ (add-hook 'text-mode-hook #'display-line-numbers-mode) (add-hook 'prog-mode-hook #'display-line-numbers-mode) -(set-face-attribute 'default (selected-frame) :height 85) +;; (set-face-attribute 'default (selected-frame) :height 85) (setq column-number-mode t) (setq ido-use-filename-at-point nil)