some more work on emacs init.el

This commit is contained in:
Geir Okkenhaug Jerstad 2025-05-28 10:03:19 +02:00
parent a5d571fc75
commit 1582fae861
2 changed files with 80 additions and 16 deletions

View file

@ -16,14 +16,7 @@ This will generate the `~/.emacs.d/init.el` file with the configuration.
* Prep
** Copilot Authentication
To use GitHub Copilot, you need to authenticate with your GitHub account. This is done by running the following command in Emacs:
after installing the copilot package:
Try to trigger the GitHub OAuth flow from within Emacs:
#+BEGIN_SRC emacs-lisp :eval yes
(call-interactively 'copilot-auth)
#+END_SRC
* Configuration
@ -65,16 +58,32 @@ Here we set up the UI to our liking. We disable the menu bar, tool bar, and scro
(set-face-attribute 'default nil :height 140)
#+END_SRC
Set up doom modeline, which is a nice status line for Emacs. We set it up to show the current buffer name and the current line number.
#+BEGIN_SRC emacs-lisp
;; install doom-modeline if not already installed
(unless (package-installed-p 'doom-modeline)
(package-refresh-contents)
(package-install 'doom-modeline))
(require 'doom-modeline)
;; enable doom-modeline
(doom-modeline-mode 1)
;; set up doom-modeline to show the current buffer name and line number
(setq doom-modeline-buffer-file-name-style 'truncate-with-project)
;; Doom modline, all-the-icons and doom-theme
(use-package doom-modeline
:ensure t
:init (doom-modeline-mode 1)
:custom ((doom-modeline-height 15)))
(setq doom-modeline-icon t)
(use-package all-the-icons)
(use-package doom-themes
:init (load-theme 'doom-monokai-pro t))
#+END_SRC
Set up all-the-icons, which provides icons for various file types and modes in Emacs. This enhances the visual appearance of the UI.
install all-the-icons if not already installed with 'M-x package-install all-the-icons'
#+BEGIN_SRC emacs-lisp
(use-package all-the-icons
:if (display-graphic-p) ;; only load in GUI Emacs
:ensure t
:init
(unless (package-installed-p 'all-the-icons)
(package-refresh-contents)
(package-install 'all-the-icons))
:config
(all-the-icons-setup))
#+END_SRC
** Set up package management
@ -157,6 +166,15 @@ Here we install from MELPA, enable it in all prog-modes and bind keys for comple
(define-key copilot-completion-map (kbd "<tab>") #'copilot-accept-completion)
#+END_SRC
** Copilot Authentication
To use GitHub Copilot, you need to authenticate with your GitHub account. This is done by running the following command in Emacs:
after installing the copilot package:
Try to trigger the GitHub OAuth flow from within Emacs:
#+BEGIN_SRC emacs-lisp :eval yes
(call-interactively 'copilot-auth)
#+END_SRC
** Language support
Here we install and configure support for various programming languages. We use the `use-package` macro to ensure that the packages are installed and configured correctly.