-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
executable file
·93 lines (78 loc) · 1.79 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
" Appearance
colorscheme desert256
highlight cursorline guibg=#111111
set nocompatible
set number
set relativenumber
set cursorline
set ruler
set visualbell
let &statusline = '[%{toupper(mode())}] %(%F%m%r%) %= %(%c,%l %p%%%)'
set laststatus=2
set splitbelow
set splitright
" Tabs and indentation
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent
set smartindent
set cindent
set cino=(0
" Files and paths
set encoding=utf-8
set autoread
set noswapfile
syntax on
filetype on
filetype plugin on
filetype indent on
let filetype_m='objc'
set tags=tags;/
set wildignore=*.swp,*.bak,*.pyc
au! BufEnter *.py setlocal tabstop=4 shiftwidth=4 makeprg=nosetests\ %
au! BufEnter *.rb setlocal tabstop=4 shiftwidth=4 makeprg=ruby\ %
au! FileType python setlocal omnifunc=pythoncomplete#Complete
" Search
set hlsearch
set incsearch
set ic
set wildmode=longest:full
set wildmenu
set complete-=i
set backspace=start,indent,eol
set listchars=tab:>-,trail:#,eol:$
" Shell
set shellcmdflag=-ci
" Custom mappings
let mapleader=","
map <leader>c :make<CR> :cw<CR>
map <leader>d :ts /
map <leader><S-d> :ts /<C-r><C-w><CR>
nmap <leader>w :%s/\ \+$//g<CR>
nmap <leader><LEFT> :diffget //2<CR> :diffup<CR>
nmap <leader><RIGHT> :diffget //3<CR> :diffup<CR>
nmap <leader><DOWN> ]c
nmap <leader><UP> [c
nmap <leader>. @:
nmap <leader>/ :nohlsearch<CR>
nmap <leader>r :\.,\.+$v:count1
nmap <leader><S-r> :'<,'>s/
runtime! init/**.vim
function! Getrange(type)
let low = getpos("'[")[1]
let high = getpos("']")[1]
let com = string(low) . "," . string(high) . "s/"
:<c-r>=com<cr>
endfunction
nmap <silent> <F4> :set opfunc=Getrange<CR>g@
function! ToggleNumbers()
if &number
set nonumber
set norelativenumber
else
set number
set relativenumber
endif
endfunction
nmap <silent> <leader>n :call ToggleNumbers()<CR>