diff options
| author | Nirmal Kumar R <tildezero@gmail.com> | 2026-05-31 13:28:40 +0530 |
|---|---|---|
| committer | Nirmal Kumar R <tildezero@gmail.com> | 2026-05-31 13:28:40 +0530 |
| commit | 872cc357abe76afe77e6656aa078ec95331ca8d3 (patch) | |
| tree | 086d8a2f4da0317abc711e2924b3d2fc92ecef75 | |
| parent | e1a00b6b56369a68b5ec8fb5c1c2aab1a9ec6a3a (diff) | |
Add vimrc config just for C programming
| -rw-r--r-- | .vimrc-alt | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/.vimrc-alt b/.vimrc-alt new file mode 100644 index 0000000..c3ba174 --- /dev/null +++ b/.vimrc-alt @@ -0,0 +1,46 @@ +" disable vi compatibility +set nocompatible + +" set UTF-8 encoding +set enc=utf-8 +set fenc=utf-8 +set termencoding=utf-8 + +" use indentation of previous line +set autoindent + +" use intelligent indentation for C +set smartindent + +" configure tabwidth and insert spaces instead of tabs +set tabstop=4 " tab width is 4 spaces +set shiftwidth=4 " indent also with 4 spaces +set expandtab " expand tabs to spaces + +set cc=80 + +" turn syntax highlighting on +set t_Co=256 +syntax on +" :color shine +:colorscheme jellybeans + +" turn line numbers on +set number + +" highlight matching braces +set showmatch + +" Enhanced keyboard mappings +" +" in normal mode F2 will save the file +nmap <F2> :w<CR> + +" in insert mode F2 will exit insert, save, enters insert again +imap <F2> <ESC>:w<CR>i + +" switch between header/source with F4 +map <F4> :e %:p:s,.h$,.X123X,:s,.c$,.h,:s,.X123X$,.c,<CR> + +map <F5> :make<CR> +map <F6> :make clean all<CR> |
