Migrated init.lua into plugin files
This commit is contained in:
35
AppData/Local/nvim/lua/config/autocmd.lua
Normal file
35
AppData/Local/nvim/lua/config/autocmd.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
-- Try it with `yap` in normal mode
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking (copying) text',
|
||||
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- NOTE: Disabeling the built in cmp in favor of blink
|
||||
-- vim.api.nvim_create_autocmd('LspAttach', {
|
||||
-- callback = function(ev)
|
||||
-- local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
-- if client ~= nil and client:supports_method 'textDocument/completion' then
|
||||
-- vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
|
||||
-- end
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
-- Autoindent json by 2 spaces
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'json', 'xml' },
|
||||
callback = function()
|
||||
vim.bo.shiftwidth = 2
|
||||
vim.bo.tabstop = 2
|
||||
vim.bo.softtabstop = 2
|
||||
vim.bo.expandtab = true
|
||||
end,
|
||||
})
|
||||
Reference in New Issue
Block a user