mirror of
https://codeberg.org/scip/config-general-mode.git
synced 2025-12-17 12:30:59 +01:00
added commentary
This commit is contained in:
86
README.md
86
README.md
@@ -1,2 +1,84 @@
|
|||||||
# config-general-mode
|
## config-general-mode
|
||||||
Emacs major editing mode for Config::General config files
|
|
||||||
|
Emacs major editing mode for Config::General config files.
|
||||||
|
|
||||||
|
### Screenshot
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
### Introduction
|
||||||
|
|
||||||
|
[Config::General](http://search.cpan.org/dist/Config-General/) is a
|
||||||
|
Perl module for parsing config files with some enhanced
|
||||||
|
features. [config-general-mode](https://github.com/TLINDEN/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 <kbd><tab></kbd> (using `dabbrev`)
|
||||||
|
- imenu support for `<blocks>`
|
||||||
|
- electric paring mode (for quotes, parens, etc) enabled
|
||||||
|
- automatic indenting
|
||||||
|
- jump to include file with <kbd><ret></kbd>
|
||||||
|
|
||||||
|
### 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-*-
|
||||||
|
|
||||||
|
### 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 <tlinden@cpan.org>
|
||||||
|
|
||||||
|
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@cpan.org>
|
||||||
|
- Keywords: config file editing
|
||||||
|
- URL: https://github.com/tlinden/config-general-mode
|
||||||
|
- License: GNU General Public License >= 2
|
||||||
|
|||||||
@@ -21,16 +21,63 @@
|
|||||||
|
|
||||||
;; Version: 0.01
|
;; Version: 0.01
|
||||||
;; Author: T.v.Dein <tlinden@cpan.org>
|
;; Author: T.v.Dein <tlinden@cpan.org>
|
||||||
;; Keywords: config
|
;; Keywords: config file editing
|
||||||
;; URL: https://github.com/tlinden/config-general-mode
|
;; URL: https://github.com/tlinden/config-general-mode
|
||||||
;; License: GNU General Public License >= 2
|
;; License: GNU General Public License >= 2
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
;;(add-hook 'cg-mode-hook 'electric-indent-mode)
|
;;;; Introduction
|
||||||
|
|
||||||
|
;; [Config::General](http://search.cpan.org/dist/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 <blocks>
|
||||||
|
;; - electric paring mode (for quotes, parens, etc) enabled
|
||||||
|
;; - automatic indenting
|
||||||
|
;; - jump to include file with `<ret>'
|
||||||
|
|
||||||
|
;;;; 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-*-
|
||||||
|
|
||||||
|
;;;; 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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; Install:
|
|
||||||
;;; Customize:
|
|
||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user