Sensible default save location



  • I opened up TextWrangler to save a snippet of text I pulled out of XCode's debugger. I did File -> Save As, and take a guess what folder it used as the default save location before I changed to my desktop? .trash

    To be fair, TextWrangler always opens the last text file it used, and I had previously opened a file on my desktop that has since been moved to trash and somehow TextWrangler realized that and opened it anyway so its working directory was changed to .trash. 

    Are there any basic text editors for OS X that don't suck? I'm debugging code that parses JSON and having the downloaded JSON
    tidied up and formatted makes it much easier to decipher, but I haven't
    found any tools on OS X that help. My current workflow works but is inefficient. Right now I have it printed to the debugger console, then I copy-paste it into TextWrangler and save it on the Mac, then copy the file through the Finder to my Windows workstation's desktop, then open it in Notepad++.



  • You need to print it out, take a photo on a wooden table and OCR the result.



  • @mott555 said:

    Are there any basic text editors for OS X that don't suck?

    You should try Sublime Text 2, and then mail me some fine beer for telling you about it.



  • Back when our shop gave a shit about Macs and we got  one of them new-fangled minis, I tried something called TextMate and was quite enamoured by it.

    Wasn't Textmate the program where it was kind of a running gag to talk about the next version because the creators spent years between 1 and 2 or something?



  • @dhromed said:

    Wasn't Textmate the program where it was kind of a running gag to talk about the next version because the creators spent years between 1 and 2 or something?
     

    No, that was Duke Nukem.

    And the irony wasn't wasted at Mozilla...



  • I tend to use Smultron a lot. I have Coda installed, but find that (like so much for the Mac) it hides a lot of the details I want to see.

    For formatting code, I haven't found anything better than Netbeans. Yes, it's a full IDE, but I like the syntax colouring, completion, and formatting even for other files. Integrated PHP debugger and SVN/GIT/Mercurial (plus *local* tracking of changes within the IDE) is also awesome.



  • @Smitty said:

    @mott555 said:

    Are there any basic text editors for OS X that don't suck?

    You should try Sublime Text 2, and then e-mail me some fine beer for telling you about it.

    FTFY.

    This is the 21st century, man. Get with the program.



  • @Someone You Know said:

    @Smitty said:

    @mott555 said:

    Are there any basic text editors for OS X that don't suck?

    You should try Sublime Text 2, and then e-mailsext me some fine beer for telling you about it.

    FTFY.

    This is the 21st century, man. Get with the program.

    FTFTFYFY.



  • @mott555 said:

    Are there any basic text editors for OS X that don't suck?

    Sublime Text is a good option.

    The most popular around seems to still be TextMate.

    There are always the standard Emacs/Vim options on mac as well. The cocoa build of emacs is what I use most of the time. The only thing I've found that TextMate has over emacs on a Mac is that TextMate handles multiple modes (e.g. python/ruby in html) well, whereas emacs just can't get a handle on the concept.



  • @mott555 said:

    TextWrangler always opens the last text file it used, and I had previously opened a file on my desktop that has since been moved to trash and somehow TextWrangler realized that and opened it anyway


    There's a bit of magic going on when you move or rename files on OS X — try opening a file in a text editor, changing its name in the Finder, and then saving the file, for example. You [i]should[/i] be presented with a dialog asking you if you want to save under the old name or the new one. I'm guessing something similar happened here, though it's odd it would open things from the trash, since you can't do that manually (double-click on a file in the trash and you'll be told it can't be opened because it's in the trash and you should move it out of there first; before someone mentions this is stupid, I'm guessing it's to prevent people from using the trash as storage).

    @mott555 said:

    I'm debugging code that parses JSON and having the downloaded JSON tidied up and formatted makes it much easier to decipher, but I haven't found any tools on OS X that help.

    I've not used TextWrangler and am not familiar with JSON, but can't you set up formatting rules in it that make the text appear the way you need/want it to? I usually use skEdit for coding, in which you can do just that, anyway.



  • @mott555 said:

    Are there any basic text editors for OS X that don't suck?
    @mott555 said:
    then open it in Notepad++.

    But... Notepad++ sucks. So now I don't know what "sucks" means to you.

    Sublime Text is "the new hotness" in text editors, and it's cross platform. So even if it sucks, at least it sucks equally on both platforms.



  • You should be able to use any editor that lets you format text with an external command.

    If you have python, you can use python -mjson.tool

    If you have perl, use JSON::XS, or the standalone utility json_xs

    I'm pretty sure even TextWrangler can use these with its "UNIX Filters".



  • @Gurth said:

    There's a bit of magic going on when you move or rename files on OS X — try opening a file in a text editor, changing its name in the Finder, and then saving the file, for example. You should be presented with a dialog asking you if you want to save under the old name or the new one. I'm guessing something similar happened here, though it's odd it would open things from the trash, since you can't do that manually (double-click on a file in the trash and you'll be told it can't be opened because it's in the trash and you should move it out of there first; before someone mentions this is stupid, I'm guessing it's to prevent people from using the trash as storage).

    WHO WANTS A HISTORY LESS ON MAC CLASSIC? Nobody? Damn:

    So in Mac Classic, files were always opened by ID and not by file name. One thing that used to drive me FUCKING NUTS about Windows is that if you open folder/hello.txt, then move the file to a different folder, then saved in the text editor, you ended up with your old file in the new location and your new file in the old location and now there's TWO FILES instead of one even though I only ever opened up ONE FILE WINDOWS IS SO BUGGY UGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHH so yes.

    Yet Another Thing Mac Classic Got Right And Nobody Else Did.



  • We use UltraEdit here at work a bunch. I've never used its Mac port, but it has one: [url]http://www.ultraedit.com/products/mac-text-editor.html[/url]

    It's not free, but it is very good, and the folks who work on it are very responsive to bugs and other inquiries. If this is for a commercial project, it may be worth a trial run.



  • I don't think this is a WTF at all.  It is an artifact of desired behaviour.

    Let's say you save a file to folder A, then you move it to Folder B, then you load up the editor and it loads the file from folder B.  Now you save.  Question: Do you want it to save in Folder A making a new copy that you really might be unaware of or do you want it to now save to Folder B where you intentioanlly moved it to.

    You hit an edge case where folder B is your recycle bin or your systems version of it.  I agree perhaps a setting that says ignore deleted items or a particular folder or something like that, but I do not see the WTF here, it is simply opening into the prior detected save location which is what you want in most cases, easy enough to change when you want to.


  • Discourse touched me in a no-no place

    @blakeyrat said:

    But... Notepad++ sucks.
    What's wrong with notepad++?



  • @PedanticCurmudgeon said:

    @blakeyrat said:
    But... Notepad++ sucks.
    What's wrong with notepad++?

    Nothing, everything, remember this is Blakeyrat you are talking about.

    On the other hand, I kind of agree with him about hte file handling by ID rather than name thing.

     



  • @PedanticCurmudgeon said:

    @blakeyrat said:
    But... Notepad++ sucks.
    What's wrong with notepad++?

    The drop-down menus don't work. It's 2012. Drop-down menus were perfected in 1984.

    Presumably they've fixed the 45,237 UAC violations the WTF thing did last time I tried it.



  • @mott555 said:

    ...

    Are there any basic text editors for OS X that don't suck?

    ...

    I like vi.

     



  • @Rick said:

    @mott555 said:
    ...

    Are there any basic text editors for OS X that don't suck?

    ...

    I like vi.

    By basic text editor I mean I don't have to consult a manual every time I want to do something. Vi is one of those ugly rituals that UNIX people force themselves through just to inflate their egos and make them feel special about themselves. Kinda like that Star Trek episode where Data and Troi have Worf get beat up by fake Klingons on the holodeck so he's not depressed anymore.



  • @mott555 said:

    @Rick said:
    @mott555 said:
    ...

    Are there any basic text editors for OS X that don't suck?

    ...

    I like vi.

    By basic text editor I mean I don't have to consult a manual every time I want to do something. Vi is one of those ugly rituals that UNIX people force themselves through just to inflate their egos and make them feel special about themselves. Kinda like that Star Trek episode where Data and Troi have Worf get beat up by fake Klingons on the holodeck so he's not depressed anymore.

    Friends of mine like emacs.

     



  • Editplus.

    It's quite good.

    Compare these examples of the limits of extraneous bullshit in either program:

    Notepad++ : transparency slider on preferences window

    Editplus: built-in tool to add the numbers (as floats) in your selection.

    Notepad++ : all labels and buttons are... centered

    Editplus: all buttons have icons

     

    So yeah. Editplus: The Least Insane Option

    And it has builtin seamless FTP.



  • @mott555 said:

    By basic text editor I mean I don't have to consult a manual every time I want to do something. Vi is one of those ugly rituals that UNIX people force themselves through just to inflate their egos and make them feel special about themselves. [...]

    I hate vi... for making text editing feel so incredibly tedious... in non-vi editors.

    The ego boost helps soothe the pain a bit, though.

     



  • @superjer said:

    @mott555 said:

    By basic text editor I mean I don't have to consult a manual every time I want to do something. Vi is one of those ugly rituals that UNIX people force themselves through just to inflate their egos and make them feel special about themselves. [...]

    I hate vi... for making text editing feel so incredibly tedious... in non-vi editors.

    The ego boost helps soothe the pain a bit, though.

     

    I regularly try to save with [esc]:wq in GUI text editors.



  • @Ben L. said:

    I regularly try to save with [esc]:wq in GUI text editors.
     

     

    iThat's completely rediculjjbbdawlriAous. Noboyd does that.jjFyxpZZ



  • @Ben L. said:

    I regularly try to save with [esc]:wq in GUI text editors.
     

    I regularly try to search with / in all programs. Luckily Firefox supports this.



  • I regularly try to... oh wait I actually know how to fucking use a computer, I didn't just memorize some fucking awful program in 1987 and use it for my entire career without ever learning anything new.



  • @blakeyrat said:

    I regularly try to... oh wait I actually know how to fucking use a computer, I didn't just memorize some fucking awful program in 1987 and use it for my entire career without ever learning anything new.
    vim is better than any GUI text editor I've tried.



  • That's because you've brainwashed yourself into thinking it's good because you spent months or years learning it and incurred massive sunk costs during that time. Your brain is a lying liar.



  • @blakeyrat said:

    That's because you've brainwashed yourself into thinking it's good because you spent months or years learning it and incurred massive sunk costs during that time. Your brain is a lying liar.
    Actually, I'm 18 years old and only started using vim about a month ago. I won't dispute the last point, though.



  • @mott555 said:

    I opened up TextWrangler to save a snippet of text I pulled out of XCode's debugger. I did File -> Save As, and take a guess what folder it used as the default save location before I changed to my desktop? .trash

     

    Adding files to Visual Studio Setup projects is similarly challenged. When you add a file, the default location for the file browser is c:\windows\system32, maybe some end users don't have their own copy of ntdll.dll and the .vdproj is simply doing me a favour?

     


  • Discourse touched me in a no-no place

    @Ben L. said:

    @blakeyrat said:
    That's because you've brainwashed yourself into thinking it's good because you spent months or years learning it and incurred massive sunk costs during that time. Your brain is a lying liar.
    Actually, I'm 18 years old and only started using vim about a month ago. I won't dispute the last point, though.
    You guys have a nice retro editor flamewar going on, but shouldn't emacs be included in the festivities?



  • @superjer said:

    @mott555 said:

    By basic text editor I mean I don't have to consult a manual every time I want to do something. Vi is one of those ugly rituals that UNIX people force themselves through just to inflate their egos and make them feel special about themselves. [...]

    I hate vi... for making text editing feel so incredibly tedious... in non-vi editors.

    The ego boost helps soothe the pain a bit, though.

     

     

    VI is probably the worst text editor devised for a casual or new user. 

    But, if you are going to put Linux or Unix or BSD on your resume/cv, you better know VI. 

     

     

     



  • @Rick said:

    VI is probably the worst text editor devised for a casual or new user. 

    But, if you are going to put Linux or Unix or BSD on your resume/cv, you better know VI. 

    Why? So you can spread the shitty software to a new generation of fuckers?

    I used to believe that when all the old Unix-heads from then 70s and 80s died off, we'd finally get some people in IT who actually give a shit about usability. Sadly, I see now that that was just a pipe-dream. Not only are all the stupid shitty bad decisions made by Unix 40 years ago still around, but there's tons of idiot kids who actually think they're pretty good features.

    Who suffers? The end-user. Not that anybody in the Unix/Linux/open source world ever gave 16 milliseconds of thought to the end-user of their software.



  • @Rick said:

    But, if you are going to put Linux or Unix or BSD on your resume/cv, you better know VI. 
     

    And you sure as hell do NOT call it "6" in an interview when boasting about your years' experience of Unix.



  • @Rick said:

    But, if you are going to put Linux or Unix or BSD on your resume/cv, you better know VI. 
    I know Linux well enough. I also know vi well enough that I have resorted to sed and cat on a box that didn't have internet connectivity and no other editor than vi.



  • @blakeyrat said:

    Who suffers? The end-user. Not that anybody in the Unix/Linux/open source world ever gave 16 milliseconds of thought to the end-user of their software.
     

    .. because they ARE the end-user of this software that hasn't changed in the past 40 years (and isn't likely to change anytime soon) and have accepted it looks shit but works effectively.

    Catch-22.



  • @blakeyrat said:

    @Rick said:

    VI is probably the worst text editor devised for a casual or new user. 

    But, if you are going to put Linux or Unix or BSD on your resume/cv, you better know VI. 

    Why? So you can spread the shitty software to a new generation of fuckers?

    I used to believe that when all the old Unix-heads from then 70s and 80s died off, we'd finally get some people in IT who actually give a shit about usability. Sadly, I see now that that was just a pipe-dream. Not only are all the stupid shitty bad decisions made by Unix 40 years ago still around, but there's tons of idiot kids who actually think they're pretty good features.

    Who suffers? The end-user. Not that anybody in the Unix/Linux/open source world ever gave 16 milliseconds of thought to the end-user of their software.

    Because if you have *nux on your resume and you can't use vi then you are either lieing or ignorant. I have interviewed many from both categories, but I have not yet run into a situation where lack of vi knowledge was the only reason for me to disqualify a candidate.

    P.S.

    My development Linux server was rebooted this past weekend. I had to log in again after 9 months.

     



  • @blakeyrat said:

    I regularly try to... oh wait I actually know how to fucking use a computer, I didn't just memorize some fucking awful program in 1987 and use it for my entire career without ever learning anything new.
     

    @blakeyrat said:

    That's because you've brainwashed yourself into
    thinking it's good because you spent months or years learning it and
    incurred massive sunk costs during that time. Your brain is a lying
    liar.

    You're contradicting yourself. Do vi users never learn anything new or have they spent years learning?

    How often do you learn a slick new, fun, efficient feature or plugin for your editor? I learn a couple a week in Vim. Often it's something that makes me say, "how did I ever live without this?!" And all the other editors become that much more tedious to use.



  • @superjer said:

    You're contradicting yourself.

    No I'm not.

    @superjer said:

    Do vi users never learn anything new or have they spent years learning?

    Huh? How are those two things mutually-exclusive?

    @superjer said:

    How often do you learn a slick new, fun, efficient feature or plugin for your editor? I learn a couple a week in Vim. Often it's something that makes me say, "how did I ever live without this?!" And all the other editors become that much more tedious to use.

    Possibly; but that doesn't mean Vim a better editor. That makes it a shitty editor that you've invested a shitload of time in.



  • @superjer said:

    How often do you learn a slick new, fun, efficient feature or plugin for your editor? I learn a couple a week in Vim. Often it's something that makes me say, "how did I ever live without this?!"
    That sounds like features aren't easily discoverable, which sounds like a huge downside to me.



  • I look at the features of vim and I love it but I really can't be arsed to learn its disgraceful excuse for an interaction model. That is not joy. That is suffering.



  • @ender said:

    @superjer said:
    How often do you learn a slick new, fun, efficient feature or plugin for your editor? I learn a couple a week in Vim. Often it's something that makes me say, "how did I ever live without this?!"
    That sounds like features aren't easily discoverable, which sounds like a huge downside to me.
    Or the user doesn't put the effort into discovering/using the stuff.


    There's someone where I work who (in the times I've observed them) exclusively uses the mouse with their GUI editor (I think it's eclipse) where possible. It's painful watching them.



    To find the next/previous instance of something (for example),

    • left-click drag select the (usually) word to be searched
    • right-click, select copy
    • in the find dialog, left-click drag select the last search
    • right-click, select paste
    • make sure the correct forward/back button is selected
    • click 'next' (or whatever the button is.)

    I'm certain there must be a quicker way akin to what I use in my editor, which is
    • double-click word,
    • ctrl-f, enter
    • F3/shift-F3


    (There's some other magic that Eclipse seems to need whereby you need to re-select the window with the text in before clicking 'next' in the find dialog otherwise it won't work, but I'm guessing that a bug of sorts rather than intended behaviour.)


  •  @ender said:

    @superjer said:
    How often do you learn a slick new, fun, efficient feature or plugin for your editor? I learn a couple a week in Vim. Often it's something that makes me say, "how did I ever live without this?!"
    That sounds like features aren't easily discoverable, which sounds like a huge downside to me.

    I think if every feature of Vim was "discoverable" it might get a bit overwhelming. It comes with 130,000 lines of documentation on its builtin features and there are thousands of plugins on top of that. You should only use the ones you find helpful though.



  • @PJH said:


    I'm certain there must be a quicker way akin to what I use in my editor, which is

    • double-click word,
    • ctrl-f, enter
    • F3/shift-F3

     

    For completeness, in Vim:

    • Put cursor anywhere on word if not already there (click it if you must)
    • Press *
    • Press n or N

     



  • @superjer said:

    I think if every feature of Vim was "discoverable" it might get a bit overwhelming.
     

    Not every feature can be made discoverable. Not every feature needs to be made discoverable.

    Compare to vim: as a fresh new user, it is not possible to start work without a trip to the manual!

     



  • @blakeyrat said:

    @superjer said:
    Do vi users never learn anything new or have they spent years learning?

    Huh? How are those two things mutually-exclusive?

    Well I guess you're right. It seemed like a contradiction to me because everyone I know using Vim is still learning new things in it (and other tools). Development on Vim is ongoing. The latest commit was 6 hours ago.

    @blakeyrat said:

    @superjer said:
    How often do you learn a slick new, fun, efficient feature or plugin for your editor? I learn a couple a week in Vim. Often it's something that makes me say, "how did I ever live without this?!" And all the other editors become that much more tedious to use.

    Possibly; but that doesn't mean Vim a better editor. That makes it a shitty editor that you've invested a shitload of time in.

    It makes it a better editor for me. It's not a waste of time if I'm more efficient and enjoy editing text more. Tasks I would have written a script or program to complete I can often do with a few seconds of Vim-fu. Like learning any advanced tool, it might just be worth the effort.



  • @superjer said:

    @blakeyrat said:
    Possibly; but that doesn't mean Vim a better editor. That makes it a shitty editor that you've invested a shitload of time in.

    It makes it a better editor for me. It's not a waste of time if I'm more efficient and enjoy editing text more. Tasks I would have written a script or program to complete I can often do with a few seconds of Vim-fu. Like learning any advanced tool, it might just be worth the effort.

    You don't understand. Somewhere, someone has statistics. Probably with p-values.



  • @superjer said:

    It makes it a better editor for me. It's not a waste of time if I'm more efficient and enjoy editing text more. Tasks I would have written a script or program to complete I can often do with a few seconds of Vim-fu. Like learning any advanced tool, it might just be worth the effort.

    What's the point of writing an advanced tool if you don't bother to make it usable? Just so you can sit around and be smug about how much smarter you are than everybody else? Oh wait, that is literally why you do it.



  • @PJH said:

    I'm certain there must be a quicker way akin to what I use in my editor, which is

    • double-click word,
    • ctrl-f, enter
    • F3/shift-F3

     

    In Eclipse it's double-click then Ctrl-K. And Ctrl-K to search again. (Or ⌘K on Mac)

    In TextWrangler it's ⌘-double-click. And ⌘G to search again. (Or select, ⌘C, ⌘F, ⌘V, enter for the initial search. It does annoy me that selecting and going into the search dialog doesn't bring up the highlighted text by default) And the ⌘G vs ⌘K inconsistency between programs annoy me too. Especially since ⌘G in Eclipse goes tothe "search" view-widget-thingy that requires a click to return to your file. And F3 doesn't work on many (any?) Mac programs.

    Watching someone select the word manually using the mouse compared to simply double-clicking it annoys me!

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.