aboutsummaryrefslogtreecommitdiff
path: root/init.vim
blob: 048b54e942d9afe3dd65d6c209236cf26d14ea4b (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
" for long lines
set wrap

" tab business
set tabstop=8
set softtabstop=4
set shiftwidth=4
set expandtab

set autoindent

" syntax highlighting
syntax on

set nohlsearch

" try to detect filetypes
filetype on

" enable loading indent file for filetype
filetype plugin indent on

" line numbers
set number

" cursor line
set cursorline

" enable mouse
set mouse=a

" set term title
set title
set titleold=

source ~/.config/nvim/plugins.vim

set laststatus=2

" vim-autoformat (C-F5)
"
noremap <F29> :Autoformat<CR>
au BufWrite *.py,*.c,*.h,*.cpp :Autoformat

" enable omnicompletion
set omnifunc=syntaxcomplete#Complete

" looks nice
set termguicolors
set background=dark

let g:tokyonight_italic_keywords = 0
let g:tokyonight_colors = {
  \ 'comment': '#5e6691',
  \ 'fg_gutter': '#505777',
\ }
let g:tokyonight_day_brightness = 0.2

colorscheme tokyonight

" toggle spell check
map <leader>s :set spell! spelllang=en_gb<CR>

" show tabs and EOL whitespace
:set list listchars=tab:»·,trail:·

" for tmux, screen, etc
set t_ut=

" default is too slow
set updatetime=500

" re-read the file if changed (if possible)
set autoread
au BufEnter,CursorHold,CursorHoldI * silent! checktime

" NERDTree
"
map <leader>n :NERDTreeToggle<CR>
let NERDTreeQuitOnOpen=1

" Telescope
"
nnoremap <leader>f <cmd>Telescope find_files<CR>
nnoremap <leader>B <cmd>Telescope buffers<CR>

" vim-markdown
"
let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_conceal_code_blocks = 0
autocmd FileType markdown setlocal conceallevel=2

" git gutter to play nice with others
"
let g:gitgutter_sign_allow_clobber = 0

" Required for operations modifying multiple buffers like rename.
set hidden

" better for some messages
set cmdheight=2
set shortmess+=c
" for lsc erros
set shortmess-=F

" disable preview when doing auto-complete
set completeopt-=preview

" Set completeopt to have a better completion experience
set completeopt=menuone,noinsert,noselect

" EOF