Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve fzf #282

Merged
merged 4 commits into from
Apr 3, 2018
Merged

improve fzf #282

merged 4 commits into from
Apr 3, 2018

Conversation

pittcat
Copy link
Contributor

@pittcat pittcat commented Apr 3, 2018

No description provided.

@pittcat pittcat changed the title improve fzf and fix ctrl arrows conflix in tmux improve fzf and fix ctrl arrows conflict in tmux Apr 3, 2018
command! Sessions call s:sessions()
nnoremap <silent> <leader>sf :Sessions<cr>

let g:fzf_colors =
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g:fzf_colors has been already configured, see

let g:fzf_colors = g:spacevim#plug#fzf#colors
.

\})
endfunction
command! Sessions call s:sessions()
nnoremap <silent> <leader>sf :Sessions<cr>
Copy link
Owner

@liuchengxu liuchengxu Apr 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this block, s:sessions(), to core/autoload/spacevim/plug/fzf.vim, i.e., spacevim#plug#fzf#Session().

nnoremap <silent> <Leader>fs :call spacevim#plug#fzf#Session()<CR>

What's more, no need to define Sessions command.

@liuchengxu
Copy link
Owner

liuchengxu commented Apr 3, 2018

Last but not the least, please split this single PR into 2. One PR for tmux specific and the other for fzf related.

@pittcat pittcat changed the title improve fzf and fix ctrl arrows conflict in tmux improve fzf Apr 3, 2018
@pittcat
Copy link
Contributor Author

pittcat commented Apr 3, 2018

it seems like that "leader fs " has been mapped.
better-defaults

\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
" }

function! s:spacevim#plug#fzf#Session()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove s:, s:spacevim#plug#fzf#Session() -> spacevim#plug#fzf#Session().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry

@@ -190,6 +190,34 @@ function! s:align_lists(lists)
return a:lists
endfunction

autocmd VimEnter * command! -bang -nargs=* Ag
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autocmd VimEnter * is useless in the autoload mechanism. So, remove autocmd VimEnter *.

@pittcat
Copy link
Contributor Author

pittcat commented Apr 3, 2018

To be honest,use the custom fzf colors maybe more reasonable,as follow,
" Customize fzf colors to match your color scheme
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment']
,because if you set other colortheme ,the object which is matched by fzf looks like vague.

@liuchengxu
Copy link
Owner

liuchengxu commented Apr 3, 2018

Yeah, space-vim only guarantee the default g:fzf_colors is suitable for space-vim-dark.

" Only suitable for space-vim-dark theme, other themes are not guaranteed.
let g:spacevim#plug#fzf#colors = {
\ 'fg': ['fg', 'StatusLineNC'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'String'],
\ 'fg+': ['fg', 'Number', 'Normal'],
\ 'bg+': ['bg', 'StatusLine', 'Normal'],
\ 'hl+': ['fg', 'Exception'],
\ 'info': ['fg', 'Special'],
\ 'prompt': ['fg', 'Function'],
\ 'pointer': ['fg', 'Error'],
\ 'marker': ['fg', 'Error'],
\ 'spinner': ['fg', 'Statement'],
\ 'header': ['fg', 'Number'],
\ }

User can override g:fzf_colors in UserConfig if it looks strange.

@pittcat
Copy link
Contributor Author

pittcat commented Apr 3, 2018

Ok,it's uncontroversial any more.

@liuchengxu liuchengxu merged commit 8b5365f into liuchengxu:master Apr 3, 2018
@liuchengxu
Copy link
Owner

Merged, thanks!

alvin2ye pushed a commit to alvin2ye/space-vim that referenced this pull request Jan 31, 2019
* improve fzf and fix ctrl arrows conflix in tmux

* improve fzf

* improve fzf

* improve fzf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants