Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding "c++" and "h++" filetype #32

Open
ajcorda opened this issue Feb 21, 2023 · 0 comments
Open

Adding "c++" and "h++" filetype #32

ajcorda opened this issue Feb 21, 2023 · 0 comments

Comments

@ajcorda
Copy link

ajcorda commented Feb 21, 2023

HI! I love your vim-codequery plugin, but I needed to modify it to recognize my file extensions… I use .c++ and .h++ for code in my C++ development library.

The mods I made were to the first two lines in the codequery.vim file:

let g:c_family_filetype_list =
\ ['c', 'h', 'cpp', 'c++', 'cxx', 'cc', 'hpp', 'hxx', 'hh', 'h++']

let g:codequery_supported_filetype_list = g:c_family_filetype_list +
\ ['python', 'javascript', 'go', 'ruby', 'java', 'c', 'cpp', 'c++']

I also had to modify the db.vim file:

function! codequery#db#construct_c_db_build_cmd(db_path) abort
let find_cmd = 'find . -iname ".c" > c_cscope.files && ' .
\ 'find . -iname "
.h" >> c_cscope.files && ' .
\ 'find . -iname ".cpp" >> c_cscope.files && ' .
\ 'find . -iname "
.cxx" >> c_cscope.files && ' .
\ 'find . -iname ".c++" >> c_cscope.files && ' .
\ 'find . -iname "
.cc" >> c_cscope.files && ' .
\ 'find . -iname ".hpp" >> c_cscope.files && ' .
\ 'find . -iname "
.hxx" >> c_cscope.files && ' .
\ 'find . -iname ".h++" >> c_cscope.files && ' .
\ 'find . -iname "
.hh" >> c_cscope.files'

These seem to allow me to create a database and use the plugin properly with c++ and h++ files…

As I do not actually know vimscript, I thought I’d ask you to see if I missed anything else that
needed to be changed, or if you see any unintended consequences from these mods...

If these changes look OK to you, and you think it useful to other folks are using these extensions
for their c++ work, you might consider adding them to your official version..

Again, thanks for creating this great plugin!

-ajcorda@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant