LINUX.ORG.RU

История изменений

Исправление bryak, (текущая версия) :

Спасибо, а то я уже костылить начал:

function! MyNextParagraph()
  let lastline = line('$')
  let myline = search('^\s*$', 'W')
  while matchend(getline(myline), '.*\S')-1 < 0
      if myline != lastline
          let myline += 1
      else
          break
      endif
  endwhile
  execute 'normal! '.myline.'G0'
endfunction

function! MyPrevParagraph()
    let lastline = line('$')
    let myline = search('^\s*$', 'bW')
    while matchend(getline(myline), '.*\S')-1 < 0
        if myline != 0
            let myline -= 1
        else
            break
        endif
    endwhile
    execute 'normal! '.myline.'G0'
endfunction

PS: set whichwrap+=b,s вроде ж по дефолту стоит

Исходная версия bryak, :

Спасибо, а то я уже костылить начал:

function! MyNextParagraph()
  let lastline = line('$')
  let myline = search('^\s*$', 'W')
  while matchend(getline(myline), '.*\S')-1 < 0
      if myline != lastline
          let myline += 1
      else
          break
      endif
  endwhile
  execute 'normal! '.myline.'G0'
endfunction

function! MyPrevParagraph()
    let lastline = line('$')
    let myline = search('^\s*$', 'bW')
    while matchend(getline(myline), '.*\S')-1 < 0
        if myline != 0
            let myline -= 1
        else
            break
        endif
    endwhile
    execute 'normal! '.myline.'G0'
endfunction