-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
69 lines (53 loc) · 1.98 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
set nocompatible
" relative line number
set relativenumber
" tab settings
set tabstop=8 " maximum width of tab measured in spaces
set softtabstop=0 " never combine tab chars and spaces
set shiftwidth=4 " size of indent measured in spaces
set expandtab " insert shifwidth number of spaces instead of tab char
set smarttab " insert spaces automatically for next indent
" only one unique clipboard -> makes copying from internet to vim easier
set clipboard=unnamed
" add highlighting while searching
set incsearch
" split default below and vsplit default right
set splitbelow splitright
" remap leader key
let mapleader=','
let maplocalleader=","
" check filetype
filetype plugin indent on
" python, markdown and julia compile key remap
autocmd FileType python noremap <leader><space> :w <CR> :term python3.11 %<CR>
autocmd FileType markdown noremap <leader><space> :w <CR> :! pandoc -s % -o out.pdf<CR> :! open out.pdf <CR><CR>
autocmd FileType julia noremap <leader><space> :w <CR> :term julia %<CR>
" autowrite when entering normal mode
autocmd InsertLeave *.tex update
" cpp compile key remaps
autocmd FileType cpp noremap <leader><space> :w <CR> :silent make\|redraw!\|cc<CR>
autocmd FileType cpp noremap <leader>ci :w <CR> :terminal ./a.out<CR>
autocmd FileType cpp noremap <leader>co :w <CR> :tab terminal ./a.out<CR>
autocmd FileType cpp noremap <leader>cf :cn<CR>
autocmd FileType cpp noremap <leader>cd :cp<CR>
autocmd FileType cpp noremap <leader>cw :cw<CR>
autocmd FileType cpp noremap <leader>cc :cc<CR>
" external plugins
call plug#begin('~/.vim/plugged')
Plug 'jacoborus/tender.vim'
Plug 'NLKNguyen/papercolor-theme'
Plug 'tribela/vim-transparent'
Plug 'JuliaEditorSupport/julia-vim'
Plug 'plasticboy/vim-markdown'
Plug 'lervag/vimtex'
call plug#end()
let g:python_highlight_all = 1
" using external colorscheme
" colorscheme tender
" colorscheme blue terminal
set background=dark
colorscheme Papercolor
" skim pdf viewer for vimtex
let g:vimtex_view_method='skim'
" syntax highlighting
syntax on