From 4fc1ed07f396f7b4bfca50961e369a11b6606bc3 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Sun, 31 Jul 2022 22:08:31 +0200 Subject: [PATCH] nvim: OS-aware clipboard settings --- home/config/nvim/init.fnl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/home/config/nvim/init.fnl b/home/config/nvim/init.fnl index 96cd61f..d2e9be8 100644 --- a/home/config/nvim/init.fnl +++ b/home/config/nvim/init.fnl @@ -1,5 +1,6 @@ (let [o vim.opt - g vim.g] + g vim.g + uname (vim.loop.os_uname)] ;; Preamble (vim.cmd.filetype "plugin indent on") (set o.shell :/bin/sh) @@ -60,11 +61,13 @@ (set o.undofile true) (set o.undodir (.. (os.getenv :HOME) :/.local/share/nvim/undo//)) ;; Clipboard - (set g.clipboard {:name :pbcopy - :copy {:+ :pbcopy :* :pbcopy} - :paste {:+ :pbpaste :* :pbpaste} - :cache_enabled 0}) - (o.clipboard:prepend :unnamedplus) + (if (= uname.sysname :Darwin) + (do + (set g.clipboard {:name :pbcopy + :copy {:+ :pbcopy :* :pbcopy} + :paste {:+ :pbpaste :* :pbpaste} + :cache_enabled 0}) + (o.clipboard:prepend :unnamedplus))) ;; Theme (let [theme (require :nifoc.theme)] (theme.setup))