Skip to content

Instantly share code, notes, and snippets.

@dlandahl
Created November 12, 2020 23:26
Show Gist options
  • Save dlandahl/e5e1e579cb4340329e4dc0cd3ee14e3d to your computer and use it in GitHub Desktop.
Save dlandahl/e5e1e579cb4340329e4dc0cd3ee14e3d to your computer and use it in GitHub Desktop.
(setq byte-compile-warnings '(cl-functions))
(require 'package)
;; Any add to list for package-archives (to add marmalade or melpa) goes here
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(set-frame-font "Fira Mono-11" nil t)
(setq inhibit-startup-screen t
initial-buffer-choice nil)
(add-to-list 'load-path "~/.emacs.d/lisp/")
(setq-default tab-width 4)
(defvaralias 'c-basic-offset 'tab-width)
(defvaralias 'cperl-indent-level 'tab-width)
(menu-bar-mode -1)
(toggle-scroll-bar -1)
(tool-bar-mode -1)
(global-font-lock-mode -1)
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq-default message-log-max nil)
(add-hook 'dired-mode-hook
(lambda ()
(dired-hide-details-mode)))
(setq mouse-wheel-scroll-amount '(2 ((shift) . 2)))
(setq mouse-wheel-progressive-speed nil)
(delete-selection-mode 1)
;; Multiple cursors
(defun no-more-cursors ()
""
(interactive)
(ignore-errors (multiple-cursors-mode -1)))
(global-set-key (kbd "C-c m c") 'mc/edit-lines)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-S-<mouse-1>") 'mc/add-cursor-on-click)
(global-set-key (kbd "<mouse-3>") 'no-more-cursors)
(global-set-key [C-S-mouse-4] 'text-scale-increase)
(global-set-key [C-S-mouse-5] 'text-scale-decrease)
(global-set-key (kbd "<mouse-2>")
(lambda () (interactive)
(setq current-prefix-arg '(0))
(call-interactively 'text-scale-set)))
(global-set-key [(ctrl z)] 'undo)
(global-set-key [f5] 'revert-buffer)
(defun save-stuff ()
"Save and stuff"
(interactive)
(untabify (point-min) (point-max))
(save-buffer)
(ignore-errors (kill-buffer "*Completions*"))
(ignore-errors (kill-buffer "*Shell Command Output*"))
(ignore-errors (kill-buffer "*scratch*"))
(ignore-errors (kill-buffer "dominik"))
(ignore-errors (kill-buffer "*Messages*")))
(global-set-key (kbd "C-x C-s") 'save-stuff)
(global-unset-key (kbd "C-x C-c"))
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
(require 'volsung)
(require 'odin-mode)
(defun move-line-up ()
"Move up the current line."
(interactive)
(transpose-lines 1)
(forward-line -2)
(indent-according-to-mode))
(defun move-line-down ()
"Move down the current line."
(interactive)
(forward-line 1)
(transpose-lines 1)
(forward-line -1)
(indent-according-to-mode))
(global-set-key [(meta up)] 'move-line-up)
(global-set-key [(meta down)] 'move-line-down)
(global-set-key [(ctrl tab)] 'other-window)
(global-set-key [(super shift right)] (lambda () (interactive) (enlarge-window-horizontally 4)))
(global-set-key [(super shift left)] (lambda () (interactive) (shrink-window-horizontally 4)))
(global-set-key [(super shift up)] (lambda () (interactive) (enlarge-window 2)))
(global-set-key [(super shift down)] (lambda () (interactive) (shrink-window 2)))
(defconst namespace-no-indent
'("cc-mode"
(c-offsets-alist . ((innamespace . [0])))))
(c-add-style "namespace-no-indent" namespace-no-indent)
(require 'cc-mode)
(add-to-list 'c-mode-common-hook
(lambda () (setq c-syntactic-indentation nil)))
(defun next-desktop ()
(interactive)
(shell-command "qdbus org.kde.KWin /KWin nextDesktop")
(ignore-errors (kill-buffer "*Shell Command Output*")))
(defun previous-desktop ()
(interactive)
(shell-command "qdbus org.kde.KWin /KWin previousDesktop")
(ignore-errors (kill-buffer "*Shell Command Output*")))
(global-set-key (kbd "<right-fringe> <mouse-5>") 'next-desktop)
(global-set-key (kbd "<right-fringe> <mouse-4>") 'previous-desktop)
(global-set-key (kbd "<vertical-scroll-bar> <mouse-5>") 'next-desktop)
(global-set-key (kbd "<vertical-scroll-bar> <mouse-4>") 'previous-desktop)
(global-set-key (kbd "<mouse-8>") 'previous-buffer)
(global-set-key (kbd "<mouse-9>") 'next-buffer)
(global-set-key (kbd "<mode-line> <mouse-2>") 'kill-this-buffer)
(setq-default message-log-max nil)
(setq-default indent-tabs-mode nil)
(kill-buffer "*Messages*")
(defun delete-completion-window-buffer (&optional output)
(interactive)
(dolist (win (window-list))
(when (string= (buffer-name (window-buffer win)) "*Completions*")
(delete-window win)
(kill-buffer "*Completions*")))
output)
(add-hook 'comint-preoutput-filter-functions 'delete-completion-window-buffer)
(global-set-key (kbd "M-=") 'count-words)
(require 'kaolin-themes)
(load-theme 'kaolin-blossom t)
(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
'("620b9018d9504f79344c8ef3983ea4e83d209b46920f425240889d582be35881" default))
'(package-selected-packages '(nasm-mode multiple-cursors kaolin-themes)))
(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.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment