From 77fa77466b7978d891520e96eab784a8a789e561 Mon Sep 17 00:00:00 2001 From: opFez Date: Mon, 7 Dec 2020 22:09:35 +0100 Subject: [PATCH] initial --- functions.el | 13 +++++++++ init.el | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++ packages.el | 17 ++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 functions.el create mode 100644 init.el create mode 100644 packages.el diff --git a/functions.el b/functions.el new file mode 100644 index 0000000..79a1015 --- /dev/null +++ b/functions.el @@ -0,0 +1,13 @@ +(defun copy-whole-line () + (interactive) + (save-excursion + (kill-new + (buffer-substring + (point-at-bol) + (point-at-eol))))) +(global-set-key (kbd "C-c w l") 'copy-whole-line) + +(defun kill-all-buffers () + (interactive) + (mapc 'kill-buffer (buffer-list))) +(global-set-key (kbd "C-c k k") 'kill-all-buffers) diff --git a/init.el b/init.el new file mode 100644 index 0000000..71cc1e6 --- /dev/null +++ b/init.el @@ -0,0 +1,76 @@ +;; Packages +(load "~/.emacs.d/packages.el") + +;; Convenient functions +(load "~/.emacs.d/functions.el") + +;; Remove useless stuff +(menu-bar-mode 0) +(tool-bar-mode 0) +(scroll-bar-mode 0) + +;; Appearance +(set-default-font "ttyp0 12") +; theme set in packages.el +(global-linum-mode) +(blink-cursor-mode nil) +(when window-system (global-hl-line-mode t)) +(show-paren-mode t) + +;; Mode line +(line-number-mode t) +(column-number-mode t) +(setq display-time-24hr-format t) +(display-time-mode t) + +;; Instead of leaving backup files everywhere, have them in this dir +(setq backup-directory-alist `(("." . "~/.emacs.d/backups"))) + +;; Y or N instead of Yes or No +(defalias 'yes-or-no-p 'y-or-n-p) + +;; Smaller skips when cursor reaches end of screen +(setq scroll-conservatively 100) + +;; Disable bell +(setq ring-bell-function 'ignore) + +;; Subword for camelCase words +(global-subword-mode t) + +;; Electric pair mode +(setq electric-pair-pairs '((?\( . ?\)) + (?\[ . ?\]) + (?\{ . ?\}) + (?\" . ?\") + )) +(electric-pair-mode t) + +;; windmove +(global-set-key (kbd "C-:") 'windmove-left) +(global-set-key (kbd "C-|") 'windmove-right) +(global-set-key (kbd "C-{") 'windmove-up) +(global-set-key (kbd "C-\"") 'windmove-down) + +;; Terminal +(defvar term-shell "/bin/zsh") +(defadvice ansi-term (before force-bash) + (interactive (list term-shell))) +(ad-activate 'ansi-term) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(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. + '(package-selected-packages (quote (almost-mono-themes use-package)))) +(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. + ) +;; diff --git a/packages.el b/packages.el new file mode 100644 index 0000000..e510c33 --- /dev/null +++ b/packages.el @@ -0,0 +1,17 @@ +(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3") + +;; Package +(require 'package) +(setq package-archives '(("gnu" . "http://mirrors.163.com/elpa/gnu/") + ("melpa" . "https://melpa.org/packages/"))) +(package-initialize) + +;; use-package +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(use-package almost-mono-themes + :ensure t + :init + (load-theme 'almost-mono-black t))