Skip to content

Instantly share code, notes, and snippets.

@jaasonw
Last active December 29, 2023 21:57
Show Gist options
  • Save jaasonw/b979b8f12d8ae01e5e334cf2edc4507f to your computer and use it in GitHub Desktop.
Save jaasonw/b979b8f12d8ae01e5e334cf2edc4507f to your computer and use it in GitHub Desktop.
dotfiles
# Load Antigen
source ~/antigen.zsh
# Load Antigen configurations
antigen init ~/.antigenrc
# Example aliases
alias zshconfig="nvim ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias ghf="cd ~/Documents/github/"
alias ghidra="ghidraRun"
alias vim='lvim'
alias nvim='lvim'
alias npm='pnpm'
alias ls='exa --icons --git -la'
alias cat='bat --theme Nord -Pp'
export PATH=$PATH:/Users/jason/go/bin
export EDITOR=nvim
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/jason/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/jason/miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/jason/miniconda3/etc/profile.d/conda.sh"
# else
# export PATH="/Users/jason/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
# pnpm
export PNPM_HOME="/Users/jason/Library/pnpm"
export PATH="$PNPM_HOME:$PATH"
# pnpm end
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
export PATH=$PATH:/Users/jason/.spicetify
# Load oh-my-zsh library
antigen use oh-my-zsh
# Load bundles from the default repo (oh-my-zsh)
antigen bundle git
antigen bundle command-not-found
antigen bundle docker
# Load bundles from external repos
antigen bundle zsh-users/zsh-completions
antigen bundle zsh-users/zsh-autosuggestions
antigen bundle zsh-users/zsh-syntax-highlighting
# Select theme
antigen theme romkatv/powerlevel10k
# Tell Antigen that you're done
antigen apply
stuff essential to my workflow
code --install-extension usernamehw.errorlens
code --install-extension albert.TabOut
code --install-extension shyykoserhiy.vscode-spotify
code --install-extension eamodio.gitlens
code --install-extension Gruntfuggly.activitusbar
code --install-extension ms-vscode.sublime-keybindings
code --install-extension VisualStudioExptTeam.intellicode-api-usage-examples
code --install-extension GitHub.copilot
code --install-extension GitHub.copilot-labs
themes i like
code --install-extension Catppuccin.catppuccin-vsc
code --install-extension akamud.vscode-theme-onedark
code --install-extension Equinusocio.vsc-community-material-theme
code --install-extension Equinusocio.vsc-material-theme
code --install-extension equinusocio.vsc-material-theme-icons
code --install-extension arcticicestudio.nord-visual-studio-code
code --install-extension qufiwefefwoyn.kanagawa
language specific
code --install-extension bradlc.vscode-tailwindcss
code --install-extension esbenp.prettier-vscode
code --install-extension ms-python.python
code --install-extension csstools.postcss
code --install-extension ms-python.black-formatter
code --install-extension ms-vscode.cpptools-extension-pack
code --install-extension James-Yu.latex-workshop
code --install-extension svelte.svelte-vscode
-- Install packer
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local is_bootstrap = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
is_bootstrap = true
vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }
vim.cmd [[packadd packer.nvim]]
end
require('packer').startup(function(use)
-- Package manager
use 'wbthomason/packer.nvim'
use { -- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
requires = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'j-hui/fidget.nvim',
'folke/neodev.nvim',
},
}
use {
'hrsh7th/nvim-cmp',
requires = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' },
}
use {
'nvim-treesitter/nvim-treesitter',
run = function()
pcall(require('nvim-treesitter.install').update { with_sync = true })
end,
}
use {
'nvim-treesitter/nvim-treesitter-textobjects',
after = 'nvim-treesitter',
}
-- git stuff
use 'tpope/vim-fugitive'
use 'tpope/vim-rhubarb'
use 'lewis6991/gitsigns.nvim'
use 'rebelot/kanagawa.nvim'
use { "catppuccin/nvim", as = "catppuccin" }
use 'navarasu/onedark.nvim'
use 'nvim-lualine/lualine.nvim'
use 'lukas-reineke/indent-blankline.nvim'
use 'numToStr/Comment.nvim'
use 'tpope/vim-sleuth'
-- telescope
use { 'nvim-telescope/telescope.nvim', branch = '0.1.x', requires = { 'nvim-lua/plenary.nvim' } }
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = vim.fn.executable 'make' == 1 }
-- svelte
use 'othree/html5.vim'
use 'pangloss/vim-javascript'
use 'evanleck/vim-svelte'
-- tree
use {
'nvim-tree/nvim-tree.lua',
requires = {
'nvim-tree/nvim-web-devicons', -- optional, for file icons
},
}
if is_bootstrap then
require('packer').sync()
end
end)
-- Automatically source and re-compile packer whenever you save this init.lua
local packer_group = vim.api.nvim_create_augroup('Packer', { clear = true })
vim.api.nvim_create_autocmd('BufWritePost', {
command = 'source <afile> | silent! LspStop | silent! LspStart | PackerCompile',
group = packer_group,
pattern = vim.fn.expand '$MYVIMRC',
})
-- vim config
vim.o.hlsearch = false
vim.o.number = true
vim.o.relativenumber = true
vim.o.mouse = 'a'
vim.o.breakindent = true
vim.o.undofile = true
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.completeopt = 'menuone,noselect'
-- color scheme
vim.o.termguicolors = true
vim.cmd [[colorscheme catppuccin-macchiato]]
-- remaps
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- vim.keymap.set(mode, keybind, thing)
vim.keymap.set("n", "<leader>F", vim.lsp.buf.format)
-- init plugins
require("kickstart")
require("nvim-tree").setup({
sort_by = "case_sensitive",
view = {
adaptive_size = true,
mappings = {
list = {
{ key = "u", action = "dir_up" },
},
},
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
})
-- general
lvim.log.level = "warn"
lvim.format_on_save.enabled = true
lvim.colorscheme = "catppuccin-macchiato"
-- keymappings
lvim.leader = "space"
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
lvim.builtin.alpha.active = true
lvim.builtin.alpha.mode = "dashboard"
lvim.builtin.terminal.active = true
lvim.builtin.nvimtree.setup.view.side = "left"
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
lvim.builtin.treesitter.ensure_installed = {
"bash",
"c",
"javascript",
"json",
"lua",
"python",
"typescript",
"tsx",
"css",
"rust",
"java",
"yaml",
}
lvim.builtin.treesitter.ignore_install = { "haskell" }
lvim.builtin.treesitter.highlight.enable = true
-- Additional Plugins
lvim.plugins = {
{
"folke/trouble.nvim",
cmd = "TroubleToggle",
},
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000
},
{ "github/copilot.vim" },
{ "karb94/neoscroll.nvim" },
{ "mattn/emmet-vim" },
{ "neovim/nvim-lspconfig" },
{ "RRethy/vim-illuminate" },
{ "SmiteshP/nvim-navic" },
{ "nvim-treesitter/nvim-treesitter-context" },
{ "petobens/poet-v" },
{ "rcarriga/nvim-notify" },
{ "APZelos/blamer.nvim" },
{ "nacro90/numb.nvim" },
{ "ethanholz/nvim-lastplace" }
}
require('neoscroll').setup()
require('numb').setup()
require('nvim-lastplace').setup()
local lspconfig = require('lspconfig')
lspconfig.pyright.setup {
on_new_config = function(config, root_dir)
local env = vim.trim(vim.fn.system('cd "' .. root_dir .. '"; poetry env info -p 2>/dev/null'))
if string.len(env) > 0 then
config.settings.python.pythonPath = env .. '/bin/python'
end
end
}
{
"workbench.colorTheme": "Catppuccin Macchiato",
"git.confirmSync": false,
"git.autofetch": true,
"sync.gist": "e48f2118a5cc6b0085d4f0939bbd110e",
"editor.fontSize": 20,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.rulers": [80],
"editor.minimap.scale": 2,
"workbench.iconTheme": "material-icon-theme",
"spotify.showSignOutButton": false,
"spotify.showSignInButton": false,
"vim.handleKeys": {
"<C-f>": false
},
"vim.useSystemClipboard": true,
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["d"],
"after": ["\"", "_", "d"]
},
{
"before": ["D"],
"after": ["\"", "_", "D"]
},
{
"before": ["d", "d"],
"after": ["\"", "_", "d", "d"]
}
],
"security.workspace.trust.untrustedFiles": "open",
"latex-workshop.latex.recipe.default": "lastUsed",
"vim.useCtrlKeys": false,
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"git.enableSmartCommit": true,
"telemetry.telemetryLevel": "off",
"typescript.updateImportsOnFileMove.enabled": "always",
"svelte.enable-ts-plugin": true,
"explorer.confirmDelete": false,
"remote.SSH.remotePlatform": {
"152.70.112.92": "linux"
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"editor.stickyScroll.enabled": true,
"editor.minimap.renderCharacters": false,
"editor.cursorSmoothCaretAnimation": "on",
"workbench.list.smoothScrolling": true,
"terminal.integrated.smoothScrolling": true,
"editor.smoothScrolling": true,
"window.commandCenter": true,
"editor.largeFileOptimizations": false,
"[handlebars]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"files.autoSave": "afterDelay",
"[liquid]": {
"editor.defaultFormatter": "Shopify.theme-check-vscode"
},
"editor.inlineSuggest.enabled": true,
"debug.inlineValues": "on",
"editor.foldingStrategy": "indentation",
"explorer.confirmDragAndDrop": false,
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"window.zoomLevel": -1,
"editor.fontFamily": "Comic Mono, Consolas, 'Courier New', monospace",
"editor.stickyTabStops": true,
"auto-rename-tag.activationOnLanguage": ["*"]
// "vim.normalModeKeyBindingsNonRecursive": [
// {
// "before": [
// "J"
// ],
// "commands": [
// "editor.action.moveLinesDownAction"
// ]
// }, // moveLineDown
// {
// "before": [
// "K"
// ],
// "commands": [
// "editor.action.moveLinesUpAction"
// ]
// } // moveLineUp
// ],
}
// To be used with Sublime Text Keybinds
[
// increment and decrement by 1
{
"key": "alt+cmd+,",
"command": "editor.emmet.action.decrementNumberByOne"
},
{
"key": "alt+cmd+.",
"command": "editor.emmet.action.incrementNumberByOne"
},
// go to symbol + go to line
{
"key": "cmd+g",
"command": "workbench.action.gotoSymbol"
},
{
"key": "shift+cmd+g",
"command": "workbench.action.gotoLine"
},
// expand selection inward and outward
{
"key": "shift+cmd+]",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "shift+cmd+[",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
// wrap with emmet abbreviation
{
"key": "shift+cmd+w",
"command": "editor.emmet.action.wrapWithAbbreviation"
},
// navigate back and forward
{
"key": "shift+cmd+-",
"command": "workbench.action.navigateBack",
"when": "canNavigateBack"
},
{
"key": "shift+cmd+=",
"command": "workbench.action.navigateForward",
"when": "canNavigateForward"
},
// jump between folds
{
"key": "alt+]",
"command": "editor.gotoNextFold"
},
{
"key": "alt+[",
"command": "editor.gotoPreviousFold"
},
// unbind defaults
{
"key": "alt+cmd+.",
"command": "-editor.action.autoFix",
"when": "editorTextFocus && !editorReadonly && supportedCodeAction =~ /(\\s|^)quickfix\\b/"
},
{
"key": "shift+cmd+o",
"command": "-workbench.action.gotoSymbol"
},
{
"key": "cmd+g",
"command": "-editor.action.nextMatchFindAction",
"when": "editorTextFocus"
},
{
"key": "cmd+g",
"command": "-editor.action.nextMatchFindAction",
"when": "editorFocus"
},
{
"key": "shift+cmd+.",
"command": "-breadcrumbs.toggleToOn",
"when": "!config.breadcrumbs.enabled"
},
{
"key": "shift+cmd+[",
"command": "-workbench.action.debug.prevConsole",
"when": "inDebugRepl"
},
{
"key": "shift+cmd+[",
"command": "-workbench.action.previousEditor"
},
{
"key": "shift+cmd+[",
"command": "-workbench.action.terminal.focusPrevious",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{
"key": "ctrl+shift+right",
"command": "-editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "shift+cmd+]",
"command": "-workbench.action.debug.nextConsole",
"when": "inDebugRepl"
},
{
"key": "shift+cmd+]",
"command": "-workbench.action.terminal.focusNext",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus"
},
{
"key": "shift+cmd+]",
"command": "-workbench.action.nextEditor"
},
{
"key": "ctrl+shift+left",
"command": "-editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
{
"key": "shift+cmd+w",
"command": "-workbench.action.closeWindow"
},
{
"key": "ctrl+g",
"command": "-workbench.action.gotoLine"
},
{
"key": "shift+cmd+g",
"command": "-editor.action.previousMatchFindAction",
"when": "editorFocus"
},
{
"key": "shift+cmd+-",
"command": "-workbench.action.zoomOut"
},
{
"key": "ctrl+-",
"command": "-workbench.action.navigateBack",
"when": "canNavigateBack"
},
{
"key": "shift+cmd+=",
"command": "-workbench.action.zoomIn"
},
{
"key": "ctrl+shift+-",
"command": "-workbench.action.navigateForward",
"when": "canNavigateForward"
}
]
// To be used with Sublime Text Keybinds
[
// increment + decrement
{
"key": "ctrl+shift+.",
"command": "editor.emmet.action.incrementNumberByOne"
},
{
"key": "ctrl+shift+,",
"command": "editor.emmet.action.decrementNumberByOne"
},
// emmet wrap with abbreviation
{
"key": "ctrl+shift+w",
"command": "editor.emmet.action.wrapWithAbbreviation"
},
// jump between folds
{
"key": "ctrl+]",
"command": "editor.gotoNextFold"
},
{
"key": "ctrl+[",
"command": "editor.gotoPreviousFold"
},
// scrolling without having to reach for the mouse
{
"key": "alt+down",
"command": "scrollLineDown",
"when": "editorTextFocus"
},
{
"key": "alt+up",
"command": "scrollLineUp",
"when": "editorTextFocus"
},
// naviagate back and forward
{
"key": "ctrl+shift+-",
"command": "workbench.action.navigateBack",
"when": "canNavigateBack"
},
{
"key": "ctrl+shift+=",
"command": "workbench.action.navigateForward",
"when": "canNavigateForward"
},
// expand selection inward and outwards (alt shift variant to be like mac ig?)
{
"key": "shift+alt+[",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
{
"key": "shift+alt+]",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+[",
"command": "editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+]",
"command": "editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
// move lines up and down, should be included with sublime text keybinds
// but werent for som reason ¯\_(ツ)_/¯
{
"key": "ctrl+up",
"command": "editor.action.moveLinesUpAction",
"when": "editorTextFocus"
},
{
"key": "ctrl+down",
"command": "editor.action.moveLinesDownAction",
"when": "editorTextFocus"
},
// go to symbol + go to line
{
"key": "ctrl+g",
"command": "workbench.action.gotoSymbol"
},
{
"key": "ctrl+shift+g",
"command": "workbench.action.gotoLine"
},
// unbind defaults
{
"key": "alt+down",
"command": "-editor.action.moveLinesDownAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "alt+up",
"command": "-editor.action.moveLinesUpAction",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+.",
"command": "-breadcrumbs.toggleToOn",
"when": "!config.breadcrumbs.enabled"
},
{
"key": "ctrl+shift+.",
"command": "-breadcrumbs.focusAndSelect",
"when": "breadcrumbsPossible && breadcrumbsVisible"
},
{
"key": "ctrl+shift+w",
"command": "-workbench.action.closeWindow"
},
{
"key": "shift+alt+left",
"command": "-editor.action.smartSelect.shrink",
"when": "editorTextFocus"
},
{
"key": "shift+alt+right",
"command": "-editor.action.smartSelect.expand",
"when": "editorTextFocus"
},
{
"key": "ctrl+shift+[",
"command": "-spotify.previous"
},
{
"key": "ctrl+shift+]",
"command": "-spotify.next"
},
{
"key": "alt+]",
"command": "-editor.action.inlineSuggest.showNext",
"when": "inlineSuggestionVisible && !editorReadonly"
},
{
"key": "alt+[",
"command": "-editor.action.inlineSuggest.showPrevious",
"when": "inlineSuggestionVisible && !editorReadonly"
},
{
"key": "ctrl+[",
"command": "-editor.action.outdentLines",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+]",
"command": "-editor.action.indentLines",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+-",
"command": "-workbench.action.zoomOut"
},
{
"key": "ctrl+shift+-",
"command": "-notebook.cell.split",
"when": "editorTextFocus && inputFocus && notebookEditorFocused && !notebookOutputFocused"
},
{
"key": "alt+-",
"command": "-workbench.action.navigateBack",
"when": "canNavigateBack"
},
{
"key": "shift+alt+-",
"command": "-workbench.action.navigateForward",
"when": "canNavigateForward"
},
{
"key": "ctrl+shift+=",
"command": "-workbench.action.zoomIn"
},
{
"key": "ctrl+shift+[",
"command": "-editor.fold",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+shift+]",
"command": "-editor.unfold",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+shift+]",
"command": "-editor.unfold",
"when": "editorFocus"
},
{
"key": "ctrl+shift+]",
"command": "-notebook.unfold",
"when": "notebookEditorFocused && !inputFocus && activeEditor == 'workbench.editor.notebook'"
},
{
"key": "ctrl+r",
"command": "-workbench.action.gotoSymbol"
},
{
"key": "ctrl+g",
"command": "-workbench.action.gotoLine"
},
{
"key": "ctrl+shift+g",
"command": "-workbench.view.scm",
"when": "workbench.scm.active"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment