swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.75k stars 1.11k forks source link

VIM-like marks (mark/goto) #8319

Open stablestud opened 3 months ago

stablestud commented 3 months ago

VIM-like marks as described in i3wm docs do not work as sway has no i3-input counterpart.

While the ground functionality exists for adding marks and jumping to them, the i3-input is not available thus its not possible in sway.

To my knowledge there is currently no utility which reads a single key and executes a command based on it just like i3-input did. See the examples in the i3wm docs

Are others also having interest in that VIM-like behavior? I currently really miss that in sway.

mcepl commented 2 months ago

https://github.com/ilya-zlobintsev/sway-marker ?

ArijanJ commented 1 month ago

You can use anything else, like zenity for example:

i3-goto-mark

#!/usr/bin/env bash
# In the i3 window manager, goes to a mark provided by zenity

# No mark provided as argumentt
if [[ $# -lt 1 ]] ; then
    MARK=$(zenity --title 'i3-goto-mark' --text 'Go to which mark?' --entry)
else
    MARK=$1
fi

i3-msg "[con_mark=$MARK] focus"

i3-mark

#!/usr/bin/env bash
# Mark a window in the i3 window manager using a user-provided string through zenity

# No mark provided as argument
if [[ $# -lt 1 ]] ; then
    MARK=$(zenity --title 'i3-mark' --text 'Mark the current window as what?' --entry)
    # Wait for zenity to go away (Optional)
    # sleep .1
else
    MARK=$1
fi

i3-msg "mark $MARK"