Merge branch 'master' of ssh://git.venberg.xyz:7920/Gabe/dotfiles

This commit is contained in:
Gabe Venberg 2023-07-07 08:58:41 -05:00
commit be3bc4095c
8 changed files with 463 additions and 324 deletions

View file

@ -3,8 +3,14 @@
name = Gabe Venberg
[alias]
hist = log --graph --date-order --date=short --pretty=format:'%C(auto)%h%d %C(reset)%s %C(bold blue)%ce %C(reset)%C(green)%cr (%cd)'
graph = log --graph --date-order --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) (%C(bold red)%an%C(reset)/%C(bold cyan)%ae%C(reset)) - %C(white)%s%C(reset)%C(yellow)%d%C(reset)' --all
graph = log --graph --topo-order --all --pretty=format:'%C(auto)%h %C(cyan)%an %C(blue)%ar %C(auto)%d %s'
[init]
defaultBranch = trunk
[push]
autoSetupRemote = true
[difftool]
prompt = false
[diff]
tool = nvimdiff
[difftool "nvimdiff"]
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\""

View file

@ -191,9 +191,10 @@ font pango:DejaVu Sans Mono 8
bindsym $mod+control+plus exec --no-startup-id "xbacklight -inc 10; notify-send --expire-time=500 Brightness\ $(xbacklight -get | cut --delimiter=. -f 1)"
bindsym $mod+control+minus exec --no-startup-id "xbacklight -dec 10; notify-send --expire-time=500 Brightness\ $(xbacklight -get | cut --delimiter=. -f 1)"
#screenshot everything with mod+s, current window with mod+shift+s
#screenshot everything with mod+s, current window with mod+shift+s, selection with mod+ctrl+s
bindsym $mod+s exec --no-startup-id "maim ~/Pictures/$(date +%s).png; notify-send --expire-time=1000 'Whole-desktop screenshot taken'"
bindsym $mod+shift+s exec --no-startup-id "maim -i $(xdotool getactivewindow) ~/Pictures/$(date +%s).png; notify-send --expire-time=1000 'Window screenshot taken'"
bindsym $mod+ctrl+s exec --no-startup-id "maim -s ~/Pictures/$(date +%s).png; notify-send --expire-time=1000 'Whole-desktop screenshot taken'"
#colour picker with xcolor
bindsym --release $mod+c exec --no-startup-id "xcolor -s"

View file

@ -2,11 +2,11 @@
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
Packer_Bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
Packer_Bootstrap = fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim',
install_path })
end
return require('packer').startup(function(use)
--startup speed
use 'lewis6991/impatient.nvim'
@ -16,12 +16,38 @@ return require('packer').startup(function(use)
use { 'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate',
config=function() require('nvim-treesitter').setup{
ensure_installed='maintained',
config = function()
require('nvim-treesitter').setup {
ensure_installed = {
'c',
'lua',
'vim',
'vimdoc',
'query',
'bash',
'comment',
'cpp',
'diff',
'git_config',
'git_rebase',
'gitattributes',
'gitcommit',
'gitignore',
'json',
'jsonc',
'latex',
'make',
'python',
'regex',
'rust',
'toml',
},
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = { enable = true }
}end,
}
end,
}
use {
{
@ -125,13 +151,15 @@ return require('packer').startup(function(use)
requires = {
'kyazdani42/nvim-web-devicons', -- optional, for file icon
},
config = function() require'nvim-tree'.setup {
config = function()
require 'nvim-tree'.setup {
on_attach = function(bufnr)
local api = require('nvim-tree.api')
local function opts(desc)
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true,
nowait = true }
end
@ -234,10 +262,10 @@ return require('packer').startup(function(use)
vim.keymap.set('n', 'q', api.tree.close, opts('Close'))
vim.keymap.set('n', 'g?', api.tree.toggle_help, opts('Help'))
vim.keymap.set('n', 'W', api.tree.collapse_all, opts('Collapse'))
end,
-- on_attach = on_attach
} end
}
end
}
--UI stuff
@ -273,7 +301,8 @@ end
use { 'nvim-lualine/lualine.nvim',
requires = { 'kyazdani42/nvim-web-devicons', opt = true },
config=function() require('lualine').setup{
config = function()
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'auto',
@ -299,7 +328,8 @@ end
lualine_z = {}
},
extensions = {}
} end,
}
end,
}
use { 'kdheepak/tabline.nvim',
@ -329,7 +359,8 @@ requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicon
use { 'folke/trouble.nvim',
requires = "kyazdani42/nvim-web-devicons",
config = function() require("trouble").setup {
config = function()
require("trouble").setup {
position = "bottom", -- position of the list can be: bottom, top, left, right
height = 10, -- height of the trouble list when position is top or bottom
width = 50, -- width of the list when position is left or right
@ -339,7 +370,8 @@ requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicon
fold_closed = "", -- icon used for closed folds
group = true, -- group results by file
padding = true, -- add an extra new line on top of the list
action_keys = { -- key mappings for actions in the trouble list
action_keys = {
-- key mappings for actions in the trouble list
-- map to {} to remove a mapping, for example:
-- close = {},
close = "q", -- close the list
@ -381,7 +413,8 @@ requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicon
use { 'romgrk/nvim-treesitter-context',
requires = 'nvim-treesitter/nvim-treesitter',
config=function() require('treesitter-context').setup{
config = function()
require('treesitter-context').setup {
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
@ -391,7 +424,8 @@ requires = { { 'hoob3rt/lualine.nvim', opt=true }, {'kyazdani42/nvim-web-devicon
-- Separator between context and content. Should be a single character string, like '-'.
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
separator = nil,
} end
}
end
}
use { 'lewis6991/gitsigns.nvim',

View file

@ -0,0 +1,9 @@
"TODO: port to LUA!
function! Minimal_foldtext()
let lines_count = v:foldend - v:foldstart + 1
let lines_count_text = '+' . v:folddashes . '| ' . printf("%10S" , lines_count) . ' lines |'
let line_level_text = '| ' . printf("%8S" , 'level ' . v:foldlevel) . ' |'
let fold_text_end = line_level_text . repeat('-',8)
let fold_text_length = strlen(lines_count_text . fold_text_end) + &foldcolumn
return lines_count_text . repeat('-' , winwidth(0) - fold_text_length - 4) . fold_text_end
endfunction

View file

@ -0,0 +1,81 @@
--set some aliases to make typing this faster.
local cmd = vim.cmd
local opt = vim.opt
local fn = vim.fn
local map = vim.api.nvim_set_keymap
--leader key is set through a variable, for some reason.
vim.g.mapleader = ';'
--helper functions
local function keyCode(string)
return vim.api.nvim_replace_termcodes(str, true, true, true, true)
end
--options using vim.opt (aliased, of course.)
opt.mouse = 'a'
opt.lazyredraw = true
opt.termguicolors = true
opt.autoread = true
opt.swapfile = false
opt.history = 500
opt.formatoptions = 'rojq'
--disable hard text wrapping, will only wrap visually.
opt.textwidth = 0
opt.wrapmargin = 0
opt.wrap = true
opt.linebreak = true
opt.breakindent = true
--add ruler to side of screen.
opt.number = true
opt.numberwidth=2
--displays cordinates of your cursor in statusbar
opt.ruler = true
--always leave 5 cells between cursor and side of window.
opt.scrolloff = 5
--better command line completion
opt.wildmenu = true
--ignore case in search if search is all lowercase.
opt.ignorecase = true
opt.smartcase = true
--show unfinished commands in statusbar.
opt.showcmd = true
--regex stuff
opt.magic = true
--always have a status line
opt.laststatus = 2
--tab stuff
opt.tabstop = 4
opt.shiftwidth = 0 --zero inherrits tabstop.
opt.autoindent = true
opt.smartindent = true
opt.smarttab = true
--space based tabs.
-- opt.softtabstop=-1 --negative value inherrits shiftwidth.
-- opt.expandtab=true
--highlight search results as you type.
opt.hlsearch = true
opt.incsearch = true
--foling stuff
opt.foldlevelstart = 5
cmd([[source ~/.config/nvim/foldtext.vimrc]])
opt.foldmethod = 'indent'
opt.foldtext = 'minimal_foldtext()'
opt.fillchars = 'stl:=,stlnc: ,vert:|,fold:-'
opt.foldcolumn = '4'
opt.foldenable = true
opt.foldignore = ''
--keyboard mappings
local opts = { noremap = true, silent = true }
--toggle spell check
map('n', '<leader>sp', ':setlocal spell!<CR>', opts)
--use ctrl+direction to move between splits.
map('n', '<C-h>', '<C-w>h', opts)
map('n', '<C-j>', '<C-w>j', opts)
map('n', '<C-k>', '<C-w>k', opts)
map('n', '<C-l>', '<C-w>l', opts)
--toggle folds with space.
map('', '<Space>', 'za', opts)
--clear highlighting with leader+h
map('', '<leader>h', ':nohls<CR>', opts)

View file

@ -4,7 +4,7 @@ Description=SSH key agent
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
ExecStart=-/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target

View file

@ -1,5 +1,8 @@
#remap caps lock to a third control key. both shifts at once toggle shiftlock
setxkbmap -option ctrl:nocaps
#dark mode styling for qt and gtk apps.
export GTK_THEME=Adwaita:dark
export GTK2_RC_FILES=/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc
export QT_STYLE_OVERRIDE=adwaita-dark
xrdb -merge ~/.Xresources
#~/dotfiles/scripts/mousestart
i3

View file

@ -153,6 +153,8 @@
alias slideshow='feh --full-screen --randomize --auto-zoom --recursive --slideshow-delay'
# converts all .doc and .docx files in the local directory to pdfs using libreoffice
alias doc2pdf='loffice --convert-to pdf --headless *.docx#'
#common options for sshfs
alias sshmnt='sshfs -o idmap=user,compression=no,reconnect,follow_symlinks,dir_cache=yes,ServerAliveInterval=15'
#setup grep to be a bit more nice
local GREP_OPTIONS=""
@ -176,3 +178,6 @@
#zsh completions, if it exists.
testPath=$(find /usr/share -path '*fzf/*completion.zsh' -print -quit 2> /dev/null)
[ -f "$testPath" ] && source $testPath
#if it was installed using git, can just source the one file:
testPath="$HOME/.fzf.zsh"
[ -f "$testPath" ] && source $testPath