diff --git a/.gitignore b/.gitignore index c84aa4a..89c26fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ plugin/packer_compiled.lua +lazy-lock.json + diff --git a/after/plugin/harpoon.lua b/after/plugin/harpoon.lua index a4a99a6..860079b 100644 --- a/after/plugin/harpoon.lua +++ b/after/plugin/harpoon.lua @@ -1,11 +1,13 @@ --- fast switching between files -local mark = require("harpoon.mark") -local ui = require("harpoon.ui") +local harpoon = require("harpoon") -vim.keymap.set("n", "a", mark.add_file) -vim.keymap.set("n", "h", ui.toggle_quick_menu) +-- REQUIRED +harpoon:setup() +-- REQUIRED -vim.keymap.set("n", "", function() ui.nav_file(1) end) -vim.keymap.set("n", "", function() ui.nav_file(2) end) -vim.keymap.set("n", "", function() ui.nav_file(3) end) -vim.keymap.set("n", "", function() ui.nav_file(4) end) +vim.keymap.set("n", "a", function() harpoon:list():append() end) +vim.keymap.set("n", "h", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + +vim.keymap.set("n", "", function() harpoon:list():select(1) end) +vim.keymap.set("n", "", function() harpoon:list():select(2) end) +vim.keymap.set("n", "", function() harpoon:list():select(3) end) +vim.keymap.set("n", "", function() harpoon:list():select(4) end) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index c40cc3b..47f7fb7 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -1,11 +1,15 @@ --- language server manager (via Mason) -local lsp = require('lsp-zero').preset({}) +local lsp_zero = require('lsp-zero') -lsp.on_attach(function(client, bufnr) - lsp.default_keymaps({buffer = bufnr}) +lsp_zero.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp_zero.default_keymaps({buffer = bufnr}) end) --- (Optional) Configure lua language server for neovim -require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) - -lsp.setup() +require('mason').setup({}) +require('mason-lspconfig').setup({ + ensure_installed = {}, + handlers = { + lsp_zero.default_setup, + }, +}) diff --git a/init.lua b/init.lua index 55e5539..c7a896a 100644 --- a/init.lua +++ b/init.lua @@ -1 +1,16 @@ require("sevi-kun") + +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("sevi-kun.plugins") diff --git a/lua/sevi-kun/packer.lua b/lua/sevi-kun/packer.lua deleted file mode 100644 index 25c2744..0000000 --- a/lua/sevi-kun/packer.lua +++ /dev/null @@ -1,141 +0,0 @@ --- This file can be loaded by calling `lua require('plugins')` from your init.vim - --- Only required if you have packer configured as `opt` -vim.cmd [[packadd packer.nvim]] - -return require('packer').startup(function(use) - -- Packer can manage itself - use 'wbthomason/packer.nvim' - - - -- treesitter - use ('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'}) - use ('nvim-treesitter/playground') - use ('nvim-treesitter/nvim-treesitter-context') - - - -- useful - use { 'rmagatti/auto-session' } - - use { - 'rmagatti/session-lens', - requires = {'rmagatti/auto-session', 'nvim-telescope/telescope.nvim'}, - } - - use { - 'nvim-telescope/telescope.nvim', branch = '0.1.x', - requires = 'nvim-lua/plenary.nvim' - } - - use { - 'ThePrimeagen/harpoon', - requires = 'nvim-lua/plenary.nvim' - } - - use { - 'NeogitOrg/neogit', - requires = 'nvim-lua/plenary.nvim' - } - - use { 'stevearc/oil.nvim' } - - use { - "nvim-neorg/neorg", - tag = "*", - run = ":Neorg sync-parsers", - requires = "nvim-lua/plenary.nvim", - config = function () - require('neorg').setup { - load = { - ["core.defaults"] = {}, - ["core.concealer"] = {}, - ["core.summary"] = {}, - ["core.export"] = {}, - ["core.export.markdown"] = {}, - ["core.ui"] = {}, - ["core.ui.calendar"] = {}, - ["core.dirman"] = { - config = { - workspaces = { - notes = "~/Documents/Notes", - }, - default_workspace = "notes", - }, - }, - }, - } - end - } - - use({ - "kylechui/nvim-surround", - tag = "*", -- Use for stability; omit to use `main` branch for the latest features - config = function() - require("nvim-surround").setup() - end - }) - - use { - 'numToStr/Comment.nvim', - config = function() - require('Comment').setup() - end - } - - use ('mbbill/undotree') - - use { - 'm4xshen/autoclose.nvim', - config = function () - require("autoclose").setup() - end - } - - - -- pretty - use { - 'navarasu/onedark.nvim', - config = function() - vim.cmd('colorscheme onedark') - end - } - - use { "lukas-reineke/indent-blankline.nvim" } - - use { - "utilyre/barbecue.nvim", tag = "*", - requires = { - "SmiteshP/nvim-navic", - "nvim-tree/nvim-web-devicons", -- optional dependency - }, - after = "nvim-web-devicons", -- keep this if you're using NvChad - config = function() - require("barbecue").setup() - end, - } - - - -- lsp - use ('github/copilot.vim') - - use { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v2.x', - requires = { - -- LSP Support - {'neovim/nvim-lspconfig'}, -- Required - { -- Optional - 'williamboman/mason.nvim', - run = function() - pcall(vim.cmd, 'MasonUpdate') - end, - }, - {'williamboman/mason-lspconfig.nvim'}, -- Optional - - -- Autocompletion - {'hrsh7th/nvim-cmp'}, -- Required - {'hrsh7th/cmp-nvim-lsp'}, -- Required - {'L3MON4D3/LuaSnip'}, -- Required - } - } -end) diff --git a/lua/sevi-kun/plugins.lua b/lua/sevi-kun/plugins.lua new file mode 100644 index 0000000..062b35f --- /dev/null +++ b/lua/sevi-kun/plugins.lua @@ -0,0 +1,126 @@ +-- lazy.nvim plugins + +return { + -- treesitter + { "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate" + }, + { "nvim-treesitter/playground" }, + { "nvim-treesitter/nvim-treesitter-context" }, + + + -- useful + { "rmagatti/session-lens", + dependencies = { + "rmagatti/auto-session", + "nvim-telescope/telescope.nvim" + } + }, + + { "nvim-telescope/telescope.nvim", version = "0.1.x", + dependencies = { "nvim-lua/plenary.nvim" } + }, + + { "ThePrimeagen/harpoon", + version = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + }, + + { "NeogitOrg/neogit", + dependencies = { "nvim-lua/plenary.nvim" } + }, + + { "stevearc/oil.nvim" }, + + { "nvim-neorg/neorg", + version = "*", + build = ":Neorg sync-parsers", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("neorg").setup { + load = { + ["core.defaults"] = {}, -- Loads default behaviour + ["core.concealer"] = {}, -- Adds pretty icons to your documents + ["core.dirman"] = { -- Manages Neorg workspaces + config = { + workspaces = { + notes = "~/Documents/Notes", + }, + default_workspace = "notes", + }, + }, + }, + } + end, + }, + + { "kylechui/nvim-surround", + version = "*", + config = function() + require("nvim-surround").setup() + end + }, + + { "numToStr/Comment.nvim", + config = function() + require("Comment").setup() + end + }, + + { "mbbill/undotree" }, + + { "m4xshen/autoclose.nvim", + config = function () + require("autoclose").setup() + end + }, + + + -- pretty + + { "navarasu/onedark.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd("colorscheme onedark") + end + }, + + { "lukas-reineke/indent-blankline.nvim", + lazy = false, + main = "ibl", + opts = {}, + config = function() + require("ibl").setup({}) + end + }, + + { "utilyre/barbecue.nvim", + lazy = false, + name = "barbecue", + version = "*", + dependencies = { + "SmiteshP/nvim-navic", + "nvim-tree/nvim-web-devicons", + }, + }, + + + -- lsp + + { "github/copilot.vim" }, + + {"williamboman/mason.nvim", + lazy = false, + config = function() + require("mason").setup({}) + end + }, + {"williamboman/mason-lspconfig.nvim"}, + + {"VonHeikemen/lsp-zero.nvim", branch = "v3.x"}, + {"neovim/nvim-lspconfig"}, + {"hrsh7th/cmp-nvim-lsp"}, + {"hrsh7th/nvim-cmp"}, + {"L3MON4D3/LuaSnip"}, +}