From f284d334b4840f6a75a09b5bcf43402b33f615a8 Mon Sep 17 00:00:00 2001 From: Dario48true Date: Mon, 15 Jul 2024 19:54:18 +0200 Subject: [PATCH] ai, note taking and formatter --- lazy-lock.json | 8 +-- lua/Dario48/options.lua | 1 + lua/Dario48/plugins/codeium.lua | 12 +++++ lua/Dario48/plugins/conformer.lua | 28 ++++++++++ lua/Dario48/plugins/dashboard.back | 9 ---- lua/Dario48/plugins/lsp-zero.lua | 83 +++++++++++++++++------------- lua/Dario48/plugins/neorg.lua | 7 +-- 7 files changed, 96 insertions(+), 52 deletions(-) create mode 100644 lua/Dario48/plugins/codeium.lua create mode 100644 lua/Dario48/plugins/conformer.lua delete mode 100644 lua/Dario48/plugins/dashboard.back diff --git a/lazy-lock.json b/lazy-lock.json index b3b0c71..7f95523 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -3,21 +3,22 @@ "alpha-nvim": { "branch": "main", "commit": "41283fb402713fc8b327e60907f74e46166f4cfd" }, "bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "codeium.vim": { "branch": "main", "commit": "7a01ffb1e6538fe634f294908a50a7b680039284" }, + "conform.nvim": { "branch": "master", "commit": "cd75be867f2331b22905f47d28c0c270a69466aa" }, "csvlens.nvim": { "branch": "main", "commit": "987375e2cf6399850f7f801b53b89c981ed652fa" }, "fd": { "branch": "master", "commit": "f8270a6a447648a087c968552aa80325277a5588" }, "feline.nvim": { "branch": "main", "commit": "8bc28b94a16304aad2f53b8c3653b14803748c28" }, "gitsigns.nvim": { "branch": "main", "commit": "47c8e3e571376b24de62408fd0c9d12f0a9fc0a3" }, - "lazy.nvim": { "branch": "main", "commit": "cea5920abb202753004440f94ec39bcf2927e02e" }, + "lazy.nvim": { "branch": "main", "commit": "c501b429cf995c645454539b924aaefae45bb9eb" }, "lazydev.nvim": { "branch": "main", "commit": "6184ebbbc8045d70077659b7d30c705a588dc62f" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "16de3b18c5f7b6230d89b8e64ce9a4801b6f8d08" }, - "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, + "mason-conform.nvim": { "branch": "main", "commit": "abce2be529f3b4b336c56d0ba6336a9144e0fee6" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, "neorg": { "branch": "main", "commit": "99b32492b836b64a5ff4544d4c466496f0aec9bd" }, "nightfox.nvim": { "branch": "main", "commit": "df75a6a94910ae47854341d6b5a6fd483192c0eb" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" }, @@ -27,7 +28,6 @@ "nvim-tree.lua": { "branch": "master", "commit": "2086e564c4d23fea714e8a6d63b881e551af2f41" }, "nvim-treesitter": { "branch": "master", "commit": "c29989f5d735a30b6d2350b54d5cd50be811f8b2" }, "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, - "pathlib.nvim": { "branch": "main", "commit": "7a5a6facd29e306bc73a37719fa67c0d2226f852" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "telescope.nvim": { "branch": "master", "commit": "c392f1b78eaaf870ca584bd698e78076ed301b26" }, diff --git a/lua/Dario48/options.lua b/lua/Dario48/options.lua index 93807de..4af7f16 100644 --- a/lua/Dario48/options.lua +++ b/lua/Dario48/options.lua @@ -1,5 +1,6 @@ vim.cmd("nnoremap ") vim.g.mapleader = ' ' +vim.g.maplocalleader = ',' vim.cmd("set tabstop=4") vim.cmd("set softtabstop=0") diff --git a/lua/Dario48/plugins/codeium.lua b/lua/Dario48/plugins/codeium.lua new file mode 100644 index 0000000..4e11f44 --- /dev/null +++ b/lua/Dario48/plugins/codeium.lua @@ -0,0 +1,12 @@ +return { + 'Exafunction/codeium.vim', + event = 'BufEnter', + config = function () + end, + keys = { + { '', function () return vim.fn['codeium#Accept']() end, { expr = true, silent = true }}, + { '', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true, silent = true }}, + { '', function() return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true, silent = true }}, + { '', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true }} + } +} diff --git a/lua/Dario48/plugins/conformer.lua b/lua/Dario48/plugins/conformer.lua new file mode 100644 index 0000000..9977fd8 --- /dev/null +++ b/lua/Dario48/plugins/conformer.lua @@ -0,0 +1,28 @@ +return { + { + "stevearc/conform.nvim", + event = { "BufReadPre", "BufNewFile" }, + cmd = "Conform", + config = true, + opts = { + formatters_by_ft = { + lua = { "stylua" }, + cpp = { "clang-format" }, + fish = { "fish_indent" }, + css = { "prettier" }, + scss = { "prettier" }, + js = { "prettier" }, + }, + format_on_save = { + -- These options will be passed to conform.format() + timeout_ms = 500, + lsp_format = "fallback", + }, + }, + }, + { + "zapling/mason-conform.nvim", + dependencies = { "mason.nvim", "conform.nvim" }, + config = true, + }, +} diff --git a/lua/Dario48/plugins/dashboard.back b/lua/Dario48/plugins/dashboard.back deleted file mode 100644 index bceae75..0000000 --- a/lua/Dario48/plugins/dashboard.back +++ /dev/null @@ -1,9 +0,0 @@ - /\\\\\ /\\\ /\\\\\\\\\\\\\\\ /\\\\\ /\\\ /\\\ /\\\\\\\\\\\ /\\\\ /\\\\ - \/\\\\\\ \/\\\ \/\\\/////////// /\\\///\\\ \/\\\ \/\\\ \/////\\\/// \/\\\\\\ /\\\\\\ - \/\\\/\\\ \/\\\ \/\\\ /\\\/ \///\\\ \//\\\ /\\\ \/\\\ \/\\\//\\\ /\\\//\\\ - \/\\\//\\\ \/\\\ \/\\\\\\\\\\\ /\\\ \//\\\ \//\\\ /\\\ \/\\\ \/\\\\///\\\/\\\/ \/\\\ - \/\\\\//\\\\/\\\ \/\\\/////// \/\\\ \/\\\ \//\\\ /\\\ \/\\\ \/\\\ \///\\\/ \/\\\ - \/\\\ \//\\\/\\\ \/\\\ \//\\\ /\\\ \//\\\/\\\ \/\\\ \/\\\ \/// \/\\\ - \/\\\ \//\\\\\\ \/\\\ \///\\\ /\\\ \//\\\\\ \/\\\ \/\\\ \/\\\ - \/\\\ \//\\\\\ \/\\\\\\\\\\\\\\\ \///\\\\\/ \//\\\ /\\\\\\\\\\\ \/\\\ \/\\\ - \/// \///// \/////////////// \///// \/// \/////////// \/// \/// diff --git a/lua/Dario48/plugins/lsp-zero.lua b/lua/Dario48/plugins/lsp-zero.lua index 5e586b7..3a29e72 100644 --- a/lua/Dario48/plugins/lsp-zero.lua +++ b/lua/Dario48/plugins/lsp-zero.lua @@ -1,7 +1,7 @@ return { { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v3.x', + "VonHeikemen/lsp-zero.nvim", + branch = "v3.x", lazy = true, config = false, init = function() @@ -11,85 +11,96 @@ return { end, }, { - 'williamboman/mason.nvim', + "williamboman/mason.nvim", lazy = false, - config = function () + config = function() require("mason").setup() end, keys = { - {"m", ":Mason ", desc = "open mason"} - } + { "m", ":Mason ", desc = "open mason" }, + }, }, -- Autocompletion { - 'hrsh7th/nvim-cmp', - event = 'InsertEnter', + "hrsh7th/nvim-cmp", + event = "InsertEnter", dependencies = { - {'L3MON4D3/LuaSnip'}, + { "L3MON4D3/LuaSnip" }, }, config = function() -- Here is where you configure the autocompletion settings. - local lsp_zero = require('lsp-zero') + local lsp_zero = require("lsp-zero") lsp_zero.extend_cmp() -- And you can configure cmp even more, if you want to. - local cmp = require('cmp') + local cmp = require("cmp") local cmp_action = lsp_zero.cmp_action() cmp.setup({ sources = { - {name = 'nvim_lsp'}, - {name = 'nvim_lua'}, + { name = "nvim_lsp" }, + { name = "nvim_lua" }, }, formatting = lsp_zero.cmp_format(), mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.complete(), - [' '] = cmp.mapping.confirm({select = true}), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp_action.luasnip_jump_forward(), - [''] = cmp_action.luasnip_jump_backward(), - }) + [""] = cmp.mapping.complete(), + [" "] = cmp.mapping.confirm({ select = false }), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp_action.luasnip_jump_forward(), + [""] = cmp_action.luasnip_jump_backward(), + }), }) - end + end, }, -- LSP { - 'neovim/nvim-lspconfig', - cmd = {'LspInfo', 'LspInstall', 'LspStart'}, - event = {'BufReadPre', 'BufNewFile'}, + "neovim/nvim-lspconfig", + cmd = { "LspInfo", "LspInstall", "LspStart" }, + event = { "BufReadPre", "BufNewFile" }, dependencies = { - {'hrsh7th/cmp-nvim-lsp'}, - {'williamboman/mason-lspconfig.nvim'}, + { "hrsh7th/cmp-nvim-lsp" }, + { "williamboman/mason-lspconfig.nvim" }, }, config = function() -- This is where all the LSP shenanigans will live - local lsp_zero = require('lsp-zero') + local lsp_zero = require("lsp-zero") lsp_zero.extend_lspconfig() lsp_zero.on_attach(function(client, bufnr) -- see :help lsp-zero-keybindings -- to learn the available actions - vim.keymap.set("n", "gd", function () vim.lsp.buf.definition() end, {buffer = bufnr, remap = false}) - vim.keymap.set("n", "ca", function () vim.lsp.buf.code_action() end, {buffer = bufnr, remap = false}) - lsp_zero.default_keymaps({buffer = bufnr}) + vim.keymap.set("n", "gd", function() + vim.lsp.buf.definition() + end, { buffer = bufnr, remap = false }) + vim.keymap.set("n", "ca", function() + vim.lsp.buf.code_action() + end, { buffer = bufnr, remap = false }) + lsp_zero.default_keymaps({ buffer = bufnr }) end) - require('mason-lspconfig').setup({ + require("mason-lspconfig").setup({ ensure_installed = {}, handlers = { lsp_zero.default_setup, lua_ls = function() -- (Optional) Configure lua language server for neovim local lua_opts = lsp_zero.nvim_lua_ls() - require('lspconfig').lua_ls.setup(lua_opts) - require'lspconfig'.ltex.setup{} + require("lspconfig").lua_ls.setup(lua_opts) + require("lspconfig").ltex.setup({}) end, - } + }, }) end, - keys = {{"qf", function() vim.lsp.buf.code_action() end, silent=true, desc="quickfix"}} - } + keys = { { + "qf", + function() + vim.lsp.buf.code_action() + end, + silent = true, + desc = "quickfix", + } }, + }, } diff --git a/lua/Dario48/plugins/neorg.lua b/lua/Dario48/plugins/neorg.lua index 9443a98..62e662c 100644 --- a/lua/Dario48/plugins/neorg.lua +++ b/lua/Dario48/plugins/neorg.lua @@ -1,8 +1,7 @@ return { "nvim-neorg/neorg", dependencies = { "luarocks.nvim" }, - lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default - config = true, + lazy = true, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default opts = { load = { ["core.defaults"] = {}, @@ -17,5 +16,7 @@ return { }, } } - } + }, + ft = "norg", + cmd = "Neorg" }