All Projects → michaelb → vim-tips

michaelb / vim-tips

Licence: MIT license
Short plugin to display tips at startup

Programming Languages

Vim Script
2826 projects
python
139335 projects - #7 most used programming language

Vim-Tips

A simple plugin that display a tip at startup, no configuration required

Installation

Use your favorite plugin manager; ex vim-plug:

Plug 'michaelb/vim-tips'

vim-tips should be, vim (incl <8), neovim, linux, macOS and windows compatible

Usage

vim-tips prints a message in the command area at startup.

However, you can request tips by calling the function GetTip() to get a string value usable in vimscript. Ex:

let tip = GetTip()
echo tip

Don't forget to load vim-tips beforehand if necessary (you need it at startup) by preceding calls to GetTip() by a runtime plugin/vim-tips.vim

Add tips to vim-startify (courtesy of R0LA1mRifcF8yAkk)

To display a tip (and not a quote) in your vim-startify you can include the following in your config file:

let g:startify_custom_header = 'startify#pad([GetTip()])'

You'll probably also want to deactivate the basic tip display at startup.

Important note

If you are using an autoload session restore (from mksession) it displays a message and therefore hide the vim-tips message.

Your own mappings (deprecated for now, didn't work very well anyway)

vim-tips reads from your vim/neovim config file and displays the lines it recognizes.

For example; nnoremap gd :ALEGoToDefinition will display the tip "Config => gd :ALEGoToDefinition (normal mode)".

If you'd like to display tips more often (and see less mappings from your own config file), you can adjust the tips frequency via let g:vim_tips_tips_frequency=0.5 (with a value between 0.0 and 1.0, higher value increase tips frequency)

Hiding the message at startup

You can specify let g:vim_tips_display_at_startup=0 (default :1) to not have a message displayed at startup. You can then get tips by using the GetTip() function

##Special thanks

To @R0LA1mRifcF8yAkk and @Kamilcuk who have opened so many relevant issues, and helped me catch edge cases and suggested improvements.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].