Coder Social home page Coder Social logo

westurner / dotfiles Goto Github PK

View Code? Open in Web Editor NEW
39.0 3.0 7.0 68.09 MB

Bash, Python, IPython scripts, and userspace configuration https://westurner.org/dotfiles/

Home Page: https://westurner.org/dotfiles/

License: BSD 3-Clause "New" or "Revised" License

Shell 40.86% Python 52.34% Makefile 0.80% GLSL 0.01% CSS 0.01% JavaScript 0.01% Ruby 0.03% Vim Script 1.07% Roff 0.12% HTML 4.76%
shell python ipython gnome i3wm bashrc virtualenv virtualenvwrapper conda makefile

dotfiles's Introduction

Dotfiles

image

image

image

Goals

  • Streamline frequent workflows
  • Configure Bash, ZSH, and Vim
  • Configure Python, pip, virtualenv, virtualenvwrapper
  • Configure IPython
  • Configure Gnome
  • Configure i3wm
  • Support Debian Linux, Ubuntu Linux, OSX
  • Document commands and keyboard shortcuts
  • Create a productive working environment

Installation

Requirements

Project requirements are installed by bootstrap_dotfiles.sh and/or, optionally, also a Makefile.

  • Bash, Git, Python, pip

Install the dotfiles

The bootstrap_dotfiles.sh shell script:

  • clones the dotfiles and dotvim repositories
  • creates symlinks from HOME to __DOTFILES,
  • installs the dotfiles Python package,
  • installs additional requirements with pip

Create a virtualenv with virtualenvwrapper named "dotfiles":

With Python builds that haven't set a prefix which is writeable by the current user, you can also install into ~/.local with pip --user:

Note

See Quickstart, which uses venv-style paths.

Source the dotfiles

Upgrade the dotfiles

Quickstart

This is a verbose example of installing and working with a VIRTUAL_ENV in WORKON_HOME named "dotfiles".

See Install the dotfiles for more terse installation instructions.

For further documentation, see:

Further Dotfiles Resources

.

dotfiles's People

Contributors

westurner 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

Watchers

 avatar  avatar  avatar

dotfiles's Issues

ENH: topo sort variables from self.environ

Algorithmic Solution (e.g. for testing, initially)

  • tokenize fmtstring vars (${varname} || {varname} || {{ varname }})
  • serialize to edges
  • tsort edges

Programmatic Solution

  • Venv.iter_environ() Defined .iterkeys output sequence for venv.env.environ OrderedDict (with known set of variables)

BUG,UBY: venv: deactivate resets WORKON_HOME to the default

venv is setting WORKON_HOME to the default set in venv.py.

Instead:

  • venv could set WORKON_HOME to os.environ.get('WORKON_HOME', opts.WORKON_HOME if opts.WORKON_HOME else default_workon_home) when: WORKON)

cases:

  • using venv.py for a prefix template
  • using venv.py for a virtualenv
  • using venv.py for a conda env
  • using venv.py with -E/--from-environ

TST: shell test cases

REF: el.py -> vendored python package

el -- "edit lines" --> basically xargs with --each and Python str.format w/ shell quoting [TODO: repr adds a u'' to the front of [some versions of] [some] python3 strings]

BUG: Log output from [hg i] and [hg is] cannot colorize {desc}

...

see: Log templates with labels containing special characters error "parse error at 20:" http://bz.selenic.com/show_bug.cgi?id=4349:

Including a label() for desc when desc contains certain characters causes 'hg log' to error.

Steps to recreate::

# create a repo
mkdir repo; cd repo; echo 'Text' >> text
hg add text
hg commit -m "ENH: Add {git,hg} {i[s]} to log -n1 [and diffstat] (closes #3)"

# works
hg log -l1 --template "{label('custom.desc', node)}\n"

# errors
hg log -l1 --template "{label('custom.desc', desc)}\n"

Error Message:

hg: parse error at 20: syntax error

DOC,BLD: Sphinx >= 2.0 support

  • tell-k/sphinxjp.themes.basicstrap#25 fixes the app.info logging
    • patch locally pending this getting merged
  • Now I'm getting sphinx.errors.ThemeError: no theme named 'basicstrap' found (missing theme.conf?)
    • pip install requirements.txt does
      pip install -e git+ssh://github.com/tell-k/sphinxjp.themes.basicstrap#egg=basicstrap
    • I've tried:
      • pip install -e .
      • pip install .

For now, the workaround is to:

pip install 'sphinx<2.0'

ENH: pretty printing (pp)

scripts/pyline.py -m pprint "pprint.pformat(locals())"
  • Add pp to pretty print the context
scripts/pyline.py 'pp(locals())'

Why are some paths prefixed with '-'?

- sorts first in ASCII sort order.

Sometimes, bash requires ./ as a prefix for paths that strat with -.

  • This is okay because, for log interpretation, it's really more readable to use variables or cdaliases
cd ~ 
cd -wrk/    # ERR
cd ./-wrk/  # OK
cd $_WRK   # OK (venv --wrk="$HOME/-wrk")
cdwrk      # OK (venv cdaliases)
cdh -wrk/  # OK (venv cdaliases)

BUG: ipython_config.py (venv, scripts/venv.py): _APP support is broken

How this should (did) work:

# env vars

__WRK="${HOME}/-wrk"
#WORKON_HOME="~/.virtualenvs"
WORKON_HOME="$__WRK/-ve27"  ## ~/-wrk/-ve27

VENVSTR=${1:-${VENVSTR}}
VENVSTR="dotfiles"  ## we dotfiles
VENVSTRAPP=${2:-${VENVSTRAPP:-${VENVSTR}}}

VIRTUAL_ENV_PREFIX="$VENVSTR"
VIRTUAL_ENV="$WORKON_HOME/$VIRTUAL_ENV_PREFIX"
_VENVPREFIX=$VIRTUAL_ENV
_SRC="$_VENVPREFIX/src"
_WRD="$_SRC/$_APP" 

## Create the __DOTFILES symlink to the current dotfiles repo:
__DOTFILES=~/-dotfiles
ln -s $_WRD $__DOTFILES

## Link to the venv script (also scripts/venv.py, etc/ipython/ipython_config.py)
__VENV="${__DOTFILES}/src/dotfiles/venv/ipython_config.py"

## Workon a venv (in `$WORKON_HOME` (or abspath($1)))
# we() {   ## bash function (we command)
#     source <($__VENV --print-bash $VENVSTR $VENVSTRAPP)
# }
## we dotfiles == we dotfiles dotfiles
we ${1:-${VENVSTR}} ${2:-${VENVSTRAPP:-${VENVSTR}}}
set -x;
[ "$_WRD" == "$WORKON_HOME/$VENVSTR/src/$VENVSTRAPP" ] || return 1

# dotfiles_status  # ds
  • tests
    • unittest.TestCases
    • ] [ shell test cases
  • venv "${1:-${VENVSTR}}" "${2:-${VENVSTRAPP:-${VENVSTR}}}"

BUG: usrlog.sh: \t Linux

Output to $_USRLOG and from ut is not consistent with the behavior on BSD.

Possible causes:

  • tab handling (\t) differences between GNU and BSD programs
  • Bash HISTTIMEFORMAT

Possible remedies:

  • $'\t' ?

ENH: venv.vim: command-completion

" venv.vim
" :Cdwrd, :Cdsrc, :Cdetc completion

" help command-completion
" -complete=dir
" -complete=file (file or dir)
" -complete=function_name

function function_name
" cd to _DIR
" then -complete=dir
endfunction

REF: dotfiles.venv.py -> { venvw, venvv }, dotfiles -> dotfileswt

venv.py

westurner/dotfiles/scripts/venv.py can conflict with python3 -m venv

$ python3 -m venv
usage: venv [-h] [--system-site-packages] [--symlinks | --copies] [--clear] [--upgrade] [--without-pip]
            ENV_DIR [ENV_DIR ...]
venv: error: the following arguments are required: ENV_DIR

workaround:

python3 -m dotfiles,venv

TODO:

  • BLD: venvv [0.1.0?]: cookiecutter
  • ENH: venvv/venvv.py: from westurner/dotfiles/scripts/venv_ipyconfig.py
python -m venvv
python3 -m venvv

python -m dotfileswt.venvv
python3 -m dotfileswt.venvv

dotfileswt

  • setup.py APPNAME='dotfileswt'
  • grin+sed || vimgrep+ 'dotfiles[wt]'

ENH: search all usrlogs

_usrlogs=$(ls ~/.usrlog $WORKON_HOME/*/src/.usrlog)
usrlog-search-all() {
    term=$1
    grep $term ${_usrlogs}

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.