aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
blob: 879d50e6860e50d0c87578e52520c7bf5ee0a8e4 (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
execute pathogen#infect()

let mapleader=";"

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

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>