diff --git a/init.lua b/init.lua index 345aa71..977b5b9 100644 --- a/init.lua +++ b/init.lua @@ -1,115 +1,86 @@ -if vim.g.vscode then - -- VSCode Neovim - require("user.vscode_keymaps") -else - local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) - end - vim.opt.rtp:prepend(lazypath) - - -- Set as the leader key - -- See `:help mapleader` - -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) - vim.g.mapleader = " " - vim.g.maplocalleader = " " - - require("lazy").setup("plugins", { - lockfile = vim.fn.stdpath("data") .. "/lazy-lock.json", -- in data directory as normal location read only as managed by nix - dev = { - path = "~/Projects/Neovim", - }, +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, }) - - -- [[ Setting options ]] - -- See `:help vim.o` - - -- conceal level (needed for obsidian) - vim.o.conceallevel = 1 - - -- Set highlight on search - vim.o.hlsearch = true - vim.o.incsearch = true - - -- clipboard - vim.o.clipboard = "unnamedplus" - - -- Make line numbers default - vim.wo.number = true - - -- Enable mouse mode - vim.o.mouse = "a" - - -- Enable break indent - vim.o.breakindent = true - - -- smart indenting - vim.o.smartindent = true - - -- Save undo history - vim.o.undofile = true - - -- Case insensitive searching UNLESS /C or capital in search - vim.o.ignorecase = true - vim.o.smartcase = true - - -- Decrease update time - vim.o.updatetime = 250 - vim.wo.signcolumn = "yes" - - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 - - -- Set completeopt to have a better completion experience - vim.o.completeopt = "menuone,noselect" - - -- [[ Basic Keymaps ]] - - -- Keymaps for better default experience - -- See `:help vim.keymap.set()` - vim.keymap.set({ "n", "v" }, "", "", { silent = true }) - - -- Remap for dealing with word wrap - vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) - vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) - - -- [[ Highlight on yank ]] - -- See `:help vim.highlight.on_yank()` - local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }) - vim.api.nvim_create_autocmd("TextYankPost", { - callback = function() - vim.highlight.on_yank() - end, - group = highlight_group, - pattern = "*", - }) - - -- sets the tab size for json files - vim.api.nvim_create_autocmd("FileType", { - pattern = { "json", "lua", "nix" }, - callback = function() - vim.bo.tabstop = 2 - vim.bo.shiftwidth = 2 - vim.bo.expandtab = true - end, - }) - - -- Terminal Escape Key Mapping - vim.keymap.set("t", "", [[]]) - - -- Diagnostic keymaps - vim.keymap.set("n", "[d", vim.diagnostic.goto_prev) - vim.keymap.set("n", "]d", vim.diagnostic.goto_next) - vim.keymap.set("n", "e", vim.diagnostic.open_float) - vim.keymap.set("n", "q", vim.diagnostic.setloclist) - - -- The line beneath this is called `modeline`. See `:help modeline` - -- vim: ts=2 sts=2 sw=2 et end +vim.opt.rtp:prepend(lazypath) + +-- Set as the leader key +-- See `:help mapleader` +-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +require("lazy").setup("plugins") + +-- [[ Setting options ]] +-- See `:help vim.o` + +-- Set highlight on search +vim.o.hlsearch = false +vim.o.incsearch = true + +-- clipboard +vim.o.clipboard = "unnamedplus" + +-- Make line numbers default +vim.wo.number = true + +-- Enable mouse mode +vim.o.mouse = "a" + +-- Enable break indent +vim.o.breakindent = true + +-- Save undo history +vim.o.undofile = true + +-- Case insensitive searching UNLESS /C or capital in search +vim.o.ignorecase = true +vim.o.smartcase = true + +-- Decrease update time +vim.o.updatetime = 250 +vim.wo.signcolumn = "yes" + +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +-- Set completeopt to have a better completion experience +vim.o.completeopt = "menuone,noselect" + +-- [[ Basic Keymaps ]] + +-- Keymaps for better default experience +-- See `:help vim.keymap.set()` +vim.keymap.set({ "n", "v" }, "", "", { silent = true }) + +-- Remap for dealing with word wrap +vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) +vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) + +-- [[ Highlight on yank ]] +-- See `:help vim.highlight.on_yank()` +local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }) +vim.api.nvim_create_autocmd("TextYankPost", { + callback = function() + vim.highlight.on_yank() + end, + group = highlight_group, + pattern = "*", +}) + +-- Diagnostic keymaps +vim.keymap.set("n", "[d", vim.diagnostic.goto_prev) +vim.keymap.set("n", "]d", vim.diagnostic.goto_next) +vim.keymap.set("n", "e", vim.diagnostic.open_float) +vim.keymap.set("n", "q", vim.diagnostic.setloclist) + +-- The line beneath this is called `modeline`. See `:help modeline` +-- vim: ts=2 sts=2 sw=2 et diff --git a/lua/plugins/avante.lua b/lua/plugins/avante.lua deleted file mode 100644 index b1ca857..0000000 --- a/lua/plugins/avante.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - "yetone/avante.nvim", - event = "VeryLazy", - lazy = false, - version = false, - opts = { - provider = "claude", - providers = { - claude = { - model = "claude-sonnet-4-20250514", - api_key_name = "cmd:cat " .. vim.fn.expand("~/.anthropic"), - }, - openai = { - model = "o4-mini", - api_key_name = "cmd:cat " .. vim.fn.expand("~/.openai"), - extra_request_body = { - reasoning_effort = "high", - }, - }, - ollama = { - __inherited_from = "openai", - api_key_name = "", - endpoint = "http://127.0.0.1:11434", - model = "qwen2.5-coder", - }, - }, - }, - -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - build = "make", - dependencies = { - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - "HakonHarnes/img-clip.nvim", - "nvim-tree/nvim-web-devicons", - "nvim-treesitter/nvim-treesitter", - "folke/snacks.nvim", - }, -} diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua deleted file mode 100644 index 4a872d3..0000000 --- a/lua/plugins/conform.lua +++ /dev/null @@ -1,46 +0,0 @@ -return { - "stevearc/conform.nvim", - config = function() - require("conform").setup({ - formatters_by_ft = { - lua = { "stylua" }, - nix = { "nixfmt" }, - python = function(bufnr) - if require("conform").get_formatter_info("ruff_format", bufnr).available then - return { "ruff_fix", "ruff_format" } - else - return { "isort", "black", "flake8" } - end - end, - scala = { "scalafmt" }, - swift = { "swift_format" }, - ["*"] = { "trim_whitespace", "trim_newlines" }, - }, - format_on_save = function(bufnr) - -- Disable with a global or buffer-local variable - if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then - return - end - return { timeout_ms = 500, lsp_fallback = true } - end, - }) - - vim.api.nvim_create_user_command("FormatDisable", function(args) - if args.bang then - -- FormatDisable! will disable formatting just for this buffer - vim.b.disable_autoformat = true - else - vim.g.disable_autoformat = true - end - end, { - desc = "Disable autoformat-on-save", - bang = true, - }) - 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/lua/plugins/copilot.lua b/lua/plugins/copilot.lua deleted file mode 100644 index 99b091d..0000000 --- a/lua/plugins/copilot.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "github/copilot.vim", - lazy = false, - config = function() - vim.api.nvim_set_keymap( - "i", - "", - 'copilot#Accept("\\")', - { silent = true, script = true, expr = true, replace_keycodes = false } - ) - vim.g.copilot_no_tab_map = true - vim.g.copilot_assume_mapped = true - end, -} diff --git a/lua/plugins/img-clip.lua b/lua/plugins/img-clip.lua deleted file mode 100644 index 2ffeac0..0000000 --- a/lua/plugins/img-clip.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - "HakonHarnes/img-clip.nvim", - event = "BufEnter", - opts = { - default = { - embed_image_as_base64 = false, - prompt_for_file_name = false, - drag_and_drop = { - insert_mode = true, - }, - use_absolute_path = true, - }, - }, - keys = { - -- suggested keymap - { "p", "PasteImage", desc = "Paste clipboard image" }, - }, -} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index fee8d09..06421ee 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -11,15 +11,11 @@ return { lazy = false, -- make sure we load this during startup if it is your main colorscheme priority = 1000, -- make sure to load this before all the other start plugins config = function() - require("tokyonight").setup({ - style = "night", - on_colors = function(colors) - colors.bg = "#000000" -- "#1a1b26" - end, - }) + vim.g.tokyonight_style = "night" + vim.g.tokyonight_italic_functions = true vim.o.termguicolors = true -- load the colorscheme here - vim.cmd([[colorscheme tokyonight-night]]) + vim.cmd([[colorscheme tokyonight]]) end, }, { @@ -31,8 +27,6 @@ return { { "folke/which-key.nvim", lazy = false }, { "j-hui/fidget.nvim", - tag = "legacy", - event = "LspAttach", config = function() require("fidget").setup() end, @@ -50,12 +44,20 @@ return { "softinio/scaladex.nvim", { "lukas-reineke/indent-blankline.nvim", - main = "ibl", config = function() - require("ibl").setup({ - indent = { char = "┊" }, + require("indent_blankline").setup({ + char = "┊", + show_trailing_blankline_indent = false, }) end, }, - "SidOfc/mkdx", + "tpope/vim-fugitive", + "tpope/vim-rhubarb", + "tpope/vim-sleuth", + { + "numToStr/Comment.nvim", + config = function() + require("Comment").setup() + end, + }, } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 53dfcfe..8819d72 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,22 +1,25 @@ 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", -- Additional lua configuration, makes nvim stuff amazing "folke/neodev.nvim", - - -- schemas for json and yaml files - "b0o/schemastore.nvim", }, config = function() -- LSP settings. - -- Require the lspconfig module - local lspconfig = require("lspconfig") -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) - -- We create a function that lets us more easily define mappings specific + -- NOTE: Remember that lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself + -- many times. + -- + -- 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. local nmap = function(keys, func, desc) if desc then @@ -54,78 +57,49 @@ return { end, { desc = "Format current buffer with LSP" }) end + -- Enable the following language servers + -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. + -- + -- Add any additional override configuration in the following tables. They will be passed to + -- the `settings` field of the server config. You must look up that documentation yourself. local servers = { - basedpyright = { - analysis = { - autoImportCompletions = true, - autoSearchPaths = true, - diagnosticMode = "openFilesOnly", - reportMissingImports = true, - reportMissingParameterType = true, - reportUnnecessaryComparison = true, - reportUnnecessaryContains = true, - reportUnusedClass = true, - reportUnusedFunction = true, - reportUnsedImports = true, - reportUnsusedVariables = true, - typeCheckingMode = "all", - useLibraryCodeForTypes = true, - }, - }, - bashls = { - bashIde = { - globPattern = "*@(.sh|.inc|.bash|.command)", - }, - }, - html = {}, - jqls = {}, - jsonls = { - json = { - format = { - enable = true, - }, - schemas = require("schemastore").json.schemas(), - validate = true, - }, - }, - lua_ls = { + -- clangd = {}, + -- gopls = {}, + -- pyright = {}, + -- rust_analyzer = {}, + -- tsserver = {}, + + sumneko_lua = { Lua = { - diagnostics = { globals = { "vim" } }, workspace = { checkThirdParty = false }, telemetry = { enable = false }, }, }, - marksman = {}, - nil_ls = {}, - nixd = {}, - pyrefly = {}, - rust_analyzer = { - diagnostics = { - enable = true, - }, - }, - sourcekit = { - workspace = { - didChangeConfiguration = { - dynamicRegistration = true, - }, - }, - }, - ts_ls = {}, - yamlls = {}, } + + -- -- nvim-cmp supports additional completion capabilities, so broadcast that to servers local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) - -- Iterate over the servers table and configure each one - for server, config in pairs(servers) do - -- Set up the server using the `config` if provided, otherwise just `on_attach` and `capabilities` - lspconfig[server].setup({ - on_attach = on_attach, - capabilities = capabilities, - settings = config, -- Pass the specific server settings here - }) - end + -- Setup mason so it can manage external tooling + require("mason").setup() + + -- Ensure the servers above are installed + local mason_lspconfig = require("mason-lspconfig") + + mason_lspconfig.setup({ + ensure_installed = vim.tbl_keys(servers), + }) + + mason_lspconfig.setup_handlers({ + function(server_name) + require("lspconfig")[server_name].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = servers[server_name], + }) + end, + }) end, } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index ba3a5ec..860989d 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -2,47 +2,13 @@ return { "nvim-lualine/lualine.nvim", lazy = false, config = function() - -- Default from its README then customized - -- Added metals status require("lualine").setup({ options = { - icons_enabled = true, - theme = "auto", - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = { - statusline = {}, - winbar = {}, - }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - }, + icons_enabled = false, + theme = "tokyonight", + component_separators = "|", + section_separators = "", }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", "diff", "diagnostics" }, - lualine_c = { "filename" }, - lualine_x = { "g:metals_status", "encoding", "fileformat", "filetype", "overseer" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {}, }) end, } diff --git a/lua/plugins/markdown-composer.lua b/lua/plugins/markdown-composer.lua deleted file mode 100644 index 4d6cb1c..0000000 --- a/lua/plugins/markdown-composer.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "euclio/vim-markdown-composer", - build = "cargo build --release", -} diff --git a/lua/plugins/mind.lua b/lua/plugins/mind.lua new file mode 100644 index 0000000..a4ee7b7 --- /dev/null +++ b/lua/plugins/mind.lua @@ -0,0 +1,7 @@ +return { + "phaazon/mind.nvim", + branch = "v2.2", + config = function() + require("mind").setup() + end, +} diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index 68bf8fe..d1b3038 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -10,17 +10,6 @@ return { { "m", "Neotree toggle", desc = "NeoTree" }, }, config = function() - require("neo-tree").setup({ - window = { - position = "right", - }, - filesystem = { - filtered_items = { - visible = true, - hide_dotfiles = false, - hide_gitignored = true, - }, - }, - }) + require("neo-tree").setup() end, } diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua deleted file mode 100644 index 7a049f3..0000000 --- a/lua/plugins/neotest.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - "nvim-neotest/neotest", - dependencies = { - "nvim-neotest/nvim-nio", - "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim", - "nvim-treesitter/nvim-treesitter", - "nvim-neotest/neotest-python", - "stevanmilic/neotest-scala", - }, - keys = { - { "na", "lua require('neotest').run.attach()", desc = "Attach to the nearest test" }, - { "nl", "lua require('neotest').run.run_last()", desc = "Toggle Test Summary" }, - { "no", "lua require('neotest').output_panel.toggle()", desc = "Toggle Test Output Panel" }, - { "np", "lua require('neotest').run.stop()", desc = "Stop the nearest test" }, - { "ns", "lua require('neotest').summary.toggle()", desc = "Toggle Test Summary" }, - { "nt", "lua require('neotest').run.run()", desc = "Run the nearest test" }, - { - "nT", - "lua require('neotest').run.run(vim.fn.expand('%'))", - desc = "Run test the current file", - }, - }, - opts = { - adapters = { - ["neotest-python"] = { - runner = "pytest", - args = { "-vvv" }, - python = ".venv/bin/python", - }, - ["neotest-scala"] = { - runner = "sbt", - command = "test", - framework = "munit", - }, - }, - }, -} diff --git a/lua/plugins/nvim-aider.lua b/lua/plugins/nvim-aider.lua deleted file mode 100644 index 8913bff..0000000 --- a/lua/plugins/nvim-aider.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "GeorgesAlkhouri/nvim-aider", - cmd = { - "AiderTerminalToggle", - "AiderHealth", - }, - keys = { - { "a/", "AiderTerminalToggle", desc = "Open Aider" }, - { "as", "AiderTerminalSend", desc = "Send to Aider", mode = { "n", "v" } }, - { "ac", "AiderQuickSendCommand", desc = "Send Command To Aider" }, - { "ab", "AiderQuickSendBuffer", desc = "Send Buffer To Aider" }, - { "a+", "AiderQuickAddFile", desc = "Add File to Aider" }, - { "a-", "AiderQuickDropFile", desc = "Drop File from Aider" }, - { "ar", "AiderQuickReadOnlyFile", desc = "Add File as Read-Only" }, - }, - config = true, -} diff --git a/lua/plugins/nvim-metals.lua b/lua/plugins/nvim-metals.lua index 8cedf90..635196b 100644 --- a/lua/plugins/nvim-metals.lua +++ b/lua/plugins/nvim-metals.lua @@ -1,6 +1,5 @@ return { "scalameta/nvim-metals", - lazy = false, keys = { { "ws", "lua require'metals'.hover_worksheet()", desc = "Metals Worksheet" }, { @@ -11,32 +10,12 @@ return { }, config = function() local metals_config = require("metals").bare_config() - metals_config.tvp = { - icons = { - enabled = true, - }, - } metals_config.settings = { - serverVersion = "latest.snapshot", - useGlobalExecutable = true, showImplicitArguments = true, - showImplicitConversionsAndClasses = true, - showInferredType = true, - bloopSbtAlreadyInstalled = true, excludedPackages = { "akka.actor.typed.javadsl", "com.github.swagger.akka.javadsl" }, - -- fallbackScalaVersion = "2.13.8", - superMethodLensesEnabled = true, } - metals_config.on_attach = function(client, bufnr) - vim.keymap.set("n", "tt", require("metals.tvp").toggle_tree_view) - vim.keymap.set("n", "tr", require("metals.tvp").reveal_in_tree) - vim.cmd([[autocmd CursorHold lua vim.lsp.buf.document_highlight()]]) - vim.cmd([[autocmd CursorMoved lua vim.lsp.buf.clear_references()]]) - vim.cmd([[autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh()]]) - end - metals_config.init_options.statusBarProvider = "on" metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() diff --git a/lua/plugins/obsidian.lua b/lua/plugins/obsidian.lua deleted file mode 100644 index 0637aa1..0000000 --- a/lua/plugins/obsidian.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - "epwalsh/obsidian.nvim", - lazy = true, - ft = "markdown", - dependencies = { - "nvim-lua/plenary.nvim", - }, - keys = { - { "fo", "ObsidianQuickSwitch", desc = "Obsidian Quick Switch (Telescope)" }, - { "fn", "ObsidianNew", desc = "Create a new obsidian note" }, - { "fs", "ObsidianSearch", desc = "Obsidian Search" }, - { "fd", "ObsidianToday", desc = "Obsidian new daily note" }, - }, - opts = { - workspaces = { - { - name = "personal", - path = "/Users/salar/Library/Mobile Documents/iCloud~md~obsidian/Documents/Softinio", - }, - }, - }, -} diff --git a/lua/plugins/octo.lua b/lua/plugins/octo.lua deleted file mode 100644 index acbaeaf..0000000 --- a/lua/plugins/octo.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - "pwntester/octo.nvim", - cmd = "Octo", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope.nvim", - "nvim-tree/nvim-web-devicons", - }, - config = function() - require("octo").setup({ - enable_builtin = true, - file_panel = { use_icons = true }, - mappings = { - review_diff = { - select_next_entry = { lhs = "", desc = "move to previous changed file" }, - select_prev_entry = { lhs = "", desc = "move to next changed file" }, - }, - }, - }) - vim.treesitter.language.register("markdown", "octo") - end, - keys = { - { "o", "Octo", desc = "Octo" }, - }, -} diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua deleted file mode 100644 index c003c2b..0000000 --- a/lua/plugins/snacks.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "folke/snacks.nvim", - priority = 1000, - lazy = false, - ---@type snacks.Config - opts = {}, -} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index c460410..818dd8b 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -4,8 +4,6 @@ return { dependencies = { "nvim-lua/plenary.nvim", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - "debugloop/telescope-undo.nvim", - "nvim-telescope/telescope-ui-select.nvim", }, config = function() require("telescope").setup({ @@ -22,8 +20,6 @@ return { -- Enable telescope fzf native, if installed pcall(require("telescope").load_extension, "fzf") pcall(require("telescope").load_extension, "scaladex") - pcall(require("telescope").load_extension, "ui-select") - pcall(require("telescope").load_extension, "undo") -- See `:help telescope.builtin` vim.keymap.set("n", "?", require("telescope.builtin").oldfiles, { desc = "[?] Find recently opened files" }) @@ -41,6 +37,5 @@ return { vim.keymap.set("n", "sw", require("telescope.builtin").grep_string, { desc = "[S]earch current [W]ord" }) vim.keymap.set("n", "sg", require("telescope.builtin").live_grep, { desc = "[S]earch by [G]rep" }) vim.keymap.set("n", "sd", require("telescope.builtin").diagnostics, { desc = "[S]earch [D]iagnostics" }) - vim.keymap.set("n", "su", "Telescope undo", { desc = "[S]earch [U]ndo" }) end, } diff --git a/lua/plugins/texlabconfig.lua b/lua/plugins/texlabconfig.lua new file mode 100644 index 0000000..0d745fa --- /dev/null +++ b/lua/plugins/texlabconfig.lua @@ -0,0 +1,40 @@ +return { + "f3fora/nvim-texlabconfig", + build = "go build", + dependencies = { "lervag/vimtex" }, + config = function() + -- vimtex + vim.g.vimtex_view_method = "skim" + vim.g.vimtex_compiler_method = "tectonic" + + -- nvim-texlabconfig + local tex_preview_executable = "/Applications/Skim.app/Contents/SharedSupport/displayline" + local tex_preview_args = { "%l", "%p", "%f" } + local texlab_build_executable = "tectonic" + local texlab_build_args = { + "-X", + "compile", + "%f", + "--synctex", + "--keep-logs", + "--keep-intermediates", + } + require("texlabconfig").setup({ + cache_activate = true, + cache_filetypes = { "tex", "bib" }, + reverse_search_edit_cmd = vim.cmd.edit, + settings = { + texlab = { + build = { + executable = texlab_build_executable, + args = texlab_build_args, + }, + forwardSearch = { + executable = tex_preview_executable, + args = tex_preview_args, + }, + }, + }, + }) + end, +} diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua deleted file mode 100644 index 1d88635..0000000 --- a/lua/plugins/todo-comments.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - keys = { - { "t", "TodoTelescope", desc = "To Do Comments" }, - }, - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }, -} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 843cbcf..dfd4698 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -4,28 +4,28 @@ return { -- build = function() -- pcall(require("nvim-treesitter.install").update({ with_sync = true })) -- end, - dependencies = { - "nvim-treesitter/nvim-treesitter-context", - "nvim-treesitter/nvim-treesitter-refactor", - "nvim-treesitter/nvim-treesitter-textobjects", - "nvim-treesitter/playground", - }, + dependencies = { "nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/playground" }, config = function() require("nvim-treesitter.configs").setup({ -- Add languages to be installed here that you want installed for treesitter ensure_installed = { - "awk", - "bash", "c", "cpp", - "css", + "go", + "lua", + "python", + "rust", + "typescript", + "help", + "vim", + "scala", + "bash", "dockerfile", "fish", "git_rebase", "gitattributes", "gitcommit", "gitignore", - "go", "haskell", "hocon", "html", @@ -34,25 +34,12 @@ return { "javascript", "json", "json5", - "jsonc", "latex", - "lua", "make", - "markdown", "markdown_inline", "nix", - "proto", - "python", - "rust", - "scala", - "scss", "sql", - "swift", "terraform", - "toml", - "typescript", - "vim", - "xml", "yaml", }, @@ -64,13 +51,7 @@ return { auto_install = true, highlight = { enable = true }, - indent = { - enable = true, - disable = { - "python", - "css", - }, - }, + indent = { enable = true, disable = { "python" } }, incremental_selection = { enable = true, keymaps = { diff --git a/lua/user/vscode_keymaps.lua b/lua/user/vscode_keymaps.lua deleted file mode 100644 index d239c88..0000000 --- a/lua/user/vscode_keymaps.lua +++ /dev/null @@ -1,50 +0,0 @@ -local keymap = vim.keymap.set -local opts = { noremap = true, silent = true } - --- remap leader key -keymap("n", "", "", opts) -vim.g.mapleader = " " -vim.g.maplocalleader = " " - --- highligh yank -vim.api.nvim_set_hl(0, "YankHighlight", { bg = "#d19a66" }) -vim.api.nvim_create_autocmd("TextYankPost", { - callback = function() - vim.highlight.on_yank({ higroup = "YankHighlight", timeout = 200 }) - end, - pattern = "*", -}) - --- yank to system clipboard -keymap({ "n", "v" }, "y", '"+y', opts) - --- paste from system clipboard -keymap({ "n", "v" }, "p", '"+p', opts) - --- better indent handling -keymap("v", "<", "", ">gv", opts) - --- move text up and down -keymap("v", "J", ":m .+1==", opts) -keymap("v", "K", ":m .-2==", opts) -keymap("x", "J", ":move '>+1gv-gv", opts) -keymap("x", "K", ":move '<-2gv-gv", opts) - --- paste preserves primal yanked piece -keymap("v", "p", '"_dP', opts) - --- removes highlighting after escaping vim search -keymap("n", "", ":noh", opts) - --- call vscode commands from neovim -keymap({ "n", "v" }, "t", "lua require('vscode').action('workbench.action.terminal.toggleTerminal')") -keymap({ "n", "v" }, "b", "lua require('vscode').action('editor.debug.action.toggleBreakpoint')") -keymap({ "n", "v" }, "d", "lua require('vscode').action('editor.action.showHover')") -keymap({ "n", "v" }, "a", "lua require('vscode').action('editor.action.quickFix')") -keymap({ "n", "v" }, "sp", "lua require('vscode').action('workbench.actions.view.problems')") -keymap({ "n", "v" }, "cn", "lua require('vscode').action('notifications.clearAll')") -keymap({ "n", "v" }, "ff", "lua require('vscode').action('workbench.action.quickOpen')") -keymap({ "n", "v" }, "cp", "lua require('vscode').action('workbench.action.showCommands')") -keymap({ "n", "v" }, "pr", "lua require('vscode').action('code-runner.run')") -keymap({ "n", "v" }, "fd", "lua require('vscode').action('editor.action.formatDocument')")