Created
September 21, 2010 10:03
-
-
Save eikes/589495 to your computer and use it in GitHub Desktop.
.vimrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " disable vi compatibility mode | |
set nowrap " don't wrap lines | |
set tabstop=2 | |
set shiftwidth=2 | |
set softtabstop=2 | |
set expandtab | |
set showmode | |
set list | |
set listchars=tab:▸\ ,eol:¬ | |
syntax on | |
let mapleader = "," | |
" Remember, the <leader> is , so type ,l to hide or show invisible chars | |
nmap <leader>l :set list!<CR> | |
" use Strg+S to save | |
map <C-S> :w<CR> | |
imap <C-S> <esc><C-S> | |
set encoding=utf-8 | |
set backspace=indent,eol,start | |
set autoindent " always set autoindenting on | |
set copyindent " copy the previous indentation on autoindenting | |
set number " always show line numbers | |
set shiftwidth=2 " number of spaces to use for autoindenting | |
set shiftround " use multiple of shiftwidth when indenting with '<' and '>' | |
set showmatch " set show matching parenthesis | |
set ignorecase " ignore case when searching | |
set smartcase " ignore case if search pattern is all lowercase, | |
" case-sensitive otherwise | |
set smarttab " insert tabs on the start of a line according to | |
" shiftwidth, not tabstop | |
set title " change the terminal's title | |
set visualbell " don't beep | |
set noerrorbells " don't beep | |
set nobackup | |
set noswapfile | |
set hlsearch | |
colorscheme delek | |
filetype on | |
filetype plugin on | |
filetype indent on | |
autocmd filetype python set expandtab | |
set mouse=a "press shift to use mouse in terminal mode | |
set ic " Case insensitive search | |
" Folding | |
if has("autocmd") | |
" Drupal *.module and *.install files. | |
augroup module | |
autocmd BufRead,BufNewFile *.module set filetype=php | |
autocmd BufRead,BufNewFile *.install set filetype=php | |
augroup END | |
endif | |
" let php_folding = 1 | |
" Folding stuff | |
"set foldmethod=syntax | |
hi Folded guibg=red guifg=Red cterm=bold ctermbg=DarkGrey ctermfg=lightblue | |
hi FoldColumn guibg=grey78 gui=Bold guifg=DarkBlue | |
set foldcolumn=2 | |
set foldclose= | |
set foldmethod=indent | |
set foldnestmax=3 | |
set foldlevel=1 | |
set fillchars=vert:\|,fold:\ | |
set foldminlines=1 | |
fu! ToggleFold() | |
if foldlevel('.') == 0 | |
normal! l | |
else | |
if foldclosed('.') < 0 | |
. foldclose | |
else | |
. foldopen | |
endif | |
endif | |
echo | |
endf | |
" Map this function to Space key. | |
noremap <space> :call ToggleFold()<CR> | |
"""""""""""""""""""""""""""""" | |
" => JavaScript section | |
""""""""""""""""""""""""""""""" | |
au FileType javascript call JavaScriptFold() | |
au FileType javascript setl fen | |
au FileType javascript setl nocindent | |
au FileType javascript imap <c-t> AJS.log();<esc>hi | |
au FileType javascript imap <c-a> alert();<esc>hi | |
au FileType javascript inoremap <buffer> $r return | |
au FileType javascript inoremap <buffer> $f //--- PH ----------------------------------------------<esc>FP2xi | |
function! JavaScriptFold() | |
setl foldmethod=syntax | |
setl foldlevelstart=1 | |
syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend | |
function! FoldText() | |
return substitute(getline(v:foldstart), '{.*', '{...}', '') | |
endfunction | |
setl foldtext=FoldText() | |
endfunction | |
" http://amix.dk/vim/vimrc.html | |
" http://nvie.com/posts/how-i-boosted-my-vim/ | |
" http://stevelosh.com/blog/2010/09/coming-home-to-vim/ | |
" http://vimcasts.org/ | |
call pathogen#runtime_append_all_bundles() | |
filetype off | |
filetype plugin indent on | |
autocmd VimEnter * NERDTree | |
autocmd BufEnter * NERDTreeMirror |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment