From 68cdfcc3a38105a962ea79df8a3a01196ac0d6c2 Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Fri, 19 Dec 2025 12:58:12 +0100 Subject: [PATCH 01/17] Customizations based on previous config probably still bloated --- init.lua | 87 +++----- lua/custom/plugins/bufferline.lua | 1 + lua/custom/plugins/conform.lua | 93 ++++++++ lua/custom/plugins/copilot.lua | 25 +++ lua/custom/plugins/lazyvim.lua | 8 + lua/custom/plugins/lsp.lua | 229 ++++++++++++++++++++ lua/custom/plugins/markdown-preview.lua | 17 ++ lua/custom/plugins/nvim-surround.lua | 10 + lua/custom/plugins/nvim-tmux-navigation.lua | 19 ++ lua/custom/plugins/nvim-tree.lua | 13 ++ lua/custom/plugins/obsidian.lua | 72 ++++++ lua/custom/plugins/plenary.lua | 3 + lua/custom/plugins/render-markdown.lua | 9 + lua/custom/plugins/tasko.lua | 13 ++ lua/custom/plugins/trouble.lua | 37 ++++ lua/custom/plugins/typescript-tools.lua | 5 + lua/keymaps.lua | 118 ++++++++++ 17 files changed, 703 insertions(+), 56 deletions(-) create mode 100644 lua/custom/plugins/bufferline.lua create mode 100644 lua/custom/plugins/conform.lua create mode 100644 lua/custom/plugins/copilot.lua create mode 100644 lua/custom/plugins/lazyvim.lua create mode 100644 lua/custom/plugins/lsp.lua create mode 100644 lua/custom/plugins/markdown-preview.lua create mode 100644 lua/custom/plugins/nvim-surround.lua create mode 100644 lua/custom/plugins/nvim-tmux-navigation.lua create mode 100644 lua/custom/plugins/nvim-tree.lua create mode 100644 lua/custom/plugins/obsidian.lua create mode 100644 lua/custom/plugins/plenary.lua create mode 100644 lua/custom/plugins/render-markdown.lua create mode 100644 lua/custom/plugins/tasko.lua create mode 100644 lua/custom/plugins/trouble.lua create mode 100644 lua/custom/plugins/typescript-tools.lua create mode 100644 lua/keymaps.lua diff --git a/init.lua b/init.lua index b98ffc6198a..ff4a01e16dc 100644 --- a/init.lua +++ b/init.lua @@ -83,15 +83,22 @@ I hope you enjoy your Neovim journey, P.S. You can delete this when you're done too. It's your config now! :) --]] +-- +-- +-- NvimTree +-- disable netrw at the very start of your init.lua +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' +vim.g.mapleader = ',' +vim.g.maplocalleader = ',' +vim.g.vscode_snippets_path = '~/.config/lvim/snippets/my-snippets' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -100,6 +107,9 @@ vim.g.have_nerd_font = false -- Make line numbers default vim.o.number = true + +require 'keymaps' + -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! -- vim.o.relativenumber = true @@ -344,7 +354,7 @@ require('lazy').setup({ -- Document existing key chains spec = { - { 's', group = '[S]earch' }, + { 'f', group = '[F]ind' }, { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, }, @@ -426,15 +436,15 @@ require('lazy').setup({ -- See `:help telescope.builtin` local builtin = require 'telescope.builtin' - vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) - vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) - vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) - vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) - vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) - vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) - vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + vim.keymap.set('n', 'fh', builtin.help_tags, { desc = '[F]ind [H]elp' }) + vim.keymap.set('n', 'fk', builtin.keymaps, { desc = '[F]ind [K]eymaps' }) + vim.keymap.set('n', 'ff', builtin.find_files, { desc = '[F]ind [F]iles' }) + vim.keymap.set('n', 'fs', builtin.builtin, { desc = '[F]ind [S]elect Telescope' }) + vim.keymap.set('n', 'fw', builtin.grep_string, { desc = '[F]ind current [W]ord' }) + vim.keymap.set('n', 'fg', builtin.live_grep, { desc = '[F]ind by [G]rep' }) + vim.keymap.set('n', 'fd', builtin.diagnostics, { desc = '[F]ind [D]iagnostics' }) + vim.keymap.set('n', 'fr', builtin.resume, { desc = '[F]ind [R]esume' }) + vim.keymap.set('n', 'f.', builtin.oldfiles, { desc = '[F]ind Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) -- Slightly advanced example of overriding default behavior and theme @@ -448,17 +458,17 @@ require('lazy').setup({ -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys - vim.keymap.set('n', 's/', function() + vim.keymap.set('n', 'f/', function() builtin.live_grep { grep_open_files = true, prompt_title = 'Live Grep in Open Files', } - end, { desc = '[S]earch [/] in Open Files' }) + end, { desc = '[F]ind [/] in Open Files' }) -- Shortcut for searching your Neovim configuration files - vim.keymap.set('n', 'sn', function() + vim.keymap.set('n', 'fn', function() builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) + end, { desc = '[F]ind [N]eovim files' }) end, }, @@ -535,43 +545,8 @@ require('lazy').setup({ vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) end - -- Rename the variable under your cursor. - -- Most Language Servers support renaming across files, etc. - map('grn', vim.lsp.buf.rename, '[R]e[n]ame') - - -- Execute a code action, usually your cursor needs to be on top of an error - -- or a suggestion from your LSP for this to activate. - map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' }) - - -- Find references for the word under your cursor. - map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - - -- Jump to the implementation of the word under your cursor. - -- Useful when your language has ways of declaring types without an actual implementation. - map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - - -- 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 . - map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - - -- WARN: This is not Goto Definition, this is Goto Declaration. - -- For example, in C this would take you to the header. - map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - - -- Fuzzy find all the symbols in your current document. - -- Symbols are things like variables, functions, types, etc. - map('gO', require('telescope.builtin').lsp_document_symbols, 'Open Document Symbols') - - -- Fuzzy find all the symbols in your current workspace. - -- Similar to document symbols, except searches over your entire project. - map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols') - - -- Jump to the type of the word under your cursor. - -- Useful when you're not sure what type a variable is and you want to see - -- the definition of its *type*, not where it was *defined*. - map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition') - + -- Check out lua/custom/plugins/lsp.lua for more lsp related keymaps + -- -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10) ---@param client vim.lsp.Client ---@param method vim.lsp.protocol.Method @@ -742,7 +717,7 @@ require('lazy').setup({ cmd = { 'ConformInfo' }, keys = { { - 'f', + 'F', function() require('conform').format { async = true, lsp_format = 'fallback' } end, @@ -984,7 +959,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/bufferline.lua b/lua/custom/plugins/bufferline.lua new file mode 100644 index 00000000000..d3f2faa6d1c --- /dev/null +++ b/lua/custom/plugins/bufferline.lua @@ -0,0 +1 @@ +return { 'akinsho/bufferline.nvim', version = '*', dependencies = 'nvim-tree/nvim-web-devicons' } diff --git a/lua/custom/plugins/conform.lua b/lua/custom/plugins/conform.lua new file mode 100644 index 00000000000..3b7fa781031 --- /dev/null +++ b/lua/custom/plugins/conform.lua @@ -0,0 +1,93 @@ +return { + 'stevearc/conform.nvim', + event = { 'BufWritePre' }, + cmd = { 'ConformInfo' }, + keys = { + { + -- Customize or remove this keymap to your liking + 'lf', + function() + require('conform').format { async = false } + end, + mode = 'n', + desc = 'Format buffer', + }, + }, + -- This will provide type hinting with LuaLS + ---@module "conform" + ---@type conform.setupOpts + opts = { + -- Define your formatters + formatters_by_ft = { + lua = { 'stylua' }, + python = { 'isort', 'black' }, + javascript = { 'eslint_d' }, + typescript = { 'eslint_d' }, + html = { 'eslint_d' }, + css = { 'eslint_d' }, + }, + -- Set default options + default_format_opts = { + lsp_format = 'fallback', + }, + -- Set up format-on-save + format_on_save = function(bufnr) + -- Disable format_on_save for TypeScript to prevent auto-indent conflicts + local filetype = vim.bo[bufnr].filetype + if filetype == 'typescript' or filetype == 'typescriptreact' or filetype == 'ts' or filetype == 'tsx' then + return false + end + return { timeout_ms = 500 } + end, + -- Customize formatters + formatters = { + shfmt = { + prepend_args = { '-i', '2' }, + }, + }, + eslint_d = { + args = { '--fix', '--stdin', '--stdin-filename', '$FILENAME' }, + cwd = function(bufnr) + local bufname = vim.api.nvim_buf_get_name(bufnr) + return vim.fs.dirname(bufname) + end, + }, + }, + init = function() + vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" + + -- Set TypeScript indentation to 2 spaces and disable ALL auto-formatting/indenting + vim.api.nvim_create_autocmd('FileType', { + pattern = { 'typescript', 'typescriptreact', 'ts', 'tsx' }, + callback = function() + vim.opt_local.tabstop = 2 + vim.opt_local.shiftwidth = 2 + -- Disable ALL auto-indent/format options + vim.opt_local.autoindent = false + vim.opt_local.smartindent = false + vim.opt_local.cindent = false + vim.opt_local.indentexpr = '' + vim.opt_local.equalprg = '' + vim.opt_local.formatprg = '' + vim.opt_local.formatexpr = '' + -- Disable vim-sleuth for TypeScript files + vim.b.sleuth_automatic = 0 + end, + }) + + -- Prevent ANY auto-indent/format before write for TypeScript files + vim.api.nvim_create_autocmd('BufWritePre', { + pattern = { '*.ts', '*.tsx' }, + callback = function() + -- Completely disable all formatting/indenting right before save + vim.opt_local.indentexpr = '' + vim.opt_local.equalprg = '' + vim.opt_local.formatprg = '' + vim.opt_local.formatexpr = '' + vim.opt_local.autoindent = false + vim.opt_local.smartindent = false + vim.opt_local.cindent = false + end, + }) + end, +} diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000000..8a70374d429 --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,25 @@ +return { + 'zbirenbaum/copilot.lua', + cmd = 'Copilot', + event = 'InsertEnter', + -- Load before nvim-cmp to ensure copilot is ready + priority = 100, + config = function() + require('copilot').setup { + suggestion = { + enabled = true, + auto_trigger = true, -- Need to trigger to get suggestions for copilot-cmp + debounce = 75, + keymap = { + accept = false, -- Disable accept keymap, use copilot-cmp instead + accept_word = false, + accept_line = false, + next = '', + prev = '', + dismiss = '', + }, + }, + panel = { enabled = true }, + } + end, +} diff --git a/lua/custom/plugins/lazyvim.lua b/lua/custom/plugins/lazyvim.lua new file mode 100644 index 00000000000..07995784e79 --- /dev/null +++ b/lua/custom/plugins/lazyvim.lua @@ -0,0 +1,8 @@ +return { + "kdheepak/lazygit.nvim", + cmd = "LazyGit", + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + }, +} diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua new file mode 100644 index 00000000000..cf3e835a9c5 --- /dev/null +++ b/lua/custom/plugins/lsp.lua @@ -0,0 +1,229 @@ +return { + 'neovim/nvim-lspconfig', + dependencies = { + -- Automatically install LSPs to stdpath for neovim + -- 'williamboman/mason.nvim', + -- 'williamboman/mason-lspconfig.nvim', + + -- Useful status updates for LSP + { 'j-hui/fidget.nvim', opts = {} }, + + -- Additional lua configuration, makes nvim stuff amazing! + 'folke/neodev.nvim', + }, + config = function() + -- Mappings. + -- See `:help vim.diagnostic.*` for documentation on any of the below functions + local opts = { silent = true } + + function optsWithDesc(desc) + return { desc = desc } + end + + -- the following diagnostic commands don't work :( + -- vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) + -- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) + --- end of not working + + vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, optsWithDesc 'previous diagnostics') + vim.keymap.set('n', ']d', vim.diagnostic.goto_next, optsWithDesc 'next diagnostics') + + vim.api.nvim_create_autocmd('FileType', { + pattern = 'sh', + callback = function() + vim.lsp.start { + name = 'bash-language-server', + cmd = { 'bash-language-server', 'start' }, + } + end, + }) + + -- Use an on_attach function to only map the following keys + -- after the language server attaches to the current buffer + local on_attach = function(client, bufnr) + function bufoptsWithDesc(desc) + return { silent = true, buffer = bufnr, desc = desc } + end + + local function telescope_lsp(picker, fallback, picker_opts) + return function() + local ok, builtin = pcall(require, 'telescope.builtin') + if ok and type(builtin[picker]) == 'function' then + return builtin[picker](picker_opts or {}) + end + return fallback() + end + end + + vim.keymap.set( + 'n', + 'ls', + telescope_lsp('lsp_document_symbols', vim.lsp.buf.document_symbol), + bufoptsWithDesc 'Open symbol picker' + ) + vim.keymap.set( + 'n', + 'lS', + telescope_lsp('lsp_dynamic_workspace_symbols', vim.lsp.buf.workspace_symbol), + bufoptsWithDesc 'Open symbol picker (workspace)' + ) + vim.keymap.set( + 'n', + 'dd', + telescope_lsp('diagnostics', vim.diagnostic.setloclist), + bufoptsWithDesc 'Open diagnostics picker' + ) + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufoptsWithDesc 'LSP Hover') + -- Neovim (0.11+) sets default LSP keymaps from `vim/_defaults.lua` on `LspAttach`. + -- Those can overwrite mappings set inside `on_attach`, so we schedule our preferred + -- mappings to run after the defaults. + vim.schedule(function() + -- Prefer Telescope UI for "jump-to/list" LSP requests when available; + -- fall back to built-in LSP functions otherwise. + -- + -- NOTE: Telescope doesn't provide `lsp_declarations`, so `gD` always falls back. + vim.keymap.set( + 'n', + 'gd', + telescope_lsp('lsp_definitions', vim.lsp.buf.definition), + bufoptsWithDesc 'Definition (telescope)' + ) + vim.keymap.set( + 'n', + 'gr', + telescope_lsp('lsp_references', vim.lsp.buf.references), + bufoptsWithDesc 'References (telescope)' + ) + vim.keymap.set( + 'n', + 'gi', + telescope_lsp('lsp_implementations', vim.lsp.buf.implementation), + bufoptsWithDesc 'Implementation (telescope)' + ) + vim.keymap.set( + 'n', + 'gt', + telescope_lsp('lsp_type_definitions', vim.lsp.buf.type_definition), + bufoptsWithDesc 'Type definition (telescope)' + ) + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufoptsWithDesc 'Declaration') + end) + -- TODO: C-k is already used for going to the top split figure out a different keymap + -- vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufoptsWithDesc("Signature help")) + -- vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufoptsWithDesc("")) + -- vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufoptsWithDesc()) + -- vim.keymap.set('n', 'wl', function() + -- print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + -- end, bufoptsWithDesc()) + vim.keymap.set('n', 'lr', function() + -- when rename opens the prompt, this autocommand will trigger + -- it will "press" CTRL-F to enter the command-line window `:h cmdwin` + -- in this window I can use normal mode keybindings + local cmdId + cmdId = vim.api.nvim_create_autocmd({ 'CmdlineEnter' }, { + callback = function() + local key = vim.api.nvim_replace_termcodes('', true, false, true) + vim.api.nvim_feedkeys(key, 'c', false) + vim.api.nvim_feedkeys('0', 'n', false) + -- autocmd was triggered and so we can remove the ID and return true to delete the autocmd + cmdId = nil + return true + end, + }) + vim.lsp.buf.rename() + -- if LPS couldn't trigger rename on the symbol, clear the autocmd + vim.defer_fn(function() + -- the cmdId is not nil only if the LSP failed to rename + vim.api.nvim_del_autocmd(cmdId) + if cmdId then + end + end, 500) + end, bufoptsWithDesc 'Rename symbol') + vim.keymap.set('n', 'lw', function() + vim.diagnostic.setloclist() + end, { desc = 'Diagnostic setloclist' }) + vim.keymap.set('n', 'la', vim.lsp.buf.code_action, bufoptsWithDesc 'Run code action') + -- vim.keymap.set('n', 'f', vim.lsp.buf.formatting, bufoptsWithDesc("Format using LSP")) + end + + -- Prefer blink.cmp capabilities if available (kickstart config uses blink.cmp), + -- otherwise fall back to vanilla LSP capabilities. + local capabilities = vim.lsp.protocol.make_client_capabilities() + local ok_blink, blink = pcall(require, 'blink.cmp') + if ok_blink and type(blink.get_lsp_capabilities) == 'function' then + capabilities = blink.get_lsp_capabilities(capabilities) + end + local lspconfig = vim.lsp.config + + lspconfig['gopls'] = { + capabilities = capabilities, + on_attach = on_attach, + } + vim.lsp.enable 'gopls' + + lspconfig['ts_ls'] = { + capabilities = capabilities, + on_attach = on_attach, + } + vim.lsp.enable 'ts_ls' + + lspconfig['sqlls'] = { + capabilities = capabilities, + on_attach = on_attach, + } + vim.lsp.enable 'sqlls' + + lspconfig['tailwindcss-language-server'] = { + capabilities = capabilities, + on_attach = on_attach, + filetypes = { 'html', 'css', 'scss', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'eruby' }, + } + vim.lsp.enable 'tailwindcss-language-server' + + lspconfig['ruby_lsp'] = { + capabilities = capabilities, + on_attach = on_attach, + mason = false, + cmd = { vim.fn.expand '~/.local/share/mise/installs/ruby/3.4.1/bin/ruby-lsp' }, + } + vim.lsp.enable 'ruby_lsp' + + lspconfig['lua_ls'] = { + capabilities = capabilities, + on_attach = on_attach, + settings = { + Lua = { + runtime = { + version = 'LuaJIT', + }, + diagnostics = { + globals = { 'vim' }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file('', true), + checkThirdParty = false, + }, + }, + }, + } + vim.lsp.enable 'lua_ls' + + lspconfig.marksman = {} + if vim.fn.executable 'solargraph' == 1 then + lspconfig['solargraph'] = { + capabilities = capabilities, + on_attach = on_attach, + settings = { + flags = { + debounce_text_changes = 150, + }, + }, + } + end + end, +} diff --git a/lua/custom/plugins/markdown-preview.lua b/lua/custom/plugins/markdown-preview.lua new file mode 100644 index 00000000000..a16a810a24d --- /dev/null +++ b/lua/custom/plugins/markdown-preview.lua @@ -0,0 +1,17 @@ +-- return { +-- 'iamcco/markdown-preview.nvim', +-- cmd = { 'MarkdownPreviewToggle', 'MarkdownPreview', 'MarkdownPreviewStop' }, +-- ft = { 'markdown' }, +-- build = function() +-- vim.fn['mkdp#util#install']() +-- end, +-- } +return { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, +} diff --git a/lua/custom/plugins/nvim-surround.lua b/lua/custom/plugins/nvim-surround.lua new file mode 100644 index 00000000000..252d84145b8 --- /dev/null +++ b/lua/custom/plugins/nvim-surround.lua @@ -0,0 +1,10 @@ +return { + "kylechui/nvim-surround", + version = "*", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup { + -- Configuration here, or leave empty to use defaults + } + end, +} diff --git a/lua/custom/plugins/nvim-tmux-navigation.lua b/lua/custom/plugins/nvim-tmux-navigation.lua new file mode 100644 index 00000000000..1a996eb2a19 --- /dev/null +++ b/lua/custom/plugins/nvim-tmux-navigation.lua @@ -0,0 +1,19 @@ +local plugins = { + "alexghergh/nvim-tmux-navigation", + lazy = false, + config = function() + require("nvim-tmux-navigation").setup { + disable_when_zoomed = true, -- defaults to false + keybindings = { + left = "", + down = "", + up = "", + right = "", + last_active = "", + next = "", + }, + } + end, +} + +return plugins diff --git a/lua/custom/plugins/nvim-tree.lua b/lua/custom/plugins/nvim-tree.lua new file mode 100644 index 00000000000..80ecd3196d3 --- /dev/null +++ b/lua/custom/plugins/nvim-tree.lua @@ -0,0 +1,13 @@ +return { + 'nvim-tree/nvim-tree.lua', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + keys = { + { 'e', 'NvimTreeToggle', desc = 'Explorer (NvimTree)' }, + }, + opts = {}, + config = function(_, opts) + require('nvim-tree').setup(opts) + end, +} diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua new file mode 100644 index 00000000000..983607d7b4e --- /dev/null +++ b/lua/custom/plugins/obsidian.lua @@ -0,0 +1,72 @@ +return { + 'epwalsh/obsidian.nvim', + version = '*', -- Use the latest release + lazy = true, + event = { + -- Load obsidian.nvim only when opening files in the vault + 'BufReadPre ' + .. vim.fn.expand '~/AdisObsidianVault' + .. '/*.md', + 'BufNewFile ' .. vim.fn.expand '~/AdisObsidianVault' .. '/*.md', + }, + + dependencies = { + 'nvim-lua/plenary.nvim', -- Required dependency + }, + + opts = function(_, opts) + vim.api.nvim_create_autocmd('FileType', { + pattern = { 'markdown', 'md' }, + callback = function() + vim.wo.conceallevel = 1 + end, + }) + return { + workspaces = { + { + name = 'work', + path = '~/AdisObsidianVault', -- Define your vault path + }, + }, + templates = { + folder = '~/AdisObsidianVault/Templates', + date_format = '%d.%m.%Y', + time_format = '%H:%M', + }, + -- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp. + completion = { + -- Set to false to disable completion. + nvim_cmp = true, + -- Trigger completion at 2 chars. + min_chars = 2, + }, + + ui = { + -- recommended here: https://github.com/MeanderingProgrammer/render-markdown.nvim + enabled = false, + }, + + note_id_func = function(title) + -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. + -- In this case a note with the title 'My new note' will be given an ID that looks + -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md' + local suffix = '' + if title ~= nil then + -- If title is given, transform it into valid file name. + suffix = title:gsub(' ', '-'):gsub('[^A-Za-z0-9-]', ''):lower() + else + -- If title is nil, just add 4 random uppercase letters to the suffix. + for _ = 1, 4 do + suffix = suffix .. string.char(math.random(65, 90)) + end + end + return tostring(os.time()) .. '-' .. suffix + end, + + note_path_func = function(spec) + local path = spec.dir / tostring(spec.title) + return path:with_suffix '.md' + end, + } + end, +} diff --git a/lua/custom/plugins/plenary.lua b/lua/custom/plugins/plenary.lua new file mode 100644 index 00000000000..d3e0f62a24f --- /dev/null +++ b/lua/custom/plugins/plenary.lua @@ -0,0 +1,3 @@ +return { + 'nvim-lua/plenary.nvim', +} diff --git a/lua/custom/plugins/render-markdown.lua b/lua/custom/plugins/render-markdown.lua new file mode 100644 index 00000000000..533b6a4c03a --- /dev/null +++ b/lua/custom/plugins/render-markdown.lua @@ -0,0 +1,9 @@ +return { + "MeanderingProgrammer/render-markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + ---@module 'render-markdown' + ---@type render.md.UserConfig + opts = {}, +} diff --git a/lua/custom/plugins/tasko.lua b/lua/custom/plugins/tasko.lua new file mode 100644 index 00000000000..c9f234893c0 --- /dev/null +++ b/lua/custom/plugins/tasko.lua @@ -0,0 +1,13 @@ +return { + 'adi-de-masi/tasko.nvim', + -- dir = '/Users/adidemasi/code/tasko.nvim', + dependencies = { + { 'nvim-lua/plenary.nvim' }, + { 'nvim-telescope/telescope.nvim' }, + }, + config = function() + require('tasko').setup { + provider = 'todoist', + } + end, +} diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua new file mode 100644 index 00000000000..cf9dd307f25 --- /dev/null +++ b/lua/custom/plugins/trouble.lua @@ -0,0 +1,37 @@ +return { + "folke/trouble.nvim", + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "tt", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "tb", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "ts", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "tl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "tL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "tQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, +} diff --git a/lua/custom/plugins/typescript-tools.lua b/lua/custom/plugins/typescript-tools.lua new file mode 100644 index 00000000000..ba7fb2046e7 --- /dev/null +++ b/lua/custom/plugins/typescript-tools.lua @@ -0,0 +1,5 @@ +return { + 'pmizio/typescript-tools.nvim', + dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, + opts = {}, +} diff --git a/lua/keymaps.lua b/lua/keymaps.lua new file mode 100644 index 00000000000..3f4507a7d54 --- /dev/null +++ b/lua/keymaps.lua @@ -0,0 +1,118 @@ +-- Adi's custom section +local map = vim.keymap.set +--local unmap = vim.keymap.del + +-- Neovim 0.11+ ships default LSP keymaps in `vim/_defaults.lua` (e.g. `grr`, `gri`, `grt`), +-- but those use the built-in UI (often a locations list / read-only buffer). +-- Override them here to prefer Telescope pickers. +local function telescope_lsp(picker, fallback, picker_opts) + return function() + local ok, builtin = pcall(require, 'telescope.builtin') + if ok and type(builtin[picker]) == 'function' then + return builtin[picker](picker_opts or {}) + end + return fallback() + end +end + +map('n', 'gr', telescope_lsp('lsp_references', vim.lsp.buf.references), { desc = 'LSP: references (telescope)' }) +map('n', 'gi', telescope_lsp('lsp_implementations', vim.lsp.buf.implementation), { desc = 'LSP: implementations (telescope)' }) +map('n', 'gt', telescope_lsp('lsp_type_definitions', vim.lsp.buf.type_definition), { desc = 'LSP: type definitions (telescope)' }) +map('n', 'gO', telescope_lsp('lsp_document_symbols', vim.lsp.buf.document_symbol), { desc = 'LSP: document symbols (telescope)' }) + +map('n', ';', ':', { desc = 'CMD enter command mode' }) +map('i', 'jk', '') +map('n', 'lw', function() + vim.diagnostic.setloclist() +end, { desc = 'Diagnostic setloclist' }) + +map('n', 'h', 'nohlsearch', { desc = 'set no highlight search' }) +map('n', '', ' m .+1==', { desc = 'Move line down' }) +map('n', '', ' m .-2==', { desc = 'Move line up' }) +map('v', '', ":m '>+1gv=gv", { desc = 'Move selected block down' }) +map('v', '', ":m '<-2gv=gv", { desc = 'Move selected block up' }) +map('v', 'y', '"*y', { desc = 'Yank to clipboard' }) + +map('n', 'w', ':w ', { desc = 'alias to :w' }) +map('n', '', 'NvimTmuxNavigateLeft', { silent = true }) +map('n', '', 'NvimTmuxNavigateDown', { silent = true }) +map('n', '', 'NvimTmuxNavigateUp', { silent = true }) +map('n', '', 'NvimTmuxNavigateRight', { silent = true }) +map('n', '', 'NvimTmuxNavigateLastActive', { silent = true }) +map('n', 'm', 'MarkdownPreview', { silent = true }) +map('n', 'gg', ' LazyGit ', { desc = 'start LazyGit' }) + +map('n', 'd', ' Run/Debug') +map('n', 'fe', 'Telescope emoji', { desc = '😃 [F]ind [E]moji' }) +map('n', 'l', ' Lsp') + +map('n', 't', ' Telescope or  Trouble') +map('n', 'tr', 'Telescope resume') +map('n', 'o', ' Obsidian') +map('n', 'r', ' Render Markdown') +map('n', 'rt', 'RenderMarkdown toggle', { desc = 'toggle render markdown', silent = true }) +map('n', 're', 'RenderMarkdown expand', { desc = 'Increase anti-conceal margin above and below by 1', silent = true }) +map('n', 're', 'RenderMarkdown expand', { desc = 'Decrease anti-conceal margin above and below by 1', silent = true }) +map('n', 'os', 'ObsidianSearch', { silent = true }) +map('n', 'ob', 'ObsidianBacklink', { silent = true }) +map('n', 'ot', 'ObsidianToday', { silent = true }) +map('n', 'od', 'ObsidianDailies', { silent = true }) +map('n', 'oq', 'ObsidianQuickSwitch', { silent = true }) +map('n', 'on', 'ObsidianNew', { silent = true }) + +map('n', 'e', 'NvimTreeFindFileToggle', { silent = true }) +map('n', '', 'bn', { desc = 'next buffer' }) +map('n', '', 'bp', { desc = 'previous buffer' }) +map('n', 'x', 'bd', { desc = 'delete buffer' }) + +map('n', 'X', ':only', { desc = 'Close other panes' }) + +-- TJs kickstart +-- +-- +-- [[ Basic Keymaps ]] +-- See `:help map()` + +-- Clear highlights on search when pressing in normal mode +-- See `:help hlsearch` +--map('n', '', 'nohlsearch') + +-- Diagnostic keymaps +map('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) + +-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier +-- for people to discover. Otherwise, you normally need to press , which +-- is not what someone will guess without a bit more experience. +-- +-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping +-- or just use to exit terminal mode +map('t', '', '', { desc = 'Exit terminal mode' }) + +-- TIP: Disable arrow keys in normal mode +-- map('n', '', 'echo "Use h to move!!"') +-- map('n', '', 'echo "Use l to move!!"') +-- map('n', '', 'echo "Use k to move!!"') +-- map('n', '', 'echo "Use j to move!!"') + +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- +-- See `:help wincmd` for a list of all window commands +-- map('n', '', '', { desc = 'Move focus to the left window' }) +-- map('n', '', '', { desc = 'Move focus to the right window' }) +-- map('n', '', '', { desc = 'Move focus to the lower window' }) +-- map('n', '', '', { desc = 'Move focus to the upper window' }) + +-- [[ 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, +}) From d549e665eb76f6e8f9fdfa2ce5404864c12c1e3e Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Mon, 22 Dec 2025 23:36:45 +0100 Subject: [PATCH 02/17] fix treesitter config --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index ff4a01e16dc..8161365b54b 100644 --- a/init.lua +++ b/init.lua @@ -916,7 +916,7 @@ require('lazy').setup({ { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', - main = 'nvim-treesitter.configs', -- Sets main module to use for opts + main = 'nvim-treesitter.config', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, From 58b72dba8b4906f8d60eaed60f8adc4d139e7fdb Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Tue, 23 Dec 2025 08:12:10 +0100 Subject: [PATCH 03/17] change path to obsidian vault --- lua/custom/plugins/obsidian.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua index 983607d7b4e..94b0ec8a59d 100644 --- a/lua/custom/plugins/obsidian.lua +++ b/lua/custom/plugins/obsidian.lua @@ -5,9 +5,9 @@ return { event = { -- Load obsidian.nvim only when opening files in the vault 'BufReadPre ' - .. vim.fn.expand '~/AdisObsidianVault' + .. vim.fn.expand '~/AdisObsidianSyncVault' .. '/*.md', - 'BufNewFile ' .. vim.fn.expand '~/AdisObsidianVault' .. '/*.md', + 'BufNewFile ' .. vim.fn.expand '~/AdisObsidianSyncVault' .. '/*.md', }, dependencies = { @@ -25,18 +25,18 @@ return { workspaces = { { name = 'work', - path = '~/AdisObsidianVault', -- Define your vault path + path = '~/AdisObsidianSyncVault', -- Define your vault path }, }, templates = { - folder = '~/AdisObsidianVault/Templates', + folder = '~/AdisObsidianSyncVault/Templates', date_format = '%d.%m.%Y', time_format = '%H:%M', }, -- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp. completion = { -- Set to false to disable completion. - nvim_cmp = true, + nvim_cmp = false, -- Trigger completion at 2 chars. min_chars = 2, }, From ef22ca74f4856f7e840a5471f2f45c2e6cc2708b Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Tue, 23 Dec 2025 08:54:38 +0100 Subject: [PATCH 04/17] remove the lsp.lua, it seems to destroy everything --- lua/custom/plugins/lsp.lua | 229 ------------------------------------- 1 file changed, 229 deletions(-) delete mode 100644 lua/custom/plugins/lsp.lua diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua deleted file mode 100644 index cf3e835a9c5..00000000000 --- a/lua/custom/plugins/lsp.lua +++ /dev/null @@ -1,229 +0,0 @@ -return { - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs to stdpath for neovim - -- 'williamboman/mason.nvim', - -- 'williamboman/mason-lspconfig.nvim', - - -- Useful status updates for LSP - { 'j-hui/fidget.nvim', opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! - 'folke/neodev.nvim', - }, - config = function() - -- Mappings. - -- See `:help vim.diagnostic.*` for documentation on any of the below functions - local opts = { silent = true } - - function optsWithDesc(desc) - return { desc = desc } - end - - -- the following diagnostic commands don't work :( - -- vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) - -- vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) - --- end of not working - - vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, optsWithDesc 'previous diagnostics') - vim.keymap.set('n', ']d', vim.diagnostic.goto_next, optsWithDesc 'next diagnostics') - - vim.api.nvim_create_autocmd('FileType', { - pattern = 'sh', - callback = function() - vim.lsp.start { - name = 'bash-language-server', - cmd = { 'bash-language-server', 'start' }, - } - end, - }) - - -- Use an on_attach function to only map the following keys - -- after the language server attaches to the current buffer - local on_attach = function(client, bufnr) - function bufoptsWithDesc(desc) - return { silent = true, buffer = bufnr, desc = desc } - end - - local function telescope_lsp(picker, fallback, picker_opts) - return function() - local ok, builtin = pcall(require, 'telescope.builtin') - if ok and type(builtin[picker]) == 'function' then - return builtin[picker](picker_opts or {}) - end - return fallback() - end - end - - vim.keymap.set( - 'n', - 'ls', - telescope_lsp('lsp_document_symbols', vim.lsp.buf.document_symbol), - bufoptsWithDesc 'Open symbol picker' - ) - vim.keymap.set( - 'n', - 'lS', - telescope_lsp('lsp_dynamic_workspace_symbols', vim.lsp.buf.workspace_symbol), - bufoptsWithDesc 'Open symbol picker (workspace)' - ) - vim.keymap.set( - 'n', - 'dd', - telescope_lsp('diagnostics', vim.diagnostic.setloclist), - bufoptsWithDesc 'Open diagnostics picker' - ) - -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - - -- Mappings. - -- See `:help vim.lsp.*` for documentation on any of the below functions - vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufoptsWithDesc 'LSP Hover') - -- Neovim (0.11+) sets default LSP keymaps from `vim/_defaults.lua` on `LspAttach`. - -- Those can overwrite mappings set inside `on_attach`, so we schedule our preferred - -- mappings to run after the defaults. - vim.schedule(function() - -- Prefer Telescope UI for "jump-to/list" LSP requests when available; - -- fall back to built-in LSP functions otherwise. - -- - -- NOTE: Telescope doesn't provide `lsp_declarations`, so `gD` always falls back. - vim.keymap.set( - 'n', - 'gd', - telescope_lsp('lsp_definitions', vim.lsp.buf.definition), - bufoptsWithDesc 'Definition (telescope)' - ) - vim.keymap.set( - 'n', - 'gr', - telescope_lsp('lsp_references', vim.lsp.buf.references), - bufoptsWithDesc 'References (telescope)' - ) - vim.keymap.set( - 'n', - 'gi', - telescope_lsp('lsp_implementations', vim.lsp.buf.implementation), - bufoptsWithDesc 'Implementation (telescope)' - ) - vim.keymap.set( - 'n', - 'gt', - telescope_lsp('lsp_type_definitions', vim.lsp.buf.type_definition), - bufoptsWithDesc 'Type definition (telescope)' - ) - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufoptsWithDesc 'Declaration') - end) - -- TODO: C-k is already used for going to the top split figure out a different keymap - -- vim.keymap.set('n', '', vim.lsp.buf.signature_help, bufoptsWithDesc("Signature help")) - -- vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufoptsWithDesc("")) - -- vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufoptsWithDesc()) - -- vim.keymap.set('n', 'wl', function() - -- print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - -- end, bufoptsWithDesc()) - vim.keymap.set('n', 'lr', function() - -- when rename opens the prompt, this autocommand will trigger - -- it will "press" CTRL-F to enter the command-line window `:h cmdwin` - -- in this window I can use normal mode keybindings - local cmdId - cmdId = vim.api.nvim_create_autocmd({ 'CmdlineEnter' }, { - callback = function() - local key = vim.api.nvim_replace_termcodes('', true, false, true) - vim.api.nvim_feedkeys(key, 'c', false) - vim.api.nvim_feedkeys('0', 'n', false) - -- autocmd was triggered and so we can remove the ID and return true to delete the autocmd - cmdId = nil - return true - end, - }) - vim.lsp.buf.rename() - -- if LPS couldn't trigger rename on the symbol, clear the autocmd - vim.defer_fn(function() - -- the cmdId is not nil only if the LSP failed to rename - vim.api.nvim_del_autocmd(cmdId) - if cmdId then - end - end, 500) - end, bufoptsWithDesc 'Rename symbol') - vim.keymap.set('n', 'lw', function() - vim.diagnostic.setloclist() - end, { desc = 'Diagnostic setloclist' }) - vim.keymap.set('n', 'la', vim.lsp.buf.code_action, bufoptsWithDesc 'Run code action') - -- vim.keymap.set('n', 'f', vim.lsp.buf.formatting, bufoptsWithDesc("Format using LSP")) - end - - -- Prefer blink.cmp capabilities if available (kickstart config uses blink.cmp), - -- otherwise fall back to vanilla LSP capabilities. - local capabilities = vim.lsp.protocol.make_client_capabilities() - local ok_blink, blink = pcall(require, 'blink.cmp') - if ok_blink and type(blink.get_lsp_capabilities) == 'function' then - capabilities = blink.get_lsp_capabilities(capabilities) - end - local lspconfig = vim.lsp.config - - lspconfig['gopls'] = { - capabilities = capabilities, - on_attach = on_attach, - } - vim.lsp.enable 'gopls' - - lspconfig['ts_ls'] = { - capabilities = capabilities, - on_attach = on_attach, - } - vim.lsp.enable 'ts_ls' - - lspconfig['sqlls'] = { - capabilities = capabilities, - on_attach = on_attach, - } - vim.lsp.enable 'sqlls' - - lspconfig['tailwindcss-language-server'] = { - capabilities = capabilities, - on_attach = on_attach, - filetypes = { 'html', 'css', 'scss', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'eruby' }, - } - vim.lsp.enable 'tailwindcss-language-server' - - lspconfig['ruby_lsp'] = { - capabilities = capabilities, - on_attach = on_attach, - mason = false, - cmd = { vim.fn.expand '~/.local/share/mise/installs/ruby/3.4.1/bin/ruby-lsp' }, - } - vim.lsp.enable 'ruby_lsp' - - lspconfig['lua_ls'] = { - capabilities = capabilities, - on_attach = on_attach, - settings = { - Lua = { - runtime = { - version = 'LuaJIT', - }, - diagnostics = { - globals = { 'vim' }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file('', true), - checkThirdParty = false, - }, - }, - }, - } - vim.lsp.enable 'lua_ls' - - lspconfig.marksman = {} - if vim.fn.executable 'solargraph' == 1 then - lspconfig['solargraph'] = { - capabilities = capabilities, - on_attach = on_attach, - settings = { - flags = { - debounce_text_changes = 150, - }, - }, - } - end - end, -} From b19b2f42722e7514dcd25761885bb05674c60e0d Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Tue, 23 Dec 2025 14:31:08 +0100 Subject: [PATCH 05/17] go to definition with telescope --- lua/keymaps.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 3f4507a7d54..5039d2303ec 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -19,6 +19,7 @@ map('n', 'gr', telescope_lsp('lsp_references', vim.lsp.buf.references), { desc = map('n', 'gi', telescope_lsp('lsp_implementations', vim.lsp.buf.implementation), { desc = 'LSP: implementations (telescope)' }) map('n', 'gt', telescope_lsp('lsp_type_definitions', vim.lsp.buf.type_definition), { desc = 'LSP: type definitions (telescope)' }) map('n', 'gO', telescope_lsp('lsp_document_symbols', vim.lsp.buf.document_symbol), { desc = 'LSP: document symbols (telescope)' }) +map('n', 'gd', telescope_lsp('lsp_definitions', vim.lsp.buf.document_symbol), { desc = 'LSP: Go to definition' }) map('n', ';', ':', { desc = 'CMD enter command mode' }) map('i', 'jk', '') From 3c20990a3cc8dba0499692383b5ed3634cc896ce Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Tue, 23 Dec 2025 22:29:39 +0100 Subject: [PATCH 06/17] code actions revived --- lua/keymaps.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 5039d2303ec..1c15869cb82 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -23,9 +23,6 @@ map('n', 'gd', telescope_lsp('lsp_definitions', vim.lsp.buf.document_symbol), { map('n', ';', ':', { desc = 'CMD enter command mode' }) map('i', 'jk', '') -map('n', 'lw', function() - vim.diagnostic.setloclist() -end, { desc = 'Diagnostic setloclist' }) map('n', 'h', 'nohlsearch', { desc = 'set no highlight search' }) map('n', '', ' m .+1==', { desc = 'Move line down' }) @@ -46,6 +43,10 @@ map('n', 'gg', ' LazyGit ', { desc = 'start LazyGit' }) map('n', 'd', ' Run/Debug') map('n', 'fe', 'Telescope emoji', { desc = '😃 [F]ind [E]moji' }) map('n', 'l', ' Lsp') +map('n', 'lw', function() + vim.diagnostic.setloclist() +end, { desc = 'Diagnostic setloclist' }) +map('n', 'la', 'lua vim.lsp.buf.code_action()', { desc = 'code actions' }) map('n', 't', ' Telescope or  Trouble') map('n', 'tr', 'Telescope resume') From 2a9a8ad515e9f0229ab6748d91dbebcdaccee536 Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Tue, 23 Dec 2025 23:41:31 +0100 Subject: [PATCH 07/17] add copilot to the mix using blink --- init.lua | 14 +++++++++++++- lua/custom/plugins/copilot.lua | 33 ++++++++++++++------------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/init.lua b/init.lua index 8161365b54b..b637b5404c1 100644 --- a/init.lua +++ b/init.lua @@ -293,6 +293,9 @@ require('lazy').setup({ }, }, }, + { + 'giuxtaposition/blink-cmp-copilot', + }, -- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- @@ -771,6 +774,9 @@ require('lazy').setup({ return 'make install_jsregexp' end)(), dependencies = { + -- Add the copilot source for blink here as well to ensure it loads + 'giuxtaposition/blink-cmp-copilot', + 'zbirenbaum/copilot.lua', -- Ensure the base copilot plugin is also present -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets @@ -829,8 +835,14 @@ require('lazy').setup({ }, sources = { - default = { 'lsp', 'path', 'snippets', 'lazydev' }, + default = { 'copilot', 'lsp', 'path', 'snippets', 'lazydev' }, providers = { + copilot = { + name = 'copilot', + module = 'blink-cmp-copilot', + score_offset = 100, + async = true, + }, lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, }, }, diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua index 8a70374d429..a67d4fc6089 100644 --- a/lua/custom/plugins/copilot.lua +++ b/lua/custom/plugins/copilot.lua @@ -2,24 +2,19 @@ return { 'zbirenbaum/copilot.lua', cmd = 'Copilot', event = 'InsertEnter', - -- Load before nvim-cmp to ensure copilot is ready - priority = 100, - config = function() - require('copilot').setup { - suggestion = { - enabled = true, - auto_trigger = true, -- Need to trigger to get suggestions for copilot-cmp - debounce = 75, - keymap = { - accept = false, -- Disable accept keymap, use copilot-cmp instead - accept_word = false, - accept_line = false, - next = '', - prev = '', - dismiss = '', - }, + dependencies = { + 'copilotlsp-nvim/copilot-lsp', + }, + opts = { + nes = { + enabled = true, + keymap = { + accept_and_goto = 'p', + accept = false, + dismiss = '', }, - panel = { enabled = true }, - } - end, + }, + suggestion = { enabled = false }, + panel = { enabled = false }, + }, } From ef421219761fcf2b101bf2eedb4dd5cb3be641c9 Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Tue, 23 Dec 2025 23:42:32 +0100 Subject: [PATCH 08/17] better golang lsp support --- init.lua | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index b637b5404c1..e796eb69705 100644 --- a/init.lua +++ b/init.lua @@ -650,7 +650,41 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, + gopls = { + settings = { + gopls = { + gofumpt = true, + codelenses = { + gc_details = false, + generate = true, + regenerate_cgo = true, + test = true, + tidy = true, + upgrade_dependency = true, + vendor = true, + }, + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, + }, + analyses = { + fieldalignment = true, + nilness = true, + unusedparams = true, + unusedwrite = true, + useany = true, + }, + usePlaceholders = true, + completeUnimported = true, + staticcheck = true, + directoryFilters = { '-.git', '-.vscode', '-.idea', '-.vscode-test', '-node_modules' }, + }, + }, + }, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -832,6 +866,25 @@ require('lazy').setup({ -- By default, you may press `` to show the documentation. -- Optionally, set `auto_show = true` to show the documentation after a delay. documentation = { auto_show = false, auto_show_delay_ms = 500 }, + menu = { + draw = { + -- Define the columns to show in the completion menu + columns = { + { 'kind_icon' }, + { 'label', 'label_description', gap = 1 }, + { 'source_name' }, + }, + components = { + source_name = { + width = { max = 20 }, + text = function(ctx) + return ctx.source_name or '' + end, + highlight = 'BlinkCmpSource', + }, + }, + }, + }, }, sources = { From fb480408ebcdf801dec54372af80da72b69f69ed Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Tue, 23 Dec 2025 17:47:36 +0100 Subject: [PATCH 09/17] replace nvim-tree with neotree --- init.lua | 12 +++++++++++- lua/custom/plugins/nvim-tree.lua | 13 ------------- lua/keymaps.lua | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 lua/custom/plugins/nvim-tree.lua diff --git a/init.lua b/init.lua index e796eb69705..ca15eca6d55 100644 --- a/init.lua +++ b/init.lua @@ -1017,7 +1017,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` @@ -1052,5 +1052,15 @@ require('lazy').setup({ }, }) +require('neo-tree').setup { + filesystem = { + follow_current_file = { + enabled = true, -- This will find and focus the file in the active buffer every time + -- -- the current file is changed while the tree is open. + leave_dirs_open = true, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` + }, + }, +} + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/nvim-tree.lua b/lua/custom/plugins/nvim-tree.lua deleted file mode 100644 index 80ecd3196d3..00000000000 --- a/lua/custom/plugins/nvim-tree.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - 'nvim-tree/nvim-tree.lua', - dependencies = { - 'nvim-tree/nvim-web-devicons', - }, - keys = { - { 'e', 'NvimTreeToggle', desc = 'Explorer (NvimTree)' }, - }, - opts = {}, - config = function(_, opts) - require('nvim-tree').setup(opts) - end, -} diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 1c15869cb82..5501e197938 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -62,7 +62,7 @@ map('n', 'od', 'ObsidianDailies', { silent = true }) map('n', 'oq', 'ObsidianQuickSwitch', { silent = true }) map('n', 'on', 'ObsidianNew', { silent = true }) -map('n', 'e', 'NvimTreeFindFileToggle', { silent = true }) +map('n', 'e', 'Neotree toggle') map('n', '', 'bn', { desc = 'next buffer' }) map('n', '', 'bp', { desc = 'previous buffer' }) map('n', 'x', 'bd', { desc = 'delete buffer' }) From a0a7fd074c47ae2aba12c5de3aebe84c8a4afc1f Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Tue, 23 Dec 2025 17:55:27 +0100 Subject: [PATCH 10/17] Autocompletion for obsidian is back nvim-cmp is used, so be it. --- lua/custom/plugins/obsidian.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua index 94b0ec8a59d..8dfbe4a24bb 100644 --- a/lua/custom/plugins/obsidian.lua +++ b/lua/custom/plugins/obsidian.lua @@ -12,6 +12,7 @@ return { dependencies = { 'nvim-lua/plenary.nvim', -- Required dependency + 'hrsh7th/nvim-cmp', }, opts = function(_, opts) @@ -36,7 +37,7 @@ return { -- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp. completion = { -- Set to false to disable completion. - nvim_cmp = false, + nvim_cmp = true, -- Trigger completion at 2 chars. min_chars = 2, }, From e2a2e1adaf060a7dbbb3780d5b33d9cb3e785c30 Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Sun, 4 Jan 2026 09:03:40 +0100 Subject: [PATCH 11/17] copilot etc improved --- lua/custom/plugins/copilot.lua | 18 ++++++++-------- lua/keymaps.lua | 2 +- lua/kickstart/plugins/neo-tree.lua | 33 +++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua index a67d4fc6089..eb6ceb12d7d 100644 --- a/lua/custom/plugins/copilot.lua +++ b/lua/custom/plugins/copilot.lua @@ -6,15 +6,15 @@ return { 'copilotlsp-nvim/copilot-lsp', }, opts = { - nes = { - enabled = true, - keymap = { - accept_and_goto = 'p', - accept = false, - dismiss = '', - }, - }, - suggestion = { enabled = false }, + -- nes = { + -- enabled = true, + -- keymap = { + -- accept_and_goto = '', + -- accept = false, + -- dismiss = '', + -- }, + -- }, + suggestion = { enabled = true }, panel = { enabled = false }, }, } diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 5501e197938..8ada39a420e 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -15,7 +15,7 @@ local function telescope_lsp(picker, fallback, picker_opts) end end -map('n', 'gr', telescope_lsp('lsp_references', vim.lsp.buf.references), { desc = 'LSP: references (telescope)' }) +map('n', 'grr', telescope_lsp('lsp_references', vim.lsp.buf.references), { desc = 'LSP: references (telescope)' }) map('n', 'gi', telescope_lsp('lsp_implementations', vim.lsp.buf.implementation), { desc = 'LSP: implementations (telescope)' }) map('n', 'gt', telescope_lsp('lsp_type_definitions', vim.lsp.buf.type_definition), { desc = 'LSP: type definitions (telescope)' }) map('n', 'gO', telescope_lsp('lsp_document_symbols', vim.lsp.buf.document_symbol), { desc = 'LSP: document symbols (telescope)' }) diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c7067891df0..4640a3e3e65 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -1,6 +1,5 @@ -- Neo-tree is a Neovim plugin to browse the file system -- https://github.com/nvim-neo-tree/neo-tree.nvim - return { 'nvim-neo-tree/neo-tree.nvim', version = '*', @@ -21,5 +20,37 @@ return { }, }, }, + -- your config here + event_handlers = { + -- save layout before opening neotree + { + event = 'neo_tree_window_before_open', + handler = function() + -- vim.cmd("set noequalalways") + local layout = {} + for _, win in ipairs(vim.api.nvim_list_wins()) do + layout[win] = { + height = vim.api.nvim_win_get_height(win), + width = vim.api.nvim_win_get_width(win), + } + end + vim._neotree_layout = layout + end, + }, + -- restore layout after closing neotree + { + event = 'neo_tree_window_after_close', + handler = function() + if vim._neotree_layout then + for win, dims in pairs(vim._neotree_layout) do + if vim.api.nvim_win_is_valid(win) then + pcall(vim.api.nvim_win_set_height, win, dims.height) + pcall(vim.api.nvim_win_set_width, win, dims.width) + end + end + end + end, + }, + }, }, } From aeda5821222930b1d4376fd599113248be6e9c4e Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Sun, 4 Jan 2026 16:50:10 +0100 Subject: [PATCH 12/17] fix snippets --- init.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/init.lua b/init.lua index ca15eca6d55..9243c7cfcbc 100644 --- a/init.lua +++ b/init.lua @@ -95,7 +95,6 @@ vim.g.loaded_netrwPlugin = 1 -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = ',' vim.g.maplocalleader = ',' -vim.g.vscode_snippets_path = '~/.config/lvim/snippets/my-snippets' -- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = true @@ -814,14 +813,17 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, }, - opts = {}, + config = function() + -- load snippets from path/of/your/nvim/config/my-cool-snippets + require('luasnip.loaders.from_vscode').lazy_load { paths = { '~/.config/lvim/snippets/my-snippets' } } + end, }, 'folke/lazydev.nvim', }, @@ -886,8 +888,8 @@ require('lazy').setup({ }, }, }, - sources = { + default = { 'copilot', 'lsp', 'path', 'snippets', 'lazydev' }, providers = { copilot = { From 0842439e34d35dca2515ba33b5c7156dc282ab82 Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Mon, 5 Jan 2026 10:56:34 +0100 Subject: [PATCH 13/17] fix tmux navigation --- lua/custom/plugins/nvim-tmux-navigation.lua | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/lua/custom/plugins/nvim-tmux-navigation.lua b/lua/custom/plugins/nvim-tmux-navigation.lua index 1a996eb2a19..26f482289ac 100644 --- a/lua/custom/plugins/nvim-tmux-navigation.lua +++ b/lua/custom/plugins/nvim-tmux-navigation.lua @@ -1,19 +1,16 @@ -local plugins = { - "alexghergh/nvim-tmux-navigation", - lazy = false, +return { + 'alexghergh/nvim-tmux-navigation', config = function() - require("nvim-tmux-navigation").setup { + require('nvim-tmux-navigation').setup { disable_when_zoomed = true, -- defaults to false keybindings = { - left = "", - down = "", - up = "", - right = "", - last_active = "", - next = "", + left = '', + down = '', + up = '', + right = '', + last_active = '', + next = '', }, } end, } - -return plugins From 6ae7eb42aa1ef103d66b353eea7f502d94df31fe Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Wed, 21 Jan 2026 13:13:16 +0100 Subject: [PATCH 14/17] improve markdown and obsidian configuration no eager loading anymore, consolidate keymaps in the plugin etc. --- lua/custom/plugins/obsidian.lua | 103 +++++++++---------------- lua/custom/plugins/render-markdown.lua | 1 + lua/keymaps.lua | 9 +-- 3 files changed, 42 insertions(+), 71 deletions(-) diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua index 8dfbe4a24bb..13b8e886a92 100644 --- a/lua/custom/plugins/obsidian.lua +++ b/lua/custom/plugins/obsidian.lua @@ -1,73 +1,46 @@ return { - 'epwalsh/obsidian.nvim', - version = '*', -- Use the latest release + 'obsidian-nvim/obsidian.nvim', + version = '*', -- use latest release, remove to use latest commit lazy = true, event = { - -- Load obsidian.nvim only when opening files in the vault - 'BufReadPre ' - .. vim.fn.expand '~/AdisObsidianSyncVault' - .. '/*.md', - 'BufNewFile ' .. vim.fn.expand '~/AdisObsidianSyncVault' .. '/*.md', + -- If you want to use the home shortcut '~' here, you need to call 'vim.fn.expand'. + "BufReadPre " .. vim.fn.expand "~" .. "/AdisObsidianSyncVault/**.md", + "BufNewFile " .. vim.fn.expand "~" .. "/AdisObsidianSyncVault/**.md", }, - dependencies = { - 'nvim-lua/plenary.nvim', -- Required dependency - 'hrsh7th/nvim-cmp', + 'nvim-lua/plenary.nvim', }, - - opts = function(_, opts) - vim.api.nvim_create_autocmd('FileType', { - pattern = { 'markdown', 'md' }, - callback = function() - vim.wo.conceallevel = 1 - end, - }) - return { - workspaces = { - { - name = 'work', - path = '~/AdisObsidianSyncVault', -- Define your vault path - }, - }, - templates = { - folder = '~/AdisObsidianSyncVault/Templates', - date_format = '%d.%m.%Y', - time_format = '%H:%M', - }, - -- Optional, completion of wiki links, local markdown links, and tags using nvim-cmp. - completion = { - -- Set to false to disable completion. - nvim_cmp = true, - -- Trigger completion at 2 chars. - min_chars = 2, - }, - - ui = { - -- recommended here: https://github.com/MeanderingProgrammer/render-markdown.nvim - enabled = false, + cmd = { + "ObsidianOpen", + "ObsidianNew", + "ObsidianQuickSwitch", + "ObsidianFollowLink", + "ObsidianBacklinks", + "ObsidianTags", + "ObsidianToday", + "ObsidianYesterday", + "ObsidianTomorrow", + "ObsidianDailies", + "ObsidianTemplate", + "ObsidianSearch", + "ObsidianLink", + "ObsidianLinkNew", + "ObsidianLinks", + "ObsidianExtractNote", + "ObsidianWorkspace", + "ObsidianPasteImg", + "ObsidianRename", + "ObsidianTOC", + }, + ---@module 'obsidian' + ---@type obsidian.config + opts = { + legacy_commands = false, -- this will be removed in the next major release + workspaces = { + { + name = 'MyOnlyVault', + path = '~/AdisObsidianSyncVault', }, - - note_id_func = function(title) - -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. - -- In this case a note with the title 'My new note' will be given an ID that looks - -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md' - local suffix = '' - if title ~= nil then - -- If title is given, transform it into valid file name. - suffix = title:gsub(' ', '-'):gsub('[^A-Za-z0-9-]', ''):lower() - else - -- If title is nil, just add 4 random uppercase letters to the suffix. - for _ = 1, 4 do - suffix = suffix .. string.char(math.random(65, 90)) - end - end - return tostring(os.time()) .. '-' .. suffix - end, - - note_path_func = function(spec) - local path = spec.dir / tostring(spec.title) - return path:with_suffix '.md' - end, - } - end, + }, + }, } diff --git a/lua/custom/plugins/render-markdown.lua b/lua/custom/plugins/render-markdown.lua index 533b6a4c03a..845bb621c1c 100644 --- a/lua/custom/plugins/render-markdown.lua +++ b/lua/custom/plugins/render-markdown.lua @@ -1,6 +1,7 @@ return { "MeanderingProgrammer/render-markdown.nvim", dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite + ft = { "markdown" }, -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons ---@module 'render-markdown' diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 8ada39a420e..ea6434df5bc 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -55,12 +55,9 @@ map('n', 'r', ' Render Markdown') map('n', 'rt', 'RenderMarkdown toggle', { desc = 'toggle render markdown', silent = true }) map('n', 're', 'RenderMarkdown expand', { desc = 'Increase anti-conceal margin above and below by 1', silent = true }) map('n', 're', 'RenderMarkdown expand', { desc = 'Decrease anti-conceal margin above and below by 1', silent = true }) -map('n', 'os', 'ObsidianSearch', { silent = true }) -map('n', 'ob', 'ObsidianBacklink', { silent = true }) -map('n', 'ot', 'ObsidianToday', { silent = true }) -map('n', 'od', 'ObsidianDailies', { silent = true }) -map('n', 'oq', 'ObsidianQuickSwitch', { silent = true }) -map('n', 'on', 'ObsidianNew', { silent = true }) +map('n', 'ot', 'Obsidian today', { silent = true }) +map('n', 'od', 'Obsidian dailies', { silent = true }) +map('n', 'oq', 'Obsidian quick_switch', { silent = true }) map('n', 'e', 'Neotree toggle') map('n', '', 'bn', { desc = 'next buffer' }) From 2c88e3186fbb48ed76fe4be6d128f86650e0897a Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Wed, 21 Jan 2026 13:13:45 +0100 Subject: [PATCH 15/17] limit typescript loading to ts and js --- lua/custom/plugins/typescript-tools.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/custom/plugins/typescript-tools.lua b/lua/custom/plugins/typescript-tools.lua index ba7fb2046e7..0f139a5034d 100644 --- a/lua/custom/plugins/typescript-tools.lua +++ b/lua/custom/plugins/typescript-tools.lua @@ -1,5 +1,6 @@ return { 'pmizio/typescript-tools.nvim', dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, + ft = { 'typescript', 'typescriptreact', 'javascript', 'javascriptreact' }, opts = {}, } From 4f2315f832a51783ef347cff92bb81dba4f1e33e Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Fri, 23 Jan 2026 08:41:40 +0100 Subject: [PATCH 16/17] fix obsidian config --- lua/custom/plugins/obsidian.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua index 13b8e886a92..6f720ad41b5 100644 --- a/lua/custom/plugins/obsidian.lua +++ b/lua/custom/plugins/obsidian.lua @@ -2,11 +2,13 @@ return { 'obsidian-nvim/obsidian.nvim', version = '*', -- use latest release, remove to use latest commit lazy = true, - event = { - -- If you want to use the home shortcut '~' here, you need to call 'vim.fn.expand'. - "BufReadPre " .. vim.fn.expand "~" .. "/AdisObsidianSyncVault/**.md", - "BufNewFile " .. vim.fn.expand "~" .. "/AdisObsidianSyncVault/**.md", - }, + event = function() + local vault_path = vim.fn.expand("~/AdisObsidianSyncVault") + return { + "BufReadPre " .. vault_path .. "/**/*.md", + "BufNewFile " .. vault_path .. "/**/*.md", + } + end, dependencies = { 'nvim-lua/plenary.nvim', }, From 7114fbeae254712a81e661b19bbbe309b1f83f90 Mon Sep 17 00:00:00 2001 From: Adi De Masi Date: Thu, 26 Feb 2026 15:01:13 +0100 Subject: [PATCH 17/17] obsidian and telescope mini tweaks --- lua/custom/plugins/obsidian.lua | 37 ++++----------------------------- lua/keymaps.lua | 5 +---- 2 files changed, 5 insertions(+), 37 deletions(-) diff --git a/lua/custom/plugins/obsidian.lua b/lua/custom/plugins/obsidian.lua index 6f720ad41b5..92cfb6b75d2 100644 --- a/lua/custom/plugins/obsidian.lua +++ b/lua/custom/plugins/obsidian.lua @@ -1,43 +1,14 @@ return { 'obsidian-nvim/obsidian.nvim', version = '*', -- use latest release, remove to use latest commit - lazy = true, - event = function() - local vault_path = vim.fn.expand("~/AdisObsidianSyncVault") - return { - "BufReadPre " .. vault_path .. "/**/*.md", - "BufNewFile " .. vault_path .. "/**/*.md", - } - end, - dependencies = { - 'nvim-lua/plenary.nvim', - }, - cmd = { - "ObsidianOpen", - "ObsidianNew", - "ObsidianQuickSwitch", - "ObsidianFollowLink", - "ObsidianBacklinks", - "ObsidianTags", - "ObsidianToday", - "ObsidianYesterday", - "ObsidianTomorrow", - "ObsidianDailies", - "ObsidianTemplate", - "ObsidianSearch", - "ObsidianLink", - "ObsidianLinkNew", - "ObsidianLinks", - "ObsidianExtractNote", - "ObsidianWorkspace", - "ObsidianPasteImg", - "ObsidianRename", - "ObsidianTOC", - }, + ft = 'markdown', ---@module 'obsidian' ---@type obsidian.config opts = { legacy_commands = false, -- this will be removed in the next major release + -- Disable footer to avoid "calling 'backlinks' on bad self" when timer runs + -- after buffer is closed/reused (plugin bug: footer doesn't validate buffer). + footer = { enabled = false }, workspaces = { { name = 'MyOnlyVault', diff --git a/lua/keymaps.lua b/lua/keymaps.lua index ea6434df5bc..6c43f36c6cb 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -42,6 +42,7 @@ map('n', 'gg', ' LazyGit ', { desc = 'start LazyGit' }) map('n', 'd', ' Run/Debug') map('n', 'fe', 'Telescope emoji', { desc = '😃 [F]ind [E]moji' }) +map('n', 'fb', 'Telescope buffers', { desc = '😃 [F]ind [B]uffer' }) map('n', 'l', ' Lsp') map('n', 'lw', function() vim.diagnostic.setloclist() @@ -50,14 +51,10 @@ map('n', 'la', 'lua vim.lsp.buf.code_action()', { desc = 'code map('n', 't', ' Telescope or  Trouble') map('n', 'tr', 'Telescope resume') -map('n', 'o', ' Obsidian') map('n', 'r', ' Render Markdown') map('n', 'rt', 'RenderMarkdown toggle', { desc = 'toggle render markdown', silent = true }) map('n', 're', 'RenderMarkdown expand', { desc = 'Increase anti-conceal margin above and below by 1', silent = true }) map('n', 're', 'RenderMarkdown expand', { desc = 'Decrease anti-conceal margin above and below by 1', silent = true }) -map('n', 'ot', 'Obsidian today', { silent = true }) -map('n', 'od', 'Obsidian dailies', { silent = true }) -map('n', 'oq', 'Obsidian quick_switch', { silent = true }) map('n', 'e', 'Neotree toggle') map('n', '', 'bn', { desc = 'next buffer' })