Git Product home page Git Product logo

config's Introduction

Dotfile Configuration for OSX and Linux

Maintains a (mostly) homogenous configuration setup across Linux and OSX platforms.

Anthony M. Cook 2013 - http://github.com/acook | @anthony_m_cook | http://anthonymcook.com

How to Install

  1. Open a terminal in the same directory as this file.
  2. Run ./install.sh
  3. source ~/.bash_profile
  4. Enjoy!

What the install.sh script does

  • Asks you for info to set up your git config.
  • Backs up any existing configuration files.
  • Creates symlinks to the dotfiles in the repo.
  • Pulls all the submodules contained in this repo.

Prerequisites

  • bash : http://www.gnu.org/s/bash - The install scripts were written for Bash, as were the configurations. May or may not work on other shells.
  • git : http://git-scm.com - Without git the install script will complain at the end and you won't get any of the submodules, but it will still happily do everything else.
  • coreutils : http://www.gnu.org/s/coreutils - GNU basic utilities, some aliases and functions in the bash configuration may fail. (Preinstalled on Linux)

Note that my configuration files use GNU syntax, not BSD syntax.

Recommended

You can use the script with your own collection of dotfiles

  1. Fork this repo.
  2. Clear out the dotfiles directory.
  3. Clean up any script/pre_install or script/post_install files you don't want.
  4. Drop in your own configuration files.
  5. Commit and push to your repo.
  6. Run with ./install.sh.

Cheatsheet

Vim Commands

Unless otherwise specified, these commands are invoked from Normal mode.

The colon (:) prefix indicates Command mode.

The <Leader> is backslash (\) by default.

Shoftcuts, Macros, and Functions

General Helpers

  • <Leader>d - Diff current buffer with associated file on disk. Good for seeing what you've changed before you save, or comparing changes from recovered vim sessions.
  • <Leader>cd - Change Vim's working directory to that of the parent directory of the current buffer's file.

Tab Management

  • <Control>t - Open a new tab.
  • <Control><Tab> - Change to next tab.
  • <Control><Shift<Tab> - Change to previous tab.

Window Navigation

  • <Control>h - Go to window left of current.
  • <Control>j - Go to window below current.
  • <Control>k - Go to window above current.
  • <Control>l - Go to window right of current.

Search

  • <Leader>/ - Toggle search highlighting.

Other Niceties

  • Non-Apple external keyboard tenkey (number keypad) works in terminal Vim on OSX.
  • Mouse and Trackpad scrolling works in any terminal that can send mouse information.
  • Bash-like command line navigation in Command mode.
  • Automatically enables search highlighting when using the standard search commands (/,?,n,N).
  • Turn off search highlighting in Normal mode when hitting key.

Multiple Cursor Editing

Similar to how Sublime Text works, you can have multiple cursors. Hit <Control>n to start playing with them.

Buffer Changeset Exploration

Far beyond just undo/redo, Vim stores the entire tree of your changes whether you save or not in an SCM-like system in memory. I use the Undotree plugin to open this functionality up to explore the changes and undo tree of your current Vim buffer.

  • <Leader>u - Toggles the changeset tree in a left-side vertical split.

File/Directory/Buffer Navigation

The "F" set of Search Utilities (using the "CtrlP" plugin currently)

  • <Leader>ff - Opens fuzzy file search to open files.

    This indexes all the files to be searched when triggered, with pros and cons. This will pull the file list from Git by default, which is very fast. However, if Git doesn't know about your file, it won't show up here. If you use it in a large non-Git directory (like / or ~) it might lag. See below for the "L" set of file search utilities for an alternate method.

  • <Leader>ft - Opens fuzzy tag search to search Ctags tag lists.

  • <Leader>fb - Opens fuzzy buffer search to find named buffers.

  • <Leader>fd - Opens fuzzy directory search to change directories.

  • <Leader>fm - Opens fuzzy MRU search to pick from recent files.

  • <Leader>fq - Opens fuzzy quickfix search if connected to your debugger.

When the search window is enabled you can also do a few more things:

  • <F5> - refreshes the cache
  • <Control>d - disables full path search, does filename only matching
  • :<...> - a colon at the end of a file can be followed by a vim command

The "L" set of Search Utilities (using the "LustyExplorer" plugin currently)

Similar in overall function to the above utils, but using different stategies and interfaces.

  • <Leader>lf - Opens filesystem explorer in Vim's working directory.

  • <Leader>lr - Opens filesystem explorer at the directory of the current file.

    The above utils do not index files, so do no deep fuzzy matching of file names. It can easily delve into directories and match directories and files in a fuzzy manner however.

  • <Leader>lb - Opens buffer explorer for switching buffers by name.

  • <Leader>lg - Opens buffer grep which searches the contents of all buffers in memory.

  • <Leader>lj - Opens buffer juggler for rapidly switching between buffers.

Working with Git

The Fugitive and Gitv plugins are used for this functionality.

  • :Gitv - Show a Gitk-like view of commits in the current repo in a new tab.
  • :Gblame - Show Git's blame on the current file in a vertical split.

Ruby and Rails

Rails.vim provides a huge set of helpers for working with Rails projects.

  • :AV - Open test/object in vertical split.
  • :AS - Open test/object in horizontal split.
  • :A - Swap between test/object in current window.

config's People

Contributors

acook avatar darrigoni avatar ogredude avatar stangreen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.