summaryrefslogtreecommitdiff
path: root/.config/vimrc
blob: 63f8fe1b7affc6c8bf1f086f3b23638dec17b783 (plain)
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
runtime! archlinux.vim
scriptencoding utf-8

" behaviour
set history=200
set wildmenu
set ruler
set cursorline
set showmatch
set hlsearch
set nocompatible
set backspace=2
set incsearch
set formatoptions+=tcroqn2bmj
"set formatoptions+=1cjmnoqrw
"set formatoptions+=2acjnoqrtw
set relativenumber
set number

" Enable mouse support
set mouse=a

" tabs
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
set smartindent
set textwidth=80
set wrap

" theme
syntax enable

set background=dark
colorscheme jellybeans

" Need to set runtimepath before calling pathogen
set runtimepath=~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after

" adding pathogen
execute pathogen#infect('bundle/{}')
filetype plugin indent on

" encodings
set fileencoding=utf-8
set encoding=utf-8
set ffs=unix

set viminfofile=${XDG_DATA_HOME:-$HOME/.local/share}/viminfo

" some syntastics
"set listchars=space:·\,eol:¬
set listchars=
set list

set grepprg=grep\ -nH\ $*

"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list            = 1
let g:syntastic_check_on_open            = 1
let g:syntastic_check_on_wq              = 0

" filetypes
let g:syntastic_disabled_filetypes=['asm', 's', 'latex', 'tex']

let g:tex_flavor='latex'
let g:vimtex_view_method='zathura'
let g:vimtex_quickfix_mode=0
set conceallevel=2
let g:tex_conceal='abdmg'
"let g:syntastic_tex_checkers=['lacheck']
let g:vimtex_compiler_method = 'latexrun'
let g:vimtex_compiler_latexrun = {
            \ 'backend' : 'jobs',
            \ 'background' : 1,
            \ 'build_dir' : 'latex.out',
            \ 'options' : [
            \   '-verbose-cmds',
            \   '--latex-args="-synctex=1"',
            \ ],
            \}

let g:latex_view_general_viewer = 'zathura'
let g:vimtex_view_method = 'zathura'

function! Synctex()
  " remove 'silent' for debugging
  execute "silent !mv -u latex.out/" . bufname('%')[:-5] . ".synctex.gz ."
  execute "silent !zathura --synctex-forward " . line('.') . ":" . col('.') . ":" . bufname('%') . " " . bufname('%')[:-5] . ".pdf"
  redraw!
endfunction

map <F5> :make<CR>
au BufNewFile,BufRead *.fo setlocal ft=fasto
au BufNewFile,BufRead /tmp/[a-zA-Z0-9]\+/ setlocal ft=sh


match ErrorMsg '\%>80v.\+'
match ErrorMsg ' \+$'
match ErrorMsg '	\+$'

" Remove trailing cancer on write
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritePost *.tex !latexrun --bibtex-cmd="biber" --latex-args="-synctex=1" %
"autocmd BufWritePost *.tex !latexrun --latex-cmd xelatex %
"autocmd BufWritePost *.tex !latexrun --latex-cmd xelatex --bibtex-cmd biber %

set makeprg=GCC_COLORS=\ make

vnoremap // y/\V<C-R>"<CR>

map <ESC>[1;5A <C-Up>
map <ESC>[1;5B <C-Down>
map <ESC>[1;5C <C-Right>
map <ESC>[1;5D <C-Left>
map! <ESC>[1;5A <C-Up>
map! <ESC>[1;5B <C-Down>
map! <ESC>[1;5C <C-Right>
map! <ESC>[1;5D <C-Left>

map <ESC>[1;3C <ESC>:tabnext<CR>
map <ESC>[1;3D <ESC>:tabprevious<CR>

autocmd VimEnter * silent !echo -ne "\e[1 q"