aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc14
1 files changed, 6 insertions, 8 deletions
diff --git a/vimrc b/vimrc
index be45510..879d50e 100644
--- a/vimrc
+++ b/vimrc
@@ -1,5 +1,7 @@
1execute pathogen#infect() 1execute pathogen#infect()
2 2
3let mapleader=";"
4
3syntax on 5syntax on
4filetype plugin indent on 6filetype plugin indent on
5 7
@@ -16,14 +18,10 @@ autocmd StdinReadPre * let s:std_in=1
16autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif 18autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
17autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif 19autocmd 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.
22function! AppendModeline() 21function! 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)
27call append(line("$"), l:modeline)
28endfunction 26endfunction
29nnoremap <silent> <Leader>ml :call AppendModeline()<CR> 27nnoremap <silent> <Leader>ml :call AppendModeline()<CR>