2022-10-17 19:40:16 +02:00
|
|
|
;;; package --- Rawley's Linux .emacs
|
2022-10-17 04:44:50 +02:00
|
|
|
;;; Commentary:
|
2022-10-17 19:40:16 +02:00
|
|
|
;;; This is my Emacs init.el for Linx. This is used on a Artix Linux machine
|
2022-10-17 04:44:50 +02:00
|
|
|
;;; and a Debian Linux machine.
|
|
|
|
;;; Code:
|
|
|
|
(add-to-list 'default-frame-alist '(font . "monospace-14"))
|
|
|
|
|
2022-11-02 00:19:02 +01:00
|
|
|
(unless (file-exists-p "~/.auto-save")
|
|
|
|
(make-directory "~/.auto-save"))
|
|
|
|
(defvar autosave-dir (concat "~/.auto-save" "/")) ; Auto save path
|
|
|
|
(make-directory autosave-dir t)
|
|
|
|
(setq auto-save-file-name-transforms
|
|
|
|
`(("\\(?:[^/]*/\\)*\\(.*\\)" ,(concat autosave-dir "\\1") t)))
|
|
|
|
|
2022-10-30 00:08:47 +02:00
|
|
|
(setq package-enable-at-startup nil)
|
2022-10-17 04:44:50 +02:00
|
|
|
(setq visible-bell nil)
|
|
|
|
(setq ring-bell-function 'ignore)
|
2022-10-30 00:08:47 +02:00
|
|
|
(setq shell-file-name "bash")
|
|
|
|
(setq shell-command-switch "-ic")
|
2022-10-17 19:40:16 +02:00
|
|
|
(setq-default tab-width 4)
|
2022-10-17 04:44:50 +02:00
|
|
|
|
|
|
|
(tool-bar-mode -1)
|
2022-08-17 19:40:58 +02:00
|
|
|
(scroll-bar-mode -1)
|
2022-10-17 04:44:50 +02:00
|
|
|
(menu-bar-mode -1)
|
2022-08-17 19:40:58 +02:00
|
|
|
(show-paren-mode 1)
|
2022-10-17 04:44:50 +02:00
|
|
|
(recentf-mode 1)
|
2022-08-17 19:40:58 +02:00
|
|
|
|
|
|
|
(require 'package)
|
2022-10-17 04:44:50 +02:00
|
|
|
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/"))
|
|
|
|
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
|
2022-08-17 19:40:58 +02:00
|
|
|
(package-initialize)
|
|
|
|
|
|
|
|
(unless (package-installed-p 'use-package)
|
2022-10-17 04:44:50 +02:00
|
|
|
(package-install 'use-package)
|
|
|
|
(package-refresh-contents))
|
2022-08-17 19:40:58 +02:00
|
|
|
|
|
|
|
(eval-and-compile
|
|
|
|
(setq use-package-always-ensure t
|
|
|
|
use-package-expand-minimally t))
|
|
|
|
|
2022-10-17 04:44:50 +02:00
|
|
|
(require 'use-package)
|
|
|
|
(use-package modus-themes)
|
|
|
|
(load-theme 'modus-operandi t)
|
|
|
|
|
2022-08-17 19:40:58 +02:00
|
|
|
(require 'ido)
|
|
|
|
(ido-mode 1)
|
|
|
|
|
2022-09-08 16:32:53 +02:00
|
|
|
(setq indent-tabs-mode nil)
|
|
|
|
(setq c-basic-offset 4)
|
|
|
|
(setq js-indent-level 2)
|
|
|
|
|
2022-08-17 19:40:58 +02:00
|
|
|
;; Packages
|
|
|
|
(require 'use-package)
|
2022-10-30 00:08:47 +02:00
|
|
|
(use-package yaml-mode)
|
|
|
|
(use-package dockerfile-mode)
|
|
|
|
(use-package docker
|
|
|
|
:ensure t
|
|
|
|
:bind ("C-c d" . docker))
|
2022-10-17 04:44:50 +02:00
|
|
|
(use-package dumb-jump)
|
2022-10-30 00:08:47 +02:00
|
|
|
(use-package yasnippet
|
|
|
|
:config
|
|
|
|
(yas-global-mode 1))
|
|
|
|
(use-package yasnippet-snippets)
|
|
|
|
|
2022-10-17 19:40:16 +02:00
|
|
|
(use-package flycheck
|
|
|
|
:ensure t
|
|
|
|
:init (global-flycheck-mode))
|
2022-10-17 04:44:50 +02:00
|
|
|
(use-package haml-mode)
|
2022-08-17 19:40:58 +02:00
|
|
|
(use-package smex
|
|
|
|
:config
|
|
|
|
(smex-initialize)
|
|
|
|
(global-set-key (kbd "M-x") 'smex))
|
2022-10-17 04:44:50 +02:00
|
|
|
|
|
|
|
;; Editing
|
|
|
|
(require 'flycheck)
|
|
|
|
(setq flycheck-check-syntax-automatically '(mode-enabled save))
|
|
|
|
(setq flycheck-display-errors-delay 0.1)
|
|
|
|
|
|
|
|
(require 'dumb-jump)
|
|
|
|
(setq dumb-jump-force-searcher 'ag)
|
|
|
|
(add-hook 'xref-backend-functions #'dumb-jump-xref-activate)
|
|
|
|
|
2022-10-30 00:08:47 +02:00
|
|
|
;; Enable scala-mode for highlighting, indentation and motion commands
|
|
|
|
(use-package scala-mode
|
|
|
|
:interpreter ("scala" . scala-mode))
|
|
|
|
|
|
|
|
;; Enable sbt mode for executing sbt commands
|
|
|
|
(use-package sbt-mode
|
|
|
|
:commands sbt-start sbt-command
|
|
|
|
:config
|
|
|
|
;; WORKAROUND: https://github.com/ensime/emacs-sbt-mode/issues/31
|
|
|
|
;; allows using SPACE when in the minibuffer
|
|
|
|
(substitute-key-definition
|
|
|
|
'minibuffer-complete-word
|
|
|
|
'self-insert-command
|
|
|
|
minibuffer-local-completion-map)
|
|
|
|
;; sbt-supershell kills sbt-mode: https://github.com/hvesalai/emacs-sbt-mode/issues/152
|
|
|
|
(setq sbt:program-options '("-Dsbt.supershell=false")))
|
|
|
|
|
|
|
|
;; Enable nice rendering of diagnostics like compile errors.
|
|
|
|
(use-package flycheck
|
|
|
|
:init (global-flycheck-mode))
|
|
|
|
|
2022-10-17 04:44:50 +02:00
|
|
|
;;;; OCaml/Reason
|
2022-11-04 02:37:11 +01:00
|
|
|
;; ## added by OPAM user-setup for emacs / base ## 56ab50dc8996d2bb95e7856a6eddb17b ## you can edit, but keep this line
|
|
|
|
(require 'opam-user-setup "~/.emacs.d/opam-user-setup.el")
|
|
|
|
;; ## end of OPAM user-setup addition for emacs / base ## keep this line
|
|
|
|
(use-package ocamlformat)
|
|
|
|
(require 'ocamlformat)
|
2022-08-17 19:40:58 +02:00
|
|
|
(use-package tuareg)
|
2022-11-04 02:37:11 +01:00
|
|
|
(add-hook 'tuareg-mode-hook (lambda ()
|
|
|
|
(define-key tuareg-mode-map (kbd "C-M-<tab>") #'ocamlformat)
|
|
|
|
(add-hook 'before-save-hook #'ocamlformat-before-save)))
|
2022-08-20 03:56:07 +02:00
|
|
|
(use-package utop
|
|
|
|
:ensure t)
|
2022-09-08 16:32:53 +02:00
|
|
|
(use-package rescript-mode)
|
|
|
|
(use-package reason-mode)
|
2022-09-25 04:49:14 +02:00
|
|
|
(use-package dune)
|
2022-08-20 03:56:07 +02:00
|
|
|
(setq utop-commands "opam config exec -- utop -emacs")
|
|
|
|
|
2022-10-17 04:44:50 +02:00
|
|
|
;;;; Perl
|
|
|
|
(fset 'perl-mode 'cperl-mode)
|
|
|
|
(add-hook 'cperl-mode-hook 'flycheck-mode)
|
2022-09-25 04:49:14 +02:00
|
|
|
|
2022-08-17 19:40:58 +02:00
|
|
|
(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.
|
2022-10-30 00:08:47 +02:00
|
|
|
'(custom-enabled-themes '(tango-dark))
|
2022-08-17 19:40:58 +02:00
|
|
|
'(custom-safe-themes
|
2022-10-17 04:44:50 +02:00
|
|
|
'("92d350334df87fe61a682518ff214c773625c6d5ace8060d128adc550bc60c9b" "ecc077ef834d36aa9839ec7997aad035f4586df7271dd492ec75a3b71f0559b3" default))
|
2022-08-17 19:40:58 +02:00
|
|
|
'(package-selected-packages
|
2022-10-30 00:08:47 +02:00
|
|
|
'(company lsp-ui lsp-metals lsp-mode sbt-mode yaml-mode docker yasnippet-snippets perl-docnow perlnow dune dune-mode borland-blue-theme reason-mode rescript-mode haml-mode utop tuareg smex modus-themes use-package))
|
2022-10-17 04:44:50 +02:00
|
|
|
'(whitespace-style '(space-mark tab-mark)))
|
2022-08-17 19:40:58 +02:00
|
|
|
(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.
|
|
|
|
)
|
2022-10-17 19:40:16 +02:00
|
|
|
|
|
|
|
(provide '.emacs)
|
|
|
|
;;; .emacs ends here
|