Skip to content

Instantly share code, notes, and snippets.

@umidjons
Last active February 25, 2021 04:10
Show Gist options
  • Save umidjons/8265223 to your computer and use it in GitHub Desktop.
Save umidjons/8265223 to your computer and use it in GitHub Desktop.
Vim: .vimrc example for easy programming

Vim & gVim configurations

Change color scheme

colorscheme candycode

Show line numbers

set nu!

Set gVim font

set guifont=Consolas:h12:cRUSSIAN

Change language

set langmenu=en_US
let $LANG='en_US'
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim

Change encoding

set encoding=utf8

Set TAB size

set softtabstop=2

Enable auto indentation

set autoindent

Enable indentation according to file type

filetype plugin indent on

Configure paired characters

inoremap ' ''<ESC>ha
inoremap " ""<ESC>ha
inoremap ` ``<ESC>ha
inoremap ( ()<ESC>ha
inoremap [ []<ESC>ha
inoremap { {}<ESC>ha
inoremap /* /** */<ESC>2ha

Enable 256 colors in terminal

set t_Co=256

Change default netrw window size

let g:netrw_winsize=25

Enable preview in netrw

let g:netrw_preview=1

Set commands and search patterns history (default is 50)

set history=100

Some mapping related to PHP

Create new file in c:\program\ files\vim\vimfiles\ftplugin\php_mymaps.vim.

Put colon ,, semicolon ; at EOL:

inoremap ;; <C-o>A;
inoremap ,, <C-o>A,

Spaces around =, =>

inoremap =<space> <space>=<space>
inoremap =><space> <space>=><space>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment