You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
185 lines
5.1 KiB
185 lines
5.1 KiB
8 years ago
|
;;;; init.el -*- lexical-binding: t; -*-
|
||
|
|
||
8 years ago
|
(require 'package)
|
||
8 years ago
|
|
||
8 years ago
|
;;; either the stable version:
|
||
6 years ago
|
(add-to-list
|
||
|
'package-archives
|
||
|
;; '("melpa" . "http://stable.melpa.org/packages/") ; many packages won't show if using stable
|
||
|
'("melpa" . "http://melpa.milkbox.net/packages/")
|
||
|
t)
|
||
5 years ago
|
(add-to-list
|
||
|
'package-archives
|
||
|
'("org" . "https://orgmode.org/elpa/")
|
||
|
t)
|
||
8 years ago
|
|
||
|
;; Added by Package.el. This must come before configurations of
|
||
|
;; installed packages. Don't delete this line. If you don't want it,
|
||
|
;; just comment it out by adding a semicolon to the start of the line.
|
||
|
;; You may delete these explanatory comments.
|
||
|
(package-initialize)
|
||
|
|
||
7 years ago
|
(unless (package-installed-p 'use-package)
|
||
|
(package-refresh-contents)
|
||
|
(package-install 'use-package))
|
||
|
|
||
|
(require 'use-package)
|
||
|
(setq use-package-always-ensure t)
|
||
|
|
||
6 years ago
|
; install evil
|
||
|
(use-package evil
|
||
|
:ensure t
|
||
|
:config
|
||
|
(evil-mode 1))
|
||
|
|
||
5 years ago
|
; Org-mode
|
||
|
(use-package org
|
||
|
:ensure t)
|
||
|
(global-set-key "\C-cl" 'org-store-link)
|
||
|
(global-set-key "\C-ca" 'org-agenda)
|
||
|
(global-set-key "\C-cb" 'org-iswtichb)
|
||
|
|
||
|
; Markdown mode
|
||
|
(use-package markdown-mode
|
||
|
:ensure t)
|
||
|
|
||
6 years ago
|
; install goto last change (opens the file in the last position)
|
||
|
(use-package goto-last-change
|
||
|
:ensure t)
|
||
|
|
||
|
; install fill-column-indicador: right side gutter
|
||
|
(use-package fill-column-indicator
|
||
|
:ensure t)
|
||
|
|
||
|
; install powerline
|
||
|
(use-package powerline
|
||
|
:ensure t
|
||
|
:config (powerline-center-evil-theme))
|
||
|
|
||
|
; rust mode
|
||
|
(use-package rust-mode
|
||
|
:ensure t)
|
||
|
|
||
|
; colorscheme
|
||
5 years ago
|
; (use-package monokai-theme
|
||
|
; :ensure t)
|
||
|
(use-package nord-theme
|
||
|
:ensure t)
|
||
6 years ago
|
|
||
8 years ago
|
(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.
|
||
5 years ago
|
'(custom-enabled-themes (quote (nord)))
|
||
8 years ago
|
'(custom-safe-themes
|
||
|
(quote
|
||
5 years ago
|
("bd7b7c5df1174796deefce5debc2d976b264585d51852c962362be83932873d9" "039eb505cec29b4521ce5ecf5abf523492005f0c65d0640f62e53e2d3068b393" "6c0a087a4f49c04d4002393ffd149672f70e4ab38d69bbe8b39059b61682b61c" default)))
|
||
8 years ago
|
'(inhibit-startup-screen t)
|
||
5 years ago
|
'(org-agenda-files (quote ("~/Documents/index.org")))
|
||
8 years ago
|
'(package-selected-packages
|
||
|
(quote
|
||
5 years ago
|
(markdown-mode org-evil org-link-minor-mode rust-mode evil-quickscope evil-tabs ## scala-mode evil-leader editorconfig diff-hl neotree helm-ag helm-projectile projectile helm hlinum fill-column-indicator evil monokai-theme cider))))
|
||
8 years ago
|
(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.
|
||
|
)
|
||
|
|
||
|
(menu-bar-mode 0)
|
||
|
(tool-bar-mode 0)
|
||
|
|
||
|
(show-paren-mode 1)
|
||
|
|
||
|
(require 'whitespace)
|
||
|
(setq whitespace-style '(face empty tabs lines-tail trailing))
|
||
|
(global-whitespace-mode t)
|
||
|
|
||
|
(setq-default fill-column 80)
|
||
|
(define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1)))
|
||
|
(global-fci-mode 1)
|
||
8 years ago
|
|
||
|
(define-key evil-normal-state-map (kbd "C-w <down>") 'evil-window-down)
|
||
|
(define-key evil-normal-state-map (kbd "C-w <up>") 'evil-window-up)
|
||
|
(define-key evil-normal-state-map (kbd "C-w <right>") 'evil-window-right)
|
||
|
(define-key evil-normal-state-map (kbd "C-w <left>") 'evil-window-left)
|
||
|
(define-key evil-normal-state-map (kbd "-") 'find-file)
|
||
7 years ago
|
|
||
|
; most of this stuff was taken from https://brainlessdeveloper.com/2017/12/27/making-emacs-work-like-my-vim-setup/
|
||
|
; and https://github.com/brainlessdeveloper/emacs.d
|
||
|
|
||
|
|
||
|
; line numbers
|
||
|
(global-linum-mode 1)
|
||
|
(defun configure-linum-colors ()
|
||
|
(set-face-foreground 'linum "#555555"))
|
||
|
(configure-linum-colors)
|
||
|
(setq linum-format " %4d ")
|
||
|
|
||
|
; highlights the current line
|
||
|
(use-package hlinum
|
||
|
:ensure t)
|
||
|
(set-face-foreground 'linum-highlight-face "white")
|
||
|
(set-face-background 'linum-highlight-face nil)
|
||
|
(hlinum-activate)
|
||
|
|
||
|
; display line and column in the statusbar
|
||
|
(line-number-mode 1)
|
||
|
(column-number-mode 1)
|
||
|
|
||
|
; don't show startup messages
|
||
|
(setq inhibit-startup-message t)
|
||
|
(setq initial-scratch-message nil)
|
||
|
|
||
|
; auto-pairs
|
||
|
(electric-pair-mode 1)
|
||
|
|
||
7 years ago
|
; scala support
|
||
|
(use-package scala-mode
|
||
|
:interpreter
|
||
|
("scala" . scala-mode))
|
||
7 years ago
|
|
||
6 years ago
|
; rust support
|
||
|
|
||
7 years ago
|
; neotree is a nerdtree like
|
||
|
(use-package neotree :ensure t)
|
||
|
|
||
|
(evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter)
|
||
|
(evil-define-key 'normal neotree-mode-map (kbd "SPC") 'neotree-quick-look)
|
||
|
(evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide)
|
||
|
(evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter)
|
||
|
|
||
|
; git gutters
|
||
|
(use-package diff-hl
|
||
|
:ensure t
|
||
|
:init
|
||
|
(setq diff-hl-side 'right))
|
||
|
(global-diff-hl-mode 1)
|
||
|
(diff-hl-margin-mode 1)
|
||
|
(diff-hl-flydiff-mode 1)
|
||
|
|
||
|
; install editorconfig
|
||
|
(use-package editorconfig
|
||
|
:ensure t
|
||
|
:config
|
||
|
(editorconfig-mode 1))
|
||
|
|
||
|
; install evil-leader and set it as space
|
||
|
(use-package evil-leader
|
||
|
:ensure t
|
||
|
:config
|
||
|
(global-evil-leader-mode))
|
||
|
(evil-leader/set-leader "<SPC>")
|
||
|
|
||
|
(evil-leader/set-key
|
||
|
"q" 'kill-buffer-and-window
|
||
|
"w" 'save-buffer
|
||
|
"t" 'neotree-toggle
|
||
5 years ago
|
"o" 'org-capture
|
||
|
"O" 'org-agenda
|
||
7 years ago
|
)
|
||
|
|
||
|
; answer questions with 'y' instead of full 'yes'
|
||
|
(defalias 'yes-or-no-p 'y-or-n-p)
|