Created
October 10, 2016 15:52
-
-
Save lukassup/5eb257cf477b921420695bbfd47c2531 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: set sw=2 ts=2 sts=2: | |
" | |
if !has('nvim') | |
set nocompatible | |
endif | |
call plug#begin('~/.vim/plugged') | |
Plug 'morhetz/gruvbox' | |
Plug 'tpope/vim-sensible' | |
Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-fugitive' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'Yggdroot/indentLine' | |
Plug 'scrooloose/nerdcommenter' | |
Plug 'michaeljsmith/vim-indent-object' | |
Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} | |
Plug 'scrooloose/syntastic' | |
Plug 'ervandew/supertab' | |
Plug 'tpope/vim-rails', {'for': ['ruby', 'eruby']} | |
Plug 'davidhalter/jedi-vim', {'for': 'python'} | |
Plug 'nvie/vim-flake8', {'for': 'python'} | |
Plug 'rust-lang/rust.vim', {'for': 'rust'} | |
Plug 'ctrlpvim/ctrlp.vim' | |
Plug 'fholgado/minibufexpl.vim' | |
Plug 'leafgarland/typescript-vim' | |
Plug 'honza/dockerfile.vim' | |
Plug 'git://fedorapeople.org/home/fedora/wwoods/public_git/vim-scripts.git' | |
Plug 'vim-latex/vim-latex', {'for': 'latex'} | |
if version >= 704 || has('neovim') | |
" Snippets -- Vim 7.4+ / neovim | |
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' | |
else | |
" Snippets -- Vim < 7.4 | |
Plug 'MarcWeber/vim-addon-mw-utils' | |
Plug 'tomtom/tlib_vim' | |
Plug 'garbas/vim-snipmate' | Plug 'honza/vim-snippets' | |
endif | |
call plug#end() | |
" NERDCommenter | |
" Add spaces after comment delimiters by default | |
let g:NERDSpaceDelims = 1 | |
" Use compact syntax for prettified multi-line comments | |
let g:NERDCompactSexyComs = 1 | |
" Align line-wise comment delimiters flush left instead of following code | |
" indentation | |
let g:NERDDefaultAlign = 'left' | |
" Set a language to use its alternate delimiters by default | |
let g:NERDAltDelims_java = 1 | |
" Add your own custom formats or override the defaults | |
let g:NERDCustomDelimiters = {'c': {'left': '/**','right': '*/'}} | |
" Allow commenting and inverting empty lines (useful when commenting a | |
" region) | |
let g:NERDCommentEmptyLines = 1 | |
" Enable trimming of trailing whitespace when uncommenting | |
let g:NERDTrimTrailingWhitespace = 1 | |
" MiniBufExplorer | |
let g:miniBufExplBRSplit = 0 | |
" IndentLine | |
let g:indentLine_concealcursor = '' | |
let g:indentLine_conceallevel = 0 | |
let g:indentLine_color_tty_light = 7 | |
let g:indentLine_color_dark = 1 | |
let g:UltiSnipsExpandTrigger = '<tab>' | |
let g:UltiSnipsJumpForwardTrigger = '<tab>' | |
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>' | |
let g:UltiSnipsEditSplit = 'vertical' | |
let g:SuperTabMappingForward = '<s-tab>' | |
let g:SuperTabMappingBackward = '<tab>' | |
" Syntastic | |
let g:syntastic_always_populate_loc_list = 1 | |
let g:syntastic_auto_loc_list = 0 | |
let g:syntastic_check_on_open = 1 | |
let g:syntastic_check_on_wq = 0 | |
"let g:syntastic_ruby_checker = ['rubocop'] | |
filetype plugin indent on | |
if !has('nvim') | |
"set autochdir | |
set autoread | |
set fileformats=unix,dos,mac | |
set backspace=indent,eol,start | |
endif | |
set background=dark | |
set lazyredraw | |
set shortmess+=I | |
set showcmd | |
set number | |
set history=256 | |
set wildmenu | |
set wildmode=longest,list,full | |
set wildignore=.svn,CVS,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif | |
set showmatch | |
set matchtime=2 | |
set splitbelow | |
set splitright | |
set hidden | |
set noerrorbells | |
set novisualbell | |
set t_vb= | |
set tm=500 | |
set whichwrap+=<,>,h,l,[,] | |
if &t_Co > 2 || has('gui_running') | |
syntax enable | |
set list | |
set cursorline | |
hi LineNr ctermfg=darkgrey cterm=none term=none | |
hi CursorLineNr ctermfg=lightblue cterm=bold term=bold | |
hi Comment ctermfg=grey cterm=italic | |
hi NonText ctermfg=darkgrey cterm=none | |
hi SpecialKey ctermfg=darkgrey cterm=none | |
hi clear CursorLine | |
endif | |
if has('gui_running') | |
colorscheme gruvbox | |
set guifont=Hack\ 10 | |
set guioptions=aAegi " aegimrLtT | |
"set guiheadroom=50 | |
endif | |
set statusline=%t | |
set statusline+=%#warningmsg# | |
"set statusline+=%{SyntasticStatuslineFlag()} | |
set statusline+=%*\ | |
set statusline+=%m | |
set statusline+=%r | |
set statusline+=%h | |
set statusline+=%w | |
set statusline+=%y | |
"set statusline+=%{fugitive#statusline()} | |
set statusline+=%= | |
set statusline+=[ | |
set statusline+=%{strlen(&spl)?&spl:''}, | |
set statusline+=%{&ff}, | |
set statusline+=%{strlen(&fenc)?&fenc:'none'} | |
set statusline+=] | |
set statusline+=[%c,%l/%L\ %P] | |
set wrap | |
set linebreak | |
set textwidth=0 | |
set foldmethod=indent | |
set foldlevel=99 | |
set tabstop=4 | |
set shiftwidth=4 | |
set softtabstop=4 | |
set expandtab | |
set autoindent | |
set smartindent | |
set smarttab | |
set shiftround | |
set incsearch " search-as-you-type | |
set hlsearch " hi-lite matches | |
set nohlsearch " off until searched | |
set gdefault " auto /g flag for s/1/2/ | |
set ignorecase " case-insensitive searching & tabcompl... | |
set smartcase " ...unless search term contains caps | |
set magic " no escapes for extended REs (<,>,+,...) | |
if has('multibyte') | |
set termencoding=utf8 | |
set fileencoding=utf8 | |
set encoding=utf8 | |
end | |
" unhide quotes in JSON | |
set conceallevel=0 | |
let g:vim_json_syntax_conceal = 0 | |
set undofile | |
set backupdir=$HOME/.vim/backup | |
set undodir=$HOME/.vim/undo | |
set directory=$HOME/.vim/swap | |
" proper clipboard settings | |
set pastetoggle=<F2> | |
if has('nvim') | |
set clipboard+=unnamedplus | |
elseif has('xterm_clipboard') | |
set clipboard=unnamedplus | |
elseif has('clipboard') | |
set clipboard=unnamed | |
endif | |
if has('vms') | |
set nobackup | |
else | |
set backup | |
endif | |
if has('mouse') | |
set mouse=a | |
endif | |
if has('nvim') | |
" escape terminal | |
tnoremap <Esc> <C-\><C-n> | |
endif | |
if version >= 700 | |
set spell spelllang=en | |
set nospell | |
endif | |
if &encoding == 'utf-8' | |
set listchars=tab:▸\ ,eol:¬,trail:· | |
else | |
set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:< | |
endif | |
" Don't use Ex mode, use Q for formatting | |
map Q gq | |
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, | |
" so that you can undo CTRL-U after inserting a line break. | |
inoremap <C-U> <C-G>u<C-U> | |
if has('autocmd') | |
filetype plugin indent on | |
augroup vimrcEx | |
au! | |
autocmd FileType text setlocal textwidth=78 | |
autocmd FileType man setlocal textwidth=78 | |
autocmd BufReadPost * | |
\ if line("'\"") > 1 && line("'\"") <= line("$") | | |
\ exe "normal! g`\"" | | |
\ endif | |
augroup END | |
autocmd BufRead *.mkd,*.md set ai formatoptions=tcroqn2 comments=n:> | |
else | |
endif " has("autocmd") | |
if !exists(':DiffOrig') | |
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis | |
\ | wincmd p | diffthis | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment