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 1052785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:09:00+00:00 2026-05-16T17:09:00+00:00

I have some character maps for typing braces that I’d like to behave differently

  • 0

I have some character maps for typing braces that I’d like to behave differently based on the file’s extension – I imagine that would be pretty useful ability to have in general.

Any ideas on how to make this happen from my .vimrc or a plugin?

Thank you!

  • 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-05-16T17:09:01+00:00Added an answer on May 16, 2026 at 5:09 pm

    There are basically two ways. Use the filetype plugin, or use filetype or extension autocommands.

    The autocommands (placed in your .vimrc/_vimrc) take the form of either

    autocmd Filetype cpp set textwidth=100
    

    or

    autocmd BufRead *.cpp,*.h,*.c set textwidth=100
    

    (Obviously set textwidth=100 can be replaced with any other command)

    The better solution, particularly if you have alot of custom commands for a filetype, is to use the files ~/.vim/after/ftplugin/<filetype>.vim for each filetype. Commands in those files will be executed after loading a file of the given type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Servlet that explicity sets the character encoding and redirect to some
I have some vendor data that has the SOH (ASCII character 1) as the
How do I escape '<' and '>' character in sed. I have some xml
We have some input data that sometimes appears with &nbsp characters on the end.
I have an application that uses simple sockets to pass some characters between two
I have some UI in VB 2005 that looks great in XP Style, but
I have some classes layed out like this class A { public virtual void
I have some 256-character strings of hexadecimal characters which represent a sequence of bit
I have a simple string which is delimited by some character, let's say a
I have some data with messed-up accented characters. For example in the data we

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.