Commits

Frank Fischer committed f61b807

close #30: regroup all customization options

  • Participants
  • Parent commits ebfda78

Comments (0)

Files changed (10)

File vim-commands.el

 (require 'vim-compat)
 (require 'vim-motions)
 
+(defgroup vim-commands nil
+  "Commands"
+  :group 'vim-mode)
 
 (defcustom vim:shift-width 8
   "The number of columns for shifting commands like < or >."
   :type 'integer
-  :group 'vim-mode)
+  :group 'vim-commands)
 
 (vim:defcmd vim:cmd-insert (count)
   "Switches to insert-mode before point."

File vim-compat.el

   (vim:deflocalvar vim:mouse-click-count 0)
   (vim:deflocalvar vim:mouse-click-last-time nil)
   (defcustom vim:visual-double-click-time 500
-    "Number of milliseconds for a repeating click.")
+    "Number of milliseconds for a repeating click."
+    :group 'vim-mode-general)
   (defun vim:mouse-click-count (event)
     (let ((time (event-timestamp event)))
       (message "TIME: %s %s" time vim:mouse-click-last-time)
 (require 'vim-compat)
 (require 'vim-motions)
 
+(defgroup vim-ex-mode nil
+  "Configure ex-mode and search mode."
+  :group 'vim-mode)
+
 (defvar vim:ex-commands nil
   "List of pairs (command . function).")
 
 			 :slant italic
 			 :foreground "red"))
   "Face for the info message in ex mode."
-  :group 'vim-mode)
+  :group 'vim-ex-mode)
 
 (defvar vim:ex-cmd nil
   "The currently parsed command.")

File vim-insert-mode.el

 
 (defcustom vim:insert-mode-replace-cursor 'hbar
   "Cursor for replace-mode."
-  :group 'vim-mode)
+  :group 'vim-cursors)
 
 (vim:define-keymap insert-mode "insert-mode" :map-command imap)
 

File vim-keymap.el

 ;; the next command and the ESC event is resent.
 (defcustom vim:intercept-ESC-timeout 0.1
   "Time in seconds to wait for another key after an ESC event."
-  :group 'vim-mode)
+  :group 'vim-mode-general)
 
 (defconst vim:intercept-ESC-keymap (make-sparse-keymap)
   "Keymap to map ESC to [escape].")

File vim-modes.el

 (eval-when-compile (require 'cl))
 (require 'vim-macs)
 
+(defgroup vim-cursors nil
+  "Cursor types for modes."
+  :group 'vim-mode)
+
 (vim:deflocalvar vim:mode-string)
 
 (vim:deflocalvar vim:active-mode nil
     `(progn
        (defcustom ,cursor-name ,cursor
          ,(concat "The cursor-type for vim-mode " (symbol-name name) ".")
-         :group 'vim-mode)
+         :group 'vim-cursors)
        
        (define-minor-mode ,mode-name ,doc nil nil nil
          (when ,mode-name

File vim-motions.el

 (require 'vim-core)
 (require 'vim-compat)
 
+(defgroup vim-motions nil
+  "Motions"
+  :group 'vim-mode)
+
 (defcustom vim:word "[:word:]_"
   "Regexp-set matching a word."
   :type 'string
-  :group 'vim-mode)
+  :group 'vim-motions)
 
 (defcustom vim:whitespace " \t\r\n"
   "Regexp-set matching a whitespace."
   :type 'string
-  :group 'vim-mode)
+  :group 'vim-motions)
 
 (defcustom vim:find-skip-newlines nil
   "If non-nil character find motions t,T,f,F skip over newlines."
   :type 'boolean
-  :group 'vim-mode)
+  :group 'vim-motions)
 
 (vim:deflocalvar vim:last-find nil
   "The previous find command (command . arg).")

File vim-search.el

 (require 'vim-macs)
 (require 'vim-ex)
 
-
 (defcustom vim:interactive-search-highlight 'all-windows
   "Determine in which windows the interactive highlighting should be shown."
   :type '(radio (const :tag "All windows." all-windows)
 		(const :tag "Selected window." selected-window)
 		(const :tag "Disable highlighting." nil))
-  :group 'vim-mode)
+  :group 'vim-ex-mode)
 
 (defcustom vim:search-case 'smart
   "The case behaviour of the search command."
   :type '(radio (const :tag "Case sensitive." 'sensitive)
 		(const :tag "Case insensitive." 'insensitive)
 		(const :tag "Smart case." 'smart))
-  :group 'vim-mode)
+  :group 'vim-ex-mode)
 
 (defcustom vim:substitute-case nil
   "The case behaviour of the search command."
 		(const :tag "Case sensitive." 'sensitive)
 		(const :tag "Case insensitive." 'insensitive)
 		(const :tag "Smart case." 'smart))
-  :group 'vim-mode)
+  :group 'vim-ex-mode)
 
 (defcustom vim:search-interactive t
   "If t search is interactive."
   :type 'boolean
-  :group 'vim-mode)
+  :group 'vim-ex-mode)
 
 (defcustom vim:search-highlight-all t
   "If t and interactive search is enabled, all matches are
 highlighted."
   :type 'boolean
-  :group 'vim-mode)
+  :group 'vim-ex-mode)
 
 (defcustom vim:substitute-highlight-all t
   "If t all matches for the substitute pattern are highlighted."
   :type 'boolean
-  :group 'vim-mode)
+  :group 'vim-ex-mode)
 
 (defcustom vim:substitute-interactive-replace t
   "If t and substitute patterns are highlighted the replacement is shown interactively."
   :type 'boolean
-  :group 'vim-mode)
+  :group 'vim-ex-mode)
 
 (defconst vim:search-keymap (make-sparse-keymap)
   "Keymap used in search-ex-mode.")
 (defvar vim:substitute-replacement nil
   "The actual replacement.")
 
+(defface vim:search '((t :inherit isearch))
+  "Face for interactive search."
+  :group 'vim-ex-mode)
+
+(defface vim:lazy-highlight '((t :inherit lazy-highlight))
+  "Face for highlighting all matches in interactive search."
+  :group 'vim-ex-mode)
+
 (defface vim:substitute '(( ((supports :underline))
 			    :underline t
 			    :foreground "red"))
-  "Face interactive replacement text."
-  :group 'vim-mode)
+  "Face for interactive replacement text."
+  :group 'vim-ex-mode)
 
 
 (define-key vim:search-keymap [return] #'vim:search-exit)
   )
 
 (defun* vim:make-hl (name &key
-			  (face 'lazy-highlight)
+			  (face 'vim:lazy-highlight)
 			  (win (selected-window))
 			  (beg nil)
 			  (end nil)
 			vim:search-match-end)
 	(setq vim:search-overlay (make-overlay vim:search-match-beg vim:search-match-end))
 	(overlay-put vim:search-overlay 'priority 1001)
-	(overlay-put vim:search-overlay 'face 'isearch)))
+	(overlay-put vim:search-overlay 'face 'vim:search)))
     (when vim:search-highlight-all
       (vim:hl-change 'vim:search (and isearch-success vim:search-pattern)))))
 

File vim-visual-mode.el

 (require 'vim-ex)
 (require 'vim-commands)
 
-(defcustom vim:visual-region-face vim:default-region-face
+(defgroup vim-visual-mode nil
+  "Visual mode"
+  :group 'vim-mode)
+
+(defface vim:visual-region `(( t :inherit ,vim:default-region-face))
   "Face of the highlighted region."
-  :type 'face
-  :group 'vim-mode)
+  :group 'vim-visual-mode)
 
 (vim:define-keymap visual-mode "visual mode" :map-command vmap)
 
 		  (setq new (cons overlay new)
 			old (cdr old)))
 	      (setq overlay (make-overlay row-start row-end))
-	      (overlay-put overlay 'face vim:visual-region-face)
+	      (overlay-put overlay 'face 'vim:visual-region)
 	      (overlay-put overlay 'priority 99)
 	      (setq new (cons overlay new))))
 	  (forward-line 1))
         ov)
     (let ((ov (make-overlay start  end)))
       (vim:visual-hide-region)
-      (overlay-put ov 'face vim:visual-region-face)
+      (overlay-put ov 'face 'vim:visual-region)
       (overlay-put ov 'priority 99)
       ov)))
     
   "A VIM emulation mode."
   :group 'emulations)
 
+(defgroup vim-mode-general nil
+  "General options for Vim-Mode"
+  :group 'vim-mode)
+
 (defcustom vim:default-initial-mode
   'normal
   "The default initial vim sub-mode."
   :type '(symbol :tag "vim-mode start mode")
-  :group 'vim-mode)
+  :group 'vim-mode-general)
 
 (defcustom vim:initial-modes
   '((debugger-mode . window)
 vim sub-mode in which vim-mode should start when a buffer with the
 given major-mode is created."
   :type '(repeat (cons (symbol :tag "major mode") (symbol :tag "vim-mode start mode")))
-  :group 'vim-mode)
+  :group 'vim-mode-general)
 
 
 (define-minor-mode vim-local-mode
   "The minimal distance between point and a parenthesis which
 causes the parenthesis to be highlighted."
   :type 'integer
-  :group 'vim-mode)
+  :group 'vim-mode-general)
 
 
 (defadvice show-paren-function (around vim:show-paren-function)