-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
executable file
·150 lines (121 loc) · 4.53 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
" Maintainer: Stephen Coward <[email protected]>
" Last change: 2012 Jul 11
""""""""""""""""""""""""""""""""""""""""""
" General
""""""""""""""""""""""""""""""""""""""""""
set nocompatible
call pathogen#infect()
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
set rtp+=$GOROOT/misc/vim
Bundle 'gmarik/vundle'
Bundle 'Valloric/YouCompleteMe'
Bundle 'guns/vim-clojure-static'
Bundle 'tpope/vim-foreplay'
Bundle 'tpope/vim-classpath'
Bundle 'dart-lang/dart-vim-plugin'
Bundle 'bling/vim-airline'
Bundle 'tpope/vim-fugitive'
Bundle 'scrooloose/syntastic'
Bundle 'fatih/vim-go'
Bundle 'airblade/vim-gitgutter'
Bundle 'jelera/vim-javascript-syntax'
Bundle 'pangloss/vim-javascript'
Bundle 'nathanaelkane/vim-indent-guides'
Bundle 'Raimondi/delimitMate'
filetype plugin indent on " Automatically detect file types.
syntax on " syntax highlighting
let g:vikiNameTypes = "sSeuix"
" hides tabs?
set hidden
set background=dark
colorscheme solarized
set autoread
set backupdir=/tmp
set directory=/tmp
set history=100
set virtualedit=onemore
set viewoptions=folds,options,cursor,unix,slash
" add omnifunc
set ofu=syntaxcomplete#Complete
" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","
let maplocalleader = '.'
let g:maplocalleader = '.'
" Fast saving
nmap <leader>w :w!<cr>
" When vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vimrc
" Buffer stuff
:nnoremap <F5> :buffers<CR>:buffer<Space>
""""""""""""""""""""""""""""""
" => Vim UI
""""""""""""""""""""""""""""""
set tabpagemax=15 " only show 15 tabs
set showmode " display the current mode
if has('cmdline_info')
set ruler " show the ruler
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " a ruler on steroids
set showcmd " show partial commands in status line and
" selected characters/lines in visual mode
endif
set backspace=indent,eol,start " backspace for dummys
set linespace=0 " No extra spaces between rows
set nu " Line numbers on
set showmatch " show matching brackets/parenthesis
set incsearch " find as you type search
set hlsearch " highlight search terms
set winminheight=0 " windows can be 0 line high
set ignorecase " case insensitive search
set smartcase " case sensitive when uc present
set wildmenu " show list instead of just completing
set wildmode=list:longest,full " command <Tab> completion, list matches, then longest common part, then all.
set whichwrap=b,s,h,l,<,>,[,] " backspace and cursor keys wrap to
set scrolljump=5 " lines to scroll when cursor leaves screen
set scrolloff=3 " minimum lines to keep above and below cursor
set foldenable " auto fold code
set gdefault " the /g flag on :s substitutions by default
""""""""""""""""""""""""""""""
" => Formatting
""""""""""""""""""""""""""""""
" Formatting {
set nowrap " wrap long lines
set autoindent " indent at the same level of the previous line
set shiftwidth=4 " use indents of 4 spaces
set expandtab " tabs are spaces, not tabs
set tabstop=4 " an indentation every four columns
set softtabstop=4 " let backspace delete indent
"set matchpairs+=<:> " match, to be used with %
set pastetoggle=<F2> " pastetoggle (sane indentation on pastes)
"set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
" Remove trailing whitespaces and ^M chars
autocmd FileType c,cpp,java,php,js,python,twig,xml,yml,as,go autocmd BufWritePre <buffer> :call setline(1,map(getline(1,"$"),'substitute(v:val,"\\s\\+$","","")'))
" }
" ActionScript
au BufNewFile,BufRead *.as, setf actionscript
" Spark INO as cplusplus
au BufNewFile,BufRead,BufReadPost *.ino, set filetype=cpp
" Markdown textwidth
au BufRead,BufNewFile *.md setlocal textwidth=80
""""""""""""""""""""""""""""""
" => Key (re)Mappings
""""""""""""""""""""""""""""""
" Making it so ; works like : for commands. Saves typing and eliminates :W style typos due to lazy holding shift.
nnoremap ; :
" Easier moving in tabs and windows
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map <C-L> <C-W>l<C-W>_
map <C-H> <C-W>h<C-W>_
" Shortcuts
" Change Working Directory to that of the current file
cmap cd. lcd %:p:h
noremap <F12> <Esc>:syntax sync fromstart<CR>
inoremap <F12> <C-o>:syntax sync fromstart<CR>
""""""""""""""""""""""""""""
" => Plugins
""""""""""""""""""""""""""""
source ~/.vim/vimrcs/plugins_config.vim