Skip to content

Instantly share code, notes, and snippets.

@hiway
Created August 20, 2014 09:22
Show Gist options
  • Save hiway/f80cfaf5c87ac3dd1841 to your computer and use it in GitHub Desktop.
Save hiway/f80cfaf5c87ac3dd1841 to your computer and use it in GitHub Desktop.
Create VIM lockdown script where vimscript is not available => IdeaVIM (for PyCharm etc)
"""
Script to create an .ideavimrc comptabile VIM lockdown key-remapper as used by github.com/hiway/po
This will unmap EVERYTHING and render your VIM useless - the idea is to begin with your own keymapping instead of VIM's legacy keymaps. You may refer to github.com/hiway/po for more information.
To create a new .lockdown_ideavim: `python ideavimlockdown.py > ~/.lockdown_ideavim`
Then use it within your ~/.ideavimrc by adding "source ~/.lockdown_ideavim" within the file.
"""
excludes = [":", "\n", "!", chr(0x9), chr(0x16), " ", '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '(', ')', ',']
for mode in ['n', 'x', 'o']:
for char in range(8, 0x7F):
if chr(char) not in excludes:
print "{0}noremap {1} <Nop>".format(mode, chr(char))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment