Skip to content

FFFluoride/Emacs-Config-org

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minor stuff

show lines and columns on the modeline

(line-number-mode 1)
(column-number-mode 1)

electric

(setq electric-pair-pairs '(
			      (?\( . ?\))
			      (?\[ . ?\])
			      (?\{ . ?\})
                            (?\' . ?\')
			      (?\` . ?\`)
			      (?\| . ?\|)
			      ))
(electric-pair-mode t)

conf mode better indents

(add-hook 'conf-mode-hook
	    (lambda ()
	      (setq indent-line-function #'insert-tab
		    indent-tabs-mode     t)))
(setq indent-tabs-mode t)

subword

(global-subword-mode 1)

tetris

(setq gamegrid-glyph-height-mm 10.0)

(defvar tetris-mode-map
  (make-sparse-keymap 'tetris-mode-map))

(define-key tetris-mode-map "n"     'tetris-start-game)
(define-key tetris-mode-map "q"     'tetris-end-game)
(define-key tetris-mode-map "p"     'tetris-pause-game)
(define-key tetris-mode-map "j"     'tetris-move-bottom)
(define-key tetris-mode-map "a"  'tetris-move-left)
(define-key tetris-mode-map "d" 'tetris-move-right)
(define-key tetris-mode-map "k"    'tetris-rotate-prev)
(define-key tetris-mode-map "s"  'tetris-move-down)

Terminal

Vterm

(setq vterm-module-cmake-args "-DUSE_SYSTEM_LIBVTERM=no")
(use-package vterm
  :ensure t)

multi-vterm

(use-package multi-vterm
  :ensure t)

Org Mode

basic config

(setq org-src-window-setup 'current-window)
(add-to-list 'org-structure-template-alist
	       '("el" . "src emacs-lisp"))
(add-to-list 'org-structure-template-alist
	       '("sh" . "src shell"))
(global-set-key (kbd "C-c l") #'org-store-link)
(global-set-key (kbd "C-c a") #'org-agenda)
(global-set-key (kbd "C-c c") #'org-capture)

org mode sub and super scripts

(setq org-pretty-entities t)
(setq org-pretty-entities-include-sub-superscripts t)

Org mode bullets

(use-package org-bullets
  :ensure t
  :config
  (add-hook 'org-mode-hook 'org-bullets-mode ))

org mode table blank field”

(setq org-table-auto-blank-field nil)

line wrap

(add-hook 'org-mode-hook 'visual-line-mode)
(add-hook 'org-mode-hook 'toggle-word-wrap)

increase size of org mode latex preview

(setq org-format-latex-options (plist-put org-format-latex-options :scale 3.0))

image width

(setq org-image-actual-width 600)

Which-key

setting up which key

(use-package which-key
  :ensure t
  :init
  (which-key-mode))

sudo edit

(use-package sudo-edit
  :ensure t
  :bind ("C-c m r" . sudo-edit))

dashboard

(use-package dashboard
  :ensure t
  :config
  (setq dashboard-items '((recents . 10)))
  (dashboard-setup-startup-hook))
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))

Beacon

setup

(use-package beacon
  :ensure t
  :init
  (beacon-mode 1))

Variables

back up and auto save directory

 (setq backup-directory-alist
	`((".*" . "~/.emacs_saves")))
 (setq auto-save-file-name-transforms
	`((".*" "~/.emacs_saves" t)))

anoyances

(setq inhibit-startup-message t)
(setq ring-bell-function 'ignore)

remove tool bar, menu bar and scroll bar

(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)

aliases

(defalias 'yes-or-no-p 'y-or-n-p)

global highlight

(when window-system (global-hl-line-mode t))

conservative scroll

(setq scroll-conservatively 100)

reload when file changes

(global-auto-revert-mode t)

Rebound keys

multi-vterm

(global-set-key (kbd "C-c m m") 'multi-vterm)

truncate-lines

(global-set-key (kbd "C-c m p") 'toggle-truncate-lines)

shrink/enlarge-window-horizontally

(global-set-key (kbd "C-x ]") 'enlarge-window-horizontally)
(global-set-key (kbd "C-x [") 'shrink-window-horizontally)
(global-set-key (kbd "C-c C-u") 'enlarge-window)
(global-set-key (kbd "C-c C-v") 'shrink-window)

IDO

enable ido mode

(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)
(setq ido-create-new-buffer 'always)

ido-vertical

(use-package ido-vertical-mode
  :ensure t
  :init
  (ido-vertical-mode 1))
(setq ido-vertical-define-keys 'C-n-and-C-p-only)

smex

(use-package smex
  :ensure t
  :init (smex-initialize)
  :bind
  ("M-x" . smex))

switch buffer

(global-set-key (kbd "C-x C-b") 'ido-switch-buffer)

Buffers

enable ibuffer

(global-set-key (kbd "C-x b") 'ibuffer)

kill current buffer by default

(defun kill-curr-buffer ()
  (interactive)
  (kill-buffer (curent-buffer)))
(global-set-key (kbd "C-x k") `kill-current-buffer)

avy

(use-package avy
  :ensure t
  :bind
  ("M-s" . avy-goto-char))

convienent functions

copy whole line

 (defun copy-whole-line ()
   (interactive)
   (save-excursion
     (kill-new
      (buffer-substring
	(point-at-bol)
	(point-at-eol)))))
 (global-set-key (kbd "C-c y y") `copy-whole-line)

kill-whole-word

(defun kill-whole-word ()
  (interactive)
  (backward-word)
  (kill-word 1))
(global-set-key (kbd "C-c d d") 'kill-whole-word)

setup-tide-mode

(defun setup-tide-mode ()
  (interactive)
  (tide-setup)
  (flycheck-mode +1)
  (setq flycheck-check-syntax-automatically '(save mode-enabled))
  (eldoc-mode +1)
  (tide-hl-identifier-mode +1)
  ;; company is an optional dependency. You have to
  ;; install it separately via package-install
  ;; `M-x package-install [ret] company`
  (company-mode +1))

config edit/reload

edit

(defun config-visit ()
  (interactive)
  (find-file "~/.emacs.d/config.org"))
(global-set-key (kbd "C-c e") 'config-visit)

reload

(defun config-reload ()
  (interactive)
  (org-babel-load-file (expand-file-name "~/.emacs.d/config.org")))
(global-set-key (kbd "C-c r") 'config-reload)

rainbow

(use-package rainbow-mode
  :ensure t
  :init (add-hook 'prog-mode-hook 'rainbow-mode))
(use-package rainbow-delimiters
  :ensure t
  :init
  (add-hook 'prog-mode-hook 'rainbow-delimiters-mode))

switch window

(use-package switch-window
  :ensure t
  :config
  (setq switch-window-input-style 'minibuffer)
  (setq switch-window-increase 4)
  (setq switch-window-threshold 2)
  (setq switch-window-shortcut-style 'qwerty)
  (setq switch-window-qwert-shortcuts
	  '("a" "s" "d" "f" "j" "k" "l"))
  :bind ([remap other-window] . switch-window))

window splitting function

(defun split-and-follow-horizontally ()
  (interactive)
  (split-window-below)
  (balance-windows)
  (other-window 1))
(global-set-key (kbd "C-x 2") 'split-and-follow-horizontally)

(defun split-and-follow-vertically ()
  (interactive)
  (split-window-right)
  (balance-windows)
  (other-window 1))
(global-set-key (kbd "C-x 3") 'split-and-follow-vertically)

nginx mode

(use-package nginx-mode
  :ensure t
  :init)

Borderless window on startup

(set-frame-parameter nil 'undecorated t)

Correct emacs size on startup

 (setq frame-resize-pixelwise t)
 (setq default-frame-alist
	'((top . 0) (left . 0)
	  (width . 80) (height . 40)))
 (setq initial-frame-alist '((top . 0) (left . 0) (width . 80) (height . 200)))

Sass

ssaass

(use-package ssass-mode
  :ensure t)

autocompletion

(use-package company
  :ensure t
  :init
  (add-hook 'after-init-hook 'global-company-mode))

(setq global-company-modes '(not idris2-repl-mode))

modeline

spaceline

(use-package spaceline
  :ensure t
  :config
  (require 'spaceline-config)
  (setq powerline-default-separator (quote arrow))
  (spaceline-spacemacs-theme))

diminish

(use-package diminish
  :ensure t
  :init
  (diminish 'company-mode)
  (diminish 'rainbow-mode)
  (diminish 'beacon-mode)
  (diminish 'which-key-mode)
  (diminish 'org-src-mode)
  (diminish 'eldoc-mode)
  (diminish 'subword-mode)
  (diminish 'flycheck-mode)
  (diminish 'drag-stuff-mode))

popup killring

(use-package popup-kill-ring
  :ensure t
  :bind ("M-y" . popup-kill-ring))

swiper

(use-package swiper
  :ensure t
  :bind
  ("C-s" . swiper))

expand region

(use-package expand-region
  :ensure t
  :bind ("C-q" . er/expand-region))

Rust mode

(use-package rust-mode
  :ensure t)

Flycheck

(use-package flycheck
  :ensure t
  :init 
  (global-flycheck-mode)
  (setq company-tooltip-align-annotations t))
(setq flycheck-global-modes '(not rust-mode))

(use-package flymake-easy
  :ensure t)

Typescript mode

(use-package typescript-mode
  :ensure t)

Tide

(use-package tide
  :ensure t
  :after (company flycheck)
  :hook ((typescript-ts-mode . tide-setup)
	   (tsx-ts-mode . tide-setup)
	   (typescript-ts-mode . tide-hl-identifier-mode)
	   (before-save . tide-format-before-save)))

Haskell

haskell-mode

(use-package haskell-mode
  :ensure t)

;; (setq flycheck-haskell-stack-ghc-executable
;;       "/home/fffluoride/.ghcup/bin/ghc")

;; (setq flycheck-haskell-hlint-executable
;;       "/home/fffluoride/.cabal/bin/hlint")

;; (setq flycheck-haskell-stack-ghc-executable
;;       "/home/fffluoride/.ghcup/bin/stack")

hlint

(use-package flymake-hlint
  :ensure t)

(add-hook 'haskell-mode-hook 'flymake-hlint-load)

Idris Mode

(use-package idris-mode
  :ensure t
  :config
  (require 'flycheck-idris) ;; Syntax checker
  (add-hook 'idris-mode-hook #'flycheck-mode)
  ;(require 'idris-format) ;; Prettification commands
  (add-to-list 'completion-ignored-extensions ".ibc") ;; Idris 1 artefacts
  :custom
  (idris-interpreter-path "idris2")
  (idris-hole-show-on-load nil)
  (idris-repl-show-repl-on-startup nil))

Drag stuff

(use-package drag-stuff
  :ensure t
  :bind ("<M-up>" . drag-stuff-up)
  :bind ("<M-down>" . drag-stuff-down)
  :bind ("<M-right>" . drag-stuff-right)
  :bind ("<M-left>" . drag-stuff-left))
(drag-stuff-mode t)

About

My emacs config (In case I mess up lol)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published