1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 22:20:06 +08:00
SpaceVim/config/plugins/vimfiler.vim

77 lines
2.8 KiB
VimL
Raw Normal View History

2016-12-26 21:11:19 +08:00
scriptencoding utf-8
let g:vimfiler_as_default_explorer = 1
let g:vimfiler_restore_alternate_file = 1
let g:vimfiler_tree_indentation = 1
let g:vimfiler_tree_leaf_icon = ''
let g:vimfiler_tree_opened_icon = '▼'
let g:vimfiler_tree_closed_icon = '▷'
let g:vimfiler_file_icon = ''
let g:vimfiler_readonly_file_icon = '*'
let g:vimfiler_marked_file_icon = '√'
"let g:vimfiler_preview_action = 'auto_preview'
let g:vimfiler_ignore_pattern = [
\ '^\.git$',
\ '^\.DS_Store$',
\ '^\.init\.vim-rplugin\~$',
\ '^\.netrwhist$',
\ '\.class$'
\]
if has('mac')
let g:vimfiler_quick_look_command =
\ '/Applications//Sublime\ Text.app/Contents/MacOS/Sublime\ Text'
else
let g:vimfiler_quick_look_command = 'gloobus-preview'
endif
call vimfiler#custom#profile('default', 'context', {
\ 'explorer' : 1,
\ 'winwidth' : 30,
\ 'winminwidth' : 30,
\ 'toggle' : 1,
\ 'columns' : 'type',
\ 'auto_expand': 1,
\ 'direction' : 'rightbelow',
\ 'parent': 0,
\ 'explorer_columns' : 'type',
\ 'status' : 1,
\ 'safe' : 0,
\ 'split' : 1,
\ 'hidden': 1,
\ 'no_quit' : 1,
\ 'force_hide' : 0,
\ })
augroup vfinit
2017-01-07 10:50:28 +08:00
au!
autocmd FileType vimfiler call s:vimfilerinit()
autocmd BufEnter * if (winnr('$') == 1 && &filetype ==# 'vimfiler') |
\ q | endif
2016-12-26 21:11:19 +08:00
augroup END
function! s:vimfilerinit()
set nonumber
set norelativenumber
2017-01-12 22:09:03 +08:00
silent! nunmap <buffer> <Space>
silent! nunmap <buffer> <C-l>
silent! nunmap <buffer> <C-j>
silent! nunmap <buffer> gr
silent! nunmap <buffer> gf
silent! nunmap <buffer> -
2017-01-12 23:08:06 +08:00
silent! nunmap <buffer> s
2017-01-12 22:09:03 +08:00
nnoremap <silent><buffer> gr :<C-u>Denite grep:<C-R>=<SID>selected()<CR> -buffer-name=grep<CR>
nnoremap <silent><buffer> gf :<C-u>Denite file_rec:<C-R>=<SID>selected()<CR><CR>
nnoremap <silent><buffer> gd :<C-u>call <SID>change_vim_current_dir()<CR>
nnoremap <silent><buffer><expr> sg vimfiler#do_action('vsplit')
nnoremap <silent><buffer><expr> sv vimfiler#do_action('split')
nnoremap <silent><buffer><expr> st vimfiler#do_action('tabswitch')
nmap <buffer> gx <Plug>(vimfiler_execute_vimfiler_associated)
nmap <buffer> ' <Plug>(vimfiler_toggle_mark_current_line)
nmap <buffer> v <Plug>(vimfiler_quick_look)
nmap <buffer> p <Plug>(vimfiler_preview_file)
nmap <buffer> V <Plug>(vimfiler_clear_mark_all_lines)
nmap <buffer> i <Plug>(vimfiler_switch_to_history_directory)
nmap <buffer> <Tab> <Plug>(vimfiler_switch_to_other_window)
nmap <buffer> <C-r> <Plug>(vimfiler_redraw_screen)
2016-12-26 21:11:19 +08:00
endf