From ea066e821fdf158baa7660e16cb7797b02e41a46 Mon Sep 17 00:00:00 2001 From: afonsofrancof Date: Fri, 17 Jul 2026 12:12:32 +0100 Subject: [PATCH] feat(nvim): gutentags, harper_ls and disable vim._core.ui2 --- .config/nvim/init.lua | 88 ++++++++++++++++++-------------- .config/nvim/nvim-pack-lock.json | 38 ++++++++------ 2 files changed, 71 insertions(+), 55 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 529d8a0..372117a 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,28 +1,30 @@ -- Set the leader key vim.g.mapleader = " " -- Appearance -vim.opt.termguicolors = true -- Enable 24-bit colors -vim.opt.number = true -- Show line numbers -vim.opt.relativenumber = true -- Show relative line numbers -vim.opt.wrap = false -- Disable line wrapping -vim.opt.conceallevel = 2 -- Hide Org mode links (assuming you use Org mode) -vim.opt.concealcursor = 'nc' -- Conceal text in normal mode only -vim.opt.signcolumn = "yes" -- Always show the sign column -vim.o.laststatus = 1 -- Always show the status line -vim.o.winborder = nil -- Use default border for floating windows -vim.o.foldlevelstart = 99 -- Start with all folds closed +vim.opt.termguicolors = true -- Enable 24-bit colors +vim.opt.number = true -- Show line numbers +vim.opt.relativenumber = true -- Show relative line numbers +vim.opt.wrap = false -- Disable line wrapping +vim.opt.conceallevel = 2 -- Hide Org mode links +vim.opt.concealcursor = 'nc' -- Conceal text in normal mode only +vim.opt.cursorline = true -- Show current line +vim.opt.cursorlineopt = 'number' -- Only show the number in bold, not a line highlight +vim.opt.signcolumn = "yes" -- Always show the sign column +vim.o.laststatus = 1 -- Always show the status line +vim.o.winborder = nil -- Use default border for floating windows +vim.o.foldlevelstart = 99 -- Start with all folds closed -- Indentation -vim.opt.tabstop = 4 -- Number of spaces a tab represents -vim.opt.softtabstop = 4 -- Number of spaces a in Insert mode equals -vim.opt.shiftwidth = 4 -- Number of spaces to use for autoindent -vim.opt.expandtab = true -- Use spaces instead of tabs -vim.opt.smartindent = true -- Smart auto-indenting +vim.opt.tabstop = 4 -- Number of spaces a tab represents +vim.opt.softtabstop = 4 -- Number of spaces a in Insert mode equals +vim.opt.shiftwidth = 4 -- Number of spaces to use for autoindent +vim.opt.expandtab = true -- Use spaces instead of tabs +vim.opt.smartindent = true -- Smart auto-indenting -- Searching -vim.opt.hlsearch = false -- Disable highlighting of search matches -vim.opt.incsearch = true -- Show partial matches while typing +vim.opt.hlsearch = false -- Disable highlighting of search matches +vim.opt.incsearch = true -- Show partial matches while typing -- Behavior and Navigation -vim.opt.iskeyword:append("_") -- Add '_' to the list of keyword characters -vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor when scrolling +vim.opt.iskeyword:append("_") -- Add '_' to the list of keyword characters +vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor when scrolling vim.opt.sidescrolloff = 10 vim.opt.smoothscroll = true -- File Management @@ -35,6 +37,14 @@ vim.opt.swapfile = false -- Disable -- Formatting vim.opt.formatoptions:remove("ro") -- Remove 'ro' from formatoptions vim.opt.completeopt = { 'menuone', 'noinsert', 'popup', 'fuzzy' } +--Move between wrapped lines, but keep relative jumps working +vim.keymap.set({ "n", "v" }, "k", function() + return vim.v.count == 0 and "gk" or "k" +end, { expr = true }) + +vim.keymap.set({ "n", "v" }, "j", function() + return vim.v.count == 0 and "gj" or "j" +end, { expr = true }) --Move lines vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") @@ -113,6 +123,8 @@ vim.pack.add({ 'https://github.com/mfussenegger/nvim-dap', 'https://github.com/igorlfs/nvim-dap-view', 'https://github.com/lervag/vimtex', + -- This needs universal-ctags on macos (can be installed from brew) + --'https://github.com/ludovicchabant/vim-gutentags', 'https://github.com/micangl/cmp-vimtex', 'https://github.com/tpope/vim-fugitive', 'https://github.com/FabijanZulj/blame.nvim', @@ -124,8 +136,8 @@ vim.pack.add({ -- NVIM 0.12 EXPERIMENTAL vim.cmd.packadd('nvim.undotree') -vim.o.cmdheight = 0 -require('vim._core.ui2').enable() +vim.o.cmdheight = 1 +--require('vim._core.ui2').enable() local treesitter = require('nvim-treesitter') vim.api.nvim_create_autocmd('FileType', { @@ -353,21 +365,6 @@ vim.lsp.config["lua_ls"] = { } vim.lsp.enable('lua_ls') -vim.lsp.config["ltex"] = { - capabilities = capabilities, - on_attach = function() require("ltex_extra").setup() end, - settings = { - ltex = { - language = "en-GB", - additionalRules = { - enablePickyRules = true, - languageModel = '~/Downloads/ngrams/', - }, - }, - }, -} -vim.lsp.enable('ltex') - vim.lsp.config["hls"] = { capabilities = capabilities, filetypes = { 'haskell', 'lhaskell', 'cabal' }, @@ -377,6 +374,16 @@ vim.lsp.enable('hls') vim.lsp.config["texlab"] = { capabilities = capabilities } vim.lsp.enable('texlab') +vim.lsp.config["harper_ls"] = { + settings = { + ["harper-ls"] = { + dialect = "British", + excludePatterns = { "*acronyms.tex", "*.go" } + } + } +} +vim.lsp.enable('harper_ls') + vim.lsp.config["bashls"] = { capabilities = capabilities } vim.lsp.enable('bashls') @@ -397,7 +404,8 @@ vim.lsp.enable('pyright') -- vimtex -- if vim.loop.os_uname().sysname == "Darwin" then - vim.g.vimtex_view_method = 'skim' + vim.g.vimtex_view_method = 'sioyek' + vim.g.vimtex_view_sioyek_options = '--reuse-window' -- vim.g.vimtex_view_method = 'zathura' -- vim.g.vimtex_view_zathura_use_synctex = 0 else @@ -418,6 +426,10 @@ vim.g.vimtex_compiler_latexmk = { } vim.g.vimtex_view_automatic = 1 +-- gutentags -- +if vim.loop.os_uname().sysname == "Darwin" then + vim.g.gutentags_ctags_executable = '/opt/homebrew/bin/ctags' +end -- blink.cmp -- if vim.g.vscode ~= 1 then @@ -511,7 +523,7 @@ require('conform').setup({ -- lint -- local lint = require('lint') -lint.linters_by_ft = { go = { "golangcilint" } } +--lint.linters_by_ft = { go = { "golangcilint" } } vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { group = vim.api.nvim_create_augroup("lint", { clear = true }), diff --git a/.config/nvim/nvim-pack-lock.json b/.config/nvim/nvim-pack-lock.json index be15736..0d438c0 100644 --- a/.config/nvim/nvim-pack-lock.json +++ b/.config/nvim/nvim-pack-lock.json @@ -19,7 +19,7 @@ "src": "https://github.com/micangl/cmp-vimtex" }, "conform.nvim": { - "rev": "9fd3b3a91b0981d60d2bc688c8cd1680320ee5de", + "rev": "619363c30309d29ffa631e67c8183f2a72caa373", "src": "https://github.com/stevearc/conform.nvim" }, "friendly-snippets": { @@ -27,7 +27,7 @@ "src": "https://github.com/rafamadriz/friendly-snippets" }, "fzf-lua": { - "rev": "23f71140754b9162551dc8ccc1d6346e4275ecc2", + "rev": "1c91f217f394b8c5c628f9e900fc52e923c850fa", "src": "https://github.com/ibhagwan/fzf-lua" }, "harpoon": { @@ -39,6 +39,10 @@ "rev": "0074b551a17338ccdcd299bd86687cc651bcb33d", "src": "https://github.com/smjonas/inc-rename.nvim" }, + "kulala.nvim": { + "rev": "5a2883ce52bc5feb6eb1f0ddd19de06bb4033144", + "src": "https://github.com/mistweaverco/kulala.nvim" + }, "lazydev.nvim": { "rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d", "src": "https://github.com/folke/lazydev.nvim" @@ -48,43 +52,43 @@ "src": "https://github.com/barreiroleo/ltex-extra.nvim" }, "mason.nvim": { - "rev": "8e921c2b68571e978db5d4d3fef9c9a7f8755473", + "rev": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d", "src": "https://github.com/williamboman/mason.nvim" }, "mini.ai": { - "rev": "bfb26d9072670c3aaefab0f53024b2f3729c8083", + "rev": "d73c36349aa7b0bab5f77ad71701a1d42211a1df", "src": "https://github.com/echasnovski/mini.ai", "version": ">=0.0.0" }, "mini.icons": { - "rev": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428", + "rev": "e56797f90192d81f1fda02e662fc3e8e3d775027", "src": "https://github.com/echasnovski/mini.icons", "version": ">=0.0.0" }, "mini.pairs": { - "rev": "d5a29b6254dad07757832db505ea5aeab9aad43a", + "rev": "4a014143fcb4e9df26198ccb3ecff3b9e77a048c", "src": "https://github.com/echasnovski/mini.pairs", "version": ">=0.0.0" }, "mini.surround": { - "rev": "88c52297ed3e69ecf9f8652837888ecc727a28ee", + "rev": "580e4cb98c5900d9fe743865fb5a5b2178b4ab18", "src": "https://github.com/echasnovski/mini.surround", "version": ">=0.0.0" }, "nvim-dap": { - "rev": "45a69eba683a2c448dd9ecfc4de89511f0646b5f", + "rev": "9e848e09a697ee95302a3ef2dd43fd6eb709e570", "src": "https://github.com/mfussenegger/nvim-dap" }, "nvim-dap-view": { - "rev": "b5cc6e1c4cd188478fdad2e0b58dbca08fd6d363", + "rev": "440ec66c2b26470ec97cd4d6667cdd4b51cbc7cb", "src": "https://github.com/igorlfs/nvim-dap-view" }, "nvim-lint": { - "rev": "665525810630701b84181e4d9eefd24b49845b29", + "rev": "a219b2c9e5b4765e5c845aba119dad55806fcaf1", "src": "https://github.com/mfussenegger/nvim-lint" }, "nvim-lspconfig": { - "rev": "8f7e64066e2641d5e7d494962a9c7051e3d38dd5", + "rev": "d224a1920728ba129880efc700d4a0180ac4ecbb", "src": "https://github.com/neovim/nvim-lspconfig" }, "nvim-treesitter": { @@ -96,11 +100,11 @@ "src": "https://github.com/nvim-treesitter/nvim-treesitter-textobjects" }, "nvim-web-devicons": { - "rev": "2795c26c916bb3c57dde308b82be51971fa92747", + "rev": "dad71387de386a946b123079d0e53f23028f3abd", "src": "https://github.com/nvim-tree/nvim-web-devicons" }, "oil.nvim": { - "rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e", + "rev": "b73018b75affd13fa38e2fc94ef753b465f770d7", "src": "https://github.com/stevearc/oil.nvim" }, "onedark.nvim": { @@ -112,15 +116,15 @@ "src": "https://github.com/nvim-lua/plenary.nvim" }, "smart-splits.nvim": { - "rev": "9053ebd394c38fe55fd2f4710daec27411c34fb9", + "rev": "ebf4d8bbc16570817c0f5275468466b9d00b8d7d", "src": "https://github.com/mrjones2014/smart-splits.nvim" }, "snacks.nvim": { - "rev": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e", + "rev": "882c996cf28183f4d63640de0b4c02ec886d01f2", "src": "https://github.com/folke/snacks.nvim" }, "tiny-glimmer.nvim": { - "rev": "cc285167914e947fc130523d02927fdaf24636a6", + "rev": "f26728abf811324d7ed6b035a11d7b76a27c06c3", "src": "https://github.com/rachartier/tiny-glimmer.nvim" }, "todo-comments.nvim": { @@ -136,7 +140,7 @@ "src": "https://github.com/tpope/vim-fugitive" }, "vimtex": { - "rev": "182ad387e3f3107699483606c9a2b6648f8437b2", + "rev": "a5949d2800c1866c878956d49c51fc8d003c6b99", "src": "https://github.com/lervag/vimtex" } }