Suckless's simple terminal how to configure alt gr and single keystroke for tilde - terminal

In Suckless's simple terminal (st) I can type the tilde ~ by pressing the keys alt gr and 4. But with alt gr and the key to the right of the ñ key, I have to press twice this last key, I want to use alt gr and a single keystroke of the key to the right of the ñ key.
I can do it on other terminals and applications, for example xfce4-terminal, Firefox...
Details:
Keyboard: Spanish, example: https://assets.ltkcontent.com/images/spanish-keyboard-yd.jpg.
Operating system: Arch Linux
Window manager: i3wm
localectl status command output:
System Locale: LANG=es_ES.UTF-8
VC Keymap: es
X11 Layout: es
I don't know If I have to modify the st config files.
Thank you for your help.

Related

Byobu Shift + F2 not working on windows

Connecting to byobu in Ubuntu 16.04.3 LTS on a Windows 10 system, when I type Shift+F2 to get a vertical split, nothing happens. Typing plain F2 works and opens a new window. Ctrl + F2 works too and splits vertically.
I tried all the terminal keyboard types in PuTTY/Kitty/ConEmu configuration (ex. XTerm R2, Linux) without any luck. Any ideas? Is there any another keyboard shortcut to do the same thing?
How about using the Ctrl + A commands which is what I use mostly.
Ctrl + A then | will give you a horizontal split
Ctrl + A then % will give you a vertical split

ZSH shell and CLion/PyCharm integration, movement around terminal

I'm trying to use zsh in the CLion terminal window (changed my shell to /bin/zsh)
But when I try to move around using Ctrl + Left, Ctrl + Right, Ctrl + E... I get the literal characters D, C and Ctrl + E opens the "Recent files" UI
Is there any way around this? I'd like to use the movement keystrokes as I can with bash.
Tempoz,
Check out the offical Zsh Line Editor doc and the Z-Shell Line Editor guide for tons of detail.
To start, you can see your current mappings by typing bindkey at your prompt. There are two start modes: emacs [default], and vi. If you want to use vi mode, add this to your ~/.zshrc
bindkey -v
and source it (or restart your shell, or restart your IDE). Check out how the bindkey output has changed.
If you decide you want to change or augment your key mappings, use bind in your ~/.zshrc to reassign, or add to your key map.
# Example key binding change
# bindkey key-sequence editor-command
bindkey '^Z' vi-kill-line
You will also probably want to fix your $PATH - all the JetBrains products do it incorrectly. See this answer: https://stackoverflow.com/a/51006003/1089228

Binding option left and right arrows to move by words in zsh command line

I'm using iTerm2 on Mac OSX 10.8 with an xterm key binding and zsh.
I'd like zsh to use option left arrow and option right arrow to do the standard Mac bindings of left and right word.
If I hit ctrl-v then option-left and right arrows, where are the two key sequences that print:
^[[1;9D
^[[1;9C
I tried using binding these sequences using bindkey -v, but with no luck.
You can configure iTerm2 to do this like so:
Go to iTerm2 > Preferences > Profiles > Keys
If there is already an ⌥ ← or ⌥ → setting, delete it by selecting it and hitting -.
Add a new shortcut by hitting the + button.
Type ⌥+← in the Keyboard shortcut box.
Select Send Escape Sequence in the Action box.
Enter b for Characters to send.
Click Ok.
Repeat the above procedure for ⌥ →, this time entering f for the Characters to send.
Taken from this great tutorial which describes the whole process in detail and with pictures:
Use ⌥ ← and ⌥ → to jump forwards / backwards words in iTerm 2, on OS X | Coderwall
Add the following to .zshrc
# Skip forward/back a word with opt-arrow
bindkey '[C' forward-word
bindkey '[D' backward-word
If you're looking to easily add this and a bundle of similar mappings, there's a "Natural Text Editing" preset under Preferences > Profiles > Keys (version 3):
Simply add these to your .zshrc
bindkey "\e[1;3D" backward-word # ⌥←
bindkey "\e[1;3C" forward-word # ⌥→
bindkey "^[[1;9D" beginning-of-line # cmd+←
bindkey "^[[1;9C" end-of-line # cmd+→
It works for me using kitty

For the Vim editor, how do I map a function key in .vimrc on Mac OS X?

I'm trying to map f11 to a command within vim, with a line in .vimrc such as:
map <F11> :exe '!ctags -R --python-kinds=-i -f ./tags ' . shellescape(system('python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"'))<CR>
But if you hit F11 it just turns up the volume. Is it possible to remap keys that have
OS-wide functions in OSX?
I don't want to remap any more commonly used key here because regenerating tags takes awhile.
You have two options that I know of:
1) Enable the regular use of the function keys, ie. f1 - f12 no longer executes the OSX specific command such as decrease volume. Instead you will have to hold the fn key press the f key. I have this set up on my computer and I've successfully mapped the function keys in Vim / MacVim. To do this go to System preferences --> Keyboard and check of the Use all F1, F2,...
2) Use fn + F11 to execute the command.
6 years later...
Check out https://github.com/Pyroh/Fluor/releases
It allows you to change the behavior of the function keys based on the app that is currently active.

Can't Map <S-CR> in Vim

Got my first Mac over the weekend, and I'm trying to get adjusted. This line in my vimrc, which worked on my windows, won't work with vim through iTerm
inoremap <S-CR> <Esc>
I'm wanting Shift-Enter to act as Escape in insert mode. I've tried using Enter and Return, but that requires me to use the Fn key on my Macbook, which is just as annoying as the escape key.
I Appreciate the help!
The problem here is with the terminal emulation. Most terminals cannot distinguish between non-printing keys [1] and those keys combined with modifier keys.
However, you can still make the desired combination work if your terminal application has the ability to remap key combinations (as iTerm2, for example, does). Map the terminal application's combination to some Unicode character you'll never use, then map that key in Vim to the desired effect, and you can get around this limitation.
For this example, in iTerm2, open the Keys Preferences pane, add a Global Shortcut key, input shift and return, give it an action of Set Text, and then put ✠ (a Maltese Cross, but you could use any random unlikely-to-be-used Unicode character) as its value. In your .vimrc, add these lines:
" Map ✠ (U+2720) to <Esc> as <S-CR> is mapped to ✠ in iTerm2.
inoremap ✠ <Esc>
Or:
inoremap <S-CR> <Esc>
" Map ✠ (U+2720) to <S-CR>, so we have <S-CR> mapped to ✠ in iTerm2 and
" ✠ mapped back to <S-CR> in Vim.
imap ✠ <S-CR>
Entering <S-CR> in Vim in iTerm2 will now ultimately result in <Esc> in Vim as desired.
[1]: E.g. space, tab, enter, delete, control, alt, escape.
That's because for iTerm <S-CR> is the same as <CR>, type Ctrl+V Return then Ctrl+V Shift+Return and you'll see that the same character is inserted in both cases.
So, when you type <S-CR> Vim gets <CR> and your mapping is not triggered.
MacVim is the equivalent of GVim: a GUI for Vim. You don't run MacVim through iTerm. You either run the GUI version (MacVim.app) OR the CLI version ($ vim).
You can launch the GUI from the CLI but iTerm's settings won't interfere in any way with MacVim's settings.
In MacVim your mapping works perfectly.
As far as I know all or most "terminals" treat ⇧↩ the same as ↩. Maybe you should try another sequence like jj?

Resources