From d60da4b78aec588ade09496e19b961b01223f828 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 12 Sep 2021 00:08:46 +0200 Subject: [PATCH 1/5] feat: tweaking nvim's colorscheme --- .local/src/polyjuice | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/src/polyjuice b/.local/src/polyjuice index 800a770..4136059 160000 --- a/.local/src/polyjuice +++ b/.local/src/polyjuice @@ -1 +1 @@ -Subproject commit 800a770838d28e2430b85b28d1c907ae55cae782 +Subproject commit 41360594fd669ec9f4d09e552c77764dde302c3b From c38ffd81d2111effec8d3523078e3d6ea56493e0 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 12 Sep 2021 02:30:11 +0200 Subject: [PATCH 2/5] feat: change nvim completion engine BREAKING: now using hrsh7th/nvim-cmp, because nvim-compe has been deprecated --- .config/nvim/init.lua | 2 +- .config/nvim/lua/plugin/cmp.lua | 81 +++++++++++++++++++++++++++++++ .config/nvim/lua/plugin/compe.lua | 73 ---------------------------- .config/nvim/lua/plugins.lua | 16 +++++- 4 files changed, 97 insertions(+), 75 deletions(-) create mode 100644 .config/nvim/lua/plugin/cmp.lua delete mode 100644 .config/nvim/lua/plugin/compe.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 9199b9d..1694204 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -13,7 +13,7 @@ require("statusline") -- ./lua/statusline.lua require("polyjuice") -- ~/.local/src/polyjuice/lua/polyjuice.lua -- auto complete -require("plugin.compe") -- ./lua/plugin/compe.lua +require("plugin.cmp") -- ./lua/plugin/cmp.lua -- treesitter require("plugin.treesitter") -- ./lua/plugin/treesitter.lua diff --git a/.config/nvim/lua/plugin/cmp.lua b/.config/nvim/lua/plugin/cmp.lua new file mode 100644 index 0000000..deebb51 --- /dev/null +++ b/.config/nvim/lua/plugin/cmp.lua @@ -0,0 +1,81 @@ +-- Author : swytch +-- Created : Saturday Sept. 11, 2021 22:12:33 CET +-- License : GPLv3 +-- Description : cmp plugin config file + +local cmp = require("cmp") +local luasnip = require("luasnip") + +local t = function(str) + return vim.api.nvim_replace_termcodes(str, true, true, true) +end + +local check_backspace = function() + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and + vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]: + sub(col, col):match('%s') == nil +end + +cmp.setup { + completion = { + autocomplete = false + }, + sources = { + { name = "path" }, + { name = "buffer" }, + { name = "nvim_lsp" }, + { name = "nvim_lua" }, + { name = "treesitter" }, + { name = "calc" }, + { name = "spell" }, + }, + formatting = { + format = function(entry, vim_item) + vim_item.menu = ({ + nvim_lsp = "[lsp]", + nvim_lua = "[nvim]", + path = "[path]", + buffer = "[buff]", + calc = "[calc]", + spell = "[spel]", + treesitter = "[tree]", + })[entry.source.name] + return vim_item + end, + }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + mapping = { + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.close(), + [""] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + [""] = cmp.mapping(function(fallback) + if vim.fn.pumvisible() == 1 then + vim.fn.feedkeys(t "", "n") + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif check_backspace() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if vim.fn.pumvisible() == 1 then + vim.fn.feedkeys(t "", "n") + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + } +} diff --git a/.config/nvim/lua/plugin/compe.lua b/.config/nvim/lua/plugin/compe.lua deleted file mode 100644 index 0436288..0000000 --- a/.config/nvim/lua/plugin/compe.lua +++ /dev/null @@ -1,73 +0,0 @@ --- Author : swytch --- Created : Tuesday Mar 18, 2021 23:12:25 CET --- License : GPLv3 --- Description : compe plugin config file - -require("compe").setup { - enabled = true; - autocomplete = false; - debug = false; - min_length = 1; - preselect = "enable"; - throttle_time = 80; - source_timeout = 200; - incomplete_delay = 400; - max_abbr_width = 100; - max_kind_width = 10; - max_menu_width = 100; - documentation = true; - - source = { - path = {menu = " [path]"}, - buffer = {menu = " [buff]"}, - calc = {menu = " [calc]"}, - -- vsnip = {menu = " [snip]"}, - nvim_lsp = {menu = " [LSP]"}, - nvim_lua = {menu = " [nvim]"}, - spell = {menu = " [spel]"}, - tags = false, - treesitter = {menu = " [tree]"}, - }; -} - -local t = function(str) - return vim.api.nvim_replace_termcodes(str, true, true, true) -end - -local check_back_space = function() - local col = vim.fn.col('.') - 1 - if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then - return true - else - return false - end -end - --- Use (s-)tab to: ---- move to prev/next item in completion menuone ---- jump to prev/next snippet's placeholder -_G.tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" --- elseif vim.fn.call("vsnip#available", {1}) == 1 then --- return t "(vsnip-expand-or-jump)" - elseif check_back_space() then - return t "" - else - return vim.fn['compe#complete']() - end -end -_G.s_tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" --- elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then --- return t "(vsnip-jump-prev)" - else - return t "" - end -end - -vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) -vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 59e78ec..e002111 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -55,7 +55,19 @@ return require("packer").startup(function() } -- auto completion - use "hrsh7th/nvim-compe" + use { + "hrsh7th/nvim-cmp", + requires = { + "L3MON4D3/LuaSnip", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-calc", + "ray-x/cmp-treesitter", + "f3fora/cmp-spell" + } + } -- display colors directly in editor use { @@ -63,4 +75,6 @@ return require("packer").startup(function() cmd = "ColorizerToggle" } + -- ens + use "whonore/Coqtail" end) From 125404a49c1708959dd6700df5b2d998228f6dfd Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 12 Sep 2021 17:42:56 +0200 Subject: [PATCH 3/5] feat: change search color in neovim --- .local/src/polyjuice | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/src/polyjuice b/.local/src/polyjuice index 4136059..2596b02 160000 --- a/.local/src/polyjuice +++ b/.local/src/polyjuice @@ -1 +1 @@ -Subproject commit 41360594fd669ec9f4d09e552c77764dde302c3b +Subproject commit 2596b02be402dae70a915898edc9c4391805c489 From 4f202cd4cddd99a55ce94b895537545e3c00c890 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 12 Sep 2021 19:53:44 +0200 Subject: [PATCH 4/5] feat: unlock GPG for the whole session actually for a week, but hey. --- .config/gnupg/gpg-agent.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/gnupg/gpg-agent.conf b/.config/gnupg/gpg-agent.conf index 2d46bba..52cbff2 100644 --- a/.config/gnupg/gpg-agent.conf +++ b/.config/gnupg/gpg-agent.conf @@ -1,2 +1,3 @@ allow-preset-passphrase -max-cache-ttl 86400 +default-cache-ttl 604800 +max-cache-ttl 604800 From 10ba59d43fef83c93fc76801ec801b6eda260f91 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sun, 12 Sep 2021 19:54:27 +0200 Subject: [PATCH 5/5] feat: introducce ncmpc ncmpccp is broken, so this is a temporary backup plan --- .config/ncmpc/config | 187 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 .config/ncmpc/config diff --git a/.config/ncmpc/config b/.config/ncmpc/config new file mode 100644 index 0000000..61567f9 --- /dev/null +++ b/.config/ncmpc/config @@ -0,0 +1,187 @@ +## +## Configuration file for ncmpc (~/.config/ncmpc/config) +## + +############## Connection ################### +## Connect to mpd running on a specified host +#host = "localhost" + +## Connect to mpd on the specified port. +#port = 6600 + +## Connect to mpd using the specified password. +#password = "secret" + +## Reconnect after NUM seconds of MPD not responding. +#timeout = 5 + +############## Interface #################### +## Enable mouse support (if enabled at compile time). +#enable-mouse = no + +# Which tags shall be grouped on the library page? +#library-page-tags = artist album + +## A list of screens to cycle through when using +## the previous/next screen commands (tab and shift+tab). +## names: playlist browse help library search song keydef lyrics outputs chat +screen-list = playlist browse + +## Default search mode for the search screen. The mode is an +## integer index, with 0 for title, 1 for artist, 2 for album, +## 3 for filename, and 4 for artist+title. +#search-mode = 0 + +## Auto center (center the playing track in the playlist) +auto-center = yes + +## Keep at least NUM lines above and below the cursor on list windows, if possible. +scroll-offset = 4 + +## Show the most recent query when using find. +#find-show-last = no + +## Wrapped find mode. +#find-wrap = yes + +## Wrapped cursor movement. +#wrap-around = no + +## Ring bell when find wraps around. +#bell-on-wrap = yes + +## Sound audible bell on alerts. +#audible-bell = yes + +## Enable visible bell on alerts. +#visible-bell = no + +## Default crossfade time in seconds. +#crossfade-time = 10 + +## Seek forward/backward by NUM seconds. +#seek-time = 1 + +## Quits downloading lyrics of a song after the timeout of NUM seconds is reached, if NUM is greater than zero. +#lyrics-timeout = 60 + +############## Display ###################### +## Show a list of the screens in the top line. +#welcome-screen-list = yes + +## Make the cursor as wide as the screen. +#wide-cursor = yes + +## Use the terminal's hardware cursor instead of inverse colors +#hardware-cursor = yes + +## Hide playlist cursor after x seconds (0 disables this feature). +#hide-cursor = 5 + +## Scroll the title if it is too long for the screen. +scroll = yes + +## The separator to show at the end of the scrolling title. +scroll-sep = " *** " + +## list-format +## The format used to display songs in the main window. +#list-format = "%name%|[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]" + +## The format used to display songs in the search window. +#search-format = "%name%|[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]" + +## The format used to display songs on the status line. +#status-format = "[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]" + +## The time, in seconds, for which status messages will be displayed. +#status-message-time = 3 + +## Sets whether to display remaining or elapsed time in +## the status window. Default is elapsed. +#timedisplay-type = elapsed + +## Show the bitrate in the status bar when playing a stream. +#visible-bitrate = no + +## Change the XTerm title (ncmpc will not restore the title). +#set-xterm-title = no + +## The format used to for the xterm title when ncmpc is playing. +#xterm-title-format = "ncmpc: [%name%|[[%artist%|%performer%|%composer%] - ][%title%|%shortfile%]]" + +## Automatically save the lyrics after receiving them. +#lyrics-autosave = no + +## Show the name of the plugin used to receive lyrics on the lyrics screen. +#lyrics-show-plugin = no + +## The text editor used for editing lyrics. +#text-editor = emacs + +## Ask before starting an editor. +#text-editor-ask = yes + +## The prefix of chat messages +#chat-prefix = " " + +## Display song length in second column +#second-column = yes + +############## Colors ####################### +## colors: none, black, red, green, yellow, blue, magenta, cyan, white +## attributes: standout, underline, reverse, blink, dim, bold +## +## Colors can also be given as an integer representing a terminal specific +## color code. The special color, none, represents the terminals default color. + +## Enable/disable colors. +#enable-colors = no + +## Set the background color. +#color background = black + +## Set the text color for the title row. +color title = white/black + +## Set the text color for the title row (the bold part). +#color title-bold = yellow,bold + +## Set the color of the line on the second row. +#color line = white + +## Set the text color used to indicate mpd flags on the second row. +#color line-flags = white,bold + +## Set the text color in the main area of ncmpc. +#color list = yellow + +## Set the bold text color in the main area of ncmpc. +#color list-bold = green,bold + +## Sets the text color of directories in the browser +#color browser-directory = yellow + +## Sets the text color of playlists in the browser +#color browser-playlist = red + +## Set the color of the progress indicator. +color progressbar = blue/black + +## Set the text color used to display mpd status in the status window. +color status-state = yellow,bold/black + +## Set the text color used to display song names in the status window. +color status-song = green,bold/black + +## Set the text color used to display time the status window. +#color status-time = red + +## Text color used to display alerts in the status window. +#color alert = red,bold + +## Redefine any of the base colors. +## The RGB values must be an integer value between 0 and 1000. +## Note: Only some terminals allow redefinitions of colors! +#colordef yellow = 255, 140, 0 +