Skip to main content
deleted 26 characters in body
Source Link
joeytwiddle
  • 3.7k
  • 19
  • 28

To ensure that this workaround runs even when Vim is started by a separate tool (such as git), I have this in my ~/.vimrc:

" Allow us to use Ctrl-s and Ctrl-q as keybinds
silent !stty -ixon

" Restore default behaviour when leaving Vim.
autocmd VimLeave * silent !stty ixon

This has been working for me on Linux, GVim, Mac OS X and MacVim.

Caveats:

  • On Windows, or any other OS lacking the stty command, the above will likely throw up errors every time Vim starts! (silent! might mute that.)

  • If your shell already had this TTY setting disabled, of course the VimLeave autocommand will turn it back on again! Detecting and restoring iProgram's approach manages that by detecting the current settings is an advantage with @aPyDeveloper's approachat startup.


A combination of this and @aPyDeveloper'siProgram's solution, which handles compatibility concerns under OS X and Windows, would be great to post up here and/or on the Wiki!

To avoid choosing between stty -g and stty --save, you could try the following test for just the ix option.

call system("stty -a | grep '\( \|^\)ixon\>' >/dev/null")
let g:ix_at_startup = (v:shell_error == 0)

To ensure that this workaround runs even when Vim is started by a separate tool (such as git), I have this in my ~/.vimrc:

" Allow us to use Ctrl-s and Ctrl-q as keybinds
silent !stty -ixon

" Restore default behaviour when leaving Vim.
autocmd VimLeave * silent !stty ixon

This has been working for me on Linux, GVim, Mac OS X and MacVim.

Caveats:

  • On Windows, or any other OS lacking the stty command, the above will likely throw up errors every time Vim starts! (silent! might mute that.)

  • If your shell already had this TTY setting disabled, of course the VimLeave autocommand will turn it back on again! Detecting and restoring the current settings is an advantage with @aPyDeveloper's approach.


A combination of this and @aPyDeveloper's solution, which handles compatibility concerns under OS X and Windows, would be great to post up here and/or on the Wiki!

To avoid choosing between stty -g and stty --save, you could try the following test for just the ix option.

call system("stty -a | grep '\( \|^\)ixon\>' >/dev/null")
let g:ix_at_startup = (v:shell_error == 0)

To ensure that this workaround runs even when Vim is started by a separate tool (such as git), I have this in my ~/.vimrc:

" Allow us to use Ctrl-s and Ctrl-q as keybinds
silent !stty -ixon

" Restore default behaviour when leaving Vim.
autocmd VimLeave * silent !stty ixon

This has been working for me on Linux, GVim, Mac OS X and MacVim.

Caveats:

  • On Windows, or any other OS lacking the stty command, the above will likely throw up errors every time Vim starts! (silent! might mute that.)

  • If your shell already had this TTY setting disabled, of course the VimLeave autocommand will turn it back on again! iProgram's approach manages that by detecting the settings at startup.


A combination of this and iProgram's solution, which handles compatibility concerns under OS X and Windows, would be great to post up here and/or on the Wiki!

To avoid choosing between stty -g and stty --save, you could try the following test for just the ix option.

call system("stty -a | grep '\( \|^\)ixon\>' >/dev/null")
let g:ix_at_startup = (v:shell_error == 0)
deleted 63 characters in body
Source Link
joeytwiddle
  • 3.7k
  • 19
  • 28

To ensure that this workaround runs even when Vim is started by a separate tool (such as git), I have this in my ~/.vimrc:

" Allow us to use Ctrl-s and Ctrl-q as keybinds
silent !stty -ixon

" Restore default behaviour when leaving Vim.
autocmd VimLeave * silent !stty ixon

This has been working for me on Linux, GVim, Mac OS X and MacVim.

Caveats:

  • On Windows, or any other OS lacking the stty command, the above will likely throw up errors every time Vim starts! (silent! might mute that.)

  • If your shell already had this TTY setting disabled, of course the VimLeave autocommand will turn it back on again! Detecting and restoring the current settings is an advantage with @aPyDeveloper's approach.


A combination of this and @aPyDeveloper's solution, which handles compatibility concerns under OS X and Windows, would be great to post up here and/or on the Wiki!

To avoid choosing between stty -g and stty --save, you could try the following test for just the ix option. I can confirm it works on Linux, but I don't know about OS X:

call system("stty -a | grep '\( \|^\)ixon\>' >/dev/null")
let g:ix_at_startup = (v:shell_error == 0)

To ensure that this workaround runs even when Vim is started by a separate tool (such as git), I have this in my ~/.vimrc:

" Allow us to use Ctrl-s and Ctrl-q as keybinds
silent !stty -ixon

" Restore default behaviour when leaving Vim.
autocmd VimLeave * silent !stty ixon

This has been working for me on Linux, GVim, Mac OS X and MacVim.

Caveats:

  • On Windows, or any other OS lacking the stty command, the above will likely throw up errors every time Vim starts! (silent! might mute that.)

  • If your shell already had this TTY setting disabled, of course the VimLeave autocommand will turn it back on again! Detecting and restoring the current settings is an advantage with @aPyDeveloper's approach.


