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

  • Home
  • SEARCH
  • 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 8497063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:01:17+00:00 2026-06-11T00:01:17+00:00

I have been exploring some way in VIM to automatically append closing characters to

  • 0

I have been exploring some way in VIM to automatically append closing characters to a line of code. In my case it is CSS. I came across this tip http://vim.wikia.com/wiki/Automatically_append_closing_characters and tweaked the code it tells me to add to my .vimrc like so

inoremap {      {}<Left>
inoremap {<CR>  {<CR>}<Esc>O
inoremap {{     {
inoremap {}     {} 

so when I write

body 

and then press { and ENTER in rapid succession what results is

body {

}

Note that the cursor will be indented and on the 2nd line so I will be ready to write code in that block.

Also I should mention that I also added the following to my .vimrc

inoremap ::     :;<Left>   

so that when I type : and : in rapid succession I will get :; with the cursor located in between the : and ;. This exactly where I want to be so I can start writing code right away.

I got that working fine but I quickly realized that the auto complete plug in that I installed (AutoComplPop VIM plug-in http://www.vim.org/scripts/script.php?script_id=1879) conflicts with the above .vimrc tweak.

So for example, if I start to write color I get the drop auto completion drop down menu of all options. The problem is that the option for color is actually color:.

enter image description here

You see it has a colon already added to it so when I select it, the colon is already there and then I have to manually add the closing ; character. This basically defeats the whole purpose of adding the auto appending closing character code to my .vimrc since in this case, it does not auto append the closing semicolon.

So how do I make a custom edit to VIM’s Omni Completion so that all CSS properties do not end in a colon?

CSS auto completion options for VIM and came across AutoComplPop here http://www.vim.org/scripts/script.php?script_id=1879

  • 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-11T00:01:18+00:00Added an answer on June 11, 2026 at 12:01 am

    Assuming you are on a UNIX-like system…

    1. Copy

      /usr/share/vim/vim7x/autoload/csscomplete.vim
      

      to

      ~/.vim/autoload/csscomplete.vim
      
    2. Find the loop that generates the list of properties, for me it’s at line 92.

    3. Remove the colon from the second parameter of the two add().

      These lines:

      call add(res, m . ':')
      call add(res2, m . ':')
      

      become:

      call add(res, m)
      call add(res2, m)
      
    4. Save the file.


    Also there are many plugins for “auto closing” pairs of characters. I use DelimitMate.

    And the issue is not related to ACP at all.

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

Sidebar

Related Questions

cool so i have been exploring CSS with HTML fo about a month now
I have been exploring algorithms that require some work on matrices, and I have
I have been exploring patterns in various MV* frameworks out there and today noticed
I have been exploring different answers about release management in Mercurial and almost found
I'm exploring package building on Windows 7 but have been running into trouble after
Have been looking on some tutorials for drawing canvas using SurfaceView, but the only
Recently I have been exploring using the fancy new dynamic keyword introduced in C#
I have been tasked with exploring the possibility of offline access of my webapp.
I've been exploring the use of mock objects in unit testing and have been
I've been fighting and fighting for some time with a decent way to handle

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.