Please bear with us as we work to restore functionality to dotfiles.org.
"-------------------------
" Pento VIM settings
" Last changes: 25.02.2007
"-------------------------
"-------------------------
" Common settings
"-------------------------
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" Enable loading filetype and indentation plugins
filetype plugin on
filetype indent on
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" keep 50 lines of command line history
set history=50
" show the cursor position all the time
set ruler
" display incomplete commands
set showcmd
" Turn on number vertical line
set nu
" I don't like backups
set nobackup
" Autoclose folds, when moving out of them
"set foldclose=all
" Open all folds
set foldenable
" I like {{{ }}} folds
"set foldmethod=marker
set foldmethod=indent
" Use incremental searching
set incsearch
" Do not highlight search results
set nohlsearch
" Jump 5 lines when running out of the screen
set scrolljump=7
" Indicate jump out of the screen when 10 lines before end of the screen
set scrolloff=7
" write all tmp files to /tmp
set dir=/tmp
" gui font
" set guifont=Misc\ Console\ 10
"set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
" Turn off any bell
set novisualbell
set t_vb=
" Enable mouse
set mouse=a
set mousemodel=popup
" default encoding
set termencoding=utf-8
" do NOT unload buffer when switch to another one
" this allows to edit several files in the same time without having to save
" them each time you switch between them
set hidden
" hide button panel
set guioptions-=T
" Make command line one line high
set ch=1
" Hide the mouse when typing text
set mousehide
" turn on autoindent
set autoindent
" I like highlighting strings inside C comments
"let c_comment_strings=0
" Switch on syntax highlighting if it wasn't on yet.
if !exists("syntax_on")
syntax on
endif
" allow to use backspace instead of "x"
set backspace=indent,eol,start whichwrap+=<,>,[,]
" expand tab to spaces ?
" set expandtab
" default tab size
set shiftwidth=4
set softtabstop=4
set tabstop=4
"set textwidth=80
" status line
set statusline=%<%f%h%m%r\ %b\ %{&encoding}\ 0x\ \ %l,%c%V\ %P
set laststatus=2
" Auto indent after a {
set smartindent
" scan the files given with the 'dictionary' option
"set complete+=k
" Fix for comment
set fo+=cr
" Session options
set sessionoptions=curdir,buffers,tabpages
set foldcolumn=2
"-------------------------
" Bindings
"-------------------------
" Make act as in Visual mode?
vmap x
" Wrap selected text to 80 symbols per line
vmap :'<,'>!fold -w 120 -s
" CTRL-C and CTRL-Insert are Copy
vmap "+yi
imap "+gPi
" Make shift-insert work like in Xterm
map
" use CTRL-F for omni completion
imap
" Search & replace the word under the cursor
nmap ; :%s/\<=expand("")\>/
" map F2 to quick save
nmap :w
vmap :wi
imap :wi
" F3 - list all errors
nmap :copen
vmap :copen
imap :copen
" F3 - list all errors
nmap :cclose
vmap :cclose
imap :cclose
" F4 - Project toogle
map ToggleProject
vmap ToggleProject
imap ToggleProject
" F5 - show buffers
nmap :ls:b
vmap :ls:b
imap :ls:b
" F6 - prev buffer
map :bp
vmap :bpi
imap :bpi
" F7 - newxt buffer
map :bn
vmap :bni
imap :bni
" F8 - Marks
map :marks
vmap :marks
imap :marks
" F9 to make
map :make
vmap :makei
imap :makei
" F10 kill buffer
map :bd
vmap :bd
imap :bd
" F8 - Tlist
map :TlistToggle
vmap :TlistToggle
imap :TlistToggle
" F12 to quick explorer
map :Ex
vmap :Exi
imap :Exi
" < & > to indent blocks
vmap < >gv
" Switch off 'Replace mode'
imap i
" C-T - new tab
map :tabnew
vmap :tabnew
imap :tabnew
" Open tag under cursor in new tab
map ] ]:tab splitgT:qgt
" Encoding menu
set wildmenu
set wcm=
menu Encoding.&koi8-r :e ++enc=koi8-r
menu Encoding.&windows-1251 :e ++enc=cp1251
menu Encoding.&cp866 :e ++enc=cp866
menu Encoding.&utf-8 :e ++enc=utf8
map { {}O
" Tab autocompletion
function InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\"
else
return "\"
endif
endfunction
imap =InsertTabWrapper()
set complete=""
set complete+=.
set complete+=k
set complete+=b
set complete+=t
"set completeopt-=preview
set completeopt+=longest
" my own func to read *.out files and to paste their content to the current
function CopyBack()
let file=expand("%")
let out_file=substitute(file, '\.phpt', ".out", '')
execute "$read ".out_file
endfunction
map ff :call CopyBack()
let g:snippetsEmu_key = ""
"-------------------------
" Colors
"-------------------------
"
colorscheme spec
au BufRead,BufNewFile *.phps set filetype=php
au BufRead,BufNewFile *.thtml set filetype=php
au BufRead,BufNewFile *.c set filetype=c
au BufEnter *.nasl setfiletype nasl
iabbrev cline -----------------------------------------------------------------
iabbrev bcline =================================================================
let g:SessionMgr_AutoManage = 0
let g:SessionMgr_DefaultName = "mysession"
" Tag list settings
let g:Tlist_Show_One_File = 1
let g:Tlist_GainFocus_On_ToggleOpen = 1
set mps-=[:]
" New settings
" y, d, c и т.д. без указания регистра используют иксовый clipboard
set clipboard+=unnamed
" Что б не тянутся к esc в режиме вставки (мне кажется самое удобное)
imap jj
nmap va VCSAdd
nmap vn VCSAnnotate
nmap vc VCSCommit
nmap vd VCSDiff
nmap vg VCSGotoOriginal
nmap vG VCSGotoOriginal!
nmap vl VCSLog
nmap vL VCSLock
nmap vr VCSReview
nmap vs VCSStatus
nmap vu VCSUpdate
nmap vU VCSUnlock
nmap vv VCSVimDiff
function MoveTabLeft()
let current_tab = tabpagenr()
if current_tab > 1
let current_tab = current_tab - 2
execute 'tabmove' current_tab
endif
endfunction
function MoveTabRight()
let current_tab = tabpagenr()
execute 'tabmove' current_tab
endfunction
map tl :call MoveTabLeft()
map tr :call MoveTabRight()
let g:TranslateIt_Bin = "sdcv"
if &term =~ "xterm"
let &t_SI = "\]12;green\x7"
let &t_EI = "\]12;blue\x7"
endif
" For 'view' mode
if &readonly == 1
set nonumber
set nofoldenable
set foldcolumn=10
nmap :qa
nmap
endif