Giter VIP home page Giter VIP logo

sensible-dotfiles's Introduction

Sensible dotfiles

Screenshot of sensible-dotfiles

This is a selection of most common tweaks that make working with terminal more enjoyable and productive. Some command line defaults are over a decade old - leave them behind and make your life easier!

  • If you haven't done much customization before, this will be a good starting point. (It's also a good opportunity to start versioning your dotfiles.)

  • If you are pair programming or otherwise sharing a machine, you can install this rather than confuse other people with your personal configuration.

  • You can install this on all your VMs etc. to have some basic amenities without making too many changes.

I will keep this repository small and focused, including only settings that are essential for comfortable work environment. If you think that something doesn't make a reasonable default and should be removed (or that I missed an important setting), please open an issue.

Installation

Clone the repo and run the installation script (it will backup your existing config files):

git clone https://github.com/jan-warchol/sensible-dotfiles
~/sensible-dotfiles/link-dotfiles.sh

You'll probably want to move some parts of your old configuration into the new files. Keep in mind that you need to re-run the installation script if you add new files to the repo, to create missing symlinks.

Features

Here's a summary of the most interesting settings:

  • git-aware prompt displaying repository status (see screenshot) - very convenient!

  • essential git configuration:

    • aliases for displaying awesome logs (see screenshot),
    • a dozen of common shorthands, including ci, co, br and st,
    • improved output layout and coloring for status, blame and log,
    • better default behaviour in case of merge conflicts, file copies etc.
  • reasonable defaults and convenient aliases for ls, less and grep:

    • let ls group directories together, listing them above files,
    • better searching and navigation inside less,
    • did you know that grep can highlight matches even when piped to less?
  • handy bash settings, for example:

    • case-insensitive autocompletion,
    • more powerful shell history and navigation,
    • cd to a directory just by typing its name, autocorrect typos
  • disable SSH timeouts - don't let the connection hang because of inactivity

  • Tim Pope's sensible.vim - reasonable and widely accepted default configuration for Vim

  • turtles all the way down: a global Vagrantfile that lets Vagrant install sensible-dotfiles on your VMs as well!

Other good stuff

Want more? Here are a couple things I recommend:

  • Install (smart history)[https://github.com/jan-warchol/smart-bash-history] to make reusing commands you typed super efficient
  • Install (smart find)[https://github.com/jan-warchol/smart-find] to get only meaningful results when you look for files
  • remap the close-to-useless Caps Lock key to control - makes pressing common keyboard shortcuts much more comfortable:
    • on Linux, add this to your ~/.profile:

      setxkbmap -option ctrl:nocaps
      setxkbmap -option shift:both_capslock
      

      (the second command allows you to toggle caps lock by pressing two shifts simultaneously).

    • on OSX, you can change Caps Lock key behaviour in System Preferences -> Keyboard -> Modifier Keys.

  • use xcape to make your remapped caps lock emit escape when pressed on its own. Great for vim users :-)
  • install ranger - a console file manager. It's much better than typing cd and ls all the time.
  • install trash-cli - command-line interface to system trash. Have you ever rm'ed wrong file and wanted to get it back?

Both ranger and trash-cli are available from apt repositories: sudo apt-get install ranger trash-cli.

If you're interested in my personal configuration (forked from this repo), look here.

Backward compatibility

Please note that I may occasionally remove some settings if it turns out that they interfere with something else or are too controversial. However, this will happen rarely, and in each case you will be able to get previous behavior back by reverting the commit that removed it.

sensible-dotfiles's People

Contributors

j-warchol avatar jan-warchol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sensible-dotfiles's Issues

What to do with vim's smarttab?

Sensible-vim enables smarttab. In my experience having this setting on is actually really annoying if you don't have some plugin that automatically sets shiftwidth to fit the filetype being edited (or at least without changing shiftwidth manually to some value smaller than 8).

I'm not sure whether I should simply disable smarttab here, or request Tim Pope to remove it from sensible-vim. I will have to think more about this.

Fix ranger path on OSX

The function wrapping ranger doesn't work on OSX because ranger is not installed in /usr/bin.

Add CI testing

This may look like overkill, but I think it would be useful to have Travis check whether dotiles install succesfully on a clean Linux box, as well as verifying that the screenshots hosted on 3rd party site are available for viewing.

Git configuration ideas

  • set editor to vim by default?
  • set merge.defaultToUpstream by default?
  • find what setting (probably shell's, not git's) is responsible for not printing special characters (like Jan Warcho<C5><82> instead of Jan Warchoł)
  • add --inter-hunk-context=8 do d alias

Tmux configuration ideas

stuff to consider:

  • set window numbering to start from 1
  • make control-arrows work inside tmux sessions
  • automatically enter copy mode on mouse scrolling

Add default ranger configuration

Since I recommend installing it, it would make sense to include some defaults. Some things to cover:

  • set default application to open text files with to vim

Find where git completion is installed on OSX

__git_ps1 function should be installed together with git, but on Macs it's not loaded by default. I suppose it's just installed to a non-standard location. Perhaps I can find where it is and source that file to enable git status in bash prompt.

Change bash prompt back to one-line?

Two-line prompt is something I find very convenient (and a lot of other people like it as well), but OTOH other people don't like it at all. In fact, having such substantial/controversial change may be against the idea of sensible dotfiles...

Should I change it or keep it the way it is? Need to think more.

Vim configuration ideas

Some things that may be worth to add to sensible-dotfiles' vimrc:

  • make ctrl-backspace work as in most other programs
  • make arrow keys move by visual line
  • provide a couple suggested plugins? (disabled by default)
  • add mapping to copy and paste from system clipboard

Let global Vagrantfile install the same version of dotfiles as is installed on the host

Currently vagrant just downloads the latest version of sensible-dotfiles from github. It would be more convenient to install the same version as the user has installed on his host machine. Or maybe it could copy host configuration itself? This would not require internet access, and would also copy any changes made by the user in his configuration.

Create an extended version?

There are some settings that would be nice to have but I wouldn't call them essential. What to do with them? Create a separate branch with "extra features"?

I should probably start by collecting them here and decide on what to do when I have a better overview of what could be included in such a branch.

"__git_ps1: command not found" on OSX

Theoretically this should be no problem, as I have a check in .bashrc that should skip using this function if it's not available, but somehow it doesn't work on macs...

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.