Sublime Text Carrying The Code One Line Above - editing

My problem is a code editing problem in Sublime text. After I delete some line, I want to carry whole code below in that line to one line above. Right now I am doing this via deleting the line manually. Are there any shortcuts that I can do it easily?
What I want to remove:
What I want to achieve via shortcuts:

Related

Turn off tkinter canvas line, but not delete the line

Pretty much the subject line says it all. I just want to be able to turn off the line, undisplay it. I don't want to delete the line or the tag reference to the line. I want to use a checkbutton and once the line is drawn, done through a database, I want to be able to turn on and off the line with the checkbutton, without having to replace the tag in the line list everytime I turn the line back on, err in that case I would have to redraw the line from scratch. How do I turn I line off? I haven't tried but I don't think the disable feature is for the this purpose.
You can use the canvas's .itemconfig() method to switch your line between state=HIDDEN and state=NORMAL.

Annoying vim behavior in visual mode

Let's say I have the following three lines and cursor is where ▐ is:
1. This is a slightly longer line.▐I want to delete this and the next line.
2. This is a shorter line
3. This is the third line
I want to delete the rest of the line from the cursor and line 2, so I do vjd, but that leaves my text like:
# This is a slightly longer line.# This is the third line
This is because when selecting text in visual mode, vim selects an additional virtual character at the end of the line. I've played around with virtualedit but that didn't seem to help.
Any clues on how I can get the original behavior that I wanted?
Try three keystrokes - sh-d, sh-j, sh-d
shift-d (delete to end-of-line)
shift-j (merge next line with this)
shift-d (delete the merged, i.e., second line
That will do the trick for you.
That's because if you don't have virtualedit set, vjd will delete everything including the new line character. So you just have to do vjhd instead, to keep the new line intact.
Otherwise with virtualedit=all, I don't face this problem.

SublimeText: Change line endings of all files in a project

Sublime Text 3 has a very useful feature to change Windows to Unix line endings on a file per file basis under View > Line Endings. Is it possible to do this for a whole project and/or directory at once?
Thanks
The Line​Endings plugin / package is small, but works like a charm Visit it's GitHub repository to get a few details, because on its Package Control page there is no description.
It not only works, but also gives you an additional functionality -- you can change not only line endings, but also indentation method of all open files in one step.
After installation:
1-Open all files, in which you want to convert / change line endings and/or indentation method.
2-Press Ctrl+Shift+P, to bring Command Pallete and start typing lin to locate Line Ending to all views: Windows (for example).
3-Select it, hit Enter, and... you're done!
4-Repeat step 2, but type spaces to locate Indentation: Convert to all views to Spaces or tabs to locate Indentation: Convert to all views to Tabs to change indentation method of all open files.

How to call a function when text is wrapped in vim?

In vim I want to visually make transparent the space I have to write a text in markdown. I use hard wrapping with textwidth=79. I know by some calculation that I'll have 20 lines for a chapter for example. So, what I do is inserting 20 empty lines to get a visual feeling for what I can write. After writing some lines, I manually delete the number of lines already written from the empty lines, so that the visual impression still is correct.
What I want to do, is to automate this deletion process. That means I want vim to automatically remove one line below the last written line if this line is empty and after vim automatically started a new line because I reached 79 characters in the line before. How can I do this?
I know that there are autocommands in vim but I haven't found an <event> that fits to the action: after vim automatically hard wraps a line / reached new line in insert (or however you would like to describe it)
I don't think there's an event for that particular action but there's a buffer-local option called formatexpr that gq & co will use, if set. So you can write a function that inspects any placeholder whitespace, if existing. That function can call the text format command gqq to maintain original feel (+ the cursor movement to the new, empty line).

Sublime Text Tab Indentation Indenting Entire Paragraph?

I've recently discovered Sublime Text and since I'm new to using text editors like this, I had a question about indentation. When I'm not using Sublime for code, I type up my writing with it before taking it to a word processor for further processing. I've been having a little bit of trouble with the indentation regarding paragraphs. When I tab a paragraph, it seems to tab the entire paragraph rather than just the first line. It looks like the first paragraph in this picture.
I've tried using the wrap paragraph function which seems to allow me to tab just the first line but when I paste it in Microsoft Word, it retains its wrap setting. Is there anyway that I can just indent just the first line without having to wrap it? Or am I approaching it all wrong?
For a global effect you can add this to Preferences > Settings-User:
"indent_subsequent_lines": false
Because I code too, I add it to Preferences > Settings-More > Syntax Specific-User.
To do this properly, open a .txt file (or your preferred file type) and it will open/create a settings file for the specific file type. Then paste in this and save:
{
"indent_subsequent_lines": false,
"tab_size": 4,
"translate_tabs_to_spaces": false
}
Sublime is a code editor, not a word processor. Although you may use it to type any kind of (plain) text, it's focused on editing code.
Sublime indents lines in a way that makes sense for a programming language. If you're looking for a tool to write anything like a report or a novel, maybe you should consider another tool.

Resources