myhome/.emacs.d/init.el
Marcin Woźniak d5198c8a12 Added
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
2020-08-29 16:40:44 +02:00

141 lines
2.9 KiB
EmacsLisp

; Packages
;; package archives
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
'(
("ELPA" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("ORG" . "https://orgmode.org/elpa/")
)
)
(package-initialize)
;; install use-package
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package)
)
;; Set path to store "custom-set"
(setq custom-file "~/.emacs.d/emacs-custom.el")
;; Enable awesome-tab-mode
(add-to-list 'load-path (expand-file-name "~/.emacs.d/plugins"))
(require 'awesome-tab)
(awesome-tab-mode t)
(use-package awesome-tab
:load-path "~/.emacs.d/plugins"
:config
(awesome-tab-mode t))
(awesome-tab-mode t)
(global-set-key (kbd "C-x j") 'awesome-tab-backward-tab)
(global-set-key (kbd "C-x k") 'awesome-tab-forward-tab)
;; Theme
(use-package dracula-theme
:ensure t
:config
(load-theme 'dracula t))
;; Magit
(use-package magit
:ensure t
:config
)
(global-set-key (kbd "C-x g") 'magit-status)
;; Markdown-mode
(use-package markdown-mode
:ensure t
:config
)
;; Livedown
;;; sudo npm install -g livedown
;;; (add-to-list 'load-path (expand-file-name "~/.emacs.d/emacs-livedown"))
(require 'livedown)
(custom-set-variables
'(livedown-autostart nil) ; automatically open preview when opening markdown files
'(livedown-open t) ; automatically open the browser window
'(livedown-port 1337) ; port for livedown server
'(livedown-browser nil)) ; browser to use
(global-set-key (kbd "C-M-m") 'livedown-preview)
;;; --- Look & Feel ---
;; no toolbar:
(tool-bar-mode -1)
;; line numbers:
(global-display-line-numbers-mode 1)
;; scrolling:
(setq scroll-conservatively 100)
;; no "bell" (audible notification):
(setq ring-bell-function 'ignore)
;; highlight:
(global-hl-line-mode 1)
;; auto reloading (reverting) buffers
(global-auto-revert-mode 1)
;; disable lock files:
(setq create-lockfiles nil)
;; disable autosave:
(setq auto-save-default nil)
;; disable backups:
(setq make-backup-files nil)
;; Pass "y or n" instead of "yes or no"
(defalias 'yes-or-no-p 'y-or-n-p)
;; Highlight parens
(show-paren-mode 1)
;; Candy
(global-prettify-symbols-mode 1)
;; Modeline
(column-number-mode 1)
(size-indication-mode 1)
;; Horizontal splitting
(defun split-and-follow-horizontally ()
(interactive)
(split-window-below)
(balance-windows)
(other-window 1)
)
(global-set-key (kbd "C-x 2") 'split-and-follow-horizontally)
;; Vertical splitting
(defun split-and-follow-vertically ()
(interactive)
(split-window-right)
(balance-windows)
(other-window 1)
)
(global-set-key (kbd "C-x 3") 'split-and-follow-vertically)
;; Kill & remove split
(defun kill-and-remove-split ()
"Kill and remove split."
(interactive)
(kill-buffer)
(delete-window)
(balance-windows)
(other-window 1)
)
(global-set-key (kbd "C-x x") 'kill-and-remove-split)