Coder Social home page Coder Social logo

emacs-uncrustify-mode's Introduction

uncrustify-mode

Overview

this mode is Minor mode to automatically uncrustify.

Installation

drop requirements and uncrustify-mode.el into a directory in your load-path. If you have install-elisp or auto-install, you also be able to install uncrustify-mode.el like:

;; install-elisp
(install-elisp "https://raw.github.com/koko1000ban/emacs-uncrustify-mode/master/uncrustify-mode.el")

;; auto-install
(auto-install-from-url "https://raw.github.com/koko1000ban/emacs-uncrustify-mode/master/uncrustify-mode.el")

And then enable uncrustify-mode on target mode like:

;; (require 'uncrustify-mode)
;; (add-hook 'c-mode-common-hook 
;;    '(lambda ()
;;        (uncrustify-mode 1)))

emacs-uncrustify-mode's People

Contributors

koko1000ban avatar yasuyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

emacs-uncrustify-mode's Issues

Typo in readme

You have (require 'uncrusfify-mode) instead of (require 'uncrustify-mode) (the first 'f' should be a 't').

Automatically find .uncrustify.cfg in parent dir

Looking up .uncrustify.cfg in parent dir would allow for more contextual formatting (e.g. a project can provide its own .uncrustify.cfg).

For instance

(defun uncrustify-format-file-lookup ()
  "Find .clang-format or .uncrustify.cfg in parent folder up to Git root.
Return nil if non is found or if not a Git repository."
  (unless (require 'magit nil 'noerror)
    (error "Magit is missing"))
  (when (or (magit-get-current-branch) (magit-get-current-tag))
    (let ((git-root (magit-rev-parse "--show-toplevel"))
          (default-directory default-directory))
      (while (and (string= (magit-rev-parse "--show-toplevel") git-root)
                  (not (file-exists-p ".uncrustify.cfg")))
        (cd ".."))
        (and (file-exists-p ".uncrustify.cfg")
               (expand-file-name ".uncrustify.cfg" default-directory)))))

We can always replace the magit snippet with something else to limit the root of the project.

Rust support

Given that Rust syntax is C-like, I have to ask, dose this support Rust?

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.