The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
0

Vim and keybinds

asked 2013-07-28 16:04:39 +0000

Kratisto gravatar image

Does anyone use Vim and i3? If so how do you manage keybinds? It seems difficult since movement is different on each. It seems like changing i3 to vim makes more sense since I am more likely to use vim on another machine than i3.

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
3

answered 2013-07-29 01:07:37 +0000

syl20bnr gravatar image

Just edit your ~/.i3/config file and shift all default key bindings jkl; to hjkl.

edit flag offensive delete link more
0

answered 2013-08-03 16:01:49 +0000

alf gravatar image

Change these lines in your configuration file:

# change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

# split in horizontal orientation
bindsym $mod+Shift+v split h

# split in vertical orientation
bindsym $mod+v split v

# resize window (you can also use the mouse for that)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindsym $mod+h resize shrink width 10 px or 10 ppt
        bindsym $mod+j resize grow height 10 px or 10 ppt
        bindsym $mod+k resize shrink height 10 px or 10 ppt
        bindsym $mod+l resize grow width 10 px or 10 ppt

        # same bindings, but for the arrow keys
        bindsym Left resize shrink width 10 px or 10 ppt
        bindsym Down resize grow height 10 px or 10 ppt
        bindsym Up resize shrink height 10 px or 10 ppt
        bindsym Right resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
}
edit flag offensive delete link more
0

answered 2013-07-29 00:52:57 +0000

I think you have confused things here. Vim is a command-line based text editor, and i3 is a window manager. They serve different purposes.

You can use both without any problems. The usual $mod key we rely on i3 for handling the windows is normally "Window" button, which is not used in vim by default. So, if you have colliding bindings for i3 and vim, then you need to sort them out on your own.

But if that's your case, I'd say that you are doing something wrong. I am not a VIM guru, but I use it in a regular basis and never had to use keys that collide with i3 ones... if that ever happen, you need to decide which one you will use for what purpose, and that's it.

edit flag offensive delete link more

Comments

1

They don't conflict as in not work. My point was that it would be very difficult using two different movement schemes.

Kratisto gravatar imageKratisto ( 2013-07-29 22:35:17 +0000 )edit

Question Tools

Stats

Asked: 2013-07-28 16:04:39 +0000

Seen: 3,510 times

Last updated: Aug 03 '13