Commit Graph

1728 Commits

Author SHA1 Message Date
Max Nordlund gmail
61ca196d73
Move formatting of branch name into get_head
This allows for advanced customization where the shortening of the
branch name is up to the caller, unlike before.

This change is observable from the outside, and as such can be
dangerous. But AFAIK it does not change the default behavior.
2019-02-21 11:59:04 +01:00
Max Nordlund gmail
5f769dbed9
Expose get_hunks for advanced customization 2019-02-21 11:59:04 +01:00
Max Nordlund gmail
45ff435378
Honor minwidth for hunks and branch parts
This removes the hardcoded minwidth limits for both the `hunks` and
`branch` parts. It replaces these with safe accesses to the `minwidth`
setting as done by `airline#parts#define_minwidth`.
2019-02-20 12:36:40 +01:00
petobens
cc7b3c1636 Fix denite extension 2019-02-11 09:22:43 -03:00
Christian Brabandt
1471330825
Adjust buffer numbers for buf_idx_mode v2 slightly
fixes #1823
2019-02-08 07:55:35 +01:00
Christian Brabandt
05572482b8
tabline: add forgotten changes from commit cd1d8c2a96
I accidentally missed including some more changes for buffer_idx_mode=2.
So add those files now.
2019-02-07 08:17:33 +01:00
Christian Brabandt
cd1d8c2a96
Introduce buffer_idx_mode v2
fixes #1823
2019-02-07 08:11:47 +01:00
Christian Brabandt
624d2f1438
tabline: AirlineSelectTab still wrong sometimes
Partly revert commit 105e9daaf7
and fix #1857 another way, by making sure, that buffers are not taking
away from the s:current_visible_buffers list.

Fixes #1857
Fixes #1872
2019-02-06 22:42:10 +01:00
Christian Brabandt
767c1efd10
bufferline: catch invalid modelines 2019-02-05 08:35:57 +01:00
Christian Brabandt
999c40fcf3
tabline: simplify creation of maps
instead of typing all the mapping commands, create a loop that will
create the new maps.
2019-02-04 21:59:40 +01:00
Christian Brabandt
105e9daaf7
tabline: Make the PlugAirlineSelectTab buffers work as expected
for bufferlist.

fixes #1857
2019-02-04 21:47:11 +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
58bbc512f9
tabline: Only define Terminal autocommand if vim supports it
fixes the broken CI test which runs in a vim that does not come with
terminal support
2019-02-03 10:43:23 +01:00
Christian Brabandt
1d03b9dc62
tabline: invalidate buffer list on Terminal Enter
should workaround and fix #1853 in a better way
2019-02-03 10:36:07 +01:00
Christian Brabandt
916d023c35
buflist: do not consider empty buffers to be excluded
currently, empty buffer names were still considered to match against the
exclude_path setting. That does not make sense, so skip the check for
empty bufnames.
2019-02-02 22:43:27 +01:00
Christian Brabandt
5415c5e6ec
tabline: Fix broken call to formatter 2019-02-02 21:57:15 +01:00
Christian Brabandt
54584a2bb2
fugitive: mark fugitive like buffers with "[git]"
closes #1852
2019-02-02 18:04:53 +01:00
Christian Brabandt
dc7d991007
Tabline: Make specifying formatter more easy
closes #1863
2019-02-02 17:45:55 +01:00
Christian Brabandt
d372b5bc46
tabnr formmatter: fix style 2019-02-02 17:45:33 +01:00
Christian Brabandt
98bc6abde3
languageclient: check for existence of 'result' key
fixes #1861
2019-01-28 11:21:32 +01:00
w0rp
54dba2a92b
Remove incorrect copyright attribution
I have never touched anything in this file, nor in the LanguageClient plugin, so the copyright attribution is incorrect. @neersighted may also wish to be removed from the list here.
2019-01-28 10:11:43 +00:00
Christian Brabandt
a829ec4861
Merge pull request #1864 from petpetpetpet/more_efficient_ale_line_numbers
More efficient ale line number function.
2019-01-28 10:57:13 +01:00
petpetpet
57c061dcb0 Added a hook to the new ALE api to grab line numbers. Should be more
efficient.
2019-01-27 13:57:18 +00:00
Ming, Bai
6601474bf5 Fixed t:undotree undefined error
the ```t:undotree.GetStatusLine()``` is appended to the status line when ```t:undotree``` exists, but it seems like the ```statusline``` will be executed when ```t:undtree``` is no longer available during window destruction.
2019-01-22 14:52:39 -08:00
Konstantinos Natsakis
53aa65a5ce Fix ctrlp memory leak 2019-01-17 15:34:19 +02:00
petobens
fa5910eb14
extensions: Add defx support
closes #1850
2019-01-11 10:49:31 +01:00
Christian Brabandt
d68c9bbeb2
tabline: make middle-click work as expected in neovim
closes: #1854
2019-01-11 10:44:10 +01:00
Arjan van der Velde
2d3bbbff43
make VimLeave autocmd nested
add "nested" to autocmd to make it play well w/ YouCompleteMe

see 109a019279/README.md (ycm-does-not-shut-down-when-i-quit-vim)
2019-01-10 23:15:30 -05:00
Christian Brabandt
6fd5b6ae56
tabline: Fix redrawtabline typo 2019-01-09 08:26:07 +01:00
Christian Brabandt
4604f6d465
tabline: Use :redrawtabline if available
this needs patch 8.1.706 and is a less hacky approach to force updating
the tabline
2019-01-09 07:42:32 +01:00
Christian Brabandt
c0f96df97f
Update metadata (copyright)
also remove trailing empty lines in test files
2018-12-15 19:56:30 +01:00
Christian Brabandt
e3cfd3643b
wordcount: prevent use of unused variable 2018-12-10 09:11:10 +01:00
Christian Brabandt
3d9071e6b6
themes: Load dark theme, when default colorscheme is loaded 2018-12-03 18:29:26 +01:00
Christian Brabandt
c047abfe96
Add inactive statusline for terminal 2018-11-20 16:32:55 +01:00
Christian Brabandt
bc63a60b0f
terminal: return proper terminal name 2018-11-20 16:11:34 +01:00
Christian Brabandt
31f5a9307d
Make terminal statusline work for inactive window 2018-11-20 15:48:28 +01:00
Christian Brabandt
df0c1731db
Add :AirlineExtensions command
This shows whether or not an extensions has been loaded.
2018-11-14 08:06:39 +01:00
Christian Brabandt
f6a95d3a6f
Fix wrong extension name for unicode 2018-11-14 07:41:48 +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
b20e181bc8
Add a separate function for returning all available themes 2018-11-13 22:14:51 +01:00
Christian Brabandt
c3ee263d5b
whitespace: use airline#util#warning instead of echo consistently 2018-11-13 21:37:52 +01:00
Christian Brabandt
2eaf57ece8
xtabline: use airline#util#warning instead of echo conistently 2018-11-13 21:37:52 +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
d441b3f7b6
util: use correct endfunction style 2018-11-13 21:11:04 +01:00
Christian Brabandt
f05f649be8
highlighter: even further refinement of when to skip groups 2018-11-13 13:57:15 +01:00
Christian Brabandt
cfd373a5a2
highlighter: Better check, when to skip groups
Groupnames like 'airline_c1_to_airline_x_inactive' still have to be
processed, so do not skip them.

