vim-anywhere
vim-anywhere copied to clipboard
Keyboard shortcut not working in Linux
Just install here in my Ubuntu 13.04 and tried ctrl+alt+v
, but nothing happens...
Hey, sorry for the trouble.
What was the output of the installer? It should fail the install if you are missing any dependency. You are using Gnome right? I know you said Ubuntu, but just double checking.
Hi, @cknadler!
According the installer everything is installed and I already had Gnome and gVim installed.
Apparently everything is alright; vim-anywhere simply doesn't work... =(
Thats pretty strange. By nothing happens, I'm assuming you mean that gVim doesn't show up? What happens if you run the script directly?
$ ~/.vim-anywhere/bin/run -v # this will run what the shortcut would run with verbose output
If it still doesn't show up, paste me the output of that script.
I had the same problem, but manually setting the key-binding resolved it for me. After a little testing though, I think gconftool isn't setting key-bindings even if it is installed, I'm on Linux Mint.
I had the same problem on Ubuntu 13.10. Here is what I've got:
- vim-anywhere is properly configured, and
gconftool --get /desktop/gnome/keybindings/vim-anywhere/binding
properly returns<CTRL><ALT>v
. - Newer versions of Ubuntu seem to use
dconf
rather thangconf
. - setting keyboard shortcut for
~/.vim-anywhere/bin/run
manually (from All Settings -> Keyboard -> Shortcuts -> Custom Shortcuts) and rebooting (essentially, logging out and in) solves the issue.
After setting shortcut manually, in my environment,
dconf list /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0
shows 'binding', 'command' and 'name', where settings are stored.
dconf read /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command
shows '/home/(my_user_name)/.vim-anywhere/bin/run'.
We are aware that newer versions of gnome don't use gconf anymore. The current solution is to use gconftool if it is installed and use gsettings (dconf) as a fallback to set the shortcut. The real issue here is that people obviously have both gconf and dconf installed on their systems. We need a better solution to detect if a user has dconf as their main settings daemon vs gconf.
@pyrated good point. We will have to look at an alternate way to detect wether to use gconftool
or gsettings
. Clearly the current solution isn't working in all cases.
Incidentally, I was running into (what looked like) this problem with Ubuntu 14.04 and Gnome 3.10.4. ctrl + alt + v
didn't launch gvim. But setting the shortcut in Keyboard -> Shortcuts -> Custom Shortcuts didn't resolve it.
I found that using the full path to vim-anywhere in Custom Shortcuts, e.g. /home/user/.vim-anywhere/bin/run
instead of ~/.vim-anywhere/bin/run
, worked as expected. The shortcut had been created successfully, but for some reason tilde expansion wasn't happening.
For newer releases (I'm using 15.10) that use dconf instead of gconf:
- Go to All
Settings -> Keyboard -> Shortcuts -> Custom Shortcuts
. - Add custom keyboard shortcut:
- Name:
vim-anywhere
- Command:
/home/username/.vim-anywhere/bin/run
- select the new shortcut and press
ctrl+alt+v
- Name:
To see these settings, open dconf
editor and navigate to org -> gnome -> settings-daemon -> plugins -> media-keys -> custom-keybindings -> custom0
or in terminal:
dconf read /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/name
dconf read /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding
dconf read /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/command
This worked for me (ubuntu 16.04) after adding the entry via Go to All Settings -> Keyboard -> Shortcuts -> Custom Shortcuts. (couldn't get it to actually assign the key map):
dconf write /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/binding "'<Ctrl><Alt>v'"
[Yes, I know that the following is neither a code issue nor Linux. Please feel free to add it to the FAQ or README or something; just pls don't merely delete it. Thx. I've put it here because, when I was looking for guidance, this is where I ended up. And I'm sharing the resolution in case anyone else hits it in the future.]
FYI, the keyboard shortcut didn't work for on MacOS Big Sur until I restarted my machine.