From 9a519e2eb5a81d8c75454cca535bc9f836fa0445 Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Thu, 19 May 2022 17:11:04 +0200 Subject: [PATCH] switch vim flavour to Neovim; reason: macOS clipboard support access to system clipboard was broken in command-line vim, the buffers "+ or "* were said not to exist and neither unnamed or unnamedplus clipboard settings were working. Aliases nvim to "vim" --- home/home.nix | 3 ++- home/overlays.nix | 10 ++++------ home/vimrc | 11 ++++------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/home/home.nix b/home/home.nix index ba4d362..2568e70 100644 --- a/home/home.nix +++ b/home/home.nix @@ -440,8 +440,9 @@ in ipb = "ip --color --brief"; ll = "ls -l"; wavesynth = "nix-shell -p sox --run 'play -n synth brownnoise synth pinknoise mix synth 0 0 0 15 40 80 trapezium amod 0.2 20'"; + vim = "nvim"; }; home.sessionVariables = { - EDITOR = "vim"; + EDITOR = "nvim"; }; } diff --git a/home/overlays.nix b/home/overlays.nix index 58a8333..617bf26 100644 --- a/home/overlays.nix +++ b/home/overlays.nix @@ -4,10 +4,8 @@ self: super: rec { #jami-ring-daemon = super.qt5.callPackage ./ov/jami/ring-daemon.nix {}; - myVim = with super; (vim_configurable.override { python = python3; }).customize { - # executable/ package name - name = "vim"; - vimrcConfig.packages.myVimPackage = with pkgs.vimPlugins; { + myVim = with super; neovim.override { configure = { + packages.myVimPackage = with pkgs.vimPlugins; { # loaded on start start = [ ale @@ -27,8 +25,8 @@ vim-jinja ]; }; - vimrcConfig.customRC = builtins.readFile ./vimrc; - }; + customRC = builtins.readFile ./vimrc; + };}; # build with debug symbols and in debug mode (less optimized) opencvDebug = with super; enableDebugging ((opencv3.override { enablePython = true; enableGtk3 = true; enableDocs = true; pythonPackages = pkgs.python3Packages; }).overrideAttrs (oldAttrs: rec { cmakeBuildType = "Debug"; })); #gnutls = super.callPackage ./ov/gnutls {inherit (super.darwin.apple_sdk.frameworks) Security;}; diff --git a/home/vimrc b/home/vimrc index ccda4d0..4226a8d 100644 --- a/home/vimrc +++ b/home/vimrc @@ -36,11 +36,8 @@ set incsearch set autoindent set history=1000 " set cursorline -if has("unnamedplus") - set clipboard=unnamedplus -elseif has("clipboard") - set clipboard=unnamed -endif +" use system clipboard as default buffer +set clipboard=unnamed " set expandtab set shiftwidth=4 @@ -101,7 +98,7 @@ au FileType nix setlocal tabstop=2 expandtab shiftwidth=2 softtabstop=2 set ofu=syntaxcomplete#Complete " nmap "+gP " imap a -vmap "+y +"vmap "+y " ALE linter settings let g:ale_linters = { 'python': ['flake8'] } @@ -109,4 +106,4 @@ let g:ale_linters = { 'python': ['flake8'] } " vim-pandoc settings let g:pandoc#modules#disabled = ["spell"] set textwidth=0 -set wrapmargin=0 \ No newline at end of file +set wrapmargin=0