Also for the tabline, '_inactive' groups are not used, so skip them
2018-11-13 13:48:26 +01:00
Christian Brabandt
78e67897a4
highlight: fix previous commit differently
Actually we can restrict the loop condition to only run 5 times instead
of 6 (which was an oversight).
2018-11-13 09:06:39 +01:00
Christian Brabandt
e66d65ebf4
highlighter: break out of loop at the end
thanks for mentioning @jottkaerr at
4d8a06a5a9 (commitcomment-31275754)
2018-11-13 08:50:10 +01:00
Christian Brabandt
4d8a06a5a9
highlighter: get rid of s:Get() function
Replace by a function that retuns the to be executed highlighting string

Should in theory be a bit faster, since the same function does not have
to be called 5 times per highlighting group.

It probably is not much better, but here are some random numbers:

Profiling:

Previously:
count  total (s)   self (s)
  199   0.022973   0.009909     let cmd = printf('hi %s %s %s %s %s %s %s %s', a:group, s:Get(colors, 0, 'guifg=')…

New:
count  total (s)   self (s)
   79   0.010166   0.000862     let cmd = printf('hi %s%s', a:group, s:GetHiCmd(colors))
2018-11-12 17:59:02 +01:00
Christian Brabandt
6c6c6c104f
highlighter: exec_separator will re-create '_to_' groups
so we don't need to re-create them in the main for loop of
airline#highlighter#highlight() and so skip those groups.
2018-11-12 05:18:53 +01:00
Christian Brabandt
f3d6a3542a
Revert "highlighter: also check separator groups for being defined"
This reverts commit 99971aa24d.
2018-11-11 21:18:13 +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
a993ae5d42
builder: don't call add_separtor twice 2018-11-08 16:44:26 +01:00
Christian Brabandt
f08078d683
autoload: add comments 2018-11-08 16:20:37 +01:00
Christian Brabandt
99971aa24d
highlighter: also check separator groups for being defined
Make sure, to also check, if the separator groups have already been
defined. Once they are defined initially, they are usually available in
the palette group. So do not redefine them once they have been created
initially.

references #1779
2018-11-08 15:31:58 +01:00
Christian Brabandt
d57344a3c3
highlighter: skip more buffer related hi groups
Previously, we only checked for if the name starts with 'airline_c'

But there could as well be highlighting groups starting being called
'airline_b_to_airline_c5', but if buffer 5 is no longer visible in the
current viewport, then we do not need to recreate those groups.
2018-11-08 13:32:20 +01:00
Christian Brabandt
496de8b745
highlighter: do not skip empty c_sections
currently, if the matchstr() evaluates to '', it would skip the required
section, because bnr would be evaluated to zero and since there is no
buffer zero, skip that highlighting group.

Make sure, to only skip the highlighting group if the buffer number is
actually > 0
2018-11-08 12:40:46 +01:00
Christian Brabandt
71dc6f0257
highlighter: fix regex typo 2018-11-08 12:24:02 +01:00
Christian Brabandt
09b5eb952c
highlighter: Only recreate hi groups for visible buffers
In a long editing session, there could happen to accumulate several
highlighting groups for buffers that might no longer be visible.

Therefore, only re-create the highlighting group for buffers that are
actually displayed in the current tabpage. If not, skip them.

references #1779
2018-11-08 12:20:55 +01:00
Christian Brabandt
b7367c605a
highlighter: do not redefine the same groups several times
previously, it could happen that the same highlighting group was defined
several times, because it was available in several modes within
g:airline#theme[mode]. So the second one would always win.

Therefore, loop through all modes in reverse order and define the group
and remember what group has already been defined. If we happen to have
to re-define the same group, skip it. Since we are traversing the list
in reverse order, this should make sure the last definition wins.

This has the benefit of being more performant and hopefully helps with
e.g. #1779 and similar issues.
2018-11-07 14:25:40 +01:00
Christian Brabandt
18200bfad3
modes: do not add special sections to accents 2018-11-07 13:49:22 +01:00
Christian Brabandt
776f7aa948
Merge pull request #1816 from amiller27/numbered-ctrlspace-tabs
Add option for numbered tabs
2018-11-01 16:10:16 +01:00
Aaron Miller
62f3d1d412 Add option for numbered tabs
Cleaned up variable name, added documentation
2018-11-01 10:44:44 -04:00
Christian Brabandt
6516b1b4dc
po: only reset cache if window width changed 2018-11-01 11:18:04 +01:00
Christian Brabandt
fc021cf4e8
po: only substitute, if value is present in string 2018-11-01 11:14:57 +01:00
Christian Brabandt
6508558c3d
po: shorten and reformat message format for smaller windows 2018-11-01 10:40:41 +01:00
Lars Michelsen
0609a1f945 Visualize that ale is currently checking the current buffer
At the moment you can never be sure whether you look at the results
that ale just produced after your last changes or you are looking at
outdated information.

Instead of showing the last results while ale executes checks on the
current buffer it can now show a specific indicator.

This commit introduces the new config variable
`g:airline#extensions#ale#checking_symbol` which defaults to "...". In
case you don't want to see this, you may set it to an empty string.
2018-10-18 21:33:15 +02:00
Christian Brabandt
2e99805dbf
Fix failing test 2018-10-16 12:13:24 +02:00
Christian Brabandt
726b730f0a
highlight: correctly cache and restore reverse attributes for highlighting colors
references #1779
2018-10-16 12:03:31 +02:00
Christian Brabandt
7e004804d1
Merge pull request #1811 from LarsMichelsen/update_post_ale
Improve update logic after ale finished
2018-10-16 10:56:49 +02: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
fish
4d825bdb64 Remove trailing space 2018-10-15 20:35:28 +08:00
Christian Brabandt
68f5f1e50d
mode: Update doc, sort dict 2018-10-15 14:17:49 +02:00
Lars Michelsen
3f34ff56b8 Improve update logic after ale finished
Previously the ale refresh was triggered after user interactions only.
When linting takes some time and the user is not actively working the
ale information was not updated while the things ale directly controls
were updated. This change makes showing linting results a loot smoother.
2018-10-14 20:19:39 +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
Doron Behar
7190164451 Externalize quickfix function returning text
Useful when one wants to use this function for something else and to
know if a QuickFix window is actually a Location list with qf as
`&filetype`.
2018-09-28 12:56:49 +03:00
Christian Brabandt
a0298263b7
autocomd: do not re-evaluate modelines
fixes #1804
2018-09-25 16:03:30 +02:00
Liam Fleming
2390022e33
wordcount: do not rely on english in old versions
for older Vims, the wordcount extension falls back to `g<c-g>` and
parses the messaage that is generated.

When doing so, it expects the English locale, which might not be true.
Therefore, try to regex parse the result without using the english words
(assuming the output is still in the same order as in English).
2018-09-23 20:10:32 +02:00
Christian Brabandt
57bbe050c7
Merge pull request #1801 from flemingfleming/wordcount-fixes
The rest of the wordcount fixes, and some improvements
2018-09-23 17:38:11 +02:00
Dennis Falling
2f17e368b5 Add dictionary key check for d.severity 2018-09-23 10:50:15 -04:00
Liam Fleming
0f6cfcdfc2 wordcount: Fix the visual count matching pattern 2018-09-22 13:57:53 +01:00
Liam Fleming
264c1fefd2 wordcount: Compatibility fixes and General upkeep
Compatibility:
- Don't use a script-local function to update the format strings
- Protect against `:normal!' moving the cursor on on the wordcount check

Bugfix:
- Let to_string() try to return something for all values
  - Now returns correctly when passed both 0 and '0'

Upkeep:
- Simplify check again no valid key from winwidth()
- Old wordcount check: use matchstr() - more expressive and fewer steps
- Improve documentation style/clarity/detail
2018-09-22 03:34:27 +01:00
Christian Brabandt
ae024293e4
wordcount: fix wrong normal mode command 2018-09-21 21:37:21 +02:00
Christian Brabandt
ecf10d0e58
wordcount: check that the retun value has the dict key
else it will throw an error.
2018-09-21 11:49:42 +02:00
Christian Brabandt
82a6097b01
wordcount: work-around non-existing v:t_list
v:t_list is an internal variable describing the type of a list.
Unfortunately, this is not available in older vims. So let's fall back
to using `type([])`

see #1795
2018-09-20 11:44:17 +02:00
Christian Brabandt
7957bd1d32
wordcount: only add fmt function once to statusline functions
This prevents a warning message, when the function is tried to add
several times. Also while at it, add a '!' so that no error is thrown if
the file is sourced a second times.
2018-09-20 10:41:50 +02:00
Christian Brabandt
110594c91a
tabline: remove spurious variable 2018-09-20 10:31:14 +02:00
Christian Brabandt
012229fe08
tabline: Ignore buffers in buflist matching ignore_bufadd_pat
closes #1777
2018-09-20 10:26:32 +02:00
Christian Brabandt
a60eabb82f
tabline: do not show terminal buffers by default 2018-09-20 10:25:47 +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
Liam Fleming
0756b9a4aa wordcount: Re-enable updating the format string 2018-09-18 20:12:17 +01: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
Liam Fleming
c33c1de079 wordcount: Simplify update strategy
Checking for wordcount changes now uses a b:changedtick comparison in
the statusline funcref. The autocommand strategy that used to do this is
removed, simplifying the code.
2018-09-18 16:05:01 +01:00
Liam Fleming
9903fee60e wordcount: Optimise formatter calls, cleanup code
- Formatter is now only called when the wordcount changes
- ...#apply() now only compares against the filetype list when necessary
- Old format() function is no longer called for (unsupported) counting
  of visual words
- Misc code quality improvements
2018-09-18 15:13:43 +01:00
Liam Fleming
487d262901 wordcount: formatter: code quality improvements
- Rename new formatting function: transform() -> to_string()
- Optimise separator selection
- Other quality improvements
2018-09-18 02:04:35 +01: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
aec0a1a15a
languageclient: Check severity key before accessing it
closes #1793
2018-09-16 18:17:04 +02:00
Daniel Wennberg
cda5647a29 Don't use the read-only count as local variable
The variable name `count` is always equivalent to `v:count`, which is
a read-only variable and cannot be assigned to.
2018-09-09 23:51:11 -07:00
Christian Brabandt
f5676d1fa1
Merge pull request #1788 from hallettj/extension/languageclient
Extension to report errors and warnings from LanguageClient plugin
2018-09-10 07:36:15 +02:00
Jesse Hallett
a92b12e1c6 Implement extension to report errors and warnings from LanguageClient plugin 2018-09-09 23:53:08 -04:00
Sebastián Mancilla
c3434164b2 Load vimtex only when the extension is enabled
Do not force loading the full vimtex autoload script for all users.
First check if the extension is enabled.
2018-09-06 13:15:38 -03:00
Liam Fleming
8715d13cc5 wordcount: Refactor updating and autocmds
Various improvements:
 - Seperate out visual mode detection.
 - Use TextChanged rather than CursorMoved where supported.
 - Let users specify the filetypes for which wordcounting is enabled
   with a list rather than a pattern.
 - Move the filetype check to when airline is refreshed, as opposed to
   on every update; autocommands are not created if wordcounting is
   disabled
2018-07-28 19:26:24 +01:00
Liam Fleming
44da0a4761 wordcount: Replace formatter interface
Currently the formatter, and not the wordcount plugin, is responsible
for providing the wordcount as well as formatting it. The default
formatter allows visual mode word counting, although this is not
documented.

The new interface - a transform() function, allows the main wordcount
plugin to internalise this logic. Providing the wordcount simplifies
formatter implementations:
 - All formatters can display the visual wordcount.
 - Formatters do not have to worry about compatibility with different
   vim versions.

The old format() function can now be deprecated, although the wordcount
plugin retains compatibility with formatters using it. The default
formatter will also be used as a fallback if no suitable function is
found.

The default formatter is rewritten to use the new interface.
2018-07-28 18:24:12 +01: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
Mo Hyun
723987eca9 Add vim-grepper extension
- Displays a segment when a grepper search is running
2018-07-23 13:05:34 -07:00
Tim Pope
a8ccef61ba Update to new Fugitive real path API 2018-07-22 15:39:54 -04:00
Christian Brabandt
5aef1b90e5
tabline: Correctly trigger on BufDelete autocommand
fixes #399
2018-07-13 22:29:34 +02:00
Christian Brabandt
821372b9cf
tabline: re-map tabline keys
fixes #1753
2018-07-13 21:33:03 +02:00
Liam Fleming
781c40bb3d Create AirlineModeChanged autocmd 2018-06-28 18:44:26 +01:00
Tim Pope
9bee0e923e Use FugitivePath in fugitiveline if available 2018-06-27 18:07:59 -04:00
Tim Pope
66e49d9a15 Fix fugitiveline when file is also branch name 2018-06-27 18:05:09 -04:00
Christian Brabandt
b790fd2120
Merge pull request #1750 from Mangero/arduino-whitespace
Add Arduino to list of C-like languages
2018-06-18 08:39:53 +02:00
Mangero
a141918faa
Add Arduino to list of C-like languages
Add 'arduino' filetype to list of C-like languages. This is needed in
order to avoid mix-indent-file warnings when using hard tabs for
indentation in Arduino source files (*.ino, *.pde) containing top level
block comments with leading space before a '*'.

Similar to: 460ed02864
Original fix: 8fde76dd63
2018-06-18 01:09:56 +02:00
Liam Fleming
11bc0ba843 Move CursorMoved autocmd to main augroup 2018-06-16 20:34:07 +01:00
Liam Fleming
feca81fb86 add "!" to function signatures 2018-06-13 17:52:13 +01:00
Christian Brabandt
4f95970228
branch: use :noa before calling async func
for some reasons, calling async functions might cause an error, if a
SourcePre command has been defined. So explicitly call the functions
using `:noa` modifier to prevent triggering the SourcePre autocommand.

fixes #1742
2018-06-11 14:45:29 +02:00
Hana Shiro
acb93da0d8 Fix tabline didn't update when enable both buffers and tabs 2018-06-05 06:11:14 +08:00
Christian Brabandt
add75907d5
Merge pull request #1738 from shirohana/fix/ctrlspace-tabline-switching
airline#extensions#ctrlspace: Fix tabline didn't update when switch to tab which focused on non-listed buffer
2018-06-04 22:56:22 +02:00
Christian Brabandt
eab6d35852
terminal: Some improvements to Terminal detection
closes #1730

- Make sure to always call the term extension on TermOpen autocommands
- consistently use the airline_term highlighting group
- hard code the airline_term highlighting group, because by the time the
  function airline#themes#patch() is called the highlighting group
  airline_c would no be defined, so we cannot dynamically get those
  attributes
- In the documentation, mention how the g:airline_mode_map can be set
  including the terminal section
2018-06-04 22:44:46 +02:00
Christian Brabandt
1bb1ce594a
Formatter: Use pathshorten() instead of substitute()
The default formatter uses a hand-build regexp for shortening the path
in the tabline. However, since it uses the \w  regex atom, this won't
match e.g. cyrillic letters.

To fix this, use the builtin pathshorten() function which does handle
this case correctly. For a test, use e.g. 'D/Учёба/t.c'

closes #1737
2018-06-04 21:59:16 +02:00
Christian Brabandt
044a90ed55
use get(v:, 'lang', '') instead of v:lang
closes #1735
2018-06-04 21:45:46 +02:00
Christian Brabandt
981b83003f
fugitive: Use FugitiveHead() instead of fugitive#head
function if possible and use it instead of the fugitive#head
(which will always autload the fugitive plugin).
2018-06-04 18:32:30 +02:00
Christian Brabandt
a1680cc36d
fugitive: Check for existence of FugitiveStatusline function
as per @tpopes advice.
2018-06-04 17:42:33 +02:00
Christian Brabandt
30a3c4f549
branch: fugitive renamed its functions
this caused that the branch extension was not correctly working anymore
because of a refactoring of fugitive tpope/vim-fugitive@5d11ff7

Solution: Move the existence check for the fugitive plugin into a
separate function and call it from there in all places that check the
fugitive plugin. Do the same for lawrencium and vcscommand check.

fixes #605 #1739
2018-06-04 17:38:49 +02:00
Hana Shiro
c7d4710f76 Refactor airline#extentions#tabline#ctrlspace#* 2018-06-02 23:41:15 +08:00
Hana Shiro
6e1e6686e7 Fix problems caused by #1524 2018-06-02 21:22:00 +08:00
Hana Shiro
a6e07b6a55 Remove unused catch block 2018-06-02 14:04:25 +08:00
Hana Shiro
4db6d11962 Fix indentation 2018-06-02 13:59:08 +08:00
Hana Shiro
ac799f6021 Rename parameters for better readability 2018-06-02 13:49:32 +08:00
Hana Shiro
92bf1b0b39 Use ternary-operator 2018-06-02 13:02:49 +08:00
Christian Brabandt
b84e13f1d7
Blacklist startify for [noperm]
Startify unfortunately does not set the buftype option, so the
`[noperm]` would be shown, since the buffer is not really a file.
(see mhinz/vim-startify#324)

So allow to blacklist startify from this setting. To do so, the logic
from the tabline extension was refactored out into a separate function
that returns true, if the buffer matches
`g:airline#extensions#tabline#ignore_bufadd_pat` and that function is
then reused for the readonly() function as well.
2018-05-11 22:32:20 +02:00
Christian Brabandt
c7e05efb76
Only consider regular files for the '[noperm]'
Recently, NERDTree added the &readonly setting to its buffer.
Unfortunately, this caused airline to render the '[noperm]' string in
it.

Fix this by only making the readonly check for buffers that actually
represent files (e.g. the buftype option is empty).
2018-05-11 09:53:55 +02:00
iroedius
15bc732df4 allow to also disable trailing whitespace check per filetype 2018-04-28 07:34:59 +02:00
Christian Brabandt
33310c5b24
whitespace: Allow to disable individual whitespace checks per filetype
closes #1716
2018-04-27 08:25:49 +02:00
Stanislav Gobunov
c4a4a20b8d
xkblayout: Make Short codes configurable
airline#extensions#xkblayout#short_codes changed to global for easily redefine long named keyboard layout

closes #1713
2018-04-18 10:46:55 +02:00
Christian Brabandt
a76f523be5
bufferline: always add a space for the very first item
closes #1631
2018-04-15 10:16:28 +02:00
mg979
f7c818a0ff
add xtabline extension 2018-04-14 14:03:21 +02:00
Christian Brabandt
0df2c9b12e
Merge pull request #1700 from mox-mox/master
Add extension for vim-localsearch
2018-04-09 13:27:44 +02:00
mox
00f718691a Adding localsearch extension (code and documentation). See https://github.com/mox-mox/vim-localsearch 2018-04-09 00:47:23 +02:00
Christian Brabandt
d66b507b02
Merge pull request #1683 from idbrii/add-custom-scm
Make branch detection customizable
2018-04-08 21:56:32 +02:00
David Briscoe
8209ca7da1 Make branch detection customizable
Instead of requiring each version control plugin to modify airline to
show the current branch, provide a customization function we can check
instead.

Following the example of airline_theme_patch_func, you define the
variable like so:

    let g:airline#extensions#branch#custom_head = 'david#svn#get_branch'

Custom functions should cache their value. They may need an autocmd to
invalidate their cache:

    " Use a buffer-unique group name to prevent clearing autocmds for other
    " buffers.
    exec 'augroup svndavid-'. bufnr("%")
        au!
        autocmd BufWinLeave <buffer> unlet! b:svndavid_branch
    augroup END

This change lets me integrate with vc.vim (I couldn't get VCSCommand
working for svn) or write my own thing for perforce.

Additionally, always load whole file and check for existence.

Instead of determining up front whether various scm plugins are
installed, check for them on use so they can be added after this script
is sourced.

This also mitigates the problem of checking for existence of autoload
functions (which are not loaded by exist()). Since we're checking
root-level functions, they're likely to be loaded once we're using any
part of the plugin.
2018-04-06 09:40:17 -07:00
Christian Brabandt
902921931e
Simplify airline#init#gui_mode()
remove all the old code that is probably not used anymore
2018-04-06 02:21:20 +02:00
Christian Brabandt
ae394294c3
gutentags: output correct statusline message
fixes #1703
2018-04-06 02:14:10 +02:00
Christian Brabandt
bf3cc5ad9d
NerdTree: make the statusline configurable
Use the g:NerdTreeStatusline variable for configuring the
NerdTree statusline in the NerdTree window

closes #1705
2018-04-06 01:52:23 +02:00
Christian Brabandt
47bdae9067
Merge pull request #1702 from mrmr1993/fix-buffer-counts
Fix buffer numbering to start from 1 with buffer_idx_mode
2018-04-03 03:16:38 +02:00
Gianni Chiappetta
023fe122c5
Support typescript in jsformatter 2018-04-02 11:29:18 -04:00
mrmr1993
fbf96559c9 Fix buffer numbering to start from 1 with buffer_idx_mode
275ec4fe63 broke this so that numbering
started from 0 instead of 1 with
g:airline#extensions#tabline#buffer_idx_mode = 1

Specifically, I overlooked that |index| actually tracked the index of
the current buffer in the buffer list *starting from 1*, whereas I
assumed it tracked the true index (starting from 0).
2018-04-02 01:04:43 +01:00
Christian Brabandt
2ba64a88fd
Merge pull request #1691 from silenc3r/master
ALE: add option to disable line numbers
2018-04-01 14:13:29 +02:00
Christian Brabandt
f0b969549a
Merge pull request #1693 from mrmr1993/current-tabs-visible-experiments
Rework tabline for tabs and buffers
2018-04-01 14:01:17 +02:00
mrmr1993
47c36d2819 Don't let the current buffer be -1 when calculating the tabline 2018-04-01 01:17:18 +01:00
mrmr1993
aee733aa87 Don't show titles in the tabline if there aren't any
airline#extensions#tabline#buflist#list doesn't pick up some buffers
(most notably Netrw buffers), so there are sometimes no buffers to show
and the tabline code fails with an error. This avoids that situation.

It would be better to detect these and show titles for them, but for now
this restores the old behaviour.
2018-04-01 01:05:51 +01:00
mrmr1993
c75106f12d Don't change remaining_space in tabline builder until necessary 2018-03-22 16:42:06 +00:00
mrmr1993
4b1913ad13 Use insert_section for overflow markers in tabline builder 2018-03-22 16:42:06 +00:00
mrmr1993
df2f380c9e Add get_separator_change_with_end to tabline builder 2018-03-22 16:14:18 +00:00
Christian Brabandt
b9f55455fb
Revert "highlighter: Make the separators use a cterm background color"
This reverts commit e72a7e2c8d.
2018-03-20 15:30:02 +01:00
Christian Brabandt
d2ac3d5755
async: catch error when jobstart() fails
closes #1692
2018-03-20 14:01:46 +01:00
Christian Brabandt
e72a7e2c8d
highlighter: Make the separators use a cterm background color
should fix: #1663
2018-03-19 22:24:57 +01:00
mrmr1993
2528de7d81 Add comments to tabline/builder 2018-03-19 16:21:43 +00:00
mrmr1993
7396dc7a10 Create helper function tabline_evaluated_length 2018-03-19 15:05:50 +00:00
mrmr1993
51bb8dd7e0 Move strchars into util.vim 2018-03-19 15:03:51 +00:00
mrmr1993
5b7b9cf656 Rename remaining tab -> title in tabline/builder 2018-03-19 15:03:51 +00:00
mrmr1993
0b47adf087 Rename tab -> title in tabline/builder method names 2018-03-19 14:36:02 +00:00
mrmr1993
3914d5b475 Rename skipped_tabs_marker to overflow_marker 2018-03-19 14:36:02 +00:00
Christian Brabandt
ecff00a559
tabline: do not show buffer label if show_buffers is zero
fixes #1689
2018-03-19 15:06:55 +01:00
Dawid Zych
18f93ac96b ALE: add option to disable line numbers 2018-03-19 11:28:45 +01:00
mrmr1993
75f53ef6e5 Rename last_{left,right}_group to {left,right}_group 2018-03-18 01:15:11 +00:00
mrmr1993
a2e0ed982f Rename left{,_alt}_sep_size to {,alt_}sep_size 2018-03-18 01:13:30 +00:00
mrmr1993
84bf60c405 Statusline: Use separator widths to calculate whether a title will fit 2018-03-18 00:52:34 +00:00
mrmr1993
896c14bded Reset _remaining_space if a title can't be inserted
This gives us a chance to add the title on the other side if it will
fit, so that we fill more space in the tabline.
2018-03-17 20:05:38 +00:00
Ingo Heimbach
724beb0c73
Added a vim-gutentags extension
Added a segment that displays whether gutentags is running a ctags
instance.
2018-03-15 22:05:16 +01:00
Christian Brabandt
fb85c0a91a
Merge pull request #1678 from mg979/buflist
Changed buflist.vim algorithm
2018-03-15 21:52:35 +01:00
mrmr1993
d13305fc5d Redraw buffer tabline when the terminal width changes 2018-03-15 20:44:51 +00:00
mrmr1993
7844d8bf72 Remove get_visible_buffers 2018-03-15 20:44:51 +00:00
mrmr1993
4a342afb90 Add an option to centre the active tab in the tabline 2018-03-15 20:44:51 +00:00
mrmr1993
275ec4fe63 Use tabline builder for buffers tabline 2018-03-15 20:44:51 +00:00
mrmr1993
d9e68039b8 Take the first tab number in tabline/builder.insert_tabs 2018-03-15 20:44:51 +00:00
mrmr1993
3cd8daa162 Add support for get_pretitle and get_posttitle to tabline builder 2018-03-15 20:44:51 +00:00
mrmr1993
e6b6f36d90 Remove %@...@ patterns in evaluate_tabline if has('tablineat') 2018-03-15 19:21:15 +00:00
mrmr1993
a7bff3b30b Pass number of tabs as an argument to insert_tabs 2018-03-15 18:21:29 +00:00
mrmr1993
5ecc25d6d6 Move tab_nr_type into tabs get_title 2018-03-15 18:14:50 +00:00
mrmr1993
6db0af6f8d Factor out tab insertion into its own function 2018-03-15 18:14:24 +00:00
mrmr1993
9b41fe5de9 Replace tabs tabline remaining_space with a member variable 2018-03-15 18:01:39 +00:00
mrmr1993
1328610188 Initialise tabs tabline builder variables in insert_tabs 2018-03-15 17:46:33 +00:00
mrmr1993
ada8cd7641 Use variables in the tabs tabline builder to track position 2018-03-15 17:41:08 +00:00
mrmr1993
349d01ba39 Generate tabs directly in tabline/builder.build 2018-03-15 17:38:19 +00:00
mrmr1993
3f87d28abb Move insert_tabs into tabs tabline builder prototype
Also move evaluate_tabline and strchars methods that it uses
2018-03-15 17:05:58 +00:00
mrmr1993
71814fb19f Add get_title and get_group to tabs tabline builder 2018-03-15 17:04:19 +00:00
mrmr1993
b99da65412 Create insert_tabs function on builder for tabs tabline 2018-03-15 16:58:04 +00:00
mrmr1993
6286b6d8d8 Move get_group into its own function for tabs 2018-03-15 16:58:04 +00:00
mrmr1993
5907d3909e Add dedicated tabline builder 2018-03-15 16:38:36 +00:00
mrmr1993
57f2619c67 Remove unused variable b_tabline 2018-03-15 15:42:51 +00:00
mrmr1993
1837b2ee39 Use the size of the seperators to get the tabline's remaining space 2018-03-15 15:42:51 +00:00
mrmr1993
d3ec54d42e Remove magic contant for skipped_tabs_marker in tabline calculation 2018-03-15 15:18:57 +00:00
mrmr1993
2b0fe51f99 Replace %= with empty string in evaluate_tabline 2018-03-15 14:36:39 +00:00
mrmr1993
a8f92cc68a Rename skipped_tabs_marker to overflow_marker
This is set to g:airline_symbols.ellipsis, which this commit also adds.
2018-03-15 14:21:16 +00:00
Christian Brabandt
4237bfb052
branch: allow multibyte chars in shortening algorithm
previously, the branch extension used name[0:6], however that would
break with multibyte characters, since this is a byte index and not a
character index.

fixes #1686
2018-03-14 21:33:25 +01:00
mrmr1993
88dedb586a Update tabs tabline when the width of the terminal changes 2018-03-14 15:25:03 +00:00
mrmr1993
5d2d764368 Use strchars to calculate string lengths
This also adds a compatability wrapper, so that versions older than
Vim 7.3 are supported.

This is inspired by, and includes s:strchars from, @ruipgpinheiro's
commit e2d1295a3d3708e8d2a5eb30cac840fc9520bb8b
2018-03-14 15:13:40 +00:00
mrmr1993
6819443d6a Fix typo in evaluating %( %) rules 2018-03-14 15:07:41 +00:00
mrmr1993
980e78b4bf Add configurable variable airline#extensions#tabline#skipped_tabs_marker 2018-03-14 15:07:32 +00:00
mrmr1993
7480245ebf Calculate used length of tabs directly as they are added 2018-03-14 14:51:09 +00:00
mrmr1993
f93894f6ac Move tab title generation into its own function 2018-03-14 13:55:30 +00:00
mrmr1993
e1a4cd764f Adjust tab columns to allow for ellipsis and the left/right split 2018-03-13 00:57:48 +00:00
mrmr1993
d29c7b27fa Evaluate tabline fragments to get the length of tab titles 2018-03-12 21:55:27 +00:00
mrmr1993
3305410982 Move tabline evaluation into its own function 2018-03-12 21:55:27 +00:00
mrmr1993
e0791cc1a0 Use the partially built tabline to calculate space left for tabs 2018-03-12 21:55:25 +00:00
mrmr1993
7a286639c5 Attach tabs to tabline last 2018-03-12 21:52:12 +00:00
mrmr1993
2711c73a47 Pass the available space for tabs as an argument to |get_visible_tabs| 2018-03-12 21:48:40 +00:00
mrmr1993
cf47d63f71 Fix formatting in clipped tab bar 2018-03-12 21:48:40 +00:00
mrmr1993
abd310bb31 Show current tab in the middle of the tabline
This is heavily based on 3cc1dcb697,
mostly by copying the get_visible_buffers function and making some
tweaks
2018-03-12 21:48:35 +00:00
mrmr1993
f60cf736db Add a get_tabs function to abstract over tabs 2018-03-12 21:47:08 +00:00
mg979
26aa528c42 Made s:variables local
Moved small functions out of main function
2018-03-07 02:21:52 +01:00
Christian Brabandt
167602d5b9
tabline: get correct buffer name
When the uniq_tail formatter is used, the buffer name is not refreshed
when running through the duplicates. Fix that by getting the correct
buffer name again.

fixes #1680
2018-03-06 11:23:38 +01:00
Cimbali
9912ce13a4 Disable fugitiveline if bufferline is activated
This fixes the conflict of both plugins redifining the 'file' (or 'path')
function. Closes #1670.
As fugitiveline modifies the path display and bufferline replaces it,
the latter should be the plugin to be used if both are activated.
2018-03-05 11:56:03 +01:00
mg979
63111e9810 Removed fnamemodify() in path check for buflist.vim 2018-03-04 00:31:25 +01:00
mg979
2e2a66c5a0 Restored old variable name for g:airline#extensions#tabline#excludes
Made check case sensitive
2018-03-03 23:53:10 +01:00
mg979
3ebbc57725 Changed buflist.vim algorithm 2018-03-03 23:39:14 +01:00
Christian Brabandt
55a9721c22
Merge pull request #1651 from srini-x/master
Changing 'airline_tablabel' text and colors back to old style
2018-02-14 09:49:31 +01:00
srini-x
7f1cfb0c3f removing the hard-coded '[' and ']' around the tabline labels. 2018-02-13 17:48:21 -08:00
erfanio
8c634887bf Fix white space in tabline when showing buffers 2018-02-08 19:02:35 -08:00
Christian Brabandt
c2ffb8b3ec
Merge pull request #1643 from ThomasFaivre/quickfix
quickfix: fix options initialization
2018-01-21 09:55:23 +01:00
Thomas Faivre
dec9b8e65c cursormode: allow custom mode names
A new variable named cursormode_mode_func is used to store the function
returning the current mode. This allows more customization in the mapping.
The default value is the built-in mode function so there is no change in
behavior.
Add some documentation.

Signed-off-by: Thomas Faivre <thomas.faivre@6wind.com>
2018-01-19 13:28:02 +01:00
Thomas Faivre
e5a51f9fca quickfix: fix options initialization
Options default value is hard coded making them override user values.

Signed-off-by: Thomas Faivre <thomas.faivre@6wind.com>
2018-01-18 18:21:56 +01:00
Christian Brabandt
a3bdb10aea
Merge pull request #1634 from Cimbali/master
Fix over-caching of paths
2018-01-15 08:02:09 +01:00
Cimbali
a104e40b10 Cache only git calls, not bufname and fnamemodify 2018-01-09 20:07:54 +01:00
Christian Brabandt
9a2ed35ff9
tabline: do not confuse Vim
looks like this:
```
let a=(condition ? s:var:'')
```
confuses older Vims and it complains about a missing colon. So make
parsing a bit easier and add a space in front of the second colon.

fixes #1629
2018-01-08 13:46:08 +01:00
Christian Brabandt
02816a3cb6
tabline: missing spaces
commit ab49a1c7ae changed that no leading whitespace was added.
While this removed a double space in front of the current active
selected buffer, it removed one space too much for the non-current
buffers in the bufferline.

So partly reverse it and only add the space, if the highlighting groups
between each item did not change.
2018-01-08 09:48:36 +01:00
Christian Brabandt
182675dc10
tabline: revert default buffer_idx_mode
commit 2e3cdeb unintentionally changed the default for the
buffer_idx_mode in the tabline.

Revert it back to be disabled by default

fixes #1628
2018-01-07 09:51:08 +01:00
Christian Brabandt
ab49a1c7ae
tabline: do not add extra space before buffer name
there was a space too much added in the tabline. Fix that
2018-01-05 22:13:47 +01:00
Christian Brabandt
5db4c408bd
Update copyright notifications 2018-01-05 10:37:59 +01:00
Christian Brabandt
6c4f3277f1
Add missing scriptencoding 2018-01-05 10:26:38 +01:00
Christian Brabandt
6cdcaf13b1
cursormode: disable by default
fixes #1625
2018-01-05 08:12:35 +01:00
Christian Brabandt
3a2323feac
branch: shorten default master for smaller windows 2018-01-05 08:12:10 +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
3b5f2bd470
async: Todo: Check if cwd option for Vim 8 is needed 2018-01-04 23:29:15 +01:00
Michael Brailsford
7215a1fdd5
clarifying documentation
closes #1225
2018-01-04 21:31:16 +01:00
Eduardo Suarez-Santana
ebda798080
Cursormode integrated as extension 2018-01-04 21:24:27 +01:00
Christian Brabandt
c17ad9a123
Merge pull request #1426 from lynnard/master
Fix problems with AirlineSelect{Prev,Next}Tab
2018-01-04 21:15:00 +01:00
Christian Brabandt
73d8abff2f
Merge pull request #1617 from kyleholzinger/master
Add formatter for js files
2018-01-04 21:14:00 +01:00
Christian Brabandt
d283a25e3f
tabline: only show buffer label, if they were drawn
closes #1558
2018-01-04 20:56:09 +01:00
Christian Brabandt
ce83c39bed
tabline: allow custom formatter for tabnr_type
closes #1418
2018-01-04 20:41:55 +01:00
Christian Brabandt
c518f79aab
tabline: allow to show buffers label at start 2018-01-04 19:38:07 +01:00
Christian Brabandt
9d28f0dcc7
tabline: allow to show current buffer/tab at first position
This will make highlighting more consistent. Always first item is the
one where the cursor is.
2018-01-04 19:32:29 +01:00
Christian Brabandt
30652c05c4
tabline: correct order of tab/buffer labels 2018-01-04 19:09:02 +01:00
Christian Brabandt
90cf752c90
tabline: add separate highlight group for labels 2018-01-04 18:57:28 +01:00
Christian Brabandt
3b631ef0c4
tabline: refactor label function 2018-01-04 18:43:03 +01:00
Christian Brabandt
3985ece131
tabline: add [buffers]/[tabs] labels consistently
previously, when both tabs and buffers were displayed in the tabline, it
was not immediately obvious which side belongs to a buffer and which one
to a tab. Therefore, add [buffers]/[tabs] labels consistently.
2018-01-04 18:34:48 +01:00
Christian Brabandt
45878a7947
tabline: remove l: prefix of function variables 2018-01-04 18:29:51 +01:00
Christian Brabandt
503b9977fb
tabline: refactor s:variables 2018-01-04 18:20:25 +01:00
Christian Brabandt
69aa1e93b3
tabline: add more try/catch for mappings
similar to 2e3cdeb808 add a couple of more try catch statements
around the map_keys() function
2018-01-04 18:15:40 +01:00
Christian Brabandt
645f65d8d9
ctrlspace: wrong separator
under certains circumstances it could happen that for the vim-ctrlspace
tabline extension a tabline group was redefined which would cause a
separator having foreground and background color swapped. This was
caused by using the 'pos' parameter for the right side wrongly.

fixes #1559
2018-01-04 18:07:03 +01:00
Christian Brabandt
45236ba7c7
ctrlspace: refactor s:variables 2018-01-04 17:27:34 +01:00
Christian Brabandt
a25757ac64
tabline: Allow an alternate style for bufferlist
fixes #1608
2018-01-04 15:45:36 +01:00
Christian Brabandt
d78f686ce5
tabline: remove some more s:vars 2018-01-04 14:35:10 +01:00
Christian Brabandt
6ba65b2c8c
tabline: remove s:show_tab_type variable 2018-01-04 14:30:16 +01:00
Christian Brabandt
708c76e22c
tabline: do not cache s:buffer_idx_mode 2018-01-04 14:23:50 +01:00
Christian Brabandt
d03c3fa7b9
tabline: remove l: variable prefix 2018-01-04 14:20:36 +01:00
Christian Brabandt
72e457d8c2
tabline: remove static caching of s:vars
rather let them be defined whenever they are needed. They were only used
inside a single function anyhow, so it does not make sense to cache
them. In addition, having the user later change the variable won't work
as expected.
2018-01-04 14:11:13 +01:00
Christian Brabandt
2e3cdeb808
tabline: try/catch mapping of the keys
fixes #1621
2018-01-04 14:11:11 +01:00
Kyle Holzinger
a3d5e84417 Add formatter for js files 2017-12-28 15:43:13 -05:00
Cimbali
18da5aa699 Separate updating and displaying branch information
This will cause any calls that are not just head() to be delayed and
cached whenever possible.
2017-12-26 22:30:23 +01:00
Cimbali
1ee057362d Caching path simplified using fugitive 2017-12-26 22:30:23 +01:00
Cimbali
e0dd3d8125 Rename merge file names
Clearer names that reference the HEADs of git: FETCH_HEAD, ORIG_HEAD and
MERGE_HEAD, rather than the names that fugitive uses for them.
2017-12-23 15:05:59 +01:00
Christian Brabandt
bc985301db
Merge pull request #1603 from Cimbali/master
Improve fugitive integration
2017-12-21 09:09:44 +01:00
Edward Betts
3b304f36ae
Correct spelling mistake. 2017-11-25 21:14:31 +00:00
Cimbali
e415c5301f Trusting fugitive instead of tracking paths manually
The initial reason in #237 is not valid anymore, as vim-gitgutter
functions as expected for editing files that are not part of a repo,
whether they are:
- in a different repo
- in a parent repo (cwd being a submodule)
- outside of the repo

Furthermore, removing this check allows to show relevant info for
specific fugitive file names that are fugitive://..../sha1//...
which are hard to parse manually, especially in complicated situations
such as submodules.
2017-11-22 23:55:22 +01:00
Cimbali
8c4bf37588 Configurability: parametrizable sha1 length 2017-11-22 23:01:54 +01:00
Cimbali
33663d7df2 Show buffer name relative to git folder 2017-11-22 23:00:58 +01:00
Cimbali
009f7932fb Show #branch#head() as "ref-or-sha1(current-branch)"
Only changes anything in the case of using fugitive to show a file that
is not from the current working directory.
2017-11-22 23:00:57 +01:00
Cimbali
f0093ceaa6 Remove code redundant with fugitive#head()
It which requires a path, and just performed the same as
fugitive#head() does internally.
2017-11-22 19:25:26 +01:00
Christian Brabandt
3e13bab201
Merge pull request #1600 from PratikBhusal/patch-1
Add function to show line number
2017-11-20 13:58:21 +01:00
Jerome Reybert
640d6762f7 vimagit: let vimagit itself returns the current mode
If current vimagit version does not provide vimagit#get_current_mode(),
internal string version is kept.
2017-11-20 13:47:48 +01:00
Pratik Bhusal
58328b347c Added function to show line number
The function shows the line number of the first error/warning that appears in the current buffer. If there are 20 warnings and the first warning exists on line 33, then vim-airline would show "W:20(L33)".

One can change how the line number is represented using: `g:airline#extensions#ale#open_lnum_symbol` and `airline#extensions#ale#close_lnum_symbol`
2017-11-18 14:24:47 -06: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
Shohei Fujii
b044b4b204 collapse fname in tabline when using unique_tail formatter 2017-10-30 20:00:05 +09:00
Taikuh
ccc4c9f430 Add option to change wordcount display for the default formatter 2017-10-26 01:02:10 +08:00
Christian Brabandt
6e2a9e38cd
tabline: force redraw on BufAdd autocommands
closes #1580
2017-10-19 11:37:24 +02:00
Shohei Fujii
7bf1d9b1fb skip toggling ctrlspace tabline plugin 2017-10-16 17:33:40 +09:00
Christian Brabandt
27acd851a7
cleanup term extension 2017-09-27 20:28:18 +02:00
Christian Brabandt
0ad4f97c1a
Add a terminal statusline function for vim 2017-09-27 20:28:16 +02:00
yehuohan
4d645711e5 Fix: Use the CS-symbol of ctrlspace which may be change by user in ctrlspace-externsion 2017-09-27 16:17:50 +08:00
Christian Brabandt
031cb31056
branch: do not show errors for mq extensions
skip anything that matches abort

e.g. running hg qtop with Vims path outside of the repository returns
something like "abort: no repository found in ..."
in that case, do not show anything.
2017-09-22 21:39:17 +02:00
Christian Brabandt
9f186d899a
branch: mq patch not correctly displayed
also make the branch extension make use of the specific code to handle
the mq output
2017-09-22 21:37:28 +02:00
Gideon VanRiette
a763c6b53f Catch trailing whitespace when matching output 2017-09-18 09:02:39 -05:00
Christian Brabandt
8a3e3e2794
mq: remove trailing \n from system()
fixes #1563
2017-09-14 11:43:53 +02:00
Christian Brabandt
81f089322a
keymap: allow to disable extension by checking config var
closes #1556
2017-09-03 21:18:01 +02:00
Christian Brabandt
cdaa5117b0
highlighter: also return bold flag 2017-09-01 11:25:37 +02:00
Christian Brabandt
e7a5c97df1
readonly: remove modifiable check 2017-09-01 09:19:39 +02:00
Christian Brabandt
9e3fcc4cdb
tagbar: only try loading the tagbar extension once
commit 232b641 did unfortunately disable tagbar completely, since
exists("*func") does not autoload the function.

So this time, try explicitly calling the function once, and if it does
not exists, it should be disabled and not cause any further errors.

closes #1555
2017-09-01 09:08:22 +02:00
Christian Brabandt
f0a508b121
async: nvim: use generic output handler 2017-08-30 13:15:55 +02:00
Christian Brabandt
942458f19b
async: include stderr output in job output (Nvim)
references #1551
2017-08-29 12:56:15 +02:00
Christian Brabandt
d3f8873469
async: fix error, when mq is not enabled
fixes #1551
2017-08-29 12:47:29 +02:00
Christian Brabandt
09ab45a2fb
async: add missing comma
fixes #1550
2017-08-29 11:53:20 +02:00
Christian Brabandt
195f2e1dae
keymap: fix missing keymap symbol, fix wrong condition 2017-08-27 21:29:40 +02:00
Christian Brabandt
3b225a1322
keymap: add some more missing parts, fix missing printf 2017-08-26 21:14:35 +02:00
Christian Brabandt
f430246aff
keymap: add missing part from #1546 2017-08-26 18:18:45 +02:00
Christian Brabandt
57cda93aad
keymap: fix the style 2017-08-26 18:14:08 +02:00
Doron Behar
89e484ac59
Add keymap extension which shows keymap setting. 2017-08-26 18:09:20 +02:00
kaidiren
2b45581f1c fix: refresh airline when airline_skip_empty_sections enabled in plugin ale 2017-08-26 19:00:40 +08:00
Christian Brabandt
db907f5598
async: new function for validating directory
references #1544
2017-08-26 08:04:44 +02:00
Christian Brabandt
3e25ca5a5a
async: Check directory before starting the job (Neovim)
fixes #1544
2017-08-26 07:58:39 +02:00
Christian Brabandt
e357f88de6
async: define config variable for older vims
references #1542
2017-08-25 18:50:15 +02:00
Christian Brabandt
f4caf598fa
async: only use nvim functions, when actually using neovim
closes #1542
2017-08-25 16:48:45 +02:00
Christian Brabandt
42e5c82d64 Merge pull request #1535 from chrisbra/nvim_async
Improvement to async functionality
2017-08-25 14:37:47 +02:00
Christian Brabandt
5345c8fafa
denite: Check filetype in mode function
references #1540
2017-08-25 08:38:31 +02:00
Christian Brabandt
9bd2c40e7d
denite: remove FileType autocommand
closes #1540
2017-08-25 07:44:39 +02:00
icymind
b6a98bcd10 add option 'keymap_ignored_filetypes' for tabline extensions 2017-08-24 23:22:16 +08:00
Christian Brabandt
b77f326b33
async: rename variable
rename g:airline#init#async variable to g:airline#init#vim_async
because that is what it is for: showing whether vim supports async. Is
not set vor nvim, because nvim always supports jobs.
2017-08-23 18:38:19 +02:00
Christian Brabandt
06272275b5
fix po output not visible for nvim
Apparently, the output of msgfmt goes to stderr. So catch that one as
well.
2017-08-23 18:37:28 +02:00
Christian Brabandt
2c05a48a26
async: Add comments, better conditions to detect vim/nvim 2017-08-23 18:37:26 +02:00
Christian Brabandt
4c74a95045
Refactor async functions
- create a new async module
- refactor async functions from branch.vim and po.vim to async.vim
- support nvim async correctly
2017-08-23 18:37:24 +02:00
Christian Brabandt
50bfe8dd68
First commit to handle nvim specific async code 2017-08-23 18:31:43 +02:00
Christian Brabandt
a01d03a78a
branch: only do mq check once
but reset the check variable on Shell commands and when :AirlineRefresh
was called.

should make vim more performant

references #1536
2017-08-23 18:28:48 +02:00
Christian Brabandt
3ec22a524c
branch: comment why the argument is not used for update_hg_branch 2017-08-23 18:23:28 +02:00
Christian Brabandt
8cd7e35027
branch: correctly reset cache variables 2017-08-23 18:03:23 +02:00
Christian Brabandt
e553433430
branch: when mq is disabled, do not run hg qtop anymore 2017-08-23 18:01:41 +02:00
Christian Brabandt
5147d385a5
branch: cache filename path
fixes #1536
2017-08-23 17:56:57 +02:00
Christian Brabandt
232b6415d9
tagbar: do not error out, if autoloaded function does not exist
tagbar is not loaded if filetype plugin is off, so do not try to call a
non-existent function than.
2017-08-23 15:54:06 +02:00
Christian Brabandt
e8b6312dd9
Backout the wrong commit for checking async feature in nvim
fixes #1532
2017-08-21 22:22:19 +02:00
Christian Brabandt
04bc544db2
po: rename variable correctly and add g: prefix 2017-08-21 21:29:16 +02:00
Christian Brabandt
5fc5a43802
init: rename variable 2017-08-21 21:26:35 +02:00
Christian Brabandt
c2b2351d99
async: Better check for nvim
closes neovim/neovim#7186
2017-08-21 21:23:34 +02:00
Christian Brabandt
470e9870f1
highlighter: do not consider 0 to be empty
fixes #1531
2017-08-20 22:47:02 +02: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
Christian Brabandt
d8eb12845f
hunks: do not cache for changes plugin 2017-08-14 08:13:19 +02:00
Christian Brabandt
a8c4424244
highligthing: Enable cacheing only when config is set.
This enables the highlighting caching only when the variable
g:airline_highlighting_cache is set to 1

Should make airline faster and more performant, because we can save a
lot of expensive C core calls. However, when redefining highlighting
groups, it might not correctly reset the cache.
2017-08-14 08:06:53 +02:00
Christian Brabandt
a96681d459
highlighter: Cache syntax highlighting attributes
Should in theory improve performance by quiet a lot.
2017-08-11 11:26:35 +02:00
Christian Brabandt
e9a7a12d9e
highlighter: improve performance of get_array() function 2017-08-11 11:05:56 +02:00
Christian Brabandt
c65d7fe36b
highlighter: slight performance increase
do not access get() function twice. We can assign the result to a
variable and use it a second time. Should speed up the highligther part
of the code by a bit.

Since I was already touching s:Get(), also get rid of the default
parameter, as it always has been the empty string.
2017-08-11 10:46:03 +02:00
Christian Brabandt
2ec563bd57
syntastic: slightly tweak output format
also document how to use different syntastic statusline format

closes #1525
2017-08-08 14:57:04 +02:00
Christian Brabandt
83ceae726e
syntastic: display line number for errors/warnings
line number was omitted from 2e3055541e, so add it back
in parenthesis.

fixes #1525
2017-08-08 12:59:15 +02:00
tenfy
c0695feb13 Fixes #1515. The tabline will no update when use ctrlspace together.
Do not update tabline when the new buffer is no add to BufferList yes.
It will update by other event later.
2017-08-08 15:07:54 +08:00
Ryan Lue
039fd6b50f Fix airline#switch_matching_theme() to accommodate camelcased colorscheme names 2017-08-07 12:42:22 +08:00
Christian Brabandt
a2e20bc3ca
spell: Display spelling language
fixes: #1521
2017-08-01 19:25:20 +02: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