Skip to content

Instantly share code, notes, and snippets.

@bacek
Created February 19, 2018 02:57
Show Gist options
  • Save bacek/12b09872637e0299ab8f036eaeffc418 to your computer and use it in GitHub Desktop.
Save bacek/12b09872637e0299ab8f036eaeffc418 to your computer and use it in GitHub Desktop.
my .vimrc
colorscheme wombat
set ai
set et
set ts=2
set sts=2
set sw=2
set guioptions-=T
set guioptions-=m
set number
set relativenumber
set spell
" Disable bells
set noeb vb t_vb=
"====[ Show when lines extend past column 80 ]=================================>-<=====================
" highlight ColorColumn ctermfg=208 ctermbg=Black
function! MarkMargin (on)
if exists('b:MarkMargin')
try
call matchdelete(b:MarkMargin)
catch /./
endtry
unlet b:MarkMargin
endif
if a:on
let b:MarkMargin = matchadd('ColorColumn', '\%81v\s*\S', 100)
endif
endfunction
augroup MarkMargin
autocmd!
autocmd BufEnter * :call MarkMargin(1)
autocmd BufEnter *.vp* :call MarkMargin(0)
augroup END
" Vundle
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
" let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py'
let g:ycm_compilation_database_folder = './'
let g:ycm_global_ycm_extra_conf = '~/.vim/global_extra_conf.py'
let g:ycm_extra_conf_vim_data = [ 'g:ycm_compilation_database_folder' ]
Plugin 'SirVer/ultisnips'
" Snippets are separated from the engine. Add this if you want them:
" Plugin 'honza/vim-snippets'
Plugin 'isRuslan/vim-es6'
Plugin 'vcscommand.vim'
" Plugin 'ctrlpvim/ctrlp.vim'
" set wildignore+=*/node_modules/*
" Plugin 'vim-airline/vim-airline'
" Plugin 'vim-airline/vim-airline-themes'
Plugin 'itchyny/lightline.vim'
" Lightline
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [['mode', 'paste'], ['filename', 'modified']],
\ 'right': [['lineinfo'], ['percent'], ['readonly', 'linter_warnings', 'linter_errors', 'linter_ok']]
\ },
\ 'component_expand': {
\ 'linter_warnings': 'LightlineLinterWarnings',
\ 'linter_errors': 'LightlineLinterErrors',
\ 'linter_ok': 'LightlineLinterOK'
\ },
\ 'component_type': {
\ 'readonly': 'error',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error'
\ },
\ }
function! LightlineLinterWarnings() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '' : printf('%d ◆', all_non_errors)
endfunction
function! LightlineLinterErrors() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '' : printf('%d ✗', all_errors)
endfunction
function! LightlineLinterOK() abort
let l:counts = ale#statusline#Count(bufnr(''))
let l:all_errors = l:counts.error + l:counts.style_error
let l:all_non_errors = l:counts.total - l:all_errors
return l:counts.total == 0 ? '✓ ' : ''
endfunction
autocmd User ALELint call s:MaybeUpdateLightline()
" Update and show lightline but only if it's visible (e.g., not in Goyo)
function! s:MaybeUpdateLightline()
if exists('#lightline')
call lightline#update()
end
endfunction
Plugin 'mileszs/ack.vim'
let g:ackprg = 'ack'
Plugin 'leafgarland/typescript-vim'
Plugin 'Shougo/vimproc.vim'
" Plugin 'Quramy/tsuquyomi'
Plugin 'JamshedVesuna/vim-markdown-preview'
Plugin 'pangloss/vim-javascript'
let g:javascript_plugin_jsdoc = 1
let g:javascript_plugin_ngdoc = 1
Plugin 'mustache/vim-mustache-handlebars'
" Plugin 'mattn/vimtweak'
" Plugin 'mattn/transparency-windows-vim'
Plugin 'tell-k/vim-autopep8'
Plugin 'vim-scripts/a.vim'
" Async linter
Plugin 'w0rp/ale'
let g:ale_python_mypy_options = '--ignore-missing-imports'
let g:rust_cargo_use_check = 1
Plugin 'rust-lang/rust.vim'
Plugin 'cespare/vim-toml'
" Plugin 'vim-syntastic/syntastic'
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 1
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 0
" let g:syntastic_python_python_exec = '/usr/bin/python3'
" let g:syntastic_python_pyflakes_exe = 'python3 -m pyflakes'
Plugin 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plugin 'junegunn/fzf.vim'
nmap ; :Buffers<CR>
nmap <Leader>t :Files<CR>
nmap <Leader>r :Tags<CR>
" This is the default. %s is replaced with fzf command
" let g:fzf_launcher = 'gnome-terminal -e bash -- -ic %s'
" Auto indent to open (
Plugin 'Vimjas/vim-python-pep8-indent'
let g:python_pep8_indent_multiline_string = -1
" Snippets
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<c-tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
Plugin 'heavenshell/vim-jsdoc'
let g:jsdoc_enable_es6 = 1 " Typescriptish support
augroup JSDoc
autocmd BufEnter *.ts :set foldmethod=syntax
augroup END
" Plugin 'jalcine/cmake.vim'
Plugin 'timonv/vim-cargo'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
set exrc " load project specific .vimrc
syntax on
set laststatus=2
" ligatures support
let g:gtk_nocache=[0x00000000, 0xfc00ffff, 0xf8000001, 0x78000001]
set guifont=Fira\ Code\ 11
" YCM
map <C-[> :YcmCompleter GoToDefinition<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment