Skip to content

Commit e37623e

Browse files
committed
Merge branch 'master' of github.com:zhangyangjing/vimfiles
2 parents 71da4c6 + 587a503 commit e37623e

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

after/plugin/snipMate.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ if !exists('loaded_snips') || exists('s:did_snips_mappings')
55
endif
66
let s:did_snips_mappings = 1
77

8-
ino <silent> <tab> <c-r>=TriggerSnippet()<cr>
9-
snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
8+
"ino <silent> <tab> <c-r>=TriggerSnippet()<cr>
9+
"snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
10+
ino <silent> <c-j> <c-r>=TriggerSnippet()<cr>
11+
snor <silent> <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr>
1012
ino <silent> <s-tab> <c-r>=BackwardsSnippet()<cr>
1113
snor <silent> <s-tab> <esc>i<right><c-r>=BackwardsSnippet()<cr>
1214
ino <silent> <c-r><tab> <c-r>=ShowAvailableSnips()<cr>

snippets/python.snippets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
snippet #!
2-
#!/usr/bin/python
2+
#!/usr/bin/env python
3+
# -*- coding: utf-8 -*-
4+
35

46
snippet imp
57
import ${1:module}

vimrc

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ set nocompatible
2929
set completeopt=longest,menu
3030
autocmd FileType c,ch,cpp,java setlocal cindent
3131
autocmd FileType python set omnifunc=pythoncomplete#Complete
32-
3332
autocmd FileType c,ch,cpp,python set cc=80
3433

3534
" os type
@@ -130,9 +129,6 @@ nmap <leader>en $
130129
nnoremap <leader>x :set paste<CR>i
131130
autocmd InsertLeave * :set nopaste
132131

133-
" quick to run
134-
noremap <leader>r :!
135-
136132
" search show result in single window
137133
nmap <Leader>/ :exec 'lvimgrep /' . input('>', expand('<cword>')) . '/j % <bar> lopen'<CR>
138134
@@ -183,18 +179,20 @@ else
183179
endif
184180

185181
" flake8
186-
autocmd! FileType python map <buffer> <F7> :call Flake8()<CR>
182+
autocmd FileType python map <buffer> <F7> :call Flake8()<CR>
187183
let g:flake8_ignore="F403"
188184

189185
" auto run
190-
"nnoremap <silent><F5> :call AutoRun()<CR>
191-
"function! AutoRun()
192-
"if 'python' == &filetype
193-
"exe "!python %"
194-
"elseif 'php' == &filetype
195-
"exe "!php %"
196-
"endif
197-
"endfunction
186+
nnoremap <silent><F5> :call AutoRun()<CR>
187+
function! AutoRun()
188+
if 'python' == &filetype
189+
exe "!python %"
190+
elseif 'php' == &filetype
191+
exe "!php %"
192+
elseif 'sh' == &filetype
193+
exe "!bash %"
194+
endif
195+
endfunction
198196

199197
" Comments
200198
map <leader>cc <C-C>
@@ -223,4 +221,3 @@ function! TableMove(direction)
223221

224222
execute 'tabm '.tableIndex
225223
endfunction
226-

0 commit comments

Comments
 (0)