change theme, add autosave, and maybe other things

This commit is contained in:
Tazoeur 2024-03-17 18:44:08 +01:00
parent d36118f53a
commit 808191ee54
2 changed files with 56 additions and 42 deletions

View file

@ -1,3 +1,5 @@
-- todo:
--nnoremap gx <CMD>execute '!xdg-open ' .. shellescape(expand('<cfile>'), v:true)<CR>
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
@ -50,7 +52,7 @@ require('lazy').setup({
-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },
{ 'j-hui/fidget.nvim', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
@ -100,7 +102,7 @@ require('lazy').setup({
},
-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} },
{ 'folke/which-key.nvim', opts = {} },
{
-- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
@ -175,23 +177,31 @@ require('lazy').setup({
end,
},
},
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
-- Theme
"rose-pine/neovim",
name = "rose-pine",
config = function()
require('catppuccin').setup({
flavour = "mocha",
dim_inactive = {
shade = "dark",
enabled = true,
percentage = 0.75
require("rose-pine").setup({
dim_inactive_windows = true,
extend_background_behind_borders = true,
enable = {
terminal = true,
legacy_highlights = true,
migrations = true
}
})
end
end,
},
{
"Pocco81/auto-save.nvim",
config = function()
require("auto-save").setup {
trigger_events = { "FocusLost" }
}
end,
},
{
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
@ -358,6 +368,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
-- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup {
pickers = { find_files = { hidden = true } },
defaults = {
mappings = {
i = {
@ -424,6 +435,7 @@ local function telescope_live_grep_open_files()
prompt_title = 'Live Grep in Open Files',
}
end
vim.keymap.set('n', '<leader>s/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' })
vim.keymap.set('n', '<leader>ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
@ -441,7 +453,8 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
vim.defer_fn(function()
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash' },
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim',
'bash' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
@ -711,7 +724,7 @@ cmp.setup {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'buffer', keyword_length = 5, max_item_count = 5 },
{ name = 'buffer', keyword_length = 5, max_item_count = 5 },
},
formatting = {
format = lspkind.cmp_format {
@ -722,6 +735,6 @@ cmp.setup {
}
vim.cmd.colorscheme "catppuccin"
vim.cmd.colorscheme "rose-pine"
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et