tpope / vim-vinegar

vinegar.vim: Combine with netrw to create a delicious salad dressing
https://www.vim.org/scripts/script.php?script_id=5671
2.23k stars 87 forks source link

Using H and L for navigation #89

Open superDuperCyberTechno opened 6 years ago

superDuperCyberTechno commented 6 years ago

Wouldn't it make sense to have h working as - and l working as <enter>? At least as alternative keybindings? Exactly as ranger does it, basically.

michaelmob commented 6 years ago

Here's one method for this.

Add this function:

function! NetrwBuf()
  nmap <buffer> h -
  nmap <buffer> l <CR>
endfunction

Add this autocmd to an augroup to run for each netrw buffer

augroup FILETYPES
  autocmd FileType netrw call NetrwBuf()
augroup END

Now it behaves sort of like ranger