User talk:Andy: Difference between revisions
From KitwarePublic
Jump to navigationJump to search
(Random Python Tricks) |
|||
Line 10: | Line 10: | ||
=== My VIM Settings === | === My VIM Settings === | ||
<pre> | |||
set nocompatible " We use a vim | |||
set noautoindent | |||
set tabstop=2 " Tabs are two characters | |||
set shiftwidth=2 " Indents are two charactes too | |||
set expandtab " Do not use tabs | |||
syntax on " Turn on syntax hilighting | |||
set hlsearch " Hilight the search results | |||
set incsearch " Incrementally search. Like Emacs | |||
set autochdir " Automatically chdir to directory of the buffer | |||
set matchpairs+=<:> | |||
"set matchpairs+=<:> | |||
set showmatch | |||
set laststatus=2 | |||
set guioptions-=T | |||
set guioptions-=m | |||
set guioptions+=f | |||
"set guifont=Fixed\ 11 | |||
"set guifont=Fixed\ 11 | |||
set viminfo+=n$HOME/.vim/viminfo | |||
"set guifont=-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-* | |||
"set guifont=Andale\ Mono\ 8 | |||
colorscheme darkblue | |||
amenu F&ont.&5x7 :set guifont=5x7<CR><C-L> | |||
amenu F&ont.&6x10 :set guifont=6x10<CR><C-L> | |||
amenu F&ont.6x13 :set guifont=6x13<CR><C-L> | |||
amenu F&ont.&7x13 :set guifont=7x13<CR><C-L> | |||
amenu F&ont.&8x13 :set guifont=8x13<CR><C-L> | |||
amenu F&ont.&9x15 :set guifont=9x15<CR><C-L> | |||
amenu F&ont.&10x20 :set guifont=10x20<CR><C-L> | |||
amenu F&ont.&12x24 :set guifont=12x24<CR><C-L> | |||
amenu F&ont.&heabfix :set guifont=-*-haebfix-medium-r-normal-*-15-*-*-*-*-*-*-*<CR><C-L> | |||
amenu F&ont.&lucida :set guifont=-*-lucidatypewriter-medium-r-*-*-14-*-*-*-*-*-*-*<CR><C-L> | |||
if exists("loaded_vimspell") | |||
set spell_auto_type="tex,mail,text,html,sgml,otl" | |||
:SpellAutoEnable | |||
endif | |||
set wildmode=longest " Make tabcompletion behave correctly | |||
set selection=exclusive " Only select up to not including last character | |||
set ignorecase " Ignore case when searching lowercase | |||
set smartcase " Ignore case when searching lowercase | |||
set cinoptions={1s,:0,l1,g0,c0,(0,(s,m1 | |||
highlight SpellErrors guibg=Red guifg=Black | |||
:autocmd BufRead,BufNewFile [Mm]akefile :set noexpandtab | |||
highlight SpellErrors guibg=Red guifg=Black | |||
</pre> | |||
== Random things that need to be put somewhere == | == Random things that need to be put somewhere == |
Revision as of 22:22, 4 November 2004
VIM is a great editor
Ok, so I use VIM. I used to use Emacs, but I guess the starting time was bothering me. Also, for small sysadmin edits I used VIM already and I was mixing key strokes from Emacs and VIM.
My VIM Settings
set nocompatible " We use a vim set noautoindent set tabstop=2 " Tabs are two characters set shiftwidth=2 " Indents are two charactes too set expandtab " Do not use tabs syntax on " Turn on syntax hilighting set hlsearch " Hilight the search results set incsearch " Incrementally search. Like Emacs set autochdir " Automatically chdir to directory of the buffer set matchpairs+=<:> "set matchpairs+=<:> set showmatch set laststatus=2 set guioptions-=T set guioptions-=m set guioptions+=f "set guifont=Fixed\ 11 "set guifont=Fixed\ 11 set viminfo+=n$HOME/.vim/viminfo "set guifont=-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-* "set guifont=Andale\ Mono\ 8 colorscheme darkblue amenu F&ont.&5x7 :set guifont=5x7<CR><C-L> amenu F&ont.&6x10 :set guifont=6x10<CR><C-L> amenu F&ont.6x13 :set guifont=6x13<CR><C-L> amenu F&ont.&7x13 :set guifont=7x13<CR><C-L> amenu F&ont.&8x13 :set guifont=8x13<CR><C-L> amenu F&ont.&9x15 :set guifont=9x15<CR><C-L> amenu F&ont.&10x20 :set guifont=10x20<CR><C-L> amenu F&ont.&12x24 :set guifont=12x24<CR><C-L> amenu F&ont.&heabfix :set guifont=-*-haebfix-medium-r-normal-*-15-*-*-*-*-*-*-*<CR><C-L> amenu F&ont.&lucida :set guifont=-*-lucidatypewriter-medium-r-*-*-14-*-*-*-*-*-*-*<CR><C-L> if exists("loaded_vimspell") set spell_auto_type="tex,mail,text,html,sgml,otl" :SpellAutoEnable endif set wildmode=longest " Make tabcompletion behave correctly set selection=exclusive " Only select up to not including last character set ignorecase " Ignore case when searching lowercase set smartcase " Ignore case when searching lowercase set cinoptions={1s,:0,l1,g0,c0,(0,(s,m1 highlight SpellErrors guibg=Red guifg=Black :autocmd BufRead,BufNewFile [Mm]akefile :set noexpandtab highlight SpellErrors guibg=Red guifg=Black
Random things that need to be put somewhere
- MITK from CSiro: http://www3.ict.csiro.au/ict/content/display/0%2C%2Ca16254_b16408_d72676,00.html
- Fairly good C++ reference: http://www.cppreference.com/index.html
Random Python Tricks
How do I get a current line number or file name from the scrip?
import inspect f = inspect.currentframe() print "Line number: %d" % f.f_lineno print "File name: %s" % f.f_code.co_filename
Also, you can go up the stack and do the same thing:
lineno = inspect.currentframe().f_back.f_lineno