summaryrefslogtreecommitdiffstats
path: root/.config/nvim/init.vim
blob: 4bc605c73cf616e56db599a634db0f58dc3ea6ba (plain) (blame)
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
" Set options
set nocompatible
let mapleader =","
set backspace=indent,eol,start
set clipboard+=unnamedplus
set ignorecase
set linebreak
set mouse=a
set nohlsearch
set number
set smartcase
set title
set titlestring=%f\ %m
syntax on

" Key remapping
inoremap <C-H> <C-W>
inoremap <C-Del> X<Esc>ce<del>

" Automatically deletes all trailing whitespace and newlines at end of file on save.
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritepre * %s/\n\+\%$//e

" Reloads programs when config file is updated.
autocmd BufWritePost ~/.config/picom/picom.conf !pkill -USR1 picom
autocmd BufWritePost ~/.config/polybar/config !pkill -USR1 polybar
autocmd BufWritePost ~/.config/sxhkd/sxhkdrc !pkill -USR1 sxhkd
autocmd BufWritePost ~/.config/termite/config !pkill -USR1 termite