From 79e2954f4d8b21a98fdfe152f43af666721214a4 Mon Sep 17 00:00:00 2001 From: Henrik Bakken Date: Thu, 22 Feb 2024 20:13:38 +0100 Subject: [PATCH] nvim+ipython+zsh updates --- ipython/ipython_config.py | 3 -- nvim/init.lua | 60 ++++++++++++++++++++++++++++++--------- zsh/.zshrc | 1 + 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/ipython/ipython_config.py b/ipython/ipython_config.py index 5a95afc..6b502df 100644 --- a/ipython/ipython_config.py +++ b/ipython/ipython_config.py @@ -1,6 +1,3 @@ -c.InteractiveShellApp.extensions = ["autoreload"] -c.InteractiveShellApp.exec_lines = ["%autoreload 2"] - ## Use colors for displaying information about objects. Because this information # is passed through a pager (like 'less'), and some pagers get confused with # color codes, this capability can be turned off. diff --git a/nvim/init.lua b/nvim/init.lua index a1ff7d1..982d9bc 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -200,6 +200,7 @@ require("lazy").setup({ "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, config = function() + local noice_status = require("noice").api.status require("lualine").setup({ options = { theme = "auto", globalstatus = false }, extensions = { "fugitive" }, @@ -215,7 +216,18 @@ require("lazy").setup({ }, { "diff", colored = true }, }, - lualine_x = {}, + lualine_x = { + { + noice_status.command.get, + cond = noice_status.command.has, + color = { fg = "#ff9e64" }, + }, + { + noice_status.mode.get, + cond = noice_status.mode.has, + color = { fg = "#ff9e64" }, + }, + }, lualine_y = { "filetype", "progress" }, lualine_z = { "location" }, }, @@ -382,6 +394,7 @@ require("lazy").setup({ }, config = function() local cmp = require("cmp") + local compare = require("cmp.config.compare") cmp.setup({ sources = cmp.config.sources({ { name = "nvim_lsp" }, @@ -395,25 +408,44 @@ require("lazy").setup({ [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = false }), }), + matching = { + disallow_fuzzy_matching = true, + disallow_fullfuzzy_matching = true, + disallow_partial_fuzzy_matching = true, + disallow_partial_matching = true, + disallow_prefix_unmatching = false, + }, + sorting = { + priority_weight = 2, + comparators = { + compare.offset, + compare.exact, + -- compare.scopes, + compare.score, + compare.recently_used, + compare.locality, + compare.kind, + compare.sort_text, + compare.length, + compare.order, + }, + }, }) cmp.setup.cmdline(":", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = "path" } }, { { name = "cmdline" } }), }) - -- Set configuration for specific filetype. cmp.setup.filetype("gitcommit", { sources = cmp.config.sources({ { name = "cmp_git" }, -- You can specify the `cmp_git` source if you were installed it. }, { { name = "buffer" } }), }) - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - -- cmp.setup.cmdline({ "/", "?" }, { - -- mapping = cmp.mapping.preset.cmdline(), - -- sources = { { name = "buffer" } }, - -- }) + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { { name = "buffer" } }, + }) - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). cmp.setup.cmdline(":", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = "path" } }, { { name = "cmdline" } }), @@ -435,8 +467,14 @@ require("lazy").setup({ local actions = require("telescope.actions") map("n", "", "Telescope find_files layout_config={width=0.99}", opts) map("n", "", "Telescope git_files layout_config={width=0.99}", opts) - map("n", "", "Telescope diagnostics layout_strategy=vertical layout_config={width=0.99}", opts) + map( + "n", + "", + "Telescope diagnostics layout_strategy=vertical layout_config={width=0.99}", + opts + ) map("n", "", "Telescope live_grep layout_strategy=vertical layout_config={width=0.99}", opts) + map("n", "", ':lua require("telescope").extensions.live_grep_args.live_grep_args()', opts) map("n", "", "Telescope filetypes", opts) map("n", "", "Telescope search_history", opts) map("n", "", "Telescope colorscheme layout_config={width=0.5} enable_preview=1", opts) @@ -823,10 +861,6 @@ require("lazy").setup({ }, opts = { skip = true }, }, - { -- show 'recording @...' - filter = { event = "msg_showmode" }, - view = "notify", - }, { filter = { kind = "", min_height = 2 }, view = "split", diff --git a/zsh/.zshrc b/zsh/.zshrc index 893a6f5..9ab2eec 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -36,6 +36,7 @@ bindkey "^[[1;3C" forward-word # alt+right bindkey "^[[1;3D" backward-word # alt+left bindkey "[[3~" delete-char # delete bindkey "^[^?" backward-kill-word # alt+backspace +bindkey '^[[Z' reverse-menu-complete # substring search bindkey "^[[A" history-substring-search-up # up