-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
197 lines (186 loc) · 5.61 KB
/
Copy pathvimrc
File metadata and controls
197 lines (186 loc) · 5.61 KB
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
set nocompatible
filetype off
if isdirectory("/Library/TeX/texbin")
let $PATH=$PATH.":/Library/TeX/texbin"
endif
"" VUNDLE
"set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Vunvle must be first
Plugin 'VundleVim/Vundle.vim'
Plugin 'Glench/Vim-Jinja2-Syntax'
Plugin 'altercation/vim-colors-solarized'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'cespare/vim-toml'
Plugin 'croaker/mustang-vim'
Plugin 'jnurmine/Zenburn'
Plugin 'joeytwiddle/sexy_scroller.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'tomasr/molokai'
Plugin 'tpope/vim-eunuch'
Plugin 'tpope/vim-markdown'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-vinegar'
Plugin 'tpope/vim-fugitive'
Plugin 'blerins/flattown'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'hashivim/vim-terraform'
Plugin 'google/vim-maktaba'
Plugin 'google/vim-glaive'
Plugin 'google/vim-codefmt'
Plugin 'bazelbuild/vim-bazel'
Plugin 'vinitkumar/monokai-pro-vim'
Plugin 'valloric/youcompleteme'
" plugins that can't run in restricted vim should go in the try block.
try
Plugin 'mhinz/vim-signify'
catch /E145/
" do something here? I don't care if signify fails silently
endtry
call vundle#end()
filetype plugin indent on
syntax on
syntax enable
set updatetime=200
set modeline
set expandtab
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set number
set relativenumber
set nofoldenable
set nojoinspaces
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
set nowrap
set autoread
set textwidth=79
set formatoptions=qrn1
set pastetoggle=<F2>
set list
set listchars=tab:→\ ,trail:·
set backup
set backupdir=$HOME/.vim/backup,/tmp/backups,/var/tmp/backups,.
set dir=~/.vim/swap,~/local/tmp,/var/tmp,.
set tags=./tags;./TAGS;$HOME
set ttymouse=xterm2
set mouse=a
if exists('+colorcolumn')
set colorcolumn=80
endif
if exists('+undofile')
set undofile
set undodir=$HOME/.vim/undo,/tmp/undos,/var/tmp/undos,.
endif
set guifont=Inconsolata-dz\ for\ Powerline:h16
" Remove annoying scrollbars in macvim
set guioptions=
let mapleader = " "
imap jk <Esc>
nnoremap / /\v
vnoremap / /\v
nnoremap <leader><space> :noh<cr>
nnoremap ; :
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<cr>
nnoremap <leader>q gqip
nnoremap <leader>v V`]
nnoremap <leader>R :RainbowParenthesesToggle<cr>
"nnoremap <leader>N :NERDTreeToggle<cr>
nnoremap <leader>B :buffers<cr>
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Tabbing defaults
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
" Custom tabbing for filetypes
autocmd FileType make,Makefile,mk setlocal tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab
"autocmd FileType python,py,wsgi setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab
autocmd FileType yaml,yml setlocal filetype=yaml.ansible
autocmd BufNewFile,BufRead SCons* set filetype=python
autocmd BufNewFile,BufRead Jenkinsfile,*.dsl set filetype=groovy
set background=light
colorscheme shine
"let g:airline_theme = 'molokai'
"function! SetMacOSColorScheme()
" " Use AppleScript to query macOS appearance
" try
" let l:darkmode = system("osascript -e 'tell app \"System Events\" to tell appearance preferences to get dark mode'")
" if l:darkmode =~? 'true'
" colorscheme molokai " Replace with your preferred dark theme
" else
" colorscheme shine " Replace with your preferred light theme
" endif
" catch /E145/
" " restricted mode, don't worry about it
" endtry
"endfunction
"autocmd VimEnter * call SetMacOSColorScheme()
" Open NERDTree on startup if no files specified
"autocmd vimenter * if !argc() | NERDTree | endif
"autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
"let NERDTreeIgnore=['__pycache__[[dir]]','\.pyc$[[file]]','\.class$[[file]]','\.[oa]$[[file]]','\.orig$']
"
let g:vim_markdown_folding_disabled=1
"let g:solarized_termcolors=256
let g:airline_powerline_fonts=1
let g:netrw_browse_split=4
let g:netrw_altv=1
"let g:netrw_liststyle=3
let g:netrw_banner=0
let g:netrw_winsize=28
let g:go_fmt_command = "goimports"
"let g:go_fmt_autosave = 0 " Disable formats on save
"let g:ycm_autoclose_preview_window_after_completion = 1
"let g:ycm_autoclose_preview_window_after_insertion = 1
let g:neocomplete#enable_at_startup = 1
let g:SexyScroller_DetectPendingKeys = 1
let g:SexyScroller_EasingStyle = 2
let g:SexyScroller_CursorTime = 5
let g:vimtex_latexmk_options = "-pdf -verbose -file-line-error -synctex=1 -interaction=nonstopmode -latex=xelatex"
"let g:vimtex_view_general_viewer = '/Applications/Skim.app/Contents/SharedSupport/displayline'
"let g:vimtex_view_general_options = '-r @line @pdf @tex'
" This adds a callback hook that updates Skim after compilation
let g:vimtex_latexmk_callback_hooks = ['UpdateSkim']
function! UpdateSkim(status)
if !a:status | return | endif
let l:out = b:vimtex.out()
let l:tex = expand('%:p')
let l:cmd = [g:vimtex_view_general_viewer, '-r']
if !empty(system('pgrep Skim'))
call extend(l:cmd, ['-g'])
endif
if has('nvim')
call job_start(l:cmd + [line('.'), l:out, l:tex])
elseif has('job')
call job_start(l:cmd + [line('.'), l:out, l:tex])
else
call system(join(l:cmd + [line('.'), shellescape(l:out), shellescape(l:tex)], ' '))
endif
endfunction
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,ansible_collections
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll|a|o)$',
\ }
let g:ctrlp_working_path_mode = ''
"let g:ctrlp_working_path_mode = 'ra' " default