Created
April 22, 2011 20:49
-
-
Save andoriyu/937593 to your computer and use it in GitHub Desktop.
This file contains 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
" ----------------------------------------------------------------------------- | |
" | VIM Settings | | |
" | (see gvimrc for gui vim settings) | | |
" | | | |
" | Some highlights: | | |
" | jj = <esc> Very useful for keeping your hands on the home row | | |
" | ,n = toggle NERDTree off and on | | |
" | | | |
" | ,f = fuzzy find all files | | |
" | ,b = fuzzy find in all buffers | | |
" | ,p = go to previous file | | |
" | ` | | |
" | hh = inserts '=>' | | |
" | aa = inserts '@' | | |
" | | |
" | ,h = new horizontal window | | |
" | ,v = new vertical window | | |
" | | | |
" | ,i = toggle invisibles | | |
" | | | |
" | enter and shift-enter = adds a new line after/before the current line | | |
" | | | |
" | :call Tabstyle_tabs = set tab to real tabs | | |
" | :call Tabstyle_spaces = set tab to 2 spaces | | |
" | | | |
" | Put machine/user specific settings in ~/.vimrc.local | | |
" ----------------------------------------------------------------------------- | |
filetype off | |
set rtp+=~/.vim/vundle.git/ | |
call vundle#rc() | |
Bundle 'tpope/vim-git' | |
Bundle 'tpope/vim-haml.git' | |
Bundle 'tpope/vim-markdown.git' | |
Bundle 'kchmck/vim-coffee-script.git' | |
Bundle 'vim-scripts/RubySinatra.git' | |
Bundle "http://github.com/mattn/gist-vim.git" | |
Bundle "http://github.com/mattn/gist-vim.git" | |
Bundle 'F9' | |
Bundle 'FuzzyFinder' | |
Bundle 'jQuery' | |
filetype plugin indent on | |
set nocompatible | |
let mapleader = "," | |
imap jj <Esc> " Professor VIM says '87% of users prefer jj over esc', jj abrams disagrees | |
" Tabs ************************************************************************ | |
"set sta " a <Tab> in an indent inserts 'shiftwidth' spaces | |
function! Tabstyle_tabs() | |
" Using 4 column tabs | |
set softtabstop=4 | |
set shiftwidth=4 | |
set tabstop=4 | |
set noexpandtab | |
autocmd User Rails set softtabstop=4 | |
autocmd User Rails set shiftwidth=4 | |
autocmd User Rails set tabstop=4 | |
autocmd User Rails set noexpandtab | |
endfunction | |
function! Tabstyle_spaces() | |
" Use 2 spaces | |
set softtabstop=2 | |
set shiftwidth=2 | |
set tabstop=2 | |
set expandtab | |
endfunction | |
call Tabstyle_spaces() | |
" Indenting ******************************************************************* | |
set ai " Automatically set the indent of a new line (local to buffer) | |
set si " smartindent (local to buffer) | |
" Scrollbars ****************************************************************** | |
set sidescrolloff=2 | |
set numberwidth=4 | |
" Windows ********************************************************************* | |
set equalalways " Multiple windows, when created, are equal in size | |
set splitbelow splitright | |
" Vertical and horizontal split then hop to a new buffer | |
:noremap <Leader>v :vsp^M^W^W<cr> | |
:noremap <Leader>h :split^M^W^W<cr> | |
" Cursor highlights *********************************************************** | |
set cursorline | |
"set cursorcolumn | |
" Searching ******************************************************************* | |
set hlsearch " highlight search | |
set incsearch " Incremental search, search as you type | |
set ignorecase " Ignore case when searching | |
set smartcase " Ignore case when searching lowercase | |
" Colors ********************************************************************** | |
"set t_Co=256 " 256 colors | |
"set background=dark | |
syntax on " syntax highlighting | |
colorscheme molokai | |
let g:molokai_original = 1 | |
"set background=dark | |
"colorscheme solarized | |
" Status Line ***************************************************************** | |
set showcmd | |
set ruler " Show ruler | |
"set ch=2 " Make command line two lines high | |
" match LongLineWarning '\%120v.*' " Error format when a line is longer than 120 | |
" Line Wrapping *************************************************************** | |
set wrap | |
set linebreak " Wrap at word | |
" Directories ***************************************************************** | |
" Setup backup location and enable | |
"set backupdir=~/backup/vim | |
"set backup | |
" Set Swap directory | |
"set directory=~/backup/vim/swap | |
" Sets path to directory buffer was loaded from | |
"autocmd BufEnter * lcd %:p:h | |
" File Stuff ****************************************************************** | |
filetype plugin indent on | |
" To show current filetype use: set filetype | |
"autocmd FileType html :set filetype=xhtml | |
" Insert New Line ************************************************************* | |
map <S-Enter> O<ESC> " awesome, inserts new line without going into insert mode | |
map <Enter> o<ESC> | |
"set fo-=r " do not insert a comment leader after an enter, (no work, fix!!) | |
" Sessions ******************************************************************** | |
" Sets what is saved when you save a session | |
set sessionoptions=blank,buffers,curdir,folds,help,resize,tabpages,winsize | |
" Invisible characters ********************************************************* | |
set listchars=trail:.,tab:>-,eol:$ | |
set nolist | |
:noremap <Leader>i :set list!<CR> " Toggle invisible chars | |
" Mouse *********************************************************************** | |
set mouse=a " Enable the mouse | |
behave xterm | |
set selectmode=mouse | |
" Misc settings *************************************************************** | |
set backspace=indent,eol,start | |
set number " Show line numbers | |
set matchpairs+=<:> | |
set vb t_vb= " Turn off bell, this could be more annoying, but I'm not sure how | |
set nofoldenable " Turn off folding | |
autocmd BufWritePost .vimrc source % "reload vimrc | |
" Navigation ****************************************************************** | |
" Make cursor move by visual lines instead of file lines (when wrapping) | |
map <up> gk | |
map k gk | |
imap <up> <C-o>gk | |
map <down> gj | |
map j gj | |
imap <down> <C-o>gj | |
map E ge | |
map <Leader>p <C-^> " Go to previous file | |
" Ruby stuff ****************************************************************** | |
compiler ruby " Enable compiler support for ruby | |
map <F5> :!ruby %<CR> | |
" Omni Completion ************************************************************* | |
autocmd FileType html :set omnifunc=htmlcomplete#CompleteTags | |
autocmd FileType python set omnifunc=pythoncomplete#Complete | |
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS | |
autocmd FileType css set omnifunc=csscomplete#CompleteCSS | |
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags | |
autocmd FileType php set omnifunc=phpcomplete#CompletePHP | |
autocmd FileType c set omnifunc=ccomplete#Complete | |
" May require ruby compiled in | |
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete | |
" Hard to type ***************************************************************** | |
imap uu _ | |
imap hh => | |
imap aa @ | |
" ----------------------------------------------------------------------------- | |
" | Plug-ins | | |
" ----------------------------------------------------------------------------- | |
" NERDTree ******************************************************************** | |
:noremap <Leader>n :NERDTreeToggle<CR> | |
let NERDTreeHijackNetrw=1 " User instead of Netrw when doing an edit /foobar | |
let NERDTreeMouseMode=1 " Single click for everything | |
" NERD Commenter ************************************************************** | |
let NERDCreateDefaultMappings=0 " I turn this off to make it simple | |
" Toggle commenting on 1 line or all selected lines. Wether to comment or not | |
" is decided based on the first line; if it's not commented then all lines | |
" will be commented | |
:map <Leader>c :call NERDComment(0, "toggle")<CR> | |
" SnippetsEmu ***************************************************************** | |
"imap <unique> <C-j> <Plug>Jumper | |
"let g:snip_start_tag = "_\." | |
"let g:snip_end_tag = "\._" | |
"let g:snip_elem_delim = ":" | |
"let g:snip_set_textmate_cp = '1' " Tab to expand snippets, not automatically. | |
" CommandT ******************************************************** | |
" To compile: | |
" cd ~/cl/etc/vim/ruby/command-t | |
" ruby extconf.rb | |
" make | |
let g:CommandTMatchWindowAtTop = 1 | |
map <Leader>f :CommandT<CR> | |
" fuzzyfinder ******************************************************** | |
" I'm using CommandT for main searching, but it doesn't do buffers, so I'm | |
" using FuzzyFinder for that | |
map <Leader>b :FufBuffer<CR> | |
"let g:fuzzy_ignore = '.o;.obj;.bak;.exe;.pyc;.pyo;.DS_Store;.db' | |
" autocomplpop *************************************************************** | |
" complete option | |
"set complete=.,w,b,u,t,k | |
"let g:AutoComplPop_CompleteOption = '.,w,b,u,t,k' | |
"set complete=. | |
let g:AutoComplPop_IgnoreCaseOption = 0 | |
let g:AutoComplPop_BehaviorKeywordLength = 2 | |
"Вызываем SnippletsEmu(см. дальше в топике) по ctrl-j | |
"let g:snippetsEmu_key = "<C-j>" | |
" railsvim *************************************************************** | |
map <Leader>ra :AS<CR> | |
map <Leader>rs :RS<CR> | |
" ----------------------------------------------------------------------------- | |
" | OS Specific | | |
" | (GUI stuff goes in gvimrc) | | |
" ----------------------------------------------------------------------------- | |
" Mac ************************************************************************* | |
"if has("mac") | |
"" | |
"endif | |
" Windows ********************************************************************* | |
"if has("gui_win32") | |
"" | |
"endif | |
" ----------------------------------------------------------------------------- | |
" | Startup | | |
" ----------------------------------------------------------------------------- | |
" Open NERDTree on start | |
"autocmd VimEnter * exe 'NERDTree' | wincmd l | |
" ----------------------------------------------------------------------------- | |
" | Host specific | | |
" ----------------------------------------------------------------------------- | |
if filereadable(expand("~/.vimrc.local")) | |
source ~/.vimrc.local | |
endif | |
"if hostname() == "foo" | |
" do something | |
"endif | |
" Example .vimrc.local: | |
"call Tabstyle_tabs() | |
"colorscheme ir_dark | |
"match LongLineWarning '\%120v.*' | |
"autocmd User ~/git/some_folder/* call Tabstyle_spaces() | let g:force_xhtml=1 |
Хех, ошибка в имени: L9 not F9 )
О, не заметил.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Что-то не пофиксилось:
Andrey-Cherkashins-MacBook-Pro:.vim andoriyu$ vim ~/.vimrc
Cloning into /Users/andoriyu/.vim/bundle/FuzzyFinder...
remote: Counting objects: 493, done.
remote: Compressing objects: 100% (219/219), done.
remote: Total 493 (delta 224), reused 491 (delta 223)
Receiving objects: 100% (493/493), 254.89 KiB | 66 KiB/s, done.
Resolving deltas: 100% (224/224), done.
Cloning into /Users/andoriyu/.vim/bundle/jQuery...
remote: Counting objects: 26, done.
remote: Compressing objects: 100% (21/21), done.
remote: Total 26 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (26/26), done.
Press ENTER or type command to continueCloning into /Users/andoriyu/.vim/bundle/F9...
Username:
Password:
fatal: Authentication failed