Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 669779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:11:18+00:00 2026-05-14T00:11:18+00:00

Are there any plugins or built-in methods in Vim for performing refactoring on C

  • 0

Are there any plugins or built-in methods in Vim for performing refactoring on C or C++ code, something like the refactoring tools in Eclipse?

I’m especially keen on the extract method refactoring tool from Eclipse that will determine parameters from new methods and typically also guess a variable to use as the return value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:11:18+00:00Added an answer on May 14, 2026 at 12:11 am

    No, although Vim is a good environment for editing, and can be customised in a lot of ways (code folding, syntax colouring, macro expansion etc.) most of these are done on the syntax level, rather than the semantic level. Even the code folding just matches up opposing braces.

    To do a proper refactoring, you have to have a lot of semantic knowledge about the AST, what variables are declared in which scope, and so on. IDEs like Eclipse build up a cache of the variables defined in each lexical scope, so that they can quickly refer back to where they are used in terms of determining what to rename and where.

    That’s not to say that you can’t do some things syntactically; after all, one can just take out a block of code and put it into a separate function easily enough. You might even be able to guess at some parameters (e.g. find a list of the variables, find out which ones have local declarations, remove them and what’s left are your parameters. But Eclipse also does other things—like figuring out whether any variables are modified in the function, and ensuring they’re passed back by the return value. It also checks for any thrown exceptions, and add them to the list.

    The net effect is that whilst you may be able to approximate some of these in Vim, you really aren’t going to be able to get this working in a Vim-only enviornment. You could either use a Vim-like keybinding in Eclipse proper, or look at eclim. From the home page:

    The primary goal of eclim is to bring
    Eclipse functionality to the Vim
    editor. The initial goal was to
    provide Eclipse’s java functionality
    in vim, but support for various other
    languages (c/c++, php, python, ruby,
    css, html, xml, etc.) have been added
    and several more are planned.

    Eclim is less of an application and
    more of an integration of two great
    projects. The first, Vim, is arguably
    one of the best text editors in
    existence. The second, Eclipse,
    provides many great tools for
    development in various languages. Each
    provides many features that can
    increase developer productivity, but
    both still leave something to be
    desired. Vim lacks native Java support
    and many of the advanced features
    available in Eclipse. Eclipse, on the
    other hand, still requires the use of
    the mouse for many things, and when
    compared to Vim, provides a less than
    ideal interface for editing text.

    That is where eclim comes into play.
    Instead of trying to write an IDE in
    Vim or a Vim editor in Eclipse, eclim
    provides an Eclipse plug-in that
    exposes Eclipse features through a
    server interface, and a set of Vim
    plug-ins that communicate with Eclipse
    over that interface.

    This not only gives an Eclipse-like environment, it is Eclipse. But you still get the navigation and text editing features of vim. It sounds like this might suit your needs, although the documentation on refactoring support doesn’t indicate that it provides an extract method functionality.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 361k
  • Answers 361k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Cavium Networks and Raza Microelectronics Broadcom are two large MIPS… May 14, 2026 at 2:49 pm
  • Editorial Team
    Editorial Team added an answer You should include the Properties folder; it contains AssemblyInfo.cs (with… May 14, 2026 at 2:49 pm
  • Editorial Team
    Editorial Team added an answer Yes, it's possible and the solution is here: http://blog.andregil.net/2010/01/how-to-remove-event-listeners-with-parameters-closure/ You… May 14, 2026 at 2:49 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.