Merge branch 'master' into arch-desktop
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
# lua
|
||||
[language.lua.grammar.source.git]
|
||||
[lua.grammar.source.git]
|
||||
url = "https://github.com/tree-sitter-grammars/tree-sitter-lua"
|
||||
pin = "88e446476a1e97a8724dff7a23e2d709855077f2"
|
||||
|
||||
[language.lua.grammar]
|
||||
[lua.grammar]
|
||||
path = "src"
|
||||
compile = "cc"
|
||||
compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
|
||||
@@ -44,11 +44,11 @@ path = "runtime/queries/lua"
|
||||
# path = "runtime/queries/clojure"
|
||||
|
||||
#ocaml
|
||||
[language.ocaml.grammar.source.git]
|
||||
[ocaml.grammar.source.git]
|
||||
url = "https://github.com/tree-sitter/tree-sitter-ocaml"
|
||||
pin = "ef6ed4a773a260545f0b03c43d2ca78235e9a488"
|
||||
|
||||
[language.ocaml.grammar]
|
||||
[ocaml.grammar]
|
||||
path = "grammars/ocaml/src"
|
||||
compile = "cc"
|
||||
compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
|
||||
@@ -65,11 +65,11 @@ pin = "6bedca80646ce7350fb73029adf802ce7d9e241d"
|
||||
path = "runtime/queries/ocaml"
|
||||
|
||||
# typst
|
||||
[language.typst.grammar.source.git]
|
||||
[typst.grammar.source.git]
|
||||
url = "https://github.com/uben0/tree-sitter-typst"
|
||||
pin = "46cf4ded12ee974a70bf8457263b67ad7ee0379d"
|
||||
|
||||
[language.typst.grammar]
|
||||
[typst.grammar]
|
||||
path = "src"
|
||||
compile = "cc"
|
||||
compile_args = ["-c", "-fpic", "../scanner.c", "../parser.c", "-I", ".."]
|
||||
@@ -86,11 +86,11 @@ pin = "46cf4ded12ee974a70bf8457263b67ad7ee0379d"
|
||||
path = "queries/typst"
|
||||
|
||||
# swift
|
||||
[language.swift.grammar.source.git]
|
||||
[swift.grammar.source.git]
|
||||
url = "https://github.com/alex-pinkus/tree-sitter-swift"
|
||||
pin = "57c1c6d6ffa1c44b330182d41717e6fe37430704"
|
||||
|
||||
[language.swift.grammar]
|
||||
[swift.grammar]
|
||||
path = "src"
|
||||
compile = "cc"
|
||||
compile_args = ["-c", "-fpic", "../scanner.c", "-I", ".."]
|
||||
|
||||
@@ -112,39 +112,6 @@ add-highlighter global/ wrap -word -indent
|
||||
# }
|
||||
# }
|
||||
|
||||
# hook global -group autofmt BufSetOption filetype=(javascript) %{
|
||||
# set-option buffer formatcmd 'prettier --tab-width 4 --parser typescript'
|
||||
#
|
||||
# hook -group autofmt buffer BufOpenFile .* %{
|
||||
# format
|
||||
# }
|
||||
#
|
||||
# hook -group autofmt buffer BufWritePre .* %{
|
||||
# format
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# hook global -group autofmt BufSetOption filetype=(go) %{
|
||||
# set-option buffer formatcmd 'gofmt'
|
||||
#
|
||||
# hook -group autofmt buffer BufOpenFile .* %{
|
||||
# format
|
||||
# }
|
||||
#
|
||||
# hook -group autofmt buffer BufWritePre .* %{
|
||||
# format
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# define-command disable-autofmt -docstring 'disable autoformatting of buffer' %{
|
||||
# remove-hooks global autofmt
|
||||
# }
|
||||
#
|
||||
# enable-autofmt
|
||||
#
|
||||
#
|
||||
#
|
||||
## Indentation ##
|
||||
set global tabstop 4
|
||||
set global indentwidth 4
|
||||
@@ -453,7 +420,7 @@ define-command -docstring 'paste from clipboard' xpaste %{
|
||||
|
||||
declare-user-mode config
|
||||
map -docstring 'enter config mode' global user e ':enter-user-mode config<ret>'
|
||||
map -docstring 'edit kakoune config' global config k ':cd ~/.config/kak/<ret>:e ./kakrc<ret>'
|
||||
map -docstring 'edit kakoune config' global config k ':e ~/.config/kak/kakrc<ret>'
|
||||
map -docstring 'edit tmux config' global config t ':e ~/.tmux.conf<ret>'
|
||||
map -docstring 'edit bash config' global config b ':e ~/.bashrc<ret>'
|
||||
map -docstring 'edit scripts folder' global config s ':cd ~/.scripts<ret>:fzf-edit<ret>'
|
||||
|
||||
@@ -5,7 +5,7 @@ end
|
||||
|
||||
setnx('<leader>ff', Snacks.picker.files, 'Find files')
|
||||
setnx('<leader>f/', Snacks.picker.grep_word, 'Search current word')
|
||||
setnx('<leader>f?', Snacks.picker.grep, 'Search in files')
|
||||
setnx('<leader>fg', Snacks.picker.grep, 'Search in files')
|
||||
setnx('<leader>fr', Snacks.picker.recent, 'Find recent files')
|
||||
setnx('<leader>b', Snacks.picker.buffers, 'List buffers')
|
||||
setnx('<leader>h', Snacks.picker.help, 'Search help')
|
||||
@@ -42,7 +42,7 @@ setnx('`', '\'', 'Goto mark without column')
|
||||
|
||||
setnx('<leader>x', '<CMD>bd!<CR>', 'Close Current Buffer')
|
||||
|
||||
setnx('grR', Snacks.picker.lsp_references, 'Search lsp references')
|
||||
setnx('grr', Snacks.picker.lsp_references, 'Search lsp references')
|
||||
-- setnx('grI', tele.lsp_incoming_calls, 'Find incoming function calls')
|
||||
-- setnx('grO', tele.lsp_outgoing_calls, 'Find outgoing function calls')
|
||||
setnx('grd', Snacks.picker.diagnostics, 'Show LSP diagnostics')
|
||||
|
||||
@@ -71,6 +71,9 @@ return {
|
||||
},
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = {
|
||||
trigger = {
|
||||
show_on_insert = true
|
||||
},
|
||||
documentation = { auto_show = false },
|
||||
list = {
|
||||
selection = {
|
||||
|
||||
@@ -8,6 +8,14 @@ return {
|
||||
config = function()
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
}
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = false,
|
||||
|
||||
@@ -17,7 +17,7 @@ return {
|
||||
},
|
||||
|
||||
{
|
||||
"sindrets/diffview.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
event = 'VeryLazy',
|
||||
},
|
||||
|
||||
@@ -157,6 +157,10 @@ return {
|
||||
-- `z` key
|
||||
{ mode = 'n', keys = 'z' },
|
||||
{ mode = 'x', keys = 'z' },
|
||||
|
||||
-- Localleader
|
||||
{ mode = 'n', keys = '<Localleader>'},
|
||||
{ mode = 'x', keys = '<Localleader>'},
|
||||
},
|
||||
|
||||
clues = {
|
||||
@@ -189,6 +193,8 @@ return {
|
||||
triggers = {
|
||||
{ 'g', mode = { 'n', 'x' } },
|
||||
},
|
||||
skip_confirm_for_simple_edits = true,
|
||||
prompt_save_on_select_new_entry = false,
|
||||
},
|
||||
-- Optional dependencies
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||
@@ -245,85 +251,98 @@ return {
|
||||
event = 'VeryLazy',
|
||||
},
|
||||
|
||||
-- {
|
||||
-- "jake-stewart/multicursor.nvim",
|
||||
-- branch = "1.0",
|
||||
-- config = function()
|
||||
-- local mc = require("multicursor-nvim")
|
||||
-- mc.setup()
|
||||
--
|
||||
-- local set = vim.keymap.set
|
||||
--
|
||||
-- -- Add or skip cursor above/below the main cursor.
|
||||
-- set({"n", "x"}, "<up>", function() mc.lineAddCursor(-1) end)
|
||||
-- set({"n", "x"}, "<down>", function() mc.lineAddCursor(1) end)
|
||||
-- -- set({"n", "x"}, "<leader><up>", function() mc.lineSkipCursor(-1) end)
|
||||
-- -- set({"n", "x"}, "<leader><down>", function() mc.lineSkipCursor(1) end)
|
||||
--
|
||||
-- -- Add or skip adding a new cursor by matching word/selection
|
||||
-- -- set({"n", "x"}, "<leader>n", function() mc.matchAddCursor(1) end)
|
||||
-- -- set({"n", "x"}, "<leader>s", function() mc.matchSkipCursor(1) end)
|
||||
-- -- set({"n", "x"}, "<leader>N", function() mc.matchAddCursor(-1) end)
|
||||
-- -- set({"n", "x"}, "<leader>S", function() mc.matchSkipCursor(-1) end)
|
||||
--
|
||||
-- -- Add cursor at next argument treesitter
|
||||
-- set({'n', 'x'}, ']A', function()
|
||||
-- if vim.v.count < 1 then
|
||||
-- mc.addCursor(']a')
|
||||
-- else
|
||||
-- for i=1, vim.v.count - 1 do
|
||||
-- mc.addCursor(']a')
|
||||
-- end
|
||||
-- end
|
||||
-- end, { desc = 'Create multicursor on next argument'})
|
||||
-- set({'n', 'x'}, '[A', function()
|
||||
-- if vim.v.count < 1 then
|
||||
-- mc.addCursor('[a')
|
||||
-- else
|
||||
-- for i=1, vim.v.count - 1 do
|
||||
-- mc.addCursor('[a')
|
||||
-- end
|
||||
-- end
|
||||
-- end, { desc = 'Create multicursor on previous argument'})
|
||||
--
|
||||
-- -- Add and remove cursors with control + left click.
|
||||
-- set("n", "<c-leftmouse>", mc.handleMouse)
|
||||
-- set("n", "<c-leftdrag>", mc.handleMouseDrag)
|
||||
-- set("n", "<c-leftrelease>", mc.handleMouseRelease)
|
||||
--
|
||||
-- -- Disable and enable cursors.
|
||||
-- set({"n", "x"}, "<c-q>", mc.toggleCursor)
|
||||
--
|
||||
-- -- Mappings defined in a keymap layer only apply when there are
|
||||
-- -- multiple cursors. This lets you have overlapping mappings.
|
||||
-- mc.addKeymapLayer(function(layerSet)
|
||||
--
|
||||
-- -- Select a different cursor as the main one.
|
||||
-- layerSet({"n", "x"}, "<left>", mc.prevCursor)
|
||||
-- layerSet({"n", "x"}, "<right>", mc.nextCursor)
|
||||
--
|
||||
-- -- Delete the main cursor.
|
||||
-- layerSet({"n", "x"}, "<leader>x", mc.deleteCursor)
|
||||
--
|
||||
-- -- Enable and clear cursors using escape.
|
||||
-- layerSet("n", "<esc>", function()
|
||||
-- if not mc.cursorsEnabled() then
|
||||
-- mc.enableCursors()
|
||||
-- else
|
||||
-- mc.clearCursors()
|
||||
-- end
|
||||
-- end)
|
||||
-- end)
|
||||
--
|
||||
-- -- Customize how cursors look.
|
||||
-- local hl = vim.api.nvim_set_hl
|
||||
-- hl(0, "MultiCursorCursor", { reverse = true })
|
||||
-- hl(0, "MultiCursorVisual", { link = "Visual" })
|
||||
-- hl(0, "MultiCursorSign", { link = "SignColumn"})
|
||||
-- hl(0, "MultiCursorMatchPreview", { link = "Search" })
|
||||
-- hl(0, "MultiCursorDisabledCursor", { reverse = true })
|
||||
-- hl(0, "MultiCursorDisabledVisual", { link = "Visual" })
|
||||
-- hl(0, "MultiCursorDisabledSign", { link = "SignColumn"})
|
||||
-- end
|
||||
-- },
|
||||
{
|
||||
"jake-stewart/multicursor.nvim",
|
||||
branch = "1.0",
|
||||
config = function()
|
||||
local mc = require("multicursor-nvim")
|
||||
mc.setup()
|
||||
|
||||
local set = vim.keymap.set
|
||||
|
||||
-- Add or skip cursor above/below the main cursor.
|
||||
set({"n", "x"}, "<localleader>k", function() mc.lineAddCursor(-1) end, { desc = "Add cursor to previous line" })
|
||||
set({"n", "x"}, "<localleader>j", function() mc.lineAddCursor(1) end, { desc = "Add cursor to next line" })
|
||||
set({"n", "x"}, "<up>", function() mc.lineAddCursor(-1) end, { desc = "Add cursor to previous line" })
|
||||
set({"n", "x"}, "<down>", function() mc.lineAddCursor(1) end, { desc = "Add cursor to next line" })
|
||||
set({"n", "x"}, "<localleader>K", function() mc.lineSkipCursor(-1) end, { desc = "Skip previous line to add cursor" })
|
||||
set({"n", "x"}, "<localleader>J", function() mc.lineSkipCursor(1) end, { desc = "Skip next line to add cursor" })
|
||||
|
||||
-- Add or skip adding a new cursor by matching word/selection
|
||||
set({"n", "x"}, "<localleader>n", function() mc.matchAddCursor(1) end, { desc = "Add cursor to next currently selected word" })
|
||||
set({"n", "x"}, "<localleader>s", function() mc.matchSkipCursor(1) end, { desc = "Skip next instance of current word to add cursor" })
|
||||
set({"n", "x"}, "<localleader>N", function() mc.matchAddCursor(-1) end, { desc = "Add cursor to previous currently selected word" })
|
||||
set({"n", "x"}, "<localleader>S", function() mc.matchSkipCursor(-1) end, { desc = "Skip previous instance of current word to add cursor" })
|
||||
|
||||
set({"n", "x"}, "<localleader>m", mc.operator, { desc = "Add cursors to text object" })
|
||||
set("n", "<localleader>s", function()
|
||||
vim.ui.input({prompt = "Match: "}, function(input) mc.operator({pattern = input}) end)
|
||||
end, { desc = "Add cursors to regex match inside text object " })
|
||||
set("n", "<localleader>*", function()
|
||||
mc.operator({pattern = vim.fn.expand("<cword>")})
|
||||
end, { desc = "Add cursors to current word inside text object" })
|
||||
set("x", "<localleader>s", mc.matchCursors, { desc = "Add cursors to regex match inside visual selection" })
|
||||
|
||||
-- Add cursor at next argument treesitter
|
||||
set({'n', 'x'}, ']A', function()
|
||||
if vim.v.count < 1 then
|
||||
mc.addCursor(']a')
|
||||
else
|
||||
for _=1, vim.v.count - 1 do
|
||||
mc.addCursor(']a')
|
||||
end
|
||||
end
|
||||
end, { desc = 'Create multicursor on next argument'})
|
||||
set({'n', 'x'}, '[A', function()
|
||||
if vim.v.count < 1 then
|
||||
mc.addCursor('[a')
|
||||
else
|
||||
for _=1, vim.v.count - 1 do
|
||||
mc.addCursor('[a')
|
||||
end
|
||||
end
|
||||
end, { desc = 'Create multicursor on previous argument'})
|
||||
|
||||
-- Add and remove cursors with control + left click.
|
||||
set("n", "<c-leftmouse>", mc.handleMouse)
|
||||
set("n", "<c-leftdrag>", mc.handleMouseDrag)
|
||||
set("n", "<c-leftrelease>", mc.handleMouseRelease)
|
||||
|
||||
-- Disable and enable cursors.
|
||||
set({"n", "x"}, "<c-q>", mc.toggleCursor, { desc = "Toggle multiple cursors" })
|
||||
|
||||
-- Mappings defined in a keymap layer only apply when there are
|
||||
-- multiple cursors. This lets you have overlapping mappings.
|
||||
mc.addKeymapLayer(function(layerSet)
|
||||
|
||||
-- Select a different cursor as the main one.
|
||||
layerSet({"n", "x"}, "<localleader>h", mc.prevCursor, { desc = "Make previous cursor primary" })
|
||||
layerSet({"n", "x"}, "<localleader>l", mc.nextCursor, { desc = "Make next cursor primary" })
|
||||
layerSet({"n", "x"}, "<left>", mc.prevCursor, { desc = "Make previous cursor primary" })
|
||||
layerSet({"n", "x"}, "<right>", mc.nextCursor, { desc = "Make next cursor primary" })
|
||||
|
||||
-- Delete the main cursor.
|
||||
layerSet({"n", "x"}, "<localleader>x", mc.deleteCursor)
|
||||
|
||||
-- Enable and clear cursors using escape.
|
||||
layerSet("n", "<esc>", function()
|
||||
if not mc.cursorsEnabled() then
|
||||
mc.enableCursors()
|
||||
else
|
||||
mc.clearCursors()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Customize how cursors look.
|
||||
local hl = vim.api.nvim_set_hl
|
||||
hl(0, "MultiCursorCursor", { reverse = true })
|
||||
hl(0, "MultiCursorVisual", { link = "Visual" })
|
||||
hl(0, "MultiCursorSign", { link = "SignColumn"})
|
||||
hl(0, "MultiCursorMatchPreview", { link = "Search" })
|
||||
hl(0, "MultiCursorDisabledCursor", { reverse = true })
|
||||
hl(0, "MultiCursorDisabledVisual", { link = "Visual" })
|
||||
hl(0, "MultiCursorDisabledSign", { link = "SignColumn"})
|
||||
end
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user