summaryrefslogtreecommitdiff
path: root/_posts/2012-05-18-using-vim.md
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2012-05-18 10:03:05 +0200
committerAndreas Maunz <andreas@maunz.de>2012-05-18 10:03:05 +0200
commit706eea1286a92954b296f4c674333878966aa3e4 (patch)
treeaafabf29e99e2ed9cc2b17fcf9a34350465f338e /_posts/2012-05-18-using-vim.md
parent3920cb52864e8811c8ef94c9c66b3fc9a7916304 (diff)
Beautyfied
Diffstat (limited to '_posts/2012-05-18-using-vim.md')
-rw-r--r--_posts/2012-05-18-using-vim.md53
1 files changed, 25 insertions, 28 deletions
diff --git a/_posts/2012-05-18-using-vim.md b/_posts/2012-05-18-using-vim.md
index fcacafc..8125d89 100644
--- a/_posts/2012-05-18-using-vim.md
+++ b/_posts/2012-05-18-using-vim.md
@@ -8,7 +8,7 @@ tags: [vim, latex]
{% include JB/setup %}
-Installing vim
+Installing **Vim**
==============
sudo apt-get install vim
@@ -21,7 +21,7 @@ and do
source ~/.bashrc
-Now you can start the editor by entering `vim` at the command line.
+Now **Vim** will be invoked as the default text editor and you can start it by entering `vim` at the command line.
@@ -73,7 +73,7 @@ Your user experience should now be much better.
-Using vim
+Using **Vim**
=========
Graphical Cheat Sheet
@@ -82,17 +82,17 @@ Graphical Cheat Sheet
![Vim Cheat Sheet](/images/vi-vim-cheat-sheet.gif)
-Learn vim with the [graphical cheat sheet](http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html).
+Learn **Vim** with the [graphical cheat sheet](http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html).
Toggle auto-indenting for code paste
------------------------------------
-In a console or terminal version of Vim, there is no standard procedure
+In a console or terminal version of **Vim**, there is no standard procedure
to paste text from another application. Instead, the terminal may
-emulate pasting by inserting text into the keyboard buffer, so Vim
-thinks the text has been typed by the user. After each line ending, Vim
+emulate pasting by inserting text into the keyboard buffer, so **Vim**
+thinks the text has been typed by the user. After each line ending, **Vim**
may move the cursor so the next line starts with the same indent as the
last. However, that will change the indentation already in the pasted
text.
@@ -111,22 +111,19 @@ displaying whether `'paste'`{.western} is turned on in insert mode.
To paste from another application:
-- Start insert mode.
-
-- Press F2 (toggles the `paste` option on).
-
-- Use your terminal to paste text from the clipboard.
-
-- Press F2 (toggles the `paste` option off).
+1. Start insert mode.
+2. Press F2 (toggles the `paste` option on).
+3. Use your terminal to paste text from the clipboard.
+4. Press F2 (toggles the `paste` option off).
Then the existing indentation of the pasted text will be retained.
-Using vim with Latex
+Using **Vim** with Latex
====================
-LaTeX is a system for setting characters ('types'). Actually, it is a wrapper of macros around TeX, which has a famous [history](http://www.tug.org/whatis.html). LaTeX is most widely used In technical writing, especially mathematics, physics, and computer science, because it can typeset beautiful mathematical formulae.
+LaTeX is a system for setting characters ('types'). Actually, it is a wrapper of macros around TeX, [created by Donald Knuth](http://www.tug.org/whatis.html). LaTeX is most widely used In technical writing, especially mathematics, physics, and computer science, because it can typeset mathematical formulae beautifully.
@@ -142,7 +139,7 @@ Install LaTeX:
texlive-lang-german \
texlive-science
-Install vim, the Gnome version:
+Install **Vim**, the Gnome version:
sudo apt-get install \
vim-gnome \
@@ -173,7 +170,7 @@ Create file `~/.vim/ftplugin/tex.vim` and insert
Add this to your `~/.vimrc`:
- " REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
+ " REQUIRED. This makes **Vim** invoke Latex-Suite when you open a tex file.
filetype plugin on
" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
@@ -192,21 +189,22 @@ Add this to your `~/.vimrc`:
autocmd FileType tex setlocal spell spelllang=en_us
-Now you can edit and compile `.tex` files from within gvim. Load a [template document](https://www.dropbox.com/sh/lppr2bhmrm0wpfc/KEokhp0usL) from my Dropbox.
+Now you can edit and compile `.tex` files from within **GVim**. Load a [template document](https://www.dropbox.com/sh/lppr2bhmrm0wpfc/KEokhp0usL) from Dropbox.
gvim technical_report.tex
-In vim, press `\ll` to compile to dvi format. Start xdvi (the dvi viewer) to view results. Change something, compile again and reload (`Ctrl+R`) the viewer.
+In **Vim**, press `\ll` to compile to dvi format. Start xdvi (the dvi viewer) to view results. Change something, compile again and reload (`Ctrl+R`) the viewer.
-Gvim can interact with xdvi
+**GVim** can interact with xdvi
--------------------------
-Goal: If one clicks at some place in xdvi (usually Ctrl+Button1), vim automatically jumps to the corresponding line in the LaTeX source file ("reverse search"). Also, from inside Vim, one can jump to the corresponding line in xdvi which becomes highlighted ("forward search").
+If one clicks at some place in xdvi (usually Ctrl+Button1), **Vim** automatically jumps to the corresponding line in the LaTeX source file ("reverse search").
+Also, from inside **Vim**, one can jump to the corresponding line in xdvi which becomes highlighted ("forward search").
-Note: This shows only the process for Gvim, the graphical vim version. It works analogous for the terminal Vim.
+Note: This shows only the process for **GVim**, the graphical **Vim** version. It works analogous for the terminal **Vim**.
-First of all, the latex document need to tell the latex compiler to set marks in the dvi file. Only put:
+First of all, the LaTeX document need to tell the LaTeX compiler to set marks in the dvi file. Only put:
\usepackage{srcltx}
@@ -227,10 +225,10 @@ And in your `.bashrc`:
alias gvim='gvim --servername vimtex'
-Press `\ld` in Gvim in normal mode to start xdvi with forward search.
+Press `\ld` in **GVim** in normal mode to start xdvi with forward search.
For things to work you must, in order:
-1. Open the tex file with gvim (after `source`-ing your changed `~/.bashrc`),
+1. Open the tex file with **GVim** (after `source`-ing your changed `~/.bashrc`),
2. Open the dvi file with the command `\ld`
3. reverse-search using Ctrl + left-mouse-click.
@@ -238,7 +236,7 @@ Enjoy!
-Using Vim with Git
+Using **Vim** with Git
==================
@@ -267,7 +265,6 @@ Step 2: create a file named `git_diff_wrapper` (and put it somewhere in your `$P
Step 3: there is still access to the default `git diff` behavior with the `--no-ext-diff` flag. Here’s a function I put in my bash configuration files:
-
function git_diff() {
git diff --no-ext-diff -w "$@" | vim -R -
}