Wednesday, 16 December 2009

vim notes 2

Paragraph forward / back: ESC { and ESC }


pasting:

vim --version

Check whether xterm_clipboard has a + or - preceding it. If -, add it by running
a version with it enabled. gvim has it enabled. I installed vim-python, to install
gvim, which then affected my normal vim.

Once enabled,

ESCAPE " + p

pastes from the xterm clipboard.

From http://vim.wikia.com/wiki/Accessing_the_system_clipboard

* "+2yy – copy two lines to X11 clipboard
* "+dd – cut line to X11 clipboard
* "+p – paste X11 clipboard

-----------------


Code folding.

V
select block
ZF

marks the code for folding

-------------------

multiple tabs:

vi -p *.tex

or

:tabnew filename

tab navigate with CTRL pg-up and pg-down

Gavin: tabdo command

executes command on all tabs.
-----------------------

Bookmarking:

m a : set a mark
` a : jump to mark. `a' can be anything.

-------------------

Mapping keys in Vim:

To map to control-V, the paste function whilst in insert mode:

 

:imap pi



or something like that
-----------------

Search / replace (from http://www.linux.com/learn/tutorials/8255-vim-tips-the-basics-of-search-and-replace):

:/string search
:?string backwards search
n next
N previous

:8,10 s/search/replace/g from line 8 to 10, g(lobal = repeats on lines)

Or, use visual select and execute the search. v is visual, V is line visual, CRTL-v is block visual.

:%s/search/replace/g over entire file

----------------------

Vim white spaces on pasting from GUI

Pre paste, do

:set paste

Post paste, do

:set nopaste

to prevent automatic indentation. From http://aymanh.com/a-collection-of-vim-tips

-------------------------

Copy, paste multiple buffers.


" a y to place into register `a'.
" a p to place into register `a'.

So, the `+' is the global buffer....

--------------------------

To pull the results of a command into the editor:

:r ! command

for example

:r ! ls gabvo*

;)
----------------------------

Speech marks when using vim-latex:

Insert mode, CTRL-V, "

CTRL-V indicates literal mode, I think.

http://vim-latex.sourceforge.net/index.php?subject=faq&title=FAQ#faq-not-loaded-vim7

-------------

Saturday, 7 November 2009

skype, in koala

sudo vi /etc/apt/sources.list

add:

http://packages.medibuntu.org/ karmic free non-free

Koala DVD

sudo apt-get install ubuntu-restricted-extras

Tuesday, 3 November 2009

subfig captions are not centered with \abstract

Trial and error showed this to be due to \abstract being
used. Changing to \begin{abstract} text \end{abstract}
cleaned things up immediately.

Monday, 5 October 2009

PAFEC examples. Single PZT element.

TITLE Single 2D PZT element

CONTROL
FRONTAL.SINUSOIDAL.SOLUTION
PLANE.STRAIN
CONTROL.END

PARAMETERS
'E0' = 8.85E-12


NODES
NODE X Y
1 0 0
2 1 0
3 0 1
4 1 1

ELEMENTS
NUMBER GROUP ELEMENT PROP TOPO
1 1 35425 11 1 2 3 4


ORTHOTROPIC
NUMB SXX SYY SZZ SXY SYZ SZX SHXY SHYZ SHZX RO
11 15E-12 15E-12 18E-12 -4.5E-12 -4.6E-12 -4.6E-12 47E-12 47E-12 39E-12 7800

PIEZOELECTRIC
NUMB TYPE EPZZ EPXX EZX EZZ EXXZ
c clamped. See tol_j7.DAT
11 1 <830 * 'E0'> <916 * 'E0'> -5.4 15.8 12.3


MODES.AND.FREQUENCIES
AUTO MODES
0 0

RESPONSE
TYPE
0

FREQUENCIES.FOR.ANALYSIS
TYPE START FINISH NUMBER
3 100 10000 10

FULL.DYNAMICS.OUTPUT
TYPE START FINISH STEP
4 1 100 1

LAMINATES
NUMB ORTH PIEZ AXIS ANG2 LOWER UPPER
11 11 11 1 90 0 1

REPEATED.FREEDOMS
N1 N2 AXIS DIRE
1 2 1 4

RESTRAINTS
NODE PLANE AXIS DIRE
3 2 1 4

SINE.LOADING
NODE DIRE TABLE
1 4 1

MASTERS
NODE DIRE
1 4

TABLES
TABLE BASIS VALUE
1 1 1 0
1 1000 1 0

END.OF.DATA

Friday, 2 October 2009

Vim notes

Column insert.

CTRL-V to enter visual block.
Select insert column region.
I (that's a capital i)
Type text.
esc

Thursday, 17 September 2009

nethogs

sudo nethogs


and

lsof -Pnl +M -i4 | fold -w70

to see ipv4 connections

iftop

is lovely!