![]() ![]() To achieve this result on older Vim versions, you could combine the idea in the first method with a CursorHold or a CursorMoved autocmd. If you only want the highlight applied in the current window, use an autocmd instead:Īu VimEnter,WinEnter,BufWinEnter * setlocal cursorline That makes it easy to locate the cursor after scrolling in a large file. With the default backslash leader key, typing \c will toggle highlighting on and off. ![]() :nnoremap c :set cursorline! cursorcolumn! :hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white :hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white The following example shows how to change the highlight colors and how to create a mapping to toggle cursorline (to highlight the current line) and cursorcolumn (to highlight the current column): Simply putting :set cursorline in your vimrc will highlight the current line in every window and update the highlight as the cursor moves. 2 Highlighting that stays after cursor moves.1 Highlighting that moves with the cursor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |