This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc.local
135 lines (105 loc) · 3.78 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
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
" Set up the proper snippet author
let g:snips_author = 'Jakub Z <jakzale@gmail.com>'
"inoremap <esc> <nop>
inoremap jk <esc>
" Shortcuts for switching background
nnoremap <Leader>bl :set background=light<CR>
nnoremap <Leader>bd :set background=dark<CR>
augroup my_markdown
autocmd!
" Adding support for Marked.app
autocmd FileType markdown :nnoremap <Leader>m :silent !open -a Marked\ 2 '%:p'<CR>:redraw!<CR>
autocmd FileType markdown set wrap linebreak nolist
"autocmd FileType markdown :set wm=2
" Add additional row below the row -- still not shure how to solve this
" one
autocmd FileType markdown :nnoremap <Leader>h yypVr-<CR>
autocmd FileType markdown :nnoremap <Leader>H yypVr=<CR>
" Adding shortcuts for underlying
if has("gui_running")
autocmd FileType markdown let &showbreak='↳'
else
autocmd FileType markdown let &showbreak='↳ '
endif
augroup END
augroup my_autosave
autocmd!
" Autosave whenever you loose focus
autocmd FocusLost * silent! wall
augroup END
let g:LatexBox_viewer = "open"
" Haskell support
let g:haddock_browser = "open"
let g:haddock_browser_callformat = "%s %s"
" Support for latex viewing
augroup my_latex
autocmd!
autocmd FileType tex nnoremap <silent> <LocalLeader>ls :silent
\ !/Applications/Skim.app/Contents/SharedSupport/displayline
\ <C-R>=line('.')<CR> "<C-R>=LatexBox_GetOutputFile()<CR>"
\ "%:p" <CR>:redraw!<CR>
autocmd FileType tex set textwidth=79
augroup END
" Ignore Angularjs proprietary prefixes
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"]
" Ensuring proper colors for the gui
if has('gui_running')
let g:js_context_colors = [7, 64, 136, 33, 160, 37, 125]
endif
" Context colouring for javascript
augroup my_javascript
autocmd!
autocmd FileType javascript nnoremap <Leader>t :JSContextColorToggle<CR>
augroup END
" Disable context colouring globally -- too slow
let g:js_context_colors_enabled = 0
" Disable TypeScript checkers for now
let g:syntastic_typescript_checkers = ['tslint']
" Fixing the colorscheme
function! s:fix_color_scheme()
highlight clear SignColumn
highlight clear LineNr
" Fixing the color of the omnicomplete window
hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray
hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE
endfunction
augroup FixingColorScheme
autocmd!
autocmd ColorScheme * call <SID>fix_color_scheme()
augroup END
" Setting up the distraction free writing
function! s:goyo_enter()
" Go to the beginning of the line --- prevents usually shifted screen
normal ^
Limelight
endfunction
function s:goyo_leave()
Limelight!
endfunction
autocmd! User GoyoEnter
autocmd! User GoyoLeave
autocmd User GoyoEnter call <SID>goyo_enter()
autocmd User GoyoLeave call <SID>goyo_leave()
let g:goyo_width = 100
nnoremap <Leader>, :Goyo<CR>
" Custom configuration for latexbox
let g:LatexBox_quickfix=2
let g:LatexBox_latexmk_async=1
" Ensure that the background is set properly
if filereadable(expand("~/.vimrc.background"))
source ~/.vimrc.background
endif
" Disable syntastic for Haskell -- too much hassle atm
" let g:syntastic_mode_map = { "mode": "active",
" \ "active_filetypes": [],
" \ "passive_filetypes": ["haskell"] }
" Change haskell checker to hlint only, the other ones are too severe
let g:syntastic_haskell_checkers=['hlint']
" Ensure that quick fix is always at the bottom (splits difficult to read)
augroup my_quickfix
autocmd!
autocmd FileType qf wincmd J
augroup END
" Ensure that you do not redraw when not needed
set lazyredraw