Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is one of my favorite bits from my .vimrc. It lets you use !find with location list:

  function! g:Find(...)
      let subexpr = 'substitute(v:val, ".*", "\"&\" 0: found", "")'
      let found = join(map(split(system('find ' . join(a:000, ' ')), '\n'), subexpr), "\n")
      exec 'lgete "' fnameescape(found) '" | lop'
  endfunction

  command! -nargs=+ Find call g:Find(<f-args>)
The :Find command above passes its arguments to `find`.

I use splits heavily, and these mappings for navigating and resizing splits are indispensable:

  nnoremap <C-K> <C-W>k
  nnoremap <C-J> <C-W>j
  nnoremap <C-H> <C-W>h
  nnoremap <C-L> <C-W>l
  nnoremap _ 3<C-W><LT>
  nnoremap + 3<C-W>>


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: