Skip to content

aswna/Environment

Repository files navigation

Environment

Overview

Configuration files for my zsh (shell), GNU screen (terminal multiplexer) and Vim (text editor) environment on Linux/Windows, used from PuTTY (ssh client) on Windows.

I use the Solarized color scheme in Vim, PuTTY, Gnome terminal and for GNU dircolors.

Markup used in this file

In this file GitHub Flavored Markdown is used.

Cloning repository

See more info about cloning on GitHub. See below Submodules section, too.

For read-only access it is easy to use the https:// URL.

git clone https://github.com/aswna/Environment.git

For read/write access it is best to setup ssh keys and use SSH.

git clone [email protected]:aswna/Environment.git

Using this repository

Create symbolic links in your home directory to the configuration files in this repository. Some examples:

.config/redshift.conf -> <repo dir>/.config/redshift.conf
.dircolors            -> <repo dir>/dircolors-solarized/dircolors.256dark
etc                   -> <repo dir>/etc
.gitconfig            -> <repo dir>/.gitconfig
.hgrc                 -> <repo dir>/.hgrc
.plan                 -> <repo dir>/.plan
.pystartup            -> <repo dir>/.pystartup
.screenrc             -> <repo dir>/.screenrc
.vim                  -> <repo dir>/.vim
.vimrc                -> <repo dir>/.vimrc
.zsh                  -> <repo dir>/.zsh
.zshrc                -> <repo dir>/.zshrc

Submodules

Adding new submodule

Adding a new Git submodule is easy.

git submodule add <git repo> <directory to clone submodule into>

Cloning, updating a submodule

You can clone the repository in a way, which clones the submodules, too, with Git 1.6.5 and later.

git clone --recursive <git repo>

In an already existing (cloned) repository, you need to initialize the submodules first and -- usually -- switch to the main branch. The best I could find is the following:

git submodule update --init --recursive
git submodule foreach --recursive git checkout master
git submodule foreach --recursive git pull

Deleting a submodule

  1. Delete the relevant line from the .gitmodules file.
  2. Delete the relevant section from .git/config.
  3. Run git rm --cached <path_to_submodule> (no trailing slash).
  4. Delete the now untracked submodule directory.
  5. Commit the "superproject" (modified .gitmodules file and deleted submodule directory).
  6. Remove the submodule cache from .git/modules/. Example: rm -rf .git/modules/.vim/bundle/vim-cccs. Otherwise, it does not seem possible to add a different submodule with the same name, to the same place.

For more details see the Git submodule tutorial.

Notes for usage on Windows

On Windows -- currently -- the only interesting thing here is the Vim configuration, settings.

Add Python directories to System Path: Computer -> Right-click -> Properties -> Advanced System settings -> Advanced (in System Properties) -> Environment variables -> System variables -> Path.

Path = ...;C:\Python27;C:\Python27\Scripts;C:\Python27\Lib\site-packages

Add some Unix-like utilities from Git install path:

Path = ...;C:\Program Files (x86)\Git\bin

How to install syntax checkers for Python (used by Syntastic)

I assume Python (2.7) is already installed. Download and execute distribute_setup.py, then install pip with the following command:

easy_install pip

After having pip, it is easy to install the Python syntax checkers. Namely

pip install -U flake8 frosted isort mccabe py3kwarn pycodestyle pydocstyle pyflakes pylama pylint

Note: flake8 installs pycodestyle, pyflakes and mccabe. Pylama is a wrapper around pycodestyle, pydocstyle, pyflakes, pylint, maccabe, and isort. Pylama seems to be a better alternative compared to flake8.

Troubleshooting

Cannot clone/sync with Git on Windows

Make sure, you have the correct proxy settings in the shell, where the git commands are invoked. (There are no quotes around <your proxy:port>)

set http_proxy=<your proxy:port>
set https_proxy=<your proxy:port>

Check whether you are using Symantec Endpoint Protection. If so, the you may want to change Client Management settings: Current location to "Out of ... premises".

After deleting a submodule and adding back another with the same name, Git gets confused

See step 6. in Deleting a submodule section above.

error: SSL certificate problem, verify that the CA cert is OK.

Error during the pull of YouCompleteMe:

Entering '.vim/bundle/YouCompleteMe/python/ycm/completers/python/jedi'
error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/davidhalter/jedi.git/info/refs?service=git-upload-pack
fatal: HTTP request failed
Stopping at 'python/ycm/completers/python/jedi'; script returned non-zero status.
Stopping at '.vim/bundle/YouCompleteMe'; script returned non-zero status.

Solution (workaround 1): Edit below files, to contain the git protocol and not https for Jedi.

.git/modules/.vim/bundle/YouCompleteMe/modules/python/ycm/completers/python/jedi/config
.vim/bundle/YouCompleteMe/.gitmodules

Solution (workaround 2):

env GIT_SSL_NO_VERIFY=true git submodule foreach --recursive git pull

Troubleshooting (obsolete)

Following troubles are obsolete, since my way of use has changed.

Alt-Left/Alt-Right do not switch between GNU screen windows using from PuTTY

Use default PuTTY config options, except for Terminal -> Features -> Disable application cursor keys mode. Its default setting is off, and it must be turned on.

Vim key bindings do not work as expected using from PuTTY

See above.

You are not currently on a branch...

Sometimes git pull cannot succeed. Example:

Stopping at 'zsh'; script returned non-zero status.
> cd zsh
> git branch
* (no branch)
  master
> git checkout master

See above "Cloning, updating a submodule".

warning: templates not found /some/path/git-core/templates

Set the correct templates path explicitly.

git clone --template=/path/to/git-core/templates [email protected]:aswna/Environment.git

About

Configuration files for zsh/screen/vim environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published