Skip to content

Instantly share code, notes, and snippets.

@iauns
iauns / gist:6276455
Created August 20, 2013 02:26
An example of my .ycm_extra_conf.py which includes several modifications. See: http://iauns.com/b?summary=false&articles=2013_08_Vim_Plugin:_YouCompleteMe
import os
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 = []
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
@iauns
iauns / cc_merge.js
Last active February 5, 2021 19:41
Merges multiple compilation databases (compile_commands.json -- output from CMake) into one. See this other gist for an example bash function that is responsible for compile_commands.json files and passing them into this script: https://gist.github.com/iauns/6276327.
#!/usr/bin/env node
var fs = require('fs');
var argv = require('optimist')
.usage('Merge multiple clang compile_commands.json into one file.')
.demand('o')
.alias('o', 'output')
.describe('o', "Output merged compile_command.json file.")
.argv;
var commands = [];
@iauns
iauns / merge.sh
Last active March 25, 2020 17:09
Simple bash function which finds a number of compilation databases and passes them into my cc_merge script.
#!/bin/bash
MergeCompileCommands()
{
BIN_DIR=$1
OUT_FILE=$BIN_DIR/compile_commands.json
command -v node >/dev/null 2>&1 || { echo >&2 "Node.js (node) is required but not installed. Aborting."; exit 1; }
command -v npm >/dev/null 2>&1 || { echo >&2 "Node.js' package manager (npm) is required not installed. Aborting."; exit 1; }
# Ensure node app is setup correctly (look for node_modules in target dir).