/kb

personal knowledgebase

Archive for the ‘Editors’ Category

Compile Vim in Snow Leopard

without comments

./configure –enable-pythoninterp –with-macsdk=10.6

via Chris Moyer: OSX, Vim, and Python.

Written by hgrimelid

April 28th, 2010 at 11:01 am

Posted in Editors,Programming,Shell

Tagged with ,

Remove Windows line endings in VIM

with 5 comments

The Windows line endings (^M) can be easily removed with most editors. In ViM it is very easy.

To remove all windows line endings (and replace with nothing), type the following:

:%s/^V^M//g

(note that the ^V will not display).

Sometimes it is necessary to add a line break as well:

:%s/^V^M/\r/g

Partly based on a Tech Recipes article.

Written by Håvard Grimelid

November 17th, 2008 at 11:14 am

Posted in Editors

Tagged with , , , ,

Pasting text in terminal VIM

without comments

Pasting code into a VIM running in terminal has never worked properly for me. It occured to me that Google might have some information on the topic. It turned out to be ridiculously easy:

:set nopaste

Paste your code, and then:

:set paste

Ref.: vim.org.

Written by Håvard Grimelid

July 16th, 2008 at 5:42 pm

Posted in Editors

Tagged with

Some useful Vim-commands

without comments

There are numerous pages and blog posts about Vi and Vim out there so here’s my small contribution. Here are some less frequently used commands that tends to be useful from time to time:

Delete lines patching pattern
:g/pattern/d
Go to position previously modified
g;
Go to next modified position in change list
g,
Create bookmark in file
mLETTER
Go to bookmark
'LETTER
Change highlighted text to upper case
gU
Open file under cursor
gf
Coopy text mathich pattern to register a
:/pattern/yank A
Paste text from register a
"ap
Reduce split window size
C-w -
Increase split window size
C-w +
Make split windows equally big
C-w =

Written by Håvard Grimelid

May 14th, 2008 at 12:36 pm

Posted in Editors

Tagged with , , ,

Pydev in Eclipse on Mac

with one comment

You will be asked to specify the where Python interpreter is located:

Please configure a Python or Jython interpreter in Window -> Preferences -> PyDev
before creating a new Pydev project

  • Press Apple key and , (Preferences) and browse to the Python Interpreters submenu
  • Choose New in the upper right and browse to /usr/bin/python
  • Eclipse will then take care of the rest for you – ie. updating the $PYTHONPATH

NOTE: I use Eclipse 3.3.2 on Mac OS 10.5.2.

Reference: On Using Pydev on a Mac.

Written by Håvard Grimelid

April 23rd, 2008 at 11:23 am

Posted in Editors

Tagged with , , ,