Git Product home page Git Product logo

dotfiles's Introduction

Paul's dotfiles

  • I maintain this repo as my dotfiles, but I'm keenly aware people are using it for theirs.
  • You're quite welcome to make suggestions, however I may decline if it's not of personal value to me.
  • If you're starting off anew, consider forking mathias or alrra. paulmillr and gf3 also have great setups

Setup

I would not suggest you just wholesale use my dotfiles. But there's a few files where there's great goodies you can steal.

shell

This repo contains config for fish and bash. As of 2016, I primarily use fish shell, but fall back to bash once in a while. The bash and fish stuff are both well maintained. If you're using fish you'll want to do a git submodule update --init.

my favorite parts.

aliases and functions

So many goodies.

The "readline config" (.inputrc)

Basically it makes typing into the prompt amazing.

  • tab like crazy for autocompletion that doesnt suck. tab all the things. srsly.
  • no more that says "Display all 1745 possibilities? (y or n)" YAY
  • type cat <uparrow> to see your previous cats and use them.
  • case insensitivity.
  • tab all the livelong day.
  • err'body gotta have their aliases. I'm no different.

Moving around in folders (z, ..., cdf)

z helps you jump around to whatever folder. It uses actual real magic to determine where you should jump to. Seperately there's some ... aliases to shorten cd ../.. and .., .... etc. Then, if you have a folder open in Finder, cdf will bring you to it.

z dotfiles
z blog
....      # drop back equivalent to cd ../../..
z public
cdf       # cd to whatever's up in Finder

z learns only once its installed so you'll have to cd around for a bit to get it taught. Lastly, I use open . to open Finder from this path. (That's just available normally.)

overview of files

shell environment

  • .aliases, .bash_profile, .bash_prompt, .bashrc, .exports, .functions

manual run

  • setup-a-new-machine.sh - random apps i need installed
  • symlink-setup.sh - sets up symlinks for all dotfiles and vim config.
  • .macos - run on a fresh mac os setup
  • brew.sh & brew-cask.sh - homebrew initialization

git, brah

  • .gitconfig
  • .gitignore

.extra for your private configuration

There will be items that don't belong to be committed to a git repo, because either 1) it shoudn't be the same across your machines or 2) it shouldn't be in a git repo. Kick it off like this:

touch ~/.extra && $EDITOR $_

I have some EXPORTS, my PATH construction, and a few aliases for ssh'ing into my servers in there.

Sensible OS X defaults in .macos

Mathias's repo is the canonical for this, but you should probably run his or mine after reviewing it.

~/bin

One-off binaries that aren't via an npm global or homebrew. git open, subl for Sublime Text, and some other git utilities.

2020 update

Rust folks have made a few things that are changing things.

Dotfiles mgmt todo

Also I'd like to migrate to using one of these:

also interested in https://github.com/dandavison/open-in-editor

dotfiles's People

Contributors

alanyee avatar alfredbez avatar alrra avatar amio avatar anenth avatar anikets avatar binwilly avatar christianvuerings avatar connorjclark avatar danawoodman avatar edditoria avatar freddydumont avatar gburtini avatar hivehand avatar jonleopard avatar jpsirois avatar jrk avatar kainy avatar mathiasbynens avatar matijs avatar mattbanks avatar mecu avatar mhumesf avatar mikez avatar paulirish avatar pedrro avatar peterpme avatar robcolburn avatar sebkouba avatar sepans 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  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  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  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

dotfiles's Issues

Getting Photo Booth to export to Google Drive and others

The Photo Booth -> Dropbox symlink trick works great, and I've missed it since I dropped Dropbox. Some cloud storage providers don't support symlinks, but there is a workaround:

https://github.com/selkhateeb/hardlink will let you create directory hardlinks which work just fine.

Once it's installed, it's just a quick
$ hardlink ~/Pictures/Photo\ Booth\ Library/Pictures/ ~/Google\ Drive/Pictures
and you can export to Google Drive, Box Sync, or whatever else you have.

[Suggestion] Allow more fine grained installation of dotfiles

The repo currently uses a single symlink-setup.sh script to install all the symlinks to their correct places on the system. However, with this script, users must install all your settings at once. It would be much better if fine grained installation of only certain settings files was possible. For example, only the Vim and Zsh configs but nothing else. The script currently does its job, but is a bit hackish and difficult to extend for more features.

I've been writing a small more general purpose solution for maintaining my own dotfiles and think that you may be able to benefit from the set of scripts I have. Do take a look at the architecture I have in my dotfiles repo. The basics of how everything is organized is mentioned in the README file. Currently, the scripts are slightly geared towards my Archlinux installations, but I would be happy to provide more general purpose support for your Mac based settings as well.

The advantage of using something like this is that the various settings can now be split into their logical components and installed separately. Also, certain utilities / tools that you need can be installed and configured with just a single command.

I shall be happy to answer any questions about the scripts, make any changes needed and help you port your existing setup to it if you'd like.

Could not write domain ~/Library/Preferences/ByHost/com.apple.systemuiserver

Hello, I am kind new on OSX environment, learning about the dotfiles now, I am building my own following a guide. Got a mix between paulirish and mathiasbynens, getting what I want from them.

I use Itsycal and want to hide the Clock from menu bar, it worked before just unchecking Show date and time in menu bar at System Preference > Date & Time > Clock.
Then after I first ran my .osx file that have the commands to hide Menu Bar icons, the Clock and Spotlight icons keep coming back, even if I go to System Preferences and uncheck the option, every time I reboot my Mac, both of them are there again.

Commands on my .osx file:

sudo chmod 700 ~/Library/Preferences
sudo chown "${UID}" ~/Library/Preferences

# Menu bar: hide the Time Machine, Volume, and User icons
for domain in ~/Library/Preferences/ByHost/com.apple.systemuiserver.*; do
	defaults write "${domain}" dontAutoLoad -array \
		"/System/Library/CoreServices/Menu Extras/TimeMachine.menu" \
		"/System/Library/CoreServices/Menu Extras/Volume.menu" \
		"/System/Library/CoreServices/Menu Extras/User.menu"
done
defaults write com.apple.systemuiserver menuExtras -array \
	"/System/Library/CoreServices/Menu Extras/Bluetooth.menu" \
	"/System/Library/CoreServices/Menu Extras/AirPort.menu" \
	"/System/Library/CoreServices/Menu Extras/Battery.menu" \
	"/System/Library/CoreServices/Menu Extras/Clock.menu"

sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search

When I run my .osx file I got the error on Terminal:

bash .osx
2018-01-03 01:07:50.515 defaults[2576:37988] Could not write domain /Users/cassiano/Library/Preferences/ByHost/com.apple.systemuiserver.013D9106-3475-5C6E-B6D1-88770AA105A6.013D9106-3475-5C6E-B6D1-88770AA105A6.013D9106-3475-5C6E-B6D1-88770AA105A6.013D9106-3475-5C6E-B6D1-88770AA105A6.013D9106-3475-5C6E-B6D1-88770AA105A6.plist; exiting
2018-01-03 01:07:50.695 defaults[2580:38008] Could not write domain /Users/cassiano/Library/Preferences/ByHost/com.apple.systemuiserver.013D9106-3475-5C6E-B6D1-88770AA105A6.plist; exiting

My SIP status:

csrutil status
System Integrity Protection status: disabled.

My dotfiles repository: https://github.com/cassianomon/dotfiles

Also my apps icons go missing after I run my .osx (https://prnt.sc/hvdsrh)

MacBook Pro (Retina, 15-inch, Mid 2015)
macOS High Sierra 10.13.2

localip sed illegal option

I tried to use localip function, but getting this error. Do you know what I might be missing here?

:; localip
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: illegal option -- r
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]

fasd or z?

I was adapting your dotfiles for my own (Ubuntu-based) needs, and was seriously excited with z. Since it is a bit of a hassle to install, I was reading a bit and found about fasd, another autocompleter inspired by z. Feedback on HN has been positive.

I am not involved in the project, but thought you may be interested since it includes a package for brew. So far I like it, even if it doesn't include a debian package.

Pearl package manager

Hi Paul,

Perhaps, you might be interested to use a mechanism that allows to easily share, control and sync your dotfiles via a recent package manger I have built https://github.com/pearl-core/pearl

There is an existing official repository of dotfiles that can be, but you can create your own repository to let people try your dotfiles easily.

There are still few improvements that need to be done but the major features have been already implemented.

I would appreciate if you can give it a try.

Thank you,
Filippo

rvm error

the .bash_profile cannot read the .rvm folder and says

cat: /Users/admin/.rvm/VERSION: No such file or directory
Warning! PATH is not properly set up, '/Users/admin/.rvm/gems/ruby-2.0.0-p247/bin' is not at first place,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-2.0.0-p247'.
-bash: /Users/admin/.rvm/scripts/base: No such file or directory
-bash: /Users/admin/.rvm/scripts/help: No such file or directory

when calling $ rvm

fs not working anymore

I love the fs alias but now I'm getting this error
stat: cannot read file system information for ‘%z bytes’: No such file or directory\

I've fallen back to using stat -c %s

Any ideas how to fix?

Chrome extensions

I was wondering if it is possible to specify extensions that should be installed after chrome?

brew_bash_completion.sh: No such file or directory

After install, getting this error when opening the terminal:
-bash: /usr/local/Library/Contributions/brew_bash_completion.sh: No such file or directory

Per this stack overflow and this commit, homebrew was re-organized.

In .bash_profile, I changed this line:
source brew --repository/Library/Contributions/brew_bash_completion.sh
to
source "$(brew --prefix)/etc/bash_completion.d/brew"
and everything worked.

Is this the best approach? I can submit a PR if agreed.

Screenshot in README

Could you add a screenshot to the main README with your everyday tools that the dotfiles affect (vim, terminal emulator, etc.)?

Symlinks?

I've been using a fork of this repo and it's awesome.

Just curious... why does the sync.sh copy the files to your home directory? Why not create symlinks instead? That way you wouldn't have to re-sync after editing a file.

Also, some scripts/apps append lines to your dotfiles in ~ automatically (eg, when you install things like pow or rvm, or when you do git config --global --add ...) ...but these get overwritten next time you run sync.sh. Symlinks would solve that too, these changes would actually be made in the HEAD your repo, so you can later commit them if you want).

import prompt improvements from Pure

https://gist.github.com/9e4f4673a3aa1610dc52

i had an idea to capture duration of longrunning tasks and automatically output their length if they surpass some threshold.

and then @sindresorhus wrote it!

preexec() {
    export PREEXEC_TIME=$(date +'%s')
}

precmd() {
    local stop=$(date +'%s')
    local start=${PREEXEC_TIME:-$stop}
    let elapsed=$stop-$start
    let max=5
    local cmd_time=`[ $elapsed -gt $max ] && echo ${elapsed}sec`
    print -P '\n $cmd_time'
}

also

i want to pull in his benchmarked fast git dirty check

@sindresorhus do you have a gist on all dirty checks and their speeds?

.bash_prompt > Only show username/host if not default

.bash_prompt

If your "default_username" on line 4 contains a space (e.g. "Art Kay"), then line 55:
if [ $USER != $default_username ];

will throw an error about "too many arguements" in Bash.

Solution is simple:
if [ "$USER != $default_username" ];

Note the double-quotes around the inner content.

I branched off you (rather than Mathias) for no good reason, so I won't submit a PR but I thought you might fix this.

[vim] FastEscape seems to affect inoremap

When trying to use the FastEscape augroup that you have in your .vimrc, I noticed that inoremaps I've had before stopped working. For eg:

inoremap jk <esc>

If I remove the FastEscape augroup, it works again. Do you know why this might be the case?

Typo?

Not sure if this is a typo but in the readme it says

This repo contains config for bash, zsh, and fish. As of March 2016, I'm using fish shell mostly, but fall back to bash once in a while. The bash and zsh stuff are both well maintained; zsh, less so.

Is it supposed to say "zsh" twice in that last sentence or is one of those supposed to be "fish"?

histappend not being set, since shopt is a shell builtin

histappend is not being set correctly in your current dotfiles, since shopt is a shell builtin.

This happens because of this line in .bash_profile: https://github.com/paulirish/dotfiles/blob/master/.bash_profile#L48

which shopt &> /dev/null && shopt -s histappend  # append to history, don't overwrite it

Example:

$ which shopt
~/dotfiles on master*
$ type shopt
shopt is a shell builtin
~/dotfiles on master*
$ which shopt &> /dev/null && echo "working"
$ echo $?
1

You could remove the test or use:

type shopt &> /dev/null && shopt -s histappend  # append to history, don't overwrite it

Example:

~/dotfiles on master*
$ type shopt &> /dev/null && echo "working"
working
$ type fakecommand &> /dev/null && echo "working"
~/dotfiles on master*
$ echo $?
1

brew-cask.sh browser casks no longer available

Hi just a heads up if you weren't already aware but these three browsers are no longer available through brew:

browsers

brew cask install google-chrome-canary
brew cask install firefoxnightly
brew cask install webkit-nightly

who is using my camera?

lsof | grep -i "AppleCamera"
lsof | grep "USBVDC"
lsof | grep -i "iSight"

will get you process ID.

need some function to find which app owns it.

ez pz

dircolors: command not found

I am setting up a new machine and I am getting this error dircolors: command not found from

command -v gdircolors >/dev/null 2>&1 || alias gdircolors="dircolors"
eval "$(gdircolors -b ~/.dircolors)" 

The issue is we are not istalling the dircolors, can I add to this to config?

wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.dircolors
echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.bashrc
. $HOME/.bashrc

.profile is missing

because the .profile file is missing the .bash_profile is not getting executed in my machine

I created a new file .profile and added the following code to it and it worked.

[ -n "$PS1" ] && source ~/.bash_profile

length miscalculation on bash prompt

Hi, I was trying to use your bash prompt colorization and I think I discovered that the color codes are not properly escaped in the userhostname output:

# Only show username/host if not default
function usernamehost() {
    if [ $USER != $default_username ]; then echo "${MAGENTA}$USER ${WHITE}at ${ORANGE}$HOSTNAME $WHITEin "; fi
}

Because the codes are not escaped here (with [, ]), and apparently can't be because bash treats the result of the function as literal output, the prompt length calculation can be wrong and the display can get messed up. I suspect you might not notice this since this output is only used conditionally for non-default user.

It appears this case was handled for the git branch by embedding the expression in the PS1 value, and the same could be done for usernamehost.

In my case I just extracted both of these as variables that contain the escaped expressions. It's not pretty but it simplifies the PS1 prompt value.

# my prompt
PS1="[$USERHOST\[$BOLD$BLUE\]\W$GITBRANCH\[$RESET\]]\$ "

[contribute] useful function set proxy

px () {
	green=$(tput setaf 64);
	red=$(tput setaf 124);
	reset=$(tput sgr0);
	UTC_TIME="$(date +"%Y-%m-%d %H:%M:%S")"
	PORT=${1:-7890}
	if [ ! -z "$http_proxy" ]
	then
		echo $UTC_TIME
		echo "http_proxy already set, ${red}unset now${reset}"
		unset http_proxy;
		unset https_proxy;
	else
		echo $UTC_TIME
		export http_proxy=http://127.0.0.1:$PORT;
		export https_proxy=http://127.0.0.1:$PORT;
		echo "set http_proxy to ${green}$(echo $http_proxy)${reset}"
	fi
}

$ px
2022-07-18 19:46:41
set http_proxy to http://127.0.0.1:7890

$ px
2022-07-18 19:48:17
http_proxy already set, unset now

/Users/marif/.functions:37: parse error near `]]'

I am pretty new to OSX but everything is almost settled down, I had configured Z and ZSH earlier and lately come to know about paulirish dot files and installed it.

Got to see following output when I refresh .bash_profile or .bashrc

Last login: Tue May 14 08:41:35 on console
ls
  ~  ls
Applications    Downloads       Music           Samsung         dotfiles        log
Desktop         Library         Pictures        Sites           install-deps.sh readme.md
Documents       Movies          Public          bin             js-boilerplate
  ~  z
zsh: command not found: z
  ~  source ~/.bash_profile
/Users/marif/.aliases:79: bad option: -t
/Users/marif/.aliases:82: bad option: -t
/Users/marif/.functions:37: parse error near `]]'
/Users/marif/.bash_profile:.:9: no such file or directory: /Users/marif/code/z/z.sh
/Users/marif/.bash_profile:15: command not found: shopt
/Users/marif/.bash_profile:26: command not found: complete
\[\e]2;/Users/marif\[\a\]\[\e]1;\]Users/\W\[\a\]marif at   \[\]\w\[\]\[\]\[\]\n$ \[\]

I don't know what's going wrong here, would help if somebody point me out to issue persisting in my profile or something.

About setup fish

I know it's not a bug but just wanna get some help from others

First, I haven't set up symlink ~/.config/fish -> ~/code/dotfiles/fish/ then fish works fine.
But because I want to use the aliases, functions .. so I set up that symlink and then fish broken
I do some Google but there's no useful guide to figure out . Could anyone help me with this ? Maybe a simple guide is great 👍

entr is deprecated

Friendly poke that brew install entr is unnecessary now that it's deprecated.

This has been superceded/merged by eradman into the default homebrew.

You can now brew update/install/upgrade with homebrew proper. Don't use this unless you're bored/like out of date things.

[Suggestion] use pigz instead of gzip

I noticed an alias involving gunzip (ungz), and I thought I would mention that pigz (http://www.zlib.net/pigz/) is a much faster alternative, since it supports multi-core processing. You can install pigz with homebrew.

I actually only found out about pigz recently, and it is lightning fast compared to regular gzip, both at compressing and decompressing. It can result in a slightly larger compressed file, but the difference is very small (no more than a few MB larger gz file when compressing a 400MB log file).

If you use gzip and gunzip very much, I think you'll quickly grow to like pigz.

Minor syntax error

.bash_prompt

Line 55

if [ $USER != $default_username ]; then echo "${MAGENTA}$USER ${WHITE}at ${ORANGE}$HOSTNAME $WHITEin "; fi

$WHITEin should be ${WHITE}in

[10.11] QLEnableTextSelection doesn't work

I've just have a fresh install with El Captain 10.11.1. Everything works well except QLEnableTextSelection setting (To enable select/copy text when using quick look).
Does anybody have experience with this ?

diff-so-fancy assumes a git format diff header

diff -urNd foo bar | diff-highlight | diff-so-fancy seems to work with this:

--- i/scripts/diff-so-fancy
+++ w/scripts/diff-so-fancy
@@ -43,8 +43,9 @@ dim_magenta="\x1B\[38;05;146m"
 format_diff_header () {
        # simplify the unified patch diff header
        sed -E "s/^($color_code_regex)diff --git .*$//g" | \
-       sed -E "s/^($color_code_regex)index .*$/\
-\1$(print_horizontal_rule)/g" | \
+       sed -E "/^($color_code_regex)index /d" | \
+        sed -E "s/^($color_code_regex)---(.*)$/\1$(print_horizontal_rule)\\
+\1---\5/g" | \
        sed -E "s/^($color_code_regex)\+\+\+(.*)$/\1\+\+\+\5\\
 \1$(print_horizontal_rule)/g"
 }

ip doesnt work

ip doesnt work

'alias ip='dig +short myip.opendns.com @resolver1.opendns.com'

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.