add some surround plugin configuration
This commit is contained in:
parent
887fa25cb3
commit
6fd3bab760
4 changed files with 762 additions and 736 deletions
|
|
@ -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())
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ M.sections = {
|
||||||
e = { desc = icons.FileTree .. " File Manager" },
|
e = { desc = icons.FileTree .. " File Manager" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
M.maps = function()
|
||||||
-- Standard --
|
-- Standard --
|
||||||
maps.n["j"] = { "v:count == 0 ? 'gj' : 'j'", expr = true, desc = "Move cursor down" }
|
maps.n["j"] = { "v:count == 0 ? 'gj' : 'j'", expr = true, desc = "Move cursor down" }
|
||||||
maps.n["k"] = { "v:count == 0 ? 'gk' : 'k'", expr = true, desc = "Move cursor up" }
|
maps.n["k"] = { "v:count == 0 ? 'gk' : 'k'", expr = true, desc = "Move cursor up" }
|
||||||
|
|
@ -743,7 +744,21 @@ if f.is_available("nvim-ufo") then
|
||||||
desc = "Peek fold",
|
desc = "Peek fold",
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
return maps
|
||||||
|
end
|
||||||
|
|
||||||
M.maps = maps
|
M.surround = {
|
||||||
|
insert = false,
|
||||||
|
insert_line = false,
|
||||||
|
normal = "ys",
|
||||||
|
normal_cur = "yss",
|
||||||
|
normal_line = "yS",
|
||||||
|
normal_cur_line = "ySS",
|
||||||
|
visual = "S",
|
||||||
|
visual_line = "gS",
|
||||||
|
delete = "ds",
|
||||||
|
change = "cs",
|
||||||
|
change_line = "cS",
|
||||||
|
}
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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 );
|
||||||
Loading…
Add table
Add a link
Reference in a new issue