Skip to content

Instantly share code, notes, and snippets.

@ghosty141
Created June 17, 2019 18:26
Show Gist options
  • Save ghosty141/fdf047d06c5e78b089d801885a674907 to your computer and use it in GitHub Desktop.
Save ghosty141/fdf047d06c5e78b089d801885a674907 to your computer and use it in GitHub Desktop.
.ycm_extra_conf.py that just wraps a .clang_complete file for usage with YouCompleteMe and adds some extra flags
import os
import ycm_core
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
'-ferror-limit=10000',
'-DNDEBUG',
'-std=c++11',
'-xc++',
]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def IncludeClangCompleteFlags():
return open(os.path.join(DirectoryOfThisScript(), '.clang_complete'), 'r').read().replace('"', '').splitlines()
# This is the entry point; this function is called by ycmd to produce flags for
# a file.
def FlagsForFile( filename, **kwargs ):
clang_complete_flags = IncludeClangCompleteFlags()
return {
'flags': flags + clang_complete_flags,
'include_paths_relative_to_dir': DirectoryOfThisScript()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment