From d5d781272d83598bdf5e0825954f884c318cc147 Mon Sep 17 00:00:00 2001 From: Florian Schmitt Date: Tue, 8 Oct 2024 12:06:15 +0300 Subject: [PATCH] feat(nvim): working lsp and formatters --- dotfiles/nvim/init.lua | 5 +++++ dotfiles/nvim/lua/configs/conform.lua | 3 ++- dotfiles/nvim/lua/configs/lspconfig.lua | 14 +++++++++++++- dotfiles/nvim/lua/plugins/init.lua | 5 +++-- home-manager/mrflos-cli.nix | 4 ++++ 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/dotfiles/nvim/init.lua b/dotfiles/nvim/init.lua index 4205ce0..a02cf30 100644 --- a/dotfiles/nvim/init.lua +++ b/dotfiles/nvim/init.lua @@ -104,3 +104,8 @@ local function open_nvim_tree(data) end autocmd({ "VimEnter" }, { callback = open_nvim_tree }) +vim.api.nvim_create_autocmd("TextYankPost", { + callback = function() + vim.highlight.on_yank { higroup = "IncSearch", timeout = 200 } + end, +}) diff --git a/dotfiles/nvim/lua/configs/conform.lua b/dotfiles/nvim/lua/configs/conform.lua index 2f3a800..ab05207 100644 --- a/dotfiles/nvim/lua/configs/conform.lua +++ b/dotfiles/nvim/lua/configs/conform.lua @@ -4,10 +4,11 @@ local options = { css = { "prettier" }, html = { "prettier" }, js = { "prettier" }, + php = { "php_cs_fixer" }, }, format_on_save = { - timeout_ms = 50, + timeout_ms = 500, lsp_fallback = true, }, } diff --git a/dotfiles/nvim/lua/configs/lspconfig.lua b/dotfiles/nvim/lua/configs/lspconfig.lua index 478df01..bbb41a2 100644 --- a/dotfiles/nvim/lua/configs/lspconfig.lua +++ b/dotfiles/nvim/lua/configs/lspconfig.lua @@ -4,7 +4,19 @@ require("nvchad.configs.lspconfig").defaults() local lspconfig = require "lspconfig" -- EXAMPLE -local servers = { "html", "cssls" } +local servers = { + "html", + "cssls", + "phpactor", + "gopls", + -- "intelephense", + "jsonls", + "lua_ls", + "nixd", + "tailwindcss", + "templ", + "vuels", +} local nvlsp = require "nvchad.configs.lspconfig" -- lsps with default config diff --git a/dotfiles/nvim/lua/plugins/init.lua b/dotfiles/nvim/lua/plugins/init.lua index 465199a..9e3a3c7 100644 --- a/dotfiles/nvim/lua/plugins/init.lua +++ b/dotfiles/nvim/lua/plugins/init.lua @@ -87,7 +87,7 @@ return { rgb_fn = true, -- CSS rgb() and rgba() functions hsl_fn = true, -- CSS hsl() and hsla() functions css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn -- Available modes for `mode`: foreground, background, virtualtext mode = "background", -- Set the display mode. -- Available methods are false / true / "normal" / "lsp" / "both" @@ -98,10 +98,11 @@ return { virtualtext = "■", -- update color values even if buffer is not focused -- example use: cmp_menu, cmp_docs - always_update = false, + always_update = true, }, -- all the sub-options of filetypes apply to buftypes buftypes = {}, }, }, + { "lukas-reineke/indent-blankline.nvim", enabled = false }, } diff --git a/home-manager/mrflos-cli.nix b/home-manager/mrflos-cli.nix index 6ad901d..52261ec 100644 --- a/home-manager/mrflos-cli.nix +++ b/home-manager/mrflos-cli.nix @@ -43,6 +43,7 @@ neofetch neovim nil + nixd nixfmt-rfc-style nodejs_20 pandoc @@ -50,12 +51,15 @@ pciutils php83 php83Packages.composer + php83Packages.php-cs-fixer + phpactor pinentry python312Packages.pip ripgrep slides starship symfony-cli + tailwindcss-language-server tmux tree unzip