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

0
.config/nvim/lua/cmp.lua Normal file
View File

View File

@@ -1,21 +1,27 @@
local global = vim.g
local o = vim.opt
-- Basic settings
vim.o.number = true
vim.o.relativenumber = true
vim.o.tabstop = 2
vim.o.shiftwidth = 2
vim.o.expandtab = true
vim.o.smartindent = true
vim.o.wrap = false
vim.o.cursorline = true
vim.o.termguicolors = true
vim.o.ruler = true
vim.o.visualbell = true
vim.o.modelines = 0
vim.o.colorcolumn = '+1,100,120'
vim.o.hidden = true
vim.o.showmode = true
-- Editor options
-- Syntax highlighting and filetype plugins
vim.cmd('syntax enable')
vim.cmd('filetype plugin indent on')
o.number = true -- Print the line number in front of each line
o.relativenumber = true -- Show the line number relative to the line with the cursor in front of each line.
o.clipboard = "unnamedplus" -- uses the clipboard register for all operations except yank.
o.syntax = "on" -- When this option is set, the syntax with this name is loaded.
o.autoindent = true -- Copy indent from current line when starting a new line.
o.cursorline = true -- Highlight the screen line of the cursor with CursorLine.
o.expandtab = true -- In Insert mode: Use the appropriate number of spaces to insert a <Tab>.
o.shiftwidth = 2 -- Number of spaces to use for each step of (auto)indent.
o.tabstop = 2 -- Number of spaces that a <Tab> in the file counts for.
o.encoding = "UTF-8" -- Sets the character encoding used inside Vim.
o.ruler = true -- Show the line and column number of the cursor position, separated by a comma.
o.mouse = "a" -- Enable the use of the mouse. "a" you can use on all modes
o.title = true -- When on, the title of the window will be set to the value of 'titlestring'
o.hidden = true -- When on a buffer becomes hidden when it is |abandon|ed
o.ttimeoutlen = 0 -- The time in milliseconds that is waited for a key code or mapped key sequence to complete.
o.wildmenu = true -- When 'wildmenu' is on, command-line completion operates in an enhanced mode.
o.showcmd = true -- Show (partial) command in the last line of the screen. Set this option off if your terminal is slow.
o.showmatch = true -- When a bracket is inserted, briefly jump to the matching one.
o.inccommand = "split" -- When nonempty, shows the effects of :substitute, :smagic, :snomagic and user commands with the :command-preview flag as you type.
o.splitright = true
o.splitbelow = true -- When on, splitting a window will put the new window below the current one
o.termguicolors = true

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!")

View File

@@ -1,2 +1,2 @@
-- theme.lua
vim.cmd[[colorscheme deus]]
vim.cmd[[colorscheme tokyonight]]

View File

@@ -1,11 +0,0 @@
-- Autocompletion system
return {
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp", -- LSP source for nvim-cmp
"hrsh7th/cmp-buffer", -- Buffer source
"hrsh7th/cmp-path", -- Path source
"L3MON4D3/LuaSnip", -- Snippet engine
"saadparwaiz1/cmp_luasnip", -- Snippet source
},
}

View File

@@ -1,4 +0,0 @@
-- Color scheme
return {
"theniceboy/nvim-deus"
}

View File

@@ -2,8 +2,6 @@
return {
"neovim/nvim-lspconfig", -- Base LSP configurations
dependencies = {
-- Server installation manager
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
},
}
}
}

View File

@@ -0,0 +1,7 @@
return {
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
},
}

View File

@@ -1,5 +0,0 @@
-- Fuzzy finder
return {
"nvim-telescope/telescope.nvim",
dependencies = { "nvim-lua/plenary.nvim" }
}

View File

@@ -0,0 +1,6 @@
return {
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opt = {},
}