aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files/.vim/templates/=template=.py5
-rw-r--r--files/.vim/templates/=template=.sh2
-rw-r--r--files/.vimrc14
3 files changed, 12 insertions, 9 deletions
diff --git a/files/.vim/templates/=template=.py b/files/.vim/templates/=template=.py
index f6f948d..1b23c83 100644
--- a/files/.vim/templates/=template=.py
+++ b/files/.vim/templates/=template=.py
@@ -1,8 +1,9 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
+
def main():
%HERE%
+
if __name__ == '__main__':
main()
diff --git a/files/.vim/templates/=template=.sh b/files/.vim/templates/=template=.sh
index 0774808..54e0dcf 100644
--- a/files/.vim/templates/=template=.sh
+++ b/files/.vim/templates/=template=.sh
@@ -1 +1,3 @@
#!/bin/sh
+
+set -e
diff --git a/files/.vimrc b/files/.vimrc
index ddb4a54..251505d 100644
--- a/files/.vimrc
+++ b/files/.vimrc
@@ -313,14 +313,15 @@ if has('autocmd')
au InsertEnter * set nocursorline
au InsertLeave * set cursorline
- " TODO перенести в ftplugin
- autocmd FileType tex setlocal spell textwidth=79
- autocmd FileType java setlocal omnifunc=javacomplete#Complete
- autocmd FileType python set expandtab
- autocmd FileType html,xml,ant set nolist
+ " TODO перенести в ftplugin
+ au FileType tex setlocal spell textwidth=79
+ au FileType java setlocal omnifunc=javacomplete#Complete
+ au FileType python set expandtab
+ au FileType html,xml,ant set nolist
" Restore cursor position
- au BufReadPost * if line("'\.") > 0 && line("'\.") <= line("$") | exe 'normal g`.zvzz' | endif
+ au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe 'normal g`"zvzz' | endif
+
au BufRead,BufNewFile /etc/nginx/* if &ft == "" | setfiletype nginx | endif
au BufEnter * if &filetype == "" | setlocal ft=text | endif
au BufReadPost *.ledger norm G
@@ -328,7 +329,6 @@ if has('autocmd')
au BufRead,BufNewFile *.geojson if &ft == "" | setfiletype json | endif
" Set scripts to be executable from shell
- "au BufWritePost * if getline(1) =~ "^#!.*/bin/" | silent !chmod +x <afile> | endif
au BufWritePost * if getline(1) =~ "^#!.*/bin/" | silent exec "!chmod +x <afile>" | endif
endif
" }}}