1
0
Fork 0

add some surround plugin configuration

This commit is contained in:
Luca Bilke 2024-02-21 14:41:57 +01:00
commit 6fd3bab760
4 changed files with 762 additions and 736 deletions
.config/nvim
init.lua
lua
config
plugins/misc
.local/bin

View file

@ -4,4 +4,4 @@ require("lazy-init")
require("config.autocmds") require("config.autocmds")
require("config.filetypes") require("config.filetypes")
require("funcs").set_title() require("funcs").set_title()
require("funcs").set_maps(require("config.keymaps").maps) require("funcs").set_maps(require("config.keymaps").maps())

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,21 @@
local M = { "kylechui/nvim-surround" } local M = { "kylechui/nvim-surround" }
M.event = { "BufReadPost", "BufNewFile" } M.event = "VeryLazy"
M.config = true M.opts = {
keymaps = require("config.keymaps").surround,
surrounds = {
["B"] = {
add = { "{{ ", " }}" },
find = function()
return require("nvim-surround.config").get_selection({ motion = "2a}" })
end,
delete = "^(.. ?)().-( ?..)()$",
},
},
aliases = {
["B"] = false,
},
}
return M return M

View file

@ -3,11 +3,13 @@
# #
# TODO: detect existing repos and automatically modify config file accordingly # TODO: detect existing repos and automatically modify config file accordingly
# TODO: function to detect unclean working trees # TODO: function to detect unclean working trees
# TODO: Move update hooks to the actual .git/hooks directory # TODO: Handle cloning
# TODO: Handle pulling
# TODO: Trigger hooks on clone/pull
# #
print("This shit ain't done yet!"); print("This shit ain't done yet!\n");
exit; # exit;
use strict; use strict;
use warnings; use warnings;
@ -150,9 +152,6 @@ sub read_conf() {
# █ ████ ██ ████ ██ ██ ███ █ # █ ████ ██ ████ ██ ██ ███ █
# ████████████████████████████████████████ # ████████████████████████████████████████
# TODO: Handle cloning
# TODO: Handle pulling
# TODO: Trigger hooks on clone/pull
read_conf(); read_conf();
@ -179,12 +178,10 @@ foreach my $i ( keys @{ $conf{plugins} } ) {
$_ = `printf "$_"`; $_ = `printf "$_"`;
} }
foreach my $j ( keys @{ $plugin{targets} } ) { foreach my $j ( keys @{ $plugin{targets} } ) {
# FIX: $_[$j] is empty
$last_handle++; $last_handle++;
$handles[$last_handle]{plugin} = $i; $handles[$last_handle]{plugin} = $i;
print("$plugin{api_url}/$_[$j]/$plugin{endpoint}\n"); print("$plugin{api_url}/$plugin{targets}[$j]/$plugin{endpoint}\n");
set_curl( $last_handle, "$plugin{api_url}/$_[$j]/$plugin{endpoint}", set_curl( $last_handle, "$plugin{api_url}/$plugin{targets}[$j]/$plugin{endpoint}",
$plugin{extra_headers} ); $plugin{extra_headers} );
add_callback( $last_handle, \&dump ); add_callback( $last_handle, \&dump );
add_callback( $last_handle, \&json_decode ); add_callback( $last_handle, \&json_decode );