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

Add defx support #2282

Merged
merged 28 commits into from
Mar 10, 2019
Merged

Add defx support #2282

merged 28 commits into from
Mar 10, 2019

Conversation

wsdjeg
Copy link
Member

@wsdjeg wsdjeg commented Oct 28, 2018

PR Prelude

Thank you for working on SpaceVim! :)

Please complete these steps and check these boxes before filing your PR:

  • I have read and understood SpaceVim's CONTRIBUTING document.
  • I have read and understood SpaceVim's CODE_OF_CONDUCT document.
  • I have updated the Following-HEAD page for this PR.
  • I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps.

Why this change is necessary and useful?

The dark powered file explorer implementation

File tree navigation

Navigation is centered on the hjkl keys with the hope of providing a fast navigation experience like in vifm:

Key Bindings Descriptions vimfiler nerdtree defx
<F3> / SPC f t Toggle file explorer ok ok
with in file tree
<Left> / h go to parent node and collapse expanded directory ok ok
<Down> / j select next file or directory ok ok
<Up> / k select previous file or directory ok ok
<Right> / l open selected file or expand directory ok ok
N Create new file under corsor ok
y y Copy file full path to system clipboard ok
y Y Copy file to system clipboard ok
P Paste file to the position under the cursor ok
. toggle visible ignored files ok
s v Split edit ok
s g Vertical split edit ok
p Preview ok
i Switch to directory history ok
v Quick look ok
g x Execute with vimfiler associated ok
' Toggle mark current line ok
V Clear all marks ok
Ctrl-r Redraw ok

@ghost ghost assigned wsdjeg Oct 28, 2018
@ghost ghost added the WIP Work In Progress label Oct 28, 2018
@codecov
Copy link

codecov bot commented Oct 28, 2018

Codecov Report

Merging #2282 into master will decrease coverage by 1.92%.
The diff coverage is 22.82%.

@@            Coverage Diff             @@
##           master    #2282      +/-   ##
==========================================
- Coverage   27.46%   25.53%   -1.93%     
==========================================
  Files         286      277       -9     
  Lines       20404    13943    -6461     
==========================================
- Hits         5604     3561    -2043     
+ Misses      14800    10382    -4418

@wsdjeg wsdjeg merged commit 7179777 into SpaceVim:master Mar 10, 2019
@wsdjeg wsdjeg deleted the defx branch March 10, 2019 12:49
@Double1996
Copy link

Please add o for openfile with defx.

@marcopgordillo
Copy link

Please could you add this (./config/plugins/defx.vim) to move files between folders, thanks.

nnoremap <silent><buffer><expr> yM defx#do_action('call', g:defx_config_sid . 'DefxMoveFile')

function! s:DefxMoveFile(_) abort
  if !executable('xclip-cutfile') &&  !s:SYS.isWindows
    echohl WarningMsg
    echo 'you need to have xclip-cutfile in your PATH'
    echohl NONE
    return
  endif
  let candidate = defx#get_candidate()
  let filename = candidate['action__path']

  if executable('xclip-cutfile')
    call s:VCOP.systemlist(['xclip-cutfile', filename])
    if v:shell_error
      echohl WarningMsg
      echo 'failed to move file!'
      echohl NONE
    else
      echo 'Yanked:' . filename
    endif
  elseif s:SYS.isWindows
    let s:copyed_file_path = filename
    echo 'Yanked:' . filename
  endif
endfunction

@wsdjeg
Copy link
Member Author

wsdjeg commented Jul 3, 2021

@Double1996 @marcopgordillo please use new issue for feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work In Progress
Development

Successfully merging this pull request may close these issues.

3 participants