Based on "The Ultimate vimrc"
Make an alias:
alias edit="docker run -ti --rm -v $(pwd):/home/developer/workspace jare/vim-bundle"
Alternatively, for VIM GUI and also clang completer support, make an alias:
alias edit="docker run -ti --rm -e DISPLAY -v $HOME/.Xauthority:/home/developer/.Xauthority --net=host -v $(pwd):/home/developer/workspace benjamint/vim-bundle"
Often a shell function will work better. Here are examples of mine
vii() { docker run -ti --rm -v $(pwd):/home/developer/workspace -v /home/btucker/vim_config:/ext/ benjamint/vim-bundle $* }
export -f vii
gvii() { docker run -ti --rm -e DISPLAY -v $HOME/.Xauthority:/home/developer/.Xauthority --net=host -v $(pwd):/home/developer/workspace -v /home/btucker/vim_config:/ext/ benjamint/vim-bundle $* }
export -f gvii
Have fun! edit some.file
Also You can use this one for getting updates: alias edit_update="docker pull jare/vim-bundle:latest"
By default the inner vi process will run as uid=9001 and gid=9001. New files created will have corresponding ownership values, which is probably not useful. The UID and GID can be controlled with the LOCAL_USER_ID and LOCAL_GROUP_ID environment variables. If you want to use the local users ownership include the following on the docker run command line:
docker run ... -e LOCAL_USER_ID=`id -u` -e LOCAL_GROUP_ID=`id -g` ... benjamint/vim-bundle
docker run ... -e DISABLE="'vim-airline', 'nerdtree'" ... jare/vim-bundle
- Create a folder with your
.vimrc
file and, if you want to add plugins, subfolder calledbundle
with them. - mount it:
docker run ... -v <***>/my-stuff:/ext/ ... jare/vim-bundle
But the best we will be extending this container.
- Airline Lean & mean status/tabline for vim that's light as air
- Tagbar Plugin that displays tags in a window, ordered by scope
- EasyGrep Fast and Easy Find and Replace Across Multiple Files
- Bufexplorer BufExplorer Plugin for Vim
- CtrlP Fuzzy file, buffer, mru, tag, ... finder with regexp support
- The NERD Tree A tree explorer plugin for vim
- NERDTree tabs NERDTree and tabs together in Vim, painlessly
- Syntastic Syntax checking hacks for vim
- Vim-Scala Integration of Scala into Vim - not a ton here, but useful
- Solarized Colorscheme for Vim Solarized Colorscheme
- Taglist Source code browser (supports C/C++, java, perl, python, tcl, sql, php, etc)
- Vim-expand-region Visual selection of increasingly larger regions using the same key combination
- Fugitive fugitive.vim: a Git wrapper so awesome, it should be illegal
- Gitgutter Plugin which shows a git diff in the gutter (sign column) and stages/reverts hunks
- Vim-go Go development plugin for Vim
- Vim-markdown Vim Markdown runtime files
- Vim-indent-object Defines a new text object representing lines of code at the same indent level
- Vim-multiple-cursor True Sublime Text style multiple selections for Vim
- Vim-repeat Enable to repeat last change by non built-in commands
- Vim-surround surround.vim: quoting/parenthesizing made simple
- The Most Recently Used (MRU) Plugin to manage Most Recently Used (MRU) files
- YankRing Maintains a history of previous yanks, changes and deletes
- Vim-HAML Vim runtime files for Haml, Sass, and SCSS
- snipMate & UltiSnip Snippets vim-snipmate default snippets (Previously snipmate-snippets)
- Easymotion Vim motions on speed!
- Undotree The ultimate undo history visualizer for VIM
- Vim-javascript Vastly improved Javascript indentation and syntax support in Vim.
- NerdCommenter Plugin for intensely orgasmic commenting
- Tabular Script for text filtering and alignment
- DelimitMate Plugin, provides insert mode auto-completion for quotes, parens, brackets, etc.
- Vim-indent-guides A Vim plugin for visually displaying indent levels in code
- Vim-less vim syntax for LESS (dynamic CSS)
- HTML5.vim HTML5 omnicomplete and syntax
- Vim-json Syntax highlighting for JSON in Vim
- Vim-TypeScript Syntax file and other settings for TypeScript.
- Vim-addon-mw-utils vim: interpret a file by function and cache file automatically
- Tlib Some utility functions for VIM
- Vim-tmux-navigator to navigate seamlessly between vim and tmux splits using a consistent set of hotkeys
- UltiSnips The ultimate snippet solution for Vim!
- YouCompleteMe Fast, as-you-type, fuzzy-search code completion
- Vimproc.vim Interactive command execution in Vim
- Tsuquyomi A Vim plugin for TypeScript
- Peaksea The peak sea color
- Rainbow Parentheses Much simpler Rainbow Parentheses
- vim-clang_doxygen Generate Doxygen comments for your C/C++ code
- vim-bitbake Syntax highlighting for bitbake (.bb) files
- Dockerfile Vim syntax file for Docker's Dockerfile and snippets for snipMate.
- drools Syntax highlighting for "Rules Set" files for the DROOLS Rules Engine, a.k.a, JBoss Rules: http://labs.jboss.com/jbossrules/
- grammerous a powerful grammar checker that uses LanguageTool
- localvimrc searches for local vimrc files in the file system tree of the currently opened file.
- fontsize adjust font size via key presses.
- incsearch incrementally highlights ALL pattern matches unlike default 'incsearch'.
- incsearch-fuzzy incremantal fuzzy search extension for incsearch.vim.
- python.vim This indentation script for python tries to match more closely what is suggested in PEP 8.
- git submodules are employed to pull all of the plugins into the container. This enables the latest upstream versions of the plugins to be used. Before building update all of the submodules using
git submodule update --init --recursive
- Alternatively run
./update_and_build.sh
- For the full Golang support you need to mount
/usr/lib/go
. For example, runjare/go-tools
in the detached modedocker create -v /usr/lib/go --name vim-go-tools jare/go-tools /bin/true
and mount its volumes like thisdocker run ... --volumes-from vim-go-tools ... jare/vim-bundle
or add it to the aliasalias edit="docker run -ti --rm --volumes-from go-tools -v $(pwd):/home/developer/workspace jare/vim-bundle"
- If you want to use a go-tool , but vim-go doesn't provide a shorthand - you can simply type, for example,
:!gofmt %
and it will output formatted source of the current buffers(%:p
absolute file path,%:h
head of the file name and%:p:h
is the current directory). If you want to overwrite - use:% ! gofmt %
Thegofmt
tool used as an example, actually, it covered in vim-go.
Same as with the Golang tools. You can use jare/typescript
and mount it in to the /usr/lib/node_modules/
Alternatively, you can put something like this into .bashrc to automatically bootstrap all containers:
#docker vim-bunlde
function ed() {
local dtc_id=$(docker ps -a -q --filter 'name=vim-go-tools')
local ts_id=$(docker ps -a -q --filter 'name=vim-typescript')
if [[ -z "${dtc_id}" ]]; then
echo 'vim-go-tools container not found. Creating...'
docker create -v '/usr/lib/go' --name 'vim-go-tools' \
'jare/go-tools' '/bin/true'
echo 'Done!'
fi
if [[ -z "${ts_id}" ]]; then
echo 'vim-typescript container not found. Creating...'
docker create -v '/usr/lib/node_modules' \
--name 'vim-typescript' 'jare/typescript' '/bin/true'
echo 'Done!'
fi
echo 'Starting Vim'
docker run -ti --rm -p 8080:8080 --volumes-from 'vim-go-tools' \
--volumes-from 'vim-typescript' \
-v $('pwd'):/home/developer/workspace 'jare/vim-bundle' "${@}"
}
export -f ed
- With something like GNOME terminal You should be able to:
- drag and drop text into the Vim.
- use mouse right button menu by holding
Shift
.
<Leader>
mapped to,
. I use the basic mappings from the great amix .vimrc- It's generally good idea to remap
Caps Lock
to theEsc
key on your system. - If Vim or Powerline doesn't look right in the tmux try
tmux -2
- To see fancy arrows you need
PowerlineFonts
http://goo.gl/gBeVbk on your machine(instruction). But if you don't need them removelet g:airline_powerline_fonts = 1
from the .vimrc - If the Golang auto-complete doesn't work try
go install
package
Leave a comment if you found a bug or if you have a suggestion!