Skip to content

Instantly share code, notes, and snippets.

@kossnocorp
Created December 22, 2009 19:50
Show Gist options
  • Select an option

  • Save kossnocorp/261986 to your computer and use it in GitHub Desktop.

Select an option

Save kossnocorp/261986 to your computer and use it in GitHub Desktop.
"*****************************************************************************"
"
" _______ _____
" || | || |
" \\_ / \\ |
" || | / /
" || | / /
" || | / /
" || | / /
" || | _/ _/
" || |/ |_|
" || / ___ __ ___ ___
" || _/ \\ | \\ \−-_−-_ || _/ // _|
" _ || / || | || /\ /\ | || | || |_
" |_| ||__/ ||_| ||_||_||_|_ ||_| \\__|
"
"
" by Aleksandr Koss (http://nocorp.ru)
"
"*****************************************************************************"
" "
"*****************************************************************************"
"
" Basic settings
"
"*****************************************************************************"
" "
set nocompatible " Turn off vi compatible
syntax on " Turn on syntax highlight
set mouse=a " Mouse everywhere
" "
"*****************************************************************************"
"
" Appearance configurations
"
"*****************************************************************************"
" "
""" Line options
set nu " Turn on line numbers
set cul " Highligth current line
" Highligth in red more then 80 columns
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%81v.*/
""" GUI options
if has("gui_running")
set tb=icons " Only icons in toolbar
set tbis=tiny " Set icon size to tiny
set guioptions-=T " Turn off toolbar
endif
""" Tabulation
" Tab size
set ts=2
set shiftwidth=2 " Make indent equal 2 spaces
set ai " Auto indent to current level
set si " Smart indent
set stal=2 "
set expandtab " No tabs, no war!
"
set et
" No wrap text
set nowrap
"
set hidden " Allow dirty unsaved buffers
""" :
""" Appearance
set gfn=Monospace\ 8 " Font
colorscheme molokai " Color theme
""" Search
set backup " Enable creation of backup file.
set backupdir=~/.vim/backups " Where backups will go.
set directory=~/.vim/tmp " Where temporary files will go.
set history=1000 " Store lots of :cmdline history
set ignorecase " Ignore case when searching
set showcmd " Show incomplete cmds down the bottom
set showmode " Show current mode down the bottom
set incsearch " Find the next match as we type the search
set hlsearch " Hilight searches by default
" Page Up & Page Down behaviour
set nostartofline " Don't jump to fisrt line
nmap <PageUp> <C-U><C-U>
imap <PageUp> <C-O><C-U><C-O><C-U>
nmap <PageDown> <C-D><C-D>
imap <PageDown> <C-O><C-D><C-O><C-D>
"""
" Ctrl+C & Ctrl+V to system buffer
nmap <C-V> "+gP
imap <C-V> <ESC><C-V>i
vmap <C-C> "+y
" "
"*****************************************************************************"
"
" Key maps
"
"*****************************************************************************"
" "
"" Previous - Next buffer
map <C-S-Left> :bprev<CR>
map <C-S-Right> :bnext<CR>
" "
"*****************************************************************************"
"
" Plugin configurations
"
"*****************************************************************************"
" "
""" Fuzzy Finder Textmate
" Ctrl+F map to start search
nnoremap <C-F> :FuzzyFinderTextMate<CR>
""" NERDTree
" Ctrl+D map to toggle NERDTree
nmap <silent> <C-D> :NERDTreeToggle<CR>
imap <silent> <C-D> :NERDTreeToggle<CR>
""" Vim-Ruby
" Autocomplete setup
let g:rubycomplete_buffer_loading = 1
let g:rubycomplete_classes_in_global = 1
let g:rubycomplete_rails = 1
""""
"
" Allow to navigate from start of line to end of previous line
set backspace=indent,eol,start
"
set wildmode=list:longest "make cmdline tab completion similar to bash
" Ctrl+L to clear highlight
nnoremap <C-L> :nohls<CR><C-L>
inoremap <C-L> <C-O>:nohls<CR>
" "
"*****************************************************************************"
"
" Functions
"
"*****************************************************************************"
" "
""" Remove all spaces from end in each line
fun! RemoveSpaces()
if &bin | return | endif
if search('\s\+$', 'n')
let line = line('.')
let col = col('.')
sil %s/\s\+$//ge
call cursor(line, col)
endif
endf
" "
"*****************************************************************************"
"
" Auto commands
"
"*****************************************************************************"
" "
""" Remove all spaces from end of each line
autocmd BufWritePre * call RemoveSpaces()
" "
"*****************************************************************************"
" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "
"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
"*****************************************************************************"
" "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment