-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
172 lines (138 loc) · 4.97 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
set nocompatible
syntax enable
set encoding=utf-8
"setting vundler
filetype off
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
source ~/.vim/bundles.vim
set t_Co=256
set background=dark
color solarized
filetype plugin indent on
set number
set ruler " show the cursor position all the time
set cursorline
set showcmd " display incomplete commands
" Allow backgrounding buffers without writing them, and remember marks/undo
" for backgrounded buffers
set hidden
set winheight=25
set winminheight=5
" Setting rules
set colorcolumn=120
"Whitespace
set nowrap " don't wrap lines
set tabstop=2 " a tab is two spaces
set shiftwidth=2 " an autoindent (with <<) is two spaces
set expandtab " use spaces, not tabs
set list " Show invisible characters
set backspace=indent,eol,start " backspace through everything in insert mode
" List chars
set listchars="" " Reset the listchars
set listchars=tab:\ \ " a tab should display as " ", trailing whitespace as "."
set listchars+=trail:. " show trailing spaces as dots
set listchars+=extends:> " The character to show in the last column when wrap is
" off and the line continues beyond the right of the screen
set listchars+=precedes:< " The character to show in the last column when wrap is
" off and the line continues beyond the right of the screen
"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
if has("autocmd")
" In Makefiles, use real tabs, not tabs expanded to spaces
au FileType make set noexpandtab
" Make sure all mardown files have the correct filetype set and setup wrapping
au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn,txt} setf markdown | call s:setupWrapping()
" Treat JSON files like JavaScript
au BufNewFile,BufRead *.json set ft=javascript
" make Python follow PEP8 ( http://www.python.org/dev/peps/pep-0008/ )
au FileType python set softtabstop=4 tabstop=4 shiftwidth=4 textwidth=79
" Remember last location in file, but not for commit messages.
" see :help last-position-jump
au BufReadPost * if &filetype !~ '^git\c' && line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g`\"" | endif
endif
" provide some context when editing
set scrolloff=3
" mouse configs
set mouse=a
set ttymouse=xterm2
set clipboard=unnamed
" don't use Ex mode, use Q for formatting
map Q gq
" clear the search buffer when hitting return
:nnoremap <CR> :nohlsearch<cr>
let mapleader=","
map <leader>gg :topleft 100 :split Gemfile<cr>
" http://vimcasts.org/e/14
cnoremap %% <C-R>=expand('%:h').'/'<cr>
map <leader>vs :vsplit<cr>
map <leader>sp :split<cr>
nnoremap <leader><leader> <c-^>
" find merge conflict markers
nmap <silent> <leader>cf <ESC>/\v^[<=>]{7}( .*\|$)<CR>
command! KillWhitespace :normal :%s/ *$//g<cr><c-o><cr>
" easier navigation between split windows
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
" moving lines up and down
nnoremap <c-j> :m .+1<CR>==
nnoremap <c-k> :m .-2<CR>==
vnoremap <c-J> :m '>+1<CR>gv=gv
vnoremap <c-K> :m '<-2<CR>gv=gv
" vim-airline plugin
let g:airline_solarized_bg='dark'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>- <Plug>AirlineSelectPrevTab
nmap <leader>+ <Plug>AirlineSelectNextTab
" ctrl-p configs
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*/node_modules/*,*/vendor/*
" ctrl-p shortcuts
map <leader>p :CtrlP<cr>
" disable cursor keys in normal mode
map <Left> :echo "Solta essa porra!"<cr>
map <Right> :echo "Solta essa porra!"<cr>
map <Up> :echo "Solta essa porra!"<cr>
map <Down> :echo "Solta essa porra!"<cr>
map <M> :echo "fu"<cr>
" tabs
nnoremap <C-t> :tabnew<CR>
nnoremap <C-D> :tabclose<CR>
nnoremap <leader>1 1gt
nnoremap <leader>2 2gt
nnoremap <leader>3 3gt
nnoremap <leader>4 4gt
nnoremap <leader>5 5gt
nnoremap <leader>6 6gt
nnoremap <leader>7 7gt
nnoremap <leader>8 8gt
nnoremap <leader>9 9gt
nnoremap <leader>0 :tablast<cr>
" no more backup or swap file
set nobackup
set noswapfile
" find in project
map <F4> :execute "vimgrep /" . expand("<cword>") . "/j **" <Bar> cw<CR>
let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctrlp_custom_ignore = '\v[\/](vendor)$'
let g:ctrlp_custom_ignore = '\v[\/](node_modules)$'
if has("statusline") && !&cp
set laststatus=2 " always show the status bar
set statusline=%F%m%r%h%w
set statusline+=\ %{fugitive#statusline()}\
set statusline+=\ [line\ %l\/%L]
set statusline+=%=
set statusline+=\[%{strftime('%a\ %H:%M\')}]
endif
" Emmet html
let g:user_emmet_leader_key='<C-Z>'
augroup VimCSS3Syntax
autocmd!
autocmd FileType css setlocal iskeyword+=-
augroup END