From 2c3ccb816caa2adbb89ba01be14db229783d4028 Mon Sep 17 00:00:00 2001 From: Amy Retzerau Date: Sun, 7 Sep 2025 12:42:40 +0200 Subject: [PATCH] feat: rewrite of nvim dotfiles --- .config/nvim/init.lua | 18 +++++++ .config/nvim/lua/config/lazy.lua | 4 +- .config/nvim/lua/plugins/lsp.lua | 67 +++++++++++++++++++++++++ .config/nvim/lua/plugins/rose-pine.lua | 17 +++++++ .config/nvim/lua/plugins/tokyodark.lua | 9 ---- .config/nvim/lua/plugins/treesitter.lua | 20 ++++++++ 6 files changed, 124 insertions(+), 11 deletions(-) create mode 100644 .config/nvim/lua/plugins/lsp.lua create mode 100644 .config/nvim/lua/plugins/rose-pine.lua delete mode 100644 .config/nvim/lua/plugins/tokyodark.lua create mode 100644 .config/nvim/lua/plugins/treesitter.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 55b8979..bbde72a 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1 +1,19 @@ +-- Basic settings +vim.o.number = true -- Enable line numbers +vim.o.relativenumber = true -- Enable relative line numbers +vim.o.tabstop = 4 -- Number of spaces a tab represents +vim.o.shiftwidth = 4 -- Number of spaces for each indentation +vim.o.expandtab = true -- Convert tabs to spaces +vim.o.smartindent = true -- Automatically indent new lines +vim.o.wrap = false -- Disable line wrapping +vim.o.cursorline = true -- Highlight the current line +vim.o.termguicolors = true -- Enable 24-bit RGB colors +vim.o.clipboard = "unnamedplus" + +-- Syntax highlighting and filetype plugins +vim.cmd('syntax enable') +vim.cmd('filetype plugin indent on') + require("config.lazy") + +--vim.cmd[[colorscheme tokyonight]] diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index f5ee74c..8c758a9 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -27,9 +27,9 @@ require("lazy").setup({ -- import your plugins { import = "plugins" }, }, - -- Configure any other settings here. See the documentation for more details. + -- Configure any other settings here. See the documentation for more details. -- colorscheme that will be used when installing plugins. - install = { colorscheme = { "habamax" } }, + install = { colorscheme = {"tokyonight", "habamax" } }, -- automatically check for plugin updates checker = { enabled = true }, }) diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua new file mode 100644 index 0000000..fa9eaad --- /dev/null +++ b/.config/nvim/lua/plugins/lsp.lua @@ -0,0 +1,67 @@ +return { + + { + "neovim/nvim-lspconfig", + }, + { + "mason-org/mason.nvim", + opts = { + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗" + } + } + } + }, + { + "williamboman/mason-lspconfig.nvim", + opts = { + ensure_installed = { "clangd" }, + }, + dependencies = { + { "mason-org/mason.nvim", opts = {} }, + "neovim/nvim-lspconfig", + }, + }, + { + 'hrsh7th/nvim-cmp', + opts = { + sources = { + { name = 'nvim_lsp' }, + { name = 'buffer' }, + { name = 'path' }, + } + }, + dependencies = { + {'L3MON4D3/LuaSnip'}, + {'hrsh7th/cmp-buffer'}, + {'hrsh7th/cmp-nvim-lsp'}, + {'saadparwaiz1/cmp_luasnip'}, + }, + }, + { + 'stevearc/conform.nvim', + opts = { + -- Define your formatters + formatters_by_ft = { + cpp = { "clang-format" }, + }, + -- Set default options + default_format_opts = { + lsp_format = "fallback", + }, + -- Set up format-on-save + format_on_save = { timeout_ms = 500 }, + -- Customize formatters + formatters = { + ['clang-format'] = { + append_args = function(self, ctx) + return { "-style={IndentWidth: 4}" } + end, + }, + }, + }, + } +} diff --git a/.config/nvim/lua/plugins/rose-pine.lua b/.config/nvim/lua/plugins/rose-pine.lua new file mode 100644 index 0000000..f850d40 --- /dev/null +++ b/.config/nvim/lua/plugins/rose-pine.lua @@ -0,0 +1,17 @@ +return { + "rose-pine/neovim", + name = "rose-pine", + + config = function() + local configs = require("rose-pine"); + + configs.setup({ + variant = "moon", + styles = { + transparency = true; + } + }) + + vim.cmd("colorscheme rose-pine") + end +} diff --git a/.config/nvim/lua/plugins/tokyodark.lua b/.config/nvim/lua/plugins/tokyodark.lua deleted file mode 100644 index 47d3aeb..0000000 --- a/.config/nvim/lua/plugins/tokyodark.lua +++ /dev/null @@ -1,9 +0,0 @@ - -return { - "tiagovla/tokyodark.nvim", - lazy = false, - priority = 1000, - config = function() - vim.cmd("colorscheme tokyodark") - end, -} diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..0b48c5d --- /dev/null +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,20 @@ +return{ + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + dependencies = { + -- Automatically install LSPs and related tools to stdpath for Neovim + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + }, + config = function () + + local configs = require("nvim-treesitter.configs") + + configs.setup({ + ensure_installed = { "c", "cpp", "lua", "vim", "vimdoc", "query", "elixir", "heex", "javascript", "html" }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end + }