diff --git a/README.md b/README.md index 87330d8..ad06f4b 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,11 @@ For stow to restore the old state you have to run following command. `git clone https://git.snrd.eu/Spaenny/dotfiles.git && cd dotfiles` -`stow alacritty nvim plasma zsh tmux git pipewire` +`stow alacritty nvim plasma zsh tmux git pipewire stylua` If you just wanna restore one application config you can do so by executing it via package name. `stow nvim` This would just restore the nvim config files. -WARNING: This will instantly apply my Dotfiles to your machine, for further information how todo this step by step checkout. +#### WARNING: This will instantly apply my Dotfiles to your machine, for further information how todo this step by step checkout. diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index c7f470f..1bc79c1 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,14 +1,13 @@ - local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or 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, - }) + 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) diff --git a/nvim/.config/nvim/lua/plugins/completions.lua b/nvim/.config/nvim/lua/plugins/completions.lua index e974c42..02a71a8 100644 --- a/nvim/.config/nvim/lua/plugins/completions.lua +++ b/nvim/.config/nvim/lua/plugins/completions.lua @@ -1,44 +1,44 @@ return { - { - "hrsh7th/cmp-nvim-lsp", - }, - { - "L3MON4D3/LuaSnip", - dependencies = { - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets" - } - }, - { - "hrsh7th/nvim-cmp", - config = function() - local cmp = require('cmp') - require("luasnip.loaders.from_vscode").lazy_load() + { + "hrsh7th/cmp-nvim-lsp", + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + }, + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() - cmp.setup({ - snippet = { - expand = function(args) - require('luasnip').lsp_expand(args.body) - end, - }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - --{ name = 'nvim_lsp' }, - { name = 'luasnip' }, - }, { - { name = 'buffer' }, - }) - }) - end - } + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + --{ name = 'nvim_lsp' }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, } diff --git a/nvim/.config/nvim/lua/plugins/dracula.lua b/nvim/.config/nvim/lua/plugins/dracula.lua index b40d72e..11a2b17 100644 --- a/nvim/.config/nvim/lua/plugins/dracula.lua +++ b/nvim/.config/nvim/lua/plugins/dracula.lua @@ -1,24 +1,24 @@ return { { - 'maxmx03/dracula.nvim', + "maxmx03/dracula.nvim", lazy = false, priority = 1000, - config = function () - local dracula = require "dracula" + config = function() + local dracula = require("dracula") dracula.setup({ - transparent = false, - plugins = { - ["nvim-treesitter"] = true, - ["nvim-lspconfig"] = true, - ["nvim-cmp"] = true, - ["neo-tree.nvim"] = true, - ["gitsigns.nvim"] = true, - ["lazy.nvim"] = true, - ["telescope.nvim"] = true, - } + transparent = false, + plugins = { + ["nvim-treesitter"] = true, + ["nvim-lspconfig"] = true, + ["nvim-cmp"] = true, + ["neo-tree.nvim"] = true, + ["gitsigns.nvim"] = true, + ["lazy.nvim"] = true, + ["telescope.nvim"] = true, + }, }) - vim.cmd.colorscheme 'dracula' - end + vim.cmd.colorscheme("dracula") + end, }, } diff --git a/nvim/.config/nvim/lua/plugins/formatter.lua b/nvim/.config/nvim/lua/plugins/formatter.lua new file mode 100644 index 0000000..b1717a0 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/formatter.lua @@ -0,0 +1,29 @@ +return { + "nvimtools/none-ls.nvim", + requires = { "nvim-lua/plenary.nvim" }, + config = function() + local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.golines, + null_ls.builtins.formatting.htmlbeautifier, + null_ls.builtins.formatting.nginx_beautifier, + null_ls.builtins.formatting.prettierd, + null_ls.builtins.formatting.stylua, + }, + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + vim.lsp.buf.format({ async = false }) + end, + }) + end + end, + }) + end, +} diff --git a/nvim/.config/nvim/lua/plugins/git.lua b/nvim/.config/nvim/lua/plugins/git.lua index 0f7d10c..0c7cc6f 100644 --- a/nvim/.config/nvim/lua/plugins/git.lua +++ b/nvim/.config/nvim/lua/plugins/git.lua @@ -1,11 +1,11 @@ return { - { - "tpope/vim-fugitive" - }, - { - "lewis6991/gitsigns.nvim", - config = function() - require("gitsigns").setup() - end - } + { + "tpope/vim-fugitive", + }, + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup() + end, + }, } diff --git a/nvim/.config/nvim/lua/plugins/lsp-config.lua b/nvim/.config/nvim/lua/plugins/lsp-config.lua index 1e3de0e..3feda09 100644 --- a/nvim/.config/nvim/lua/plugins/lsp-config.lua +++ b/nvim/.config/nvim/lua/plugins/lsp-config.lua @@ -2,19 +2,31 @@ return { { "williamboman/mason.nvim", config = function() - require('mason').setup() - end + require("mason").setup() + end, }, { "williamboman/mason-lspconfig.nvim", opts = { - auto_install = true + auto_install = true, }, config = function() - require('mason-lspconfig').setup({ - ensure_installed = { "lua_ls", "bashls", "gopls", "jsonls", "biome", "zk", "pyre", "rust_analyzer", "sqls", "taplo", "yamlls" } + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "bashls", + "gopls", + "jsonls", + "biome", + "zk", + "pyre", + "rust_analyzer", + "sqls", + "taplo", + "yamlls", + }, }) - end + end, }, { "neovim/nvim-lspconfig", @@ -33,6 +45,6 @@ return { lspconfig.sqls.setup({ capabilities = capabilities }) lspconfig.taplo.setup({ capabilities = capabilities }) lspconfig.yamlls.setup({ capabilities = capabilities }) - end - } + end, + }, } diff --git a/nvim/.config/nvim/lua/plugins/lualine.lua b/nvim/.config/nvim/lua/plugins/lualine.lua index 2d5edbf..156bf15 100644 --- a/nvim/.config/nvim/lua/plugins/lualine.lua +++ b/nvim/.config/nvim/lua/plugins/lualine.lua @@ -1,12 +1,11 @@ -return - { - 'nvim-lualine/lualine.nvim', - opts = { - options = { - theme = vim.g.colors_name, - refresh = { - statusline = 1000, - }, - }, - }, - } +return { + "nvim-lualine/lualine.nvim", + opts = { + options = { + theme = vim.g.colors_name, + refresh = { + statusline = 1000, + }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/plugins/markdown.lua b/nvim/.config/nvim/lua/plugins/markdown.lua new file mode 100644 index 0000000..5cf0f6e --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/markdown.lua @@ -0,0 +1,7 @@ +return { + "MeanderingProgrammer/markdown.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons + config = function() + require("render-markdown").setup({}) + end, +} diff --git a/nvim/.config/nvim/lua/plugins/neotree.lua b/nvim/.config/nvim/lua/plugins/neotree.lua index 97e0d10..e3a0d86 100644 --- a/nvim/.config/nvim/lua/plugins/neotree.lua +++ b/nvim/.config/nvim/lua/plugins/neotree.lua @@ -1,10 +1,10 @@ return { - 'nvim-neo-tree/neo-tree.nvim', - branch = 'v3.x', + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', - 'MunifTanjim/nui.nvim', + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", }, opts = { filesystem = { @@ -14,13 +14,11 @@ return { hide_dotfiles = false, hide_gitignored = true, hide_by_name = { - '.DS_Store', - 'thumbs.db' + ".DS_Store", + "thumbs.db", }, - never_show = { '.git' } - } - } - } + never_show = { ".git" }, + }, + }, + }, } - - diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 7a36808..3fed1ae 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -1,27 +1,25 @@ return { - { - 'nvim-telescope/telescope.nvim', - tag = '0.1.6', - dependencies = { 'nvim-lua/plenary.nvim' }, - config = function () - local builtin = require("telescope.builtin") - vim.keymap.set("n", "", builtin.find_files, {}) -- ctrl + p = fuzzy file find - vim.keymap.set("n", "fg", builtin.live_grep, {}) -- space + fg = fuzzy grep in files - end - }, - { - 'nvim-telescope/telescope-ui-select.nvim', - config = function() - require("telescope").setup({ - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown {} - } - } - }) - require("telescope").load_extension("ui-select") - end - } + { + "nvim-telescope/telescope.nvim", + tag = "0.1.6", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local builtin = require("telescope.builtin") + vim.keymap.set("n", "", builtin.find_files, {}) -- ctrl + p = fuzzy file find + vim.keymap.set("n", "fg", builtin.live_grep, {}) -- space + fg = fuzzy grep in files + end, + }, + { + "nvim-telescope/telescope-ui-select.nvim", + config = function() + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + }, + }) + require("telescope").load_extension("ui-select") + end, + }, } - - diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua index c8b3b5a..abc7c35 100644 --- a/nvim/.config/nvim/lua/plugins/treesitter.lua +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -1,17 +1,14 @@ -return { - 'nvim-treesitter/nvim-treesitter', - build = function() - require("nvim-treesitter.install").update({ with_sync = true })() - end, - config = function() - local config = require("nvim-treesitter.configs") - config.setup({ - ensure_installed = {"lua", "javascript", "go", "toml", "json", "yaml"}, - highlight = { enable = true }, - indent = { enable = true }, - }) - end +return { + "nvim-treesitter/nvim-treesitter", + build = function() + require("nvim-treesitter.install").update({ with_sync = true })() + end, + config = function() + local config = require("nvim-treesitter.configs") + config.setup({ + ensure_installed = { "lua", "javascript", "go", "toml", "json", "yaml" }, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, } - - -