(lambda (_level) (max 0 (1- (- (point) (line-beginning-position)))))) Faces Typically (char-before (point)) can be used to check the kind of bracket.Īn example for Lisp family languages shows how each block can have a different level of indentation: (setq hl-indent-scope-indent-block-fn The (point) will be located at the start of the S-expression. Lisps and it's variants are more likely to use different levels of indentation for nested blocks, the following example shows how this can be set. This callback typically doesn't need to be set for any language with C-like syntax. When nil all opening/closing brackets will be used to show indentation levels. The current state should not be modified. Takes one level argument which represents the S-expression depth, taking only used levels into account. hl-indent-scope-show-block-fn: nilįunction that returns non-nil when the S-expression should be used. Otherwise you may wish to override these functions to change behavior. When hl-indent-scope-preset is non-nil the callbacks will be set to provide defaults where possible. Otherwise you must configure hl-indent-scope-show-block-fn yourself. Use the default preset for the major modes (when available). hl-indent-scope-fill-over-textĭisplay colors columns over non white-space characters. hl-indent-scope-fill-empty-lines: nilĭisplay color columns for blank lines. When non-nil, always use the tab-width for each indentation level. Idle time to wait before highlighting (zero for immediate highlighting). Customization hl-indent-scope-idle-delay: 0.2175 Other Lisp Style SyntaxĮmacs-Lisp has been tested to work with this package without needing a preset. Languages such as GLSL/Java/Rust work without depending on presets. python-modeĪ custom-preset has been included to support Python. Supported via a preset which highlights indentation within blocks are excluded from indentation.Ī custom-preset has been included to support CMake. Once hl-indent-scope-mode is enabled, the buffer will highlight indentation based on scope. To provide indentation highlighting that works well for C/C++ projects, supporting indentation highlighting that is compatible un-indented pre-processor usage.įurther, using scope as opposed to reading different indentation levels has some advantage in that scope can be differentiated from wrapped function calls (for example), although this is somewhat a personal preference too. Support is also included for CMake and Python. This package highlights indentation based on scope (defined by the syntax-table).Ĭ & C-like language syntax is well supported as well as Lisp's.
0 Comments
Leave a Reply. |