Skip to content

Latest commit

 

History

History
162 lines (160 loc) · 8.88 KB

plans.org

File metadata and controls

162 lines (160 loc) · 8.88 KB

Plans

End of the Line

Text object for table cells

fix envs not understanding nesting, adapt delim algorithm

unify $ and m, paritally unify m and M

unify m and M for surround deletion and change, but not insertion

Check customizations suggested in the readme

Add notes about interactions with other packages in readme

  • Surround
  • Embrace
  • Which-key
  • Snipe

Bind the tab-like movement to some key

change mtS functionality to change name of section

fix sub/superscript textobjects

Reach out to the original evil-LaTeX-txtobjs author

bind textobjects on local keymap

Bug when defining custom envs:

if you use the cons definition in the envs-alist, you need to include the \n’s in order for it to format correctly. This not only breaks the newline variable convention, it also causes which-key to bug out as it takes \n to be part of the name

Make cse respect options like [foo] when newline is on

fix env textobject edge case

for [foo]’s after a newline that are considered inputs here.

fix bug of tsd on ()

think about changing overlays in toggles

currently we have an-over and in-over, right-over and left-over might make more sense in some cases.

No need to get rid of code duplication when binding textobjects

refactor evil-tex--select-table-cell because dear god

add various \big’s to the delim text object, prob with a macro.

Consider using interactive for keymap reads

Its more fluent in elisp. Nothing to do anymore, because evil-surround doesn’t call the functions it reads interactively so

Go over all documentation, and make it better

Particularly the one under define-minor-mode. Also probably delete test.tex

have final look at README

Restructure. Maybe move appendix to seperate file, maybe add recomended plugins section.

Restructure order of all the functions so it makes more sense (if need be).

cse doesn’t work when you do it on the last } of the end.

Auctex TeX-find-macro-start bug

when on the bolded bracket of \frac{N!}{(N-i+1 ) !(i+1)!}, TeX-find-macro-start returns nil which ruins the command text object sometimes

  • Implement it ourselves?
  • Send bug report / contribute to auctex
  • Work around, detecting if its nil and and if so go back a few chars

tsf toggle \frac{a}{b} <-> a/b

Final stress test

Take a copy of Itai’s main.tex and make sure everything works as expected on a real document

Tag release as 1.0, upload to MELPA

send links to places.

Bugfixes

Features

Text Objects

For environments, commands/macros, inline & display math

Make Text Objects Work with Surround

Make the env newline rational

Currently the newline behavior is erratic. \begin{…} \end{…} should always appear in lines of their own.

Math

Define math surrounding behavior: inline or display?

Add a new txt obj M only for display math

m would still match \], but when changing something to a math env m would be for inline math and M for display.

m is only for inline; use the flag.

m would only insert inline, for display insert an equation env*, and with the flag it would result in a \].

evil-surround like bindings for toggling inline/display math

Redundant with:

  • The M txt obj: user would just press csmM

General delimiter text object, with integration to evil-surround

create delimiter text object

integrate with surround

add prompt

Environment changing

This is the csd/cse/tsd/tse commands from vimtex

Vimtex way - minibuffer with evil-surrountd

Just through a prompt. That would be through the minibuffer in Emacs.

Using an alias table

texmathp-environments is useful so I put it here. After doing cse you would will be able to enter one letter aliases to immediately change the enviornment, e.g. csea for changing to align, or cseE for changing to equation*.

  • One mapping, e.g. csez, will be reserved for entering a prompt so you can

fully type out the thing.

  • This is a very vimish way: i.e csea would be mapped to align environment
  • Aliases would be customizable
  • Have a Menu for an overview of the aliases

CDLaTeX-tab-like movement (implemented already)

Steal some more stuff from vimtex

section text object iS aS

add ]] etc motions, see evil-forward-section etc

maybeeeeee still do the toggle?

Misc

Add beamer or other envs to the env keymap

Sub/superscript text objects

change inside/around sub/superscript ci^ ci_ which would jump to the closest sub/superscript

  • Would not work with surround-stuff, only c/d commands. Just thought it might be useful (Say you quickly want to change a sigma index…)

Proposed

Rejected

Support math envs (begin{align}…) with math text objects

  • Use tsm to toggle between begin{align} and begin{equation} (It already toggles between \(\) and \[\])

    I don’t use begin{equation} at all, only \[\]. In amsmath, \[\] are defined just to yield a begin{equation*}.... If we support toggling only equation and align, getting from \[\] to align wouldn’t be nice.

Itai: I thought we agreed that it would be best to just have a way for the user to decide how this acts because there is no good universal option.

Mark the environment being changed while user changing it

Would be hard as currently it’s implemented with surround which deletes the surrounding delimiters (doesn’t mark them). This is exactly what evil-goggles does. We can either:

  • Just add a similar functionality to our plugin
  • Add an optional integration to evil-goggles in this repo
  • Add an integration with goggles in the goggles plugin (this sounds odd but goggles has built-in integration with evil-surround and other plugins)

Add stuff to thing-at-point so a backslash is considered part of a symbol

I’m not so sure of the interactive use of this, as cio (change inner symbol) would be the same as csm (change surrounding macro). However, there are other things that use symbol-at-point (such as project search), which is why it might be useful

Far Future

Appendix

Keybinds

ModeKeybindAction
NormalcsdChange surrounding delimiter (see id/ad)
cseChange environment
cscChange command (should be acessable from any brace e.g. ==\frac{}{:}==)
tsdToggle surrounding delimiter, e.g. (f:oo) <===> \left(f:oo\right)
tseFor surrounding environment, equation <==> equation*, or align <==> align*
tsmFor surrounding math, \(\) <==> \[\]
dseDelete surrounding environment
dscDelete surrounding command, \tilde{a} > =a
Text objectsie, aeSelect inside/around environment
ic, acSelect inside/around command (macro)
im, amSelect inside/around math
id, adSelect inside/around delimiter (math parentheses), e.g. (), [], \left[\right].
Insert?Brace movement

Things to add to Doom in another repo later

TeX-fold flag

would define bindings and advices for TeX-fold

Folding

Doom has its own folding module, which tries hideshow, outline-minor-mode, and vimish-fold. We should probably override its keybinds, as we know whats best for LaTeX.

  • [ ] Show labels on folds

Sections, subsections

Auctex configure outline-minor-mode (which is part of Emacs). We just need to hook outline and set a keybind to try to fold using outline.

Environments

Done in doom-emacs/#2818.

Have an org-like cycle functionality, start the buffer folded

latex-extra does it, but it only uses outline for section folding (not env).