ctags-lang-iPythonCell(7)

πŸ“¦
version 6.2.1 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

ctags-lang-iPythonCell β€” bestie, this is the man page for the iPythonCell parser in Universal Ctags ✨


πŸŽ€ SYNOPSIS πŸŽ€

ctags ... --extras=+{subparser} --languages=+iPythonCell,Python \
  [--extras-IPythonCell=+{doubleSharps}] \
  [--regex-IPythonCell=/<PATTERN>/\n/c/] ...

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so, the iPythonCell parser is a subparser that's stacked on top of the Python parser. It only does its thing when all three of these are true:

  • the Python parser is enabled,
  • the subparser extra is enabled, and
  • the iPythonCell parser itself is enabled.

Once it's living its best life, it pulls out cells β€” exactly the way they're explained over in vim-ipython-cell (<https://github.com/hanschen/vim-ipython-cell/blob/master/README.md>). no cap πŸ’…


🌸 KIND(S) 🌸

The iPythonCell parser defines only one kind: a cell kind. That's it. That's the whole list. minimal, iconic, periodt πŸ‘‘


✨ EXTRA(S) ✨

Tagging cells that start with ##... is disabled by default, and honestly? For good reason β€” that pattern is way too generic, and if you turn it on as-is you can end up with a whole mess of unwanted tags. it's giving chaos 😭

If you want it, enable the doubleSharps language specific extra, and then cells starting with ##... get tagged too 🫢


πŸ’… CUSTOMIZING πŸ’…

Okay so if your fave cell pattern isn't supported out of the box, you can define it yourself β€” either in your .ctagd.d/your.ctags or right on the command line. Here's a lil example of how to support # CTAGS: ... πŸ‘‡

"input.py"

x=1
# CTAGS: DEFINE F
def F():
        # CTAGS: DO NOTING
        pass

"output.tags" with --options=NONE --sort=no --extras=+{subparser} --regex-IPythonCell=/[ t]*# CTAGS:[ ]?(.*)$/1/c/ -o - input.py

x    input.py        /^x=1$/;"       v
DEFINE F     input.py        /^# CTAGS: DEFINE F$/;" c
F    input.py        /^def F():$/;"  f
DO NOTING    input.py        /^      # CTAGS: DO NOTING$/;"  c

And pro tip bestie: you can drop --regex-IPythonCell=/[ \t]*# CTAGS:[ ]?(.*)$/\1/c/ straight into your .ctags file so you don't have to keep typing that pattern over and over again. your wrists will thank you πŸ’œ


🌈 SEE ALSO 🌈


Version 6.2.1 of Universal Ctags, mwah πŸ’‹ go tag some cells, you absolute icon 🧚⭐

πŸ“¦ where this page comes from