How to select all text up to the cursor? - text

I occasionally look through logs or other data where I'm only interested in a small piece of a very large amount of data. I usually just drop it into sublime text and then cut out all the data I'm not interested in. How can I select all the text from the beginning up to my cursor? And all the text from my cursor to the end of the file? That would make reviewing data a little easier. I'd prefer if this answer worked in sublime text 3, but other lightweight text editors would be useful too if it couldn't be done if sublime text 3.

Mac:
Select all text above your cursor: command+shift+up.
Select all text below your cursor: command+shift+down.
Windows:
Select all text above your cursor: ctrl+shift+home.
Select all text below your cursor: ctrl+shift+end.
*This works in all versions of Sublime Text

Related

How to replace text on a multiselection

Suppose I have the following text selected in vim using ctrl-v e e:
To delete all the text I can press x (or d) and to insert new text I can do shift-I, but is there a way to replace that text directly? I want all those four items to say "video frame rate" instead of video resolution. How would I do that in the most efficient way in vim?
ctrl-v and other magic to select the block
press s or c
write the text you want
press ESC

How can I easily edit after finding text in Sublime Text 3?

Whenever I do a sublime find, at some match I wish to add the text. But is there a shortcut to edit without moving mouse and clicking the text (to bring cursor to that location)
Example gif (issue I'm facing) - https://imgur.com/wTe3vcA
Just press Esc after finding your text.

Entering italics in vim

How does one enter italic text in vim?
In the following screenshot from the infopage of a certain plugin
you can see the italic text under the heading Text styles.
It is not my goal to highlight comments in italics as has been asked in many other questions.
I am looking for a keymap by which I can toggle to "italic text mode" and back.
You can't "enter italics", or bold, or underlined. Neither in Vim nor in any other text editor. What you insert is plain characters which get displayed according to their context.
What you see in that screenshot is the effect of a special rule defined in the plugin that tells Vim to italicize text between underscores and "conceal" those underscores. That feature is plugin-specific and can be enabled/disabled with an option.
You can always save your text file in .md format and use markdown syntax for italics.
For example:
In terminal insert vim text_file_name.md to open new text file in vim.
Then in this text file insert some text surrounded with asterixes eg. Some text in * italics *.
It should automatically show word "italics" in italics.
Vanilla VIM doesn't support this. It's just a text editor. You would need to use a plugin like Txtfmt.

Sublime Text 3 Multiple selection

I'm trying to do this Multiple selection with Sublime on Mac:
I can do it easily with Textmate: https://i.stack.imgur.com/htjDk.gif
But did not found how to do it with Sublime.
With text highlighted (CtrlA for all text): CtrlShiftL will allow you to modify text on all lines simultaneously.
http://www.sublimetext.com/docs/selection
Select the required text and press CommandD multiple times.

Remove non utf8 lines in text file

How do i remove only non utf8 keywords/lines in a text file.
eg.
你好
相手123abc
this is only abc
I only want to remove lines that contain all english words and not the lines with utf8 words. So in this case only 'this is only abc' will be removed. Is it possible to do it in notepad++ or do i need to write a script for it?
This is possible using the following steps;
Open Notepad++ select the Find menu and select the last tab 'Mark', enter the regex ^(([a-zA-Z])+\s?)+, select Bookmark Line, and click the button 'Mark All'.
From the drop down menu select; Search --> Bookmark --> Remove Bookmarked Lines
I would also recommend making sure Notepad++ is up to date. I tested this with version 6.3. Marking lines is something added quite recently.

Resources