[
  {
    "path": ".gitignore",
    "content": "*~\n*.swp\n*.swo\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2015 \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n"
  },
  {
    "path": "README.md",
    "content": "\n# Use VIM as your RUST IDE\n\n\n### Install vim first, if its not already\n\n```sh\n\nsudo apt-get install vim\n```\nIf `vi` worked in your command line, it is most likely the light version of `vi` which is installed by default in Ubuntu, and it lacks most functionality of the real `vi`.\n\n\nYou also need to install\n\n* `curl`\n* `git`\n* `CMake`\n* Python Headers\n* Development Tools\n\nI assume most of you have already installed it, if not then install it via\n\n```sh\n\nsudo apt-get install curl\nsudo apt-get install git\nsudo apt-get install build-essential cmake\nsudo apt-get install python-dev python3-dev\n```\n\n\n\n\n### Install pathogen plugin\n[Pathogen](https://github.com/tpope/vim-pathogen) is a vim plugin which allows you to easily install other plugins, by just adding files into the `~/.vim/bundle` (There are other alternatives, but pathogen is most commonly used)\n\n```sh\n\nmkdir -p ~/.vim/autoload ~/.vim/bundle\ncurl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim\n```\n* Add this to `~/.vimrc`\n\n```sh\nexecute pathogen#infect()\nsyntax on\nfiletype plugin indent on\n```\n\n\n\n\n### Install syntax highlighting for rust\n\n```sh\n\ncd ~/.vim/bundle\ngit clone https://github.com/rust-lang/rust.vim.git\n```\n\n\n\n### Install YouCompleteMe\n\n[YouCompleteMe](https://github.com/Valloric/YouCompleteMe) - a code-completion engine for Vim with support for C-family languages and [Rust](http://blog.jwilm.io/youcompleteme-rust)\n\n```sh\ncd ~/.vim/bundle\n\ngit clone https://github.com/Valloric/YouCompleteMe\n\ncd ~/.vim/bundle/YouCompleteMe\n\ngit submodule update --init --recursive\n\n./install.py --rust-completer\n\n```\n\n* Download source code of the rust version you are using, for example [master branch](https://github.com/rust-lang/rust/)\n* Extract the zip file and put in your Development folder ie. `~/Developer`\n* Checkout and build racer\n\n```sh\n\nmkdir -p ~/Developer/\ncd ~/Developer/\ngit clone --depth 1 --branch master https://github.com/rust-lang/rust rust-master\n\n```\nAdd this to your `.vimrc`\n\n```sh\nlet g:ycm_rust_src_path=\"/home/<username>/Developer/rust-master/src/\"\n```\n\n\n\n### Install Vim number toggle\n\n[vim-numbertoggle](https://github.com/jeffkreeftmeijer/vim-numbertoggle) adds line numbers to the code you are editing.\nLine numbers can either show absolute position or position relative to your cursor location.\nThis will boost your productivity later, when you orchestrate vim commands such as moving 10 lines below the current cursor position: `10j`.\n\n\n\n```sh\n\ncd ~/.vim/bundle\ngit clone git://github.com/jeffkreeftmeijer/vim-numbertoggle.git\n```\n\n\n\n### Install `NERDtree` for displaying files in a tab\n[NERDTree](https://github.com/scrooloose/nerdtree) is a file manager, that most text editors have, such as `sublime`, `atom`, or `eclipse` where it lists the files in the directory you are editing from.\n\n```sh\n\ncd ~/.vim/bundle\ngit clone https://github.com/scrooloose/nerdtree.git\n```\n* Add this to `~/.vimrc`\n\n```\nautocmd VimEnter * NERDTree\nautocmd BufEnter * NERDTreeMirror\n\n\"CTRL-t to toggle tree view with CTRL-t\nnmap <silent> <C-t> :NERDTreeToggle<CR>\n\"Set F2 to put the cursor to the nerdtree\nnmap <silent> <F2> :NERDTreeFind<CR>\n```\n\n\n\n\n\n## Controls\n\n```sh\n\nCTRL-t  - Open/Close the files tab\nCTRL-n  - Toggle relative / absolute numbering\nCTRL-ww - Switch between the files tab and the main window\nF2      - Focus cursor to files tab\n<Enter> - Open the focused files/directory, duh!\nh,j,k,l - Navigate the cursor left, down, up, right respectively\ni       - Insert mode, you can start typing in your code.\n<ESC>   - Back to default mode, where you can issue commands in vi\n:w      - Write/save the file, you are editing\n:wqa    - Save the file, then quit the editor closing vi including the files tab\n```\n## Some advance commands\n\n```sh\n\n:bp                 - Open previous file/buffer\n:bn                 - Open next file/buffer\n:b <filename-part>  - Open the file you are looking for without typing the exact filename\n:vsp                - Vertically split the window\n:vsp <filename>     - Open the file in vertical split\n:sp                 - Horizontal split\n:sp <filename>      - Open the file in horizontal split\n\n```\n* You don't really have to quit the editor using `wq` whenever you want to build the project.\nA convenient way is to open a new tab in a terminal via `<CTRL>-<SHIFT>-t`\nand issue your command (`cargo build --release`) from there. That way, you don't lose the state of your editor,\ni.e. you can undo `u` or redo `<CTRL>-r` your code changes when needed\n\n## Compile without opening another tab\nAlternatively, you can compile your project without opening another terminal instance by issuing the command directly from `vim` using `:! <external terminal command>`\n\n```sh\n:! cargo run --release\n```\n\n\n\n## Try to `vi`ew some files\n\n```sh\n\nvi main.rs\n```\n\n\n* It should look something like this\n\n![](https://raw.githubusercontent.com/ivanceras/rust-vim-setup/master/rust-vim.png)\n\n\n\n## Enable mouse support\n\nIf you want to use the mouse to point and click files and move the cursor around, add this to your `~/.vimrc`\n\n```\n\n\"enable mouse support\nset mouse=a\n```\n\nAdditionally, you can use arrow keys to move the cursor around.\nHowever, if you are really serious about using `vi` and want to maximize your `vi` skills, you should minimize the use of the arrow keys or the mouse.\n\n![Using Mouse](https://raw.githubusercontent.com/ivanceras/rust-vim-setup/master/using-mouse.gif)\n\n## A helpful vim cheatsheet at\n* http://vim.rtorr.com/\n* [My Comprehensive List](https://github.com/ivanceras/rust-vim-setup/blob/master/VIM_Notes.md)\n\n\n## Automatically reload files when changed\n\nSometimes some of your files might get edited outside of your current `vi` session, such as other editors/code generators, dropbox sync, git pulls.\n\n* Add this to your `~/.vimrc` to refresh them automatically\n\n```\n\n\" check file change every 4 seconds ('CursorHold') and reload the buffer upon detecting change\nset autoread\nau CursorHold * checktime  \n```\n\n## Enable the global Clipboard in vim\nIn Linux distros, you have to install `vim-gtk` to gain clipboard functionality.\n\n[More information here.](http://stackoverflow.com/questions/3961859/how-to-copy-to-clipboard-using-vim)\n\n```sh\n\nsudo apt-get install vim-gtk\n\n```\nThen you can\n\nCopy to `+` register, which is the global/OS clipboard\n`\"+y`\n\nPaste from `+` register\n`\"+p`\n\n\nPasting is equivalent to `<CTRL>-<SHIFT>-v` in insert mode.\nIt is equivalent to pasting (`<CTRL>-v`) in terminal.\n\n\n\n## One step install for those who have never used vim before or people who want to do it automatically\n* This will replace your existing `~/.vimrc` and `.vim`, if you have one\n* Don't hold me responsible for breaking your vim configuration, your laundry machine or anything else that would make you angry.\n\n```sh\n\nsudo apt-get install curl\n\ncurl -sSf https://raw.githubusercontent.com/ivanceras/rustupefy/master/setup.sh | sh\n\n```\n\n## Update\n\n* Update it via (same as setup)\n\n```sh\n\ncurl -sSf https://raw.githubusercontent.com/ivanceras/rustupefy/master/setup.sh | sh\n\n```\n\n## Uninstall\n\n```sh\n\ncurl -sSf https://raw.githubusercontent.com/ivanceras/rustupefy/master/uninstall.sh | sh\n\n```\n"
  },
  {
    "path": "VIM_Notes.md",
    "content": "\n# Basic Controls\n\tCTRL-t \t\t\topen or close nerdtree\n\tCTRL-n \t\t\ttoggle relative / absolute numbering\n\tCTRL-w w \t\tswitch focus on nerdtree and open windows\n\th,j,k,l\t\t\tnavigate the cursor left, down, up, right respectively\n\ti\t\t\t\tinsert mode, you can start typing in your code\n\t<ESC>   \t\tgo back to normal/default mode, where you can issue vi commands\n\t:w      \t\twrite/save the file, you are editing\n\t:wqa   \t\t\tsave the file, then quit the editor closing vi including the files tab\n\t<F2>\t\t\tset focus on the nerd tree\n\n## Rust specific commands\n\n\tCTRL-x CTRL-o   activate auto rust autocompeletion (example: type in `String::` then press CTRL-x CTRL-o then select from the drop down list the appropriate functions)\n\tgd              go to function/struct/variable declaration of the focused item ( this is equivalent to eclipse' open declaration )\n\tgD              go to declaration split open in window tab\n\t:bp             to go back to the previous edited file (very useful when following a declaration)\n\t:b <part of filename>  when you have open a lot of files, this comes in handy in showing back the previously open files\n\n\n# NERDTree specific commands\n\n    o       open files, directories and bookmarks\n    go      open selected file, but leave cursor in the NERDTree\n    t       open selected node/bookmark in a new tab\n    T       same as 't' but keep the focus on the current tab\n    i       open selected file in a split window\n    gi      same as i, but leave the cursor on the NERDTree\n    s       open selected file in a new vsplit\n    gs      same as s, but leave the cursor on the NERDTree\n    O       recursively open the selected directory\n    x       close the current nodes parent\n    X       recursively close all children of the current node\n    e       edit the current dif\n\n    ENTER              open files, directories and bookmarks\n    double-click       open files, directories and bookmarks\n\n    D       delete the current bookmark\n\n    P       jump to the root node\n    p       jump to current nodes parent\n    K       jump up inside directories at the current tree depth\n    J       jump down inside directories at the current tree depth\n    CTRL-J  jump down to the next sibling of the current directory\n    CTRL-K  jump up to the previous sibling of the current directory\n\n    C       change the tree root to the selected dir\n    u       move the tree root up one directory\n    U       same as 'u' except the old root node is left open\n    r       recursively refresh the current directory\n    R       recursively refresh the current root\n    m       display the NERD tree menu\n    cd      change the CWD to the dir of the selected node\n\n    I       toggle whether hidden files displayed\n    f       toggle whether the file filters are used\n    F       toggle whether files are displayed\n    B       toggle whether the bookmark table is displayed\n\n    q       close the NERDTree window\n    A       zoom (maximize/minimize) the NERDTree window\n    ?       toggle the display of the quick help\n    \n    \n    \n    \n# Cursor movement\n\n    h   \tmove left\n    j   \tmove down\n    k   \tmove up\n    l   \tmove right\n    \n    \t*Note: Prefix a cursor movement command with a number to repeat it. For example, 4j moves down 4 lines.*\n\n    CTRL-b  page up\n    CTRL-f  page down\n    %   \tjump to matching brace\n    w   \tjump by start of words (punctuation considered words)\n    W   \tjump by words (spaces separate words)\n    e   \tjump to end of words (punctuation considered words)\n    E   \tjump to end of words (no punctuation)\n    b   \tjump backward by words (punctuation considered words)\n    B   \tjump backward by words (no punctuation)\n    ge  \tjump backward to end of words (punctuation considered words)\n    gE  \tjump backward to end of words (no punctuation)\n    0   \t(zero) start of line\n    ^   \tfirst non-blank character of line\n    $   \tend of line\n    gg   \tgo to first line\n    G       go to last line of the file\n    [N]G   \tgo To line N, (example 20G  - go to Line 20)\n    \n    \n# Inserting/Appending text\n    \n    i   start insert mode at cursor\n    I   insert at the beginning of the line\n    a   append after the cursor\n    A   append at the end of the line\n    o   open (append) blank line below current line (no need to press return)\n    O   open blank line above current line\n\tea  append at end of word\n    ESC exit insert mode, to normal mode\n    \n# Editing\n    \n    r    \treplace a single character (does not use insert mode)\n    J    \tjoin line below to the current one\n    cc  \tchange (replace) an entire line\n    cw    \tchange (replace) to the end of word\n    c$   \tchange (replace) to the end of line\n    s   \tdelete character at cursor and subsitute text\n    S   \tdelete line at cursor and substitute text (same as cc)\n    xp   \ttranspose two letters (delete and paste, technically)\n    u   \tundo\n    CTRL-r  redo\n    .       repeat last command\n    ~       switch case\n    g~iw   \tswitch case of current word\n    gUiw  \tmake current word uppercase\n    guiw   \tmake current word lowercase\n    >>      indent line one column to right\n    <<      indent line one column to left\n    ==      auto-indent current line\n    ddp     swap current line with next\n    ddkP\tswap current line with previous\n    \n# Cut and Paste\n    \n    dd  \t    delete (cut) a line\n    dw  \t    delete the current word\n    x           delete current character\n    X           delete previous character\n    D   \t    delete from cursor to end of line\n    yy          yank (copy) a line\n    2yy         yank 2 lines\n    yw          yank word\n    y$          yank to end of line\n    p           put (paste) the clipboard after cursor/current line\n    P           put (paste) before cursor/current line\n    :set paste  avoid unexpected effects in pasting\n    \n# Visual Mode - Marking, Highligting text\n    \n    v       start visual mode, mark lines, then do command (such as y-yank)\n    V       start Linewise visual mode (i.e selecting the whole line at the cursor location )\n    o       move to other end of marked area\n    U       upper case of marked area\n    CTRL-v  start visual block mode (that is, selecting text in rectangular area marker)\n    O       move to Other corner of block\n    aw      mark a word\n    ab      a () block (with braces)\n    aB      a {} block (with brackets)\n    ib      inner () block\n    iB      inner {} block\n    ESC     exit visual mode, go to normal mode\n    gv      re-select the last selected visual area\n   \n   \t*Note: right after entering visual mode, you can use the same cursor movement commands in the normal/default mode to highlight your selection*\n    \n# Visual Mode\n\n## Commands\n    \n    >   shift right the marked text\n    <   shift left the marked text\n    c   change (replace) marked text\n    y   yank (copy) marked text\n    d   delete (cut) marked text\n    ~   switch case of the marked text\n    \n## Cut and paste\n    \n    1. Place the cursor at the start of your text.\n    2. ma (marks the location as point 'a')\n    3. Place the cursor at the end of your text.\n    4. d'a (cuts back to location 'a')\n    \n## Exiting\n    \n    :w  - write (save) the file, but don't exit\n    :wq - write (save) and quit\n    :x  - same as :wq\n    :q  - quit (fails if anything has changed)\n    :q! - quit and throw away changes\n    \n# Search/Replace\n    \n    /pattern        search for pattern\n    ?pattern        search backward for pattern\n    n               repeat search in same direction\n    N               repeat search in opposite direction\n    :%s/old/new/g   replace all old with new throughout file\n    :%s/old/new/gc  replace all old with new throughout file with confirmations\n    %               go to the corresponding (, {, [.\n    *               go to next occurrence of the word under the cursor\n    #               go to previous occurrence of the word under the cursor\n\n    \n# Working with multiple files\n    \n    :e filename     edit a file in a new buffer\t\n    :n **/*.pl      open all perl files under the current directory, recursively\n    :tabe filename  edit a file in a new tab (Vim7, gVim)\n    :bnext (or :bn  go to next buffer\n    :bprev (or :bp  go to previous buffer\n    :bd             delete a buffer (close a file)\n    :sp filename    open a file in a new buffer and split window\n    CTRL-w s        split windows\n    CTRL-w w        switch between windows\n    CTRL-w q        quit a window\n    CTRL-w v        split windows vertically\n    CTRL-w x        swap the current window with the next one\n    :e#             Open previous file\n    CTRL-^          Edit the alternate file.  Mostly the alternate file is\n                        the previously edited file.  This is a quick way to\n                        toggle between two files.  It is equivalent to \":e#\",\n                        except that it also works when there is no file name.\n\n### Moving the cursor in between windows\n    CTRL-w h    Move cursor left to the current window\n    CTRL-w k    Move cursor top to the current window\n    CTRL-w j    Move cursor bottom to the current window\n    CTRL-w l    Move cursor right to the current window\n\n## Moving windows with respect to the current focused window\n    CTRL-w H    Move current window to the far left\n    CTRL-w K    Move current window to the top\n    CTRL-w J    Move current window to the bottom\n    CTRL-w L    Move current window to the right\n    \n## Window movements\n\tCTRL-w |    Maximize the window horizontally\n\tCTRL-w _    Maximize the window vertically\n\tCTRL-w =    Resize all window to equal sizes\n    \n# Changeset, last edit jumping back and forth\n\t`.      jump to the last edit\n\tg;      go to previous edit\n\tg,      go to next edit\n\tCTRL-o  go to previous edit\n\tCTRL-i  go to next edit\n\t''      jump to last location (no-edits)\n\t``      jump to last location (no-edits)\n\n# Fuzzy searching files with CTRL.P plugin\n    CTRL-p    Open up search user interface\n              you can then start typing what you are looking for\n    CTRL-f    By default your search text is match against files,\n              pressing CTRL-f will switch to match for content of the files, buffers,\n              directories, etc.\n    CTRL-b    same as CTRL-f but cycle on opposite direction\n\n    CTRL-j    Move down 1 line of the search results\n    CTRL-k    Move up 1 line on the search results\n    <Enter>   Open the file of the focused line in the search result\n    CTRL-t    Open the focused file of the line in the search result in a new tab\n    CTRL-v    Open the focused file of the line in the search result in a vertical split\n    CTRL-x    Open the focused file of the line in the search result in a horizontal split\n    CTRL-z    Mark select the focused file of the line in the search result\n    CTRL-o    Opens all the mark selected files in the search results\n\n\n"
  }
]