blob: be45510f173742796331ae9f836559b923f9b411 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
execute pathogen#infect()
syntax on
filetype plugin indent on
set number
set hlsearch
set list
set modeline
set background=dark
set foldmethod=indent
set listchars=trail:·,tab:▸\ ,eol:¬
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
" Append modeline after last line in buffer.
" Use substitute() instead of printf() to handle '%%s' modeline in LaTeX
" files.
function! AppendModeline()
let l:modeline = printf(" vim: set ts=%d sw=%d tw=%d %set :",
\ &tabstop, &shiftwidth, &textwidth, &expandtab ? '' : 'no')
let l:modeline = substitute(&commentstring, "%s", l:modeline,
"")
call append(line("$"), l:modeline)
endfunction
nnoremap <silent> <Leader>ml :call AppendModeline()<CR>
|