Bunch of things
parent
e664956065
commit
0e67bba162
|
@ -2,6 +2,9 @@
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
[[ $- != *i* ]] && return
|
[[ $- != *i* ]] && return
|
||||||
|
|
||||||
|
# Ansible defaults
|
||||||
|
export ANSIBLE_BECOME_ASK_PASS=yes
|
||||||
|
|
||||||
# Add ~/bin and ~/bin/scripts to my path
|
# Add ~/bin and ~/bin/scripts to my path
|
||||||
export PATH=$PATH:$HOME/bin/:$HOME/bin/scripts/:$HOME/.cargo/bin
|
export PATH=$PATH:$HOME/bin/:$HOME/bin/scripts/:$HOME/.cargo/bin
|
||||||
|
|
||||||
|
@ -133,6 +136,8 @@ alias proj="cd-projects"
|
||||||
# Use the kitty kitten for ssh so sessions can be cached and remote editing/session cloning is possible.
|
# Use the kitty kitten for ssh so sessions can be cached and remote editing/session cloning is possible.
|
||||||
alias ssh="kitty +kitten ssh"
|
alias ssh="kitty +kitten ssh"
|
||||||
|
|
||||||
|
alias paru="paru --bottomup"
|
||||||
|
|
||||||
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
|
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
|
||||||
export SDKMAN_DIR="$HOME/.sdkman"
|
export SDKMAN_DIR="$HOME/.sdkman"
|
||||||
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||||
|
|
|
@ -2,10 +2,32 @@
|
||||||
(defpoll year :interval "10h" "date '+%Y'")
|
(defpoll year :interval "10h" "date '+%Y'")
|
||||||
(defpoll date :interval "30m" "date '+%m-%d'")
|
(defpoll date :interval "30m" "date '+%m-%d'")
|
||||||
|
|
||||||
(defpoll media-player_art-url :interval "10s" "playerctl metadata mpris:artUrl")
|
(defpoll audio_sink_default
|
||||||
(defpoll media-player_status :interval "10s" "playerctl status")
|
:interval "10s"
|
||||||
(defpoll media-player_title :interval "10s" "playerctl metadata xesam:title | ellipse -n 30")
|
`pactl get-default-sink`)
|
||||||
(defpoll media-player_artist :interval "10s" "playerctl metadata xesam:artist")
|
|
||||||
|
|
||||||
; TODO: Change this to a script that gets polled every x seconds. Or even a script in the window manager to update this variable when changing workspace.
|
(defpoll audio_source_default
|
||||||
(defvar workspace 1)
|
:interval "10s"
|
||||||
|
`pactl get-default-source`)
|
||||||
|
|
||||||
|
(deflisten media-player_status
|
||||||
|
:initial "paused"
|
||||||
|
"playerctl --player plasma-browser-integration --follow status")
|
||||||
|
|
||||||
|
(deflisten media-player_metadata
|
||||||
|
:initial "{\"title\": \"Nothing playing\", \"album\": \"\", \"artist\": \"\", \"art_url\": \"\"}"
|
||||||
|
"playerctl --player plasma-browser-integration --follow metadata --format '{\"title\": \"{{title}}\", \"album\": \"{{album}}\", \"artist\": \"{{artist}}\", \"art_url\": \"{{mpris:artUrl}}\"}'")
|
||||||
|
|
||||||
|
(deflisten media-player_metadata_image
|
||||||
|
:initial "/tmp/mpris-thumb"
|
||||||
|
"playerctl --follow --player plasma-browser-integration --follow metadata --format {{mpris:artUrl}} | /home/kalle/bin/scripts/eww-playerctl-download-image")
|
||||||
|
|
||||||
|
(defpoll audio-sinks
|
||||||
|
:initial "[]"
|
||||||
|
:interval "10s"
|
||||||
|
"pactl -f json list sinks | jq '[.[]|{\"id\": .name, \"name\":.description, \"volume\": .volume.\"front-left\".value_percent | rtrimstr(\"%\"), \"muted\": .mute}]'")
|
||||||
|
|
||||||
|
(defpoll audio-sources
|
||||||
|
:initial "[]"
|
||||||
|
:interval "10s"
|
||||||
|
"pactl -f json list sources | jq '[.[] | select(.monitor_source == \"\") | {\"id\": .name, \"name\":.description, \"volume\": .volume.\"front-left\".value_percent | rtrimstr(\"%\"), \"muted\": .mute}]'")
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
(defwidget audio-sink [sink]
|
||||||
|
(box
|
||||||
|
:orientation "v"
|
||||||
|
(box :space-evenly false :spacing 15
|
||||||
|
(box "${sink.id == audio_sink_default ? "x " : ""}${sink.name}")
|
||||||
|
(box :hexpand true)
|
||||||
|
(button :onclick "pactl set-sink-mute \"${sink.id}\" toggle"
|
||||||
|
"M")
|
||||||
|
(button :onclick "pactl set-default-sink ${sink.id}"
|
||||||
|
"D")
|
||||||
|
)
|
||||||
|
(box :space-evenly false
|
||||||
|
(box :width 50
|
||||||
|
{sink.muted ? "Muted" : "${sink.volume}%"})
|
||||||
|
(scale :hexpand true
|
||||||
|
:value {sink.volume}
|
||||||
|
:onchange "pactl set-sink-volume ${sink.id} {}%"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defwidget audio-source [source]
|
||||||
|
(box
|
||||||
|
:orientation "v"
|
||||||
|
(box :space-evenly false :spacing 15
|
||||||
|
(box "${source.id == audio_source_default ? "x " : ""}${source.name}")
|
||||||
|
(box :hexpand true)
|
||||||
|
(button :onclick "pactl set-source-mute \"${source.id}\" toggle"
|
||||||
|
"M")
|
||||||
|
(button :onclick "pactl set-default-source ${source.id}"
|
||||||
|
"D")
|
||||||
|
)
|
||||||
|
(box :space-evenly false
|
||||||
|
(box :width 50
|
||||||
|
{source.muted ? "Muted" : "${source.volume}%"})
|
||||||
|
(scale :hexpand true
|
||||||
|
:value {source.volume}
|
||||||
|
:onchange "pactl set-source-volume ${source.id} {}%"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
99
eww/bar.yuck
99
eww/bar.yuck
|
@ -1,11 +1,3 @@
|
||||||
(defwidget user-icon []
|
|
||||||
(eventbox :class "user-icon"
|
|
||||||
(box :class "img"
|
|
||||||
:height 50
|
|
||||||
:width 50)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(defwidget notifications []
|
(defwidget notifications []
|
||||||
(eventbox :class "notifications"
|
(eventbox :class "notifications"
|
||||||
""
|
""
|
||||||
|
@ -24,62 +16,30 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defwidget top []
|
(defwidget color-picker []
|
||||||
(box :class "top"
|
(eventbox :class "color-picker"
|
||||||
:space-evenly "false"
|
:onclick "hyprctl dispatch exec \"hyprpicker --no-fancy | wl-copy\""
|
||||||
:valign "start"
|
""
|
||||||
:orientation "v"
|
|
||||||
(user-icon) ; TODO: User Icon - Opens misc menu
|
|
||||||
(notifications) ; TODO: notifications - Opens notification menu
|
|
||||||
(audio) ; TODO: Audio - Opens audio menu (music controls and volume)
|
|
||||||
(clipboard); TODO: Clipboard - Opens clipboard menu (clipboard history click to make current)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defwidget workspace []
|
(defwidget left []
|
||||||
(box :class "workspace"
|
(box :class "left"
|
||||||
:orientation "v"
|
:halign "start"
|
||||||
:halign "center"
|
:orientation "h"
|
||||||
:space-evenly "true"
|
(notifications) ; TODO: notifications - Opens notification menu
|
||||||
(box :class {workspace == 1 ? "single-selected" : "single"}
|
(audio)
|
||||||
:width 25
|
(clipboard); TODO: Clipboard - Opens clipboard menu (clipboard history click to make current)
|
||||||
:height 25)
|
;; TODO: Bluetooth something
|
||||||
(box :class {workspace == 2 ? "single-selected" : "single"}
|
(color-picker)
|
||||||
:width 25
|
|
||||||
:height 25)
|
|
||||||
(box :class {workspace == 3 ? "single-selected" : "single"}
|
|
||||||
:width 25
|
|
||||||
:height 25)
|
|
||||||
(box :class {workspace == 4 ? "single-selected" : "single"}
|
|
||||||
:width 25
|
|
||||||
:height 25)
|
|
||||||
(box :class {workspace == 5 ? "single-selected" : "single"}
|
|
||||||
:width 25
|
|
||||||
:height 25)
|
|
||||||
(box :class {workspace == 6 ? "single-selected" : "single"}
|
|
||||||
:width 25
|
|
||||||
:height 25)
|
|
||||||
(box :class {workspace == 7 ? "single-selected" : "single"}
|
|
||||||
:width 25
|
|
||||||
:height 25)
|
|
||||||
(box :class {workspace == 8 ? "single-selected" : "single"}
|
|
||||||
:width 25
|
|
||||||
:height 25)
|
|
||||||
(box :class {workspace == 9 ? "single-selected" : "single"}
|
|
||||||
:width 25
|
|
||||||
:height 25)
|
|
||||||
(box :class {workspace == 10 ? "single-selected" : "single"}
|
|
||||||
:width 25
|
|
||||||
:height 25)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defwidget center []
|
(defwidget center []
|
||||||
(box :class "top"
|
(box :class "center"
|
||||||
:space-evenly "false"
|
:space-evenly "false"
|
||||||
:valign "center"
|
:valign "center"
|
||||||
:orientation "v"
|
:orientation "h"
|
||||||
(workspace) ; TODO: Workspace indicator - Highlight current workspace (Click to go to?)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -91,39 +51,38 @@
|
||||||
|
|
||||||
(defwidget date []
|
(defwidget date []
|
||||||
(eventbox :class "date"
|
(eventbox :class "date"
|
||||||
(box :orientation "v"
|
"${year}-${date}"
|
||||||
year
|
|
||||||
date
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defwidget bottom []
|
(defwidget right []
|
||||||
(box :class "top"
|
(box :class "right"
|
||||||
:space-evenly "false"
|
:space-evenly "false"
|
||||||
:valign "end"
|
:halign "end"
|
||||||
|
:valign "center"
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
|
; TODO: Redo this thing and make it open calendar view
|
||||||
(time) ; TODO: Time - Open timer/stopwatch menu?
|
(time) ; TODO: Time - Open timer/stopwatch menu?
|
||||||
(date) ; TODO: Year month day - Open calendar/upcomming events list (source these from some daemon?)
|
(date) ; TODO: Year month day - Open calendar/upcoming events list (source these from some daemon?)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defwidget bar []
|
(defwidget bar []
|
||||||
(box :class "bar"
|
(box :class "bar"
|
||||||
:orientation "v"
|
:orientation "h"
|
||||||
(top)
|
(left)
|
||||||
(center)
|
(center)
|
||||||
(bottom)
|
(right)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defwindow bar
|
(defwindow bar
|
||||||
:monitor 2
|
:monitor 2
|
||||||
:geometry (geometry :x "0px"
|
:geometry (geometry :x "0px"
|
||||||
:y "0px"
|
:y "10px"
|
||||||
:width "50px"
|
:width "1060px"
|
||||||
:height "100%"
|
:height "50px"
|
||||||
:anchor "top left")
|
:anchor "center top")
|
||||||
:stacking "fg"
|
:stacking "fg"
|
||||||
:exclusive true
|
:exclusive true
|
||||||
(bar)
|
(bar)
|
||||||
|
|
46
eww/eww.scss
46
eww/eww.scss
|
@ -1,49 +1,42 @@
|
||||||
$clr-primary: #883333;
|
$clr-primary: #883333;
|
||||||
$clr-background: rgba(0, 0, 0, 0.75);
|
$clr-background: rgba(0, 0, 0, 0.5);
|
||||||
|
|
||||||
.bar {
|
.bar {
|
||||||
background-color: $clr-background;
|
background-color: $clr-background;
|
||||||
|
border-radius: 10px;
|
||||||
|
|
||||||
.user-icon {
|
.notifications, .audio, .clipboard, .color-picker {
|
||||||
// &:hover {
|
label {
|
||||||
// background-color: rgba(#888888, 0.2);
|
font-size: 30px;
|
||||||
// }
|
|
||||||
.img {
|
|
||||||
background-image: url("file:///home/kalle/Pictures/Wallpapers/Boat.jpg");
|
|
||||||
background-size: cover;
|
|
||||||
border-radius: 100%;
|
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.notifications, .audio, .clipboard {
|
|
||||||
font-size: 30px;
|
|
||||||
margin: 5px;
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: $clr-primary;
|
color: $clr-primary;
|
||||||
// background-color: rgba(#888888, 0.2);
|
// background-color: rgba(#888888, 0.2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.workspace {
|
|
||||||
|
|
||||||
.single, .single-selected {
|
.left {
|
||||||
margin: 5px;
|
margin-left: 10px;
|
||||||
border-radius: 100%;
|
}
|
||||||
border: 2px solid white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.single-selected {
|
.right {
|
||||||
border-color: $clr-primary;
|
margin-right: 10px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.audio {
|
.audio {
|
||||||
background-color: $clr-background;
|
background-color: $clr-background;
|
||||||
|
border-radius: 5px;
|
||||||
|
|
||||||
.audio-title {
|
.audio-sinks {
|
||||||
font-size: 30px;
|
margin-left: 50px;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
.audio-sources {
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-right: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.media-player {
|
.media-player {
|
||||||
|
@ -76,3 +69,6 @@ $clr-background: rgba(0, 0, 0, 0.75);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
(include "_variables.yuck")
|
(include "_variables.yuck")
|
||||||
|
(include "util.yuck")
|
||||||
|
(include "audio.yuck")
|
||||||
(include "bar.yuck")
|
(include "bar.yuck")
|
||||||
(include "volume.yuck")
|
(include "volume.yuck")
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
(defwidget title [content]
|
||||||
|
(box :class "title"
|
||||||
|
content
|
||||||
|
)
|
||||||
|
)
|
|
@ -6,16 +6,16 @@
|
||||||
circle farthest-side at left,
|
circle farthest-side at left,
|
||||||
rgba(0, 0, 0, 0.9) 40%,
|
rgba(0, 0, 0, 0.9) 40%,
|
||||||
rgba(0, 0, 0, 0.2) 70%),
|
rgba(0, 0, 0, 0.2) 70%),
|
||||||
url('${media-player_art-url}');"
|
url('${media-player_metadata_image}');"
|
||||||
(box :orientation "v"
|
(box :orientation "v"
|
||||||
(box :class "title"
|
(box :class "title"
|
||||||
:halign "start"
|
:halign "start"
|
||||||
media-player_title
|
{media-player_metadata.title}
|
||||||
)
|
)
|
||||||
|
|
||||||
(box :class "artist"
|
(box :class "artist"
|
||||||
:halign "start"
|
:halign "start"
|
||||||
media-player_artist
|
{media-player_metadata.artist}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
(eventbox :class "pause"
|
(eventbox :class "pause"
|
||||||
:width 40
|
:width 40
|
||||||
:onclick "playerctl play-pause"
|
:onclick "playerctl play-pause"
|
||||||
${media-player_status == "Playing" ? "" : "契"}
|
{media-player_status == "Playing" ? "" : "契"}
|
||||||
)
|
)
|
||||||
(eventbox :class "next"
|
(eventbox :class "next"
|
||||||
:width 40
|
:width 40
|
||||||
|
@ -50,23 +50,52 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(defwidget audio-sinks []
|
||||||
|
(box :orientation "v" :class "audio-sinks" :space-evenly false
|
||||||
|
(title :content "Sinks")
|
||||||
|
{audio_sink_default ? "" : ""} ;; This is dumb, but fixes this variable not updating
|
||||||
|
(for sink in audio-sinks
|
||||||
|
(audio-sink :sink {sink})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defwidget audio-sources []
|
||||||
|
(box :orientation "v" :class "audio-sources" :space-evenly false
|
||||||
|
(title :content "Sources")
|
||||||
|
{audio_source_default ? "" : ""} ;; This is dumb, but fixes this variable not updating
|
||||||
|
(for source in audio-sources
|
||||||
|
(audio-source :source {source})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
(defwidget audio-window []
|
(defwidget audio-window []
|
||||||
(box :class "audio"
|
(box :class "audio"
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
; (audio-title)
|
;; TODO: Maybe individual applications as well.
|
||||||
(media-player)
|
(box :orientation "h"
|
||||||
|
(media-player)
|
||||||
|
(box
|
||||||
|
;; TODO: Put something here
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(box :orientation "h"
|
||||||
|
(audio-sinks)
|
||||||
|
(audio-sources)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defwindow audio
|
(defwindow audio
|
||||||
:monitor 2
|
:monitor 2
|
||||||
:geometry (geometry :x "50px"
|
:geometry (geometry :x "10px"
|
||||||
:y "0px"
|
:y "10px"
|
||||||
:width "500px"
|
:width "1060"
|
||||||
:height "100%"
|
:height "500px"
|
||||||
:anchor "top left")
|
:anchor "top center")
|
||||||
:stacking "fg"
|
:stacking "overlay"
|
||||||
:exclusive true
|
:exclusive false
|
||||||
(audio-window)
|
(audio-window)
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,19 +1,36 @@
|
||||||
local cmp = require'cmp'
|
local cmp = require'cmp'
|
||||||
|
local luasnip = require'luasnip'
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
vim.fn["vsnip#anonymous"](args.body)
|
require('luasnip').lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||||
-- Add tab support
|
-- Add tab support
|
||||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
if cmp.visible() then
|
||||||
['<C-S-f>'] = cmp.mapping.scroll_docs(-4),
|
cmp.select_prev_item()
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
['<Tab>'] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { 'i', 's' }),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
['<C-e>'] = cmp.mapping.close(),
|
['<C-e>'] = cmp.mapping.close(),
|
||||||
['<CR>'] = cmp.mapping.confirm({
|
['<CR>'] = cmp.mapping.confirm({
|
||||||
|
@ -23,13 +40,12 @@ cmp.setup({
|
||||||
}),
|
}),
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'path' }, -- file paths
|
{ name = 'path' }, -- file paths
|
||||||
{ name = 'nvim_lsp', keyword_length = 3 }, -- from language server
|
{ name = 'nvim_lsp' }, -- from language server
|
||||||
{ name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
|
{ name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
|
||||||
{ name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.*
|
{ name = 'luasnip' },
|
||||||
{ name = 'buffer', keyword_length = 2 }, -- source current buffer
|
{ name = 'nvim_lua' }, -- complete neovim's Lua runtime API such vim.lsp.*
|
||||||
{ name = 'vsnip', keyword_length = 2 }, -- nvim-cmp source for vim-vsnip
|
{ name = 'buffer' }, -- source current buffer
|
||||||
{ name = 'calc'}, -- source for math calculation
|
{ name = 'calc'}, -- source for math calculation
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
}),
|
}),
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
|
@ -66,18 +82,13 @@ cmp.setup.cmdline('/', {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
-- TODO: This doesn't seem to work with Noice. Maybe it starts to work with a new release.
|
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||||
-- -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
cmp.setup.cmdline(':', {
|
||||||
-- cmp.setup.cmdline(':', {
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
-- mapping = cmp.mapping.preset.cmdline(),
|
sources = cmp.config.sources({
|
||||||
-- sources = cmp.config.sources({
|
{ name = 'path' }
|
||||||
-- { name = 'path' }
|
}, {
|
||||||
-- }, {
|
{ name = 'cmdline' }
|
||||||
-- { name = 'cmdline' }
|
})
|
||||||
-- })
|
})
|
||||||
-- })
|
|
||||||
|
|
||||||
-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers..
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
require('which-key').setup()
|
||||||
|
require('neogit').setup()
|
||||||
|
require('lualine').setup()
|
||||||
|
require('marks').setup()
|
||||||
|
require('Comment').setup()
|
||||||
|
require('illuminate').configure()
|
||||||
|
require("todo-comments").setup()
|
||||||
|
require("nvim-autopairs").setup()
|
||||||
|
require("fidget").setup()
|
||||||
|
require('nvim-highlight-colors').setup()
|
||||||
|
|
||||||
|
require('gitsigns').setup {
|
||||||
|
current_line_blame = true,
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
---@diagnostic disable: redefined-local
|
||||||
|
|
||||||
|
local function map(mode, keys, func, desc, silent)
|
||||||
|
local silent = silent == nil and true or silent
|
||||||
|
vim.keymap.set(mode, keys, func, {desc = desc, silent = silent})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Movement between windows
|
||||||
|
map('n', '<leader>h', function() vim.cmd.wincmd('h') end, "Window Left")
|
||||||
|
map('n', '<leader>j', function() vim.cmd.wincmd('j') end, "Window Down")
|
||||||
|
map('n', '<leader>k', function() vim.cmd.wincmd('k') end, "Window Up")
|
||||||
|
map('n', '<leader>l', function() vim.cmd.wincmd('l') end, "Window Right")
|
||||||
|
|
||||||
|
-- Buffer hotkeys
|
||||||
|
map('n', '<leader>1', function() vim.cmd.BufferLineGoToBuffer(1) end, 'Tab 1')
|
||||||
|
map('n', '<leader>2', function() vim.cmd.BufferLineGoToBuffer(2) end, 'Tab 2')
|
||||||
|
map('n', '<leader>3', function() vim.cmd.BufferLineGoToBuffer(3) end, 'Tab 3')
|
||||||
|
map('n', '<leader>4', function() vim.cmd.BufferLineGoToBuffer(4) end, 'Tab 4')
|
||||||
|
map('n', '<leader>5', function() vim.cmd.BufferLineGoToBuffer(5) end, 'Tab 5')
|
||||||
|
map('n', '<leader>6', function() vim.cmd.BufferLineGoToBuffer(6) end, 'Tab 6')
|
||||||
|
map('n', '<leader>7', function() vim.cmd.BufferLineGoToBuffer(7) end, 'Tab 7')
|
||||||
|
map('n', '<leader>8', function() vim.cmd.BufferLineGoToBuffer(8) end, 'Tab 8')
|
||||||
|
map('n', '<leader>9', function() vim.cmd.BufferLineGoToBuffer(9) end, 'Tab 9')
|
||||||
|
|
||||||
|
map('n', '<leader>tt', vim.cmd.NvimTreeToggle, '[T]oggle file [T]ree')
|
||||||
|
map('n', '<leader>tg', vim.cmd.Neogit, '[T]oggle [G]it view')
|
||||||
|
map('n', '<leader>tu', require('undotree').toggle, '[T]oggle [U]ndo tree')
|
||||||
|
|
||||||
|
map('n', '[d', vim.diagnostic.goto_prev, 'Goto Previous Diagnostic')
|
||||||
|
map('n', ']d', vim.diagnostic.goto_next, 'Goto Next Diagnostic')
|
||||||
|
map('n', '<leader>e', vim.diagnostic.open_float, 'Show [E]rrors')
|
||||||
|
map('n', '<leader>q', vim.diagnostic.setloclist, 'Errors to [Q]uickfix')
|
||||||
|
|
||||||
|
|
||||||
|
map('n', '<leader>?', require('telescope.builtin').oldfiles, '[?] Find recently opened files')
|
||||||
|
map('n', '<leader><space>', require('telescope.builtin').buffers, '[ ] Find existing buffers')
|
||||||
|
map('n', '<leader>sf', require('telescope.builtin').find_files, '[S]earch [F]iles')
|
||||||
|
map('n', '<leader>sh', require('telescope.builtin').help_tags, '[S]earch [H]elp')
|
||||||
|
map('n', '<leader>sw', require('telescope.builtin').grep_string, '[S]earch current [W]ord')
|
||||||
|
map('n', '<leader>sg', require('telescope.builtin').live_grep, '[S]earch by [G]rep')
|
||||||
|
map('n', '<leader>sd', require('telescope.builtin').diagnostics, '[S]earch [D]iagnostics')
|
||||||
|
|
||||||
|
map({'n', 't'}, '<A-t>', require("FTerm").toggle, 'Toggle Terminal')
|
||||||
|
|
|
@ -0,0 +1,132 @@
|
||||||
|
require("mason").setup()
|
||||||
|
require("mason-lspconfig").setup()
|
||||||
|
|
||||||
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
|
|
||||||
|
local on_attach = function(_, bufnr)
|
||||||
|
local nmap = function(keys, func, desc)
|
||||||
|
if desc then
|
||||||
|
desc = 'LSP: ' .. desc
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||||
|
end
|
||||||
|
|
||||||
|
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||||
|
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||||
|
|
||||||
|
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||||
|
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||||
|
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||||
|
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
||||||
|
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||||
|
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||||
|
|
||||||
|
-- See `:help K` for why this keymap
|
||||||
|
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||||
|
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||||
|
|
||||||
|
-- Lesser used LSP functionality
|
||||||
|
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||||
|
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||||
|
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||||
|
nmap('<leader>wl', function()
|
||||||
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
end, '[W]orkspace [L]ist Folders')
|
||||||
|
|
||||||
|
-- Create a command `:Format` local to the LSP buffer
|
||||||
|
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||||
|
if vim.lsp.buf.format then
|
||||||
|
vim.lsp.buf.format()
|
||||||
|
elseif vim.lsp.buf.formatting then
|
||||||
|
vim.lsp.buf.formatting()
|
||||||
|
end
|
||||||
|
end, { desc = 'Format current buffer with LSP' })
|
||||||
|
end
|
||||||
|
|
||||||
|
require("mason-lspconfig").setup_handlers({
|
||||||
|
function (server_name) -- default handler (optional)
|
||||||
|
if server_name == 'sumneko_lua' then
|
||||||
|
require("lspconfig")[server_name].setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
globals = {'vim'}
|
||||||
|
},
|
||||||
|
runtime = {
|
||||||
|
version = "LuaJIT",
|
||||||
|
path = vim.split(package.path, ";")
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = {
|
||||||
|
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||||
|
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
else
|
||||||
|
require("lspconfig")[server_name].setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
require('mason-nvim-dap').setup()
|
||||||
|
|
||||||
|
|
||||||
|
local rt_config = {
|
||||||
|
server = {
|
||||||
|
on_attach = on_attach,
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
checkOnSave = {
|
||||||
|
command = "clippy"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require('rust-tools').setup(rt_config)
|
||||||
|
|
||||||
|
-- LSP Diagnostics Options Setup
|
||||||
|
local sign = function(opts)
|
||||||
|
vim.fn.sign_define(opts.name, {
|
||||||
|
texthl = opts.name,
|
||||||
|
text = opts.text,
|
||||||
|
numhl = ''
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
sign({name = 'DiagnosticSignError', text = ''})
|
||||||
|
sign({name = 'DiagnosticSignWarn', text = ''})
|
||||||
|
sign({name = 'DiagnosticSignHint', text = ''})
|
||||||
|
sign({name = 'DiagnosticSignInfo', text = ''})
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = false,
|
||||||
|
signs = true,
|
||||||
|
update_in_insert = true,
|
||||||
|
underline = true,
|
||||||
|
severity_sort = false,
|
||||||
|
float = {
|
||||||
|
border = 'rounded',
|
||||||
|
source = 'always',
|
||||||
|
header = '',
|
||||||
|
prefix = '',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd([[
|
||||||
|
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
require('nvim-lightbulb').setup({autocmd = {enabled = true}})
|
|
@ -19,3 +19,5 @@ require('nvim-tree').setup {
|
||||||
dotfiles = true,
|
dotfiles = true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require("lsp-file-operations").setup()
|
|
@ -0,0 +1,13 @@
|
||||||
|
require('telescope').setup {
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
['<C-u>'] = false,
|
||||||
|
['<C-d>'] = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require("telescope").load_extension("ui-select")
|
||||||
|
pcall(require('telescope').load_extension, 'fzf')
|
|
@ -12,6 +12,9 @@ require('nvim-treesitter.configs').setup {
|
||||||
enable = true,
|
enable = true,
|
||||||
extended_mode = true,
|
extended_mode = true,
|
||||||
max_file_lines = nil,
|
max_file_lines = nil,
|
||||||
|
},
|
||||||
|
autotag = {
|
||||||
|
enable = true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
require('undotree').setup()
|
|
@ -2,13 +2,21 @@ vim.opt.termguicolors = true
|
||||||
vim.opt.clipboard = 'unnamed,unnamedplus'
|
vim.opt.clipboard = 'unnamed,unnamedplus'
|
||||||
vim.opt.timeoutlen = 300
|
vim.opt.timeoutlen = 300
|
||||||
vim.opt.mouse = 'a'
|
vim.opt.mouse = 'a'
|
||||||
vim.opt.undodir = vim.fn.expand('~/.cache/vim/undo')
|
|
||||||
vim.opt.listchars = 'tab:▸ ,extends:❯,precedes:❮'
|
vim.opt.listchars = 'tab:▸ ,extends:❯,precedes:❮'
|
||||||
|
|
||||||
|
vim.opt.swapfile = false
|
||||||
|
vim.opt.backup = false
|
||||||
|
vim.opt.undodir = vim.fn.expand('~/.cache/vim/undo')
|
||||||
|
vim.opt.undofile = true
|
||||||
|
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
vim.opt.list = true
|
vim.opt.list = true
|
||||||
|
|
||||||
|
vim.opt.wrap = false
|
||||||
|
|
||||||
|
vim.opt.scrolloff = 8
|
||||||
|
|
||||||
vim.opt.autoindent = true
|
vim.opt.autoindent = true
|
||||||
vim.opt.expandtab = true
|
vim.opt.expandtab = true
|
||||||
vim.opt.softtabstop = 4
|
vim.opt.softtabstop = 4
|
||||||
|
@ -19,27 +27,20 @@ vim.opt.modeline = true
|
||||||
|
|
||||||
vim.opt.spell = true
|
vim.opt.spell = true
|
||||||
|
|
||||||
vim.opt.undofile = true
|
|
||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = ' '
|
||||||
|
|
||||||
|
vim.opt.hlsearch = false
|
||||||
|
vim.opt.incsearch = true
|
||||||
|
vim.opt.signcolumn = 'yes'
|
||||||
|
|
||||||
|
vim.opt.updatetime = 50
|
||||||
vim.opt.completeopt = {'menuone', 'noselect', 'noinsert'}
|
vim.opt.completeopt = {'menuone', 'noselect', 'noinsert'}
|
||||||
vim.opt.shortmess = vim.opt.shortmess + { c = true}
|
vim.opt.shortmess = vim.opt.shortmess + { c = true}
|
||||||
vim.api.nvim_set_option('updatetime', 100)
|
|
||||||
|
|
||||||
-- Always show signcolumn
|
|
||||||
vim.cmd([[
|
|
||||||
set signcolumn=yes
|
|
||||||
]])
|
|
||||||
|
|
||||||
-- Load utilities
|
|
||||||
require('kalle.utils')
|
|
||||||
-- Load plugins
|
-- Load plugins
|
||||||
require('kalle.plugins')
|
require('kalle.plugins')
|
||||||
|
|
||||||
vim.cmd('colorscheme carbonfox')
|
vim.cmd.colorscheme('carbonfox')
|
||||||
|
|
||||||
-- Load config
|
|
||||||
require('kalle.config')
|
|
||||||
|
|
||||||
-- TODO:
|
-- TODO:
|
||||||
-- - Debugger integration (gdb?, java?/kotlin?, rust?, etc) - nvim-dap and friends
|
-- - Debugger integration (gdb?, java?/kotlin?, rust?, etc) - nvim-dap and friends
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
require('kalle.config.keybinds')
|
|
||||||
require('kalle.config.neovide')
|
|
||||||
require('kalle.config.plugin-config')
|
|
|
@ -1,52 +0,0 @@
|
||||||
Keybind.g({
|
|
||||||
-- [ space + h ] move cursor to left window
|
|
||||||
{ 'n', '<Leader>h', '<Cmd>wincmd h<CR>', { noremap = true, desc = 'Window left' } },
|
|
||||||
-- [ space + l ] move cursor to bottom window
|
|
||||||
{ 'n', '<Leader>j', '<Cmd>wincmd j<CR>', { noremap = true, desc = 'Window down' } },
|
|
||||||
-- [ space + j ] move cursor to top window
|
|
||||||
{ 'n', '<Leader>k', '<Cmd>wincmd k<CR>', { noremap = true, desc = 'Window up' } },
|
|
||||||
-- [ space + k ] move cursor to right window
|
|
||||||
{ 'n', '<Leader>l', '<Cmd>wincmd l<CR>', { noremap = true, desc = 'Window right' } },
|
|
||||||
-- [ space + 1 ] tab 1
|
|
||||||
{ 'n', '<Leader>1', '<Cmd>BufferLineGoToBuffer 1<CR>', {noremap = true, desc = 'Tab 1' } },
|
|
||||||
-- [ space + 2 ] tab 2
|
|
||||||
{ 'n', '<Leader>2', '<Cmd>BufferLineGoToBuffer 2<CR>', {noremap = true, desc = 'Tab 2' } },
|
|
||||||
-- [ space + 3 ] tab 3
|
|
||||||
{ 'n', '<Leader>3', '<Cmd>BufferLineGoToBuffer 3<CR>', {noremap = true, desc = 'Tab 3' } },
|
|
||||||
-- [ space + 4 ] tab 4
|
|
||||||
{ 'n', '<Leader>4', '<Cmd>BufferLineGoToBuffer 4<CR>', {noremap = true, desc = 'Tab 4' } },
|
|
||||||
-- [ space + 5 ] tab 5
|
|
||||||
{ 'n', '<Leader>5', '<Cmd>BufferLineGoToBuffer 5<CR>', {noremap = true, desc = 'Tab 5' } },
|
|
||||||
-- [ space + 6 ] tab 6
|
|
||||||
{ 'n', '<Leader>6', '<Cmd>BufferLineGoToBuffer 6<CR>', {noremap = true, desc = 'Tab 6' } },
|
|
||||||
-- [ space + 7 ] tab 7
|
|
||||||
{ 'n', '<Leader>7', '<Cmd>BufferLineGoToBuffer 7<CR>', {noremap = true, desc = 'Tab 7' } },
|
|
||||||
-- [ space + 8 ] tab 8
|
|
||||||
{ 'n', '<Leader>8', '<Cmd>BufferLineGoToBuffer 8<CR>', {noremap = true, desc = 'Tab 8' } },
|
|
||||||
-- [ space + 9 ] tab 9
|
|
||||||
{ 'n', '<Leader>9', '<Cmd>BufferLineGoToBuffer 9<CR>', {noremap = true, desc = 'Tab 9' } },
|
|
||||||
|
|
||||||
-- [ space + t ] Toggles
|
|
||||||
{ 'n', '<Leader>t', '', { noremap = true, desc = '+Toggle' } },
|
|
||||||
-- [ space + t + t] Toggle file tree
|
|
||||||
{ 'n', '<Leader>tt', '<Cmd>NvimTreeToggle<CR>', { noremap = true, desc = 'Open file tree' } },
|
|
||||||
-- [ space + t + g] Neogit
|
|
||||||
{ 'n', '<Leader>tg', '<Cmd>Neogit<CR>', { noremap = true, desc = 'Open git status' } },
|
|
||||||
|
|
||||||
-- [ space + o] Open
|
|
||||||
{ 'n', '<Leader>o', '', { noremap = true, desc = '+Open' } },
|
|
||||||
-- [ space + o + f] Open file
|
|
||||||
{ 'n', '<Leader>of', '<Cmd>Telescope find_files<CR>', { noremap = true, desc = 'Open file' } },
|
|
||||||
|
|
||||||
-- [ space + c] Code
|
|
||||||
{ 'n', '<Leader>c', '', {noremap = true, desc = '+Code' } },
|
|
||||||
-- [ space + c + a] Code actions
|
|
||||||
{ 'n', '<Leader>ca', '<Cmd>lua vim.lsp.buf.code_action()<CR>', {noremap = true, desc = 'Code actions' } },
|
|
||||||
-- [ space + c]
|
|
||||||
{ 'n', '<Leader>cr', '<Cmd>Telescope lsp_references<CR>', {noremap = true, desc = 'References' } },
|
|
||||||
-- [ space + c]
|
|
||||||
{ 'n', '<Leader>cd', '<Cmd>Telescope lsp_definitions<CR>', {noremap = true, desc = 'Definitions' } },
|
|
||||||
|
|
||||||
{ 'n', '<A-t>', '<CMD>lua require("FTerm").toggle()<CR>', {noremap = true, desc = 'Terminal' } },
|
|
||||||
{ 't', '<A-t>', '<C-\\><C-n><CMD>lua require("FTerm").toggle()<CR>', {noremap = true, desc = 'Terminal' } },
|
|
||||||
})
|
|
|
@ -1,10 +0,0 @@
|
||||||
vim.cmd [[
|
|
||||||
set guifont=Fira\ Code\ Nerd\ Font:h11
|
|
||||||
let g:neovide_transparency = 0.8
|
|
||||||
let g:neovide_floating_blur_amount_x = 2.0
|
|
||||||
let g:neovide_floating_blur_amount_y = 2.0
|
|
||||||
let g:neovide_scroll_animation_length = 0.1
|
|
||||||
let g:neovide_refresh_rate = 144
|
|
||||||
let g:neovide_fullscreen = v:false
|
|
||||||
let g:neovide_cursor_animation_length=0.05
|
|
||||||
]]
|
|
|
@ -1,62 +0,0 @@
|
||||||
require('kalle.config.plugin-config.lsp')
|
|
||||||
require('kalle.config.plugin-config.cmp')
|
|
||||||
require('kalle.config.plugin-config.treesitter')
|
|
||||||
require('kalle.config.plugin-config.bufferline')
|
|
||||||
require('kalle.config.plugin-config.nvim-tree')
|
|
||||||
|
|
||||||
require('which-key').setup {}
|
|
||||||
require('neogit').setup {}
|
|
||||||
require('lualine').setup {}
|
|
||||||
require('marks').setup {}
|
|
||||||
require('Comment').setup()
|
|
||||||
require('illuminate').configure()
|
|
||||||
require("telescope").load_extension("ui-select")
|
|
||||||
require("todo-comments").setup {}
|
|
||||||
require'FTerm'.setup {}
|
|
||||||
|
|
||||||
require('gitsigns').setup {
|
|
||||||
current_line_blame = true,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- TODO: Move this to a better place.
|
|
||||||
require("noice").setup({
|
|
||||||
routes = {
|
|
||||||
{
|
|
||||||
filter = {
|
|
||||||
event = "cmdline",
|
|
||||||
find = "^%s*[/?]",
|
|
||||||
},
|
|
||||||
view = "cmdline",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
views = {
|
|
||||||
cmdline_popup = {
|
|
||||||
position = {
|
|
||||||
row = 5,
|
|
||||||
col = "50%",
|
|
||||||
},
|
|
||||||
size = {
|
|
||||||
width = 60,
|
|
||||||
height = "auto",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
popupmenu = {
|
|
||||||
relative = "editor",
|
|
||||||
position = {
|
|
||||||
row = 8,
|
|
||||||
col = "50%",
|
|
||||||
},
|
|
||||||
size = {
|
|
||||||
width = 60,
|
|
||||||
height = 10,
|
|
||||||
},
|
|
||||||
border = {
|
|
||||||
style = "rounded",
|
|
||||||
padding = { 0, 1 },
|
|
||||||
},
|
|
||||||
win_options = {
|
|
||||||
winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -1,91 +0,0 @@
|
||||||
require("mason").setup()
|
|
||||||
require("mason-lspconfig").setup()
|
|
||||||
require("mason-lspconfig").setup_handlers({
|
|
||||||
function (server_name) -- default handler (optional)
|
|
||||||
if server_name == 'sumneko_lua' then
|
|
||||||
require("lspconfig")[server_name].setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
globals = {'vim'}
|
|
||||||
},
|
|
||||||
runtime = {
|
|
||||||
version = "LuaJIT",
|
|
||||||
path = vim.split(package.path, ";")
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
library = {
|
|
||||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
|
||||||
[vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
else
|
|
||||||
require("lspconfig")[server_name].setup {
|
|
||||||
capabilities = capabilities,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
require('mason-nvim-dap').setup()
|
|
||||||
|
|
||||||
|
|
||||||
local rt_config = {
|
|
||||||
server = {
|
|
||||||
settings = {
|
|
||||||
on_attach = function(_, bufnr)
|
|
||||||
-- Hover actions
|
|
||||||
vim.keymap.set("n", "<C-space>", rt_config.hover_actions.hover_actions, { buffer = bufnr })
|
|
||||||
-- Code action groups
|
|
||||||
vim.keymap.set("n", "<Leader>a", rt_config.code_action_group.code_action_group, { buffer = bufnr })
|
|
||||||
require 'illuminate'.on_attach(client)
|
|
||||||
end,
|
|
||||||
["rust-analyzer"] = {
|
|
||||||
checkOnSave = {
|
|
||||||
command = "clippy"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require('rust-tools').setup()
|
|
||||||
|
|
||||||
-- LSP Diagnostics Options Setup
|
|
||||||
local sign = function(opts)
|
|
||||||
vim.fn.sign_define(opts.name, {
|
|
||||||
texthl = opts.name,
|
|
||||||
text = opts.text,
|
|
||||||
numhl = ''
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
sign({name = 'DiagnosticSignError', text = ''})
|
|
||||||
sign({name = 'DiagnosticSignWarn', text = ''})
|
|
||||||
sign({name = 'DiagnosticSignHint', text = ''})
|
|
||||||
sign({name = 'DiagnosticSignInfo', text = ''})
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = false,
|
|
||||||
signs = true,
|
|
||||||
update_in_insert = true,
|
|
||||||
underline = true,
|
|
||||||
severity_sort = false,
|
|
||||||
float = {
|
|
||||||
border = 'rounded',
|
|
||||||
source = 'always',
|
|
||||||
header = '',
|
|
||||||
prefix = '',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.cmd([[
|
|
||||||
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
|
||||||
]])
|
|
||||||
|
|
||||||
|
|
||||||
require('nvim-lightbulb').setup({autocmd = {enabled = true}})
|
|
|
@ -17,15 +17,12 @@ return require('packer').startup({function(use)
|
||||||
use('EdenEast/nightfox.nvim')
|
use('EdenEast/nightfox.nvim')
|
||||||
use('folke/which-key.nvim')
|
use('folke/which-key.nvim')
|
||||||
use('numToStr/FTerm.nvim')
|
use('numToStr/FTerm.nvim')
|
||||||
use({
|
|
||||||
"folke/noice.nvim",
|
use('brenoprata10/nvim-highlight-colors')
|
||||||
commit = "312ac20daeae1ba73c300671bbf8d405419a33ef", -- FIX: This is only here because the next commit breaks something...
|
|
||||||
requires = {
|
use('jiaoshijie/undotree')
|
||||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
|
||||||
"MunifTanjim/nui.nvim",
|
use('j-hui/fidget.nvim')
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
use('elkowar/yuck.vim')
|
use('elkowar/yuck.vim')
|
||||||
|
|
||||||
|
@ -36,6 +33,9 @@ return require('packer').startup({function(use)
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
|
run = function() require('nvim-treesitter.install').update({ with_sync = true }) end,
|
||||||
}
|
}
|
||||||
|
use('https://git.sr.ht/~p00f/nvim-ts-rainbow')
|
||||||
|
use('windwp/nvim-autopairs')
|
||||||
|
use('windwp/nvim-ts-autotag')
|
||||||
|
|
||||||
use {
|
use {
|
||||||
'kosayoda/nvim-lightbulb',
|
'kosayoda/nvim-lightbulb',
|
||||||
|
@ -49,6 +49,14 @@ return require('packer').startup({function(use)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
'antosha417/nvim-lsp-file-operations',
|
||||||
|
requires = {
|
||||||
|
{ "nvim-lua/plenary.nvim" },
|
||||||
|
{ "kyazdani42/nvim-tree.lua" },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
use {
|
use {
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
@ -72,9 +80,9 @@ return require('packer').startup({function(use)
|
||||||
'hrsh7th/cmp-path',
|
'hrsh7th/cmp-path',
|
||||||
'hrsh7th/cmp-cmdline',
|
'hrsh7th/cmp-cmdline',
|
||||||
'hrsh7th/cmp-nvim-lsp-signature-help',
|
'hrsh7th/cmp-nvim-lsp-signature-help',
|
||||||
'hrsh7th/cmp-vsnip',
|
|
||||||
'hrsh7th/nvim-cmp',
|
'hrsh7th/nvim-cmp',
|
||||||
'hrsh7th/vim-vsnip',
|
'L3MON4D3/LuaSnip',
|
||||||
|
'saadparwaiz1/cmp_luasnip',
|
||||||
}
|
}
|
||||||
|
|
||||||
use 'famiu/bufdelete.nvim'
|
use 'famiu/bufdelete.nvim'
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
Keybind = require('kalle.utils.keybind')
|
|
||||||
|
|
||||||
Vim = {
|
|
||||||
Keybind = Keybind,
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
local Keybind = {}
|
|
||||||
|
|
||||||
Keybind.add_global_keybinds = function (keybinds)
|
|
||||||
for _, keybind in pairs(keybinds) do
|
|
||||||
if(keybind[4] == nil) then
|
|
||||||
keybind[4] = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap(
|
|
||||||
keybind[1],
|
|
||||||
keybind[2],
|
|
||||||
keybind[3],
|
|
||||||
keybind[4]
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Keybind.add_buffer_keybinds = function (keybinds)
|
|
||||||
for _, keybind in pairs(keybinds) do
|
|
||||||
if(keybind[5] == nil) then
|
|
||||||
keybind[5] = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_buf_set_keymap(
|
|
||||||
keybind[1],
|
|
||||||
keybind[2],
|
|
||||||
keybind[3],
|
|
||||||
keybind[4],
|
|
||||||
keybind[5]
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
Keybind.g = Keybind.add_global_keybinds
|
|
||||||
Keybind.b = Keybind.add_buffer_keybinds
|
|
||||||
|
|
||||||
return Keybind
|
|
|
@ -89,6 +89,11 @@ _G.packer_plugins = {
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/FixCursorHold.nvim",
|
||||||
url = "https://github.com/antoinemadec/FixCursorHold.nvim"
|
url = "https://github.com/antoinemadec/FixCursorHold.nvim"
|
||||||
},
|
},
|
||||||
|
LuaSnip = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
||||||
|
url = "https://github.com/L3MON4D3/LuaSnip"
|
||||||
|
},
|
||||||
["bufdelete.nvim"] = {
|
["bufdelete.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/bufdelete.nvim",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/bufdelete.nvim",
|
||||||
|
@ -124,10 +129,15 @@ _G.packer_plugins = {
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp-path",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp-path",
|
||||||
url = "https://github.com/hrsh7th/cmp-path"
|
url = "https://github.com/hrsh7th/cmp-path"
|
||||||
},
|
},
|
||||||
["cmp-vsnip"] = {
|
cmp_luasnip = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp-vsnip",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
|
||||||
url = "https://github.com/hrsh7th/cmp-vsnip"
|
url = "https://github.com/saadparwaiz1/cmp_luasnip"
|
||||||
|
},
|
||||||
|
["fidget.nvim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/fidget.nvim",
|
||||||
|
url = "https://github.com/j-hui/fidget.nvim"
|
||||||
},
|
},
|
||||||
["gitsigns.nvim"] = {
|
["gitsigns.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
|
@ -169,15 +179,10 @@ _G.packer_plugins = {
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nightfox.nvim",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nightfox.nvim",
|
||||||
url = "https://github.com/EdenEast/nightfox.nvim"
|
url = "https://github.com/EdenEast/nightfox.nvim"
|
||||||
},
|
},
|
||||||
["noice.nvim"] = {
|
["nvim-autopairs"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/noice.nvim",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
|
||||||
url = "https://github.com/folke/noice.nvim"
|
url = "https://github.com/windwp/nvim-autopairs"
|
||||||
},
|
|
||||||
["nui.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nui.nvim",
|
|
||||||
url = "https://github.com/MunifTanjim/nui.nvim"
|
|
||||||
},
|
},
|
||||||
["nvim-cmp"] = {
|
["nvim-cmp"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
|
@ -199,21 +204,26 @@ _G.packer_plugins = {
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text",
|
||||||
url = "https://github.com/theHamsta/nvim-dap-virtual-text"
|
url = "https://github.com/theHamsta/nvim-dap-virtual-text"
|
||||||
},
|
},
|
||||||
|
["nvim-highlight-colors"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-highlight-colors",
|
||||||
|
url = "https://github.com/brenoprata10/nvim-highlight-colors"
|
||||||
|
},
|
||||||
["nvim-lightbulb"] = {
|
["nvim-lightbulb"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-lightbulb",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-lightbulb",
|
||||||
url = "https://github.com/kosayoda/nvim-lightbulb"
|
url = "https://github.com/kosayoda/nvim-lightbulb"
|
||||||
},
|
},
|
||||||
|
["nvim-lsp-file-operations"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-lsp-file-operations",
|
||||||
|
url = "https://github.com/antosha417/nvim-lsp-file-operations"
|
||||||
|
},
|
||||||
["nvim-lspconfig"] = {
|
["nvim-lspconfig"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||||
url = "https://github.com/neovim/nvim-lspconfig"
|
url = "https://github.com/neovim/nvim-lspconfig"
|
||||||
},
|
},
|
||||||
["nvim-notify"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-notify",
|
|
||||||
url = "https://github.com/rcarriga/nvim-notify"
|
|
||||||
},
|
|
||||||
["nvim-tree.lua"] = {
|
["nvim-tree.lua"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
||||||
|
@ -224,6 +234,16 @@ _G.packer_plugins = {
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
},
|
},
|
||||||
|
["nvim-ts-autotag"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-ts-autotag",
|
||||||
|
url = "https://github.com/windwp/nvim-ts-autotag"
|
||||||
|
},
|
||||||
|
["nvim-ts-rainbow"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-ts-rainbow",
|
||||||
|
url = "https://git.sr.ht/~p00f/nvim-ts-rainbow"
|
||||||
|
},
|
||||||
["nvim-web-devicons"] = {
|
["nvim-web-devicons"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||||
|
@ -264,16 +284,16 @@ _G.packer_plugins = {
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/todo-comments.nvim",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/todo-comments.nvim",
|
||||||
url = "https://github.com/folke/todo-comments.nvim"
|
url = "https://github.com/folke/todo-comments.nvim"
|
||||||
},
|
},
|
||||||
|
undotree = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/undotree",
|
||||||
|
url = "https://github.com/jiaoshijie/undotree"
|
||||||
|
},
|
||||||
["vim-illuminate"] = {
|
["vim-illuminate"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/vim-illuminate",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/vim-illuminate",
|
||||||
url = "https://github.com/RRethy/vim-illuminate"
|
url = "https://github.com/RRethy/vim-illuminate"
|
||||||
},
|
},
|
||||||
["vim-vsnip"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/vim-vsnip",
|
|
||||||
url = "https://github.com/hrsh7th/vim-vsnip"
|
|
||||||
},
|
|
||||||
["which-key.nvim"] = {
|
["which-key.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/which-key.nvim",
|
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/which-key.nvim",
|
||||||
|
|
|
@ -55,3 +55,6 @@ v2
|
||||||
todo
|
todo
|
||||||
nightfox
|
nightfox
|
||||||
FTerm
|
FTerm
|
||||||
|
dto
|
||||||
|
api
|
||||||
|
loadPage
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
cat | xargs -I '%' curl '%' -o /tmp/mpris-thumb 2>&1 | echo "/tmp/mpris-thumb"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
echo "Looking up playlist name..."
|
echo "Looking up playlist name..."
|
||||||
pl_line=$(youtube-dl --flat-playlist "$1" | grep "\[download\] Downloading playlist: ")
|
pl_line=$(yt-dlp --flat-playlist "$1" | grep "\[download\] Downloading playlist: ")
|
||||||
pl_name=$(echo ${pl_line:33} | tr '/' ' ')
|
pl_name=$(echo ${pl_line:33} | tr '/' ' ')
|
||||||
|
|
||||||
echo "Found playlist by name: $pl_name"
|
echo "Found playlist by name: $pl_name"
|
||||||
|
@ -10,5 +10,5 @@ echo "Downloading it into directory: $pl_name"
|
||||||
|
|
||||||
mkdir "$pl_name"
|
mkdir "$pl_name"
|
||||||
cd "$pl_name"
|
cd "$pl_name"
|
||||||
youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" "$1"
|
yt-dlp --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" "$1"
|
||||||
cd ../
|
cd ../
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
bat -pf `project path "$1"`/README.md
|
bat -pf "`project path "$1"`"/README.md
|
||||||
|
|
Loading…
Reference in New Issue