Reputation: 3509
I have been setting up my development environment in Vim for a while now. Since all my projects are in C++11 I have found some plugins that made my life easier and almost as good as the days of Intellij and Java. However there are still some things missing.
The main feature I miss is the refactoring utilities (rename across project, refactor code into functions/classes, remove classes, ...). Any recommendations on how I can get such functionality in vim?
I am using the following plugins:
gmarik/vundle
Valloric/YouCompleteMe
a.vim
wincent/Command-T
DoxygenToolkit.vim
scrooloose/nerdtree
godlygeek/tabular
tpope/vim-sensible
tpope/vim-unimpaired
tpope/vim-endwise
tpope/vim-fugitive
jeffkreeftmeijer/vim-numbertoggle
Lokaltog/vim-easymotion
rstacruz/sparkup'
Mizuchi/STL-Syntax
If you want the full details, here is my .vimrc (feel free to contribute to it in the gist):
https://gist.github.com/MauricioCarneiro/9547864
Upvotes: 4
Views: 7849
Reputation: 1710
The only refactoring tool for c++11 I know of is clang-modernize from LLVM and Intel guys (Chandler Carruth from Google gave a speech about it on youtube). You can run it from vim as any other cli tool, e.g.:
:!clang-modernize -style=Google -format -loop-convert -pass-by-value -replace-auto_ptr -use-nullptr -use-auto -add-override -override-macros %
The %
sign at the end will expand to your current file's path. There's more tools available nowadays, like clangtidy
and cquery
.
You can probably make all fixers and linters auto correct your code as you type with something like ALE vim plugin. Alternatively (and this is my preferred solution) you could use a dedicated language server and coc.nvim plugin which allows for a full IDE experience (with code specific fixers, snippets, jump to definition, find all interface implementations, etc.).
Upvotes: 1
Reputation: 32966
In my plugins suites, you'll found:
On github, I also have an experimental project to wrap clang-indexer.
Upvotes: 4
Reputation: 309
I think you will need Ultisnips
, Tagbar
and tcomment
plugin, especially Ultisnips
.
More information about configuration, please refer:https://github.com/xautjzd/dotvim
Upvotes: 3
Reputation: 196876
Refactor is the only C++ refactoring plugin on vim.org. Its latest update is from 2007, though, so I'm not sure it will work for C++11.
You could also try Eclim, an Eclipse/Vim plugin that lets you use a number of Eclipse features from Vim.
Upvotes: 0