diff options
Diffstat (limited to 'vimrc')
| -rw-r--r-- | vimrc | 18 |
1 files changed, 16 insertions, 2 deletions
| @@ -4,12 +4,26 @@ syntax on | |||
| 4 | filetype plugin indent on | 4 | filetype plugin indent on |
| 5 | 5 | ||
| 6 | set number | 6 | set number |
| 7 | set background=dark | ||
| 8 | set hlsearch | 7 | set hlsearch |
| 9 | set listchars=trail:·,tab:▸\ ,eol:¬ | ||
| 10 | set list | 8 | set list |
| 9 | set modeline | ||
| 10 | |||
| 11 | set background=dark | ||
| 11 | set foldmethod=indent | 12 | set foldmethod=indent |
| 13 | set listchars=trail:·,tab:▸\ ,eol:¬ | ||
| 12 | 14 | ||
| 13 | autocmd StdinReadPre * let s:std_in=1 | 15 | autocmd StdinReadPre * let s:std_in=1 |
| 14 | autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | 16 | autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif |
| 15 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif | 17 | autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif |
| 18 | |||
| 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() | ||
| 23 | let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :", | ||
| 24 | \ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no') | ||
| 25 | let l:modeline = substitute(&commentstring, "%s", l:modeline, | ||
| 26 | "") | ||
| 27 | call append(line("$"), l:modeline) | ||
| 28 | endfunction | ||
| 29 | nnoremap <silent> <Leader>ml :call AppendModeline()<CR> | ||
