diff options
| author | ottjk <joshott16@gmail.com> | 2023-12-30 19:23:04 -0500 |
|---|---|---|
| committer | ottjk <joshott16@gmail.com> | 2023-12-30 19:23:04 -0500 |
| commit | ed46f1c5e82709417085b1a3b7708b209c5f4bfe (patch) | |
| tree | d7eb3f2b4b00e75e5f10199e1cbff959c355b312 | |
| download | dotfiles-ed46f1c5e82709417085b1a3b7708b209c5f4bfe.tar.gz dotfiles-ed46f1c5e82709417085b1a3b7708b209c5f4bfe.zip | |
initial commit
44 files changed, 2588 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..96bf7ed --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# dotfiles diff --git a/configs.toml b/configs.toml new file mode 100644 index 0000000..2248d39 --- /dev/null +++ b/configs.toml @@ -0,0 +1,51 @@ +[nvim] +file = "nvim" +parent = "~/.config" + +[kanata] +file = "/home/josh/.config" +parent = "keybs" + +[tex] +file = "texmf" +parent = "~/" + +[tofi] +file = "tofi" +parent = "~/.config" + +[vim] +file = ".vimrc" +parent = "~/" + +[zathura] +file = "zathura" +parent = "~/.config" + +[dunst] +file = "dunst" +parent = "~/.config" + +[xplr] +file = "/home/josh/.config" +parent = "xplr" + +[fish] +file = "fish" +parent = "~/.config" + +[swaylock] +file = "swaylock" +parent = "~/.config" + +[sway] +file = "sway" +parent = "~/.config" + +[waybar] +file = "waybar" +parent = "~/.config" + +[wezterm] +file = ".wezterm.lua" +parent = "~/" diff --git a/dunst/dunstrc b/dunst/dunstrc new file mode 100644 index 0000000..28de7cb --- /dev/null +++ b/dunst/dunstrc @@ -0,0 +1,442 @@ +# See dunst(5) for all configuration options + +[global] + ### Display ### + + # Which monitor should the notifications be displayed on. + monitor = 0 + + # Display notification on focused monitor. Possible modes are: + # mouse: follow mouse pointer + # keyboard: follow window with keyboard focus + # none: don't follow anything + # + # "keyboard" needs a window manager that exports the + # _NET_ACTIVE_WINDOW property. + # This should be the case for almost all modern window managers. + # + # If this option is set to mouse or keyboard, the monitor option + # will be ignored. + follow = none + + ### Geometry ### + + # dynamic width from 0 to 300 + # width = (0, 300) + # constant width of 300 + width = 300 + + # The maximum height of a single notification, excluding the frame. + height = 300 + + # Position the notification in the top right corner + origin = top-right + + # Offset from the origin + offset = 10x50 + + # Scale factor. It is auto-detected if value is 0. + scale = 0 + + # Maximum number of notification (0 means no limit) + notification_limit = 20 + + ### Progress bar ### + + # Turn on the progess bar. It appears when a progress hint is passed with + # for example dunstify -h int:value:12 + progress_bar = true + + # Set the progress bar height. This includes the frame, so make sure + # it's at least twice as big as the frame width. + progress_bar_height = 10 + + # Set the frame width of the progress bar + progress_bar_frame_width = 1 + + # Set the minimum width for the progress bar + progress_bar_min_width = 150 + + # Set the maximum width for the progress bar + progress_bar_max_width = 300 + + # Corner radius for the progress bar. 0 disables rounded corners. + progress_bar_corner_radius = 0 + + # Corner radius for the icon image. + icon_corner_radius = 0 + + # Show how many messages are currently hidden (because of + # notification_limit). + indicate_hidden = yes + + # The transparency of the window. Range: [0; 100]. + # This option will only work if a compositing window manager is + # present (e.g. xcompmgr, compiz, etc.). (X11 only) + transparency = 0 + + # Draw a line of "separator_height" pixel height between two + # notifications. + # Set to 0 to disable. + # If gap_size is greater than 0, this setting will be ignored. + separator_height = 2 + + # Padding between text and separator. + padding = 8 + + # Horizontal padding. + horizontal_padding = 8 + + # Padding between text and icon. + text_icon_padding = 0 + + # Defines width in pixels of frame around the notification window. + # Set to 0 to disable. + frame_width = 3 + + # Size of gap to display between notifications - requires a compositor. + # If value is greater than 0, separator_height will be ignored and a border + # of size frame_width will be drawn around each notification instead. + # Click events on gaps do not currently propagate to applications below. + gap_size = 0 + + # Sort messages by urgency. + sort = yes + + # Don't remove messages, if the user is idle (no mouse or keyboard input) + # for longer than idle_threshold seconds. + # Set to 0 to disable. + # A client can set the 'transient' hint to bypass this. See the rules + # section for how to disable this if necessary + # idle_threshold = 120 + + ### Text ### + + font = FiraCode 11 + + # The spacing between lines. If the height is smaller than the + # font height, it will get raised to the font height. + line_height = 0 + + # Possible values are: + # full: Allow a small subset of html markup in notifications: + # <b>bold</b> + # <i>italic</i> + # <s>strikethrough</s> + # <u>underline</u> + # + # For a complete reference see + # <https://docs.gtk.org/Pango/pango_markup.html>. + # + # strip: This setting is provided for compatibility with some broken + # clients that send markup even though it's not enabled on the + # server. Dunst will try to strip the markup but the parsing is + # simplistic so using this option outside of matching rules for + # specific applications *IS GREATLY DISCOURAGED*. + # + # no: Disable markup parsing, incoming notifications will be treated as + # plain text. Dunst will not advertise that it has the body-markup + # capability if this is set as a global setting. + # + # It's important to note that markup inside the format option will be parsed + # regardless of what this is set to. + markup = full + + # The format of the message. Possible variables are: + # %a appname + # %s summary + # %b body + # %i iconname (including its path) + # %I iconname (without its path) + # %p progress value if set ([ 0%] to [100%]) or nothing + # %n progress value if set without any extra characters + # %% Literal % + # Markup is allowed + format = "<b>%s</b>\n%b" + + # Alignment of message text. + # Possible values are "left", "center" and "right". + alignment = left + + # Vertical alignment of message text and icon. + # Possible values are "top", "center" and "bottom". + vertical_alignment = center + + # Show age of message if message is older than show_age_threshold + # seconds. + # Set to -1 to disable. + show_age_threshold = 60 + + # Specify where to make an ellipsis in long lines. + # Possible values are "start", "middle" and "end". + ellipsize = middle + + # Ignore newlines '\n' in notifications. + ignore_newline = no + + # Stack together notifications with the same content + stack_duplicates = true + + # Hide the count of stacked notifications with the same content + hide_duplicate_count = false + + # Display indicators for URLs (U) and actions (A). + show_indicators = yes + + ### Icons ### + + # Recursive icon lookup. You can set a single theme, instead of having to + # define all lookup paths. + enable_recursive_icon_lookup = true + + # Set icon theme (only used for recursive icon lookup) + icon_theme = Adwaita + # You can also set multiple icon themes, with the leftmost one being used first. + # icon_theme = "Adwaita, breeze" + + # Align icons left/right/top/off + icon_position = left + + # Scale small icons up to this size, set to 0 to disable. Helpful + # for e.g. small files or high-dpi screens. In case of conflict, + # max_icon_size takes precedence over this. + min_icon_size = 32 + + # Scale larger icons down to this size, set to 0 to disable + max_icon_size = 128 + + # Paths to default icons (only neccesary when not using recursive icon lookup) + icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ + + ### History ### + + # Should a notification popped up from history be sticky or timeout + # as if it would normally do. + sticky_history = yes + + # Maximum amount of notifications kept in history + history_length = 20 + + ### Misc/Advanced ### + + # dmenu path. + dmenu = /usr/bin/dmenu -p dunst: + + # Browser for opening urls in context menu. + browser = /usr/bin/xdg-open + + # Always run rule-defined scripts, even if the notification is suppressed + always_run_script = true + + # Define the title of the windows spawned by dunst + title = Dunst + + # Define the class of the windows spawned by dunst + class = Dunst + + # Define the corner radius of the notification window + # in pixel size. If the radius is 0, you have no rounded + # corners. + # The radius will be automatically lowered if it exceeds half of the + # notification height to avoid clipping text and/or icons. + corner_radius = 0 + + # Ignore the dbus closeNotification message. + # Useful to enforce the timeout set by dunst configuration. Without this + # parameter, an application may close the notification sent before the + # user defined timeout. + ignore_dbusclose = false + + ### Wayland ### + # These settings are Wayland-specific. They have no effect when using X11 + + # Uncomment this if you want to let notications appear under fullscreen + # applications (default: overlay) + # layer = top + + # Set this to true to use X11 output on Wayland. + force_xwayland = false + + ### Legacy + + # Use the Xinerama extension instead of RandR for multi-monitor support. + # This setting is provided for compatibility with older nVidia drivers that + # do not support RandR and using it on systems that support RandR is highly + # discouraged. + # + # By enabling this setting dunst will not be able to detect when a monitor + # is connected or disconnected which might break follow mode if the screen + # layout changes. + force_xinerama = false + + ### mouse + + # Defines list of actions for each mouse event + # Possible values are: + # * none: Don't do anything. + # * do_action: Invoke the action determined by the action_name rule. If there is no + # such action, open the context menu. + # * open_url: If the notification has exactly one url, open it. If there are multiple + # ones, open the context menu. + # * close_current: Close current notification. + # * close_all: Close all notifications. + # * context: Open context menu for the notification. + # * context_all: Open context menu for all notifications. + # These values can be strung together for each mouse event, and + # will be executed in sequence. + mouse_left_click = close_current + mouse_middle_click = do_action, close_current + mouse_right_click = close_all + + frame_color = "#EBA0AC" + separator_color= frame + +# Experimental features that may or may not work correctly. Do not expect them +# to have a consistent behaviour across releases. +[experimental] + # Calculate the dpi to use on a per-monitor basis. + # If this setting is enabled the Xft.dpi value will be ignored and instead + # dunst will attempt to calculate an appropriate dpi value for each monitor + # using the resolution and physical size. This might be useful in setups + # where there are multiple screens with very different dpi values. + per_monitor_dpi = false + +[urgency_low] + background = "#1E1E2E" + foreground = "#CDD6F4" + timeout = 10 + +[urgency_normal] + background = "#1E1E2E" + foreground = "#CDD6F4" + timeout = 10 + +[urgency_critical] + background = "#1E1E2E" + foreground = "#CDD6F4" + frame_color = "#FAB387" + timeout = 10 + +# Every section that isn't one of the above is interpreted as a rules to +# override settings for certain messages. +# +# Messages can be matched by +# appname (discouraged, see desktop_entry) +# body +# category +# desktop_entry +# icon +# match_transient +# msg_urgency +# stack_tag +# summary +# +# and you can override the +# background +# foreground +# format +# frame_color +# fullscreen +# new_icon +# set_stack_tag +# set_transient +# set_category +# timeout +# urgency +# icon_position +# skip_display +# history_ignore +# action_name +# word_wrap +# ellipsize +# alignment +# hide_text +# +# Shell-like globbing will get expanded. +# +# Instead of the appname filter, it's recommended to use the desktop_entry filter. +# GLib based applications export their desktop-entry name. In comparison to the appname, +# the desktop-entry won't get localized. +# +# SCRIPTING +# You can specify a script that gets run when the rule matches by +# setting the "script" option. +# The script will be called as follows: +# script appname summary body icon urgency +# where urgency can be "LOW", "NORMAL" or "CRITICAL". +# +# NOTE: It might be helpful to run dunst -print in a terminal in order +# to find fitting options for rules. + +# Disable the transient hint so that idle_threshold cannot be bypassed from the +# client +#[transient_disable] +# match_transient = yes +# set_transient = no +# +# Make the handling of transient notifications more strict by making them not +# be placed in history. +#[transient_history_ignore] +# match_transient = yes +# history_ignore = yes + +# fullscreen values +# show: show the notifications, regardless if there is a fullscreen window opened +# delay: displays the new notification, if there is no fullscreen window active +# If the notification is already drawn, it won't get undrawn. +# pushback: same as delay, but when switching into fullscreen, the notification will get +# withdrawn from screen again and will get delayed like a new notification +#[fullscreen_delay_everything] +# fullscreen = delay +#[fullscreen_show_critical] +# msg_urgency = critical +# fullscreen = show + +#[espeak] +# summary = "*" +# script = dunst_espeak.sh + +#[script-test] +# summary = "*script*" +# script = dunst_test.sh + +#[ignore] +# # This notification will not be displayed +# summary = "foobar" +# skip_display = true + +#[history-ignore] +# # This notification will not be saved in history +# summary = "foobar" +# history_ignore = yes + +#[skip-display] +# # This notification will not be displayed, but will be included in the history +# summary = "foobar" +# skip_display = yes + +#[signed_on] +# appname = Pidgin +# summary = "*signed on*" +# urgency = low +# +#[signed_off] +# appname = Pidgin +# summary = *signed off* +# urgency = low +# +#[says] +# appname = Pidgin +# summary = *says* +# urgency = critical +# +#[twitter] +# appname = Pidgin +# summary = *twitter.com* +# urgency = normal +# +#[stack-volumes] +# appname = "some_volume_notifiers" +# set_stack_tag = "volume" +# +# vim: ft=cfg diff --git a/fish/config.fish b/fish/config.fish new file mode 100644 index 0000000..a8159eb --- /dev/null +++ b/fish/config.fish @@ -0,0 +1,23 @@ +fish_add_path -p /usr/local/sbin /usr/local/bin /usr/bin + +set -e TERMCAP +set -e MANPATH + +pyenv init - | source +zoxide init fish | source +starship init fish | source + +function xcd + set --local result (command xplr $argv) + [ -n "$result" ] && cd "$result" +end + +if status is-interactive + alias ls='eza' + alias cd='z' + alias grep='grep --color=auto' + alias nv=nvim + + fish_add_path -p ~/.cargo/bin ~/.local/bin + pfetch +end diff --git a/fish/fish_variables b/fish/fish_variables new file mode 100644 index 0000000..f4539c1 --- /dev/null +++ b/fish/fish_variables @@ -0,0 +1,38 @@ +# This file contains fish universal variable definitions. +# VERSION: 3.0 +SETUVAR --export EDITOR:nvim +SETUVAR --export PF_INFO:ascii\x20title\x20os\x20uptime\x20pkgs\x20memory +SETUVAR --export PYENV_ROOT:/home/josh/\x2epyenv +SETUVAR --export VISUAL:nvim +SETUVAR --export XDG_SCREENSHOTS_DIR:/home/josh/Pictures/screenshots +SETUVAR __fish_initialized:3400 +SETUVAR _fisher_upgraded_to_4_4:\x1d +SETUVAR fish_color_autosuggestion:555\x1ebrblack +SETUVAR fish_color_cancel:\x2dr +SETUVAR fish_color_command:blue +SETUVAR fish_color_comment:red +SETUVAR fish_color_cwd:green +SETUVAR fish_color_cwd_root:red +SETUVAR fish_color_end:green +SETUVAR fish_color_error:brred +SETUVAR fish_color_escape:brcyan +SETUVAR fish_color_history_current:\x2d\x2dbold +SETUVAR fish_color_host:normal +SETUVAR fish_color_host_remote:yellow +SETUVAR fish_color_normal:normal +SETUVAR fish_color_operator:brcyan +SETUVAR fish_color_param:cyan +SETUVAR fish_color_quote:yellow +SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold +SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack +SETUVAR fish_color_status:red +SETUVAR fish_color_user:brgreen +SETUVAR fish_color_valid_path:\x2d\x2dunderline +SETUVAR fish_key_bindings:fish_default_key_bindings +SETUVAR fish_pager_color_completion:normal +SETUVAR fish_pager_color_description:B3A06D\x1eyellow\x1e\x2di +SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline +SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan +SETUVAR fish_pager_color_selected_background:\x2dr +SETUVAR fish_user_paths:/home/josh/\x2ecargo/bin\x1e/home/josh/\x2elocal/bin\x1e/home/josh/git\x1e/usr/local/sbin\x1e/usr/local/bin\x1e/usr/bin diff --git a/keybs b/keybs new file mode 160000 +Subproject f5e92f2aca679c1a5c296ca915f20db0c38d11f diff --git a/nvim/.nextcloudsync.log b/nvim/.nextcloudsync.log new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/nvim/.nextcloudsync.log diff --git a/nvim/.sync_bdd2e5b09f19.db b/nvim/.sync_bdd2e5b09f19.db Binary files differnew file mode 100644 index 0000000..b574f1f --- /dev/null +++ b/nvim/.sync_bdd2e5b09f19.db diff --git a/nvim/.sync_bdd2e5b09f19.db-shm b/nvim/.sync_bdd2e5b09f19.db-shm Binary files differnew file mode 100644 index 0000000..5220237 --- /dev/null +++ b/nvim/.sync_bdd2e5b09f19.db-shm diff --git a/nvim/.sync_bdd2e5b09f19.db-wal b/nvim/.sync_bdd2e5b09f19.db-wal Binary files differnew file mode 100644 index 0000000..628d756 --- /dev/null +++ b/nvim/.sync_bdd2e5b09f19.db-wal diff --git a/nvim/after/plugin/bufdel.lua b/nvim/after/plugin/bufdel.lua new file mode 100644 index 0000000..12d097f --- /dev/null +++ b/nvim/after/plugin/bufdel.lua @@ -0,0 +1,3 @@ +require('bufdel').setup { + quit = false, -- quit Neovim when last buffer is closed +} diff --git a/nvim/after/plugin/bufferline.lua b/nvim/after/plugin/bufferline.lua new file mode 100644 index 0000000..53db4f3 --- /dev/null +++ b/nvim/after/plugin/bufferline.lua @@ -0,0 +1,22 @@ +vim.cmd.colorscheme "catppuccin" +vim.opt.termguicolors = true + +require("bufferline").setup({ + options = { + offsets = { + { + filetype = "undotree", + text = "Undo Zone", + text_align = "center", + separator = true + } + }, + show_buffer_icons = true, -- disable filetype icons for buffers + separator_style = "thick", + hover = { + enabled = true, + delay = 200, + reveal = {'close'} + }, + } +}) diff --git a/nvim/after/plugin/lsp.lua b/nvim/after/plugin/lsp.lua new file mode 100644 index 0000000..2db301b --- /dev/null +++ b/nvim/after/plugin/lsp.lua @@ -0,0 +1,58 @@ +local lspconfig = require('lspconfig') +local lsp_defaults = lspconfig.util.default_config + +lsp_defaults.capabilities = vim.tbl_deep_extend( + 'force', + lsp_defaults.capabilities, + require('cmp_nvim_lsp').default_capabilities() +) + +vim.api.nvim_create_autocmd('LspAttach', { + desc = 'LSP actions', + callback = function(event) + -- Enable completion triggered by <c-x><c-o> + vim.api.nvim_buf_set_option(event.buf, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local bufopts = { noremap=true, silent=true, buffer=event.buf } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) + vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts) + vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, bufopts) + vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, bufopts) + vim.keymap.set('n', '<leader>wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, bufopts) + vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts) + vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts) + vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, bufopts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) + vim.keymap.set('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, bufopts) + end +}) + +require('mason').setup() +require('mason-lspconfig').setup({ + ensure_installed = { + 'julials', + } +}) + +require("mason-lspconfig").setup_handlers { + function (server_name) + lspconfig[server_name].setup {} + end, + + ["julials"] = function () + lspconfig.julials.setup { + on_attach = on_attach, + julia_env_path = "/home/josh/.julia/environments/v1.9/", + filetypes = { "julia", "jl" }, + single_file_support = true + } + end +} + diff --git a/nvim/after/plugin/luasnip.lua b/nvim/after/plugin/luasnip.lua new file mode 100644 index 0000000..140d9b2 --- /dev/null +++ b/nvim/after/plugin/luasnip.lua @@ -0,0 +1,10 @@ +-- Somewhere in your Neovim startup, e.g. init.lua +require("luasnip").config.set_config({ -- Setting LuaSnip config + enable_autosnippets = true, + store_selection_keys = "<Tab>", + region_check_events = 'InsertEnter', + delete_check_events = 'InsertLeave' +}) + +-- Load all snippets from the nvim/LuaSnip directory at startup +require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/snips/"}) diff --git a/nvim/after/plugin/markdown-preview.lua b/nvim/after/plugin/markdown-preview.lua new file mode 100644 index 0000000..65170e6 --- /dev/null +++ b/nvim/after/plugin/markdown-preview.lua @@ -0,0 +1,6 @@ +vim.cmd([[ + function OpenMarkdownPreview (url) + execute "silent ! firefox --new-window " . a:url + endfunction + let g:mkdp_browserfunc = 'OpenMarkdownPreview' +]]) diff --git a/nvim/after/plugin/nvim-cmp.lua b/nvim/after/plugin/nvim-cmp.lua new file mode 100644 index 0000000..40cb605 --- /dev/null +++ b/nvim/after/plugin/nvim-cmp.lua @@ -0,0 +1,74 @@ +local cmp = require'cmp' +local luasnip = require'luasnip' + +local check_backspace = function() + local col = vim.fn.col "." - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" +end + +cmp.setup.filetype({ 'tex' } , { + enabled = false +}) + +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = cmp.mapping.preset.insert({ + ['<C-b>'] = cmp.mapping.scroll_docs(-4), + ['<C-f>'] = cmp.mapping.scroll_docs(4), + ['<C-Space>'] = cmp.mapping.complete(), + ['<C-c>'] = cmp.mapping.abort(), + ['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + ["<Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif check_backspace() then + fallback() + else + fallback() + end + end, { "i", "s", }), + ["<S-Tab>"] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s", }), + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + }, { + { name = 'buffer' }, + { name = 'path' }, + { name = 'luasnip', option = { use_show_condition = false } }, + }) +}) + +-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } +}) + +-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) +}) diff --git a/nvim/after/plugin/nvim-markdown.lua b/nvim/after/plugin/nvim-markdown.lua new file mode 100644 index 0000000..c11d7ca --- /dev/null +++ b/nvim/after/plugin/nvim-markdown.lua @@ -0,0 +1,9 @@ +vim.g.vim_markdown_conceal = 2 +vim.g.vim_markdown_math = 1 +vim.g.vim_markdown_toc_autofit = 1 + +local map = vim.keymap.set; +local opts = { noremap = false, silent = true} + +map('', 'o', '<Plug>Markdown_NewLineBelow<Esc>', opts) +map('', 'O', '<Plug>Markdown_NewLineAbove<Esc>', opts) diff --git a/nvim/after/plugin/oil.lua b/nvim/after/plugin/oil.lua new file mode 100644 index 0000000..f2a2c7d --- /dev/null +++ b/nvim/after/plugin/oil.lua @@ -0,0 +1,48 @@ +require("oil").setup({ + -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) + -- Set to false if you still want to use netrw. + default_file_explorer = true, + -- Id is automatically added at the beginning, and name at the end + -- See :help oil-columns + columns = { + "icon", + -- "permissions", + -- "size", + -- "mtime", + }, + -- Buffer-local options to use for oil buffers + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash) + delete_to_trash = true, + -- Skip the confirmation popup for simple operations + skip_confirm_for_simple_edits = false, + -- Selecting a new/moved/renamed file or directory will prompt you to save changes first + prompt_save_on_select_new_entry = true, + -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap + -- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true }) + -- Additionally, if it is a string that matches "actions.<name>", + -- it will use the mapping at require("oil.actions").<name> + -- Set to `false` to remove a keymap + -- See :help oil-actions for a list of all available actions + keymaps = { + ["g?"] = "actions.show_help", + ["<CR>"] = "actions.select", + ["<C-s>"] = "actions.select_vsplit", + ["<C-h>"] = "actions.select_split", + ["<C-t>"] = "actions.select_tab", + ["<C-p>"] = "actions.preview", + ["<C-c>"] = "actions.close", + ["<C-l>"] = "actions.refresh", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = "actions.tcd", + ["gs"] = "actions.change_sort", + ["g."] = "actions.toggle_hidden", + }, + -- Set to false to disable all of the above keymaps + use_default_keymaps = true, +}) diff --git a/nvim/after/plugin/treesitter.lua b/nvim/after/plugin/treesitter.lua new file mode 100644 index 0000000..268e901 --- /dev/null +++ b/nvim/after/plugin/treesitter.lua @@ -0,0 +1,21 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "julia", "rust" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + enable = true, + + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = true, + }, +} diff --git a/nvim/after/plugin/vimtex.lua b/nvim/after/plugin/vimtex.lua new file mode 100644 index 0000000..c2b2276 --- /dev/null +++ b/nvim/after/plugin/vimtex.lua @@ -0,0 +1,14 @@ +vim.g.vimtex_view_general_viewer = 'zathura' +vim.g.vimtex_quickfix_open_on_warning = 0 +vim.g.vimtex_imaps_enabled = 0 +vim.cmd([[ +let g:vimtex_compiler_latexmk = { + \ 'options' : [ + \ '-verbose', + \ '-file-line-error', + \ '-synctex=1', + \ '-interaction=nonstopmode', + \ '-shell-escape', + \ ], + \} +]]) diff --git a/nvim/ftplugin/md.lua b/nvim/ftplugin/md.lua new file mode 100644 index 0000000..b90955c --- /dev/null +++ b/nvim/ftplugin/md.lua @@ -0,0 +1,5 @@ +local map = vim.keymap.set; +local opts = { noremap = false, silent = true} + +map('', 'o', '<Plug>Markdown_NewLineBelow<Esc>', opts) +map('', 'O', '<Plug>Markdown_NewLineAbove<Esc>', opts) diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..ed0fa45 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,5 @@ +require("plugins") +require("options") +require("keymaps") +require("commands") +require("colorscheme") diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json new file mode 100644 index 0000000..5ddc6d1 --- /dev/null +++ b/nvim/lazy-lock.json @@ -0,0 +1,31 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "118263867197a111717b5f13d954cd1ab8124387" }, + "bufferline.nvim": { "branch": "main", "commit": "6c456b888823d9e4832aa91c482bccd19445c009" }, + "catppuccin": { "branch": "main", "commit": "4fbab1f01488718c3d54034a473d0346346b90e3" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "feline.nvim": { "branch": "master", "commit": "3587f57480b88e8009df7b36dc84e9c7ff8f2c49" }, + "hop.nvim": { "branch": "master", "commit": "df0b5b693ef8c3d414b5b85e4bc11cea99c4958d" }, + "lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" }, + "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "56e435e09f8729af2d41973e81a0db440f8fe9c9" }, + "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, + "nvim-bufdel": { "branch": "main", "commit": "96c4f7ab053ddab0025bebe5f7c71e4795430e47" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-lspconfig": { "branch": "master", "commit": "9099871a7c7e1c16122e00d70208a2cd02078d80" }, + "nvim-markdown": { "branch": "master", "commit": "017b3644fd46f625bdeaa280a324ef75a4933b4f" }, + "nvim-treesitter": { "branch": "master", "commit": "27f68c0b6a87cbad900b3d016425450af8268026" }, + "nvim-web-devicons": { "branch": "master", "commit": "43aa2ddf476012a2155f5f969ee55ab17174da7a" }, + "oil.nvim": { "branch": "master", "commit": "523b61430cb7365f8f86609c2ea60e48456bac63" }, + "plenary.nvim": { "branch": "master", "commit": "55d9fe89e33efd26f532ef20223e5f9430c8b0c0" }, + "telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, + "undotree": { "branch": "master", "commit": "36ff7abb6b60980338344982ad4cdf03f7961ecd" }, + "vim-fugitive": { "branch": "master", "commit": "59659093581aad2afacedc81f009ed6a4bfad275" }, + "vim-visual-multi": { "branch": "master", "commit": "aec289a9fdabaa0ee6087d044d75b32e12084344" }, + "vimtex": { "branch": "master", "commit": "6179414f2eb3db977a513b7b19c23e7e62a0f388" }, + "zepl.vim": { "branch": "master", "commit": "e9e96b5307aa2e5e301d8d41220dcfd2712bc30e" } +}
\ No newline at end of file diff --git a/nvim/lua/colorscheme.lua b/nvim/lua/colorscheme.lua new file mode 100644 index 0000000..86e8b42 --- /dev/null +++ b/nvim/lua/colorscheme.lua @@ -0,0 +1,18 @@ +require("catppuccin").setup({ + flavour = "macchiato", + background = { + light = "latte", + dark = "macchiato", + }, + custom_highlights = function (colors) + return { + CursorLineNr = { fg = colors.flamingo }, + } + end, + integrations = { + cmp = true, + telescope = true, + }, +}) + +vim.cmd.colorscheme "catppuccin" diff --git a/nvim/lua/commands.lua b/nvim/lua/commands.lua new file mode 100644 index 0000000..8714158 --- /dev/null +++ b/nvim/lua/commands.lua @@ -0,0 +1,10 @@ +vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "*", + callback = function() + package.loaded["feline"] = nil + package.loaded["catppuccin.groups.integrations.feline"] = nil + require("feline").setup { + components = require("catppuccin.groups.integrations.feline").get(), + } + end, +}) diff --git a/nvim/lua/keymaps.lua b/nvim/lua/keymaps.lua new file mode 100644 index 0000000..0b72932 --- /dev/null +++ b/nvim/lua/keymaps.lua @@ -0,0 +1,85 @@ +local map = vim.keymap.set; +local builtin = require('telescope.builtin') +local opts = { noremap = true, silent = true} + +map('', '<Up>', 'gk', opts) +map('', '<Down>', 'gj', opts) +map('n', 'J', 'mzJ`z', opts) + +map('', 'o', 'o<Esc>', opts) +map('', 'O', 'O<Esc>', opts) + +map('i', '<C-Space>', '<Esc>', opts) +map('v', '<C-Space>', '<Esc>', opts) +map('t', '<C-Space>', '<C-\\><C-n>', opts) +map('v', '<PageDown>', ":m '>+1<CR>gv=gv", opts) +map('v', '<PageUp>', ":m '<-2<CR>gv=gv", opts) + +map('n', 'Q', '<nop>') + +-- +-- telescope +-- +map('n', '<leader>pf', builtin.find_files, {}) +map('n', '<leader>pg', function() + -- If the directory is not a git repository, fallback to regular find_files. + if pcall(builtin.git_files) then + else + pcall(builtin.find_files) + end +end, {}) +map('n', '<leader>fs', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) +end, {}) +-- + +map("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" }) +map('n', '<leader>u', vim.cmd.UndotreeToggle) +map('n', '<PageUp>', vim.cmd.BufferLineCycleNext) +map('n', '<PageDown>', vim.cmd.BufferLineCyclePrev) +map('n', '<leader>br', vim.cmd.BufDel) + +-- +-- window resizing +-- +-- map('n', '<S-Left>', ':vertical resize -2<CR>', { silent = true }) +-- map('n', '<S-Right>', ':vertical resize +2<CR>', { silent = true }) +-- map('n', '<S-Up>', ':resize +2<CR>', { silent = true }) +-- map('n', '<S-Down>', ':resize -2<CR>', { silent = true }) + +map('n', '<C-p>', ':MarkdownPreview<CR>', { silent = true }) + +map('x', 'p', '\"_dP') + +map('n', '<leader>y', '\"+y') +map('v', '<leader>y', '\"+y') +map('n', '<leader>Y', '\"+Y') + +map('n', '<leader>d', '\"+d') +map('v', '<leader>d', '\"+d') + +map('n', '<leader>js', ':vertical botright Repl julia<CR>') +map('n', '<leader>jr', function() + vim.cmd.ReplSend(string.format('include("%s")', vim.fn.expand('%:p'))) +end) +map('n', '<leader>j;', function() + vim.cmd.ReplSend(string.format('include("%s");', vim.fn.expand('%:p'))) +end) + +map('n', '<C-h>', vim.cmd.HopWord) + +map('n', '<leader>vv', vim.cmd.VimtexCompile) +map('n', '<leader>vc', ':VimtexClean!<CR>') + +map('i', '<C-f>', [[<Esc>: silent exec '.!inkscape-figures create "'.getline('.').'" "'.b:vimtex.root.'/figures/"'<CR><CR>:w<CR>]], opts) +map('n', '<C-f>', [[: silent exec '!inkscape-figures edit "'.b:vimtex.root.'/figures/" > /dev/null 2>&1 &'<CR><CR>:redraw!<CR>]], opts) + +vim.cmd([[ +" press <Tab> to expand or jump in a snippet. These can also be mapped separately +" via <Plug>luasnip-expand-snippet and <Plug>luasnip-jump-next. +imap <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>' +]]) + +map('i', '<S-Tab>', [[<cmd>lua require'luasnip'.jump(-1)<Cr>]], opts) +map('s', '<Tab>', [[<cmd>lua require('luasnip').jump(1)<Cr>]], opts) +map('s', '<Tab>', [[<cmd>lua require('luasnip').jump(-1)<Cr>]], opts) diff --git a/nvim/lua/luasnip-helpers.lua b/nvim/lua/luasnip-helpers.lua new file mode 100644 index 0000000..e912046 --- /dev/null +++ b/nvim/lua/luasnip-helpers.lua @@ -0,0 +1,41 @@ +local n = require("luasnip-nodes") +local utils = {} + +utils.get_visual = function(args, parent) + if (#parent.snippet.env.LS_SELECT_RAW > 0) then + return n.sn(nil, n.i(1, parent.snippet.env.LS_SELECT_RAW)) + else -- If LS_SELECT_RAW is empty, return a blank insert node + return n.sn(nil, n.i(1)) + end +end + +utils.in_mathzone = function() -- math context detection + return vim.fn['vimtex#syntax#in_mathzone']() == 1 +end +utils.in_text = function() + return not utils.in_mathzone() +end +utils.in_comment = function() -- comment detection + return vim.fn['vimtex#syntax#in_comment']() == 1 +end +utils.in_env = function(name) -- generic environment detection + local is_inside = vim.fn['vimtex#env#is_inside'](name) + return (is_inside[1] > 0 and is_inside[2] > 0) +end +-- A few concrete environments---adapt as needed +utils.in_equation = function() -- equation environment detection + return utils.in_env('equation') +end +utils.in_itemize = function() -- itemize environment detection + return utils.in_env('itemize') +end +utils.in_enumerate = function() -- itemize environment detection + return utils.in_env('enumerate') +end +utils.in_tikz = function() -- TikZ picture environment detection + return utils.in_env('tikzpicture') +end + +utils.line_begin = require("luasnip.extras.expand_conditions").line_begin + +return utils diff --git a/nvim/lua/luasnip-nodes.lua b/nvim/lua/luasnip-nodes.lua new file mode 100644 index 0000000..1b48f00 --- /dev/null +++ b/nvim/lua/luasnip-nodes.lua @@ -0,0 +1,31 @@ +local nodes = {} + +local ls = require("luasnip") +local extras = require("luasnip.extras") + +nodes.s = ls.snippet +nodes.sn = ls.snippet_node +nodes.isn = ls.indent_snippet_node +nodes.t = ls.text_node +nodes.i = ls.insert_node +nodes.f = ls.function_node +nodes.c = ls.choice_node +nodes.d = ls.dynamic_node +nodes.r = ls.restore_node +nodes.events = require("luasnip.util.events") +nodes.ai = require("luasnip.nodes.absolute_indexer") +nodes.l = extras.lambda +nodes.rep = extras.rep +nodes.p = extras.partial +nodes.m = extras.match +nodes.n = extras.nonempty +nodes.dl = extras.dynamic_lambda +nodes.fmt = require("luasnip.extras.fmt").fmt +nodes.fmta = require("luasnip.extras.fmt").fmta +nodes.conds = require("luasnip.extras.expand_conditions") +nodes.postfix = require("luasnip.extras.postfix").postfix +nodes.types = require("luasnip.util.types") +nodes.parse = require("luasnip.util.parser").parse_snippet +nodes.ms = ls.multi_snippet + +return nodes diff --git a/nvim/lua/options.lua b/nvim/lua/options.lua new file mode 100644 index 0000000..b555069 --- /dev/null +++ b/nvim/lua/options.lua @@ -0,0 +1,26 @@ +vim.opt.nu = true +vim.opt.relativenumber = true + +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 +vim.opt.expandtab = true + +vim.opt.smartindent = true + +vim.opt.wrap = false + +vim.opt.hlsearch = false +vim.opt.incsearch = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "no" +vim.opt.cursorline = true +vim.opt.cursorlineopt = "number" +vim.opt.isfname:append("@-@") + +vim.cmd "set undofile" + +vim.g.mapleader = ' ' + +vim.opt.guifont = "FiraCode:h10" diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua new file mode 100644 index 0000000..2fb9566 --- /dev/null +++ b/nvim/lua/plugins.lua @@ -0,0 +1,74 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + "nvim-tree/nvim-web-devicons", + "ojroques/nvim-bufdel", + "mbbill/undotree", + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "neovim/nvim-lspconfig", + 'hrsh7th/nvim-cmp', + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-buffer', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-cmdline', + 'saadparwaiz1/cmp_luasnip', + 'feline-nvim/feline.nvim', + 'tpope/vim-fugitive', + 'axvr/zepl.vim', + 'lervag/vimtex', + 'ixru/nvim-markdown', + 'mg979/vim-visual-multi', + 'stevearc/oil.nvim', + { + 'nvim-telescope/telescope.nvim', tag = '0.1.4', + dependencies = { 'nvim-lua/plenary.nvim' } + }, + { "catppuccin/nvim", name = "catppuccin" }, + { + 'akinsho/bufferline.nvim', version = "*", + dependencies = 'nvim-tree/nvim-web-devicons' + }, + { + "nvim-treesitter/nvim-treesitter", + build = function() + require("nvim-treesitter.install").update({ with_sync = true }) + end, + }, + { + "L3MON4D3/LuaSnip", + version = "v2.*", + build = "make install_jsregexp" + }, + { + 'numToStr/Comment.nvim', + opts = { + -- add any options here + }, + lazy = false, + }, + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + ft = { "markdown" }, + build = function() vim.fn["mkdp#util#install"]() end, + }, + { + "smoka7/hop.nvim", + version = "*", + config = function() + require("hop").setup({ keys = "tnseridhaofuwyplcqxz" }) + end, + }, +}) diff --git a/nvim/snips/tex/chunks.lua b/nvim/snips/tex/chunks.lua new file mode 100644 index 0000000..a48242e --- /dev/null +++ b/nvim/snips/tex/chunks.lua @@ -0,0 +1,210 @@ +local n = require("luasnip-nodes") +local h = require("luasnip-helpers") + +-- pump snippet input into wolframscript and get the output +-- if an error occurs, find out and redo snippet +local mathematica = function (_, snip) + local cmd = "'Check[ToString[" .. snip.captures[1] .. ", TeXForm], Exit[1]]'" + local output = string.sub(vim.fn.system("wolframscript -code " .. cmd), 1, -2) + if string.sub(output, -7, -1) ~= "$Failed" and vim.v.shell_error == 0 then + return n.sn(nil, n.t(output)) + else + print("there was an error") + return n.sn(nil, n.fmta("math " .. snip.captures[1] .. "<> math", { n.i(1) })) + end +end + +-- creates a matrix row as a snippet node +local rowGenerator = function (j, rows, columns) + local column = {} + local isSquare = rows == columns + for k=1,columns do + local digit = "0" + if isSquare and j==k then + digit = "1" + end + column[2*k-1] = n.i(k, digit) + column[2*k] = n.t(" & ") + end + column[2*columns] = n.t({ " \\\\", "\t" }) + if j==rows then + column[2*columns] = nil + end + return n.sn(j, column) +end + +-- creates a table row as a snippet node +local tableRowGenerator = function (j, rows, columns) + local column = {} + for k=1,columns do + column[2*k-1] = n.i(k) + column[2*k] = n.t(" & ") + end + column[2*columns] = n.t({ " \\\\ \\hline", "\t" }) + if j==rows then + column[2*columns] = n.t({ " \\\\ \\hline" }) + end + return n.sn(j, column) +end + +-- generates a matrix with dimensions as snippet capture groups +local matrix = function (_, snip) + local rows = tonumber(snip.captures[1]) + local columns = tonumber(snip.captures[2]) + local nodes = {} + for j=1,rows do + nodes[j] = rowGenerator(j, rows, columns) + end + return n.sn(1, nodes) +end + +-- generates a table with dimensions as snippet capture groups +local table = function (_, snip) + local rows = tonumber(snip.captures[1]) + local columns = tonumber(snip.captures[2]) + local nodes = {} + for j=1,rows do + nodes[j] = tableRowGenerator(j, rows, columns) + end + return n.sn(1, nodes) +end + +-- generates little partition definition thing for table environment +local tableCols = function (_, snip) + local columns = tonumber(snip.captures[2]) + local output = string.rep("|l", columns) + return output .. "|" +end + +-- turns identifier into enum prefix +local enumType = function (_, snip) + local type = snip.captures[1] + if type == "n" then + return "\\arabic*." + elseif type == "a" then + return "\\alph*)" + elseif type == "i" then + return "(\\roman*)" + end +end + +return { + -- environment + n.s({trig="beg", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{<>} + <> + \end{<>} + ]], + { n.i(1), n.i(0), n.rep(1) }), + { condition = h.line_begin }), + -- named environment + n.s({trig="beng", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{<>}[<>] + <> + \end{<>} + ]], + { n.i(1), n.i(2), n.i(0), n.rep(1) }), + { condition = h.line_begin }), + -- equation + n.s({trig="beq", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{equation} + <> + \end{equation} + ]], + { n.i(0) }), + { condition = h.line_begin }), + -- WIP plot snippet + n.s({trig="plot(", snippetType="autosnippet"}, + n.fmta( + "plot(<>) <> plot", + { n.i(1), n.i(2) }) + ), + -- mathematica snippet + n.s({trig="math", snippetType="autosnippet"}, + n.fmta("math <> math", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="math (.*) math", regTrig=true, wordTrig=false}, + { n.d(1, mathematica) }, + { condition = h.in_mathzone } + ), + -- bmatrix + n.s({trig="bm", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{bmatrix}{<>,<>} \end{bmatrix} + ]], + { n.i(1), n.i(2) }), + { condition = h.line_begin * h.in_mathzone }), + -- matrix with arbitrary brackets + n.s({trig="zmat", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{<>matrix}{<>,<>} \end{<>matrix} + ]], + { n.i(1), n.i(2), n.i(3), n.rep(1) }), + { condition = h.line_begin * h.in_mathzone }), + n.s({trig="\\begin{.matrix}{(%d+),(%d+)} \\end{(.)matrix}", regTrig=true, wordTrig=false}, + n.fmta( + [[ + \begin{<>matrix} + <> + \end{<>matrix} + ]], + { n.f(function(_, parent) return parent.captures[3] end), n.d(1, matrix), n.f(function(_, parent) return parent.captures[3] end) }), + { condition = h.in_mathzone }), + -- table + n.s({trig="tab", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{table}{<>,<>} \end{table} + ]], + { n.i(1), n.i(2) }), + { condition = h.line_begin }), + n.s({trig="\\begin{table}{(%d+),(%d+)} \\end{table}", regTrig=true, wordTrig=false}, + n.fmta( + [[ + \begin{tabular}{<>} + \hline + <> + \end{tabular} + ]], + { n.f(tableCols), n.d(1, table) })), + -- enum with n=numbers, a=alphas, or i=roman numerals + n.s({trig="enum([nai])", regTrig=true, snippetType="autosnippet"}, + n.fmta( + [[ + \begin{enumerate}[label=<>] + \item <> + \end{enumerate} + ]], + { n.f(enumType), n.i(0) }), + { condition = h.in_text * h.line_begin }), + -- itemize + n.s({trig="item", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{itemize} + \item <> + \end{itemize} + ]], + { n.i(0) }), + { condition = h.in_text * h.line_begin }), + -- split equation environment + n.s({trig="slt", snippetType="autosnippet"}, + n.fmta( + [[ + \begin{equation}\begin{split} + <> + \end{split}\end{equation} + ]], + { n.i(0) }), + { condition = h.in_text * h.line_begin }) +} diff --git a/nvim/snips/tex/electromagnetism.lua b/nvim/snips/tex/electromagnetism.lua new file mode 100644 index 0000000..cae57e6 --- /dev/null +++ b/nvim/snips/tex/electromagnetism.lua @@ -0,0 +1,9 @@ +local n = require("luasnip-nodes") +local h = require("luasnip-helpers") + +return { + n.s({trig=";rr", snippetType="autosnippet"}, + { n.t("\\scriptr") }, + { condition = h.in_mathzone } + ), +} diff --git a/nvim/snips/tex/expressions.lua b/nvim/snips/tex/expressions.lua new file mode 100644 index 0000000..2bb6d29 --- /dev/null +++ b/nvim/snips/tex/expressions.lua @@ -0,0 +1,211 @@ +local n = require("luasnip-nodes") +local h = require("luasnip-helpers") + +local closer = function (open) + if open == "(" then + return ")" + elseif open == "\\{" then + return "\\}" + elseif open == "{" then + return "}" + elseif open == "[" then + return "]" + elseif open == "|" then + return "|" + elseif open == "\\langle" then + return "\\rangle" + else + return nil + end +end + +local parens = function(_, parent) + local open = parent.captures[1] + + if open == "{" then open = "\\{" end + if open == "'a" then open = "\\langle" end + + local node = n.sn(1, + n.fmta("\\left<> <> \\right<>", + { n.t(open), n.i(1), n.t(closer(open)) }) + ) + return node +end + +return { + n.s({trig="'{", snippetType="autosnippet"}, + n.fmta("\\{ <> \\}", { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[\\left([\(\[\{|]|'a)]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet"}, + { n.d(1, parens) }, + { condition = h.in_mathzone } + ), + n.s({trig="'lf", snippetType="autosnippet"}, + { n.t("\\left") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ang", snippetType="autosnippet"}, + n.fmta("\\langle <> \\rangle", { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="dsum", snippetType="autosnippet", priority=200}, + n.fmta("\\sum_{<>=<>}^{<>}", + { n.i(1), n.i(2), n.i(3) }), + { condition = h.in_mathzone } + ), + n.s({trig="sum", snippetType="autosnippet", priority=100}, + { n.t("\\sum") }, + { condition = h.in_mathzone } + ), + n.s({trig="od", snippetType="autosnippet"}, + n.fmta("\\od[]{<>}{<>}", + { n.i(1), n.i(2) }), + { condition = h.in_mathzone } + ), + n.s({trig="oD", snippetType="autosnippet"}, + n.fmta("\\od[<>]{<>}{<>}", + { n.i(1), n.i(2), n.i(3) }), + { condition = h.in_mathzone } + ), + n.s({trig="pd", snippetType="autosnippet"}, + n.fmta("\\pd[]{<>}{<>} ", + { n.i(1), n.i(2) }), + { condition = h.in_mathzone } + ), + n.s({trig="pD", snippetType="autosnippet"}, + n.fmta("\\pd[<>]{<>}{<>} ", + { n.i(1), n.i(2), n.i(3) }), + { condition = h.in_mathzone } + ), + n.s({trig="dint", snippetType="autosnippet", priority=200}, + n.fmta("\\int_{<>}^{<>}", + { n.i(1, "-\\infty"), n.i(2, "\\infty") }), + { condition = h.in_mathzone } + ), + n.s({trig="int", snippetType="autosnippet", priority=100}, + { n.t("\\int") }, + { condition = h.in_mathzone } + ), + n.s({trig="oint", snippetType="autosnippet", priority=100}, + { n.t("\\oint") }, + { condition = h.in_mathzone } + ), + n.s({trig="doint", snippetType="autosnippet", priority=200}, + n.fmta("\\oint_{<>}^{<>}", + { n.i(1), n.i(2) }), + { condition = h.in_mathzone } + ), + n.s({trig="df", wordTrig=false, snippetType="autosnippet"}, + { n.t("\\diff") }, + { condition = h.in_mathzone } + ), + n.s({trig="pf", wordTrig=false, snippetType="autosnippet"}, + { n.t("\\pdiff") }, + { condition = h.in_mathzone } + ), + n.s({trig = "tii", snippetType="autosnippet"}, + n.fmta("\\textit{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_text } + ), + n.s({trig = "tbb", snippetType="autosnippet"}, + n.fmta("\\textbf{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_text } + ), + n.s({trig = "xb", snippetType="autosnippet"}, + n.fmta("\\text{\\textbf{<>}}", + { n.d(1, h.get_visual) }), + { condition = h.in_mathzone } + ), + n.s({trig = "tuu", snippetType="autosnippet"}, + n.fmta("\\underline{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_text } + ), + n.s({trig = "=", snippetType="autosnippet"}, + { n.t("\\item ") }, + { condition = h.in_itemize * h.line_begin } + ), + n.s({trig = "=", snippetType="autosnippet"}, + { n.t("\\item ") }, + { condition = h.in_enumerate * h.line_begin } + ), + n.s({trig = "ceil", snippetType="autosnippet"}, + n.fmta("\\left\\lceil <> \\right\\rceil", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig = "floor", snippetType="autosnippet"}, + n.fmta("\\left\\lfloor <> \\right\\rfloor", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="sr", snippetType="autosnippet", wordTrig=false}, + { n.t("^2") }, + { condition = h.in_mathzone } + ), + n.s({trig="cb", snippetType="autosnippet", wordTrig=false}, + { n.t("^3") }, + { condition = h.in_mathzone } + ), + n.s({trig="tf", snippetType="autosnippet", wordTrig=false}, + n.fmta("^{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig = "rf", wordTrig=false, snippetType="autosnippet"}, + n.fmta("_{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="vm", snippetType="autosnippet"}, + n.fmta("$<>$", + { n.i(1) }), + { condition = h.in_text } + ), + n.s({trig="dm", snippetType="autosnippet"}, + n.fmta( + [[ + \[ + <> + \] + <> + ]], + { n.i(1), n.i(0) }), + { condition = h.in_text } + ), + n.s({trig=[[([A-Za-z])(\d)]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=100}, + n.fmta("<>_<>", + { n.f(function(_, parent) return parent.captures[1] end), + n.f(function(_, parent) return parent.captures[2] end) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[([A-Za-z])_(\d{2})]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet"}, + n.fmta("<>_{<>}", + { n.f(function(_, parent) return parent.captures[1] end), + n.f(function(_, parent) return parent.captures[2] end) }), + { condition = h.in_mathzone } + ), + n.s({trig = "tx", snippetType="autosnippet"}, + n.fmta("\\text{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig = "sq", snippetType="autosnippet"}, + n.fmta("\\sqrt{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_mathzone } + ), + n.s({trig = "map", snippetType="autosnippet"}, + n.fmta("<> : <> \\to <>", + { n.i(1), n.i(2), n.i(0) }), + { condition = h.in_mathzone } + ), + n.s({trig = "eval", snippetType="autosnippet"}, + n.fmta("\\eval{<>}", + { n.d(1, h.get_visual) }), + { condition = h.in_mathzone } + ), +} diff --git a/nvim/snips/tex/symbols.lua b/nvim/snips/tex/symbols.lua new file mode 100644 index 0000000..d42c831 --- /dev/null +++ b/nvim/snips/tex/symbols.lua @@ -0,0 +1,353 @@ +local n = require("luasnip-nodes") +local h = require("luasnip-helpers") + +return { + n.s({trig="//", snippetType="autosnippet"}, + n.fmta("\\frac{<>}{<>}", + { n.i(1), n.i(2), }), + { condition = h.in_mathzone } + ), + n.s({trig="oo", snippetType="autosnippet"}, + { n.t("\\infty") }, + { condition = h.in_mathzone } + ), + n.s ({trig="sin", snippetType="autosnippet"}, + { n.t("\\sin") }, + { condition = h.in_mathzone } + ), + n.s ({trig="cos", snippetType="autosnippet"}, + { n.t("\\cos") }, + { condition = h.in_mathzone } + ), + n.s ({trig="tan", snippetType="autosnippet"}, + { n.t("\\tan") }, + { condition = h.in_mathzone } + ), + n.s ({trig="csc", snippetType="autosnippet"}, + { n.t("\\csc") }, + { condition = h.in_mathzone } + ), + n.s ({trig="sec", snippetType="autosnippet"}, + { n.t("\\sec") }, + { condition = h.in_mathzone } + ), + n.s ({trig="cot", snippetType="autosnippet"}, + { n.t("\\cot") }, + { condition = h.in_mathzone } + ), + n.s ({trig="ln", snippetType="autosnippet"}, + { n.t("\\ln") }, + { condition = h.in_mathzone } + ), + n.s({trig="inn", snippetType="autosnippet"}, + { n.t("\\in") }, + { condition = h.in_mathzone } + ), + n.s({trig="=>", snippetType="autosnippet"}, + { n.t("\\implies") }, + { condition = h.in_mathzone } + ), + n.s({trig="=<", snippetType="autosnippet"}, + { n.t("\\impliedby ") }, + { condition = h.in_mathzone } + ), + n.s({trig="iff", snippetType="autosnippet"}, + { n.t("\\iff") }, + { condition = h.in_mathzone } + ), + n.s({trig="NN", snippetType="autosnippet"}, + { n.t("\\N") } + ), + n.s({trig="RR", snippetType="autosnippet"}, + { n.t("\\R") } + ), + n.s({trig="ZZ", snippetType="autosnippet"}, + { n.t("\\Z") } + ), + n.s({trig="OO", snippetType="autosnippet"}, + { n.t("\\emptyset") } + ), + n.s({trig="QQ", snippetType="autosnippet"}, + { n.t("\\Q") } + ), + n.s({trig="CC", snippetType="autosnippet"}, + { n.t("\\C") } + ), + n.s({trig="EE", snippetType="autosnippet"}, + { n.t("\\exists") }, + { condition = h.in_mathzone } + ), + n.s({trig="AA", snippetType="autosnippet"}, + { n.t("\\forall") }, + { condition = h.in_mathzone } + ), + n.s({trig="<=", snippetType="autosnippet"}, + { n.t("\\le") }, + { condition = h.in_mathzone } + ), + n.s({trig=">=", snippetType="autosnippet"}, + { n.t("\\ge") }, + { condition = h.in_mathzone } + ), + n.s({trig="<<", snippetType="autosnippet"}, + { n.t("\\ll") }, + { condition = h.in_mathzone } + ), + n.s({trig=">>", snippetType="autosnippet"}, + { n.t("\\gg") }, + { condition = h.in_mathzone } + ), + n.s({trig="!=", snippetType="autosnippet"}, + { n.t("\\neq") }, + { condition = h.in_mathzone } + ), + n.s({trig="->", snippetType="autosnippet", priority=100}, + { n.t("\\to") }, + { condition = h.in_mathzone } + ), + n.s({trig="<->", snippetType="autosnippet", priority=200}, + { n.t("\\leftrightarrow") }, + { condition = h.in_mathzone } + ), + n.s({trig="!>", snippetType="autosnippet"}, + { n.t("\\mapsto") }, + { condition = h.in_mathzone } + ), + n.s({trig="stm", snippetType="autosnippet"}, + { n.t("\\setminus") }, + { condition = h.in_mathzone } + ), + n.s({trig="||", snippetType="autosnippet"}, + { n.t("\\mid") }, + { condition = h.in_mathzone } + ), + n.s({trig="**", snippetType="autosnippet"}, + { n.t("\\cdot") }, + { condition = h.in_mathzone } + ), + n.s({trig="xx", snippetType="autosnippet"}, + { n.t("\\times") }, + { condition = h.in_mathzone } + ), + n.s({trig="cc", snippetType="autosnippet"}, + { n.t("\\subseteq") }, + { condition = h.in_mathzone } + ), + n.s({trig="Nn", snippetType="autosnippet"}, + { n.t("\\cap") }, + { condition = h.in_mathzone } + ), + n.s({trig="UU", snippetType="autosnippet"}, + { n.t("\\cup") }, + { condition = h.in_mathzone } + ), + n.s({trig="bar", snippetType="autosnippet", priority=100}, + n.fmta("\\overline{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[((\\[a-zA-Z]+)|[A-Za-z0-9])bar]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=200}, + n.fmta("\\overline{<>}", + { n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + + n.s({trig="hat", snippetType="autosnippet", priority=100}, + n.fmta("\\hat{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[((\\[a-zA-Z]+)|[A-Za-z0-9])hat]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=200}, + n.fmta("\\hat{<>}", + { n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + + n.s({trig=[[!\?|\?!]], trigEngine="ecma", snippetType="autosnippet", priority=100}, + n.fmta("\\vec{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9])(!\?|\?!)]], trigEngine="ecma", wordTrig=false, snippetType="autosnippet", priority=200}, + n.fmta("\\vec{<>}", + { n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + + n.s({trig="t(o+)t", regTrig=true, snippetType="autosnippet", priority=100}, + n.fmta("\\<>ot{<>}", + { n.f(function(_, parent) return string.rep("d", string.len(parent.captures[1])) end), + n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig=[[(\\[a-zA-Z]+|[A-Za-z0-9]|\\[a-z]+\{\\?[A-Za-z0-9]+\})t(o+)t]], + wordTrig=false, trigEngine="ecma", snippetType="autosnippet", priority=200}, + n.fmta("\\<>ot{<>}", + { n.f(function(_, parent) return string.rep("d", string.len(parent.captures[2])) end), + n.f(function(_, parent) return parent.captures[1] end) }), + { condition = h.in_mathzone } + ), + + n.s({trig="mcal", snippetType="autosnippet"}, + n.fmta("\\mathcal{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="mbb", snippetType="autosnippet"}, + n.fmta("\\mathbb{<>}", + { n.i(1) }), + { condition = h.in_mathzone } + ), + n.s({trig="'hb", snippetType="autosnippet"}, + { n.t("\\hbar") }, + { condition = h.in_mathzone } + ), + n.s({trig="'pi", snippetType="autosnippet"}, + { n.t("\\pi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ph", snippetType="autosnippet"}, + { n.t("\\phi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Ph", snippetType="autosnippet"}, + { n.t("\\phi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'vp", snippetType="autosnippet"}, + { n.t("\\varphi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'th", snippetType="autosnippet"}, + { n.t("\\theta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Th", snippetType="autosnippet"}, + { n.t("\\Theta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Om", snippetType="autosnippet"}, + { n.t("\\Omega") }, + { condition = h.in_mathzone } + ), + n.s({trig="'om", snippetType="autosnippet"}, + { n.t("\\omega") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ep", snippetType="autosnippet"}, + { n.t("\\epsilon") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ta", snippetType="autosnippet"}, + { n.t("\\tau") }, + { condition = h.in_mathzone } + ), + n.s({trig="'rh", snippetType="autosnippet"}, + { n.t("\\rho") }, + { condition = h.in_mathzone } + ), + n.s({trig="del", snippetType="autosnippet"}, + { n.t("\\Del") }, + { condition = h.in_mathzone } + ), + n.s({trig="==", snippetType="autosnippet"}, + { n.t("\\equiv") }, + { condition = h.in_mathzone } + ), + n.s({trig="~~", snippetType="autosnippet"}, + { n.t("\\approx") }, + { condition = h.in_mathzone } + ), + n.s({trig="'de", snippetType="autosnippet"}, + { n.t("\\delta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'De", snippetType="autosnippet"}, + { n.t("\\Delta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'nu", snippetType="autosnippet"}, + { n.t("\\nu") }, + { condition = h.in_mathzone } + ), + n.s({trig="'mu", snippetType="autosnippet"}, + { n.t("\\mu") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ps", snippetType="autosnippet"}, + { n.t("\\psi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Ps", snippetType="autosnippet"}, + { n.t("\\Psi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ve", snippetType="autosnippet"}, + { n.t("\\varepsilon") }, + { condition = h.in_mathzone } + ), + n.s({trig="'al", snippetType="autosnippet"}, + { n.t("\\alpha") }, + { condition = h.in_mathzone } + ), + n.s({trig="'be", snippetType="autosnippet"}, + { n.t("\\beta") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ga", snippetType="autosnippet"}, + { n.t("\\gamma") }, + { condition = h.in_mathzone } + ), + n.s({trig="'Ga", snippetType="autosnippet"}, + { n.t("\\Gamma") }, + { condition = h.in_mathzone } + ), + n.s({trig="'la", snippetType="autosnippet"}, + { n.t("\\lambda") }, + { condition = h.in_mathzone } + ), + n.s({trig="'La", snippetType="autosnippet"}, + { n.t("\\Lambda") }, + { condition = h.in_mathzone } + ), + n.s({trig="'el", snippetType="autosnippet"}, + { n.t("\\ell") }, + { condition = h.in_mathzone } + ), + n.s({trig="'si", snippetType="autosnippet"}, + { n.t("\\sigma") }, + { condition = h.in_mathzone } + ), + n.s({trig="'xi", snippetType="autosnippet"}, + { n.t("\\xi") }, + { condition = h.in_mathzone } + ), + n.s({trig="'ci", snippetType="autosnippet"}, + { n.t("\\circ") }, + { condition = h.in_mathzone } + ), + n.s({trig="'dg", snippetType="autosnippet", wordTrig=false}, + { n.t("^{\\circ}") }, + { condition = h.in_mathzone } + ), + n.s({trig="oxx", snippetType="autosnippet"}, + { n.t("\\otimes") }, + { condition = h.in_mathzone } + ), + n.s({trig="opp", snippetType="autosnippet"}, + { n.t("\\oplus") }, + { condition = h.in_mathzone } + ), + n.s({trig="pm", snippetType="autosnippet"}, + { n.t("\\pm") }, + { condition = h.in_mathzone } + ), + n.s({trig="<|", snippetType="autosnippet"}, + { n.t("\\lhd") }, + { condition = h.in_mathzone } + ), + n.s({trig="|>", snippetType="autosnippet"}, + { n.t("\\rhd") }, + { condition = h.in_mathzone } + ), +} diff --git a/swaylock/config b/swaylock/config new file mode 100644 index 0000000..6b9889b --- /dev/null +++ b/swaylock/config @@ -0,0 +1,29 @@ +screenshots +clock +indicator +indicator-radius=100 +indicator-thickness=7 +effect-blur=7x5 +effect-vignette=0.8:0.8 +ring-color=363a4f +key-hl-color=f5a97f +bs-hl-color=ed8796 +text-color=cad3f5 +line-color=00000000 +inside-color=24273a88 +separator-color=00000000 +layout-bg-color=24273a88 +layout-text-color=cad3f5 +ring-clear-color=a6da95 +text-clear-color=a6da95 +inside-clear-color=24273a88 +ring-ver-color=c6a0f6 +text-ver-color=c6a0f6 +inside-ver-color=24273a88 +ring-wrong-color=ed8796 +text-wrong-color=ed8796 +inside-wrong-color=24273a88 +grace=4 +fade-in=0.2 +font=FiraCodeNerdFont +font-size=30 diff --git a/tofi/config b/tofi/config new file mode 100644 index 0000000..9c3770c --- /dev/null +++ b/tofi/config @@ -0,0 +1,19 @@ +width = 35% +height = 35% +border-width = 0 +outline-width = 0 +padding-left = 2% +padding-top = 2% +result-spacing = 25 +num-results = 5 +font = /usr/share/fonts/TTF/FiraCodeNerdFont-Regular.ttf +font-size = 18 +background-color = #181926fa +text-color = #cad3f5 +selection-color = #ed8796 +prompt-color = #8aadf4 +input-background = #363a4f +input-background-padding = 7 +input-background-corner-radius = 3 +clip-to-padding = false +corner-radius = 8 diff --git a/waybar/config b/waybar/config new file mode 100644 index 0000000..1e25cef --- /dev/null +++ b/waybar/config @@ -0,0 +1,174 @@ +{ + // "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar position (top|bottom|left|right) + "height": 30, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + "spacing": 4, // Gaps between modules (4px) + // Choose the order of the modules + "modules-left": ["sway/workspaces", "sway/mode", "sway/scratchpad", "custom/media"], + "modules-center": ["sway/window"], + "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "backlight", "network", "temperature", "keyboard-state", "sway/language", "battery", "battery#bat2", "clock", "tray"], + // "modules-right": ["mpd", "idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "sway/language", "battery", "battery#bat2", "clock", "tray"], + // Modules configuration + // "sway/workspaces": { + // "disable-scroll": true, + // "all-outputs": true, + // "format": "{name}: {icon}", + // "format-icons": { + // "1": "", + // "2": "", + // "3": "", + // "4": "", + // "5": "", + // "urgent": "", + // "focused": "", + // "default": "" + // } + // }, + "sway/window": { + "max-length": 60, + "icon": true + }, + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "" + } + }, + "sway/mode": { + "format": "<span style=\"italic\">{}</span>" + }, + "sway/scratchpad": { + "format": "{icon} {count}", + "show-empty": false, + "format-icons": ["", ""], + "tooltip": true, + "tooltip-format": "{app}: {title}" + }, + "mpd": { + "format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ", + "format-disconnected": "Disconnected ", + "format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ", + "unknown-tag": "N/A", + "interval": 2, + "consume-icons": { + "on": " " + }, + "random-icons": { + "off": "<span color=\"#f53c3c\"></span> ", + "on": " " + }, + "repeat-icons": { + "on": " " + }, + "single-icons": { + "on": "1 " + }, + "state-icons": { + "paused": "", + "playing": "" + }, + "tooltip-format": "MPD (connected)", + "tooltip-format-disconnected": "MPD (disconnected)" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + // "timezone": "America/New_York", + "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% ", + "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "format-wifi": "{essid} ({signalStrength}%) ", + "format-ethernet": "{ipaddr}/{cidr} ", + "tooltip-format": "{ifname} via {gwaddr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "Disconnected ⚠", + "format-alt": "{ifname}: {ipaddr}/{cidr}" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{volume}% {icon} {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "🎜" + }, + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + }, + "sway/language" : { + "format": "{shortDescription}" + } +} + diff --git a/waybar/macchiato.css b/waybar/macchiato.css new file mode 100644 index 0000000..6880473 --- /dev/null +++ b/waybar/macchiato.css @@ -0,0 +1,37 @@ +/* +* +* Catppuccin Macchiato palette +* Maintainer: rubyowo +* +*/ + +@define-color base #24273a; +@define-color mantle #1e2030; +@define-color crust #181926; + +@define-color text #cad3f5; +@define-color subtext0 #a5adcb; +@define-color subtext1 #b8c0e0; + +@define-color surface0 #363a4f; +@define-color surface1 #494d64; +@define-color surface2 #5b6078; + +@define-color overlay0 #6e738d; +@define-color overlay1 #8087a2; +@define-color overlay2 #939ab7; + +@define-color blue #8aadf4; +@define-color lavender #b7bdf8; +@define-color sapphire #7dc4e4; +@define-color sky #91d7e3; +@define-color teal #8bd5ca; +@define-color green #a6da95; +@define-color yellow #eed49f; +@define-color peach #f5a97f; +@define-color maroon #ee99a0; +@define-color red #ed8796; +@define-color mauve #c6a0f6; +@define-color pink #f5bde6; +@define-color flamingo #f0c6c6; +@define-color rosewater #f4dbd6; diff --git a/waybar/style.css b/waybar/style.css new file mode 100644 index 0000000..a0c0a32 --- /dev/null +++ b/waybar/style.css @@ -0,0 +1,315 @@ +@import "macchiato.css"; + +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: FiraCode Nerd Font, FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; +} + +window#waybar { + background-color: alpha(@base, 0); + /* border-bottom: 3px solid alpha(@surface0, 0.5); */ + color: @text; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 3px @rosewater; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: @text; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused { + background-color: @surface1; + box-shadow: inset 0 3px @flamingo; +} + +#workspaces button.urgent { + background-color: @red; + color: @mantle; +} + +#mode { + background-color: @surface1; + border-top: 3px solid @rosewater; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#mpd { + padding: 0 10px; + color: @text; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left > widget:first-child > #workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right > widget:last-child > #workspaces { + margin-right: 0; +} + +#clock { + /* background-color: #64727D; */ + border-top: 3px solid @lavender; + color: @lavender; +} + +#battery { + /* background-color: #ffffff; */ + color: @blue; + border-top: 3px solid @blue; + padding-right: 18px; +} + +#battery.charging, #battery.plugged { + color: @surface0; + background-color: @green; + border-top: 0; + padding-right: 11px; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { + /* background-color: #2ecc71; */ + /* color: #000000; */ + border-top: 3px solid @peach; +} + +#memory { + /* background-color: #9b59b6; */ + border-top: 3px solid @peach; + padding-right: 15px; +} + +#disk { + background-color: #964B00; +} + +#backlight { + /* background-color: #90b1b1; */ + border-top: 3px solid @peach; + color: @peach; + padding-right: 11px; +} + +#network { + /* background-color: #2980b9; */ + border-top: 3px solid @yellow; + color: @yellow; + padding-right: 15px; +} + +#network.disconnected { + /* background-color: #f53c3c; */ + border-top: 3px solid @red; + color: @red; +} + +#pulseaudio { + /* background-color: #f1c40f; */ + /* color: #000000; */ + border-top: 3px solid @maroon; + color: @maroon; +} + +#pulseaudio.muted { + /* background-color: #90b1b1; */ + /* color: #2a5c45; */ + border-top: 3px solid @flamingo; + background-color: @flamingo; + color: @mantle; +} + +#wireplumber { + background-color: #fff0f5; + color: #000000; +} + +#wireplumber.muted { + background-color: #f53c3c; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + /* background-color: #f0932b; */ + border-top: 3px solid @teal; + color: @teal; + padding-right: 12px; +} + +#temperature.critical { + background-color: #eb4d4b; + border-top: 3px solid #eb4d4b; + color: #ffffff; +} + +#tray { + /* background-color: #2980b9; */ + border-top: 3px solid @mauve; +} + +#tray > .passive { + -gtk-icon-effect: dim; +} + +#tray > .needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor { + /* background-color: #2d3436; */ + border-top: 3px solid @mantle; + padding-right: 14px; +} + +#idle_inhibitor.activated { + background-color: @text; + color: @mantle; + border-top: 3px solid @subtext0; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + /* background: #00b093; */ + color: @sapphire; + padding: 0 5px; + /* margin: 0 5px; */ + min-width: 16px; + border-top: 3px solid @sapphire; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state > label { + padding: 0 5px; +} + +#keyboard-state > label.locked { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad { + background: @mantle; +} + +#scratchpad.empty { + background-color: transparent; +} diff --git a/xplr/init.lua b/xplr/init.lua new file mode 100644 index 0000000..54e748b --- /dev/null +++ b/xplr/init.lua @@ -0,0 +1,44 @@ +version = "0.21.3" + +local home = os.getenv("HOME") +local xpm_path = home .. "/.local/share/xplr/dtomvan/xpm.xplr" +local xpm_url = "https://github.com/dtomvan/xpm.xplr" + +package.path = package.path + .. ";" + .. xpm_path + .. "/?.lua;" + .. xpm_path + .. "/?/init.lua" + +os.execute( + string.format( + "[ -e '%s' ] || git clone '%s' '%s'", + xpm_path, + xpm_url, + xpm_path + ) +) + +require("xpm").setup({ + plugins = { + 'dtomvan/xpm.xplr', + { name = 'sayanarijit/fzf.xplr' }, + { name = 'prncss-xyz/icons.xplr' }, + { 'dtomvan/extra-icons.xplr', + after = function() + xplr.config.general.table.row.cols[2] = { format = "custom.icons_dtomvan_col_1" } + end + }, + }, + auto_install = true, + auto_cleanup = true, +}) + +xplr.config.modes.builtin.default.key_bindings.on_key.x = { + help = "xpm", + messages = { + "PopMode", + { SwitchModeCustom = "xpm" }, + }, +} diff --git a/xplr/plugins/icons b/xplr/plugins/icons new file mode 160000 +Subproject 6133ea79c41629591c72fa4c51132f7a3cb3078 diff --git a/zathura/.nextcloudsync.log b/zathura/.nextcloudsync.log new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/zathura/.nextcloudsync.log diff --git a/zathura/catppuccin-macchiato b/zathura/catppuccin-macchiato new file mode 100644 index 0000000..4e447da --- /dev/null +++ b/zathura/catppuccin-macchiato @@ -0,0 +1,37 @@ +set default-fg "#CAD3F5" +set default-bg "#24273A" + +set completion-bg "#363A4F" +set completion-fg "#CAD3F5" +set completion-highlight-bg "#575268" +set completion-highlight-fg "#CAD3F5" +set completion-group-bg "#363A4F" +set completion-group-fg "#8AADF4" + +set statusbar-fg "#CAD3F5" +set statusbar-bg "#363A4F" + +set notification-bg "#363A4F" +set notification-fg "#CAD3F5" +set notification-error-bg "#363A4F" +set notification-error-fg "#ED8796" +set notification-warning-bg "#363A4F" +set notification-warning-fg "#FAE3B0" + +set inputbar-fg "#CAD3F5" +set inputbar-bg "#363A4F" + +set recolor-lightcolor "#24273A" +set recolor-darkcolor "#CAD3F5" + +set index-fg "#CAD3F5" +set index-bg "#24273A" +set index-active-fg "#CAD3F5" +set index-active-bg "#363A4F" + +set render-loading-bg "#24273A" +set render-loading-fg "#CAD3F5" + +set highlight-color "#575268" +set highlight-fg "#F5BDE6" +set highlight-active-color "#F5BDE6" diff --git a/zathura/zathurarc b/zathura/zathurarc new file mode 100644 index 0000000..603114f --- /dev/null +++ b/zathura/zathurarc @@ -0,0 +1,4 @@ +include catppuccin-macchiato +set recolor true +set font FiraCode +set selection-clipboard clipboard |