lambdalisue / vim-fern-git-status

🌿 Add Git status badge integration on file:// scheme on fern.vim
MIT License
87 stars 6 forks source link

Support Windows #10

Closed RnYi closed 3 years ago

RnYi commented 3 years ago

I startup vim and neovim with a minimal vimrc, still couldn't show git status. VIMRC is below:

if has('vim_starting')
  set nocompatible
endif
set packpath=
set runtimepath+=\~/vimfiles/plugged/fern.vim
set runtimepath+=\~/vimfiles/plugged/fern-plugin-git.vim
filetype plugin indent on
syntax on
nnoremap \<silent> <Leader>e :Fern . -drawer -keep -toggle\<CR>
lambdalisue commented 3 years ago

What is your Vim/Neovim/OS version and how did you try?

RnYi commented 3 years ago

I tried on Vim 8.2, Neovim 0.4.4 and Neovim nightly with a minimal vimrc. Then I entered a directory and modified a file, no signs showed on fern buffer. My OS is Win10 20H2. The minimal vimrc is below:

call plug#begin()
    Plug 'lambdalisue/fern.vim'
    Plug 'lambdalisue/fern-git-status.vim'
call plug#end()

if has('vim_starting')
  set nocompatible
endif
filetype plugin indent on
syntax on
let g:mapleader="\<Space>"

" Fern
function! s:init_fern() abort
    setlocal nonu
    nmap <buffer><expr>
                \ <Plug>(fern-my-open-or-expand-or-collapse)
                \ fern#smart#leaf(
                \   "\<Plug>(fern-action-open)",
                \   "\<Plug>(fern-action-expand:stay)",
                \   "\<Plug>(fern-action-collapse)",
                \ )
    nmap <buffer><silent> e    <Plug>(fern-action-open:tabedit)
    nmap <buffer><silent> o    <Plug>(fern-my-open-or-expand-or-collapse)
    nmap <buffer><silent> go   <Plug>(fern-action-open:edit)<C-w>p
    nmap <buffer><silent> t    <Plug>(fern-action-open:tabedit)
    nmap <buffer><silent> T    <Plug>(fern-action-open:tabedit)gT
    nmap <buffer><silent> ma   <Plug>(fern-action-new-path)
    nmap <buffer><silent> mc   <Plug>(fern-action-copy)
    nmap <buffer><silent> md   <Plug>(fern-action-trash)
    nmap <buffer><silent> mm   <Plug>(fern-action-move)
    nmap <buffer><silent> mr   <Plug>(fern-action-rename)

    nmap <buffer><silent> cc   <Plug>(fern-action-clipboard-copy)
    nmap <buffer><silent> cp   <Plug>(fern-action-clipboard-paste)
    nmap <buffer><silent> cm   <Plug>(fern-action-clipboard-move)
    nmap <buffer><silent> cr   <Plug>(fern-action-clipboard-clear)
    nmap <buffer><silent> l    <Plug>(fern-action-enter)
    nmap <buffer><silent> h    <Plug>(fern-action-leave)
    nmap <buffer><silent> r    <Plug>(fern-action-reload)
    nmap <buffer><silent> x    <Plug>(fern-action-collapse)
    nmap <buffer><silent> R  gg<Plug>(fern-action-reload)<C-o>
    nmap <buffer><silent> cd   <Plug>(fern-action-tcd:cursor)
    nmap <buffer><silent> CD <Cmd>Fern . -drawer -keep<CR>

    nmap <buffer><silent> -    <Plug>(fern-action-mark:toggle)
    nmap <buffer><silent> _    <Plug>(fern-action-mark:clear)
    nmap <buffer><silent> I    <Plug>(fern-action-hidden:toggle)

    nmap <buffer><silent> q <Cmd>quit<CR>
endfunction
augroup fern-custom
    autocmd! *
    autocmd FileType fern call s:init_fern()
augroup END
nnoremap <silent> <Leader>e <Cmd>Fern . -drawer -keep -toggle<CR>

Screenshots: 屏幕截图 2021-01-17 210520 屏幕截图 2021-01-17 210738

I modeified "vimrc", but nothing happended.

lambdalisue commented 3 years ago

Is git command accessible from your GVim? Confirm it by

:echo executable('git')
RnYi commented 3 years ago

Is git command accessible from your GVim? Confirm it by

:echo executable('git')

Yes, it prints "1".

lambdalisue commented 3 years ago

Do you see anything when you hit :message? I don't have Windows + Git + Fern environment thus it's a bit difficult to debug .

RnYi commented 3 years ago

Do you see anything when you hit :message? I don't have Windows + Git + Fern environment thus it's a bit difficult to debug .

I hit :messages, output is below: 屏幕截图 2021-01-18 131351 Translate it in English:Simplified Chinese message maintainer:Yuheng Xie <elephant@linux.net.cn>. It seems not helpful...

lambdalisue commented 3 years ago

I've asked other users who use Windows as well and they don't see the columns as well so it seems there are bug on Windows.

lambdalisue commented 3 years ago

@RnYi Please try #12

RnYi commented 3 years ago

@RnYi Please try #12

Solved! Thank you!