Commit Graph

202 Commits

Author SHA1 Message Date
Christian Brabandt
5f9ae83f44
config: allow to disable setting the statusline option
closes #2013
2019-12-13 09:59:45 +01:00
Christian Brabandt
28453d7038
Support Multiple Cursor mode
Detect the use of plugin https://github.com/mg979/vim-visual-multi
and show mode "MULTI" when it is active.

closes #1933
2019-06-11 09:48:08 +02:00
Christian Brabandt
c8a36e14e9
Updated Copyright Statements 2019-03-25 12:29:47 +01:00
Christian Brabandt
25e384f236
wordcount: move User autocommand to plugin
Do not scatter the autocommands around, but rather move the auto command
to the main plugin file. The function that handles the auto command will
be created in the autoload script.

Also add a call to force updating the tabline, if g:airline_statusline_ontop
is defined.

In addition, the wordcount() extension did not correctly notice
block-wise visual mode, so while creating the airline#mode_changed()
function, make the mode also detect blockwise visual mode correctly.
2019-02-04 08:25:45 +01:00
Christian Brabandt
8867301f78
plugin: Move tabline_update function to autoload 2019-02-04 08:23:58 +01:00
Christian Brabandt
840bf02baf
autoload: Fix typo in comment 2019-02-04 08:21:39 +01:00
Christian Brabandt
fd5bde1a3a
allow to show the statusline on top
This is an experimental feature that allows to display the statusline in
the tabline. It might still be a bit rough, but seems to work so far.

Remaining problem:
- Mode changes are not immediately detected, only after moving the
  cursor

fixes #1388
closes #1867
2019-02-03 17:30:55 +01:00
Christian Brabandt
ffac12cbbe
theme: do not show not-found warning
Only show the "airline theme not found" warning message, when the user
actually used `:AirlineTheme foobar`, not when called by an autocommand
that tries to switch themes when the Vim colorscheme changed.

fixes #1824
2018-11-14 07:36:45 +01:00
Christian Brabandt
b2e1dbad6f
use tr() instead of substitute
should be a bit faster
2018-11-13 22:54:49 +01:00
Christian Brabandt
b3a574b4a3
Fix error in airline#add_statusline_funcref 2018-11-13 22:53:13 +01:00
Christian Brabandt
7f6dfbefd1
theme: only define g:autoload_theme if loading was successfully
fixes the test
2018-11-13 22:39:36 +01:00
Christian Brabandt
5b1c92979c
Fix error in airline#add_statusline_funcref 2018-11-13 22:36:43 +01:00
Christian Brabandt
9dc546c699
use tr() instead of substitute
should be a bit faster
2018-11-13 22:29:32 +01:00
Christian Brabandt
14691bb00e
themes: load them explicitly rather than implictly
While this adds a bit more code it makes it possible to distinguish
between themes not found and errors in themes.

Use :verbose AirlineTheme <foobar>
to also see the error message in case of errors.
2018-11-13 22:27:02 +01:00
Christian Brabandt
c850f485ad
autoload: use airline#util#warning instead of echo 2018-11-13 21:37:48 +01:00
Christian Brabandt
464633baad
themes: Do not try to load the palette twice
This will be done explicitly by the switch_theme() function
2018-11-13 21:17:48 +01:00
Christian Brabandt
8c36d2b595
allow to use alternative seperators for inactive windows
closes #1236
2018-11-08 17:09:17 +01:00
Christian Brabandt
f08078d683
autoload: add comments 2018-11-08 16:20:37 +01:00
Christian Brabandt
d81cdacb1e
better disabled highlighting for inactive windows on FocusLost
This will make sure that the current window will be highlighted as
expected, even if there are no other windows and all highlighting groups
will be correctly re-created as 'inactive'

references #1807
2018-10-16 10:49:17 +02:00
Christian Brabandt
c44bbc66f5
main: make sure winnr is available in s:context for check_mode function 2018-10-16 10:26:26 +02:00
Christian Brabandt
f045452743
main: disable airline on FocusLost
When switching away from Vim and your terminal supports the FocusLost
autocommand, set the statusline to inactive, so it won't distract you
too much when working with another application.

In the gui, the FocusLost autocommand should always trigger.

This is now the default, if people start complaining, that behaviour
should probably be made configurable.

closes #1807
2018-10-03 12:31:45 +02:00
Christian Brabandt
a0298263b7
autocomd: do not re-evaluate modelines
fixes #1804
2018-09-25 16:03:30 +02:00
Christian Brabandt
fce8585239
main: detect some more modes 2018-09-20 10:13:59 +02:00
Christian Brabandt
1b8ecb6336
Merge pull request #1796 from flemingfleming/wordcount-improvements
[WIP] Rewrite wordcount plugin
2018-09-20 10:04:53 +02:00
Christian Brabandt
251ed064e8
Make mode return only single letter except for virt replace mode
commit bcd37fc115 changed the detection of modes slightly in that it
allowed not only single letters but also several letters.

While in theory, it might be okay to have extra modes displayed like
Insert Completion or Normal Insert, or Operator Pending, let's for now
just revert it to the default. We can always enhance it later if
requested.
2018-09-18 20:00:46 +02:00
Christian Brabandt
a1c112cafd
main: replace and virt replace mode should use same coloring
fixes #1794
2018-09-16 20:01:00 +02:00
Christian Brabandt
bcd37fc115
mode: add support for virt replace mode
fixes #1792
2018-09-16 18:25:27 +02:00
Christian Brabandt
c7fb175d35
Add a specific color for commandline mode
closes #1768

