-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use the terminal by default for nvim-0.2.1 or GVim (nightly) #1019
Conversation
Thanks! |
Using the same |
|
|
Because |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick thought which popped into my head...
Rather than having my name in the commit message, I think it makes more sense to rewrite this commit so I'm the author and you're the committer. It doesn't matter that much but it will make the Git history a little more complete / correct. Also, if you can be bothered, you might want to also prefix this with [neovim]
(I realise I should've done this before so I'm kind of passing the buck, sorry).
EDIT: I thought this was per-commit, but of course I'm talking about the commit I initially wrote.
@mikesmiffy128 Is commit 7d91ecd how you want it? It's the first time I've amended the commit author. |
LGTM 👍 |
Wow this works pretty well with the latest macvim, thanks!
@janlazo Do you think it's ready for merge? |
Yes, for Neovim. No issues yet with fzf.vim commands in About your comment for terminal Vim on Windows, |
Original Patch: junegunn@a9bf29b
Requirements: - compiled with +terminal - has patch-8.0.995 - has('gui_running') returns 1
Related commit is mattn/vim-fz@ecf5fc3, but there's no explanation. I did some quick tests and it looks like we don't need it. The associated channel is actually open during function! E(...)
echom 'exit '.job_getchannel(term_getjob(g:buf))
endfunction
function! C(...)
echom 'close '.job_getchannel(term_getjob(g:buf))
endfunction
let g:buf = term_start('fzf', {'exit_cb': function('E'), 'close_cb': function('C')}) Maybe it was to deal with some bugs of Vim terminal? I don't know. But let's not add it until we actually run into an issue. By the way, Macvim I tested with did not have CTRL-J/CTRL-M issue (vim/vim#1998), but it may pop up in the future. If I recall correctly, terminal Vim did not have the problem when I first tried its terminal a few weeks ago. |
vim-fz's initial commit has No issues with Ctrl mappings (ie. Ctrl-S, Ctrl-D, Ctrl-J, Ctrl-M) so far. |
I'm experiencing |
We can merge but I recommend not making a release yet so we can make adjustments to the patch requirements and fix other quirks. Can you give me more time? I like to use |
No problem! Just let me know when you think it's ready for merge.
I was thinking about pushing a new tag like 0.17.0-1 that only updates auxiliary scripts because I made a stupid mistake before releasing 0.17.0. Thought it would be a good idea to include this, so that many users can test it and give us feedbacks, but no hurries. I'll proceed without this. |
IMPORTANT: cmd.exe and powershell are fine in default Windows terminal. cmd.exe prompt is broken on ConEmu because it natively supports ucs-2 only. utf-16 support is exclusive to .Net (ie. powershell). utf-8 supports requires chcp, external program, but does not fix the cmd.exe prompt. Use powershell on ConEmu to avoid corrupted text on display
I think we're good to go for user testing. |
|
Yes, I noticed that too, thanks. The reason I'm hesitating to merge this is that I'm actually running into CTRL-J/CTRL-M issue on Macvim. Enter key doesn't work occasionally, and I have to terminate fzf with CTRL-C, or reach to trackpad to double-click on an item, which is really awkward and I figure many users don't even know that fzf supports mouse. I think this is not a trivial issue that we can just tell the users to deal with it for the moment. And I'm thinking if we should force-append |
" in fzf#run, before running s:execute_term
if use_height
let height = s:calc_size(&lines, dict.down, dict)
let optstr .= ' --height='.height
elseif use_term
let optstr .= ' --no-height'
if !has('nvim') && !s:is_win
let optstr .= ' --bind ctrl-j:accept'
endif
endif
let command = prefix.(use_tmux ? s:fzf_tmux(dict) : fzf_exec).' '.optstr.' > '.temps.result |
Do we need to bind Ctrl-M too? |
Yes, I can confirm that this works. We should add a comment that it's a temporary workaround.
No, it's already mapped to |
Temporary workaround for non-Windows environment Reference: vim/vim#1998 junegunn#1019 (comment)
Merged, thank you! Let's see how it turns out. |
His this fix supposed to work in GVim ? With default fzf.vim options i am still getting the external window ? (https://user-images.githubusercontent.com/7561038/30072423-3931d688-9238-11e7-8e66-8e4becd8f2ea.png) |
Did you upgrade Vim (and GVim) to version 8.0.995 or greater? |
The upgrade seems to have done the job ! Thank you Is there a way to set the terminal color and font in this patch ? |
Not yet. |
It is possible to support font size if running the bang version like I'm not sure about the terminal color because fzf has |
By setting 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'] } |
@janlazo Oh it does. This looks pretty silly but effectively fixes the problem. tnoremap <buffer> <c-m> <c-m> We could add something like if !has('nvim') && has('patch-8.0.1108')
tnoremap <buffer> <c-m> <c-m>
endif to the code, but let me report this workaround to Vim issue tracker first. |
@janlazo Hmm, looks like I was mistaken. The problem was resolved not by the use of the tnoremap, but by my action of exiting normal mode ( |
You mean exiting terminal mode (or normal mode of the terminal buffer) after |
Yes, it is reported in vim/vim#1998 (comment) that Vim correctly interprets keys only after some events, and exiting terminal mode seems to be one of them. |
@junegunn I see that in |
@lifepillar Hi, thanks for the comment. I can confirm that the workaround works for me too. But I'm not too confident that it's a reliable solution that will work for everybody. |
Initial work to use the neovim terminal by default in Windows.
The double keypress remains for Windows 8+ because gdamore/tcell#159 is unresolved.
I prefer to keep this open/unmerged until the 0.2.1 release while I test this with my pull requests in fzf.vim.
@mikesmiffy128 I cherry-pick the commit as you suggested in #962 (comment)