diff --git a/.gitignore b/.gitignore index a6c57f5..e033bc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -*.json +lazy-lock.json diff --git a/README.md b/README.md deleted file mode 100644 index d10ecc4..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# neovim - -neovim config \ No newline at end of file diff --git a/init.lua b/init.lua index ee1d79d..3b6dc97 100644 --- a/init.lua +++ b/init.lua @@ -1,2 +1,3 @@ -require("Dario48.options") -require("Dario48.lazy") +require("config.lazy") +require("config.general") +require("config.autocmd") diff --git a/lua/Dario48/lazy.lua b/lua/Dario48/lazy.lua deleted file mode 100644 index d356689..0000000 --- a/lua/Dario48/lazy.lua +++ /dev/null @@ -1,14 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) -require("lazy").setup({ import = "Dario48/plugins" }) -vim.keymap.set("n", "l", ":Lazy ") diff --git a/lua/Dario48/options.lua b/lua/Dario48/options.lua deleted file mode 100644 index da39c2b..0000000 --- a/lua/Dario48/options.lua +++ /dev/null @@ -1,23 +0,0 @@ -vim.cmd("nnoremap ") -vim.g.mapleader = ' ' - -vim.cmd("set tabstop=4") -vim.cmd("set softtabstop=0") -vim.cmd("set shiftwidth=0") - -vim.keymap.set("n", "+x", ":!chmod +x %", {silent = true}) -vim.keymap.set("n", "+r", ":!chmod +r %", {silent = true}) -vim.keymap.set("n", "+w", ":!chmod +w %", {silent = true}) - -vim.keymap.set("n", "-x", ":!chmod -x %", {silent = true}) -vim.keymap.set("n", "-r", ":!chmod -r %", {silent = true}) -vim.keymap.set("n", "-w", ":!chmod -w %", {silent = true}) - -vim.opt.nu = true - -vim.opt.termguicolors = true - -vim.opt.hlsearch = false -vim.opt.incsearch = true - -vim.opt.scrolloff = 6 diff --git a/lua/Dario48/plugins/VimBeGood.lua b/lua/Dario48/plugins/VimBeGood.lua deleted file mode 100644 index 8c82e88..0000000 --- a/lua/Dario48/plugins/VimBeGood.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - 'ThePrimeagen/vim-be-good', - config = function() - vim.keymap.set("n", "vbg", ":VimBeGood ") - end -} diff --git a/lua/Dario48/plugins/alpha.lua b/lua/Dario48/plugins/alpha.lua deleted file mode 100644 index 58d86de..0000000 --- a/lua/Dario48/plugins/alpha.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - 'goolord/alpha-nvim', - config = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") - - -- Set header - dashboard.section.header.val = { - [[ /\\\\\ /\\\ /\\\\\\\\\\\\\\\ /\\\\\ /\\\ /\\\ /\\\\\\\\\\\ /\\\\ /\\\\ ]], - [[ \/\\\\\\ \/\\\ \/\\\/////////// /\\\///\\\ \/\\\ \/\\\ \/////\\\/// \/\\\\\\ /\\\\\\ ]], - [[ \/\\\/\\\ \/\\\ \/\\\ /\\\/ \///\\\ \//\\\ /\\\ \/\\\ \/\\\//\\\ /\\\//\\\ ]], - [[ \/\\\//\\\ \/\\\ \/\\\\\\\\\\\ /\\\ \//\\\ \//\\\ /\\\ \/\\\ \/\\\\///\\\/\\\/ \/\\\ ]], - [[ \/\\\\//\\\\/\\\ \/\\\/////// \/\\\ \/\\\ \//\\\ /\\\ \/\\\ \/\\\ \///\\\/ \/\\\ ]], - [[ \/\\\ \//\\\/\\\ \/\\\ \//\\\ /\\\ \//\\\/\\\ \/\\\ \/\\\ \/// \/\\\ ]], - [[ \/\\\ \//\\\\\\ \/\\\ \///\\\ /\\\ \//\\\\\ \/\\\ \/\\\ \/\\\ ]], - [[ \/\\\ \//\\\\\ \/\\\\\\\\\\\\\\\ \///\\\\\/ \//\\\ /\\\\\\\\\\\ \/\\\ \/\\\ ]], - [[ \/// \///// \/////////////// \///// \/// \/////////// \/// \/// ]], - } - - -- Set menu - dashboard.section.buttons.val= { - type = "group", - val = { - { type = "text", val = "Quick links", opts = { hl = "SpecialComment", position = "center" } }, - { type = "padding", val = 1 }, - dashboard.button("e", " New file", "ene"), - dashboard.button("u", " Update plugins", "Lazy sync"), - dashboard.button("q", "󰩈 Quit", "qa"), - }, - position = "center", - } - -- Send config to alpha - alpha.setup(dashboard.opts) - - -- Disable folding on alpha buffer - vim.cmd([[ - autocmd FileType alpha setlocal nofoldenable - ]]) - end -}; diff --git a/lua/Dario48/plugins/bufferline.lua b/lua/Dario48/plugins/bufferline.lua deleted file mode 100644 index a30842e..0000000 --- a/lua/Dario48/plugins/bufferline.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - 'akinsho/bufferline.nvim', - version = "*", - dependencies = 'nvim-tree/nvim-web-devicons', - config = function() - require("bufferline").setup() - vim.keymap.set("n", "bb", ":bNext ") - vim.keymap.set("n", "bk", ":bdelete ") - vim.keymap.set("n", "bl", ":blast ") - end -} diff --git a/lua/Dario48/plugins/dashboard.back b/lua/Dario48/plugins/dashboard.back deleted file mode 100644 index 8936064..0000000 --- a/lua/Dario48/plugins/dashboard.back +++ /dev/null @@ -1,9 +0,0 @@ - [[__/\\\\\_____/\\\__/\\\\\\\\\\\\\\\_______/\\\\\_______/\\\________/\\\__/\\\\\\\\\\\__/\\\\____________/\\\\_________]], - [[__\/\\\\\\___\/\\\_\/\\\///////////______/\\\///\\\____\/\\\_______\/\\\_\/////\\\///__\/\\\\\\________/\\\\\\________]], - [[___\/\\\/\\\__\/\\\_\/\\\_______________/\\\/__\///\\\__\//\\\______/\\\______\/\\\_____\/\\\//\\\____/\\\//\\\_______]], - [[____\/\\\//\\\_\/\\\_\/\\\\\\\\\\\______/\\\______\//\\\__\//\\\____/\\\_______\/\\\_____\/\\\\///\\\/\\\/_\/\\\______]], - [[_____\/\\\\//\\\\/\\\_\/\\\///////______\/\\\_______\/\\\___\//\\\__/\\\________\/\\\_____\/\\\__\///\\\/___\/\\\_____]], - [[______\/\\\_\//\\\/\\\_\/\\\_____________\//\\\______/\\\_____\//\\\/\\\_________\/\\\_____\/\\\____\///_____\/\\\____]], - [[_______\/\\\__\//\\\\\\_\/\\\______________\///\\\__/\\\________\//\\\\\__________\/\\\_____\/\\\_____________\/\\\___]], - [[________\/\\\___\//\\\\\_\/\\\\\\\\\\\\\\\____\///\\\\\/__________\//\\\________/\\\\\\\\\\\_\/\\\_____________\/\\\__]], - [[_________\///_____\/////__\///////////////_______\/////_____________\///________\///////////__\///______________\///__]], diff --git a/lua/Dario48/plugins/feline.lua b/lua/Dario48/plugins/feline.lua deleted file mode 100644 index a774ff8..0000000 --- a/lua/Dario48/plugins/feline.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - 'freddiehaddad/feline.nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', - 'lewis6991/gitsigns.nvim', - }, - config = function() - require('feline').setup() - end -} diff --git a/lua/Dario48/plugins/lsp-zero.lua b/lua/Dario48/plugins/lsp-zero.lua deleted file mode 100644 index 062d8bd..0000000 --- a/lua/Dario48/plugins/lsp-zero.lua +++ /dev/null @@ -1,91 +0,0 @@ -return { - { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v3.x', - lazy = true, - config = false, - init = function() - -- Disable automatic setup, we are doing it manually - vim.g.lsp_zero_extend_cmp = 0 - vim.g.lsp_zero_extend_lspconfig = 0 - end, - }, - { - 'williamboman/mason.nvim', - lazy = false, - config = function () - require("mason").setup() - vim.keymap.set("n", "m", ":Mason ") - end - }, - - -- Autocompletion - { - 'hrsh7th/nvim-cmp', - event = 'InsertEnter', - dependencies = { - {'L3MON4D3/LuaSnip'}, - }, - config = function() - -- Here is where you configure the autocompletion settings. - 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_action = lsp_zero.cmp_action() - - cmp.setup({ - sources = { - {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(), - }) - }) - end - }, - - -- LSP - { - 'neovim/nvim-lspconfig', - cmd = {'LspInfo', 'LspInstall', 'LspStart'}, - event = {'BufReadPre', 'BufNewFile'}, - dependencies = { - {'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') - 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}) - end) - - 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) - end, - } - }) - end - } -} diff --git a/lua/Dario48/plugins/nightfox.lua b/lua/Dario48/plugins/nightfox.lua deleted file mode 100644 index ca2606e..0000000 --- a/lua/Dario48/plugins/nightfox.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "EdenEast/nightfox.nvim", - priority = 1000, - config = function() - vim.opt.termguicolors = true - vim.cmd("colorscheme carbonfox") - end -} diff --git a/lua/Dario48/plugins/nvim-tree.lua b/lua/Dario48/plugins/nvim-tree.lua deleted file mode 100644 index 4d8a5fe..0000000 --- a/lua/Dario48/plugins/nvim-tree.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - "nvim-tree/nvim-tree.lua", - dependencies = {'nvim-tree/nvim-web-devicons'}, - config = function() - -- disable netrw at the very start of your init.lua - vim.g.loaded_netrw = 1 - vim.g.loaded_netrwPlugin = 1 - - -- set termguicolors to enable highlight groups - vim.opt.termguicolors = true - - -- empty setup using defaults - require("nvim-tree").setup() - local focus = function() - vim.cmd("NvimTreeClose") - vim.cmd("NvimTreeOpen") - end - vim.cmd([[command! NvimTreeFocus lua require("nvim-tree").focus() ]]) - vim.keymap.set("n", "ee", ":NvimTreeToggle ") - vim.keymap.set("n", "ef", ":NvimTreeFocus ") - end -} diff --git a/lua/Dario48/plugins/telescope.lua b/lua/Dario48/plugins/telescope.lua deleted file mode 100644 index 01528b9..0000000 --- a/lua/Dario48/plugins/telescope.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - 'nvim-telescope/telescope.nvim', - dependencies = { 'nvim-lua/plenary.nvim', "sharkdp/fd", "nvim-tree/nvim-web-devicons" }, - config = function() - local builtin = require('telescope.builtin') - vim.keymap.set('n', 'ff', builtin.find_files, {}) - vim.keymap.set('n', 'fg', builtin.git_files, {}) - vim.keymap.set('n', 'fs', function() - builtin.grep_string({search = vim.fn.input("What to grep? ")}) - end) - end -} diff --git a/lua/Dario48/plugins/treesitter.lua b/lua/Dario48/plugins/treesitter.lua deleted file mode 100644 index 4a0876d..0000000 --- a/lua/Dario48/plugins/treesitter.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - build = function() - require("nvim-treesitter.install").update({ with_sync = true })() - end, - config = function () - local configs = require("nvim-treesitter.configs") - - configs.setup({ - ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, - sync_install = false, - auto_install = true, - highlight = { enable = true, additional_vim_regex_highlighting = false }, - indent = { enable = true }, - }) - end -} diff --git a/lua/Dario48/plugins/whichkey.lua b/lua/Dario48/plugins/whichkey.lua deleted file mode 100644 index 9f06fd5..0000000 --- a/lua/Dario48/plugins/whichkey.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 - end, - opts = {} -} diff --git a/lua/config/autocmd.lua b/lua/config/autocmd.lua new file mode 100644 index 0000000..e69de29 diff --git a/lua/config/general.lua b/lua/config/general.lua new file mode 100644 index 0000000..c0a412b --- /dev/null +++ b/lua/config/general.lua @@ -0,0 +1,27 @@ +vim.opt.tabstop = 4 +vim.opt.softtabstop = 0 +vim.opt.shiftwidth = 0 +vim.opt.shell = "/bin/bash" +vim.cmd("set wrap smoothscroll") + +vim.opt.rnu = true +vim.opt.nu = true + +vim.cmd([[set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:<,space:•]]) +vim.keymap.set("n", "hc", ":set list!", { silent = true }) + +vim.keymap.set("n", ".", ":", {}) + +vim.keymap.set("i", "jk", "", {}) + +vim.opt.termguicolors = true + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.scrolloff = 6 + +vim.cmd("nnoremap j gj") +vim.cmd("nnoremap k gk") + +vim.g.zig_fmt_parse_errors = 0 diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua new file mode 100644 index 0000000..0e20fb6 --- /dev/null +++ b/lua/config/lazy.lua @@ -0,0 +1,28 @@ +-- Bootstrap lazy.nvim +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = "https://github.com/folke/lazy.nvim.git" + local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) + if vim.v.shell_error ~= 0 then + vim.api.nvim_echo({ + { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, + { out, "WarningMsg" }, + { "\nPress any key to exit..." }, + }, true, {}) + vim.fn.getchar() + os.exit(1) + end +end +vim.opt.rtp:prepend(lazypath) + +-- Make sure to setup `mapleader` and `maplocalleader` before +-- loading lazy.nvim so that mappings are correct. +-- This is also a good place to setup other settings (vim.opt) +vim.cmd("nnoremap ") +vim.g.mapleader = " " +vim.g.maplocalleader = "," + +vim.keymap.set("n", "l", function() require"lazy".home() end, { silent = true, desc = "open lazy.nvim"}) + +-- Setup lazy.nvim +require("lazy").setup("plugins") diff --git a/lua/plugins/conformer.lua b/lua/plugins/conformer.lua new file mode 100644 index 0000000..b2acafc --- /dev/null +++ b/lua/plugins/conformer.lua @@ -0,0 +1,50 @@ +return { + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + init = function() + require "conform".setup( + { + format_on_save = function(bufnr) + require("conform").formatters_by_ft = require "mason-bridge".get_formatters() + return { timeout_ms = 200, lsp_fallback = true }, on_format + end, + formatters_by_ft = require("mason-bridge").get_formatters(), --[[ = { + lua = { "stylua" }, + javascript = { "prettier" }, + html = { "prettier" }, + css = { "prettier" }, + c = { "clang-format" }, + cpp = { "clang-format" }, + arduino = { "clang-format" }, + sh = { "shfmt" }, + bash = { "shfmt" }, + mksh = { "shfmt" }, + json = { "jq" }, + }, ]] -- + + -- This will provide type hinting with LuaLS + ---@module "conform" + ---@type conform.setupOpts + formatters = { + prettier = { + prepend_args = { "--use-tabs", "true" }, + }, + jq = { + prepend_args = { "--tab" }, + }, + ["clang-format"] = { + prepend_args = function(self, ctx) + return { "-style=file:/home/Dario48/.config/.clang-format" } + end, + }, + default_format_opts = { + lsp_format = "fallback", + }, + }, + }) + -- If you want the formatexpr, here is the place to set it + vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" + vim.g.arduino_recommended_style = 0 + end, +} diff --git a/lua/plugins/darioline.lua b/lua/plugins/darioline.lua new file mode 100644 index 0000000..0f32fc7 --- /dev/null +++ b/lua/plugins/darioline.lua @@ -0,0 +1,4 @@ +return { + url = "https://codeberg.org/Dario48/darioline.git", + config = true +} diff --git a/lua/plugins/image.lua b/lua/plugins/image.lua new file mode 100644 index 0000000..37c5a39 --- /dev/null +++ b/lua/plugins/image.lua @@ -0,0 +1,4 @@ +return { + "3rd/image.nvim", + opts = {}, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..0129cb7 --- /dev/null +++ b/lua/plugins/lspconfig.lua @@ -0,0 +1,59 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { + { "hrsh7th/cmp-nvim-lsp" }, + { "hrsh7th/nvim-cmp" }, + }, + config = function() + -- Reserve a space in the gutter + -- This will avoid an annoying layout shift in the screen + vim.opt.signcolumn = "yes" + + -- Add cmp_nvim_lsp capabilities settings to lspconfig + -- This should be executed before you configure any language server + local lspconfig_defaults = require("lspconfig").util.default_config + lspconfig_defaults.capabilities = vim.tbl_deep_extend( + "force", + lspconfig_defaults.capabilities, + require("cmp_nvim_lsp").default_capabilities() + ) + + vim.api.nvim_create_autocmd("LspAttach", { + desc = "LSP actions", + callback = function(event) + local opts = { buffer = event.buf } + + vim.keymap.set("n", "K", function() + vim.lsp.buf.hover() + end, opts) + vim.keymap.set("n", "gd", function() + vim.lsp.buf.definition() + end, opts) + vim.keymap.set("n", "gD", function() + vim.lsp.buf.declaration() + end, opts) + vim.keymap.set("n", "gi", function() + vim.lsp.buf.implementation() + end, opts) + vim.keymap.set("n", "go", function() + vim.lsp.buf.type_definition() + end, opts) + vim.keymap.set("n", "gr", function() + vim.lsp.buf.references() + end, opts) + vim.keymap.set("n", "gs", function() + vim.lsp.buf.signature_help() + end, opts) + vim.keymap.set("n", "", function() + vim.lsp.buf.rename() + end, opts) + vim.keymap.set({ "n", "x" }, "", function() + vim.lsp.buf.format({ async = true }) + end, opts) + vim.keymap.set("n", "f", function() + vim.lsp.buf.code_action() + end, opts) + end, + }) + end, +} diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua new file mode 100644 index 0000000..1a6ba51 --- /dev/null +++ b/lua/plugins/mason.lua @@ -0,0 +1,63 @@ +return { + { + "williamboman/mason.nvim", + + dependencies = { "williamboman/mason-lspconfig.nvim" }, + + keys = { + { "m", ":Mason ", desc = "open mason" }, + }, + config = true, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = { + -- Replace the language servers listed here + -- with the ones you want to install + ensure_installed = { "lua_ls", "clangd", "hyprls", "lua_ls" }, + handlers = { + function(server_name) + require("lspconfig")[server_name].setup({ + }) + end, + + ["lua_ls"] = function() + require 'lspconfig'.lua_ls.setup { + on_init = function(client) + local path = client.workspace_folders[1].name + if vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc') then + return + end + + client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT' + }, + -- Make the server aware of Neovim runtime files + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME + -- Depending on the usage, you might want to add additional paths here. + -- "${3rd}/luv/library" + -- "${3rd}/busted/library", + } + -- or pull in all of 'runtimepath'. NOTE: this is a lot slower + -- library = vim.api.nvim_get_runtime_file("", true) + } + }) + end, + settings = { + Lua = {} + } + } + end + }, + }, + }, + { + "frostplexx/mason-bridge.nvim", + }, +} diff --git a/lua/plugins/neorg.lua b/lua/plugins/neorg.lua new file mode 100644 index 0000000..ed48bf5 --- /dev/null +++ b/lua/plugins/neorg.lua @@ -0,0 +1,37 @@ +return { + "nvim-neorg/neorg", + lazy = true, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default + dependencies = { + { + "juniorsundar/neorg-extras", + -- tag = "v0.3.1" -- Always a safe bet to track current latest release + }, + "nvim-telescope/telescope.nvim", -- Required for the Neorg-Roam features + "nvim-lua/plenary.nvim", -- Required as part of Telescope installation + }, + opts = { + load = { + ["external.many-mans"] = { + config = { + metadata_fold = true, -- If want @data property ... @end to fold + code_fold = true, -- If want @code ... @end to fold + } + }, + ["core.defaults"] = {}, + ["core.concealer"] = { config = { folds = false } }, + ["core.dirman"] = { + config = { + workspaces = { + school = "~/Documents/school", + notes = "~/Documents/notes", + }, + default_workspace = "notes", + }, + }, + ["core.completion"] = { config = { engine = "nvim-cmp" } }, + }, + }, + ft = "norg", + cmd = "Neorg", + config = true, +} diff --git a/lua/plugins/nightfox.lua b/lua/plugins/nightfox.lua new file mode 100644 index 0000000..79abc6d --- /dev/null +++ b/lua/plugins/nightfox.lua @@ -0,0 +1,6 @@ +return { + "EdenEast/nightfox.nvim", + init = function() + vim.cmd("colorscheme carbonfox") + end +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..ba47702 --- /dev/null +++ b/lua/plugins/nvim-cmp.lua @@ -0,0 +1,59 @@ +return { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-nvim-lua", + "neovim/nvim-lspconfig", + "mtoohey31/cmp-fish", + "petertriho/cmp-git", + }, + config = function() + local cmp = require("cmp") + + cmp.setup({ + sources = { + { name = "nvim_lua" }, + { + name = "nvim_lsp", + entry_filter = function(entry, ctx) + local kind = require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] + + if kind == "Text" then + return false + end + return true + end, + }, + { name = "neorg" }, + { name = "fish" }, + }, + snippet = { + expand = function(args) + -- You need Neovim v0.10 to use vim.snippet + vim.snippet.expand(args.body) + end, + }, + cmp.setup.filetype("gitcommit", { + sources = cmp.config.sources({ + { name = "git" }, + }, { + { name = "buffer" }, + }), + }), + require("cmp_git").setup(), + + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(-4), + [" "] = cmp.mapping.confirm(), + }), + }) + end, +} diff --git a/lua/plugins/nvim-lint.lua b/lua/plugins/nvim-lint.lua new file mode 100644 index 0000000..b84db48 --- /dev/null +++ b/lua/plugins/nvim-lint.lua @@ -0,0 +1,19 @@ +return { + "mfussenegger/nvim-lint", + init = function() + vim.api.nvim_create_autocmd({ "BufWritePost" }, { + callback = function() + require "lint".try_lint() + end, + }) + + vim.diagnostic.config({ + signs = true, + underline = true, + update_in_insert = false, + virtual_text = true, + }) + + require("lint").linters_by_ft = require("mason-bridge").get_linters() + end +} diff --git a/lua/plugins/rainbow_parentheses.lua b/lua/plugins/rainbow_parentheses.lua new file mode 100644 index 0000000..60505ff --- /dev/null +++ b/lua/plugins/rainbow_parentheses.lua @@ -0,0 +1,33 @@ +return { + "HiPhish/rainbow-delimiters.nvim", + lazy = false, + init = function() + -- This module contains a number of default definitions + local rainbow_delimiters = require("rainbow-delimiters") + + ---@type rainbow_delimiters.config + vim.g.rainbow_delimiters = { + strategy = { + [""] = rainbow_delimiters.strategy["global"], + vim = rainbow_delimiters.strategy["local"], + }, + query = { + [""] = "rainbow-delimiters", + lua = "rainbow-blocks", + }, + priority = { + [""] = 110, + lua = 210, + }, + highlight = { + "RainbowDelimiterViolet", + "RainbowDelimiterBlue", + "RainbowDelimiterOrange", + "RainbowDelimiterYellow", + "RainbowDelimiterRed", + "RainbowDelimiterGreen", + "RainbowDelimiterCyan", + }, + } + end, +} diff --git a/lua/plugins/suda.lua b/lua/plugins/suda.lua new file mode 100644 index 0000000..f255b6f --- /dev/null +++ b/lua/plugins/suda.lua @@ -0,0 +1,3 @@ +return { + "lambdalisue/vim-suda", +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..54f4ec6 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,39 @@ +return { + "nvim-treesitter/nvim-treesitter", + opts = { + -- A list of parser names, or "all" (the listed parsers MUST always be installed) + ensure_installed = { "c", "lua", "norg"}, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = true, + + -- 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") + + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + + highlight = { + enable = true, + + -- NOTE: these are the names of the parsers and not the filetype. (for example if you want to + -- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is + -- the name of the parser) + -- list of language that will be disabled + -- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true, + disable = {"norg"} + }, + }, + config = true, +} diff --git a/lua/plugins/vim-jukit.lua b/lua/plugins/vim-jukit.lua new file mode 100644 index 0000000..7699d60 --- /dev/null +++ b/lua/plugins/vim-jukit.lua @@ -0,0 +1,5 @@ +return { + "luk400/vim-jukit", + lazu = true, + ft = "ipynb", +} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..42dc55f --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,4 @@ +return { + "folke/which-key.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, +}