diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-17 16:20:10 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-07-17 16:25:32 +1200 |
commit | 30d3c595060c6d40ca2b6a478cd79a8ca6b9ddc4 (patch) | |
tree | 4d5e45cc1d92d7181d4ec6df707550f6bfda7cb6 /vim/autoload/shebang_create_exec.vim | |
parent | Adjust formatting of .gitmodules (diff) | |
download | dotfiles-30d3c595060c6d40ca2b6a478cd79a8ca6b9ddc4.tar.gz dotfiles-30d3c595060c6d40ca2b6a478cd79a8ca6b9ddc4.zip |
Spin shebang_create_exec.vim into own distribution
Diffstat (limited to 'vim/autoload/shebang_create_exec.vim')
-rw-r--r-- | vim/autoload/shebang_create_exec.vim | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/vim/autoload/shebang_create_exec.vim b/vim/autoload/shebang_create_exec.vim deleted file mode 100644 index b01cf584..00000000 --- a/vim/autoload/shebang_create_exec.vim +++ /dev/null @@ -1,14 +0,0 @@ -" If the buffer starts with a shebang and the file being saved to doesn't -" exist yet, set up a hook to make it executable after the write is done -function! shebang_create_exec#Check(filename) abort - if stridx(getline(1), '#!') == 0 && !filereadable(a:filename) - autocmd shebang_create_exec BufWritePost <buffer> - \ call shebang_create_exec#Chmod(expand('<afile>:p')) - endif -endfunction - -" Make the file executable and clear away the hook that called us -function! shebang_create_exec#Chmod(filename) abort - autocmd! shebang_create_exec BufWritePost <buffer> - call system('chmod +x '.shellescape(a:filename)) -endfunction |