vim pastes "9" after pressing the central button of the mouse - vim

After selecting a piece of text from a web page with the mouse, I'm trying to paste it into a file opened with vim, but when I press the central button of my mouse it just pastes "9" (with or without insert mode activated).
This is the output of :reg:
--- Registers ---
"" 9
"0 9
"1 ^J
"- 9
"/ \s\+$
Press ENTER or type command to continue
Any idea what's going on here?

Create a file in your home directory called .vimrc with this content:
set mouse=r

Related

Vim - go to next match + change word + paste clipboard does not work

In my Vim, hitting cw (change word) and then command + v (MacOS paste shortcut) is able to replace the word on cursor to the clipboard copied one, but if I search some word then press n to go to the next match, and then do the same thing with cw then command + v, the copied one are not able to be pasted (it dose not show up) until I press ESC. It used to work normally.
What could be the possible cause of this?
It's caused by romainl/vim-cool, it used work without this issue, maybe because I changed vim config or installed some other new plugins that don't fit with it.

How can I delete all lines from cursor position using vi

I have a file in Linux. I want to delete all lines from cursor position till the EOF. How can I do that using vi editor.
Do something like:
:1,$d
Replace 1 with the number of the line you're on.
: - gets you to command mode
1,$ - indicates a range from the first line to the end
d - the delete command
Step 1:
Esc -> to enter command mode
Step 2: press key d (d stands for delete, vim will wait for second input specifying number of lines to delete)
Step 3 : Shift + g (To delete till EOF)
Press **Esc** come to command mode
press **v** enter visual mode
**Shift + g** "selects everything from current position to EOF"
**DEL** "delete selected"
be careful it can even delete the first line in which case you probably need to do this from the next line in cursor.
Press Esc come to command mode
press v enter visual mode
Shift + g "selects everything from current position to EOF"
DEL "delete selected"

Delete Current Word in IntelliJ IDEA/Android Studio

How to delete a current word(word at a caret)?
Below solution forces to put caret at start or end of the word, but that is not very convenient.
Ctrl-BACKSPACE
Delete to word end from caret.
Ctrl-DEL
Delete to word start from caret.
Other solution is to select word using Ctrl + W and then delete it but it is also two steps process.
Is there any shortcut or setting which can delete current word in a single step?
IDEA macro feature is usable here:
Open an editor and place the caret in a word
Main menu: Edit -> Macros -> Start Macro Recording
Press Ctrl-W, then Delete
Main menu: Edit -> Stop Macro Recording
A dialog pops up where you can enter a macro name like "Delete Word at Caret"
Assign a keyboard shortcut: Main menu: File -> Settings, then Keymap -> Macros, "Delete Word at Caret"
I see you have already created a tcket in YouTrack: https://youtrack.jetbrains.com/issue/IDEA-180648

How to open hyperlinks in excel without mouse-click; is there any shortcut key/Keys

I have many hyperlinks in a column of excel-sheet.
Is/Are there any shortcut key/Keys so that after going to each cell(using keyboard) I can open those in browser without using mouse-click?
In Excel 2016 (English version), I would say that the simplest way to do this is to
press the menu key (that has a similar effect to a right click)
press "o" twice
press "Enter".
The first "o" goes to "sort" ; the second "o" goes to "Open Hyperlink", and "Enter" then opens the hyperlink.
On a keyboard that does not have a menu key, one can press Shift + F10 instead.
Press the menu key and then press 'O' or 'o'.
More about Menu Key: http://en.wikipedia.org/wiki/Menu_key
Create a macro with the following. The cell with the link should only include text of the hyperlink (and not use the Excel function hyperlink with an embedded link). Note that the "... chrome.exe " has a [space] between exe and quote (").
Sub ClickHyperlnk()
'
' ClickHyperlnk Macro
'
' Keyboard Shortcut: Ctrl+d
'
With Selection.Interior
URL = ActiveCell.Value
Shell "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe " & URL, vbNormalNoFocus
End With
End Sub
To open a hyperlinked file in excel, try the following
Select the cell.
Press application key (menu key).
Press O key twice.
Press enter key.
This works well for me.
Sub hyhperlink()
'
' hyhperlink Macro
' opens hyperlink
'
' Keyboard Shortcut: Ctrl+Shift+X
'
With Selection.Interior
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
End With
End Sub
or record a macro for this operation
go in excel view tab
Click on micro
Click Record micro
type text in shortcut key i.e.(Ctr+Q or q)
enter OK
Press the menu key and then press 'O' or 'o' in excel Where is your hyper link data & Enter
again go in view > micro > click on stop micro
Now you can use your short cut key i.e. Ctr+Q or q
For hyperlink cells in excel
This is an old post but maybe it could help someone searching for this shortcut. To open a link without going through "Edit Links" follow these couple of steps:
click on a cell that is linked to another file
then press Ctrl + [
This will open the linked file. Hope this helps.
I found out this command doesn't work for me with the 'o' twice, maybe because i have a column of hyperlinks? who knows.
What I do is:
Select cell
Menu key
Up_Arrow
Enter
Opening the link is the last proposition of the menu, so going up goes to the last option. Pressing enter activates it.
Chears
Ben
You can make keyboard shortcut for hyperlinks formula / function.
Just press ALT + F11 copy and paste the script below:
Sub OpenHyp()
Workbooks.Open "FOLDER ADDRESS\" & ActiveCell.Value & "FILE EXTENSION"
End Sub
replace the FOLDER ADDRESS = you can find it on address bar of the file location just copy, paste and add "\" at the end of file address.
no need to replace ActiveCell.Value = this is the filename of your file which is usually the content of cell.
replace the FILEEXTENSION = for pdf used ".pdf", for normal excel file used ".xlsx" and so on.
Then, go to developer tab, click Macros, select the code we make which is "OpenHyp" and click "Option". Now you can put the shortcut key
I hope this helps.

TextMate bundle to insert a line of text above each line selected?

I'm looking for a way to insert a line of text above each line in the selected text in TextMate.
Does anyone know how to write a command or snippet to do this?
Example, selected text:
This is line 1
This is line 2
This is line 3
This is line 4
I want to insert the following above each line selected:
--im an inserted line--
Which would result in the following:
-
-im an inserted line--
This is line 1
--im an inserted line--
This is line 2
--im an inserted line--
This is line 3
--im an inserted line--
This is line 4
Could this be done using *NIX commands then I could setup a TextMate command to do this?
Select your text, press APPLE + F, then replace \n with \n--Im an inserted line--\n. Make sure that 'Regular expression' is ticked and that you hold in SHIFT while pressing the 'Replace All' button.
I would record a macro:
Insert a new line above with ⌥⌘↩
Paste desired text
Then save it as a command and possibly assign a shortcut to it.
EDIT
The best way to achive what you want in TextMate is to select all the lines then hit ⌥⌘a (Text > Edit Each Line in Selection) then do all the keyboard mashing necessary to paste what you want where you want:
⌘← to go back to the beginning of the line
↩ to insert a newline, effectively adding a blank line above the current line
↑ to jump to the new blank line
⌘v to paste your text
It will do that on each selected line simultaneously.
You can save a few keystrokes the next time you have to do that by recording all these steps in a macro and save it as a command as in the first part of my answer.
To insert line above current line
I believe the key shortcut is: ⌥ + ⌘ + ↩

Resources