aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruser@node5.net <user@node5.net>2025-11-19 19:26:57 +0100
committeruser@node5.net <user@node5.net>2025-11-19 19:26:57 +0100
commitd20aa05e86f42e3017ccf10ad6b1879710ea9395 (patch)
treed9ed694122371b1fcaffa18195dc964bcaab8d3e
Initial commit - Lots of features configured
-rw-r--r--flake.nix370
1 files changed, 370 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..d182e83
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,370 @@
+# Print current config: nvf-print-config nvim | bat --language lua
+# Handy shortcuts
+# leader is space
+# <leader>g show git diff pop up
+# <leader>ld show linter error / warning list at bottom
+# <leader>/ find text in files - grep text in files
+# <leader>. find files - grep files names
+# CTRL+T Terminal
+
+# Handy commands
+# :StripWhitespace - remove unwanted trailing whitespace
+# :Noice command to show a full message history
+
+# TODO Markdown preview new window
+# TODO LSP
+# TODO More git integrations
+# TODO Dashboard
+# TODO Smoothscrolling
+# TODO Undo tree
+# TODO Navigation Breadcrumbs
+
+# DONE Gitgutter
+# DONE Migrate existing
+# DONE smear-cursor
+# DONE Theme dark cool colors
+# DONE Show hidden uneeded whitespacing
+# Done File tabs
+
+{
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
+ nvf.url = "github:notashelf/nvf";
+ };
+
+ outputs = {nixpkgs, ...} @ inputs: let
+ pkgs = nixpkgs.legacyPackages.x86_64-linux;
+ in {
+ packages.x86_64-linux = {
+ # Set the default package to the wrapped instance of Neovim.
+ # This will allow running your Neovim configuration with
+ # `nix run` and in addition, sharing your configuration with
+ # other users in case your repository is public.
+ default =
+ (inputs.nvf.lib.neovimConfiguration {
+ pkgs = nixpkgs.legacyPackages.x86_64-linux;
+ modules = [
+ {
+ config.vim = {
+ # ┌───────┐
+ # │ Theme │
+ # └───────┘
+ highlight = {
+ CursorLineNr.fg="lightblue";
+ CursorLine.bg="#0a0a0a";
+ ColorColumn.bg="#0a0a0a";
+ Normal.bg=null; # Transparent nvim
+ };
+
+
+ theme = {
+ #enable = true;
+ #name = "base16";
+ #base16-colors = {
+ # base00 = "#000000";
+ # base01 = "#131721";
+ # base02 = "#272d38";
+ # base03 = "#3e4b59";
+ # base04 = "#bfbdb6";
+ # base05 = "#e6e1cf";
+ # base06 = "#e6e1cf";
+ # base07 = "#f3f4f5";
+ # base08 = "#f07178";
+ # base09 = "#ff8f40";
+ # base0A = "#ffb454";
+ # base0B = "#b8cc52";
+ # base0C = "#95e6cb";
+ # base0D = "#59c2ff";
+ # base0E = "#d2a6ff";
+ # base0F = "#e6b673";
+ #};
+ };
+
+ # ┌─────────┐
+ # │ Plugins │
+ # └─────────┘
+ # Install plugins that aren't bundled with nvf
+
+ extraPlugins = {
+ smear-cursor = {
+ package = pkgs.vimPlugins.smear-cursor-nvim;
+ setup = ''require('smear_cursor').setup {
+ smear_to_cmd = false;
+ }'';
+ };
+ vim-better-whitespace = {
+ package = pkgs.vimPlugins.vim-better-whitespace;
+ setup = ''
+ vim.g.better_whitespace_filetypes_blacklist = { 'dashboard' } -- Don't show whitespace error on dashboard
+ '';
+ };
+ #semshi = {
+ # package = pkgs.vimPlugins.semshi;
+ # setup = ":UpdateRemotePlugins";
+ #};
+ };
+
+ withPython3 = true; # Needed for semshi python improved python highlighting
+ python3Packages = [ "pynvim" ]; # Needed for semshi python improved python highlighting
+
+ filetree.neo-tree = { # File tree for the side
+ enable = true;
+ setupOpts = {
+ reveal_force_cwd = true;
+ };
+ };
+
+ #mini.statusline.enable = true; # Bottom status line
+ statusline.lualine = { # Bottom status line
+ enable = true;
+ theme = "powerline";
+ activeSection.b = [ # Most of this segment is NVF default, except path
+ ''
+ {
+ "filetype",
+ colored = true,
+ icon_only = true,
+ icon = { align = 'left' }
+ }
+ ''
+ ''
+ {
+ "filename",
+ path = 3, -- Absolute path, with tilde as the home directory
+ symbols = {modified = ' ', readonly = ' '},
+ separator = {right = ''}
+ }
+ ''
+ ''
+ {
+ "",
+ draw_empty = true,
+ separator = { left = '', right = '' }
+ }
+ ''
+ ];
+ };
+
+ binds = {
+ whichKey.enable = true; # Shortcut hint pop-up
+ cheatsheet.enable = true; # A searchable cheatsheet, using Telescope
+ };
+
+ projects.project-nvim.enable = true; # Search projects and cd to them automatically. Trigger: Space+fp
+
+ autocomplete.blink-cmp = { # Code completion pop up
+ enable = true;
+ setupOpts.completion.documentation = {
+ auto_show = true;
+ auto_show_delay_ms = 0;
+ };
+ };
+
+ ui = {
+ colorizer = { # Preview colors
+ enable = true;
+ #setupOpts.user_default_options.RRGGBB = true;
+ setupOpts = {
+ filetypes = {"*" = { };}; # Enable by default for all files
+ filetypes.user_default_options.RRGGBBAA = true;
+ };
+ };
+ #breadcrumbs.enable = true;
+ noice.enable = true; # Cooler notifications :Noice command to show a full message history
+ borders.enable = true;
+ };
+
+ tabline.nvimBufferline = { # File tabs status bar for open file buffers
+ enable = true;
+ setupOpts = {
+ options = {
+ middle_mouse_command = "bd";
+ numbers = "none";
+ always_show_bufferline = false; # Don't show when only one buffer is open
+ };
+ highlights = {
+ tab = {
+ fg = "#aaaaaa";
+ bg = null;
+ };
+ tab_selected = {
+ fg = "#00ffff";
+ bg = null;
+ };
+ };
+ };
+ };
+
+ visuals = {
+ rainbow-delimiters.enable = true;
+ indent-blankline = {
+ enable = true; # Lines that show code nesting indentation
+ setupOpts = {
+ exclude = {
+ filetypes = [ "dashboard" ]; # Don't show indent on dashboard
+ };
+ };
+ };
+ nvim-scrollbar.enable = true; # File scrollbar on the right side
+ };
+
+ telescope = {
+ enable = true; # Grep for code in directory
+ mappings = {
+ liveGrep = "<leader>/";
+ findFiles = "<leader>.";
+ };
+ };
+
+ git = {
+ gitsigns = { # Show changes since last git commit + more shortcuts.
+ enable = true;
+ mappings.previewHunk = "<leader>g"; # Pop up, showing changes since last commit
+ };
+ };
+
+ dashboard.dashboard-nvim = {
+ enable = true;
+ setupOpts = {
+ theme = "hyper";
+ change_to_vcs_root = true;
+ preview = {
+ command = "cat /home/user/dot-files/nix/apps/nvim/neovim_header | lolcat --animate --speed 100 --duration 10";
+ file_path = "/home/user/dot-files/nix/apps/nvim/neovim_header";
+ file_height = 11;
+ file_width = 71;
+ };
+ config = {
+ packages.enable = false; # Don't show how many plugins neovim loaded (It always says 0)
+ shortcut = [
+ {
+ desc = "󰩈 Quit";
+ group = "@property";
+ action = "q";
+ key = "q";
+ }
+ {
+ desc = " New file";
+ group = "@property";
+ action = "enew";
+ key = "n";
+ }
+ ];
+ header = [
+ " <U+E0BA><U+E0B8>"
+ " <U+E0BA>████<U+E0B8> <U+E0BA>██████<U+E0BC> <U+E0BE>█████<U+E0B8> <U+E0BE>██<U+E0BC>"
+ " <U+E0BA>██████<U+E0B8><U+E0BE>█████<U+E0BC> <U+E0BE>█████<U+E0B8> <U+E0B8>"
+ " <U+E0BA>███████<U+E0B8><U+E0BE>██<U+E0BC> <U+E0BA>████████<U+E0BC><U+E0BA>███<U+E0B8><U+E0BE>█████<U+E0B8>███ ███<U+E0B8> <U+E0BA>███<U+E0B8>████<U+E0B8>████<U+E0B8>"
+ " <U+E0BA>█<U+E0B8><U+E0BE>████████<U+E0BC> <U+E0BA>███<U+E0BC> <U+E0BA>█████<U+E0B8><U+E0BE>████████ █████ █████<U+E0BE>████<U+E0BE>█████"
+ " <U+E0BA>███<U+E0B8><U+E0BE>██████<U+E0BC> <U+E0BA>████████<U+E0BC><U+E0BA>██<U+E0BC> <U+E0BE>██<U+E0B8><U+E0BE>███████ █████ █████ ████ █████"
+ " <U+E0BA>██████<U+E0BC><U+E0BE>█████<U+E0BC> <U+E0BA>███<U+E0BC> <U+E0BA>███<U+E0B8> <U+E0BA>███<U+E0B8><U+E0BE>██████ █████ █████ ████ █████<U+E0B8>"
+ " <U+E0BA>██████<U+E0BC> <U+E0BE>███<U+E0BC><U+E0BA>█████████<U+E0B8><U+E0BE>█████████<U+E0BC> <U+E0BE>████<U+E0BC> █████ █████ ████ ██████<U+E0B8>"
+
+ ];
+ };
+ };
+ };
+
+ terminal.toggleterm = {
+ enable = true; # Enable float, bottom, side and tab terminal
+ };
+
+ # ┌─────────┐
+ # │ Options │
+ # └─────────┘
+ options = {
+ tabstop = 2; # Number of spaces that a <Tab> in the file counts for. Also see the :retab command, and the softtabstop option.
+ shiftwidth = 2; # Number of spaces to use for each step of (auto)indent. Used for cindent, >>, <<, etc.
+ scrolloff = 8; # Scroll 8 lines before cursor is a the bottom
+ colorcolumn = "120"; # Color the 120'th column slightly gray
+ cursorlineopt = "both"; # Highlight the text line of the cursor with CursorLine hl-CursorLine
+ wrap = false; # Don't wrap long line
+ cursorline = true; # Highlight current line background & line number
+ };
+
+ # ┌─────┐
+ # │ LSP │
+ # └─────┘
+ lsp = {
+ enable = true;
+ trouble.enable = true; # Side menu with LSP errors showing problem under cursor. Trigger: Space+ld
+ otter-nvim.enable = true;
+ nvim-docs-view.enable = true;
+ mappings = {
+ goToDefinition = "<leader>lgd";
+ };
+ };
+
+ debugger = {
+ nvim-dap = { # Live code runner and debug tool
+ enable = true;
+ ui.enable = true;
+ };
+ };
+
+ languages = {
+ nix.enable = true;
+ python.enable = true;
+ html.enable = true;
+ css.enable = true;
+ clang.enable = true; # Enable C/C++ language support.
+ bash.enable = true;
+ markdown.enable = true;
+ rust.enable = true;
+ sql.enable = true;
+ ts.enable = true; # Enable Typescript/Javascript language support.
+ wgsl.enable = true; # Enable WebGPU language support.
+ yaml.enable = true;
+
+ enableTreesitter = true; # Improved code highlighting
+ markdown.extensions.markview-nvim.enable = true; # Markdown preview
+ };
+ treesitter.context.enable =true;
+
+ minimap = {
+ minimap-vim.enable = false;
+ codewindow.enable = true; # lighter, faster, and uses lua for configuration
+ };
+
+ utility = {
+ preview.markdownPreview.enable = true;
+ undotree.enable = true;
+ };
+
+ # ┌────────────────────┐
+ # │ Custom keybindings │
+ # └────────────────────┘
+ keymaps = [
+ {
+ key = "<leader>t";
+ mode = ["n"];
+ action = ":Neotree toggle dir=./<CR>";
+ desc = "Show file manager";
+ }
+ {
+ key = "<C-Tab>";
+ mode = ["n"];
+ action = ":bnext<CR>";
+ desc = "Switch to next open file buffer";
+ }
+ {
+ key = "<C-S-Tab>";
+ mode = ["n"];
+ action = ":bprevious<CR>";
+ desc = "Switch to previous open file buffer";
+ }
+ ];
+
+ };
+ }
+ ];
+ })
+ .neovim;
+ };
+ };
+}
+
+#environment.systemPackages = with pkgs; [
+# lolcat
+#];
+