Tuesday, 15 September 2015

vim - Qt Creator tag file -



vim - Qt Creator tag file -

i utilize vim c++ code editing. code completion isn't (although have tried many plugins, such omnicppcomplete). qt creator code completion awesome, , has vim style editing functionality total plenty me. thing isn't me cannot utilize ctags functionality within qt creator (although qt creator has functionality go class definition, takes lot more time parse source code).

is possible create source code tag file , utilize in qt creator in false vim mode?

code completion c++ in vim superior. i'll outline steps have take in order create work. however, won't go much detail here (such building huge open-source code base, cloning repository, installing plugins vim, etc.) because otherwise worth writing big tutorial novices. so, assuming well-aware , well-prepared software developer, there go fluent guide:

get , install clang_complete (plugin vim);

get , install neocomplcache (plugin vim);

if on unix, lucky because have llvm , clang either installed on scheme or have utilize bundle manager , install them single command. if so, can jump lastly step (#7).

if on windows, less lucky, that's improve practical point of view - you'll have great experience of building huge stuff on own , getting things work no matter what. :)

so, if you're on windows (and using qt creator can see), might have mingw installed on system. if that's not case, suggest install bleeding-edge mingw-w64. fortunately, don't have compile rubenvb has kindly built mingw-w64 toolchain in both variants: targeting 64-bit windows (aka x64) , targeting 32-bit windows (aka x86). download 1 depending on os. note: these links pointing latest (at time of writing answer) stable builds of mingw-w64, i.e. based on gcc 4.7.2. important: create sure mingw-w64 in %path% environment variable.

another piece of software needed cmake (a popular build system). again, if on unix might installed already. if on windows, download , install it. important: create sure cmake in %path% environment variable.

the lastly thing we'll need python. 1 time again, if on unix, installed on system. otherwise, know already. :) officially, there 2 versions of python: 2.7.3 , 3.x.x - should download , install both. python essential piece of software on developer's machine. important: create sure python 2.7.3 (not 3.x.x!) in %path% environment variable.

now have mingw-w64, cmake, python installed, ready build llvm , clang. ease pain go out-of-source builders project , scroll downwards guide: build 64-bit llvm , clang windows (64-bit) using mingw-w64. if on 32-bit windows, don't pay attending 64-bit (it not matter) in title, follow instructions there. wait hr until llvm , clang built.

we done, left configure vim properly. here i'll provide configuration satisfy needs.

configure neocomplcache:

let g:neocomplcache_enable_at_startup = 1 allow g:neocomplcache_enable_smart_case = 1 allow g:neocomplcache_enable_camel_case_completion = 1 allow g:neocomplcache_enable_underbar_completion = 1 allow g:neocomplcache_min_syntax_length = 2 if !exists('g:neocomplcache_force_omni_patterns') allow g:neocomplcache_force_omni_patterns = {} endif allow g:neocomplcache_force_overwrite_completefunc = 1 allow g:neocomplcache_force_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' allow g:neocomplcache_force_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)' \ . '\|\h\w*::' allow g:neocomplcache_force_omni_patterns.objc = '[^.[:digit:] *\t]\%(\.\|->\)' \ . '\|\h\w*::' allow g:neocomplcache_force_omni_patterns.objcpp = '[^.[:digit:] *\t]\%(\.\|->\)' \ . '\|\h\w*::' inoremap <expr> <tab> pumvisible() ? "\<c-n>" : "\<tab>" inoremap <expr> <s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"

configure clang_complete:

let g:clang_use_library = 1 allow g:clang_auto_select = 0 allow g:clang_complete_auto = 0 allow g:clang_complete_copen = 1 allow g:clang_complete_macros = 1 allow g:clang_complete_patters = 1 allow g:clang_library_path = 'd:/toolchains/x64/llvm/3.3/bin' allow g:clang_auto_user_options = 'path, .clang_complete'

for more info on both of these plugins utilize vim's help documentation: :h clang_complete , :h neocomplcache. there lots of options tweak, in neocomplcache. point of view both plugins must have c++ developer uses vim.

note: if don't know how finish of steps listed here, have either inquire additional questions here on stackoverflow or elsewhere reason described in origin of answer.

i hope helps , favor vim more development efforts now. :)

qt vim qt-creator ctags

No comments:

Post a Comment