From ff9e47e96b28d5837b35abc84878def52c8c82d8 Mon Sep 17 00:00:00 2001 From: Philipp Hochkamp Date: Mon, 6 Mar 2023 21:27:28 +0100 Subject: [PATCH] update --- flake.lock | 4 +- flake.nix | 4 +- hm-imports/nvim/config/coc-settings.json | 29 -------------- hm-imports/nvim/config/lua/coc.lua | 16 ++++---- hm-imports/nvim/config/lua/keybindings.lua | 40 +++++++++++-------- hm-imports/nvim/config/lua/plugin/lualine.lua | 4 +- .../lua/plugin/{notice.lua => noice.lua} | 7 ++++ hm-imports/nvim/config/nvim.lua | 5 ++- hm-imports/nvim/default.nix | 19 ++++----- hm-imports/tmux/default.nix | 3 +- 10 files changed, 57 insertions(+), 74 deletions(-) rename hm-imports/nvim/config/lua/plugin/{notice.lua => noice.lua} (87%) diff --git a/flake.lock b/flake.lock index aea551b8..5d7e9655 100644 --- a/flake.lock +++ b/flake.lock @@ -360,7 +360,7 @@ "type": "github" } }, - "notice-nvim": { + "noice-nvim": { "flake": false, "locked": { "lastModified": 1677882849, @@ -493,7 +493,7 @@ "nixpkgs-darwin": "nixpkgs-darwin", "nixpkgs-master": "nixpkgs-master", "nnn-vim": "nnn-vim", - "notice-nvim": "notice-nvim", + "noice-nvim": "noice-nvim", "notify-nvim": "notify-nvim", "octoprint-spoolmanager": "octoprint-spoolmanager", "octoprint-telegram": "octoprint-telegram", diff --git a/flake.nix b/flake.nix index 97e08cae..12e92a2a 100644 --- a/flake.nix +++ b/flake.nix @@ -34,8 +34,8 @@ nnn-vim.flake = false; notify-nvim.url = "github:rcarriga/nvim-notify"; notify-nvim.flake = false; - notice-nvim.url = "github:folke/noice.nvim"; - notice-nvim.flake = false; + noice-nvim.url = "github:folke/noice.nvim"; + noice-nvim.flake = false; ## zsh zsh-completions.url = "github:zsh-users/zsh-completions"; diff --git a/hm-imports/nvim/config/coc-settings.json b/hm-imports/nvim/config/coc-settings.json index 6aa24b5c..7ae2aeb2 100644 --- a/hm-imports/nvim/config/coc-settings.json +++ b/hm-imports/nvim/config/coc-settings.json @@ -1,36 +1,7 @@ { - "suggest.triggerCompletionWait": 50, - "semanticTokens": { - "filetypes": ["nix"] - }, - "coc.preferences.formatOnSaveFiletypes": ["nix"], - "suggest.enablePreview": true, - "html.enable": true, - "python.linting.enabled": true, - "html.format.enable": true, - "html.suggest.html5": true, - "html.validate.html": true, - "html.validate.styles": true, - "diagnostic-languageserver.mergeConfig": true, - "diagnostic-languageserver.filetypes": { - "vim": "vint", - "sh": "shellcheck", - "markdown": "write-good" - }, - "diagnostic-languageserver.formatFiletypes": { - "sh": "shfmt" - }, - "tabnine.disable_filetypes": ["pandoc"], - "flutter.provider.hot-reload": true, - "flutter.provider.enableSnippet": true, - "snippets.ultisnips.direcories": ["snippets"], "rust-analyzer.procMacro.enable": true, - "rust-analyzer.cargo.allFeatures": true, - "rust-analyzer.inlayHints.refreshOnInsertMode": true, "rust-analyzer.updates.channel": "nightly", "html.validate.scripts": true, - "git.gitlab.hosts": ["gitlab.com"], - "git.addGBlameToVirtualText": true, "languageserver": { "nix": { "command": "nil", diff --git a/hm-imports/nvim/config/lua/coc.lua b/hm-imports/nvim/config/lua/coc.lua index f3043c7e..72fecd8c 100644 --- a/hm-imports/nvim/config/lua/coc.lua +++ b/hm-imports/nvim/config/lua/coc.lua @@ -169,18 +169,18 @@ vim.opt.statusline:prepend("%{coc#status()}%{get(b:,'coc_current_function','')}" ---@diagnostic disable-next-line: redefined-local local opts = {silent = true, nowait = true} -- Show all diagnostics -keyset("n", "a", ":CocList diagnostics", opts) +keyset("n", ",a", ":CocList diagnostics", opts) -- Manage extensions -keyset("n", "e", ":CocList extensions", opts) +keyset("n", ",e", ":CocList extensions", opts) -- Show commands -keyset("n", "c", ":CocList commands", opts) +keyset("n", ",c", ":CocList commands", opts) -- Find symbol of current document -keyset("n", "o", ":CocList outline", opts) +keyset("n", ",o", ":CocList outline", opts) -- Search workspace symbols -keyset("n", "s", ":CocList -I symbols", opts) +keyset("n", ",s", ":CocList -I symbols", opts) -- Do default action for next item -keyset("n", "j", ":CocNext", opts) +keyset("n", ",j", ":CocNext", opts) -- Do default action for previous item -keyset("n", "k", ":CocPrev", opts) +keyset("n", ",k", ":CocPrev", opts) -- Resume latest coc list -keyset("n", "p", ":CocListResume", opts) +keyset("n", ",p", ":CocListResume", opts) diff --git a/hm-imports/nvim/config/lua/keybindings.lua b/hm-imports/nvim/config/lua/keybindings.lua index e2029a78..64ce5cc9 100644 --- a/hm-imports/nvim/config/lua/keybindings.lua +++ b/hm-imports/nvim/config/lua/keybindings.lua @@ -1,14 +1,14 @@ local map = require('utils').map -- split binds -map { 'n', '', ':vertical resize -5', noremap = true, silent = true} -map { 'n', '', ':vertical resize +5', noremap = true, silent = true} -map { 'n', '', ':resize -5', noremap = true, silent = true} -map { 'n', '', ':resize +5', noremap = true, silent = true} +map { 'n', '', 'vertical resize -5', noremap = true, silent = true} +map { 'n', '', 'vertical resize +5', noremap = true, silent = true} +map { 'n', '', 'resize -5', noremap = true, silent = true} +map { 'n', '', 'resize +5', noremap = true, silent = true} map { 'n', '', ' =', noremap = true, silent = true} -map { 'n', '', ':vsp', noremap = true, silent = true} -map { 'n', '', ':split', noremap = true, silent = true} +map { 'n', '', 'vsp', noremap = true, silent = true} +map { 'n', '', 'split', noremap = true, silent = true} map { 'n', '', 'h', noremap = true, silent = true} map { 'n', '', 'j', noremap = true, silent = true} @@ -16,34 +16,40 @@ map { 'n', '', 'k', noremap = true, silent = true} map { 'n', '', 'l', noremap = true, silent = true} -- buffer binds -map { 'n', 'q', ':bd', noremap = false, silent = true} +map { 'n', 'q', 'bd', noremap = false, silent = true} -- telescope -map { 'n', 'fb', 'Telescope buffers', noremap = false, silent = true} -map { 'n', 'ff', 'Telescope find_files', noremap = false, silent = true} -map { 'n', 'fs', 'Telescope live_grep', noremap = false, silent = true} -map { 'n', 'fr', 'Telescope registers', noremap = false, silent = true} -map { 'n', 'pp', 'lua require\'telescope\'.extensions.projects.projects{}', noremap = false, silent = true} +map { 'n', 'b', 'Telescope buffers', noremap = false, silent = true} +--map { 'n', 'ff', 'Telescope find_files', noremap = false, silent = true} +map { 'n', 's', 'Telescope live_grep', noremap = false, silent = true} +map { 'n', '', 'Telescope registers', noremap = false, silent = true} +--map { 'n', 'pp', 'lua require\'telescope\'.extensions.projects.projects{}', noremap = false, silent = true} -- tab binds -map { 'n', '', ':tabnew', noremap = false, silent = true} +map { 'n', '', 'tabnew', noremap = false, silent = true} +map { 'n', '', 'tabprevious', noremap = false, silent = true} +map { 'n', '', 'tabnext', noremap = false, silent = true} -- copy paste map { 'v', '', '"+y', noremap = true, silent = true} -map { 'n', '', '"+P', noremap = false, silent = true} +--map { 'n', '', '"+P', noremap = false, silent = true} -- sudo :w map { 'c', 'w!!', 'w !sudo tee > /dev/null %', noremap = false, silent = false} +-- vimspector +map { 'n', 'di', 'VimspectorBalloonEval', noremap = false, silent = false } +map { 'x', 'di', 'VimspectorBalloonEval', noremap = false, silent = false } -- terminal -- map { 'n', 't', ':term', noremap = false, silent = true} -- map { 't', '', '', noremap = true, silent = true} -- plugins - commentary -map { 'n', 'c', ':Commentary', noremap = false, silent = true} +map { 'n', 'c', 'Commentary', noremap = false, silent = true} -- plugins - vista -map { 'n', 'v', ':Vista!!', noremap = false, silent = true} +map { 'n', 'v', 'Vista!!', noremap = false, silent = true} -- plugins - nnn -map { 'n', '', '::NnnPicker %:p:h', noremap = true, silent = true} +map { 'n', '', ':NnnPicker %:p:h', noremap = true, silent = true} +map { 'n', '', ':NnnExplorer %:p:h', noremap = true, silent = true} -- plugins - terminal map {"n", "gg", "lua _lazygit_toggle()", {noremap = true, silent = true}} diff --git a/hm-imports/nvim/config/lua/plugin/lualine.lua b/hm-imports/nvim/config/lua/plugin/lualine.lua index 6baeafcf..cec15262 100644 --- a/hm-imports/nvim/config/lua/plugin/lualine.lua +++ b/hm-imports/nvim/config/lua/plugin/lualine.lua @@ -2,8 +2,8 @@ require('lualine').setup { options = { icons_enabled = true, theme = 'gruvbox', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, + --component_separators = { left = '', right = ''}, + --section_separators = { left = '', right = ''}, disabled_filetypes = {}, always_divide_middle = true, }, diff --git a/hm-imports/nvim/config/lua/plugin/notice.lua b/hm-imports/nvim/config/lua/plugin/noice.lua similarity index 87% rename from hm-imports/nvim/config/lua/plugin/notice.lua rename to hm-imports/nvim/config/lua/plugin/noice.lua index 9b8e296a..938a4b10 100644 --- a/hm-imports/nvim/config/lua/plugin/notice.lua +++ b/hm-imports/nvim/config/lua/plugin/noice.lua @@ -7,6 +7,9 @@ require("noice").setup({ ["cmp.entry.get_documentation"] = true, }, }, + messages = { + view = "mini" + }, -- you can enable a preset for easier configuration presets = { bottom_search = true, -- use a classic bottom cmdline for search @@ -16,3 +19,7 @@ require("noice").setup({ lsp_doc_border = false, -- add a border to hover docs and signature help }, }) +require("notify").setup({ + stages = "static", + max_width = 70, + }) diff --git a/hm-imports/nvim/config/nvim.lua b/hm-imports/nvim/config/nvim.lua index 251d9a73..ae4ec326 100644 --- a/hm-imports/nvim/config/nvim.lua +++ b/hm-imports/nvim/config/nvim.lua @@ -7,11 +7,12 @@ require('filetypes') local opt = vim.opt -- load plugin luas (idk how to do that autmagically) +--require('plugin.treesitter') require('plugin.nnn') require('plugin.rainbow') require('plugin.terminal') require('plugin.project') -require('plugin.notice') +require('plugin.noice') require('plugin.telescope') @@ -20,9 +21,9 @@ require('plugin.telescope') require('coc') -- color stuff +opt.termguicolors = true -- 24bit color vim.g.gruvbox_italic = 1 vim.cmd ':colorscheme gruvbox' -opt.termguicolors = true -- 24bit color opt.background = 'dark' -- dark gruvbox --vimspector vim.g.vimspector_base_dir = vim.env.HOME .. "/.local/share/nvim/vimspector" diff --git a/hm-imports/nvim/default.nix b/hm-imports/nvim/default.nix index 4f6672b2..d8401f42 100644 --- a/hm-imports/nvim/default.nix +++ b/hm-imports/nvim/default.nix @@ -1,4 +1,4 @@ -{ pkgs, config, inputs, ... }: +{ pkgs, config, lib, inputs, ... }: { home.packages = with pkgs;[ python3 # ultisnips @@ -19,9 +19,6 @@ home.file.".config/nvim".source = ./config; home.file.".config/nvim".recursive = true; programs.neovim = - let - conf = inputs.self.nixosConfigurations.enterprise.config.programs.neovim.configure; - in { enable = true; package = pkgs.neovim-nightly; @@ -43,10 +40,10 @@ version = "1.0.0"; src = inputs.notify-nvim; }; - notice-nvim = pkgs.vimUtils.buildVimPlugin { - pname = "notice-nvim"; + noice-nvim = pkgs.vimUtils.buildVimPlugin { + pname = "noice-nvim"; version = "1.0.0"; - src = inputs.notice-nvim; + src = inputs.noice-nvim; }; #coc-nvim = pkgs.vimUtils.buildVimPlugin { # name = "coc-nvim"; @@ -81,12 +78,12 @@ undotree vim-pandoc vim-pandoc-syntax - ultisnips + #ultisnips #dart-vim - nvim-treesitter + nvim-treesitter.withAllGrammars notify-nvim - notice-nvim + noice-nvim nui-nvim @@ -106,7 +103,7 @@ #coc-vimtex #coc-vimlsp #coc-vetur # vue - coc-ultisnips + #coc-ultisnips coc-tsserver #coc-tslint-plugin #coc-tslint diff --git a/hm-imports/tmux/default.nix b/hm-imports/tmux/default.nix index b0410eca..9dc95a05 100644 --- a/hm-imports/tmux/default.nix +++ b/hm-imports/tmux/default.nix @@ -15,7 +15,8 @@ bind '"' split-window -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}" bind c new-window -c "#{pane_current_path}" - + set-option -g default-terminal "tmux-256color" + set -as terminal-overrides ',xterm*:Tc:sitm=\E[3m' ''; }; }