(line-number-mode 1)
(column-number-mode 1)
(setq electric-pair-pairs '(
(?\( . ?\))
(?\[ . ?\])
(?\{ . ?\})
(?\' . ?\')
(?\` . ?\`)
(?\| . ?\|)
))
(electric-pair-mode t)
(add-hook 'conf-mode-hook
(lambda ()
(setq indent-line-function #'insert-tab
indent-tabs-mode t)))
(setq indent-tabs-mode t)
(global-subword-mode 1)
(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)
(setq vterm-module-cmake-args "-DUSE_SYSTEM_LIBVTERM=no")
(use-package vterm
:ensure t)
(use-package multi-vterm
:ensure t)
(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)
(setq org-pretty-entities t)
(setq org-pretty-entities-include-sub-superscripts t)
(use-package org-bullets
:ensure t
:config
(add-hook 'org-mode-hook 'org-bullets-mode ))
(setq org-table-auto-blank-field nil)
(add-hook 'org-mode-hook 'visual-line-mode)
(add-hook 'org-mode-hook 'toggle-word-wrap)
(setq org-format-latex-options (plist-put org-format-latex-options :scale 3.0))
(setq org-image-actual-width 600)
(use-package which-key
:ensure t
:init
(which-key-mode))
(use-package sudo-edit
:ensure t
:bind ("C-c m r" . sudo-edit))
(use-package dashboard
:ensure t
:config
(setq dashboard-items '((recents . 10)))
(dashboard-setup-startup-hook))
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
(use-package beacon
:ensure t
:init
(beacon-mode 1))
(setq backup-directory-alist
`((".*" . "~/.emacs_saves")))
(setq auto-save-file-name-transforms
`((".*" "~/.emacs_saves" t)))
(setq inhibit-startup-message t)
(setq ring-bell-function 'ignore)
(tool-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(defalias 'yes-or-no-p 'y-or-n-p)
(when window-system (global-hl-line-mode t))
(setq scroll-conservatively 100)
(global-auto-revert-mode t)
(global-set-key (kbd "C-c m m") 'multi-vterm)
(global-set-key (kbd "C-c m p") 'toggle-truncate-lines)
(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)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)
(setq ido-create-new-buffer 'always)
(use-package ido-vertical-mode
:ensure t
:init
(ido-vertical-mode 1))
(setq ido-vertical-define-keys 'C-n-and-C-p-only)
(use-package smex
:ensure t
:init (smex-initialize)
:bind
("M-x" . smex))
(global-set-key (kbd "C-x C-b") 'ido-switch-buffer)
(global-set-key (kbd "C-x b") 'ibuffer)
(defun kill-curr-buffer ()
(interactive)
(kill-buffer (curent-buffer)))
(global-set-key (kbd "C-x k") `kill-current-buffer)
(use-package avy
:ensure t
:bind
("M-s" . avy-goto-char))
(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)
(defun kill-whole-word ()
(interactive)
(backward-word)
(kill-word 1))
(global-set-key (kbd "C-c d d") 'kill-whole-word)
(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))
(defun config-visit ()
(interactive)
(find-file "~/.emacs.d/config.org"))
(global-set-key (kbd "C-c e") 'config-visit)
(defun config-reload ()
(interactive)
(org-babel-load-file (expand-file-name "~/.emacs.d/config.org")))
(global-set-key (kbd "C-c r") 'config-reload)
(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))
(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))
(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)
(use-package nginx-mode
:ensure t
:init)
(set-frame-parameter nil 'undecorated t)
(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)))
(use-package ssass-mode
:ensure t)
(use-package company
:ensure t
:init
(add-hook 'after-init-hook 'global-company-mode))
(setq global-company-modes '(not idris2-repl-mode))
(use-package spaceline
:ensure t
:config
(require 'spaceline-config)
(setq powerline-default-separator (quote arrow))
(spaceline-spacemacs-theme))
(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))
(use-package popup-kill-ring
:ensure t
:bind ("M-y" . popup-kill-ring))
(use-package swiper
:ensure t
:bind
("C-s" . swiper))
(use-package expand-region
:ensure t
:bind ("C-q" . er/expand-region))
(use-package rust-mode
:ensure t)
(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)
(use-package typescript-mode
:ensure t)
(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)))
(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")
(use-package flymake-hlint
:ensure t)
(add-hook 'haskell-mode-hook 'flymake-hlint-load)
(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))
(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)