commit ca9ede56f3a82772e34d320344d016933de4ccc8
parent 3cf164e711d14df5fe5fdd29d93c3eb085e40dd1
Author: Linus <93053722+KoenigLinus@users.noreply.github.com>
Date: Sat, 7 Dec 2024 13:24:54 +0100
exec
Diffstat:
18 files changed, 264 insertions(+), 500 deletions(-)
diff --git a/nvim/.DS_Store b/nvim/.DS_Store
Binary files differ.
diff --git a/nvim/after/ftplugin/c.lua b/nvim/after/ftplugin/c.lua
@@ -1,6 +0,0 @@
--- ~/.config/nvim/after/ftplugin/c.lua
-
-vim.opt_local.tabstop = 4
-vim.opt_local.shiftwidth = 4
-vim.opt_local.expandtab = true
-vim.opt_local.softtabstop = 4
diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json
@@ -1,51 +0,0 @@
-{
- "LazyVim": { "branch": "main", "commit": "4d596cf4b4dcb369b2aef7e4d09635416b6c5a3f" },
- "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" },
- "bufferline.nvim": { "branch": "main", "commit": "5cc447cb2b463cb499c82eaeabbed4f5fa6a0a44" },
- "catppuccin": { "branch": "main", "commit": "637d99e638bc6f1efedac582f6ccab08badac0c6" },
- "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
- "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
- "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
- "conform.nvim": { "branch": "master", "commit": "62d5accad8b29d6ba9b58d3dff90c43a55621c60" },
- "dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
- "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
- "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
- "gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" },
- "grug-far.nvim": { "branch": "main", "commit": "9a2f78219390b47d67795ab09390d7f092e23976" },
- "gruvbox.nvim": { "branch": "main", "commit": "49d9c0b150ba70efcd831ec7b3cb8ee740067045" },
- "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" },
- "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" },
- "lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" },
- "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
- "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" },
- "mason-lspconfig.nvim": { "branch": "main", "commit": "43894adcf10bb1190c2184bd7c1750e8ea2b3dce" },
- "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
- "mini.ai": { "branch": "main", "commit": "31c149067d38b97720d2a179619f7745a0006ecc" },
- "mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" },
- "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" },
- "neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
- "noice.nvim": { "branch": "main", "commit": "203f74adaae11d47440a667555b4af9156be807b" },
- "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
- "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
- "nvim-cmp": { "branch": "main", "commit": "be7bd4c5f860c79da97af3a26d489af50babfd4b" },
- "nvim-lint": { "branch": "master", "commit": "8e9562de7261e5b862c631958df616e1a65552cd" },
- "nvim-lspconfig": { "branch": "master", "commit": "291a8f1a319dc712db85bcc174b0cf406f0a5b69" },
- "nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" },
- "nvim-tetris": { "branch": "master", "commit": "d17c99fb527ada98ffb0212ffc87ccda6fd4f7d9" },
- "nvim-treesitter": { "branch": "master", "commit": "8a74ac9aead72ef7a870908f1517b48f2bb25ac7" },
- "nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" },
- "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
- "nvim-web-devicons": { "branch": "master", "commit": "e87554285f581047b1bf236794b0eb812b444b87" },
- "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
- "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
- "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
- "snacks.nvim": { "branch": "main", "commit": "aa38175c002555aded511b6787380ad887665680" },
- "substitute.nvim": { "branch": "main", "commit": "97f49d16f8eea7967d41db4f657dd63af53eeba1" },
- "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
- "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
- "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
- "tokyonight.nvim": { "branch": "main", "commit": "c2725eb6d086c8c9624456d734bd365194660017" },
- "trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" },
- "ts-comments.nvim": { "branch": "main", "commit": "2002692ad1d3f6518d016550c20c2a890f0cbf0e" },
- "which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" }
-}
diff --git a/nvim/lua/.DS_Store b/nvim/lua/.DS_Store
Binary files differ.
diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua
@@ -1,14 +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
-
-local keymap = vim.keymap -- for conciseness
-
-keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd" })
-keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "Fuzzy find recent files" })
-keymap.set("n", "<leader>fs", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd" })
-keymap.set("n", "<leader>fc", "<cmd>Telescope grep_string<cr>", { desc = "Find string under cursor in cwd" })
-keymap.set("n", "<leader>ft", "<cmd>TodoTelescope<cr>", { desc = "Find todos" })
-
-keymap.set("n", "<leader>db", "<cmd>DapToggleBreakpoint<cr>", { desc = "Add breakpoint at line" })
-keymap.set("n", "<leader>dr", "<cmd>DapContinue <cr>", { desc = "Start or continue the debugger" })
diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua
@@ -1,54 +1,53 @@
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
+ 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)
require("lazy").setup({
- spec = {
- -- add LazyVim and import its plugins
- { "LazyVim/LazyVim", import = "lazyvim.plugins" },
- -- 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 = { "gruvbox"} },
- checker = {
- enabled = true, -- check for plugin updates periodically
- notify = false, -- notify on update
- }, -- automatically check for plugin updates
- performance = {
- rtp = {
- -- disable some rtp plugins
- disabled_plugins = {
- "gzip",
- -- "matchit",
- -- "matchparen",
- -- "netrwPlugin",
- "tarPlugin",
- "tohtml",
- "tutor",
- "zipPlugin",
- },
- },
+ spec = {
+ -- add LazyVim and import its plugins
+ { "LazyVim/LazyVim", import = "lazyvim.plugins" },
+ -- 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 = { "tokyonight", "habamax" } },
+ checker = {
+ enabled = true, -- check for plugin updates periodically
+ notify = false, -- notify on update
+ }, -- automatically check for plugin updates
+ performance = {
+ rtp = {
+ -- disable some rtp plugins
+ disabled_plugins = {
+ "gzip",
+ -- "matchit",
+ -- "matchparen",
+ -- "netrwPlugin",
+ "tarPlugin",
+ "tohtml",
+ "tutor",
+ "zipPlugin",
+ },
},
+ },
})
-
diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua
@@ -1,15 +1,3 @@
-- 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
-
--- Set 4-space tabs
-opt.tabstop = 4 -- Number of visual spaces per TAB
-opt.shiftwidth = 4 -- Number of spaces to use for each step of (auto)indent
-opt.expandtab = true -- Convert tabs to spaces
-opt.softtabstop = 4 -- Makes editing feel like 4-space tabs
-
--- Optionally, enable auto-indentation:
-opt.smartindent = false
-vim.g.autoformat = false
diff --git a/nvim/lua/plugins/alpha.lua b/nvim/lua/plugins/alpha.lua
@@ -1,6 +0,0 @@
-return {
- "goolord/alpha-nvim",
- config = function()
- require("alpha").setup(require("alpha.themes.dashboard").config)
- end,
-}
diff --git a/nvim/lua/plugins/dap.lua b/nvim/lua/plugins/dap.lua
@@ -1,35 +0,0 @@
-return {}
--- return {
--- "rcarriga/nvim-dap-ui",
--- event = "VeryLazy",
--- dependencies = "mfussenegger/nvim-dap",
--- config = function()
--- local dap = require("dap")
--- local dapui = require("dapui")
--- dapui.setup()
--- dap.listeners.after.event_initialized["dapui_config"] = function()
--- dapui.open()
--- end
--- dap.listeners.before.event_terminated["dapui_config"] = function()
--- dapui.close()
--- end
--- dap.listeners.before.event_exited["dapui_config"] = function()
--- dapui.close()
--- end
--- end,
--- }, {
--- "jay-babu/mason-nvim-dap.nvim",
--- event = "VeryLazy",
--- dependencies = {
--- "williamboman/mason.nvim",
--- "mfussenegger/nvim-dap",
--- },
--- opts = {
--- handlers = {},
--- },
--- }, {
--- "mfussenegger/nvim-dap",
--- config = function(_, _)
--- require("core.utils").load_mappings("dap")
--- end,
--- }
diff --git a/nvim/lua/plugins/example.lua b/nvim/lua/plugins/example.lua
@@ -9,38 +9,41 @@ if true then return {} end
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
- -- 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 },
-
- -- override nvim-cmp and add cmp-emoji
- {
- "hrsh7th/nvim-cmp",
- dependencies = { "hrsh7th/cmp-emoji" },
- ---@param opts cmp.ConfigSchema
- opts = function(_, opts)
- table.insert(opts.sources, { name = "emoji" })
- end,
- },
-
- -- change some telescope options and a keymap to browse plugin files
- {
- "nvim-telescope/telescope.nvim",
- keys = {
+ -- 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 },
+
+ -- override nvim-cmp and add cmp-emoji
+ {
+ "hrsh7th/nvim-cmp",
+ dependencies = { "hrsh7th/cmp-emoji" },
+ ---@param opts cmp.ConfigSchema
+ opts = function(_, opts)
+ table.insert(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
{
@@ -48,143 +51,147 @@ return {
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 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").lsp.on_attach(function(_, buffer)
+ },
+ -- change some options
+ opts = {
+ defaults = {
+ layout_strategy = "horizontal",
+ layout_config = { prompt_position = "top" },
+ sorting_strategy = "ascending",
+ winblend = 0,
+ },
+ },
+ },
+
+ -- 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").lsp.on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
- vim.keymap.set("n", "<leader>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<string, fun(server:string, opts:_.lspconfig.options):boolean?>
- 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",
- },
- },
- },
+ vim.keymap.set("n", "<leader>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<string, fun(server:string, opts:_.lspconfig.options):boolean?>
+ 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, {
+ function()
+ return "😄"
+ end,
+ })
+ 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",
+ },
+ },
+ },
}
diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua
@@ -1,108 +0,0 @@
--- Mason setup: Handles the installation of LSP servers, DAP servers, and more.
-require("mason").setup()
-
--- Mason LSPConfig setup: Ensures installation of required LSP servers.
-require("mason-lspconfig").setup({
- ensure_installed = {
- "lua_ls", -- Lua Language Server
- "pyright", -- Python Language Server
- "jdtls", -- Java Language Server
- "marksman", -- Markdown Language Server
- "clangd", -- C/C++ Language Server (optional, add if you need C/C++)
- -- "clang-format",
- -- "codelldb",
- },
- automatic_installation = true, -- Automatically install missing servers
-})
-
--- Require lspconfig for setting up language servers.
-local lspconfig = require("lspconfig")
-
--- Ensure that mason-lspconfig installs these servers
-local servers = { "lua_ls", "pyright", "jdtls", "marksman", "clangd" }
-
--- Loop through each server and set up with default configuration
-for _, server in ipairs(servers) do
- lspconfig[server].setup({
- -- Common configuration for all servers
- on_attach = function(client, bufnr)
- -- Set tab size and expand tab settings for each LSP
- vim.opt_local.tabstop = 4
- vim.opt_local.shiftwidth = 4
- vim.opt_local.expandtab = true
- end,
- })
-end
-
--- Lua Language Server configuration
-lspconfig.lua_ls.setup({
- settings = {
- Lua = {
- diagnostics = {
- globals = { "vim" }, -- Recognize 'vim' as a global variable for Neovim
- },
- workspace = {
- library = vim.api.nvim_get_runtime_file("", true), -- Automatically detect libraries
- },
- telemetry = { enable = false }, -- Disable telemetry data collection by Lua LS
- },
- },
-})
-
--- Pyright for Python
-lspconfig.pyright.setup({
- settings = {
- python = {
- analysis = {
- typeCheckingMode = "basic", -- You can change this to "strict" or "off" if needed
- },
- },
- },
-})
-
--- Java Language Server configuration
-lspconfig.jdtls.setup({
- cmd = { "java-lsp.sh" }, -- Adjust this path if necessary for your system
- root_dir = lspconfig.util.root_pattern(".git", "mvnw", "gradlew", "pom.xml", "build.gradle"), -- Detect project root
- settings = {
- java = {
- format = {
- settings = {
- tabSize = 4,
- insertSpaces = true, -- Use spaces instead of tabs
- },
- enable = true,
- defaultConfig = {
- indent_style = "space",
- indent_size = "4",
- },
- },
- },
- },
-})
-
--- Marksman: Markdown Language Server configuration
-lspconfig.marksman.setup({})
-
--- Clangd Language Server configuration
-lspconfig.clangd.setup({
- cmd = { "clangd", "--background-index" }, -- Ensure clangd is in your PATH
- settings = {
- clangd = {
- format = {
- settings = {
- tabSize = 4,
- insertSpaces = true, -- Use spaces instead of tabs
- },
- enable = true,
- defaultConfig = {
- indent_style = "space",
- indent_size = "4",
- },
- },
- },
- },
-})
-
--- Return a valid Lua table (necessary for LazyVim to load the config properly)
-return {}
diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua
@@ -1,28 +1,28 @@
return {
- "nvim-lualine/lualine.nvim",
- dependencies = { "nvim-tree/nvim-web-devicons" },
- config = function()
- local lualine = require("lualine")
- local lazy_status = require("lazy.status") -- to configure lazy pending updates count
+ "nvim-lualine/lualine.nvim",
+ dependencies = { "nvim-tree/nvim-web-devicons" },
+ config = function()
+ local lualine = require("lualine")
+ local lazy_status = require("lazy.status") -- to configure lazy pending updates count
- lualine.setup({
- options = {
- theme = "gruvbox",
- section_separators = "",
- component_separators = "",
- },
- sections = {
- lualine_x = {
- {
- lazy_status.updates,
- cond = lazy_status.has_updates,
- color = { fg = "#ff9e64" },
- },
- { "encoding" },
- { "fileformat" },
- { "filetype" },
- },
- },
- })
- end,
+ lualine.setup({
+ options = {
+ theme = "gruvbox",
+ section_separators = "",
+ component_separators = "",
+ },
+ sections = {
+ lualine_x = {
+ {
+ lazy_status.updates,
+ cond = lazy_status.has_updates,
+ color = { fg = "#ff9e64" },
+ },
+ { "encoding" },
+ { "fileformat" },
+ { "filetype" },
+ },
+ },
+ })
+ end,
}
diff --git a/nvim/lua/plugins/null-ls.lua b/nvim/lua/plugins/null-ls.lua
@@ -1,13 +0,0 @@
-return {
- "jose-elias-alvarez/null-ls.nvim",
- config = function()
- local null_ls = require("null-ls")
- null_ls.setup({
- sources = {
- null_ls.builtins.formatting.clang_format.with({
- extra_args = { "--style", "{IndentWidth: 4}" }, -- Set indent to 4 spaces
- }),
- },
- })
- end,
-}
diff --git a/nvim/lua/plugins/project.lua b/nvim/lua/plugins/project.lua
@@ -1,9 +0,0 @@
-return {
- "ahmedkhalf/project.nvim",
- config = function()
- require("project_nvim").setup({
- detection_methods = { "pattern" },
- patterns = { ".git", "_darcs", ".hg", ".bzr", ".svn", "Makefile", "package.json", ".obsidian" },
- })
- end,
-}
diff --git a/nvim/lua/plugins/snacks.lua b/nvim/lua/plugins/snacks.lua
@@ -0,0 +1,14 @@
+return {
+ "folke/snacks.nvim",
+ priority = 1000,
+ lazy = false,
+ opts = {
+ sections = {
+ { section = "header" },
+ { icon = " ", title = "Keymaps", section = "keys", indent = 2, padding = 1 },
+ { icon = " ", title = "Recent Files", section = "recent_files", indent = 2, padding = 1 },
+ { icon = " ", title = "Projects", section = "projects", indent = 2, padding = 1 },
+ { section = "startup" },
+ },
+ },
+}
diff --git a/nvim/lua/plugins/tetris.lua b/nvim/lua/plugins/tetris.lua
@@ -1,4 +0,0 @@
-return {
- "alec-gibson/nvim-tetris",
- lazy = true,
-}
diff --git a/nvim/lua/plugins/tokyonight.lua b/nvim/lua/plugins/tokyonight.lua
@@ -1,4 +0,0 @@
-return {
- "folke/tokyonight.nvim",
- lazy = false, -- Load the plugin immediately (not deferred)
-}
diff --git a/nvim/stylua.toml b/nvim/stylua.toml
@@ -1 +1,3 @@
-indent_width = 4
+indent_type = "Spaces"
+indent_width = 2
+column_width = 120
+\ No newline at end of file