Merge to 14 is Change the pink omnicomplete popup to a readable color and that short tip mentions SuperTab and offers a change to the Pmenu highlight. Maybe we should feature the script, but I'm not so sure. This one isn't it though, and should probably be removed. If we don't have such a tip, perhaps we should. If we already have a tip on omnicompletion or mapping tab to omnicomplete, we could link the script mentioned from it. JohnBeckett 10:13, 4 September 2008 (UTC)īind the tab key for omni complete (requires supertab.vim) As I mentioned in comments in the tip, the original author of the script (Andreas Politz) said on vim_use that it should not be posted as a working solution. Realistically, I don't think this tip will be fixed, so unless someone supports it I think it should be removed. Fritzophrenic 03:33, 27 August 2008 (UTC)ĭelete I have added the plugin to featured scripts. Since the utility of the tip is in doubt, I suggest featuring the script on our scripts page and removing the tip unless someone speaks up for it. It looks like there is a script linked from the tip that accomplishes the same thing. General comments (not for a specific tip) Automatic type along completion (typeahead) Please add your comment (sign with ~~~~) below the appropriate heading. Restore the cursor position after undoing text change made by a script If you have any comments, edit the appropriate tip page.Īlternatively, comments can be posted on the mailing list.Īutomatic type along completion (typeahead)īind the tab key for omni complete (requires supertab.vim) Please do not edit this page because discussion has finished. In the examples, I used a different highlighting group as in the main article.This page is an archive listing tips created in July 2008. :nnoremap c :exe "let m=matchadd('WildMenu','\\')"Īnd finally, one can clear the permanent highlights (mapped to \Enter): To highlight the words contained in the virtual column (mapped to \c): :nnoremap w :exe "let m=matchadd('WildMenu','\\')" Or one could only highlight the word underneath the cursor (mapped to key \w): :nnoremap l :exe "let m = matchadd('WildMenu','\\%". It is possible to highlight the entire line permanently (mapped to key \l): CursorLineCurrentWindow highlights the current line only the current window, and allows for exceptions like disabling the cursorline for a particular window or making it permanent for (another) window.:nnoremap c :execute 'match Search /\%'.virtcol('.').'v/' To highlight the current virtual column (column after tabs are expanded), and have the highlighting stay where it is when the cursor is moved, use this mapping: Enter :match to clear the highlighting when finished. The mapping also sets mark l so you can type 'l to return to the highlighted line. With the default backslash leader key, pressing \l will highlight the line that currently contains the cursor. :nnoremap l ml:execute 'match Search /\%'.line('.').'l/' To highlight the current line, and have the highlighting stay where it is when the cursor is moved, use this mapping: Highlighting that stays after cursor moves Note that setting the 'cursorline' or 'cursorcolumn' options can cause Vim to respond slowly, especially for large files or files with long lines. If you only want highlighting in insert mode (but don't mind that it appears in all windows) use InsertEnter and InsertLeave instead of WinEnter and WinLeave above. 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 |