Skip to content

Instantly share code, notes, and snippets.

@Stubbs
Created May 18, 2012 10:36
Show Gist options
  • Save Stubbs/2724564 to your computer and use it in GitHub Desktop.
Save Stubbs/2724564 to your computer and use it in GitHub Desktop.
Dirty hack for Macvim when it hangs trying to add new lines to files.
" DIRTY!
" For some reason, Macvim hangs when trying to insert a new line when editing
" mysql & javascript file.
"
" You can work around that by switching to another filetype that doesn't have
" the problem, then back again, hence these two hacks.
"
augroup mysqlhack
au!
au BufNewFile,BufRead *.sql,*.mysql,*.ddl set ft=php ft=mysql
augroup END
augroup jshack
au!
au BufNewFile,BufRead *.js set ft=php ft=javascript
augroup END
@Stubbs
Copy link
Author

Stubbs commented May 18, 2012

When I run dtruss on the process, I get this endlessly:

gettimeofday(0xC0093258, 0x0, 0x1000) = 1337337987 0
gettimeofday(0xC0093258, 0x0, 0x1000) = 1337337987 0
gettimeofday(0xC0093258, 0x0, 0x1000) = 1337337987 0
gettimeofday(0xC0093258, 0x0, 0x1000) = 1337337987 0
gettimeofday(0xC0093258, 0x0, 0x1000) = 1337337987 0
gettimeofday(0xC0093258, 0x0, 0x1000) = 1337337987 0
gettimeofday(0xC0093258, 0x0, 0x1000) = 1337337987 0
gettimeofday(0xC0093258, 0x0, 0x1000) = 1337337988 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment