Giter VIP home page Giter VIP logo

config-general-mode's Introduction

config-general-mode - Emacs major editing mode for Config::General config files.

Screenshot

demo

Introduction

Config::General is a Perl module for parsing config files with some enhanced features. config-general-mode makes it easier to edit such config files with Emacs.

It is based on conf-mode with the following features:

  • good syntax highlighting for config files
  • completion support with TAB (using dabbrev)
  • imenu support for
  • electric paring mode (for quotes, parens, etc) enabled
  • automatic indenting
  • jump to include file with C-return

Installation

To use, save config-general-mode.el to a directory in your load-path.

Add something like this to your config:

    (require 'config-general-mode)
    (add-to-list 'auto-mode-alist '("\\.conf$" . config-general-mode))

or load it manually, when needed:

M-x config-general-mode

You can also enable it with a buffer-local variable by adding this as the first line of a config file:

# -*-config-general-*-

Usage

Edit your config file as usual. Use TAB for completion of values and variables. Use C-c C-t to toggle flags (like true to false). Use C-c C-= on a region to automatically align on the = character. Use C-c C-/ to breakup a region with long lines into shorter ones using backslash notation. Use C-return to visit an included file or (when not on a link) insert a new line below the current one, indent and move point there. Use C-k to delete lines, including continuation lines or whole blocks. Use C-c C-j to jump to a block definition (same as using imenu with the mouse).

Customize

You can customize the mode with:

 M-x customize-group RET config-general-mode RET

You can also use hooks to config-general mode as a way to modify or enhance its behavior. The following hooks are available:

config-general-mode-hook

For example:

    (add-hook 'config-general-mode-hook 'electric-indent-mode)

Meta

Copyright (C) 2017, T.v.Dein

This file is NOT part of Emacs.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

- Version: 0.01
- Author: T.v.Dein <tlinden AT cpan DOT org>
- Keywords: config file editing
- URL: https://github.com/tlinden/config-general-mode
- License: GNU General Public License >= 2

config-general-mode's People

Contributors

purcell avatar tlinden avatar

Watchers

 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.