Debugging: verbosity

This commit is contained in:
Marco Hinz 2016-01-07 18:38:30 +01:00
parent d2b795a6f7
commit 77ac08ea92
2 changed files with 47 additions and 0 deletions

View File

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
### Added
- Debugging: [Verbosity](README.md#verbosity)
## [1.1] - 2016-01-07 ## [1.1] - 2016-01-07
### Added ### Added

View File

@ -48,6 +48,7 @@ added every day. Things about to be added can be found here:
- [General tips](#general-tips) - [General tips](#general-tips)
- [Profiling startup time](#profiling-startup-time) - [Profiling startup time](#profiling-startup-time)
- [Profiling at runtime](#profiling-at-runtime) - [Profiling at runtime](#profiling-at-runtime)
- [Verbosity](#verbosity)
#### [Miscellaneous](#miscellaneous-1) #### [Miscellaneous](#miscellaneous-1)
@ -834,6 +835,48 @@ two different sections `FUNCTIONS SORTED ON TOTAL TIME` and `FUNCTIONS SORTED ON
SELF TIME` that are worth gold. On a quick glance you can see, if a certain SELF TIME` that are worth gold. On a quick glance you can see, if a certain
function is taking too long. function is taking too long.
#### Verbosity
Another useful way for observing what Vim is currently doing is increasing the
verbosity level. Currently Vim supports 9 different levels. See `:h 'verbose'`
for the full list.
```viml
:e /tmp/foo
:set verbose=2
:w
:set verbose=0
```
This would show all the files that get sourced, e.g. the undo file or various
plugins that act on saving.
If you only want increase verbosity for a single command, there's also
`:verbose`, which simply gets put in front of any other command. It takes the
verbosity level as count and defaults to 1:
```viml
:verb set verbose
" verbose=1
:10verb set verbose
" verbose=10
```
It's very often used with its default verbosity level 1 to show where an option
was set last:
```viml
:verb set ai?
" Last set from ~/.vim/vimrc
```
Naturally, the higher the verbosity level the more overwhelming the output. But
fear no more, you can simply redirect the output to a file:
```viml
:set verbosefile=/tmp/foo | 15verbose echo "foo" | vsplit /tmp/foo
```
## Miscellaneous ## Miscellaneous
#### Vim distributions #### Vim distributions