Created
July 5, 2021 19:12
-
-
Save mbrc12/821dc2e9d31b6af0805dfbbffa9649ec to your computer and use it in GitHub Desktop.
init.el
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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. | |
'(default ((t (:inherit nil :extend nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :foundry "outline" :family "JetBrains Mono"))))) | |
(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-safe-themes | |
'("4d4ada02d1e34ff016e4a09f2b5f64196e66fd5f85883d2203ec60ab31f1fee7" "c9381ad96da61654fa28902038562ed49d6fd6bac17164c3e3ffa56d2e24a2a2" "861871bcf7c24faf9fa0aa159a80837ff58749c91618050d9058a09707f75b5f" "adbc9e9496bd982be90b79b5b32c78d831c65eb54b3badd6cc42358fa3f367fd" "f96aaa44aa8416a044f95a185d88b7823e4ffa5a62fe21f38b2b00c8ed75f34d" "729ddf899d07810d66fb6bd048b1cbef228efbcee0dca69d3d6cd0efcff428e1" default))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq package-enable-at-startup nil) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq inhibit-splash-screen t) | |
(tool-bar-mode -1) | |
(toggle-scroll-bar -1) | |
(add-to-list 'default-frame-alist | |
'(vertical-scroll-bars . nil)) | |
(menu-bar-mode -1) | |
(show-paren-mode 1) | |
(setq visible-bell t) | |
(setq scroll-step 1) | |
(setq-default tab-width 4) | |
(setq indent-tabs-mode nil) | |
(add-to-list 'default-frame-alist | |
'(fullscreen . maximized)) | |
(add-hook 'after-init-hook 'global-display-line-numbers-mode) | |
(global-hl-line-mode 1) | |
;; Do not litter this init.el | |
(setq custom-file "~/.emacs.d/custom.el") | |
(load custom-file) | |
;; (load-file "~/.emacs.d/move-border.el") | |
(setq split-width-threshold 1) | |
(setq split-height-threshold nil) | |
;; Wrapping enabled | |
(setq-default truncate-lines 1) | |
(defun commenter () | |
;; Comments a selected line, see binding for ";" in evil package usage. | |
(interactive) | |
(comment-or-uncomment-region | |
(line-beginning-position) | |
(line-end-position)) | |
(forward-line)) | |
(defvar bootstrap-version) | |
(let ((bootstrap-file | |
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) | |
(bootstrap-version 5)) | |
(unless (file-exists-p bootstrap-file) | |
(with-current-buffer | |
(url-retrieve-synchronously | |
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" | |
'silent 'inhibit-cookies) | |
(goto-char (point-max)) | |
(eval-print-last-sexp))) | |
(load bootstrap-file nil 'nomessage)) | |
(straight-use-package 'use-package) | |
(use-package benchmark-init | |
:straight t | |
:config | |
;; To disable collection of benchmark data after init is done. | |
(add-hook 'after-init-hook 'benchmark-init/deactivate)) | |
(use-package evil | |
:straight t | |
:init | |
(setq evil-want-keybinding nil) | |
:config | |
(evil-mode 1) | |
(setq evil-undo-system 'undo-fu) | |
(define-key evil-normal-state-map (kbd "-ec") '(lambda () | |
(interactive) | |
(find-file "~/.emacs.d/init.el"))) | |
(define-key evil-normal-state-map (kbd "-rl") '(lambda () | |
(interactive) | |
(load-file buffer-file-name))) | |
;;(define-key evil-normal-state-map (kbd "-pp") 'projectile-switch-project) | |
;; (define-key evil-normal-state-map (kbd "-tt") 'treemacs) | |
;; (define-key evil-normal-state-map (kbd "-TT") 'treemacs-projectile) | |
(define-key evil-normal-state-map (kbd "M-q") 'delete-other-windows) | |
(define-key evil-normal-state-map (kbd "M-w") 'delete-window) | |
(define-key evil-normal-state-map (kbd ";") 'commenter) | |
(define-key evil-visual-state-map (kbd ";") 'comment-or-uncomment-region) | |
;; (define-key evil-normal-state-map (kbd "]]") 'move-border-right) | |
;; (define-key evil-normal-state-map (kbd "[[") 'move-border-left) | |
(define-key evil-normal-state-map (kbd "--h") 'split-window-horizontally) | |
(define-key evil-normal-state-map (kbd "--v") 'split-window-vertically) | |
(define-key evil-visual-state-map (kbd "-y") 'clipboard-kill-ring-save) | |
(define-key evil-normal-state-map (kbd "-p") 'clipboard-yank) | |
(evil-ex-define-cmd "q" 'kill-this-buffer) | |
(evil-ex-define-cmd "quit" 'evil-quit)) | |
(use-package evil-collection | |
:straight t) | |
(use-package undo-fu | |
:straight t | |
:config | |
;; (global-undo-tree-mode -1) | |
(define-key evil-normal-state-map "u" 'undo-fu-only-undo) | |
(define-key evil-normal-state-map "\C-r" 'undo-fu-only-redo)) | |
(use-package neotree | |
:straight t | |
:config | |
(define-key evil-normal-state-map (kbd "-d") 'neotree-toggle) | |
(add-hook 'neotree-mode-hook | |
(lambda () | |
(define-key evil-normal-state-local-map (kbd "TAB") 'neotree-enter) | |
(define-key evil-normal-state-local-map (kbd "SPC") 'neotree-quick-look) | |
(define-key evil-normal-state-local-map (kbd "q") 'neotree-hide) | |
(define-key evil-normal-state-local-map (kbd "RET") 'neotree-enter) | |
(define-key evil-normal-state-local-map (kbd "g") 'neotree-refresh) | |
(define-key evil-normal-state-local-map (kbd "n") 'neotree-next-line) | |
(define-key evil-normal-state-local-map (kbd "p") 'neotree-previous-line) | |
(define-key evil-normal-state-local-map (kbd "A") 'neotree-stretch-toggle) | |
(define-key evil-normal-state-local-map (kbd "H") 'neotree-hidden-file-toggle)))) | |
(use-package ivy | |
:straight t | |
:config | |
(ivy-mode 1)) | |
(use-package telephone-line | |
:straight t | |
:config | |
(setq telephone-line-primary-left-separator 'telephone-line-identity-left | |
telephone-line-secondary-left-separator 'telephone-line-identity-hollow-left | |
telephone-line-primary-right-separator 'telephone-line-identity-left | |
telephone-line-secondary-right-separator 'telephone-line-identity-hollow-right) | |
(setq telephone-line-height 35) | |
(setq telephone-line-lhs | |
'((evil . (telephone-line-evil-tag-segment)) | |
(accent . (telephone-line-vc-segment | |
telephone-line-erc-modified-channels-segment | |
telephone-line-process-segment)) | |
(nil . (telephone-line-buffer-segment)))) | |
(setq telephone-line-rhs | |
'((nil . (telephone-line-misc-info-segment | |
telephone-line-minor-mode-segment)) | |
(accent . (telephone-line-major-mode-segment)) | |
(evil . (telephone-line-airline-position-segment)))) | |
(telephone-line-mode 1)) | |
(use-package company | |
:straight t | |
:init | |
(setq company-idle-delay 0.5) | |
(setq company-minimum-prefix-length 2) | |
:config | |
(add-to-list 'company-backends 'company-dabbrev t) | |
:hook | |
((after-init . global-company-mode))) | |
(use-package lsp-mode | |
:straight t | |
;; :init | |
;; (setq lsp-pyls-server-command "/home/mbrc/Software/Anaconda/anaconda3/bin/pyls") | |
:config | |
(setq gc-cons-threshold 100000000) | |
:commands | |
(lsp lsp-deferred) | |
:hook | |
((rust-mode . lsp-deferred) | |
(python-mode . lsp-deferred))) | |
(use-package lsp-ivy | |
:straight t | |
:commands lsp-ivy-workspace-symbol) | |
(use-package lsp-ui | |
;; :straight t | |
:commands | |
lsp-ui-mode | |
:config | |
(lsp-ui-peek-enable t) | |
(lsp-ui-doc-enable t) | |
(setq lsp-ui-sideline-show-diagnostics t) | |
(setq lsp-ui-sideline-show-hover t) | |
(setq lsp-ui-sideline-show-symbol t)) | |
(use-package company-lsp | |
:straight t) | |
(use-package yascroll | |
:straight t | |
:config | |
(global-yascroll-bar-mode 1)) | |
(use-package gruvbox-theme | |
:straight t | |
:config | |
(load-theme 'gruvbox-dark-hard t)) | |
(use-package kaolin-themes | |
:straight t) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(setq light-theme nil) | |
(setq dark-theme nil) | |
(setq current-theme-mode 'light) | |
(defun theme-set () | |
(interactive) | |
(if (eq current-theme-mode 'light) | |
(load-theme light-theme t) | |
(load-theme dark-theme t))) | |
(defun hour-based-theme () | |
(interactive) | |
(let ((hr (caddr (decode-time)))) | |
(if (< hr 17) | |
(setq current-theme-mode 'light) | |
(setq current-theme-mode 'dark))) | |
(theme-set)) | |
(defun light() | |
(interactive) | |
(setq current-theme-mode 'light) | |
(theme-set)) | |
(defun dark() | |
(interactive) | |
(setq current-theme-mode 'dark) | |
(theme-set)) | |
(add-hook 'after-init-hook (lambda () | |
(setq light-theme 'kaolin-breeze) | |
(setq dark-theme 'kaolin-temple) | |
(hour-based-theme))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment