diff options
author | Baitinq <30861839+Baitinq@users.noreply.github.com> | 2022-07-22 01:36:06 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-07-22 01:36:06 +0200 |
commit | bf40900c2747c7b7c62ac0f4a1e3db856517894c (patch) | |
tree | ada349c778f9aac3cce3aa3ba5602e7ab0d9f4fb /dotfiles/.emacs | |
parent | Disable touchpad if usb mouse connected (diff) | |
download | nixos-config-bf40900c2747c7b7c62ac0f4a1e3db856517894c.tar.gz nixos-config-bf40900c2747c7b7c62ac0f4a1e3db856517894c.tar.bz2 nixos-config-bf40900c2747c7b7c62ac0f4a1e3db856517894c.zip |
Make emacs portable
It now autoinstalls packages and just changes the font if its availeable
Diffstat (limited to 'dotfiles/.emacs')
-rw-r--r-- | dotfiles/.emacs | 50 |
1 files changed, 36 insertions, 14 deletions
diff --git a/dotfiles/.emacs b/dotfiles/.emacs index 65cf70b..e7db1bd 100644 --- a/dotfiles/.emacs +++ b/dotfiles/.emacs @@ -1,7 +1,16 @@ -(eval-when-compile - (require 'use-package)) +;; load package manager, add the Melpa package registry +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(package-initialize) + +;; bootstrap use-package +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) +(require 'use-package) (use-package evil + :ensure t :init (setq evil-want-integration t) ;; This is optional since it's already set to t by default. (setq evil-want-keybinding nil) @@ -10,29 +19,34 @@ (use-package evil-collection :after evil + :ensure t :config (evil-collection-init)) -(use-package doom-themes) +(use-package doom-themes + :ensure t ) (setq doom-themes-enable-bold t doom-themes-enable-italic t) (load-theme 'doom-one t) -(set-face-attribute 'default nil - :font "Inconsolata LGC Nerd Font 11" - :weight 'medium) +(cond + ((find-font (font-spec :name "Inconsolata LGC Nerd Font")) + (set-face-attribute 'default nil + :font "Inconsolata LGC Nerd Font 11" + :weight 'medium) + ;; Needed for emacsclient or fonts will be smaller than expected + (add-to-list 'default-frame-alist '(font . "Inconsolata LGC Nerd Font 11"))) +) (setq-default line-spacing 0.10) -;; Needed for emacsclient or fonts will be smaller than expected -(add-to-list 'default-frame-alist '(font . "Inconsolata LGC Nerd Font 11")) - ;; Disable toolbar, menubar and scrollbar (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) (use-package doom-modeline + :ensure t :init (doom-modeline-mode 1)) ;; One line scrolling @@ -44,6 +58,7 @@ (global-visual-line-mode t) (use-package dashboard + :ensure t :init (setq dashboard-banner-logo-title "Welcome to Emacs Dashboard") (setq dashboard-center-content nil) @@ -68,20 +83,27 @@ (get-buffer-create "*dashboard*")))) (use-package direnv + :ensure t :config (direnv-mode)) (use-package nix-mode - :mode "\\.nix\\'") + :ensure t + :mode "\\.nix\\'") -(use-package haskell-mode) +(use-package haskell-mode + :ensure t ) -(use-package typescript-mode) +(use-package typescript-mode + :ensure t ) -(use-package jq-mode) +(use-package jq-mode + :ensure t ) (use-package lsp-mode + :ensure t :hook ((haskell-mode . lsp-deferred)) :commands (lsp lsp-deferred)) -(use-package lsp-haskell) +(use-package lsp-haskell + :ensure t ) |