add hyprlang stuff

This commit is contained in:
2025-02-20 04:18:32 -08:00
parent f4e0406181
commit dc29310cf1
8 changed files with 105 additions and 32 deletions

View File

@@ -74,3 +74,17 @@ vim.api.nvim_create_autocmd({ "User" }, {
end,
})
-- }}}
-- {{{ Hyprlang LSP
vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, {
pattern = { "*.hl", "hypr*.conf" },
callback = function(event)
print(string.format("starting hyprls for %s", vim.inspect(event)))
vim.lsp.start({
name = "hyprlang",
cmd = { "hyprls" },
root_dir = vim.fn.getcwd(),
})
end,
})
--}}}

View File

@@ -6,6 +6,7 @@ local term_factory = term.term_factory
local term_toggle = term.term_toggle
local opts = { silent = true, noremap = true }
local nosilent = { noremap = true }
-- Leader key
vim.g.mapleader = " "
@@ -204,16 +205,22 @@ local lsp_mappings = {
local code_companion_mappings = {
{ mode = "n", key = "<leader>cp", cmd = ":vert Copilot panel<CR>", group = "Code" },
{ mode = "n", key = "<leader>oc", cmd = ":CodeCompanionChat Toggle<CR>", group = "Open" },
{ mode = "n", key = "<leader>Cc", cmd = ":CodeCompanionChat Toggle<CR>", group = "CodeCompanion" },
{ mode = "n", key = "<leader>Ci", cmd = ":CodeCompanion ", group = "CodeCompanion" },
{ mode = "n", key = "<leader>CT", cmd = ":CodeCompanionChat Toggle<CR>", group = "CodeCompanion" },
{ mode = "n", key = "<leader>Ca", cmd = ":CodeCompanionActions<CR>", group = "CodeCompanion" },
{ mode = "v", key = "<leader>Cc", cmd = ":CodeCompanionChat Add<CR>", group = "CodeCompanion" },
{ mode = "v", key = "<leader>Ci", cmd = ":CodeCompanion /buffer ", group = "CodeCompanion" },
{ mode = "v", key = "<leader>Ce", cmd = ":CodeCompanion /explain<CR>", group = "CodeCompanion" },
{ mode = "v", key = "<leader>Cf", cmd = ":CodeCompanion /fix<CR>", group = "CodeCompanion" },
{ mode = "v", key = "<leader>Cl", cmd = ":CodeCompanion /lsp<CR>", group = "CodeCompanion" },
{ mode = "v", key = "<leader>Ct", cmd = ":CodeCompanion /tests<CR>", group = "CodeCompanion" },
{ mode = "n", key = "<leader>Cc", cmd = ":CodeCompanionChat Toggle<CR>", group = "CodeCompanionChat" },
{ mode = "n", key = "<leader>Ci", cmd = ":CodeCompanion ", group = "Inline CodeCompanion", opts = nosilent },
{ mode = "n", key = "<leader>CT", cmd = ":CodeCompanionChat Toggle<CR>", group = "CodeCompanion Toggle" },
{ mode = "n", key = "<leader>Ca", cmd = ":CodeCompanionActions<CR>", group = "CodeCompanion Actions" },
{ mode = "v", key = "<leader>Cc", cmd = ":CodeCompanionChat Add<CR>", group = "CodeCompanion Add" },
{
mode = "v",
key = "<leader>Ci",
cmd = ":CodeCompanion /buffer ",
group = "CodeCompanion /buffer",
opts = nosilent,
},
{ mode = "v", key = "<leader>Ce", cmd = ":CodeCompanion /explain<CR>", group = "CodeCompanion /explain" },
{ mode = "v", key = "<leader>Cf", cmd = ":CodeCompanion /fix<CR>", group = "CodeCompanion /fix" },
{ mode = "v", key = "<leader>Cl", cmd = ":CodeCompanion /lsp<CR>", group = "CodeCompanion /lsp" },
{ mode = "v", key = "<leader>Ct", cmd = ":CodeCompanion /tests<CR>", group = "CodeCompanion /tests" },
}
-- }}}
@@ -391,12 +398,16 @@ local noice_mappings = {
-- {{{ ODIS Mappings
local odis_mappings = {
{ mode = "n", key = "<leader>dv", cmd = ':lua require("odis").show_documentation("vsplit")<CR>', group = "ODIS" },
{ mode = "n", key = "<leader>dh", cmd = ':lua require("odis").show_documentation("vsplit")<CR>', group = "ODIS" },
{ mode = "n", key = "<leader>db", cmd = ':lua require("odis").show_documentation("vsplit")<CR>', group = "ODIS" },
{ mode = "n", key = "<leader>dt", cmd = ':lua require("odis").show_documentation("vsplit")<CR>', group = "ODIS" },
{ mode = "n", key = "<leader>dt", cmd = ':lua require("odis").show_documentation("vsplit")<CR>', group = "ODIS" },
-- { mode = "n", key = "<leader>dc", cmd = 'require("odis").close_float()' },
{
mode = "n",
key = "<leader>dv",
cmd = ':lua require("odis").show_documentation("vsplit")<CR>',
group = "Vertical split",
},
{ mode = "n", key = "<leader>dh", cmd = ':lua require("odis").show_documentation("split")<CR>', group = "Split" },
{ mode = "n", key = "<leader>db", cmd = ':lua require("odis").show_documentation("buffer")<CR>', group = "Buffer" },
{ mode = "n", key = "<leader>dt", cmd = ':lua require("odis").show_documentation("tab")<CR>', group = "Tab" },
{ mode = "n", key = "<leader>df", cmd = ':lua require("odis").show_documentation("float")<CR>', group = "Float" },
}
-- }}}
@@ -407,7 +418,7 @@ local diffview_mappings = {
mode = "n",
key = "<leader>gdo",
cmd = ":DiffviewOpen<CR>",
group = "Git",
group = "DiffviewOpen",
},
{
@@ -537,4 +548,5 @@ add_to_whichkey(map_from_table(workspace_management_mappings))
add_to_whichkey(map_from_table(noice_mappings))
add_to_whichkey(map_from_table(odis_mappings))
add_to_whichkey(map_from_table(diffview_mappings))
add_to_whichkey(nil, { key = "<leader>dc", group = "Close" })
--}}}

View File

@@ -60,12 +60,3 @@ require("lazy").setup({
require = false,
},
})
vim.cmd("colorscheme catppuccin")
require("core.keymaps")
require("core.lsp-notifications")
require("utils.extensions")
require("utils.telescope_extra").setup()
require("utils.git_paste").setup({
telescope_key = "<leader>pg",
})

View File

@@ -52,6 +52,9 @@ g.db_ui_use_nerd_fonts = 1
-- vim.cmd.colorscheme = 'catppuccin-macchiato'
vim.cmd.colorscheme = "catppuccin"
-- Define the highlight color for float border
vim.api.nvim_set_hl(0, "FloatBorder", { fg = "#89b4fa", bold = true })
local border = {
{ "", "FloatBorder" },
{ "", "FloatBorder" },

View File

@@ -3,19 +3,49 @@ return {
event = "VeryLazy",
opts = {
lsp = {
progress = {
enabled = true,
-- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin
-- See the section on formatting for more details on how to customize.
--- @type NoiceFormat|string
format = "lsp_progress",
--- @type NoiceFormat|string
format_done = "lsp_progress_done",
throttle = 1000 / 30, -- frequency to update lsp progress message
view = "mini",
},
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
},
hover = {
enabled = false,
silent = false, -- set to true to not show a message if hover is not available
view = "split", -- when nil, use defaults from documentation
---@type NoiceViewOptions
opts = {}, -- merged with defaults from documentation
},
signature = {
enabled = true,
auto_open = {
enabled = false,
trigger = true, -- Automatically show signature help when typing a trigger character from the LSP
luasnip = true, -- Will open signature help when jumping to Luasnip insert nodes
throttle = 50, -- Debounce lsp signature help request by 50ms
},
view = nil, -- when nil, use defaults from documentation
---@type NoiceViewOptions
opts = {}, -- merged with defaults from documentation
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = true, -- add a border to hover docs and signature help
},
},
@@ -26,5 +56,5 @@ return {
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
"rcarriga/nvim-notify",
}
},
}

View File

@@ -0,0 +1,12 @@
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.hyprlang = {
install_info = {
url = "~/github/tree-sitter-hyprlang", -- local path or git repo
files = { "src/parser.c" }, -- note that some parsers also require src/scanner.c or src/scanner.cc
-- optional entries:
branch = "main", -- default branch in case of git repo if different from master
generate_requires_npm = false, -- if stand-alone parser without npm dependencies
requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c
},
filetype = "conf", -- if filetype does not match the parser name
}