Bunch of things

arch
kalle 2023-04-23 18:55:30 +02:00
parent e664956065
commit 0e67bba162
32 changed files with 505 additions and 447 deletions

View File

@ -2,6 +2,9 @@
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Ansible defaults
export ANSIBLE_BECOME_ASK_PASS=yes
# Add ~/bin and ~/bin/scripts to my path
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.
alias ssh="kitty +kitten ssh"
alias paru="paru --bottomup"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

View File

@ -2,10 +2,32 @@
(defpoll year :interval "10h" "date '+%Y'")
(defpoll date :interval "30m" "date '+%m-%d'")
(defpoll media-player_art-url :interval "10s" "playerctl metadata mpris:artUrl")
(defpoll media-player_status :interval "10s" "playerctl status")
(defpoll media-player_title :interval "10s" "playerctl metadata xesam:title | ellipse -n 30")
(defpoll media-player_artist :interval "10s" "playerctl metadata xesam:artist")
(defpoll audio_sink_default
:interval "10s"
`pactl get-default-sink`)
; 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.
(defvar workspace 1)
(defpoll audio_source_default
: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}]'")

43
eww/audio.yuck Normal file
View File

@ -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} {}%"
)
)
)
)

View File

@ -1,11 +1,3 @@
(defwidget user-icon []
(eventbox :class "user-icon"
(box :class "img"
:height 50
:width 50)
)
)
(defwidget notifications []
(eventbox :class "notifications"
""
@ -24,62 +16,30 @@
)
)
(defwidget top []
(box :class "top"
:space-evenly "false"
: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 color-picker []
(eventbox :class "color-picker"
:onclick "hyprctl dispatch exec \"hyprpicker --no-fancy | wl-copy\""
""
)
)
(defwidget workspace []
(box :class "workspace"
:orientation "v"
:halign "center"
:space-evenly "true"
(box :class {workspace == 1 ? "single-selected" : "single"}
:width 25
:height 25)
(box :class {workspace == 2 ? "single-selected" : "single"}
: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 left []
(box :class "left"
:halign "start"
:orientation "h"
(notifications) ; TODO: notifications - Opens notification menu
(audio)
(clipboard); TODO: Clipboard - Opens clipboard menu (clipboard history click to make current)
;; TODO: Bluetooth something
(color-picker)
)
)
(defwidget center []
(box :class "top"
(box :class "center"
:space-evenly "false"
:valign "center"
:orientation "v"
(workspace) ; TODO: Workspace indicator - Highlight current workspace (Click to go to?)
:orientation "h"
)
)
@ -91,39 +51,38 @@
(defwidget date []
(eventbox :class "date"
(box :orientation "v"
year
date
)
"${year}-${date}"
)
)
(defwidget bottom []
(box :class "top"
(defwidget right []
(box :class "right"
:space-evenly "false"
:valign "end"
:halign "end"
:valign "center"
:orientation "v"
; TODO: Redo this thing and make it open calendar view
(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 []
(box :class "bar"
:orientation "v"
(top)
:orientation "h"
(left)
(center)
(bottom)
(right)
)
)
(defwindow bar
:monitor 2
:geometry (geometry :x "0px"
:y "0px"
:width "50px"
:height "100%"
:anchor "top left")
:y "10px"
:width "1060px"
:height "50px"
:anchor "center top")
:stacking "fg"
:exclusive true
(bar)

View File

@ -1,49 +1,42 @@
$clr-primary: #883333;
$clr-background: rgba(0, 0, 0, 0.75);
$clr-background: rgba(0, 0, 0, 0.5);
.bar {
background-color: $clr-background;
border-radius: 10px;
.user-icon {
// &:hover {
// background-color: rgba(#888888, 0.2);
// }
.img {
background-image: url("file:///home/kalle/Pictures/Wallpapers/Boat.jpg");
background-size: cover;
border-radius: 100%;
margin: 5px;
}
}
.notifications, .audio, .clipboard {
.notifications, .audio, .clipboard, .color-picker {
label {
font-size: 30px;
margin: 5px;
}
&:hover {
color: $clr-primary;
// background-color: rgba(#888888, 0.2);
}
}
.workspace {
.single, .single-selected {
margin: 5px;
border-radius: 100%;
border: 2px solid white;
.left {
margin-left: 10px;
}
.single-selected {
border-color: $clr-primary;
}
.right {
margin-right: 10px;
}
}
.audio {
background-color: $clr-background;
border-radius: 5px;
.audio-title {
font-size: 30px;
.audio-sinks {
margin-left: 50px;
margin-right: 20px;
}
.audio-sources {
margin-left: 20px;
margin-right: 50px;
}
.media-player {
@ -76,3 +69,6 @@ $clr-background: rgba(0, 0, 0, 0.75);
}
.title {
font-size: 24px;
}

View File

@ -1,4 +1,6 @@
(include "_variables.yuck")
(include "util.yuck")
(include "audio.yuck")
(include "bar.yuck")
(include "volume.yuck")

5
eww/util.yuck Normal file
View File

@ -0,0 +1,5 @@
(defwidget title [content]
(box :class "title"
content
)
)

View File

@ -6,16 +6,16 @@
circle farthest-side at left,
rgba(0, 0, 0, 0.9) 40%,
rgba(0, 0, 0, 0.2) 70%),
url('${media-player_art-url}');"
url('${media-player_metadata_image}');"
(box :orientation "v"
(box :class "title"
:halign "start"
media-player_title
{media-player_metadata.title}
)
(box :class "artist"
:halign "start"
media-player_artist
{media-player_metadata.artist}
)
)
@ -32,7 +32,7 @@
(eventbox :class "pause"
:width 40
:onclick "playerctl play-pause"
${media-player_status == "Playing" ? "" : "契"}
{media-player_status == "Playing" ? "" : "契"}
)
(eventbox :class "next"
: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 []
(box :class "audio"
:orientation "v"
:space-evenly false
; (audio-title)
;; TODO: Maybe individual applications as well.
(box :orientation "h"
(media-player)
(box
;; TODO: Put something here
)
)
(box :orientation "h"
(audio-sinks)
(audio-sources)
)
)
)
(defwindow audio
:monitor 2
:geometry (geometry :x "50px"
:y "0px"
:width "500px"
:height "100%"
:anchor "top left")
:stacking "fg"
:exclusive true
:geometry (geometry :x "10px"
:y "10px"
:width "1060"
:height "500px"
:anchor "top center")
:stacking "overlay"
:exclusive false
(audio-window)
)

View File

@ -1,19 +1,36 @@
local cmp = require'cmp'
local luasnip = require'luasnip'
cmp.setup({
snippet = {
expand = function(args)
vim.fn["vsnip#anonymous"](args.body)
require('luasnip').lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-n>'] = cmp.mapping.select_next_item(),
-- Add tab support
['<S-Tab>'] = cmp.mapping.select_prev_item(),
['<Tab>'] = cmp.mapping.select_next_item(),
['<C-S-f>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
['<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-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm({
@ -23,13 +40,12 @@ cmp.setup({
}),
sources = cmp.config.sources({
{ 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_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.*
{ name = 'buffer', keyword_length = 2 }, -- source current buffer
{ name = 'vsnip', keyword_length = 2 }, -- nvim-cmp source for vim-vsnip
{ name = 'luasnip' },
{ name = 'nvim_lua' }, -- complete neovim's Lua runtime API such vim.lsp.*
{ name = 'buffer' }, -- source current buffer
{ name = 'calc'}, -- source for math calculation
{ name = 'nvim_lsp' },
}),
window = {
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).
-- cmp.setup.cmdline(':', {
-- mapping = cmp.mapping.preset.cmdline(),
-- sources = cmp.config.sources({
-- { name = 'path' }
-- }, {
-- { 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)
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})

View File

@ -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,
}

View File

@ -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')

132
nvim/after/plugin/lsp.lua Normal file
View File

@ -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}})

View File

@ -19,3 +19,5 @@ require('nvim-tree').setup {
dotfiles = true,
},
}
require("lsp-file-operations").setup()

View File

@ -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')

View File

@ -12,6 +12,9 @@ require('nvim-treesitter.configs').setup {
enable = true,
extended_mode = true,
max_file_lines = nil,
},
autotag = {
enable = true,
}
}

View File

@ -0,0 +1 @@
require('undotree').setup()

View File

@ -2,13 +2,21 @@ vim.opt.termguicolors = true
vim.opt.clipboard = 'unnamed,unnamedplus'
vim.opt.timeoutlen = 300
vim.opt.mouse = 'a'
vim.opt.undodir = vim.fn.expand('~/.cache/vim/undo')
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.relativenumber = true
vim.opt.list = true
vim.opt.wrap = false
vim.opt.scrolloff = 8
vim.opt.autoindent = true
vim.opt.expandtab = true
vim.opt.softtabstop = 4
@ -19,27 +27,20 @@ vim.opt.modeline = true
vim.opt.spell = true
vim.opt.undofile = true
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.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
require('kalle.plugins')
vim.cmd('colorscheme carbonfox')
-- Load config
require('kalle.config')
vim.cmd.colorscheme('carbonfox')
-- TODO:
-- - Debugger integration (gdb?, java?/kotlin?, rust?, etc) - nvim-dap and friends

View File

@ -1,3 +0,0 @@
require('kalle.config.keybinds')
require('kalle.config.neovide')
require('kalle.config.plugin-config')

View File

@ -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' } },
})

View File

@ -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
]]

View File

@ -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" },
},
},
},
})

View File

@ -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}})

View File

@ -17,15 +17,12 @@ return require('packer').startup({function(use)
use('EdenEast/nightfox.nvim')
use('folke/which-key.nvim')
use('numToStr/FTerm.nvim')
use({
"folke/noice.nvim",
commit = "312ac20daeae1ba73c300671bbf8d405419a33ef", -- FIX: This is only here because the next commit breaks something...
requires = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
}
})
use('brenoprata10/nvim-highlight-colors')
use('jiaoshijie/undotree')
use('j-hui/fidget.nvim')
use('elkowar/yuck.vim')
@ -36,6 +33,9 @@ return require('packer').startup({function(use)
'nvim-treesitter/nvim-treesitter',
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 {
'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 {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
@ -72,9 +80,9 @@ return require('packer').startup({function(use)
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lsp-signature-help',
'hrsh7th/cmp-vsnip',
'hrsh7th/nvim-cmp',
'hrsh7th/vim-vsnip',
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
}
use 'famiu/bufdelete.nvim'

View File

@ -1,5 +0,0 @@
Keybind = require('kalle.utils.keybind')
Vim = {
Keybind = Keybind,
}

View File

@ -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

View File

@ -89,6 +89,11 @@ _G.packer_plugins = {
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/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"] = {
loaded = true,
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",
url = "https://github.com/hrsh7th/cmp-path"
},
["cmp-vsnip"] = {
cmp_luasnip = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp-vsnip",
url = "https://github.com/hrsh7th/cmp-vsnip"
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/cmp_luasnip",
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"] = {
loaded = true,
@ -169,15 +179,10 @@ _G.packer_plugins = {
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nightfox.nvim",
url = "https://github.com/EdenEast/nightfox.nvim"
},
["noice.nvim"] = {
["nvim-autopairs"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/noice.nvim",
url = "https://github.com/folke/noice.nvim"
},
["nui.nvim"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nui.nvim",
url = "https://github.com/MunifTanjim/nui.nvim"
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/nvim-autopairs",
url = "https://github.com/windwp/nvim-autopairs"
},
["nvim-cmp"] = {
loaded = true,
@ -199,21 +204,26 @@ _G.packer_plugins = {
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/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"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/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"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/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"] = {
loaded = true,
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",
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"] = {
loaded = true,
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",
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"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/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"] = {
loaded = true,
path = "/home/kalle/.local/share/nvim/site/pack/packer/start/which-key.nvim",

View File

@ -55,3 +55,6 @@ v2
todo
nightfox
FTerm
dto
api
loadPage

Binary file not shown.

View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
cat | xargs -I '%' curl '%' -o /tmp/mpris-thumb 2>&1 | echo "/tmp/mpris-thumb"

View File

@ -2,7 +2,7 @@
set -x
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 '/' ' ')
echo "Found playlist by name: $pl_name"
@ -10,5 +10,5 @@ echo "Downloading it into directory: $pl_name"
mkdir "$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 ../

View File

@ -1,2 +1,2 @@
#!/usr/bin/env bash
bat -pf `project path "$1"`/README.md
bat -pf "`project path "$1"`"/README.md