" fzf - the fuzzy finder of all the things Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' let g:fzf_files_options = \ '--reverse ' . \ '--preview "(coderay {} || cat {}) 2> /dev/null | head -'.&lines.'"' let g:fzf_layout = { 'down': '~60%' } nnoremap :Files let $FZF_DEFAULT_COMMAND = 'ag -g "" --hidden --ignore .git' " let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6, 'highlight': 'Todo', 'border': 'sharp' } } " " Creates a floating window with a most recent buffer to be used " function! CreateCenteredFloatingWindow() " let width = float2nr(&columns * 0.75) " let height = float2nr(&lines * 0.6) " let top = ((&lines - height) / 2) - 1 " let left = (&columns - width) / 2 " let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'} " let top = "╭" . repeat("─", width - 2) . "╮" " let mid = "│" . repeat(" ", width - 2) . "│" " let bot = "╰" . repeat("─", width - 2) . "╯" " let lines = [top] + repeat([mid], height - 2) + [bot] " let s:buf = nvim_create_buf(v:false, v:true) " call nvim_buf_set_lines(s:buf, 0, -1, v:true, lines) " call nvim_open_win(s:buf, v:true, opts) " set winhl=Normal:Floating " let opts.row += 1 " let opts.height -= 2 " let opts.col += 2 " let opts.width -= 4 " call nvim_open_win(nvim_create_buf(v:false, v:true), v:true, opts) " au BufWipeout exe 'bw '.s:buf " endfunction " function! OpenTerm(cmd) " call CreateCenteredFloatingWindow() " call termopen(a:cmd, { 'on_exit': function('OnTermExit') }) " endfunction " let g:fzf_layout = { 'window': 'call CreateCenteredFloatingWindow()' } nnoremap ga :Files app/ nnoremap gm :Files app/models/ nnoremap gv :Files app/views/ nnoremap gc :Files app/controllers/ nnoremap gy :Files app/assets/stylesheets/ nnoremap gj :Files app/assets/javascripts/ nnoremap gs :Files spec/ nnoremap . :Files %:p:h " vim:ft=vim