mirror of
https://github.com/TheM1Stery/dotfiles.git
synced 2025-04-20 00:51:11 +00:00
add initial configuration
This commit is contained in:
commit
de451bb584
7
README.md
Normal file
7
README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# My dotfiles(currently incomplete)
|
||||
|
||||
To install, write this command:
|
||||
```bash
|
||||
$ sh ./setup.sh
|
||||
```
|
||||
|
25
hypr/autostart.conf
Executable file
25
hypr/autostart.conf
Executable file
@ -0,0 +1,25 @@
|
||||
exec-once=nm-applet --indicator & disown
|
||||
exec-once= /usr/libexec/kdeconnectd
|
||||
exec-once= kdeconnect-indicator
|
||||
exec-once = /usr/libexec/polkit-kde-authentication-agent-1
|
||||
exec-once = waybar
|
||||
exec-once = swaync # notification
|
||||
exec-once= dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
|
||||
exec-once=[workspace 1 silent] steam
|
||||
exec-once= xembedsniproxy & # for wine system tray
|
||||
exec-once=solaar --window=hide
|
||||
exec-once=blueman-applet
|
||||
# exec-once=wallengine --screen-root HDMI-A-2 1383845959
|
||||
# exec-once=/home/themystery/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox
|
||||
|
||||
exec-once = wl-paste --type text --watch cliphist store #Stores only text data
|
||||
exec-once = wl-paste --type image --watch cliphist store #Stores only image data
|
||||
|
||||
exec-once = python3 -m http.server -d /home/themystery/Bento
|
||||
|
||||
|
||||
|
||||
# env
|
||||
env = XDG_SESSION_TYPE,wayland
|
||||
env = WLR_DRM_NO_ATOMIC, 1
|
||||
windowrulev2 = immediate, class:^(overwatch.exe)$
|
273
hypr/hyprland.conf
Normal file
273
hypr/hyprland.conf
Normal file
@ -0,0 +1,273 @@
|
||||
|
||||
########################################################################################
|
||||
AUTOGENERATED HYPR CONFIG.
|
||||
PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
|
||||
OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
|
||||
########################################################################################
|
||||
|
||||
#
|
||||
# Please note not all available settings / options are set here.
|
||||
# For a full list, see the wiki
|
||||
#
|
||||
|
||||
# autogenerated = 1 # remove this line to remove the warning
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor=,preferred,auto,auto
|
||||
|
||||
|
||||
# xwaylandvideobridge hiding
|
||||
windowrulev2 = opacity 0.0 override 0.0 override,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noanim,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = nofocus,class:^(xwaylandvideobridge)$
|
||||
windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$
|
||||
|
||||
|
||||
|
||||
|
||||
# firefox picture in picture
|
||||
windowrulev2 = float, title:^(Picture-in-Picture)$
|
||||
windowrulev2 = pin, title:^(Picture-in-Picture)$
|
||||
windowrulev2 = float, title:^(Firefox)$
|
||||
windowrulev2 = pin, title:^(Firefox)$
|
||||
|
||||
# jetbrains ides
|
||||
# windowrulev2=stayfocused,class:^(jetbrains-*.)$
|
||||
|
||||
windowrulev2=windowdance,class:^(jetbrains-.*)$
|
||||
# search dialog
|
||||
windowrulev2=dimaround,class:^(jetbrains-.*)$,floating:1,title:^(?!win)
|
||||
windowrulev2=center,class:^(jetbrains-.*)$,floating:1,title:^(?!win)
|
||||
# autocomplete & menus
|
||||
windowrulev2=noanim,class:^(jetbrains-.*)$,title:^(win.*)$
|
||||
windowrulev2=noinitialfocus,class:^(jetbrains-.*)$,title:^(win.*)$
|
||||
windowrulev2=rounding 0,class:^(jetbrains-.*)$,title:^(win.*)$
|
||||
|
||||
# steam context menus(https://github.com/hyprwm/Hyprland/issues/2661#issuecomment-1821639125)
|
||||
windowrulev2 = stayfocused, title:^()$,class:^(steam)$
|
||||
windowrulev2 = minsize 1 1, title:^()$,class:^(steam)$
|
||||
|
||||
|
||||
|
||||
# floating windows
|
||||
windowrule=float,org.kde.polkit-kde-authentication-agent-1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
|
||||
# Execute your favorite apps at launch
|
||||
source = ~/.config/hypr/autostart.conf
|
||||
|
||||
|
||||
# wallpapers
|
||||
source = ~/.config/hypr/wallpaper.conf
|
||||
|
||||
|
||||
#
|
||||
# Source a file (multi-file configs)
|
||||
# source = ~/.config/hypr/myColors.conf
|
||||
source=~/.config/hypr/specialworkspace.conf
|
||||
|
||||
# Some default env vars.
|
||||
env = XCURSOR_SIZE,24
|
||||
|
||||
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
|
||||
input {
|
||||
kb_layout = us,ru,az
|
||||
kb_variant =
|
||||
kb_model =
|
||||
kb_options = grp:alt_shift_toggle, caps:escape
|
||||
kb_rules =
|
||||
|
||||
follow_mouse = 1
|
||||
|
||||
touchpad {
|
||||
natural_scroll = no
|
||||
}
|
||||
|
||||
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
|
||||
}
|
||||
|
||||
general {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
|
||||
gaps_in = 3
|
||||
gaps_out = 5
|
||||
border_size = 3
|
||||
# col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg
|
||||
# col.inactive_border = rgba(595959aa)
|
||||
col.active_border = rgb(8b008b) rgb(4b0082) 90deg
|
||||
col.inactive_border = rgba(595959aa)
|
||||
|
||||
|
||||
layout = dwindle
|
||||
allow_tearing = true
|
||||
}
|
||||
|
||||
group {
|
||||
# col.group_border = rgba(282a36dd)
|
||||
col.border_active = rgb(bd93f9) rgb(44475a) 90deg
|
||||
}
|
||||
|
||||
decoration {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
|
||||
rounding = 10
|
||||
|
||||
blur {
|
||||
enabled = true
|
||||
size = 3
|
||||
passes = 1
|
||||
}
|
||||
|
||||
# col.shadow = rgba(1E202966)
|
||||
# suggested shadow setting
|
||||
# drop_shadow = yes
|
||||
# shadow_range = 60
|
||||
# shadow_offset = 1 2
|
||||
# shadow_render_power = 3
|
||||
# shadow_scale = 0.97
|
||||
|
||||
|
||||
drop_shadow = yes
|
||||
shadow_range = 4
|
||||
shadow_render_power = 3
|
||||
col.shadow = rgba(1a1a1aee)
|
||||
}
|
||||
|
||||
animations {
|
||||
enabled = yes
|
||||
|
||||
# Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
|
||||
|
||||
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
|
||||
|
||||
animation = windows, 1, 7, myBezier
|
||||
animation = windowsOut, 1, 7, default, popin 80%
|
||||
animation = border, 1, 10, default
|
||||
animation = borderangle, 1, 8, default
|
||||
animation = fade, 1, 7, default
|
||||
animation = workspaces, 1, 6, default
|
||||
}
|
||||
|
||||
dwindle {
|
||||
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
|
||||
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
|
||||
preserve_split = yes # you probably want this
|
||||
special_scale_factor = 0.89
|
||||
}
|
||||
|
||||
master {
|
||||
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||
new_is_master = true
|
||||
}
|
||||
|
||||
gestures {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
workspace_swipe = off
|
||||
}
|
||||
|
||||
# Example per-device config
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
|
||||
device:epic-mouse-v1 {
|
||||
sensitivity = -0.5
|
||||
}
|
||||
|
||||
# Example windowrule v1
|
||||
# windowrule = float, ^(kitty)$
|
||||
# Example windowrule v2
|
||||
# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$
|
||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||
|
||||
|
||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||
$mainMod = SUPER
|
||||
$secondaryMod = ALT
|
||||
|
||||
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
|
||||
|
||||
# rofi binds
|
||||
source = ~/.config/hypr/rofi.conf
|
||||
|
||||
bind = $mainMod, Q, exec, kitty
|
||||
bind = $mainMod, C, killactive,
|
||||
bind = $mainMod, M, exit,
|
||||
bind = $mainMod, E, exec, dolphin
|
||||
bind = $mainMod, V, togglefloating,
|
||||
bind = $mainMod, F, fullscreen, 1
|
||||
bind = $mainMod, T, fullscreen, 0
|
||||
bind = $mainMod, P, pseudo, # dwindle
|
||||
bind = $mainMod, J, togglesplit, # dwindle
|
||||
bind = $mainMod, L, exec, gtklock
|
||||
bind = $mainMod, S, exec, grimblast --cursor --notify copy area
|
||||
bind = $mainMod_SHIFT, S, exec, swappy -f $(grimblast --cursor --notify copysave area)
|
||||
bind = $mainMod_SHIFT, E, exec, grimblast --cursor --notify edit area
|
||||
bind = $mainMod, F12, exec, grimblast --cursor --notify --freeze save screen
|
||||
bind = $mainMod_SHIFT, F12, exec, grimblast --cursor --notify --freeze save active
|
||||
bind = $mainMod SHIFT, P, pin
|
||||
bind = $mainMod SHIFT, B, exec, firefox
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
bind = $mainMod, left, movefocus, l
|
||||
bind = $mainMod, right, movefocus, r
|
||||
bind = $mainMod, up, movefocus, u
|
||||
bind = $mainMod, down, movefocus, d
|
||||
|
||||
|
||||
# Cycle through windows
|
||||
# bind = SHIFT_CTRL,W, cyclenext
|
||||
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
bind = $mainMod, 1, workspace, 1
|
||||
bind = $mainMod, 2, workspace, 2
|
||||
bind = $mainMod, 3, workspace, 3
|
||||
bind = $mainMod, 4, workspace, 4
|
||||
bind = $mainMod, 5, workspace, 5
|
||||
bind = $mainMod, 6, workspace, 6
|
||||
bind = $mainMod, 7, workspace, 7
|
||||
bind = $mainMod, 8, workspace, 8
|
||||
bind = $mainMod, 9, workspace, 9
|
||||
bind = $mainMod, 0, workspace, 10
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
bind = $mainMod SHIFT, 1, movetoworkspace, 1
|
||||
bind = $mainMod SHIFT, 2, movetoworkspace, 2
|
||||
bind = $mainMod SHIFT, 3, movetoworkspace, 3
|
||||
bind = $mainMod SHIFT, 4, movetoworkspace, 4
|
||||
bind = $mainMod SHIFT, 5, movetoworkspace, 5
|
||||
bind = $mainMod SHIFT, 6, movetoworkspace, 6
|
||||
bind = $mainMod SHIFT, 7, movetoworkspace, 7
|
||||
bind = $mainMod SHIFT, 8, movetoworkspace, 8
|
||||
bind = $mainMod SHIFT, 9, movetoworkspace, 9
|
||||
bind = $mainMod SHIFT, 0, movetoworkspace, 10
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
bind = $mainMod, D, workspace, e+1
|
||||
bind = $mainMod, A, workspace, e-1
|
||||
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
bindm = $mainMod, mouse:272, movewindow
|
||||
bindm = $mainMod, mouse:273, resizewindow
|
||||
|
||||
|
||||
# resize active window with mainMod + SHIFT + arrow keys
|
||||
bind = $mainMod SHIFT, right, resizeactive, 10 0
|
||||
bind = $mainMod SHIFT, left, resizeactive, -10 0
|
||||
bind = $mainMod SHIFT, up, resizeactive, 0 -10
|
||||
bind = $mainMod SHIFT, down, resizeactive, 0 10
|
||||
|
||||
# move active window with mainMod + ALT + arrow keys
|
||||
bind = $mainMod ALT, left, movewindow, l
|
||||
bind = $mainMod ALT, right, movewindow, r
|
||||
bind = $mainMod ALT, up, movewindow, u
|
||||
bind = $mainMod ALT, down, movewindow, d
|
||||
|
||||
|
||||
|
||||
misc {
|
||||
disable_hyprland_logo=true
|
||||
}
|
4
hypr/hyprpaper.conf
Normal file
4
hypr/hyprpaper.conf
Normal file
@ -0,0 +1,4 @@
|
||||
preload= /home/themystery/Downloads/od_nasa.png
|
||||
preload= /home/themystery/Downloads/pink-mercy-overwatch-art-uhdpaper.com-hd-39.jpg
|
||||
|
||||
wallpaper = HDMI-A-2,/home/themystery/Downloads/od_nasa.png
|
9
hypr/rofi.conf
Normal file
9
hypr/rofi.conf
Normal file
@ -0,0 +1,9 @@
|
||||
bind = $mainMod, R, exec, ~/.config/rofi/launchers/type-6/launcher.sh -m drun
|
||||
bind = $mainMod, B, exec, ~/.config/rofi/launchers/type-6/launcher.sh -m run
|
||||
bind = $mainMod, W, exec, ~/.config/rofi/launchers/type-6/launcher.sh -m window
|
||||
bind = $mainMod_ALT, B, exec, ~/.config/rofi/launchers/type-6/launcher.sh -m filebrowser
|
||||
bind = $mainMod, X, exec, ~/.config/rofi/powermenu/type-6/powermenu.sh
|
||||
bind = $secondaryMod, V, exec, ~/.config/rofi/applets/bin/volume.sh
|
||||
bind = $secondaryMod, M, exec, ~/.config/rofi/applets/bin/mpd.sh
|
||||
bind = $mainMod, H, exec, ~/.config/rofi/applets/bin/history.sh
|
||||
bind = $mainMod, I, exec, ~/.config/rofi/applets/bin/file-searcher.sh
|
7
hypr/specialworkspace.conf
Normal file
7
hypr/specialworkspace.conf
Normal file
@ -0,0 +1,7 @@
|
||||
# binding
|
||||
bind=CTRL,Tab,togglespecialworkspace
|
||||
bind=SUPER, Tab, togglespecialworkspace, minimize
|
||||
bind=SUPER_SHIFT, C, movetoworkspacesilent, special:minimize
|
||||
|
||||
# kitty
|
||||
exec-once=[workspace special silent;size 75% 20%;move 12.5% 40] kitty
|
10
hypr/wallpaper.conf
Normal file
10
hypr/wallpaper.conf
Normal file
@ -0,0 +1,10 @@
|
||||
# hyprpaper, swww, mpvpaper
|
||||
|
||||
# exec-once = hyprpaper # see hyprpaper.conf
|
||||
|
||||
# exec-once = mpvpaper -o "--loop" -f HDMI-A-2 ~/Videos/LiveWallpapers/mylivewallpapers.com-ADDED-Mercy-Overwatch.mp4
|
||||
# exec-once = mpvpaper -o "--loop" -f HDMI-A-2 ~/Videos/LiveWallpapers/mylivewallpapers-com-Rainy-Train-Station-4K.mp4
|
||||
exec-once = mpvpaper -o "--loop" -f HDMI-A-2 ~/Videos/LiveWallpapers/mylivewallpapers-com-Night-Italian-Cafe-4K.mp4
|
||||
|
||||
# exec-once=wallengine --screen-root HDMI-A-2 1383845959
|
||||
|
35
kitty/OneDark.conf
Normal file
35
kitty/OneDark.conf
Normal file
@ -0,0 +1,35 @@
|
||||
# Colors - https://github.com/olimorris/onedarkpro.nvim
|
||||
|
||||
background #282c34
|
||||
foreground #abb2bf
|
||||
# cursor none
|
||||
|
||||
color0 #282c34
|
||||
color8 #5c6370
|
||||
|
||||
color1 #ef596f
|
||||
color9 #f38897
|
||||
|
||||
color2 #89ca78
|
||||
color10 #a9d89d
|
||||
|
||||
color3 #e5c07b
|
||||
color11 #edd4a6
|
||||
|
||||
color4 #61afef
|
||||
color12 #8fc6f4
|
||||
|
||||
color5 #d55fde
|
||||
color13 #e089e7
|
||||
|
||||
color6 #2bbac5
|
||||
color14 #4bced8
|
||||
|
||||
color7 #abb2bf
|
||||
color15 #c8cdd5
|
||||
|
||||
# Tab bar
|
||||
active_tab_foreground #e089e7
|
||||
active_tab_background #282c34
|
||||
inactive_tab_foreground #5c6370
|
||||
inactive_tab_background #3e4451
|
2398
kitty/kitty.conf
Normal file
2398
kitty/kitty.conf
Normal file
File diff suppressed because it is too large
Load Diff
2
nvim/.gitignore
vendored
Normal file
2
nvim/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
plugin/packer_compiled.lua
|
||||
|
10
nvim/README.md
Normal file
10
nvim/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
### TheMystery's init.lua
|
||||
Prerequisite: install [ripgrep](https://github.com/BurntSushi/ripgrep).
|
||||
|
||||
Based on [ThePrimagen's init.lua](https://github.com/ThePrimeagen/init.lua) with some changes for my workflow
|
||||
|
||||
Additional plugins installed:
|
||||
- [Comments.nvim](https://github.com/numToStr/Comment.nvim)
|
||||
- [One Dark theme](https://github.com/navarasu/onedark.nvim)
|
||||
- [Csharp language server](https://github.com/razzmatazz/csharp-language-server)
|
||||
- [Nvim-tree](https://github.com/nvim-tree/nvim-tree.lua)
|
43
nvim/after/plugin/bufferline.lua
Normal file
43
nvim/after/plugin/bufferline.lua
Normal file
@ -0,0 +1,43 @@
|
||||
-- local map = vim.api.nvim_set_keymap
|
||||
-- local opts = { noremap = true, silent = true }
|
||||
--
|
||||
-- -- Move to previous/next
|
||||
-- map('n', '<A-Right>', '<Cmd>BufferLineCycleNext<CR>', opts)
|
||||
-- map('n', '<A-Left>', '<Cmd>BufferLineCyclePrev<CR>', opts)
|
||||
--
|
||||
-- -- Re-order to previous/next
|
||||
-- map('n', '<A-,>', '<Cmd>BufferLineMovePrev<CR>', opts)
|
||||
-- map('n', '<A-.>', '<Cmd>BufferLineMoveNext<CR>', opts)
|
||||
-- -- Goto buffer in position...
|
||||
-- map('n', '<leader>1', '<Cmd>BufferLineGoToBuffer 1<CR>', opts)
|
||||
-- map('n', '<leader>2', '<Cmd>BufferLineGoToBuffer 2<CR>', opts)
|
||||
-- map('n', '<leader>3', '<Cmd>BufferLineGoToBuffer 3<CR>', opts)
|
||||
-- map('n', '<leader>4', '<Cmd>BufferLineGoToBuffer 4<CR>', opts)
|
||||
-- map('n', '<leader>5', '<Cmd>BufferLineGoToBuffer 5<CR>', opts)
|
||||
-- map('n', '<leader>6', '<Cmd>BufferLineGoToBuffer 6<CR>', opts)
|
||||
-- map('n', '<leader>7', '<Cmd>BufferLineGoToBuffer 7<CR>', opts)
|
||||
-- map('n', '<leader>8', '<Cmd>BufferLineGoToBuffer 8<CR>', opts)
|
||||
-- map('n', '<leader>9', '<Cmd>BufferLineGoToBuffer 9<CR>', opts)
|
||||
-- map('n', '<leader>0', '<Cmd>BufferLineGoToBuffer -1<CR>', opts)
|
||||
--
|
||||
-- -- Pin/unpin buffer
|
||||
-- map('n', '<A-p>', '<Cmd>BufferLineTogglePin<CR>', opts)
|
||||
-- -- Close buffer
|
||||
-- map('n', '<A-c>', '<Cmd>BufferLinePickClose<CR>', opts)
|
||||
--
|
||||
-- -- Close commands
|
||||
-- map('n', '<leader>cll', '<Cmd>BufferLineCloseLeft<CR>', opts)
|
||||
-- map('n', '<leader>clr', '<Cmd>BufferLineCloseRight<CR>', opts)
|
||||
--
|
||||
-- require('bufferline').setup{
|
||||
-- options = {
|
||||
-- offsets = {
|
||||
-- {
|
||||
-- filetype = "neo-tree",
|
||||
-- text = "Neo-tree",
|
||||
-- text_align = "left",
|
||||
-- highlight = "Directory",
|
||||
-- }
|
||||
-- },
|
||||
-- }
|
||||
-- }
|
22
nvim/after/plugin/cloak.lua
Normal file
22
nvim/after/plugin/cloak.lua
Normal file
@ -0,0 +1,22 @@
|
||||
require("cloak").setup({
|
||||
enabled = true,
|
||||
cloak_character = "*",
|
||||
-- The applied highlight group (colors) on the cloaking, see `:h highlight`.
|
||||
highlight_group = "Comment",
|
||||
patterns = {
|
||||
{
|
||||
-- Match any file starting with ".env".
|
||||
-- This can be a table to match multiple file patterns.
|
||||
file_pattern = {
|
||||
".env*",
|
||||
"wrangler.toml",
|
||||
".dev.vars",
|
||||
},
|
||||
-- Match an equals sign and any character after it.
|
||||
-- This can also be a table of patterns to cloak,
|
||||
-- example: cloak_pattern = { ":.+", "-.+" } for yaml files.
|
||||
cloak_pattern = "=.+"
|
||||
},
|
||||
},
|
||||
})
|
||||
|
13
nvim/after/plugin/comments.lua
Normal file
13
nvim/after/plugin/comments.lua
Normal file
@ -0,0 +1,13 @@
|
||||
require('Comment').setup({
|
||||
toggler = {
|
||||
-- if you're using other terminals use '<C-_>' but for some reason in kitty this didn't work, so i used '<C-/>'
|
||||
line = '<C-/>',
|
||||
block = '<C-\\>',
|
||||
},
|
||||
opleader = {
|
||||
-- look at the comment above
|
||||
line = '<C-/>',
|
||||
block = '<C-\\>',
|
||||
},
|
||||
})
|
||||
|
2
nvim/after/plugin/copilot.lua
Normal file
2
nvim/after/plugin/copilot.lua
Normal file
@ -0,0 +1,2 @@
|
||||
vim.g.copilot_no_tab_map = true
|
||||
vim.api.nvim_set_keymap("i", "<C-J>", 'copilot#Accept("<CR>")', { silent = true, expr = true })
|
16
nvim/after/plugin/dap.lua
Normal file
16
nvim/after/plugin/dap.lua
Normal file
@ -0,0 +1,16 @@
|
||||
-- dap keymaps
|
||||
vim.keymap.set("n", "<F5>", "<cmd>lua require'dap'.continue()<CR>")
|
||||
vim.keymap.set("n", "<F10>", "<cmd>lua require'dap'.step_over()<CR>")
|
||||
vim.keymap.set("n", "<F11>", "<cmd>lua require'dap'.step_into()<CR>")
|
||||
vim.keymap.set("n", "<F12>", "<cmd>lua require'dap'.step_out()<CR>")
|
||||
vim.keymap.set("n", "<leader>b", "<cmd>lua require'dap'.toggle_breakpoint()<CR>")
|
||||
vim.keymap.set("n", "<leader>B", "<cmd>lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>")
|
||||
vim.keymap.set("n", "<leader>lp", "<cmd>lua require'dap'.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))<CR>")
|
||||
vim.keymap.set("n", "<leader>dr", "<cmd>lua require'dap'.repl.open()<CR>")
|
||||
|
||||
|
||||
|
||||
require("dapui").setup()
|
||||
|
||||
-- dapui keymaps
|
||||
vim.keymap.set("n", "<leader>dui", "<cmd>lua require'dapui'.toggle()<CR>")
|
1
nvim/after/plugin/dashboard.lua
Normal file
1
nvim/after/plugin/dashboard.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.keymap.set("n", "<leader>ds", vim.cmd.Dashboard, {noremap = true})
|
29
nvim/after/plugin/fugitive.lua
Normal file
29
nvim/after/plugin/fugitive.lua
Normal file
@ -0,0 +1,29 @@
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git)
|
||||
|
||||
local ThePrimeagen_Fugitive = vim.api.nvim_create_augroup("ThePrimeagen_Fugitive", {})
|
||||
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
autocmd("BufWinEnter", {
|
||||
group = ThePrimeagen_Fugitive,
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
if vim.bo.ft ~= "fugitive" then
|
||||
return
|
||||
end
|
||||
|
||||
local bufnr = vim.api.nvim_get_current_buf()
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
vim.keymap.set("n", "<leader>p", function()
|
||||
vim.cmd.Git('push')
|
||||
end, opts)
|
||||
|
||||
-- rebase always
|
||||
vim.keymap.set("n", "<leader>P", function()
|
||||
vim.cmd.Git({'pull', '--rebase'})
|
||||
end, opts)
|
||||
|
||||
-- NOTE: It allows me to easily set the branch i am pushing and any tracking
|
||||
-- needed if i did not set the branch up correctly
|
||||
vim.keymap.set("n", "<leader>t", ":Git push -u origin ", opts);
|
||||
end,
|
||||
})
|
1
nvim/after/plugin/gitsigns.lua
Normal file
1
nvim/after/plugin/gitsigns.lua
Normal file
@ -0,0 +1 @@
|
||||
require("gitsigns").setup()
|
14
nvim/after/plugin/harpoon.lua
Normal file
14
nvim/after/plugin/harpoon.lua
Normal file
@ -0,0 +1,14 @@
|
||||
local harpoon = require("harpoon")
|
||||
|
||||
harpoon:setup()
|
||||
|
||||
vim.keymap.set("n", "<leader>a", function() harpoon:list():append() end)
|
||||
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
|
||||
|
||||
vim.keymap.set("n", "<leader>hlc", function() harpoon:list():clear() end)
|
||||
vim.keymap.set("n", "<leader>hc", function() harpoon:list():remove() end)
|
||||
vim.keymap.set("n", "<leader>1", function() harpoon:list():select(1) end)
|
||||
vim.keymap.set("n", "<leader>2", function() harpoon:list():select(2) end)
|
||||
vim.keymap.set("n", "<leader>3", function() harpoon:list():select(3) end)
|
||||
vim.keymap.set("n", "<leader>4", function() harpoon:list():select(4) end)
|
28
nvim/after/plugin/image.lua
Normal file
28
nvim/after/plugin/image.lua
Normal file
@ -0,0 +1,28 @@
|
||||
require("image").setup({
|
||||
backend = "kitty",
|
||||
integrations = {
|
||||
markdown = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
|
||||
},
|
||||
neorg = {
|
||||
enabled = true,
|
||||
clear_in_insert_mode = false,
|
||||
download_remote_images = true,
|
||||
only_render_image_at_cursor = false,
|
||||
filetypes = { "norg" },
|
||||
},
|
||||
},
|
||||
max_width = nil,
|
||||
max_height = nil,
|
||||
max_width_window_percentage = nil,
|
||||
max_height_window_percentage = 50,
|
||||
window_overlap_clear_enabled = false, -- toggles images when windows are overlapped
|
||||
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },
|
||||
editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus
|
||||
tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
|
||||
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp" }, -- render image files as images when opened
|
||||
})
|
1
nvim/after/plugin/indent.lua
Normal file
1
nvim/after/plugin/indent.lua
Normal file
@ -0,0 +1 @@
|
||||
require("ibl").setup()
|
3
nvim/after/plugin/lightbulb.lua
Normal file
3
nvim/after/plugin/lightbulb.lua
Normal file
@ -0,0 +1,3 @@
|
||||
require("nvim-lightbulb").setup({
|
||||
autocmd = {enabled = true}
|
||||
})
|
164
nvim/after/plugin/lsp.lua
Normal file
164
nvim/after/plugin/lsp.lua
Normal file
@ -0,0 +1,164 @@
|
||||
require("neodev").setup({
|
||||
library = { plugins = { "nvim-dap-ui" }, types = true }
|
||||
})
|
||||
|
||||
|
||||
local lsp = require("lsp-zero")
|
||||
-- lsp.preset("recommended")
|
||||
|
||||
|
||||
|
||||
|
||||
-- use csharp_ls language server("https://github.com/razzmatazz/csharp-language-server")
|
||||
-- i'm using this instead of Mason because the version of it is old in Mason,
|
||||
-- the version here is maintained by dotnet tool and it's the latest
|
||||
-- lsp.configure('csharp_ls', {
|
||||
-- force_setup = true
|
||||
-- })
|
||||
|
||||
lsp.configure('clangd', {
|
||||
cmd = { 'clangd', '--offset-encoding=utf-16' },
|
||||
})
|
||||
--
|
||||
-- -- Fix Undefined global 'vim'
|
||||
-- lsp.configure('lua-language-server', {
|
||||
-- settings = {
|
||||
-- Lua = {
|
||||
-- diagnostics = {
|
||||
-- globals = { 'vim' }
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- })
|
||||
|
||||
-- this code makes it so that the css language server doesn't complain about tailwindcss classes
|
||||
lsp.configure("cssls", {
|
||||
settings = {
|
||||
css = {
|
||||
lint = { unknownAtRules = "ignore" }
|
||||
},
|
||||
scss = {
|
||||
lint = { unknownAtRules = "ignore" }
|
||||
},
|
||||
less = {
|
||||
lint = { unknownAtRules = "ignore" }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
lsp.set_server_config({
|
||||
capabilities = {
|
||||
textDocument = {
|
||||
foldingRange = {
|
||||
dynamicRegistration = false,
|
||||
lineFoldingOnly = true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
local cmp = require('cmp')
|
||||
local cmp_action = lsp.cmp_action()
|
||||
local cmp_format = lsp.cmp_format()
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
|
||||
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
|
||||
|
||||
cmp.setup({
|
||||
formatting = cmp_format,
|
||||
preselect = 'item',
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert'
|
||||
},
|
||||
window = {
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
sources = {
|
||||
{name = 'path'},
|
||||
{name = 'nvim_lsp'},
|
||||
{name = 'nvim_lua'},
|
||||
{name = 'buffer', keyword_length = 3},
|
||||
{name = 'luasnip', keyword_length = 2},
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- confirm completion item
|
||||
['<CR>'] = cmp.mapping.confirm({select = false, behavior = cmp.ConfirmBehavior.Insert}),
|
||||
['<Tab>'] = cmp.mapping.confirm({select = false, behavior = cmp.ConfirmBehavior.Replace}),
|
||||
|
||||
-- toggle completion menu
|
||||
['<C-e>'] = cmp_action.toggle_completion(),
|
||||
|
||||
-- tab complete
|
||||
-- ['<Tab>'] = cmp_action.tab_complete(),
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
|
||||
-- navigate between snippet placeholder
|
||||
['<C-d>'] = cmp_action.luasnip_jump_forward(),
|
||||
['<C-b>'] = cmp_action.luasnip_jump_backward(),
|
||||
|
||||
-- scroll documentation window
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(5),
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-5),
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
local navic = require("nvim-navic")
|
||||
|
||||
lsp.on_attach(function(client, bufnr)
|
||||
local opts = { buffer = bufnr, remap = false }
|
||||
lsp.default_keymaps({buffer = bufnr})
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
|
||||
vim.keymap.set("n", "<leader>dc", function() vim.lsp.buf.hover() end, opts)
|
||||
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>ed", function() vim.diagnostic.open_float() end, opts)
|
||||
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
|
||||
-- for the code action key map to work you need to change key binding('.' symbol) of your terminal, otherwise it won't work
|
||||
vim.keymap.set("n", "<C-.>", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
|
||||
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
-- sometimes lsp fails, we can restart it with this keymap
|
||||
vim.keymap.set('n', "<leader>lr", vim.cmd.LspRestart, opts)
|
||||
end)
|
||||
|
||||
require("mason").setup({});
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {'tsserver', 'tailwindcss', 'svelte', 'lua_ls'},
|
||||
handlers = {
|
||||
lsp.default_setup,
|
||||
lua_ls = function()
|
||||
local lua_opts = lsp.nvim_lua_ls()
|
||||
require('lspconfig').lua_ls.setup(lua_opts)
|
||||
end,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
lsp.set_sign_icons({
|
||||
error = '✘',
|
||||
warn = '▲',
|
||||
hint = '⚑',
|
||||
info = ''
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
style = 'minimal',
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
header = '',
|
||||
prefix = '',
|
||||
},
|
||||
})
|
||||
|
||||
-- because we want to add another source, the ones that are set by lsp-zero will be lost,
|
||||
-- we need to add them again together with the new one
|
216
nvim/after/plugin/lualine.lua
Normal file
216
nvim/after/plugin/lualine.lua
Normal file
@ -0,0 +1,216 @@
|
||||
local colors = {
|
||||
bg = '#202328',
|
||||
fg = '#bbc2cf',
|
||||
yellow = '#ECBE7B',
|
||||
cyan = '#008080',
|
||||
darkblue = '#081633',
|
||||
green = '#98be65',
|
||||
orange = '#FF8800',
|
||||
violet = '#a9a1e1',
|
||||
magenta = '#c678dd',
|
||||
blue = '#51afef',
|
||||
red = '#ec5f67',
|
||||
}
|
||||
|
||||
local conditions = {
|
||||
buffer_not_empty = function()
|
||||
return vim.fn.empty(vim.fn.expand('%:t')) ~= 1
|
||||
end,
|
||||
hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end,
|
||||
check_git_workspace = function()
|
||||
local filepath = vim.fn.expand('%:p:h')
|
||||
local gitdir = vim.fn.finddir('.git', filepath .. ';')
|
||||
return gitdir and #gitdir > 0 and #gitdir < #filepath
|
||||
end,
|
||||
}
|
||||
|
||||
-- Config
|
||||
local config = {
|
||||
options = {
|
||||
-- Disable sections and component separators
|
||||
component_separators = '',
|
||||
section_separators = '',
|
||||
theme = 'onedark_vivid',
|
||||
globalstatus = true
|
||||
},
|
||||
sections = {
|
||||
-- these are to remove the defaults
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
-- These will be filled later
|
||||
lualine_c = {},
|
||||
lualine_x = {
|
||||
{
|
||||
require("noice").api.status.command.get,
|
||||
cond = require("noice").api.status.command.has,
|
||||
color = { fg = "#ff9e64" },
|
||||
}
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
-- these are to remove the defaults
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
},
|
||||
}
|
||||
|
||||
-- Inserts a component in lualine_c at left section
|
||||
local function ins_left(component)
|
||||
table.insert(config.sections.lualine_c, component)
|
||||
end
|
||||
|
||||
-- Inserts a component in lualine_x at right section
|
||||
local function ins_right(component)
|
||||
table.insert(config.sections.lualine_x, component)
|
||||
end
|
||||
|
||||
ins_left {
|
||||
function()
|
||||
return '▊'
|
||||
end,
|
||||
color = { fg = colors.blue }, -- Sets highlighting of component
|
||||
padding = { left = 0, right = 1 }, -- We don't need space before this
|
||||
}
|
||||
|
||||
ins_left {
|
||||
-- mode component
|
||||
function()
|
||||
return ''
|
||||
end,
|
||||
color = function()
|
||||
-- auto change color according to neovims mode
|
||||
local mode_color = {
|
||||
n = colors.red,
|
||||
i = colors.green,
|
||||
v = colors.blue,
|
||||
[''] = colors.blue,
|
||||
V = colors.blue,
|
||||
c = colors.magenta,
|
||||
no = colors.red,
|
||||
s = colors.orange,
|
||||
S = colors.orange,
|
||||
[''] = colors.orange,
|
||||
ic = colors.yellow,
|
||||
R = colors.violet,
|
||||
Rv = colors.violet,
|
||||
cv = colors.red,
|
||||
ce = colors.red,
|
||||
r = colors.cyan,
|
||||
rm = colors.cyan,
|
||||
['r?'] = colors.cyan,
|
||||
['!'] = colors.red,
|
||||
t = colors.red,
|
||||
}
|
||||
return { fg = mode_color[vim.fn.mode()] }
|
||||
end,
|
||||
padding = { right = 1 },
|
||||
}
|
||||
|
||||
ins_left {
|
||||
-- filesize component
|
||||
'filesize',
|
||||
cond = conditions.buffer_not_empty,
|
||||
}
|
||||
|
||||
ins_left {
|
||||
'filename',
|
||||
cond = conditions.buffer_not_empty,
|
||||
color = { fg = colors.magenta, gui = 'bold' },
|
||||
}
|
||||
|
||||
ins_left { 'location' }
|
||||
|
||||
ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } }
|
||||
|
||||
ins_left {
|
||||
'diagnostics',
|
||||
sources = { 'nvim_diagnostic' },
|
||||
symbols = { error = ' ', warn = ' ', info = ' ' },
|
||||
diagnostics_color = {
|
||||
color_error = { fg = colors.red },
|
||||
color_warn = { fg = colors.yellow },
|
||||
color_info = { fg = colors.cyan },
|
||||
},
|
||||
}
|
||||
|
||||
-- Insert mid section. You can make any number of sections in neovim :)
|
||||
-- for lualine it's any number greater then 2
|
||||
ins_left {
|
||||
function()
|
||||
return '%='
|
||||
end,
|
||||
}
|
||||
|
||||
ins_left {
|
||||
-- Lsp server name .
|
||||
function()
|
||||
local msg = 'No Active Lsp'
|
||||
local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype')
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
if next(clients) == nil then
|
||||
return msg
|
||||
end
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
|
||||
return client.name
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end,
|
||||
icon = ' LSP:',
|
||||
color = { fg = '#ffffff', gui = 'bold' },
|
||||
}
|
||||
|
||||
-- Add components to right sections
|
||||
ins_right {
|
||||
'o:encoding', -- option component same as &encoding in viml
|
||||
fmt = string.upper, -- I'm not sure why it's upper case either ;)
|
||||
cond = conditions.hide_in_width,
|
||||
color = { fg = colors.green, gui = 'bold' },
|
||||
}
|
||||
|
||||
ins_right {
|
||||
'fileformat',
|
||||
fmt = string.upper,
|
||||
icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh
|
||||
color = { fg = colors.green, gui = 'bold' },
|
||||
}
|
||||
|
||||
ins_right {
|
||||
'branch',
|
||||
icon = '',
|
||||
color = { fg = colors.violet, gui = 'bold' },
|
||||
}
|
||||
|
||||
ins_right {
|
||||
'diff',
|
||||
-- Is it me or the symbol for modified us really weird
|
||||
symbols = { added = ' ', modified = ' ', removed = ' ' },
|
||||
diff_color = {
|
||||
added = { fg = colors.green },
|
||||
modified = { fg = colors.orange },
|
||||
removed = { fg = colors.red },
|
||||
},
|
||||
cond = conditions.hide_in_width,
|
||||
}
|
||||
|
||||
ins_right {
|
||||
function()
|
||||
return '▊'
|
||||
end,
|
||||
color = { fg = colors.blue },
|
||||
padding = { left = 1 },
|
||||
}
|
||||
|
||||
|
||||
|
||||
require('lualine').setup(config)
|
61
nvim/after/plugin/neotree.lua
Normal file
61
nvim/after/plugin/neotree.lua
Normal file
@ -0,0 +1,61 @@
|
||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim/issues/202#issuecomment-1428278234
|
||||
-- These two functions were taken from the issue above. So, Thanks!
|
||||
|
||||
local delete = function(state)
|
||||
local inputs = require("neo-tree.ui.inputs")
|
||||
local path = state.tree:get_node().path
|
||||
local msg = "Are you sure you want to trash " .. path
|
||||
inputs.confirm(msg, function(confirmed)
|
||||
if not confirmed then return end
|
||||
|
||||
vim.fn.system { "trash", path }
|
||||
require("neo-tree.sources.manager").refresh(state.name)
|
||||
end)
|
||||
end
|
||||
|
||||
-- over write default 'delete_visual' command to 'trash' x n.
|
||||
local delete_visual = function(state, selected_nodes)
|
||||
local inputs = require("neo-tree.ui.inputs")
|
||||
|
||||
-- get table items count
|
||||
function GetTableLen(tbl)
|
||||
local len = 0
|
||||
for n in pairs(tbl) do
|
||||
len = len + 1
|
||||
end
|
||||
return len
|
||||
end
|
||||
|
||||
local count = GetTableLen(selected_nodes)
|
||||
local msg = "Are you sure you want to trash " .. count .. " files ?"
|
||||
inputs.confirm(msg, function(confirmed)
|
||||
if not confirmed then return end
|
||||
for _, node in ipairs(selected_nodes) do
|
||||
vim.fn.system { "trash", node.path }
|
||||
end
|
||||
require("neo-tree.sources.manager").refresh(state.name)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
|
||||
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
||||
require("neo-tree").setup({
|
||||
window = {
|
||||
position = "float",
|
||||
},
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true
|
||||
},
|
||||
use_libuv_file_watcher = true,
|
||||
commands = {
|
||||
delete = delete,
|
||||
delete_visual = delete_visual,
|
||||
},
|
||||
hijack_netrw_behavior = "open_current"
|
||||
},
|
||||
})
|
||||
vim.keymap.set("n", "<leader>tf", vim.cmd.Neotree)
|
||||
vim.keymap.set("n", "<leader>tt", "<Cmd>Neotree reveal=true position=float toggle <CR>")
|
||||
|
34
nvim/after/plugin/noice.lua
Normal file
34
nvim/after/plugin/noice.lua
Normal file
@ -0,0 +1,34 @@
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
-- 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,
|
||||
},
|
||||
},
|
||||
-- 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
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
routes = {
|
||||
{
|
||||
-- this is needed to filter out excessive lsp progress messages from Ionide(F#)
|
||||
-- we just check if the message contains .fs extension and skip it
|
||||
filter = {
|
||||
event = "lsp",
|
||||
kind = "progress",
|
||||
find = ".*%.fs.*",
|
||||
},
|
||||
opts = { skip = true },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("notify").setup({
|
||||
background_colour = "#000000",
|
||||
})
|
5
nvim/after/plugin/presence.lua
Normal file
5
nvim/after/plugin/presence.lua
Normal file
@ -0,0 +1,5 @@
|
||||
require("presence").setup({
|
||||
workspace_text = "Working on project",
|
||||
editing_text = "Editing file",
|
||||
buttons = false
|
||||
})
|
5
nvim/after/plugin/refactoring.lua
Normal file
5
nvim/after/plugin/refactoring.lua
Normal file
@ -0,0 +1,5 @@
|
||||
require('refactoring').setup({})
|
||||
|
||||
vim.api.nvim_set_keymap("v", "<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], {noremap = true, silent = true, expr = false})
|
||||
|
||||
|
52
nvim/after/plugin/telescope.lua
Normal file
52
nvim/after/plugin/telescope.lua
Normal file
@ -0,0 +1,52 @@
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<C-p>', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>ps', function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
||||
end)
|
||||
vim.keymap.set('n', '<leader>pb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
|
||||
|
||||
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
require('telescope').setup{
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_cursor {}
|
||||
}
|
||||
},
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-s>"] = actions.select_vertical,
|
||||
},
|
||||
n = {
|
||||
["<C-s>"] = actions.select_vertical,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
theme = "dropdown"
|
||||
},
|
||||
git_files = {
|
||||
theme = "dropdown"
|
||||
},
|
||||
grep_string = {
|
||||
theme = "dropdown"
|
||||
},
|
||||
buffers = {
|
||||
theme = "dropdown",
|
||||
mappings = {
|
||||
n = {
|
||||
['<C-d>'] = actions.delete_buffer
|
||||
},
|
||||
i = {
|
||||
['<C-d>'] = actions.delete_buffer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
require("telescope").load_extension("ui-select")
|
14
nvim/after/plugin/theme.lua
Normal file
14
nvim/after/plugin/theme.lua
Normal file
@ -0,0 +1,14 @@
|
||||
-- require('onedark').setup{
|
||||
-- style = 'deep'
|
||||
-- }
|
||||
--
|
||||
-- require('onedark').load()
|
||||
|
||||
require("onedarkpro").setup({
|
||||
options = {
|
||||
transparency = true,
|
||||
}
|
||||
})
|
||||
|
||||
vim.cmd("colorscheme onedark_vivid")
|
||||
|
26
nvim/after/plugin/treesitter.lua
Normal file
26
nvim/after/plugin/treesitter.lua
Normal file
@ -0,0 +1,26 @@
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = { "vimdoc", "javascript", "typescript", "c", "lua", "rust", "c_sharp" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
autotag = {
|
||||
enable = true,
|
||||
}
|
||||
}
|
||||
|
3
nvim/after/plugin/trouble.lua
Executable file
3
nvim/after/plugin/trouble.lua
Executable file
@ -0,0 +1,3 @@
|
||||
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle<cr>",
|
||||
{silent = true, noremap = true}
|
||||
)
|
11
nvim/after/plugin/ufo.lua
Normal file
11
nvim/after/plugin/ufo.lua
Normal file
@ -0,0 +1,11 @@
|
||||
vim.o.foldcolumn = '1' -- '0' is not bad
|
||||
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.o.foldenable = true
|
||||
|
||||
require('ufo').setup()
|
||||
|
||||
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
||||
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
||||
vim.keymap.set('n', 'zr', require('ufo').openFoldsExceptKinds)
|
||||
vim.keymap.set('n', 'zm', require('ufo').closeFoldsWith) -- closeAllFolds == closeFoldsWith(0)
|
2
nvim/after/plugin/undotree.lua
Normal file
2
nvim/after/plugin/undotree.lua
Normal file
@ -0,0 +1,2 @@
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
|
30
nvim/after/plugin/zenmode.lua
Normal file
30
nvim/after/plugin/zenmode.lua
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
vim.keymap.set("n", "<leader>zz", function()
|
||||
require("zen-mode").setup {
|
||||
window = {
|
||||
width = 90,
|
||||
options = { }
|
||||
},
|
||||
}
|
||||
require("zen-mode").toggle()
|
||||
vim.wo.wrap = false
|
||||
vim.wo.number = true
|
||||
vim.wo.rnu = true
|
||||
ColorMyPencils()
|
||||
end)
|
||||
|
||||
|
||||
vim.keymap.set("n", "<leader>zZ", function()
|
||||
require("zen-mode").setup {
|
||||
window = {
|
||||
width = 80,
|
||||
options = { }
|
||||
},
|
||||
}
|
||||
require("zen-mode").toggle()
|
||||
vim.wo.wrap = false
|
||||
vim.wo.number = false
|
||||
vim.wo.rnu = false
|
||||
vim.opt.colorcolumn = "0"
|
||||
ColorMyPencils()
|
||||
end)
|
4
nvim/dev
Executable file
4
nvim/dev
Executable file
@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
rm -rf ~/.config/nvim
|
||||
ln -s $(pwd) ~/.config/nvim
|
2
nvim/init.lua
Normal file
2
nvim/init.lua
Normal file
@ -0,0 +1,2 @@
|
||||
require("themystery")
|
||||
|
3
nvim/lua/.luarc.json
Normal file
3
nvim/lua/.luarc.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"workspace.checkThirdParty": false
|
||||
}
|
36
nvim/lua/themystery/init.lua
Normal file
36
nvim/lua/themystery/init.lua
Normal file
@ -0,0 +1,36 @@
|
||||
require("themystery.set")
|
||||
require("themystery.remap")
|
||||
|
||||
package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;"
|
||||
package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;"
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local TheMysteryGroup = augroup('TheMystery', {})
|
||||
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
local yank_group = augroup('HighlightYank', {})
|
||||
|
||||
function R(name)
|
||||
require("plenary.reload").reload_module(name)
|
||||
end
|
||||
|
||||
autocmd('TextYankPost', {
|
||||
group = yank_group,
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
vim.highlight.on_yank({
|
||||
higroup = 'IncSearch',
|
||||
timeout = 40,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd({"BufWritePre"}, {
|
||||
group = TheMysteryGroup,
|
||||
pattern = "*",
|
||||
command = [[%s/\s\+$//e]],
|
||||
})
|
||||
|
||||
vim.g.netrw_browse_split = 0
|
||||
vim.g.netrw_banner = 0
|
||||
vim.g.netrw_winsize = 25
|
183
nvim/lua/themystery/packer.lua
Normal file
183
nvim/lua/themystery/packer.lua
Normal file
@ -0,0 +1,183 @@
|
||||
-- This file can be loaded by calling `lua require('plugins')` from your init.vimpacke
|
||||
|
||||
-- Only required if you have packer configured as `opt`
|
||||
vim.cmd.packadd('packer.nvim')
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
-- Packer can manage itself
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.x',
|
||||
requires = { { 'nvim-lua/plenary.nvim' } }
|
||||
}
|
||||
|
||||
-- use({
|
||||
-- 'rose-pine/neovim',
|
||||
-- as = 'rose-pine',
|
||||
-- config = function()
|
||||
-- vim.cmd('colorscheme rose-pine')
|
||||
-- end
|
||||
-- })
|
||||
|
||||
use 'numToStr/Comment.nvim'
|
||||
|
||||
-- use 'navarasu/onedark.nvim'
|
||||
use "olimorris/onedarkpro.nvim"
|
||||
|
||||
|
||||
-- use 'folke/tokyonight.nvim'
|
||||
|
||||
use({
|
||||
"folke/trouble.nvim",
|
||||
config = function()
|
||||
require("trouble").setup {
|
||||
icons = false,
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
|
||||
use("nvim-treesitter/playground")
|
||||
use("theprimeagen/refactoring.nvim")
|
||||
use("mbbill/undotree")
|
||||
use("tpope/vim-fugitive")
|
||||
use("nvim-treesitter/nvim-treesitter-context");
|
||||
|
||||
use {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
branch = 'v3.x',
|
||||
requires = {
|
||||
-- LSP Support
|
||||
{ 'neovim/nvim-lspconfig' },
|
||||
{ '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' },
|
||||
}
|
||||
}
|
||||
|
||||
use("folke/zen-mode.nvim")
|
||||
use("github/copilot.vim")
|
||||
-- use("zbirenbaum/copilot.lua")
|
||||
|
||||
|
||||
use("eandrju/cellular-automaton.nvim")
|
||||
use("laytan/cloak.nvim")
|
||||
-- use {
|
||||
-- 'nvim-tree/nvim-tree.lua',
|
||||
-- requires = {
|
||||
-- 'nvim-tree/nvim-web-devicons', -- optional
|
||||
-- },
|
||||
-- }
|
||||
|
||||
use {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
use('lewis6991/gitsigns.nvim')
|
||||
|
||||
use('windwp/nvim-ts-autotag')
|
||||
|
||||
use('theprimeagen/vim-be-good')
|
||||
|
||||
use {
|
||||
"windwp/nvim-autopairs",
|
||||
config = function() require("nvim-autopairs").setup {} end
|
||||
}
|
||||
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = { 'nvim-tree/nvim-web-devicons', opt = true }
|
||||
}
|
||||
|
||||
use 'andweeb/presence.nvim'
|
||||
|
||||
-- use {'romgrk/barbar.nvim', requires = {
|
||||
-- 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||
-- 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||
-- }
|
||||
-- }
|
||||
|
||||
use {
|
||||
'glepnir/dashboard-nvim',
|
||||
event = 'VimEnter',
|
||||
config = function()
|
||||
require('dashboard').setup({
|
||||
theme = "hyper",
|
||||
config = {
|
||||
project = {
|
||||
action = function(path)
|
||||
vim.cmd('Neotree dir=')
|
||||
end,
|
||||
},
|
||||
}
|
||||
})
|
||||
end,
|
||||
requires = { 'nvim-tree/nvim-web-devicons' }
|
||||
}
|
||||
|
||||
use({
|
||||
"utilyre/barbecue.nvim",
|
||||
tag = "*",
|
||||
requires = {
|
||||
"SmiteshP/nvim-navic",
|
||||
"nvim-tree/nvim-web-devicons", -- optional dependency
|
||||
},
|
||||
after = "nvim-web-devicons", -- keep this if you're using NvChad
|
||||
config = function()
|
||||
require("barbecue").setup({
|
||||
attach_navic = false
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
use { 'akinsho/bufferline.nvim', tag = "*", requires = 'nvim-tree/nvim-web-devicons' }
|
||||
|
||||
use { 'kosayoda/nvim-lightbulb' }
|
||||
|
||||
use "lukas-reineke/indent-blankline.nvim"
|
||||
|
||||
use { 'nvim-telescope/telescope-ui-select.nvim' }
|
||||
|
||||
use 'mfussenegger/nvim-dap'
|
||||
|
||||
use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
|
||||
|
||||
use { "folke/neodev.nvim" }
|
||||
|
||||
use { "folke/noice.nvim", requires = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" } }
|
||||
|
||||
use { 'kevinhwang91/nvim-ufo', requires = 'kevinhwang91/promise-async' }
|
||||
|
||||
use { '3rd/image.nvim' }
|
||||
|
||||
use { 'ionide/Ionide-vim', event = 'VimEnter' }
|
||||
|
||||
use {
|
||||
"ThePrimeagen/harpoon",
|
||||
branch = "harpoon2",
|
||||
requires = { { "nvim-lua/plenary.nvim" } }
|
||||
}
|
||||
end)
|
58
nvim/lua/themystery/remap.lua
Normal file
58
nvim/lua/themystery/remap.lua
Normal file
@ -0,0 +1,58 @@
|
||||
|
||||
vim.g.mapleader = " "
|
||||
-- vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
|
||||
vim.keymap.set("v", "<A-Up>", ":m '<-2<CR>gv=gv")
|
||||
vim.keymap.set("v", "<A-Down>", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("n", "<A-Up>", ":m .-2<CR>==")
|
||||
vim.keymap.set("n", "<A-Down>", ":m .+1<CR>==")
|
||||
|
||||
vim.keymap.set("v", "<A-j>", ":m '<-2<CR>gv=gv")
|
||||
vim.keymap.set("v", "<A-k>", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("n", "<A-j>", ":m .-2<CR>==")
|
||||
vim.keymap.set("n", "<A-k>", ":m .+1<CR>==")
|
||||
|
||||
|
||||
vim.keymap.set("n", "J", "mzJ`z")
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
-- greatest remap ever
|
||||
vim.keymap.set("x", "<leader>p", [["_dP]])
|
||||
|
||||
-- next greatest remap ever : asbjornHaland
|
||||
vim.keymap.set({"n", "v"}, "<leader>y", [["+y]])
|
||||
vim.keymap.set("n", "<leader>Y", [["+Y]])
|
||||
|
||||
vim.keymap.set({"n", "v"}, "<leader>d", [["_d]])
|
||||
|
||||
-- This is going to get me cancelled
|
||||
vim.keymap.set("i", "<C-c>", "<Esc>")
|
||||
|
||||
vim.keymap.set({"n", "v", "i"}, "<C-z>", "<nop>")
|
||||
vim.keymap.set("n", "Q", "<nop>")
|
||||
-- vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
||||
vim.keymap.set("n", "<leader>f", vim.lsp.buf.format)
|
||||
|
||||
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
|
||||
vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
|
||||
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
|
||||
vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
|
||||
|
||||
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
|
||||
|
||||
--delete current buffer
|
||||
vim.keymap.set("n", "<leader>bd", "<cmd>bd<CR>")
|
||||
|
||||
--delete all buffers except current
|
||||
vim.keymap.set("n", "<leader>bda", "<cmd>:%bd|e#<CR>")
|
||||
|
||||
|
||||
vim.keymap.set("n", "<leader><leader>", function()
|
||||
vim.cmd("so")
|
||||
end)
|
||||
|
31
nvim/lua/themystery/set.lua
Normal file
31
nvim/lua/themystery/set.lua
Normal file
@ -0,0 +1,31 @@
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
vim.opt.wrap = false
|
||||
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.isfname:append("@-@")
|
||||
|
||||
vim.opt.updatetime = 50
|
||||
|
||||
vim.opt.colorcolumn = "120"
|
||||
|
||||
vim.opt.cmdheight = 0
|
33
setup.sh
Normal file
33
setup.sh
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
removePathAndLink() {
|
||||
rm -rf ~/.config/$1
|
||||
ln -s $(pwd)/$1 ~/.config/$1
|
||||
}
|
||||
|
||||
moveShell() {
|
||||
rm -rf ~/.zshrc
|
||||
ln -s $(pwd)/zsh/.zshrc ~/.zshrc
|
||||
|
||||
rm -rf ~/.profile
|
||||
ln -s $(pwd)/zsh/.profile ~/.profile
|
||||
}
|
||||
|
||||
|
||||
if pwd | grep -q "dotfiles"; then
|
||||
echo "You are in dotfiles directory"
|
||||
else
|
||||
echo "You are not in dotfiles directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
removePathAndLink nvim
|
||||
removePathAndLink hypr
|
||||
removePathAndLink waybar
|
||||
removePathAndLink kitty
|
||||
|
||||
|
||||
moveShell
|
||||
|
||||
|
||||
|
304
waybar/config.jsonc
Executable file
304
waybar/config.jsonc
Executable file
@ -0,0 +1,304 @@
|
||||
[
|
||||
// {
|
||||
// "layer": "top", // Waybar at top layer
|
||||
// "position": "top", // Waybar position (top|bottom|left|right),
|
||||
// "name": "top",
|
||||
// // "height": 30, // Waybar height (to be removed for auto height)
|
||||
// // "width": 1280, // Waybar width
|
||||
// // "gtk-layer-shell": "false",
|
||||
// // Choose the order of the modules
|
||||
// "modules-left": ["tray", "custom/notification", "custom/media"],
|
||||
// "modules-center": ["hyprland/window"],
|
||||
// "modules-right": ["cpu", "memory"],
|
||||
// "mode": "default",
|
||||
// "sway/mode": {
|
||||
// "format": " {}"
|
||||
// },
|
||||
// "hyprland/workspaces": {
|
||||
// "format": "{name}",
|
||||
// "persistent_workspaces": {
|
||||
// "*": 5, // 5 workspaces by default on every monitor
|
||||
// },
|
||||
// "show-special": true
|
||||
// },
|
||||
// "hyprland/window": {
|
||||
// "format": "👉 {}",
|
||||
// "rewrite": {
|
||||
// "(.*) — Mozilla Firefox": "🌎 $1",
|
||||
// },
|
||||
// "separate-outputs": true
|
||||
// },
|
||||
// "custom/layout": {
|
||||
// "tooltip": false,
|
||||
// "exec": "swaymsg -mrt subscribe '[\"input\"]' | jq -r --unbuffered \"select(.change == \\\"xkb_layout\\\") | .input | select(.type == \\\"keyboard\\\") | .xkb_active_layout_name | .[0:2]\""
|
||||
// },
|
||||
// "custom/zypper": {
|
||||
// "format": "{} ",
|
||||
// "interval": 3600,
|
||||
// "exec": "zypper lu | grep 'v |' | wc -l; echo 'packages to update'",
|
||||
// "exec-if": "exit 0",
|
||||
// // "on-click": "exec alacritty -e sudo sh -c 'zypper ref; zypper dup; pkill -SIGRTMIN+8 waybar'",
|
||||
// "signal": 8
|
||||
// },
|
||||
// // Modules configuration
|
||||
// // "hyprland/workspaces": {
|
||||
// // "disable-scroll": true,
|
||||
// // "all-outputs": true,
|
||||
// // "format": "{name}: {icon}",
|
||||
// // "format-icons": {
|
||||
// // "1": "",
|
||||
// // "2": "",
|
||||
// // "3": "",
|
||||
// // "4": "",
|
||||
// // "5": "",
|
||||
// // "urgent": "",
|
||||
// // "focused": "",
|
||||
// // "default": ""
|
||||
// // }
|
||||
// // },
|
||||
// "idle_inhibitor": {
|
||||
// "format": "{icon}",
|
||||
// "format-icons": {
|
||||
// "activated": "",
|
||||
// "deactivated": ""
|
||||
// }
|
||||
// },
|
||||
// "tray": {
|
||||
// // "icon-size": 21,
|
||||
// "spacing": 10
|
||||
// },
|
||||
// "cpu": {
|
||||
// "format": "{usage}% ",
|
||||
// "tooltip": true
|
||||
// },
|
||||
// "memory": {
|
||||
// "format": "{}% "
|
||||
// },
|
||||
// "temperature": {
|
||||
// // "thermal-zone": 2,
|
||||
// // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
|
||||
// "critical-threshold": 80,
|
||||
// // "format-critical": "{temperatureC}°C {icon}",
|
||||
// "format": "{temperatureC}°C {icon}",
|
||||
// "format-icons": ["", "", ""]
|
||||
// },
|
||||
// "backlight": {
|
||||
// // "device": "acpi_video1",
|
||||
// "format": "{percent}% {icon}",
|
||||
// "format-icons": ["", ""]
|
||||
// },
|
||||
// "battery": {
|
||||
// "states": {
|
||||
// // "good": 95,
|
||||
// "warning": 30,
|
||||
// "critical": 15
|
||||
// },
|
||||
// "format": "{icon}",
|
||||
// "format-charging": "",
|
||||
// "format-plugged": "",
|
||||
// "format-alt": "{capacity}% {time}",
|
||||
// "format-icons": ["", "", "", "", ""]
|
||||
// },
|
||||
// "battery#bat2": {
|
||||
// "bat": "BAT2"
|
||||
// },
|
||||
// "network": {
|
||||
// // "interface": "wlp2*", // (Optional) To force the use of this interface
|
||||
// "format-wifi": "",
|
||||
// "format-ethernet": "",
|
||||
// "format-linked": "",
|
||||
// "format-disconnected": "⚠",
|
||||
// "format-alt": "{ifname} {essid} ({signalStrength}%)"
|
||||
// },
|
||||
// "pulseaudio": {
|
||||
// "format": "{volume}% {icon}",
|
||||
// "format-bluetooth": "{volume}% {icon}",
|
||||
// "format-muted": "",
|
||||
// "format-icons": {
|
||||
// "headphone": "",
|
||||
// "hands-free": "",
|
||||
// "headset": "",
|
||||
// "phone": "",
|
||||
// "portable": "",
|
||||
// "car": "",
|
||||
// "default": ["", ""]
|
||||
// },
|
||||
// "scroll-step": 1,
|
||||
// "on-click": "pavucontrol",
|
||||
// "ignored-sinks": ["Easy Effects Sink"]
|
||||
// },
|
||||
// "custom/scratchpad": {
|
||||
// "format-text": "{}",
|
||||
// "return-type": "json",
|
||||
// "interval": 3,
|
||||
// "exec": "/usr/share/openSUSEway/helpers/scratchpad-indicator.sh 2> /dev/null",
|
||||
// "exec-if": "exit 0",
|
||||
// "on-click": "swaymsg 'scratchpad show'",
|
||||
// "on-click-right": "swaymsg 'move scratchpad'"
|
||||
// },
|
||||
// // "custom/notification": {
|
||||
// // "tooltip": true,
|
||||
// // "format": "{icon}",
|
||||
// // "format-icons": {
|
||||
// // "notification": "<span foreground='red'><small><sup>⬤</sup></small></span>",
|
||||
// // "none": " ",
|
||||
// // "dnd-notification": "<span foreground='red'><small><sup>⬤</sup></small></span>",
|
||||
// // "dnd-none": " "
|
||||
// // },
|
||||
// // "return-type": "json",
|
||||
// // "exec-if": "which swaync-client",
|
||||
// // "exec": "swaync-client -swb",
|
||||
// // "on-click": "swaync-client -t -sw",
|
||||
// // "on-click-right": "swaync-client -d -sw",
|
||||
// // "escape": true
|
||||
// // },
|
||||
// "hyprland/language": {
|
||||
// "format": "{short} {variant}",
|
||||
// // "keyboard-name": "at-translated-set-2-keyboard"
|
||||
// },
|
||||
// "user": {
|
||||
// "format": "{user} (up {work_d} days ↑)",
|
||||
// "interval": 60,
|
||||
// "height": 30,
|
||||
// "width": 30,
|
||||
// "icon": true,
|
||||
// },
|
||||
// "custom/notification": {
|
||||
// "tooltip": false,
|
||||
// "format": "{icon}",
|
||||
// "format-icons": {
|
||||
// "notification": "<span foreground='red'><sup></sup></span>",
|
||||
// "none": "",
|
||||
// "dnd-notification": "<span foreground='red'><sup></sup></span>",
|
||||
// "dnd-none": "",
|
||||
// "inhibited-notification": "<span foreground='red'><sup></sup></span>",
|
||||
// "inhibited-none": "",
|
||||
// "dnd-inhibited-notification": "<span foreground='red'><sup></sup></span>",
|
||||
// "dnd-inhibited-none": ""
|
||||
// },
|
||||
// "return-type": "json",
|
||||
// "exec-if": "which swaync-client",
|
||||
// "exec": "swaync-client -swb",
|
||||
// "on-click": "sleep 0.1 && swaync-client -t -sw",
|
||||
// "on-click-right": "swaync-client -d -sw",
|
||||
// "escape": true
|
||||
// },
|
||||
// "custom/media": {
|
||||
// "format": "{icon} {}",
|
||||
// "escape": true,
|
||||
// "return-type": "json",
|
||||
// "max-length": 40,
|
||||
// "on-click": "playerctl play-pause",
|
||||
// "on-click-right": "playerctl stop",
|
||||
// "smooth-scrolling-threshold": 5, // This value was tested using a trackpad, it should be lowered if using a mouse.
|
||||
// "on-scroll-up": "playerctl next",
|
||||
// "on-scroll-down": "playerctl previous",
|
||||
// "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null", // Script in resources/custom_modules folder
|
||||
// }
|
||||
// },
|
||||
{
|
||||
"layer": "top",
|
||||
"position": "bottom",
|
||||
"mode": "default",
|
||||
"name":"bottom",
|
||||
// "exclusive": false,
|
||||
// "passthrough": true,
|
||||
"modules-left": ["hyprland/workspaces"],
|
||||
"modules-center": ["memory", "cpu", "custom/gpu-usage"],
|
||||
"modules-right": ["tray", "hyprland/language", "custom/notification", "pulseaudio", "clock"],
|
||||
"clock": {
|
||||
// "timezone": "America/New_York",
|
||||
"format": " {:%b %d %Y %R}",
|
||||
"tooltip-format": "<span color='#35b9ab'><big>{:%Y %B}</big></span>\n<span color='#35b9ab'><tt><small>{calendar}</small></tt></span>",
|
||||
"format-alt": "{:%a %d %b w:%V %H:%M}",
|
||||
"today-format": "<span color='#21a4df'><b><u>{}</u></b></span>",
|
||||
"calendar-weeks-pos": "left",
|
||||
"format-calendar": "<span background='#173f4f' bgalpha='60%'><b>{}</b></span>",
|
||||
"format-calendar-weeks": "<span color='#73ba25'><b>{}</b></span>",
|
||||
"format-calendar-weekdays": "<span color='#21a4df'><b>{}</b></span>",
|
||||
"interval": 10
|
||||
},
|
||||
"cpu": {
|
||||
"format": "{usage}% ",
|
||||
"tooltip": true
|
||||
},
|
||||
"memory": {
|
||||
"format": "{}% "
|
||||
},
|
||||
"tray": {
|
||||
// "icon-size": 21,
|
||||
"spacing": 10
|
||||
},
|
||||
"margin-bottom": 5,
|
||||
"hyprland/workspaces": {
|
||||
"format": "{name}",
|
||||
"persistent-workspaces": {
|
||||
"*": 5, // 5 workspaces by default on every monitor
|
||||
},
|
||||
// "show-special": true
|
||||
},
|
||||
"hyprland/language": {
|
||||
"format": "{short} {variant}",
|
||||
// "keyboard-name": "at-translated-set-2-keyboard"
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{volume}% {icon}",
|
||||
"format-bluetooth": "{volume}% {icon}",
|
||||
"format-muted": "",
|
||||
"format-icons": {
|
||||
"headphone": "",
|
||||
"hands-free": "",
|
||||
"headset": "",
|
||||
"phone": "",
|
||||
"portable": "",
|
||||
"car": "",
|
||||
"default": ["", ""]
|
||||
},
|
||||
"scroll-step": 1,
|
||||
"on-click": "pavucontrol",
|
||||
"ignored-sinks": ["Easy Effects Sink"]
|
||||
},
|
||||
|
||||
"temperature": {
|
||||
// "thermal-zone": 2,
|
||||
"hwmon-path": "/sys/class/hwmon/hwmon1/temp1_input",
|
||||
// "critical-threshold": 80,
|
||||
// "format-critical": "{temperatureC}°C ",
|
||||
"format": "{temperatureC}°C {icon}",
|
||||
"format-icons": ["", "", ""]
|
||||
},
|
||||
"custom/notification": {
|
||||
"tooltip": false,
|
||||
"format": "{icon}",
|
||||
"format-icons": {
|
||||
"notification": "<span foreground='red'><sup></sup></span>",
|
||||
"none": "",
|
||||
"dnd-notification": "<span foreground='red'><sup></sup></span>",
|
||||
"dnd-none": "",
|
||||
"inhibited-notification": "<span foreground='red'><sup></sup></span>",
|
||||
"inhibited-none": "",
|
||||
"dnd-inhibited-notification": "<span foreground='red'><sup></sup></span>",
|
||||
"dnd-inhibited-none": ""
|
||||
},
|
||||
"return-type": "json",
|
||||
"exec-if": "which swaync-client",
|
||||
"exec": "swaync-client -swb",
|
||||
"on-click": "sleep 0.1 && swaync-client -t -sw",
|
||||
"on-click-right": "swaync-client -d -sw",
|
||||
"escape": true
|
||||
},
|
||||
"custom/gpu-usage": {
|
||||
"exec": "nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader,nounits",
|
||||
"format": "{}% G",
|
||||
"return-type": "",
|
||||
"interval": 3
|
||||
},
|
||||
"pulseaudio/slider": {
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"orientation": ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
}]
|
182
waybar/mediaplayer.py
Executable file
182
waybar/mediaplayer.py
Executable file
@ -0,0 +1,182 @@
|
||||
#!/usr/bin/env python3
|
||||
import gi
|
||||
gi.require_version("Playerctl", "2.0")
|
||||
from gi.repository import Playerctl, GLib
|
||||
from gi.repository.Playerctl import Player
|
||||
import argparse
|
||||
import logging
|
||||
import sys
|
||||
import signal
|
||||
import gi
|
||||
import json
|
||||
import os
|
||||
from typing import List
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def signal_handler(sig, frame):
|
||||
logger.info("Received signal to stop, exiting")
|
||||
sys.stdout.write("\n")
|
||||
sys.stdout.flush()
|
||||
# loop.quit()
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
class PlayerManager:
|
||||
def __init__(self, selected_player=None):
|
||||
self.manager = Playerctl.PlayerManager()
|
||||
self.loop = GLib.MainLoop()
|
||||
self.manager.connect(
|
||||
"name-appeared", lambda *args: self.on_player_appeared(*args))
|
||||
self.manager.connect(
|
||||
"player-vanished", lambda *args: self.on_player_vanished(*args))
|
||||
|
||||
signal.signal(signal.SIGINT, signal_handler)
|
||||
signal.signal(signal.SIGTERM, signal_handler)
|
||||
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
|
||||
self.selected_player = selected_player
|
||||
|
||||
self.init_players()
|
||||
|
||||
def init_players(self):
|
||||
for player in self.manager.props.player_names:
|
||||
if self.selected_player is not None and self.selected_player != player.name:
|
||||
logger.debug(f"{player.name} is not the filtered player, skipping it")
|
||||
continue
|
||||
self.init_player(player)
|
||||
|
||||
def run(self):
|
||||
logger.info("Starting main loop")
|
||||
self.loop.run()
|
||||
|
||||
def init_player(self, player):
|
||||
logger.info(f"Initialize new player: {player.name}")
|
||||
player = Playerctl.Player.new_from_name(player)
|
||||
player.connect("playback-status",
|
||||
self.on_playback_status_changed, None)
|
||||
player.connect("metadata", self.on_metadata_changed, None)
|
||||
self.manager.manage_player(player)
|
||||
self.on_metadata_changed(player, player.props.metadata)
|
||||
|
||||
def get_players(self) -> List[Player]:
|
||||
return self.manager.props.players
|
||||
|
||||
def write_output(self, text, player):
|
||||
logger.debug(f"Writing output: {text}")
|
||||
|
||||
output = {"text": text,
|
||||
"class": "custom-" + player.props.player_name,
|
||||
"alt": player.props.player_name}
|
||||
|
||||
sys.stdout.write(json.dumps(output) + "\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
def clear_output(self):
|
||||
sys.stdout.write("\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
def on_playback_status_changed(self, player, status, _=None):
|
||||
logger.debug(f"Playback status changed for player {player.props.player_name}: {status}")
|
||||
self.on_metadata_changed(player, player.props.metadata)
|
||||
|
||||
def get_first_playing_player(self):
|
||||
players = self.get_players()
|
||||
logger.debug(f"Getting first playing player from {len(players)} players")
|
||||
if len(players) > 0:
|
||||
# if any are playing, show the first one that is playing
|
||||
# reverse order, so that the most recently added ones are preferred
|
||||
for player in players[::-1]:
|
||||
if player.props.status == "Playing":
|
||||
return player
|
||||
# if none are playing, show the first one
|
||||
return players[0]
|
||||
else:
|
||||
logger.debug("No players found")
|
||||
return None
|
||||
|
||||
def show_most_important_player(self):
|
||||
logger.debug("Showing most important player")
|
||||
# show the currently playing player
|
||||
# or else show the first paused player
|
||||
# or else show nothing
|
||||
current_player = self.get_first_playing_player()
|
||||
if current_player is not None:
|
||||
self.on_metadata_changed(current_player, current_player.props.metadata)
|
||||
else:
|
||||
self.clear_output()
|
||||
|
||||
def on_metadata_changed(self, player, metadata, _=None):
|
||||
logger.debug(f"Metadata changed for player {player.props.player_name}")
|
||||
player_name = player.props.player_name
|
||||
artist = player.get_artist()
|
||||
title = player.get_title()
|
||||
|
||||
track_info = ""
|
||||
if player_name == "spotify" and "mpris:trackid" in metadata.keys() and ":ad:" in player.props.metadata["mpris:trackid"]:
|
||||
track_info = "Advertisement"
|
||||
elif artist is not None and title is not None:
|
||||
track_info = f"{artist} - {title}"
|
||||
else:
|
||||
track_info = title
|
||||
|
||||
if track_info:
|
||||
if player.props.status == "Playing":
|
||||
track_info = " " + track_info
|
||||
else:
|
||||
track_info = " " + track_info
|
||||
# only print output if no other player is playing
|
||||
current_playing = self.get_first_playing_player()
|
||||
if current_playing is None or current_playing.props.player_name == player.props.player_name:
|
||||
self.write_output(track_info, player)
|
||||
else:
|
||||
logger.debug(f"Other player {current_playing.props.player_name} is playing, skipping")
|
||||
|
||||
def on_player_appeared(self, _, player):
|
||||
logger.info(f"Player has appeared: {player.name}")
|
||||
if player is not None and (self.selected_player is None or player.name == self.selected_player):
|
||||
self.init_player(player)
|
||||
else:
|
||||
logger.debug(
|
||||
"New player appeared, but it's not the selected player, skipping")
|
||||
|
||||
def on_player_vanished(self, _, player):
|
||||
logger.info(f"Player {player.props.player_name} has vanished")
|
||||
self.show_most_important_player()
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
# Increase verbosity with every occurrence of -v
|
||||
parser.add_argument("-v", "--verbose", action="count", default=0)
|
||||
|
||||
# Define for which player we"re listening
|
||||
parser.add_argument("--player")
|
||||
|
||||
parser.add_argument("--enable-logging", action="store_true")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
arguments = parse_arguments()
|
||||
|
||||
# Initialize logging
|
||||
if arguments.enable_logging:
|
||||
logfile = os.path.join(os.path.dirname(
|
||||
os.path.realpath(__file__)), "media-player.log")
|
||||
logging.basicConfig(filename=logfile, level=logging.DEBUG,
|
||||
format="%(asctime)s %(name)s %(levelname)s:%(lineno)d %(message)s")
|
||||
|
||||
# Logging is set by default to WARN and higher.
|
||||
# With every occurrence of -v it's lowered by one
|
||||
logger.setLevel(max((3 - arguments.verbose) * 10, 0))
|
||||
|
||||
logger.info("Creating player manager")
|
||||
if arguments.player:
|
||||
logger.info(f"Filtering for player: {arguments.player}")
|
||||
player = PlayerManager(arguments.player)
|
||||
player.run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
162
waybar/style.css
Normal file
162
waybar/style.css
Normal file
@ -0,0 +1,162 @@
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family: "JetBrainsMono NF";
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
transition-duration: 0s;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
/* color: rgba(53, 185, 171, 1); */
|
||||
color: whitesmoke;
|
||||
background-color: rgba(38,40,42, 0.92);
|
||||
border-bottom: 2px solid rgba(75, 0, 130, 1);
|
||||
border-radius: 100px;
|
||||
/* border-top: 2px solid rgba(75, 0, 130, 1); */
|
||||
}
|
||||
|
||||
window#waybar.bottom{
|
||||
background-color: transparent;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
window#waybar.bottom > * > *{
|
||||
background-color: rgba(38,40,42, 0.8);
|
||||
border-radius: 100px;
|
||||
}
|
||||
|
||||
window#waybar.bottom > * > :nth-child(1){
|
||||
border: 2px solid #e5c07b;
|
||||
}
|
||||
|
||||
window#waybar.bottom > * > :nth-child(2){
|
||||
border: 2px solid #abb2bf;
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
window#waybar.bottom > * > :nth-child(3){
|
||||
border: 2px solid #61afef;
|
||||
}
|
||||
|
||||
|
||||
window#waybar.solo {
|
||||
/* color: rgba(53, 185, 171, 1); */
|
||||
color: whitesmoke;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
|
||||
}
|
||||
|
||||
#custom-scratchpad {
|
||||
margin: 0px 5px;
|
||||
padding: 0px 5px;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
/* color: rgba(53, 185, 171, 1); */
|
||||
/* color: whitesmoke; */
|
||||
color: whitesmoke;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
/* color: rgba(115, 186, 37, 1); */
|
||||
/* color: whitesmoke; */
|
||||
/* background-color: rgba(23, 63, 79, 0.4); */
|
||||
background-color: #BE5046;
|
||||
border-radius: 100px;
|
||||
/* background-color: rgba(255, 255, 255, 0.4); */
|
||||
}
|
||||
|
||||
#workspaces button.persistent{
|
||||
/* color: rgba(115, 186, 37, 1); */
|
||||
color:whitesmoke;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
/* color: rgba(33, 164, 223, 1); */
|
||||
color: rgba(255, 210, 4, 1);
|
||||
}
|
||||
|
||||
#workspaces button:hover{
|
||||
background-color: rgba(23, 63, 79, 0.4);
|
||||
border-radius: 100px;
|
||||
}
|
||||
|
||||
#workspaces button.special{
|
||||
color: blueviolet;
|
||||
}
|
||||
|
||||
#mode,
|
||||
#battery,
|
||||
#network,
|
||||
#pulseaudio,
|
||||
#idle_inhibitor,
|
||||
#temperature,
|
||||
#custom-layout,
|
||||
#backlight,
|
||||
#custom-zypper
|
||||
{
|
||||
margin: 0px 6px 0px 10px;
|
||||
min-width: 30px;
|
||||
}
|
||||
|
||||
#cpu, #memory{
|
||||
margin: 0px 6px 0px 3px;
|
||||
}
|
||||
|
||||
#language{
|
||||
margin: 0px 3px 0px 10px;
|
||||
}
|
||||
|
||||
#clock {
|
||||
margin: 0px 6px 0px 10px;
|
||||
}
|
||||
|
||||
#battery.warning {
|
||||
color: rgba(255, 210, 4, 1);
|
||||
}
|
||||
|
||||
#battery.critical {
|
||||
color: rgba(238, 46, 36, 1);
|
||||
}
|
||||
|
||||
#battery.charging {
|
||||
color: rgba(217, 216, 216, 1);
|
||||
}
|
||||
|
||||
#custom-notification {
|
||||
font-family: "NotoSansMono Nerd Font";
|
||||
margin: 0px 6px 0px 8px;
|
||||
}
|
||||
|
||||
#tray{
|
||||
margin-left: 5px;
|
||||
}
|
||||
/* #pulseaudio-slider slider { */
|
||||
/* min-height: 0px; */
|
||||
/* min-width: 0px; */
|
||||
/* opacity: 0; */
|
||||
/* background-image: none; */
|
||||
/* border: none; */
|
||||
/* box-shadow: none; */
|
||||
/* } */
|
||||
/* #pulseaudio-slider trough { */
|
||||
/* min-height: 80px; */
|
||||
/* min-width: 10px; */
|
||||
/* border-radius: 5px; */
|
||||
/* background-color: black; */
|
||||
/* } */
|
||||
/* #pulseaudio-slider highlight { */
|
||||
/* min-width: 10px; */
|
||||
/* border-radius: 5px; */
|
||||
/* background-color: green; */
|
||||
/* } */
|
166
zsh/.profile
Normal file
166
zsh/.profile
Normal file
@ -0,0 +1,166 @@
|
||||
# Sample .profile for SUSE Linux
|
||||
# rewritten by Christian Steinruecken <cstein@suse.de>
|
||||
#
|
||||
# This file is read each time a login shell is started.
|
||||
# All other interactive shells will only read .bashrc; this is particularly
|
||||
# important for language settings, see below.
|
||||
|
||||
test -z "$PROFILEREAD" && . /etc/profile || true
|
||||
|
||||
# Some applications read the EDITOR variable to determine your favourite text
|
||||
# editor. So uncomment the line below and enter the editor of your choice :-)
|
||||
#export EDITOR=/usr/bin/vim
|
||||
#export EDITOR=/usr/bin/mcedit
|
||||
|
||||
# For some news readers it makes sense to specify the NEWSSERVER variable here
|
||||
#export NEWSSERVER=your.news.server
|
||||
|
||||
# Some people don't like fortune. If you uncomment the following lines,
|
||||
# you will have a fortune each time you log in ;-)
|
||||
|
||||
#if [ -x /usr/bin/fortune ] ; then
|
||||
# echo
|
||||
# /usr/bin/fortune
|
||||
# echo
|
||||
#fi
|
||||
|
||||
|
||||
# Added by Toolbox App
|
||||
export PATH="$PATH:/home/themystery/.local/share/JetBrains/Toolbox/scripts"
|
||||
|
||||
. "$HOME/.cargo/env"
|
||||
# eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
||||
test -s ~/.alias && . ~/.alias || true
|
||||
|
||||
# test -d ~/.linuxbrew && eval "$(~/.linuxbrew/bin/brew shellenv)"
|
||||
# test -d /home/linuxbrew/.linuxbrew && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
||||
# test -r ~/.bash_profile && echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.bash_profile
|
||||
# echo "eval \"\$($(brew --prefix)/bin/brew shellenv)\"" >> ~/.profile
|
||||
|
||||
# load bash_completion from brew if exists
|
||||
# if [ -d "/home/linuxbrew/.linuxbrew/etc/bash_completion.d" ]; then
|
||||
# # loop through all files in bash_completion.d and source them
|
||||
# for f in /home/linuxbrew/.linuxbrew/etc/bash_completion.d/*; do
|
||||
# . $f
|
||||
# done
|
||||
# fi
|
||||
|
||||
|
||||
alias vim="nvim"
|
||||
export NEOCONFPATH="$HOME/Documents/init.lua"
|
||||
alias overwatch='lutris lutris:rungame/overwatch-2'
|
||||
|
||||
alias nuget='mono ~/nuget.exe'
|
||||
|
||||
# alias rm = "rm -i"
|
||||
|
||||
# opensuse zypper aliases
|
||||
alias zrmu="zypper packages --unneeded | awk -F'|' 'NR==0 || NR==1 || NR==2 || NR==3 || NR==4 {next} {print $3}' | rg -v Name | sudo xargs -r zypper remove --clean-deps"
|
||||
alias zin="sudo zypper in"
|
||||
alias zse="zypper se"
|
||||
alias zrm="sudo zypper rm"
|
||||
alias zre="sudo zypper ref"
|
||||
alias zup="sudo zypper up"
|
||||
alias zdup="sudo zypper dup"
|
||||
alias zrn="sudo zypper ps -s"
|
||||
alias zve="sudo zypper ve"
|
||||
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
|
||||
export SUDO_EDITOR="nvim"
|
||||
mkcdir ()
|
||||
{
|
||||
mkdir -p -- "$1" &&
|
||||
cd -P -- "$1"
|
||||
}
|
||||
|
||||
# fzf + fd
|
||||
export FZF_DEFAULT_COMMAND="fd . $HOME"
|
||||
|
||||
_check_hidden_arg(){
|
||||
if [[ "$1" = "--hidden" ]]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# need to clean this up(TODO)
|
||||
cdf(){
|
||||
arg=$1
|
||||
hidden=false
|
||||
if _check_hidden_arg "$arg"; then
|
||||
hidden=true
|
||||
arg=$2
|
||||
fi
|
||||
if [ -z "$arg" ]; then
|
||||
if $hidden; then
|
||||
result="$($FZF_DEFAULT_COMMAND --hidden | fzf)"
|
||||
if [ -d "$result" ]; then
|
||||
cd "$result"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
result="$(fzf $arg)"
|
||||
if [ -d "$result" ]; then
|
||||
cd "$result"
|
||||
return 0
|
||||
fi
|
||||
echo "Not a directory or empty"
|
||||
return 1
|
||||
fi
|
||||
fd_command="fd . $arg --type d --max-depth 1"
|
||||
if $hidden; then
|
||||
fd_command="$fd_command --hidden"
|
||||
fi
|
||||
cd "$($fd_command | fzf)"
|
||||
}
|
||||
|
||||
# need to clean up this function(TODO)
|
||||
vimf(){
|
||||
arg=$1
|
||||
hidden=false
|
||||
if _check_hidden_arg "$arg"; then
|
||||
hidden=true
|
||||
arg=$2
|
||||
fi
|
||||
if [ -z "$arg" ]; then
|
||||
if $hidden; then
|
||||
result="$($FZF_DEFAULT_COMMAND --hidden | fzf)"
|
||||
vim "$result"
|
||||
if [ -d "$result" ]; then
|
||||
cd "$result"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
result="$(fzf $arg)"
|
||||
if [ -z "$result" ]; then
|
||||
echo "Not a file/directory or empty"
|
||||
return 1
|
||||
fi
|
||||
vim "$result"
|
||||
if [ -d "$result" ]; then
|
||||
cd "$result"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
fd_command="fd . $arg --max-depth 1"
|
||||
if $hidden; then
|
||||
fd_command="$fd_command --hidden"
|
||||
fi
|
||||
result=$($fd_command | fzf)
|
||||
if [ -d "$result" ]; then
|
||||
cd "$result"
|
||||
fi
|
||||
|
||||
vim "$result"
|
||||
}
|
||||
|
||||
|
||||
alias clear="clear && pfetch"
|
||||
alias gitstat='git log --format="%aN" | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | awk '\''{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }'\'' -; done'
|
||||
alias clearhm="clear && cd ~"
|
||||
alias rm="rm -i"
|
||||
alias hyprexec="hyprctl dispatch exec"
|
||||
alias tgwaybar="killall -SIGUSR1 waybar"
|
||||
alias rwaybar="killall -SIGUSR2 waybar"
|
78
zsh/.zshrc
Normal file
78
zsh/.zshrc
Normal file
@ -0,0 +1,78 @@
|
||||
export PF_INFO="ascii title os host kernel uptime pkgs memory shell de"
|
||||
pfetch
|
||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
||||
# Initialization code that may require console input (password prompts, [y/n]
|
||||
# confirmations, etc.) must go above this block; everything else may go below.
|
||||
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
# Created by newuser for 5.9
|
||||
# my alliases are in ~/.profile so this just sources it
|
||||
[[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile'
|
||||
|
||||
# enable vi mode
|
||||
bindkey -v
|
||||
|
||||
fpath+=~/.zsh
|
||||
|
||||
export PATH="$PATH:$HOME/.dotnet/tools"
|
||||
|
||||
source <(copilot completion zsh)
|
||||
|
||||
|
||||
|
||||
# _dotnet_zsh_complete()
|
||||
# {
|
||||
# local completions=("$(dotnet complete "$words")")
|
||||
#
|
||||
# # If the completion list is empty, just continue with filename selection
|
||||
# if [ -z "$completions" ]
|
||||
# then
|
||||
# _arguments '*::arguments: _normal'
|
||||
# return
|
||||
# fi
|
||||
#
|
||||
# # This is not a variable assignment, don't remove spaces!
|
||||
# _values = "${(ps:\n:)completions}"
|
||||
# }
|
||||
#
|
||||
# compdef _dotnet_zsh_complete dotnet
|
||||
|
||||
# useful plugins
|
||||
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||
source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||
source ~/.zsh/zsh-autocomplete/zsh-autocomplete.plugin.zsh
|
||||
|
||||
# aws cli completion for zsh
|
||||
autoload bashcompinit && bashcompinit
|
||||
complete -C '/usr/local/bin/aws_completer' aws
|
||||
eval "$(register-python-argcomplete pipx)"
|
||||
|
||||
# pnpm
|
||||
export PNPM_HOME="/home/themystery/.local/share/pnpm"
|
||||
case ":$PATH:" in
|
||||
*":$PNPM_HOME:"*) ;;
|
||||
*) export PATH="$PNPM_HOME:$PATH" ;;
|
||||
esac
|
||||
# pnpm end
|
||||
|
||||
# add Pulumi to the PATH
|
||||
export PATH=$PATH:$HOME/.pulumi/bin
|
||||
export PATH=$PATH:/home/themystery/.spicetify
|
||||
source ~/.zsh/powerlevel10k/powerlevel10k.zsh-theme
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||
|
||||
export PATH="$HOME/go/bin:$PATH"
|
||||
|
||||
# bun completions
|
||||
[ -s "/home/themystery/.bun/_bun" ] && source "/home/themystery/.bun/_bun"
|
||||
|
||||
# bun
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
export PATH="$BUN_INSTALL/bin:$PATH"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user