Compare commits

...

10 Commits

Author SHA1 Message Date
73dab4cc48 add init.lua to git ignore
no public changes will be made, only call personal configs
2024-07-24 22:51:13 -04:00
741ce3fa04 readme 2024-07-24 22:37:35 -04:00
3d4d64bdc9 add logind.conf config 2024-07-24 22:31:57 -04:00
525a235ea8 add power commands for sudoers file 2024-07-24 22:29:30 -04:00
17df1ba39f add ly config 2024-07-24 22:26:27 -04:00
3722cfb325 added yay aur package to source software 2024-07-24 18:43:21 -04:00
5861b08e7d added pacman config 2024-07-24 18:42:17 -04:00
36f3a7c506 added udev rules for thunderbolt docks 2024-07-24 18:39:18 -04:00
56130f51e8 added lf config 2024-07-24 18:38:20 -04:00
cce170ad96 added nvim config 2024-07-24 18:38:20 -04:00
39 changed files with 1578 additions and 0 deletions

7
.gitignore vendored
View File

@ -1,2 +1,9 @@
user/.config/zsh/personal/* user/.config/zsh/personal/*
user/.config/autorandr/* user/.config/autorandr/*
user/.config/nvim/init.lua
user/.config/nvim/plugin/*
user/.config/nvim/plugin/lua/priv/*
root/etc/ly/lang/*
root/etc/ly/save.ini
root/etc/ly/wsetup.sh
root/etc/ly/xsetup.sh

3
.gitmodules vendored
View File

@ -10,3 +10,6 @@
[submodule "user/.local/share/zsh/plugins/powerlevel10k"] [submodule "user/.local/share/zsh/plugins/powerlevel10k"]
path = user/.local/share/zsh/plugins/powerlevel10k path = user/.local/share/zsh/plugins/powerlevel10k
url = https://github.com/romkatv/powerlevel10k url = https://github.com/romkatv/powerlevel10k
[submodule "source-software/yay"]
path = source-software/yay
url = https://aur.archlinux.org/yay.git

BIN
personal/archives/nvim.zip Normal file

Binary file not shown.

View File

@ -9,4 +9,7 @@ zip --encrypt ../../../../personal/archives/zsh.zip ./*
cd "${XDG_CONFIG_HOME:-$HOME/.config}/autorandr" cd "${XDG_CONFIG_HOME:-$HOME/.config}/autorandr"
zip --encrypt "$dir/archives/autorandr.zip" ./**/** zip --encrypt "$dir/archives/autorandr.zip" ./**/**
cd "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/lua/priv"
zip --encrypt "$dir/archives/nvim.zip" ./*
cd "$dir" cd "$dir"

View File

@ -4,3 +4,6 @@
unzip ./archives/zsh.zip -d ../user/.config/zsh/personal unzip ./archives/zsh.zip -d ../user/.config/zsh/personal
unzip ./archives/autorandr.zip -d ../user/.config/autorandr unzip ./archives/autorandr.zip -d ../user/.config/autorandr
unzip ./archives/nvim.zip -d ../user/.config/nvim/lua/priv
echo 'require("priv.init")' >> ../user/.config/nvim/init.lua

31
readme.md Normal file
View File

@ -0,0 +1,31 @@
# My Config Files
## To Do
### Repo Features
- [ ] installation scripts for
- [ ] config files for any system
- [ ] arch linux software
- [ ] arch linux base
### Configs to Add
- [ ] default programs
- [ ] suckless software
- [ ] dwm
- [ ] dwmblocks or other status bar manager
- [ ] dmenu
- [ ] slock
- [ ] st
- [ ] picom
- [ ] dunst
- [ ] lf
- [ ] scripts
- [ ] dmenu-pass
- [ ] md2src
- [ ] bookmarks
- [ ] firefox
### Other
- [ ] write docs
- [ ] possibly convert all to md files to be installed with md2src

162
root/etc/ly/config.ini Normal file
View File

@ -0,0 +1,162 @@
# The active animation
# none -> Nothing (default)
# doom -> PSX DOOM fire
# matrix -> CMatrix
animation = matrix
# Format string for clock in top right corner (see strftime specification). Example: %c
clock = null
# Enable/disable big clock
bigclock = false
# The character used to mask the password
asterisk = *
# Erase password input on failure
clear_password = true
# Enable vi keybindings
vi_mode = false
# The `fg` and `bg` color settings take a digit 0-8 corresponding to:
#define TB_DEFAULT 0x00
#define TB_BLACK 0x01
#define TB_RED 0x02
#define TB_GREEN 0x03
#define TB_YELLOW 0x04
#define TB_BLUE 0x05
#define TB_MAGENTA 0x06
#define TB_CYAN 0x07
#define TB_WHITE 0x08
#
# Setting both to zero makes `bg` black and `fg` white. To set the actual color palette you are encouraged to use another tool
# such as [mkinitcpio-colors](https://github.com/evanpurkhiser/mkinitcpio-colors). Note that the color palette defined with
# `mkinitcpio-colors` takes 16 colors (0-15), only values 0-8 are valid for `ly` config and these values do not correspond
# exactly. For instance, in defining palettes with `mkinitcpio-colors` the order is black, dark red, dark green, brown, dark
# blue, dark purple, dark cyan, light gray, dark gray, bright red, bright green, yellow, bright blue, bright purple, bright
# cyan, and white, indexed in that order 0 through 15. For example, the color defined for white (indexed at 15 in the mkinitcpio
# config) will be used by `ly` for `fg = 8`.
# Background color id
bg = 0
# Foreground color id
fg = 8
# Border color
border_fg = 8
# Title to show at the top of the main box
box_title = null
# Initial text to show on the info line (Defaults to hostname)
initial_info_text = null
# Blank main box background
# Setting to false will make it transparent
blank_box = true
# Remove main box borders
hide_borders = true
# Main box margins
margin_box_h = 2
margin_box_v = 1
# Input boxes length
input_len = 34
# Max input sizes
max_desktop_len = 100
max_login_len = 255
max_password_len = 255
# Input box active by default on startup
# Available inputs: session, login, password
default_input = password
# Load the saved desktop and username
load = true
# Save the current desktop and login as defaults
save = true
# Deprecated - Will be removed in a future version
# New save files are now loaded from the same directory as the config
# Currently used to migrate old save files to the new version
# File in which to save and load the default desktop and login
save_file = /etc/ly/save
# Remove power management command hints
hide_key_hints = true
# Specifies the key used for shutdown (F1-F12)
shutdown_key = F1
# Specifies the key used for restart (F1-F12)
restart_key = F2
# Specifies the key used for sleep (F1-F12)
sleep_key = F3
# Command executed when pressing shutdown_key
shutdown_cmd = /sbin/shutdown -a now
# Command executed when pressing restart_key
restart_cmd = /sbin/shutdown -r now
# Command executed when pressing sleep key (can be null)
sleep_cmd = /sbin/systemctl suspend
# Active language
# Available languages are found in /etc/ly/lang/
lang = en
# TTY in use
tty = 2
# Console path
console_dev = /dev/console
# Default path. If null, ly doesn't set a path.
path = /sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin
# Event timeout in milliseconds
min_refresh_delta = 5
# Set numlock on/off at startup
numlock = true
# Service name (set to ly to use the provided pam config file)
service_name = ly
# Terminal reset command (tput is faster)
term_reset_cmd = /usr/bin/tput reset
# Terminal restore cursor command
term_restore_cursor_cmd = /usr/bin/tput cnorm
# Cookie generator
mcookie_cmd = /usr/bin/mcookie
# Wayland setup command
wayland_cmd = /etc/ly/wsetup.sh
# Wayland desktop environments
waylandsessions = /usr/share/wayland-sessions
# xinitrc (hidden if null)
xinitrc = ~/.xinitrc
# Xorg server command
x_cmd = /usr/bin/X
# Xorg setup command
x_cmd_setup = /etc/ly/xsetup.sh
# Xorg xauthority edition tool
xauth_cmd = /usr/bin/xauth
# Xorg desktop environments
xsessions = /usr/share/xsessions

98
root/etc/pacman.conf Normal file
View File

@ -0,0 +1,98 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
HookDir = /etc/pacman.d/hooks/
#HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
ILoveCandy
#UseSyslog
Color
#NoProgressBar
CheckSpace
#VerbosePkgLists
ParallelDownloads = 5
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required
# NOTE: You must run `pacman-key --init` before first using pacman; the local
# keyring can then be populated with the keys of all official Arch Linux
# packagers with `pacman-key --populate archlinux`.
#
# REPOSITORIES
# - can be defined here or included from another file
# - pacman will search repositories in the order defined here
# - local/custom mirrors can be added here or in separate files
# - repositories listed first will take precedence when packages
# have identical names, regardless of version number
# - URLs will have $repo replaced by the name of the current repo
# - URLs will have $arch replaced by the name of the architecture
#
# Repository entries are of the format:
# [repo-name]
# Server = ServerName
# Include = IncludePath
#
# The header [repo-name] is crucial - it must be present and
# uncommented to enable the repo.
#
# The testing repositories are disabled by default. To enable, uncomment the
# repo name header and Include lines. You can add preferred servers immediately
# after the header, and they will be used before the default mirrors.
#[core-testing]
#Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
#[extra-testing]
#Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
# If you want to run 32 bit applications on your x86_64 system,
# enable the multilib repositories as required here.
#[multilib-testing]
#Include = /etc/pacman.d/mirrorlist
[multilib]
Include = /etc/pacman.d/mirrorlist
# An example of a custom package repository. See the pacman manpage for
# tips on creating your own repositories.
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs

View File

@ -0,0 +1,10 @@
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = *
[Action]
Description = "Updating statusbar..."
When = PostTransaction
Exec = /bin/sh -c 'kill -42 "$(pidof dwmblocks)"'

View File

@ -0,0 +1,10 @@
[Trigger]
Operation = Install
Operation = Upgrade
Type = Package
Target = grub
[Action]
Description = "Updating GRUB..."
Depends = grub
When = PostTransaction
Exec = /bin/sh -c 'grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB && grub-mkconfig -o /boot/grub/grub.cfg'

View File

@ -0,0 +1,8 @@
# allow wheel users to run power commands with no passwd
%wheel ALL=(ALL:ALL) NOPASSWD: /bin/systemctl suspend
%wheel ALL=(ALL:ALL) NOPASSWD: /bin/systemctl hibernate
%wheel ALL=(ALL:ALL) NOPASSWD: /bin/systemctl hybrid-sleep
%wheel ALL=(ALL:ALL) NOPASSWD: /bin/systemctl poweroff
%wheel ALL=(ALL:ALL) NOPASSWD: /bin/systemctl reboot
%wheel ALL=(ALL:ALL) NOPASSWD: /bin/shutdown
%wheel ALL=(ALL:ALL) NOPASSWD: /bin/reboot

View File

@ -0,0 +1,49 @@
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the logind.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
#
# See logind.conf(5) for details.
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#UserStopDelaySec=10
HandlePowerKey=suspend
HandlePowerKeyLongPress=hibernate
#HandleRebootKey=reboot
#HandleRebootKeyLongPress=poweroff
#HandleSuspendKey=suspend
#HandleSuspendKeyLongPress=hibernate
#HandleHibernateKey=hibernate
#HandleHibernateKeyLongPress=ignore
HandleLidSwitch=suspend
HandleLidSwitchExternalPower=ignore
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#RebootKeyIgnoreInhibited=no
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RuntimeDirectoryInodesMax=
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
#StopIdleSessionSec=infinity

View File

@ -0,0 +1 @@
ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}=="0", ATTR{authorized}="1"

View File

@ -0,0 +1,2 @@
ACTION=="add", SUBSYSTEM=="thunderbolt", ATTR{authorized}="1", RUN+="/usr/bin/autorandr --batch -c"
ACTION=="remove", SUBSYSTEM=="thunderbolt", ATTR{authorized}="1", RUN+="/usr/bin/autorandr --batch -c"

1
source-software/yay Submodule

@ -0,0 +1 @@
Subproject commit 4abc0938416a57cbd9974864caff28b4b7c3415a

10
user/.config/lf/cleaner Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
#!/usr/bin/env sh
cat <<EOF | paste -sd '' >"$LF_UEBERZUG_TEMPDIR/fifo"
{
"action": "remove",
"identifier": "lf-preview"
}
EOF

160
user/.config/lf/icons Executable file
View File

@ -0,0 +1,160 @@
tw 
st 
ow 
dt 
di 
fi 
ln 
or 
ex 
*.c 
*.cc 
*.clj 
*.coffee 
*.cpp 
*.css 
*.d 
*.dart 
*.erl 
*.exs 
*.fs 
*.go 
*.h 
*.hh 
*.hpp 
*.hs 
*.html 
*.java 
*.jl 
*.js 
*.json 
*.lua 
*.md 
*.php 
*.pl 
*.pro 
*.py 
*.rb 
*.rs 
*.scala 
*.ts 
*.vim 
*.cmd 
*.ps1 
*.sh 
*.bash 
*.zsh 
*.fish 
*.tar 
*.tgz 
*.arc 
*.arj 
*.taz 
*.lha 
*.lz4 
*.lzh 
*.lzma 
*.tlz 
*.txz 
*.tzo 
*.t7z 
*.zip 
*.z 
*.dz 
*.gz 
*.lrz 
*.lz 
*.lzo 
*.xz 
*.zst 
*.tzst 
*.bz2 
*.bz 
*.tbz 
*.tbz2 
*.tz 
*.deb 
*.rpm 
*.jar 
*.war 
*.ear 
*.sar 
*.rar 
*.alz 
*.ace 
*.zoo 
*.cpio 
*.7z 
*.rz 
*.cab 
*.wim 
*.swm 
*.dwm 
*.esd 
*.jpg 
*.jpeg 
*.mjpg 
*.mjpeg 
*.gif 
*.bmp 
*.pbm 
*.pgm 
*.ppm 
*.tga 
*.xbm 
*.xpm 
*.tif 
*.tiff 
*.png 
*.svg 
*.svgz 
*.mng 
*.pcx 
*.mov 
*.mpg 
*.mpeg 
*.m2v 
*.mkv 
*.webm 
*.ogm 
*.mp4 
*.m4v 
*.mp4v 
*.vob 
*.qt 
*.nuv 
*.wmv 
*.asf 
*.rm 
*.rmvb 
*.flc 
*.avi 
*.fli 
*.flv 
*.gl 
*.dl 
*.xcf 
*.xwd 
*.yuv 
*.cgm 
*.emf 
*.ogv 
*.ogx 
*.aac 
*.au 
*.flac 
*.m4a 
*.mid 
*.midi 
*.mka 
*.mp3 
*.mpc 
*.ogg 
*.ra 
*.wav 
*.oga 
*.opus 
*.spx 
*.xspf 
*.pdf 
*.nix 

20
user/.config/lf/lfrc Executable file
View File

@ -0,0 +1,20 @@
set scrolloff 8
set icons
set hidden
set autoquit
set ratios 1:1
set cleaner "~/.config/lf/cleaner"
set previewer "~/.config/lf/previewer"
cmd quit-and-cd &{{
pwd > $LF_CD_FILE
lf -remote "send $id quit"
}}
cmd mkdir $mkdir -p "$(echo $* | tr ' ' '\ ')"
map D delete
map q quit-and-cd
map Y $printf "%s" "$fx" | xclip -selection clipboard

45
user/.config/lf/previewer Executable file
View File

@ -0,0 +1,45 @@
#!/bin/sh
#!/usr/bin/env sh
preview() {
cat <<-EOF | paste -sd '' >"$LF_UEBERZUG_TEMPDIR/fifo"
{
"action": "add", "identifier": "lf-preview",
"path": "$1", "x": $4, "y": $5, "width": $2, "height": $3,
"scaler": "contain"
}
EOF
}
file="$1"; shift
case "$(basename "$file" | tr '[:upper:]' '[:lower:]')" in
*.tar*) tar tf "$file" ;;
*.zip) unzip -l "$file" ;;
*.rar) unrar l "$file" ;;
*.7z) 7z l "$file" ;;
*.avi|*.mp4|*.mkv)
thumbnail="$LF_UEBERZUG_TEMPDIR/thumbnail.png"
ffmpeg -y -i "$file" -vframes 1 "$thumbnail"
preview "$thumbnail" "$@"
;;
*.pdf)
thumbnail="$LF_UEBERZUG_TEMPDIR/thumbnail.png"
gs -o "$thumbnail" -sDEVICE=pngalpha -dLastPage=1 "$file" >/dev/null
preview "$thumbnail" "$@"
;;
*.jpg|*.jpeg|*.png|*.bmp)
preview "$file" "$@" ;;
*.svg)
thumbnail="$LF_UEBERZUG_TEMPDIR/thumbnail.png"
gm convert "$file" "$thumbnail"
preview "$thumbnail" "$@"
;;
*.gif)
thumbnail="$LF_UEBERZUG_TEMPDIR/thumbnail.png"
gm convert "$file[0]" "$thumbnail"
preview "$thumbnail" "$@"
;;
*) cat "$file" ;;
esac
return 127 # nonzero retcode required for lf previews to reload

View File

@ -0,0 +1 @@
require("user.init")

View File

@ -0,0 +1,10 @@
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "email-list.md",
callback = function ()
local infile = vim.fn.expand('%:p')
local outfile = os.getenv("HOME") .. '/docs/notes/harc/emails/raw-list.md'
local command = string.format("grep -o '[^ ^ ]*@[^ ^ ]*' %s > %s", infile, outfile)
os.execute(command)
end,
})

View File

@ -0,0 +1 @@
require("priv.autocmd")

View File

@ -0,0 +1,7 @@
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "logind.conf",
callback = function ()
local command = string.format('sudo -A cp -f %s %s', vim.fn.expand('%:p'), "/etc/systemd/logind.conf")
os.execute(command)
end,
})

View File

@ -0,0 +1,40 @@
local opts = { noremap = true, silent = true }
local term_opts = { silent = true }
-- Function to check if the buffer is saved
local function is_buffer_saved()
return vim.api.nvim_buf_get_option(0, 'modified') == false
end
-- Function to prompt user to save buffer
local function save_buffer_prompt()
if not is_buffer_saved() then
local save_choice = vim.fn.confirm('Buffer is not saved. Save it?', '&Yes\n&No', 1)
if save_choice == 1 then
vim.cmd('w')
else
return
end
end
end
-- Keybinding function
function run_md_export()
save_buffer_prompt()
-- vim.api.nvim_exec2("TermExec direction=float cmd=\"md-export " .. vim.fn.expand('%:p') .. "\"" , true)
end
-- MD keybinds
vim.api.nvim_create_autocmd("FileType", {
pattern = { "vimwiki", "markdown"},
callback = function ()
vim.api.nvim_buf_set_keymap(0, "n", "<leader>mp", ":MarkdownPreview<cr>", opts) -- Preview
vim.api.nvim_buf_set_keymap(0, "n", "<leader>mgl", ":VimwikiGenerateLinks<cr>", opts) -- Generate VimWiki Links
vim.api.nvim_buf_set_keymap(0, "n", "<leader>toc", ":VimwikiTOC<cr>", opts) -- Generate TOC
vim.api.nvim_buf_set_keymap(0, "n", "<leader>mtc", ":VimwikiTOC<cr>", opts) -- Generate TOC
vim.api.nvim_buf_set_keymap(0, "n", "<leader>mdc", ":TermExec direction=float cmd=\"md2src " .. vim.fn.expand('%:p') .. "\"<cr>", opts ) -- Compile Markdown File to code using md2src
-- vim.api.nvim_buf_set_keymap(0, "n", '<Leader>mde', ':lua run_md_export()<CR>', opts )
end
})

View File

@ -0,0 +1,5 @@
require("user.plugins.packer")
require("user.options")
require("user.keys")
require("user.autocmd")
require("user.filetypes.md.keys")

View File

@ -0,0 +1,84 @@
local opts = { noremap = true, silent = true }
local term_opts = { silent = true }
--Remap space as leader key
vim.api.nvim_set_keymap("", "<Space>", "<Nop>", opts)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- Modes
-- normal_mode = "n",
-- insert_mode = "i",
-- visual_mode = "v",
-- visual_block_mode = "x",
-- term_mode = "t",
-- command_mode = "c",
-- Normal --
vim.api.nvim_set_keymap("n", "<leader>ws", ":w|source<cr>", opts)
-- Better window navigation
vim.api.nvim_set_keymap("n", "<C-h>", "<C-w>h", opts)
vim.api.nvim_set_keymap("n", "<C-j>", "<C-w>j", opts)
vim.api.nvim_set_keymap("n", "<C-k>", "<C-w>k", opts)
vim.api.nvim_set_keymap("n", "<C-l>", "<C-w>l", opts)
-- NvimTree Focus
vim.api.nvim_set_keymap("n", "<leader>ft", ":NvimTreeFocus<cr>", opts)
-- Telescope
vim.api.nvim_set_keymap("n", "<leader>fr", ":Telescope oldfiles<cr>", opts)
vim.api.nvim_set_keymap("n", "<leader>ff", ":Telescope find_files<cr>", opts)
vim.api.nvim_set_keymap('n', '<leader>fn', [[:lua require('telescope.builtin').find_files({ cwd = '~/docs/notes' })<CR>]], opts)
vim.api.nvim_set_keymap("n", "<leader>sh", ":Telescope help_tags<cr>", opts)
vim.api.nvim_set_keymap("n", "<leader>sf", ":Telescope filetypes<cr>", opts)
-- Better buffer navigation
local function is_nvimtree_open()
for _, winid in ipairs(vim.api.nvim_list_wins()) do
local bufnr = vim.fn.winbufnr(winid)
local filetype = vim.bo[bufnr].filetype
if filetype == 'NvimTree' then
return true
end
end
return false
end
function close_or_exit()
local ls_output = vim.fn.execute(":ls")
local open_buffers_count = vim.fn.len(vim.fn.split(ls_output, '\n'))
if vim.bo.filetype == "NvimTree" then
require("nvim-tree.api").tree.close()
elseif vim.fn.winnr('$') == 2 and is_nvimtree_open() then
if open_buffers_count > 1 then
vim.cmd('bnext | bdelete! #')
else
vim.cmd('qall!')
end
elseif vim.fn.winnr('$') > 1 then
vim.cmd(':q!')
elseif open_buffers_count > 1 then
vim.cmd('bdelete!')
else
vim.cmd('qall!')
end
end
vim.api.nvim_set_keymap("n", "ZZ", ":w|lua close_or_exit()<CR>", opts)
vim.api.nvim_set_keymap("n", "ZQ", ":lua close_or_exit()<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>bj", ":BufferLineCycleNext<cr>", opts)
vim.api.nvim_set_keymap("n", "<leader>bk", ":BufferLineCyclePrev<cr>", opts)
vim.api.nvim_set_keymap("n", "<leader>bf", ":Telescope buffers<cr>", opts)
vim.api.nvim_set_keymap("n", "<leader>bp", ":BufferLinePick<cr>", opts)
for dig = 1, 9 do
vim.api.nvim_set_keymap("n", "<leader>" .. dig , ":BufferLineGoToBuffer " .. dig .. "<cr>", opts)
end
vim.api.nvim_set_keymap("n", "<leader>0", ":BufferLineGoToBuffer 10<cr>", opts)

View File

@ -0,0 +1,26 @@
vim.opt.clipboard = 'unnamedplus' -- Use system clipboard
vim.opt.number = true -- Have curent line show line number
vim.opt.relativenumber = true -- Show relative line numbers
vim.opt.hlsearch = false -- Disable highlight on searched strings
vim.opt.ignorecase = true -- Ignore case in searches
vim.opt.mouse = '' -- Set mouse behaviour (disabled)
vim.opt.scrolloff = 8 -- Prevent cursor from top and bottom edges - better readability
vim.opt.sidescrolloff = 8 -- Prevent cursor from side edges - better readability
vim.opt.cursorline = true -- Highlught line which cursor is on
vim.opt.splitbelow = true -- force all horizontal splits to go below current window
vim.opt.splitright = true -- force all vertical splits to go to the right of current window
vim.opt.expandtab = false -- convert tabs to spaces
vim.opt.shiftwidth = 2 -- the number of spaces inserted for each indentation
vim.opt.tabstop = 2 -- insert 2 spaces for a tab
vim.opt.swapfile = false -- keep track of open buffers, ocassionally casuses issues
vim.opt.undofile = true -- save undo hist on nvim exit
-- Disable New Line Comment
vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
vim.opt.formatoptions:remove { "c", "r", "o" }
end
})
vim.opt.termguicolors = true

View File

@ -0,0 +1,35 @@
require('bufferline').setup {
options = {
mode = "buffers",
themeable = true,
right_mouse_command = nil,
left_mouse_command = nil,
middle_mouse_command = nil,
indicator = {
-- icon = 'lala',
style = 'icon',
},
show_buffer_icons = true,
show_buffer_close_icons = false,
-- show_close_icon = false,
-- show_tab_indicators = true | false,
-- show_duplicate_prefix = true | false, -- whether to show duplicate buffer prefix
offsets = {
{
filetype = "NvimTree",
-- text = function() return vim.fn.getcwd() end,
text = "File Explorer",
text_align = "center",
highlight = "Directory",
separator = true,
},
},
separator_style = 'slant' -- "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
},
highlights = {
tab = {
-- fg = '<colour-value-here>',
-- bg = 'lualine_c_normal',
},
}
}

View File

@ -0,0 +1 @@
vim.g.calendar_no_mappings = 1 -- Disable default (bad) mappings

View File

@ -0,0 +1,122 @@
function custom_footer(command, max_chars, max_lines)
local handle, result = io.popen(command), {}
for _ = 1, 3 do table.insert(result, "") end
for line in handle:lines() do
line = string.gsub(line, "\t", "")
while #line > max_chars do
local chunk, i = string.sub(line, 1, max_chars), max_chars
while i > 0 and string.sub(chunk, i, i) ~= " " do i = i - 1 end
if i > 0 then chunk = string.sub(chunk, 1, i) end
chunk = string.gsub(chunk, "^%s*(.-)%s*$", "%1")
table.insert(result, chunk)
line = string.sub(line, i + 1)
end
table.insert(result, line)
if #result > max_lines then handle:close(); return custom_footer(command, max_chars, max_lines) end
end
handle:close()
return result
end
require('dashboard').setup {
theme = 'doom',
-- disable_move, -- default is false disable move keymap for hyper
-- shortcut_type, -- shorcut type 'letter' or 'number'
-- change_to_vcs_root, -- default is false,for open file in hyper mru. it will change to the root of vcs
config = {
header = {
'',
'',
'',
'',
'',
' ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗',
' ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║',
' ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║',
' ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║',
' ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║',
' ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝',
'',
'',
'',
},
center = {
{
icon = '󰋚 ',
desc = 'Recent Files ',
key = 'r',
keymap = 'SPC f r',
action = ':Telescope oldfiles'
},
{
icon = '󰝒 ',
desc = 'New File ',
key = 'n',
keymap = 'NONE',
action = ':enew'
},
{
icon = '󰍉 ',
desc = 'Find Files ',
key = 'f',
keymap = 'SPC f f',
action = ':Telescope find_files'
},
{
icon = '󰍉 ',
desc = 'File Tree ',
key = 't',
keymap = 'SPC f t',
action = ':NvimTreeFocus'
},
{
icon = '󰠮 ',
desc = 'Open Vimwiki ',
key = 'w',
keymap = 'SPC w w',
action = ':VimwikiIndex'
},
{
icon = '󰺿 ',
desc = 'Open Daily Note ',
key = 'd',
keymap = 'SPC w SPC w',
action = ':VimwikiMakeDiaryNote'
},
{
icon = '󰃭 ',
desc = 'Open Calendar ',
key = 'c',
keymap = 'SPC c a l',
action = ':CalendarT'
},
{
icon = '󰚰 ',
desc = 'Update Plugins',
key = 'u',
keymap = 'NONE',
action = ':PackerSync'
},
{
icon = '󰋗 ',
desc = 'Help Pages',
key = 'h',
keymap = 'SPC s h',
action = ':Telescope help_tags'
},
},
footer = custom_footer("fortune", 50, 8)
},
-- hide = {
-- statusline, -- hide statusline default is true
-- tabline, -- hide the tabline
-- winbar, -- hide winbar
-- },
-- preview = {
-- command, -- preview command
-- file_path, -- preview file path
-- file_height, -- preview file height
-- file_width, -- preview file width
-- }
}

View File

@ -0,0 +1,24 @@
require("gruvbox").setup({
undercurl = true,
underline = true,
bold = true,
italic = {
strings = false,
comments = false,
operators = false,
folds = true,
},
strikethrough = true,
invert_selection = false,
invert_signs = false,
invert_tabline = false,
invert_intend_guides = false,
inverse = true, -- invert background for search, diffs, statuslines and errors
contrast = "hard", -- can be "hard", "soft" or empty string
palette_overrides = {},
overrides = {},
dim_inactive = false,
transparent_mode = true,
})
vim.cmd "colorscheme gruvbox"

View File

@ -0,0 +1,40 @@
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'filetype'}, --fileformat
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}

View File

@ -0,0 +1,10 @@
vim.g.mkdp_filetypes = { 'markdown' }
-- TODO lua rewrite
vim.cmd[[
function OpenFF (url)
execute "silent ! firefox -P nvim-mdp " . a:url . "&"
endfunction
]]
vim.g.mkdp_browserfunc = 'OpenFF'

View File

@ -0,0 +1,240 @@
-- Disable Default Nvim file browser - it suck ngl
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- Load Plugin
require("nvim-tree").setup {
auto_reload_on_write = true,
disable_netrw = true,
hijack_cursor = true,
hijack_netrw = true,
hijack_unnamed_buffer_when_opening = false,
sort = {
sorter = "name",
folders_first = true,
},
root_dirs = {},
prefer_startup_root = false,
sync_root_with_cwd = false,
reload_on_bufenter = false,
respect_buf_cwd = false,
on_attach = "default",
select_prompts = false,
view = {
centralize_selection = false,
cursorline = true,
debounce_delay = 15,
width = 30,
side = "left",
preserve_window_proportions = false,
number = false,
relativenumber = false,
signcolumn = "yes",
float = {
enable = false,
quit_on_focus_loss = true,
open_win_config = {
relative = "editor",
border = "rounded",
width = 35,
height = 30,
row = 1,
col = 1,
},
},
},
renderer = {
add_trailing = false,
group_empty = false,
highlight_git = false,
full_name = false,
highlight_opened_files = "none",
highlight_modified = "none",
root_folder_label = ":~:s?$?/..?",
indent_width = 2,
indent_markers = {
enable = true,
inline_arrows = true,
icons = {
corner = "",
edge = "",
item = "",
bottom = "",
none = " ",
},
},
icons = {
webdev_colors = true,
git_placement = "before",
modified_placement = "after",
padding = " ",
symlink_arrow = "",
show = {
file = true,
folder = true,
folder_arrow = true,
git = true,
modified = true,
},
glyphs = {
default = "",
symlink = "",
bookmark = "󰆤",
modified = "",
folder = {
arrow_closed = "",
arrow_open = "",
default = "",
open = "",
empty = "",
empty_open = "",
symlink = "",
symlink_open = "",
},
git = {
unstaged = "",
staged = "",
unmerged = "",
renamed = "",
untracked = "",
deleted = "",
ignored = "",
},
},
},
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
symlink_destination = true,
},
hijack_directories = {
enable = true,
auto_open = false,
},
update_focused_file = {
enable = true,
update_root = false,
ignore_list = {},
},
system_open = {
cmd = "xdg-open",
args = {},
},
diagnostics = {
enable = false,
show_on_dirs = false,
show_on_open_dirs = true,
debounce_delay = 50,
severity = {
min = vim.diagnostic.severity.HINT,
max = vim.diagnostic.severity.ERROR,
},
icons = {
hint = "",
info = "",
warning = "",
error = "",
},
},
filters = {
git_ignored = false,
dotfiles = false,
git_clean = false,
no_buffer = false,
custom = {},
exclude = {},
},
filesystem_watchers = {
enable = true,
debounce_delay = 50,
ignore_dirs = {},
},
git = {
enable = true,
show_on_dirs = true,
show_on_open_dirs = true,
disable_for_dirs = {},
timeout = 400,
},
modified = {
enable = false,
show_on_dirs = true,
show_on_open_dirs = true,
},
actions = {
use_system_clipboard = true,
change_dir = {
enable = true,
global = false,
restrict_above_cwd = false,
},
expand_all = {
max_folder_discovery = 300,
exclude = {},
iii},
file_popup = {
open_win_config = {
col = 1,
row = 1,
relative = "cursor",
border = "shadow",
style = "minimal",
},
},
open_file = {
quit_on_open = false,
eject = true,
resize_window = true,
window_picker = {
enable = true,
picker = "default",
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
exclude = {
filetype = { "notify", "packer", "qf", "diff", "fugitive", "fugitiveblame" },
buftype = { "nofile", "terminal", "help" },
},
},
},
remove_file = {
close_window = true,
},
},
trash = {
cmd = "gio trash",
},
live_filter = {
prefix = "[FILTER]: ",
always_show_folders = true,
},
tab = {
sync = {
open = true,
close = true,
ignore = {},
},
},
notify = {
threshold = vim.log.levels.INFO,
absolute_path = true,
},
ui = {
confirm = {
remove = true,
trash = true,
},
},
experimental = {},
log = {
enable = false,
truncate = false,
types = {
all = false,
config = false,
copy_paste = false,
dev = false,
diagnostics = false,
git = false,
profile = false,
watcher = false,
},
},
}

View File

@ -0,0 +1,138 @@
-- Auto install packer
local ensure_packer = function()
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
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
-- Autocommand that reloads neovim whenever you save the plugins.lua file
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "packer.lua",
command = "source <afile> | PackerSync",
group = vim.api.nvim_create_augroup("packer_user_config", {clear = true})
})
-- Use a protected call so we don't error out on first use
local status_ok, packer = pcall(require, 'packer')
if not status_ok then
return
end
-- Have packer use a popup window
packer.init({
git = { clone_timeout = -1 },
display = {
open_fn = function()
return require('packer.util').float({ border = 'single' })
end
}
})
return require('packer').startup(function(use)
use 'https://github.com/wbthomason/packer.nvim'
use { 'https://github.com/ellisonleao/gruvbox.nvim',
config = function() require('user.plugins.gruvbox') end
}
use { 'https://github.com/nvim-treesitter/nvim-treesitter',
config = function() end
}
use { 'https://github.com/kylechui/nvim-surround',
tag = '*',
config = function () require("nvim-surround").setup() end
}
use { 'https://github.com/norcalli/nvim-colorizer.lua',
config = function()
require 'colorizer'.setup{
'*';
'!dashboard';
'!gcode';
'!ngc';
}
end
}
use { 'https://github.com/terrortylor/nvim-comment',
config = function() require('nvim_comment').setup() end
}
use 'https://github.com/junegunn/goyo.vim'
use { 'https://github.com/vimwiki/vimwiki',
config = function() require('user.plugins.vimwiki') end
}
use { 'https://github.com/nvim-tree/nvim-tree.lua',
config = function() require('user.plugins.nvim-tree') end,
requires = {'https://github.com/nvim-tree/nvim-web-devicons'}
}
use { 'https://github.com/iamcco/markdown-preview.nvim',
run = function() vim.fn['mkdp#util#install']() end,
setup = function() require('user.plugins.markdown-preview') end,
ft = { 'markdown' },
}
use {
'https://github.com/windwp/nvim-autopairs',
config = function() require("nvim-autopairs").setup {} end
}
use { 'https://github.com/nvimdev/dashboard-nvim',
config = function() require('user.plugins.dash') end,
requires = {'https://github.com/nvim-tree/nvim-web-devicons'}
}
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build' }
use { 'https://github.com/nvim-telescope/telescope.nvim',
requires = { 'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/BurntSushi/ripgrep',
},
config = function () require('user.plugins.telescope') end
}
use {
'https://github.com/akinsho/toggleterm.nvim',
tag = '*',
config = function () require("user.plugins.toggleterm") end
}
use { 'https://git.jakubb.xyz/jakub/vim-nc' }
use { 'https://github.com/nvim-lualine/lualine.nvim',
config = function() require("user.plugins.lualine") end,
requires = { 'nvim-tree/nvim-web-devicons' }
}
use { 'https://github.com/mattn/calendar-vim',
config = function() require("user.plugins.calendar") end,
}
use { 'https://github.com/akinsho/bufferline.nvim',
-- tag = "*",
config = function()
require("user.plugins.buf-line")
vim.cmd "colorscheme gruvbox"
end,
requires = 'nvim-tree/nvim-web-devicons'
}
if packer_bootstrap then
require('packer').sync()
end
end)

View File

@ -0,0 +1,33 @@
require("telescope").setup {
pickers = {
find_files = {
mappings = {
n = { ["q"] = "close", }
},
hidden = true,
file_ignore_patterns = {
-- special dirs
".git/",
-- xdg dirs
".cache", ".local/share", ".local/state",
-- bin output
"%.o", "%.a", "%.out",
-- bin docs
"%.pdf", "%doc", "%docx", "%.odt",
-- vids
"%.mkv", "%.mp4", "%.webm", "%.mov", "%.srt",
"%.m4a",
-- pics
"%.jpg", "%.png", "%.webp", "%.gif",
-- audio
"%.mp3", "%.flac",
-- archives
"%.zip",
-- fonts
"%.ttf",
-- misc
"%.torrent", "%.part", "%.dll", "%.exe", "%.pdb",
}
}
}
}

View File

@ -0,0 +1,67 @@
require("toggleterm").setup{
-- size can be a number or function which is passed the current terminal
size = function(term)
if term.direction == "horizontal" then
return 15
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end,
open_mapping = [[<c-t>]],
-- on_create = fun(t: Terminal), -- function to run when the terminal is first created
-- on_open = fun(t: Terminal), -- function to run when the terminal opens
-- on_close = fun(t: Terminal), -- function to run when the terminal closes
-- on_stdout = fun(t: Terminal, job: number, data: string[], name: string) -- callback for processing output on stdout
-- on_stderr = fun(t: Terminal, job: number, data: string[], name: string) -- callback for processing output on stderr
-- on_exit = fun(t: Terminal, job: number, exit_code: number, name: string) -- function to run when terminal process exits
shade_terminals = false,
hide_numbers = true, -- hide the number column in toggleterm buffers
autochdir = true, -- when neovim changes it current directory the terminal will change it's own when next it's opened
highlights = {
-- -- highlights which map to a highlight group name and a table of it's values
-- -- NOTE: this is only a subset of values, any group placed here will be set for the terminal window split
-- Normal = {
-- guibg = "",
-- },
-- NormalFloat = {
-- link = 'Normal'
-- },
FloatBorder = { link = "FloatBorder" },
},
-- start_in_insert = true,
-- insert_mappings = true, -- whether or not the open mapping applies in insert mode
-- terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals
-- direction = 'float',
direction = 'horizontal',
-- auto_scroll = true, -- automatically scroll to the bottom on terminal output
-- This field is only relevant if direction is set to 'float'
float_opts = {
-- The border key is *almost* the same as 'nvim_open_win'
-- see :h nvim_open_win for details on borders however
-- the 'curved' border is a custom border type
-- not natively supported but implemented in this plugin.
border = 'single',
width = 160,
height = 40,
},
}
vim.api.nvim_create_autocmd( "TermOpen", {
callback = function()
local opts = {noremap = true}
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-t><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-t><C-n>]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
end,
pattern = "term://*",
})
vim.api.nvim_create_autocmd( "BufEnter", {
pattern = "term://*",
callback = function() vim.cmd("startinsert") end
})

View File

@ -0,0 +1,47 @@
vim.g.vimwiki_list = {{
path = '~/docs/notes/',
syntax = 'markdown',
ext = '.md'
}}
vim.g.vimwiki_links_header = "Pages"
vim.g.vimwiki_links_header_level = 2
vim.g.vimwiki_links_space_char = '-'
vim.api.nvim_create_autocmd( "BufEnter", {
pattern = vim.fn.expand("~") .. "/docs/notes/diary/diary.md",
command = "VimwikiDiaryGenerateLinks"
})
vim.api.nvim_create_autocmd( "BufEnter", {
pattern = vim.fn.expand("~") .. "/docs/notes/index.md",
command = "VimwikiGenerateLinks"
})
-- Automatically asign todays date as title to todays diary entry
vim.api.nvim_create_autocmd( "BufNewFile", {
pattern = vim.fn.expand("~") .. "/docs/notes/diary/*.md",
callback = function ()
buf_name = vim.api.nvim_buf_get_name(0)
todays_note= vim.fn.expand("~") .. "/docs/notes/diary/".. os.date("%Y-%m-%d") .. ".md"
if buf_name == todays_note then
local date = vim.fn.split("# " .. os.date("%-b. %-d, %Y"), "\n")
vim.api.nvim_buf_set_lines(0, 0, 1, false, date)
end
end
})
-- Timestamp entries into todays diary entry
vim.api.nvim_create_autocmd( {"BufRead", "BufNewFile"}, {
pattern = vim.fn.expand("~") .. "/docs/notes/diary/*.md",
callback = function ()
buf_name = vim.api.nvim_buf_get_name(0)
todays_note= vim.fn.expand("~") .. "/docs/notes/diary/".. os.date("%Y-%m-%d") .. ".md"
if buf_name == todays_note then
vim.api.nvim_buf_set_lines(0, -1, -1, false, { "", "## " .. os.date("%-I:%M %p"), "" })
vim.cmd("normal! G$")
end
end
})

24
user/.local/bin/lf-run Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env zsh
cleanup() {
~/.config/lf/cleaner
kill "$UEBERZUGPID"
pkill -f "tail -f $LF_UEBERZUG_TEMPDIR/fifo"
rm -rf "$LF_UEBERZUG_TEMPDIR"
}
trap cleanup INT HUP
# Set up temporary directory.
export LF_UEBERZUG_TEMPDIR="$(mktemp -d -t lf-ueberzug-XXXXXX)"
# Launch ueberzug.
mkfifo "$LF_UEBERZUG_TEMPDIR/fifo"
tail -f "$LF_UEBERZUG_TEMPDIR/fifo" | ueberzug layer --silent &
UEBERZUGPID=$!
# Add this script's directory to PATH so that the lf config will find
# lf-ueberzug-cleaner and lf-ueberzgu-previewer. If no startup directory is
# provided, start lf in the examples directory.
export PATH="$PATH:${ZSH_ARGZERO:A:h}"
/usr/bin/lf
cleanup