Dotfiles/dotfiles/vimrc

166 lines
7.1 KiB
VimL
Raw Normal View History

2016-05-22 07:53:37 +00:00
" --------------------------------------------------------------------------------
" important
" --------------------------------------------------------------------------------
call pathogen#infect()
set nocompatible
set runtimepath^=~/.vim/bundle/ctrlp.vim
" --------------------------------------------------------------------------------
" not sorted
" --------------------------------------------------------------------------------
let g:airline#extensions#branch#enabled=1
set t_Co=256
set fileencoding=utf-8
set encoding=utf-8
set title
set autoread
set matchpairs+=<:>
set ruler
set showcmd
set cursorline
let g:pdv_template_dir = $HOME ."/.vim/bundle/pdv/templates_snip"
let g:indent_guides_auto_colors = 1
"autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=red ctermbg=3
"autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=green ctermbg=4
" --------------------------------------------------------------------------------
" moving around, searching and patterns
" --------------------------------------------------------------------------------
set showmatch
set incsearch
set hlsearch
" --------------------------------------------------------------------------------
" tags
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" displaying text
" --------------------------------------------------------------------------------
set linebreak
" --------------------------------------------------------------------------------
" highlighting and spelling
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" multiple windows
" --------------------------------------------------------------------------------
set laststatus=2
" --------------------------------------------------------------------------------
" multiple tab pages
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" terminal
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" using the mouse
" --------------------------------------------------------------------------------
set mouse=a
" --------------------------------------------------------------------------------
" printing
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" messages and info
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" selecting text
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" editing text
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" tabs and indenting
" --------------------------------------------------------------------------------
set tabstop=4
set shiftwidth=4
set expandtab
set autoindent
filetype plugin indent on
" --------------------------------------------------------------------------------
" folding
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" diff mode
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" mapping
" --------------------------------------------------------------------------------
inoremap EE <esc>$a
inoremap ;; <esc>$a;
inoremap jj <esc>:w<cr>
nnoremap <Leader>p :set paste<CR>o<esc>"*]p:set nopaste<cr>"
nmap <silent> <Leader>o :NERDTreeToggle<CR>
nmap <silent> <Leader>s ]sz=
nmap <Leader>r :BLReloadPage<cr>
nnoremap <silent> <Right> :vertical resize +5<cr>
noremap <silent> <Left> :vertical resize -5<cr>
nnoremap <silent> <Up> :resize +5<cr>
nnoremap <silent> <Down> :resize -5<cr>
nnoremap <leader>d :call pdv#DocumentWithSnip()<cr>
nnoremap <leader>t :! vendor/bin/phpunit<cr>
nnoremap <leader>tf :! vendor/bin/phpunit %<cr>
" --------------------------------------------------------------------------------
" reading and writing files
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" the swap file
" --------------------------------------------------------------------------------
set noswapfile
" --------------------------------------------------------------------------------
" command line editing
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" executing external commands
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" running make and jumping to errors
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" language specific
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" multi-byte characters
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" variousexecute
" --------------------------------------------------------------------------------
" --------------------------------------------------------------------------------
" functions
" --------------------------------------------------------------------------------
set rnu
function! ToggleNumbersOn()
set nu!
set rnu
endfunction
function! ToggleRelativeOn()
set rnu!
set nu
endfunction
autocmd FocusLost * call ToggleRelativeOn()
autocmd FocusGained * call ToggleRelativeOn()
autocmd InsertEnter * call ToggleRelativeOn()
autocmd InsertLeave * call ToggleRelativeOn()
let g:vimwiki_list = [{
\ 'path': '$HOME/ownCloud/vimwiki/',
\ 'template_path': '$HOME/ownCloud/vimwiki/templates',
\ 'template_default': 'default',
\ 'template_ext': '.html',
\ 'auto_toc': 1}]
au BufRead,BufNewFile *.wiki set filetype=vimwiki
function! ToggleCalendar()
execute ":Calendar"
if exists("g:calendar_open")
if g:calendar_open == 1
execute "q"
unlet g:calendar_open
else
g:calendar_open = 1
end
else
let g:calendar_open = 1
end
endfunction
autocmd FileType calendar nmap <buffer> <CR> :<C-u>call vimwiki#diary#calendar_action(b:calendar.day().get_day(), b:calendar.day().get_month(), b:calendar.day().get_year(), b:calendar.day().week(), "V")<CR>