Permalink
Switch branches/tags
Nothing to show
Find file Copy path
7c73456 Oct 11, 2018
2 contributors

Users who have contributed to this file

@Shougo @kristijanhusak
345 lines (262 sloc) 9.45 KB
*defx.txt* Dark powered file explorer for neovim/Vim8.
Version: 0.0
Author: Shougo <Shougo.Matsu at gmail.com>
License: MIT license
CONTENTS *defx-contents*
Introduction |defx-introduction|
Install |defx-install|
Interface |defx-interface|
Commands |defx-commands|
Functions |defx-functions|
Key mappings |defx-key-mappings|
Actions |defx-actions|
Options |defx-options|
Columns |defx-columns|
Examples |defx-examples|
FAQ |defx-faq|
Compatibility |defx-compatibility|
==============================================================================
INTRODUCTION *defx-introduction*
*defx* is the abbreviation of "dark powered file explorer".
==============================================================================
INSTALL *defx-install*
Note: defx requires Neovim 0.3.0+ or Vim8.1+ with Python3.6.1+.
Please install nvim-yarp plugin for Vim8.
https://github.com/roxma/nvim-yarp
Please install vim-hug-neovim-rpc plugin for Vim8.
https://github.com/roxma/vim-hug-neovim-rpc
1. Extract the files and put them in your Neovim or .vim directory
(usually `$XDG_CONFIG_HOME/nvim/`).
2. Execute the ":UpdateRemotePlugins" if Neovim.
If ":echo has('python3')" returns `1`, then you're done; otherwise, see below.
You can enable Python3 interface with pip: >
pip3 install neovim
Note: defx needs neovim-python ver.0.1.8+.
You need update neovim-python module.
>
pip3 install --upgrade neovim
<
If you want to read for Neovim-python/python3 interface install documentation,
you should read |provider-python| and the Wiki.
https://github.com/zchee/defx-jedi/wiki/Setting-up-Python-for-Neovim
You can check the Python3 installation by |:checkhealth| command in neovim.
==============================================================================
INTERFACE *defx-interface*
------------------------------------------------------------------------------
COMMANDS *defx-commands*
:Defx [{options}] {paths} *:Defx*
Creates a new Defx buffer.
------------------------------------------------------------------------------
FUNCTIONS *defx-functions*
defx#do_action({action}[, {args}]) *defx#do_action()*
Fire {action} action with {args}. You can find the actions
list in |defx-actions|.
{args} behavior depends on {action}.
Note: It is used to define mappings. >
------------------------------------------------------------------------------
KEY MAPPINGS *defx-key-mappings*
Defx does not provide any of default key mappings.
You need to define original key mappings by |defx#do_action()|.
------------------------------------------------------------------------------
ACTIONS *defx-actions*
cd *defx-action-cd*
Change the current directory.
Note: If the action args is empty, it means the home
directory.
Action args:
0. new current directory path
change_vim_cwd *change_vim_cwd*
Change current working directory to the current directory.
copy *defx-action-copy*
Copy the selected files to defx clipboard.
execute_system *defx-action-execute_system*
Execute the file by system associated command.
move *defx-action-move*
Move the selected files to defx clipboard.
new_directory *defx-action-new_directory*
Create a new directory.
new_file *defx-action-new_file*
Create a new file and directory if provided.
open *defx-action-open*
Open the file.
Action args:
0. open command(The default is |:edit|)
paste *defx-action-paste*
Fire the clipboard action in the current directory.
Note: It is used after |defx-action-copy| or |defx-action-move|.
print *defx-action-print*
Print the filename.
quit *defx-action-quit*
Quit the buffer.
redraw *defx-action-redraw*
Redraw the buffer.
rename *defx-action-rename*
Rename the file/directory under cursor or from selected list.
remove *defx-action-remove*
Delete the file/directory under cursor or from selected list
completely.
Note: You cannot undo the action.
remove_trash *defx-action-remove_trash*
Delete the file/directory under cursor or from selected list
to trashbox.
Note: Send2Trash module is needed for the action.
https://pypi.org/project/Send2Trash/
toggle_ignored_files *defx-action-toggle_ignored_files*
Toggle the enable state of ignored files.
toggle_select *defx-action-toggle_select*
Toggle the cursor candidate select.
toggle_select_all *defx-action-toggle_select_all*
Toggle the all candidates select.
yank_path *defx-action-yank_path*
Yank the all candidates path.
------------------------------------------------------------------------------
OPTIONS *defx-options*
*defx-option-no-*
-no-{option-name}
Disable {option-name} flag.
Note: If you use both {option-name} and -no-{option-name} in
the same denite buffer, it is undefined.
*defx-option-auto-cd*
-auto-cd
Change the working directory while navigating with defx.
Default: false
*defx-option-buffer-name*
-buffer-name={buffer-name}
Specify defx buffer name.
Default: "default"
*defx-option-columns*
-columns={columns1:columns2,...}
Specify defx columns.
Default: "mark:filename:type"
*defx-option-direction*
-direction={direction}
Specify the window direction as {direction} if
|defx-option-split| is set.
You can use "topleft" or "botright".
Default: ""
*defx-option-fnamewidth*
-fnamewidth={filename-width}
Specifies the filename width of a defx buffer.
*defx-option-listed*
-listed
Enable 'buflisted' option in defx buffer.
Default: false
*defx-option-new*
-new
Create new defx buffer.
Default: false
*defx-option-profile*
-profile
Enable profile feature.
Note: It is for debugging.
Default: false
*defx-option-search*
-search={path}
Search the {path}.
Default: ""
*defx-option-split*
-split={direction}
Specify the split direction.
"vertical": Split buffer vertically
"horizontal": Split buffer horizontally
"no": No split
"tab": Create the new tab
Default: "no"
*defx-option-toggle*
-toggle
Close defx buffer window if this defx window exists.
Default: false
*defx-option-winheight*
-winheight={window-height}
Set the height of the window if |defx-option-split| is
"horizontal".
Default: 0
*defx-option-winwidth*
-winwidth={window-width}
Set the width of the window if |defx-option-split| is
"vertical".
Default: 0
------------------------------------------------------------------------------
COLUMNS *defx-columns*
*defx-column-filename*
filename File name.
*defx-column-mark*
mark File selected mark.
*defx-column-type*
type File type.
==============================================================================
DENITE SOURCES *defx-denite-sources*
*denite-source-defx/history*
defx/history Gather defx histories.
==============================================================================
EXAMPLES *defx-examples*
>
autocmd FileType defx call s:defx_my_settings()
function! s:defx_my_settings() abort
" Define mappings
nnoremap <silent><buffer><expr> <CR>
\ defx#do_action('open')
nnoremap <silent><buffer><expr> c
\ defx#do_action('copy')
nnoremap <silent><buffer><expr> m
\ defx#do_action('move')
nnoremap <silent><buffer><expr> p
\ defx#do_action('paste')
nnoremap <silent><buffer><expr> l
\ defx#do_action('open')
nnoremap <silent><buffer><expr> E
\ defx#do_action('open', 'vsplit')
nnoremap <silent><buffer><expr> P
\ defx#do_action('open', 'pedit')
nnoremap <silent><buffer><expr> K
\ defx#do_action('new_directory')
nnoremap <silent><buffer><expr> N
\ defx#do_action('new_file')
nnoremap <silent><buffer><expr> d
\ defx#do_action('remove')
nnoremap <silent><buffer><expr> r
\ defx#do_action('rename')
nnoremap <silent><buffer><expr> x
\ defx#do_action('execute_system')
nnoremap <silent><buffer><expr> yy
\ defx#do_action('yank_path')
nnoremap <silent><buffer><expr> .
\ defx#do_action('toggle_ignored_files')
nnoremap <silent><buffer><expr> h
\ defx#do_action('cd', ['..'])
nnoremap <silent><buffer><expr> ~
\ defx#do_action('cd')
nnoremap <silent><buffer><expr> q
\ defx#do_action('quit')
nnoremap <silent><buffer><expr> <Space>
\ defx#do_action('toggle_select') . 'j'
nnoremap <silent><buffer><expr> *
\ defx#do_action('toggle_select_all')
nnoremap <silent><buffer><expr> j
\ line('.') == line('$') ? 'gg' : 'j'
nnoremap <silent><buffer><expr> k
\ line('.') == 1 ? 'G' : 'k'
nnoremap <silent><buffer><expr> <C-l>
\ defx#do_action('redraw')
nnoremap <silent><buffer><expr> <C-g>
\ defx#do_action('print')
nnoremap <silent><buffer><expr> cd
\ defx#do_action('change_vim_cwd')
endfunction
<
==============================================================================
FREQUENTLY ASKED QUESTIONS (FAQ) *defx-faq*
Q: I want to explore the folder where the current file is.
A: >
Defx `expand('%:p:h')` -search=`expand('%:p')`
Q: I want to open defx window like explorer.
A: >
Defx -split=vertical -winwidth=50 -direction=topleft
Q: I want to open file like vimfiler explorer mode.
A: >
nnoremap <silent><buffer><expr> <CR>
\ defx#do_action('open', 'wincmd w \| drop')
==============================================================================
COMPATIBILITY *defx-compatibility*
==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:noet: