ArLinux.110mb.com | ||
مشاركة: منع Vim من الحفظ مصادفةً إلى ملف مفتوحموليادي سنتوسا [mulyadi.santosa at gmail.com] (Mulyadi Santosa) الأربعاء، 15 أغسطس 2007 16:46:51 +0700 مرحبا بالجميع يستخدم أكثرنا "view" أو "vim -R" لتنفيذ Vim في وضع القراءة فقط، إلا أننا أحيانا نجبر Vim على الحفظ بإصدار الأمر ":w!" لمنع ذلك حاول: "vim -m <اسم الملف>" يمنعك فعلا من كتابة الذاكرة الوسيطة المعدلة إلى الملف المساند. إلا في حالة تفعيل وضع الكتابة يدويا من خلال إصدار الأمر ":set write" استمتع ملحوظة: ... مع التحيات،
مقالات مرتبطة: مصدر المقالة بالانجليزية متوفرة في الاصدار رقم 143 من لينكس غازيت ، ويلي نصها: 2 cent tip: Prevent Vim to accidentally write to opened file
Mulyadi Santosa [mulyadi.santosa at gmail.com] Wed, 15 Aug 2007 16:46:51 +0700 Hello everybody Most of us use "view" or "vim -R" in order to execute Vim in readonly mode. However, sometimes we accidentally force writing by issuing ":w!" command. To prevent this, you can try: $ vim -m <file> It really stops you from writing the modified buffer back to the backing file. The only exception is when you manually turn write mode on via: :set write have fun! NB: Mr. Okopnik, please include this tip in the next LG release if you think this tip is useful for the LG audience. Thanks in advance. regards, Mulyadi. |
||
|
| ||