diff --git a/config/nvim/.gitignore b/config/nvim/.gitignore index 882c025..cc5457a 100644 --- a/config/nvim/.gitignore +++ b/config/nvim/.gitignore @@ -1 +1,8 @@ -session.vim +tt.* +.tests +doc/tags +debug +.repro +foo.* +*.log +data diff --git a/config/nvim/.neoconf.json b/config/nvim/.neoconf.json new file mode 100644 index 0000000..7c48087 --- /dev/null +++ b/config/nvim/.neoconf.json @@ -0,0 +1,15 @@ +{ + "neodev": { + "library": { + "enabled": true, + "plugins": true + } + }, + "neoconf": { + "plugins": { + "lua_ls": { + "enabled": true + } + } + } +} diff --git a/config/nvim/.stylua.toml b/config/nvim/.stylua.toml deleted file mode 100644 index 52f7162..0000000 --- a/config/nvim/.stylua.toml +++ /dev/null @@ -1,10 +0,0 @@ -column_width = 160 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferDouble" -call_parentheses = "Always" -collapse_simple_statement = "Always" - -[sort_requires] -enabled = true diff --git a/config/nvim/README.md b/config/nvim/README.md new file mode 100644 index 0000000..185280b --- /dev/null +++ b/config/nvim/README.md @@ -0,0 +1,4 @@ +# ๐Ÿ’ค LazyVim + +A starter template for [LazyVim](https://github.com/LazyVim/LazyVim). +Refer to the [documentation](https://lazyvim.github.io/installation) to get started. diff --git a/config/nvim/after/ftplugin/lua.lua b/config/nvim/after/ftplugin/lua.lua deleted file mode 100644 index d6e3be8..0000000 --- a/config/nvim/after/ftplugin/lua.lua +++ /dev/null @@ -1 +0,0 @@ -vim.api.nvim_command("set formatoptions-=cro") diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 0f0846b..2514f9e 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -1,31 +1,2 @@ --- luacheck: globals vim -local key = vim.api.nvim_set_keymap -local remap = { noremap = true, silent = true } - --- Set with normal Vim opts, 'Space' as mapleader -vim.g.mapleader = " " -vim.g.maplocalleader = " " - --- Set 'Space' as key to leadermap key -key("n", "", "", remap) - --- Global, windows options of neovim: -require("options") - --- Filetype specialties. -require("filetype") - --- To adminstrate packages: -require("plugin-manager") - --- LSP for editing. -require("lsp") - --- Autocmd commands from Vimscript -require("autocmd") - --- Personal Keymaps of neovim: -require("keymappings") - --- The line beneath this is called `modeline`. See `:help modeline` --- vim: ts=2 sts=2 sw=2 et +-- bootstrap lazy.nvim, LazyVim and your plugins +require("config.lazy") diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index b2b0263..4c9b957 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -1,52 +1,62 @@ { - "barbecue.nvim": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, + "LazyVim": { "branch": "main", "commit": "a72a84972d85e5bbc6b9d60a0983b37efef21b8a" }, + "LuaSnip": { "branch": "master", "commit": "ea7d7ea510c641c4f15042becd27f35b3e5b3c2b" }, + "SchemaStore.nvim": { "branch": "main", "commit": "0305d00d4e9fd9ed643432b488c51d8002e17c28" }, + "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" }, "bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" }, + "bufferline.nvim": { "branch": "main", "commit": "9961d87bb3ec008213c46ba14b3f384a5f520eb5" }, "catppuccin": { "branch": "main", "commit": "85e93601e0f0b48aa2c6bbfae4d0e9d7a1898280" }, - "close-buffers.nvim": { "branch": "master", "commit": "3acbcad1211572342632a6c0151f839e7dead27f" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" }, "dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" }, - "fidget.nvim": { "branch": "main", "commit": "89b633f3bd0b7187f070236b348697de176860e2" }, + "flash.nvim": { "branch": "main", "commit": "8a8e74922a383c253b7f92e042b749150140c8d1" }, + "friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" }, "gitsigns.nvim": { "branch": "main", "commit": "907ae8636016aab2f283576fc60d46ca3427e579" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, - "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, - "lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "dfdd771b792fbb4bad8e057d72558255695aa1a7" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "6148b51db945b55b3b725da39eaea6441e59dff8" }, + "indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" }, + "lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" }, + "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "f014db32437aa61c86fc0ef1067cd2bc6a37205c" }, "mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" }, - "mini.nvim": { "branch": "main", "commit": "707dca4f4152c2d9c9b4c5e02635f78dfd33db50" }, - "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, - "neodev.nvim": { "branch": "main", "commit": "dcd34653b0f1d3e7ea9aeb3e37dc7c8da445c4fe" }, + "mini.ai": { "branch": "main", "commit": "7ae226f331885e6f30e9a8229e113debc59308ae" }, + "mini.animate": { "branch": "main", "commit": "230140aa0b06af87c9d345573aab1aaf50d8b539" }, + "mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" }, + "mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" }, + "mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" }, + "mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" }, + "mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "2d89ca96e08eb6e9c8e50e1bb4738bc5125c9f12" }, + "neoconf.nvim": { "branch": "main", "commit": "06afabe121ec01784e7c4da20340a338ae78f7c7" }, + "neodev.nvim": { "branch": "main", "commit": "471324e6c746284dbbdc1d357799d1911bb7e120" }, "neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" }, + "noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" }, "nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, - "nvim-dap": { "branch": "master", "commit": "0e6b7c47dd70e80793ed39271b2aa712d9366dbc" }, - "nvim-dap-go": { "branch": "main", "commit": "1b508e9db330108d3b5d62a6d9cc01fe6bbdd4e0" }, - "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, - "nvim-lspconfig": { "branch": "master", "commit": "360a895125ac4f39df6aa8f763635eff07e69fff" }, + "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, + "nvim-lspconfig": { "branch": "master", "commit": "cc388d3f6b9c7c943ae2b2dcd46ad470fd257f91" }, "nvim-navic": { "branch": "master", "commit": "9c89730da6a05acfeb6a197e212dfadf5aa60ca0" }, "nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" }, "nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" }, - "nvim-treesitter": { "branch": "master", "commit": "2461e5ac21c59950457fea4b3f9f184f0daa8913" }, - "nvim-treesitter-context": { "branch": "master", "commit": "b6c763db8cc486215ba96e0a67418848a710ab25" }, - "nvim-web-devicons": { "branch": "master", "commit": "925e2aa30dc9fe9332060199c19f132ec0f3d493" }, - "nvim-window-picker": { "branch": "main", "commit": "1b1bb834b0acb9eebb11a61664efc665757f1ba2" }, + "nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" }, + "nvim-treesitter": { "branch": "master", "commit": "bf8b089eecef9e9e8c1765f81613a2fd5e49175c" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" }, + "nvim-web-devicons": { "branch": "master", "commit": "973ab742f143a796a779af4d786ec409116a0d87" }, + "persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" }, "plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" }, - "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, - "refactoring.nvim": { "branch": "master", "commit": "2ec9bc0fb5f3c8c6a0f776f0159dd2a3b1663554" }, - "restoreview": { "branch": "main", "commit": "03d00d59a9ba640db6b44192ed0fcc9d7261dcd2" }, - "schemastore.nvim": { "branch": "main", "commit": "8c388a1a38ae1b618eef06a6b0388f5ff33867bd" }, - "smartcolumn.nvim": { "branch": "main", "commit": "c6abf3917fcec487c7475e208ae37f5788af5b04" }, "stickybuf.nvim": { "branch": "master", "commit": "4c667bc837e5e3fec5a8857ee99f1a229fc76df9" }, - "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" }, "tabnine": { "branch": "master", "commit": "cceef1024aa1d8a17698a77c499a124fe85f1f79" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "ad7b637c72549713b9aaed7c4f9c79c62bcbdff0" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope.nvim": { "branch": "master", "commit": "a19770625aed49ad2a9f591a5e3946707f7359f6" }, - "toggleterm.nvim": { "branch": "main", "commit": "b90a1381e9b5b8596f49070ee86c71db267ac868" }, + "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, + "telescope.nvim": { "branch": "master", "commit": "59812c26d826e8c717e29406267ea1260f71e103" }, + "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, + "tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" }, "trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" }, - "twilight.nvim": { "branch": "main", "commit": "a4843e6e67092a1e6fa9666f02bf0ab59174c1df" }, - "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" }, + "vim-illuminate": { "branch": "master", "commit": "8c910b2f84ae6acd9b4b17330bb94dd783c0c11a" }, + "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, "vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" }, - "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, - "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } + "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" } } \ No newline at end of file diff --git a/config/nvim/lua/autocmd.lua b/config/nvim/lua/autocmd.lua deleted file mode 100644 index 88ea589..0000000 --- a/config/nvim/lua/autocmd.lua +++ /dev/null @@ -1,146 +0,0 @@ -local vim = vim -local api = vim.api -local M = {} - ---- function to create a list of commands and convert them to autocommands ---- This function is taken from https://github.com/norcalli/nvim_utils -function M.nvim_create_augroups(definitions) - for group_name, definition in pairs(definitions) do - api.nvim_command("augroup " .. group_name) - api.nvim_command("autocmd!") - for _, def in ipairs(definition) do - local command = table.concat(vim.tbl_flatten({ "autocmd", def }), " ") - api.nvim_command(command) - end - api.nvim_command("augroup END") - end -end - -local autoCommands = { - -- To save the current session (may be restored later). - -- autocmd! VimLeavePre * :mks! ~/.config/nvim/session.vim - save_session = { - { "VimLeavePre", "*", ":mks! ~/.local/state/nvim/session.vim" }, - }, - -- other autocommands - open_folds = { - { "BufReadPost,FileReadPost", "*", "normal zR" }, - }, -} - -M.nvim_create_augroups(autoCommands) - -vim.api.nvim_create_autocmd("FileType", { - pattern = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - }, - callback = function(event) - vim.b[event.buf].miniindentscope_disable = true - end, -}) - - --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ taken from LazyVim repository โ”‚ --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.luaโ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - -local function augroup(name) - return vim.api.nvim_create_augroup("ivuorinen_" .. name, { clear = true }) -end --- Check if we need to reload the file when it changed -vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, { - group = augroup("checktime"), - command = "checktime", -}) - --- Highlight on yank -vim.api.nvim_create_autocmd("TextYankPost", { - group = augroup("highlight_yank"), - callback = function() - vim.highlight.on_yank() - end, -}) - --- resize splits if window got resized -vim.api.nvim_create_autocmd({ "VimResized" }, { - group = augroup("resize_splits"), - callback = function() - local current_tab = vim.fn.tabpagenr() - vim.cmd("tabdo wincmd =") - vim.cmd("tabnext " .. current_tab) - end, -}) - --- go to last loc when opening a buffer -vim.api.nvim_create_autocmd("BufReadPost", { - group = augroup("last_loc"), - callback = function() - local exclude = { "gitcommit" } - local buf = vim.api.nvim_get_current_buf() - if vim.tbl_contains(exclude, vim.bo[buf].filetype) then - return - end - local mark = vim.api.nvim_buf_get_mark(buf, '"') - local lcount = vim.api.nvim_buf_line_count(buf) - if mark[1] > 0 and mark[1] <= lcount then - pcall(vim.api.nvim_win_set_cursor, 0, mark) - end - end, -}) - --- close some filetypes with -vim.api.nvim_create_autocmd("FileType", { - group = augroup("close_with_q"), - pattern = { - "PlenaryTestPopup", - "help", - "lspinfo", - "man", - "notify", - "qf", - "spectre_panel", - "startuptime", - "tsplayground", - "neotest-output", - "checkhealth", - "neotest-summary", - "neotest-output-panel", - }, - callback = function(event) - vim.bo[event.buf].buflisted = false - vim.keymap.set("n", "q", "close", { buffer = event.buf, silent = true }) - end, -}) - --- wrap and check for spell in text filetypes -vim.api.nvim_create_autocmd("FileType", { - group = augroup("wrap_spell"), - pattern = { "gitcommit", "markdown" }, - callback = function() - vim.opt_local.wrap = true - vim.opt_local.spell = true - end, -}) - --- Auto create dir when saving a file, in case some intermediate directory does not exist -vim.api.nvim_create_autocmd({ "BufWritePre" }, { - group = augroup("auto_create_dir"), - callback = function(event) - if event.match:match("^%w%w+://") then - return - end - local file = vim.loop.fs_realpath(event.match) or event.match - vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") - end, -}) diff --git a/config/nvim/lua/config/autocmds.lua b/config/nvim/lua/config/autocmds.lua new file mode 100644 index 0000000..27e9e06 --- /dev/null +++ b/config/nvim/lua/config/autocmds.lua @@ -0,0 +1,3 @@ +-- Autocmds are automatically loaded on the VeryLazy event +-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua +-- Add any additional autocmds here diff --git a/config/nvim/lua/config/keymaps.lua b/config/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..2c134f7 --- /dev/null +++ b/config/nvim/lua/config/keymaps.lua @@ -0,0 +1,3 @@ +-- Keymaps are automatically loaded on the VeryLazy event +-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua +-- Add any additional keymaps here diff --git a/config/nvim/lua/config/lazy.lua b/config/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..7d974c5 --- /dev/null +++ b/config/nvim/lua/config/lazy.lua @@ -0,0 +1,58 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + -- bootstrap lazy.nvim + -- stylua: ignore + vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +end +vim.opt.rtp:prepend(vim.env.LAZY or lazypath) + +require("lazy").setup({ + spec = { + -- add LazyVim and import its plugins + { + "LazyVim/LazyVim", + import = "lazyvim.plugins", + opts = { + colorscheme = "catppuccin", + }, + }, + -- import any extras modules here + { import = "lazyvim.plugins.extras.formatting.prettier" }, + { import = "lazyvim.plugins.extras.lang.docker" }, + { import = "lazyvim.plugins.extras.lang.go" }, + { import = "lazyvim.plugins.extras.lang.tailwind" }, + { import = "lazyvim.plugins.extras.lang.terraform" }, + { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.lang.json" }, + { import = "lazyvim.plugins.extras.linting.eslint" }, + { import = "lazyvim.plugins.extras.ui.mini-animate" }, + -- import/override with your plugins + { import = "plugins" }, + }, + defaults = { + -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. + -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. + lazy = false, + -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, + -- have outdated releases, which may break your Neovim install. + version = false, -- always use the latest git commit + -- version = "*", -- try installing the latest stable version for plugins that support semver + }, + install = { colorscheme = { "catppuccin", "tokyonight", "habamax" } }, + checker = { enabled = true }, -- automatically check for plugin updates + performance = { + rtp = { + -- disable some rtp plugins + disabled_plugins = { + "gzip", + -- "matchit", + -- "matchparen", + -- "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/config/nvim/lua/config/options.lua b/config/nvim/lua/config/options.lua new file mode 100644 index 0000000..0e3401c --- /dev/null +++ b/config/nvim/lua/config/options.lua @@ -0,0 +1,11 @@ +-- Options are automatically loaded before lazy.nvim startup +-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua +-- Add any additional options here + +local opt = vim.opt + +opt.number = true +opt.relativenumber = true + +-- The line beneath this is called `modeline`. See `:help modeline` +-- vim: ts=2 sts=2 sw=2 et diff --git a/config/nvim/lua/filetype.lua b/config/nvim/lua/filetype.lua deleted file mode 100644 index 987eb56..0000000 --- a/config/nvim/lua/filetype.lua +++ /dev/null @@ -1,73 +0,0 @@ --- luacheck: globals vim - --- To be used anywhere. --- local function job(command) vim.api.nvim_command("call jobstart('" .. command .. "')") end - -local function yaml_ft(path, bufnr) - -- get content of buffer as string - local content = vim.filetype.getlines(bufnr) - if type(content) == "table" then content = table.concat(content, "\n") end - - -- check if file is in roles, tasks, or handlers folder - local path_regex = vim.regex("(tasks\\|roles\\|handlers)/") - if path_regex and path_regex:match_str(path) then return "yaml.ansible" end - -- check for known ansible playbook text and if found, return yaml.ansible - local regex = vim.regex("hosts:\\|tasks:") - if regex and regex:match_str(content) then return "yaml.ansible" end - - -- return yaml if nothing else - return "yaml" -end - --- In init.lua or filetype.nvim's config file -vim.filetype.add({ - extension = { - - h = function() - -- Use a lazy heuristic that #including a C++ header means it's a - -- C++ header - if vim.fn.search("\\C^#include <[^>.]\\+>$", "nw") == 1 then return "cpp" end - return "c" - end, - - -- Spelling fix. - md = function() vim.api.nvim_command("setlocal spell!") end, - - yml = yaml_ft, - yaml = yaml_ft, - - -- - csv = "csv", - cl = "opencl", - env = "env", - sh = "bash", - -- - }, - pattern = { - - -- Go to root configuration of some projects. - -- [".*config/nvim/.*"] = function() vim.api.nvim_command "cd ~/.config/nvim/" end, - - ---- Typescript Projects - -- [".*/src/.*ts"] = function() format() end, - -- [".*/src/.*json"] = function() format() end, - -- [".*/src/.*scss"] = function() format() end, - -- [".*/src/.*html"] = function() format() end, - - --[".*Code/ivuorinen/[project]/src/.*ts"] = function() - -- vim.api.nvim_command('cd ~/Code/ivuorinen/[project]/') - -- build('ts index') - --end, - }, - - filename = { - -- For eslint_d configuration file. - [".eslintrc"] = "jsonc", - - -- For Typescript projects. - ["tsconfig.json"] = "json5", - - [".ignore"] = "gitignore", - ["docker-compose.yml"] = "yaml.docker-compose", - }, -}) diff --git a/config/nvim/lua/keymappings.lua b/config/nvim/lua/keymappings.lua deleted file mode 100644 index df6a519..0000000 --- a/config/nvim/lua/keymappings.lua +++ /dev/null @@ -1,222 +0,0 @@ ---[[ - Keymappings for nvim experience. - - I use combination of both nvim default vim.api.nvim_set_keymap - and WhichKey register. Slowly migrating to the WhichKey system, - and tweaking the groupings as I go. ---]] --- luacheck: globals vim CAPABILITIES - -local wk = require("which-key") - --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ Register keybindings โ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ Register in all modes, prefix โ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ -wk.register({ - b = { - name = "+buffer", - n = { "tabnew", "[n]ew tab" }, - a = { - name = "+annotate", - -- defined in plugins/neogen.lua - }, - c = { - name = "+comments", - b = { - "lua require('comment-box').lbox()", - "Left aligned fixed size box with left aligned text", - }, - c = { - "lua require('comment-box').ccbox()", - desc = "Centered adapted box with centered text", - }, - l = { - "lua require('comment-box').cline()", - desc = "Centered line", - }, - }, - d = { - name = "+delete buffers", - h = { - "lua require('close_buffers').delete({type = 'hidden'})", - "Delete hidden buffers", - }, - }, - t = { ":TabnineToggle", "Toggle TabNine" }, - }, - D = { - name = "+Diagnostics (Trouble)", - t = { ":TroubleToggle", "[D]iagnostics [t]oggle" }, - -- Quick navigation between diagonostics. - f = { ":lua vim.diagnostic.open_float()", "[D]iagnostics: Open [f]loat" }, - n = { ":lua vim.diagnostic.goto_next()", "[D]iagnostics: [n]ext" }, - p = { ":lua vim.diagnostic.goto_prev()", "[D]iagnostics: [p]rev" }, - --- - x = { function() require("trouble").open() end, "Open Trouble" }, - w = { function() require("trouble").open("workspace_diagnostics") end, "Workspace diagnostics" }, - d = { function() require("trouble").open("document_diagnostics") end, "Document diagnostics" }, - q = { function() require("trouble").open("quickfix") end, "Quickfix" }, - l = { function() require("trouble").open("loclist") end, "Loclist" }, - r = { function() require("trouble").open("lsp_references") end, "LSP References" }, - }, - e = { - function() vim.cmd("Neotree focus source=filesystem position=left") end, - "Toggle the sidebar tree", - }, - f = { - name = "+find", - -- Find recursively files across the root folder subfiles. - f = { ':lua require("telescope.builtin").find_files()', "[f]ind [f]iles" }, - -- Find recursively a text across the root folder subfiles. - g = { ':lua require("telescope.builtin").live_grep()', "[f]ind text with [g]rep" }, - }, - h = { - name = "+harpoon", - a = { "lua require('harpoon.mark').add_file()", "[h]arpoon: [A]dd file" }, - r = { "lua require('harpoon.mark').rm_file()", "[h]arpoon: [r]emove file" }, - m = { "lua require('harpoon.ui').toggle_quick_menu()", "[h]arpoon: harpoon [m]enu" }, - n = { "lua require('harpoon.ui').nav_next()", "[h]arpoon: [n]ext file" }, - p = { "lua require('harpoon.ui').nav_prev()", "[h]arpoon: [p]revious file" }, - ["1"] = { " lua require('harpoon.ui').nav_file(1)", "[h]arpoon: file 1" }, - ["2"] = { " lua require('harpoon.ui').nav_file(2)", "[h]arpoon: file 2" }, - ["3"] = { " lua require('harpoon.ui').nav_file(3)", "[h]arpoon: file 3" }, - }, - --- Remap debugging to "H" from LV default of "h" - H = { - name = "+help/Conceal/Treesitter", - c = { - name = "+conceal", - h = { ":set conceallevel=1", "hide/conceal" }, - s = { ":set conceallevel=0", "show/unconceal" }, - }, - t = { - name = "+treesitter", - t = { vim.treesitter.inspect_tree, "show tree" }, - c = { ":=vim.treesitter.get_captures_at_cursor()", "show capture" }, - n = { ":=vim.treesitter.get_node():type()", "show node" }, - }, - }, - o = { - g = { - -- defined in plugins/gitsigns.lua - name = "+git", - b = { - name = "+blame", - }, - }, - }, - p = { - name = "+plugins", - i = { function() require("lazy").install() end, "plugins [i]nstall" }, - s = { function() require("lazy").home() end, "plugins [s]tatus" }, - S = { function() require("lazy").sync() end, "plugins [S]ync" }, - u = { function() require("lazy").check() end, "plugins Check [u]pdates" }, - U = { function() require("lazy").update() end, "plugins [U]pdate" }, - }, - q = { - name = "+quit", - q = { ":qa", "quit: [q]uit all" }, - f = { ":qa!", "quit: all with [f]orce" }, - }, - r = { - -- defined in plugins/refactoring-nvim.lua - name = "+refactor", - }, - t = { - name = "+telescope", - -- Find recursively TODOs, NOTEs, FIXITs, ... across the root folder subfiles. - t = { ":TodoTelescope", "[t]elescope: [t]odo" }, - }, - x = { ":Bdelete", "Close current buffer" }, -}, { prefix = "" }) - --- --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ Normal mode, prefix โ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ -wk.register({ - b = { name = "Buffer" }, -}, { mode = "n", prefix = "" }) - --- --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ Insert mode, prefix โ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ -wk.register({ - b = { name = "Buffer" }, -}, { mode = "i", prefix = "" }) - --- --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ Insert mode, no prefix โ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ -wk.register({ - [""] = { "w", "Save file" }, - [""] = { "", "Do just Home on CTRL + Home" }, -}, { mode = "i", prefix = "" }) - --- --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ All modes, no prefix โ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ -wk.register({ - [""] = { "w", "Save file" }, - [""] = { "", "Do just End on CTRL + End" }, -}, { prefix = "" }) - --- --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ Other keymappings, still to move โ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - -local key = vim.api.nvim_set_keymap -local remap = { noremap = true, silent = true } - --- Go to the next block. ---key('n', '', 'g%', remap ) - --- Loop through brackets blocks. ---key('n', '', 'z%', remap ) - --- Move lines normally like an IDE when line wraps -key("i", "", [[v:count ? 'j' : 'gj']], { expr = true, noremap = true, silent = true }) -key("i", "", [[v:count ? 'k' : 'gk']], { expr = true, noremap = true, silent = true }) -key("n", "", [[v:count ? 'j' : 'gj']], { expr = true, noremap = true, silent = true }) -key("n", "", [[v:count ? 'k' : 'gk']], { expr = true, noremap = true, silent = true }) - --- Move normaly bottom and up with C+Up and C+Down. -key("i", "", "gk", remap) -key("i", "", "gj", remap) -key("n", "", "gk", remap) -key("n", "", "gj", remap) - --- Set 'CTRL + z' as 'undo' -key("i", "", "ui", remap) - --- Set 'CTRL + y' as 'redo' -key("i", "", "", remap) - --- Set 'SHIFT + arrows' as 'select' like modern text-editor. -key("n", "", "v", remap) -key("n", "", "v", remap) -key("n", "", "v", remap) -key("n", "", "v", remap) -key("v", "", "", remap) -key("v", "", "", remap) -key("v", "", "", remap) -key("v", "", "", remap) -key("i", "", "v", remap) -key("i", "", "v", remap) -key("i", "", "v", remap) -key("i", "", "v", remap) - --- Indent the current visual selection. -key("v", "<", "", ">gv", remap) - --- Set 'Backspace' as 'delete selection' for the visual selection. -key("v", "", '"_di', remap) diff --git a/config/nvim/lua/lsp.lua b/config/nvim/lua/lsp.lua deleted file mode 100644 index 7774ccf..0000000 --- a/config/nvim/lua/lsp.lua +++ /dev/null @@ -1,144 +0,0 @@ --- Completion for snippets. --- luacheck: globals vim CAPABILITIES -local vim = vim -CAPABILITIES = vim.lsp.protocol.make_client_capabilities() -CAPABILITIES.textDocument.completion.completionItem.snippetSupport = true - --- [[ Configure LSP ]] --- This function gets run when an LSP connects to a particular buffer. -local on_attach = function(client, bufnr) - local nmap = function(keys, func, desc) - if desc then desc = "LSP: " .. desc end - - vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc }) - end - - if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end - - local wk = require("which-key") - - wk.register({ - l = { - name = "+lsp", - n = { vim.lsp.buf.rename, "Rename" }, - c = { vim.lsp.buf.code_action, "Code Action" }, - f = { "Format", "Format current buffer with LSP" }, - D = { vim.lsp.buf.declaration, "[G]oto [D]eclaration" }, - w = { - name = "[w]orkspace", - a = { vim.lsp.buf.add_workspace_folder, "[w]orkspace: [a]dd folder" }, - r = { vim.lsp.buf.remove_workspace_folder, "[w]orkspace: [r]emove folder" }, - l = { - function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, - "[w]orkspace [l]ist folders", - }, - }, - }, - g = { - name = "+goto", - d = { vim.lsp.buf.definition, "[G]oto [D]efinition" }, - r = { require("telescope.builtin").lsp_references, "[G]oto [R]eferences" }, - I = { vim.lsp.buf.implementation, "[G]oto [I]mplementation" }, - D = { vim.lsp.buf.type_definition, "Type [D]efinition" }, - s = { require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols" }, - w = { require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols" }, - }, - }, { prefix = "" }) - - -- See `:help K` for why this keymap - nmap("K", vim.lsp.buf.hover, "Hover Documentation") - nmap("", vim.lsp.buf.signature_help, "Signature Documentation") - - -- Create a command `:Format` local to the LSP buffer - -- vim.api.nvim_buf_create_user_command( - -- bufnr, - -- "Format", - -- function(_) vim.lsp.buf.format() 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. --- --- If you want to override the default filetypes that your --- language server will attach to you can define the property --- 'filetypes' to the map in question. -local servers = { - ansiblels = {}, - bashls = {}, - clangd = {}, - cssls = { - cmd = { "vscode-css-language-server", "--stdio" }, - filetypes = { "css", "scss", "less" }, - -- root_dir = root_pattern("package.json", ".git") or bufdir, - settings = { - css = { - validate = true, - }, - less = { - validate = true, - }, - scss = { - validate = true, - }, - }, - single_file_support = true, - capabilities = CAPABILITIES, - }, - diagnosticls = {}, - docker_compose_language_service = {}, - dockerls = {}, - eslint = {}, -- JS - gopls = {}, -- Go - graphql = {}, - html = { filetypes = { "html", "twig", "hbs" } }, - intelephense = {}, -- PHP - jsonls = { - json = { - schemas = require("schemastore").json.schemas(), - validate = { enable = true }, - }, - }, - lua_ls = { - Lua = { - diagnostics = { globals = { "vim" } }, - workspace = { checkThirdParty = false }, - telemetry = { enable = false }, - }, - }, - marksman = {}, -- Markdown - psalm = {}, -- PHP - pylsp = {}, -- Python - pyright = {}, -- Python - rust_analyzer = {}, -- Rust - terraformls = {}, -- Terraform - tsserver = {}, -- TypeScript - vuels = {}, -- Vue - yamlls = { -- YAML - yaml = { - schemaStore = { - -- You must disable built-in schemaStore support if you want to use - -- this plugin and its advanced options like `ignore`. - enable = false, - -- Avoid TypeError: Cannot read properties of undefined (reading 'length') - url = "", - }, - schemas = require("schemastore").yaml.schemas(), - }, - }, -} - --- Setup neovim lua configuration -require("neodev").setup() - -require("mason").setup() -require("mason-lspconfig").setup({ - ensure_installed = vim.tbl_keys(servers), - automatic_installtion = true, -}) diff --git a/config/nvim/lua/lsp_signature.lua b/config/nvim/lua/lsp_signature.lua deleted file mode 100644 index fe7b003..0000000 --- a/config/nvim/lua/lsp_signature.lua +++ /dev/null @@ -1,59 +0,0 @@ --- Signature for LSP - -return { - "ray-x/lsp_signature.nvim", - config = { - debug = false, -- set to true to enable debug logging - verbose = false, -- show debug line number - - bind = true, -- This is mandatory, otherwise border config won't get registered. - -- If you want to hook lspsaga or other signature handler, pls set to false - doc_lines = 10, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated); - -- set to 0 if you DO NOT want any API comments be shown - -- This setting only take effect in insert mode, it does not affect signature help in normal - -- mode, 10 by default - - floating_window = true, -- show hint in a floating window, set to false for virtual text only mode - - floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note: - -- will set to true when fully tested, set to false will use whichever side has more space - -- this setting will be helpful if you do not want the PUM and floating win overlap - close_timeout = 4000, -- close floating window after ms when laster parameter is entered - hint_enable = true, -- virtual hint enable - hint_prefix = "๐Ÿผ", -- Panda for parameter - hint_scheme = "String", - use_lspsaga = false, -- set to true if you want to use lspsaga popup - - hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight - - max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down - -- to view the hiding contents - max_width = 90, -- max_width of signature floating_window, line will be wrapped if exceed max_width - wrap = true, - handler_opts = { - border = "shadow", -- double, rounded, single, shadow, none - }, - - always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58 - - floating_window_off_x = 0, -- adjust float windows x position. - -- can be either a number or function - floating_window_off_y = 2, -- adjust float windows y position. e.g -2 move window up 2 lines; 2 move down 2 lines - -- can be either number or function, see examples - - auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil. - extra_trigger_chars = { "(", ",", ";", ")", "{", "}" }, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","} - zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom - - padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc - - transparency = 20, -- disabled by default, allow floating win transparent value 1~100 - shadow_blend = 36, -- if you using shadow as border use this set the opacity - shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315' - timer_interval = 50, -- default timer check interval set to lower value if you want to reduce latency - toggle_key = "", -- toggle signature on and off in insert mode, e.g. toggle_key = '' - - select_signature_key = nil, -- cycle to next signature, e.g. '' function overloading - move_cursor_key = nil, -- imap, use nvim_set_current_win to move cursor between current win and floating - }, -} diff --git a/config/nvim/lua/options.lua b/config/nvim/lua/options.lua deleted file mode 100644 index 72575be..0000000 --- a/config/nvim/lua/options.lua +++ /dev/null @@ -1,94 +0,0 @@ --- luacheck: globals vim -local vim = vim - --- Use the new FileType system of Neovim. --- let g:do_filetype_lua = 1 -vim.g.do_filetype_lua = 1 - -vim.wo.linebreak = true -- Fix moving through lines 'gk' and 'gj' -vim.o.breakindent = true -- Enable break indent -vim.o.undofile = true -- Save undo history -vim.wo.number = true -- Show lines number (hybrid) -vim.wo.relativenumber = true -- Show lines number (hybrid) -vim.wo.signcolumn = "yes" -- Keep signcolumn on by default -vim.o.laststatus = 3 -- Global statusline. -vim.o.cmdheight = 0 -- To have a extra line :) -vim.wo.wrap = true -- Set wrap for words -vim.o.showtabline = 2 -- Always show tabs -vim.o.list = true -- Show xtra spaces -vim.o.wildmenu = true -- Set wildmenu for later use -vim.o.hlsearch = true -- Highlighting search -vim.o.ruler = true -- Set ruler for better look -vim.o.hidden = true -- No nice message -vim.o.showcmd = true -- Partial commands only in the screen -vim.o.showmatch = true -- Match braces when inserting new ones -vim.opt.backup = false -- No backups because some plugins freak out -vim.opt.writebackup = false -- No backups because some plugins freak out -vim.o.scrolloff = 40 -- Off scroll when moving through the buffer -vim.go.termguicolors = true -- For terminal RGB colours -vim.go.t_Co = "256" -- Colours, I believe -vim.go.t_ut = "" -- Colours, I believe -vim.o.laststatus = 3 -- Space for tabs -vim.o.softtabstop = 2 -- Space for tabs -vim.o.expandtab = true -- Expand tab to use spaces instead -vim.o.tabstop = 2 -- Space for tabs -vim.bo.shiftwidth = 2 -- Space for tabs -vim.o.shiftwidth = 2 -- Space for tabs -vim.o.formatoptions = "tqj" -- Format options to not create new lines with comments -vim.o.mouse = "a" -- Mouse working with neovim - --- Case-insensitive searching UNLESS \C or capital in search -vim.o.ignorecase = true -vim.o.smartcase = true - --- Cursor line -vim.o.cursorline = true -vim.wo.cursorline = true -vim.o.cursorcolumn = true -vim.wo.cursorcolumn = true - --- Spell language to English (UK) -vim.o.spelllang = "en_gb" -vim.bo.spelllang = "en_gb" - --- When "on" the commands listed below move the cursor to the first non-blank --- of the line. When off the cursor is kept in the same column (if possible). --- https://neovim.io/doc/user/options.html#'startofline' -vim.o.startofline = true - --- Complete options -vim.o.completeopt = "menuone,longest,noselect" -vim.o.shortmess = vim.o.shortmess .. "c" - --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ Variables โ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - -vim.api.nvim_set_var("one_allow_itali:set cursorlinec:set cursorlines", 1) -vim.api.nvim_set_var("do_filetype_lua", 1) -vim.api.nvim_set_var("MRU_File", "~/.cache/vim_mru_files") - --- โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ --- โ”‚ API โ”‚ --- โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ - --- Change title accordingly. -vim.api.nvim_set_option("title", true) - --- Set clipboard to be global across the system -vim.api.nvim_set_option("clipboard", "unnamedplus") - --- Set dictionary to language spell -vim.api.nvim_set_option("dictionary", "/usr/share/dict/words") - --- Wildignore for when opening files :0 -vim.api.nvim_set_option( - "wildignore", - "*/tmp*/,*/node_modules/*,_site,*/__pycache__/,*/venv/*,*/target/*,*/.vim$,~$,*/.log" -) - --- Folding -vim.api.nvim_set_option("foldmethod", "syntax") -vim.api.nvim_set_option("foldenable", false) -vim.api.nvim_set_option("foldminlines", 5) -vim.api.nvim_set_option("foldcolumn", "1") diff --git a/config/nvim/lua/plugin-manager.lua b/config/nvim/lua/plugin-manager.lua deleted file mode 100644 index 0922148..0000000 --- a/config/nvim/lua/plugin-manager.lua +++ /dev/null @@ -1,40 +0,0 @@ --- Package manager https://github.com/folke/lazy.nvim --- :help lazy.nvim.txt --- luacheck: globals vim - --- To install lazy.nvim automatically. -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) - -local options = { - defaults = { lazy = false }, - install = { colorscheme = { "catppuccin" } }, - performance = { - cache = { - enabled = true, - }, - rtp = { - disabled_plugins = { - "matchit", - "matchparen", - "netrwPlugin", - "tohtml", - "tutor", - }, - }, - }, -} - -require("lazy").setup("plugins", options) diff --git a/config/nvim/lua/plugins/barbecue.lua b/config/nvim/lua/plugins/barbecue.lua deleted file mode 100644 index f42e57e..0000000 --- a/config/nvim/lua/plugins/barbecue.lua +++ /dev/null @@ -1,92 +0,0 @@ --- A VS Code like winbar for Neovim --- https://github.com/utilyre/barbecue.nvim -return { - "utilyre/barbecue.nvim", - dependencies = { - "neovim/nvim-lspconfig", - "SmiteshP/nvim-navic", - "nvim-tree/nvim-web-devicons", - }, - version = "*", - opts = { - theme = "catppuccin", - - -- If you set this to false, floating windows will look weird - exclude_float = true, - - -- Instead of excluding countless number of filetypes, barbecue tries to only show on some buftypes - -- "": file buffer - -- "nofile": e.g. nvim-tree and nvim-dap-ui - -- "prompt": e.g. telescope.nvim and nvim-fzf - -- "terminal": e.g. fterm.nvim and toggleterm.nvim - -- ... - include_buftypes = { "" }, - - ---Filetypes not to enable winbar in. - --- - ---@type string[] - exclude_filetypes = { - "", - "txt", - "markdown", - }, - - -- :help events - -- :help [event] (like :help BufWinEnter) - update_events = { - "BufWinEnter", - "BufWritePost", - "CursorMoved", - "CursorMovedI", - "TextChanged", - "TextChangedI", - }, - - -- Show `~ ๎ชถ ...` instead of `/ ๎ชถ home ๎ชถ user ๎ชถ ...` - tilde_home = true, - - -- Your winbar will have a little padding from the edge - prefix = " ", - - -- The sign between each entry - separator = " ๎ชถ ", - - -- Show if lsp context is available but there is nothing to show - no_info_indicator = "โ€ฆ", - - -- Symbol to show if file has been modified (not saved). It's usually `[+]` in vim - -- `nil` to disable - modified_indicator = nil, - - -- Icons passed to nvim-navic - icons = { - File = "๏œ˜ ", - Module = "๎˜ค ", - Namespace = "๏ – ", - Package = "๎˜ค ", - Class = "๏ – ", - Method = "๏šฆ ", - Property = "๎ž› ", - Field = "๎œ– ", - Constructor = "๏ฅ ", - Enum = "๏ฉ—", - Interface = "๏ฉ—", - Function = "๏ž” ", - Variable = "๏šฆ ", - Constant = "๏ฃพ ", - String = "๏”ซ ", - Number = "๏ขŸ ", - Boolean = "โ—ฉ ", - Array = "๏™ฉ ", - Object = "๏™จ ", - Key = "๏ Š ", - Null = "๏ณ  ", - EnumMember = "๏… ", - Struct = "๏ – ", - Event = "๏ƒง ", - Operator = "๏š” ", - TypeParameter = "๏žƒ ", - Define = "๏ง ", - }, - }, -} diff --git a/config/nvim/lua/plugins/coding.lua b/config/nvim/lua/plugins/coding.lua new file mode 100644 index 0000000..b093c38 --- /dev/null +++ b/config/nvim/lua/plugins/coding.lua @@ -0,0 +1,90 @@ +return { + -- A better annotation generator. Supports multiple languages and annotation conventions. + -- https://github.com/danymat/neogen + { + "danymat/neogen", + dependencies = "nvim-treesitter/nvim-treesitter", + version = "*", + cmd = "Neogen", + opts = { + snippet_engine = "luasnip", + languages = { + lua = { template = { annotation_convention = "ldoc" } }, + typescript = { template = { annotation_convention = "tsdoc" } }, + typescriptreact = { template = { annotation_convention = "tsdoc" } }, + }, + }, + keys = { + { + "baa", + function() + require("neogen").generate({ type = "current" }) + end, + desc = "Current", + }, + { + "bac", + function() + require("neogen").generate({ type = "class" }) + end, + desc = "Class", + }, + { + "baf", + function() + require("neogen").generate({ type = "func" }) + end, + desc = "Function", + }, + { + "bat", + function() + require("neogen").generate({ type = "type" }) + end, + desc = "Type", + }, + { + "baF", + function() + require("neogen").generate({ type = "file" }) + end, + desc = "File", + }, + }, + }, + -- Describe the regexp under the cursor + -- https://github.com/bennypowers/nvim-regexplainer + { + "bennypowers/nvim-regexplainer", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "MunifTanjim/nui.nvim", + }, + opts = { + -- automatically show the explainer when the cursor enters a regexp + auto = true, + }, + }, + + -- Clarify and beautify your comments using boxes and lines. + -- https://github.com/LudoPinelli/comment-box.nvim + { "LudoPinelli/comment-box.nvim", opts = {} }, + + -- Tabnine Client for Neovim + -- https://github.com/codota/tabnine-nvim + { + "codota/tabnine-nvim", + name = "tabnine", + build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh", + cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" }, + event = "User", + opts = { + accept_keymap = "", + dismiss_keymap = "", + }, + }, + + -- Vim plugin for automatic time tracking and metrics generated from your programming activity. + -- https://github.com/wakatime/vim-wakatime + { "wakatime/vim-wakatime", lazy = false, enabled = true }, +} diff --git a/config/nvim/lua/plugins/example.lua b/config/nvim/lua/plugins/example.lua new file mode 100644 index 0000000..78a3370 --- /dev/null +++ b/config/nvim/lua/plugins/example.lua @@ -0,0 +1,266 @@ +-- since this is just an example spec, don't actually load anything here and return an empty spec +-- stylua: ignore +if true then return {} end + +-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim +-- +-- In your plugin files, you can: +-- * add extra plugins +-- * disable/enabled LazyVim plugins +-- * override the configuration of LazyVim plugins +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, + + -- change trouble config + { + "folke/trouble.nvim", + -- opts will be merged with the parent spec + opts = { use_diagnostic_signs = true }, + }, + + -- disable trouble + { "folke/trouble.nvim", enabled = false }, + + -- add symbols-outline + { + "simrat39/symbols-outline.nvim", + cmd = "SymbolsOutline", + keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, + config = true, + }, + + -- override nvim-cmp and add cmp-emoji + { + "hrsh7th/nvim-cmp", + dependencies = { "hrsh7th/cmp-emoji" }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local cmp = require("cmp") + opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } })) + end, + }, + + -- change some telescope options and a keymap to browse plugin files + { + "nvim-telescope/telescope.nvim", + keys = { + -- add a keymap to browse plugin files + -- stylua: ignore + { + "fp", + function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end, + desc = "Find Plugin File", + }, + }, + -- change some options + opts = { + defaults = { + layout_strategy = "horizontal", + layout_config = { prompt_position = "top" }, + sorting_strategy = "ascending", + winblend = 0, + }, + }, + }, + + -- add telescope-fzf-native + { + "telescope.nvim", + dependencies = { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + config = function() + require("telescope").load_extension("fzf") + end, + }, + }, + + -- add pyright to lspconfig + { + "neovim/nvim-lspconfig", + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- pyright will be automatically installed with mason and loaded with lspconfig + pyright = {}, + }, + }, + }, + + -- add tsserver and setup with typescript.nvim instead of lspconfig + { + "neovim/nvim-lspconfig", + dependencies = { + "jose-elias-alvarez/typescript.nvim", + init = function() + require("lazyvim.util").on_attach(function(_, buffer) + -- stylua: ignore + vim.keymap.set( "n", "co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" }) + vim.keymap.set("n", "cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer }) + end) + end, + }, + ---@class PluginLspOpts + opts = { + ---@type lspconfig.options + servers = { + -- tsserver will be automatically installed with mason and loaded with lspconfig + tsserver = {}, + }, + -- you can do any additional lsp server setup here + -- return true if you don't want this server to be setup with lspconfig + ---@type table + setup = { + -- example to setup with typescript.nvim + tsserver = function(_, opts) + require("typescript").setup({ server = opts }) + return true + end, + -- Specify * to use this function as a fallback for any server + -- ["*"] = function(server, opts) end, + }, + }, + }, + + -- for typescript, LazyVim also includes extra specs to properly setup lspconfig, + -- treesitter, mason and typescript.nvim. So instead of the above, you can use: + { import = "lazyvim.plugins.extras.lang.typescript" }, + + -- add more treesitter parsers + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "html", + "javascript", + "json", + "lua", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "tsx", + "typescript", + "vim", + "yaml", + }, + }, + }, + + -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above + -- would overwrite `ensure_installed` with the new value. + -- If you'd rather extend the default config, use the code below instead: + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add tsx and treesitter + vim.list_extend(opts.ensure_installed, { + "tsx", + "typescript", + }) + end, + }, + + -- the opts function can also be used to change the default opts: + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function(_, opts) + table.insert(opts.sections.lualine_x, "๐Ÿ˜„") + end, + }, + + -- or you can return new options to override all the defaults + { + "nvim-lualine/lualine.nvim", + event = "VeryLazy", + opts = function() + return { + --[[add your custom lualine config here]] + } + end, + }, + + -- use mini.starter instead of alpha + { import = "lazyvim.plugins.extras.ui.mini-starter" }, + + -- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc + { import = "lazyvim.plugins.extras.lang.json" }, + + -- add any tools you want to have installed below + { + "williamboman/mason.nvim", + opts = { + ensure_installed = { + "stylua", + "shellcheck", + "shfmt", + "flake8", + }, + }, + }, + + -- Use for completion and snippets (supertab) + -- first: disable default and behavior in LuaSnip + { + "L3MON4D3/LuaSnip", + keys = function() + return {} + end, + }, + -- then: setup supertab in cmp + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-emoji", + }, + ---@param opts cmp.ConfigSchema + opts = function(_, opts) + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + + local luasnip = require("luasnip") + local cmp = require("cmp") + + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() + -- this way you will only jump inside the snippet region + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }) + end, + }, +} diff --git a/config/nvim/lua/plugins/gitsigns.lua b/config/nvim/lua/plugins/gitsigns.lua deleted file mode 100644 index 35153b9..0000000 --- a/config/nvim/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,89 +0,0 @@ --- Git integration for buffers --- https://github.com/lewis6991/gitsigns.nvim --- luacheck: globals vim -return { - "lewis6991/gitsigns.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - signs = { - add = { hl = "GitSignsAdd", text = "โ”ƒ", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, - change = { hl = "GitSignsChange", text = "โ”ƒ", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - topdelete = { hl = "GitSignsDelete", text = "โ€พ", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map("n", "]c", function() - if vim.wo.diff then return "]c" end - vim.schedule(function() gs.next_hunk() end) - return "" - end, { expr = true }) - - map("n", "[c", function() - if vim.wo.diff then return "[c" end - vim.schedule(function() gs.prev_hunk() end) - return "" - end, { expr = true }) - - -- Actions - map("n", "oghs", gs.stage_hunk, { desc = "Stage Hunk" }) - map("n", "oghr", gs.reset_hunk, { desc = "Reset Hunk" }) - map("v", "oghs", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end) - map("v", "oghr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end) - map("n", "oghS", gs.stage_buffer, { desc = "Stage Buffer" }) - map("n", "oghu", gs.undo_stage_hunk, { desc = "Undo Stage Hunk" }) - map("n", "oghR", gs.reset_buffer, { desc = "Reset Buffer" }) - map("n", "oghp", gs.preview_hunk, { desc = "Preview Hunk" }) - map("n", "ogbl", function() gs.blame_line({ full = true }) end, { desc = "Blame Line" }) - map("n", "ogbt", gs.toggle_current_line_blame, { desc = "Toggle Current Line Blame" }) - map("n", "oghd", gs.diffthis, { desc = "Diff This" }) - map("n", "oghD", function() gs.diffthis("~") end) - map("n", "ogtd", gs.toggle_deleted, { desc = "Toggle Deleted" }) - - -- Text object - map({ "o", "x" }, "ih", ":Gitsigns select_hunk") - end, - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - }, - current_line_blame_formatter_opts = { - relative_time = false, - }, - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, - preview_config = { - -- Options passed to nvim_open_win - border = "single", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - yadm = { - enable = false, - }, - }, -} diff --git a/config/nvim/lua/plugins/lazy.lua b/config/nvim/lua/plugins/lazy.lua deleted file mode 100644 index fd4f1bf..0000000 --- a/config/nvim/lua/plugins/lazy.lua +++ /dev/null @@ -1,259 +0,0 @@ --- luacheck: globals vim -local vim = vim - -return { - -- plenary: full; complete; entire; absolute; unqualified. - -- All the lua functions I don't want to write twice. - -- https://github.com/nvim-lua/plenary.nvim - { "nvim-lua/plenary.nvim", lazy = true }, - - -- lua `fork` of vim-web-devicons for neovim - -- https://github.com/nvim-tree/nvim-web-devicons - { "nvim-tree/nvim-web-devicons" }, - - -- The theme of choise, catppuccin - -- https://github.com/catppuccin/nvim - { - "catppuccin/nvim", - name = "catppuccin", - priority = 10000, - enabled = true, - lazy = false, - config = function() vim.cmd.colorscheme("catppuccin") end, - opts = { - flavour = "mocha", - transparent_background = true, - dim_inactive = { - enabled = true, - shade = "dark", - percentage = 0.15, - }, - integrations = { - aerial = true, - barbecue = { - -- directory name is dimmed by default - dim_dirname = true, - bold_basename = true, - dim_context = false, - alt_background = false, - }, - cmp = true, - dap = { enabled = true, enable_ui = true }, - fidget = true, - gitsigns = true, - harpoon = true, - indent_blankline = { - enabled = true, - colored_indent_levels = false, - }, - mason = true, - mini = true, - neotree = true, - notify = true, - native_lsp = { - enabled = true, - virtual_text = { - errors = { "italic" }, - hints = { "italic" }, - warnings = { "italic" }, - information = { "italic" }, - }, - underlines = { - errors = { "underline" }, - hints = { "underline" }, - warnings = { "underline" }, - information = { "underline" }, - }, - inlay_hints = { - background = true, - }, - }, - semantic_tokens = true, - symbols_outline = true, - telescope = { - enabled = true, - style = "catppuccin", - }, - treesitter = true, - lsp_trouble = true, - which_key = true, - }, - }, - }, - - -- Notifications as a popup - -- https://github.com/rcarriga/nvim-notify - { - "rcarriga/nvim-notify", - keys = { - { - "un", - function() require("notify").dismiss({ silent = true, pending = true }) end, - desc = "Dismiss all Notifications", - }, - }, - opts = { - timeout = 3000, - max_height = function() return math.floor(vim.o.lines * 0.75) end, - max_width = function() return math.floor(vim.o.columns * 0.75) end, - }, - init = function() vim.notify = require("notify") end, - }, - - -- vscode-like pictograms for neovim lsp completion items - -- https://github.com/onsails/lspkind.nvim - { "onsails/lspkind-nvim" }, - - -- Save and restore Vim views automatically - -- https://github.com/senderle/restoreview - { "senderle/restoreview" }, - - -- Create key bindings that stick. WhichKey is a lua plugin for Neovim that - -- displays a popup with possible keybindings of the command you started typing. - -- https://github.com/folke/which-key.nvim - { - "folke/which-key.nvim", - enabled = true, - lazy = false, - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - opts = { - plugins = { spelling = true, marks = true, registers = true }, - }, - }, - - -- Neovim plugin to improve the default vim.ui interfaces - -- https://github.com/stevearc/dressing.nvim - { - "stevearc/dressing.nvim", - lazy = true, - init = function() - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.select = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.select(...) - end - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.input = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.input(...) - end - end, - }, - - -- A tree like view for symbols in Neovim using the LSP. - -- https://github.com/simrat39/symbols-outline.nvim - { - "simrat39/symbols-outline.nvim", - cmd = "SymbolsOutline", - keys = { { "bs", "SymbolsOutline", desc = "Symbols Outline" } }, - opts = { - -- add your options that should be passed to the setup() function here - position = "right", - }, - }, - - -- Getting you where you want with the fewest keystrokes. - -- https://github.com/ThePrimeagen/harpoon - { "ThePrimeagen/harpoon" }, - - -- A Neovim plugin hiding your colorcolumn when unneeded. - -- https://github.com/m4xshen/smartcolumn.nvim - { - "m4xshen/smartcolumn.nvim", - opts = { - colorcolumn = { "80", "100", "120" }, - disabled_filetypes = { - "dashboard", - "help", - "json", - "lazy", - "lazyterm", - "mason", - "neo-tree", - "notify", - "starter", - "toggleterm", - "Trouble", - }, - }, - }, - - -- Status information for LSP. - -- https://github.com/j-hui/fidget.nvim - { "j-hui/fidget.nvim" }, - - -- A neovim lua plugin to help easily manage multiple terminal windows - -- https://github.com/akinsho/toggleterm.nvim - { - "akinsho/toggleterm.nvim", - version = "*", - opts = { - open_mapping = [[]], - insert_mappings = true, - -- direction = "float", - float_opts = { - width = function() return math.floor(vim.o.columns * 0.9) end, - height = function() return math.floor(vim.o.lines * 0.9) end, - }, - }, - }, - - -- Close buffer without messing up with the window. - -- https://github.com/famiu/bufdelete.nvim - { "famiu/bufdelete.nvim" }, - - -- Delete multiple vim buffers based on different conditions - -- https://github.com/kazhala/close-buffers.nvim - { "kazhala/close-buffers.nvim" }, - - -- JSON schemas for Neovim - -- https://github.com/b0o/schemastore.nvim - { "b0o/schemastore.nvim" }, - - -- sleuth.vim: Heuristically set buffer options - -- https://github.com/tpope/vim-sleuth - { "tpope/vim-sleuth" }, - - -- Neovim plugin for locking a buffer to a window - -- https://github.com/stevearc/stickybuf.nvim - { "stevearc/stickybuf.nvim", opts = {} }, - - -- Describe the regexp under the cursor - -- https://github.com/bennypowers/nvim-regexplainer - { - "bennypowers/nvim-regexplainer", - dependencies = { - "nvim-treesitter/nvim-treesitter", - "MunifTanjim/nui.nvim", - }, - opts = { - -- automatically show the explainer when the cursor enters a regexp - auto = true, - }, - }, - - -- Clarify and beautify your comments using boxes and lines. - -- https://github.com/LudoPinelli/comment-box.nvim - { "LudoPinelli/comment-box.nvim", opts = {} }, - - -- Tabnine Client for Neovim - -- https://github.com/codota/tabnine-nvim - { - "codota/tabnine-nvim", - name = "tabnine", - build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh", - cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" }, - event = "User", - opts = { - accept_keymap = "", - dismiss_keymap = "", - }, - }, - - -- Vim plugin for automatic time tracking and metrics generated from your programming activity. - -- https://github.com/wakatime/vim-wakatime - { "wakatime/vim-wakatime", lazy = false, enabled = true }, -} diff --git a/config/nvim/lua/plugins/mini.lua b/config/nvim/lua/plugins/mini.lua deleted file mode 100644 index 8160a69..0000000 --- a/config/nvim/lua/plugins/mini.lua +++ /dev/null @@ -1,140 +0,0 @@ -return { - "echasnovski/mini.nvim", - version = "*", - config = function() - -- Common configuration presets - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-basics.md - require("mini.basics").setup() - - -- Fast and flexible start screen - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-starter.md - local starter = require("mini.starter") - starter.setup({ - header = table.concat({ - " โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„ ", - " โ–„โ–€โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–€โ–„ ", - " โ–ˆโ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆ ", - " โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–ˆโ–„โ–„โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–ˆ โ–„โ–„โ–„ ", - "โ–„โ–„โ–„โ–„โ–„ โ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–€โ–‘โ–‘โ–‘โ–‘โ–€โ–ˆโ–‘โ–‘โ–€โ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–€โ–€โ–‘โ–ˆโ–ˆ ", - "โ–ˆโ–ˆโ–„โ–€โ–ˆโ–ˆโ–„โ–ˆโ–‘โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–€โ–€โ–€โ–€โ–€โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆ ", - " โ–€โ–ˆโ–ˆโ–„โ–€โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–€โ–‘โ–ˆโ–ˆโ–€โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–€โ–ˆโ–ˆ", - " โ–€โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–€โ–‘โ–‘โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–„โ–ˆโ–‘โ–‘โ–‘โ–‘โ–„โ–‘โ–„โ–ˆโ–‘โ–‘โ–ˆโ–ˆ", - " โ–€โ–ˆโ–‘โ–‘โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–„โ–‘โ–‘โ–„โ–‘โ–‘โ–‘โ–ˆโ–ˆ", - " โ–„โ–ˆโ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–€โ–„โ–‘โ–‘โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–‘โ–‘โ–„โ–€ ", - " โ–ˆโ–€โ–€โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–€โ–€โ–€โ–€โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–€ ", - " โ–ˆโ–ˆโ–ˆโ–ˆโ–€ โ–ˆโ–ˆโ–ˆโ–€ โ–€โ–ˆโ–ˆโ–ˆ โ–€โ–ˆโ–ˆโ–€ ", - }, "\n"), - evaluate_single = true, - items = { - starter.sections.telescope(), - starter.sections.builtin_actions(), - starter.sections.recent_files(5, true, true), - }, - content_hooks = { - starter.gen_hook.adding_bullet(), - starter.gen_hook.aligning("center", "center"), - }, - }) - - -- Miscellaneous useful functions - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-misc.md - require("mini.misc").setup() - - -- Extend and create a/i textobjects - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-ai.md - require("mini.ai").setup() - - -- Align text interactively - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-align.md - require("mini.align").setup() - - -- Animate common Neovim actions - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-animate.md - -- require("mini.animate").setup() - - -- Go forward/backward with square brackets - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-bracketed.md - require("mini.bracketed").setup() - - -- Comment lines - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-comment.md - require("mini.comment").setup() - - -- Autocompletion and signature help plugin - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-completion.md - -- require("mini.completion").setup() - - -- Automatic highlighting of word under cursor - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-cursorword.md - -- require("mini.cursorword").setup() - - -- Highlight patterns in text - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md - local hipatterns = require("mini.hipatterns") - hipatterns.setup({ - highlighters = { - -- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE' - fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" }, - hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" }, - todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" }, - note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" }, - - -- Highlight hex color strings (`#rrggbb`) using that color - hex_color = hipatterns.gen_highlighter.hex_color(), - }, - }) - - -- Visualize and work with indent scope - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-indentscope.md - require("mini.indentscope").setup({ - draw = { - delay = 0, - -- animation = require("mini.indentscope").gen_animation("none"), - }, - }) - - -- Jump to next/previous single character - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump.md - require("mini.jump").setup() - - -- Jump within visible lines via iterative label filtering - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump2d.md - require("mini.jump2d").setup() - - -- Window with buffer text overview, scrollbar, and highlights - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-map.md - require("mini.map").setup() - - -- Move any selection in any direction - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-move.md - require("mini.move").setup() - - -- Text edit operators - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-operators.md - -- require("mini.operators").setup() - - -- Minimal and fast autopairs - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-pairs.md - require("mini.pairs").setup() - - -- Split and join arguments - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-splitjoin.md - require("mini.splitjoin").setup() - - -- Minimal and fast statusline module with opinionated default look - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-statusline.md - require("mini.statusline").setup() - - -- Fast and feature-rich surround actions - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-surround.md - require("mini.surround").setup() - - -- Minimal and fast tabline showing listed buffers - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-tabline.md - require("mini.tabline").setup() - - -- Work with trailing whitespace - -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-trailspace.md - require("mini.trailspace").setup() - end, -} diff --git a/config/nvim/lua/plugins/neo-tree.lua b/config/nvim/lua/plugins/neo-tree.lua deleted file mode 100644 index 2518c2d..0000000 --- a/config/nvim/lua/plugins/neo-tree.lua +++ /dev/null @@ -1,456 +0,0 @@ --- File-tree manager. --- https://github.com/nvim-neo-tree/neo-tree.nvim --- luacheck: globals vim - --- Unless you are still migrating, remove the deprecated commands from v1.x -vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) - -return { - "nvim-neo-tree/neo-tree.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - { - -- only needed if you want to use the commands with "_with_window_picker" suffix - "s1n7ax/nvim-window-picker", - config = function() - require("window-picker").setup({ - autoselect_one = true, - include_current = false, - filter_rules = { - -- filter using buffer options - bo = { - -- if the file type is one of following, the window will be ignored - filetype = { "neo-tree", "neo-tree-popup", "notify" }, - - -- if the buffer type is one of following, the window will be ignored - buftype = { "terminal", "quickfix" }, - }, - }, - other_win_hl_color = "#e35e4f", - }) - end, - }, - }, - config = function() - -- If you want icons for diagnostic errors, you'll need to define them somewhere: - vim.fn.sign_define("DiagnosticSignError", { text = "๏— ", texthl = "DiagnosticSignError" }) - vim.fn.sign_define("DiagnosticSignWarn", { text = "๏ฑ ", texthl = "DiagnosticSignWarn" }) - vim.fn.sign_define("DiagnosticSignInfo", { text = "๏š ", texthl = "DiagnosticSignInfo" }) - vim.fn.sign_define("DiagnosticSignHint", { text = "๓ฐŒต", texthl = "DiagnosticSignHint" }) - - require("neo-tree").setup({ - -- Close Neo-tree if it is the last window left in the tab - close_if_last_window = true, - -- "double", "none", "rounded", "shadow", "single" or "solid" - popup_border_style = "rounded", - enable_git_status = true, - enable_diagnostics = true, - -- Enable normal mode for input dialogs. - enable_normal_mode_for_inputs = false, - - -- when opening files, do not use windows containing these filetypes or buftypes - open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, - - -- popup_border_style is for input and confirmation dialogs. - -- Configurtaion of floating window is done in the individual source sections. - -- "NC" is a special style that works well with NormalNC set - close_floats_on_escape_key = true, - default_source = "filesystem", - git_status_async = true, - -- "trace", "debug", "info", "warn", "error", "fatal" - log_level = "info", - -- true, false, "/path/to/file.log", use :NeoTreeLogs to show the file - log_to_file = false, - -- false = open files in top left window - open_files_in_last_window = true, - -- in ms, needed for containers to redraw right aligned and faded content - resize_timer_interval = 100, - -- used when sorting files and directories in the tree - sort_case_insensitive = true, - -- If false, inputs will use vim.ui.input() instead of custom floats. - use_popups_for_input = false, - -- use a custom function for sorting files and directories in the tree - sort_function = nil, - event_handlers = { - -- { - -- event = "before_render", - -- handler = function (state) - -- -- add something to the state that can be used by custom components - -- end - -- }, - -- { - -- event = "file_opened", - -- handler = function(file_path) - -- --auto close - -- require("neo-tree").close_all() - -- end - -- }, - -- { - -- event = "file_opened", - -- handler = function(file_path) - -- --clear search after opening a file - -- require("neo-tree.sources.filesystem").reset_search() - -- end - -- }, - -- { - -- event = "file_renamed", - -- handler = function(args) - -- -- fix references to file - -- print(args.source, " renamed to ", args.destination) - -- end - -- }, - -- { - -- event = "file_moved", - -- handler = function(args) - -- -- fix references to file - -- print(args.source, " moved to ", args.destination) - -- end - -- }, - { - event = "neo_tree_buffer_enter", - handler = function() - vim.cmd("set winbar=") - vim.cmd("highlight CursorLine gui='bold'") - vim.cmd("highlight CursorColumn guibg=NONE") - --vim.cmd("set guicursor+=a:InvisibleCursor") - --vim.cmd("highlight InvisibleCursor gui=reverse blend=100") - end, - }, - { - event = "neo_tree_buffer_leave", - handler = function() - --vim.cmd("set guicursor-=a:InvisibleCursor") - vim.cmd("highlight CursorLine gui=NONE") - end, - }, - }, - default_component_configs = { - container = { - enable_character_fade = true, - }, - indent = { - indent_size = 2, - -- extra padding on left hand side - padding = 1, - -- indent guides - with_markers = true, - indent_marker = "โ”‚", - last_indent_marker = "โ””", - highlight = "NeoTreeIndentMarker", - -- expander config, needed for nesting files - -- if nil and file nesting is enabled, will enable expanders - with_expanders = true, - expander_collapsed = "๏‘ ", - expander_expanded = "๏‘ผ", - expander_highlight = "NeoTreeExpander", - }, - icon = { - folder_closed = "๎—ฟ", - folder_open = "๎—พ", - folder_empty = "-", - -- The next two settings are only a fallback, - -- if you use nvim-web-devicons and configure default icons there - -- then these will never be used. - default = "*", - highlight = "NeoTreeFileIcon", - }, - modified = { - symbol = "[+]", - highlight = "NeoTreeModified", - }, - name = { - trailing_slash = true, - use_git_status_colors = false, - highlight = "NeoTreeFileName", - }, - git_status = { - symbols = { - -- Change type - added = "ห–", - modified = "ยฑ", - deleted = "โœ•", - renamed = "โ†ช", - -- Status type - untracked = "?", - ignored = "โจ", - unstaged = "ยท", - staged = "โœ“", - conflict = "๎œง", - }, - }, - }, - -- A list of functions, each representing a global custom command - -- that will be available in all sources (if not overridden in `opts[source_name].commands`) - -- see `:h neo-tree-custom-commands-global` - commands = {}, - window = { - -- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for - -- possible options. These can also be functions that return these options. - - -- left, right, float, current - position = "left", - -- applies to left and right positions - width = 40, - mapping_options = { - noremap = true, - nowait = true, - }, - -- settings that apply to float position only - popup = { - size = { - height = "80%", - width = "50%", - }, - position = "50%", -- 50% means center it - -- you can also specify border here, if you want a different setting from - -- the global popup_border_style. - }, - -- Mappings for tree window. See `:h nep-tree-mappings` for a list of built-in commands. - -- You can also create your own commands by providing a function instead of a string. - mappings = { - [""] = { - "toggle_node", - -- disable `nowait` if you have existing combos - -- starting with this char that you want to use - nowait = false, - }, - ["<2-LeftMouse>"] = "open", - [""] = "open", - -- close preview or floating neo-tree window - [""] = "cancel", - ["P"] = { "toggle_preview", config = { use_float = true } }, - ["l"] = "focus_preview", - -- ["S"] = "open_split", - -- ["s"] = "open_vsplit", - ["S"] = "split_with_window_picker", - ["s"] = "vsplit_with_window_picker", - ["t"] = "open_tabnew", - -- [""] = "open_drop", - -- ["t"] = "open_tab_drop", - ["w"] = "open_with_window_picker", - -- -- enter preview mode, which shows the current node without focusing - --["P"] = "toggle_preview", - ["C"] = "close_node", - -- ['C'] = 'close_all_subnodes', - ["z"] = "close_all_nodes", - --["Z"] = "expand_all_nodes", - ["a"] = { - "add", - -- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). - -- see `:h neo-tree-file-actions` for details - -- some commands may take optional config options, - -- see `:h neo-tree-mappings` for details - config = { - -- "none", "relative", "absolute" - show_path = "relative", - }, - }, - -- also accepts the optional config.show_path option like "add". - -- this also supports BASH style brace expansion. - ["A"] = "add_directory", - ["d"] = "delete", - ["r"] = "rename", - ["y"] = "copy_to_clipboard", - ["x"] = "cut_to_clipboard", - ["p"] = "paste_from_clipboard", - -- takes text input for destination, also accepts the optional config.show_path option like "add": - -- ["c"] = { - -- "copy", - -- config = { - -- show_path = "none" -- "none", "relative", "absolute" - -- } - --} - ["c"] = "copy", - -- takes text input for destination, also accepts the optional config.show_path option like "add". - ["m"] = "move", - ["q"] = "close_window", - ["R"] = "refresh", - ["?"] = "show_help", - ["<"] = "prev_source", - [">"] = "next_source", - }, - }, - nesting_rules = {}, - filesystem = { - -- Add a custom command or override a global one using the same function name - commands = {}, - components = { - harpoon_index = function(config, node, _) - local Marked = require("harpoon.mark") - local path = node:get_id() - local succuss, index = pcall(Marked.get_index_of, path) - if succuss and index and index > 0 then - return { - text = string.format(" โฅค %d", index), -- <-- Add your favorite harpoon like arrow here - highlight = config.highlight or "NeoTreeDirectoryIcon", - } - else - return {} - end - end, - }, - renderers = { - directory = { - { "indent" }, - { "icon" }, - { "current_filter" }, - { - "container", - width = "100%", - right_padding = 0, - --max_width = 60, - content = { - { "name", zindex = 10 }, - { "clipboard", zindex = 10 }, - { "diagnostics", errors_only = true, zindex = 20, align = "right" }, - }, - }, - }, - file = { - { "indent" }, - { "icon" }, - { - "container", - width = "100%", - right_padding = 0, - --max_width = 60, - content = { - { - "name", - use_git_status_colors = false, - zindex = 10, - }, - -- { - -- "symlink_target", - -- zindex = 10, - -- highlight = "NeoTreeSymbolicLinkTarget", - -- }, - { "clipboard", zindex = 10 }, - { "bufnr", zindex = 10 }, - { "harpoon_index", zindex = 20, align = "right" }, - { "modified", zindex = 20, align = "right" }, - { "diagnostics", zindex = 20, align = "right" }, - { "git_status", zindex = 20, align = "right" }, - }, - }, - }, - }, - filtered_items = { - -- when true, they will just be displayed differently than normal items - visible = false, - hide_dotfiles = false, - hide_gitignored = false, - -- only works on Windows for hidden files/directories - hide_hidden = true, - hide_by_name = { - ".git", - ".DS_Store", - "thumbs.db", - ".idea", - ".mypy_cache", - "node_modules", - }, - -- uses glob style patterns - hide_by_pattern = { - --"*.meta", - --"*/src/*/tsconfig.json", - "*-cache", - "*.cache", - ".null-ls_*", - }, - never_show = { -- remains hidden even if visible is toggled to true - ".DS_Store", - "thumbs.db", - }, - always_show = { -- remains visible even if other settings would normally hide it - ".gitignore", - ".gitkeep", - }, - }, - find_by_full_path_words = true, - -- when true, empty folders will be grouped together - group_empty_dirs = false, - -- true creates a 2-way binding between vim's cwd and neo-tree's root - bind_to_cwd = false, - -- max number of search results when using filters - search_limit = 50, - follow_current_file = { - -- This will find and focus the file in the active buffer every time - -- the current file is changed while the tree is open. - enabled = false, - -- `false` closes auto expanded dirs, such as with `:Neotree reveal` - leave_dirs_open = false, - }, - -- netrw disabled, opening a directory opens neo-tree - -- in whatever position is specified in window.position - -- "open_current", -- netrw disabled, opening a directory opens within the - -- window like netrw would, regardless of window.position - -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs - hijack_netrw_behavior = "open_default", - -- This will use the OS level file watchers to detect changes - -- instead of relying on nvim autocmd events. - use_libuv_file_watcher = true, - window = { - mappings = { - ["."] = "set_root", - ["/"] = "fuzzy_finder", - -- fuzzy sorting using the fzy algorithm - ["#"] = "fuzzy_sorter", - [""] = "navigate_up", - [""] = "navigate_up", - [""] = "clear_filter", - ["D"] = "fuzzy_finder_directory", - ["f"] = "filter_on_submit", - ["gn"] = "next_git_modified", - ["gp"] = "prev_git_modified", - ["H"] = "toggle_hidden", - }, - -- define keymaps for filter popup window in fuzzy_finder_mode - fuzzy_finder_mappings = { - [""] = "move_cursor_down", - [""] = "move_cursor_down", - [""] = "move_cursor_up", - [""] = "move_cursor_up", - }, - }, - }, - buffers = { - follow_current_file = { - -- This will find and focus the file in the active buffer every time - -- the current file is changed while the tree is open. - enabled = true, - -- `false` closes auto expanded dirs, such as with `:Neotree reveal` - leave_dirs_open = true, - }, - -- when true, empty folders will be grouped together - group_empty_dirs = true, - show_unloaded = true, - window = { - mappings = { - ["bd"] = "buffer_delete", - [""] = "navigate_up", - ["."] = "set_root", - }, - }, - }, - git_status = { - window = { - position = "float", - mappings = { - ["A"] = "git_add_all", - ["gu"] = "git_unstage_file", - ["ga"] = "git_add_file", - ["gr"] = "git_revert_file", - ["gc"] = "git_commit", - ["gp"] = "git_push", - ["gg"] = "git_commit_and_push", - }, - }, - }, - }) - - vim.cmd([[nnoremap \ :Neotree reveal]]) - end, -} diff --git a/config/nvim/lua/plugins/neogen.lua b/config/nvim/lua/plugins/neogen.lua deleted file mode 100644 index 377f8fb..0000000 --- a/config/nvim/lua/plugins/neogen.lua +++ /dev/null @@ -1,23 +0,0 @@ --- A better annotation generator. Supports multiple languages and annotation conventions. --- https://github.com/danymat/neogen -return { - "danymat/neogen", - dependencies = "nvim-treesitter/nvim-treesitter", - version = "*", - cmd = "Neogen", - opts = { - snippet_engine = "luasnip", - languages = { - lua = { template = { annotation_convention = "ldoc" } }, - typescript = { template = { annotation_convention = "tsdoc" } }, - typescriptreact = { template = { annotation_convention = "tsdoc" } }, - }, - }, - keys = { - { "baa", function() require("neogen").generate({ type = "current" }) end, desc = "Current" }, - { "bac", function() require("neogen").generate({ type = "class" }) end, desc = "Class" }, - { "baf", function() require("neogen").generate({ type = "func" }) end, desc = "Function" }, - { "bat", function() require("neogen").generate({ type = "type" }) end, desc = "Type" }, - { "baF", function() require("neogen").generate({ type = "file" }) end, desc = "File" }, - }, -} diff --git a/config/nvim/lua/plugins/null-ls.lua b/config/nvim/lua/plugins/null-ls.lua deleted file mode 100644 index 60cca82..0000000 --- a/config/nvim/lua/plugins/null-ls.lua +++ /dev/null @@ -1,56 +0,0 @@ -return { - "jose-elias-alvarez/null-ls.nvim", - config = function() - local null_ls = require("null-ls") - -- Check supported formatters and linters - -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting - -- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics - - -- Register any number of sources simultaneously - null_ls.setup({ - -- filetypes = { "markdown", "text" }, - sources = { - - -- Code Actions - null_ls.builtins.code_actions.eslint, - null_ls.builtins.code_actions.gitsigns, - null_ls.builtins.code_actions.refactoring, - null_ls.builtins.code_actions.shellcheck, - - -- Diagnostics - null_ls.builtins.diagnostics.actionlint, - null_ls.builtins.diagnostics.alex, - null_ls.builtins.diagnostics.ansiblelint, - null_ls.builtins.diagnostics.dotenv_linter, - null_ls.builtins.diagnostics.editorconfig_checker, - null_ls.builtins.diagnostics.eslint, - null_ls.builtins.diagnostics.jsonlint, - null_ls.builtins.diagnostics.luacheck, - null_ls.builtins.diagnostics.php, - null_ls.builtins.diagnostics.phpcs, - null_ls.builtins.diagnostics.phpstan, - null_ls.builtins.diagnostics.psalm, - null_ls.builtins.diagnostics.semgrep, - null_ls.builtins.diagnostics.shellcheck, - null_ls.builtins.diagnostics.stylelint, - null_ls.builtins.diagnostics.tfsec, - null_ls.builtins.diagnostics.trail_space, - null_ls.builtins.diagnostics.tsc, - null_ls.builtins.diagnostics.write_good, - null_ls.builtins.diagnostics.zsh, - - -- Formatting - null_ls.builtins.formatting.clang_format, - null_ls.builtins.formatting.fixjson, - null_ls.builtins.formatting.isort, - null_ls.builtins.formatting.jq, - null_ls.builtins.formatting.phpcsfixer, - null_ls.builtins.formatting.prettier, - null_ls.builtins.formatting.rome, - null_ls.builtins.formatting.shfmt.with({ - args = { "-i", "1", "-bn", "-ci", "-sr", "-kb", "-fn" }, - }), - }, - }) - end, -} diff --git a/config/nvim/lua/plugins/nvim-dap.lua b/config/nvim/lua/plugins/nvim-dap.lua deleted file mode 100644 index 9ba0de4..0000000 --- a/config/nvim/lua/plugins/nvim-dap.lua +++ /dev/null @@ -1,101 +0,0 @@ --- --- Shows how to use the DAP plugin to debug your code. --- --- https://github.com/mfussenegger/nvim-dap --- luacheck: globals vim -return { - "mfussenegger/nvim-dap", - dependencies = { - -- Creates a beautiful debugger UI - "rcarriga/nvim-dap-ui", - - -- Installs the debug adapters for you - "williamboman/mason.nvim", - "jay-babu/mason-nvim-dap.nvim", - - -- Add your own debuggers here - "leoluz/nvim-dap-go", - }, - config = function() - local dap = require("dap") - local dapui = require("dapui") - - require("mason-nvim-dap").setup({ - -- Makes a best effort to setup the various debuggers with - -- reasonable debug configurations - automatic_setup = true, - automatic_installation = true, - - -- You can provide additional configuration to the handlers, - -- see mason-nvim-dap README for more information - -- handlers = {}, - - -- You'll need to check that you have the required things installed - -- online, please don't ask me how to install them :) - ensure_installed = { - -- Update this to ensure that you have the debuggers for the langs you want - "bash", - "delve", - "jq", - "js", - "lua", - "php", - "python", - "stylua", - }, - handlers = { - function(config) - -- all sources with no handler get passed here - - -- Keep original functionality - require("mason-nvim-dap").default_setup(config) - end, - }, - }) - - local wk = require("which-key") - wk.register({ - -- Basic debugging keymaps, feel free to change to your liking! - [""] = { dap.continue, "Debug: Start/Continue" }, - [""] = { dap.step_into, "Debug: Step Into" }, - [""] = { dap.step_over, "Debug: Step Over" }, - [""] = { dap.step_out, "Debug: Step Out" }, - ["Db"] = { dap.toggle_breakpoint, "Debug: Toggle Breakpoint" }, - ["DB"] = { - function() dap.set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, - "Debug: Set Breakpoint", - }, - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - [""] = { dapui.toggle, "Debug: See last session result." }, - }, { prefix = "", mode = "n" }) - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - dapui.setup({ - -- Set icons to characters that are more likely to work in every terminal. - -- Feel free to remove or use ones that you like more! :) - -- Don't feel like these are good choices. - icons = { expanded = "โ–พ", collapsed = "โ–ธ", current_frame = "*" }, - controls = { - icons = { - pause = "โธ", - play = "โ–ถ", - step_into = "โŽ", - step_over = "โญ", - step_out = "โฎ", - step_back = "b", - run_last = "โ–ถโ–ถ", - terminate = "โน", - disconnect = "โ", - }, - }, - }) - - dap.listeners.after.event_initialized["dapui_config"] = dapui.open - dap.listeners.before.event_terminated["dapui_config"] = dapui.close - dap.listeners.before.event_exited["dapui_config"] = dapui.close - - -- Install golang specific config - require("dap-go").setup() - end, -} diff --git a/config/nvim/lua/plugins/nvim-lspconfig.lua b/config/nvim/lua/plugins/nvim-lspconfig.lua index a5d2d05..4600a87 100644 --- a/config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/config/nvim/lua/plugins/nvim-lspconfig.lua @@ -1,87 +1,17 @@ --- Quickstart configs for Nvim LSP --- https://github.com/neovim/nvim-lspconfig --- luacheck: globals vim return { - -- LSP auto-complete. "neovim/nvim-lspconfig", - dependencies = { - -- Automatically install LSPs to stdpath for neovim - { "williamboman/mason.nvim", config = true }, - { "williamboman/mason-lspconfig.nvim" }, - - -- Useful status updates for LSP - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - -- NOTE: using tag legacy, fidget is being re-written completely - { "j-hui/fidget.nvim", event = "LspAttach", tag = "legacy", opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! - { "folke/neodev.nvim" }, - }, - init = function() - -- disable lsp watcher. Too slow on linux - local ok, wf = pcall(require, "vim.lsp._watchfiles") - if ok then - wf._watchfunc = function() - return function() end - end - end - end, - config = function() - -- Switch for controlling whether you want autoformatting. - -- Use :KickstartFormatToggle to toggle autoformatting on or off - local format_is_enabled = true - vim.api.nvim_create_user_command("KickstartFormatToggle", function() - format_is_enabled = not format_is_enabled - print("Setting autoformatting to: " .. tostring(format_is_enabled)) - end, {}) - - -- Create an augroup that is used for managing our formatting autocmds. - -- We need one augroup per client to make sure that multiple clients - -- can attach to the same buffer without interfering with each other. - local _augroups = {} - local get_augroup = function(client) - if not _augroups[client.id] then - local group_name = "kickstart-lsp-format-" .. client.name - local id = vim.api.nvim_create_augroup(group_name, { clear = true }) - _augroups[client.id] = id - end - - return _augroups[client.id] - end - - -- Whenever an LSP attaches to a buffer, we will run this function. - -- - -- See `:help LspAttach` for more information about this autocmd event. - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("kickstart-lsp-attach-format", { clear = true }), - -- This is where we attach the autoformatting for reasonable clients - callback = function(args) - local client_id = args.data.client_id - local client = vim.lsp.get_client_by_id(client_id) - local bufnr = args.buf - - -- Only attach to clients that support document formatting - if not client.server_capabilities.documentFormattingProvider then return end - - -- Tsserver usually works poorly. Sorry you work with bad languages - -- You can remove this line if you know what you're doing :) - if client.name == "tsserver" then return end - - -- Create an autocmd that will run *before* we save the buffer. - -- Run the formatting command for the LSP that has just attached. - vim.api.nvim_create_autocmd("BufWritePre", { - group = get_augroup(client), - buffer = bufnr, - callback = function() - if not format_is_enabled then return end - - vim.lsp.buf.format({ - async = false, - filter = function(c) return c.id == client.id end, - }) - end, - }) + opts = { + servers = { eslint = {} }, + setup = { + eslint = function() + require("lazyvim.util").on_attach(function(client) + if client.name == "eslint" then + client.server_capabilities.documentFormattingProvider = true + elseif client.name == "tsserver" then + client.server_capabilities.documentFormattingProvider = false + end + end) end, - }) - end, + }, + }, } diff --git a/config/nvim/lua/plugins/nvim-treesitter.lua b/config/nvim/lua/plugins/nvim-treesitter.lua deleted file mode 100644 index 43577fa..0000000 --- a/config/nvim/lua/plugins/nvim-treesitter.lua +++ /dev/null @@ -1,102 +0,0 @@ --- Nvim Treesitter configurations and abstraction layer --- https://github.com/nvim-treesitter/nvim-treesitter --- luacheck: globals vim -return { - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - require("nvim-treesitter.configs").setup({ - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - - -- List of parsers to ignore installing (or "all") - ignore_install = {}, - - modules = {}, - - -- Add languages to be installed here that you want installed for treesitter - ensure_installed = "all", - - highlight = { - enable = true, - disable = {}, - --injections = { - -- python = { - -- docstrings: "markdown", - -- }, - --} - }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = "", - node_decremental = "", - }, - }, - 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 - ["aa"] = "@parameter.outer", - ["ia"] = "@parameter.inner", - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - }, - move = { - enable = true, - -- whether to set jumps in the jumplist - set_jumps = true, - goto_next_start = { - ["]m"] = "@function.outer", - ["]]"] = "@class.outer", - }, - goto_next_end = { - ["]M"] = "@function.outer", - ["]["] = "@class.outer", - }, - goto_previous_start = { - ["[m"] = "@function.outer", - ["[["] = "@class.outer", - }, - goto_previous_end = { - ["[M"] = "@function.outer", - ["[]"] = "@class.outer", - }, - }, - swap = { - enable = true, - swap_next = { - ["a"] = "@parameter.inner", - }, - swap_previous = { - ["A"] = "@parameter.inner", - }, - }, - }, - }) - end, - }, - { - "nvim-treesitter/nvim-treesitter-context", - lazy = false, - enabled = true, - opts = { - enable = true, - mode = "cursor", -- cursor, or topline - }, - }, -} diff --git a/config/nvim/lua/plugins/refactoring-nvim.lua b/config/nvim/lua/plugins/refactoring-nvim.lua deleted file mode 100644 index 07ad1d1..0000000 --- a/config/nvim/lua/plugins/refactoring-nvim.lua +++ /dev/null @@ -1,100 +0,0 @@ -return { - "ThePrimeagen/refactoring.nvim", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - }, - cmd = { "Refactor" }, - opts = {}, - keys = { - { - "re", - [[ lua require('refactoring').refactor('Extract Function')]], - { silent = true, expr = false }, - mode = { - "v", - "x", - }, - desc = "Extract Function", - }, - { - "rf", - [[ lua require('refactoring').refactor('Extract Function To File')]], - { silent = true, expr = false }, - mode = { - "v", - "x", - }, - desc = "Extract Function To File", - }, - { - "rv", - [[ lua require('refactoring').refactor('Extract Variable')]], - { silent = true, expr = false }, - mode = { - "v", - "x", - }, - desc = "Extract Variable", - }, - { - "ri", - [[ lua require('refactoring').refactor('Inline Variable')]], - { silent = true, expr = false }, - mode = { - "n", - "v", - "x", - }, - desc = "Inline Variable", - }, - { - "rb", - function() require("refactoring").refactor("Extract Block") end, - { silent = true, expr = false }, - mode = { - "n", - }, - desc = "Extract Block", - }, - { - "rbf", - function() require("refactoring").refactor("Extract Block To File") end, - { silent = true, expr = false }, - mode = { - "n", - }, - desc = "Extract Block To File", - }, - { - "rr", - function() require("refactoring").select_refactor() end, - { silent = true, expr = false }, - desc = "Select Refactor", - }, - { - "rp", - function() require("refactoring").debug.printf({ below = false }) end, - mode = { "n" }, - desc = "Debug: Print Function", - }, - { - "rd", - function() require("refactoring").debug.print_var({ normal = true, below = false }) end, - mode = { "n" }, - desc = "Debug: Print Variable", - }, - { - "rd", - function() require("refactoring").debug.print_var({ below = false }) end, - mode = { "v" }, - desc = "Debug: Print Variable", - }, - { - "rc", - function() require("refactoring").debug.cleanup({}) end, - mode = { "n" }, - desc = "Debug: Clean Up", - }, - }, -} diff --git a/config/nvim/lua/plugins/telescope-nvim.lua b/config/nvim/lua/plugins/telescope-nvim.lua deleted file mode 100644 index 0a2d9d7..0000000 --- a/config/nvim/lua/plugins/telescope-nvim.lua +++ /dev/null @@ -1,155 +0,0 @@ --- Telescope, a see-all-through file manager. --- vim: ts=2 sw=2 si et --- luacheck: globals vim -return { - "nvim-telescope/telescope.nvim", - dependencies = { - { "nvim-lua/plenary.nvim" }, - { "nvim-lua/popup.nvim" }, - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. - { - "nvim-telescope/telescope-fzf-native.nvim", - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = "make", - cond = function() return vim.fn.executable("make") == 1 end, - }, - { "nvim-telescope/telescope-file-browser.nvim" }, - }, - config = function() - local actions = require("telescope.actions") - local sorters = require("telescope.sorters") - local previewers = require("telescope.previewers") - - require("telescope").setup({ - defaults = { - mappings = { - i = { - [""] = actions.close, - [""] = false, - [""] = false, - }, - }, - vimgrep_arguments = { - "rg", - "-L", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - - prompt_prefix = " ๏€‚ ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "horizontal", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.55, - results_width = 0.8, - }, - vertical = { - mirror = false, - }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - file_sorter = sorters.get_fuzzy_file, - file_ignore_patterns = { "node_modules", "dotbot" }, - generic_sorter = sorters.get_generic_fuzzy_sorter, - path_display = { "truncate" }, - winblend = 0, - border = {}, - borderchars = { "โ”€", "โ”‚", "โ”€", "โ”‚", "โ•ญ", "โ•ฎ", "โ•ฏ", "โ•ฐ" }, - color_devicons = true, - use_less = true, - set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, - file_previewer = previewers.vim_buffer_cat.new, - grep_previewer = previewers.vim_buffer_vimgrep.new, - qflist_previewer = previewers.vim_buffer_qflist.new, - -- Developer configurations: Not meant for general override - buffer_previewer_maker = previewers.buffer_previewer_maker, - }, - pickers = { - buffers = { - mappings = { - i = { - [""] = actions.delete_buffer + actions.move_to_top, - }, - }, - }, - }, - - extensions_list = { "themes", "terms" }, - }) - - pcall(require("telescope").load_extension, "fzf") - pcall(require("telescope").load_extension, "file_browser") - pcall(require("telescope").load_extension, "harpoon") - - -- See `:help telescope.builtin` - local tbi = require("telescope.builtin") - local wk = require("which-key") - wk.register({ - ["?"] = { - function() tbi.oldfiles() end, - "[?] Find recently opened files", - }, - [""] = { - function() tbi.buffers() end, - "[ ] Find existing buffers", - }, - ["/"] = { - function() - -- You can pass additional configuration to telescope to change theme, layout, etc. - tbi.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ - winblend = 10, - previewer = false, - })) - end, - "[/] Fuzzily search in current buffer", - }, - - t = { - b = { - "Telescope file_browser", - "[T]elescope: File [B]rowser", - }, - d = { - function() tbi.diagnostics() end, - "[T]elescope: Search [D]iagnostics", - }, - - f = { - function() tbi.find_files() end, - "[T]elescope: Search [F]iles", - }, - g = { - function() tbi.git_files() end, - "[T]elescope: Search [G]it files", - }, - h = { - function() tbi.help_tags() end, - "[T]elescope: Search [H]elp", - }, - r = { - function() tbi.live_grep() end, - "[T]elescope: Search by G[r]ep", - }, - w = { - function() tbi.grep_string() end, - "[T]elescope: Search current [W]ord", - }, - }, - }, { prefix = "" }) - end, -} diff --git a/config/nvim/lua/plugins/trouble.lua b/config/nvim/lua/plugins/trouble.lua deleted file mode 100644 index af5101b..0000000 --- a/config/nvim/lua/plugins/trouble.lua +++ /dev/null @@ -1,92 +0,0 @@ --- A pretty diagnostics, references, telescope results, --- quickfix and location list to help you solve all --- the trouble your code is causing. --- https://github.com/folke/trouble.nvim -return { - "folke/trouble.nvim", - dependencies = "nvim-tree/nvim-web-devicons", - opts = { - -- position of the list can be: bottom, top, left, right - position = "bottom", - -- height of the trouble list when position is top or bottom - height = 6, - -- width of the list when position is left or right - width = 50, - -- use devicons for filenames - icons = true, - -- "workspace_diagnostics", "document_diagnostics", - -- "quickfix", "lsp_references", "loclist" - mode = "workspace_diagnostics", - -- icon used for open folds - fold_open = "๏‘ผ", - -- icon used for closed folds - fold_closed = "๏‘ ", - -- group results by file - group = true, - -- add an extra new line on top of the list - padding = true, - -- key mappings for actions in the trouble list - action_keys = { - -- map to {} to remove a mapping, for example: - -- close = {}, - - -- close the list - close = "q", - -- cancel the preview and get back to your last window / buffer / cursor - cancel = "", - -- manually refresh - refresh = "r", - -- jump to the diagnostic or open / close folds - jump = { "", "" }, - -- open buffer in new split - open_split = { "" }, - -- open buffer in new vsplit - open_vsplit = { "" }, - -- open buffer in new tab - open_tab = { "" }, - -- jump to the diagnostic and close the list - jump_close = { "o" }, - -- toggle between "workspace" and "document" diagnostics mode - toggle_mode = "m", - -- toggle auto_preview - toggle_preview = "P", - -- opens a small popup with the full multiline message - hover = "K", - -- preview the diagnostic location - preview = "p", - -- close all folds - close_folds = { "zM", "zm" }, - -- open all folds - open_folds = { "zR", "zr" }, - -- toggle fold of current file - toggle_fold = { "zA", "za" }, - -- preview item - previous = "k", - -- next item - next = "j", - }, - -- add an indent guide below the fold icons - indent_lines = true, - -- automatically open the list when you have diagnostics - auto_open = false, - -- automatically close the list when you have no diagnostics - auto_close = true, - -- automatically preview the location of the diagnostic. - -- to close preview and go back to last window - auto_preview = true, - -- automatically fold a file trouble list at creation - auto_fold = false, - -- for the given modes, automatically jump if there is only a single result - auto_jump = { "lsp_definitions" }, - signs = { - -- icons / text used for a diagnostic - error = "๏™™", - warning = "๏”ฉ", - hint = "๏ ต", - information = "๏‘‰", - other = "๏ซ ", - }, - -- enabling this will use the signs defined in your lsp client - use_diagnostic_signs = false, - }, -} diff --git a/config/nvim/lua/plugins/twilight.lua b/config/nvim/lua/plugins/twilight.lua deleted file mode 100644 index 1d9577e..0000000 --- a/config/nvim/lua/plugins/twilight.lua +++ /dev/null @@ -1,33 +0,0 @@ --- Twilight dims inactive portions of the --- code you're editing using TreeSitter --- https://github.com/folke/twilight.nvim -return { - "folke/twilight.nvim", - opts = { - dimming = { - -- amount of dimming - alpha = 0.2, - -- when true, other windows will be fully dimmed (unless they contain the same buffer) - inactive = false, - }, - -- amount of lines we will try to show around the current line - context = 3, - -- use treesitter when available for the filetype - -- treesitter is used to automatically expand the visible text, - -- but you can further control the types of nodes that should always be fully expanded - - treesitter = true, - - -- for treesitter, we we always try to expand to the top-most ancestor with these types - expand = { - "function", - "while_statement", - "for_statement", - "switch_statement", - "method", - "table", - "if_statement", - }, - exclude = {}, -- exclude these filetypes - }, -} diff --git a/config/nvim/lua/plugins/ui.lua b/config/nvim/lua/plugins/ui.lua new file mode 100644 index 0000000..bbf4c09 --- /dev/null +++ b/config/nvim/lua/plugins/ui.lua @@ -0,0 +1,25 @@ +return { + -- The theme of choise, catppuccin + -- https://github.com/catppuccin/nvim + { + "catppuccin/nvim", + name = "catppuccin", + priority = 1000, + enabled = true, + config = function() + vim.cmd.colorscheme("catppuccin") + end, + opts = { + flavour = "mocha", + }, + }, + -- Getting you where you want with the fewest keystrokes. + -- https://github.com/ThePrimeagen/harpoon + { "ThePrimeagen/harpoon" }, + -- Close buffer without messing up with the window. + -- https://github.com/famiu/bufdelete.nvim + { "famiu/bufdelete.nvim" }, + -- Neovim plugin for locking a buffer to a window + -- https://github.com/stevearc/stickybuf.nvim + { "stevearc/stickybuf.nvim", opts = {} }, +} diff --git a/config/nvim/lua/plugins/wilder.lua b/config/nvim/lua/plugins/wilder.lua deleted file mode 100644 index 2b6023f..0000000 --- a/config/nvim/lua/plugins/wilder.lua +++ /dev/null @@ -1,32 +0,0 @@ --- A more adventurous wildmenu --- https://github.com/gelguy/wilder.nvim - -return { - 'gelguy/wilder.nvim', - config = function() - local wilder = require('wilder') - wilder.setup({ modes = { ':', '/', '?' } }) - - local gradient = { - '#f4468f', '#fd4a85', '#ff507a', '#ff566f', '#ff5e63', - '#ff6658', '#ff704e', '#ff7a45', '#ff843d', '#ff9036', - '#f89b31', '#efa72f', '#e6b32e', '#dcbe30', '#d2c934', - '#c8d43a', '#bfde43', '#b6e84e', '#aff05b' - } - - for i, fg in ipairs(gradient) do - gradient[i] = wilder.make_hl('WilderGradient' .. i, 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = fg } }) - end - - wilder.set_option('renderer', wilder.popupmenu_renderer({ - highlights = { - -- must be set - -- selected_gradient key can be set to apply gradient highlighting for the selected candidate. - gradient = gradient, - }, - highlighter = wilder.highlighter_with_gradient({ - wilder.basic_highlighter(), -- or wilder.lua_fzy_highlighter(), - }), - })) - end, -} diff --git a/config/nvim/stylua.toml b/config/nvim/stylua.toml new file mode 100644 index 0000000..5d6c50d --- /dev/null +++ b/config/nvim/stylua.toml @@ -0,0 +1,3 @@ +indent_type = "Spaces" +indent_width = 2 +column_width = 120 \ No newline at end of file