aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2015-02-27 11:07:20 +0100
committerGravatar Tom van der Lee <t0m.vd.l33@gmail.com>2015-02-27 11:07:20 +0100
commitb1bd63b4d093bc93880d9267da11257af8257e73 (patch)
tree8fafca0f65cfc731ceef1d8a8716045822c59c83
parentf5ba774f4c3f1d62af6145bcd51b514306675d53 (diff)
downloaddotfiles-b1bd63b4d093bc93880d9267da11257af8257e73.tar.gz
dotfiles-b1bd63b4d093bc93880d9267da11257af8257e73.tar.bz2
dotfiles-b1bd63b4d093bc93880d9267da11257af8257e73.zip
Fixed modelineappend function and changed leader key
-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>