|
|
#1 |
|
Replacing Text Edit As Default Text Editor Help
Hey,
I despise TextEdit. I've used VI since I've been using computers so naturally I took very well to MacVim. Though I want to set it as my default editor for editing blank files (plain UTF-8 text files without an extension). So I threw the .app inside of a folder named "oldTextEdit" and created a symlink to MacVim and named it TextEdit.app and placed it in /Applications, but it doesn't work. When I go to the command line and type "open -e" it still opens with TextEdit.app - The only thing I can think of is that it ignores symlinks (or as mac calls them, an "alias.") I moved TextEdit.app to another drive and my alias worked fine on double clicking a blank file, it opened up MacVim. BUT - if I go to terminal and type "open -e" it opened up TextEdit (not sure how). Now when I click that same UTF-8 blank text file (created using "touch") it opens in TextEdit (again, I have no clue how, TextEdit.app is on a different drive). Update: I zipped up TextEdit.app and now when I open blank text files it opens in MacVim like it should. This time when I type "open -e" it throws the following error: LSGetApplicationForInfo() failed with error -10814 while trying to determine the application with bundle identifier com.apple.TextEdit. Which I guess is fine, as long as in the GUI is opening with MacVim instead of TextEdit... Anybody have any ideas on the proper way of doing this? I realize it involves the LaunchServices.framework database, but I can't figure out how to use that for hell. I realize to some this is a weird request, so I ask if you don't have any good input you just ignore it. Thank you for your time. |
|
|
|
0
|
|
|
#2 |
|
|
0
|
|
|
#3 | |
|
Quote:
That was the first thing I tried, before I started linking everything. The only problem is that mac seems to have a big problem for defining an application to open files where "type" is null and "extension" is null, since it's a blank/flat UTF-8 text file it has none of the above, the GUI extension of "open" in which you change what opens it via "Get Info" depends on the extension and the mime type, which this has neither. It'll let me change it for each individually, but obviously that's a pain, if I click "Change All" it throws an error saying: "An error occured whioe changing the application that opens "filename" because not enough information is available. Do you want to open "filename" with "MacVim.app"?" My choices then are "Cancel", "Don't Update", and "Update. If I hit "Cancel" or "Don't Update" it just goes away. If I hit "Update" it will set it as the default application to open with for THAT file only. If I touch another file it will again open with TextEdit. I mean right now it won't because the fact that I hid TextEdit along with a pointer at TextEdit to MacVim is holding, though that's a hack, that's nothing like actually changing the default editor. Also, if I go into "get info" on the new file, the "open with" dialog is blank, like it would be for a blank file. If I didn't have TextEdit zipped up, it would have opened with that (tried to "Change All") before I zipped up TextEdit. The problem is that it relies on MIME types and extensions to pick the app to open it with. It wasn't given a way to handle null strings for the MIME type or extension. |
||
|
|
0
|
|
|
#4 | |
|
Quote:
|
||
|
|
0
|
|
|
#5 | |
|
Quote:
The mac managed fine using TextEdit to open the files without extensions, so there's no reason to think it shouldn't work fine with MacVim if I was somehow able to change that to the default text editor. Ever since I zipped up TextEdit and made a pointer to MacVim.app called "TextEdit.app" it's been pretty good about opening blank text files with no extension with MacVim - though this is still a hack to fool OS X, I rather do it the right way. |
||
|
|
0
|
|
|
#6 |
|
Interesting... I wanna do the exact same thing.
Syndacate, did you find a way to solve this without hacking, i.e. without creating a symlink TextEdit.app pointing to MacVim (and removing the TextEdit application)? I can't believe there isn't an easy way to simply tell OS-X to use MacVim instead of TextEdit as default editor (system-wide, NOT for each file extension individually)... |
|
|
|
0
|
|
|
#7 | |
|
Quote:
"export EDITOR=/Applications/MacVim.app" Although that may not work, that may only replace pico with MacVim - which isn't at all what we want, we still want pico in there. Though it may be worth a shot, if it fails, then revert to using pico for a command line editor: "export EDITOR=/usr/bin/pico" Though I haven't found any better ways. I've simply symlinking TextEdit.app to wherever I want to start it, and that works well for me. I also just put the MacVim icon on my dock (I don't keep any program that's on my dock when off), so I can drag it onto the MacVim icon and open it at any time. I'm not big on the whole drag and drop thing, but it's pretty much been the only answer I can find to this pain in the ass thing. ** still loooking |
||
|
|
0
|
|
|
#8 |
|
I'm new to this but,
I've been having the same problems since i often work with the "null" files. However, after renaming the applications (TextEdit.app -> TextEdit_old.app AND TextWrangler.app -> TextEdit.app) the mac did what i wanted.
I'm not sure if this will mesh with the system when an upgrade to the editor rolls out, but it did the trick. |
|
|
|
0
|
|
|
#9 | |
|
Quote:
That method will work as long as you use the GUI to work with your files. If you use the `open` command from a command terminal it will open with textedit IIRC, even though you re-named it. This is most likely because it's simply a pointer to the program data, not necessarily where the program appears in a human readable sense. Regardless, if you zip the textedit.app (or whatever you renamed it to), it will throw an error if you use the `open` command. I ended up just renaming it, like you did, and use that, although I'm not sure I've found a code editor for Mac that I really like. It is annoying though that most of its coding abilities are heavily integrated into XCode, but aside from that, as far as quick code editors go, there's (from what I see) smultron, textwrangler, bbedit, textmate, macvim, and maybe a few more that are escaping me at the moment. Nothing that really made me all warm and fuzzy. |
||
|
|
0
|
|
|
#10 |
|
Sorry to dig up such an old thread but I could not find any more recent information on that matter.
I think I found a solution that works in a shell with "open -e" as well. At least it works with TextWrangler. It is quite an ugly hack. Any more elegant solution would be welcome. Step 1: Disable TextEdit Renaming the TextEdit.app folder is not enough. Renaming the Contents folder inside works though (I renamed it to Contents_ ) as the OS cannot find the application files anymore. Step 2: Rename (or copy) your favorite editor .app folder to TextEdit.app (a symbolic link does NOT work!) Step 3: Go into your new TextEdit.app folder and edit the file "Contents/Info.plist". Find the lines <key>CFBundleIdentifier</key> <string>com.barebones.textwrangler</string> (This is for TextWrangler. The second line will vary depending on your text editor) Change the second line to "com.apple.TextEdit" <key>CFBundleIdentifier</key> <string>com.apple.TextEdit</string> Step 4: You might have to make the Mac forget about TextEdit. Easy solution: reboot. Otherwise, renaming some files in the Applications folder seems to force it to rebuild the database of installed applications and file associations (or something like that). Notes: Step 2 seems necessary for the GUI to find the text editor. It has no impact on "open -e" which apparently relies on another mechanism to find the text editor. Step 3 is necessary for "open -e" to work. (Actually "open -e" works even without step 2.) Known issue: the editor is named TextEdit in the dock (but shows up with its own icon). |
|
|
|
0
|
|
|
#11 | |
|
Quote:
What I ended up doing was just saying: Code:
open -a MacVim <file> |
||
|
|
0
|
|
|
#12 | |
|
Quote:
Code:
alias ov 'open -a MacVim' ov your-file-here |
||
|
|
0
|
|
|
#13 |
|
That's true, I can also (and probably would rather) use a symbolic link and drop it in /usr/bin or /bin. It would have similar (same0 functionality.
|
|
|
|
0
|
|
|
#14 |
|
I've been using vi since the mid-80s and would rather use just about anything else instead lol. I still use it most days at work but definitely not at home. I guess it's one of those things where you either love it or hate it
|
|
|
|
0
|
|
|
#15 | |
|
Quote:
Telling an app to open a file sends it a message (an "open document" Apple event). That's what the 'open' command does: send a message. A symlink to MacVim would start a new process when used as a shell command. |
||
|
|
0
|
|
|
#16 | ||
|
Quote:
Quote:
|
|||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| App to edit Song info... | thirumalkumaran | iPod touch | 6 | Jul 24, 2012 09:35 AM |
| Resolved: default text editor | amtec | Mac OS X | 1 | Jun 22, 2011 06:59 AM |
| Text edit for html, doesn't work. Help please. | Darth Maynard | Mac OS X | 7 | Mar 12, 2010 10:58 AM |
| Setting Swirly as Default Text App | F.Garvin | Jailbreaks and iOS Hacks | 2 | Aug 24, 2009 10:48 PM |
| Changing default text editor to vim - reverts | nichos | Mac Applications and Mac App Store | 1 | Oct 29, 2005 04:01 PM |
All times are GMT -5. The time now is 12:02 AM.







Linear Mode