A combination of this and @aPyDeveloper's solution, which handles compatibility concerns under OS X and Windows, would be great to post up here and/or on the Wiki!

To avoid choosing between stty -g and stty --save, you could try the following test for just the ix option. I can confirm it works on Linux, but I don't know about OS X:

call system("stty -a | grep '\( \|^\)ixon\>' >/dev/null")
let g:ix_at_startup = (v:shell_error == 0)

To ensure that this workaround runs even when Vim is started by a separate tool (such as git), I have this in my ~/.vimrc:

" Allow us to use Ctrl-s and Ctrl-q as keybinds
silent !stty -ixon

" Restore default behaviour when leaving Vim.
autocmd VimLeave * silent !stty ixon

This has been working for me on Linux, GVim, Mac OS X and MacVim.

Caveats:

  • On Windows, or any other OS lacking the stty command, the above will likely throw up errors every time Vim starts! (silent! might mute that.)

  • If your shell already had this TTY setting disabled, of course the VimLeave autocommand will turn it back on again! Detecting and restoring the current settings is an advantage with @aPyDeveloper's approach.


A combination of this and @aPyDeveloper's solution, which handles compatibility concerns under OS X and Windows, would be great to post up here and/or on the Wiki!

To avoid choosing between stty -g and stty --save, you could try the following test for just the ix option.

call system("stty -a | grep '\( \|^\)ixon\>' >/dev/null")
let g:ix_at_startup = (v:shell_error == 0)
ixon is not the same as -ixoff
Source Link
joeytwiddle
  • 3.7k
  • 19
  • 28

To ensure that this workaround runs even when Vim is started by a separate tool (such as git), I have this in my ~/.vimrc:

" Allow us to use Ctrl-s and Ctrl-q as keybinds
silent !stty -ixon

" Restore default behaviour when leaving Vim.
autocmd VimLeave * silent !stty ixon

This has been working for me on Linux, GVim, Mac OS X and MacVim.

It would appear that ixon and -ixoff do the same thing.

Caveats:

  • On Windows, or any other OS lacking the stty command, the above will likely throw up errors every time Vim starts! (silent! might mute that.)

  • If your shell already had this TTY setting disabled, of course the VimLeave autocommand will turn it back on again! Detecting and restoring the current settings is an advantage with @aPyDeveloper's approach.


A combination of this and @aPyDeveloper's solution, which handles compatibility concerns under OS X and Windows, would be great to post up here and/or on the Wiki!

To avoid choosing between stty -g and stty --save, you could try the following test for just the ix option. I can confirm it works on Linux, but I don't know about OS X:

call system("stty -a | grep '\( \|^\)ixon\>' >/dev/null")
let g:ix_at_startup = (v:shell_error == 0)

To ensure that this workaround runs even when Vim is started by a separate tool (such as git), I have this in my ~/.vimrc:

" Allow us to use Ctrl-s and Ctrl-q as keybinds
silent !stty -ixon

" Restore default behaviour when leaving Vim.
autocmd VimLeave * silent !stty ixon

This has been working for me on Linux, GVim, Mac OS X and MacVim.

It would appear that ixon and -ixoff do the same thing.

Caveats:

  • On Windows, or any other OS lacking the stty command, the above will likely throw up errors every time Vim starts! (silent! might mute that.)

  • If your shell already had this TTY setting disabled, of course the VimLeave autocommand will turn it back on again! Detecting and restoring the current settings is an advantage with @aPyDeveloper's approach.


A combination of this and @aPyDeveloper's solution, which handles compatibility concerns under OS X and Windows, would be great to post up here and/or on the Wiki!

To avoid choosing between stty -g and stty --save, you could try the following test for just the ix option. I can confirm it works on Linux, but I don't know about OS X:

call system("stty -a | grep '\( \|^\)ixon\>' >/dev/null")
let g:ix_at_startup = (v:shell_error == 0)

To ensure that this workaround runs even when Vim is started by a separate tool (such as git), I have this in my ~/.vimrc:

" Allow us to use Ctrl-s and Ctrl-q as keybinds
silent !stty -ixon

" Restore default behaviour when leaving Vim.
autocmd VimLeave * silent !stty ixon

This has been working for me on Linux, GVim, Mac OS X and MacVim.

Caveats:

  • On Windows, or any other OS lacking the stty command, the above will likely throw up errors every time Vim starts! (silent! might mute that.)

  • If your shell already had this TTY setting disabled, of course the VimLeave autocommand will turn it back on again! Detecting and restoring the current settings is an advantage with @aPyDeveloper's approach.


A combination of this and @aPyDeveloper's solution, which handles compatibility concerns under OS X and Windows, would be great to post up here and/or on the Wiki!

To avoid choosing between stty -g and stty --save, you could try the following test for just the ix option. I can confirm it works on Linux, but I don't know about OS X:

call system("stty -a | grep '\( \|^\)ixon\>' >/dev/null")
let g:ix_at_startup = (v:shell_error == 0)
Source Link
joeytwiddle
  • 3.7k
  • 19
  • 28
Loading