summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOskar <[email protected]>2024-11-02 16:45:04 +0100
committerOskar <[email protected]>2024-11-02 16:45:04 +0100
commit31d6090b4cbbef603ef1b76a4ce9fa33ec44f280 (patch)
treea7d85ce30d90d21034ed47e5cd6267c067e8e592
parente15ea0314ec24b96a926e7f0db69f3963438fbce (diff)
updated
-rw-r--r--.gitignore0
-rw-r--r--emacs33
-rw-r--r--emacs.el75
3 files changed, 75 insertions, 33 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.gitignore
diff --git a/emacs b/emacs
deleted file mode 100644
index 4b400ee..0000000
--- a/emacs
+++ /dev/null
@@ -1,33 +0,0 @@
-
-(setq inhibit-startup-message t)
-(setq visible-bell t)
-
-;; The menu bar and its configurations
-(menu-bar-mode 1) ;; This one is very useful to leave on actually
-(tool-bar-mode -1) ;; No tool bar
-(scroll-bar-mode -1) ;; No scroll bars
-(global-display-line-numbers-mode 1) ;; Show line numbers
-(column-number-mode 1) ;; Show column numbers as well
-(load-theme 'adwaita t) ;; My preffered themes
- ;; 'wombat' for dark, 'adwaita' for light
-(set-face-attribute 'default nil :height 125) ;; Text size
-;;(setq make-backup-files nil) ;; Prevent backup file from cluttering
-(setq lock-file-name-transforms
- '(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs.d/aux/\\1" t)))
-(setq auto-save-file-name-transforms
- '(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs.d/aux/\\1" t)))
-(setq backup-directory-alist
- '((".*" . "~/.emacs.d/aux/")))
-(display-battery-mode 1)
-
-;; From how i understand it, these variables are supposed to make tab and indentation be 4 in width?
-(setq-default tab-width 4) ; Tab width (duh)
-(setq c-basic-offset 4) ; Tab width (but for C?)
-(find-file "/home/oskar/doc/how2emacs.txt")
-(switch-to-buffer "*scratch*")
-
-(defun lmid ()
- ;;Move cursor to the middle of the current line
- (interactive)
- (let ((line-length (- (line-end-position) (line-beginning-position))))
- (goto-char (+ (line-beginning-position) (/ line-length 2)))))
diff --git a/emacs.el b/emacs.el
new file mode 100644
index 0000000..d8579d5
--- /dev/null
+++ b/emacs.el
@@ -0,0 +1,75 @@
+(setq initial-scratch-message "")
+(setq inhibit-startup-message t)
+(setq visible-bell t)
+
+;; The menu bar and its configurations
+(menu-bar-mode 1)
+(tool-bar-mode -1)
+(scroll-bar-mode -1)
+(global-display-line-numbers-mode 1)
+(column-number-mode 1)
+(load-theme 'adwaita t) ;; 'wombat' for dark, 'adwaita' for light
+(set-face-attribute 'default nil :height 160) ;; Text size
+
+;; Prevent backup file from cluttering
+(setq lock-file-name-transforms
+ '(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs.d/aux/\\1" t)))
+(setq auto-save-file-name-transforms
+ '(("\\`/.*/\\([^/]+\\)\\'" "~/.emacs.d/aux/\\1" t)))
+(setq backup-directory-alist
+ '((".*" . "~/.emacs.d/aux/")))
+(display-battery-mode 1)
+
+;; From how i understand it, these variables are supposed to make tab and indentation be 4 in width?
+(setq-default tab-width 4) ; Tab width (duh)
+(setq c-basic-offset 4) ; Tab width (but for C?)
+
+(defun lmid () ;;Move cursor to the middle of the current line
+ (interactive)
+ (let ((line-length (- (line-end-position) (line-beginning-position))))
+ (goto-char (+ (line-beginning-position) (/ line-length 2)))))
+(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.
+ '(elcord-editor-icon "emacs_legacy_icon")
+ '(elcord-idle-message "Got distracted again...")
+ '(elcord-idle-timer 600)
+ '(elcord-quiet t)
+ '(elcord-refresh-rate 10)
+ '(package-selected-packages '(elcord flycheck corfu company)))
+(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.
+ )
+
+(require 'package)
+(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
+;; Comment/uncomment this line to enable MELPA Stable if desired. See `package-archive-priorities`
+;; and `package-pinned-packages`. Most users will not need or want to do this.
+;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
+(package-initialize)
+
+(use-package flycheck
+ :ensure t
+ :hook ((c-mode . flycheck-mode)
+ (c++-mode . flycheck-mode))
+ :config
+ ;; Set the C++ standard for both GCC and Clang
+ (setq-default flycheck-gcc-language-standard "c++20"
+ flycheck-clang-language-standard "c++20"))
+
+
+(use-package company
+ :ensure t
+ :hook ((c-mode . company-mode)
+ (c++-mode . company-mode))
+ :config
+ (setq company-backends '((company-clang company-files company-yasnippet)))
+ (setq company-clang-arguments '("-std=c++20")))
+
+(require 'elcord)
+(elcord-mode)