-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
177 lines (142 loc) · 3.78 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
set nocompatible
if has('win32') || has('win64')
source $VIMRUNTIME/mswin.vim
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after
endif
" Setup Bundle Support {
" The next three lines ensure that the ~/.vim/bundle/ system works
filetype on
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
" }
" let Vundle manage Vundle
Bundle 'gmarik/vundle'
" My Bundles here:
Bundle 'tpope/vim-fugitive'
Bundle 'kien/ctrlp.vim'
Bundle 'flazz/vim-colorschemes'
Bundle 'matchit.zip'
Bundle 'chriskempson/tomorrow-theme', { "rtp": "vim" }
Bundle "daylerees/colour-schemes", { "rtp": "vim-themes" }
Bundle "mozilla/rust", { "rtp": "src/etc/vim" }
let mapleader = ','
filetype plugin indent on " required!
"mozilla/rust settings
let g:no_rust_conceal = 1
syntax enable
set autoindent
set smartindent
set background=dark
set ttimeout
set ttimeoutlen=50
if has('gui_running')
set lines=40
set columns=150
colorscheme inkpot
set cursorline
if has("gui_gtk2")
set guifont=DejaVu\ Sans\ Mono\ 9
elseif has("gui_photon")
set guifont=DejaVu\ Sans\ Mono:s9
elseif has("gui_kde")
set guifont=DejaVu\ Sans\ Mono/9/-1/5/50/0/0/0/1/0
elseif has("x11")
set guifont=-*-courier-medium-r-normal-*-*-180-*-*-m-*-*
elseif has("win32")
set guifont=DejaVu_Sans_Mono:h9:cANSI
else
set guifont=DejaVu_Sans_Mono:h9:cDEFAULT
endif
endif
set showmode
set ruler
set showcmd
set laststatus=2
set tabstop=4
set softtabstop=4
set smarttab
set shiftwidth=4
set shiftround
set number
set backspace=indent,eol,start
set complete-=i
if has ('x') && has ('gui') " On Linux use + register for copy-paste
set clipboard=unnamedplus
elseif has ('gui') " On mac and Windows, use * register for copy-paste
set clipboard=unnamed
endif
" Allow color schemes to do bright colors without forcing bold.
if &t_Co == 8 && $TERM !~# '^linux'
set t_Co=16
endif
" Change to the directory of the file we're editing
autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
set history=1000
if has('persistent_undo')
set undofile
set undolevels=1000
set undoreload=10000
endif
set incsearch
set ignorecase
set smartcase
set hlsearch
" Use <C-L> to clear the highlighting of :set hlsearch.
if maparg('<C-L>', 'n') ==# ''
nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
endif
" Toggle search highlighting
nmap <silent> <leader>/ :set invhlsearch<CR>
set showmatch
set wildmenu
set wildmode=list:longest,full
set scrolloff=3
set sidescrolloff=5
set display+=lastline
map j gj
map k gk
nnoremap Y y$
set nrformats-=octal
" ctrlp {
let g:ctrlp_working_path_mode = 2
nnoremap <silent> <D-t> :CtrlP<CR>
nnoremap <silent> <D-r> :CtrlPMRU<CR>
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$',
\ 'file': '\.exe$\|\.so$\|\.dll$' }
let g:ctrlp_user_command = {
\ 'types': {
\ 1: ['.git', 'cd %s && git ls-files'],
\ 2: ['.hg', 'hg --cwd %s locate -I .'],
\ },
\ 'fallback': 'find %s -type f'
\ }
"}
function! InitializeDirectories()
let dir_list = {
\ 'backup': 'backupdir',
\ 'views': 'viewdir',
\ 'swap': 'directory' }
if has('persistent_undo')
let dir_list['undo'] = 'undodir'
endif
let common_dir = $HOME . '/.vim'
for [dirname, settingname] in items(dir_list)
let directory = common_dir . dirname . '/'
if exists("*mkdir")
if !isdirectory(directory)
call mkdir(directory)
endif
endif
if !isdirectory(directory)
echo "Warning: Unable to create backup directory: " . directory
echo "Try: mkdir -p " . directory
else
let directory = substitute(directory, " ", "\\\\ ", "g")
exec "set " . settingname . "=" . directory
endif
endfor
endfunction
call InitializeDirectories()
" vim:set ft=vim et sw=2: