1 " Vim main configuration file.
4 " Make sure Vim (and not Vi) settings are enabled.
7 " Enable automatic filedection, plugin and indention load.
8 filetype plugin indent on
10 " Use utf-8 file encoding for all files.
11 set fileencodings=utf-8
13 " Wrap text after 78 characters.
16 " Set tabs to 4 spaces, use softtabs.
20 " When < and > is used indent/deindent to the next shiftwidth boundary.
22 " Use the default value for real tabs.
25 " Enable auto indention.
28 " Activate lines display.
30 " Display the ruler with current line/file position.
32 " Display partial commands in the status line.
35 " Activate syntax folding.
38 set foldlevel=99 " no folding at default
40 " Use smartcase mode when searching; only check for case if the searched word
41 " contains a capital character.
45 " Activate spell checking, use English as default.
49 " When joining lines only add one space after a sentence.
52 " Allow backspacing over autoindent, line breaks and insert mode starts.
53 set backspace=indent,eol,start
55 " Don't use any modelines.
58 " When completing paths first use the longest path then display a list of all
60 set wildmode=longest,list
62 " Visualize the line the cursor is currently in.
65 " Use a dark background.
69 " Use "," as my mapleader.
71 let maplocalleader = ","
73 " Settings for the NERD commenter.
74 " Don't create any mappings I don't want to use.
75 let NERDCreateDefaultMappings=0
77 map <Leader><Leader> <plug>NERDCommenterToggle
79 " I often type "W" instead of "w" when trying to save a file. Fix my mistake.
84 " Disable Apple style movements in MacVim.
86 let macvim_skip_cmd_opt_movement = 1
90 " Activate syntax coloring.
94 " Automatically save and the load the file state (stored in ~/.vim/view).
95 autocmd BufWrite * mkview
96 autocmd BufRead * loadview