Wikia

Vim Tips Wiki

Script:30

Talk0
1,612pages on
this wiki

Use this page to discuss script 30 python: menus/shortcuts to work with Python

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

ShortcutsEdit

]t Jump to beginning of block
]e Jump to end of block
]v Select block (visual line mode)
]< Shift block to left
]> Shift block to right
]# Comment selection
]u Uncomment selection
]c Select current/previous class
]d Select current/previous function
]<up> Jump to previous line with same/lower indentation
]<down> Jump to next line with same/lower indentation

CommentsEdit

I would suggest using "normal! " in the script as suggested here (http://stevelosh.com/blog/2011/09/writing-vim-plugins/#please-for-the-love-of-god-use-normal).

I had to locally modify the plugin to work correctly since I remapped <Up>,<Down>, etc..


I've noticed that at least some of the movement commands (]j, ]J, ]f and ]F at least) don't update the jumplist, so CTRL+O doesn't flip the user back to their previous position. An easy solution would be to modify the script to manually add the previous position to the jumplist by changing the mappings from this:

map ]j  :call PythonDec("class", 1)<CR>

to this:

map ]j  m':call PythonDec("class", 1)<CR>

There may well be a more elegant solution, but that seems to have worked for me.

Around Wikia's network

Random Wiki