diff options
| -rw-r--r-- | alacritty/.config/alacritty/alacritty.toml | 39 | ||||
| -rw-r--r-- | by_os/Darwin/launchagents/Library/LaunchAgents/rocks.pks.autostart.plist | 24 | ||||
| -rw-r--r-- | by_os/Darwin/launchagents/Library/LaunchAgents/rocks.pks.sync-mail.plist | 70 | ||||
| -rw-r--r-- | neovim/.config/nvim/init.lua | 407 | ||||
| -rw-r--r-- | packages/debian.txt | 3 | ||||
| -rw-r--r-- | packages/macos-macports.txt | 30 | ||||
| m--------- | vim/.vim/bundle/endwise | 0 | ||||
| m--------- | vim/.vim/bundle/lightline | 0 | ||||
| m--------- | vim/.vim/bundle/nerdcommenter | 0 | ||||
| m--------- | vim/.vim/bundle/pathogen | 0 | ||||
| m--------- | vim/.vim/bundle/supertab | 0 | ||||
| m--------- | vim/.vim/bundle/tagbar | 0 | ||||
| m--------- | vim/.vim/bundle/vimwiki | 0 | ||||
| -rw-r--r-- | vim/.vimrc | 1 | ||||
| -rw-r--r-- | zsh/.zshrc | 2 |
15 files changed, 574 insertions, 2 deletions
diff --git a/alacritty/.config/alacritty/alacritty.toml b/alacritty/.config/alacritty/alacritty.toml new file mode 100644 index 0000000..e097404 --- /dev/null +++ b/alacritty/.config/alacritty/alacritty.toml @@ -0,0 +1,39 @@ +[cursor.style] +blinking = "Always" +shape = "Block" + +[font] +size = 32.0 +builtin_box_drawing = true + +[font.bold] +family = "Myna" +style = "Bold" + +[font.bold_italic] +family = "Myna" +style = "Bold Italic" + +[font.italic] +family = "Myna" +style = "Italic" + +[font.normal] +family = "Myna" +style = "Regular" + +[scrolling] +history = 100000 + +[selection] +save_to_clipboard = true +semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" + +[window] +decorations = "none" +dynamic_title = true +opacity = 0.0 +startup_mode = "Fullscreen" + +[keyboard] +bindings = [ { key="W", mods="Command", action="None" } ] diff --git a/by_os/Darwin/launchagents/Library/LaunchAgents/rocks.pks.autostart.plist b/by_os/Darwin/launchagents/Library/LaunchAgents/rocks.pks.autostart.plist new file mode 100644 index 0000000..1f564e0 --- /dev/null +++ b/by_os/Darwin/launchagents/Library/LaunchAgents/rocks.pks.autostart.plist @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>rocks.pks.autostart</string> + + <key>OnDemand</key> + <false/> + + <key>UserName</key> + <string>pks</string> + + <key>GroupName</key> + <string>staff</string> + + <key>ProgramArguments</key> + <array> + <string>/bin/mkdir</string> + <string>-p</string> + <string>/tmp/pks/mutt</string> + </array> +</dict> +</plist> diff --git a/by_os/Darwin/launchagents/Library/LaunchAgents/rocks.pks.sync-mail.plist b/by_os/Darwin/launchagents/Library/LaunchAgents/rocks.pks.sync-mail.plist new file mode 100644 index 0000000..56f236e --- /dev/null +++ b/by_os/Darwin/launchagents/Library/LaunchAgents/rocks.pks.sync-mail.plist @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>Label</key> + <string>rocks.pks.sync-mail</string> + + <key>ProgramArguments</key> + <array> + <string>/Users/pks/.local/bin/sync-mail</string> + </array> + + <key>StandardErrorPath</key> + <string>/tmp/pks/sync-mail.err</string> + <key>StandardOutPath</key> + <string>/tmp/pks/sync-mail.out</string> + + <key>StartCalendarInterval</key> + <array> + <dict> + <key>Minute</key> + <integer>0</integer> + </dict> + <dict> + <key>Minute</key> + <integer>5</integer> + </dict> + <dict> + <key>Minute</key> + <integer>10</integer> + </dict> + <dict> + <key>Minute</key> + <integer>15</integer> + </dict> + <dict> + <key>Minute</key> + <integer>20</integer> + </dict> + <dict> + <key>Minute</key> + <integer>25</integer> + </dict> + <dict> + <key>Minute</key> + <integer>30</integer> + </dict> + <dict> + <key>Minute</key> + <integer>35</integer> + </dict> + <dict> + <key>Minute</key> + <integer>40</integer> + </dict> + <dict> + <key>Minute</key> + <integer>45</integer> + </dict> + <dict> + <key>Minute</key> + <integer>50</integer> + </dict> + <dict> + <key>Minute</key> + <integer>55</integer> + </dict> + </array> +</dict> +</plist> diff --git a/neovim/.config/nvim/init.lua b/neovim/.config/nvim/init.lua new file mode 100644 index 0000000..c92916e --- /dev/null +++ b/neovim/.config/nvim/init.lua @@ -0,0 +1,407 @@ +-------------------------------------------------------------------------------- +-- Neovim Configuration +-------------------------------------------------------------------------------- + +-------------------------------------------------------------------------------- +-- Options +-------------------------------------------------------------------------------- + +-- UI +vim.opt.cursorline = true +vim.opt.number = true +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "yes" +vim.opt.termguicolors = true + +-- Tabs & Indentation +vim.opt.expandtab = true +vim.opt.shiftwidth = 4 +vim.opt.tabstop = 4 + +-- Search +vim.opt.ignorecase = true +vim.opt.smartcase = true + +-- Splits +vim.opt.splitbelow = true +vim.opt.splitright = true + +-- Folding (treesitter-based) +vim.opt.foldmethod = "expr" +vim.opt.foldexpr = "nvim_treesitter#foldexpr()" +vim.opt.foldenable = true +vim.opt.foldlevelstart = 0 + +-- Misc +vim.opt.clipboard = "unnamedplus" +vim.opt.undofile = true +vim.opt.updatetime = 250 + +-------------------------------------------------------------------------------- +-- Bootstrap lazy.nvim +-------------------------------------------------------------------------------- +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + vim.fn.system({ + "git", "clone", "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +-------------------------------------------------------------------------------- +-- Plugins +-------------------------------------------------------------------------------- +require("lazy").setup({ + + -- Colorscheme --------------------------------------------------------------- + { + "Shadorain/shadotheme", + lazy = false, + priority = 1000, + config = function() + vim.cmd.colorscheme("shado") + vim.api.nvim_set_hl(0, "Normal", { bg = "#000000" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#000000" }) + vim.api.nvim_set_hl(0, "SignColumn", { bg = "#000000" }) + vim.api.nvim_set_hl(0, "LineNr", { bg = "#000000" }) + vim.api.nvim_set_hl(0, "CursorLineNr", { bg = "#000000" }) + end, + }, + + -- Treesitter ---------------------------------------------------------------- + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + dependencies = { "nvim-treesitter/nvim-treesitter-textobjects" }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "bash", "lua", "python", "ruby" }, + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "<C-space>", + node_incremental = "<C-space>", + node_decremental = "<bs>", + }, + }, + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["af"] = "@function.outer", ["if"] = "@function.inner", + ["ac"] = "@class.outer", ["ic"] = "@class.inner", + ["aa"] = "@parameter.outer", ["ia"] = "@parameter.inner", + }, + }, + move = { + enable = true, + set_jumps = true, + goto_next_start = { ["]m"] = "@function.outer", ["]]"] = "@class.outer" }, + goto_prev_start = { ["[m"] = "@function.outer", ["[["] = "@class.outer" }, + }, + }, + }) + end, + }, + + -- Completion ---------------------------------------------------------------- + { + "saghen/blink.cmp", + version = "1.*", + opts = { + keymap = { + preset = "default", + ["<CR>"] = { "accept", "fallback" }, + ["<Tab>"] = { "select_next", "fallback" }, + ["<S-Tab>"] = { "select_prev", "fallback" }, + }, + sources = { + default = { "lsp", "path", "buffer" }, + providers = { lsp = { timeout_ms = 2000 } }, + }, + completion = { + trigger = { show_in_snippet = false }, + menu = { auto_show = true }, + documentation = { auto_show = true, auto_show_delay_ms = 200 }, + }, + }, + }, + + -- Auto-pairs & Tags --------------------------------------------------------- + { "windwp/nvim-autopairs", event = "InsertEnter", opts = {} }, + { "windwp/nvim-ts-autotag", opts = {} }, + { "tpope/vim-endwise" }, + + -- UI ------------------------------------------------------------------------ + { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" }, opts = {} }, + { "lewis6991/gitsigns.nvim", opts = {} }, + { "folke/which-key.nvim", event = "VeryLazy", opts = {} }, + { "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} }, + + -- Navigation ---------------------------------------------------------------- + { + "nvim-tree/nvim-tree.lua", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = {}, + keys = { { "<leader>e", "<cmd>NvimTreeToggle<cr>", desc = "File tree" } }, + }, + { + "hedyhli/outline.nvim", + opts = {}, + keys = { { "<leader>o", "<cmd>Outline<cr>", desc = "Code outline" } }, + }, + { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { "nvim-lua/plenary.nvim" }, + keys = { + { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" }, + { "<leader>fg", "<cmd>Telescope live_grep<cr>", desc = "Live grep" }, + { "<leader>fb", "<cmd>Telescope buffers<cr>", desc = "Buffers" }, + { "<leader>fh", "<cmd>Telescope help_tags<cr>", desc = "Help tags" }, + { "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent files" }, + { "<leader>fc", "<cmd>Telescope git_commits<cr>", desc = "Git commits" }, + { "<leader>fs", "<cmd>Telescope lsp_document_symbols<cr>", desc = "Document symbols" }, + }, + }, + { + "folke/flash.nvim", + event = "VeryLazy", + opts = {}, + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + }, + }, + + -- Editing ------------------------------------------------------------------- + { + "numToStr/Comment.nvim", + opts = {}, + keys = { + { "gcc", mode = "n", desc = "Comment line" }, + { "gc", mode = "v", desc = "Comment selection" }, + }, + }, + { + "kylechui/nvim-surround", + version = "^3", + event = "VeryLazy", + opts = {}, + }, + { "echasnovski/mini.ai", version = "*", opts = {} }, + + -- Diagnostics & Formatting -------------------------------------------------- + { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = {}, + keys = { + { "<leader>xx", "<cmd>Trouble diagnostics toggle<cr>", desc = "Diagnostics" }, + { "<leader>xX", "<cmd>Trouble diagnostics toggle filter.buf=0<cr>", desc = "Buffer diagnostics" }, + { "<leader>xq", "<cmd>Trouble quickfix toggle<cr>", desc = "Quickfix list" }, + }, + }, + { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, + keys = { + { "<leader>xt", "<cmd>Trouble todo toggle<cr>", desc = "Todo comments" }, + { "]t", function() require("todo-comments").jump_next() end, desc = "Next todo" }, + { "[t", function() require("todo-comments").jump_prev() end, desc = "Prev todo" }, + }, + }, + { + "stevearc/conform.nvim", + event = "BufWritePre", + keys = { + { "<leader>cf", function() require("conform").format({ async = true }) end, desc = "Format buffer" }, + }, + opts = { + formatters_by_ft = { + lua = { "stylua" }, + python = { "ruff_format", "ruff_fix" }, + javascript = { "prettier" }, + typescript = { "prettier" }, + javascriptreact = { "prettier" }, + typescriptreact = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + html = { "prettier" }, + css = { "prettier" }, + markdown = { "prettier" }, + ruby = { "rubocop" }, + sh = { "shfmt" }, + bash = { "shfmt" }, + zsh = { "shfmt" }, + }, + }, + }, + + -- Notes --------------------------------------------------------------------- + { "vimwiki/vimwiki" }, + +}) + +-------------------------------------------------------------------------------- +-- LSP Configuration +-------------------------------------------------------------------------------- +vim.lsp.config.pyright = { + cmd = { "pyright-langserver", "--stdio" }, + filetypes = { "python" }, + root_markers = { "pyproject.toml", "setup.py", "setup.cfg", "requirements.txt", ".git" }, + single_file_support = true, + settings = { + python = { + analysis = { + typeCheckingMode = "basic", + autoSearchPaths = false, + diagnosticMode = "openFilesOnly", + useLibraryCodeForTypes = false, + }, + }, + }, +} + +vim.lsp.config.solargraph = { + cmd = { "solargraph", "stdio" }, + filetypes = { "ruby" }, + root_markers = { "Gemfile", ".git" }, + single_file_support = true, +} + +vim.lsp.config.yamlls = { + cmd = { "yaml-language-server", "--stdio" }, + filetypes = { "yaml", "yaml.docker-compose", "yaml.gitlab" }, + root_markers = { ".git" }, + single_file_support = true, + settings = { + yaml = { + validate = true, + schemaStore = { enable = true, url = "https://www.schemastore.org/api/json/catalog.json" }, + }, + }, +} + +vim.lsp.config.taplo = { + cmd = { "taplo", "lsp", "stdio" }, + filetypes = { "toml" }, + root_markers = { ".git" }, + single_file_support = true, +} + +vim.lsp.config.lua_ls = { + cmd = { "lua-language-server" }, + filetypes = { "lua" }, + root_markers = { ".luarc.json", ".luarc.jsonc", ".git" }, + single_file_support = true, + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + workspace = { library = { vim.env.VIMRUNTIME } }, + telemetry = { enable = false }, + }, + }, +} + +vim.lsp.config.bashls = { + cmd = { "bash-language-server", "start" }, + filetypes = { "sh", "bash", "zsh" }, + root_markers = { ".git" }, + single_file_support = true, +} + +vim.lsp.config.jsonls = { + cmd = { "vscode-json-language-server", "--stdio" }, + filetypes = { "json", "jsonc" }, + root_markers = { ".git" }, + single_file_support = true, + settings = { + json = { + validate = { enable = true }, + schemaStore = { enable = true, url = "https://www.schemastore.org/api/json/catalog.json" }, + }, + }, +} + +vim.lsp.config.html = { + cmd = { "vscode-html-language-server", "--stdio" }, + filetypes = { "html", "templ" }, + root_markers = { ".git" }, + single_file_support = true, +} + +vim.lsp.config.cssls = { + cmd = { "vscode-css-language-server", "--stdio" }, + filetypes = { "css", "scss", "less" }, + root_markers = { ".git" }, + single_file_support = true, +} + +vim.lsp.config.ts_ls = { + cmd = { "typescript-language-server", "--stdio" }, + filetypes = { "javascript", "javascriptreact", "typescript", "typescriptreact" }, + root_markers = { "tsconfig.json", "jsconfig.json", "package.json", ".git" }, + single_file_support = true, +} + +vim.lsp.config.dockerls = { + cmd = { "docker-langserver", "--stdio" }, + filetypes = { "dockerfile" }, + root_markers = { "Dockerfile", ".git" }, + single_file_support = true, +} + +vim.lsp.config.clangd = { + cmd = { "clangd" }, + filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" }, + root_markers = { "compile_commands.json", "compile_flags.txt", ".clangd", ".git" }, + single_file_support = true, +} + +vim.lsp.enable("pyright") +vim.lsp.enable("solargraph") +vim.lsp.enable("yamlls") +vim.lsp.enable("taplo") +vim.lsp.enable("lua_ls") +vim.lsp.enable("bashls") +vim.lsp.enable("jsonls") +vim.lsp.enable("html") +vim.lsp.enable("cssls") +vim.lsp.enable("ts_ls") +vim.lsp.enable("dockerls") +vim.lsp.enable("clangd") + +-------------------------------------------------------------------------------- +-- Tabline styling +-------------------------------------------------------------------------------- +vim.api.nvim_set_hl(0, "TabLineSel", { fg = "#ffffff", bg = "#5a5a5a", bold = true }) +vim.api.nvim_set_hl(0, "TabLine", { fg = "#888888", bg = "#000000" }) +vim.api.nvim_set_hl(0, "TabLineFill", { bg = "#000000" }) + +-------------------------------------------------------------------------------- +-- Keymaps +-------------------------------------------------------------------------------- +vim.keymap.set("n", "<S-h>", "<cmd>tabprev<cr>", { desc = "Prev tab" }) +vim.keymap.set("n", "<S-l>", "<cmd>tabnext<cr>", { desc = "Next tab" }) + +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local map = function(key, fn, desc) + vim.keymap.set("n", key, fn, { buffer = args.buf, desc = desc }) + end + map("gd", vim.lsp.buf.definition, "Go to definition") + map("gr", vim.lsp.buf.references, "References") + map("K", vim.lsp.buf.hover, "Hover docs") + map("<leader>rn", vim.lsp.buf.rename, "Rename symbol") + map("<leader>ca", vim.lsp.buf.code_action, "Code action") + map("<leader>ds", vim.lsp.buf.document_symbol, "Document symbols") + end, +}) diff --git a/packages/debian.txt b/packages/debian.txt index c8338b6..cc6c379 100644 --- a/packages/debian.txt +++ b/packages/debian.txt @@ -2,15 +2,18 @@ build-essential cmake colordiff dh-autoreconf +etckeeper git htop lsof mosh multitail +neovim pigz renameutils stow tmux +units vim xinput zsh diff --git a/packages/macos-macports.txt b/packages/macos-macports.txt new file mode 100644 index 0000000..f80bea9 --- /dev/null +++ b/packages/macos-macports.txt @@ -0,0 +1,30 @@ +alacritty +autoconf +automake +btop +cmake +colordiff +fzf +gnupg2 +htop +isync +jq +k9s +md5sha1sum +mosh +mpv +multitail +mutt +neovim +notmuch +pigz +renameutils +stern +stow +terraform +texlive-latex +tmux +vim +vlc +w3m +zsh diff --git a/vim/.vim/bundle/endwise b/vim/.vim/bundle/endwise -Subproject bf90d8be447de667f4532b934d1a70881be56dd +Subproject eab530110d7a0d985902a3964894816b50dbf31 diff --git a/vim/.vim/bundle/lightline b/vim/.vim/bundle/lightline -Subproject f4fa096a67afbe593bd53cf618850c32512b5d4 +Subproject e358557e1a9f9fc860416c8eb2e34c040407815 diff --git a/vim/.vim/bundle/nerdcommenter b/vim/.vim/bundle/nerdcommenter -Subproject 24df32304e20677ab061115e7bc8a37f382c60e +Subproject 02a3b6455fa07b61b9440a78732f1e9b7876c99 diff --git a/vim/.vim/bundle/pathogen b/vim/.vim/bundle/pathogen -Subproject a553410f1bdb9000fbc764069f3a5ec3454a02b +Subproject ac4dd9494fa9008754e49dff85bff1b5746c89b diff --git a/vim/.vim/bundle/supertab b/vim/.vim/bundle/supertab -Subproject 40fe711e088e2ab346738233dd5adbb1be35517 +Subproject f0093ae12a9115498f887199809a6114659fc85 diff --git a/vim/.vim/bundle/tagbar b/vim/.vim/bundle/tagbar -Subproject 3753b235a1163cfbc3b7c417825d1910b2f6610 +Subproject 2ef4ecba94440fcf8a8c692a0f2b36b332f1f0f diff --git a/vim/.vim/bundle/vimwiki b/vim/.vim/bundle/vimwiki -Subproject b90e6f2e3343277faca65156d733f725f76f1e5 +Subproject 72792615e739d0eb54a9c8f7e0a46a6e2407c9e @@ -4,7 +4,6 @@ execute pathogen#infect() " settings set nocompatible set nu -set noet set showcmd set autoindent set smartindent @@ -196,7 +196,7 @@ if [[ $? == 0 ]]; then maybe_add_dir_to_path $HOME/.R fi -export EDITOR='vim -p' +export EDITOR='nvim -p' alias qmv='qmv -evim -fdo' export LC_ALL=en_US.UTF-8 |
