Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xros/dotfiles

dotfiles for Vim and other settings
https://github.com/xros/dotfiles

bash cpp dotfiles ide java lua python tmux vim zsh zshell

Last synced: 26 days ago
JSON representation

dotfiles for Vim and other settings

Awesome Lists containing this project

README

        

Dot files
===
Dot files for Bash, Tmux, Zsh, Vim, Elinks, Mutt, Gnupg, Python, Java, Rtorrent.
A C/C++/Java/Python/HTML IDE for Vim is built in.
With Machine Learning Settings for TensorFlow 1.4+ and Cuda 8.0+
--- Created by Songhua Liu
VIM Plugins including
---
* jedi
* ctags
* tagbar
* csv.vim
* NERDTree
* ftplugin
* supertab
* vim-clang
* emmet-vim
* ctrlp.vim
* colorizer
* ultisnips
* indentLine
* numbers.vim
* nerdcommenter
* vim-airline
* vim-crosshairs
* vim-fugitive
* vim-indent-guides
* vim-airline-themes
* vim-visual-multi
* vim-javacomplete2
* vim-python-pep8-indent
* Default Vim colorscheme is corporation. Also you can try this [**raincode**](https://github.com/xros/dotfiles/blob/master/.vim/colors/raincode.vim)
* and so on , just check it out. For VIM 7.3+

##### An Easter egg
* Try \\r to see what's gonna happen in your Vim :) Hit Ctrlc to escape.

Usage
----
* Use the script ```cp_files.sh``` to **backup** previous files and **replace** them within files in this project. The ```cp_files.sh``` will copy those dotfiles to the system user's home folder.
* These settings are shipped with configuration files for some common tools, including `Elinks, Vim, Mutt, Python(2/3), Zsh, Rtorrent, Golang-go, Ardupilot and etc.`
* Usage:

![backup and install](https://github.com/xros/dotfiles/raw/master/static/snapshot349.png)

* Default Vim colorscheme is molokai
* The bash scheme looks like this by default.

![console schema](https://github.com/xros/dotfiles/raw/master/static/snapshot111.png)

Explanation
----
* This is very neat for new PC initialization. Mostly for Debian/Ubuntu or its derived destros. This is friendly compaitble with Ubuntu12.04+/Linuxmint13+/Debian6+/Ubuntu14.04/Ubuntu16.04 and more their derived destros.

* Notice that: For some vim users to use tagbar/ctags, they would need to install the package "ctags". For example on debian/ubuntu ```sudo apt-get install ctags``` , or on centOS/Fedora/RHEL ```sudo yum install ctags```, or on archlinux ```pacman -S ctags```
* The ```init_*.sh``` and the ```cp_files.sh``` are very neat for new users both on ubuntu12.04 and ubuntu14.04.
```init_ubuntu_12.04.sh``` is compatible with Debian7/Ubuntu12.04 while ```init_ubuntu_14.04.sh``` is for Ubuntu14.04. The default Vim provided on Ubuntu 16.04 is not pre-compiled with `Python` support. To use these Vim settings, you should install Vim with Python support. See [here](https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source) for info about compiling it

Pre-compiled Vim Downloads
-------------------------
I compiled Vim on serveral platforms to make sure you can use my dotfiles without a problem.

Download a Vim deb package pre-compiled with `Java`, `Python`, `Lua`, `Ruby` support.

[ Vim on Debian8/Ubuntu16.04 x86_64](https://drive.google.com/open?id=0BzL1CwVspEkiS2lwUURsQUMtYUU),

[ Vim 8.0.0133 on Debian7/Ubuntu14.04 x86_64](https://drive.google.com/open?id=0BzL1CwVspEkib1pOZEJpYU15SjA),

[ Vim on Debian8 for ARM 7L Raspberry Pi and NanoPi/NanoPC Computers](https://drive.google.com/open?id=0BzL1CwVspEkiSGZOZ0J1VkNZQWs)

#### Python IDE
* There's a Python IDE inside. Type **:Ide** in the Vim prompt console.
* Press F9 to enter Python IDE
* Using ```:b [your_file_name]``` to switch between different buffers windows in Vim
![Vim IDE](https://github.com/xros/dotfiles/raw/master/static/snapshot229.png)

Paste mode toggle: F2

numbers.vim toggle: F3

Re-fresh CtrlP fuzzy search cache switch: F5

indentLine.vim toggle: F6

`make` command shortcut: F7

Snippets can be found at ```.vim/UltiSnips/```

Ultisnips open key trigger: \\s

Ultisnips jump forward trigger: \\f

Ultisnips jump backward trigger: \\b

[Colorizer Plugin](https://github.com/lilydjwg/colorizer) toggle: \\tc

*Notice*: `````` in file ```.vimrc``` represents \\

To use **jedi** autocompletion in vim, you need to install vim-python-jedi package. For example, on Linux debian and Ubuntu `sudo apt install vim-python-jedi`. FYI, if you use python in **miniconda** environment, please read this

#### C/C++ IDE
* Type **:Ide** in the Vim prompt console.

![clang IDE in Vim](static/vim-clang.png)

I used `clang` to show some variable name predictions in this setting.

The C/C++ IDE ablity is based on `global`.

For more info, please visit [vim-clang](https://github.com/justmao945/vim-clang)

[Reference of snippets for C/C++](https://github.com/yangyangwithgnu/use_vim_as_ide#52-模板补全)

*Notice*: Use keys \\s, \\f, \\b to start, jump forward and jump backward with the snippets.

*Notice*: Vim plugin **Conque-GDB** is removed due to non-maintainance.

#### JAVA IDE

By default it works with JDK 8 at least. If you want to set your personal JDK, please change the `JAVA_HOME`/`JRE_HOME`/`PATH` in file `.bashrc`
Check this [tutorial](http://www.tecmint.com/install-java-jdk-jre-in-linux/) for switching to JDK8 for Ubuntu destro.

##### Demo
![Vim Java 1](.vim/bundle/vim-javacomplete2/doc/demo.gif)

##### Generics demo
![Vim Java 2](.vim/bundle/vim-javacomplete2/doc/generics_demo.gif)

For more info and settings, please visit [here](https://github.com/artur-shaik/vim-javacomplete2) for help.

#### HTML IDE
* There's a HTML IDE inside. It was detrived from [emmet-vim](https://github.com/mattn/emmet-vim).

##### Quick Tutorial

Open or create a New HTML File:

vim index.html

Type something ( Notice: "\_" is the cursor position):

html:5_

Then type `,` (Ctrly,), and you should see:

```html


_

```

Type

```
test1
test2
test3
```

Then select these 3 lines using Vim visual line keys Shiftv. Then press keys Ctrly,, you will see what it shows as the followings. Please try it.

![Coding in HTML](https://github.com/xros/dotfiles/raw/master/static/emmet-vim-screenshot.gif)

* More info about this tool can be found at [emmet-vim](https://github.com/mattn/emmet-vim) and [more tutorials](https://raw.github.com/mattn/emmet-vim/master/TUTORIAL).

#### Tmux operation in brief
* In tmux, use key bindings to move cursors for copying, pasting anything in terminal. (Add support for tmux version after 2.6 and before 2.6 on old servers/workstations. Now it also supports latest tmux version greater equal than 2.9 and the system will automatically set and back up settings for you)

Enter copy and paste mode (Vi bindings)
Ctrlb[

In copy/paste mode for cursor moving

| Direction | Key |
| ------- | ----:|
| down | j |
| up | k |
| left | h |
| right | l |

To select v

To copy/yank selection y

To quit copy/paste mode, q

To paste your selection, Ctrlb]

#### CSV editor
* For csv/dat file editing using csv.vim
![Vim csv](https://github.com/xros/dotfiles/raw/master/static/snapshot37.png)

The demo of CSV file editing:
![Vim csv demo](https://github.com/xros/dotfiles/raw/master/static/csv.gif)

##### Notice:
> If your csv file is very big, please do not edit it using Vim. It would be slow. Libreoffice is your friend. But viewing csv files in this manner makes me feel great.

#### Machine Learning Settings
* Not like before, I switched to docker rather than an actual machine for machine learning tasks starting from Tensorflow v1.10, which is simple. To take the most advantage of Nvidia graphic cards, the only thing we need to do is to install a latest Nvidia Graphic Driver for the host Linux PC and download the Pre-assembled nvidia docker from [here](https://github.com/NVIDIA/nvidia-docker). Then follow the tutorial. I deleted all the settings for *Tensorflow* in the file `.bashrc`. The Nvidia docker comes with all elements that the framework *tensorflow* needs for acceleration. And the docker even comes with Jupyter which is easier for people to try algorithms in web browser.

#### Have Fun ####
By Songhua Liu A.K.A. [xros](https://github.com/xros)