new rebase (Technically)

This commit is contained in:
BalrajSinghGidda
2025-12-11 01:29:09 +05:30
parent 57c94a5075
commit 76b4e0b0c7
39 changed files with 2149 additions and 59 deletions

79
config/kitty/kitty.conf Normal file
View File

@@ -0,0 +1,79 @@
# Kitty Configuration - Gruvbox x Lilex Edition (Ballu-Mode)
# Font
font_family Lilex Nerd Font
bold_font Lilex Nerd Font
italic_font Lilex Nerd Font
bold_italic_font Lilex Nerd Font
font_size 20.0
# Cursor
cursor_shape block
cursor_blink yes
cursor_blink_interval 0.5
# Opacity (blur needs compositor)
background_opacity 0.90
# Scrollback
scrollback_lines 10000
foreground #c0caf5
background #1a1b26
url_color #458588
color0 #15161e
color1 #f7768e
color2 #9ece6a
color3 #e0af68
color4 #7aa2f7
color5 #bb9af7
color6 #7dcfff
color7 #a9b1d6
color8 #928374
color9 #fb4934
color10 #b8bb26
color11 #fabd2f
color12 #83a598
color13 #d3869b
color14 #8ec07c
color15 #ebdbb2
color8 #15161e
color9 #f7768e
color10 #9ece6a
color11 #e0af68
color12 #7aa2f7
color13 #bb9af7
color14 #7dcfff
color15 #a9b1d6
# # Gruvbox Dark Theme
# foreground #ebdbb2
# background #1d2021
# selection_foreground #1d2021
# selection_background #ebdbb2
# url_color #458588
#
# color0 #282828
# color1 #cc241d
# color2 #98971a
# color3 #d79921
# color4 #458588
# color5 #b16286
# color6 #689d6a
# color7 #a89984
# color8 #928374
# color9 #fb4934
# color10 #b8bb26
# color11 #fabd2f
# color12 #83a598
# color13 #d3869b
# color14 #8ec07c
# color15 #ebdbb2
# Hide mouse while typing
hide_mouse_when_typing yes
# Padding for cozy feel
window_padding_width 6

117
config/nvim/README.md Normal file
View File

@@ -0,0 +1,117 @@
# Neovim Keybinds Documentation
This document provides a simple and organized overview of all the custom keybinds defined in my Neovim configuration.
## General Keybinds
| Mode | Key | Action |
|------|-----------------|---------------------------------------------------------------------------------------------|
| `n` | `<leader>cd` | Open Ex mode (`:Ex`) |
| `n` | `J` | Join lines while keeping the cursor in place |
| `n` | `<C-d>` | Scroll half-page down and keep the cursor centered |
| `n` | `<C-u>` | Scroll half-page up and keep the cursor centered |
| `n` | `n` | Move to next search result and keep it centered |
| `n` | `N` | Move to previous search result and keep it centered |
| `n` | `Q` | Disable Ex mode |
| `n` | `<C-k>` | Jump to next quickfix entry and keep it centered |
| `n` | `<C-j>` | Jump to previous quickfix entry and keep it centered |
| `n` | `<leader>k` | Jump to next location entry and keep it centered |
| `n` | `<leader>j` | Jump to previous location entry and keep it centered |
| `i` | `<C-c>` | Exit insert mode (acts like `Esc`) |
| `n` | `<leader>x` | Make current file executable (`chmod +x`) |
| `n` | `<leader>u` | Toggle Undotree |
| `n` | `<leader>rl` | Reload the Neovim config (`~/.config/nvim/init.lua`) |
| `n` | `<leader><leader>` | Source the current file (`:so`) |
---
## Visual Mode Keybinds
| Mode | Key | Action |
|------|-----------------|---------------------------------------------------------------------------------------------|
| `v` | `J` | Move selected block down |
| `v` | `K` | Move selected block up |
| `x` | `<leader>p` | Paste without overwriting clipboard |
| `v` | `<leader>y` | Yank into system clipboard (even on SSH) |
---
## Linting and Formatting
| Mode | Key | Action |
|------|-----------------|---------------------------------------------------------------------------------------------|
| `n` | `<leader>cc` | Run `php-cs-fixer` to lint and format PHP files |
| `n` | `<F3>` | Format code (`LSP`) |
---
## Telescope Keybinds
| Mode | Key | Action |
|------|-----------------|---------------------------------------------------------------------------------------------|
| `n` | `<leader>ff` | Find files |
| `n` | `<leader>fg` | Find git-tracked files |
| `n` | `<leader>fo` | Open recent files |
| `n` | `<leader>fq` | Open quickfix list |
| `n` | `<leader>fh` | Open help tags |
| `n` | `<leader>fb` | Open buffer list |
| `n` | `<leader>fs` | Grep current string |
| `n` | `<leader>fc` | Grep instances of the current file name without the extension |
| `n` | `<leader>fi` | Find files in Neovim configuration directory (`~/.config/nvim/`) |
---
## Harpoon Integration
| Mode | Key | Action |
|------|-----------------|---------------------------------------------------------------------------------------------|
| `n` | `<leader>a` | Add current file to Harpoon list |
| `n` | `<C-e>` | Toggle Harpoon quick menu |
| `n` | `<leader>fl` | Open Harpoon window with Telescope |
| `n` | `<C-p>` | Go to previous Harpoon mark |
| `n` | `<C-n>` | Go to next Harpoon mark |
---
## LSP Keybinds
| Mode | Key | Action |
|-----------|------------|---------------------------------------------------------------------------------------------|
| `n` | `K` | Show hover information |
| `n` | `gd` | Go to definition |
| `n` | `gD` | Go to declaration |
| `n` | `gi` | Go to implementation |
| `n` | `go` | Go to type definition |
| `n` | `gr` | Show references |
| `n` | `gs` | Show signature help |
| `n` | `gl` | Show diagnostics in a floating window |
| `n` | `<F2>` | Rename symbol |
| `n`, `x` | `<F3>` | Format code asynchronously |
| `n` | `<F4>` | Show code actions |
---
## Miscellaneous
| Mode | Key | Action |
|------|-----------------|---------------------------------------------------------------------------------------------|
| `n` | `<leader>dg` | Run `DogeGenerate` (comment documentation generation) |
| `n` | `<leader>s` | Replace all instances of the word under the cursor on the current line |
---
# LSP servers:
I am migrating my lsp config to /lua/plugins/lsp.lua because nvim v0.11 allows a very minimal debloated way to setup language server protocols.
Below is a running list of what and how to install the lsp's that are going to be configured in this build. I will avoid mason for now because I think its better to have full control over your system, and not outsource it to mason. Just uncommonet `return {` in /plugins/lsp.lua from the original lspconfig if you want to go that route.
1. { lua-language-server }
- refer to distro ( pacman -Ss lua-language-server )
2. { css-language-server --studio, html-language-server }
- npm install -g vscode-langservers-extracted
3. { intelephense }
- npm install -g intelephense
4. { typescript-language-server }
- npm install -g typescript-language-server typescript

View File

@@ -0,0 +1,9 @@
local set = vim.opt_local
set.shiftwidth = 2
set.tabstop = 2
set.softtabstop = 2
set.expandtab = true
set.number = true
set.relativenumber = true

View File

@@ -0,0 +1,8 @@
local set = vim.opt_local
set.number = true
set.relativenumber = true
set.number = true
set.relativenumber = false
set.wrap = true
set.linebreak = true
set.conceallevel = 0

View File

@@ -0,0 +1,11 @@
-- ~/.config/nvim/after/ftplugin/nix.lua
local set = vim.opt_local
set.shiftwidth = 2
set.tabstop = 2
set.softtabstop = 2
set.expandtab = true
-- extras you want for Nix buffers
set.number = true
set.relativenumber = true

3
config/nvim/init.lua Normal file
View File

@@ -0,0 +1,3 @@
require('config.options')
require('config.keybinds')
require('config.lazy')

View File

@@ -0,0 +1,66 @@
-- KEYBINDS
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>cd", vim.cmd.Ex)
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv") -- Alt Up/Down in vscode
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
vim.keymap.set("n", "J", "mzJ`z") -- Remap joining lines
vim.keymap.set("n", "<C-d>", "<C-d>zz") -- Keep cursor in place while moving up/down page
vim.keymap.set("n", "<C-u>", "<C-u>zz")
vim.keymap.set("n", "n", "nzzzv") -- center screen when looping search results
vim.keymap.set("n", "N", "Nzzzv")
-- paste and don't replace clipboard over deleted text
vim.keymap.set("x", "<leader>p", [["_dP]])
vim.keymap.set({ "n", "v" }, "<leader>d", [["_d]])
-- sometimes in insert mode, control-c doesn't exactly work like escape
vim.keymap.set("i", "<C-c>", "<Esc>")
-- add binds for Control J/K to scroll thru quickfix list
vim.keymap.set("n", "<C-j>", "<cmd>cnext<CR>zz")
vim.keymap.set("n", "<C-k>", "<cmd>cprev<CR>zz")
-- What the heck is Ex mode?
vim.keymap.set("n", "Q", "<nop>")
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
-- getting Alex off my back :)
vim.keymap.set("n", "<leader>dg", "<cmd>DogeGenerate<cr>")
-- lint / format php files for LC
vim.keymap.set("n", "<leader>cc", "<cmd>!php-cs-fixer fix % --using-cache=no<cr>")
-- Replace all instances of whatever is under cursor (on line)
vim.keymap.set("n", "<leader>s", [[:s/\<<C-r><C-w>\>//gI<Left><Left><Left>]])
-- make file executable
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
-- yank into clipboard even if on ssh
vim.keymap.set('n', '<leader>y', '<Plug>OSCYankOperator')
vim.keymap.set('v', '<leader>y', '<Plug>OSCYankVisual')
-- reload without exiting vim
vim.keymap.set("n", "<leader>rl", "<cmd>source ~/.config/nvim/init.lua<cr>")
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
-- Quickfix list stuff
vim.keymap.set("n", "<leader>cl", ":cclose<CR>", { silent = true })
vim.keymap.set("n", "<leader>co", ":copen<CR>", { silent = true })
vim.keymap.set("n", "<leader>cn", ":cnext<CR>zz")
vim.keymap.set("n", "<leader>cp", ":cprev<CR>zz")
vim.keymap.set("n", "<leader>li", ":checkhealth vim.lsp<CR>", { desc = "LSP Info" })
-- run make in current working directory
vim.keymap.set("n", "<leader>mm", "<cmd>make<CR>")
-- source file
vim.keymap.set("n", "<leader><leader>", function()
vim.cmd("so")
end)

View File

@@ -0,0 +1,21 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Setup lazy.nvim
require("lazy").setup({
spec = "plugins",
change_detection = { notify = false },
})

View File

@@ -0,0 +1,56 @@
-- OPTIONS
local set = vim.opt
--line nums
set.relativenumber = true
set.number = true
-- indentation and tabs
set.tabstop = 4
set.shiftwidth = 4
set.autoindent = true
set.expandtab = true
-- search settings
set.ignorecase = true
set.smartcase = true
-- appearance
set.termguicolors = true
set.background = "dark"
set.signcolumn = "yes"
-- cursor line
set.cursorline = true
-- 80th column
set.colorcolumn = "80"
-- clipboard
set.clipboard:append("unnamedplus")
-- backspace
set.backspace = "indent,eol,start"
-- split windows
set.splitbelow = true
set.splitright = true
-- dw/diw/ciw works on full-word
set.iskeyword:append("-")
-- keep cursor at least 8 rows from top/bot
set.scrolloff = 8
-- undo dir settings
set.swapfile = false
set.backup = false
set.undodir = os.getenv("HOME") .. "/.vim/undodir"
set.undofile = true
-- incremental search
set.incsearch = true
-- faster cursor hold
set.updatetime = 50

View File

@@ -0,0 +1 @@
return {}

View File

@@ -0,0 +1,27 @@
local function enable_transparency()
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
vim.api.nvim_set_hl(0, "LineNr", { bg = "none" })
end
return {
{
"folke/tokyonight.nvim",
config = function()
vim.cmd.colorscheme "tokyonight"
vim.cmd('hi Directory guibg=NONE')
vim.cmd('hi SignColumn guibg=NONE')
enable_transparency()
end
},
-- {
-- "Mofiqul/vscode.nvim",
-- name = 'vscode',
-- config = function()
-- vim.cmd.colorscheme "vscode"
-- vim.cmd('hi Directory guibg=NONE')
-- vim.cmd('hi SignColumn guibg=NONE')
-- enable_transparency()
-- end
-- }
}

View File

@@ -0,0 +1,40 @@
return {
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
},
config = function()
local cmp = require("cmp")
cmp.setup({
preselect = cmp.PreselectMode.Item, -- <— preselect first item
completion = { completeopt = "menu,menuone,noinsert" },
window = { documentation = cmp.config.window.bordered() },
mapping = cmp.mapping.preset.insert({
["<CR>"] = cmp.mapping.confirm({ select = false }),
["<C-e>"] = cmp.mapping.abort(),
["<C-Space>"] = cmp.mapping.complete(), -- manual trigger if you want it
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-u>"] = cmp.mapping.scroll_docs(-4),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then cmp.select_next_item() else fallback() end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then cmp.select_prev_item() end
end, { "i", "s" }),
}),
sources = {
{ name = "nvim_lsp" },
{ name = "path" },
{ name = "buffer", keyword_length = 3 },
},
})
end,
},
}

View File

@@ -0,0 +1,39 @@
local conf = require('telescope.config').values
local themes = require('telescope.themes')
-- helper function to use telescope on harpoon list.
-- change get_ivy to other themes if wanted
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
local opts = themes.get_ivy({
promt_title = "Working List"
})
require("telescope.pickers").new(opts, {
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer(opts),
sorter = conf.generic_sorter(opts),
}):find()
end
return {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = {
"nvim-lua/plenary.nvim"
},
config = function()
local harpoon = require('harpoon')
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
vim.keymap.set("n", "<leader>fl", function() toggle_telescope(harpoon:list()) end,
{ desc = "Open harpoon window" })
vim.keymap.set("n", "<C-p>", function() harpoon:list():prev() end)
vim.keymap.set("n", "<C-n>", function() harpoon:list():next() end)
end
}

View File

@@ -0,0 +1,6 @@
return {
-- {
-- "nvim-lua/plenary.nvim",
-- name = "plenary"
-- },
}

View File

@@ -0,0 +1,228 @@
return {}
-- return {
-- 'neovim/nvim-lspconfig',
-- dependencies = {
-- 'williamboman/mason.nvim',
-- 'williamboman/mason-lspconfig.nvim',
-- -- Autocompletion
-- 'hrsh7th/nvim-cmp',
-- 'hrsh7th/cmp-buffer',
-- 'hrsh7th/cmp-path',
-- 'saadparwaiz1/cmp_luasnip',
-- 'hrsh7th/cmp-nvim-lsp',
-- 'hrsh7th/cmp-nvim-lua',
-- -- Snippets
-- 'L3MON4D3/LuaSnip',
-- 'rafamadriz/friendly-snippets',
-- },
-- config = function()
-- local autoformat_filetypes = {
-- "lua",
-- }
-- -- Create a keymap for vim.lsp.buf.implementation
-- vim.api.nvim_create_autocmd('LspAttach', {
-- callback = function(args)
-- local client = vim.lsp.get_client_by_id(args.data.client_id)
-- if not client then return end
-- if vim.tbl_contains(autoformat_filetypes, vim.bo.filetype) then
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- buffer = args.buf,
-- callback = function()
-- vim.lsp.buf.format({
-- formatting_options = { tabSize = 4, insertSpaces = true },
-- bufnr = args.buf,
-- id = client.id
-- })
-- end
-- })
-- end
-- end
-- })
--
-- -- Add borders to floating windows
-- vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
-- vim.lsp.handlers.hover,
-- { border = 'rounded' }
-- )
-- vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
-- vim.lsp.handlers.signature_help,
-- { border = 'rounded' }
-- )
--
-- -- Configure error/warnings interface
-- vim.diagnostic.config({
-- virtual_text = true,
-- severity_sort = true,
-- float = {
-- style = 'minimal',
-- border = 'rounded',
-- header = '',
-- prefix = '',
-- },
-- signs = {
-- text = {
-- [vim.diagnostic.severity.ERROR] = '✘',
-- [vim.diagnostic.severity.WARN] = '▲',
-- [vim.diagnostic.severity.HINT] = '⚑',
-- [vim.diagnostic.severity.INFO] = '»',
-- },
-- },
-- })
--
-- local lspconfig_defaults = require('lspconfig').util.default_config
-- lspconfig_defaults.capabilities = vim.tbl_deep_extend(
-- 'force',
-- lspconfig_defaults.capabilities,
-- require('cmp_nvim_lsp').default_capabilities()
-- )
--
-- -- This is where you enable features that only work
-- -- if there is a language server active in the file
-- vim.api.nvim_create_autocmd('LspAttach', {
-- callback = function(event)
-- local opts = { buffer = event.buf }
--
-- vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
-- vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
-- vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
-- vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts)
-- vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts)
-- vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>', opts)
-- vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
-- vim.keymap.set('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>', opts)
-- vim.keymap.set('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
-- vim.keymap.set({ 'n', 'x' }, '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>', opts)
-- vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
-- end,
-- })
--
-- require('mason').setup({})
-- require('mason-lspconfig').setup({
-- ensure_installed = {
-- "lua_ls",
-- "intelephense",
-- "ts_ls",
-- "eslint",
-- "pyright",
-- },
-- handlers = {
-- function(server_name)
-- if server_name == "luals" then return end -- avoid starting with {}
-- require('lspconfig')[server_name].setup({})
-- end,
--
-- lua_ls = function()
-- require('lspconfig').luals.setup({
-- settings = {
-- Lua = {
-- runtime = {
-- version = 'LuaJIT',
-- },
-- diagnostics = {
-- globals = { 'vim' },
-- },
-- workspace = {
-- library = { vim.env.VIMRUNTIME },
-- },
-- },
-- },
-- })
-- end,
-- },
-- })
--
-- local cmp = require('cmp')
--
-- require('luasnip.loaders.from_vscode').lazy_load()
--
-- vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
--
-- cmp.setup({
-- preselect = 'item',
-- completion = {
-- completeopt = 'menu,menuone,noinsert'
-- },
-- window = {
-- documentation = cmp.config.window.bordered(),
-- },
-- sources = {
-- { name = 'path' },
-- { name = 'nvim_lsp' },
-- { name = 'buffer', keyword_length = 3 },
-- { name = 'luasnip', keyword_length = 2 },
-- },
-- snippet = {
-- expand = function(args)
-- require('luasnip').lsp_expand(args.body)
-- end,
-- },
-- formatting = {
-- fields = { 'abbr', 'menu', 'kind' },
-- format = function(entry, item)
-- local n = entry.source.name
-- if n == 'nvim_lsp' then
-- item.menu = '[LSP]'
-- else
-- item.menu = string.format('[%s]', n)
-- end
-- return item
-- end,
-- },
-- mapping = cmp.mapping.preset.insert({
-- -- confirm completion item
-- ['<CR>'] = cmp.mapping.confirm({ select = false }),
--
-- -- scroll documentation window
-- ['<C-f>'] = cmp.mapping.scroll_docs(5),
-- ['<C-u>'] = cmp.mapping.scroll_docs(-5),
--
-- -- toggle completion menu
-- ['<C-e>'] = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.abort()
-- else
-- cmp.complete()
-- end
-- end),
--
-- -- tab complete
-- ['<Tab>'] = cmp.mapping(function(fallback)
-- local col = vim.fn.col('.') - 1
--
-- if cmp.visible() then
-- cmp.select_next_item({ behavior = 'select' })
-- elseif col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then
-- fallback()
-- else
-- cmp.complete()
-- end
-- end, { 'i', 's' }),
--
-- -- go to previous item
-- ['<S-Tab>'] = cmp.mapping.select_prev_item({ behavior = 'select' }),
--
-- -- navigate to next snippet placeholder
-- ['<C-d>'] = cmp.mapping(function(fallback)
-- local luasnip = require('luasnip')
--
-- if luasnip.jumpable(1) then
-- luasnip.jump(1)
-- else
-- fallback()
-- end
-- end, { 'i', 's' }),
--
-- -- navigate to the previous snippet placeholder
-- ['<C-b>'] = cmp.mapping(function(fallback)
-- local luasnip = require('luasnip')
--
-- if luasnip.jumpable(-1) then
-- luasnip.jump(-1)
-- else
-- fallback()
-- end
-- end, { 'i', 's' }),
-- }),
-- })
-- end
-- }

View File

@@ -0,0 +1,11 @@
return {
{
'nvim-lualine/lualine.nvim',
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
theme = 'tokyonight',
}
}
}

View File

@@ -0,0 +1,24 @@
return {
{ -- This helps with php/html for indentation
'captbaritone/better-indent-support-for-php-with-html',
},
{ -- This helps with ssh tunneling and copying to clipboard
'ojroques/vim-oscyank',
},
{ -- This generates docblocks
'kkoomen/vim-doge',
build = ':call doge#install()'
},
{ -- Git plugin
'tpope/vim-fugitive',
},
{ -- Show historical versions of the file locally
'mbbill/undotree',
},
{ -- Show CSS Colors
'brenoprata10/nvim-highlight-colors',
config = function()
require('nvim-highlight-colors').setup({})
end
},
}

View File

@@ -0,0 +1,12 @@
return {
'nvim-orgmode/orgmode',
event = 'VeryLazy',
ft = { 'org' },
config = function()
-- Setup orgmode
require('orgmode').setup({
org_agenda_files = '~/orgfiles/**/*',
org_default_notes_file = '~/orgfiles/refile.org',
})
end,
}

View File

@@ -0,0 +1,48 @@
return {
'nvim-telescope/telescope.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
},
config = function()
local actions = require('telescope.actions')
require('telescope').setup({
defaults = {
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist, -- send selected to quickfixlist
}
}
}
})
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fo', builtin.oldfiles, {})
vim.keymap.set('n', '<leader>fq', builtin.quickfix, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
-- Rip grep + Fzf
vim.keymap.set('n', '<leader>fg', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") });
end)
-- Find instance instance of current view being included
vim.keymap.set('n', '<leader>fc', function()
local filename_without_extension = vim.fn.expand('%:t:r')
builtin.grep_string({ search = filename_without_extension })
end, { desc = "Find current file: " })
-- Grep current string (for when gd doesn't work)
vim.keymap.set('n', '<leader>fs', function()
builtin.grep_string({})
end, { desc = "Find current string: " })
-- find files in vim config
vim.keymap.set('n', '<leader>fi', function()
builtin.find_files({ cwd = "~/.config/nvim/" });
end)
end
}

View File

@@ -0,0 +1,62 @@
return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = function()
local configs = require("nvim-treesitter.configs")
---@diagnostic disable-next-line: missing-fields
configs.setup({
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
},
},
},
-- enable syntax highlighting
highlight = {
enable = true,
},
-- enable indentation
indent = { enable = true },
-- enable autotagging (w/ nvim-ts-autotag plugin)
autotag = { enable = true },
-- ensure these language parsers are installed
ensure_installed = {
"json",
"python",
"ron",
"javascript",
"haskell",
"query",
"typescript",
"tsx",
"rust",
"zig",
"php",
"yaml",
"html",
"css",
"markdown",
"markdown_inline",
"bash",
"lua",
"vim",
"vimdoc",
"c",
"dockerfile",
"gitignore",
"astro",
},
-- auto install above language parsers
auto_install = false,
})
end
}
}

View File

@@ -0,0 +1,55 @@
-- Remap leaving 'terminal mode' to double tap esc
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>")
local state = {
floating = {
buf = -1,
win = -1,
}
}
local function open_floating_terminal(opts)
opts = opts or {}
local width = opts.width or math.floor(vim.o.columns * 0.8)
local height = opts.height or math.floor(vim.o.lines * 0.8)
local row = math.floor((vim.o.lines - height) / 2)
local col = math.floor((vim.o.columns - width) / 2)
local buf = nil
if vim.api.nvim_buf_is_valid(opts.buf) then
buf = opts.buf
else
buf = vim.api.nvim_create_buf(false, true)
end
if not buf then
error("Failed to create buffer")
end
local win = vim.api.nvim_open_win(buf, true, {
relative = 'editor',
width = width,
height = height,
row = row,
col = col,
style = 'minimal',
border = 'rounded',
})
return { buf = buf, win = win }
end
local toggle_terminal = function()
if not vim.api.nvim_win_is_valid(state.floating.win) then
state.floating = open_floating_terminal({ buf = state.floating.buf });
if vim.bo[state.floating.buf].buftype ~= "terminal" then
vim.cmd.terminal()
vim.cmd("startinsert!")
end
else
vim.api.nvim_win_hide(state.floating.win)
end
end
vim.api.nvim_create_user_command("Flterm", toggle_terminal, {})
vim.api.nvim_set_keymap('n', '<leader>ft', [[:Flterm<CR>]], { noremap = true, silent = true })

225
config/nvim/plugin/lsp.lua Normal file
View File

@@ -0,0 +1,225 @@
vim.lsp.config('*', {
root_markers = { '.git' },
})
vim.diagnostic.config({
virtual_text = true,
severity_sort = true,
float = {
style = 'minimal',
border = 'rounded',
source = 'if_many',
header = '',
prefix = '',
},
signs = {
text = {
[vim.diagnostic.severity.ERROR] = '',
[vim.diagnostic.severity.WARN] = '',
[vim.diagnostic.severity.HINT] = '',
[vim.diagnostic.severity.INFO] = '»',
},
},
})
local orig = vim.lsp.util.open_floating_preview
---@diagnostic disable-next-line: duplicate-set-field
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
opts = opts or {}
opts.border = opts.border or 'rounded'
opts.max_width = opts.max_width or 80
opts.max_height = opts.max_height or 24
opts.wrap = opts.wrap ~= false
return orig(contents, syntax, opts, ...)
end
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('my.lsp', {}),
callback = function(args)
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
local buf = args.buf
local map = function(mode, lhs, rhs) vim.keymap.set(mode, lhs, rhs, { buffer = buf }) end
map('n', 'K', vim.lsp.buf.hover)
map('n', 'gd', vim.lsp.buf.definition)
map('n', 'gD', vim.lsp.buf.declaration)
map('n', 'gi', vim.lsp.buf.implementation)
map('n', 'go', vim.lsp.buf.type_definition)
map('n', 'gr', vim.lsp.buf.references)
map('n', 'gs', vim.lsp.buf.signature_help)
map('n', 'gl', vim.diagnostic.open_float)
map('n', '<F2>', vim.lsp.buf.rename)
map({ 'n', 'x' }, '<F3>', function() vim.lsp.buf.format({ async = true }) end)
map('n', '<F4>', vim.lsp.buf.code_action)
local excluded_filetypes = { php = true, c = true, cpp = true }
if not client:supports_method('textDocument/willSaveWaitUntil')
and client:supports_method('textDocument/formatting')
and not excluded_filetypes[vim.bo[buf].filetype]
then
vim.api.nvim_create_autocmd('BufWritePre', {
group = vim.api.nvim_create_augroup('my.lsp.format', { clear = false }),
buffer = buf,
callback = function()
vim.lsp.buf.format({ bufnr = buf, id = client.id, timeout_ms = 1000 })
end,
})
end
end,
})
local caps = require("cmp_nvim_lsp").default_capabilities()
vim.lsp.config['luals'] = {
cmd = { 'lua-language-server' },
filetypes = { 'lua' },
root_markers = { { '.luarc.json', '.luarc.jsonc' }, '.git' },
capabilities = caps,
settings = {
Lua = {
runtime = { version = 'LuaJIT' },
diagnostics = { globals = { 'vim' } },
workspace = {
checkThirdParty = false,
library = vim.api.nvim_get_runtime_file('', true),
},
telemetry = { enable = false },
},
},
}
vim.lsp.config['cssls'] = {
cmd = { 'vscode-css-language-server', '--stdio' },
filetypes = { 'css', 'scss', 'less' },
root_markers = { 'package.json', '.git' },
capabilities = caps,
settings = {
css = { validate = true },
scss = { validate = true },
less = { validate = true },
},
}
vim.lsp.config['phpls'] = {
cmd = { 'intelephense', '--stdio' },
filetypes = { 'php' },
root_markers = { 'composer.json', '.git' },
capabilities = caps,
settings = {
intelephense = {
files = {
maxSize = 5000000, -- default 5MB
},
},
},
}
vim.lsp.config['ts_ls'] = {
cmd = { 'typescript-language-server', '--stdio' },
filetypes = {
'javascript', 'javascriptreact', 'javascript.jsx',
'typescript', 'typescriptreact', 'typescript.tsx',
},
root_markers = { 'package.json', 'tsconfig.json', 'jsconfig.json', '.git' },
capabilities = caps,
settings = {
completions = {
completeFunctionCalls = true,
},
},
}
vim.lsp.config['zls'] = {
cmd = { 'zls' },
filetypes = { 'zig', 'zir' },
root_markers = { 'zls.json', 'build.zig', '.git' },
capabilities = caps,
settings = {
zls = {
enable_build_on_save = true,
build_on_save_step = "install",
warn_style = false,
enable_snippets = true,
}
}
}
vim.lsp.config['nil_ls'] = {
cmd = { 'nil' },
filetypes = { 'nix' },
root_markers = { 'flake.nix', 'default.nix', '.git' },
capabilities = caps,
settings = {
['nil'] = {
formatting = {
command = { "alejandra" }
}
}
}
}
vim.lsp.config['rust_analyzer'] = {
cmd = { 'rust-analyzer' },
filetypes = { 'rust' },
root_markers = { 'Cargo.toml', 'rust-project.json', '.git' },
capabilities = caps,
settings = {
['rust-analyzer'] = {
cargo = { allFeatures = true },
formatting = {
command = { "rustfmt" }
},
},
},
}
-- C / C++ via clangd
vim.lsp.config['clangd'] = {
cmd = {
'clangd',
'--background-index',
'--clang-tidy',
'--header-insertion=never',
'--completion-style=detailed',
'--query-driver=/nix/store/*-gcc-*/bin/gcc*,/nix/store/*-clang-*/bin/clang*,/run/current-system/sw/bin/cc*',
},
filetypes = { 'c', 'cpp', 'objc', 'objcpp' },
root_markers = { 'compile_commands.json', '.clangd', 'configure.ac', 'Makefile', '.git' },
capabilities = caps,
init_options = {
fallbackFlags = { '-std=c23' }, -- Default to C23
},
}
vim.lsp.config['jsonls'] = {
cmd = { 'vscode-json-languageserver', '--stdio' },
filetypes = { 'json', 'jsonc' },
root_markers = { 'package.json', '.git', 'config.jsonc' },
capabilities = caps,
}
vim.lsp.config['hls'] = {
cmd = { 'haskell-language-server-wrapper', '--lsp' },
filetypes = { 'haskell', 'lhaskell' },
root_markers = { 'stack.yaml', 'cabal.project', 'package.yaml', '*.cabal', 'hie.yaml', '.git' },
capabilities = caps,
settings = {
haskell = {
formattingProvider = 'fourmolu',
plugin = {
semanticTokens = { globalOn = false }
},
},
},
}
vim.filetype.add({
extension = {
h = 'c',
},
})
for name, _ in pairs(vim.lsp.config) do
if name ~= '*' then -- Skip the wildcard config
vim.lsp.enable(name)
end
end

View File

@@ -0,0 +1,40 @@
local function reformat_parenthesized_content()
local bufnr = vim.api.nvim_get_current_buf()
local row = vim.api.nvim_win_get_cursor(0)[1]
local line = vim.api.nvim_buf_get_lines(bufnr, row - 1, row, false)[1]
local inside = line:match("%((.-)%)")
if not inside then
vim.notify(
"No content found inside parentheses",
vim.log.levels.ERROR
)
return
end
local prefix = line:match("^(.-)%(") or ""
local suffix = line:match("%)(.*)$") or ""
local parts = vim.split(inside, ",%s*")
if #parts == 0 then
vim.notify("No comma-separated content found", vim.log.levels.ERROR)
return
end
local new_lines = {}
table.insert(new_lines, prefix .. "(")
for i, part in ipairs(parts) do
if i < #parts then
table.insert(new_lines, " " .. part .. ",")
else
table.insert(new_lines, " " .. part)
end
end
table.insert(new_lines, " )" .. suffix)
vim.api.nvim_buf_set_lines(bufnr, row - 1, row, false, new_lines)
end
vim.keymap.set("n", "<leader>qq", function()
reformat_parenthesized_content()
end)

71
config/picom/picom.conf Normal file
View File

@@ -0,0 +1,71 @@
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
shadow-exclude = [
"name = 'Notification'",
"class_g ?= 'Notify-osd'",
"_GTK_FRAME_EXTENTS@:c"
];
fading = true;
fade-in-step = 0.03;
fade-out-step = 0.03;
inactive-opacity = 0.8;
frame-opacity = 1.0
inactive-opacity-override = false;
opacity-rule = [ "98:class_g = 'Geany'"];
blur-kern = "3x3box";
blur-background-exclude = [
"window_type = 'dock'",
"window_type = 'desktop'",
"_GTK_FRAME_EXTENTS@:c"
];
# backend = "glx"
backend = "xrender";
dithered-present = false;
vsync = true;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-client-opacity = true;
detect-transient = true;
use-damage = true;
log-level = "warn";
wintypes:
{
tooltip = { fade = true; shadow = true; opacity = 0.95; focus = true; full-shadow = false; };
dock = { shadow = false; clip-shadow-above = true; }
dnd = { shadow = false; }
popup_menu = { opacity = 0.95; }
dropdown_menu = { opacity = 0.95; }
};
# ORIGINAL
# backend = "glx"
# fading = true;
# fade-in-step = 0.03;
# fade-out-step = 0.03;
# fade-delta = 5;
#
# corner-radius=0;
#
# inactive-opacity = 1.0;
# active-opacity = 1.0;
# frame-opacity = 0.7;
# wintypes:
# {
# popup_menu = { opacity = 0.9; };
# dropdown_menu = { opacity = 0.9; };
# }
#
# opacity-rule = [
# "100:class_g = 'dwm'",
# "85:class_g = 'st'",
# ];

Binary file not shown.

Binary file not shown.

319
config/qtile/config.py Normal file
View File

@@ -0,0 +1,319 @@
from libqtile import bar, extension, hook, layout, qtile, widget
from libqtile.config import Click, Drag, Group, Key, KeyChord, Match, Screen
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
import os
import subprocess
mod = "mod4"
terminal = guess_terminal()
myTerm = "kitty"
keys = [
Key([mod], "h", lazy.layout.left(), desc="Move focus to left"),
Key([mod], "l", lazy.layout.right(), desc="Move focus to right"),
Key([mod], "j", lazy.layout.down(), desc="Move focus down"),
Key([mod], "k", lazy.layout.up(), desc="Move focus up"),
Key([mod, "shift"], "space", lazy.layout.next(), desc="Move window focus to other window"),
Key([mod, "shift"], "h", lazy.layout.shuffle_left(), desc="Move window to the left"),
Key([mod, "shift"], "l", lazy.layout.shuffle_right(), desc="Move window to the right"),
Key([mod, "shift"], "j", lazy.layout.shuffle_down(), desc="Move window down"),
Key([mod, "shift"], "k", lazy.layout.shuffle_up(), desc="Move window up"),
Key([mod, "control"], "h", lazy.layout.grow_left(), desc="Grow window to the left"),
Key([mod, "control"], "l", lazy.layout.grow_right(), desc="Grow window to the right"),
Key([mod, "control"], "j", lazy.layout.grow_down(), desc="Grow window down"),
Key([mod, "control"], "k", lazy.layout.grow_up(), desc="Grow window up"),
Key([mod], "n", lazy.layout.normalize(), desc="Reset all window sizes"),
Key([], "XF86AudioRaiseVolume", lazy.spawn("pamixer -i 5"), desc="Volume Up"),
Key([], "XF86AudioLowerVolume", lazy.spawn("pamixer -d 5"), desc="Volume Down"),
Key([], "XF86AudioMute", lazy.spawn("pamixer -t"), desc="Mute Audio"),
Key([], "XF86AudioMicMute", lazy.spawn("pamixer --default-source -t"), desc="Toggle microphone mute"),
Key([], "XF86MonBrightnessUp", lazy.spawn("brightnessctl set +10%"), desc="Increase brightness"),
Key([], "XF86MonBrightnessDown", lazy.spawn("brightnessctl set 10%-"), desc="Decrease brightness"),
Key(
[mod, "shift"],
"Return",
lazy.layout.toggle_split(),
desc="Toggle between split and unsplit sides of stack",
),
Key([mod], "Return", lazy.spawn(terminal), desc="Launch terminal"),
Key([mod], "Tab", lazy.next_layout(), desc="Toggle between layouts"),
Key([mod], "q", lazy.window.kill(), desc="Kill focused window"),
Key(
[mod],
"f",
lazy.window.toggle_fullscreen(),
desc="Toggle fullscreen on the focused window",
),
Key([mod], "t", lazy.window.toggle_floating(), desc="Toggle floating on the focused window"),
Key([mod, "control"], "r", lazy.reload_config(), desc="Reload the config"),
Key([mod, "control"], "q", lazy.shutdown(), desc="Shutdown Qtile"),
Key([mod], "space", lazy.spawn("rofi -show drun -show-icons"), desc='Run Launcher'),
Key(
[mod],
"s",
# lazy.spawn('sh -c "maim -s | xclip -selection clipboard -t image/png -i"'),
# lazy.spawn('sh -c "FILE=/home/balraj/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png; maim -s $FILE && xclip -selection clipboard -t image/png -i $FILE"')
lazy.spawn('notify-send "screenshot keybind triggered"'),
lazy.spawn("""sh -c 'mkdir -p "$HOME/Pictures/Screenshots" && \
FILE="$HOME/Pictures/Screenshots/$(date +%Y-%m-%d_%H-%M-%S).png" && \
maim -s "$FILE" && \
xclip -selection clipboard -t image/png -i "$FILE" && \
notify-send "Screenshot saved" "$FILE"'"""),
desc="Screenshot"
),
]
for vt in range(1, 8):
keys.append(
Key(
["control", "mod1"],
f"f{vt}",
lazy.core.change_vt(vt).when(func=lambda: qtile.core.name == "wayland"),
desc=f"Switch to VT{vt}",
)
)
groups = [Group(i) for i in "123456789"]
for i in groups:
keys.extend(
[
Key(
[mod],
i.name,
lazy.group[i.name].toscreen(),
desc=f"Switch to group {i.name}",
),
Key([mod, "shift"], i.name, lazy.window.togroup(i.name),
desc="move focused window to group {}".format(i.name)),
]
)
colors = [
["#1a1b26", "#1a1b26"],
["#a9b1d6", "#a9b1d6"],
["#32344a", "#32344a"],
["#f7768e", "#f7768e"],
["#9ece6a", "#9ece6a"],
["#e0af68", "#e0af68"],
["#7aa2f7", "#7aa2f7"],
["#ad8ee6", "#ad8ee6"],
["#0db9d7", "#0db9d7"],
["#444b6a", "#444b6a"]
]
def C(x): return x[0] if isinstance(x, (list, tuple)) else x
layout_theme = {
"border_width" : 1,
"margin" : 1,
"border_focus" : colors[6],
"border_normal" : colors[0],
}
layouts = [
layout.Columns(**layout_theme),
layout.Max(),
# layout.Stack(num_stacks=2),
# layout.Bsp(),
# layout.Matrix(),
layout.MonadTall(**layout_theme),
# layout.MonadWide(),
# layout.RatioTile(),
# layout.Tile(),
# layout.TreeTab(),
# layout.VerticalTile(),
# layout.Zoomy(),
]
widget_defaults = dict(
font="JetBrainsMono Nerd Font Propo Bold",
fontsize=16,
padding=0,
background=colors[0],
)
extension_defaults = widget_defaults.copy()
sep = widget.Sep(linewidth=1, padding=8, foreground=colors[9])
screens = [
Screen(
top=bar.Bar(
widgets = [
widget.Spacer(length = 8),
widget.Image(
filename = "~/.config/qtile/icons/balraj.png",
scale = "False",
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn("qtilekeys-yad")},
),
widget.Prompt(
font = "Ubuntu Mono",
fontsize=14,
foreground = colors[1]
),
widget.GroupBox(
fontsize = 18,
margin_y = 5,
margin_x = 5,
padding_y = 0,
padding_x = 2,
borderwidth = 3,
active = colors[8],
inactive = colors[9],
rounded = False,
highlight_color = colors[0],
highlight_method = "line",
this_current_screen_border = colors[7],
this_screen_border = colors [4],
other_current_screen_border = colors[7],
other_screen_border = colors[4],
),
widget.TextBox(
text = '|',
font = "JetBrainsMono Nerd Font Propo Bold",
foreground = colors[9],
padding = 2,
fontsize = 14
),
widget.CurrentLayout(
foreground = colors[1],
padding = 5
),
widget.TextBox(
text = '|',
font = "JetBrainsMono Nerd Font Propo Bold",
foreground = colors[9],
padding = 2,
fontsize = 14
),
widget.WindowName(
foreground = colors[6],
padding = 8,
max_chars = 40
),
# widget.GenPollText(
# update_interval = 300,
# func = lambda: subprocess.check_output("printf $(uname -r)", shell=True, text=True),
# foreground = colors[3],
# padding = 8,
# fmt = '{}',
# ),
# sep,
widget.CPU(
foreground = colors[4],
padding = 8,
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e btop')},
format="CPU: {load_percent}%",
),
sep,
widget.Memory(
foreground = colors[8],
padding = 8,
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e btop')},
format = 'Mem: {MemUsed:.0f}{mm}',
),
sep,
# widget.DF(
# update_interval = 60,
# foreground = colors[5],
# padding = 8,
# mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn('notify-disk')},
# partition = '/',
# format = '{uf}{m} free',
# fmt = 'Disk: {}',
# visible_on_warn = False,
# ),
# sep,
widget.Battery(
foreground=colors[5], # pick a palette slot you like
padding=8,
update_interval=5,
format='{percent:2.0%} {char} {hour:d}:{min:02d}', # e.g. "73% ⚡ 1:45"
fmt='Bat: {}',
charge_char='', # shown while charging
discharge_char='', # Nerd icon; use '-' if you prefer plain ascii
full_char='', # when at/near 100%
unknown_char='?',
empty_char='!',
mouse_callbacks={
'Button1': lambda: qtile.cmd_spawn(myTerm + ' -e upower -i $(upower -e | grep BAT)'),
},
),
sep,
widget.Backlight(
backlight_name="intel_backlight", # change if different
format=" Backlight: {percent:2.0%} ",
foreground=colors[6],
step=5
),
sep,
widget.Volume(
foreground = colors[7],
padding = 8,
fmt = 'Vol: {}',
),
sep,
widget.Clock(
foreground = colors[8],
padding = 8,
mouse_callbacks = {'Button1': lambda: qtile.cmd_spawn('notify-date')},
format = "%a, %b %d - %H:%M",
),
widget.Systray(padding = 6),
widget.Spacer(length = 8),
],
margin=[0, 0, 0, 0],
size=30
),
),
]
mouse = [
Drag([mod], "Button1", lazy.window.set_position_floating(), start=lazy.window.get_position()),
Drag([mod], "Button3", lazy.window.set_size_floating(), start=lazy.window.get_size()),
Click([mod], "Button2", lazy.window.bring_to_front()),
]
dgroups_key_binder = None
dgroups_app_rules = [] # type: list
follow_mouse_focus = True
bring_front_click = False
floats_kept_above = True
cursor_warp = False
floating_layout = layout.Floating(
float_rules=[
# Run the utility of `xprop` to see the wm class and name of an X client.
*layout.Floating.default_float_rules,
Match(wm_class="confirmreset"), # gitk
Match(wm_class="makebranch"), # gitk
Match(wm_class="maketag"), # gitk
Match(wm_class="ssh-askpass"), # ssh-askpass
Match(title="branchdialog"), # gitk
Match(title="pinentry"), # GPG key password entry
]
)
auto_fullscreen = True
focus_on_window_activation = "smart"
reconfigure_screens = True
# If things like steam games want to auto-minimize themselves when losing
# focus, should we respect this or not?
auto_minimize = True
# When using the Wayland backend, this can be used to configure input devices.
wl_input_rules = None
# xcursor theme (string or None) and size (integer) for Wayland backend
wl_xcursor_theme = None
wl_xcursor_size = 24
wmname = "LG3D"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

48
config/rofi/backup-config Normal file
View File

@@ -0,0 +1,48 @@
configuration {
modi: "drun,run";
show-icons: false;
font: "monospace 10";
fullscreen: false;
dpi: 96;
}
* {
background: #2E3440; /* Nord0 */
foreground: #D8DEE9; /* Nord4 */
selected-background: #88C0D0; /* Nord8 */
selected-foreground: #2E3440; /* Nord0 */
border: 0;
padding: 6;
spacing: 5;
width: 50%;
}
window {
location: center;
border-radius: 6px;
}
inputbar {
background: @background;
text-color: @foreground;
padding: 10px;
border-radius: 6px;
}
listview {
padding: 5px;
lines: 10;
}
element {
background: transparent;
text-color: @foreground;
}
element selected {
background: @selected-background;
text-color: @selected-foreground;
border-radius: 4px;
}
@theme "/usr/share/rofi/themes/DarkBlue.rasi"

29
config/rofi/config.rasi Normal file
View File

@@ -0,0 +1,29 @@
configuration{
modi: ["drun", "window", "run"];
icon-theme: "Papirus-Dark";
show-icons: true;
terminal: "alacritty";
drun-display-format: "{icon} {name}";
location: 0;
disable-history: false;
sidebar-mode: false;
display-drun: " ";
display-run: " ";
display-window: " ";
//adding vim keybindings
kb-row-up: "Up,Control+k";
kb-row-left: "Left,Control+h";
kb-row-right: "Right,Control+l";
kb-row-down: "Down,Control+j";
kb-accept-entry: "Control+z,Control+y,Return,KP_Enter";
//fixing up
kb-remove-to-eol: "";
kb-move-char-back: "Control+b";
kb-remove-char-back: "BackSpace";
kb-move-char-forward: "Control+f";
kb-mode-complete: "Control+o";
}
@theme "tokyonight.rasi"

View File

@@ -0,0 +1,93 @@
configuration {
modi: "drun";
font: "JetBrainsMono Nerd Font 10";
show-icons: false;
terminal: "alacritty";
icon-theme: "Papirus-Dark";
drun-display-format: "{name}";
display-drun: "";
timeout {
action: "kb-cancel";
delay: 0;
}
filebrowser {
directories-first: true;
sorting-method: "name";
}
}
@theme "/dev/null"
* {
bg: #232933;
fg: #d8dee9;
selected: #2d3543;
accent: #4d6a8e;
background-color: @bg;
color: @fg;
border: 0;
border-color: @bg;
margin: 0;
padding: 0;
spacing: 0;
highlight: none;
}
window {
width: 700px;
}
element {
padding: 6 5 7 5;
text-color: @fg;
}
element-text {
vertical-align: 0.5;
padding: 5px;
}
element selected {
background-color: @selected;
}
element-text selected {
background-color: @selected;
}
element-icon selected {
background-color: @selected;
}
element-icon {
size: 30;
}
entry {
background-color: @bg;
columns: 1;
lines: 20;
}
inputbar {
children: [prompt, entry];
}
prompt {
text-color: @bg;
background-color: @accent;
padding: 12 12 12 12;
}
entry {
text-color: @bg;
background-color: @accent;
padding: 12 5 12 0;
}
listview {
background-color: @bg;
columns: 3;
lines: 6;
}

137
config/rofi/tokyonight.rasi Normal file
View File

@@ -0,0 +1,137 @@
/*
* Tokyonight colorscheme (big icons) for rofi
* User: w8ste
*/
// define colors etc.
* {
bg: #24283b;
hv: #9274ca;
primary: #444b6a; // TokyoNight bright black
ug: #0B2447;
font: "Monospace 11";
background-color: @bg;
//dark: @bg;
border: 0px;
kl: #7aa2f7;
black: #000000;
transparent: rgba(46,52,64,0);
}
// defines different aspects of the window
window {
width: 700;
/*since line wont work with height, i comment it out
if you rather control the size via height
just comment it out */
//height: 500;
orientation: horizontal;
location: center;
anchor: center;
transparency: "screenshot";
border-color: @transparent;
border: 0px;
border-radius: 6px;
spacing: 0;
children: [ mainbox ];
}
mainbox {
spacing: 0;
children: [ inputbar, message, listview ];
}
inputbar {
color: @kl;
padding: 11px;
border: 3px 3px 2px 3px;
border-color: @primary;
border-radius: 6px 6px 0px 0px;
}
message {
padding: 0;
border-color: @primary;
border: 0px 1px 1px 1px;
}
entry, prompt, case-indicator {
text-font: inherit;
text-color: inherit;
}
entry {
cursor: pointer;
}
prompt {
margin: 0px 5px 0px 0px;
}
listview {
layout: vertical;
//spacing: 5px;
padding: 8px;
lines: 7;
columns: 2;
border: 0px 3px 3px 3px;
border-radius: 0px 0px 6px 6px;
border-color: @primary;
dynamic: false;
}
element {
padding: 2px;
vertical-align: 1;
color: @kl;
font: inherit;
}
element-text {
background-color: inherit;
text-color: inherit;
vertical-align: 0.5;
}
element selected.normal {
color: @black;
background-color: @hv;
}
element normal active {
background-color: @hv;
color: @black;
}
element-icon {
background-color: inherit;
text-color: inherit;
size: 2.5em;
}
element normal urgent {
background-color: @primary;
}
element selected active {
background: @hv;
foreground: @bg;
}
button {
padding: 6px;
color: @primary;
horizonatal-align: 0.5;
border: 2px 0px 2px 2px;
border-radius: 4px 0px 0px 4px;
border-color: @primary;
}
button selected normal {
border: 2px 0px 2px 2px;
border-color: @primary;
}

View File

@@ -3,25 +3,55 @@
{
imports =
[
./hardware-configuration.nix
./hardware-configuration.nix
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.getty.autologinUser = "balraj";
networking.hostName = "nixos-btw";
networking.networkmanager.enable = true;
time.timeZone = "America/Los_Angeles";
time.timeZone = "Asia/Kolkata";
programs.hyprland = {
services.xserver = {
enable = true;
withUWSM = true;
xwayland.enable = true;
autoRepeatDelay = 200;
autoRepeatInterval = 35;
windowManager.qtile.enable = true;
displayManager.sessionCommands = ''
xwallpaper --zoom /etc/walls/nix.png'';
};
services.displayManager.ly = {
enable = true;
settings = {
animation = "matrix";
bigclock = true;
};
};
nixpkgs.config.allowUnfree = true;
services.printing.enable = true;
services.printing.drivers = [ pkgs.cnijfilter2 ];
services.pipewire = {
enable = true;
pulse.enable = true;
};
services.libinput.enable = true;
xdg.portal = {
enable = true;
config.common.default = [ "*" ];
};
services.flatpak.enable = true;
services.tailscale.enable = true;
users.users.balraj = {
isNormalUser = true;
extraGroups = [ "wheel" ];
@@ -31,16 +61,99 @@
};
programs.firefox.enable = true;
environment.systemPackages = with pkgs; [
vim
wget
foot
waybar
kitty
wofi
boot.kernelModules = [
"dell-wmi"
"dell-wmi-sysman"
"dell-smbios"
"dell-wmi-descriptor"
"video"
"sparse-keymap"
];
systemd.user.services.mpris-proxy = {
description = "Mpris proxy";
after = [ "network.target" "sound.target" ];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
virtualisation.docker.enable = true;
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};
environment.systemPackages = with pkgs; [
vim
wget
nitch
git
lazygit
gh
kitty
neovim
zellij
tmux
# onlyoffice-desktopeditors
picom
rofi
redis
xwallpaper
oh-my-posh
brightnessctl
pamixer
direnv
libnotify
dunst
maim
slop
xbindkeys
alsa-utils
libinput
blueman
bluez
xclip
xcb-util-cursor
# onlyoffice-desktopeditors
libreoffice
feh
];
fonts.enableFontDir = true;
fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
corefonts
vista-fonts
nerd-fonts.lilex
nerd-fonts.ubuntu
];
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
hardware.bluetooth.settings = {
General = {
Experimental = true;
};
};
services.blueman.enable = true;
services.picom = {
enable = true;
backend = "glx";
vSync = true;
};
nix.settings.experimental-features = [ "nix-command" "flakes" ];
services.openssh.enable = true;
system.autoUpgrade.enable = true;
system.autoUpgrade.allowReboot = true;
system.stateVersion = "25.05";
}

15
flake.lock generated
View File

@@ -7,31 +7,32 @@
]
},
"locked": {
"lastModified": 1761191301,
"narHash": "sha256-xsRL2Oyb4YRZZ1Tu4WzR2uFg1n931bH+PfLdFcqtLg8=",
"lastModified": 1764613336,
"narHash": "sha256-L979az28t/+SXvYw9qhOno5HLlDwkZOpz6LzCLnjmRM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4958aafe7b237dc1e857fb0c916efff72075048f",
"rev": "f3902b5d8767985680875ad86d028371100faeb3",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.11",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1761114652,
"narHash": "sha256-f/QCJM/YhrV/lavyCVz8iU3rlZun6d+dAiC3H+CDle4=",
"lastModified": 1764522689,
"narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "01f116e4df6a15f4ccdffb1bcd41096869fb385c",
"rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"ref": "nixos-25.11",
"type": "indirect"
}
},

View File

@@ -1,30 +1,28 @@
{
description = "Hyprland on Nixos";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... }: {
nixosConfigurations.nixos-btw = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.balraj = import ./home.nix;
backupFileExtension = "backup";
};
}
];
};
};
description = "NixOS on Dell Latitude 7490";
inputs = {
nixpkgs.url = "nixpkgs/nixos-25.11";
home-manager = {
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, home-manager, ... } : {
nixosConfigurations.nixos-btw = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.balraj = import ./home.nix;
backupFileExtension = "backup";
};
}
];
};
};
}

View File

@@ -14,18 +14,18 @@
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/97efbcd6-38ad-46b3-99ff-178dc69ae867";
{ device = "/dev/disk/by-uuid/0f18cba0-673d-450c-a905-d167fa93dd84";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/92F3-6C78";
{ device = "/dev/disk/by-uuid/D517-1BB5";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/6004095d-5a88-490c-934f-6a5496c83bec"; }
[ { device = "/dev/disk/by-uuid/9c501a59-9229-4925-8840-a4d60ad91e1e"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
@@ -33,6 +33,7 @@
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s20f0u2.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;

104
home.nix
View File

@@ -1,19 +1,111 @@
{ config, pkgs, ... }:
let
dotfiles = "${config.home.homeDirectory}/nixos-dotfiles/config";
bin = "${config.home.homeDirectory}/bin";
create_symlink = path: config.lib.file.mkOutOfStoreSymlink path;
configs = {
nvim = "nvim";
qtile = "qtile";
rofi = "rofi";
picom = "picom";
kitty = "kitty";
};
in
{
home.username = "balraj";
home.homeDirectory = "/home/balraj";
home.stateVersion = "25.05";
programs.git.enable = true;
programs.bash = {
enable = true;
shellAliases = {
btw = "echo i use nixos, btw";
nc = "nvim ~/nixos-dotfiles/.";
btw = "echo I use NixOS, btw";
nrs = "sudo nixos-rebuild switch --flake ~/nixos-dotfiles/#nixos-btw";
edit-config = "nvim ~/nixos-dotfiles/configuration.nix";
edit-home-config = "nvim ~/nixos-dotfiles/home.nix";
make-py-devshell = "bash ${bin}/make-py-devshell";
make-cpp-devshell = "bash ${bin}/make-cpp-devshell";
ls = "eza --long -ahF --no-user --no-permissions --git --icons=always --color=always --grid";
cd = "z";
};
profileExtra = ''
if [ -z "$WAYLAND_DISPLAY" ] && [ "$XDG_VTNR" = 1 ]; then
exec uwsm start -S hyprland-uwsm.desktop
fi
bashrcExtra = ''
export PS1="\[\e[38;5;75m\]\u@\h \[\e[38;5;113m\]\w \[\e[38;5;189m\]\$ \[\e[0m\]"
export MANPAGER="nvim +Man!"
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow'
eval "$(direnv hook bash)"
eval "$(zoxide init bash)"
nitch
'';
};
programs.git = {
enable = true;
settings.user.name = "BalrajSinghGidda";
settings.user.email = "anonystargamerz@gmail.com";
};
programs.gh = {
enable = true;
gitCredentialHelper = {
enable = true;
hosts = [
"https://github.com"
"https://gist.github.com"
];
};
settings = {
git_protocol = "https";
prompt = "enable";
editor = "nvim";
};
};
programs.gemini-cli = {
enable = true;
settings = {
"theme" = "Default";
"vimMode" = true;
"preferredEditor" = "nvim";
"autoAccept" = true;
};
defaultModel = "gemini-2.5-pro";
};
xdg.configFile = builtins.mapAttrs
(name: subpath: {
source = create_symlink "${dotfiles}/${subpath}";
recursive = true;
})
configs;
# xdg.configFile."qtile" = {
# source = create_symlink "${dotfiles}/qtile";
# recursive = true;
#
# (pkgs.writeShellApplication {
# name = "ns";
# runtimeInputs = with pkgs; [
# fzf
# nix-search-tv
# ];
# text = builtins.readFile "${pkgs.nix-search-tv.src}/nixpkgs.sh";
# })
#
# VV
home.packages = with pkgs; [
ripgrep
nil
nixpkgs-fmt
nodejs
gcc
yazi
flatpak
eza
zoxide
python313Packages.euporie
];
}