A vim plugin for libclang-based highlighting of C, C++, ObjC

Overview

color_coded: semantic highlighting with vim Build Status

color_coded is a vim plugin that provides realtime (fast), tagless code highlighting for C++, C, and Objective C using libclang.

  • Environmentally friendly
  • Lua binding for VimL -> C++
  • Exhaustive customization possibilities
  • Unintrusive highlighting; self-contained
  • Utilizes self-contained clang
Before color_coded After color_coded

Installation

OS X

Before installing color_coded on OS X, please read the following. The vim that ships with (even the latest) OS X is not new enough to support color_coded. Furthermore, the default macvim from homebrew doesn't have lua enabled. To ensure you have a valid macvim install on OS X, please do the following:

brew update
brew install macvim --with-lua --with-override-system-vim
brew linkapps macvim
brew install xz cmake
# Spawn a new shell to use the new system vim

To get proper highlighting, you'll also want the Xcode command line tools, which will give you the appropriate system headers:

xcode-select --install

Ubuntu/Debian

First, install all required dependencies.

[sudo] apt-get install build-essential libclang-3.9-dev libncurses-dev libz-dev cmake xz-utils libpthread-workqueue-dev

For lua, you must install the version that your version of vim is compiled for.

vim --version | grep lua

Find your version number -llua5.x and use it to install the correct version.

[sudo] apt-get install liblua5.x-dev lua5.x

You also need to ensure you have GCC 4.9 (or higher). If you don't, you can try the following (tested on Ubuntu 14.04).

# Install GCC 4.9
[sudo] add-apt-repository ppa:ubuntu-toolchain-r/test
[sudo] apt-get update
[sudo] apt-get install g++-4.9

# Prefer 4.9 to other versions
[sudo] update-alternatives --remove-all g++
[sudo] update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 50

FreeBSD / PCBSD

(Tested in FreeBSD 11.1)

$ [sudo] pkg install llvm40 cmake
$ cd ~/.vim/bundle/color_coded
$ mkdir build && cd build
$ cmake -DCUSTOM_CLANG=1 -DLLVM_ROOT_DIR=/usr/local/llvm40  ..
$ make && make install

Vundle and Pathogen

Installation has been tested using vundle, but should also be compatible with pathogen. To install using vundle (add the line to your ~/.vimrc, restart vim, run :PluginInstall):

Plugin 'jeaye/color_coded'

NeoBundle

Installation with NeoBundle supports automatically building and lazy-loading the plugin:

NeoBundleLazy 'jeaye/color_coded', {
  \ 'build': {
    \   'unix': 'rm -f CMakeCache.txt && cmake . && make && make install',
  \ },
  \ 'autoload': { 'filetypes' : ['c', 'cpp', 'objc', 'objcpp'] },
  \ 'build_commands' : ['cmake', 'make']
\}

All

Since color_coded has a compiled component, you'll need to manually compile when installing and updating (unless your vim package manager does it for you). Compilation works as follows, assuming usage of vundle (see the dependencies section to ensure you can make properly):

cd ~/.vim/bundle/color_coded
rm -f CMakeCache.txt
mkdir build && cd build
cmake ..
make && make install # Compiling with GCC is preferred, ironically
# Clang works on OS X, but has mixed success on Linux and the BSDs

# Cleanup afterward; frees several hundred megabytes
make clean && make clean_clang

For various compatibility reasons, color_coded will attempt to download a known version of clang. This may add time to your configuration process, but it offers more stability across multiple platforms. Avoiding this is not officially supported, but documented here.

ANOTHER NOTE: color_coded doesn't reliably support luajit. More informatively, luajit doesn't reliably support being embedded in shared libraries.

Usage

Once color_coded is installed and compiled, it will automatically begin working the next time you start vim. In order for color_coded to know how your code must be compiled, you may need to create a file describing the required compiler options. Note, color_coded assumes sane defaults and tries to allow for immediate usage.

That said, in any non-trivial case, you'll find yourself needing to supply a .color_coded file for your project. For each file, color_coded will search from the file's directory all the way up to the root of the filesystem looking for a .color_coded file or a .color_coded_foo file (where foo is the filetype; i.e. c, cpp, etc). This makes it possible for you to have one in your home directory, for example, and then in each of your projects' directories. If you don't specify one in a project directory, the one in your home directory is used. It also makes it possible to provide different flags for differen file types (C, C++, etc) and also work in subprojects with different flags. Again, if no such files are found, sane defaults will be applied.

color_coded will try its hardest to highlight your code for you, even if there are errors in the translation unit. This allows for better highlighting while typing and highlighting of valid code when color_coded doesn't know everything about your project.

.color_coded file contents

The contents of a .color_coded or .color_coded_foo file is simply a line-separated list of compiler options. For example, the .color_coded file for color_coded is (color_coded puts the rest in by default when it detects C or C++ files):

-Iinclude
-Ilib/jest/include

The .color_coded file can be automatically generated using YCM-Generator.

NOTE: Out of simplicity, no other data is permitted in the .color_coded file. That is to say, comments are not supported.

Options

g:color_coded_enabled

This option controls whether or not color_coded will function. Invoking the :CCtoggle command will modify this option to achieve its results. You may also specify it as 0 in your ~/.vimrc to globally disable color_coded.

Default:

let g:color_coded_enabled = 1

g:color_coded_filetypes

This option controls the filetypes which color_coded will try to compile.

Default:

let g:color_coded_filetypes = ['c', 'cpp', 'objc']

Highlighting

There are many new highlighting groups which color_coded adds. They are designed to follow libclang's internals as closely as possible. To tie things together, some wrapper groups have been created that will allow more sweeping changes. The clang groups, by default, are mapped to use these, along with vim's normal groups (Function, Macro, Number, etc).

Generic groups

" To get full highlighting, specify these in your colorscheme.
" See colors/twilighted.vim for example usage

hi Member " Any non-static member variable
hi Variable " Any non-member variable
hi Namespace
hi EnumConstant

Example of clang groups

hi link StructDecl Type
hi link UnionDecl Type
hi link ClassDecl Type
hi link EnumDecl Type

Sample colorscheme

color_coded ships with a sample color scheme demonstrating support for the extended groups. To use it, invoke :colorscheme twilighted. As the name may suggest, the colorscheme is forked from vim's own twilight theme and has been appropriately punned into that which you'll see in the repo. To examine the implementation, visit colors/twilighted.vim. Note that color_coded can work with any colorscheme; this is just a sample.

For more information on all of the supported groups, see after/syntax/color_coded.vim and the clang documentation.

Commands

:CCerror

This command outputs the last compilation error message from libclang. If your highlighting is not working properly, you may have a misconfigured .color_coded file or you may have syntax errors in your source. When in doubt, check here first.

:CCtoggle

This command enables color_coded, if it's currently disabled, or disables it, if it's currently enabled. This enable/disabling is done via the g:color_coded_enabled option.

Dependencies

Compilation of color_coded requires:

  • GCC ≥ 4.9
  • Lua ≥ 5.1.x (using the version with which vim was compiled)

Usage of color_coded requires vim:

  • Version: 7.4p330+
  • Compiled with Lua support (+lua)

Troubleshooting/FAQ

As I type, the highlighting becomes messed up

color_coded tries to compile your coded as you type it. Due to how vim works, color_coded can only update the highlighting once you do something (move the cursor, make a change, etc). When you're done typing and the highlighting has not finished updating, assuming your .color_coded file is sufficient, moving the cursor (or causing events some other way) will allow color_coded to finish.

Note, there is a hold event in vim which triggers after you stop typing and after some delay. color_coded also hooks into this and will use it to apply highlighting if possible.

Some bits aren't highlighted or are highlighted incorrectly

Yup. Believe it or not, these are almost certainly libclang bugs. I've been sorting out a few of them and I'm maintaining my own fork of libclang. If you would like to report such an issue, check out this ticket.

The highlighting isn't refreshed in a new buffer until I move the cursor

This is intentional. The first time you open a buffer, color_coded doesn't know if it's going to compile properly and it doesn't want you to wait while it tries to figure this out. color_coded will always compile in the background and events like moving the cursor or changing text will poll for updates. Note, however, that, once a buffer has highlighting, leaving that buffer and coming back to it will synchronously apply the previous highlighting.

"color_coded unavailable: you need to compile it"

When you install color_coded, you need to manually compile it before you can successfully use it. See Installation for instructions.

"color_coded has been updated: you need to recompile it"

Assuming you've updated a working installation of color_coded, you'll get this error if the update requires you to recompile color_coded (i.e. there have been changes to the native API). To recompile, follow the same exact steps you took to compile initially.

Does color_coded work with neovim?

For now, at least, color_coded is not supporting neovim. There is chromatica.vim, however, which aims to provide similar highlighting, specifically for neovim.

'stdarg.h' file not found

This happens on certain operating systems which require additional include paths; the solution is to just make sure these paths are in your .color_coded file, prefixed with -isystem. To find out those paths, run the following:

echo | clang -v -E -x c++ -

See this issue comment for details. color_coded tries to help by assuming some of these, as shown in post_constants() here.

color_coded crashes on startup?!?!

You're likely using luajit, which doesn't embed well in shared libraries. If you aren't sure, see if this turns up anything:

vim --version | grep jit

More information is here.

How can I disable color_coded in diff mode?

You can use this in your .vimrc:

" Disable color_coded in diff mode
if &diff
  let g:color_coded_enabled = 0
endif

How can I use a custom LLVM/Clang setup?

You may specify DOWNLOAD_CLANG=0 to cmake. Depending on your platform, you may also need to specify the path to your llvm-config binary using LLVM_CONFIG=. This can also allow you to use different versions of Clang/LLVM.

Example:

cmake . -DDOWNLOAD_CLANG=0

"no version information available (required by gvim)"

You may run into this on Debian-based systems. The solution has been to install liblua-5.x-0-dbg.

"E315: ml_get: invalid lnum: 32"

This is caused by a bug in vim; you can work around it by using a vim with at least patch 1691. See this issue for details.

How can I get support?

Feel free to make an issue on Github or email me or catch me on IRC: Freenode @ #color_coded

License

color_coded is under the MIT open-source license.
See the LICENSE file or http://opensource.org/licenses/MIT

Comments
  • Add initial support for JSONCompilationDatabase

    Add initial support for JSONCompilationDatabase

    This is the current state of my implementation for #90. compile_commands.json has priority over color_coded files and if we find one, take the flags from there for the current file.

    Known problems:

    • ~~building the tests fails~~
    • ~~CMake does not generate compile commands for header files, so they can't be highlighted~~
    • ~~TODO: Refactor~~
    enhancement 
    opened by UnrealQuester 45
  • Strange behavior after 3.8

    Strange behavior after 3.8

    When opening a c++ file in vim, it gets stuck, anything I type turn into numbers at the bottom of the screen:

    screenshot from 2016-04-16 13-56-47

    I'm still able to exit vim even without visual feedback by typing :q<ENTER>. After this, strangely, I can't see my cursor at the console window anymore, I have to open another one and discard the previous.

    ArchLinux Vim 7.4.1721

    opened by oblitum 38
  • color_coded doesn't compile with multiple installed Lua versions on the system.

    color_coded doesn't compile with multiple installed Lua versions on the system.

    I get these results, due to the fact that I have multiple Lua versions installed on my system (OSX 10.10.2), managed with homebrew:

    [email protected]:~/.vim/bundle/color_coded {(master)} $ make Tracking API changes...

    Building bin/libcolor_coded_boost_system.a Compiling src/error_code.cpp Linking bin/libcolor_coded_boost_system.a Building bin/libcolor_coded_boost_filesystem.a Compiling src/codecvt_error_category.cpp Compiling src/operations.cpp Compiling src/path.cpp Compiling src/path_traits.cpp Compiling src/portability.cpp Compiling src/unique_path.cpp Compiling src/utf8_codecvt_facet.cpp Linking bin/libcolor_coded_boost_filesystem.a Building bin/color_coded.so Compiling src/main.cpp src/main.cpp:3:12: fatal error: 'lua.h' file not found #include <lua.h> ^ 1 error generated. make: *** [src/main.cpp.o] Error 1

    $ ls /opt/local/lib/lua /opt/local/lib/liblua.5.1.5.dylib /opt/local/lib/liblua.5.2.dylib /opt/local/lib/liblua.dylib /opt/local/lib/libluajit-5.1.2.0.3.dylib /opt/local/lib/libluajit-5.1.dylib /opt/local/lib/liblua.5.1.dylib /opt/local/lib/liblua.5.3.0.dylib /opt/local/lib/liblua5.1.dylib /opt/local/lib/libluajit-5.1.2.dylib /opt/local/lib/liblua.5.2.3.dylib /opt/local/lib/liblua.5.3.dylib /opt/local/lib/libluabind.dylib /opt/local/lib/libluajit-5.1.a

    /opt/local/lib/lua: 5.1 5.2

    /opt/local/lib/luarocks: rocks [email protected]:~/.vim {} $ ls /opt/local/include/lua /opt/local/include/lua.hpp

    /opt/local/include/lua-5.1: lauxlib.h lua.h lua.hpp luaconf.h lualib.h

    /opt/local/include/lua-5.3: lauxlib.h lua.h lua.hpp luaconf.h lualib.h

    /opt/local/include/lua5.1: lauxlib.h lua.h lua.hpp luaconf.h lualib.h

    /opt/local/include/lua5.2: lauxlib.h lua.h lua.hpp lua5.2 luaconf.h lualib.h

    /opt/local/include/lua5.3: lauxlib.h lua.h lua.hpp luaconf.h lualib.h

    /opt/local/include/luabind: adopt_policy.hpp container_policy.hpp exception_handler.hpp iterator_policy.hpp open.hpp scope.hpp weak_ref.hpp back_reference.hpp copy_policy.hpp from_stack.hpp lua_include.hpp operator.hpp shared_ptr_converter.hpp wrapper_base.hpp back_reference_fwd.hpp dependency_policy.hpp function.hpp luabind.hpp out_value_policy.hpp tag_function.hpp yield_policy.hpp class.hpp detail get_main_thread.hpp make_function.hpp prefix.hpp typeid.hpp class_info.hpp discard_result_policy.hpp get_pointer.hpp nil.hpp raw_policy.hpp value_wrapper.hpp config.hpp error.hpp handle.hpp object.hpp return_reference_to_policy.hpp version.hpp

    /opt/local/include/luajit-2.0: lauxlib.h lua.h lua.hpp luaconf.h luajit.h lualib.h

    opened by seclorum 36
  • Revamp build infrastructure for Clang/LLVM

    Revamp build infrastructure for Clang/LLVM

    Improve finding llvm and clang across platforms. With this patch, the a majority of systems will be able to use their clang/llvm from their package manager without needing to download clang+llvm. This makes it much smoother to install color_coded, as well as much more manageable to handle via NeoBundle across platforms.

    -DDOWNLOAD_CLANG=1 can be used to force download.

    -DCUSTOM_CLANG is deprecated.

    The prior version of clang/link.cmake wasn't reliable in finding LLVM/Clang automatically. It often required entering additional arguments for LLVM/Clang, the locations of which are not consistent across systems, package managers and versions.

    FindLibClang can be used to find clang libraries across systems in unison with FindLLVM.

    Both support ${LLVM_ROOT_DIR}, so the modules will load the libraries in download form.

    Tested with both download and packaged libraries (llvm/clang 3.7) on FreeBSD 11-CURRENT, Ubuntu 15.10 and OS X 10.11 El Capitan.

    To test downloading:

    rm -rf ~/.vim/bundle/color_coded/build/*; cmake .. -DDOWNLOAD_CLANG=1 -GNinja && ninja install

    To test with clang/llvm installed from package managers:

    rm -rf ~/.vim/bundle/color_coded/build/*; cmake .. -GNinja && ninja install

    opened by tony 35
  • E315: ml_get: invalid lnum: 32

    E315: ml_get: invalid lnum: 32

    When I open a few C files in gvim, and switch between different buffers few times, after a little bit i'm getting this error and syntax coloring breaks. If I reopen the file, syntax coloring goes back, but after a few buffer switching i'm getting the same problem. :CCerror says there is no error, unfortunatly I don't know how to get more debug information for this case, E315 as I know it vim's internal error, but if i disable color coded even by :CCtoggle the error goes away. I use vim compiled from git, let me know if I can provide any more useful information. This always reopening a file is pretty annoying.

    opened by antonvesnin 30
  • Compilation error with Clang 3.5.0

    Compilation error with Clang 3.5.0

    Tracking API changes...
    
    Building bin/libcolor_coded_boost_system.a
     Compiling src/error_code.cpp
    In file included from src/error_code.cpp:16:
    In file included from include/boost/system/error_code.hpp:14:
    In file included from include/boost/system/config.hpp:13:
    In file included from /home/reuben/.vim/bundle/color_coded/lib/boost/config/include/boost/config.hpp:44:
    /home/reuben/.vim/bundle/color_coded/lib/boost/config/include/boost/config/select_stdlib_config.hpp:18:12: fatal error: 
      'cstddef' file not found
    #  include <cstddef>
           ^
    1 error generated.
    Makefile:27: recipe for target 'src/error_code.cpp.o' failed
    make[1]: *** [src/error_code.cpp.o] Error 1
    Makefile:203: recipe for target 'bin/libcolor_coded_boost_system.a' failed
    make: *** [bin/libcolor_coded_boost_system.a] Error 2
    

    OS: Sabayon amd64 (Gentoo derivative) Compiler: Clang 3.5

    As a minor aside, what is the reason for requiring GCC 4.9 (if not using clang)? It's still pretty new and immature, IMO. (Not to mention it's not in the stable repository for many distributions.)

    build 
    opened by rdnetto 28
  • Segfault on startup

    Segfault on startup

    I'm getting a segfault when starting a freshly compiled Vim with color_coded enabled.

    Output:

    $ vim
    Vim: Caught deadly signal SEGV
    Vim: Finished.
    Segmentation fault
    

    Backtrace :

    (gdb) run
    Starting program: /usr/local/bin/vim 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    b
    Program received signal SIGSEGV, Segmentation fault.
    0x00007fffedd26e33 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.2.so.0
    (gdb) bt
    #0  0x00007fffedd26e33 in ?? () from /usr/lib/x86_64-linux-gnu/liblua5.2.so.0
    #1  0x00007fffedd19c22 in lua_setglobal () from /usr/lib/x86_64-linux-gnu/liblua5.2.so.0
    #2  0x00007fffee22bab9 in luaopen_color_coded () from /home/tux3/.vim/bundle/color_coded/bin/color_coded.so
    #3  0x00007ffff557da88 in ?? () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
    #4  0x00007ffff55c0dfc in ?? () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
    #5  0x00007ffff557da88 in ?? () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
    #6  0x00007ffff55c0f60 in lua_pcall () from /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
    #7  0x00000000005c73b2 in ex_lua ()
    #8  0x000000000049431d in do_cmdline ()
    #9  0x000000000046a8e0 in ?? ()
    #10 0x000000000046b362 in ?? ()
    #11 0x000000000046f3f3 in ?? ()
    #12 0x000000000046de38 in ?? ()
    #13 0x000000000046e004 in ?? ()
    #14 0x000000000046e26e in ?? ()
    #15 0x000000000046ee75 in ?? ()
    #16 0x000000000046eff5 in ?? ()
    #17 0x000000000046f94e in ?? ()
    #18 0x0000000000476401 in ex_let ()
    #19 0x000000000049431d in do_cmdline ()
    #20 0x0000000000488cd2 in do_source ()
    #21 0x0000000000488018 in do_in_runtimepath ()
    #22 0x0000000000438f00 in main ()
    

    ~/.vimrc:

    " General
    set nocompatible
    syntax on
    set t_Co=256
    set ttimeoutlen=50
    
    " Start Vundle
    filetype off
    set rtp+=~/.vim/bundle/Vundle.vim
    call vundle#begin()
    Plugin 'gmarik/Vundle.vim'
    
    " Airline
    "Plugin 'bling/vim-airline'
    set laststatus=2
    let g:airline_powerline_fonts = 1
    if !exists('g:airline_symbols')
            let g:airline_symbols = {}
    endif
    
    " color_coded
    Plugin 'jeaye/color_coded'   
    
    let g:color_coded_enabled = 1 
    
    " End Vundle
    call vundle#end()            " required
    filetype plugin indent on
    

    Vim version:

    $ vim --version
    VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr  6 2015 15:04:58)
    Included patches: 1-691
    Compiled by tux3
    Huge version with GTK2 GUI.  Features included (+) or not (-):
    +acl             +farsi           +mouse_netterm   +syntax
    +arabic          +file_in_path    +mouse_sgr       +tag_binary
    +autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
    +balloon_eval    +float           +mouse_urxvt     -tag_any_white
    +browse          +folding         +mouse_xterm     -tcl
    ++builtin_terms  -footer          +multi_byte      +terminfo
    +byte_offset     +fork()          +multi_lang      +termresponse
    +cindent         +gettext         -mzscheme        +textobjects
    +clientserver    -hangul_input    +netbeans_intg   +title
    +clipboard       +iconv           +path_extra      +toolbar
    +cmdline_compl   +insert_expand   +perl            +user_commands
    +cmdline_hist    +jumplist        +persistent_undo +vertsplit
    +cmdline_info    +keymap          +postscript      +virtualedit
    +comments        +langmap         +printer         +visual
    +conceal         +libcall         +profile         +visualextra
    +cryptv          +linebreak       +python/dyn      +viminfo
    +cscope          +lispindent      +python3/dyn     +vreplace
    +cursorbind      +listcmds        +quickfix        +wildignore
    +cursorshape     +localmap        +reltime         +wildmenu
    +dialog_con_gui  +lua             +rightleft       +windows
    +diff            +menu            +ruby            +writebackup
    +digraphs        +mksession       +scrollbind      +X11
    +dnd             +modify_fname    +signs           -xfontset
    -ebcdic          +mouse           +smartindent     +xim
    +emacs_tags      +mouseshape      -sniff           +xsmp_interact
    +eval            +mouse_dec       +startuptime     +xterm_clipboard
    +ex_extra        -mouse_gpm       +statusline      -xterm_save
    +extra_search    -mouse_jsbterm   -sun_workshop    +xpm
       system vimrc file: "$VIM/vimrc"
         user vimrc file: "$HOME/.vimrc"
     2nd user vimrc file: "~/.vim/vimrc"
          user exrc file: "$HOME/.exrc"
      system gvimrc file: "$VIM/gvimrc"
        user gvimrc file: "$HOME/.gvimrc"
    2nd user gvimrc file: "~/.vim/gvimrc"
        system menu file: "$VIMRUNTIME/menu.vim"
      fall-back for $VIM: "/usr/local/share/vim"
     f-b for $VIMRUNTIME: "/usr/local/share/vim/vim74"
    Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2    -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
    Linking: gcc   -L. -Wl,-z,relro -L/build/ruby2.1-NaMyQG/ruby2.1-2.1.5/debian/lib -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E   -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype  -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux   -ldl  -L/usr/lib/x86_64-linux-gnu -lluajit-5.1 -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.20/CORE -lperl -ldl -lm -lpthread -lcrypt    -lruby-2.1 -lpthread -lgmp -ldl -lcrypt -lm
    
    opened by tux3 25
  • Include opencv header file, then occur errors

    Include opencv header file, then occur errors

    I've made out a simple toy project to reproduce this issue. The project is here Here's the CCerror info.

    image

    image


    PS: The opencv library was installed through apt-get under Ubuntu 14.04.3_x64.

    reproducible 
    opened by myme5261314 22
  • Lots of ID not found

    Lots of ID not found

    Open a C++ file in a split, close its window (don't delete the buffer), split again to original arrangement and switch to the same C++ file. You get a bunch of warnings about lost IDs.

    bug 
    opened by oblitum 22
  • OS X: segfaulting with homebrew MacVim (vim version 7.4.383)

    OS X: segfaulting with homebrew MacVim (vim version 7.4.383)

    My system's clang is the HEAD one and color_coded is segfaulting with it. I'll try to debug it when I have time but I guess it should be taken it account since it may get same behavior on clang 3.6.

    The reason the system libclang is being loaded and not the one embedded by the plugin is because of rpath settings.

    You may take a look at these issues and YCM code to learn how it may be fixed:

    https://github.com/Valloric/ycmd/pull/65 https://github.com/Valloric/ycmd/pull/66

    I have run install_name_tool -change @rpath/libclang.dylib ../clang+llvm-3.5.0-macosx-apple-darwin/lib/libclang.dylib bin/color_coded.so to force it to load the embedded lib.

    bug 
    opened by oblitum 21
  • Incorrect highlighting of

    Incorrect highlighting of "trivial" sample

    Hi, not sure whether it's an instance of #2, but here it's:

    Adding and removing blank lines to randomly edit the code make the highlight correct for brief instants, but then it comes back to incorrect state.

    not-reproducible 
    opened by oblitum 19
  • lua 5.4

    lua 5.4

    Hello, color_coded.

    On Arch Linux, vim is compiled with lua 5.4. On master, I see that it requires 5.3. 5.2 or 5.1. Is there any sort of timeline or information about 5.4 being supported?

    opened by kevr 2
  • My $VIMHOME has changed

    My $VIMHOME has changed

    When I installed the plugin this is what :echo $VIMHOME return

    /home/my_user/.vim/plugged/color_coded

    Did I do something wrong in my installation process or its mean to be this way?

    opened by GGCristo 0
  • Make compile_commands.json paths also absolute.

    Make compile_commands.json paths also absolute.

    This fixes a ton of issues for me. My usual workflow is as follows:

    mkdir build
    cd build
    cmake ..
    cd ..
    ln -s build/compile_commands.json .
    

    Such that I have sym-linked compile_commands.json file in my project root. This file is automatically synced by the build folder, which is perfect. Color_coded however, does not correctly interpret the paths, as they are all relative to the "working_directory" entry of the compile_commands.json file. My pull request fixes this.

    opened by mcourteaux 0
  • What about client-server architecture?

    What about client-server architecture?

    At first I want to sorry about english. So this tool (color_coded) are greate! But... here is a several problems with it:

    1. Speed. Lexical and semantic analizing is slow operations and it need many resources (cpu and memory), so, sometimes vim works very slow. Usage of memory by vim can be more then 1.8Gb!

    2. Hard for debugging. color_coded can work only as integrated in vim plugin, so I don't know how debug it at real time or other way...

    3. Stability. Sometimes color_coded chrashs. And it crash vim also. This hapens not offen, but this is very unpleasant.

    4. Integrating with other editors

    So, I think client-server architecture will fix all this problems. I write some prototype of server and client. Client fully writed by vimscript (but uses extarnal program md5sum for caching server results) and not required lua support.

    What you think about it?

    opened by andrejlevkovitch 5
Owner
Jeaye Wilkerson
I'm a leader, a problem solver, and a hacker with a passion for privacy and security.
Jeaye Wilkerson
A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.

rtags rtags-xref ac-rtags company-rtags flycheck-rtags helm-rtags ivy-rtags Introduction RTags is a client/server application that indexes C/C++ code

Anders Bakken 1.8k Jan 2, 2023
A C/C++ minor mode for Emacs powered by libclang

Irony-Mode A C/C++ minor mode powered by libclang irony-mode is an Emacs minor-mode that aims at improving the editing experience for the C, C++ and O

Guillaume Papin 898 Jan 2, 2023
A code-completion engine for Vim

YouCompleteMe: a code-completion engine for Vim NOTE: Minimum Requirements Have Changed Our policy is to support the Vim version that's in the latest

null 24.5k Jan 6, 2023
Zep is a simple embeddable editor, with a rendering agnostic design and optional Vim mode

Zep - A Mini Editor Zep is a simple embeddable editor, with a rendering agnostic design and optional Vim mode. It is built as a shared modern-cmake li

null 1 Feb 26, 2022
IDA plugin to enable nanoMIPS processor support.

nmips IDA plugin to enable nanoMIPS processor support. This is not limited to simple disassembly, but fully supports decompilation and even fixes up t

null 50 Dec 16, 2022
C-Toy is an interactive C(99) coding environment based on TCC.

C-Toy is an interactive C(99) coding environment based on TCC.

Anaël Seghezzi 1.2k Dec 26, 2022
C/C++ language server supporting multi-million line code base, powered by libclang. Emacs, Vim, VSCode, and others with language server protocol support. Cross references, completion, diagnostics, semantic highlighting and more

Archived cquery is no longer under development. clangd and ccls are both good replacements. cquery cquery is a highly-scalable, low-latency language s

Jacob Dufault 2.3k Jan 7, 2023
C/C++ language server supporting multi-million line code base, powered by libclang. Emacs, Vim, VSCode, and others with language server protocol support. Cross references, completion, diagnostics, semantic highlighting and more

Archived cquery is no longer under development. clangd and ccls are both good replacements. cquery cquery is a highly-scalable, low-latency language s

Jacob Dufault 2.3k Jan 2, 2023
Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim.

Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim. The goal of vimb is to build a completely keyboard-driven, efficient and pleasurable browsing-experience.

Daniel Carl 1.2k Dec 30, 2022
C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting

ccls ccls, which originates from cquery, is a C/C++/Objective-C language server. code completion (with both signature help and snippets) definition/re

Fangrui Song 3.3k Jan 6, 2023
A cross-platform flutter plugin for C/C++/ObjC crash report via Google Breakpad

quick_breakpad A cross-platform flutter plugin for C/C++/ObjC crash report via Google Breakpad Use breakpad for quick_breakpad_example $CLI_BREAKPAD i

Woodemi Co., Ltd 16 Jul 30, 2022
A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.

rtags rtags-xref ac-rtags company-rtags flycheck-rtags helm-rtags ivy-rtags Introduction RTags is a client/server application that indexes C/C++ code

Anders Bakken 1.8k Jan 2, 2023
A C/C++ minor mode for Emacs powered by libclang

Irony-Mode A C/C++ minor mode powered by libclang irony-mode is an Emacs minor-mode that aims at improving the editing experience for the C, C++ and O

Guillaume Papin 898 Jan 2, 2023
A C/C++ minor mode for Emacs powered by libclang

Irony-Mode A C/C++ minor mode powered by libclang irony-mode is an Emacs minor-mode that aims at improving the editing experience for the C, C++ and O

Guillaume Papin 897 Dec 22, 2022
A readline and libedit replacement that supports UTF-8, syntax highlighting, hints and Windows and is BSD licensed.

Read Evaluate Print Loop ++ A small, portable GNU readline replacement for Linux, Windows and MacOS which is capable of handling UTF-8 characters. Unl

Marcin Konarski 604 Jan 6, 2023
A SwiftUI TextEditor with syntax highlighting using Highlight.js

A SwiftUI TextEditor with syntax highlighting using Highlight.js

ZeeZide 271 Jan 8, 2023
Visual Studio extension for assembly syntax highlighting and code completion in assembly files and the disassembly window

Asm-Dude Assembly syntax highlighting and code assistance for assembly source files and the disassembly window for Visual Studio 2015, 2017 and 2019.

Henk-Jan Lebbink 4k Jan 6, 2023
Syntax highlighting text editor for ImGui

Syntax highlighting text editor for ImGui

null 1.1k Dec 29, 2022
📝 Performant plain text editor for iOS with syntax highlighting, line numbers, invisible characters and much more.

?? Welcome to Runestone - a performant plain text editor for iOS with code editing features Runestone uses GitHub's Tree-sitter to parse code to a syn

Simon Støvring 2.1k Dec 31, 2022
A code-completion engine for Vim

YouCompleteMe: a code-completion engine for Vim NOTE: Minimum Requirements Have Changed Our policy is to support the Vim version that's in the latest

null 24.5k Jan 6, 2023