1
0
Fork 0

nvim: remove osc52; use native impl

This commit is contained in:
Daniel Kempkens 2023-11-17 00:12:19 +01:00
parent 36ed158036
commit 3a73c1936d
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
8 changed files with 43 additions and 69 deletions

View file

@ -363,11 +363,11 @@
},
"nixos-unstable": {
"locked": {
"lastModified": 1700083842,
"narHash": "sha256-uC5v4VyUPgC5L3zv7e9q6+TRCm+eiA+Ow5vcH67ef/I=",
"lastModified": 1700130609,
"narHash": "sha256-pFtz286KaVHUmBOQztMNSgvT7hxcDe409vnDJxWQH7A=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9008bc4eb62c878d0812105ea1b34255d651df88",
"rev": "54f00576aa6139a9d54062d0edc2fb31423f0ffb",
"type": "github"
},
"original": {
@ -379,11 +379,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1700076579,
"narHash": "sha256-iMsZCHbMArLfg9pP5xzSSQf0/IvQ9kAAQ4w0a3sQtn8=",
"lastModified": 1700108881,
"narHash": "sha256-+Lqybl8kj0+nD/IlAWPPG/RDTa47gff9nbei0u7BntE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "61202fc8677a6e9e0a82eb6610eeef28852fc790",
"rev": "7414e9ee0b3e9903c24d3379f577a417f0aae5f1",
"type": "github"
},
"original": {

View file

@ -59,6 +59,9 @@
(set o.swapfile false)
(set o.undofile true)
(set o.undodir (.. (os.getenv :HOME) :/.local/share/nvim/undo//))
;; Clipboard
(let [clipboard (require :nifoc.clipboard)]
(clipboard.setup))
;; Theme
(let [theme (require :nifoc.theme)]
(theme.setup))

View file

@ -0,0 +1,18 @@
(let [mod {}
osc52 (require :vim.ui.clipboard.osc52)
uname (vim.loop.os_uname)
clip-name :nifocClipboard]
(fn mod.setup []
(if (= uname.sysname :Darwin)
(set vim.g.clipboard {:name clip-name
:copy {:+ osc52.copy :* osc52.copy}
:paste {:+ :pbpaste :* :pbpaste}
:cache_enabled 0})
;; Other OS
(set vim.g.clipboard
{:name clip-name
:copy {:+ osc52.copy :* osc52.copy}
:paste {:+ osc52.paste :* osc52.paste}}))
(vim.opt.clipboard:prepend :unnamedplus))
mod)

View file

@ -1,25 +0,0 @@
(let [osc52 (require :osc52)
uname (vim.loop.os_uname)
clip-name :nifocClipboard]
(osc52.setup {:silent true})
(fn copy [lines _]
(-> lines
(table.concat "\n")
(osc52.copy)))
(fn paste []
[(vim.fn.split (vim.fn.getreg "") "\n") (vim.fn.getregtype "")])
(if (= uname.sysname :Darwin)
(set vim.g.clipboard {:name clip-name
:copy {:+ :pbcopy :* :pbcopy}
:paste {:+ :pbpaste :* :pbpaste}
:cache_enabled 0})
;; Other OS
(set vim.g.clipboard {:name clip-name
:copy {:+ copy :* copy}
:paste {:+ paste :* paste}
:cache_enabled 0}))
(vim.opt.clipboard:prepend :unnamedplus))

View file

@ -123,12 +123,6 @@ in
}
# Keybindings
{
plugin = nvim-osc52;
config = builtins.readFile ../../config/nvim/plugins/osc52.fnl;
type = "fennel";
}
{
plugin = yanky-nvim;
config = builtins.readFile ../../config/nvim/plugins/yanky.fnl;
@ -318,7 +312,7 @@ in
xdg.configFile."nvim" = {
source = pkgs.runCommand "nvim-fennel-files"
{
nativeBuildInputs = with pkgs; [ luajitPackages.fennel stylua ];
nativeBuildInputs = with pkgs; [ luajitPackages.fennel ];
} ''
mkdir -p $out/lua/configuration
mkdir -p $out/lua/nifoc/utils
@ -384,8 +378,6 @@ in
# Other
echo "Copying tree-sitter queries ..."
cp -r "$after_store_path/queries" "$out/after/"
stylua "$out/"
'';
recursive = true;
};

View file

@ -60,17 +60,6 @@ in
fetchSubmodules = false;
};
};
nvim-osc52 = buildVimPlugin {
pname = "nvim-osc52";
version = "2023-11-12";
src = fetchFromGitHub {
owner = "ojroques";
repo = "nvim-osc52";
rev = "89307570b3bffe115d8b6b6fd3a4066cde0ba2d7";
sha256 = "0alsh1r6c5b8zf3jcymmrp921mmmhvws38ih9hbw5yffcy0lqhl2";
fetchSubmodules = false;
};
};
yanky-nvim = buildVimPlugin {
pname = "yanky.nvim";
version = "2023-11-03";
@ -99,8 +88,8 @@ in
src = fetchFromGitHub {
owner = "gbprod";
repo = "substitute.nvim";
rev = "00b7b71a4d767babec04b1ca72b4d1b7e7a76d58";
sha256 = "07ig248gxc241zv5x5cv2kr4sbqbb84ylgcb4pivp1pbnqcv8csj";
rev = "9849a0d5bf321b065061c585fa1a949ca6c0f04f";
sha256 = "1m3l18xzq46q6g01qr3wyghff59kfnwxzhaf5rf20iczm3lz357b";
fetchSubmodules = false;
};
};
@ -117,12 +106,12 @@ in
};
nvim-treesitter = buildVimPlugin {
pname = "nvim-treesitter";
version = "2023-11-15";
version = "2023-11-16";
src = fetchFromGitHub {
owner = "nvim-treesitter";
repo = "nvim-treesitter";
rev = "8b9f99660294dcd11d42572c84ee33a1e284f70d";
sha256 = "09mkkkirp922018dvci32p9mfsa2fqkv9b6nd1srwicxydx1wzp7";
rev = "73287b794d428843f20f9ae004bef2ce67ab3dbc";
sha256 = "1zwish3p06xn748kj56vwhn7hdfhx5b686aph2pmidfq61kp6r6d";
fetchSubmodules = false;
};
};
@ -139,12 +128,12 @@ in
};
rainbow-delimiters-nvim = buildVimPlugin {
pname = "rainbow-delimiters.nvim";
version = "2023-11-15";
version = "2023-11-16";
src = fetchFromGitHub {
owner = "HiPhish";
repo = "rainbow-delimiters.nvim";
rev = "ffb31befabb165812360ba70072e04c2101317d7";
sha256 = "1a4gwggn131zyiigv7zvpbriqs2f2z7kslds9xpc6rgskd873kkd";
rev = "538b4aec989e05e86dd42eccafa84f27733f9cf7";
sha256 = "0ajfq3i0sm2xdqmfjfykfyzlmr3lcc9myk7zq07sx25lj6qzz41q";
fetchSubmodules = false;
};
};
@ -274,12 +263,12 @@ in
};
nvim-lint = buildVimPlugin {
pname = "nvim-lint";
version = "2023-11-13";
version = "2023-11-16";
src = fetchFromGitHub {
owner = "mfussenegger";
repo = "nvim-lint";
rev = "4f2d968a827d86bb40b7b1fad28c11f7b764fef3";
sha256 = "0i60lyzhhnpzxi7k5dy4xacsg8mmc7ac8f8xwlbv32h8jqrblsab";
rev = "9e096df0858a1834ec2a60abe6cceb4d84dbd34c";
sha256 = "1hmlqcb7v45fl6541idf83zp1kcvv3qhx2shrz37rmhig38s9742";
fetchSubmodules = false;
};
};
@ -483,12 +472,12 @@ in
};
gitsigns-nvim = buildVimPlugin {
pname = "gitsigns.nvim";
version = "2023-10-26";
version = "2023-11-16";
src = fetchFromGitHub {
owner = "lewis6991";
repo = "gitsigns.nvim";
rev = "af0f583cd35286dd6f0e3ed52622728703237e50";
sha256 = "04qr0zm8cfrsf306jswah4cja8dsih3b41ikakcbvgq08qsngj86";
rev = "37d26d718f8120a8c5c107c580c8c98cf89fdf1f";
sha256 = "02w4xk0ps1swpj7fl73rxn15mf799ih04sx6k1wjrbxa5j3vwdqp";
fetchSubmodules = false;
};
};

View file

@ -5,7 +5,6 @@
- src: kyazdani42/nvim-web-devicons
- src: willothy/wezterm.nvim
# Keybindings
- src: ojroques/nvim-osc52
- src: gbprod/yanky.nvim
- src: gbprod/cutlass.nvim
- src: gbprod/substitute.nvim

View file

@ -35,7 +35,7 @@ in
xdg.configFile."wezterm" = {
source = pkgs.runCommand "wezterm-fennel-files"
{
nativeBuildInputs = with pkgs; [ lua53Packages.fennel stylua ];
nativeBuildInputs = with pkgs; [ lua53Packages.fennel ];
} ''
mkdir -p $out
@ -50,8 +50,6 @@ in
# Config
echo "Compiling config.fnl ..."
$fennel "$config_store_path/config.fnl" > "$out/config.lua"
stylua "$out/"
'';
recursive = true;
};