Skip to content

Commit

Permalink
Update vim config
Browse files Browse the repository at this point in the history
  • Loading branch information
oblique committed Jun 24, 2015
1 parent 5ad8cda commit 37ad04b
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 98 deletions.
1 change: 1 addition & 0 deletions .nvim
1 change: 1 addition & 0 deletions .nvimrc
7 changes: 0 additions & 7 deletions .vim/after/syntax/c.vim

This file was deleted.

51 changes: 51 additions & 0 deletions .vim/autoload/airline/themes/behelit.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
let g:airline#themes#behelit#palette = {}

" Normal mode
let s:N1 = [ '#121212', '#5f87ff', 233, 69 ]
let s:N2 = [ '#5f87ff', '#262626', 69 , 235 ]
let s:N3 = [ '#5f87ff', '#1c1c1c', 69 , 234 ]
let g:airline#themes#behelit#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
let g:airline#themes#behelit#palette.normal_modified = {
\ 'airline_c': [ '#d7005f', '#1c1c1c', 161, 234, 'bold' ],
\ }

" Insert mode
let s:I1 = [ '#121212', '#00ff87', 233, 48 ]
let g:airline#themes#behelit#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:N3)
let g:airline#themes#behelit#palette.insert_modified = g:airline#themes#behelit#palette.normal_modified
let g:airline#themes#behelit#palette.insert_paste = {
\ 'airline_a': [ "#101010", "#5f5faf", 233, 61, '' ],
\ }

" Replace mode
let g:airline#themes#behelit#palette.replace = copy(g:airline#themes#behelit#palette.insert)
let g:airline#themes#behelit#palette.replace.airline_a = [ s:I1[0], '#d70057', s:I1[2], 161, '' ]
let g:airline#themes#behelit#palette.replace_modified = g:airline#themes#behelit#palette.insert_modified

" Visual mode
let s:V1 = [ '#121212', '#5fff5f', 233, 83 ]
let g:airline#themes#behelit#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:N3)
let g:airline#themes#behelit#palette.visual_modified = g:airline#themes#behelit#palette.normal_modified

" Inactive window
let s:IA1 = [ '#4e4e4e', '#1c1c1c', 239, 234, '' ]
let s:IA2 = [ '#4e4e4e', '#262626', 239, 235, '' ]
let s:IA3 = [ '#4e4e4e', '#1c1c1c', 239, 234, '' ]
let g:airline#themes#behelit#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
let g:airline#themes#behelit#palette.inactive_modified = g:airline#themes#behelit#palette.normal_modified

" Accents
let g:airline#themes#behelit#palette.accents = {
\ 'red': [ '#d7005f', '', 161, '' ]
\ }

" Warnings
let s:WI = [ '#121212', '#d7005f', 233, 161 ]
let g:airline#themes#behelit#palette.normal.airline_warning = s:WI
let g:airline#themes#behelit#palette.normal_modified.airline_warning = s:WI
let g:airline#themes#behelit#palette.insert.airline_warning = s:WI
let g:airline#themes#behelit#palette.insert_modified.airline_warning = s:WI
let g:airline#themes#behelit#palette.visual.airline_warning = s:WI
let g:airline#themes#behelit#palette.visual_modified.airline_warning = s:WI
let g:airline#themes#behelit#palette.replace.airline_warning = s:WI
let g:airline#themes#behelit#palette.replace_modified.airline_warning = s:WI
10 changes: 5 additions & 5 deletions .vim/colors/behelit.vim
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
" Theme: behelit
" Version: 0.3
" Maintainer: oblique <psyberbits@gmail.com>
"
"
" Copyright (c) 2014, oblique
" All rights reserved.
"
"
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are met:
"
"
" * Redistributions of source code must retain the above copyright notice, this
" list of conditions and the following disclaimer.
"
"
" * Redistributions in binary form must reproduce the above copyright notice,
" this list of conditions and the following disclaimer in the documentation
" and/or other materials provided with the distribution.
"
"
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down
65 changes: 0 additions & 65 deletions .vim/plugin/SyntaxAttr.vim

This file was deleted.

17 changes: 17 additions & 0 deletions .vim/ycm_extra_conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python2

import os

def FlagsForFile(filename):
ext = os.path.splitext(filename)[1]
flags = [ '-Wall', '-Wextra', '-Werror' ]

if ext == ".c":
flags += [ '-std=c11', '-x', 'c' ]
else:
flags += [ '-std=c++11', '-x', 'c++' ]

return {
'flags': flags,
'do_cache': True
}
113 changes: 92 additions & 21 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -1,21 +1,92 @@
:syntax on
:set nocompatible
:set number
:set expandtab
:set softtabstop=4
:set shiftwidth=4
:filetype plugin on
:filetype indent on
:set backspace=2
:set autowrite
:set autoindent
:set hlsearch
:set incsearch
:set smartindent
":set cindent
:set encoding=utf-8
:set statusline=%<%f\ %h%m%r%=%-15.(%l[%p%%],%c%)\ %y[%{&fileformat}][len=%L]
:set laststatus=2
:set wildmenu
":setlocal spell spelllang=el
:colorscheme behelit
syntax on
set nocompatible
set number

filetype plugin on
filetype indent on

set autoindent
set cindent
set hlsearch
set incsearch
set encoding=utf-8
set backspace=indent,eol,start
set wildmenu
colorscheme behelit

set mouse+=a
if &term =~ '^screen'
" tmux knows the extended mouse mode
set ttymouse=xterm2
endif

" Reset search highlight
noremap <leader>h :nohl<cr>
" Neovim {{{
if has("nvim")
" yank uses X clipboard
set clipboard+=unnamedplus
endif
" }}}

" vim-plug {{{
" Load vim-plug
if empty(glob("~/.vim/autoload/plug.vim"))
execute '!mkdir -p ~/.vim/autoload'
execute '!curl -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim'
endif

call plug#begin('~/.vim/plugged')
Plug 'octol/vim-cpp-enhanced-highlight'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/nerdcommenter'
Plug 'bling/vim-airline'
Plug 'ntpeters/vim-better-whitespace'
Plug 'Shougo/unite.vim'
Plug 'Shougo/vimproc', { 'do' : 'make' }
Plug 'Shougo/neomru.vim'
Plug 'Valloric/YouCompleteMe', { 'do' : './install.sh --clang-completer --system-libclang --system-boost' }
call plug#end()
" }}}

" YouCompleteMe {{{
let g:ycm_global_ycm_extra_conf = '~/.vim/ycm_extra_conf.py'
" }}}

" NERDTree {{{
noremap <leader>n :NERDTreeToggle<cr>
" }}}

" Configure Airline {{{
let g:airline_theme='behelit'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
" Show just the filename
let g:airline#extensions#tabline#fnamemod = ':t'
set laststatus=2
" we don't need mode since airline show it
set noshowmode
" }}}

" Unite.vim {{{
let g:unite_source_grep_max_candidates = 200

" This allows buffers to be hidden if you've modified a buffer.
set hidden

if executable('ag')
" Use ag in unite grep source.
let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts = '-i --line-numbers --nocolor --nogroup --hidden'
let g:unite_source_grep_recursive_opt = ''
endif

call unite#filters#matcher_default#use(['matcher_fuzzy'])
nnoremap <leader>t :<C-u>Unite -buffer-name=files_rec -start-insert file_rec/neovim:!<cr>
nnoremap <leader>f :<C-u>Unite -buffer-name=files -start-insert file<cr>
nnoremap <leader>r :<C-u>Unite -buffer-name=mru -start-insert file_mru<cr>
nnoremap <leader>e :<C-u>Unite -buffer-name=buffer -start-insert buffer<cr>
" }}}

" vim: nowrap fdm=marker foldcolumn=2

0 comments on commit 37ad04b

Please sign in to comment.