Last active
May 31, 2022 14:35
-
-
Save dezza/e11a2825529011519e4588d170895f20 to your computer and use it in GitHub Desktop.
Its magic π§ββοΈβ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if has('viminfo') && !empty(&viminfo) | |
" Ignore paths, such as :help files | |
set viminfo+=r/usr/share/vim/vim81/doc | |
endif | |
set viminfofile=$HOME/.vim/viminfo | |
function! Oldfiles() | |
rviminfo! | |
enew | |
execute "0put =v:oldfiles" | |
normal! Gdd | |
set buftype=nofile | |
setlocal nomodifiable | |
setlocal nobuflisted | |
nnoremap <buffer> <CR> :e <C-r>=getline('.')<CR><CR><CR>:0<CR> | |
endfunction | |
nnoremap <leader>o :call Oldfiles()<CR> | |
if has('autocmd') | |
augroup vimrc | |
autocmd! | |
autocmd BufReadPost * wviminfo " Oldfiles() | |
augroup END | |
endif | |
" nnoremap <leader>o :call Oldfiles()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment