GithubHelp home page GithubHelp logo

dotfiles's Introduction

Awesome Dotfiles

Simple, but extensive customization of ZSH, TMUX, and Vim.

VideoWalkthrough

Setup Options

There are 3 ways in which you can use this, depending on how much you think you'll be customizing.

One of the key features is that this implementation stays in sync across all your machines. So depending on how much you'd like to customize your configuration, you have a few options:

  • Little Customization: Just clone this repo and jump to Installation.
  • Mild Customization: Fork this repo, and clone your own fork. Keep an eye on this repo for bugfixes and other improvements that you'd like to incorporate into your fork. Then jump to Installation.
  • Most Customization: Building your own dotfiles from scratch! Read through these docs, watch the video above, star this repo, and create your own dotfiles! You can add this repository as a git module and source the parts you like.

If you're unsure, just read the docs, watch the video, clone this repository, and jump to Installation.

Installation

Once the repo is cloned, execute the deploy script:

./deploy

This script guides you through the following:

  1. Checks to see if you have zsh, tmux, and vim installed.
  2. Installs them using your default package manager if you don't have some of them installed.
  3. Checks to see if your default shell is zsh.
  4. Sets zsh to your default shell.
  5. Backs up your old configuration files.

Pretty convenient for configuring new servers.

Summary of Changes

Basic runtime operations

All default dotfiles (.zshrc, .vimrc, etc) source something within the dotfiles repository. This helps separate changes that are synced across all your machines with system-specific changes.

Upon launching a new shell, the first thing that's evaluated is zshrc_manager.sh. This script first launches tmux. Then once zsh logs in, within tmux, it updates the dotfiles repository, and sources the changes.

  • cd has been reassigned to cd and ls. Every time you navigate to a new directory, it will display the content of that directory.
  • v has been aliased too: vim -p. This lets you open multiple files in vim as tabs.

Prompt

The prompt takes on the form:

[plugin, plugin, ...]:

Each plugin is sensitive to where you are and what you're doing, they reveal themselves when it's contextually relevant. Plugins include:

  • PWD plugin: always present, tells you where you are. Always the first plugin.
  • Status code plugin: appears anytime a program returns with a non-zero status code. Tells you what status code the program completed with.
  • Git plugin: appears when you're in a git repository. Tells you what branch you're on, and how many files have been changed since the last commit.
  • Sudo plugin: tells you when you can sudo without a password. Or when you're logged in as root.
  • Time plugin: appears when a program took more than 1s to execute. Tells you how long it took to execute.
  • PID plugin: appears when you background a task. Tells you what the PID of the task is.

Keybindings

Key Stroke What It Does
Ctrl-H Goes to the root of a git project, runs `cd $(git rev-parse --show-toplevel
Ctrl-K Runs cd ..
Ctrl-G Runs git add -A; git commit -v && git push
Ctrl-V Runs fc. Takes last command and puts it in a vim buffer.
Ctrl-S Adds sudo to the beginning of the buffer.
Ctrl-L Runs ls.
Ctrl-O Equivalent to hitting Enter.
Ctrl-P Equivalent to pressing Up Arrow.

Plugins

  • zsh-autosuggestions: Searches your history while you type and provides suggestions.
  • zsh-syntax-highlighting: Provides fish style syntax highlighting for zsh.
  • ohmyzsh: Borrowed things like tab completion, fixing ls, tmux's vi-mode plugin.
  • vimode-zsh allows you to hit esc and navigate the current buffer using vim movement keys.
  • Leader key has been remapped to ,
  • Ctrl-B has been remapped to the backtick character (`). If you want to type the actual backtick character (`) itself, just hit the key twice.
  • % has been remapped to v.
  • Use vim movement keys for moving between panes.
  • Copy buffer is copied to xclip.
  • Status bar tells you date, time, user, and hostname. Especially useful with nested ssh sessions.

dotfiles's People

Contributors

0xdead-c0de avatar joncolella avatar krishma-bawa avatar mikkovedru avatar parth avatar rvargs avatar tvanderstad 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

dotfiles's Issues

Cleaning history since last update

Hi,

Since the last update after every boot it remove the history which is really annoying because commands that you mostly used can't be found anymore with CTRL+R so you have to retype them every time because it's history only keeps 15 lines.

How can i fix this ?

Thanks,

Zsh Plugins not downloaded

Hi folks,

I cloned the repo, ran the deploy script, logged out and in again. But I see errors that the zsh plugins cannot be sources since those files / folders don't exist locally. In particular, these folders don't have any content:
~/dotfiles/zsh/plugins/oh-my-zsh/
~/dotfiles/zsh/plugins/zsh-autosuggestions/
~/dotfiles/zsh/plugins/zsh-syntax-highlighting

I manaed to manually clone those three repos and get everything working but I wanted to know what I was doing wrong?

Upgraded to ubuntu 20

Hi,

I've updated to ubuntu 20 and my terminal keeps crashing after some digging i've i changed my
.zshrc

  • source '/home/danny/dotfiles/zsh/zshrc_manager.sh'
  • #source '/home/danny/dotfiles/zsh/zshrc_manager.sh'

When i open up my terminal it worked again.

To test this i've created the following test:
testing.sh

if [[ $? -ne 0 ]]
then
   # handle an error
fi 

When i run this in my terminal i get the following error
./testing.sh: 5: Syntax error: "fi" unexpected

Line 5 is the following line:

time_out () { perl -e 'alarm shift; exec @argv' "$@"; }

Run tmux if exists

if command -v tmux>/dev/null; then
if [ "$DISABLE_TMUX" = "true" ]; then
echo "DISABLE_TMUX=true"
else
[ -z $TMUX ] && exec tmux
fi
else
echo "tmux not installed. Run ./deploy to configure dependencies"
fi

Anyone got an idea already to fix this ?

virtualenv in prompt

Thanks for this great work!

I found one drawback that the promt does not work with python virtualenv.
E.g.,

$ workon tf
(tf) $            # (tf) is missing

How can I use virtualenv?

In addition, if I want to use standard ZSH_THEME="agnoster", could you advise how/where I can modify?

oh-my-zsh?

Hi Parth,

First, thank you for sharing your dotfiles. Awesome stuff. I'm kinda hacking around and wanted to know how easy or difficult it'd be to integrate with oh-my-zsh? I was missing some shortcuts that I'm used to but then realized they probably weren't native zsh and part of omz. I was going to copy some things over into dotfiles/zsh but wanted to ask about it first.

Thanks again!

After running ./deploy on Mac and logging out and back in, nothing is working.

macOS Catalina Version 10.15
Cloned repo to my ~ directory. Running ./deploy seems all is working as expected as far the shell script. Closed/Opened a new terminal and nothing is working. Isn't this os independent?

We're going to do the following:
1. Grab dependencies
2. Check to make sure you have zsh, vim, and tmux installed
3. We'll help you install them if you don't
4. We're going to check to see if your default shell is zsh
5. We'll try to change it if it's not
Let's get started? (y/n)

Checking to see if zsh is installed
zsh is installed.

Checking to see if vim is installed
vim is installed.

Checking to see if tmux is installed
tmux is installed.

Default shell is not zsh. Do you want to chsh -s $(which zsh)? (y/n)
Changing shell for rajasleem.
Password for ...: 
chsh: /usr/local/bin/zsh: non-standard shell

Would you like to backup your current dotfiles? (y/n) 
Not backing up old dotfiles.

Please log out and log back in for default shell to be initialized.

A split command

A binary operator, with 3 cases:

2 commands given in: tmux split and run the commands
2 directories open the split with those two directories
2 files open a vim split.

how does the sourceing work

hi,
i tried to recreate you ~/dotfiles folder layout.
i cant get to rc files at ~ to work.
they are .chunkwmrc and .skhd files.
is there a special language to know about? i just put source /Users/Finn/dotfiles/chunkwmrc, but it does not work.

Pending tasks for deploy

  • Our messages should be colored. Does the terminal support color?
  • Should use this instead of current confirmation because: currently user can't interrupt. also should user to type, backspace, then enter whenever
  • Autoconfirm brew, and pkg install scripts.
  • Show summary of what's going to happen

Deploy script problems

The deploy script uses command -v to figure out if a particular dependency manager is present on the system. This perhaps isn't the best way to answer the question: "which dependency manager to use"

This is problematic as apt is the dependency management tool on Ubuntu, and serves a different purpose in macOS.

Short term I think we can just check for apt-get and use that.

Another consideration to make: should we just be hosting this tool on a dependency management system in the first place? So instead of:

  1. Clone
  2. Deploy
  3. Log out log back

it might be something like:

  1. Apt
    2 Exec

cd script isn't doing good

[~/Documents/gemini/web-server, GEM-14198-pm-devicecheck-safetynet]: cd ...
c:cd:1: no such file or directory: ...

Updating ZSH_THEME= has no effect

Looking into the zshrc.zsh-template file and setting the theme parameter has no effect on the theme used for the terminal. Traditionally to update the zhs_theme you would edit the ~/.zshrc file, which is now just pointing source '/dotfiles/zsh/zshrc_manager.sh'.

Let me know if I am looking in the wrong place!
Thanks.

Long Loading Times?

Hi. I'm using WSL on Windows. I noticed that zsh takes relatively more time to load than bash. Is this because of the dotfiles?

[~, 12s]: time zsh -i -c exit
Updating configuration
zsh -i -c exit  0.06s user 0.38s system 44% cpu 0.977 total

Report says 0.977 sec total, but I think I'm watching Updating configuration like 3 seconds on start-up.

I read that oh-my-zsh is to blame for bad zsh performance.

Alias for reload causes terminal to quit on key press

I'm trying to add a simple alias to allow me to reload the terminal like so:

alias reload="source ~/.zshrc"

This seems to work fine, and reloads the configuration, but when I press a key the terminal tab then quits. Any idea what is going on?

Thoughts on autocomplete and tab complete

Some thoughts

  • Tab complete is broken on macOS. On linux, you are able to expand cd d/s/p <tab> to cd documents/SAP/presentations. Not the case in macOS. Might be due to the cd alias stuff we have going on.

  • Accepting suggestions from the history is unintuitive. The separation between historical suggestions, and context based ones is useful, but hard to understand without an explicit explanation.

  • So it should certainly not offer a historical suggestion that contains a relative path if the pwd's are different.

  • A command might implicitly also take a relative path. npm run serve for example implicitly depends on the existence of not only a package.json in the pwd, but also the existence of package.json.scripts.serve.

  • Could machine learning infer these relationships?

Key binding for cd

Hi. I really like your idea for remapping cd to cd and then ls, but I'm curious how I can add this functionality directly to my .zshrc. I see in your zshrc.sh script you do

# Custom cd
chpwd() ls

but I'm not sure how to just put the remapped cd into my .zshrc like alias -g cd="<STUFF>".

Could anyone help me figure this out? Thanks in advance!

Ros, iai_kinect2 issues

Hi there,
I see your post
http://robotics.stackexchange.com/questions/6632/ros-iai-kinect2-issues
I have exactly the same problems with you. Have you find a solution?? If you don't mind I have a few question:

  • What is your graphic card Intel or Nvidia? I mean when you go additional drivers which one is selected Xorg thing or any Nvidia like 331, 340, 346, 349 etc?
  • Did you changed anything in "etc/default/grub" like "quite splash" to "quite splash nomodeset"?
  • Did you modified blacklist.conf" file?
  • Did you try Blumlebee or Beignet things?
  • Have you faced with any black screen on reboot?
  • Do you have OpenCL now?
  • Did you lost some random characters on screen due to low graphic speed?

Those are my experiences. I am working with Asus X555LN, intel core i5, Nvidia Geforce 840M, Ubuntu 14.04, Ros indigo, Kinect2 camera. I used to work with Kinect2 but last month something happened I guess during an update or upgrade and then my computer gave me black screen on regular start. I have been dealing with building Ubuntu, installing graphic driver and reinstalling everything.

I think main problem is about Nvidia. It blocks OpenCL, so libfreenect2, so iaiKinect2

If you found a solution please contact me via this issue

Kind regards

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.