-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
22 lines (19 loc) · 970 Bytes
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
vim.cmd [[colorscheme torte]]
vim.cmd [[let g:rustfmt_autosave = 1]]
vim.cmd [[:autocmd FileType lua setlocal tabstop=4 shiftwidth=4 expandtab]]
vim.wo.number = true
vim.wo.relativenumber = true
-- Triger `autoread` when files changes on disk
-- https://unix.stackexchange.com/questions/149209/refresh-changed-content-of-file-opened-in-vim/383044#383044
-- https://vi.stackexchange.com/questions/13692/prevent-focusgained-autocmd-running-in-command-line-editing-mode
vim.api.nvim_create_autocmd({'FocusGained', 'BufEnter', 'CursorHold', 'CursorHoldI'}, {
pattern = '*',
command = "if mode() !~ '\v(c|r.?|!|t)' && getcmdwintype() == '' | checktime | endif",
})
-- Notification after file change
-- https://vi.stackexchange.com/questions/13091/autocmd-event-for-autoread
vim.api.nvim_create_autocmd({'FileChangedShellPost'}, {
pattern = '*',
command = "echohl WarningMsg | echo 'File changed on disk. Buffer reloaded.' | echohl None",
})
require("config.lazy")