My own configuration files
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.
 
 
 
 

147 lines
4.2 KiB

;;;; init.el -*- lexical-binding: t; -*-
(require 'package)
;;; either the stable version:
(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)
;; 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)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)
(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.
'(custom-enabled-themes (quote (mustang)))
'(custom-safe-themes
(quote
("6c0a087a4f49c04d4002393ffd149672f70e4ab38d69bbe8b39059b61682b61c" default)))
'(inhibit-startup-screen t)
'(package-selected-packages
(quote
(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 mustang-theme cider))))
(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)
(add-to-list 'load-path "~/.emacs.d/evil")
(require 'evil)
(evil-mode 1)
(require 'goto-last-change)
(show-paren-mode 1)
(require 'whitespace)
(setq whitespace-style '(face empty tabs lines-tail trailing))
(global-whitespace-mode t)
(require 'fill-column-indicator)
(setq-default fill-column 80)
(define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1)))
(global-fci-mode 1)
(require 'powerline)
(powerline-center-evil-theme)
(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)
; 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)
; scala support
(use-package scala-mode
:interpreter
("scala" . scala-mode))
; rust support
; 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
)
; answer questions with 'y' instead of full 'yes'
(defalias 'yes-or-no-p 'y-or-n-p)