]> git.rmz.io Git - dotfiles.git/blobdiff - vim/ycm_extra_conf.py
vim: add loupe plugin to staging
[dotfiles.git] / vim / ycm_extra_conf.py
index 391fa8c029e634836affa458cb157c6592e7e4e9..ac15c2297f5316fdf57ff37e29ffae07cfc694d2 100644 (file)
@@ -3,29 +3,35 @@ import shlex
 import subprocess
 import ycm_core
 
-# These are the compilation flags that will be used in case there's no
-# compilation database set (by default, one is not set).
-# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
-flags = [
-'-Wall',
-# '-Wextra',
-# '-Wshadow',
-# '-Werror',
-# '-Wc++98-compat',
-# '-Wno-long-long',
-# '-Wno-variadic-macros',
-# '-fexceptions',
-# '-DNDEBUG',
-'-std=c++11',
-'-stdlib=libc++',
-'-x', 'c++',
-'-I', '.',
-'-I', './include',
-'-isystem', '/usr/include/c++/4.9.0',
-'-isystem', '/usr/include/c++/4.9.0/x86_64-unknown-linux-gnu',
-'-isystem', '/usr/include/c++/4.9.0/backward',
-'-isystem', '/usr/lib/clang/3.4.1/include'
-]
+def FlagsForFile( filename, **kwargs ):
+  client_data = kwargs['client_data']
+  cwd = client_data['getcwd()']
+  # These are the compilation flags that will be used in case there's no
+  # compilation database set (by default, one is not set).
+  flags = [
+  '-Wall',
+  # '-Wextra',
+  # '-Wshadow',
+  # '-Werror',
+  # '-Wc++98-compat',
+  # '-Wno-long-long',
+  # '-Wno-variadic-macros',
+  # '-fexceptions',
+  # '-DNDEBUG',
+  '-std=c++11',
+  '-stdlib=libstdc++',
+  '-x', 'c++',
+  '-I', '.',
+  '-I', './include',
+  ]
+  flags += rospack()
+  relative_to = cwd
+  final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
+
+  return {
+    'flags': final_flags,
+    'do_cache': True
+  }
 
 # This function makes it easy to pull in additional flags from rospack
 def rospack():
@@ -43,7 +49,6 @@ def rospack():
       includes += ['-isystem', include]
   return filter(lambda a: a != ' ', includes)
 
-flags += rospack()
 
 def DirectoryOfThisScript():
   return os.path.dirname( os.path.abspath( __file__ ) )
@@ -76,11 +81,3 @@ def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
       new_flags.append( new_flag )
   return new_flags
 
-def FlagsForFile( filename, **kwargs ):
-  relative_to = DirectoryOfThisScript()
-  final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
-
-  return {
-    'flags': final_flags,
-    'do_cache': True
-  }