暗黒さんのデフェックス defx　アイコン付きで、みたく

# Summary

暗黒さんの`defx`をアイコン付きで

## 環境

```bash
(ins)$ uname -a
Darwin callmekoheis-MacBook-Air.local 18.6.0 
Darwin Kernel Version 18.6.0
: Thu Apr 25 23:16:27 PDT 2019
; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
```

### 必要なフォント

```bash
$ brew cask install font-droidsansmono-nerd-font
```

### 必要なプラグイン

```bash
git clone --depth 1 https://github.com/Shougo/defx.nvim
git clone --depth 1 https://github.com/kristijanhusak/defx-icons
git clone --depth 1 https://github.com/ryanoasis/vim-devicons
```

### vimrc

```vimscript

  autocmd MyAutoCmd VimEnter * call s:foofoo()

  function s:foofoo()
    call defx#custom#option('_', {
        \ 'columns': 'icons:filename',
        \ })
  endfunction
```

### vimrc

ショートカット的な

```vim

" defxのヘルプをそのまま使う ( 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> o
	  \ defx#do_action('open_or_close_tree')
	  nnoremap <silent><buffer><expr> K
	  \ defx#do_action('new_directory')
	  nnoremap <silent><buffer><expr> N
	  \ defx#do_action('new_file')
	  nnoremap <silent><buffer><expr> M
	  \ defx#do_action('new_multiple_files')
	  nnoremap <silent><buffer><expr> C
	  \ defx#do_action('toggle_columns',
	  \                'mark:indent:icon:filename:type:size:time')
	  nnoremap <silent><buffer><expr> S
	  \ defx#do_action('toggle_sort', 'time')
	  nnoremap <silent><buffer><expr> d
	  \ defx#do_action('remove')
	  nnoremap <silent><buffer><expr> r
	  \ defx#do_action('rename')
	  nnoremap <silent><buffer><expr> !
	  \ defx#do_action('execute_command')
	  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> ;
	  \ defx#do_action('repeat')
	  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
```

### こんな感じ

フォルダに移動して`vim`を立ち上げる

![Screen Shot 2019-07-13 at 12.13.50.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/149269/8b79e8f2-2286-3489-8650-72cd03452f8b.png)

`Defx`

![Screen Shot 2019-07-13 at 12.13.56.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/149269/ccd6c326-c47e-f8f8-36c2-4f3249de1d81.png)


ファイルが一覧される

![Screen Shot 2019-07-13 at 12.13.59.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/149269/9b1464f8-daf5-aa82-193e-7c237860376b.png)

フォルダの上で'o'を押す

![Screen Shot 2019-07-13 at 12.14.04.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/149269/5f8378ae-c7ef-d47a-77e7-9bbfb5dbe551.png)


ファイルの上でにカーソルをもってくる 'j'

![Screen Shot 2019-07-13 at 12.14.10.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/149269/266437f2-7c8d-3aa2-5db8-d73db2b42941.png)


リターン

![Screen Shot 2019-07-13 at 12.14.14.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/149269/3b83973b-1425-52af-9f76-352c807bae64.png)

### その他

ウインドウズでやるときはフォントを`Cica`フォントにするとでました！

![Screen Shot 2019-07-16 at 1.22.21.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/149269/3ed46e65-aa2c-f0ae-ebe7-e023461481e2.png)