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.
 
 
 
 

184 lines
5.1 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)
(add-to-list
'package-archives
'("org" . "https://orgmode.org/elpa/")
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)
; install evil
(use-package evil
:ensure t
:config
(evil-mode 1))
; 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)
; 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
; (use-package monokai-theme
; :ensure t)
(use-package nord-theme
: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 (nord)))
'(custom-safe-themes
(quote
("bd7b7c5df1174796deefce5debc2d976b264585d51852c962362be83932873d9" "039eb505cec29b4521ce5ecf5abf523492005f0c65d0640f62e53e2d3068b393" "6c0a087a4f49c04d4002393ffd149672f70e4ab38d69bbe8b39059b61682b61c" default)))
'(inhibit-startup-screen t)
'(org-agenda-files (quote ("~/Documents/index.org")))
'(package-selected-packages
(quote
(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))))
(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)
(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
"o" 'org-capture
"O" 'org-agenda
)
; answer questions with 'y' instead of full 'yes'
(defalias 'yes-or-no-p 'y-or-n-p)