From d907b7b8f0aecee0f9eba12b09b929d720d07a8d Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Tue, 20 Feb 2024 00:53:48 +0300 Subject: 2024-02-20 --- modules/common/common/shell/functions.bash | 56 +++++++++++++++--------------- modules/common/editorconfig.nix | 10 ++++-- modules/common/emacs/default.nix | 10 +----- modules/common/emacs/doom/config.el | 32 ++--------------- 4 files changed, 40 insertions(+), 68 deletions(-) (limited to 'modules/common') diff --git a/modules/common/common/shell/functions.bash b/modules/common/common/shell/functions.bash index d947d0f..f354adb 100644 --- a/modules/common/common/shell/functions.bash +++ b/modules/common/common/shell/functions.bash @@ -1,59 +1,59 @@ function where() { - local s - s="$(type -P "$1")" - realpath "$s" + local s + s="$(type -P "$1")" + realpath "$s" } complete -F _command where function what() { - local s - s="$(where "$1")" - printf "%s\n" "${s%/*/*}" + local s + s="$(where "$1")" + printf "%s\n" "${s%/*/*}" } complete -F _command what function cat() { - if (($# == 1)) && [[ -d $1 ]]; then - ll "$1" - else - command cat "$@" - fi + if (($# == 1)) && [[ -d $1 ]]; then + ll "$1" + else + command cat "$@" + fi } function cd() { - builtin cd "$@" && - if ((${#FUNCNAME[@]} == 1)); then - ls - fi + builtin cd "$@" && + if ((${#FUNCNAME[@]} == 1)); then + ls + fi } function mkcd() { - mkdir -p "$1" && builtin cd "$1" + mkdir -p "$1" && builtin cd "$1" } function mvcd() { - mv -i -- "$PWD" "$1" && builtin cd . + mv -i -- "$PWD" "$1" && builtin cd . } function bak() { - local f - for f; do - cp -ai -- "$f" "$f.bak" - done + local f + for f; do + cp -ai -- "$f" "$f.bak" + done } function ubak() { - local f - for f; do - [[ $f == *.bak ]] || f="$f.bak" - mv -i -- "$f" "${f%.bak}" - done + local f + for f; do + [[ $f == *.bak ]] || f="$f.bak" + mv -i -- "$f" "${f%.bak}" + done } function dec2hex() { - printf "0x%X\n" "$1" + printf "0x%X\n" "$1" } function hex2dec() { - printf "%d\n" "0x$1" + printf "%d\n" "0x$1" } diff --git a/modules/common/editorconfig.nix b/modules/common/editorconfig.nix index 822acf6..537912f 100644 --- a/modules/common/editorconfig.nix +++ b/modules/common/editorconfig.nix @@ -29,7 +29,7 @@ in { }; # https://go.dev/doc/effective_go#formatting - "*.go" = { + "{*.go,go.mod}" = { indent_size = 2; indent_style = "tab"; }; @@ -66,7 +66,7 @@ in { indent_style = "space"; }; - "*.{asm,s}" = { + "*.{asm,s,S}" = { indent_size = 4; indent_style = "spaces"; }; @@ -90,6 +90,12 @@ in { indent_style = "space"; }; + # https://nickel-lang.org/user-manual/syntax + "*.ncl" = { + indent_size = 2; + indent_style = "space"; + }; + # https://developer.hashicorp.com/terraform/language/syntax/style "*.{tf,hcl}" = { indent_size = 2; diff --git a/modules/common/emacs/default.nix b/modules/common/emacs/default.nix index 082b3c3..439a6bc 100644 --- a/modules/common/emacs/default.nix +++ b/modules/common/emacs/default.nix @@ -71,6 +71,7 @@ in { cmigemo # :lang japanese config.hm.programs.emacs.package # !doom config.nix.package # !doom + delve # :lang go :tools debugger dockerfile-language-server-nodejs # :tools (docker +lsp) dockfmt # :tools docker :editor format editorconfig-core-c # :tools editorconfig @@ -198,7 +199,6 @@ in { org-plantuml-jar-path plantuml-jar-path org-plantuml-executable-path plantuml-executable-path) - ;; :app irc (setq circe-default-nick "${my.username}" circe-default-realname "${my.email}" @@ -248,14 +248,6 @@ in { # https://github.com/akermu/emacs-libvterm 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" - - message() { - vterm_cmd message "%s" "$*" - } - - find-file() { - vterm_cmd find-file "$(realpath "''${@:-.}")" - } fi # Not sourced from inside Emacs for some reason. Maybe it's not diff --git a/modules/common/emacs/doom/config.el b/modules/common/emacs/doom/config.el index 13eb5ba..70116f8 100644 --- a/modules/common/emacs/doom/config.el +++ b/modules/common/emacs/doom/config.el @@ -64,41 +64,15 @@ ("HOLD" . +org-todo-onhold) ("PROJ" . +org-todo-project) ("KILL" . +org-todo-cancel)) - org-capture-templates '(("t" "Personal todo" entry + org-capture-templates '(("t" "Todo" entry (file+headline +org-capture-todo-file "Inbox") "* TODO %?\n%i\n%a" :prepend t) - ("n" "Personal notes" entry + ("n" "Note" entry (file+headline +org-capture-notes-file "Inbox") "* %u %?\n%i\n%a" :prepend t) ("j" "Journal" entry (file+olp+datetree +org-capture-journal-file) - "* %U %?\n%i\n%a" :prepend t) - ("p" "Templates for projects") - ("pt" "Project-local todo" entry - (file+headline +org-capture-project-todo-file "Inbox") - "* TODO %?\n%i\n%a" :prepend t) - ("pn" "Project-local notes" entry - (file+headline +org-capture-project-notes-file "Inbox") - "* %U %?\n%i\n%a" :prepend t) - ("pc" "Project-local changelog" entry - (file+headline +org-capture-project-changelog-file "Unreleased") - "* %U %?\n%i\n%a" :prepend t) - ("o" "Centralized templates for projects") - ("ot" "Project todo" entry - (function +org-capture-central-project-todo-file) - "* TODO %?\n %i\n %a" - :heading "Tasks" - :prepend nil) - ("on" "Project notes" entry - (function +org-capture-central-project-notes-file) - "* %U %?\n %i\n %a" - :heading "Notes" - :prepend t) - ("oc" "Project changelog" entry - (function +org-capture-central-project-changelog-file) - "* %U %?\n %i\n %a" - :heading "Changelog" - :prepend t)))) + "* %U %?\n%i\n%a" :prepend t)))) (add-hook! 'org-mode-hook 'auto-fill-mode) -- cgit v1.2.3