Skip to content

Commit

Permalink
Add filetype blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarWatcher committed Jan 26, 2021
1 parent 7402136 commit ed8cc5b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Added
* `g:AutoPairsMultilineCloseDeleteSpace`
* `g:AutoPairsMultibyteFastWrap` -- fast wrap now supports multibyte pairs
* `g:AutoPairsFiletypeBlacklist`

## Fixed

Expand Down
3 changes: 2 additions & 1 deletion autoload/autopairs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ call s:define('g:AutoPairsSingleQuoteBalanceCheck', 1)
" (Pro tip: also a great use for autocmds and default-disable rather than
" plugin configuration. Project .vimrcs work too)
call s:define('g:AutoPairsDirectoryBlacklist', [])
call s:define('g:AutoPairsFiletypeBlacklist', [])

" Olivia: set to 0 based on my own personal biases
call s:define('g:AutoPairsMapBS', 0)
Expand Down Expand Up @@ -892,7 +893,7 @@ func! autopairs#AutoPairsTryInit()
if type(g:AutoPairsInitHook) == 2
call g:AutoPairsInitHook()
endif
if index(g:AutoPairsDirectoryBlacklist, getcwd()) >= 0
if index(g:AutoPairsDirectoryBlacklist, getcwd()) >= 0 || index(g:AutoPairsFiletypeBlacklist, &ft) != -1
let b:autopairs_enabled = 0
endif

Expand Down
11 changes: 11 additions & 0 deletions doc/AutoPairs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,17 @@ would be unpredictable.
If a multibyte pair or a normal pair isn't found, it'll fall back to standard
behavior and assume the next character is what you want to wrap.

------------------------------------------------------------------------------
*g:AutoPairsFiletypeBlacklist*
|g:AutoPairsFiletypeBlacklist| array

Default: []

List containing filetypes in which autopairs is disabled by default. Note that
the keybinds and whatnot are loaded due to how the plugin is built up. This
may change in a future version. The plugin may be manually enabled in spite of
this blacklist. See |g:AutoPairsShortcutToggle|

==============================================================================
6. Troubleshooting *autopairs-troubleshooting*

Expand Down

0 comments on commit ed8cc5b

Please sign in to comment.