]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - vimrc
Added Vim ftplugin file for PHP.
[config/dotfiles.git] / vimrc
1 " Vim main configuration file.
2
3
4 " Make sure Vim (and not Vi) settings are enabled.
5 set nocompatible
6
7 " Enable automatic filedection, plugin and indention load.
8 filetype plugin indent on
9
10 " Use utf-8 file encoding for all files.
11 set fileencodings=utf-8
12
13 " Wrap text after 78 characters.
14 set textwidth=78
15
16 " Set tabs to 4 spaces, use softtabs.
17 set shiftwidth=4
18 set softtabstop=4
19 set expandtab
20 " When < and > is used indent/deindent to the next shiftwidth boundary.
21 set shiftround
22 " Use the default value for real tabs.
23 set tabstop=8
24
25 " Enable auto indention.
26 set autoindent
27
28 " Activate lines display.
29 set number
30 " Display the ruler with current line/file position.
31 set ruler
32 " Display partial commands in the status line.
33 set showcmd
34
35 " Activate syntax folding.
36 set foldmethod=syntax
37 set foldcolumn=2
38 set foldlevel=99 " no folding at default
39
40 " Use smartcase mode when searching; only check for case if the searched word
41 " contains a capital character.
42 set ignorecase
43 set smartcase
44
45 " Activate spell checking, use English as default.
46 set spell
47 set spelllang=en_us
48
49 " When joining lines only add one space after a sentence.
50 set nojoinspaces
51
52 " Allow backspacing over autoindent, line breaks and insert mode starts.
53 set backspace=indent,eol,start
54
55 " Don't use any modelines.
56 set nomodeline
57
58 " When completing paths first use the longest path then display a list of all
59 " possible files.
60 set wildmode=longest,list
61
62 " Visualize the line the cursor is currently in.
63 set cursorline
64
65 " Use a dark background.
66 set background=dark
67
68
69 " Use "," as my mapleader.
70 let mapleader = ","
71 let maplocalleader = ","
72
73 " Settings for the NERD commenter.
74 " Don't create any mappings I don't want to use.
75 let NERDCreateDefaultMappings=0
76 " Map toggle comment.
77 map <Leader><Leader> <plug>NERDCommenterToggle
78
79 " I often type "W" instead of "w" when trying to save a file. Fix my mistake.
80 cmap W w
81 cmap Wq wq
82
83
84 " Disable Apple style movements in MacVim.
85 if has("gui_macvim")
86     let macvim_skip_cmd_opt_movement = 1
87 endif
88
89
90 " Activate syntax coloring.
91 syntax enable
92
93
94 " Automatically save and the load the file state (stored in ~/.vim/view).
95 autocmd BufWrite * mkview
96 autocmd BufRead  * loadview