When the lines are longer than the width of the screen, SublimeText, by default, forces the end of the line to be displayed on a second line.
Is there a way to tell SublimeText to not do that? I'd like the whole line to remain on one line and have a horizontal scroll bar.
I am using SublimeText 2 Version 2.0.2
Use "word_wrap": false in your User Preferences
You could also add the following to your user key-bindings file (Preferences -> Key Bindings - User) to add a key or a key combination to toggle between the two modes. I use CTRL+ALT+W, but the key combination could be anything you want.
{
"keys": ["ctrl+alt+w"],
"command": "toggle_setting",
"args":
{
"setting": "word_wrap"
}
}
Related
<textarea cols="152" rows="5">
Keep pushing space key after
the end of this sentence, you will notice that caret wouldn't pass new
row and stay put, start pushing space key now
</textarea>
When i just keep pushing space key after "start pushing space key now", caret doesn't automatically passes to new line at the very end of line. How can i get caret pass to new row at the end of row automatically? Is there any css solution for that? And only Chrome has this problem.
In Chrome (and a number of applications) the cursor won't jump to the next line until you enter a non-"whitespace" character (so spaces will never drop it down a line). If you observe after keying in enough spaces to move the cursor all the way to the right edge, typing any other character (a number, letter, or punctuation), you will drop down a line. This is simply the way chrome handles textareas, and is not configurable.
On an unrelated note, "^" is a caret.
The fold arrow in the gutter doesn't have arrows for all indented elements in HTML, only a few:
It only shows an arrow on line #2 and #6. This is with reindenting and --- "tab_size": 2, "translate_tabs_to_spaces": true --- in my user settings.
Is anyone else experiencing this? I have the fold arrows set to always show and it'd be so much faster to be able to collapse each respective HTML element when necessary.
Thanks!
Your indentation must to be well done to have folding arrows :
Preferences
"tab_size": 4,
"tabs_small": true,
"translate_tabs_to_spaces": true
Reiterating to what Alex has said, if Indentation is what's causing this .. Have
[
{"keys": ["f12"], "command": "reindent"}
]
in your user preferences. Ctrl+A and then f12 and see if you get the collapsing arrows.
When I click on the line numbers in the margin, it highlights the entire line and moves the cursor to the beginning of the following line (presumably so that you can quickly copy that line to the clipboard).
Is there any way to disable this behaviour and have the cursor simply jump to the beginning of the line that was clicked?
On OS X, hold down ⌥ (Option key, or Alt) while clicking on the margin. On Windows and presumably Linux, you can click using the middle mouse button.
If you want to make this the default behavior for mouse button 1 (the left button), create a new file with JSON syntax and the following contents:
[
{
"button": "button1",
"press_command": "drag_select",
"press_args": {"by": "columns"}
}
]
Save it in your Packages/User directory as Default (your_OS).sublime-mousemap, where your_OS is one of OSX, Windows, or Linux. You can find the Packages directory by clicking on Preferences -> Browse Packages....
Warning!
This will make your left mouse button act like the center mouse button - you won't be able to double-click to select words, and click-drag events will select columns instead of lines. There is no way to isolate this behavior to just the margin, unfortunately.
I have longer lines of text (separated by spaces...no long single word) that veer off to the right side of the editor. The only way I can read them is if I scroll horizontally. Is there a way to wrap all the text that falls out of view on the right? Thanks!
Yes,
Go to preferences > settings - user
and add:
"word_wrap": true
Then save the file and restart sublime
how to set the same tabsize width with 4 space in sublime text?
I like verdana font ,then I set font to it in sublime text, but it appears that the 1 tab is much wider then 4 space. why? how to fix?
Probably, this is a problem related to how Sublime handles tabsize.
It seems to use the size of an em-dash (—), instead of the size of a space. In monospaced fonts, of course, those sizes are the same, but in proportional fonts, such as Verdana, they are quite different:
" " (4 spaces)
"————" (4 em-dashes)
So, I think that the only way to solve your problem is to convert tabs to spaces with View/Indentation/Convert Indentation to Spaces. And be sure to have "translate_tabs_to_spaces": true in your preferences and Indent Using Spaces set in Indentation menu:
The particular file you've included as a screenshot forces itself to use tabs instead of spaces, so that could be why it seems much too large of a space. Even if you set "translate_tabs_to_spaces": true, in your User Settings, this isn't applied to the Settings files themselves.
You can make sure what you're seeing is actually spaces/tabs by turning on draw_white_space in the preferences. You can do this by editing your User Settings (Preferences -> Settings -> User) and adding the line "draw_white_space": "selection", (remember not to include the comma if this is the last line of your settings).
This value can be set to "none" to turn off drawing white space, "selection" to draw only the white space within the selection, and "all" to draw all white space.
If you do that, then restart Sublime Text 2, it might give you a good idea of what's going on.