Skip to content

Instantly share code, notes, and snippets.

@lukassup
Created October 7, 2016 12:54
Show Gist options
  • Save lukassup/185c781f7fdea4aadb8dfa52e476528f to your computer and use it in GitHub Desktop.
Save lukassup/185c781f7fdea4aadb8dfa52e476528f to your computer and use it in GitHub Desktop.
" 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 'tpope/vim-rails', {'for': ['ruby', 'eruby'] }
Plug 'scrooloose/syntastic'
Plug 'ervandew/supertab'
Plug 'davidhalter/jedi-vim'
Plug 'nvie/vim-flake8', { 'for': 'python' }
Plug 'rust-lang/rust.vim', {'for': 'rust'}
Plug 'ctrlpvim/ctrlp.vim'
Plug 'fholgado/minibufexpl.vim'
"Plug 'honza/dockerfile.vim'
"Plug 'git://fedorapeople.org/home/fedora/wwoods/public_git/vim-scripts.git'
Plug 'vim-latex/vim-latex', { 'for': 'latex' }
" Snippets: Vim 7.4+ / neovim
Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
" Snippets: Vim < 7.4
"Plug 'MarcWeber/vim-addon-mw-utils'
"Plug 'tomtom/tlib_vim'
"Plug 'garbas/vim-snipmate' | Plug 'honza/vim-snippets'
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_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
if has("vms")
set nobackup
else
set backup
endif
set background=dark
set shortmess+=I
set showcmd
set number
set showmatch
set matchtime=2
set splitbelow
set splitright
set hidden
set wildmenu
set wildmode=longest,list,full
set wildignore=.svn,CVS,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif
set noerrorbells
set whichwrap+=<,>,h,l,[,]
if has("gui_running")
colorscheme gruvbox
set guifont=Hack\ 10
set guioptions=aAegi " aegimrLtT
set cursorline
set list
"set guiheadroom=50
endif
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch!
endif
"
" Proper clipboard settings
"
set pastetoggle=<F2>
if has('nvim')
set clipboard+=unnamedplus
else
if has('mouse')
set mouse=a
endif
if has('xterm_clipboard')
set clipboard=unnamedplus
elseif has('clipboard')
set clipboard=unnamed
endif
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 history=256
set incsearch
set hlsearch!
set gdefault
set ignorecase
set smartcase
set termencoding=utf-8
"set fileencoding=utf-8
set encoding=utf-8
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
set backupdir=$HOME/.vim/backup
set undodir=$HOME/.vim/undo
set directory=$HOME/.vim/swap
if has("vms")
set nobackup
else
set backup
set undofile
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
if has('nvim')
" escape terminal
tnoremap <Esc> <C-\><C-n>
endif
" Unhide quotes in JSON
set conceallevel=0
let g:vim_json_syntax_conceal = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment