{"id":13906682,"url":"https://github.com/jordwalke/VimBox","last_synced_at":"2025-07-18T04:32:26.370Z","repository":{"id":15092335,"uuid":"17818902","full_name":"jordwalke/VimBox","owner":"jordwalke","description":"Simple, Modern MacVim Configuration","archived":false,"fork":false,"pushed_at":"2023-12-03T04:57:45.000Z","size":30122,"stargazers_count":917,"open_issues_count":34,"forks_count":70,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-11-18T17:09:20.468Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hanc00l/wooyun_public","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jordwalke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2014-03-17T06:11:09.000Z","updated_at":"2024-11-05T19:41:15.000Z","dependencies_parsed_at":"2023-12-03T05:36:39.721Z","dependency_job_id":null,"html_url":"https://github.com/jordwalke/VimBox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordwalke%2FVimBox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordwalke%2FVimBox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordwalke%2FVimBox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordwalke%2FVimBox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordwalke","download_url":"https://codeload.github.com/jordwalke/VimBox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226353394,"owners_count":17611695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T23:01:40.530Z","updated_at":"2024-11-25T15:30:31.109Z","avatar_url":"https://github.com/jordwalke.png","language":"Vim script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"# 📢 Announcement: 📢\n\n**I have been working on a new version of vimbox that uses Atom/VSCode style json configuration and allows you to just drag a `VimBox.app` into your applications directory. Some good features:**\n- Self contained `.app` (but still requires that you have MacVim installed).\n- `.json` based configuration.\n- When loading the app, it automatically pulls everything down from this repo.\n- It creates an isolated Vim environment that doesn't disturb your current `~/.vim`/`~/.vimrc`. It is a different approach - better in my opinion. It really is \"vim in a box\" - a sandbox.\n- Also will work on terminal / Linux / Windows. Share your config across platforms. Json configuration can be platform specific `settings.json` vs. `settings.linux.json`, and `settings.osx.gui.json` etc. (no one click `.app` for linux/windows though, you need to create your own launcher).\n\n**[Here is the branch](https://github.com/jordwalke/VimBox/tree/json) that it lives at. Follow the instructions there to try it out.**\n\nThank you for your patience while I have not been super responsive to issues on `#master` branch - it is because I have been working on the new `#json` branch linked above which should take the place of `#master`. Feedback appreciated.\n\n\n\u003ctable width=\"100%\"\u003e\n\u003ctr\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\n\u003ch2\u003eVimBox\u003c/h2\u003e\n\u003cblockquote\u003eModern MacVim Configuration\u003c/blockquote\u003e\n\u003cimg src=\"dotVim/images/VimBox.png\" height=\"256px\" width=\"256px\" /\u003e\n\u003c/td\u003e\n\u003ctd\u003e\n\n\u003cul\u003e\n  \u003cli\u003e\u003ch5\u003eMac Keyboard mappings\u003c/h5\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ch5\u003eFamiliar autocomplete behavior\u003c/h5\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ch5\u003eJavaScript indentation and lint support\u003c/h5\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ch5\u003eSnippets (with JavaScript examples)\u003c/h5\u003e\u003c/li\u003e\n  \u003cli\u003e\u003ch5\u003eSpacegray theme with matching app icon.\u003c/h5\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\n\n\u003cbr\u003e\n\n\u003e VimBox with Atom inspired one-dark theme.\n\n\u003cimg width=\"744px\" height=\"642px\" src=\"dotVim/images/VimBoxScreen_1488x1284.png\" /\u003e\n\n\u003e VimBox's matching application icon\n\n\u003cimg src=\"dotVim/images/iconScreenshot.png\" /\u003e\n\n\nInstallation:\n-------------\n\u003e Quickly try VimBox in place of your existing setup. Back up your existing vim files, and move them out of the way as instructed:\n\n1. If you already have a vim setup, move it safely out of the way or back it up.\n\n        mv ~/.vim ~/.vim_backup    #No trailing slashes to preserve symlinks!\n        mv ~/.vimrc ~/.vimrc_backup\n        mv ~/.gvimrc ~/.gvimrc_backup\n\n\n2. You *Must* Install a [Recent Version of MacVim](http://macvim-dev.github.io/macvim/): (with python support)\n\n        # Alternatively, if you'd rather install via `brew`\n        brew install macvim --with-cscope --python --HEAD\n        brew linkapps    # Put the app in your /Applications directory\n\n3. Clone `VimBox` wherever you like to keep your github clones\n\n        # cd ~/github/     # Or wherever you like to keep github clones\n        git clone https://github.com/jordwalke/VimBox/\n        ln -s `pwd`/VimBox/dotVim ~/.vim      # Link to the cloned vim config\n        ln -s `pwd`/VimBox/dotVimRc ~/.vimrc\n        ln -s `pwd`/VimBox/dotGVimRc ~/.gvimrc\n\n4. Start `MacVim` that you just installed. It will prompt you to download the\n   plugins in the background. If you opt to do so, it may take a while to\n   startup but be patient.\n\n5. `[Recommended]` Install the included vim-airline font so `VimBox` looks like\n   the screenshot with the `vim-airline` bar. From the command line:\n\n        open ./VimBox/dotVim/Fonts/InconsolataDz/Inconsolata-dz\\ for\\ Powerline.otf # Then click \"Install Font\"\n\n6. Install up-to-date node.js if you want JS linting (http://nodejs.org/)\n\n7. Make your MacVim use the VimBox icon (optional):\n\n```lang=bash\nopen /Applications/\n# Find the MacVim app icon and press `⌘+i` to open the information window\nopen ./dotVim/images\n# drag the ApplicationIcon.icns onto the little icon in the information window\n# and restart MacVim.\n```\n  \n  \nFeatures:\n----------\n\n#### Familiar Mac Key Commands\n\n| Key                       | Action                                                   |\n| ------------------------- |----------------------------------------------------------|\n| `⌘+p`                     | Open Anything (`ctrl-p`)                                 |\n| `⌘+n`                     | New Tab                                                  |\n| `⌘+shift+n`               | New Window                                               |\n| `⌘+shift+t`               | Reopen Last Closed Tab                                   |\n| `⌘+w`                     | Close tab/split: Opens to the left (like Sublime) not right (like vim)  |\n| `⌘+s`                     | Save file                                                |\n| `⌘+z`                     | Undo                                                     |\n| `⌘+shift+z`               | Redo                                                     |\n| `⌘+enter`                 | Special Distraction-Free FullScreen Mode                 |\n| `⌘+\\`                     | Toggle File Explorer (Docked `NERDTree`)                 |\n| `⌘+shift+\\`               | Find current file in file explorer                       |\n| `^+\\`                     | Toggle focus between file explorer                       |\n| `⌘+shift+[` / `⌘+shift+]` | Go to previous/next tab                                  |\n| `^+tab` / `^+shift+tab`   | Go to previous/next tab (in normal Vim mode)             |\n| `⌘+1 `                    |                 Go to tab `1`                            |\n| `F5`                      | Sort lines (like Textmate)                               |\n| `⌘+/`                     | Toggle comments - selected range - or line               |\n| `⌘+shift+c`               | format/indent entire file then restore cursor            |\n| `⌘+d`                     | Toggle Diagnostics (errors in location list)             |\n| `⌘+D`                     | Toggle QuickFix list                                     |\n| `⌘+r`                     | \"Run\" - invokes pwd/runFromEditor.sh                     |\n\n\nThe file browser shortcuts are carefully setup so that when you use the\nshortcuts for opening/closing/toggling-focus, the window positions will not be\nresized. Make sure to use `^+\\` if you want to jump back and forth between the\nfile tree and your editor - it will remember the editor you were last in, and\nnot disturb window positions (just like Atom or other modern editors).\n\n#### Mega Escape\n\u003e - `VimBox` has mapped `^+l` to exit out of any modal window/prompt/mode/command to bring you back to normal Vim navigation mode.\n\u003e - It's like the home button on the iPhone.\n\u003e - Unlike regular `\u003cEsc\u003e`, mega-escape doesn't move your cursor when escaping.\n\u003e - Remap \u003ca href=\"http://stackoverflow.com/questions/15435253/how-to-remap-the-caps-lock-key-to-control-in-os-x-10-8\"\u003e CapsLock to control\u003c/a\u003e and never reach for `Escape` again. Hit the `CapsLock` key and `l` right on the home row.\n\n| Key          | Action      |\n| ------------ |-------------|\n| `^+l`        | Mega Escape |\n\n#### Airline/Spacegray\n\n`VimBox` includes `vim-airline` and `Spacegray` color scheme.\n\n#### Braces and Pairs\n\n- Inserting `{`, `[`, `'`, or `\"` automatically inserts the closing character.\n- When hitting enter with the cursor between two braces `{|}` the newline is formatted with an extra indentation.\n- The behavior is identical to Sublime/Textmate.\n\n#### AutoComplete/Snippets\n\n- Completions pop up automatically.\n- Like Sublime, `VimBox` accepts highlighted entries via `tab` or `enter`.\n- `tab` also triggers a snippet when applicable, and `tab` will allow \"tabbing\" through the snippet placeholders.\n- Place custom snippets in `~/.vim/myUltiSnippets/`\n- If the completion window is open and you want to insert a newline instead of inserting the completion, press `shift+enter` or `control+enter`.\n\n\n#### Distraction Free UI Tabs\n\n- When not in full screen mode, Mac style metalic tabs are used.\n- When in full-screen mode, those tabs become flat and blend into the background so you can focus on the code.\n\n\n#### One File, One Location\n\nIncluded plugins are configured so that opening a file will always focus the window/tab/split where that file is already open. This is how most modern editors work.\n\n#### Many Plugins, One Interaction Language\n\nMultiple plugins (`ctrl-p` and `NERDTree`) have been configured so that they have consistent keyboard mappings. For example, `s` represents the notion of a \"vertical split\", and `h` represents horizontal in both plugins (though one plugin might require a `ctrl` modifier in some cases.)\n\n#### Command-P Search Window\n\nThe `ctrl-p` plugin has been configured to \"do the right thing\", which means searching for some combination of recently used files and/or the contents under the current working directory. It caches the results, but if you open it from your home directory, it could take a while to scan your entire directory.\n\n| Key          | Action        |\n| ------------ |-------------|\n| `⌘+p`       | Open Anything and begin searching for file|\n| `enter`      | While searching, opens the top hit in new tab or jump to existing window if already open |\n| `c-s`        | While searching, opens the top hit in a vertical split or jump to existing window if already open |\n| `c-h`        | While searching, opens the top hit in horizontal split or jump to existing window if already open |\n| `⌘+shift+c`  | While searching, refreshes the search results if files have changed on disk|\n| `ctrl+c`     | Kills a slow search |\n\n#### NERDTree\n\n`NERDTree` is included and is configured to act as a left-nav bar (toggle it via `⌘+e`). Its keymappings have been configured to be consistent with the `ctrl-p` plugin.\n\n| Key          | Action        |\n| ------------ |-------------|\n| `⌘+e`       | Toggle side bar file explorer |\n| `⌘+E`       | Reveal current file in side bar file explorer |\n| `j`/`k`      | While explorer focused, move up and down |\n| `enter`      | While explorer focused, opens a file in new tab or jump to existing window if already open |\n| `s`          | While explorer focused, opens a file in a vertical split or jump to existing window if already open |\n| `h`          | While explorer focused, opens a file in horizontal split or jump to existing window if already open |\n| `u`          | While explorer focused, Move up a directory |\n| `o`          | While explorer focused, Expand a subdirectory |\n| `CD`         | While explorer focused, Make the file explorer's directory equal to Vim's `cwd`  |\n| `cd`         | While explorer focused, make Vim's `cwd` equal to the directory under the cursor |\n| `m`         | While explorer focused, show complete menu of possible commands to execute |\n\n\n#### Tabs And Splits Navigation\n\u003e Jump around quickly to the next tab or split with a single key press. Go back the other direction by pressing shift.\n\n| Key          | Action        |\n| ------------ |-------------|\n| `⌘+shift+h`, `⌘+shift+l` | While in Vim's normal mode - focus split to the left or right |\n| `⌘+shift+j`, `⌘+shift+k` | While in Vim's normal mode - focus split to the top or bottom (not in diff mode) |\n| `⌘+shift+j`, `⌘+shift+k` | While in Vim's normal mode - *and* diff mode, go to next / previous changes |\n| `⌘+shift+p`              | While in Vim's normal mode - focus *previously* focused tab |\n| `Space`/`shift+Space`    | While in Vim's normal mode - go to next/preious tab |\n| `tab`/`shift+tab`        | While in Vim's normal mode - go to next/previous split |\n\n\n####JavaScript Development\n\n#### JavaScript Linting\n- Excellent JavaScript indenting and inline linting with support for `JSX`.\n- Syntax error highlighting via Syntastic.\n- Type error highlighting via `flow`. Just have `flow` installed on your path, and type/syntax errors will be underlined in red. As always, hit `⌘+l` to toggle the summary of the file's errors.\n\n#### JavaScript Snippets\n- JavaScript snippets are include, but you can add your own for any language you like\n\n| Key          | Action        |\n| ------------ |-------------|\n| `for` `tab`  | `for` loop |\n| `if`       | `if` statement|\n| `forin` `tab`| `for`-`in` loop |\n| `fun` `tab`| `function` definition |\n| `lam` `tab`| Lambda function |\n| `try` `tab`| `try`/`catch` |\n| `log` `tab`| `console.log` |\n| `logo` `tab`| Log stringified object to console |\n| `tag` `tab`| `JSX` tag `\u003ctypeHere att={}\u003e\u003c/typeHere\u003e`|\n| `logo` `tab`| Many more including \u003ca href=\"https://github.com/facebook/react\"\u003eReactJS\u003c/a\u003e helpers |\n\n\n#### JavaScript DocBlock Generator\n\nThe following key mapping generates docblock comments. `\u003ctab\u003e` will select the parameters in the generated docblock so you can edit the descriptions/types. Works with `ES6` functions.\n\n| Key          | Action        |\n| ------------ |-------------|\n| `⌘+shift+i` | Generate JS Docblock  - when cursor is above a function|\n\n\nGit Integration:\n---------\n\n#### Setup DiffTool:\n\nAny result of a `git diff` command can be viewed in a side-by-side diff view inside of `MacVim`. All of your familiar `vim` key commands work while browsing your diff. Place this in your `~/.gitconfig`:\n\n        [diff]\n            tool = default-difftool\n        [difftool \"default-difftool\"]\n            cmd = \"~/.vim/mvimgitdiff.sh \" $LOCAL $REMOTE\n\nNow you can use the `git difftool` command exactly like you use `git diff`, but a MacVim window will appear:\n\n\u003cimg width=\"744px\" height=\"642px\" src=\"dotVim/images/VimDiff_1488x1284.png\" /\u003e\n\n#### Setup MergeTool:\n\nResolving merge conflicts is simple with `MacVim`. Just put this in your `~/.gitconfig`.\n\n        [mergetool]\n          prompt = false\n          # See bashrc for exporting the editor across all apps, not just git.\n        [mergetool \"mvimdiff\"]\n          cmd=\"/Applications/MacVim.app/Contents/MacOS/Vim -g -f '+windo set diff scrollbind scrollopt+=hor nowrap' -c 'Gdiff' $MERGED -c 'au VimLeave * !open -a iTerm'\"\n          # cmd=\"mvim -c 'Gdiff' $MERGED\"     # use fugitive.vim for 3-way merge\n          keepbackup=false\n\n        [merge]\n          tool = mvimdiff\n\n\nNow, `git mergetool` will resolve rebase and merge conflicts directly inside of `MacVim`.\n\n\n#### Setup Commit Message Editor:\n\nMake sure to tell your shell that `MacVim` is the way that you'd like to edit commit messages. This special command will ensure that when you close your `MacVim` window, you will return back to the command line `iTerm`. Replace with your shell rc file and terminal app name.\n\n\n    echo export EDITOR='mvim -f --nomru -c \"au VimLeave * !open -a iTerm\"' \u003e\u003e ~/.bashrc\n    echo export GIT_EDITOR='mvim -f --nomru -c \"au VimLeave * !open -a iTerm\"' \u003e\u003e ~/.bashrc\n\n\n\n\nPlugin System:\n---------\n\n`VimBox` achieves its features through configuration of several plugins, but\nthose should be considered implementation details of the `VimBox` distribution.\n`VimBox` uses modern editors as a \"spec\" for features and will configure\nseveral plugins in order to conform to that spec.\n\n- You can add any plugin you like using the `Plug` command.\n- Add custom plugins using the `Plug` command inside\n  `~/.vim/bundlesVimRc.custom`.\n- Customize `~/.vim/vimrc.custom.before` to configure Vim before any of the\n  bundles are loaded, and customize `~/.vim/vimrc.custom.after` to configure\n  Vim after plugins are loaded.\n\n\nCustomizing:\n---------\nIn `~/.vim/vimrc.custom.before`/`~/.vim/vimrc.custom.after` you may set any options you like. (See \"Plugin System\" section above).\n\n`VimBox` will look to see if you have defined the following variables defined in your `~/.vim/vimrc.custom.before`:\n\n| Key                      | Behavior                |\n| ------------------------ |-------------------------|\n| `let g:textColumns = 82` | Set text wrapping width |\n| `let g:tabSize = 2`      | Set tab width           |\n\n\nUsing VimBox's configuration from NeoVim\n---------\n\n    mkdir ~/.config\n    ln -s ~/.vim ~/.config/nvim\n    ln -s ~/.vimrc ~/.config/nvim/init.vim\n\nLicense:\n-------\n\nSee the license file included. Any dependencies that are included in `VimBox`\nmay have their own license. In the event any dependency is include in `VimBox`,\nan attempt has been made to also include its corresponding license in the\ndirectory containing that licensed work.\n\nOrigins:\n--------\nSee [./ORIGINS.md](ORIGINS.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordwalke%2FVimBox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordwalke%2FVimBox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordwalke%2FVimBox/lists"}