Opening and switching between buffers/ files is very related. Often you want to edit a file and don't care about whether you've previously opened it. There are many ways to help with it
auto-create-directories-before-writing
typing ctrl-o: open last file (after restarting vim) :e/n **/*foo.txt<c-d> or <tab> to find a file :enew|r!find<cr> then gf/gF on a file " this is very useful, because typing some characters and <tab> expanding is enough: set wildcharm=<tab> map lhs :b<space><tab>
The_NERD_tree is popular, because it has a tree view.
Is as easy as doing such:
" simple glob open based on tlib's List function (similar to TCommand or fuzzy " plugin etc) " don't ask me why glob() from Vim is that slow .. :( " one reason is that it doesn't follow symlinks (unless you pass -L to find) " of course you can use Vim's glob instead .. fun! FastGlob(glob) let g = '^'.a:glob.'$' let replace = {'': '.*','*': '[^/\\]*','.': '\.'} let g = substitute(g, '\(\*\*\|\*\|\.\)', '\='.string(replace).'[submatch(1)]','g') let cmd = 'find | grep -e '.shellescape(g) " let exclude = a:exclude_pattern == ''? '' : ' | grep -v -e '.shellescape(a:exclude_pattern) " let cmd .= exclude return system(cmd) endfun noremap \go :exec 'e '. fnameescape(tlib#input#List('s','select file', split(FastGlob(input('glob pattern, curr dir:','/*')),"\n") ))<cr>
Opening files you used recently fast: