From a2d6d1d7298eaa7d87aba16a5c3df76ec2e9c5eb Mon Sep 17 00:00:00 2001 From: seajee Date: Fri, 9 Jan 2026 20:54:16 +0100 Subject: [PATCH] [neovim] Yes --- neovim/.config/nvim/.luarc.json | 13 -- neovim/.config/nvim/init.lua | 81 +++---- neovim/.config/nvim/init.lua.old | 349 ------------------------------- 3 files changed, 44 insertions(+), 399 deletions(-) delete mode 100644 neovim/.config/nvim/.luarc.json delete mode 100644 neovim/.config/nvim/init.lua.old diff --git a/neovim/.config/nvim/.luarc.json b/neovim/.config/nvim/.luarc.json deleted file mode 100644 index 3ccbb87..0000000 --- a/neovim/.config/nvim/.luarc.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "runtime.version": "LuaJIT", - "runtime.path": [ - "lua/?.lua", - "lua/?/init.lua" - ], - "diagnostics.globals": ["vim"], - "workspace.checkThirdParty": false, - "workspace.library": [ - "$VIMRUNTIME", - "${3rd}/luv/library" - ] -} diff --git a/neovim/.config/nvim/init.lua b/neovim/.config/nvim/init.lua index 6a8dc4b..9fe9c6b 100644 --- a/neovim/.config/nvim/init.lua +++ b/neovim/.config/nvim/init.lua @@ -70,7 +70,7 @@ map("n", "tl", ":tablast") -- Buffers map("n", "n", ":enew") -map("n", "bd", ":bdelete") +map("n", "db", ":bdelete") map("n", "", ":bnext") map("n", "", ":bprevious") map("n", "\\", ":buffer term") @@ -104,38 +104,17 @@ map("n", "", "vertical resize -2") map("n", "", "vertical resize +2") -- Listchars -local listchars = { +opt.listchars = { -- eol = "$", tab = "» ", space = "·", trail = "-" } -opt.listchars = listchars -vim.api.nvim_set_hl(0, "NonText", { fg = "#303030" }) -vim.api.nvim_set_hl(0, "Whitespace", { fg = "#303030" }) -cmd.match([[TrailingWhitespace /\s\+$/]]) -- Toggle listchars map("n", "lc", function() vim.wo.list = not vim.wo.list - if vim.wo.list then - vim.api.nvim_set_hl(0, "TrailingWhitespace", { link = "Error" }) - else - vim.api.nvim_set_hl(0, "TrailingWhitespace", { link = "Whitespace" }) - end end) -vim.api.nvim_create_autocmd({ "InsertEnter", "TermEnter" }, { - callback = function() - opt.listchars.trail = nil - vim.api.nvim_set_hl(0, "TrailingWhitespace", { link = "Whitespace" }) - end -}) -vim.api.nvim_create_autocmd({ "InsertLeave", "TermLeave" }, { - callback = function() - opt.listchars.trail = listchars.space - vim.api.nvim_set_hl(0, "TrailingWhitespace", { link = "Error" }) - end -}) -- [[ PLUGINS ]] -- @@ -162,19 +141,14 @@ opt.rtp:prepend(lazypath) -- Plugins require("lazy").setup({ -- Colorscheme - { - "blazkowolf/gruber-darker.nvim", - opts = { - italic = { - strings = false, - comments = false, - } - } - }, + { "vague-theme/vague.nvim" }, -- Background trasparency { "xiyaowong/transparent.nvim" }, + -- Treesitter + { "nvim-treesitter/nvim-treesitter" }, + -- Fuzzy finder { "echasnovski/mini.pick", opts = {} }, @@ -189,15 +163,44 @@ require("lazy").setup({ { "Vonr/align.nvim", branch = "v2" }, -- Multi cursor - { "brenton-leighton/multiple-cursors.nvim", opts = {} } + { "brenton-leighton/multiple-cursors.nvim", opts = {} }, + + -- Trailing whitespace + { + "kaplanz/retrail.nvim", + opts = { + hlgroup = "Error", + trim = { + auto = false, -- Auto trim on BufWritePre + } + } + }, + + -- Indent blankline + { "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} }, + + -- File tree + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + "nvim-tree/nvim-web-devicons", + }, + lazy = false, -- neo-tree will lazily load itself + opts = { + window = { + width = 32 + } + } + } }) -- Colorscheme -cmd.colorscheme("gruber-darker") +cmd.colorscheme("vague") -- Plugin keymaps -map("n", "bt", ":TransparentToggle") - map("n", "f", ":Pick files") map("n", "b", ":Pick buffers") @@ -219,4 +222,8 @@ map({ "n", "i", "x" }, "", "MultipleCursorsAddDown") map({ "n", "i" }, "", "MultipleCursorsMouseAddDelete") map({ "n", "v", "x" }, "", "MultipleCursorsAddJumpNextMatch") map({ "n", "x" }, "D", "MultipleCursorsJumpNextMatch") -map("n", "|", function() require("multiple-cursors").align() end) +map("n", "|", function() + require("multiple-cursors").align() +end) + +map("n", "p", "Neotree toggle") diff --git a/neovim/.config/nvim/init.lua.old b/neovim/.config/nvim/init.lua.old deleted file mode 100644 index 3808384..0000000 --- a/neovim/.config/nvim/init.lua.old +++ /dev/null @@ -1,349 +0,0 @@ --- Set as the leader key -vim.g.mapleader = " " -vim.g.maplocalleader = " " - --- [[ Setting options ]] - --- Fat cursor --- vim.opt.guicursor = "" - --- Make relative line numbers default -vim.opt.number = true -vim.opt.relativenumber = true - --- Use 4 spaces as tab -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.expandtab = true - --- Smart indentantion -vim.opt.smartindent = true - --- Enable mouse mode -vim.opt.mouse = "a" - --- Don't show the mode, since it's already in the status line -vim.opt.showmode = true -- false - --- Enable break indent -vim.opt.breakindent = true - --- Save undo history -vim.opt.undofile = true -vim.opt.undodir = os.getenv("HOME") .. "/.vim/nvim_undodir" -vim.opt.swapfile = false -vim.opt.backup = false - --- Case-insensitive searching UNLESS \C or one or more capital letters in the search term -vim.opt.ignorecase = true -vim.opt.smartcase = true - --- Incremental search -vim.opt.incsearch = true - --- Keep signcolumn on by default -vim.opt.signcolumn = "yes" -vim.opt.colorcolumn = "79" -- RFC 5322 - --- Decrease update time -vim.opt.updatetime = 250 - --- Decrease mapped sequence wait time --- Displays which-key popup sooner -vim.opt.timeoutlen = 300 - --- Configure how new splits should be opened -vim.opt.splitright = true -vim.opt.splitbelow = false - --- Diable automatic new line at end of file -vim.opt.fixendofline = false - --- Preview substitutions live, as you type! -vim.opt.inccommand = "nosplit" - --- Show which line your cursor is on -vim.opt.cursorline = false - --- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 0 - --- [[ Keymaps ]] - --- Set highlight on search, but clear on pressing in normal mode -vim.opt.hlsearch = true -vim.keymap.set("n", "", "nohlsearch") - --- Netrw -vim.keymap.set("n", "pv", vim.cmd.Ex) - --- Move through quick fixes -vim.keymap.set("n", "", "cnext") -vim.keymap.set("n", "", "cprev") - --- Move text in visual mode -vim.keymap.set("v", "J", "m '>+1gv=gv") -vim.keymap.set("v", "K", "m '<-2gv=gv") - --- Query replace selected text in visual mode -vim.keymap.set("v", "", "y:%s/0//gc") - --- Center screen with vim motions --- vim.keymap.set("n", "", "zz") --- vim.keymap.set("n", "", "zz") -vim.keymap.set("n", "n", "nzzzv") -vim.keymap.set("n", "N", "Nzzzv") - --- System clipboard -vim.keymap.set("n", "y", "\"+y") -vim.keymap.set("v", "y", "\"+y") -vim.keymap.set("n", "Y", "\"+Y") - --- Delete without copying -vim.keymap.set("n", "d", "\"_d") -vim.keymap.set("v", "d", "\"_d") - --- Delete all marks -vim.keymap.set("n", "dm", "delmarks!") - --- Make executable -vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) - --- Change CWD for current tab -vim.keymap.set("n", "cd", "cd %:h | pwd", { silent = true }) - --- Tabs -vim.keymap.set("n", "tt", "tabnew") -vim.keymap.set("n", "tw", "tabc") -vim.keymap.set("n", "tn", "tabn") -vim.keymap.set("n", "tp", "tabp") -vim.keymap.set("n", "tr", "tabr") -vim.keymap.set("n", "tl", "tabl") - --- Buffers -vim.keymap.set("n", "bc", "enew") -vim.keymap.set("n", "bn", "bn") -vim.keymap.set("n", "bp", "bp") -vim.keymap.set("n", "\\", "b term") - --- Diagnostic keymaps -vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous [D]iagnostic message" }) -vim.keymap.set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next [D]iagnostic message" }) -vim.keymap.set("n", "L", vim.diagnostic.open_float, { desc = "Show diagnostic [E]rror messages" }) -vim.keymap.set("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 -vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) - --- [[ Install `lazy.nvim` plugin manager ]] - -local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - vim.fn.system { "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath } -end -vim.opt.rtp:prepend(lazypath) - --- [[ Configure and install plugins ]] - -require("lazy").setup({ - -- "gc" to comment visual regions/lines - { "numToStr/Comment.nvim" }, - - -- Adds git related signs to the gutter, as well as utilities for managing changes - { - "lewis6991/gitsigns.nvim", - config = function() - require("gitsigns").setup() - vim.keymap.set("n", "gp", "Gitsigns preview_hunk") - vim.keymap.set("n", "gb", "Gitsigns toggle_current_line_blame") - end - }, - - -- Fuzzy Finder (files, lsp, etc) - { - "nvim-telescope/telescope.nvim", - branch = "0.1.x", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - local builtin = require('telescope.builtin') - vim.keymap.set('n', 'ff', builtin.find_files, {}) - vim.keymap.set('n', 'fg', builtin.live_grep, {}) - vim.keymap.set('n', 'fb', builtin.buffers, {}) - vim.keymap.set('n', 'fh', builtin.help_tags, {}) - end - }, - - -- File manager - --[[ - { - "X3eRo0/dired.nvim", - dependencies = { "MunifTanjim/nui.nvim" }, - config = function() - require("dired").setup({ - path_separator = "/", - show_banner = false, - show_icons = false, - show_hidden = true, - show_dot_dirs = true, - show_colors = true, - }) - vim.keymap.set("n", "pd", vim.cmd.Dired) - end - }, - ]]-- - - -- Advanced Undo tree - { - "mbbill/undotree", - config = function() - vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) - end - }, - - -- Custom Neovim status line - { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("lualine").setup({ - options = { - theme = "auto", - globalstatus = false, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" } - } - }) - end - }, - - -- Colorscheme - { - "davidosomething/vim-colors-meh", - config = function() - vim.opt.termguicolors = true - vim.cmd.colorscheme("meh") - end - }, - - -- Transparency - { "xiyaowong/transparent.nvim" }, - - -- Listchars - { - "0xfraso/nvim-listchars", - event = "BufEnter", - config = function() - require("nvim-listchars").setup({ - save_state = true, - listchars = { - trail = "-", - -- eol = "↲", - tab = "» ", - space = "·", - }, - notifications = true, - lighten_step = 10, - }) - - -- Decrease initial listchars brightness - vim.cmd("ListcharsDarkenColors") - - vim.keymap.set("n", "lc", "ListcharsToggle") - end - }, - - -- Multi cursor editing - { "mg979/vim-visual-multi" }, - - -- Git integration - { - "tpope/vim-fugitive", - config = function() - vim.keymap.set("n", "gs", "G") - end - }, - - -- Place, toggle and display marks - { "kshenoy/vim-signature" }, - - -- Center text in the middle of the screen - { "smithbm2316/centerpad.nvim" }, - - -- Treesitter - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - local configs = require("nvim-treesitter.configs") - - configs.setup({ - sync_install = false, - highlight = { enable = false }, - indent = { enable = false }, - }) - end - }, - - -- LSP - -- { - -- "VonHeikemen/lsp-zero.nvim", - -- dependencies = { - -- "williamboman/mason.nvim", - -- "williamboman/mason-lspconfig.nvim", - -- "neovim/nvim-lspconfig", - -- "hrsh7th/cmp-nvim-lsp", - -- "hrsh7th/nvim-cmp", - -- "hrsh7th/cmp-buffer", - -- "L3MON4D3/LuaSnip", - -- }, - -- branch = "v3.x", - -- config = function() - -- local lsp_zero = require("lsp-zero") - -- lsp_zero.on_attach(function(client, bufnr) - -- -- LSP keymaps - -- lsp_zero.default_keymaps({ buffer = bufnr }) - -- - -- local toggle_diagnostics = function() - -- vim.diagnostic.enable(not vim.diagnostic.is_enabled()) - -- end - -- vim.diagnostic.enable(false) - -- -- vim.diagnostic.config({ virtual_lines = true }) - -- vim.diagnostic.config({ virtual_text = true }) - -- - -- vim.keymap.set("n", "gr", "Telescope lsp_references", { buffer = bufnr }) - -- vim.keymap.set("n", "td", toggle_diagnostics) - -- end) - -- lsp_zero.set_server_config({ - -- on_init = function(client) - -- client.server_capabilities.semanticTokensProvider = nil - -- end, - -- }) - -- - -- require("mason").setup({}) - -- require("mason-lspconfig").setup({ - -- ensure_installed = {"lua_ls", "clangd"}, - -- handlers = { - -- function(server_name) - -- require("lspconfig")[server_name].setup({}) - -- end - -- } - -- }) - -- - -- local cmp = require("cmp") - -- local cmp_format = require("lsp-zero").cmp_format({ details = true }) - -- - -- cmp.setup({ - -- completion = { - -- autocomplete = false - -- }, - -- sources = { - -- { name = "nvim_lsp" }, - -- { name = "buffer" }, - -- }, - -- formatting = cmp_format, - -- }) - -- end - -- } -})