Compare commits
1 Commits
test-emacs
...
max-master
| Author | SHA1 | Date | |
|---|---|---|---|
| 23927d6948 |
@@ -3,6 +3,7 @@
|
||||
;; Place your private configuration here! Remember, you do not need to run 'doom
|
||||
;; sync' after modifying this file!
|
||||
|
||||
|
||||
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
||||
;; clients, file templates and snippets.
|
||||
(setq user-full-name "Max Regan"
|
||||
@@ -51,30 +52,3 @@
|
||||
;;
|
||||
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
||||
;; they are implemented.
|
||||
|
||||
(after! lsp-ui
|
||||
;; sideline is super noisy
|
||||
(setq lsp-ui-sideline-enable nil))
|
||||
|
||||
(after! org-journal
|
||||
(setq org-journal-dir "~/org/journal/"))
|
||||
|
||||
(after! counsel
|
||||
(ivy-rich-mode 1)
|
||||
(all-the-icons-ivy-rich-mode 1))
|
||||
|
||||
(use-package! mgr-gitlab
|
||||
:load-path "lisp/mgr-gitlab"
|
||||
:ensure t
|
||||
:config
|
||||
(setq gitlab-host "gitlab.maxregan.me"
|
||||
gitlab-token-id (if (file-exists-p mgr-gitlab-token-file)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents mgr-gitlab-token-file)
|
||||
(string-trim (buffer-string)))
|
||||
nil)
|
||||
dashboard-projects-backend 'projectile
|
||||
dashboard-items '((mgr-gitlab-gitlab-projects . 10)
|
||||
(recents . 5)
|
||||
(agenda . 5)
|
||||
(projects . 5))))
|
||||
|
||||
@@ -20,17 +20,17 @@
|
||||
;;layout ; auie,ctsrnm is the superior home row
|
||||
|
||||
:completion
|
||||
company ; the ultimate code completion backend
|
||||
company ; the ultimate code completion backend
|
||||
;;helm ; the *other* search engine for love and life
|
||||
;;ido ; the other *other* search engine...
|
||||
;;ivy ; a search engine for love and life
|
||||
vertico ; the search engine of the future
|
||||
;;ivy ; a search engine for love and life
|
||||
vertico ; the search engine of the future
|
||||
|
||||
:ui
|
||||
;;deft ; notational velocity for Emacs
|
||||
doom ; what makes DOOM look the way it does
|
||||
doom-dashboard ; a nifty splash screen for Emacs
|
||||
;; doom-quit ; DOOM quit-message prompts when you quit Emacs
|
||||
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
|
||||
(emoji +unicode) ; 🙂
|
||||
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
||||
;;hydra
|
||||
@@ -45,16 +45,16 @@
|
||||
;;tabs ; a tab bar for Emacs
|
||||
;;treemacs ; a project drawer, like neotree but cooler
|
||||
;;unicode ; extended unicode support for various languages
|
||||
vc-gutter ; vcs diff in the fringe
|
||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||
window-select ; visually switch windows
|
||||
workspaces ; tab emulation, persistence & separate workspaces
|
||||
vc-gutter ; vcs diff in the fringe
|
||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||
window-select ; visually switch windows
|
||||
workspaces ; tab emulation, persistence & separate workspaces
|
||||
;;zen ; distraction-free coding or writing
|
||||
|
||||
:editor
|
||||
;;(evil +everywhere); come to the dark side, we have cookies
|
||||
;; file-templates ; auto-snippets for empty files
|
||||
fold ; (nigh) universal code folding
|
||||
file-templates ; auto-snippets for empty files
|
||||
fold ; (nigh) universal code folding
|
||||
;;(format +onsave) ; automated prettiness
|
||||
;;god ; run Emacs commands without modifier keys
|
||||
;;lispy ; vim for lisp, for people who don't like vim
|
||||
@@ -62,8 +62,8 @@
|
||||
;;objed ; text object editing for the innocent
|
||||
;;parinfer ; turn lisp into python, sort of
|
||||
;;rotate-text ; cycle region at point between text candidates
|
||||
snippets ; my elves. They type so I don't have to
|
||||
word-wrap ; soft wrapping with language-aware indent
|
||||
snippets ; my elves. They type so I don't have to
|
||||
word-wrap ; soft wrapping with language-aware indent
|
||||
|
||||
:emacs
|
||||
(dired +icons) ; making dired pretty [functional]
|
||||
@@ -73,10 +73,10 @@
|
||||
vc ; version-control and Emacs, sitting in a tree
|
||||
|
||||
:term
|
||||
eshell ; the elisp shell that works everywhere
|
||||
eshell ; the elisp shell that works everywhere
|
||||
;;shell ; simple shell REPL for Emacs
|
||||
;;term ; basic terminal emulator for Emacs
|
||||
vterm ; the best terminal emulation in Emacs
|
||||
vterm ; the best terminal emulation in Emacs
|
||||
|
||||
:checkers
|
||||
syntax ; tasing you for every semicolon you forget
|
||||
@@ -85,17 +85,17 @@
|
||||
|
||||
:tools
|
||||
;;ansible
|
||||
debugger ; FIXME stepping through code, to help you add bugs
|
||||
debugger ; FIXME stepping through code, to help you add bugs
|
||||
;;direnv
|
||||
docker
|
||||
editorconfig ; let someone else argue about tabs vs spaces
|
||||
editorconfig ; let someone else argue about tabs vs spaces
|
||||
;;ein ; tame Jupyter notebooks with emacs
|
||||
(eval +overlay) ; run code, run (also, repls)
|
||||
;;gist ; interacting with github gists
|
||||
lookup ; navigate your code and its documentation
|
||||
lsp ; M-x vscode
|
||||
magit ; a git porcelain for Emacs
|
||||
make ; run make tasks from Emacs
|
||||
lsp ; M-x vscode
|
||||
magit ; a git porcelain for Emacs
|
||||
make ; run make tasks from Emacs
|
||||
;;pass ; password manager for nerds
|
||||
;;pdf ; pdf enhancements
|
||||
;;prodigy ; FIXME managing external services & code builders
|
||||
@@ -145,15 +145,15 @@
|
||||
;;lean ; for folks with too much to prove
|
||||
;;ledger ; be audit you can be
|
||||
;;lua ; one-based indices? one-based indices
|
||||
markdown ; writing docs for people to ignore
|
||||
markdown ; writing docs for people to ignore
|
||||
;;nim ; python + lisp at the speed of c
|
||||
;;nix ; I hereby declare "nix geht mehr!"
|
||||
;;ocaml ; an objective camel
|
||||
org ; organize your plain life in plain text
|
||||
org ; organize your plain life in plain text
|
||||
;;php ; perl's insecure younger brother
|
||||
;;plantuml ; diagrams for confusing people more
|
||||
;;purescript ; javascript, but functional
|
||||
python ; beautiful is better than ugly
|
||||
python ; beautiful is better than ugly
|
||||
;;qt ; the 'cutest' gui framework ever
|
||||
;;racket ; a DSL for DSLs
|
||||
;;raku ; the artist formerly known as perl6
|
||||
@@ -169,7 +169,7 @@
|
||||
;;swift ; who asked for emoji variables?
|
||||
;;terra ; Earth and Moon in alignment for performance.
|
||||
;;web ; the tubes
|
||||
yaml ; JSON, but readable
|
||||
yaml ; JSON, but readable
|
||||
;;zig ; C, but simpler
|
||||
|
||||
:email
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
;;; mgr-gitlab.el --- Description -*- lexical-binding: t; -*-
|
||||
;;
|
||||
;; Copyright (C) 2022 Max Regan
|
||||
;;
|
||||
;; Author: Max Regan <https://github.com/reganmax>
|
||||
;; Maintainer: Max Regan <reganmax@amazon.com>
|
||||
;; Created: March 17, 2022
|
||||
;; Modified: March 17, 2022
|
||||
;; Version: 0.0.1
|
||||
;; Keywords: abbrev bib c calendar comm convenience data docs emulations extensions faces files frames games hardware help hypermedia i18n internal languages lisp local maint mail matching mouse multimedia news outlines processes terminals tex tools unix vc wp
|
||||
;; Homepage: https://github.com/reganmax/mgr-gitlab
|
||||
;; Package-Requires: ((emacs "27.1"))
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
;;
|
||||
;;; Commentary:
|
||||
;;
|
||||
;; Description: My personal configuration for Gitlab
|
||||
;;
|
||||
;;; Code:
|
||||
|
||||
(require 'gitlab)
|
||||
(require 'dashboard)
|
||||
(require 'projectile)
|
||||
(require 'seq)
|
||||
|
||||
(defvar mgr-gitlab-project-path "~/repos/" "The location into which gitlab projects will be cloned.")
|
||||
(defvar mgr-gitlab-token-file "~/.gitlab_token" "The location into which gitlab projects will be cloned.")
|
||||
|
||||
(defun mgr-gitlab-list-remote-project-names ()
|
||||
"Return a list of all of the project names on the remote server."
|
||||
(seq-map (lambda (el) (alist-get 'name el)) (gitlab-list-all-projects)))
|
||||
|
||||
(defun mgr-gitlab-list-local-project-names ()
|
||||
"Return a list of all of the project names in the mgr-gitlab-project-path."
|
||||
(seq-remove #'file-directory-p (directory-files mgr-gitlab-project-path)))
|
||||
|
||||
(defun mgr-gitlab--get-project-by-name (name)
|
||||
"Return the alist for the project named NAME."
|
||||
(seq-find (lambda (el) (string-equal (alist-get 'name el) name)) (gitlab-list-projects)))
|
||||
|
||||
(defun mgr-gitlab--get-id-for-name (name)
|
||||
"Return an ID for a given project NAME."
|
||||
(alist-get 'id (mgr-gitlab--get-project-by-name name)))
|
||||
|
||||
(defun mgr-gitlab-clone (name)
|
||||
"Clone the project NAME."
|
||||
;; TODO: Automatically set remote.pushDefault so it does not prompt
|
||||
;; TODO: Clone with API token, if there is one
|
||||
(interactive
|
||||
(list (completing-read "Project: " (mgr-gitlab-list-remote-project-names))))
|
||||
(let* ((url (mgr-gitlab--get-url-by-name name))
|
||||
(dest mgr-gitlab-project-path))
|
||||
(magit-clone-regular url dest nil)))
|
||||
|
||||
(defun mgr-gitlab-clone-all ()
|
||||
"Clone all projects in Gitlab, iteratively."
|
||||
(interactive)
|
||||
(seq-do (lambda (name)
|
||||
(if (not (seq-contains-p (mgr-gitlab-list-local-project-names) name))
|
||||
(progn
|
||||
(message (format "Cloning %s..." name))
|
||||
(mgr-gitlab-clone name))
|
||||
(message (format "Skipping %s." name))))
|
||||
(mgr-gitlab-list-remote-project-names)))
|
||||
|
||||
(defun mgr-gitlab--get-url-by-name (name)
|
||||
"Return a fixed-up repository url for the given project NAME.
|
||||
This also fixes up the capitalization in the project name that
|
||||
gitlab so kindly removes."
|
||||
(let* ((repo (mgr-gitlab--get-project-by-name name))
|
||||
(orig-url (alist-get 'http_url_to_repo repo)))
|
||||
(concat (mapconcat 'identity (butlast (split-string orig-url "/")) "/")
|
||||
"/"
|
||||
name
|
||||
".git")))
|
||||
|
||||
(defun mgr-gitlab-dashboard-insert-gitlab-projects (list-size)
|
||||
"A custom dashboard.el widget to display LIST-SIZE gitlab projects."
|
||||
(dashboard-insert-section
|
||||
"Gitlab Projects:"
|
||||
(cl-map 'list (lambda (el) (alist-get 'name el)) (gitlab-list-all-projects))
|
||||
list-size
|
||||
'projects
|
||||
"P"
|
||||
`(lambda (&rest _)
|
||||
(let ((dir (concat mgr-gitlab-project-path ,el)))
|
||||
(if (not (file-directory-p dir))
|
||||
(mgr-gitlab-clone ,el))
|
||||
(magit-status (concat mgr-gitlab-project-path ,el))))
|
||||
(format "%s" el)))
|
||||
|
||||
(add-to-list 'dashboard-item-generators '(mgr-gitlab-gitlab-projects . mgr-gitlab-dashboard-insert-gitlab-projects))
|
||||
|
||||
(provide 'mgr-gitlab)
|
||||
@@ -55,8 +55,6 @@
|
||||
|
||||
(package! git-auto-commit-mode)
|
||||
|
||||
;; required for mgr-gitlab
|
||||
(package! gitlab)
|
||||
|
||||
;; Testing
|
||||
(package! dashboard)
|
||||
|
||||
|
||||
@@ -4,23 +4,6 @@
|
||||
# See https://docs.gitlab.com/ee/ci/variables/#priority-of-environment-variables
|
||||
stages:
|
||||
- test
|
||||
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
DOOMDIR: ./.doom.d
|
||||
EMACSDIR: ./.emacs.d
|
||||
DOOMLOCALDIR: ./.emacs.d/local
|
||||
|
||||
test-emacs:
|
||||
stage: test
|
||||
image: ubuntu:22.04
|
||||
before_script:
|
||||
- apt-get update
|
||||
- apt-get install -y emacs-nox git
|
||||
- yes | ./.emacs.d/bin/doom install || true
|
||||
script:
|
||||
- ./.mgr_config/tests/test-emacs.sh
|
||||
|
||||
sast:
|
||||
stage: test
|
||||
include:
|
||||
|
||||
@@ -73,18 +73,8 @@ prompt_function() {
|
||||
|
||||
PS1="\$(prompt_function)"
|
||||
|
||||
# Add doom emacs to path
|
||||
|
||||
export PATH=$PATH:$HOME/.emacs.d/bin/
|
||||
|
||||
export EDITOR="emacs"
|
||||
export VISUAL="emacs"
|
||||
|
||||
# Special sauce for better vterm integration in emacs
|
||||
if [[ "$INSIDE_EMACS" = 'vterm' ]] \
|
||||
&& [[ -n ${EMACS_VTERM_PATH} ]] \
|
||||
&& [[ -f ${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh ]]; then
|
||||
source ${EMACS_VTERM_PATH}/etc/emacs-vterm-bash.sh
|
||||
|
||||
alias find-file="vterm_cmd find-file"
|
||||
alias magit="vterm_cmd magit"
|
||||
fi
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
emacs --batch --debug-init --load ./.emacs.d/init.el
|
||||
Reference in New Issue
Block a user