I use setxkbmap to define layout change shortcut as ctrl+shift, as I am used to. But I face a problem sometimes that it clashes with shortcuts of the software I use, like ctrl+shift+A. How can I avoid changing layout when I press ctrl+shift+other_button? I use OpenSuse Linux with i3 wm.
There isn't really a way around this if you want to use ctrl+shift to switch you layouts because ctrl+shift is now caught by xkb at a lower level than the applications you are using. I had the same issue and just switched to using both ctrls to change layout. Have a look at
$ grep 'grp:' /usr/share/X11/xkb/rules/base.lst
grp:switch Right Alt (while pressed)
grp:lswitch Left Alt (while pressed)
grp:lwin_switch Left Win (while pressed)
grp:rwin_switch Right Win (while pressed)
grp:win_switch Any Win key (while pressed)
grp:caps_switch Caps Lock (while pressed), Alt+Caps Lock does the original capslock action
grp:rctrl_switch Right Ctrl (while pressed)
grp:toggle Right Alt
grp:lalt_toggle Left Alt
grp:caps_toggle Caps Lock
grp:shift_caps_toggle Shift+Caps Lock
grp:shift_caps_switch Caps Lock (to first layout), Shift+Caps Lock (to last layout)
grp:win_menu_switch Left Win (to first layout), Right Win/Menu (to last layout)
grp:lctrl_rctrl_switch Left Ctrl (to first layout), Right Ctrl (to last layout)
grp:alt_caps_toggle Alt+Caps Lock
grp:shifts_toggle Both Shift keys together
grp:alts_toggle Both Alt keys together
grp:ctrls_toggle Both Ctrl keys together
grp:ctrl_shift_toggle Ctrl+Shift
grp:lctrl_lshift_toggle Left Ctrl+Left Shift
grp:rctrl_rshift_toggle Right Ctrl+Right Shift
grp:ctrl_alt_toggle Alt+Ctrl
grp:alt_shift_toggle Alt+Shift
grp:lalt_lshift_toggle Left Alt+Left Shift
grp:alt_space_toggle Alt+Space
grp:menu_toggle Menu
grp:lwin_toggle Left Win
grp:win_space_toggle Win Key+Space
grp:rwin_toggle Right Win
grp:lshift_toggle Left Shift
grp:rshift_toggle Right Shift
grp:lctrl_toggle Left Ctrl
grp:rctrl_toggle Right Ctrl
grp:sclk_toggle Scroll Lock
grp:lctrl_lwin_rctrl_menu LeftCtrl+LeftWin (to first layout), RightCtrl+Menu (to second layout)
grp:lctrl_lwin_toggle LeftCtrl+LeftWin
These are all the different key combinations you can use to change the layout. I use grp:ctrls_toggle but you have a lot of options to play with and see what you like.
I had a similar issue, and worked out a compromise which wasn't immediately obvious from the accepted answer.
My layout switching was initially set to Alt+Shift
and this interfered with my ability to use the Alt+Shift+} shortcut to indent in nano / pico.
My compromise was to change the layout switching option from grp:alt_shift_toggle to grp:lalt_lshift_toggle. In other words, only pressing the left Alt and left Shift together change layouts, leaving, e.g. (left) Alt + (right) Shift + } free to produce the desired indentation effect in pico.
In case it is useful to anyone, this is the full line I used in my .fluxbox/startup file:
setxkbmap -layout "gb,gr,ru" -variant ",,phonetic_winkeys" -option "grp:lalt_lshift_toggle" -model pc105 -rules evdev # keyboard layout switching
Related
How to fast change focus between windows in neovim? I dont know how to make it.
A quick reference from usr_08.txt
CTRL-W h move to the window on the left
CTRL-W j move to the window below
CTRL-W k move to the window above
CTRL-W l move to the window on the right
CTRL-W t move to the TOP window
CTRL-W b move to the BOTTOM window
If you're a new user (and have done vimtutor), I highly recommend going through the user manual (or at least skim through it, so that you learn the basics of Vim) - :h user-manual.
Both for Vim and NeoVim, why don't you give a try to this plugin I've created to allow easy movement between, and "management" of, windows and tabs?
I you go to that page, you'll see I've included a GIF showing the keys I press and what they do. Essentially you press leader+w to enter a "window management"-mode which interprets any key as if it was preceded by Ctrl-W.
Is it possible to some how setup IntelliJ IDEA so that I can column select with the cursor keys similarly to how I might in Notepad++, Visual Studio, or FlashDevelop.
For instance when I'm typing code I almost always do my navigation solely through use of the keyboard. In the IDEs mentioned previously I can quickly select blocks of code by holding Shift + Alt then tapping ↑ to extend my cursor across the lines above. I can then hold Shift + Alt + Ctrl and tap ← or → to quickly jump across words and select the chunk of text I want.
In IntelliJ IDEA I have to constantly enable and disable Column Selection Mode using the Shift + Alt + Insert and even then it doesn't quite function as it does in the other IDEs or Text Editors.
Any ideas?
You can do column editing using the Edit | Column Selection Mode.
The shortcut to turn it on/off is Alt+Shift+Insert. You navigate with arrow keys to select blocks of text.
Multiline Caret (without mouse)
Windows/Linux: CTRL + CTRL(Hold) + ↑ / ↓
Mac: ⌘ + ⌘(Hold) + ↑ / ↓
ESC will end multiline mode.
Change Multi-caret Hotkey
To add a custom Keymap, CTRL+SHIFT+A, type keymap and click on the one with Settings as subtext. Search for Clone Caret Above and Clone Caret Below.
I mapped mine to ALT+SHIFT+↑ / ↓.
Bonus
Try holding combinations of CTRL, SHIFT, and arrows for improved selection power.
It is also possible to select holding middle mouse key.
Go to the Settings | Keymap and set a shortcut for Clone Caret Above and for Clone Caret Below
Most convenient way is to:
MAC: Hold Option+Shift and click with mouse.
Windows: Hold Alt and click with mouse.
On a mac, to toggle block select on/off:
shift command 8
⇧⌘8
For me on Mac:
Press once 'option' key, release it, and press and hold it again.
Now navigate with cursor to select desired code.
Press 'Esc' to exit column mode! :)
I think #Meo's answer is the most correct, but if your hand happens to be on the mouse, you can also accomplish this with Ctrl+Alt+Shift+Left Mouse Button Click. Or look for the Add Rectangular Selection on Mouse Drag in the keymap settings.
In Windows or Linux I press two times Ctrl
For Mac cmd+shift+* didn't work for me. I changed the keymap to something else and now it works seamlessly.
Sometimes I have to write Java class where I need to define multiple fields of the same type. For example, I know that I will need to duplicate private final String on the next 4 lines.
Is it possible to spawn multiple carets in IntelliJ editor, so I can type on mutliple lines at the sime time?
IntelliJ IDEA 14.1 & 15
You can press Alt + Shift and using the mouse left click you can put many carets.
E.g.:
will become
typing "added" only once.
If you want to have a continuous vertical line, it's enough to press Alt + drag your mouse vertically. If there are lines with a length lower than the current position, the vertical line will be broken (carets will be placed at the end of every line) if "Allow placement of caret after end of line" is disabled (in File > Settings... > Editor > General > Virtual Space).
Another way to add a continuous vertical line is to hit Ctrl twice and then press up or down arrow key (supported in JetBrains 2016.X products, and possibly earlier).
If you cannot get the shortcuts working, check what they're currently assigned to under Settings > Keymap Add or Remove Caret, Clone Caret Above and Clone Caret Below. If they look right and you're on Linux, your window manager may be capturing the combination, e.g., for Alt + window drag operations.
See:
http://blog.jetbrains.com/idea/2015/02/multiple-selections-in-editor-using-mouse/
https://www.jetbrains.com/help/idea/2016.3/multicursor.html
I think "Column Selection Mode" could help you. You can enable it in the context menu in the editor. Then you can select multiple lines and type same text at once.
Column Select
For Windows, you can use CTRL+CTRL(Hold)+↑ / ↓. For Mac, replace the CTRL with ⌘.
Change Multi-caret Hotkey
To add a custom Keymap, CTRL+SHIFT+A, type keymap and click on the one with Settings as subtext. Search for Clone Caret Above and Clone Caret Below.
I mapped mine to ALT+SHIFT+↑ / ↓.
Bonus
Try holding combinations of CTRL, SHIFT, and arrows for improved selection power.
On Windows:
You can enable the Column Selection Mode (Alt + Shift + Insert)
And then Shift + ↑ / ↓ can select multiple columns
Hit Esc to go back to single cursor
Add/remove a caret: Alt + Shift + Mouse Click
Remove all carets: Esc
As for now(2018.9), you just:
Press middle mouse key to create a four-rows-high caret
Type what you want
Or,
Create the first line,
Press the "Duplicate entire line" key combination to create a new, identical line.
By the way, I think "multiple caret" should be like carets enabling me to edit different locations which are not necessarily vertically aligned. In Sublime Text you can press Ctrl and click. And in IntelliJ you can only "Clone caret up/down", that is to say, they are vertically aligned, which is not flexible.
Using R# IntelliSense, when I move mouse over items in the list, only background color of items changed to emphasize the item under mouse. But, I want to see datatip of the item under mouse.
Note: At below images, mouse pointer is over LogMethodCall item.
Happened:
Desired:
Edit:
This behaviour was formerly available (may be in a previous version of ReSharper) and so useful for me.
If you are pressing the CTRL + Space (Symbol code completion) keyboard shortcut then try using the CTRL + ALT + Space (Smart code completion) shortcut to get the current method to be highlighted. (Note, these shortcuts are for the Visual Studio scheme, they will be CTRL + Space and CTRL + SHIFT + Space respectively for the IDEA scheme)
In Vim, the usual way to jump to the definition of the keyword under the cursor is to type CTRL-] (as claimed by :he CTRL-\]).
But when you have a QWERTZ keyboard (see below, Strg is Ctrl), you're in some trouble: there is no separate ] key on the keyboard; you'll have to press ALT GR-9 to type the ]. So, to jump to a tag, it`s neccessary to hit CTRL-ALT GR-9 which doesn't work (and is also not feasible because you'll break your fingers if you happen to use that often).
So, how could I jump to a tag using my QWERTZ keyboard?
In addition, I'd also be glad if someone could explain why pressing CTRL-ALT GR-9 does not work.
Edit:
I'm not interested in the obvious answers "remap to something else" or "press the mouse button".
Duplicate on Vi/Vim: https://vi.stackexchange.com/questions/5732/tag-navigation-using-ctrl-does-not-work-with-non-english-keyboard-on-windows
As weird as it reads, on AZERTY keyboards (french layout specifically) $ is at the same spot as ] on QWERTY keyboards so I must hit <C-$> to jump to definition.
See if <C-+> does the trick.
On an AZERTY keyboard press:
ctrl shift 8 to go to List item
ctrl shift 7 to go from
The same in excel as
ctrl [
ctrl ]
On a QWERTZ mac keyboard Ctrl+option+6 worked for me. And jumping back worked as expected with Ctrl+T or Ctrl+O.