-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
178 lines (140 loc) · 5.67 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
set clipboard=unnamed "all yanking/deleting operations automatically copy to the system clipboard
set nocompatible " be iMproved, required
filetype off " required
" Always show statusline
set laststatus=2
"Get rid of the default mode indicator
set noshowmode
"Avoid mode switch delay
set timeoutlen=1000 ttimeoutlen=0
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 'gmarik/Vundle.vim'
"YouCompleteMe
Plugin 'ycm-core/YouCompleteMe'
"YCM will auto-close the preview window after the user leaves insert mode
let g:ycm_autoclose_preview_window_after_insertion = 1
"Fugitive git wrapper
Plugin 'tpope/vim-fugitive'
"Autotag (automatically update ctags file on file save)
"Plugin 'craigemery/vim-autotag'
"Syntax and indent files for Swift (https://github.com/keith/swift.vim)
Plugin 'keith/swift.vim'
"Swift syntax (from https://github.com/apple/swift/tree/master/utils/vim)
"Disabled because dosn't seem to work well for indentation
"Plugin 'file:///Users/francescobigagnoli/.vim/vim-swift'
"Auto Pairs: Insert or delete brackets, parens, quotes in pair.
Plugin 'jiangmiao/auto-pairs'
" Powerline status
" https://powerline.readthedocs.io/en/master/usage/other.html#vim-statusline
Bundle 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'}
"CtrlP
"Plugin 'kien/ctrlp.vim'
"Markdown syntax, mapping rules and matching
"https://github.com/plasticboy/vim-markdown
"Plugin 'godlygeek/tabular'
"Plugin 'plasticboy/vim-markdown'
"Abolish.vim - A plugin for working with variants of a word.
"https://github.com/tpope/vim-abolish
"Plugin 'abolish.vim'
"Instant Markdown
"Plugin 'instant-markdown.vim'
"Nerdtree
"Plugin 'scrooloose/nerdtree'
"GitGutter
Plugin 'airblade/vim-gitgutter'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
" "
" " Brief help
" " :PluginList - lists configured plugins
" " :PluginInstall - installs plugins; append `!` to update or just
" :PluginUpdate
" " :PluginSearch foo - searches for foo; append `!` to refresh local cache
" " :PluginClean - confirms removal of unused plugins; append `!` to
" auto-approve removal
" "
" " see :h vundle for more details or wiki for FAQ
" " Put your non-Plugin stuff after this line
set showcmd "The bottom line in your editor will show you information about the current command going on"
"set relativenumber
set number
syntax on "Enable syntax highlighting
set re=1 "Force using the old regex engine, this improves performances while using ruby syntax
"set synmaxcol=128 "Disable syntax highlight after 128 column (to improve scroll performances)
"syntax sync minlines=256 "Syntax highlight minlines 256 (to improve scroll performances)
:let ruby_no_expensive = 1 "(to improve scroll performances)
filetype on "Enable filetype detection
filetype indent on "Enable filetype-specific indenting
filetype plugin on "Enable filetype-specific plugins
:set tabstop=4 shiftwidth=4 expandtab "no tabs in the source file, all tab characters are 4 space characters
"Automatically set fold level to each opened
:set foldlevelstart=1
" Use a line cursor within insert mode and a block cursor everywhere else.
"
" Reference chart of values:
" Ps = 0 -> blinking block.
" Ps = 1 -> blinking block (default).
" Ps = 2 -> steady block.
" Ps = 3 -> blinking underline.
" Ps = 4 -> steady underline.
" Ps = 5 -> blinking bar (xterm).
" Ps = 6 -> steady bar (xterm).
let &t_SI = "\e[6 q"
let &t_EI = "\e[2 q"
"Open a vertical help with the :Help and :H command
command -nargs=* -complete=help Help vertical belowright help <args>
command -nargs=* -complete=help H vertical belowright help <args>
"Search
:set hlsearch "highlight search results
"Double tap ESC to remove search highlighting
:nnoremap <silent><esc> :noh<CR>
:nnoremap <esc>^[ <esc>^[
"color Theme
set background=dark
colorscheme Tomorrow-Night-Eighties
"line number color
hi LineNr ctermfg=white
"zsh ex command autocoplete style
set wildmenu
set wildmode=full
"raise history limit
set history=200
"reduce time before buffer is written to swap (makes gitgutter updates instant)
set updatetime=100
"use ruby syntax highlighting for Podfile
au BufRead,BufNewFile Podfile set filetype=ruby
"use ruby syntax highlighting for Fastlane configuration files
au BufRead,BufNewFile Fastfile set filetype=ruby
au BufRead,BufNewFile Deliverfile set filetype=ruby
au BufRead,BufNewFile Appfile set filetype=ruby
au BufRead,BufNewFile MatchFile set filetype=ruby
"use ruby syntax highlighting for gems configuration files
au BufRead,BufNewFile Gemfile set filetype=ruby
au BufRead,BufNewFile Guardfile set filetype=ruby "config file for guard gem
"Make the backspace work like in most other programs
set backspace=indent,eol,start
"Add python tags file for *.py files, to generate this file run the
"'ctagsPythonGen' script
au Filetype python set tags+=~/Development/tags/python.tags
"Open new split panes to right and bottom, which feels more natural than Vim’s default
set splitbelow
set splitright
"Enable mouse for all (a) modes
:set mouse=a
" Line numbers: automatic switch between relative in NORMAL and absolute in
" INSERT and when editor doens't have focus
" https://jeffkreeftmeijer.com/vim-number/
:set number
:augroup numbertoggle
: autocmd!
: autocmd BufEnter,FocusGained,InsertLeave,WinEnter * if &nu && mode() != "i" | set rnu | endif
: autocmd BufLeave,FocusLost,InsertEnter,WinLeave * if &nu | set nornu | endif
:augroup END