Advertisement
Guest User

Untitled

a guest
Jun 25th, 2011
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 7.34 KB | None | 0 0
  1. " Notes {
  2.     " This is comrad Eugene's .vimrc
  3. " }
  4.  
  5. " General {
  6.     set nocompatible " get out of vi-compatible mode
  7.     set t_Co=256 " get all the colorful happyness
  8.  
  9.     set autochdir " always switch to current file directory
  10.     set backspace=indent,eol,start " make backspace flexible
  11.     set backup " make backup files
  12.     set backupdir=~/.vim/backup " make backup files
  13.     set directory=~/.vim/tmp " directory to place swap files in
  14.     set fileformats=unix,dos,mac " support 'em in this order
  15.     set fileencodings=utf-8,cp1251,koi8-r,cp866 " support 'em in this order
  16.     set history=1000 " store lots of :cmdline history
  17.     set mouse=a " use mouse everywhere
  18.     set ttymouse=xterm2 " some stuff to get the mouse going in term
  19. " }
  20.  
  21. " UI {
  22.     syntax on " syntax highlighting on
  23.     set background=light
  24.     colorscheme molokai
  25.  
  26.     set backspace=indent,eol,start " allow backspacing over everything in insert mode
  27.     " set cursorcolumn " highlight the current column
  28.     set cursorline " highlight the current line
  29.     set cpoptions=aABceFsmq
  30.     "             |||||||||
  31.     "             ||||||||+-- When joining lines, leave the cursor
  32.     "             |||||||      between joined lines
  33.     "             |||||||+-- When a new match is created (showmatch)
  34.     "             ||||||      pause for .5
  35.     "             ||||||+-- Set buffer options when entering the
  36.     "             |||||      buffer
  37.     "             |||||+-- :write command updates current file name
  38.     "             ||||+-- Automatically add <CR> to the last line
  39.     "             |||      when using :@r
  40.     "             |||+-- Searching continues at the end of the match
  41.     "             ||      at the cursor position
  42.     "             ||+-- A backslash has no special meaning in mappings
  43.     "             |+-- :write updates alternative file name
  44.     "             +-- :read updates alternative file name
  45.  
  46.     set hidden "hide buffers when not displayed
  47.     set incsearch " highlight matches as you type
  48.     set lazyredraw " do not redraw while running macros
  49.     set matchtime=0 " blink matching brackets for 0s
  50.     set nohlsearch " do not highlight searched for phrases
  51.     set nostartofline " leave my cursor where it was
  52.     set novisualbell " don't blink
  53.     set number " turn on line numbers
  54.     set numberwidth=5 " good up to 99999 lines
  55.     set report=0 " tell us when anything is changed via :...
  56.     set ruler " always show current positions along the bottom
  57.     set scrolloff=10 " Keep 10 lines (top/bottom) for scope
  58.     set shortmess=aOstT " shortens message to avoid 'press key' prompt
  59.     set showcmd " show the command being typed
  60.     set showmatch " show matching brackets
  61.     set sidescrolloff=10 " Keep 5 lines at the size
  62.  
  63.     set wildmenu " turn on command line completion wild style
  64.     set wildignore=*.dll,*.o,*,obj,*.bak,*.exe,*.pyc,*.jpg,*.jpg,*.png
  65.     set wildmode=list:longest " make cmdline tab completion similar to bash
  66. " }
  67.  
  68. " StatusLine {
  69.     set laststatus=2 " always show the status line
  70.     set statusline=%F%m%r%h%w\ [%{&ff}]\ %y%=L:%l/%L\ C:%c%V\ [%p%%]"\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
  71.    "              | | | | |   |         | |   |  |     |     |
  72.     "              | | | | |   |         | |   |  |     |     |
  73.     "              | | | | |   |         | |   |  |     |     +-- current %
  74.     "              | | | | |   |         | |   |  |     +-- current
  75.     "              | | | | |   |         | |   |  |         column
  76.     "              | | | | |   |         | |   |  +- lines number
  77.     "              | | | | |   |         | |   +-- current line
  78.     "              | | | | |   |         | +-- spacer
  79.     "              | | | | |   |         +-- current syntax in
  80.     "              | | | | |   |             square brackets
  81.     "              | | | | |   +-- current fileformat
  82.     "              | | | | +-- preview flag in square brackets
  83.     "              | | | +-- help flag in square brackets
  84.     "              | | +-- readonly flag in square brackets
  85.     "              | +-- rodified flag in square brackets
  86.     "              +-- full path to file in the buffer
  87.     "hi StatusLine ctermfg=black ctermbg=green gui=none
  88.     "au InsertEnter * hi StatusLine term=reverse ctermbg=magenta
  89.     "au InsertLeave * hi StatusLine term=reverse ctermbg=green
  90. " }
  91.  
  92. " Text Formatting/Layout {
  93.     set autoindent
  94.     set completeopt= " dont use a pop up menu for completions
  95.     set expandtab " no real tabs please!
  96.     set hlsearch " hilight searches by default
  97.     set ignorecase " case insensitive by default
  98.     set incsearch " find the next match as we type the search
  99.     set linebreak " wrap lines at convenient points
  100.     set nowrap " do not wrap lines
  101.     set shiftround " when at 3 spaces, and I hit > ... go to 4, not 5
  102.     set smartcase " if there are caps, go case-sensitive
  103.     set shiftwidth=4 " auto-indent amount when using cindent
  104.     set softtabstop=4 " when hitting tab or backspace
  105.     set tabstop=8 " real tabs should be 8, and they will show with set list on
  106.  
  107.     set list " display tabs and trailing spaces
  108.     set listchars=tab:▷⋅,trail:⋅,nbsp:
  109. " }
  110.  
  111. " Folding {
  112.     " i'm using to hate this
  113.     "iset foldmethod=indent   "fold based on indent
  114.     "set foldnestmax=3       "deepest fold is 3 levels
  115.     "set nofoldenable        "dont fold by default
  116. " }
  117.  
  118. " Mappings {
  119.     "noremap <S-space> <C-b>
  120.     "noremap <space> <C-f>
  121.  
  122.     "map ^P :Lodgeit<CR>
  123.     map <C-Q> :q!<CR>
  124.  
  125.     "nnoremap <C-B> :BufExplorer<cr>
  126.  
  127.     " visual search mappings {
  128.         function! s:VSetSearch()
  129.             let temp = @@
  130.             norm! gvy
  131.             let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
  132.            let @@ = temp
  133.        endfunction
  134.        vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR>
  135.        vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR>
  136.    " }
  137. " }
  138.  
  139. " Plugin Settings {
  140.    " NERDTree {
  141.        "function OpenNERDTree()
  142.        "    execute ":NERDTree"
  143.        "endfunction
  144.        "command -nargs=0 OpenNERDTree :call OpenNERDTree()
  145.        "autocmd VimEnter * NERDTree
  146.        "autocmd VimEnter * wincmd p
  147.    " }
  148.  
  149.    " IntelliSense {
  150.        "let g:syntastic_enable_signs=1
  151.    " }
  152. " }
  153.  
  154. " Autocommands {
  155.    " load ftplugins and indent files
  156.    "filetype plugin on
  157.    "filetype indent on
  158.  
  159.    " Настройка omnicomletion для Python (а так же для js, html и css)
  160.    "autocmd FileType python set omnifunc=pythoncomplete#Complete
  161.    "autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
  162.    "autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
  163.    "autocmd FileType css set omnifunc=csscomplete#CompleteCSS
  164.  
  165.    " Python {
  166.        " знерщт standard 4 spaces, always
  167.        au BufRead,BufNewFile *.py set shiftwidth=4
  168.        au BufRead,BufNewFile *.py set softtabstop=4
  169.    " }
  170.  
  171.    " Ruby {
  172.        " ruby standard 2 spaces, always
  173.        au BufRead,BufNewFile *.rb,*.rhtml,*.haml,*.sass set shiftwidth=2
  174.        au BufRead,BufNewFile *.rb,*.rhtml,*.haml,*.sass set softtabstop=2
  175.        compiler ruby
  176.    " }
  177.  
  178.    " Makefile {
  179.        au BufRead,BufNewFile *Makefile set noet " real tabs in Makefile's
  180.     " }
  181.  
  182.     "recalculate the trailing whitespace warning when idle, and after saving
  183.     autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning
  184. " }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement