diff --git a/config.el b/config.el index 7a67348..1349267 100644 --- a/config.el +++ b/config.el @@ -51,3 +51,57 @@ ;; Set tab width, Doesn't seem to work :( ;; (setq-default tab-width 1) + + +;;;;;;;;;;;;;;;;; +;; Minor Modes ;; +;;;;;;;;;;;;;;;;; + +(defun do-nothing () + "Don't do anything" + (interactive)) + +(define-minor-mode no-backspace-mode + "Disable the backspace key" + :global t + :lighter " noBackspace") + +(defvar no-backspace--emulation-alist + `((no-backspace-mode + . ,(let ((map (make-sparse-keymap))) + (define-key map (kbd "DEL") #'do-nothing) + map)))) + +(add-to-list 'emulation-mode-map-alists 'no-backspace--emulation-alist) + + + +;;;;;;;;;;;;;;;;; +;; HBLang Mode ;; +;;;;;;;;;;;;;;;;; + + +(defvar hblang-mode-syntax-table + (let ((table (make-syntax-table))) + ;; C and C++-style comments. + (modify-syntax-entry ?/ ". 124b" table) + (modify-syntax-entry ?* ". 23" table) + (modify-syntax-entry ?\n "> b" table) + ;; Lisp-style comments. + ;; (modify-syntax-entry ?\; "< b" table) + table) + "Syntax table for `hblang-mode'.") + +(defvar hblang-font-lock-keywords + '(("[a-zA-Z]+" (1 font-lock-function-name-face)) + ("[a-z]" (1 font-lock-variable-name-face))) + "Highlight rules for `hblang-mode'.") + +(define-derived-mode hblang-mode prog-mode "hb" + "Major mode for editing hblang files." + (setq font-lock-defaults '(hblang-font-lock-keywords nil))) + + +(add-to-list 'auto-mode-alist '("\\.hb\\'" . hblang-mode)) + +(provide 'hblang-mode) diff --git a/init.el b/init.el index 908d145..28bd49b 100644 --- a/init.el +++ b/init.el @@ -21,11 +21,12 @@ ;;layout ; auie,ctsrnm is the superior home row :completion - ;;company ; the ultimate code completion backend + company ; the ultimate code completion backend (corfu +orderless) ; complete with cap(f), cape and a flying feather! ;;helm ; the *other* search engine for love and life ;;ido ; the other *other* search engine... - ;;ivy ; a search engine for love and life + ;;ivy + ;;; a search engine for love and life vertico ; the search engine of the future :ui @@ -96,7 +97,7 @@ ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) lookup ; navigate your code and its documentation - ;;lsp ; M-x vscode + lsp ; M-x vscode magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs ;;pass ; password manager for nerds @@ -164,7 +165,7 @@ ;;rest ; Emacs as a REST client ;;rst ; ReST in peace ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} - ;;(rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good ;;(scheme +guile) ; a fully conniving family of lisps sh ; she sells {ba,z,fi}sh shells on the C xor