remove old airline to move to pathogen

This commit is contained in:
2017-02-25 18:17:23 -05:00
parent 2b7a4a134e
commit 69dc1d1608
70 changed files with 0 additions and 7558 deletions

View File

@@ -1,793 +0,0 @@
*airline.txt* Lean and mean status/tabline that's light as air
*airline*
_ _ _ _ ~
__ _(_)_ __ ___ __ _(_)_ __| (_)_ __ ___ ~
\ \ / / | '_ ` _ \ _____ / _` | | '__| | | '_ \ / _ \ ~
\ V /| | | | | | |_____| (_| | | | | | | | | | __/ ~
\_/ |_|_| |_| |_| \__,_|_|_| |_|_|_| |_|\___| ~
~
==============================================================================
CONTENTS *airline-contents*
01. Intro ............................................... |airline-intro|
02. Features ......................................... |airline-features|
03. Name ................................................. |airline-name|
04. Configuration ............................... |airline-configuration|
05. Commands ......................................... |airline-commands|
06. Customization ............................... |airline-customization|
07. Extensions ..................................... |airline-extensions|
08. Advanced Customization ............. |airline-advanced-customization|
09. Funcrefs ......................................... |airline-funcrefs|
10. Pipeline ......................................... |airline-pipeline|
11. Writing Extensions ..................... |airline-writing-extensions|
12. Writing Themes ..................................... |airline-themes|
13. Troubleshooting ........................... |airline-troubleshooting|
14. Contributions ............................... |airline-contributions|
15. License ........................................... |airline-license|
==============================================================================
INTRODUCTION *airline-intro*
vim-airline is a fast and lightweight alternative to powerline, written
in 100% vimscript with no outside dependencies.
==============================================================================
FEATURES *airline-features*
* tiny core written with extensibility in mind.
* integrates with many popular plugins.
* looks good with regular fonts, and provides configuration points so you
can use unicode or powerline symbols.
* optimized for speed; it loads in under a millisecond.
* fully customizable; if you know a little 'statusline' syntax you can
tweak it to your needs.
* extremely easy to write themes.
==============================================================================
NAME *airline-name*
Where did the name come from?
I wrote this on an airplane, and since it's light as air it turned out to be a
good name :-)
==============================================================================
CONFIGURATION *airline-configuration*
There are a couple configuration values available (shown with their default
values):
* the separator used on the left side >
let g:airline_left_sep='>'
<
* the separator used on the right side >
let g:airline_right_sep='<'
<
* enable modified detection >
let g:airline_detect_modified=1
* enable paste detection >
let g:airline_detect_paste=1
<
* enable iminsert detection >
let g:airline_detect_iminsert=0
<
* determine whether inactive windows should have the left section collapsed to
only the filename of that buffer. >
let g:airline_inactive_collapse=1
<
* themes are automatically selected based on the matching colorscheme. this
can be overridden by defining a value. >
let g:airline_theme=
<
* if you want to patch the airline theme before it gets applied, you can
supply the name of a function where you can modify the palette. >
let g:airline_theme_patch_func = 'AirlineThemePatch'
function! AirlineThemePatch(palette)
if g:airline_theme == 'badwolf'
for colors in values(a:palette.inactive)
let colors[3] = 245
endfor
endif
endfunction
<
* enable/disable automatic population of the `g:airline_symbols` dictionary
with powerline symbols. >
let g:airline_powerline_fonts=0
<
* define the set of text to display for each mode. >
let g:airline_mode_map = {} " see source for the defaults
" or copy paste the following into your vimrc for shortform text
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'c' : 'C',
\ 'v' : 'V',
\ 'V' : 'V',
\ '' : 'V',
\ 's' : 'S',
\ 'S' : 'S',
\ '' : 'S',
\ }
<
* define the set of filename match queries which excludes a window from having
its statusline modified >
let g:airline_exclude_filenames = [] " see source for current list
<
* define the set of filetypes which are excluded from having its window
statusline modified >
let g:airline_exclude_filetypes = [] " see source for current list
<
* defines whether the preview window should be excluded from have its window
statusline modified (may help with plugins which use the preview window
heavily) >
let g:airline_exclude_preview = 0
<
==============================================================================
COMMANDS *airline-commands*
:AirlineTheme {theme-name} *:AirlineTheme*
Displays or changes the current theme.
:AirlineToggleWhitespace *:AirlineToggleWhitespace*
Toggles whitespace detection.
:AirlineToggle *:AirlineToggle*
Toggles between the standard 'statusline' and airline.
:AirlineRefresh *:AirlineRefresh*
Refreshes all highlight groups and redraws the statusline.
==============================================================================
CUSTOMIZATION *airline-customization*
The following are some unicode symbols for customizing the left/right
separators, as well as the powerline font glyths.
Note: You must define the dictionary first before setting values. Also, it's a
good idea to check whether if it exists as to avoid accidentally overwritting
its contents. >
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
" powerline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
" old vim-powerline symbols
let g:airline_left_sep = '⮀'
let g:airline_left_alt_sep = '⮁'
let g:airline_right_sep = '⮂'
let g:airline_right_alt_sep = '⮃'
let g:airline_symbols.branch = '⭠'
let g:airline_symbols.readonly = '⭤'
let g:airline_symbols.linenr = '⭡'
<
For more intricate customizations, you can replace the predefined sections
with the usual statusline syntax.
Note: If you define any section variables it will replace the default values
entirely. If you want to disable only certain parts of a section you can try
using variables defined in the |airline-configuration| or |airline-extensions|
section.
>
variable names default contents
----------------------------------------------------------------------------
let g:airline_section_a (mode, paste, iminsert)
let g:airline_section_b (hunks, branch)
let g:airline_section_c (bufferline or filename)
let g:airline_section_gutter (readonly, csv)
let g:airline_section_x (tagbar, filetype, virtualenv)
let g:airline_section_y (fileencoding, fileformat)
let g:airline_section_z (percentage, line number, column number)
let g:airline_section_warning (syntastic, whitespace)
" here is an example of how you could replace the branch indicator with
" the current working directory, followed by the filename.
let g:airline_section_b = '%{getcwd()}'
let g:airline_section_c = '%t'
<
==============================================================================
EXTENSIONS *airline-extensions*
Most extensions are enabled by default and lazily loaded when the
corresponding plugin (if any) is detected.
By default, airline will attempt to load any extension it can find in the
'runtimepath'. On some systems this can result in an undersirable startup
cost. You can disable the check with the following flag. >
let g:airline#extensions#disable_rtp_load = 1
<
Note: Third party plugins that rely on this behavior will be affected. You
will need to manually load them.
------------------------------------- *airline-default*
The default extension understands all of the `g:` variables in the
|airline-configuration| section, however it also has some more fine-tuned
configuration values that you can use.
* control which sections get truncated and at what width. >
let g:airline#extensions#default#section_truncate_width = {
\ 'b': 79,
\ 'x': 60,
\ 'y': 88,
\ 'z': 45,
\ }
" Note: set to an empty dictionary to disable truncation.
let g:airline#extensions#default#section_truncate_width = {}
<
* configure the layout of the sections by specificing an array of two arrays
(first array is the left side, second array is the right side). >
let g:airline#extensions#default#layout = [
\ [ 'a', 'b', 'c' ],
\ [ 'x', 'y', 'z', 'warning' ]
\ ]
<
------------------------------------- *airline-quickfix*
The quickfix extension is a simple built-in extension which determines
whether the buffer is a quickfix or location list buffer, and adjusts the
title accordingly.
* configure the title text for quickfix buffers >
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix'
<
* configure the title text for location list buffers >
let g:airline#extensions#quickfix#location_text = 'Location'
<
------------------------------------- *airline-bufferline*
vim-bufferline <https://github.com/bling/vim-bufferline>
* enable/disable bufferline integration >
let g:airline#extensions#bufferline#enabled = 1
<
* determine whether bufferline will overwrite customization variables >
let g:airline#extensions#bufferline#overwrite_variables = 1
<
------------------------------------- *airline-branch*
fugitive.vim <https://github.com/tpope/vim-fugitive>
lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
vcscommand <http://www.vim.org/scripts/script.php?script_id=90>
* enable/disable fugitive/lawrencium integration >
let g:airline#extensions#branch#enabled = 1
<
* change the text for when no branch is detected >
let g:airline#extensions#branch#empty_message = ''
* use vcscommand.vim if available >
let g:airline#extensions#branch#use_vcscommand = 0
* truncate long branch names to a fixed length >
let g:airline#extensions#branch#displayed_head_limit = 10
------------------------------------- *airline-syntastic*
syntastic <https://github.com/scrooloose/syntastic>
* enable/disable syntastic integration >
let g:airline#extensions#syntastic#enabled = 1
<
------------------------------------- *airline-tagbar*
tagbar <https://github.com/majutsushi/tagbar>
* enable/disable tagbar integration >
let g:airline#extensions#tagbar#enabled = 1
<
* change how tags are displayed (:help tagbar-statusline) >
let g:airline#extensions#tagbar#flags = '' (default)
let g:airline#extensions#tagbar#flags = 'f'
let g:airline#extensions#tagbar#flags = 's'
let g:airline#extensions#tagbar#flags = 'p'
<
------------------------------------- *airline-csv*
csv.vim <https://github.com/chrisbra/csv.vim>
* enable/disable csv integration for displaying the current column. >
let g:airline#extensions#csv#enabled = 1
<
* change how columns are displayed. >
let g:airline#extensions#csv#column_display = 'Number' (default)
let g:airline#extensions#csv#column_display = 'Name'
<
------------------------------------- *airline-hunks*
vim-gitgutter <https://github.com/airblade/vim-gitgutter>
vim-signify <https://github.com/mhinz/vim-signify>
changesPlugin <https://github.com/chrisbra/changesPlugin>
* enable/disable showing a summary of changed hunks under source control. >
let g:airline#extensions#hunks#enabled = 1
<
* enable/disable showing only non-zero hunks. >
let g:airline#extensions#hunks#non_zero_only = 0
<
* set hunk count symbols. >
let g:airline#extensions#hunks#hunk_symbols = ['+', '~', '-']
<
------------------------------------- *airline-ctrlp*
ctrlp <https://github.com/kien/ctrlp.vim>
* configure which mode colors should ctrlp window use (takes effect
only if the active airline theme doesn't define ctrlp colors) >
let g:airline#extensions#ctrlp#color_template = 'insert' (default)
let g:airline#extensions#ctrlp#color_template = 'normal'
let g:airline#extensions#ctrlp#color_template = 'visual'
let g:airline#extensions#ctrlp#color_template = 'replace'
<
* configure whether to show the previous and next modes (mru, buffer, etc...)
>
let g:airline#extensions#ctrlp#show_adjacent_modes = 1
<
------------------------------------- *airline-virtualenv*
virtualenv <https://github.com/jmcantrell/vim-virtualenv>
* enable/disable virtualenv integration >
let g:airline#extensions#virtualenv#enabled = 1
<
------------------------------------- *airline-eclim*
eclim <https://eclim.org>
* enable/disable eclim integration, which works well with the
|airline-syntastic| extension. >
let g:airline#extensions#eclim#enabled = 1
------------------------------------- *airline-whitespace*
* enable/disable detection of whitespace errors. >
let g:airline#extensions#whitespace#enabled = 1
<
* customize the type of mixed indent checking to perform. >
" must be all spaces or all tabs before the first non-whitespace character
let g:airline#extensions#whitespace#mixed_indent_algo = 0 (default)
" certain number of spaces are allowed after tabs, but not in between
" this algorithm works well for /** */ style comments in a tab-indented file
let g:airline#extensions#whitespace#mixed_indent_algo = 1
<
* customize the whitespace symbol. >
let g:airline#extensions#whitespace#symbol = '!'
<
* configure which whitespace checks to enable. >
let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing' ]
<
* configure the maximum number of lines where whitespace checking is enabled. >
let g:airline#extensions#whitespace#max_lines = 20000
<
* configure whether a message should be displayed. >
let g:airline#extensions#whitespace#show_message = 1
<
* configure the formatting of the warning messages. >
let g:airline#extensions#whitespace#trailing_format = 'trailing[%s]'
let g:airline#extensions#whitespace#mixed_indent_format = 'mixed-indent[%s]'
<
------------------------------------- *airline-tabline*
* enable/disable enhanced tabline. >
let g:airline#extensions#tabline#enabled = 0
<
* enable/disable displaying buffers with a single tab. >
let g:airline#extensions#tabline#show_buffers = 1
<
* configure filename match rules to exclude from the tabline. >
let g:airline#extensions#tabline#excludes = []
<
* configure how numbers are calculated in tab mode. >
let g:airline#extensions#tabline#tab_nr_type = 0 " # of splits (default)
let g:airline#extensions#tabline#tab_nr_type = 1 " tab number
<
* enable/disable displaying tab number in tabs mode. >
let g:airline#extensions#tabline#show_tab_nr = 1
* enable/disable displaying tab type (far right)
let g:airline#extensions#tabline#show_tab_type = 1
* enable/disable displaying index of the buffer.
When enabled, numbers will be displayed in the tabline and mappings will be
exposed to allow you to select a buffer directly. Up to 9 mappings will be
exposed.
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
Note: Mappings will be ignored within a NERDTree buffer.
* defines the name of a formatter for how buffer names are displayed. >
let g:airline#extensions#tabline#formatter = 'default'
" here is how you can define a 'foo' formatter:
function! airline#extensions#tabline#foo#format(bufnr, buffers)
return fnamemodify(bufname(a:bufnr), ':t')
endfunction
let g:airline#extensions#tabline#formatter = 'foo'
<
Note: the following variables are only used by the 'default' formatter.
* configure whether buffer numbers should be shown. >
let g:airline#extensions#tabline#buffer_nr_show = 0
<
* configure how buffer numbers should be formatted with |printf|. >
let g:airline#extensions#tabline#buffer_nr_format = '%s: '
<
* configure the formatting of filenames (see |filename-modifiers|). >
let g:airline#extensions#tabline#fnamemod = ':p:.'
<
* configure collapsing parent directories in buffer name. >
let g:airline#extensions#tabline#fnamecollapse = 1
" The `unique_tail` algorithm will display the tail of the filename, unless
" there is another file of the same name, in which it will display it along
" with the containing parent directory.
let g:airline#extensions#tabline#formatter = 'unique_tail'
" The `unique_tail_improved` - another algorithm, that will smartly uniquify
" buffers names with similar filename, suppressing common parts of paths.
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
<
* configure the minimum number of buffers needed to show the tabline. >
let g:airline#extensions#tabline#buffer_min_count = 0
<
Note: this setting only applies to a single tab and when `show_buffers` is
true.
* configure the minimum number of tabs needed to show the tabline. >
let g:airline#extensions#tabline#tab_min_count = 0
<
Note: this setting only applies when `show_buffers` is false.
* configure separators for the tabline only. >
let g:airline#extensions#tabline#left_sep = ''
let g:airline#extensions#tabline#left_alt_sep = ''
let g:airline#extensions#tabline#right_sep = ''
let g:airline#extensions#tabline#right_alt_sep = ''
* configure whether close button should be shown
let g:airline#extensions#tabline#show_close_button = 1
* configure symbol used to represent close button
let g:airline#extensions#tabline#close_symbol = 'X'
<
Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
------------------------------------- *airline-tmuxline*
tmuxline <https://github.com/edkolev/tmuxline.vim>
* enable/disable tmuxline integration >
let g:airline#extensions#tmuxline#enabled = 0
<
* configure which mode colors should be used in tmux statusline >
let airline#extensions#tmuxline#color_template = 'normal' (default)
let airline#extensions#tmuxline#color_template = 'insert'
let airline#extensions#tmuxline#color_template = 'visual'
let airline#extensions#tmuxline#color_template = 'replace'
<
* if specified, setting this option will trigger writing to the file whenever the
airline theme is applied, i.e. when :AirlineTheme is executed and on vim
startup >
airline#extensions#tmuxline#snapshot_file = "~/.tmux-statusline-colors.conf"
<
------------------------------------- *airline-promptline*
promptline <https://github.com/edkolev/promptline.vim>
* configure the path to the snapshot .sh file. Mandatory option. The created
file should be sourced by the shell on login >
" in .vimrc
airline#extensions#promptline#snapshot_file = "~/.shell_prompt.sh"
" in .bashrc/.zshrc
[ -f ~/.shell_prompt.sh ] && source ~/.shell_prompt.sh
<
* enable/disable promptline integration >
let g:airline#extensions#promptline#enabled = 0
<
* configure which mode colors should be used in prompt >
let airline#extensions#promptline#color_template = 'normal' (default)
let airline#extensions#promptline#color_template = 'insert'
let airline#extensions#promptline#color_template = 'visual'
let airline#extensions#promptline#color_template = 'replace'
<
------------------------------------- *airline-nrrwrgn*
NrrwRgn <https://github.com/chrisbra/NrrwRgn>
* enable/disable NrrwRgn integration >
let g:airline#extensions#nrrwrgn#enabled = 1
------------------------------------- *airline-capslock*
vim-capslock <https://github.com/tpope/vim-capslock>
* enable/disable vim-capslock integration >
let g:airline#extensions#capslock#enabled = 1
------------------------------------- *airline-windowswap*
vim-windowswap <https://github.com/wesQ3/vim-windowswap>
* enable/disable vim-windowswap integration >
let g:airline#extensions#windowswap#enabled = 1
* set marked window indicator string >
let g:airline#extensions#windowswap#indicator_text = 'WS'
<
==============================================================================
ADVANCED CUSTOMIZATION *airline-advanced-customization*
The defaults will accomodate the mass majority of users with minimal
configuration. However, if you want to reposition sections or contents you can
do so with built-in helper functions, which makes it possible to create
sections in a more declarative style.
------------------------------------- *airline-parts*
A part is something that contains metadata that eventually gets rendered into
the statusline. You can define parts that contain constant strings or
functions. Defining parts is needed if you want to use features like automatic
insertion of separators or hiding based on window width.
For example, this is how you would define a part function: >
call airline#parts#define_function('foo', 'GetFooText')
<
Here is how you would define a part that is visible only if the window width
greater than a minimum width. >
call airline#parts#define_minwidth('foo', 50)
<
Parts can be configured to be visible conditionally. >
call airline#parts#define_condition('foo', 'getcwd() =~ "work_dir"')
<
Note: Part definitions are combinative; e.g. the two examples above modify the
same `foo` part.
Note: Look at the source code and tests for the full API.
------------------------------------- *airline-predefined-parts*
Before is a list of parts that are predefined by vim-airline.
* `mode` displays the current mode
* `iminsert` displays the current insert method
* `paste` displays the paste indicator
* `filetype` displays the file type
* `readonly` displays the read only indicator
* `file` displays the filename and modified indicator
* `ffenc` displays the file format and encoding
And the following are defined for their respective extensions:
`hunks`, `branch`, `tagbar`, `syntastic`, `whitespace`
------------------------------------- *airline-accents*
Accents can be defined on any part, like so: >
call airline#parts#define_accent('foo', 'red')
<
This will override the colors of that part by using what is defined in that
particular accent. In the above example, the `red` accent is used, which means
regardless of which section the part is used in, it will have red foreground
colors instead of the section's default foreground color.
The following accents are defined by default. Themes can define their variants
of the colors, but defaults will be provided if missing. >
bold, italic, red, green, blue, yellow, orange, purple
<
The defaults configure the mode and line number parts to be bold, and the
readonly part to be red.
------------------------------------- *airline-sections*
Once a part is defined, you can use helper functions to generate the
statuslines for each section. For example, to use the part above, we could
define a section like this: >
function! AirlineInit()
let g:airline_section_a = airline#section#create(['mode', ' ', 'foo'])
let g:airline_section_b = airline#section#create_left(['ffenc','file'])
let g:airline_section_c = airline#section#create(['%{getcwd()}'])
endfunction
autocmd VimEnter * call AirlineInit()
<
This will create a section with the `mode`, followed by a space, and our `foo`
part in section `a`. Section `b` will have two parts with a left-side
separator. And section `c` will contain the current path. You may notice that
the space and cwd are not defined parts. For convenience, if a part of that
key does not exist, it will be inserted as is. The unit tests will be a good
resource for possibilities.
Note: The use of |VimEnter| is important, because most extensions are lazily
loaded, so we must give them a chance to define their parts before we can use
them.
Note: The `airline#section#create` function and friends will do its best to
create a section with the appropriate separators, but it only works for
function and text parts. Special 'statusline' items like %f or raw/undefined
parts will not work as it is not possible to inspect their widths/contents
before rendering to the statusline.
==============================================================================
FUNCREFS *airline-funcrefs*
vim-airline internally uses funcrefs to integrate with third party plugins,
and you can tap into this functionality to extend it for you needs. This is
the most powerful way to customize the statusline, and sometimes it may be
easier to go this route than the above methods.
Every section can have two values. The default value is the global `g:`
variable which is used in the absense of a `w:` value. This makes it very easy
to override only certain parts of the statusline by only defining window-local
variables for a subset of all sections.
------------------------------------- *add_statusline_func*
The following is an example of how you can extend vim-airline to support a
new plugin. >
function! MyPlugin(...)
if &filetype == 'MyPluginFileType'
let w:airline_section_a = 'MyPlugin'
let w:airline_section_b = '%f'
let w:airline_section_c = '%{MyPlugin#function()}'
let g:airline_variable_referenced_in_statusline = 'foo'
endif
endfunction
call airline#add_statusline_func('MyPlugin')
<
Notice that only the left side of the statusline is overwritten. This means
the right side (the line/column numbers, etc) will be intact.
------------------------------------- *remove_statusline_func*
You can also remove a function as well, which is useful for when you want a
temporary override. >
call airline#remove_statusline_func('MyPlugin')
<
==============================================================================
PIPELINE *airline-pipeline*
Sometimes you want to do more than just use overrides. The statusline funcref
is invoked and passed two arguments. The first of these arguments is the
statusline builder. You can use this to build completely custom statuslines
to your liking. Here is an example: >
>
function! MyPlugin(...)
" first variable is the statusline builder
let builder = a:1
" WARNING: the API for the builder is not finalized and may change
call builder.add_section('Normal', '%f')
call builder.add_section('WarningMsg', '%{getcwd()}')
call builder.split()
call builder.add_section('airline_z', '%p%%')
" tell the core to use the contents of the builder
return 1
endfunction
<
The above example uses various example highlight groups to demonstrate
that you can use any combination from the loaded colorscheme. However, if
you want colors to change between modes, you should use one of the section
highlight groups, e.g. `airline_a` and `airline_b`.
The second variable is the context, which is a dictionary containing various
values such as whether the statusline is active or not, and the window number.
>
context = {
'winnr': 'the window number for the statusline',
'active': 'whether the window is active or not',
'bufnr': 'the current buffer for this window',
}
<
------------------------------------- *airline-pipeline-return-codes*
The pipeline accepts various return codes and can be used to determine the
next action. The following are the supported codes: >
0 the default, continue on with the next funcref
-1 do not modify the statusline
1 modify the statusline with the current contents of the builder
<
Note: Any value other than 0 will halt the pipeline and prevent the next
funcref from executing.
==============================================================================
WRITING EXTENSIONS *airline-writing-extensions*
For contributions into the plugin, here are the following guidelines:
1. For simple 'filetype' checks, they can be added directly into the
`extensions.vim` file.
2. Pretty much everything else should live as a separate file under the
`extensions/` directory.
a. Inside `extensions.vim`, add a check for some variable or command that
is always available (these must be defined in `plugin/`, and _not_
`autoload/` of the other plugin). If it exists, then initialize the
extension. This ensures that the extension is loaded if and only if the
user has the other plugin installed. Also, a check to
`airline#extensions#foo_plugin#enabled` should be performed to allow the
user to disable it.
b. Configuration variables for the extension should reside in the
extension, e.g. `g:airline#extensions#foo_plugin#bar_variable`.
See the source of |example.vim| for documented code of how to write one.
Looking at the other extensions is also a good resource.
==============================================================================
WRITING THEMES *airline-themes*
Themes are written "close to the metal" -- you will need to know some basic
VimL syntax to write a theme, but if you've written in any programming
language before it will be easy to pick up.
The |dark.vim| theme fully documents this procedure and will guide you through
the process. The |jellybeans.vim| theme is another example of how to write a
theme, but instead of manually declaring colors, it extracts the values from
highlight groups.
==============================================================================
TROUBLESHOOTING *airline-troubleshooting*
Q. There are no colors.
A. You need to set up your terminal correctly. For more details, see
<http://vim.wikia.com/wiki/256_colors_in_vim>. Alternatively, if you want
to bypass the automatic detection of terminal colors, you can force Vim
into 256 color mode with this: >
set t_Co=256
<
Q. The statusline does not appear until I create a split.
A. This is the default setting of 'laststatus'. If you want it to appear all
the time, add the following to your vimrc: >
set laststatus=2
<
Q. Powerline symbols are not showing up.
A. First, you must install patched powerline fonts. Second, you must enable
unicode in vim. >
set encoding=utf-8
<
Q. There is a pause when leaving insert mode.
A. Add the following to your vimrc. >
set ttimeoutlen=50
<
Q. The colors look a little off for some themes.
A. Certain themes are derived from the active colorscheme by extracting colors
from predefined highlight groups. These airline themes will look good for
their intended matching colorschemes, but will be hit or miss when loaded
with other colorschemes.
Solutions to other common problems can be found in the Wiki:
<https://github.com/bling/vim-airline/wiki/FAQ>
==============================================================================
CONTRIBUTIONS *airline-contributions*
Contributions and pull requests are welcome.
==============================================================================
LICENSE *airline-license*
MIT License. Copyright © 2013-2014 Bailey Ling.
vim:tw=78:ts=8:ft=help:norl:

View File

@@ -1,754 +0,0 @@
*easytags.txt* Automated tag generation and syntax highlighting in Vim
===============================================================================
Contents ~
1. Introduction |easytags-introduction|
2. Installation |easytags-installation|
1. A note about Windows |easytags-note-about-windows|
3. Commands |easytags-commands|
1. The |:UpdateTags| command
2. The |:HighlightTags| command
4. Options |easytags-options|
1. The |g:easytags_cmd| option
2. The |g:easytags_opts| option
3. The |g:easytags_async| option
4. The |g:easytags_syntax_keyword| option
5. The |g:easytags_languages| option
6. The |g:easytags_file| option
7. The |g:easytags_dynamic_files| option
8. The |g:easytags_by_filetype| option
9. The |g:easytags_events| option
10. The |g:easytags_always_enabled| option
11. The |g:easytags_on_cursorhold| option
12. The |g:easytags_updatetime_min| option
13. The |g:easytags_auto_update| option
14. The |g:easytags_auto_highlight| option
15. The |g:easytags_autorecurse| option
16. The |g:easytags_include_members| option
17. The |g:easytags_resolve_links| option
18. The |g:easytags_suppress_ctags_warning| option
19. The |g:easytags_suppress_report| option
5. Customizing the easytags plug-in |customizing-easytags-plug-in|
1. Passing custom command line arguments to Exuberant Ctags |easytags-passing-custom-command-line-arguments-to-exuberant-ctags|
2. Update & highlight tags immediately after save |easytags-update-highlight-tags-immediately-after-save|
3. How to customize the highlighting colors? |easytags-how-to-customize-highlighting-colors|
6. Faster syntax highlighting using Python |easytags-faster-syntax-highlighting-using-python|
1. The |g:easytags_python_enabled| option
2. The |g:easytags_python_script| option
7. Troubleshooting |easytags-troubleshooting|
8. vim-easytags is slow! |vim-easytags-is-slow|
1. |:HighlightTags| only works for the tags file created by |:UpdateTags| |easytags-highlighttags-only-works-for-tags-file-created-by-updatetags|
2. The plug-in complains that Exuberant Ctags isn't installed |easytags-plug-in-complains-that-exuberant-ctags-isnt-installed|
3. Vim locks up while the plug-in is running |easytags-vim-locks-up-while-plug-in-is-running|
4. Failed to highlight tags because pattern is too big! |easytags-failed-to-highlight-tags-because-pattern-is-too-big|
5. The plug-in doesn't seem to work in Cygwin |easytags-plug-in-doesnt-seem-to-work-in-cygwin|
9. Contact |easytags-contact|
10. License |easytags-license|
11. References |easytags-references|
===============================================================================
*easytags-introduction*
Introduction ~
Vim has long been my favorite text editor and combined with Exuberant Ctags [1]
it has the potential to provide most of what I expect from an integrated
development environment [2]. Exuberant Ctags is the latest incarnation of a
family of computer programs [3] that scan source code files to create an index
of identifiers (tags) and where they are defined. Vim uses this index (a so-
called tags file) to enable you to jump to the definition of any identifier
using the Control-] (see |CTRL-]|) mapping.
When you're familiar with integrated development environments you may recognize
this feature as "Go-to definition". One advantage of the combination of Vim and
Exuberant Ctags over integrated development environments is that Vim supports
syntax highlighting for over 500 file types [4] (!) and Exuberant Ctags can
generate tags for over 40 file types [5] as well...
There's just one problem: You have to manually keep your tags files up-to-date
and this turns out to be a royal pain in the ass! So I set out to write a Vim
plug-in that would do this boring work for me. When I finished the plug-in's
basic functionality (one automatic command and a call to |system()| later) I
became interested in dynamic syntax highlighting, so I added that as well to
see if it would work -- surprisingly well I'm happy to report!
===============================================================================
*easytags-installation*
Installation ~
_Please note that the vim-easytags plug-in requires my vim-misc plug-in which
is separately distributed._
Unzip the most recent ZIP archives of the vim-easytags [6] and vim-misc [7]
plug-ins inside your Vim profile directory (usually this is '~/.vim' on UNIX
and '%USERPROFILE%\vimfiles' on Windows), restart Vim and execute the command
':helptags ~/.vim/doc' (use ':helptags ~\vimfiles\doc' instead on Windows).
If you prefer you can also use Pathogen [8], Vundle [9] or a similar tool to
install and update the vim-easytags [10] and vim-misc [11] plug-ins using a
local clone of the git repository.
Now try it out: Edit any file type supported by Exuberant Ctags and within ten
seconds the plug-in should create/update your tags file ('~/.vimtags' on UNIX,
'~/_vimtags' on Windows) with the tags defined in the file you just edited!
This means that whatever file you're editing in Vim (as long as it's on the
local file system), tags will always be available by the time you need them!
Additionally if the file you just opened is an AWK, C#, C, C++, Objective-C,
Java, Lua, Perl, PHP, Python, Ruby, Shell, Tcl or Vim source file you should
also notice that the function and/or type names defined in the file have been
syntax highlighted.
The 'easytags.vim' plug-in is intended to work automatically once it's
installed, but if you want to change how it works there are several options you
can change and commands you can execute from your own mappings and/or automatic
commands. These are all documented below.
Note that if the plug-in warns you 'ctags' isn't installed you'll have to
download it from its homepage [1], or if you're running Debian/Ubuntu you can
install it by executing the following shell command:
>
$ sudo apt-get install exuberant-ctags
<
-------------------------------------------------------------------------------
*easytags-note-about-windows*
A note about Windows ~
On Windows the |system()| function used by 'easytags.vim' causes a command
prompt window to pop up while Exuberant Ctags is executing. If this bothers you
then you can install my shell.vim [12] plug-in which includes a DLL [13] that
works around this issue. Once you've installed both plug-ins it should work out
of the box! Please let me know if this doesn't work for you.
===============================================================================
*easytags-commands*
Commands ~
-------------------------------------------------------------------------------
The *:UpdateTags* command
This command executes Exuberant Ctags [1] from inside Vim to update the global
tags file defined by |g:easytags_file|. When no arguments are given the tags
for the current file are updated, otherwise the arguments are passed on to
'ctags'. For example when you execute the Vim command ':UpdateTags -R ~/.vim'
(or ':UpdateTags -R ~\vimfiles' on Windows) the plug-in will execute 'ctags -R
~/.vim' for you (with some additional arguments, see the troubleshooting
section "|:HighlightTags| only works for the tags file created by
|:UpdateTags|" for more information).
When you execute this command like ':UpdateTags!' (including the bang!) then
all tags whose files are missing will be filtered from the global tags file.
Note that this command will be executed automatically every once in a while,
assuming you haven't changed |g:easytags_on_cursorhold|.
-------------------------------------------------------------------------------
The *:HighlightTags* command
When you execute this command while editing one of the supported file types
(see above) the relevant tags in the current file are highlighted. The tags to
highlight are gathered from all tags files known to Vim (through the |'tags'|
option).
Note that this command will be executed automatically every once in a while,
assuming you haven't changed |g:easytags_on_cursorhold|.
===============================================================================
*easytags-options*
Options ~
The easytags plug-in should work out of the box but if you don't like the
default configuration you can change how it works by setting the variables
documented below. Most of these variables can also be changed for specific
files by setting a buffer local variable instead of the global variable. For
example to disable automatic highlighting (enabled by default) only in Python
files you can add the following line to your |vimrc| script:
>
:autocmd FileType python let b:easytags_auto_highlight = 0
<
Note that buffer local variables always override global variables, so if you
want to undo this for a specific file you have to use |:unlet|:
>
:unlet b:easytags_auto_highlight
<
-------------------------------------------------------------------------------
The *g:easytags_cmd* option
The plug-in will try to determine the location where Exuberant Ctags is
installed on its own but this might not always work because any given
executable named 'ctags' in your '$PATH' might not in fact be Exuberant Ctags
but some older, more primitive 'ctags' implementation which doesn't support the
same command line options and thus breaks the easytags plug-in. If this is the
case you can set the global variable |g:easytags_cmd| to the location where
you've installed Exuberant Ctags, e.g.:
>
:let g:easytags_cmd = '/usr/local/bin/ctags'
<
If you rely entirely on language-specific configuration and don't have a
general ctags program, set this to the empty string.
-------------------------------------------------------------------------------
The *g:easytags_opts* option
If you need to pass custom command line option(s) to the program specified by
|g:easytags_cmd| you can set this option to a list of strings to be passed to
Exuberant Ctags. Make sure to only use options that are valid in any context,
for example the concatenation of |g:easytags_cmd|, |g:easytags_opts| and
'--list-languages' should work as expected. Here's an example:
>
:let g:easytags_opts = ['--options=$VIM\ctags\ctags.cnf']
<
The example above (based on issue 98 [14]) overrides the location of Exuberant
Ctags' configuration file. As you can see the command line option(s) may
contain environment variables, these will be expanded before passing the
options to Exuberant Ctags (to make sure it works in all environments).
-------------------------------------------------------------------------------
The *g:easytags_async* option
By default vim-easytags runs Exuberant Ctags and updates your tags file in the
foreground, blocking Vim in the process. As your tags files get larger this
becomes more annoying. It has been the number one complaint about vim-easytags
since I published the first release online.
In version 3.5 of the vim-easytags plug-in support for asynchronous tags file
updates was added. It's not enabled by default yet because I want to make sure
I'm not breaking the plug-in for the majority of users. However after I've
gathered some feedback I definitely want to make this the default mode.
By setting this option to true (1) you enable asynchronous tags file updates.
Good luck! ;-)
Note that asynchronous updates on Windows currently require the installation of
my vim-shell [12] plug-in (for obscure technical reasons that I want to fix but
don't know how yet).
-------------------------------------------------------------------------------
The *g:easytags_syntax_keyword* option
When you look into how the dynamic syntax highlighting in the vim-easytags
plug-in works you'll realize that vim-easytags is really abusing Vim's syntax
highlighting engine. This can cause Vim to slow down to a crawl, depending on
how big your tags files are. To make things worse in Vim 7.4 a new regex engine
was introduced which exacerbates the problem (the patterns generated by vim-
easytags bring out the worst of the new regex engine).
Since version 3.6 the vim-easytags plug-in tries to squeeze as much performance
as possible out of Vim by using keyword highlighting where this is possible
without sacrificing accuracy. If your Vim's syntax highlighting is still too
slow you can add the following to your |vimrc| script:
>
let g:easytags_syntax_keyword = 'always'
<
The default value of this option is 'auto' which means to use keyword
highlighting where this is possible without sacrificing accuracy. By changing
it to 'always' you're telling vim-easytags to sacrifice accuracy in order to
gain performance. Try it out and see what works best for you.
Please note that right now this 'feature' is not integrated with the
"accelerated Python syntax highlighting" feature, because I'm considering
ripping that out and replacing it with a _fast_ Vim script implementation.
-------------------------------------------------------------------------------
The *g:easytags_languages* option
Exuberant Ctags supports many languages and can be extended via regular
expression patterns, but for some languages separate tools with ctags-
compatible output exist (e.g. jsctags [15] for Javascript). To use these, the
executable and its arguments must be configured:
>
let g:easytags_languages = {
\ 'language': {
\ 'cmd': g:easytags_cmd,
\ 'args': [],
\ 'fileoutput_opt': '-f',
\ 'stdout_opt': '-f-',
\ 'recurse_flag': '-R'
\ }
\}
<
Each key is a special language definition. The key is a Vim file type in
lowercase. The above snippet shows the defaults; you only need to specify
options that differ.
-------------------------------------------------------------------------------
The *g:easytags_file* option
As mentioned above the plug-in will store your tags in '~/.vimtags' on UNIX and
'~/_vimtags' on Windows. To change the location of this file, set the global
variable |g:easytags_file|, e.g.:
>
:let g:easytags_file = '~/.vim/tags'
<
A leading '~' in the |g:easytags_file| variable is expanded to your current
home directory ('$HOME' on UNIX, '%USERPROFILE%' on Windows).
-------------------------------------------------------------------------------
The *g:easytags_dynamic_files* option
By default |:UpdateTags| only writes to the global tags file, but it can be
configured to look for project specific tags files by adding the following
lines to your |vimrc| script:
>
:set tags=./tags;
:let g:easytags_dynamic_files = 1
<
You can change the name of the tags file, the important thing is that it's
relative to your working directory or the buffer (using a leading './'). When
|g:easytags_dynamic_files| is set to 1 the easytags plug-in will write to the
first existing tags file seen by Vim (based on the |'tags'| option). In other
words: If a project specific tags file is found it will be used, otherwise the
plug-in falls back to the global tags file (or a file type specific tags file).
If you set |g:easytags_dynamic_files| to 2 the easytags plug-in will
automatically create project specific tags based on the first name in the
'tags' option. In this mode the the global tags file or file type specific tags
files are only used for directories where you don't have write permissions.
The |'tags'| option is reevaluated each time the plug-in runs, so which tags
file is selected can differ depending on the buffer and working directory.
-------------------------------------------------------------------------------
The *g:easytags_by_filetype* option
By default all tags are stored in a global tags file. When the tags file grows
beyond a certain size Vim will be slowed down by the easytags plug-in because
it has to read and process a large number of tags very frequently.
To avoid this problem you can set |g:easytags_by_filetype| to the path of an
existing directory. The easytags plug-in will create separate tags files for
each file type in the configured directory. These tags files are automatically
registered by the easytags plug-in when the file type of a buffer is set.
Note that the |g:easytags_dynamic_files| option takes precedence over this
option.
If you already have a global tags file you can create file type specific tags
files from the global tags file using the command ':TagsByFileType'.
-------------------------------------------------------------------------------
The *g:easytags_events* option
This option can be used to customize the events that trigger the automatic
updating and highlighting performed by the easytags plug-in. The
|g:easytags_always_enabled| and |g:easytags_on_cursorhold| options are more
user friendly but limited ways to accomplish the same thing.
Here's an example: Say you want the easytags plug-in to automatically update &
highlight tags for the current file right after you save the file. You can
accomplish this by adding the following line to your |vimrc| script:
>
:let g:easytags_events = ['BufWritePost']
<
Note that if you set |g:easytags_events| in your |vimrc| script, the values of
the options |g:easytags_always_enabled| and |g:easytags_on_cursorhold| will be
ignored completely.
-------------------------------------------------------------------------------
The *g:easytags_always_enabled* option
By default the plug-in automatically generates and highlights tags when you
stop typing for a few seconds (this works using the |CursorHold| automatic
command). This means that when you edit a file, the dynamic highlighting won't
appear until you pause for a moment. If you don't like this you can configure
the plug-in to always enable dynamic highlighting:
>
:let g:easytags_always_enabled = 1
<
Be warned that after setting this option you'll probably notice why it's
disabled by default: Every time you edit a file in Vim, the plug-in will first
run Exuberant Ctags and then highlight the tags, and this slows Vim down quite
a lot. I have some ideas on how to improve this latency by running Exuberant
Ctags in the background so stay tuned!
Note: If you change this option it won't apply until you restart Vim, so you'll
have to set this option in your |vimrc| script.
-------------------------------------------------------------------------------
The *g:easytags_on_cursorhold* option
As I explained above the plug-in by default doesn't update or highlight your
tags until you stop typing for a moment. The plug-in tries hard to do the least
amount of work possible in this break but it might still interrupt your
workflow. If it does you can disable the periodic update:
>
:let g:easytags_on_cursorhold = 0
<
Note: Like the |g:easytags_always_enabled| option, if you change this option it
won't apply until you restart Vim, so you'll have to set this option in your
|vimrc| script.
-------------------------------------------------------------------------------
The *g:easytags_updatetime_min* option
Vim's |'updatetime'| option controls how often the easytags plug-in is
automatically executed. A lot of popular Vim plug-ins manipulate this option to
control how often they are called. Unfortunately some of those plug-ins set
|'updatetime'| to a very low value (less than a second) and this can break the
easytags plug-in. Because of this the easytags plug-in compensates by keeping
track of when it was last executed.
The default value of Vim's 'updatetime (see |'updatetime'|) option _and_ the
|g:easytags_updatetime_min| option is 4000 milliseconds (4 seconds).
If you know what you're doing and you really want the easytags plug-in to be
executed more than once every 4 seconds you can lower the minimum acceptable
updatetime by setting |g:easytags_updatetime_min| to the number of milliseconds
(an integer).
Note that although |g:easytags_updatetime_min| counts in milliseconds, the
easytags plug-in does not support subsecond granularity because it is limited
by Vim's |localtime()| function which has one-second resolution.
-------------------------------------------------------------------------------
The *g:easytags_auto_update* option
By default the plug-in automatically updates and highlights your tags when you
stop typing for a moment. If you want to disable automatic updating while
keeping automatic highlighting enabled you can set this option to false:
>
:let g:easytags_auto_update = 0
<
-------------------------------------------------------------------------------
The *g:easytags_auto_highlight* option
By default the plug-in automatically updates and highlights your tags when you
stop typing for a moment. If you want to disable automatic highlighting while
keeping automatic updating enabled you can set this option to false:
>
:let g:easytags_auto_highlight = 0
<
-------------------------------------------------------------------------------
The *g:easytags_autorecurse* option
When the |:UpdateTags| command is executed automatically or without arguments,
it defaults to updating just the tags for the current file. If you'd rather
have it recursively scan everything below the directory of the current file
then set this option to true (1):
>
:let g:easytags_autorecurse = 1
<
You have to explicitly enable this option because it should only be used while
navigating around small directory trees. Imagine always having this option
enabled and then having to edit a file in e.g. the root of your home directory:
The 'easytags.vim' plug-in would freeze Vim for a long time while you'd have to
wait for Exuberant Ctags to scan thousands of files...
Note that when you enable this option the 'easytags.vim' plug-in might ignore
other options like |g:easytags_resolve_links|. This is an implementation detail
which I intend to fix.
-------------------------------------------------------------------------------
The *g:easytags_include_members* option
Exuberant Ctags knows how to generate tags for struct/class members in C++ and
Java source code but doesn't do so by default because it can more than double
the size of your tags files, thus taking much longer to read/write the tags
file. When you enable the |g:easytags_include_members| option from your |vimrc|
script (before the 'easytags.vim' plug-in is loaded):
>
:let g:easytags_include_members = 1
<
Exuberant Ctags will be instructed to include struct/class members using the '
--extra=+q' command line argument and the 'easytags.vim' plug-in will highlight
them using the 'cMember' highlighting group. Because most color schemes don't
distinguish the Identifier and Type (see |group-name|) highlighting groups all
members will now probably look like type definitions. You can change that by
executing either of the following Vim commands (from your vimrc script, a file
type plug-in, etc.):
>
" If you like one of the existing styles you can link them:
highlight link cMember Special
" You can also define your own style if you want:
highlight cMember gui=italic
<
-------------------------------------------------------------------------------
The *g:easytags_resolve_links* option
UNIX has symbolic links [16] and hard links [17], both of which conflict with
the concept of having one unique location for every identifier. With regards to
hard links there's not much anyone can do, but because I use symbolic links
quite a lot I've added this option. It's disabled by default since it has a
small performance impact and might not do what unknowing users expect it to:
When you enable this option the plug-in will resolve symbolic links in
pathnames, which means your tags file will only contain entries with canonical
pathnames [18]. To enable this option (which I strongly suggest doing when you
run UNIX and use symbolic links) execute the following Vim command:
>
:let g:easytags_resolve_links = 1
<
-------------------------------------------------------------------------------
The *g:easytags_suppress_ctags_warning* option
If this is set and not false, it will suppress the warning on startup if ctags
is not found or not recent enough.
>
:let g:easytags_suppress_ctags_warning = 1
<
-------------------------------------------------------------------------------
The *g:easytags_suppress_report* option
If this is set and not false, it will suppress the report displayed on tag
updates.
>
:let g:easytags_suppress_report = 1
<
===============================================================================
*customizing-easytags-plug-in*
Customizing the easytags plug-in ~
Advanced users may wish to customize how the easytags plug-in works beyond the
point of changing configuration defaults. This section contains some hints
about this. If you have suggestions, please feel free to submit them.
-------------------------------------------------------------------------------
*easytags-passing-custom-command-line-arguments-to-exuberant-ctags*
Passing custom command line arguments to Exuberant Ctags ~
You may want to run Exuberant Ctags with specific command line options, for
example the code_complete [19] plug-in requires the signature field to be
present. To do this you can create a configuration file for Exuberant Ctags,
e.g. '~/.ctags' on UNIX or '%USERPROFILE%\ctags.cnf' on Windows. The file
should contain one command line option per line. See the Exuberant Ctags manual
[20] for details.
-------------------------------------------------------------------------------
*easytags-update-highlight-tags-immediately-after-save*
Update & highlight tags immediately after save ~
By default the easytags plug-in automatically updates & highlights tags for the
current file after several seconds of inactivity. This is done to prevent the
easytags plug-in from interrupting your workflow.
If you want the easytags plug-in to automatically update & highlight tags for
the current file right after you save the file, you can add the following line
to your |vimrc| script:
>
:let g:easytags_events = ['BufWritePost']
<
-------------------------------------------------------------------------------
*easytags-how-to-customize-highlighting-colors*
How to customize the highlighting colors? ~
The easytags plug-in defines new highlighting groups for dynamically
highlighted tags. These groups are linked to Vim's default groups so that
they're colored out of the box, but if you want you can change the styles. To
do so use a 'highlight' command such as the ones given a few paragraphs back.
Of course you'll need to change the group name. Here are the group names used
by the easytags plug-in:
- **AWK**: 'awkFunctionTag'
- **C#:**'csClassOrStructTag', 'csMethodTag'
- **C, C++, Objective C:**'cTypeTag', 'cEnumTag', 'cPreProcTag',
'cFunctionTag', 'cMemberTag'
- **Java:**'javaClassTag', 'javaInterfaceTag', 'javaMethodTag'
- **Lua:**'luaFuncTag'
- **Perl:**'perlFunctionTag'
- **PHP:**'phpFunctionsTag', 'phpClassesTag'
- **Python:**'pythonFunctionTag', 'pythonMethodTag', 'pythonClassTag'
- **Ruby:**'rubyModuleNameTag', 'rubyClassNameTag', 'rubyMethodNameTag'
- **Shell**: 'shFunctionTag'
- **Tcl**: 'tclCommandTag'
- **Vim:**'vimAutoGroupTag', 'vimCommandTag', 'vimFuncNameTag',
'vimScriptFuncNameTag'
As you can see each of these names ends in 'Tag' to avoid conflicts with the
syntax modes shipped with Vim. And about the singular/plural confusion: I've
tried to match the existing highlighting groups defined by popular syntax modes
(except of course for the 'Tag' suffix).
===============================================================================
*easytags-faster-syntax-highlighting-using-python*
Faster syntax highlighting using Python ~
The Vim script implementation of dynamic syntax highlighting is quite slow on
large tags files. When the Python Interface to Vim is enabled the easytags
plug-in will therefor automatically use a Python script that performs dynamic
syntax highlighting about twice as fast as the Vim script implementation. The
following options are available to change the default configuration.
-------------------------------------------------------------------------------
The *g:easytags_python_enabled* option
To disable the Python implementation of dynamic syntax highlighting you can set
this option to false (0).
-------------------------------------------------------------------------------
The *g:easytags_python_script* option
This option defines the pathname of the script that contains the Python
implementation of dynamic syntax highlighting.
===============================================================================
*easytags-troubleshooting*
Troubleshooting ~
===============================================================================
*vim-easytags-is-slow*
vim-easytags is slow! ~
Yes, I know. I'm trying to make it faster but that's far from trivial. In the
process of trying to speed up vim-easytags I've added reporting of elapsed time
in several ways. If Vim seems very slow and you suspect this plug-in might be
the one to blame, increase Vim's verbosity level:
>
:set vbs=1
<
Every time the plug-in executes it will time how long the execution takes and
add the results to Vim's message history, which you can view by executing the
|:messages| command. If you want a more fine grained impression of the time
spent by vim-easytags on various operations you can call the
'xolox#easytags#why_so_slow()' function:
>
:call xolox#easytags#why_so_slow()
easytags.vim 3.6.4: Timings since you started Vim:
- 0.094937 seconds updating tags
- 1.850201 seconds highlighting tags
- 0.035167 seconds highlighting tags using ':syntax match')
- 0.493910 seconds highlighting tags using ':syntax keyword')
- 0.413160 seconds filtering tags for highlighting (stage 1)
- 0.141747 seconds filtering tags for highlighting (stage 2)
<
-------------------------------------------------------------------------------
*easytags-highlighttags-only-works-for-tags-file-created-by-updatetags*
:HighlightTags only works for the tags file created by :UpdateTags ~
If you want to create tags files and have their tags highlighted by the
'easytags.vim' plug-in then you'll have to create the tags file with certain
arguments to Exuberant Ctags:
>
$ ctags --fields=+l --c-kinds=+p --c++-kinds=+p ...
<
The '--fields=+l' argument makes sure that Exuberant Ctags includes a
'language:...' property with each entry in the tags file. This is required by
the |:HighlightTags| command so it can filter tags by their file type. The
other two arguments make sure Exuberant Ctags generates tags for function
prototypes in C/C++ source code.
If you have the |g:easytags_include_members| option enabled (its off by
default) then you'll also need to add the '--extra=+q' argument so that
Exuberant Ctags generates tags for structure/class members.
-------------------------------------------------------------------------------
*easytags-plug-in-complains-that-exuberant-ctags-isnt-installed*
The plug-in complains that Exuberant Ctags isn't installed ~
After a Mac OS X user found out the hard way that the 'ctags' executable isn't
always Exuberant Ctags and we spend a few hours debugging the problem I added
proper version detection: The plug-in executes 'ctags --version' when Vim is
started to verify that Exuberant Ctags 5.5 or newer is installed. If it isn't
Vim will show the following message on startup:
>
easytags.vim: Plug-in not loaded because Exuberant Ctags isn't installed!
Please download & install Exuberant Ctags from http://ctags.sf.net
<
If the installed Exuberant Ctags version is too old the plug-in will complain:
>
easytags.vim: Plug-in not loaded because Exuberant Ctags 5.5
or newer is required while you have version %s installed!
<
If you have the right version of Exuberant Ctags installed but the plug-in
still complains, try executing the following command from inside Vim:
>
:!which ctags
<
If this doesn't print the location where you installed Exuberant Ctags it means
your system already had a 'ctags' executable but it isn't compatible with
Exuberant Ctags 5.5 and you'll need to set the |g:easytags_cmd| option (see
above) so the plug-in knows which 'ctags' to run.
-------------------------------------------------------------------------------
*easytags-vim-locks-up-while-plug-in-is-running*
Vim locks up while the plug-in is running ~
Once or twice now in several years I've experienced Exuberant Ctags getting
into an infinite loop when given garbage input. In my case this happened by
accident a few days ago :-|. Because my plug-in executes 'ctags' in the
foreground this will block Vim indefinitely! If this happens you might be able
to kill 'ctags' by pressing Control-C (see |CTRL-C|) but if that doesn't work
you can also kill it without stopping Vim using a task manager or the 'pkill'
command (available on most UNIX systems):
>
$ pkill -KILL ctags
<
-------------------------------------------------------------------------------
*easytags-failed-to-highlight-tags-because-pattern-is-too-big*
Failed to highlight tags because pattern is too big! ~
If the 'easytags.vim' plug-in fails to highlight your tags and the error
message mentions that the pattern is too big, your tags file has grown too
large for Vim to be able to highlight all tagged identifiers! I've had this
happen to me with 50 KB patterns because I added most of the headers in
'/usr/include/' to my tags file. Internally Vim raises the error |E339|:
Pattern too long and unfortunately the only way to avoid this problem once it
occurs is to reduce the number of tagged identifiers...
In my case the solution was to move most of the tags from '/usr/include/' over
to project specific tags files which are automatically loaded by Vim when I
edit files in different projects because I've set the |'tags'| option as
follows:
>
:set tags=./.tags;,~/.vimtags
<
Once you've executed the above command, Vim will automatically look for a file
named '.tags' in the directory of the current file. Because of the ';' Vim also
recurses upwards so that you can nest files arbitrarily deep under your project
directories.
-------------------------------------------------------------------------------
*easytags-plug-in-doesnt-seem-to-work-in-cygwin*
The plug-in doesn't seem to work in Cygwin ~
If you want to use the plug-in with Vim under Cygwin [21], you need to have the
Cygwin version of Ctags installed instead of the Windows version (thanks to
Alex Zuroff for reporting this!).
===============================================================================
*easytags-contact*
Contact ~
If you have questions, bug reports, suggestions, etc. the author can be
contacted at peter@peterodding.com. The latest version is available at
http://peterodding.com/code/vim/easytags/ and http://github.com/xolox/vim-
easytags. If you like this plug-in please vote for it on Vim Online [22].
===============================================================================
*easytags-license*
License ~
This software is licensed under the MIT license [23]. © 2015 Peter Odding
<peter@peterodding.com> and Ingo Karkat.
Thanks go out to everyone who has helped to improve the vim-easytags plug-in
(whether through pull requests, bug reports or personal e-mails).
===============================================================================
*easytags-references*
References ~
[1] http://ctags.sourceforge.net/
[2] http://en.wikipedia.org/wiki/Integrated_development_environment
[3] http://en.wikipedia.org/wiki/Ctags
[4] http://ftp.vim.org/vim/runtime/syntax/
[5] http://ctags.sourceforge.net/languages.html
[6] http://peterodding.com/code/vim/downloads/easytags.zip
[7] http://peterodding.com/code/vim/downloads/misc.zip
[8] http://www.vim.org/scripts/script.php?script_id=2332
[9] https://github.com/gmarik/vundle
[10] http://github.com/xolox/vim-easytags
[11] http://github.com/xolox/vim-misc
[12] http://peterodding.com/code/vim/shell/
[13] http://en.wikipedia.org/wiki/Dynamic-link_library
[14] https://github.com/xolox/vim-easytags/issues/98
[15] https://npmjs.org/package/jsctags
[16] http://en.wikipedia.org/wiki/Symbolic_link
[17] http://en.wikipedia.org/wiki/Hard_link
[18] http://en.wikipedia.org/wiki/Canonicalization
[19] http://www.vim.org/scripts/script.php?script_id=1764
[20] http://ctags.sourceforge.net/ctags.html#FILES
[21] http://en.wikipedia.org/wiki/Cygwin
[22] http://www.vim.org/scripts/script.php?script_id=3114
[23] http://en.wikipedia.org/wiki/MIT_License
vim: ft=help

File diff suppressed because it is too large Load Diff