aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vim/ftplugin/python.vim4
-rw-r--r--vimrc18
2 files changed, 20 insertions, 2 deletions
diff --git a/vim/ftplugin/python.vim b/vim/ftplugin/python.vim
new file mode 100644
index 0000000..183ef4b
--- /dev/null
+++ b/vim/ftplugin/python.vim
@@ -0,0 +1,4 @@
1set tabstop=8
2set expandtab
3set shiftwidth=4
4set softtabstop=4
diff --git a/vimrc b/vimrc
index 0d11819..be45510 100644
--- a/vimrc
+++ b/vimrc
@@ -4,12 +4,26 @@ syntax on
4filetype plugin indent on 4filetype plugin indent on
5 5
6set number 6set number
7set background=dark
8set hlsearch 7set hlsearch
9set listchars=trail:·,tab:▸\ ,eol:¬
10set list 8set list
9set modeline
10
11set background=dark
11set foldmethod=indent 12set foldmethod=indent
13set listchars=trail:·,tab:▸\ ,eol:¬
12 14
13autocmd StdinReadPre * let s:std_in=1 15autocmd StdinReadPre * let s:std_in=1
14autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif 16autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
15autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif 17autocmd 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.
22function! 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 "")
27call append(line("$"), l:modeline)
28endfunction
29nnoremap <silent> <Leader>ml :call AppendModeline()<CR>