From 7a98c8504941366fabe94c241704adab2b7ca4c3 Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Wed, 24 May 2023 19:18:03 +0100 Subject: [PATCH 01/10] Fix: Issue with the blur on fullscreen mode on other screen --- yabai/yabairc | 1 + 1 file changed, 1 insertion(+) diff --git a/yabai/yabairc b/yabai/yabairc index 2616cc5..67f29b4 100755 --- a/yabai/yabairc +++ b/yabai/yabairc @@ -7,6 +7,7 @@ yabai -m config window_placement second_child # yabai -m config window_shadow on yabai -m config window_border on yabai -m config window_border_width 4 +yabai -m config window_border_blur off # yabai -m config active_window_opacity 1.0 # yabai -m config normal_window_opacity 0.90 From 0c17f7e7dd2e090206f163a62212a1f4aa1bcd44 Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Tue, 30 May 2023 17:57:55 +0100 Subject: [PATCH 02/10] Add: Blame line --- nvim/lua/modules/nv-git/init.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/nvim/lua/modules/nv-git/init.lua b/nvim/lua/modules/nv-git/init.lua index e6631e5..af23493 100644 --- a/nvim/lua/modules/nv-git/init.lua +++ b/nvim/lua/modules/nv-git/init.lua @@ -10,12 +10,14 @@ return { - { - "lewis6991/gitsigns.nvim", - -- version = 'release' -- To use the latest release (do not use this if you build Neovim nightly or dev builds!) - config = function() - require("gitsigns").setup() - -- gitconflict.setup() - end, - }, + { + "lewis6991/gitsigns.nvim", + -- version = 'release' -- To use the latest release (do not use this if you build Neovim nightly or dev builds!) + config = function() + require("gitsigns").setup({ + current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame` + }) + -- gitconflict.setup() + end, + }, } From ad9896ed726940f3676f91422f91582a34126f52 Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Tue, 30 May 2023 17:58:10 +0100 Subject: [PATCH 03/10] Add: tmuxinator for config --- tmuxinator/config.yml | 55 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tmuxinator/config.yml diff --git a/tmuxinator/config.yml b/tmuxinator/config.yml new file mode 100644 index 0000000..f69da11 --- /dev/null +++ b/tmuxinator/config.yml @@ -0,0 +1,55 @@ +# /Users/joaopedro/.config/tmuxinator/config.yml + +name: config +root: ~/ + +# Optional tmux socket +# socket_name: foo + +# Note that the pre and post options have been deprecated and will be replaced by +# project hooks. + +# Project hooks + +# Runs on project start, always +# on_project_start: command + +# Run on project start, the first time +# on_project_first_start: command + +# Run on project start, after the first time +# on_project_restart: command + +# Run on project exit ( detaching from tmux session ) +# on_project_exit: command + +# Run on project stop +# on_project_stop: command + +# Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions. +# pre_window: rbenv shell 2.0.0-p247 + +# Pass command line options to tmux. Useful for specifying a different tmux.conf. +# tmux_options: -f ~/.tmux.mac.conf + +# Change the command to call tmux. This can be used by derivatives/wrappers like byobu. +# tmux_command: byobu + +# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used. +# startup_window: editor + +# Specifies (by index) which pane of the specified window will be selected on project startup. If not set, the first pane is used. +# startup_pane: 1 + +# Controls whether the tmux session should be attached to automatically. Defaults to true. +# attach: false + +windows: + - configs: + root: ~/.config/ + panes: + - nv + - backup: + root: ~/Documents/data/ConfigBackup + panes: + - lg From 12041cbd612e6981f9ce8cb8b44ba91784c79e4e Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Wed, 31 May 2023 15:45:03 +0100 Subject: [PATCH 04/10] Fix: Issue with null-ls not correctly being triggered --- nvim/lua/core/null-ls/init.lua | 6 +- nvim/lua/modules/nv-lsp/init.lua | 131 ++++++++++++++++--------------- 2 files changed, 71 insertions(+), 66 deletions(-) diff --git a/nvim/lua/core/null-ls/init.lua b/nvim/lua/core/null-ls/init.lua index 3ee51d6..f6ebb4f 100644 --- a/nvim/lua/core/null-ls/init.lua +++ b/nvim/lua/core/null-ls/init.lua @@ -36,10 +36,10 @@ null_ls.setup({ -- -- ) -- end, -- }), - formatting.prettierd, + -- formatting.prettierd, formatting.phpcsfixer, formatting.blade_formatter, - -- formatting.prettier, + formatting.prettier, -- require("typescript.extensions.null-ls.code-actions"), }, -- you can reuse a shared lspconfig on_attach callback here @@ -53,7 +53,9 @@ null_ls.setup({ -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead -- vim.lsp.buf.formatting_sync() vim.lsp.buf.format({ bufnr = bufnr }) + print("File formated with prettier") end, + desc = "[lsp] format on save", }) end end, diff --git a/nvim/lua/modules/nv-lsp/init.lua b/nvim/lua/modules/nv-lsp/init.lua index 7648394..b2798fe 100644 --- a/nvim/lua/modules/nv-lsp/init.lua +++ b/nvim/lua/modules/nv-lsp/init.lua @@ -1,71 +1,74 @@ return { - { - "neovim/nvim-lspconfig", - dependencies = { - { "jose-elias-alvarez/typescript.nvim" }, - { "lervag/vimtex" }, - { "akinsho/flutter-tools.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, - }, - -- config = function() - -- -- require("core.lsp") -- lsp engine - -- end, - }, + { + "neovim/nvim-lspconfig", + dependencies = { + { "jose-elias-alvarez/typescript.nvim" }, + { "lervag/vimtex" }, + { "akinsho/flutter-tools.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, + }, + -- config = function() + -- -- require("core.lsp") -- lsp engine + -- end, + }, - { - "williamboman/mason.nvim", - dependencies = { - "williamboman/mason-lspconfig.nvim", - -- "jayp0521/mason-null-ls.nvim", - "jayp0521/mason-nvim-dap.nvim", - }, - build = ":MasonUpdate", -- :MasonUpdate updates registry contents - config = function() - require("core.mason") -- lsp management - -- Lsp needs to be loaded after mason in order for - -- automatic_installation to work - require("core.lsp") -- lsp engine - -- require("core.null-ls") -- formaters management - require("core.dap") -- debuggers management - end, - }, + { + "williamboman/mason.nvim", + dependencies = { + "williamboman/mason-lspconfig.nvim", + -- "jayp0521/mason-null-ls.nvim", + "jayp0521/mason-nvim-dap.nvim", + }, + build = ":MasonUpdate", -- :MasonUpdate updates registry contents + config = function() + require("core.mason") -- lsp management + -- Lsp needs to be loaded after mason in order for + -- automatic_installation to work + require("core.lsp") -- lsp engine + require("core.dap") -- debuggers management + require("core.null-ls") -- formaters management + end, + }, - { - -- "jay-babu/mason-null-ls.nvim", - "jayp0521/mason-null-ls.nvim", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - "williamboman/mason.nvim", - "jose-elias-alvarez/null-ls.nvim", - -- "jose-elias-alvarez/null-ls.nvim", - "nvim-lua/plenary.nvim", - }, - config = function() - -- require("your.null-ls.config") -- require your null-ls config here (example below) - require("core.null-ls") -- formaters management - end, - }, + { + -- "jay-babu/mason-null-ls.nvim", + "jayp0521/mason-null-ls.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "williamboman/mason.nvim", + "jose-elias-alvarez/null-ls.nvim", + -- "jose-elias-alvarez/null-ls.nvim", + "nvim-lua/plenary.nvim", + }, + -- config = function() + -- require("your.null-ls.config") -- require your null-ls config here (example below) + -- require("core.null-ls") -- formaters management + -- end, + }, - { "mfussenegger/nvim-dap", dependencies = { - "rcarriga/nvim-dap-ui", - } }, + { + "mfussenegger/nvim-dap", + dependencies = { + "rcarriga/nvim-dap-ui", + }, + }, - -- LSP Sources && Modules - { - "hrsh7th/nvim-cmp", - config = function() - require("core.cmp") -- completion - end, - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - "hrsh7th/cmp-calc", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp-signature-help", - "onsails/lspkind-nvim", - }, - }, - -- use({ "tzachar/cmp-tabnine", build = "./install.sh", dependencies = "hrsh7th/nvim-cmp" }) + -- LSP Sources && Modules + { + "hrsh7th/nvim-cmp", + config = function() + require("core.cmp") -- completion + end, + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-calc", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-nvim-lsp-signature-help", + "onsails/lspkind-nvim", + }, + }, + -- use({ "tzachar/cmp-tabnine", build = "./install.sh", dependencies = "hrsh7th/nvim-cmp" }) } From 5bc4971f637da63c5ba18f3c89f7cb6b6bd4c8c9 Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Wed, 31 May 2023 15:45:16 +0100 Subject: [PATCH 05/10] Add: Luasnip extension for php --- nvim/lua/modules/nv-luasnip/init.lua | 32 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/nvim/lua/modules/nv-luasnip/init.lua b/nvim/lua/modules/nv-luasnip/init.lua index 5865fa9..3139bf8 100644 --- a/nvim/lua/modules/nv-luasnip/init.lua +++ b/nvim/lua/modules/nv-luasnip/init.lua @@ -1,16 +1,20 @@ return { - { - "L3MON4D3/LuaSnip", - dependencies = { - - "saadparwaiz1/cmp_luasnip", - "rafamadriz/friendly-snippets", - }, - config = function() - local luasnip = require("luasnip") - -- luasnip.filetype_extend("javascript", { "javascriptreact" }) - luasnip.filetype_extend("typescript", { "typescriptreact" }) - -- luasnip.filetype_extend("php", { "html" }) - end, - }, + { + "L3MON4D3/LuaSnip", + -- follow latest release. + version = ".*", -- Replace by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = "make install_jsregexp", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + config = function() + local luasnip = require("luasnip") + require("luasnip.loaders.from_vscode").lazy_load() + -- luasnip.filetype_extend("javascript", { "javascriptreact" }) + luasnip.filetype_extend("typescript", { "typescriptreact" }) + luasnip.filetype_extend("php", { "html" }) + end, + }, } From 4aa4bacc229773d5ffae8b662a998ee88e0a3ee2 Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Wed, 31 May 2023 15:47:05 +0100 Subject: [PATCH 06/10] Add: info on lsp module --- nvim/lua/modules/nv-lsp/init.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nvim/lua/modules/nv-lsp/init.lua b/nvim/lua/modules/nv-lsp/init.lua index b2798fe..4f0de1c 100644 --- a/nvim/lua/modules/nv-lsp/init.lua +++ b/nvim/lua/modules/nv-lsp/init.lua @@ -21,6 +21,9 @@ return { }, build = ":MasonUpdate", -- :MasonUpdate updates registry contents config = function() + -- Everything related to LSP need to have the following order + -- Mason should be first and then lsp and lastly all of the others + -- If we change this order, can lead to not expected behaviour require("core.mason") -- lsp management -- Lsp needs to be loaded after mason in order for -- automatic_installation to work From 52448346eb2bfd343cc07a81acd069e98aa0f43d Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Wed, 31 May 2023 15:49:51 +0100 Subject: [PATCH 07/10] Add: Changed structure of lsp module --- nvim/lua/modules/nv-lsp/init.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/nvim/lua/modules/nv-lsp/init.lua b/nvim/lua/modules/nv-lsp/init.lua index 4f0de1c..2dad535 100644 --- a/nvim/lua/modules/nv-lsp/init.lua +++ b/nvim/lua/modules/nv-lsp/init.lua @@ -1,17 +1,4 @@ return { - - { - "neovim/nvim-lspconfig", - dependencies = { - { "jose-elias-alvarez/typescript.nvim" }, - { "lervag/vimtex" }, - { "akinsho/flutter-tools.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, - }, - -- config = function() - -- -- require("core.lsp") -- lsp engine - -- end, - }, - { "williamboman/mason.nvim", dependencies = { @@ -28,11 +15,24 @@ return { -- Lsp needs to be loaded after mason in order for -- automatic_installation to work require("core.lsp") -- lsp engine + require("core.cmp") -- completion require("core.dap") -- debuggers management require("core.null-ls") -- formaters management end, }, + { + "neovim/nvim-lspconfig", + dependencies = { + { "jose-elias-alvarez/typescript.nvim" }, + { "lervag/vimtex" }, + { "akinsho/flutter-tools.nvim", dependencies = { "nvim-lua/plenary.nvim" } }, + }, + -- config = function() + -- -- require("core.lsp") -- lsp engine + -- end, + }, + { -- "jay-babu/mason-null-ls.nvim", "jayp0521/mason-null-ls.nvim", @@ -59,9 +59,9 @@ return { -- LSP Sources && Modules { "hrsh7th/nvim-cmp", - config = function() - require("core.cmp") -- completion - end, + -- config = function() + -- require("core.cmp") -- completion + -- end, dependencies = { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", From a0ca4f61da454646260720d189d46a1f71aec387 Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Wed, 31 May 2023 16:00:28 +0100 Subject: [PATCH 08/10] Typo: lsp info --- nvim/lua/modules/nv-lsp/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvim/lua/modules/nv-lsp/init.lua b/nvim/lua/modules/nv-lsp/init.lua index 2dad535..bc996fe 100644 --- a/nvim/lua/modules/nv-lsp/init.lua +++ b/nvim/lua/modules/nv-lsp/init.lua @@ -10,7 +10,7 @@ return { config = function() -- Everything related to LSP need to have the following order -- Mason should be first and then lsp and lastly all of the others - -- If we change this order, can lead to not expected behaviour + -- If we change this order, can lead to unexpected behaviour require("core.mason") -- lsp management -- Lsp needs to be loaded after mason in order for -- automatic_installation to work From cc7e32bad05f3fbab3e10ac69377fd8396c6eb38 Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Wed, 31 May 2023 16:00:38 +0100 Subject: [PATCH 09/10] Fix: lsp icon on lualine --- nvim/lua/modules/nv-lualine/init.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nvim/lua/modules/nv-lualine/init.lua b/nvim/lua/modules/nv-lualine/init.lua index 7792a11..6151628 100644 --- a/nvim/lua/modules/nv-lualine/init.lua +++ b/nvim/lua/modules/nv-lualine/init.lua @@ -58,6 +58,7 @@ return { lualine_b = { "filename", { "branch", icon = "" }, + -- "diff", { "diagnostics", sources = { "nvim_diagnostic" } }, }, lualine_c = {}, @@ -67,7 +68,7 @@ return { -- lualine_y = { { lspClients, icon = "ﴞ" }, "fileformat", "filetype", "progress" }, lualine_x = {}, -- lualine_y = { { lspClients, icon = "喇" }, "tabs", "filetype", "progress" }, - lualine_y = { { lspClients, icon = "喇" }, "filetype", "progress" }, + lualine_y = { { lspClients, icon = "" }, "filetype", "progress", "searchcount" }, lualine_z = { { "location", separator = { right = "" }, left_padding = 2 }, }, @@ -99,5 +100,9 @@ return { vim.opt.laststatus = 3 -- Status bar always on bottom (shared) end, + -- init = function() + -- vim.opt.laststatus = 3 -- Status bar always on bottom (shared) + -- vim.opt.termguicolors = true + -- end, }, } From e21fb83ed17c612e06aa823ad584879bc4af1a9c Mon Sep 17 00:00:00 2001 From: bitinbyte Date: Wed, 31 May 2023 19:40:23 +0100 Subject: [PATCH 10/10] Fix: Issue with lsp performing multiple formatting engines --- nvim/lua/core/lsp/init.lua | 11 +++- nvim/lua/core/null-ls/init.lua | 93 ++++++++++++++++++---------------- 2 files changed, 60 insertions(+), 44 deletions(-) diff --git a/nvim/lua/core/lsp/init.lua b/nvim/lua/core/lsp/init.lua index e8f433f..2b27e2d 100644 --- a/nvim/lua/core/lsp/init.lua +++ b/nvim/lua/core/lsp/init.lua @@ -19,6 +19,7 @@ keymap.set("n", "e", vim.diagnostic.open_float, mappingOpts) keymap.set("n", "[d", vim.diagnostic.goto_prev, mappingOpts) keymap.set("n", "]d", vim.diagnostic.goto_next, mappingOpts) keymap.set("n", "q", vim.diagnostic.setloclist, mappingOpts) +-- keymap.set("n", "q", 'ca", vim.lsp.buf.code_action, bufopts) keymap.set("n", "gr", vim.lsp.buf.references, bufopts) keymap.set("n", "bf", function() - vim.lsp.buf.format({ async = true }) + -- vim.lsp.buf.format({ async = false }) + vim.lsp.buf.format({ + async = false, + filter = function(cli) + return cli.name == "null-ls" + end, + }) end, bufopts) -- keymap.set("n", "lA", vim.lsp.buf.format, bufopts) end @@ -78,6 +85,8 @@ local lsps_table = { eslint_lsp = require(providers_path .. "eslint"), angular_lsp = require(providers_path .. "angular"), clang_lsp = require(providers_path .. "clang"), + php_lsp = require(providers_path .. "php"), + tailwind = require(providers_path .. "tailwind"), } -- LSP settings (for overriding per client) diff --git a/nvim/lua/core/null-ls/init.lua b/nvim/lua/core/null-ls/init.lua index f6ebb4f..f637e55 100644 --- a/nvim/lua/core/null-ls/init.lua +++ b/nvim/lua/core/null-ls/init.lua @@ -16,47 +16,54 @@ local formatting = null_ls.builtins.formatting local diagnostics = null_ls.builtins.diagnostics null_ls.setup({ - sources = { - formatting.stylua, - -- diagnostics.eslint_d, - -- diagnostics.eslint_d.with({ - -- filetypes = { "javascript", "javascriptreact", "typescript", "vue", "html", "css" }, - -- condition = function() - -- return utils.root_pattern( - -- "eslint.config.js", - -- -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats - -- ".eslintrc", - -- ".eslintrc.js", - -- ".eslintrc.cjs", - -- ".eslintrc.yaml", - -- ".eslintrc.yml", - -- ".eslintrc.json", - -- "package.json" - -- )(vim.api.nvim_buf_get_name(0)) ~= nil - -- -- ) - -- end, - -- }), - -- formatting.prettierd, - formatting.phpcsfixer, - formatting.blade_formatter, - formatting.prettier, - -- require("typescript.extensions.null-ls.code-actions"), - }, - -- you can reuse a shared lspconfig on_attach callback here - 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() - -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead - -- vim.lsp.buf.formatting_sync() - vim.lsp.buf.format({ bufnr = bufnr }) - print("File formated with prettier") - end, - desc = "[lsp] format on save", - }) - end - end, + sources = { + formatting.stylua, + -- diagnostics.eslint_d, + -- diagnostics.eslint_d.with({ + -- filetypes = { "javascript", "javascriptreact", "typescript", "vue", "html", "css" }, + -- condition = function() + -- return utils.root_pattern( + -- "eslint.config.js", + -- -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats + -- ".eslintrc", + -- ".eslintrc.js", + -- ".eslintrc.cjs", + -- ".eslintrc.yaml", + -- ".eslintrc.yml", + -- ".eslintrc.json", + -- "package.json" + -- )(vim.api.nvim_buf_get_name(0)) ~= nil + -- -- ) + -- end, + -- }), + -- formatting.prettierd, + formatting.phpcsfixer, + formatting.blade_formatter, + formatting.prettier, + -- require("typescript.extensions.null-ls.code-actions"), + }, + -- you can reuse a shared lspconfig on_attach callback here + 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.notify("Formating with null ls") + -- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead + -- vim.lsp.buf.formatting_sync() + -- vim.lsp.buf.format({ bufnr = bufnr }) + vim.lsp.buf.format({ + async = false, + filter = function(cli) + return cli.name == "null-ls" + end, + }) + -- print("File formated with prettier") + end, + desc = "[lsp] format on save", + }) + end + end, })