From 5b423ab74aca875959e5d5453b2fe008ddcf278e Mon Sep 17 00:00:00 2001 From: Tyler Kelley Date: Tue, 20 Feb 2024 03:00:59 -0600 Subject: [PATCH] Making big improvements to neovim and moving into home as that makes more sense --- config/home/alacritty.nix | 10 +- config/home/default.nix | 1 + config/home/neovim.nix | 189 ++++++++++++++++++++++++++++++++++++++ config/system/default.nix | 1 - config/system/neovim.nix | 136 --------------------------- options.nix | 2 +- system.nix | 6 +- 7 files changed, 201 insertions(+), 144 deletions(-) create mode 100644 config/home/neovim.nix delete mode 100644 config/system/neovim.nix diff --git a/config/home/alacritty.nix b/config/home/alacritty.nix index c02f435..8849159 100644 --- a/config/home/alacritty.nix +++ b/config/home/alacritty.nix @@ -13,7 +13,7 @@ in lib.mkIf (alacritty == true) { decorations = "none"; startup_mode = "Windowed"; dynamic_title = true; - opacity = 0.85; + opacity = 0.6; }; cursor = { style = { @@ -23,10 +23,10 @@ in lib.mkIf (alacritty == true) { }; live_config_reload = true; font = { - normal.family = "JetBrainsMono Nerd Font"; - bold.family = "JetBrainsMono Nerd Font"; - italic.family = "JetBrainsMono Nerd Font"; - bold_italic.family = "JetBrainsMono Nerd Font"; + normal.family = "JetBrainsMono NFM"; + bold.family = "JetBrainsMono NFM"; + italic.family = "JetBrainsMono NFM"; + bold_italic.family = "JetBrainsMono NFM"; size = 14; }; colors = { diff --git a/config/home/default.nix b/config/home/default.nix index f150e03..4f545c7 100644 --- a/config/home/default.nix +++ b/config/home/default.nix @@ -10,6 +10,7 @@ ./kdenlive.nix ./kitty.nix ./neofetch.nix + ./neovim.nix ./packages.nix ./rofi.nix ./starship.nix diff --git a/config/home/neovim.nix b/config/home/neovim.nix new file mode 100644 index 0000000..67cabcb --- /dev/null +++ b/config/home/neovim.nix @@ -0,0 +1,189 @@ +{ config, pkgs, ... }: + +let + plugins = pkgs.vimPlugins; + theme = config.colorScheme.palette; +in { + programs.nixvim = { + enable = true; + + globals.mapleader = " "; # Sets the leader key to space + + options = { + clipboard="unnamedplus"; + number = true; # Show line numbers + relativenumber = true; # Show relative line numbers + shiftwidth = 2; # Tab width should be 2 + softtabstop = 2; + smartindent = true; + wrap = false; + swapfile = false; + backup = false; + hlsearch = false; + incsearch = true; + termguicolors = true; + scrolloff = 8; + updatetime = 50; + }; + + colorschemes.base16.enable = true; + colorschemes.base16.customColorScheme = { + base00 = "#${theme.base00}"; + base01 = "#${theme.base01}"; + base02 = "#${theme.base02}"; + base03 = "#${theme.base03}"; + base04 = "#${theme.base04}"; + base05 = "#${theme.base05}"; + base06 = "#${theme.base06}"; + base07 = "#${theme.base07}"; + base08 = "#${theme.base08}"; + base09 = "#${theme.base09}"; + base0A = "#${theme.base0A}"; + base0B = "#${theme.base0B}"; + base0C = "#${theme.base0C}"; + base0D = "#${theme.base0D}"; + base0E = "#${theme.base0E}"; + base0F = "#${theme.base0F}"; + }; + + plugins = { + barbecue.enable = true; + telescope = { + enable = true; + keymaps = { + "ff" = "find_files"; + }; + }; + neo-tree.enable = true; + indent-blankline.enable = true; + nvim-colorizer.enable = true; + nvim-autopairs.enable = true; + nix.enable = true; + comment-nvim.enable = true; + lualine = { + enable = true; + componentSeparators = { + left = "|"; + right = "|"; + }; + sectionSeparators = { + left = ""; + right = ""; + }; + inactiveSections = { + lualine_a = [ "filename" ]; + lualine_b = null; + lualine_c = null; + lualine_x = null; + lualine_y = null; + lualine_z = [ "location" ]; + }; + sections = { + lualine_a = ["mode" "separator = { left = '' }" "right_padding = 2" ]; + lualine_b = [ "filename" "branch" ]; + lualine_c = [ "fileformat" ]; + lualine_x = [ ]; + lualine_y = [ "filetype" "progress" ]; + lualine_z = [ "location" "separator = { right = '' }" "left_padding = 2" ]; + }; + + }; + startup = { + enable = true; + theme = "dashboard"; + }; + lint = { + enable = true; + lintersByFt = { + text = ["vale"]; + json = ["jsonlint"]; + markdown = ["vale"]; + rst = ["vale"]; + ruby = ["ruby"]; + janet = ["janet"]; + inko = ["inko"]; + clojure = ["clj-kondo"]; + dockerfile = ["hadolint"]; + terraform = ["tflint"]; + typscriptreact = ["prettier_eslint"]; + }; + }; + lsp = { + enable = true; + servers = { + tsserver.enable = true; + lua-ls.enable = true; + bashls.enable = true; + rust-analyzer = { + enable = true; + installRustc = true; + installCargo = true; + }; + nixd.enable = true; + html.enable = true; + ccls.enable = true; + cmake.enable = true; + csharp-ls.enable = true; + cssls.enable = true; + gopls.enable = true; + jsonls.enable = true; + pyright.enable = true; + tailwindcss.enable = true; + }; + }; + lsp-lines.enable = true; + treesitter = { + enable = true; + nixGrammars = true; + }; + nvim-cmp = { + enable = true; + autoEnableSources = true; + sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + ]; + mapping = { + "" = "cmp.mapping.confirm({ select = true })"; + "" = { + action = ''cmp.mapping.select_next_item()''; + modes = [ "i" "s" ]; + }; + }; + }; + }; + + # FOR NEOVIDE + extraConfigLua = '' + vim.opt.guifont = "JetBrainsMono\\ NFM,Noto_Color_Emoji:h14" + vim.g.neovide_cursor_animation_length = 0.05 + ''; + + extraConfigVim = '' + set noshowmode + inoremap jj + ''; + + keymaps = [ + { + mode = "n"; + key = "fb"; + action = "Neotree reveal right"; + options.silent = false; + } + { + key = ""; + action = ":bnext"; + options.silent = false; + } + { + key = ""; + action = ":bprev"; + options.silent = false; + } + ]; + + + }; + } diff --git a/config/system/default.nix b/config/system/default.nix index f7b7ccf..d00e303 100644 --- a/config/system/default.nix +++ b/config/system/default.nix @@ -15,7 +15,6 @@ ./intel-nvidia.nix ./kernel.nix ./logitech.nix - ./neovim.nix ./nfs.nix ./ntp.nix ./nvidia.nix diff --git a/config/system/neovim.nix b/config/system/neovim.nix deleted file mode 100644 index 764158d..0000000 --- a/config/system/neovim.nix +++ /dev/null @@ -1,136 +0,0 @@ -{ config, pkgs, ... }: - -let - plugins = pkgs.vimPlugins; - inherit (import ../../options.nix) theme; -in { - programs.nixvim = { - enable = true; - - plugins = { - telescope.enable = true; - neo-tree.enable = true; - indent-blankline.enable = true; - lualine = { - enable = true; - theme = "auto"; - }; - startup = { - enable = true; - theme = "dashboard"; - userMappings = { - "ff" = "Telescope find_files"; - "s" = "Telescope live_grep"; - "fb" = "Neotree reveal right"; - }; - }; - comment-nvim.enable = true; - lsp = { - enable = true; - servers = { - tsserver.enable = true; - lua-ls.enable = true; - bashls.enable = true; - rust-analyzer = { - enable = true; - installRustc = true; - installCargo = true; - }; - nixd.enable = true; - html.enable = true; - ccls.enable = true; - cmake.enable = true; - csharp-ls.enable = true; - cssls.enable = true; - gopls.enable = true; - jsonls.enable = true; - pyright.enable = true; - tailwindcss.enable = true; - }; - }; - treesitter.enable = true; - nvim-cmp = { - enable = true; - autoEnableSources = true; - sources = [ - { name = "nvim_lsp"; } - { name = "path"; } - { name = "buffer"; } - ]; - mapping = { - "" = "cmp.mapping.confirm({ select = true })"; - "" = { - action = ''cmp.mapping.select_next_item()''; - modes = [ "i" "s" ]; - }; - }; - }; - }; - - extraPlugins = [ - plugins.nvim-base16 - ]; - - globals.mapleader = " "; # Sets the leader key to space - - extraConfigLua = '' - local builtin = require('telescope.builtin') - vim.keymap.set('n', 'ff', builtin.find_files, {}) - vim.keymap.set('n', 's', function() - builtin.grep_string({ search = vim.fn.input("Grep > ") }) - end) - vim.api.nvim_set_option("clipboard","unnamed") - ''; - - extraConfigVim = '' - set noshowmode - colorscheme base16-${theme} - inoremap jj - let s:guifontsize = 16 - let s:guifont = "JetBrainsMono\\ Nerd\\ Font" - " " Copy to clipboard - vnoremap y "+y - nnoremap Y "+yg_ - nnoremap y "+y - nnoremap yy "+yy - - " " Paste from clipboard - nnoremap p "+p - nnoremap P "+P - vnoremap p "+p - vnoremap P "+P - ''; - - keymaps = [ - { - mode = "n"; - key = "tf"; - options.silent = false; - action = "Ex"; - } - { - mode = "n"; - key = "fb"; - options.silent = false; - action = "Neotree reveal right"; - } - ]; - - options = { - number = true; # Show line numbers - relativenumber = true; # Show relative line numbers - shiftwidth = 2; # Tab width should be 2 - softtabstop = 2; - smartindent = true; - wrap = false; - swapfile = false; - backup = false; - hlsearch = false; - incsearch = true; - termguicolors = true; - scrolloff = 8; - updatetime = 50; - }; - - }; - } diff --git a/options.nix b/options.nix index d5cf33c..28c4f61 100644 --- a/options.nix +++ b/options.nix @@ -15,7 +15,7 @@ in { hostname = "${hostname}"; gitUsername = "Tyler Kelley"; gitEmail = "tylerzanekelley@gmail.com"; - theme = "tomorrow-night"; + theme = "catppuccin-mocha"; slickbar = if waybarStyle == "slickbar" then true else false; slickbar-num = if waybarStyle == "slickbar-num" then true else false; simplebar = if waybarStyle == "simplebar" then true else false; diff --git a/system.nix b/system.nix index 30c92e9..3d24f0b 100644 --- a/system.nix +++ b/system.nix @@ -5,11 +5,13 @@ let inherit (import ./options.nix) theLocale theTimezone gitUsername theShell wallpaperDir wallpaperGit - theLCVariables theKBDLayout flakeDir; + theLCVariables theKBDLayout flakeDir + theme; in { imports = [ inputs.nixvim.nixosModules.nixvim + inputs.nix-colors.homeManagerModules.default ./hardware.nix ./config/system ]; @@ -18,6 +20,8 @@ in { networking.hostName = "${hostname}"; # Define your hostname networking.networkmanager.enable = true; + colorScheme = inputs.nix-colors.colorSchemes."${theme}"; + # Set your time zone time.timeZone = "${theTimezone}";