diff options
Diffstat (limited to 'vimrc')
| -rw-r--r-- | vimrc | 14 |
1 files changed, 6 insertions, 8 deletions
| @@ -1,5 +1,7 @@ | |||
| 1 | execute pathogen#infect() | 1 | execute pathogen#infect() |
| 2 | 2 | ||
| 3 | let mapleader=";" | ||
| 4 | |||
| 3 | syntax on | 5 | syntax on |
| 4 | filetype plugin indent on | 6 | filetype plugin indent on |
| 5 | 7 | ||
| @@ -16,14 +18,10 @@ autocmd StdinReadPre * let s:std_in=1 | |||
| 16 | autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | 18 | autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif |
| 17 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif | 19 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif |
| 18 | 20 | ||
| 19 | " Append modeline after last line in buffer. | ||
| 20 | " Use substitute() instead of printf() to handle '%%s' modeline in LaTeX | ||
| 21 | " files. | ||
| 22 | function! AppendModeline() | 21 | function! AppendModeline() |
| 23 | let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :", | 22 | let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :", |
| 24 | \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no') | 23 | \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no') |
| 25 | let l:modeline = substitute(&commentstring, "%s", l:modeline, | 24 | let l:modeline = substitute(&commentstring, "%s", l:modeline, "") |
| 26 | "") | 25 | call append(line("$"), l:modeline) |
| 27 | call append(line("$"), l:modeline) | ||
| 28 | endfunction | 26 | endfunction |
| 29 | nnoremap <silent> <Leader>ml :call AppendModeline()<CR> | 27 | nnoremap <silent> <Leader>ml :call AppendModeline()<CR> |
