Contents of the README
- Using these vim files
- Installing vim itself
- Learning vim
- Using vim with Octave
- My dotvim
- Compiling Vim/Installing extra dependencies/IPython/etc
- Latest version
These are my dotvim files. I separated them out from my dotfiles because I wanted to be able to offer them individually (and, more specifically, to share them with my Machine Learning class on Coursera :) ). Octave is baked right in. It defaults to using Matlab for syntax highlighting, but you can look below for instructions on how to set the default to Octave. If you need help or want to get in touch with me, you can email me.
Get a working set of files by entering the following on a command line.
git clone https://github.com/jtratner/dotfiles.git dotvim cd dotvim ./install.sh
(note: install.sh will back up your files and update submodules automatically)
If you are using Windows, you can use the vim files by copying into your home
$HOME is your directory, where you have folders for My
Documents, etc). You can get my either via git clone or by downloading them as
a zip file on github.
vimrc.symlinkshould be copied to
$HOME/_vimrc(note the '_' !)
vim.symlinkshould be copied to
You can get patched fonts to use with Powerline online, for example, you can get them in the fonts folder of my dotfiles
You can download a binary from the vim website. (Grab the self-installing executable and make things easy).
Install MacVim, works (and integrates) very well.
vim-gnome is pretty good:
``sudo apt-get install vim-gnome``
You could install a Debian gui-version; however, it might mean installing a whole bunch of other dependencies, I'd compile it from source (not super hard)! Email me and I can send you an install script.
Check out my dotfiles for more.
The basics: you open your file, type
i to start editing, and then
<Esc> to type commands, followed by
i again to go back to editing.
Vim does take some time to learn, but once you do, you will be way more
|Command||What it does|
||lets you edit the file (starts "insert mode") -- Use <Esc> to exit insert mode and be able to type the other commands|
||exits insert mode|
||undos the last change|
||puts you in command line mode (so you can do commands|
||save your file|
||save current buffer and quit|
||with a motion (
||pastes yanked text|
||deletes and yanks current line|
||deletes a single character|
||move around the page (see main
||lets you select text (use
For more on Vim, I suggest you check out this Vim cheat sheet and/or
:help vimtutor for more).
There are a few things you might like to do with Octave files.
Vim defaults to
matlab filetype for
.m files, which is fine, but
doesn't highlight everything correctly. Instead, you can set Octave syntax
highlighting for the current file with:
If you want to set this permanently, add this to your
autocmd BufNewFile, BufRead *.m setlocal ft=octave
To add a
; to the end of every line that doesn't have one, you can
highlight the lines you want with
: and then use this substitution:
" the '<'>' part will already be there :'<,'>s/\([^;]\)\_$/\1;/
To comment out a set of lines, again highlight them with
use this simple subsituttion:
And to uncomment:
You can find any particular line of text by typing
/ in "command mode"
(that's the default mode, press
<Esc> while typing to get to it). For
Will highlight all instances of apple in the document. (you can type
,<space> to turn off the highlighting (the actual comma
vimrc.symlink file is pretty well documented. I've laid out a few
things below. (again, my dotfiles have quite a bit more)
Check out my dotfiles for some highlights on the included plugins. But a few that might be helpful.
- Gundo - lets you scroll through your undo history with
- Powerline - sets the fancy status bar at the bottom of the screen. Try installing a patched font and using the fancy encoding for additional awesomeness.
- Ctrl-P - type
<Ctrl-P>to pop up a list of files in the current directory (and be able to open them). You can also use
<Ctrl-Down>to view recently used files and currently opened buffers.
|<leader> en||'edit normal'||tw=78; fo+=t, colorcolumn+=0|
|<leader> ec||'edit comment'||tw=72; fo+=t, colorcolumn+=0|
|<leader> ed||'edit done'||restore defaults (or tw=80,fo-=t, colorcolumn=0)|
|<leader> p||'paste'||paste from clipboard|
|<leader> y||'yank'||yank to clipboard|
|Q||'quick form'?||format the current paragraph (e.g. wrap lines)|
|:DiffSaved||Show diffs between current file and saved file|
<arg>is a character or number. (title creates an under and overline)
some vim text ":Un - some vim text -------------
I've tried to document dependencies below, but a quick list here for reference. NONE of these are necessary to use my dotfiles, they just enable additional features.
|Syntastic||Requires 'compilers' for whatever files you want to check (for example, to check
|Ack||Requires an installation of
Go look at my dotfiles for a detailed guide. I wanted to leave this README quick and simple.
I tweak this version a bit and I update it less frequently -- you can find the bleeding edge version at my dotfiles.