Colors for the other themes need to be defined however
2018-07-26 10:22:40 +02:00
Liam Fleming
781c40bb3d Create AirlineModeChanged autocmd 2018-06-28 18:44:26 +01:00
Christian Brabandt
5db4c408bd
Update copyright notifications 2018-01-05 10:37:59 +01:00
Christian Brabandt
c76019ac9e
Safety: Make sure g:airline_theme is defined before using it
fixes #1624
2018-01-04 23:54:12 +01:00
Christian Brabandt
52ce640534
startup: remove workaround for skipping redraw
commit 7d082c03b2 added a workaround to skip
a few redraws on startup so that the intro message is not shown anymore.

However might cause problems, that some highlighting groups are not
correctly set. Also recent Vims (8.0.1290 and so on) do not seem to
suffer from the problem that an too early initializiation of airline
causes a redraw which skips the intro message.

Therefore, revert that commit.

Fixes #1585
2017-11-14 23:38:32 +01:00
Christian Brabandt
e5f9ccad8e
terminal: use mode() to detect terminal mode
workaround with index(term_list(), bufnr('')) > -1 not needed anymore,
since vim 8.0.936 will correctly return 't' for the mode() function in
the terminal.
2017-08-20 22:47:00 +02:00
Ryan Lue
039fd6b50f Fix airline#switch_matching_theme() to accommodate camelcased colorscheme names 2017-08-07 12:42:22 +08:00
Christian Brabandt
0c307d5f73
Better way to check for terminal buffer 2017-07-30 18:57:05 +02:00
Christian Brabandt
d54613d2dd
Check for existence of term_list()
fixes #1518
2017-07-30 18:55:52 +02:00
Christian Brabandt
846d85aaa1
main: support for Vims terminal mode
Currently this is a hack, to get terminal mode from Vim.

However there is no better solution yet, since the API is not stable
here. Until then, just use the hack with
index(term_list(), bufnr('')) > -1
2017-07-30 09:51:23 +02:00
Christian Brabandt
825aec9e4d
Revert "highlight: skip processing the same hi group twice"
This reverts commit feee9bcf3c.

It brakes CI and shouldn't be needed
2017-06-27 14:44:49 +02:00
Christian Brabandt
feee9bcf3c
highlight: skip processing the same hi group twice
Shouldn't happen, but just in case skip creating highlighting group,
if the same group with the same attributes has already been defined.
2017-06-26 23:17:43 +02:00
Christian Brabandt
7d082c03b2
Do not clear intro screen
if airline is initialized too early and some :hi commands are run,
this will force a redraw in Vim which will result in the intro screen
being cleared.

Currently, this does not work for gvim, not sure why.

closes #1476 (well only partly, until i have discovered, why for gvim it
doesn't work).
2017-06-21 13:21:13 +02:00
Christian Brabandt
7cd7972bbe cleanup unlet calls
Instead of looping through the list and unletting each value separately,
join the list and their names together and unlet them all together.
2016-12-13 20:28:30 +01:00
thawk
45d77ca909 Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
Christian Brabandt
73aea86a7a Do not unconditionally modify airline_c_inactive
consider a window with these splits:
,----
| file1
| ---
| file2
| ---
| file1
`----

If the top buffer is the active one and you start modifying this buffer,
this will also reset the highlighting for the inactive buffer2, since
the highlighting group 'airline_c_inactive' is used for both windows
(one having the unmodified buffer 'file2' and one having the modified
'file1').

This lead to the incorrect highlighting of the buffer name of file2.

Airline basically already created different airline_c<bufnr>_inactive
highlighting groups, but unfortunately did not use them.

Therefore, make the builder aware of this and always append the buffer
number to the group 'airline_c' if it is in an inactive window.

2) we need to make sure, the highlighting won't get overwritten, so
make the highlighter aware of this situation as well, by appending the
buffer number to the group name, if it creates the 'inactive' mode
groups and a buffer number has been given.

this fixes #1233
2016-09-08 18:46:11 +02:00
Christian Brabandt
7612aaf701 Add User autocommand for Theme changing
fixes #1226
2016-08-24 21:27:49 +02:00
David Terei
ae4a978509 Add spell detection 2016-03-21 23:52:04 -07:00
Kevin Ballard
4540ea428a Fix colorscheme to theme matching
Fixes #1067 for real.
2016-02-27 11:22:30 -08:00
Christian Brabandt
a7eb735f2e Fix typo
fixes #1067
2016-02-26 09:20:01 +01:00
Christian Brabandt
78e1a2c8db Fix matching of themes to color names
theme usually use '_' instead of '-', so replace that first before
trying to match.

Second, make the patterns easier to match.

Third, make sure, match for Tomorrow happens with matching case

fixes #1056
2016-02-25 08:07:51 +01:00
Christian Brabandt
7efa5067ef fix performance regression 2016-02-07 22:17:17 +01:00
Christian Brabandt
ac86003ac3 Problem with highlighting groups per tabpages
The current mode is only cached per window. This will break, if one
switches tabpage. We remember the last mode that was used to create the
highlighting group and compare, if this has changed.

This fixes #670
2016-02-07 09:07:00 +01:00