Fixes #2 add markdown, add auto formatting on save

This commit is contained in:
Philipp 2024-07-17 19:18:16 +02:00
parent d332337f07
commit 33c2215f40
Signed by: Philipp
GPG key ID: 9EBD8439AFBAB750
12 changed files with 189 additions and 150 deletions

View file

@ -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.

View file

@ -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)

View file

@ -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({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = 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({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = 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,
},
}

View file

@ -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,
},
}

View file

@ -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,
}

View file

@ -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,
},
}

View file

@ -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,
},
}

View file

@ -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,
},
},
},
}

View file

@ -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,
}

View file

@ -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" },
},
},
},
}

View file

@ -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", "<C-p>", builtin.find_files, {}) -- ctrl + p = fuzzy file find
vim.keymap.set("n", "<leader>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", "<C-p>", builtin.find_files, {}) -- ctrl + p = fuzzy file find
vim.keymap.set("n", "<leader>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,
},
}

View file

@ -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,
}