News for hackers. Stuff that matters.
Re:Tmux and Vim – better together by hultner on Thursday April 20, 2017 @09:07AM (#14156275)
I usually use :!command to run a command real quick from within vim, where I also have access to the current filename and contents.

A classic gem is ":w !diff % -" to see what I've changed since the last save.

Re:Tmux and Vim – better together by name_for_now on Thursday April 20, 2017 @11:00AM (#14157240)
I used to run more commands from vim, but now I personally find Ctrl-Z is usually more convenient for all the one-off commands. If I do run stuff from inside of vim, it's now usually ":w !" or ":r !" (or some custom command wrapper around those).
Re:Tmux and Vim – better together by sergiosgc on Thursday April 20, 2017 @12:54PM (#14158419)
Oh! Ctrl-Z! I've been calling !zsh all these years, for quick shell access, and never thought of suspending vim.

Thanks for the nugget.

Re:Tmux and Vim – better together by NocturnalWaffle on Thursday April 20, 2017 @08:38PM (#14162163)
Put this in your zshrc, and Ctrl-Z will also resume the most recently suspended process. Really handy to just Ctrl-Z in and out of Vim.

  # Make Ctrl-z also resume background process
  fancy-ctrl-z () {
      if [[ $#BUFFER -eq 0 ]]; then
          BUFFER="fg"
          zle accept-line
      else
          zleush-input
          zle clear-screen
      fi
  }
  zle -N fancy-ctrl-z
  bindkey '^Z' fancy-ctrl-z
Re:Tmux and Vim – better together by mrkgnao on Friday April 21, 2017 @01:48AM (#14163355)
I don't really know zsh, but that looks like it should be

  zle flush-input
Re:Tmux and Vim – better together by erikb on Thursday April 20, 2017 @11:02AM (#14157256)
And as many other cool vim features, you can even extend that usage by combining it with other features. For instance, you can read the output of a command into the current buffer by ":r !command".
Re:Tmux and Vim – better together by bphogan on Thursday April 20, 2017 @10:05AM (#14156698)
That's what I've done for years too. I didn't know about the diff, but I love that - thank you.