From 664934ea742163918e66444fdf6491f326e4594b Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Mon, 16 Dec 2024 15:46:10 +0500 Subject: [PATCH 01/16] Initial Custom Commit. --- init.lua | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index ee8fbc992e1..0608c1524b0 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -155,7 +155,7 @@ vim.opt.inccommand = 'split' vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 +vim.opt.scrolloff = 4 -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -176,10 +176,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows @@ -416,6 +416,7 @@ require('lazy').setup({ -- You can pass additional configuration to Telescope to change the theme, layout, etc. builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { winblend = 10, + prompt_title = 'Live Grep in current Buffer', previewer = false, }) end, { desc = '[/] Fuzzily search in current buffer' }) @@ -588,14 +589,14 @@ require('lazy').setup({ }) -- Change diagnostic symbols in the sign column (gutter) - -- if vim.g.have_nerd_font then - -- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' } - -- local diagnostic_signs = {} - -- for type, icon in pairs(signs) do - -- diagnostic_signs[vim.diagnostic.severity[type]] = icon - -- end - -- vim.diagnostic.config { signs = { text = diagnostic_signs } } - -- end + if vim.g.have_nerd_font then + local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' } + local diagnostic_signs = {} + for type, icon in pairs(signs) do + diagnostic_signs[vim.diagnostic.severity[type]] = icon + end + vim.diagnostic.config { signs = { text = diagnostic_signs } } + end -- LSP servers and clients are able to communicate to each other what features they support. -- By default, Neovim doesn't support everything that is in the LSP specification. From 0a5251af60a4b14109889354cfcba02f66352bac Mon Sep 17 00:00:00 2001 From: momoyonwork Date: Tue, 17 Dec 2024 21:32:09 +0500 Subject: [PATCH 02/16] Set autochdir --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 0608c1524b0..254c04f7066 100644 --- a/init.lua +++ b/init.lua @@ -966,5 +966,6 @@ require('lazy').setup({ }, }) +vim.opt.autochdir = true -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 7e804ecb81734bb6161146e7ed35b90e9cd78401 Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Fri, 20 Dec 2024 00:28:16 +0500 Subject: [PATCH 03/16] Use gitsings keymap and pyright lsp. --- init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 254c04f7066..6d7909ba41f 100644 --- a/init.lua +++ b/init.lua @@ -932,7 +932,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. @@ -966,6 +966,9 @@ require('lazy').setup({ }, }) +require('lspconfig').pyright.setup { + trace = 'verbose', +} vim.opt.autochdir = true -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From f6e85770f480d295090a01f390a222d4b19e1398 Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Thu, 26 Dec 2024 00:01:42 +0500 Subject: [PATCH 04/16] Add autocmd for BufWritePost on sxhkdrc. --- init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.lua b/init.lua index 6d7909ba41f..ef585ec9f74 100644 --- a/init.lua +++ b/init.lua @@ -970,5 +970,12 @@ require('lspconfig').pyright.setup { trace = 'verbose', } vim.opt.autochdir = true + +vim.api.nvim_create_autocmd('BufWritePost', { + pattern = 'sxhkdrc', + callback = function() + vim.cmd '!kill -s USR1 -- $(pidof sxhkd)' + end, +}) -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 828d0fa46d2b72e4ab26d10e94b866c790388415 Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Wed, 1 Jan 2025 21:55:23 +0500 Subject: [PATCH 05/16] Add denols. --- init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.lua b/init.lua index ef585ec9f74..1c9e1846fe5 100644 --- a/init.lua +++ b/init.lua @@ -969,6 +969,13 @@ require('lazy').setup({ require('lspconfig').pyright.setup { trace = 'verbose', } +require('lspconfig').denols.setup { + trace = 'verbose', +} + +vim.g.markdown_fenced_languages = { + 'ts=typescript', +} vim.opt.autochdir = true vim.api.nvim_create_autocmd('BufWritePost', { From 067792b25605bd7b642b015f69af32fadcecefeb Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Tue, 7 Jan 2025 22:25:39 +0500 Subject: [PATCH 06/16] Add nvim-colorizer Plugin. --- init.lua | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 1c9e1846fe5..a38e0d8daeb 100644 --- a/init.lua +++ b/init.lua @@ -231,6 +231,8 @@ require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + { 'norcalli/nvim-colorizer.lua' }, + -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. @@ -938,7 +940,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! @@ -966,11 +968,19 @@ require('lazy').setup({ }, }) -require('lspconfig').pyright.setup { +require('colorizer').setup() + +local lspconfig = require 'lspconfig' + +lspconfig['pyright'].setup { trace = 'verbose', } -require('lspconfig').denols.setup { + +lspconfig['denols'].setup { trace = 'verbose', + settings = { + lint = false, + }, } vim.g.markdown_fenced_languages = { @@ -984,5 +994,6 @@ vim.api.nvim_create_autocmd('BufWritePost', { vim.cmd '!kill -s USR1 -- $(pidof sxhkd)' end, }) + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From bfe28a0cbe87f7d8aa6de2e1f9da2114d707310a Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Sat, 8 Feb 2025 14:49:57 +0500 Subject: [PATCH 07/16] [init.lua] Add autocmd for config.jsonc (waybar config) --- init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.lua b/init.lua index a38e0d8daeb..a0656313047 100644 --- a/init.lua +++ b/init.lua @@ -995,5 +995,12 @@ vim.api.nvim_create_autocmd('BufWritePost', { end, }) +vim.api.nvim_create_autocmd('BufWritePost', { + pattern = 'config.jsonc', + callback = function() + vim.cmd '!killall -SIGUSR2 waybar' + end, +}) + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 1a94af9a2e9fa62e783567ed3f440461224c6411 Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Sun, 9 Feb 2025 18:31:11 +0500 Subject: [PATCH 08/16] [init.lua] Changed config.jsonc autocmd to absolute path (waybar) --- init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index a0656313047..265a1d47c1a 100644 --- a/init.lua +++ b/init.lua @@ -996,7 +996,14 @@ vim.api.nvim_create_autocmd('BufWritePost', { }) vim.api.nvim_create_autocmd('BufWritePost', { - pattern = 'config.jsonc', + pattern = '/home/momoyon/dotfiles/waybar/.config/waybar/style.css', + callback = function() + vim.cmd '!killall -SIGUSR2 waybar' + end, +}) + +vim.api.nvim_create_autocmd('BufWritePost', { + pattern = '/home/momoyon/dotfiles/waybar/.config/waybar/config.jsonc', callback = function() vim.cmd '!killall -SIGUSR2 waybar' end, From d2f795dce883dbad9d4fe29b6fe85800a1d7501e Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Wed, 12 Feb 2025 23:13:56 +0500 Subject: [PATCH 09/16] [init.lua] Add autocmd for mako config. --- init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.lua b/init.lua index 265a1d47c1a..53b20843fd3 100644 --- a/init.lua +++ b/init.lua @@ -1009,5 +1009,12 @@ vim.api.nvim_create_autocmd('BufWritePost', { end, }) +vim.api.nvim_create_autocmd('BufWritePost', { + pattern = '/home/momoyon/dotfiles/mako/.config/mako/config', + callback = function() + vim.cmd '!makoctl reload' + end, +}) + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 59bd0505e460f5f996fd607161a997cedbd10bae Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Sat, 15 Feb 2025 13:04:05 +0500 Subject: [PATCH 10/16] [init.lua] Add tab options. --- init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.lua b/init.lua index 53b20843fd3..eb169c0a2d0 100644 --- a/init.lua +++ b/init.lua @@ -1016,5 +1016,9 @@ vim.api.nvim_create_autocmd('BufWritePost', { end, }) +vim.g.expandtab = true +vim.g.tabstop = 4 +vim.g.shiftwidth = 4 + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 7643d536c2f4a1db2d4621127385e134f4556948 Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Mon, 17 Feb 2025 23:35:00 +0500 Subject: [PATCH 11/16] [init.lua] Add close window/buffer. --- init.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/init.lua b/init.lua index eb169c0a2d0..108a8845901 100644 --- a/init.lua +++ b/init.lua @@ -1020,5 +1020,10 @@ vim.g.expandtab = true vim.g.tabstop = 4 vim.g.shiftwidth = 4 +vim.keymap.set('n', 'bd', ':bd') +vim.keymap.set('n', 'bD', ':bd!') +vim.keymap.set('n', 'bc', ':close') +vim.keymap.set('n', 'bC', ':close!') + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et From 3375b8a9bee2600b4b539f05fd10d7d529bcc63d Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Tue, 25 Feb 2025 17:50:32 +0500 Subject: [PATCH 12/16] [init.lua] Actually set tabstops and shi. --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 108a8845901..92c0eb27703 100644 --- a/init.lua +++ b/init.lua @@ -1016,9 +1016,9 @@ vim.api.nvim_create_autocmd('BufWritePost', { end, }) -vim.g.expandtab = true -vim.g.tabstop = 4 -vim.g.shiftwidth = 4 +vim.opt.tabstop = 4 +vim.opt.expandtab = true +vim.opt.shiftwidth = 4 vim.keymap.set('n', 'bd', ':bd') vim.keymap.set('n', 'bD', ':bd!') From 1a7651e4cb0af011e12de38f67b476c93fb67e95 Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Tue, 4 Mar 2025 12:39:32 +0500 Subject: [PATCH 13/16] [init.lua] Install presence.nvim (discord RPC)... - autocmd on BufWritePre xresources. --- init.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/init.lua b/init.lua index 92c0eb27703..2bb1e53309f 100644 --- a/init.lua +++ b/init.lua @@ -228,6 +228,7 @@ vim.opt.rtp:prepend(lazypath) -- -- NOTE: Here is where you install your plugins. require('lazy').setup({ + 'andweeb/presence.nvim', -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically @@ -968,6 +969,30 @@ require('lazy').setup({ }, }) +-- The setup config table shows all available config options with their default values: +require('presence').setup { + -- General options + auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`) + neovim_image_text = 'The One True Text Editor', -- Text displayed when hovered over the Neovim image + main_image = 'neovim', -- Main image display (either "neovim" or "file") + client_id = '793271441293967371', -- Use your own Discord application client id (not recommended) + log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error") + debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(, true)`) + enable_line_number = false, -- Displays the current line number instead of the current project + blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches + buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "