-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
87 lines (65 loc) · 2.24 KB
/
vimrc
File metadata and controls
87 lines (65 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
syntax enable
" set line numbers
set nu
" colors
set background=dark
" colorscheme solarized
" Identation
set autoindent
set smarttab
set expandtab
set shiftwidth=4
" Detect filetype
filetype on
" make searches case-insensitive, unless they contain upper-case letters:
set ignorecase
set smartcase
" show the `best match so far' as search strings are typed:
set incsearch
" scroll the window (but leaving the cursor in the same place) by a couple of
"noremap <C-k> 1<C-Y>
"noremap <C-j> 1<C-E>
"noremap <M-k> 1<C-Y>k
"noremap <M-j> 1<C-E>j
"noremap <C-M-k> 1<C-Y>2k
"noremap <C-M-j> 1<C-E>2j
" allow <BkSpc> to delete line breaks, beyond the start of the current
" insertion, and over indentations:
set backspace=eol,start,indent
" We play utf-8
set fileencoding=utf-8
set encoding=utf-8
set termencoding=utf-8
" enable mouse
if has('mouse')
set mouse=a
endif
if has("autocmd")
filetype plugin indent on
endif
" for all files
autocmd FileType * set tabstop=2|set shiftwidth=2|set noexpandtab
" for C-like programming, have automatic indentation:
autocmd FileType c,cpp,slang set cindent
" for actual C (not C++) programming where comments have explicit end
" characters, if starting a new line in the middle of a comment automatically
" insert the comment leader characters:
autocmd FileType c set formatoptions+=ro cindent
" for Perl programming, have things in braces indenting themselves:
autocmd FileType perl set smartindent
" for PHP programming, have things in braces indenting themselves:
autocmd FileType php set autoindent tabstop=3
" for CSS, also have things in braces indented:
autocmd FileType css set smartindent
" for HTML, generally format text, but if a long line has been created leave it
" alone when editing:
autocmd FileType html set formatoptions+=tl
" for both CSS and HTML, use genuine tab characters for indentation, to make
" files a few bytes smaller:
autocmd FileType html,css set noexpandtab tabstop=2
" in makefiles, don't expand tabs to spaces, since actual tab characters are
" needed, and have indentation at 8 chars to be sure that all indents are tabs
" (despite the mappings later):
autocmd FileType make set noexpandtab shiftwidth=8
" for python
autocmd FileType python set tabstop=4|set shiftwidth=4|set softtabstop=4|set expandtab