created a tokyo night theme for hyprland

This commit is contained in:
2025-04-08 16:55:15 +02:00
parent e03e073a6b
commit f8decdb9c4
26 changed files with 2968 additions and 230 deletions

View File

@@ -1,81 +0,0 @@
-- completion.lua
local has_cmp, cmp = pcall(require, 'cmp')
if not has_cmp then
print("Warning: nvim-cmp not found. Autocompletion won't be available.")
return
end
local has_luasnip, luasnip = pcall(require, 'luasnip')
if not has_luasnip then
print("Warning: luasnip not found. Snippet expansion won't be available.")
return
end
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept explicitly selected item
-- Tab support
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'path' },
}),
formatting = {
format = function(entry, vim_item)
-- Add icons
vim_item.menu = ({
nvim_lsp = "[LSP]",
luasnip = "[Snippet]",
buffer = "[Buffer]",
path = "[Path]",
})[entry.source.name]
return vim_item
end,
},
})
-- Enable command-line completion
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' },
{ name = 'cmdline' }
})
})
print("Completion system initialized!")

View File

@@ -1,26 +1,18 @@
-- lsp.lua
-- Install Mason first for managing servers
require("mason").setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
})
-- Connect Mason with lspconfig
require("mason-lspconfig").setup({
-- Automatically install these servers
ensure_installed = {
"lua_ls", -- Lua
"pyright", -- Python
"biome", -- TypeScript/JavaScript
"rust_analyzer", -- Rust
"gopls", -- Go
"clangd", -- C/C++
"bashls", -- Bash
"lua_ls", -- Lua
"pyright", -- Python
"biome", -- TypeScript/JavaScript
"rust_analyzer", -- Rust
"gopls", -- Go
"clangd", -- C/C++
"bashls", -- Bash
"emmet_language_server", -- Emmet
"somesass_ls", -- SASS
"hyprls", -- Hyprlang
},
automatic_installation = true,
})

View File

@@ -0,0 +1,10 @@
-- Install Mason first for managing servers
require("mason").setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
})

View File

@@ -1,56 +0,0 @@
-- telescope.lua
-- Check if telescope is available
local has_telescope, telescope = pcall(require, "telescope")
if not has_telescope then
print("Warning: telescope not found. Fuzzy finding won't be available.")
return
end
-- Set up telescope with error handling
local setup_ok, _ = pcall(telescope.setup, {
defaults = {
prompt_prefix = "🔍 ",
selection_caret = " ",
path_display = { "truncate" },
layout_config = {
horizontal = {
preview_width = 0.55,
results_width = 0.8,
},
width = 0.87,
height = 0.80,
preview_cutoff = 120,
},
file_ignore_patterns = {
"node_modules/",
".git/",
".DS_Store"
},
},
extensions = {
-- Configure any extensions here
}
})
if not setup_ok then
print("Error setting up telescope. Some features might not work correctly.")
return
end
-- Load telescope extensions if available
pcall(function() require('telescope').load_extension('fzf') end)
-- Useful Telescope mappings with error handling
local builtin_ok, builtin = pcall(require, 'telescope.builtin')
if builtin_ok then
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = "Find files" })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = "Live grep" })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = "Buffers" })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = "Help tags" })
-- LSP-related searches
vim.keymap.set('n', '<leader>fd', builtin.lsp_definitions, { desc = "Find definitions" })
vim.keymap.set('n', '<leader>fr', builtin.lsp_references, { desc = "Find references" })
end
print("Fuzzy finder initialized!")