.dotfiles/vimrc

96 lines
2.4 KiB
VimL
Raw Normal View History

set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
2014-06-26 22:15:45 +00:00
runtime! autoload/vundle.vim
if exists("*vundle#begin")
2014-06-26 22:12:28 +00:00
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
2014-06-26 22:12:28 +00:00
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
2014-06-26 22:12:28 +00:00
"Other plugins
Plugin 'wting/rust.vim'
2014-06-26 22:12:28 +00:00
Plugin 'tomtom/tlib_vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
Plugin 'alfredodeza/coveragepy.vim'
2015-06-21 20:23:57 +00:00
Plugin 'tikhomirov/vim-glsl'
2016-03-28 20:38:21 +00:00
Plugin 'chrisbra/vim-show-whitespace'
Plugin 'krisajenkins/vim-projectlocal'
2016-05-09 21:49:32 +00:00
Plugin 'xolox/vim-misc'
Plugin 'rhysd/vim-clang-format'
2014-06-26 22:12:28 +00:00
" All of your Plugins must be added before the following line
call vundle#end() " required
endif
"Split view if multiple files are opened
if argc() == 2
autocmd VimEnter * nested silent vertical all
"silent vertical all
endif
set background=dark
set autoindent
set number
set tabstop=4
set softtabstop=4
set shiftwidth=4
set incsearch
set hlsearch
set expandtab
set foldmethod=indent
set nofoldenable
set foldlevel=99
set autowrite
set cmdheight=2
2014-07-27 16:47:21 +00:00
set scrolloff=7
set wildmode=longest,list,full
set wildmenu
set wildignorecase
2014-04-03 22:35:28 +00:00
set ignorecase
2014-04-03 21:40:54 +00:00
set smartcase
set ruler
syntax on
filetype plugin indent on
2015-03-05 07:31:29 +00:00
imap jk <Esc>
2015-03-12 11:24:08 +00:00
map <F2> :set nonumber!<CR>
2015-03-12 11:24:22 +00:00
set pastetoggle=<F3>
"Change working dir to current dir
":cd %:p:h
"execute Makefile
:map <F9> :! ~/.vim/custom_make.sh<cr>
:imap <F9> <Esc><F9>
2014-01-24 11:56:52 +00:00
"Map <F8> on python files
2015-06-22 21:05:32 +00:00
au FileType python :map <F8> i <F8>
au FileType python :imap <F8> import pdb; pdb.set_trace()<ESC>
"Map <F10> on python files
2014-01-24 11:56:52 +00:00
au FileType python :map <F10> :Coveragepy show<cr>
au FileType python :imap <F10> <Esc><F10>
2014-02-02 18:14:25 +00:00
"Map <F9> on Latex files
2017-04-20 21:44:36 +00:00
au FileType tex :map <F9> :! if [ -f Makefile ]; then; make; else; latexmk -auxdir=build -outdir=build -pdf %:t; cp build/%:r.pdf .; fi<cr>
"Highlight chars after column 80
let s:activatedh=0
highlight OverLength ctermbg=darkred guibg=#ffd9d9
function! ToggleH()
if s:activatedh == 0
let s:activatedh = 1
match OverLength '\%>80v.\+'
else
let s:activatedh = 0
match none
endif
endfunction
nnoremap <F4> :call ToggleH()<CR>
call ToggleH()
2016-05-09 21:49:32 +00:00
"Map ctrl+f to ClangFormat
:nnoremap <C-f> :ClangFormat<CR>
:vnoremap <C-f> :ClangFormat<CR>