Giter VIP home page Giter VIP logo

yabai-mode's Introduction

Notice!!!!!!!!!!!!!!!!

I want to contribute to awesome irony-mode! So this package no longer supported!!

YABAI - Yet Another Build-system Attentive Integration Mode

Emacs minor mode for C/C++ syntax checking and completion with any build systems without any configuration in many cases.

This mode get the compiler options from build system (CMake is default) and integrate syntax checking and completion packages. Not only that, you can compile and run it. What you shuold do is to put source codes and build configuration file (e.g. CMakeLists.txt).

(YABAI (ヤバイ) is the japanese slang means dangerous, awful and amazing etc...)

Compatible build systems

(At least one is required.)

Packages can be integrated

Syntax check packages:
Completion (like Intellisense) packages:

Set up

Basic setup:

(add-to-list 'load-path "~/path-to-*")

(require 'company)
(require 'flycheck)
(require 'yabai)

;; enable Company mode in all buffers
(add-hook 'after-init-hook 'global-company-mode)

;; enable Flycheck mode in all buffers
(add-hook 'after-init-hook #'global-flycheck-mode)

;; enable YABAI mode in C/C++ buffers
(add-hook 'c-mode-hook   'yabai-mode)
(add-hook 'c++-mode-hook 'yabai-mode)

Basic Usage (CMake with Make)

  1. Put source codes and CMakeLists.txt on your source tree.
  2. Create build-tree named build. (If you don't do it, this package asks you where do I create build-tree.)
  3. Just open your source code. Enjoy!

Advanced Usage

Compiler option analysis can be controlled with yabai/load-options and yabai/reload-options. But you probably don't need to call them directly. While cccc-mode is enabled, those commands automatically called when you opened C/C++ sources or someone modified build configuration file. If something went wrong, please call yabai/reload-options.

You can generate build tree with yabai/generate-build-files.
You can compile build tree with yabai/compile.
You can run executable file with yabai/run.

If you want to compile and run, I recommend yabai/compile-and-run.

If you want to use other build system, please see below chapter Customization.

CMake

If valid CMakeLists.txt is exists at source code's directory or upper, it will work. If you don't have build tree, this plugin ask you where build tree create. Build tree's name must be emacs-build. If you want to change this name, customize variable yabai/cmake-build-tree-name.

CMake Acceptable trees

If CMakeLists.txt and build-tree emacs-build are exists at upper or current directory where source is opened exists, it is acceptable tree.

Example 1:

.
|-- emacs-build
`-- src
  |-- CMakeLists.txt
  |-- blah.cpp
  |-- blah.h
  `-- blahblah
    |-- blahblah.cc
    .
    .

Example 2:

.
|-- emacs-build
|-- CMakeLists.txt
|-- blah.cpp
.
.

Customization

There are customizable user options.

  • yabai/build-system

    • Build system used for all integration.
    • You can choose cmake, make, ninja and json-compilation.
    • make, ninja and json-compilation mean without CMake.
      • But make and ninja require Bear.
    • Default value is cmake.
  • yabai/cmake-generator

    • CMake's build system generator.
    • You can select make or ninja.
      • When you select make in windows, automatically detect environment and select MinGW Makefiles or MSYS Makefiles generators.
    • Default value is make.
  • yabai/cmake-build-tree-name

    • CMake's build tree name used when build-tree searching and creating.
    • Default value is "emacs-build".
  • yabai/with-checker-flycheck

    • Set non-nil if you want to use Flycheck as checker.
    • Default value is t.
  • yabai/with-completer-company

    • Set non-nil if you want to use Company as checker.
    • Default value is t.
  • yabai/with-completer-ac-clang-async

License

see ./LICENSE

Similar packages

yabai-mode's People

Contributors

kumar8600 avatar

Stargazers

Lindsey Esch avatar Guillaume Papin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.