From e8e076d85fd8ae84baee8ea1dc037ef7de22e02d Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Wed, 2 Feb 2022 22:19:55 +0100 Subject: [PATCH] Migrate universal-ctags setup to home-manager As we add more and more files, move to set with curly braces. Maybe home-files is a better approach, but not documented and I don't understand it to well yet. I guess I've to create a derivation which "builds" all the files. Maybe to complicated right now. Might also make sense to build modules for such tools in future where I can configure within nix, just like git.nix, and it will generate the config. Might be cool for some things where configs might change, but the actual things to configure might not. The generation of the file can change within nix, while configuration within nix stays the same?! ;) --- home.nix | 6 ++- home/files/ctags | 97 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 home/files/ctags diff --git a/home.nix b/home.nix index e0b773e..e22684c 100644 --- a/home.nix +++ b/home.nix @@ -37,6 +37,7 @@ pkgs.mycli pkgs.mkcert pkgs.tig + pkgs.universal-ctags # Writing pkgs.languagetool @@ -51,7 +52,10 @@ }; }; - home.file.".myclirc".source = ./home/files/myclirc; + home.file = { + ".myclirc".source = ./home/files/myclirc; + ".config/ctags/config".source = ./home/files/ctags; + }; services.dunst = import ./home/configurations/dunst.nix; diff --git a/home/files/ctags b/home/files/ctags new file mode 100644 index 0000000..110e6bc --- /dev/null +++ b/home/files/ctags @@ -0,0 +1,97 @@ +-R +--recurse +--maxdepth=20 +--tag-relative=yes + +--exclude=.DS_Store +--exclude=*.git* +--exclude=*.hg* +--exclude=*.orig +--exclude=*.rej +--exclude=*.pyc +--exclude=*.pyo +--exclude=*uploads* +--exclude=*Data/* +# --exclude=*Build/* +--exclude=*Documentation-GENERATED-temp/* +--exclude=*typo3temp/* +--exclude=*vendor/composer* +--exclude=*node_modules/* + +--exclude=*typo3_src* + +--exclude=*tcpdf/examples* +--exclude=*_Resources* +--exclude=*typo3export* + +--langmap=php:.engine.inc.module.theme.install.php + +# --langmap=css:.css.less.scss +# --regex-css=/^[ \t]*@([A-Za-z0-9_-]+)/@\1/v,var,variables/ +# --regex-css=/^[ \t]*\.([A-Za-z0-9_-]+)/.\1/c,class,classes/ +# --regex-css=/^[ \t]*#([A-Za-z0-9_-]+)/#\1/i,id,ids/ +# --regex-css=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/ +# --regex-css=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/ +# --regex-css=/^[ \t]*\/\*\s*(.*)\s*\*\//\1/k,comment,comments/ + +# Testable with http://regexraptor.net/ +--regex-html=//\1/c,comment,comments/ +--regex-xml=/id="(.*)"/\1/i,id,ids/ + +# https://github.com/jb55/typescript-ctags/blob/master/.ctags +--langdef=typescript +--langmap=typescript:.ts +# From vim yats bundle +--regex-typescript=/^[ \t]*(export)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\2/c,classes/ +--regex-typescript=/^[ \t]*(export)?[ \t]*abstract class[ \t]+([a-zA-Z0-9_]+)/\2/a,abstract classes/ +--regex-typescript=/^[ \t]*(export)?[ \t]*module[ \t]+([a-zA-Z0-9_]+)/\2/n,modules/ +--regex-typescript=/^[ \t]*(export)?[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\2/t,types/ +--regex-typescript=/^[ \t]*(export)?[ \t]*namespace[ \t]+([a-zA-Z0-9_]+)/\2/n,modules/ +--regex-typescript=/^[ \t]*(export)?[ \t]*function[ \t]+([a-zA-Z0-9_]+)/\2/f,functions/ +--regex-typescript=/^[ \t]*export[ \t]+(var|const|let)[ \t]+([a-zA-Z0-9_]+)/\1/v,variables/ +--regex-typescript=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)[ \t]*=[ \t]*function[ \t]*\(\)/\1/l,varlambdas/ +--regex-typescript=/^[ \t]*(export)?[ \t]*(public|private)[ \t]+(static|readonly)?[ \t]*([a-zA-Z0-9_]+)/\4/m,members/ +--regex-typescript=/^[ \t]*(export)?[ \t]*interface[ \t]+([a-zA-Z0-9_]+)/\2/i,interfaces/ +--regex-typescript=/^[ \t]*(export)?[ \t]*(const)?[ \t]*enum[ \t]+([a-zA-Z0-9_]+)/\3/e,enums/ +# Hack to add tests from jest to ctrlp +--regex-typescript=/^[ \t]*test\('(.*)'.*/\1/s,test/ +--regex-typescript=/^[ \t]*test\.todo\('(.*)'.*/\1/o,testtodo/ +--regex-typescript=/^[ \t]*describe\('(.*)'.*/\1/d,describe/ + +--langdef=apache +--langmap=apache:.conf +--regex-apache=/Server(Name|Alias) ([0-9a-zA-Z\._-]+)/\2/s,server,servers/ + +--langdef=yaml +--langmap=yaml:.yaml.yml +--regex-yaml=/^([a-zA-Z0-9_.:]*):.*$/\1/t,toplevel/ + +--fields=* +# --*-kinds=* +--html-kinds=si +--php-kinds=-la + +--languages= +--languages=+c +# --languages=+css +# --languages=+go +--languages=+php +--languages=+apache +# --languages=+ruby +--languages=+python +# --languages=+reStructuredText +# --languages=+Markdown +--languages=+SQL +# --languages=+Make +--languages=+Vim +--languages=+xml +--languages=+html +--languages=+typescript +# --languages=+java +--languages=+yaml +# vim: commentstring=#%s ft=conf