diff --git a/lua/autocmd.lua b/lua/autocmd.lua index d7bd867..fa91f4f 100644 --- a/lua/autocmd.lua +++ b/lua/autocmd.lua @@ -63,13 +63,6 @@ vim.api.nvim_create_autocmd("BufWritePre", { end, }) --- Highlight on yank -vim.api.nvim_create_autocmd("TextYankPost", { - group = augroup("highlight_yank"), - callback = function() - vim.highlight.on_yank({ timeout = 200 }) - end, -}) -- Resize splits if window got resized vim.api.nvim_create_autocmd("VimResized", { @@ -79,17 +72,6 @@ vim.api.nvim_create_autocmd("VimResized", { end, }) --- Go to last location when opening a buffer -vim.api.nvim_create_autocmd("BufReadPost", { - group = augroup("last_loc"), - callback = function() - local mark = vim.api.nvim_buf_get_mark(0, '"') - local lcount = vim.api.nvim_buf_line_count(0) - if mark[1] > 0 and mark[1] <= lcount then - pcall(vim.api.nvim_win_set_cursor, 0, mark) - end - end, -}) -- Close specific filetypes with vim.api.nvim_create_autocmd("FileType", { @@ -116,11 +98,13 @@ vim.api.nvim_create_autocmd("BufWritePre", { end, }) --- Document Highlight on CursorHold +-- LSP Attach Features vim.api.nvim_create_autocmd("LspAttach", { group = augroup("lsp_attach_autocmds"), callback = function(args) local client = vim.lsp.get_client_by_id(args.data.client_id) + + -- Document Highlight if client and client:supports_method("textDocument/documentHighlight") then vim.api.nvim_create_autocmd({ "CursorHold" }, { buffer = args.buf, @@ -131,6 +115,11 @@ vim.api.nvim_create_autocmd("LspAttach", { callback = vim.lsp.buf.clear_references, }) end + + -- Inlay Hints + if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then + vim.lsp.inlay_hint.enable(true, { bufnr = args.buf }) + end end, }) diff --git a/lua/options.lua b/lua/options.lua index ad395b7..4dd3ed2 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -6,7 +6,6 @@ local options = { undofile = true, -- save state of file on write undodir = vim.fn.stdpath("cache") .. "/undo", undolevels = 10000, - autoread = true, -- autoread changes from other sources signcolumn = "yes", cursorline = true, cursorlineopt = "number", @@ -19,10 +18,8 @@ local options = { backup = false, -- creates a backup file writebackup = false, -- do not edit backups winminwidth = 5, -- Minimum window width - termguicolors = true, -- set term gui colors (most terminals support this) showtabline = 0, -- always show tabs showcmd = false, - mouse = "a", -- allow the mouse to be used in neovim confirm = true, -- Confirm to save changes before exiting modified buffer -- tabs @@ -31,8 +28,6 @@ local options = { expandtab = true, -- key will create " " instead of "\t" shiftwidth = 4, -- indent change after backspace and >> << softtabstop = 4, -- number of spaces instead of tab - autoindent = true, -- auto indent - smartindent = true, -- make indenting smarter again list = true, listchars = { tab = "» ", trail = "·", nbsp = "␣" }, showbreak = string.rep(" ", 3), @@ -40,8 +35,6 @@ local options = { -- Search ignorecase = true, smartcase = true, - hlsearch = true, - wildmenu = true, wildmode = "longest:full,full", wildoptions = "pum",