" ============================================================================== " Name: ShowMarks " Description: Visually displays the location of marks. " Authors: Anthony Kruize " Michael Geddes " Version: 2.2 " Modified: 17 August 2004 " License: Released into the public domain. " ChangeLog: See :help showmarks-changelog " " Usage: Copy this file into the plugins directory so it will be " automatically sourced. " " Default keymappings are: " mt - Toggles ShowMarks on and off. " mo - Turns ShowMarks on, and displays marks. " mh - Clears a mark. " ma - Clears all marks. " mm - Places the next available mark. " " Hiding a mark doesn't actually remove it, it simply moves it " to line 1 and hides it visually. " " Configuration: *********************************************************** " * PLEASE read the included help file(showmarks.txt) for a * " * more thorough explanation of how to use ShowMarks. * " *********************************************************** " The following options can be used to customize the behavior " of ShowMarks. Simply include them in your vimrc file with " the desired settings. " " showmarks_enable (Default: 1) " Defines whether ShowMarks is enabled by default. " Example: let g:showmarks_enable=0 " showmarks_include (Default: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.'`^<>[]{}()\"") " Defines all marks, in precedence order (only the highest " precence will show on lines having more than one mark). " Can be buffer-specific (set b:showmarks_include) " showmarks_ignore_type (Default: "hq") " Defines the buffer types to be ignored. " Valid types are: " h - Help p - preview " q - quickfix r - readonly " m - non-modifiable " showmarks_textlower (Default: ">") " Defines how the mark is to be displayed. " A maximum of two characters can be displayed. To include " the mark in the text use a tab(\t) character. A single " character will display as the mark with the character " suffixed (same as "\t") " Examples: " To display the mark with a > suffixed: " let g:showmarks_textlower="\t>" " or " let g:showmarks_textlower=">" " To display the mark with a ( prefixed: " let g:showmarks_textlower="(\t" " To display two > characters: " let g:showmarks_textlower=">>" " showmarks_textupper (Default: ">") " Same as above but for the marks A-Z. " Example: let g:showmarks_textupper="**" " showmarks_textother (Default: ">") " Same as above but for all other marks. " Example: let g:showmarks_textother="--" " showmarks_hlline_lower (Default: 0) " showmarks_hlline_upper (Default: 0) " showmarks_hlline_other (Default: 0) " Defines whether the entire line for a particular mark " should be highlighted. " Example: let g:showmarks_hlline_lower=1 " " Setting Highlighting Colours " ShowMarks uses the following highlighting groups: " ShowMarksHLl - For marks a-z " ShowMarksHLu - For marks A-Z " ShowMarksHLo - For all other marks " ShowMarksHLm - For multiple marks on the same line. " (Highest precendece mark is shown) " " By default they are set to a bold blue on light blue. " Defining a highlight for each of these groups will " override the default highlighting. " See the VIM help for more information about highlighting. " ============================================================================== " Check if we should continue loading if exists( "loaded_showmarks" ) finish endif let loaded_showmarks = 1 " Bail if Vim isn't compiled with signs support. if has( "signs" ) == 0 echohl ErrorMsg echo "ShowMarks requires Vim to have +signs support." echohl None finish endif " Options: Set up some nice defaults if !exists('g:showmarks_enable' ) | let g:showmarks_enable = 1 | endif if !exists('g:showmarks_textlower' ) | let g:showmarks_textlower = ">" | endif if !exists('g:showmarks_textupper' ) | let g:showmarks_textupper = ">" | endif if !exists('g:showmarks_textother' ) | let g:showmarks_textother = ">" | endif if !exists('g:showmarks_ignore_type' ) | let g:showmarks_ignore_type = "hq" | endif if !exists('g:showmarks_ignore_name' ) | let g:showmarks_ignore_name = "" | endif if !exists('g:showmarks_hlline_lower') | let g:showmarks_hlline_lower = "0" | endif if !exists('g:showmarks_hlline_upper') | let g:showmarks_hlline_upper = "0" | endif if !exists('g:showmarks_hlline_other') | let g:showmarks_hlline_other = "0" | endif " This is the default, and used in ShowMarksSetup to set up info for any " possible mark (not just those specified in the possibly user-supplied list " of marks to show -- it can be changed on-the-fly). let s:all_marks = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.'`^<>[]{}()\"" " Commands com! -nargs=0 ShowMarksToggle :call ShowMarksToggle() com! -nargs=0 ShowMarksOn :call ShowMarksOn() com! -nargs=0 ShowMarksClearMark :call ShowMarksClearMark() com! -nargs=0 ShowMarksClearAll :call ShowMarksClearAll() com! -nargs=0 ShowMarksPlaceMark :call ShowMarksPlaceMark() " Mappings (NOTE: Leave the '|'s immediately following the '' so the mapping does not contain any trailing spaces!) if !hasmapto( 'ShowmarksShowMarksToggle' ) | map mt :ShowMarksToggle| endif if !hasmapto( 'ShowmarksShowMarksOn' ) | map mo :ShowMarksOn| endif if !hasmapto( 'ShowmarksClearMark' ) | map mh :ShowMarksClearMark| endif if !hasmapto( 'ShowmarksClearAll' ) | map ma :ShowMarksClearAll| endif if !hasmapto( 'ShowmarksPlaceMark' ) | map mm :ShowMarksPlaceMark| endif noremap