use-package configuration is better
This commit is contained in:
		
							parent
							
								
									5b50bfea88
								
							
						
					
					
						commit
						bd5e9a2b46
					
				
					 16 changed files with 185 additions and 174 deletions
				
			
		
							
								
								
									
										15
									
								
								custom.el
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								custom.el
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,15 @@
 | 
				
			||||||
 | 
					(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.
 | 
				
			||||||
 | 
					 '(ffap-machine-p-known (quote reject))
 | 
				
			||||||
 | 
					 '(package-selected-packages
 | 
				
			||||||
 | 
					   (quote
 | 
				
			||||||
 | 
					    (undo-tree ein-mumamo yasnippet use-package racer material-theme magit lsp-ui helm flycheck-rust elm-mode company-lsp cargo))))
 | 
				
			||||||
 | 
					(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.
 | 
				
			||||||
 | 
					 )
 | 
				
			||||||
							
								
								
									
										26
									
								
								init.el
									
										
									
									
									
								
							
							
						
						
									
										26
									
								
								init.el
									
										
									
									
									
								
							| 
						 | 
					@ -4,8 +4,9 @@
 | 
				
			||||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
 | 
					(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
 | 
				
			||||||
(package-initialize)
 | 
					(package-initialize)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(setq dotfiles-dir (file-name-directory
 | 
					(setq dotfiles-dir
 | 
				
			||||||
                    (or (buffer-file-name) (file-chase-links load-file-name))))
 | 
					      (file-name-directory
 | 
				
			||||||
 | 
					        (or (buffer-file-name) (file-chase-links load-file-name))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(add-to-list 'load-path (concat dotfiles-dir "modules"))
 | 
					(add-to-list 'load-path (concat dotfiles-dir "modules"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,24 +17,13 @@
 | 
				
			||||||
(require 'jenga-helm)
 | 
					(require 'jenga-helm)
 | 
				
			||||||
(require 'jenga-magit)
 | 
					(require 'jenga-magit)
 | 
				
			||||||
(require 'jenga-org)
 | 
					(require 'jenga-org)
 | 
				
			||||||
(require 'jenga-python)
 | 
					(require 'jenga-ui)
 | 
				
			||||||
(require 'jenga-theme)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; Custom languages and highlighting
 | 
					;; Custom languages and highlighting
 | 
				
			||||||
(require 'jenga-elm)
 | 
					(require 'jenga-elm)
 | 
				
			||||||
(require 'jenga-rust)
 | 
					(require 'jenga-rust)
 | 
				
			||||||
(require 'jenga-systemd)
 | 
					(require 'jenga-systemd)
 | 
				
			||||||
(custom-set-variables
 | 
					(require 'jenga-python)
 | 
				
			||||||
 ;; custom-set-variables was added by Custom.
 | 
					
 | 
				
			||||||
 ;; If you edit it by hand, you could mess it up, so be careful.
 | 
					(setq custom-file "~/.emacs.d/custom.el")
 | 
				
			||||||
 ;; Your init file should contain only one such instance.
 | 
					(load custom-file)
 | 
				
			||||||
 ;; If there is more than one, they won't work right.
 | 
					 | 
				
			||||||
 '(package-selected-packages
 | 
					 | 
				
			||||||
   (quote
 | 
					 | 
				
			||||||
    (ein-mumamo yasnippet use-package racer material-theme magit lsp-ui helm flycheck-rust elm-mode company-lsp cargo))))
 | 
					 | 
				
			||||||
(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.
 | 
					 | 
				
			||||||
 )
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,12 +1,15 @@
 | 
				
			||||||
;;;; Company configuration.
 | 
					;;;; Company configuration.
 | 
				
			||||||
(require 'jenga-functions)
 | 
					(use-package company
 | 
				
			||||||
(instl 'company)
 | 
					  :ensure t
 | 
				
			||||||
 | 
					  :defer t
 | 
				
			||||||
;; Allign annotations in company auto-complete list.
 | 
					  :init (global-company-mode)
 | 
				
			||||||
(setq company-tooltip-align-annotations t)
 | 
					  :config
 | 
				
			||||||
(add-hook 'after-init-hook 'global-company-mode)
 | 
					  (progn
 | 
				
			||||||
 | 
					    (add-to-list 'completion-styles 'initials t)
 | 
				
			||||||
(setq tab-always-indent 'complete)
 | 
					    (bind-key "M-<tab>" #'company-complete company-mode-map)
 | 
				
			||||||
(add-to-list 'completion-styles 'initials t)
 | 
					    (setq company-tooltip-align-annotations t
 | 
				
			||||||
 | 
					          tab-always-indent 'complete)
 | 
				
			||||||
 | 
					    (setq company-dabbrev-downcase nil))
 | 
				
			||||||
 | 
					  :diminish company-mode)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(provide 'jenga-company)
 | 
					(provide 'jenga-company)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,26 +1,25 @@
 | 
				
			||||||
;;;; Elm mode configuration.
 | 
					;;;; Elm mode configuration.
 | 
				
			||||||
(require 'jenga-functions)
 | 
					(use-package elm-mode
 | 
				
			||||||
(instl 'elm-mode)
 | 
					    :ensure t
 | 
				
			||||||
(instl 'lsp-mode)
 | 
					    :bind
 | 
				
			||||||
(instl 'lsp-ui)
 | 
					    ("M-<tab>" . company-indent-or-complete-common)
 | 
				
			||||||
(instl 'yasnippet)
 | 
					    :config
 | 
				
			||||||
 | 
					    (use-package lsp-mode)
 | 
				
			||||||
 | 
					    (use-package lsp-ui)
 | 
				
			||||||
 | 
					    (use-package yasnippet)
 | 
				
			||||||
 | 
					    (use-package company)
 | 
				
			||||||
 | 
					    (setq elm-format-on-save t
 | 
				
			||||||
 | 
					          elm-tags-on-save t
 | 
				
			||||||
 | 
					          elm-tags-exclude-elm-stuff nil)
 | 
				
			||||||
 | 
					    (add-to-list 'company-backends 'company-elm)
 | 
				
			||||||
 | 
					    (add-to-list 'auto-mode-alist '("\\.elm\\'" . elm-mode))
 | 
				
			||||||
 | 
					    :hook
 | 
				
			||||||
 | 
					    (after-init . global-flycheck-mode)
 | 
				
			||||||
 | 
					    (elm-mode   . company-mode)
 | 
				
			||||||
 | 
					    (elm-mode   . lsp)
 | 
				
			||||||
 | 
					    (elm-mode   . (lambda () (setq evil-auto-indent nil))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(add-hook 'elm-mode-hook #'company-mode)
 | 
					 | 
				
			||||||
(add-hook 'elm-mode-hook #'lsp)
 | 
					 | 
				
			||||||
(add-hook 'elm-mode-hook (lambda () (setq evil-auto-indent nil)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(add-hook 'after-init-hook #'global-flycheck-mode)
 | 
					 | 
				
			||||||
(with-eval-after-load 'flycheck
 | 
					(with-eval-after-load 'flycheck
 | 
				
			||||||
      '(add-hook 'flycheck-mode-hook #'flycheck-elm-setup))
 | 
					      '(add-hook 'flycheck-mode-hook #'flycheck-elm-setup))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(add-to-list 'company-backends 'company-elm)
 | 
					 | 
				
			||||||
(define-key elm-mode-map (kbd "M-<tab>") #'company-indent-or-complete-common)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
;; Turn on Elm mode with *.elm files.
 | 
					 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.elm\\'" . elm-mode))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(setq elm-format-on-save t
 | 
					 | 
				
			||||||
      elm-tags-on-save t
 | 
					 | 
				
			||||||
      elm-tags-exclude-elm-stuff nil)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(provide 'jenga-elm)
 | 
					(provide 'jenga-elm)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,16 +1,8 @@
 | 
				
			||||||
;; Persist command history
 | 
					;; Persist command history
 | 
				
			||||||
(savehist-mode 1)
 | 
					(savehist-mode 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; Disable the splash screen (to enable it agin, replace the t with 0).
 | 
					;; Enable C-r in evil
 | 
				
			||||||
(setq inhibit-splash-screen t)
 | 
					(undo-tree-mode 1)
 | 
				
			||||||
 | 
					 | 
				
			||||||
;; Disable the menu.
 | 
					 | 
				
			||||||
(tool-bar-mode -1)
 | 
					 | 
				
			||||||
;; Enable transient mark mode.
 | 
					 | 
				
			||||||
(transient-mark-mode 1)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
;; Highlight paired parentheses when cursor is over one.
 | 
					 | 
				
			||||||
(show-paren-mode 1)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;;; TAGS configuration.
 | 
					;;;; TAGS configuration.
 | 
				
			||||||
;; Goto tag with M-.
 | 
					;; Goto tag with M-.
 | 
				
			||||||
| 
						 | 
					@ -21,21 +13,10 @@
 | 
				
			||||||
    (message "Loading tags file: %s" my-tags-file)
 | 
					    (message "Loading tags file: %s" my-tags-file)
 | 
				
			||||||
    (visit-tags-table my-tags-file)))
 | 
					    (visit-tags-table my-tags-file)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;;(setq split-height-threshold nil)
 | 
					;; Resize windows
 | 
				
			||||||
;;(setq split-width-threshold 0)
 | 
					 | 
				
			||||||
(global-set-key (kbd "S-C-h") 'shrink-window-horizontally)
 | 
					(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-l") 'enlarge-window-horizontally)
 | 
				
			||||||
(global-set-key (kbd "S-C-j") 'shrink-window)
 | 
					(global-set-key (kbd "S-C-j") 'shrink-window)
 | 
				
			||||||
(global-set-key (kbd "S-C-k") 'enlarge-window)
 | 
					(global-set-key (kbd "S-C-k") 'enlarge-window)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(setq column-number-mode t)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(setq-default display-line-numbers-type 'absolute
 | 
					 | 
				
			||||||
              display-line-numbers-current-absolute t
 | 
					 | 
				
			||||||
              display-line-numbers-width 4
 | 
					 | 
				
			||||||
              display-line-numbers-widen t)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(add-hook 'text-mode-hook #'display-line-numbers-mode)
 | 
					 | 
				
			||||||
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(provide 'jenga-emacs)
 | 
					(provide 'jenga-emacs)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,15 +2,20 @@
 | 
				
			||||||
;;(unless (package-installed-p 'evil)
 | 
					;;(unless (package-installed-p 'evil)
 | 
				
			||||||
;;  (package-refresh-contents)
 | 
					;;  (package-refresh-contents)
 | 
				
			||||||
;;  (package-install 'evil))
 | 
					;;  (package-install 'evil))
 | 
				
			||||||
(add-to-list 'load-path "~/.emacs.d/evil")
 | 
					(use-package evil
 | 
				
			||||||
(setq evil-want-C-u-scroll t)
 | 
					    :ensure t
 | 
				
			||||||
 | 
					    :init ;; tweak evil's configuration before loading it
 | 
				
			||||||
;; Enable Evil mode.
 | 
					    (setq evil-search-module 'evil-search
 | 
				
			||||||
(require 'evil)
 | 
					          evil-ex-complete-emacs-commands nil
 | 
				
			||||||
(evil-mode 1)
 | 
					          evil-vsplit-window-right t
 | 
				
			||||||
 | 
					          evil-split-window-below t
 | 
				
			||||||
(eval-after-load "evil-maps"
 | 
					          evil-shift-round nil
 | 
				
			||||||
  ;; Unset Evil's "M-." keymap so that TAGS definitions can be followed.
 | 
					          evil-want-C-u-scroll t)
 | 
				
			||||||
  (define-key evil-normal-state-map "\M-." nil))
 | 
					    :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)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(provide 'jenga-evil)
 | 
					(provide 'jenga-evil)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +0,0 @@
 | 
				
			||||||
(defun instl (pckg)
 | 
					 | 
				
			||||||
    (unless (and should-install-packages (package-installed-p pckg))
 | 
					 | 
				
			||||||
      (package-refresh-contents)
 | 
					 | 
				
			||||||
      (package-install pckg))
 | 
					 | 
				
			||||||
    (require pckg))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(provide 'jenga-functions)
 | 
					 | 
				
			||||||
| 
						 | 
					@ -1,13 +1,22 @@
 | 
				
			||||||
;;;; Heml mode configuration.
 | 
					;;;; Heml mode configuration.
 | 
				
			||||||
(require 'jenga-functions)
 | 
					(use-package helm
 | 
				
			||||||
(instl 'helm)
 | 
					    :requires helm-config
 | 
				
			||||||
 | 
					    :init
 | 
				
			||||||
(require 'helm-config)
 | 
					    (helm-mode 1)
 | 
				
			||||||
 | 
					    (helm-autoresize-mode 1)
 | 
				
			||||||
(helm-mode 1)
 | 
					    :bind
 | 
				
			||||||
(setq helm-autoresize-max-height 0)
 | 
					    ("<tab>" . helm-execute-persistent-action) ; rebind tab to run persistent action
 | 
				
			||||||
(setq helm-autoresize-min-height 20)
 | 
					    ("C-i"   . helm-execute-persistent-action) ; make TAB work in terminal
 | 
				
			||||||
(helm-autoresize-mode 1)
 | 
					    ("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))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
 | 
					;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
 | 
				
			||||||
;; Changed to "C-c h". Note: We must set "C-c h" globally, because we
 | 
					;; Changed to "C-c h". Note: We must set "C-c h" globally, because we
 | 
				
			||||||
| 
						 | 
					@ -15,18 +24,8 @@
 | 
				
			||||||
(global-set-key (kbd "C-c h") 'helm-command-prefix)
 | 
					(global-set-key (kbd "C-c h") 'helm-command-prefix)
 | 
				
			||||||
(global-unset-key (kbd "C-x c"))
 | 
					(global-unset-key (kbd "C-x c"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebind tab to run persistent action
 | 
					 | 
				
			||||||
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB work in terminal
 | 
					 | 
				
			||||||
(define-key helm-map (kbd "C-z")  'helm-select-action) ; list actions using C-z
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(when (executable-find "firefox")
 | 
					(when (executable-find "firefox")
 | 
				
			||||||
  (setq helm-google-suggest-use-curl-p t))
 | 
					  (setq helm-google-suggest-use-curl-p t))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(setq 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)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(provide 'jenga-helm)
 | 
					(provide 'jenga-helm)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,5 @@
 | 
				
			||||||
;;;; Magit configuration.
 | 
					;;;; Magit configuration.
 | 
				
			||||||
(require 'jenga-functions)
 | 
					(use-package magit
 | 
				
			||||||
(instl 'magit)
 | 
					    :init (setq magit-auto-revert-mode nil))
 | 
				
			||||||
 | 
					 | 
				
			||||||
(setq magit-auto-revert-mode nil)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(provide 'jenga-magit)
 | 
					(provide 'jenga-magit)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,7 @@
 | 
				
			||||||
;;;; Org mode configuration.
 | 
					;;;; Org mode configuration.
 | 
				
			||||||
;; Enable Org mode.
 | 
					;; Enable Org mode.
 | 
				
			||||||
(require 'jenga-functions)
 | 
					(use-package org
 | 
				
			||||||
(instl 'org)
 | 
					    :ensure t
 | 
				
			||||||
 | 
					    :init (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)))
 | 
				
			||||||
;; Turn on Org mode on .org files.
 | 
					 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(provide 'jenga-org)
 | 
					(provide 'jenga-org)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,26 +1,33 @@
 | 
				
			||||||
;;;; Python configuration.
 | 
					;;;; Python configuration.
 | 
				
			||||||
(require 'jenga-functions)
 | 
					(use-package jupyter
 | 
				
			||||||
(instl 'elpy)
 | 
					    :ensure t)
 | 
				
			||||||
(instl 'jupyter)
 | 
					(use-package ein
 | 
				
			||||||
(instl 'ein)
 | 
					    :ensure t)
 | 
				
			||||||
(instl 'py-autopep8)
 | 
					(use-package py-autopep8
 | 
				
			||||||
(instl 'yasnippet)
 | 
					    :ensure t)
 | 
				
			||||||
 | 
					(use-package yasnippet
 | 
				
			||||||
(elpy-enable)
 | 
					    :ensure t)
 | 
				
			||||||
 | 
					(use-package jedi
 | 
				
			||||||
(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)
 | 
					    :ensure t)
 | 
				
			||||||
 | 
					(use-package elpy
 | 
				
			||||||
;; Enable Flycheck
 | 
					    :ensure t
 | 
				
			||||||
(when (require 'flycheck nil t)
 | 
					    :init
 | 
				
			||||||
  (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
 | 
					    (elpy-enable)
 | 
				
			||||||
  (add-hook 'elpy-mode-hook 'flycheck-mode))
 | 
					    :bind
 | 
				
			||||||
 | 
					    ("M-." . jedi:goto-definition)
 | 
				
			||||||
;; Use IPython for REPL
 | 
					    ("M-," . jedi:goto-definition-pop-marker)
 | 
				
			||||||
(setq python-shell-interpreter "jupyter"
 | 
					    :config
 | 
				
			||||||
      python-shell-interpreter-args "console --simple-prompt"
 | 
					    (setq python-shell-interpreter "jupyter"
 | 
				
			||||||
      python-shell-prompt-detect-failure-warning nil)
 | 
					          python-indent-offset 4
 | 
				
			||||||
 | 
					          python-shell-interpreter-args "console --simple-prompt"
 | 
				
			||||||
(add-to-list 'python-shell-completion-native-disabled-interpreters
 | 
					          python-shell-prompt-detect-failure-warning nil)
 | 
				
			||||||
             "jupyter")
 | 
					    ;; Use IPython for REPL
 | 
				
			||||||
 | 
					    (add-to-list 'python-shell-completion-native-disabled-interpreters
 | 
				
			||||||
 | 
					                 "jupyter")
 | 
				
			||||||
 | 
					    :hook
 | 
				
			||||||
 | 
					    (elpy-mode . py-autopep8-enable-on-save)
 | 
				
			||||||
 | 
					    (elpy-mode . flycheck-mode)
 | 
				
			||||||
 | 
					    (elpy-mode . jedi:setup)
 | 
				
			||||||
 | 
					    (elpy-mode . jedi:ac-setup))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(provide 'jenga-python)
 | 
					(provide 'jenga-python)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										0
									
								
								modules/jenga-rst.el
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								modules/jenga-rst.el
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -1,27 +1,26 @@
 | 
				
			||||||
;;;; Rust mode configuration.
 | 
					;;;; Rust mode configuration.
 | 
				
			||||||
;; Add rust load hooks.
 | 
					;; Add rust load hooks.
 | 
				
			||||||
(require 'jenga-functions)
 | 
					(use-package cargo)
 | 
				
			||||||
(instl 'rust-mode)
 | 
					(use-package flycheck-rust)
 | 
				
			||||||
(instl 'racer)
 | 
					 | 
				
			||||||
(instl 'cargo)
 | 
					 | 
				
			||||||
(instl 'flycheck-rust)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
(add-hook 'rust-mode-hook #'racer-mode)
 | 
					(use-package rust-mode
 | 
				
			||||||
(add-hook 'racer-mode-hook #'eldoc-mode)
 | 
					    :init (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
 | 
				
			||||||
(add-hook 'racer-mode-hook #'company-mode)
 | 
					    :bind
 | 
				
			||||||
(add-hook 'rust-mode-hook #'cargo-minor-mode)
 | 
					    ("M-."     . racer-find-definition)
 | 
				
			||||||
 | 
					    ("M-h"     . racer-describe)
 | 
				
			||||||
 | 
					    ("M-<tab>" . company-indent-or-complete-common)
 | 
				
			||||||
 | 
					    :config
 | 
				
			||||||
 | 
					    (setq rust-format-on-save t)
 | 
				
			||||||
 | 
					    :hook
 | 
				
			||||||
 | 
					    (after-init . global-flycheck-mode)
 | 
				
			||||||
 | 
					    (rust-mode  . racer-mode)
 | 
				
			||||||
 | 
					    (rust-mode  . cargo-minor-mode))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(use-package racer
 | 
				
			||||||
 | 
					    :hook
 | 
				
			||||||
 | 
					    (racer-mode . eldoc-mode)
 | 
				
			||||||
 | 
					    (racer-mode . company-mode))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(add-hook 'after-init-hook #'global-flycheck-mode)
 | 
					 | 
				
			||||||
(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
 | 
					(add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
;; Turn on Rust mode with *.rs files.
 | 
					 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
 | 
					 | 
				
			||||||
;; Auto-format with rustfmt on save.
 | 
					 | 
				
			||||||
(setq rust-format-on-save t)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(define-key rust-mode-map (kbd "M-.") #'racer-find-definition)
 | 
					 | 
				
			||||||
(define-key rust-mode-map (kbd "M-h") #'racer-describe)
 | 
					 | 
				
			||||||
(define-key rust-mode-map (kbd "M-<tab>") #'company-indent-or-complete-common)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(provide 'jenga-rust)
 | 
					(provide 'jenga-rust)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,13 +1,13 @@
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.service\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.service\\'"   . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.timer\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.timer\\'"     . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.target\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.target\\'"    . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.mount\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.mount\\'"     . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.automount\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.automount\\'" . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.slice\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.slice\\'"     . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.socket\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.socket\\'"    . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.path\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.path\\'"      . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.netdev\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.netdev\\'"    . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.network\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.network\\'"   . conf-unix-mode))
 | 
				
			||||||
(add-to-list 'auto-mode-alist '("\\.link\\'" . conf-unix-mode))
 | 
					(add-to-list 'auto-mode-alist '("\\.link\\'"      . conf-unix-mode))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(provide 'jenga-systemd)
 | 
					(provide 'jenga-systemd)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +0,0 @@
 | 
				
			||||||
;; Use material theme on black background.
 | 
					 | 
				
			||||||
(unless (package-installed-p 'material-theme)
 | 
					 | 
				
			||||||
  (package-refresh-contents)
 | 
					 | 
				
			||||||
  (package-install 'material-theme))
 | 
					 | 
				
			||||||
(require 'material-theme)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(provide 'jenga-theme)
 | 
					 | 
				
			||||||
							
								
								
									
										31
									
								
								modules/jenga-ui.el
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								modules/jenga-ui.el
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,31 @@
 | 
				
			||||||
 | 
					;; Use material theme on black background.
 | 
				
			||||||
 | 
					(use-package material-theme)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;;
 | 
				
			||||||
 | 
					;; ===============
 | 
				
			||||||
 | 
					;; Other UI tweaks
 | 
				
			||||||
 | 
					;; ===============
 | 
				
			||||||
 | 
					;;
 | 
				
			||||||
 | 
					;; Disable the splash screen (to enable it agin, replace the t with 0).
 | 
				
			||||||
 | 
					(setq inhibit-splash-screen t)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;; Disable the menu.
 | 
				
			||||||
 | 
					(tool-bar-mode -1)
 | 
				
			||||||
 | 
					;; Enable transient mark mode.
 | 
				
			||||||
 | 
					(transient-mark-mode 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					;; Highlight paired parentheses when cursor is over one.
 | 
				
			||||||
 | 
					(show-paren-mode 1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(setq-default display-line-numbers-type 'absolute
 | 
				
			||||||
 | 
					              display-line-numbers-current-absolute t
 | 
				
			||||||
 | 
					              display-line-numbers-width 4
 | 
				
			||||||
 | 
					              display-line-numbers-widen t)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(add-hook 'text-mode-hook #'display-line-numbers-mode)
 | 
				
			||||||
 | 
					(add-hook 'prog-mode-hook #'display-line-numbers-mode)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(setq column-number-mode t)
 | 
				
			||||||
 | 
					(setq ido-use-filename-at-point nil)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(provide 'jenga-ui)
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue