Updated config

This commit is contained in:
Eduard Urbach 2024-03-05 00:40:49 +01:00
parent 29a8811800
commit 307d253d9e
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
17 changed files with 196 additions and 120 deletions

View File

@ -1,30 +1,26 @@
[colors.bright] [colors.primary]
black = "#666666" background = "#26292C"
blue = "#3b8eea" foreground = "#F8F8F0"
cyan = "#29b8db"
green = "#23d18b"
magenta = "#d670d6"
red = "#f14c4c"
white = "#e5e5e5"
yellow = "#f5f543"
[colors.cursor]
cursor = "#cccccc"
text = "#1d1f21"
[colors.normal] [colors.normal]
black = "#000000" black = "#272822"
blue = "#2472c8" red = "#F92672"
cyan = "#11a8cd" green = "#A6E22E"
green = "#0dbc79" yellow = "#F4BF75"
magenta = "#bc3fbc" blue = "#66D9EF"
red = "#cd3131" magenta = "#AE81FF"
white = "#e5e5e5" cyan = "#A1EFE4"
yellow = "#e5e510" white = "#F8F8F2"
[colors.primary] [colors.bright]
background = "#241F31" black = "#75715E"
foreground = "#D4D4D4" red = "#F92672"
green = "#A6E22E"
yellow = "#F4BF75"
blue = "#66D9EF"
magenta = "#AE81FF"
cyan = "#A1EFE4"
white = "#F9F8F5"
[env] [env]
LANG = "en_US.UTF-8" LANG = "en_US.UTF-8"
@ -43,6 +39,4 @@ action = "ToggleFullscreen"
key = "F11" key = "F11"
[window] [window]
opacity = 0.9 opacity = 1.0
#decorations = "none"
#startup_mode = "Maximized"

View File

@ -2,7 +2,3 @@ exec-once = $statusbar
exec-once = waypaper --restore exec-once = waypaper --restore
exec-once = dunst exec-once = dunst
exec-once = wl-paste --watch cliphist store exec-once = wl-paste --watch cliphist store
exec-once = [workspace 1 silent] $browser
exec-once = [workspace 7 silent] $files
exec-once = [workspace 9 silent] $email

View File

@ -1,3 +1,9 @@
# https://github.com/hyprwm/Hyprland/issues/2591
$XDG_DATA_HOME=$HOME/.local/share
$XDG_CONFIG_HOME=$HOME/.config
$XDG_STATE_HOME=$HOME/.local/state
$XDG_CACHE_HOME=$HOME/.cache
# Firefox # Firefox
env = MOZ_ENABLE_WAYLAND,1 env = MOZ_ENABLE_WAYLAND,1
@ -26,5 +32,15 @@ env = GDK_BACKEND,wayland
env = WLR_NO_HARDWARE_CURSORS,1 env = WLR_NO_HARDWARE_CURSORS,1
env = WLR_RENDERER,vulkan env = WLR_RENDERER,vulkan
# Config directories
env = HISTFILE,$XDG_STATE_HOME/bash/history
env = CARGO_HOME,$XDG_DATA_HOME/cargo
env = CUDA_CACHE_PATH,$XDG_CACHE_HOME/nv
env = DOTNET_CLI_HOME,$XDG_DATA_HOME/dotnet
env = GTK2_RC_FILES,$XDG_CONFIG_HOME/gtk-2.0/gtkrc
env = NUGET_PACKAGES,$XDG_CACHE_HOME/nuget
env = RUSTUP_HOME,$XDG_DATA_HOME/rustup
env = W3M_DIR,$XDG_DATA_HOME/w3m
# X11 # X11
env = XCURSOR_SIZE,24 env = XCURSOR_SIZE,24

View File

