diff --git a/snowblocks/vim/vimrc b/snowblocks/vim/vimrc new file mode 100644 index 0000000..d1596bc --- /dev/null +++ b/snowblocks/vim/vimrc @@ -0,0 +1,229 @@ +" ++++++++++++++++++++++++++++++++++++++++++++++++++++++ +" title Vim Configuration + +" project igloo + +" repository https://github.com/arcticicestudio/igloo + +" author Arctic Ice Studio + +" email development@arcticicestudio.com + +" copyright Copyright (C) 2017 + +" ++++++++++++++++++++++++++++++++++++++++++++++++++++++ +" +" [References] +" Google Style Guide +" (https://google.github.io/styleguide/vimscriptguide.xml) + +"+---------+ +"+ Plugins + +"+---------+ +call plug#begin(expand('~/.vim/plugged')) +Plug 'mattn/emmet-vim' +Plug 'Yggdroot/indentLine' +Plug 'itchyny/lightline.vim' +Plug 'scrooloose/nerdtree' +Plug 'Townk/vim-autoclose' +Plug 'gorodinskiy/vim-coloresque' +Plug 'tpope/vim-fugitive' +Plug 'airblade/vim-gitgutter' +Plug 'pangloss/vim-javascript' + +Plug 'arcticicestudio/nord-vim' + +if v:version >= 704 + Plug 'honza/vim-snippets' + Plug 'SirVer/ultisnips' +endif +call plug#end() + +"+--- Yggdroot/indentLine ---+ +let g:indentLine_enabled = 0 +let g:indentLine_char = '│' + +"+--- itchyny/lightline.vim ---+ +let g:lightline = { + \ 'colorscheme': 'nord', + \ 'active': { + \ 'left': [ + \ [ 'mode', 'paste' ], + \ [ 'fugitive', 'filename' ] + \ ] + \ }, + \ 'component_function': { + \ 'fugitive': 'LightlineFugitive', + \ 'readonly': 'LightlineReadonly', + \ 'modified': 'LightlineModified', + \ 'filename': 'LightlineFilename' + \ }, + \ 'separator': { + \ 'left': '', + \ 'right': '' + \ }, + \ 'subseparator': { + \ 'left': '', + \ 'right': '' + \ } + \ } + +function! LightlineModified() + if &filetype == "help" + return "" + elseif &modified + return "+" + elseif &modifiable + return "" + else + return "" + endif +endfunction + +function! LightlineReadonly() + if &filetype == "help" + return "" + elseif &readonly + return "" + else + return "" + endif +endfunction + +function! LightlineFugitive() + if exists("*fugitive#head") + let branch = fugitive#head() + return branch !=# '' ? ' '.branch : '' + endif + return '' +endfunction + +function! LightlineFilename() + return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') . + \ ('' != expand('%:t') ? expand('%:t') : '[No Name]') . + \ ('' != LightlineModified() ? ' ' . LightlineModified() : '') +endfunction + +"+--- airblade/vim-gitgutter ---+ +let g:gitgutter_sign_column_always = 1 +let g:gitgutter_realtime = 1 +let g:gitgutter_eager = 1 + +"+--- pangloss/vim-javascript ---+ +let g:javascript_enable_domhtmlcss = 1 +let g:javascript_plugin_jsdoc = 1 +let g:javascript_plugin_flow = 1 + +"+--- SirVer/ultisnips ---+ +let g:UltiSnipsExpandTrigger="" +let g:UltiSnipsJumpForwardTrigger="" +let g:UltiSnipsJumpBackwardTrigger="" +let g:UltiSnipsEditSplit="vertical" + +"+---------------+ +"+ Auto Commands + +"+---------------+ +" Enable syntax highlight syncing from start +augroup vimrc-sync-fromstart + autocmd! + autocmd BufEnter * :syntax sync fromstart +augroup END + +" Exit if only NERDTree is open +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif + +"+--------------+ +"+ Key Mappings + +"+--------------+ +let mapleader = "," +let g:mapleader = "," + +map j +map k +map h +map l + +map :NERDTreeToggle + +"+---------------+ +"+ Configuration + +"+---------------+ +syntax enable +colorscheme nord + +filetype plugin on +filetype indent on + +set autochdir +set binary +set mouse=a +set nobackup +set nocompatible +set noswapfile +set nowb +set encoding=utf-8 +set fileencoding=utf-8 +set fileencodings=utf-8 +set ttyfast +set viminfo= +set updatetime=250 + +"+----+ +"+ UI + +"+----+ +set ffs=unix,dos,mac +set gfn=Source\ Code\ Pro\ Regular\ 12 +set guioptions-=m +set guioptions-=T +set guioptions-=r +set guioptions-=L +set hidden +set laststatus=2 +set lazyredraw +set noerrorbells +set noshowmode +set novisualbell +set number +set ruler +set t_vb= +set tm=500 +set wildmenu +set wildignore=*~,*.pyc +set wildignore+=*/.git/*,*/.hg/*,*/.svn/* + +"+--- Editor ---+ +set autoindent +set backspace=indent,eol,start +set cursorline +set colorcolumn=160 +set expandtab +set foldcolumn=1 +set foldenable +set foldlevelstart=10 +set guicursor=a:ver25-Cursor/lCursor +set linebreak +set list +set listchars=eol:¬,space:·,tab:»\ +set magic +set mat=2 +set shiftwidth=2 +set showmatch +set smartindent +set smarttab +set softtabstop=2 +set tabstop=2 +set textwidth=160 +set whichwrap+=<,>,h,l +set wrap + +"+--- Search ---+ +set ignorecase +set smartcase +set hlsearch +set incsearch + +"+-----------+ +"+ Functions + +"+-----------+ +" Shows syntax highlighting groups for the current cursor position +nmap :call SynStack() +function! SynStack() + if !exists("*synstack") + return + endif + echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') +endfunc