From 1d9121b6e716563b502252f621f81f0f95d5ea93 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sun, 9 Mar 2025 21:28:36 +0200 Subject: Add arkta-progmodes.el, add stuff from init.el --- arkta/arkta-progmodes.el | 250 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 arkta/arkta-progmodes.el (limited to 'arkta') diff --git a/arkta/arkta-progmodes.el b/arkta/arkta-progmodes.el new file mode 100644 index 0000000..06d736b --- /dev/null +++ b/arkta/arkta-progmodes.el @@ -0,0 +1,250 @@ +;; -*- lexical-binding: t -*- +;; Copyright © 2018-2025 Uko Koknevics + +(use-package c-ts-mode + :after treesit + :straight '(c-ts-mode :type built-in) + :mode ("\\.c\\'" + ("\\.cpp\\'" . c++-ts-mode)) + :init + (defun arkta/c-setup () + (set-tab-usage t) + (set-tab-width c-ts-mode-indent-offset)) + :hook (c-ts-base-mode . arkta/c-setup) + :custom + (c-ts-mode-indent-offset 8) + (c-ts-mode-indent-style (lambda () + `(((node-is ")") parent-bol 0) + ((node-is "}") parent-bol 0) + ((node-is "access_specifier") parent-bol 0) + ((parent-is "argument_list") parent-bol c-ts-mode-indent-offset) + ((parent-is "parameter_list") parent-bol c-ts-mode-indent-offset) + ((parent-is "field_declaration_list") parent-bol c-ts-mode-indent-offset) + ,@(alist-get 'linux (c-ts-mode--indent-styles 'c)))))) + +(use-package cmake-ts-mode + :after treesit + :straight '(cmake-ts-mode :type built-in) + :mode ("CMakeLists\\.txt\\'" + "\\.cmake\\'")) + +(use-package csharp-mode + :after treesit + :straight '(csharp-mode :type built-in) + :mode "\\.cs\\'") + +(use-package css-mode + :after treesit + :straight '(css-mode :type built-in) + :mode "\\.css\\'") + +(use-package dart-mode + :straight t + :mode "\\.dart\\'") + +(use-package dockerfile-ts-mode + :after treesit + :straight '(dockerfile-ts-mode :type built-in) + :mode "Dockerfile\\'") + +(use-package ebuild-mode + :straight t + :mode ("\\.ebuild\\'" + "\\.eclass\\'")) + +(use-package elisp-mode + :straight '(elisp-mode :type built-in) + :mode ("\\.el\\'" . emacs-lisp-mode) + :init + (use-package auto-compile + :straight t + :hook ((emacs-lisp-mode . auto-compile-on-load-mode) + (emacs-lisp-mode . auto-compile-on-save-mode)))) + +(use-package elixir-mode + :straight t + :mode "\\.exs?\\'" + :init + (defun arkta/elixir-setup () + (add-hook 'before-save-hook #'elixir-format nil t)) + :hook (elixir-mode . arkta/elixir-setup)) + +(use-package gdscript-mode + :straight t + :mode "\\.gd\\'") + +(use-package go-ts-mode + :after treesit + :straight '(go-ts-mode :type built-in) + :mode "\\.go\\'" + :init + (defun arkta/go-setup () + (add-hook 'before-save-hook #'gofmt-before-save nil t) + (set-tab-usage t) + (set-tab-width go-ts-mode-indent-offset)) + :hook (go-ts-mode . arkta/go-setup)) + +(use-package groovy-mode + :straight t + :mode ("Jenkinsfile\\'" + "\\.gradle\\'" + "\\.groovy\\'")) + +(use-package haskell-mode + :straight t + :mode "\\.hs\\'") + +(use-package java-ts-mode + :after treesit + :straight '(java-ts-mode :type built-in) + :mode "\\.java\\'") + +(use-package js + :after treesit + :straight '(js :type built-in) + :mode ("\\.js\\'" . js-ts-mode)) + +(use-package json-ts-mode + :after treesit + :straight '(json-ts-mode :type built-in) + :mode "\\.json\\'") + +(use-package lisp-mode + :straight '(lisp-mode :type built-in) + :mode "\\.lisp\\'" + :init + (use-package slime + :straight t + :after lisp-mode + :commands slime + :custom + (inferior-lisp-program (executable-find "sbcl")))) + +(use-package lua-mode + :straight t + :custom + (lua-indent-level 4) + :mode ("\\.lua\\'" "\\.rockspec\\'")) + +(use-package make-mode + :straight '(make-mode :type built-in) + :mode (("Makefile\\'" . makefile-gmake-mode) + "GNUmakefile\\'" + "\\.mk\\(\\.template\\)?\\'")) + +(use-package markdown-mode + :straight t + :mode ("\\.md\\'" . gfm-mode)) + +(use-package nasm-mode + :straight t + :mode ("\\.asm\\'" + "\\.inc\\'") + :init + (defun arkta/nasm-setup () + (set-tab-width 4)) + :hook (nasm-mode . arkta/nasm-setup)) + +(use-package nix-mode + :straight t + :mode "\\.nix\\'") + +(use-package nxml-mode + :straight '(nxml-mode :type built-in) + :mode ("\\.xml\\'" + "\\.plist\\'" + "\\.svg\\'")) + +(use-package org + :straight '(org :type built-in) + :bind (("C-c l" . org-store-link) + ("C-c a" . org-agenda)) + :mode ("\\.org\\'" . org-mode) + :init + (use-package htmlize + :straight t) + :custom + (org-agenda-files '("~/TODO.org")) + (org-log-done t)) + +(use-package php-mode + :straight t + :mode "\\.php\\'") + +(use-package pico8-mode + :straight '(pico8-mode :host github + :repo "Kaali/pico8-mode") + :mode "\\.p8\\'") + +(use-package prolog + :straight '(prolog :type built-in) + :mode ("\\.pl\\'" . prolog-mode)) + +(use-package python + :after treesit + :straight '(python :type built-in) + :mode ("\\.py\\'" . python-ts-mode)) + +(use-package ruby-ts-mode + :after treesit + :straight '(ruby-ts-mode :type built-in) + :mode "\\.rb\\'") + +(use-package rust-ts-mode + :after treesit + :straight '(rust-ts-mode :type built-in) + :mode "\\.rs\\'") + +(use-package scala-mode + :straight t + :mode "\\.scala\\'") + +(use-package scheme + :straight '(scheme :type built-in) + :commands scheme-mode + :mode ("\\.scm\\'" . scheme-mode) + :config + (put 'module 'scheme-indent-function 2)) + +(use-package smalltalk-mode + :straight t + :mode "\\.st\\'") + +(use-package svelte-mode + :straight t + :mode ("\\.svelte\\'" "\\.svx\\'")) + +(use-package sml-mode + :straight t + :mode "\\.sml\\'" + :init + (use-package company-mlton + :after company + :straight '(company-mlton :host github + :repo "MatthewFluet/company-mlton") + :hook (sml-mode . company-mlton-init))) + +(use-package toml-ts-mode + :after treesit + :straight '(toml-ts-mode :type built-in) + :mode "\\.toml\\'") + +(use-package typescript-ts-mode + :after treesit + :straight '(typescript-ts-mode :type built-in) + :mode "\\.ts\\'") + +(use-package typst-mode + :straight t + :mode "\\.typ\\'") + +(use-package yaml-ts-mode + :after treesit + :straight '(yaml-ts-mode :type built-in) + :mode "\\.ya?ml\\'") + +(use-package zig-mode + :straight t + :mode "\\.zig\\'") + +(provide 'arkta-progmodes) -- cgit v1.2.3