1
1
" vim-sublime - A minimal Sublime Text -like vim experience bundle
2
2
" http://github.com/grigio/vim-sublime
3
+ " Best view with a 256 color terminal and Powerline fonts
3
4
4
- " NB: You need a terminal with 256 colors support
5
-
6
- set nocompatible " be iMproved
7
- filetype off " required!
8
-
5
+ set nocompatible
6
+ filetype off
9
7
set rtp += ~/.vim/bundle/vundle/
10
8
call vundle#rc ()
11
-
12
- " let Vundle manage Vundle
13
- " required!
14
9
Bundle ' gmarik/vundle'
15
- filetype plugin indent on " required!
16
10
17
- "
18
- " vim-sublime basic bundles here:
19
- "
20
- Bundle ' L9'
21
11
Bundle ' tpope/vim-surround'
22
- Bundle ' tomtom/tcomment_vim'
23
12
Bundle ' gcmt/breeze.vim'
24
- Bundle ' bling/vim-airline'
25
- " Bundle 'Raimondi/delimitMate'
26
13
Bundle ' kien/ctrlp.vim'
14
+ Bundle ' SirVer/ultisnips'
15
+ Bundle ' tomtom/tcomment_vim'
16
+ Bundle ' bling/vim-airline'
17
+ Bundle ' airblade/vim-gitgutter'
27
18
28
19
" Color Themes
29
20
Bundle ' flazz/vim-colorschemes'
30
-
31
- " My settings
32
21
colorscheme Monokai
33
- set paste
34
- syntax on
35
-
36
- set noerrorbells " No beeps
37
- set number " Show line numbers
38
- set backspace = indent ,eol ,start " Makes backspace key more powerful.
39
- set showcmd " Show me what I'm typing
40
- set showmode " Show current mode.
41
-
42
- set noswapfile " Don't use swapfile
43
- set nobackup " Don't create annoying backup files
44
- set splitright " Split vertical windows right to the current windows
45
- set splitbelow " Split horizontal windows below to the current windows
46
- set encoding = utf- 8 " Set default encoding to UTF-8
47
- set autowrite " Automatically save before :next, :make etc.
48
- set autoread " Automatically reread changed files without asking me anything
49
- set laststatus = 2
50
22
51
- set fileformats = unix,dos,mac " Prefer Unix over Windows over OS 9 formats
23
+ " """""""
24
+ if has (' autocmd' )
25
+ filetype plugin indent on
26
+ endif
27
+ if has (' syntax' ) && ! exists (' g:syntax_on' )
28
+ syntax enable
29
+ endif
30
+
31
+ " Use :help 'option' to see the documentation for the given option.
32
+ set autoindent
33
+ set backspace = indent ,eol ,start
34
+ set complete -= i
35
+ set showmatch
36
+ set showmode
37
+ set smarttab
38
+
39
+ set nrformats -= octal
40
+ set shiftround
41
+
42
+ set ttimeout
43
+ set ttimeoutlen = 50
52
44
53
- set showmatch " Do not show matching brackets by flickering
54
- set incsearch " Shows the match while typing
55
- set hlsearch " Highlight found searches
56
- set ignorecase " Search case insensitive...
57
- set smartcase " ... but not when search pattern contains upper case characters
45
+ set incsearch
46
+ " Use <C-L> to clear the highlighting of :set hlsearch.
47
+ if maparg (' <C-L>' , ' n' ) == # ' '
48
+ nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
49
+ endif
50
+
51
+ set laststatus = 2
52
+ set ruler
53
+ set showcmd
54
+ set wildmenu
58
55
59
- set switchbuf = usetab,newtab " open new buffers always in new tabs
56
+ set autoread
60
57
58
+ set encoding = utf- 8
61
59
set tabstop = 2 shiftwidth = 2 expandtab
62
60
set listchars = tab :▒░,trail: ▓
63
61
set list
64
62
63
+ inoremap <C-U> <C-G> u<C-U>
64
+
65
+ set number
66
+ set hlsearch
67
+ set ignorecase
68
+ set smartcase
69
+
70
+ " Don't use Ex mode, use Q for formatting
71
+ map Q gq
72
+
73
+ " In many terminal emulators the mouse works just fine, thus enable it.
74
+ if has (' mouse' )
75
+ set mouse = a
76
+ endif
77
+
78
+ " do not history when leavy buffer
79
+ set hidden
80
+
81
+ " FIXME: (broken) ctrl s to save
82
+ noremap <C-S> :update<CR>
83
+ vnoremap <C-S> <C-C> :update<CR>
84
+ inoremap <C-S> <Esc> :update<CR>
85
+
86
+ set nobackup
87
+ set nowritebackup
88
+ set noswapfile
89
+ set fileformats = unix,dos,mac
90
+
91
+ " exit insert mode
92
+ inoremap <C-c> <Esc>
93
+
94
+ set completeopt = menuone,longest,preview
95
+
96
+ "
97
+ " Plugins config
98
+ "
99
+
100
+ " CtrlP
101
+ set wildignore += * /.git/ * ,* /.hg/ * ,* /.svn/ *
102
+
103
+ " Ultisnip
104
+ " NOTE: <f1> otherwise it overrides <tab> forever
105
+ let g: UltiSnipsExpandTrigger= " <f1>"
106
+ let g: UltiSnipsJumpForwardTrigger= " <f1>"
107
+ let g: UltiSnipsJumpBackwardTrigger= " <c-k>"
108
+ let g: did_UltiSnips_vim_after = 1
109
+
110
+ " vim-airline
111
+ let g: airline #extensions#tabline #enabled = 1
112
+ let g: airline_powerline_fonts = 1
113
+
65
114
"
66
115
" Basic shortcuts definitions
67
116
" most in visual mode / selection (v or ⇧ v)
@@ -70,8 +119,8 @@ set list
70
119
" Find
71
120
map <C-f> /
72
121
" indend / deindent after selecting the text with (⇧ v), (.) to repeat.
73
- vmap <Tab> >
74
- vmap <S-Tab> <
122
+ vnoremap <Tab> >
123
+ vnoremap <S-Tab> <
75
124
" comment / decomment & normal comment behavior
76
125
vmap <C-m> gc
77
126
" Disable tComment to escape some entities
@@ -98,10 +147,16 @@ nnoremap <C-t> :tabnew<CR>
98
147
inoremap <C-t> <Esc> :tabnew<CR> i
99
148
nnoremap <C-k> :tabclose<CR>
100
149
inoremap <C-k> <Esc> :tabclose<CR> i
101
- "
102
- " Your overrides
103
- "
104
- if isdirectory (expand (" $HOME/.vim/" ))
105
- source $HOME /.vim/ packages.vim
106
- source $HOME /.vim/ shortcuts.vim
150
+
151
+ " lazy ':'
152
+ map \ :
153
+
154
+ let mapleader = ' ,'
155
+ nnoremap <Leader> p :set paste<CR>
156
+ nnoremap <Leader> o :set nopaste<CR>
157
+ noremap <Leader> g :GitGutterToggle<CR>
158
+
159
+ " this machine config
160
+ if filereadable (expand (" ~/.vimrc.local" ))
161
+ source ~/.vimrc.local
107
162
endif
0 commit comments