zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
3.09k stars 128 forks source link

Tags get generated to a .TAGS dotfile to then replace TAGS via hardlinks #389

Closed psprint closed 1 year ago

psprint commented 2 years ago

Basically:

ctags … -f .TAGS
ln -f .TAGS TAGS
rm -f .TAGS

for lowest possible inconsistency time when regenerating index.

Also, pass -G option to universal-ctags, so that shell files without .zsh extension get recognized by file constents (hashbangs and vim/emacs modelines). Also fixed modeline in zi-browse-symbol because it wasn't recognized.

Motivation and Context

When an editor reloads the file when its timestamp changes it might read incomplete contents. The hardlink way should be best possible (however it probably does the same what mv -f .TAGS TAGS does, but it's good to be as much explicit as possible).

Related Issue(s)

Usage examples

# Establish auto make every 5 seconds with `zservices/make-server`
zinit lucid service'make' param'MSERV_CONF_DIRS→~/github/zinit;
         MSERV_CONF_INTERVAL→5;MSERV_ARGS→tags-emacs' \
            for zservices/make-server

To then browse tags with Ctrl-k (or Alt-Shift-q after #387).

Types of changes

Checklist:

psprint commented 1 year ago

It's a documentation for the feature of browsing Ctags index and ln -f A B ; rm -f A robustness trick, safe to merge. It'l publish the extra feature of TAGS browser. Could it be merged, @vladdoster ?

psprint commented 1 year ago

Closed because overlaps #402,