summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile2
-rw-r--r--X11/xresources2
-rw-r--r--doas.conf1
-rw-r--r--nvim/lua/keymaps.lua2
-rw-r--r--nvim/lua/options.lua54
-rw-r--r--nvim/lua/plugins.lua66
-rw-r--r--python/pythonrc48
-rw-r--r--sh/aliases13
-rw-r--r--sh/profile2
-rw-r--r--vim/vimrc11
-rw-r--r--zsh/zshrc13
12 files changed, 119 insertions, 96 deletions
diff --git a/.gitignore b/.gitignore
index 2ae7b9f..dc2344b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -288,6 +288,7 @@ waybar/config-Hyprland-*
waybar/config-river-*
weechat/
whoozle.github.io/
+wireshark/
xmonad/.stack-work
xmonad/stack.yaml.lock
xmonad/xmonad.hi
diff --git a/Makefile b/Makefile
index d850e2a..28bc66e 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ DCONFS := doas.conf
all:
-install: install-zshconfigs install-shconfigs vimplug-vim vimplug-nvim
+install: install-zshconfigs install-shconfigs vimplug-vim
install-zshconfigs: $(ZCONFS)
@echo "Installing zsh conf files..."
diff --git a/X11/xresources b/X11/xresources
index d5c4550..7115b96 100644
--- a/X11/xresources
+++ b/X11/xresources
@@ -30,7 +30,7 @@ st.termname: st-256color
st.shell: /usr/bin/tmux
! The following options options can be reloaded via USR1 signal.
-!st.font: mononoki Nerd Font Mono:pixelsize=12:antialias=true:autohint=true;
+!st.font: Fira Code Nerd Font Mono:pixelsize=12:antialias=true:autohint=true;
!st.font2: Symbola:pixelsize=12:antialias=true:autohint=true;
st.borderpx: 3
! st alpha
diff --git a/doas.conf b/doas.conf
index 90ab328..d598fa1 100644
--- a/doas.conf
+++ b/doas.conf
@@ -12,6 +12,7 @@ permit nopass :wheel cmd pacman
permit nopass :wheel cmd cryptsetup
permit nopass :wheel cmd systemctl
permit setenv { EDITOR } :wheel cmd visudo args
+permit setenv { EDITOR } :wheel cmd vidoas args
permit setenv { EDITOR } :wheel cmd vimv
permit nopass keepenv zachir as zachir
diff --git a/nvim/lua/keymaps.lua b/nvim/lua/keymaps.lua
index 26037c6..4f4a489 100644
--- a/nvim/lua/keymaps.lua
+++ b/nvim/lua/keymaps.lua
@@ -11,7 +11,7 @@ vim.g.mapleader = "'"
-- Normal mode --
-----------------
--- Hint: set `:h vim.map.set()`
+-- Hint: see `:h vim.map.set()`
-- Better window navigation
vim.keymap.set('n', '<C-h>', '<C-w>h', opts)
vim.keymap.set('n', '<C-j>', '<C-w>j', opts)
diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua
index 1d4826e..ae802be 100644
--- a/nvim/lua/options.lua
+++ b/nvim/lua/options.lua
@@ -8,6 +8,8 @@ vim.opt.tabstop = 2 -- number of visual spaces per TAB
vim.opt.softtabstop = 2 -- number of spaces in tab when editing
vim.opt.shiftwidth = 2 -- insert 2 spaces on a tab
vim.opt.expandtab = true -- tabs are spaces
+vim.opt.smartindent = true
+vim.opt.smarttab = true
-- UI config
vim.opt.number = true -- show absolute number
@@ -30,3 +32,55 @@ vim.opt.undolevels = 1000 -- Number of undo levels
vim.opt.backspace = { "indent", "eol", "start" } -- Backspace behavior
vim.opt.foldmethod = "marker"
vim.opt.conceallevel = 2
+
+-- Plugins
+-- emmet
+vim.g.user_emmet_leader_key = '<C-a>'
+
+-- zig
+vim.g.zig_fmt_autosave = 1
+
+-- markdown
+vim.g.vim_markdown_folding_disabled = 1
+vim.g.vim_markdown_folding_level = 3
+vim.g.vim_markdown_toc_autofit = 1
+vim.g.vim_markdown_emphasis_multiline = 0
+vim.g.tex_conceal = ""
+vim.g.vim_markdown_math = 1
+vim.g.vim_markdown_conceal_code_blocks = 1
+vim.g.vim_markdown_fenced_languages = { 'c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini' }
+vim.g.vim_markdown_follow_anchor = 1
+vim.g.vim_markdown_math = 1
+vim.g.vim_markdown_frontmatter = 1
+vim.g.vim_markdown_toml_frontmatter = 1
+vim.g.vim_markdown_strikethrough = 1
+vim.g.vim_markdown_no_extensions_in_markdown = 1
+vim.g.vim_markdown_autowrite = 1
+vim.g.vim_markdown_auto_insert_bullets = 0
+vim.g.vim_markdown_new_list_item_indent = 0
+vim.g.vim_markdown_edit_url_in = 'tab'
+
+-- NERDTree
+vim.g.NERDTreeGitStatusUseNerdFonts = 1
+vim.g.NERDTreeGitStatusShowClean = 1
+vim.g.NERDTreeDirArrowExpandable = '>'
+vim.g.NERDTreeDirArrowCollapsible = '<'
+vim.g.NERDTreeMapToggleHidden = 'z'
+
+-- goyo
+vim.g.goyo_width = '90%'
+vim.g.goyo_height = '100%'
+
+-- limelight
+vim.g.limelight_conceal_ctermfg = 'gray'
+vim.g.limelight_conceal_guifg = 'gray'
+
+-- devicon
+vim.g.airline_powerline_fonts = 1
+vim.g.webdevicons_enable_nerdtree = 1
+
+-- vim-indent-guides
+vim.g.indent_guides_enable_on_vim_startup = 0
+
+-- vim-signify
+vim.opt.updatetime = 100
diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua
index 8056494..f90b09c 100644
--- a/nvim/lua/plugins.lua
+++ b/nvim/lua/plugins.lua
@@ -5,7 +5,7 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
- "--branch=stable", -- latest stable rtelease
+ "--branch=stable", -- latest stable release
lazypath,
})
end
@@ -33,13 +33,9 @@ require("lazy").setup({
end,
},
"tanvirtin/monokai.nvim",
- 'preservim/nerdtree',
- 'ziglang/zig.vim',
"lervag/vimtex",
'tomasiser/vim-code-dark',
'flazz/vim-colorschemes',
- 'tomasiser/vim-code-dark',
- 'flazz/vim-colorschemes',
'ZachIndigo/vim-preglow',
'axvr/org.vim',
'ziglang/zig.vim',
@@ -64,63 +60,3 @@ require("lazy").setup({
'ryanoasis/vim-devicons',
{'akinsho/toggleterm.nvim', version = "*", config = true},
})
-
---------------------
--- Plugin Options --
---------------------
-
--- emmet
-vim.g.user_emmet_leader_key='<C-a>'
-
--- zig config
-vim.g.zig_fmt_autosave = 1
-
--- latex live preview
-vim.g.livepreview_previewer = 'zathura'
-vim.g.livepreview_use_biber = 1
-vim.g.livepreview_cursorhold_recompile = 0
-
--- vim-markdown
-vim.g.vim_markdown_folding_disabled = 1
-vim.g.vim_markdown_folding_level = 3
-vim.g.vim_markdown_toc_autofit = 1
-vim.g.vim_markdown_emphasis_multiline = 0
-vim.g.tex_conceal = ""
-vim.g.vim_markdown_math = 1
-vim.g.vim_markdown_conceal_code_blocks = 1
-vim.g.vim_markdown_fenced_languages = { 'c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini' }
-vim.g.vim_markdown_follow_anchor = 1
-vim.g.vim_markdown_math = 1
-vim.g.vim_markdown_frontmatter = 1
-vim.g.vim_markdown_toml_frontmatter = 1
-vim.g.vim_markdown_strikethrough = 1
-vim.g.vim_markdown_no_extensions_in_markdown = 1
-vim.g.vim_markdown_autowrite = 1
-vim.g.vim_markdown_auto_insert_bullets = 0
-vim.g.vim_markdown_new_list_item_indent = 0
-vim.g.vim_markdown_edit_url_in = 'tab'
-
--- NERDTree config
-vim.g.NERDTreeGitStatusUseNerdFonts = 1 -- use nerd fonts
-vim.g.NERDTreeGitStatusShowClean = 1 -- default: 0
-vim.g.NERDTreeDirArrowExpandable = '>'
-vim.g.NERDTreeDirArrowCollapsible = '<'
-vim.g.NERDTreeMapToggleHidden = 'z'
-
--- Goyo config
-vim.g.goyo_width = '90%'
-vim.g.goyo_height = '100%'
-
--- limelight config
-vim.g.limelight_conceal_ctermfg = 'gray'
-vim.g.limelight_conceal_guifg = 'gray'
-
--- devicon config
-vim.g.airline_powerline_fonts = 1
-vim.g.webdevicons_enable_nerdtree = 1
-
--- vim-indent-guides config
-vim.g.indent_guides_enable_on_vim_startup = 0
-
--- vim-signify config
-vim.opt.updatetime=100
diff --git a/python/pythonrc b/python/pythonrc
index cd954b6..c7cf7d5 100644
--- a/python/pythonrc
+++ b/python/pythonrc
@@ -1,24 +1,40 @@
-def is_vanilla() -> bool:
+try:
+ import atexit
+ import os
import sys
- return not hasattr(__builtins__, '__IPYTHON__') and 'bpython' not in sys.argv[0]
+ from pathlib import Path
+ import readline
+except ImportError as e:
+ print(f"Couldn't load module. {e}")
+ sys.exit(1)
-def setup_history():
- import os
- import atexit
- import readline
- from pathlib import Path
+################
+# TAB COMPLETION #
+##################
+
+try:
+ readline.parse_and_bind("tab: complete")
+except ImportError:
+ pass
+
- if state_home := os.environ.get('XDG_STATE_HOME'):
- state_home = Path(state_home)
- else:
- state_home = Path.home() / '.local' / 'state'
+### XDG Compliant History File
+# See https://gist.github.com/viliampucik/8713b09ff7e4d984b29bfcd7804dc1f4?permalink_comment_id=4582040#gistcomment-4582040
- history: Path = state_home / 'python_history'
+# Destroy default history file writing hook (and also tab completion, which is why we manually added it above)
+if hasattr(sys, '__interactivehook__'):
+ del sys.__interactivehook__
- readline.read_history_file(str(history))
- atexit.register(readline.write_history_file, str(history))
+histfile = Path(os.getenv("XDG_CACHE_HOME", Path.home() / ".cache")) / "python_history"
+try:
+ histfile.touch(exist_ok=True)
+except FileNotFoundError: # Probably the parent directory doesn't exist
+ histfile.parent.mkdir(parents=True, exist_ok=True)
-if is_vanilla():
- setup_history()
+readline.read_history_file(histfile)
+# Don't store an obscene amount of history
+readline.set_history_length(5000)
+# Write to history file on exit
+atexit.register(readline.write_history_file, histfile)
diff --git a/sh/aliases b/sh/aliases
index 2d2aa27..a56a25c 100644
--- a/sh/aliases
+++ b/sh/aliases
@@ -21,6 +21,9 @@ case `uname -s` in
#alias ls="ls -h $COLOR_FLAGS_GNU"
alias ls="eza"
;;
+ "Darwin")
+ alias ls="eza --color"
+ ;;
esac
alias ll='ls -l'
alias lt='ls -l --total-size'
@@ -36,8 +39,14 @@ alias nv='nvim'
alias v='nvim'
## Change utils
-#alias rm='rm -i'
-alias rm='trash-put'
+case `uname -s` in
+ "OpenBSD" | "Darwin")
+ alias rm='rm -i'
+ ;;
+ "Linux")
+ alias rm='trash-put'
+ ;;
+esac
alias cp='cp -i'
alias srsync='rsync -KPUcrtvyz'
diff --git a/sh/profile b/sh/profile
index e9ca8e5..4643335 100644
--- a/sh/profile
+++ b/sh/profile
@@ -22,6 +22,8 @@ export ADB_VENDOR_KEY="$XDG_CONFIG_HOME"/android
export LESSHISTFILE=-
# Fixing Paths
+export ZPLUG_HOME="$XDG_DATA_HOME/zplug"
+export DOTNET_CLI_HOME="$XDG_DATA_HOME"/dotnet
export MBSYNCRC="$XDG_CONFIG_HOME"/isync/mbsyncrc
export ATOM_HOME="$XDG_DATA_HOME"/atom
export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc
diff --git a/vim/vimrc b/vim/vimrc
index bc048ab..01156b5 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -13,10 +13,8 @@ set directory=$XDG_STATE_HOME/vim/swap | call mkdir(&directory, 'p')
set undodir=$XDG_STATE_HOME/vim/undo | call mkdir(&undodir, 'p')
set viewdir=$XDG_STATE_HOME/vim/view | call mkdir(&viewdir, 'p')
-if !has('nvim') | set viminfofile=$XDG_STATE_HOME/vim/viminfo | endif
-
" vimplugs {{{
-call plug#begin('~/.config/nvim/plugged')
+call plug#begin('~/.config/vim/plugged')
" colorschemes {{{
Plug 'tomasiser/vim-code-dark' " codedark color scheme
Plug 'flazz/vim-colorschemes' " meta-color scheme package
@@ -52,9 +50,9 @@ Plug 'ryanoasis/vim-devicons' " dev icons for nerdtree
call plug#end()
" }}}
-" nvim options {{{
+" vim options {{{
-"" nvimrc:
+"" vimrc:
"" General
set showmatch " Highlight matching brace
@@ -80,9 +78,6 @@ set undolevels=1000 " Number of undo levels
set backspace=indent,eol,start " Backspace behaviour
filetype plugin indent on
-"" GUI Config
-set guifont=mononoki\ Nerd\ Font\ Mono:h12
-
"hi Normal guibg=NONE ctermbg=NONE
"hi NonText guibg=NONE ctermbg=NONE
"set background=dark
diff --git a/zsh/zshrc b/zsh/zshrc
index f748913..f8fdac5 100644
--- a/zsh/zshrc
+++ b/zsh/zshrc
@@ -1,8 +1,17 @@
#zmodload zsh/zprof
-if [ -d "$HOME/.zplug" ]; then
+if [ -n "$ZPLUG_HOME" ]; then
+ if [ -d "$ZPLUG_HOME" ]; then
+ export ZPLUG_INSTALLED="y"
+ source "$ZPLUG_HOME/init.zsh"
+ fi
+elif [ -d "$XDG_DATA_HOME/zplug" ]; then
+ export ZPLUG_INSTALLED="y"
+ source "$XDG_DATA_HOME/zplug/init.zsh"
+elif [ -d "$HOME/.zplug" ]; then
export ZPLUG_INSTALLED="y"
source "$HOME/.zplug/init.zsh"
fi
+[ -z "$XDG_CONFIG_HOME" ] && XDG_CONFIG_HOME="$HOME/.config"
HISTFILE="$XDG_CONFIG_HOME/zsh/hist"
SAVEHIST=1000
HISTSIZE=1000
@@ -80,6 +89,6 @@ if [ -n "$ZPLUG_INSTALLED" ]; then
fi
autoload -Uz compinit
-compinit
+compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
#zprof