README.md 5.64 KB
Newer Older
1 2 3 4 5 6
# 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
7
IDE or as a minimal editor. For those who do, since 13 Aug, 2012.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

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
```

26 27 28
### Step by step installation

This procedure is for installing the project system wide.
29 30 31

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

32 33
```bash
$ cd /opt
34 35
$ git clone http://code.jity.de/Jack12816/linux-environment.git
$ cd linux-environment
36
```
37 38 39 40

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

41 42 43 44
```bash
$ mkdir -p ~/.bashrc.d
$ eval `find config/*.dist | awk '{printf "cp -T " $0; gsub(/\.dist|config\//,""); print " ~/.bashrc.d/" $0 ";"}'`
```
45 46 47

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

48 49 50 51
```bash
$ cd dot && cp `pwd`/.* ~; cd -
$ cd dotrc && ln -s `pwd`/.* ~; cd -
```
52 53

After these steps you got a new git-config (.gitconfig.dist) file inside your $HOME.
54
Rename it to .gitconfig and change your name and email address.
55 56 57 58 59 60 61

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)

62 63 64
```bash
$ fc-cache -fr
```
65

66 67 68 69 70 71 72 73 74 75 76
## 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.
77 78 79 80

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

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
```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
```

109 110
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
111 112 113
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.
114

115 116 117 118 119
```bash
$ vim
```

### PHP support
120 121 122 123

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

124
```bash
125
$ cd /opt/linux-environment/dotrc/.vim/tools
126
$ git clone https://github.com/techlivezheng/phpctags.git && cd phpctags
127
$ make
128
```
129 130 131 132

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

133
```bash
134
$ cd /opt/linux-environment/dotrc/.vim/doc
135 136 137 138 139 140
$ 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
141

142 143 144 145 146
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>.

147 148 149
```bash
$ npm install jslint jshint -g
```
150

151 152 153
To fetch all needed files for spellchecking just run these commands
and edit it for your needs:

154 155
### Common stuff

156 157
For english support:

158 159 160 161 162
```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
```
163 164 165

For german support:

166 167 168 169 170
```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
```
171

172 173
Nice! You made it. Now everything should work!

174
## Known Issues
175 176 177 178

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)

179 180 181 182
```bash
$ cd ~/.vim/bundle/vim-powerline
$ git checkout develop
```