Vim and keybinds
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.
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.
Just edit your ~/.i3/config file and shift all default key bindings jkl; to hjkl.
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"
}
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.
Asked: 2013-07-28 16:04:39 +0000
Seen: 3,510 times
Last updated: Aug 03 '13