@ -1,6 +1,7 @@
general { general {
gaps_in = 5 gaps_in = 5
gaps_out = 20 gaps_out = 10
border_size = 2 border_size = 2
col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
col.inactive_border = rgba(595959aa) col.inactive_border = rgba(595959aa)
@ -27,7 +28,7 @@ input {
} }
decoration { decoration {
rounding = 10 rounding = 3
blur { blur {
enabled = true enabled = true
@ -46,11 +47,11 @@ animations {
bezier = myBezier, 0.05, 0.9, 0.1, 1.05 bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 6, myBezier animation = windows, 1, 2, myBezier
animation = windowsOut, 1, 6, default, popin 80% animation = windowsOut, 1, 2, default, popin 80%
animation = border, 1, 9, default animation = border, 1, 5, default
animation = borderangle, 1, 7, default animation = borderangle, 1, 3, default
animation = fade, 1, 6, default animation = fade, 1, 2, default
animation = workspaces, 1, 1, default animation = workspaces, 1, 1, default
} }

View File

@ -5,6 +5,7 @@ $movews = CTRL ALT
bind = $leader, T, exec, $terminal bind = $leader, T, exec, $terminal
bind = $leader, B, exec, $browser bind = $leader, B, exec, $browser
bind = $leader, E, exec, $files bind = $leader, E, exec, $files
bind = $leader, D, exec, $terminal -e $editor
bind = $leader, L, exec, $lockscreen bind = $leader, L, exec, $lockscreen
bind = $leader, Space, exec, $menu bind = $leader, Space, exec, $menu
bind = $leader, F12, exec, $logout bind = $leader, F12, exec, $logout

View File

@ -3,3 +3,4 @@ require("boot")
require("setup") require("setup")
require("keys") require("keys")
require("autocmds") require("autocmds")
require("usercmds")

View File

@ -1,20 +1,23 @@
{ {
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" },
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, "lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
"mini.completion": { "branch": "main", "commit": "0cf6c4e257b5e8189ac6b3ffa2064a319c4eb8a8" },
"mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" }, "mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" },
"monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" },
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
"nui.nvim": { "branch": "main", "commit": "b81333d12f824dbed5eb231c8a4409a290fdd848" }, "nui.nvim": { "branch": "main", "commit": "fbb139c6f14896b434d0229099e1acd863ae6bec" },
"nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
"nvim-lspconfig": { "branch": "master", "commit": "c932a56bf25167b1e88d2a1ebe35bb774b41019a" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-lspconfig": { "branch": "master", "commit": "7f5cf1121f772850a30bdaf83fb448e88846aa58" },
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
"nvim-tree.lua": { "branch": "master", "commit": "efafd73efa9bc8c26282aed563ba0f01c7465b06" }, "nvim-tree.lua": { "branch": "master", "commit": "efafd73efa9bc8c26282aed563ba0f01c7465b06" },
"nvim-treesitter": { "branch": "master", "commit": "63ca90eaa3ce1cc668add8828a9e3d6728dbbdf1" }, "nvim-treesitter": { "branch": "master", "commit": "212b7a504cf56f85d1acc5be237261b42d7560c5" },
"nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, "nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" },
"onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"telescope-project.nvim": { "branch": "master", "commit": "1aaf16580a614601a7f7077d9639aeb457dc5559" }, "telescope-project.nvim": { "branch": "master", "commit": "1aaf16580a614601a7f7077d9639aeb457dc5559" },
"telescope.nvim": { "branch": "master", "commit": "aa83606299c5beeaf80e656efbf07bde258db7be" } "telescope.nvim": { "branch": "master", "commit": "dc1ea28cc2a02cd1cebb9d80e967807d668f78f8" }
} }

View File

@ -1,6 +1,9 @@
local on = vim.api.nvim_create_autocmd local on = vim.api.nvim_create_autocmd
local group = vim.api.nvim_create_augroup("autocmds", {clear = true})
on({ "BufNewFile", "BufRead" }, { on({ "BufNewFile", "BufRead" }, {
desc = "Enable word wrap in text files and markdown documents",
group = group,
pattern = { "*.txt", "*.md" }, pattern = { "*.txt", "*.md" },
callback = function() callback = function()
vim.opt_local.wrap = true vim.opt_local.wrap = true
@ -9,6 +12,8 @@ on({ "BufNewFile", "BufRead" }, {
}) })
on({ "TermOpen", "TermEnter" }, { on({ "TermOpen", "TermEnter" }, {
desc = "Disable sign column in terminals",
group = group,
callback = function() callback = function()
vim.opt_local.signcolumn = "no" vim.opt_local.signcolumn = "no"
end, end,
@ -16,35 +21,42 @@ on({ "TermOpen", "TermEnter" }, {
on({ "TextYankPost" }, { on({ "TextYankPost" }, {
desc = "Highlight when copying text", desc = "Highlight when copying text",
group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }), group = group,
callback = function() callback = function()
vim.highlight.on_yank() vim.highlight.on_yank()
end, end,
}) })
on({ "VimEnter" }, { on({ "VimEnter" }, {
desc = "Allow opening a directory and jumping to project root",
group = group,
callback = function() callback = function()
-- Change file to its directory if needed -- Change file to its directory if needed
local file = vim.api.nvim_buf_get_name(0) local name = vim.api.nvim_buf_get_name(0)
if vim.fn.isdirectory(file) == 0 then if vim.fn.isdirectory(name) == 0 then
file = vim.fs.dirname(file) name = vim.fs.dirname(name)
end end
-- Switch to root directory of the project -- Switch to root directory of the project
local root_patterns = { ".git", "go.mod", "init.lua" } local root_patterns = { ".git", "go.mod", "init.lua" }
local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, { local root_dir = vim.fs.dirname(vim.fs.find(root_patterns, {
upward = true, upward = true,
path = file, path = name,
})[1]) })[1])
if root_dir then if root_dir then
vim.api.nvim_set_current_dir(root_dir) vim.api.nvim_set_current_dir(root_dir)
else else
vim.api.nvim_set_current_dir(file) vim.api.nvim_set_current_dir(name)
end end
end,
})
-- Open file explorer if we have enough space on({ "VimEnter" }, {
desc = "Open file explorer if there is enough horizontal space",
group = group,
callback = function()
local files = require("nvim-tree.api") local files = require("nvim-tree.api")
local width = vim.go.columns local width = vim.go.columns

View File

@ -45,55 +45,55 @@ return {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
event = "InsertEnter", event = "InsertEnter",
dependencies = { dependencies = {
"hrsh7th/cmp-nvim-lsp", -- "hrsh7th/cmp-nvim-lsp",
-- "hrsh7th/cmp-buffer", -- "hrsh7th/cmp-buffer",
-- "hrsh7th/cmp-path", -- "hrsh7th/cmp-path",
-- "L3MON4D3/LuaSnip", -- "L3MON4D3/LuaSnip",
}, },
config = function() opts = {
completion = {
autocomplete = true,
completeopt = "menu,menuone,noinsert",
},
formatting = {
fields = { "abbr", "kind", "menu" },
format = function(_, item)
local icon = icons[item.kind] or ""
item.kind = string.format(" %s %s", icon, item.kind)
return item
end,
},
-- snippet = {
-- expand = function(args)
-- require("luasnip").lsp_expand(args.body)
-- end,
-- },
-- preselect = cmp.PreselectMode.None,
sources = {
-- { name = "nvim_lsp" },
-- { name = "luasnip" },
{ name = "buffer" },
-- { name = "path" },
},
window = {
completion = {
border = "rounded",
scrollbar = false,
},
documentation = {
border = "rounded",
}
},
},
config = function(_, opts)
local cmp = require("cmp") local cmp = require("cmp")
local opts = { opts.mapping = {
completion = { ["<C-space>"] = cmp.mapping.complete(),
-- autocomplete = false, ["<C-up>"] = cmp.mapping.select_prev_item(),
completeopt = "menu,menuone,noinsert", ["<C-down>"] = cmp.mapping.select_next_item(),
}, ["<C-x>"] = cmp.mapping.abort(),
formatting = { ["<cr>"] = cmp.mapping.confirm({ select = true }),
fields = { "abbr", "kind", "menu" },
format = function(_, item)
local icon = icons[item.kind] or ""
item.kind = string.format(" %s %s", icon, item.kind)
return item
end,
},
mapping = {
["<C-space>"] = cmp.mapping.complete(),
["<C-up>"] = cmp.mapping.select_prev_item(),
["<C-down>"] = cmp.mapping.select_next_item(),
["<C-x>"] = cmp.mapping.abort(),
["<cr>"] = cmp.mapping.confirm({ select = true }),
},
-- snippet = {
-- expand = function(args)
-- require("luasnip").lsp_expand(args.body)
-- end,
-- },
-- preselect = cmp.PreselectMode.None,
sources = {
{ name = "nvim_lsp" },
-- { name = "luasnip" },
-- { name = "buffer" },
-- { name = "path" },
},
window = {
completion = {
border = "rounded",
scrollbar = false,
},
documentation = {
border = "rounded",
}
},
} }
cmp.setup(opts) cmp.setup(opts)

View File

@ -0,0 +1,11 @@
return {
"L3MON4D3/LuaSnip",
dependencies = {
"rafamadriz/friendly-snippets"
},
event = "InsertEnter",
version = "v2.*",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
}

View File

@ -6,7 +6,16 @@ end
map("n", ";", ":", "Command mode") map("n", ";", ":", "Command mode")
map("n", "U", "<cmd>redo<cr>", "Redo") map("n", "U", "<cmd>redo<cr>", "Redo")
map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", "Clear search") map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", "Clear search")
map({"n", "v"}, "qq", "<cmd>qa!<cr>", "Quit all") map({"n", "v"}, "<leader>q", "<cmd>qa!<cr>", "Quit all")
-- Buffer management
map("n", "<C-n>", "<cmd>enew<cr>", "New file")
map({ "i", "n", "s", "v" }, "<C-s>", "<cmd>w<cr><esc>", "Save file")
map("n", "<C-q>", "<cmd>bd<cr>", "Delete buffer")
-- Copy and paste
map("v", "<C-c>", "y")
map("n", "<C-v>", '"+P<right>')
-- Editing lines -- Editing lines
map({ "n", "v" }, "<C-b>", "^", "Beginning of line") map({ "n", "v" }, "<C-b>", "^", "Beginning of line")
@ -15,6 +24,7 @@ map({ "i", "n", "v" }, "<C-e>", "<end>", "End of line")
map("n", "<C-l>", "^Da", "Rewrite line") map("n", "<C-l>", "^Da", "Rewrite line")
map("i", "<C-l>", "<esc>^Da", "Rewrite line") map("i", "<C-l>", "<esc>^Da", "Rewrite line")
map("v", "<C-l>", "V", "Select line") map("v", "<C-l>", "V", "Select line")
map("n", "<C-Enter>", "i<Enter>", "Split line")
map({"n", "v"}, "<C-a>", "<esc>ggVG", "Select all") map({"n", "v"}, "<C-a>", "<esc>ggVG", "Select all")
-- Editing multiple instances -- Editing multiple instances
@ -25,27 +35,22 @@ map("v", "<C-d>", "y/<C-r>\"<cr>N", "Search selection")
map("n", "<C-r>", "*#:%s//<C-r><C-w>/g<left><left>", "Replace word under cursor") map("n", "<C-r>", "*#:%s//<C-r><C-w>/g<left><left>", "Replace word under cursor")
map("v", "<C-r>", "y/<C-r>\"<cr>N:%s//<C-r>\"/g<left><left>", "Replace selection") map("v", "<C-r>", "y/<C-r>\"<cr>N:%s//<C-r>\"/g<left><left>", "Replace selection")
-- Increasing and decreasing numbers
map("n", "+", "<C-a>", "Increase number")
map("n", "-", "<C-x>", "Decrease number")
map("n", "<kPlus>", "<C-a>", "Increase number")
map("n", "<kMinus>", "<C-x>", "Decrease number")
-- Buffer management
map("n", "<C-n>", "<cmd>enew<cr>", "New file")
map({ "i", "n", "s", "v" }, "<C-s>", "<cmd>w<cr><esc>", "Save file")
map("n", "<C-q>", "<cmd>bd<cr>", "Delete buffer")
-- Copy and paste
map("v", "<C-c>", "y")
map("n", "<C-v>", '"+p')
-- Indenting -- Indenting
map("n", "<Tab>", "V>gv<esc>") map("n", "<Tab>", "V>gv<esc>")
map("n", "<S-Tab>", "V<gv<esc>") map("n", "<S-Tab>", "V<gv<esc>")
map("v", "<Tab>", ">gv") map("v", "<Tab>", ">gv")
map("v", "<S-Tab>", "<gv") map("v", "<S-Tab>", "<gv")
-- Increasing and decreasing numbers
map("n", "+", "<C-a>", "Increase number")
map("n", "-", "<C-x>", "Decrease number")
map("n", "<kPlus>", "<C-a>", "Increase number")
map("n", "<kMinus>", "<C-x>", "Decrease number")
map("n", "<Bslash>", "<cmd>ToggleWord<cr>", "Toggle word")
-- Package manager
map("n", "<leader>l", "<cmd>Lazy<cr>", "Lazy")
-- Shift arrow selection -- Shift arrow selection
map("n", "<S-Up>", "v<Up>") map("n", "<S-Up>", "v<Up>")
map("n", "<S-Down>", "v<Down>") map("n", "<S-Down>", "v<Down>")
@ -61,6 +66,3 @@ map("i", "<S-Up>", "<Esc>v<Up>")
map("i", "<S-Down>", "<Esc>v<Down>") map("i", "<S-Down>", "<Esc>v<Down>")
map("i", "<S-Left>", "<Esc>v<Left>") map("i", "<S-Left>", "<Esc>v<Left>")
map("i", "<S-Right>", "<Esc>v<Right>") map("i", "<S-Right>", "<Esc>v<Right>")
-- Package manager
map("n", "<leader>l", "<cmd>Lazy<cr>", "Lazy")

View File

@ -0,0 +1,7 @@
return {
"tanvirtin/monokai.nvim",
lazy = false,
priority = 1000,
opts = {},
config = true,
}

View File

@ -6,7 +6,7 @@ return {
-- "nvim-telescope/telescope-ui-select.nvim", -- "nvim-telescope/telescope-ui-select.nvim",
}, },
keys = { keys = {
{"<leader>b", "<cmd>Telescope buffers<cr>", desc = "Buffers"}, {"<C-Tab>", "<cmd>Telescope buffers<cr>", desc = "Buffers"},
{"<leader>f", "<cmd>Telescope find_files<cr>", desc = "Find files"}, {"<leader>f", "<cmd>Telescope find_files<cr>", desc = "Find files"},
{"<leader>h", "<cmd>Telescope help_tags<cr>", desc = "Help"}, {"<leader>h", "<cmd>Telescope help_tags<cr>", desc = "Help"},
{"<leader>p", "<cmd>Telescope project<cr>", desc = "Projects"}, {"<leader>p", "<cmd>Telescope project<cr>", desc = "Projects"},

View File

@ -0,0 +1,31 @@
-- ToggleWord
vim.api.nvim_create_user_command("ToggleWord", function()
local inverse = {
["true"] = "false",
["True"] = "False",
["TRUE"] = "FALSE",
["Yes"] = "No",
["YES"] = "NO",
["1"] = "0",
["<"] = ">",
["("] = ")",
["["] = "]",
["{"] = "}",
['"'] = "'",
['""'] = "''",
["+"] = "-",
["==="] = "!==",
["=="] = "!="
}
vim.tbl_add_reverse_lookup(inverse)
vim.cmd("normal! yiw")
local yanked = vim.fn.getreg('"')
local flipped = inverse[yanked]
if flipped == nil then
return
end
vim.cmd("normal! ciw" .. flipped)
end, {})

View File

@ -1,5 +1,6 @@
{ {
"layer": "top", "layer": "top",
"position": "bottom",
"modules-left": ["custom/os","hyprland/workspaces"], "modules-left": ["custom/os","hyprland/workspaces"],
"modules-center": ["clock"], "modules-center": ["clock"],
"modules-right": ["cpu","custom/gpu","memory","disk","network","custom/power"], "modules-right": ["cpu","custom/gpu","memory","disk","network","custom/power"],

View File

@ -1,13 +1,17 @@
* { * {
border: none; border: none;
font-family: "Ubuntu Nerd Font"; font-family: "Ubuntu Nerd Font";
font-size: 14px; font-size: 11px;
padding: 0; padding: 0;
margin: 0; margin: 0;
} }
window#waybar { window#waybar {
background: transparent; color: #F8F8F2;
background: #272822;
/* border: 2px solid rgba(255, 255, 255, 0.1); */
/* border-radius: 3px; */
/* border-bottom: 1px solid rgba(255, 255, 255, 0.25); */
} }
window#waybar.hidden { window#waybar.hidden {
@ -24,10 +28,7 @@ window#waybar.hidden {
#workspaces, #workspaces,
#custom-os, #custom-os,
#custom-gpu { #custom-gpu {
color: @fg;
background: @bg;
margin: 0 8px; margin: 0 8px;
transition: none;
} }
#workspaces {} #workspaces {}
@ -53,6 +54,5 @@ window#waybar.hidden {
} }
#custom-os { #custom-os {
font-size: 24px;
color: rgb(137, 220, 235); color: rgb(137, 220, 235);
} }