Skip to content

Instantly share code, notes, and snippets.

@jowave
Created March 24, 2018 17:34
Show Gist options
  • Save jowave/24e2b9aeac7c5bc49db3da2e97a89f73 to your computer and use it in GitHub Desktop.
Save jowave/24e2b9aeac7c5bc49db3da2e97a89f73 to your computer and use it in GitHub Desktop.
Configuration file for Vim
" vimrc file by jowave
set nocompatible " Use vim defaults, not vi
" pathogen install:
" mkdir -p ~/.vim/autoload ~/.vim/bundle && \
" curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
call pathogen#infect()
syntax on
filetype plugin indent on
set showmode
set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
set autoindent
set writebackup " make backup, delete afterwards
set hlsearch " nohlsearch to turn off
set updatetime=60000 " saves power on notebooks
set mouse=a
set mousemodel=popup " activate popup menu with right mouse-button
set clipboard=autoselect,unnamedplus " try to become owner of wm's clipboard; unnamedplus: copy/paste to system clipboard with 'y'
set laststatus=2 " always a status line
set statusline=%<%f\ %h%m%r\ %=(%l\:%c)\ %P\
set showcmd
set ttyfast
set visualbell " flash screen instead of beep:
" terminal code for visual bell (empty = turn off):
"set t_vb=
set wildmode=longest,list,full " tab completion for filenames
set wildmenu
if !has('gui_running')
set background=dark
endif
" map ctrl+h,j,k,l to move between windows and maximize the window vertically
nmap <C-J> <C-W>j<C-W>_
nmap <C-K> <C-W>k<C-W>_
nmap <C-H> <C-W>h<C-W>_
nmap <C-L> <C-W>l<C-W>_
set completeopt=menu
" build ctags database for omnicppcomplete
map <C-F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
" search for tags file in parent directories up to $HOME
set tags+=tags;$HOME
set tags+=~/.vim/ctags/cpp
set tags+=~/.vim/ctags/gl
set tags+=~/.vim/ctags/zlib
" close the preview window of omnicppcomplete automatically after completion:
autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
autocmd InsertLeave * if pumvisible() == 0|pclose|endif
let OmniCpp_ShowPrototypeInAbbr = 1 " show function parameters
" taglist
let Tlist_Process_File_Always = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment