You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

145 lines
4.1 KiB

"
" Begin Vundle config
" https://github.com/VundleVim/Vundle.vim
"
set nocompatible
filetype off
" 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 for running make asynchronously
Plugin 'https://github.com/skywind3000/asyncrun.vim.git'
" glsl hilighting
Plugin 'tikhomirov/vim-glsl'
autocmd! BufNewFile,BufRead *.vs,*.fs set ft=glsl
" additional highlighting for c/c++ function names
Plugin 'octol/vim-cpp-enhanced-highlight'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
"
" End Vundle config
"
"filetype plugin indent on
syntax on
colorscheme deus
set hlsearch
" don't clutter directories with backup files
set nobackup
set nowritebackup
set tabstop=4
set shiftwidth=4 " set to same as tabstop for auto-indent
set clipboard=unnamedplus
" folding
set foldmethod=syntax
set foldnestmax=1
set foldlevelstart=20
set foldcolumn=2
set autoindent
" filename auto-completion
set wildmode=longest,list,full
set wildmenu
" attempts to fix delay when mode switch, also need tmux option "set -s escape-time 0"
set ttimeoutlen=10
" line numbering gutter
set number
set numberwidth=3
set cpoptions+=n " use gutter for wrapped lines
highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE
" airline plugin stuffs
set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#formatter = 'default'
let g:airline_theme='bubblegum'
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_altsep = ''
"let g:airline_section_c = '%{getcwd()}'
let g:airline_section_warning = '' " disable whitespace warnings
"let g:airline_powerline_fonts = 1
" custom keybinds
" C-PageUp/Down conflicts with xfce-terminal, so there is a trick to fixing
" https://unix.stackexchange.com/questions/159979/xfce4-terminal-disable-individual-shortcut
map <C-PageDown> :bnext<CR>
map <C-PageUp> :bprev<CR>
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" override default paste behavior
xnoremap p pgvy
map <F6> :ccl<CR>
map <F2> :cn<CR>
nmap <F4> :bp\|bd #<CR>
" AsyncRun
" https://github.com/skywind3000/asyncrun.vim
" map <F5> :AsyncRun -cwd=<root> -save=2 make<CR>
map <F5> :AsyncRun -cwd=<root> -save=2 make<CR>
augroup vimrc
" remove all vimrc autocommands
autocmd!
autocmd QuickFixCmdPost * copen 8
" Don't screw up folds when inserting text that might affect them, until
" " leaving insert mode. Foldmethod is local to the window. Protect against
" " screwing up folding when switching between windows.
autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif
" save folds/cursor positions of buffers
autocmd BufWinLeave *.* mkview
autocmd BufWinEnter *.* silent loadview
augroup END
" fix keycodes when running inside tmux
" http://tmux-users.narkive.com/M9tIqoa0/c-pageup-and-c-pagedown-seems-not-to-work-in-tmux
if &term =~ '^screen' && exists('$TMUX')
" Mouse mode
set mouse+=a
set ttymouse=xterm2
" tmux sends xterm-style keys when xterm-keys option is on
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
execute "set <xHome>=\e[1;*H"
execute "set <xEnd>=\e[1;*F"
execute "set <Insert>=\e[2;*~"
execute "set <Delete>=\e[3;*~"
execute "set <PageUp>=\e[5;*~"
execute "set <PageDown>=\e[6;*~"
execute "set <xF1>=\e[1;*P"
execute "set <xF2>=\e[1;*Q"
execute "set <xF3>=\e[1;*R"
execute "set <xF4>=\e[1;*S"
execute "set <F5>=\e[15;*~"
execute "set <F6>=\e[17;*~"
execute "set <F7>=\e[18;*~"
execute "set <F8>=\e[19;*~"
execute "set <F9>=\e[20;*~"
execute "set <F10>=\e[21;*~"
execute "set <F11>=\e[23;*~"
execute "set <F12>=\e[24;*~"
endif