Skip to Content

Vim Plugins and Pathogen (The Complete Guide)

Vim Plugins and Pathogen (The Complete Guide)

Vim does a lot with its base install and provides everything you’d expect from a CLI text editor, but to unlock even further awesomeness one needs to delve into the vast libraries of plugins on offer.

One such site that aims to index these plugins is:

http://vimawesome.com/

Which is awesome in its own right.

To install said plugins there are several varying install solutions on offer (Vundle, NeoBundle, VimPlug, Pathogen, etc). In this post I’ll follow the most basic method of using Pathogen to install Vim plugins, whilst highlighting and describing a list of my own thus far installed and used plugins.


1 – Install Pathogen

Start by making the two configuration directories in your user’s home directory, here’s how to do this:

[alert-announce]

  1. $ mkdir -p ~/.vim/autoload ~/.vim/bundle && \

[/alert-announce]

Now in the prompt that’s initiated from the last command retrieve the contents of the two new folders with Curl:

[alert-announce]

  1. > curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim

[/alert-announce]

Install Curl first if you don’t have it install it on Debian/Ubuntu with:

[alert-announce]

  1. $ sudo apt-get install curl

[/alert-announce]

Or on Arch Linux with:

[alert-announce]

  1. $ sudo pacman -S curl

[/alert-announce]

Check out Pathogen plugin manager on Github.

2 – Edit .vimrc

After returning to the command line continue by opening your ~/.vimrc file for writing:

[alert-announce]

  1. $ vim ~/.vimrc

[/alert-announce]

Then add these two lines to run Pathogen and enable plugins:

[alert-announce]

~/.vimrc

  1. execute pathogen#infect()
  2. filetype plugin indent on

[/alert-announce]

Save and quit.


3 – Install Plugins

Any plugins I use I’ll add details about here in this section.

vim-markdown

To install vim-markdown use these two commands on your system (with Git installed):

[alert-announce]

  1. $ cd ~/.vim/bundle && \
  2. > git clone git://github.com/plasticboy/vim-markdown.git

[/alert-announce]

To disable the “folding” in markdown files provided by vim-markdown add this line to your ~/.vimrc config file:

[alert-announce]

~/.vimrc

  1. let g:vim_markdown_folding_disabled=1

[/alert-announce]

Commands

:Toc create a quickfix vertical window navigable table of contents with the headers.

:Toch Same as :Toc but in an horizontal window.

:Toct Same as :Toc but in a new tab.

:Tocv: Same as :Toc for symmetry with :Toch and :Tocv

SuperTab

SuperTab is an auto-completion plugin that allows extra insert mode completion using the key.

After typing a few letters of a word that exists within the current open buffer (vim session) SuperTab will list the auto-completion options it.

[alert-announce]

  1. $ git clone https://github.com/ervandew/supertab.git ~/.vim/bundle/supertab

[/alert-announce]

NERD Tree

NERD tree allows you to explore your filesystem in order to easily open files and directories. It takes the form of a tree which you manipulate with the keyboard and/or mouse. It also supports basic filesystem operations.

[alert-announce]

  1. $ git clone https://github.com/scrooloose/nerdtree ~/.vim/bundle/supertab

[/alert-announce]

Include this next line in your ~/.vimrc to stop garbled characters and broken directory traversing in your NERDTree.:

[alert-announce]

~/.vimrc

  1. let NERDTreeDirArrows = 0

[/alert-announce]

Running NERD Tree

To start a tree in the currently opened file’s directory type this into Vim:

[alert-announce]

  1. :NERDTree

[/alert-announce]

To do the same but commence the tree in a separate directory, specify the directory path like this:

[alert-announce]

  1. :NERDTree /etc/X11/Xresources/

[/alert-announce]

To close the tree in the current tab use:

[alert-announce]

  1. :NERDTreeClose

[/alert-announce]

To quickly find the current file in the tree:

[alert-announce]

  1. :NERDTreeFind

[/alert-announce]

Bookmarks

When the NERD Tree window/tab is active you can type the next command in the current buffer, to bookmark a file or directory that is currently highlighted by the tree.

[alert-announce]

  1. :Bookmark bookmark_name

[/alert-announce]

Opening bookmark is done with:

[alert-announce]

  1. :OpenBookmark bookmark_name

[/alert-announce]

If you need to remove a bookmark then use

[alert-announce]

  1. :ClearBookmarks bookmark_name bookmark_name bookmark_name

[/alert-announce]

Note: If no bookmark names are passed then this will remove all bookmarks on the current node.

Any previous bookmarks made with NERDTree can be used to start the tree by providing the bookmark name. The second command in this next example provides auto-completion when typing out the bookmark name, both commands have the same result, however:

[alert-announce]

  1. :NERDTree bookmark_name
  2. :NERDTreeFromBookmark bookmark_name

[/alert-announce]

NERD tree Mappings

[alert-announce]

  1. —————————————————————————–
  2. 2.3. NERD tree Mappings *NERDTreeMappings*
  3. Default Description~ help-tag~
  4. Key~
  5. o…….Open files, directories and bookmarks………………..|NERDTree-o|
  6. go……Open selected file, but leave cursor in the NERDTree…..|NERDTree-go|
  7. t…….Open selected node/bookmark in a new tab……………..|NERDTree-t|
  8. T…….Same as ‘t’ but keep the focus on the current tab……..|NERDTree-T|
  9. i…….Open selected file in a split window…………………|NERDTree-i|
  10. gi……Same as i, but leave the cursor on the NERDTree……….|NERDTree-gi|
  11. s…….Open selected file in a new vsplit…………………..|NERDTree-s|
  12. gs……Same as s, but leave the cursor on the NERDTree……….|NERDTree-gs|
  13. O…….Recursively open the selected directory………………|NERDTree-O|
  14. x…….Close the current nodes parent………………………|NERDTree-x|
  15. X…….Recursively close all children of the current node…….|NERDTree-X|
  16. e…….Edit the current dir……………………………….|NERDTree-e|
  17. <CR>……………same as |NERDTree-o|.
  18. double-click…….same as the |NERDTree-o| map.
  19. middle-click…….same as |NERDTree-i| for files, same as
  20. |NERDTree-e| for dirs. 
  21. D…….Delete the current bookmark ………………………..|NERDTree-D|
  22. P…….Jump to the root node………………………………|NERDTree-P|
  23. p…….Jump to current nodes parent………………………..|NERDTree-p|
  24. K…….Jump up inside directories at the current tree depth…..|NERDTree-K|
  25. J…….Jump down inside directories at the current tree depth…|NERDTree-J|
  26. <C-J>…Jump down to the next sibling of the current directory…|NERDTree-C-J|
  27. <C-K>…Jump up to the previous sibling of the current directory.|NERDTree-C-K| 
  28. C…….Change the tree root to the selected dir……………..|NERDTree-C|
  29. u…….Move the tree root up one directory………………….|NERDTree-u|
  30. U…….Same as ‘u’ except the old root node is left open……..|NERDTree-U|
  31. r…….Recursively refresh the current directory…………….|NERDTree-r|
  32. R…….Recursively refresh the current root…………………|NERDTree-R|
  33. m…….Display the NERD tree menu………………………….|NERDTree-m|
  34. cd……Change the CWD to the dir of the selected node………..|NERDTree-cd|
  35. CD……Change tree root to the CWD…………………………|NERDTree-CD| 
  36. I…….Toggle whether hidden files displayed………………..|NERDTree-I|
  37. f…….Toggle whether the file filters are used……………..|NERDTree-f|
  38. F…….Toggle whether files are displayed…………………..|NERDTree-F|
  39. B…….Toggle whether the bookmark table is displayed………..|NERDTree-B| 
  40. q…….Close the NERDTree window…………………………..|NERDTree-q|
  41. A…….Zoom (maximize/minimize) the NERDTree window………….|NERDTree-A|
  42. ?…….Toggle the display of the quick help…………………|NERDTree-?| 
  43. —————————————————————————–

[/alert-announce]

Check out NERDtree plugin on Github.

Syntastic

This is a syntax checking plugin for Vim that runs files through various external syntax checkers to display any resulting errors to the user. This can be done on demand if needed, or automatically as files are saved. If syntax errors are detected, the user is notified and is happy because they didn’t have to compile their code or execute their script to find them!

Here are the languages it has built in support for:

“ActionScript, Ada, API Blueprint, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and iOS property lists, Puppet, Python, R, Racket, Relax NG, reStructuredText, RPM spec, Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope Page Templates, and Zsh.”

Install the plugin with Pathogen as usual via:

[alert-announce]

  1. $ git clone https://github.com/scrooloose/syntastic.git ~/.vim/bundle/syntastic

[/alert-announce]

Include these new lines in your ~/.vimrc to ensure Syntastic works and displays its content properly:

[alert-announce]

~/.vimrc

  1. let g:syntastic_always_populate_loc_list = 1
  2. let g:syntastic_auto_loc_list = 1
  3. let g:syntastic_check_on_open = 1
  4. let g:syntastic_check_on_wq = 0
  5. set statusline+=\ %=%#warningmsg#
  6. set statusline+=\ %=%{SyntasticStatuslineFlag()}
  7. set statusline+=\ %=%*

[/alert-announce]

Check out Syntastic Plugin on Github

fugitive.vim

“Fugitive.vim may very well be the best Git wrapper of all time.”

This plugin adds a whole new set of commands to Vim to make using Git smoother, flexible, more varied, and all from within the Vim session in question.

Install it as usual with:

[alert-announce]

  1. $ git clone https://github.com/tpope/vim-fugitive.git ~/.vim/bundle/vim-fugitive

[/alert-announce]

Note: The percent symbol (%) is short-hand for the path of the current file.

Base Fugitive Commands

Git fugitive.vim Action
:Git add % :Gwrite Stage the current file to the index
:Git checkout % :Gread Revert current file to last checked in version
:Git rm % :Gremove Delete the current file and the corresponding Vim buffer
:Git mv % :Gmove Rename the current file and the corresponding Vim buffer
:Git commit :Gcommit Opens up a split window to enter a commit message and features Vim’s auto-completion functionality (CTRL + N). :wq and ENTER to confirm.
:Git blame % :Gblame Opens a vertically split window containing annotations for each line of the file: the last commit reference, with author and timestamp. When you scroll one, the other window follows.
:Git status :Gstatus Opens a split window with status, that is interact-able. CNTRL+N & CNTRL + P moves between files names listed, pressing - minus whilst untracked files are highlighted will add it to the index, - on the added modified files will remove them from the index. You can highlight multiple files with visual mode. p on a highlighted file opens up the specific file changes. ENTER opens the highlighted file in the window beneath
:Git diff % :Gdiff Shows current individual file’s insertions or removals in comparison to indexed version.

Check out fugitive.vim Plugin on Github

goyo.vim

Distraction-free writing tool that sets the writing dimensions suitable for non-technical and non-programming contexts. It also removes any unnecessary interface elements from the Vim UI. Works well with the limelight.vim plugin is shown after this one.

goyo.vim

Install it from Github with:

[alert-announce]

  1. $ git clone https://github.com/junegunn/goyo.vim.git ~/.vim/bundle/goyo.vim

[/alert-announce]

Toggle Goyo on:

[alert-announce]

  1. :Goyo

[/alert-announce]

Toggle Goyo off:

[alert-announce]

  1. :Goyo!

[/alert-announce]

Toggle Goyo on but with a specific width:

[alert-announce]

width

  1. :Goyo 120

[/alert-announce]

Or with a specific height:

[alert-announce]

height

  1. :Goyo x30

[/alert-announce]

Both a specific width and height work too:

[alert-announce]

both

  1. :Goyo 120×30

[/alert-announce]

Percentages can be passed instead:

[alert-announce]

percentage

  1. :Goyo 120×30%

[/alert-announce]

Defaults can be set in your ~/.vimrc file via:

[alert-announce]

~/.vimrc

  1. g:goyo_width (default: 80)
  2. g:goyo_height (default: 85%)
  3. g:goyo_linenr (default: 0)

[/alert-announce]

Check out goyo.vim Plugin on Github

limelight.vim

Allows you to focus and highlight blocks of text and content dynamically, useful for writing oriented environments. Works well with the previous Goyo plugin.

limelight.vim

Install with Pathogen as normal:

[alert-announce]

  1. $ git clone https://github.com/junegunn/limelight.vim.git ~/.vim/bundle/limelight.vim

[/alert-announce]

Turn Limelight on:

[alert-announce]

  1. :Limelight

[/alert-announce]

Turn Limelight on at a specific brightness, can use any value between 0.0 ~ 1.0 where the higher the value the brighter/darker it is:

[alert-announce]

  1. :Limelight0.3

[/alert-announce]

Turn Limelight off:

[alert-announce]

  1. :Limelight!

[/alert-announce]

Check out limelight.vim Plugin on Github

vim-startify

This plugin provides an awesome start menu that can be seen whenever Vim is called on its own without any arguments or piped text.

Install with Pathogen as normal:

[alert-announce]

  1. $ git clone https://github.com/mhinz/vim-startify.git ~/.vim/bundle/vim-startify.vim

[/alert-announce]

Run Vim in a terminal to see the plugin:

[alert-announce]

  1. $ vim

[/alert-announce]

vim startify

Startify Layout

This is the layout of Startify and how it organises its content by default:

Custom header – How about some ASCII art action? Perhaps even dynamically generated?

Default: <empty>

Recently used files from directory – List recently modified files from the current directory recursively. The list can also be filtered.

Default: <enabled>

Recently used files: List recently used files. The list can also be filtered.

Default: <enabled>

Sessions: List all your sessions from a certain directory, when you’ve made them with the in-built session commands.

Default: ~/.vim/session

Bookmarks – Define bookmarks, thus entries for files that will always be listed. Again appears when you define them.

Default: <empty>

Custom footer: Same as the custom header.. but at the bottom.

Default: <empty>

Navigating the menu can be done by using the usual Vim keys j k or just by keying in whatever is written between the square brackets on that line. You can also double-click anywhere on a line to highlight the paths.

Moreover, you can open several files at once if needed.

Whilst the cursor is on an entry hit either:

  • b – Opens in same window,
  • s – Open in a split window.
  • t – Open in a tab.

There is also e for creating an empty buffer (new file), and i for creating an empty buffer and jumping into insert mode straight away, and then q for quitting the menu.

You can always reopen the Stratify screen via :Startify inside a Vim session.

##Startify Sessions
Using :mksession in Vim to save a Session.vim file to the current directory will show the session as an option in the Startify menu. It will be shown at the top of all lists as entry [0] .

The vim-startify inbuilt session commands can also be used to place saved session files in the ~/.vim/sessions/ folder.

These inbuilt session commands are:

  • :SLoad – Load a session.
  • :SSave – Save a session.
  • :Delete – Delete a session.

Startify Custom Header

Add this line to your ~/.vimrc file to generate an ASCII art cow displaying random both serious and humorous quotes in the Stratify page:

[alert-announce]

~/.vimrc

  1. let g:startify_custom_header =
  2. \ map(split(system(‘fortune | cowthink ‘), ‘\n’), ‘” “. v:val’) + [”,”]

[/alert-announce]

Note: You must have cowsay and fortune installed for this to work.

Instead hardcoded ASCII art or any other message can be set like so:

[alert-announce]

~/.vimrc

  1. let g:startify_custom_header = [
  2. \ ‘ ________ __ __ ‘,
  3. \ ‘ __ /\_____ \/\ \\ \ ‘,
  4. \ ‘ __ __ /\_\ ___ ___ \/___//”/”\ \ \\ \ ‘,
  5. \ ‘ /\ \/\ \\/\ \ /” __` __`\ /” /” \ \ \\ \_ ‘,
  6. \ ‘ \ \ \_/ |\ \ \/\ \/\ \/\ \ /” /”__ \ \__ ,__\’,
  7. \ ‘ \ \___/ \ \_\ \_\ \_\ \_\ /\_/ /\_\ \/_/\_\_/ ‘,
  8. \ ‘ \/__/ \/_/\/_/\/_/\/_/ \// \/_/ \/_/ ‘,
  9. \ ”,
  10. \ ”,
  11. \ ]

[/alert-announce]

Similar to the Header except appears at the bottom of the menu. This example in the next code snippet displays the date and time in the machine’s local format, and the operating system’s name and version number:

[alert-announce]

~/.vimrc

  1. let g:startify_custom_footer =
  2. \ [”] + map(split(system(‘date -R’), ‘\n’), ‘” “. v:val’) + [”] + map(split(system(‘lsb_release -a | tail -n 3’), ‘\n’), ‘” “. v:val’) + [”]

[/alert-announce]

Extra Startify Variables

There are more variables that can be defined and are documented in:

~/.vim/bundle/vim-startify/doc/startify.txt

Here are two more that set up the hard coded bookmarks, and another that deletes session file buffers:

[alert-announce]

~/.vimrc

  1. let g:startify_bookmarks = [ ‘/etc/apache2/apache2.conf’,’~/.vimrc’]        “Hard-coded vim-startify bookmarks.
  2. 20 let g:startify_session_delete_buffers = 1                “Deletes any session file buffers when a session is loaded.

[/alert-announce]

Check out vim-startify Plugin on Github

eunuch-vim

This strangely named plugin adds some much appreciated Unix command functionality into Vim.

Install it in Pathogen as usual by cloning the repository with:

[alert-announce]

  1. $ git clone https://github.com/tpope/vim-eunuch.git ~/.vim/bundle/vim-eunuch

[/alert-announce]

The features of eunuch-vim include:

  • :Remove – Delete a buffer and the file on disk simultaneously.
  • :Unlink – Like :Remove, but keeps the now empty buffer.
  • :Move – Rename a buffer and the file on disk simultaneously.
  • :Rename – Like :Move, but relative to the current file’s containing directory.
  • :Chmod – Change the permissions of the current file.
  • :Mkdir – Create a directory, defaulting to the parent of the current file.
  • :Find – Run find and load the results into the quickfix list.
  • :Locate – Run locate and load the results into the quickfix list.
  • :Wall – Write every open window. Handy for kicking off tools like guard.
  • :SudoWrite – Write a privileged file with sudo.
  • :SudoEdit – Edit a privileged file with sudo.
  • File type detection for sudo -e is based on original file name.
  • New files created with a shebang line are automatically made executable.
  • New init scripts are automatically pre-populated with the /etc/init.d/skeleton file.

Check out vim-eunuch Plugin on Github

vim-wordy

“Wordy is not a grammar checker. Nor is it a guide to proper word usage. Rather, wordy is a lightweight tool to assist you in identifying those words and phrases known for their history of misuse, abuse, and overuse, at least according to usage experts. For example, if wordy highlights moreover in your document, a word for which no good usage exists, you should consider a rewrite to eliminate it. But if wordy highlights therefore in a sentence where you can demonstrate the usage is sound, you can elect to keep it —wordy be damned.”

Still not sure how this works?

See the gif below:

vim-worthy

Install it with this line:

[alert-announce]

  1. $ git clone https://github.com/reedes/vim-wordy.git ~/.vim/bundle/vim-wordy

[/alert-announce]

To disable it and restore your previous Vim environment after using one of the below options, enter the command:

[alert-announce]

  1. :NoWordy

[/alert-announce]

Use Vim’s Normal mode commands for navigating misspelled words to go to those words flagged by wordy.

  • ]s – Move to next misspelled word after the cursor.
  • [s – Like ]s but search backwards.

Weak & Lazy Usage

[alert-announce]

  1. :Wordy weak

[/alert-announce]

Redundant & Problematic Usage

[alert-announce]

  1. :Wordy redundant
  2. :Wordy problematic

[/alert-announce]

Puffery & Jargon

[alert-announce]

  1. :Wordy puffery
  2. :Wordy business-jargon
  3. :Wordy art-jargon

[/alert-announce]

Manipulative Language

[alert-announce]

  1. :Wordy weasel

[/alert-announce]

To Be & The Passive Voice

[alert-announce]

  1. :Wordy being
  2. :Wordy passive-voice

[/alert-announce]

Colloquialisms, Idioms, and Similies

[alert-announce]

  1. :Wordy colloquial
  2. :Wordy idiomatic
  3. :Wordy similies

[/alert-announce]

Miscellaneous

[alert-announce]

  1. :Wordy said-synonyms
  2. :Wordy opinion
  3. :Wordy contractions
  4. :Wordy vague-time

[/alert-announce]

Check out vim-wordy Plugin on Github

gist-vim

This is a plugin for creating and pushing Gists – http://gist.github.com

gist-vim Setup

Install the plugin by cloning the gist-vim repository:

[alert-announce]

  1. $ git clone https://github.com/mattn/gist-vim.git ~/.vim/bundle/gist-vim

[/alert-announce]

Then also install the webapi-vim plugin as gist-vim requires it to authenticate to Github:

[alert-announce]

  1. $ git clone https://github.com/mattn/webapi-vim.git ~/.vim/bundle/webapi-vim

[/alert-announce]

Now ensure your username is set in Git’s global config file with the next command, where 5car1z is replaced with your own Git username:

[alert-announce]

  1. $ git config –global github.user 5car1z

[/alert-announce]

Open a blank Vim file and enter the basic command to begin authenticating with Github:

[alert-announce]

  1. :Gist

[/alert-announce]

Enter your Github account password:

[alert-announce]

  1. :Gist

[/alert-announce]

[alert-announce]

  1. Gist.vim requires authorization to use the Github API. These settings are stored in “~/.gist-vim”. If you want to revoke, do “rm ~/.gist-vim”.
  2. Github Password for 5car1z:

[/alert-announce]

Now the token file is created in your user’s home directory you can continue onto using the plugin. If you stop using the plugin, remember to remove this file. Or to revoke the associated Github token, go to the list of “Authorised applications” on Github’s “Account Settings” through their website.

gist-vim Commands

Post the current buffer (file) to Github Gists using the default privacy option:

[alert-announce]

  1. :Gist

[/alert-announce]

Create a private Gist:

[alert-announce]

  1. :Gist -p

[/alert-announce]

Create a public Gist – Only relevant if you’ve set Gists to be private by default:

[alert-announce]

  1. :Gist -P

[/alert-announce]

Create a Gist anonymously:

[alert-announce]

  1. :Gist -a

[/alert-announce]

Create a Gist with all open buffers:

[alert-announce]

  1. :Gist -m

[/alert-announce]

Edit the Gist (you need to have opened the gist buffer first). You can update the Gist with the :w command within the Gist buffer:

[alert-announce]

  1. :Gist -e

[/alert-announce]

Edit the Gist with the name example.sh (you need to have opened the Gist buffer first):

[alert-announce]

  1. :Gist -e example.sh

[/alert-announce]

Post/Edit the Gist with an added description (you need to have opened the Gist buffer first):

[alert-announce]

  1. :Gist -s Add words here for a description of the gist.
  2. :Gist -e -s Add words here for a description of the gist after editing.

[/alert-announce]

Delete the Gist (you need to have opened the Gist buffer first) and password authentication is required:

[alert-announce]

  1. :Gist -d

[/alert-announce]

Fork the Gist (you need to have opened the Gist buffer first).

Password authentication is required:

[alert-announce]

  1. :Gist -f

[/alert-announce]

Star the Gist (you need to have opened the Gist buffer first).

Password authentication is required:

[alert-announce]

  1. :Gist +1

[/alert-announce]

Unstar the Gist (you need to have opened the gist buffer first).

Password authentication is required:

[alert-announce]

  1. :Gist -1

[/alert-announce]

Get gist example-name from Github:

[alert-announce]

  1. :Gist example-name

[/alert-announce]

Get gist example-name and add it to the clipboard:

[alert-announce]

  1. :Gist -c example-name

[/alert-announce]

List your public Gists:

[alert-announce]

  1. :Gist -l

[/alert-announce]

List Gists from user 5car1z on Github:

[alert-announce]

  1. :Gist -l 5car1z

[/alert-announce]

List everyone’s Gists:

[alert-announce]

  1. :Gist -la

[/alert-announce]

List Gists only from your starred Gists:

[alert-announce]

  1. :Gist -ls

[/alert-announce]

Open the Gist in a web browser after you post or update it.

[alert-announce]

  1. :Gist -b

[/alert-announce]

gist-vim Variables

To make gist-vim detect filetypes from the filename enable:

[alert-announce]

~/.vimrc

  1. let g:gist_detect_filetype = 1

[/alert-announce]

If you want to set it to open your web browser along with a Gist post:

[alert-announce]

~/.vimrc

  1. let g:gist_open_browser_after_post = 1

[/alert-announce]

If you want to set or change the browser in question, where firefox is the name of the browser’s command line program:

[alert-announce]

~/.vimrc

  1. let g:gist_browser_command = ‘firefox %URL% &’

[/alert-announce]

If you want to show your private Gists as part of the :Gist -l command:

[alert-announce]

~/.vimrc

  1. let g:gist_show_privates = 1

[/alert-announce]

If you want all your Gist posts to be private by default:

[alert-announce]

~/.vimrc

  1. let g:gist_post_private = 1

[/alert-announce]

If you want all your Gist posts to be anonymous by default:

[alert-announce]

~/.vimrc

  1. let g:gist_post_anonymous = 1

[/alert-announce]

If you want to manipulate multiple files in a gist:

[alert-announce]

~/.vimrc

  1. let g:gist_get_multiplefile = 1

[/alert-announce]

If you want to use gist-vim with Github Enterprise instead:

[alert-announce]

~/.vimrc

  1. let g:gist_api_url = ‘http://your-github-enterprise-domain/api/v3’

[/alert-announce]

Check out gist.vim Plugin on Github

On top of all this, Nick Nisi has an incredibly popular video dedicated to Vim customisation, and is required watching for anyone new to the art – see below: