diff --git a/.config/dwm b/.config/dwm deleted file mode 160000 index baaa790..0000000 --- a/.config/dwm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit baaa7906cf6efdee3c1b9f2dbe0ffe5f03c2e0ea diff --git a/.config/dwmblocks b/.config/dwmblocks deleted file mode 160000 index c9e0c8c..0000000 --- a/.config/dwmblocks +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c9e0c8c8d32e77d90f7f812052510a3f80e2eb1d diff --git a/.config/nvim b/.config/nvim deleted file mode 160000 index 8ab9357..0000000 --- a/.config/nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8ab935736256e651df978eb3fb3bd4f8879d4465 diff --git a/.config/st b/.config/st deleted file mode 160000 index 7a8e462..0000000 --- a/.config/st +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7a8e462eb227fcf9fe78d39ae898a1e4b1adb920 diff --git a/.gitmodules b/.gitmodules index 83ebc09..2aa36d7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,17 +1,17 @@ -[submodule ".config/dwm"] - path = .config/dwm +[submodule "dwm"] + path = dwm/dot-config/dwmblocks url = ../dwm.git ignore = all -[submodule ".config/st"] - path = .config/st +[submodule "st"] + path = st/dot-config/st url = ../st.git ignore = all -[submodule ".config/dwmblocks"] - path = .config/dwmblocks +[submodule "dwmblocks"] + path = dwmblocks/dot-config/dwmblocks url = ../dwmblocks.git ignore = all -[submodule ".config/nvim"] - path = .config/nvim +[submodule "nvim"] + path = nvim/dot-config/nvim url = ../nvim.git ignore = all diff --git a/init_submodules b/init_submodules new file mode 100755 index 0000000..c75be31 --- /dev/null +++ b/init_submodules @@ -0,0 +1,9 @@ +#!/bin/sh + +# Go to script dir +cd "$(dirname "$(readlink -f "$0")")" + +git submodule init +git submodule update --force --recursive --init --remote +git submodule foreach "git checkout master" + diff --git a/install b/install new file mode 100755 index 0000000..10b76a6 --- /dev/null +++ b/install @@ -0,0 +1,18 @@ +#!/bin/sh + +# Go to script directory +dir="$(dirname "$(readlink -f "$0")")" +cd "$dir" + +for package in $(ls $dir); do + if [ ! -d "$dir/$package" ]; then + continue + fi + + if [ "$package" = "misc" ]; then + stow --target=$HOME --dotfiles --simulate --no-folding -R $package + else + stow --target=$HOME --dotfiles --simulate -v -R $package + fi +done + diff --git a/.cache/tldr/.gitignore b/misc/dot-cache/tldr/.gitignore similarity index 100% rename from .cache/tldr/.gitignore rename to misc/dot-cache/tldr/.gitignore diff --git a/.config/X11/xinitrc b/misc/dot-config/X11/xinitrc similarity index 100% rename from .config/X11/xinitrc rename to misc/dot-config/X11/xinitrc diff --git a/.config/autorandr/postswitch b/misc/dot-config/autorandr/postswitch similarity index 100% rename from .config/autorandr/postswitch rename to misc/dot-config/autorandr/postswitch diff --git a/.config/colors/accent b/misc/dot-config/colors/accent similarity index 100% rename from .config/colors/accent rename to misc/dot-config/colors/accent diff --git a/.config/conda/condarc b/misc/dot-config/conda/condarc similarity index 100% rename from .config/conda/condarc rename to misc/dot-config/conda/condarc diff --git a/.config/discord/settings.json b/misc/dot-config/discord/settings.json similarity index 100% rename from .config/discord/settings.json rename to misc/dot-config/discord/settings.json diff --git a/.config/dmenu/config.h b/misc/dot-config/dmenu/config.h similarity index 100% rename from .config/dmenu/config.h rename to misc/dot-config/dmenu/config.h diff --git a/.config/doom/config.org b/misc/dot-config/doom/config.org similarity index 100% rename from .config/doom/config.org rename to misc/dot-config/doom/config.org diff --git a/.config/doom/init.el b/misc/dot-config/doom/init.el similarity index 100% rename from .config/doom/init.el rename to misc/dot-config/doom/init.el diff --git a/.config/doom/themes/some-clown-fiesta-theme.el b/misc/dot-config/doom/themes/some-clown-fiesta-theme.el similarity index 100% rename from .config/doom/themes/some-clown-fiesta-theme.el rename to misc/dot-config/doom/themes/some-clown-fiesta-theme.el diff --git a/.config/dunst/dunstrc b/misc/dot-config/dunst/dunstrc similarity index 100% rename from .config/dunst/dunstrc rename to misc/dot-config/dunst/dunstrc diff --git a/.config/fcitx5/conf/classicui.conf b/misc/dot-config/fcitx5/conf/classicui.conf similarity index 100% rename from .config/fcitx5/conf/classicui.conf rename to misc/dot-config/fcitx5/conf/classicui.conf diff --git a/.config/foot/foot.ini b/misc/dot-config/foot/foot.ini similarity index 100% rename from .config/foot/foot.ini rename to misc/dot-config/foot/foot.ini diff --git a/.config/git/.gitignore b/misc/dot-config/git/.gitignore similarity index 100% rename from .config/git/.gitignore rename to misc/dot-config/git/.gitignore diff --git a/.config/gtk-2.0/gtkrc-2.0 b/misc/dot-config/gtk-2.0/gtkrc-2.0 similarity index 100% rename from .config/gtk-2.0/gtkrc-2.0 rename to misc/dot-config/gtk-2.0/gtkrc-2.0 diff --git a/.config/gtk-3.0/settings.ini b/misc/dot-config/gtk-3.0/settings.ini similarity index 100% rename from .config/gtk-3.0/settings.ini rename to misc/dot-config/gtk-3.0/settings.ini diff --git a/.config/htop/htoprc b/misc/dot-config/htop/htoprc similarity index 100% rename from .config/htop/htoprc rename to misc/dot-config/htop/htoprc diff --git a/.config/hypr/hyprland.conf b/misc/dot-config/hypr/hyprland.conf similarity index 100% rename from .config/hypr/hyprland.conf rename to misc/dot-config/hypr/hyprland.conf diff --git a/.config/hyprland-autoname-workspaces/config.toml b/misc/dot-config/hyprland-autoname-workspaces/config.toml similarity index 100% rename from .config/hyprland-autoname-workspaces/config.toml rename to misc/dot-config/hyprland-autoname-workspaces/config.toml diff --git a/.config/ipython/.gitignore b/misc/dot-config/ipython/.gitignore similarity index 100% rename from .config/ipython/.gitignore rename to misc/dot-config/ipython/.gitignore diff --git a/.config/kanshi/config b/misc/dot-config/kanshi/config similarity index 100% rename from .config/kanshi/config rename to misc/dot-config/kanshi/config diff --git a/.config/lf/cleaner b/misc/dot-config/lf/cleaner similarity index 100% rename from .config/lf/cleaner rename to misc/dot-config/lf/cleaner diff --git a/.config/lf/icons b/misc/dot-config/lf/icons similarity index 100% rename from .config/lf/icons rename to misc/dot-config/lf/icons diff --git a/.config/lf/lfrc b/misc/dot-config/lf/lfrc similarity index 100% rename from .config/lf/lfrc rename to misc/dot-config/lf/lfrc diff --git a/.config/lf/previewer b/misc/dot-config/lf/previewer similarity index 100% rename from .config/lf/previewer rename to misc/dot-config/lf/previewer diff --git a/.config/nixos/configuration.def.nix b/misc/dot-config/nixos/configuration.def.nix similarity index 100% rename from .config/nixos/configuration.def.nix rename to misc/dot-config/nixos/configuration.def.nix diff --git a/.config/nixos/core.nix b/misc/dot-config/nixos/core.nix similarity index 100% rename from .config/nixos/core.nix rename to misc/dot-config/nixos/core.nix diff --git a/.config/nixos/profiles/emacs.nix b/misc/dot-config/nixos/profiles/emacs.nix similarity index 100% rename from .config/nixos/profiles/emacs.nix rename to misc/dot-config/nixos/profiles/emacs.nix diff --git a/.config/nixos/profiles/fcitx.nix b/misc/dot-config/nixos/profiles/fcitx.nix similarity index 100% rename from .config/nixos/profiles/fcitx.nix rename to misc/dot-config/nixos/profiles/fcitx.nix diff --git a/.config/nixos/profiles/lf.nix b/misc/dot-config/nixos/profiles/lf.nix similarity index 100% rename from .config/nixos/profiles/lf.nix rename to misc/dot-config/nixos/profiles/lf.nix diff --git a/.config/nixos/profiles/minimal.nix b/misc/dot-config/nixos/profiles/minimal.nix similarity index 100% rename from .config/nixos/profiles/minimal.nix rename to misc/dot-config/nixos/profiles/minimal.nix diff --git a/.config/nixos/profiles/nvim.nix b/misc/dot-config/nixos/profiles/nvim.nix similarity index 100% rename from .config/nixos/profiles/nvim.nix rename to misc/dot-config/nixos/profiles/nvim.nix diff --git a/.config/nixos/profiles/virtualbox.nix b/misc/dot-config/nixos/profiles/virtualbox.nix similarity index 100% rename from .config/nixos/profiles/virtualbox.nix rename to misc/dot-config/nixos/profiles/virtualbox.nix diff --git a/.config/nixos/profiles/wm/dwm.nix b/misc/dot-config/nixos/profiles/wm/dwm.nix similarity index 100% rename from .config/nixos/profiles/wm/dwm.nix rename to misc/dot-config/nixos/profiles/wm/dwm.nix diff --git a/.config/nixos/profiles/wm/hyprland.nix b/misc/dot-config/nixos/profiles/wm/hyprland.nix similarity index 100% rename from .config/nixos/profiles/wm/hyprland.nix rename to misc/dot-config/nixos/profiles/wm/hyprland.nix diff --git a/.config/nixpkgs/config.nix b/misc/dot-config/nixpkgs/config.nix similarity index 100% rename from .config/nixpkgs/config.nix rename to misc/dot-config/nixpkgs/config.nix diff --git a/.config/npm/npmrc b/misc/dot-config/npm/npmrc similarity index 100% rename from .config/npm/npmrc rename to misc/dot-config/npm/npmrc diff --git a/.config/picom/picom.conf b/misc/dot-config/picom/picom.conf similarity index 100% rename from .config/picom/picom.conf rename to misc/dot-config/picom/picom.conf diff --git a/.config/rofi-pass/config b/misc/dot-config/rofi-pass/config similarity index 100% rename from .config/rofi-pass/config rename to misc/dot-config/rofi-pass/config diff --git a/.config/rofi/config.rasi b/misc/dot-config/rofi/config.rasi similarity index 100% rename from .config/rofi/config.rasi rename to misc/dot-config/rofi/config.rasi diff --git a/.config/rofi/themes/gruvbox-common.rasi b/misc/dot-config/rofi/themes/gruvbox-common.rasi similarity index 100% rename from .config/rofi/themes/gruvbox-common.rasi rename to misc/dot-config/rofi/themes/gruvbox-common.rasi diff --git a/.config/rofi/themes/gruvbox-dark-transparent.rasi b/misc/dot-config/rofi/themes/gruvbox-dark-transparent.rasi similarity index 100% rename from .config/rofi/themes/gruvbox-dark-transparent.rasi rename to misc/dot-config/rofi/themes/gruvbox-dark-transparent.rasi diff --git a/.config/rofi/themes/theme.rasi b/misc/dot-config/rofi/themes/theme.rasi similarity index 100% rename from .config/rofi/themes/theme.rasi rename to misc/dot-config/rofi/themes/theme.rasi diff --git a/.config/starship.def.toml b/misc/dot-config/starship.def.toml similarity index 100% rename from .config/starship.def.toml rename to misc/dot-config/starship.def.toml diff --git a/.config/starship.toml b/misc/dot-config/starship.toml similarity index 100% rename from .config/starship.toml rename to misc/dot-config/starship.toml diff --git a/.config/sxhkd/sxhkdrc b/misc/dot-config/sxhkd/sxhkdrc similarity index 100% rename from .config/sxhkd/sxhkdrc rename to misc/dot-config/sxhkd/sxhkdrc diff --git a/.config/tmux/tmux.conf b/misc/dot-config/tmux/tmux.conf similarity index 100% rename from .config/tmux/tmux.conf rename to misc/dot-config/tmux/tmux.conf diff --git a/.config/waybar/config b/misc/dot-config/waybar/config similarity index 100% rename from .config/waybar/config rename to misc/dot-config/waybar/config diff --git a/.config/waybar/style.css b/misc/dot-config/waybar/style.css similarity index 100% rename from .config/waybar/style.css rename to misc/dot-config/waybar/style.css diff --git a/.config/yazi/init.lua b/misc/dot-config/yazi/init.lua similarity index 100% rename from .config/yazi/init.lua rename to misc/dot-config/yazi/init.lua diff --git a/.config/yazi/keymap.toml b/misc/dot-config/yazi/keymap.toml similarity index 100% rename from .config/yazi/keymap.toml rename to misc/dot-config/yazi/keymap.toml diff --git a/.config/yazi/plugins/smart-enter.yazi/init.lua b/misc/dot-config/yazi/plugins/smart-enter.yazi/init.lua similarity index 100% rename from .config/yazi/plugins/smart-enter.yazi/init.lua rename to misc/dot-config/yazi/plugins/smart-enter.yazi/init.lua diff --git a/.config/yazi/theme.toml b/misc/dot-config/yazi/theme.toml similarity index 100% rename from .config/yazi/theme.toml rename to misc/dot-config/yazi/theme.toml diff --git a/.config/yazi/yazi.toml b/misc/dot-config/yazi/yazi.toml similarity index 100% rename from .config/yazi/yazi.toml rename to misc/dot-config/yazi/yazi.toml diff --git a/.config/zathura/zathurarc b/misc/dot-config/zathura/zathurarc similarity index 100% rename from .config/zathura/zathurarc rename to misc/dot-config/zathura/zathurarc diff --git a/.config/zsh/.zprofile b/misc/dot-config/zsh/.zprofile similarity index 100% rename from .config/zsh/.zprofile rename to misc/dot-config/zsh/.zprofile diff --git a/.config/zsh/.zshenv b/misc/dot-config/zsh/.zshenv similarity index 100% rename from .config/zsh/.zshenv rename to misc/dot-config/zsh/.zshenv diff --git a/.config/zsh/.zshhighlighting b/misc/dot-config/zsh/.zshhighlighting similarity index 100% rename from .config/zsh/.zshhighlighting rename to misc/dot-config/zsh/.zshhighlighting diff --git a/.config/zsh/.zshrc b/misc/dot-config/zsh/.zshrc similarity index 100% rename from .config/zsh/.zshrc rename to misc/dot-config/zsh/.zshrc diff --git a/.local/bin/block_battery b/misc/dot-local/bin/block_battery similarity index 100% rename from .local/bin/block_battery rename to misc/dot-local/bin/block_battery diff --git a/.local/bin/change-brightness b/misc/dot-local/bin/change-brightness similarity index 100% rename from .local/bin/change-brightness rename to misc/dot-local/bin/change-brightness diff --git a/.local/bin/dlkiller b/misc/dot-local/bin/dlkiller similarity index 100% rename from .local/bin/dlkiller rename to misc/dot-local/bin/dlkiller diff --git a/.local/bin/entrs b/misc/dot-local/bin/entrs similarity index 100% rename from .local/bin/entrs rename to misc/dot-local/bin/entrs diff --git a/.local/bin/hyprdwm b/misc/dot-local/bin/hyprdwm similarity index 100% rename from .local/bin/hyprdwm rename to misc/dot-local/bin/hyprdwm diff --git a/.local/bin/hyprgaps b/misc/dot-local/bin/hyprgaps similarity index 100% rename from .local/bin/hyprgaps rename to misc/dot-local/bin/hyprgaps diff --git a/.local/bin/javafx b/misc/dot-local/bin/javafx similarity index 100% rename from .local/bin/javafx rename to misc/dot-local/bin/javafx diff --git a/.local/bin/menu-accent b/misc/dot-local/bin/menu-accent similarity index 100% rename from .local/bin/menu-accent rename to misc/dot-local/bin/menu-accent diff --git a/.local/bin/menu-layout b/misc/dot-local/bin/menu-layout similarity index 100% rename from .local/bin/menu-layout rename to misc/dot-local/bin/menu-layout diff --git a/.local/bin/menu-man b/misc/dot-local/bin/menu-man similarity index 100% rename from .local/bin/menu-man rename to misc/dot-local/bin/menu-man diff --git a/.local/bin/menu-run b/misc/dot-local/bin/menu-run similarity index 100% rename from .local/bin/menu-run rename to misc/dot-local/bin/menu-run diff --git a/.local/bin/menu-unicode b/misc/dot-local/bin/menu-unicode similarity index 100% rename from .local/bin/menu-unicode rename to misc/dot-local/bin/menu-unicode diff --git a/.local/bin/menu-wpio b/misc/dot-local/bin/menu-wpio similarity index 100% rename from .local/bin/menu-wpio rename to misc/dot-local/bin/menu-wpio diff --git a/.local/bin/opener b/misc/dot-local/bin/opener similarity index 100% rename from .local/bin/opener rename to misc/dot-local/bin/opener diff --git a/.local/bin/overrides/nixos-rebuild b/misc/dot-local/bin/overrides/nixos-rebuild similarity index 100% rename from .local/bin/overrides/nixos-rebuild rename to misc/dot-local/bin/overrides/nixos-rebuild diff --git a/.local/bin/overrides/rofi-pass b/misc/dot-local/bin/overrides/rofi-pass similarity index 100% rename from .local/bin/overrides/rofi-pass rename to misc/dot-local/bin/overrides/rofi-pass diff --git a/.local/bin/pinentry-wrapper b/misc/dot-local/bin/pinentry-wrapper similarity index 100% rename from .local/bin/pinentry-wrapper rename to misc/dot-local/bin/pinentry-wrapper diff --git a/.local/bin/rotdir b/misc/dot-local/bin/rotdir similarity index 100% rename from .local/bin/rotdir rename to misc/dot-local/bin/rotdir diff --git a/.local/bin/swallow b/misc/dot-local/bin/swallow similarity index 100% rename from .local/bin/swallow rename to misc/dot-local/bin/swallow diff --git a/.local/bin/sysbin b/misc/dot-local/bin/sysbin similarity index 100% rename from .local/bin/sysbin rename to misc/dot-local/bin/sysbin diff --git a/.local/share/chars/emoji b/misc/dot-local/share/chars/emoji similarity index 100% rename from .local/share/chars/emoji rename to misc/dot-local/share/chars/emoji diff --git a/.local/share/chars/font-awesome b/misc/dot-local/share/chars/font-awesome similarity index 100% rename from .local/share/chars/font-awesome rename to misc/dot-local/share/chars/font-awesome diff --git a/.local/share/fcitx5/themes/vince/theme.conf b/misc/dot-local/share/fcitx5/themes/vince/theme.conf similarity index 100% rename from .local/share/fcitx5/themes/vince/theme.conf rename to misc/dot-local/share/fcitx5/themes/vince/theme.conf diff --git a/.local/share/gnupg/gpg-agent.conf b/misc/dot-local/share/gnupg/gpg-agent.conf similarity index 100% rename from .local/share/gnupg/gpg-agent.conf rename to misc/dot-local/share/gnupg/gpg-agent.conf diff --git a/.local/share/gnupg/pinentry-dmenu.conf b/misc/dot-local/share/gnupg/pinentry-dmenu.conf similarity index 100% rename from .local/share/gnupg/pinentry-dmenu.conf rename to misc/dot-local/share/gnupg/pinentry-dmenu.conf diff --git a/.ssh/config b/misc/dot-ssh/config similarity index 100% rename from .ssh/config rename to misc/dot-ssh/config diff --git a/nvim/dot-config/nvim/.gitignore b/nvim/dot-config/nvim/.gitignore new file mode 100644 index 0000000..ef02d0c --- /dev/null +++ b/nvim/dot-config/nvim/.gitignore @@ -0,0 +1,2 @@ +/plugin/ + diff --git a/nvim/dot-config/nvim/after/ftplugin/html.lua b/nvim/dot-config/nvim/after/ftplugin/html.lua new file mode 100644 index 0000000..806b55a --- /dev/null +++ b/nvim/dot-config/nvim/after/ftplugin/html.lua @@ -0,0 +1,4 @@ +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 + diff --git a/nvim/dot-config/nvim/after/ftplugin/lua.lua b/nvim/dot-config/nvim/after/ftplugin/lua.lua new file mode 100644 index 0000000..806b55a --- /dev/null +++ b/nvim/dot-config/nvim/after/ftplugin/lua.lua @@ -0,0 +1,4 @@ +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 + diff --git a/nvim/dot-config/nvim/after/ftplugin/norg.lua b/nvim/dot-config/nvim/after/ftplugin/norg.lua new file mode 100644 index 0000000..806b55a --- /dev/null +++ b/nvim/dot-config/nvim/after/ftplugin/norg.lua @@ -0,0 +1,4 @@ +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 + diff --git a/nvim/dot-config/nvim/after/plugin/colors.lua b/nvim/dot-config/nvim/after/plugin/colors.lua new file mode 100644 index 0000000..4f38b16 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/colors.lua @@ -0,0 +1,207 @@ +local palette = { + none = "NONE", + fg = "#E1E1E1", + bg = "#151515", + alt_bg = "#171717", + accent = "#202020", + white = "#E1E1E1", + gray = "#373737", + medium_gray = "#727272", + light_gray = "#AFAFAF", + blue = "#BAD7FF", + gray_blue = "#7E97AB", + medium_gray_blue = "#A2B5C1", + cyan = "#88afa2", + red = "#b46958", + green = "#90A959", + yellow = "#F4BF75", + orange = "#FFA557", + purple = "#AA749F", + magenta = "#AA759F", + cursor_fg = "#151515", + cursor_bg = "#D0D0D0", + sign_add = "#586935", + sign_change = "#51657B", + sign_delete = "#984936", + error = "#984936", + warning = "#ab8550", + info = "#ab8550", + hint = "#576f82", + neogit_light_green = "#2A2E19", + neogit_blue = "#1B1F27", + neogit_green = "#212513", + neogit_light_red = "#402020", + neogit_red = "#351D1D", +} + +require("no-clown-fiesta").setup({ + transparent = true, +}) + +require('rose-pine').setup({ + --- @usage 'auto'|'main'|'moon'|'dawn' + variant = 'auto', + --- @usage 'main'|'moon'|'dawn' + dark_variant = 'main', + bold_vert_split = false, + dim_nc_background = false, + disable_background = true, + disable_float_background = false, + disable_italics = true, + + --- @usage string hex value or named color from rosepinetheme.com/palette + groups = { + background = 'base', + background_nc = '_experimental_nc', + panel = 'surface', + panel_nc = 'base', + border = 'highlight_med', + comment = 'muted', + link = 'iris', + punctuation = 'subtle', + + error = 'love', + hint = 'iris', + info = 'foam', + warn = 'gold', + + headings = { + h1 = 'iris', + h2 = 'foam', + h3 = 'rose', + h4 = 'gold', + h5 = 'pine', + h6 = 'foam', + } + -- or set all headings at once + -- headings = 'subtle' + }, + + -- Change specific vim highlight groups + -- https://github.com/rose-pine/neovim/wiki/Recipes + highlight_groups = { + ColorColumn = { bg = 'rose' }, + + -- Blend colours against the "base" background + CursorLine = { bg = 'foam', blend = 10 }, + StatusLine = { fg = 'love', bg = 'love', blend = 10 }, + + -- By default each group adds to the existing config. + -- If you only want to set what is written in this config exactly, + -- you can set the inherit option: + Search = { bg = 'gold', inherit = false }, + } +}) + +require("gruvbox").setup({ + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = "", -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = true, +}) + +local c = require('vscode.colors').get_colors() +require('vscode').setup({ + -- Alternatively set style in setup + -- style = 'light' + + -- Enable transparent background + transparent = true, + + -- Enable italic comment + italic_comments = true, + + -- Disable nvim-tree background color + disable_nvimtree_bg = true, + + -- Override colors (see ./lua/vscode/colors.lua) + color_overrides = { + -- vscLineNumber = '#FFFFFF', + }, + + -- Override highlight groups (see ./lua/vscode/theme.lua) + group_overrides = { + -- this supports the same val table as vim.api.nvim_set_hl + -- use colors from this colorscheme by requiring vscode.colors! + Cursor = { fg=c.vscDarkBlue, bg=c.vscLightGreen, bold=true }, + } +}) + +vim.cmd[[ +let s:base03 = [ '#151513', 233 ] +let s:base02 = [ '#202020', 236 ] +let s:base01 = [ '#373737', 239 ] +let s:base00 = [ '#727272', 242 ] +let s:base0 = [ '#808070', 244 ] +let s:base1 = [ '#949484', 246 ] +let s:base2 = [ '#a8a897', 248 ] +let s:base3 = [ '#E1E1E1', 253 ] +let s:yellow = [ '#F4BF75', 3 ] +let s:orange = [ '#FFA557', 216 ] +let s:red = [ '#B46958', 131 ] +let s:purple = [ '#AA749F', 181 ] +let s:blue = [ '#7E97AB', 109 ] +let s:cyan = [ '#BAD7FF', 23 ] +let s:green = [ '#90A959', 108 ] +let s:white = [ '#AFAFAF', 252 ] + +let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}} +let s:p.normal.left = [ [ s:base02, s:green ], [ s:base3, s:base01 ] ] +let s:p.normal.right = [ [ s:base02, s:base1 ], [ s:base2, s:base01 ] ] +let s:p.inactive.right = [ [ s:base02, s:base00 ], [ s:base0, s:base02 ] ] +let s:p.inactive.left = [ [ s:base0, s:base02 ], [ s:base00, s:base02 ] ] +let s:p.insert.left = [ [ s:base02, s:blue ], [ s:base3, s:base01 ] ] +let s:p.replace.left = [ [ s:base02, s:purple ], [ s:base3, s:base01 ] ] +let s:p.visual.left = [ [ s:base02, s:red ], [ s:base3, s:base01 ] ] +let s:p.normal.middle = [ [ s:base0, s:base02 ] ] +let s:p.inactive.middle = [ [ s:base00, s:base02 ] ] +let s:p.tabline.left = [ [ s:base3, s:base00 ] ] +let s:p.tabline.tabsel = [ [ s:base3, s:base02 ] ] +let s:p.tabline.middle = [ [ s:base01, s:base1 ] ] +let s:p.tabline.right = copy(s:p.normal.right) +let s:p.normal.error = [ [ s:red, s:base02 ] ] +let s:p.normal.warning = [ [ s:yellow, s:base01 ] ] + +let g:lightline#colorscheme#mycolors#palette = lightline#colorscheme#flatten(s:p) +let g:lightline = { + \ 'colorscheme': 'mycolors', + \ } + +" Don't need to see mode if lightline is installed +set noshowmode +]] + +vim.cmd[[colorscheme no-clown-fiesta]] + +-- My own color overrides +local hl = vim.api.nvim_set_hl +hl(0, 'TSConstant', { fg = palette.yellow }) +hl(0, 'EndOfBuffer', { fg = palette.medium_gray }) +hl(0, 'ErrorMsg', { fg = palette.yellow }) +hl(0, 'LineNr', { fg = palette.medium_gray }) +hl(0, 'MasonNormal', { bg = palette.gray }) +hl(0, 'NvimTreeCursorLine', { fg = palette.yellow }) +hl(0, 'NvimTreeEndOfBuffer', { fg = palette.medium_gray }) +hl(0, 'NvimTreeIndentMarker', { fg = palette.medium_gray }) +hl(0, 'NvimTreeFolderIcon', { fg = palette.yellow }) +hl(0, 'WhichKeyFloat', { bg = nil }) +hl(0, 'WhichKeyDesc', { link = "function" }) +hl(0, 'WhichKey', { fg = palette.medium_gray_blue }) +hl(0, 'WhichKeyGroup', { fg = palette.gray_blue, bold = true }) + diff --git a/nvim/dot-config/nvim/after/plugin/comment.lua b/nvim/dot-config/nvim/after/plugin/comment.lua new file mode 100644 index 0000000..a595cbd --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/comment.lua @@ -0,0 +1,9 @@ +require("Comment").setup() + +vim.keymap.set( + "n", + "", + function() require("Comment.api").toggle.linewise.current() end, + { noremap = true, silent = true } +) + diff --git a/nvim/dot-config/nvim/after/plugin/dashboard.lua b/nvim/dot-config/nvim/after/plugin/dashboard.lua new file mode 100644 index 0000000..711ee35 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/dashboard.lua @@ -0,0 +1,58 @@ +local alpha = require("alpha") +local dashboard = require("alpha.themes.dashboard") + +math.randomseed(os.time()) + +local function pick_color() + local colors = {"String", "Identifier", "Keyword", "Number"} + return colors[math.random(#colors)] +end + +local function footer() + local total_plugins = #vim.tbl_keys(packer_plugins) + local version = vim.version() + local nvim_version_info = " NVIM v" .. version.major .. "." .. version.minor .. "." .. version.patch + + return nvim_version_info .. " 󰏖 " .. total_plugins .. " plugins" +end + +-- Set header +dashboard.section.header.val = { + " ⣴⣶⣤⡤⠦⣤⣀⣤⠆ ⣈⣭⣭⣿⣶⣿⣦⣼⣆ ", + " ⠉⠻⢿⣿⠿⣿⣿⣶⣦⠤⠄⡠⢾⣿⣿⡿⠋⠉⠉⠻⣿⣿⡛⣦ ", + " ⠈ ⠈⢿⣿⣟⠦⠄⣾⣿⣿⣷ ⠻⠿⢿⣿⣧⣄ ", + " ⣸⣿⣿⢧⠄⢻⠻⣿⣿⣷⣄⣀⠄⠢⣀⡀⠈⠙⠿⠄ ", + " ⢠⣿⣿⣿⠈ ⠡⠌⣻⣿⣿⣿⣿⣿⣿⣿⣛⣳⣤⣀⣀ ", + " ⢠⣧⣶⣥⡤⢄ ⣸⣿⣿⠘ ⢀⣴⣿⣿⡿⠛⣿⣿⣧⠈⢿⠿⠟⠛⠻⠿ ", + " ⣰⣿⣿⠛⠻⣿⣿⡦⢹⣿⣷⠄ ⢊⣿⣿⡏ ⢸⣿⣿⡇ ⢀⣠⣄⣾⠄ ", + "⣠⣿⠿⠛ ⢀⣿⣿⣷⠘⢿⣿⣦⡀ ⢸⢿⣿⣿⣄ ⣸⣿⣿⡇⣪⣿⡿⠿⣿⣷⡄ ", + "⠙⠃ ⣼⣿⡟⠌ ⠈⠻⣿⣿⣦⣌⡇⠻⣿⣿⣷⣿⣿⣿⠐⣿⣿⡇ ⠛⠻⢷⣄", + " ⢻⣿⣿⣄ ⠈⠻⣿⣿⣿⣷⣿⣿⣿⣿⣿⡟ ⠫⢿⣿⡆ ⠁", + " ⠻⣿⣿⣿⣿⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣀⣤⣾⡿⠃ ", + "⢀⣀⠀⣠⣀⣠⣾⣿⣿⡿⠛⠋⠉⠉⠉ ⠉⠉⠉⠉⠛⠻⣿⣿⣷⣄⣀⢿⡽⢻⣦", + "⠻⠶⠾⠿⠿⠿⠋⠉ N E O V I M ⠉⠻⠿⠿⠿⠿⠿⠋", +} + +-- Set menu +dashboard.section.buttons.val = { + dashboard.button( "e", " New file" , ":ene startinsert "), + dashboard.button( "q", "󰩈 Quit NVIM", ":qa"), +} + +vim.api.nvim_create_autocmd("VimEnter", { + once = true, + callback = function() + math.randomseed(os.time()) + local fg_color = tostring(math.random(0, 12)) + local hi_setter = "hi AlphaHeader ctermfg=" + vim.cmd(hi_setter .. fg_color) + end +}) + +dashboard.section.footer.val = footer() + +dashboard.section.header.opts.hl = "Include" +dashboard.section.footer.opts.hl = "String" + +alpha.setup(dashboard.opts) + diff --git a/nvim/dot-config/nvim/after/plugin/firenvim.lua b/nvim/dot-config/nvim/after/plugin/firenvim.lua new file mode 100644 index 0000000..fb14f4b --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/firenvim.lua @@ -0,0 +1,23 @@ +vim.g.firenvim_config = { + globalSettings = { alt = "all" }, + localSettings = { + [".*"] = { + cmdline = "neovim", + content = "text", + priority = 0, + selector = "textarea", + takeover = "never" + }, + } +} + +-- Prevents scrolling when cursor is near the bottom of the text area +if vim.g.started_by_firenvim == true then + vim.opt.scrolloff = 0 +end + +vim.api.nvim_create_autocmd({'BufEnter'}, { + pattern = "localhost_*.txt", + command = "set filetype=python" +}) + diff --git a/nvim/dot-config/nvim/after/plugin/fugative.lua b/nvim/dot-config/nvim/after/plugin/fugative.lua new file mode 100644 index 0000000..12b6d67 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/fugative.lua @@ -0,0 +1,4 @@ +local wk = require("which-key") + +wk.register({g = { name = "git" }, prefix = ""}) +vim.keymap.set("n", "gs", vim.cmd.Git, { desc = "Git status" }) diff --git a/nvim/dot-config/nvim/after/plugin/lf.lua b/nvim/dot-config/nvim/after/plugin/lf.lua new file mode 100644 index 0000000..58a2922 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/lf.lua @@ -0,0 +1,4 @@ +-- vim.keymap.set("n", "e", function () +-- vim.cmd("Lf") +-- end) + diff --git a/nvim/dot-config/nvim/after/plugin/lsp.lua b/nvim/dot-config/nvim/after/plugin/lsp.lua new file mode 100644 index 0000000..541b066 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/lsp.lua @@ -0,0 +1,69 @@ +-- LANGUAGE SERVERS +local lsp_zero = require('lsp-zero') +local lspconfig = require("lspconfig") +local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() + +lsp_zero.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp_zero.default_keymaps({buffer = bufnr}) +end) + +-- LUA +lspconfig.lua_ls.setup({ + settings = { + Lua = { + diagnostics = { + -- Making sure that lua recognizes the global variable 'vim' + globals = { 'vim', 'xplr' }, + }, + }, + }, +}) + +-- RUST +-- Must run `rustup default stable` and then `rustup component add rust-analyzer` +-- upon first install +lspconfig.rust_analyzer.setup({}) + +lspconfig.clangd.setup({ + capabilities = lsp_capabilities, +}) + +-- AUTOCOMPLETION + +local cmp = require('cmp') +local cmp_action = require('lsp-zero').cmp_action() + +cmp.setup({ + sources = { + { name = "luasnip", option = { show_autosnippets = true } }, + { name = "nvim_lua" }, + { name = "nvim_lsp" }, + { name = "path" }, -- Auto complete paths + }, + mapping = { + -- Navigate between completion item + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + + -- toggle completion + [''] = cmp_action.toggle_completion(), + + -- navigate between snippet placeholder + [''] = cmp_action.luasnip_jump_backward(), + [''] = cmp_action.luasnip_jump_forward(), + + -- Confirm item + [''] = cmp.mapping.confirm({select = true}), + } +}) + +-- DIAGNOSTICS + +-- Show all diagnostics on current line in floating window +vim.api.nvim_set_keymap( + 'n', 'gl', ':lua vim.diagnostic.open_float()', + { noremap = true, silent = true } +) + diff --git a/nvim/dot-config/nvim/after/plugin/markdownpreview.lua b/nvim/dot-config/nvim/after/plugin/markdownpreview.lua new file mode 100644 index 0000000..a6f9c75 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/markdownpreview.lua @@ -0,0 +1,105 @@ +vim.keymap.set("n", "mp", "MarkdownPreview", + { desc = "Markdown prewview" }) + +vim.cmd([[ + +" set to 1, nvim will open the preview window after entering the markdown buffer +" default: 0 +let g:mkdp_auto_start = 0 + +" set to 1, the nvim will auto close current preview window when change +" from markdown buffer to another buffer +" default: 1 +let g:mkdp_auto_close = 1 + +" set to 1, the vim will refresh markdown when save the buffer or +" leave from insert mode, default 0 is auto refresh markdown as you edit or +" move the cursor +" default: 0 +let g:mkdp_refresh_slow = 0 + +" set to 1, the MarkdownPreview command can be use for all files, +" by default it can be use in markdown file +" default: 0 +let g:mkdp_command_for_global = 0 + +" set to 1, preview server available to others in your network +" by default, the server listens on localhost (127.0.0.1) +" default: 0 +let g:mkdp_open_to_the_world = 0 + +" use custom IP to open preview page +" useful when you work in remote vim and preview on local browser +" more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9 +" default empty +let g:mkdp_open_ip = '' + +" specify browser to open preview page +" for path with space +" valid: `/path/with\ space/xxx` +" invalid: `/path/with\\ space/xxx` +" default: '' +let g:mkdp_browser = 'thorium-browser' + +" set to 1, echo preview page url in command line when open preview page +" default is 0 +let g:mkdp_echo_preview_url = 0 + +" a custom vim function name to open preview page +" this function will receive url as param +" default is empty +let g:mkdp_browserfunc = '' + +" options for markdown render +" mkit: markdown-it options for render +" katex: katex options for math +" uml: markdown-it-plantuml options +" maid: mermaid options +" disable_sync_scroll: if disable sync scroll, default 0 +" sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle' +" middle: mean the cursor position alway show at the middle of the preview page +" top: mean the vim top viewport alway show at the top of the preview page +" relative: mean the cursor position alway show at the relative positon of the preview page +" hide_yaml_meta: if hide yaml metadata, default is 1 +" sequence_diagrams: js-sequence-diagrams options +" content_editable: if enable content editable for preview page, default: v:false +" disable_filename: if disable filename header for preview page, default: 0 +let g:mkdp_preview_options = { + \ 'mkit': {}, + \ 'katex': {}, + \ 'uml': {}, + \ 'maid': {}, + \ 'disable_sync_scroll': 0, + \ 'sync_scroll_type': 'middle', + \ 'hide_yaml_meta': 1, + \ 'sequence_diagrams': {}, + \ 'flowchart_diagrams': {}, + \ 'content_editable': v:false, + \ 'disable_filename': 0, + \ 'toc': {} + \ } + +" use a custom markdown style must be absolute path +" like '/Users/username/markdown.css' or expand('~/markdown.css') +let g:mkdp_markdown_css = '~/.local/share/github-markdown-dark.css' + +" use a custom highlight style must absolute path +" like '/Users/username/highlight.css' or expand('~/highlight.css') +let g:mkdp_highlight_css = '' + +" use a custom port to start server or empty for random +let g:mkdp_port = '' + +" preview page title +" ${name} will be replace with the file name +let g:mkdp_page_title = '「${name}」' + +" recognized filetypes +" these filetypes will have MarkdownPreview... commands +let g:mkdp_filetypes = ['markdown'] + +" set default theme (dark or light) +" By default the theme is define according to the preferences of the system +let g:mkdp_theme = 'dark' + +]]) diff --git a/nvim/dot-config/nvim/after/plugin/nvimtree.lua b/nvim/dot-config/nvim/after/plugin/nvimtree.lua new file mode 100644 index 0000000..4643fac --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/nvimtree.lua @@ -0,0 +1,10 @@ +-- set termguicolors to enable highlight groups +vim.opt.termguicolors = true + +require("nvim-tree").setup() + +vim.keymap.set("n", "pt", vim.cmd.NvimTreeToggle) + +-- sets transparent background +vim.cmd[[hi NvimTreeNormal guibg=NONE ctermbg=NONE]] + diff --git a/nvim/dot-config/nvim/after/plugin/telescope.lua b/nvim/dot-config/nvim/after/plugin/telescope.lua new file mode 100644 index 0000000..76b1ba8 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/telescope.lua @@ -0,0 +1,29 @@ +local builtin = require("telescope.builtin") + +require("telescope").setup{ + defaults = { + file_ignore_patterns = { ".git\\", ".pyc", ".mypy_cache\\", "node_modules\\", ".svg" } + } +} + +local wk = require("which-key") + +-- p +wk.register({p = { name = "project" }, prefix = ""}) +vim.keymap.set("n", "pf", builtin.find_files, {desc = "Project find"}) +vim.keymap.set("n", "ps", function () + builtin.grep_string({ search = vim.fn.input("Grep > ") }) + end , {desc = "Project search"}) + +-- f +wk.register({f = { name = "find" }, prefix = ""}) +vim.keymap.set("n", "fr", builtin.oldfiles, { desc = "Find recent" }) + +-- h +wk.register({h = { name = "help" }, prefix = ""}) +vim.keymap.set("n", "ht", builtin.colorscheme, { desc = "Load theme" }) +vim.keymap.set("n", "hf", builtin.commands , { desc = "Describe function" }) +vim.keymap.set("n", "hk", builtin.keymaps , { desc = "Describe key" }) +vim.keymap.set("n", "hv", builtin.vim_options, { desc = "Describe key" }) +vim.keymap.set("n", "hh", builtin.help_tags , { desc = "Search local wiki" }) + diff --git a/nvim/dot-config/nvim/after/plugin/treesitter.lua b/nvim/dot-config/nvim/after/plugin/treesitter.lua new file mode 100644 index 0000000..a4881fb --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/treesitter.lua @@ -0,0 +1,16 @@ +require'nvim-treesitter.configs'.setup { + ensure_installed = { "rust", "vim", "javascript", "html", "css", "python", "java", "lua", "perl", "php", "c", "json" }, + + ignore_install = { "latex", "markdown", "htmldjango" }, + + sync_install = false, + + auto_install = false, + + highlight = { + enable = true, + + addition_vim_regex_highlighting = false, + }, +} + diff --git a/nvim/dot-config/nvim/after/plugin/undotree.lua b/nvim/dot-config/nvim/after/plugin/undotree.lua new file mode 100644 index 0000000..48822a4 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/undotree.lua @@ -0,0 +1,2 @@ +vim.keymap.set("n", "ut", vim.cmd.UndotreeToggle) + diff --git a/nvim/dot-config/nvim/after/plugin/vimtex.lua b/nvim/dot-config/nvim/after/plugin/vimtex.lua new file mode 100644 index 0000000..2b34d64 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/vimtex.lua @@ -0,0 +1,21 @@ +vim.cmd([[ + +syntax enable + +let g:maplocalleader=' ' +let g:vimtex_view_method='zathura' +let g:tex_flavor='latex' +let g:vimtex_quickfix_mode=0 +set conceallevel=0 +let g:tex_conceal='abdmg' +let g:vimtex_view_forward_search_on_start=0 " Weird highlighting otherwise + +augroup vimtex_config + au! + au User VimtexEventQuit call vimtex#compiler#clean(0) +augroup END + +]]) + + + diff --git a/nvim/dot-config/nvim/after/plugin/whichkey.lua b/nvim/dot-config/nvim/after/plugin/whichkey.lua new file mode 100644 index 0000000..f1fd478 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/whichkey.lua @@ -0,0 +1,16 @@ +require("which-key").setup({ + window = { + border = "single", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = { 0, 0, 0, 0 }, -- extra window margin [top, right, bottom, left]. When between 0 and 1, will be treated as a percentage of the screen size. + padding = { 0, 2, 0, 2 }, -- extra window padding [top, right, bottom, left] + winblend = 0, -- value between 0-100 0 for fully opaque and 100 for fully transparent + zindex = 1000, -- positive value to position WhichKey above other floating windows. + }, + layout = { + height = { min = 4, max = 25 }, -- min and max height of the columns + width = { min = 20, max = 50 }, -- min and max width of the columns + spacing = 3, -- spacing between columns + align = "left", -- align columns left, center or right + }, +}) diff --git a/nvim/dot-config/nvim/after/plugin/yazi.lua b/nvim/dot-config/nvim/after/plugin/yazi.lua new file mode 100644 index 0000000..2fdf5ca --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/yazi.lua @@ -0,0 +1,4 @@ +vim.keymap.set("n", "e", function () + vim.cmd("Yazi") +end) + diff --git a/nvim/dot-config/nvim/after/plugin/zenmode.lua b/nvim/dot-config/nvim/after/plugin/zenmode.lua new file mode 100644 index 0000000..5459116 --- /dev/null +++ b/nvim/dot-config/nvim/after/plugin/zenmode.lua @@ -0,0 +1,62 @@ +require('zen-mode').setup { + window = { + backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal + -- height and width can be: + -- * an absolute number of cells when > 1 + -- * a percentage of the width / height of the editor when <= 1 + -- * a function that returns the width or the height + width = 120, -- width of the Zen window + height = 1, -- height of the Zen window + -- by default, no options are changed for the Zen window + -- uncomment any of the options below, or add other vim.wo options you want to apply + options = { + signcolumn = "no", -- disable signcolumn + number = false, -- disable number column + relativenumber = false, -- disable relative numbers + cursorline = false, -- disable cursorline + cursorcolumn = false, -- disable cursor column + foldcolumn = "0", -- disable fold column + -- list = false, -- disable whitespace characters + }, + }, + plugins = { + -- disable some global vim options (vim.o...) + -- comment the lines to not apply the options + options = { + enabled = true, + ruler = false, -- disables the ruler text in the cmd line area + showcmd = false, -- disables the command in the last line of the screen + }, + twilight = { enabled = true }, -- enable to start Twilight when zen mode opens + gitsigns = { enabled = false }, -- disables git signs + tmux = { enabled = false }, -- disables the tmux statusline + -- this will change the font size on kitty when in zen mode + -- to make this work, you need to set the following kitty options: + -- - allow_remote_control socket-only + -- - listen_on unix:/tmp/kitty + kitty = { + enabled = false, + font = "+4", -- font size increment + }, + -- this will change the font size on alacritty when in zen mode + -- requires Alacritty Version 0.10.0 or higher + -- uses `alacritty msg` subcommand to change font size + alacritty = { + enabled = false, + font = "14", -- font size + }, + -- this will change the font size on wezterm when in zen mode + -- See alse also the Plugins/Wezterm section in this projects README + wezterm = { + enabled = false, + -- can be either an absolute font size or the number of incremental steps + font = "+4", -- (10% increase per step) + }, + }, + -- callback where you can add custom code when the Zen window opens + on_open = function(win) + end, + -- callback where you can add custom code when the Zen window closes + on_close = function() + end, +} diff --git a/nvim/dot-config/nvim/after/syntax/asm.vim b/nvim/dot-config/nvim/after/syntax/asm.vim new file mode 100644 index 0000000..c923012 --- /dev/null +++ b/nvim/dot-config/nvim/after/syntax/asm.vim @@ -0,0 +1,40 @@ +syntax case ignore + +" Match regexes. +syntax match lc3Label /[A-Za-z_][A-Za-z0-9_]*/ +syntax match lc3Register /[rR][0-7]/ +syntax match lc3Decimal /#\=-\=\<[0-9]\+\>/ +syntax match lc3Hex /x-\=[A-Fa-f0-9]\+/ +syntax match lc3Binary /b-\=[01]\+/ +syntax region lc3String start=+"+ skip=+\\"+ end=+"+ +syntax region lc3Comment start=+;+ end=+$+ + +" Assembler directives/pseudo-ops +syntax match lc3Directive /\.orig/ +syntax match lc3Directive /\.end/ +syntax match lc3Directive /\.fill/ +syntax match lc3Directive /\.blkw/ +syntax match lc3Directive /\.stringz/ + +" LC-3 opcodes/aliases, minus branches +syntax keyword lc3Opcode add ld st jsrr jsr and ldr str rti not ldi sti jmp ret lea trap nop +" Branches +syntax keyword lc3Opcode br brn brz brp brnz brnp brzp brnzp +" Trap subroutines +syntax keyword lc3Opcode getc out puts in putsp halt +" LC-3b opcodes +syntax keyword lc3Opcode ldb ldw lshf rshfl rshfa stb stw xor + +" Link colors. +hi def link lc3Opcode Statement +hi def link lc3Label Identifier +hi def link lc3Register Type +hi def link lc3Directive Define +hi def link lc3Decimal Number +hi def link lc3Hex Number +hi def link lc3Binary Number +hi def link lc3String String +hi def link lc3Comment Comment + +let b:current_syntax = "asm" + diff --git a/nvim/dot-config/nvim/after/syntax/lua.vim b/nvim/dot-config/nvim/after/syntax/lua.vim new file mode 100644 index 0000000..aa05f50 --- /dev/null +++ b/nvim/dot-config/nvim/after/syntax/lua.vim @@ -0,0 +1,15 @@ + +syn include @Vim $VIMRUNTIME/syntax/vim.vim +syn region embedvim matchgroup=luaEmbedError start="vim\.api\.nvim_command(\[\[" end="\]\])" keepend contains=@Vim +syn region embedvim matchgroup=luaEmbedError start="vim\.api\.nvim_command \[\[" end="\]\]" keepend contains=@Vim +syn region embedvim matchgroup=luaEmbedError start="vim\.api\.nvim_exec(\[\[" end="\]\])" keepend contains=@Vim +syn region embedvim matchgroup=luaEmbedError start="vim\.api\.nvim_exec \[\[" end="\]\]" keepend contains=@Vim +syn region embedvim matchgroup=luaEmbedError start="vim\.cmd \[\[" end="\]\]" keepend contains=@Vim +syn region embedvim matchgroup=luaEmbedError start="vim\.cmd(\[\[" end="\]\])" keepend contains=@Vim +syn region embedvim matchgroup=luaEmbedError start="vim\.cmd \"" end="\"" keepend contains=@Vim +syn region embedvim matchgroup=luaEmbedError start="vim\.cmd(\"" end="\")" keepend contains=@Vim +syn region embedvim matchgroup=luaEmbedError start="vim\.cmd '" end="'" keepend contains=@Vim +syn region embedvim matchgroup=luaEmbedError start="vim\.cmd('" end="')" keepend contains=@Vim + +let b:current_syntax = 'lua' + diff --git a/nvim/dot-config/nvim/init.lua b/nvim/dot-config/nvim/init.lua new file mode 100644 index 0000000..3a19e05 --- /dev/null +++ b/nvim/dot-config/nvim/init.lua @@ -0,0 +1,2 @@ +require("andrew") + diff --git a/nvim/dot-config/nvim/lua/andrew/init.lua b/nvim/dot-config/nvim/lua/andrew/init.lua new file mode 100644 index 0000000..180a9a4 --- /dev/null +++ b/nvim/dot-config/nvim/lua/andrew/init.lua @@ -0,0 +1,4 @@ +require("andrew.remap") +require("andrew.packer") +require("andrew.set") + diff --git a/nvim/dot-config/nvim/lua/andrew/packer.lua b/nvim/dot-config/nvim/lua/andrew/packer.lua new file mode 100644 index 0000000..82aa4e1 --- /dev/null +++ b/nvim/dot-config/nvim/lua/andrew/packer.lua @@ -0,0 +1,137 @@ +local ensure_packer = function() + local fn = vim.fn + local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' + if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}) + vim.cmd [[packadd packer.nvim]] + return true + end + return false +end + +local packer_bootstrap = ensure_packer() + +return require("packer").startup(function(use) + use "goolord/alpha-nvim" + + use "wbthomason/packer.nvim" + + use "DreamMaoMao/yazi.nvim" + + use "whonore/Coqtail" + + use { + "folke/which-key.nvim", + config = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end + } + + -- File manager in nvim + use { + "ptzz/lf.vim", + requires = { {"voldikss/vim-floaterm"} }, + } + vim.cmd("let g:lf_map_keys = 0") -- Need to put here or else doesn't work + + -- Zen mode + use "folke/zen-mode.nvim" + + -- Find files and strings + use { + "nvim-telescope/telescope.nvim", tag = "0.1.4", + requires = { {"nvim-lua/plenary.nvim"} } + } + + -- Treesitter + use({"nvim-treesitter/nvim-treesitter", run = ":TSUpdate"}) + + -- Themes + use "aktersnurra/no-clown-fiesta.nvim" + use "ellisonleao/gruvbox.nvim" + use { 'rose-pine/neovim', as = 'rose-pine' } + use 'Mofiqul/vscode.nvim' + + -- Referencing a hex code highlights it in that color + use "norcalli/nvim-colorizer.lua" + + -- Relative line numbers disappear when not actively in buffer + use "jeffkreeftmeijer/vim-numbertoggle" + + -- History visualizer + use "mbbill/undotree" + + -- See function signatures when typing them + use "ray-x/lsp_signature.nvim" + require "lsp_signature".setup({}) + + -- Left-side file tree dispaly + use { + "nvim-tree/nvim-tree.lua", + requires = { + "nvim-tree/nvim-web-devicons", -- for file icons + }, + tag = "nightly" -- optional, updated every week + } + + -- Shows current mode on bottom of screen + use "itchyny/lightline.vim" + + -- LSP + use { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v3.x', + requires = { + -- LSP Support + {'neovim/nvim-lspconfig'}, -- Required + + -- Autocompletion + {'hrsh7th/nvim-cmp'}, -- Required + {'hrsh7th/cmp-nvim-lsp'}, -- Required + {'hrsh7th/cmp-buffer'}, -- Optional + {'hrsh7th/cmp-path'}, -- Optional + {'saadparwaiz1/cmp_luasnip'}, -- Optional + {'hrsh7th/cmp-nvim-lua'}, -- Optional + + -- Snippets + {'L3MON4D3/LuaSnip'}, -- Required + {'rafamadriz/friendly-snippets'}, -- Optional + } + } + + -- Better diagnostics + use { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + } + + -- Linting + use "jose-elias-alvarez/null-ls.nvim" + + -- Git wrapper + use("tpope/vim-fugitive") + + -- Latex editing in vim + use "lervag/vimtex" + + -- Auto comment + use "numToStr/Comment.nvim" + + -- Markdown + use({ + "agryphus/markdown-preview.nvim", + run = function() vim.fn["mkdp#util#install"]() end, + }) + + -- Jupyter notebook integration + -- use { + -- "glacambre/firenvim", + -- run = function() vim.fn["firenvim#install"](0) end + -- } + + if packer_bootstrap then + require('packer').sync() + end +end) + diff --git a/nvim/dot-config/nvim/lua/andrew/remap.lua b/nvim/dot-config/nvim/lua/andrew/remap.lua new file mode 100644 index 0000000..c620ac3 --- /dev/null +++ b/nvim/dot-config/nvim/lua/andrew/remap.lua @@ -0,0 +1,60 @@ +vim.g.mapleader = " " + +-- opens file explorer +vim.keymap.set("n", "pv", vim.cmd.Ex) + +-- centers cursor when jumping up and down page +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "", "zz") +vim.keymap.set("n", "J", "mzJ`z") +vim.keymap.set("n", "n", "nzzzv") +vim.keymap.set("n", "N", "Nzzzv") + +-- easier escape back to normal mode +vim.keymap.set("i", "", "") + +vim.keymap.set("n", "Q", "") + +-- universal find and replace +vim.keymap.set("n", "s", [[:%s/\<\>//gI]]) + +-- moving highlighted text +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + +-- allow for pasting over without losing buffer +vim.keymap.set("x", "p", "\"_dP") + +-- allow copying to system clipboard +vim.keymap.set("n", "y", "\"+y") +vim.keymap.set("v", "y", "\"+y") +vim.keymap.set("n", "y", "\"+y") + +-- allow deleting to void register +vim.keymap.set("n", "d", "\"_d") +vim.keymap.set("v", "d", "\"_d") + +vim.keymap.set("n", "tc", + function () + local col = "78" + print(vim.o.cc) + if vim.o.cc == col then + vim.o.cc = "" + else + vim.o.cc = col + end + end, + {desc = "Toggle color column"}) + +-- case insensitive search +vim.keymap.set("n", "/", "/\\c") +vim.keymap.set("n", "?", "?\\c") + +vim.keymap.set("n", "hF", + function() + local result = vim.treesitter.get_captures_at_cursor(0) + print(vim.inspect(result)) + end, + { noremap = true, silent = false, desc = "Describe face" } +) + diff --git a/nvim/dot-config/nvim/lua/andrew/set.lua b/nvim/dot-config/nvim/lua/andrew/set.lua new file mode 100644 index 0000000..32b7a34 --- /dev/null +++ b/nvim/dot-config/nvim/lua/andrew/set.lua @@ -0,0 +1,48 @@ +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.linebreak = true + +local autocmd = vim.api.nvim_create_autocmd +autocmd("bufenter", { + pattern = "*", + callback = function() + if vim.bo.ft ~= "terminal" then + vim.opt.laststatus = 2 + else + vim.opt.laststatus = 0 + end + end, +}) + +-- Only search with case if capital letter is typed +vim.opt.ignorecase = true +vim.opt.smartcase = true +vim.opt.wrap = true + +vim.opt.splitbelow = true + +vim.opt.scrolloff = 8 +vim.opt.signcolumn = "auto" + +vim.o.shell = "zsh" + +-- Do not map q to :q in man mode +vim.g.no_man_maps = true; + +-- Local settings for when in :terminal mode +-- I don't believe this functionality has been ported to lua. +vim.cmd([[ +function! TerminalSettings() + setlocal nonumber norelativenumber + setlocal scrolloff=0 +endfunction +autocmd TermOpen * call TerminalSettings() +]]) + diff --git a/scripts/auto_rice b/scripts/auto_rice deleted file mode 100755 index 5547afb..0000000 --- a/scripts/auto_rice +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env sh -# Automatically deploys my rice onto a new system - -git_url="https://github.com/agryphus/archrice.git" -location="$HOME/repos/dotfiles" - -if [ ! -d "$location" ]; then - mkdir -p "$location" -fi - -cd "$location" - -if [ "$(git remote get-url origin 2> /dev/null)" != "$git_url" ]; then - git clone --bare "$git_url" . -fi - -alias config="git --git-dir $location --work-tree=$HOME" -config config status.showUntrackedFiles no - -# Checkout branch, but move collisions to ~/.config-backup -if [ ! -e "$location/checked" ]; then - mkdir -p "$HOME/.config-backup" - config checkout 2>&1 \ - | egrep "\s+\." | awk {'print $1'} \ - | xargs -I {} mv {} "$HOME/.config-backup/"{} - - # Fix unsafe permissions on gnupg directory - chmod 700 "$HOME/.local/share/gnupg/" - - # Empty file, indicating the repo has been checked out once - touch "$location/checked" -fi - -config submodule init -config submodule update --force --recursive --init --remote -config submodule foreach "git checkout master" - -cd $HOME - -exec zsh -