Newer
Older

Hermann Mayer
committed
# Linux Environment
The Linux environment project is a complete bootstrap boilerplate for a
common developer / admin system. It ships a big but flexible bash library
for almost all known shell tasks which are usefull for a day to day basis.
A configurable vim environment is shipped as well. You can setup vim as an
IDE or as a minimal editor. For those who do, since 13 Aug, 2012.

Hermann Mayer
committed
For [this blog post](http://hermann-mayer.net/blog/bash-als-power-shell-und-vim-als-ide) for screenshots.
## Getting started
The installation of the environment can be done with two different ways. The
easy way with the curl/dialog based installation - you just need the ``curl``
and ``dialog`` binaries. You also can choose the hard way with a step by step
installation.
### Curl / Dialog installation
Just run the following command to start the interactive installation:
```bash
$ curl http://code.jity.de/Jack12816/linux-environment/raw/master/install.sh | bash
```
### Step by step installation
This procedure is for installing the project system wide.

Hermann Mayer
committed
First of all just clone the git repository to a persistent location. :)

Hermann Mayer
committed
```bash
$ cd /opt
$ git clone http://code.jity.de/Jack12816/linux-environment.git
$ cd linux-environment

Hermann Mayer
committed
```

Hermann Mayer
committed
Create a configuration directory for the BashRC project inside your $HOME.
And copy all distributed configurations to the new config directory.

Hermann Mayer
committed
```bash
$ mkdir -p ~/.bashrc.d
$ eval `find config/*.dist | awk '{printf "cp -T " $0; gsub(/\.dist|config\//,""); print " ~/.bashrc.d/" $0 ";"}'`
```

Hermann Mayer
committed
Link all BashRC dot-files to your $HOME to getting everything up and running.

Hermann Mayer
committed
```bash
$ cd dot && cp `pwd`/.* ~; cd -
$ cd dotrc && ln -s `pwd`/.* ~; cd -
```

Hermann Mayer
committed
After these steps you got a new git-config (.gitconfig.dist) file inside your $HOME.
Rename it to .gitconfig and change your name and email address.

Hermann Mayer
committed
I recommend you to use the patched font with your terminal emulator to get the
best results. You have linked the .fonts directory already to your $HOME, so just
run the following command to setup the font for your system account. Afterwards
you need to restart your terminal emulator and pick the new installed font.
(LiberationMono-Regular-Powerline || SourceCodePro-Regular-Powerline)

Hermann Mayer
committed
```bash
$ fc-cache -fr
```

Hermann Mayer
committed

Hermann Mayer
committed
## Bash
Have a look at the ~/.bashrc.d/exports.conf file. There you can
enable/disable components and set for your setup specific settings.
## Vim
You can choice which version of vim you are going to install. There is a
minimal(-non-IDE) version and a full-featured(-IDE) version. If your are going
to install this on a server system is usefuller to choose the minimal version,
unless you develop on the server system.

Hermann Mayer
committed
Have a look at the $HOME/.bashrc.d/vim.conf and modify it to fit your needs.
The default setting is the minimal mode.

Hermann Mayer
committed
```vimscript
" # +-------------------------------------------------
" # | Vim Config
" # +-------------------------------------------------
" Enable specific bundles
" As the default only the VimRCBundlesMisc will be enabled.
" If you wish more features just enabled the bundle group.
let VimRCBundlesDevel = 1
let VimRCBundlesSysAdmin = 1
let VimRCBundlesHTML = 1
" let VimRCBundlesPython = 1
let VimRCBundlesPHP = 1
" let VimRCBundlesJava = 1
let VimRCBundlesJavaScript = 1
" Enable VimRC functionality loading
" As the default settings all parts of the VimRC are enabled.
" You can easily disable the parts you didn't like.
" let VimRCMisc = 0
" let VimRCFiletypes = 0
" let VimRCFunctions = 0
" let VimRCKeymap = 0
" let VimRCBundlesOptions = 0
```

Hermann Mayer
committed
After you choose a version, just startup vim for the first time. It will load
all required packages/bundles according to the configured version. After all

Hermann Mayer
committed
bundles are processed, there may be an error about "close-duplicate-tabs". You
can safely ignore it and just press enter. When all is done, just close vim
with :qa! and everything is ready for production.

Hermann Mayer
committed

Hermann Mayer
committed
```bash
$ vim
```
### PHP support

Hermann Mayer
committed
On the full-featured(-IDE) version you may want to install a better
tagbar support for PHP. So just run these commands:

Hermann Mayer
committed
```bash

Hermann Mayer
committed
$ cd /opt/linux-environment/dotrc/.vim/tools

Hermann Mayer
committed
$ git clone https://github.com/techlivezheng/phpctags.git && cd phpctags

Hermann Mayer
committed
$ make

Hermann Mayer
committed
```

Hermann Mayer
committed
Another usefull thing to install is the PHP documentation if you need it.
Just run the following:

Hermann Mayer
committed
```bash

Hermann Mayer
committed
$ cd /opt/linux-environment/dotrc/.vim/doc

Hermann Mayer
committed
$ wget http://www.php.net/get/php_manual_en.tar.gz/from/de1.php.net/mirror -O php_manual_en.tar.gz
$ mkdir php-manual
$ tar xfv php_manual_en.tar.gz -C php-manual --strip-components=1
```
### JavaScript/Node.js support

Hermann Mayer
committed
For a nice Javascript/Node.js integration I added jsctags to the default vim
toolset. To get a nice syntax/coding-standard check for Javascript install
jslint and jshint via node's package manager - npm. After this you can check
your active buffers with <F11>.

Hermann Mayer
committed
```bash
$ npm install jslint jshint -g
```
To fetch all needed files for spellchecking just run these commands
and edit it for your needs:

Hermann Mayer
committed
### Common stuff
For english support:

Hermann Mayer
committed
```bash
$ for i in "en.ascii.spl" "en.ascii.sug" "en.latin1.spl" "en.latin1.sug" "en.utf-8.spl" "en.utf-8.sug"; do \
cd ~/.vim/spell/ && wget "ftp://ftp.vim.org/pub/vim/runtime/spell/${i}"; \
done
```
For german support:

Hermann Mayer
committed
```bash
$ for i in "de.utf-8.sug" "de.utf-8.spl" "de.latin1.sug" "de.latin1.spl"; do \
cd ~/.vim/spell/ && wget "ftp://ftp.vim.org/pub/vim/runtime/spell/${i}"; \
done
```

Hermann Mayer
committed
Nice! You made it. Now everything should work!

Hermann Mayer
committed
## Known Issues

Hermann Mayer
committed
The vim-powerline project was deprecated but can used further by
running the following: (The new is a python package, so we will switch sometimes)

Hermann Mayer
committed
```bash
$ cd ~/.vim/bundle/vim-powerline
$ git checkout develop
```