new config old version is now on v1 branch

This commit is contained in:
2023-04-30 18:41:13 -04:00
parent 7c5d3eff78
commit 01a09f243c
77 changed files with 1611 additions and 1267 deletions

View File

@ -1,73 +1,48 @@
local function auto(event, opts)
a.nvim_create_autocmd(event, opts)
end
a.nvim_create_augroup('bufcheck', {clear = true})
-- highlight yanks
a.nvim_create_autocmd('TextYankPost', {
group = 'bufcheck',
pattern = '*',
callback = function() vim.highlight.on_yank{timeout = 250} end
})
-- start terminal in insert mode
a.nvim_create_autocmd('TermOpen', {
group = 'bufcheck',
pattern = '*',
command = 'startinsert | set winfixheight'
})
-- close terminal buffers after shell dies
a.nvim_create_autocmd('TermClose', {
auto('TextYankPost', {
group = 'bufcheck',
pattern = 'term://*',
command = 'call nvim_input("<CR>")'
pattern = '*',
callback = function()
vim.highlight.on_yank{ timeout = 250 }
end
})
-- start git messages in insert mode
a.nvim_create_autocmd('FileType', {
group = 'bufcheck',
pattern = { 'gitcommit', 'gitrebase', },
command = 'startinsert | 1'
auto('FileType', {
group = 'bufcheck',
pattern = { 'gitcommit', 'gitrebase', },
command = 'startinsert | 1'
})
-- return to last place
a.nvim_create_autocmd('BufRead', {
auto('BufRead', {
pattern = '*',
command = [[call setpos(".", getpos("'\""))]]
})
-- disable color column in certain files
a.nvim_create_autocmd('FileType', {
pattern = {
'netrw',
"help",
"term",
"gitcommit",
"packer",
"vim",
"Trouble",
"norg",
"alpha"
},
command = 'set colorcolumn=0'
-- start terminal in insert mode
auto('TermOpen', {
group = 'bufcheck',
pattern = '*',
callback = function()
vim.cmd('startinsert | set winfixheight')
o.winfixheight = true
o.cmdheight = 0
end
})
-- disable intent markers in certain files
a.nvim_create_autocmd('FileType', {
pattern = {
'netrw',
"help",
"term",
"gitcommit",
"packer",
"vim",
"Trouble",
"norg",
"alpha"
},
command = 'IndentBlanklineDisable'
})
-- disable extra tildas in certain files
a.nvim_create_autocmd('FileType', {
pattern = '*',
command = 'hi NonText guifg=bg'
-- close terminal buffers after shell dies
auto('TermClose', {
group = 'bufcheck',
pattern = 'term://*',
callback = function()
vim.cmd('call nvim_input("<CR>")')
o.cmdheight = 1
end
})