diff options
| author | Eugene Triguba <eugene.triguba@paymentworks.com> | 2025-06-28 11:19:15 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugene.triguba@paymentworks.com> | 2025-06-28 11:19:15 -0400 |
| commit | 1bb191f3ab8460f87cc981c631439fcb5e39db49 (patch) | |
| tree | 17256981b1d33629bc566ece0ce1f3e16c8227d2 /nvim | |
| parent | tweak linters (diff) | |
| parent | update readme (diff) | |
| download | dotfiles-1bb191f3ab8460f87cc981c631439fcb5e39db49.zip | |
Merge remote-tracking branch 'upstream'
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/.config/nvim/lazy-lock.json | 13 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/filetypes.lua | 8 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/config/global.lua | 5 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/blink.lua | 12 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/conform.lua | 27 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/copilot.lua | 27 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/debug.lua | 334 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/lint.lua | 1 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/lsp.lua | 11 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/neo-tree.lua | 14 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/obsidian.lua | 20 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/telescope.lua | 28 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/tmux-navigator.lua | 20 | ||||
| -rw-r--r-- | nvim/.config/nvim/lua/plugins/vim-sleuth.lua | 1 |
14 files changed, 380 insertions, 141 deletions
diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index 3fdaa00..652413b 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,32 +1,32 @@ { + "CopilotChat.nvim": { "branch": "main", "commit": "55f2162c36901224e22ff8424fd60ecef670b8fc" }, "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, + "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, "blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" }, "conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" }, - "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, + "copilot.lua": { "branch": "master", "commit": "46f4b7d026cba9497159dcd3e6aa61a185cb1c48" }, "gitsigns.nvim": { "branch": "main", "commit": "1b0350ab707713b2bc6c236151f1a324175347b1" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "4c2cdc69d69fe00c15ae8648f7e954d99e5de3ea" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" }, "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "mini.nvim": { "branch": "main", "commit": "1b32a3f61f1f649cadc748bd4b7a32b4b4785d29" }, + "mini.nvim": { "branch": "main", "commit": "8ca3965e68edfee5f438d4063f5adf5afa255884" }, "neo-tree.nvim": { "branch": "main", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "2647cce4cb64fb35c212146663384e05ae126bdf" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "2edd6375692d9ac1053d50acfe415c1eb2ba92d0" }, + "nvim-dap": { "branch": "master", "commit": "14fe46ae16eb272629144a93f7738f5279665a4f" }, "nvim-dap-go": { "branch": "main", "commit": "8763ced35b19c8dc526e04a70ab07c34e11ad064" }, "nvim-dap-python": { "branch": "master", "commit": "261ce649d05bc455a29f9636dc03f8cdaa7e0e2c" }, "nvim-dap-ui": { "branch": "master", "commit": "73a26abf4941aa27da59820fd6b028ebcdbcf932" }, "nvim-lint": { "branch": "master", "commit": "2b0039b8be9583704591a13129c600891ac2c596" }, - "nvim-lspconfig": { "branch": "master", "commit": "5e0e9c00d51fcb7efef0d4c49023f9593b38661e" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" }, + "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, @@ -35,5 +35,6 @@ "toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, + "vim-tmux-navigator": { "branch": "master", "commit": "412c474e97468e7934b9c217064025ea7a69e05e" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } } diff --git a/nvim/.config/nvim/lua/config/filetypes.lua b/nvim/.config/nvim/lua/config/filetypes.lua index 38ae06f..139bfb7 100644 --- a/nvim/.config/nvim/lua/config/filetypes.lua +++ b/nvim/.config/nvim/lua/config/filetypes.lua @@ -31,3 +31,11 @@ vim.api.nvim_create_autocmd('FileType', { vim.opt_local.shiftwidth = 2 end, }) + +vim.api.nvim_create_autocmd('FileType', { + pattern = 'go', + callback = function() + vim.opt_local.tabstop = 4 + vim.opt_local.shiftwidth = 4 + end, +}) diff --git a/nvim/.config/nvim/lua/config/global.lua b/nvim/.config/nvim/lua/config/global.lua index 8769e85..8581ae9 100644 --- a/nvim/.config/nvim/lua/config/global.lua +++ b/nvim/.config/nvim/lua/config/global.lua @@ -9,3 +9,8 @@ vim.g.have_nerd_font = true -- Disable netrw vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 + +-- Set Python 3 to a virtual environment with `pynvim` installed +-- to support python plugins. +vim.g.python3_host_prog = vim.fn.expand '~/.config/nvim/venv/bin/python' + diff --git a/nvim/.config/nvim/lua/plugins/blink.lua b/nvim/.config/nvim/lua/plugins/blink.lua index d83ee7f..e035292 100644 --- a/nvim/.config/nvim/lua/plugins/blink.lua +++ b/nvim/.config/nvim/lua/plugins/blink.lua @@ -1,8 +1,9 @@ return { { -- Autocompletion 'saghen/blink.cmp', + build = 'cargo +nightly build --release', event = 'VimEnter', - version = '1.*', + version = '*', dependencies = { -- Snippet Engine { @@ -31,6 +32,7 @@ return { opts = {}, }, 'folke/lazydev.nvim', + 'giuxtaposition/blink-cmp-copilot', }, --- @module 'blink.cmp' --- @type blink.cmp.Config @@ -76,9 +78,15 @@ return { }, sources = { - default = { 'lsp', 'path', 'snippets', 'lazydev' }, + default = { 'lsp', 'path', 'snippets', 'lazydev', 'copilot' }, providers = { lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 }, + copilot = { + name = 'copilot', + module = 'blink-cmp-copilot', + score_offset = 100, + async = true, + }, }, }, diff --git a/nvim/.config/nvim/lua/plugins/conform.lua b/nvim/.config/nvim/lua/plugins/conform.lua index 54d14d2..627607f 100644 --- a/nvim/.config/nvim/lua/plugins/conform.lua +++ b/nvim/.config/nvim/lua/plugins/conform.lua @@ -1,3 +1,5 @@ +-- Conform adds code autoformatting funcionality. + return { { 'stevearc/conform.nvim', @@ -94,6 +96,8 @@ return { javascriptreact = { 'prettierd', 'prettier', stop_after_first = true }, typescriptreact = { 'prettierd', 'prettier', stop_after_first = true }, css = { 'prettierd', 'prettier', stop_after_first = true }, + htmldjango = { 'prettierd', 'prettier', stop_after_first = true }, + html = { 'prettierd', 'prettier', stop_after_first = true }, }, formatters = { isort = { @@ -104,5 +108,28 @@ return { }, }, }, + config = function(_, opts) + require('conform').setup(opts) + + vim.api.nvim_create_user_command('FormatDisable', function(args) + if args.bang then + -- :FormatDisable! disables autoformat for this buffer only + vim.b.disable_autoformat = true + else + -- :FormatDisable disables autoformat globally + vim.g.disable_autoformat = true + end + end, { + desc = 'Disable autoformat-on-save', + bang = true, -- allows the ! variant + }) + + vim.api.nvim_create_user_command('FormatEnable', function() + vim.b.disable_autoformat = false + vim.g.disable_autoformat = false + end, { + desc = 'Re-enable autoformat-on-save', + }) + end, }, } diff --git a/nvim/.config/nvim/lua/plugins/copilot.lua b/nvim/.config/nvim/lua/plugins/copilot.lua new file mode 100644 index 0000000..4d16709 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/copilot.lua @@ -0,0 +1,27 @@ +return { + { + 'zbirenbaum/copilot.lua', + cmd = 'Copilot', + event = 'InsertEnter', + config = function() + require('copilot').setup { + suggestion = { enabled = false }, + panel = { enabled = false }, + } + end, + }, + { + 'CopilotC-Nvim/CopilotChat.nvim', + dependencies = { + { 'zbirenbaum/copilot.lua' }, + { 'nvim-lua/plenary.nvim', branch = 'master' }, -- for curl, log and async functions + }, + build = 'make tiktoken', -- Only on MacOS or Linux + config = function() + require('CopilotChat').setup {} + vim.keymap.set('n', '<leader>cc', function() + vim.cmd 'CopilotChatToggle' + end, { desc = '[Copilot] Toggle Copilot Chat' }) + end, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/debug.lua b/nvim/.config/nvim/lua/plugins/debug.lua index fb59be1..668323e 100644 --- a/nvim/.config/nvim/lua/plugins/debug.lua +++ b/nvim/.config/nvim/lua/plugins/debug.lua @@ -1,139 +1,239 @@ -- debug.lua -- --- Shows how to use the DAP plugin to debug your code. +-- Configures the DAP plugin to debug code. -return { - 'mfussenegger/nvim-dap', - dependencies = { - -- Creates a beautiful debugger UI - 'rcarriga/nvim-dap-ui', +---@class DapConfig +---@field name string Configuration name +---@field type string Debug adapter type +---@field request string Launch type ('launch' or 'attach') +---@field program function|string Path to executable or function returning path +---@field cwd string Working directory +---@field stopOnEntry boolean Whether to stop at entry point +---@field args table Command line arguments +---@field runInTerminal boolean Whether to run in terminal - -- Required dependency for nvim-dap-ui - 'nvim-neotest/nvim-nio', +---@class DapAdapter +---@field type string Adapter type ('server', 'executable', etc.) +---@field port string Port configuration +---@field executable table Executable configuration with command and args - -- Installs the debug adapters - 'williamboman/mason.nvim', - 'jay-babu/mason-nvim-dap.nvim', - - -- Debugger adapters - 'leoluz/nvim-dap-go', - 'mfussenegger/nvim-dap-python', - }, - keys = { - { - '<F5>', - function() - require('dap').continue() - end, - desc = 'Debug: Start/Continue', +-- Go debugging adapter setup +-- Configures delve debugger for Go with platform-specific settings +---@return nil +local function setup_go_adapter() + require('dap-go').setup { + delve = { + -- On Windows delve must be run attached or it crashes + detached = vim.fn.has 'win32' == 0, }, - { - '<F1>', - function() - require('dap').step_into() - end, - desc = 'Debug: Step Into', + } +end + +-- Python debugging adapter setup +-- Configures Python debugger using python3 interpreter +---@return nil +local function setup_python_adapter() + require('dap-python').setup 'python3' +end + +-- CodeLLDB adapter setup +-- Configures LLDB-based debugger for native languages (C, C++, Rust, Zig) +---@param dap table # DAP module instance +---@return nil +local function setup_codelldb_adapter(dap) + ---@type DapAdapter + dap.adapters.codelldb = { + type = 'server', + port = '${port}', + executable = { + command = vim.fn.exepath 'codelldb', + args = { '--port', '${port}' }, }, + } +end + +-- Build and find the newly-built Zig executable by running +-- 'zig build' and attempting to locate the resulting executable. +-- If the executable is unable to be automatically found, the user +-- will be prompted to give the path to the executable. +-- +---@return string|nil # Path to executable or nil if build the failed +local function build_and_find_zig_executable() + local build_result = vim.fn.system 'zig build' + if vim.v.shell_error ~= 0 then + vim.notify('Build failed: ' .. build_result, vim.log.levels.ERROR) + return nil + end + + local exe_name = vim.fn.fnamemodify(vim.fn.getcwd(), ':t') + local possible_paths = { 'zig-out/bin/' .. exe_name } + + for _, path in ipairs(possible_paths) do + local full_path = vim.fn.getcwd() .. '/' .. path + if vim.fn.executable(full_path) == 1 then + return full_path + end + end + + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/zig-out/bin/', 'file') +end + +-- Build and find the Zig test executable by running +-- 'zig build test' and prompting the user for the test +-- executable location. +-- +---@return string # Path to test executable +local function build_and_find_zig_test() + vim.fn.system 'zig build test' + return vim.fn.input('Path to test executable: ', vim.fn.getcwd() .. '/zig-cache/o/', 'file') +end + +-- Zig debugging configuration +-- Sets up debugging configurations for Zig programs and tests +---@param dap table # DAP module instance +---@return nil +local function setup_zig_configuration(dap) + ---@type DapConfig[] + dap.configurations.zig = { { - '<F2>', - function() - require('dap').step_over() - end, - desc = 'Debug: Step Over', + name = 'Build and Launch Zig Program', + type = 'codelldb', + request = 'launch', + program = build_and_find_zig_executable, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + runInTerminal = false, }, { - '<F3>', - function() - require('dap').step_out() - end, - desc = 'Debug: Step Out', + name = 'Launch Zig Test', + type = 'codelldb', + request = 'launch', + program = build_and_find_zig_test, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + runInTerminal = false, }, - { - '<leader>b', + } +end + +-- Language adapters and configurations +-- Sets up debugging support for all supported languages +---@param dap table # DAP module instance +---@return nil +local function setup_language_adapters(dap) + setup_go_adapter() + setup_python_adapter() + setup_codelldb_adapter(dap) + setup_zig_configuration(dap) +end + +-- Key mappings setup +-- Configures function keys and leader key combinations for debugging actions +---@param dap table # DAP module instance +---@param dapui table # DAP UI module instance +---@return nil +local function setup_keymaps(dap, dapui) + ---@type table<string, {[1]: function, [2]: string}> + local keymaps = { + ['<F5>'] = { dap.continue, 'Debug: Start/Continue' }, + ['<F1>'] = { dap.step_into, 'Debug: Step Into' }, + ['<F2>'] = { dap.step_over, 'Debug: Step Over' }, + ['<F3>'] = { dap.step_out, 'Debug: Step Out' }, + ['<F7>'] = { dapui.toggle, 'Debug: See last session result' }, + ['<leader>tb'] = { dap.toggle_breakpoint, 'Debug: Toggle Breakpoint' }, + ['<leader>B'] = { function() - require('dap').toggle_breakpoint() + dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') end, - desc = 'Debug: Toggle Breakpoint', + 'Debug: Set Breakpoint', }, - { - '<leader>B', - function() - require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, - desc = 'Debug: Set Breakpoint', + } + + for key, config in pairs(keymaps) do + vim.keymap.set('n', key, config[1], { desc = config[2] }) + end +end + +-- Event listeners setup +-- Configures automatic UI opening/closing based on debug session events +---@param dap table # DAP module instance +---@param dapui table # DAP UI module instance +---@return nil +local function setup_dap_listeners(dap, dapui) + local dapui_config = 'dapui_config' + dap.listeners.after.event_initialized[dapui_config] = dapui.open + dap.listeners.before.event_terminated[dapui_config] = dapui.close + dap.listeners.before.event_exited[dapui_config] = dapui.close +end + +-- DAP UI configuration +-- Sets up the debugging user interface with custom icons and controls +---@param dapui table # DAP UI module instance +---@return nil +local function setup_dapui_config(dapui) + dapui.setup { + icons = { + expanded = '▾', + collapsed = '▸', + current_frame = '*', }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - { - '<F7>', - function() - require('dapui').toggle() - end, - desc = 'Debug: See last session result.', + controls = { + icons = { + pause = '⏸', + play = '▶', + step_into = '⏎', + step_over = '⏭', + step_out = '⏮', + step_back = 'b', + run_last = '▶▶', + terminate = '⏹', + disconnect = '⏏', + }, }, - }, - config = function() - local dap = require 'dap' - local dapui = require 'dapui' + } +end - require('mason-nvim-dap').setup { - -- Makes a best effort to setup the various debuggers with - -- reasonable debug configurations - automatic_installation = true, +-- Mason DAP configuration +-- Automatically installs and configures debug adapters through Mason +---@return nil +local function setup_mason_dap() + require('mason-nvim-dap').setup { + automatic_installation = true, + handlers = {}, + ensure_installed = { 'delve', 'python', 'codelldb' }, + } +end - -- see mason-nvim-dap README for more information - handlers = {}, +-- Main configuration orchestrator +-- Sets up all debugging components in the correct order +---@return nil +local function setup_dap() + local dap = require 'dap' + local dapui = require 'dapui' - ensure_installed = { - -- Update this to ensure that you have the debuggers for the langs you want - 'delve', - 'python', - }, - } - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - dapui.setup { - icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, - controls = { - icons = { - pause = '⏸', - play = '▶', - step_into = '⏎', - step_over = '⏭', - step_out = '⏮', - step_back = 'b', - run_last = '▶▶', - terminate = '⏹', - disconnect = '⏏', - }, - }, - } - - -- Change breakpoint icons - -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) - -- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) - -- local breakpoint_icons = vim.g.have_nerd_font - -- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } - -- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } - -- for type, icon in pairs(breakpoint_icons) do - -- local tp = 'Dap' .. type - -- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' - -- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) - -- end - - dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close - - -- Install golang specific config - require('dap-go').setup { - delve = { - -- On Windows delve must be run attached or it crashes. - -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring - detached = vim.fn.has 'win32' == 0, - }, - } + setup_mason_dap() + setup_dapui_config(dapui) + setup_dap_listeners(dap, dapui) + setup_language_adapters(dap) + setup_keymaps(dap, dapui) +end - require('dap-python').setup 'python3' +-- Plugin specification +-- Configures nvim-dap with all necessary dependencies for debugging +---@return table # Plugin specification for lazy.nvim +return { + 'mfussenegger/nvim-dap', + dependencies = { + 'rcarriga/nvim-dap-ui', -- Beautiful debugger UI + 'nvim-neotest/nvim-nio', -- Required dependency for nvim-dap-ui + 'williamboman/mason.nvim', -- Package manager for debug adapters + 'jay-babu/mason-nvim-dap.nvim', -- Mason integration for DAP + 'leoluz/nvim-dap-go', -- Go debugging support + 'mfussenegger/nvim-dap-python', -- Python debugging support + }, + config = function() + setup_dap() end, } diff --git a/nvim/.config/nvim/lua/plugins/lint.lua b/nvim/.config/nvim/lua/plugins/lint.lua index 1361816..66923a7 100644 --- a/nvim/.config/nvim/lua/plugins/lint.lua +++ b/nvim/.config/nvim/lua/plugins/lint.lua @@ -11,6 +11,7 @@ return { lint.linters_by_ft['terraform'] = { 'tflint' } lint.linters_by_ft['python'] = { 'ruff', 'bandit' } lint.linters_by_ft['markdown'] = nil + lint.linters_by_ft['text'] = nil lint.linters_by_ft['sh'] = { 'shellcheck' } -- Default linters, which will cause errors unless these tools are available: diff --git a/nvim/.config/nvim/lua/plugins/lsp.lua b/nvim/.config/nvim/lua/plugins/lsp.lua index ced27a2..c184284 100644 --- a/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/nvim/.config/nvim/lua/plugins/lsp.lua @@ -37,8 +37,8 @@ return { vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), callback = function(event) - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. + -- Utility to more easily define mappings specific for LSP related items. + -- It sets the mode, buffer and description for us each time. local map = function(keys, func, desc, mode) mode = mode or 'n' vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) @@ -87,10 +87,7 @@ return { -- -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) - if - client - and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) - then + if client and client:supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then local highlight_augroup = vim.api.nvim_create_augroup('lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -196,6 +193,8 @@ return { }, }, stylua = {} + tailwindcss = {}, + mesonlsp = {}, } -- Ensure the servers and tools above are installed diff --git a/nvim/.config/nvim/lua/plugins/neo-tree.lua b/nvim/.config/nvim/lua/plugins/neo-tree.lua index 556111b..fa2b5db 100644 --- a/nvim/.config/nvim/lua/plugins/neo-tree.lua +++ b/nvim/.config/nvim/lua/plugins/neo-tree.lua @@ -22,5 +22,19 @@ return { }, }, }, + filtered_items = { + visible = true, + hide_dotfiles = false, + hide_gitignored = true, + hide_by_name = { + '.DS_Store', + 'thumbs.db', + '.git', + }, + always_show_by_pattern = { + '.env*', + '.gitignore', + }, + }, }, } diff --git a/nvim/.config/nvim/lua/plugins/obsidian.lua b/nvim/.config/nvim/lua/plugins/obsidian.lua new file mode 100644 index 0000000..a29e9f8 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/obsidian.lua @@ -0,0 +1,20 @@ +return { + 'epwalsh/obsidian.nvim', + version = '*', + lazy = true, + event = { + 'BufReadPre ' .. vim.fn.expand '~' .. '/Documents/Notes/*.md', + 'BufNewFile ' .. vim.fn.expand '~' .. '/Documents/Notes/*.md', + }, + dependencies = { + 'nvim-lua/plenary.nvim', + }, + opts = { + workspaces = { + { + name = 'personal', + path = '~/Documents/Notes', + }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 5157aea..9e3c703 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -39,15 +39,25 @@ return { -- [[ Configure Telescope ]] -- See `:help telescope` and `:help telescope.setup()` require('telescope').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 = { ['<c-enter>'] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} + defaults = { + vimgrep_arguments = { + 'rg', + '--color=never', + '--no-heading', + '--with-filename', + '--line-number', + '--column', + '--smart-case', + '--hidden', + '--glob', + '!.git/*', + }, + }, + pickers = { + find_files = { + find_command = { 'fd', '--type', 'f', '--hidden', '--strip-cwd-prefix', '--exclude', '.git' }, + }, + }, extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(), diff --git a/nvim/.config/nvim/lua/plugins/tmux-navigator.lua b/nvim/.config/nvim/lua/plugins/tmux-navigator.lua new file mode 100644 index 0000000..a161285 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/tmux-navigator.lua @@ -0,0 +1,20 @@ +--- Vim Tmux Navigator is a plugin that allows you to navigate between Vim and Tmux panes seamlessly. + +return { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + 'TmuxNavigatorProcessList', + }, + keys = { + { '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' }, + { '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' }, + { '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' }, + { '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' }, + { '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/vim-sleuth.lua b/nvim/.config/nvim/lua/plugins/vim-sleuth.lua index 93904da..d9a0887 100644 --- a/nvim/.config/nvim/lua/plugins/vim-sleuth.lua +++ b/nvim/.config/nvim/lua/plugins/vim-sleuth.lua @@ -1,5 +1,4 @@ -- Detect tabstop and shiftwidth automatically - return { 'tpope/vim-sleuth', } |