Skip to content

Commit

Permalink
Add formatting for python.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Ryan committed Jul 6, 2017
1 parent 62a2029 commit 3cc6e99
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions vim/autocmds.vim
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ autocmd BufRead,BufNewFile *.go set filetype=go
autocmd BufRead,BufNewFile *.rs set filetype=rust
autocmd BufRead,BufNewFile *.js set filetype=javascript
autocmd BufRead,BufNewFile *.es6 set filetype=javascript
autocmd BufRead,BufNewFile *.py set filetype=python
autocmd BufRead,BufNewFile Gemfile set filetype=ruby
autocmd BufRead,BufNewFile Guardfile set filetype=ruby
autocmd FileType * call Tabstyle_auto()
Expand Down
9 changes: 9 additions & 0 deletions vim/functions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,20 @@ function! Tabstyle_4_spaces()
set expandtab
endfunction

function! Python_Tabstyle()
set tabstop=8
set shiftwidth=4
set softtabstop=4
set expandtab
endfunction

function! Tabstyle_auto()
if (&ft == 'c') || (&ft == 'cpp') || (&ft == 'make') || (&ft == 'sh') || (&ft == 'awk')
call Tabstyle_tabs()
elseif (&ft == 'php') || (&ft == 'go') || (&ft == 'rust')
call Tabstyle_4_spaces()
elseif (&ft == 'python')
call Python_Tabstyle()
else
call Tabstyle_2_spaces()
endif
Expand Down

0 comments on commit 3cc6e99

Please sign in to comment.