diff --git a/init.lua b/init.lua index 054c82d7..3c117aa8 100644 --- a/init.lua +++ b/init.lua @@ -154,6 +154,8 @@ vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 +vim.opt.smartindent = true + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -190,7 +192,10 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) --- [[ Basic Autocommands ]] +-- vim.o.winbar = '%=%m %f' +vim.o.winbar = '%f' + +-- [[ Basic Autocommands ]]: -- See `:help lua-guide-autocommands` -- Highlight when yanking (copying) text @@ -207,7 +212,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' -if not vim.loop.fs_stat(lazypath) then +if not vim.uv.fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } end ---@diagnostic disable-next-line: undefined-field @@ -255,6 +260,7 @@ require('lazy').setup({ topdelete = { text = '‾' }, changedelete = { text = '~' }, }, + current_line_blame = true, }, }, @@ -353,11 +359,14 @@ require('lazy').setup({ -- You can put your default mappings / updates / etc. in here -- All the info you're looking for is in `:help telescope.setup()` -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, + defaults = { + mappings = { + i = { [''] = 'to_fuzzy_refine' }, + }, + file_ignore_patterns = { + 'build/*', + }, + }, -- pickers = {} extensions = { ['ui-select'] = { @@ -466,6 +475,12 @@ require('lazy').setup({ vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end + -- Define the map function with support for arguments + local map_with_args = function(keys, func, desc, args) + vim.keymap.set('n', keys, function() + func(args) + end, { buffer = event.buf, desc = 'LSP: ' .. desc }) + end -- Jump to the definition of the word under your cursor. -- This is where a variable was first declared, or where a function is defined, etc. -- To jump back, press . @@ -485,7 +500,7 @@ require('lazy').setup({ -- Fuzzy find all the symbols in your current document. -- Symbols are things like variables, functions, types, etc. - map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + map_with_args('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols', { fname_width = 0.5, symbol_width = 0.75 }) -- Fuzzy find all the symbols in your current workspace. -- Similar to document symbols, except searches over your entire project. @@ -544,6 +559,9 @@ require('lazy').setup({ map('th', function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) end, '[T]oggle Inlay [H]ints') + + -- enable inlay on by default. + vim.lsp.inlay_hint.enable() end end, }) @@ -778,13 +796,15 @@ 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', + 'catppuccin/nvim', + name = 'catppuccin', priority = 1000, -- Make sure to load this before all the other start plugins. init = function() -- 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' + -- colorscheme catppuccin " catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha + vim.cmd.colorscheme 'catppuccin-mocha' -- You can configure highlights by doing something like: vim.cmd.hi 'Comment gui=none' @@ -876,7 +896,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.debug', require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 5662387d..0f8a2704 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,26 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return { 'Civitasv/cmake-tools.nvim' } +return { + 'Civitasv/cmake-tools.nvim', + lazy = true, + init = function() + local loaded = false + local function check() + local cwd = vim.uv.cwd() + if vim.fn.filereadable(cwd .. '/CMakeLists.txt') == 1 then + require('lazy').load { plugins = { 'cmake-tools.nvim' } } + loaded = true + end + end + check() + vim.api.nvim_create_autocmd('DirChanged', { + callback = function() + if not loaded then + check() + end + end, + }) + end, + opts = {}, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c793b885..d6b36a98 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -20,6 +20,11 @@ return { ['\\'] = 'close_window', }, }, + filtered_items = { + visible = true, + hide_dotfiles = false, + hide_gitignored = false, + }, }, }, }