Search code examples
pythonvimftplugin

How to override some remapping in my .vimrc to edit Python properly


I code CSS and Python and for CSS I have the following little time saver

inoremap :      :;<Left>

This is great until I start coding in Python. Every time I hit : I get an unwanted ; I should mention that to make editing in Python pleasant with proper indentation I added

~/.vim/ftplugin/python.vim

python.vim contains the following

setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal textwidth=80
setlocal smarttab
setlocal expandtab  

What code would I put into python.vim to override inoremap : :;<Left> from my .vimrc so that when I press : all I get is a single :?


Solution

  • You can put this in your python.vim:
       iunmap :
    

    As mentioned by Daan, you can also put the mapping for : in css specific vim file ( for example ~/.vim/syntax/css.vim )