From 423d9e231fe3aa040b1958d157bd7a130b3f3e4e Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Sun, 18 Dec 2022 10:15:15 -0500 Subject: [PATCH] Start logging the nix config --- dconf.nix | 43 ++++ home.nix | 109 +++++++++ nixos.nix | 222 ++++++++++++++++++ programs/firefox.nix | 60 +++++ programs/fish.nix | 116 +++++++++ programs/kitty.nix | 61 +++++ programs/neovim.nix | 220 +++++++++++++++++ programs/neovim/init.vim | 31 +++ .../neovim/laserwave/colors/laserwave.vim | 58 +++++ 9 files changed, 920 insertions(+) create mode 100644 dconf.nix create mode 100644 home.nix create mode 100644 nixos.nix create mode 100644 programs/firefox.nix create mode 100644 programs/fish.nix create mode 100644 programs/kitty.nix create mode 100644 programs/neovim.nix create mode 100644 programs/neovim/init.vim create mode 100644 programs/neovim/laserwave/colors/laserwave.vim diff --git a/dconf.nix b/dconf.nix new file mode 100644 index 0000000..41f4e13 --- /dev/null +++ b/dconf.nix @@ -0,0 +1,43 @@ +{ + "org/gnome/shell/extensions/pop-shell" = { + tile-move-down-global=["j"]; + tile-move-up-global=["k"]; + tile-move-left-global=["h"]; + tile-move-right-global=["l"]; + focus-down=["j"]; + focus-up=["k"]; + focus-left=["h"]; + focus-right=["l"]; + tile-orientation=["o"]; + tile-floating=["g"]; + tile-stacking-global=["s"]; + + active-hint=true; + active-hint-border-radius=true; + show-title=false; + smart-gaps=true; + snap-to-grid=true; + tile-by-default=true; + }; + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = ["/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal/"]; + screensaver = ["Escape"]; + }; + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/terminal" = { + binding="t"; + command="kitty"; + name="Terminal"; + }; + "org/gnome/settings-daemon/plugins/power" = { + ambient-enabled = false; + }; + "org/gnome/mutter" = { + dynamic-workspaces=false; + overlay-key="Alt_L"; + # Enable fractional scaling + experimental-features=["scale-monitor-framebuffer"]; + }; + "org/gnome/desktop/interface" = { + show-battery-percentage=true; + }; +} diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..915f530 --- /dev/null +++ b/home.nix @@ -0,0 +1,109 @@ +{pkgs, ...}: { + home.sessionVariables = { + NNN_FIFO = "/tmp/nnn.fifo"; + LANG = "en_US.UTF-8"; + EDITOR = "nvim"; + MOZ_ENABLE_WAYLAND = "1"; + }; + home.keyboard.layout = "us"; + home.keyboard.variant = "3l"; + home.packages = with pkgs; [ + restic + ripgrep + libqalculate + clapper + git-annex + git-annex-remote-rclone + qrencode + gnomeExtensions.blur-my-shell + gnomeExtensions.burn-my-windows + gnomeExtensions.pop-shell + gnomeExtensions.firefox-pip-always-on-top + ]; + editorconfig = { + enable = true; + settings."*" = { + indent_style = "tab"; + indent_size = 4; + end_of_line = "lf"; + charset = "utf-8"; + max_line_length = 90; + trim_trailing_whitespace = true; + insert_final_newline = false; + }; + settings."{*.{md,gmi,adoc},COMMIT_EDITMSG}" = { + max_line_length = 0; + }; + settings."*.{elm,lisp,yml,purs}" = { + indent_style = "space"; + indent_size = 2; + }; + settings."*.{wat,nix}" = { + indent_size = 2; + }; + settings."*.asm" = { + indent_style = "tab"; + indent_size = "tab"; + max_line_length = 80; + }; + }; + programs.git = { + enable = true; + lfs.enable = true; + signing.key = "ACABBABE77B76F6301F4ACF97A0F4799BF91C8C1"; + signing.signByDefault = true; + userName = "Emi Simpson"; + userEmail = "emi@alchemi.dev"; + extraConfig = { + init.defaultbranch = "main"; + diff.algorithm = "patience"; + core.compression = 9; + core.editor = "nvim"; + pull.rebase = false; + }; + }; + programs.kitty = import programs/kitty.nix pkgs; + programs.password-store = { + enable = true; + package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]); + }; + programs.fish = import programs/fish.nix pkgs; + programs.firefox = import programs/firefox.nix pkgs; + programs.nnn = { + enable = true; + plugins.mappings = { + p = "preview-tui"; + }; + plugins.src = (pkgs.fetchFromGitHub { + owner = "jarun"; + repo = "nnn"; + rev = "0c23406"; + sha256 = "sha256-Hpc8YaJeAzJoEi7aJ6DntH2VLkoR6ToP6tPYn3llR7k="; + }) + "/plugins"; + extraPackages = with pkgs; [ + tree + file + unzip + bat + ffmpeg + ffmpegthumbnailer + poppler_utils + glow + w3m + ]; + }; + programs.neovim = import programs/neovim.nix pkgs; + programs.gpg.enable = true; + programs.jq.enable = true; + services.gpg-agent = { + enable = true; + maxCacheTtl = 180; # Seconds + pinentryFlavor = "gnome3"; + }; + # Package broken as of 2022-12-14 + # services.etesync-dav.enable = true; + services.syncthing.enable = true; + dconf.settings = import ./dconf.nix; + home.stateVersion = "22.11"; + targets.genericLinux.enable = true; +} diff --git a/nixos.nix b/nixos.nix new file mode 100644 index 0000000..09af485 --- /dev/null +++ b/nixos.nix @@ -0,0 +1,222 @@ +# sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware +# sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager + +{ config, pkgs, ... }: + +{ + networking.hostName = "kudzu"; + + imports = + [ # Include the results of the hardware scan. + # + # DON'T FORGET to add your hardware config too + # https://github.com/NixOS/nixos-hardware/ + # + # Also make sure to move the swap configuration to the hardware config + /etc/nixos/hardware-configuration.nix + + ]; + + # Bootloader + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + boot.kernelParams = [ + # Power efficiency + # https://wiki.archlinux.org/title/Power_management#Kernel_parameters + "nmi_watchdog=0" + ]; + + boot.kernel.sysctl = { + # Set IO batching to 2 minutes for power reasons + "vm.dirty_writeback_centisecs" = 12000; + }; + + # Setup keyfile + boot.initrd.secrets = { + "/crypto_keyfile.bin" = null; + }; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/New_York"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + services.logind.lidSwitch = "ignore"; + + # Enable the GNOME Desktop Environment. + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome = { + enable = true; + extraGSettingsOverrides = '' + # Favorite apps in gnome-shell + # [org.gnome.shell] + # favorite-apps=['org.gnome.Photos.desktop', 'org.gnome.Nautilus.desktop'] + + [org.gnome.desktop.input-sources] + show-all-sources=true + sources=[('xkb', 'us'), ('xkb', 'us+3l')] + + [org.gnome.desktop.wm.preferences] + num-workspaces=5 + + [org.gnome.desktop.wm.keybindings] + # Pop shell bindings + minimize=['comma'] + switch-to-workspace-left=@as [] + switch-to-workspace-right=@as [] + maximize=@as [] + unmaximize=@as [] + move-to-monitor-up=@as [] + move-to-monitor-down=@as [] + move-to-monitor-left=@as [] + move-to-monitor-right=@as [] + switch-to-workspace-down=@as [] + switch-to-workspace-up=@as [] + toggle-fullscreen=['m'] + close=['q'] + switch-to-workspace-1=@as ['1'] + switch-to-workspace-2=@as ['2'] + switch-to-workspace-3=@as ['3'] + switch-to-workspace-4=@as ['4'] + switch-to-workspace-5=@as ['5'] + move-to-workspace-1=@as ['1'] + move-to-workspace-2=@as ['2'] + move-to-workspace-3=@as ['3'] + move-to-workspace-4=@as ['4'] + move-to-workspace-5=@as ['5'] + + [org.gnome.shell.keybindings] + open-application-menu=@as [] + toggle-message-tray=@as [] + toggle-overview=@as [] + + [org.gnome.mutter.keybindings] + toggle-tiled-left=@as [] + toggle-tiled-right=@as [] + ''; + extraGSettingsOverridePackages = [ + pkgs.gsettings-desktop-schemas # for org.gnome.desktop + pkgs.gnome.gnome-shell # for org.gnome.shell + ]; + }; + + # Configure keymap in X11 + services.xserver = { + layout = "us"; + xkbVariant = "3l"; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.ember = { + uid = 1312; + isNormalUser = true; + description = "Ember"; + extraGroups = [ "networkmanager" "wheel" ]; + shell = pkgs.fish; + }; + home-manager.users.ember = import ./home.nix; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + environment.systemPackages = with pkgs; [ + wget + gnumake + htop + wl-clipboard + unzip + vlc + gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-libav gst_all_1.gst-vaapi gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-good gst_all_1.gst-plugins-ugly + ]; + environment.gnome.excludePackages = with pkgs.gnome; [ + gnome-terminal + gnome-music + gedit + geary + totem + ]; + + # List services that you want to enable: + + services = { + flatpak = { + enable = true; + }; + fwupd.enable = true; + }; + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + networking.hosts = { + "162.255.119.254" = ["www.librepunk.club"]; + "129.21.49.69" = ["www.librepunk.club"]; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "22.11"; # Did you read the comment? + + # Set up hardware acceleration + # https://nixos.wiki/wiki/Accelerated_Video_Playback + hardware.opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-compute-runtime + intel-media-driver # LIBVA_DRIVER_NAME=iHD + vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium) + vaapiVdpau + libvdpau-va-gl + ]; + }; +} diff --git a/programs/firefox.nix b/programs/firefox.nix new file mode 100644 index 0000000..9b12346 --- /dev/null +++ b/programs/firefox.nix @@ -0,0 +1,60 @@ +pkgs: { + enable = true; + profiles = { nixos = { + name = "NixOS Profile"; + settings = { + "media.ffmpeg.vaapi.enabled" = true; + "browser.startup.homepage" = "https://ipfs.io/ipfs/QmcnP6Fa2cs8SMLAMC12caF1pFoso4ZKU8FLKagFtKGfa1"; + "browser.cache.disk.capacity" = 536870912; # 1 GiB + "extensions.pocket.enabled" = false; + }; + search.force = true; + search.default = "DuckDuckGo"; + search.engines = { + "Library Genesis" = { + urls = [{ + template = "https://libgen.rs/search.php"; + params = [ + {name = "req"; value = "{searchTerms}";} + ]; + }]; + iconUpdateURL = "https://libgen.rs/favicon.ico"; + updateInterval = 7 * 24 * 60 * 60 * 1000; # every week + definedAliases = [ "!lg" ]; + }; + "YouTube" = { + urls = [{ + template = "https://youtube.com/results"; + params = [ + {name = "search_query"; value = "{searchTerms}";} + {name = "page"; value = "{startPage}";} + ]; + }]; + iconUpdateURL = "https://www.youtube.com/favicon.ico"; + updateInterval = 7 * 24 * 60 * 60 * 1000; # every week + definedAliases = [ "!yt" ]; + }; + "ArchWiki" = { + urls = [{ + template = "https://wiki.archlinux.org/index.php"; + params = [ + {name = "search"; value = "{searchTerms}";} + {name = "title"; value = "Special:Search";} + ]; + }]; + iconUpdateURL = "https://wiki.archlinux.org/favicon.ico"; + updateInterval = 7 * 24 * 60 * 60 * 1000; # every week + definedAliases = [ "!a" ]; + }; + "NixOS Wiki" = { + urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://nixos.wiki/favicon.png"; + updateInterval = 7 * 24 * 60 * 60 * 1000; # every week + definedAliases = [ "!nix" ]; + }; + "Wikipedia (en)".metaData.alias = "!w"; + "Google".metaData.alias = "!g"; + "Bing".metaData.hidden = true; + }; + };}; +} diff --git a/programs/fish.nix b/programs/fish.nix new file mode 100644 index 0000000..4d6b6c8 --- /dev/null +++ b/programs/fish.nix @@ -0,0 +1,116 @@ +pkgs: { + enable = true; + plugins = [ + { + name = "bang-bang"; + src = pkgs.fetchFromGitHub { + owner = "oh-my-fish"; + repo = "plugin-bang-bang"; + rev = "816c66d"; + hash = "sha256-35xXBWCciXl4jJrFUUN5NhnHdzk6+gAxetPxXCv4pDc="; + }; + } + ]; + shellAliases = { + clip = "kitty +kitten clipboard"; + l = "ls -lah --hyperlink=auto"; + icat = "kitty +kitten icat"; + rust-musl-builder = "fish -c 'docker run --rm -it -v (pwd):/home/rust/src ekidd/rust-musl-builder cargo build --release'"; + lonk = "qrencode -t utf8i"; + s = "kitty +kitten ssh"; + weather = "curl wttr.in/43.0844,-77.6749"; + }; + shellInit = '' + set -x PATH ~/.cargo/bin/ ~/go/bin ~/.local/bin ~/.gem/ruby/*/bin /var/lib/flatpak/exports/bin/ $PATH + set -x KEYFILE ~/.config/void/keyfile + + set fish_color_command magenta + set fish_color_normal white + set fish_color_param ffffff + set fish_color_quote blue + set fish_color_redirection green + set fish_color_end b4a8c8 + set fish_color_comment black + set fish_color_operator green + set fish_color_escape yellow + set fish_color_autosuggestion 91889b + + set fish_greeting "" + + # echo "You're cute and loved <3" + # echo "You seriously are incredibly wonderful and you mean so much to me, you've made my life so much brighter and i never wanna let you go <3" + ''; + functions = { + n = { + description = "support nnn quit and change directory"; + wraps = "nnn"; + body = '' + # Block nesting of nnn in subshells + if test -n "$NNNLVL" + if [ (expr $NNNLVL + 0) -ge 1 ] + echo "nnn is already running" + return + end + end + set -x NNN_TMPFILE '.nnn.tmp' + nnn $argv + if test -e $NNN_TMPFILE + source $NNN_TMPFILE + rm $NNN_TMPFILE + end + ''; + }; + fish_prompt = '' + # Theme based on Bira theme from oh-my-zsh: https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/bira.zsh-theme + # Some code stolen from oh-my-fish clearance theme: https://github.com/bpinto/oh-my-fish/blob/master/themes/clearance/ + # Further modification by Ember, to make the colors cooler + + function __user_host + set -l content + echo -n (set_color --bold cyan) + echo -n $USER@(hostname|cut -d . -f 1) (set color normal) + end + + function __current_path + echo -n (set_color --bold red) (pwd) (set_color normal) + end + + function _git_branch_name + echo (command git symbolic-ref HEAD 2> /dev/null | sed -e 's|^refs/heads/||') + end + + function _git_is_dirty + echo (command git status -s --ignore-submodules=dirty 2> /dev/null) + end + + function __git_status + if [ (_git_branch_name) ] + set -l git_branch (_git_branch_name) + + if [ (_git_is_dirty) ] + set git_info '['$git_branch"*"']' + else + set git_info '['$git_branch']' + end + + echo -n (set_color white) $git_info (set_color normal) + end + end + + function fish_right_prompt + set -l st $status + + if [ $st != 0 ]; + echo (set_color red) ↵ $st(set_color normal) + end + end + + echo -n (set_color white)"╭─"(set_color normal) + __user_host + __current_path + __git_status + echo -e ''' + echo (set_color white)"╰─"(set_color --bold white)"\$ "(set_color normal) + ''; + }; +} diff --git a/programs/kitty.nix b/programs/kitty.nix new file mode 100644 index 0000000..e755238 --- /dev/null +++ b/programs/kitty.nix @@ -0,0 +1,61 @@ +pkgs: { + enable = true; + font.name = "Comic Mono"; + font.package = pkgs.comic-mono; + font.size = 13; + settings = { + hide_window_decorations = true; + tab_bar_style = "powerline"; + tab_powerline_style = "slanted"; + window_padding_width = 5; + allow_remote_control = true; + listen_on = "unix:/tmp/kitty"; + enabled_layouts = "splits"; + close_on_child_death = true; + scrollback_lines = 4000; + repaint_delay = 17; + input_delay = 17; + shell = "fish"; + editor = "nvim"; + + foreground = "#ffffff"; + background = "#201B27"; + selection_foreground = "#201B27"; + selection_background = "#ffffff"; + + # Old Lavender (Comments) + color0 = "#91889b"; + color8 = "#91889b"; + + # Hot Pink (Functions, Attributes, Highlights) + color1 = "#ff52bf"; + color9 = "#ff52bf"; + + # Pearl Aqua (Operators, Tags) + color2 = "#3feabf"; + color10 = "#3feabf"; + + # Mustard (Builtins, Constants) + color3 = "#ffe261"; + color11 = "#ffe261"; + + # Powder Blue (Strings) + color4 = "#acdfef"; + color12 = "#acdfef"; + + # African Violet (Numbers, Types) + color5 = "#d887f5"; + color13 = "#d887f5"; + + # Maximum Blue (Keywords, Properties) + color6 = "#1ed3ec"; + color14 = "#1ed3ec"; + + # Unnamed (Cool Mystery Purposes ig) + color7 = "#716385"; + color15 = "#716385"; + + # Roman Siler (Punctuation) + # b4a8c8 + }; +} diff --git a/programs/neovim.nix b/programs/neovim.nix new file mode 100644 index 0000000..263e68e --- /dev/null +++ b/programs/neovim.nix @@ -0,0 +1,220 @@ +with builtins; + +let + mkSettings = s: + concatStringsSep + "\n" + (attrValues + (mapAttrs + (k: v: + if typeOf v == "bool" then + if v then "set ${k}" else "set no${k}" + else + "set ${k}=${toString v}") + s + ) + ); + boolToString = b: if b then "true" else "false"; + toLuaTable = as: + "{" + + ( concatStringsSep + ", " + ( filter + (attr: !isNull attr) + ( attrValues + ( mapAttrs + (k: v: if v then "${k}=true" else null) + as + ) + ) + ) + ) + + "}"; + mkMapping = { + mode, + binding, + command, + nowait?false, + silent?false, + unique?false, + expr?false + }: + "vim.api.nvim_set_keymap(${toJSON mode}, ${toJSON binding}, ${toJSON command}, ${toLuaTable {inherit nowait silent unique expr;}})"; + mkMappings = + m: + "lua << END-OF-KEYBINDS\n" + + (concatStringsSep "\n" (map mkMapping m)) + + "\nEND-OF-KEYBINDS"; + mkRuntimes = rs: + if rs == [] then "" else + "set runtimepath+=" + + ( concatStringsSep + "," + (map (rt: "${rt}") rs) + ); + mkVimHeader = h: "\"\"\"\"\"\"\"\" ${h} \"\"\"\"\"\"\"\"\""; + mkVimSection = section: + (concatStringsSep "\n\n\n" + (filter + (v: !isNull v) + (attrValues + (mapAttrs + (k: v: if "" == v then null else (mkVimHeader k) + "\n" + v) + section + ) + ) + ) + ); + mkVimSections = sections: concatStringsSep "\n\n\n" (map mkVimSection sections); + mkConfig = { settings?{}, mappings?[], runtimes?[], extra?"" }: + mkVimSections [ + {"ADDITIONAL RUNTIME DIRS" = mkRuntimes runtimes;} + {"SETTINGS" = mkSettings settings;} + {"KEY BINGINGS" = mkMappings mappings;} + {"MANUAL SETTINGS" = extra;} + ]; +in +pkgs: { + enable = true; + plugins = with pkgs.vimPlugins; [ + editorconfig-nvim + vim-airline + vim-airline-themes + lsp_signature-nvim + nvim-colorizer-lua + nnn-vim + nvim-surround + hop-nvim + nvim-treesitter.withAllGrammars + nvim-ts-rainbow + nvim-lspconfig + ]; + extraConfig = mkConfig { + settings = { + number = true; + expandtab = false; + linebreak = true; + display = "lastline"; + comments = "s1:/*,mb:*,ex:*/,:///\\ #,:///,://!,://,b:#,:%,:XCOMM,n:>,b:-,b:*"; + tgc = true; + tw = 90; + foldmethod = "expr"; + foldexpr = "nvim_treesitter#foldexpr()"; + foldminlines = 10; + foldnestmax = 2; + }; + mappings = [ + { + mode = ""; + binding = ""; + command = ":tab split"; + } + { + mode = "n"; + binding = ""; + command = "call nnn#pick(expand('%:p:h'))"; + } + { + mode = "n"; + binding = ""; + command = "HopWord"; + } + { + mode = "n"; + binding = ""; + command = "HopChar2"; + } + { + mode = "i"; + binding = ""; + command = "coc#pum#visible() ? coc#pum#next(1) : CheckBackspace() ? \"\\\" : coc#refresh()"; + silent = true; + expr = true; + } + { + mode = "i"; + binding = ""; + command = "coc#pum#visible() ? coc#pum#prev(1) : \"\\\""; + expr = true; + } + { + mode = "i"; + binding = ""; + command = "coc#pum#visible() ? coc#pum#confirm() : \"\\u\\\\=coc#on_enter()\\\""; + silent = true; + expr = true; + } + { + mode = "n"; + binding = ""; + command = "coc#refresh()"; + silent = true; + } + { + mode = "n"; + binding = "[g"; + command = "(coc-diagnostic-prev)"; + silent = true; + } + { + mode = "n"; + binding = "]g"; + command = "(coc-diagnostic-next)"; + silent = true; + } + { + mode = "n"; + binding = "gd"; + command = "(coc-definition)"; + silent = true; + } + { + mode = "n"; + binding = "gy"; + command = "(coc-type-definition)"; + silent = true; + } + { + mode = "n"; + binding = "gi"; + command = "(coc-implementation)"; + silent = true; + } + { + mode = "n"; + binding = "gr"; + command = "(coc-references)"; + silent = true; + } + { + mode = "n"; + binding = "K"; + command = ":call ShowDocumentation()"; + silent = true; + } + { + mode = "n"; + binding = "..."; + command = "(coc-codeaction-cursor)"; + silent = true; + } + { + mode = "n"; + binding = "rn"; + command = "(coc-rename)"; + silent = true; + } + { + mode = "n"; + binding = "cl"; + command = "(coc-codelens-action)"; + silent = true; + } + ]; + runtimes = [neovim/laserwave]; + extra = builtins.readFile neovim/init.vim; + }; + coc.enable = true; + coc.settings = { + }; +} \ No newline at end of file diff --git a/programs/neovim/init.vim b/programs/neovim/init.vim new file mode 100644 index 0000000..b628530 --- /dev/null +++ b/programs/neovim/init.vim @@ -0,0 +1,31 @@ +:colo laserwave +:let g:airline_theme="fruit_punch" +:let g:EditorConfig_exclude_patterns = ['scp://.*'] +:let g:instant_username = "Emi" + +lua << EOF +require'colorizer'.setup() + +require('hop').setup() + +require'nvim-treesitter.configs'.setup { + highlight = { + enable = true, -- false will disable the whole extension + } +} +EOF + +" https://github.com/neoclide/coc.nvim +" Used in keybindings +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +function! ShowDocumentation() + if CocAction('hasProvider', 'hover') + call CocActionAsync('doHover') + else + call feedkeys('K', 'in') + endif +endfunction \ No newline at end of file diff --git a/programs/neovim/laserwave/colors/laserwave.vim b/programs/neovim/laserwave/colors/laserwave.vim new file mode 100644 index 0000000..87e991c --- /dev/null +++ b/programs/neovim/laserwave/colors/laserwave.vim @@ -0,0 +1,58 @@ +" Vim color file +" Maintainer: Bram Moolenaar +" Last Change: 2001 Jul 23 + +" This is the default color scheme. It doesn't define the Normal +" highlighting, it uses whatever the colors used to be. + +" Set 'background' back to the default. The value can't always be estimated +" and is then guessed. +hi clear Normal +set bg& + +" Remove all existing highlighting and set the defaults. +hi clear + +" Load the syntax highlighting defaults, if it's enabled. +if exists("syntax_on") + syntax reset +endif + +hi Normal guibg=#201b27 +hi Comment guifg=#91889b +hi Constant guifg=#ffe261 +hi String guifg=#acdfef +hi Number guifg=#d887f5 +hi Type guifg=#d887f5 +hi Special guifg=#ff52bf +hi Statement guifg=#1ed3ec +hi PreProc guifg=#716385 +hi Todo guifg=black guibg=#ff52bf +hi Identifier guifg=#ffffff +hi Function guifg=#ff52bf +hi Operator guifg=#3feabf +hi Delimiter guifg=#7b6995 + +hi TSProperty guifg=#1ed3ec +hi TSAttribute guifg=#ff52bf +hi TSField guifg=#ff52bf +hi TSTag guifg=#3feabf +hi TSFuncBuiltin guifg=#ffe261 +hi TSTypeBuiltin guifg=#ffe261 +hi TSConstBuiltin guifg=#ffe261 +hi TSVariableBuiltin guifg=#ffe261 + +hi LineNr guifg=grey +hi Pmenu guifg=white guibg=#483051 +hi ColorColumn guibg=#2A2432 + +hi LspDiagnosticsUnderlineError gui=undercurl guisp=#ff52bf +hi LspDiagnosticsUnderlineWarning gui=undercurl guisp=#ffe261 +hi LspDiagnosticsUnderlineInformation gui=undercurl guisp=#1ed3ec +hi LspDiagnosticsUnderlineHint gui=undercurl guisp=#91889b + +hi IndentBlanklineChar guifg=#483051 + +let colors_name = "laserwave" + +" vim: sw=2