Browse Source

Emacs: Ivy and Cargo modes

master
Julio Biason 4 years ago
parent
commit
a697373a33
  1. 84
      emacs.d/init.el

84
emacs.d/init.el

@ -22,65 +22,85 @@
;; update packages ;; update packages
(use-package auto-package-update (use-package auto-package-update
:config (setq auto-package-update-delete-old-versions t) :config (setq auto-package-update-delete-old-versions t)
(setq auto-package-update-hide-results t) (setq auto-package-update-hide-results t)
(auto-package-update-maybe)) (auto-package-update-maybe))
;; rust mode ;; rust mode
(use-package rust-mode (use-package rust-mode
:ensure t) :ensure t
:config (setq rust-format-on-save t))
;; cargo
(use-package cargo
:ensure t
:config (add-hook 'rust-mode-hook 'cargo-minor-mode))
;; Notes ;; Notes
(use-package org (use-package org
:ensure t :ensure t
:bind (("\C-cl" . org-store-link) :bind (("\C-cl" . org-store-link)
("\C-ca" . org-agenda) ("\C-ca" . org-agenda)
("\C-cb" . org-iswtichb))) ("\C-cb" . org-iswtichb)))
;; LanguageServer ;; LanguageServer
(use-package lsp-mode (use-package lsp-mode
:ensure t :ensure t
:hook ((python-mode . lsp) :hook ((python-mode . lsp)
(rust-mode . lsp)) (rust-mode . lsp))
:commands lsp :commands lsp
:config (setq lsp-enable-indentation t :config (setq lsp-enable-indentation t
lsp-enable-on-type-formatting t)) lsp-enable-on-type-formatting t))
(use-package lsp-ui (use-package lsp-ui
:commands lsp-ui-mode :commands lsp-ui-mode
:ensure t :ensure t
:config (setq lsp-ui-sideline-show-diagnostics t)) :config (setq lsp-ui-sideline-show-diagnostics t))
;; Markdown mode ;; Markdown mode
(use-package markdown-mode (use-package markdown-mode
:ensure t) :ensure t)
;; install goto last change (opens the file in the last position) ;; install goto last change (opens the file in the last position)
; (use-package goto-last-change ; (use-package goto-last-change
; :ensure t) ; :ensure t)
;; install fill-column-indicador: right side gutter ;; install fill-column-indicador: right side gutter
; (use-package fill-column-indicator (use-package fill-column-indicator
; :ensure t) :ensure t)
;; better completion
(use-package counsel
:ensure t
:config
(global-set-key "\C-s" 'swiper)
(global-set-key (kbd "C-c C-r") 'ivy-resume)
(global-set-key (kbd "M-x") 'counsel-M-x) ;
(global-set-key (kbd "C-x C-f") 'counsel-find-file)
(global-set-key (kbd "C-c g") 'counsel-git)
(global-set-key (kbd "C-c j") 'counsel-git-grep)
(global-set-key (kbd "C-x l") 'counsel-locate)
(define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)
)
;; powerline ;; powerline
(use-package powerline (use-package powerline
:ensure t :ensure t
:config (powerline-center-theme)) :config (powerline-center-theme))
;; colorschemes ;; colorschemes
(use-package doom-themes (use-package doom-themes
:ensure t :ensure t
:config (setq doom-themes-enable-bold t :config (setq doom-themes-enable-bold t
doom-themes-enable-italic t) doom-themes-enable-italic t)
(load-theme 'doom-molokai t) (load-theme 'doom-molokai t))
)
; (setq-default fill-column 80) ; (setq-default fill-column 80)
; (define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1))) ; (define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1)))
; (global-fci-mode 1) ; (global-fci-mode 1)
;; highlights the current line ;; highlights the current line
(use-package hlinum (use-package hlinum
:ensure t) :ensure t)
(set-face-foreground 'linum-highlight-face "white") (set-face-foreground 'linum-highlight-face "white")
(set-face-background 'linum-highlight-face nil) (set-face-background 'linum-highlight-face nil)
(hlinum-activate) (hlinum-activate)
@ -91,16 +111,16 @@
;; git gutters ;; git gutters
(use-package diff-hl (use-package diff-hl
:ensure t :ensure t
:init (setq diff-hl-side 'right)) :init (setq diff-hl-side 'right))
(global-diff-hl-mode 1) (global-diff-hl-mode 1)
(diff-hl-margin-mode 1) (diff-hl-margin-mode 1)
(diff-hl-flydiff-mode 1) (diff-hl-flydiff-mode 1)
;; install editorconfig ;; install editorconfig
(use-package editorconfig (use-package editorconfig
:ensure t :ensure t
:config (editorconfig-mode 1)) :config (editorconfig-mode 1))
(require 'whitespace) (require 'whitespace)
(setq whitespace-style '(face empty tabs lines-tail trailing)) (setq whitespace-style '(face empty tabs lines-tail trailing))

Loading…
Cancel
Save