Friday, March 22, 2013

Motion for C functions

Hi,

I often need to uncomment or copy a C function and I wonder if
there's a motion for that. What I do at the moment is

[[{v][y

which seems rather verbose and a lot to type for just "copy this
function". The following does not work for some reason:

[[{y][

The closing brace is missing. I tried

ya[

which seems logical, but it also does not work. If the functions do
not contain empty lines

yap

does the job, but only in case there are no empty lines. Here an
example of such a function:

template <typename Stream>
void do_read( Stream& stream, std::vector<char>& buf )
{
boost::asio::async_read(
stream, boost::asio::buffer( buf ), boost::bind( read_handler ));

stream.get_io_service().reset();
stream.get_io_service().run();

std::cout << "done" << std::endl;
}

Marco

No comments:

Post a Comment