-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
113 lines (102 loc) · 2.51 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'tpope/vim-commentary'
Bundle 'tpope/vim-surround'
Bundle 'kien/ctrlp.vim'
Bundle 'stash/syntastic'
Bundle 'ervandew/supertab'
Bundle 'mileszs/ack.vim'
Bundle 'bendecoste/vim-togglenumber'
Bundle 'bendecoste/vim-whitespace'
" Config {
filetype plugin indent on
syntax on
set nobackup
set noswapfile
set backspace=indent,eol,start
set colorcolumn=80
set nocompatible
set completeopt=menu,menuone
set confirm
set encoding=utf-8
set hidden
set history=1000
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set linebreak
set scrolljump=10
set showcmd
set smartcase
set nostartofline
set termencoding=utf-8
set nowrap
set expandtab
set smarttab
set autoindent
" tab width {
set ts=2
set shiftwidth=2
" }
" Folding {
" set foldcolumn=0
" set foldenable
" set foldlevel=0
" set foldmethod=marker
" set foldtext=FoldText()
"}
" wildmenu {
set wildignore=.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,*.pyc,*/.tox/*,*.egg-info/*
set wildmenu
set wildmode=list:longest,full
"}
" Mappings {
let g:syntastic_enable_signs=1
let g:syntastic_disabled_filetypes = ['html']
let mapleader="\\"
:nmap <silent> <c-q> /<c-r>//e<cr>:let @/='<c-r>/'<cr>
:nmap \p :set paste!<CR>
:nmap j gj
:nmap k gk
:nmap \e :e#<CR>
:nmap <C-n> :bnext<CR>
:nmap <C-p> :bprev<CR>
:nmap \; :CtrlPBuffer<CR>
:nmap \o :nohl<CR>
" }
" ctrlP options {
:let g:ctrlp_map = '<Leader>t'
:let g:ctrlp_custom_ignore = '\v\~$|\.(o|swp|pyc|wav|mp3|ogg|blend)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])|__init__\.py'
:let g:ctrlp_dotfiles = 0
" }
" }
" Functions {
"toggle between relative and absolute line numbering
set relativenumber
nnoremap <C-l> :call ToggleNumber()<cr>
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
" }
let g:solarized_termcolors=256
let g:solarized_termtrans=2 " makes the background not change color
set background=dark
" colorscheme solarized
colorscheme grb256
" colorscheme dw_green
" Other color options {
" hi StatusLine cterm=bold
" hi StatusLineNC cterm=bold
" }
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()