Skip to content

Instantly share code, notes, and snippets.

@identor
Last active April 22, 2017 15:01
Show Gist options
  • Save identor/06c79d3896f0a7b73aef14fec39a2d31 to your computer and use it in GitHub Desktop.
Save identor/06c79d3896f0a7b73aef14fec39a2d31 to your computer and use it in GitHub Desktop.
Windows Vim config
" Recommended settings
set clipboard=unnamed
set nocompatible
" Syntax and plugin settings
filetype plugin indent on
syntax enable
set nowrap
set list
set listchars=tab:›\ ,trail:•,extends:#,nbsp:.
" Default indention settings
set noet
set ts=4
set sw=4
set sts=4
" Color scheme
colo desert
" If gvim
if has("gui_running")
" Remove toolbars
set guioptions-=T "remove toolbar
"set guioptions-=m "remove menu bar
" Set gui font
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h10
endif
" Strip whitespace
autocmd FileType c,cpp,java,go,php,javascript,puppet,python,rust,twig,xml,yml,perl,sql autocmd BufWritePre <buffer> call StripTrailingWhitespace()
" Recommended settings
set clipboard=unnamed
set nocompatible
filetype off
" Vundle Settings
set rtp+=$HOME/vimfiles/bundle/Vundle.vim/
call vundle#begin('$HOME/vimfiles/bundle/')
Plugin 'VundleVim/Vundle.vim'
" Plugins here:
Plugin 'tpope/vim-fugitive'
Plugin 'altercation/vim-colors-solarized'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'scrooloose/nerdtree'
call vundle#end()
" Syntax and plugin settings
filetype plugin indent on
syntax enable
set nowrap
set list
set nu
if has('win32')
set listchars=tab:›\ ,trail:•,extends:#,nbsp:.
endif
if has('unix')
set listchars=tab:>\ ,trail:.,extends:#,nbsp:.
endif
" Set temp directory
set backupdir=$HOME/vimfiles/tmp,.
set directory=$HOME/vimfiles/tmp,.
" Default indention settings
set noet
set ts=4
set sw=4
set sts=4
" Color scheme
colo solarized
" Make backspace work like other apps
set backspace=2
" If gvim
if has("gui_running")
" Remove toolbars
set guioptions-=T "remove toolbar
set guioptions-=m "remove menu bar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
" Set gui font
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h10
endif
" Strip whitespace
autocmd FileType c,cpp,java,go,php,javascript,puppet,python,rust,twig,xml,yml,perl,sql autocmd BufWritePre <buffer> call StripTrailingWhitespace()
" cd to current dir
autocmd BufEnter * silent! lcd %:p:h
" Ctrlp ignore
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.(git|hg|svn)|(node_modules))$',
\ 'file': '\v\.(exe|so|dll|zip|gz|rar)$',
\ 'link': 'some_bad_symbolic_links',
\ }
" Key mappings
let mapleader=" "
nnoremap <leader>l :tabnext<cr>
nnoremap <leader>h :tabprev<cr>
nnoremap <leader>e :NERDTreeToggle<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment