Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8349055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:52:42+00:00 2026-06-09T07:52:42+00:00

I have been trying this now for about an hour and I can’t seem

  • 0

I have been trying this now for about an hour and I can’t seem to get it to work at all! ha ha

This is what I have:

function! Tabber()
let l2=getline(".")
if l2[:2] == 'To:'
    if len(l2) > 4
        exe "silent! normal 5Gi"
    else
        exe "silent! normal 2Gi"
    endif
endif
startinsert
endfunction

Basically when I’m writing an email in VIM for mutt I want to be able to hit the Tab key when done writing the To: address and I want it to decide if the line I’m on has To: on it, then if it’s more than 4 character’s that mean’s I have an address entered, if not then stay there. If there are more than 4 goto line 5 which is the subject line.

Once done there I want to copy that If for a Subject line to make sure if I’m on the subject line goto line 9 to write the email. So I can just tab my way down ha ha.

For the life of me it won’t work. Of course I don’t have it connected to tab yet, I am just <Esc>ing out and then:

:call Tabber()

But that should work. :S

Thanks! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:52:44+00:00Added an answer on June 9, 2026 at 7:52 am

    Your function does work for me, so I’m not sure why you’re having trouble with it without some more information. I did modify it though to fit your specifications:

    function! Tabber()
       let line=getline(".")
       if line[:2] == 'To:'
          if len(line) > 4 | 5 | endif
       elseif line[:7] == 'Subject:'
          if len(line) > 9 | 9 | endif
       endif
       startinsert!
    endfunction
    inoremap <Tab> <Esc>:call Tabber()<cr>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying this all day now, and I am about ready to
I have been trying to days now to get this website completed ... however,
I have been trying for about an hour now to find an elegant solution
I've been trying to figure this issue out for about an hour now. I've
I have been trying for about a day now to get an xml feed
I have been trying to get this my damned layout to work for so
I have been trying to get this seemingly simple problem fixed for about half
For about a week now I have been trying to get a view to
So I have been trying and battling with this for a few hours now.
Been trying to find this online for a while now. I have a SDL_Surface

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.