If an originally-binary plist is saved as plain text due to syntax errors and you fix the errors and save the file again, it is written in binary format. If you open a binary file and just view it without making any changes, you can still exit from vim using the normal:q (no need for:q!) and the file is left untouched (still in binary format). About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features Press Copyright Contact us Creators. Bundled vim in Mac OS X 10.5 and Exit code Showing 1-6 of 6 messages. Bundled vim in Mac OS X 10.5 and Exit code: jjgod: 11/3/07 2:43 AM: Hi.
Click here to return to the '10.4: Edit binary (and normal) plist files with vim' hint |
This is fantastic. I just stuck it at the bottom of my .vimrc file and it works great. Thanks VERY VERY much for making this public.
Vi How To Exit
Michael.
I just see that the code for the alternative method I mention has been mangled (I guess because it contains <
and >
). So replace: with (that's literal). Just in case somebody want to try that out.
P.S.: @ Rob: There is something annoying goind with the comment editing:
If I enter something as <code><</code>
to get the less than sign <
in yellow code style and press preview, the result is shown OK.
BUT: In the editing window, this less sign just entered is transformed from a <
to <
. So if you edit some more and the submit, things like a less than sign are not properly encoded as HTML entities anymore.
So basically every time you press preview, you need to re-encode the HTML entities so they show up OK when finally submitting. I experienced this while composing this comment and this must have been the cause for the omission.
Note: This applies only to the inline <code>
, not to the special
Anywat, you get the point I think... The last part should've been:
Note: This applies only to the inline <code>
, not to the special [
code]
(which starts a new paragraph so is not always what you want). This behavior might be standard-compliant, but it sure is annoying and dangerous when editing lenghty posts. So anyone else, be warned.
P.P.S.: You can imagine getting something like
<code><</code>
in this comment isn't so easy... :)
Crap! You beat the Emacs guys' attempts at getting this right! (Emacs ones don't memorize the original binary/text format.)
Okay. You win this one... But watch your back!
:Pie
---
-Pie
Cool hint!
I don't seem to have a .vimrc file on my system (running Tiger).
Will this still work if I add the script to the .viminfo file (located in home folder)?
PS
.viminfo gets a current timestamp when I run vi.
geohar is right. Don't add it to ~/.viminfo as this only memorizes in which line you were for each file, what recent searched you have perfomed etc.
~/.vimrc (vim run commands) is the file vim scans each time you open vim to edit a file. There is none by default, but you can create one. Either just start with an empty file or you can copy the file /usr/share/vim/vim62/vimrc_example.vim and append the script from the hint at the bottom. That way, you also get some nice features that are not enabled by default.
I'm running 10.4.2 (fresh install) and I don't have the devices /dev/stdin and /dev/stdout. I'd mknod them, but I'm not sure how, and I don't think that would persist across a reboot. Is there any way to get the system to provide those devices, or is there an alternative?
For anyone who's getting the plutil help message instead of a file, just replace the lines:
'[,']!plutil -convert xml1 /dev/stdin -o /dev/stdout
and
silent '[,']!plutil -convert binary1 /dev/stdin -o /dev/stdout
with:
'[,']!plutil -convert xml1 -i /dev/stdin -o /dev/stdout
and
silent '[,']!plutil -convert binary1 -i /dev/stdin -o /dev/stdout
To quit (close) a Mac app normally, choose Quit from the app's menu in the menu bar, or press Command (⌘)-Q. If the app doesn't quit, follow these steps to force the app to quit.
How to force an app to quit
Press these three keys together: Option, Command, and Esc (Escape). Or choose Force Quit from the Apple menu in the upper-left corner of your screen. (This is similar to pressing Control-Alt-Delete on a PC.)
Then select the app in the Force Quit window and click Force Quit.
You can even force the Finder to quit, if it stops responding: Select Finder in the Force Quit window, then click Relaunch.
Mac Os Vi Save And Exit Command
Learn more
Command Vi Save And Exit
How to force an app to close on your iPhone, iPad, or iPod touch.