jdevlieghere / dotfiles Goto Github PK
View Code? Open in Web Editor NEW⚙ Dotfiles for Linux &macOS
License: MIT License
⚙ Dotfiles for Linux &macOS
License: MIT License
Very good idea to define a function in ycm_extra_conf.py to add project's include directory and its subdirectories to compilation flags. But I think the flag
variable should be initialized to ["-I" + include_path]
instead of []
, because we want to track headers not only in subdirectories but also in include_path
.
def FlagsForInclude(root):
try:
include_path = FindNearest(root, 'include')
flags = ["-I" + include_path] # flags = []
for dirroot, dirnames, filenames in os.walk(include_path):
for dir_path in dirnames:
real_path = os.path.join(dirroot, dir_path)
flags = flags + ["-I" + real_path]
return flags
except:
return None
In dotfiles/.vim/.ycm_extra_conf.py
the function FindNearest
is sometimes called with 2 arguments instead of the 3 compulsory arguments. I don't know what to put as 3rd argument so I can't make any pull request.
Thank you for providing the file, by the way!
Hello,
I stumbled upon your article about a better .ycm_extra_conf and I found it really great ! The only thing I missed was the possibility to keep the compile db in the not synced build folder while working with an out-of-source project. I added a few lines to FindNearest to make it look for a "build" folder each time it goes one directory up (the line starting with next_build_folder
and the following 5) :
def FindNearest(path, target):
candidate = os.path.join(path, target)
if(os.path.isfile(candidate) or os.path.isdir(candidate)):
logging.info("Found nearest " + target + " at " + candidate)
return candidate;
else:
parent = os.path.dirname(os.path.abspath(path));
next_build_folder = os.path.join(os.path.dirname(os.path.abspath(parent)),"build")
if (os.path.isdir(next_build_folder)):
if re.search("build",path):
logging.info("NOT doing twice " + path + " folder")
else:
return FindNearest(next_build_folder ,target)
if(parent == path):
raise RuntimeError("Could not find " + target);
return FindNearest(parent, target)
On linux there is actually a program called ip which is used to manage networking.
The alias ip shadows this. You might want to change the ip alias to something like ipof.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.