Remove redundant modules, use rust-analyzer

This commit is contained in:
Vladan Popovic 2020-07-30 23:02:28 +02:00
parent 47565fe8b2
commit 6214f60f72
8 changed files with 95 additions and 93 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ history
ac-comphist.dat
elpy/
.python*
recentf

View file

@ -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.

View file

@ -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)

View file

@ -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)

82
modules/jenga-init.el Normal file
View file

@ -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-<tab>" #'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)

View file

@ -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-<tab>" #'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
("<tab>" . 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-<next>/M-<prior>
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)

View file

@ -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

View file

@ -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)