Vimshell
GSAWiki.Vimshell History
Hide minor edits - Show changes to markup
The vimshell extension is a handy customization that allows you to run a shell subprocess in a vim window. This is great for when you're editing a file or debugging a program and don't want to have two terminal windows open or pop in and out of vim to run things. The source and instructions can be found here.
The vimshell extension is a handy customization that allows you to run a shell subprocess in a vim window. This is great for when you're editing a file or debugging a program and don't want to have two terminal windows open or pop in and out of vim to run things. The source and instructions can be found here and precompiled binaries and instructions are below.
- choose the appropriate executable for vimshell executable depending on architecture
- choose the appropriate executable for vimshell depending on architecture
Put all three of these executables into your ~/bin directory and the following code to your .bashrc file to run the right version on the right machine:
Put all three of these executables into your ~/bin directory and add the following code to your .bashrc file to run the right version on the right machine:
if [ `uname -p` = 'x86_64' ] # 64 bit linux machines then
export VIM=/usr/share/vim
export VIMRUNTIME=/usr/share/vim/vim70
alias vim='~/bin/vim_linux64' # compiled on 64 bit machine
elif [ `uname -p` = 'i386' ] # 32 bit linux machines then
export VIM=/usr/share/vim
export VIMRUNTIME=/usr/share/vim/vim70
alias vim='~/bin/vim_linux32' # compiled on 32 bit machine
elif [ `uname` = 'Darwin' ] # OS X machines then
alias vim='~/bin/vim_darwin' # compiled on OS X
fi
case "`uname -sp`" in
"Linux x86_64")
export VIM=/usr/share/vim
export VIMRUNTIME=/usr/share/vim/vim70
alias vim='~/bin/vim_linux64';;
"Linux i686")
export VIM=/usr/share/vim
export VIMRUNTIME=/usr/share/vim/vim70
alias vim='~/bin/vim_linux32';;
"Darwin i386")
export VIM=/usr/share/vim
export VIMRUNTIME=/usr/share/vim/vim62
alias vim='~/bin/vim_darwin';;
esac
Put all three of these executables into your ~/bin directoory and the following code to your .bashrc file to run the right version on the right machine:
Put all three of these executables into your ~/bin directory and the following code to your .bashrc file to run the right version on the right machine:
One unfortunate thing about the extension is it requires you to compile vim from source after applying a patch, so if you want it to work on different architectures you need to compile different versions of the executable. If you are an avid vimmer this is well worth the effort, however, and here is a section of code you can add to your .bashrc file to run the right version on the right machine:
One unfortunate thing about the extension is it requires you to compile vim from source after applying a patch, so you need different executables for different architectures. Below are three precompiled versions of vim with vimshell included:
Put all three of these executables into your ~/bin directoory and the following code to your .bashrc file to run the right version on the right machine:
The vimshell extension is a handy customization that allows you to run a shell subprocess in a vim window. This is great for when you're editing a file or debugging a program and don't want to have two terminal windows open or pop in and out of vim to run things. The source and instructions can be found here.
One unfortunate thing about the extension is it requires you to compile vim from source after applying a patch, so if you want it to work on different architectures you need to compile different versions of the executable. If you are an avid vimmer this is well worth the effort, however, and here is a section of code you can add to your .bashrc file to run the right version on the right machine:
(:source lang=bash :)
- choose the appropriate executable for vimshell executable depending on architecture
if [ `uname -p` = 'x86_64' ] # 64 bit linux machines then
export VIM=/usr/share/vim
export VIMRUNTIME=/usr/share/vim/vim70
alias vim='~/bin/vim_linux64' # compiled on 64 bit machine
elif [ `uname -p` = 'i386' ] # 32 bit linux machines then
export VIM=/usr/share/vim
export VIMRUNTIME=/usr/share/vim/vim70
alias vim='~/bin/vim_linux32' # compiled on 32 bit machine
elif [ `uname` = 'Darwin' ] # OS X machines then
alias vim='~/bin/vim_darwin' # compiled on OS X
fi (:sourceend:)