Home | Projects | Notes > Unix/Linux > .vimrc
A setting file used by Vim
Saves the default settings for the Vim editor when it is opened
Allows users to customize options for the editor
xxxxxxxxxx
731"*******************************************************************************
2" @file : .vimrc (Vim Run Command)
3" @brief : Optimized for C/C++ development, but useful also for other things
4" @author : Kyungjae Lee
5" @date : Jan 14, 2021 - Created file
6"*******************************************************************************
7
8"-------------------------------------------------------------------------------
9" Development Environment Configuration
10"-------------------------------------------------------------------------------
11
12" turn line numbers on
13set number
14
15" wrap line at 90 chars
16"set textwidth=90
17
18" mark the end of the desired textwidth
19set colorcolumn=80
20highlight ColorColumn ctermbg=DarkGray
21
22" display current column number
23set ruler
24
25" highlight all search matches
26set hlsearch
27
28" configure tabwidth and insert spaces instead of tabs
29set tabstop=4
30set shiftwidth=4
31
32" use indentation of previous line
33set autoindent
34
35" use intelligent indentation for C
36set smartindent
37
38" use auto-comment in new line (use ctrl-u in insert mode to delete the
39" automatically inserted comment markers in one key-chord)
40set formatoptions=tcroql
41
42" enable syntax color scheme
43syntax on
44
45" fixes glitch? in colors when using vim with tmux
46set background=dark
47set t_Co=256
48
49" underline the current line
50"highlight CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE
51set cursorline
52
53" configure the line number
54"highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
55
56" configure comment color
57highlight Comment ctermfg=DarkGreen
58
59" configure statusline
60set laststatus=2
61" display the full path of the currently open file
62set statusline+=%F
63" display the line and column numbers left-justified
64set statusline+=\ %=L%l:%=C%c
65" highlight the statusline
66highlight StatusLine ctermfg=Blue
67
68"-------------------------------------------------------------------------------
69" Key Bindings
70"-------------------------------------------------------------------------------
71
72" personal auto-commenting template
73map <F7> o/* <CR>@KyungjaeLee <C-R>=strftime("%m/%d/%Y")<CR><CR>/<ESC><UP><UP>