MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: use vim to edit mathematica file

  • To: mathgroup at
  • Subject: [mg91829] Re: use vim to edit mathematica file
  • From: Bob F <deepyogurt at>
  • Date: Tue, 9 Sep 2008 06:58:05 -0400 (EDT)
  • References: <ga2pmd$p57$>

On Sep 8, 3:02 am, Peng Yu <PengYu... at> wrote:
> Hi,
> It seems the vim front end is too old. I'm wondering if it is
> worthwhile to install it.
> Anyway, I'm trying to use vim to edit mathematica file. But it seems
> the .nb files are full of something like
> Notebook[{
> Cell[BoxData[
>  RowBox[{
> These things are not readable in the text mode. I'm wondering how to
> get rid of these things. How does people usually do when editing
> mathematica files with vim?
> Thanks,
> Peng

You should realize that Mathematica notebook files are much more
complicated than what you see when looking at them with Mathematica's
front end user interface. You normally do not see all the low-level
code, but if you do a "Cell/Show Expression" menu command for any
highlighted cell(s) you will see the low level code that actually
makes up the cell as you see it. You can also see it if you edit the
file with any text editor, but you need to be very careful editing
this low level code and don't ever try to edit a file with vim/vi that
Mathematica has open.

It is very easy to break this low level code and very prone to making
errors unless you are VERY careful. All the commands you see in vim/vi
or any text editor can be looked up in Mathematica's Help window if
you are curious. In general I have found it not worthwhile editing the
low level code, but occasionally this code has gotten corrupted and
the only recourse was to edit it in vim/vi and attempt to fix it - but
only as a last resort.


  • Prev by Date: Re: use vim to edit mathematica file
  • Next by Date: Error in file / load entire notebook into memory
  • Previous by thread: Re: use vim to edit mathematica file
  • Next by thread: Re: I am having some problem manipulating mathematica expressions