私は、Mac OS X上の端末でVimのエディタにウェブサイトmatplotlib&ペーストからコードをコピーしています:これはBBEditで正常に動作している間のMac OS X上でのVimで厄介先頭の空白を削除し
pylab_examples example code: ellipse_demo.py
:
`from pylab import figure, show, rand
from matplotlib.patches import Ellipse
NUM = 250
ells = [Ellipse(xy=rand(2)*10, width=rand(), height=rand(), angle=rand()*360)
for i in xrange(NUM)]
fig = figure()
ax = fig.add_subplot(111, aspect='equal')
for e in ells:
ax.add_artist(e)
e.set_clip_box(ax.bbox)
e.set_alpha(rand())
e.set_facecolor(rand(3))
ax.set_xlim(0, 10)
ax.set_ylim(0, 10)
show()
つまり、すべてのコードが正しく整列されています。 Vimでは、次のようになります。
from pylab import figure, show, rand
from matplotlib.patches import Ellipse
NUM = 250
ells = [Ellipse(xy=rand(2)*10, width=rand(), height=rand(), angle=rand()*360)
for i in xrange(NUM)]
fig = figure()
ax = fig.add_subplot(111, aspect='equal')
for e in ells:
ax.add_artist(e)
e.set_clip_box(ax.bbox)
e.set_alpha(rand())
e.set_facecolor(rand(3))
ax.set_xlim(0, 10)
ax.set_ylim(0, 10)
show()
この厄介な状況を修正するにはどうすればいいですか?それはMacでの異なるキャリッジリターン/改行規則と関係がありますか?
それを試してみました。グレッグ - まだ動作しません。 –
これから何を提案するのかよくわかりません。あなたが記述しているのは、正確には、 ':set paste'コマンドが解決するように設計されているという問題です。私は同じ問題に直面しているときはいつでもそれを使用し、それは私のために働く。 –
その前のコメントは私のものです。ここロンドンの夜は、明らかに遅すぎる!それは働いた。 Gregさん、ありがとうございました。 –