-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.local
57 lines (55 loc) · 1.73 KB
/
.vimrc.local
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
" This file will be loaded at the end of .vimrc.
" This file is designed to add your own vim scripts or override the exVim's .vimrc settings.
set number
set tags=tags;
let g:vimfiler_as_default_explorer = 1
let g:vimfilter_enable_auto_cd = 1
set nocompatible " Disable vi-compatibility
set laststatus=2 " Always show the statusline
set encoding=utf-8 " Necessary to show Unicode glyphsll Vex
set tabstop=4 softtabstop=4 expandtab shiftwidth=4 smarttab
set list!
set listchars=tab:>.,trail:.,extends:\#,nbsp:.
set hlsearch
set colorcolumn=110
set autoread
set autowriteall
highlight ColorColumn ctermbg=darkgray
map <F3> :tabnew <CR>
map <F5> :tabprev <CR>
map <F6> :tabnext <CR>
:map <C-C> :NERDTree <CR>
" Find file in current directory and edit it.
function! Find(name)
let l:list=system("find . -name '".a:name."' | perl -ne 'print \"$.\\t$_\"'")
" replace above line with below one for gvim on windows
" let l:list=system("find . -name ".a:name." | perl -ne \"print qq{$.\\t$_}\"")
let l:num=strlen(substitute(l:list, "[^\n]", "", "g"))
if l:num < 1
echo "'".a:name."' not found"
return
endif
if l:num != 1
echo l:list
let l:input=input("Which ? (CR=nothing)\n")
if strlen(l:input)==0
return
endif
if strlen(substitute(l:input, "[0-9]", "", "g"))>0
echo "Not a number"
return
endif
if l:input<1 || l:input>l:num
echo "Out of range"
return
endif
let l:line=matchstr("\n".l:list, "\n".l:input."\t[^\n]*")
else
let l:line=l:list
endif
let l:line=substitute(l:line, "^[^\t]*\t./", "", "")
execute ":e ".l:line
endfunction
command! -nargs=1 Find :call Find("<args>")
autocmd TextChanged,TextChangedI <buffer> silent write
;autocmd BufWritePost *.py !yapf -i <afile> :e