Skip to content

Instantly share code, notes, and snippets.

@CodisRedding
Created January 22, 2015 23:26
Show Gist options
  • Save CodisRedding/23aa357ca2fe02993e18 to your computer and use it in GitHub Desktop.
Save CodisRedding/23aa357ca2fe02993e18 to your computer and use it in GitHub Desktop.
call pathogen#infect()
call pathogen#helptags()
" General stuff
set nocompatible
syntax on
filetype on
filetype plugin on
set ofu=syntaxcomplete#Complete
set ruler
set noerrorbells
set nostartofline
set vb
" User interface
set laststatus=2
set ruler
match ErrorMsg '\%>80v.\+'
" Text Formatting
" don't make it look like there are line breaks where there aren't:
set nowrap
" use indents of 4 spaces, and have them copied down lines:
set expandtab
" set tabstop=4
set shiftwidth=4
set softtabstop=4
set shiftround
" set noexpandtabset autoindent
set autoindent
set nosi
" search and replace stuff
set ignorecase
set smartcase
set hlsearch
highlight Search ctermfg=Black ctermbg=Red cterm=NONE
set encoding=utf-8
set fileencoding=utf-8
set backspace=2
set tw=0
set backupdir=~/.bak
set directory=~/.swp
autocmd FileType python set tabstop=4 shiftwidth=4 softtabstop=4 expandtab
autocmd FileType c set tabstop=3 shiftwidth=3
autocmd FileType cpp set tabstop=3 shiftwidth=3
autocmd FileType sql set tabstop=3 shiftwidth=3 nowrap
autocmd FileType xml set tabstop=4 shiftwidth=4 softtabstop=4 nowrap
autocmd FileType coffee set tabstop=2 shiftwidth=2 softtabstop=2 nowrap expandtab
autocmd FileType js set tabstop=4 shiftwidth=4 softtabstop=4 nowrap expandtab
autocmd FileType html set nowrap
autocmd BufRead,BufNewFile *.txt set tabstop=5 shiftwidth=5 wrap
autocmd FileType html,htmldjango,jinjahtml,eruby,mako let b:closetag_html_style=1
autocmd FileType html,xhtml,xml,htmldjango,jinjahtml,eruby,mako source ~/.vim/bundle/closetag/plugin/closetag.vim
highlight clear SpellBad
highlight SpellBad term=standout ctermfg=1 term=underline cterm=underline
highlight clear SpellCap
highlight SpellCap term=underline cterm=underline
highlight clear SpellRare
highlight SpellRare term=underline cterm=underline
highlight clear SpellLocal
highlight SpellLocal term=underline cterm=underline
""au BufWritePre * set binary noeol
au BufWritePost * set nobinary eol
"au BufEnter *.py,*.cpp,*.c,*.h exec 'match Todo /\%>80v.\+/'
au BufEnter *.cls set syntax=apex tabstop=4 shiftwidth=4 softtabstop=4 nowrap filetype=apex
"au BufEnter *.cls exec 'match Todo /\%>80v.\+/'
au BufEnter *.trigger set syntax=apex tabstop=4 shiftwidth=4 softtabstop=4 nowrap filetype=apex
"au BufEnter *.trigger exec 'match Todo /\%>80v.\+/'
au BufEnter *.page set tabstop=4 shiftwidth=4 softtabstop=4 nowrap
au BufWritePre *.snippet set binary eol
au BufWritePost *.snippet set binary eol
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
command TrailingWhitespace %s/\s\+$//
map <F9> mzgg=G`z<CR>
let g:snippets_dir = '~/.vim/snippets,~/.vim/my_snippets'
nnoremap <F2> :set invpaste paste?<CR>
set pastetoggle=<F2>
set showmode
nnoremap <F3> :set hlsearch!<CR>
nnoremap <F6> :set list!<bar>set list?<cr>
nnoremap <F7> :set foldmethod=indent<cr>
" Airline
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
" Ctrlp
set runtimepath^=~/.vim/bundle/ctrlp
"autocmd StdinReadPre * let s:std_in=1
"autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" autocmd vimenter * NERDTree
"map <C-c> :NERDTreeToggle<CR>
"map <C-l> :tabn<CR>
"map <C-h> :tabp<CR>
"map <C-n> :tabnew<CR>
" netrw
" open split window with the new window on the left
let g:netrw_altv = 1
" gist
let g:gist_post_private = 1
let g:gist_open_browser_after_post = 1
set background=dark
set t_Co=256
color mango
"Don't ask to save when changing buffers (i.e. when jumping to a type definition)
set hidden
" NeoComplete
" Note: This option must set it in .vimrc(_vimrc). NOT IN .gvimrc(_gvimrc)!
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }
" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
" Plugin key-mappings.
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" Recommended key-mappings.
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
function! s:my_cr_function()
return neocomplete#close_popup() . "\<CR>"
" For no inserting <CR> key.
"return pumvisible() ? neocomplete#close_popup() : "\<CR>"
endfunction
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#close_popup()
inoremap <expr><C-e> neocomplete#cancel_popup()
" Close popup by <Space>.
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment