Skip to content

Commit

Permalink
Rename enable_fuzzyy_keymaps to fuzzyy_enable_mappings
Browse files Browse the repository at this point in the history
- fuzzyy options should really be prefixed with fuzzyy_
- use "mappings" to avoid confusion with fuzzy_keymaps
  • Loading branch information
mmrwoods committed Nov 29, 2024
1 parent 8f6a510 commit 2c30337
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ you can set `g:fuzzyy_keymaps` to change these defaults.

## Default Keymaps

you can set `g:enable_fuzzyy_keymaps = 0` to disable default keymaps
you can set `g:fuzzyy_enable_mappings = 0` to disable default mappings

```vim
nnoremap <silent> <leader>fb :FuzzyInBuffer<CR>
Expand All @@ -101,7 +101,7 @@ nnoremap <silent> <leader>fm :FuzzyMRUFiles<CR>
```vim
" Set to 0 to disable default keybindings
" Default to 1
let g:enable_fuzzyy_keymaps = 0
let g:fuzzyy_enable_mappings = 0
" Make FuzzyFiles respect .gitignore if possible
" only work when
Expand Down
10 changes: 8 additions & 2 deletions plugin/fuzzyy.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ if exists("g:loaded_fuzzyy")
endif
g:loaded_fuzzyy = 1

g:enable_fuzzyy_keymaps = exists('g:enable_fuzzyy_keymaps') ? g:enable_fuzzyy_keymaps : 1
# Deprecated options
if exists('g:enable_fuzzyy_keymaps')
echo 'fuzzyy: g:enable_fuzzyy_keymaps is deprecated, use g:fuzzyy_enable_mappings'
g:fuzzyy_enable_mappings = g:enable_fuzzyy_keymaps
endif

g:fuzzyy_enable_mappings = exists('g:fuzzyy_enable_mappings') ? g:fuzzyy_enable_mappings : 1
g:fuzzyy_buffers_exclude = exists('g:fuzzyy_buffers_exclude') ? g:fuzzyy_buffers_exclude
: ['__vista__']

Expand Down Expand Up @@ -76,7 +82,7 @@ command! -nargs=0 FuzzyGitFiles files.Start(windows.FuzzyFiles, 'git ls-files')
command! -nargs=0 FuzzyCmdHistory cmdhistory.Start()
command! -nargs=0 FuzzyMRUFiles mru.Start(windows.FuzzyMRUFiles)

if g:enable_fuzzyy_keymaps
if g:fuzzyy_enable_mappings
nnoremap <silent> <leader>fb :FuzzyInBuffer<CR>
nnoremap <silent> <leader>fc :FuzzyColors<CR>
nnoremap <silent> <leader>fd :FuzzyHelps<CR>
Expand Down

0 comments on commit 2c30337

Please sign in to comment.