1
0
Fork 0
This commit is contained in:
Luca Bilke 2023-01-28 16:59:14 +01:00
commit 5ea035ee06
23 changed files with 138 additions and 391 deletions

View file

@ -153,7 +153,7 @@ cmd dupe &{{
find "$PWD" "$file" | grep -oP '(?<=.\.~)\d+(?=~$)' | sort -n | tail -1 | (
ext=$(($(cat /dev/stdin)+1))
filedest="$(echo "$file" | sed 's/.~[[:digit:]]*~$//').~$ext~"
cp "$file" "$filedest"
cp -r "$file" "$filedest"
)
done
}}
@ -198,7 +198,7 @@ map N
map g/ cd "/"
# Kitty Specific
map W kitty --detach lf
map W &kitty --detach lf
# Load bookmark shortcuts
source "~/.config/lf/shortcutrc"

View file

@ -9,7 +9,7 @@ map gdl cd "/home/luca/Downloads"
map gdm cd "/home/luca/Documents"
map gco cd "/home/luca/Documents/Code"
map gms cd "/home/luca/Music"
map gpc cd "/home/luca/Pictures"
map gph cd "/home/luca/Photos"
map gvd cd "/home/luca/Videos"
map gdot cd "/home/luca/.local/share/dotfiles"
map Ebf $$EDITOR "/home/luca/.config/shell/bm-files"

View file

@ -5,7 +5,8 @@ end, 0)
require('config.options')
require('funcs').bootstrap()
require('plugins')
require('funcs').autocmd(require('config.autocmdlist'))
require('config.autocmdlist')
require('config.filetypelist')
require('funcs').map('general')
local icons = require('config.iconlist').diagnostics

View file

@ -1,4 +1,4 @@
return {
local cmds = {
{ -- Handles the automatic line numeration changes
{ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" },
{
@ -104,3 +104,17 @@ return {
}
}
}
vim.api.nvim_create_augroup('packer_user_config', { clear = true })
for _, entry in ipairs(cmds) do
local event = entry[1]
local opts = entry[2]
if type(opts.group) == "string" and opts.group ~= "" then
local exists, _ = pcall(vim.api.nvim_get_autocmds, { group = opts.group })
if not exists then
vim.api.nvim_create_augroup(opts.group, {})
end
end
vim.api.nvim_create_autocmd(event, opts)
end

View file

@ -0,0 +1,28 @@
local filetypes = {
{
extension = {
yml = function(path, bufnr)
if vim.fs.find({ 'tasks', 'roles', 'handlers', 'group_vars', 'host_vars' },
{ type = 'directory', upward = true }) and
vim.fs.find({ 'ansible.cfg', '.ansible-lint' }, { upward = true }) then
return 'yaml.ansible'
else
return 'yaml'
end
end,
yaml = function(path, bufnr)
if vim.fs.find({ 'tasks', 'roles', 'handlers', 'group_vars', 'host_vars' },
{ type = 'directory', upward = true }) and
vim.fs.find({ 'ansible.cfg', '.ansible-lint' }, { upward = true }) then
return 'yaml.ansible'
else
return 'yaml'
end
end
}
}
}
for _, entry in pairs(filetypes) do
vim.filetype.add(entry)
end

View file

@ -57,7 +57,7 @@ M.whichkey = {
l = {
name = "LSP",
a = { function() vim.lsp.buf.code_action() end, "Code Action" },
f = { function() vim.lsp.buf.format { async = true } end, "Format" },
f = { function() require("funcs").format { async = true } end, "Format" },
j = { function() vim.diagnostic.goto_next() end, "Next Diagnostic" },
k = { function() vim.diagnostic.goto_prev() end, "Prev Diagnostic" },
l = { function() vim.lsp.codelens.run() end, "CodeLens Action" },

View file

@ -35,6 +35,7 @@ o.relativenumber = true
o.laststatus = 3
o.modeline = true
o.modelines = 3
o.listchars = "eol:$,tab:>-,trail:~,extends:>,precedes:<"
g.Illuminate_ftblacklist = { 'alpha', 'NvimTree' }
g.mapleader = ' '

View file

@ -1,20 +1,4 @@
local M = {}
function M.autocmd(list)
vim.api.nvim_create_augroup('packer_user_config', {clear = true})
for _, entry in ipairs(list) do
local event = entry[1]
local opts = entry[2]
if type(opts.group) == "string" and opts.group ~= "" then
local exists, _ = pcall(vim.api.nvim_get_autocmds, { group = opts.group })
if not exists then
vim.api.nvim_create_augroup(opts.group, {})
end
end
vim.api.nvim_create_autocmd(event, opts)
end
end
function M.lazy_load(tb)
vim.api.nvim_create_autocmd(tb.events, {
group = vim.api.nvim_create_augroup(tb.augroup_name, {}),
@ -38,6 +22,18 @@ function M.lazy_load(tb)
})
end
function M.on_file_open(plugin_name)
M.lazy_load {
events = { "BufRead", "BufWinEnter", "BufNewFile" },
augroup_name = "BeLazyOnFileOpen" .. plugin_name,
plugin = plugin_name,
condition = function()
local file = vim.fn.expand "%"
return file ~= "NvimTree_1" and file ~= "[packer]" and file ~= ""
end,
}
end
function M.gitsigns()
vim.api.nvim_create_autocmd({ "BufRead" }, {
group = vim.api.nvim_create_augroup("GitSignsLazyLoad", { clear = true }),
@ -53,18 +49,6 @@ function M.gitsigns()
})
end
function M.on_file_open(plugin_name)
M.lazy_load {
events = { "BufRead", "BufWinEnter", "BufNewFile" },
augroup_name = "BeLazyOnFileOpen" .. plugin_name,
plugin = plugin_name,
condition = function()
local file = vim.fn.expand "%"
return file ~= "NvimTree_1" and file ~= "[packer]" and file ~= ""
end,
}
end
function M.bootstrap()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
@ -116,6 +100,28 @@ function M.map(section)
end
end
function M.format_filter(client)
local filetype = vim.bo.filetype
local n = require "null-ls"
local s = require "null-ls.sources"
local method = n.methods.FORMATTING
local available_formatters = s.get_available(filetype, method)
if #available_formatters > 0 then
return client.name == "null-ls"
elseif client.supports_method "textDocument/formatting" then
return true
else
return false
end
end
function M.format(opts)
opts = opts or {}
opts.filter = opts.filter or M.format_filter
return vim.lsp.buf.format(opts)
end
-- Modified version of a function stolen from LunarVim
function M.buf_kill(kill_command, bufnr, force)
kill_command = kill_command or "bd"

View file

@ -13,7 +13,8 @@ autopairs.setup({
},
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'" },
chars = { "{", "[", "("},
-- chars = { "{", "[", "(", '"', "'" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0,
end_key = "$",

View file

@ -3,22 +3,15 @@ if not cmp_status_ok then
return
end
local function border(hl_name)
return {
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
{ "", hl_name },
}
local luasnip_status_ok, luasnip = pcall(require, 'luasnip')
if not luasnip_status_ok then
return
end
local check_backspace = function()
local col = vim.fn.col(".") - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local cmp_window = require "cmp.utils.window"
@ -33,23 +26,25 @@ end
cmp.setup({
window = {
completion = {
border = border "CmpBorder",
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
},
documentation = {
border = border "CmpDocBorder",
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
col_offset = -3,
side_padding = 0,
},
},
formatting = {
fields = { "kind", "abbr", "menu" },
format = function(entry, vim_item)
local kind = require("lspkind").cmp_format({ mode = "symbol_text", maxwidth = 50 })(entry, vim_item)
local strings = vim.split(kind.kind, "%s", { trimempty = true })
kind.kind = " " .. (strings[1] or "") .. " "
kind.menu = " (" .. (strings[2] or "") .. ")"
return kind
end,
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
formatting = {
format = function(_, vim_item)
local icons = require('config.iconlist').kind
vim_item.kind = string.format("%s %s", icons[vim_item.kind], vim_item.kind)
return vim_item
luasnip.lsp_expand(args.body)
end,
},
mapping = {
@ -62,35 +57,29 @@ cmp.setup({
i = cmp.mapping.abort(),
c = cmp.mapping.close(),
}),
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require('luasnip').expandable() then
require('luasnip').expand()
elseif require('luasnip').expand_or_jumpable() then
require('luasnip').expand_or_jump()
elseif check_backspace() then
fallback()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- they way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, {
"i",
"s",
}),
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require('luasnip').jumpable(-1) then
require('luasnip').jump(-1)
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
end, { "i", "s" }),
},
sources = {
{ name = "nvim_lsp" },

View file

@ -9,7 +9,8 @@ indent_blankline.setup {
show_trailing_blankline_indent = false,
show_first_indent_level = true,
use_treesitter = true,
show_current_context = true,
show_current_context = false,
show_end_of_line = false,
buftype_exclude = { "terminal", "nofile" },
filetype_exclude = {
"help",

View file

@ -14,8 +14,8 @@ local diagnostics = null_ls.builtins.diagnostics
null_ls.setup {
debug = false,
sources = {
-- formatting.black.with { extra_args = { "--fast" } },
-- formatting.stylua,
-- diagnostics.flake8,
formatting.black.with { extra_args = { "--fast" } },
-- formatting.stylua,
-- diagnostics.flake8,
},
}

View file

@ -4,6 +4,7 @@ if not status_ok then
end
todo_comments.setup({
highlight = {
multiline = false,
comments_only = false
}
})

View file

@ -182,6 +182,7 @@ local plugins = {
{ "hrsh7th/cmp-nvim-lsp", after = "cmp-nvim-lua" },
{ "hrsh7th/cmp-buffer", after = "cmp-nvim-lsp" },
{ "hrsh7th/cmp-path", after = "cmp-buffer" },
{ "onsails/lspkind.nvim" },
{ "windwp/nvim-autopairs",
after = "nvim-cmp",
config = function()

View file

@ -1 +1 @@
TODO: Function to decide between LS and null-ls for formatting
TODO: Clean up telescope triggers

View file

@ -21,7 +21,7 @@ blur-method = "dual_kawase";
blur-background = true;
blur-background-frame = false;
blur-kern = "3x3box";
blur-strength = 8;
blur-strength = 5;
blur-background-exclude = [
"class_g = 'LibreWolf' && argb",
"class_g = 'easyeffects'",

View file

@ -10,7 +10,7 @@ dl ${XDG_DOWNLOAD_DIR:-$HOME/Downloads}
dm ${XDG_DOCUMENTS_DIR:-$HOME/Documents}
co ${XDG_DOCUMENTS_DIR:-$HOME/Documents}/Code
ms ${XDG_MUSIC_DIR:-$HOME/Music}
pc ${XDG_PICTURES_DIR:-$HOME/Pictures}
ph ${XDG_PICTURES_DIR:-$HOME/Photos}
vd ${XDG_VIDEOS_DIR:-$HOME/Videos}
dot ${XDG_DATA_HOME:-$HOME/.local/share}/dotfiles

View file

@ -10,7 +10,7 @@ dl="cd /home/luca/Downloads && tput cuu1;tput el" \
dm="cd /home/luca/Documents && tput cuu1;tput el" \
co="cd /home/luca/Documents/Code && tput cuu1;tput el" \
ms="cd /home/luca/Music && tput cuu1;tput el" \
pc="cd /home/luca/Pictures && tput cuu1;tput el" \
ph="cd /home/luca/Photos && tput cuu1;tput el" \
vd="cd /home/luca/Videos && tput cuu1;tput el" \
dot="cd /home/luca/.local/share/dotfiles && tput cuu1;tput el" \
bf="$EDITOR /home/luca/.config/shell/bm-files" \

View file

@ -9,7 +9,7 @@ hash -d dl=/home/luca/Downloads
hash -d dm=/home/luca/Documents
hash -d co=/home/luca/Documents/Code
hash -d ms=/home/luca/Music
hash -d pc=/home/luca/Pictures
hash -d ph=/home/luca/Photos
hash -d vd=/home/luca/Videos
hash -d dot=/home/luca/.local/share/dotfiles
hash -d bf=/home/luca/.config/shell/bm-files

View file

@ -32,10 +32,12 @@ export XSECURELOCK_DATETIME_FORMAT="%d.%m.%Y %H:%M"
export XSECURELOCK_PASSWORD_PROMPT="time_hex"
export XSECURELOCK_AUTH_TIMEOUT=10
export XSECURELOCK_SHOW_DATETIME=1
export XSECURELOCK_SAVER="saver_xscreensaver"
export XSECURELOCK_COMPOSITE_OBSCURER=0
export XSECURELOCK_SAVER="/usr/libexec/xscreensaver/cubicgrid"
export XSECURELOCK_SHOW_DATETIME=1
export XSECURELOCK_SHOW_HOSTNAME=1
xset s 300
xss-lock -- xsecurelock &
xss-lock -n /usr/lib/xsecurelock/dimmer -l -- xsecurelock &
# Ensure that xrdb has finished running before moving on to start the WM/DE.
[ -n "$xrdbpid" ] && wait "$xrdbpid"

View file

@ -1,299 +0,0 @@
# XScreenSaver Preferences File
# Written by xscreensaver-settings 6.04 for luca on Wed Aug 17 00:56:02 2022.
# https://www.jwz.org/xscreensaver/
timeout: 0:10:00
cycle: 0:10:00
lock: False
lockTimeout: 0:00:00
passwdTimeout: 0:00:30
visualID: default
installColormap: True
verbose: False
splash: True
splashDuration: 0:00:05
demoCommand: xscreensaver-settings
nice: 10
fade: True
unfade: True
fadeSeconds: 0:00:03
ignoreUninstalledPrograms:False
font: NotoSans Nerd Font:style=Regular:pixelsize=14:antialias=true:autohint=true;
dpmsEnabled: False
dpmsQuickOff: False
dpmsStandby: 2:00:00
dpmsSuspend: 2:00:00
dpmsOff: 4:00:00
grabDesktopImages: True
grabVideoFrames: False
chooseRandomImages: False
imageDirectory:
mode: one
selected: 184
textMode: url
textLiteral: XScreenSaver
textFile:
textProgram: fortune
textURL: https://en.wikipedia.org/w/index.php?title=Special:NewPages&feed=rss
dialogTheme: default
programs: \
maze -root \n\
GL: superquadrics -root \n\
attraction -root \n\
blitspin -root \n\
greynetic -root \n\
helix -root \n\
hopalong -root \n\
imsmap -root \n\
- noseguy -root \n\
- pyro -root \n\
qix -root \n\
- rocks -root \n\
rorschach -root \n\
decayscreen -root \n\
flame -root \n\
halo -root \n\
slidescreen -root \n\
pedal -root \n\
bouboule -root \n\
- braid -root \n\
coral -root \n\
deco -root \n\
drift -root \n\
- fadeplot -root -count 30 -cycles 2519 \n\
galaxy -root \n\
goop -root \n\
grav -root \n\
ifs -root \n\
GL: jigsaw -root \n\
julia -root \n\
- kaleidescope -root \n\
GL: moebius -root \n\
moire -root \n\
GL: morph3d -root \n\
mountain -root \n\
munch -root \n\
penrose -root \n\
GL: pipes -root \n\
rdbomb -root \n\
GL: rubik -root \n\
- sierpinski -root \n\
slip -root \n\
GL: sproingies -root \n\
starfish -root \n\
strange -root \n\
swirl -root \n\
triangle -root \n\
xjack -root \n\
xlyap -root \n\
GL: atlantis -root \n\
bsod -root \n\
GL: bubble3d -root \n\
GL: cage -root \n\
- crystal -root \n\
cynosure -root \n\
discrete -root \n\
distort -root \n\
epicycle -root \n\
flow -root -delay 25191 -cycles 800000 \
-size -6 -no-rotate -no-ride -no-box \n\
GL: glplanet -root \n\
interference -root \n\
kumppa -root \n\
GL: lament -root \n\
moire2 -root \n\
GL: sonar -root \n\
GL: stairs -root \n\
truchet -root \n\
- vidwhacker -root \n\
blaster -root \n\
bumps -root \n\
ccurve -root \n\
compass -root \n\
deluxe -root \n\
- demon -root \n\
- GL: extrusion -root \n\
- loop -root \n\
penetrate -root \n\
petri -root \n\
phosphor -root \n\
GL: pulsar -root \n\
ripples -root \n\
shadebobs -root \n\
GL: sierpinski3d -root \n\
spotlight -root \n\
squiral -root \n\
wander -root \n\
- webcollage -root \n\
xflame -root \n\
xmatrix -root -insert top -delay 19084 \
-density 49 \n\
GL: gflux -root \n\
- nerverot -root \n\
xrayswarm -root \n\
xspirograph -root \n\
GL: circuit -root \n\
GL: dangerball -root \n\
- GL: dnalogo -root \n\
GL: engine -root \n\
GL: flipscreen3d -root \n\
GL: gltext -root \n\
GL: menger -root \n\
GL: molecule -root \n\
rotzoomer -root \n\
scooter -root \n\
speedmine -root \n\
GL: starwars -root \n\
GL: stonerview -root \n\
vermiculate -root \n\
whirlwindwarp -root \n\
zoom -root \n\
anemone -root \n\
apollonian -root \n\
GL: boxed -root \n\
GL: cubenetic -root \n\
GL: endgame -root \n\
euler2d -root \n\
fluidballs -root \n\
GL: flurry -root \n\
- GL: glblur -root \n\
GL: glsnake -root \n\
halftone -root \n\
GL: juggler3d -root \n\
GL: lavalite -root \n\
- polyominoes -root \n\
GL: queens -root \n\
- GL: sballs -root \n\
GL: spheremonics -root \n\
- thornbird -root \n\
twang -root \n\
- GL: antspotlight -root \n\
apple2 -root \n\
GL: atunnel -root \n\
barcode -root \n\
GL: blinkbox -root \n\
GL: blocktube -root \n\
GL: bouncingcow -root -delay 0 -speed 0.326 \n\
cloudlife -root \n\
GL: cubestorm -root \n\
eruption -root \n\
GL: flipflop -root \n\
GL: flyingtoasters -root \n\
fontglide -root \n\
GL: gleidescope -root \n\
GL: glknots -root \n\
GL: glmatrix -root \n\
- GL: glslideshow -root \n\
GL: hypertorus -root \n\
- GL: jigglypuff -root \n\
metaballs -root \n\
GL: mirrorblob -root \n\
piecewise -root \n\
GL: polytopes -root \n\
pong -root \n\
popsquares -root \n\
GL: surfaces -root \n\
xanalogtv -root \n\
abstractile -root \n\
anemotaxis -root \n\
- GL: antinspect -root \n\
fireworkx -root \n\
fuzzyflakes -root \n\
interaggregate -root \n\
intermomentary -root \n\
memscroller -root \n\
GL: noof -root \n\
pacman -root \n\
GL: pinion -root \n\
GL: polyhedra -root \n\
- GL: providence -root \n\
substrate -root \n\
wormhole -root \n\
- GL: antmaze -root \n\
GL: boing -root \n\
boxfit -root \n\
GL: carousel -root \n\
celtic -root \n\
GL: crackberg -root \n\
GL: cube21 -root \n\
fiberlamp -root \n\
GL: fliptext -root \n\
GL: glhanoi -root \n\
GL: tangram -root \n\
GL: timetunnel -root \n\
GL: glschool -root \n\
GL: topblock -root \n\
GL: cubicgrid -root -delay 0 -speed 0.676 \
-zoom 34 \n\
cwaves -root \n\
GL: gears -root \n\
GL: glcells -root \n\
GL: lockward -root \n\
m6502 -root \n\
GL: moebiusgears -root \n\
GL: voronoi -root \n\
GL: hypnowheel -root \n\
GL: klein -root \n\
- lcdscrub -root \n\
GL: photopile -root \n\
GL: skytentacles -root \n\
GL: rubikblocks -root \n\
GL: companioncube -root \n\
GL: hilbert -root \n\
GL: tronbit -root \n\
GL: geodesic -root \n\
hexadrop -root \n\
GL: kaleidocycle -root \n\
GL: quasicrystal -root \n\
GL: unknownpleasures -root -resolution 104 \n\
binaryring -root \n\
GL: cityflow -root \n\
GL: geodesicgears -root \n\
GL: projectiveplane -root \n\
GL: romanboy -root \n\
tessellimage -root \n\
GL: winduprobot -root \n\
GL: splitflap -root \n\
GL: cubestack -root \n\
GL: cubetwist -root \n\
GL: discoball -root \n\
GL: dymaxionmap -root \n\
GL: energystream -root \n\
GL: hexstrut -root \n\
GL: hydrostat -root \n\
GL: raverhoop -root \n\
GL: splodesic -root \n\
GL: unicrud -root \n\
GL: esper -root \n\
GL: vigilance -root \n\
GL: crumbler -root \n\
filmleader -root \n\
glitchpeg -root \n\
GL: handsy -root \n\
GL: maze3d -root \n\
GL: peepers -root \n\
GL: razzledazzle -root \n\
vfeedback -root \n\
GL: deepstars -root \n\
GL: gravitywell -root -grid-size 1.641 -count \
31 \n\
GL: beats -root \n\
GL: covid19 -root \n\
GL: etruscanvenus -root \n\
GL: gibson -root \n\
GL: headroom -root \n\
GL: sphereeversion -root \n\
binaryhorizon -root \n\
marbling -root \n\
GL: chompytower -root \n\
GL: mapscroller -root \n\
GL: nakagin -root \n\
GL: squirtorus -root \n\
pointerHysteresis: 10
authWarningSlack: 20

View file

@ -1,4 +1,4 @@
set sandbox none
/* set sandbox none */
set statusbar-h-padding 0
set statusbar-v-padding 0
set page-padding 1
@ -51,7 +51,7 @@ set render-loading-fg "#FFEE79"
set render-loading-bg "#18191E"
# Recolor mode settings
set recolor-lightcolor "#21252D"
set recolor-darkcolor "#FFFADE"
set recolor

View file

@ -1,4 +1,5 @@
#!/bin/sh
# FIX: Script dies when ethernet cable is plugged in through docking station
shift=""
if ls /sys/class/net/w*/operstate 1>/dev/null 2>&1; then