update #16

Merged
jalil merged 2 commits from update into main 2024-07-02 09:52:58 +02:00
4 changed files with 227 additions and 103 deletions
Showing only changes of commit dc130e4723 - Show all commits

View file

@ -12,7 +12,12 @@ in {
group = "highlightOnYank"; group = "highlightOnYank";
event = "TextYankPost"; event = "TextYankPost";
pattern = "*"; pattern = "*";
callback = mkRaw '' callback =
mkRaw
/*
lua
*/
''
function() function()
vim.highlight.on_yank { vim.highlight.on_yank {
higroup = ( higroup = (
@ -27,7 +32,12 @@ in {
group = "restoreCursorPosition"; group = "restoreCursorPosition";
event = "BufReadPost"; event = "BufReadPost";
pattern = "*"; pattern = "*";
callback = mkRaw '' callback =
mkRaw
/*
lua
*/
''
function() function()
if vim.fn.line '\'"' > 0 and vim.fn.line '\'"' <= vim.fn.line '$' then if vim.fn.line '\'"' > 0 and vim.fn.line '\'"' <= vim.fn.line '$' then
vim.cmd [[execute "normal! g'\""]] vim.cmd [[execute "normal! g'\""]]
@ -42,7 +52,11 @@ in {
callback = let callback = let
opts = "noremap = true, buffer = bufnr"; opts = "noremap = true, buffer = bufnr";
in in
mkRaw '' mkRaw
/*
lua
*/
''
function(opts) function(opts)
local bufnr = opts.buf local bufnr = opts.buf
local client = vim.lsp.get_client_by_id(opts.data.client_id) local client = vim.lsp.get_client_by_id(opts.data.client_id)

View file

@ -51,99 +51,180 @@ in {
{ {
mode = "n"; mode = "n";
key = "<leader>dj"; key = "<leader>dj";
action = mkRaw "vim.diagnostic.goto_next"; action =
mkRaw
# lua
''
vim.diagnostic.goto_next
'';
options.desc = "Diagnostics next [J]"; options.desc = "Diagnostics next [J]";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>dk"; key = "<leader>dk";
action = mkRaw "vim.diagnostic.goto_prev"; action =
mkRaw
# lua
''
vim.diagnostic.goto_prev
'';
options.desc = "Diagnostics previous [K]"; options.desc = "Diagnostics previous [K]";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>xx"; key = "<leader>xx";
action = mkRaw "require('trouble').toggle"; action =
mkRaw
# lua
''
require('trouble').toggle
'';
options.desc = "Toggle trouble"; options.desc = "Toggle trouble";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>xw"; key = "<leader>xw";
action = mkRaw "function() require('trouble').toggle('workspace_diagnostics') end"; action =
mkRaw
# lua
''
function() require('trouble').toggle('workspace_diagnostics') end
'';
options.desc = "Toggle Workspace trouble"; options.desc = "Toggle Workspace trouble";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>xd"; key = "<leader>xd";
action = mkRaw "function() require('trouble').toggle('document_diagnostics') end"; action =
mkRaw
# lua
''
function() require('trouble').toggle('document_diagnostics') end
'';
options.desc = "Toggle Document trouble"; options.desc = "Toggle Document trouble";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>xq"; key = "<leader>xq";
action = mkRaw "function() require('trouble').toggle('quickfix') end"; action =
mkRaw
# lua
''
function() require('trouble').toggle('quickfix') end
'';
options.desc = "Toggle Quickfix trouble"; options.desc = "Toggle Quickfix trouble";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>xl"; key = "<leader>xl";
action = mkRaw "function() require('trouble').toggle('loclist') end"; action =
mkRaw
# lua
''
function() require('trouble').toggle('loclist') end
'';
options.desc = "Toggle Loclist trouble"; options.desc = "Toggle Loclist trouble";
} }
{ {
mode = "n"; mode = "n";
key = "gR"; key = "gR";
action = mkRaw "function() require('trouble').toggle('lsp_references') end"; action =
mkRaw
# lua
''
function() require('trouble').toggle('lsp_references') end
'';
options.desc = "Toggle lsp References trouble"; options.desc = "Toggle lsp References trouble";
} }
# Telescope # Telescope
{ {
mode = "n"; mode = "n";
key = "<leader>ff"; key = "<leader>ff";
action = mkRaw "require('telescope.builtin').find_files"; action =
mkRaw
# lua
''
require('telescope.builtin').find_files
'';
options.desc = "Find Files"; options.desc = "Find Files";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>fg"; key = "<leader>fg";
action = mkRaw "require('telescope.builtin').live_grep"; action =
mkRaw
# lua
''
require('telescope.builtin').live_grep
'';
options.desc = "Find Grep"; options.desc = "Find Grep";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>fh"; key = "<leader>fh";
action = mkRaw "require('telescope.builtin').help_tags"; action =
mkRaw
# lua
''
require('telescope.builtin').help_tags
'';
options.desc = "Find Help"; options.desc = "Find Help";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>fb"; key = "<leader>fb";
action = mkRaw "require('telescope.builtin').buffers"; action =
mkRaw
# lua
''
require('telescope.builtin').buffers
'';
options.desc = "Find Buffer"; options.desc = "Find Buffer";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>fd"; key = "<leader>fd";
action = mkRaw "require('telescope.builtin').diagnostics"; action =
mkRaw
# lua
''
require('telescope.builtin').diagnostics
'';
options.desc = "Find Diagnostics"; options.desc = "Find Diagnostics";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>fq"; key = "<leader>fq";
action = mkRaw "require('telescope.builtin').quickfix"; action =
mkRaw
# lua
''
require('telescope.builtin').quickfix
'';
options.desc = "Find Quickfix"; options.desc = "Find Quickfix";
} }
{ {
mode = "n"; mode = "n";
key = "<leader>w"; key = "<leader>w";
action = mkRaw "require('conform').format"; action =
mkRaw
# lua
''
require('conform').format
'';
options.desc = "Format buffer"; options.desc = "Format buffer";
} }
# Nvim Silicon # Nvim Silicon
{ {
mode = "v"; mode = "v";
key = "<leader>sc"; key = "<leader>sc";
action = mkRaw "require('nvim-silicon').clip"; action =
mkRaw
# lua
''
require('nvim-silicon').clip
'';
options.desc = "Snap Code (to clipboard)"; options.desc = "Snap Code (to clipboard)";
} }
]; ];

View file

@ -15,14 +15,28 @@ in {
enable = true; enable = true;
cmdline = { cmdline = {
"/" = { "/" = {
mapping = mkRaw "cmp.mapping.preset.cmdline()"; mapping =
mkRaw
/*
lua
*/
''
cmp.mapping.preset.cmdline()
'';
sources = [ sources = [
{name = "rg";} {name = "rg";}
{name = "buffer";} {name = "buffer";}
]; ];
}; };
":" = { ":" = {
mapping = mkRaw "cmp.mapping.preset.cmdline()"; mapping =
mkRaw
/*
lua
*/
''
cmp.mapping.preset.cmdline()
'';
sources = [ sources = [
{name = "path";} {name = "path";}
{name = "cmdline";} {name = "cmdline";}
@ -31,7 +45,13 @@ in {
}; };
settings = { settings = {
# Snippets # Snippets
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end"; snippet.expand =
/*
lua
*/
''
function(args) require('luasnip').lsp_expand(args.body) end
'';
# Completion Sources # Completion Sources
sources = [ sources = [
{ {
@ -83,7 +103,12 @@ in {
groupIndex = 1; groupIndex = 1;
} }
]; ];
mapping = mkRaw '' mapping =
mkRaw
/*
lua
*/
''
cmp.mapping.preset.insert({ cmp.mapping.preset.insert({
["<C-n>"] = function(fallback) ["<C-n>"] = function(fallback)
if cmp.visible() then if cmp.visible() then

View file

@ -55,7 +55,9 @@
pkgs.unstable.typos pkgs.unstable.typos
pkgs.unstable.yamlfmt pkgs.unstable.yamlfmt
]; ];
extraConfigLuaPre = '' extraConfigLuaPre =
# lua
''
-- Lua Pre Config -- Lua Pre Config
if vim.fn.has 'termguicolors' then if vim.fn.has 'termguicolors' then
-- Enable RGB colors -- Enable RGB colors
@ -71,7 +73,9 @@
end end
-- END: Lua Pre Config -- END: Lua Pre Config
''; '';
extraConfigLua = '' extraConfigLua =
# lua
''
-- Lua Config -- Lua Config
require("nvim-silicon").setup { require("nvim-silicon").setup {
theme = "gruvbox-dark", theme = "gruvbox-dark",