Skip to content

Instantly share code, notes, and snippets.

@dob9601
Last active October 27, 2020 14:45
Show Gist options
  • Save dob9601/96b42899c02e6451a7d97810ddb4ea48 to your computer and use it in GitHub Desktop.
Save dob9601/96b42899c02e6451a7d97810ddb4ea48 to your computer and use it in GitHub Desktop.
My vimrc config
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 'nathanaelkane/vim-indent-guides'
Plugin 'w0rp/ale'
Plugin 'ayu-theme/ayu-vim'
Plugin 'wimproved.vim'
Plugin 'majutsushi/tagbar'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'tpope/vim-fugitive'
Plugin 'valloric/youcompleteme'
Plugin 'jiangmiao/auto-pairs'
"Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'airblade/vim-gitgutter'
Plugin 'mhinz/vim-startify'
Plugin 'skywind3000/asyncrun.vim'
Plugin 'sheerun/vim-polyglot'
Plugin 'ryanoasis/vim-devicons'
Plugin 'yggdroot/indentline'
Plugin 'ap/vim-css-color'
Plugin 'junegunn/goyo.vim'
" 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
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
set statusline+=%#warningmsg#
set statusline+=%*
let g:ale_linters = {
\ 'javascript': ['eslint'],
\ 'css': ['stylelint'],
\ 'python': ['flake8', 'pylint']
\}
" 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_javascript_checkers = ['eslint']
" let g:syntastic_css_checkers = ['stylelint']
" let g:syntastic_mode_map = { 'mode': 'passive' }
nnoremap <F4> :silent make <CR>
nnoremap <F5> :silent !java % <CR>
autocmd filetype java set makeprg=javac\ %
let g:startify_custom_header = [
\ ' ___ ___ ___ _____ _______ ________ _____ ',
\ ' |\ \ / /|\ \|\ _ \ __ \ |\ __ \ |\__ \ ',
\ ' \ \ \ / / | \ \ \ \\ \\ \ \ \ \ \|\ \ \|_|\ \ ',
\ ' \ \ \/ / / \ \ \ \ \\__\\ \ \ \ \ __ \ \ \ \ ',
\ ' \ \ / / \ \ \ \ \ \ \ \ \ \ \|\ \ __\ \ \ ',
\ ' \ \__/ / \ \__\ \__\ \ \__\ \ \_______\\__\ \__\',
\ ' \|__|/ \|__| |__| \|__| \|_______\|__|\|__|',
\ ]
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set selection=exclusive
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
if empty(&shellxquote)
let l:shxq_sav = ''
set shellxquote&
endif
let cmd = '"' . $VIMRUNTIME . '\diff"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
if exists('l:shxq_sav')
let &shellxquote=l:shxq_sav
endif
endfunction
set noundofile
set backupdir-=.
set backupdir^=~/Vim-Backups
set backup
set nowrap
set number
" nmap <F12> :SyntasticCheck <enter>
" nmap <F11> :SyntasticToggleMode <enter>
" let g:indent_guides_enable_on_vim_startup = 1
let g:ale_open_list = 0
"let g:ale_set_loclist = 0
"let g:ale_set_quickfix = 1
"let g:ale_list_window_size = 4
"let g:ale_lint_on_text_changed = 'never'
autocmd BufRead,BufNewFile * setlocal signcolumn=yes
"autocmd FileType tagbar,nerdtree setlocal signcolumn=no
augroup CloseLoclistWindowGroup
autocmd!
autocmd QuitPre * if empty(&buftype) | lclose | endif
augroup END
autocmd Filetype css setlocal sw=2 softtabstop=2 expandtab
set laststatus=0
highlight clear SignColumn
set termguicolors " enable true colors support
" let ayucolor="light" " for light version of theme
" let ayucolor="mirage" " for mirage version of theme
let ayucolor="dark" " for dark version of theme
colorscheme ayu
if has("gui_running")
set guioptions -=m
set guioptions -=T
set guioptions -=r
set guioptions -=L
autocmd GUIEnter * silent! WToggleClean
autocmd GUIEnter * silent! WCenter 70
autocmd GUIEnter * silent! WSetAlpha 240
set guifont=NotoMono_NF:h10:W500:cANSI:qDRAFT
endif
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2
nnoremap <silent> <F12> :WToggleFullscreen<CR>
inoremap <silent> <F12> <C-O>:WToggleFullscreen<CR>
nnoremap <silent> <F4> :YcmCompleter FixIt<CR>
inoremap <silent> <F4> <C-O>:YcmCompleter FixIt<CR>
" SPLIT HANDLING
nnoremap <silent> <A-Left> <C-w>h
nnoremap <silent> <A-Down> <C-w>j
nnoremap <silent> <A-Up> <C-w>k
nnoremap <silent> <A-Right> <C-w>l
inoremap <silent> <A-Left> <C-O><C-w>h
inoremap <silent> <A-Down> <C-O><C-w>j
inoremap <silent> <A-Up> <C-O><C-w>k
inoremap <silent> <A-Right> <C-O><C-w>l
set splitright
set splitbelow
nnoremap <silent> <C-w> :q<CR>
inoremap <silent> <C-w> <C-O>:q<CR>
nnoremap <A-,> :split<CR>
inoremap <A-,> <C-O>:split<CR>
nnoremap <A-.> :vsplit<CR>
inoremap <A-.> <C-O>:vsplit<CR>
" ----------------
set laststatus=2
set cursorline
set encoding=UTF-8
set expandtab
set shiftwidth=4
set softtabstop=4
set smartindent
set autoindent
autocmd BufEnter * :syntax sync fromstart
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='cool'
" Disable Beep Boop
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=
let g:airline#extensions#tabline#show_buffers = 0
highlight Comment cterm=italic gui=italic
let g:asyncrun_open = 1
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/youcompleteme/.ycm_extra_conf.py'
nmap <F8> :TagbarToggle<CR>
autocmd FileType java TagbarOpen
" let g:indentLine_char = '|'
let g:indentLine_fileTypeExclude = ['startify']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment