What if you want to select 78 here (after having pressed ⇧↑)?
Or if you want to select both 12 and 78, on Windows you couldn't press shift+home and shift+end.
Methods like moveToEndOfLineAndModifySelection:
are unanchored in most applications, which means that they always extend selections. They are actually anchored in Xcode, TextMate, Sublime Text, and BBEdit, but I don't know any way to change the default behavior.
If you just want to make selecting and deleting lines easier, you can create ~/Library/KeyBindings/ and save a property list like this as DefaultKeyBinding.dict:
{
"~l" = selectParagraph:;
"~z" = (selectParagraph:, deleteBackward:);
"~x" = (selectParagraph:, cut:);
"~c" = (selectParagraph:, copy:);
}
After reopening applications, ⌥L should select a line. See http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html and http://lri.me/keybindings.html for more information.
There are some things worth paying for in life and a solid text editor is, in my opinion, one of them. If it's the tool you use every day, what's a few dollars to ensure that tool is high quality? For me, that editor worth paying for is Sublime Text. I'm still on 2, but 3 is a pretty stable beta and can be had for free for the time being. Both 2 and, when it leaves beta, 3 can be "evaluated" indefinitely if the price and paying for quality software really turns you off.
The upside to Sublime is it has a long and illustrious with a great community behind it. It has an awesome package management system in Package Control that lets you add a ton of features very quickly and easily.
To address your specific feature requests...
vertical gridlines, that help you see how far indented you are
Yes. Add:
"draw_indent_guides": true
to your preferences file.
bracket matching and tag matching when you're inside a tag
The BracketHighligher extension does this and more. There's a snazzy screen shot on its Package Control page that shows off all the ways it can highlight things out of the box.
You can find my Sublime preferences file here which has most of things you desire enabled in it already.
when highlighting a word (which is quick by double clicking on it) all other instances of that same word will be highlighted
Sublime calls this Multiple Selection. Select a word and then press Ctrl+Command+G
or Cmd-D
to select all occurrences of the word in the file. Typing will replace all occurrences simultaneously. You can do a lot more than that with Sublime. See the aforementioned page for other multiple selection ninja moves you can do.
Commenting multiple lines of text by highlighting and hitting [strg]+[k]
Highlight the block and press Command-/
to toggle comments on and off for the block. You can combine this with multiple selection mentioned above to comment out non-contiguous lines.
Un-Commenting multiple lines of text by highlighting and hitting [strg]+[shift]+[k]
It's Command-/
in Sublime to toggle comments which is easier to remember than an 'add comment' and a separate 'remove comment' action if you ask me. If you don't like the short cut you can reassign key bindings freely in Sublime to map the actions to a preferred combination.
Indenting multiple lines of text by highlighting and hitting [strg]+[tab]
That works exactly how you want: select the lines, TAB
to indent, Shift-TAB
to un-indent.
Un-Indenting multiple lines of text by highlighting and hitting [strg]+[shift]+[tab]
It's just Shift-TAB
in Sublime.
the ability to chose how to interpret the file (what language)
You can override Sublime's language guess using the View > Syntax...
menu. Pick the language you want it to be instead of the one Sublime guessed. Sublime's guessing is much better than TextMate's though IMO.
function completion, such as parameter hints, closing html tags automatically, and completing brackets, would also be helpful.
Absolutely -- they're called Snippets in Sublime's parlance. It ships with a bunch of defaults for some common languages like CSS, HTML, Ruby and Python that are useful. You can add your own snippets and you can find more language support and snippets in Package Control.
Best Answer
If you look at your file with
od -cx
you will notice that every lines is terminated by the sequence:0x0d 0x0a
i.e. a carriage return followed by a newline.There is most probably a difference between your 2
Sublime Text
preferences in their way to manage the carriage return.The next best explanation is a difference in extension you gave on your 2 text files which set
Sublime Text
in a different way to manage the charactercarriage return
==0x0d
(coming from the last century type writers).