Skip to content

xros/dotfiles

Repository files navigation

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

  • Default Vim colorscheme is molokai

  • The bash scheme looks like this by default.

    console schema

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

Vim 8.0.0133 on Debian7/Ubuntu14.04 x86_64,

Vim on Debian8 for ARM 7L Raspberry Pi and NanoPi/NanoPC Computers

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

    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 toggle: \tc

    Notice: <leader> 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 davidhalter/jedi-vim#907

C/C++ IDE

  • Type :Ide in the Vim prompt console.

clang IDE in Vim

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

Reference of snippets for C/C++

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 for switching to JDK8 for Ubuntu destro.

Demo

Vim Java 1

Generics demo

Vim Java 2

For more info and settings, please visit here for help.

HTML IDE

  • There's a HTML IDE inside. It was detrived from 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 <c-y>, (Ctrly,), and you should see:

<!DOCTYPE HTML>
<html lang="en">
<head>
        <meta charset="UTF-8">
        <title></title>
</head>
<body>
        _
</body>
</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

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

    The demo of CSV file editing: Vim csv demo

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