Skip to content

Instantly share code, notes, and snippets.

@abadger
Created August 23, 2022 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abadger/f516f167a572231fa2a8bc5efec70c36 to your computer and use it in GitHub Desktop.
Save abadger/f516f167a572231fa2a8bc5efec70c36 to your computer and use it in GitHub Desktop.
toggle vim for copy and paste (using snake)
@snake.key_map("<c-p>", mode=snake.INSERT_MODE)
def toggle_gutters_insert():
"""Turn the gutters off in insert mode to make mouse selection easier"""
line_no_value = snake.get_option('nu')
signcolumn_value = snake.get_option('signcolumn')
if signcolumn_value != 'no' or line_no_value != '0':
snake.set_option('signcolumn=no')
snake.set_option('nonumber')
else:
snake.set_option('signcolumn=yes')
snake.set_option('nu')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment