-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_vimrc
240 lines (203 loc) · 5.89 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
" vim: nowrap fdm=marker
" vim-plug config {{{1
call plug#begin('~/vimfiles/plugged')
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-sleuth'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree'
Plug 'Raimondi/delimitMate'
Plug 'godlygeek/tabular'
Plug 'chrisbra/NrrwRgn'
Plug 'mileszs/ack.vim'
Plug 'kien/ctrlp.vim'
Plug 'd11wtq/ctrlp_bdelete.vim'
Plug 'derekwyatt/vim-scala'
Plug 'AutoComplPop'
Plug 'ervandew/supertab'
"Plug 'svermeulen/vim-easyclip'
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-indent'
Plug 'kana/vim-textobj-function'
Plug 'AfterColors.vim'
Plug 'chriskempson/vim-tomorrow-theme'
Plug 'altercation/vim-colors-solarized'
Plug 'tpope/vim-flagship'
Plug 'bootleq/ShowMarks'
call plug#end()
" }}}
language messages en
set showmode
set hidden
set foldmethod=syntax
set smartindent
set expandtab
set tabstop=4 expandtab shiftwidth=4
set formatoptions-=t
set wildmode=list:longest,full
set ignorecase
set smartcase
set number
set hlsearch
set wrap
set nobackup
set nowritebackup
set noswapfile
set mouse=a
set showmatch
set cursorline
set encoding=utf-8
set colorcolumn=100
set vb t_vb=
set nolist
set listchars=tab:▸–,trail:·,nbsp:¬
let mapleader = ","
set scrolloff=3
set pastetoggle=<F2>
nnoremap <silent> <F2> :set invpaste paste?<CR>
" Para siempre copiar del unnamed al * y viceversa
set clipboard=unnamed
" Color Scheme
colorscheme Tomorrow
set showtabline=2
set guioptions-=e
set laststatus=2
set statusline=[%n]\ %f\ %m%y%r%h%w%=%-35.(%{&fenc==\"\"?&enc:&fenc}\ [%{&ff}]\ [%L,%p%%]\ [%l,%c%V]\ %)%P
" Para que inicie el pwd en ~
cd ~
" Para los .log
au BufRead,BufNewFile *.log set filetype=text
" Para los markdown
au BufRead,BufNewFile *.md,*.markdown set filetype=markdown
" Custom mappings and functions {{{2
" Save
nnoremap <Leader>w :w<Enter>
" Delete a word to the right
imap <C-d> <C-o>diw
" Override the read-only permissions
cmap w!! %!sudo tee > /dev/null %
" Copy the path of the actual file
function! MeGetFilePath()
let @+ = expand("%:p")
let @* = expand("%:p")
endfunction
" Force yourself to stop using arrow keys
noremap <Up> <Nop>
noremap <Down> <Nop>
noremap <Left> <Nop>
noremap <Right> <Nop>
inoremap <Up> <Nop>
inoremap <Down> <Nop>
inoremap <Left> <Nop>
inoremap <Right> <Nop>
" Mappings {{{1
" Override defaults {{{2
nnoremap Q <Nop>
nnoremap <space> za
nnoremap j gj
nnoremap k gk
" File opening {{{2
cnoremap <expr> %% getcmdtype() == ':' ? fnameescape(expand('%:h')).'/' : '%%'
map <leader>ew :e %%
map <leader>es :sp %%
map <leader>ev :vsp %%
map <leader>et :tabe %%
map <Leader><Tab> :b#<CR>
map <Leader>n :new<CR>
map <Leader>d :bd<CR>
map <Leader>D :bd!<CR>
map <Leader>W :w \| bd<CR>
map <Leader>h :hide<CR>
" Visual line repeat {{{2
xnoremap . :normal .<CR>
xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR>
function! ExecuteMacroOverVisualRange()
echo "@".getcmdline()
execute ":'<,'>normal @".nr2char(getchar())
endfunction
" Smash Escape {{{2
inoremap jk <Esc>
inoremap kj <Esc>
inoremap JK <Esc>
inoremap KJ <Esc>
" Plugin Configuration {{{1
" Flagship {{{2
" Quit the defaul showing Vim GUI server name
let g:tabprefix=''
autocmd User Flags call Hoist("buffer", "%{&ignorecase ? '[IC]' : ''}")
" ShowMarks {{{2
let g:showmarks_auto_toggle = 0
let g:showmarks_ignore_type = "h"
" NerdTree {{{2
map <Leader>l :NERDTreeToggle<CR>
map <Leader>L :NERDTree<CR>
map <leader>nt :NERDTreeFind<CR>
let NERDTreeShowBookmarks=1
let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr']
let NERDTreeChDirMode=2
let NERDTreeQuitOnOpen=1
let NERDTreeMouseMode=2
let NERDTreeShowHidden=1
let NERDTreeKeepTreeInNewTab=1
let g:nerdtree_tabs_open_on_gui_startup=0
" CtrlP {{{2
silent! nnoremap <unique> <silent> <Leader>p :CtrlP<CR>
silent! nnoremap <unique> <silent> <Leader>b :CtrlPBuffer<CR>
silent! nnoremap <unique> <silent> <Leader>T :CtrlPTag<CR>
silent! nnoremap <unique> <silent> <Leader>t :CtrlPBufTag<CR>
silent! nnoremap <unique> <silent> <Leader>r :CtrlPMRUFiles<CR>
silent! nnoremap <unique> <silent> <Leader>o :CtrlPBookmarkDir<CR>
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$',
\ 'file': '\.pyc$\|\.pyo$\|\.rbc$|\.rbo$\|\.class$\|\.o$\|\~$\',
\ 'link': 'some_bad_symbolic_links',
\ }
let g:ctrlp_map = ''
let g:ctrlp_follow_symlinks = 1
let g:ctrlp_extensions = ['bookmarkdir']
let g:ctrlp_working_path_mode = 0
let g:ctrlp_match_window='max:30'
call ctrlp_bdelete#init()
" Tabular {{{2
" Invoke by <leader>= alignment-character
nnoremap <silent> <leader>= :call g:Tabular(1)<CR>
xnoremap <silent> <leader>= :call g:Tabular(0)<CR>
function! g:Tabular(ignore_range) range
let c = getchar()
let c = nr2char(c)
if a:ignore_range == 0
exec printf('%d,%dTabularize /%s', a:firstline, a:lastline, c)
else
exec printf('Tabularize /%s', c)
endif
endfunction
" EasyClip {{{2
"nmap <silent> gs <plug>SubstituteOverMotionMap
"nmap gss <plug>SubstituteLine
"xmap gs p
"let g:EasyClipUseCutDefaults = 0
"nmap x <Plug>MoveMotionPlug
"xmap x <Plug>MoveMotionXPlug
"nmap xx <Plug>MoveMotionLinePlug
" ag & ack.vim {{{2
let g:ackprg = 'C:\Users\eb75435\vimfiles\utils\ack -s -H --nogroup --nocolor --column'
nnoremap K :AckWindow! "\b<C-R><C-W>\b"<CR>
nnoremap \ :AckWindow!<Space>
nnoremap <Leader>a :Ack<Space>
" SuperTab {{{ 2
let g:SuperTabDefaultCompletionType = "<c-n>"
let g:SuperTabContextDefaultCompletionType = "<c-n>"
" Commands {{{1
" From tpope .vimrc, para el statusline
if has("eval")
function! SL(function)
if exists('*'.a:function)
return ' '.call(a:function,[])
else
return ''
endif
endfunction
endif