diff options
author | Matias Linares <matiaslina@openmailbox.org> | 2015-10-23 03:14:36 -0300 |
---|---|---|
committer | Matias Linares <matiaslina@openmailbox.org> | 2015-10-23 03:14:36 -0300 |
commit | 5b132bf1244a008ad3ce67688030a7678831f77d (patch) | |
tree | 501aa27e89f81d5f4bdfaab31c72378991a9c749 /vimrc | |
download | dotfiles-5b132bf1244a008ad3ce67688030a7678831f77d.tar.gz |
Initial commit
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 117 |
1 files changed, 117 insertions, 0 deletions
@@ -0,0 +1,117 @@ +filetype plugin indent on +syntax on + +set runtimepath+=/usr/share/vim/vimfiles/ + +call pathogen#infect() + +" Color +"let g:hybrid_use_Xresources = 1 + +if has("gui_running") + set guioptions=c + colo gruvbox + set bg=dark + set guifont=Envy\ Code\ R\ 9 +else + set bg=light +endif + +" Settings +set noerrorbells +set novisualbell + +set showcmd +set autoread + +set nobackup +set nowb +set noswapfile +set wrap +set scrolloff=3 +set autochdir + +if expand("%:p") =~ '\.*blender\.*' + set tabstop=4 + set shiftwidth=4 + set smarttab + set autoindent + set smartindent + set ci + set cin + set ofu=syntaxcomplete#Complete + set showmatch + set incsearch +else + set expandtab + set smarttab + set sw=4 + set ts=4 + set sts=4 + set ai + set si +endif + +let NERDTreeIgnore=['.pyc$'] + +" Filetyp dependent + +au BufRead /tmp/mutt-* set tw=80 +au BufRead,BufNewFile *.md set tw=80 ft=markdown +au Bufread,BufNewFile *.go set ft=go + +au Bufread,BufNewFile *.oz set ft=oz + +au Bufread,BufNewFile *.rb set sw=2 ts=2 sts=2 + +au BufRead,BufNewFile *.html call HtmlDjangoSettings() + +function! HtmlDjangoSettings() + if (&ft=='htmldjango') + inoremap <Leader>t {% %}<Esc>hhi + inoremap <Leader>s {{ }}<Esc>hhi + endif +endfunction + +" Some functions +set colorcolumn=0 +function! Toggle_colorcolumn() + if &colorcolumn == 0 + set colorcolumn=80 + else + set colorcolumn=0 + endif +endfunction + + +""""" Mappings """""" +" Setting nop to the arrows keys +nmap <F1> <Esc> +map <up> <nop> +map <down> <nop> +map <right> <nop> +map <left> <nop> +imap <up> <nop> +imap <down> <nop> +imap <right> <nop> +imap <left> <nop> + +nnoremap <F2> :NERDTreeToggle<cr> +nmap <F3> :TagbarToggle<cr> + +map <c-h> <c-w>h +map <c-j> <c-w>j +map <c-k> <c-w>k +map <c-l> <c-w>l + +" Yank behaves really good +map Y y$ + +" Nice for wrapped lines +nnoremap j gj +nnoremap k gk +inoremap jk <Esc> + +nnoremap <Leader>p :call Toggle_colorcolumn() <cr> +" Diff +nnoremap <F4> :diffg 3 <cr> |