Mercurial > dotfiles
annotate vim/vimrc @ 42:6b831735c092
Added french keymap support.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 22 Nov 2011 22:48:52 -0800 |
parents | cec2213f938c |
children | 25e8b2fffd50 |
rev | line source |
---|---|
6 | 1 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" |
2 " | |
0 | 3 " Ludovic Chabant's ~/.vimrc |
4 " | |
6 | 5 " http://ludovic.chabant.com |
6 " | |
7 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
0 | 8 |
9 " Use Vim settings, rather then Vi settings (much better!). | |
10 " This must be first, because it changes other options as a side effect. | |
11 set nocompatible | |
12 | |
6 | 13 " Set some important system-dependent variables. |
14 if has("win32") || has("win64") || has("dos32") | |
15 let $HOMEVIM = "vimfiles" | |
16 let $PLATFORM = "windows" | |
17 else | |
18 let $HOMEVIM = ".vim" | |
19 let $PLATFORM = "unix" | |
20 endif | |
21 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
22 " Disable some plugins. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
23 let g:pathogen_disabled = [] |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
24 call add(g:pathogen_disabled, 'command-t') |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
25 |
0 | 26 " Load pathogen. |
27 call pathogen#infect() | |
28 | |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
29 " Hide the toolbar in MacVim/gVIM, and set a nice window size. |
0 | 30 if has("gui_running") |
31 set guioptions=-t | |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
32 set lines=50 |
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
33 set columns=135 |
0 | 34 endif |
35 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
36 " Disable modelines. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
37 set modelines=0 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
38 |
6 | 39 " Don't unload abandoned buffers. |
40 set hidden | |
0 | 41 |
6 | 42 " Show line numbers. |
43 set number | |
44 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
45 " Show what mode we're in, and what command we're typing. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
46 set showmode |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
47 set showcmd |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
48 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
49 " Keep the cursor off the top/bottom edges. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
50 set scrolloff=3 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
51 |
6 | 52 " Smart auto-indenting. |
0 | 53 set autoindent |
54 set smartindent | |
6 | 55 |
56 " Use confirmation dialog. | |
0 | 57 set confirm |
6 | 58 |
59 " Remember lots of commands. | |
0 | 60 set history=1000 |
6 | 61 |
62 " Use incremental search, with highlighting, | |
63 " case-insensitive unless we actually type some | |
64 " mixed-case stuff. | |
0 | 65 set incsearch |
66 set hlsearch | |
67 set ignorecase | |
68 set smartcase | |
6 | 69 |
70 " Always show window status lines. | |
0 | 71 set laststatus=2 |
6 | 72 |
73 " Enable using the mouse like some everyday guy. | |
0 | 74 set mouse=a |
6 | 75 |
76 " Show interesting stuff at the bottom of the window. | |
0 | 77 set showcmd |
78 set ruler | |
6 | 79 |
80 " Don't pollute the hard-drive with *~ files. Only | |
81 " create them in hidden backup/temp directories while | |
82 " we edit the file, and then get rid of it. | |
0 | 83 set nobackup |
84 set writebackup | |
6 | 85 set backupdir=~/$HOMEVIM/backup |
86 set directory=~/$HOMEVIM/temp | |
87 | |
88 " Better command-line completion, but don't show some | |
89 " stuff we don't care about. | |
0 | 90 set wildmenu |
91 set wildignore+=.DS_Store,Thumbs.db | |
6 | 92 |
93 " Always display the tab-page line. | |
0 | 94 set showtabline=2 |
6 | 95 |
96 " Show matching braces. | |
97 set showmatch | |
98 | |
99 " Set the file-formats. | |
0 | 100 set ffs=unix,mac,dos |
6 | 101 |
102 " Tabs and indenting are 4 characters, and tabs behave like | |
103 " spaces during editing. They're smart, too, and when you | |
104 " press <TAB> it actually inserts a soft-tab so everything's | |
105 " indented the same. | |
0 | 106 set tabstop=4 |
107 set shiftwidth=4 | |
108 set softtabstop=4 | |
109 set smarttab | |
110 set expandtab | |
6 | 111 |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
112 " Default encoding |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
113 set encoding=utf-8 |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
114 |
6 | 115 " Clipboard buffer. |
0 | 116 set clipboard=unnamed |
6 | 117 |
118 " Smoot terminal experience. | |
0 | 119 set ttyfast |
6 | 120 |
121 " Allow backspacing over anything. | |
0 | 122 set backspace=indent,eol,start |
123 | |
6 | 124 " Going left and right let you go to other lines. |
125 set whichwrap+=<,>,h,l | |
126 | |
127 " And now, for some system-dependent settings: | |
128 " - font to use | |
129 if $PLATFORM == "windows" | |
130 set guifont=Consolas:h12 | |
131 else | |
132 set guifont=Monaco:h12 | |
133 endif | |
134 | |
135 | |
0 | 136 " Syntax highlighting |
137 syntax on | |
138 | |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
139 " Change the current directory to the home directory. |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
140 cd ~/ |
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
141 |
6 | 142 " Default color scheme |
143 colorscheme peaksea | |
144 set background=dark | |
145 | |
146 " Enable file type detection. | |
0 | 147 filetype indent plugin on |
148 | |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
149 " MiniBufExplorer |
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
150 " Navigate with CTRL+Tab/CTRL+Shift+Tab |
18
cec2213f938c
Removed some MiniBufExplorer mappings.
Ludovic Chabant <ludovic@chabant.com>
parents:
13
diff
changeset
|
151 let g:miniBufExplMapCTabSwitchBufs = 1 |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
152 |
6 | 153 " Custom mappings. |
42
6b831735c092
Added french keymap support.
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
154 let mapleader="," |
10
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
155 " MiniBufExplorer mappings |
00cac5ebf546
Added default window size. Added buffer keyboard shortcuts.
ludovicchabant
parents:
6
diff
changeset
|
156 map <leader>e :MiniBufExplorer<cr> |
13 | 157 " Open NERDtree |
158 map <leader>n :NERDTreeToggle<cr> | |
42
6b831735c092
Added french keymap support.
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
159 " Switch between FR and US keyboard layouts |
6b831735c092
Added french keymap support.
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
160 map <leader>fr :set keymap=french<cr> |
6b831735c092
Added french keymap support.
Ludovic Chabant <ludovic@chabant.com>
parents:
18
diff
changeset
|
161 map <leader>us :set keymap=<cr> |
0 | 162 |
163 " Temporary stuff | |
164 "let mapleader="," " Use , as Leader | |
165 "let gmapleader="," | |
166 "map Y y$ " Yank to the end of the line w/ Y | |
167 "map <leader>nt :tabnew<CR> " New tab w/ ,nt | |
168 "map <leader>f :FufFile<CR> " Find files with ,f | |
169 "nmap <leader>w :w!<cr> | |
170 "map <F3> :r !pbpaste<CR> | |
171 "map <F4> :setlocal spell spelllang=en_gb<CR> " Turn on spellcheck with <F4> | |
172 "map <F5> :set nospell<CR> | |
173 "set pastetoggle=<F6> | |
174 "map <F7> :set complete+=k<CR> | |
175 "map <S-F7> :set complete=-k<CR> | |
176 "map <F8> :YRShow<CR> " Show the YankRing w/ <F8> | |
177 "nnoremap <F3> :GundoToggle<CR> " Show the undo tree w/ <F3> | |
178 "nnoremap ; : | |
179 "autocmd BufRead,BufNewfile ~/notes/* set filetype=markdown " All files in ~/notes are Markdown | |
180 "au BufWinLeave *.html,*.css mkview | |
181 "au BufWinEnter *.html,*.css silent loadview | |
182 "au FileType mail set tw=65 " Thin width when writing mail in mutt | |
183 "au FocusLost * :wa " Saves file when vim loses focus | |
184 "if has('statusline') " Status line with git repo info | |
185 " set statusline=%<%f\ | |
186 " set statusline+=%w%h%m%r | |
187 " set statusline+=%{fugitive#statusline()} | |
188 " set statusline+=\ [%{&ff}/%Y] | |
189 " set statusline+=\ [%{getcwd()}] | |
190 " set statusline+=%=%-14.(Line:\ %l\ of\ %L\ [%p%%]\ -\ Col:\ %c%V%) | |
191 "endif | |
192 | |
193 " When started as "evim", evim.vim will already have done these settings. | |
194 "if v:progname =~? "evim" | |
195 " finish | |
196 "endif | |
197 | |
198 " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries | |
199 " let &guioptions = substitute(&guioptions, "t", "", "g") | |
200 | |
201 " Don't use Ex mode, use Q for formatting | |
202 "map Q gq | |
203 | |
204 " This is an alternative that also works in block mode, but the deleted | |
205 " text is lost and it only works for putting the current register. | |
206 "vnoremap p "_dp | |
207 | |
208 " Switch syntax highlighting on, when the terminal has colors | |
209 " Also switch on highlighting the last used search pattern. | |
210 "if &t_Co > 2 || has("gui_running") | |
211 " syntax on | |
212 " set hlsearch | |
213 "endif | |
214 | |
215 " Only do this part when compiled with support for autocommands. | |
216 "if has("autocmd") | |
217 | |
218 " Enable file type detection. | |
219 " Use the default filetype settings, so that mail gets 'tw' set to 72, | |
220 " 'cindent' is on in C files, etc. | |
221 " Also load indent files, to automatically do language-dependent indenting. | |
222 " filetype plugin indent on | |
223 | |
224 " Put these in an autocmd group, so that we can delete them easily. | |
225 " augroup vimrcEx | |
226 " au! | |
227 | |
228 " For all text files set 'textwidth' to 78 characters. | |
229 " autocmd FileType text setlocal textwidth=78 | |
230 | |
231 " When editing a file, always jump to the last known cursor position. | |
232 " Don't do it when the position is invalid or when inside an event handler | |
233 " (happens when dropping a file on gvim). | |
234 " autocmd BufReadPost * | |
235 " \ if line("'\"") > 0 && line("'\"") <= line("$") | | |
236 " \ exe "normal g`\"" | | |
237 " \ endif | |
238 | |
239 " augroup END | |
240 | |
241 "else | |
242 | |
243 " set autoindent " always set autoindenting on | |
244 | |
245 "endif " has("autocmd") | |
246 | |
247 "set fileformats=dos,unix " set fileformat to DOS by default | |
248 |