Skip to content

Commit

Permalink
GHI-#3 Implement vimrc
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticicestudio committed Jan 10, 2017
1 parent fd43bda commit c5e33d1
Showing 1 changed file with 229 additions and 0 deletions.
229 changes: 229 additions & 0 deletions snowblocks/vim/vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
" ++++++++++++++++++++++++++++++++++++++++++++++++++++++
" title Vim Configuration +
" project igloo +
" repository https://github.com/arcticicestudio/igloo +
" author Arctic Ice Studio +
" email [email protected] +
" 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="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
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 <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
map <C-n> :NERDTreeToggle<CR>
"+---------------+
"+ 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 <C-S-P> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc

0 comments on commit c5e33d1

Please sign in to comment.