Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

21 votes
7 answers
29046 views
Changing cursor style based on mode in both zsh and vim
I use *[vi-mode][1]* in *[oh-my-zsh][2]* with the *[af-magic][3] [theme][4]*. I want the cursor style to indicate whether I am in *normal mode* (block) or *insert mode* (beam), both in `zsh` and in `vim`. This is what I have so far: In my `~/.zshrc`: # vim mode config # --------------- # Activate vi...
I use *vi-mode * in *oh-my-zsh * with the *af-magic theme *. I want the cursor style to indicate whether I am in *normal mode* (block) or *insert mode* (beam), both in zsh and in vim. This is what I have so far: In my ~/.zshrc: # vim mode config # --------------- # Activate vim mode. bindkey -v # Remove mode switching delay. KEYTIMEOUT=5 # Change cursor shape for different vi modes. function zle-keymap-select { if [[ ${KEYMAP} == vicmd ]] || [[ $1 = 'block' ]]; then echo -ne '\e[1 q' elif [[ ${KEYMAP} == main ]] || [[ ${KEYMAP} == viins ]] || [[ ${KEYMAP} = '' ]] || [[ $1 = 'beam' ]]; then echo -ne '\e5 q' fi } zle -N zle-keymap-select # Use beam shape cursor on startup. echo -ne '\e[5 q' # Use beam shape cursor for each new prompt. preexec() { echo -ne '\e[5 q' } As found [here . In vim, I use *Vundle * and *terminus *. With these configurations, both zsh and vim work as they should when considered independently. However, when I enter vim from zsh in *insert mode*, vim starts in *normal mode* (as it should) but still shows the beam shape cursor. Similarly, when I exit vim, I get back to zsh in *insert mode*, but the cursor is still in block shape (since the last mode in vim was *normal*). When after this, I switch modes for the first time (in both zsh and vim), the cursor behaves the way it should again. How can I make them display the correct cursor after entering and exiting vim as well? I tried putting autocmd VimEnter * stopinsert autocmd VimLeave * startinsert in my ~.vimrc, but this does not affect the cursor.
maddingl (686 rep)
Mar 24, 2018, 03:15 PM • Last activity: Jan 3, 2025, 01:08 AM
1 votes
0 answers
53 views
Move text cursor with compose key sequence
I was wondering if it is possible in my `.Xcompose` file to have a compose sequence that also moves the cursor. For example, if I have ``` : " " ``` Is it possible to make it so that I can choose where the text cursor will be? In this example, it should be like ``` CURSOR HERE ``` If it's not possib...
I was wondering if it is possible in my .Xcompose file to have a compose sequence that also moves the cursor. For example, if I have
: ""
Is it possible to make it so that I can choose where the text cursor will be? In this example, it should be like
CURSOR HERE
If it's not possible via a compose key, is there any other way to do so?
QuickQuokka (11 rep)
Dec 5, 2023, 12:56 PM • Last activity: Dec 8, 2023, 10:37 AM
3 votes
2 answers
2506 views
How to Have key-repeats of Arrow keys when disabled key-repeats?
I need disabled key-repeats because 10% greater long-term WPM then, as described in the thread [How to Calibrate typing when unstable Cursor/Typing in Debian][1]. However, I think the feature of repositioning caret position is useful with long-presses of arrow-keys in using key-repeats. I would like...
I need disabled key-repeats because 10% greater long-term WPM then, as described in the thread How to Calibrate typing when unstable Cursor/Typing in Debian . However, I think the feature of repositioning caret position is useful with long-presses of arrow-keys in using key-repeats. I would like to maintain the long-presses of them but have custom settings for *delay* and *speed*. My settings in *Keyboard > Typing* where the *delay* and *option* should be individualized for arrow-keys in Fig. 1. Options where I cannot get (1) work at all and I keep option (2) too cumbersome for the task because of many buttons and keyboards 1. Disable all key-repeats and enable then those of arrow keys. 2. Allow all key-repeats and disable everything else than arrow keys. (olejorgenb's answer ) - - I think this proposal is not solid so reject because cannot reproduce the effect as described. - - Also outside of the scope of the question in the title. Fig. 1 Unchecked *Key presses repeat when key is held down* enter image description here Differential solutions 1. Is there a way to have it so that key repeats aren't disabled but only start after you've held a key down for a longer time? [Random832] - - Actually, I would like to know how this can work if you make many rapid changes in the directions of arrow-keys. Hardware: Asus Zenbook UX303UA OS: Debian 8.5 64 bit Linux kernel: 4.6
Léo Léopold Hertz 준영 (7138 rep)
Sep 3, 2016, 09:13 AM • Last activity: Sep 24, 2016, 08:40 AM
1 votes
1 answers
197 views
How to Calibrate Caret-Cursor's position when unstable Cursor in Debian?
Condition: unstable caret-cursor and its position Other complications: many enter-artifacts, much lost content because sudden selections of contents and overwrites, often ctrl + z does not work etc in *Google Product Forums* so much lost work time; my typing speed in Debian now: 10-30 WPM; normally,...
Condition: unstable caret-cursor and its position Other complications: many enter-artifacts, much lost content because sudden selections of contents and overwrites, often ctrl+z does not work etc in *Google Product Forums* so much lost work time; my typing speed in Debian now: 10-30 WPM; normally, 80-95 WPM long-term with Dvorak - configurating *Keyboard > Typing* in Fig. 1 cannot solve the artifacts so there must be something internal going on; possible related to, touchpad/... - keybooard-layout independent - occurs in Qwerty and Dvorak - no firmware errors - dmesg |grep firmware returns no relevant errors/warnings - keyboard-independent - problems occur with an external keyboard too I had to do about two corrections every sentence because of abnormal typing configuration. I think I am not touching the touchpad neither by accident. I think I have much more typing artifacts now than with Ubuntu 16.04. Fig. 1 Options which I change to find optimal configuration but not sufficient and something internal must be going on enter image description here System characteristics 0. I purged already xserver-xorg-video-intel because many bugs so using modesetting and (2) 1. Backported Linux kernel (4.6) and Skylake CPU support and firmware installed (thread How Smooth is Upgrading Linux kernel in Debian 8.5? ) - apt-get -t jessie-backports install linux-image-amd64 - apt-get -t jessie-backports install firmware-misc-nonfree 2. Installed wifi firmware - apt-get -t jessie-backports install firmware-iwlwifi Proposals 1. Some missing firmware because no firmware errors, severe problem and the setting *Keyboard > Typing* 2. Insufficient Skylake support in Linux kernel 4.6? I will exclude this thing by trying 4.7. - - I think CPU graphic can affect cursor's location, which stability seems to be the main problem here. Hardware: Asus Zenbook UX303UA Debian: 8.5 64 bit Linux kernel: 4.6 backported Keyboard layout: Qwerty, Dvorak, ...
Léo Léopold Hertz 준영 (7138 rep)
Sep 1, 2016, 08:53 PM • Last activity: Sep 3, 2016, 11:03 AM
Showing page 1 of 4 total questions