Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim Latex: Remove command around word/phrase easily

Tags:

vim

latex

I am using vim-latex and I am searching for a solution to delete an attribute/a command around a phrase. E.g.

\textit{\textbf{Foo}}

shall become

\textit{Foo}

somehow. I found the "surroundings"-script which is powerful for single signs but unfortunately cannot achieve my goals.

Any ideas and hints?

like image 518
AnatraIlDuck Avatar asked Oct 27 '25 09:10

AnatraIlDuck


2 Answers

If you have surround.vim by Tim Pope this might do

nmap <silent> dsa ds}dF\
like image 122
Peter Rincker Avatar answered Oct 28 '25 23:10

Peter Rincker


you could do something like

F{dF\ds{

F{  "goes back to the last { before the cursor
dF\ "deletes the attribute
ds{ "deletes the {} (needing the surround-plugin

and put this to a new-vim-command like ds or something but otherwise I don't know either.

like image 21
epsilonhalbe Avatar answered Oct 28 '25 23:10

epsilonhalbe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!