The following demonstrates the most commonly used method to define a keyboard shortcut using global-set-key. The function bh/switch-to-scratch is okay "as-is". Keep in mind that we are defining SHIFT+F11 in this example:
(defun bh/switch-to-scratch ()
(global-set-key (kbd "<S-...
After reading the documentation and the source code of ivy, I think there is no way to disable the effect of / elegantly. I may be wrong, those who are interested in the question can see the function ivy--update-minibuffer which calls ivy--magic-file-slash to autocomplete directory by / if only one directory matched the input string.