@@ -929,29 +929,44 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
929929\%23l Matches in a specific line.
930930\%<23l Matches above a specific line (lower line number).
931931\%>23l Matches below a specific line (higher line number).
932+ \%.l Matches at the cursor line.
933+ \%<.l Matches above the cursor line.
934+ \%>.l Matches below the cursor line.
932935 These three can be used to match specific lines in a buffer. The "23"
933936 can be any line number. The first line is 1.
934937 WARNING: When inserting or deleting lines Vim does not automatically
935938 update the matches. This means Syntax highlighting quickly becomes
936- wrong.
939+ wrong. Also when refering to the cursor position (".") and
940+ the cursor moves the display isn't updated for this change. An update
941+ is done when using the | CTRL-L | command (the whole screen is updated).
937942 Example, to highlight the line where the cursor currently is: >
938- :exe '/\%' . line(".") . 'l.*'
943+ :exe '/\%' . line(".") . 'l'
944+ < Alternatively use: >
945+ /\%.l
939946< When 'hlsearch' is set and you move the cursor around and make changes
940947 this will clearly show when the match is updated or not.
941948
942949 */\%c* */\%>c* */\%<c*
943950\%23c Matches in a specific column.
944951\%<23c Matches before a specific column.
945952\%>23c Matches after a specific column.
953+ \%.c Matches at the cursor column.
954+ \%<.c Matches before the cursor column.
955+ \%>.c Matches after the cursor column.
946956 These three can be used to match specific columns in a buffer or
947957 string. The "23" can be any column number. The first column is 1.
948958 Actually, the column is the byte number (thus it's not exactly right
949959 for multibyte characters).
950960 WARNING: When inserting or deleting text Vim does not automatically
951961 update the matches. This means Syntax highlighting quickly becomes
952- wrong.
962+ wrong. Also when refering to the cursor position (".") and
963+ the cursor moves the display isn't updated for this change. An update
964+ is done when using the | CTRL-L | command (the whole screen is updated).
965+
953966 Example, to highlight the column where the cursor currently is: >
954967 :exe '/\%' . col(".") . 'c'
968+ < Alternatively use: >
969+ /\%.c
955970< When 'hlsearch' is set and you move the cursor around and make changes
956971 this will clearly show when the match is updated or not.
957972 Example for matching a single byte in column 44: >
@@ -962,6 +977,9 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
962977\%23v Matches in a specific virtual column.
963978\%<23v Matches before a specific virtual column.
964979\%>23v Matches after a specific virtual column.
980+ \%.v Matches at the current virtual column.
981+ \%<.v Matches before the current virtual column.
982+ \%>.v Matches after the current virtual column.
965983 These three can be used to match specific virtual columns in a buffer
966984 or string. When not matching with a buffer in a window, the option
967985 values of the current window are used (e.g., 'tabstop' ).
@@ -971,13 +989,18 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
971989 one screen character.
972990 WARNING: When inserting or deleting text Vim does not automatically
973991 update highlighted matches. This means Syntax highlighting quickly
974- becomes wrong.
992+ becomes wrong. Also when refering to the cursor position (".") and
993+ the cursor moves the display isn't updated for this change. An update
994+ is done when using the | CTRL-L | command (the whole screen is updated).
975995 Example, to highlight all the characters after virtual column 72: >
976996 /\%>72v.*
977997< When 'hlsearch' is set and you move the cursor around and make changes
978998 this will clearly show when the match is updated or not.
979999 To match the text up to column 17: >
9801000 /^.*\%17v
1001+ < To match all characters after the current virtual column (where the
1002+ cursor is): >
1003+ /\%>.v.*
9811004< Column 17 is not included, because this is a | /zero-width | match. To
9821005 include the column use: >
9831006 /^.*\%17v.
0 commit comments