Coder Social home page Coder Social logo

dotfiles's People

Contributors

jaebradley avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

leo328

dotfiles's Issues

Add Nerdtree Settings to vimrc

  • Add toggling: https://vi.stackexchange.com/a/9968
  • Close NerdTree when opening file: let NERDTreeQuitOnOpen = 1
  • Automatically close tab if only remaining window is NerdTree autocmd bufenter * if (winnr(“$”) == 1 && exists(“b:NERDTreeType”) && b:NERDTreeType == “primary”) | q | endif
  • Update NerdTree UI
let NERDTreeMinimalUI = 1
let NERDTreeDirArrows = 1

Update powerlevel9k installation

brew tap sambadevi/powerlevel9k
brew install powerlevel9k

Add

source /usr/local/opt/powerlevel9k/powerlevel9k.zsh-theme

to ~/.zshrc

Missing steps for virtualenvwrapper

# uninstall python / python 2 and install python 3 and set as default "python"
brew uninstall --ignore-dependencies python
brew uninstall --ignore-dependencies python2
brew uninstall --ignore-dependencies python3
brew install python
brew unlink python && brew link python
brew unlink python3 && brew link python3
sudo ln -s /usr/local/bin/python3 /usr/local/bin/python
sudo ln -s /usr/local/bin/pip3 /usr/local/bin/pip

https://stackoverflow.com/a/52068185/5225575

Vim setup

Install Karabiner to remap caps lock

{
    "global": {
        "check_for_updates_on_startup": true,
        "show_in_menu_bar": true,
        "show_profile_name_in_menu_bar": false
    },
    "profiles": [
        {
            "complex_modifications": {
                "parameters": {
                    "basic.simultaneous_threshold_milliseconds": 50,
                    "basic.to_delayed_action_delay_milliseconds": 500,
                    "basic.to_if_alone_timeout_milliseconds": 1000,
                    "basic.to_if_held_down_threshold_milliseconds": 500,
                    "mouse_motion_to_scroll.speed": 100
                },
                "rules": [
                    {
                        "manipulators": [
                            {
                                "description": "Change caps_lock to control when used as modifier, escape when used alone",
                                "from": {
                                    "key_code": "caps_lock"
                                },
                                "to": [
                                    {
                                        "key_code": "left_control"
                                    }
                                ],
                                "to_if_alone": [
                                    {
                                        "key_code": "escape"
                                    }
                                ],
                                "type": "basic"
                            }
                        ]
                    }
                ]
            },
            "devices": [],
            "fn_function_keys": [
                {
                    "from": {
                        "key_code": "f1"
                    },
                    "to": {
                        "consumer_key_code": "display_brightness_decrement"
                    }
                },
                {
                    "from": {
                        "key_code": "f2"
                    },
                    "to": {
                        "consumer_key_code": "display_brightness_increment"
                    }
                },
                {
                    "from": {
                        "key_code": "f3"
                    },
                    "to": {
                        "key_code": "mission_control"
                    }
                },
                {
                    "from": {
                        "key_code": "f4"
                    },
                    "to": {
                        "key_code": "launchpad"
                    }
                },
                {
                    "from": {
                        "key_code": "f5"
                    },
                    "to": {
                        "key_code": "illumination_decrement"
                    }
                },
                {
                    "from": {
                        "key_code": "f6"
                    },
                    "to": {
                        "key_code": "illumination_increment"
                    }
                },
                {
                    "from": {
                        "key_code": "f7"
                    },
                    "to": {
                        "consumer_key_code": "rewind"
                    }
                },
                {
                    "from": {
                        "key_code": "f8"
                    },
                    "to": {
                        "consumer_key_code": "play_or_pause"
                    }
                },
                {
                    "from": {
                        "key_code": "f9"
                    },
                    "to": {
                        "consumer_key_code": "fastforward"
                    }
                },
                {
                    "from": {
                        "key_code": "f10"
                    },
                    "to": {
                        "consumer_key_code": "mute"
                    }
                },
                {
                    "from": {
                        "key_code": "f11"
                    },
                    "to": {
                        "consumer_key_code": "volume_decrement"
                    }
                },
                {
                    "from": {
                        "key_code": "f12"
                    },
                    "to": {
                        "consumer_key_code": "volume_increment"
                    }
                }
            ],
            "name": "",
            "parameters": {
                "delay_milliseconds_before_open_device": 1000
            },
            "selected": true,
            "simple_modifications": [],
            "virtual_hid_keyboard": {
                "country_code": 0,
                "mouse_key_xy_scale": 100
            }
        }
    ]
}

Update vim

  • brew install vim
  • Need to install xcode command line tools
    • xcode-select --install
  • Restart shell session and vim --version should contain +clipboard
    • exec -l $SHELL
" Set 'nocompatible' to ward off unexpected things that your distro might
" have made, as well as sanely reset options when re-sourcing .vimrc
set nocompatible

" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
filetype indent plugin on

" Enable syntax highlighting
syntax on

" Better command-line completion
set wildmenu

" Show partial commands in the last line of the screen
set showcmd

" Highlight searches (use <C-L> to temporarily turn off highlighting; see the
" mapping of <C-L> below)
set hlsearch

" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase

" Allow backspacing over autoindent, line breaks and start of insert action
set backspace=indent,eol,start

" When opening a new line and no filetype-specific indenting is enabled, keep
" the same indent as the line you're currently on. Useful for READMEs, etc.
set autoindent

" Display the cursor position on the last line of the screen or in the status
" line of a window
set ruler

" Always display the status line, even if only one window is displayed
set laststatus=2

" Instead of failing a command because of unsaved changes, instead raise a
" dialogue asking if you wish to save changed files.
set confirm

" Enable use of the mouse for all modes
set mouse=a

" Set the command window height to 2 lines, to avoid many cases of having to
" "press <Enter> to continue"
set cmdheight=2

" shows $ at end of each line and shows ^I instead of tabs
set list

" show line numbers
set number

" show relative line numbers
set relativenumber 

" remap jk or kj to escape
cnoremap kj <C-C>
cnoremap jk <C-C>

" Indentation settings for using 4 spaces instead of tabs.
" Do not change 'tabstop' from its default value of 8 with this setup.
set shiftwidth=4
set softtabstop=4
set expandtab

" default Vim register to * register
set clipboard=unnamed

Create Vim Plugins (see https://gist.github.com/manasthakur/ab4cf8d32a28ea38271ac0d07373bb53)

mkdir -p ~/.vim/pack/plugins/start
cd ~/.vim/pack/plugins/start
git clone [email protected]:pangloss/vim-javascript.git
  • Remember to :helptags ALL in vim

Add to .gitconfig

[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f
	process = git-lfs filter-process
	required = true
[user]
	name = Jae Bradley
	email = [email protected]
[credential]
	helper = osxkeychain

Update `.hyper.js` file

module.exports = {
  config: {
    opacity: 0.9,
    updateChannel: "canary",
    fontSize: 14,
    fontFamily: '"Hack Nerd Font", "Operator Mono", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
    fontWeight: 300,
    fontWeightBold: 700,
    cursorColor: "rgba(248,28,229,0.8)",
    cursorAccentColor: "#000",
    cursorShape: "BLOCK",
    cursorBlink: false,
    foregroundColor: "#fff",
    backgroundColor: "#000",
    selectionColor: "rgba(248,28,229,0.3)",
    borderColor: "#333",
    css: "",
    termCSS: "",
    showHamburgerMenu: "",
    showWindowControls: "left",
    padding: "12px 14px",
    colors: {
      black: "#000000",
      red: "#C51E14",
      green: "#1DC121",
      yellow: "#C7C329",
      blue: "#0A2FC4",
      magenta: "#C839C5",
      cyan: "#20C5C6",
      white: "#C7C7C7",
      lightBlack: "#686868",
      lightRed: "#FD6F6B",
      lightGreen: "#67F86F",
      lightYellow: "#FFFA72",
      lightBlue: "#6A76FB",
      lightMagenta: "#FD7CFC",
      lightCyan: "#68FDFE",
      lightWhite: "#FFFFFF"
    },
    shell: "",
    shellArgs: ["--login"],
    env: {},
    bell: "SOUND",
    copyOnSelect: false,
    defaultSSHApp: true
  },
  plugins: ["hyper-material-theme", "hyper-opacity"],
  localPlugins: [],
  keymaps: {}
};

Update powerlevel prompt elements

POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
  context
  root_indicator
  dir
  vcs
)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
  vi_mode
  status
  node_version
  rbenv
  time
  ram
  battery
)

Ensure terminal colors

WARNING! Your terminal appears to support fewer than 256 colors!
If your terminal supports 256 colors, please export the appropriate environment variable
_before_ loading this theme in your ~/.zshrc. In most terminal emulators, putting
export TERM="xterm-256color" at the top of your ~/.zshrc is sufficient.

More elegant install solution

Use symlinks to create a more elegant install solution where all files are located in ~/dotfiles but then symlink themselves to the correct files

Don't forget to install oh-my-zsh

Need to run this at some point

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Update .zshrc

export TERM="xterm-256color"

# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:$PATH:/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin

# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh

# ssh
export SSH_KEY_PATH="~/.ssh/rsa_id"

# Postgres App
export PATH=/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH

# env variables
source $HOME/.env

# nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

export HOMEBREW_CASK_OPTS="--appdir=/Applications"

# virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/projects
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'

source /usr/local/bin/virtualenvwrapper.sh

# zsh configs
ZSH_CONFIGS=$HOME/zsh/configs

# zsh scripts
ZSH_SCRIPTS=$HOME/zsh/scripts

# zsh functions
ZSH_FUNCTIONS=$HOME/zsh/functions

# Disabling compfix so can source files
ZSH_DISABLE_COMPFIX="true"

# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
POWERLEVEL9K_MODE='nerdfont-complete'
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
  context
  root_indicator
  dir
  vcs
)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
  vi_mode
  status
  node_version
  rbenv
  time
  ram
  battery
)

#POWERLEVEL9K_TIME_FORMAT="%D{%H:%M %m.%d.%y}"
POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S}"
POWERLEVEL9K_STATUS_VERBOSE=false

#POWERLEVEL9K_SHORTEN_STRATEGY="truncate_from_right"
POWERLEVEL9K_NODE_VERSION_BACKGROUND='022'

POWERLEVEL9K_SHORTEN_DIR_LENGTH=4
POWERLEVEL9K_OS_ICON_BACKGROUND="white"
POWERLEVEL9K_OS_ICON_FOREGROUND="blue"
POWERLEVEL9K_DIR_HOME_FOREGROUND="white"
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="white"
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
POWERLEVEL9K_CONTEXT_TEMPLATE="%n"

# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
HIST_STAMPS="mm/dd/yyyy"

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Add wisely, as too many plugins slow down shell startup.
plugins=(
  bundler
  brew
  calc
  colored-man-pages
  dotenv
  encode64
  git
  gitfast
  httpie
  jsontools
  mylocation
  npm
  osx
  pip
  python
  rails
  rake
  rbenv
  ruby
  urltools
  vi-mode
  web-search
  wd
  yarn
  you-should-use
  zsh-autosuggestions
  zsh-completions
  zsh-plugin-rails
  zsh-syntax-highlighting
)

cdpath=(
  $HOME/groove
  $HOME/projects
)

fpath=(
  $ZSH_FUNCTIONS
  $fpath
)

autoload -Uz compinit && compinit
autoload -U add-zsh-hook
autoload -U $ZSH_FUNCTIONS/*(:t)

add-zsh-hook chpwd load-nvmrc
add-zsh-hook chpwd auto-ls

# Source the config files
source $ZSH_CONFIGS/aliases.sh
source $ZSH_CONFIGS/groove_aliases.sh
source $ZSH_CONFIGS/editor.sh
source $ZSH_CONFIGS/history.sh
source $ZSH_CONFIGS/keybindings.sh
source $ZSH_CONFIGS/options.sh
source $ZSH_CONFIGS/window.sh

# Source the scripts
source $ZSH_SCRIPTS/npm-completion.sh
source $ZSH_SCRIPTS/nvm.sh
source $ZSH_SCRIPTS/prompt.sh
source $ZSH_SCRIPTS/rbenv-init.sh
source $ZSH_SCRIPTS/tabtab-source-yarn-package.sh

source $ZSH/oh-my-zsh.sh
source /usr/local/etc/profile.d/z.sh

source $HOME/.env

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# added by travis gem
[ -f /Users/jaebradley/.travis/travis.sh ] && source /Users/jaebradley/.travis/travis.sh

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.