initial commit

This commit is contained in:
2026-01-19 20:33:18 -05:00
commit 6c728033f2
43 changed files with 4729 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
{
config,
pkgs,
lib,
...
}: {
home.username = "synchronous";
home.homeDirectory = "/home/synchronous";
home.stateVersion = "25.11";
imports = [
./programs/programs.nix
];
home.sessionVariables = {
EDITOR = "nvim";
SHELL = "/etc/profiles/per-user/synchronous/bin/zsh"; # just zsh no longer works?
HOME = "/home/synchronous";
# XDG_CACHE_HOME = "$HOME/.cache";
DBUS_SESSION_BUS_ADDRESS = "unix:path=$XDG_RUNTIME_DIR/bus";
};
programs.home-manager.enable = true;
home.packages = with pkgs;
[
netcat
neovim
firefox
];
}
+39
View File
@@ -0,0 +1,39 @@
[colors.bright]
black = "#5c5855"
blue = "#01a0e4"
cyan = "#b5e4f4"
green = "#01a252"
magenta = "#a16a94"
red = "#db2d20"
white = "#f7f7f7"
yellow = "#fded02"
[colors.cursor]
cursor = "#a5a2a2"
text = "#090300"
[colors.normal]
black = "#090300"
blue = "#01a0e4"
cyan = "#b5e4f4"
green = "#01a252"
magenta = "#a16a94"
red = "#db2d20"
white = "#a5a2a2"
yellow = "#fded02"
[colors.primary]
background = "#0d0d0d"
foreground = "#a5a2a2"
[font]
size = 7.0
[font.normal]
family = "monospace"
style = "Regular"
[terminal]
[terminal.shell]
program = "/etc/profiles/per-user/synchronous/bin/zsh"
+11
View File
@@ -0,0 +1,11 @@
{
builtins,
lib,
...
}: {
programs.alacritty = {
enable = true;
};
programs.alacritty.settings = lib.trivial.importTOML ./alacritty.toml;
}
+154
View File
@@ -0,0 +1,154 @@
# ref: https://github.com/vimjoyer/nvim-nix-video/blob/main/home.nix
{
pkgs,
lib,
...
}: {
programs.neovim = let
toLua = str: "lua << EOF\n${str}\nEOF\n";
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
in {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraLuaConfig = ''
${builtins.readFile ./init.lua}
'';
extraPackages = with pkgs; [
lua-language-server
# rnix-lsp
xclip
wl-clipboard
ripgrep
fd
lua-language-server
rust-analyzer-unwrapped
black
nodejs_22
latexrun
tectonic
texpresso
# gh
];
plugins = with pkgs.vimPlugins; [
vim-nix
vim-airline-themes
plenary-nvim
nvim-web-devicons
texpresso-vim
# {
# plugin = smear-cursor-nvim;
# config = toLuaFile ./plugins/smear.lua;
# }
# {
# plugin = neovide;
# config = toLuaFile ./plugins/neovide.lua;
# }
# { worthless plugin don't use
# plugin = mini-animate;
# config = toLuaFile ./plugins/mini-animate.lua;
# }
{
plugin = telescope-nvim;
config = toLuaFile ./plugins/telescope.lua;
}
{
plugin = presenting-vim;
config = toLuaFile ./plugins/presenting.lua;
}
# coc-nvim
{
plugin = vimtex;
config = toLuaFile ./plugins/vimtex.lua;
}
{
plugin = goyo-vim;
config = toLuaFile ./plugins/goyo.lua;
}
{
plugin = tokyonight-nvim;
config = toLuaFile ./plugins/tokyonight.lua;
}
{
plugin = nerdcommenter;
config = toLuaFile ./plugins/nerdcommenter.lua;
}
{
plugin = nvim-tree-lua;
config = toLuaFile ./plugins/nvimtree.lua;
}
# {
# plugin = vim-airline;
# config = toLuaFile ./plugins/airline.lua;
# }
{
plugin = markdown-preview-nvim;
config = toLuaFile ./plugins/markdown-preview-nvim.lua;
}
{
plugin = barbar-nvim;
config = toLuaFile ./plugins/barbar.lua;
}
{
# the most helpful thing is this guy: https://ejmastnak.com/tutorials/vim-latex/luasnip/
plugin = luasnip;
config = toLuaFile ./plugins/luasnip.lua;
}
{
plugin = lualine-nvim;
config = toLuaFile ./plugins/lualine.lua;
}
{
plugin = nvim-treesitter.withPlugins (p: [
# p.tree-sitter-nix
# p.tree-sitter-vim
# p.tree-sitter-bash
# p.tree-sitter-lua
# p.tree-sitter-python
# p.tree-sitter-json
p.bash
p.comment
p.css
p.dockerfile
p.fish
p.gitattributes
p.gitignore
p.go
p.gomod
p.gowork
p.hcl
p.javascript
p.jq
p.json5
p.json
p.lua
p.make
p.markdown
p.nix
p.python
p.rust
p.toml
p.typescript
p.yaml
p.agda
]);
config = toLuaFile ./plugins/treesitter.lua;
}
];
# extraConfig = lib.fileContents ./init.vim;
};
# copy the snippets :#
home.activation.copySnippetsDir = lib.mkAfter ''
mkdir -p ~/.config/nvim/snippets
cp -r ${./snippets}/* ~/.config/nvim/snippets/
chmod -R u+w ~/.config/nvim/snippets/
'';
}
+198
View File
@@ -0,0 +1,198 @@
-- =========================================================
-- FILE: init.lua
-- A translation of the provided Vimscript config to Lua.
-- =========================================================
-- filetype detection / plugin / indent
vim.cmd([[
filetype on
filetype plugin on
filetype indent on
syntax on
]])
-- Basic UI
vim.opt.number = true -- set number
vim.opt.relativenumber = false -- 'set nu' in Vimscript doesn't mean relative. If you prefer relativenumber, set it to true
vim.opt.showcmd = true
vim.opt.showmode = true
vim.opt.showmatch = true -- highlights matching brackets
vim.opt.hlsearch = true
vim.opt.history = 1000
vim.opt.wrap = false
vim.opt.scrolloff = 10
vim.opt.incsearch = true
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- Tab / indentation
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.smarttab = true
vim.opt.cindent = true
vim.opt.expandtab = true
-- Turn off backups, swaps
vim.opt.backup = false
vim.opt.swapfile = false
vim.opt.undofile = true
vim.opt.undodir = os.getenv("HOME") .. "/.local/share/nvim/cache"
-- For line length column marking
vim.opt.colorcolumn = "0"
vim.opt.textwidth = 0 -- alternative if you want no fixed textwidth
-- Some other miscellaneous settings
vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages
vim.opt.wildmenu = true
vim.opt.wildmode = { "longest", "list" }
vim.opt.wildignore:append({
"*.docx", "*.jpg", "*.png", "*gif", "*.pdf", "*.pyc",
"*.exe", "*.flv", "*.img", "*.png"
})
vim.opt.termguicolors = true -- truecolor mode
vim.opt.mouse = "a" -- enable mouse
vim.opt.splitright = true
vim.opt.splitbelow = true
vim.opt.updatetime = 300 -- faster completion
vim.opt.signcolumn = "auto"
vim.opt.title = true
vim.opt.titlestring = "%F - NVIM" -- File path and "Neovim" branding
-- vim.opt.titlestring = "%(%{expand(\"%:~:h\")}%)#%(% t%)%(% M%)%(% )NVIM"
-- Append '+' register to clipboard
vim.opt.clipboard:append("unnamedplus")
-- Stop showing matching paren (and disable matchparen plugin)
vim.g.loaded_matchparen = 1
vim.opt.showmatch = false
-- t_ZH, t_ZR (italics) — for older terminal support
vim.cmd([[ let &t_ZH = "\e[3m" ]])
vim.cmd([[ let &t_ZR = "\e[23m" ]])
-- netrw settings
vim.g.netrw_banner = 0
vim.g.netrw_liststyle = 0
vim.g.netrw_browse_split = 4
vim.g.netrw_altv = 1
vim.g.netrw_winsize = 25
vim.g.netrw_keepdir = 0
vim.g.netrw_localcopydircmd = "cp -r"
-- Remember cursor location (viminfo)
vim.opt.viminfo = "'100,\"2500,:200,%,n~/.cache/.viminfo"
-- Encodings
vim.opt.fileencodings = { "utf-8" }
vim.opt.encoding = "utf-8"
-- Leader key
vim.g.mapleader = ","
vim.opt_local.conceallevel = 0
vim.opt_local.foldmethod = 'manual'
-- Keep treesitter, ditch legacy syntax:
vim.g.markdown_fenced_languages = {}
vim.opt.shell = "zsh"
vim.loader.enable()
------------------------------------------------------
-- KEY MAPPINGS
------------------------------------------------------
local opts = { noremap = true, silent = true }
-- Clear search highlights when pressing ESC in normal mode
vim.api.nvim_set_keymap("n", "<Esc>", ":noh<CR><Esc>", opts)
-- The literal mapping from the original: "nnoremap <esc>^[ <esc>^["
vim.api.nvim_set_keymap("n", "<Esc>^[", "<Esc>^[", { noremap = true })
-- inoremap {<CR> {<CR>}<C-o>O}
vim.api.nvim_set_keymap("i", "{<CR>", "{<CR>}<C-o>O", { noremap = true })
local map = vim.keymap.set
local opts = { noremap = true, silent = true }
-- yank link
map("n", "<leader>yl", "?\\](<CR>lvi)y<Cmd>nohlsearch<CR>", opts)
-- Save file with Ctrl+S
vim.cmd([[
command -nargs=0 -bar Update if &modified
\| if empty(bufname('%'))
\| browse confirm write
\| else
\| confirm write
\| endif
\|endif
]])
vim.api.nvim_set_keymap("n", "<C-S>", ":<C-u>Update<CR>", opts)
vim.api.nvim_set_keymap("i", "<C-S>", "<Esc>:Update<CR>", opts)
-- Terminal toggles
vim.api.nvim_set_keymap("n", "<C-t>", ":term<CR>A", { noremap = true, silent = false })
vim.api.nvim_set_keymap("t", "<Esc>", [[<C-\><C-n>]], { noremap = true })
-- "Focus" commands that rely on the Goyo plugin
-- vim.api.nvim_set_keymap("n", "<C-a>z", ":Goyo 80<CR>", opts)
-- vim.api.nvim_set_keymap("n", "<C-a>q", ":Goyo!<CR>", opts)
-- Movements in visual mode
vim.api.nvim_set_keymap("x", "<C-h>", "b", { noremap = true })
vim.api.nvim_set_keymap("x", "<C-l>", "w", { noremap = true })
-- Map Ctrl-Backspace to delete the previous word in insert mode
vim.api.nvim_set_keymap("i", "<C-BS>", "<C-W>", { noremap = true })
vim.api.nvim_set_keymap("i", "<C-H>", "<C-W>", { noremap = true })
-- nagiation
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>h', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>j', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-i>', '<C-w>k', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', { noremap = true, silent = true })
------------------------------------------------------
-- AUTOCMD
------------------------------------------------------
local wrapLineInTexFile = vim.api.nvim_create_augroup("WrapLineInTexFile", { clear = true })
vim.api.nvim_create_autocmd("FileType", {
pattern = { "md" },
group = wrapLineInTexFile,
command = "setlocal wrap"
})
vim.api.nvim_create_augroup("vimrc", { clear = true })
-- vim.api.nvim_create_autocmd("FileType", {
-- desc = "texpresso compile",
-- group = "vimrc",
-- pattern = "tex",
-- callback = function(args)
-- -- start server on first BufWrite
-- vim.api.nvim_create_autocmd("BufWritePost", {
-- group = vim.api.nvim_create_augroup(
-- string.format("latex<buffer=%d>", args.buf),
-- { clear = true }
-- ),
-- buffer = args.buf,
-- callback = function()
-- if not vim.b.latex_started then
-- vim.cmd "TeXpresso %"
-- vim.b.latex_started = true
-- end
-- -- vim.cmd "VimtexView"
-- end,
-- })
-- end,
-- })
-- idk why i need to define it here bro
-- local builtin = require('telescope.builtin')
-- vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
-- vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
-- vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
-- vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
+158
View File
@@ -0,0 +1,158 @@
set nocompatible
filetype on
filetype plugin on
filetype indent on
" syntax on
syntax on
" num highlighting on
set number
" tab stuff
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set nobackup
set scrolloff=10
set incsearch
set ignorecase
set filetype=on
set smartcase
set nowrap
set showcmd
set showmode
set showmatch
set hlsearch
set history=1000
set wildmenu
set wildmode=list:longest
set wildignore=*.docx,*.jpg,*.png,*gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.png
set noswapfile
set wildmode=longest,list
set cc=80
set colorcolumn=0
set t_Co=256
let s:fontsize = 12
" don't give |ins-completion-menu| messages.
set shortmess+=c
" Clear highlighting on escape in normal mode
nnoremap <esc> :noh<return><esc>
nnoremap <esc>^[ <esc>^[
" update everything, faster completion
set updatetime=300
" auto signcolumn
set signcolumn=auto
" set terminal title to vim
set title
set titlestring=%(%{expand(\"%:~:h\")}%)#%(\ %t%)%(\ %M%)%(\ %)NVIM
" Italics
let &t_ZH="\e[3m"
let &t_ZR="\e[23m"
" File browser
let g:netrw_banner=0
let g:netrw_liststyle=0
let g:netrw_browse_split=4
let g:netrw_altv=1
let g:netrw_winsize=25
let g:netrw_keepdir=0
let g:netrw_localcopydircmd='cp -r'
" Defualt Clipboard
set clipboard+=unnamedplus
" true colors, needs patched urxvt or st to work right
set termguicolors
" set mouse on
set mouse=a
" https://stackoverflow.com/questions/34675677/disable-highlight-matched-parentheses-in-vim-let-loaded-matchparen-1-not-w
let loaded_matchparen = 1
set noshowmatch
inoremap {<CR? {<CR>}<C-o>O}
set splitright
set splitbelow
" auto file wrap for certain types of files
" save file w/ ctrl+s
command -nargs=0 -bar Update if &modified
\| if empty(bufname('%'))
\| browse confirm write
\| else
\| confirm write
\| endif
\|endif
nnoremap <silent> <C-S> :<C-u>Update<CR>
inoremap <c-s> <Esc>:Update<CR>
" set relativenumber
set nu
" cursor blinkage
" set guicursor=v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait1700-blinkoff400-blinkon950-Cursor/lCursor,sm:block,n:block-blinkon0
set smarttab
set cindent
set tabstop=2
set softtabstop=2
set shiftwidth=2
" always uses spaces instead of tab characters
set expandtab
" keep undos in a file
set undofile
set undodir=~/.local/share/nvim/cache
" lines to keep cursor vertically centered
set scrolloff=10
" remember cursor location
set viminfo='100,\"2500,:200,%,n~/.cache/.viminfo
" set encodings
set fileencodings=utf-8
set encoding=utf-8
" Map Ctrl-Backspace to delete the previous word in insert mode.
imap <C-BS> <C-W>
imap <C-H> <C-W>
augroup WrapLineInTexFile
autocmd!
autocmd FileType md setlocal wrap
augroup END
" term toggle
map <C-t> :term<CR>A
" exit terminal mode mapping
tnoremap <Esc> <C-\><C-n>
" nnoremap <silent> <C-q> <C-w>s<C-w>j:resize 20<CR>:terminal<CR><S-i>
" coq leader
let mapleader = ","
" Focus commands
nnoremap <C-a>z :Goyo 80<CR>
nnoremap <C-a>q :Goyo!<CR>
" mapping control h,l to move forward and backward an entire word
" nnoremap <C-h> b
" nnoremap <C-l> w
xnoremap <C-h> b
xnoremap <C-l> w
+30
View File
@@ -0,0 +1,30 @@
-- Set airline theme
vim.g.airline_theme = 'simple'
-- Initialize airline symbols if not already defined
vim.g.airline_symbols = vim.g.airline_symbols or {}
-- Configure airline symbols
vim.g.airline_symbols.crypt = '🔒'
vim.g.airline_symbols.linenr = ''
vim.g.airline_symbols.maxlinenr = ''
vim.g.airline_symbols.paste = 'ρ'
vim.g.airline_symbols.spell = ''
vim.g.airline_symbols.notexists = 'Ɇ'
vim.g.airline_symbols.whitespace = 'Ξ'
-- Powerline symbols (requires appropriate fonts)
vim.g.airline_left_sep = ''
vim.g.airline_left_alt_sep = ''
vim.g.airline_right_sep = ''
vim.g.airline_right_alt_sep = ''
vim.g.airline_symbols.branch = ''
vim.g.airline_symbols.linenr = ''
-- Configure bufferline extension
-- vim.g.airline#extensions#tabline#enabled = 1
vim.g.airline_extensions_tabline_formatter = 'unique_tail'
-- Set global statusline
vim.opt.laststatus = 3
+76
View File
@@ -0,0 +1,76 @@
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
-- Move to previous/next
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
-- Re-order to previous/next
map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)
-- Goto buffer in position...
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
-- Pin/unpin buffer
map('n', '<A-p>', '<Cmd>BufferPin<CR>', opts)
-- Goto pinned/unpinned buffer
-- :BufferGotoPinned
-- :BufferGotoUnpinned
-- Close buffer
map('n', '<A-c>', '<Cmd>BufferClose<CR>', opts)
-- Wipeout buffer
-- :BufferWipeout
-- Close commands
-- :BufferCloseAllButCurrent
-- :BufferCloseAllButPinned
-- :BufferCloseAllButCurrentOrPinned
-- :BufferCloseBuffersLeft
-- :BufferCloseBuffersRight
-- Magic buffer-picking mode
map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
map('n', '<C-s-p>', '<Cmd>BufferPickDelete<CR>', opts)
-- Sort automatically by...
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
map('n', '<Space>bn', '<Cmd>BufferOrderByName<CR>', opts)
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
-- Other:
-- :BarbarEnable - enables barbar (enabled by default)
-- :BarbarDisable - very bad command, should never be used
vim.g.barbar_auto_setup = false -- disable auto-setup
require'barbar'.setup {
-- Enable/disable animations
animation = true,
-- Automatically hide the tabline when there are this many buffers left.
-- Set to any value >=0 to enable.
auto_hide = false,
-- Enable/disable current/total tabpages indicator (top right corner)
tabpages = true,
-- Enables/disable clickable tabs
-- - left-click: go to buffer
-- - middle-click: delete buffer
clickable = true,
}
+71
View File
@@ -0,0 +1,71 @@
local opts = { noremap = true, silent = true }
-- "Focus" commands that rely on the Goyo plugin
vim.api.nvim_set_keymap("n", "<C-a>z", ":Goyo 80<CR>", opts)
vim.api.nvim_set_keymap("n", "<C-a>q", ":Goyo!<CR>", opts)
-- https://github.com/junegunn/goyo.vim/issues/180
-- automatically resize goyo when nvim resizes
vim.api.nvim_create_autocmd("VimResized", {
callback = function()
if vim.t.goyo_master == 1 then
vim.cmd([[exe "normal \<c-w>="]])
end
end,
})
-- vim.api.nvim_create_autocmd("VimResized", {
-- callback = function()
-- if vim.fn.exists('#goyo') == 1 then
-- vim.cmd("normal <C-w>=")
-- end
-- end,
-- })
-- hide and unhide lualine when entering and leaving goyo
local lualine = require('lualine')
local grp = vim.api.nvim_create_augroup('goyo_lualine_toggle', { clear = true })
local function hide() lualine.hide{ place = {'statusline', 'winbar', 'tabline'} } end
local function unhide() lualine.hide{ place = {'statusline', 'winbar', 'tabline'}, unhide = true } end
vim.api.nvim_create_autocmd('User', {
group = grp,
pattern = 'GoyoEnter',
callback = function()
lualine.hide({ place = {'statusline', 'winbar', 'tabline'} })
end,
})
vim.api.nvim_create_autocmd('User', {
group = grp,
pattern = 'GoyoLeave',
callback = function()
lualine.hide({ place = {'statusline', 'winbar', 'tabline'}, unhide = true })
end,
})
vim.api.nvim_create_autocmd('VimEnter', {
group = grp,
once = true,
callback = function()
local w = vim.g.goyo_if
if w then
vim.schedule(hide)
end
end,
})
vim.api.nvim_create_autocmd('UIEnter', {
once = true,
group = grp,
callback = function()
local w = vim.g.goyo_if
if w then
vim.opt.showtabline = 0
vim.cmd('BarbarDisable')
end
end,
})
+67
View File
@@ -0,0 +1,67 @@
-- Bubbles config for lualine
-- Author: lokesh-krishna
-- MIT license, see LICENSE for more details.
-- stylua: ignore
-- ripped from https://lospec.com/palette-list/tokyo-night
local colors = {
blue = '#80a0ff',
cyan = '#79dac8',
black = '#080808',
white = '#c6c6c6',
red = '#ff5189',
violet = '#d183e8',
grey = '#303030',
deepblue = '#292e42',
deepcyan = '#3b4261',
deepred = '#c53b53',
lightblue = '#737aa2'
}
local bubbles_theme = {
normal = {
a = { fg = colors.black, bg = colors.lightblue },
b = { fg = colors.white, bg = colors.grey },
c = { fg = colors.white },
},
insert = { a = { fg = colors.black, bg = colors.deepblue } },
visual = { a = { fg = colors.black, bg = colors.deepred } },
replace = { a = { fg = colors.black, bg = colors.violet } },
inactive = {
a = { fg = colors.white, bg = colors.black },
b = { fg = colors.white, bg = colors.black },
c = { fg = colors.white },
},
}
require('lualine').setup {
options = {
theme = bubbles_theme,
component_separators = '',
section_separators = { left = '', right = '' },
},
sections = {
lualine_a = { { 'mode', right_padding = 1 } },
lualine_b = { 'filename', 'branch' },
lualine_c = {
'%=', --[[ add your center compoentnts here in place of this comment ]]
},
lualine_x = {},
lualine_y = { 'filetype' ,'progress' },
lualine_z = {
{ 'location', left_padding = 1 },
},
},
inactive_sections = {
lualine_a = { 'filename' },
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = {},
}
+31
View File
@@ -0,0 +1,31 @@
vim.cmd[[
" Use Tab to expand and jump through snippets
imap <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>'
smap <silent><expr> <Tab> luasnip#jumpable(1) ? '<Plug>luasnip-jump-next' : '<Tab>'
" Use Shift-Tab to jump backwards through snippets
imap <silent><expr> <S-Tab> luasnip#jumpable(-1) ? '<Plug>luasnip-jump-prev' : '<S-Tab>'
smap <silent><expr> <S-Tab> luasnip#jumpable(-1) ? '<Plug>luasnip-jump-prev' : '<S-Tab>'
" Expand or jump in insert mode
imap <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>'
" Jump forward through tabstops in visual mode
smap <silent><expr> <Tab> luasnip#jumpable(1) ? '<Plug>luasnip-jump-next' : '<Tab>'
]]
require("luasnip").config.set_config({ -- Setting LuaSnip config
-- Enable autotriggered snippets
enable_autosnippets = true,
-- Use Tab (or some other key if you prefer) to trigger visual selection
store_selection_keys = "<Tab>",
})
-- JAKENOTE, relative imports *do not work* with nixos. don't GG yourself blud.
require("luasnip.loaders.from_lua").load({
paths = vim.fn.stdpath('config') .. "/snippets/"
})
-- require("luasnip.loaders.from_lua").lazy_load({paths = "./snippets/"})
@@ -0,0 +1,4 @@
-- browser
vim.g.mkdp_browser = "firefox"
-- keybindings
vim.keymap.set("n", "<leader>m", "<plug>MarkdownPreview")
@@ -0,0 +1,19 @@
-- require('mini.animate').setup()
-- require('mini.animate').setup({
-- cursor = {
-- enable = true,
-- },
-- scroll = {
-- enable = false,
-- },
-- resize = {
-- enable = false,
-- },
-- open = {
-- enable = false,
-- },
-- close = {
-- enable = false,
-- },
-- })
@@ -0,0 +1,6 @@
vim.g.NERDSpaceDelims = 1;
vim.g.NERDAltDelims_c = 1;
-- the _ key is actually / because nvim/vim does not recognize that!
-- vmap <C-_> <plug>NERDCommenterToggle"
-- nmap <C-_> <plug>NERDCommenterToggle
+58
View File
@@ -0,0 +1,58 @@
-- buh https://gist.github.com/mrpmohiburrahman/b7ec0d47cd043d3a2ed4c10a20504d4e
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
local function my_on_attach(bufnr)
local api = require "nvim-tree.api"
local function opts(desc)
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
-- default mappings
api.config.mappings.default_on_attach(bufnr)
vim.keymap.set("n", "+", api.tree.change_root_to_node, opts "CD")
vim.keymap.set("n", "?", api.tree.toggle_help, opts "Help")
vim.keymap.set("n", "<ESC>", api.tree.close, opts "Close")
-- custom mappings
-- vim.keymap.set('n', '<C-o>', api.tree.open(), opts('Up'))
-- vim.keymap.set('n', '<C-o>', api.tree.close(), opts('Up'))
-- vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
end
vim.keymap.set("n", "<C-o>", "<cmd>NvimTreeToggle<CR>", {
desc = "Toggle NvimTree"
})
require('nvim-tree').setup()
require('nvim-tree').setup({
on_attach = my_on_attach,
sort_by = 'case_sensitive',
view = {
adaptive_size = false,
-- mappings = {
-- list = {
-- { key = 'u', action = 'dir_up' },
-- },
-- },
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
exclude = {".git", ".jpg", ".mp4", ".ogg", ".iso", ".pdf", ".odt", ".png", ".gif", ".db", ".class"},
},
actions = {
open_file = {
resize_window = false
}
},
})
@@ -0,0 +1 @@
vim.b.presenting_slide_separator = "---"
+11
View File
@@ -0,0 +1,11 @@
require('smear_cursor').setup({
scroll_buffer_space = false,
smear_between_buffers = false,
smear_between_neighbor_lines = false,
scroll_buffer_space = false,
stiffness = 0.5,
trailing_stiffness = 0.5,
matrix_pixel_threshold = 0.5,
damping = 0.9999, -- how "bouncy" the cursor is. 1 makes the cursor freeze in the top left lmao
smear_insert_mode = false,
})
+10
View File
@@ -0,0 +1,10 @@
if vim.g.goyo_if then
return
end
local builtin = require('telescope.builtin')
vim.g.mapleader = ","
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Telescope find files' })
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Telescope live grep' })
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = 'Telescope buffers' })
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = 'Telescope help tags' })
+31
View File
@@ -0,0 +1,31 @@
-- Tokyonight configuration in Lua
require("tokyonight").setup({
-- use the night style
style = "night",
-- disable italic for functions
styles = {
functions = {}
},
-- Change the "hint" color to the "orange" color, and make the "error" color bright red
on_colors = function(colors)
-- colors.hint = colors.orange
colors.bg = "#0d0d0d" -- dark af bruh
colors.fg = "#e3e1e1"
end
})
vim.cmd([[
colorscheme tokyonight
]])
-- vim.g.tokyonight_style = "day"
-- vim.g.tokyonight_italic_functions = true
-- vim.g.tokyonight_sidebars = { "qf", "vista_kind", "terminal", "packer" }
-- vim.g.tokyonight_colors = {
-- bg_dark = "#ff0000",
-- bg = "#0d0d0d",
-- fg = "#e3e1e1",
-- }
+16
View File
@@ -0,0 +1,16 @@
require('nvim-treesitter.configs').setup {
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
}
require('nvim-treesitter.configs').setup({
highlight = {
enable = true, -- keep TS for everything else
disable = { "markdown", "markdown_inline" },
additional_vim_regex_highlighting = false,
},
indent = { enable = false },
incremental_selection = { enable = false },
})
+53
View File
@@ -0,0 +1,53 @@
-- Enable filetype plugins, indent, and syntax highlighting.
vim.cmd("filetype plugin indent on")
vim.cmd("syntax enable")
-- Viewer options: either with a built-in viewer method or with a generic interface.
vim.g.vimtex_view_method = 'zathura'
vim.g.vimtex_view_general_viewer = 'zathura'
vim.g.vimtex_view_general_options = '--unique file:@pdf#src:@line@tex'
-- Set the TeX flavor and quickfix mode.
vim.g.tex_flavor = 'latex'
-- vim.g.vimtex_quickfix_mode = 0
-- vim.g.vimtex_quickfix_enabled = 0
-- Compiler backend.
-- vim.g.vimtex_compiler_method = 'latexmk'
vim.g.vimtex_quickfix_autoclose_after_keystrokes = 3
vim.g.vimtex_compiler_method = "tectonic"
vim.g.vimtex_compiler_tectonic = {
options = {
"--keep-intermediates", -- faster compile times
"--keep-logs",
"--synctex",
"-Z shell-escape",
-- "-Z deterministic-mode", -- breaks synctex
},
}
-- Set the local leader (default is "\"; here we change it to comma).
vim.g.maplocalleader = ','
-- Configure warnings to ignore.
-- vim.g.Tex_IgnoredWarnings = [[
-- Package hyperref Warning
-- Token not allowed in a PDF string (Unicode)
-- removing math shift
-- removing superscript
-- Underfull
-- Overfull
-- specifier changed to
-- You have requested
-- Missing number, treated as zero.
-- There were undefined references
-- Citation %.%# undefined
-- Double space found.
-- ]]
-- vim.g.Tex_IgnoreLevel = 8
-- Delete extra compilation files when a TeX buffer is deleted.
-- vim.api.nvim_create_autocmd("BufDelete", {
-- pattern = "*.tex",
-- command = "silent! !latexmk -c > /dev/null 2>&1 %:p",
-- })
+45
View File
@@ -0,0 +1,45 @@
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local isn = ls.indent_snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local d = ls.dynamic_node
local r = ls.restore_node
local events = require("luasnip.util.events")
local ai = require("luasnip.nodes.absolute_indexer")
local extras = require("luasnip.extras")
local l = extras.lambda
local rep = extras.rep
local p = extras.partial
local m = extras.match
local n = extras.nonempty
local dl = extras.dynamic_lambda
local fmt = require("luasnip.extras.fmt").fmt
local fmta = require("luasnip.extras.fmt").fmta
local conds = require("luasnip.extras.expand_conditions")
local postfix = require("luasnip.extras.postfix").postfix
local types = require("luasnip.util.types")
local parse = require("luasnip.util.parser").parse_snippet
local ms = ls.multi_snippet
local k = require("luasnip.nodes.key_indexer").new_key
local line_begin = require("luasnip.extras.expand_conditions").line_begin
ls.add_snippets("lua", {
s("hello", {
t('print("hello '),
i(1),
t(' world")')
}),
s("if", {
t('if '),
i(1, "true"),
t(' then '),
i(2),
t(' end')
})
})
+284
View File
@@ -0,0 +1,284 @@
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local isn = ls.indent_snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local d = ls.dynamic_node
local r = ls.restore_node
local events = require("luasnip.util.events")
local ai = require("luasnip.nodes.absolute_indexer")
local extras = require("luasnip.extras")
local l = extras.lambda
local rep = extras.rep
local p = extras.partial
local m = extras.match
local n = extras.nonempty
local dl = extras.dynamic_lambda
local fmt = require("luasnip.extras.fmt").fmt
local fmta = require("luasnip.extras.fmt").fmta
local conds = require("luasnip.extras.expand_conditions")
local postfix = require("luasnip.extras.postfix").postfix
local types = require("luasnip.util.types")
local parse = require("luasnip.util.parser").parse_snippet
local ms = ls.multi_snippet
local k = require("luasnip.nodes.key_indexer").new_key
local line_begin = require("luasnip.extras.expand_conditions").line_begin
ls.add_snippets("markdown", {
s("date", {
t("# "), f(function() return os.date("%y-%m-%d") end, {}),
t({ "", "- " }),
}),
-- s({
-- trig = [[\v(https?://(?:www\.)?([-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9()@:%_\+.~#?&//=]*))]],
-- regTrig = true,
-- wordTrig = false,
-- },
-- fmt("[{}]({})", {
-- f(function(_, snip) return snip.captures[2] end),
-- f(function(_, snip) return snip.captures[1] end),
-- })
-- ),
s({
trig = [[%f[%S](https?://([^/%s]+[^%s]*))]],
regTrig = true,
wordTrig = false,
}, fmt("[{}]({})", {
-- link text → host
f(function(_, snip) return snip.captures[2] end),
-- link target → full url
f(function(_, snip) return snip.captures[1] end),
}))
})
-- local ls = require('luasnip')
-- local fmt = require('luasnip.extras.fmt').fmt
-- local fmta = require('luasnip.extras.fmt').fmta
-- local rep = require('luasnip.extras').rep
-- local dl = require('luasnip.extras').dynamic_lambda
-- local l = require('luasnip.extras').lambda
-- local autosnippet = ls.extend_decorator.apply(s, { snippetType = 'autosnippet' })
-- -- some shorthands...
-- local s = ls.snippet
-- local n = ls.snippet_node
-- local t = ls.text_node
-- local i = ls.insert_node
-- local f = ls.function_node
-- local c = ls.choice_node
-- local d = ls.dynamic_node
-- ls.config.set_config({
-- history = true,
-- -- treesitter-hl has 100, use something higher (default is 200).
-- ext_base_prio = 200,
-- -- minimal increase in priority.
-- ext_prio_increase = 1,
-- enable_autosnippets = true,
-- store_selection_keys = '<Tab>',
-- })
-- vim.keymap.set({ 'i', 's' }, '<C-l>', function()
-- if ls.choice_active() then ls.change_choice(1) end
-- end)
-- vim.keymap.set({ 'i', 's' }, '<C-h>', function()
-- if ls.choice_active() then ls.change_choice(-1) end
-- end)
-- local function get_line_iter(str)
-- if str:sub(-1) ~= '\n' then str = str .. '\n' end
-- return str:gmatch('(.-)\n')
-- end
-- local function box_trim_lines(str)
-- local new_str = ''
-- for line in get_line_iter(str) do
-- line = line:gsub('^%s+', '')
-- line = string.gsub(line, '%s+$', '')
-- new_str = new_str .. '\n' .. line
-- end
-- return new_str
-- end
-- -- local return_filename = function()
-- -- return vim.fn.fnamemodify(vim.fn.expand('%'), ':p')
-- -- end
-- local return_filename = function()
-- -- return vim.fn.fnamemodify(vim.fn.expand('%'), ':p')
-- local filename = vim.fn.fnamemodify(vim.fn.expand('%'), ':p')
-- local home_dir = vim.fn.expand('~')
-- if filename:sub(1, #home_dir) == home_dir then filename = '~/' .. filename:sub(#home_dir + 2) end
-- return filename
-- end
-- local date = function() return { os.date('%Y-%m-%d') } end
-- local fulldate = function() return { os.date('%a, %b %Y/%m/%d - %H:%M:%S') } end
-- -- lua print(os.date("%a, %b %Y/%m/%d - %H:%M:%S"))
-- local get_visual = function(args, parent)
-- if #parent.snippet.env.SELECT_RAW > 0 then
-- return sn(nil, i(1, parent.snippet.env.SELECT_RAW))
-- else -- If SELECT_RAW is empty, return a blank insert node
-- return sn(nil, i(1))
-- end
-- end
-- local filename = function() return { vim.fn.expand('%:p') } end
-- local clipboard = function() return { vim.fn.getreg('+') } end
-- -- Make sure to not pass an invalid command, as io.popen() may write over nvim-text.
-- local function bash(_, _, command)
-- local file = io.popen(command, 'r')
-- local res = {}
-- for line in file:lines() do
-- table.insert(res, line)
-- end
-- return res
-- end
-- local function get_port_snip(args)
-- if #args < 1 and not args[1][1] then return n(nil, t('hello world')) end
-- local type = args[1][1]
-- local indent = ' '
-- if type == 'NodePort' or type == 'LoadBalancer' then
-- return n(
-- nil,
-- fmt(
-- box_trim_lines([[
-- - port: {}
-- {}targetPort: {}
-- {}nodePort: {}
-- ]]),
-- {
-- i(1, '30000'),
-- indent,
-- i(2, '80'),
-- indent,
-- i(3, '30000'),
-- }
-- )
-- )
-- end
-- if type == 'ClusterIP' then
-- return n(
-- nil,
-- fmt(
-- [[
-- - port: {}
-- {}targetPort: {}
-- ]],
-- {
-- i(1, '30000'),
-- indent,
-- i(2, '80'),
-- }
-- )
-- )
-- end
-- end
-- ls.add_snippets(nil, {
-- markdown = {
-- s({
-- trig = 'link',
-- namr = 'markdown_link [selection]',
-- dscr = 'Create markdown link [txt](url) Select description + TAB',
-- }, {
-- t('['),
-- i(1),
-- t(']('),
-- d(2, get_visual),
-- t(')'),
-- i(0),
-- }),
-- s({
-- trig = 't',
-- namr = 'check list',
-- desc = 'Create item of a checklist',
-- }, fmt('- [{}] {}', { c(2, { t(' '), t('-'), t('') }), i(1, 'task') })),
-- autosnippet(
-- {
-- trig = 'qw',
-- name = 'trig',
-- dscr = 'inline code',
-- },
-- fmt(
-- [[
-- `<>` <>
-- ]],
-- { d(1, get_visual), i(0) },
-- { delimiters = '<>' }
-- )
-- ),
-- s({
-- trig = 'code',
-- namr = 'markdown_code_fenced',
-- desc = 'code backsticks',
-- priority = 2000,
-- }, {
-- t('```'),
-- i(1, 'Lang'),
-- t({ '', '' }),
-- d(2, get_visual),
-- t({ '', '```', '' }),
-- i(0),
-- }),
-- s({
-- trig = 'meta',
-- namr = 'Metadata',
-- dscr = 'Yaml metadata format for markdown',
-- }, {
-- t({ '---', 'title: ' }),
-- i(1, 'note_title'),
-- t({ '', 'author: ' }),
-- i(2, 'author'),
-- t({ '', 'date: ' }),
-- f(date, {}),
-- t({ '', 'cathegories: [' }),
-- i(3, ''),
-- t({ ']', 'lastmod: ' }),
-- f(date, {}),
-- t({ '', 'tags: [' }),
-- i(4),
-- t({ ']', 'comments: true', '---', '' }),
-- i(0),
-- }),
-- s({
-- trig = '_skel',
-- namr = 'File_skeleton',
-- dscr = 'File header (dynamic)',
-- }, {
-- t({ '---', 'File: ' }),
-- f(return_filename, {}),
-- t({ '', 'Last Change: ' }),
-- f(fulldate, {}),
-- t({ '', 'tags: [' }),
-- i(1),
-- t({ ']', '---', '' }),
-- i(0),
-- }),
-- },
-- })
+79
View File
@@ -0,0 +1,79 @@
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local isn = ls.indent_snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local d = ls.dynamic_node
local r = ls.restore_node
local events = require("luasnip.util.events")
local ai = require("luasnip.nodes.absolute_indexer")
local extras = require("luasnip.extras")
local l = extras.lambda
local rep = extras.rep
local p = extras.partial
local m = extras.match
local n = extras.nonempty
local dl = extras.dynamic_lambda
local fmt = require("luasnip.extras.fmt").fmt
local fmta = require("luasnip.extras.fmt").fmta
local conds = require("luasnip.extras.expand_conditions")
local postfix = require("luasnip.extras.postfix").postfix
local types = require("luasnip.util.types")
local parse = require("luasnip.util.parser").parse_snippet
local ms = ls.multi_snippet
local k = require("luasnip.nodes.key_indexer").new_key
local line_begin = require("luasnip.extras.expand_conditions").line_begin
ls.add_snippets("nix", {
s("flake-devshell", fmta([[
{
description = "A flake indeed";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in {
packages.x86_64-linux = {
hello = pkgs.hello;
default = pkgs.hello;
};
devShells.x86_64-linux.default = pkgs.mkShell {
packages = [
pkgs.hello
pkgs.zsh
];
shellHook = ''
export SHELL=${pkgs.zsh}/bin/zsh
exec $SHELL
'';
};
};
}
<>
]], {i(1)}, {
indent_string = ""
})),
s("nix-default", fmta([[
{
config,
pkgs,
...
}: {
<>
}
]], {i(1)}, {
indent_string = ""
}))
})
+801
View File
@@ -0,0 +1,801 @@
local ls = require("luasnip")
local s = ls.snippet
local sn = ls.snippet_node
local isn = ls.indent_snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local c = ls.choice_node
local d = ls.dynamic_node
local r = ls.restore_node
local events = require("luasnip.util.events")
local ai = require("luasnip.nodes.absolute_indexer")
local extras = require("luasnip.extras")
local l = extras.lambda
local rep = extras.rep
local p = extras.partial
local m = extras.match
local n = extras.nonempty
local dl = extras.dynamic_lambda
local fmt = require("luasnip.extras.fmt").fmt
local fmta = require("luasnip.extras.fmt").fmta
local conds = require("luasnip.extras.expand_conditions")
local postfix = require("luasnip.extras.postfix").postfix
local types = require("luasnip.util.types")
local parse = require("luasnip.util.parser").parse_snippet
local ms = ls.multi_snippet
local k = require("luasnip.nodes.key_indexer").new_key
local line_begin = require("luasnip.extras.expand_conditions").line_begin
ls.filetype_extend("plaintex", {"tex"})
local get_visual = function(args, parent)
if (#parent.snippet.env.LS_SELECT_RAW > 0) then
return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW))
else -- If LS_SELECT_RAW is empty, return a blank insert node
return sn(nil, i(1))
end
end
local in_mathzone = function()
-- The `in_mathzone` function requires the VimTeX plugin
return vim.fn['vimtex#syntax#in_mathzone']() == 1
end
-- exampe of a multiline snippet
-- ls.add_snippets("tex", {
-- s("template", fmta([[
-- <> <>
-- ]], {i(1), i(0)}, {
-- indent_string = ""
-- }))
-- })
ls.add_snippets("tex", {
s("template", fmta([[
\documentclass[11pt]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{listings}
\usepackage[utf8]{inputenc}
\usepackage{parskip}
\usepackage{hyperref}
\usepackage{bookmark}
\usepackage[linguistics]{forest}
\usepackage{tikz}
\usepackage{float}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{enumitem}
\usepackage{import}
\usepackage{pdfpages}
\usepackage{transparent}
\usepackage{xcolor}
\newtheorem{all}{Theorem}[section]
\newtheorem{corollary}[all]{Corollary}
\newtheorem{lemma}[all]{Lemma}
\newtheorem{definition}[all]{Definition}
\newtheorem{exercise}[all]{Exercise}
\newtheorem{proposition}[all]{Proposition}
\newtheorem{example}[all]{Example}
\newtheorem{theorem}{Theorem}
\newenvironment{lecture}[1]{
\t\section{\MakeUppercase{#1}}
\t\vspace{-0.5em}
\t\hrule
\t\vspace{1em}
\t\begin{list}{}{
\t\t\setlength{\leftmargin}{1.5em}
\t}
\t\item[]
}{
\t\end{list}
}
\title{<>}
\author{Jake Ginesin}
\date{}
\begin{document}
\maketitle
<>
\end{document}
]], {i(1), i(0)}, {
indent_string = ""
}))
})
ls.add_snippets("tex", {
s("template-math", fmta([[
\documentclass[11pt]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{fullpage}
\usepackage{listings}
\usepackage[utf8]{inputenc}
\usepackage{parskip}
\usepackage{hyperref}
\usepackage{bookmark}
\usepackage[linguistics]{forest}
\usepackage{tikz}
\usepackage{float}
\usepackage{enumitem}
\usepackage{euler}
\usepackage{libertine}
\usepackage{import}
\usepackage{pdfpages}
\usepackage{transparent}
\usepackage{xcolor}
\newtheoremstyle{definitionstyle}
{}
{}
{\normalfont}
{}
{\bfseries}
{:}
{0.5em}
{}
\theoremstyle{definitionstyle}
\newtheorem{definition}{Definition}[section]
\newtheorem{all}{Theorem}[section]
\newtheorem{corollary}[all]{Corollary}
\newtheorem{lemma}[all]{Lemma}
\newtheorem{exercise}[all]{Exercise}
\newtheorem{proposition}[all]{Proposition}
\newtheorem{example}[all]{Example}
\newtheorem{theorem}{Theorem}
\title{<>}
\author{Jake Ginesin}
\date{}
\begin{document}
\maketitle
<>
\end{document}
]], {i(1), i(0)}, {
indent_string = ""
}))
})
ls.add_snippets("tex", {
s("template-report", fmta([[
\documentclass[10pt]{article}
\usepackage{graphicx} % Required for inserting images
\usepackage[margin=1in]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage{url}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{fullpage}
\usepackage{listings}
\usepackage[utf8]{inputenc}
\usepackage{parskip}
\usepackage{hyperref}
\usepackage{bookmark}
\usepackage[linguistics]{forest}
\usepackage{tikz}
\usepackage{float}
\usepackage[minted,skins]{tcolorbox} % 'skins' needed for shadows
% Define a new command \rustshadowfile that replaces \rustfile
\newtcbinputlisting{\rustshadowfile}[2][]{%
listing engine=minted,
minted language=rust,
minted options={linenos, numbersep=5pt, fontsize=\footnotesize, baselinestretch=1.05},
listing file={#2}, % The file to read
enhanced, % Enable skins for shadows
drop shadow, % Add the shadow
colback=white, % Background color
colframe=black!70, % Border color
boxrule=0.5pt, % Border width
arc=2pt, % Rounded corners (optional)
listing only, % Display code only (no title bar inside box)
#1 % Pass extra options like labels
}
\newtcblisting{rustcode}[1][]{
listing engine=minted,
minted language=rust,
minted options={linenos, numbersep=5pt, fontsize=\footnotesize, baselinestretch=1.05},
enhanced,
drop shadow, % Adds the shadow
colback=white, % Background color
colframe=black!70,% Border color
boxrule=0.5pt, % Border width
arc=2pt, % Rounded corners
listing only, % Hides the internal tcolorbox title bar
#1 % Allows passing extra options
}
% \usepackage{enumitem}
% \usepackage{euler}
% \usepackage{libertine}
\usepackage{import}
\usepackage{pdfpages}
\usepackage{transparent}
\newtheoremstyle{definitionstyle}
{}
{}
{\normalfont}
{}
{\bfseries}
{:}
{0.5em}
{}
\theoremstyle{definitionstyle}
\newtheorem{definition}{Definition}[section]
\newtheorem{all}{Theorem}[section]
\newtheorem{corollary}[all]{Corollary}
\newtheorem{lemma}[all]{Lemma}
\newtheorem{exercise}[all]{Exercise}
\newtheorem{proposition}[all]{Proposition}
\newtheorem{example}[all]{Example}
\newtheorem{theorem}{Theorem}
\newcommand{\namedcomment}[3]{{\sf \scriptsize \color{#2} #1: #3}}
\newcommand{\jake}[1]{\namedcomment{jake}{red}{#1}}
\title{<>}
\author{Jake Ginesin \and <>}
\date{December 5th, 1999}
\begin{document}
\maketitle
\end{document}
]], {i(1), i(0)}, {
indent_string = ""
}))
})
ls.add_snippets("tex", {
s("beamer", fmta([[
\documentclass{beamer}
\usetheme{metropolis} % Use metropolis theme
\title{<>}
\date{\today}
\author{Jacob Ginesin}
\institute{<>}
\begin{document}
\maketitle
\section{First Section}
\begin{frame}{First Frame}
Hello, world!
\end{frame}
\end{document}
]], {i(1), i(0)}, {
indent_string = ""
}))
})
ls.add_snippets("tex", {
s("beamer", fmta([[
\documentclass{beamer}
\usetheme{metropolis} % Use metropolis theme
\title{<>}
\date{\today}
\author{Jacob Ginesin}
\institute{<>}
\begin{document}
\maketitle
\section{First Section}
\begin{frame}{First Frame}
Hello, world!
\end{frame}
\end{document}
]], {i(1), i(0)}, {
indent_string = ""
}))
})
ls.add_snippets("tex", {
s("bib", fmta([[
\bibliographystyle{plain}
\bibliography{<>}
]], {i(0)}, {
indent_string = ""
}))
})
-- ----
ls.add_snippets("tex", {
s({trig = "ita", dscr = "Expands 'tii' into LaTeX's textit{} command."},
fmta("\\textit{<>}",
{
d(1, get_visual),
}
)
),
s({trig = "isc"},
fmta("\\textsc{<>}",
{
d(1, get_visual),
}
)
),
s({trig = "frac"},
fmta(
"\\frac{<>}{<>}",
{
i(1),
i(2),
}
),
{condition = in_mathzone} -- `condition` option passed in the snippet `opts` table
),
s({trig = "it"},
fmta(
"\\item ",
{}
), {} -- `condition` option passed in the snippet `opts` table
),
s({trig="eq", dscr="Expands 'eq' into an equation environment"},
fmta(
[[
\begin{equation*}
<>
\end{equation*}
]],
{ i(1) }
)
),
s({trig="align", dscr="Expands 'eq' into an equation environment"},
fmta(
[[
\begin{align*}
<>
\end{align*}
]],
{ i(1) }
)
),
s({trig="beg",
-- snippetType="autosnippet"
},
fmta(
[[
\begin{<>}
<>
\end{<>}
]],
{
i(1),
i(2),
rep(1), -- this node repeats insert node i(1)
}
)
),
s({trig="href", dscr="The hyperref package's href{}{} command (for url links)"},
fmta(
[[\href{<>}{<>}]],
{
i(1, "url"),
i(2, "display name"),
}
)
),
s({trig="([^%a])mk",
snippetType="autosnippet",
wordTrig = false,
regTrig = true
},
fmta(
"<>$<>$",
{
f( function(_, snip) return snip.captures[1] end ),
d(1, get_visual),
}
)
),
s({trig="mk",
snippetType="autosnippet",
wordTrig = false,
regTrig = true
},
fmta(
"<>$<>$",
{
f( function(_, snip) return snip.captures[1] end ),
d(1, get_visual),
}
),
{condition = line_begin}
),
s({trig="([^%a])dm",
snippetType="autosnippet",
wordTrig = false,
regTrig = true
},
fmta(
[[
\[
<>
\]
]],
{
-- f( function(_, snip) return snip.captures[1] end ),
d(1, get_visual),
}
)
),
s({trig="dm",
snippetType="autosnippet",
wordTrig = false,
regTrig = true
},
fmta(
[[
\[
<>
\]
<>
]],
{
-- f( function(_, snip) return snip.captures[1] end ),
d(1, get_visual),
i(0)
}
),
{condition = line_begin}
),
s({
trig = "^^",
snippetType="autosnippet",
},
fmta(
"^{<>}",
{
i(1),
}
),
{condition = in_mathzone}
),
s({
trig = "__",
snippetType="autosnippet",
},
fmta(
"_{<>}",
{
i(1),
}
),
{condition = in_mathzone}
),
s({
trig = "sec",
},
fmta(
[[
\section{<>}
\label{sec:<>}
<>
]],
{
i(1, "section name"),
i(2, "section label"),
i(3),
}
),
{}
),
s({
trig = "sub",
},
fmta(
[[
\subsection{<>}
\label{sec:<>}
<>
]],
{
i(1, "section name"),
i(2, "section label"),
i(0),
}
),
{}
),
ms({
common = {snippetType = "autosnippet"},
"!=",
{trig = "neq", snippetType = "snippet"},
},
fmta(
"\\neq ",
{}
),
{condition = in_mathzone}
),
ms({
common = {snippetType = "autosnippet"},
"<=",
{trig = "leq", snippetType = "snippet"},
},
fmta(
"\\leq ",
{}
),
{condition = in_mathzone}
),
ms({
common = {snippetType = "autosnippet"},
">=",
{trig = "geq", snippetType = "snippet"},
{trig = "ge", snippetType = "snippet"},
},
fmta(
"\\ge ",
{}
),
{condition = in_mathzone}
),
s({
trig = "**",
snippetType="autosnippet",
},
fmta(
"\\cdot ",
{ }
),
{condition = in_mathzone}
),
s({
trig = "->",
snippetType="autosnippet",
},
fmta(
"\\to ",
{ }
),
{condition = in_mathzone}
),
s({
trig = "<->",
snippetType="autosnippet",
},
fmta(
"\\leftrightarrow ",
{ }
),
{condition = in_mathzone}
),
s({trig = "rustcode"},
fmta(
[[
\begin{listing}[H]
\begin{rustcode}
<>
\end{rustcode}
\end{listing}
]],
{ i(1) }
)
),
s({
trig = "notin",
snippetType="autosnippet",
},
fmta(
"\\not\\in ",
{ }
),
{condition = in_mathzone}
),
s({
trig = "notin",
snippetType="autosnippet",
},
fmta(
"\\not\\in ",
{ }
),
{condition = in_mathzone}
),
s({trig="lemma"},
fmta(
[[
\begin{lemma}
<>
\end{lemma}
]],
{ i(1) }
)
),
s({trig="proof"},
fmta(
[[
\begin{proof}
<>
\end{proof}
]],
{ i(1) }
)
),
s({trig = "bf"},
fmta("\\textbf{<>}",
{
d(1, get_visual),
}
)
),
s({
trig = "...",
snippetType="autosnippet",
},
fmta(
"\\ldots ",
{ }
),
{}
),
s({
trig = "image",
},
fmta(
[[
\begin{figure}[h]
\centering
\includegraphics[width=0.5\textwidth]{<>}
\caption{<>}
\label{fig:<>}
\end{figure}
<>
]],
{
i(1, "image.png"),
i(2, "A great image!"),
i(3, "image"),
i(0)
}
),
{}
),
s({
trig = "enum",
},
fmta(
[[
\begin{enumerate}
\item <>
\end{enumerate}
]],
{
i(0)
}
),
{}
),
s({
trig = "item",
},
fmta(
[[
\begin{itemize}
\item <>
\end{itemize}
]],
{
i(0)
}
),
{}
),
-- s({ trig = "!=", snippetType="autosnippet" }, fmta("\\neq ", {}), {condition = in_mathzone}),
-- s({ trig = "<=", snippetType="autosnippet" }, fmta("\\leq ", {}), {condition = in_mathzone}),
-- s({ trig = ">=", snippetType="autosnippet" }, fmta("\\geq ", {}), {condition = in_mathzone}),
s({ trig = "<<", snippetType="autosnippet" }, fmta("\\ll ", {}), {condition = in_mathzone}),
s({ trig = ">>", snippetType="autosnippet" }, fmta("\\gg ", {}), {condition = in_mathzone}),
s({ trig = "~~", snippetType="autosnippet" }, fmta("\\sim ", {}), {condition = in_mathzone}),
s({ trig = "~=", snippetType="autosnippet" }, fmta("\\approx ", {}), {condition = in_mathzone}),
s({ trig = "~-", snippetType="autosnippet" }, fmta("\\simeq ", {}), {condition = in_mathzone}),
s({ trig = "-~", snippetType="autosnippet" }, fmta("\\backsimeq ", {}), {condition = in_mathzone}),
s({ trig = "-=", snippetType="autosnippet" }, fmta("\\equiv ", {}), {condition = in_mathzone}),
s({ trig = "=~", snippetType="autosnippet" }, fmta("\\cong ", {}), {condition = in_mathzone}),
s({ trig = ":=", snippetType="autosnippet" }, fmta("\\definedas ", {}), {condition = in_mathzone}),
-- s({ trig = "**", snippetType="autosnippet" }, fmta("\\cdot ", {}), {condition = in_mathzone}),
s({ trig = "xx", snippetType="autosnippet" }, fmta("\\times ", {}), {condition = in_mathzone}),
s({ trig = "!+", snippetType="autosnippet" }, fmta("\\oplus ", {}), {condition = in_mathzone}),
s({ trig = "!*", snippetType="autosnippet" }, fmta("\\otimes ", {}), {condition = in_mathzone}),
s({ trig = "NN", snippetType="autosnippet" }, fmta("\\mathbb{N} ", {}), {condition = in_mathzone}),
s({ trig = "ZZ", snippetType="autosnippet" }, fmta("\\mathbb{Z} ", {}), {condition = in_mathzone}),
s({ trig = "QQ", snippetType="autosnippet" }, fmta("\\mathbb{Q} ", {}), {condition = in_mathzone}),
s({ trig = "RR", snippetType="autosnippet" }, fmta("\\mathbb{R} ", {}), {condition = in_mathzone}),
s({ trig = "CC", snippetType="autosnippet" }, fmta("\\mathbb{C} ", {}), {condition = in_mathzone}),
s({ trig = "OO", snippetType="autosnippet" }, fmta("\\emptyset ", {}), {condition = in_mathzone}),
s({ trig = "pwr", snippetType="autosnippet" }, fmta("\\powerset ", {}), {condition = in_mathzone}),
s({ trig = "cc", snippetType="autosnippet" }, fmta("\\subset ", {}), {condition = in_mathzone}),
s({ trig = "cq", snippetType="autosnippet" }, fmta("\\subseteq ", {}), {condition = in_mathzone}),
s({ trig = "qq", snippetType="autosnippet" }, fmta("\\supset ", {}), {condition = in_mathzone}),
s({ trig = "qc", snippetType="autosnippet" }, fmta("\\supseteq ", {}), {condition = in_mathzone}),
s({ trig = "Nn", snippetType="autosnippet" }, fmta("\\cap ", {}), {condition = in_mathzone}),
s({ trig = "UU", snippetType="autosnippet" }, fmta("\\cup ", {}), {condition = in_mathzone}),
s({ trig = "::", snippetType="autosnippet" }, fmta("\\colon ", {}), {condition = in_mathzone}),
s({ trig = "AA", snippetType="autosnippet" }, fmta("\\forall ", {}), {condition = in_mathzone}),
s({ trig = "EE", snippetType="autosnippet" }, fmta("\\exists ", {}), {condition = in_mathzone}),
s({ trig = "inn", snippetType="autosnippet" }, fmta("\\in ", {}), {condition = in_mathzone}),
-- s({ trig = "notin", snippetType="autosnippet" }, fmta("\\not\\in ", {}), {condition = in_mathzone}),
s({ trig = "!-", snippetType="autosnippet" }, fmta("\\lnot ", {}), {condition = in_mathzone}),
s({ trig = "VV", snippetType="autosnippet" }, fmta("\\lor ", {}), {condition = in_mathzone}),
s({ trig = "WW", snippetType="autosnippet" }, fmta("\\land ", {}), {condition = in_mathzone}),
s({ trig = "!W", snippetType="autosnippet" }, fmta("\\bigwedge ", {}), {condition = in_mathzone}),
s({ trig = "=>", snippetType="autosnippet" }, fmta("\\implies ", {}), {condition = in_mathzone}),
s({ trig = "=<", snippetType="autosnippet" }, fmta("\\impliedby ", {}), {condition = in_mathzone}),
s({ trig = "iff", snippetType="autosnippet" }, fmta("\\iff ", {}), {condition = in_mathzone}),
s({ trig = "->", snippetType="autosnippet" }, fmta("\\to ", {}), {condition = in_mathzone}),
s({ trig = "!>", snippetType="autosnippet" }, fmta("\\mapsto ", {}), {condition = in_mathzone}),
s({ trig = "<-", snippetType="autosnippet" }, fmta("\\gets ", {}), {condition = in_mathzone}),
s({ trig = "dp", snippetType="autosnippet" }, fmta("\\partial ", {}), {condition = in_mathzone}),
s({ trig = "-->", snippetType="autosnippet" }, fmta("\\longrightarrow ", {}), {condition = in_mathzone}),
s({ trig = "<->", snippetType="autosnippet" }, fmta("\\leftrightarrow ", {}), {condition = in_mathzone}),
s({ trig = "2>", snippetType="autosnippet" }, fmta("\\rightrightarrows ", {}), {condition = in_mathzone}),
s({ trig = "upar", snippetType="autosnippet" }, fmta("\\uparrow ", {}), {condition = in_mathzone}),
s({ trig = "dnar", snippetType="autosnippet" }, fmta("\\downarrow ", {}), {condition = in_mathzone}),
s({ trig = "ooo", snippetType="autosnippet" }, fmta("\\infty ", {}), {condition = in_mathzone}),
s({ trig = "lll", snippetType="autosnippet" }, fmta("\\ell ", {}), {condition = in_mathzone}),
s({ trig = "dag", snippetType="autosnippet" }, fmta("\\dagger ", {}), {condition = in_mathzone}),
s({ trig = "+-", snippetType="autosnippet" }, fmta("\\pm ", {}), {condition = in_mathzone}),
s({ trig = "-+", snippetType="autosnippet" }, fmta("\\mp ", {}), {condition = in_mathzone}),
})
+14
View File
@@ -0,0 +1,14 @@
{
config,
pkgs,
...
}: {
programs.home-manager.enable = true;
imports = [
./alacritty/default.nix
./zsh/default.nix
./nvim/default.nix
];
}
+45
View File
@@ -0,0 +1,45 @@
{
pkgs,
lib,
system,
config,
osConfig,
...
}: {
home.packages = with pkgs; [zsh-powerlevel10k meslo-lgs-nf];
home.file.".p10k.zsh".source = ./p10k;
programs.direnv.enable = true;
programs.zsh = {
enable = true;
# dotDir = "$HOME/.config/zsh";
plugins = [
{
name = "zsh-powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/";
file = "powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = lib.cleanSource ./p10k;
file = "p10k.zsh";
}
];
oh-my-zsh = {
enable = true;
# theme = "af-magic";
# theme = "powerlevel10k/powerlevel10k";
plugins = ["git" "history-substring-search" "colored-man-pages"];
};
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
# zsh sheeee
initExtraFirst = ''
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
'';
};
}
File diff suppressed because it is too large Load Diff
+185
View File
@@ -0,0 +1,185 @@
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt nomatch autocd
# unsetopt autocd beep extendedglob notify
unsetopt beep extendedglob notify
bindkey -v
zstyle :compinstall filename '/home/synchronous/.zshrc'
export PATH=/home/synchronous/.local/bin:$PATH
export PATH=/home/synchronous/.cargo/bin/:$PATH
export NIX_PATH=/home/synchronous/nix-cfg
DISABLE_UNTRACKED_FILES_DIRTY="true"
# ==== binding keys ====
bindkey '^ ' autosuggest-accept
# ==== holy fuck aliases ====
# make sure i get the right version of python
alias python='python3'
alias pls='sudo'
alias please='sudo'
# fuck
alias fuck="sudo !!"
# neovim
alias vi='nvim'
alias vim='nvim'
alias n="nvim"
alias neovim='nvim'
alias v='nvim'
# duplicate current alacritty unit
alias dupe='setsid alacritty --working-directory "$(pwd)" > /dev/null'
# alias so i can copy stuff to my clipboard from my terminal
# example:
#$ pwd | clip
alias clip='perl -p -e "chomp if eof" | xclip -in -sel clip'
alias pwdc='pwd | clip | echo "directory clipped"'
alias cls="clear"
## Curl Aliases for easy info
alias myip="curl https://ipecho.net/plain; echo"
alias pq="ping google.com -c 5"
alias ..="cd ../"
alias ../="cd ../"
alias ...="cd ../.."
alias .4="cd ../../.."
# replacing ls with exa & lsd
# hrr drr why do you use lsd AND exa?
# because lsd has icons but exa is better with everything else. smh.
# Lolcats!!
alias neofetch="neofetch | lolcat"
# tars
alias untar="tar -zxvf"
alias mktar="tar -cvzf"
# by default, put zathura windows in new process
# alias zathura="sh /home/synchronous/.scripts/zathura/zathura_conditional.sh"
# alias exclude-zathura="pwd >> /home/synchronous/.scripts/zathura/excluded;echo 'done'"
# make ncdu run fast wow
alias ncdu="ncdu -rx"
alias ndwc="nmcli device wifi connect"
alias ndwl="nmcli device wifi list"
alias ndc="nmcli device disconnect wlan0"
alias wt="systemctl restart NetworkManager"
alias syncthing="firefox localhost:8384"
alias htop="btop" # of course
alias top="btop" # of course
stack() {
find . -type f -exec echo -e "\n--- {} ---\n" \; -exec cat {} \;
}
stack-fast() {
rg -l . | while read -r file; do
echo -e "\n--- $file ---\n"
cat "$file"
done
}
stack-b() {
(
while IFS= read -r -d '' file; do
# Print a header for each filename:
printf '\n--- %s ---\n' "$file"
# Dump the raw content of "$file" exactly (no transformations).
cat "$file"
done < <(find . -type f ! -name '*.json' -print0)
) \
| perl -p -e 'chomp if eof' \
| xclip -in -sel clip
}
stack-min() {
find . -maxdepth 1 -type f -exec echo -e "\n--- {} ---\n" \; -exec cat {} \;
}
a.nixi() {
nix-store -q --references /var/run/current-system/sw | cut -d'-' -f2-
}
a.pingg() {
grc ping 8.8.8.8 -c 1
}
a.sitecopy() {
wget -k -K -E -r -l 10 -p -N -F -nH $@
}
a.pdfcopy() {
wget -k -r -l 10 -p -A "*.pdf" -N -F -nH $@
}
a.fo() {
firefox `pwd`
}
a.dnsenum() {
dnsenum "$@"
}
# ------------------- fzf configuration
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_COMMAND='fd --type f'
export FZF_DEFAULT_OPTS="--layout=reverse --inline-info --height=80%"
# ------------------- Key Binding
bindkey "\e[1~" beginning-of-line # Home
bindkey "\e[4~" end-of-line # End
bindkey "\e[3~" delete-char #Del
bindkey "\e[2~" overwrite-mode # Ins
bindkey "\e[6~" end-of-history # PageDown
bindkey "\e[5~" beginning-of-history #PageUp
bindkey '^R' history-incremental-search-backward
# -------------------- control backspace deleting previous word entirely
bindkey '^H' backward-kill-word
bindkey '5~' kill-word
# ------------------- More Widgets
#run_ranger () {
## echo
# ranger --choosedir=$HOME/.rangedir < $TTY
# LASTDIR='cat $HOME/.rangerdir'
# cd "$LASTDIR"
# zle reset-prompt
#}
#zle -N run_ranger
# --------------------- REMOTES CONFIG
# source /home/synchronous/.zshrc_remote
export LESS_TERMCAP_mb=$'\e[1;32m'
export LESS_TERMCAP_md=$'\e[1;32m'
export LESS_TERMCAP_me=$'\e[0m'
export LESS_TERMCAP_se=$'\e[0m'
export LESS_TERMCAP_so=$'\e[01;33m'
export LESS_TERMCAP_ue=$'\e[0m'
export LESS_TERMCAP_us=$'\e[1;4;31m'
# ------ NNN (not no not november)
export PATH=/home/synchronous/.scripts/nnn:$PATH
# export VISUAL=wrapper.sh
# export EDITOR="$VISUAL"
export EDITOR="nvim"
export NNN_PLUG='m:preview-tui;'
export NNN_FIFO=/tmp/nnn.fifo
export NNN_TERMINAL=alacritty
bindkey -s '^o' 'nnn -e ^M'