Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what's the fastest way to select a function of Python via VIM?

Tags:

python

vim

Is it possible without any plugins? Or what's the best plugin for edit python file?

like image 792
northtree Avatar asked Jul 05 '11 08:07

northtree


People also ask

Can you use VIM for python?

Using Vim as a Python IDEThe python-mode project is a Vim plugin with syntax highlighting, breakpoints, PEP8 linting, code completion and many other features you'd expect from an integrated development environment.

How do I delete a function in Vim?

If your cursor is on the line with the function name, try d } . It will delete everything to the next block (i.e. your function body). Within the function body itself, d a p will delete the 'paragraph'.


2 Answers

try vis to visualy select and o to jump edges

like image 138
SergioAraujo Avatar answered Oct 20 '22 03:10

SergioAraujo


The way I do it is not specific to functions. It will just select a continuous block of Python code:

v]] if what you want to select is below the cursor
v[[ if it is above the cursor.

Just remove one bracket if the cursor is on the first line of the code block you want to select.

like image 36
Julius Avatar answered Oct 20 '22 05:10

Julius