From 1c0ac26114e249548dfdd270a07bc2336a37b6e2 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Thu, 23 May 2024 01:06:50 -0400 Subject: Massive simplification --- init.lua | 36 +++- lua/ben/core/init.lua | 77 --------- lua/ben/lazy.lua | 26 --- lua/ben/plugins/blamer.lua | 16 -- lua/ben/plugins/bling.lua | 7 - lua/ben/plugins/cmp.lua | 56 ------- lua/ben/plugins/colorizer.lua | 4 - lua/ben/plugins/colorscheme.lua | 41 ----- lua/ben/plugins/comments.lua | 5 - lua/ben/plugins/copilot.lua | 7 - lua/ben/plugins/dressing.lua | 4 - lua/ben/plugins/easyalign.lua | 10 -- lua/ben/plugins/flog.lua | 11 -- lua/ben/plugins/formatting.lua | 38 ----- lua/ben/plugins/fugitive.lua | 36 ---- lua/ben/plugins/gitignore.lua | 18 -- lua/ben/plugins/gitsigns.lua | 9 - lua/ben/plugins/go.lua | 34 ---- lua/ben/plugins/grammalecte.lua | 21 --- lua/ben/plugins/gutentags.lua | 8 - lua/ben/plugins/lf.lua | 15 -- lua/ben/plugins/linting.lua | 29 ---- lua/ben/plugins/lsp.lua | 246 ---------------------------- lua/ben/plugins/lualine.lua | 53 ------ lua/ben/plugins/markdown-preview.lua | 43 ----- lua/ben/plugins/neorg.lua | 39 ----- lua/ben/plugins/nvim-r.lua | 14 -- lua/ben/plugins/search-highlight.lua | 7 - lua/ben/plugins/smoothie.lua | 4 - lua/ben/plugins/surround.lua | 5 - lua/ben/plugins/syntax.lua | 7 - lua/ben/plugins/table-mode.lua | 4 - lua/ben/plugins/telescope.lua | 36 ---- lua/ben/plugins/treesitter-text-objects.lua | 53 ------ lua/ben/plugins/treesitter.lua | 76 --------- lua/ben/plugins/undotree.lua | 8 - lua/ben/plugins/vimtex.lua | 12 -- lua/ben/plugins/winresizer.lua | 5 - lua/ben/plugins/yadm-telescope.lua | 14 -- lua/ben/plugins/yadm.lua | 13 -- lua/core/init.lua | 25 +++ lua/plugins/auto-session.lua | 17 ++ lua/plugins/colorscheme.lua | 41 +++++ lua/plugins/comments.lua | 5 + lua/plugins/copilot.lua | 7 + lua/plugins/easyalign.lua | 10 ++ lua/plugins/fugitive.lua | 14 ++ lua/plugins/gitignore.lua | 7 + lua/plugins/gitsigns.lua | 9 + lua/plugins/harpoon.lua | 20 +++ lua/plugins/lf.lua | 21 +++ lua/plugins/lualine.lua | 49 ++++++ lua/plugins/orgmode.lua | 34 ++++ lua/plugins/surround.lua | 5 + lua/plugins/telescope.lua | 34 ++++ 55 files changed, 332 insertions(+), 1113 deletions(-) delete mode 100644 lua/ben/core/init.lua delete mode 100644 lua/ben/lazy.lua delete mode 100644 lua/ben/plugins/blamer.lua delete mode 100644 lua/ben/plugins/bling.lua delete mode 100644 lua/ben/plugins/cmp.lua delete mode 100644 lua/ben/plugins/colorizer.lua delete mode 100644 lua/ben/plugins/colorscheme.lua delete mode 100644 lua/ben/plugins/comments.lua delete mode 100644 lua/ben/plugins/copilot.lua delete mode 100644 lua/ben/plugins/dressing.lua delete mode 100644 lua/ben/plugins/easyalign.lua delete mode 100644 lua/ben/plugins/flog.lua delete mode 100644 lua/ben/plugins/formatting.lua delete mode 100644 lua/ben/plugins/fugitive.lua delete mode 100644 lua/ben/plugins/gitignore.lua delete mode 100644 lua/ben/plugins/gitsigns.lua delete mode 100644 lua/ben/plugins/go.lua delete mode 100644 lua/ben/plugins/grammalecte.lua delete mode 100644 lua/ben/plugins/gutentags.lua delete mode 100644 lua/ben/plugins/lf.lua delete mode 100644 lua/ben/plugins/linting.lua delete mode 100644 lua/ben/plugins/lsp.lua delete mode 100644 lua/ben/plugins/lualine.lua delete mode 100644 lua/ben/plugins/markdown-preview.lua delete mode 100644 lua/ben/plugins/neorg.lua delete mode 100644 lua/ben/plugins/nvim-r.lua delete mode 100644 lua/ben/plugins/search-highlight.lua delete mode 100644 lua/ben/plugins/smoothie.lua delete mode 100644 lua/ben/plugins/surround.lua delete mode 100644 lua/ben/plugins/syntax.lua delete mode 100644 lua/ben/plugins/table-mode.lua delete mode 100644 lua/ben/plugins/telescope.lua delete mode 100644 lua/ben/plugins/treesitter-text-objects.lua delete mode 100644 lua/ben/plugins/treesitter.lua delete mode 100644 lua/ben/plugins/undotree.lua delete mode 100644 lua/ben/plugins/vimtex.lua delete mode 100644 lua/ben/plugins/winresizer.lua delete mode 100644 lua/ben/plugins/yadm-telescope.lua delete mode 100644 lua/ben/plugins/yadm.lua create mode 100644 lua/core/init.lua create mode 100644 lua/plugins/auto-session.lua create mode 100644 lua/plugins/colorscheme.lua create mode 100644 lua/plugins/comments.lua create mode 100644 lua/plugins/copilot.lua create mode 100644 lua/plugins/easyalign.lua create mode 100644 lua/plugins/fugitive.lua create mode 100644 lua/plugins/gitignore.lua create mode 100644 lua/plugins/gitsigns.lua create mode 100644 lua/plugins/harpoon.lua create mode 100644 lua/plugins/lf.lua create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/orgmode.lua create mode 100644 lua/plugins/surround.lua create mode 100644 lua/plugins/telescope.lua diff --git a/init.lua b/init.lua index 3465962..fb2193c 100644 --- a/init.lua +++ b/init.lua @@ -1,2 +1,34 @@ -require("ben.core") -require("ben.lazy") +-- _ _ _ _ +-- (_)_ __ (_) |_ | |_ _ __ _ +-- | | '_ \| | __| | | | | |/ _` | +-- | | | | | | |_ _| | |_| | (_| | +-- |_|_| |_|_|\__(_)_|\__,_|\__,_| +-- +require("core") + +-- Lazy Plugins Bootstrap {{{ +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", + "git@github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) +require("lazy").setup({ + { import = "plugins" }, -- i.e. the lua/plugins directory + -- add more subdirectories as needed + }, { + checker = { + enabled = true, + notify = false, + }, + change_detection = { + notify = false, + }, +}) +-- }}} diff --git a/lua/ben/core/init.lua b/lua/ben/core/init.lua deleted file mode 100644 index 59f9e93..0000000 --- a/lua/ben/core/init.lua +++ /dev/null @@ -1,77 +0,0 @@ --- My Personal Configurations: - --- Superior leader key -vim.g.mapleader = ";" - --- Space is quicker than Shift+Semicolon -vim.keymap.set("n", "", ":") - --- Set encoding to UTF-8 -vim.opt.encoding = "utf-8" - --- Do not lazy redraw -vim.opt.lazyredraw = false - --- Display all matching files when tab completing -vim.opt.wildmenu = true - --- Don't show the previously typed command -vim.opt.shortmess:append("c") - --- Set absolute and relative number hybrid -vim.opt.number = true -vim.opt.relativenumber = true - --- View column count -vim.opt.ruler = true - --- Disable the statusline -vim.opt.laststatus = 0 - --- Sensible split directions -vim.opt.splitbelow = true -vim.opt.splitright = true - --- Set tab width and shift width to 2 -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 - --- Expanding tabs -vim.opt.expandtab = true - --- Set fold method to marker for Vim folding -vim.opt.foldmethod = "marker" - --- Spelling -vim.opt.complete:append("kspell") -- Better Spell Checking -vim.opt.spelllang = "fr" -- French prose - --- Quickly save -vim.api.nvim_set_keymap("n", "w", ":update", { silent = true }) - --- Logical way to Yank -vim.api.nvim_set_keymap("n", "Y", "y$", {}) - --- Easily escape terminal mode -vim.api.nvim_set_keymap("t", "", "", {}) - --- Split motion -vim.api.nvim_set_keymap("n", "", "h", {}) -vim.api.nvim_set_keymap("n", "", "j", {}) -vim.api.nvim_set_keymap("n", "", "k", {}) -vim.api.nvim_set_keymap("n", "", "l", {}) - --- Saving and quitting buffers -vim.api.nvim_set_keymap("n", "ZF", "ZQ", {}) -vim.api.nvim_set_keymap("n", "w", ":update", { silent = true }) - --- Enter vim's F.ile M.anager -vim.api.nvim_set_keymap("n", "fm", ":e .", { silent = true }) - --- Remove trailing white spaces on BufWritePre -vim.cmd([[autocmd BufWritePre * %s/\s\+$//e]]) - --- Tree View for the netrw File Manager -vim.g.netrw_liststyle = 3 -vim.g.netrw_banner = 0 -vim.g.netrw_bufsettings = "noma nomod nu nobl nowrap ro" diff --git a/lua/ben/lazy.lua b/lua/ben/lazy.lua deleted file mode 100644 index 46668e4..0000000 --- a/lua/ben/lazy.lua +++ /dev/null @@ -1,26 +0,0 @@ -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) -require("lazy").setup({ - { import = "ben.plugins" }, -}, { - install = { - colorscheme = { "everforest" }, - }, - checker = { - enabled = true, - notify = false, - }, - change_detection = { - notify = false, - }, -}) diff --git a/lua/ben/plugins/blamer.lua b/lua/ben/plugins/blamer.lua deleted file mode 100644 index 243a8a7..0000000 --- a/lua/ben/plugins/blamer.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - "APZelos/blamer.nvim", - -- Only load if on a compatible OS and git is installed - cond = function() - local goodOS = (vim.fn.has("linux") == 1) or (vim.fn.has("mac") == 1) - local hasGit = vim.fn.executable("git") == 1 - return goodOS and hasGit - end, - config = function() - vim.g.blamer_enabled = 1 - vim.g.blamer_delay = 500 - vim.g.blamer_template = ", " - vim.g.blamer_prefix = ">" - end, - cmd = { "BlamerToggle", "BlamerShow" }, -} diff --git a/lua/ben/plugins/bling.lua b/lua/ben/plugins/bling.lua deleted file mode 100644 index a0771e1..0000000 --- a/lua/ben/plugins/bling.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "ivyl/vim-bling", - keys = { - { "/", "/" }, - { "?", "?" }, - }, -} diff --git a/lua/ben/plugins/cmp.lua b/lua/ben/plugins/cmp.lua deleted file mode 100644 index 2038540..0000000 --- a/lua/ben/plugins/cmp.lua +++ /dev/null @@ -1,56 +0,0 @@ -return { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-buffer", -- source for text in buffer - "hrsh7th/cmp-path", -- source for file system paths - "L3MON4D3/LuaSnip", -- snippet engine - "saadparwaiz1/cmp_luasnip", -- for autocompletion - "rafamadriz/friendly-snippets", -- useful snippets - "onsails/lspkind.nvim", -- vs-code like pictograms - }, - config = function() - local cmp = require("cmp") - - local luasnip = require("luasnip") - - local lspkind = require("lspkind") - - -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) - require("luasnip.loaders.from_vscode").lazy_load() - - cmp.setup({ - completion = { - completeopt = "menu,menuone,preview,noselect", - }, - snippet = { -- configure how nvim-cmp interacts with snippet engine - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), -- previous suggestion - [""] = cmp.mapping.select_next_item(), -- next suggestion - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), -- show completion suggestions - [""] = cmp.mapping.abort(), -- close completion window - [""] = cmp.mapping.confirm({ select = false }), - }), - -- sources for autocompletion - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, -- snippets - { name = "buffer" }, -- text within current buffer - { name = "path" }, -- file system paths - }), - -- configure lspkind for vs-code like pictograms in completion menu - formatting = { - format = lspkind.cmp_format({ - maxwidth = 50, - ellipsis_char = "...", - }), - }, - }) - end, -} diff --git a/lua/ben/plugins/colorizer.lua b/lua/ben/plugins/colorizer.lua deleted file mode 100644 index 08bd85c..0000000 --- a/lua/ben/plugins/colorizer.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "chrisbra/Colorizer", - event = { "BufReadPre", "BufNewFile" }, -} diff --git a/lua/ben/plugins/colorscheme.lua b/lua/ben/plugins/colorscheme.lua deleted file mode 100644 index 4caaa52..0000000 --- a/lua/ben/plugins/colorscheme.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - -- Treesitter optimized colorscheme - { - "neanias/everforest-nvim", - version = false, - priority = 1000, - config = function() - require("everforest").setup({ - background = "hard", - italics = true, - transparent_background_level = 2, - }) - require("everforest").load() - end, - }, - -- My very own colorscheme - { - "ChausseBenjamin/friffle-vim", - lazy = true, - config = function() - vim.cmd([[syntax on]]) -- Enable vim syntax - vim.cmd([[set tgc]]) -- Terminal GUI Colors - vim.cmd([[set lz]]) -- Lazy redraw - vim.cmd([[set t_Co=256]]) -- 256 Colors - vim.cmd([[colo friffle]]) -- Set the colorscheme - vim.cmd([[hi Normal guibg=NONE]]) - vim.cmd([[hi CursorLineNr guibg=NONE]]) - vim.cmd([[hi Constant guibg=NONE]]) - vim.cmd([[hi Conceal guibg=NONE]]) - vim.cmd([[hi Folded guibg=NONE]]) - vim.cmd([[hi ColorColumn guibg='#738c9c']]) - vim.cmd([[hi Todo guibg='#acb3b5' guifg='#340001']]) - vim.cmd([[hi Search guifg='#810002' guibg='#738c9c']]) - end, - }, - -- Backup retro colorscheme - { - "djpohly/elly.vim", - lazy = true, - }, -} diff --git a/lua/ben/plugins/comments.lua b/lua/ben/plugins/comments.lua deleted file mode 100644 index b1267f6..0000000 --- a/lua/ben/plugins/comments.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - 'numToStr/Comment.nvim', - event = { 'BufReadPre', 'BufNewFile' }, - config = true, -} diff --git a/lua/ben/plugins/copilot.lua b/lua/ben/plugins/copilot.lua deleted file mode 100644 index f53bb48..0000000 --- a/lua/ben/plugins/copilot.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "github/copilot.vim", - event = "VeryLazy", - build = function() - vim.cmd([[Copilot setup]]) - end, -} diff --git a/lua/ben/plugins/dressing.lua b/lua/ben/plugins/dressing.lua deleted file mode 100644 index 105f7e5..0000000 --- a/lua/ben/plugins/dressing.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "stevearc/dressing.nvim", - event = "VeryLazy", -} diff --git a/lua/ben/plugins/easyalign.lua b/lua/ben/plugins/easyalign.lua deleted file mode 100644 index fcf254b..0000000 --- a/lua/ben/plugins/easyalign.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "junegunn/vim-easy-align", - event = { "BufRead", "BufNewFile" }, - config = function() - -- Start interactive EasyAlign in visual mode (e.g., vipga) - vim.api.nvim_set_keymap("x", "ga", "(EasyAlign)", {}) - -- Start interactive EasyAlign for a motion/text object (e.g., gaip) - vim.api.nvim_set_keymap("n", "ga", "(EasyAlign)", {}) - end, -} diff --git a/lua/ben/plugins/flog.lua b/lua/ben/plugins/flog.lua deleted file mode 100644 index 81b0c0d..0000000 --- a/lua/ben/plugins/flog.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "rbong/vim-flog", - -- Only enable if git is installed - cond = function() - return vim.fn.executable("git") == 1 - end, - dependencies = { "tpope/vim-fugitive" }, - keys = { - { "gg", "Flogsplit" }, -- G.it G.raph - }, -} diff --git a/lua/ben/plugins/formatting.lua b/lua/ben/plugins/formatting.lua deleted file mode 100644 index 22ddb17..0000000 --- a/lua/ben/plugins/formatting.lua +++ /dev/null @@ -1,38 +0,0 @@ -return { - "stevearc/conform.nvim", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local conform = require("conform") - - conform.setup({ - formatters_by_ft = { - javascript = { "prettier" }, - html = { "prettier" }, - css = { "prettier" }, - json = { "prettier" }, - markdown = { "prettier" }, - bib = { "bibtex_tidy" }, - go = { "goimports", "gci", "golines" }, - sh = { "shfmt" }, - tex = { "latexindent" }, - sql = { "sql_formatter" }, - python = { "isort", "black" }, - yaml = { "yamlfix" }, - lua = { "stylua" }, - }, - - format_on_save = { - lsp_fallback = true, - async = false, - timeout_ms = 300, - }, - }) - vim.keymap.set({ "n", "v" }, "mp", function() - conform.format({ - lsp_fallback = true, - async = false, - timeout_ms = 300, - }) - end, { desc = "Format file or range" }) - end, -} diff --git a/lua/ben/plugins/fugitive.lua b/lua/ben/plugins/fugitive.lua deleted file mode 100644 index 051a983..0000000 --- a/lua/ben/plugins/fugitive.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - "tpope/vim-fugitive", - dependencies = "tpope/vim-rhubarb", - -- Only enable on systems with git installed - cond = function() - return vim.fn.executable("git") == 1 - end, - -- Only load when using one of the following commands: - keys = { - { "gs", "G" }, -- G.it S.tatus - { "gd", "G difftool" }, -- G.it D.iff - { "gm", "Gvdiffsplit!" }, -- G.it M.erge - { "gc", "G commit" }, -- G.it C.ommit - { "gu", "G push" }, -- G.it push U.pstream - { "gp", "G pull" }, -- G.it P.ull - { "gf", "G fetch" }, -- G.it F.etch - }, - config = function() - -- Use > and < to fix merge conflicts (keep the cursor in the middle of the screen) - -- vim.api.nvim_set_keymap("n", ">", "diffg //2diffupdate", { noremap = true, silent = true }) - -- vim.api.nvim_set_keymap("n", "<", "diffg //3diffupdate", { noremap = true, silent = true }) - -- Use } and { to force the entire file - -- vim.api.nvim_set_keymap( - -- "n", - -- "}", - -- "hGwrite!diffupdate", - -- { noremap = true, silent = true } - -- ) - -- vim.api.nvim_set_keymap( - -- "n", - -- "{", - -- "lGwrite!diffupdate", - -- { noremap = true, silent = true } - -- ) - end, -} diff --git a/lua/ben/plugins/gitignore.lua b/lua/ben/plugins/gitignore.lua deleted file mode 100644 index 0a657d9..0000000 --- a/lua/ben/plugins/gitignore.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - "theniceboy/fzf-gitignore", - dependencies = { - { - "junegunn/fzf", - build = function() - vim.fn["fzf#install"]() - end, - }, - }, - cond = function() - return vim.fn.executable("python3") == 1 - end, - build = function() - vim.cmd([[UpdateRemotePlugins]]) - end, - ft = "gitignore", -} diff --git a/lua/ben/plugins/gitsigns.lua b/lua/ben/plugins/gitsigns.lua deleted file mode 100644 index ef8f427..0000000 --- a/lua/ben/plugins/gitsigns.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "lewis6991/gitsigns.nvim", - -- Only enable if git is installed - cond = function() - return vim.fn.executable("git") == 1 - end, - event = { "BufReadPre", "BufNewFile" }, - config = true, -} diff --git a/lua/ben/plugins/go.lua b/lua/ben/plugins/go.lua deleted file mode 100644 index 72e42e7..0000000 --- a/lua/ben/plugins/go.lua +++ /dev/null @@ -1,34 +0,0 @@ -return { - "ray-x/go.nvim", - -- Only if Go is installed - cond = function() - return vim.fn.executable("go") - end, - dependencies = { -- optional packages - "ray-x/guihua.lua", - "neovim/nvim-lspconfig", - "nvim-treesitter/nvim-treesitter", - "ray-x/guihua.lua", - }, - config = function() - require("go").setup() - -- Go keymaps - vim.api.nvim_set_keymap("n", "gb", "GoBuild", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "gr", "GoRun", { noremap = true, silent = true }) - vim.api.nvim_set_keymap("n", "gd", "GoDoc", { noremap = true, silent = true }) - -- Commands to run on save: - local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {}) - vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*.go", - callback = function() - -- Go format: - require("go.format").gofmt() - -- Goimports: - require("go.format").goimport() - end, - group = format_sync_grp, - }) - end, - ft = { "go", "gomod", "gowork", "gosum" }, - build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries -} diff --git a/lua/ben/plugins/grammalecte.lua b/lua/ben/plugins/grammalecte.lua deleted file mode 100644 index efcdb64..0000000 --- a/lua/ben/plugins/grammalecte.lua +++ /dev/null @@ -1,21 +0,0 @@ -return { - "dpelle/vim-Grammalecte", - build = function() - local grammalecte_url = "https://grammalecte.net/zip/Grammalecte-fr-v2.1.1.zip" - Grammalecte_path = vim.fn.expand("~/.local/share/nvim/grammalecte") - -- Download the latest version of Grammalecte ~/.local/share/nvim/grammalecte: - vim.fn.mkdir(Grammalecte_path, "p") - vim.fn.system({ "curl", "-L", grammalecte_url, "-o", Grammalecte_path .. "/grammalecte.zip" }) - -- Unzip the file - vim.fn.system({ "unzip", Grammalecte_path .. "/grammalecte.zip", "-d", Grammalecte_path }) - -- Then set g:grammalecte_cli_py to the unzipped python script - end, - config = function() - vim.g.grammalecte_cli_py = vim.fn.expand("~/.local/share/nvim/grammalecte/grammalecte-cli.py") - end, - cmd = { "GrammalecteCheck", "GrammalecteClear" }, - keys = { - { "cg", "GrammalecteCheck" }, -- C.heck G.rammar - { "cs", "GrammalecteClear" }, -- C.heck S.top - }, -} diff --git a/lua/ben/plugins/gutentags.lua b/lua/ben/plugins/gutentags.lua deleted file mode 100644 index 88fb388..0000000 --- a/lua/ben/plugins/gutentags.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "ludovicchabant/vim-gutentags", - -- Only enable if ctags is installed - condition = function() - return vim.fn.executable("ctags") == 1 - end, - event = { "BufReadPre", "BufNewFile" }, -} diff --git a/lua/ben/plugins/lf.lua b/lua/ben/plugins/lf.lua deleted file mode 100644 index 5c95197..0000000 --- a/lua/ben/plugins/lf.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - "lmburns/lf.nvim", - lazy = false, - dependencies = { - { "akinsho/toggleterm.nvim", version = "*", config = true }, - }, - config = function() - vim.g.lf_netrw = 1 - local lf = require("lf").setup({ - border = "rounded", - focus_on_open = true, - }) - vim.api.nvim_set_keymap("n", "lf", "Lf", { noremap = true, silent = true }) - end, -} diff --git a/lua/ben/plugins/linting.lua b/lua/ben/plugins/linting.lua deleted file mode 100644 index a5be347..0000000 --- a/lua/ben/plugins/linting.lua +++ /dev/null @@ -1,29 +0,0 @@ -return { - "mfussenegger/nvim-lint", - event = { "BufReadPre", "BufNewFile" }, - config = function() - local lint = require("lint") - lint.linters_by_ft = { - css = { "stylelint" }, - markdown = { "markdownlint" }, - python = { "pylint" }, - go = { "golangci_lint" }, - sh = { "shellcheck" }, - } - - local lint_augroup = vim.api.nvim_create_augroup("link", { clear = true }) - - vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { - group = lint_augroup, - callback = function() - lint.try_lint() - end, - }) - vim.keymap.set("n", "l", function() - lint.try_lint() - end, { - desc = "Trigger linting for current file", - silent = true, - }) - end, -} diff --git a/lua/ben/plugins/lsp.lua b/lua/ben/plugins/lsp.lua deleted file mode 100644 index 251a459..0000000 --- a/lua/ben/plugins/lsp.lua +++ /dev/null @@ -1,246 +0,0 @@ -return { - - { - "williamboman/mason.nvim", - dependencies = { - "williamboman/mason-lspconfig.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", - }, - config = function() - -- import mason - local mason = require("mason") - - -- import mason-lspconfig - local mason_lspconfig = require("mason-lspconfig") - local mason_tool_installer = require("mason-tool-installer") - - -- enable mason and configure icons - mason.setup({ - ui = { - icons = { - package_installed = "", - package_pending = "", - package_uninstalled = "", - }, - }, - }) - - mason_lspconfig.setup({ - -- list of servers for mason to install - ensure_installed = { - "ast_grep", -- fallback - "lua_ls", -- lua - "autotools_ls", -- Makefile - "dockerls", -- dockerfiles - "docker_compose_language_service", -- docker-compose - "marksman", -- markdown - "gopls", -- go - "texlab", -- latex - "pyre", -- python - "r_language_server", -- r - "rust_analyzer", -- rust - "mutt_ls", -- mutt - "taplo", -- toml - "yamlls", -- yaml - }, - -- auto-install configured servers (with lspconfig) - automatic_installation = true, - }) - - -- configure mason tool installer - mason_tool_installer.setup({ - ensure_installed = { - "isort", -- python import formatter - "goimports", -- go import formatter - "doctoc", -- markdown table of contents generator - "go-debug-adapter", -- go debugger - "codelldb", -- c/c++ debugger - }, - }) - end, - }, - - { - "neovim/nvim-lspconfig", - dependencies = { "hrsh7th/cmp-nvim-lsp" }, - event = { "BufReadPre", "BufNewFile" }, - config = function() - -- import lspconfig plugin - local lspconfig = require("lspconfig") - - -- import cmp-nvim-lsp plugin - local cmp_nvim_lsp = require("cmp_nvim_lsp") - - local keymap = vim.keymap - - local opts = { noremap = true, silent = true } - local on_attach = function(client, bufnr) - opts.buffer = bufnr - - -- set keybinds - opts.desc = "Show LSP references" - keymap.set("n", "gR", "Telescope lsp_references", opts) -- show definition, references - - opts.desc = "Go to declaration" - keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration - - opts.desc = "Show LSP definitions" - keymap.set("n", "gd", "Telescope lsp_definitions", opts) -- show lsp definitions - - opts.desc = "Show LSP implementations" - keymap.set("n", "gi", "Telescope lsp_implementations", opts) -- show lsp implementations - - opts.desc = "Show LSP type definitions" - keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) -- show lsp type definitions - - opts.desc = "See available code actions" - keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection - - opts.desc = "Smart rename" - keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename - - opts.desc = "Show buffer diagnostics" - keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file - - opts.desc = "Show line diagnostics" - keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line - - opts.desc = "Go to previous diagnostic" - keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer - - opts.desc = "Go to next diagnostic" - keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagostic in buffer - - opts.desc = "Show documentation for what is under cursor" - keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor - - opts.desc = "Restart LSP" - keymap.set("n", "rs", ":LspRestart", opts) -- mapping to restart lsp if necessary - end - - -- used to enable autocompletion (assign to every lsp server config) - local capabilities = cmp_nvim_lsp.default_capabilities() - - -- change diagnostic symbols in sign column - local signs = { Error = " ", Warn = " ", Hint = "󰠠 ", Info = " " } - for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) - end - - -- configure lua server (with special settings) - lspconfig["lua_ls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - settings = { -- custom settings for lua - Lua = { - -- make the language server recognize "vim" global - diagnostics = { - globals = { "vim" }, - }, - workspace = { - -- make language server aware of runtime files - library = { - [vim.fn.expand("$VIMRUNTIME/lua")] = true, - [vim.fn.stdpath("config") .. "/lua"] = true, - }, - }, - }, - }, - }) - - -- configure dockerfile server - lspconfig["dockerls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure docker-compose server - lspconfig["docker_compose_language_service"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure markdown server - lspconfig["marksman"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure golang server - lspconfig["gopls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure LaTeX server - lspconfig["texlab"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure LaTeX server - lspconfig["texlab"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure python server - lspconfig["pyre"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure R server - lspconfig["r_language_server"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure R server - lspconfig["r_language_server"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure mutt server - lspconfig["mutt_ls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure toml server - lspconfig["taplo"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure Makefile server - lspconfig["autotools_ls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure fallback server - lspconfig["ast_grep"].setup({ - capabilities = capabilities, - on_attach = on_attach, - }) - - -- configure yaml server - lspconfig["yamlls"].setup({ - capabilities = capabilities, - on_attach = on_attach, - settings = { - yaml = { - schemas = { - ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", - ["../path/relative/to/file.yml"] = "/.github/workflows/*", - ["/path/from/root/of/project"] = "/.github/workflows/*", - }, - }, - }, - }) - end, - }, -} diff --git a/lua/ben/plugins/lualine.lua b/lua/ben/plugins/lualine.lua deleted file mode 100644 index 0cecbf4..0000000 --- a/lua/ben/plugins/lualine.lua +++ /dev/null @@ -1,53 +0,0 @@ -return { - "nvim-lualine/lualine.nvim", - dependencies = "nvim-tree/nvim-web-devicons", - event = { "BufReadPre", "BufNewFile" }, - config = function() - require("lualine").setup({ - options = { - theme = "everforest", - icons_enabled = true, - -- section_separators = { left = "", right = "" }, - -- component_separators = { left = "", right = "" }, - -- component_separators = { left = "", right = "" }, - -- section_separators = { left = "", right = "" }, - section_separators = { left = "▓", right = "▓" }, - component_separators = { left = "░", right = "░" }, - globalstatus = false, - ignore_focus = {}, - always_divide_middle = true, - refresh = { - statusline = 500, - tabline = 500, - winbar = 500, - }, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch" }, - lualine_c = { "filename" }, - lualine_x = { "encoding", "fileformat", "filetype" }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = { "location" }, - lualine_y = {}, - lualine_z = {}, - }, - tabline = {}, - winbar = {}, - extensions = {}, - }) - -- Remove duplicate information that clutters the bottom of the screen - -- "-- INSERT --" on the left: - vim.opt.showmode = false - -- "100%" linenr/col on the right: - vim.opt.ruler = false - -- commands on the right: - vim.opt.showcmd = false - end, -} diff --git a/lua/ben/plugins/markdown-preview.lua b/lua/ben/plugins/markdown-preview.lua deleted file mode 100644 index 1a2f4bc..0000000 --- a/lua/ben/plugins/markdown-preview.lua +++ /dev/null @@ -1,43 +0,0 @@ -return { - "iamcco/markdown-preview.nvim", - ft = { "markdown", "pandoc.markdown", "rmd" }, - build = function() - vim.fn["mkdp#util#install"]() - end, - config = function() - vim.g.mkdp_auto_start = 0 - vim.g.mkdp_auto_close = 1 - vim.g.mkdp_auto_update = 1 - vim.g.mkdp_refresh_slow = 1 - vim.g.mkdp_command_for_global = 0 - vim.g.mkdp_open_to_the_world = 0 - vim.g.mkdp_open_ip = "" - vim.g.mkdp_browser = "" - vim.g.mkpd_echo_preview_url = 0 - vim.g.mkdp_browser_func = "" - vim.g.mkdp_preview_options = { - mkit = {}, - katex = {}, - uml = {}, - maid = {}, - disable_sync_scroll = 0, - sync_scroll_type = "middle", - hide_yaml_meta = 1, - sequence_diagrams = {}, - flowchart_diagrams = {}, - content_editable = false, - disable_filename = 0, - toc = {}, - } - vim.g.mkdp_markdown_css = "" - vim.g.mkdp_highlight_css = "" - vim.g.mkpd_port = "" - vim.g.mkdp_page_title = "「${name}」" - vim.g.mkpd_filetypes = { "markdown", "pandoc.markdown", "rmd" } - vim.g.mkdp_theme = "dark" - -- Keymaps - vim.api.nvim_set_keymap("n", "mp", "MarkdownPreviewToggle", { silent = true }) - vim.api.nvim_set_keymap("n", "mk", "MarkdownPreviewStop", { silent = true }) - vim.api.nvim_set_keymap("n", "mi", "MarkdownPreview", { silent = true }) - end, -} diff --git a/lua/ben/plugins/neorg.lua b/lua/ben/plugins/neorg.lua deleted file mode 100644 index ece2a53..0000000 --- a/lua/ben/plugins/neorg.lua +++ /dev/null @@ -1,39 +0,0 @@ -return { - "nvim-neorg/neorg", - build = ":Neorg sync-parsers", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-neorg/neorg-telescope", - }, - config = function() - require("neorg").setup({ - load = { - ["core.defaults"] = {}, -- Loads default behaviour - ["core.export"] = {}, -- Loads default behaviour - ["core.concealer"] = { - config = { - icons = { - heading = { - icons = { - "", - "", - "", - "", - }, - }, - }, - }, - }, -- Adds pretty icons to your documents - ["core.integrations.telescope"] = {}, - ["core.dirman"] = { -- Manages Neorg workspaces - config = { - workspaces = { - notes = "~/Dropbox/org", - }, - default_workspace = "notes", - }, - }, - }, - }) - end, -} diff --git a/lua/ben/plugins/nvim-r.lua b/lua/ben/plugins/nvim-r.lua deleted file mode 100644 index e6e43d1..0000000 --- a/lua/ben/plugins/nvim-r.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "jalvesaq/Nvim-R", - -- Only enable if R is installed - cond = function() - return vim.fn.executable("R") == 1 - end, - ft = { "R", "Rnoweb", "tex", "aux", "bib" }, - config = function() - vim.g.r_syntax_folding = 1 - vim.opt.foldnestmax = 1 - vim.opt.foldmethod = "marker" - vim.g.rout_follow_colorscheme = 0 - end, -} diff --git a/lua/ben/plugins/search-highlight.lua b/lua/ben/plugins/search-highlight.lua deleted file mode 100644 index e00e17f..0000000 --- a/lua/ben/plugins/search-highlight.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "qxxxb/vim-searchhi", - keys = { - { "/", "/" }, - { "?", "?" }, - }, -} diff --git a/lua/ben/plugins/smoothie.lua b/lua/ben/plugins/smoothie.lua deleted file mode 100644 index 3afb796..0000000 --- a/lua/ben/plugins/smoothie.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "psliwka/vim-smoothie", - event = "CursorMoved", -} diff --git a/lua/ben/plugins/surround.lua b/lua/ben/plugins/surround.lua deleted file mode 100644 index aef9e72..0000000 --- a/lua/ben/plugins/surround.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "tpope/vim-surround", - dependencies = "tpope/vim-repeat", - event = { "BufReadPre", "BufNewFile" }, -} diff --git a/lua/ben/plugins/syntax.lua b/lua/ben/plugins/syntax.lua deleted file mode 100644 index 8b2af10..0000000 --- a/lua/ben/plugins/syntax.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - -- This layout allows to fit multiple syntax plugins in a single file - { - "waycrate/swhkd-vim", - ft = { "swhkd" }, - }, -} diff --git a/lua/ben/plugins/table-mode.lua b/lua/ben/plugins/table-mode.lua deleted file mode 100644 index 838d813..0000000 --- a/lua/ben/plugins/table-mode.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "dhruvasagar/vim-table-mode", - ft = { "org", "markdown", "text" }, -} diff --git a/lua/ben/plugins/telescope.lua b/lua/ben/plugins/telescope.lua deleted file mode 100644 index 66c107e..0000000 --- a/lua/ben/plugins/telescope.lua +++ /dev/null @@ -1,36 +0,0 @@ -return { - "nvim-telescope/telescope.nvim", - branch = "0.1.x", - dependencies = { - "nvim-lua/plenary.nvim", - }, - keys = { -- LazyLoad telescope when it's actually needed - - -- F.ind F.iles - { "ff", 'lua require("telescope.builtin").find_files()' }, - - -- F.ind H.elp - { "fh", 'lua require("telescope.builtin").help_tags()' }, - - -- F.ind Q.uickfix - { "fq", 'lua require("telescope.builtin").quickfix()' }, - - -- F.ind G.it (files known to git / not ignored or untracked) - { "fg", 'lua require("telescope.builtin").git_files()' }, - - -- F.ind C.ommit ( checkout ) - { "fc", 'lua require("telescope.builtin").git_commits()' }, - - -- F.ind B.ranch - { "fs", 'lua require("telescope.builtin").grep_branches()' }, - }, - cmd = { - "Telescope", - "TelescopeFindFiles", - "TelescopeFindHelp", - "TelescopeQuickfix", - "TelescopeGitFiles", - "TelescopeGitCommits", - "TelescopeGrepBranches", - }, -} diff --git a/lua/ben/plugins/treesitter-text-objects.lua b/lua/ben/plugins/treesitter-text-objects.lua deleted file mode 100644 index bcf1b92..0000000 --- a/lua/ben/plugins/treesitter-text-objects.lua +++ /dev/null @@ -1,53 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter-textobjects", - event = { "BufReadPost", "BufNewFile" }, - dependencies = { - "nvim-treesitter/nvim-treesitter", - }, - config = function() - require("nvim-treesitter.configs").setup({ - textobjects = { - select = { - enable = true, - - -- Automatically jump forward to textobj, similar to targets.vim - lookahead = true, - - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment region" }, - ["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment region" }, - - ["a:"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/field region" }, - ["i:"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/field region" }, - - ["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional region" }, - ["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional region" }, - - ["al"] = { query = "@loop.outer", desc = "Select outer part of a loop region" }, - ["il"] = { query = "@loop.inner", desc = "Select inner part of a loop region" }, - - ["ab"] = { query = "@block.outer", desc = "Select outer part of a block region" }, -- overrides default text object block of parenthesis to parenthesis - ["ib"] = { query = "@block.inner", desc = "Select inner part of a block region" }, -- overrides default text object block of parenthesis to parenthesis - - ["af"] = { query = "@function.outer", desc = "Select outer part of a function region" }, - ["if"] = { query = "@function.inner", desc = "Select inner part of a function region" }, - - ["ac"] = { query = "@class.outer", desc = "Select outer part of a class region" }, - ["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" }, - }, - include_surrounding_whitespace = true, - }, - swap = { - enable = true, - swap_next = { - ["on"] = "@parameter.inner", -- swap object under cursor with next - }, - swap_previous = { - ["op"] = "@parameter.inner", -- swap object under cursor with previous - }, - }, - }, - }) - end, -} diff --git a/lua/ben/plugins/treesitter.lua b/lua/ben/plugins/treesitter.lua deleted file mode 100644 index 279fa1a..0000000 --- a/lua/ben/plugins/treesitter.lua +++ /dev/null @@ -1,76 +0,0 @@ -return { - { - "nvim-treesitter/nvim-treesitter", - dependencies = "windwp/nvim-ts-autotag", - build = ":TSUpdate", - event = { "BufReadPre", "BufNewFile" }, - config = function() - -- import nvim-treesitter plugin - local treesitter = require("nvim-treesitter.configs") - - -- configure treesitter - treesitter.setup({ -- enable syntax highlighting - highlight = { - enable = true, - }, - -- enable indentation - indent = { enable = true }, - -- enable autotagging (w/ nvim-ts-autotag plugin) - autotag = { enable = true }, - -- ensure these language parsers are installed - ensure_installed = { - "json", - "yaml", - "html", - "css", - "javascript", - "markdown", - "markdown_inline", - "graphql", - "bash", - "lua", - "go", - "gomod", - "gowork", - "gosum", - "latex", - "bibtex", - "rnoweb", - "org", - "rust", - "c", - "cpp", - "arduino", - "vim", - "make", - "cmake", - "mermaid", - "passwd", - "gpg", - "regex", - "awk", - "sql", - "ssh_config", - "sxhkdrc", - "nix", - "xml", - "csv", - "dockerfile", - "git_config", - "git_rebase", - "gitattributes", - "gitcommit", - "gitignore", - "diff", - }, - -- enable nvim-ts-context-commentstring plugin for commenting tsx and jsx - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - -- auto install above language parsers - auto_install = true, - }) - end, - }, -} diff --git a/lua/ben/plugins/undotree.lua b/lua/ben/plugins/undotree.lua deleted file mode 100644 index f5dbefc..0000000 --- a/lua/ben/plugins/undotree.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "jiaoshijie/undotree", - dependencies = { "nvim-lua/plenary.nvim" }, - config = true, - keys = { - { "u", "lua require('undotree').toggle()" }, - }, -} diff --git a/lua/ben/plugins/vimtex.lua b/lua/ben/plugins/vimtex.lua deleted file mode 100644 index 31ee15e..0000000 --- a/lua/ben/plugins/vimtex.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "lervag/vimtex", - ft = { "texinfo", "tex", "aux", "bib" }, - config = function() - vim.g.vimtex_view_general_viewer = "open" - vim.g.vimtex_view_general_options = "-a zathura" - vim.g.tex_flavor = "latex" - vim.g.tex_no_error = 1 - vim.g.tex_conceal = "abdmg" - vim.api.set_keymap("n", "", "(vimtex-toc-open)", { noremap = false, silent = true }) - end, -} diff --git a/lua/ben/plugins/winresizer.lua b/lua/ben/plugins/winresizer.lua deleted file mode 100644 index f920cb5..0000000 --- a/lua/ben/plugins/winresizer.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "simeji/winresizer", - lazy = true, - keys = { "", "WinResizerStart" }, -} diff --git a/lua/ben/plugins/yadm-telescope.lua b/lua/ben/plugins/yadm-telescope.lua deleted file mode 100644 index 2e3b6ad..0000000 --- a/lua/ben/plugins/yadm-telescope.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "pschmitt/telescope-yadm.nvim", - dependencies = { "nvim-telescope/telescope.nvim" }, - cond = function() - return vim.fn.executable("yadm") == 1 - end, - config = function() - require("telescope").load_extension("yadm_files") - require("telescope").load_extension("git_or_yadm_files") - end, - keys = { - { "fy", "Telescope yadm_files" }, - }, -} diff --git a/lua/ben/plugins/yadm.lua b/lua/ben/plugins/yadm.lua deleted file mode 100644 index de6389e..0000000 --- a/lua/ben/plugins/yadm.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - "robstumborg/yadm.nvim", - dependencies = "tpope/vim-fugitive", - -- Only load if yadm is installed - cond = function() - return vim.fn.executable("yadm") == 1 - end, - config = function() - require("yadm").setup({ - yadm_dir = vim.fn.expand("$HOME/.local/share/yadm/repo.git"), - }) - end, -} diff --git a/lua/core/init.lua b/lua/core/init.lua new file mode 100644 index 0000000..7b47875 --- /dev/null +++ b/lua/core/init.lua @@ -0,0 +1,25 @@ +vim.g.mapleader=" " +vim.opt.encoding="utf-8" +vim.opt.wildmenu=true -- Show mathes with tab-completion +vim.opt.number=true +vim.opt.relativenumber=true +vim.opt.ruler=true +vim.opt.laststatus=0 +vim.opt.splitbelow=true +vim.opt.splitright=true +vim.opt.tabstop=2 +vim.opt.shiftwidth=2 +vim.opt.expandtab=true +vim.opt.foldmethod="marker" --- For `{{{` & `}}}` folding +vim.opt.complete:append("kspell") +vim.opt.spelllang="fr" -- why does french exist... +vim.api.nvim_set_keymap("n","Y","y$", {}) -- Better motion for `Y` +vim.api.nvim_set_keymap("t", "", "", {}) -- terminal mode Esc + +vim.keymap.set("v", "", ":m '>+1gv=gv") +vim.keymap.set("v", "", ":m '<-2gv=gv") + +-- Netrw preferences when not using lf +vim.g.netrw_liststyle = 3 +vim.g.netrw_banner = 0 +vim.g.netrw_bufsettings = "noma nomod nu nobl nowrap ro" diff --git a/lua/plugins/auto-session.lua b/lua/plugins/auto-session.lua new file mode 100644 index 0000000..e120c7f --- /dev/null +++ b/lua/plugins/auto-session.lua @@ -0,0 +1,17 @@ +return { + "rmagatti/auto-session", + dependencies = { "nvim-telescope/telescope.nvim" }, + config = function() + require("auto-session").setup({ + session_lens = { + bufftypes_to_ignore = {}, + load_on_setup = true, + theme_conf = { border = true }, + previewer = true, + } + }) + vim.keymap.set("n", "", require("auto-session.session-lens").search_session, { + noremap = true, + }) + end, +} diff --git a/lua/plugins/colorscheme.lua b/lua/plugins/colorscheme.lua new file mode 100644 index 0000000..e69ffd8 --- /dev/null +++ b/lua/plugins/colorscheme.lua @@ -0,0 +1,41 @@ +return { -- No nonsense, very stoic + "aktersnurra/no-clown-fiesta.nvim", + dependencies = { + { "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local configs = require("nvim-treesitter.configs") + configs.setup({ + ensure_installed = { + "c", "go", "python", "yaml", "json", "lua", "vim", "graphql" + }, + ignore_install = { + "javascript", "typescript" + }, + sync_install = false, + highlight = {enable = true}, + indent = {enable = false}, + additional_vim_regex_highlighting = false, + }) + end, + }, + }, + lazy = false, + priority = 1000, + config = function() + require("no-clown-fiesta").setup({ + transparent = true, + styles = { + -- You can set any of the style values specified for `:h nvim_set_hl` + type = { bold = true }, + lsp = { underline = true }, + }, + }) + vim.cmd.colorscheme('no-clown-fiesta') + vim.api.nvim_set_hl(0,"LineNr",{fg="#727272"}) + vim.api.nvim_set_hl(0,"Visual",{bg="#171717"}) + vim.api.nvim_set_hl(0,"VertSplit",{bg="none",fg="#727272"}) + vim.api.nvim_set_hl(0,"WinSeparator",{bg="none",fg="#727272"}) + vim.api.nvim_set_hl(0,"StatusLine",{bg="none",fg="#727272"}) + end, +} diff --git a/lua/plugins/comments.lua b/lua/plugins/comments.lua new file mode 100644 index 0000000..5da4b3e --- /dev/null +++ b/lua/plugins/comments.lua @@ -0,0 +1,5 @@ +return { + 'tpope/vim-commentary', + event = { 'BufReadPre', 'BufNewFile' }, +} + diff --git a/lua/plugins/copilot.lua b/lua/plugins/copilot.lua new file mode 100644 index 0000000..f53bb48 --- /dev/null +++ b/lua/plugins/copilot.lua @@ -0,0 +1,7 @@ +return { + "github/copilot.vim", + event = "VeryLazy", + build = function() + vim.cmd([[Copilot setup]]) + end, +} diff --git a/lua/plugins/easyalign.lua b/lua/plugins/easyalign.lua new file mode 100644 index 0000000..fcf254b --- /dev/null +++ b/lua/plugins/easyalign.lua @@ -0,0 +1,10 @@ +return { + "junegunn/vim-easy-align", + event = { "BufRead", "BufNewFile" }, + config = function() + -- Start interactive EasyAlign in visual mode (e.g., vipga) + vim.api.nvim_set_keymap("x", "ga", "(EasyAlign)", {}) + -- Start interactive EasyAlign for a motion/text object (e.g., gaip) + vim.api.nvim_set_keymap("n", "ga", "(EasyAlign)", {}) + end, +} diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua new file mode 100644 index 0000000..12a6385 --- /dev/null +++ b/lua/plugins/fugitive.lua @@ -0,0 +1,14 @@ +return { + "tpope/vim-fugitive", + dependencies = "tpope/vim-rhubarb", + -- Only load when using one of the following commands: + keys = { + { "gs", "G" }, -- G.it S.tatus + { "gd", "G difftool" }, -- G.it D.iff + { "gm", "Gvdiffsplit!" }, -- G.it M.erge + { "gc", "G commit" }, -- G.it C.ommit + { "gu", "G push" }, -- G.it push U.pstream + { "gp", "G pull" }, -- G.it P.ull + { "gf", "G fetch" }, -- G.it F.etch + }, +} diff --git a/lua/plugins/gitignore.lua b/lua/plugins/gitignore.lua new file mode 100644 index 0000000..08188a3 --- /dev/null +++ b/lua/plugins/gitignore.lua @@ -0,0 +1,7 @@ +return { + "antonk52/gitignore-grabber.nvim", + dependencies = { + { "nvim-telescope/telescope.nvim" }, + }, + cmd = "Gitignore", +} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..ef8f427 --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,9 @@ +return { + "lewis6991/gitsigns.nvim", + -- Only enable if git is installed + cond = function() + return vim.fn.executable("git") == 1 + end, + event = { "BufReadPre", "BufNewFile" }, + config = true, +} diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..a6d4535 --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,20 @@ +return { + "theprimeagen/harpoon", + branch = "harpoon2", + dependencies = {"nvim-lua/plenary.nvim"}, + config = function() + local harpoon = require("harpoon") + harpoon:setup() + + vim.keymap.set("n", "a", function() harpoon:list():add() end ) + vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end ) + + vim.keymap.set("n", "", function() harpoon:list():select(1)end ) + vim.keymap.set("n", "", function() harpoon:list():select(2)end ) + vim.keymap.set("n", "", function() harpoon:list():select(3)end ) + vim.keymap.set("n", "", function() harpoon:list():select(4)end ) + + vim.keymap.set("n", "", function() harpoon:list():prev() end) + vim.keymap.set("n", "", function() harpoon:list():next() end) + end, +} diff --git a/lua/plugins/lf.lua b/lua/plugins/lf.lua new file mode 100644 index 0000000..1ad7090 --- /dev/null +++ b/lua/plugins/lf.lua @@ -0,0 +1,21 @@ +return { + "lmburns/lf.nvim", + lazy = false, + dependencies = { + { "akinsho/toggleterm.nvim", version = "*", config = true }, + }, + config = function() + vim.g.lf_netrw = 1 + require("lf").setup({ + border = "rounded", + winblend = 20, + focus_on_open = true, + highlights = { -- highlights passed to toggleterm + Normal = {link = "Normal"}, + NormalFloat = {link = 'Normal'}, + FloatBorder = {guifg = "#111a1f", guibg = "#bada55"}, + }, + }) + vim.api.nvim_set_keymap("n", "lf", "Lf", { noremap = true, silent = true }) + end, +} diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..e41d998 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,49 @@ +return { + "nvim-lualine/lualine.nvim", + dependencies = "nvim-tree/nvim-web-devicons", + event = { "BufReadPre", "BufNewFile" }, + config = function() + require("lualine").setup({ + options = { + theme = "no-clown-fiesta", + icons_enabled = true, + section_separators = { left = "", right = "" }, + component_separators = { left = "", right = "" }, + globalstatus = false, + ignore_focus = {}, + always_divide_middle = true, + refresh = { + statusline = 500, + tabline = 500, + winbar = 500, + }, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch" }, + lualine_c = { "filename" }, + lualine_x = { "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + extensions = {'fugitive'}, + }) + -- Remove duplicate information that clutters the bottom of the screen + -- "-- INSERT --" on the left: + vim.opt.showmode = false + -- "100%" linenr/col on the right: + vim.opt.ruler = false + -- commands on the right: + vim.opt.showcmd = false + end, +} diff --git a/lua/plugins/orgmode.lua b/lua/plugins/orgmode.lua new file mode 100644 index 0000000..d6f3ac0 --- /dev/null +++ b/lua/plugins/orgmode.lua @@ -0,0 +1,34 @@ +return { + 'nvim-orgmode/orgmode', + dependencies = { + { -- Nicely formatted bullet Headings + "akinsho/org-bullets.nvim", + dependencies = "nvim-treesitter/nvim-treesitter", + config = true, + }, + }, + event = 'VeryLazy', + ft = { 'org' }, + config = function() + -- This is bound to org-modern: + -- local Menu = require("org-modern.menu") + -- Setup orgmode + require('orgmode').setup({ + org_agenda_files = '~/Dropbox/org/**/*', + org_default_notes_file = '~/Dropbox/org/index.org', + emacs_config = { + -- executable_path = '/opt/homebrew/bin/emacs', + config_path = '$HOME/.config/emacs/early-init.el', + }, + }) + vim.opt.conceallevel = 2 + vim.opt.concealcursor = 'v' + + -- NOTE: If you are using nvim-treesitter with `ensure_installed = "all"` option + -- add `org` to ignore_install + -- require('nvim-treesitter.configs').setup({ + -- ensure_installed = 'all', + -- ignore_install = { 'org' }, + -- }) + end, +} diff --git a/lua/plugins/surround.lua b/lua/plugins/surround.lua new file mode 100644 index 0000000..aef9e72 --- /dev/null +++ b/lua/plugins/surround.lua @@ -0,0 +1,5 @@ +return { + "tpope/vim-surround", + dependencies = "tpope/vim-repeat", + event = { "BufReadPre", "BufNewFile" }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..f0efe69 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,34 @@ +return { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + }, + keys = { -- LazyLoad telescope when it's actually needed + + -- P.roject F.iles + { "pv", 'lua require("telescope.builtin").find_files()' }, + + -- P.roject S.earch + { "ps", 'lua require("telescope.builtin").grep_string({search = vim.fn.input("Grep > ")})' }, + + + -- F.ind Q.uickfix + { "qf", 'lua require("telescope.builtin").quickfix()' }, + + -- F.ind G.it (files known to git / not ignored or untracked) + { "", 'lua require("telescope.builtin").git_files()' }, + + -- F.ind B.ranch + { "fb", 'lua require("telescope.builtin").grep_branches()' }, + }, + cmd = { + "Telescope", + "TelescopeFindFiles", + "TelescopeFindHelp", + "TelescopeQuickfix", + "TelescopeGitFiles", + "TelescopeGitCommits", + "TelescopeGrepBranches", + }, +} -- cgit v1.2.3