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
Related
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.
I know what recording in vim is.
Let's say I have already a recording on a register and I'm missing some more keys that I want to add to that sequence. Is there a way to append these keys to an earlier recording in vim?
Using an uppercase letter will append to a register, so qA would continue recording the #a macro.
From :help q:
q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"}
(uppercase to append).
Note: this works for everything related to registers, so "Ayw would also append the next word to register "a.
Pasting the Macro
You can paste your register on the current file by doing this (let's say register "a"):
:put a
If I want to delete the last word of the line and I want to erase the space before it, jump to the beginning of the line and go down one line
Original register "a":
$diw
Pasting the register
:put a
On insert mode we need insert the macro literally, so we need to use Ctrl-rCtrl-ra
Note: The second Ctrl-r is necessary to capture Esc or Enter.
Modifying the Macro
Modifying the register "a":
$diwx0j
In the above example we just added x0j
Reassigning the Macro
Then you can make a visual selection and yank to the register "a":
0vg_"ay
0 ........ goes to the beginning of the line
v ........ visual selection
g_ ....... goes to the end of the line without line break
"ay ..... copy to the register "a"
If you want to swich modes you can type Esc literally by typing Ctrl-vEsc
You can also use "let" to set a register, in this case a register "a" to swich case of the line and go to the next line:
let #a="V~\<Esc>0j"
The let option allows you to save macros in your ~/.vimrc, wich comes in handy for those situations where you need the macro in a daily basis.
Another advantage of using "let" to assign and reassign your macro is that you can insert special keys this way:
:let #a="iHello World\<Return>bye\<Esc>"
Is necessary to use double quotes otherwise it will not work as expected.
Note: The digraph ^[ is inserted by typing Ctrl-vEsc and it represents the Esc literally.
Is there a method to remove or at least disable Bloomberg keyboard short cuts in Excel?
For example, normally to open a filter I can press CONTROL + SHIFT + L. However, this shortcut is now being used in Bloomberg and it causes my Excel to either freeze or not load for some time.
Go to the Bloomberg tab in the workbook, select Options -> Hot Key Manager and disable Bloomberg hotkey (top right corner)
Run the following code in VBA:
Public Sub DisableBloomberg()
Application.OnKey "+^l"
End Sub
This should disable them, if you are lucky :)
Here you can read more about Application.OnKey.
If you do not know what VBA is, then in Excel do the following:
Press Alt+F11
Press Ctrl+G
Write Application.OnKey "+^l" to the opened window and press Enter
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.
How can I script an action in Vim that will take the selected lines, indent them once, jump to the beginning and insert some code, then jump to the end and insert some code?
The code that needs to be inserted at the beginning and end are static and don't need to change (at least, not at this point).
Let's say beginning text is --- and ending text is ***
:execute "normal gv>i---\<Esc>`>a***"
If you want to record it into a macro, say buffer "a", then starting with a visual selection, use:
qa start recording into a
> indent
i insert mode
--- start text
Esc normal mode
`> end of last visual selection
a insert after
*** end text
Esc normal mode
q end recording
The following key sequence steps should work.
search for the start line e.g. /mysearch
qa - starts recoding the a macro
Vxj where x is the needed number of line(s)
>> to indent
ESC
'< jumps to the start of the marked lines
insert whatever you want (e.g. O to start a new line right above)
ESC
'> jumps to the end of the marked lines
insert whatever you want (e.g. o to start a new line right below)
hit q to end recording the macro.
Or something like this.
HTH
This is an old question, but I thought I'd contribute anyway. This is how you can take a paragraph and wrap text around it. Not exactly what you asked for but this one is just much neater if you write small nice small chunks of code. From anywhere in the paragraph type:
>ip (indent paragraph)
ki (jump before the first line and open a new one)
type what you want at the beginning of the paragraph here
<Esc>} (jump to after the last line of paragraph)
type what you want at the end of of the paragraph
<CR><Esc>
Caveats here are, as implied, this must be a "paragraph" (no empty lines) and this will not work properly if there is no new line after the paragraph. To accomodate this, use i instead of o but then you will be an empty line before the bottom bit of code you insert. You would need to write up something in vimscript if you wanted to account for this.
Here are all the strokes I use for setting up macro t to do a begin/rescue/end (for example) block:
qt>ipkibegin<Esc>}orescue<CR>end<CR><Esc>q
There are certainly better ways but this is keeping it at the marco level.