Browse Source

nixpkgs/neovim: switch to onedark theme

Thomas Dy 3 năm trước cách đây
mục cha
commit
fd07ed611d

+ 4 - 13
.config/nixpkgs/neovim/flake.nix

@@ -6,25 +6,16 @@
     packages.x86_64-linux.default =
       with nixpkgs.legacyPackages.x86_64-linux;
       let
-        seti-vim = vimUtils.buildVimPlugin {
-          pname = "seti.vim";
-          version = "1.0.0";
-          src = fetchFromGitHub {
-            owner = "trusktr";
-            repo = "seti.vim";
-            rev = "a4781817e75a627b54403a92683516aee6230091";
-            sha256 = "sha256-3XIEKC0fs9v2a73qcbWA+b9gvCbCaHwGs0uoAn9mprg=";
-          };
-        };
-
         extraPath = [
           fzf
+          bat
+          ripgrep
           nodePackages.typescript-language-server
           nodePackages.eslint_d
         ];
       in
       neovim.override {
-        extraMakeWrapperArgs = "--prefix PATH : ${lib.makeBinPath extraPath}";
+        extraMakeWrapperArgs = "--prefix PATH : ${lib.makeBinPath extraPath} --set BAT_THEME OneHalfDark";
         configure = {
           customRC = ''
             source ${./vimrc}
@@ -43,7 +34,7 @@
               fzf-lsp-nvim
               mini-nvim
               gitsigns-nvim
-              seti-vim
+              onedark-nvim
 
               (nvim-treesitter.withPlugins (p: with p; [
                 tree-sitter-css

+ 15 - 7
.config/nixpkgs/neovim/init.lua

@@ -1,3 +1,18 @@
+require('onedark').setup({
+  term_colors = false,
+  transparent = true,
+  highlights = {
+    MiniStatuslineModeNormal = { bg = '$blue', fg = '$black' },
+    MiniStatuslineModeCommand = { bg = '$grey', fg = '$black' },
+    MiniStatuslineModeInsert = { bg = '$green', fg = '$black' },
+    MiniStatuslineModeVisual = { bg = '$orange', fg = '$black' },
+    MiniStatuslineModeReplace = { bg = '$red', fg = '$black' },
+    MiniStatuslineModeOther = { bg = '$green', fg = '$black' },
+    MiniIndentscopeSymbol = { fg = '$bg3' },
+  },
+})
+require('onedark').load()
+
 require('gitsigns').setup()
 
 require('mini.statusline').setup({
@@ -33,13 +48,6 @@ require('nvim-treesitter.configs').setup {
   },
 }
 
-local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
-function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
-  opts = opts or {}
-  opts.border = opts.border or 'single'
-  return orig_util_open_floating_preview(contents, syntax, opts, ...)
-end
-
 vim.diagnostic.config({
   virtual_text = { severity = { min = vim.diagnostic.severity.WARN } }
 })

+ 0 - 19
.config/nixpkgs/neovim/vimrc

@@ -110,22 +110,3 @@ augroup formatting
   autocmd BufWritePre * :%s/\s\+$//e
   autocmd FileType markdown :set tw=80
 augroup end
-
-colorscheme seti
-
-" Use unset background so that syntax-highlighted text does not overwrite the
-" base color. This might cause problems on white backgrounded terminals but I
-" don't use those
-highlight Normal ctermbg=NONE
-
-" Add a background for popups and floats to distinguish from regular text
-highlight Pmenu ctermbg=235 guibg=#282a2b
-highlight link FloatBorder Pmenu
-
-highlight MiniStatuslineModeNormal ctermbg=117 ctermfg=0
-highlight MiniStatuslineModeCommand ctermbg=117 ctermfg=0
-highlight MiniStatuslineModeInsert ctermbg=119 ctermfg=0
-highlight MiniStatuslineModeVisual ctermbg=216 ctermfg=0
-highlight MiniStatuslineModeReplace ctermbg=216 ctermfg=0
-highlight MiniStatuslineModeOther ctermbg=119 ctermfg=0
-highlight link MiniIndentscopeSymbol Comment