Compare commits
31 Commits
8a2fbc92ff
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ca3682564 | |||
| 1eb6626965 | |||
| 4f83f044b6 | |||
| f99e215cbd | |||
| 8c842122cf | |||
| 822af1d987 | |||
| 9d4cce8bae | |||
| f11376c1a4 | |||
| c1f925aa92 | |||
| 77f3b7eaa4 | |||
| 37f1134fd5 | |||
| 8cf37489be | |||
| 8f98beb4a7 | |||
| f0a4230996 | |||
| 4580c248d7 | |||
| 5275987eb0 | |||
| 411bc325c5 | |||
| c00629e56d | |||
| 84a87fb6a6 | |||
| 7327691016 | |||
| 7e654d39e2 | |||
| eed65f7ae0 | |||
| 3507dc0ca1 | |||
| dfadf1c9f2 | |||
| ba69308ad0 | |||
| 6aec6c7cb6 | |||
| 2a1321e961 | |||
| 997af51bee | |||
| 67988b7ffc | |||
| d32b47dd72 | |||
| 9b73f4cc9b |
27
.bashrc
27
.bashrc
@@ -12,25 +12,26 @@ esac
|
||||
[ -z "${PS1-}" ] && return
|
||||
|
||||
# lazy loading of ssh agents
|
||||
_lazy_ssh() {
|
||||
__lazy_ssh_agent() {
|
||||
if [ -z "$SSH_AUTH_SOCK" ]; then
|
||||
eval "$(ssh-agent -s)" >/dev/null
|
||||
ssh-add "$HOME/.ssh/github" >/dev/null
|
||||
ssh-add "$HOME/.ssh/gitea" >/dev/null
|
||||
ssh-add "$HOME/.ssh/admin@homeserver" >/dev/null
|
||||
ssh-add "$HOME/.ssh/github" >/dev/null 2>&1
|
||||
ssh-add "$HOME/.ssh/gitea" >/dev/null 2>&1
|
||||
ssh-add "$HOME/.ssh/admin@homeserver" >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
# aliases so the function is called beforehand
|
||||
alias ssh='_lazy_ssh; ssh'
|
||||
alias sudo='_lazy_ssh; sudo'
|
||||
alias ssh='__lazy_ssh_agent; ssh'
|
||||
alias sudo='__lazy_ssh_agent; sudo'
|
||||
|
||||
# alias to colourise make output
|
||||
_make() {
|
||||
# colourises make output, so when it prints via
|
||||
# $(warning) or $(error), it is formatted properly
|
||||
__colour_make() {
|
||||
make "$@" 2> >(sed -E \
|
||||
-e "s/^([Mm]akefile:[0-9]+:.*)/\x1b[33m\1\x1b[0m/" \
|
||||
-e "s/^.*error.*$/\x1b[31m&\x1b[0m/I" >&2)
|
||||
}
|
||||
alias make='_make'
|
||||
alias make='__colour_make'
|
||||
|
||||
# lazily loads the git utilities, to prevent slowdowns
|
||||
__lazy_git_ps1() {
|
||||
@@ -50,11 +51,13 @@ __regenprompt() {
|
||||
local err=$? # acquire the error code of the last executed command
|
||||
local git=$(__lazy_git_ps1)
|
||||
|
||||
# Format the error code to be in the last column of the terminal
|
||||
# this shall be printed as non-printable characters, so won't effect text wrapping.
|
||||
if [ $err -ne 0 ]; then
|
||||
err="\[\033[$((COLUMNS - 4))G\033[01;31m\]${err}\[\033[0G\]"
|
||||
err="\033[$((COLUMNS - 4))G\033[01;31m${err}\033[0G"
|
||||
else unset err; fi
|
||||
|
||||
PS1="$err" # error code
|
||||
PS1="\[$err\]" # error code
|
||||
PS1="$PS1\[\033[?25h\]" # show cursor
|
||||
PS1="$PS1\[\033[01;35m\]\u@\h" # user@host
|
||||
PS1="$PS1\[\033[00m\]:" # separator
|
||||
@@ -72,7 +75,7 @@ HISTIGNORE='exit*:clear*:\:*:echo*'
|
||||
shopt -s checkwinsize # check the window size after each command (and if necessary, the values of LINES and COLUMNS)
|
||||
shopt -s globstar # enable globstar (**/*)
|
||||
|
||||
[ -f "$HOME/.bash_aliases" ] && . .bash_aliases
|
||||
[ -f "$HOME/.bash_aliases" ] && . "$HOME/.bash_aliases"
|
||||
|
||||
# cute lil hyfetch :3
|
||||
[ "$TERM" == "xterm-kitty" ] && fastfetch
|
||||
|
||||
@@ -16,6 +16,7 @@ Checks:
|
||||
- '-bugprone-easily-swappable-parameters'
|
||||
- '-clang-analyzer-security.insecureAPI.*'
|
||||
- '-misc-include-cleaner'
|
||||
- '-bugprone-reserved-identifier'
|
||||
WarningsAsErrors: ''
|
||||
HeaderFileExtensions:
|
||||
- ''
|
||||
|
||||
@@ -20,3 +20,4 @@ Diagnostics:
|
||||
- bugprone-implicit-widening-of-multiplication-result
|
||||
- bugprone-switch-missing-default-case
|
||||
- bugprone-easily-swappable-parameters
|
||||
- bugprone-reserved-identifier
|
||||
|
||||
@@ -43,8 +43,8 @@ bindsym XF86AudioMute exec --no-startup-id x-volume mute
|
||||
bindsym XF86AudioMicMute exec --no-startup-id x-mic-mute
|
||||
|
||||
# brightness control
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id x-brightness-up
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id x-brightness-down
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id x-brightness up
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id x-brightness down
|
||||
|
||||
# media controls
|
||||
bindsym XF86AudioPlay exec playerctl play-pause
|
||||
|
||||
@@ -4,6 +4,7 @@ vim.g.maplocalleader = ' '
|
||||
Autocmd = vim.api.nvim_create_autocmd
|
||||
Map = vim.keymap.set
|
||||
|
||||
---@module 'gruvbox'
|
||||
---@class userdata
|
||||
---@field palette GruvboxPalette
|
||||
_G.userdat = {}
|
||||
|
||||
@@ -5,7 +5,10 @@ Map({ 'n', 'v' }, '<left>', '<nop>')
|
||||
Map({ 'n', 'v' }, '<right>', '<nop>')
|
||||
|
||||
-- tab management / navigation
|
||||
Map('n', '<c-t>', '<cmd>enew<cr>', { desc = 'create a new tab' })
|
||||
Map('n', '<c-t>', '<cmd>enew<cr>', { desc = 'create a new buffer' })
|
||||
Map('n', '<tab>', '<cmd>bnext<cr>', { desc = 'move to next buffer' })
|
||||
Map('n', '<s-tab>', '<cmd>bprevious<cr>', { desc = 'move to previous buffer' })
|
||||
Map('n', '<c-w>', '<cmd>bd<cr>', { desc = 'close buffer' })
|
||||
|
||||
-- for help exiting certain modes
|
||||
Map({ 'n', 'i' }, '<esc>', '<cmd>nohlsearch<cr><esc>', { desc = 'cancel search highlighting and escape' })
|
||||
@@ -28,6 +31,8 @@ Map('n', 'K', vim.lsp.buf.hover, { desc = 'symbol hover' })
|
||||
Map('n', '<F2>', vim.lsp.buf.rename, { desc = 'rename symbol' })
|
||||
Map('n', '<leader>lm', vim.diagnostic.open_float, { desc = 'view line\'s diagnostic messages' })
|
||||
Map('n', '<leader>q', vim.lsp.buf.code_action, { desc = 'view quickfix list' })
|
||||
Map('n', 'gd', vim.lsp.buf.definition, { desc = "Go to the definition" })
|
||||
Map('n', 'gr', vim.lsp.buf.references, { desc = "Go to the reference" })
|
||||
|
||||
-- smart tabulation
|
||||
Map('i', '<tab>', function()
|
||||
|
||||
@@ -2,17 +2,8 @@ local o = vim.opt
|
||||
|
||||
-- set options
|
||||
o.clipboard = "unnamedplus" -- keep the clipboard in sync with the one provided by the OS
|
||||
o.termguicolors = true -- allows for colour in the terminal
|
||||
o.number = true -- show line numbers
|
||||
o.cursorline = true -- highlight the current line
|
||||
o.cursorcolumn = false -- highlight the current column
|
||||
o.dir = vim.fn.stdpath('cache') .. '/swp' -- swap directory location for recovery
|
||||
o.sessionoptions = 'buffers,curdir,folds,help,localoptions,tabpages,terminal'
|
||||
o.expandtab = false -- whether tabs are expanded to spaces (overridden by .editorconfig)
|
||||
o.diffopt = 'internal,filler,closeoff,linematch:60' -- diff visualisation
|
||||
o.foldenable = true -- whether folding is enabled
|
||||
o.wrap = false -- whether to wrap text to a new line when it goes off-screen
|
||||
o.breakindent = true -- wrapped lines start at the same location as the start of the line
|
||||
o.ignorecase = true -- whether case should be ignored whilst searching
|
||||
o.list = true -- shows invisible characters
|
||||
o.listchars = { -- whitespace characters
|
||||
eol = nil,
|
||||
@@ -23,30 +14,25 @@ o.listchars = { -- whitespace charact
|
||||
space = '·',
|
||||
nbsp = '␣',
|
||||
}
|
||||
o.mouse = 'nv' -- which modes the mouse is enabled in 'a:all'
|
||||
o.number = true -- show line numbers
|
||||
o.relativenumber = true -- whether line numbers are relative to the cursor
|
||||
o.scrolloff = 10 -- minimal number of screen lines to keep above and below the cursor
|
||||
o.showtabline = 2 -- whether to show the tab line
|
||||
o.signcolumn = 'yes' -- always show the signcolumn, otherwise it shifts text all the time
|
||||
o.tabstop = 8 -- visual spaces per tab
|
||||
o.softtabstop = 8 -- spaces inserted per tab in insert mode
|
||||
o.sessionoptions = 'buffers,curdir,folds,help,localoptions,tabpages,terminal'
|
||||
o.shiftwidth = 8 -- spaces for auto-indent
|
||||
o.smartindent = true -- behave a bit more nuanced with when to indent
|
||||
o.ignorecase = true -- whether case should be ignored whilst searching
|
||||
o.smartcase = true -- overrides the above option if contains capital letters
|
||||
o.inccommand = 'split' -- split|nosplit whether substitutions should appear whilst typing.
|
||||
o.splitbelow = true -- force all horizontal splits below the current window
|
||||
o.splitright = true -- force all vertical splits to the right of this window
|
||||
o.showmode = false -- don't show mode as this is already in the status line
|
||||
o.signcolumn = 'yes' -- always show the signcolumn, otherwise it shifts text all the time
|
||||
o.smartcase = true -- overrides the above option if contains capital letters
|
||||
o.smartindent = true -- behave a bit more nuanced with when to indent
|
||||
o.spell = true -- whether spell checking is enabled
|
||||
o.spellfile = vim.fn.stdpath('config') .. '/spell/user.utf-8.add'
|
||||
o.spelllang = 'en_gb,nl' -- set the spell languages
|
||||
o.termguicolors = true -- allows for colour in the terminal
|
||||
o.timeoutlen = 300 -- number of MS to wait for a mapped sequence to complete
|
||||
o.ttimeoutlen = 0 -- number of MS to wait for a key sequence to complete
|
||||
o.undodir = vim.fn.stdpath('cache') .. '/undo' -- directory for undo files
|
||||
o.undofile = true -- for saving the undo history
|
||||
o.undolevels = 1024 -- the amount of changes that can be undone
|
||||
o.timeoutlen = 300 -- number of MS to wait for a mapped sequence to complete
|
||||
o.ttimeoutlen = 0 -- number of MS to wait for a key sequence to complete
|
||||
o.updatetime = 250 -- number of MS of nothing typed to write a swap file to disk.
|
||||
o.spell = true -- whether spell checking is enabled
|
||||
o.spelllang = 'en_gb,nl' -- set the spell languages
|
||||
o.spellfile = vim.fn.stdpath('config') .. '/spell/user.utf-8.add'
|
||||
o.wrap = false -- whether to wrap text to a new line when it goes off-screen
|
||||
|
||||
vim.diagnostic.config({
|
||||
underline = true, -- use underline for diagnostics
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
---@type LazySpec
|
||||
return { {
|
||||
'windwp/nvim-autopairs', -- automatically inserts closing brackets
|
||||
event = { 'BufReadPre', 'BufNewFile' },
|
||||
opts = {
|
||||
enable_moveright = true, -- moves the cursor over existing pairs instead of inserting duplicates
|
||||
check_ts = true, -- whether to check treesitter for specific nodes
|
||||
ts_config = {}
|
||||
},
|
||||
config = function(_, opts)
|
||||
local autopairs = require 'nvim-autopairs'
|
||||
autopairs.setup(opts)
|
||||
|
||||
-- customise the rule for [] brackets so it doesn't close when typing ANSI escape codes
|
||||
local rule = autopairs.get_rule '['
|
||||
if rule then
|
||||
rule:with_pair(function(opt)
|
||||
local ei = math.max(1, opt.col - 1) -- get the end-index
|
||||
local prev_oct = opt.line:sub(math.max(1, opt.col - 4), ei) -- get the range of an octal escape code
|
||||
local prev_hex = opt.line:sub(math.max(1, opt.col - 4), ei) -- get the range of a hexadecimal escape code
|
||||
local prev_cha = opt.line:sub(math.max(1, opt.col - 2), ei) -- get the range of a character escape code
|
||||
|
||||
-- check whether we can't match any of the patterns,
|
||||
-- if so return true, otherwise return false (whether to insert a pair)
|
||||
return (prev_oct ~= [[\033]] and prev_hex ~= [[\x1b]] and prev_cha ~= [[\e]])
|
||||
end)
|
||||
else
|
||||
vim.notify('could not add a rule for not auto-closing [ when typing an ANSI escape code',
|
||||
vim.log.levels.WARN)
|
||||
end
|
||||
end,
|
||||
} }
|
||||
@@ -1,29 +0,0 @@
|
||||
---@type LazySpec
|
||||
return { {
|
||||
'akinsho/bufferline.nvim', -- shows the opened buffers
|
||||
event = 'VeryLazy',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons', },
|
||||
---@type bufferline.UserConfig
|
||||
opts = {
|
||||
options = {
|
||||
mode = 'buffers',
|
||||
separator_style = '',
|
||||
sort_by = 'directory',
|
||||
diagnostics = 'nvim_lsp',
|
||||
diagnostics_indicator = function(c, _, _, _)
|
||||
return '(' .. c .. ')'
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require('bufferline').setup(opts)
|
||||
|
||||
Map('n', '<tab>', '<cmd>BufferLineCycleNext<cr>', { desc = 'switch to the next tab' })
|
||||
Map('n', '<s-tab>', '<cmd>BufferLineCyclePrev<cr>', { desc = 'switch to the previous tab' })
|
||||
|
||||
Map('n', '<leader>wch', '<cmd>BufferLineCloseLeft<cr>', { desc = 'close the tabs on the left' })
|
||||
Map('n', '<leader>wcl', '<cmd>BufferLineCloseRight<cr>', { desc = 'close the tabs on the right' })
|
||||
Map('n', '<leader>wcw', '<cmd>BufferLineCloseOthers<cr>',
|
||||
{ desc = 'close all tabs except the current one' })
|
||||
end,
|
||||
} }
|
||||
@@ -1,54 +0,0 @@
|
||||
---@type LazySpec
|
||||
return { {
|
||||
'lewis6991/gitsigns.nvim', -- adds git signs to the signcolumn
|
||||
event = 'VeryLazy',
|
||||
opts = {
|
||||
signs_staged_enable = true, -- whether staged statuses are enabled
|
||||
signcolumn = true, -- the signs enable/disable based on the signcolumn state
|
||||
current_line_blame = true, -- show the blame of the current line
|
||||
current_line_blame_opts = {
|
||||
delay = 50, -- delay in MS before blame is shown
|
||||
ignore_whitespace = true, -- whether to ignore whitespace
|
||||
use_focus = true, -- whether to only enable when the buffer is in focus
|
||||
},
|
||||
signs = { -- signs when working
|
||||
add = { text = '+' },
|
||||
change = { text = '~' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signs_staged = { -- signs when staged
|
||||
add = { text = 'A' },
|
||||
change = { text = 'M' },
|
||||
delete = { text = 'D' },
|
||||
topdelete = { text = 'D' },
|
||||
changedelete = { text = 'M' },
|
||||
untracked = { text = 'U' },
|
||||
},
|
||||
attach_to_untracked = true, -- shows untracked files' signcolumn
|
||||
},
|
||||
config = function(_, opts)
|
||||
require('gitsigns').setup(opts)
|
||||
|
||||
local palette = _G.userdat.palette
|
||||
local bg = vim.api.nvim_get_hl(0, { name = 'SignColumn' }).bg
|
||||
for n, fg in pairs {
|
||||
GitSignsAdd = palette.bright_green,
|
||||
GitSignsChange = palette.bright_orange,
|
||||
GitSignsDelete = palette.bright_red,
|
||||
GitSignsTopdelete = palette.bright_red,
|
||||
GitSignsChangedelete = palette.bright_orange,
|
||||
GitSignsUntracked = palette.bright_aqua,
|
||||
GitSignsStagedAdd = palette.neutral_green,
|
||||
GitSignsStagedChange = palette.neutral_orange,
|
||||
GitSignsStagedDelete = palette.neutral_red,
|
||||
GitSignsStagedTopDelete = palette.neutral_red,
|
||||
GitSignsStagedChangedelete = palette.neutral_orange,
|
||||
GitSignsStagedUntracked = palette.neutral_aqua,
|
||||
} do
|
||||
vim.api.nvim_set_hl(0, n, { fg = fg, bg = bg })
|
||||
end
|
||||
end,
|
||||
} }
|
||||
@@ -1,9 +1,10 @@
|
||||
---@module 'lazy'
|
||||
---@type LazySpec
|
||||
return { {
|
||||
'ellisonleao/gruvbox.nvim',
|
||||
lazy = false,
|
||||
dependencies = { 'johnfrankmorgan/whitespace.nvim' },
|
||||
priority = 1000,
|
||||
---@module 'gruvbox'
|
||||
---@type GruvboxConfig
|
||||
opts = {
|
||||
styles = {
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
---@module 'lazy'
|
||||
---@type LazySpec
|
||||
return { {
|
||||
'lmburns/lf.nvim',
|
||||
lazy = false,
|
||||
dependencies = { 'akinsho/toggleterm.nvim' },
|
||||
---@module 'lf'
|
||||
---@type Lf.Config
|
||||
opts = {
|
||||
direction = 'float',
|
||||
border = 'rounded',
|
||||
},
|
||||
config = function(_, opts)
|
||||
vim.g.lf_netrw = 1
|
||||
|
||||
local lf = require('lf')
|
||||
lf.setup(opts)
|
||||
|
||||
Map({ 'n' }, '<leader>o', lf.start, { desc = 'Shows the LF window' })
|
||||
end
|
||||
} }
|
||||
@@ -1,43 +1,90 @@
|
||||
---@type LazySpec
|
||||
return { {
|
||||
'echasnovski/mini.nvim',
|
||||
config = function()
|
||||
require('mini.ai').setup()
|
||||
require('mini.surround').setup()
|
||||
require('mini.operators').setup()
|
||||
-- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps'
|
||||
local path_package = vim.fn.stdpath('data') .. '/site/'
|
||||
local mini_path = path_package .. 'pack/deps/start/mini.nvim'
|
||||
if not (vim.uv or vim.loop).fs_stat(mini_path) then
|
||||
vim.cmd('echo "Installing [`mini.nvim`](../doc/mini-nvim.qmd#mini.nvim)" | redraw')
|
||||
local clone_cmd = {
|
||||
'git', 'clone', '--filter=blob:none',
|
||||
'https://github.com/nvim-mini/mini.nvim', mini_path
|
||||
}
|
||||
vim.fn.system(clone_cmd)
|
||||
vim.cmd('packadd mini.nvim | helptags ALL')
|
||||
vim.cmd('echo "Installed [`mini.nvim`](../doc/mini-nvim.qmd#mini.nvim)" | redraw')
|
||||
end
|
||||
require('mini.deps').setup({ path = { package = path_package } })
|
||||
|
||||
require('mini.indentscope').setup({
|
||||
symbol = '¦',
|
||||
require('mini.ai').setup() -- enhances the use of a/i textobjects
|
||||
require('mini.align').setup() -- utility to align text in various ways
|
||||
require('mini.comment').setup() -- for toggling comments inline
|
||||
require('mini.move').setup() -- moving lines
|
||||
require('mini.operators').setup() -- duplicating lines and evaluating equations inline
|
||||
require('mini.pairs').setup() -- automatic closing pairs
|
||||
require('mini.surround').setup() -- surround stuff
|
||||
require('mini.clue').setup({ -- shows available keybinds when performing keybind actions
|
||||
window = { delay = 50 },
|
||||
triggers = {
|
||||
-- Leader triggers
|
||||
{ mode = 'n', keys = '<Leader>' },
|
||||
{ mode = 'x', keys = '<Leader>' },
|
||||
|
||||
-- Built-in completion
|
||||
{ mode = 'i', keys = '<C-x>' },
|
||||
|
||||
-- `g` key
|
||||
{ mode = 'n', keys = 'g' },
|
||||
{ mode = 'x', keys = 'g' },
|
||||
|
||||
-- Marks
|
||||
{ mode = 'n', keys = "'" },
|
||||
{ mode = 'n', keys = '`' },
|
||||
{ mode = 'x', keys = "'" },
|
||||
{ mode = 'x', keys = '`' },
|
||||
|
||||
-- Registers
|
||||
{ mode = 'n', keys = '"' },
|
||||
{ mode = 'x', keys = '"' },
|
||||
{ mode = 'i', keys = '<C-r>' },
|
||||
{ mode = 'c', keys = '<C-r>' },
|
||||
|
||||
-- Window commands
|
||||
{ mode = 'n', keys = '<C-w>' },
|
||||
|
||||
-- `z` key
|
||||
{ mode = 'n', keys = 'z' },
|
||||
{ mode = 'x', keys = 'z' },
|
||||
},
|
||||
|
||||
clues = {
|
||||
-- Enhance this by adding descriptions for <Leader> mapping groups
|
||||
require('mini.clue').gen_clues.builtin_completion(),
|
||||
require('mini.clue').gen_clues.g(),
|
||||
require('mini.clue').gen_clues.marks(),
|
||||
require('mini.clue').gen_clues.registers(),
|
||||
require('mini.clue').gen_clues.windows(),
|
||||
require('mini.clue').gen_clues.z(),
|
||||
},
|
||||
})
|
||||
require('mini.diff').setup({ -- shows git diffs in the file
|
||||
view = {
|
||||
style = 'sign',
|
||||
}
|
||||
})
|
||||
require('mini.files').setup() -- file browser
|
||||
Map('n', '<leader>o', MiniFiles.open, { desc = "Open mini file browser" })
|
||||
require('mini.jump').setup() -- extends f,F,t,T to work across multiple lines
|
||||
require('mini.cursorword').setup() -- highlight words beneath the cursor
|
||||
require('mini.icons').setup()
|
||||
require('mini.indentscope').setup({
|
||||
draw = {
|
||||
delay = 50, -- delay in MS before writing the indicator
|
||||
animation = require('mini.indentscope').gen_animation.none(),
|
||||
},
|
||||
options = {
|
||||
try_as_border = false,
|
||||
},
|
||||
})
|
||||
vim.api.nvim_set_hl(0, 'MiniIndentscopeSymbol', { fg = _G.userdat.palette.dark2, bg = nil })
|
||||
|
||||
require('mini.move').setup({
|
||||
mappings = {
|
||||
-- move visual selection in visual mode
|
||||
left = '<m-h>',
|
||||
down = '<m-j>',
|
||||
up = '<m-k>',
|
||||
right = '<m-l>',
|
||||
|
||||
-- move current line in normal mode
|
||||
line_left = '<m-h>',
|
||||
line_down = '<m-j>',
|
||||
line_up = '<m-k>',
|
||||
line_right = '<m-l>',
|
||||
},
|
||||
options = {
|
||||
reindent_linewise = true, -- automatically re-indent selection during line vertical move
|
||||
},
|
||||
})
|
||||
|
||||
require('mini.statusline').setup({
|
||||
})
|
||||
MiniDeps.later(function()
|
||||
vim.api.nvim_set_hl(0, 'MiniIndentscopeSymbol', { link = 'Whitespace' })
|
||||
end)
|
||||
require('mini.notify').setup() -- has more noticeable / utilitarian / aesthetically pleasing notifications
|
||||
require('mini.statusline').setup({
|
||||
content = {
|
||||
active = function()
|
||||
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
|
||||
@@ -66,6 +113,10 @@ return { {
|
||||
},
|
||||
use_icons = true,
|
||||
set_vim_settings = true,
|
||||
})
|
||||
end
|
||||
} }
|
||||
})
|
||||
require('mini.tabline').setup()
|
||||
require('mini.trailspace').setup() -- trailing space indication and removal.
|
||||
|
||||
---@module 'lazy'
|
||||
---@type LazySpec
|
||||
return {}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
---@module 'lazy'
|
||||
---@type LazySpec
|
||||
return { {
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.nvim' },
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {
|
||||
completions = {
|
||||
blink = { enabled = true }
|
||||
}
|
||||
}
|
||||
} }
|
||||
@@ -1,83 +0,0 @@
|
||||
---@module 'snacks'
|
||||
---@module 'lazy'
|
||||
---@type LazySpec
|
||||
return { { -- provides quality of life features for neovim
|
||||
'folke/snacks.nvim',
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
animate = { enabled = false }, -- efficient animations including over 45 easing functions (library)
|
||||
bigfile = { enabled = false }, -- deal with big files
|
||||
bufdelete = { enabled = false }, -- delete buffers without disrupting window layout
|
||||
dashboard = { enabled = false }, -- beautiful declarative dashboards
|
||||
debug = { enabled = false }, -- pretty inspect & backtraces for debugging
|
||||
dim = { enabled = false }, -- focus on the active scope by dimming the rest
|
||||
explorer = { enabled = false }, -- a file explorer (picker in disguise)
|
||||
git = { enabled = false }, -- git utilities
|
||||
gitbrowse = { enabled = false }, -- open the current file, branch, commit, or repo in a browser (e.g. github, gitlab, etc.)
|
||||
image = { enabled = true }, -- image viewer using kitty graphics protocol
|
||||
indent = { enabled = false }, -- indent guides and scopes
|
||||
input = { enabled = false }, -- better vim.ui.input
|
||||
layout = { enabled = false }, -- window layouts
|
||||
lazygit = { enabled = false }, -- open lazygit in a float, auto-configure colour scheme and integration with neovim
|
||||
notifier = { enabled = true }, -- pretty vim.notify
|
||||
notify = { enabled = true }, -- utility functions to work with neovim's vim.notify
|
||||
picker = { enabled = false }, -- picker for selecting items
|
||||
profiler = { enabled = false }, -- neovim lua profiler
|
||||
quickfile = { enabled = true }, -- when doing nvim somefile.txt, it will render the file as quickly as possible, before loading your plugins.
|
||||
rename = { enabled = true }, -- LSP-integrated file renaming with support for plugins like and.
|
||||
scope = { enabled = false }, -- scope detection, text objects and jumping based on treesitter or indent
|
||||
scratch = { enabled = false }, -- scratch buffers with a persistent file
|
||||
scroll = { enabled = false }, -- smooth scrolling
|
||||
statuscolumn = { enabled = false }, -- pretty status column
|
||||
terminal = { enabled = false }, -- create and toggle floating/split terminals
|
||||
toggle = { enabled = false }, -- toggle keymaps integrated with which-key icons / colours
|
||||
util = { enabled = false }, -- utility functions for Snacks (library)
|
||||
win = { enabled = false }, -- create and manage floating windows or splits
|
||||
words = { enabled = true }, -- auto-show LSP references and quickly navigate between them
|
||||
zen = { enabled = false }, -- zen mode; distraction-free coding
|
||||
},
|
||||
keys = {
|
||||
{ '*', function() Snacks.words.jump(-vim.v.count1) end, desc = 'next reference', nowait = true },
|
||||
{ '#', function() Snacks.words.jump(vim.v.count1) end, desc = 'prev reference', nowait = true },
|
||||
{ '<c-w>', function() Snacks.bufdelete() end, desc = 'delete buffer', nowait = true },
|
||||
{ '<leader>N', function() Snacks.notifier.show_history() end, desc = 'show notification history' },
|
||||
{ '<leader>U', function() Snacks.picker.undo() end, desc = 'undo tree' },
|
||||
{ '<leader>gB', function() Snacks.git.blame_line() end, desc = 'git blame line' },
|
||||
{ '<leader>gb', function() Snacks.picker.git_branches() end, desc = 'git branches' },
|
||||
{ '<leader>@', function() Snacks.picker.lsp_symbols() end, desc = 'workspace symbols' },
|
||||
{ '<leader>ld', function() Snacks.picker.lsp_definitions() end, desc = 'definition' },
|
||||
{ '<leader>lr', function() Snacks.picker.lsp_references() end, desc = 'references' },
|
||||
{ '<leader>li', function() Snacks.picker.lsp_implementations() end, desc = 'implementation' },
|
||||
{ '<leader>lt', function() Snacks.picker.lsp_type_definitions() end, desc = 'type definition' },
|
||||
{ '<leader>?', function() Snacks.picker.keymaps() end, desc = 'keymaps' },
|
||||
{ 'gd', function() Snacks.picker.lsp_definitions() end, desc = 'definition' },
|
||||
{ 'gr', function() Snacks.picker.lsp_references() end, desc = 'references' },
|
||||
},
|
||||
init = function()
|
||||
Autocmd("User", {
|
||||
pattern = 'VeryLazy',
|
||||
callback = function()
|
||||
local virt_lines = false;
|
||||
Snacks.toggle.new({
|
||||
id = "virtual_lines",
|
||||
name = "diagnostics virtual lines",
|
||||
get = function() return virt_lines end,
|
||||
set = function(v)
|
||||
virt_lines = v
|
||||
vim.diagnostic.config({ virtual_lines = v })
|
||||
end,
|
||||
}):map('<leader>tl')
|
||||
|
||||
Snacks.toggle.option('wrap', { name = 'word wrap' }):map('<leader>tw')
|
||||
Snacks.toggle.option('spell', { name = 'spelling' }):map('<leader>ts')
|
||||
Snacks.toggle.inlay_hints():map('<leader>th')
|
||||
end,
|
||||
})
|
||||
end,
|
||||
---@param opts snacks.Config
|
||||
config = function(_, opts)
|
||||
require('snacks').setup(opts)
|
||||
end
|
||||
} }
|
||||
@@ -7,6 +7,7 @@ return { {
|
||||
dependencies = {
|
||||
{ 'nvim-lua/plenary.nvim' }, -- contains lua functions for neovim, apparently
|
||||
{ 'nvim-telescope/telescope-ui-select.nvim' }, -- allows neovim core stuff to enter the telescope picker
|
||||
{ 'nvim-tree/nvim-web-devicons' },
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = 'make', -- used for when the plugin is installed/updated
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
---@type LazySpec
|
||||
return { { -- displays pending keybinds, helps with remembering keybinds
|
||||
'folke/which-key.nvim',
|
||||
event = 'VeryLazy',
|
||||
---@module 'which-key'
|
||||
---@type wk.Opts
|
||||
opts = {
|
||||
delay = 0, -- delay in MS between pressing a key and opening which-key
|
||||
icons = {
|
||||
mappings = true,
|
||||
keys = {
|
||||
Up = '',
|
||||
Down = '',
|
||||
Left = '',
|
||||
Right = '',
|
||||
C = '',
|
||||
M = '',
|
||||
D = '',
|
||||
S = '',
|
||||
CR = '',
|
||||
Esc = '',
|
||||
ScrollWheelUp = '',
|
||||
ScrollWheelDown = '',
|
||||
NL = '',
|
||||
BS = '',
|
||||
Space = '',
|
||||
Tab = '',
|
||||
F1 = '<F1>',
|
||||
F2 = '<F2>',
|
||||
F3 = '<F3>',
|
||||
F4 = '<F4>',
|
||||
F5 = '<F5>',
|
||||
F6 = '<F6>',
|
||||
F7 = '<F7>',
|
||||
F8 = '<F8>',
|
||||
F9 = '<F9>',
|
||||
F10 = '<F10>',
|
||||
F11 = '<F11>',
|
||||
F12 = '<F12>',
|
||||
},
|
||||
},
|
||||
spec = { -- document the key chains we know about
|
||||
{ '<leader>g', group = 'git' },
|
||||
{ '<leader>s', group = 'search' },
|
||||
{ '<leader>t', group = 'toggle' },
|
||||
{ '<leader>w', group = 'windows' },
|
||||
{ '<leader>l', group = 'lsp' },
|
||||
{ '<leader>wc', group = 'close' },
|
||||
},
|
||||
},
|
||||
} }
|
||||
5
.inputrc
5
.inputrc
@@ -1,5 +1,6 @@
|
||||
# for backward searching the history
|
||||
"\e[A": history-search-backward
|
||||
"\e[B": history-search-forward
|
||||
|
||||
set completion-ignore-case on
|
||||
set colored-completion-prefix on
|
||||
set completion-ignore-case on # ignore completion case
|
||||
set colored-completion-prefix on # colour in what it has been able to complete
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/usr/bin/sh
|
||||
"$HOME/.local/share/emsdk/emsdk" "$@"
|
||||
BIN
.local/bin/owo
Executable file
BIN
.local/bin/owo
Executable file
Binary file not shown.
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
if [ -z ${var+2} ]; then
|
||||
printf "\033[91mno parameters were given!\033[0m\n"
|
||||
fi
|
||||
|
||||
for i in $2; do
|
||||
readonly fname
|
||||
fname="$(basename "$i" .*)"
|
||||
mkdir "$fname"
|
||||
cd "$fname" || return 1
|
||||
unzip "../$i"
|
||||
cd - || return 1
|
||||
done
|
||||
BIN
.local/bin/uwu
BIN
.local/bin/uwu
Binary file not shown.
27
.local/bin/x-brightness
Executable file
27
.local/bin/x-brightness
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
[ -z "$AMOUNT" ] && AMOUNT=5
|
||||
|
||||
notify() {
|
||||
notify-send "$@" -h string:x-dunst-stack-tag:'brightnessctl' -a 'brightnessctl'
|
||||
}
|
||||
|
||||
max=$(brightnessctl max)
|
||||
br=$(brightnessctl get)
|
||||
brp=$((100 * br / max))
|
||||
|
||||
case "$1" in
|
||||
up) brp=$((brp + AMOUNT)) ;;
|
||||
down) brp=$((brp - AMOUNT)) ;;
|
||||
*)
|
||||
echo 'E: could not decide what brightness action to perform!' >&2
|
||||
notify 'could not decide what audio action to perform!' -u critical -t 5000
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
brp=$((brp - (brp % AMOUNT)))
|
||||
[ $brp -gt 100 ] && brp=100
|
||||
|
||||
brightnessctl set $brp%
|
||||
ico=display-brightness-symbolic
|
||||
notify -u low -i "$ico" -h "int:value:$brp" "brightness: $brp%"
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/sh
|
||||
br=$(brightnessctl set 5%- |
|
||||
grep '%' | awk '{print $4}' | sed 's/[^0-9]//g')
|
||||
notify-send -u low -i display-brightness-symbolic -h int:value:"$br" -h string:x-dunst-stack-tag:'brightnessctl' -a 'brightnessctl' "brightness: $br%"
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/sh
|
||||
br=$(brightnessctl set 5%+ |
|
||||
grep '%' | awk '{print $4}' | sed 's/[^0-9]//g')
|
||||
notify-send -i display-brightness-symbolic -u low -h int:value:"$br" -h string:x-dunst-stack-tag:'brightnessctl' -a 'brightnessctl' "brightness: $br%"
|
||||
Reference in New Issue
Block a user