Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Navigation and Context

  • Loading branch information...
commit ce0b8f8fba97eb7252ec1ac30a1866c83d2f234c 1 parent 48ea5c0
Alex Young authored
View
23 _posts/2012-07-11-context.md
@@ -0,0 +1,23 @@
+---
+layout: post
+title: Navigation and Context
+author: Alex Young
+tags:
+- essays
+---
+
+Most IDEs have a graphical drawer that displays a list of files and folders in a project. Although this is a slow way to navigate between files (hunting for a file visually rather than searching), it provides a useful representation of the project.
+
+![The Unix tree program](/images/posts/unix-tree.png)
+
+The Unix `tree` program is a command-line friendly alternative. It recursively lists files and directories, supports colourised output, and is available as a package on most systems.
+
+I find `tree` a useful tool for visualising a project, but what about navigating between files using Vim? There are popular IDE-like file browser plugins, including [NERDTree, vtreeexplorer, and project](http://vim.wikia.com/wiki/Use_Vim_like_an_IDE#Project.2FFiletree_Browsing). NERDTree in particular offers a familiar interface that's easy to use even for Vim beginners.
+
+![NERDTree](/images/posts/nerdtree.png)
+
+However, visualising a project's structure and finding files isn't the end of the story. IDEs and editors also need to show us what we're editing, and where we are in the file.
+
+Vim's [statusline](http://vimdoc.sourceforge.net/htmldoc/options.html#'statusline') can show the current file, column and line number, and filesystem information. Rather than spending a lot of time tweaking the `statusline` setting, a plugin can be used instead. I like using Kim Silkebækken's [Powerline](https://github.com/Lokaltog/vim-powerline) which not only looks cool but also works well with Git.
+
+That isn't to say other options aren't available -- the beauty of Vim is that it can be easily customised to provide the level of navigational context and project visualisation that you require.
View
BIN  images/posts/nerdtree.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/posts/unix-tree.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Please sign in to comment.
Something went wrong with that request. Please try again.