Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #+STARTUP: overview
- * Interface tweaks
- #+BEGIN_SRC emacs-lisp
- ;; UTF-8 encoding
- (prefer-coding-system 'utf-8)
- ;; Set "yes or no" commands to "y or n"
- (fset 'yes-or-no-p 'y-or-n-p)
- ;; Getting rid of startup screen
- (setq inhibit-startup-screen t)
- ;; Changing line-break behavior
- (global-visual-line-mode 1)
- (global-hl-line-mode t)
- ;; Spell-check
- (setq-default ispell-program-name "aspell")
- ;; Changing default font size
- (set-frame-font "Source Code Pro 13" nil t)
- ;; Get rid of tabs in favor of spaces (mostly for highlight-indentation mode)
- (setq-default indent-tabs-mode nil)
- ;; Surround selection with these pairs
- (global-set-key (kbd "M-[") 'insert-pair)
- (global-set-key (kbd "M-{") 'insert-pair)
- (global-set-key (kbd "M-\"") 'insert-pair)
- (vc-mode -1)
- #+END_SRC
- * All the icons
- #+BEGIN_SRC emacs-lisp
- (use-package all-the-icons ;
- :ensure t)
- #+END_SRC
- * Ace-window
- #+BEGIN_SRC emacs-lisp
- ;; Easy window switching
- (use-package ace-window
- :ensure t
- :init ;
- (progn
- (global-set-key (kbd "M-o") 'ace-window))
- (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)))
- #+END_SRC
- * Aggressive indent
- #+BEGIN_SRC emacs-lisp
- (use-package aggressive-indent
- :ensure t
- :diminish
- :config
- (global-aggressive-indent-mode 1)
- (add-to-list 'aggressive-indent-excluded-modes 'html-mode))
- #+END_SRC
- * AucTeX
- #+BEGIN_SRC emacs-lisp
- (use-package auctex ;
- :defer t
- :ensure t
- :init
- (progn
- (setq TeX-auto-save t
- TeX-parse-self t
- TeX-save-query nil
- TeX-PDF-mode t))
- (setq TeX-view-program-selection '((output-pdf "PDF Tools"))))
- ;; Initializing SyncTeX and inhibiting startup message
- (setq TeX-source-correlate-mode t)
- (setq TeX-source-correlate-method 'synctex)
- (setq TeX-source-correlate-start-server t)
- ;; Adding RefTeX
- (require 'reftex)
- (setq reftex-plug-into-AUCTeX t)
- (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
- #+END_SRC
- * Auto-update
- #+BEGIN_SRC emacs-lisp
- (use-package auto-package-update ;
- :ensure t
- :config
- (setq auto-package-update-delete-old-versions t
- auto-package-update-interval 5)
- (auto-package-update-maybe))
- #+END_SRC
- * Better Defaults
- #+BEGIN_SRC emacs-lisp
- (use-package better-defaults ;
- :ensure t
- :config
- ;; Turn off ido mode in case I enabled it accidentally
- (ido-mode -1))
- #+END_SRC
- * Company
- #+BEGIN_SRC emacs-lisp
- ;; Autocompletion for words
- (use-package company
- :ensure t
- :config
- (global-company-mode)
- :custom
- (company-idle-delay .2)
- (company-minimum-prefix-length 2)
- (company-show-numbers t)
- (company-tooltip-align-annotations 't))
- ;; Adding company for AucTeX
- (use-package company-auctex
- :ensure t
- :after
- (auctex company)
- :config
- (company-auctex-init))
- (use-package company-quickhelp
- :ensure t
- :config
- (company-quickhelp-mode)
- '(company-quickhelp-delay 0.3)
- '(company-quickhelp-use-propertized-text 't))
- ;; Company for Jedi
- (use-package company-jedi
- :ensure t
- :defer t)
- ;; Company for C
- (use-package company-irony
- :ensure t
- :defer t)
- #+END_SRC
- * Centered Cursor Mode
- #+BEGIN_SRC emacs-lisp
- (use-package centered-cursor-mode
- :ensure t)
- #+END_SRC
- * Diminish
- #+BEGIN_SRC emacs-lisp
- ;; Use minor modes without them appearing on the mode-line
- (use-package diminish
- :ensure t
- :config
- (diminish 'auto-revert-mode)
- (diminish 'visual-line-mode))
- #+END_SRC
- * Evil
- #+BEGIN_SRC emacs-lisp
- (use-package evil ;
- :ensure t
- :diminish undo-tree-mode
- :init
- (setq evil-want-keybinding 'nil)
- :config
- (define-key evil-motion-state-map "j" 'evil-next-visual-line)
- (define-key evil-motion-state-map "k" 'evil-previous-visual-line)
- (define-key evil-motion-state-map (kbd "SPC") nil) ;; Unbinding space key to use in general config
- (define-key evil-normal-state-map "/" 'swiper) ;; Change evil search to swiper
- (define-key evil-motion-state-map "/" 'swiper)
- (evil-mode 1))
- ;; Add global keyboard shortcut to activate evil mode
- ;; (global-set-key (kbd "C-z") 'evil-mode)
- ;; Bind everything to Evil that hasn't already been binded
- (use-package evil-collection
- :ensure t
- :config
- (evil-collection-init))
- #+END_SRC
- * Elpy
- #+BEGIN_SRC emacs-lisp
- ;; Python extension for emacs
- (use-package elpy
- :ensure t
- :config
- (elpy-enable))
- #+END_SRC
- * Exec-path-from-shell
- #+BEGIN_SRC emacs-lisp
- ;; A GNU Emacs library to ensure environment variables inside Emacs look the same as in the user's shell. (for use-package ensure-system-package)
- (use-package exec-path-from-shell
- :ensure t
- :config
- (when (memq window-system '(mac ns x))
- (exec-path-from-shell-initialize)))
- (use-package use-package-ensure-system-package
- :ensure t)
- #+END_SRC
- * Expand region
- #+BEGIN_SRC emacs-lisp
- (use-package expand-region
- :ensure t
- :config
- (global-set-key (kbd "C-=") 'er/expand-region))
- #+END_SRC
- * Eyebrowse
- #+BEGIN_SRC emacs-lisp
- ;; Save window configurations
- (use-package eyebrowse
- :ensure t
- :diminish eyebrows-mode
- :config
- (eyebrowse-mode t)
- (eyebrowse-setup-opinionated-keys))
- #+END_SRC
- * Fancy Battery
- #+BEGIN_SRC emacs-lisp
- (use-package fancy-battery
- :ensure t
- :config
- (fancy-battery-mode 1))
- #+END_SRC
- * Flycheck
- #+BEGIN_SRC emacs-lisp
- ;; Syntax checker
- (use-package flycheck
- :ensure t
- :diminish
- :config
- (global-flycheck-mode))
- #+END_SRC
- * Flyspell-correct
- #+BEGIN_SRC emacs-lisp
- ;; Adding flyspell as spell-checker
- (use-package flyspell
- :ensure t
- :defer t
- :diminish
- :init
- (progn
- (add-hook 'prog-mode-hook 'flyspell-prog-mode)
- (add-hook 'text-mode-hook 'flyspell-mode)
- (add-hook 'LaTeX-mode-hook 'flyspell-mode)))
- (use-package flyspell-correct-ivy
- :ensure t
- :config
- (define-key flyspell-mode-map (kbd "C-;") 'flyspell-correct-previous-word-generic))
- ;; Adding keyboard shortcuts to activate flyspell
- (global-set-key (kbd "<f8>") 'ispell-word)
- (global-set-key (kbd "C-<f8>") 'flyspell-mode)
- #+END_SRC
- * Fontawesome
- #+BEGIN_SRC emacs-lisp
- ;; Adding fontawesome icons
- (use-package fontawesome
- :ensure t)
- #+END_SRC
- * Golden Ratio
- #+BEGIN_SRC emacs-lisp
- ;; Focuses working window and makes it easier to work in
- (use-package golden-ratio
- :ensure t
- :diminish
- :config
- (require 'golden-ratio)
- (golden-ratio-mode 1)
- ;; Fix golden ratio mode to work with ace-window
- (add-to-list 'golden-ratio-extra-commands 'ace-window)
- (setq golden-ratio-auto-scale t))
- #+END_SRC
- * General
- #+BEGIN_SRC emacs-lisp
- ;; Allows for a leader key (similar to spacemacs)
- (use-package general
- :ensure t
- :config
- (general-evil-setup t)
- (general-define-key
- :states '(normal insert emacs motion)
- :prefix "SPC"
- :non-normal-prefix "C-SPC"
- "C-r" 'restart-emacs
- "C-s" 'save-some-buffers
- "0" 'delete-window
- "1" 'delete-other-windows
- "2" 'split-window-below
- "3" 'split-window-right
- "b" 'switch-to-buffer
- "d" 'dired
- "e" 'eval-last-sexp
- "f" 'counsel-find-file
- "g" 'magit-status
- "h" 'mark-whole-buffer
- "k" 'kill-buffer
- ;; "m" 'mu4e
- "s" 'save-buffer))
- #+END_SRC
- * Gitignore mode
- #+BEGIN_SRC emacs-lisp
- ;; Major mode for editing gitignore files
- (use-package gitignore-mode
- :ensure t)
- #+END_SRC
- * Highlight-indent-guides
- #+BEGIN_SRC emacs-lisp
- (use-package highlight-indent-guides
- :ensure t
- :diminish
- :config
- (add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
- (add-hook 'org-mode-hook 'highlight-indent-guides-mode)
- (setq highlight-indent-guides-delay 0))
- ;; Don't show first column indicator
- (defun my-highlighter (level responsive display)
- (if (> 1 level)
- nil
- (highlight-indent-guides--highlighter-default level responsive display)))
- (setq highlight-indent-guides-highlighter-function 'my-highlighter)
- #+END_SRC
- * Hydra
- #+BEGIN_SRC emacs-lisp
- (use-package hydra
- :ensure t)
- ;; Org mode hydra
- #+END_SRC
- * Irony
- # A mode for writing c++
- #+BEGIN_SRC emacs-lisp
- (use-package irony ;
- :ensure t
- :config
- (add-hook 'c++-mode-hook 'irony-mode)
- (add-hook 'c-mode-hook 'irony-mode)
- (add-hook 'objc-mode-hook 'irony-mode)
- (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
- #+END_SRC
- * Ivy / Counsel / Swiper
- #+BEGIN_SRC emacs-lisp
- ;; Auto-completion mechanism
- (use-package ivy
- :ensure t
- :diminish
- :config
- (setq ivy-use-virtual-buffers t
- ivy-count-format "%d/%d ")
- (ivy-mode 1)
- (global-set-key (kbd "C-s") 'swiper)
- (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
- (global-set-key (kbd "C-c g") 'counsel-git)
- (global-set-key (kbd "C-c j") 'counsel-git-grep)
- (global-set-key (kbd "C-c k") 'counsel-ag)
- (global-set-key (kbd "C-x l") 'counsel-locate)
- (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
- (define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history))
- ;; Gives extra details when using ivy
- (use-package ivy-rich
- :ensure t
- :config
- (setq ivy-rich-path-style 'abbrev)
- (setq ivy-virtual-abbreviate 'full
- ivy-rich-switch-buffer-align-virtual-buffer t)
- (ivy-rich-mode 1))
- ;; Ensures that all lists are used with ivy
- (use-package counsel
- :ensure t
- :diminish
- :config
- (counsel-mode))
- ;; A replacement for emacs' default search
- (use-package swiper
- :ensure t)
- #+END_SRC
- * Java
- #+BEGIN_SRC emacs-lisp
- (use-package java-snippets
- :ensure t)
- #+END_SRC
- * Linum-relative
- #+BEGIN_SRC emacs-lisp
- ;; Adding relative line numbers
- (use-package linum-relative
- :ensure t
- :diminish
- :config
- (require 'linum-relative)
- (linum-relative-global-mode)
- ;; Sets symbol of focused line to current line number
- (setq linum-relative-current-symbol ""))
- #+END_SRC
- * Magit
- #+BEGIN_SRC emacs-lisp
- ;; Git porcelain inside emacs
- (use-package magit
- :ensure t
- :init
- (global-set-key (kbd "C-x g") 'magit-status))
- (use-package evil-magit
- :ensure t)
- #+END_SRC
- * Meghanada
- #+BEGIN_SRC emacs-lisp
- (use-package meghanada
- :ensure t
- :if (executable-find "java")
- :config
- (add-hook 'java-mode-hook (lambda ()
- (meghanada-mode t))))
- #+END_SRC
- * Mode Line
- #+BEGIN_SRC emacs-lisp
- (use-package mode-icons ;
- :ensure t
- :config
- (mode-icons-mode))
- ;; Changing the mode-line to look better
- (use-package powerline
- :ensure t
- :config
- (require 'powerline)
- (powerline-default-theme))
- ;; Spacemacs stuff
- (use-package spaceline
- :ensure t
- :config
- (require 'spaceline-config)
- (spaceline-spacemacs-theme))
- ;; Change icons for modes in mode-line
- (use-package delight
- :ensure t)
- #+END_SRC
- * Mu4e
- #+BEGIN_SRC emacs-lisp
- ;; email client
- ;; (use-package mu4e
- ;; :ensure nil
- ;; :ensure-system-package mu
- ;; :config
- ;; (require 'mu4e-contrib)
- ;; (add-to-list 'mu4e-view-actions '("view in browser" . mu4e-action-view-in-browser))
- ;; (setq mail-user-agent 'mu4e-user-agent)
- ;; (defvaralias 'mu4e-compose-signature 'message-signature)
- ;; :delight
- ;; :custom
- ;; (setq
- ;; user-mail-address "lucasl2000@gmail.com"
- ;; user-full-name "Lucas Liseth")
- ;; (mu4e-attachment-dir "~/Downloads")
- ;; (mu4e-compose-signature-auto-include nil)
- ;; (mu4e-drafts-folder "/personal/Drafts")
- ;; (mu4e-get-mail-command "mbsync -a")
- ;; (mu4e-maildir "~/Maildir/personal")
- ;; (mu4e-refile-folder "/personal/Archive")
- ;; (mu4e-sent-folder "/personal/Sent Mail")
- ;; (mu4e-maildir-shortcuts
- ;; '(("/personal/Inbox/" . ?i)
- ;; ("/personal/[Gmail]//All Mail" . ?a)
- ;; ("/personal/[Gmail]/Deleted Items" . ?d)
- ;; ("/personal/[Gmail]/Drafts" . ?D)
- ;; ("/personal/[Gmail]/Important" . ?I)
- ;; ("/personal/[Gmail]/Sent Mail" . ?s)
- ;; ("/personal/[Gmail]//Starred" . ?S)))
- ;; (mu4e-trash-folder "/personal/Trash")
- ;; (mu4e-update-interval 300)
- ;; (mu4e-use-fancy-chars t)
- ;; (mu4e-view-show-addresses t)
- ;; (mu4e-view-show-images t))
- ;; (use-package mu4e-alert
- ;; :ensure t
- ;; :config
- ;; (mu4e-alert-enable-notifications)
- ;; (add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display)
- ;; (mu4e-alert-set-default-style 'libnotify)
- ;; (add-hook 'after-init-hook #'mu4e-alert-enable-notifications))
- #+END_SRC
- * Org
- #+BEGIN_SRC emacs-lisp
- (use-package org-bullets
- :ensure t
- :config
- (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))
- ;; Setting default org capture location
- (setq org-default-notes-file (concat org-directory "~/gtd/inbox.org")) ;
- ;; Adding capture templates to inbox and tickler file
- (setq org-capture-templates '(("t" "Todo [inbox]" entry
- (file+headline "~/gtd/inbox.org" "Tasks")
- "* TODO %i%?")
- ("T" "Tickler" entry
- (file+headline "~/gtd/tickler.org" "Tickler")
- "* %i%? \n %U")))
- ;; Adding files to agenda view (someday file won't show)
- (setq org-agenda-files '("~/gtd/inbox.org"
- "~/gtd/gtd.org"
- "~/gtd/tickler.org"))
- ;; Adding completion states
- (setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
- ;; Adding refile targets
- (setq org-refile-targets '(("~/gtd/gtd.org" :maxlevel . 3)
- ("~/gtd/someday.org" :level . 1)
- ("~/gtd/tickler.org" :maxlevel . 2)))
- ;; Adding recommended global keyboard shorcuts
- (global-set-key "\C-cl" 'org-store-link)
- (global-set-key "\C-ca" 'org-agenda)
- (global-set-key "\C-cc" 'org-capture)
- (global-set-key "\C-cb" 'org-switchb)
- #+END_SRC
- #+RESULTS:
- : org-switchb
- * PDF-Tools
- #+BEGIN_SRC emacs-lisp
- (use-package pdf-tools ;
- :ensure t
- :config
- (add-hook 'pdf-view-mode-hook (lambda()
- "disables these modes so pdf-tools can actually work"(linum-mode -1) (linum-relative-mode -1)
- (local-unset-key (kbd "k"))
- (local-set-key (kbd "k") 'pdf-view-scroll-down-or-previous-page)
- (local-set-key (kbd "j") 'pdf-view-scroll-up-or-next-page)))
- (pdf-tools-install))
- #+END_SRC
- * Projectile
- #+BEGIN_SRC emacs-lisp
- ;; Project support
- (use-package projectile
- :ensure t
- :diminish
- :config
- (projectile-global-mode)
- (projectile-mode +1)
- (define-key projectile-mode-map (kbd "s-p") 'projectile-command-map)
- (define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
- (setq projectile-completion-system 'ivy))
- ;; Adding ivy completion to projectile
- (use-package counsel-projectile
- :ensure t
- :config
- (counsel-projectile-mode))
- #+END_SRC
- * Pos-tip
- #+BEGIN_SRC emacs-lisp
- (use-package pos-tip ;
- :ensure t
- :config
- '(pos-tip-border-width 0))
- #+END_SRC
- * Rainbow Mode
- #+BEGIN_SRC emacs-lisp
- (use-package rainbow-mode ;
- :ensure t)
- #+END_SRC
- * Restart
- #+BEGIN_SRC emacs-lisp
- (use-package restart-emacs
- :ensure t)
- #+END_SRC
- * Smartparens
- #+BEGIN_SRC emacs-lisp
- (use-package smartparens
- :ensure t
- :diminish
- :config
- (require 'smartparens-config)
- (smartparens-global-strict-mode 1))
- #+END_SRC
- * Themes
- #+BEGIN_SRC emacs-lisp
- ;; Match the rest of the user interface
- ;; (use-package xresources-theme
- ;; :ensure t)
- ;; MMMMM solarized
- ;; (use-package solarized-theme
- ;; :ensure t
- ;; :init
- ;; (load-theme 'solarized-dark t)
- ;; :config
- ;; (setq x-underline-at-descent-line t))
- ;; Zenburn (really nice)
- (use-package zenburn-theme
- :ensure t
- :config
- (load-theme 'zenburn))
- ;; Spacemacs (tasty)
- ;; (use-package spacemacs-theme
- ;; :defer t
- ;; :init (load-theme 'spacemacs-dark t))
- ;; Beautiful nordic color scheme
- ;; (use-package nord-theme
- ;; :ensure t
- ;; :config
- ;; (add-to-list 'custom-theme-load-path (expand-file-name "~/.emacs.d/themes/"))
- ;; (setq nord-region-highlight "snowstorm")
- ;; (load-theme 'nord t))
- #+END_SRC
- * Treemacs
- #+BEGIN_SRC emacs-lisp
- ;; Atom-like file tree to emacs
- (use-package treemacs
- :ensure t
- :defer t
- :init
- (with-eval-after-load 'winum
- (define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
- :config
- (progn
- (setq treemacs-collapse-dirs (if (executable-find "python") 3 0)
- treemacs-deferred-git-apply-delay 0.5
- treemacs-file-event-delay 5000
- treemacs-file-follow-delay 0.2
- treemacs-follow-after-init t
- treemacs-follow-recenter-distance 0.1
- treemacs-goto-tag-strategy 'refetch-index
- treemacs-indentation 2
- treemacs-indentation-string " "
- treemacs-is-never-other-window nil
- treemacs-no-png-images nil
- treemacs-project-follow-cleanup nil
- treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory)
- treemacs-recenter-after-file-follow nil
- treemacs-recenter-after-tag-follow nil
- treemacs-show-hidden-files t
- treemacs-silent-filewatch nil
- treemacs-silent-refresh nil
- treemacs-sorting 'alphabetic-desc
- treemacs-space-between-root-nodes t
- treemacs-tag-follow-cleanup t
- treemacs-tag-follow-delay 1.5
- treemacs-width 30)
- ;; The default width and height of the icons is 22 pixels. If you are
- ;; using a Hi-DPI display, uncomment this to double the icon size.
- ;;(treemacs-resize-icons 44)
- (treemacs-follow-mode t)
- (treemacs-filewatch-mode t)
- (treemacs-fringe-indicator-mode t)
- (pcase (cons (not (null (executable-find "git")))
- (not (null (executable-find "python3"))))
- (`(t . _)
- (treemacs-git-mode 'simple))))
- (add-to-list 'treemacs-pre-file-insert-predicates #'treemacs-is-file-git-ignored?)
- :bind
- (:map global-map
- ("M-0" . treemacs-select-window)
- ("C-x t 1" . treemacs-delete-other-windows)
- ("C-x t t" . treemacs)
- ("C-x t B" . treemacs-bookmark)
- ("C-x t C-t" . treemacs-find-file)
- ("C-x t M-t" . treemacs-find-tag)))
- ;; Adding evil keybindings to treemacs
- (use-package treemacs-evil
- :after treemacs evil
- :ensure t)
- ;; Adding projectile integration to treemacs
- (use-package treemacs-projectile
- :after treemacs projectile
- :ensure t)
- #+END_SRC
- * Undo-tree
- #+BEGIN_SRC emacs-lisp
- ;; Allows visualization of undo commands
- (use-package undo-tree
- :defer 2
- :init
- (global-undo-tree-mode))
- #+END_SRC
- * Which-key
- #+BEGIN_SRC emacs-lisp
- ;; Brings up a help menu with suggested actions
- (use-package which-key
- :ensure t
- :diminish
- :config
- (which-key-mode))
- #+END_SRC
- * Writeroom-mode
- #+BEGIN_SRC emacs-lisp
- ;; Distraction free writing
- (use-package writeroom-mode
- :ensure t)
- #+END_SRC
- * Yasnippet
- #+BEGIN_SRC emacs-lisp
- (use-package yasnippet ;
- :ensure t
- :config
- (yas-global-mode 1))
- ;;
- ;; Adding premade snippets
- (use-package yasnippet-snippets
- :ensure t)
- #+END_SRC
- * Miscellaneous
- #+BEGIN_SRC emacs-lisp
- (with-eval-after-load 'company
- (define-key company-active-map (kbd "<return>") 'company-complete-selection)
- (define-key company-active-map (kbd "RET") 'company-complete-selection))
- ;; Load gtd and agenda and set it to the first to the first workspace
- (add-hook 'after-init-hook (find-file "~/gtd/gtd.org"))
- (add-hook 'after-init-hook 'org-agenda-list)
- #+END_SRC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement