diff --git a/init.lua b/init.lua index ad00dada..55cf1391 100644 --- a/init.lua +++ b/init.lua @@ -248,6 +248,14 @@ vim.api.nvim_create_user_command('LlamaStop', function() vim.notify('llama-server stopped', vim.log.levels.INFO) end, { desc = 'Stop llama-server' }) +vim.api.nvim_create_autocmd('InsertLeave', { + callback = function() + if vim.bo.modified and vim.bo.buftype == '' and vim.fn.expand '%' ~= '' then + vim.cmd 'silent! write' + end + end, +}) + vim.api.nvim_create_autocmd('VimLeavePre', { callback = function() if llama_job_id then @@ -869,20 +877,12 @@ require('lazy').setup({ -- change the command in the config to whatever the name of that colorscheme is. -- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. + 'rose-pine/neovim', + name = 'rose-pine', + priority = 1000, config = function() - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } - - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + require('rose-pine').setup { variant = 'moon' } + vim.cmd.colorscheme 'rose-pine' end, }, diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 91c5c987..1a398424 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -58,7 +58,11 @@ return { -- describe the hovered symbol using Markdown. if vim.bo.modifiable then local linters = lint.linters_by_ft[vim.bo.filetype] or {} - local available = vim.tbl_filter(function(l) return vim.fn.executable(lint.linters[l] and lint.linters[l].cmd or l) == 1 end, linters) + local available = vim.tbl_filter(function(l) + local linter = lint.linters[l] + local cmd = type(linter) == 'table' and linter.cmd or l + return type(cmd) == 'string' and vim.fn.executable(cmd) == 1 + end, linters) if #available > 0 then lint.try_lint(available) end end end,