Mercurial > dotfiles
comparison .chezmoitemplates/init.lua @ 691:989cedcc0a38
chore: remove config.vim
author | zegervdv <zegervdv@me.com> |
---|---|
date | Wed, 05 Oct 2022 09:52:29 +0200 |
parents | 424764c7f51a |
children | 22efd3b888f8 |
comparison
equal
deleted
inserted
replaced
690:424764c7f51a | 691:989cedcc0a38 |
---|---|
982 -- Reload diffs after editing | 982 -- Reload diffs after editing |
983 au.BufWritePost = function() | 983 au.BufWritePost = function() |
984 if vim.o.diff then vim.cmd.diffupdate() end | 984 if vim.o.diff then vim.cmd.diffupdate() end |
985 end | 985 end |
986 | 986 |
987 -- Open file at last position | |
988 au.BufReadPost = function() | |
989 if vim.bo.filetype ~= 'gitcommit' and vim.fn.line '\'"' > 0 and vim.fn.line '\'"' <= vim.fn.line '$' then | |
990 vim.cmd.normal { 'g`"', bang = true } | |
991 end | |
992 end | |
993 | |
994 -- Remove netrw buffers | |
995 au.FileType = { 'netrw', 'setlocal bufhidden=delete' } | |
996 | |
987 -- Terminal | 997 -- Terminal |
988 au.group('enter_term', { | 998 au.group('enter_term', { |
989 { 'TermOpen', '*', 'startinsert!' }, | 999 { 'TermOpen', '*', 'startinsert!' }, |
990 { | 1000 { |
991 'BufEnter', | 1001 'BufEnter', |
999 '*', | 1009 '*', |
1000 function() | 1010 function() |
1001 if vim.bo.buftype == 'terminal' then vim.cmd.stopinsert { bang = true } end | 1011 if vim.bo.buftype == 'terminal' then vim.cmd.stopinsert { bang = true } end |
1002 end, | 1012 end, |
1003 }, | 1013 }, |
1014 }) | |
1015 | |
1016 -- Color number categories in reports and logs | |
1017 au({ 'BufNewFile', 'BufRead', 'BufEnter' }, { | |
1018 '*.rpt,*.log', | |
1019 function() | |
1020 vim.cmd.syntax { 'match', 'String', [["\v<\d{1,3}>"]] } | |
1021 vim.cmd.syntax { 'match', 'Statement', [["\v<\d{4,6}>"]] } | |
1022 vim.cmd.syntax { 'match', 'Function', [["\v<\d{7,9}>"]] } | |
1023 | |
1024 vim.cmd.syntax { 'match', 'Number', [["\v<0+>"]] } | |
1025 | |
1026 vim.cmd.syntax { 'match', 'Error', [["\v\c^error:"]] } | |
1027 | |
1028 vim.wo.wrap = false | |
1029 end, | |
1004 }) | 1030 }) |
1005 | 1031 |
1006 -- Apply changes in chezmoi managed files | 1032 -- Apply changes in chezmoi managed files |
1007 au.group('chezmoi', { | 1033 au.group('chezmoi', { |
1008 { 'BufWritePost', os.getenv 'HOME' .. '/.local/share/chezmoi/*', 'silent !chezmoi apply --source-path %' }, | 1034 { 'BufWritePost', os.getenv 'HOME' .. '/.local/share/chezmoi/*', 'silent !chezmoi apply --source-path %' }, |