vim-bootstrap
Vim Bootstrap provides a simple method for generating .vimrc configuration files for Vim, NeoVim, NeoVim-Qt, MacVim and GVim.
Want to generate your vim/neovim file? Access here!
Pre-requisites
The distribution is designed to work with Vim >= 8 and neovim.
Mac OSX
$ brew install git ctags
Linux
- Ubuntu\Debian
$ sudo apt-get install git exuberant-ctags ncurses-term curl
- Gentoo
$ sudo emerge --ask dev-util/ctags sys-libs/ncurses dev-vcs/git dev-python/pyflakes net-misc/curl
- Arch Linux via pacman
$ sudo pacman -S git ctags ncurses curl
- Fedora
$ sudo dnf install ncurses-devel git ctags-etags curl
- openSUSE
$ sudo zypper in ncurses-devel git ctags curl
BSD
- FreeBSD via packages collection
# pkg install git p5-Parse-ExuberantCTags ncurses curl
Python bundle (optionally)
- pyflakes
- jedi
- neovim (neovim only)
$ pip install flake8 jedi
$ pip2 install --user --upgrade neovim
$ pip3 install --user --upgrade neovim
Elm bundle (optionally)
- elm-test
- elm-oracle
- elm-format
$ npm install -g elm-test
$ npm install -g elm-oracle
$ npm install -g [email protected]
Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Installation
- Download your own vimrc file at https://vim-bootstrap.com
- Put your vimrc file into home folder or
$XDG_CONFIG_HOME/nvim/init.vim
if you use NeoVim
vim: mv ~/Downloads/generate.vim ~/.vimrc
neovim: mv ~/Downloads/generate.vim $XDG_CONFIG_HOME/nvim/init.vim
- Execute ViM and it will install plugins automatically
vim
Fast-installation by URL parameters
Vim-bootstrap generator can accept URL params via request as example below.
curl 'https://vim-bootstrap.com/generate.vim' --data 'editor=vim&frameworks=vuejs&langs=javascript&langs=php&langs=html&langs=ruby' > ~/.vimrc
Updating to the latest version
:VimBootstrapUpdate (thanks to @sherzberg)
:PlugInstall
Offline usage
You can run vim-bootstrap Go package to generate a vimrc file, just download it:
go get github.com/editor-bootstrap/vim-bootstrap
cd $GOPATH/src/github.com/editor-bootstrap/vim-bootstrap
go build
Inside vim-bootstrap folder cd vim-bootstrap
use vim-bootstrap
module (file) like this example:
./vim-bootstrap -langs=python,lua,ruby,javascript,haskell -frameworks vuejs -editor=vim > ~/.vimrc
For more instructions run vim-bootstrap -h
openSUSE repo
vim-bootstrap is also available on openSUSE on both Leap 42.2/42.3 and Tumbleweed. Leap versions must add devel:tools repository before, while Tumbleweed users should have vim-bootstrap in the default repository without the need to add any extra repository.
- Leap 42.2
$ sudo zypper ar -f http://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_42.2/ devel:tools
$ sudo zypper ref
$ sudo zypper in vim-bootstrap
- Leap 42.3
$ sudo zypper ar -f http://download.opensuse.org/repositories/devel:/tools/openSUSE_Leap_42.3/ devel:tools
$ sudo zypper ref
$ sudo zypper in vim-bootstrap
- Tumbleweed
$ sudo zypper ref
$ sudo zypper in vim-bootstrap
Adding a new Theme
Create a folder inside generate/vim_template/themes/
with the name of your theme.
mkdir generate/vim_template/themes/my_theme
Inside this folder, add a file called mytheme.vim
with colorscheme instruction (optionally other configs).
echo "colorscheme mytheme" > generate/vim_template/themes/my_theme/mytheme.vim
Add a .bundle
extension file with instructions of how to install theme.
echo "Plug username/mytheme" > generate/vim_template/themes/my_theme/mytheme.vim.bundle
Submit a PR and when approved new theme was added.
Customization
It's highly recommended to add customizations in a separate file. This way, you can maintain the original vim-bootstrap generated vimrc file and subsequent updates.
For Vim users, the files available for customization are ~/.vimrc.local
and ~/.vimrc.local.bundles
. The former handles general configuration while the latter handles external Vim plugins through vim-plug
.
NeoVim users can also customize their configuration by using $XDG_CONFIG_HOME/nvim/local_init.vim
and $XDG_CONFIG_HOME/nvim/local_bundles.vim
.
Commands
▪️
Basic Commands
Commands | Descriptions |
---|---|
:cd <path> |
Open path /path |
Ctrlw+hjkl | Navigate via split panels |
Ctrlww | Alternative navigate vim split panels |
,. | Set path working directory |
,w or ,x | Next buffer navigate |
,q or ,z | previous buffer navigate |
shiftt | Create a tab |
tab | next tab navigate |
shifttab | previous tab navigate |
,e | Find and open files |
,b | Find file on buffer (open file) |
,c | Close active buffer (close file) |
F2 | Open tree navigate in actual opened file |
F3 | Open/Close tree navigate files |
F4 | List all class and method, support for python, go, lua, ruby and php |
,v | Split vertical |
,h | Split horizontal |
,f | Search in the project |
,o | Open github file/line (website), if used git in github |
,sh | Open shell.vim terminal inside Vim or NeoVim built-in terminal |
,ga | Execute git add on current file |
,gc | git commit (splits window to write commit message) |
,gsh | git push |
,gll | git pull |
,gs | git status |
,gb | git blame |
,gd | git diff |
,gr | git remove |
,so | Open Session |
,ss | Save Session |
,sd | Delete Session |
,sc | Close Session |
> | indent to right |
< | indent to left |
gc | Comment or uncomment lines that {motion} moves over |
YY | Copy to clipboard |
,p | Paste |
Ctrly + , | Activate Emmet plugin |
Ctrlh | Does a fuzzy search in your command mode history |
▪️
Python hotkeys
Commands | Descriptions |
---|---|
SHIFT+k |
Open documentation |
Control+Space |
Autocomplete |
,d |
Go to the Class/Method definition |
,r |
Rename object definition |
,n |
Show where command is usage |
▪️
Ruby hotkeys
Commands | Descriptions |
---|---|
,a |
Run all specs |
,l |
Run last spec |
,t |
Run current spec |
,rap |
Add Parameter |
,rcpc |
Inline Temp |
,rel |
Convert Post Conditional |
,rec |
Extract Constant (visual selection) |
,rec |
Extract to Let (Rspec) |
,relv |
Extract Local Variable (visual selection) |
,rrlv |
Rename Local Variable (visual selection/variable under the cursor) |
,rriv |
Rename Instance Variable (visual selection) |
,rem |
Extract Method (visual selection) |
▪️
Php hotkeys
Commands | Descriptions |
---|---|
,u |
Include use statement |
,mm |
Invoke the context menu |
,nn |
Invoke the navigation menu |
,oo |
Goto definition |
,oh |
Goto definition on horizontal split |
,ov |
Goto definition on vertical split |
,ot |
Goto definition on tab |
,K |
Show brief information about the symbol under the cursor |
,tt |
Transform the classes in the current file |
,cc |
Generate a new class (replacing the current file) |
,ee |
Extract expression (normal mode) |
,ee |
Extract expression (visual selection) |
,em |
Extract method (visual selection) |
,pcd |
cs-fixer fix directory |
,pcf |
cs-fixer fix file |
Learn Vim
Visit the following sites to learn more about Vim:
- Learn Vim Progressively
- Vim Adventures
- Vimcasts
- Byte of Vim
- MinuteVim Tricks
- Join the Church of Vim, and you too can be a saint!
- Vim para noobs (in portuguese)
- Vimbook (in portuguese)
issue with using sudo vim/VimBootstrapUpdate
Hi!
I've been using this package for quite some time and after the switch over from neobundle to what we have now I've been unable to use VimBootstrapUpdate as it clears out my .vimrc file.
I've also come across an issue (randomly on regular files) and 100% broken on the following command:
The moment I start typing something in the buffer I get the following errors:
Here is my current .vimrc vimrc.txt
I'm using macOS Sierra (but this was present in El Capitain as well). I'm also using Vim8 as follows:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 12 2016 17:28:17) MacOS X (unix) version Included patches: 1-2 Compiled by Homebrew
Is there any additional info I can provide for how to fix this?
How do I install on NeoVim?
The guide shows how to install neovim and move the downloaded file, but nothing about install similar to how it's shown with regular vim. Could someone help me out?
Error detected while processing /Users/foo/.vimrc:
I followed all the steps for macOS on README and if I try to open vim (not neo) or run
vim +PlugInstall +qall
I get a lot of errors:Ps: I already have
git
andctags
installed.vim_bootstrap_updater.vim - 'cannot execute :python after using :py3'
This is my first time reporting a bug, so please excuse any protocols that I've breached.
System: Fedora 22 LXDE, with python2, python2-devel, python3, python3-devel installed.
Anyhow, upon starting up with the pre configured vimrc it'll pop out the annoying message:
Quick fix done via changing ~/.vim/bundle/vim-bootstrap-updater/plugin/vim_bootstrap_updater.vim
to
Create an alternative installation method.
It would be interesting to create an alternative installation method because to download via the website makes it miss the updates in the repository. Nobody will get by downloading the site every week to keep up.
gvim on windows
Is possible I use vim-bootstrap on GVIM on windows ?
When I try install I Get This message:
Error detected while processing C:\Users\UserName.vimrc: line 25: E117: Unknown function: plug#begin line 30: E492: Not an editor command: Plug 'scrooloose/nerdtree' line 31: E492: Not an editor command: Plug 'jistr/vim-nerdtree-tabs' line 32: E492: Not an editor command: Plug 'tpope/vim-commentary' line 33: E492: Not an editor command: Plug 'tpope/vim-fugitive' line 34: E492: Not an editor command: Plug 'ctrlpvim/ctrlp.vim' line 35: E492: Not an editor command: Plug 'vim-airline/vim-airline' line 36: E492: Not an editor command: Plug 'vim-airline/vim-airline-themes' line 37: E492: Not an editor command: Plug 'airblade/vim-gitgutter' line 38: E492: Not an editor command: Plug 'sheerun/vim-polyglot' line 39: E492: Not an editor command: Plug 'vim-scripts/grep.vim' line 40: E492: Not an editor command: Plug 'vim-scripts/CSApprox' line 41: E492: Not an editor command: Plug 'bronson/vim-trailing-whitespace' line 42: E492: Not an editor command: Plug 'Raimondi/delimitMate' line 43: E492: Not an editor command: Plug 'majutsushi/tagbar' line 44: E492: Not an editor command: Plug 'scrooloose/syntastic' line 45: E492: Not an editor command: Plug 'Yggdroot/indentLine' line 46: E492: Not an editor command: Plug 'avelino/vim-bootstrap-updater' line 52: E492: Not an editor command: Plug 'Shougo/vimproc.vim', {'do': g:make} line 55: E492: Not an editor command: Plug 'xolox/vim-misc' line 56: E492: Not an editor command: Plug 'xolox/vim-session' line 59: E492: Not an editor command: Plug 'Shougo/vimshell.vim' line 64: E492: Not an editor command: Plug 'SirVer/ultisnips' line 68: E492: Not an editor command: Plug 'honza/vim-snippets' line 71: E492: Not an editor command: Plug 'tomasr/molokai' line 74: E492: Not an editor command: Plug 'vim-scripts/c.vim' line 77: E492: Not an editor command: Plug 'davidhalter/jedi-vim' line 80: E492: Not an editor command: Plug 'vim-perl/vim-perl' line 81: E492: Not an editor command: Plug 'c9s/perlomni.vim' line 84: E492: Not an editor command: Plug 'amirh/HTML-AutoCloseTag' line 85: E492: Not an editor command: Plug 'hail2u/vim-css3-syntax' line 86: E492: Not an editor command: Plug 'gorodinskiy/vim-coloresque' line 87: E492: Not an editor command: Plug 'tpope/vim-haml' line 88: E492: Not an editor command: Plug 'mattn/emmet-vim' line 91: E492: Not an editor command: Plug 'arnaud-lb/vim-php-namespace' line 93: E492: Not an editor command: Plug 'tpope/vim-rails' line 94: E492: Not an editor command: Plug 'tpope/vim-rake' line 95: E492: Not an editor command: Plug 'tpope/vim-projectionist' line 96: E492: Not an editor command: Plug 'thoughtbot/vim-rspec' line 97: E492: Not an editor command: Plug 'ecomba/vim-ruby-refactoring' line 104: E117: Unknown function: plug#end
Vim plug
Replace Neobundle with Vim-Plug
Problems until now:
Vimproc build fails on FreeBSD
The fix is quite easy, just go to ~/.vim/bundle/vimproc.vim and run gmake, but of course it would be easier if the default bootstrap settings included this tiny tweak. I think it SHOULD just a matter of adding
'freebsd' : 'gmake'
after windows, cygwin, mac and unix, but the only thing that works for me is to manually build it, so who knows what the proper solution is.set avelino fork repo official vim-bootstrap-updater package
more than 1 year was opened a PR and we had no return of the @sherzberg so I decided to keep a fork of official (thus keeping the credit of creator) PR: https://github.com/sherzberg/vim-bootstrap-updater/pull/4 by @nemith Accept PR in: https://github.com/avelino/vim-bootstrap-updater/commits/master
Error installing on openSUSE 13.1 (x64)
Hi, @avelino.
I tried install on openSUSE 13.1 but unfortunately got errors.
Before I installed:
Printscreen of my terminal with what happened:
Add default support for vue.js and TypeScript
I know that vim-bootstrap has some default config for supporting
jsx
, can similar be done for.vue
file format. The other thing is native support for TypeScript`:E` returns `ambiguous use of user-defined command`
Vim bootstrap version(number in first line): vim-bootstrap 2022-12-25 06:54:24
Operating system: Description: Ubuntu 20.04.5 LTS
Vim/Nvim version: NVIM v0.4.3
Languages: let g:vim_bootstrap_langs = "c,javascript,python,typescript"
Can't yank a line in Nvim
Description
I can't yank a line in Nvim (
yy
command). I also see this error in the bottom line:The
wl-copy
command is installed in my system.The same bootstrap config works fine in Vim.
Add a name or description for each language icon
This issue is related to the vim-bootstrap website.
Description
When selecting the language, I think it is good to present icons, including the language name they represent. Some icons are not very known. This will improve the accessibility.
For example (in the Vim Boostrap page):
On ohmyz.sh page:
Best regards,
Fernando Pimenta
Neovim with init.lua is faster
We all know how hard it would be to create a separate neovim exclusive config, but the speed it brings is huge. Neovim now has native Language Server support, treesiter for better syntax.
There is a thread on Reddit on how much faster/or better using init.lua could be: https://www.reddit.com/r/neovim/comments/jfs5sb/initvim_to_initlua_any_advantages/
Personally, I am using a plugin that caches lua plugins, which already are faster than pure vim:
The plugin manager is packer (written in lua)
Even it took a long time to implement, this solution would be great
Add description and checkboxes to choose individually plugins
Authoug having language sets of plugins we could have an optional review where the user could enable or disable plugins.
"With descriptions". Because some plugins are not language specific.