- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql-clean.vim
More file actions
Latest commit
30 lines (29 loc) · 489 Bytes
/
Copy pathsql-clean.vim
File metadata and controls
30 lines (29 loc) · 489 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
function!SqlCleanFile()
execute'%s/ / /ge'
execute'%s/ / /ge'
execute'%s/,/,/ge'
execute'%s/Inner Join/ Inner Join/ge'
execute'%s/Left Join/ Left Join/ge'
execute'%s/SELECT/SELECT/ge'
execute'%s/FROM/FROM/ge'
execute'%s/WHERE/WHERE/ge'
execute'%s/GROUP BY/GROUP BY/ge'
execute'%s/AND/AND/ge'
execute'retab'
execute'set ff=unix'
execute'%s///e'
execute'%s/\s\+$//e'
endfunction
command! SqlClean executeSqlCleanFile()