https://github.com/jaandrle/vim-user_tips
Managing/showing your tips
https://github.com/jaandrle/vim-user_tips
Last synced: 5 months ago
JSON representation
Managing/showing your tips
- Host: GitHub
- URL: https://github.com/jaandrle/vim-user_tips
- Owner: jaandrle
- License: mit
- Created: 2021-12-08T12:30:56.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-08T08:33:34.000Z (over 4 years ago)
- Last Synced: 2025-10-29T00:34:57.973Z (9 months ago)
- Language: Vim script
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# user_tips.vim
This plugin provide two public functions
- `user_tips#current()`: shows registered tip (random on `VimEnter`)
- `user_tips#edit()`: opens file for modifying your tips
## Usage
You can show it in statusline (e. g. mine, the relevant part is `%2*»·%{user_tips#current()}%*`):
```vim
execute 'hi! User2 ctermbg='.synIDattr(synIDtrans(hlID('StatusLine')), 'bg').' ctermfg=grey'
set laststatus=2 " Show status line on startup
set statusline+=··%1*≡·%{QuickFixStatus()}%*··%2*»·%{user_tips#current()}%*··%=
set statusline+=%<%f%R\%M··▶·%{&fileformat}·%{&fileencoding?&fileencoding:&encoding}·%{&filetype}··∷·%{mini_sessions#name('–')}··
```
… leads to:

… for editing use for example:
```vim
nnoremap :call user_tips#edit()
```
Default tips are in [./user_tips.vim](./user_tips.vim), for inspiration see [user_tips.vim](https://github.com/jaandrle/dotfiles/blob/master/vim/.vim/user_tips.vim).
## Installation
Install using your favorite package manager, or use Vim's built-in package
support:
mkdir -p ~/.vim/bundle/vim-user_tips
cd ~/.vim/bundle/vim-user_tips
git clone -b main --single-branch https://github.com/jaandrle/vim-user_tips.git --depth 1
In `.vimrc`:
set runtimepath^=~/.vim/bundle/*