3

I want to highlight around of current line in Vim like VSCode.

enter image description here

Edit: I want to highlight up, left, down, and right of current line.

sbh
  • 53
  • 1
  • 6
  • 5
    Welcome to [vi.se]! Can you please elaborate on what you want to accomplish? Perhaps an example of what you'd like to see? A screenshot of VSCode displaying the behavior you would like to have? As it stands, your question is not completely clear as to what you'd like to accomplish... Thanks! – filbranden Feb 19 '21 at 20:42
  • 1
    Hi there, if you want to highlight the cursor line, you should give a look at :h cursorline. For "around" the cursor line though, it will require some scripting.. – Zorzi Feb 19 '21 at 23:40
  • It's the second very unclear question you ask on the same topic (cf this closed question) you should really take the time to write a complete question explaining what you are trying to do, what you have tried so far and what is blocking you. This is the only way you will get a useful answer. – statox Feb 20 '21 at 00:30
  • I'm really sorry about this very unclear question. I edited this question. – sbh Feb 20 '21 at 04:55
  • I think you are asking how to draw a thin line between the current line and the line above it, as well as the current line and the line below it. I don't think this is possible. As zorzi and GH1995 point out, only changing the colour of the current line (:h cursorline) is possible in vim. – Andrew Ho-Lee Feb 20 '21 at 11:36

2 Answers2

6

You might try just :set cursorline

            *'cursorline'* *'cul'* *'nocursorline'* *'nocul'*
'cursorline' 'cul'  boolean (default off)
            local to window
            {not available when compiled without the |+syntax|
            feature}
    Highlight the text line of the cursor with CursorLine |hl-CursorLine|.
    Useful to easily spot the cursor.  Will make screen redrawing slower.
    When Visual mode is active the highlighting isn't used to make it
    easier to see the selected text.

Also see cursorlineopt.

To get something more like your screenshot, you can :highlight CursorLine and set, e.g., ctermbg and guibg to soft-gray values (60 and 424450 work for me).

D. Ben Knoble
  • 26,070
  • 3
  • 29
  • 65
2

Conoline.vim This plugin highlights the line of the cursor, only in the current window. The colors change according to the mode (normal/insert). Colors in each mode are independently customizable.

enter image description here

GH1995
  • 21
  • 3