feat(emacs): add code files to move away from spacemacs

This is the start to move away from spacemacs and to a custom emacs
config
This commit is contained in:
Ade Attwood 2021-03-16 20:12:46 +00:00
parent d182275eb0
commit 7cf8c3fa53
62 changed files with 1421 additions and 13 deletions

View file

@ -0,0 +1,5 @@
elpa
etc
quelpa
var
lsp-cache

View file

@ -0,0 +1,145 @@
;;; init.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
;; ;;; Commentary:
;;
;; The entrypoint to AMACS
;;
;;; Code:
;; (setq user-emacs-directory "~/development/emacs")
;; (customize-set-value 'custom-theme-directory user-emacs-directory)
;; Load package loading with `use-package` this must be the first
;; thing loaded so we can install the packages with `use-package`
(load-file (expand-file-name "src/packages.el" user-emacs-directory))
;; Load the ui tweeks and theme to limit the time we see a big white
;; screen
(load-file (expand-file-name "src/ui.el" user-emacs-directory))
;; Load the personal config if its available where all of the secrets
;; source is
(let ((personal-init (expand-file-name "init-personal.el" user-emacs-directory)))
(when (file-exists-p personal-init)
(load-file personal-init)))
;; Genral and main configuration
(load-file (expand-file-name "src/general.el" user-emacs-directory))
(load-file (expand-file-name "src/evil.el" user-emacs-directory))
(load-file (expand-file-name "src/ivy.el" user-emacs-directory))
(load-file (expand-file-name "src/projectile.el" user-emacs-directory))
(load-file (expand-file-name "src/treemacs.el" user-emacs-directory))
(load-file (expand-file-name "src/term.el" user-emacs-directory))
;; Email configuration
(load-file (expand-file-name "src/notmuch.el" user-emacs-directory))
;; Org mode
(load-file (expand-file-name "src/org.el" user-emacs-directory))
;; Development configuration
(load-file (expand-file-name "src/development.el" user-emacs-directory))
(load-file (expand-file-name "src/lang/php.el" user-emacs-directory))
(load-file (expand-file-name "src/lang/js-ts.el" user-emacs-directory))
(load-file (expand-file-name "src/lang/yaml.el" user-emacs-directory))
(load-file (expand-file-name "src/lang/json.el" user-emacs-directory))
(load-file (expand-file-name "src/lang/web.el" user-emacs-directory))
(load-file (expand-file-name "src/lang/go.el" user-emacs-directory))
(load-file (expand-file-name "src/lang/cue.el" user-emacs-directory))
(load-file (expand-file-name "src/lang/docker.el" user-emacs-directory))
(load-file (expand-file-name "src/lang/shell.el" user-emacs-directory))
(use-package general
:config
(general-create-definer efs/leader-keys
:keymaps '(normal insert visual emacs)
:prefix "SPC"
:global-prefix "C-SPC")
(efs/leader-keys
;; Global bindings
"/" '(counsel-projectile-ag :which-key "Search Project")
"TAB" '(evil-switch-to-windows-last-buffer :which-key "Last Buffer")
"SPC" '(counsel-M-x :which-key "M-x")
";" '(evil-commentary-line :which-key "Comment")
;; Docker
"d" '(:ignore t :which-key "Docker")
"dd" 'docker
"di" 'docker-images
"dc" 'docker-containers
;; Jumping in a buffer
"j" '(:ignore t :which-key "Jumps")
"jj" 'evil-avy-goto-char-timer
"jl" 'evil-avy-goto-line
;; Searching
"s" '(:ignore t :which-key "Searching")
"ss" 'swiper
"sS" 'swiper-thing-at-point
"sb" 'swiper-all
"sB" 'swiper-all-thing-at-point
;; Windows. Just rebind all of the evil window bindings to "SPC w"
;; so we dont have to keep hitting "CTRL-w"
"w" '(evil-window-map :which-key "Windows")
"wd" 'kill-buffer-and-window
;; Org Mode
"o" '(evil-window-map :which-key "Org Mode")
"oa" 'org-agenda
;; Git
"g" '(:ignore t :which-key "Git")
"gs" 'magit-status
"gd" 'magit-diff
"gl" 'magit-log
"gb" 'browse-at-remote
;; Email
"e" '(:ignore t :which-key "Email")
"ei" 'aa/notmuch-search-inbox
"es" 'counsel-notmuch
"en" 'notmuch
"ej" 'notmuch-jump-search
;; Files
"f" '(:ignore t :which-key "Files")
"fs" 'save-buffer
"ff" 'counsel-find-file
;; Buffers
"b" '(:ignore t :which-key "Buffers")
"bd" 'kill-this-buffer
"bb" 'counsel-switch-buffer
;; Projects
"p" '(:ignore t :which-key "Projects")
"p SPC" 'counsel-projectile
"pb" 'counsel-projectile-switch-to-buffer
"pd" 'counsel-projectile-find-dir
"pp" 'counsel-projectile-switch-project
"pf" 'counsel-projectile-find-file
"pt" 'spacemacs/treemacs-project-toggle
"ps" 'projectile-run-vterm
;; Toggles
"t" '(:ignore t :which-key "Toggles")
"tt" '(counsel-load-theme :which-key "choose theme")))
(require 'server)
(unless (server-running-p)
(message "Starting a server...")
(server-start))
(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.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(doom-modeline-mode t)
'(package-selected-packages
'(string-inflection puppet-mode cue-mode evil-multiedit sh-mode dockerfile-mode docker hide-mode-line vterm browse-at-remote yasnippet yaml-mode which-key web-mode typescript-mode treemacs-projectile treemacs-magit treemacs-evil treemacs-all-the-icons smartparens scss-mode sass-mode rjsx-mode rainbow-delimiters quelpa-use-package prettier-js php-mode no-littering lsp-ui lsp-treemacs lsp-ivy ligature json-mode ivy-rich ivy-prescient general flycheck evil-surround evil-commentary evil-collection emmet-mode doom-themes doom-modeline counsel-projectile counsel-notmuch company-box base16-theme)))
(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.
)

View file

@ -0,0 +1,6 @@
# Private directory for Yasnippets snippets
The content of this directory is ignored by Git. This is the default place where
to store your private yasnippets.
This path will be loaded automatically and used whenever Yasnippets loads.

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: ES Import
# key: import
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
import {${2:Import}) from '$1';

View file

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: Table
# key: table
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
| One | Two |
| --- | --- |
| 1 | 2 |

View file

@ -0,0 +1,15 @@
;;; .yas-setup.el --- Yasnippet helper functions for PHP snippets
;;; Commentary:
;;; Code:
(require 'yasnippet)
(defun yas-php-get-class-name-by-file-name ()
"Return name of class-like construct by `file-name'.
\"class-like\" contains class, trait and interface."
(file-name-nondirectory
(file-name-sans-extension (or (buffer-file-name)
(buffer-name (current-buffer))))))
;;; .yas-setup.el ends here

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Array item
# key: ai
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
'$1' => $0

View file

@ -0,0 +1,18 @@
# -*- mode: snippet -*-
# name: Class definition
# key: class
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
<?php
declare(strict_types=1);
namespace NameSpace;
/**
* Undocumented function
*/
class ${1:`(yas-php-get-class-name-by-file-name)`}${2: extends ${3:ExtendsClass}}${4: implements ${5:ImpementsInterface}}
{
$0
}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Declare strict types decoration
# key: dst
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
declare(strict_types = 1);

View file

@ -0,0 +1,11 @@
# -*- mode: snippet -*-
# name: Practically BSD licence
# key: pbsd
# --
/**
* Copyright 2021 Practically.io All rights reserved
*
* Use of this source is governed by a BSD-style
* licence that can be found in the LICENCE file or at
* https://www.practically.io/copyright/
*/

View file

@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: Public function
# key: pub
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
/**
* Undocumented function
*
* @return $4
*/
public function ${1:name}(${2:params})${3::${4:returns}}
{
$0
}

View file

@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: Public static function
# key: pubs
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
/**
* Undocumented function
*
* @return $4
*/
public static function ${1:name}(${2:params})${3::${4:returns}}
{
$0
}

View file

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: This
# key: this
# --
$this->$0

View file

@ -0,0 +1,23 @@
# -*- mode: snippet -*-
# name: Var doc for php view files
# key: var-doc
# --
echo '<pre>';
echo '/**'.PHP_EOL;
echo ' *'.PHP_EOL;
$_type = gettype($this) == 'object' ? get_class($this) : gettype($this);
echo " * @var $_type \\$this\n";
foreach(get_defined_vars() as $name => $var) {
if (substr($name, 0, strlen('_')) !== '_' && $name !== 'this') {
if (is_array($var) && isset($var[0]) && gettype($var[0]) == 'object') {
$type = get_class($var[0]);
echo " * @var {$type}[] \\$$name\n";
continue;
}
$type = gettype($var) == 'object' ? get_class($var) : gettype($var);
echo " * @var $type \\$$name\n";
}
}
echo ' */'.PHP_EOL;
echo "</pre>";
die;

View file

@ -0,0 +1 @@
js-mode

View file

@ -0,0 +1,8 @@
;; Capitalise the first letter in a string
(defun aa/yas/rjsx/capitalize-first-cha (&optional string)
"Capitalise only the first character of the input STRING."
(when (and string (> (length string) 0))
(let ((first-char (substring string nil 1))
(rest-str (substring string 1)))
(concat (capitalize first-char) rest-str))))

View file

@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: React import
# key: react
# condition: (eq major-mode 'rjsx-mode)
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
import React from 'react';
import PropTypes from 'prop-types';

View file

@ -0,0 +1,13 @@
# -*- mode: snippet -*-
# name: React functional component
# key: rfc
# condition: (eq major-mode 'rjsx-mode)
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
export const ${1:Component} = (${2:props}) => {
return (
${0:<div>Content</div>}
);
};
$1.propTypes = {};

View file

@ -0,0 +1,8 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: React useEffect hook
# key: useEffec
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
React.useEffect(() => {
`yas-selected-text`$0
}, [${1:dependcides}]);

View file

@ -0,0 +1,6 @@
# -*- mode: snippet; require-final-newline: nil -*-
# name: React useState
# key: useState
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
const [${1:state}, set${1:$(aa/yas/rjsx/capitalize-first-cha yas-text)}] = React.useState(${2:initialState});

View file

@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: Practically BDS licence
# key: pbsd
# --
# Copyright 2021 Practically.io All rights reserved
#
# Use of this source is governed by a BSD-style
# licence that can be found in the LICENCE file or at
# https://www.practically.io/copyright/

View file

@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: shebang
# key: #!
# --
#!/usr/bin/env bash

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Breaking change block in commit message
# key: bc
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
BREAKING CHANGE: ${0:Description}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Chore commit message
# key: chore
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
chore(${1:scope}): ${2:title}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Continuous intergration commit message
# key: ci
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
ci(${1:scope}): ${2:title}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Documentation commit message
# key: docs
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
docs(${1:scope}): ${2:title}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Feature commit message
# key: feat
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
feat(${1:scope}): ${2:title}

View file

@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: Bug fix commit message
# key: fix
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
fix(${1:scope}): ${2:title}
${3:discription}
fixes issue ${3:issue number}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Performance commit message
# key: pref
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
pref(${1:scope}): ${2:title}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Refactor commit message
# key: refactor
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
refactor(${1:scope}): ${2:title}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Code styling commit message
# key: style
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
style(${1:scope}): ${2:title}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Test commit message
# key: test
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
test(${1:scope}): ${2:title}

View file

@ -0,0 +1 @@
js-mode

View file

@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: It testing helper function
# key: it
# --
it('${1: description}', async () => {
$0
});

View file

@ -0,0 +1,17 @@
# -*- mode: snippet -*-
# name: LitElement
# key: lit-element
# --
import { LitElement, html, css } from 'lit-element';
import { customElement, property } from 'lit-element/decorators.js';
@customElement('${1:x-component}')
export class Component extends LitElement {
static get styles() {
return css\`:host {}\`;
}
render() {
return html\`<div>Content</div>\`;
}
}

View file

@ -0,0 +1,2 @@
rjsx-mode
typescript-mode

View file

@ -0,0 +1,17 @@
# -*- mode: snippet -*-
# name: React class component
# key: rc
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
export interface $1State {};
export interface $1Props {};
export class ${1:Name} extends React.Component<$1Props, $1State> {
public state: $1State = {}
public render(): JSX.Element {
return (
${0:<div>Component</div>}
);
}
}

View file

@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: React import
# key: react
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
import React from 'react';

View file

@ -0,0 +1,12 @@
# -*- mode: snippet -*-
# name: React functional component
# key: rfc
# contributor: Ade Attwood <code@adeattwood.co.uk>
# --
export interface $1Props {};
export const ${1:Name}:React.FC<$1Props> = (${2:props}) => {
return (
${0:<div>Component</div>}
);
};

View file

@ -64,7 +64,8 @@ This function should only modify configuration layer settings."
;; Play Layers ;; Play Layers
emacs-lisp chrome emacs-lisp chrome
(dart :variables dart-backend 'lsp lsp-dart-sdk-dir "~/snap/flutter/common/flutter/bin/cache/dart-sdk/") (go :variables go-backend 'lsp go-tab-width 4 go-format-before-save t)
;;(dart :variables dart-backend 'lsp lsp-dart-sdk-dir "~/snap/flutter/common/flutter/bin/cache/dart-sdk/")
(elfeed :variables (elfeed :variables
elfeed-feeds '(("https://www.php.net/feed.atom" dev php) elfeed-feeds '(("https://www.php.net/feed.atom" dev php)
("https://feeds.feedburner.com/d0od" blog dev) ("https://feeds.feedburner.com/d0od" blog dev)
@ -238,7 +239,7 @@ It should only modify the values of Spacemacs settings."
;; Default font or prioritized list of fonts. ;; Default font or prioritized list of fonts.
;;dotspacemacs-default-font '("Fira Code" :size 10.0) ;;dotspacemacs-default-font '("Fira Code" :size 10.0)
;; dotspacemacs-default-font '("LigaFreeMono" :size 10.0) ;; dotspacemacs-default-font '("LigaFreeMono" :size 12.0)
dotspacemacs-default-font '("Hasklig" :size 12.0) dotspacemacs-default-font '("Hasklig" :size 12.0)
;; The leader key (default "SPC") ;; The leader key (default "SPC")
@ -588,8 +589,9 @@ This function is called at the very end of Spacemacs initialization."
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance. ;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right. ;; If there is more than one, they won't work right.
'(evil-want-Y-yank-to-eol nil)
'(package-selected-packages '(package-selected-packages
'(nginx-mode lsp-dart dap-mode posframe bui flutter dart-server dart-mode helm-gtags ggtags counsel-gtags counsel swiper ivy company-lua lua-mode yasnippet-snippets yaml-mode xterm-color ws-butler writeroom-mode winum which-key web-mode web-beautify vterm volatile-highlights vi-tilde-fringe uuidgen use-package treemacs-projectile treemacs-persp treemacs-magit treemacs-icons-dired treemacs-evil toc-org tide terminal-here tagedit symon symbol-overlay string-inflection spaceline-all-the-icons smeargle slim-mode shell-pop scss-mode sass-mode rjsx-mode restart-emacs rainbow-delimiters pug-mode prettier-js popwin phpunit phpcbf php-extras php-auto-yasnippets pcre2el password-generator paradox overseer orgit org-superstar org-projectile org-present org-pomodoro org-mime org-download org-cliplink org-brain open-junk-file nodejs-repl nameless multi-term move-text mmm-mode markdown-toc magit-svn magit-section magit-gitflow macrostep lsp-ui lsp-treemacs lorem-ipsum livid-mode link-hint json-navigator js2-refactor js-doc indent-guide impatient-mode hybrid-mode hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-org-rifle helm-org helm-notmuch helm-mode-manager helm-make helm-lsp helm-ls-git helm-gitignore helm-git-grep helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-ag google-translate golden-ratio gnuplot gmail-message-mode gitignore-templates gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe+ gh-md fuzzy font-lock+ flyspell-correct-helm flymd flycheck-pos-tip flycheck-package flycheck-elsa flx-ido fill-column-indicator fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-org evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-magit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-cleverparens evil-args evil-anzu eval-sexp-fu eshell-z eshell-prompt-extras esh-help emr emmet-mode elisp-slime-nav editorconfig edit-server dumb-jump drupal-mode dotenv-mode dockerfile-mode docker diminish devdocs define-word company-web company-statistics company-quickhelp column-enforce-mode clean-aindent-mode centered-cursor-mode browse-at-remote base16-theme auto-yasnippet auto-highlight-symbol auto-dictionary auto-compile aggressive-indent ace-link ace-jump-helm-line ac-ispell))) '(flycheck-psalm ox-json nginx-mode lsp-dart dap-mode posframe bui flutter dart-server dart-mode helm-gtags ggtags counsel-gtags counsel swiper ivy company-lua lua-mode yasnippet-snippets yaml-mode xterm-color ws-butler writeroom-mode winum which-key web-mode web-beautify vterm volatile-highlights vi-tilde-fringe uuidgen use-package treemacs-projectile treemacs-persp treemacs-magit treemacs-icons-dired treemacs-evil toc-org tide terminal-here tagedit symon symbol-overlay string-inflection spaceline-all-the-icons smeargle slim-mode shell-pop scss-mode sass-mode rjsx-mode restart-emacs rainbow-delimiters pug-mode prettier-js popwin phpunit phpcbf php-extras php-auto-yasnippets pcre2el password-generator paradox overseer orgit org-superstar org-projectile org-present org-pomodoro org-mime org-download org-cliplink org-brain open-junk-file nodejs-repl nameless multi-term move-text mmm-mode markdown-toc magit-svn magit-section magit-gitflow macrostep lsp-ui lsp-treemacs lorem-ipsum livid-mode link-hint json-navigator js2-refactor js-doc indent-guide impatient-mode hybrid-mode hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-org-rifle helm-org helm-notmuch helm-mode-manager helm-make helm-lsp helm-ls-git helm-gitignore helm-git-grep helm-flx helm-descbinds helm-css-scss helm-company helm-c-yasnippet helm-ag google-translate golden-ratio gnuplot gmail-message-mode gitignore-templates gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link git-gutter-fringe+ gh-md fuzzy font-lock+ flyspell-correct-helm flymd flycheck-pos-tip flycheck-package flycheck-elsa flx-ido fill-column-indicator fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-org evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-magit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-cleverparens evil-args evil-anzu eval-sexp-fu eshell-z eshell-prompt-extras esh-help emr emmet-mode elisp-slime-nav editorconfig edit-server dumb-jump drupal-mode dotenv-mode dockerfile-mode docker diminish devdocs define-word company-web company-statistics company-quickhelp column-enforce-mode clean-aindent-mode centered-cursor-mode browse-at-remote base16-theme auto-yasnippet auto-highlight-symbol auto-dictionary auto-compile aggressive-indent ace-link ace-jump-helm-line ac-ispell)))
(custom-set-faces (custom-set-faces
;; custom-set-faces was added by Custom. ;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.

View file

@ -0,0 +1,85 @@
;;; development.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
;;
;; The main development configuration common development packages
;; like lsp and flycheck
(defun efs/lsp-mode-setup ()
"Set up the LSP mode."
(setq lsp-enable-which-key-integration t
lsp-enable-xref nil
lsp-intelephense-completion-trigger-parameter-hints nil
lsp-intelephense-multi-root nil
lsp-enable-file-watchers nil
lsp-enable-snippet t
lsp-ui-doc-position 'top
lsp-headerline-breadcrumb-enable nil))
(use-package lsp-mode
:commands (lsp lsp-deferred)
:config
(setq
lsp-intelephense-completion-trigger-parameter-hints nil
lsp-intelephense-multi-root nil
lsp-enable-file-watchers nil
lsp-enable-snippet t
lsp-ui-doc-position 'top
lsp-headerline-breadcrumb-enable nil))
;;:hook (lsp-mode . efs/lsp-mode-setup))
(use-package lsp-ui
:hook (lsp-mode . lsp-ui-mode))
(use-package lsp-treemacs
:after lsp)
(use-package lsp-ivy)
(use-package company
:after lsp-mode
:bind
(:map company-active-map
("C-l" . yas-next-field-or-maybe-expand)
("RET" . company-complete))
:config
(global-company-mode)
(setq company-idle-delay 0.2)
(setq company-minimum-prefix-length 1)
:hook (lsp-mode . company-mode))
(use-package company-box
:hook (company-mode . company-box-mode)
:config
(setq company-box-icons-alist 'company-box-icons-all-the-icons))
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package flycheck
:ensure t
:init (global-flycheck-mode))
(with-eval-after-load 'flycheck
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc)))
(use-package magit
:ensure t
:init
;; Force magit status to go full screen
(setq magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1))
(use-package smartparens
:config
(require 'smartparens-config)
:init
(smartparens-global-mode))
;; To set different remote tyeps see https://github.com/rmuslimov/browse-at-remote#remote-types
(use-package browse-at-remote :defer t)
(use-package string-inflection :defer t)

View file

@ -0,0 +1,49 @@
;;; evil.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package evil
:init
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
(setq evil-want-C-u-scroll t)
(setq evil-want-C-i-jump nil)
:config
(evil-mode 1)
;; Set window movement to CTRL hjkl to emulate tmux vim interaction
(global-set-key (kbd "C-h") 'evil-window-left)
(global-set-key (kbd "C-j") 'evil-window-down)
(global-set-key (kbd "C-l") 'evil-window-right)
(global-set-key (kbd "C-k") 'evil-window-up)
(evil-set-initial-state 'messages-buffer-mode 'normal)
(evil-set-initial-state 'dashboard-mode 'normal))
(use-package evil-collection
:after evil
:config
(evil-collection-init))
(use-package evil-commentary
:init
(evil-commentary-mode))
(use-package evil-surround
:after evil
:init
;; `s' for surround instead of `substitute'
;; see motivation here:
;; https://github.com/syl20bnr/spacemacs/blob/develop/doc/DOCUMENTATION.org#the-vim-surround-case
(evil-define-key 'visual evil-surround-mode-map "s" 'evil-surround-region)
(evil-define-key 'visual evil-surround-mode-map "S" 'evil-substitute)
:config
(global-evil-surround-mode 1))
(use-package evil-multiedit
:after evil-collection
:config
(evil-multiedit-default-keybinds))

View file

@ -0,0 +1,61 @@
;;; general.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
;; no-littering doesn't set this by default so we must place
;; auto save files in the same path as it uses for sessions
(use-package no-littering)
(setq auto-save-file-name-transforms
`((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
(setq inhibit-startup-message t)
;; Don't wrap lines
(set-default 'truncate-lines t)
;; Set the default tab width to 4 from the default 8. This is only
;; really used in go and makefiles and 8 if just silly
(set-default 'tab-width 4)
;; Make ESC quit prompts
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(use-package which-key
:init (which-key-mode)
:diminish which-key-mode
:config
(setq which-key-idle-delay 1))
(use-package flyspell-correct-ivy
:bind ("C-M-;" . flyspell-correct-next)
:init
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'org-mode-hook 'flyspell-mode)
(add-hook 'prog-mode-hook 'flyspell-prog-mode)
(setq flyspell-correct-interface #'flyspell-correct-ivy)
(setq ispell-dictionary "british"))
(use-package yasnippet
:ensure t
:config
(yas-global-mode)
:init
(setq yas-snippet-dirs '("~/.emacs.d/snippets")))
;; Sort out line numbers
;; https://stackoverflow.com/a/23857738
(defadvice server-visit-files (before parse-numbers-in-lines (files proc &optional nowait) activate)
"looks for filenames like file:line or file:line:position and reparses name in such manner that position in file"
(ad-set-arg 0
(mapcar (lambda (fn)
(let ((name (car fn)))
(if (string-match "^\\(.*?\\):\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?$" name)
(cons
(match-string 1 name)
(cons (string-to-number (match-string 2 name))
(string-to-number (or (match-string 3 name) "")))
)
fn))) files)))

View file

@ -0,0 +1,44 @@
;;; ivy.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package ivy
:diminish
:bind (:map ivy-minibuffer-map
("TAB" . ivy-alt-done)
("C-l" . ivy-alt-done)
("C-j" . ivy-next-line)
("C-k" . ivy-previous-line)
:map ivy-switch-buffer-map
("C-k" . ivy-previous-line)
("C-l" . ivy-done)
("C-d" . ivy-switch-buffer-kill)
:map ivy-reverse-i-search-map
("C-k" . ivy-previous-line)
("C-d" . ivy-reverse-i-search-kill))
:config
(ivy-mode 1))
(use-package ivy-rich
:init
(ivy-rich-mode 1))
(use-package counsel
:bind (:map minibuffer-local-map
("C-r" . 'counsel-minibuffer-history))
:custom
(counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
:config
(counsel-mode 1))
(use-package ivy-prescient
:after counsel
:custom
(ivy-prescient-enable-filtering nil)
:config
(prescient-persist-mode 1)
(ivy-prescient-mode 1))

View file

@ -0,0 +1,120 @@
;;; cue.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
;; (use-package cue-mode
;; :quelpa (cue-mode :fetcher github :repo "jdbaldry/cue-mode")
;; :mode "\\.cue\\'")
;; Hook for user defined code.
(defvar cue-mode-hook nil)
;; Configure keymap.
(defvar cue-mode-map
(let ((map (make-keymap)))
;; TODO: implement buffer formatting.
;; (define-key map "C-c C-r" 'cue-format-buffer)
map)
"Keymap for Cue major mode")
;; Formatting using `cue fmt`.
(defun cue-format()
(interactive)
(write-region (point-min) (point-max) (buffer-file-name))
(shell-command (concat "cue fmt " (buffer-file-name)))
(revert-buffer :ignore-auto :noconfirm))
(defun cue-format-before-save ()
"Add this to .emacs to run cue on the current buffer when saving:
\(add-hook 'before-save-hook 'cue-format-before-save)."
(interactive)
(when (eq major-mode 'cue-mode) (cue-format)))
;; Keyword highlighting.
(defconst cue--identifier-regexp "\\(?:\\#\\|\\#_\\|_\\)?[a-zA-Z\$_[:digit:]]+")
(defconst cue--closed-identifier-regexp "#_?[a-zA-Z\$_[:digit:]]+")
(defconst cue--field-regexp (concat "\\(" cue--identifier-regexp "\\??:\\)"))
(defconst cue-font-lock-keywords
(let (
(keywords-regex (regexp-opt '("package" "import" "true" "false" "for" "in" "if" "let" "div" "mod" "quo" "rem") 'words))
(type-regex (regexp-opt '("bool" "string" "int" "null" "float" "bytes" "number" "uint" "uint8" "int8" "uint16" "int16" "rune" "uint32" "int32" "uint64" "int64" "uint128" "int128" "float32" "float64") 'words)))
(list
`(,keywords-regex . font-lock-builtin-face)
`(,cue--closed-identifier-regexp . font-lock-type-face)
`(,type-regex . font-lock-constant-face)
`(,cue--field-regexp . font-lock-function-name-face)
))
"Minimal highlighting expressions for Cue major mode")
;; Indentation.
(defun cue-indent-line ()
"Indent the current line close to how cuefmt would"
(interactive)
(beginning-of-line)
(if (bobp)
;; First line is never indented.
(indent-line-to 0)
(let ((no-hint t) indent)
;; If we are looking at the end of a block, decrease the indent.
(if (looking-at "\t*[]}]$")
(progn
(save-excursion
(setq indent (- (current-indentation) 2)))
;; Don't go beyond left margin.
(if (< indent 0)
(setq indent 0)))
(save-excursion
;; Iterate backwards until we find an indentation hint.
(while no-hint
(forward-line -1)
;; If the previous line opened a block, increase the indent.
(if (looking-at ".*[{\\[]$")
(progn
(setq indent (+ (current-indentation) 2))
(setq no-hint nil))
;; Else, if the previous line was a field, maintain the indent.
(if (looking-at "\t*[[:graph:]]")
(progn
(setq indent (current-indentation))
(setq no-hint nil))
;; Else, if we reach the beginning of the file, break.
(if (bobp)
(setq no-hint nil)))))))
;; If we set an indent, indent the current line to it.
(if indent
(indent-line-to indent)
;; Else, set it 0.
(indent-line-to 0)))))
;; Syntax table.
(defconst cue-mode-syntax-table
(let ((table (make-syntax-table)))
;; Cue uses // to delimit comments
(modify-syntax-entry ?/ ". 124b" table)
(modify-syntax-entry ?\n "> b" table)
table)
"Syntax table for Cue major mode.")
(defun cue-mode ()
"Major mode for editing Cue (Cuelang) files"
(interactive)
(kill-all-local-variables)
(use-local-map cue-mode-map)
(set-syntax-table cue-mode-syntax-table)
(set (make-local-variable 'font-lock-defaults) '(cue-font-lock-keywords))
(set (make-local-variable 'indent-line-function) 'cue-indent-line)
(setq major-mode 'cue-mode)
(setq mode-name "Cue")
;; Cue, like Go, uses tabs.
(setq indent-tabs-mode t)
(run-hooks 'cue-mode-hook))
(add-to-list 'auto-mode-alist (cons "\\.cue\\'" 'cue-mode))
(provide 'cue-mode)

View file

@ -0,0 +1,16 @@
;;; docker.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package docker
:ensure t
:bind ("C-c d" . docker))
(use-package dockerfile-mode
:ensure t
:hook (dockerfile-mode . lsp-deferred)
:mode "\\Dockerfile\\'")

View file

@ -0,0 +1,13 @@
;;; go.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(setenv "PATH" (concat (getenv "PATH") ":" (getenv "HOME") "/.local/share/go/bin"))
(use-package go-mode
:ensure t
:hook (go-mode . lsp-deferred)
:mode "\\.go\\'")

View file

@ -0,0 +1,53 @@
;;; ts-js.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package js2-mode
:mode "\\.m?js\\'"
:interpreter "node"
:hook (js2-mode . lsp-deferred)
:commands js2-line-break
:config
(setq js-chain-indent t
;; Don't mishighlight shebang lines
js2-skip-preprocessor-directives t
;; let flycheck handle this
js2-mode-show-parse-errors nil
js2-mode-show-strict-warnings nil
;; Flycheck provides these features, so disable them: conflicting with
;; the eslint settings.
js2-strict-trailing-comma-warning nil
js2-strict-missing-semi-warning nil
;; maximum fontification
js2-highlight-level 3
js2-highlight-external-variables t
js2-idle-timer-delay 0.1))
(use-package rjsx-mode
:mode
(("components/.+\\.js$" . rjsx-mode))
:hook (rjsx-mode . lsp-deferred)
:init
(defun +javascript-jsx-file-p ()
"Detect React or preact imports early in the file."
(and buffer-file-name
(string= (file-name-extension buffer-file-name) "js")
(re-search-forward "\\(^\\s-*import +React\\|\\( from \\|require(\\)[\"']p?react\\)"
magic-mode-regexp-match-limit t)
(progn (goto-char (match-beginning 1))
(not (sp-point-in-string-or-comment)))))
(add-to-list 'magic-mode-alist '(+javascript-jsx-file-p . rjsx-mode))
(setq-local emmet-expand-jsx-className? t))
(use-package typescript-mode
:hook (typescript-mode . lsp-deferred)
:mode
(("\\.ts\\'" . typescript-mode)
("\\.tsx\\'" . typescript-mode)))
(use-package prettier-js :commands prettier-js)

View file

@ -0,0 +1,12 @@
;;; json.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package json-mode
:ensure t
:hook (json-mode . lsp-deferred)
:mode "\\.json\\'")

View file

@ -0,0 +1,12 @@
;;; php.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package php-mode
:ensure t
:hook (php-mode . lsp-deferred)
:mode "\\.php\\'")

View file

@ -0,0 +1,10 @@
;;; shell.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
;; sh-mode is already installed just need to enable lsp in that mode
(add-hook 'sh-mode-hook 'lsp)

View file

@ -0,0 +1,64 @@
;;; web.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package web-mode
:defer t
:hook (web-mode . lsp-deferred)
:mode
(("\\.phtml\\'" . web-mode)
("\\.tpl\\.php\\'" . web-mode)
("\\.twig\\'" . web-mode)
("\\.xml\\'" . web-mode)
("\\.html\\'" . web-mode)
("\\.htm\\'" . web-mode)
("\\.[gj]sp\\'" . web-mode)
("\\.as[cp]x?\\'" . web-mode)
("\\.eex\\'" . web-mode)
("\\.erb\\'" . web-mode)
("\\.mustache\\'" . web-mode)
("\\.handlebars\\'" . web-mode)
("\\.hbs\\'" . web-mode)
("\\.eco\\'" . web-mode)
("\\.ejs\\'" . web-mode)
("\\.svelte\\'" . web-mode)
("\\.ctp\\'" . web-mode)
("\\.djhtml\\'" . web-mode)))
(use-package sass-mode
:defer t
:hook (sass-mode . lsp-deferred)
:mode ("\\.sass\\'" . sass-mode))
(use-package scss-mode
:defer t
:hook (scss-mode . lsp-deferred)
:mode ("\\.scss\\'" . scss-mode))
(use-package css-mode
:defer t
:hook (css-mode . lsp-deferred)
:mode ("\\.css\\'" . css-mode))
(use-package less-css-mode
:defer t
:hook (less-css-mode . lsp-deferred)
:mode ("\\.less\\'" . less-css-mode))
(use-package emmet-mode
:defer t
:hook ((web-mode . emmet-mode)
(css-mode . emmet-mode)
(sass-mode . emmet-mode)
(js2-mode . emmet-mode)
(rjsx-mode . (lambda ()
(emmet-mode)
(setq-local emmet-expand-jsx-className? t)))
(typescript-mode . (lambda ()
(emmet-mode)
(setq-local emmet-expand-jsx-className? t)))))

View file

@ -0,0 +1,12 @@
;;; yaml.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package yaml-mode
:ensure t
:hook (yaml-mode . lsp-deferred)
:mode "\\.\\(yml\\|yaml\\)\\'")

View file

@ -0,0 +1,82 @@
;;; notmuch.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(defvar notmuch-message-deleted-tags '("+deleted" "-inbox" "-unread"))
(defun spacemacs/notmuch-search-archive-thread-down ()
"Search thread up."
(interactive)
(notmuch-search-archive-thread))
(defun spacemacs/notmuch-search-archive-thread-up ()
"Search thread down."
(interactive)
(notmuch-search-archive-thread)
(notmuch-search-previous-thread)
(notmuch-search-previous-thread))
(defun spacemacs//notmuch-message-delete (go-next)
"Delete message and select GO-NEXT message."
(notmuch-search-tag notmuch-message-deleted-tags)
(if (eq 'up go-next)
(notmuch-search-previous-thread)
(notmuch-search-next-thread)))
(defun spacemacs/notmuch-message-delete-down ()
"Delete a message and select the next message."
(interactive)
(spacemacs//notmuch-message-delete 'down))
(defun spacemacs/notmuch-message-delete-up ()
"Delete a message and select the previous message."
(interactive)
(spacemacs//notmuch-message-delete 'up))
(defun aa/notmuch-search-inbox ()
"Search the notmuch inbox."
(interactive)
(notmuch-search "tag:inbox"))
(use-package notmuch
:defer t
:commands notmuch
:config
(setq notmuch-saved-searches '((:name "inbox"
:key "i"
:query "tag:inbox"
:sort-order newest-first)
(:name "unread"
:key "u"
:query "tag:unread"
:sort-order newest-first)
(:name "all"
:key "a"
:query "*"
:sort-order newest-first)))
;; key bindings
(evil-define-key 'normal notmuch-search-mode-map
"=" 'notmuch-refresh-this-buffer
"?" 'notmuch-help
"*" 'notmuch-search-tag-all
"-" 'notmuch-search-remove-tag
"+" 'notmuch-search-add-tag
"J" 'notmuch-jump-search
"m" 'notmuch-mua-new-mail
"s" 'notmuch-search
"a" 'spacemacs/notmuch-search-archive-thread-down
"A" 'spacemacs/notmuch-search-archive-thread-up
"d" 'spacemacs/notmuch-message-delete-down
"D" 'spacemacs/notmuch-message-delete-up)
(evil-define-key 'normal notmuch-show-mode-map
"B" 'notmuch-show-browse-urls)
(evil-define-key 'visual notmuch-search-mode-map
"-" 'notmuch-search-remove-tag
"+" 'notmuch-search-add-tag
"d" 'spacemacs/notmuch-message-delete-down))
(use-package counsel-notmuch :defer t)

View file

@ -0,0 +1,118 @@
;;; org.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(defun efs/org-mode-setup ()
(org-indent-mode)
(variable-pitch-mode 1)
(visual-line-mode 1))
(defun efs/org-font-setup ()
;; Set faces for heading levels
(dolist (face '((org-level-1 . 1.2)
(org-level-2 . 1.1)
(org-level-3 . 1.05)
(org-level-4 . 1.0)
(org-level-5 . 1.1)
(org-level-6 . 1.1)
(org-level-7 . 1.1)
(org-level-8 . 1.1)))
(set-face-attribute (car face) nil :font "Lato" :weight 'regular :height (cdr face)))
;; Ensure that anything that should be fixed-pitch in Org files appears that way
(set-face-attribute 'org-block nil :foreground nil :inherit 'fixed-pitch)
(set-face-attribute 'org-table nil :inherit 'fixed-pitch)
(set-face-attribute 'org-formula nil :inherit 'fixed-pitch)
(set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch))
(set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch))
(set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch)
(set-face-attribute 'line-number nil :inherit 'fixed-pitch)
(set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch))
(use-package org
:pin org
:hook (org-mode . efs/org-mode-setup)
:config
(efs/org-font-setup)
(setq org-ellipsis "")
(setq org-agenda-start-with-log-mode t)
(setq org-log-done 'time)
(setq org-log-into-drawer t)
(setq org-agenda-files
'("~/Nextcloud/org/Todo.org"))
(setq org-refile-targets '(("Archive.org" :maxlevel . 1)))
(setq org-agenda-files '("~/Nextcloud/org"))
(setq org-directory "~/Nextcloud/org")
(require 'org-habit)
(add-to-list 'org-modules 'org-habit)
(setq org-habit-graph-column 60)
;; Define a kanban style set of stages for todo tasks
(setq org-todo-keywords
'((sequence "TODO" "WAITING" "REVIEW" "|" "DONE" "ARCHIVED")))
;; Save Org buffers after refiling!
(advice-add 'org-refile :after 'org-save-all-org-buffers)
;; Configure custom agenda views
(setq org-agenda-custom-commands
'(("d" "Dashboard"
((agenda "" ((org-deadline-warning-days 7 )))
(todo "TODO"
((org-agenda-overriding-header "Todo")))
(todo "WAITING"
((org-agenda-overriding-header "Waiting on External")))))
("w" "Workflow Status"
((todo "WAITING"
((org-agenda-overriding-header "Waiting on External")
(org-agenda-files org-agenda-files)))
(todo "TODO"
((org-agenda-overriding-header "Todo")
(org-agenda-files org-agenda-files)))
(todo "REVIEW"
((org-agenda-overriding-header "In Review")
(org-agenda-files org-agenda-files)))))))
(setq org-capture-templates
`(("t" "Tasks / Projects")
("tt" "Task" entry (file+olp "~/Nextcloud/org/Todo.org" "Tasks")
"* TODO %?\n %U\n %a\n %i" :empty-lines 1))))
(use-package org-bullets
:after org
:hook (org-mode . org-bullets-mode)
:custom
(org-bullets-bullet-list '("" "" "" "" "" "" "")))
(use-package evil-org
:ensure t
:after org
:hook (org-mode . (lambda () evil-org-mode))
:config
(require 'evil-org-agenda)
(evil-org-agenda-set-keys))
;; This is needed as of Org 9.2
(require 'org-tempo)
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
(add-to-list 'org-structure-template-alist '("php" . "src php"))
(defun efs/org-mode-visual-fill ()
(setq visual-fill-column-width 100
visual-fill-column-center-text t)
(visual-fill-column-mode 1))
(use-package visual-fill-column
:hook (org-mode . efs/org-mode-visual-fill))

View file

@ -0,0 +1,31 @@
;;; packages.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("elpa" . "https://elpa.gnu.org/packages/")))
(package-initialize)
(unless package-archive-contents
(package-refresh-contents))
;; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
(package-install 'use-package))
(require 'use-package)
(setq use-package-always-ensure t)
(use-package quelpa)
(quelpa
'(quelpa-use-package
:fetcher git
:url "https://github.com/quelpa/quelpa-use-package.git"))
(require 'quelpa-use-package)

View file

@ -0,0 +1,22 @@
;;; projectile.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package projectile
:diminish projectile-mode
:config (projectile-mode)
:custom ((projectile-completion-system 'ivy))
:bind-keymap
("C-c p" . projectile-command-map)
:init
;; NOTE: Set this to the folder where you keep your Git repos!
(when (file-directory-p "~/Code/src")
(setq projectile-project-search-path '("~/Code/src")))
(setq projectile-switch-project-action #'projectile-dired))
(use-package counsel-projectile
:config (counsel-projectile-mode))

View file

@ -0,0 +1,12 @@
;;; puppet.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(use-package puppet-mode
:ensure t
:defer
:mode "\\.pp\\'")

View file

@ -0,0 +1,24 @@
;;; term.el --- AMACS -*- lexical-binding: t; -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(defun aa/term-init ()
;; Hide the mode line in the terminal
(hide-mode-line-mode))
(use-package vterm
:quelpa (vterm :fetcher github :repo "akermu/emacs-libvterm")
:commands (vterm)
:hook (vterm-mode . aa/term-init)
:init
(defvar vterm-install t)
:config
;; Set the custom term prompt the oh-my-zsh "pygmalion" theme
(setq term-prompt-regexp ".*⇒")
;; Once vterm is dead, the vterm buffer is useless. Why keep it around? We can
;; spawn another if want one.
(setq vterm-kill-buffer-on-exit t))

View file

@ -0,0 +1,44 @@
;;; treemacs.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(defun spacemacs/treemacs-project-toggle ()
"Toggle and add the current project to treemacs if not already added."
(interactive)
(if (eq (treemacs-current-visibility) 'visible)
(delete-window (treemacs-get-local-window))
(let ((path (projectile-ensure-project (projectile-project-root)))
(name (projectile-project-name)))
(unless (treemacs-current-workspace)
(treemacs--find-workspace))
(treemacs-do-add-project-to-workspace path name)
(treemacs-select-window))))
(use-package treemacs
:ensure t
:defer t
:init
(with-eval-after-load 'winum
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window)))
(use-package treemacs-magit
:after treemacs magit
:ensure t
:config
;; Force magit status to go full screen
(setq-default git-magit-status-fullscreen t))
(use-package treemacs-evil
:after treemacs evil
:ensure t)
(use-package treemacs-projectile
:after treemacs projectile
:ensure t)
(use-package treemacs-all-the-icons
:hook (treemacs-mode . (lambda () (treemacs-load-theme 'all-the-icons))))

View file

@ -0,0 +1,64 @@
;;; ui.el --- AMACS -*- lexical-binding: t -*-
;;
;; Copyright 2021 Practically.io All rights reserved
;;
;; Use of this source is governed by a BSD-style
;; licence that can be found in the LICENCE file or at
;; https://www.practically.io/copyright/
(scroll-bar-mode -1) ; Disable visible scrollbar
(tool-bar-mode -1) ; Disable the toolbar
(tooltip-mode -1) ; Disable tooltips
(set-fringe-mode 10) ; Give some breathing room
(menu-bar-mode -1) ; Disable the menu bar
;; Display the line column in the modeline not just the line number
(column-number-mode)
;; Set up the visible bell
(setq visible-bell t)
(setq-default a-font-size 120)
(setq-default a-font "LigaFreeMono")
(set-face-attribute 'default nil :font a-font :height a-font-size)
(set-face-attribute 'fixed-pitch nil :font a-font :height a-font-size)
(set-face-attribute 'variable-pitch nil :font "Lato" :height a-font-size :weight 'regular)
(use-package doom-themes)
(use-package base16-theme
:init
;; Fix terminal color theme for base16
;; See: https://github.com/belak/base16-emacs#terminal-colors
;; See: https://github.com/belak/base16-emacs/issues/73#issuecomment-721942335
(setq base16-theme-256-color-source 'base16-shell)
(setq base16-distinct-fringe-background nil)
(load-theme 'base16-ocean t))
(use-package all-the-icons)
(use-package doom-modeline
:init (doom-modeline-mode 1)
:custom ((doom-modeline-height 15)))
(use-package hide-mode-line)
(use-package ligature
:quelpa (ligature :fetcher github :repo "mickeynp/ligature.el")
:config
(ligature-set-ligatures 'prog-mode '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>"
":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
"!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
"<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
"<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<"
"..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~="
"~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|"
"[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:"
">=" ">>" ">-" "-~" "-|" "->" "-<" "<~" "<*" "<|" "<:" "<$"
"<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!" "##"
"#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:" "?="
"?." "??" ";;" "/*" "/**" "/=" "/>" "__" "~~" "(*" "*)"
"://" "true" "false"))
;; Enables ligature checks globally in all buffers. You can also do it
;; per mode with `ligature-mode'.
(global-ligature-mode t))

View file

@ -1,14 +1,6 @@
class core::emacs { class core::emacs {
vcsrepo { "${user_home}/.emacs.d": file { "${user_home}/.emacs.d":
source => 'https://github.com/syl20bnr/spacemacs',
ensure => 'latest',
provider => 'git',
user => $user,
revision => 'develop',
}
file { "${user_home}/.spacemacs":
ensure => 'link', ensure => 'link',
target => find_file('core/emacs/spacemacs'), target => find_file('core/emacs'),
} }
} }