If you wish to use Gmail via IMAP, it's important to keep in mind some specialties in how Gmail handles IMAP. This is especially important if you use the priority inbox to filter important emails for you.
What you would do in Gmail | What you do in the mail client
- Archive email | Delete the email (but do not move it into the trash folder)
- Mark the email not important | Move the email from impotant to all mails or the inbox
- Add a label | Copy the email to the folder
- Remove a label | Delete an email from a folder (but do not move it to the trash folder)
- Delete an email | Move it to the trash folder (you may also delete it from the current folder).
If you want to search your emails via IMAP, you will usually want to search inside the folder all mails. Note that unless you use special extensions the search in my tests only works for exact matches in the subject line. It does not find anything else, e.g. email addresses or content.
I hope that helps!