From c29a53ac5877a1c4af1eec266c40b50f6662ec5c Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 1 May 2022 14:41:20 +0200 Subject: [PATCH 1/6] [mail] feat: change Centrale displayed name is now "Smecta" --- .../mutt/accounts/4-david.julien@centrale-marseille.fr.muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/mutt/accounts/4-david.julien@centrale-marseille.fr.muttrc b/.config/mutt/accounts/4-david.julien@centrale-marseille.fr.muttrc index a4aa0c7..55a8192 100644 --- a/.config/mutt/accounts/4-david.julien@centrale-marseille.fr.muttrc +++ b/.config/mutt/accounts/4-david.julien@centrale-marseille.fr.muttrc @@ -1,6 +1,6 @@ # vim: filetype=neomuttrc # muttrc file for account david.julien@centrale-marseille.fr -set realname = "David JULIEN" +set realname = "Smecta" set from = "david.julien@centrale-marseille.fr" set sendmail = "msmtp -a david.julien@centrale-marseille.fr" alias me david.julien From 8f73067a9becf6d4a4a03198218fa2bfa8213b25 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 1 May 2022 14:42:05 +0200 Subject: [PATCH 2/6] [nvim] fix: variable names conflicts --- .config/nvim/lua/plugin/luasnip.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugin/luasnip.lua b/.config/nvim/lua/plugin/luasnip.lua index c5415c1..9fb6719 100644 --- a/.config/nvim/lua/plugin/luasnip.lua +++ b/.config/nvim/lua/plugin/luasnip.lua @@ -74,10 +74,12 @@ end -- Returns a snippet_node wrapped around an insert_node whose initial -- text value is set to the current date in the desired format. local function date_input(fmt) - local fmt = fmt or "%Y-%m-%d" - return sn(nil, i(1, os.date(fmt))) + local format = fmt or "%Y-%m-%d" + return sn(nil, i(1, os.date(format))) end +local copy = utils.copy + -- snippets are added via ls.add_snippets(filetype, snippets[, opts]), where -- opts may specify the `type` of the snippets ("snippets" or "autosnippets", -- for snippets that should expand directly after the trigger is typed). From f0596d3c808f15b41a44c71b2892dd84e27c8bf8 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 1 May 2022 14:43:00 +0200 Subject: [PATCH 3/6] [nvim] refactor: move CompletionItems to cmp.lua --- .config/nvim/lua/plugin/cmp.lua | 40 ++++++++++++++++++++++++++ .config/nvim/lua/plugin/lsp_config.lua | 40 -------------------------- .config/nvim/lua/plugin/packer.lua | 2 +- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/.config/nvim/lua/plugin/cmp.lua b/.config/nvim/lua/plugin/cmp.lua index 92e29b2..4155b68 100644 --- a/.config/nvim/lua/plugin/cmp.lua +++ b/.config/nvim/lua/plugin/cmp.lua @@ -17,6 +17,45 @@ end -- If you want insert `(` after select function or method item cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } })) +-- Custom item icons +local icons = { + Class = "  ", + Color = "  ", + Constant = " µ ", + Constructor = "  ", + Enum = "  ", + EnumMember = "  ", + Event = "  ", + Field = "  ", + File = "  ", + Folder = "  ", + Function = "  ", + Keyword = "  ", + Interface = "  ", + Method = "  ", + Module = "  ", + Operator = "  ", + Property = "  ", + Reference = "  ", + Snippet = "  ", + Struct = "  ", + Text = "  ", + TypeParameter = "  ", + Unit = "  ", + Value = "  ", + Variable = "  ", +} + + +local function icons_setup() + local kinds = vim.lsp.protocol.CompletionItemKind + for i, kind in ipairs(kinds) do + kinds[i] = icons[kind] or kind + end +end + + + cmp.setup { completion = { autocomplete = false @@ -33,6 +72,7 @@ cmp.setup { }, formatting = { format = function(entry, vim_item) + vim_item.kind = icons[vim_item.kind] vim_item.menu = ({ nvim_lsp = "[lsp]", nvim_lua = "[nvim]", diff --git a/.config/nvim/lua/plugin/lsp_config.lua b/.config/nvim/lua/plugin/lsp_config.lua index fb00539..e593c90 100644 --- a/.config/nvim/lua/plugin/lsp_config.lua +++ b/.config/nvim/lua/plugin/lsp_config.lua @@ -3,8 +3,6 @@ -- License : GPLv3 -- Description : neovim lsp config file -local M = {} - vim.fn.sign_define( "DiagnosticSignError", { @@ -37,41 +35,3 @@ vim.fn.sign_define( numhl = "DiagnosticSignInfo" } ) - -M.icons = { - Class = "  ", - Color = "  ", - Constant = " µ ", - Constructor = "  ", - Enum = "  ", - EnumMember = "  ", - Event = "  ", - Field = "  ", - File = "  ", - Folder = "  ", - Function = "  ", - Keyword = "  ", - Interface = "  ", - Method = "  ", - Module = "  ", - Operator = "  ", - Property = "  ", - Reference = "  ", - Snippet = "  ", - Struct = "  ", - Text = "  ", - TypeParameter = "  ", - Unit = "  ", - Value = "  ", - Variable = "  ", -} - - -function M.setup() - local kinds = vim.lsp.protocol.CompletionItemKind - for i, kind in ipairs(kinds) do - kinds[i] = M.icons[kind] or kind - end -end - -return M diff --git a/.config/nvim/lua/plugin/packer.lua b/.config/nvim/lua/plugin/packer.lua index dddeee8..9ab4a3b 100644 --- a/.config/nvim/lua/plugin/packer.lua +++ b/.config/nvim/lua/plugin/packer.lua @@ -58,7 +58,7 @@ return require("packer").startup(function() requires = { "neovim/nvim-lspconfig", config = function() - require("plugin.lsp_config").setup() end + require("plugin.lsp_config") end }, config = function() require("plugin.lsp_installer") end } From 375f82d8e6a3e2c391f4492b9f42e44ea1bca503 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 1 May 2022 18:30:12 +0200 Subject: [PATCH 4/6] [nvim] refactor: trim down lsp icons + remove unused functions --- .config/nvim/lua/plugin/cmp.lua | 68 +++++++++++++++------------------ 1 file changed, 31 insertions(+), 37 deletions(-) diff --git a/.config/nvim/lua/plugin/cmp.lua b/.config/nvim/lua/plugin/cmp.lua index 4155b68..c12ce81 100644 --- a/.config/nvim/lua/plugin/cmp.lua +++ b/.config/nvim/lua/plugin/cmp.lua @@ -19,43 +19,33 @@ cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex -- Custom item icons local icons = { - Class = "  ", - Color = "  ", - Constant = " µ ", - Constructor = "  ", - Enum = "  ", - EnumMember = "  ", - Event = "  ", - Field = "  ", - File = "  ", - Folder = "  ", - Function = "  ", - Keyword = "  ", - Interface = "  ", - Method = "  ", - Module = "  ", - Operator = "  ", - Property = "  ", - Reference = "  ", - Snippet = "  ", - Struct = "  ", - Text = "  ", - TypeParameter = "  ", - Unit = "  ", - Value = "  ", - Variable = "  ", + Class = "", + Color = "", + Constant = "µ", + Constructor = "", + Enum = "", + EnumMember = "", + Event = "", + Field = "", + File = "", + Folder = "", + Function = "", + Keyword = "", + Interface = "", + Method = "", + Module = "", + Operator = "", + Property = "", + Reference = "", + Snippet = "", + Struct = "", + Text = "", + TypeParameter = "", + Unit = "", + Value = "", + Variable = "", } - -local function icons_setup() - local kinds = vim.lsp.protocol.CompletionItemKind - for i, kind in ipairs(kinds) do - kinds[i] = icons[kind] or kind - end -end - - - cmp.setup { completion = { autocomplete = false @@ -72,7 +62,8 @@ cmp.setup { }, formatting = { format = function(entry, vim_item) - vim_item.kind = icons[vim_item.kind] + vim_item.kind = string.format("%s %s", icons[vim_item.kind], + vim_item.kind) vim_item.menu = ({ nvim_lsp = "[lsp]", nvim_lua = "[nvim]", @@ -119,5 +110,8 @@ cmp.setup { fallback() end end, { "i", "s" }), - } + }, + view = { + entries = {name = 'custom', selection_order = 'near_cursor' } + }, } From fb9ea761df8bf7b46f4382edf9e370965bc2b47a Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 1 May 2022 18:36:33 +0200 Subject: [PATCH 5/6] [nvim] feat: add nvim-cmp colors --- .local/src/astronomy.nvim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/src/astronomy.nvim b/.local/src/astronomy.nvim index 9b46e0f..41edd2a 160000 --- a/.local/src/astronomy.nvim +++ b/.local/src/astronomy.nvim @@ -1 +1 @@ -Subproject commit 9b46e0fa3d2bfca3b376961d822eb5d965da48ed +Subproject commit 41edd2a8502cc6d3be9ad18387e8b3c67d2dd4c3 From 0cb56c9a46dc7e1a0d91bf53608e628edfcfc036 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 1 May 2022 18:37:27 +0200 Subject: [PATCH 6/6] [dwm] feat: add screenshot script + keymap --- .config/sxhkd/sxhkdrc | 3 +++ .local/bin/screenshot | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100755 .local/bin/screenshot diff --git a/.config/sxhkd/sxhkdrc b/.config/sxhkd/sxhkdrc index 687ef73..0538d1f 100644 --- a/.config/sxhkd/sxhkdrc +++ b/.config/sxhkd/sxhkdrc @@ -50,6 +50,9 @@ super + shift + Return super + d dmenu_run -p "run:" +super + p + screenshot + super + shift + {w,z} $BROWSER diff --git a/.local/bin/screenshot b/.local/bin/screenshot new file mode 100755 index 0000000..8c4c684 --- /dev/null +++ b/.local/bin/screenshot @@ -0,0 +1,10 @@ +#!/usr/bin/env sh +if [ "-w" = "$1" ]; then + scrot -e 'xclip -selection clipboard -t image/png -i $f && rm $f' +else + if [ ! "" = "$1" ]; then + dunstify -u "normal" " Wrong parameter. No screenshot taken" && exit 1 + else + scrot -s -e 'xclip -selection clipboard -t image/png -i $f && rm $f' + fi +fi